Polarize
GitHub Get in touch

Work · Repository

polarize-ui

Polarize's design system for scientific interfaces: tokens, zero-build CSS, evidence badges, shadcn/ui + visx React components. Live Storybook ↓

  • TypeScript
  • MIT licence
  • 1 post
  • 24 merged PRs
  • 1 star

View on GitHub → Changelog ↓ Homepage →

Posts about it

README

Live Storybook → · Releases

The design system behind Polarize’s research tools. It is built for interfaces that show scientific data honestly: every measured, modelled or speculative value carries a label, and the label can never be hidden.

A label may never be hidden. Its explanation must be.

It comes in two forms that share one set of tokens:

  • Zero-build CSS + custom elements — link a stylesheet, no npm, no bundler.
  • React — shadcn/ui components on the same theme, plus publication layouts, evidence badges and visx charts.

How we choose and judge a view for scientific data (the question first, five things every view states, forms for common data, simulation views, demo-data rules): METHOD.md.

What is in it

Science: the charts and analysis views (the point of the library)

   
Charts LineChart, BarChart, ScatterPlot (least-squares fit with a labelled 95% confidence or prediction band, fitted only over the measured range, with n, slope interval, r, R² and p printed; linearFit() gives the same numbers without the chart). A threshold is drawn on the axes it judges, a log axis says so in its label, thinning a trace for display is printed on the panel, and a shared or independent y-scale across panels is declared.
Signals Comodulogram + computeComodulogram(): phase–amplitude coupling (Tort MI) with a family-wise surrogate threshold, significant cells outlined, and unresolvable cells hatched instead of shown as zero. Heatmap (spectrograms, time–frequency maps) on a one-hue magnitude ramp with a colour bar, hover readout, and counted clipping. Waveform with marked regions.
Statistics NullDistribution and nullTest(): an observed statistic against its surrogate or permutation null, with the permutation p printed with its count, z beside it, and a warning when p is at its floor.
Evidence Tier (a MEASURED / PREDICTED / REFUTED badge that can’t be hidden), Value (measured and predicted never styled alike), Readout (figures with their source), and Note + DocsProvider (explanations in a drawer).

Source: src/science/. Every view is in the live Storybook under Science.

General UI

   
tokens.json The single source of truth: colour, type, spacing, the tier ladder, a colour-blind-validated categorical palette and a one-hue sequential ramp.
design.css + design.js The zero-build form, generated from the tokens: link it and set <body class="ui">. Custom elements: <ui-tier>, <ui-note>, <ui-docs>.
Navbar .ui-navbar (React Navbar): a 44px sticky bar that slides away while scrolling down and returns on scroll up (data-autohide). Below 768px the items fold into a menu and .ui-navbar__wide content is hidden.
Dashboard frames .ui-kpis, .ui-panels (stacked panels on one gutter), .ui-strip (category strip with legend), .ui-events (event cards), .ui-pcell (p-value cell), .ui-disclosure. The frame and type only; marks are drawn by the caller. React versions in components/dashboard.
publication.css Layouts for a research blog: sidebar shell, post list, article, prose, source cards, citations, claims, references, pager, footer. React versions render the same classes.
landing.css A lab’s front door: top bar, hero, section heads, process steps, project features, repository cards, a changelog feed, article and story cards, archival plates, the principle block and the site footer. React: src/components/landing.tsx.
trajectory3d.js A path through three dimensions with a marker at the current time, on a plain canvas: mountTrajectory3D(host, options). Drag to turn, pinch to zoom. No dependencies; colour from the tokens. See INTEGRATION.md § 5.
network3d.js An interactive 3-D node-link network on a plain canvas: mountNetwork3D(host, options). The caller supplies geometry and visual state; the component supplies projection, orbit, zoom and depth sorting.
controls.css + controls.js Hardware-style controls for audio and instrument interfaces: a knob and a detented fader (horizontal, vertical, bipolar ribbon) over a native range input, with fine adjust, detents, numeric entry and drawn hard limits; a scene timeline, an automation lane and a polar panner (SVG); channel strips, meters, a glide readout, linked-value, delta and sync-state chips, hold-to-confirm, an on/off toggle, a bottom sheet, a tab bar and a night view; a segmented control and popover (design.css), a gauge, an on-screen keyboard with greyed keys and their reasons, and a key lane. Every detent fires a ui-detent event for haptics. React: src/components/controls.tsx. See INTEGRATION.md § 6.
docs.css + docs.js A documentation site for a library or tool: top bar with ⌘K search, left nav and “on this page” column, an always-dark code window, the example panel (one real call with its code, input and output plots), an API reference entry, package and dataset cards, callouts and chips. docs.js wires it through data-ui-* attributes and exports renderPlot / highlight. React: src/components/docs.tsx. How to build one for an existing repository: DOCS-SITES.md.
specimens.css Field-guide style illustrations drawn in theme colours (SPECIMEN-ICONS.md).
src/components/ shadcn/ui components restyled to the type rules, typography (Display, Eyebrow, Standfirst), the publication layouts and Specimen.
fonts/, icons/ Self-hosted Instrument Serif, Inter, IBM Plex Mono, Literata (OFL) and a Phosphor icon sprite (MIT).

