diff --git a/.agent/skills/basalt-html/parts/core.css b/.agent/skills/basalt-html/parts/core.css
index e1f9cda2..0b5c3e46 100644
--- a/.agent/skills/basalt-html/parts/core.css
+++ b/.agent/skills/basalt-html/parts/core.css
@@ -1 +1 @@
-:root{--basalt-neutral-0: oklch(0 0 0);--basalt-neutral-4: oklch(.1448 0 0);--basalt-neutral-7: oklch(.1776 0 0);--basalt-neutral-9: oklch(.2046 0 0);--basalt-neutral-20: oklch(.3211 0 0);--basalt-neutral-30: oklch(.4202 0 0);--basalt-neutral-36: oklch(.4748 0 0);--basalt-neutral-42: oklch(.5278 0 0);--basalt-neutral-52: oklch(.6167 0 0);--basalt-neutral-59: oklch(.675 0 0);--basalt-neutral-63: oklch(.709 0 0);--basalt-neutral-64: oklch(.7155 0 0);--basalt-neutral-73: oklch(.79 0 0);--basalt-neutral-75: oklch(.8047 0 0);--basalt-neutral-93: oklch(.9461 0 0);--basalt-neutral-94: oklch(.9551 0 0);--basalt-neutral-96: oklch(.9702 0 0);--basalt-neutral-98: oklch(.9851 0 0);--basalt-neutral-100: oklch(1 0 0);--basalt-neutral-42-4: oklch(.53 0 0);--basalt-neutral-95-7: oklch(.966 0 0);--basalt-white-6: oklch(1 0 0 / .06);--basalt-white-8: oklch(1 0 0 / .08);--basalt-white-9: oklch(1 0 0 / .09);--basalt-white-15: oklch(1 0 0 / .145);--basalt-white-24: oklch(1 0 0 / .24);--basalt-white-38: oklch(1 0 0 / .38);--basalt-black-4: oklch(0 0 0 / .04);--basalt-black-6: oklch(0 0 0 / .06);--basalt-black-7: oklch(0 0 0 / .07);--basalt-black-8: oklch(0 0 0 / .08);--basalt-black-10: oklch(0 0 0 / .1);--basalt-black-16: oklch(0 0 0 / .16);--basalt-black-18: oklch(0 0 0 / .18);--basalt-black-24: oklch(0 0 0 / .24);--basalt-black-40: oklch(0 0 0 / .4);--basalt-black-45: oklch(0 0 0 / .45);--basalt-black-60: oklch(0 0 0 / .6);--basalt-black-80: oklch(0 0 0 / .8);--basalt-status-danger-dark: oklch(.7 .191 22);--basalt-status-success-dark: oklch(.73 .211 148);--basalt-status-warning-dark: oklch(.79 .171 70);--basalt-status-danger-light: oklch(.51 .19 25);--basalt-status-success-light: oklch(.55 .159 148);--basalt-status-warning-light: oklch(.6 .137 62);--basalt-space-0: 0px;--basalt-space-1: 4px;--basalt-space-2: 8px;--basalt-space-3: 12px;--basalt-space-4: 16px;--basalt-space-5: 20px;--basalt-space-6: 24px;--basalt-space-8: 32px;--basalt-space-10: 40px;--basalt-space-12: 48px;--basalt-space-16: 64px;--basalt-space-24: 96px;--basalt-space-0-5: 2px;--basalt-space-1-5: 6px;--basalt-space-2-5: 10px;--basalt-space-3-5: 14px;--basalt-radius-2xs: 2px;--basalt-radius-xs: 4px;--basalt-radius-sm: 6px;--basalt-radius-md: 8px;--basalt-radius-lg: 12px;--basalt-radius-xl: 16px;--basalt-radius-full: 9999px;--basalt-size-control-xs: 24px;--basalt-size-control-sm: 28px;--basalt-size-control-md: 32px;--basalt-size-control-lg: 36px;--basalt-size-control-xl: 40px;--basalt-size-control-2xl: 44px;--basalt-size-control-3xl: 48px;--basalt-size-control-4xl: 52px;--basalt-size-control-5xl: 56px;--basalt-size-control-6xl: 64px;--basalt-size-menu-row: 36px;--basalt-size-menu-row-touch: 44px;--basalt-size-tap-min: 44px;--basalt-size-icon-sm: 16px;--basalt-size-icon-md: 20px;--basalt-size-icon-lg: 24px;--basalt-size-focus-width: 2px;--basalt-size-focus-offset: 2px;--basalt-size-hairline: 1px;--basalt-size-indicator: 2px;--basalt-size-description-label: 160px;--basalt-size-field-label-inline: 80px;--basalt-size-track: 4px;--basalt-size-dot: 6px;--basalt-size-choice: 16px;--basalt-size-choice-mark: 12px;--basalt-size-switch-width: 32px;--basalt-size-switch-height: 18px;--basalt-size-switch-thumb: 14px;--basalt-size-kbd: 20px;--basalt-size-badge: 22px;--basalt-size-table-row: 40px;--basalt-size-command-input: 48px;--basalt-size-code-line-height: 20px;--basalt-size-underline-offset: 3px;--basalt-size-slider-length: 180px;--basalt-size-dialog-width: 480px;--basalt-size-sheet-width: 440px;--basalt-size-command-width: 560px;--basalt-size-dialog-width-wide: 992px;--basalt-size-search-trigger: 200px;--basalt-size-search-logo-width: 96px;--basalt-size-search-logo-height: 48px;--basalt-size-search-pack-width: 48px;--basalt-size-search-pack-height: 60px;--basalt-size-toast-width: 360px;--basalt-size-popover-max: 320px;--basalt-size-tooltip-max: 280px;--basalt-size-menu-min: 200px;--basalt-size-select-min: 160px;--basalt-size-popup-max-height: 360px;--basalt-size-list-width: 320px;--basalt-size-header: 56px;--basalt-size-tab-bar: 56px;--basalt-size-sidebar-width: 256px;--basalt-size-rail-width: 72px;--basalt-size-page-width: 72rem;--basalt-size-prose-width: 34rem;--basalt-size-gutter: var(--basalt-space-6);--basalt-size-gutter-narrow: var(--basalt-space-4);--basalt-size-breakpoint-md: 720px;--basalt-size-breakpoint-lg: 1024px;--basalt-size-breakpoint-container: 480px;--basalt-size-breakpoint-container-sm: 340px;--basalt-size-breakpoint-container-lg: 640px;--basalt-size-cut: 2px;--basalt-size-hatch-pitch: 4px;--basalt-size-meter-marker: 12px;--basalt-opacity-amount: .72;--basalt-font-family-sans: Geist, "Geist Fallback", ui-sans-serif, system-ui, sans-serif;--basalt-font-family-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--basalt-font-weight-regular: 400;--basalt-font-weight-medium: 500;--basalt-font-weight-semibold: 600;--basalt-text-xs-size: 12px;--basalt-text-xs-line-height: 16px;--basalt-text-xs-tracking: .01em;--basalt-text-sm-size: 13px;--basalt-text-sm-line-height: 18px;--basalt-text-sm-tracking: 0em;--basalt-text-base-size: 14px;--basalt-text-base-line-height: 20px;--basalt-text-base-tracking: 0em;--basalt-text-md-size: 16px;--basalt-text-md-line-height: 24px;--basalt-text-md-tracking: -.005em;--basalt-text-lg-size: 18px;--basalt-text-lg-line-height: 26px;--basalt-text-lg-tracking: -.01em;--basalt-text-xl-size: 20px;--basalt-text-xl-line-height: 28px;--basalt-text-xl-tracking: -.015em;--basalt-text-2xl-size: 24px;--basalt-text-2xl-line-height: 30px;--basalt-text-2xl-tracking: -.02em;--basalt-text-3xl-size: 30px;--basalt-text-3xl-line-height: 36px;--basalt-text-3xl-tracking: -.025em;--basalt-text-4xl-size: 40px;--basalt-text-4xl-line-height: 44px;--basalt-text-4xl-tracking: -.03em;--basalt-text-5xl-size: 56px;--basalt-text-5xl-line-height: 60px;--basalt-text-5xl-tracking: -.035em;--basalt-blur-chrome: 12px;--basalt-duration-instant: 0ms;--basalt-duration-fast: .1s;--basalt-duration-base: .15s;--basalt-duration-slow: .2s;--basalt-duration-slower: .3s;--basalt-duration-confirm: 1.5s;--basalt-duration-figure: .6s;--basalt-duration-stagger: 22ms;--basalt-duration-loop-ring: .64s;--basalt-duration-loop-braille: .8s;--basalt-duration-loop-fade: 1.2s;--basalt-duration-loop-ambient: 6s;--basalt-ease-out: cubic-bezier(.16, 1, .3, 1);--basalt-ease-in-out: cubic-bezier(.65, 0, .35, 1);--basalt-ease-in: cubic-bezier(.4, 0, 1, 1);--basalt-ease-linear: cubic-bezier(0, 0, 1, 1);--basalt-layer-base: 0;--basalt-layer-sticky: 100;--basalt-layer-overlay: 500;--basalt-layer-popover: 600;--basalt-layer-dialog: 700;--basalt-layer-toast: 800;--basalt-layer-tooltip: 1100}:root,[data-theme=light],.light{color-scheme:light;--basalt-status-danger: var(--basalt-status-danger-light);--basalt-status-success: var(--basalt-status-success-light);--basalt-status-warning: var(--basalt-status-warning-light);--basalt-syntax-keyword: oklch(.5 .12 255);--basalt-syntax-string: oklch(.5 .12 150);--basalt-syntax-constant: oklch(.5 .1 70);--basalt-syntax-function: oklch(.5 .12 305);--basalt-syntax-comment: var(--basalt-text-tertiary);--basalt-surface-0: var(--basalt-neutral-98);--basalt-surface-1: var(--basalt-neutral-100);--basalt-surface-2: var(--basalt-neutral-100);--basalt-surface-3: var(--basalt-neutral-100);--basalt-surface-page: var(--basalt-surface-0);--basalt-surface-raised: var(--basalt-surface-1);--basalt-surface-overlay: var(--basalt-surface-2);--basalt-surface-top: var(--basalt-surface-3);--basalt-surface-sunken: var(--basalt-neutral-96);--basalt-surface-well-2: var(--basalt-surface-sunken);--basalt-surface-well-3: var(--basalt-surface-sunken);--basalt-surface-sunken-strong: var(--basalt-neutral-94);--basalt-surface-kbd: var(--basalt-black-6);--basalt-surface-chrome: oklch(.9851 0 0 / .96);--basalt-surface-placeholder: var(--basalt-neutral-94);--basalt-text-primary: var(--basalt-neutral-9);--basalt-text-secondary: var(--basalt-neutral-30);--basalt-text-tertiary: var(--basalt-neutral-42);--basalt-text-disabled: var(--basalt-neutral-64);--basalt-text-inverse: var(--basalt-neutral-100);--basalt-border-rim: var(--basalt-black-8);--basalt-border-rim-top: var(--basalt-black-8);--basalt-border-hairline: var(--basalt-black-8);--basalt-border-hover: var(--basalt-black-16);--basalt-border-divider: var(--basalt-black-8);--basalt-border-input: var(--basalt-black-45);--basalt-border-field: var(--basalt-border-input);--basalt-border-focus: var(--basalt-neutral-30);--basalt-state-hover: var(--basalt-black-4);--basalt-state-selected: var(--basalt-black-7);--basalt-action-primary: var(--basalt-neutral-9);--basalt-action-primary-hover: var(--basalt-neutral-0);--basalt-action-primary-press: var(--basalt-neutral-20);--basalt-action-primary-text: var(--basalt-neutral-100);--basalt-line-contrast: var(--basalt-black-45);--basalt-ink-contrast: var(--basalt-neutral-30);--basalt-field-contrast: var(--basalt-neutral-30);--basalt-scrim: var(--basalt-black-40);--basalt-shadow-hairline: 0px 0px 0px 1px oklch(0 0 0 / .08), 0px 0px 0px 1px oklch(.9851 0 0);--basalt-shadow-overlay: 0px 4px 8px -4px oklch(0 0 0 / .06), 0px 16px 24px -8px oklch(0 0 0 / .1);--basalt-shadow-modal: 0px 8px 16px -4px oklch(0 0 0 / .06), 0px 24px 32px -8px oklch(0 0 0 / .1)}[data-theme=dark],.dark{color-scheme:dark;--basalt-status-danger: var(--basalt-status-danger-dark);--basalt-status-success: var(--basalt-status-success-dark);--basalt-status-warning: var(--basalt-status-warning-dark);--basalt-syntax-keyword: oklch(.8 .09 255);--basalt-syntax-string: oklch(.8 .09 150);--basalt-syntax-constant: oklch(.8 .09 70);--basalt-syntax-function: oklch(.8 .09 305);--basalt-syntax-comment: var(--basalt-text-tertiary);--basalt-surface-0: var(--basalt-neutral-0);--basalt-surface-1: var(--basalt-neutral-4);--basalt-surface-2: var(--basalt-neutral-7);--basalt-surface-3: var(--basalt-neutral-9);--basalt-surface-page: var(--basalt-surface-0);--basalt-surface-raised: var(--basalt-surface-1);--basalt-surface-overlay: var(--basalt-surface-2);--basalt-surface-top: var(--basalt-surface-3);--basalt-surface-sunken: var(--basalt-surface-1);--basalt-surface-well-2: var(--basalt-surface-2);--basalt-surface-well-3: var(--basalt-surface-3);--basalt-surface-sunken-strong: var(--basalt-surface-2);--basalt-surface-kbd: var(--basalt-white-8);--basalt-surface-chrome: oklch(0 0 0 / .925);--basalt-surface-placeholder: var(--basalt-neutral-9);--basalt-text-primary: var(--basalt-neutral-95-7);--basalt-text-secondary: var(--basalt-neutral-73);--basalt-text-tertiary: var(--basalt-neutral-59);--basalt-text-disabled: var(--basalt-neutral-42-4);--basalt-text-inverse: var(--basalt-neutral-0);--basalt-border-hairline: var(--basalt-white-15);--basalt-border-rim: var(--basalt-white-6);--basalt-border-rim-top: var(--basalt-white-8);--basalt-border-hover: var(--basalt-white-24);--basalt-border-divider: var(--basalt-white-6);--basalt-border-input: var(--basalt-white-38);--basalt-border-field: var(--basalt-border-input);--basalt-border-focus: var(--basalt-text-secondary);--basalt-state-hover: var(--basalt-white-6);--basalt-state-selected: var(--basalt-white-9);--basalt-action-primary: var(--basalt-neutral-93);--basalt-action-primary-hover: var(--basalt-neutral-100);--basalt-action-primary-press: var(--basalt-neutral-75);--basalt-action-primary-text: var(--basalt-neutral-0);--basalt-line-contrast: var(--basalt-white-38);--basalt-ink-contrast: var(--basalt-text-secondary);--basalt-field-contrast: var(--basalt-text-secondary);--basalt-scrim: var(--basalt-black-80);--basalt-shadow-hairline: 0px 0px 0px 1px oklch(1 0 0 / .145), 0px 0px 0px 1px oklch(0 0 0);--basalt-shadow-overlay: 0px 4px 8px -4px oklch(0 0 0 / .24), 0px 16px 24px -8px oklch(0 0 0 / .4);--basalt-shadow-modal: 0px 8px 16px -4px oklch(0 0 0 / .24), 0px 24px 32px -8px oklch(0 0 0 / .6)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]):not(.light){color-scheme:dark;--basalt-status-danger: var(--basalt-status-danger-dark);--basalt-status-success: var(--basalt-status-success-dark);--basalt-status-warning: var(--basalt-status-warning-dark);--basalt-syntax-keyword: oklch(.8 .09 255);--basalt-syntax-string: oklch(.8 .09 150);--basalt-syntax-constant: oklch(.8 .09 70);--basalt-syntax-function: oklch(.8 .09 305);--basalt-surface-0: var(--basalt-neutral-0);--basalt-surface-1: var(--basalt-neutral-4);--basalt-surface-2: var(--basalt-neutral-7);--basalt-surface-3: var(--basalt-neutral-9);--basalt-surface-sunken: var(--basalt-surface-1);--basalt-surface-well-2: var(--basalt-surface-2);--basalt-surface-well-3: var(--basalt-surface-3);--basalt-surface-sunken-strong: var(--basalt-surface-2);--basalt-surface-kbd: var(--basalt-white-8);--basalt-surface-chrome: oklch(0 0 0 / .925);--basalt-surface-placeholder: var(--basalt-neutral-9);--basalt-text-primary: var(--basalt-neutral-95-7);--basalt-text-secondary: var(--basalt-neutral-73);--basalt-text-tertiary: var(--basalt-neutral-59);--basalt-text-disabled: var(--basalt-neutral-42-4);--basalt-text-inverse: var(--basalt-neutral-0);--basalt-border-hairline: var(--basalt-white-15);--basalt-border-rim: var(--basalt-white-6);--basalt-border-rim-top: var(--basalt-white-8);--basalt-border-hover: var(--basalt-white-24);--basalt-border-divider: var(--basalt-white-6);--basalt-border-input: var(--basalt-white-38);--basalt-border-focus: var(--basalt-text-secondary);--basalt-state-hover: var(--basalt-white-6);--basalt-state-selected: var(--basalt-white-9);--basalt-action-primary: var(--basalt-neutral-93);--basalt-action-primary-hover: var(--basalt-neutral-100);--basalt-action-primary-press: var(--basalt-neutral-75);--basalt-action-primary-text: var(--basalt-neutral-0);--basalt-line-contrast: var(--basalt-white-38);--basalt-ink-contrast: var(--basalt-text-secondary);--basalt-field-contrast: var(--basalt-text-secondary);--basalt-scrim: var(--basalt-black-80);--basalt-shadow-hairline: 0px 0px 0px 1px oklch(1 0 0 / .145), 0px 0px 0px 1px oklch(0 0 0);--basalt-shadow-overlay: 0px 4px 8px -4px oklch(0 0 0 / .24), 0px 16px 24px -8px oklch(0 0 0 / .4);--basalt-shadow-modal: 0px 8px 16px -4px oklch(0 0 0 / .24), 0px 24px 32px -8px oklch(0 0 0 / .6)}}@media(prefers-contrast:more){:root,[data-theme=light],[data-theme=dark],.light,.dark,:root:not([data-theme=light]):not(.light){--basalt-border-hairline: var(--basalt-line-contrast);--basalt-border-rim: var(--basalt-line-contrast);--basalt-border-rim-top: var(--basalt-line-contrast);--basalt-border-divider: var(--basalt-line-contrast);--basalt-text-tertiary: var(--basalt-ink-contrast);--basalt-border-field: var(--basalt-field-contrast);--basalt-border-hover: var(--basalt-text-secondary);--basalt-shadow-hairline: 0px 0px 0px 1px var(--basalt-line-contrast), 0px 0px 0px 1px var(--basalt-surface-0)}}@media(prefers-reduced-motion:reduce){:root{--basalt-duration-base: .1s;--basalt-duration-slow: .1s;--basalt-duration-slower: .1s;--basalt-duration-figure: .1s;--basalt-duration-stagger: 0ms}}@layer reset,basalt;@layer reset{*,*:before,*:after{box-sizing:border-box}html{background:var(--basalt-surface-0);-webkit-text-size-adjust:100%}body{margin:0;background:var(--basalt-surface-0);color:var(--basalt-text-primary);font:var(--basalt-font-weight-regular) var(--bh-base);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}b,strong,th{font-weight:var(--basalt-font-weight-semibold)}img,svg,video{max-width:100%}button,input,select,textarea{font:inherit;letter-spacing:inherit;color:inherit;margin:0}a{color:inherit;text-decoration:underline;text-decoration-color:var(--basalt-border-input);text-underline-offset:var(--basalt-size-underline-offset)}a:hover{text-decoration-color:currentColor}h1,h2,h3,h4,p,ul,ol,dl,dd,figure,blockquote{margin:0}h1,h2,h3,h4{font-weight:var(--basalt-font-weight-semibold);color:var(--basalt-text-primary);text-wrap:balance}h5,h6{font-weight:var(--basalt-font-weight-semibold)}h1,.display{font-size:var(--basalt-text-3xl-size);line-height:var(--basalt-text-3xl-line-height);letter-spacing:var(--basalt-text-3xl-tracking)}h2{font-size:var(--basalt-text-2xl-size);line-height:var(--basalt-text-2xl-line-height);letter-spacing:var(--basalt-text-2xl-tracking)}h3{font-size:var(--basalt-text-lg-size);line-height:var(--basalt-text-lg-line-height);letter-spacing:var(--basalt-text-lg-tracking)}h4{font-size:var(--basalt-text-base-size);line-height:var(--basalt-text-base-line-height)}@media(width>=720px){h1,.display{font-size:var(--basalt-text-4xl-size);line-height:var(--basalt-text-4xl-line-height);letter-spacing:var(--basalt-text-4xl-tracking)}}p,li{text-wrap:pretty}code:not(.code code){padding:var(--basalt-size-hairline) var(--basalt-space-1);border-radius:var(--basalt-radius-xs);background:var(--basalt-surface-kbd);font:var(--basalt-font-weight-regular) .92em / 1 var(--basalt-font-family-mono)}pre,code,kbd,samp{font-family:var(--basalt-font-family-mono)}}@layer basalt{:root{--bh-xs: var(--basalt-text-xs-size) / var(--basalt-text-xs-line-height) var(--basalt-font-family-sans);--bh-sm: var(--basalt-text-sm-size) / var(--basalt-text-sm-line-height) var(--basalt-font-family-sans);--bh-base: var(--basalt-text-base-size) / var(--basalt-text-base-line-height) var(--basalt-font-family-sans);--bh-md: var(--basalt-text-md-size) / var(--basalt-text-md-line-height) var(--basalt-font-family-sans);--bh-2xl: var(--basalt-text-2xl-size) / var(--basalt-text-2xl-line-height) var(--basalt-font-family-sans);--bh-xs-mono: var(--basalt-text-xs-size) / var(--basalt-text-xs-line-height) var(--basalt-font-family-mono);--bh-sm-mono: var(--basalt-text-sm-size) / var(--basalt-size-code-line-height) var(--basalt-font-family-mono)}:root{accent-color:var(--basalt-action-primary);--basalt-gutter: var(--basalt-size-gutter)}@media(width<720px){:root{--basalt-gutter: var(--basalt-size-gutter-narrow)}}a,button,summary,[role=tab],.row,.disclosure,.segment button{-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}:focus-visible{outline:var(--basalt-size-focus-width) solid var(--basalt-border-focus);outline-offset:var(--basalt-size-focus-offset)}::selection{background:var(--basalt-state-selected)}svg.icon{flex:none}svg[data-brand]{pointer-events:none}.dot-sep:before{content:"·";content:"·" / ""}.dot-sep[data-spaced]:before{content:" · ";content:" · " / ""}.dot-sep>.visually-hidden{white-space:pre}.display{font-weight:var(--basalt-font-weight-semibold)}.text-5xl{font-size:var(--basalt-text-5xl-size);line-height:var(--basalt-text-5xl-line-height);letter-spacing:var(--basalt-text-5xl-tracking);font-weight:var(--basalt-font-weight-semibold)}.lead{font-size:var(--basalt-text-md-size);line-height:var(--basalt-text-md-line-height);color:var(--basalt-text-secondary);max-width:var(--basalt-size-prose-width);text-wrap:pretty}.eyebrow{font:var(--basalt-font-weight-medium) var(--bh-xs);color:var(--basalt-text-secondary)}.muted{color:var(--basalt-text-secondary)}.faint{color:var(--basalt-text-tertiary)}.small{font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height)}.mono{font-family:var(--basalt-font-family-mono)}.num{font-variant-numeric:tabular-nums}.prose{max-inline-size:var(--basalt-size-prose-width);margin-inline:0 auto}.prose>*+*{margin-top:var(--basalt-space-4)}.prose>:is(h2,h3){margin-top:var(--basalt-space-8)}.prose>:is(h2,h3)+*{margin-top:var(--basalt-space-2)}.prose :is(ul,ol){padding-inline-start:var(--basalt-space-5)}.prose li+li{margin-top:var(--basalt-space-1)}.prose blockquote{padding-inline-start:var(--basalt-space-4);color:var(--basalt-text-secondary)}.page{width:100%;max-width:var(--basalt-size-page-width);margin-inline:auto;padding:var(--basalt-space-8) var(--basalt-gutter) var(--basalt-space-16)}.page.narrow{max-width:46rem}@media(width<720px){.page{padding-block:var(--basalt-space-6) var(--basalt-space-12)}}.stack{display:flex;flex-direction:column;gap:var(--gap, var(--basalt-space-4));min-width:0}.cluster{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gap, var(--basalt-space-2));min-width:0}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(var(--min, 220px),100%),1fr));gap:var(--gap, var(--basalt-space-4))}.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--gap, var(--basalt-space-6))}@media(width>=720px){.split.aside{grid-template-columns:minmax(0,var(--basalt-size-list-width)) minmax(0,1fr);align-items:start}}@media(width<720px){.split{grid-template-columns:minmax(0,1fr)}}.spacer{flex:1}@media(width<720px){.hide-narrow{display:none!important}}.section{margin-top:var(--basalt-space-12)}.section>.section-head{margin-bottom:var(--basalt-space-4)}.footer{margin-top:var(--basalt-space-16);padding-top:var(--basalt-space-4);border-top:var(--basalt-size-hairline) solid var(--basalt-border-divider);color:var(--basalt-text-secondary);font-size:var(--basalt-text-sm-size)}.footer:not(.page .footer){width:calc(min(100%,var(--basalt-size-page-width)) - 2 * var(--basalt-gutter));margin-top:0;margin-inline:auto;padding-bottom:var(--basalt-space-8)}.skip-link{position:absolute;inset-inline-start:var(--basalt-space-2);top:var(--basalt-space-2);transform:translateY(-200%);padding:var(--basalt-space-2) var(--basalt-space-3);border:var(--basalt-size-hairline) solid var(--basalt-border-rim);border-top-color:var(--basalt-border-rim-top);border-radius:var(--basalt-radius-md);background:var(--basalt-surface-3);color:var(--basalt-text-primary);z-index:var(--basalt-layer-toast)}.skip-link:focus{transform:none;box-shadow:var(--basalt-shadow-overlay)}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-1);--panel-next: var(--basalt-surface-2);--panel-well: var(--basalt-surface-sunken);--panel-plate: light-dark(var(--basalt-state-selected), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--panel-next)));position:relative;min-width:0;background-color:var(--panel-bg);color:var(--basalt-text-primary);border:var(--basalt-size-hairline) solid var(--basalt-border-rim);border-top-color:var(--basalt-border-rim-top);border-radius:var(--basalt-radius-lg)}:is(.panel,.card,.callout,.code,.table-wrap) :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-2);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-2)}:is(.panel,.card,.callout,.code,.table-wrap) :is(.panel,.card,.callout,.code,.table-wrap) :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-3);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-3)}@supports not (color: light-dark(white,black)){:root,[data-theme=light],.light{--_dkp: 0%}[data-theme=dark],.dark{--_dkp: 100%}@media(prefers-color-scheme:dark){:root:not([data-theme=light]):not(.light){--_dkp: 100%}}:root,:is(.panel,.card,.callout,.code,.table-wrap){--_dk: color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--panel-next, var(--basalt-surface-1)));--_mx: color-mix(in srgb, var(--_dk) var(--_dkp), color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--panel-bg, var(--basalt-surface-page))));--panel-plate: color-mix(in srgb, var(--_dk) var(--_dkp), var(--basalt-state-selected))}.choice-card.choice-card{--_solid: var(--_mx)}.btn.btn.btn[aria-pressed=true]:not([data-variant=primary],[data-variant=danger]){background:var(--_mx)}.segment.segment{--pill-fill: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-top)) var(--_dkp), var(--basalt-surface-top))}select.input.input{--_pop-plate: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--_pop-next)) var(--_dkp), var(--basalt-state-selected))}}.panel-pad,.card{padding:var(--basalt-space-4)}@media(width>=720px){.panel-pad.lg,.card.lg{padding:var(--basalt-space-6)}}.panel-head{display:flex;flex-wrap:wrap;align-items:center;gap:var(--basalt-space-2);padding:var(--basalt-space-3) var(--basalt-space-4);border-bottom:var(--basalt-size-hairline) solid var(--basalt-border-divider);font-weight:var(--basalt-font-weight-medium)}.float{--panel-bg: var(--basalt-surface-1);--panel-next: var(--basalt-surface-2);--panel-well: var(--basalt-surface-sunken);box-shadow:var(--basalt-shadow-overlay)}.float.modal{box-shadow:var(--basalt-shadow-modal);--panel-bg: var(--basalt-surface-1);--panel-next: var(--basalt-surface-2);--panel-well: var(--basalt-surface-sunken)}.float.modal :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-2);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-2)}[data-level="0"]{--panel-next: var(--basalt-surface-1)}[data-level="1"] :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-2);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-2)}[data-level="2"] :is(.panel,.card,.callout,.code,.table-wrap),[data-level="3"] :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-3);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-3)}.divider{display:block;height:var(--basalt-size-hairline);margin:0;border:0;background:var(--basalt-border-divider);flex:none}.divide-y>*+*{border-top:var(--basalt-size-hairline) solid var(--basalt-border-divider)}.btn{position:relative;--_h: var(--basalt-size-control-md);--_px: var(--basalt-space-3);display:inline-flex;align-items:center;justify-content:center;gap:var(--basalt-space-1-5);height:var(--_h);padding:0 var(--_px);margin:0;border:0;border-radius:var(--basalt-radius-sm);font:var(--basalt-font-weight-medium) var(--basalt-text-base-size) / 1 var(--basalt-font-family-sans);white-space:nowrap;text-decoration:none;cursor:pointer;user-select:none;background:var(--basalt-surface-1);color:var(--basalt-text-primary);box-shadow:var(--basalt-shadow-hairline);transition-property:background-color,color,box-shadow,transform;transition-duration:var(--basalt-duration-fast);transition-timing-function:var(--basalt-ease-out)}.btn[data-size=sm]{--_h: var(--basalt-size-control-sm);--_px: var(--basalt-space-2-5);font-size:var(--basalt-text-sm-size)}.btn[data-size=lg]{--_h: var(--basalt-size-control-lg);--_px: var(--basalt-space-3-5);border-radius:var(--basalt-radius-md)}.btn[data-icon-only]{width:var(--_h);padding:0}.btn[data-variant=primary]{background:var(--basalt-action-primary);color:var(--basalt-action-primary-text);box-shadow:none}.btn[data-variant=ghost]{background:transparent;color:var(--basalt-text-secondary);box-shadow:none}.btn[data-variant=danger]{background:transparent;color:var(--basalt-status-danger);box-shadow:inset 0 0 0 var(--basalt-size-hairline) color-mix(in oklch,var(--basalt-status-danger) 45%,transparent)}@media(hover:hover){.btn:hover:not([disabled],[aria-disabled=true]){box-shadow:0 0 0 var(--basalt-size-hairline) var(--basalt-border-hover),0 0 0 var(--basalt-size-hairline) var(--basalt-surface-0)}.btn[data-variant=primary]:hover:not([disabled],[aria-disabled=true]){background:var(--basalt-action-primary-hover);box-shadow:none}.btn[data-variant=ghost]:hover:not([disabled],[aria-disabled=true]){background:var(--basalt-state-hover);color:var(--basalt-text-primary);box-shadow:none}.btn[data-variant=danger]:hover:not([disabled],[aria-disabled=true]){background:var(--basalt-state-hover);box-shadow:inset 0 0 0 var(--basalt-size-hairline) color-mix(in oklch,var(--basalt-status-danger) 70%,transparent)}}.btn:active:not([disabled],[aria-disabled=true]){background:var(--basalt-state-selected)}.btn[data-variant=primary]:active:not([disabled],[aria-disabled=true]){background:var(--basalt-action-primary-press)}.btn:active:not([disabled],[aria-disabled=true],[aria-busy=true]){transform:scale(.98)}.btn:active:not([disabled],[aria-disabled=true],[aria-busy=true]):after{content:"";position:absolute;inset:-1.03%}.btn[disabled],.btn[aria-disabled=true]{cursor:not-allowed;color:var(--basalt-text-disabled);box-shadow:0 0 0 var(--basalt-size-hairline) color-mix(in oklch,var(--basalt-border-hairline) 50%,transparent)}.btn[data-variant=primary][disabled],.btn[data-variant=primary][aria-disabled=true]{background:var(--basalt-state-selected);box-shadow:none}.btn[data-variant=ghost][disabled]{box-shadow:none}.btn[aria-busy=true]{cursor:progress}.btn[aria-busy=true]>*{opacity:0}.btn[aria-busy=true]:after{content:"";position:absolute;inset:0;margin:auto;width:var(--basalt-size-icon-sm);height:var(--basalt-size-icon-sm);border:1.5px solid color-mix(in oklch,currentColor 25%,transparent);border-top-color:currentColor;border-radius:var(--basalt-radius-full);animation:bh-spin var(--basalt-duration-loop-ring) linear infinite}.btn svg{flex:none}@media(pointer:coarse){.btn{min-height:var(--basalt-size-tap-min);border-radius:var(--basalt-radius-md)}.btn[data-icon-only]{min-width:var(--basalt-size-tap-min)}}@media(pointer:coarse){a:not(.btn,.row,.tab,.disclosure,.brand,.skip-link,:is(p,li,.prose,.small,.hint,.error,.callout-body) a),nav a:not(.btn),.footer a,.tap{display:inline-flex;align-items:center;min-height:var(--basalt-size-tap-min);margin-block:var(--bh-tap-margin, min( 0lh , calc((1lh - var(--basalt-size-tap-min)) / 2)))}.skip-link{display:inline-flex;align-items:center;min-height:var(--basalt-size-tap-min)}:is(a:not(.btn,.row,.tab,.disclosure,.brand,.skip-link,.topbar-links a,:is(p,li,.prose,.small,.hint,.error,.callout-body) a),.tap){position:relative}:is(a:not(.btn,.row,.tab,.disclosure,.brand,.skip-link,.topbar-links a,:is(p,li,.prose,.small,.hint,.error,.callout-body) a),.tap):after{content:"";position:absolute;inset-block:0;left:50%;width:max(100%,var(--basalt-size-tap-min));transform:translate(-50%)}}@keyframes bh-spin{to{transform:rotate(360deg)}}@keyframes bh-fade{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.btn[aria-busy=true]:after{animation:bh-fade var(--basalt-duration-loop-fade) var(--basalt-ease-in-out) infinite;border-top-color:color-mix(in oklch,currentColor 25%,transparent)}.btn:active:not([disabled],[aria-disabled=true],[aria-busy=true]){transform:none}.btn{transition-property:background-color,color,box-shadow}}@media(forced-colors:active){:is(.panel,.card,.callout,.code,.table-wrap){border-color:CanvasText}.btn{border:var(--basalt-size-hairline) solid ButtonText}}@media print{.skip-link{display:none}:is(.panel,.card,.callout,.code,.table-wrap){break-inside:avoid}}}
+:root{--basalt-neutral-0: oklch(0 0 0);--basalt-neutral-4: oklch(.1448 0 0);--basalt-neutral-7: oklch(.1776 0 0);--basalt-neutral-9: oklch(.2046 0 0);--basalt-neutral-20: oklch(.3211 0 0);--basalt-neutral-30: oklch(.4202 0 0);--basalt-neutral-36: oklch(.4748 0 0);--basalt-neutral-42: oklch(.5278 0 0);--basalt-neutral-52: oklch(.6167 0 0);--basalt-neutral-59: oklch(.675 0 0);--basalt-neutral-63: oklch(.709 0 0);--basalt-neutral-64: oklch(.7155 0 0);--basalt-neutral-73: oklch(.79 0 0);--basalt-neutral-75: oklch(.8047 0 0);--basalt-neutral-93: oklch(.9461 0 0);--basalt-neutral-94: oklch(.9551 0 0);--basalt-neutral-96: oklch(.9702 0 0);--basalt-neutral-98: oklch(.9851 0 0);--basalt-neutral-100: oklch(1 0 0);--basalt-neutral-42-4: oklch(.53 0 0);--basalt-neutral-95-7: oklch(.966 0 0);--basalt-white-6: oklch(1 0 0 / .06);--basalt-white-8: oklch(1 0 0 / .08);--basalt-white-9: oklch(1 0 0 / .09);--basalt-white-15: oklch(1 0 0 / .145);--basalt-white-24: oklch(1 0 0 / .24);--basalt-white-38: oklch(1 0 0 / .38);--basalt-black-4: oklch(0 0 0 / .04);--basalt-black-6: oklch(0 0 0 / .06);--basalt-black-7: oklch(0 0 0 / .07);--basalt-black-8: oklch(0 0 0 / .08);--basalt-black-10: oklch(0 0 0 / .1);--basalt-black-16: oklch(0 0 0 / .16);--basalt-black-18: oklch(0 0 0 / .18);--basalt-black-24: oklch(0 0 0 / .24);--basalt-black-40: oklch(0 0 0 / .4);--basalt-black-45: oklch(0 0 0 / .45);--basalt-black-60: oklch(0 0 0 / .6);--basalt-black-80: oklch(0 0 0 / .8);--basalt-status-danger-dark: oklch(.7 .191 22);--basalt-status-success-dark: oklch(.73 .211 148);--basalt-status-warning-dark: oklch(.79 .171 70);--basalt-status-danger-light: oklch(.51 .19 25);--basalt-status-success-light: oklch(.55 .159 148);--basalt-status-warning-light: oklch(.6 .137 62);--basalt-space-0: 0px;--basalt-space-1: 4px;--basalt-space-2: 8px;--basalt-space-3: 12px;--basalt-space-4: 16px;--basalt-space-5: 20px;--basalt-space-6: 24px;--basalt-space-8: 32px;--basalt-space-10: 40px;--basalt-space-12: 48px;--basalt-space-16: 64px;--basalt-space-24: 96px;--basalt-space-0-5: 2px;--basalt-space-1-5: 6px;--basalt-space-2-5: 10px;--basalt-space-3-5: 14px;--basalt-radius-2xs: 2px;--basalt-radius-xs: 4px;--basalt-radius-sm: 6px;--basalt-radius-md: 8px;--basalt-radius-lg: 12px;--basalt-radius-xl: 16px;--basalt-radius-full: 9999px;--basalt-size-control-xs: 24px;--basalt-size-control-sm: 28px;--basalt-size-control-md: 32px;--basalt-size-control-lg: 36px;--basalt-size-control-xl: 40px;--basalt-size-control-2xl: 44px;--basalt-size-control-3xl: 48px;--basalt-size-control-4xl: 52px;--basalt-size-control-5xl: 56px;--basalt-size-control-6xl: 64px;--basalt-size-menu-row: 36px;--basalt-size-menu-row-touch: 44px;--basalt-size-tap-min: 44px;--basalt-size-icon-sm: 16px;--basalt-size-icon-md: 20px;--basalt-size-icon-lg: 24px;--basalt-size-focus-width: 2px;--basalt-size-focus-offset: 2px;--basalt-size-hairline: 1px;--basalt-size-indicator: 2px;--basalt-size-description-label: 160px;--basalt-size-field-label-inline: 80px;--basalt-size-track: 4px;--basalt-size-dot: 6px;--basalt-size-choice: 16px;--basalt-size-choice-mark: 12px;--basalt-size-switch-width: 32px;--basalt-size-switch-height: 18px;--basalt-size-switch-thumb: 14px;--basalt-size-kbd: 20px;--basalt-size-badge: 22px;--basalt-size-table-row: 40px;--basalt-size-command-input: 48px;--basalt-size-code-line-height: 20px;--basalt-size-underline-offset: 3px;--basalt-size-slider-length: 180px;--basalt-size-dialog-width: 480px;--basalt-size-sheet-width: 440px;--basalt-size-command-width: 560px;--basalt-size-dialog-width-wide: 992px;--basalt-size-search-trigger: 200px;--basalt-size-search-logo-width: 96px;--basalt-size-search-logo-height: 48px;--basalt-size-search-pack-width: 48px;--basalt-size-search-pack-height: 60px;--basalt-size-toast-width: 360px;--basalt-size-popover-max: 320px;--basalt-size-tooltip-max: 280px;--basalt-size-menu-min: 200px;--basalt-size-select-min: 160px;--basalt-size-popup-max-height: 360px;--basalt-size-list-width: 320px;--basalt-size-header: 56px;--basalt-size-tab-bar: 56px;--basalt-size-sidebar-width: 256px;--basalt-size-rail-width: 72px;--basalt-size-page-width: 72rem;--basalt-size-prose-width: 34rem;--basalt-size-gutter: var(--basalt-space-6);--basalt-size-gutter-narrow: var(--basalt-space-4);--basalt-size-breakpoint-md: 720px;--basalt-size-breakpoint-lg: 1024px;--basalt-size-breakpoint-container: 480px;--basalt-size-breakpoint-container-sm: 340px;--basalt-size-breakpoint-container-lg: 640px;--basalt-size-cut: 2px;--basalt-size-hatch-pitch: 4px;--basalt-size-meter-marker: 12px;--basalt-opacity-amount: .72;--basalt-font-family-sans: Geist, "Geist Fallback", ui-sans-serif, system-ui, sans-serif;--basalt-font-family-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;--basalt-font-weight-regular: 400;--basalt-font-weight-medium: 500;--basalt-font-weight-semibold: 600;--basalt-text-xs-size: 12px;--basalt-text-xs-line-height: 16px;--basalt-text-xs-tracking: .01em;--basalt-text-sm-size: 13px;--basalt-text-sm-line-height: 18px;--basalt-text-sm-tracking: 0em;--basalt-text-base-size: 14px;--basalt-text-base-line-height: 20px;--basalt-text-base-tracking: 0em;--basalt-text-md-size: 16px;--basalt-text-md-line-height: 24px;--basalt-text-md-tracking: -.005em;--basalt-text-lg-size: 18px;--basalt-text-lg-line-height: 26px;--basalt-text-lg-tracking: -.01em;--basalt-text-xl-size: 20px;--basalt-text-xl-line-height: 28px;--basalt-text-xl-tracking: -.015em;--basalt-text-2xl-size: 24px;--basalt-text-2xl-line-height: 30px;--basalt-text-2xl-tracking: -.02em;--basalt-text-3xl-size: 30px;--basalt-text-3xl-line-height: 36px;--basalt-text-3xl-tracking: -.025em;--basalt-text-4xl-size: 40px;--basalt-text-4xl-line-height: 44px;--basalt-text-4xl-tracking: -.03em;--basalt-text-5xl-size: 56px;--basalt-text-5xl-line-height: 60px;--basalt-text-5xl-tracking: -.035em;--basalt-blur-chrome: 12px;--basalt-duration-instant: 0ms;--basalt-duration-fast: .1s;--basalt-duration-base: .15s;--basalt-duration-slow: .2s;--basalt-duration-slower: .3s;--basalt-duration-confirm: 1.5s;--basalt-duration-figure: .6s;--basalt-duration-stagger: 22ms;--basalt-duration-loop-ring: .64s;--basalt-duration-loop-braille: .8s;--basalt-duration-loop-fade: 1.2s;--basalt-duration-loop-ambient: 6s;--basalt-ease-out: cubic-bezier(.16, 1, .3, 1);--basalt-ease-in-out: cubic-bezier(.65, 0, .35, 1);--basalt-ease-in: cubic-bezier(.4, 0, 1, 1);--basalt-ease-linear: cubic-bezier(0, 0, 1, 1);--basalt-layer-base: 0;--basalt-layer-sticky: 100;--basalt-layer-overlay: 500;--basalt-layer-popover: 600;--basalt-layer-dialog: 700;--basalt-layer-toast: 800;--basalt-layer-tooltip: 1100}:root,[data-theme=light],.light{color-scheme:light;--basalt-status-danger: var(--basalt-status-danger-light);--basalt-status-success: var(--basalt-status-success-light);--basalt-status-warning: var(--basalt-status-warning-light);--basalt-syntax-keyword: oklch(.5 .12 255);--basalt-syntax-string: oklch(.5 .12 150);--basalt-syntax-constant: oklch(.5 .1 70);--basalt-syntax-function: oklch(.5 .12 305);--basalt-syntax-comment: var(--basalt-text-tertiary);--basalt-surface-0: var(--basalt-neutral-98);--basalt-surface-1: var(--basalt-neutral-100);--basalt-surface-2: var(--basalt-neutral-100);--basalt-surface-3: var(--basalt-neutral-100);--basalt-surface-page: var(--basalt-surface-0);--basalt-surface-raised: var(--basalt-surface-1);--basalt-surface-overlay: var(--basalt-surface-2);--basalt-surface-top: var(--basalt-surface-3);--basalt-surface-sunken: var(--basalt-neutral-96);--basalt-surface-well-2: var(--basalt-surface-sunken);--basalt-surface-well-3: var(--basalt-surface-sunken);--basalt-surface-sunken-strong: var(--basalt-neutral-94);--basalt-surface-kbd: var(--basalt-black-6);--basalt-surface-chrome: oklch(.9851 0 0 / .96);--basalt-surface-placeholder: var(--basalt-neutral-94);--basalt-text-primary: var(--basalt-neutral-9);--basalt-text-secondary: var(--basalt-neutral-30);--basalt-text-tertiary: var(--basalt-neutral-42);--basalt-text-disabled: var(--basalt-neutral-64);--basalt-text-inverse: var(--basalt-neutral-100);--basalt-border-rim: var(--basalt-black-8);--basalt-border-rim-top: var(--basalt-black-8);--basalt-border-hairline: var(--basalt-black-8);--basalt-border-hover: var(--basalt-black-16);--basalt-border-divider: var(--basalt-black-8);--basalt-border-input: var(--basalt-black-45);--basalt-border-field: var(--basalt-border-input);--basalt-border-focus: var(--basalt-neutral-30);--basalt-state-hover: var(--basalt-black-4);--basalt-state-selected: var(--basalt-black-7);--basalt-plate-0: oklch(.9325 0 0);--basalt-plate-1: oklch(.9466 0 0);--basalt-plate-2: oklch(.9466 0 0);--basalt-plate-3: oklch(.9466 0 0);--basalt-action-primary: var(--basalt-neutral-9);--basalt-action-primary-hover: var(--basalt-neutral-0);--basalt-action-primary-press: var(--basalt-neutral-20);--basalt-action-primary-text: var(--basalt-neutral-100);--basalt-line-contrast: var(--basalt-black-45);--basalt-ink-contrast: var(--basalt-neutral-30);--basalt-field-contrast: var(--basalt-neutral-30);--basalt-scrim: var(--basalt-black-40);--basalt-shadow-hairline: 0px 0px 0px 1px oklch(0 0 0 / .08), 0px 0px 0px 1px oklch(.9851 0 0);--basalt-shadow-overlay: 0px 4px 8px -4px oklch(0 0 0 / .06), 0px 16px 24px -8px oklch(0 0 0 / .1);--basalt-shadow-modal: 0px 8px 16px -4px oklch(0 0 0 / .06), 0px 24px 32px -8px oklch(0 0 0 / .1)}[data-theme=dark],.dark{color-scheme:dark;--basalt-status-danger: var(--basalt-status-danger-dark);--basalt-status-success: var(--basalt-status-success-dark);--basalt-status-warning: var(--basalt-status-warning-dark);--basalt-syntax-keyword: oklch(.8 .09 255);--basalt-syntax-string: oklch(.8 .09 150);--basalt-syntax-constant: oklch(.8 .09 70);--basalt-syntax-function: oklch(.8 .09 305);--basalt-syntax-comment: var(--basalt-text-tertiary);--basalt-surface-0: var(--basalt-neutral-0);--basalt-surface-1: var(--basalt-neutral-4);--basalt-surface-2: var(--basalt-neutral-7);--basalt-surface-3: var(--basalt-neutral-9);--basalt-surface-page: var(--basalt-surface-0);--basalt-surface-raised: var(--basalt-surface-1);--basalt-surface-overlay: var(--basalt-surface-2);--basalt-surface-top: var(--basalt-surface-3);--basalt-surface-sunken: var(--basalt-surface-1);--basalt-surface-well-2: var(--basalt-surface-2);--basalt-surface-well-3: var(--basalt-surface-3);--basalt-surface-sunken-strong: var(--basalt-surface-2);--basalt-surface-kbd: var(--basalt-white-8);--basalt-surface-chrome: oklch(0 0 0 / .925);--basalt-surface-placeholder: var(--basalt-neutral-9);--basalt-text-primary: var(--basalt-neutral-95-7);--basalt-text-secondary: var(--basalt-neutral-73);--basalt-text-tertiary: var(--basalt-neutral-59);--basalt-text-disabled: var(--basalt-neutral-42-4);--basalt-text-inverse: var(--basalt-neutral-0);--basalt-border-hairline: var(--basalt-white-15);--basalt-border-rim: var(--basalt-white-6);--basalt-border-rim-top: var(--basalt-white-8);--basalt-border-hover: var(--basalt-white-24);--basalt-border-divider: var(--basalt-white-6);--basalt-border-input: var(--basalt-white-38);--basalt-border-field: var(--basalt-border-input);--basalt-border-focus: var(--basalt-text-secondary);--basalt-state-hover: var(--basalt-white-6);--basalt-state-selected: var(--basalt-white-9);--basalt-plate-0: oklch(.2438 0 0);--basalt-plate-1: oklch(.2703 0 0);--basalt-plate-2: oklch(.2926 0 0);--basalt-plate-3: oklch(.2926 0 0);--basalt-action-primary: var(--basalt-neutral-93);--basalt-action-primary-hover: var(--basalt-neutral-100);--basalt-action-primary-press: var(--basalt-neutral-75);--basalt-action-primary-text: var(--basalt-neutral-0);--basalt-line-contrast: var(--basalt-white-38);--basalt-ink-contrast: var(--basalt-text-secondary);--basalt-field-contrast: var(--basalt-text-secondary);--basalt-scrim: var(--basalt-black-80);--basalt-shadow-hairline: 0px 0px 0px 1px oklch(1 0 0 / .145), 0px 0px 0px 1px oklch(0 0 0);--basalt-shadow-overlay: 0px 4px 8px -4px oklch(0 0 0 / .24), 0px 16px 24px -8px oklch(0 0 0 / .4);--basalt-shadow-modal: 0px 8px 16px -4px oklch(0 0 0 / .24), 0px 24px 32px -8px oklch(0 0 0 / .6)}@media(prefers-color-scheme:dark){:root:not([data-theme=light]):not(.light){color-scheme:dark;--basalt-status-danger: var(--basalt-status-danger-dark);--basalt-status-success: var(--basalt-status-success-dark);--basalt-status-warning: var(--basalt-status-warning-dark);--basalt-syntax-keyword: oklch(.8 .09 255);--basalt-syntax-string: oklch(.8 .09 150);--basalt-syntax-constant: oklch(.8 .09 70);--basalt-syntax-function: oklch(.8 .09 305);--basalt-surface-0: var(--basalt-neutral-0);--basalt-surface-1: var(--basalt-neutral-4);--basalt-surface-2: var(--basalt-neutral-7);--basalt-surface-3: var(--basalt-neutral-9);--basalt-surface-sunken: var(--basalt-surface-1);--basalt-surface-well-2: var(--basalt-surface-2);--basalt-surface-well-3: var(--basalt-surface-3);--basalt-surface-sunken-strong: var(--basalt-surface-2);--basalt-surface-kbd: var(--basalt-white-8);--basalt-surface-chrome: oklch(0 0 0 / .925);--basalt-surface-placeholder: var(--basalt-neutral-9);--basalt-text-primary: var(--basalt-neutral-95-7);--basalt-text-secondary: var(--basalt-neutral-73);--basalt-text-tertiary: var(--basalt-neutral-59);--basalt-text-disabled: var(--basalt-neutral-42-4);--basalt-text-inverse: var(--basalt-neutral-0);--basalt-border-hairline: var(--basalt-white-15);--basalt-border-rim: var(--basalt-white-6);--basalt-border-rim-top: var(--basalt-white-8);--basalt-border-hover: var(--basalt-white-24);--basalt-border-divider: var(--basalt-white-6);--basalt-border-input: var(--basalt-white-38);--basalt-border-focus: var(--basalt-text-secondary);--basalt-state-hover: var(--basalt-white-6);--basalt-state-selected: var(--basalt-white-9);--basalt-plate-0: oklch(.2438 0 0);--basalt-plate-1: oklch(.2703 0 0);--basalt-plate-2: oklch(.2926 0 0);--basalt-plate-3: oklch(.2926 0 0);--basalt-action-primary: var(--basalt-neutral-93);--basalt-action-primary-hover: var(--basalt-neutral-100);--basalt-action-primary-press: var(--basalt-neutral-75);--basalt-action-primary-text: var(--basalt-neutral-0);--basalt-line-contrast: var(--basalt-white-38);--basalt-ink-contrast: var(--basalt-text-secondary);--basalt-field-contrast: var(--basalt-text-secondary);--basalt-scrim: var(--basalt-black-80);--basalt-shadow-hairline: 0px 0px 0px 1px oklch(1 0 0 / .145), 0px 0px 0px 1px oklch(0 0 0);--basalt-shadow-overlay: 0px 4px 8px -4px oklch(0 0 0 / .24), 0px 16px 24px -8px oklch(0 0 0 / .4);--basalt-shadow-modal: 0px 8px 16px -4px oklch(0 0 0 / .24), 0px 24px 32px -8px oklch(0 0 0 / .6)}}@media(prefers-contrast:more){:root,[data-theme=light],[data-theme=dark],.light,.dark,:root:not([data-theme=light]):not(.light){--basalt-border-hairline: var(--basalt-line-contrast);--basalt-border-rim: var(--basalt-line-contrast);--basalt-border-rim-top: var(--basalt-line-contrast);--basalt-border-divider: var(--basalt-line-contrast);--basalt-text-tertiary: var(--basalt-ink-contrast);--basalt-border-field: var(--basalt-field-contrast);--basalt-border-hover: var(--basalt-text-secondary);--basalt-shadow-hairline: 0px 0px 0px 1px var(--basalt-line-contrast), 0px 0px 0px 1px var(--basalt-surface-0)}}@media(prefers-reduced-motion:reduce){:root{--basalt-duration-base: .1s;--basalt-duration-slow: .1s;--basalt-duration-slower: .1s;--basalt-duration-figure: .1s;--basalt-duration-stagger: 0ms}}@layer reset,basalt;@layer reset{*,*:before,*:after{box-sizing:border-box}html{background:var(--basalt-surface-0);-webkit-text-size-adjust:100%}body{margin:0;background:var(--basalt-surface-0);color:var(--basalt-text-primary);font:var(--basalt-font-weight-regular) var(--bh-base);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}b,strong,th{font-weight:var(--basalt-font-weight-semibold)}img,svg,video{max-width:100%}button,input,select,textarea{font:inherit;letter-spacing:inherit;color:inherit;margin:0}a{color:inherit;text-decoration:underline;text-decoration-color:var(--basalt-border-input);text-underline-offset:var(--basalt-size-underline-offset)}a:hover{text-decoration-color:currentColor}h1,h2,h3,h4,p,ul,ol,dl,dd,figure,blockquote{margin:0}h1,h2,h3,h4{font-weight:var(--basalt-font-weight-semibold);color:var(--basalt-text-primary);text-wrap:balance}h5,h6{font-weight:var(--basalt-font-weight-semibold)}h1,.display{font-size:var(--basalt-text-3xl-size);line-height:var(--basalt-text-3xl-line-height);letter-spacing:var(--basalt-text-3xl-tracking)}h2{font-size:var(--basalt-text-2xl-size);line-height:var(--basalt-text-2xl-line-height);letter-spacing:var(--basalt-text-2xl-tracking)}h3{font-size:var(--basalt-text-lg-size);line-height:var(--basalt-text-lg-line-height);letter-spacing:var(--basalt-text-lg-tracking)}h4{font-size:var(--basalt-text-base-size);line-height:var(--basalt-text-base-line-height)}@media(width>=720px){h1,.display{font-size:var(--basalt-text-4xl-size);line-height:var(--basalt-text-4xl-line-height);letter-spacing:var(--basalt-text-4xl-tracking)}}p,li{text-wrap:pretty}code:not(.code code){padding:var(--basalt-size-hairline) var(--basalt-space-1);border-radius:var(--basalt-radius-xs);background:var(--basalt-surface-kbd);font:var(--basalt-font-weight-regular) .92em / 1 var(--basalt-font-family-mono)}pre,code,kbd,samp{font-family:var(--basalt-font-family-mono)}}@layer basalt{:root{--bh-xs: var(--basalt-text-xs-size) / var(--basalt-text-xs-line-height) var(--basalt-font-family-sans);--bh-sm: var(--basalt-text-sm-size) / var(--basalt-text-sm-line-height) var(--basalt-font-family-sans);--bh-base: var(--basalt-text-base-size) / var(--basalt-text-base-line-height) var(--basalt-font-family-sans);--bh-md: var(--basalt-text-md-size) / var(--basalt-text-md-line-height) var(--basalt-font-family-sans);--bh-2xl: var(--basalt-text-2xl-size) / var(--basalt-text-2xl-line-height) var(--basalt-font-family-sans);--bh-xs-mono: var(--basalt-text-xs-size) / var(--basalt-text-xs-line-height) var(--basalt-font-family-mono);--bh-sm-mono: var(--basalt-text-sm-size) / var(--basalt-size-code-line-height) var(--basalt-font-family-mono)}:root{accent-color:var(--basalt-action-primary);--basalt-gutter: var(--basalt-size-gutter)}@media(width<720px){:root{--basalt-gutter: var(--basalt-size-gutter-narrow)}}a,button,summary,[role=tab],.row,.disclosure,.segment button{-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}:focus-visible{outline:var(--basalt-size-focus-width) solid var(--basalt-border-focus);outline-offset:var(--basalt-size-focus-offset)}::selection{background:var(--basalt-state-selected)}svg.icon{flex:none}svg[data-brand]{pointer-events:none}.dot-sep:before{content:"·";content:"·" / ""}.dot-sep[data-spaced]:before{content:" · ";content:" · " / ""}.dot-sep>.visually-hidden{white-space:pre}.display{font-weight:var(--basalt-font-weight-semibold)}.text-5xl{font-size:var(--basalt-text-5xl-size);line-height:var(--basalt-text-5xl-line-height);letter-spacing:var(--basalt-text-5xl-tracking);font-weight:var(--basalt-font-weight-semibold)}.lead{font-size:var(--basalt-text-md-size);line-height:var(--basalt-text-md-line-height);color:var(--basalt-text-secondary);max-width:var(--basalt-size-prose-width);text-wrap:pretty}.eyebrow{font:var(--basalt-font-weight-medium) var(--bh-xs);color:var(--basalt-text-secondary)}.muted{color:var(--basalt-text-secondary)}.faint{color:var(--basalt-text-tertiary)}.small{font-size:var(--basalt-text-sm-size);line-height:var(--basalt-text-sm-line-height)}.mono{font-family:var(--basalt-font-family-mono)}.num{font-variant-numeric:tabular-nums}.prose{max-inline-size:var(--basalt-size-prose-width);margin-inline:0 auto}.prose>*+*{margin-top:var(--basalt-space-4)}.prose>:is(h2,h3){margin-top:var(--basalt-space-8)}.prose>:is(h2,h3)+*{margin-top:var(--basalt-space-2)}.prose :is(ul,ol){padding-inline-start:var(--basalt-space-5)}.prose li+li{margin-top:var(--basalt-space-1)}.prose blockquote{padding-inline-start:var(--basalt-space-4);color:var(--basalt-text-secondary)}.page{width:100%;max-width:var(--basalt-size-page-width);margin-inline:auto;padding:var(--basalt-space-8) var(--basalt-gutter) var(--basalt-space-16)}.page.narrow{max-width:46rem}@media(width<720px){.page{padding-block:var(--basalt-space-6) var(--basalt-space-12)}}.stack{display:flex;flex-direction:column;gap:var(--gap, var(--basalt-space-4));min-width:0}.cluster{display:flex;flex-wrap:wrap;align-items:center;gap:var(--gap, var(--basalt-space-2));min-width:0}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(var(--min, 220px),100%),1fr));gap:var(--gap, var(--basalt-space-4))}.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--gap, var(--basalt-space-6))}@media(width>=720px){.split.aside{grid-template-columns:minmax(0,var(--basalt-size-list-width)) minmax(0,1fr);align-items:start}}@media(width<720px){.split{grid-template-columns:minmax(0,1fr)}}.spacer{flex:1}@media(width<720px){.hide-narrow{display:none!important}}.section{margin-top:var(--basalt-space-12)}.section>.section-head{margin-bottom:var(--basalt-space-4)}.footer{margin-top:var(--basalt-space-16);padding-top:var(--basalt-space-4);border-top:var(--basalt-size-hairline) solid var(--basalt-border-divider);color:var(--basalt-text-secondary);font-size:var(--basalt-text-sm-size)}.footer:not(.page .footer){width:calc(min(100%,var(--basalt-size-page-width)) - 2 * var(--basalt-gutter));margin-top:0;margin-inline:auto;padding-bottom:var(--basalt-space-8)}.skip-link{position:absolute;inset-inline-start:var(--basalt-space-2);top:var(--basalt-space-2);transform:translateY(-200%);padding:var(--basalt-space-2) var(--basalt-space-3);border:var(--basalt-size-hairline) solid var(--basalt-border-rim);border-top-color:var(--basalt-border-rim-top);border-radius:var(--basalt-radius-md);background:var(--basalt-surface-3);color:var(--basalt-text-primary);z-index:var(--basalt-layer-toast)}.skip-link:focus{transform:none;box-shadow:var(--basalt-shadow-overlay)}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}:is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-1);--panel-next: var(--basalt-surface-2);--panel-well: var(--basalt-surface-sunken);--panel-plate: light-dark(var(--basalt-state-selected), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--panel-next)));position:relative;min-width:0;background-color:var(--panel-bg);color:var(--basalt-text-primary);border:var(--basalt-size-hairline) solid var(--basalt-border-rim);border-top-color:var(--basalt-border-rim-top);border-radius:var(--basalt-radius-lg)}:is(.panel,.card,.callout,.code,.table-wrap) :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-2);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-2)}:is(.panel,.card,.callout,.code,.table-wrap) :is(.panel,.card,.callout,.code,.table-wrap) :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-3);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-3)}@supports not (color: light-dark(white,black)){:root,[data-theme=light],.light{--_dkp: 0%}[data-theme=dark],.dark{--_dkp: 100%}@media(prefers-color-scheme:dark){:root:not([data-theme=light]):not(.light){--_dkp: 100%}}:root,:is(.panel,.card,.callout,.code,.table-wrap){--_dk: color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--panel-next, var(--basalt-surface-1)));--_mx: color-mix(in srgb, var(--_dk) var(--_dkp), color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--panel-bg, var(--basalt-surface-page))));--panel-plate: color-mix(in srgb, var(--_dk) var(--_dkp), var(--basalt-state-selected))}.choice-card.choice-card{--_solid: var(--_mx)}.btn.btn.btn[aria-pressed=true]:not([data-variant=primary],[data-variant=danger]){background:var(--_mx)}.segment.segment{--pill-fill: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-top)) var(--_dkp), var(--basalt-surface-top))}select.input.input{--_pop-plate: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--_pop-next)) var(--_dkp), var(--basalt-state-selected))}}.panel-pad,.card{padding:var(--basalt-space-4)}@media(width>=720px){.panel-pad.lg,.card.lg{padding:var(--basalt-space-6)}}.panel-head{display:flex;flex-wrap:wrap;align-items:center;gap:var(--basalt-space-2);padding:var(--basalt-space-3) var(--basalt-space-4);border-bottom:var(--basalt-size-hairline) solid var(--basalt-border-divider);font-weight:var(--basalt-font-weight-medium)}.float{--panel-bg: var(--basalt-surface-1);--panel-next: var(--basalt-surface-2);--panel-well: var(--basalt-surface-sunken);box-shadow:var(--basalt-shadow-overlay)}.float.modal{box-shadow:var(--basalt-shadow-modal);--panel-bg: var(--basalt-surface-1);--panel-next: var(--basalt-surface-2);--panel-well: var(--basalt-surface-sunken)}.float.modal :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-2);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-2)}[data-level="0"]{--panel-next: var(--basalt-surface-1)}[data-level="1"] :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-2);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-2)}[data-level="2"] :is(.panel,.card,.callout,.code,.table-wrap),[data-level="3"] :is(.panel,.card,.callout,.code,.table-wrap){--panel-bg: var(--basalt-surface-3);--panel-next: var(--basalt-surface-3);--panel-well: var(--basalt-surface-well-3)}.divider{display:block;height:var(--basalt-size-hairline);margin:0;border:0;background:var(--basalt-border-divider);flex:none}.divide-y>*+*{border-top:var(--basalt-size-hairline) solid var(--basalt-border-divider)}.btn{position:relative;--_h: var(--basalt-size-control-md);--_px: var(--basalt-space-3);display:inline-flex;align-items:center;justify-content:center;gap:var(--basalt-space-1-5);height:var(--_h);padding:0 var(--_px);margin:0;border:0;border-radius:var(--basalt-radius-sm);font:var(--basalt-font-weight-medium) var(--basalt-text-base-size) / 1 var(--basalt-font-family-sans);white-space:nowrap;text-decoration:none;cursor:pointer;user-select:none;background:var(--basalt-surface-1);color:var(--basalt-text-primary);box-shadow:var(--basalt-shadow-hairline);transition-property:background-color,color,box-shadow,transform;transition-duration:var(--basalt-duration-fast);transition-timing-function:var(--basalt-ease-out)}.btn[data-size=sm]{--_h: var(--basalt-size-control-sm);--_px: var(--basalt-space-2-5);font-size:var(--basalt-text-sm-size)}.btn[data-size=lg]{--_h: var(--basalt-size-control-lg);--_px: var(--basalt-space-3-5);border-radius:var(--basalt-radius-md)}.btn[data-icon-only]{width:var(--_h);padding:0}.btn[data-variant=primary]{background:var(--basalt-action-primary);color:var(--basalt-action-primary-text);box-shadow:none}.btn[data-variant=ghost]{background:transparent;color:var(--basalt-text-secondary);box-shadow:none}.btn[data-variant=danger]{background:transparent;color:var(--basalt-status-danger);box-shadow:inset 0 0 0 var(--basalt-size-hairline) color-mix(in oklch,var(--basalt-status-danger) 45%,transparent)}@media(hover:hover){.btn:hover:not([disabled],[aria-disabled=true]){box-shadow:0 0 0 var(--basalt-size-hairline) var(--basalt-border-hover),0 0 0 var(--basalt-size-hairline) var(--basalt-surface-0)}.btn[data-variant=primary]:hover:not([disabled],[aria-disabled=true]){background:var(--basalt-action-primary-hover);box-shadow:none}.btn[data-variant=ghost]:hover:not([disabled],[aria-disabled=true]){background:var(--basalt-state-hover);color:var(--basalt-text-primary);box-shadow:none}.btn[data-variant=danger]:hover:not([disabled],[aria-disabled=true]){background:var(--basalt-state-hover);box-shadow:inset 0 0 0 var(--basalt-size-hairline) color-mix(in oklch,var(--basalt-status-danger) 70%,transparent)}}.btn:active:not([disabled],[aria-disabled=true]){background:var(--basalt-state-selected)}.btn[data-variant=primary]:active:not([disabled],[aria-disabled=true]){background:var(--basalt-action-primary-press)}.btn:active:not([disabled],[aria-disabled=true],[aria-busy=true]){transform:scale(.98)}.btn:active:not([disabled],[aria-disabled=true],[aria-busy=true]):after{content:"";position:absolute;inset:-1.03%}.btn[disabled],.btn[aria-disabled=true]{cursor:not-allowed;color:var(--basalt-text-disabled);box-shadow:0 0 0 var(--basalt-size-hairline) color-mix(in oklch,var(--basalt-border-hairline) 50%,transparent)}.btn[data-variant=primary][disabled],.btn[data-variant=primary][aria-disabled=true]{background:var(--basalt-state-selected);box-shadow:none}.btn[data-variant=ghost][disabled]{box-shadow:none}.btn[aria-busy=true]{cursor:progress}.btn[aria-busy=true]>*{opacity:0}.btn[aria-busy=true]:after{content:"";position:absolute;inset:0;margin:auto;width:var(--basalt-size-icon-sm);height:var(--basalt-size-icon-sm);border:1.5px solid color-mix(in oklch,currentColor 25%,transparent);border-top-color:currentColor;border-radius:var(--basalt-radius-full);animation:bh-spin var(--basalt-duration-loop-ring) linear infinite}.btn svg{flex:none}@media(pointer:coarse){.btn{min-height:var(--basalt-size-tap-min);border-radius:var(--basalt-radius-md)}.btn[data-icon-only]{min-width:var(--basalt-size-tap-min)}}@media(pointer:coarse){a:not(.btn,.row,.tab,.disclosure,.brand,.skip-link,:is(p,li,.prose,.small,.hint,.error,.callout-body) a),nav a:not(.btn),.footer a,.tap{display:inline-flex;align-items:center;min-height:var(--basalt-size-tap-min);margin-block:var(--bh-tap-margin, min( 0lh , calc((1lh - var(--basalt-size-tap-min)) / 2)))}.skip-link{display:inline-flex;align-items:center;min-height:var(--basalt-size-tap-min)}:is(a:not(.btn,.row,.tab,.disclosure,.brand,.skip-link,.topbar-links a,:is(p,li,.prose,.small,.hint,.error,.callout-body) a),.tap){position:relative}:is(a:not(.btn,.row,.tab,.disclosure,.brand,.skip-link,.topbar-links a,:is(p,li,.prose,.small,.hint,.error,.callout-body) a),.tap):after{content:"";position:absolute;inset-block:0;left:50%;width:max(100%,var(--basalt-size-tap-min));transform:translate(-50%)}}@keyframes bh-spin{to{transform:rotate(360deg)}}@keyframes bh-fade{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.btn[aria-busy=true]:after{animation:bh-fade var(--basalt-duration-loop-fade) var(--basalt-ease-in-out) infinite;border-top-color:color-mix(in oklch,currentColor 25%,transparent)}.btn:active:not([disabled],[aria-disabled=true],[aria-busy=true]){transform:none}.btn{transition-property:background-color,color,box-shadow}}@media(forced-colors:active){:is(.panel,.card,.callout,.code,.table-wrap){border-color:CanvasText}.btn{border:var(--basalt-size-hairline) solid ButtonText}}@media print{.skip-link{display:none}:is(.panel,.card,.callout,.code,.table-wrap){break-inside:avoid}}}
diff --git a/Sources/BasaltTokens/Tokens.swift b/Sources/BasaltTokens/Tokens.swift
index ede137d1..493a0824 100644
--- a/Sources/BasaltTokens/Tokens.swift
+++ b/Sources/BasaltTokens/Tokens.swift
@@ -251,6 +251,30 @@ extension Basalt {
dark: RGBA(red: 1, green: 1, blue: 1, alpha: 0.09)
)
+ /// The lit row's plate on the page (level 0), as one opaque colour: state-selected (black at 7%) over surface-0. For a part that replaces its own fill (a pressed toggle, a chosen card) or an app's own list row; --basalt-plate follows the level.
+ public static let plate0 = ThemedColor(
+ light: RGBA(red: 0.911749, green: 0.911749, blue: 0.911749, alpha: 1),
+ dark: RGBA(red: 0.125736, green: 0.125736, blue: 0.125736, alpha: 1)
+ )
+
+ /// The plate on a level-1 surface: state-selected over surface-1. In light, levels 1 to 3 are one white, so their plates are one colour.
+ public static let plate1 = ThemedColor(
+ light: RGBA(red: 0.930055, green: 0.930055, blue: 0.930055, alpha: 1),
+ dark: RGBA(red: 0.150617, green: 0.150617, blue: 0.150617, alpha: 1)
+ )
+
+ /// The plate on a level-2 surface: state-selected over surface-2.
+ public static let plate2 = ThemedColor(
+ light: RGBA(red: 0.930055, green: 0.930055, blue: 0.930055, alpha: 1),
+ dark: RGBA(red: 0.172036, green: 0.172036, blue: 0.172036, alpha: 1)
+ )
+
+ /// The plate on a level-3 surface: state-selected over surface-3.
+ public static let plate3 = ThemedColor(
+ light: RGBA(red: 0.930055, green: 0.930055, blue: 0.930055, alpha: 1),
+ dark: RGBA(red: 0.172036, green: 0.172036, blue: 0.172036, alpha: 1)
+ )
+
/// The one primary action per view: the inverse of the page.
public static let actionPrimary = ThemedColor(
light: RGBA(red: 0.090173, green: 0.090173, blue: 0.090173, alpha: 1),
diff --git a/docs/foundations.md b/docs/foundations.md
index 2dc87c94..2ad43421 100644
--- a/docs/foundations.md
+++ b/docs/foundations.md
@@ -339,7 +339,7 @@ kept as a rule so both themes behave alike (DECISIONS 166). Four text levels wer
prop, because paint without semantics ends up on a `div` nothing can operate. A real choice box (`size-choice`, the
checked control's own look) sits in a seat reserved on every choice card, on its header line, inline-end of the title,
empty at rest with the input boundary, so choosing moves no title. Selected is the selected wash as one solid fill at the
- card's own level (the active-row plate recipe: `--_plate-solid`, about `#262626` on level 1 in dark and `#ededed` on
+ card's own level (the active-row plate, `--basalt-plate`, the token `plate-1` on level 1: about `#262626` on level 1 in dark and `#ededed` on
white), with the rim and the level unchanged: level is position, and a chosen card is not nested deeper. The title stays
primary with no weight change; tertiary content steps to secondary on the fill. Hover on an unselected card is the
hover wash alone, with no further step on a selected one; there is no press scale; focus is the control ring at +2
@@ -826,7 +826,7 @@ type. `Heading size` takes `"6xl"`, `"7xl"`, `"hero"` and `"display"`; the roles
## Space, size, radius
- **Space:** a 4px base, with Tailwind-compatible names (`space-4` is 16px), plus the half
- steps 0.5, 1.5, 2.5 and 3.5 (2, 6, 10 and 14px) for control padding and optical spacing, and `space-32` (128px), the large section gap.
+ steps 0.5, 1.5, 2.5 and 3.5 (2, 6, 10 and 14px) for control padding and optical spacing, and `space-32` (128px), the large section gap. There is no step above it: a larger length is a size with a role (a label column is `size-description-label`, 160), not a gap.
- **Component sizes are tokens too:** the tab underline (2), tracks (4), dots (6), choice boxes,
the switch, kbd and badge heights, table rows, and the widths of dialogs, sheets, toasts,
popovers, tooltips and the command menu, all under `size-*`. Component CSS has no raw
@@ -2183,7 +2183,7 @@ as if it were known, which Basalt can't detect.
## What the HTML skill does not draw
-The log slots, the status bar, the command block, the event log, the source stamp, the inline-label rows, the filter toolbar, the notice bar, the listbox, the open list, the drawer and `Reflow` are React's alone: the HTML skill has no module for them (DECISIONS 167, Q8). So are `Pagination` and `ListBand` (DECISIONS 222: the skill has no pagination module and none is added). The skill's modules draw the rest (DECISIONS 230, the owner approved the caps): `select` has `data-numeric` (the width of its widest option, measured once fonts are ready; cap 9,000), `filter` has a toolbar trigger that holds its widest value (cap 17,450), and the form dialog is a module of its own, `dialog-form` (`data-form`: the 480 box, the held head and foot, the scrolling body, full screen under 720, the top held as it opens and first focus by the input that opened it; cap 2,200), so the plain and alert dialog keep `dialog`'s 5,150. React's alone: `FormGrid` and the rest of Declare's gaps (DECISIONS 242: the form grid, a segmented control's `fullWidth`, `required`, `invalid` and its tab stop on the chosen value, a `Switch` description, `TextButton` keeping focus and underlining a `Reserve`), the held top's re-measure on a window resize, and the scrim closing a form only while nothing has been entered (the skill's scrim closes it). React's alone too: `LoadingShape` and its parts (DECISIONS 258; the skill's loading shape is a follow-up batch). Whether the skill gets the links and the charts is not decided.
+The log slots, the status bar, the command block, the event log, the source stamp, the inline-label rows, the filter toolbar, the notice bar, the listbox, the open list, the drawer and `Reflow` are React's alone: the HTML skill has no module for them (DECISIONS 167, Q8). So are `Pagination` and `ListBand` (DECISIONS 222: the skill has no pagination module and none is added). The skill's modules draw the rest (DECISIONS 230, the owner approved the caps): `select` has `data-numeric` (the width of its widest option, measured once fonts are ready; cap 9,000), `filter` has a toolbar trigger that holds its widest value (cap 17,450), and the form dialog is a module of its own, `dialog-form` (`data-form`: the 480 box, the held head and foot, the scrolling body, full screen under 720, the top held as it opens and first focus by the input that opened it; cap 2,200), so the plain and alert dialog keep `dialog`'s 5,150. React's alone: `FormGrid` and the rest of Declare's gaps (DECISIONS 242: the form grid, a segmented control's `fullWidth`, `required`, `invalid` and its tab stop on the chosen value, a `Switch` description, `TextButton` keeping focus and underlining a `Reserve`), the held top's re-measure on a window resize, and the scrim closing a form only while nothing has been entered (the skill's scrim closes it). React's alone too: `LoadingShape` and its parts (DECISIONS 258; the skill's loading shape is a follow-up batch). React's alone too: `Composer`, `Mention` and `MentionPicker` (cimip-gaps-2, B3; see [Writing to someone](#writing-to-someone-the-composer-the-mention-and-the-picker)). Whether the skill gets the links and the charts is not decided.
## Logs, status and forms
@@ -2232,6 +2232,40 @@ implementation hasn't been reviewed by the panel). Candidates D14a, D14b, D15, X
`Stat`'s source line. A countdown ticks by the second and a clock by the minute on one shared timer; `data-loops="held"` freezes both and releasing writes the current value; no live region; reduced motion does not stop them.
- **Filter toolbar** (`FilterToolbar`): the kind select (phone only), the filter, `FilterResult` and the sort with the word "Sort" beside it (`aria-hidden`, and in the select's `aria-label`).
+## Writing to someone: the composer, the mention and the picker
+
+Found by an app's message stream (cimip-gaps-2, batch B3; the no-council path, DECISIONS 226 and 265: decided and built by Opus, the code reviewed by Astra and the pixels checked by
+the lead; the owner sees the pictures before merge). Every part serves any app where people write to each other: a support inbox, a build's comments, a team chat, a shared document.
+
+- **The composer** (`Composer`). The field is Basalt's `Textarea` with an accessible name (`label`) and no visible label; the placeholder says where the message goes too. Under it a row:
+ the app's own actions at its start (ghost `sm` buttons: attach, a format toggle) and Send, a primary Button, always the row's last, at its end. Under that one status line, `text-xs` in
+ tertiary ink, one line tall even when empty and never more (a long list of names is cut with an ellipsis; the live region holds the whole text), a polite live region: who is typing (`typingStatus`: "Ana is typing", "Ana and Ben are typing", "Ana, Ben, and Cy are typing", "4 people
+ are typing") or anything the app says there. Nothing moves when it fills. The field starts at `rows` lines (default 2, the textarea's own least) and grows with its text a line at a time
+ to `maxRows` (default 8), then scrolls; it has no resize handle, since its height is its text's. Where the browser cannot size a field to its content (`field-sizing`), it is measured, within
+ the same bounds.
+- **Sending.** Enter sends and Shift+Enter is a new line (the soft keyboard's key says Send), or with `sendKey="Mod+Enter"` Enter is a new line and the platform's modifier with Enter sends,
+ shown as chips beside Send (`ActionShortcut`). A key never sends, and never picks a name, while an input method is composing (`isComposing`, or the key code 229 some engines send instead). The key presses Send, so a key and a press are one send and the button's own wait
+ (`waitForAnswer`) guards both: a second Enter while a message is out sends nothing. On success the field is cleared, unless its text changed while the send was out; a refusal (a
+ rejection, or `false`) keeps the words. A press on Send keeps focus, and a phone's keyboard, in the field; after a keyboard press on Send, focus goes back to the field.
+- **A mention** (`Mention`) is the trigger and the name, "@Ana Ruiz", at 500 in primary ink: a glyph and a weight mark it, never a colour, and it wraps with its text. The trigger is a prop
+ ("#billing"). A mention that calls on the reader (`you`) also sits on its level's plate (`--basalt-plate`), radius 4, 2px each side of its own (given back by a margin, the plate ate half the space before it), drawn on
+ every line it wraps to; in forced colours it is `Mark` with `MarkText`, and in print the plate is dropped.
+- **The mention picker** (`MentionPicker`; `Composer`'s `mentions` renders it for the composer's field, and the app imports it, so a composer without names never carries it) is Combobox's popup and rows, reused: the popup's level (its opener's plus one), rim, `shadow-overlay`, radius 12,
+ one-line and two-line rows (40 and 58), group labels ("People", "Teams", "Roles", the app's words), the plate, its glide and the lift. `Listbox` is a list in the page that holds its own
+ focus, so it is not the picker. Focus stays in the field, which carries `aria-autocomplete="list"` and `aria-haspopup="listbox"`, and while the picker is open `aria-controls` and
+ `aria-activedescendant` to the active row (whose `aria-selected` is true). A trigger at the start of the text, or after a space or an opening bracket, opens it; one inside a word (an address)
+ does not. ↑ and ↓ move the plate, passing over a row that cannot be picked; Enter or Tab writes the trigger, the name and a space (the browser's own undo takes it back); a press on a row picks
+ it; Esc closes it until another trigger is typed, and a dialog round the field stays open. A name may hold a space while something matches it; once nothing does, the picker closes, so a
+ sentence is never held, and a query that matches nothing opens nothing (the app still hears it, `onQueryChange`, to look names up). The default match is each word typed starting a word of
+ the label or the description. It sits 6px under the trigger's line, or above it when there is more room there, inside what can be seen, 8px from its edges, at every width: the room is the visual viewport's where there is one, so a phone's keyboard (which shrinks it and not WebKit's `innerHeight`) counts. It never writes into a field that is read-only or disabled (it does not open there, and checks again as it writes), nor into a mention the field no longer holds: a value the app set while it was open closes it, and an Enter or Tab meant for its rows then writes and sends nothing. The field's own `aria-controls`, `aria-activedescendant`, `aria-autocomplete` and `aria-haspopup` are kept and put back when it closes or lets go. Rows are cut and never
+ wrap, as every popup row is (whether a described row may wrap is open). It enters and leaves as a popup does.
+- **The plate is public.** The lit row's plate as one opaque colour per level is the tokens `plate-0` to `plate-3` (the selected wash composited over the level, or in dark over the next
+ level; a test holds each to that recipe), in both themes and in Swift, and `--basalt-plate`, which follows the level a part sits in (`data-level`; the page and a nested theme root start
+ at `plate-0`). An app's own list draws its active row with it as Basalt's do (and gives that row a forced-colours form of its own, `Highlight` with `HighlightText`, since a fill is dropped there); Basalt's pressed toggle, chosen card and chosen peek read it, painting the pixel the private recipe did.
+- **No space step above `space-32`.** The 160 an app asked for was a label column, which `size-description-label` names. A space step is a gap; past 64 the scale holds only the section gaps
+ (96 and 128, `size-section-gap-md` and `size-section-gap`), and a larger gap than those has no role.
+- **The HTML skill** draws none of these: they are React's alone. A page the skill writes is read, not written into, so a composer and a picker have no use there; a quoted mention is words.
+
## Primitives
Components build on Base UI (the default base in shadcn/ui since July 2026, from the team
diff --git a/packages/react/README.md b/packages/react/README.md
index 64be05bc..39a1a504 100644
--- a/packages/react/README.md
+++ b/packages/react/README.md
@@ -422,6 +422,35 @@ const { shortcuts, keyshortcuts } = useShortcuts([{ key: "j", description: "Next
- The formatters draw nothing: `formatStamp` ("14:49:07", to the second and always 24-hour), `formatClock` ("2:49 PM" in `en-US`, "14:49" in `en-GB`: a clock a person reads follows the locale, with a numeric hour), `formatDay` ("Nov 1"), `formatCountdown` ("18d 09:10:51", `null` once passed) and `formatAge`, each with its machine `dateTime` (ISO), the zone an argument and the `locale` too (default `en-US`, never the runtime's, so a server's render and the browser's agree). `Clock`, `Stat`, `SourceStamp`, `SourceStateWords` and `CommandBlock` take `locale` as well, and `EventLog` for the width its time column reserves.
- `SourceStamp`'s name and time are the app's: Basalt ships no source's icon or name.
+## Writing to someone
+
+The composer, the mention and the mention picker (cimip-gaps-2, B3; decided and built by Opus on the no-council path, not yet reviewed). See foundations, "Writing to
+someone".
+
+```tsx
+{/* A support inbox: Enter sends, Shift+Enter is a new line; the send waits for the server and keeps the words if it is refused */}
+Attach}
+ status={typingStatus(typingNames)}
+ onSend={(text) => api.reply(ticket, text)}
+ mentions={(field) => picked.add(o.value)} />}
+/>
+
+{/* A build's comments: Mod+Enter sends (⌘↵ or Ctrl Enter, shown beside Send) */}
+
+
+{/* In the stream: a mention, and one that calls on the reader (on the plate) */}
+
Thanks Ana Ruiz; Lee Park, can you look? Routed to billing.
+
+{/* An app's own text field with the picker: its handlers see defaultPrevented on a key the picker used */}
+
+```
+
+An app's own list draws its active row with the plate Basalt's popups use: `background: var(--basalt-plate)` follows the level the row sits in, and the tokens
+`--basalt-plate-0` to `--basalt-plate-3` are each level's.
+
## Loading in the page's own shape
A region whose data is on its way draws its own parts, and what isn't known is painted as bones measured from the drawing (DECISIONS 247, 248, 249b and 258;
diff --git a/packages/react/src/composer.tsx b/packages/react/src/composer.tsx
new file mode 100644
index 00000000..aa800338
--- /dev/null
+++ b/packages/react/src/composer.tsx
@@ -0,0 +1,165 @@
+import * as React from "react";
+
+import { ActionShortcut } from "./action-shortcut";
+import { Button } from "./button";
+import { Textarea } from "./feedback";
+import { isComposingKey } from "./keyboard";
+import { isModKey } from "./platform";
+import { isThenable, useJoinedRef } from "./wait";
+import { join } from "./utils";
+
+// The composer (cimip-gaps-2, B3): where a person writes a message. A field with no visible label (its accessible name is `label`), the
+// send action at the row's end, the app's own second actions at its start, and a status line under it (who is typing) that is always one
+// line tall, so nothing moves when someone starts. The field grows with its text to `maxRows`, then scrolls. Enter sends (Shift+Enter is a
+// new line), or Mod+Enter where `sendKey` says so; a key and a press are one send: the key presses the button, so the button's own wait
+// (`waitForAnswer`) guards both and a second Enter while a message is out sends nothing. Nothing here runs at import.
+
+export interface ComposerProps extends Omit, "onChange" | "defaultValue" | "children"> {
+ /** The field's accessible name ("Message the team", "Reply to Ana"). There is no visible label: say where the message goes in `placeholder` too. */
+ label: string;
+ value?: string;
+ defaultValue?: string;
+ onValueChange?: (value: string) => void;
+ /**
+ * Sends the message (trimmed of its outer space). Return a promise and the send waits for it: Send is busy and a second send does nothing until
+ * it settles. On success the field is cleared, unless the text was changed meanwhile; return `false` (or resolve to it) to keep the text. A
+ * rejection keeps the text and is passed on, as a button's is.
+ */
+ onSend: (value: string) => unknown;
+ /** Which key sends from the field. "Enter" (Shift+Enter is a new line), or "Mod+Enter" (⌘↵ on Apple's systems, Ctrl+Enter elsewhere), shown as chips beside Send. Default "Enter". */
+ sendKey?: "Enter" | "Mod+Enter";
+ /** Send's words. Default "Send". */
+ sendLabel?: string;
+ /** Wait for a promise `onSend` returns. Default true. */
+ waitForAnswer?: boolean;
+ placeholder?: string;
+ /** Lines the field shows when empty. Default 2, the textarea's own least. */
+ rows?: number;
+ /** Lines it grows to with its text before it scrolls. Default 8. */
+ maxRows?: number;
+ /** The app's other actions, at the start of the row under the field: an attach button, a format toggle. Send is always the row's last. */
+ actions?: React.ReactNode;
+ /** The line under the composer: who is typing (`typingStatus`), a draft saved. A polite live region, one line tall even when empty. */
+ status?: React.ReactNode;
+ /**
+ * Names in the field: render the picker for the composer's field, `(field) => `. The app imports
+ * `MentionPicker` itself, so a composer without names never carries it.
+ */
+ mentions?: (field: React.RefObject) => React.ReactNode;
+ disabled?: boolean;
+ /** The field's element. */
+ inputRef?: React.Ref;
+ /** More for the field: `name`, `maxLength`, `autoFocus`, `id`, its own key handler (which sees `defaultPrevented` on a key the composer used). */
+ textareaProps?: Omit, "value" | "defaultValue" | "rows" | "placeholder" | "disabled" | "aria-label" | "className" | "ref">;
+}
+
+/**
+ * A message field with its send action. The field has an accessible name and no visible label; it grows with its text up to `maxRows` and
+ * then scrolls. The row under it holds the app's `actions` and Send (primary, the row's last); the `status` line under that is a polite live
+ * region that keeps its height when empty. A key sends by pressing Send, so a send is guarded by the button's own wait. With `mentions`, the
+ * trigger opens a picker of names while focus stays in the field.
+ */
+export function Composer({ label, value, defaultValue = "", onValueChange, onSend, sendKey = "Enter", sendLabel = "Send", waitForAnswer = true, placeholder, rows = 2, maxRows = 8, actions, status, mentions, disabled = false, inputRef, textareaProps, className, style, ...props }: ComposerProps) {
+ const [inner, setInner] = React.useState(defaultValue);
+ const text = value !== undefined ? value : inner;
+ const own = React.useRef(null);
+ const joined = useJoinedRef(inputRef, own);
+ const send = React.useRef(null);
+ const latest = React.useRef(text);
+ latest.current = text;
+ const empty = text.trim() === "";
+ const min = Math.max(1, rows);
+ const max = Math.max(min, maxRows);
+
+ const change = (next: string) => {
+ if (value === undefined) setInner(next);
+ onValueChange?.(next);
+ };
+ // Cleared only if the field still holds what was sent: words typed while it was out stay.
+ const sent = (what: string, kept: unknown) => {
+ if (kept === false || latest.current !== what) return;
+ change("");
+ };
+ const press = () => {
+ const what = latest.current;
+ const message = what.trim();
+ if (!message) return undefined;
+ const result = onSend(message);
+ const back = () => { if (document.activeElement === send.current) own.current?.focus(); };
+ if (waitForAnswer && isThenable(result)) {
+ return Promise.resolve(result).then((kept) => { sent(what, kept); back(); });
+ }
+ if (isThenable(result)) {
+ // Not waited for: each send runs, and the text goes when it is answered.
+ void Promise.resolve(result).then((kept) => sent(what, kept), () => {});
+ return undefined;
+ }
+ sent(what, result);
+ back();
+ return undefined;
+ };
+
+ // The field grows with its text where the browser can size it (field-sizing); elsewhere it is measured, within the same bounds.
+ React.useLayoutEffect(() => {
+ const field = own.current;
+ if (!field || typeof CSS === "undefined" || CSS.supports("field-sizing", "content")) return undefined;
+ // The stylesheet's least and greatest heights bound it; this only follows the text.
+ const fit = () => {
+ field.style.height = "auto";
+ field.style.height = `${field.scrollHeight + field.offsetHeight - field.clientHeight}px`;
+ };
+ fit();
+ const resize = new ResizeObserver(() => fit());
+ resize.observe(field);
+ return () => resize.disconnect();
+ }, [text]);
+
+ const onKeyDown = (event: React.KeyboardEvent) => {
+ textareaProps?.onKeyDown?.(event);
+ if (event.defaultPrevented || event.key !== "Enter" || isComposingKey(event.nativeEvent)) return;
+ const sends = sendKey === "Enter" ? !event.shiftKey && !event.altKey : isModKey(event.nativeEvent) && !event.shiftKey && !event.altKey;
+ if (!sends) return;
+ event.preventDefault();
+ // The key presses Send, so the button's wait is the one guard for both.
+ send.current?.click();
+ };
+
+ const button = (
+
+ );
+ return (
+
+
+ );
+}
diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts
index eddccbf8..b1f8834a 100644
--- a/packages/react/src/index.ts
+++ b/packages/react/src/index.ts
@@ -251,3 +251,8 @@ export { CaptionedColumn, CaptionedColumns } from "./captioned-columns";
export type { CaptionedColumnProps, CaptionedColumnsProps, CaptionedColumnsSize } from "./captioned-columns";
export { PeriodStepper } from "./period-stepper";
export type { PeriodStepperProps } from "./period-stepper";
+export { Composer } from "./composer";
+export { typingStatus } from "./typing-status";
+export type { ComposerProps } from "./composer";
+export { Mention, MentionPicker } from "./mention";
+export type { MentionOption, MentionPickDetails, MentionPickerProps, MentionProps } from "./mention";
diff --git a/packages/react/src/keyboard.ts b/packages/react/src/keyboard.ts
index 832a688b..5e4e0361 100644
--- a/packages/react/src/keyboard.ts
+++ b/packages/react/src/keyboard.ts
@@ -24,6 +24,14 @@ export function isHardwareKey(event: Pick, "prefix"> {
+ /** The name, as written after the trigger: "Ana Ruiz", "design". */
+ children: React.ReactNode;
+ /** The trigger drawn before the name. Default "@". */
+ trigger?: string;
+ /** The mention calls on the person reading: it sits on the plate as well, so "you were called" shows by shape (and as `Mark` in forced colours). */
+ you?: boolean;
+}
+
+/** A name in running text that calls on someone: "@Ana Ruiz" at 500 in primary ink. With `you`, on the plate too. */
+export function Mention({ children, trigger = "@", you = false, className, ...props }: MentionProps) {
+ return (
+
+ {trigger}
+ {children}
+
+ );
+}
+
+// ---- The picker ----
+
+export interface MentionOption {
+ /** The row's title, and what is written after the trigger when it is picked: "Ana Ruiz". */
+ label: string;
+ /** What the app keeps for the pick (an id). Default: the label. */
+ value?: string;
+ /** A second line under the title (13/18, tertiary, one line): a role, a team's size, a handle. */
+ description?: string;
+ /** The heading the row sits under ("People", "Teams", "Roles"). Rows of a group are drawn together, groups in the order they first appear. */
+ group?: string;
+ /** Shown and passed over by the keys; it cannot be picked. */
+ disabled?: boolean;
+}
+
+export interface MentionPickDetails {
+ /** The field's text after the pick. */
+ text: string;
+ /** Where the mention starts and ends in that text (the trigger included, the space after it not). */
+ start: number;
+ end: number;
+}
+
+export interface MentionPickerProps {
+ /** The text field the picker writes into: a `textarea` or a text `input`. Its own handlers run after the picker's, and see `defaultPrevented` on a key it used. */
+ field: React.RefObject;
+ /** Who can be named. With the default filter, give them all; with `filter={null}`, give what `onQueryChange`'s query found. */
+ options: readonly MentionOption[];
+ /** The character that starts a mention. Default "@". */
+ trigger?: string;
+ /** Which options match what is typed after the trigger. Default: each word typed starts a word of the label or the description. `null` shows every option given. */
+ filter?: null | ((option: MentionOption, query: string) => boolean);
+ /** What is typed after the trigger, as it changes, or `null` when there is no mention at the caret: for an app that looks names up. */
+ onQueryChange?: (query: string | null) => void;
+ /** A row was picked: the name is written into the field and a space after it. */
+ onPick?: (option: MentionOption, details: MentionPickDetails) => void;
+ /** The list's accessible name. Default "Suggestions". */
+ label?: string;
+}
+
+/** What a mention at the caret looks like: where its trigger is, and what follows it up to the caret. */
+interface Query {
+ at: number;
+ text: string;
+}
+
+const fold = (text: string) => text.normalize("NFD").replace(/\p{M}/gu, "").toLocaleLowerCase();
+const words = (text: string) => fold(text).split(/[\s.,'’_-]+/u).filter(Boolean);
+
+/** Each word typed starts a word of the label or of the description. */
+function startsWords(option: MentionOption, query: string): boolean {
+ const typed = words(query);
+ if (typed.length === 0) return true;
+ const own = [...words(option.label), ...words(option.description ?? "")];
+ return typed.every((word) => own.some((each) => each.startsWith(word)));
+}
+
+/** The mention being typed at the caret: a trigger at the start of the text or after a space or an opening bracket, with no line break or second trigger after it. */
+function queryAt(value: string, caret: number, trigger: string): Query | null {
+ const before = value.slice(0, caret);
+ const at = before.lastIndexOf(trigger);
+ if (at < 0) return null;
+ const ahead = before[at - 1];
+ if (at > 0 && ahead !== undefined && !/[\s([{"'“‘]/u.test(ahead)) return null;
+ const text = before.slice(at + trigger.length);
+ if (/[\n\r]/.test(text) || text.includes(trigger) || /^\s/u.test(text)) return null;
+ return { at, text };
+}
+
+// The caret's box, measured on a copy of the field laid out the same way (a textarea wraps; an input is one line).
+const COPIED = ["boxSizing", "width", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderTopStyle", "borderRightStyle", "borderBottomStyle", "borderLeftStyle", "fontFamily", "fontSize", "fontWeight", "fontStyle", "fontStretch", "fontVariantNumeric", "fontFeatureSettings", "letterSpacing", "lineHeight", "textTransform", "textIndent", "wordSpacing", "tabSize", "direction", "textAlign"] as const;
+
+function caretBox(field: HTMLTextAreaElement | HTMLInputElement, index: number): { x: number; top: number; bottom: number } {
+ const style = getComputedStyle(field);
+ const copy = document.createElement("div");
+ for (const name of COPIED) copy.style[name] = style[name];
+ Object.assign(copy.style, { position: "absolute", top: "0", left: "0", visibility: "hidden", overflow: "hidden", height: "auto", whiteSpace: field instanceof HTMLTextAreaElement ? "pre-wrap" : "pre", overflowWrap: "break-word" });
+ copy.textContent = field.value.slice(0, index);
+ const mark = document.createElement("span");
+ mark.textContent = field.value.slice(index, index + 1) || "";
+ copy.append(mark);
+ document.body.append(copy);
+ const box = field.getBoundingClientRect();
+ const x = box.left + field.clientLeft + mark.offsetLeft - field.scrollLeft;
+ const top = box.top + field.clientTop + mark.offsetTop - field.scrollTop;
+ const line = Number.parseFloat(style.lineHeight) || mark.offsetHeight;
+ copy.remove();
+ // A trigger scrolled out of the field is held at the field's edge, so the list never floats away from it.
+ const clampedTop = Math.min(Math.max(top, box.top), box.bottom - line);
+ return { x: Math.min(Math.max(x, box.left), box.right), top: clampedTop, bottom: clampedTop + line };
+}
+
+/** A field the picker may write into: not read-only, not disabled, with a caret and no selection. */
+const writable = (element: HTMLTextAreaElement | HTMLInputElement) => !element.readOnly && !element.disabled && element.selectionStart === element.selectionEnd;
+
+/** The mention at the field's caret now, read from its live value: a controlled update fires no input event, so a query held from before may be stale. */
+const liveQuery = (element: HTMLTextAreaElement | HTMLInputElement, trigger: string) => (writable(element) ? queryAt(element.value, element.selectionStart ?? element.value.length, trigger) : null);
+const same = (a: Query | null, b: Query | null) => Boolean(a && b && a.at === b.at && a.text === b.text);
+
+/** The ARIA the picker sets on the field. The caller's own values are kept and put back when the picker lets go. */
+const OWNED = ["aria-autocomplete", "aria-haspopup", "aria-controls", "aria-activedescendant"] as const;
+
+/** 6px from the trigger's line, as a popup sits from its trigger; 8px from the window's edges. */
+const OFFSET = 6;
+const MARGIN = 8;
+
+/**
+ * The picker for a mention in a text field. Typing the trigger at the start of a word opens a popup of the options that match what follows it,
+ * under the trigger's line (above it when there is more room there), at the popup's level. Focus stays in the field: ↑ and ↓ move the plate
+ * (passing over a disabled row), Enter or Tab writes the name and a space, Esc closes it until another trigger is typed, and a press on a row
+ * picks it. A query with a space in it stays open only while something matches, so a name can hold a space and a sentence closes it. The rows
+ * are Combobox's two-line rows, under `group` labels.
+ */
+export function MentionPicker({ field, options, trigger = "@", filter, onQueryChange, onPick, label = "Suggestions" }: MentionPickerProps) {
+ const [query, setQuery] = React.useState(null);
+ const [active, setActive] = React.useState(0);
+ const dismissed = React.useRef(null);
+ const base = React.useId();
+ const listId = `${base}-list`;
+ const level = usePopupLevel();
+ const layer = useFloatingLayer();
+
+ const shown = React.useMemo(() => {
+ if (!query) return [];
+ const test = filter === null ? null : (filter ?? startsWords);
+ const matched = test ? options.filter((option) => test(option, query.text)) : [...options];
+ // Rows of one group are drawn together, the groups in the order they first appear; within a group the app's order stands.
+ const order: string[] = [];
+ for (const option of matched) if (!order.includes(option.group ?? "")) order.push(option.group ?? "");
+ return order.flatMap((group) => matched.filter((option) => (option.group ?? "") === group));
+ }, [query, options, filter]);
+ // A query with a space in it is a name with a space while something matches it, and a sentence once nothing does.
+ const open = Boolean(query) && shown.length > 0 && (shown.some((option) => !option.disabled) || !/\s/u.test(query!.text));
+ const firstEnabled = (from: number, step: 1 | -1) => {
+ for (let tries = 0, i = from; tries < shown.length; tries++, i = (i + step + shown.length) % shown.length) if (!shown[i]!.disabled) return i;
+ return -1;
+ };
+ const current = open ? (shown[active] && !shown[active]!.disabled ? active : firstEnabled(0, 1)) : -1;
+ const optionId = (index: number) => `${base}-option-${index}`;
+
+ // What is typed after the trigger, read from the field on every change of its text or caret.
+ const read = React.useCallback(() => {
+ const element = field.current;
+ if (!element || document.activeElement !== element || !writable(element)) { setQuery(null); return; }
+ const next = liveQuery(element, trigger);
+ if (next && dismissed.current === next.at) { setQuery(null); return; }
+ if (!next) dismissed.current = null;
+ setQuery((was) => (was && next && was.at === next.at && was.text === next.text ? was : next));
+ }, [field, trigger]);
+
+ // The caller's own values of the attributes the picker sets, read once from the field before the picker writes any.
+ const saved = React.useRef<{ element: Element; values: Map } | null>(null);
+ const saveAria = React.useCallback((element: Element) => {
+ if (saved.current?.element === element) return;
+ saved.current = { element, values: new Map(OWNED.map((name) => [name, element.getAttribute(name)])) };
+ }, []);
+ const restoreAria = React.useCallback((element: Element, name: string) => {
+ const value = saved.current?.element === element ? saved.current.values.get(name) : null;
+ if (value === null || value === undefined) element.removeAttribute(name);
+ else element.setAttribute(name, value);
+ }, []);
+
+ const queryText = query?.text ?? null;
+ const onQuery = React.useRef(onQueryChange);
+ onQuery.current = onQueryChange;
+ React.useEffect(() => { onQuery.current?.(queryText); }, [queryText]);
+ // A new query starts on its first row.
+ React.useEffect(() => { setActive(0); }, [queryText]);
+
+ const pick = React.useCallback((option: MentionOption) => {
+ const element = field.current;
+ if (!element || !query || option.disabled) return;
+ // Write only into the mention the field holds now: a field the app made read-only or disabled, or a value it replaced, closes the picker
+ // and keeps its text.
+ if (!same(liveQuery(element, trigger), query)) { setQuery(null); return; }
+ const end = element.selectionStart ?? element.value.length;
+ const name = `${trigger}${option.label}`;
+ const spaced = /^\s/u.test(element.value.slice(end)) ? name : `${name} `;
+ element.focus();
+ element.setSelectionRange(query.at, end);
+ // insertText keeps the browser's own undo; where it is refused, the text is set and an input event tells the app (React reads it as a change).
+ if (!document.execCommand?.("insertText", false, spaced)) {
+ element.setRangeText(spaced, query.at, end, "end");
+ element.dispatchEvent(new Event("input", { bubbles: true }));
+ }
+ const after = query.at + spaced.length + (spaced === name ? 1 : 0);
+ element.setSelectionRange(after, after);
+ // The name written is a mention made: it does not offer itself again as the words after it are typed.
+ dismissed.current = query.at;
+ setQuery(null);
+ onPick?.(option, { text: element.value, start: query.at, end: query.at + name.length });
+ }, [field, query, trigger, onPick]);
+
+ // The keys, on the field itself, so they run before any handler the app gave the field (React's run at the root).
+ const state = React.useRef({ open, current, shown, pick, query });
+ state.current = { open, current, shown, pick, query };
+ React.useEffect(() => {
+ const element = field.current;
+ if (!element) return undefined;
+ const onKey = (event: Event) => {
+ const key = event as KeyboardEvent;
+ const s = state.current;
+ if (!s.open || isComposingKey(key)) return;
+ // The field changed under the picker (the app set its value, or made it read-only): it closes. An Enter or Tab meant for the rows it
+ // showed is still the picker's, so it neither writes nor sends.
+ if (!same(liveQuery(element, trigger), s.query)) {
+ if (key.key === "Enter" || key.key === "Tab" || key.key === "ArrowDown" || key.key === "ArrowUp" || key.key === "Escape") key.preventDefault();
+ read();
+ return;
+ }
+ if (key.key === "ArrowDown" || key.key === "ArrowUp") {
+ key.preventDefault();
+ const step = key.key === "ArrowDown" ? 1 : -1;
+ let next = s.current;
+ for (let tries = 0; tries < s.shown.length; tries++) {
+ next = (next + step + s.shown.length) % s.shown.length;
+ if (!s.shown[next]!.disabled) break;
+ }
+ // Two keys in one task each move once: the next reads where this one left it, before React draws.
+ s.current = next;
+ setActive(next);
+ } else if ((key.key === "Enter" || key.key === "Tab") && !key.shiftKey && !key.altKey && !key.metaKey && !key.ctrlKey) {
+ const option = s.shown[s.current];
+ if (!option || option.disabled) return;
+ key.preventDefault();
+ s.pick(option);
+ } else if (key.key === "Escape") {
+ key.preventDefault();
+ // The Esc is the picker's: a dialog round the field stays open.
+ key.stopPropagation();
+ const at = queryAt(element.value, element.selectionStart ?? 0, trigger)?.at;
+ dismissed.current = at ?? null;
+ setQuery(null);
+ }
+ };
+ const onBlur = () => setQuery(null);
+ const later = () => requestAnimationFrame(read);
+ // The text is read once the app has heard it: on the document, after React's own listener at the root has taken the change. Read on the
+ // field itself, a state change here would draw a controlled field before React had its new value, and the keystroke would be undone.
+ const doc = element.ownerDocument;
+ const onInput = (event: Event) => { if (event.target === element) read(); };
+ element.addEventListener("keydown", onKey);
+ doc.addEventListener("input", onInput);
+ element.addEventListener("keyup", read);
+ element.addEventListener("pointerup", later);
+ element.addEventListener("focus", read);
+ element.addEventListener("blur", onBlur);
+ // A selection or caret the app moved without an input event (a value it set) is read too.
+ const onSelection = () => { if (doc.activeElement === element) read(); };
+ doc.addEventListener("selectionchange", onSelection);
+ saveAria(element);
+ element.setAttribute("aria-autocomplete", "list");
+ element.setAttribute("aria-haspopup", "listbox");
+ return () => {
+ doc.removeEventListener("selectionchange", onSelection);
+ element.removeEventListener("keydown", onKey);
+ doc.removeEventListener("input", onInput);
+ element.removeEventListener("keyup", read);
+ element.removeEventListener("pointerup", later);
+ element.removeEventListener("focus", read);
+ element.removeEventListener("blur", onBlur);
+ for (const name of OWNED) restoreAria(element, name);
+ saved.current = null;
+ };
+ }, [field, read, trigger, saveAria, restoreAria]);
+
+ // The field names the list while it is open, and the row the keys are on.
+ React.useLayoutEffect(() => {
+ const element = field.current;
+ if (!element) return;
+ saveAria(element);
+ if (open) element.setAttribute("aria-controls", listId);
+ else restoreAria(element, "aria-controls");
+ if (open && current >= 0) element.setAttribute("aria-activedescendant", optionId(current));
+ else restoreAria(element, "aria-activedescendant");
+ // A value the app set while the picker was open (no input event): the query is read again, and closes if it is gone.
+ if (query && !same(liveQuery(element, trigger), query)) read();
+ });
+
+ // The popup stays mounted through its exit (0.75 of its entry, easing in), as Base UI's popups do.
+ const [mounted, setMounted] = React.useState(false);
+ const [phase, setPhase] = React.useState<"starting" | "open" | "ending">("starting");
+ React.useEffect(() => {
+ if (open) {
+ setMounted(true);
+ setPhase((was) => (was === "open" ? was : "starting"));
+ // Two frames, so the starting style is drawn once before it goes; both are cancelled if it closes first, or the inner one would undo the exit.
+ let inner = 0;
+ const outer = requestAnimationFrame(() => { inner = requestAnimationFrame(() => setPhase("open")); });
+ return () => { cancelAnimationFrame(outer); cancelAnimationFrame(inner); };
+ }
+ if (!mounted) return undefined;
+ setPhase("ending");
+ const done = window.setTimeout(() => setMounted(false), 250);
+ return () => window.clearTimeout(done);
+ }, [open, mounted]);
+
+ // Where it sits: under the trigger's line, or above it when there is more room there; never past what can be seen.
+ const positioner = React.useRef(null);
+ const popup = React.useRef(null);
+ const anchor = open ? query!.at : -1;
+ const place = React.useCallback(() => {
+ const element = field.current;
+ const box = positioner.current;
+ const list = popup.current;
+ if (!element || !box || !list || anchor < 0) return;
+ const caret = caretBox(element, anchor);
+ // The room is the visual viewport's, where there is one: a phone's keyboard shrinks it and not the layout viewport (WebKit's innerHeight
+ // stays whole), and a pinch-zoom moves it. Its offsets are in the layout viewport's coordinates, which the caret and a fixed box use too.
+ const view = window.visualViewport;
+ const top = view?.offsetTop ?? 0;
+ const leftEdge = view?.offsetLeft ?? 0;
+ const height = view?.height ?? window.innerHeight;
+ const viewWidth = view?.width ?? window.innerWidth;
+ const below = top + height - caret.bottom - OFFSET - MARGIN;
+ const above = caret.top - top - OFFSET - MARGIN;
+ list.style.removeProperty("--available-height");
+ const natural = list.scrollHeight + (list.offsetHeight - list.clientHeight);
+ const down = below >= natural || below >= above;
+ list.style.setProperty("--available-height", `${Math.max(0, down ? below : above)}px`);
+ list.style.setProperty("--transform-origin", down ? "left top" : "left bottom");
+ const width = list.offsetWidth;
+ const left = Math.min(Math.max(leftEdge + MARGIN, caret.x), Math.max(leftEdge + MARGIN, leftEdge + viewWidth - MARGIN - width));
+ box.style.left = `${left}px`;
+ if (down) { box.style.top = `${caret.bottom + OFFSET}px`; box.style.bottom = ""; }
+ else { box.style.bottom = `${window.innerHeight - caret.top + OFFSET}px`; box.style.top = ""; }
+ box.dataset.side = down ? "bottom" : "top";
+ }, [field, anchor]);
+ React.useLayoutEffect(() => { if (mounted && anchor >= 0) place(); }, [mounted, anchor, shown, place]);
+ React.useEffect(() => {
+ if (!mounted) return undefined;
+ let frame = 0;
+ const again = () => { cancelAnimationFrame(frame); frame = requestAnimationFrame(place); };
+ window.addEventListener("resize", again);
+ window.addEventListener("scroll", again, { capture: true, passive: true });
+ window.visualViewport?.addEventListener("resize", again);
+ window.visualViewport?.addEventListener("scroll", again);
+ return () => {
+ cancelAnimationFrame(frame);
+ window.removeEventListener("resize", again);
+ window.removeEventListener("scroll", again, { capture: true });
+ window.visualViewport?.removeEventListener("resize", again);
+ window.visualViewport?.removeEventListener("scroll", again);
+ };
+ }, [mounted, place]);
+
+ // The row the keys moved to is scrolled into the list's view (the list alone: the page never moves).
+ React.useLayoutEffect(() => {
+ const list = popup.current;
+ const row = current >= 0 ? document.getElementById(optionId(current)) : null;
+ if (!list || !row || !list.contains(row)) return;
+ const top = row.offsetTop;
+ const bottom = top + row.offsetHeight;
+ if (top < list.scrollTop) list.scrollTop = top;
+ else if (bottom > list.scrollTop + list.clientHeight) list.scrollTop = bottom - list.clientHeight;
+ }, [current]);
+
+ // The last rows drawn stay during the exit, so the popup fades with what it held.
+ const drawn = React.useRef([]);
+ if (open) drawn.current = shown;
+ if (!mounted || typeof document === "undefined") return null;
+ const rows = open ? shown : drawn.current;
+ const groups: { name: string; rows: { option: MentionOption; index: number }[] }[] = [];
+ rows.forEach((option, index) => {
+ const name = option.group ?? "";
+ const last = groups.at(-1);
+ if (last && last.name === name) last.rows.push({ option, index });
+ else groups.push({ name, rows: [{ option, index }] });
+ });
+ const row = ({ option, index }: { option: MentionOption; index: number }) => (
+
,
+ document.body,
+ );
+}
diff --git a/packages/react/src/styles/components.css b/packages/react/src/styles/components.css
index b2f4fa18..5fa03ae7 100644
--- a/packages/react/src/styles/components.css
+++ b/packages/react/src/styles/components.css
@@ -61,17 +61,20 @@
[data-level="2"] { --_surface: var(--basalt-surface-2); --_well: var(--basalt-surface-well-2); --_plate: light-dark(var(--basalt-state-selected), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3))); }
[data-level="3"] { --_surface: var(--basalt-surface-3); --_well: var(--basalt-surface-well-3); --_plate: light-dark(var(--basalt-state-selected), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3))); }
- /* --_plate-solid is the same plate for a surface that REPLACES its own fill (a choice card, a pressed toggle) rather than
- laying over a panel: one opaque colour, so nothing shows through it. In dark it is --_plate; in light it is the 7% selected
- wash (black at state-selected's own alpha) mixed over the level's own white. */
- /* The page (no data-level ancestor) has its own: in dark the next level plus the wash, as level 0 would be; in light the 7% wash over
- surface-page, one opaque colour (about #e8e8e8, the same 1.17:1 step #ededed has on white). Every level below overrides it. */
- :root { --_plate-solid: light-dark(color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-page)), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-1))); }
- [data-level="1"] { --_plate-solid: light-dark(color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-1)), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-2))); }
- [data-level="2"] { --_plate-solid: light-dark(color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-2)), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3))); }
- [data-level="3"] { --_plate-solid: light-dark(color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-3)), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3))); }
-
- /* A browser without light-dark() (Safari before 17.5, Chrome before 123, Firefox before 120) would read each of the plate, plate-solid
+ /* --basalt-plate is the same plate for a surface that REPLACES its own fill (a choice card, a pressed toggle, an app's own list row)
+ rather than laying over a panel: one opaque colour per level, so nothing shows through it. It is public: the tokens plate-0 to plate-3
+ hold it (in dark --_plate, the next level plus the wash; in light the 7% selected wash, black at state-selected's own alpha, mixed over
+ the level's own white), and this alias follows the level, so a row anywhere reads `var(--basalt-plate)` and gets its level's plate.
+ The page (no data-level ancestor) and a nested theme root start at plate-0: in dark the next level plus the wash, as level 0 would be;
+ in light the 7% wash over surface-page (about #e8e8e8, the same 1.17:1 step #ededed has on white). Every level below overrides it.
+ The tokens are plain colours themed by selector, so no light-dark() and no fallback is needed for them. */
+ :root, [data-theme], .light, .dark { --basalt-plate: var(--basalt-plate-0); }
+ [data-level="0"] { --basalt-plate: var(--basalt-plate-0); }
+ [data-level="1"] { --basalt-plate: var(--basalt-plate-1); }
+ [data-level="2"] { --basalt-plate: var(--basalt-plate-2); }
+ [data-level="3"] { --basalt-plate: var(--basalt-plate-3); }
+
+ /* A browser without light-dark() (Safari before 17.5, Chrome before 123, Firefox before 120) would read each of the plate
and pill variables above as an unknown function and paint nothing. There the same values are mixed instead of picked:
--_dkp is how much of the dark value a mix takes, 0% in a light theme and 100% in a dark one, set where the theme tokens set
the theme, so a nested theme root and the OS preference resolve as they do for the tokens. color-mix reaches every browser that
@@ -85,10 +88,6 @@
[data-level="1"] { --_plate: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-2)) var(--_dkp), var(--basalt-state-selected)); }
[data-level="2"] { --_plate: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3)) var(--_dkp), var(--basalt-state-selected)); }
[data-level="3"] { --_plate: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3)) var(--_dkp), var(--basalt-state-selected)); }
- :root { --_plate-solid: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-1)) var(--_dkp), color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-page))); }
- [data-level="1"] { --_plate-solid: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-2)) var(--_dkp), color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-1))); }
- [data-level="2"] { --_plate-solid: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3)) var(--_dkp), color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-2))); }
- [data-level="3"] { --_plate-solid: color-mix(in srgb, color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-3)) var(--_dkp), color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-3))); }
}
/* Every panel has one rim: a real 1px border in two solid colours, the top lit in dark. Never on a
@@ -383,7 +382,7 @@
.basalt-button-swap:has(> .basalt-glyph-frame) > .basalt-icon { visibility: hidden; }
/* A pressed toggle (aria-pressed; only secondary and ghost, and IconButton). Pressed is the selected plate as ONE solid fill per
- level (--_plate-solid: the next level plus the wash in dark, the wash over white in light; the page has its own, the wash over
+ level (--basalt-plate: the next level plus the wash in dark, the wash over white in light; the page has its own, the wash over
surface-page in light), never a layered wash, so forced colours can replace it. The label steps to primary, with no weight change. A secondary's
hairline steps to border-hover; a ghost gains its rectangle; the radius is the button's own. A text toggle holds a 16px seat at the
label's start that shows the core check while pressed and is empty while not, so both states are one width; the check swaps, it
@@ -394,11 +393,11 @@
.basalt-button[aria-pressed="true"] > .basalt-button-check > .basalt-icon { opacity: 1; }
.basalt-button.basalt-button[aria-pressed="true"][data-variant="secondary"],
.basalt-button.basalt-button[aria-pressed="true"][data-variant="ghost"] {
- background: var(--_plate-solid, light-dark(color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-page)), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-1))));
+ background: var(--basalt-plate);
}
.basalt-button[aria-pressed="true"][data-variant="secondary"]:not([data-disabled]):not([data-loading]),
.basalt-button[aria-pressed="true"][data-variant="ghost"]:not([data-disabled]):not([data-loading]) {
- background: var(--_plate-solid, light-dark(color-mix(in srgb, var(--basalt-neutral-0) 7%, var(--basalt-surface-page)), color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-1))));
+ background: var(--basalt-plate);
color: var(--basalt-text-primary);
}
.basalt-button.basalt-button[aria-pressed="true"][data-variant="secondary"] { box-shadow: 0 0 0 var(--basalt-size-hairline) var(--basalt-border-hover); }
@@ -2109,7 +2108,7 @@
/* ---- Choice card: a native radio or checkbox wearing a card ----
The whole card is the label; the input is visually hidden (it covers the card, invisible, so it stays focusable) and a real
choice box sits in a seat on the header line, reserved on every choice card, so choosing moves no title. Selected is the
- selected wash as one solid fill at the card's own level (--_plate-solid, the active-row recipe made opaque), with the rim and the level
+ selected wash as one solid fill at the card's own level (--basalt-plate, the active-row recipe made opaque), with the rim and the level
unchanged and the title still primary. Hover on an unselected card is the hover wash alone; a selected card takes no further
step. No press scale. Focus is the control ring at +2, outside the card. State changes crossfade over duration-fast. */
.basalt-choice-card {
@@ -2135,7 +2134,7 @@
@media (hover: hover) {
.basalt-choice-card:hover:not(:has(> .basalt-choice-card-input:checked, > .basalt-choice-card-input:disabled))::before { opacity: 1; }
}
- .basalt-choice-card:has(> .basalt-choice-card-input:checked) { background-color: var(--_plate-solid); }
+ .basalt-choice-card:has(> .basalt-choice-card-input:checked) { background-color: var(--basalt-plate); }
.basalt-choice-card:has(> .basalt-choice-card-input:checked) .basalt-text[data-tone="tertiary"] { color: var(--basalt-text-secondary); }
.basalt-choice-card:has(> .basalt-choice-card-input:focus-visible) { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: var(--basalt-size-focus-offset); }
.basalt-choice-card:has(> .basalt-choice-card-input:disabled) { color: var(--basalt-text-disabled); cursor: not-allowed; }
@@ -2365,7 +2364,7 @@
transition: opacity var(--basalt-duration-base) var(--basalt-ease-out);
}
.basalt-peek[data-kind="row"] { cursor: pointer; }
- .basalt-peek[data-chosen] { background: var(--_plate-solid); }
+ .basalt-peek[data-chosen] { background: var(--basalt-plate); }
.basalt-peek[data-focus] { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: var(--basalt-size-focus-offset); }
.basalt-peek-text { display: block; }
.basalt-peek-seat { float: inline-end; }
@@ -3401,6 +3400,67 @@
resize: vertical;
}
+ /* ---- Composer, Mention and MentionPicker (cimip-gaps-2, B3) ----
+ A composer is the textarea, a row of actions under it with Send last, and a status line under that. The field has no visible label
+ (its name is the aria-label) and grows with its text, a line at a time, from --_rows to --_max-rows (set by the component), then
+ scrolls; it never takes a resize handle, since its height is the text's. The status line is text-xs in tertiary ink, one line tall
+ even when empty, so nothing above or below moves when someone starts typing. */
+ .basalt-composer { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--basalt-space-2); min-width: 0; }
+ .basalt-input.basalt-textarea.basalt-composer-field {
+ --_line: var(--basalt-text-base-line-height);
+ resize: none;
+ field-sizing: content;
+ min-height: calc(var(--_line) * var(--_rows, 2) + var(--basalt-space-4));
+ max-height: calc(var(--_line) * var(--_max-rows, 8) + var(--basalt-space-4));
+ overflow-y: auto;
+ }
+ .basalt-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-2); flex-wrap: wrap; }
+ .basalt-composer-extra { display: flex; align-items: center; gap: var(--basalt-space-1); flex-wrap: wrap; min-width: 0; }
+ /* Send is the row's last, at its end, whether or not the app gave other actions. */
+ .basalt-composer-actions > :is(.basalt-composer-send, .basalt-composer-send-group) { margin-inline-start: auto; }
+ /* One line, always: a long list of names is cut with an ellipsis rather than wrapped, so nothing under it moves. The cut is a look only:
+ the live region holds the whole text, and that is what is read. */
+ .basalt-composer-status {
+ margin: 0;
+ min-height: var(--basalt-text-xs-line-height);
+ font-size: var(--basalt-text-xs-size);
+ line-height: var(--basalt-text-xs-line-height);
+ color: var(--basalt-text-tertiary);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ /* A mention is the trigger and the name at 500 in primary ink: a glyph and a weight mark it, never a colour. It wraps with its text. One
+ that calls on the reader (data-you) also sits on the plate of its level, the opaque --basalt-plate, with radius 4 and 2px each side,
+ drawn on every line it wraps to. The 2px are its own (no margin gives them back): given back, the plate ate half the space before it
+ and the name read as joined to the word ahead. A mention never changes state, so nothing moves. */
+ .basalt-mention { font-weight: var(--basalt-font-weight-medium); color: var(--basalt-text-primary); }
+ .basalt-mention[data-you] {
+ padding-inline: var(--basalt-space-0-5);
+ border-radius: var(--basalt-radius-xs);
+ background-color: var(--basalt-plate);
+ box-decoration-break: clone;
+ -webkit-box-decoration-break: clone;
+ }
+ @media (forced-colors: active) {
+ .basalt-mention[data-you] { forced-color-adjust: none; background-color: Mark; color: MarkText; }
+ }
+ @media print {
+ .basalt-mention[data-you] { background-color: transparent; }
+ }
+
+ /* The picker is a popup of Combobox's rows, placed by the component (fixed, beside the trigger's line) and as wide as its content up to
+ the popover maximum. Focus stays in the field, so the rows' plate follows aria-activedescendant through data-highlighted. */
+ .basalt-mention-positioner { position: fixed; }
+ .basalt-mention-picker {
+ width: max-content;
+ /* stylelint-disable-next-line unit-disallowed-list -- a width that follows the window (a viewport unit), less the margins; a fixed-length token cannot say it */
+ max-width: min(var(--basalt-size-popover-max), calc(100vw - 2 * var(--basalt-space-2)));
+ }
+ .basalt-mention-option { cursor: pointer; }
+ .basalt-mention-option[aria-disabled="true"] { cursor: default; }
+
/* ---- Popover ---- */
.basalt-popover {
diff --git a/packages/react/src/typing-status.ts b/packages/react/src/typing-status.ts
new file mode 100644
index 00000000..2b48554b
--- /dev/null
+++ b/packages/react/src/typing-status.ts
@@ -0,0 +1,10 @@
+// Who is typing, in words: a plain function with no React, so a server can write the line too (cimip-gaps-2, B3).
+
+/** Who is typing, in words: "Ana is typing", "Ana and Ben are typing", "Ana, Ben, and Cy are typing", "4 people are typing". Empty for
+ * nobody. US English; an app in another language writes its own line. */
+export function typingStatus(names: readonly string[]): string {
+ if (names.length === 0) return "";
+ if (names.length > 3) return `${names.length} people are typing`;
+ const list = new Intl.ListFormat("en-US", { type: "conjunction" }).format(names);
+ return `${list} ${names.length === 1 ? "is" : "are"} typing`;
+}
diff --git a/packages/react/test/audit-fixes-b.test.mjs b/packages/react/test/audit-fixes-b.test.mjs
index a3ded8aa..5414f7d4 100644
--- a/packages/react/test/audit-fixes-b.test.mjs
+++ b/packages/react/test/audit-fixes-b.test.mjs
@@ -385,7 +385,7 @@ for (const theme of THEMES) {
// ---- A5-01: the selected fills paint in a browser without light-dark() ----
describe("A5-01 selected fills without light-dark()", () => {
- const SELECTED = render(`<>
DayWeekToggledAlphaBeta
plate
pill
page
>`);
+ const SELECTED = render(`<>
DayWeekToggledAlphaBeta
plate
pill
page
>`);
const fills = (page) => page.evaluate(() => {
const canvas = document.createElement("canvas"); canvas.width = canvas.height = 1; const ctx = canvas.getContext("2d", { willReadFrequently: true });
const rgba = (css) => { ctx.clearRect(0, 0, 1, 1); ctx.fillStyle = "#000"; ctx.fillStyle = css; ctx.fillRect(0, 0, 1, 1); return [...ctx.getImageData(0, 0, 1, 1).data]; };
diff --git a/packages/react/test/composer-mentions.test.mjs b/packages/react/test/composer-mentions.test.mjs
new file mode 100644
index 00000000..d830e170
--- /dev/null
+++ b/packages/react/test/composer-mentions.test.mjs
@@ -0,0 +1,687 @@
+// The composer, the mention and the mention picker, and the public plate (cimip-gaps-2, batch B3: decided and built by Opus on the no-council path,
+// DECISIONS 226 and 265; the code review is Astra's and the pixels the lead's). A message field with no visible label, Send last in the row under it,
+// a status line that keeps its height, Enter or Mod+Enter that press Send (so the button's own wait guards a key and a press alike), and a field
+// that grows to its cap and then scrolls. A mention is the trigger and the name at 500 in primary ink, and one that calls on the reader sits on the
+// plate. The picker is a popup of Combobox's rows with focus left in the field (`aria-activedescendant`), in groups, with two-line rows. The plate
+// (--basalt-plate, tokens plate-0 to plate-3) paints exactly what the private recipe painted. Driven in Chromium against the built package with the
+// real stylesheet. Synthetic names only, from two unlike domains (a support inbox and a build pipeline).
+import assert from "node:assert/strict";
+import fs from "node:fs";
+import { createRequire } from "node:module";
+import { after, before, describe, test } from "node:test";
+
+import { fixturePage, launch } from "./support.mjs";
+
+const require = createRequire(import.meta.url);
+const axeSource = fs.readFileSync(require.resolve("axe-core/axe.min.js"), "utf8");
+
+let browser;
+before(async () => { browser = await launch(); });
+after(async () => { await browser?.close(); });
+
+// The page's own fill and ink, as an app's body has them, so axe reads the parts on the page they are drawn on.
+const PAGE = `document.body.style.margin = "0"; document.body.style.background = "var(--basalt-surface-page)"; document.body.style.color = "var(--basalt-text-primary)"; document.body.style.fontFamily = "var(--basalt-font-family-sans)";\n`;
+const open = async (body, { theme = "dark", width = 1024, height = 800, ...options } = {}) => {
+ const { page, errors } = await fixturePage(browser, PAGE + body, { theme, viewport: { width, height }, ...options });
+ page.errors = errors;
+ return page;
+};
+const axe = async (page) => {
+ await page.evaluate(() => { document.title = "Basalt"; document.documentElement.lang = "en"; });
+ await page.addScriptTag({ content: axeSource });
+ return page.evaluate(async () => {
+ const options = { runOnly: { type: "tag", values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"] }, resultTypes: ["violations"] };
+ const result = await globalThis.axe.run(document, options);
+ return result.violations.map((v) => `${v.id}: ${v.nodes.map((n) => n.target.join(" ")).join(" | ")}`);
+ });
+};
+const until = (page, fn, arg) => page.waitForFunction(fn, arg, { timeout: 5000, polling: "raf" }).catch(async (error) => {
+ const seen = await page.evaluate(() => ({ value: document.querySelector("textarea")?.value, caret: document.querySelector("textarea")?.selectionStart, list: Boolean(document.querySelector('[role="listbox"]')), focused: document.activeElement?.tagName })).catch(() => null);
+ throw new Error(`${error.message}; the page: ${JSON.stringify(seen)}`);
+});
+
+// ---- The plate ----
+
+const PLATES = `
+createRoot(document.getElementById("root")).render(<>
+ page
+
1
+
2
+
3
+
light in dark
+
dark in light
+>);`;
+
+describe("the public plate", () => {
+ for (const theme of ["dark", "light"]) {
+ test(`${theme}: --basalt-plate is the old recipe's pixel on the page and at levels 1 to 3, one opaque colour, and a nested theme root gets its own theme's`, async () => {
+ const page = await open(PLATES, { theme });
+ const got = await page.evaluate((dark) => {
+ const canvas = document.createElement("canvas"); canvas.width = canvas.height = 1;
+ const ctx = canvas.getContext("2d", { willReadFrequently: true });
+ const px = (css) => { ctx.clearRect(0, 0, 1, 1); ctx.fillStyle = "#f0f"; ctx.fillStyle = css; ctx.fillRect(0, 0, 1, 1); return [...ctx.getImageData(0, 0, 1, 1).data].join(","); };
+ // The recipe the stylesheet held privately before the plate was public (--_plate-solid), evaluated on a probe at the same place.
+ const recipe = (el, light, darkMix) => {
+ const probe = document.createElement("i");
+ probe.style.background = dark ? darkMix : light;
+ el.parentElement.append(probe);
+ const value = getComputedStyle(probe).backgroundColor;
+ probe.remove();
+ return px(value);
+ };
+ const mix = (top, pct, under) => `color-mix(in srgb, var(--basalt-${top}) ${pct}%, var(--basalt-${under}))`;
+ const at = (id) => document.getElementById(id);
+ const plate = (id) => px(getComputedStyle(at(id)).backgroundColor);
+ const rows = [
+ ["p0", mix("neutral-0", 7, "surface-page"), mix("neutral-100", 9, "surface-1")],
+ ["p1", mix("neutral-0", 7, "surface-1"), mix("neutral-100", 9, "surface-2")],
+ ["p2", mix("neutral-0", 7, "surface-2"), mix("neutral-100", 9, "surface-3")],
+ ["p3", mix("neutral-0", 7, "surface-3"), mix("neutral-100", 9, "surface-3")],
+ ];
+ return {
+ rows: rows.map(([id, light, darkMix]) => ({ id, plate: plate(id), recipe: recipe(at(id), light, darkMix), raw: getComputedStyle(at(id)).backgroundColor })),
+ nestedLight: plate("nl"),
+ nestedDark: plate("nd"),
+ };
+ }, theme === "dark");
+ for (const row of got.rows) {
+ assert.equal(row.plate, row.recipe, `${theme}: ${row.id} paints ${row.plate}, the recipe ${row.recipe}`);
+ assert.ok(!/\/|rgba/.test(row.raw), `${theme}: ${row.id} is opaque (${row.raw})`);
+ }
+ // A nested theme root starts at its own theme's page plate.
+ const near = (got, want, what) => got.split(",").slice(0, 3).forEach((c, i) => assert.ok(Math.abs(Number(c) - want[i]) <= 1, `${what}: ${got}`));
+ near(got.nestedLight, [232, 232, 232], "a light root inside the page has light's page plate, about #e8e8e8");
+ near(got.nestedDark, [32, 32, 32], "a dark root inside the page has dark's page plate, about #202020");
+ assert.deepEqual(page.errors, []);
+ await page.close();
+ });
+ }
+});
+
+// ---- The mention ----
+
+const MENTIONS = `
+createRoot(document.getElementById("root")).render(
+
Thanks Ana Ruiz, the refund for order 4471 went out.
+
The nightly build failed on arm64; Lee Park, can you look at the linker step that ran out of memory?
+
Routed to billing.
+
);`;
+
+describe("Mention", () => {
+ for (const theme of ["dark", "light"]) {
+ test(`${theme}: the trigger and the name at 500 in primary ink, no colour of its own; you sits on its level's plate, wrapping with its text, keeping the space before it whole`, async () => {
+ const page = await open(MENTIONS, { theme });
+ const got = await page.evaluate(() => {
+ const s = (id) => getComputedStyle(document.getElementById(id));
+ const probe = document.createElement("i"); probe.style.color = "var(--basalt-text-primary)"; document.body.append(probe);
+ const primary = getComputedStyle(probe).color; probe.remove();
+ const plateProbe = document.createElement("i"); plateProbe.style.background = "var(--basalt-plate)"; document.getElementById("card").append(plateProbe);
+ const cardPlate = getComputedStyle(plateProbe).backgroundColor; plateProbe.remove();
+ const you = document.getElementById("m-you");
+ return {
+ text: document.getElementById("m-ana").textContent, hash: document.getElementById("m-hash").textContent,
+ weight: s("m-ana").fontWeight, color: s("m-ana").color, primary, bg: s("m-ana").backgroundColor,
+ youBg: s("m-you").backgroundColor, cardPlate, youRadius: s("m-you").borderTopLeftRadius, youLines: you.getClientRects().length,
+ youMargin: s("m-you").marginInlineStart, youPad: s("m-you").paddingInlineStart, decoration: s("m-you").boxDecorationBreak || s("m-you").webkitBoxDecorationBreak,
+ };
+ });
+ assert.equal(got.text, "@Ana Ruiz");
+ assert.equal(got.hash, "#billing");
+ assert.equal(got.weight, "500");
+ assert.equal(got.color, got.primary);
+ assert.equal(got.bg, "rgba(0, 0, 0, 0)", "a mention has no fill of its own");
+ assert.equal(got.youBg, got.cardPlate, "you sits on the plate of the card's level");
+ assert.equal(got.youRadius, "4px");
+ assert.equal(got.youPad, "2px");
+ assert.equal(got.youMargin, "0px", "the padding is its own: the space before it stays a whole space");
+ assert.equal(got.decoration, "clone", "the plate is drawn on every line it wraps to");
+ assert.deepEqual(await axe(page), []);
+ await page.close();
+ });
+ }
+
+ test("forced colours: you is Mark with MarkText; a plain mention keeps its weight", async () => {
+ const page = await open(MENTIONS, { theme: "dark", forcedColors: "active" });
+ const got = await page.evaluate(() => {
+ const probe = document.createElement("i"); probe.style.background = "Mark"; probe.style.color = "MarkText"; document.body.append(probe);
+ const mark = [getComputedStyle(probe).backgroundColor, getComputedStyle(probe).color]; probe.remove();
+ const you = getComputedStyle(document.getElementById("m-you"));
+ return { mark, you: [you.backgroundColor, you.color], weight: getComputedStyle(document.getElementById("m-ana")).fontWeight };
+ });
+ assert.deepEqual(got.you, got.mark);
+ assert.equal(got.weight, "500");
+ await page.close();
+ });
+});
+
+// ---- The composer ----
+
+// window.sends records each send; window.answer(n) settles the nth pending send (true: it was sent; false: it was refused).
+const COMPOSER = (props = "", extra = "") => `
+window.sends = []; window.pending = [];
+window.answer = (i, ok = true) => { const p = window.pending[i]; ok ? p.resolve() : p.reject(new Error("refused")); };
+window.addEventListener("unhandledrejection", (e) => { e.preventDefault(); window.rejected = String(e.reason); });
+function App() {
+ const [typing, setTyping] = React.useState([]);
+ window.setTyping = setTyping;
+ return (
+
`)};
+}
+createRoot(document.getElementById("root")).render();`;
+const listbox = '[role="listbox"]';
+const state = (page) => page.evaluate(() => {
+ const ta = document.querySelector("#c textarea");
+ const list = document.querySelector('[role="listbox"]');
+ const active = ta.getAttribute("aria-activedescendant");
+ return {
+ open: Boolean(list) && !list.closest("[data-ending-style]"),
+ value: ta.value, caret: ta.selectionStart, focused: document.activeElement === ta,
+ controls: ta.getAttribute("aria-controls"), listId: list?.id ?? null, active, activeText: active ? document.getElementById(active)?.querySelector(".basalt-menu-item-label")?.textContent : null,
+ autocomplete: ta.getAttribute("aria-autocomplete"), popup: ta.getAttribute("aria-haspopup"),
+ rows: list ? [...list.querySelectorAll('[role="option"]')].map((o) => o.querySelector(".basalt-menu-item-label").textContent) : [],
+ groups: list ? [...list.querySelectorAll('[role="group"]')].map((g) => document.getElementById(g.getAttribute("aria-labelledby")).textContent) : [],
+ };
+});
+
+describe("MentionPicker", () => {
+ test("@ opens the matching names in groups, focus stays in the field, and the field points at the active row; the rows are Combobox's two-line rows", async () => {
+ const page = await open(PICKER());
+ await page.locator(field).click();
+ let s = await state(page);
+ assert.equal(s.autocomplete, "list");
+ assert.equal(s.popup, "listbox");
+ assert.equal(s.open, false);
+ await page.keyboard.type("Thanks @an");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ s = await state(page);
+ assert.equal(s.focused, true);
+ assert.deepEqual(s.rows, ["Ana Ruiz", "Anders Holm", "android-release", "analytics"]);
+ assert.deepEqual(s.groups, ["People", "Teams"]);
+ assert.equal(s.controls, s.listId);
+ assert.equal(s.activeText, "Ana Ruiz");
+ assert.equal(await page.evaluate(() => window.query), "an");
+ const row = await page.evaluate(() => {
+ const option = document.querySelector('[role="option"]');
+ // Its layout height: the popup may still be easing in from .98.
+ return { h: option.offsetHeight, selected: option.getAttribute("aria-selected"), cls: option.className, level: document.querySelector(".basalt-mention-picker").dataset.level };
+ });
+ assert.equal(row.h, 58, "a two-line popup row: 58, its plate 54");
+ assert.equal(row.selected, "true");
+ assert.match(row.cls, /basalt-menu-item/);
+ assert.equal(row.level, "1", "a popup opened from the page is level 1");
+ for (const theme of ["dark", "light"]) {
+ await page.evaluate(async (t) => {
+ document.documentElement.dataset.theme = t;
+ // The rows' ink eases to the new theme: read it once it has.
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
+ await Promise.all(document.getAnimations().map((a) => a.finished.catch(() => {})));
+ }, theme);
+ assert.deepEqual(await axe(page), [], `${theme}: axe with the picker open`);
+ }
+ await page.close();
+ });
+
+ test("↓ and ↑ move the plate and pass over a disabled row; Enter writes the name and a space and does not send; the app hears the pick", async () => {
+ const page = await open(PICKER());
+ await page.locator(field).click();
+ await page.keyboard.type("Ask @an");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ await page.keyboard.press("ArrowDown");
+ await page.keyboard.press("ArrowDown");
+ assert.equal((await state(page)).activeText, "android-release");
+ await page.keyboard.press("ArrowDown");
+ assert.equal((await state(page)).activeText, "Ana Ruiz", "analytics is passed over, and the list wraps");
+ await page.keyboard.press("ArrowUp");
+ assert.equal((await state(page)).activeText, "android-release");
+ await page.keyboard.press("Enter");
+ const s = await state(page);
+ assert.equal(s.value, "Ask @android-release ");
+ assert.equal(s.caret, s.value.length);
+ assert.equal(s.open, false);
+ assert.equal(s.controls, null);
+ assert.equal(s.active, null);
+ assert.equal(await page.evaluate(() => window.sends), undefined, "the Enter was the picker's");
+ assert.deepEqual(await page.evaluate(() => window.picks), [["t1", 4, 20, "Ask @android-release "]]);
+ // Undo takes the pick back, as the browser's own edit.
+ await page.keyboard.press(process.platform === "darwin" ? "Meta+z" : "Control+z");
+ assert.equal((await state(page)).value, "Ask @an");
+ await page.close();
+ });
+
+ test("Tab picks too; a press on a row picks it and keeps focus in the field; a name before a space keeps that space", async () => {
+ const page = await open(PICKER());
+ await page.locator(field).click();
+ await page.keyboard.type("@be");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ await page.keyboard.press("Tab");
+ assert.equal((await state(page)).value, "@Ben Okafor ");
+ await page.keyboard.type("and @");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ assert.deepEqual((await state(page)).groups, ["People", "Teams", "Roles"], "a bare trigger offers every group");
+ await page.locator('[role="option"]', { hasText: "on-call" }).click();
+ let s = await state(page);
+ assert.equal(s.value, "@Ben Okafor and @on-call ");
+ assert.equal(s.focused, true);
+ // A name typed in front of words already there keeps their space.
+ await page.evaluate(() => { const ta = document.querySelector("#c textarea"); ta.setSelectionRange(0, 0); });
+ await page.keyboard.type("@an ");
+ await page.keyboard.press("ArrowLeft");
+ await until(page, () => document.querySelector('[role="listbox"]') && !document.querySelector("[data-ending-style]"));
+ await page.keyboard.press("Enter");
+ s = await state(page);
+ assert.equal(s.value, "@Ana Ruiz @Ben Okafor and @on-call ");
+ assert.equal(s.caret, "@Ana Ruiz ".length);
+ await page.close();
+ });
+
+ test("a name can hold a space while something matches, and a sentence closes it; a trigger inside a word opens nothing; nothing matching opens nothing", async () => {
+ const page = await open(PICKER());
+ await page.locator(field).click();
+ await page.keyboard.type("@ana r");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ // "r" starts Ruiz, and "Reaches" in analytics' description.
+ assert.deepEqual((await state(page)).rows, ["Ana Ruiz", "analytics"]);
+ await page.keyboard.type("eplied");
+ await until(page, () => !document.querySelector('[role="listbox"]'));
+ await page.keyboard.press("Enter");
+ assert.deepEqual(await page.evaluate(() => window.sends), ["@ana replied"], "closed, Enter sends");
+ await page.keyboard.type("mail ops@an");
+ await page.waitForTimeout(100);
+ assert.equal((await state(page)).open, false, "an @ inside a word (an address) is not a mention");
+ await page.keyboard.type(" @zz");
+ await page.waitForTimeout(100);
+ assert.equal((await state(page)).open, false);
+ assert.equal(await page.evaluate(() => window.query), "zz", "the app still hears the query, to look it up");
+ await page.close();
+ });
+
+ test("Esc closes it until another trigger is typed, and a dialog round the field stays open", async () => {
+ const page = await open(PICKER({ wrap: (c) => `Reply${c}` }));
+ await page.locator(field).click();
+ await page.keyboard.type("@an");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ assert.equal(await page.locator(".basalt-mention-picker").getAttribute("data-level"), "2", "a popup from a dialog is level 2");
+ await page.keyboard.press("Escape");
+ await until(page, () => !document.querySelector('[role="listbox"]'));
+ assert.equal(await page.locator(".basalt-dialog").count(), 1, "the dialog is still open");
+ await page.keyboard.type("d");
+ await page.waitForTimeout(100);
+ assert.equal((await state(page)).open, false, "the same mention stays closed");
+ await page.keyboard.type(" @ok");
+ await until(page, () => document.querySelector('[role="listbox"]'));
+ assert.deepEqual((await state(page)).rows, ["Ben Okafor"]);
+ await page.close();
+ });
+
+ test("it sits under the trigger's line when there is room, above it near the window's foot, and inside the window at 390", async () => {
+ for (const [top, width, want] of [[40, 1024, "bottom"], [700, 1024, "top"], [40, 390, "bottom"]]) {
+ const page = await open(PICKER({ top }), { width, height: 800 });
+ await page.locator(field).click();
+ await page.keyboard.type("Thanks for the report, @");
+ await until(page, () => document.querySelector('[role="listbox"]') && document.querySelector(".basalt-mention-positioner")?.dataset.side);
+ const got = await page.evaluate(() => {
+ const pop = document.querySelector(".basalt-mention-picker").getBoundingClientRect();
+ const ta = document.querySelector("#c textarea").getBoundingClientRect();
+ return { side: document.querySelector(".basalt-mention-positioner").dataset.side, top: pop.top, bottom: pop.bottom, left: pop.left, right: pop.right, taTop: ta.top, taBottom: ta.bottom, vw: innerWidth, vh: innerHeight };
+ });
+ assert.equal(got.side, want, `top ${top} at ${width}`);
+ assert.ok(got.left >= 8 && got.right <= got.vw - 8 + 0.5, `inside the window: ${got.left} to ${got.right} of ${got.vw}`);
+ assert.ok(got.top >= 8 - 0.5 && got.bottom <= got.vh - 8 + 0.5, `inside the window: ${got.top} to ${got.bottom}`);
+ if (want === "bottom") assert.ok(got.top > got.taTop + 20, "under the trigger's line");
+ else assert.ok(got.bottom <= got.taTop + 16 + 0.5, "above the trigger's line");
+ await page.close();
+ }
+ });
+});
+
+// ---- Fix pass 1 (Astra's review): a stale query, an input method's Enter, a field that cannot be written, the phone's keyboard, the typing
+// line's one line, the caller's ARIA, and the picker loaded only when asked for ----
+
+// A plain controlled textarea with the picker, so an Enter sends nothing and the field's value is the test's to read. window.setDraft sets the
+// value as an app would (React state, no input event); window.flags sets readOnly and disabled.
+const OWN_FIELD = (pre = "") => `
+${pre}
+window.picks = [];
+const OPTIONS = ${PEOPLE};
+function App() {
+ const [text, setText] = React.useState("");
+ const [flags, setFlags] = React.useState({ readOnly: false, disabled: false });
+ const [picker, setPicker] = React.useState(true);
+ window.setDraft = setText; window.flags = setFlags; window.setPicker = setPicker;
+ const ref = React.useRef(null);
+ return (
+
+
+ );
+}
+createRoot(document.getElementById("root")).render();`;
+const own = "#own";
+const opened = (page) => until(page, () => document.querySelector('[role="listbox"]') && !document.querySelector(".basalt-mention-picker[data-ending-style]"));
+
+describe("fix pass 1", () => {
+ test("a value the app sets while the picker is open closes it: Enter and a press on an old row write nothing, by React state or by the DOM", async () => {
+ const page = await open(OWN_FIELD());
+ await page.locator(own).click();
+ await page.keyboard.type("@a");
+ await opened(page);
+ // A controlled update: React state, no input event. The picker closes as it is drawn; a press on a row of the closing popup writes nothing,
+ // and the next Enter is the field's own (a new line), not a pick.
+ await page.evaluate(() => window.setDraft("draft"));
+ await until(page, () => document.getElementById("own").value === "draft");
+ await page.locator('[role="option"]').first().dispatchEvent("click").catch(() => {});
+ assert.equal(await page.locator(own).inputValue(), "draft", "the field stays the app's draft");
+ await page.keyboard.press("Enter");
+ assert.equal(await page.locator(own).inputValue(), "draft\n", "the Enter was the field's");
+ assert.deepEqual(await page.evaluate(() => window.picks), []);
+ // The DOM's value set straight, with nothing drawn and before any event says so: an Enter and a press at once. The picker still shows its
+ // rows, reads the field live, and writes nothing; the Enter it was shown for is still its own, so it does not reach the field either.
+ await page.evaluate(() => window.setDraft(""));
+ await until(page, () => document.getElementById("own").value === "");
+ await page.locator(own).click();
+ await page.keyboard.type("@a");
+ await opened(page);
+ const consumed = await page.evaluate(() => {
+ const ta = document.getElementById("own");
+ ta.value = "draft";
+ ta.setSelectionRange(5, 5);
+ const enter = new KeyboardEvent("keydown", { key: "Enter", bubbles: true, cancelable: true });
+ ta.dispatchEvent(enter);
+ document.querySelector('[role="option"]')?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
+ return enter.defaultPrevented;
+ });
+ assert.equal(consumed, true);
+ assert.equal(await page.locator(own).inputValue(), "draft");
+ assert.deepEqual(await page.evaluate(() => window.picks), []);
+ await until(page, () => !document.querySelector('[role="listbox"]'));
+ await page.close();
+ });
+
+ test("an input method's Enter (key code 229) picks nothing, writes nothing and sends nothing", async () => {
+ const page = await open(PICKER());
+ await page.locator(field).click();
+ await page.keyboard.type("@an");
+ await opened(page);
+ const before = await state(page);
+ const ime = await page.evaluate(() => {
+ const ta = document.querySelector("#c textarea");
+ const event = new KeyboardEvent("keydown", { key: "Enter", bubbles: true, cancelable: true });
+ Object.defineProperty(event, "keyCode", { get: () => 229 });
+ ta.dispatchEvent(event);
+ return event.defaultPrevented;
+ });
+ const after = await state(page);
+ assert.equal(ime, false, "the key is left to the input method");
+ assert.equal(after.value, before.value);
+ assert.equal(after.open, true);
+ assert.deepEqual(await page.evaluate(() => [window.picks, window.sends]), [[], undefined]);
+ await page.close();
+ });
+
+ test("a read-only or disabled field: the picker does not open there, and a field made read-only while it is open is not written", async () => {
+ const page = await open(OWN_FIELD());
+ await page.evaluate(() => window.flags({ readOnly: true, disabled: false }));
+ await page.evaluate(() => { const ta = document.getElementById("own"); ta.focus(); ta.value = "@a"; ta.setSelectionRange(2, 2); ta.dispatchEvent(new Event("input", { bubbles: true })); ta.dispatchEvent(new KeyboardEvent("keyup", { key: "a" })); });
+ await page.waitForTimeout(150);
+ assert.equal(await page.locator('[role="listbox"]').count(), 0, "read-only: closed");
+ await page.evaluate(() => { window.flags({ readOnly: false, disabled: false }); window.setDraft(""); });
+ await page.locator(own).click();
+ await page.keyboard.type("@a");
+ await opened(page);
+ // Made read-only while open: Enter and a press write nothing.
+ await page.evaluate(() => { document.getElementById("own").readOnly = true; });
+ await page.keyboard.press("Enter");
+ await page.locator('[role="option"]').first().dispatchEvent("click").catch(() => {});
+ assert.equal(await page.locator(own).inputValue(), "@a");
+ assert.deepEqual(await page.evaluate(() => window.picks), []);
+ // Disabled: the same.
+ await page.evaluate(() => { const ta = document.getElementById("own"); ta.readOnly = false; ta.focus(); ta.dispatchEvent(new KeyboardEvent("keyup", { key: "a" })); });
+ await opened(page);
+ await page.evaluate(() => { document.getElementById("own").disabled = true; });
+ await page.locator('[role="option"]').first().dispatchEvent("click").catch(() => {});
+ assert.equal(await page.locator(own).inputValue(), "@a");
+ assert.deepEqual(await page.evaluate(() => window.picks), []);
+ await page.close();
+ });
+
+ test("the phone's keyboard: with a visual viewport shorter than the window, the picker opens above the caret, inside what can be seen", async () => {
+ // A stand-in for a keyboard that covers the window's lower part (WebKit keeps innerHeight whole): the visual viewport is 300 tall.
+ const STUB = `{ const vv = new EventTarget(); Object.assign(vv, { offsetTop: 0, offsetLeft: 0, height: 300, width: innerWidth, scale: 1, pageTop: 0, pageLeft: 0 }); Object.defineProperty(window, "visualViewport", { configurable: true, get: () => vv }); window.vv = vv; }`;
+ const page = await open(OWN_FIELD(STUB), { width: 390, height: 800 });
+ await page.locator(own).click();
+ await page.keyboard.type("@");
+ await opened(page);
+ await until(page, () => document.querySelector(".basalt-mention-positioner")?.dataset.side).catch((e) => { throw new Error(`${e.message}; errors: ${page.errors.join(" | ")}`); });
+ const got = await page.evaluate(() => {
+ const pop = document.querySelector(".basalt-mention-picker").getBoundingClientRect();
+ const ta = document.getElementById("own").getBoundingClientRect();
+ return { side: document.querySelector(".basalt-mention-positioner").dataset.side, top: pop.top, bottom: pop.bottom, taTop: ta.top };
+ });
+ assert.equal(got.side, "top", "the room below the visible edge is short, so it opens above");
+ assert.ok(got.bottom <= got.taTop + 16, `above the caret's line: ${got.bottom} against ${got.taTop}`);
+ assert.ok(got.top >= 8 - 0.5, `inside what can be seen: ${got.top}`);
+ // The keyboard goes: the viewport grows back, and the picker follows it (resize), below the line again.
+ await page.evaluate(() => { window.vv.height = 800; window.vv.dispatchEvent(new Event("resize")); });
+ await until(page, () => document.querySelector(".basalt-mention-positioner").dataset.side === "bottom");
+ // A scroll of the visual viewport (a pinch-zoomed page panned) moves it too.
+ await page.evaluate(() => { window.vv.height = 200; window.vv.offsetTop = 100; window.vv.dispatchEvent(new Event("scroll")); });
+ await until(page, () => document.querySelector(".basalt-mention-positioner").dataset.side === "top");
+ const top = await page.evaluate(() => document.querySelector(".basalt-mention-picker").getBoundingClientRect().top);
+ assert.ok(top >= 108 - 0.5, `kept under the visual viewport's top (100) and its margin: ${top}`);
+ await page.close();
+ });
+
+ test("the typing line stays one line at 390 with three long names: cut with an ellipsis, the whole text in the live region", async () => {
+ const page = await open(COMPOSER(), { width: 390 });
+ await page.locator("#c").evaluate((el) => { el.parentElement.style.width = "358px"; el.parentElement.style.padding = "16px"; el.parentElement.style.boxSizing = "border-box"; });
+ const below = await box(page, "#after");
+ await page.evaluate(() => window.setTyping(["Maximiliana Okonkwo-Fairweather", "Bartholomew Alessandrini", "Genevieve Castellanos-Ruiz"]));
+ await until(page, () => document.querySelector("#c .basalt-composer-status").textContent.endsWith("are typing"));
+ const got = await page.locator("#c .basalt-composer-status").evaluate((el) => ({ h: el.getBoundingClientRect().height, cut: el.scrollWidth > el.clientWidth, overflow: getComputedStyle(el).textOverflow, text: el.textContent, live: el.getAttribute("aria-live") }));
+ assert.equal(got.h, 16, "one line");
+ assert.equal(got.cut, true, "the names are wider than the line");
+ assert.equal(got.overflow, "ellipsis");
+ assert.equal(got.text, "Maximiliana Okonkwo-Fairweather, Bartholomew Alessandrini, and Genevieve Castellanos-Ruiz are typing");
+ assert.equal(got.live, "polite");
+ assert.equal((await box(page, "#after")).y, below.y, "nothing under it moved");
+ await page.close();
+ });
+
+ test("the field's own ARIA is kept: its aria-controls comes back when the picker closes and when it lets go", async () => {
+ const page = await open(OWN_FIELD());
+ const aria = () => page.locator(own).evaluate((el) => ({ controls: el.getAttribute("aria-controls"), active: el.getAttribute("aria-activedescendant"), described: el.getAttribute("aria-describedby") }));
+ assert.equal((await aria()).controls, "help-1", "at rest, the field's own");
+ await page.locator(own).click();
+ await page.keyboard.type("@a");
+ await opened(page);
+ const during = await aria();
+ assert.notEqual(during.controls, "help-1");
+ assert.ok(during.active);
+ await page.keyboard.press("Escape");
+ await until(page, () => document.getElementById("own").getAttribute("aria-controls") === "help-1");
+ assert.equal((await aria()).active, null);
+ // The picker lets go (unmounted while open): the field has its own again, and none of the picker's.
+ await page.keyboard.type(" @b");
+ await opened(page);
+ await page.evaluate(() => window.setPicker(false));
+ await until(page, () => !document.getElementById("own").hasAttribute("aria-autocomplete"));
+ const released = await page.locator(own).evaluate((el) => ({ controls: el.getAttribute("aria-controls"), active: el.getAttribute("aria-activedescendant"), popup: el.getAttribute("aria-haspopup"), described: el.getAttribute("aria-describedby") }));
+ assert.deepEqual(released, { controls: "help-1", active: null, popup: null, described: "help-1" });
+ await page.close();
+ });
+
+ test("a composer without mentions draws no picker and leaves its field alone; one with mentions draws it, attached to its field", async () => {
+ const plain = await open(COMPOSER());
+ assert.equal(await plain.evaluate(() => document.querySelector("#c textarea").hasAttribute("aria-autocomplete")), false, "no picker attached");
+ await plain.close();
+ const withPicker = await open(PICKER());
+ await until(withPicker, () => document.querySelector("#c textarea").getAttribute("aria-autocomplete") === "list");
+ await withPicker.close();
+ });
+});
diff --git a/packages/react/test/display-states.test.mjs b/packages/react/test/display-states.test.mjs
index 5b9de7f0..5eac73ea 100644
--- a/packages/react/test/display-states.test.mjs
+++ b/packages/react/test/display-states.test.mjs
@@ -391,7 +391,7 @@ describe("the choice card", () => {
test(`${theme}: selected is one solid fill at the card's own level, hover is the wash alone, and tertiary content steps up`, async () => {
const { page } = await open(CARDS, { theme, ...DESKTOP });
- const paint = (id) => page.locator(card(id)).evaluate((el) => { const s = getComputedStyle(el); const probe = document.createElement("i"); probe.style.backgroundColor = "var(--_plate-solid)"; el.append(probe); const plate = getComputedStyle(probe).backgroundColor; probe.remove(); return { bg: s.backgroundColor, image: s.backgroundImage, plate, veil: getComputedStyle(el, "::before").opacity }; });
+ const paint = (id) => page.locator(card(id)).evaluate((el) => { const s = getComputedStyle(el); const probe = document.createElement("i"); probe.style.backgroundColor = "var(--basalt-plate)"; el.append(probe); const plate = getComputedStyle(probe).backgroundColor; probe.remove(); return { bg: s.backgroundColor, image: s.backgroundImage, plate, veil: getComputedStyle(el, "::before").opacity }; });
const rest = await paint("plan-a");
const chosen = await paint("plan-b");
assert.equal(chosen.bg, chosen.plate, "the plate recipe, one solid colour");
@@ -529,7 +529,7 @@ describe("the pressed toggle", () => {
test(`${theme}: pressed is the selected plate as one solid fill at the level, primary ink, the check swapped in, and no weight change`, async () => {
const { page } = await open(TOGGLES, { theme, ...DESKTOP });
- const paint = (id) => page.locator(id).evaluate((node) => { const s = getComputedStyle(node); const probe = document.createElement("i"); probe.style.backgroundColor = "var(--_plate-solid)"; node.parentElement.append(probe); const plate = getComputedStyle(probe).backgroundColor; probe.remove(); const seat = node.querySelector(".basalt-button-check .basalt-icon"); return { bg: s.backgroundColor, image: s.backgroundImage, colour: s.color, weight: s.fontWeight, radius: s.borderRadius, shadow: s.boxShadow, plate, check: seat ? getComputedStyle(seat).opacity : null }; });
+ const paint = (id) => page.locator(id).evaluate((node) => { const s = getComputedStyle(node); const probe = document.createElement("i"); probe.style.backgroundColor = "var(--basalt-plate)"; node.parentElement.append(probe); const plate = getComputedStyle(probe).backgroundColor; probe.remove(); const seat = node.querySelector(".basalt-button-check .basalt-icon"); return { bg: s.backgroundColor, image: s.backgroundImage, colour: s.color, weight: s.fontWeight, radius: s.borderRadius, shadow: s.boxShadow, plate, check: seat ? getComputedStyle(seat).opacity : null }; });
const secOff = await paint("#t-sec");
const ghostOff = await paint("#t-ghost");
assert.equal(secOff.check, "0");
@@ -584,9 +584,11 @@ describe("the pressed toggle", () => {
for (const [theme, expected] of [["light", [232, 232, 232]], ["dark", null]]) {
const { page } = await open(body, { theme, ...DESKTOP });
const bg = await page.locator("#p").evaluate((n) => getComputedStyle(n).backgroundColor);
- const rgb = bg.match(/[\d.]+/g).slice(0, 3).map(Number).map((c) => (bg.startsWith("color(srgb") ? c * 255 : c));
+ // Read as painted (the plate is the token plate-0 now, written in oklch, so its computed text is not rgb()).
+ const painted = (css) => page.evaluate((value) => { const c = document.createElement("canvas"); c.width = c.height = 1; const x = c.getContext("2d"); x.fillStyle = value; x.fillRect(0, 0, 1, 1); return [...x.getImageData(0, 0, 1, 1).data].slice(0, 3); }, css);
+ const rgb = await painted(bg);
if (expected) rgb.forEach((c, i) => assert.ok(Math.abs(c - expected[i]) <= 1, `${theme}: ${bg}`));
- else assert.equal(bg, await fillOf(page, "color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-1))"), "dark: unchanged");
+ else assert.deepEqual(rgb, await painted(await fillOf(page, "color-mix(in srgb, var(--basalt-neutral-100) 9%, var(--basalt-surface-1))")), "dark: unchanged");
assert.ok(!/\/|rgba/.test(bg), `opaque: ${bg}`);
await page.close();
}
diff --git a/packages/react/test/export-sizes.json b/packages/react/test/export-sizes.json
index 7faa7438..6a9d0855 100644
--- a/packages/react/test/export-sizes.json
+++ b/packages/react/test/export-sizes.json
@@ -27,7 +27,7 @@
"BadgePair": 411,
"BigLinkList": 257,
"BigLinkRow": 4708,
- "Bones": 8911,
+ "Bones": 9148,
"BrandSvg": 1084,
"Breadcrumbs": 5631,
"Button": 17513,
@@ -62,6 +62,7 @@
"CommandBlock": 4923,
"CommandList": 33057,
"CommandMenu": 84381,
+ "Composer": 51932,
"CopyButton": 18435,
"CopyGlyph": 2884,
"Countdown": 2920,
@@ -130,7 +131,7 @@
"ListboxGroup": 405,
"ListboxOption": 4052,
"LivePreview": 46023,
- "LoadingShape": 11486,
+ "LoadingShape": 11724,
"LogFields": 414,
"LogLine": 602,
"LogSlots": 1588,
@@ -138,6 +139,8 @@
"LoopsToggle": 30148,
"LoopsToggleIcon": 17952,
"MarksRow": 886,
+ "Mention": 342,
+ "MentionPicker": 13737,
"Menu": 181593,
"MenuCheckboxItem": 184918,
"MenuContent": 186365,
@@ -234,7 +237,7 @@
"ShortcutList": 10032,
"SingleKeysSwitch": 17082,
"SiteBrand": 1302,
- "SiteFooter": 14780,
+ "SiteFooter": 14782,
"SiteHeader": 175837,
"SiteLockupDefs": 694,
"SiteMenu": 168176,
@@ -291,7 +294,7 @@
"TabsPanels": 385,
"Terminal": 32255,
"Text": 922,
- "TextButton": 10415,
+ "TextButton": 10414,
"TextMorph": 4504,
"Textarea": 26909,
"ThemeChoiceControl": 4794,
@@ -349,6 +352,7 @@
"travelLeg": 248,
"travelRun": 896,
"travelTokens": 415,
+ "typingStatus": 195,
"useApplePlatform": 272,
"useConfirm": 269,
"useGlide": 1355,
@@ -370,11 +374,11 @@
"useWaitMark": 303
},
"package": {
- "bytes": 761670,
- "gzip": 250752
+ "bytes": 773874,
+ "gzip": 255038
},
"styles": {
- "bytes": 306435,
- "gzip": 40140
+ "bytes": 306980,
+ "gzip": 40421
}
}
diff --git a/packages/react/test/server-modules.test.mjs b/packages/react/test/server-modules.test.mjs
index 0ce9b7e6..1a6b9943 100644
--- a/packages/react/test/server-modules.test.mjs
+++ b/packages/react/test/server-modules.test.mjs
@@ -29,7 +29,7 @@ const PLAIN = [
"AMBIENT_MAX", "CONFIRM_MS", "COPIED_MS", "ENTRANCE_LATE_MS", "LOOPS_TOGGLE_DESCRIPTION", "LOOPS_TOGGLE_NAME", "REFLOW_BOUND", "STATUS_MESSAGE_MS", "TRAVEL_IN_FLIGHT",
"TRAVEL_LONG_LEG", "TRAVEL_MIN_LEG", "TRAVEL_MS_PER_PX", "TRAVEL_RUN_LIMIT", "TRAVEL_SHORT_LEG", "WAIT_MIN_SHOWN_MS", "WAIT_SHOW_AFTER_MS", "ambient", "ambientTiming", "createTravellers", "entranceKey",
"entranceSeen", "entranceStep", "entranceVerdict", "forgetEntrance", "formatAge", "formatClock", "formatCountdown", "formatDay", "formatStamp", "formatStatTime",
- "holdFirstPaint", "isApplePlatform", "isModKey", "KEEP", "fillIn", "lockupDrawing", "loopsBootstrap", "markEntranceSeen", "markPageChange", "markPageStart", "preloadCodeLanguages", "rememberCount", "rememberedCount", "shareOf", "sortRows", "standIn", "themeBootstrap", "trailingMean", "travelLeg", "travelRun", "travelTokens",
+ "holdFirstPaint", "isApplePlatform", "isModKey", "KEEP", "fillIn", "lockupDrawing", "loopsBootstrap", "markEntranceSeen", "markPageChange", "markPageStart", "preloadCodeLanguages", "rememberCount", "rememberedCount", "shareOf", "sortRows", "standIn", "themeBootstrap", "trailingMean", "travelLeg", "travelRun", "travelTokens", "typingStatus",
];
const LEFT_IN_A_CLIENT_MODULE = {
// Base UI's `createHandle`: a handle ties a trigger to a popover, both on the client, and an object made on the server could not be passed to either.
diff --git a/packages/tokens/test/contrast.test.mjs b/packages/tokens/test/contrast.test.mjs
index 6eec9f22..e98bdc21 100644
--- a/packages/tokens/test/contrast.test.mjs
+++ b/packages/tokens/test/contrast.test.mjs
@@ -704,7 +704,7 @@ for (const theme of THEMES) {
// ---- Display states (DECISIONS 95): "Not observed", the scroll hint, the choice card, the pressed toggle, the pending ring ----
//
-// The solid plate (--_plate-solid) is the plate of the menus round painted as ONE opaque colour: the wash mixed over the level in
+// The solid plate (--basalt-plate, the tokens plate-0 to plate-3) is the plate of the menus round painted as ONE opaque colour: the wash mixed over the level in
// the CSS, at the token's own alpha (9% white in dark, 7% black in light). A choice card and a pressed toggle replace their own
// fill with it, so these are the pairs a reader sees. The page (level 0) has no plate of its own: a toggle there takes level 1's
// recipe over surface-1 in both themes.
@@ -955,3 +955,27 @@ for (const theme of THEMES) {
atLeast(theme, "text-primary", 4.5, [["surface-raised (the open sources button)", color(theme, "surface-raised")]]);
});
}
+
+// ---- The public plate (cimip-gaps-2, B3): plate-0 to plate-3 ----
+//
+// The lit row's plate as one opaque colour per level, so an app's own list can draw its active row as Basalt's popups do. Each token is held to
+// the recipe the stylesheet used before it was public (the selected wash composited in sRGB over the level, or in dark over the next level), to
+// within a fraction of an 8-bit step, so a part that moved from the recipe to the token paints the same pixel. On every plate the row's inks hold.
+const PLATE_UNDER = { light: ["surface-0", "surface-1", "surface-2", "surface-3"], dark: ["surface-1", "surface-2", "surface-3", "surface-3"] };
+for (const theme of THEMES) {
+ test(`${theme}: plate-0 to plate-3 are the selected wash over their level, and primary, secondary and danger ink hold 4.5:1 on each`, () => {
+ for (const level of [0, 1, 2, 3]) {
+ const token = color(theme, `plate-${level}`);
+ assert.equal(token.alpha ?? 1, 1, `${theme}: plate-${level} is opaque`);
+ const recipe = over(color(theme, "state-selected"), color(theme, PLATE_UNDER[theme][level]));
+ for (const channel of ["r", "g", "b"]) assert.ok(Math.abs(token[channel] - recipe[channel]) * 255 < 0.1, `${theme}: plate-${level} ${channel} is ${(token[channel] * 255).toFixed(3)}, the recipe ${(recipe[channel] * 255).toFixed(3)}`);
+ if (level > 0) for (const channel of ["r", "g", "b"]) assert.ok(Math.abs(token[channel] - plateOf(theme, level)[channel]) * 255 < 0.1, `${theme}: plate-${level} is the menus round's plate`);
+ for (const text of ["text-primary", "text-secondary", "status-danger"]) {
+ const r = ratio(over(color(theme, text), token), token);
+ assert.ok(r >= 4.5, `${theme}: ${text} on plate-${level} is ${fmt(r)}:1`);
+ }
+ // A plate is a step from its level, never nothing (and never a boundary: the ink step carries the state).
+ assert.ok(ratio(token, color(theme, `surface-${level}`)) > 1.1, `${theme}: plate-${level} is no step from surface-${level}`);
+ }
+ });
+}
diff --git a/packages/tokens/tokens/theme.dark.tokens.json b/packages/tokens/tokens/theme.dark.tokens.json
index bbc8e799..e0982380 100644
--- a/packages/tokens/tokens/theme.dark.tokens.json
+++ b/packages/tokens/tokens/theme.dark.tokens.json
@@ -159,6 +159,25 @@
"$description": "Selected wash: the lit row's plate, the nav pill, a selected table row's band. A wash alone is about 1.2:1, so the state has a second cue: the ink step to primary, a check, a pill or a checked box."
}
},
+ "plate": {
+ "$description": "The lit row's plate as one opaque colour per level: the selected wash composited over that level, as a browser draws it. A plate never marks a state alone: it comes with the ink step to primary, a check or a weight. A test holds each to its recipe.",
+ "0": {
+ "$value": { "colorSpace": "oklch", "components": [0.2438, 0, 0] },
+ "$description": "The lit row's plate on the page (level 0), as one opaque colour: the next level (surface-1) plus state-selected (white at 9%). For a part that replaces its own fill (a pressed toggle, a chosen card) or an app's own list row; --basalt-plate follows the level."
+ },
+ "1": {
+ "$value": { "colorSpace": "oklch", "components": [0.2703, 0, 0] },
+ "$description": "The plate on a level-1 surface: surface-2 plus state-selected."
+ },
+ "2": {
+ "$value": { "colorSpace": "oklch", "components": [0.2926, 0, 0] },
+ "$description": "The plate on a level-2 surface: surface-3 plus state-selected."
+ },
+ "3": {
+ "$value": { "colorSpace": "oklch", "components": [0.2926, 0, 0] },
+ "$description": "The plate on a level-3 surface: level 3 is the cap, so it is surface-3 plus state-selected, as on level 2."
+ }
+ },
"action": {
"primary": {
"$value": "{color.neutral.93}",
diff --git a/packages/tokens/tokens/theme.light.tokens.json b/packages/tokens/tokens/theme.light.tokens.json
index 818bbd51..ae48853f 100644
--- a/packages/tokens/tokens/theme.light.tokens.json
+++ b/packages/tokens/tokens/theme.light.tokens.json
@@ -159,6 +159,25 @@
"$description": "Selected wash: the lit row's plate, the nav pill, a selected table row's band. A wash alone is about 1.2:1, so the state has a second cue: the ink step to primary, a check, a pill or a checked box."
}
},
+ "plate": {
+ "$description": "The lit row's plate as one opaque colour per level: the selected wash composited over that level, as a browser draws it. A plate never marks a state alone: it comes with the ink step to primary, a check or a weight. A test holds each to its recipe.",
+ "0": {
+ "$value": { "colorSpace": "oklch", "components": [0.9325, 0, 0] },
+ "$description": "The lit row's plate on the page (level 0), as one opaque colour: state-selected (black at 7%) over surface-0. For a part that replaces its own fill (a pressed toggle, a chosen card) or an app's own list row; --basalt-plate follows the level."
+ },
+ "1": {
+ "$value": { "colorSpace": "oklch", "components": [0.9466, 0, 0] },
+ "$description": "The plate on a level-1 surface: state-selected over surface-1. In light, levels 1 to 3 are one white, so their plates are one colour."
+ },
+ "2": {
+ "$value": { "colorSpace": "oklch", "components": [0.9466, 0, 0] },
+ "$description": "The plate on a level-2 surface: state-selected over surface-2."
+ },
+ "3": {
+ "$value": { "colorSpace": "oklch", "components": [0.9466, 0, 0] },
+ "$description": "The plate on a level-3 surface: state-selected over surface-3."
+ }
+ },
"action": {
"primary": {
"$value": "{color.neutral.9}",
diff --git a/tools/review/round57.tsx b/tools/review/round57.tsx
new file mode 100644
index 00000000..0cd97fca
--- /dev/null
+++ b/tools/review/round57.tsx
@@ -0,0 +1,235 @@
+// Round 57: the composer, the mention, the mention picker and the public plate (cimip-gaps-2, batch B3). Decided and built by Opus on the
+// no-council path (DECISIONS 226 and 265); the code review is Astra's and the pixels are the lead's, and neither has happened yet. Every part
+// is shown in two unlike domains, a support inbox and a build pipeline, with synthetic names only. States: at rest (`default`), `typing`
+// (words in the field and someone typing), `long` (the field at its cap, scrolling), `sending` (a send held out, Send's ring up),
+// `picker` (@ typed, the picker open under the field's line), `picker-keys` (↓ twice), `picker-foot` (the composers at the page's foot: the
+// picker above the line), and forced colours and reduced
+// motion for each that moves or marks.
+
+import * as React from "react";
+
+import { Button, Card, CardContent, Composer, Mention, MentionPicker, Text, typingStatus } from "../../packages/react/src/index";
+import type { MentionOption } from "../../packages/react/src/index";
+import type { Round } from "./rounds";
+
+const kindOf = (state: string) => state.replace(/-(reduced-motion|forced-colours)$/, "").replace(/-foot$/, "");
+
+const SUPPORT: MentionOption[] = [
+ { label: "Ana Ruiz", value: "u1", description: "Support lead · Online", group: "People" },
+ { label: "Anders Holm", value: "u2", description: "Billing · Away until 2 pm", group: "People" },
+ { label: "Ben Okafor", value: "u3", description: "Support · Online", group: "People" },
+ { label: "billing", value: "t1", description: "Team of 4 · Refunds and invoices", group: "Teams" },
+ { label: "android-app", value: "t2", description: "Team of 6 · Mobile reports", group: "Teams" },
+ { label: "analytics", value: "t3", description: "Reaches nobody yet", group: "Teams", disabled: true },
+ { label: "tier-2", value: "r1", description: "Whoever takes escalations this week", group: "Roles" },
+];
+const PIPELINE: MentionOption[] = [
+ { label: "Lee Park", value: "u1", description: "Owns the arm64 runners", group: "People" },
+ { label: "Lena Varga", value: "u2", description: "Release manager", group: "People" },
+ { label: "Mira Sato", value: "u3", description: "Build tooling", group: "People" },
+ { label: "linker", value: "t1", description: "Team of 3 · Toolchain", group: "Teams" },
+ { label: "release", value: "t2", description: "Team of 5 · Signs and ships", group: "Teams" },
+ { label: "on-call", value: "r1", description: "Whoever holds the pager this week", group: "Roles" },
+];
+
+const DOMAINS = {
+ support: {
+ title: "Order 4471: refund not received",
+ label: "Reply to the customer",
+ placeholder: "Reply to the customer. Type @ to bring someone in.",
+ options: SUPPORT,
+ typed: "Hi Jordan, the refund went out this morning. It takes three to five business days to reach your card.",
+ long: ["Hi Jordan,", "", "The refund went out this morning.", "It takes three to five business days", "to reach your card, and your bank", "may show it as pending first.", "", "If it hasn't arrived by Friday,", "reply here and we'll trace it."].join("\n"),
+ query: "Thanks, @an",
+ typing: ["Ana Ruiz"],
+ actions: ,
+ sendKey: "Enter" as const,
+ },
+ pipeline: {
+ title: "Nightly build #2291 failed on arm64",
+ label: "Comment on the build",
+ placeholder: "Comment on the build. Type @ to ask someone.",
+ options: PIPELINE,
+ typed: "The linker ran out of memory on the arm64 runner. Rerunning with the larger runner now.",
+ long: ["The linker ran out of memory on arm64:", "", " ld: error: out of memory", " allocating 2147483648 bytes", "", "Rerunning on the 32 GB runner.", "If that passes I'll raise the default", "for every arm64 job in the matrix", "and close this."].join("\n"),
+ query: "@l",
+ typing: ["Lee Park", "Mira Sato"],
+ actions: ,
+ sendKey: "Mod+Enter" as const,
+ },
+};
+
+function Thread({ domain, state }: { domain: keyof typeof DOMAINS; state: string }) {
+ const d = DOMAINS[domain];
+ const kind = kindOf(state);
+ const [text, setText] = React.useState(kind === "typing" || kind === "sending" ? d.typed : kind === "long" ? d.long : "");
+ const field = React.useRef(null);
+ React.useEffect(() => {
+ const ta = field.current;
+ if (!ta) return undefined;
+ if (kind === "picker" || kind === "picker-keys") {
+ // A real focus and a real input event, so the picker reads the field as it would a person's typing, once the picker has taken the field.
+ const timers: number[] = [];
+ const start = () => {
+ if (!ta.hasAttribute("aria-autocomplete")) { timers.push(window.setTimeout(start, 20)); return; }
+ ta.focus();
+ ta.value = d.query;
+ ta.setSelectionRange(d.query.length, d.query.length);
+ ta.dispatchEvent(new Event("input", { bubbles: true }));
+ setText(d.query);
+ if (kind === "picker-keys") {
+ timers.push(window.setTimeout(() => {
+ for (let i = 0; i < 2; i++) ta.dispatchEvent(new KeyboardEvent("keydown", { key: "ArrowDown", bubbles: true, cancelable: true }));
+ }, 200));
+ }
+ };
+ start();
+ return () => timers.forEach(window.clearTimeout);
+ }
+ if (kind === "long") { ta.scrollTop = ta.scrollHeight; }
+ if (kind === "sending") {
+ const timer = window.setTimeout(() => ta.closest(".basalt-composer")?.querySelector(".basalt-composer-send")?.click(), 50);
+ return () => window.clearTimeout(timer);
+ }
+ return undefined;
+ }, [kind, d]);
+ return (
+
+ {d.title}
+ {domain === "support" ? (
+
+ Ben Okafor checked the payment provider: the refund was issued at 09:12. Ana Ruiz, can you confirm the card it went to?
+
+ ) : (
+
+ Mira Sato retried once with the same runner and it failed at the same step. Lee Park, is the 32 GB pool free tonight?
+
+ )}
+ (kind === "sending" ? new Promise(() => {}) : undefined)}
+ mentions={(field) => }
+ />
+
+ );
+}
+
+function Composers({ state }: { state: string }) {
+ const at = state.includes("-foot") ? "foot" : "top";
+ return (
+
+
+
+
+ );
+}
+
+// An app's own list, drawn with the public plate: the active row is `var(--basalt-plate)` at whatever level the list sits on.
+function OwnList({ title, rows, active }: { title: string; rows: string[]; active: number }) {
+ return (
+
+ );
+}
+
+export const ROUND_57: Round = {
+ id: "57",
+ title: "The composer, the mention, the mention picker and the public plate (cimip-gaps-2, B3)",
+ reviewed: false,
+ summary:
+ "Four parts any app that lets people write to each other needs: a composer (a message field with no visible label, its actions and Send, and a line for who is typing), a mention (a name that calls on someone, marked by its @ and a weight), a mention picker (Combobox's rows in a popup over the field, focus left in the field), and the lit row's plate as public tokens, so an app's own list draws its active row as Basalt does. Decided and built by Opus on the no-council path (DECISIONS 226 and 265); Astra's code review and the lead's pixel check have not happened yet, and no design panel reviewed it. Shown in a support inbox and a build pipeline, synthetic names only, at 1440 and at 390 on touch, in both themes, with forced colours and reduced motion. No space step at 160 was added: the 160 that was asked for is a label column, and `size-description-label` is that.",
+ steps: [
+ {
+ id: "composer",
+ name: "The composer",
+ intro: "Where a person writes a message: the field (its name is its label, and there is no visible one), the app's actions and Send under it, and one line for who is typing.",
+ decisions: [
+ "Built from parts that are already decided: Basalt's Textarea, a primary Button for Send at the row's end, the app's own ghost buttons at its start, and the status line in text-xs tertiary ink. No new look.",
+ "The status line is one line tall even when empty, so nothing moves when someone starts typing; it is a polite live region. `typingStatus` writes \"Ana is typing\", \"Ana and Ben are typing\", \"Ana, Ben, and Cy are typing\" and \"4 people are typing\"; an app can write its own words.",
+ "The field starts at two lines (the Textarea's own least) and grows a line at a time to eight, then scrolls; both are props (`rows`, `maxRows`). No resize handle: its height is its text's. Where the browser cannot size a field to its content it is measured instead, within the same bounds.",
+ "Enter sends and Shift+Enter is a new line, and the soft keyboard's key says Send. With `sendKey=\"Mod+Enter\"` (the build pipeline) Enter is a new line and ⌘↵ or Ctrl Enter sends, shown as chips beside Send (ActionShortcut, hidden on touch until a hardware key is pressed). A key presses Send, so a key and a press are one send, guarded by the button's own wait: while a send is out, a second Enter sends nothing.",
+ "On success the field is cleared, unless the person changed the text while it was out; a refusal keeps the words. A press on Send keeps focus (and a phone's keyboard) in the field.",
+ "Not reviewed: no design panel, and Astra and the lead have not looked yet.",
+ ],
+ tryIt: [
+ "Type a reply and press Enter in the support thread; in the build thread press Enter for a new line and ⌘↵ (Ctrl Enter) to send.",
+ "Paste ten lines: the field grows to eight and then scrolls.",
+ "Type @ and a letter: the picker opens over the field's line (the next step).",
+ ],
+ states: ["typing", "long", "sending", "typing-forced-colours", "sending-reduced-motion"],
+ widths: [1440, 390],
+ scales: [2],
+ height: 560,
+ touch: true,
+ demo: ({ state }) => ,
+ },
+ {
+ id: "picker",
+ name: "The mention picker",
+ intro: "Typing @ at the start of a word offers who can be named: people, teams and roles, two lines a row, under the trigger's line, with focus left in the field.",
+ decisions: [
+ "Combobox's popup and rows, reused: the popup's level, rim, shadow and radius 12, the 58px two-line rows (54 plate), group labels, the plate and its glide, and the lift from secondary to primary. `Listbox` is a list in the page that holds focus, so it is not the picker.",
+ "Focus stays in the field, which carries `aria-activedescendant` to the active row, `aria-controls` to the list while it is open, and `aria-autocomplete=\"list\"`. ↑ and ↓ move the plate and pass over a row that cannot be picked; Enter or Tab writes \"@Name \" (the browser's own undo takes it back); a press on a row picks it; Esc closes it until another @ is typed, and a dialog round the field stays open.",
+ "It sits under the trigger's line, 6px from it, and above the line when there is more room there (a composer at a page's foot), inside the window at 390.",
+ "A name may hold a space (\"@ana r\") while something matches; once nothing does it closes, so a sentence is never held. An @ inside a word (an address) opens nothing. A query that matches nothing opens nothing, and the app still hears it (`onQueryChange`) to look names up on its server.",
+ "Rows are cut, never wrapped, as every popup row is today. Whether described rows may wrap is another batch's question (B6).",
+ ],
+ tryIt: [
+ "Type @an in the support thread, ↓ twice, Enter.",
+ "Type @an and press Esc; type more: it stays closed until the next @.",
+ ],
+ states: ["picker", "picker-keys", "picker-foot", "picker-forced-colours", "picker-reduced-motion"],
+ widths: [1440, 390],
+ scales: [2],
+ height: 640,
+ touch: true,
+ demo: ({ state }) => ,
+ },
+ {
+ id: "mention",
+ name: "The mention, and the public plate",
+ intro: "A name in running text that calls on someone, and the plate an app's own list can draw its active row with.",
+ decisions: [
+ "A mention is the trigger and the name at 500 in primary ink: a glyph and a weight mark it, never a colour, and it wraps with its text. The trigger is a prop (\"#billing\").",
+ "A mention of the reader (`you`) sits on its level's plate as well, radius 4 and 2px each side of its own, drawn on every line it wraps to (given back by a margin, the plate ate half the space before it); in forced colours it is Mark with MarkText.",
+ "The plate is public: tokens plate-0 to plate-3 (the selected wash over each level as one opaque colour, in both themes and in Swift), and `--basalt-plate`, which follows the level a part sits in. Basalt's pressed toggle, chosen card and chosen peek now read it; a test proves they paint the same pixel the private recipe did.",
+ "No space step above 128: the 160 that was asked for is a label column, which `size-description-label` already names. Space steps are gaps; past 64 the scale has only the section gaps (96 and 128).",
+ ],
+ tryIt: ["Look at the three lists: each active row is `var(--basalt-plate)`, a step lighter at each level in dark and one grey in light. These are an app's own markup with inline styles, so in forced colours their fill goes: an app gives its own active row `Highlight` there, as Basalt's rows do."],
+ states: ["forced-colours"],
+ widths: [1440, 390],
+ scales: [2],
+ height: 520,
+ touch: true,
+ demo: () => <>>,
+ },
+ ],
+};
diff --git a/tools/review/rounds.tsx b/tools/review/rounds.tsx
index f69544ec..3c06f655 100644
--- a/tools/review/rounds.tsx
+++ b/tools/review/rounds.tsx
@@ -122,6 +122,7 @@ import { ROUND_53 } from "./round53";
import { ROUND_54 } from "./round54";
import { ROUND_55 } from "./round55";
import { ROUND_56 } from "./round56";
+import { ROUND_57 } from "./round57";
export interface Step {
id: string;
@@ -683,3 +684,4 @@ ROUNDS.push(ROUND_53);
ROUNDS.push(ROUND_54);
ROUNDS.push(ROUND_55);
ROUNDS.push(ROUND_56);
+ROUNDS.push(ROUND_57);