@inkorange/space-ui 1.0.2 → 1.0.3
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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +174 -169
- package/dist/index.js.map +1 -1
- package/dist/space-ui.css +1 -1
- package/package.json +2 -7
- package/dist/spaceControls.cjs +0 -2
- package/dist/spaceControls.cjs.map +0 -1
- package/dist/spaceControls.js +0 -7
- package/dist/spaceControls.js.map +0 -1
- package/dist/spaceControls.module-BO-7e9rP.js +0 -13
- package/dist/spaceControls.module-BO-7e9rP.js.map +0 -1
- package/dist/spaceControls.module-CBUgTEwi.cjs +0 -2
- package/dist/spaceControls.module-CBUgTEwi.cjs.map +0 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/components/propShared.ts","../src/components/Text.tsx","../src/components/Heading.tsx","../src/components/Link.tsx","../src/components/Flex.tsx","../src/components/Box.tsx","../src/components/Grid.tsx","../src/components/Badge.tsx","../src/components/Separator.tsx","../src/components/Card.tsx","../src/components/ScrollArea.tsx","../src/internal/seededRandom.ts","../src/components/Button.tsx","../src/components/Loader.tsx","../src/components/Tooltip.tsx","../src/components/IconToggle.tsx","../src/components/Select.tsx","../src/components/TextField.tsx","../src/components/TextArea.tsx","../src/components/Slider.tsx","../src/components/RadioGroup.tsx","../src/components/Progress.tsx","../src/components/icons.tsx","../src/components/Dialog.tsx","../src/components/AlertDialog.tsx","../src/components/DropdownMenu.tsx","../src/components/Tabs.tsx"],"sourcesContent":["// Shared prop plumbing for the design-system primitives. The spacing map is\n// the single place Radix's numeric steps meet our t-shirt tokens; \"3\" (12px)\n// rounds UP to md per the spec's when-in-doubt-go-up rule.\nimport type { CSSProperties } from \"react\";\n\nexport type SpaceStep = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n\nexport interface SpacingProps {\n m?: SpaceStep;\n mt?: SpaceStep;\n mb?: SpaceStep;\n p?: SpaceStep;\n pb?: SpaceStep;\n}\n\nconst SPACE: Record<SpaceStep, string> = {\n \"0\": \"0\",\n \"1\": \"var(--spacing-xs)\",\n \"2\": \"var(--spacing-sm)\",\n \"3\": \"var(--spacing-md)\",\n \"4\": \"var(--spacing-md)\",\n \"5\": \"var(--spacing-lg)\",\n \"6\": \"var(--spacing-xl)\",\n};\n\nexport function spacingStyle(\n { m, mt, mb, p, pb }: SpacingProps,\n style?: CSSProperties,\n): CSSProperties | undefined {\n const out: CSSProperties = {\n ...(m !== undefined && { margin: SPACE[m] }),\n ...(mt !== undefined && { marginTop: SPACE[mt] }),\n ...(mb !== undefined && { marginBottom: SPACE[mb] }),\n ...(p !== undefined && { padding: SPACE[p] }),\n ...(pb !== undefined && { paddingBottom: SPACE[pb] }),\n ...style,\n };\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\nexport function cx(...parts: Array<string | false | undefined>): string {\n return parts.filter(Boolean).join(\" \");\n}\n","import type * as React from \"react\";\nimport { createElement, forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Text.module.scss\";\n\nexport interface TextProps\n extends SpacingProps,\n Omit<React.HTMLAttributes<HTMLElement>, \"color\"> {\n /** Element to render. Default `span`. Use `p` for prose and `label`\n * (with `htmlFor`) for form labels — size is presentational, so the\n * element stays free to be the semantically correct one. */\n as?: \"span\" | \"div\" | \"p\" | \"label\";\n /** Font size step: 1=12px, 2=14px, 3=16px, 4=18px, 5=20px, 6=24px.\n * Line height and letter spacing move with it. Omit to inherit. */\n size?: \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n /** 500 or 700. Omit for the inherited weight. */\n weight?: \"medium\" | \"bold\";\n /** Semantic colour role. `gray` is the standard secondary-text token;\n * the rest carry meaning, so avoid them for emphasis alone. Omit for\n * primary text. */\n /** Semantic colour role. `muted` is the standard secondary-text token;\n * the rest carry meaning, so avoid them for emphasis alone. Omit for\n * primary text. */\n color?: \"muted\" | \"danger\" | \"success\" | \"warning\";\n /** Id of the control this labels. Only meaningful with `as=\"label\"`. */\n htmlFor?: string;\n /** The text. */\n children?: ReactNode;\n}\n\n/**\n * Body copy. Size, weight and colour are presentational and independent of\n * the element, so `as` stays free to be whatever the document actually needs\n * — a `p` for prose, a `label` for a field, a `span` inline.\n *\n * Colour is a role, not a hue: use `muted` for secondary copy and reserve the\n * status roles for text that genuinely carries that meaning.\n */\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(\n { as = \"span\", size, weight, color, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return createElement(as, {\n ...rest,\n ref,\n className: cx(\n styles.text,\n size && styles[`size${size}`],\n weight && styles[weight],\n color && styles[`color${color[0].toUpperCase()}${color.slice(1)}`],\n className,\n ),\n style: spacingStyle({ m, mt, mb, p, pb }, style),\n });\n});\n","import type * as React from \"react\";\nimport { createElement, forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Heading.module.scss\";\n\nexport interface HeadingProps\n extends SpacingProps,\n Omit<React.HTMLAttributes<HTMLHeadingElement>, \"color\"> {\n /** Heading level to render. Default `h2`. Independent of `size`, so\n * document outline stays correct without dictating appearance. */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n /** Font size step: 4=18px, 5=20px, 6=24px, 7=28px, 8=35px, 9=60px.\n * Shares steps 4–6 with Text, so a Heading and Text can sit on the\n * same line and match. */\n size?: \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\";\n /** Semantic colour role. Omit for primary heading colour. */\n color?: \"muted\" | \"danger\";\n /** Centres the text. There is no `left`/`right` — headings are\n * start-aligned unless deliberately centred. */\n align?: \"center\";\n /** The heading text. */\n children?: ReactNode;\n}\n\n/**\n * A section heading. `as` sets the heading level and `size` sets the\n * appearance, deliberately apart — so a visually small heading can still be\n * an h2 where the document structure calls for one.\n *\n * Shares size steps 4-6 with Text, so a heading and body copy on the same\n * line align.\n */\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { as = \"h2\", size, color, align, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return createElement(as, {\n ...rest,\n ref,\n className: cx(\n styles.heading,\n size && styles[`size${size}`],\n color === \"muted\" && styles.colorMuted,\n color === \"danger\" && styles.colorDanger,\n align === \"center\" && styles.alignCenter,\n className,\n ),\n style: spacingStyle({ m, mt, mb, p, pb }, style),\n });\n});\n","import type * as React from \"react\";\nimport { cloneElement, forwardRef, isValidElement, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Link.module.scss\";\n\nexport interface LinkProps\n extends SpacingProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\"> {\n /** Render the single child element instead of an `<a>`, merging link\n * styling onto it. For wrapping a router's own Link component without\n * nesting two anchors. */\n asChild?: boolean;\n /** Font size step: 1=12px, 2=14px, 3=16px. Matches Text's first three\n * steps so inline links sit flush with surrounding copy. */\n size?: \"1\" | \"2\" | \"3\";\n /** Link text. With `asChild`, the single element to style as a link. */\n children?: ReactNode;\n}\n\n/**\n * An inline anchor, styled to sit inside running text without disturbing its\n * rhythm. Sizes match Text's first three steps.\n *\n * Use `asChild` to wrap a router's own link component rather than nesting two\n * anchors, which is invalid and breaks keyboard navigation.\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { asChild, size, className, style, m, mt, mb, p, pb, children, ...rest },\n ref,\n) {\n const cls = cx(styles.link, size && styles[`size${size}`], className);\n const merged = spacingStyle({ m, mt, mb, p, pb }, style);\n if (asChild && isValidElement(children)) {\n const child = children as React.ReactElement<{ className?: string; style?: React.CSSProperties }>;\n return cloneElement(child, {\n ...rest,\n className: cx(cls, child.props.className),\n style: { ...merged, ...child.props.style },\n });\n }\n return (\n <a {...rest} ref={ref} className={cls} style={merged}>\n {children}\n </a>\n );\n});\n","import type * as React from \"react\";\nimport { cloneElement, forwardRef, isValidElement, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Flex.module.scss\";\n\nexport interface FlexProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** Render the single child element instead of a wrapper div, merging\n * the flex styling onto it. Avoids a redundant layer in the DOM. */\n asChild?: boolean;\n /** Gap step: 1=4px, 2=8px, 3=12px, 4=16px, 5=24px, 6=32px. Note step 3\n * is 12px — off the 8pt grid, kept for parity with the shipped app. */\n gap?: \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n /** Main axis. Default `row`. */\n direction?: \"row\" | \"column\";\n /** Cross-axis alignment (`align-items`). */\n align?: \"start\" | \"center\" | \"end\" | \"baseline\" | \"stretch\";\n /** Main-axis distribution (`justify-content`). */\n justify?: \"start\" | \"center\" | \"end\" | \"between\";\n /** Wrapping behaviour. Default is the browser's `nowrap`. */\n wrap?: \"wrap\" | \"nowrap\";\n /** The items to lay out. */\n children?: ReactNode;\n}\n\nconst cap = (s: string) => s[0].toUpperCase() + s.slice(1);\n\n/**\n * A flex row or column whose gap comes from the spacing scale, so layouts\n * inherit the 8pt grid instead of restating it in pixels.\n *\n * `asChild` merges the layout onto its only child rather than adding a\n * wrapper, for when an extra div would break a grid or a selector.\n */\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(function Flex(\n { asChild, gap, direction, align, justify, wrap, className, style, m, mt, mb, p, pb, children, ...rest },\n ref,\n) {\n const cls = cx(\n styles.flex,\n gap && styles[`gap${gap}`],\n direction && styles[`direction${cap(direction)}`],\n align && styles[`align${cap(align)}`],\n justify && styles[`justify${cap(justify)}`],\n wrap && styles[`wrap${cap(wrap)}`],\n className,\n );\n const merged = spacingStyle({ m, mt, mb, p, pb }, style);\n if (asChild && isValidElement(children)) {\n const child = children as React.ReactElement<{ className?: string; style?: React.CSSProperties }>;\n return cloneElement(child, {\n ...rest,\n className: cx(cls, child.props.className),\n style: { ...merged, ...child.props.style },\n });\n }\n return (\n <div {...rest} ref={ref} className={cls} style={merged}>\n {children}\n </div>\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { spacingStyle, type SpacingProps } from \"./propShared\";\n\nexport interface BoxProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** Anything. Box adds no styling of its own. */\n children?: ReactNode;\n}\n\n// Radix Box at our call sites is a plain div carrying className/style/ref —\n// no layout props anywhere (verified by inventory). Keep it exactly that.\n\n/**\n * A plain div that understands the spacing scale. The escape hatch for when\n * you need margin or padding on the grid but no layout behaviour with it.\n *\n * Renders nothing of its own — no class, no styling — so it never interferes\n * with whatever you put inside.\n */\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(function Box(\n { style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return <div {...rest} ref={ref} style={spacingStyle({ m, mt, mb, p, pb }, style)} />;\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Grid.module.scss\";\n\ntype Cols = \"1\" | \"2\" | \"3\";\nexport interface GridProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** Column count, 1–3. Pass an object for responsive counts:\n * `{ initial: \"1\", sm: \"2\", md: \"3\" }` — `initial` applies below the\n * first breakpoint. */\n columns?: Cols | { initial?: Cols; sm?: Cols; md?: Cols };\n /** Gap step: 1=4px, 2=8px, 3=12px, 4=16px, 5=24px, 6=32px. Same scale\n * as Flex. */\n gap?: \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n /** The cells. */\n children?: ReactNode;\n}\n\n/**\n * A simple column grid, 1-3 wide, with the same gap scale as Flex. Pass an\n * object to `columns` for responsive counts.\n *\n * Deliberately narrow: anything more elaborate is a job for CSS grid directly\n * rather than a prop API that would end up reinventing it.\n */\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(\n { columns, gap, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n const colCls =\n typeof columns === \"string\"\n ? [styles[`cols${columns}`]]\n : columns\n ? [\n columns.initial && styles[`cols${columns.initial}`],\n columns.sm && styles[`smCols${columns.sm}`],\n columns.md && styles[`mdCols${columns.md}`],\n ]\n : [];\n return (\n <div\n {...rest}\n ref={ref}\n className={cx(styles.grid, ...(colCls as string[]), gap && styles[`gap${gap}`], className)}\n style={spacingStyle({ m, mt, mb, p, pb }, style)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Badge.module.scss\";\n\n/**\n * Roles whose colour carries meaning — status and emphasis.\n */\nexport type BadgeSemanticColor =\n | \"muted\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\n/**\n * Categorical hues for telling data apart — star classes, planet types — where\n * the colour distinguishes rather than signals. These deliberately keep hue\n * names: for a categorical scale the hue IS the identity, and calling one\n * \"tertiary\" would imply a ranking that does not exist.\n */\nexport type BadgeCategoricalColor =\n | \"cyan\"\n | \"purple\"\n | \"orange\"\n | \"yellow\"\n | \"accent\";\n\nexport type BadgeColor = BadgeSemanticColor | BadgeCategoricalColor;\n\nexport interface BadgeProps\n extends SpacingProps,\n Omit<React.HTMLAttributes<HTMLSpanElement>, \"color\"> {\n /** Semantic role or categorical hue. Roles carry meaning — pick one\n * that matches the state, not the look you want.\n */\n color?: BadgeColor;\n /** `soft` is a tinted wash for dense lists; `solid` is a filled chip\n * for a badge that must win attention.\n */\n variant?: \"soft\" | \"solid\";\n /** 1 is the default chip; 2 is for standalone use away from body text. */\n size?: \"1\" | \"2\";\n /** Badges are single-line by default (Radix parity). Long free-text\n * content — e.g. user-named star systems on planet cards — opts into\n * wrapping so it can't overflow its card. */\n wrap?: boolean;\n /** Label text. Keep it short — a badge that wraps stops reading as one. */\n children?: ReactNode;\n}\n\nconst cap = (s: string) => s[0].toUpperCase() + s.slice(1);\n\n// Default color is \"blue\" (not \"gray\") to match Radix's behavior: Badge's\n// `color` prop had no hardcoded default there either — it inherited the\n// surrounding Theme's `accentColor`, which this app sets to \"blue\" (see the\n// single <Theme accentColor> in the host app). A caller that wants a\n// neutral badge should pass color=\"muted\" explicitly.\n/**\n * A compact status label. Colour is the message, so choose it for meaning:\n * the semantic roles say safe, pending or destructive, while the categorical\n * hues only tell one kind of thing from another and carry no judgement.\n *\n * Single-line by default, since a badge that wraps stops reading as a badge.\n * Opt into `wrap` for free text you do not control.\n */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { color = \"primary\", variant = \"soft\", size = \"1\", wrap, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return (\n <span\n {...rest}\n ref={ref}\n className={cx(\n styles.badge,\n styles[`color${cap(color)}`],\n variant === \"solid\" && styles.solid,\n styles[`size${size}`],\n wrap && styles.wrap,\n className,\n )}\n style={spacingStyle({ m, mt, mb, p, pb }, style)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Separator.module.scss\";\n\nexport interface SeparatorProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Length of the rule, 1 (shortest) to 4 (full width of its container). */\n size?: \"1\" | \"2\" | \"3\" | \"4\";\n}\n\n/**\n * A hairline rule for dividing content within a surface, where a full panel\n * boundary would be too heavy. Exposed as `role=\"separator\"`, so assistive\n * technology hears the division too.\n */\nexport const Separator = forwardRef<HTMLSpanElement, SeparatorProps>(function Separator(\n { size = \"4\", className, ...rest },\n ref,\n) {\n return (\n <span\n {...rest}\n ref={ref}\n role=\"separator\"\n className={cx(styles.separator, size === \"4\" && styles.full, className)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Card.module.scss\";\n\nexport interface CardProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** The card's contents. */\n children?: ReactNode;\n}\n\n/**\n * A translucent panel for grouping related content, one step above the page\n * surface. Its 12px inset is a deliberate exception to the 8pt grid, kept for\n * parity with the app this was extracted from.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return (\n <div\n {...rest}\n ref={ref}\n className={cx(styles.card, className)}\n style={spacingStyle({ m, mt, mb, p, pb }, style)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./ScrollArea.module.scss\";\n\n// Plain overflow container. ConfigurationPanel's scrollViewport() helper\n// queries [data-radix-scroll-area-viewport] and falls back to the element\n// itself — with this component the ref IS the viewport, so the fallback path\n// serves it (verified before migration).\nexport interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The scrollable content. */\n children?: ReactNode;\n}\n\n/**\n * A region that scrolls independently of the page, with the scrollbar styled\n * to match the dark surface rather than the browser default.\n *\n * Needs a bounded height from its parent or its context — without one there\n * is nothing to scroll against.\n */\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(function ScrollArea(\n { className, ...rest },\n ref,\n) {\n return <div {...rest} ref={ref} className={cx(styles.scrollArea, className)} />;\n});\n","/** Deterministic RNG + string hash, vendored from the source application (the only\n * consumer inside the library is SpaceButton's star speckle). Pure,\n * dependency-free, and part of no public API. */\nexport function mulberry32(a: number): () => number {\n return function () {\n a |= 0;\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** FNV-1a 32-bit string hash, for turning stable strings into seeds. */\nexport function hashString(s: string): number {\n let h = 0x811c9dc5;\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return h >>> 0;\n}\n","\"use client\";\n\nimport { forwardRef, useId, useMemo } from \"react\";\nimport styles from \"./Button.module.scss\";\nimport { mulberry32, hashString } from \"../internal/seededRandom\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Circular, icon-only sizing (e.g. the share glyph). */\n iconOnly?: boolean;\n /** Warm red-dwarf rim for destructive-ish actions (e.g. Clear). */\n ember?: boolean;\n /** md = default. lg = hero CTAs. sm = compact dialog actions. micro = tiny steppers (no stars/glint). */\n size?: \"sm\" | \"md\" | \"lg\" | \"micro\";\n /** Stretch to the container width (sticky footers). */\n fullWidth?: boolean;\n /** Ambient motion: the orbiting rim, the glint sweep, and the twinkling\n * stars. Set false for dense UI or long lists where the movement\n * distracts. The glass look itself is not optional. Default true. */\n animated?: boolean;\n}\n\n\n/**\n * \"Limb-lit glass\" button: cosmic glass capsule whose rim glows like a planet's\n * sunlit atmosphere limb, with twinkling stars inside and a periodic glint\n * sweep. Plain <button>, so it composes with Radix Dialog.Trigger (Slot).\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button({ iconOnly, ember, size = \"md\", fullWidth, animated = true, className, children, ...rest }, ref) {\n const id = useId();\n\n // Unique-per-instance star field: positions and timing vary button to\n // button so the sparkles don't read as a repeated stamp.\n const starStyles = useMemo(() => {\n // Deterministic PRNG seeded from useId, so each button instance gets its\n // own star arrangement while server and client render identically (no\n // hydration mismatch, unlike Math.random in render).\n const rand = mulberry32(hashString(id));\n return Array.from({ length: 3 }, () => ({\n top: `${12 + rand() * 58}%`,\n left: `${8 + rand() * 80}%`,\n animationDelay: `${(rand() * 3.2).toFixed(2)}s`,\n animationDuration: `${(2.8 + rand() * 1.8).toFixed(2)}s`,\n }));\n }, [id]);\n\n const classes = [\n styles.spaceButton,\n iconOnly ? styles.iconOnly : \"\",\n ember ? styles.ember : \"\",\n size !== \"md\" ? styles[size] : \"\",\n fullWidth ? styles.fullWidth : \"\",\n className ?? \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <button\n ref={ref}\n className={classes}\n data-animated={animated ? undefined : \"false\"}\n {...rest}\n >\n {size !== \"micro\" && (\n <span className={styles.stars} aria-hidden>\n {starStyles.map((style, i) => (\n <i key={i} className={styles.star} style={style} />\n ))}\n </span>\n )}\n <span className={styles.label}>{children}</span>\n </button>\n );\n }\n);\n","\"use client\";\n\nimport { cx } from \"./propShared\";\nimport styles from \"./Loader.module.scss\";\n\nexport interface LoaderProps {\n /** sm = inline/compact spots. md = default. lg = full-panel takeovers. */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Visible caption under the spinner; also doubles as the accessible name. */\n label?: string;\n /** Merged onto the wrapper. */\n className?: string;\n}\n\n/**\n * Orbital spinner: a small pulsing \"planet\" disc at the center of a static\n * ring, with a \"moon\" dot traveling the ring. Dependency-free CSS animation\n * so it composes cleanly wherever a lazy chunk or async panel needs a\n * space-themed loading state (see SurfaceView's dynamic-import loader).\n */\nexport function Loader({ size = \"md\", label, className }: LoaderProps) {\n return (\n <div\n className={cx(styles.wrap, styles[size], className)}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={label ?? \"Loading\"}\n >\n <span className={styles.orbit}>\n <span className={styles.planet} />\n <span className={styles.moon} />\n </span>\n {label && <span className={styles.label}>{label}</span>}\n </div>\n );\n}\n","\"use client\";\n\n// Generic hover/focus tooltip for icon-only controls. Built on the same\n// native popover=\"auto\" top-layer pattern as ElementTooltip (and\n// DropdownMenu) rather than a library: Radix is gone from this app, and the\n// platform gives Escape/click-outside dismissal and top-layer stacking for\n// free — which matters here because these triggers sit over WebGL canvases\n// and inside their own stacking contexts.\n//\n// Deliberately NOT the native `title` attribute, which these controls used\n// before: the browser's own tooltip waits about a second, cannot be styled\n// to match the app, and never appears for keyboard users at all.\n\nimport {\n cloneElement, isValidElement, useEffect, useId, useLayoutEffect, useRef, useState,\n} from \"react\";\nimport styles from \"./Tooltip.module.scss\";\n\ninterface TooltipProps {\n /** The text to show. Nothing renders when this is empty. */\n label: string;\n /** Preferred side; flips automatically when there isn't room. */\n side?: \"top\" | \"bottom\";\n /** The element the tooltip describes. Receives the hover and focus\n * handlers, so it must accept a ref. */\n children: React.ReactElement;\n}\n\nconst SHOW_DELAY = 350;\nconst HIDE_DELAY = 80;\nconst SIDE_OFFSET = 8;\nconst COLLISION_PADDING = 8;\n\n// The clone lives in its own component so this scope never dereferences\n// triggerRef itself — the React Compiler flags a ref that is BOTH passed\n// into cloneElement's props and read in the same scope. Same split, and the\n// same reason, as ElementTooltip's TooltipTrigger.\ninterface TriggerProps {\n triggerRef: React.RefObject<HTMLElement | null>;\n tooltipId: string;\n show: (immediate?: boolean) => void;\n hide: () => void;\n children: React.ReactElement<Record<string, unknown>>;\n}\nfunction TooltipTrigger({ triggerRef, tooltipId, show, hide, children }: TriggerProps) {\n const p = children.props;\n return cloneElement(children, {\n ref: triggerRef,\n // Always present, so the id it points at never dangles: the content\n // element stays mounted and only toggles its popover state.\n \"aria-describedby\": tooltipId,\n onPointerEnter: (e: React.PointerEvent) => {\n (p.onPointerEnter as ((e: React.PointerEvent) => void) | undefined)?.(e);\n // Mouse only. A touch \"hover\" fires on tap, which would pop a tooltip\n // over the very control the user just pressed.\n if (e.pointerType === \"mouse\") show();\n },\n onPointerLeave: (e: React.PointerEvent) => {\n (p.onPointerLeave as ((e: React.PointerEvent) => void) | undefined)?.(e);\n hide();\n },\n // Keyboard focus shows it immediately — no hover delay to wait out.\n onFocus: (e: React.FocusEvent) => {\n (p.onFocus as ((e: React.FocusEvent) => void) | undefined)?.(e);\n show(true);\n },\n onBlur: (e: React.FocusEvent) => {\n (p.onBlur as ((e: React.FocusEvent) => void) | undefined)?.(e);\n hide();\n },\n // A tooltip must never outlive the action it describes: clicking the\n // control (expand, switch view) leaves it stranded over the new layout.\n onClick: (e: React.MouseEvent) => {\n (p.onClick as ((e: React.MouseEvent) => void) | undefined)?.(e);\n hide();\n },\n });\n}\n\n/**\n * A short label revealed on hover or focus, for naming a control whose icon\n * is not self-evident.\n *\n * Never put information here that a reader needs: a tooltip is unreachable on\n * touch and easy to miss. If it must be read, put it on the page.\n */\nexport function Tooltip({ label, side = \"bottom\", children }: TooltipProps) {\n const tooltipId = useId();\n const [open, setOpen] = useState(false);\n const [pos, setPos] = useState<{ top: number; left: number } | null>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const showTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearTimers = () => {\n if (showTimer.current) { clearTimeout(showTimer.current); showTimer.current = null; }\n if (hideTimer.current) { clearTimeout(hideTimer.current); hideTimer.current = null; }\n };\n const show = (immediate = false) => {\n clearTimers();\n if (immediate) { setOpen(true); return; }\n showTimer.current = setTimeout(() => setOpen(true), SHOW_DELAY);\n };\n const hide = () => {\n clearTimers();\n hideTimer.current = setTimeout(() => setOpen(false), HIDE_DELAY);\n };\n\n useEffect(() => clearTimers, []);\n\n useLayoutEffect(() => {\n const content = contentRef.current;\n if (!content) return;\n if (!open) {\n if (content.matches(\":popover-open\")) content.hidePopover();\n return;\n }\n // Show before measuring: while display:none the offset sizes read 0 and\n // every clamp below would be computed against nothing.\n if (!content.matches(\":popover-open\")) content.showPopover();\n const trigger = triggerRef.current;\n if (!trigger) return;\n const r = trigger.getBoundingClientRect();\n const w = content.offsetWidth;\n const h = content.offsetHeight;\n\n // Flip to the other side when the preferred one has no room — these\n // controls sit in both the top row and the bottom action bar.\n const below = r.bottom + SIDE_OFFSET;\n const above = r.top - h - SIDE_OFFSET;\n const fitsBelow = below + h <= window.innerHeight - COLLISION_PADDING;\n const fitsAbove = above >= COLLISION_PADDING;\n const top = side === \"bottom\"\n ? (fitsBelow || !fitsAbove ? below : above)\n : (fitsAbove || !fitsBelow ? above : below);\n\n // Centred on the trigger, clamped inside the viewport.\n const left = Math.min(\n Math.max(r.left + r.width / 2 - w / 2, COLLISION_PADDING),\n Math.max(window.innerWidth - w - COLLISION_PADDING, COLLISION_PADDING),\n );\n setPos({ top, left });\n }, [open, side, label]);\n\n if (!label || !isValidElement(children)) return <>{children}</>;\n\n return (\n <>\n <TooltipTrigger\n triggerRef={triggerRef}\n tooltipId={tooltipId}\n show={show}\n hide={hide}\n >\n {children as React.ReactElement<Record<string, unknown>>}\n </TooltipTrigger>\n <div\n ref={contentRef}\n id={tooltipId}\n popover=\"auto\"\n role=\"tooltip\"\n className={styles.content}\n style={pos ? { top: pos.top, left: pos.left } : undefined}\n onToggle={(e: React.SyntheticEvent<HTMLDivElement>) => {\n if ((e.nativeEvent as ToggleEvent).newState === \"closed\" && open) setOpen(false);\n }}\n >\n {label}\n </div>\n </>\n );\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Tooltip } from \"./Tooltip\";\nimport styles from \"./IconToggle.module.scss\";\n\nexport interface IconToggleOption<V extends string> {\n value: V;\n icon: ReactNode;\n /** Used for aria-label and the hover tooltip. */\n label: string;\n}\n\n/**\n * A segmented icon toggle: every option is always visible in one pill, the\n * selected one reads as active, clicking any option selects it. Built for the\n * scene view switcher (planet / orrery / surface), where the old pattern —\n * showing only the views you are NOT on and swapping icons on click — made\n * the control's meaning flip under the cursor (owner: both icons should be\n * \"always visible, the selected one is the active one\"). Generic over the\n * option set so other icon-mode switchers can reuse it.\n */\nexport function IconToggle<V extends string>({\n options,\n value,\n onValueChange,\n className = \"\",\n}: {\n /** The segments, in display order. Every option is always visible —\n * this is a segmented control, not a menu.\n */\n options: IconToggleOption<V>[];\n /** The selected option's value. Fully controlled. */\n value: V;\n /** Called with the newly selected value. Not called when the already\n * selected option is clicked. */\n onValueChange(next: V): void;\n /** Merged onto the group wrapper. */\n className?: string;\n}) {\n return (\n <div className={`${styles.group} ${className}`} role=\"group\">\n {options.map((opt) => (\n // The pill sits at the top of the scene, so its tooltips hang below.\n <Tooltip key={opt.value} label={opt.label} side=\"bottom\">\n <button\n type=\"button\"\n className={`${styles.segment} ${opt.value === value ? styles.active : \"\"}`}\n aria-label={opt.label}\n aria-pressed={opt.value === value}\n onClick={() => {\n if (opt.value !== value) onValueChange(opt.value);\n }}\n >\n {opt.icon}\n </button>\n </Tooltip>\n ))}\n </div>\n );\n}\n","// src/components/ui/Select.tsx\n// Compound Select matching the Radix JSX shape used by all 16 app sites\n// (Root/Trigger/Content/Item; single-select; 100% controlled). Native\n// engine: <button> trigger + an always-mounted hidden listbox, absolutely\n// positioned under the trigger (every styled site used position=\"popper\";\n// no site is inside a ScrollArea, so no portal is needed — and skipping the\n// portal keeps in-dialog Selects inside the dialog's stacking context).\n\"use client\";\nimport type * as React from \"react\";\nimport {\n Children, createContext, isValidElement, useCallback, useContext,\n useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type ReactNode,\n} from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Select.module.scss\";\nimport ctl from \"../styles/spaceControls.module.scss\";\n\ninterface RootCtx {\n value: string;\n onValueChange: (v: string) => void;\n disabled?: boolean;\n open: boolean;\n setOpen: (o: boolean) => void;\n highlighted: string | null;\n setHighlighted: (v: string | null) => void;\n listboxId: string;\n values: string[];\n /** Every item's label, disabled included — used to size the trigger. */\n itemLabels: ReactNode[];\n labelFor: (v: string) => ReactNode;\n}\nconst Ctx = createContext<RootCtx | null>(null);\nconst useSelect = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"Select parts must be inside Select.Root\");\n return ctx;\n};\n\n// Shared id contract between the listbox's aria-activedescendant and each\n// Item's id. encodeURIComponent guards against values containing spaces or\n// other characters that aren't legal in an HTML id (every current call site\n// uses plain slugs/numbers, but this keeps the contract safe for any future\n// value).\nconst optionId = (listboxId: string, value: string) => `${listboxId}-${encodeURIComponent(value)}`;\n\n// The trigger ref travels through its own context, kept separate from\n// RootCtx above: a single context object mixing a ref field with plain\n// state fields makes every read of that object's OTHER fields look like a\n// render-time ref access to the react-hooks/refs lint rule, anywhere in the\n// component (not just the JSX using the ref) — this side-steps that.\nconst RefCtx = createContext<React.RefObject<HTMLButtonElement | null> | null>(null);\nconst useTriggerRef = () => {\n const ref = useContext(RefCtx);\n if (!ref) throw new Error(\"Select parts must be inside Select.Root\");\n return ref;\n};\n\n/** Pure render-time walk of <Content>'s children collecting Item values and\n * labels — no effects, so the trigger label is correct on first paint,\n * under SSR, and in renderToStaticMarkup tests. */\nfunction collectItems(children: ReactNode): Array<{ value: string; label: ReactNode; disabled?: boolean }> {\n const out: Array<{ value: string; label: ReactNode; disabled?: boolean }> = [];\n const walk = (nodes: ReactNode) => {\n Children.forEach(nodes, (child) => {\n if (!isValidElement(child)) return;\n const props = child.props as { value?: string; children?: ReactNode; disabled?: boolean };\n if (child.type === Item && typeof props.value === \"string\") {\n out.push({ value: props.value, label: props.children, disabled: props.disabled });\n } else if (props.children) {\n walk(props.children);\n }\n });\n };\n walk(children);\n return out;\n}\n\nexport interface RootProps {\n /** The selected item's value. Fully controlled. */\n value: string;\n /** Called with the newly selected value. */\n onValueChange: (v: string) => void;\n /** Blocks the trigger and removes it from the tab order. */\n disabled?: boolean;\n /** A Trigger and a Content. */\n children?: ReactNode;\n}\n\n/**\n * A single-choice menu for lists too long to show inline. Fully controlled.\n *\n * Reads its options at render time rather than through effects, so the\n * trigger shows the right label on first paint and under SSR.\n */\nexport function Root({ value, onValueChange, disabled, children }: RootProps) {\n const [open, setOpen] = useState(false);\n const [highlighted, setHighlighted] = useState<string | null>(null);\n const listboxId = useId();\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n // Find the <Content> child and index its items at render time.\n const contentChildren = useMemo(() => {\n let found: ReactNode = null;\n Children.forEach(children, (child) => {\n if (isValidElement(child) && child.type === Content) {\n found = (child.props as { children?: ReactNode }).children;\n }\n });\n return found;\n }, [children]);\n const items = useMemo(() => collectItems(contentChildren), [contentChildren]);\n const values = useMemo(() => items.filter((i) => !i.disabled).map((i) => i.value), [items]);\n const itemLabels = useMemo(() => items.map((i) => i.label), [items]);\n const labelFor = useCallback(\n (v: string) => items.find((i) => i.value === v)?.label ?? null,\n [items],\n );\n\n // Light-dismiss: click outside closes.\n useEffect(() => {\n if (!open) return;\n const onDown = (e: MouseEvent) => {\n if (rootRef.current && !rootRef.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener(\"mousedown\", onDown);\n return () => document.removeEventListener(\"mousedown\", onDown);\n }, [open]);\n\n return (\n <Ctx.Provider\n value={{ value, onValueChange, disabled, open, setOpen, highlighted, setHighlighted, listboxId, values, itemLabels, labelFor }}\n >\n <RefCtx.Provider value={triggerRef}>\n <div ref={rootRef} className={styles.root}>\n {children}\n </div>\n </RefCtx.Provider>\n </Ctx.Provider>\n );\n}\n\nexport interface TriggerProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"value\"> {\n /** Shown when nothing is selected. Counts toward the trigger's width,\n * so selecting an option never resizes it.\n */\n placeholder?: string;\n /** Ambient motion: the lit arc orbiting the rim. The glass skin itself\n * is always applied. Default true. */\n animated?: boolean;\n}\n\n/**\n * The closed state of the Select, showing the selected item's own content.\n *\n * Sizes itself to its widest option, so it never changes width as you select\n * — capped by `--sp-select-trigger-max-width`, past which the label\n * ellipsizes.\n */\nexport function Trigger({ placeholder, animated = true, className, ...rest }: TriggerProps) {\n const s = useSelect();\n const triggerRef = useTriggerRef();\n const label = s.value ? s.labelFor(s.value) : null;\n const openWith = (highlight: string | null) => {\n s.setHighlighted(highlight ?? s.values[0] ?? null);\n s.setOpen(true);\n };\n return (\n <button\n type=\"button\"\n {...rest}\n ref={triggerRef}\n disabled={s.disabled}\n className={cx(styles.trigger, ctl.spaceControl, \"spSelectTrigger\", className)}\n data-animated={animated ? undefined : \"false\"}\n data-state={s.open ? \"open\" : \"closed\"}\n aria-haspopup=\"listbox\"\n aria-expanded={s.open}\n aria-controls={s.listboxId}\n onClick={() => (s.open ? s.setOpen(false) : openWith(s.value || null))}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n openWith(s.value || null);\n }\n }}\n >\n {/* The visible label and a hidden copy of every option share one grid\n cell, so the button is as wide as its widest choice and never jumps\n width when the selection changes. Capped by\n --sp-select-trigger-max-width, past which the label ellipsizes. */}\n <span className={styles.labelWrap}>\n <span className={styles.sizer} data-sizer=\"\" aria-hidden=\"true\">\n {s.itemLabels.map((l, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <span key={i}>{l}</span>\n ))}\n {placeholder && <span>{placeholder}</span>}\n </span>\n <span className={styles.triggerLabel}>{label ?? placeholder ?? \"\"}</span>\n </span>\n <svg className={styles.chevron} width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" aria-hidden=\"true\">\n <path d=\"M0.5 3 L4.5 7 L8.5 3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n </svg>\n </button>\n );\n}\n\nexport interface ContentProps {\n /** Merged with the panel's own classes. */\n className?: string;\n /** Accepted for Radix call-site compatibility (\"popper\" everywhere);\n * our listbox is always trigger-anchored. */\n position?: string;\n /** Ambient motion on the panel rim. Default true. */\n animated?: boolean;\n /** The Items. */\n children?: ReactNode;\n}\n\n/**\n * The option panel. Always mounted but hidden while closed, so the trigger\n * can read its labels for sizing.\n *\n * Never narrower than the trigger, and grows to fit the longest option so\n * labels only wrap when they truly must.\n */\nexport function Content({ className, position: _position, animated = true, children }: ContentProps) {\n const s = useSelect();\n const triggerRef = useTriggerRef();\n const listRef = useRef<HTMLDivElement | null>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n const [maxHeight, setMaxHeight] = useState<number | null>(null);\n\n // Measures the trigger's rendered width (and available vertical space\n // below it) to size the listbox. useLayoutEffect so the measurement is\n // applied before the browser paints the first open frame — a plain\n // useEffect flashes one frame with --_select-trigger-width unset.\n useLayoutEffect(() => {\n if (s.open && triggerRef.current) {\n const rect = triggerRef.current.getBoundingClientRect();\n setTriggerWidth(triggerRef.current.offsetWidth);\n // Clamp to the space between the trigger and the viewport bottom.\n // This is a partial mitigation, not a full fix: it keeps the listbox\n // from forcing extra scroll inside its own scrollable ancestor (e.g.\n // AuthModal's ~87-entry birth-year select), but a listbox inside a\n // dialog that's ALSO been scrolled can still have its trigger (and\n // thus this measurement) clipped by the dialog's own overflow before\n // this ever runs. Known QA follow-up on the birth-year select.\n const available = window.innerHeight - rect.bottom - 16;\n setMaxHeight(Math.min(380, Math.max(120, available)));\n }\n }, [s.open, triggerRef]);\n\n // Focus the listbox on open so arrow keys work immediately; return focus\n // to the trigger on close (checked against the in-dialog sites: Escape\n // must close the Select WITHOUT closing the surrounding Radix Dialog).\n useEffect(() => {\n if (s.open) listRef.current?.focus();\n }, [s.open]);\n\n const move = (delta: number) => {\n const idx = s.highlighted ? s.values.indexOf(s.highlighted) : -1;\n const next = Math.min(Math.max(idx + delta, 0), s.values.length - 1);\n s.setHighlighted(s.values[next] ?? null);\n };\n\n return (\n <div\n ref={listRef}\n id={s.listboxId}\n role=\"listbox\"\n tabIndex={-1}\n hidden={!s.open}\n aria-activedescendant={s.highlighted ? optionId(s.listboxId, s.highlighted) : undefined}\n className={cx(styles.listbox, ctl.spacePanel, className)}\n data-animated={animated ? undefined : \"false\"}\n style={\n triggerWidth != null || maxHeight != null\n ? ({\n ...(triggerWidth != null ? { \"--_select-trigger-width\": `${triggerWidth}px` } : {}),\n ...(maxHeight != null ? { maxHeight: `${maxHeight}px` } : {}),\n } as React.CSSProperties)\n : undefined\n }\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n e.stopPropagation(); // don't let an ancestor Dialog close too\n s.setOpen(false);\n triggerRef.current?.focus();\n } else if (e.key === \"ArrowDown\") { e.preventDefault(); move(1); }\n else if (e.key === \"ArrowUp\") { e.preventDefault(); move(-1); }\n else if (e.key === \"Home\") { e.preventDefault(); s.setHighlighted(s.values[0] ?? null); }\n else if (e.key === \"End\") { e.preventDefault(); s.setHighlighted(s.values[s.values.length - 1] ?? null); }\n else if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (s.highlighted) {\n s.onValueChange(s.highlighted);\n s.setOpen(false);\n triggerRef.current?.focus();\n }\n } else if (e.key === \"Tab\") {\n s.setOpen(false);\n }\n }}\n >\n {children}\n </div>\n );\n}\n\nexport interface ItemProps {\n /** Reported to onValueChange when chosen. */\n value: string;\n /** Skipped by keyboard navigation and not selectable. Still contributes\n * its width to the trigger's sizing. */\n disabled?: boolean;\n /** Shown in the panel and, once selected, in the trigger — so it has to\n * read correctly in both places. */\n children?: ReactNode;\n}\n\n/**\n * One option. Its children are what the trigger displays once selected, so\n * anything rendered here has to read correctly in both places.\n */\nexport function Item({ value, disabled, children }: ItemProps) {\n const s = useSelect();\n const triggerRef = useTriggerRef();\n const selected = s.value === value;\n const highlighted = s.highlighted === value;\n return (\n <div\n id={optionId(s.listboxId, value)}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={disabled || undefined}\n data-highlighted={highlighted ? \"\" : undefined}\n className={cx(styles.item, \"spSelectItem\")}\n onMouseEnter={() => !disabled && s.setHighlighted(value)}\n onClick={() => {\n if (disabled) return;\n s.onValueChange(value);\n s.setOpen(false);\n triggerRef.current?.focus();\n }}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\nimport type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./TextField.module.scss\";\nimport ctl from \"../styles/spaceControls.module.scss\";\n\nexport interface RootProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"className\" | \"style\"> {\n /** Merged onto the field wrapper, not the inner input. */\n className?: string;\n /** Ambient motion on the rim. The glass skin is always applied.\n * Default true. */\n animated?: boolean;\n /** Applied to the field wrapper — set width here. */\n style?: React.CSSProperties;\n /** Slots rendered inside the field, alongside the input. */\n children?: ReactNode; // Slot(s)\n}\n\n/**\n * Single-line text entry. Composed as a Root so slots can sit alongside the\n * input inside the same field surface.\n *\n * Props land on the inner input, so `value`, `onChange` and the rest behave\n * as they would on a bare input.\n */\nexport const Root = forwardRef<HTMLInputElement, RootProps>(function Root(\n { className, style, animated = true, children, ...inputProps },\n ref,\n) {\n return (\n <div\n className={cx(styles.root, ctl.spaceInput, \"spTextFieldRoot\", className)}\n data-animated={animated ? undefined : \"false\"}\n style={style}\n >\n {children}\n <input {...inputProps} ref={ref} className={cx(styles.input, \"spTextFieldInput\")} />\n </div>\n );\n});\n\n/**\n * A fixed element inside the field, before or after the input — an icon, a\n * unit, a short affordance. Sits within the field's surface rather than\n * beside it, and does not shrink as the input fills.\n */\nexport function Slot({\n children,\n}: {\n /** The slot's contents — an icon, a unit, a short affordance. */\n children?: ReactNode;\n}) {\n return <span className={styles.slot}>{children}</span>;\n}\n","\"use client\";\nimport type * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./TextArea.module.scss\";\nimport ctl from \"../styles/spaceControls.module.scss\";\n\nexport interface TextAreaProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"className\" | \"style\"> {\n /** Merged onto the field wrapper, not the inner textarea. */\n className?: string;\n /** Ambient motion on the rim. The glass skin is always applied.\n * Default true. */\n animated?: boolean;\n /** Applied to the field wrapper — set width here. */\n style?: React.CSSProperties;\n}\n\n/**\n * Multi-line text entry. `rows` sets the initial height; it grows with its\n * container's width and resizes vertically only, since horizontal drag would\n * break the surrounding layout.\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n { className, style, animated = true, ...rest },\n ref,\n) {\n return (\n <div\n className={cx(styles.root, ctl.spaceInput, ctl.spaceTextArea, \"spTextFieldRoot\", className)}\n data-animated={animated ? undefined : \"false\"}\n style={style}\n >\n <textarea {...rest} ref={ref} className={cx(styles.textarea, \"spTextAreaInput\")} />\n </div>\n );\n});\n","\"use client\";\nimport type * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Slider.module.scss\";\nimport ctl from \"../styles/spaceControls.module.scss\";\n\nexport interface SliderProps {\n /** Current value, as a single-element array. Fully controlled. */\n value: number[];\n /** Called with the new value array as the thumb moves. */\n onValueChange: (v: number[]) => void;\n /** Lower bound. */\n min: number;\n /** Upper bound. */\n max: number;\n /** Smallest increment the thumb can move by. */\n step: number;\n /** Blocks interaction and removes it from the tab order. */\n disabled?: boolean;\n /** Merged onto the wrapper. */\n className?: string;\n /** Accessible name. Required unless a visible label references it,\n * since a slider has no text of its own.\n */\n \"aria-label\"?: string;\n}\n\n/**\n * A range control for a continuous value.\n *\n * Takes and returns an array so multiple thumbs can be added later without a\n * breaking change, even though it renders one today.\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n { value, onValueChange, min, max, step, disabled, className, \"aria-label\": ariaLabel },\n ref,\n) {\n const v = value[0] ?? min;\n const pct = max === min ? 0 : ((v - min) / (max - min)) * 100;\n return (\n <span className={cx(styles.root, ctl.spaceSlider, className)} data-disabled={disabled || undefined}>\n <span className={cx(styles.track, \"spSliderTrack\")}>\n <span className={cx(styles.range, \"spSliderRange\")} style={{ width: `${pct}%` }} />\n </span>\n <span className={cx(styles.thumb, \"spSliderThumb\")} style={{ left: `${pct}%` }} />\n <input\n ref={ref}\n type=\"range\"\n className={cx(styles.input, \"spSliderInput\")}\n value={v}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n aria-label={ariaLabel}\n onChange={(e) => onValueChange([Number(e.target.value)])}\n />\n </span>\n );\n});\n","\"use client\";\nimport type * as React from \"react\";\nimport { createContext, useContext, useId, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./RadioGroup.module.scss\";\n\ninterface GroupCtx {\n value: string;\n onValueChange: (v: string) => void;\n disabled?: boolean;\n name: string;\n}\nconst Ctx = createContext<GroupCtx | null>(null);\n\nexport interface RootProps {\n /** The selected item's value. Fully controlled. */\n value: string;\n /** Called with the newly selected value. */\n onValueChange: (v: string) => void;\n /** Disables every item at once. */\n disabled?: boolean;\n /** Merged onto the group wrapper. */\n className?: string;\n /** The Items. */\n children?: ReactNode;\n}\n\n/**\n * A single-choice control for short lists, where seeing every option at once\n * matters more than saving space. Reach for Select when it does not.\n */\nexport function Root({ value, onValueChange, disabled, className, children }: RootProps) {\n const name = useId();\n return (\n <Ctx.Provider value={{ value, onValueChange, disabled, name }}>\n <div role=\"radiogroup\" className={cx(styles.root, className)}>\n {children}\n </div>\n </Ctx.Provider>\n );\n}\n\nexport interface ItemProps {\n /** Reported to the group's onValueChange when chosen. */\n value: string;\n /** Disables this option only. */\n disabled?: boolean;\n /** The option's label. Part of the click target, not merely beside it. */\n children?: ReactNode;\n}\n\n/** With children: self-labeling (<label> wraps input+orb+children) — the\n * SaveShareDialog pattern. Without children: emits a bare span so an\n * OUTER label (ConfigurationPanel's <Text as=\"label\">) owns association —\n * nesting labels would be invalid HTML. */\nexport function Item({ value, disabled, children }: ItemProps) {\n const g = useContext(Ctx);\n if (!g) throw new Error(\"RadioGroup.Item must be inside RadioGroup.Root\");\n const isDisabled = disabled || g.disabled;\n const control = (\n <>\n <input\n type=\"radio\"\n className={styles.input}\n name={g.name}\n value={value}\n checked={g.value === value}\n disabled={isDisabled}\n onChange={() => g.onValueChange(value)}\n />\n <span className={cx(styles.orb, \"spRadioOrb\")} aria-hidden=\"true\" />\n </>\n );\n if (children === undefined || children === null) {\n return <span className={styles.item}>{control}</span>;\n }\n return (\n <label className={cx(styles.item, styles.selfLabeled)}>\n {control}\n {children}\n </label>\n );\n}\n","\"use client\";\nimport type * as React from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Progress.module.scss\";\n\nexport interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Current progress, clamped between 0 and `max`. */\n value: number;\n /** The value representing complete. */\n max?: number;\n}\n\n/**\n * A determinate bar for work you can measure — use Loader when you cannot.\n *\n * Speaks the same visual language as Slider, because a progress bar and a\n * slider track are the same object: one you watch, one you drag.\n */\nexport function Progress({ value, max = 100, className, style, ...rest }: ProgressProps) {\n const pct = max > 0 ? Math.min(Math.max((value / max) * 100, 0), 100) : 0;\n return (\n <div\n {...rest}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n className={cx(styles.progress, className)}\n style={style}\n >\n {/* Unclassed on purpose: a consumer can target `.progress > div`\n without knowing the hashed module class. */}\n <div style={{ width: `${pct}%`, height: \"100%\" }} />\n </div>\n );\n}\n","// The 17 icons this app uses, ported verbatim from @radix-ui/react-icons\n// (MIT License — Copyright (c) 2022 WorkOS; https://github.com/radix-ui/icons).\n// Uniform 15x15 viewBox, currentColor, decorative by default (aria-hidden) —\n// pass aria-label + aria-hidden={undefined} for semantic uses.\nimport type * as React from \"react\";\n\nexport type IconProps = React.SVGAttributes<SVGSVGElement>;\n\nconst base = {\n width: 15,\n height: 15,\n viewBox: \"0 0 15 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": true,\n} as const;\n\nexport function Share2Icon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3.5 5.00006C3.22386 5.00006 3 5.22392 3 5.50006L3 11.5001C3 11.7762 3.22386 12.0001 3.5 12.0001L11.5 12.0001C11.7761 12.0001 12 11.7762 12 11.5001L12 5.50006C12 5.22392 11.7761 5.00006 11.5 5.00006L10.25 5.00006C9.97386 5.00006 9.75 4.7762 9.75 4.50006C9.75 4.22392 9.97386 4.00006 10.25 4.00006L11.5 4.00006C12.3284 4.00006 13 4.67163 13 5.50006L13 11.5001C13 12.3285 12.3284 13.0001 11.5 13.0001L3.5 13.0001C2.67157 13.0001 2 12.3285 2 11.5001L2 5.50006C2 4.67163 2.67157 4.00006 3.5 4.00006L4.75 4.00006C5.02614 4.00006 5.25 4.22392 5.25 4.50006C5.25 4.7762 5.02614 5.00006 4.75 5.00006L3.5 5.00006ZM7 1.6364L5.5682 3.0682C5.39246 3.24393 5.10754 3.24393 4.9318 3.0682C4.75607 2.89246 4.75607 2.60754 4.9318 2.4318L7.1818 0.181802C7.26619 0.09741 7.38065 0.049999 7.5 0.049999C7.61935 0.049999 7.73381 0.09741 7.8182 0.181802L10.0682 2.4318C10.2439 2.60754 10.2439 2.89246 10.0682 3.0682C9.89246 3.24393 9.60754 3.24393 9.4318 3.0682L8 1.6364L8 8.5C8 8.77614 7.77614 9 7.5 9C7.22386 9 7 8.77614 7 8.5L7 1.6364Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChatBubbleIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M12.5 3L2.5 3.00002C1.67157 3.00002 1 3.6716 1 4.50002V9.50003C1 10.3285 1.67157 11 2.5 11H7.50003C7.63264 11 7.75982 11.0527 7.85358 11.1465L10 13.2929V11.5C10 11.2239 10.2239 11 10.5 11H12.5C13.3284 11 14 10.3285 14 9.50003V4.5C14 3.67157 13.3284 3 12.5 3ZM2.49999 2.00002L12.5 2C13.8807 2 15 3.11929 15 4.5V9.50003C15 10.8807 13.8807 12 12.5 12H11V14.5C11 14.7022 10.8782 14.8845 10.6913 14.9619C10.5045 15.0393 10.2894 14.9965 10.1464 14.8536L7.29292 12H2.5C1.11929 12 0 10.8807 0 9.50003V4.50002C0 3.11931 1.11928 2.00003 2.49999 2.00002Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function Pencil1Icon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M11.8536 1.14645C11.6583 0.951184 11.3417 0.951184 11.1465 1.14645L3.71455 8.57836C3.62459 8.66832 3.55263 8.77461 3.50251 8.89155L2.04044 12.303C1.9599 12.491 2.00189 12.709 2.14646 12.8536C2.29103 12.9981 2.50905 13.0401 2.69697 12.9596L6.10847 11.4975C6.2254 11.4474 6.3317 11.3754 6.42166 11.2855L13.8536 3.85355C14.0488 3.65829 14.0488 3.34171 13.8536 3.14645L11.8536 1.14645ZM4.42166 9.28547L11.5 2.20711L12.7929 3.5L5.71455 10.5784L4.21924 11.2192L3.78081 10.7808L4.42166 9.28547Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function HeartFilledIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M1.35248 4.90532C1.35248 2.94498 2.936 1.35248 4.89346 1.35248C6.25769 1.35248 6.86058 1.92336 7.50002 2.93545C8.13946 1.92336 8.74235 1.35248 10.1066 1.35248C12.064 1.35248 13.6476 2.94498 13.6476 4.90532C13.6476 6.74041 12.6013 8.50508 11.4008 9.96927C10.2636 11.3562 8.92194 12.5508 8.00601 13.3664C7.94645 13.4194 7.88869 13.4709 7.83291 13.5206C7.64324 13.6899 7.3568 13.6899 7.16713 13.5206C7.11135 13.4709 7.05359 13.4194 6.99403 13.3664C6.0781 12.5508 4.73641 11.3562 3.59926 9.96927C2.39872 8.50508 1.35248 6.74041 1.35248 4.90532Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ExitFullScreenIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M5.5 2C5.77614 2 6 2.22386 6 2.5V5.5C6 5.77614 5.77614 6 5.5 6H2.5C2.22386 6 2 5.77614 2 5.5C2 5.22386 2.22386 5 2.5 5H5V2.5C5 2.22386 5.22386 2 5.5 2ZM9.5 2C9.77614 2 10 2.22386 10 2.5V5H12.5C12.7761 5 13 5.22386 13 5.5C13 5.77614 12.7761 6 12.5 6H9.5C9.22386 6 9 5.77614 9 5.5V2.5C9 2.22386 9.22386 2 9.5 2ZM2 9.5C2 9.22386 2.22386 9 2.5 9H5.5C5.77614 9 6 9.22386 6 9.5V12.5C6 12.7761 5.77614 13 5.5 13C5.22386 13 5 12.7761 5 12.5V10H2.5C2.22386 10 2 9.77614 2 9.5ZM9 9.5C9 9.22386 9.22386 9 9.5 9H12.5C12.7761 9 13 9.22386 13 9.5C13 9.77614 12.7761 10 12.5 10H10V12.5C10 12.7761 9.77614 13 9.5 13C9.22386 13 9 12.7761 9 12.5V9.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function EnterFullScreenIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M2 2.5C2 2.22386 2.22386 2 2.5 2H5.5C5.77614 2 6 2.22386 6 2.5C6 2.77614 5.77614 3 5.5 3H3V5.5C3 5.77614 2.77614 6 2.5 6C2.22386 6 2 5.77614 2 5.5V2.5ZM9 2.5C9 2.22386 9.22386 2 9.5 2H12.5C12.7761 2 13 2.22386 13 2.5V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3H9.5C9.22386 3 9 2.77614 9 2.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H2.5C2.22386 13 2 12.7761 2 12.5V9.5C2 9.22386 2.22386 9 2.5 9ZM12.5 9C12.7761 9 13 9.22386 13 9.5V12.5C13 12.7761 12.7761 13 12.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H12V9.5C12 9.22386 12.2239 9 12.5 9Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function TrashIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function QuestionMarkCircledIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function PersonIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M7.5 0.875C5.49797 0.875 3.875 2.49797 3.875 4.5C3.875 6.15288 4.98124 7.54738 6.49373 7.98351C5.2997 8.12901 4.27557 8.55134 3.50407 9.31167C2.52216 10.2794 2.02502 11.72 2.02502 13.5999C2.02502 13.8623 2.23769 14.0749 2.50002 14.0749C2.76236 14.0749 2.97502 13.8623 2.97502 13.5999C2.97502 11.8799 3.42786 10.7206 4.17091 9.9883C4.91536 9.25463 6.02674 8.87499 7.49995 8.87499C8.97317 8.87499 10.0846 9.25463 10.8291 9.98831C11.5721 10.7206 12.025 11.8799 12.025 13.5999C12.025 13.8623 12.2376 14.0749 12.5 14.0749C12.7623 14.075 12.975 13.8623 12.975 13.6C12.975 11.72 12.4778 10.2794 11.4959 9.31166C10.7244 8.55135 9.70025 8.12903 8.50625 7.98352C10.0187 7.5474 11.125 6.15289 11.125 4.5C11.125 2.49797 9.50203 0.875 7.5 0.875ZM4.825 4.5C4.825 3.02264 6.02264 1.825 7.5 1.825C8.97736 1.825 10.175 3.02264 10.175 4.5C10.175 5.97736 8.97736 7.175 7.5 7.175C6.02264 7.175 4.825 5.97736 4.825 4.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function MinusIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function MagnifyingGlassIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function HeartIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M4.89346 2.35248C3.49195 2.35248 2.35248 3.49359 2.35248 4.90532C2.35248 6.38164 3.20954 7.9168 4.37255 9.33522C5.39396 10.581 6.59464 11.6702 7.50002 12.4778C8.4054 11.6702 9.60608 10.581 10.6275 9.33522C11.7905 7.9168 12.6476 6.38164 12.6476 4.90532C12.6476 3.49359 11.5081 2.35248 10.1066 2.35248C9.27059 2.35248 8.81894 2.64323 8.5397 2.95843C8.27877 3.25295 8.14623 3.58566 8.02501 3.88993C8.00391 3.9429 7.98315 3.99501 7.96211 4.04591C7.88482 4.23294 7.7024 4.35494 7.50002 4.35494C7.29765 4.35494 7.11523 4.23295 7.03793 4.04592C7.01689 3.99501 6.99612 3.94289 6.97502 3.8899C6.8538 3.58564 6.72126 3.25294 6.46034 2.95843C6.18109 2.64323 5.72945 2.35248 4.89346 2.35248ZM1.35248 4.90532C1.35248 2.94498 2.936 1.35248 4.89346 1.35248C6.0084 1.35248 6.73504 1.76049 7.20884 2.2953C7.32062 2.42147 7.41686 2.55382 7.50002 2.68545C7.58318 2.55382 7.67941 2.42147 7.79119 2.2953C8.265 1.76049 8.99164 1.35248 10.1066 1.35248C12.064 1.35248 13.6476 2.94498 13.6476 4.90532C13.6476 6.74041 12.6013 8.50508 11.4008 9.96927C10.2636 11.3562 8.92194 12.5508 8.00601 13.3664C7.94645 13.4194 7.88869 13.4709 7.83291 13.5206C7.64324 13.6899 7.3568 13.6899 7.16713 13.5206C7.11135 13.4709 7.05359 13.4194 6.99403 13.3664C6.0781 12.5508 4.73641 11.3562 3.59926 9.96927C2.39872 8.50508 1.35248 6.74041 1.35248 4.90532Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChevronUpIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** The house directional chevrons (Radix geometry, matching Up/Down above).\n * These replaced the typographic arrows: a text glyph's shape is whatever the\n * viewer's font decides, and the owner called the result poorly shaped. Used\n * by every \"onward\" CTA and \"back\" button. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M6.1584 3.13508C5.95694 3.32394 5.94673 3.64036 6.13559 3.84182L9.56499 7.49991L6.13559 11.158C5.94673 11.3595 5.95694 11.6759 6.1584 11.8647C6.35986 12.0536 6.67628 12.0434 6.86514 11.8419L10.6151 7.84182C10.7954 7.64946 10.7954 7.35036 10.6151 7.158L6.86514 3.15801C6.67628 2.95655 6.35986 2.94634 6.1584 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M8.84182 3.13508C9.04328 3.32394 9.05348 3.64036 8.86462 3.84182L5.43523 7.49991L8.86462 11.158C9.05348 11.3595 9.04328 11.6759 8.84182 11.8647C8.64036 12.0536 8.32394 12.0434 8.13508 11.8419L4.38508 7.84182C4.20477 7.64946 4.20477 7.35036 4.38508 7.158L8.13508 3.15801C8.32394 2.95655 8.64036 2.94634 8.84182 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function BookmarkIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3 2.5C3 2.22386 3.22386 2 3.5 2H11.5C11.7761 2 12 2.22386 12 2.5V13.5C12 13.6818 11.9014 13.8492 11.7424 13.9373C11.5834 14.0254 11.3891 14.0203 11.235 13.924L7.5 11.5896L3.765 13.924C3.61087 14.0203 3.41659 14.0254 3.25762 13.9373C3.09864 13.8492 3 13.6818 3 13.5V2.5ZM4 3V12.5979L6.97 10.7416C7.29427 10.539 7.70573 10.539 8.03 10.7416L11 12.5979V3H4Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** Dialog dismiss glyph — a plain X, used by Dialog.Content's corner button. */\nexport function XIcon(props: IconProps) {\n return (\n <svg viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" {...props}>\n <path\n d=\"M11.8 3.2a.6.6 0 0 0-.85 0L7.5 6.65 4.05 3.2a.6.6 0 1 0-.85.85L6.65 7.5 3.2 10.95a.6.6 0 1 0 .85.85L7.5 8.35l3.45 3.45a.6.6 0 0 0 .85-.85L8.35 7.5l3.45-3.45a.6.6 0 0 0 0-.85Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n","// src/components/ui/Dialog.tsx\n// Compound Dialog matching the Radix JSX shape on a native <dialog>:\n// top-layer stacking (nested/stacked dialogs work), built-in focus trap and\n// focus return, Esc via the `cancel` event. Both controlled (open/\n// onOpenChange) and Trigger-driven uncontrolled sites are supported — the\n// inventory has both. Esc handoff with the in-house Select: a capture-phase\n// keydown checks for an open listbox inside the dialog and flags the next\n// `cancel` to be swallowed, so one Esc closes the Select, the next closes\n// the dialog (matching the Radix-era behavior sites were built against).\n\"use client\";\nimport type * as React from \"react\";\nimport { XIcon } from \"./icons\";\nimport {\n cloneElement, createContext, isValidElement, useContext, useEffect,\n useId, useLayoutEffect, useRef, useState, type ReactNode,\n} from \"react\";\nimport { cx } from \"./propShared\";\nimport { Heading, type HeadingProps } from \"./Heading\";\nimport { Text, type TextProps } from \"./Text\";\nimport styles from \"./Dialog.module.scss\";\n\n// Body scroll-lock reference count, shared across every mounted Content\n// instance (module scope, not per-instance state) — Dialog and AlertDialog\n// stack on top of one another, and per-instance prev-capture couldn't tell\n// \"I'm the last one closing\" from \"another instance is still open\" when\n// unmounts land out of open-order. A plain 0→1 / 1→0 edge count is\n// order-proof: overflow is locked exactly while count > 0, regardless of\n// which instance opened or closed first.\nlet lockCount = 0;\n\nexport interface DialogCtx {\n open: boolean;\n setOpen: (o: boolean) => void;\n titleId: string;\n descId: string;\n /** alert dialogs: no backdrop light-dismiss */\n alert?: boolean;\n /** whether a Description is currently mounted (drives aria-describedby) */\n hasDesc: boolean;\n setHasDesc: (v: boolean) => void;\n}\nconst Ctx = createContext<DialogCtx | null>(null);\nexport const useDialog = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"Dialog parts must be inside Dialog.Root\");\n return ctx;\n};\n\nexport interface RootProps {\n /** Controls the dialog. Omit both this and onOpenChange to let the dialog\n * manage its own state. */\n open?: boolean;\n /** Called whenever the dialog opens or closes, including via Escape or a\n * backdrop click. */\n onOpenChange?: (o: boolean) => void;\n /** A Trigger and a Content. */\n children?: ReactNode;\n}\n\n/** Shared by Dialog.Root and AlertDialog.Root (alert flag differs). */\nexport function makeRoot(alert: boolean) {\n return function Root({ open, onOpenChange, children }: RootProps) {\n const [internal, setInternal] = useState(false);\n const isControlled = open !== undefined;\n const actual = isControlled ? open : internal;\n const setOpen = (o: boolean) => {\n if (!isControlled) setInternal(o);\n onOpenChange?.(o);\n };\n const titleId = useId();\n const descId = useId();\n const [hasDesc, setHasDesc] = useState(false);\n return (\n <Ctx.Provider value={{ open: actual, setOpen, titleId, descId, alert, hasDesc, setHasDesc }}>\n {children}\n </Ctx.Provider>\n );\n };\n}\n/**\n * Owns a dialog's open state. Works controlled via `open`/`onOpenChange`, or\n * uncontrolled if you pass neither.\n *\n * Renders nothing itself — it only provides context, so Trigger and Content\n * can sit anywhere beneath it in the tree.\n */\nexport const Root = makeRoot(false);\n\ntype Clickable = React.ReactElement<{ onClick?: (e: React.MouseEvent) => void }>;\nconst chainOpen = (child: ReactNode, fn: () => void): ReactNode => {\n if (!isValidElement(child)) return child;\n const c = child as Clickable;\n return cloneElement(c, {\n onClick: (e: React.MouseEvent) => { c.props.onClick?.(e); fn(); },\n });\n};\n\n/**\n * Opens the dialog. Chains onto its child's existing click handler rather\n * than replacing it, and renders no element of its own — so the child stays\n * whatever it already was, button or otherwise.\n */\nexport function Trigger({\n children,\n}: {\n /** The control that opens the dialog. Its own onClick still fires. */\n children?: ReactNode;\n}) {\n const d = useDialog();\n return <>{chainOpen(children, () => d.setOpen(true))}</>;\n}\n\n/**\n * Closes the dialog. Same shape as Trigger: wraps its child, adds a close on\n * click, and adds no markup.\n */\nexport function Close({\n children,\n}: {\n /** The control that closes the dialog. Its own onClick still fires. */\n children?: ReactNode;\n}) {\n const d = useDialog();\n return <>{chainOpen(children, () => d.setOpen(false))}</>;\n}\n\nexport interface ContentProps extends React.HTMLAttributes<HTMLDialogElement> {\n /** Padding and radius step. 4 is roomier, for dialogs carrying a form. */\n size?: \"3\" | \"4\";\n /** Caps the dialog's width, e.g. \"480px\". Without it the dialog uses its\n * own default and grows with its content. */\n maxWidth?: string;\n /** Dialog contents. Include a Title — it is the accessible name. */\n children?: ReactNode;\n}\n\n/**\n * The dialog surface. Built on the native `<dialog>` element, so the browser\n * supplies the top layer, focus trapping and Escape handling rather than the\n * library reimplementing them.\n *\n * Dismissible by Escape or a click on the backdrop; AlertDialog's Content\n * deliberately is not.\n */\nexport function Content({ size = \"3\", maxWidth, className, style, children, ...rest }: ContentProps) {\n const d = useDialog();\n const ref = useRef<HTMLDialogElement | null>(null);\n const swallowCancel = useRef(false);\n // Backdrop dismissal must require BOTH the mousedown/pointerdown AND the\n // click to land on the backdrop (the <dialog> element itself, not the\n // inner content wrapper) — otherwise a text-selection drag that starts in\n // the content and ends up released over the backdrop would close the\n // dialog on mouseup even though the gesture began inside it.\n const pointerDownOnBackdrop = useRef(false);\n\n // Imperative <dialog> API follows the declarative open prop (handles the\n // delayed first open of AccountsIntroModal's 900ms timer too).\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n if (d.open && !el.open) el.showModal();\n else if (!d.open && el.open) el.close();\n }, [d.open]);\n\n // Body scroll lock while open (Radix did this; panels behind rely on it).\n // Module-level counter (see `lockCount` above) so stacked dialogs compose:\n // only the 0→1 transition locks, only the 1→0 transition unlocks.\n useEffect(() => {\n if (!d.open) return;\n lockCount += 1;\n if (lockCount === 1) document.body.style.overflow = \"hidden\";\n return () => {\n lockCount -= 1;\n if (lockCount === 0) document.body.style.overflow = \"\";\n };\n }, [d.open]);\n\n return (\n <dialog\n {...rest}\n ref={ref}\n role={d.alert ? \"alertdialog\" : undefined}\n aria-labelledby={d.titleId}\n aria-describedby={d.hasDesc ? d.descId : undefined}\n className={cx(styles.dialog, \"spDialog\", size === \"4\" && styles.size4, className)}\n style={{ ...(maxWidth ? { maxWidth } : null), ...style }}\n onKeyDownCapture={(e) => {\n if (e.key !== \"Escape\") return;\n // A nested dialog is open inside this one (e.g. an AlertDialog\n // launched from this dialog's content) — that inner dialog owns\n // this Esc; don't let the outer one arm its own swallow logic on\n // an event that's about to close a dialog it isn't itself.\n if (ref.current?.querySelector(\"dialog[open]\")) return;\n // Esc while an in-house Select's listbox is open inside this dialog:\n // the Select closes itself; swallow the dialog's own cancel.\n if (ref.current?.querySelector('[role=\"listbox\"]:not([hidden])')) {\n swallowCancel.current = true;\n }\n }}\n onCancel={(e) => {\n e.preventDefault(); // we route ALL closes through React state\n if (swallowCancel.current) { swallowCancel.current = false; return; }\n d.setOpen(false);\n }}\n onClose={() => {\n // Belt-and-suspenders: any UA-initiated close we didn't route\n // through onCancel (a non-cancelable close request, or a future\n // method=\"dialog\" form submission inside the content) still fires\n // `close`. Resync React state so `open` doesn't get stranded true\n // while the native element is actually closed.\n if (d.open) d.setOpen(false);\n }}\n onPointerDown={(e) => {\n pointerDownOnBackdrop.current = e.target === ref.current;\n }}\n onClick={(e) => {\n // Backdrop click = clicking the <dialog> element itself (the inner\n // wrapper covers the content area). Alert dialogs don't light-dismiss.\n // Require the pointerdown that started this click to have also\n // landed on the backdrop, so a text-selection drag from the content\n // out to the backdrop doesn't close the dialog on release.\n if (!d.alert && e.target === ref.current && pointerDownOnBackdrop.current) d.setOpen(false);\n }}\n >\n <div className={styles.inner}>\n {/* Every dialog gets the same dismiss affordance in the same place.\n Alert dialogs are excluded on purpose: they ask a question that\n wants an explicit answer, and a corner X is an ambiguous one. */}\n {!d.alert && (\n <button\n type=\"button\"\n className={styles.closeX}\n aria-label=\"Close\"\n onClick={() => d.setOpen(false)}\n >\n <XIcon width={16} height={16} />\n </button>\n )}\n {children}\n </div>\n </dialog>\n );\n}\n\n/**\n * The dialog's accessible name. Wire one up for every dialog — it is what a\n * screen reader announces when the dialog opens.\n */\nexport function Title({ className, ...rest }: HeadingProps) {\n const d = useDialog();\n return <Heading as=\"h2\" size=\"5\" {...rest} id={d.titleId} className={cx(styles.title, className)} />;\n}\n\n/**\n * Supporting copy beneath the title, registered as the dialog's accessible\n * description. Optional, and only announced when present.\n */\nexport function Description(props: TextProps) {\n const d = useDialog();\n // aria-describedby on Content is conditional on a Description actually\n // being mounted (some dialogs render none), so Content can't just point\n // at descId unconditionally. Register/unregister via a layout effect —\n // runs before paint, and Description mounts synchronously with the\n // dialog's content, so there's no visible flash of a missing attribute.\n // Depend on setHasDesc alone (a stable useState setter), not the whole\n // `d` context object — that object is a fresh literal every Root render,\n // so depending on it would re-fire this effect (and its cleanup) on\n // every render instead of just mount/unmount.\n const { setHasDesc } = d;\n useLayoutEffect(() => {\n setHasDesc(true);\n return () => setHasDesc(false);\n }, [setHasDesc]);\n return <Text as=\"p\" {...props} id={d.descId} />;\n}\n","// src/components/ui/AlertDialog.tsx\n// Same native-<dialog> engine with alertdialog semantics: role=\"alertdialog\",\n// NO backdrop light-dismiss (spec), and sites render Cancel before Action so\n// showModal()'s first-focusable initial focus lands on Cancel (spec).\n\"use client\";\nimport {\n makeRoot, Trigger as DialogTrigger, Close as DialogClose,\n Content as DialogContent, Title as DialogTitle, Description as DialogDescription,\n} from \"./Dialog\";\n\nexport const Root = makeRoot(true);\nexport const Trigger = DialogTrigger;\nexport const Content = DialogContent;\nexport const Title = DialogTitle;\nexport const Description = DialogDescription;\nexport const Cancel = DialogClose;\n// Close chains the child's own onClick (the destructive handler) BEFORE\n// closing — exactly AlertDialog.Action's Radix contract. Distinct export so\n// call sites keep their names.\nexport const Action = DialogClose;\n","// src/components/ui/DropdownMenu.tsx\n// role=\"menu\" on a popover=\"auto\" div: top-layer + click-outside dismissal\n// come from the platform. Anchor positioning is manual (align=\"end\" is the\n// only inventoried mode). Roving tabindex arrows per the spec.\n\"use client\";\nimport type * as React from \"react\";\nimport {\n cloneElement, createContext, createElement, isValidElement, useContext,\n useEffect, useId, useLayoutEffect, useRef, useState, type ReactNode,\n} from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./DropdownMenu.module.scss\";\n\ninterface MenuCtx {\n open: boolean;\n setOpen: (o: boolean) => void;\n menuId: string;\n}\nconst Ctx = createContext<MenuCtx | null>(null);\nconst useMenu = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ctx;\n};\n\n// Refs live in their own contexts (not bundled into MenuCtx) so `ref={...}`\n// attachment in JSX reads a plain RefObject, matching the pattern Select.tsx\n// uses for its trigger ref.\nconst TriggerRefCtx = createContext<React.RefObject<HTMLElement | null> | null>(null);\nconst useTriggerRef = () => {\n const ref = useContext(TriggerRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\nconst MenuRefCtx = createContext<React.RefObject<HTMLDivElement | null> | null>(null);\nconst useMenuRef = () => {\n const ref = useContext(MenuRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\n\n// Whether a platform light-dismiss just closed the popover (cleared after a\n// short window by a timeout — see Content's onToggle). Own context per the\n// ref-context pattern above (refs never live on Ctx itself — react-hooks/\n// refs forbids mutable refs on a value object that's also read for render,\n// since a ref write wouldn't trigger the re-render consumers of Ctx expect).\nconst LightDismissRefCtx = createContext<React.RefObject<boolean> | null>(null);\nconst useLightDismissRef = () => {\n const ref = useContext(LightDismissRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\n\n// Whether the popover's current \"closed\" toggle was initiated by an Item\n// activating (click/asChild-navigate) rather than a platform light-dismiss\n// (click outside / Esc). Item arms this just before it calls setOpen(false);\n// Content's onToggle reads-and-clears it to decide whether to arm the\n// light-dismiss race guard above — an item-initiated close shouldn't be\n// mistaken for an outside click. Own ref-context, same reasoning as\n// LightDismissRefCtx.\nconst ItemClosedRefCtx = createContext<React.RefObject<boolean> | null>(null);\nconst useItemClosedRef = () => {\n const ref = useContext(ItemClosedRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\n\n// Plain (non-component, non-hook) helper: reads-and-clears the flag. Kept\n// outside Trigger's body because closures passed through cloneElement's\n// props object aren't recognized as deferred event handlers by the React\n// Compiler's ref-during-render check the way a literal JSX attribute value\n// is — pulling the `.current` access out into an ordinary function sidesteps\n// that false positive (the closure in Trigger only ever calls this helper,\n// it never touches `.current` itself).\nfunction consumeLightDismissFlag(ref: React.RefObject<boolean>): boolean {\n if (!ref.current) return false;\n ref.current = false;\n return true;\n}\n\n// Same false-positive, same fix: Item's asChild onClick is built inside the\n// props object passed to createElement (not a literal JSX attribute), so a\n// direct `.current` write there trips the same ref-during-render check.\nfunction markItemInitiatedClose(ref: React.RefObject<boolean>): void {\n ref.current = true;\n}\n\n/**\n * Owns a menu's open state and closes it on an outside click or Escape.\n * Renders nothing of its own.\n */\nexport function Root({\n children,\n}: {\n /** A Trigger and a Content. */\n children?: ReactNode;\n}) {\n const [open, setOpen] = useState(false);\n const menuId = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const menuRef = useRef<HTMLDivElement | null>(null);\n const lightDismissedRef = useRef(false);\n const itemClosedRef = useRef(false);\n return (\n <Ctx.Provider value={{ open, setOpen, menuId }}>\n <TriggerRefCtx.Provider value={triggerRef}>\n <MenuRefCtx.Provider value={menuRef}>\n <LightDismissRefCtx.Provider value={lightDismissedRef}>\n <ItemClosedRefCtx.Provider value={itemClosedRef}>{children}</ItemClosedRefCtx.Provider>\n </LightDismissRefCtx.Provider>\n </MenuRefCtx.Provider>\n </TriggerRefCtx.Provider>\n </Ctx.Provider>\n );\n}\n\n/**\n * The control that opens the menu, and the element the menu is positioned\n * against. Wraps its child rather than rendering a button of its own.\n */\nexport function Trigger({\n children,\n}: {\n /** The control that opens the menu, and what the menu anchors to. */\n children?: ReactNode;\n}) {\n const m = useMenu();\n const triggerRef = useTriggerRef();\n const lightDismissedRef = useLightDismissRef();\n if (!isValidElement(children)) return null;\n const child = children as React.ReactElement<Record<string, unknown>>;\n return cloneElement(child, {\n ref: triggerRef,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": m.open,\n \"aria-controls\": m.menuId,\n onClick: (e: React.MouseEvent) => {\n (child.props.onClick as ((e: React.MouseEvent) => void) | undefined)?.(e);\n // Race: clicking the trigger while the menu is open first fires a\n // pointerdown, which the popover API treats as an outside interaction\n // and light-dismisses the popover (Content's onToggle flags this ref\n // and clears it again after a short window — see there). The click\n // event that completes right after would then read the now-stale\n // open===false and immediately reopen the menu it was meant to close.\n // Skip this click's toggle if a light-dismiss just landed within the\n // same gesture.\n if (consumeLightDismissFlag(lightDismissedRef)) return;\n m.setOpen(!m.open);\n },\n });\n}\n\n/**\n * The menu surface, anchored to the trigger and aligned to its start or end\n * edge. Owns the keyboard model: arrows move between items, Escape closes and\n * returns focus to the trigger.\n */\nexport function Content({\n align = \"start\",\n children,\n}: {\n /** Which edge of the trigger the menu lines up with. Use `end` when the\n * trigger sits near the right edge and the menu would overflow. */\n align?: \"start\" | \"end\";\n /** Items, Labels and Separators. */\n children?: ReactNode;\n}) {\n const m = useMenu();\n const triggerRef = useTriggerRef();\n const menuRef = useMenuRef();\n const lightDismissedRef = useLightDismissRef();\n const itemClosedRef = useItemClosedRef();\n const [pos, setPos] = useState<{ top: number; left: number | \"auto\"; right: number | \"auto\" } | null>(null);\n\n // useLayoutEffect (not useEffect) so the position is measured and applied\n // synchronously before paint — matches Select.tsx's trigger-measurement\n // pattern and avoids a one-frame flash at the wrong coordinates.\n useLayoutEffect(() => {\n const el = menuRef.current;\n if (!el) return;\n if (m.open) {\n // Position under the trigger before entering the top layer.\n const trigger = triggerRef.current;\n if (trigger) {\n const r = trigger.getBoundingClientRect();\n const left = align === \"end\" ? \"auto\" : r.left;\n const right = align === \"end\" ? window.innerWidth - r.right : \"auto\";\n setPos({ top: r.bottom + 6, left, right });\n }\n el.showPopover();\n // Focus the first item for keyboard users.\n el.querySelector<HTMLElement>('[role=\"menuitem\"]')?.focus();\n } else if (el.matches(\":popover-open\")) {\n el.hidePopover();\n }\n }, [m.open, align, menuRef, triggerRef]);\n\n // A resize invalidates the anchored position (measured once, at open) —\n // rather than re-measuring on every resize tick, just close the menu, same\n // as a light dismiss.\n useEffect(() => {\n if (!m.open) return;\n const setOpen = m.setOpen;\n const onResize = () => setOpen(false);\n window.addEventListener(\"resize\", onResize);\n return () => window.removeEventListener(\"resize\", onResize);\n }, [m.open, m.setOpen]);\n\n return (\n <div\n ref={menuRef}\n id={m.menuId}\n role=\"menu\"\n popover=\"auto\"\n className={styles.menu}\n style={\n pos\n ? {\n top: pos.top,\n left: pos.left === \"auto\" ? \"auto\" : pos.left,\n right: pos.right === \"auto\" ? \"auto\" : pos.right,\n }\n : undefined\n }\n onToggle={(e: React.SyntheticEvent<HTMLDivElement>) => {\n // Platform light-dismiss (click outside / Esc) → sync React state.\n if ((e.nativeEvent as ToggleEvent).newState === \"closed\") {\n // An Item activating also drives this closed (setOpen(false) →\n // hidePopover() → this same toggle event) — that's not a light\n // dismiss and shouldn't arm the race guard below. Read-and-clear\n // the item's flag to tell the two apart.\n const itemInitiated = itemClosedRef.current;\n itemClosedRef.current = false;\n if (!itemInitiated) {\n // Flag the race window for Trigger's onClick (see the comment\n // there) and auto-clear it shortly after — it only needs to\n // survive the current click gesture, not linger indefinitely.\n lightDismissedRef.current = true;\n setTimeout(() => { lightDismissedRef.current = false; }, 300);\n }\n if (m.open) m.setOpen(false);\n }\n }}\n onKeyDown={(e) => {\n const items = Array.from(\n menuRef.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []\n );\n const idx = items.indexOf(document.activeElement as HTMLElement);\n if (e.key === \"ArrowDown\") { e.preventDefault(); items[Math.min(idx + 1, items.length - 1)]?.focus(); }\n else if (e.key === \"ArrowUp\") { e.preventDefault(); items[Math.max(idx - 1, 0)]?.focus(); }\n else if (e.key === \"Home\") { e.preventDefault(); items[0]?.focus(); }\n else if (e.key === \"End\") { e.preventDefault(); items[items.length - 1]?.focus(); }\n else if (e.key === \"Escape\") { m.setOpen(false); triggerRef.current?.focus(); }\n }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * A non-interactive heading for a group of items. Skipped by arrow-key\n * navigation, since there is nothing to activate.\n */\nexport function Label({\n children,\n}: {\n /** Heading text for the group beneath it. Not focusable. */\n children?: ReactNode;\n}) {\n return <div className={styles.label}>{children}</div>;\n}\n\nexport interface ItemProps {\n /** Render the child element instead of the default item — for a link that\n * should stay an anchor rather than becoming a button. */\n asChild?: boolean;\n /** Marks a destructive action, so it reads differently before it is\n * chosen rather than after. */\n color?: \"danger\";\n /** Runs when the item is chosen; the menu closes either way. */\n onSelect?: () => void | Promise<void>;\n /** The item's label. */\n children?: ReactNode;\n}\n\n/**\n * One menu action. `onSelect` fires and the menu closes.\n *\n * Pass `color=\"danger\"` for a destructive action so it reads differently from\n * its neighbours before it is chosen, not after.\n */\nexport function Item({ asChild, color, onSelect, children }: ItemProps) {\n const m = useMenu();\n const itemClosedRef = useItemClosedRef();\n const cls = cx(styles.item, color === \"danger\" && styles.danger);\n const activate = () => {\n markItemInitiatedClose(itemClosedRef);\n m.setOpen(false);\n void onSelect?.();\n };\n if (asChild && isValidElement(children)) {\n const child = children as React.ReactElement<Record<string, unknown>>;\n // Rebuild (rather than cloneElement) so role/tabIndex land BEFORE the\n // child's own attributes (e.g. href) in the emitted markup — cloneElement\n // always keeps pre-existing keys in their original position. Also drop\n // the child's own role/tabIndex (if any) from restProps entirely — a\n // spread landing after the forced menuitem/-1 values would otherwise\n // silently win and undo the forced semantics.\n const {\n className: childClassName, onClick: childOnClick, children: childChildren,\n role: childRole, tabIndex: childTabIndex, ...restProps\n } = child.props;\n // Discarded — pulled out of restProps only so the forced role/tabIndex\n // below can't be silently overwritten by the child's own values.\n void childRole;\n void childTabIndex;\n const originalRef = (child as unknown as { ref?: React.Ref<unknown> }).ref;\n return createElement(\n child.type as React.ElementType,\n {\n key: child.key,\n ref: originalRef,\n role: \"menuitem\",\n tabIndex: -1,\n ...restProps,\n className: cx(cls, childClassName as string | undefined),\n onClick: (e: React.MouseEvent) => {\n (childOnClick as ((e: React.MouseEvent) => void) | undefined)?.(e);\n markItemInitiatedClose(itemClosedRef);\n m.setOpen(false); // real navigation proceeds; menu closes\n },\n },\n childChildren as ReactNode,\n );\n }\n return (\n <button type=\"button\" role=\"menuitem\" tabIndex={-1} className={cls} onClick={activate}>\n {children}\n </button>\n );\n}\n\n/**\n * A rule between groups of items — for separating a destructive action from\n * routine ones, so the two are not adjacent to a moving cursor.\n */\nexport function Separator() {\n return <div role=\"separator\" className={styles.separator} />;\n}\n","// ARIA tabs. Inactive Content unmounts, matching Radix's default.\n\"use client\";\nimport type * as React from \"react\";\nimport { createContext, useContext, useId, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Tabs.module.scss\";\n\ninterface TabsCtx {\n value: string;\n onValueChange: (v: string) => void;\n /** useId()-derived base, shared by Trigger/Content so a trigger's\n * aria-controls always matches its panel's id (and vice versa via\n * aria-labelledby) without either side guessing the other's id. */\n id: string;\n}\nconst Ctx = createContext<TabsCtx | null>(null);\nconst useTabs = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"Tabs parts must be inside Tabs.Root\");\n return ctx;\n};\n\n/**\n * Wraps a tab set and owns which tab is showing. Fully controlled — pass\n * `value` and `onValueChange`; there is no uncontrolled mode.\n *\n * Renders a plain div, so it imposes no layout of its own. It also mints the\n * id that pairs each Trigger with its Content, which is why every part has to\n * sit inside a Root rather than being usable on its own.\n */\nexport function Root({ value, onValueChange, className, children }: {\n /** The selected tab's value. Fully controlled — there is no default. */\n value: string;\n /** Called with the newly selected tab's value. */\n onValueChange: (v: string) => void;\n /** Merged onto the wrapper div, which is otherwise unstyled. */\n className?: string;\n /** A List and the Contents it switches between. */\n children?: ReactNode;\n}) {\n const id = useId();\n return (\n <Ctx.Provider value={{ value, onValueChange, id }}>\n <div className={className}>{children}</div>\n </Ctx.Provider>\n );\n}\n\n/**\n * The row of triggers, and the keyboard model for the set: arrow keys move\n * between tabs, Home and End jump to the ends, each moving focus and\n * selection together as the ARIA tabs pattern expects.\n *\n * Bottom-aligns its children, so an active tab that grows taller rises above\n * its neighbours instead of pushing the row down — the folder-tab effect.\n */\nexport function List({\n children,\n}: {\n /** The Triggers. Their order is the tab order. */\n children?: ReactNode;\n}) {\n return (\n <div\n role=\"tablist\"\n className={cx(styles.list, \"spTabsList\")}\n onKeyDown={(e) => {\n const tabs = Array.from(\n (e.currentTarget as HTMLElement).querySelectorAll<HTMLElement>('[role=\"tab\"]')\n );\n const idx = tabs.indexOf(document.activeElement as HTMLElement);\n if (idx === -1) return;\n if (e.key === \"ArrowRight\") { e.preventDefault(); const t = tabs[(idx + 1) % tabs.length]; t.focus(); t.click(); }\n else if (e.key === \"ArrowLeft\") { e.preventDefault(); const t = tabs[(idx - 1 + tabs.length) % tabs.length]; t.focus(); t.click(); }\n else if (e.key === \"Home\") { e.preventDefault(); const t = tabs[0]; t.focus(); t.click(); }\n else if (e.key === \"End\") { e.preventDefault(); const t = tabs[tabs.length - 1]; t.focus(); t.click(); }\n }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * One tab. Selects its `value` on click and carries the ARIA wiring that ties\n * it to the matching Content.\n *\n * Emits `data-state=\"active\" | \"inactive\"`, which is the hook the active\n * styling keys off — useful if you are restyling tabs from outside.\n */\nexport function Trigger({ value, className, children, ...rest }: {\n /** Selects this value. Must match the Content it reveals. */\n value: string;\n /** Merged with the tab's own classes rather than replacing them. */\n className?: string;\n /** The tab's label. */\n children?: ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>) {\n const t = useTabs();\n const active = t.value === value;\n return (\n <button\n {...rest}\n type=\"button\"\n role=\"tab\"\n id={`${t.id}-tab-${value}`}\n aria-selected={active}\n aria-controls={`${t.id}-panel-${value}`}\n tabIndex={active ? 0 : -1}\n data-state={active ? \"active\" : \"inactive\"}\n className={cx(styles.trigger, \"spTabsTrigger\", className)}\n onClick={() => t.onValueChange(value)}\n >\n {children}\n </button>\n );\n}\n\n/**\n * The panel for one tab. Renders only while its `value` is the selected one —\n * inactive panels unmount rather than hide, so their contents do not run,\n * hold state, or appear to a screen reader.\n *\n * Carries no styling: the surface a tab set seats onto is the consumer's, and\n * should match `--sp-tabs-surface-color` so the active tab connects to it.\n */\nexport function Content({\n value,\n children,\n}: {\n /** Shown while this matches the Root's value. Must match a Trigger. */\n value: string;\n /** Panel contents. Unmounted while another tab is selected. */\n children?: ReactNode;\n}) {\n const t = useTabs();\n if (t.value !== value) return null;\n return (\n <div role=\"tabpanel\" id={`${t.id}-panel-${value}`} aria-labelledby={`${t.id}-tab-${value}`}>\n {children}\n </div>\n );\n}\n"],"names":["SPACE","spacingStyle","m","mt","mb","p","pb","style","out","cx","parts","Text","forwardRef","as","size","weight","color","className","rest","ref","createElement","styles","Heading","align","Link","asChild","children","cls","merged","isValidElement","child","cloneElement","jsx","cap","s","Flex","gap","direction","justify","wrap","Box","Grid","columns","colCls","Badge","variant","Separator","Card","ScrollArea","mulberry32","a","t","hashString","h","i","Button","iconOnly","ember","fullWidth","animated","id","useId","starStyles","useMemo","rand","classes","jsxs","Loader","label","SHOW_DELAY","HIDE_DELAY","SIDE_OFFSET","COLLISION_PADDING","TooltipTrigger","triggerRef","tooltipId","show","hide","e","_a","Tooltip","side","open","setOpen","useState","pos","setPos","useRef","contentRef","showTimer","hideTimer","clearTimers","immediate","useEffect","useLayoutEffect","content","trigger","r","w","below","above","fitsBelow","fitsAbove","top","left","Fragment","IconToggle","options","value","onValueChange","opt","Ctx","createContext","useSelect","ctx","useContext","optionId","listboxId","RefCtx","useTriggerRef","collectItems","walk","nodes","Children","props","Item","Root","disabled","highlighted","setHighlighted","rootRef","contentChildren","found","Content","items","values","itemLabels","labelFor","useCallback","onDown","Trigger","placeholder","openWith","highlight","ctl","l","_position","listRef","triggerWidth","setTriggerWidth","maxHeight","setMaxHeight","rect","available","move","delta","idx","next","_b","selected","inputProps","Slot","TextArea","Slider","min","max","step","ariaLabel","v","pct","name","g","isDisabled","control","Progress","base","Share2Icon","ChatBubbleIcon","PlusIcon","Pencil1Icon","HeartFilledIcon","ExitFullScreenIcon","EnterFullScreenIcon","CheckIcon","TrashIcon","QuestionMarkCircledIcon","PersonIcon","MinusIcon","MagnifyingGlassIcon","HeartIcon","ChevronUpIcon","ChevronDownIcon","ChevronRightIcon","ChevronLeftIcon","BookmarkIcon","XIcon","lockCount","useDialog","makeRoot","alert","onOpenChange","internal","setInternal","isControlled","actual","o","titleId","descId","hasDesc","setHasDesc","chainOpen","fn","c","d","Close","maxWidth","swallowCancel","pointerDownOnBackdrop","el","Title","Description","DialogTrigger","DialogContent","DialogTitle","DialogDescription","Cancel","DialogClose","Action","useMenu","TriggerRefCtx","MenuRefCtx","useMenuRef","LightDismissRefCtx","useLightDismissRef","ItemClosedRefCtx","useItemClosedRef","consumeLightDismissFlag","markItemInitiatedClose","menuId","menuRef","lightDismissedRef","itemClosedRef","right","onResize","itemInitiated","_c","_d","_e","_f","Label","onSelect","activate","childClassName","childOnClick","childChildren","childRole","childTabIndex","restProps","originalRef","useTabs","List","tabs","active"],"mappings":"sMAeMA,EAAmC,CACvC,EAAK,IACL,EAAK,oBACL,EAAK,oBACL,EAAK,oBACL,EAAK,oBACL,EAAK,oBACL,EAAK,mBACP,EAEO,SAASC,EACd,CAAE,EAAAC,EAAG,GAAAC,EAAI,GAAAC,EAAI,EAAAC,EAAG,GAAAC,CAAA,EAChBC,EAC2B,CAC3B,MAAMC,EAAqB,CACzB,GAAIN,IAAM,QAAa,CAAE,OAAQF,EAAME,CAAC,CAAA,EACxC,GAAIC,IAAO,QAAa,CAAE,UAAWH,EAAMG,CAAE,CAAA,EAC7C,GAAIC,IAAO,QAAa,CAAE,aAAcJ,EAAMI,CAAE,CAAA,EAChD,GAAIC,IAAM,QAAa,CAAE,QAASL,EAAMK,CAAC,CAAA,EACzC,GAAIC,IAAO,QAAa,CAAE,cAAeN,EAAMM,CAAE,CAAA,EACjD,GAAGC,CAAA,EAEL,OAAO,OAAO,KAAKC,CAAG,EAAE,OAAS,EAAIA,EAAM,MAC7C,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F,CAAK,EAEnC,SAAAlF,CAAA,CAAA,CAGP,CAUO,SAAS2G,GAAQ,CACtB,MAAAzB,EACA,SAAAlF,CACF,EAKG,CACD,MAAMyB,EAAIgN,GAAA,EACV,OAAIhN,EAAE,QAAUyD,EAAc,WAE3B,MAAA,CAAI,KAAK,WAAW,GAAI,GAAGzD,EAAE,EAAE,UAAUyD,CAAK,GAAI,kBAAiB,GAAGzD,EAAE,EAAE,QAAQyD,CAAK,GACrF,SAAAlF,EACH,CAEJ"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/components/propShared.ts","../src/components/Text.tsx","../src/components/Heading.tsx","../src/components/Link.tsx","../src/components/Flex.tsx","../src/components/Box.tsx","../src/components/Grid.tsx","../src/components/Badge.tsx","../src/components/Separator.tsx","../src/components/Card.tsx","../src/components/ScrollArea.tsx","../src/internal/seededRandom.ts","../src/components/Button.tsx","../src/components/Loader.tsx","../src/components/Tooltip.tsx","../src/components/IconToggle.tsx","../src/styles/spaceControls.ts","../src/components/Select.tsx","../src/components/TextField.tsx","../src/components/TextArea.tsx","../src/components/Slider.tsx","../src/components/RadioGroup.tsx","../src/components/Progress.tsx","../src/components/icons.tsx","../src/components/Dialog.tsx","../src/components/AlertDialog.tsx","../src/components/DropdownMenu.tsx","../src/components/Tabs.tsx"],"sourcesContent":["// Shared prop plumbing for the design-system primitives. The spacing map is\n// the single place Radix's numeric steps meet our t-shirt tokens; \"3\" (12px)\n// rounds UP to md per the spec's when-in-doubt-go-up rule.\nimport type { CSSProperties } from \"react\";\n\nexport type SpaceStep = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n\nexport interface SpacingProps {\n m?: SpaceStep;\n mt?: SpaceStep;\n mb?: SpaceStep;\n p?: SpaceStep;\n pb?: SpaceStep;\n}\n\nconst SPACE: Record<SpaceStep, string> = {\n \"0\": \"0\",\n \"1\": \"var(--spacing-xs)\",\n \"2\": \"var(--spacing-sm)\",\n \"3\": \"var(--spacing-md)\",\n \"4\": \"var(--spacing-md)\",\n \"5\": \"var(--spacing-lg)\",\n \"6\": \"var(--spacing-xl)\",\n};\n\nexport function spacingStyle(\n { m, mt, mb, p, pb }: SpacingProps,\n style?: CSSProperties,\n): CSSProperties | undefined {\n const out: CSSProperties = {\n ...(m !== undefined && { margin: SPACE[m] }),\n ...(mt !== undefined && { marginTop: SPACE[mt] }),\n ...(mb !== undefined && { marginBottom: SPACE[mb] }),\n ...(p !== undefined && { padding: SPACE[p] }),\n ...(pb !== undefined && { paddingBottom: SPACE[pb] }),\n ...style,\n };\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\nexport function cx(...parts: Array<string | false | undefined>): string {\n return parts.filter(Boolean).join(\" \");\n}\n","import type * as React from \"react\";\nimport { createElement, forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Text.module.scss\";\n\nexport interface TextProps\n extends SpacingProps,\n Omit<React.HTMLAttributes<HTMLElement>, \"color\"> {\n /** Element to render. Default `span`. Use `p` for prose and `label`\n * (with `htmlFor`) for form labels — size is presentational, so the\n * element stays free to be the semantically correct one. */\n as?: \"span\" | \"div\" | \"p\" | \"label\";\n /** Font size step: 1=12px, 2=14px, 3=16px, 4=18px, 5=20px, 6=24px.\n * Line height and letter spacing move with it. Omit to inherit. */\n size?: \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n /** 500 or 700. Omit for the inherited weight. */\n weight?: \"medium\" | \"bold\";\n /** Semantic colour role. `gray` is the standard secondary-text token;\n * the rest carry meaning, so avoid them for emphasis alone. Omit for\n * primary text. */\n /** Semantic colour role. `muted` is the standard secondary-text token;\n * the rest carry meaning, so avoid them for emphasis alone. Omit for\n * primary text. */\n color?: \"muted\" | \"danger\" | \"success\" | \"warning\";\n /** Id of the control this labels. Only meaningful with `as=\"label\"`. */\n htmlFor?: string;\n /** The text. */\n children?: ReactNode;\n}\n\n/**\n * Body copy. Size, weight and colour are presentational and independent of\n * the element, so `as` stays free to be whatever the document actually needs\n * — a `p` for prose, a `label` for a field, a `span` inline.\n *\n * Colour is a role, not a hue: use `muted` for secondary copy and reserve the\n * status roles for text that genuinely carries that meaning.\n */\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(\n { as = \"span\", size, weight, color, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return createElement(as, {\n ...rest,\n ref,\n className: cx(\n styles.text,\n size && styles[`size${size}`],\n weight && styles[weight],\n color && styles[`color${color[0].toUpperCase()}${color.slice(1)}`],\n className,\n ),\n style: spacingStyle({ m, mt, mb, p, pb }, style),\n });\n});\n","import type * as React from \"react\";\nimport { createElement, forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Heading.module.scss\";\n\nexport interface HeadingProps\n extends SpacingProps,\n Omit<React.HTMLAttributes<HTMLHeadingElement>, \"color\"> {\n /** Heading level to render. Default `h2`. Independent of `size`, so\n * document outline stays correct without dictating appearance. */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n /** Font size step: 4=18px, 5=20px, 6=24px, 7=28px, 8=35px, 9=60px.\n * Shares steps 4–6 with Text, so a Heading and Text can sit on the\n * same line and match. */\n size?: \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\";\n /** Semantic colour role. Omit for primary heading colour. */\n color?: \"muted\" | \"danger\";\n /** Centres the text. There is no `left`/`right` — headings are\n * start-aligned unless deliberately centred. */\n align?: \"center\";\n /** The heading text. */\n children?: ReactNode;\n}\n\n/**\n * A section heading. `as` sets the heading level and `size` sets the\n * appearance, deliberately apart — so a visually small heading can still be\n * an h2 where the document structure calls for one.\n *\n * Shares size steps 4-6 with Text, so a heading and body copy on the same\n * line align.\n */\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { as = \"h2\", size, color, align, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return createElement(as, {\n ...rest,\n ref,\n className: cx(\n styles.heading,\n size && styles[`size${size}`],\n color === \"muted\" && styles.colorMuted,\n color === \"danger\" && styles.colorDanger,\n align === \"center\" && styles.alignCenter,\n className,\n ),\n style: spacingStyle({ m, mt, mb, p, pb }, style),\n });\n});\n","import type * as React from \"react\";\nimport { cloneElement, forwardRef, isValidElement, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Link.module.scss\";\n\nexport interface LinkProps\n extends SpacingProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\"> {\n /** Render the single child element instead of an `<a>`, merging link\n * styling onto it. For wrapping a router's own Link component without\n * nesting two anchors. */\n asChild?: boolean;\n /** Font size step: 1=12px, 2=14px, 3=16px. Matches Text's first three\n * steps so inline links sit flush with surrounding copy. */\n size?: \"1\" | \"2\" | \"3\";\n /** Link text. With `asChild`, the single element to style as a link. */\n children?: ReactNode;\n}\n\n/**\n * An inline anchor, styled to sit inside running text without disturbing its\n * rhythm. Sizes match Text's first three steps.\n *\n * Use `asChild` to wrap a router's own link component rather than nesting two\n * anchors, which is invalid and breaks keyboard navigation.\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { asChild, size, className, style, m, mt, mb, p, pb, children, ...rest },\n ref,\n) {\n const cls = cx(styles.link, size && styles[`size${size}`], className);\n const merged = spacingStyle({ m, mt, mb, p, pb }, style);\n if (asChild && isValidElement(children)) {\n const child = children as React.ReactElement<{ className?: string; style?: React.CSSProperties }>;\n return cloneElement(child, {\n ...rest,\n className: cx(cls, child.props.className),\n style: { ...merged, ...child.props.style },\n });\n }\n return (\n <a {...rest} ref={ref} className={cls} style={merged}>\n {children}\n </a>\n );\n});\n","import type * as React from \"react\";\nimport { cloneElement, forwardRef, isValidElement, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Flex.module.scss\";\n\nexport interface FlexProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** Render the single child element instead of a wrapper div, merging\n * the flex styling onto it. Avoids a redundant layer in the DOM. */\n asChild?: boolean;\n /** Gap step: 1=4px, 2=8px, 3=12px, 4=16px, 5=24px, 6=32px. Note step 3\n * is 12px — off the 8pt grid, kept for parity with the shipped app. */\n gap?: \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n /** Main axis. Default `row`. */\n direction?: \"row\" | \"column\";\n /** Cross-axis alignment (`align-items`). */\n align?: \"start\" | \"center\" | \"end\" | \"baseline\" | \"stretch\";\n /** Main-axis distribution (`justify-content`). */\n justify?: \"start\" | \"center\" | \"end\" | \"between\";\n /** Wrapping behaviour. Default is the browser's `nowrap`. */\n wrap?: \"wrap\" | \"nowrap\";\n /** The items to lay out. */\n children?: ReactNode;\n}\n\nconst cap = (s: string) => s[0].toUpperCase() + s.slice(1);\n\n/**\n * A flex row or column whose gap comes from the spacing scale, so layouts\n * inherit the 8pt grid instead of restating it in pixels.\n *\n * `asChild` merges the layout onto its only child rather than adding a\n * wrapper, for when an extra div would break a grid or a selector.\n */\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(function Flex(\n { asChild, gap, direction, align, justify, wrap, className, style, m, mt, mb, p, pb, children, ...rest },\n ref,\n) {\n const cls = cx(\n styles.flex,\n gap && styles[`gap${gap}`],\n direction && styles[`direction${cap(direction)}`],\n align && styles[`align${cap(align)}`],\n justify && styles[`justify${cap(justify)}`],\n wrap && styles[`wrap${cap(wrap)}`],\n className,\n );\n const merged = spacingStyle({ m, mt, mb, p, pb }, style);\n if (asChild && isValidElement(children)) {\n const child = children as React.ReactElement<{ className?: string; style?: React.CSSProperties }>;\n return cloneElement(child, {\n ...rest,\n className: cx(cls, child.props.className),\n style: { ...merged, ...child.props.style },\n });\n }\n return (\n <div {...rest} ref={ref} className={cls} style={merged}>\n {children}\n </div>\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { spacingStyle, type SpacingProps } from \"./propShared\";\n\nexport interface BoxProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** Anything. Box adds no styling of its own. */\n children?: ReactNode;\n}\n\n// Radix Box at our call sites is a plain div carrying className/style/ref —\n// no layout props anywhere (verified by inventory). Keep it exactly that.\n\n/**\n * A plain div that understands the spacing scale. The escape hatch for when\n * you need margin or padding on the grid but no layout behaviour with it.\n *\n * Renders nothing of its own — no class, no styling — so it never interferes\n * with whatever you put inside.\n */\nexport const Box = forwardRef<HTMLDivElement, BoxProps>(function Box(\n { style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return <div {...rest} ref={ref} style={spacingStyle({ m, mt, mb, p, pb }, style)} />;\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Grid.module.scss\";\n\ntype Cols = \"1\" | \"2\" | \"3\";\nexport interface GridProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** Column count, 1–3. Pass an object for responsive counts:\n * `{ initial: \"1\", sm: \"2\", md: \"3\" }` — `initial` applies below the\n * first breakpoint. */\n columns?: Cols | { initial?: Cols; sm?: Cols; md?: Cols };\n /** Gap step: 1=4px, 2=8px, 3=12px, 4=16px, 5=24px, 6=32px. Same scale\n * as Flex. */\n gap?: \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n /** The cells. */\n children?: ReactNode;\n}\n\n/**\n * A simple column grid, 1-3 wide, with the same gap scale as Flex. Pass an\n * object to `columns` for responsive counts.\n *\n * Deliberately narrow: anything more elaborate is a job for CSS grid directly\n * rather than a prop API that would end up reinventing it.\n */\nexport const Grid = forwardRef<HTMLDivElement, GridProps>(function Grid(\n { columns, gap, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n const colCls =\n typeof columns === \"string\"\n ? [styles[`cols${columns}`]]\n : columns\n ? [\n columns.initial && styles[`cols${columns.initial}`],\n columns.sm && styles[`smCols${columns.sm}`],\n columns.md && styles[`mdCols${columns.md}`],\n ]\n : [];\n return (\n <div\n {...rest}\n ref={ref}\n className={cx(styles.grid, ...(colCls as string[]), gap && styles[`gap${gap}`], className)}\n style={spacingStyle({ m, mt, mb, p, pb }, style)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Badge.module.scss\";\n\n/**\n * Roles whose colour carries meaning — status and emphasis.\n */\nexport type BadgeSemanticColor =\n | \"muted\"\n | \"primary\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\n/**\n * Categorical hues for telling data apart — star classes, planet types — where\n * the colour distinguishes rather than signals. These deliberately keep hue\n * names: for a categorical scale the hue IS the identity, and calling one\n * \"tertiary\" would imply a ranking that does not exist.\n */\nexport type BadgeCategoricalColor =\n | \"cyan\"\n | \"purple\"\n | \"orange\"\n | \"yellow\"\n | \"accent\";\n\nexport type BadgeColor = BadgeSemanticColor | BadgeCategoricalColor;\n\nexport interface BadgeProps\n extends SpacingProps,\n Omit<React.HTMLAttributes<HTMLSpanElement>, \"color\"> {\n /** Semantic role or categorical hue. Roles carry meaning — pick one\n * that matches the state, not the look you want.\n */\n color?: BadgeColor;\n /** `soft` is a tinted wash for dense lists; `solid` is a filled chip\n * for a badge that must win attention.\n */\n variant?: \"soft\" | \"solid\";\n /** 1 is the default chip; 2 is for standalone use away from body text. */\n size?: \"1\" | \"2\";\n /** Badges are single-line by default (Radix parity). Long free-text\n * content — e.g. user-named star systems on planet cards — opts into\n * wrapping so it can't overflow its card. */\n wrap?: boolean;\n /** Label text. Keep it short — a badge that wraps stops reading as one. */\n children?: ReactNode;\n}\n\nconst cap = (s: string) => s[0].toUpperCase() + s.slice(1);\n\n// Default color is \"blue\" (not \"gray\") to match Radix's behavior: Badge's\n// `color` prop had no hardcoded default there either — it inherited the\n// surrounding Theme's `accentColor`, which this app sets to \"blue\" (see the\n// single <Theme accentColor> in the host app). A caller that wants a\n// neutral badge should pass color=\"muted\" explicitly.\n/**\n * A compact status label. Colour is the message, so choose it for meaning:\n * the semantic roles say safe, pending or destructive, while the categorical\n * hues only tell one kind of thing from another and carry no judgement.\n *\n * Single-line by default, since a badge that wraps stops reading as a badge.\n * Opt into `wrap` for free text you do not control.\n */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { color = \"primary\", variant = \"soft\", size = \"1\", wrap, className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return (\n <span\n {...rest}\n ref={ref}\n className={cx(\n styles.badge,\n styles[`color${cap(color)}`],\n variant === \"solid\" && styles.solid,\n styles[`size${size}`],\n wrap && styles.wrap,\n className,\n )}\n style={spacingStyle({ m, mt, mb, p, pb }, style)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Separator.module.scss\";\n\nexport interface SeparatorProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Length of the rule, 1 (shortest) to 4 (full width of its container). */\n size?: \"1\" | \"2\" | \"3\" | \"4\";\n}\n\n/**\n * A hairline rule for dividing content within a surface, where a full panel\n * boundary would be too heavy. Exposed as `role=\"separator\"`, so assistive\n * technology hears the division too.\n */\nexport const Separator = forwardRef<HTMLSpanElement, SeparatorProps>(function Separator(\n { size = \"4\", className, ...rest },\n ref,\n) {\n return (\n <span\n {...rest}\n ref={ref}\n role=\"separator\"\n className={cx(styles.separator, size === \"4\" && styles.full, className)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx, spacingStyle, type SpacingProps } from \"./propShared\";\nimport styles from \"./Card.module.scss\";\n\nexport interface CardProps extends SpacingProps, React.HTMLAttributes<HTMLDivElement> {\n /** The card's contents. */\n children?: ReactNode;\n}\n\n/**\n * A translucent panel for grouping related content, one step above the page\n * surface. Its 12px inset is a deliberate exception to the 8pt grid, kept for\n * parity with the app this was extracted from.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, style, m, mt, mb, p, pb, ...rest },\n ref,\n) {\n return (\n <div\n {...rest}\n ref={ref}\n className={cx(styles.card, className)}\n style={spacingStyle({ m, mt, mb, p, pb }, style)}\n />\n );\n});\n","import type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./ScrollArea.module.scss\";\n\n// Plain overflow container. ConfigurationPanel's scrollViewport() helper\n// queries [data-radix-scroll-area-viewport] and falls back to the element\n// itself — with this component the ref IS the viewport, so the fallback path\n// serves it (verified before migration).\nexport interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The scrollable content. */\n children?: ReactNode;\n}\n\n/**\n * A region that scrolls independently of the page, with the scrollbar styled\n * to match the dark surface rather than the browser default.\n *\n * Needs a bounded height from its parent or its context — without one there\n * is nothing to scroll against.\n */\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(function ScrollArea(\n { className, ...rest },\n ref,\n) {\n return <div {...rest} ref={ref} className={cx(styles.scrollArea, className)} />;\n});\n","/** Deterministic RNG + string hash, vendored from the source application (the only\n * consumer inside the library is SpaceButton's star speckle). Pure,\n * dependency-free, and part of no public API. */\nexport function mulberry32(a: number): () => number {\n return function () {\n a |= 0;\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** FNV-1a 32-bit string hash, for turning stable strings into seeds. */\nexport function hashString(s: string): number {\n let h = 0x811c9dc5;\n for (let i = 0; i < s.length; i++) {\n h ^= s.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return h >>> 0;\n}\n","\"use client\";\n\nimport { forwardRef, useId, useMemo } from \"react\";\nimport styles from \"./Button.module.scss\";\nimport { mulberry32, hashString } from \"../internal/seededRandom\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Circular, icon-only sizing (e.g. the share glyph). */\n iconOnly?: boolean;\n /** Warm red-dwarf rim for destructive-ish actions (e.g. Clear). */\n ember?: boolean;\n /** md = default. lg = hero CTAs. sm = compact dialog actions. micro = tiny steppers (no stars/glint). */\n size?: \"sm\" | \"md\" | \"lg\" | \"micro\";\n /** Stretch to the container width (sticky footers). */\n fullWidth?: boolean;\n /** Ambient motion: the orbiting rim, the glint sweep, and the twinkling\n * stars. Set false for dense UI or long lists where the movement\n * distracts. The glass look itself is not optional. Default true. */\n animated?: boolean;\n}\n\n\n/**\n * \"Limb-lit glass\" button: cosmic glass capsule whose rim glows like a planet's\n * sunlit atmosphere limb, with twinkling stars inside and a periodic glint\n * sweep. Plain <button>, so it composes with Radix Dialog.Trigger (Slot).\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button({ iconOnly, ember, size = \"md\", fullWidth, animated = true, className, children, ...rest }, ref) {\n const id = useId();\n\n // Unique-per-instance star field: positions and timing vary button to\n // button so the sparkles don't read as a repeated stamp.\n const starStyles = useMemo(() => {\n // Deterministic PRNG seeded from useId, so each button instance gets its\n // own star arrangement while server and client render identically (no\n // hydration mismatch, unlike Math.random in render).\n const rand = mulberry32(hashString(id));\n return Array.from({ length: 3 }, () => ({\n top: `${12 + rand() * 58}%`,\n left: `${8 + rand() * 80}%`,\n animationDelay: `${(rand() * 3.2).toFixed(2)}s`,\n animationDuration: `${(2.8 + rand() * 1.8).toFixed(2)}s`,\n }));\n }, [id]);\n\n const classes = [\n styles.spaceButton,\n iconOnly ? styles.iconOnly : \"\",\n ember ? styles.ember : \"\",\n size !== \"md\" ? styles[size] : \"\",\n fullWidth ? styles.fullWidth : \"\",\n className ?? \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <button\n ref={ref}\n className={classes}\n data-animated={animated ? undefined : \"false\"}\n {...rest}\n >\n {size !== \"micro\" && (\n <span className={styles.stars} aria-hidden>\n {starStyles.map((style, i) => (\n <i key={i} className={styles.star} style={style} />\n ))}\n </span>\n )}\n <span className={styles.label}>{children}</span>\n </button>\n );\n }\n);\n","\"use client\";\n\nimport { cx } from \"./propShared\";\nimport styles from \"./Loader.module.scss\";\n\nexport interface LoaderProps {\n /** sm = inline/compact spots. md = default. lg = full-panel takeovers. */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Visible caption under the spinner; also doubles as the accessible name. */\n label?: string;\n /** Merged onto the wrapper. */\n className?: string;\n}\n\n/**\n * Orbital spinner: a small pulsing \"planet\" disc at the center of a static\n * ring, with a \"moon\" dot traveling the ring. Dependency-free CSS animation\n * so it composes cleanly wherever a lazy chunk or async panel needs a\n * space-themed loading state (see SurfaceView's dynamic-import loader).\n */\nexport function Loader({ size = \"md\", label, className }: LoaderProps) {\n return (\n <div\n className={cx(styles.wrap, styles[size], className)}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={label ?? \"Loading\"}\n >\n <span className={styles.orbit}>\n <span className={styles.planet} />\n <span className={styles.moon} />\n </span>\n {label && <span className={styles.label}>{label}</span>}\n </div>\n );\n}\n","\"use client\";\n\n// Generic hover/focus tooltip for icon-only controls. Built on the same\n// native popover=\"auto\" top-layer pattern as ElementTooltip (and\n// DropdownMenu) rather than a library: Radix is gone from this app, and the\n// platform gives Escape/click-outside dismissal and top-layer stacking for\n// free — which matters here because these triggers sit over WebGL canvases\n// and inside their own stacking contexts.\n//\n// Deliberately NOT the native `title` attribute, which these controls used\n// before: the browser's own tooltip waits about a second, cannot be styled\n// to match the app, and never appears for keyboard users at all.\n\nimport {\n cloneElement, isValidElement, useEffect, useId, useLayoutEffect, useRef, useState,\n} from \"react\";\nimport styles from \"./Tooltip.module.scss\";\n\ninterface TooltipProps {\n /** The text to show. Nothing renders when this is empty. */\n label: string;\n /** Preferred side; flips automatically when there isn't room. */\n side?: \"top\" | \"bottom\";\n /** The element the tooltip describes. Receives the hover and focus\n * handlers, so it must accept a ref. */\n children: React.ReactElement;\n}\n\nconst SHOW_DELAY = 350;\nconst HIDE_DELAY = 80;\nconst SIDE_OFFSET = 8;\nconst COLLISION_PADDING = 8;\n\n// The clone lives in its own component so this scope never dereferences\n// triggerRef itself — the React Compiler flags a ref that is BOTH passed\n// into cloneElement's props and read in the same scope. Same split, and the\n// same reason, as ElementTooltip's TooltipTrigger.\ninterface TriggerProps {\n triggerRef: React.RefObject<HTMLElement | null>;\n tooltipId: string;\n show: (immediate?: boolean) => void;\n hide: () => void;\n children: React.ReactElement<Record<string, unknown>>;\n}\nfunction TooltipTrigger({ triggerRef, tooltipId, show, hide, children }: TriggerProps) {\n const p = children.props;\n return cloneElement(children, {\n ref: triggerRef,\n // Always present, so the id it points at never dangles: the content\n // element stays mounted and only toggles its popover state.\n \"aria-describedby\": tooltipId,\n onPointerEnter: (e: React.PointerEvent) => {\n (p.onPointerEnter as ((e: React.PointerEvent) => void) | undefined)?.(e);\n // Mouse only. A touch \"hover\" fires on tap, which would pop a tooltip\n // over the very control the user just pressed.\n if (e.pointerType === \"mouse\") show();\n },\n onPointerLeave: (e: React.PointerEvent) => {\n (p.onPointerLeave as ((e: React.PointerEvent) => void) | undefined)?.(e);\n hide();\n },\n // Keyboard focus shows it immediately — no hover delay to wait out.\n onFocus: (e: React.FocusEvent) => {\n (p.onFocus as ((e: React.FocusEvent) => void) | undefined)?.(e);\n show(true);\n },\n onBlur: (e: React.FocusEvent) => {\n (p.onBlur as ((e: React.FocusEvent) => void) | undefined)?.(e);\n hide();\n },\n // A tooltip must never outlive the action it describes: clicking the\n // control (expand, switch view) leaves it stranded over the new layout.\n onClick: (e: React.MouseEvent) => {\n (p.onClick as ((e: React.MouseEvent) => void) | undefined)?.(e);\n hide();\n },\n });\n}\n\n/**\n * A short label revealed on hover or focus, for naming a control whose icon\n * is not self-evident.\n *\n * Never put information here that a reader needs: a tooltip is unreachable on\n * touch and easy to miss. If it must be read, put it on the page.\n */\nexport function Tooltip({ label, side = \"bottom\", children }: TooltipProps) {\n const tooltipId = useId();\n const [open, setOpen] = useState(false);\n const [pos, setPos] = useState<{ top: number; left: number } | null>(null);\n const triggerRef = useRef<HTMLElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const showTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearTimers = () => {\n if (showTimer.current) { clearTimeout(showTimer.current); showTimer.current = null; }\n if (hideTimer.current) { clearTimeout(hideTimer.current); hideTimer.current = null; }\n };\n const show = (immediate = false) => {\n clearTimers();\n if (immediate) { setOpen(true); return; }\n showTimer.current = setTimeout(() => setOpen(true), SHOW_DELAY);\n };\n const hide = () => {\n clearTimers();\n hideTimer.current = setTimeout(() => setOpen(false), HIDE_DELAY);\n };\n\n useEffect(() => clearTimers, []);\n\n useLayoutEffect(() => {\n const content = contentRef.current;\n if (!content) return;\n if (!open) {\n if (content.matches(\":popover-open\")) content.hidePopover();\n return;\n }\n // Show before measuring: while display:none the offset sizes read 0 and\n // every clamp below would be computed against nothing.\n if (!content.matches(\":popover-open\")) content.showPopover();\n const trigger = triggerRef.current;\n if (!trigger) return;\n const r = trigger.getBoundingClientRect();\n const w = content.offsetWidth;\n const h = content.offsetHeight;\n\n // Flip to the other side when the preferred one has no room — these\n // controls sit in both the top row and the bottom action bar.\n const below = r.bottom + SIDE_OFFSET;\n const above = r.top - h - SIDE_OFFSET;\n const fitsBelow = below + h <= window.innerHeight - COLLISION_PADDING;\n const fitsAbove = above >= COLLISION_PADDING;\n const top = side === \"bottom\"\n ? (fitsBelow || !fitsAbove ? below : above)\n : (fitsAbove || !fitsBelow ? above : below);\n\n // Centred on the trigger, clamped inside the viewport.\n const left = Math.min(\n Math.max(r.left + r.width / 2 - w / 2, COLLISION_PADDING),\n Math.max(window.innerWidth - w - COLLISION_PADDING, COLLISION_PADDING),\n );\n setPos({ top, left });\n }, [open, side, label]);\n\n if (!label || !isValidElement(children)) return <>{children}</>;\n\n return (\n <>\n <TooltipTrigger\n triggerRef={triggerRef}\n tooltipId={tooltipId}\n show={show}\n hide={hide}\n >\n {children as React.ReactElement<Record<string, unknown>>}\n </TooltipTrigger>\n <div\n ref={contentRef}\n id={tooltipId}\n popover=\"auto\"\n role=\"tooltip\"\n className={styles.content}\n style={pos ? { top: pos.top, left: pos.left } : undefined}\n onToggle={(e: React.SyntheticEvent<HTMLDivElement>) => {\n if ((e.nativeEvent as ToggleEvent).newState === \"closed\" && open) setOpen(false);\n }}\n >\n {label}\n </div>\n </>\n );\n}\n","\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Tooltip } from \"./Tooltip\";\nimport styles from \"./IconToggle.module.scss\";\n\nexport interface IconToggleOption<V extends string> {\n value: V;\n icon: ReactNode;\n /** Used for aria-label and the hover tooltip. */\n label: string;\n}\n\n/**\n * A segmented icon toggle: every option is always visible in one pill, the\n * selected one reads as active, clicking any option selects it. Built for the\n * scene view switcher (planet / orrery / surface), where the old pattern —\n * showing only the views you are NOT on and swapping icons on click — made\n * the control's meaning flip under the cursor (owner: both icons should be\n * \"always visible, the selected one is the active one\"). Generic over the\n * option set so other icon-mode switchers can reuse it.\n */\nexport function IconToggle<V extends string>({\n options,\n value,\n onValueChange,\n className = \"\",\n}: {\n /** The segments, in display order. Every option is always visible —\n * this is a segmented control, not a menu.\n */\n options: IconToggleOption<V>[];\n /** The selected option's value. Fully controlled. */\n value: V;\n /** Called with the newly selected value. Not called when the already\n * selected option is clicked. */\n onValueChange(next: V): void;\n /** Merged onto the group wrapper. */\n className?: string;\n}) {\n return (\n <div className={`${styles.group} ${className}`} role=\"group\">\n {options.map((opt) => (\n // The pill sits at the top of the scene, so its tooltips hang below.\n <Tooltip key={opt.value} label={opt.label} side=\"bottom\">\n <button\n type=\"button\"\n className={`${styles.segment} ${opt.value === value ? styles.active : \"\"}`}\n aria-label={opt.label}\n aria-pressed={opt.value === value}\n onClick={() => {\n if (opt.value !== value) onValueChange(opt.value);\n }}\n >\n {opt.icon}\n </button>\n </Tooltip>\n ))}\n </div>\n );\n}\n","// The shared control-chrome class map — INTERNAL. Components apply this skin\n// themselves, so a consumer never composes it; it was a public subpath until\n// the skin became unconditional, which made every call site a no-op.\n//\n// Kept as a typed module rather than importing the SCSS directly, so a typo in\n// ctl.spaceInput is a compile error here rather than undefined at runtime.\nimport ctlModule from \"./spaceControls.module.scss\";\n\n/** Declared explicitly rather than inferred from the SCSS module, so the\n * emitted .d.ts stands alone: the .module.scss is not published, and a\n * consumer importing this subpath must not need it. Naming the keys also\n * means a typo at a call site is a type error instead of `undefined`. */\nexport interface SpaceControlClasses {\n spaceControl: string;\n spaceInput: string;\n spacePanel: string;\n spaceSlider: string;\n spaceTextArea: string;\n rimRotate: string;\n}\n\n// Through `unknown` because Vite types a CSS module as CSSModuleClasses —\n// an index signature, which TypeScript will not narrow straight to a named\n// interface. The names are checked against the SCSS by a test instead.\nconst ctl = ctlModule as unknown as SpaceControlClasses;\nexport default ctl;\n","// src/components/ui/Select.tsx\n// Compound Select matching the Radix JSX shape used by all 16 app sites\n// (Root/Trigger/Content/Item; single-select; 100% controlled). Native\n// engine: <button> trigger + an always-mounted hidden listbox, absolutely\n// positioned under the trigger (every styled site used position=\"popper\";\n// no site is inside a ScrollArea, so no portal is needed — and skipping the\n// portal keeps in-dialog Selects inside the dialog's stacking context).\n\"use client\";\nimport type * as React from \"react\";\nimport {\n Children, createContext, isValidElement, useCallback, useContext,\n useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type ReactNode,\n} from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Select.module.scss\";\nimport ctl from \"../styles/spaceControls\";\n\ninterface RootCtx {\n value: string;\n onValueChange: (v: string) => void;\n disabled?: boolean;\n open: boolean;\n setOpen: (o: boolean) => void;\n highlighted: string | null;\n setHighlighted: (v: string | null) => void;\n listboxId: string;\n values: string[];\n /** Every item's label, disabled included — used to size the trigger. */\n itemLabels: ReactNode[];\n labelFor: (v: string) => ReactNode;\n}\nconst Ctx = createContext<RootCtx | null>(null);\nconst useSelect = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"Select parts must be inside Select.Root\");\n return ctx;\n};\n\n// Shared id contract between the listbox's aria-activedescendant and each\n// Item's id. encodeURIComponent guards against values containing spaces or\n// other characters that aren't legal in an HTML id (every current call site\n// uses plain slugs/numbers, but this keeps the contract safe for any future\n// value).\nconst optionId = (listboxId: string, value: string) => `${listboxId}-${encodeURIComponent(value)}`;\n\n// The trigger ref travels through its own context, kept separate from\n// RootCtx above: a single context object mixing a ref field with plain\n// state fields makes every read of that object's OTHER fields look like a\n// render-time ref access to the react-hooks/refs lint rule, anywhere in the\n// component (not just the JSX using the ref) — this side-steps that.\nconst RefCtx = createContext<React.RefObject<HTMLButtonElement | null> | null>(null);\nconst useTriggerRef = () => {\n const ref = useContext(RefCtx);\n if (!ref) throw new Error(\"Select parts must be inside Select.Root\");\n return ref;\n};\n\n/** Pure render-time walk of <Content>'s children collecting Item values and\n * labels — no effects, so the trigger label is correct on first paint,\n * under SSR, and in renderToStaticMarkup tests. */\nfunction collectItems(children: ReactNode): Array<{ value: string; label: ReactNode; disabled?: boolean }> {\n const out: Array<{ value: string; label: ReactNode; disabled?: boolean }> = [];\n const walk = (nodes: ReactNode) => {\n Children.forEach(nodes, (child) => {\n if (!isValidElement(child)) return;\n const props = child.props as { value?: string; children?: ReactNode; disabled?: boolean };\n if (child.type === Item && typeof props.value === \"string\") {\n out.push({ value: props.value, label: props.children, disabled: props.disabled });\n } else if (props.children) {\n walk(props.children);\n }\n });\n };\n walk(children);\n return out;\n}\n\nexport interface RootProps {\n /** The selected item's value. Fully controlled. */\n value: string;\n /** Called with the newly selected value. */\n onValueChange: (v: string) => void;\n /** Blocks the trigger and removes it from the tab order. */\n disabled?: boolean;\n /** A Trigger and a Content. */\n children?: ReactNode;\n}\n\n/**\n * A single-choice menu for lists too long to show inline. Fully controlled.\n *\n * Reads its options at render time rather than through effects, so the\n * trigger shows the right label on first paint and under SSR.\n */\nexport function Root({ value, onValueChange, disabled, children }: RootProps) {\n const [open, setOpen] = useState(false);\n const [highlighted, setHighlighted] = useState<string | null>(null);\n const listboxId = useId();\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const rootRef = useRef<HTMLDivElement | null>(null);\n\n // Find the <Content> child and index its items at render time.\n const contentChildren = useMemo(() => {\n let found: ReactNode = null;\n Children.forEach(children, (child) => {\n if (isValidElement(child) && child.type === Content) {\n found = (child.props as { children?: ReactNode }).children;\n }\n });\n return found;\n }, [children]);\n const items = useMemo(() => collectItems(contentChildren), [contentChildren]);\n const values = useMemo(() => items.filter((i) => !i.disabled).map((i) => i.value), [items]);\n const itemLabels = useMemo(() => items.map((i) => i.label), [items]);\n const labelFor = useCallback(\n (v: string) => items.find((i) => i.value === v)?.label ?? null,\n [items],\n );\n\n // Light-dismiss: click outside closes.\n useEffect(() => {\n if (!open) return;\n const onDown = (e: MouseEvent) => {\n if (rootRef.current && !rootRef.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener(\"mousedown\", onDown);\n return () => document.removeEventListener(\"mousedown\", onDown);\n }, [open]);\n\n return (\n <Ctx.Provider\n value={{ value, onValueChange, disabled, open, setOpen, highlighted, setHighlighted, listboxId, values, itemLabels, labelFor }}\n >\n <RefCtx.Provider value={triggerRef}>\n <div ref={rootRef} className={styles.root}>\n {children}\n </div>\n </RefCtx.Provider>\n </Ctx.Provider>\n );\n}\n\nexport interface TriggerProps\n extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"value\"> {\n /** Shown when nothing is selected. Counts toward the trigger's width,\n * so selecting an option never resizes it.\n */\n placeholder?: string;\n /** Ambient motion: the lit arc orbiting the rim. The glass skin itself\n * is always applied. Default true. */\n animated?: boolean;\n}\n\n/**\n * The closed state of the Select, showing the selected item's own content.\n *\n * Sizes itself to its widest option, so it never changes width as you select\n * — capped by `--sp-select-trigger-max-width`, past which the label\n * ellipsizes.\n */\nexport function Trigger({ placeholder, animated = true, className, ...rest }: TriggerProps) {\n const s = useSelect();\n const triggerRef = useTriggerRef();\n const label = s.value ? s.labelFor(s.value) : null;\n const openWith = (highlight: string | null) => {\n s.setHighlighted(highlight ?? s.values[0] ?? null);\n s.setOpen(true);\n };\n return (\n <button\n type=\"button\"\n {...rest}\n ref={triggerRef}\n disabled={s.disabled}\n className={cx(styles.trigger, ctl.spaceControl, \"spSelectTrigger\", className)}\n data-animated={animated ? undefined : \"false\"}\n data-state={s.open ? \"open\" : \"closed\"}\n aria-haspopup=\"listbox\"\n aria-expanded={s.open}\n aria-controls={s.listboxId}\n onClick={() => (s.open ? s.setOpen(false) : openWith(s.value || null))}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\" || e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n openWith(s.value || null);\n }\n }}\n >\n {/* The visible label and a hidden copy of every option share one grid\n cell, so the button is as wide as its widest choice and never jumps\n width when the selection changes. Capped by\n --sp-select-trigger-max-width, past which the label ellipsizes. */}\n <span className={styles.labelWrap}>\n <span className={styles.sizer} data-sizer=\"\" aria-hidden=\"true\">\n {s.itemLabels.map((l, i) => (\n // eslint-disable-next-line react/no-array-index-key\n <span key={i}>{l}</span>\n ))}\n {placeholder && <span>{placeholder}</span>}\n </span>\n <span className={styles.triggerLabel}>{label ?? placeholder ?? \"\"}</span>\n </span>\n <svg className={styles.chevron} width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" aria-hidden=\"true\">\n <path d=\"M0.5 3 L4.5 7 L8.5 3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n </svg>\n </button>\n );\n}\n\nexport interface ContentProps {\n /** Merged with the panel's own classes. */\n className?: string;\n /** Accepted for Radix call-site compatibility (\"popper\" everywhere);\n * our listbox is always trigger-anchored. */\n position?: string;\n /** Ambient motion on the panel rim. Default true. */\n animated?: boolean;\n /** The Items. */\n children?: ReactNode;\n}\n\n/**\n * The option panel. Always mounted but hidden while closed, so the trigger\n * can read its labels for sizing.\n *\n * Never narrower than the trigger, and grows to fit the longest option so\n * labels only wrap when they truly must.\n */\nexport function Content({ className, position: _position, animated = true, children }: ContentProps) {\n const s = useSelect();\n const triggerRef = useTriggerRef();\n const listRef = useRef<HTMLDivElement | null>(null);\n const [triggerWidth, setTriggerWidth] = useState<number | null>(null);\n const [maxHeight, setMaxHeight] = useState<number | null>(null);\n\n // Measures the trigger's rendered width (and available vertical space\n // below it) to size the listbox. useLayoutEffect so the measurement is\n // applied before the browser paints the first open frame — a plain\n // useEffect flashes one frame with --_select-trigger-width unset.\n useLayoutEffect(() => {\n if (s.open && triggerRef.current) {\n const rect = triggerRef.current.getBoundingClientRect();\n setTriggerWidth(triggerRef.current.offsetWidth);\n // Clamp to the space between the trigger and the viewport bottom.\n // This is a partial mitigation, not a full fix: it keeps the listbox\n // from forcing extra scroll inside its own scrollable ancestor (e.g.\n // AuthModal's ~87-entry birth-year select), but a listbox inside a\n // dialog that's ALSO been scrolled can still have its trigger (and\n // thus this measurement) clipped by the dialog's own overflow before\n // this ever runs. Known QA follow-up on the birth-year select.\n const available = window.innerHeight - rect.bottom - 16;\n setMaxHeight(Math.min(380, Math.max(120, available)));\n }\n }, [s.open, triggerRef]);\n\n // Focus the listbox on open so arrow keys work immediately; return focus\n // to the trigger on close (checked against the in-dialog sites: Escape\n // must close the Select WITHOUT closing the surrounding Radix Dialog).\n useEffect(() => {\n if (s.open) listRef.current?.focus();\n }, [s.open]);\n\n const move = (delta: number) => {\n const idx = s.highlighted ? s.values.indexOf(s.highlighted) : -1;\n const next = Math.min(Math.max(idx + delta, 0), s.values.length - 1);\n s.setHighlighted(s.values[next] ?? null);\n };\n\n return (\n <div\n ref={listRef}\n id={s.listboxId}\n role=\"listbox\"\n tabIndex={-1}\n hidden={!s.open}\n aria-activedescendant={s.highlighted ? optionId(s.listboxId, s.highlighted) : undefined}\n className={cx(styles.listbox, ctl.spacePanel, className)}\n data-animated={animated ? undefined : \"false\"}\n style={\n triggerWidth != null || maxHeight != null\n ? ({\n ...(triggerWidth != null ? { \"--_select-trigger-width\": `${triggerWidth}px` } : {}),\n ...(maxHeight != null ? { maxHeight: `${maxHeight}px` } : {}),\n } as React.CSSProperties)\n : undefined\n }\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n e.stopPropagation(); // don't let an ancestor Dialog close too\n s.setOpen(false);\n triggerRef.current?.focus();\n } else if (e.key === \"ArrowDown\") { e.preventDefault(); move(1); }\n else if (e.key === \"ArrowUp\") { e.preventDefault(); move(-1); }\n else if (e.key === \"Home\") { e.preventDefault(); s.setHighlighted(s.values[0] ?? null); }\n else if (e.key === \"End\") { e.preventDefault(); s.setHighlighted(s.values[s.values.length - 1] ?? null); }\n else if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n if (s.highlighted) {\n s.onValueChange(s.highlighted);\n s.setOpen(false);\n triggerRef.current?.focus();\n }\n } else if (e.key === \"Tab\") {\n s.setOpen(false);\n }\n }}\n >\n {children}\n </div>\n );\n}\n\nexport interface ItemProps {\n /** Reported to onValueChange when chosen. */\n value: string;\n /** Skipped by keyboard navigation and not selectable. Still contributes\n * its width to the trigger's sizing. */\n disabled?: boolean;\n /** Shown in the panel and, once selected, in the trigger — so it has to\n * read correctly in both places. */\n children?: ReactNode;\n}\n\n/**\n * One option. Its children are what the trigger displays once selected, so\n * anything rendered here has to read correctly in both places.\n */\nexport function Item({ value, disabled, children }: ItemProps) {\n const s = useSelect();\n const triggerRef = useTriggerRef();\n const selected = s.value === value;\n const highlighted = s.highlighted === value;\n return (\n <div\n id={optionId(s.listboxId, value)}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={disabled || undefined}\n data-highlighted={highlighted ? \"\" : undefined}\n className={cx(styles.item, \"spSelectItem\")}\n onMouseEnter={() => !disabled && s.setHighlighted(value)}\n onClick={() => {\n if (disabled) return;\n s.onValueChange(value);\n s.setOpen(false);\n triggerRef.current?.focus();\n }}\n >\n {children}\n </div>\n );\n}\n","\"use client\";\nimport type * as React from \"react\";\nimport { forwardRef, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./TextField.module.scss\";\nimport ctl from \"../styles/spaceControls\";\n\nexport interface RootProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"className\" | \"style\"> {\n /** Merged onto the field wrapper, not the inner input. */\n className?: string;\n /** Ambient motion on the rim. The glass skin is always applied.\n * Default true. */\n animated?: boolean;\n /** Applied to the field wrapper — set width here. */\n style?: React.CSSProperties;\n /** Slots rendered inside the field, alongside the input. */\n children?: ReactNode; // Slot(s)\n}\n\n/**\n * Single-line text entry. Composed as a Root so slots can sit alongside the\n * input inside the same field surface.\n *\n * Props land on the inner input, so `value`, `onChange` and the rest behave\n * as they would on a bare input.\n */\nexport const Root = forwardRef<HTMLInputElement, RootProps>(function Root(\n { className, style, animated = true, children, ...inputProps },\n ref,\n) {\n return (\n <div\n className={cx(styles.root, ctl.spaceInput, \"spTextFieldRoot\", className)}\n data-animated={animated ? undefined : \"false\"}\n style={style}\n >\n {children}\n <input {...inputProps} ref={ref} className={cx(styles.input, \"spTextFieldInput\")} />\n </div>\n );\n});\n\n/**\n * A fixed element inside the field, before or after the input — an icon, a\n * unit, a short affordance. Sits within the field's surface rather than\n * beside it, and does not shrink as the input fills.\n */\nexport function Slot({\n children,\n}: {\n /** The slot's contents — an icon, a unit, a short affordance. */\n children?: ReactNode;\n}) {\n return <span className={styles.slot}>{children}</span>;\n}\n","\"use client\";\nimport type * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./TextArea.module.scss\";\nimport ctl from \"../styles/spaceControls\";\n\nexport interface TextAreaProps\n extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"className\" | \"style\"> {\n /** Merged onto the field wrapper, not the inner textarea. */\n className?: string;\n /** Ambient motion on the rim. The glass skin is always applied.\n * Default true. */\n animated?: boolean;\n /** Applied to the field wrapper — set width here. */\n style?: React.CSSProperties;\n}\n\n/**\n * Multi-line text entry. `rows` sets the initial height; it grows with its\n * container's width and resizes vertically only, since horizontal drag would\n * break the surrounding layout.\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n { className, style, animated = true, ...rest },\n ref,\n) {\n return (\n <div\n className={cx(styles.root, ctl.spaceInput, ctl.spaceTextArea, \"spTextFieldRoot\", className)}\n data-animated={animated ? undefined : \"false\"}\n style={style}\n >\n <textarea {...rest} ref={ref} className={cx(styles.textarea, \"spTextAreaInput\")} />\n </div>\n );\n});\n","\"use client\";\nimport type * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Slider.module.scss\";\nimport ctl from \"../styles/spaceControls\";\n\nexport interface SliderProps {\n /** Current value, as a single-element array. Fully controlled. */\n value: number[];\n /** Called with the new value array as the thumb moves. */\n onValueChange: (v: number[]) => void;\n /** Lower bound. */\n min: number;\n /** Upper bound. */\n max: number;\n /** Smallest increment the thumb can move by. */\n step: number;\n /** Blocks interaction and removes it from the tab order. */\n disabled?: boolean;\n /** Merged onto the wrapper. */\n className?: string;\n /** Accessible name. Required unless a visible label references it,\n * since a slider has no text of its own.\n */\n \"aria-label\"?: string;\n}\n\n/**\n * A range control for a continuous value.\n *\n * Takes and returns an array so multiple thumbs can be added later without a\n * breaking change, even though it renders one today.\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n { value, onValueChange, min, max, step, disabled, className, \"aria-label\": ariaLabel },\n ref,\n) {\n const v = value[0] ?? min;\n const pct = max === min ? 0 : ((v - min) / (max - min)) * 100;\n return (\n <span className={cx(styles.root, ctl.spaceSlider, className)} data-disabled={disabled || undefined}>\n <span className={cx(styles.track, \"spSliderTrack\")}>\n <span className={cx(styles.range, \"spSliderRange\")} style={{ width: `${pct}%` }} />\n </span>\n <span className={cx(styles.thumb, \"spSliderThumb\")} style={{ left: `${pct}%` }} />\n <input\n ref={ref}\n type=\"range\"\n className={cx(styles.input, \"spSliderInput\")}\n value={v}\n min={min}\n max={max}\n step={step}\n disabled={disabled}\n aria-label={ariaLabel}\n onChange={(e) => onValueChange([Number(e.target.value)])}\n />\n </span>\n );\n});\n","\"use client\";\nimport type * as React from \"react\";\nimport { createContext, useContext, useId, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./RadioGroup.module.scss\";\n\ninterface GroupCtx {\n value: string;\n onValueChange: (v: string) => void;\n disabled?: boolean;\n name: string;\n}\nconst Ctx = createContext<GroupCtx | null>(null);\n\nexport interface RootProps {\n /** The selected item's value. Fully controlled. */\n value: string;\n /** Called with the newly selected value. */\n onValueChange: (v: string) => void;\n /** Disables every item at once. */\n disabled?: boolean;\n /** Merged onto the group wrapper. */\n className?: string;\n /** The Items. */\n children?: ReactNode;\n}\n\n/**\n * A single-choice control for short lists, where seeing every option at once\n * matters more than saving space. Reach for Select when it does not.\n */\nexport function Root({ value, onValueChange, disabled, className, children }: RootProps) {\n const name = useId();\n return (\n <Ctx.Provider value={{ value, onValueChange, disabled, name }}>\n <div role=\"radiogroup\" className={cx(styles.root, className)}>\n {children}\n </div>\n </Ctx.Provider>\n );\n}\n\nexport interface ItemProps {\n /** Reported to the group's onValueChange when chosen. */\n value: string;\n /** Disables this option only. */\n disabled?: boolean;\n /** The option's label. Part of the click target, not merely beside it. */\n children?: ReactNode;\n}\n\n/** With children: self-labeling (<label> wraps input+orb+children) — the\n * SaveShareDialog pattern. Without children: emits a bare span so an\n * OUTER label (ConfigurationPanel's <Text as=\"label\">) owns association —\n * nesting labels would be invalid HTML. */\nexport function Item({ value, disabled, children }: ItemProps) {\n const g = useContext(Ctx);\n if (!g) throw new Error(\"RadioGroup.Item must be inside RadioGroup.Root\");\n const isDisabled = disabled || g.disabled;\n const control = (\n <>\n <input\n type=\"radio\"\n className={styles.input}\n name={g.name}\n value={value}\n checked={g.value === value}\n disabled={isDisabled}\n onChange={() => g.onValueChange(value)}\n />\n <span className={cx(styles.orb, \"spRadioOrb\")} aria-hidden=\"true\" />\n </>\n );\n if (children === undefined || children === null) {\n return <span className={styles.item}>{control}</span>;\n }\n return (\n <label className={cx(styles.item, styles.selfLabeled)}>\n {control}\n {children}\n </label>\n );\n}\n","\"use client\";\nimport type * as React from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Progress.module.scss\";\n\nexport interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Current progress, clamped between 0 and `max`. */\n value: number;\n /** The value representing complete. */\n max?: number;\n}\n\n/**\n * A determinate bar for work you can measure — use Loader when you cannot.\n *\n * Speaks the same visual language as Slider, because a progress bar and a\n * slider track are the same object: one you watch, one you drag.\n */\nexport function Progress({ value, max = 100, className, style, ...rest }: ProgressProps) {\n const pct = max > 0 ? Math.min(Math.max((value / max) * 100, 0), 100) : 0;\n return (\n <div\n {...rest}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n className={cx(styles.progress, className)}\n style={style}\n >\n {/* Unclassed on purpose: a consumer can target `.progress > div`\n without knowing the hashed module class. */}\n <div style={{ width: `${pct}%`, height: \"100%\" }} />\n </div>\n );\n}\n","// The 17 icons this app uses, ported verbatim from @radix-ui/react-icons\n// (MIT License — Copyright (c) 2022 WorkOS; https://github.com/radix-ui/icons).\n// Uniform 15x15 viewBox, currentColor, decorative by default (aria-hidden) —\n// pass aria-label + aria-hidden={undefined} for semantic uses.\nimport type * as React from \"react\";\n\nexport type IconProps = React.SVGAttributes<SVGSVGElement>;\n\nconst base = {\n width: 15,\n height: 15,\n viewBox: \"0 0 15 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": true,\n} as const;\n\nexport function Share2Icon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3.5 5.00006C3.22386 5.00006 3 5.22392 3 5.50006L3 11.5001C3 11.7762 3.22386 12.0001 3.5 12.0001L11.5 12.0001C11.7761 12.0001 12 11.7762 12 11.5001L12 5.50006C12 5.22392 11.7761 5.00006 11.5 5.00006L10.25 5.00006C9.97386 5.00006 9.75 4.7762 9.75 4.50006C9.75 4.22392 9.97386 4.00006 10.25 4.00006L11.5 4.00006C12.3284 4.00006 13 4.67163 13 5.50006L13 11.5001C13 12.3285 12.3284 13.0001 11.5 13.0001L3.5 13.0001C2.67157 13.0001 2 12.3285 2 11.5001L2 5.50006C2 4.67163 2.67157 4.00006 3.5 4.00006L4.75 4.00006C5.02614 4.00006 5.25 4.22392 5.25 4.50006C5.25 4.7762 5.02614 5.00006 4.75 5.00006L3.5 5.00006ZM7 1.6364L5.5682 3.0682C5.39246 3.24393 5.10754 3.24393 4.9318 3.0682C4.75607 2.89246 4.75607 2.60754 4.9318 2.4318L7.1818 0.181802C7.26619 0.09741 7.38065 0.049999 7.5 0.049999C7.61935 0.049999 7.73381 0.09741 7.8182 0.181802L10.0682 2.4318C10.2439 2.60754 10.2439 2.89246 10.0682 3.0682C9.89246 3.24393 9.60754 3.24393 9.4318 3.0682L8 1.6364L8 8.5C8 8.77614 7.77614 9 7.5 9C7.22386 9 7 8.77614 7 8.5L7 1.6364Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChatBubbleIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M12.5 3L2.5 3.00002C1.67157 3.00002 1 3.6716 1 4.50002V9.50003C1 10.3285 1.67157 11 2.5 11H7.50003C7.63264 11 7.75982 11.0527 7.85358 11.1465L10 13.2929V11.5C10 11.2239 10.2239 11 10.5 11H12.5C13.3284 11 14 10.3285 14 9.50003V4.5C14 3.67157 13.3284 3 12.5 3ZM2.49999 2.00002L12.5 2C13.8807 2 15 3.11929 15 4.5V9.50003C15 10.8807 13.8807 12 12.5 12H11V14.5C11 14.7022 10.8782 14.8845 10.6913 14.9619C10.5045 15.0393 10.2894 14.9965 10.1464 14.8536L7.29292 12H2.5C1.11929 12 0 10.8807 0 9.50003V4.50002C0 3.11931 1.11928 2.00003 2.49999 2.00002Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function PlusIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function Pencil1Icon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M11.8536 1.14645C11.6583 0.951184 11.3417 0.951184 11.1465 1.14645L3.71455 8.57836C3.62459 8.66832 3.55263 8.77461 3.50251 8.89155L2.04044 12.303C1.9599 12.491 2.00189 12.709 2.14646 12.8536C2.29103 12.9981 2.50905 13.0401 2.69697 12.9596L6.10847 11.4975C6.2254 11.4474 6.3317 11.3754 6.42166 11.2855L13.8536 3.85355C14.0488 3.65829 14.0488 3.34171 13.8536 3.14645L11.8536 1.14645ZM4.42166 9.28547L11.5 2.20711L12.7929 3.5L5.71455 10.5784L4.21924 11.2192L3.78081 10.7808L4.42166 9.28547Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function HeartFilledIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M1.35248 4.90532C1.35248 2.94498 2.936 1.35248 4.89346 1.35248C6.25769 1.35248 6.86058 1.92336 7.50002 2.93545C8.13946 1.92336 8.74235 1.35248 10.1066 1.35248C12.064 1.35248 13.6476 2.94498 13.6476 4.90532C13.6476 6.74041 12.6013 8.50508 11.4008 9.96927C10.2636 11.3562 8.92194 12.5508 8.00601 13.3664C7.94645 13.4194 7.88869 13.4709 7.83291 13.5206C7.64324 13.6899 7.3568 13.6899 7.16713 13.5206C7.11135 13.4709 7.05359 13.4194 6.99403 13.3664C6.0781 12.5508 4.73641 11.3562 3.59926 9.96927C2.39872 8.50508 1.35248 6.74041 1.35248 4.90532Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ExitFullScreenIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M5.5 2C5.77614 2 6 2.22386 6 2.5V5.5C6 5.77614 5.77614 6 5.5 6H2.5C2.22386 6 2 5.77614 2 5.5C2 5.22386 2.22386 5 2.5 5H5V2.5C5 2.22386 5.22386 2 5.5 2ZM9.5 2C9.77614 2 10 2.22386 10 2.5V5H12.5C12.7761 5 13 5.22386 13 5.5C13 5.77614 12.7761 6 12.5 6H9.5C9.22386 6 9 5.77614 9 5.5V2.5C9 2.22386 9.22386 2 9.5 2ZM2 9.5C2 9.22386 2.22386 9 2.5 9H5.5C5.77614 9 6 9.22386 6 9.5V12.5C6 12.7761 5.77614 13 5.5 13C5.22386 13 5 12.7761 5 12.5V10H2.5C2.22386 10 2 9.77614 2 9.5ZM9 9.5C9 9.22386 9.22386 9 9.5 9H12.5C12.7761 9 13 9.22386 13 9.5C13 9.77614 12.7761 10 12.5 10H10V12.5C10 12.7761 9.77614 13 9.5 13C9.22386 13 9 12.7761 9 12.5V9.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function EnterFullScreenIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M2 2.5C2 2.22386 2.22386 2 2.5 2H5.5C5.77614 2 6 2.22386 6 2.5C6 2.77614 5.77614 3 5.5 3H3V5.5C3 5.77614 2.77614 6 2.5 6C2.22386 6 2 5.77614 2 5.5V2.5ZM9 2.5C9 2.22386 9.22386 2 9.5 2H12.5C12.7761 2 13 2.22386 13 2.5V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3H9.5C9.22386 3 9 2.77614 9 2.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H2.5C2.22386 13 2 12.7761 2 12.5V9.5C2 9.22386 2.22386 9 2.5 9ZM12.5 9C12.7761 9 13 9.22386 13 9.5V12.5C13 12.7761 12.7761 13 12.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H12V9.5C12 9.22386 12.2239 9 12.5 9Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function CheckIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function TrashIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function QuestionMarkCircledIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function PersonIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M7.5 0.875C5.49797 0.875 3.875 2.49797 3.875 4.5C3.875 6.15288 4.98124 7.54738 6.49373 7.98351C5.2997 8.12901 4.27557 8.55134 3.50407 9.31167C2.52216 10.2794 2.02502 11.72 2.02502 13.5999C2.02502 13.8623 2.23769 14.0749 2.50002 14.0749C2.76236 14.0749 2.97502 13.8623 2.97502 13.5999C2.97502 11.8799 3.42786 10.7206 4.17091 9.9883C4.91536 9.25463 6.02674 8.87499 7.49995 8.87499C8.97317 8.87499 10.0846 9.25463 10.8291 9.98831C11.5721 10.7206 12.025 11.8799 12.025 13.5999C12.025 13.8623 12.2376 14.0749 12.5 14.0749C12.7623 14.075 12.975 13.8623 12.975 13.6C12.975 11.72 12.4778 10.2794 11.4959 9.31166C10.7244 8.55135 9.70025 8.12903 8.50625 7.98352C10.0187 7.5474 11.125 6.15289 11.125 4.5C11.125 2.49797 9.50203 0.875 7.5 0.875ZM4.825 4.5C4.825 3.02264 6.02264 1.825 7.5 1.825C8.97736 1.825 10.175 3.02264 10.175 4.5C10.175 5.97736 8.97736 7.175 7.5 7.175C6.02264 7.175 4.825 5.97736 4.825 4.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function MinusIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M2.25 7.5C2.25 7.22386 2.47386 7 2.75 7H12.25C12.5261 7 12.75 7.22386 12.75 7.5C12.75 7.77614 12.5261 8 12.25 8H2.75C2.47386 8 2.25 7.77614 2.25 7.5Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function MagnifyingGlassIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function HeartIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M4.89346 2.35248C3.49195 2.35248 2.35248 3.49359 2.35248 4.90532C2.35248 6.38164 3.20954 7.9168 4.37255 9.33522C5.39396 10.581 6.59464 11.6702 7.50002 12.4778C8.4054 11.6702 9.60608 10.581 10.6275 9.33522C11.7905 7.9168 12.6476 6.38164 12.6476 4.90532C12.6476 3.49359 11.5081 2.35248 10.1066 2.35248C9.27059 2.35248 8.81894 2.64323 8.5397 2.95843C8.27877 3.25295 8.14623 3.58566 8.02501 3.88993C8.00391 3.9429 7.98315 3.99501 7.96211 4.04591C7.88482 4.23294 7.7024 4.35494 7.50002 4.35494C7.29765 4.35494 7.11523 4.23295 7.03793 4.04592C7.01689 3.99501 6.99612 3.94289 6.97502 3.8899C6.8538 3.58564 6.72126 3.25294 6.46034 2.95843C6.18109 2.64323 5.72945 2.35248 4.89346 2.35248ZM1.35248 4.90532C1.35248 2.94498 2.936 1.35248 4.89346 1.35248C6.0084 1.35248 6.73504 1.76049 7.20884 2.2953C7.32062 2.42147 7.41686 2.55382 7.50002 2.68545C7.58318 2.55382 7.67941 2.42147 7.79119 2.2953C8.265 1.76049 8.99164 1.35248 10.1066 1.35248C12.064 1.35248 13.6476 2.94498 13.6476 4.90532C13.6476 6.74041 12.6013 8.50508 11.4008 9.96927C10.2636 11.3562 8.92194 12.5508 8.00601 13.3664C7.94645 13.4194 7.88869 13.4709 7.83291 13.5206C7.64324 13.6899 7.3568 13.6899 7.16713 13.5206C7.11135 13.4709 7.05359 13.4194 6.99403 13.3664C6.0781 12.5508 4.73641 11.3562 3.59926 9.96927C2.39872 8.50508 1.35248 6.74041 1.35248 4.90532Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChevronUpIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChevronDownIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** The house directional chevrons (Radix geometry, matching Up/Down above).\n * These replaced the typographic arrows: a text glyph's shape is whatever the\n * viewer's font decides, and the owner called the result poorly shaped. Used\n * by every \"onward\" CTA and \"back\" button. */\nexport function ChevronRightIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M6.1584 3.13508C5.95694 3.32394 5.94673 3.64036 6.13559 3.84182L9.56499 7.49991L6.13559 11.158C5.94673 11.3595 5.95694 11.6759 6.1584 11.8647C6.35986 12.0536 6.67628 12.0434 6.86514 11.8419L10.6151 7.84182C10.7954 7.64946 10.7954 7.35036 10.6151 7.158L6.86514 3.15801C6.67628 2.95655 6.35986 2.94634 6.1584 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ChevronLeftIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M8.84182 3.13508C9.04328 3.32394 9.05348 3.64036 8.86462 3.84182L5.43523 7.49991L8.86462 11.158C9.05348 11.3595 9.04328 11.6759 8.84182 11.8647C8.64036 12.0536 8.32394 12.0434 8.13508 11.8419L4.38508 7.84182C4.20477 7.64946 4.20477 7.35036 4.38508 7.158L8.13508 3.15801C8.32394 2.95655 8.64036 2.94634 8.84182 3.13508Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function BookmarkIcon(props: IconProps) {\n return (\n <svg {...base} {...props}>\n <path\n d=\"M3 2.5C3 2.22386 3.22386 2 3.5 2H11.5C11.7761 2 12 2.22386 12 2.5V13.5C12 13.6818 11.9014 13.8492 11.7424 13.9373C11.5834 14.0254 11.3891 14.0203 11.235 13.924L7.5 11.5896L3.765 13.924C3.61087 14.0203 3.41659 14.0254 3.25762 13.9373C3.09864 13.8492 3 13.6818 3 13.5V2.5ZM4 3V12.5979L6.97 10.7416C7.29427 10.539 7.70573 10.539 8.03 10.7416L11 12.5979V3H4Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n </svg>\n );\n}\n\n/** Dialog dismiss glyph — a plain X, used by Dialog.Content's corner button. */\nexport function XIcon(props: IconProps) {\n return (\n <svg viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"15\" {...props}>\n <path\n d=\"M11.8 3.2a.6.6 0 0 0-.85 0L7.5 6.65 4.05 3.2a.6.6 0 1 0-.85.85L6.65 7.5 3.2 10.95a.6.6 0 1 0 .85.85L7.5 8.35l3.45 3.45a.6.6 0 0 0 .85-.85L8.35 7.5l3.45-3.45a.6.6 0 0 0 0-.85Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n","// src/components/ui/Dialog.tsx\n// Compound Dialog matching the Radix JSX shape on a native <dialog>:\n// top-layer stacking (nested/stacked dialogs work), built-in focus trap and\n// focus return, Esc via the `cancel` event. Both controlled (open/\n// onOpenChange) and Trigger-driven uncontrolled sites are supported — the\n// inventory has both. Esc handoff with the in-house Select: a capture-phase\n// keydown checks for an open listbox inside the dialog and flags the next\n// `cancel` to be swallowed, so one Esc closes the Select, the next closes\n// the dialog (matching the Radix-era behavior sites were built against).\n\"use client\";\nimport type * as React from \"react\";\nimport { XIcon } from \"./icons\";\nimport {\n cloneElement, createContext, isValidElement, useContext, useEffect,\n useId, useLayoutEffect, useRef, useState, type ReactNode,\n} from \"react\";\nimport { cx } from \"./propShared\";\nimport { Heading, type HeadingProps } from \"./Heading\";\nimport { Text, type TextProps } from \"./Text\";\nimport styles from \"./Dialog.module.scss\";\n\n// Body scroll-lock reference count, shared across every mounted Content\n// instance (module scope, not per-instance state) — Dialog and AlertDialog\n// stack on top of one another, and per-instance prev-capture couldn't tell\n// \"I'm the last one closing\" from \"another instance is still open\" when\n// unmounts land out of open-order. A plain 0→1 / 1→0 edge count is\n// order-proof: overflow is locked exactly while count > 0, regardless of\n// which instance opened or closed first.\nlet lockCount = 0;\n\nexport interface DialogCtx {\n open: boolean;\n setOpen: (o: boolean) => void;\n titleId: string;\n descId: string;\n /** alert dialogs: no backdrop light-dismiss */\n alert?: boolean;\n /** whether a Description is currently mounted (drives aria-describedby) */\n hasDesc: boolean;\n setHasDesc: (v: boolean) => void;\n}\nconst Ctx = createContext<DialogCtx | null>(null);\nexport const useDialog = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"Dialog parts must be inside Dialog.Root\");\n return ctx;\n};\n\nexport interface RootProps {\n /** Controls the dialog. Omit both this and onOpenChange to let the dialog\n * manage its own state. */\n open?: boolean;\n /** Called whenever the dialog opens or closes, including via Escape or a\n * backdrop click. */\n onOpenChange?: (o: boolean) => void;\n /** A Trigger and a Content. */\n children?: ReactNode;\n}\n\n/** Shared by Dialog.Root and AlertDialog.Root (alert flag differs). */\nexport function makeRoot(alert: boolean) {\n return function Root({ open, onOpenChange, children }: RootProps) {\n const [internal, setInternal] = useState(false);\n const isControlled = open !== undefined;\n const actual = isControlled ? open : internal;\n const setOpen = (o: boolean) => {\n if (!isControlled) setInternal(o);\n onOpenChange?.(o);\n };\n const titleId = useId();\n const descId = useId();\n const [hasDesc, setHasDesc] = useState(false);\n return (\n <Ctx.Provider value={{ open: actual, setOpen, titleId, descId, alert, hasDesc, setHasDesc }}>\n {children}\n </Ctx.Provider>\n );\n };\n}\n/**\n * Owns a dialog's open state. Works controlled via `open`/`onOpenChange`, or\n * uncontrolled if you pass neither.\n *\n * Renders nothing itself — it only provides context, so Trigger and Content\n * can sit anywhere beneath it in the tree.\n */\nexport const Root = makeRoot(false);\n\ntype Clickable = React.ReactElement<{ onClick?: (e: React.MouseEvent) => void }>;\nconst chainOpen = (child: ReactNode, fn: () => void): ReactNode => {\n if (!isValidElement(child)) return child;\n const c = child as Clickable;\n return cloneElement(c, {\n onClick: (e: React.MouseEvent) => { c.props.onClick?.(e); fn(); },\n });\n};\n\n/**\n * Opens the dialog. Chains onto its child's existing click handler rather\n * than replacing it, and renders no element of its own — so the child stays\n * whatever it already was, button or otherwise.\n */\nexport function Trigger({\n children,\n}: {\n /** The control that opens the dialog. Its own onClick still fires. */\n children?: ReactNode;\n}) {\n const d = useDialog();\n return <>{chainOpen(children, () => d.setOpen(true))}</>;\n}\n\n/**\n * Closes the dialog. Same shape as Trigger: wraps its child, adds a close on\n * click, and adds no markup.\n */\nexport function Close({\n children,\n}: {\n /** The control that closes the dialog. Its own onClick still fires. */\n children?: ReactNode;\n}) {\n const d = useDialog();\n return <>{chainOpen(children, () => d.setOpen(false))}</>;\n}\n\nexport interface ContentProps extends React.HTMLAttributes<HTMLDialogElement> {\n /** Padding and radius step. 4 is roomier, for dialogs carrying a form. */\n size?: \"3\" | \"4\";\n /** Caps the dialog's width, e.g. \"480px\". Without it the dialog uses its\n * own default and grows with its content. */\n maxWidth?: string;\n /** Dialog contents. Include a Title — it is the accessible name. */\n children?: ReactNode;\n}\n\n/**\n * The dialog surface. Built on the native `<dialog>` element, so the browser\n * supplies the top layer, focus trapping and Escape handling rather than the\n * library reimplementing them.\n *\n * Dismissible by Escape or a click on the backdrop; AlertDialog's Content\n * deliberately is not.\n */\nexport function Content({ size = \"3\", maxWidth, className, style, children, ...rest }: ContentProps) {\n const d = useDialog();\n const ref = useRef<HTMLDialogElement | null>(null);\n const swallowCancel = useRef(false);\n // Backdrop dismissal must require BOTH the mousedown/pointerdown AND the\n // click to land on the backdrop (the <dialog> element itself, not the\n // inner content wrapper) — otherwise a text-selection drag that starts in\n // the content and ends up released over the backdrop would close the\n // dialog on mouseup even though the gesture began inside it.\n const pointerDownOnBackdrop = useRef(false);\n\n // Imperative <dialog> API follows the declarative open prop (handles the\n // delayed first open of AccountsIntroModal's 900ms timer too).\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n if (d.open && !el.open) el.showModal();\n else if (!d.open && el.open) el.close();\n }, [d.open]);\n\n // Body scroll lock while open (Radix did this; panels behind rely on it).\n // Module-level counter (see `lockCount` above) so stacked dialogs compose:\n // only the 0→1 transition locks, only the 1→0 transition unlocks.\n useEffect(() => {\n if (!d.open) return;\n lockCount += 1;\n if (lockCount === 1) document.body.style.overflow = \"hidden\";\n return () => {\n lockCount -= 1;\n if (lockCount === 0) document.body.style.overflow = \"\";\n };\n }, [d.open]);\n\n return (\n <dialog\n {...rest}\n ref={ref}\n role={d.alert ? \"alertdialog\" : undefined}\n aria-labelledby={d.titleId}\n aria-describedby={d.hasDesc ? d.descId : undefined}\n className={cx(styles.dialog, \"spDialog\", size === \"4\" && styles.size4, className)}\n style={{ ...(maxWidth ? { maxWidth } : null), ...style }}\n onKeyDownCapture={(e) => {\n if (e.key !== \"Escape\") return;\n // A nested dialog is open inside this one (e.g. an AlertDialog\n // launched from this dialog's content) — that inner dialog owns\n // this Esc; don't let the outer one arm its own swallow logic on\n // an event that's about to close a dialog it isn't itself.\n if (ref.current?.querySelector(\"dialog[open]\")) return;\n // Esc while an in-house Select's listbox is open inside this dialog:\n // the Select closes itself; swallow the dialog's own cancel.\n if (ref.current?.querySelector('[role=\"listbox\"]:not([hidden])')) {\n swallowCancel.current = true;\n }\n }}\n onCancel={(e) => {\n e.preventDefault(); // we route ALL closes through React state\n if (swallowCancel.current) { swallowCancel.current = false; return; }\n d.setOpen(false);\n }}\n onClose={() => {\n // Belt-and-suspenders: any UA-initiated close we didn't route\n // through onCancel (a non-cancelable close request, or a future\n // method=\"dialog\" form submission inside the content) still fires\n // `close`. Resync React state so `open` doesn't get stranded true\n // while the native element is actually closed.\n if (d.open) d.setOpen(false);\n }}\n onPointerDown={(e) => {\n pointerDownOnBackdrop.current = e.target === ref.current;\n }}\n onClick={(e) => {\n // Backdrop click = clicking the <dialog> element itself (the inner\n // wrapper covers the content area). Alert dialogs don't light-dismiss.\n // Require the pointerdown that started this click to have also\n // landed on the backdrop, so a text-selection drag from the content\n // out to the backdrop doesn't close the dialog on release.\n if (!d.alert && e.target === ref.current && pointerDownOnBackdrop.current) d.setOpen(false);\n }}\n >\n <div className={styles.inner}>\n {/* Every dialog gets the same dismiss affordance in the same place.\n Alert dialogs are excluded on purpose: they ask a question that\n wants an explicit answer, and a corner X is an ambiguous one. */}\n {!d.alert && (\n <button\n type=\"button\"\n className={styles.closeX}\n aria-label=\"Close\"\n onClick={() => d.setOpen(false)}\n >\n <XIcon width={16} height={16} />\n </button>\n )}\n {children}\n </div>\n </dialog>\n );\n}\n\n/**\n * The dialog's accessible name. Wire one up for every dialog — it is what a\n * screen reader announces when the dialog opens.\n */\nexport function Title({ className, ...rest }: HeadingProps) {\n const d = useDialog();\n return <Heading as=\"h2\" size=\"5\" {...rest} id={d.titleId} className={cx(styles.title, className)} />;\n}\n\n/**\n * Supporting copy beneath the title, registered as the dialog's accessible\n * description. Optional, and only announced when present.\n */\nexport function Description(props: TextProps) {\n const d = useDialog();\n // aria-describedby on Content is conditional on a Description actually\n // being mounted (some dialogs render none), so Content can't just point\n // at descId unconditionally. Register/unregister via a layout effect —\n // runs before paint, and Description mounts synchronously with the\n // dialog's content, so there's no visible flash of a missing attribute.\n // Depend on setHasDesc alone (a stable useState setter), not the whole\n // `d` context object — that object is a fresh literal every Root render,\n // so depending on it would re-fire this effect (and its cleanup) on\n // every render instead of just mount/unmount.\n const { setHasDesc } = d;\n useLayoutEffect(() => {\n setHasDesc(true);\n return () => setHasDesc(false);\n }, [setHasDesc]);\n return <Text as=\"p\" {...props} id={d.descId} />;\n}\n","// src/components/ui/AlertDialog.tsx\n// Same native-<dialog> engine with alertdialog semantics: role=\"alertdialog\",\n// NO backdrop light-dismiss (spec), and sites render Cancel before Action so\n// showModal()'s first-focusable initial focus lands on Cancel (spec).\n\"use client\";\nimport {\n makeRoot, Trigger as DialogTrigger, Close as DialogClose,\n Content as DialogContent, Title as DialogTitle, Description as DialogDescription,\n} from \"./Dialog\";\n\nexport const Root = makeRoot(true);\nexport const Trigger = DialogTrigger;\nexport const Content = DialogContent;\nexport const Title = DialogTitle;\nexport const Description = DialogDescription;\nexport const Cancel = DialogClose;\n// Close chains the child's own onClick (the destructive handler) BEFORE\n// closing — exactly AlertDialog.Action's Radix contract. Distinct export so\n// call sites keep their names.\nexport const Action = DialogClose;\n","// src/components/ui/DropdownMenu.tsx\n// role=\"menu\" on a popover=\"auto\" div: top-layer + click-outside dismissal\n// come from the platform. Anchor positioning is manual (align=\"end\" is the\n// only inventoried mode). Roving tabindex arrows per the spec.\n\"use client\";\nimport type * as React from \"react\";\nimport {\n cloneElement, createContext, createElement, isValidElement, useContext,\n useEffect, useId, useLayoutEffect, useRef, useState, type ReactNode,\n} from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./DropdownMenu.module.scss\";\n\ninterface MenuCtx {\n open: boolean;\n setOpen: (o: boolean) => void;\n menuId: string;\n}\nconst Ctx = createContext<MenuCtx | null>(null);\nconst useMenu = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ctx;\n};\n\n// Refs live in their own contexts (not bundled into MenuCtx) so `ref={...}`\n// attachment in JSX reads a plain RefObject, matching the pattern Select.tsx\n// uses for its trigger ref.\nconst TriggerRefCtx = createContext<React.RefObject<HTMLElement | null> | null>(null);\nconst useTriggerRef = () => {\n const ref = useContext(TriggerRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\nconst MenuRefCtx = createContext<React.RefObject<HTMLDivElement | null> | null>(null);\nconst useMenuRef = () => {\n const ref = useContext(MenuRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\n\n// Whether a platform light-dismiss just closed the popover (cleared after a\n// short window by a timeout — see Content's onToggle). Own context per the\n// ref-context pattern above (refs never live on Ctx itself — react-hooks/\n// refs forbids mutable refs on a value object that's also read for render,\n// since a ref write wouldn't trigger the re-render consumers of Ctx expect).\nconst LightDismissRefCtx = createContext<React.RefObject<boolean> | null>(null);\nconst useLightDismissRef = () => {\n const ref = useContext(LightDismissRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\n\n// Whether the popover's current \"closed\" toggle was initiated by an Item\n// activating (click/asChild-navigate) rather than a platform light-dismiss\n// (click outside / Esc). Item arms this just before it calls setOpen(false);\n// Content's onToggle reads-and-clears it to decide whether to arm the\n// light-dismiss race guard above — an item-initiated close shouldn't be\n// mistaken for an outside click. Own ref-context, same reasoning as\n// LightDismissRefCtx.\nconst ItemClosedRefCtx = createContext<React.RefObject<boolean> | null>(null);\nconst useItemClosedRef = () => {\n const ref = useContext(ItemClosedRefCtx);\n if (!ref) throw new Error(\"DropdownMenu parts must be inside DropdownMenu.Root\");\n return ref;\n};\n\n// Plain (non-component, non-hook) helper: reads-and-clears the flag. Kept\n// outside Trigger's body because closures passed through cloneElement's\n// props object aren't recognized as deferred event handlers by the React\n// Compiler's ref-during-render check the way a literal JSX attribute value\n// is — pulling the `.current` access out into an ordinary function sidesteps\n// that false positive (the closure in Trigger only ever calls this helper,\n// it never touches `.current` itself).\nfunction consumeLightDismissFlag(ref: React.RefObject<boolean>): boolean {\n if (!ref.current) return false;\n ref.current = false;\n return true;\n}\n\n// Same false-positive, same fix: Item's asChild onClick is built inside the\n// props object passed to createElement (not a literal JSX attribute), so a\n// direct `.current` write there trips the same ref-during-render check.\nfunction markItemInitiatedClose(ref: React.RefObject<boolean>): void {\n ref.current = true;\n}\n\n/**\n * Owns a menu's open state and closes it on an outside click or Escape.\n * Renders nothing of its own.\n */\nexport function Root({\n children,\n}: {\n /** A Trigger and a Content. */\n children?: ReactNode;\n}) {\n const [open, setOpen] = useState(false);\n const menuId = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const menuRef = useRef<HTMLDivElement | null>(null);\n const lightDismissedRef = useRef(false);\n const itemClosedRef = useRef(false);\n return (\n <Ctx.Provider value={{ open, setOpen, menuId }}>\n <TriggerRefCtx.Provider value={triggerRef}>\n <MenuRefCtx.Provider value={menuRef}>\n <LightDismissRefCtx.Provider value={lightDismissedRef}>\n <ItemClosedRefCtx.Provider value={itemClosedRef}>{children}</ItemClosedRefCtx.Provider>\n </LightDismissRefCtx.Provider>\n </MenuRefCtx.Provider>\n </TriggerRefCtx.Provider>\n </Ctx.Provider>\n );\n}\n\n/**\n * The control that opens the menu, and the element the menu is positioned\n * against. Wraps its child rather than rendering a button of its own.\n */\nexport function Trigger({\n children,\n}: {\n /** The control that opens the menu, and what the menu anchors to. */\n children?: ReactNode;\n}) {\n const m = useMenu();\n const triggerRef = useTriggerRef();\n const lightDismissedRef = useLightDismissRef();\n if (!isValidElement(children)) return null;\n const child = children as React.ReactElement<Record<string, unknown>>;\n return cloneElement(child, {\n ref: triggerRef,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": m.open,\n \"aria-controls\": m.menuId,\n onClick: (e: React.MouseEvent) => {\n (child.props.onClick as ((e: React.MouseEvent) => void) | undefined)?.(e);\n // Race: clicking the trigger while the menu is open first fires a\n // pointerdown, which the popover API treats as an outside interaction\n // and light-dismisses the popover (Content's onToggle flags this ref\n // and clears it again after a short window — see there). The click\n // event that completes right after would then read the now-stale\n // open===false and immediately reopen the menu it was meant to close.\n // Skip this click's toggle if a light-dismiss just landed within the\n // same gesture.\n if (consumeLightDismissFlag(lightDismissedRef)) return;\n m.setOpen(!m.open);\n },\n });\n}\n\n/**\n * The menu surface, anchored to the trigger and aligned to its start or end\n * edge. Owns the keyboard model: arrows move between items, Escape closes and\n * returns focus to the trigger.\n */\nexport function Content({\n align = \"start\",\n children,\n}: {\n /** Which edge of the trigger the menu lines up with. Use `end` when the\n * trigger sits near the right edge and the menu would overflow. */\n align?: \"start\" | \"end\";\n /** Items, Labels and Separators. */\n children?: ReactNode;\n}) {\n const m = useMenu();\n const triggerRef = useTriggerRef();\n const menuRef = useMenuRef();\n const lightDismissedRef = useLightDismissRef();\n const itemClosedRef = useItemClosedRef();\n const [pos, setPos] = useState<{ top: number; left: number | \"auto\"; right: number | \"auto\" } | null>(null);\n\n // useLayoutEffect (not useEffect) so the position is measured and applied\n // synchronously before paint — matches Select.tsx's trigger-measurement\n // pattern and avoids a one-frame flash at the wrong coordinates.\n useLayoutEffect(() => {\n const el = menuRef.current;\n if (!el) return;\n if (m.open) {\n // Position under the trigger before entering the top layer.\n const trigger = triggerRef.current;\n if (trigger) {\n const r = trigger.getBoundingClientRect();\n const left = align === \"end\" ? \"auto\" : r.left;\n const right = align === \"end\" ? window.innerWidth - r.right : \"auto\";\n setPos({ top: r.bottom + 6, left, right });\n }\n el.showPopover();\n // Focus the first item for keyboard users.\n el.querySelector<HTMLElement>('[role=\"menuitem\"]')?.focus();\n } else if (el.matches(\":popover-open\")) {\n el.hidePopover();\n }\n }, [m.open, align, menuRef, triggerRef]);\n\n // A resize invalidates the anchored position (measured once, at open) —\n // rather than re-measuring on every resize tick, just close the menu, same\n // as a light dismiss.\n useEffect(() => {\n if (!m.open) return;\n const setOpen = m.setOpen;\n const onResize = () => setOpen(false);\n window.addEventListener(\"resize\", onResize);\n return () => window.removeEventListener(\"resize\", onResize);\n }, [m.open, m.setOpen]);\n\n return (\n <div\n ref={menuRef}\n id={m.menuId}\n role=\"menu\"\n popover=\"auto\"\n className={styles.menu}\n style={\n pos\n ? {\n top: pos.top,\n left: pos.left === \"auto\" ? \"auto\" : pos.left,\n right: pos.right === \"auto\" ? \"auto\" : pos.right,\n }\n : undefined\n }\n onToggle={(e: React.SyntheticEvent<HTMLDivElement>) => {\n // Platform light-dismiss (click outside / Esc) → sync React state.\n if ((e.nativeEvent as ToggleEvent).newState === \"closed\") {\n // An Item activating also drives this closed (setOpen(false) →\n // hidePopover() → this same toggle event) — that's not a light\n // dismiss and shouldn't arm the race guard below. Read-and-clear\n // the item's flag to tell the two apart.\n const itemInitiated = itemClosedRef.current;\n itemClosedRef.current = false;\n if (!itemInitiated) {\n // Flag the race window for Trigger's onClick (see the comment\n // there) and auto-clear it shortly after — it only needs to\n // survive the current click gesture, not linger indefinitely.\n lightDismissedRef.current = true;\n setTimeout(() => { lightDismissedRef.current = false; }, 300);\n }\n if (m.open) m.setOpen(false);\n }\n }}\n onKeyDown={(e) => {\n const items = Array.from(\n menuRef.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? []\n );\n const idx = items.indexOf(document.activeElement as HTMLElement);\n if (e.key === \"ArrowDown\") { e.preventDefault(); items[Math.min(idx + 1, items.length - 1)]?.focus(); }\n else if (e.key === \"ArrowUp\") { e.preventDefault(); items[Math.max(idx - 1, 0)]?.focus(); }\n else if (e.key === \"Home\") { e.preventDefault(); items[0]?.focus(); }\n else if (e.key === \"End\") { e.preventDefault(); items[items.length - 1]?.focus(); }\n else if (e.key === \"Escape\") { m.setOpen(false); triggerRef.current?.focus(); }\n }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * A non-interactive heading for a group of items. Skipped by arrow-key\n * navigation, since there is nothing to activate.\n */\nexport function Label({\n children,\n}: {\n /** Heading text for the group beneath it. Not focusable. */\n children?: ReactNode;\n}) {\n return <div className={styles.label}>{children}</div>;\n}\n\nexport interface ItemProps {\n /** Render the child element instead of the default item — for a link that\n * should stay an anchor rather than becoming a button. */\n asChild?: boolean;\n /** Marks a destructive action, so it reads differently before it is\n * chosen rather than after. */\n color?: \"danger\";\n /** Runs when the item is chosen; the menu closes either way. */\n onSelect?: () => void | Promise<void>;\n /** The item's label. */\n children?: ReactNode;\n}\n\n/**\n * One menu action. `onSelect` fires and the menu closes.\n *\n * Pass `color=\"danger\"` for a destructive action so it reads differently from\n * its neighbours before it is chosen, not after.\n */\nexport function Item({ asChild, color, onSelect, children }: ItemProps) {\n const m = useMenu();\n const itemClosedRef = useItemClosedRef();\n const cls = cx(styles.item, color === \"danger\" && styles.danger);\n const activate = () => {\n markItemInitiatedClose(itemClosedRef);\n m.setOpen(false);\n void onSelect?.();\n };\n if (asChild && isValidElement(children)) {\n const child = children as React.ReactElement<Record<string, unknown>>;\n // Rebuild (rather than cloneElement) so role/tabIndex land BEFORE the\n // child's own attributes (e.g. href) in the emitted markup — cloneElement\n // always keeps pre-existing keys in their original position. Also drop\n // the child's own role/tabIndex (if any) from restProps entirely — a\n // spread landing after the forced menuitem/-1 values would otherwise\n // silently win and undo the forced semantics.\n const {\n className: childClassName, onClick: childOnClick, children: childChildren,\n role: childRole, tabIndex: childTabIndex, ...restProps\n } = child.props;\n // Discarded — pulled out of restProps only so the forced role/tabIndex\n // below can't be silently overwritten by the child's own values.\n void childRole;\n void childTabIndex;\n const originalRef = (child as unknown as { ref?: React.Ref<unknown> }).ref;\n return createElement(\n child.type as React.ElementType,\n {\n key: child.key,\n ref: originalRef,\n role: \"menuitem\",\n tabIndex: -1,\n ...restProps,\n className: cx(cls, childClassName as string | undefined),\n onClick: (e: React.MouseEvent) => {\n (childOnClick as ((e: React.MouseEvent) => void) | undefined)?.(e);\n markItemInitiatedClose(itemClosedRef);\n m.setOpen(false); // real navigation proceeds; menu closes\n },\n },\n childChildren as ReactNode,\n );\n }\n return (\n <button type=\"button\" role=\"menuitem\" tabIndex={-1} className={cls} onClick={activate}>\n {children}\n </button>\n );\n}\n\n/**\n * A rule between groups of items — for separating a destructive action from\n * routine ones, so the two are not adjacent to a moving cursor.\n */\nexport function Separator() {\n return <div role=\"separator\" className={styles.separator} />;\n}\n","// ARIA tabs. Inactive Content unmounts, matching Radix's default.\n\"use client\";\nimport type * as React from \"react\";\nimport { createContext, useContext, useId, type ReactNode } from \"react\";\nimport { cx } from \"./propShared\";\nimport styles from \"./Tabs.module.scss\";\n\ninterface TabsCtx {\n value: string;\n onValueChange: (v: string) => void;\n /** useId()-derived base, shared by Trigger/Content so a trigger's\n * aria-controls always matches its panel's id (and vice versa via\n * aria-labelledby) without either side guessing the other's id. */\n id: string;\n}\nconst Ctx = createContext<TabsCtx | null>(null);\nconst useTabs = () => {\n const ctx = useContext(Ctx);\n if (!ctx) throw new Error(\"Tabs parts must be inside Tabs.Root\");\n return ctx;\n};\n\n/**\n * Wraps a tab set and owns which tab is showing. Fully controlled — pass\n * `value` and `onValueChange`; there is no uncontrolled mode.\n *\n * Renders a plain div, so it imposes no layout of its own. It also mints the\n * id that pairs each Trigger with its Content, which is why every part has to\n * sit inside a Root rather than being usable on its own.\n */\nexport function Root({ value, onValueChange, className, children }: {\n /** The selected tab's value. Fully controlled — there is no default. */\n value: string;\n /** Called with the newly selected tab's value. */\n onValueChange: (v: string) => void;\n /** Merged onto the wrapper div, which is otherwise unstyled. */\n className?: string;\n /** A List and the Contents it switches between. */\n children?: ReactNode;\n}) {\n const id = useId();\n return (\n <Ctx.Provider value={{ value, onValueChange, id }}>\n <div className={className}>{children}</div>\n </Ctx.Provider>\n );\n}\n\n/**\n * The row of triggers, and the keyboard model for the set: arrow keys move\n * between tabs, Home and End jump to the ends, each moving focus and\n * selection together as the ARIA tabs pattern expects.\n *\n * Bottom-aligns its children, so an active tab that grows taller rises above\n * its neighbours instead of pushing the row down — the folder-tab effect.\n */\nexport function List({\n children,\n}: {\n /** The Triggers. Their order is the tab order. */\n children?: ReactNode;\n}) {\n return (\n <div\n role=\"tablist\"\n className={cx(styles.list, \"spTabsList\")}\n onKeyDown={(e) => {\n const tabs = Array.from(\n (e.currentTarget as HTMLElement).querySelectorAll<HTMLElement>('[role=\"tab\"]')\n );\n const idx = tabs.indexOf(document.activeElement as HTMLElement);\n if (idx === -1) return;\n if (e.key === \"ArrowRight\") { e.preventDefault(); const t = tabs[(idx + 1) % tabs.length]; t.focus(); t.click(); }\n else if (e.key === \"ArrowLeft\") { e.preventDefault(); const t = tabs[(idx - 1 + tabs.length) % tabs.length]; t.focus(); t.click(); }\n else if (e.key === \"Home\") { e.preventDefault(); const t = tabs[0]; t.focus(); t.click(); }\n else if (e.key === \"End\") { e.preventDefault(); const t = tabs[tabs.length - 1]; t.focus(); t.click(); }\n }}\n >\n {children}\n </div>\n );\n}\n\n/**\n * One tab. Selects its `value` on click and carries the ARIA wiring that ties\n * it to the matching Content.\n *\n * Emits `data-state=\"active\" | \"inactive\"`, which is the hook the active\n * styling keys off — useful if you are restyling tabs from outside.\n */\nexport function Trigger({ value, className, children, ...rest }: {\n /** Selects this value. Must match the Content it reveals. */\n value: string;\n /** Merged with the tab's own classes rather than replacing them. */\n className?: string;\n /** The tab's label. */\n children?: ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>) {\n const t = useTabs();\n const active = t.value === value;\n return (\n <button\n {...rest}\n type=\"button\"\n role=\"tab\"\n id={`${t.id}-tab-${value}`}\n aria-selected={active}\n aria-controls={`${t.id}-panel-${value}`}\n tabIndex={active ? 0 : -1}\n data-state={active ? \"active\" : \"inactive\"}\n className={cx(styles.trigger, \"spTabsTrigger\", className)}\n onClick={() => t.onValueChange(value)}\n >\n {children}\n </button>\n );\n}\n\n/**\n * The panel for one tab. Renders only while its `value` is the selected one —\n * inactive panels unmount rather than hide, so their contents do not run,\n * hold state, or appear to a screen reader.\n *\n * Carries no styling: the surface a tab set seats onto is the consumer's, and\n * should match `--sp-tabs-surface-color` so the active tab connects to it.\n */\nexport function Content({\n value,\n children,\n}: {\n /** Shown while this matches the Root's value. Must match a Trigger. */\n value: string;\n /** Panel contents. Unmounted while another tab is selected. */\n children?: ReactNode;\n}) {\n const t = useTabs();\n if (t.value !== value) return null;\n return (\n <div role=\"tabpanel\" id={`${t.id}-panel-${value}`} aria-labelledby={`${t.id}-tab-${value}`}>\n {children}\n </div>\n );\n}\n"],"names":["SPACE","spacingStyle","m","mt","mb","p","pb","style","out","cx","parts","Text","forwardRef","as","size","weight","color","className","rest","ref","createElement","styles","Heading","align","Link","asChild","children","cls","merged","isValidElement","child","cloneElement","jsx","cap","s","Flex","gap","direction","justify","wrap","Box","Grid","columns","colCls","Badge","variant","Separator","Card","ScrollArea","mulberry32","a","t","hashString","h","i","Button","iconOnly","ember","fullWidth","animated","id","useId","starStyles","useMemo","rand","classes","jsxs","Loader","label","SHOW_DELAY","HIDE_DELAY","SIDE_OFFSET","COLLISION_PADDING","TooltipTrigger","triggerRef","tooltipId","show","hide","e","_a","Tooltip","side","open","setOpen","useState","pos","setPos","useRef","contentRef","showTimer","hideTimer","clearTimers","immediate","useEffect","useLayoutEffect","content","trigger","r","w","below","above","fitsBelow","fitsAbove","top","left","Fragment","IconToggle","options","value","onValueChange","opt","ctl","ctlModule","Ctx","createContext","useSelect","ctx","useContext","optionId","listboxId","RefCtx","useTriggerRef","collectItems","walk","nodes","Children","props","Item","Root","disabled","highlighted","setHighlighted","rootRef","contentChildren","found","Content","items","values","itemLabels","labelFor","useCallback","onDown","Trigger","placeholder","openWith","highlight","l","_position","listRef","triggerWidth","setTriggerWidth","maxHeight","setMaxHeight","rect","available","move","delta","idx","next","_b","selected","inputProps","Slot","TextArea","Slider","min","max","step","ariaLabel","v","pct","name","g","isDisabled","control","Progress","base","Share2Icon","ChatBubbleIcon","PlusIcon","Pencil1Icon","HeartFilledIcon","ExitFullScreenIcon","EnterFullScreenIcon","CheckIcon","TrashIcon","QuestionMarkCircledIcon","PersonIcon","MinusIcon","MagnifyingGlassIcon","HeartIcon","ChevronUpIcon","ChevronDownIcon","ChevronRightIcon","ChevronLeftIcon","BookmarkIcon","XIcon","lockCount","useDialog","makeRoot","alert","onOpenChange","internal","setInternal","isControlled","actual","o","titleId","descId","hasDesc","setHasDesc","chainOpen","fn","c","d","Close","maxWidth","swallowCancel","pointerDownOnBackdrop","el","Title","Description","DialogTrigger","DialogContent","DialogTitle","DialogDescription","Cancel","DialogClose","Action","useMenu","TriggerRefCtx","MenuRefCtx","useMenuRef","LightDismissRefCtx","useLightDismissRef","ItemClosedRefCtx","useItemClosedRef","consumeLightDismissFlag","markItemInitiatedClose","menuId","menuRef","lightDismissedRef","itemClosedRef","right","onResize","itemInitiated","_c","_d","_e","_f","Label","onSelect","activate","childClassName","childOnClick","childChildren","childRole","childTabIndex","restProps","originalRef","useTabs","List","tabs","active"],"mappings":"qJAeMA,EAAmC,CACvC,EAAK,IACL,EAAK,oBACL,EAAK,oBACL,EAAK,oBACL,EAAK,oBACL,EAAK,oBACL,EAAK,mBACP,EAEO,SAASC,EACd,CAAE,EAAAC,EAAG,GAAAC,EAAI,GAAAC,EAAI,EAAAC,EAAG,GAAAC,CAAA,EAChBC,EAC2B,CAC3B,MAAMC,EAAqB,CACzB,GAAIN,IAAM,QAA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