Using it

It is not published to npm. If there is enough interest we will happily turn it into a proper npm package. Until then, use it straight from this repository, always pinned to a release tag, or fork or clone it and make it your own.

In a React app (Vite + Tailwind v4)

npm install github:polarizetech/polarize-ui#v0.5.2     # or: yarn add github:polarizetech/polarize-ui#v0.5.2
/* your app's main stylesheet */
@import "tailwindcss";
@import "tw-animate-css";
@import "@polarizetech/polarize-ui/theme.css";
@source "../node_modules/@polarizetech/polarize-ui/src";
import { Heatmap, NullDistribution, LineChart, Tier, Button } from "@polarizetech/polarize-ui/react"
  • The package ships TypeScript source and your bundler compiles it; there is no build step here. It is type-checked with noUnusedLocals/noUnusedParameters on, so it compiles under strict app settings.
  • There is one theme, Polarize warm dark. No .dark class or data-theme stamp is needed, and Tailwind’s dark: variants always apply.
  • Importing from /react also loads the self-hosted fonts.

In a plain HTML page

Add it as a git submodule pinned to a tag, and link the files:

git submodule add https://github.com/polarizetech/polarize-ui.git design
git -C design checkout v0.5.2
<link rel="stylesheet" href="https://github.com/polarizetech/polarize-ui/blob/main/design/design.css">
<link rel="stylesheet" href="https://github.com/polarizetech/polarize-ui/blob/main/design/publication.css">   <!-- optional: blog layouts -->
<script type="module" src="https://raw.githubusercontent.com/polarizetech/polarize-ui/main/design/design.js"></script>
<body class="ui">

The full wiring guide, including how to serve the fonts, is INTEGRATION.md.

Staying up to date

  • Watch → Custom → Releases on this repository to be told when a new version is out. Each release has notes listing what changed.
  • To update, change the tag you pin: the #v… in your dependency, or git -C design checkout v… for a submodule.
  • Read the release notes before crossing a minor version while we are below 1.0 (see below).

Versioning

Releases follow Semantic Versioning. While the version is below 1.0.0, the rule is the one npm applies to 0.x versions:

bump below 1.0.0 from 1.0.0 on
patch (0.5.2 → 0.5.3) never breaking never breaking
minor (0.5.x → 0.6.0) may be breaking: read the release notes new features, never breaking
major — breaking

Covered by that promise (the public API):

  • everything exported from @polarizetech/polarize-ui/react, and its props;
  • the stylesheet entry points (design.css, publication.css, specimens.css, theme.css) and the ui-* class names and modifiers they define;
  • the CSS custom properties (--background, --space-4, --tier-measured, …) and the keys in tokens.json;
  • the custom elements in design.js and their attributes.

Not covered: exact colour values and spacing (a tweak is a patch release, not a breaking change), the stories, the build scripts, and anything under .storybook/ or .github/.

Removing or renaming anything in the public API always produces a breaking bump: scripts/api_surface.py lists that surface, and the release workflow compares it with the previous release. What was removed is listed at the top of the release notes. Changes it cannot see, such as a prop’s type or a component’s behaviour, have to be marked by whoever makes them, and the contributor guidance (AGENTS.md) requires it.

Every push to main is released automatically by .github/workflows/release.yml, which applies these rules: a commit whose subject has !: (for example refactor!: rename Label to Eyebrow) or a BREAKING CHANGE: line produces a breaking bump, and anything else produces a patch. Setting the version in package.json by hand always wins.

Working on it

npm install
npm run storybook        # http://localhost:6006
python3 dev_check.py     # tokens, contrast, the type rule, generated-file drift

Edit tokens.json, never design.css; regenerate with python3 build_css.py and python3 shadcn/build_shadcn.py. src/ uses relative imports only. An @/ import would resolve against the consuming app’s alias, and dev_check.py rejects it. The shadcn CLI writes @/ imports, so rewrite them after npx shadcn add.

The Storybook, its own interface included, is warm dark only. The MCP add-on (@storybook/addon-mcp) lets coding agents find the components and their stories.

Where it is used

These Polarize repos track new releases automatically. A daily workflow in each one moves its pin to the newest tag, runs that repo’s own checks, and commits and deploys only if they pass.

repo pin gate before it commits
polarizetech/polarize.tech design/ submodule check_design.py, validate_posts.py
joshuaanderton/joshuaanderton.ca package.json git dependency tsc -b && vite build, then the Pages deploy
polarizetech/audio-projects tools/design submodule tools/design/dev_check.py

Background and design decisions: CLAUDE.md. React specifics: shadcn/SHADCN.md.

Licence

Code: MIT (see LICENSE). Fonts: SIL Open Font License, texts in fonts/. Icons: Phosphor, MIT.

Changelog

2026-11-30 #27

feat: DriftDiffusion chart and Kramers–Moyal estimator

Builds scope/drift-diffusion.md (Tier: explore).

  • kramersMoyal() — per-bin drift K(1) / diffusion K(2) with SE and counts (Lin et al. 2025); histogramPotential(), equilibriumPotential() (Quintanilha Valente et al. 2025, eqs. 7–8).
  • DriftDiffusion — drift / diffusion / potential panels; MEASURED-style estimate with ±2 SE band, PREDICTED-style dashed truth, sparse bins hatched, Itô + τs inline, sampling caveat in a Note.
  • Synthetic bistable demo (Euler–Maruyama, seeded) with additive and multiplicative stories under Science / Stochastic dynamics.
  • tests/kramers-moyal.test.ts (5 tests) checks the estimator against the model’s own drift, diffusion and Ueq; wired into dev_check.py.

Additive exports only (patch). Standard published methods on synthetic data. Display constants, test tolerances and demo parameters are marked exploratory.

Checks: node tests 5/5, dev_check.py 481/481, tsc clean. Verified both stories in Storybook.

🤖 Generated with Claude Code

2026-11-30 #26

docs: scope for the drift-diffusion chart

Adds scope/drift-diffusion.md (Tier: explore), the plan for a DriftDiffusion chart in Science / Stochastic dynamics. No code.

  • F1 Kramers–Moyal drift/diffusion estimator (Lin et al. 2025)
  • F2 two-panel chart, Itô labelled (Brückner & Broedersz 2024; Dakos et al. 2012)
  • F3 equilibrium potential (Quintanilha Valente et al. 2025)
  • F4 synthetic bistable demo, Euler–Maruyama (Quintanilha Valente et al. 2025; Pillonetto et al. 2026)
  • F5 sampling-interval caveat (Lin et al. 2025)

Standard published methods on synthetic data only. Bin-count default and demo parameter values are marked exploratory.

🤖 Generated with Claude Code

2026-11-30 #25

feat: xs knob size; science stories use knobs instead of faders

  • New .ui-knob--xs and .ui-playknob--xs (40px); Knob and PlayKnob accept size="xs". New “Knob sizes” story (xs/sm/md/lg).
  • Science stories (Mechanisms ×3, Space ×2, Trajectory playback) swap Fader for Knob size="xs", props unchanged.
  • Fader component and its Controls stories untouched (public API).

Additive only (patch). Checks: dev_check.py 480/480, tsc clean. Verified in Storybook: Knob sizes and Mechanisms render the xs knobs.

🤖 Generated with Claude Code

2026-11-30 #24

fix: tissue-field uses knobs, not range sliders

<tissue-field>’s Time scrubber, Opacity and Hide below were bare <input type="range"> sliders, against the no-range-sliders rule.

  • Each input is wrapped in .ui-knob and drawn with initControl from controls.js; the native input still drives the existing listeners.
  • The Time knob follows playback (handle.set(k) in _readout).
  • Knob spans get display: inline-block so the knob’s size applies.
  • Removed the now-unused .tf-scrub rule and the range accent-color rule (internal classes, not public API).

Checks: dev_check.py 480/480, tsc clean. Verified in Storybook (Science / Tissue field): three knobs render, Time knob turns during playback.

🤖 Generated with Claude Code

2026-11-30 #22

feat: volume component (WebGL), React wrapper, synthetic demo story

Opened for review from an existing branch (last commit 2026-10-02); not merged.

  • New <tissue-field> custom element (WebGL volume, tissue-field/1 format) and ./tissue-field.js export
  • New TissueField React export (src/science/space/TissueField.tsx)
  • New optional peer dependency three
  • Synthetic demo story; no data in the repo

Additive only per the commit message (new export, optional peer dep), so a non-breaking release.

Before merging

  • Conflicts with main in dev_check.py and package.json (branch is ~2 months behind).
  • Public-repo check: confirm the component, the tissue-field/1 format and the demo model (stories/models/tissue-demo/) are standard/synthetic, not unpublished group work.

🤖 Generated with Claude Code

2026-11-30 #21

fix!: keep SpatialSpace panes fixed at the centre of view

Panes in SpatialSpace drifted with the pointer (the head-tracking stand-in rotated the world they lived in) and slid in on a 3-D arc when switching.

  • Panes now render in a screen-fixed layer: centred, no rotation, no depth offset; switching is an opacity fade (instant with reduced motion).
  • Dock and Spaces menu unchanged (still trail the head; Follow/Recenter work).
  • New optional prop arrangement?: "fixed" | "arc", default "fixed". "arc" keeps the old behaviour; new story “Space: arc (legacy)”.

Breaking: default layout changed. Migrate with arrangement="arc" to keep the old arc.

Checks: npm run typecheck clean, dev_check.py 475/475. Verified in Storybook: pane stays centred while hovering corners; Next swaps in place.

🤖 Generated with Claude Code

2026-11-26 #20

feat: MapSearch component for picking latitude and longitude

Adds MapSearch: a place search box, a map and latitude/longitude fields that share one value, { lat, lon } in WGS 84 decimal degrees. No new dependency and no map library.

What it does

  • Search box. Typed coordinates are parsed locally: signed decimals, latitude first (48.4284, -123.3656), or degrees-minutes-seconds with hemispheres (48°25′42″N 123°21′56″W). Place names go to a pluggable search function. nominatimSearch() is provided for OpenStreetMap and runs on Enter only, because Nominatim’s usage policy forbids autocomplete.
  • Map. A Web Mercator (EPSG:3857) z/x/y tile grid drawn with plain <img> tiles. Tiles are opt-in via tileUrl + attribution; without them it draws an offline graticule, so nothing touches the network by default. Light tiles are inverted and dimmed by default (tileFilter="dark", values chosen by eye) so a dark page gets no light backdrop.
  • Input. Drag pans, wheel and +/− zoom, a click drops the pin. With the map focused, arrows pan and Enter drops the pin at the centre.
  • Fields. Latitude/longitude inputs, clear, use-my-location (browser geolocation, accuracy shown), and hidden form inputs via latName / lonName.

Public API

New exports: MapSearch, MapSearchProps, LatLon, GeocodeResult, GeocodeFn, isLatLon, parseCoordinates, formatCoordinates, nominatimSearch. Additions only, so this is a patch release; nothing is renamed or removed.

Stories: General UI/Components/Map search (Offline, OpenStreetMap tiles and place search, States). Only the OpenStreetMap story makes network requests, and it shows the © OpenStreetMap contributors credit.

Checks

  • python3 dev_check.py: 475/475 passed
  • npx tsc -p .: clean
  • python3 scripts/api_surface.py --removed v0.8.1: nothing removed

Not yet tried in a browser: drag, wheel zoom and live search have not been exercised in Storybook.

🤖 Generated with Claude Code

2026-11-25 #19

feat: spatial (VR) components and storybook section

Adds a Spatial (VR) section to the storybook, plus the components behind it (src/spatial/Spatial.tsx, exported from the package).

  • SpatialSpace: panes on an arc around you. Swipe (drag), the dock, or ←/→ bring the next pane in from the side; the dock and Spaces menu trail the head (the pointer stands in for head tracking).
  • SpatialPane, Lift: pane chrome with its tier badge; components lift toward the eye on gaze and press in on pinch.
  • Orbit, OrbitGraph, OrbitBars: graphs as objects. Any flat chart becomes a slab with a labelled reverse side; categories become 3-D boxes. Flip / Turn / Roll / Pull out / Reset, or drag to orbit, even for 1-D and 2-D data.

Stories: the space, a line graph, bars, a 1-D value as a rod, components in depth. All story data is synthetic.

Standard techniques only (CSS 3-D transforms, a pane carousel, rotatable charts); no findings or recordings. Additive (patch): new exports only. Depth, lag and spacing values are TASTE.

Checks: dev_check.py 475/475, build_css.py --check, build_shadcn.py --check, tsc, storybook build. Tried in a desktop browser (swipe, dock, Flip); not yet on a headset.

Companion: polarize-holo’s spatial extension (the same UI in three.js for the Cardboard viewer).

🤖 Generated with Claude Code

2026-11-25 #18

fix: knobs and faders follow a drag outside the control

Dragging a knob (or fader) and moving the mouse outside it broke the drag, and releasing outside could leave the control following the mouse.

Now initControl tracks a press on the whole page: pointermove/pointerup/pointercancel on window, added on press and removed on release (and in destroy), replacing the element-level listeners. While the button is held the value follows the pointer anywhere; releasing anywhere sets it and ends the drag. A mouse move with no button held ends the drag at its value; other pointers are ignored mid-drag.

Not breaking: no export, class, attribute or option changed. Checks: dev_check.py 475/475, tsc -p . clean.

Owner, 2026-11-25: “if you click on the knob and you hold and drag outside of the knob, you can still adjust … when you let go, it just sets to wherever it was pointing”.

🤖 Generated with Claude Code

2026-11-25 #17

feat: an on/off toggle in the controls layer

Adds .ui-toggle: a real <button> with its state in aria-pressed, drawn as a track and thumb from existing tokens (on in --ctl-signal), keyboard and screen-reader support from the button itself.

  • controls.js: initToggle(btn, { onChange }) flips it on a click and fires a bubbling change; init() wires [data-ui-toggle].
  • controls.d.ts: ToggleHandle, initToggle; init’s return type includes it.
  • React: Toggle (src/components/controls.tsx). Story: General UI / Controls / Toggle.
  • Docs: INTEGRATION.md § 6 row, README controls row.

Not breaking: additive only. Checks: dev_check.py 475/475, tsc -p . clean, api_surface.py --removed v0.8.3 nothing removed.

First user: polarize-thesis apps/noise-playground (Spikes and Mixer on/off). Owner, 2026-11-25: “add a nice toggle feature, component to the polarize-ui repo”.

🤖 Generated with Claude Code

2026-11-25 #16

feat: speaker-high and speaker-slash icons

Adds Phosphor duotone speaker-high and speaker-slash (from @phosphor-icons/core 2.1.1, MIT, like the rest of the sprite) to icons/polarize-icons.svg, and lists them in tokens.json icons.used (17 icons). For polarize-holo: an audio enable / mute toggle on .ui-playknob.

dev_check.py: 475/475 passed.

🤖 Generated with Claude Code

2026-11-25 #15

Play knob, mixer faders instead of sliders, geometric story fix

What changed

  • PlayKnob (new, exported): a round play/pause toggle the same size as Knob (sm/md/lg), with a thin outer ring, so they sit side by side. Story added under Controls.
  • No more sliders in the stories: Card with controls uses a Knob + PlayKnob; Mechanisms, Space and Trajectory playback use horizontal mixer Faders. ui/Slider is still exported, marked @deprecated.
  • Geometric stories fixed: Geometric overlays and Trajectory playback crashed (appendChild of null) because the host element was null when the 3-D view mounted; they now wait for it via callback refs.
  • Keyboard: a thin border separates the black keys.

Why

Geometric components were not rendering in Storybook; the play control and slider changes were requested for the controls set.

For reviewers

  • Additive only (new export and CSS class); nothing removed or renamed, so a patch release.
  • Demo values are synthetic (Rate/Depth knob ranges, readout formats in Space were chosen by the executor; presentation only).
  • Checked: tsc, dev_check.py (475/475), Storybook build, and the stories in the browser.

🤖 Generated with Claude Code

2026-11-25 #11

fix(deps): update @storybook/addon-mcp to 10.6.7 (CVE-2026-114126)

@storybook/addon-mcp is pinned at 10.6.0 at node_modules/@storybook/addon-mcp by the committed package-lock.json (the root manifest declares ^10.6.0 under devDependencies), inside the affected range of CVE-2026-114126 / GHSA-px85-f4q5-jh77.

The advisory names 10.6.2 as the first patched version; its fix points span several lines, so this build takes line 10’s fix deliberately. line 10’s fix 10.6.2 is the target: the lock resolves 10.6.0 below it; line 11’s fix 11.0.0-alpha.6 applies to no resolved copy (the lock resolves none in that line), so taking it would force a cross-line jump without clearing anything. The fix commit is 5f00d7d0a78e in storybookjs/storybook (rung tag-ref, confidence release-tag). The root declared range ^10.6.0 admits 10.6.2 (computed), so this is a lockfile-only update: package.json is not touched, and package-lock.json moves @storybook/addon-mcp from 10.6.0 to 10.6.7.

What changes

  • @storybook/addon-mcp: 10.6.0 -> 10.6.7 at every lockfile path (1).
  • No manifest is touched, and no source file is changed.

Verification

  • npm ci --dry-run on the patched lockfile with the unchanged manifest: pass (see the verification record).
  • Every lockfile path resolving @storybook/addon-mcp is at or above the advisory’s first patched version 10.6.2 (node_modules/@storybook/addon-mcp at 10.6.7 is the built worst copy).
  • package.json is byte-identical to the base commit (sha256 ebf451b940254bd1…).
  • Applied to a fresh clone of polarizetech/polarize-ui at 935f751d4751fbc5a9bdf32c5c22563538819863, the change touches only package-lock.json.
  • Dependency churn: 17 lines outside @storybook/addon-mcp across 2 lockfile entries: the dependency entries npm ci requires to move with it. No source file is changed.
  • Lockfile shape: the entries that resolve the package and the 2 dependency entries npm ci requires to move with it are rewritten, and the npm ci –dry-run gate passed on that file; every other byte is the base commit’s. npm: host npm 10.9.9 writes lockfileVersion 3, the repo’s own.

Scope

@storybook/addon-mcp is declared under devDependencies, and the affected range and the pinned version come from the security advisory. This is a dependency update, not a code change.

2026-11-24 #14

feat!: warm dark is the only theme; add DatePicker

Summary

