Skip to content

dimension composites: rebuild on TUI primitives - #84

Open
juliacanzani wants to merge 3 commits into
mainfrom
feat/dimension-composites-tui
Open

dimension composites: rebuild on TUI primitives#84
juliacanzani wants to merge 3 commits into
mainfrom
feat/dimension-composites-tui

Conversation

@juliacanzani

Copy link
Copy Markdown
Contributor

Stacked on #78 (the ^0.2.0 bump). Retargets to main once #78 merges.

Rebuilds the dimension family as composites of TUI primitives — TextInput (type=number) + Select + IconButton — in the Field idiom. Reclassified out of the "no equivalent" bucket: these are just compositions.

Contracts preserved (verified live)

Field Value
simple-dimension { value, unit }
dimensions { top, left, right, bottom, unit, isLinked }
border { dimensions, color }
  • simple-dimension / dimensions are now fully TUI: native number spinners replace the react-aria stepper field; the link/unlink toggle → IconButton (system/link/system/unlink); linked mode syncs all four sides.
  • The Field label is a group label (multiple controls) → sits on a role="group" wrapper (Field.Control injects aria-labelledby); each input carries its own aria-label.

⚠️ Border's color half stays react-aria

border = dimensions + color, and TUI has no ColorPicker yet (the ColorArea primitive gap). Border gets its Dimensions half migrated for free + a TUI Field wrapper; the Color field is untouched and finishes migrating when we build the TUI ColorPicker.

tsc unchanged (the initJSON(value, {defaults}) loose-typing warnings are pre-existing). Rebuilt bundle.

🤖 Generated with Claude Code

juliacanzani and others added 3 commits July 30, 2026 20:35
Picks up MultiCombobox (searchable multi-select — needed for the combo-box
field migration's multiple+async case), Chip onRemove, and the Combobox
aria-describedby/invalid/required forwarding fix.

Compat: TUI 0.2.0's Button dropped the `iconSize` prop (icons size
intrinsically now) — removed it from the base Button wrapper + its story.
tsc error count unchanged from 0.1.x (422 pre-existing); rebuilt bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rebuild the dimension-family fields as composites of TUI primitives (TextInput
type=number + Select + IconButton), in the Field idiom. The Field label becomes
a group label on a role=group wrapper; each control gets its own aria-label.
Value contracts preserved exactly — verified live:
  - simple-dimension  { value, unit }
  - dimensions        { top, left, right, bottom, unit, isLinked }
  - border            { dimensions, color }

simple-dimension / dimensions are fully TUI now (native number spinners replace
the react-aria stepper field; link toggle -> IconButton system/link|unlink,
linked mode syncs all sides). Border gets its dimensions half for free (imports
the migrated Dimensions) + a TUI Field wrapper.

Note: border's **color** half is still the react-aria Color field — TUI has no
ColorPicker yet (the ColorArea primitive gap). Border finishes migrating when
Color does.

tsc unchanged (422; the initJSON(value, {defaults}) loose-typing warnings are
pre-existing, carried from the original). Rebuilt bundle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a `min` prop to Dimensions/SimpleDimension, applied to the number inputs
(native min + block the minus key so a negative can't be typed). Border passes
min={0} — border widths are non-negative. General dimensions/simple-dimension
stay unconstrained by default (negative margins are legit).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicolas-jaussaud
nicolas-jaussaud changed the base branch from feat/tui-0.2.0-bump to main August 3, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant