altitude-design 0.1.2 → 0.2.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,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../project/components/src/core.tsx", "../project/components/src/controls.tsx", "../project/components/src/pile.tsx", "../project/components/src/overlays.tsx", "../project/components/src/nav.tsx", "../project/components/src/sheet.tsx", "../project/components/src/command.tsx", "../project/components/src/select.tsx", "../project/components/src/stepper.tsx", "../project/components/src/collections.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport { createPortal } from 'react-dom';\n\n/** useLayoutEffect in the browser, useEffect on the server, where layout effects can't run (React 18 warns about them). */\nexport const useIsoLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 utilities \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport const cx = (...parts: Array<string | false | null | undefined>) => parts.filter(Boolean).join(' ');\n\n/**\n * Mount/unmount with an exit animation. Returns `mounted` (render or not) and\n * `state` (\"open\" | \"closed\") for the data-state attribute. The element first\n * renders in its closed pose, then flips to open two frames later so CSS\n * transitions run; on close it stays mounted for `exitMs`.\n */\nexport function usePresence(open: boolean, exitMs: number) {\n const [mounted, setMounted] = React.useState(open);\n const [state, setState] = React.useState<'open' | 'closed'>(open ? 'open' : 'closed');\n React.useEffect(() => {\n if (open) {\n setMounted(true);\n let r2 = 0;\n const r1 = requestAnimationFrame(() => { r2 = requestAnimationFrame(() => setState('open')); });\n return () => { cancelAnimationFrame(r1); cancelAnimationFrame(r2); };\n }\n setState('closed');\n const t = setTimeout(() => setMounted(false), exitMs);\n return () => clearTimeout(t);\n }, [open, exitMs]);\n return { mounted, state };\n}\n\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (v: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? (value as T) : inner;\n const set = React.useCallback((v: T) => { if (!controlled) setInner(v); onChange?.(v); }, [controlled, onChange]);\n return [current, set] as const;\n}\n\nexport function useOutside(ref: React.RefObject<HTMLElement | null>, active: boolean, onOutside: () => void) {\n React.useEffect(() => {\n if (!active) return;\n const down = (e: PointerEvent) => { if (ref.current && !ref.current.contains(e.target as Node)) onOutside(); };\n const key = (e: KeyboardEvent) => { if (e.key === 'Escape') onOutside(); };\n document.addEventListener('pointerdown', down);\n document.addEventListener('keydown', key);\n return () => { document.removeEventListener('pointerdown', down); document.removeEventListener('keydown', key); };\n }, [active, onOutside, ref]);\n}\n\n/** Spread on an element to make it inert. React 18 passes unknown attributes through as strings and needs ''; React 19\n * knows `inert` as a boolean and treats '' as false. */\nexport const inert = { inert: React.version.split('.')[0] === '18' ? '' : true } as unknown as React.HTMLAttributes<HTMLElement>;\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 keyboard focus \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * A field shows its held rim only when focus arrived from the keyboard; a field you clicked into shows its lit floor and\n * the caret, which is enough when you know where you clicked. Browsers match :focus-visible on text fields after a click\n * too, so one shared listener remembers whether the last input was a key or a pointer and, when focus enters a field\n * (an `.alt-input`, or a whole `.alt-select` with its list), marks it `data-key-focus` until focus leaves it. It's decided\n * as focus arrives, so typing into a field you clicked doesn't add the rim, and clicking a field removes it. Until the\n * first pointer input, focus counts as keyboard, so an autofocused field shows its rim.\n */\nlet keyFocusStarted = false;\nexport function useKeyFocus() {\n React.useEffect(() => {\n if (keyFocusStarted || typeof document === 'undefined') return;\n keyFocusStarted = true;\n let key = true;\n const scope = (t: EventTarget | null) => (t instanceof Element ? t.closest<HTMLElement>('.alt-select') ?? t.closest<HTMLElement>('.alt-input') : null);\n const inside = (s: HTMLElement, t: EventTarget | null) => t instanceof Node && s.contains(t);\n document.addEventListener('keydown', (e) => { if (!e.metaKey && !e.ctrlKey && !e.altKey) key = true; }, true);\n document.addEventListener('pointerdown', (e) => { key = false; scope(e.target)?.removeAttribute('data-key-focus'); }, true);\n document.addEventListener('focusin', (e) => {\n const s = scope(e.target);\n if (!s) return;\n if (key) s.setAttribute('data-key-focus', '');\n else if (!inside(s, e.relatedTarget)) s.removeAttribute('data-key-focus');\n }, true);\n document.addEventListener('focusout', (e) => {\n const s = scope(e.target);\n if (s && !inside(s, e.relatedTarget)) s.removeAttribute('data-key-focus');\n }, true);\n }, []);\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 approach \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * The pointer is felt before it arrives. One shared tracker watches a fine pointer (mouse or pen, never touch) and,\n * for every element marked `data-approach`, writes:\n * --near 0 when the pointer is further than the element's radius (data-approach=\"96\" sets it; default 64px),\n * rising smoothly to 1 when it touches the element;\n * --mx --my where the pointer is on the element (\u22121\u20261 from centre) while it's over it, else 0.\n * Altitude's own components use it only for openings: an empty field (Input, Textarea, Select, Combobox) deepens to\n * receive, and a bottom sheet's finger pull opens under a hand. Raised things never respond to approach and never\n * follow the pointer: a button or a card stays exactly where it is until the pointer is on it. All of it is multiplied\n * by --alt-travel, so reduced motion turns it off. `AltitudeProvider approach={false}` turns it off for a subtree.\n */\nlet approachUsers = 0;\nlet approachStop: (() => void) | null = null;\nfunction startApproach() {\n let x = 0, y = 0, live = false, raf = 0;\n let touched = new Set<HTMLElement>();\n const clear = (el: HTMLElement) => { el.style.removeProperty('--near'); el.style.removeProperty('--mx'); el.style.removeProperty('--my'); };\n const frame = () => {\n raf = 0;\n const els = Array.from(document.querySelectorAll<HTMLElement>('[data-approach]'));\n const rects = els.map((el) => el.getBoundingClientRect()); // read everything first, then write\n const next = new Set<HTMLElement>();\n els.forEach((el, i) => {\n const r = rects[i];\n const radius = Number(el.dataset.approach) || 64;\n const dx = Math.max(r.left - x, 0, x - r.right), dy = Math.max(r.top - y, 0, y - r.bottom);\n const d = Math.hypot(dx, dy);\n if (!live || d >= radius || !r.width || el.closest('[data-approach-off]')) return;\n const t = 1 - d / radius;\n el.style.setProperty('--near', (t * t * (3 - 2 * t)).toFixed(3));\n const inside = d === 0;\n el.style.setProperty('--mx', inside ? (((x - r.left) / r.width) * 2 - 1).toFixed(3) : '0');\n el.style.setProperty('--my', inside ? (((y - r.top) / r.height) * 2 - 1).toFixed(3) : '0');\n next.add(el);\n });\n touched.forEach((el) => { if (!next.has(el)) clear(el); });\n touched = next;\n };\n const schedule = () => { if (!raf) raf = requestAnimationFrame(frame); };\n const move = (e: PointerEvent) => { if (e.pointerType === 'touch') { live = false; } else { live = true; x = e.clientX; y = e.clientY; } schedule(); };\n const leave = (e: PointerEvent) => { if (!e.relatedTarget) { live = false; schedule(); } };\n const blur = () => { live = false; schedule(); };\n window.addEventListener('pointermove', move, { passive: true });\n window.addEventListener('pointerdown', move, { passive: true });\n document.addEventListener('pointerout', leave, { passive: true });\n window.addEventListener('scroll', schedule, { passive: true, capture: true });\n window.addEventListener('blur', blur);\n return () => {\n cancelAnimationFrame(raf);\n window.removeEventListener('pointermove', move); window.removeEventListener('pointerdown', move);\n document.removeEventListener('pointerout', leave); window.removeEventListener('scroll', schedule, { capture: true });\n window.removeEventListener('blur', blur);\n touched.forEach(clear);\n };\n}\n/** Keeps the shared approach tracker running while any component that reacts to it is mounted. */\nexport function useApproach(enabled = true) {\n React.useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n if (approachUsers++ === 0) approachStop = startApproach();\n return () => { if (--approachUsers === 0) { approachStop?.(); approachStop = null; } };\n }, [enabled]);\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 icons (1.75 stroke, Lucide-compatible grid) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype IconProps = React.SVGProps<SVGSVGElement> & { size?: number };\nconst icon = (paths: React.ReactNode) => ({ size = 16, ...rest }: IconProps) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75}\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" {...rest}>{paths}</svg>\n);\nexport const Icons = {\n Check: icon(<path d=\"M5 12.5l4.5 4.5L19 7.5\" />),\n ChevronDown: icon(<path d=\"M6 9l6 6 6-6\" />),\n X: icon(<path d=\"M6 6l12 12M18 6L6 18\" />),\n Info: icon(<><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 11v5M12 8h.01\" /></>),\n CircleCheck: icon(<><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M8.5 12.5l2.5 2.5 4.5-5\" /></>),\n AlertCircle: icon(<><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 7.5v5.5M12 16.5h.01\" /></>),\n AlertTriangle: icon(<><path d=\"M10.3 4.2L2.6 17.5A2 2 0 0 0 4.3 20.5h15.4a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0z\" /><path d=\"M12 9.5v4M12 17h.01\" /></>),\n};\nexport function Spinner({ size = 16 }: { size?: number }) {\n return (\n <svg className=\"alt-spinner\" width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" strokeOpacity=\".25\" strokeWidth=\"2.25\" />\n <path d=\"M21 12a9 9 0 0 0-9-9\" stroke=\"currentColor\" strokeWidth=\"2.25\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 colour math for custom accents \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RGB = [number, number, number];\nconst hexToRgb = (hex: string): RGB => {\n let h = hex.trim().replace('#', '');\n if (h.length === 3 || h.length === 4) h = h.slice(0, 3).split('').map((c) => c + c).join('');\n const n = [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));\n return (n.some(isNaN) ? [255, 255, 255] : n) as RGB;\n};\nconst rgbToHex = (c: number[]) => '#' + c.map((v) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, '0')).join('');\nconst lum = (c: RGB) => {\n const f = (v: number) => { v /= 255; return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; };\n return 0.2126 * f(c[0]) + 0.7152 * f(c[1]) + 0.0722 * f(c[2]);\n};\nexport const contrast = (a: string, b: string) => {\n const la = lum(hexToRgb(a)), lb = lum(hexToRgb(b));\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n};\nconst mix = (a: RGB, b: RGB, t: number) => a.map((v, i) => v + (b[i] - v) * t) as RGB;\n\n/**\n * Derive the four accent tokens from one brand colour, against the surfaces of\n * the active scheme: `accent` (as given), `on-accent` (white or ink, whichever\n * reads at 4.5:1), `accent-ink` (nudged toward ink until it reads at 4.5:1 on\n * every surface passed) and `accent-soft` (a tint of the ground).\n */\nexport function deriveAccent(accent: string, surfaces: string[]) {\n const a = hexToRgb(accent);\n const ground = surfaces[0] || '#ffffff';\n const dark = lum(hexToRgb(ground)) < 0.2;\n const toward: RGB = dark ? [255, 255, 255] : [0, 0, 0];\n let ink = a, t = 0;\n const worst = (c: RGB) => Math.min(...surfaces.filter(Boolean).map((s) => contrast(rgbToHex(c), s)));\n while (t < 1 && worst(ink) < 4.6) { t += 0.03; ink = mix(a, toward, t); }\n const onAccent = contrast('#ffffff', accent) >= 5 ? '#ffffff' : rgbToHex(mix(a, [0, 0, 0], 0.82));\n return {\n '--accent': rgbToHex(a),\n '--on-accent': onAccent,\n '--accent-ink': rgbToHex(ink),\n '--accent-soft': rgbToHex(mix(hexToRgb(ground), a, dark ? 0.2 : 0.13)),\n } as React.CSSProperties;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 provider \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Scheme = 'daylight' | 'nightfall' | 'mesa' | 'alpine';\ntype Ctx = { host: HTMLElement | null; pushLayer: () => () => void };\nconst AltitudeContext = React.createContext<Ctx | null>(null);\nexport const useAltitude = () => React.useContext(AltitudeContext);\n\nexport interface AltitudeProviderProps extends React.HTMLAttributes<HTMLDivElement> {\n scheme?: Scheme;\n accent?: string;\n motion?: 'system' | 'full' | 'reduced';\n /** 'more' renders elevation as hard, high-contrast slabs (offset = height). 'system' follows prefers-contrast. */\n contrast?: 'system' | 'more';\n recede?: boolean;\n /** Openings deepen as the pointer approaches (empty fields, a sheet's finger pull). Default true; reduced motion turns it off regardless. */\n approach?: boolean;\n}\n\nexport function AltitudeProvider({ scheme, accent, motion = 'system', contrast = 'system', recede = true, approach = true, className, style, children, ...rest }: AltitudeProviderProps) {\n const rootRef = React.useRef<HTMLDivElement>(null);\n const [host, setHost] = React.useState<HTMLElement | null>(null);\n const [layers, setLayers] = React.useState(0);\n const [accentVars, setAccentVars] = React.useState<React.CSSProperties | null>(null);\n\n useIsoLayoutEffect(() => {\n if (!accent || !rootRef.current) { setAccentVars(null); return; }\n const el = rootRef.current;\n const compute = () => {\n const cs = getComputedStyle(el);\n const read = (n: string) => cs.getPropertyValue(n).trim();\n setAccentVars(deriveAccent(accent, ['--surface-ground', '--surface-trench', '--surface-raised', '--surface-modal'].map(read)));\n };\n compute();\n const mo = new MutationObserver(compute);\n mo.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });\n return () => mo.disconnect();\n }, [accent, scheme]);\n\n const api = React.useMemo<Ctx>(() => ({\n host,\n pushLayer: () => { setLayers((n) => n + 1); return () => setLayers((n) => n - 1); },\n }), [host]);\n\n return (\n <AltitudeContext.Provider value={api}>\n <div ref={rootRef} className={cx('alt-root', className)} data-theme={scheme}\n data-motion={motion === 'system' ? undefined : motion} data-contrast={contrast === 'more' ? 'more' : undefined}\n data-approach-off={approach ? undefined : ''} style={{ ...accentVars, ...style }} {...rest}>\n <div className=\"alt-stage\" data-receded={recede && layers > 0 ? '' : undefined}>{children}</div>\n <div className=\"alt-layers\" ref={setHost} />\n </div>\n </AltitudeContext.Provider>\n );\n}\n\n/** Renders into the provider's layer host (inside the theme, outside the receding stage), else document.body. */\nexport function Layer({ children }: { children: React.ReactNode }) {\n const ctx = useAltitude();\n const [ready, setReady] = React.useState(false);\n React.useEffect(() => setReady(true), []);\n if (!ready) return null;\n const target = ctx ? ctx.host : document.body;\n return target ? createPortal(children, target) : null;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Depth signals \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * Attention budget: abrupt onsets capture attention, and people track only about\n * four moving things at once. Rises that start together are staggered so no more\n * than four begin within any 250ms window.\n */\nconst riseStarts: number[] = [];\nexport function riseDelay() {\n const now = performance.now();\n while (riseStarts.length && now - riseStarts[0] > 250) riseStarts.shift();\n const delay = Math.max(0, riseStarts.length - 3) * 90;\n riseStarts.push(now + delay);\n return delay;\n}\n\nexport type Presence = 1 | 2 | 3;\nexport interface DepthProps {\n /** Afterglow. Any value: when it changes the surface lifts, tints and settles back over dur-settle. `true` settles once on mount. */\n settle?: unknown;\n /** Commit state of an optimistic write. pending hovers above the ground (after dur-grace), committed lands, failed drops into a trench. */\n status?: 'pending' | 'committed' | 'failed';\n /** Someone is holding this: lifted to level 3 with their presence colour and name. */\n heldBy?: { name: string; presence?: Presence } | null;\n /** Focus+context. match rises one level, miss sinks into a well; nothing is removed. */\n relevance?: 'match' | 'miss';\n}\n\n/** Turns depth signals into the data attributes bundle.css reads. Spread the result onto any surface. */\nexport function useDepth({ settle, status, heldBy, relevance }: DepthProps) {\n const [glow, setGlow] = React.useState<'a' | 'b' | undefined>(undefined);\n const [land, setLand] = React.useState<'a' | 'b' | undefined>(undefined);\n const [delay, setDelay] = React.useState(0);\n const mounted = React.useRef(false);\n const lastStatus = React.useRef(status);\n React.useEffect(() => {\n const first = !mounted.current;\n mounted.current = true;\n if (settle === undefined || settle === null || settle === false) return;\n if (first && settle !== true) return;\n setDelay(riseDelay());\n setGlow((g) => (g === 'a' ? 'b' : 'a'));\n }, [settle]);\n React.useEffect(() => {\n if (lastStatus.current === 'pending' && status === 'committed') setLand((l) => (l === 'a' ? 'b' : 'a'));\n lastStatus.current = status;\n }, [status]);\n return {\n 'data-settle': glow,\n 'data-land': land,\n 'data-status': status,\n 'data-held': heldBy ? '' : undefined,\n 'data-held-by': heldBy?.name,\n 'data-presence': heldBy ? String(heldBy.presence ?? 1) : undefined,\n 'data-relevance': relevance,\n 'aria-busy': status === 'pending' || undefined,\n style: delay ? ({ '--alt-rise-delay': delay + 'ms' } as React.CSSProperties) : undefined,\n };\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Surface \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Level = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5;\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLElement>, DepthProps {\n level?: Level;\n interactive?: boolean;\n as?: keyof React.JSX.IntrinsicElements;\n}\nexport const Surface = React.forwardRef<HTMLElement, SurfaceProps>(function Surface(\n { level = 1, interactive = false, as = 'div', className, settle, status, heldBy, relevance, style, ...rest }, ref) {\n const Comp = as as any;\n const { style: depthStyle, ...depth } = useDepth({ settle, status, heldBy, relevance });\n return <Comp ref={ref} className={cx('alt-surface', interactive && 'alt-lift', className)} data-level={String(level)}\n tabIndex={interactive && rest.onClick && as === 'div' ? 0 : undefined} {...depth} style={{ ...depthStyle, ...style }} {...rest} />;\n});\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Kbd \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface KbdProps extends React.HTMLAttributes<HTMLElement> {\n /** A KeyboardEvent.key (case-insensitive) \u2014 the key presses down while it is held. */\n listen?: string;\n}\nexport function Kbd({ listen, className, children, ...rest }: KbdProps) {\n const [down, setDown] = React.useState(false);\n React.useEffect(() => {\n if (!listen) return;\n const k = listen.toLowerCase();\n const on = (e: KeyboardEvent) => { if (e.key.toLowerCase() === k) setDown(true); };\n const off = (e: KeyboardEvent) => { if (e.key.toLowerCase() === k || e.key === 'Meta') setDown(false); };\n const blur = () => setDown(false);\n window.addEventListener('keydown', on); window.addEventListener('keyup', off); window.addEventListener('blur', blur);\n return () => { window.removeEventListener('keydown', on); window.removeEventListener('keyup', off); window.removeEventListener('blur', blur); };\n }, [listen]);\n return <kbd className={cx('alt-kbd', className)} data-pressed={down ? '' : undefined} {...rest}>{children}</kbd>;\n}\n", "import * as React from 'react';\nimport { cx, DepthProps, Icons, inert, riseDelay, Spinner, useApproach, useControllable, useDepth, useIsoLayoutEffect, useKeyFocus } from './core';\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'primary' | 'secondary' | 'ghost' | 'danger';\n size?: 'sm' | 'md' | 'lg';\n /** Icon-only: a square button. Give it an aria-label. */\n square?: boolean;\n loading?: boolean;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n}\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { variant = 'secondary', size = 'md', square, loading, leading, trailing, className, children, disabled, type = 'button', ...rest }, ref) {\n return (\n <button ref={ref} type={type} className={cx('alt-btn', className)} data-variant={variant} data-size={size}\n data-square={square ? '' : undefined} data-loading={loading ? '' : undefined}\n aria-busy={loading || undefined} disabled={disabled} {...rest}\n onClick={loading ? (e) => e.preventDefault() : rest.onClick}>\n <span className=\"alt-btn-label\">{leading}{children}{trailing}</span>\n {loading && <span className=\"alt-btn-spinner\"><Spinner size={size === 'sm' ? 14 : 16} /></span>}\n </button>\n );\n});\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Card \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface CardProps extends React.HTMLAttributes<HTMLDivElement>, DepthProps {\n /** Lifts on hover and presses on click. Only set it when the whole card does something. */\n interactive?: boolean;\n}\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(\n { interactive, className, onKeyDown, settle, status, heldBy, relevance, style, ...rest }, ref) {\n const actionable = interactive && !!rest.onClick;\n const { style: depthStyle, ...depth } = useDepth({ settle, status, heldBy, relevance });\n return <div ref={ref} className={cx('alt-card', interactive && 'alt-lift', className)}\n role={actionable ? 'button' : undefined} tabIndex={actionable ? 0 : undefined}\n onKeyDown={actionable ? (e) => { onKeyDown?.(e); if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); (e.currentTarget as HTMLElement).click(); } } : onKeyDown}\n {...depth} style={{ ...depthStyle, ...style }} {...rest} />;\n});\nexport const CardHeader = ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => <div className={cx('alt-card-header', className)} {...p} />;\nexport const CardTitle = ({ className, ...p }: React.HTMLAttributes<HTMLHeadingElement>) => <h3 className={cx('alt-card-title', className)} {...p} />;\nexport const CardDescription = ({ className, ...p }: React.HTMLAttributes<HTMLParagraphElement>) => <p className={cx('alt-card-desc', className)} {...p} />;\nexport const CardContent = ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => <div className={cx('alt-card-content', className)} {...p} />;\nexport const CardFooter = ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => <div className={cx('alt-card-footer', className)} {...p} />;\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Input / Textarea / Field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n invalid?: boolean;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n size?: 'sm' | 'md';\n}\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(function Input(\n { invalid, leading, trailing, size = 'md', className, disabled, placeholder, ...rest }, ref) {\n useApproach();\n useKeyFocus();\n return (\n <div className={cx('alt-input', className)} data-size={size} data-approach=\"56\" data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}>\n {leading && <span className=\"alt-input-adorn\">{leading}</span>}\n {/* A placeholder (even a blank one) lets the well know whether it's empty or filled, without JavaScript. */}\n <input ref={ref} disabled={disabled} aria-invalid={invalid || undefined} placeholder={placeholder ?? ' '} {...rest} />\n {trailing && <span className=\"alt-input-adorn\">{trailing}</span>}\n </div>\n );\n});\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n invalid?: boolean;\n /** With maxLength, the well fills from the bottom as the text approaches the limit, and shows a count. Default true. */\n showFill?: boolean;\n}\n/** A deep well. With a maxLength it shows how full it is: a fill line rises from the floor as you type. */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { invalid, className, disabled, placeholder, maxLength, showFill = true, onChange, value, defaultValue, ...rest }, ref) {\n const [len, setLen] = React.useState(() => String(value ?? defaultValue ?? '').length);\n React.useEffect(() => { if (value !== undefined) setLen(String(value).length); }, [value]);\n const gauge = showFill && maxLength ? Math.min(1, len / maxLength) : null;\n const level = gauge === null ? undefined : len >= maxLength! ? 'full' : gauge >= 0.9 ? 'near' : 'ok';\n useApproach();\n useKeyFocus();\n return (\n <div className={cx('alt-input', className)} data-multiline=\"\" data-approach=\"56\" data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}\n data-fill={level} style={gauge !== null ? ({ ['--alt-fill' as any]: gauge } as React.CSSProperties) : undefined}>\n {gauge !== null && <span className=\"alt-input-gauge\" aria-hidden=\"true\" />}\n <textarea ref={ref} disabled={disabled} aria-invalid={invalid || undefined} placeholder={placeholder ?? ' '} maxLength={maxLength}\n value={value} defaultValue={defaultValue} {...rest} onChange={(e) => { setLen(e.target.value.length); onChange?.(e); }} />\n {gauge !== null && <span className=\"alt-input-count\" aria-live=\"polite\">{len} / {maxLength}</span>}\n </div>\n );\n});\n\nexport interface FieldProps {\n label: React.ReactNode;\n hint?: React.ReactNode;\n /** When set, the control turns invalid and the message emerges beneath it. */\n error?: React.ReactNode;\n required?: boolean;\n className?: string;\n children: React.ReactElement<any>;\n}\nexport function Field({ label, hint, error, required, className, children }: FieldProps) {\n const id = React.useId();\n const controlId = children.props.id || id + '-control';\n const describedBy = [hint && id + '-hint', error && id + '-error'].filter(Boolean).join(' ') || undefined;\n return (\n <div className={cx('alt-field', className)}>\n <label className=\"alt-field-label\" htmlFor={controlId}>{label}{required && <span className=\"alt-field-req\" aria-hidden=\"true\"> *</span>}</label>\n {React.cloneElement(children, { id: controlId, 'aria-describedby': describedBy, invalid: !!error || children.props.invalid, required })}\n {hint && !error && <p className=\"alt-field-hint\" id={id + '-hint'}>{hint}</p>}\n {error && <p className=\"alt-field-error\" id={id + '-error'} role=\"alert\"><Icons.AlertCircle size={14} />{error}</p>}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Checkbox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {\n label?: React.ReactNode;\n description?: React.ReactNode;\n indeterminate?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n}\n/** Built like the Switch and RadioGroup: an empty trench when off; checking pours the accent in and sets a raised white check on it. */\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, description, indeterminate, onCheckedChange, onChange, className, disabled, ...rest }, ref) {\n const inner = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => inner.current as HTMLInputElement);\n React.useEffect(() => { if (inner.current) inner.current.indeterminate = !!indeterminate; }, [indeterminate]);\n return (\n <label className={cx('alt-check', className)} data-disabled={disabled ? '' : undefined}>\n <input ref={inner} type=\"checkbox\" disabled={disabled} {...rest}\n onChange={(e) => { onChange?.(e); onCheckedChange?.(e.target.checked); }} />\n <span className=\"alt-check-track\" aria-hidden=\"true\">\n <span className=\"alt-check-fill\" />\n <svg className=\"alt-check-mark\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.25\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path className=\"alt-check-tick\" d=\"M3.5 8.5l3 3 6-6.5\" pathLength={16} />\n <path className=\"alt-check-dash\" d=\"M4 8h8\" pathLength={16} />\n </svg>\n </span>\n {(label || description) && (\n <span className=\"alt-check-text\">\n {label && <span className=\"alt-check-label\">{label}</span>}\n {description && <span className=\"alt-check-desc\">{description}</span>}\n </span>\n )}\n </label>\n );\n});\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 RadioGroup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RadioCtxT = { name: string; value: string; set: (v: string) => void; disabled?: boolean; register: (v: string, el: HTMLElement | null) => void };\nconst RadioCtx = React.createContext<RadioCtxT | null>(null);\nexport interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: string; defaultValue?: string; onValueChange?: (v: string) => void; name?: string; disabled?: boolean;\n orientation?: 'vertical' | 'horizontal';\n}\n/** A switch with several positions: one raised thumb slides to the chosen option and the accent pours in behind it. */\nexport function RadioGroup({ value, defaultValue = '', onValueChange, name, disabled, orientation = 'vertical', className, children, ...rest }: RadioGroupProps) {\n const auto = React.useId();\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const root = React.useRef<HTMLDivElement>(null);\n const slots = React.useRef(new Map<string, HTMLElement>());\n const [bead, setBead] = React.useState<{ x: number; y: number; ready: boolean } | null>(null);\n const register = React.useCallback((val: string, el: HTMLElement | null) => { if (el) slots.current.set(val, el); else slots.current.delete(val); }, []);\n const measure = React.useCallback(() => {\n const el = slots.current.get(v), r = root.current;\n if (!el || !r) { setBead(null); return; }\n const a = el.getBoundingClientRect(), b = r.getBoundingClientRect();\n const x = a.left - b.left + a.width / 2, y = a.top - b.top + a.height / 2;\n setBead((p) => (p && p.x === x && p.y === y ? p : { x, y, ready: !!p }));\n }, [v]);\n useIsoLayoutEffect(() => { measure(); }, [measure]);\n React.useEffect(() => {\n const ro = new ResizeObserver(() => measure());\n if (root.current) ro.observe(root.current);\n document.fonts?.ready.then(() => measure());\n return () => ro.disconnect();\n }, [measure]);\n return (\n <RadioCtx.Provider value={{ name: name || auto, value: v, set, disabled, register }}>\n <div ref={root} role=\"radiogroup\" className={cx('alt-radio-group', className)} data-orientation={orientation} data-disabled={disabled ? '' : undefined} {...rest}>\n {children}\n {bead && (\n <span className=\"alt-radio-thumb\" aria-hidden=\"true\" data-ready={bead.ready ? '' : undefined}\n style={{ transform: `translate(${bead.x}px, ${bead.y}px)` }} />\n )}\n </div>\n </RadioCtx.Provider>\n );\n}\nexport interface RadioProps { value: string; label?: React.ReactNode; description?: React.ReactNode; disabled?: boolean; className?: string }\nexport function Radio({ value, label, description, disabled, className }: RadioProps) {\n const g = React.useContext(RadioCtx);\n const off = disabled || g?.disabled;\n return (\n <label className={cx('alt-check alt-radio', className)} data-disabled={off ? '' : undefined}>\n <input type=\"radio\" name={g?.name} value={value} disabled={off} checked={g ? g.value === value : undefined}\n onChange={() => g?.set(value)} />\n <span className=\"alt-check-track\" data-round=\"\" aria-hidden=\"true\" ref={(el) => g?.register(value, el)}><span className=\"alt-check-fill\" /></span>\n {(label || description) && (\n <span className=\"alt-check-text\">\n {label && <span className=\"alt-check-label\">{label}</span>}\n {description && <span className=\"alt-check-desc\">{description}</span>}\n </span>\n )}\n </label>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Switch \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n checked?: boolean; defaultChecked?: boolean; onCheckedChange?: (v: boolean) => void; label?: React.ReactNode;\n}\nexport function Switch({ checked, defaultChecked = false, onCheckedChange, label, className, disabled, ...rest }: SwitchProps) {\n const [on, set] = useControllable(checked, defaultChecked, onCheckedChange);\n const control = (\n <button type=\"button\" role=\"switch\" aria-checked={on} disabled={disabled} className={cx('alt-switch', !label && className)}\n {...rest} onClick={(e) => { rest.onClick?.(e); set(!on); }}>\n <span className=\"alt-switch-fill\" />\n <span className=\"alt-switch-thumb\" />\n </button>\n );\n if (!label) return control;\n return <label className={cx('alt-switch-row', className)} data-disabled={disabled ? '' : undefined}>{control}<span>{label}</span></label>;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Tabs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype TabsCtxT = { value: string; set: (v: string) => void; id: string; variant: 'folder' | 'segmented'; register: (v: string, el: HTMLButtonElement | null) => void; nodes: React.MutableRefObject<Map<string, HTMLButtonElement>> };\nconst TabsCtx = React.createContext<TabsCtxT | null>(null);\nexport interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n value?: string; defaultValue?: string; onValueChange?: (v: string) => void;\n /**\n * folder (default): each tab is the top edge of its own sheet; the chosen tab and its panel are one raised piece.\n * Put TabsContent directly after TabsList. segmented: the options sit in a well and a raised pill glides between them.\n */\n variant?: 'folder' | 'segmented';\n}\nexport function Tabs({ value, defaultValue = '', onValueChange, variant = 'folder', className, children, ...rest }: TabsProps) {\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const id = React.useId();\n const nodes = React.useRef(new Map<string, HTMLButtonElement>());\n const register = React.useCallback((val: string, el: HTMLButtonElement | null) => { if (el) nodes.current.set(val, el); else nodes.current.delete(val); }, []);\n return <TabsCtx.Provider value={{ value: v, set, id, variant, register, nodes }}><div className={cx('alt-tabs', className)} data-variant={variant} {...rest}>{children}</div></TabsCtx.Provider>;\n}\nexport function TabsList({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>) {\n const t = React.useContext(TabsCtx)!;\n const listRef = React.useRef<HTMLDivElement>(null);\n const pill = t.variant === 'segmented';\n const [ind, setInd] = React.useState<{ x: number; w: number; ready: boolean }>({ x: 0, w: 0, ready: false });\n const measure = React.useCallback(() => {\n if (!pill) return;\n const el = t.nodes.current.get(t.value);\n if (!el) return;\n setInd((p) => ({ x: el.offsetLeft, w: el.offsetWidth, ready: p.w > 0 || p.ready }));\n }, [t.value, t.nodes, pill]);\n useIsoLayoutEffect(() => { measure(); }, [measure]);\n React.useEffect(() => {\n if (!pill) return;\n const ro = new ResizeObserver(measure);\n if (listRef.current) ro.observe(listRef.current);\n document.fonts?.ready.then(measure);\n return () => ro.disconnect();\n }, [measure, pill]);\n const onKeyDown = (e: React.KeyboardEvent) => {\n const keys = [...t.nodes.current.keys()];\n const i = keys.indexOf(t.value);\n const next = e.key === 'ArrowRight' ? keys[(i + 1) % keys.length] : e.key === 'ArrowLeft' ? keys[(i - 1 + keys.length) % keys.length]\n : e.key === 'Home' ? keys[0] : e.key === 'End' ? keys[keys.length - 1] : null;\n if (next) { e.preventDefault(); t.set(next); t.nodes.current.get(next)?.focus(); }\n };\n return (\n <div ref={listRef} role=\"tablist\" className={cx('alt-tabs-list', className)} onKeyDown={onKeyDown} {...rest}>\n {pill && <span className=\"alt-tabs-indicator\" aria-hidden=\"true\" data-ready={ind.ready ? '' : undefined}\n style={{ transform: `translateX(${ind.x}px)`, width: ind.w, opacity: ind.w ? 1 : 0 }} />}\n {children}\n </div>\n );\n}\nexport function TabsTrigger({ value, className, children, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & { value: string }) {\n const t = React.useContext(TabsCtx)!;\n const on = t.value === value;\n return (\n <button ref={(el) => t.register(value, el)} type=\"button\" role=\"tab\" id={`${t.id}-t-${value}`} aria-controls={`${t.id}-p-${value}`}\n aria-selected={on} tabIndex={on ? 0 : -1} className={cx('alt-tabs-trigger', className)} onClick={() => t.set(value)} {...rest}>{children}</button>\n );\n}\nexport function TabsContent({ value, className, ...rest }: React.HTMLAttributes<HTMLDivElement> & { value: string }) {\n const t = React.useContext(TabsCtx)!;\n if (t.value !== value) return null;\n return <div role=\"tabpanel\" id={`${t.id}-p-${value}`} aria-labelledby={`${t.id}-t-${value}`} tabIndex={0} className={cx('alt-tabs-content', className)} {...rest} />;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Slider \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: number; defaultValue?: number; onValueChange?: (v: number) => void;\n min?: number; max?: number; step?: number; disabled?: boolean;\n /** Format the value shown in the bubble that floats above the thumb while dragging. */\n format?: (v: number) => React.ReactNode;\n 'aria-label'?: string;\n}\nexport function Slider({ value, defaultValue = 50, onValueChange, min = 0, max = 100, step = 1, disabled, format = (v) => v, className, ...rest }: SliderProps) {\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const [drag, setDrag] = React.useState(false);\n const track = React.useRef<HTMLDivElement>(null);\n const clamp = (n: number) => Math.min(max, Math.max(min, Math.round((n - min) / step) * step + min));\n const fromX = (x: number) => { const r = track.current!.getBoundingClientRect(); return clamp(min + ((x - r.left) / r.width) * (max - min)); };\n const pct = ((v - min) / (max - min)) * 100;\n return (\n <div className={cx('alt-slider', className)} data-dragging={drag ? '' : undefined} data-disabled={disabled ? '' : undefined}\n onPointerDown={(e) => { if (disabled) return; (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId); setDrag(true); set(fromX(e.clientX)); (e.currentTarget.querySelector('.alt-slider-thumb') as HTMLElement)?.focus(); }}\n onPointerMove={(e) => { if (drag) set(fromX(e.clientX)); }}\n onPointerUp={() => setDrag(false)} onPointerCancel={() => setDrag(false)} {...rest}>\n <div className=\"alt-slider-track\" ref={track}>\n <div className=\"alt-slider-fill\" style={{ width: pct + '%' }} />\n </div>\n <div className=\"alt-slider-thumb\" role=\"slider\" tabIndex={disabled ? -1 : 0} aria-valuemin={min} aria-valuemax={max} aria-valuenow={v}\n aria-label={rest['aria-label']} aria-disabled={disabled || undefined} style={{ left: pct + '%' }}\n onKeyDown={(e) => {\n const big = (max - min) / 10;\n const map: Record<string, number> = { ArrowRight: v + step, ArrowUp: v + step, ArrowLeft: v - step, ArrowDown: v - step, PageUp: v + big, PageDown: v - big, Home: min, End: max };\n if (e.key in map) { e.preventDefault(); set(clamp(map[e.key])); }\n }}>\n <span className=\"alt-slider-bubble\" aria-hidden=\"true\">{format(v)}</span>\n </div>\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Progress \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> { value?: number | null; max?: number; 'aria-label'?: string }\nexport function Progress({ value = null, max = 100, className, ...rest }: ProgressProps) {\n const ind = value === null || value === undefined;\n return (\n <div role=\"progressbar\" aria-valuemin={0} aria-valuemax={max} aria-valuenow={ind ? undefined : value}\n className={cx('alt-progress', className)} data-indeterminate={ind ? '' : undefined} {...rest}>\n <div className=\"alt-progress-fill\" style={ind ? undefined : { width: `${Math.max(0, Math.min(100, (value! / max) * 100))}%` }} />\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Badge \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';\n /**\n * plate (default): an indicator plate set flush into the page. tinted: the plate takes its tone's colour.\n * outline: a hairline only. count: a number that wants attention; it floats above the page and pops when it changes.\n * ('soft' is the old name for tinted.)\n */\n variant?: 'plate' | 'tinted' | 'outline' | 'count' | 'soft';\n /** The indicator lamp. On by default for positive, caution and critical; true on a neutral badge shows an unlit lamp. 'pulse' breathes, for something in progress. */\n lamp?: boolean | 'pulse';\n /** @deprecated Use `lamp`. */\n dot?: boolean;\n}\n/** A label stamped into the record. Status carries a lamp that relights when it changes; a changed label is re-stamped. */\nexport function Badge({ tone = 'neutral', variant = 'plate', lamp, dot, className, children, ...rest }: BadgeProps) {\n const v = variant === 'soft' ? 'tinted' : variant;\n const showLamp = v !== 'count' && !!(lamp ?? (dot || tone === 'positive' || tone === 'caution' || tone === 'critical'));\n const label = typeof children === 'string' || typeof children === 'number' ? String(children) : undefined;\n const [stamp, setStamp] = React.useState<'a' | 'b' | undefined>(undefined);\n const [lit, setLit] = React.useState(0);\n const prev = React.useRef({ tone, label });\n React.useEffect(() => {\n const p = prev.current;\n if (p.label !== label) setStamp((x) => (x === 'a' ? 'b' : 'a'));\n if (p.tone !== tone) setLit((n) => n + 1);\n prev.current = { tone, label };\n }, [tone, label]);\n return (\n <span className={cx('alt-badge', className)} data-tone={tone} data-variant={v} data-stamp={stamp} {...rest}>\n {showLamp && <span key={lit} className=\"alt-badge-lamp\" aria-hidden=\"true\" data-lit={lit ? '' : undefined} data-pulse={lamp === 'pulse' ? '' : undefined} />}\n {children}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Avatar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst TINTS = ['accent', 'positive', 'caution', 'critical'];\nexport interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {\n name: string;\n src?: string;\n size?: number;\n /** Presence as height: active people hover above the page (their shadow drops away), idle ones rest on it, offline ones lie flat and grey. */\n status?: 'active' | 'idle' | 'offline';\n /** Speaking, typing or presenting right now: the avatar drifts gently. */\n live?: boolean;\n /** Ties the person to their presence colour, the same ring they wear on anything they're holding. */\n presence?: 1 | 2 | 3;\n /** The status lamp (green active, amber idle). Default: shown when there is a status and the avatar is 24px or larger. Never shown inside AvatarGroup. */\n lamp?: boolean;\n}\n/** A disc above its own shadow. The gap between them is how high the person is: how present they are right now. */\nexport function Avatar({ name, src, size = 36, status, live, presence, lamp, className, style, onClick, ...rest }: AvatarProps) {\n const initials = name.split(/\\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]!.toUpperCase()).join('');\n const tint = TINTS[[...name].reduce((a, c) => a + c.charCodeAt(0), 0) % TINTS.length];\n const label = [name, status, live && 'live'].filter(Boolean).join(', ');\n const showLamp = (lamp ?? size >= 24) && (status === 'active' || status === 'idle');\n return (\n <span className={cx('alt-avatar', className)} data-tint={tint} data-status={status} data-live={live ? '' : undefined}\n data-presence={presence ? String(presence) : undefined} data-interactive={onClick ? '' : undefined}\n role={onClick ? 'button' : 'img'} tabIndex={onClick ? 0 : undefined} aria-label={label} title={label} onClick={onClick}\n onKeyDown={onClick ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); (e.currentTarget as HTMLElement).click(); } } : undefined}\n style={{ ['--size' as any]: size + 'px', ...style }} {...rest}>\n <span className=\"alt-avatar-shadow\" aria-hidden=\"true\" />\n <span className=\"alt-avatar-face\">{src ? <img src={src} alt=\"\" /> : initials}</span>\n {showLamp && <span className=\"alt-avatar-lamp\" aria-hidden=\"true\" />}\n </span>\n );\n}\nexport function AvatarGroup({ className, children, max, style, ...rest }: React.HTMLAttributes<HTMLDivElement> & { max?: number }) {\n const all = React.Children.toArray(children);\n const shown = max ? all.slice(0, max) : all;\n const extra = all.length - shown.length;\n const size = (shown[0] as any)?.props?.size || 36;\n return (\n <div className={cx('alt-avatar-group', className)} style={{ ['--size' as any]: size + 'px', ...style }} {...rest}>\n {shown}\n {extra > 0 && (\n <span className=\"alt-avatar\" data-tint=\"more\" role=\"img\" aria-label={`${extra} more`} style={{ ['--size' as any]: size + 'px' }}>\n <span className=\"alt-avatar-shadow\" aria-hidden=\"true\" />\n <span className=\"alt-avatar-face\">+{extra}</span>\n </span>\n )}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Skeleton \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** When it turns true, the children rise out of the imprint into place. */\n loaded?: boolean;\n shape?: 'block' | 'text' | 'circle';\n /** For shape=\"text\": how many lines to imprint. */\n lines?: number;\n width?: number | string; height?: number | string; radius?: string;\n}\nconst LINE_WIDTHS = ['100%', '94%', '82%', '97%', '64%'];\n/** An imprint of the content to come, pressed into the page; when the content arrives it rises out of its imprint. */\nexport function Skeleton({ loaded, shape = 'block', lines = 3, width, height, radius, className, style, children, ...rest }: SkeletonProps) {\n const [reveal, setReveal] = React.useState<number | null>(null);\n const was = React.useRef(loaded);\n React.useEffect(() => { if (loaded && !was.current) setReveal(riseDelay()); if (!loaded) setReveal(null); was.current = loaded; }, [loaded]);\n if (loaded) {\n return (\n <div className={cx('alt-reveal', className)} data-reveal={reveal !== null ? '' : undefined}\n style={{ ...(reveal ? { ['--alt-rise-delay' as any]: reveal + 'ms' } : null), ...style }} {...rest}>\n <div className=\"alt-reveal-inner\">{children}</div>\n </div>\n );\n }\n if (shape === 'text') {\n return (\n <div className={cx('alt-skeleton-lines', className)} aria-hidden=\"true\" style={{ width, ...style }} {...rest}>\n {Array.from({ length: lines }, (_, i) => (\n <div key={i} className=\"alt-skeleton\" data-shape=\"text\" style={{ width: i === lines - 1 && lines > 1 ? '60%' : LINE_WIDTHS[i % LINE_WIDTHS.length], height: height ?? 12, ['--i' as any]: i }} />\n ))}\n </div>\n );\n }\n const d = shape === 'circle' ? (width ?? height ?? 40) : undefined;\n return <div className={cx('alt-skeleton', className)} data-shape={shape} aria-hidden=\"true\"\n style={{ width: d ?? width, height: d ?? height ?? 14, borderRadius: radius, ...style }} {...rest} />;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Alert \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst toneIcon = { neutral: Icons.Info, accent: Icons.Info, positive: Icons.CircleCheck, caution: Icons.AlertTriangle, critical: Icons.AlertCircle };\nexport interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, Pick<DepthProps, 'settle'> {\n tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';\n /** flat (default): a sheet laid on the page, it informs. raised: a card above the page, it asks you to act. */\n variant?: 'flat' | 'raised';\n title?: React.ReactNode; action?: React.ReactNode; icon?: React.ReactNode;\n /** Shows a dismiss button; the sheet lifts off the page and the gap closes, then this is called. */\n onDismiss?: () => void;\n}\n/** Status as a sheet laid on the page: it rests on the ground (you can see its edge and its contact shadow) and never floats. When it asks the person to act it becomes a raised card. */\nexport function Alert({ tone = 'neutral', variant = 'flat', title, action, icon, onDismiss, settle, className, style, children, ...rest }: AlertProps) {\n const I = toneIcon[tone];\n const [closing, setClosing] = React.useState(false);\n const { style: depthStyle, ...depth } = useDepth({ settle });\n const dismiss = () => { setClosing(true); window.setTimeout(() => onDismiss?.(), 400); };\n return (\n <div role={tone === 'critical' ? 'alert' : 'status'} className={cx('alt-alert', className)} data-tone={tone} data-variant={variant}\n data-closing={closing ? '' : undefined} {...depth} style={{ ...depthStyle, ...style }} {...rest}>\n <div className=\"alt-alert-inner\">\n <span className=\"alt-alert-icon\" aria-hidden=\"true\">{icon ?? <I size={18} />}</span>\n <div className=\"alt-alert-body\">\n {title && <p className=\"alt-alert-title\">{title}</p>}\n {children && <div className=\"alt-alert-text\">{children}</div>}\n </div>\n {action && <div className=\"alt-alert-action\">{action}</div>}\n {onDismiss && <button type=\"button\" className=\"alt-alert-close\" aria-label=\"Dismiss\" onClick={dismiss}><Icons.X size={14} /></button>}\n </div>\n </div>\n );\n}\n\nexport interface AlertStackProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Alert elements, most important first. Give each a key. */\n children: React.ReactNode;\n expanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Label for the count while stacked. Default \"+N more\". */\n moreLabel?: (hidden: number) => React.ReactNode;\n /** Label for collapsing. Default \"Show less\". */\n lessLabel?: React.ReactNode;\n}\n/**\n * Several alerts as a stack of sheets: the first lies on top and the others peek out beneath it, each tinted by its\n * own tone, with a count. Opening the stack fans them out; dismissing the top one lifts it off and the next comes up.\n */\nexport function AlertStack({ children, expanded, defaultExpanded = false, onExpandedChange, moreLabel = (n) => `+${n} more`, lessLabel = 'Show less', className, ...rest }: AlertStackProps) {\n const list = React.Children.toArray(children).filter(React.isValidElement) as React.ReactElement<AlertProps>[];\n const [open, setOpen] = useControllable(expanded, defaultExpanded, onExpandedChange);\n const topKey = list[0]?.key;\n const prevTop = React.useRef(topKey);\n const [risen, setRisen] = React.useState(0);\n React.useEffect(() => { if (prevTop.current !== topKey) { prevTop.current = topKey; if (topKey != null) setRisen((r) => r + 1); } }, [topKey]);\n const hidden = list.length - 1;\n const all = open || hidden < 1;\n return (\n <div className={cx('alt-alert-stack', className)} data-expanded={all ? '' : undefined} data-sheets={all ? undefined : Math.min(hidden, 2)} {...rest}>\n {all ? list.map((el, i) => <div key={el.key} className=\"alt-alert-stack-item\" style={{ ['--i' as any]: i }}>{el}</div>) : (\n <>\n {list.slice(1, 3).map((el, i) => <span key={el.key} className=\"alt-alert-sheet\" aria-hidden=\"true\" data-tone={el.props.tone ?? 'neutral'} style={{ ['--i' as any]: i + 1 }} />)}\n <div key={String(topKey) + risen} className=\"alt-alert-stack-top\" data-risen={risen ? '' : undefined}>{list[0]}</div>\n </>\n )}\n {hidden > 0 && <button type=\"button\" className=\"alt-alert-more\" aria-expanded={all} onClick={() => setOpen(!open)}>{all ? lessLabel : moreLabel(hidden)}</button>}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Accordion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface AccordionItem { value: string; title: React.ReactNode; content: React.ReactNode }\nexport interface AccordionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n items: AccordionItem[];\n type?: 'single' | 'multiple';\n defaultValue?: string[];\n}\nexport function Accordion({ items, type = 'single', defaultValue = [], className, ...rest }: AccordionProps) {\n const [open, setOpen] = React.useState<string[]>(defaultValue);\n const id = React.useId();\n const toggle = (v: string) => setOpen((o) => o.includes(v) ? o.filter((x) => x !== v) : type === 'single' ? [v] : [...o, v]);\n return (\n <div className={cx('alt-acc', className)} {...rest}>\n {items.map((it) => {\n const on = open.includes(it.value);\n return (\n <div key={it.value} className=\"alt-acc-item\" data-state={on ? 'open' : 'closed'}>\n <h3 className=\"alt-acc-heading\">\n <button type=\"button\" className=\"alt-acc-trigger\" aria-expanded={on} aria-controls={`${id}-${it.value}`} onClick={() => toggle(it.value)}>\n <span>{it.title}</span><Icons.ChevronDown className=\"alt-acc-chevron\" size={18} />\n </button>\n </h3>\n <div className=\"alt-acc-panel\" id={`${id}-${it.value}`} role=\"region\" {...(on ? {} : inert)}>\n <div><div className=\"alt-acc-content\">{it.content}</div></div>\n </div>\n </div>\n );\n })}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 HoldButton \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface HoldButtonProps extends Omit<ButtonProps, 'loading'> {\n /** Called once the button has been held for `duration`. */\n onConfirm: () => void;\n /** Milliseconds. Default 1000 (dur-hold). */\n duration?: number;\n holdingLabel?: React.ReactNode;\n doneLabel?: React.ReactNode;\n /**\n * By default a completed hold is final: the button settles flat, shows doneLabel and can't be pressed again.\n * Set true for actions that can be repeated; the button re-arms after a moment.\n */\n repeatable?: boolean;\n}\n/** Commitment as depth: holding pushes the button down through the ground into a trench. Let go early and it springs back. */\nexport function HoldButton({ onConfirm, duration = 1000, variant = 'danger', holdingLabel, doneLabel, repeatable = false, className, children, style, disabled, onClick, ...rest }: HoldButtonProps) {\n const [state, setState] = React.useState<'idle' | 'holding' | 'done'>('idle');\n const timer = React.useRef<number | undefined>(undefined);\n const done = state === 'done';\n const start = () => {\n if (disabled || state !== 'idle') return;\n setState('holding');\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => {\n setState('done');\n onConfirm();\n if (repeatable) timer.current = window.setTimeout(() => setState('idle'), 1800);\n }, duration);\n };\n const cancel = () => { if (state !== 'holding') return; window.clearTimeout(timer.current); setState('idle'); };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n const label = done ? doneLabel ?? children : state === 'holding' ? holdingLabel ?? children : children;\n return (\n <Button {...rest} disabled={disabled} variant={variant} className={cx('alt-hold', className)} data-hold={state}\n data-final={done && !repeatable ? '' : undefined} aria-disabled={(done && !repeatable) || undefined}\n style={{ ['--alt-hold-dur' as any]: duration + 'ms', ...style }}\n onClick={(e) => { if (done) { e.preventDefault(); return; } onClick?.(e); }}\n onPointerDown={(e) => { if (e.button === 0) start(); }} onPointerUp={cancel} onPointerLeave={cancel} onPointerCancel={cancel}\n onKeyDown={(e) => { if ((e.key === ' ' || e.key === 'Enter') && !e.repeat) { e.preventDefault(); start(); } }}\n onKeyUp={(e) => { if (e.key === ' ' || e.key === 'Enter') cancel(); }}\n onContextMenu={(e) => e.preventDefault()}>\n <span className=\"alt-hold-fill\" aria-hidden=\"true\" />\n <span className=\"alt-hold-text\">{label}</span>\n <span className=\"alt-sr\" aria-live=\"polite\">{state === 'holding' ? 'Keep holding to confirm' : done ? 'Confirmed' : ''}</span>\n </Button>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 ScrollArea \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** A header that sits flush at the top and rises once content scrolls beneath it. */\n header?: React.ReactNode;\n maxHeight?: number | string;\n 'aria-label'?: string;\n}\n/** Overflow as depth: where content continues past an edge, the edge curves away (an inner lip); content passing under the header lifts it. */\nexport function ScrollArea({ header, maxHeight = 280, className, children, ...rest }: ScrollAreaProps) {\n const body = React.useRef<HTMLDivElement>(null);\n const inner = React.useRef<HTMLDivElement>(null);\n const [edges, setEdges] = React.useState({ top: false, bottom: false });\n const update = React.useCallback(() => {\n const el = body.current; if (!el) return;\n const top = el.scrollTop > 1, bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;\n setEdges((p) => (p.top === top && p.bottom === bottom ? p : { top, bottom }));\n }, []);\n useIsoLayoutEffect(() => {\n update();\n const ro = new ResizeObserver(update);\n if (body.current) ro.observe(body.current);\n if (inner.current) ro.observe(inner.current);\n return () => ro.disconnect();\n }, [update]);\n return (\n <div className={cx('alt-scroll', className)} data-top={edges.top ? '' : undefined} data-bottom={edges.bottom ? '' : undefined} {...rest}>\n {header && <div className=\"alt-scroll-header\">{header}</div>}\n <div className=\"alt-scroll-body\" ref={body} onScroll={update} style={{ maxHeight }} tabIndex={0} aria-label={rest['aria-label']}>\n <div ref={inner}>{children}</div>\n </div>\n <span className=\"alt-scroll-lip\" data-edge=\"top\" aria-hidden=\"true\" />\n <span className=\"alt-scroll-lip\" data-edge=\"bottom\" aria-hidden=\"true\" />\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 DropZone \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface DropZoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop'> {\n onFiles?: (files: File[]) => void;\n accept?: string;\n multiple?: boolean;\n /** Force a visual state, for documentation: idle, armed (a file is being dragged somewhere on the page) or over. */\n state?: 'idle' | 'armed' | 'over';\n}\n/** Receptacles open when they're needed: a drop zone is flush until a file is dragged anywhere on the page, then sinks open; over it, it deepens. */\nexport function DropZone({ onFiles, accept, multiple = true, state, className, children, ...rest }: DropZoneProps) {\n const [armed, setArmed] = React.useState(false);\n const [over, setOver] = React.useState(false);\n const [landed, setLanded] = React.useState(0);\n const input = React.useRef<HTMLInputElement>(null);\n const { style: depthStyle, ...depth } = useDepth({ settle: landed || undefined });\n React.useEffect(() => {\n let n = 0;\n const hasFiles = (e: DragEvent) => Array.from(e.dataTransfer?.types || []).includes('Files');\n const enter = (e: DragEvent) => { if (!hasFiles(e)) return; n++; setArmed(true); };\n const leave = (e: DragEvent) => { if (!hasFiles(e)) return; n = Math.max(0, n - 1); if (!n) { setArmed(false); setOver(false); } };\n const end = () => { n = 0; setArmed(false); setOver(false); };\n window.addEventListener('dragenter', enter); window.addEventListener('dragleave', leave);\n window.addEventListener('drop', end); window.addEventListener('dragend', end);\n return () => { window.removeEventListener('dragenter', enter); window.removeEventListener('dragleave', leave); window.removeEventListener('drop', end); window.removeEventListener('dragend', end); };\n }, []);\n const take = (files: File[]) => { if (!files.length) return; onFiles?.(files); setLanded((x) => x + 1); };\n const visual = state ?? (over ? 'over' : armed ? 'armed' : 'idle');\n return (\n <div className={cx('alt-drop', className)} data-drop={visual} role=\"button\" tabIndex={0} {...depth} style={depthStyle}\n onClick={() => input.current?.click()} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); input.current?.click(); } }}\n onDragOver={(e) => { e.preventDefault(); setOver(true); }} onDragLeave={() => setOver(false)}\n onDrop={(e) => { e.preventDefault(); setOver(false); setArmed(false); take(Array.from(e.dataTransfer.files)); }} {...rest}>\n <input ref={input} type=\"file\" hidden accept={accept} multiple={multiple} onChange={(e) => take(Array.from(e.target.files || []))} />\n {children}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 SortableList \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SortableListProps<T> {\n items: T[];\n getKey: (item: T) => string;\n onReorder: (items: T[]) => void;\n renderItem: (item: T, state: { held: boolean }) => React.ReactNode;\n /** Accessible name for each item, used in announcements. */\n getLabel?: (item: T) => string;\n gap?: number;\n className?: string;\n 'aria-label'?: string;\n}\nconst move = <T,>(arr: T[], from: number, to: number) => { const a = arr.slice(); const [x] = a.splice(from, 1); a.splice(to, 0, x); return a; };\n\n/** Possession as depth: the item you pick up comes into your hand (level 3), the slot it will land in opens as a well, and it lands with a settle. */\nexport function SortableList<T>({ items, getKey, onReorder, renderItem, getLabel = (i) => String(getKey(i)), gap = 8, className, ...rest }: SortableListProps<T>) {\n const nodes = React.useRef(new Map<string, HTMLDivElement>());\n const before = React.useRef(new Map<string, number>());\n const start = React.useRef<{ y: number; key: string; from: number; tops: number[]; hs: number[]; id: number } | null>(null);\n const [drag, setDrag] = React.useState<{ key: string; from: number; to: number; dy: number } | null>(null);\n const [kb, setKb] = React.useState<string | null>(null);\n const [msg, setMsg] = React.useState('');\n\n const snapshot = () => { before.current.clear(); nodes.current.forEach((el, k) => before.current.set(k, el.getBoundingClientRect().top)); };\n useIsoLayoutEffect(() => {\n nodes.current.forEach((el, k) => {\n const prev = before.current.get(k); if (prev === undefined) return;\n const d = prev - el.getBoundingClientRect().top;\n if (Math.abs(d) < 0.5) return;\n el.style.transition = 'none'; el.style.transform = `translateY(${d}px)`;\n el.getBoundingClientRect();\n el.style.transition = ''; el.style.transform = '';\n });\n before.current.clear();\n }, [items]);\n\n const keys = items.map(getKey);\n const onPointerDown = (e: React.PointerEvent, key: string, index: number) => {\n if (e.button !== 0) return;\n const els = keys.map((k) => nodes.current.get(k)!);\n start.current = { y: e.clientY, key, from: index, tops: els.map((el) => el.offsetTop), hs: els.map((el) => el.offsetHeight), id: e.pointerId };\n };\n const onPointerMove = (e: React.PointerEvent) => {\n const s = start.current; if (!s) return;\n const dy = e.clientY - s.y;\n if (!drag && Math.abs(dy) < 4) return;\n if (!drag) (e.currentTarget as HTMLElement).setPointerCapture(s.id);\n const center = s.tops[s.from] + s.hs[s.from] / 2 + dy;\n let to = 0;\n s.tops.forEach((t, i) => { if (i !== s.from && t + s.hs[i] / 2 < center) to++; });\n setDrag({ key: s.key, from: s.from, to, dy });\n };\n const onPointerUp = () => {\n const s = start.current; start.current = null;\n if (!drag || !s) { setDrag(null); return; }\n const { from, to } = drag;\n if (from !== to) snapshot();\n setDrag(null);\n if (from !== to) { onReorder(move(items, from, to)); setMsg(`${getLabel(items[from])} moved to position ${to + 1} of ${items.length}.`); }\n };\n const onKeyDown = (e: React.KeyboardEvent, key: string, index: number) => {\n if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); if (kb === key) { setKb(null); setMsg(`${getLabel(items[index])} dropped at position ${index + 1}.`); } else { setKb(key); setMsg(`${getLabel(items[index])} picked up. Use the arrow keys to move it, Space to drop.`); } }\n else if (kb === key && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {\n e.preventDefault();\n const to = Math.max(0, Math.min(items.length - 1, index + (e.key === 'ArrowUp' ? -1 : 1)));\n if (to !== index) { snapshot(); onReorder(move(items, index, to)); setMsg(`Position ${to + 1} of ${items.length}.`); requestAnimationFrame(() => nodes.current.get(key)?.focus()); }\n } else if (e.key === 'Escape' && kb) { setKb(null); }\n };\n\n const s = start.current;\n const h = drag && s ? s.hs[drag.from] + gap : 0;\n const slotTop = drag && s ? (drag.to <= drag.from ? s.tops[drag.to] : s.tops[drag.to] + s.hs[drag.to] - s.hs[drag.from]) : 0;\n return (\n <div className={cx('alt-sort', className)} style={{ gap }} role=\"list\" aria-label={rest['aria-label']} data-dragging={drag ? '' : undefined}>\n {drag && s && <div className=\"alt-sort-slot\" aria-hidden=\"true\" style={{ top: slotTop, height: s.hs[drag.from] }} />}\n {items.map((item, i) => {\n const key = keys[i];\n const held = drag?.key === key || kb === key;\n let shift = 0;\n if (drag && key !== drag.key) {\n if (drag.from < drag.to && i > drag.from && i <= drag.to) shift = -h;\n if (drag.to < drag.from && i >= drag.to && i < drag.from) shift = h;\n }\n const transform = drag?.key === key ? `translateY(${drag.dy}px)` : shift ? `translateY(${shift}px)` : undefined;\n return (\n <div key={key} ref={(el) => { if (el) nodes.current.set(key, el); else nodes.current.delete(key); }} role=\"listitem\" tabIndex={0}\n className=\"alt-sort-item\" data-held={held ? '' : undefined} data-following={drag?.key === key ? '' : undefined}\n aria-roledescription=\"sortable item\" aria-grabbed={held}\n style={{ transform }} onPointerDown={(e) => onPointerDown(e, key, i)} onPointerMove={onPointerMove} onPointerUp={onPointerUp} onPointerCancel={onPointerUp}\n onKeyDown={(e) => onKeyDown(e, key, i)}>\n <span className=\"alt-sort-grip\" aria-hidden=\"true\">\n <svg width=\"12\" height=\"16\" viewBox=\"0 0 12 16\" fill=\"currentColor\"><circle cx=\"3\" cy=\"3\" r=\"1.3\" /><circle cx=\"9\" cy=\"3\" r=\"1.3\" /><circle cx=\"3\" cy=\"8\" r=\"1.3\" /><circle cx=\"9\" cy=\"8\" r=\"1.3\" /><circle cx=\"3\" cy=\"13\" r=\"1.3\" /><circle cx=\"9\" cy=\"13\" r=\"1.3\" /></svg>\n </span>\n <div className=\"alt-sort-body\">{renderItem(item, { held })}</div>\n </div>\n );\n })}\n <span className=\"alt-sr\" aria-live=\"assertive\">{msg}</span>\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, useControllable, useOutside, usePresence } from './core';\n\nexport interface PileProps<T = unknown> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n /** How many items the pile holds; defaults to items.length. 1 \u2192 no sheets, 2\u20133 \u2192 one, 4\u20139 \u2192 two, 10+ \u2192 three. */\n count?: number;\n /** Hover and focus lift the top and fan the sheets. Implied when `items` is set. */\n interactive?: boolean;\n /** The items in the pile. With renderItem, clicking the pile fans these out below it, floating over the page. */\n items?: T[];\n renderItem?: (item: T, state: { index: number }) => React.ReactNode;\n getKey?: (item: T, index: number) => string;\n /** Called when a fanned-out item is clicked. */\n onSelect?: (item: T, index: number) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Tallest the fanned-out list grows before it scrolls. Default 360px. */\n maxHeight?: number | string;\n}\n\n/**\n * Quantity as thickness, and a pile you can fan out. Closed, the sheets beneath say roughly how many\n * (the badge says exactly); reaching for it fans them a little. Click it and the items slide out from under\n * the top card over the page below it, each casting its own shadow; click one to choose it; click the top,\n * press Escape or click away and they slide back.\n */\nexport function Pile<T>({ count, interactive, items, renderItem, getKey, onSelect, open, defaultOpen = false, onOpenChange,\n maxHeight = 360, className, children, ...rest }: PileProps<T>) {\n const n = count ?? items?.length ?? 1;\n const sheets = n <= 1 ? 0 : n <= 3 ? 1 : n <= 9 ? 2 : 3;\n const openable = !!(items && items.length && renderItem);\n const live = interactive || openable;\n const [isOpen, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const { mounted, state } = usePresence(openable && isOpen, 260);\n const root = React.useRef<HTMLDivElement>(null);\n const top = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const toggle = () => { if (openable) setOpen(!isOpen); };\n const close = React.useCallback(() => setOpen(false), [setOpen]);\n useOutside(root, openable && isOpen, close);\n return (\n <div ref={root} className={cx('alt-pile', live && 'alt-pile-live', className)} data-sheets={sheets} data-open={openable && isOpen ? '' : undefined}\n {...rest}>\n {Array.from({ length: sheets }, (_, i) => <span key={i} className=\"alt-pile-sheet\" aria-hidden=\"true\" style={{ ['--i' as any]: i + 1 }} />)}\n <div ref={top} className=\"alt-pile-top\" tabIndex={live ? 0 : undefined} role={openable ? 'button' : undefined}\n aria-expanded={openable ? isOpen : undefined} aria-controls={openable ? id : undefined}\n onClick={toggle} onKeyDown={(e) => { if (openable && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); toggle(); } }}>\n {children}\n </div>\n {n > 1 && <span className=\"alt-pile-count\" aria-label={`${n} items`}>{n}</span>}\n {openable && mounted && (\n <div className=\"alt-pile-list\" id={id} data-state={state}\n onKeyDown={(e) => { if (e.key === 'Escape') { e.stopPropagation(); setOpen(false); top.current?.focus(); } }}>\n <ul className=\"alt-pile-list-inner\" style={{ maxHeight }}>\n {items!.map((it, i) => (\n <li key={getKey ? getKey(it, i) : i}>\n <button type=\"button\" className=\"alt-pile-item\" style={{ ['--i' as any]: Math.min(i, 10) }} onClick={() => onSelect?.(it, i)}>\n {renderItem!(it, { index: i })}\n </button>\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, Layer, useAltitude, useControllable, useIsoLayoutEffect, useOutside, usePresence } from './core';\nimport { Button } from './controls';\n\nconst EXIT_3 = 160; // \u2248 dur-travel-3 \u00D7 0.7\nconst EXIT_4 = 190; // \u2248 dur-travel-4 \u00D7 0.7\nconst EXIT_5 = 220; // \u2248 dur-travel-5 \u00D7 0.7\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nlet lastTipClose = 0; // shared warm-up: once one tooltip has shown, neighbours open instantly\nlet openCard: (() => void) | null = null; // the HoverCard currently open, if any\n\nexport interface TooltipProps {\n content: React.ReactNode;\n side?: 'top' | 'bottom';\n delay?: number;\n defaultOpen?: boolean;\n children: React.ReactElement<any>;\n}\nexport function Tooltip({ content, side = 'top', delay = 450, defaultOpen = false, children }: TooltipProps) {\n const [open, setOpen] = React.useState(defaultOpen);\n const [warm, setWarm] = React.useState(false);\n const timer = React.useRef<number | undefined>(undefined);\n const id = React.useId();\n const { mounted, state } = usePresence(open, EXIT_3);\n const show = () => {\n const isWarm = Date.now() - lastTipClose < 400;\n setWarm(isWarm);\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setOpen(true), isWarm ? 0 : delay);\n };\n const hide = () => { window.clearTimeout(timer.current); setOpen((o) => { if (o) lastTipClose = Date.now(); return false; }); };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <span className=\"alt-tip-anchor\" onPointerEnter={show} onPointerLeave={hide}\n onFocus={() => { window.clearTimeout(timer.current); setWarm(true); setOpen(true); }} onBlur={hide}\n onKeyDown={(e) => { if (e.key === 'Escape') hide(); }}>\n {React.cloneElement(children, { 'aria-describedby': open ? id : undefined })}\n {mounted && <span role=\"tooltip\" id={id} className=\"alt-tip\" data-side={side} data-state={state} data-warm={warm ? '' : undefined}>{content}</span>}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Popover \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface PopoverProps {\n trigger: React.ReactElement<any>;\n children: React.ReactNode;\n open?: boolean; defaultOpen?: boolean; onOpenChange?: (o: boolean) => void;\n side?: 'top' | 'bottom'; align?: 'start' | 'center' | 'end';\n className?: string;\n 'aria-label'?: string;\n}\nexport function Popover({ trigger, children, open, defaultOpen = false, onOpenChange, side = 'bottom', align = 'start', className, ...rest }: PopoverProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const ref = React.useRef<HTMLSpanElement>(null);\n const panel = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const { mounted, state } = usePresence(isOpen, EXIT_3);\n const close = React.useCallback(() => set(false), [set]);\n useOutside(ref, isOpen, close);\n React.useEffect(() => {\n if (state !== 'open' || !panel.current) return;\n const f = panel.current.querySelector<HTMLElement>('input, textarea, select, button, [href], [tabindex]:not([tabindex=\"-1\"])');\n (f || panel.current).focus({ preventScroll: true });\n }, [state]);\n return (\n <span className=\"alt-pop-anchor\" ref={ref}>\n {React.cloneElement(trigger, { 'aria-expanded': isOpen, 'aria-controls': id, 'aria-haspopup': 'dialog', onClick: (e: any) => { trigger.props.onClick?.(e); set(!isOpen); } })}\n {mounted && (\n <div ref={panel} id={id} role=\"dialog\" aria-label={rest['aria-label']} tabIndex={-1} className={cx('alt-pop', className)}\n data-state={state} data-side={side} data-align={align}\n onKeyDown={(e) => { if (e.key === 'Escape') { e.stopPropagation(); close(); (ref.current?.firstElementChild as HTMLElement)?.focus(); } }}>\n {children}\n </div>\n )}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 DropdownMenu \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface MenuItem {\n type?: 'item'; label: React.ReactNode; icon?: React.ReactNode; shortcut?: React.ReactNode; onSelect?: () => void; tone?: 'critical'; disabled?: boolean;\n /** Ephemeral adaptation: predicted items appear at once, the rest fade in over dur-onset. Only worth it when predictions are right most of the time. */\n predicted?: boolean;\n}\nexport type MenuEntry =\n | MenuItem\n | { type: 'separator' }\n | { type: 'label'; label: React.ReactNode };\nexport interface DropdownMenuProps {\n trigger: React.ReactElement<any>;\n items: MenuEntry[];\n align?: 'start' | 'end';\n side?: 'top' | 'bottom';\n defaultOpen?: boolean;\n className?: string;\n}\nexport function DropdownMenu({ trigger, items, align = 'start', side = 'bottom', defaultOpen = false, className }: DropdownMenuProps) {\n const [open, setOpen] = React.useState(defaultOpen);\n const [active, setActive] = React.useState(-1);\n const [hl, setHl] = React.useState<{ y: number; h: number } | null>(null);\n const anchor = React.useRef<HTMLSpanElement>(null);\n const menu = React.useRef<HTMLDivElement>(null);\n const refs = React.useRef<(HTMLDivElement | null)[]>([]);\n const id = React.useId();\n const { mounted, state } = usePresence(open, EXIT_3);\n const close = React.useCallback(() => { setOpen(false); setActive(-1); }, []);\n useOutside(anchor, open, close);\n const enabled = items.map((it, i) => (!it.type || it.type === 'item') && !(it as any).disabled ? i : -1).filter((i) => i >= 0);\n\n useIsoLayoutEffect(() => {\n const el = active >= 0 ? refs.current[active] : null;\n setHl(el ? { y: el.offsetTop, h: el.offsetHeight } : null);\n }, [active, mounted]);\n React.useEffect(() => { if (state === 'open') menu.current?.focus({ preventScroll: true }); }, [state]);\n\n const choose = (i: number) => {\n const it = items[i] as any;\n if (!it || it.disabled) return;\n close();\n (anchor.current?.firstElementChild as HTMLElement)?.focus();\n it.onSelect?.();\n };\n const onKeyDown = (e: React.KeyboardEvent) => {\n const pos = enabled.indexOf(active);\n if (e.key === 'ArrowDown') { e.preventDefault(); setActive(enabled[(pos + 1) % enabled.length]); }\n else if (e.key === 'ArrowUp') { e.preventDefault(); setActive(enabled[(pos - 1 + enabled.length) % enabled.length]); }\n else if (e.key === 'Home') { e.preventDefault(); setActive(enabled[0]); }\n else if (e.key === 'End') { e.preventDefault(); setActive(enabled[enabled.length - 1]); }\n else if ((e.key === 'Enter' || e.key === ' ') && active >= 0) { e.preventDefault(); choose(active); }\n else if (e.key === 'Escape' || e.key === 'Tab') { close(); (anchor.current?.firstElementChild as HTMLElement)?.focus(); }\n };\n let n = 0;\n const activeTone = active >= 0 ? (items[active] as any).tone : undefined;\n return (\n <span className=\"alt-pop-anchor\" ref={anchor}>\n {React.cloneElement(trigger, {\n 'aria-haspopup': 'menu', 'aria-expanded': open, 'aria-controls': id,\n onClick: (e: any) => { trigger.props.onClick?.(e); open ? close() : setOpen(true); },\n onKeyDown: (e: React.KeyboardEvent) => { if (e.key === 'ArrowDown' && !open) { e.preventDefault(); setOpen(true); setActive(enabled[0]); } },\n })}\n {mounted && (\n <div ref={menu} id={id} role=\"menu\" tabIndex={-1} className={cx('alt-pop alt-menu', className)} data-state={state} data-side={side} data-align={align}\n data-ephemeral={items.some((it: any) => it.predicted) ? '' : undefined}\n aria-activedescendant={active >= 0 ? `${id}-${active}` : undefined} onKeyDown={onKeyDown} onPointerLeave={() => setActive(-1)}>\n <span className=\"alt-menu-hl\" aria-hidden=\"true\" data-tone={activeTone}\n style={hl ? { transform: `translateY(${hl.y}px)`, height: hl.h, opacity: 1 } : { opacity: 0 }} />\n {items.map((it, i) => {\n if (it.type === 'separator') return <div key={i} className=\"alt-menu-sep\" role=\"separator\" />;\n if (it.type === 'label') return <div key={i} className=\"alt-menu-label\" style={{ ['--i' as any]: n++ }}>{it.label}</div>;\n const item = it as MenuItem;\n return (\n <div key={i} id={`${id}-${i}`} ref={(el) => { refs.current[i] = el; }} role=\"menuitem\" aria-disabled={item.disabled || undefined}\n className=\"alt-menu-item\" data-tone={item.tone} data-predicted={(item as any).predicted ? '' : undefined} style={{ ['--i' as any]: n++ }}\n onPointerMove={() => !item.disabled && active !== i && setActive(i)} onClick={() => choose(i)}>\n {item.icon && <span className=\"alt-menu-icon\">{item.icon}</span>}\n <span className=\"alt-menu-text\">{item.label}</span>\n {item.shortcut && <span className=\"alt-menu-shortcut\">{item.shortcut}</span>}\n </div>\n );\n })}\n </div>\n )}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 HoverCard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface HoverCardProps {\n /** What you hover or focus: usually a link or an avatar. It must do its own job (navigate, open) without the card. */\n trigger: React.ReactElement<any>;\n children: React.ReactNode;\n /** Default 'bottom'. */\n side?: 'top' | 'bottom';\n /** Default 'start'. */\n align?: 'start' | 'center' | 'end';\n /** Hover intent: how long the pointer must rest before it opens. Default 400ms. */\n openDelay?: number;\n /** How long it stays after the pointer leaves, so the pointer can travel into it. Default 250ms. */\n closeDelay?: number;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n className?: string;\n}\n/**\n * A richer preview that rises from its trigger at level 3, after hover intent or on keyboard focus. It shares Tooltip's\n * warm-up: once one has shown, a neighbour opens at once. Its content is supplementary, never the only way to reach anything.\n */\nexport function HoverCard({ trigger, children, side = 'bottom', align = 'start', openDelay = 400, closeDelay = 250, open, defaultOpen = false, onOpenChange, className }: HoverCardProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const { mounted, state } = usePresence(isOpen, EXIT_3);\n const timer = React.useRef<number | undefined>(undefined);\n const closeMe = React.useRef(() => set(false));\n closeMe.current = () => set(false);\n // One preview at a time: opening a card hands over from whichever card is open (warm, so it's instant).\n React.useEffect(() => {\n if (!isOpen) return;\n const mine = () => closeMe.current();\n if (openCard && openCard !== mine) { openCard(); lastTipClose = Date.now(); }\n openCard = mine;\n return () => { if (openCard === mine) openCard = null; };\n }, [isOpen]);\n const show = (delay: number) => {\n window.clearTimeout(timer.current);\n const warm = Date.now() - lastTipClose < 400;\n timer.current = window.setTimeout(() => set(true), warm ? 0 : delay);\n };\n const hide = (delay: number) => {\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => { set(false); if (isOpen) lastTipClose = Date.now(); }, delay);\n };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <span className=\"alt-pop-anchor alt-hovercard-anchor\"\n onPointerEnter={(e) => { if (e.pointerType !== 'touch') show(openDelay); }}\n onPointerLeave={(e) => { if (e.pointerType !== 'touch') hide(closeDelay); }}\n onFocus={() => show(openDelay)}\n onBlur={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node)) hide(closeDelay); }}\n onKeyDown={(e) => { if (e.key === 'Escape' && isOpen) { e.stopPropagation(); window.clearTimeout(timer.current); set(false); lastTipClose = Date.now(); } }}>\n {trigger}\n {mounted && (\n <div className={cx('alt-pop alt-hovercard', className)} data-state={state} data-side={side} data-align={align}\n onPointerEnter={() => window.clearTimeout(timer.current)}>\n {children}\n </div>\n )}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Modal layers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * One summit: Dialog and CommandPalette sit at level 5, and only one thing may sit there at a time.\n * They register here while open, so others (the palette's \u2318K, a Sheet) can tell the summit is taken.\n */\nlet summits = 0;\nexport const summitTaken = () => summits > 0;\n\nexport interface ModalOptions {\n open: boolean;\n onDismiss: () => void;\n /** How long the closed pose stays mounted (the exit runs at 70% of the entry). */\n exitMs: number;\n panel: React.RefObject<HTMLElement | null>;\n /** Blocks the page: the stage recedes, scroll locks and Tab is trapped. Default true. */\n modal?: boolean;\n /** Escape closes. Default true. */\n dismissible?: boolean;\n /** Takes level 5 (Dialog, CommandPalette). Default false. */\n summit?: boolean;\n /** Move focus into the panel once it has risen. Default true. */\n autoFocus?: boolean;\n focusSelector?: string;\n}\n/**\n * The machinery every layer above the page shares: presence (mount, rise, exit), the receding page,\n * scroll lock, focus in and back out, Escape and the Tab trap. Dialog, Sheet and CommandPalette use it.\n */\nexport function useModal({ open, onDismiss, exitMs, panel, modal = true, dismissible = true, summit = false, autoFocus = true,\n focusSelector = '[data-autofocus], input, textarea, select' }: ModalOptions) {\n const ctx = useAltitude();\n const restore = React.useRef<HTMLElement | null>(null);\n const presence = usePresence(open, exitMs);\n\n React.useEffect(() => {\n if (!open) return;\n restore.current = document.activeElement as HTMLElement;\n const pop = modal ? ctx?.pushLayer() : undefined;\n const prev = document.body.style.overflow;\n if (modal) document.body.style.overflow = 'hidden';\n if (summit) summits++;\n return () => {\n pop?.();\n if (modal) document.body.style.overflow = prev;\n if (summit) summits--;\n if (autoFocus) restore.current?.focus?.({ preventScroll: true });\n };\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n\n React.useEffect(() => {\n if (presence.state !== 'open' || !autoFocus) return;\n let raf = 0;\n const tryFocus = () => {\n if (!panel.current) { raf = requestAnimationFrame(tryFocus); return; }\n const f = panel.current.querySelector<HTMLElement>(focusSelector);\n (f || panel.current).focus({ preventScroll: true });\n };\n tryFocus();\n return () => cancelAnimationFrame(raf);\n }, [presence.state]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape' && dismissible) { e.stopPropagation(); onDismiss(); }\n if (!modal || e.key !== 'Tab' || !panel.current) return;\n const f = [...panel.current.querySelectorAll<HTMLElement>('button, [href], input, textarea, select, [tabindex]:not([tabindex=\"-1\"])')].filter((el) => !el.hasAttribute('disabled'));\n if (!f.length) return;\n const first = f[0], last = f[f.length - 1];\n if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }\n else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }\n };\n return { ...presence, onKeyDown };\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Dialog \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface DialogProps {\n open?: boolean; defaultOpen?: boolean; onOpenChange?: (o: boolean) => void;\n /** Uncontrolled convenience: an element that opens the dialog. */\n trigger?: React.ReactElement<any>;\n title: React.ReactNode;\n description?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n size?: 'sm' | 'md' | 'lg';\n /** Set false for decisions that must be answered: the scrim and Escape won't close it. */\n dismissible?: boolean;\n className?: string;\n}\nexport function Dialog({ open, defaultOpen = false, onOpenChange, trigger, title, description, children, footer, size = 'md', dismissible = true, className }: DialogProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const panel = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const { mounted, state, onKeyDown } = useModal({ open: isOpen, onDismiss: () => set(false), exitMs: EXIT_5, panel, dismissible, summit: true });\n\n return (\n <>\n {trigger && React.cloneElement(trigger, { 'aria-haspopup': 'dialog', onClick: (e: any) => { trigger.props.onClick?.(e); set(true); } })}\n {mounted && (\n <Layer>\n <div className=\"alt-dialog-root\" data-state={state} onKeyDown={onKeyDown}>\n <div className=\"alt-scrim\" onClick={() => dismissible && set(false)} />\n <div ref={panel} role=\"dialog\" aria-modal=\"true\" aria-labelledby={`${id}-t`} aria-describedby={description ? `${id}-d` : undefined}\n tabIndex={-1} className={cx('alt-dialog', className)} data-size={size}>\n <div className=\"alt-dialog-head\">\n <h2 className=\"alt-dialog-title\" id={`${id}-t`}>{title}</h2>\n {description && <p className=\"alt-dialog-desc\" id={`${id}-d`}>{description}</p>}\n </div>\n {children && <div className=\"alt-dialog-body\">{children}</div>}\n {footer && <div className=\"alt-dialog-footer\">{footer}</div>}\n {dismissible && (\n <Button variant=\"ghost\" size=\"sm\" square aria-label=\"Close\" className=\"alt-dialog-close\" onClick={() => set(false)}><Icons.X /></Button>\n )}\n </div>\n </div>\n </Layer>\n )}\n </>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Toast \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type ToastTone = 'neutral' | 'positive' | 'caution' | 'critical';\nexport interface ToastOptions { title: React.ReactNode; description?: React.ReactNode; tone?: ToastTone; duration?: number; action?: { label: string; onClick: () => void } }\ntype ToastItem = ToastOptions & { id: number; leaving?: boolean; entered?: boolean };\n\nlet toasts: ToastItem[] = [];\nlet seq = 0;\nconst subs = new Set<() => void>();\nconst emit = () => subs.forEach((f) => f());\nconst patch = (id: number, p: Partial<ToastItem>) => { toasts = toasts.map((t) => (t.id === id ? { ...t, ...p } : t)); emit(); };\n\nexport function toast(input: ToastOptions | string) {\n const opts = typeof input === 'string' ? { title: input } : input;\n const item: ToastItem = { tone: 'neutral', duration: 5000, ...opts, id: ++seq };\n toasts = [item, ...toasts];\n emit();\n requestAnimationFrame(() => requestAnimationFrame(() => patch(item.id, { entered: true })));\n return item.id;\n}\ntoast.dismiss = (id: number) => {\n patch(id, { leaving: true });\n setTimeout(() => { toasts = toasts.filter((t) => t.id !== id); emit(); }, EXIT_4);\n};\n\nconst toastIcon = { neutral: Icons.Info, positive: Icons.CircleCheck, caution: Icons.AlertTriangle, critical: Icons.AlertCircle };\nconst STACK = 3, GAP = 8;\n\nexport function Toaster({ className }: { className?: string }) {\n const [, force] = React.useReducer((n) => n + 1, 0);\n const [expanded, setExpanded] = React.useState(false);\n const heights = React.useRef(new Map<number, number>());\n React.useEffect(() => { subs.add(force); return () => { subs.delete(force); }; }, []);\n\n // timers: pause while the stack is expanded (hovered or focused)\n React.useEffect(() => {\n if (expanded) return;\n const timers = toasts.filter((t) => !t.leaving && t.duration! > 0).map((t) => setTimeout(() => toast.dismiss(t.id), t.duration));\n return () => timers.forEach(clearTimeout);\n });\n\n const live = toasts.filter((t) => !t.leaving);\n const frontH = live[0] ? heights.current.get(live[0].id) || 64 : 64;\n let offset = 0;\n const total = live.slice(0, 5).reduce((a, t) => a + (heights.current.get(t.id) || 64) + GAP, 0);\n\n return (\n <Layer>\n <section aria-label=\"Notifications\" aria-live=\"polite\" className={cx('alt-toaster', className)}\n style={{ height: expanded ? total : frontH }}\n onPointerEnter={() => setExpanded(true)} onPointerLeave={() => setExpanded(false)}\n onFocus={() => setExpanded(true)} onBlur={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node)) setExpanded(false); }}>\n {toasts.map((t) => {\n const i = live.indexOf(t);\n const h = heights.current.get(t.id) || 64;\n let y: string, s: number, o: number, sh: string, behind = false;\n if (t.leaving) { y = `calc(${-offset}px + 8px * var(--alt-travel))`; s = 0.96; o = 0; sh = 'var(--elev-1)'; }\n else if (!t.entered) { y = 'calc(24px * var(--alt-travel))'; s = 0.96; o = 0; sh = 'var(--elev-1)'; }\n else if (expanded) { y = `${-offset}px`; s = 1; o = i < 5 ? 1 : 0; sh = 'var(--elev-4)'; }\n else { y = `calc(${-i * 10}px * var(--alt-travel) - ${i * 2}px)`; s = 1 - i * 0.05; o = i < STACK ? 1 - i * 0.12 : 0; sh = `var(--elev-${Math.max(2, 4 - i)})`; behind = i > 0; }\n if (!t.leaving && i >= 0) offset += h + GAP;\n const I = toastIcon[t.tone || 'neutral'];\n return (\n <div key={t.id} className=\"alt-toast\" data-tone={t.tone} data-behind={behind ? '' : undefined} role={t.tone === 'critical' ? 'alert' : 'status'}\n ref={(el) => { if (el) { const nh = el.offsetHeight; if (heights.current.get(t.id) !== nh && !behind) { heights.current.set(t.id, nh); } } }}\n style={{ transform: `translateY(${y}) scale(${s})`, opacity: o, boxShadow: sh, zIndex: 100 - Math.max(i, 0), height: behind ? frontH : undefined, pointerEvents: o ? undefined : 'none' }}>\n <span className=\"alt-toast-icon\"><I size={18} /></span>\n <div className=\"alt-toast-body\">\n <p className=\"alt-toast-title\">{t.title}</p>\n {t.description && <p className=\"alt-toast-desc\">{t.description}</p>}\n </div>\n {t.action && <Button size=\"sm\" variant=\"secondary\" className=\"alt-toast-action\" onClick={() => { t.action!.onClick(); toast.dismiss(t.id); }}>{t.action.label}</Button>}\n <button type=\"button\" className=\"alt-toast-close\" aria-label=\"Dismiss\" onClick={() => toast.dismiss(t.id)}><Icons.X size={14} /></button>\n </div>\n );\n })}\n </section>\n </Layer>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons } from './core';\n\nexport interface DrillNode {\n id: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n /** Leaf content. A node with children lists them instead. */\n content?: React.ReactNode;\n children?: DrillNode[];\n}\nexport interface DrilldownProps extends React.HTMLAttributes<HTMLDivElement> {\n root: DrillNode;\n}\n\n/**\n * Hierarchy as a stack. Each place you go into is laid on top of the one before: the breadcrumb\n * builds a staircase \u2014 every step stands on the same ground line and each deeper place is a taller\n * step \u2014 and the view sits on a pile whose thickness is how deep you are. Going back lifts sheets off the top.\n */\nexport function Drilldown({ root, className, ...rest }: DrilldownProps) {\n const [path, setPath] = React.useState<DrillNode[]>([root]);\n const [dir, setDir] = React.useState<'down' | 'up'>('down');\n const [out, setOut] = React.useState<DrillNode | null>(null);\n const view = React.useRef<HTMLDivElement>(null);\n const depth = path.length - 1;\n const current = path[depth];\n React.useEffect(() => { if (!out) return; const t = setTimeout(() => setOut(null), 220); return () => clearTimeout(t); }, [out]);\n const go = (node: DrillNode) => { setDir('down'); setOut(current); setPath([...path, node]); };\n const back = (i: number) => { if (i === depth) return; setDir('up'); setOut(current); setPath(path.slice(0, i + 1)); };\n React.useEffect(() => { view.current?.focus({ preventScroll: true }); }, [current.id]);\n\n const render = (node: DrillNode) => node.children?.length ? (\n <ul className=\"alt-drill-list\">\n {node.children.map((c) => (\n <li key={c.id}>\n <button type=\"button\" className=\"alt-drill-row\" onClick={() => go(c)}>\n <span className=\"alt-drill-row-text\"><span className=\"alt-drill-row-title\">{c.title}</span>{c.description && <span className=\"alt-drill-row-desc\">{c.description}</span>}</span>\n {c.children?.length ? <span className=\"alt-drill-count\">{c.children.length}</span> : null}\n <Icons.ChevronDown className=\"alt-drill-chev\" size={16} />\n </button>\n </li>\n ))}\n </ul>\n ) : <div className=\"alt-drill-leaf\">{node.content}</div>;\n\n const sheets = Math.min(depth, 3);\n return (\n <div className={cx('alt-drill', className)} data-dir={dir} {...rest}>\n <nav className=\"alt-crumbs\" aria-label=\"Location\">\n <ol>\n {path.map((n, i) => (\n <li key={n.id} data-d={Math.min(i, 3)} style={{ ['--d' as any]: i, zIndex: i + 1 }} data-current={i === depth ? '' : undefined} data-new={i === depth && dir === 'down' && i > 0 ? '' : undefined}>\n <button type=\"button\" onClick={() => back(i)} aria-current={i === depth ? 'location' : undefined}>{n.title}</button>\n </li>\n ))}\n </ol>\n </nav>\n <div className=\"alt-pile alt-drill-pile\" data-sheets={sheets}>\n {Array.from({ length: sheets }, (_, i) => <span key={i} className=\"alt-pile-sheet\" aria-hidden=\"true\" style={{ ['--i' as any]: i + 1 }} />)}\n <div className=\"alt-pile-top alt-drill-stage\">\n {out && <div key={'out-' + out.id} className=\"alt-drill-view\" data-phase=\"out\" aria-hidden=\"true\">{render(out)}</div>}\n <div key={current.id} ref={view} tabIndex={-1} className=\"alt-drill-view\" data-phase=\"in\" aria-label={typeof current.title === 'string' ? current.title : undefined}>{render(current)}</div>\n </div>\n </div>\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, Layer, useApproach, useControllable, useIsoLayoutEffect } from './core';\nimport { Button } from './controls';\nimport { summitTaken, useModal } from './overlays';\n\nconst EXIT_4 = 190; // \u2248 dur-travel-4 \u00D7 0.7\n\ntype SheetCtxT = { titleId: string; descId: string; setTitled: (on: boolean) => void; setDescribed: (on: boolean) => void };\nconst SheetCtx = React.createContext<SheetCtxT | null>(null);\n\nexport interface SheetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Uncontrolled convenience: an element that opens the sheet. */\n trigger?: React.ReactElement<any>;\n /** The edge it's anchored to. Default 'right'. */\n side?: 'right' | 'left' | 'bottom';\n /** Width: sm 360, md 440, lg 560px (a bottom sheet: 480, 720, 960px). Default 'md'. */\n size?: 'sm' | 'md' | 'lg';\n /** false: a side panel that doesn't block the page; no scrim, no receding page, no focus trap. Default true. */\n modal?: boolean;\n /** false: only your own controls close it (no Escape, scrim, close button or drag). Default true. */\n dismissible?: boolean;\n}\n\n/**\n * A large sheet laid over the page at level 4, anchored to an edge. It rises at that edge (16px of travel at most,\n * a fade, its shadow growing from elev-1 to elev-4) while the page recedes behind it; closing lifts it off.\n */\nexport function Sheet({ open, defaultOpen = false, onOpenChange, trigger, side = 'right', size = 'md', modal = true, dismissible = true,\n className, style, children, ...rest }: SheetProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const panel = React.useRef<HTMLDivElement>(null);\n const scroller = React.useRef<HTMLDivElement>(null);\n const inner = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const [titled, setTitled] = React.useState(false);\n const [described, setDescribed] = React.useState(false);\n const [edges, setEdges] = React.useState({ top: false, bottom: false });\n const [drag, setDrag] = React.useState<{ dy: number; leaving?: boolean } | null>(null);\n const pull = React.useRef<{ y: number; t: number } | null>(null);\n // Layer mounts its portal a render later; measuring waits for the panel to exist.\n const [panelEl, setPanelEl] = React.useState<HTMLDivElement | null>(null);\n const panelRef = React.useCallback((el: HTMLDivElement | null) => { (panel as React.MutableRefObject<HTMLDivElement | null>).current = el; setPanelEl(el); }, []);\n // One summit: a sheet never opens above a Dialog or the CommandPalette. If it's opened under one anyway, it\n // paints beneath it (z-overlay < z-modal) and leaves focus where it is.\n const underSummit = React.useMemo(() => isOpen && summitTaken(), [isOpen]);\n const close = React.useCallback(() => set(false), [set]);\n const { mounted, state, onKeyDown } = useModal({ open: isOpen, onDismiss: close, exitMs: EXIT_4, panel, modal, dismissible, autoFocus: !underSummit });\n useApproach(side === 'bottom' && dismissible);\n React.useEffect(() => { if (isOpen) setDrag(null); }, [isOpen]);\n\n const measure = React.useCallback(() => {\n const el = scroller.current;\n if (!el) return;\n const top = el.scrollTop > 1, bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;\n setEdges((p) => (p.top === top && p.bottom === bottom ? p : { top, bottom }));\n }, []);\n useIsoLayoutEffect(() => {\n if (!panelEl) return;\n measure();\n const ro = new ResizeObserver(measure);\n if (scroller.current) ro.observe(scroller.current);\n if (inner.current) ro.observe(inner.current);\n return () => ro.disconnect();\n }, [panelEl, measure]);\n\n // A bottom sheet can be pulled down by its finger pull; past a third of its height (or flicked), it goes.\n const onPullDown = (e: React.PointerEvent) => {\n if (!dismissible || e.button !== 0) return;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n pull.current = { y: e.clientY, t: performance.now() };\n setDrag({ dy: 0 });\n };\n const onPullMove = (e: React.PointerEvent) => {\n const p = pull.current;\n if (!p) return;\n const raw = e.clientY - p.y;\n setDrag({ dy: raw > 0 ? raw : Math.max(-8, raw / 4) });\n };\n const onPullUp = (e: React.PointerEvent) => {\n const p = pull.current;\n pull.current = null;\n if (!p) return;\n const dy = e.clientY - p.y, v = dy / Math.max(1, performance.now() - p.t), h = panel.current?.offsetHeight || 320;\n if (dy > Math.min(160, h / 3) || (dy > 24 && v > 0.6)) { setDrag({ dy, leaving: true }); close(); } else setDrag(null);\n };\n\n const ctx = React.useMemo<SheetCtxT>(() => ({ titleId: `${id}-t`, descId: `${id}-d`, setTitled, setDescribed }), [id]);\n const dragging = !!drag && !drag.leaving && !!pull.current;\n const dragStyle: React.CSSProperties | undefined = drag\n ? drag.leaving ? { transform: `translateY(${drag.dy + 24}px)` } : { transform: `translateY(${drag.dy}px)`, transition: dragging ? 'none' : undefined }\n : undefined;\n return (\n <>\n {trigger && React.cloneElement(trigger, {\n 'aria-haspopup': 'dialog', 'aria-expanded': isOpen,\n onClick: (e: any) => { trigger.props.onClick?.(e); set(modal ? true : !isOpen); },\n })}\n {mounted && (\n <Layer>\n <SheetCtx.Provider value={ctx}>\n <div className=\"alt-sheet-root\" data-state={state} data-exit={!isOpen ? '' : undefined} data-modal={modal ? '' : undefined} onKeyDown={onKeyDown}>\n {modal && <div className=\"alt-scrim\" onClick={() => dismissible && close()} />}\n <div ref={panelRef} role=\"dialog\" aria-modal={modal || undefined} aria-labelledby={titled ? ctx.titleId : undefined}\n aria-describedby={described ? ctx.descId : undefined} tabIndex={-1} className={cx('alt-sheet', className)}\n data-side={side} data-size={size} data-top={edges.top ? '' : undefined} data-bottom={edges.bottom ? '' : undefined}\n data-dragging={dragging ? '' : undefined} style={{ ...style, ...dragStyle }} {...rest}>\n {side === 'bottom' && dismissible && (\n <span className=\"alt-sheet-pull\" aria-hidden=\"true\" data-approach=\"48\"\n onPointerDown={onPullDown} onPointerMove={onPullMove} onPointerUp={onPullUp} onPointerCancel={onPullUp} />\n )}\n <div className=\"alt-sheet-scroll\" ref={scroller} onScroll={measure}>\n <div className=\"alt-sheet-inner\" ref={inner}>{children}</div>\n </div>\n {dismissible && (\n <Button variant=\"ghost\" size=\"sm\" square aria-label=\"Close\" className=\"alt-sheet-close\" onClick={close}><Icons.X /></Button>\n )}\n </div>\n </div>\n </SheetCtx.Provider>\n </Layer>\n )}\n </>\n );\n}\n\n/** The title block. It stays at the top while the sheet scrolls, and rises once content passes under it. */\nexport function SheetHeader({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cx('alt-sheet-header', className)} {...p} />;\n}\nexport function SheetTitle({ className, ...p }: React.HTMLAttributes<HTMLHeadingElement>) {\n const c = React.useContext(SheetCtx);\n React.useEffect(() => { c?.setTitled(true); return () => c?.setTitled(false); }, [c]);\n return <h2 id={c?.titleId} className={cx('alt-sheet-title', className)} {...p} />;\n}\nexport function SheetDescription({ className, ...p }: React.HTMLAttributes<HTMLParagraphElement>) {\n const c = React.useContext(SheetCtx);\n React.useEffect(() => { c?.setDescribed(true); return () => c?.setDescribed(false); }, [c]);\n return <p id={c?.descId} className={cx('alt-sheet-desc', className)} {...p} />;\n}\n/** Actions, right-aligned. It stays at the bottom; where content continues beneath it, its top edge curves away. */\nexport function SheetFooter({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cx('alt-sheet-footer', className)} {...p} />;\n}\n", "import * as React from 'react';\nimport { cx, Kbd, Layer, riseDelay, useControllable, useIsoLayoutEffect } from './core';\nimport { Input } from './controls';\nimport { summitTaken, useModal } from './overlays';\n\nconst EXIT_5 = 220; // \u2248 dur-travel-5 \u00D7 0.7\n\nexport interface CommandItem {\n /** Stable key within its group. Defaults to the label. */\n id?: string;\n label: string;\n /** A short second line of context (a path, a branch). Matched with less weight than the label. */\n description?: string;\n icon?: React.ReactNode;\n /** Keys shown as Kbd hints, e.g. ['\u2318', 'D']. Display only: bind the shortcut yourself. */\n shortcut?: string[];\n /** Other words that should find this item (synonyms, old names). */\n keywords?: string[];\n onSelect?: () => void;\n disabled?: boolean;\n tone?: 'critical';\n /** Ephemeral adaptation: on opening, predicted items are there at once while the rest fade in over dur-onset. */\n predicted?: boolean;\n}\nexport interface CommandGroup {\n /** Stable key. Defaults to the group's position. */\n id?: string;\n label?: React.ReactNode;\n items: CommandItem[];\n /** Every item in the group is predicted: a \"Recent\" or \"Suggested\" group. */\n predicted?: boolean;\n}\nexport interface CommandPaletteProps {\n items: CommandGroup[];\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Called with the chosen item (after its own onSelect). */\n onSelect?: (item: CommandItem, group: CommandGroup) => void;\n placeholder?: string;\n /** Score an item against the query: 0 hides it, higher ranks it nearer the top. Replaces the built-in fuzzy match. */\n filter?: (item: CommandItem, query: string) => number;\n /** Shown when nothing matches. A function receives the query. */\n empty?: React.ReactNode | ((query: string) => React.ReactNode);\n /** The letter that opens and closes the palette with \u2318 (macOS) or Ctrl. Default 'k'; false for none. */\n shortcut?: string | false;\n onQueryChange?: (query: string) => void;\n /** Close once an item is chosen. Default true. */\n closeOnSelect?: boolean;\n /** The key hints along the bottom. Default true. */\n hints?: boolean;\n className?: string;\n 'aria-label'?: string;\n}\n\n/**\n * The built-in ranking. 0 means no match. An exact match beats a prefix, a prefix beats a word start, a word start\n * beats a substring, and a substring beats letters found in order (fewer gaps rank higher).\n */\nexport function commandScore(text: string, query: string): number {\n const t = text.toLowerCase(), q = query.toLowerCase().trim();\n if (!q) return 1;\n if (t === q) return 100;\n if (t.startsWith(q)) return 80;\n if (t.split(/[\\s\\-_/.:@]+/).some((w) => w.startsWith(q))) return 60;\n const i = t.indexOf(q);\n if (i >= 0) return 40 - Math.min(i, 20) * 0.5;\n let from = 0, last = -1, gaps = 0;\n for (const ch of q.replace(/\\s+/g, '')) {\n const f = t.indexOf(ch, from);\n if (f < 0) return 0;\n if (last >= 0) gaps += f - last - 1;\n last = f; from = f + 1;\n }\n return Math.max(1, 20 - gaps * 0.5);\n}\nconst itemScore = (item: CommandItem, q: string) => {\n let s = commandScore(item.label, q);\n for (const k of item.keywords || []) s = Math.max(s, commandScore(k, q) * 0.9);\n if (item.description) s = Math.max(s, commandScore(item.description, q) * 0.6);\n return s;\n};\n\n/** Which letters of the label matched: one run (preferring a word start), else the letters in order. */\nfunction matchRanges(label: string, query: string): Array<[number, number]> {\n const t = label.toLowerCase(), q = query.toLowerCase().trim();\n if (!q) return [];\n let at = -1;\n for (let i = t.indexOf(q); i >= 0; i = t.indexOf(q, i + 1)) {\n if (i === 0 || /[\\s\\-_/.:@]/.test(t[i - 1])) { at = i; break; }\n if (at < 0) at = i;\n }\n if (at >= 0) return [[at, at + q.length]];\n const out: Array<[number, number]> = [];\n let from = 0;\n for (const ch of q.replace(/\\s+/g, '')) {\n const f = t.indexOf(ch, from);\n if (f < 0) return [];\n const prev = out[out.length - 1];\n if (prev && prev[1] === f) prev[1] = f + 1; else out.push([f, f + 1]);\n from = f + 1;\n }\n return out;\n}\nfunction Marked({ text, ranges }: { text: string; ranges: Array<[number, number]> }) {\n if (!ranges.length) return <>{text}</>;\n const parts: React.ReactNode[] = [];\n let i = 0;\n ranges.forEach(([a, b], k) => { if (a > i) parts.push(text.slice(i, a)); parts.push(<mark key={k} className=\"alt-cmd-match\">{text.slice(a, b)}</mark>); i = b; });\n if (i < text.length) parts.push(text.slice(i));\n return <>{parts}</>;\n}\n\nconst SearchIcon = () => (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" /><path d=\"M20 20l-3.5-3.5\" />\n </svg>\n);\nconst ms = (cs: CSSStyleDeclaration, name: string, fallback: number) => parseFloat(cs.getPropertyValue(name)) || fallback;\n\ntype Row = { key: string; item: CommandItem; group: CommandGroup; predicted: boolean };\n\n/**\n * The summit: a level-5 search over everything you can do, opened with \u2318K or Ctrl+K. The page recedes behind it\n * as it does for Dialog. The query field is an opening built like Input; one highlight glides between results;\n * when results change, surviving rows travel to their new places and new ones rise in, a few at a time.\n */\nexport function CommandPalette({ items, open, defaultOpen = false, onOpenChange, onSelect, placeholder = 'Type a command or search\u2026', filter, empty,\n shortcut = 'k', onQueryChange, closeOnSelect = true, hints = true, className, ...rest }: CommandPaletteProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const [query, setQuery] = React.useState('');\n const [active, setActive] = React.useState(0);\n const [onset, setOnset] = React.useState(true);\n const [said, setSaid] = React.useState('');\n const panel = React.useRef<HTMLDivElement>(null);\n const viewport = React.useRef<HTMLDivElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const sizer = React.useRef<HTMLDivElement>(null);\n const rowEls = React.useRef(new Map<string, HTMLElement>());\n const prevTops = React.useRef<Map<string, number> | null>(null);\n const byKeyboard = React.useRef(false);\n // Layer mounts its portal a render later; effects that measure rows wait for the panel to exist.\n const [panelEl, setPanelEl] = React.useState<HTMLDivElement | null>(null);\n const panelRef = React.useCallback((el: HTMLDivElement | null) => { (panel as React.MutableRefObject<HTMLDivElement | null>).current = el; setPanelEl(el); }, []);\n const id = React.useId();\n const close = React.useCallback(() => set(false), [set]);\n const { mounted, state, onKeyDown } = useModal({ open: isOpen, onDismiss: close, exitMs: EXIT_5, panel, summit: true });\n\n // \u2318K / Ctrl+K toggles it, unless something else holds the summit.\n React.useEffect(() => {\n if (!shortcut) return;\n const key = shortcut.toLowerCase();\n const on = (e: KeyboardEvent) => {\n if (!(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey || e.key.toLowerCase() !== key) return;\n if (isOpen) { e.preventDefault(); set(false); } else if (!summitTaken()) { e.preventDefault(); set(true); }\n };\n window.addEventListener('keydown', on);\n return () => window.removeEventListener('keydown', on);\n }, [shortcut, isOpen, set]);\n React.useEffect(() => { if (isOpen) { setQuery(''); setActive(0); setOnset(true); } }, [isOpen]);\n\n // Rank: within each group by score, and groups by their best item, so the best match is on top.\n const q = query.trim();\n const score = filter ?? itemScore;\n const view = items.map((g, gi) => {\n let rows = g.items.map((item, ii) => ({ item, ii, s: q ? score(item, q) : 1 }));\n if (q) rows = rows.filter((r) => r.s > 0).sort((a, b) => b.s - a.s || a.ii - b.ii);\n return { g, gk: g.id ?? String(gi), gi, rows, best: rows[0]?.s ?? 0 };\n }).filter((v) => v.rows.length);\n if (q) view.sort((a, b) => b.best - a.best || a.gi - b.gi);\n const flat: Row[] = [];\n view.forEach((v) => v.rows.forEach(({ item }) => flat.push({ key: `${v.gk}:${item.id ?? item.label}`, item, group: v.g, predicted: !!(item.predicted || v.g.predicted) })));\n const enabled = flat.filter((r) => !r.item.disabled);\n const act = enabled.length ? Math.min(active, enabled.length - 1) : -1;\n const activeRow = act >= 0 ? enabled[act] : null;\n const rowsKey = view.map((v) => v.gk + '[' + v.rows.map((r) => r.item.id ?? r.item.label).join('|') + ']').join(',');\n const ephemeral = onset && !q && flat.some((r) => r.predicted);\n\n // Results that change travel instead of blinking (FLIP); new rows rise in, the best few within the attention budget.\n useIsoLayoutEffect(() => {\n const host = list.current;\n if (!host) { prevTops.current = null; return; }\n const els = Array.from(host.querySelectorAll<HTMLElement>('[data-flip]'));\n const now = new Map<string, number>();\n els.forEach((el) => now.set(el.dataset.flip!, el.offsetTop));\n const before = prevTops.current;\n prevTops.current = now;\n if (viewport.current) viewport.current.scrollTop = 0;\n if (!before) return;\n const cs = getComputedStyle(host);\n const still = parseFloat(cs.getPropertyValue('--alt-travel')) === 0;\n const glide = { duration: ms(cs, '--dur-travel-2', 180), easing: cs.getPropertyValue('--ease-glide').trim() || 'ease' };\n const rise = { duration: ms(cs, '--dur-travel-1', 140), easing: cs.getPropertyValue('--ease-rise').trim() || 'ease-out' };\n // What will be visible once the list has grown to fit: its own cap, not its height before the change.\n const seen = viewport.current ? parseFloat(getComputedStyle(viewport.current).maxHeight) || viewport.current.clientHeight : 400;\n let rising = 0;\n els.forEach((el) => {\n const k = el.dataset.flip!, top = now.get(k)!, was = before.get(k);\n if (was === undefined) {\n if (!still && k.startsWith('o:') && rising < 6 && top < seen) {\n rising++;\n el.animate([{ opacity: 0, transform: 'translateY(4px)' }, { opacity: 1, transform: 'none' }], { ...rise, delay: riseDelay(), fill: 'backwards' });\n } else el.animate([{ opacity: 0 }, { opacity: 1 }], rise);\n } else if (!still && Math.abs(was - top) > 0.5) {\n el.animate([{ transform: `translateY(${was - top}px)` }, { transform: 'none' }], glide);\n }\n });\n }, [rowsKey, panelEl]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // The list's height glides to fit its rows (a size change at one level).\n useIsoLayoutEffect(() => {\n const vp = viewport.current, host = sizer.current;\n if (!vp || !host) return;\n const fit = () => { vp.style.height = host.offsetHeight + 'px'; };\n fit();\n const raf = requestAnimationFrame(() => { vp.dataset.ready = ''; });\n const ro = new ResizeObserver(fit);\n ro.observe(host);\n return () => { cancelAnimationFrame(raf); ro.disconnect(); };\n }, [panelEl]);\n\n // One highlight, carried to the active row.\n const [hl, setHl] = React.useState<{ y: number; h: number } | null>(null);\n useIsoLayoutEffect(() => {\n const el = activeRow ? rowEls.current.get(activeRow.key) : null;\n setHl(el ? { y: el.offsetTop, h: el.offsetHeight } : null);\n if (el && byKeyboard.current) el.scrollIntoView({ block: 'nearest' });\n byKeyboard.current = false;\n }, [activeRow?.key, rowsKey, panelEl]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Say how many results there are, once typing pauses.\n React.useEffect(() => {\n if (!q) { setSaid(''); return; }\n const t = setTimeout(() => setSaid(flat.length ? `${flat.length} result${flat.length === 1 ? '' : 's'}` : 'No results'), 450);\n return () => clearTimeout(t);\n }, [q, flat.length]);\n\n const choose = (r: Row) => {\n if (r.item.disabled) return;\n if (closeOnSelect) set(false);\n r.item.onSelect?.();\n onSelect?.(r.item, r.group);\n };\n const onInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n if (!enabled.length) return;\n byKeyboard.current = true;\n const d = e.key === 'ArrowDown' ? 1 : -1;\n setActive((act + d + enabled.length) % enabled.length);\n } else if (e.key === 'Enter' && activeRow) { e.preventDefault(); choose(activeRow); }\n };\n\n if (!mounted) return null;\n const label = rest['aria-label'] ?? 'Command palette';\n const activeIndex = activeRow ? flat.indexOf(activeRow) : -1;\n let n = 0;\n return (\n <Layer>\n <div className=\"alt-cmd-root\" data-state={state} onKeyDown={onKeyDown}>\n <div className=\"alt-scrim\" onClick={close} />\n <div ref={panelRef} role=\"dialog\" aria-modal=\"true\" aria-label={label} tabIndex={-1} className={cx('alt-cmd', className)} data-ephemeral={ephemeral ? '' : undefined}>\n <div className=\"alt-cmd-head\">\n <Input className=\"alt-cmd-field\" value={query} placeholder={placeholder} autoComplete=\"off\" spellCheck={false}\n role=\"combobox\" aria-label={placeholder.replace(/[\u2026.]+$/, '')} aria-expanded={flat.length > 0} aria-controls={`${id}-list`}\n aria-autocomplete=\"list\" aria-activedescendant={activeIndex >= 0 ? `${id}-o-${activeIndex}` : undefined}\n leading={<SearchIcon />} trailing={<span aria-hidden=\"true\"><Kbd>esc</Kbd></span>}\n onChange={(e) => { setQuery(e.target.value); setActive(0); setOnset(false); onQueryChange?.(e.target.value); }}\n onKeyDown={onInputKeyDown} />\n </div>\n <div className=\"alt-cmd-viewport\" ref={viewport}>\n <div ref={sizer}>\n <div className=\"alt-cmd-list\" ref={list} role=\"listbox\" id={`${id}-list`} aria-label=\"Results\">\n <span className=\"alt-cmd-hl\" aria-hidden=\"true\" data-tone={activeRow?.item.tone}\n style={hl ? { transform: `translateY(${hl.y}px)`, height: hl.h, opacity: 1 } : { opacity: 0 }} />\n {view.map((v) => {\n const labelId = `${id}-g-${v.gi}`;\n const groupPredicted = !!v.g.predicted || v.rows.every((r) => r.item.predicted);\n return (\n <div key={v.gk} role=\"group\" aria-labelledby={v.g.label ? labelId : undefined} className=\"alt-cmd-group\">\n {v.g.label && <div id={labelId} role=\"presentation\" className=\"alt-cmd-label\" data-flip={'g:' + v.gk} data-predicted={groupPredicted ? '' : undefined}>{v.g.label}</div>}\n {v.rows.map(() => {\n const i = n++, r = flat[i], item = r.item;\n const on = r === activeRow;\n return (\n <div key={r.key} id={`${id}-o-${i}`} role=\"option\" aria-selected={on} aria-disabled={item.disabled || undefined}\n className=\"alt-cmd-item\" data-flip={'o:' + r.key} data-tone={item.tone} data-predicted={r.predicted ? '' : undefined}\n ref={(el) => { if (el) rowEls.current.set(r.key, el); else rowEls.current.delete(r.key); }}\n onPointerMove={() => { if (!item.disabled && !on) setActive(enabled.indexOf(r)); }}\n onClick={() => choose(r)}>\n {item.icon && <span className=\"alt-cmd-icon\" aria-hidden=\"true\">{item.icon}</span>}\n <span className=\"alt-cmd-text\">\n <span className=\"alt-cmd-title\"><Marked text={item.label} ranges={matchRanges(item.label, q)} /></span>\n {item.description && <span className=\"alt-cmd-desc\">{item.description}</span>}\n </span>\n {item.shortcut && <span className=\"alt-cmd-keys\">{item.shortcut.map((k, j) => <Kbd key={j}>{k}</Kbd>)}</span>}\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n {q && !flat.length && (\n <div className=\"alt-cmd-empty\">\n {typeof empty === 'function' ? empty(q) : empty ?? <><b>No results for \u201C{q}\u201D</b>Try another word, or check the spelling.</>}\n </div>\n )}\n </div>\n </div>\n {hints && (\n <div className=\"alt-cmd-foot\" aria-hidden=\"true\">\n <span><Kbd>\u2191</Kbd><Kbd>\u2193</Kbd>Move</span><span><Kbd>\u21B5</Kbd>Choose</span><span><Kbd>esc</Kbd>Close</span>\n </div>\n )}\n <span className=\"alt-sr\" aria-live=\"polite\">{said}</span>\n </div>\n </div>\n </Layer>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, useApproach, useControllable, useIsoLayoutEffect, useKeyFocus, useOutside, usePresence } from './core';\nimport { commandScore } from './command';\n\nconst EXIT_3 = 160; // \u2248 dur-travel-3 \u00D7 0.7\n\nexport interface SelectOption {\n value: string;\n label: React.ReactNode;\n /** Plain text for typeahead, filtering and the field. Needed when label isn't a string. */\n textValue?: string;\n description?: React.ReactNode;\n icon?: React.ReactNode;\n disabled?: boolean;\n}\nexport interface SelectItemProps {\n value: string;\n children: React.ReactNode;\n textValue?: string;\n description?: React.ReactNode;\n icon?: React.ReactNode;\n disabled?: boolean;\n}\n/** Declares one option of a Select. It renders nothing itself; Select reads its props. */\nexport function SelectItem(_: SelectItemProps): React.ReactElement | null { return null; }\n\nconst textOf = (o: SelectOption) => o.textValue ?? (typeof o.label === 'string' || typeof o.label === 'number' ? String(o.label) : o.value);\nfunction collect(items: SelectOption[] | undefined, children: React.ReactNode): SelectOption[] {\n if (items) return items;\n const out: SelectOption[] = [];\n React.Children.forEach(children, (c) => {\n if (!React.isValidElement(c) || c.type !== SelectItem) return;\n const p = c.props as SelectItemProps;\n out.push({ value: p.value, label: p.children, textValue: p.textValue, description: p.description, icon: p.icon, disabled: p.disabled });\n });\n return out;\n}\n\n/** The Checkbox family's tick: the same path and stroke, here in accent-ink on the chosen row. */\nconst Tick = () => (\n <svg className=\"alt-select-tick\" viewBox=\"0 0 16 16\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.25\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-6.5\" pathLength={16} />\n </svg>\n);\nconst Chevron = () => <Icons.ChevronDown className=\"alt-select-chevron\" size={16} />;\n\n/** Opens downward unless there's more room above the field than below it (within whatever clips it). */\nfunction useSide(open: boolean, anchor: React.RefObject<HTMLElement | null>, list: React.RefObject<HTMLElement | null>) {\n const [side, setSide] = React.useState<'bottom' | 'top'>('bottom');\n useIsoLayoutEffect(() => {\n if (!open || !anchor.current || !list.current) return;\n const a = anchor.current.getBoundingClientRect(), need = list.current.offsetHeight + 12;\n let lo = 0, hi = window.innerHeight;\n for (let p = anchor.current.parentElement; p; p = p.parentElement) {\n const o = getComputedStyle(p).overflowY;\n if (o !== 'visible') { const r = p.getBoundingClientRect(); lo = Math.max(lo, r.top); hi = Math.min(hi, r.bottom); }\n }\n setSide(hi - a.bottom >= need || a.top - lo < hi - a.bottom ? 'bottom' : 'top');\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n return side;\n}\n\n/** A brief afterglow on a newly chosen value: it settles into the field. */\nfunction useGlow(value: string) {\n const [glow, setGlow] = React.useState<'a' | 'b' | undefined>(undefined);\n const first = React.useRef(true);\n React.useEffect(() => { if (first.current) { first.current = false; return; } if (value) setGlow((g) => (g === 'a' ? 'b' : 'a')); }, [value]);\n return glow;\n}\n\n/** Finds the label element that names a control by id, so the list can carry the same name. */\nfunction useLabelId(controlId: string, fallback: string) {\n const [labelId, setLabelId] = React.useState<string | undefined>(undefined);\n React.useEffect(() => {\n const label = document.querySelector<HTMLLabelElement>(`label[for=\"${CSS.escape(controlId)}\"]`);\n if (!label) { setLabelId(undefined); return; }\n if (!label.id) label.id = fallback;\n setLabelId(label.id);\n }, [controlId, fallback]);\n return labelId;\n}\n\ntype ListProps = {\n id: string; options: SelectOption[]; active: number; value: string; state: 'open' | 'closed'; side: 'bottom' | 'top';\n query?: string; empty?: React.ReactNode; listRef: React.RefObject<HTMLDivElement | null>; labelledBy?: string; label?: string;\n focusable: boolean; onActive: (i: number) => void; onChoose: (i: number) => void; onKeyDown?: (e: React.KeyboardEvent) => void;\n};\nfunction OptionList({ id, options, active, value, state, side, query, empty, listRef, labelledBy, label, focusable, onActive, onChoose, onKeyDown }: ListProps) {\n const rows = React.useRef<(HTMLDivElement | null)[]>([]);\n const [hl, setHl] = React.useState<{ y: number; h: number } | null>(null);\n useIsoLayoutEffect(() => {\n const el = active >= 0 ? rows.current[active] : null;\n setHl(el ? { y: el.offsetTop, h: el.offsetHeight } : null);\n if (el && listRef.current) {\n const l = listRef.current;\n if (el.offsetTop < l.scrollTop) l.scrollTop = el.offsetTop - 4;\n else if (el.offsetTop + el.offsetHeight > l.scrollTop + l.clientHeight) l.scrollTop = el.offsetTop + el.offsetHeight - l.clientHeight + 4;\n }\n }, [active, options.length]); // eslint-disable-line react-hooks/exhaustive-deps\n const marks = (o: SelectOption) => {\n const t = textOf(o);\n if (!query || typeof o.label !== 'string') return o.label;\n const i = t.toLowerCase().indexOf(query.toLowerCase());\n if (i < 0) return o.label;\n return <>{t.slice(0, i)}<mark className=\"alt-cmd-match\">{t.slice(i, i + query.length)}</mark>{t.slice(i + query.length)}</>;\n };\n return (\n <div ref={listRef as React.Ref<HTMLDivElement>} id={id} role=\"listbox\" tabIndex={focusable ? -1 : undefined} aria-labelledby={labelledBy} aria-label={labelledBy ? undefined : label}\n aria-activedescendant={focusable && active >= 0 ? `${id}-${active}` : undefined}\n className=\"alt-pop alt-menu alt-select-list\" data-state={state} data-side={side} onKeyDown={onKeyDown}\n onMouseDown={(e) => e.preventDefault()}>\n <span className=\"alt-menu-hl\" aria-hidden=\"true\" style={hl ? { transform: `translateY(${hl.y}px)`, height: hl.h, opacity: 1 } : { opacity: 0 }} />\n {options.map((o, i) => (\n <div key={o.value} id={`${id}-${i}`} ref={(el) => { rows.current[i] = el; }} role=\"option\" aria-selected={o.value === value}\n aria-disabled={o.disabled || undefined} data-active={i === active ? '' : undefined} className=\"alt-menu-item alt-select-option\" style={{ ['--i' as any]: Math.min(i, 10) }}\n onPointerMove={() => { if (!o.disabled && i !== active) onActive(i); }} onClick={() => onChoose(i)}>\n {o.icon && <span className=\"alt-menu-icon\">{o.icon}</span>}\n <span className=\"alt-menu-text\">{marks(o)}{o.description && <span className=\"alt-select-desc\">{o.description}</span>}</span>\n {o.value === value && <Tick />}\n </div>\n ))}\n {!options.length && <div className=\"alt-select-empty\">{empty}</div>}\n </div>\n );\n}\n\ninterface FieldLike {\n id?: string;\n name?: string;\n required?: boolean;\n disabled?: boolean;\n /** Drops the field to trench depth. Field sets it for you when it has an error. */\n invalid?: boolean;\n /** sm 34px, md 40px, as Input. Default 'md'. */\n size?: 'sm' | 'md';\n placeholder?: string;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n /** Start with the list open (for documentation). */\n defaultOpen?: boolean;\n}\n\nexport interface SelectProps extends FieldLike {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** The options as data. Or pass SelectItem children. */\n items?: SelectOption[];\n children?: React.ReactNode;\n}\n\n/**\n * Choosing a value is filling a field, so the trigger is an opening built like Input: its back wall shows while it's\n * empty, its floor rises flush once a value is chosen, and it drops to trench depth when invalid. The list rises from\n * the field's edge at level 3 with one gliding highlight; the chosen option wears the Checkbox family's tick.\n */\nexport function Select({ value, defaultValue = '', onValueChange, items, children, id, name, required, disabled, invalid, size = 'md',\n placeholder = 'Choose\u2026', defaultOpen = false, className, ...aria }: SelectProps) {\n const options = collect(items, children);\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(defaultOpen);\n const [active, setActive] = React.useState(() => (defaultOpen ? options.findIndex((o) => o.value === (value ?? defaultValue)) : -1));\n const auto = React.useId();\n const triggerId = id ?? auto + '-trigger';\n const listId = auto + '-list';\n const root = React.useRef<HTMLDivElement>(null);\n const field = React.useRef<HTMLDivElement>(null);\n const trigger = React.useRef<HTMLButtonElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const typed = React.useRef({ text: '', at: 0 });\n const { mounted, state } = usePresence(open, EXIT_3);\n const side = useSide(mounted, field, list);\n const glow = useGlow(v);\n const labelId = useLabelId(triggerId, auto + '-label');\n useApproach();\n useKeyFocus();\n const chosen = options.find((o) => o.value === v);\n const enabled = options.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);\n const close = React.useCallback((refocus = true) => { setOpen(false); if (refocus) trigger.current?.focus({ preventScroll: true }); }, []);\n useOutside(root, open, () => close(false));\n React.useEffect(() => { if (state === 'open') list.current?.focus({ preventScroll: true }); }, [state]);\n\n const openAt = (i: number) => { setActive(i); setOpen(true); };\n const current = () => { const i = options.findIndex((o) => o.value === v && !o.disabled); return i >= 0 ? i : enabled[0] ?? -1; };\n const step = (d: number) => { const p = enabled.indexOf(active); setActive(enabled[Math.max(0, Math.min(enabled.length - 1, (p < 0 ? (d > 0 ? -1 : enabled.length) : p) + d))]); };\n // Typeahead: letters typed within half a second find the next option that starts with them.\n const seek = (key: string, from: number) => {\n const now = Date.now(), t = typed.current;\n t.text = now - t.at < 500 ? t.text + key.toLowerCase() : key.toLowerCase();\n t.at = now;\n const same = t.text.split('').every((c) => c === t.text[0]);\n const q = same ? t.text[0] : t.text;\n const order = [...enabled.filter((i) => i > from), ...enabled.filter((i) => i <= from)];\n const start = same ? order : [from, ...order].filter((i) => i >= 0);\n return start.find((i) => textOf(options[i]).toLowerCase().startsWith(q)) ?? -1;\n };\n const choose = (i: number) => {\n const o = options[i];\n if (!o || o.disabled) return;\n set(o.value);\n close();\n };\n\n const onTriggerKey = (e: React.KeyboardEvent) => {\n if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(e.key)) { e.preventDefault(); openAt(e.key === 'ArrowUp' && v === '' ? enabled[enabled.length - 1] : current()); }\n else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) { const i = seek(e.key, current()); if (i >= 0) { e.preventDefault(); openAt(i); } }\n };\n const onListKey = (e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown') { e.preventDefault(); step(1); }\n else if (e.key === 'ArrowUp') { e.preventDefault(); step(-1); }\n else if (e.key === 'Home') { e.preventDefault(); setActive(enabled[0]); }\n else if (e.key === 'End') { e.preventDefault(); setActive(enabled[enabled.length - 1]); }\n else if (e.key === 'Enter' || (e.key === ' ' && Date.now() - typed.current.at > 500)) { e.preventDefault(); choose(active); }\n else if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); close(); }\n else if (e.key === 'Tab') close(false);\n else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) { const i = seek(e.key, active); if (i >= 0) { e.preventDefault(); setActive(i); } }\n };\n\n return (\n <div ref={root} className={cx('alt-select', className)} data-open={open ? '' : undefined}>\n <div ref={field} className=\"alt-input\" data-size={size} data-approach=\"56\" data-filled={chosen ? '' : undefined}\n data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}>\n <button ref={trigger} id={triggerId} type=\"button\" className=\"alt-select-trigger\" disabled={disabled}\n aria-haspopup=\"listbox\" aria-expanded={open} aria-controls={open ? listId : undefined} aria-invalid={invalid || undefined} aria-required={required || undefined}\n {...aria} onClick={() => (open ? close() : openAt(current()))} onKeyDown={onTriggerKey}>\n <span className=\"alt-select-value\" data-placeholder={chosen ? undefined : ''} data-glow={glow}>\n {chosen ? <>{chosen.icon && <span className=\"alt-select-icon\">{chosen.icon}</span>}{chosen.label}</> : placeholder}\n </span>\n <Chevron />\n </button>\n </div>\n {name && <input type=\"hidden\" name={name} value={v} />}\n {mounted && (\n <OptionList id={listId} options={options} active={active} value={v} state={state} side={side} listRef={list} labelledBy={labelId}\n label={aria['aria-label']} focusable onActive={setActive} onChoose={choose} onKeyDown={onListKey} />\n )}\n </div>\n );\n}\n\nexport interface ComboboxProps extends FieldLike {\n items: SelectOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Score an option against what's typed: 0 (or false) hides it, higher ranks it first. Default: the CommandPalette's ranking. */\n filter?: (option: SelectOption, query: string) => number | boolean;\n /** Shown when nothing matches. Default \"No matches\". */\n empty?: React.ReactNode;\n}\n\n/**\n * An editable Select: type to filter, choose to fill. What you type is a query, not yet a value, so the field stays an\n * opening (its back wall showing) until an option is chosen; then its floor rises flush.\n */\nexport function Combobox({ items, value, defaultValue = '', onValueChange, filter, empty = 'No matches', id, name, required, disabled, invalid,\n size = 'md', placeholder = 'Type to search\u2026', defaultOpen = false, className, ...aria }: ComboboxProps) {\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const chosen = items.find((o) => o.value === v);\n const [text, setText] = React.useState(chosen ? textOf(chosen) : '');\n const [typing, setTyping] = React.useState(false);\n const [open, setOpen] = React.useState(defaultOpen);\n const [active, setActive] = React.useState(() => (defaultOpen ? items.findIndex((o) => o.value === (value ?? defaultValue)) : -1));\n const auto = React.useId();\n const inputId = id ?? auto + '-input';\n const listId = auto + '-list';\n const root = React.useRef<HTMLDivElement>(null);\n const field = React.useRef<HTMLDivElement>(null);\n const input = React.useRef<HTMLInputElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const { mounted, state } = usePresence(open, EXIT_3);\n const side = useSide(mounted, field, list);\n const glow = useGlow(v);\n const labelId = useLabelId(inputId, auto + '-label');\n useApproach();\n useKeyFocus();\n // A controlled value that changes from outside resets the text.\n React.useEffect(() => { if (!typing) setText(chosen ? textOf(chosen) : ''); }, [v]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const q = typing ? text.trim() : '';\n const score = (o: SelectOption) => { const s = filter ? filter(o, q) : commandScore(textOf(o), q); return typeof s === 'boolean' ? (s ? 1 : 0) : s; };\n const shown = q ? items.map((o, i) => ({ o, i, s: score(o) })).filter((x) => x.s > 0).sort((a, b) => b.s - a.s || a.i - b.i).map((x) => x.o) : items;\n const enabled = shown.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);\n const restore = () => { setText(chosen ? textOf(chosen) : ''); setTyping(false); };\n const close = () => { setOpen(false); };\n // Leaving the field, by Tab or by clicking away, commits what's typed: an exact name chooses it, an empty field clears\n // the value, anything else goes back to the value it had.\n const commit = () => {\n close();\n if (!typing) return;\n const exact = items.find((o) => !o.disabled && textOf(o).toLowerCase() === text.trim().toLowerCase());\n if (exact) { set(exact.value); setText(textOf(exact)); setTyping(false); }\n else if (!text.trim()) { set(''); setTyping(false); }\n else restore();\n };\n useOutside(root, open, commit);\n\n const choose = (i: number) => {\n const o = shown[i];\n if (!o || o.disabled) return;\n set(o.value); setText(textOf(o)); setTyping(false); close();\n input.current?.focus({ preventScroll: true });\n };\n const onKey = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n if (!open) { const i = shown.findIndex((o) => o.value === v); setActive(e.altKey ? -1 : i >= 0 ? i : enabled[0] ?? -1); setOpen(true); return; }\n const p = enabled.indexOf(active), d = e.key === 'ArrowDown' ? 1 : -1;\n setActive(enabled[(p < 0 ? (d > 0 ? -1 : enabled.length) : p + d + enabled.length) % enabled.length] ?? enabled[0]);\n } else if (e.key === 'Enter' && open && active >= 0) { e.preventDefault(); choose(active); }\n else if (e.key === 'Escape') {\n if (open || typing) { e.preventDefault(); e.stopPropagation(); close(); restore(); }\n } else if (e.key === 'Tab' && open) close();\n };\n const onBlur = (e: React.FocusEvent) => { if (!root.current?.contains(e.relatedTarget as Node)) commit(); };\n const filled = !!chosen && !typing;\n return (\n <div ref={root} className={cx('alt-select alt-combobox', className)} data-open={open ? '' : undefined}>\n <div ref={field} className=\"alt-input\" data-size={size} data-approach=\"56\" data-filled={filled ? '' : undefined}\n data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}>\n <input ref={input} id={inputId} type=\"text\" role=\"combobox\" autoComplete=\"off\" spellCheck={false} disabled={disabled}\n aria-autocomplete=\"list\" aria-expanded={open} aria-controls={mounted ? listId : undefined} aria-activedescendant={open && active >= 0 ? `${listId}-${active}` : undefined}\n aria-invalid={invalid || undefined} aria-required={required || undefined} placeholder={placeholder} value={text} data-glow={glow}\n {...aria} onKeyDown={onKey} onBlur={onBlur}\n onChange={(e) => { setText(e.target.value); setTyping(true); setOpen(true); setActive(0); }} />\n <button type=\"button\" tabIndex={-1} className=\"alt-select-toggle\" aria-label=\"Show options\" disabled={disabled}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => { if (open) { close(); restore(); } else { const i = items.findIndex((o) => o.value === v); setActive(i); setOpen(true); } input.current?.focus(); }}>\n <Chevron />\n </button>\n </div>\n {name && <input type=\"hidden\" name={name} value={v} />}\n {mounted && (\n <OptionList id={listId} options={shown} active={Math.min(active, shown.length - 1)} value={v} state={state} side={side} listRef={list} labelledBy={labelId}\n label={aria['aria-label']} focusable={false} query={q} empty={empty} onActive={setActive} onChoose={choose} />\n )}\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, riseDelay } from './core';\n\nexport interface StepperStep {\n /** Stable key. Default: the step's position. */\n id?: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n}\nexport interface StepperProps extends Omit<React.OlHTMLAttributes<HTMLOListElement>, 'onChange'> {\n steps: StepperStep[];\n /** The index of the step being worked on. steps.length means every step is complete. */\n current: number;\n /** Makes completed steps buttons that go back to them. */\n onStepChange?: (index: number) => void;\n /** Default 'horizontal'. */\n orientation?: 'horizontal' | 'vertical';\n}\n\nconst Tick = () => (\n <svg viewBox=\"0 0 16 16\" width=\"13\" height=\"13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-6.5\" pathLength={16} />\n </svg>\n);\nconst word = { done: 'completed', current: 'current', upcoming: 'not started' } as const;\n\n/**\n * A process as a staircase of plates on one ground line, in the breadcrumb's vocabulary. Completed steps are settled into\n * the record: flush plates with a stamped check. The current step is a raised slab with a wall. Steps to come are imprints\n * pressed into the page. Advancing presses the current step down into the record, stamps its check in, then raises the\n * next one out of its imprint.\n */\nexport function Stepper({ steps, current, onStepChange, orientation = 'horizontal', className, ...rest }: StepperProps) {\n // The motion is derived in the same render that changes the states, so the rise's delay is in place before its\n // transition starts (setting it in an effect would be a frame late and the new step would rise at once).\n const [seen, setSeen] = React.useState(current);\n const [motion, setMotion] = React.useState<{ pressed: number; risen: number; stamp: number; delay: number; key: number } | null>(null);\n const [said, setSaid] = React.useState('');\n if (seen !== current) {\n setSeen(current);\n // Forward: the old step presses down and is stamped, then the new one rises. Back: the old one sinks, the chosen one rises.\n setMotion({ pressed: seen, risen: current, stamp: current > seen ? seen : -1, delay: (current > seen ? 150 : 60) + riseDelay(), key: (motion?.key ?? 0) + 1 });\n }\n React.useEffect(() => {\n if (!motion) return;\n const t = steps[current];\n setSaid(t ? `Step ${current + 1} of ${steps.length}: ${typeof t.title === 'string' ? t.title : ''}` : 'All steps complete');\n const done = setTimeout(() => setMotion(null), 900);\n return () => clearTimeout(done);\n }, [motion?.key]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <>\n <ol className={cx('alt-stepper', className)} data-orientation={orientation} aria-label={rest['aria-label'] ?? 'Progress'} {...rest}>\n {steps.map((s, i) => {\n const state = i < current ? 'done' : i === current ? 'current' : 'upcoming';\n const back = state === 'done' && !!onStepChange;\n const rising = motion && motion.risen === i;\n const stamped = motion && motion.stamp === i;\n // One element in every state (a completed step that goes back is a role=\"button\"), so the plate's height animates\n // from state to state instead of being swapped for a new element.\n return (\n <li key={s.id ?? i} className=\"alt-step-item\" data-state={state} aria-current={state === 'current' ? 'step' : undefined}>\n <div className=\"alt-step\" data-state={state} data-motion={rising ? 'rise' : motion && motion.pressed === i ? 'press' : undefined}\n {...(back ? { role: 'button', tabIndex: 0, onClick: () => onStepChange!(i),\n onKeyDown: (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onStepChange!(i); } } } : {})}\n style={rising ? ({ ['--alt-rise-delay' as any]: motion!.delay + 'ms' } as React.CSSProperties) : undefined}>\n <span className=\"alt-step-mark\" data-stamp={stamped ? (motion!.key % 2 ? 'a' : 'b') : undefined}>{state === 'done' ? <Tick /> : i + 1}</span>\n <span className=\"alt-step-text\">\n <span className=\"alt-sr\">Step {i + 1} of {steps.length}, {word[state]}: </span>\n <span className=\"alt-step-title\">{s.title}</span>\n {s.description && <span className=\"alt-step-desc\">{s.description}</span>}\n </span>\n </div>\n {i < steps.length - 1 && <span className=\"alt-step-line\" aria-hidden=\"true\" data-done={i < current ? '' : undefined} />}\n </li>\n );\n })}\n </ol>\n <span className=\"alt-sr\" aria-live=\"polite\">{said}</span>\n </>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, riseDelay, useControllable, useDepth, useIsoLayoutEffect } from './core';\nimport { Badge, Button, Checkbox } from './controls';\nimport { Pile } from './pile';\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 shared: carrying things to their new places (FLIP) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/** Positions recorded at the moment of a drop (where things visibly were), used instead of the last layout's. */\nconst dropSnapshots = new WeakMap<HTMLElement, Map<string, { x: number; y: number }>>();\nconst ms = (cs: CSSStyleDeclaration, name: string, fallback: number) => parseFloat(cs.getPropertyValue(name)) || fallback;\n\n/**\n * Where an element sits in the page, from layout offsets: transforms (a lift, a drag, a running animation) don't count,\n * so nothing has to be cancelled to measure. Scroll offsets along the way are subtracted.\n */\nfunction pagePlace(el: HTMLElement) {\n let x = 0, y = 0;\n for (let n: HTMLElement | null = el; n;) {\n x += n.offsetLeft; y += n.offsetTop;\n const p = n.offsetParent as HTMLElement | null;\n if (p) { x -= p.scrollLeft; y -= p.scrollTop; }\n n = p;\n }\n return { x, y };\n}\n/** Where an element sits relative to `host`. Both are measured from the page, so it holds whichever offset parent each has\n * (a row made position: relative while it's held reports to the scroll area instead of the table). */\nfunction placeIn(el: HTMLElement, host: HTMLElement) {\n const a = pagePlace(el), b = pagePlace(host);\n return { x: a.x - b.x, y: a.y - b.y };\n}\n/**\n * After every commit, items (matched by `selector`, keyed by `attr`) whose place changed are carried there from where\n * they were, instead of jumping (FLIP). Positions are measured in `host`, so moves between containers travel too.\n */\nfunction useCarry(host: React.RefObject<HTMLElement | null>, selector: string, attr: string, durToken = '--dur-travel-3') {\n const prev = React.useRef<Map<string, { x: number; y: number }> | null>(null);\n useIsoLayoutEffect(() => {\n const root = host.current;\n if (!root) return;\n const els = Array.from(root.querySelectorAll<HTMLElement>(selector));\n const now = new Map<string, { x: number; y: number }>();\n els.forEach((el) => now.set(el.getAttribute(attr)!, placeIn(el, root)));\n const before = dropSnapshots.get(root) ?? prev.current;\n dropSnapshots.delete(root);\n prev.current = now;\n if (!before) return;\n const cs = getComputedStyle(root);\n if (parseFloat(cs.getPropertyValue('--alt-travel')) === 0) return;\n const opts = { duration: ms(cs, durToken, 220), easing: cs.getPropertyValue('--ease-glide').trim() || 'ease' };\n // Something that was let go lands: it settles into place with a slight overshoot instead of gliding.\n const landing = { duration: ms(cs, durToken, 220), easing: cs.getPropertyValue('--ease-settle').trim() || 'ease-out' };\n els.forEach((el) => {\n const k = el.getAttribute(attr)!, a = before.get(k), b = now.get(k)!;\n if (!a) return;\n const dx = a.x - b.x, dy = a.y - b.y;\n if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) el.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'none' }], el.hasAttribute('data-landing') ? landing : opts);\n });\n });\n}\nconst moveItem = <T,>(arr: T[], from: number, to: number) => { const a = arr.slice(); const [x] = a.splice(from, 1); a.splice(to, 0, x); return a; };\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {\n /** The table scrolls under its header past this height. */\n maxHeight?: number | string;\n /** Drawn inside the scroll area, beneath the rows (DataTable puts its landing slot here). */\n underlay?: React.ReactNode;\n}\n/**\n * Rows are the record: they sit on the ground with `line` dividers. The header stays flush until rows scroll under it,\n * then rises. Rows that change place are carried there. Each row's height is drawn as one slab by its first cell.\n */\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(function Table({ maxHeight, underlay, className, children, ...rest }, ref) {\n const wrap = React.useRef<HTMLDivElement>(null);\n const table = React.useRef<HTMLTableElement>(null);\n React.useImperativeHandle(ref, () => table.current as HTMLTableElement);\n const [edges, setEdges] = React.useState({ top: false, bottom: false });\n const measure = React.useCallback(() => {\n const el = wrap.current;\n if (!el) return;\n const top = el.scrollTop > 1, bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;\n setEdges((p) => (p.top === top && p.bottom === bottom ? p : { top, bottom }));\n }, []);\n useIsoLayoutEffect(() => {\n const t = table.current;\n if (!t) return;\n const fit = () => { t.style.setProperty('--alt-row-w', t.offsetWidth + 'px'); measure(); };\n fit();\n const ro = new ResizeObserver(fit);\n ro.observe(t);\n if (wrap.current) ro.observe(wrap.current);\n return () => ro.disconnect();\n }, [measure]);\n useCarry(table, 'tbody > tr[data-row]', 'data-row');\n const scrolls = maxHeight !== undefined;\n return (\n <div ref={wrap} className=\"alt-table-wrap\" data-top={edges.top ? '' : undefined} data-bottom={edges.bottom ? '' : undefined}\n style={scrolls ? { maxHeight } : undefined} onScroll={measure}\n {...(scrolls ? { tabIndex: 0, role: 'region', 'aria-label': rest['aria-label'] } : {})}>\n {underlay}\n <table ref={table} className={cx('alt-table', className)} {...rest}>{children}</table>\n </div>\n );\n});\nexport const TableHeader = ({ className, ...p }: React.HTMLAttributes<HTMLTableSectionElement>) => <thead className={cx('alt-table-head', className)} {...p} />;\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(function TableBody({ className, ...p }, ref) {\n return <tbody ref={ref} className={cx('alt-table-body', className)} {...p} />;\n});\nexport const TableFooter = ({ className, ...p }: React.HTMLAttributes<HTMLTableSectionElement>) => <tfoot className={cx('alt-table-foot', className)} {...p} />;\nexport const TableCaption = ({ className, ...p }: React.HTMLAttributes<HTMLTableCaptionElement>) => <caption className={cx('alt-table-caption', className)} {...p} />;\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {\n /** A stable id. With it, a row whose place changes (re-sorting, reordering) is carried there instead of jumping. */\n rowId?: string;\n /** Selected rows are tinted accent-soft and raised one level. Pair it with a checked Checkbox in the row. */\n selected?: boolean;\n /** Lifts on hover. Only when clicking the row does something. */\n interactive?: boolean;\n /** Focus+context filtering: match rises one level, miss sinks into a well. */\n relevance?: 'match' | 'miss';\n /** Afterglow: when the value changes, the row lifts, tints and settles back over dur-settle. true settles once on mount. */\n settle?: unknown;\n /** In someone's hand while it's being moved: level 3, tilted. */\n held?: boolean;\n}\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { rowId, selected, interactive, relevance, settle, held, className, style, ...rest }, ref) {\n const [glow, setGlow] = React.useState<'a' | 'b' | undefined>(undefined);\n const [delay, setDelay] = React.useState(0);\n const first = React.useRef(true);\n React.useEffect(() => {\n const wasFirst = first.current;\n first.current = false;\n if (settle === undefined || settle === null || settle === false || (wasFirst && settle !== true)) return;\n setDelay(riseDelay());\n setGlow((g) => (g === 'a' ? 'b' : 'a'));\n }, [settle]);\n return (\n <tr ref={ref} className={cx('alt-tr', className)} data-row={rowId} data-selected={selected ? '' : undefined}\n data-interactive={interactive ? '' : undefined}\n data-row-relevance={relevance} data-row-held={held ? '' : undefined} data-row-settle={glow}\n style={delay ? ({ ['--alt-rise-delay' as any]: delay + 'ms', ...style } as React.CSSProperties) : style} {...rest} />\n );\n});\n\nconst SortIcon = () => (\n <svg className=\"alt-table-sort-icon\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 15l6-6 6 6\" />\n </svg>\n);\nexport interface TableHeadProps extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: 'start' | 'end';\n /** This column's sort. With onSort, the header becomes a button and the th carries aria-sort. */\n sort?: 'ascending' | 'descending' | 'none';\n onSort?: () => void;\n}\nexport function TableHead({ align, sort, onSort, className, children, ...rest }: TableHeadProps) {\n return (\n <th scope=\"col\" className={cx('alt-th', className)} data-align={align} aria-sort={onSort ? sort ?? 'none' : undefined} {...rest}>\n {onSort ? <button type=\"button\" className=\"alt-table-sort\" data-sort={sort ?? 'none'} onClick={onSort}>{children}<SortIcon /></button> : children}\n </th>\n );\n}\nexport interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> { align?: 'start' | 'end' }\nexport function TableCell({ align, className, ...rest }: TableCellProps) {\n return <td className={cx('alt-td', className)} data-align={align} {...rest} />;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 DataTable \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface DataTableColumn<T> {\n key: string;\n header: React.ReactNode;\n /** Cell content. Default: the row's value at `key`. */\n cell?: (row: T) => React.ReactNode;\n /** Makes the column sortable by this value. */\n sortValue?: (row: T) => string | number;\n align?: 'start' | 'end';\n width?: number | string;\n}\nexport type TableSort = { key: string; direction: 'ascending' | 'descending' } | null;\nexport interface DataTableProps<T> {\n columns: DataTableColumn<T>[];\n rows: T[];\n getRowId: (row: T) => string;\n /** A row's name, for screen readers (its checkbox, its move handle, announcements) and its button with onRowClick. */\n getRowLabel?: (row: T) => string;\n /** A checkbox column; selected rows rise, and the toolbar counts them. */\n selectable?: boolean;\n selected?: string[];\n defaultSelected?: string[];\n onSelectedChange?: (ids: string[]) => void;\n /** Toolbar actions for the selected rows, shown beside their count. */\n actions?: (ids: string[]) => React.ReactNode;\n /** Anything else for the toolbar's end (a filter field, a button). */\n toolbar?: React.ReactNode;\n sort?: TableSort;\n defaultSort?: TableSort;\n onSortChange?: (sort: TableSort) => void;\n /** Makes rows interactive: the first column becomes the row's button, and clicking anywhere on the row calls this. */\n onRowClick?: (row: T) => void;\n /** Filter in place: matches rise, misses sink. Return undefined when no filter is active. */\n relevance?: (row: T) => 'match' | 'miss' | undefined;\n /** Adds move handles: rows can be picked up and dropped (pointer, or Space and the arrow keys). Hidden while sorted. */\n onReorder?: (rows: T[]) => void;\n maxHeight?: number | string;\n /** Shown when there are no rows. */\n empty?: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n}\n\nconst GripIcon = () => (\n <svg width=\"12\" height=\"16\" viewBox=\"0 0 12 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"3\" cy=\"3\" r=\"1.3\" /><circle cx=\"9\" cy=\"3\" r=\"1.3\" /><circle cx=\"3\" cy=\"8\" r=\"1.3\" /><circle cx=\"9\" cy=\"8\" r=\"1.3\" /><circle cx=\"3\" cy=\"13\" r=\"1.3\" /><circle cx=\"9\" cy=\"13\" r=\"1.3\" />\n </svg>\n);\n\n/**\n * A table from data: sortable columns whose rows are carried to their new places, a checkbox column whose selected rows\n * rise (counted by a floating Badge in the toolbar), filtering in place, interactive rows and reordering by hand.\n */\nexport function DataTable<T>({ columns, rows, getRowId, getRowLabel, selectable, selected, defaultSelected = [], onSelectedChange, actions, toolbar,\n sort, defaultSort = null, onSortChange, onRowClick, relevance, onReorder, maxHeight, empty = 'Nothing here yet.', className, ...rest }: DataTableProps<T>) {\n const [sel, setSel] = useControllable(selected, defaultSelected, onSelectedChange);\n const [srt, setSrt] = useControllable<TableSort>(sort, defaultSort, onSortChange);\n const [said, setSaid] = React.useState('');\n const table = React.useRef<HTMLTableElement>(null);\n const body = React.useRef<HTMLTableSectionElement>(null);\n const name = (r: T) => getRowLabel?.(r) ?? getRowId(r);\n const view = React.useMemo(() => {\n const col = srt && columns.find((c) => c.key === srt.key);\n if (!srt || !col?.sortValue) return rows;\n const d = srt.direction === 'descending' ? -1 : 1;\n return rows.map((r, i) => ({ r, i, v: col.sortValue!(r) }))\n .sort((a, b) => (typeof a.v === 'string' || typeof b.v === 'string' ? String(a.v).localeCompare(String(b.v), undefined, { numeric: true }) : (a.v as number) - (b.v as number)) * d || a.i - b.i)\n .map((x) => x.r);\n }, [rows, srt, columns]);\n const ids = view.map(getRowId);\n const chosen = new Set(sel);\n const all = ids.length > 0 && ids.every((id) => chosen.has(id));\n const some = !all && ids.some((id) => chosen.has(id));\n const movable = !!onReorder && !srt;\n\n const cycle = (c: DataTableColumn<T>) => {\n const next: TableSort = srt?.key !== c.key ? { key: c.key, direction: 'ascending' } : srt.direction === 'ascending' ? { key: c.key, direction: 'descending' } : null;\n setSrt(next);\n setSaid(next ? `Sorted by ${typeof c.header === 'string' ? c.header : c.key}, ${next.direction}.` : 'Sort cleared.');\n };\n const toggle = (id: string, on: boolean) => setSel(on ? [...sel.filter((x) => x !== id), id] : sel.filter((x) => x !== id));\n\n // Reordering by hand: pick a row up by its handle; the slot it will land in opens as a well; it lands where you drop it.\n const start = React.useRef<{ y: number; id: string; from: number; tops: number[]; hs: number[] } | null>(null);\n const [drag, setDrag] = React.useState<{ id: string; from: number; to: number; dy: number } | null>(null);\n const [held, setHeld] = React.useState<{ id: string; origin: number } | null>(null);\n const rowEls = () => Array.from(body.current?.querySelectorAll<HTMLTableRowElement>('tr[data-row]') ?? []);\n // Where each row was drawn when it was let go (its layout place plus the drag offset), so the drop travels from there.\n const snapshot = (at: (i: number) => number) => {\n if (!table.current) return;\n const m = new Map<string, { x: number; y: number }>();\n ids.forEach((id, i) => m.set(id, { x: 0, y: at(i) }));\n dropSnapshots.set(table.current, m);\n };\n const onGripDown = (e: React.PointerEvent, id: string, index: number) => {\n if (e.button !== 0) return;\n const els = rowEls();\n start.current = { y: e.clientY, id, from: index, tops: els.map((el) => el.offsetTop), hs: els.map((el) => el.offsetHeight) };\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n };\n const onGripMove = (e: React.PointerEvent) => {\n const s = start.current;\n if (!s) return;\n const dy = e.clientY - s.y;\n if (!drag && Math.abs(dy) < 4) return;\n const center = s.tops[s.from] + s.hs[s.from] / 2 + dy;\n let to = 0;\n s.tops.forEach((t, i) => { if (i !== s.from && t + s.hs[i] / 2 < center) to++; });\n setDrag({ id: s.id, from: s.from, to, dy });\n };\n const onGripUp = () => {\n const s = start.current;\n start.current = null;\n if (!drag || !s) { setDrag(null); return; }\n const { from, to } = drag, hs = s.hs[from];\n snapshot((i) => s.tops[i] + (i === from ? drag.dy : drag.from < drag.to && i > from && i <= to ? -hs : drag.to < drag.from && i >= to && i < from ? hs : 0));\n setDrag(null);\n if (from !== to) { onReorder!(moveItem(view, from, to)); setSaid(`${name(view[from])} moved to position ${to + 1} of ${view.length}.`); }\n };\n const focusGrip = (id: string) => requestAnimationFrame(() => body.current?.querySelector<HTMLElement>(`tr[data-row=\"${CSS.escape(id)}\"] .alt-table-grip`)?.focus());\n const onGripKey = (e: React.KeyboardEvent, id: string, index: number) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (held?.id === id) { setHeld(null); setSaid(`${name(view[index])} dropped at position ${index + 1} of ${view.length}.`); }\n else { setHeld({ id, origin: index }); setSaid(`${name(view[index])} picked up, position ${index + 1} of ${view.length}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`); }\n } else if (held?.id === id && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {\n e.preventDefault();\n const to = Math.max(0, Math.min(view.length - 1, index + (e.key === 'ArrowUp' ? -1 : 1)));\n if (to !== index) { onReorder!(moveItem(view, index, to)); setSaid(`Position ${to + 1} of ${view.length}.`); focusGrip(id); }\n } else if (held?.id === id && e.key === 'Escape') {\n e.preventDefault();\n if (held.origin !== index) { onReorder!(moveItem(view, index, held.origin)); focusGrip(id); }\n setHeld(null); setSaid(`Move cancelled; ${name(view[index])} is back at position ${held.origin + 1}.`);\n }\n };\n React.useEffect(() => { if (!movable) setHeld(null); }, [movable]);\n\n const s = start.current;\n const h = drag && s ? s.hs[drag.from] : 0;\n const slotTop = drag && s ? (drag.to <= drag.from ? s.tops[drag.to] : s.tops[drag.to] + s.hs[drag.to] - s.hs[drag.from]) : 0;\n const span = columns.length + (selectable ? 1 : 0) + (movable ? 1 : 0);\n return (\n <div className={cx('alt-data-table', className)}>\n {(selectable || toolbar) && (\n <div className=\"alt-table-tools\">\n {sel.length > 0 && (\n <div className=\"alt-table-selection\">\n <Badge variant=\"count\" tone=\"accent\" aria-hidden=\"true\">{sel.length}</Badge>\n <span>selected</span>\n {actions?.(sel)}\n <Button size=\"sm\" variant=\"ghost\" onClick={() => setSel([])}>Clear</Button>\n </div>\n )}\n {toolbar && <div className=\"alt-table-tools-end\">{toolbar}</div>}\n </div>\n )}\n <Table ref={table} maxHeight={maxHeight} aria-label={rest['aria-label']} data-dragging={drag ? '' : undefined}\n underlay={drag && s ? <span className=\"alt-table-slot\" aria-hidden=\"true\" style={{ top: slotTop + (table.current?.offsetTop ?? 0), height: h }} /> : null}>\n <TableHeader>\n <TableRow>\n {movable && <TableHead className=\"alt-th-grip\"><span className=\"alt-sr\">Move</span></TableHead>}\n {selectable && (\n <TableHead className=\"alt-th-check\">\n <Checkbox aria-label=\"Select all rows\" checked={all} indeterminate={some} onCheckedChange={(on) => setSel(on ? Array.from(new Set([...sel, ...ids])) : sel.filter((x) => !ids.includes(x)))} />\n </TableHead>\n )}\n {columns.map((c) => (\n <TableHead key={c.key} align={c.align} style={{ width: c.width }} sort={srt?.key === c.key ? srt.direction : 'none'} onSort={c.sortValue ? () => cycle(c) : undefined}>{c.header}</TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody ref={body}>\n {!view.length && <tr><td className=\"alt-td alt-table-empty\" colSpan={span}>{empty}</td></tr>}\n {view.map((r, i) => {\n const id = ids[i];\n let shift = 0;\n if (drag && id !== drag.id && h) {\n if (drag.from < drag.to && i > drag.from && i <= drag.to) shift = -h;\n if (drag.to < drag.from && i >= drag.to && i < drag.from) shift = h;\n }\n const following = drag?.id === id;\n return (\n <TableRow key={id} rowId={id} selected={selectable && chosen.has(id)} interactive={!!onRowClick} relevance={relevance?.(r)}\n held={following || held?.id === id} data-following={following ? '' : undefined}\n style={following ? { transform: `translateY(${drag!.dy}px)` } : shift ? { transform: `translateY(${shift}px)` } : undefined}\n onClick={onRowClick ? (e) => { if (!(e.target as HTMLElement).closest('button, a, input, label, select, textarea')) onRowClick(r); } : undefined}>\n {movable && (\n <TableCell className=\"alt-td-grip\">\n <button type=\"button\" className=\"alt-table-grip\" aria-label={`Move ${name(r)}`} aria-pressed={held?.id === id}\n onPointerDown={(e) => onGripDown(e, id, i)} onPointerMove={onGripMove} onPointerUp={onGripUp} onPointerCancel={onGripUp}\n onKeyDown={(e) => onGripKey(e, id, i)} onBlur={() => { if (held?.id === id && !drag) setTimeout(() => setHeld((x) => (x?.id === id && document.activeElement?.closest(`tr[data-row=\"${CSS.escape(id)}\"]`) === null ? null : x)), 0); }}>\n <GripIcon />\n </button>\n </TableCell>\n )}\n {selectable && (\n <TableCell className=\"alt-td-check\"><Checkbox aria-label={`Select ${name(r)}`} checked={chosen.has(id)} onCheckedChange={(on) => toggle(id, on)} /></TableCell>\n )}\n {columns.map((c, ci) => {\n const content = c.cell ? c.cell(r) : String((r as any)[c.key] ?? '');\n return (\n <TableCell key={c.key} align={c.align}>\n {onRowClick && ci === 0 ? <button type=\"button\" className=\"alt-table-rowbtn\" onClick={() => onRowClick(r)}>{content}</button> : content}\n </TableCell>\n );\n })}\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n <span className=\"alt-sr\" aria-live=\"polite\">{selectable && sel.length ? `${sel.length} selected. ` : ''}{said}</span>\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Board \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface BoardPlace { column: string; index: number }\nexport interface BoardMove { cardId: string; from: BoardPlace; to: BoardPlace }\ntype SnapCard = { id: string; x: number; y: number; w: number; h: number };\ntype SnapCol = { id: string; title: string; x: number; w: number; listTop: number; gap: number; collapsed: boolean; count: number; cards: SnapCard[] };\ntype Carry = { id: string; from: BoardPlace; to: BoardPlace; dx: number; dy: number; h: number; gap: number; shifts: Record<string, number>; slotTop: number };\ntype BoardCtxT = {\n carry: Carry | null; kb: { id: string; origin: BoardPlace; at: BoardPlace } | null; landing: string | null; hintId: string;\n onPointerDown: (e: React.PointerEvent, id: string) => void; onPointerMove: (e: React.PointerEvent) => void; onPointerUp: () => void;\n onKeyDown: (e: React.KeyboardEvent, id: string) => void; onBlur: (id: string) => void; swallowClick: () => boolean;\n};\nconst BoardCtx = React.createContext<BoardCtxT | null>(null);\n\nfunction readBoard(root: HTMLElement): SnapCol[] {\n return Array.from(root.querySelectorAll<HTMLElement>('[data-board-col]')).map((col) => {\n const list = col.querySelector<HTMLElement>('.alt-board-list');\n const p = placeIn(col, root);\n const cards = list ? Array.from(list.querySelectorAll<HTMLElement>(':scope > [data-board-card]')).map((c) => {\n const q = placeIn(c, root);\n return { id: c.dataset.boardCard!, x: q.x, y: q.y, w: c.offsetWidth, h: c.offsetHeight };\n }) : [];\n return {\n id: col.dataset.boardCol!, title: col.getAttribute('aria-label') || col.dataset.boardCol!, x: p.x, w: col.offsetWidth,\n listTop: list ? placeIn(list, root).y : p.y, gap: list ? parseFloat(getComputedStyle(list).rowGap) || 8 : 8,\n collapsed: col.hasAttribute('data-collapsed'), count: Number(col.dataset.count) || 0, cards,\n };\n });\n}\n/** Where a card would land for a pointer at (cx, cy), and how every other card makes room for it. */\nfunction plan(cols: SnapCol[], id: string, cx: number, cy: number, h: number) {\n let ti = cols.findIndex((c) => cx >= c.x && cx <= c.x + c.w);\n if (ti < 0) ti = cols.reduce((best, c, i) => (Math.abs(c.x + c.w / 2 - cx) < Math.abs(cols[best].x + cols[best].w / 2 - cx) ? i : best), 0);\n const tc = cols[ti];\n const others = tc.cards.filter((c) => c.id !== id);\n const index = tc.collapsed ? tc.count : others.filter((c) => c.y + c.h / 2 < cy).length;\n const shifts: Record<string, number> = {};\n let slotTop = 0;\n for (const c of cols) {\n if (c.collapsed) continue;\n const order: (SnapCard | null)[] = c.cards.filter((k) => k.id !== id);\n if (c.id === tc.id) order.splice(index, 0, null);\n let y = c.listTop;\n for (const k of order) {\n if (!k) { slotTop = y - c.listTop; y += h + c.gap; } else { shifts[k.id] = y - k.y; y += k.h + c.gap; }\n }\n }\n return { to: { column: tc.id, index }, shifts, slotTop, gap: tc.gap };\n}\n\nexport interface BoardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Called when a card is dropped somewhere new (pointer), or moved a step (keyboard). Update your data; the board carries the cards. */\n onMove: (move: BoardMove) => void;\n /** Default \"Board\". */\n 'aria-label'?: string;\n}\n/**\n * Columns of cards. Columns are receptacles: flush at rest, they open into wells while a card is carried, and the one\n * under it deepens. Cards are raised; one picked up floats at level 3, tilted, follows the pointer, and lands with a settle.\n */\nexport const Board = React.forwardRef<HTMLDivElement, BoardProps>(function Board({ onMove, className, children, ...rest }, ref) {\n const root = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(ref, () => root.current as HTMLDivElement);\n const hintId = React.useId();\n const [carry, setCarry] = React.useState<Carry | null>(null);\n const [kb, setKb] = React.useState<BoardCtxT['kb']>(null);\n const [landing, setLanding] = React.useState<string | null>(null);\n const [said, setSaid] = React.useState('');\n const start = React.useRef<{ x: number; y: number; id: string; cols?: SnapCol[]; from?: BoardPlace; card?: SnapCard } | null>(null);\n const dragged = React.useRef(false);\n useCarry(root, '[data-board-card]', 'data-board-card');\n React.useEffect(() => { if (!landing) return; const t = setTimeout(() => setLanding(null), 450); return () => clearTimeout(t); }, [landing]);\n\n const titleOf = (col: string) => root.current?.querySelector<HTMLElement>(`[data-board-col=\"${CSS.escape(col)}\"]`)?.getAttribute('aria-label') ?? col;\n const countOf = (col: string) => Number(root.current?.querySelector<HTMLElement>(`[data-board-col=\"${CSS.escape(col)}\"]`)?.dataset.count) || 0;\n const cardEl = (id: string) => root.current?.querySelector<HTMLElement>(`[data-board-card=\"${CSS.escape(id)}\"]`) ?? null;\n const nameOf = (id: string) => { const el = cardEl(id); return el?.dataset.label || el?.textContent?.trim().split('\\n')[0] || id; };\n const locate = (id: string): BoardPlace | null => {\n const el = cardEl(id), col = el?.closest<HTMLElement>('[data-board-col]');\n if (!el || !col) return null;\n return { column: col.dataset.boardCol!, index: Array.from(col.querySelectorAll('.alt-board-list > [data-board-card]')).indexOf(el) };\n };\n const refocus = (id: string) => requestAnimationFrame(() => cardEl(id)?.focus({ preventScroll: true }));\n\n const onPointerDown = (e: React.PointerEvent, id: string) => {\n if (e.button !== 0 || kb || (e.target as HTMLElement).closest('button, a, input, textarea, select, [contenteditable]')) return;\n if ((e.currentTarget as HTMLElement).hasAttribute('data-held-by')) return; // someone else has it\n start.current = { x: e.clientX, y: e.clientY, id };\n dragged.current = false;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n };\n const onPointerMove = (e: React.PointerEvent) => {\n const s = start.current;\n if (!s || !root.current) return;\n const dx = e.clientX - s.x, dy = e.clientY - s.y;\n if (!s.cols) {\n if (Math.hypot(dx, dy) < 5) return;\n s.cols = readBoard(root.current);\n for (const c of s.cols) { const i = c.cards.findIndex((k) => k.id === s.id); if (i >= 0) { s.from = { column: c.id, index: i }; s.card = c.cards[i]; } }\n if (!s.from) { start.current = null; return; }\n dragged.current = true;\n setSaid(`Picked up ${nameOf(s.id)}.`);\n }\n const k = s.card!;\n const p = plan(s.cols, s.id, k.x + k.w / 2 + dx, k.y + k.h / 2 + dy, k.h);\n setCarry({ id: s.id, from: s.from!, to: p.to, dx, dy, h: k.h, gap: p.gap, shifts: p.shifts, slotTop: p.slotTop });\n };\n const onPointerUp = () => {\n const s = start.current;\n start.current = null;\n if (!s?.cols || !carry || !root.current) { setCarry(null); return; }\n // Where each card was drawn when it was let go, so the landing travels from there.\n const m = new Map<string, { x: number; y: number }>();\n s.cols.forEach((c) => c.cards.forEach((k) => m.set(k.id, { x: k.x + (k.id === s.id ? carry.dx : 0), y: k.y + (k.id === s.id ? carry.dy : carry.shifts[k.id] ?? 0) })));\n dropSnapshots.set(root.current, m);\n const { from, to } = carry;\n setLanding(s.id);\n setCarry(null);\n const moved = from.column !== to.column || from.index !== to.index;\n if (moved) onMove({ cardId: s.id, from, to });\n const n = countOf(to.column) + (from.column !== to.column ? 1 : 0);\n setSaid(moved ? `Dropped ${nameOf(s.id)} in ${titleOf(to.column)}, position ${Math.min(to.index + 1, n)} of ${n}.` : `Dropped ${nameOf(s.id)} where it was.`);\n };\n const go = (id: string, from: BoardPlace, to: BoardPlace, origin: BoardPlace) => {\n onMove({ cardId: id, from, to });\n setKb({ id, origin, at: to });\n refocus(id);\n const n = countOf(to.column) + (from.column !== to.column ? 1 : 0);\n setSaid(`${titleOf(to.column)}, position ${to.index + 1} of ${n}.`);\n };\n const onKeyDown = (e: React.KeyboardEvent, id: string) => {\n if (e.target !== e.currentTarget) return;\n const at = locate(id);\n if (!at) return;\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (kb?.id === id) { setKb(null); setSaid(`Dropped ${nameOf(id)} in ${titleOf(at.column)}, position ${at.index + 1} of ${countOf(at.column)}.`); return; }\n const held = cardEl(id)?.dataset.heldBy;\n if (held) { setSaid(`${nameOf(id)} is held by ${held}.`); return; }\n setKb({ id, origin: at, at });\n setSaid(`Picked up ${nameOf(id)}. ${titleOf(at.column)}, position ${at.index + 1} of ${countOf(at.column)}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`);\n return;\n }\n if (kb?.id !== id) return;\n const cols = Array.from(root.current!.querySelectorAll<HTMLElement>('[data-board-col]:not([data-collapsed])')).map((c) => c.dataset.boardCol!);\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n const to = Math.max(0, Math.min(countOf(at.column) - 1, at.index + (e.key === 'ArrowUp' ? -1 : 1)));\n if (to !== at.index) go(id, at, { column: at.column, index: to }, kb.origin);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n e.preventDefault();\n const next = cols[cols.indexOf(at.column) + (e.key === 'ArrowLeft' ? -1 : 1)];\n if (next) go(id, at, { column: next, index: Math.min(at.index, countOf(next)) }, kb.origin);\n } else if (e.key === 'Escape') {\n e.preventDefault(); e.stopPropagation();\n const o = kb.origin;\n if (o.column !== at.column || o.index !== at.index) { onMove({ cardId: id, from: at, to: o }); refocus(id); }\n setKb(null);\n setSaid(`Move cancelled. ${nameOf(id)} is back in ${titleOf(o.column)}, position ${o.index + 1}.`);\n }\n };\n // Focus leaving a card you're holding (not because it moved column) puts it down where it is.\n const onBlur = (id: string) => {\n if (kb?.id !== id) return;\n setTimeout(() => { if (!(document.activeElement as HTMLElement | null)?.matches?.(`[data-board-card=\"${CSS.escape(id)}\"]`)) setKb((x) => (x?.id === id ? null : x)); }, 80);\n };\n const swallowClick = () => { const d = dragged.current; dragged.current = false; return d; };\n const ctx: BoardCtxT = { carry, kb, landing, hintId, onPointerDown, onPointerMove, onPointerUp, onKeyDown, onBlur, swallowClick };\n return (\n <BoardCtx.Provider value={ctx}>\n <div ref={root} role=\"group\" aria-label={rest['aria-label'] ?? 'Board'} className={cx('alt-board', className)} data-carrying={carry || kb ? '' : undefined} {...rest}>\n {children}\n <span id={hintId} className=\"alt-sr\">Press Space to pick up. While holding a card, use the arrow keys to move it, Space to drop it, Escape to cancel.</span>\n <span className=\"alt-sr\" aria-live=\"assertive\">{said}</span>\n </div>\n </BoardCtx.Provider>\n );\n});\n\nexport interface BoardColumnProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {\n id: string;\n title: React.ReactNode;\n /** A collapsed column is a Pile: its thickness and count say how many cards it holds. It still takes drops. */\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Show the collapse button. */\n collapsible?: boolean;\n}\nexport function BoardColumn({ id, title, collapsed, defaultCollapsed = false, onCollapsedChange, collapsible, className, children, ...rest }: BoardColumnProps) {\n const ctx = React.useContext(BoardCtx);\n const [isCollapsed, setCollapsed] = useControllable(collapsed, defaultCollapsed, onCollapsedChange);\n const count = React.Children.toArray(children).filter(React.isValidElement).length;\n const label = typeof title === 'string' ? title : id;\n const carry = ctx?.carry;\n const over = carry ? carry.to.column === id : ctx?.kb?.at.column === id;\n const receiving = !!carry && carry.to.column === id && carry.from.column !== id && !isCollapsed;\n return (\n <section className={cx('alt-board-col', className)} data-board-col={id} data-count={count} aria-label={label}\n data-collapsed={isCollapsed ? '' : undefined} data-over={over ? '' : undefined} {...rest}>\n <header className=\"alt-board-head\">\n <h3 className=\"alt-board-title\">{title}</h3>\n <span className=\"alt-board-count\" aria-label={`${count} ${count === 1 ? 'card' : 'cards'}`}>{count}</span>\n {collapsible && (\n <Button variant=\"ghost\" size=\"sm\" square aria-expanded={!isCollapsed} aria-label={isCollapsed ? `Expand ${label}` : `Collapse ${label}`}\n className=\"alt-board-fold\" data-collapsed={isCollapsed ? '' : undefined} onClick={() => setCollapsed(!isCollapsed)}><Icons.ChevronDown /></Button>\n )}\n </header>\n {isCollapsed ? (\n <Pile count={Math.max(count, 1)} className=\"alt-board-pile\">\n <div className=\"alt-board-pile-face\"><b>{title}</b><span>{count ? `${count} ${count === 1 ? 'card' : 'cards'}` : 'No cards'}</span></div>\n </Pile>\n ) : (\n <div className=\"alt-board-list\" style={receiving ? { paddingBottom: carry!.h + carry!.gap } : undefined}>\n {carry && carry.to.column === id && <span className=\"alt-board-slot\" aria-hidden=\"true\" style={{ top: carry.slotTop, height: carry.h }} />}\n {children}\n {!count && !carry && <div className=\"alt-board-empty\">No cards</div>}\n </div>\n )}\n </section>\n );\n}\n\nexport interface BoardCardProps extends React.HTMLAttributes<HTMLDivElement> {\n id: string;\n /** How announcements name the card. Default: its first line of text. */\n label?: string;\n /** A collaborator is holding it: lifted, wearing their colour and name. It can't be picked up meanwhile. */\n heldBy?: { name: string; presence?: 1 | 2 | 3 };\n /** Afterglow: when this value changes the card arrives tinted and lifted, then settles. */\n settle?: unknown;\n}\nexport const BoardCard = React.forwardRef<HTMLDivElement, BoardCardProps>(function BoardCard({ id, label, heldBy, settle, className, style, onClickCapture, children, ...rest }, ref) {\n const ctx = React.useContext(BoardCtx);\n const depth = useDepth({ heldBy, settle });\n const carry = ctx?.carry;\n const following = carry?.id === id;\n const carried = following || ctx?.kb?.id === id;\n const shift = carry?.shifts[id];\n const transform = following ? `translate(${carry!.dx}px, ${carry!.dy}px)` : shift ? `translateY(${shift}px)` : undefined;\n return (\n <div ref={ref} className={cx('alt-board-card', className)} data-board-card={id} data-label={label} tabIndex={0} role=\"button\"\n aria-roledescription=\"draggable card\" aria-describedby={ctx?.hintId} aria-pressed={ctx?.kb?.id === id ? true : undefined}\n data-carried={carried ? '' : undefined} data-following={following ? '' : undefined} data-landing={ctx?.landing === id ? '' : undefined}\n {...depth} style={{ ...depth.style, ...style, ...(transform ? { transform } : null) }}\n onPointerDown={(e) => ctx?.onPointerDown(e, id)} onPointerMove={ctx?.onPointerMove} onPointerUp={ctx?.onPointerUp} onPointerCancel={ctx?.onPointerUp}\n onKeyDown={(e) => ctx?.onKeyDown(e, id)} onBlur={() => ctx?.onBlur(id)}\n onClickCapture={(e) => { if (ctx?.swallowClick()) { e.preventDefault(); e.stopPropagation(); } else onClickCapture?.(e); }} {...rest}>\n {children}\n </div>\n );\n});\n"],
5
- "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAGtB,IAAM,qBAAqB,OAAO,WAAW,cAAoB,kBAAkB;AAInF,IAAM,KAAK,IAAI,UAAoD,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG;AAQjG,SAAS,YAAY,MAAe,QAAgB;AACzD,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,IAAI;AACjD,QAAM,CAAC,OAAO,QAAQ,IAAU,eAA4B,OAAO,SAAS,QAAQ;AACpF,EAAM,gBAAU,MAAM;AACpB,QAAI,MAAM;AACR,iBAAW,IAAI;AACf,UAAI,KAAK;AACT,YAAM,KAAK,sBAAsB,MAAM;AAAE,aAAK,sBAAsB,MAAM,SAAS,MAAM,CAAC;AAAA,MAAG,CAAC;AAC9F,aAAO,MAAM;AAAE,6BAAqB,EAAE;AAAG,6BAAqB,EAAE;AAAA,MAAG;AAAA,IACrE;AACA,aAAS,QAAQ;AACjB,UAAM,IAAI,WAAW,MAAM,WAAW,KAAK,GAAG,MAA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,CAAC;",
6
- "names": ["move", "contrast", "Surface", "React", "Button", "Card", "Input", "Textarea", "Checkbox", "icon", "s", "React", "React", "React", "React", "EXIT_4", "React", "EXIT_5", "React", "EXIT_3", "React", "Tick", "React", "ms", "Table", "TableBody", "TableRow", "s", "cx", "Board", "k", "BoardCard"]
3
+ "sources": ["../project/components/src/core.tsx", "../project/components/src/controls.tsx", "../project/components/src/pile.tsx", "../project/components/src/overlays.tsx", "../project/components/src/nav.tsx", "../project/components/src/sheet.tsx", "../project/components/src/command.tsx", "../project/components/src/select.tsx", "../project/components/src/stepper.tsx", "../project/components/src/empty.tsx", "../project/components/src/collections.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport { createPortal } from 'react-dom';\n\n/** useLayoutEffect in the browser, useEffect on the server, where layout effects can't run (React 18 warns about them). */\nexport const useIsoLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 utilities \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport const cx = (...parts: Array<string | false | null | undefined>) => parts.filter(Boolean).join(' ');\n\n/**\n * Mount/unmount with an exit animation. Returns `mounted` (render or not) and\n * `state` (\"open\" | \"closed\") for the data-state attribute. The element first\n * renders in its closed pose, then flips to open two frames later so CSS\n * transitions run; on close it stays mounted for `exitMs`.\n */\nexport function usePresence(open: boolean, exitMs: number) {\n const [mounted, setMounted] = React.useState(open);\n const [state, setState] = React.useState<'open' | 'closed'>(open ? 'open' : 'closed');\n React.useEffect(() => {\n if (open) {\n setMounted(true);\n let r2 = 0;\n const r1 = requestAnimationFrame(() => { r2 = requestAnimationFrame(() => setState('open')); });\n return () => { cancelAnimationFrame(r1); cancelAnimationFrame(r2); };\n }\n setState('closed');\n const t = setTimeout(() => setMounted(false), exitMs);\n return () => clearTimeout(t);\n }, [open, exitMs]);\n return { mounted, state };\n}\n\nexport function useControllable<T>(value: T | undefined, defaultValue: T, onChange?: (v: T) => void) {\n const [inner, setInner] = React.useState(defaultValue);\n const controlled = value !== undefined;\n const current = controlled ? (value as T) : inner;\n const set = React.useCallback((v: T) => { if (!controlled) setInner(v); onChange?.(v); }, [controlled, onChange]);\n return [current, set] as const;\n}\n\nexport function useOutside(ref: React.RefObject<HTMLElement | null>, active: boolean, onOutside: () => void) {\n React.useEffect(() => {\n if (!active) return;\n const down = (e: PointerEvent) => { if (ref.current && !ref.current.contains(e.target as Node)) onOutside(); };\n const key = (e: KeyboardEvent) => { if (e.key === 'Escape') onOutside(); };\n document.addEventListener('pointerdown', down);\n document.addEventListener('keydown', key);\n return () => { document.removeEventListener('pointerdown', down); document.removeEventListener('keydown', key); };\n }, [active, onOutside, ref]);\n}\n\n/** Spread on an element to make it inert. React 18 passes unknown attributes through as strings and needs ''; React 19\n * knows `inert` as a boolean and treats '' as false. */\nexport const inert = { inert: React.version.split('.')[0] === '18' ? '' : true } as unknown as React.HTMLAttributes<HTMLElement>;\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 keyboard focus \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * A field shows its held rim only when focus arrived from the keyboard; a field you clicked into shows its lit floor and\n * the caret, which is enough when you know where you clicked. Browsers match :focus-visible on text fields after a click\n * too, so one shared listener remembers whether the last input was a key or a pointer and, when focus enters a field\n * (an `.alt-input`, or a whole `.alt-select` with its list), marks it `data-key-focus` until focus leaves it. It's decided\n * as focus arrives, so typing into a field you clicked doesn't add the rim, and clicking a field removes it. Until the\n * first pointer input, focus counts as keyboard, so an autofocused field shows its rim.\n */\nlet keyFocusStarted = false;\nexport function useKeyFocus() {\n React.useEffect(() => {\n if (keyFocusStarted || typeof document === 'undefined') return;\n keyFocusStarted = true;\n let key = true;\n const scope = (t: EventTarget | null) => (t instanceof Element ? t.closest<HTMLElement>('.alt-select') ?? t.closest<HTMLElement>('.alt-input') : null);\n const inside = (s: HTMLElement, t: EventTarget | null) => t instanceof Node && s.contains(t);\n document.addEventListener('keydown', (e) => { if (!e.metaKey && !e.ctrlKey && !e.altKey) key = true; }, true);\n document.addEventListener('pointerdown', (e) => { key = false; scope(e.target)?.removeAttribute('data-key-focus'); }, true);\n document.addEventListener('focusin', (e) => {\n const s = scope(e.target);\n if (!s) return;\n if (key) s.setAttribute('data-key-focus', '');\n else if (!inside(s, e.relatedTarget)) s.removeAttribute('data-key-focus');\n }, true);\n document.addEventListener('focusout', (e) => {\n const s = scope(e.target);\n if (s && !inside(s, e.relatedTarget)) s.removeAttribute('data-key-focus');\n }, true);\n }, []);\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 approach \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * The pointer is felt before it arrives. One shared tracker watches a fine pointer (mouse or pen, never touch) and,\n * for every element marked `data-approach`, writes:\n * --near 0 when the pointer is further than the element's radius (data-approach=\"96\" sets it; default 64px),\n * rising smoothly to 1 when it touches the element;\n * --mx --my where the pointer is on the element (\u22121\u20261 from centre) while it's over it, else 0.\n * Altitude's own components use it only for openings: an empty field (Input, Textarea, Select, Combobox) deepens to\n * receive, and a bottom sheet's finger pull opens under a hand. Raised things never respond to approach and never\n * follow the pointer: a button or a card stays exactly where it is until the pointer is on it. All of it is multiplied\n * by --alt-travel, so reduced motion turns it off. `AltitudeProvider approach={false}` turns it off for a subtree.\n */\nlet approachUsers = 0;\nlet approachStop: (() => void) | null = null;\nfunction startApproach() {\n let x = 0, y = 0, live = false, raf = 0;\n let touched = new Set<HTMLElement>();\n const clear = (el: HTMLElement) => { el.style.removeProperty('--near'); el.style.removeProperty('--mx'); el.style.removeProperty('--my'); };\n const frame = () => {\n raf = 0;\n const els = Array.from(document.querySelectorAll<HTMLElement>('[data-approach]'));\n const rects = els.map((el) => el.getBoundingClientRect()); // read everything first, then write\n const next = new Set<HTMLElement>();\n els.forEach((el, i) => {\n const r = rects[i];\n const radius = Number(el.dataset.approach) || 64;\n const dx = Math.max(r.left - x, 0, x - r.right), dy = Math.max(r.top - y, 0, y - r.bottom);\n const d = Math.hypot(dx, dy);\n if (!live || d >= radius || !r.width || el.closest('[data-approach-off]')) return;\n const t = 1 - d / radius;\n el.style.setProperty('--near', (t * t * (3 - 2 * t)).toFixed(3));\n const inside = d === 0;\n el.style.setProperty('--mx', inside ? (((x - r.left) / r.width) * 2 - 1).toFixed(3) : '0');\n el.style.setProperty('--my', inside ? (((y - r.top) / r.height) * 2 - 1).toFixed(3) : '0');\n next.add(el);\n });\n touched.forEach((el) => { if (!next.has(el)) clear(el); });\n touched = next;\n };\n const schedule = () => { if (!raf) raf = requestAnimationFrame(frame); };\n const move = (e: PointerEvent) => { if (e.pointerType === 'touch') { live = false; } else { live = true; x = e.clientX; y = e.clientY; } schedule(); };\n const leave = (e: PointerEvent) => { if (!e.relatedTarget) { live = false; schedule(); } };\n const blur = () => { live = false; schedule(); };\n window.addEventListener('pointermove', move, { passive: true });\n window.addEventListener('pointerdown', move, { passive: true });\n document.addEventListener('pointerout', leave, { passive: true });\n window.addEventListener('scroll', schedule, { passive: true, capture: true });\n window.addEventListener('blur', blur);\n return () => {\n cancelAnimationFrame(raf);\n window.removeEventListener('pointermove', move); window.removeEventListener('pointerdown', move);\n document.removeEventListener('pointerout', leave); window.removeEventListener('scroll', schedule, { capture: true });\n window.removeEventListener('blur', blur);\n touched.forEach(clear);\n };\n}\n/** Keeps the shared approach tracker running while any component that reacts to it is mounted. */\nexport function useApproach(enabled = true) {\n React.useEffect(() => {\n if (!enabled || typeof window === 'undefined') return;\n if (approachUsers++ === 0) approachStop = startApproach();\n return () => { if (--approachUsers === 0) { approachStop?.(); approachStop = null; } };\n }, [enabled]);\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 icons (1.75 stroke, Lucide-compatible grid) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype IconProps = React.SVGProps<SVGSVGElement> & { size?: number };\nconst icon = (paths: React.ReactNode) => ({ size = 16, ...rest }: IconProps) => (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75}\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" {...rest}>{paths}</svg>\n);\nexport const Icons = {\n Check: icon(<path d=\"M5 12.5l4.5 4.5L19 7.5\" />),\n ChevronDown: icon(<path d=\"M6 9l6 6 6-6\" />),\n X: icon(<path d=\"M6 6l12 12M18 6L6 18\" />),\n Info: icon(<><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 11v5M12 8h.01\" /></>),\n CircleCheck: icon(<><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M8.5 12.5l2.5 2.5 4.5-5\" /></>),\n AlertCircle: icon(<><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 7.5v5.5M12 16.5h.01\" /></>),\n AlertTriangle: icon(<><path d=\"M10.3 4.2L2.6 17.5A2 2 0 0 0 4.3 20.5h15.4a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0z\" /><path d=\"M12 9.5v4M12 17h.01\" /></>),\n};\nexport function Spinner({ size = 16 }: { size?: number }) {\n return (\n <svg className=\"alt-spinner\" width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke=\"currentColor\" strokeOpacity=\".25\" strokeWidth=\"2.25\" />\n <path d=\"M21 12a9 9 0 0 0-9-9\" stroke=\"currentColor\" strokeWidth=\"2.25\" strokeLinecap=\"round\" />\n </svg>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 colour math for custom accents \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RGB = [number, number, number];\nconst hexToRgb = (hex: string): RGB => {\n let h = hex.trim().replace('#', '');\n if (h.length === 3 || h.length === 4) h = h.slice(0, 3).split('').map((c) => c + c).join('');\n const n = [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));\n return (n.some(isNaN) ? [255, 255, 255] : n) as RGB;\n};\nconst rgbToHex = (c: number[]) => '#' + c.map((v) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, '0')).join('');\nconst lum = (c: RGB) => {\n const f = (v: number) => { v /= 255; return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; };\n return 0.2126 * f(c[0]) + 0.7152 * f(c[1]) + 0.0722 * f(c[2]);\n};\nexport const contrast = (a: string, b: string) => {\n const la = lum(hexToRgb(a)), lb = lum(hexToRgb(b));\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n};\nconst mix = (a: RGB, b: RGB, t: number) => a.map((v, i) => v + (b[i] - v) * t) as RGB;\n\n/**\n * Derive the four accent tokens from one brand colour, against the surfaces of\n * the active scheme: `accent` (as given), `on-accent` (white or ink, whichever\n * reads at 4.5:1), `accent-ink` (nudged toward ink until it reads at 4.5:1 on\n * every surface passed) and `accent-soft` (a tint of the ground).\n */\nexport function deriveAccent(accent: string, surfaces: string[]) {\n const a = hexToRgb(accent);\n const ground = surfaces[0] || '#ffffff';\n const dark = lum(hexToRgb(ground)) < 0.2;\n const toward: RGB = dark ? [255, 255, 255] : [0, 0, 0];\n let ink = a, t = 0;\n const worst = (c: RGB) => Math.min(...surfaces.filter(Boolean).map((s) => contrast(rgbToHex(c), s)));\n while (t < 1 && worst(ink) < 4.6) { t += 0.03; ink = mix(a, toward, t); }\n const onAccent = contrast('#ffffff', accent) >= 5 ? '#ffffff' : rgbToHex(mix(a, [0, 0, 0], 0.82));\n return {\n '--accent': rgbToHex(a),\n '--on-accent': onAccent,\n '--accent-ink': rgbToHex(ink),\n '--accent-soft': rgbToHex(mix(hexToRgb(ground), a, dark ? 0.2 : 0.13)),\n } as React.CSSProperties;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 custom schemes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst SURFACES = ['surface-trench', 'surface-well', 'surface-ground', 'surface-raised', 'surface-lifted', 'surface-floating', 'surface-overlay', 'surface-modal'] as const;\nexport type SchemeColorToken = typeof SURFACES[number] | 'ink' | 'ink-muted' | 'ink-faint' | 'line' | 'line-control'\n | 'accent' | 'on-accent' | 'accent-ink' | 'accent-soft' | 'positive' | 'positive-soft' | 'caution' | 'caution-soft'\n | 'critical' | 'critical-soft' | 'on-critical' | 'presence-1' | 'presence-2' | 'presence-3' | 'on-presence' | 'scrim';\nexport type SchemeShadowToken = 'trench' | 'well' | 'elev-0' | 'elev-1' | 'elev-2' | 'elev-3' | 'elev-4' | 'elev-5' | 'lip-top' | 'lip-bottom';\n\n// The invariants of Theming.md (\"Making a new scheme\"), as [text, ground, minimum ratio]; build/tokens.py checks the same.\nconst PAIRS: Array<[string, string, number]> = [];\nfor (const t of ['ink', 'ink-muted', 'accent-ink', 'positive', 'caution', 'critical']) for (const g of SURFACES) PAIRS.push([t, g, 4.5]);\nfor (const [t, g] of [['ink', 'accent-soft'], ['accent-ink', 'accent-soft'], ['positive', 'positive-soft'], ['caution', 'caution-soft'], ['critical', 'critical-soft'],\n ['ink', 'critical-soft'], ['ink', 'positive-soft'], ['ink', 'caution-soft'], ['ink-muted', 'accent-soft'], ['on-accent', 'accent'], ['on-critical', 'critical']]) PAIRS.push([t, g, 4.5]);\nfor (const g of ['surface-ground', 'surface-well', 'surface-raised', 'surface-trench']) PAIRS.push(['line-control', g, 3], ['accent', g, 3]);\nfor (const p of ['presence-1', 'presence-2', 'presence-3']) { PAIRS.push(['on-presence', p, 4.5]); for (const g of SURFACES) PAIRS.push([p, g, 3]); }\nconst isHex = (v: string) => /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(v);\n\n/**\n * Check a scheme against the invariants every scheme keeps: the surfaces climb in lightness (trench < well < ground\n * < raised \u2264 \u2026 \u2264 modal) and text, control edges and presence colours hold their contrast on every surface. Pass the\n * colour tokens by name (without `--`), or an element to read them from. Returns one sentence per problem; [] passes.\n * Only hex values can be measured; any other value of a checked token is reported.\n */\nexport function checkScheme(colors: Partial<Record<SchemeColorToken, string>> | Element): string[] {\n const cs = typeof Element !== 'undefined' && colors instanceof Element ? getComputedStyle(colors) : null;\n const get = (n: string) => (cs ? cs.getPropertyValue('--' + n) : (colors as Record<string, string | undefined>)[n] ?? '').trim();\n const out: string[] = [];\n const seen = new Set<string>();\n const ok = (n: string) => {\n const v = get(n);\n if (isHex(v)) return true;\n if (!seen.has(n)) { seen.add(n); out.push(v ? `${n} is ${v}: use a 3- or 6-digit hex colour so it can be checked.` : `${n} is missing.`); }\n return false;\n };\n const L = (n: string) => lum(hexToRgb(get(n)));\n for (let i = 1; i < SURFACES.length; i++) {\n const lo = SURFACES[i - 1], hi = SURFACES[i];\n if (!ok(lo) || !ok(hi)) continue;\n // Light schemes reach white at raised, so the upper rungs may tie; the lower three must step.\n if (i <= 3 ? L(hi) <= L(lo) : L(hi) < L(lo)) out.push(`${hi} (${get(hi)}) must be ${i <= 3 ? 'lighter than' : 'at least as light as'} ${lo} (${get(lo)}).`);\n }\n for (const [t, g, min] of PAIRS) {\n if (!ok(t) || !ok(g)) continue;\n const r = contrast(get(t), get(g));\n if (r < min) out.push(`${t} on ${g} is ${r.toFixed(2)}:1; it needs ${min}:1.`);\n }\n return out;\n}\n\nexport interface CustomScheme {\n /** Stamped as data-scheme on the provider's root. */\n name: string;\n /** The built-in scheme your tokens are laid over: any token you leave out comes from it, and so does light or dark\n * handling (casts, rims, walls). Use nightfall or alpine for a dark scheme. Default 'daylight'. */\n base?: BuiltInScheme;\n /** Colour and shadow tokens by name, without `--`. */\n tokens: Partial<Record<SchemeColorToken | SchemeShadowToken, string>>;\n}\n\nconst SHADOW_OR_LINE = /^(trench|well|elev-\\d|lip-top|lip-bottom|line)$/;\n/** A custom scheme as a stylesheet scoped to one provider. Shadows and `line` give way to high contrast, as the built-in ones do. */\nfunction schemeCss(sel: string, tokens: CustomScheme['tokens']) {\n const decl = (keep: (k: string) => boolean) => Object.entries(tokens)\n .filter(([k, v]) => keep(k) && typeof v === 'string' && /^[\\w-]+$/.test(k) && !/[;{}<>]/.test(v))\n .map(([k, v]) => `--${k}: ${v};`).join(' ');\n const plain = decl((k) => !SHADOW_OR_LINE.test(k)), soft = decl((k) => SHADOW_OR_LINE.test(k));\n let css = plain ? `${sel} { ${plain} }` : '';\n if (soft) css += `@media not (prefers-contrast: more) { ${sel}:not([data-contrast=\"more\"], [data-contrast=\"more\"] *) { ${soft} } }`;\n return css;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 provider \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type BuiltInScheme = 'daylight' | 'nightfall' | 'mesa' | 'alpine';\n/** A built-in scheme, the name of your own [data-theme=\"\u2026\"] block, or a CustomScheme. */\nexport type Scheme = BuiltInScheme | (string & {});\ntype Ctx = { host: HTMLElement | null; pushLayer: () => () => void };\nconst AltitudeContext = React.createContext<Ctx | null>(null);\nexport const useAltitude = () => React.useContext(AltitudeContext);\n\nexport interface AltitudeProviderProps extends React.HTMLAttributes<HTMLDivElement> {\n scheme?: Scheme | CustomScheme;\n accent?: string;\n motion?: 'system' | 'full' | 'reduced';\n /** 'more' renders elevation as hard, high-contrast slabs (offset = height). 'system' follows prefers-contrast. */\n contrast?: 'system' | 'more';\n recede?: boolean;\n /** Openings deepen as the pointer approaches (empty fields, a sheet's finger pull). Default true; reduced motion turns it off regardless. */\n approach?: boolean;\n}\n\nexport function AltitudeProvider({ scheme, accent, motion = 'system', contrast = 'system', recede = true, approach = true, className, style, children, ...rest }: AltitudeProviderProps) {\n const rootRef = React.useRef<HTMLDivElement>(null);\n const [host, setHost] = React.useState<HTMLElement | null>(null);\n const [layers, setLayers] = React.useState(0);\n const [accentVars, setAccentVars] = React.useState<React.CSSProperties | null>(null);\n const custom = scheme && typeof scheme === 'object' ? scheme : null;\n const schemeKey = custom ? JSON.stringify(custom) : (scheme as string | undefined);\n const scope = React.useId();\n const schemeSel = `.alt-root[data-scheme-id=\"${scope}\"]`;\n\n // A custom scheme that breaks the invariants says so, once per version of it.\n const warned = React.useRef('');\n React.useEffect(() => {\n if (!custom || !rootRef.current || warned.current === schemeKey) return;\n warned.current = schemeKey!;\n const issues = checkScheme(rootRef.current);\n if (issues.length) console.warn(`Altitude: the scheme \"${custom.name}\" breaks ${issues.length} of the scheme invariants (see Theming.md):\\n` + issues.join('\\n'));\n }, [schemeKey]); // eslint-disable-line react-hooks/exhaustive-deps\n\n useIsoLayoutEffect(() => {\n if (!accent || !rootRef.current) { setAccentVars(null); return; }\n const el = rootRef.current;\n const compute = () => {\n const cs = getComputedStyle(el);\n const read = (n: string) => cs.getPropertyValue(n).trim();\n setAccentVars(deriveAccent(accent, ['--surface-ground', '--surface-trench', '--surface-raised', '--surface-modal'].map(read)));\n };\n compute();\n const mo = new MutationObserver(compute);\n mo.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });\n return () => mo.disconnect();\n }, [accent, schemeKey]);\n\n const api = React.useMemo<Ctx>(() => ({\n host,\n pushLayer: () => { setLayers((n) => n + 1); return () => setLayers((n) => n - 1); },\n }), [host]);\n\n return (\n <AltitudeContext.Provider value={api}>\n <div ref={rootRef} className={cx('alt-root', className)} data-theme={custom ? custom.base ?? 'daylight' : scheme}\n data-scheme={custom?.name} data-scheme-id={custom ? scope : undefined}\n data-motion={motion === 'system' ? undefined : motion} data-contrast={contrast === 'more' ? 'more' : undefined}\n data-approach-off={approach ? undefined : ''} style={{ ...accentVars, ...style }} {...rest}>\n {custom && <style>{schemeCss(schemeSel, custom.tokens)}</style>}\n <div className=\"alt-stage\" data-receded={recede && layers > 0 ? '' : undefined}>{children}</div>\n <div className=\"alt-layers\" ref={setHost} />\n </div>\n </AltitudeContext.Provider>\n );\n}\n\n/** Renders into the provider's layer host (inside the theme, outside the receding stage), else document.body. */\nexport function Layer({ children }: { children: React.ReactNode }) {\n const ctx = useAltitude();\n const [ready, setReady] = React.useState(false);\n React.useEffect(() => setReady(true), []);\n if (!ready) return null;\n const target = ctx ? ctx.host : document.body;\n return target ? createPortal(children, target) : null;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Depth signals \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * Attention budget: abrupt onsets capture attention, and people track only about\n * four moving things at once. Rises that start together are staggered so no more\n * than four begin within any 250ms window.\n */\nconst riseStarts: number[] = [];\nexport function riseDelay() {\n const now = performance.now();\n while (riseStarts.length && now - riseStarts[0] > 250) riseStarts.shift();\n const delay = Math.max(0, riseStarts.length - 3) * 90;\n riseStarts.push(now + delay);\n return delay;\n}\n\nexport type Presence = 1 | 2 | 3;\nexport interface DepthProps {\n /** Afterglow. Any value: when it changes the surface lifts, tints and settles back over dur-settle. `true` settles once on mount. */\n settle?: unknown;\n /** Commit state of an optimistic write. pending hovers above the ground (after dur-grace), committed lands, failed drops into a trench. */\n status?: 'pending' | 'committed' | 'failed';\n /** Someone is holding this: lifted to level 3 with their presence colour and name. */\n heldBy?: { name: string; presence?: Presence } | null;\n /** Focus+context. match rises one level, miss sinks into a well; nothing is removed. */\n relevance?: 'match' | 'miss';\n}\n\n/** Turns depth signals into the data attributes bundle.css reads. Spread the result onto any surface. */\nexport function useDepth({ settle, status, heldBy, relevance }: DepthProps) {\n const [glow, setGlow] = React.useState<'a' | 'b' | undefined>(undefined);\n const [land, setLand] = React.useState<'a' | 'b' | undefined>(undefined);\n const [delay, setDelay] = React.useState(0);\n const mounted = React.useRef(false);\n const lastStatus = React.useRef(status);\n React.useEffect(() => {\n const first = !mounted.current;\n mounted.current = true;\n if (settle === undefined || settle === null || settle === false) return;\n if (first && settle !== true) return;\n setDelay(riseDelay());\n setGlow((g) => (g === 'a' ? 'b' : 'a'));\n }, [settle]);\n React.useEffect(() => {\n if (lastStatus.current === 'pending' && status === 'committed') setLand((l) => (l === 'a' ? 'b' : 'a'));\n lastStatus.current = status;\n }, [status]);\n return {\n 'data-settle': glow,\n 'data-land': land,\n 'data-status': status,\n 'data-held': heldBy ? '' : undefined,\n 'data-held-by': heldBy?.name,\n 'data-presence': heldBy ? String(heldBy.presence ?? 1) : undefined,\n 'data-relevance': relevance,\n 'aria-busy': status === 'pending' || undefined,\n style: delay ? ({ '--alt-rise-delay': delay + 'ms' } as React.CSSProperties) : undefined,\n };\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Surface \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type Level = -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5;\nexport interface SurfaceProps extends React.HTMLAttributes<HTMLElement>, DepthProps {\n level?: Level;\n interactive?: boolean;\n as?: keyof React.JSX.IntrinsicElements;\n}\nexport const Surface = React.forwardRef<HTMLElement, SurfaceProps>(function Surface(\n { level = 1, interactive = false, as = 'div', className, settle, status, heldBy, relevance, style, ...rest }, ref) {\n const Comp = as as any;\n const { style: depthStyle, ...depth } = useDepth({ settle, status, heldBy, relevance });\n return <Comp ref={ref} className={cx('alt-surface', interactive && 'alt-lift', className)} data-level={String(level)}\n tabIndex={interactive && rest.onClick && as === 'div' ? 0 : undefined} {...depth} style={{ ...depthStyle, ...style }} {...rest} />;\n});\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Kbd \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface KbdProps extends React.HTMLAttributes<HTMLElement> {\n /** A KeyboardEvent.key (case-insensitive) \u2014 the key presses down while it is held. */\n listen?: string;\n}\nexport function Kbd({ listen, className, children, ...rest }: KbdProps) {\n const [down, setDown] = React.useState(false);\n React.useEffect(() => {\n if (!listen) return;\n const k = listen.toLowerCase();\n const on = (e: KeyboardEvent) => { if (e.key.toLowerCase() === k) setDown(true); };\n const off = (e: KeyboardEvent) => { if (e.key.toLowerCase() === k || e.key === 'Meta') setDown(false); };\n const blur = () => setDown(false);\n window.addEventListener('keydown', on); window.addEventListener('keyup', off); window.addEventListener('blur', blur);\n return () => { window.removeEventListener('keydown', on); window.removeEventListener('keyup', off); window.removeEventListener('blur', blur); };\n }, [listen]);\n return <kbd className={cx('alt-kbd', className)} data-pressed={down ? '' : undefined} {...rest}>{children}</kbd>;\n}\n", "import * as React from 'react';\nimport { cx, DepthProps, Icons, inert, riseDelay, Spinner, useApproach, useControllable, useDepth, useIsoLayoutEffect, useKeyFocus } from './core';\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: 'primary' | 'secondary' | 'ghost' | 'danger';\n size?: 'sm' | 'md' | 'lg';\n /** Icon-only: a square button. Give it an aria-label. */\n square?: boolean;\n loading?: boolean;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n}\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { variant = 'secondary', size = 'md', square, loading, leading, trailing, className, children, disabled, type = 'button', ...rest }, ref) {\n return (\n <button ref={ref} type={type} className={cx('alt-btn', className)} data-variant={variant} data-size={size}\n data-square={square ? '' : undefined} data-loading={loading ? '' : undefined}\n aria-busy={loading || undefined} disabled={disabled} {...rest}\n onClick={loading ? (e) => e.preventDefault() : rest.onClick}>\n <span className=\"alt-btn-label\">{leading}{children}{trailing}</span>\n {loading && <span className=\"alt-btn-spinner\"><Spinner size={size === 'sm' ? 14 : 16} /></span>}\n </button>\n );\n});\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Card \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface CardProps extends React.HTMLAttributes<HTMLDivElement>, DepthProps {\n /** Lifts on hover and presses on click. Only set it when the whole card does something. */\n interactive?: boolean;\n}\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(\n { interactive, className, onKeyDown, settle, status, heldBy, relevance, style, ...rest }, ref) {\n const actionable = interactive && !!rest.onClick;\n const { style: depthStyle, ...depth } = useDepth({ settle, status, heldBy, relevance });\n return <div ref={ref} className={cx('alt-card', interactive && 'alt-lift', className)}\n role={actionable ? 'button' : undefined} tabIndex={actionable ? 0 : undefined}\n onKeyDown={actionable ? (e) => { onKeyDown?.(e); if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); (e.currentTarget as HTMLElement).click(); } } : onKeyDown}\n {...depth} style={{ ...depthStyle, ...style }} {...rest} />;\n});\nexport const CardHeader = ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => <div className={cx('alt-card-header', className)} {...p} />;\nexport const CardTitle = ({ className, ...p }: React.HTMLAttributes<HTMLHeadingElement>) => <h3 className={cx('alt-card-title', className)} {...p} />;\nexport const CardDescription = ({ className, ...p }: React.HTMLAttributes<HTMLParagraphElement>) => <p className={cx('alt-card-desc', className)} {...p} />;\nexport const CardContent = ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => <div className={cx('alt-card-content', className)} {...p} />;\nexport const CardFooter = ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => <div className={cx('alt-card-footer', className)} {...p} />;\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Input / Textarea / Field \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {\n invalid?: boolean;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n size?: 'sm' | 'md';\n}\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(function Input(\n { invalid, leading, trailing, size = 'md', className, disabled, placeholder, ...rest }, ref) {\n useApproach();\n useKeyFocus();\n return (\n <div className={cx('alt-input', className)} data-size={size} data-approach=\"56\" data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}>\n {leading && <span className=\"alt-input-adorn\">{leading}</span>}\n {/* A placeholder (even a blank one) lets the well know whether it's empty or filled, without JavaScript. */}\n <input ref={ref} disabled={disabled} aria-invalid={invalid || undefined} placeholder={placeholder ?? ' '} {...rest} />\n {trailing && <span className=\"alt-input-adorn\">{trailing}</span>}\n </div>\n );\n});\n\nexport interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n invalid?: boolean;\n /** With maxLength, the well fills from the bottom as the text approaches the limit, and shows a count. Default true. */\n showFill?: boolean;\n}\n/** A deep well. With a maxLength it shows how full it is: a fill line rises from the floor as you type. */\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { invalid, className, disabled, placeholder, maxLength, showFill = true, onChange, value, defaultValue, ...rest }, ref) {\n const [len, setLen] = React.useState(() => String(value ?? defaultValue ?? '').length);\n React.useEffect(() => { if (value !== undefined) setLen(String(value).length); }, [value]);\n const gauge = showFill && maxLength ? Math.min(1, len / maxLength) : null;\n const level = gauge === null ? undefined : len >= maxLength! ? 'full' : gauge >= 0.9 ? 'near' : 'ok';\n useApproach();\n useKeyFocus();\n return (\n <div className={cx('alt-input', className)} data-multiline=\"\" data-approach=\"56\" data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}\n data-fill={level} style={gauge !== null ? ({ ['--alt-fill' as any]: gauge } as React.CSSProperties) : undefined}>\n {gauge !== null && <span className=\"alt-input-gauge\" aria-hidden=\"true\" />}\n <textarea ref={ref} disabled={disabled} aria-invalid={invalid || undefined} placeholder={placeholder ?? ' '} maxLength={maxLength}\n value={value} defaultValue={defaultValue} {...rest} onChange={(e) => { setLen(e.target.value.length); onChange?.(e); }} />\n {gauge !== null && <span className=\"alt-input-count\" aria-live=\"polite\">{len} / {maxLength}</span>}\n </div>\n );\n});\n\nexport interface FieldProps {\n label: React.ReactNode;\n hint?: React.ReactNode;\n /** When set, the control turns invalid and the message emerges beneath it. */\n error?: React.ReactNode;\n required?: boolean;\n className?: string;\n children: React.ReactElement<any>;\n}\nexport function Field({ label, hint, error, required, className, children }: FieldProps) {\n const id = React.useId();\n const controlId = children.props.id || id + '-control';\n const describedBy = [hint && id + '-hint', error && id + '-error'].filter(Boolean).join(' ') || undefined;\n return (\n <div className={cx('alt-field', className)}>\n <label className=\"alt-field-label\" htmlFor={controlId}>{label}{required && <span className=\"alt-field-req\" aria-hidden=\"true\"> *</span>}</label>\n {React.cloneElement(children, { id: controlId, 'aria-describedby': describedBy, invalid: !!error || children.props.invalid, required })}\n {hint && !error && <p className=\"alt-field-hint\" id={id + '-hint'}>{hint}</p>}\n {error && <p className=\"alt-field-error\" id={id + '-error'} role=\"alert\"><Icons.AlertCircle size={14} />{error}</p>}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Checkbox \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {\n label?: React.ReactNode;\n description?: React.ReactNode;\n indeterminate?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n}\n/** Built like the Switch and RadioGroup: an empty trench when off; checking pours the accent in and sets a raised white check on it. */\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, description, indeterminate, onCheckedChange, onChange, className, disabled, ...rest }, ref) {\n const inner = React.useRef<HTMLInputElement>(null);\n React.useImperativeHandle(ref, () => inner.current as HTMLInputElement);\n React.useEffect(() => { if (inner.current) inner.current.indeterminate = !!indeterminate; }, [indeterminate]);\n return (\n <label className={cx('alt-check', className)} data-disabled={disabled ? '' : undefined}>\n <input ref={inner} type=\"checkbox\" disabled={disabled} {...rest}\n onChange={(e) => { onChange?.(e); onCheckedChange?.(e.target.checked); }} />\n <span className=\"alt-check-track\" aria-hidden=\"true\">\n <span className=\"alt-check-fill\" />\n <svg className=\"alt-check-mark\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.25\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path className=\"alt-check-tick\" d=\"M3.5 8.5l3 3 6-6.5\" pathLength={16} />\n <path className=\"alt-check-dash\" d=\"M4 8h8\" pathLength={16} />\n </svg>\n </span>\n {(label || description) && (\n <span className=\"alt-check-text\">\n {label && <span className=\"alt-check-label\">{label}</span>}\n {description && <span className=\"alt-check-desc\">{description}</span>}\n </span>\n )}\n </label>\n );\n});\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 RadioGroup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype RadioCtxT = { name: string; value: string; set: (v: string) => void; disabled?: boolean; register: (v: string, el: HTMLElement | null) => void };\nconst RadioCtx = React.createContext<RadioCtxT | null>(null);\nexport interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: string; defaultValue?: string; onValueChange?: (v: string) => void; name?: string; disabled?: boolean;\n orientation?: 'vertical' | 'horizontal';\n}\n/** A switch with several positions: one raised thumb slides to the chosen option and the accent pours in behind it. */\nexport function RadioGroup({ value, defaultValue = '', onValueChange, name, disabled, orientation = 'vertical', className, children, ...rest }: RadioGroupProps) {\n const auto = React.useId();\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const root = React.useRef<HTMLDivElement>(null);\n const slots = React.useRef(new Map<string, HTMLElement>());\n const [bead, setBead] = React.useState<{ x: number; y: number; ready: boolean } | null>(null);\n const register = React.useCallback((val: string, el: HTMLElement | null) => { if (el) slots.current.set(val, el); else slots.current.delete(val); }, []);\n const measure = React.useCallback(() => {\n const el = slots.current.get(v), r = root.current;\n if (!el || !r) { setBead(null); return; }\n const a = el.getBoundingClientRect(), b = r.getBoundingClientRect();\n const x = a.left - b.left + a.width / 2, y = a.top - b.top + a.height / 2;\n setBead((p) => (p && p.x === x && p.y === y ? p : { x, y, ready: !!p }));\n }, [v]);\n useIsoLayoutEffect(() => { measure(); }, [measure]);\n React.useEffect(() => {\n const ro = new ResizeObserver(() => measure());\n if (root.current) ro.observe(root.current);\n document.fonts?.ready.then(() => measure());\n return () => ro.disconnect();\n }, [measure]);\n return (\n <RadioCtx.Provider value={{ name: name || auto, value: v, set, disabled, register }}>\n <div ref={root} role=\"radiogroup\" className={cx('alt-radio-group', className)} data-orientation={orientation} data-disabled={disabled ? '' : undefined} {...rest}>\n {children}\n {bead && (\n <span className=\"alt-radio-thumb\" aria-hidden=\"true\" data-ready={bead.ready ? '' : undefined}\n style={{ transform: `translate(${bead.x}px, ${bead.y}px)` }} />\n )}\n </div>\n </RadioCtx.Provider>\n );\n}\nexport interface RadioProps { value: string; label?: React.ReactNode; description?: React.ReactNode; disabled?: boolean; className?: string }\nexport function Radio({ value, label, description, disabled, className }: RadioProps) {\n const g = React.useContext(RadioCtx);\n const off = disabled || g?.disabled;\n return (\n <label className={cx('alt-check alt-radio', className)} data-disabled={off ? '' : undefined}>\n <input type=\"radio\" name={g?.name} value={value} disabled={off} checked={g ? g.value === value : undefined}\n onChange={() => g?.set(value)} />\n <span className=\"alt-check-track\" data-round=\"\" aria-hidden=\"true\" ref={(el) => g?.register(value, el)}><span className=\"alt-check-fill\" /></span>\n {(label || description) && (\n <span className=\"alt-check-text\">\n {label && <span className=\"alt-check-label\">{label}</span>}\n {description && <span className=\"alt-check-desc\">{description}</span>}\n </span>\n )}\n </label>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Switch \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {\n checked?: boolean; defaultChecked?: boolean; onCheckedChange?: (v: boolean) => void; label?: React.ReactNode;\n}\nexport function Switch({ checked, defaultChecked = false, onCheckedChange, label, className, disabled, ...rest }: SwitchProps) {\n const [on, set] = useControllable(checked, defaultChecked, onCheckedChange);\n const control = (\n <button type=\"button\" role=\"switch\" aria-checked={on} disabled={disabled} className={cx('alt-switch', !label && className)}\n {...rest} onClick={(e) => { rest.onClick?.(e); set(!on); }}>\n <span className=\"alt-switch-fill\" />\n <span className=\"alt-switch-thumb\" />\n </button>\n );\n if (!label) return control;\n return <label className={cx('alt-switch-row', className)} data-disabled={disabled ? '' : undefined}>{control}<span>{label}</span></label>;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Tabs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\ntype TabsCtxT = { value: string; set: (v: string) => void; id: string; variant: 'folder' | 'segmented'; register: (v: string, el: HTMLButtonElement | null) => void; nodes: React.MutableRefObject<Map<string, HTMLButtonElement>> };\nconst TabsCtx = React.createContext<TabsCtxT | null>(null);\nexport interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n value?: string; defaultValue?: string; onValueChange?: (v: string) => void;\n /**\n * folder (default): each tab is the top edge of its own sheet; the chosen tab and its panel are one raised piece.\n * Put TabsContent directly after TabsList. segmented: the options sit in a well and a raised pill glides between them.\n */\n variant?: 'folder' | 'segmented';\n}\nexport function Tabs({ value, defaultValue = '', onValueChange, variant = 'folder', className, children, ...rest }: TabsProps) {\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const id = React.useId();\n const nodes = React.useRef(new Map<string, HTMLButtonElement>());\n const register = React.useCallback((val: string, el: HTMLButtonElement | null) => { if (el) nodes.current.set(val, el); else nodes.current.delete(val); }, []);\n return <TabsCtx.Provider value={{ value: v, set, id, variant, register, nodes }}><div className={cx('alt-tabs', className)} data-variant={variant} {...rest}>{children}</div></TabsCtx.Provider>;\n}\nexport function TabsList({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>) {\n const t = React.useContext(TabsCtx)!;\n const listRef = React.useRef<HTMLDivElement>(null);\n const pill = t.variant === 'segmented';\n const [ind, setInd] = React.useState<{ x: number; w: number; ready: boolean }>({ x: 0, w: 0, ready: false });\n const measure = React.useCallback(() => {\n if (!pill) return;\n const el = t.nodes.current.get(t.value);\n if (!el) return;\n setInd((p) => ({ x: el.offsetLeft, w: el.offsetWidth, ready: p.w > 0 || p.ready }));\n }, [t.value, t.nodes, pill]);\n useIsoLayoutEffect(() => { measure(); }, [measure]);\n React.useEffect(() => {\n if (!pill) return;\n const ro = new ResizeObserver(measure);\n if (listRef.current) ro.observe(listRef.current);\n document.fonts?.ready.then(measure);\n return () => ro.disconnect();\n }, [measure, pill]);\n const onKeyDown = (e: React.KeyboardEvent) => {\n const keys = [...t.nodes.current.keys()];\n const i = keys.indexOf(t.value);\n const next = e.key === 'ArrowRight' ? keys[(i + 1) % keys.length] : e.key === 'ArrowLeft' ? keys[(i - 1 + keys.length) % keys.length]\n : e.key === 'Home' ? keys[0] : e.key === 'End' ? keys[keys.length - 1] : null;\n if (next) { e.preventDefault(); t.set(next); t.nodes.current.get(next)?.focus(); }\n };\n return (\n <div ref={listRef} role=\"tablist\" className={cx('alt-tabs-list', className)} onKeyDown={onKeyDown} {...rest}>\n {pill && <span className=\"alt-tabs-indicator\" aria-hidden=\"true\" data-ready={ind.ready ? '' : undefined}\n style={{ transform: `translateX(${ind.x}px)`, width: ind.w, opacity: ind.w ? 1 : 0 }} />}\n {children}\n </div>\n );\n}\nexport function TabsTrigger({ value, className, children, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & { value: string }) {\n const t = React.useContext(TabsCtx)!;\n const on = t.value === value;\n return (\n <button ref={(el) => t.register(value, el)} type=\"button\" role=\"tab\" id={`${t.id}-t-${value}`} aria-controls={`${t.id}-p-${value}`}\n aria-selected={on} tabIndex={on ? 0 : -1} className={cx('alt-tabs-trigger', className)} onClick={() => t.set(value)} {...rest}>{children}</button>\n );\n}\nexport function TabsContent({ value, className, ...rest }: React.HTMLAttributes<HTMLDivElement> & { value: string }) {\n const t = React.useContext(TabsCtx)!;\n if (t.value !== value) return null;\n return <div role=\"tabpanel\" id={`${t.id}-p-${value}`} aria-labelledby={`${t.id}-t-${value}`} tabIndex={0} className={cx('alt-tabs-content', className)} {...rest} />;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Slider \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n value?: number; defaultValue?: number; onValueChange?: (v: number) => void;\n min?: number; max?: number; step?: number; disabled?: boolean;\n /** Format the value shown in the bubble that floats above the thumb while dragging. */\n format?: (v: number) => React.ReactNode;\n 'aria-label'?: string;\n}\nexport function Slider({ value, defaultValue = 50, onValueChange, min = 0, max = 100, step = 1, disabled, format = (v) => v, className, ...rest }: SliderProps) {\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const [drag, setDrag] = React.useState(false);\n const track = React.useRef<HTMLDivElement>(null);\n const clamp = (n: number) => Math.min(max, Math.max(min, Math.round((n - min) / step) * step + min));\n const fromX = (x: number) => { const r = track.current!.getBoundingClientRect(); return clamp(min + ((x - r.left) / r.width) * (max - min)); };\n const pct = ((v - min) / (max - min)) * 100;\n return (\n <div className={cx('alt-slider', className)} data-dragging={drag ? '' : undefined} data-disabled={disabled ? '' : undefined}\n onPointerDown={(e) => { if (disabled) return; (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId); setDrag(true); set(fromX(e.clientX)); (e.currentTarget.querySelector('.alt-slider-thumb') as HTMLElement)?.focus(); }}\n onPointerMove={(e) => { if (drag) set(fromX(e.clientX)); }}\n onPointerUp={() => setDrag(false)} onPointerCancel={() => setDrag(false)} {...rest}>\n <div className=\"alt-slider-track\" ref={track}>\n <div className=\"alt-slider-fill\" style={{ width: pct + '%' }} />\n </div>\n <div className=\"alt-slider-thumb\" role=\"slider\" tabIndex={disabled ? -1 : 0} aria-valuemin={min} aria-valuemax={max} aria-valuenow={v}\n aria-label={rest['aria-label']} aria-disabled={disabled || undefined} style={{ left: pct + '%' }}\n onKeyDown={(e) => {\n const big = (max - min) / 10;\n const map: Record<string, number> = { ArrowRight: v + step, ArrowUp: v + step, ArrowLeft: v - step, ArrowDown: v - step, PageUp: v + big, PageDown: v - big, Home: min, End: max };\n if (e.key in map) { e.preventDefault(); set(clamp(map[e.key])); }\n }}>\n <span className=\"alt-slider-bubble\" aria-hidden=\"true\">{format(v)}</span>\n </div>\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Progress \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> { value?: number | null; max?: number; 'aria-label'?: string }\nexport function Progress({ value = null, max = 100, className, ...rest }: ProgressProps) {\n const ind = value === null || value === undefined;\n return (\n <div role=\"progressbar\" aria-valuemin={0} aria-valuemax={max} aria-valuenow={ind ? undefined : value}\n className={cx('alt-progress', className)} data-indeterminate={ind ? '' : undefined} {...rest}>\n <div className=\"alt-progress-fill\" style={ind ? undefined : { width: `${Math.max(0, Math.min(100, (value! / max) * 100))}%` }} />\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Badge \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';\n /**\n * plate (default): an indicator plate set flush into the page. tinted: the plate takes its tone's colour.\n * outline: a hairline only. count: a number that wants attention; it floats above the page and pops when it changes.\n * ('soft' is the old name for tinted.)\n */\n variant?: 'plate' | 'tinted' | 'outline' | 'count' | 'soft';\n /** The indicator lamp. On by default for positive, caution and critical; true on a neutral badge shows an unlit lamp. 'pulse' breathes, for something in progress. */\n lamp?: boolean | 'pulse';\n /** @deprecated Use `lamp`. */\n dot?: boolean;\n}\n/** A label stamped into the record. Status carries a lamp that relights when it changes; a changed label is re-stamped. */\nexport function Badge({ tone = 'neutral', variant = 'plate', lamp, dot, className, children, ...rest }: BadgeProps) {\n const v = variant === 'soft' ? 'tinted' : variant;\n const showLamp = v !== 'count' && !!(lamp ?? (dot || tone === 'positive' || tone === 'caution' || tone === 'critical'));\n const label = typeof children === 'string' || typeof children === 'number' ? String(children) : undefined;\n const [stamp, setStamp] = React.useState<'a' | 'b' | undefined>(undefined);\n const [lit, setLit] = React.useState(0);\n const prev = React.useRef({ tone, label });\n React.useEffect(() => {\n const p = prev.current;\n if (p.label !== label) setStamp((x) => (x === 'a' ? 'b' : 'a'));\n if (p.tone !== tone) setLit((n) => n + 1);\n prev.current = { tone, label };\n }, [tone, label]);\n return (\n <span className={cx('alt-badge', className)} data-tone={tone} data-variant={v} data-stamp={stamp} {...rest}>\n {showLamp && <span key={lit} className=\"alt-badge-lamp\" aria-hidden=\"true\" data-lit={lit ? '' : undefined} data-pulse={lamp === 'pulse' ? '' : undefined} />}\n {children}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Avatar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst TINTS = ['accent', 'positive', 'caution', 'critical'];\nexport interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {\n name: string;\n src?: string;\n size?: number;\n /** Presence as height: active people hover above the page (their shadow drops away), idle ones rest on it, offline ones lie flat and grey. */\n status?: 'active' | 'idle' | 'offline';\n /** Speaking, typing or presenting right now: the avatar drifts gently. */\n live?: boolean;\n /** Ties the person to their presence colour, the same ring they wear on anything they're holding. */\n presence?: 1 | 2 | 3;\n /** The status lamp (green active, amber idle). Default: shown when there is a status and the avatar is 24px or larger. Never shown inside AvatarGroup. */\n lamp?: boolean;\n}\n/** A disc above its own shadow. The gap between them is how high the person is: how present they are right now. */\nexport function Avatar({ name, src, size = 36, status, live, presence, lamp, className, style, onClick, ...rest }: AvatarProps) {\n const initials = name.split(/\\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]!.toUpperCase()).join('');\n const tint = TINTS[[...name].reduce((a, c) => a + c.charCodeAt(0), 0) % TINTS.length];\n const label = [name, status, live && 'live'].filter(Boolean).join(', ');\n const showLamp = (lamp ?? size >= 24) && (status === 'active' || status === 'idle');\n return (\n <span className={cx('alt-avatar', className)} data-tint={tint} data-status={status} data-live={live ? '' : undefined}\n data-presence={presence ? String(presence) : undefined} data-interactive={onClick ? '' : undefined}\n role={onClick ? 'button' : 'img'} tabIndex={onClick ? 0 : undefined} aria-label={label} title={label} onClick={onClick}\n onKeyDown={onClick ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); (e.currentTarget as HTMLElement).click(); } } : undefined}\n style={{ ['--size' as any]: size + 'px', ...style }} {...rest}>\n <span className=\"alt-avatar-shadow\" aria-hidden=\"true\" />\n <span className=\"alt-avatar-face\">{src ? <img src={src} alt=\"\" /> : initials}</span>\n {showLamp && <span className=\"alt-avatar-lamp\" aria-hidden=\"true\" />}\n </span>\n );\n}\nexport function AvatarGroup({ className, children, max, style, ...rest }: React.HTMLAttributes<HTMLDivElement> & { max?: number }) {\n const all = React.Children.toArray(children);\n const shown = max ? all.slice(0, max) : all;\n const extra = all.length - shown.length;\n const size = (shown[0] as any)?.props?.size || 36;\n return (\n <div className={cx('alt-avatar-group', className)} style={{ ['--size' as any]: size + 'px', ...style }} {...rest}>\n {shown}\n {extra > 0 && (\n <span className=\"alt-avatar\" data-tint=\"more\" role=\"img\" aria-label={`${extra} more`} style={{ ['--size' as any]: size + 'px' }}>\n <span className=\"alt-avatar-shadow\" aria-hidden=\"true\" />\n <span className=\"alt-avatar-face\">+{extra}</span>\n </span>\n )}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Skeleton \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** When it turns true, the children rise out of the imprint into place. */\n loaded?: boolean;\n shape?: 'block' | 'text' | 'circle';\n /** For shape=\"text\": how many lines to imprint. */\n lines?: number;\n width?: number | string; height?: number | string; radius?: string;\n}\nconst LINE_WIDTHS = ['100%', '94%', '82%', '97%', '64%'];\n/** An imprint of the content to come, pressed into the page; when the content arrives it rises out of its imprint. */\nexport function Skeleton({ loaded, shape = 'block', lines = 3, width, height, radius, className, style, children, ...rest }: SkeletonProps) {\n const [reveal, setReveal] = React.useState<number | null>(null);\n const was = React.useRef(loaded);\n React.useEffect(() => { if (loaded && !was.current) setReveal(riseDelay()); if (!loaded) setReveal(null); was.current = loaded; }, [loaded]);\n if (loaded) {\n return (\n <div className={cx('alt-reveal', className)} data-reveal={reveal !== null ? '' : undefined}\n style={{ ...(reveal ? { ['--alt-rise-delay' as any]: reveal + 'ms' } : null), ...style }} {...rest}>\n <div className=\"alt-reveal-inner\">{children}</div>\n </div>\n );\n }\n if (shape === 'text') {\n return (\n <div className={cx('alt-skeleton-lines', className)} aria-hidden=\"true\" style={{ width, ...style }} {...rest}>\n {Array.from({ length: lines }, (_, i) => (\n <div key={i} className=\"alt-skeleton\" data-shape=\"text\" style={{ width: i === lines - 1 && lines > 1 ? '60%' : LINE_WIDTHS[i % LINE_WIDTHS.length], height: height ?? 12, ['--i' as any]: i }} />\n ))}\n </div>\n );\n }\n const d = shape === 'circle' ? (width ?? height ?? 40) : undefined;\n return <div className={cx('alt-skeleton', className)} data-shape={shape} aria-hidden=\"true\"\n style={{ width: d ?? width, height: d ?? height ?? 14, borderRadius: radius, ...style }} {...rest} />;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Alert \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nconst toneIcon = { neutral: Icons.Info, accent: Icons.Info, positive: Icons.CircleCheck, caution: Icons.AlertTriangle, critical: Icons.AlertCircle };\nexport interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, Pick<DepthProps, 'settle'> {\n tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';\n /** flat (default): a sheet laid on the page, it informs. raised: a card above the page, it asks you to act. */\n variant?: 'flat' | 'raised';\n title?: React.ReactNode; action?: React.ReactNode; icon?: React.ReactNode;\n /** Shows a dismiss button; the sheet lifts off the page and the gap closes, then this is called. */\n onDismiss?: () => void;\n}\n/** Status as a sheet laid on the page: it rests on the ground (you can see its edge and its contact shadow) and never floats. When it asks the person to act it becomes a raised card. */\nexport function Alert({ tone = 'neutral', variant = 'flat', title, action, icon, onDismiss, settle, className, style, children, ...rest }: AlertProps) {\n const I = toneIcon[tone];\n const [closing, setClosing] = React.useState(false);\n const { style: depthStyle, ...depth } = useDepth({ settle });\n const dismiss = () => { setClosing(true); window.setTimeout(() => onDismiss?.(), 400); };\n return (\n <div role={tone === 'critical' ? 'alert' : 'status'} className={cx('alt-alert', className)} data-tone={tone} data-variant={variant}\n data-closing={closing ? '' : undefined} {...depth} style={{ ...depthStyle, ...style }} {...rest}>\n <div className=\"alt-alert-inner\">\n <span className=\"alt-alert-icon\" aria-hidden=\"true\">{icon ?? <I size={18} />}</span>\n <div className=\"alt-alert-body\">\n {title && <p className=\"alt-alert-title\">{title}</p>}\n {children && <div className=\"alt-alert-text\">{children}</div>}\n </div>\n {action && <div className=\"alt-alert-action\">{action}</div>}\n {onDismiss && <button type=\"button\" className=\"alt-alert-close\" aria-label=\"Dismiss\" onClick={dismiss}><Icons.X size={14} /></button>}\n </div>\n </div>\n );\n}\n\nexport interface AlertStackProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Alert elements, most important first. Give each a key. */\n children: React.ReactNode;\n expanded?: boolean;\n defaultExpanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n /** Label for the count while stacked. Default \"+N more\". */\n moreLabel?: (hidden: number) => React.ReactNode;\n /** Label for collapsing. Default \"Show less\". */\n lessLabel?: React.ReactNode;\n}\n/**\n * Several alerts as a stack of sheets: the first lies on top and the others peek out beneath it, each tinted by its\n * own tone, with a count. Opening the stack fans them out; dismissing the top one lifts it off and the next comes up.\n */\nexport function AlertStack({ children, expanded, defaultExpanded = false, onExpandedChange, moreLabel = (n) => `+${n} more`, lessLabel = 'Show less', className, ...rest }: AlertStackProps) {\n const list = React.Children.toArray(children).filter(React.isValidElement) as React.ReactElement<AlertProps>[];\n const [open, setOpen] = useControllable(expanded, defaultExpanded, onExpandedChange);\n const topKey = list[0]?.key;\n const prevTop = React.useRef(topKey);\n const [risen, setRisen] = React.useState(0);\n React.useEffect(() => { if (prevTop.current !== topKey) { prevTop.current = topKey; if (topKey != null) setRisen((r) => r + 1); } }, [topKey]);\n const hidden = list.length - 1;\n const all = open || hidden < 1;\n return (\n <div className={cx('alt-alert-stack', className)} data-expanded={all ? '' : undefined} data-sheets={all ? undefined : Math.min(hidden, 2)} {...rest}>\n {all ? list.map((el, i) => <div key={el.key} className=\"alt-alert-stack-item\" style={{ ['--i' as any]: i }}>{el}</div>) : (\n <>\n {list.slice(1, 3).map((el, i) => <span key={el.key} className=\"alt-alert-sheet\" aria-hidden=\"true\" data-tone={el.props.tone ?? 'neutral'} style={{ ['--i' as any]: i + 1 }} />)}\n <div key={String(topKey) + risen} className=\"alt-alert-stack-top\" data-risen={risen ? '' : undefined}>{list[0]}</div>\n </>\n )}\n {hidden > 0 && <button type=\"button\" className=\"alt-alert-more\" aria-expanded={all} onClick={() => setOpen(!open)}>{all ? lessLabel : moreLabel(hidden)}</button>}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Accordion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface AccordionItem { value: string; title: React.ReactNode; content: React.ReactNode }\nexport interface AccordionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {\n items: AccordionItem[];\n type?: 'single' | 'multiple';\n defaultValue?: string[];\n}\nexport function Accordion({ items, type = 'single', defaultValue = [], className, ...rest }: AccordionProps) {\n const [open, setOpen] = React.useState<string[]>(defaultValue);\n const id = React.useId();\n const toggle = (v: string) => setOpen((o) => o.includes(v) ? o.filter((x) => x !== v) : type === 'single' ? [v] : [...o, v]);\n return (\n <div className={cx('alt-acc', className)} {...rest}>\n {items.map((it) => {\n const on = open.includes(it.value);\n return (\n <div key={it.value} className=\"alt-acc-item\" data-state={on ? 'open' : 'closed'}>\n <h3 className=\"alt-acc-heading\">\n <button type=\"button\" className=\"alt-acc-trigger\" aria-expanded={on} aria-controls={`${id}-${it.value}`} onClick={() => toggle(it.value)}>\n <span>{it.title}</span><Icons.ChevronDown className=\"alt-acc-chevron\" size={18} />\n </button>\n </h3>\n <div className=\"alt-acc-panel\" id={`${id}-${it.value}`} role=\"region\" {...(on ? {} : inert)}>\n <div><div className=\"alt-acc-content\">{it.content}</div></div>\n </div>\n </div>\n );\n })}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 HoldButton \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface HoldButtonProps extends Omit<ButtonProps, 'loading'> {\n /** Called once the button has been held for `duration`. */\n onConfirm: () => void;\n /** Milliseconds. Default 1000 (dur-hold). */\n duration?: number;\n holdingLabel?: React.ReactNode;\n doneLabel?: React.ReactNode;\n /**\n * By default a completed hold is final: the button settles flat, shows doneLabel and can't be pressed again.\n * Set true for actions that can be repeated; the button re-arms after a moment.\n */\n repeatable?: boolean;\n}\n/** Commitment as depth: holding pushes the button down through the ground into a trench. Let go early and it springs back. */\nexport function HoldButton({ onConfirm, duration = 1000, variant = 'danger', holdingLabel, doneLabel, repeatable = false, className, children, style, disabled, onClick, ...rest }: HoldButtonProps) {\n const [state, setState] = React.useState<'idle' | 'holding' | 'done'>('idle');\n const timer = React.useRef<number | undefined>(undefined);\n const done = state === 'done';\n const start = () => {\n if (disabled || state !== 'idle') return;\n setState('holding');\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => {\n setState('done');\n onConfirm();\n if (repeatable) timer.current = window.setTimeout(() => setState('idle'), 1800);\n }, duration);\n };\n const cancel = () => { if (state !== 'holding') return; window.clearTimeout(timer.current); setState('idle'); };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n const label = done ? doneLabel ?? children : state === 'holding' ? holdingLabel ?? children : children;\n return (\n <Button {...rest} disabled={disabled} variant={variant} className={cx('alt-hold', className)} data-hold={state}\n data-final={done && !repeatable ? '' : undefined} aria-disabled={(done && !repeatable) || undefined}\n style={{ ['--alt-hold-dur' as any]: duration + 'ms', ...style }}\n onClick={(e) => { if (done) { e.preventDefault(); return; } onClick?.(e); }}\n onPointerDown={(e) => { if (e.button === 0) start(); }} onPointerUp={cancel} onPointerLeave={cancel} onPointerCancel={cancel}\n onKeyDown={(e) => { if ((e.key === ' ' || e.key === 'Enter') && !e.repeat) { e.preventDefault(); start(); } }}\n onKeyUp={(e) => { if (e.key === ' ' || e.key === 'Enter') cancel(); }}\n onContextMenu={(e) => e.preventDefault()}>\n <span className=\"alt-hold-fill\" aria-hidden=\"true\" />\n <span className=\"alt-hold-text\">{label}</span>\n <span className=\"alt-sr\" aria-live=\"polite\">{state === 'holding' ? 'Keep holding to confirm' : done ? 'Confirmed' : ''}</span>\n </Button>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 ScrollArea \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** A header that sits flush at the top and rises once content scrolls beneath it. */\n header?: React.ReactNode;\n maxHeight?: number | string;\n 'aria-label'?: string;\n}\n/** Overflow as depth: where content continues past an edge, the edge curves away (an inner lip); content passing under the header lifts it. */\nexport function ScrollArea({ header, maxHeight = 280, className, children, ...rest }: ScrollAreaProps) {\n const body = React.useRef<HTMLDivElement>(null);\n const inner = React.useRef<HTMLDivElement>(null);\n const [edges, setEdges] = React.useState({ top: false, bottom: false });\n const update = React.useCallback(() => {\n const el = body.current; if (!el) return;\n const top = el.scrollTop > 1, bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;\n setEdges((p) => (p.top === top && p.bottom === bottom ? p : { top, bottom }));\n }, []);\n useIsoLayoutEffect(() => {\n update();\n const ro = new ResizeObserver(update);\n if (body.current) ro.observe(body.current);\n if (inner.current) ro.observe(inner.current);\n return () => ro.disconnect();\n }, [update]);\n return (\n <div className={cx('alt-scroll', className)} data-top={edges.top ? '' : undefined} data-bottom={edges.bottom ? '' : undefined} {...rest}>\n {header && <div className=\"alt-scroll-header\">{header}</div>}\n <div className=\"alt-scroll-body\" ref={body} onScroll={update} style={{ maxHeight }} tabIndex={0} aria-label={rest['aria-label']}>\n <div ref={inner}>{children}</div>\n </div>\n <span className=\"alt-scroll-lip\" data-edge=\"top\" aria-hidden=\"true\" />\n <span className=\"alt-scroll-lip\" data-edge=\"bottom\" aria-hidden=\"true\" />\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 DropZone \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface DropZoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop'> {\n onFiles?: (files: File[]) => void;\n accept?: string;\n multiple?: boolean;\n /** Force a visual state, for documentation: idle, armed (a file is being dragged somewhere on the page) or over. */\n state?: 'idle' | 'armed' | 'over';\n}\n/** Receptacles open when they're needed: a drop zone is flush until a file is dragged anywhere on the page, then sinks open; over it, it deepens. */\nexport function DropZone({ onFiles, accept, multiple = true, state, className, children, ...rest }: DropZoneProps) {\n const [armed, setArmed] = React.useState(false);\n const [over, setOver] = React.useState(false);\n const [landed, setLanded] = React.useState(0);\n const input = React.useRef<HTMLInputElement>(null);\n const { style: depthStyle, ...depth } = useDepth({ settle: landed || undefined });\n React.useEffect(() => {\n let n = 0;\n const hasFiles = (e: DragEvent) => Array.from(e.dataTransfer?.types || []).includes('Files');\n const enter = (e: DragEvent) => { if (!hasFiles(e)) return; n++; setArmed(true); };\n const leave = (e: DragEvent) => { if (!hasFiles(e)) return; n = Math.max(0, n - 1); if (!n) { setArmed(false); setOver(false); } };\n const end = () => { n = 0; setArmed(false); setOver(false); };\n window.addEventListener('dragenter', enter); window.addEventListener('dragleave', leave);\n window.addEventListener('drop', end); window.addEventListener('dragend', end);\n return () => { window.removeEventListener('dragenter', enter); window.removeEventListener('dragleave', leave); window.removeEventListener('drop', end); window.removeEventListener('dragend', end); };\n }, []);\n const take = (files: File[]) => { if (!files.length) return; onFiles?.(files); setLanded((x) => x + 1); };\n const visual = state ?? (over ? 'over' : armed ? 'armed' : 'idle');\n return (\n <div className={cx('alt-drop', className)} data-drop={visual} role=\"button\" tabIndex={0} {...depth} style={depthStyle}\n onClick={() => input.current?.click()} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); input.current?.click(); } }}\n onDragOver={(e) => { e.preventDefault(); setOver(true); }} onDragLeave={() => setOver(false)}\n onDrop={(e) => { e.preventDefault(); setOver(false); setArmed(false); take(Array.from(e.dataTransfer.files)); }} {...rest}>\n <input ref={input} type=\"file\" hidden accept={accept} multiple={multiple} onChange={(e) => take(Array.from(e.target.files || []))} />\n {children}\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 SortableList \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface SortableListProps<T> {\n items: T[];\n getKey: (item: T) => string;\n onReorder: (items: T[]) => void;\n renderItem: (item: T, state: { held: boolean }) => React.ReactNode;\n /** Accessible name for each item, used in announcements. */\n getLabel?: (item: T) => string;\n gap?: number;\n className?: string;\n 'aria-label'?: string;\n}\nconst move = <T,>(arr: T[], from: number, to: number) => { const a = arr.slice(); const [x] = a.splice(from, 1); a.splice(to, 0, x); return a; };\n\n/** Possession as depth: the item you pick up comes into your hand (level 3), the slot it will land in opens as a well, and it lands with a settle. */\nexport function SortableList<T>({ items, getKey, onReorder, renderItem, getLabel = (i) => String(getKey(i)), gap = 8, className, ...rest }: SortableListProps<T>) {\n const nodes = React.useRef(new Map<string, HTMLDivElement>());\n const before = React.useRef(new Map<string, number>());\n const start = React.useRef<{ y: number; key: string; from: number; tops: number[]; hs: number[]; id: number } | null>(null);\n const [drag, setDrag] = React.useState<{ key: string; from: number; to: number; dy: number } | null>(null);\n const [kb, setKb] = React.useState<string | null>(null);\n const [msg, setMsg] = React.useState('');\n\n const snapshot = () => { before.current.clear(); nodes.current.forEach((el, k) => before.current.set(k, el.getBoundingClientRect().top)); };\n useIsoLayoutEffect(() => {\n nodes.current.forEach((el, k) => {\n const prev = before.current.get(k); if (prev === undefined) return;\n const d = prev - el.getBoundingClientRect().top;\n if (Math.abs(d) < 0.5) return;\n el.style.transition = 'none'; el.style.transform = `translateY(${d}px)`;\n el.getBoundingClientRect();\n el.style.transition = ''; el.style.transform = '';\n });\n before.current.clear();\n }, [items]);\n\n const keys = items.map(getKey);\n const onPointerDown = (e: React.PointerEvent, key: string, index: number) => {\n if (e.button !== 0) return;\n const els = keys.map((k) => nodes.current.get(k)!);\n start.current = { y: e.clientY, key, from: index, tops: els.map((el) => el.offsetTop), hs: els.map((el) => el.offsetHeight), id: e.pointerId };\n };\n const onPointerMove = (e: React.PointerEvent) => {\n const s = start.current; if (!s) return;\n const dy = e.clientY - s.y;\n if (!drag && Math.abs(dy) < 4) return;\n if (!drag) (e.currentTarget as HTMLElement).setPointerCapture(s.id);\n const center = s.tops[s.from] + s.hs[s.from] / 2 + dy;\n let to = 0;\n s.tops.forEach((t, i) => { if (i !== s.from && t + s.hs[i] / 2 < center) to++; });\n setDrag({ key: s.key, from: s.from, to, dy });\n };\n const onPointerUp = () => {\n const s = start.current; start.current = null;\n if (!drag || !s) { setDrag(null); return; }\n const { from, to } = drag;\n if (from !== to) snapshot();\n setDrag(null);\n if (from !== to) { onReorder(move(items, from, to)); setMsg(`${getLabel(items[from])} moved to position ${to + 1} of ${items.length}.`); }\n };\n const onKeyDown = (e: React.KeyboardEvent, key: string, index: number) => {\n if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); if (kb === key) { setKb(null); setMsg(`${getLabel(items[index])} dropped at position ${index + 1}.`); } else { setKb(key); setMsg(`${getLabel(items[index])} picked up. Use the arrow keys to move it, Space to drop.`); } }\n else if (kb === key && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {\n e.preventDefault();\n const to = Math.max(0, Math.min(items.length - 1, index + (e.key === 'ArrowUp' ? -1 : 1)));\n if (to !== index) { snapshot(); onReorder(move(items, index, to)); setMsg(`Position ${to + 1} of ${items.length}.`); requestAnimationFrame(() => nodes.current.get(key)?.focus()); }\n } else if (e.key === 'Escape' && kb) { setKb(null); }\n };\n\n const s = start.current;\n const h = drag && s ? s.hs[drag.from] + gap : 0;\n const slotTop = drag && s ? (drag.to <= drag.from ? s.tops[drag.to] : s.tops[drag.to] + s.hs[drag.to] - s.hs[drag.from]) : 0;\n return (\n <div className={cx('alt-sort', className)} style={{ gap }} role=\"list\" aria-label={rest['aria-label']} data-dragging={drag ? '' : undefined}>\n {drag && s && <div className=\"alt-sort-slot\" aria-hidden=\"true\" style={{ top: slotTop, height: s.hs[drag.from] }} />}\n {items.map((item, i) => {\n const key = keys[i];\n const held = drag?.key === key || kb === key;\n let shift = 0;\n if (drag && key !== drag.key) {\n if (drag.from < drag.to && i > drag.from && i <= drag.to) shift = -h;\n if (drag.to < drag.from && i >= drag.to && i < drag.from) shift = h;\n }\n const transform = drag?.key === key ? `translateY(${drag.dy}px)` : shift ? `translateY(${shift}px)` : undefined;\n return (\n <div key={key} ref={(el) => { if (el) nodes.current.set(key, el); else nodes.current.delete(key); }} role=\"listitem\" tabIndex={0}\n className=\"alt-sort-item\" data-held={held ? '' : undefined} data-following={drag?.key === key ? '' : undefined}\n aria-roledescription=\"sortable item\" aria-grabbed={held}\n style={{ transform }} onPointerDown={(e) => onPointerDown(e, key, i)} onPointerMove={onPointerMove} onPointerUp={onPointerUp} onPointerCancel={onPointerUp}\n onKeyDown={(e) => onKeyDown(e, key, i)}>\n <span className=\"alt-sort-grip\" aria-hidden=\"true\">\n <svg width=\"12\" height=\"16\" viewBox=\"0 0 12 16\" fill=\"currentColor\"><circle cx=\"3\" cy=\"3\" r=\"1.3\" /><circle cx=\"9\" cy=\"3\" r=\"1.3\" /><circle cx=\"3\" cy=\"8\" r=\"1.3\" /><circle cx=\"9\" cy=\"8\" r=\"1.3\" /><circle cx=\"3\" cy=\"13\" r=\"1.3\" /><circle cx=\"9\" cy=\"13\" r=\"1.3\" /></svg>\n </span>\n <div className=\"alt-sort-body\">{renderItem(item, { held })}</div>\n </div>\n );\n })}\n <span className=\"alt-sr\" aria-live=\"assertive\">{msg}</span>\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, useControllable, useOutside, usePresence } from './core';\n\nexport interface PileProps<T = unknown> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n /** How many items the pile holds; defaults to items.length. 1 \u2192 no sheets, 2\u20133 \u2192 one, 4\u20139 \u2192 two, 10+ \u2192 three. */\n count?: number;\n /** Hover and focus lift the top and fan the sheets. Implied when `items` is set. */\n interactive?: boolean;\n /** The items in the pile. With renderItem, clicking the pile fans these out below it, floating over the page. */\n items?: T[];\n renderItem?: (item: T, state: { index: number }) => React.ReactNode;\n getKey?: (item: T, index: number) => string;\n /** Called when a fanned-out item is clicked. */\n onSelect?: (item: T, index: number) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Tallest the fanned-out list grows before it scrolls. Default 360px. */\n maxHeight?: number | string;\n}\n\n/**\n * Quantity as thickness, and a pile you can fan out. Closed, the sheets beneath say roughly how many\n * (the badge says exactly); reaching for it fans them a little. Click it and the items slide out from under\n * the top card over the page below it, each casting its own shadow; click one to choose it; click the top,\n * press Escape or click away and they slide back.\n */\nexport function Pile<T>({ count, interactive, items, renderItem, getKey, onSelect, open, defaultOpen = false, onOpenChange,\n maxHeight = 360, className, children, ...rest }: PileProps<T>) {\n const n = count ?? items?.length ?? 1;\n const sheets = n <= 1 ? 0 : n <= 3 ? 1 : n <= 9 ? 2 : 3;\n const openable = !!(items && items.length && renderItem);\n const live = interactive || openable;\n const [isOpen, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const { mounted, state } = usePresence(openable && isOpen, 260);\n const root = React.useRef<HTMLDivElement>(null);\n const top = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const toggle = () => { if (openable) setOpen(!isOpen); };\n const close = React.useCallback(() => setOpen(false), [setOpen]);\n useOutside(root, openable && isOpen, close);\n return (\n <div ref={root} className={cx('alt-pile', live && 'alt-pile-live', className)} data-sheets={sheets} data-open={openable && isOpen ? '' : undefined}\n {...rest}>\n {Array.from({ length: sheets }, (_, i) => <span key={i} className=\"alt-pile-sheet\" aria-hidden=\"true\" style={{ ['--i' as any]: i + 1 }} />)}\n <div ref={top} className=\"alt-pile-top\" tabIndex={live ? 0 : undefined} role={openable ? 'button' : undefined}\n aria-expanded={openable ? isOpen : undefined} aria-controls={openable ? id : undefined}\n onClick={toggle} onKeyDown={(e) => { if (openable && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); toggle(); } }}>\n {children}\n </div>\n {n > 1 && <span className=\"alt-pile-count\" aria-label={`${n} items`}>{n}</span>}\n {openable && mounted && (\n <div className=\"alt-pile-list\" id={id} data-state={state}\n onKeyDown={(e) => { if (e.key === 'Escape') { e.stopPropagation(); setOpen(false); top.current?.focus(); } }}>\n <ul className=\"alt-pile-list-inner\" style={{ maxHeight }}>\n {items!.map((it, i) => (\n <li key={getKey ? getKey(it, i) : i}>\n <button type=\"button\" className=\"alt-pile-item\" style={{ ['--i' as any]: Math.min(i, 10) }} onClick={() => onSelect?.(it, i)}>\n {renderItem!(it, { index: i })}\n </button>\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, Layer, useAltitude, useControllable, useIsoLayoutEffect, useOutside, usePresence } from './core';\nimport { Button } from './controls';\n\nconst EXIT_3 = 160; // \u2248 dur-travel-3 \u00D7 0.7\nconst EXIT_4 = 190; // \u2248 dur-travel-4 \u00D7 0.7\nconst EXIT_5 = 220; // \u2248 dur-travel-5 \u00D7 0.7\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Tooltip \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nlet lastTipClose = 0; // shared warm-up: once one tooltip has shown, neighbours open instantly\nlet openCard: (() => void) | null = null; // the HoverCard currently open, if any\n\nexport interface TooltipProps {\n content: React.ReactNode;\n side?: 'top' | 'bottom';\n delay?: number;\n defaultOpen?: boolean;\n children: React.ReactElement<any>;\n}\nexport function Tooltip({ content, side = 'top', delay = 450, defaultOpen = false, children }: TooltipProps) {\n const [open, setOpen] = React.useState(defaultOpen);\n const [warm, setWarm] = React.useState(false);\n const timer = React.useRef<number | undefined>(undefined);\n const id = React.useId();\n const { mounted, state } = usePresence(open, EXIT_3);\n const show = () => {\n const isWarm = Date.now() - lastTipClose < 400;\n setWarm(isWarm);\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => setOpen(true), isWarm ? 0 : delay);\n };\n const hide = () => { window.clearTimeout(timer.current); setOpen((o) => { if (o) lastTipClose = Date.now(); return false; }); };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <span className=\"alt-tip-anchor\" onPointerEnter={show} onPointerLeave={hide}\n onFocus={() => { window.clearTimeout(timer.current); setWarm(true); setOpen(true); }} onBlur={hide}\n onKeyDown={(e) => { if (e.key === 'Escape') hide(); }}>\n {React.cloneElement(children, { 'aria-describedby': open ? id : undefined })}\n {mounted && <span role=\"tooltip\" id={id} className=\"alt-tip\" data-side={side} data-state={state} data-warm={warm ? '' : undefined}>{content}</span>}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Popover \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface PopoverProps {\n trigger: React.ReactElement<any>;\n children: React.ReactNode;\n open?: boolean; defaultOpen?: boolean; onOpenChange?: (o: boolean) => void;\n side?: 'top' | 'bottom'; align?: 'start' | 'center' | 'end';\n className?: string;\n 'aria-label'?: string;\n}\nexport function Popover({ trigger, children, open, defaultOpen = false, onOpenChange, side = 'bottom', align = 'start', className, ...rest }: PopoverProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const ref = React.useRef<HTMLSpanElement>(null);\n const panel = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const { mounted, state } = usePresence(isOpen, EXIT_3);\n const close = React.useCallback(() => set(false), [set]);\n useOutside(ref, isOpen, close);\n React.useEffect(() => {\n if (state !== 'open' || !panel.current) return;\n const f = panel.current.querySelector<HTMLElement>('input, textarea, select, button, [href], [tabindex]:not([tabindex=\"-1\"])');\n (f || panel.current).focus({ preventScroll: true });\n }, [state]);\n return (\n <span className=\"alt-pop-anchor\" ref={ref}>\n {React.cloneElement(trigger, { 'aria-expanded': isOpen, 'aria-controls': id, 'aria-haspopup': 'dialog', onClick: (e: any) => { trigger.props.onClick?.(e); set(!isOpen); } })}\n {mounted && (\n <div ref={panel} id={id} role=\"dialog\" aria-label={rest['aria-label']} tabIndex={-1} className={cx('alt-pop', className)}\n data-state={state} data-side={side} data-align={align}\n onKeyDown={(e) => { if (e.key === 'Escape') { e.stopPropagation(); close(); (ref.current?.firstElementChild as HTMLElement)?.focus(); } }}>\n {children}\n </div>\n )}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 DropdownMenu \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface MenuItem {\n type?: 'item'; label: React.ReactNode; icon?: React.ReactNode; shortcut?: React.ReactNode; onSelect?: () => void; tone?: 'critical'; disabled?: boolean;\n /** Ephemeral adaptation: predicted items appear at once, the rest fade in over dur-onset. Only worth it when predictions are right most of the time. */\n predicted?: boolean;\n}\nexport type MenuEntry =\n | MenuItem\n | { type: 'separator' }\n | { type: 'label'; label: React.ReactNode };\nexport interface DropdownMenuProps {\n trigger: React.ReactElement<any>;\n items: MenuEntry[];\n align?: 'start' | 'end';\n side?: 'top' | 'bottom';\n defaultOpen?: boolean;\n className?: string;\n}\nexport function DropdownMenu({ trigger, items, align = 'start', side = 'bottom', defaultOpen = false, className }: DropdownMenuProps) {\n const [open, setOpen] = React.useState(defaultOpen);\n const [active, setActive] = React.useState(-1);\n const [hl, setHl] = React.useState<{ y: number; h: number } | null>(null);\n const anchor = React.useRef<HTMLSpanElement>(null);\n const menu = React.useRef<HTMLDivElement>(null);\n const refs = React.useRef<(HTMLDivElement | null)[]>([]);\n const id = React.useId();\n const { mounted, state } = usePresence(open, EXIT_3);\n const close = React.useCallback(() => { setOpen(false); setActive(-1); }, []);\n useOutside(anchor, open, close);\n const enabled = items.map((it, i) => (!it.type || it.type === 'item') && !(it as any).disabled ? i : -1).filter((i) => i >= 0);\n\n useIsoLayoutEffect(() => {\n const el = active >= 0 ? refs.current[active] : null;\n setHl(el ? { y: el.offsetTop, h: el.offsetHeight } : null);\n }, [active, mounted]);\n React.useEffect(() => { if (state === 'open') menu.current?.focus({ preventScroll: true }); }, [state]);\n\n const choose = (i: number) => {\n const it = items[i] as any;\n if (!it || it.disabled) return;\n close();\n (anchor.current?.firstElementChild as HTMLElement)?.focus();\n it.onSelect?.();\n };\n const onKeyDown = (e: React.KeyboardEvent) => {\n const pos = enabled.indexOf(active);\n if (e.key === 'ArrowDown') { e.preventDefault(); setActive(enabled[(pos + 1) % enabled.length]); }\n else if (e.key === 'ArrowUp') { e.preventDefault(); setActive(enabled[(pos - 1 + enabled.length) % enabled.length]); }\n else if (e.key === 'Home') { e.preventDefault(); setActive(enabled[0]); }\n else if (e.key === 'End') { e.preventDefault(); setActive(enabled[enabled.length - 1]); }\n else if ((e.key === 'Enter' || e.key === ' ') && active >= 0) { e.preventDefault(); choose(active); }\n else if (e.key === 'Escape' || e.key === 'Tab') { close(); (anchor.current?.firstElementChild as HTMLElement)?.focus(); }\n };\n let n = 0;\n const activeTone = active >= 0 ? (items[active] as any).tone : undefined;\n return (\n <span className=\"alt-pop-anchor\" ref={anchor}>\n {React.cloneElement(trigger, {\n 'aria-haspopup': 'menu', 'aria-expanded': open, 'aria-controls': id,\n onClick: (e: any) => { trigger.props.onClick?.(e); open ? close() : setOpen(true); },\n onKeyDown: (e: React.KeyboardEvent) => { if (e.key === 'ArrowDown' && !open) { e.preventDefault(); setOpen(true); setActive(enabled[0]); } },\n })}\n {mounted && (\n <div ref={menu} id={id} role=\"menu\" tabIndex={-1} className={cx('alt-pop alt-menu', className)} data-state={state} data-side={side} data-align={align}\n data-ephemeral={items.some((it: any) => it.predicted) ? '' : undefined}\n aria-activedescendant={active >= 0 ? `${id}-${active}` : undefined} onKeyDown={onKeyDown} onPointerLeave={() => setActive(-1)}>\n <span className=\"alt-menu-hl\" aria-hidden=\"true\" data-tone={activeTone}\n style={hl ? { transform: `translateY(${hl.y}px)`, height: hl.h, opacity: 1 } : { opacity: 0 }} />\n {items.map((it, i) => {\n if (it.type === 'separator') return <div key={i} className=\"alt-menu-sep\" role=\"separator\" />;\n if (it.type === 'label') return <div key={i} className=\"alt-menu-label\" style={{ ['--i' as any]: n++ }}>{it.label}</div>;\n const item = it as MenuItem;\n return (\n <div key={i} id={`${id}-${i}`} ref={(el) => { refs.current[i] = el; }} role=\"menuitem\" aria-disabled={item.disabled || undefined}\n className=\"alt-menu-item\" data-tone={item.tone} data-predicted={(item as any).predicted ? '' : undefined} style={{ ['--i' as any]: n++ }}\n onPointerMove={() => !item.disabled && active !== i && setActive(i)} onClick={() => choose(i)}>\n {item.icon && <span className=\"alt-menu-icon\">{item.icon}</span>}\n <span className=\"alt-menu-text\">{item.label}</span>\n {item.shortcut && <span className=\"alt-menu-shortcut\">{item.shortcut}</span>}\n </div>\n );\n })}\n </div>\n )}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 HoverCard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface HoverCardProps {\n /** What you hover or focus: usually a link or an avatar. It must do its own job (navigate, open) without the card. */\n trigger: React.ReactElement<any>;\n children: React.ReactNode;\n /** Default 'bottom'. */\n side?: 'top' | 'bottom';\n /** Default 'start'. */\n align?: 'start' | 'center' | 'end';\n /** Hover intent: how long the pointer must rest before it opens. Default 400ms. */\n openDelay?: number;\n /** How long it stays after the pointer leaves, so the pointer can travel into it. Default 250ms. */\n closeDelay?: number;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n className?: string;\n}\n/**\n * A richer preview that rises from its trigger at level 3, after hover intent or on keyboard focus. It shares Tooltip's\n * warm-up: once one has shown, a neighbour opens at once. Its content is supplementary, never the only way to reach anything.\n */\nexport function HoverCard({ trigger, children, side = 'bottom', align = 'start', openDelay = 400, closeDelay = 250, open, defaultOpen = false, onOpenChange, className }: HoverCardProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const { mounted, state } = usePresence(isOpen, EXIT_3);\n const timer = React.useRef<number | undefined>(undefined);\n const closeMe = React.useRef(() => set(false));\n closeMe.current = () => set(false);\n // One preview at a time: opening a card hands over from whichever card is open (warm, so it's instant).\n React.useEffect(() => {\n if (!isOpen) return;\n const mine = () => closeMe.current();\n if (openCard && openCard !== mine) { openCard(); lastTipClose = Date.now(); }\n openCard = mine;\n return () => { if (openCard === mine) openCard = null; };\n }, [isOpen]);\n const show = (delay: number) => {\n window.clearTimeout(timer.current);\n const warm = Date.now() - lastTipClose < 400;\n timer.current = window.setTimeout(() => set(true), warm ? 0 : delay);\n };\n const hide = (delay: number) => {\n window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => { set(false); if (isOpen) lastTipClose = Date.now(); }, delay);\n };\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <span className=\"alt-pop-anchor alt-hovercard-anchor\"\n onPointerEnter={(e) => { if (e.pointerType !== 'touch') show(openDelay); }}\n onPointerLeave={(e) => { if (e.pointerType !== 'touch') hide(closeDelay); }}\n onFocus={() => show(openDelay)}\n onBlur={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node)) hide(closeDelay); }}\n onKeyDown={(e) => { if (e.key === 'Escape' && isOpen) { e.stopPropagation(); window.clearTimeout(timer.current); set(false); lastTipClose = Date.now(); } }}>\n {trigger}\n {mounted && (\n <div className={cx('alt-pop alt-hovercard', className)} data-state={state} data-side={side} data-align={align}\n onPointerEnter={() => window.clearTimeout(timer.current)}>\n {children}\n </div>\n )}\n </span>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Modal layers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/**\n * One summit: Dialog and CommandPalette sit at level 5, and only one thing may sit there at a time.\n * They register here while open, so others (the palette's \u2318K, a Sheet) can tell the summit is taken.\n */\nlet summits = 0;\nexport const summitTaken = () => summits > 0;\n\nexport interface ModalOptions {\n open: boolean;\n onDismiss: () => void;\n /** How long the closed pose stays mounted (the exit runs at 70% of the entry). */\n exitMs: number;\n panel: React.RefObject<HTMLElement | null>;\n /** Blocks the page: the stage recedes, scroll locks and Tab is trapped. Default true. */\n modal?: boolean;\n /** Escape closes. Default true. */\n dismissible?: boolean;\n /** Takes level 5 (Dialog, CommandPalette). Default false. */\n summit?: boolean;\n /** Move focus into the panel once it has risen. Default true. */\n autoFocus?: boolean;\n focusSelector?: string;\n}\n/**\n * The machinery every layer above the page shares: presence (mount, rise, exit), the receding page,\n * scroll lock, focus in and back out, Escape and the Tab trap. Dialog, Sheet and CommandPalette use it.\n */\nexport function useModal({ open, onDismiss, exitMs, panel, modal = true, dismissible = true, summit = false, autoFocus = true,\n focusSelector = '[data-autofocus], input, textarea, select' }: ModalOptions) {\n const ctx = useAltitude();\n const restore = React.useRef<HTMLElement | null>(null);\n const presence = usePresence(open, exitMs);\n\n React.useEffect(() => {\n if (!open) return;\n restore.current = document.activeElement as HTMLElement;\n const pop = modal ? ctx?.pushLayer() : undefined;\n const prev = document.body.style.overflow;\n if (modal) document.body.style.overflow = 'hidden';\n if (summit) summits++;\n return () => {\n pop?.();\n if (modal) document.body.style.overflow = prev;\n if (summit) summits--;\n if (autoFocus) restore.current?.focus?.({ preventScroll: true });\n };\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n\n React.useEffect(() => {\n if (presence.state !== 'open' || !autoFocus) return;\n let raf = 0;\n const tryFocus = () => {\n if (!panel.current) { raf = requestAnimationFrame(tryFocus); return; }\n const f = panel.current.querySelector<HTMLElement>(focusSelector);\n (f || panel.current).focus({ preventScroll: true });\n };\n tryFocus();\n return () => cancelAnimationFrame(raf);\n }, [presence.state]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape' && dismissible) { e.stopPropagation(); onDismiss(); }\n if (!modal || e.key !== 'Tab' || !panel.current) return;\n const f = [...panel.current.querySelectorAll<HTMLElement>('button, [href], input, textarea, select, [tabindex]:not([tabindex=\"-1\"])')].filter((el) => !el.hasAttribute('disabled'));\n if (!f.length) return;\n const first = f[0], last = f[f.length - 1];\n if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }\n else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }\n };\n return { ...presence, onKeyDown };\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Dialog \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface DialogProps {\n open?: boolean; defaultOpen?: boolean; onOpenChange?: (o: boolean) => void;\n /** Uncontrolled convenience: an element that opens the dialog. */\n trigger?: React.ReactElement<any>;\n title: React.ReactNode;\n description?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n size?: 'sm' | 'md' | 'lg';\n /** Set false for decisions that must be answered: the scrim and Escape won't close it. */\n dismissible?: boolean;\n className?: string;\n}\nexport function Dialog({ open, defaultOpen = false, onOpenChange, trigger, title, description, children, footer, size = 'md', dismissible = true, className }: DialogProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const panel = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const { mounted, state, onKeyDown } = useModal({ open: isOpen, onDismiss: () => set(false), exitMs: EXIT_5, panel, dismissible, summit: true });\n\n return (\n <>\n {trigger && React.cloneElement(trigger, { 'aria-haspopup': 'dialog', onClick: (e: any) => { trigger.props.onClick?.(e); set(true); } })}\n {mounted && (\n <Layer>\n <div className=\"alt-dialog-root\" data-state={state} onKeyDown={onKeyDown}>\n <div className=\"alt-scrim\" onClick={() => dismissible && set(false)} />\n <div ref={panel} role=\"dialog\" aria-modal=\"true\" aria-labelledby={`${id}-t`} aria-describedby={description ? `${id}-d` : undefined}\n tabIndex={-1} className={cx('alt-dialog', className)} data-size={size}>\n <div className=\"alt-dialog-head\">\n <h2 className=\"alt-dialog-title\" id={`${id}-t`}>{title}</h2>\n {description && <p className=\"alt-dialog-desc\" id={`${id}-d`}>{description}</p>}\n </div>\n {children && <div className=\"alt-dialog-body\">{children}</div>}\n {footer && <div className=\"alt-dialog-footer\">{footer}</div>}\n {dismissible && (\n <Button variant=\"ghost\" size=\"sm\" square aria-label=\"Close\" className=\"alt-dialog-close\" onClick={() => set(false)}><Icons.X /></Button>\n )}\n </div>\n </div>\n </Layer>\n )}\n </>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Toast \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport type ToastTone = 'neutral' | 'positive' | 'caution' | 'critical';\nexport interface ToastOptions { title: React.ReactNode; description?: React.ReactNode; tone?: ToastTone; duration?: number; action?: { label: string; onClick: () => void } }\ntype ToastItem = ToastOptions & { id: number; leaving?: boolean; entered?: boolean };\n\nlet toasts: ToastItem[] = [];\nlet seq = 0;\nconst subs = new Set<() => void>();\nconst emit = () => subs.forEach((f) => f());\nconst patch = (id: number, p: Partial<ToastItem>) => { toasts = toasts.map((t) => (t.id === id ? { ...t, ...p } : t)); emit(); };\n\nexport function toast(input: ToastOptions | string) {\n const opts = typeof input === 'string' ? { title: input } : input;\n const item: ToastItem = { tone: 'neutral', duration: 5000, ...opts, id: ++seq };\n toasts = [item, ...toasts];\n emit();\n requestAnimationFrame(() => requestAnimationFrame(() => patch(item.id, { entered: true })));\n return item.id;\n}\ntoast.dismiss = (id: number) => {\n patch(id, { leaving: true });\n setTimeout(() => { toasts = toasts.filter((t) => t.id !== id); emit(); }, EXIT_4);\n};\n\nconst toastIcon = { neutral: Icons.Info, positive: Icons.CircleCheck, caution: Icons.AlertTriangle, critical: Icons.AlertCircle };\nconst STACK = 3, GAP = 8;\n\nexport function Toaster({ className }: { className?: string }) {\n const [, force] = React.useReducer((n) => n + 1, 0);\n const [expanded, setExpanded] = React.useState(false);\n const heights = React.useRef(new Map<number, number>());\n React.useEffect(() => { subs.add(force); return () => { subs.delete(force); }; }, []);\n\n // timers: pause while the stack is expanded (hovered or focused)\n React.useEffect(() => {\n if (expanded) return;\n const timers = toasts.filter((t) => !t.leaving && t.duration! > 0).map((t) => setTimeout(() => toast.dismiss(t.id), t.duration));\n return () => timers.forEach(clearTimeout);\n });\n\n const live = toasts.filter((t) => !t.leaving);\n const frontH = live[0] ? heights.current.get(live[0].id) || 64 : 64;\n let offset = 0;\n const total = live.slice(0, 5).reduce((a, t) => a + (heights.current.get(t.id) || 64) + GAP, 0);\n\n return (\n <Layer>\n <section aria-label=\"Notifications\" aria-live=\"polite\" className={cx('alt-toaster', className)}\n style={{ height: expanded ? total : frontH }}\n onPointerEnter={() => setExpanded(true)} onPointerLeave={() => setExpanded(false)}\n onFocus={() => setExpanded(true)} onBlur={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node)) setExpanded(false); }}>\n {toasts.map((t) => {\n const i = live.indexOf(t);\n const h = heights.current.get(t.id) || 64;\n let y: string, s: number, o: number, sh: string, behind = false;\n if (t.leaving) { y = `calc(${-offset}px + 8px * var(--alt-travel))`; s = 0.96; o = 0; sh = 'var(--elev-1)'; }\n else if (!t.entered) { y = 'calc(24px * var(--alt-travel))'; s = 0.96; o = 0; sh = 'var(--elev-1)'; }\n else if (expanded) { y = `${-offset}px`; s = 1; o = i < 5 ? 1 : 0; sh = 'var(--elev-4)'; }\n else { y = `calc(${-i * 10}px * var(--alt-travel) - ${i * 2}px)`; s = 1 - i * 0.05; o = i < STACK ? 1 - i * 0.12 : 0; sh = `var(--elev-${Math.max(2, 4 - i)})`; behind = i > 0; }\n if (!t.leaving && i >= 0) offset += h + GAP;\n const I = toastIcon[t.tone || 'neutral'];\n return (\n <div key={t.id} className=\"alt-toast\" data-tone={t.tone} data-behind={behind ? '' : undefined} role={t.tone === 'critical' ? 'alert' : 'status'}\n ref={(el) => { if (el) { const nh = el.offsetHeight; if (heights.current.get(t.id) !== nh && !behind) { heights.current.set(t.id, nh); } } }}\n style={{ transform: `translateY(${y}) scale(${s})`, opacity: o, boxShadow: sh, zIndex: 100 - Math.max(i, 0), height: behind ? frontH : undefined, pointerEvents: o ? undefined : 'none' }}>\n <span className=\"alt-toast-icon\"><I size={18} /></span>\n <div className=\"alt-toast-body\">\n <p className=\"alt-toast-title\">{t.title}</p>\n {t.description && <p className=\"alt-toast-desc\">{t.description}</p>}\n </div>\n {t.action && <Button size=\"sm\" variant=\"secondary\" className=\"alt-toast-action\" onClick={() => { t.action!.onClick(); toast.dismiss(t.id); }}>{t.action.label}</Button>}\n <button type=\"button\" className=\"alt-toast-close\" aria-label=\"Dismiss\" onClick={() => toast.dismiss(t.id)}><Icons.X size={14} /></button>\n </div>\n );\n })}\n </section>\n </Layer>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons } from './core';\n\nexport interface DrillNode {\n id: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n /** Leaf content. A node with children lists them instead. */\n content?: React.ReactNode;\n children?: DrillNode[];\n}\nexport interface DrilldownProps extends React.HTMLAttributes<HTMLDivElement> {\n root: DrillNode;\n}\n\n/**\n * Hierarchy as a stack. Each place you go into is laid on top of the one before: the breadcrumb\n * builds a staircase \u2014 every step stands on the same ground line and each deeper place is a taller\n * step \u2014 and the view sits on a pile whose thickness is how deep you are. Going back lifts sheets off the top.\n */\nexport function Drilldown({ root, className, ...rest }: DrilldownProps) {\n const [path, setPath] = React.useState<DrillNode[]>([root]);\n const [dir, setDir] = React.useState<'down' | 'up'>('down');\n const [out, setOut] = React.useState<DrillNode | null>(null);\n const view = React.useRef<HTMLDivElement>(null);\n const depth = path.length - 1;\n const current = path[depth];\n React.useEffect(() => { if (!out) return; const t = setTimeout(() => setOut(null), 220); return () => clearTimeout(t); }, [out]);\n const go = (node: DrillNode) => { setDir('down'); setOut(current); setPath([...path, node]); };\n const back = (i: number) => { if (i === depth) return; setDir('up'); setOut(current); setPath(path.slice(0, i + 1)); };\n React.useEffect(() => { view.current?.focus({ preventScroll: true }); }, [current.id]);\n\n const render = (node: DrillNode) => node.children?.length ? (\n <ul className=\"alt-drill-list\">\n {node.children.map((c) => (\n <li key={c.id}>\n <button type=\"button\" className=\"alt-drill-row\" onClick={() => go(c)}>\n <span className=\"alt-drill-row-text\"><span className=\"alt-drill-row-title\">{c.title}</span>{c.description && <span className=\"alt-drill-row-desc\">{c.description}</span>}</span>\n {c.children?.length ? <span className=\"alt-drill-count\">{c.children.length}</span> : null}\n <Icons.ChevronDown className=\"alt-drill-chev\" size={16} />\n </button>\n </li>\n ))}\n </ul>\n ) : <div className=\"alt-drill-leaf\">{node.content}</div>;\n\n const sheets = Math.min(depth, 3);\n return (\n <div className={cx('alt-drill', className)} data-dir={dir} {...rest}>\n <nav className=\"alt-crumbs\" aria-label=\"Location\">\n <ol>\n {path.map((n, i) => (\n <li key={n.id} data-d={Math.min(i, 3)} style={{ ['--d' as any]: i, zIndex: i + 1 }} data-current={i === depth ? '' : undefined} data-new={i === depth && dir === 'down' && i > 0 ? '' : undefined}>\n <button type=\"button\" onClick={() => back(i)} aria-current={i === depth ? 'location' : undefined}>{n.title}</button>\n </li>\n ))}\n </ol>\n </nav>\n <div className=\"alt-pile alt-drill-pile\" data-sheets={sheets}>\n {Array.from({ length: sheets }, (_, i) => <span key={i} className=\"alt-pile-sheet\" aria-hidden=\"true\" style={{ ['--i' as any]: i + 1 }} />)}\n <div className=\"alt-pile-top alt-drill-stage\">\n {out && <div key={'out-' + out.id} className=\"alt-drill-view\" data-phase=\"out\" aria-hidden=\"true\">{render(out)}</div>}\n <div key={current.id} ref={view} tabIndex={-1} className=\"alt-drill-view\" data-phase=\"in\" aria-label={typeof current.title === 'string' ? current.title : undefined}>{render(current)}</div>\n </div>\n </div>\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, Layer, useApproach, useControllable, useIsoLayoutEffect } from './core';\nimport { Button } from './controls';\nimport { summitTaken, useModal } from './overlays';\n\nconst EXIT_4 = 190; // \u2248 dur-travel-4 \u00D7 0.7\n\ntype SheetCtxT = { titleId: string; descId: string; setTitled: (on: boolean) => void; setDescribed: (on: boolean) => void };\nconst SheetCtx = React.createContext<SheetCtxT | null>(null);\n\nexport interface SheetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Uncontrolled convenience: an element that opens the sheet. */\n trigger?: React.ReactElement<any>;\n /** The edge it's anchored to. Default 'right'. */\n side?: 'right' | 'left' | 'bottom';\n /** Width: sm 360, md 440, lg 560px (a bottom sheet: 480, 720, 960px). Default 'md'. */\n size?: 'sm' | 'md' | 'lg';\n /** false: a side panel that doesn't block the page; no scrim, no receding page, no focus trap. Default true. */\n modal?: boolean;\n /** false: only your own controls close it (no Escape, scrim, close button or drag). Default true. */\n dismissible?: boolean;\n}\n\n/**\n * A large sheet laid over the page at level 4, anchored to an edge. It rises at that edge (16px of travel at most,\n * a fade, its shadow growing from elev-1 to elev-4) while the page recedes behind it; closing lifts it off.\n */\nexport function Sheet({ open, defaultOpen = false, onOpenChange, trigger, side = 'right', size = 'md', modal = true, dismissible = true,\n className, style, children, ...rest }: SheetProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const panel = React.useRef<HTMLDivElement>(null);\n const scroller = React.useRef<HTMLDivElement>(null);\n const inner = React.useRef<HTMLDivElement>(null);\n const id = React.useId();\n const [titled, setTitled] = React.useState(false);\n const [described, setDescribed] = React.useState(false);\n const [edges, setEdges] = React.useState({ top: false, bottom: false });\n const [drag, setDrag] = React.useState<{ dy: number; leaving?: boolean } | null>(null);\n const pull = React.useRef<{ y: number; t: number } | null>(null);\n // Layer mounts its portal a render later; measuring waits for the panel to exist.\n const [panelEl, setPanelEl] = React.useState<HTMLDivElement | null>(null);\n const panelRef = React.useCallback((el: HTMLDivElement | null) => { (panel as React.MutableRefObject<HTMLDivElement | null>).current = el; setPanelEl(el); }, []);\n // One summit: a sheet never opens above a Dialog or the CommandPalette. If it's opened under one anyway, it\n // paints beneath it (z-overlay < z-modal) and leaves focus where it is.\n const underSummit = React.useMemo(() => isOpen && summitTaken(), [isOpen]);\n const close = React.useCallback(() => set(false), [set]);\n const { mounted, state, onKeyDown } = useModal({ open: isOpen, onDismiss: close, exitMs: EXIT_4, panel, modal, dismissible, autoFocus: !underSummit });\n useApproach(side === 'bottom' && dismissible);\n React.useEffect(() => { if (isOpen) setDrag(null); }, [isOpen]);\n\n const measure = React.useCallback(() => {\n const el = scroller.current;\n if (!el) return;\n const top = el.scrollTop > 1, bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;\n setEdges((p) => (p.top === top && p.bottom === bottom ? p : { top, bottom }));\n }, []);\n useIsoLayoutEffect(() => {\n if (!panelEl) return;\n measure();\n const ro = new ResizeObserver(measure);\n if (scroller.current) ro.observe(scroller.current);\n if (inner.current) ro.observe(inner.current);\n return () => ro.disconnect();\n }, [panelEl, measure]);\n\n // A bottom sheet can be pulled down by its finger pull; past a third of its height (or flicked), it goes.\n const onPullDown = (e: React.PointerEvent) => {\n if (!dismissible || e.button !== 0) return;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n pull.current = { y: e.clientY, t: performance.now() };\n setDrag({ dy: 0 });\n };\n const onPullMove = (e: React.PointerEvent) => {\n const p = pull.current;\n if (!p) return;\n const raw = e.clientY - p.y;\n setDrag({ dy: raw > 0 ? raw : Math.max(-8, raw / 4) });\n };\n const onPullUp = (e: React.PointerEvent) => {\n const p = pull.current;\n pull.current = null;\n if (!p) return;\n const dy = e.clientY - p.y, v = dy / Math.max(1, performance.now() - p.t), h = panel.current?.offsetHeight || 320;\n if (dy > Math.min(160, h / 3) || (dy > 24 && v > 0.6)) { setDrag({ dy, leaving: true }); close(); } else setDrag(null);\n };\n\n const ctx = React.useMemo<SheetCtxT>(() => ({ titleId: `${id}-t`, descId: `${id}-d`, setTitled, setDescribed }), [id]);\n const dragging = !!drag && !drag.leaving && !!pull.current;\n const dragStyle: React.CSSProperties | undefined = drag\n ? drag.leaving ? { transform: `translateY(${drag.dy + 24}px)` } : { transform: `translateY(${drag.dy}px)`, transition: dragging ? 'none' : undefined }\n : undefined;\n return (\n <>\n {trigger && React.cloneElement(trigger, {\n 'aria-haspopup': 'dialog', 'aria-expanded': isOpen,\n onClick: (e: any) => { trigger.props.onClick?.(e); set(modal ? true : !isOpen); },\n })}\n {mounted && (\n <Layer>\n <SheetCtx.Provider value={ctx}>\n <div className=\"alt-sheet-root\" data-state={state} data-exit={!isOpen ? '' : undefined} data-modal={modal ? '' : undefined} onKeyDown={onKeyDown}>\n {modal && <div className=\"alt-scrim\" onClick={() => dismissible && close()} />}\n <div ref={panelRef} role=\"dialog\" aria-modal={modal || undefined} aria-labelledby={titled ? ctx.titleId : undefined}\n aria-describedby={described ? ctx.descId : undefined} tabIndex={-1} className={cx('alt-sheet', className)}\n data-side={side} data-size={size} data-top={edges.top ? '' : undefined} data-bottom={edges.bottom ? '' : undefined}\n data-dragging={dragging ? '' : undefined} style={{ ...style, ...dragStyle }} {...rest}>\n {side === 'bottom' && dismissible && (\n <span className=\"alt-sheet-pull\" aria-hidden=\"true\" data-approach=\"48\"\n onPointerDown={onPullDown} onPointerMove={onPullMove} onPointerUp={onPullUp} onPointerCancel={onPullUp} />\n )}\n <div className=\"alt-sheet-scroll\" ref={scroller} onScroll={measure}>\n <div className=\"alt-sheet-inner\" ref={inner}>{children}</div>\n </div>\n {dismissible && (\n <Button variant=\"ghost\" size=\"sm\" square aria-label=\"Close\" className=\"alt-sheet-close\" onClick={close}><Icons.X /></Button>\n )}\n </div>\n </div>\n </SheetCtx.Provider>\n </Layer>\n )}\n </>\n );\n}\n\n/** The title block. It stays at the top while the sheet scrolls, and rises once content passes under it. */\nexport function SheetHeader({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cx('alt-sheet-header', className)} {...p} />;\n}\nexport function SheetTitle({ className, ...p }: React.HTMLAttributes<HTMLHeadingElement>) {\n const c = React.useContext(SheetCtx);\n React.useEffect(() => { c?.setTitled(true); return () => c?.setTitled(false); }, [c]);\n return <h2 id={c?.titleId} className={cx('alt-sheet-title', className)} {...p} />;\n}\nexport function SheetDescription({ className, ...p }: React.HTMLAttributes<HTMLParagraphElement>) {\n const c = React.useContext(SheetCtx);\n React.useEffect(() => { c?.setDescribed(true); return () => c?.setDescribed(false); }, [c]);\n return <p id={c?.descId} className={cx('alt-sheet-desc', className)} {...p} />;\n}\n/** Actions, right-aligned. It stays at the bottom; where content continues beneath it, its top edge curves away. */\nexport function SheetFooter({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cx('alt-sheet-footer', className)} {...p} />;\n}\n", "import * as React from 'react';\nimport { cx, Kbd, Layer, riseDelay, useControllable, useIsoLayoutEffect } from './core';\nimport { Input } from './controls';\nimport { summitTaken, useModal } from './overlays';\n\nconst EXIT_5 = 220; // \u2248 dur-travel-5 \u00D7 0.7\n\nexport interface CommandItem {\n /** Stable key within its group. Defaults to the label. */\n id?: string;\n label: string;\n /** A short second line of context (a path, a branch). Matched with less weight than the label. */\n description?: string;\n icon?: React.ReactNode;\n /** Keys shown as Kbd hints, e.g. ['\u2318', 'D']. Display only: bind the shortcut yourself. */\n shortcut?: string[];\n /** Other words that should find this item (synonyms, old names). */\n keywords?: string[];\n onSelect?: () => void;\n disabled?: boolean;\n tone?: 'critical';\n /** Ephemeral adaptation: on opening, predicted items are there at once while the rest fade in over dur-onset. */\n predicted?: boolean;\n}\nexport interface CommandGroup {\n /** Stable key. Defaults to the group's position. */\n id?: string;\n label?: React.ReactNode;\n items: CommandItem[];\n /** Every item in the group is predicted: a \"Recent\" or \"Suggested\" group. */\n predicted?: boolean;\n}\nexport interface CommandPaletteProps {\n items: CommandGroup[];\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Called with the chosen item (after its own onSelect). */\n onSelect?: (item: CommandItem, group: CommandGroup) => void;\n placeholder?: string;\n /** Score an item against the query: 0 hides it, higher ranks it nearer the top. Replaces the built-in fuzzy match. */\n filter?: (item: CommandItem, query: string) => number;\n /** Shown when nothing matches. A function receives the query. */\n empty?: React.ReactNode | ((query: string) => React.ReactNode);\n /** The letter that opens and closes the palette with \u2318 (macOS) or Ctrl. Default 'k'; false for none. */\n shortcut?: string | false;\n /** The query, controlled. The palette never clears it on opening: the caller owns it, e.g. a persistent field handing over what was typed. */\n query?: string;\n /** What the query is each time the palette opens, uncontrolled. Default ''. */\n defaultQuery?: string;\n onQueryChange?: (query: string) => void;\n /** Close once an item is chosen. Default true. */\n closeOnSelect?: boolean;\n /** The key hints along the bottom. Default true. */\n hints?: boolean;\n className?: string;\n 'aria-label'?: string;\n}\n\n/**\n * The built-in ranking. 0 means no match. An exact match beats a prefix, a prefix beats a word start, a word start\n * beats a substring, and a substring beats letters found in order (fewer gaps rank higher).\n */\nexport function commandScore(text: string, query: string): number {\n const t = text.toLowerCase(), q = query.toLowerCase().trim();\n if (!q) return 1;\n if (t === q) return 100;\n if (t.startsWith(q)) return 80;\n if (t.split(/[\\s\\-_/.:@]+/).some((w) => w.startsWith(q))) return 60;\n const i = t.indexOf(q);\n if (i >= 0) return 40 - Math.min(i, 20) * 0.5;\n let from = 0, last = -1, gaps = 0;\n for (const ch of q.replace(/\\s+/g, '')) {\n const f = t.indexOf(ch, from);\n if (f < 0) return 0;\n if (last >= 0) gaps += f - last - 1;\n last = f; from = f + 1;\n }\n return Math.max(1, 20 - gaps * 0.5);\n}\nconst itemScore = (item: CommandItem, q: string) => {\n let s = commandScore(item.label, q);\n for (const k of item.keywords || []) s = Math.max(s, commandScore(k, q) * 0.9);\n if (item.description) s = Math.max(s, commandScore(item.description, q) * 0.6);\n return s;\n};\n\n/** Which letters of the label matched: one run (preferring a word start), else the letters in order. */\nfunction matchRanges(label: string, query: string): Array<[number, number]> {\n const t = label.toLowerCase(), q = query.toLowerCase().trim();\n if (!q) return [];\n let at = -1;\n for (let i = t.indexOf(q); i >= 0; i = t.indexOf(q, i + 1)) {\n if (i === 0 || /[\\s\\-_/.:@]/.test(t[i - 1])) { at = i; break; }\n if (at < 0) at = i;\n }\n if (at >= 0) return [[at, at + q.length]];\n const out: Array<[number, number]> = [];\n let from = 0;\n for (const ch of q.replace(/\\s+/g, '')) {\n const f = t.indexOf(ch, from);\n if (f < 0) return [];\n const prev = out[out.length - 1];\n if (prev && prev[1] === f) prev[1] = f + 1; else out.push([f, f + 1]);\n from = f + 1;\n }\n return out;\n}\nfunction Marked({ text, ranges }: { text: string; ranges: Array<[number, number]> }) {\n if (!ranges.length) return <>{text}</>;\n const parts: React.ReactNode[] = [];\n let i = 0;\n ranges.forEach(([a, b], k) => { if (a > i) parts.push(text.slice(i, a)); parts.push(<mark key={k} className=\"alt-cmd-match\">{text.slice(a, b)}</mark>); i = b; });\n if (i < text.length) parts.push(text.slice(i));\n return <>{parts}</>;\n}\n\nconst SearchIcon = () => (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" /><path d=\"M20 20l-3.5-3.5\" />\n </svg>\n);\nconst ms = (cs: CSSStyleDeclaration, name: string, fallback: number) => parseFloat(cs.getPropertyValue(name)) || fallback;\n\ntype Row = { key: string; item: CommandItem; group: CommandGroup; predicted: boolean };\n\n/**\n * The summit: a level-5 search over everything you can do, opened with \u2318K or Ctrl+K. The page recedes behind it\n * as it does for Dialog. The query field is an opening built like Input; one highlight glides between results;\n * when results change, surviving rows travel to their new places and new ones rise in, a few at a time.\n */\nexport function CommandPalette({ items, open, defaultOpen = false, onOpenChange, onSelect, placeholder = 'Type a command or search\u2026', filter, empty,\n shortcut = 'k', query: queryProp, defaultQuery = '', onQueryChange, closeOnSelect = true, hints = true, className, ...rest }: CommandPaletteProps) {\n const [isOpen, set] = useControllable(open, defaultOpen, onOpenChange);\n const [innerQuery, setInnerQuery] = React.useState(defaultQuery);\n const query = queryProp ?? innerQuery;\n const [active, setActive] = React.useState(0);\n const [onset, setOnset] = React.useState(true);\n const [said, setSaid] = React.useState('');\n const panel = React.useRef<HTMLDivElement>(null);\n const viewport = React.useRef<HTMLDivElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const sizer = React.useRef<HTMLDivElement>(null);\n const rowEls = React.useRef(new Map<string, HTMLElement>());\n const prevTops = React.useRef<Map<string, number> | null>(null);\n const byKeyboard = React.useRef(false);\n const caretPlaced = React.useRef(false);\n const seed = React.useRef(defaultQuery);\n seed.current = defaultQuery;\n // Layer mounts its portal a render later; effects that measure rows wait for the panel to exist.\n const [panelEl, setPanelEl] = React.useState<HTMLDivElement | null>(null);\n const panelRef = React.useCallback((el: HTMLDivElement | null) => { (panel as React.MutableRefObject<HTMLDivElement | null>).current = el; setPanelEl(el); }, []);\n const id = React.useId();\n const close = React.useCallback(() => set(false), [set]);\n const { mounted, state, onKeyDown } = useModal({ open: isOpen, onDismiss: close, exitMs: EXIT_5, panel, summit: true });\n\n // \u2318K / Ctrl+K toggles it, unless something else holds the summit.\n React.useEffect(() => {\n if (!shortcut) return;\n const key = shortcut.toLowerCase();\n const on = (e: KeyboardEvent) => {\n if (!(e.metaKey || e.ctrlKey) || e.altKey || e.shiftKey || e.key.toLowerCase() !== key) return;\n if (isOpen) { e.preventDefault(); set(false); } else if (!summitTaken()) { e.preventDefault(); set(true); }\n };\n window.addEventListener('keydown', on);\n return () => window.removeEventListener('keydown', on);\n }, [shortcut, isOpen, set]);\n // Each opening starts from the seed (a controlled query is left as the caller has it).\n React.useEffect(() => { if (isOpen) { setInnerQuery(seed.current); setActive(0); setOnset(true); caretPlaced.current = false; } }, [isOpen]);\n // A query changed from outside (a controlled one) starts again from the best match, as typing does.\n React.useEffect(() => { setActive(0); }, [query]);\n\n // Rank: within each group by score, and groups by their best item, so the best match is on top.\n const q = query.trim();\n const score = filter ?? itemScore;\n const view = items.map((g, gi) => {\n let rows = g.items.map((item, ii) => ({ item, ii, s: q ? score(item, q) : 1 }));\n if (q) rows = rows.filter((r) => r.s > 0).sort((a, b) => b.s - a.s || a.ii - b.ii);\n return { g, gk: g.id ?? String(gi), gi, rows, best: rows[0]?.s ?? 0 };\n }).filter((v) => v.rows.length);\n if (q) view.sort((a, b) => b.best - a.best || a.gi - b.gi);\n const flat: Row[] = [];\n view.forEach((v) => v.rows.forEach(({ item }) => flat.push({ key: `${v.gk}:${item.id ?? item.label}`, item, group: v.g, predicted: !!(item.predicted || v.g.predicted) })));\n const enabled = flat.filter((r) => !r.item.disabled);\n const act = enabled.length ? Math.min(active, enabled.length - 1) : -1;\n const activeRow = act >= 0 ? enabled[act] : null;\n const rowsKey = view.map((v) => v.gk + '[' + v.rows.map((r) => r.item.id ?? r.item.label).join('|') + ']').join(',');\n const ephemeral = onset && !q && flat.some((r) => r.predicted);\n\n // Results that change travel instead of blinking (FLIP); new rows rise in, the best few within the attention budget.\n useIsoLayoutEffect(() => {\n const host = list.current;\n if (!host) { prevTops.current = null; return; }\n const els = Array.from(host.querySelectorAll<HTMLElement>('[data-flip]'));\n const now = new Map<string, number>();\n els.forEach((el) => now.set(el.dataset.flip!, el.offsetTop));\n const before = prevTops.current;\n prevTops.current = now;\n if (viewport.current) viewport.current.scrollTop = 0;\n if (!before) return;\n const cs = getComputedStyle(host);\n const still = parseFloat(cs.getPropertyValue('--alt-travel')) === 0;\n const glide = { duration: ms(cs, '--dur-travel-2', 180), easing: cs.getPropertyValue('--ease-glide').trim() || 'ease' };\n const rise = { duration: ms(cs, '--dur-travel-1', 140), easing: cs.getPropertyValue('--ease-rise').trim() || 'ease-out' };\n // What will be visible once the list has grown to fit: its own cap, not its height before the change.\n const seen = viewport.current ? parseFloat(getComputedStyle(viewport.current).maxHeight) || viewport.current.clientHeight : 400;\n let rising = 0;\n els.forEach((el) => {\n const k = el.dataset.flip!, top = now.get(k)!, was = before.get(k);\n if (was === undefined) {\n if (!still && k.startsWith('o:') && rising < 6 && top < seen) {\n rising++;\n el.animate([{ opacity: 0, transform: 'translateY(4px)' }, { opacity: 1, transform: 'none' }], { ...rise, delay: riseDelay(), fill: 'backwards' });\n } else el.animate([{ opacity: 0 }, { opacity: 1 }], rise);\n } else if (!still && Math.abs(was - top) > 0.5) {\n el.animate([{ transform: `translateY(${was - top}px)` }, { transform: 'none' }], glide);\n }\n });\n }, [rowsKey, panelEl]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // The list's height glides to fit its rows (a size change at one level).\n useIsoLayoutEffect(() => {\n const vp = viewport.current, host = sizer.current;\n if (!vp || !host) return;\n const fit = () => { vp.style.height = host.offsetHeight + 'px'; };\n fit();\n const raf = requestAnimationFrame(() => { vp.dataset.ready = ''; });\n const ro = new ResizeObserver(fit);\n ro.observe(host);\n return () => { cancelAnimationFrame(raf); ro.disconnect(); };\n }, [panelEl]);\n\n // One highlight, carried to the active row.\n const [hl, setHl] = React.useState<{ y: number; h: number } | null>(null);\n useIsoLayoutEffect(() => {\n const el = activeRow ? rowEls.current.get(activeRow.key) : null;\n setHl(el ? { y: el.offsetTop, h: el.offsetHeight } : null);\n if (el && byKeyboard.current) el.scrollIntoView({ block: 'nearest' });\n byKeyboard.current = false;\n }, [activeRow?.key, rowsKey, panelEl]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Say how many results there are, once typing pauses.\n React.useEffect(() => {\n if (!q) { setSaid(''); return; }\n const t = setTimeout(() => setSaid(flat.length ? `${flat.length} result${flat.length === 1 ? '' : 's'}` : 'No results'), 450);\n return () => clearTimeout(t);\n }, [q, flat.length]);\n\n const choose = (r: Row) => {\n if (r.item.disabled) return;\n if (closeOnSelect) set(false);\n r.item.onSelect?.();\n onSelect?.(r.item, r.group);\n };\n const onInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n if (!enabled.length) return;\n byKeyboard.current = true;\n const d = e.key === 'ArrowDown' ? 1 : -1;\n setActive((act + d + enabled.length) % enabled.length);\n } else if (e.key === 'Enter' && activeRow) { e.preventDefault(); choose(activeRow); }\n };\n\n if (!mounted) return null;\n const label = rest['aria-label'] ?? 'Command palette';\n const activeIndex = activeRow ? flat.indexOf(activeRow) : -1;\n let n = 0;\n return (\n <Layer>\n <div className=\"alt-cmd-root\" data-state={state} onKeyDown={onKeyDown}>\n <div className=\"alt-scrim\" onClick={close} />\n <div ref={panelRef} role=\"dialog\" aria-modal=\"true\" aria-label={label} tabIndex={-1} className={cx('alt-cmd', className)} data-ephemeral={ephemeral ? '' : undefined}>\n <div className=\"alt-cmd-head\">\n <Input className=\"alt-cmd-field\" value={query} placeholder={placeholder} autoComplete=\"off\" spellCheck={false}\n role=\"combobox\" aria-label={placeholder.replace(/[\u2026.]+$/, '')} aria-expanded={flat.length > 0} aria-controls={`${id}-list`}\n aria-autocomplete=\"list\" aria-activedescendant={activeIndex >= 0 ? `${id}-o-${activeIndex}` : undefined}\n leading={<SearchIcon />} trailing={<span aria-hidden=\"true\"><Kbd>esc</Kbd></span>}\n onChange={(e) => { setInnerQuery(e.target.value); setActive(0); setOnset(false); onQueryChange?.(e.target.value); }}\n // A query carried in is continued, not replaced: the caret lands after it.\n onFocus={(e) => { if (caretPlaced.current) return; caretPlaced.current = true; const n = e.currentTarget.value.length; e.currentTarget.setSelectionRange(n, n); }}\n onKeyDown={onInputKeyDown} />\n </div>\n <div className=\"alt-cmd-viewport\" ref={viewport}>\n <div ref={sizer}>\n <div className=\"alt-cmd-list\" ref={list} role=\"listbox\" id={`${id}-list`} aria-label=\"Results\">\n <span className=\"alt-cmd-hl\" aria-hidden=\"true\" data-tone={activeRow?.item.tone}\n style={hl ? { transform: `translateY(${hl.y}px)`, height: hl.h, opacity: 1 } : { opacity: 0 }} />\n {view.map((v) => {\n const labelId = `${id}-g-${v.gi}`;\n const groupPredicted = !!v.g.predicted || v.rows.every((r) => r.item.predicted);\n return (\n <div key={v.gk} role=\"group\" aria-labelledby={v.g.label ? labelId : undefined} className=\"alt-cmd-group\">\n {v.g.label && <div id={labelId} role=\"presentation\" className=\"alt-cmd-label\" data-flip={'g:' + v.gk} data-predicted={groupPredicted ? '' : undefined}>{v.g.label}</div>}\n {v.rows.map(() => {\n const i = n++, r = flat[i], item = r.item;\n const on = r === activeRow;\n return (\n <div key={r.key} id={`${id}-o-${i}`} role=\"option\" aria-selected={on} aria-disabled={item.disabled || undefined}\n className=\"alt-cmd-item\" data-flip={'o:' + r.key} data-tone={item.tone} data-predicted={r.predicted ? '' : undefined}\n ref={(el) => { if (el) rowEls.current.set(r.key, el); else rowEls.current.delete(r.key); }}\n onPointerMove={() => { if (!item.disabled && !on) setActive(enabled.indexOf(r)); }}\n onClick={() => choose(r)}>\n {item.icon && <span className=\"alt-cmd-icon\" aria-hidden=\"true\">{item.icon}</span>}\n <span className=\"alt-cmd-text\">\n <span className=\"alt-cmd-title\"><Marked text={item.label} ranges={matchRanges(item.label, q)} /></span>\n {item.description && <span className=\"alt-cmd-desc\">{item.description}</span>}\n </span>\n {item.shortcut && <span className=\"alt-cmd-keys\">{item.shortcut.map((k, j) => <Kbd key={j}>{k}</Kbd>)}</span>}\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n {q && !flat.length && (\n <div className=\"alt-cmd-empty\">\n {typeof empty === 'function' ? empty(q) : empty ?? <><b>No results for \u201C{q}\u201D</b>Try another word, or check the spelling.</>}\n </div>\n )}\n </div>\n </div>\n {hints && (\n <div className=\"alt-cmd-foot\" aria-hidden=\"true\">\n <span><Kbd>\u2191</Kbd><Kbd>\u2193</Kbd>Move</span><span><Kbd>\u21B5</Kbd>Choose</span><span><Kbd>esc</Kbd>Close</span>\n </div>\n )}\n <span className=\"alt-sr\" aria-live=\"polite\">{said}</span>\n </div>\n </div>\n </Layer>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, useApproach, useControllable, useIsoLayoutEffect, useKeyFocus, useOutside, usePresence } from './core';\nimport { commandScore } from './command';\n\nconst EXIT_3 = 160; // \u2248 dur-travel-3 \u00D7 0.7\n\nexport interface SelectOption {\n value: string;\n label: React.ReactNode;\n /** Plain text for typeahead, filtering and the field. Needed when label isn't a string. */\n textValue?: string;\n description?: React.ReactNode;\n icon?: React.ReactNode;\n disabled?: boolean;\n}\nexport interface SelectItemProps {\n value: string;\n children: React.ReactNode;\n textValue?: string;\n description?: React.ReactNode;\n icon?: React.ReactNode;\n disabled?: boolean;\n}\n/** Declares one option of a Select. It renders nothing itself; Select reads its props. */\nexport function SelectItem(_: SelectItemProps): React.ReactElement | null { return null; }\n\nconst textOf = (o: SelectOption) => o.textValue ?? (typeof o.label === 'string' || typeof o.label === 'number' ? String(o.label) : o.value);\nfunction collect(items: SelectOption[] | undefined, children: React.ReactNode): SelectOption[] {\n if (items) return items;\n const out: SelectOption[] = [];\n React.Children.forEach(children, (c) => {\n if (!React.isValidElement(c) || c.type !== SelectItem) return;\n const p = c.props as SelectItemProps;\n out.push({ value: p.value, label: p.children, textValue: p.textValue, description: p.description, icon: p.icon, disabled: p.disabled });\n });\n return out;\n}\n\n/** The Checkbox family's tick: the same path and stroke, here in accent-ink on the chosen row. */\nconst Tick = () => (\n <svg className=\"alt-select-tick\" viewBox=\"0 0 16 16\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.25\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-6.5\" pathLength={16} />\n </svg>\n);\nconst Chevron = () => <Icons.ChevronDown className=\"alt-select-chevron\" size={16} />;\n\n/** Opens downward unless there's more room above the field than below it (within whatever clips it). */\nfunction useSide(open: boolean, anchor: React.RefObject<HTMLElement | null>, list: React.RefObject<HTMLElement | null>) {\n const [side, setSide] = React.useState<'bottom' | 'top'>('bottom');\n useIsoLayoutEffect(() => {\n if (!open || !anchor.current || !list.current) return;\n const a = anchor.current.getBoundingClientRect(), need = list.current.offsetHeight + 12;\n let lo = 0, hi = window.innerHeight;\n for (let p = anchor.current.parentElement; p; p = p.parentElement) {\n const o = getComputedStyle(p).overflowY;\n if (o !== 'visible') { const r = p.getBoundingClientRect(); lo = Math.max(lo, r.top); hi = Math.min(hi, r.bottom); }\n }\n setSide(hi - a.bottom >= need || a.top - lo < hi - a.bottom ? 'bottom' : 'top');\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n return side;\n}\n\n/** A brief afterglow on a newly chosen value: it settles into the field. */\nfunction useGlow(value: string) {\n const [glow, setGlow] = React.useState<'a' | 'b' | undefined>(undefined);\n const first = React.useRef(true);\n React.useEffect(() => { if (first.current) { first.current = false; return; } if (value) setGlow((g) => (g === 'a' ? 'b' : 'a')); }, [value]);\n return glow;\n}\n\n/** Finds the label element that names a control by id, so the list can carry the same name. */\nfunction useLabelId(controlId: string, fallback: string) {\n const [labelId, setLabelId] = React.useState<string | undefined>(undefined);\n React.useEffect(() => {\n const label = document.querySelector<HTMLLabelElement>(`label[for=\"${CSS.escape(controlId)}\"]`);\n if (!label) { setLabelId(undefined); return; }\n if (!label.id) label.id = fallback;\n setLabelId(label.id);\n }, [controlId, fallback]);\n return labelId;\n}\n\ntype ListProps = {\n id: string; options: SelectOption[]; active: number; value: string; state: 'open' | 'closed'; side: 'bottom' | 'top';\n query?: string; empty?: React.ReactNode; listRef: React.RefObject<HTMLDivElement | null>; labelledBy?: string; label?: string;\n focusable: boolean; onActive: (i: number) => void; onChoose: (i: number) => void; onKeyDown?: (e: React.KeyboardEvent) => void;\n};\nfunction OptionList({ id, options, active, value, state, side, query, empty, listRef, labelledBy, label, focusable, onActive, onChoose, onKeyDown }: ListProps) {\n const rows = React.useRef<(HTMLDivElement | null)[]>([]);\n const [hl, setHl] = React.useState<{ y: number; h: number } | null>(null);\n useIsoLayoutEffect(() => {\n const el = active >= 0 ? rows.current[active] : null;\n setHl(el ? { y: el.offsetTop, h: el.offsetHeight } : null);\n if (el && listRef.current) {\n const l = listRef.current;\n if (el.offsetTop < l.scrollTop) l.scrollTop = el.offsetTop - 4;\n else if (el.offsetTop + el.offsetHeight > l.scrollTop + l.clientHeight) l.scrollTop = el.offsetTop + el.offsetHeight - l.clientHeight + 4;\n }\n }, [active, options.length]); // eslint-disable-line react-hooks/exhaustive-deps\n const marks = (o: SelectOption) => {\n const t = textOf(o);\n if (!query || typeof o.label !== 'string') return o.label;\n const i = t.toLowerCase().indexOf(query.toLowerCase());\n if (i < 0) return o.label;\n return <>{t.slice(0, i)}<mark className=\"alt-cmd-match\">{t.slice(i, i + query.length)}</mark>{t.slice(i + query.length)}</>;\n };\n return (\n <div ref={listRef as React.Ref<HTMLDivElement>} id={id} role=\"listbox\" tabIndex={focusable ? -1 : undefined} aria-labelledby={labelledBy} aria-label={labelledBy ? undefined : label}\n aria-activedescendant={focusable && active >= 0 ? `${id}-${active}` : undefined}\n className=\"alt-pop alt-menu alt-select-list\" data-state={state} data-side={side} onKeyDown={onKeyDown}\n onMouseDown={(e) => e.preventDefault()}>\n <span className=\"alt-menu-hl\" aria-hidden=\"true\" style={hl ? { transform: `translateY(${hl.y}px)`, height: hl.h, opacity: 1 } : { opacity: 0 }} />\n {options.map((o, i) => (\n <div key={o.value} id={`${id}-${i}`} ref={(el) => { rows.current[i] = el; }} role=\"option\" aria-selected={o.value === value}\n aria-disabled={o.disabled || undefined} data-active={i === active ? '' : undefined} className=\"alt-menu-item alt-select-option\" style={{ ['--i' as any]: Math.min(i, 10) }}\n onPointerMove={() => { if (!o.disabled && i !== active) onActive(i); }} onClick={() => onChoose(i)}>\n {o.icon && <span className=\"alt-menu-icon\">{o.icon}</span>}\n <span className=\"alt-menu-text\">{marks(o)}{o.description && <span className=\"alt-select-desc\">{o.description}</span>}</span>\n {o.value === value && <Tick />}\n </div>\n ))}\n {!options.length && <div className=\"alt-select-empty\">{empty}</div>}\n </div>\n );\n}\n\ninterface FieldLike {\n id?: string;\n name?: string;\n required?: boolean;\n disabled?: boolean;\n /** Drops the field to trench depth. Field sets it for you when it has an error. */\n invalid?: boolean;\n /** sm 34px, md 40px, as Input. Default 'md'. */\n size?: 'sm' | 'md';\n placeholder?: string;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n /** Start with the list open (for documentation). */\n defaultOpen?: boolean;\n}\n\nexport interface SelectProps extends FieldLike {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** The options as data. Or pass SelectItem children. */\n items?: SelectOption[];\n children?: React.ReactNode;\n}\n\n/**\n * Choosing a value is filling a field, so the trigger is an opening built like Input: its back wall shows while it's\n * empty, its floor rises flush once a value is chosen, and it drops to trench depth when invalid. The list rises from\n * the field's edge at level 3 with one gliding highlight; the chosen option wears the Checkbox family's tick.\n */\nexport function Select({ value, defaultValue = '', onValueChange, items, children, id, name, required, disabled, invalid, size = 'md',\n placeholder = 'Choose\u2026', defaultOpen = false, className, ...aria }: SelectProps) {\n const options = collect(items, children);\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(defaultOpen);\n const [active, setActive] = React.useState(() => (defaultOpen ? options.findIndex((o) => o.value === (value ?? defaultValue)) : -1));\n const auto = React.useId();\n const triggerId = id ?? auto + '-trigger';\n const listId = auto + '-list';\n const root = React.useRef<HTMLDivElement>(null);\n const field = React.useRef<HTMLDivElement>(null);\n const trigger = React.useRef<HTMLButtonElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const typed = React.useRef({ text: '', at: 0 });\n const { mounted, state } = usePresence(open, EXIT_3);\n const side = useSide(mounted, field, list);\n const glow = useGlow(v);\n const labelId = useLabelId(triggerId, auto + '-label');\n useApproach();\n useKeyFocus();\n const chosen = options.find((o) => o.value === v);\n const enabled = options.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);\n const close = React.useCallback((refocus = true) => { setOpen(false); if (refocus) trigger.current?.focus({ preventScroll: true }); }, []);\n useOutside(root, open, () => close(false));\n React.useEffect(() => { if (state === 'open') list.current?.focus({ preventScroll: true }); }, [state]);\n\n const openAt = (i: number) => { setActive(i); setOpen(true); };\n const current = () => { const i = options.findIndex((o) => o.value === v && !o.disabled); return i >= 0 ? i : enabled[0] ?? -1; };\n const step = (d: number) => { const p = enabled.indexOf(active); setActive(enabled[Math.max(0, Math.min(enabled.length - 1, (p < 0 ? (d > 0 ? -1 : enabled.length) : p) + d))]); };\n // Typeahead: letters typed within half a second find the next option that starts with them.\n const seek = (key: string, from: number) => {\n const now = Date.now(), t = typed.current;\n t.text = now - t.at < 500 ? t.text + key.toLowerCase() : key.toLowerCase();\n t.at = now;\n const same = t.text.split('').every((c) => c === t.text[0]);\n const q = same ? t.text[0] : t.text;\n const order = [...enabled.filter((i) => i > from), ...enabled.filter((i) => i <= from)];\n const start = same ? order : [from, ...order].filter((i) => i >= 0);\n return start.find((i) => textOf(options[i]).toLowerCase().startsWith(q)) ?? -1;\n };\n const choose = (i: number) => {\n const o = options[i];\n if (!o || o.disabled) return;\n set(o.value);\n close();\n };\n\n const onTriggerKey = (e: React.KeyboardEvent) => {\n if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(e.key)) { e.preventDefault(); openAt(e.key === 'ArrowUp' && v === '' ? enabled[enabled.length - 1] : current()); }\n else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) { const i = seek(e.key, current()); if (i >= 0) { e.preventDefault(); openAt(i); } }\n };\n const onListKey = (e: React.KeyboardEvent) => {\n if (e.key === 'ArrowDown') { e.preventDefault(); step(1); }\n else if (e.key === 'ArrowUp') { e.preventDefault(); step(-1); }\n else if (e.key === 'Home') { e.preventDefault(); setActive(enabled[0]); }\n else if (e.key === 'End') { e.preventDefault(); setActive(enabled[enabled.length - 1]); }\n else if (e.key === 'Enter' || (e.key === ' ' && Date.now() - typed.current.at > 500)) { e.preventDefault(); choose(active); }\n else if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); close(); }\n else if (e.key === 'Tab') close(false);\n else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) { const i = seek(e.key, active); if (i >= 0) { e.preventDefault(); setActive(i); } }\n };\n\n return (\n <div ref={root} className={cx('alt-select', className)} data-open={open ? '' : undefined}>\n <div ref={field} className=\"alt-input\" data-size={size} data-approach=\"56\" data-filled={chosen ? '' : undefined}\n data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}>\n <button ref={trigger} id={triggerId} type=\"button\" className=\"alt-select-trigger\" disabled={disabled}\n aria-haspopup=\"listbox\" aria-expanded={open} aria-controls={open ? listId : undefined} aria-invalid={invalid || undefined} aria-required={required || undefined}\n {...aria} onClick={() => (open ? close() : openAt(current()))} onKeyDown={onTriggerKey}>\n <span className=\"alt-select-value\" data-placeholder={chosen ? undefined : ''} data-glow={glow}>\n {chosen ? <>{chosen.icon && <span className=\"alt-select-icon\">{chosen.icon}</span>}{chosen.label}</> : placeholder}\n </span>\n <Chevron />\n </button>\n </div>\n {name && <input type=\"hidden\" name={name} value={v} />}\n {mounted && (\n <OptionList id={listId} options={options} active={active} value={v} state={state} side={side} listRef={list} labelledBy={labelId}\n label={aria['aria-label']} focusable onActive={setActive} onChoose={choose} onKeyDown={onListKey} />\n )}\n </div>\n );\n}\n\nexport interface ComboboxProps extends FieldLike {\n items: SelectOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Score an option against what's typed: 0 (or false) hides it, higher ranks it first. Default: the CommandPalette's ranking. */\n filter?: (option: SelectOption, query: string) => number | boolean;\n /** Shown when nothing matches. Default \"No matches\". */\n empty?: React.ReactNode;\n}\n\n/**\n * An editable Select: type to filter, choose to fill. What you type is a query, not yet a value, so the field stays an\n * opening (its back wall showing) until an option is chosen; then its floor rises flush.\n */\nexport function Combobox({ items, value, defaultValue = '', onValueChange, filter, empty = 'No matches', id, name, required, disabled, invalid,\n size = 'md', placeholder = 'Type to search\u2026', defaultOpen = false, className, ...aria }: ComboboxProps) {\n const [v, set] = useControllable(value, defaultValue, onValueChange);\n const chosen = items.find((o) => o.value === v);\n const [text, setText] = React.useState(chosen ? textOf(chosen) : '');\n const [typing, setTyping] = React.useState(false);\n const [open, setOpen] = React.useState(defaultOpen);\n const [active, setActive] = React.useState(() => (defaultOpen ? items.findIndex((o) => o.value === (value ?? defaultValue)) : -1));\n const auto = React.useId();\n const inputId = id ?? auto + '-input';\n const listId = auto + '-list';\n const root = React.useRef<HTMLDivElement>(null);\n const field = React.useRef<HTMLDivElement>(null);\n const input = React.useRef<HTMLInputElement>(null);\n const list = React.useRef<HTMLDivElement>(null);\n const { mounted, state } = usePresence(open, EXIT_3);\n const side = useSide(mounted, field, list);\n const glow = useGlow(v);\n const labelId = useLabelId(inputId, auto + '-label');\n useApproach();\n useKeyFocus();\n // A controlled value that changes from outside resets the text.\n React.useEffect(() => { if (!typing) setText(chosen ? textOf(chosen) : ''); }, [v]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const q = typing ? text.trim() : '';\n const score = (o: SelectOption) => { const s = filter ? filter(o, q) : commandScore(textOf(o), q); return typeof s === 'boolean' ? (s ? 1 : 0) : s; };\n const shown = q ? items.map((o, i) => ({ o, i, s: score(o) })).filter((x) => x.s > 0).sort((a, b) => b.s - a.s || a.i - b.i).map((x) => x.o) : items;\n const enabled = shown.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);\n const restore = () => { setText(chosen ? textOf(chosen) : ''); setTyping(false); };\n const close = () => { setOpen(false); };\n // Leaving the field, by Tab or by clicking away, commits what's typed: an exact name chooses it, an empty field clears\n // the value, anything else goes back to the value it had.\n const commit = () => {\n close();\n if (!typing) return;\n const exact = items.find((o) => !o.disabled && textOf(o).toLowerCase() === text.trim().toLowerCase());\n if (exact) { set(exact.value); setText(textOf(exact)); setTyping(false); }\n else if (!text.trim()) { set(''); setTyping(false); }\n else restore();\n };\n useOutside(root, open, commit);\n\n const choose = (i: number) => {\n const o = shown[i];\n if (!o || o.disabled) return;\n set(o.value); setText(textOf(o)); setTyping(false); close();\n input.current?.focus({ preventScroll: true });\n };\n const onKey = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n if (!open) { const i = shown.findIndex((o) => o.value === v); setActive(e.altKey ? -1 : i >= 0 ? i : enabled[0] ?? -1); setOpen(true); return; }\n const p = enabled.indexOf(active), d = e.key === 'ArrowDown' ? 1 : -1;\n setActive(enabled[(p < 0 ? (d > 0 ? -1 : enabled.length) : p + d + enabled.length) % enabled.length] ?? enabled[0]);\n } else if (e.key === 'Enter' && open && active >= 0) { e.preventDefault(); choose(active); }\n else if (e.key === 'Escape') {\n if (open || typing) { e.preventDefault(); e.stopPropagation(); close(); restore(); }\n } else if (e.key === 'Tab' && open) close();\n };\n const onBlur = (e: React.FocusEvent) => { if (!root.current?.contains(e.relatedTarget as Node)) commit(); };\n const filled = !!chosen && !typing;\n return (\n <div ref={root} className={cx('alt-select alt-combobox', className)} data-open={open ? '' : undefined}>\n <div ref={field} className=\"alt-input\" data-size={size} data-approach=\"56\" data-filled={filled ? '' : undefined}\n data-invalid={invalid ? '' : undefined} data-disabled={disabled ? '' : undefined}>\n <input ref={input} id={inputId} type=\"text\" role=\"combobox\" autoComplete=\"off\" spellCheck={false} disabled={disabled}\n aria-autocomplete=\"list\" aria-expanded={open} aria-controls={mounted ? listId : undefined} aria-activedescendant={open && active >= 0 ? `${listId}-${active}` : undefined}\n aria-invalid={invalid || undefined} aria-required={required || undefined} placeholder={placeholder} value={text} data-glow={glow}\n {...aria} onKeyDown={onKey} onBlur={onBlur}\n onChange={(e) => { setText(e.target.value); setTyping(true); setOpen(true); setActive(0); }} />\n <button type=\"button\" tabIndex={-1} className=\"alt-select-toggle\" aria-label=\"Show options\" disabled={disabled}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => { if (open) { close(); restore(); } else { const i = items.findIndex((o) => o.value === v); setActive(i); setOpen(true); } input.current?.focus(); }}>\n <Chevron />\n </button>\n </div>\n {name && <input type=\"hidden\" name={name} value={v} />}\n {mounted && (\n <OptionList id={listId} options={shown} active={Math.min(active, shown.length - 1)} value={v} state={state} side={side} listRef={list} labelledBy={labelId}\n label={aria['aria-label']} focusable={false} query={q} empty={empty} onActive={setActive} onChoose={choose} />\n )}\n </div>\n );\n}\n", "import * as React from 'react';\nimport { cx, riseDelay } from './core';\n\nexport interface StepperStep {\n /** Stable key. Default: the step's position. */\n id?: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n}\nexport interface StepperProps extends Omit<React.OlHTMLAttributes<HTMLOListElement>, 'onChange'> {\n steps: StepperStep[];\n /** The index of the step being worked on. steps.length means every step is complete. */\n current: number;\n /** Makes completed steps buttons that go back to them. */\n onStepChange?: (index: number) => void;\n /** Default 'horizontal'. */\n orientation?: 'horizontal' | 'vertical';\n}\n\nconst Tick = () => (\n <svg viewBox=\"0 0 16 16\" width=\"13\" height=\"13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3.5 8.5l3 3 6-6.5\" pathLength={16} />\n </svg>\n);\nconst word = { done: 'completed', current: 'current', upcoming: 'not started' } as const;\n\n/**\n * A process as a staircase of plates on one ground line, in the breadcrumb's vocabulary. Completed steps are settled into\n * the record: flush plates with a stamped check. The current step is a raised slab with a wall. Steps to come are imprints\n * pressed into the page. Advancing presses the current step down into the record, stamps its check in, then raises the\n * next one out of its imprint.\n */\nexport function Stepper({ steps, current, onStepChange, orientation = 'horizontal', className, ...rest }: StepperProps) {\n // The motion is derived in the same render that changes the states, so the rise's delay is in place before its\n // transition starts (setting it in an effect would be a frame late and the new step would rise at once).\n const [seen, setSeen] = React.useState(current);\n const [motion, setMotion] = React.useState<{ pressed: number; risen: number; stamp: number; delay: number; key: number } | null>(null);\n const [said, setSaid] = React.useState('');\n if (seen !== current) {\n setSeen(current);\n // Forward: the old step presses down and is stamped, then the new one rises. Back: the old one sinks, the chosen one rises.\n setMotion({ pressed: seen, risen: current, stamp: current > seen ? seen : -1, delay: (current > seen ? 150 : 60) + riseDelay(), key: (motion?.key ?? 0) + 1 });\n }\n React.useEffect(() => {\n if (!motion) return;\n const t = steps[current];\n setSaid(t ? `Step ${current + 1} of ${steps.length}: ${typeof t.title === 'string' ? t.title : ''}` : 'All steps complete');\n const done = setTimeout(() => setMotion(null), 900);\n return () => clearTimeout(done);\n }, [motion?.key]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <>\n <ol className={cx('alt-stepper', className)} data-orientation={orientation} aria-label={rest['aria-label'] ?? 'Progress'} {...rest}>\n {steps.map((s, i) => {\n const state = i < current ? 'done' : i === current ? 'current' : 'upcoming';\n const back = state === 'done' && !!onStepChange;\n const rising = motion && motion.risen === i;\n const stamped = motion && motion.stamp === i;\n // One element in every state (a completed step that goes back is a role=\"button\"), so the plate's height animates\n // from state to state instead of being swapped for a new element.\n return (\n <li key={s.id ?? i} className=\"alt-step-item\" data-state={state} aria-current={state === 'current' ? 'step' : undefined}>\n <div className=\"alt-step\" data-state={state} data-motion={rising ? 'rise' : motion && motion.pressed === i ? 'press' : undefined}\n {...(back ? { role: 'button', tabIndex: 0, onClick: () => onStepChange!(i),\n onKeyDown: (e: React.KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onStepChange!(i); } } } : {})}\n style={rising ? ({ ['--alt-rise-delay' as any]: motion!.delay + 'ms' } as React.CSSProperties) : undefined}>\n <span className=\"alt-step-mark\" data-stamp={stamped ? (motion!.key % 2 ? 'a' : 'b') : undefined}>{state === 'done' ? <Tick /> : i + 1}</span>\n <span className=\"alt-step-text\">\n <span className=\"alt-sr\">Step {i + 1} of {steps.length}, {word[state]}: </span>\n <span className=\"alt-step-title\">{s.title}</span>\n {s.description && <span className=\"alt-step-desc\">{s.description}</span>}\n </span>\n </div>\n {i < steps.length - 1 && <span className=\"alt-step-line\" aria-hidden=\"true\" data-done={i < current ? '' : undefined} />}\n </li>\n );\n })}\n </ol>\n <span className=\"alt-sr\" aria-live=\"polite\">{said}</span>\n </>\n );\n}\n", "import * as React from 'react';\nimport { cx } from './core';\n\nexport interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {\n /** A line icon, drawn in ink-muted: 24px, or 18px at size sm. */\n icon?: React.ReactNode;\n /** What is empty, as a statement: \"No gift ideas yet\". It names the region. */\n title: React.ReactNode;\n /** Why it's empty, or what will appear here. Linked as the region's description. */\n description?: React.ReactNode;\n /** The one obvious next step: usually a primary Button. */\n action?: React.ReactNode;\n /** A quieter alternative beside it: usually a ghost Button or a link. */\n secondary?: React.ReactNode;\n /** md fills a page or a panel; sm fits a widget or a list. Default 'md'. */\n size?: 'sm' | 'md';\n /** The title's heading level. Default 3. */\n headingLevel?: 2 | 3 | 4;\n /** Say it politely when it appears, for an empty that follows a change (a filter, a search). true says the title, if it's text; a string says that. */\n announce?: boolean | string;\n}\n\n/**\n * An opening the first record will fill. Nothing here yet is a well cut into the page (not a raised card, not an\n * alert), with a dashed rim, a title that names what's empty and one next action standing in it.\n */\nexport function EmptyState({ icon, title, description, action, secondary, size = 'md', headingLevel = 3, announce,\n className, children, ...rest }: EmptyStateProps) {\n const id = React.useId();\n const H = `h${headingLevel}` as 'h2' | 'h3' | 'h4';\n const words = typeof announce === 'string' ? announce : announce && typeof title === 'string' ? title : '';\n // A live region has to exist before its text changes, so the words arrive a moment after it mounts.\n const [said, setSaid] = React.useState('');\n React.useEffect(() => {\n if (!words) { setSaid(''); return; }\n const t = setTimeout(() => setSaid(words), 100);\n return () => clearTimeout(t);\n }, [words]);\n return (\n <section className={cx('alt-empty', className)} data-size={size} aria-labelledby={`${id}-t`}\n aria-describedby={description ? `${id}-d` : undefined} {...rest}>\n {icon && <span className=\"alt-empty-icon\" aria-hidden=\"true\">{icon}</span>}\n <H id={`${id}-t`} className=\"alt-empty-title\">{title}</H>\n {description && <p id={`${id}-d`} className=\"alt-empty-desc\">{description}</p>}\n {children}\n {(action || secondary) && <div className=\"alt-empty-actions\">{action}{secondary}</div>}\n {announce && <span className=\"alt-sr\" aria-live=\"polite\">{said}</span>}\n </section>\n );\n}\n", "import * as React from 'react';\nimport { cx, Icons, riseDelay, useControllable, useDepth, useIsoLayoutEffect } from './core';\nimport { Badge, Button, Checkbox } from './controls';\nimport { Pile } from './pile';\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 shared: carrying things to their new places (FLIP) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n/** Positions recorded at the moment of a drop (where things visibly were), used instead of the last layout's. */\nconst dropSnapshots = new WeakMap<HTMLElement, Map<string, { x: number; y: number }>>();\nconst ms = (cs: CSSStyleDeclaration, name: string, fallback: number) => parseFloat(cs.getPropertyValue(name)) || fallback;\n\n/**\n * Where an element sits in the page, from layout offsets: transforms (a lift, a drag, a running animation) don't count,\n * so nothing has to be cancelled to measure. Scroll offsets along the way are subtracted.\n */\nfunction pagePlace(el: HTMLElement) {\n let x = 0, y = 0;\n for (let n: HTMLElement | null = el; n;) {\n x += n.offsetLeft; y += n.offsetTop;\n const p = n.offsetParent as HTMLElement | null;\n if (p) { x -= p.scrollLeft; y -= p.scrollTop; }\n n = p;\n }\n return { x, y };\n}\n/** Where an element sits relative to `host`. Both are measured from the page, so it holds whichever offset parent each has\n * (a row made position: relative while it's held reports to the scroll area instead of the table). */\nfunction placeIn(el: HTMLElement, host: HTMLElement) {\n const a = pagePlace(el), b = pagePlace(host);\n return { x: a.x - b.x, y: a.y - b.y };\n}\n/**\n * After every commit, items (matched by `selector`, keyed by `attr`) whose place changed are carried there from where\n * they were, instead of jumping (FLIP). Positions are measured in `host`, so moves between containers travel too.\n */\nfunction useCarry(host: React.RefObject<HTMLElement | null>, selector: string, attr: string, durToken = '--dur-travel-3') {\n const prev = React.useRef<Map<string, { x: number; y: number }> | null>(null);\n useIsoLayoutEffect(() => {\n const root = host.current;\n if (!root) return;\n const els = Array.from(root.querySelectorAll<HTMLElement>(selector));\n const now = new Map<string, { x: number; y: number }>();\n els.forEach((el) => now.set(el.getAttribute(attr)!, placeIn(el, root)));\n const before = dropSnapshots.get(root) ?? prev.current;\n dropSnapshots.delete(root);\n prev.current = now;\n if (!before) return;\n const cs = getComputedStyle(root);\n if (parseFloat(cs.getPropertyValue('--alt-travel')) === 0) return;\n const opts = { duration: ms(cs, durToken, 220), easing: cs.getPropertyValue('--ease-glide').trim() || 'ease' };\n // Something that was let go lands: it settles into place with a slight overshoot instead of gliding.\n const landing = { duration: ms(cs, durToken, 220), easing: cs.getPropertyValue('--ease-settle').trim() || 'ease-out' };\n els.forEach((el) => {\n const k = el.getAttribute(attr)!, a = before.get(k), b = now.get(k)!;\n if (!a) return;\n const dx = a.x - b.x, dy = a.y - b.y;\n if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) el.animate([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: 'none' }], el.hasAttribute('data-landing') ? landing : opts);\n });\n });\n}\nconst moveItem = <T,>(arr: T[], from: number, to: number) => { const a = arr.slice(); const [x] = a.splice(from, 1); a.splice(to, 0, x); return a; };\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {\n /** The table scrolls under its header past this height. */\n maxHeight?: number | string;\n /** Drawn inside the scroll area, beneath the rows (DataTable puts its landing slot here). */\n underlay?: React.ReactNode;\n}\n/**\n * Rows are the record: they sit on the ground with `line` dividers. The header stays flush until rows scroll under it,\n * then rises. Rows that change place are carried there. Each row's height is drawn as one slab by its first cell.\n */\nexport const Table = React.forwardRef<HTMLTableElement, TableProps>(function Table({ maxHeight, underlay, className, children, ...rest }, ref) {\n const wrap = React.useRef<HTMLDivElement>(null);\n const table = React.useRef<HTMLTableElement>(null);\n React.useImperativeHandle(ref, () => table.current as HTMLTableElement);\n const [edges, setEdges] = React.useState({ top: false, bottom: false });\n const measure = React.useCallback(() => {\n const el = wrap.current;\n if (!el) return;\n const top = el.scrollTop > 1, bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;\n setEdges((p) => (p.top === top && p.bottom === bottom ? p : { top, bottom }));\n }, []);\n useIsoLayoutEffect(() => {\n const t = table.current;\n if (!t) return;\n const fit = () => { t.style.setProperty('--alt-row-w', t.offsetWidth + 'px'); measure(); };\n fit();\n const ro = new ResizeObserver(fit);\n ro.observe(t);\n if (wrap.current) ro.observe(wrap.current);\n return () => ro.disconnect();\n }, [measure]);\n useCarry(table, 'tbody > tr[data-row]', 'data-row');\n const scrolls = maxHeight !== undefined;\n return (\n <div ref={wrap} className=\"alt-table-wrap\" data-top={edges.top ? '' : undefined} data-bottom={edges.bottom ? '' : undefined}\n style={scrolls ? { maxHeight } : undefined} onScroll={measure}\n {...(scrolls ? { tabIndex: 0, role: 'region', 'aria-label': rest['aria-label'] } : {})}>\n {underlay}\n <table ref={table} className={cx('alt-table', className)} {...rest}>{children}</table>\n </div>\n );\n});\nexport const TableHeader = ({ className, ...p }: React.HTMLAttributes<HTMLTableSectionElement>) => <thead className={cx('alt-table-head', className)} {...p} />;\nexport const TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(function TableBody({ className, ...p }, ref) {\n return <tbody ref={ref} className={cx('alt-table-body', className)} {...p} />;\n});\nexport const TableFooter = ({ className, ...p }: React.HTMLAttributes<HTMLTableSectionElement>) => <tfoot className={cx('alt-table-foot', className)} {...p} />;\nexport const TableCaption = ({ className, ...p }: React.HTMLAttributes<HTMLTableCaptionElement>) => <caption className={cx('alt-table-caption', className)} {...p} />;\n\nexport interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {\n /** A stable id. With it, a row whose place changes (re-sorting, reordering) is carried there instead of jumping. */\n rowId?: string;\n /** Selected rows are tinted accent-soft and raised one level. Pair it with a checked Checkbox in the row. */\n selected?: boolean;\n /** Lifts on hover. Only when clicking the row does something. */\n interactive?: boolean;\n /** Focus+context filtering: match rises one level, miss sinks into a well. */\n relevance?: 'match' | 'miss';\n /** Afterglow: when the value changes, the row lifts, tints and settles back over dur-settle. true settles once on mount. */\n settle?: unknown;\n /** In someone's hand while it's being moved: level 3, tilted. */\n held?: boolean;\n}\nexport const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { rowId, selected, interactive, relevance, settle, held, className, style, ...rest }, ref) {\n const [glow, setGlow] = React.useState<'a' | 'b' | undefined>(undefined);\n const [delay, setDelay] = React.useState(0);\n const first = React.useRef(true);\n React.useEffect(() => {\n const wasFirst = first.current;\n first.current = false;\n if (settle === undefined || settle === null || settle === false || (wasFirst && settle !== true)) return;\n setDelay(riseDelay());\n setGlow((g) => (g === 'a' ? 'b' : 'a'));\n }, [settle]);\n return (\n <tr ref={ref} className={cx('alt-tr', className)} data-row={rowId} data-selected={selected ? '' : undefined}\n data-interactive={interactive ? '' : undefined}\n data-row-relevance={relevance} data-row-held={held ? '' : undefined} data-row-settle={glow}\n style={delay ? ({ ['--alt-rise-delay' as any]: delay + 'ms', ...style } as React.CSSProperties) : style} {...rest} />\n );\n});\n\nconst SortIcon = () => (\n <svg className=\"alt-table-sort-icon\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.75} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M6 15l6-6 6 6\" />\n </svg>\n);\nexport interface TableHeadProps extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> {\n align?: 'start' | 'end';\n /** This column's sort. With onSort, the header becomes a button and the th carries aria-sort. */\n sort?: 'ascending' | 'descending' | 'none';\n onSort?: () => void;\n}\nexport function TableHead({ align, sort, onSort, className, children, ...rest }: TableHeadProps) {\n return (\n <th scope=\"col\" className={cx('alt-th', className)} data-align={align} aria-sort={onSort ? sort ?? 'none' : undefined} {...rest}>\n {onSort ? <button type=\"button\" className=\"alt-table-sort\" data-sort={sort ?? 'none'} onClick={onSort}>{children}<SortIcon /></button> : children}\n </th>\n );\n}\nexport interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> { align?: 'start' | 'end' }\nexport function TableCell({ align, className, ...rest }: TableCellProps) {\n return <td className={cx('alt-td', className)} data-align={align} {...rest} />;\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 DataTable \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface DataTableColumn<T> {\n key: string;\n header: React.ReactNode;\n /** Cell content. Default: the row's value at `key`. */\n cell?: (row: T) => React.ReactNode;\n /** Makes the column sortable by this value. */\n sortValue?: (row: T) => string | number;\n align?: 'start' | 'end';\n width?: number | string;\n}\nexport type TableSort = { key: string; direction: 'ascending' | 'descending' } | null;\nexport interface DataTableProps<T> {\n columns: DataTableColumn<T>[];\n rows: T[];\n getRowId: (row: T) => string;\n /** A row's name, for screen readers (its checkbox, its move handle, announcements) and its button with onRowClick. */\n getRowLabel?: (row: T) => string;\n /** A checkbox column; selected rows rise, and the toolbar counts them. */\n selectable?: boolean;\n selected?: string[];\n defaultSelected?: string[];\n onSelectedChange?: (ids: string[]) => void;\n /** Toolbar actions for the selected rows, shown beside their count. */\n actions?: (ids: string[]) => React.ReactNode;\n /** Anything else for the toolbar's end (a filter field, a button). */\n toolbar?: React.ReactNode;\n sort?: TableSort;\n defaultSort?: TableSort;\n onSortChange?: (sort: TableSort) => void;\n /** Makes rows interactive: the first column becomes the row's button, and clicking anywhere on the row calls this. */\n onRowClick?: (row: T) => void;\n /** Filter in place: matches rise, misses sink. Return undefined when no filter is active. */\n relevance?: (row: T) => 'match' | 'miss' | undefined;\n /** Adds move handles: rows can be picked up and dropped (pointer, or Space and the arrow keys). Hidden while sorted. */\n onReorder?: (rows: T[]) => void;\n maxHeight?: number | string;\n /** Shown when there are no rows. */\n empty?: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n}\n\nconst GripIcon = () => (\n <svg width=\"12\" height=\"16\" viewBox=\"0 0 12 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"3\" cy=\"3\" r=\"1.3\" /><circle cx=\"9\" cy=\"3\" r=\"1.3\" /><circle cx=\"3\" cy=\"8\" r=\"1.3\" /><circle cx=\"9\" cy=\"8\" r=\"1.3\" /><circle cx=\"3\" cy=\"13\" r=\"1.3\" /><circle cx=\"9\" cy=\"13\" r=\"1.3\" />\n </svg>\n);\n\n/**\n * A table from data: sortable columns whose rows are carried to their new places, a checkbox column whose selected rows\n * rise (counted by a floating Badge in the toolbar), filtering in place, interactive rows and reordering by hand.\n */\nexport function DataTable<T>({ columns, rows, getRowId, getRowLabel, selectable, selected, defaultSelected = [], onSelectedChange, actions, toolbar,\n sort, defaultSort = null, onSortChange, onRowClick, relevance, onReorder, maxHeight, empty = 'Nothing here yet.', className, ...rest }: DataTableProps<T>) {\n const [sel, setSel] = useControllable(selected, defaultSelected, onSelectedChange);\n const [srt, setSrt] = useControllable<TableSort>(sort, defaultSort, onSortChange);\n const [said, setSaid] = React.useState('');\n const table = React.useRef<HTMLTableElement>(null);\n const body = React.useRef<HTMLTableSectionElement>(null);\n const name = (r: T) => getRowLabel?.(r) ?? getRowId(r);\n const view = React.useMemo(() => {\n const col = srt && columns.find((c) => c.key === srt.key);\n if (!srt || !col?.sortValue) return rows;\n const d = srt.direction === 'descending' ? -1 : 1;\n return rows.map((r, i) => ({ r, i, v: col.sortValue!(r) }))\n .sort((a, b) => (typeof a.v === 'string' || typeof b.v === 'string' ? String(a.v).localeCompare(String(b.v), undefined, { numeric: true }) : (a.v as number) - (b.v as number)) * d || a.i - b.i)\n .map((x) => x.r);\n }, [rows, srt, columns]);\n const ids = view.map(getRowId);\n const chosen = new Set(sel);\n const all = ids.length > 0 && ids.every((id) => chosen.has(id));\n const some = !all && ids.some((id) => chosen.has(id));\n const movable = !!onReorder && !srt;\n\n const cycle = (c: DataTableColumn<T>) => {\n const next: TableSort = srt?.key !== c.key ? { key: c.key, direction: 'ascending' } : srt.direction === 'ascending' ? { key: c.key, direction: 'descending' } : null;\n setSrt(next);\n setSaid(next ? `Sorted by ${typeof c.header === 'string' ? c.header : c.key}, ${next.direction}.` : 'Sort cleared.');\n };\n const toggle = (id: string, on: boolean) => setSel(on ? [...sel.filter((x) => x !== id), id] : sel.filter((x) => x !== id));\n\n // Reordering by hand: pick a row up by its handle; the slot it will land in opens as a well; it lands where you drop it.\n const start = React.useRef<{ y: number; id: string; from: number; tops: number[]; hs: number[] } | null>(null);\n const [drag, setDrag] = React.useState<{ id: string; from: number; to: number; dy: number } | null>(null);\n const [held, setHeld] = React.useState<{ id: string; origin: number } | null>(null);\n const rowEls = () => Array.from(body.current?.querySelectorAll<HTMLTableRowElement>('tr[data-row]') ?? []);\n // Where each row was drawn when it was let go (its layout place plus the drag offset), so the drop travels from there.\n const snapshot = (at: (i: number) => number) => {\n if (!table.current) return;\n const m = new Map<string, { x: number; y: number }>();\n ids.forEach((id, i) => m.set(id, { x: 0, y: at(i) }));\n dropSnapshots.set(table.current, m);\n };\n const onGripDown = (e: React.PointerEvent, id: string, index: number) => {\n if (e.button !== 0) return;\n const els = rowEls();\n start.current = { y: e.clientY, id, from: index, tops: els.map((el) => el.offsetTop), hs: els.map((el) => el.offsetHeight) };\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n };\n const onGripMove = (e: React.PointerEvent) => {\n const s = start.current;\n if (!s) return;\n const dy = e.clientY - s.y;\n if (!drag && Math.abs(dy) < 4) return;\n const center = s.tops[s.from] + s.hs[s.from] / 2 + dy;\n let to = 0;\n s.tops.forEach((t, i) => { if (i !== s.from && t + s.hs[i] / 2 < center) to++; });\n setDrag({ id: s.id, from: s.from, to, dy });\n };\n const onGripUp = () => {\n const s = start.current;\n start.current = null;\n if (!drag || !s) { setDrag(null); return; }\n const { from, to } = drag, hs = s.hs[from];\n snapshot((i) => s.tops[i] + (i === from ? drag.dy : drag.from < drag.to && i > from && i <= to ? -hs : drag.to < drag.from && i >= to && i < from ? hs : 0));\n setDrag(null);\n if (from !== to) { onReorder!(moveItem(view, from, to)); setSaid(`${name(view[from])} moved to position ${to + 1} of ${view.length}.`); }\n };\n const focusGrip = (id: string) => requestAnimationFrame(() => body.current?.querySelector<HTMLElement>(`tr[data-row=\"${CSS.escape(id)}\"] .alt-table-grip`)?.focus());\n const onGripKey = (e: React.KeyboardEvent, id: string, index: number) => {\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (held?.id === id) { setHeld(null); setSaid(`${name(view[index])} dropped at position ${index + 1} of ${view.length}.`); }\n else { setHeld({ id, origin: index }); setSaid(`${name(view[index])} picked up, position ${index + 1} of ${view.length}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`); }\n } else if (held?.id === id && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {\n e.preventDefault();\n const to = Math.max(0, Math.min(view.length - 1, index + (e.key === 'ArrowUp' ? -1 : 1)));\n if (to !== index) { onReorder!(moveItem(view, index, to)); setSaid(`Position ${to + 1} of ${view.length}.`); focusGrip(id); }\n } else if (held?.id === id && e.key === 'Escape') {\n e.preventDefault();\n if (held.origin !== index) { onReorder!(moveItem(view, index, held.origin)); focusGrip(id); }\n setHeld(null); setSaid(`Move cancelled; ${name(view[index])} is back at position ${held.origin + 1}.`);\n }\n };\n React.useEffect(() => { if (!movable) setHeld(null); }, [movable]);\n\n const s = start.current;\n const h = drag && s ? s.hs[drag.from] : 0;\n const slotTop = drag && s ? (drag.to <= drag.from ? s.tops[drag.to] : s.tops[drag.to] + s.hs[drag.to] - s.hs[drag.from]) : 0;\n const span = columns.length + (selectable ? 1 : 0) + (movable ? 1 : 0);\n return (\n <div className={cx('alt-data-table', className)}>\n {(selectable || toolbar) && (\n <div className=\"alt-table-tools\">\n {sel.length > 0 && (\n <div className=\"alt-table-selection\">\n <Badge variant=\"count\" tone=\"accent\" aria-hidden=\"true\">{sel.length}</Badge>\n <span>selected</span>\n {actions?.(sel)}\n <Button size=\"sm\" variant=\"ghost\" onClick={() => setSel([])}>Clear</Button>\n </div>\n )}\n {toolbar && <div className=\"alt-table-tools-end\">{toolbar}</div>}\n </div>\n )}\n <Table ref={table} maxHeight={maxHeight} aria-label={rest['aria-label']} data-dragging={drag ? '' : undefined}\n underlay={drag && s ? <span className=\"alt-table-slot\" aria-hidden=\"true\" style={{ top: slotTop + (table.current?.offsetTop ?? 0), height: h }} /> : null}>\n <TableHeader>\n <TableRow>\n {movable && <TableHead className=\"alt-th-grip\"><span className=\"alt-sr\">Move</span></TableHead>}\n {selectable && (\n <TableHead className=\"alt-th-check\">\n <Checkbox aria-label=\"Select all rows\" checked={all} indeterminate={some} onCheckedChange={(on) => setSel(on ? Array.from(new Set([...sel, ...ids])) : sel.filter((x) => !ids.includes(x)))} />\n </TableHead>\n )}\n {columns.map((c) => (\n <TableHead key={c.key} align={c.align} style={{ width: c.width }} sort={srt?.key === c.key ? srt.direction : 'none'} onSort={c.sortValue ? () => cycle(c) : undefined}>{c.header}</TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody ref={body}>\n {!view.length && <tr><td className=\"alt-td alt-table-empty\" colSpan={span}>{empty}</td></tr>}\n {view.map((r, i) => {\n const id = ids[i];\n let shift = 0;\n if (drag && id !== drag.id && h) {\n if (drag.from < drag.to && i > drag.from && i <= drag.to) shift = -h;\n if (drag.to < drag.from && i >= drag.to && i < drag.from) shift = h;\n }\n const following = drag?.id === id;\n return (\n <TableRow key={id} rowId={id} selected={selectable && chosen.has(id)} interactive={!!onRowClick} relevance={relevance?.(r)}\n held={following || held?.id === id} data-following={following ? '' : undefined}\n style={following ? { transform: `translateY(${drag!.dy}px)` } : shift ? { transform: `translateY(${shift}px)` } : undefined}\n onClick={onRowClick ? (e) => { if (!(e.target as HTMLElement).closest('button, a, input, label, select, textarea')) onRowClick(r); } : undefined}>\n {movable && (\n <TableCell className=\"alt-td-grip\">\n <button type=\"button\" className=\"alt-table-grip\" aria-label={`Move ${name(r)}`} aria-pressed={held?.id === id}\n onPointerDown={(e) => onGripDown(e, id, i)} onPointerMove={onGripMove} onPointerUp={onGripUp} onPointerCancel={onGripUp}\n onKeyDown={(e) => onGripKey(e, id, i)} onBlur={() => { if (held?.id === id && !drag) setTimeout(() => setHeld((x) => (x?.id === id && document.activeElement?.closest(`tr[data-row=\"${CSS.escape(id)}\"]`) === null ? null : x)), 0); }}>\n <GripIcon />\n </button>\n </TableCell>\n )}\n {selectable && (\n <TableCell className=\"alt-td-check\"><Checkbox aria-label={`Select ${name(r)}`} checked={chosen.has(id)} onCheckedChange={(on) => toggle(id, on)} /></TableCell>\n )}\n {columns.map((c, ci) => {\n const content = c.cell ? c.cell(r) : String((r as any)[c.key] ?? '');\n return (\n <TableCell key={c.key} align={c.align}>\n {onRowClick && ci === 0 ? <button type=\"button\" className=\"alt-table-rowbtn\" onClick={() => onRowClick(r)}>{content}</button> : content}\n </TableCell>\n );\n })}\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n <span className=\"alt-sr\" aria-live=\"polite\">{selectable && sel.length ? `${sel.length} selected. ` : ''}{said}</span>\n </div>\n );\n}\n\n/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 Board \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\nexport interface BoardPlace { column: string; index: number }\nexport interface BoardMove { cardId: string; from: BoardPlace; to: BoardPlace }\ntype SnapCard = { id: string; x: number; y: number; w: number; h: number };\ntype SnapCol = { id: string; title: string; x: number; w: number; listTop: number; gap: number; collapsed: boolean; count: number; cards: SnapCard[] };\ntype Carry = { id: string; from: BoardPlace; to: BoardPlace; dx: number; dy: number; h: number; gap: number; shifts: Record<string, number>; slotTop: number };\ntype BoardCtxT = {\n carry: Carry | null; kb: { id: string; origin: BoardPlace; at: BoardPlace } | null; landing: string | null; hintId: string;\n onPointerDown: (e: React.PointerEvent, id: string) => void; onPointerMove: (e: React.PointerEvent) => void; onPointerUp: () => void;\n onKeyDown: (e: React.KeyboardEvent, id: string) => void; onBlur: (id: string) => void; swallowClick: () => boolean;\n};\nconst BoardCtx = React.createContext<BoardCtxT | null>(null);\n\nfunction readBoard(root: HTMLElement): SnapCol[] {\n return Array.from(root.querySelectorAll<HTMLElement>('[data-board-col]')).map((col) => {\n const list = col.querySelector<HTMLElement>('.alt-board-list');\n const p = placeIn(col, root);\n const cards = list ? Array.from(list.querySelectorAll<HTMLElement>(':scope > [data-board-card]')).map((c) => {\n const q = placeIn(c, root);\n return { id: c.dataset.boardCard!, x: q.x, y: q.y, w: c.offsetWidth, h: c.offsetHeight };\n }) : [];\n return {\n id: col.dataset.boardCol!, title: col.getAttribute('aria-label') || col.dataset.boardCol!, x: p.x, w: col.offsetWidth,\n listTop: list ? placeIn(list, root).y : p.y, gap: list ? parseFloat(getComputedStyle(list).rowGap) || 8 : 8,\n collapsed: col.hasAttribute('data-collapsed'), count: Number(col.dataset.count) || 0, cards,\n };\n });\n}\n/** Where a card would land for a pointer at (cx, cy), and how every other card makes room for it. */\nfunction plan(cols: SnapCol[], id: string, cx: number, cy: number, h: number) {\n let ti = cols.findIndex((c) => cx >= c.x && cx <= c.x + c.w);\n if (ti < 0) ti = cols.reduce((best, c, i) => (Math.abs(c.x + c.w / 2 - cx) < Math.abs(cols[best].x + cols[best].w / 2 - cx) ? i : best), 0);\n const tc = cols[ti];\n const others = tc.cards.filter((c) => c.id !== id);\n const index = tc.collapsed ? tc.count : others.filter((c) => c.y + c.h / 2 < cy).length;\n const shifts: Record<string, number> = {};\n let slotTop = 0;\n for (const c of cols) {\n if (c.collapsed) continue;\n const order: (SnapCard | null)[] = c.cards.filter((k) => k.id !== id);\n if (c.id === tc.id) order.splice(index, 0, null);\n let y = c.listTop;\n for (const k of order) {\n if (!k) { slotTop = y - c.listTop; y += h + c.gap; } else { shifts[k.id] = y - k.y; y += k.h + c.gap; }\n }\n }\n return { to: { column: tc.id, index }, shifts, slotTop, gap: tc.gap };\n}\n\nexport interface BoardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Called when a card is dropped somewhere new (pointer), or moved a step (keyboard). Update your data; the board carries the cards. */\n onMove: (move: BoardMove) => void;\n /** Default \"Board\". */\n 'aria-label'?: string;\n}\n/**\n * Columns of cards. Columns are receptacles: flush at rest, they open into wells while a card is carried, and the one\n * under it deepens. Cards are raised; one picked up floats at level 3, tilted, follows the pointer, and lands with a settle.\n */\nexport const Board = React.forwardRef<HTMLDivElement, BoardProps>(function Board({ onMove, className, children, ...rest }, ref) {\n const root = React.useRef<HTMLDivElement>(null);\n React.useImperativeHandle(ref, () => root.current as HTMLDivElement);\n const hintId = React.useId();\n const [carry, setCarry] = React.useState<Carry | null>(null);\n const [kb, setKb] = React.useState<BoardCtxT['kb']>(null);\n const [landing, setLanding] = React.useState<string | null>(null);\n const [said, setSaid] = React.useState('');\n const start = React.useRef<{ x: number; y: number; id: string; cols?: SnapCol[]; from?: BoardPlace; card?: SnapCard } | null>(null);\n const dragged = React.useRef(false);\n useCarry(root, '[data-board-card]', 'data-board-card');\n React.useEffect(() => { if (!landing) return; const t = setTimeout(() => setLanding(null), 450); return () => clearTimeout(t); }, [landing]);\n\n const titleOf = (col: string) => root.current?.querySelector<HTMLElement>(`[data-board-col=\"${CSS.escape(col)}\"]`)?.getAttribute('aria-label') ?? col;\n const countOf = (col: string) => Number(root.current?.querySelector<HTMLElement>(`[data-board-col=\"${CSS.escape(col)}\"]`)?.dataset.count) || 0;\n const cardEl = (id: string) => root.current?.querySelector<HTMLElement>(`[data-board-card=\"${CSS.escape(id)}\"]`) ?? null;\n const nameOf = (id: string) => { const el = cardEl(id); return el?.dataset.label || el?.textContent?.trim().split('\\n')[0] || id; };\n const locate = (id: string): BoardPlace | null => {\n const el = cardEl(id), col = el?.closest<HTMLElement>('[data-board-col]');\n if (!el || !col) return null;\n return { column: col.dataset.boardCol!, index: Array.from(col.querySelectorAll('.alt-board-list > [data-board-card]')).indexOf(el) };\n };\n const refocus = (id: string) => requestAnimationFrame(() => cardEl(id)?.focus({ preventScroll: true }));\n\n const onPointerDown = (e: React.PointerEvent, id: string) => {\n if (e.button !== 0 || kb || (e.target as HTMLElement).closest('button, a, input, textarea, select, [contenteditable]')) return;\n if ((e.currentTarget as HTMLElement).hasAttribute('data-held-by')) return; // someone else has it\n start.current = { x: e.clientX, y: e.clientY, id };\n dragged.current = false;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n };\n const onPointerMove = (e: React.PointerEvent) => {\n const s = start.current;\n if (!s || !root.current) return;\n const dx = e.clientX - s.x, dy = e.clientY - s.y;\n if (!s.cols) {\n if (Math.hypot(dx, dy) < 5) return;\n s.cols = readBoard(root.current);\n for (const c of s.cols) { const i = c.cards.findIndex((k) => k.id === s.id); if (i >= 0) { s.from = { column: c.id, index: i }; s.card = c.cards[i]; } }\n if (!s.from) { start.current = null; return; }\n dragged.current = true;\n setSaid(`Picked up ${nameOf(s.id)}.`);\n }\n const k = s.card!;\n const p = plan(s.cols, s.id, k.x + k.w / 2 + dx, k.y + k.h / 2 + dy, k.h);\n setCarry({ id: s.id, from: s.from!, to: p.to, dx, dy, h: k.h, gap: p.gap, shifts: p.shifts, slotTop: p.slotTop });\n };\n const onPointerUp = () => {\n const s = start.current;\n start.current = null;\n if (!s?.cols || !carry || !root.current) { setCarry(null); return; }\n // Where each card was drawn when it was let go, so the landing travels from there.\n const m = new Map<string, { x: number; y: number }>();\n s.cols.forEach((c) => c.cards.forEach((k) => m.set(k.id, { x: k.x + (k.id === s.id ? carry.dx : 0), y: k.y + (k.id === s.id ? carry.dy : carry.shifts[k.id] ?? 0) })));\n dropSnapshots.set(root.current, m);\n const { from, to } = carry;\n setLanding(s.id);\n setCarry(null);\n const moved = from.column !== to.column || from.index !== to.index;\n if (moved) onMove({ cardId: s.id, from, to });\n const n = countOf(to.column) + (from.column !== to.column ? 1 : 0);\n setSaid(moved ? `Dropped ${nameOf(s.id)} in ${titleOf(to.column)}, position ${Math.min(to.index + 1, n)} of ${n}.` : `Dropped ${nameOf(s.id)} where it was.`);\n };\n const go = (id: string, from: BoardPlace, to: BoardPlace, origin: BoardPlace) => {\n onMove({ cardId: id, from, to });\n setKb({ id, origin, at: to });\n refocus(id);\n const n = countOf(to.column) + (from.column !== to.column ? 1 : 0);\n setSaid(`${titleOf(to.column)}, position ${to.index + 1} of ${n}.`);\n };\n const onKeyDown = (e: React.KeyboardEvent, id: string) => {\n if (e.target !== e.currentTarget) return;\n const at = locate(id);\n if (!at) return;\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n if (kb?.id === id) { setKb(null); setSaid(`Dropped ${nameOf(id)} in ${titleOf(at.column)}, position ${at.index + 1} of ${countOf(at.column)}.`); return; }\n const held = cardEl(id)?.dataset.heldBy;\n if (held) { setSaid(`${nameOf(id)} is held by ${held}.`); return; }\n setKb({ id, origin: at, at });\n setSaid(`Picked up ${nameOf(id)}. ${titleOf(at.column)}, position ${at.index + 1} of ${countOf(at.column)}. Use the arrow keys to move it, Space to drop it, Escape to cancel.`);\n return;\n }\n if (kb?.id !== id) return;\n const cols = Array.from(root.current!.querySelectorAll<HTMLElement>('[data-board-col]:not([data-collapsed])')).map((c) => c.dataset.boardCol!);\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n const to = Math.max(0, Math.min(countOf(at.column) - 1, at.index + (e.key === 'ArrowUp' ? -1 : 1)));\n if (to !== at.index) go(id, at, { column: at.column, index: to }, kb.origin);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n e.preventDefault();\n const next = cols[cols.indexOf(at.column) + (e.key === 'ArrowLeft' ? -1 : 1)];\n if (next) go(id, at, { column: next, index: Math.min(at.index, countOf(next)) }, kb.origin);\n } else if (e.key === 'Escape') {\n e.preventDefault(); e.stopPropagation();\n const o = kb.origin;\n if (o.column !== at.column || o.index !== at.index) { onMove({ cardId: id, from: at, to: o }); refocus(id); }\n setKb(null);\n setSaid(`Move cancelled. ${nameOf(id)} is back in ${titleOf(o.column)}, position ${o.index + 1}.`);\n }\n };\n // Focus leaving a card you're holding (not because it moved column) puts it down where it is.\n const onBlur = (id: string) => {\n if (kb?.id !== id) return;\n setTimeout(() => { if (!(document.activeElement as HTMLElement | null)?.matches?.(`[data-board-card=\"${CSS.escape(id)}\"]`)) setKb((x) => (x?.id === id ? null : x)); }, 80);\n };\n const swallowClick = () => { const d = dragged.current; dragged.current = false; return d; };\n const ctx: BoardCtxT = { carry, kb, landing, hintId, onPointerDown, onPointerMove, onPointerUp, onKeyDown, onBlur, swallowClick };\n return (\n <BoardCtx.Provider value={ctx}>\n <div ref={root} role=\"group\" aria-label={rest['aria-label'] ?? 'Board'} className={cx('alt-board', className)} data-carrying={carry || kb ? '' : undefined} {...rest}>\n {children}\n <span id={hintId} className=\"alt-sr\">Press Space to pick up. While holding a card, use the arrow keys to move it, Space to drop it, Escape to cancel.</span>\n <span className=\"alt-sr\" aria-live=\"assertive\">{said}</span>\n </div>\n </BoardCtx.Provider>\n );\n});\n\nexport interface BoardColumnProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {\n id: string;\n title: React.ReactNode;\n /** A collapsed column is a Pile: its thickness and count say how many cards it holds. It still takes drops. */\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Show the collapse button. */\n collapsible?: boolean;\n}\nexport function BoardColumn({ id, title, collapsed, defaultCollapsed = false, onCollapsedChange, collapsible, className, children, ...rest }: BoardColumnProps) {\n const ctx = React.useContext(BoardCtx);\n const [isCollapsed, setCollapsed] = useControllable(collapsed, defaultCollapsed, onCollapsedChange);\n const count = React.Children.toArray(children).filter(React.isValidElement).length;\n const label = typeof title === 'string' ? title : id;\n const carry = ctx?.carry;\n const over = carry ? carry.to.column === id : ctx?.kb?.at.column === id;\n const receiving = !!carry && carry.to.column === id && carry.from.column !== id && !isCollapsed;\n return (\n <section className={cx('alt-board-col', className)} data-board-col={id} data-count={count} aria-label={label}\n data-collapsed={isCollapsed ? '' : undefined} data-over={over ? '' : undefined} {...rest}>\n <header className=\"alt-board-head\">\n <h3 className=\"alt-board-title\">{title}</h3>\n <span className=\"alt-board-count\" aria-label={`${count} ${count === 1 ? 'card' : 'cards'}`}>{count}</span>\n {collapsible && (\n <Button variant=\"ghost\" size=\"sm\" square aria-expanded={!isCollapsed} aria-label={isCollapsed ? `Expand ${label}` : `Collapse ${label}`}\n className=\"alt-board-fold\" data-collapsed={isCollapsed ? '' : undefined} onClick={() => setCollapsed(!isCollapsed)}><Icons.ChevronDown /></Button>\n )}\n </header>\n {isCollapsed ? (\n <Pile count={Math.max(count, 1)} className=\"alt-board-pile\">\n <div className=\"alt-board-pile-face\"><b>{title}</b><span>{count ? `${count} ${count === 1 ? 'card' : 'cards'}` : 'No cards'}</span></div>\n </Pile>\n ) : (\n <div className=\"alt-board-list\" style={receiving ? { paddingBottom: carry!.h + carry!.gap } : undefined}>\n {carry && carry.to.column === id && <span className=\"alt-board-slot\" aria-hidden=\"true\" style={{ top: carry.slotTop, height: carry.h }} />}\n {children}\n {!count && !carry && <div className=\"alt-board-empty\">No cards</div>}\n </div>\n )}\n </section>\n );\n}\n\nexport interface BoardCardProps extends React.HTMLAttributes<HTMLDivElement> {\n id: string;\n /** How announcements name the card. Default: its first line of text. */\n label?: string;\n /** A collaborator is holding it: lifted, wearing their colour and name. It can't be picked up meanwhile. */\n heldBy?: { name: string; presence?: 1 | 2 | 3 };\n /** Afterglow: when this value changes the card arrives tinted and lifted, then settles. */\n settle?: unknown;\n}\nexport const BoardCard = React.forwardRef<HTMLDivElement, BoardCardProps>(function BoardCard({ id, label, heldBy, settle, className, style, onClickCapture, children, ...rest }, ref) {\n const ctx = React.useContext(BoardCtx);\n const depth = useDepth({ heldBy, settle });\n const carry = ctx?.carry;\n const following = carry?.id === id;\n const carried = following || ctx?.kb?.id === id;\n const shift = carry?.shifts[id];\n const transform = following ? `translate(${carry!.dx}px, ${carry!.dy}px)` : shift ? `translateY(${shift}px)` : undefined;\n return (\n <div ref={ref} className={cx('alt-board-card', className)} data-board-card={id} data-label={label} tabIndex={0} role=\"button\"\n aria-roledescription=\"draggable card\" aria-describedby={ctx?.hintId} aria-pressed={ctx?.kb?.id === id ? true : undefined}\n data-carried={carried ? '' : undefined} data-following={following ? '' : undefined} data-landing={ctx?.landing === id ? '' : undefined}\n {...depth} style={{ ...depth.style, ...style, ...(transform ? { transform } : null) }}\n onPointerDown={(e) => ctx?.onPointerDown(e, id)} onPointerMove={ctx?.onPointerMove} onPointerUp={ctx?.onPointerUp} onPointerCancel={ctx?.onPointerUp}\n onKeyDown={(e) => ctx?.onKeyDown(e, id)} onBlur={() => ctx?.onBlur(id)}\n onClickCapture={(e) => { if (ctx?.swallowClick()) { e.preventDefault(); e.stopPropagation(); } else onClickCapture?.(e); }} {...rest}>\n {children}\n </div>\n );\n});\n"],
5
+ "mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAGtB,IAAM,qBAAqB,OAAO,WAAW,cAAoB,kBAAkB;AAInF,IAAM,KAAK,IA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,oBAAkB,KAAK;AAAA,MAAQ,gBAAc,KAAK,IAAI,OAAO,KAAK,OAAO;AAAA,MAC/G,gBAAc,UAAU,KAAK;AAAA,MAAW,kBAAgB,YAAY,KAAK;AAAA,MAAW,gBAAc,KAAK,YAAY,KAAK,KAAK;AAAA,MAC5H,GAAG;AAAA,MAAO,OAAO,EAAE,GAAG,MAAM,OAAO,GAAG,OAAO,GAAI,YAAY,EAAE,UAAU,IAAI,KAAM;AAAA,MACpF,eAAe,CAAC,MAAM,KAAK,cAAc,GAAG,EAAE;AAAA,MAAG,eAAe,KAAK;AAAA,MAAe,aAAa,KAAK;AAAA,MAAa,iBAAiB,KAAK;AAAA,MACzI,WAAW,CAAC,MAAM,KAAK,UAAU,GAAG,EAAE;AAAA,MAAG,QAAQ,MAAM,KAAK,OAAO,EAAE;AAAA,MACrE,gBAAgB,CAAC,MAAM;AAAE,YAAI,KAAK,aAAa,GAAG;AAAE,YAAE,eAAe;AAAG,YAAE,gBAAgB;AAAA,QAAG,MAAO,kBAAiB,CAAC;AAAA,MAAG;AAAA,MAAI,GAAG;AAAA;AAAA,IAC/H;AAAA,EACH;AAEJ,CAAC;",
6
+ "names": ["move", "contrast", "Surface", "React", "Button", "Card", "Input", "Textarea", "Checkbox", "icon", "s", "React", "React", "React", "React", "EXIT_4", "React", "EXIT_5", "n", "React", "EXIT_3", "React", "Tick", "React", "icon", "React", "ms", "Table", "TableBody", "TableRow", "s", "cx", "Board", "k", "BoardCard"]
7
7
  }