1. feat!: Polarize warm dark is the only theme (BREAKING). Operator request: “use the warm dark theme only - no other themes.”

  • tokens.json color keeps only polarize. light, dark, instrument, instrument-dark, fieldguide and fieldguide-dark are removed.
  • design.css: bare :root is warm dark. There is no light palette and no prefers-color-scheme switch. data-theme="polarize" still matches, and any other stamp falls through to warm dark.
  • shadcn bridge: one block for :root, .dark, :root[data-theme="polarize"]. In src/theme.css, dark: variants now always apply.
  • Docs-site theme toggle: hidden and inert. isDark() always returns true and DocsThemeToggle renders nothing. Both are kept with @deprecated so existing imports still compile.
  • Storybook: the theme toolbar is removed and the manager UI is warm dark.
  • The design-system artifact copy is regenerated. dev_check.py now fails if a second theme, color-scheme: light or prefers-color-scheme comes back.
  • The light steps inside epistemic.families, series and diverging are kept. They are validated palette data, not a theme.

2. feat: DatePicker and Calendar (src/components/ui/date-picker.tsx)

  • It uses the Radix Popover that radix-ui already ships, so there is no new dependency.
  • The value is an ISO date string YYYY-MM-DD, not a JS Date, so a time zone can’t shift the day.
  • Features: min/max, an isDisabled predicate, Monday or Sunday week start, ISO week numbers, a month-jump view, Today and clear buttons, and a hidden form input.
  • Full keyboard navigation.
  • Stories are under General UI/Components/Date picker.
  • Nothing is needed to get warm dark.
  • To keep a removed theme, pin v0.7.0.
  • For the old fieldguide landing card look, set --landing-radius: var(--radius-base); --landing-fill: var(--card);.
  • Read colours from tokens.color.polarize.
  • ⚠ polarize.tech’s homepage used the fieldguide theme, so it will change look once it picks this up.

Testing

  • python3 dev_check.py: 475/475 pass. The count is lower than before because six themes’ contrast checks went away.
  • npx tsc -p .: clean.
  • Storybook dev server plus Playwright: the date picker is verified by mouse, keyboard (arrow, Enter), clear, min/max and blocked days. The Landing story with a light OS setting renders warm dark.
  • storybook build could not run in the sandbox because the dataset host is unreachable. That is the environment, not this change.

Generated by Claude Code

2026-11-23 #13

feat!: no light ground in a dark theme, and no range sliders

What

  • Element-scoped themes with their own ground. Every theme now also matches [data-theme="X"] on any element, and [data-theme]:not(:root) paints var(--background) / var(--foreground). A board, embed or widget that can’t own <html> puts data-theme and class="ui" on its outermost element and gets no light backdrop under a dark theme.
  • No range sliders. design.js adds knobs(), run on load: any bare <input type="range"> (not inside .ui-knob / .ui-fader) is wrapped in .ui-knob[data-ui-control], and controls.css / controls.js are loaded from the design folder on demand.
  • Claude Design System copy: polarize (warm dark) is listed first, so the canvas defaults to it. The README gains both rules.
  • CLAUDE.md, INTEGRATION.md § 6: both rules. dev_check.py: checks for all of the above.

Why

The Claude Design canvas re-stamps <html data-theme> as plain light/dark from the OS. That dropped a board’s polarize stamp, so cards and plots rendered on the light palette (white) inside a dark design.

Breaking

Marked feat!:. (1) Any non-root element with data-theme now paints a ground. (2) Bare range inputs on pages loading design.js become knobs. Migration is in the commit body.

Checked

  • python3 dev_check.py: 610/610.
  • node --check design.js.
  • Browser (noise-matrix flip-view served from this branch): with <html data-theme="light">, cards were #ffffff; with data-theme="polarize" on the wrapper they were #181310 on #100d0b. A bare range inserted at runtime became a knob. No light surface anywhere on the page, Plotly backgrounds included.

🤖 Generated with Claude Code

2026-11-19 #12

fix: emit --surface and --surface-2 for every theme

tokens.json defines surface and surface-2 for every theme, and .ui-readout cells, .ui-kpi, navbar links, legend keys and table cells use var(–surface)/var(–surface-2), but build_css.py never emitted them, so those components fell back to an unset colour (white readout cells on data-theme=polarize). Adds both variables to every theme block and a dev_check that fails on var(–x) used without a fallback and never defined. Not breaking: adds variables, renames or removes nothing.

🤖 Generated with Claude Code

2026-11-18 #10

feat: segmented control, gauge, keyboard, key lane and popover for instrument pages

Five components for on-screen instrument pages. The first consumer is particle-canvas v5 in polarize-thesis, which will pin the next tag. They follow the designer’s v5 design.

Component Where React
.ui-segmented: joined pressed-state buttons design.css (via build_css.py) SegmentedButtons
.ui-popover: panel on a native [popover] design.css (via build_css.py) Popover
.ui-gauge: magnitude bar with number, unit, scale; data-state="empty"\|"off" controls.css Gauge
.ui-keyboard + mountKeyboard: piano keys; greyed keys are hatched and name their reason controls.css / controls.js Keyboard
.ui-keylane + mountKeyLane: per-note bars, per-range chips, spans under the keys controls.css / controls.js KeyLane

Naming decisions (owner)

  • .ui-gauge and .ui-keylane are new names because .ui-meter (L/R level meter) and .ui-lane (automation lane) already exist. Reusing those names would have been a breaking change.
  • .ui-seg / Segmented in the filter panel already existed. The new React component is SegmentedButtons, and the filter one is unchanged.
  • The knob already existed (.ui-knob) and is unchanged.

Values

  • Only existing tokens are used, and tokens.json is unchanged. Sizes (62% black-key height, 6px hatch, 58rem minimum width, 6.5rem key height) come from the designer’s v5 design.
  • The keyboard and key lane have no default note range: low/high are required. A black key spans from the centre of the white key below it to the centre of the one above, so it has no width ratio of its own.
  • A key-lane span is drawn in the human ink (--ctl-human), not a tier colour.

Not breaking: additions only. api_surface.py --removed v0.6.8 reports nothing removed.

Checks

  • python3 build_css.py --check: up to date
  • python3 dev_check.py: 599/599
  • npx tsc -p .: clean
  • Not yet viewed in Storybook

Draft, for the owner to review. Please don’t merge or tag without the owner’s go-ahead.

🤖 Generated with Claude Code

2026-11-10 #9

docs: sync the Claude Design System copy to v0.6.7

Brings claude-design-system/ in line with the published Polarize UI Design System artifact, which was just updated from v0.6.2 to v0.6.7.

  • project/: the stylesheet now carries the panel stack, dashboard frames and navbar; tokens.json says v0.6.7 (no token values changed between the two tags); design-system.json records the update. Every file now matches the published system byte for byte.
  • build_tokens.py / build_docs.py: find the repo from their own location (no absolute path), take the version from package.json, keep createdOnFiles, and write the Cover and Navbar cards as published, so a rebuild no longer reverts them.
  • Not breaking: the folder is not in package.json files; no export, class, token or entry point changes. python3 dev_check.py: 587/587 passed.

Merging releases a patch, as every push to main does.

🤖 Generated with Claude Code

2026-10-30 #8

feat: dashboard frames

Adds generic dashboard frames: .ui-kpis, .ui-panels, .ui-strip, .ui-events, .ui-pcell, .ui-disclosure, with React components and a Storybook story.

  • Additive only; no existing class, token or export changes.
  • Standard layout pieces only: nothing domain-specific, no unpublished method or data. The story uses placeholder numbers.
  • dev_check.py 587/587, tsc clean, api_surface.py runs.
  • Needed by the noise-departures redesign in teeter-receiver, which will pin the release that includes this.

Merging to main releases automatically.

🤖 Generated with Claude Code

2026-10-27 #6

feat: controls layer (knob, faders, timeline, lane, panner) and a React Polarize theme

Hardware-style controls for audio and instrument interfaces, in both forms (zero-build and React), plus a Polarize theme for the React side.

What’s added

  • controls.css: a knob; a detented fader (horizontal, vertical, bipolar ribbon) with end-stops that are always drawn, a person’s own mark, and printed limits; linked-value, delta and sync-state chips; a glide readout; an L/R meter; channel strips; a hazard surface with hold-to-confirm; a bottom sheet on <dialog>; a bottom tab bar; a night view.
  • controls.js (+ controls.d.ts): enhances native range inputs with fine adjust, detents, PageUp/PageDown, numeric entry, a log scale and data-at-limit. It also mounts three SVG views: a scene timeline (blocks for holds, wedges for transitions, curves, playhead, endings), an automation lane and a polar panner. Every crossed detent fires a bubbling ui-detent event, the hook for haptics in a native shell. There is no requestAnimationFrame or setInterval; the caller moves time.
  • src/components/controls.tsx: React wrappers that call controls.js rather than copying it.
  • shadcn bridge: a :root[data-theme="polarize"] block (clay on --primary, 4.83:1 on the ground) and Polarize’s audio inks in system.css. Storybook gains a “polarize” theme and a General UI / Controls page.
  • dev_check.py: check_controls covers the layer rules, inks with fallbacks, no tier colour, the exports, no rAF, ui-detent, the React wrapper reusing the module, and the React Polarize block with its contrast.

Design decisions worth a look

  • Under Polarize the controls use clay, ochre and lichen, one job each. Elsewhere they fall back to the brand colour and plain ink (see the Fallback · instrument theme story).
  • No tier colour is used for limits or conflicts. A hard limit is a foreground end-stop. The epistemic palette stays reserved for evidence.
  • Faders and knobs stay native range inputs underneath, so the keyboard and screen readers work without the script.
  • Not built yet: finger-drawing on a lane, a pulley that edits two lanes together, and drag-to-dismiss on the sheet. Each is listed in CLAUDE.md.

Checks

  • dev_check.py passes 579/579; build_css.py --check, build_shadcn.py --check and tsc are clean; storybook build succeeds.
  • The same checks pass on the branch merged with current main (v0.6.2), which merges without conflicts.
  • api_surface.py --removed v0.6.2 is empty, so the change is additive and releases as a patch.
  • Exercised in a browser: drag with detent snapping, fine adjust (a 0.28× gain at 150 px off-axis, as computed), numeric entry clamping to the ceiling, PageUp/PageDown, timeline handle and selection, lane point drag, panner keyboard and 90° snap, the hold-to-confirm button, and the bottom sheet. The plain-HTML path (design.css + controls.css + controls.js) was checked on its own, with no console errors.

All story data is synthetic.

🤖 Generated with Claude Code

2026-10-18 #5

Add reusable 3D node-link network view

Summary

  • add a dependency-free mountNetwork3D renderer with orbit, zoom, depth sorting, token colours, and accessible keyboard controls
  • ship public TypeScript declarations and integration documentation
  • add a synthetic Storybook example and API/design checks

Verification

  • python3 dev_check.py: 507/507 passed
  • TypeScript: passed
  • API surface removal check against v0.6.0: passed

This is an additive public API. It contains only a standard node-link visualization and synthetic story data; Neural Field Lab’s model remains in world-seeding.

2026-10-15 #4

feat!: remove the cell field; the homepage story is the shipped page

Removes the animated cell field (<ui-cellfield>, CellField, ./cellfield.js, .ui-cellfield*) at the operator’s request, and rebuilds the Landing homepage story as the page polarize.tech now ships (fieldguide). Adds an optional media prop to ProjectFeature.

Breaking. api_surface.py --removed v0.5.19 lists exactly the cell field’s surface. No consumer uses it: polarize.tech dropped it in v0.5.19; joshuaanderton.ca and the monorepo never used it.

Checks: dev_check 491/491, build_css/build_shadcn –check, tsc; Storybook homepage story renders with no errors.

🤖 Generated with Claude Code

2026-10-15 #3

feat: fieldguide theme — white, magenta, Geist

Opt-in fieldguide theme (white page, magenta accent, Geist sans) and additive landing components for polarize.tech’s restyle: .ui-action, .ui-stats, .ui-steps--rows, .ui-topics, .ui-specimen-tile, .ui-plate--ink, and the crab/neuron/magnet specimens.

Non-breaking: existing themes render unchanged (cards read --landing-radius/--landing-fill with the old values as fallbacks); api_surface.py --removed v0.5.18 is empty. dev_check 497/497, build_css/build_shadcn –check, tsc pass.

🤖 Generated with Claude Code

2026-10-07 #2

feat: trajectory3d.js, a 3-D path with a time marker (zero-build)

What

mountTrajectory3D(host, options) draws a path through three dimensions on a plain 2-D canvas, with a marker at the current time and the last trail seconds drawn heavier. It returns {update, setTime, show, resetView, destroy}. Zero-build, no dependencies, same shape as cellfield.js (a mount* function plus a .d.ts).

  • trajectory3d.js + trajectory3d.d.ts at the repo root
  • package.json: shipped in files, new entry point ./trajectory3d.js
  • dev_check.py: check_trajectory3d(); scripts/api_surface.py tracks the export and the handle methods, so a later rename forces a breaking bump
  • Story: Science / 3-D views / Path with a time marker (zero-build, synthetic)
  • Docs: INTEGRATION.md § 5 (and the allow-list line in § 1), a row in README.md

Versioning

Additive, so a patch. A new entry point and nothing existing changes. The React Trajectory3D (the hodogram on Scene3D) is a separate view and is untouched; no React wrapper was added for this module, to avoid a name collision.

Public-repo rule

  • Method: a 3-D state-space path / phase portrait with a playhead. Standard.
  • Data: the story integrates the Lorenz system (Lorenz 1963) in the story itself. Synthetic, and labelled so.
  • Findings: none shown or stated.

Differences from the private copy it was ported from

  • Axes are right-handed and positive pitch looks down, as in src/science/space (the original was left-handed, seen from below). Paths appear mirrored relative to the original.
  • On a drag the near side follows the pointer (direction reversed).
  • A two-finger touch pinch zooms. Before, only Ctrl/Cmd-scroll did.
  • Arrow keys turn and +/- zoom when the canvas has focus.
  • Redraws on a theme change; falls back to --chart-1 / --chart-4 on the React theme.

Checked

  • python3 dev_check.py: 429/429
  • npx tsc -p .: clean
  • python3 scripts/api_surface.py --removed v0.5.16: nothing removed
  • In a browser: a zero-build page on design.css and the Storybook story, light and dark, and at 375 px (no sideways scroll). Turn, pinch, Ctrl-scroll zoom, keyboard, reset, destroy and live theme switch work; a plain scroll is left to the page. Pinch was tested with synthetic pointer events, not on a real phone.

Note for consumers

The canvas takes every touch that starts on it (touch-action: none), so a page needs scroll room beside or below it on a phone. Documented in INTEGRATION.md.

🤖 Generated with Claude Code