Skip to content

button-group: migrate to TUI SegmentedControl - #82

Merged
nicolas-jaussaud merged 8 commits into
mainfrom
feat/button-group-tui
Aug 14, 2026
Merged

button-group: migrate to TUI SegmentedControl#82
nicolas-jaussaud merged 8 commits into
mainfrom
feat/button-group-tui

Conversation

@juliacanzani

Copy link
Copy Markdown
Contributor

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

button-group is a single-select radiogroup (react-aria useRadioGroup) rendered as segments — now TUI's SegmentedControl, in the Field idiom. A 1:1 family match (SegmentedControl is a radiogroup).

Contract preserved (verified live): the selected key, carried by a hidden input for form submission (react-aria's native radios did that before). Dashicon options → SegmentedControl.Itemicon + aria-label; disabledKeys honoured. Removed ButtonOption.tsx.

tsc 422 → 420; rebuilt bundle.

🤖 Generated with Claude Code

juliacanzaniand others added 2 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>
button-group is a single-select radiogroup (react-aria useRadioGroup) rendered
as segments — now TUI's SegmentedControl, in the Field idiom. Value contract
preserved (verified live): the selected key, carried by a hidden input for form
submission (react-aria's native radios did this before). Dashicon options map to
SegmentedControl.Item `icon` + `aria-label`; disabledKeys honoured. Removed
ButtonOption.tsx.
tsc 422 -> 420; rebuilt bundle.
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 mainAugust 3, 2026 16:23
@nicolas-jaussaud
nicolas-jaussaud merged commit dbaae57 into mainAug 14, 2026
2 checks passed
juliacanzani added a commit that referenced this pull request Aug 15, 2026
Matches the follow-up pattern from the other TUI migrations (#81, #82):
isDisabled || readOnly both disable the control, and the built assets
ship with the PR.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nicolas-jaussaud added a commit that referenced this pull request Aug 17, 2026
* color: migrate to TUI ColorField (with opt-in gradient mode)
Color field -> TUI ColorField (swatch trigger + popover picker), in the
Field idiom. Requires @tangible/ui ^0.2.5.
Value contract preserved: CSS color strings in/out, legacy { value }
objects unwrapped, empty/invalid values default to #FFFFFF (the old
react-aria impl emitted #FFFFFFFF - TUI hex omits the alpha byte when
fully opaque). Legacy config mapped: hasAlpha -> alpha, react-stately
format names (hexa/rgba/hsla/...) -> TUI formats. var(--x) values pass
through verbatim.
New opt-in: gradient: true adds Solid|Gradient tabs to the popover and
lets the value be a CSS gradient string (the Figma Color Selector).
Explicit aria-label like the date field - Field.Control's labelledby
injection lands on FieldWrapper, which doesn't forward it. Dynamic
values preserved via FieldWrapper (hidden input lives with the picker).
Old react-aria components move to deprecated/fields/color, registered
as deprecated-color-picker; the (still-legacy) gradient field keeps
using the deprecated ColorPicker until its own migration. Existing jest
tests migrated to deprecated-controls; new tests cover value contract,
popover edit commit, var() passthrough, and gradient tabs. Verified
live (gradient story: tabs render, edits flow to the hidden input).
jest 518 pass, tsc 424 -> 424.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Color: Keep support for isDisabled for legacy reason; rebuild bundle
Matches the follow-up pattern from the other TUI migrations (#81, #82):
isDisabled || readOnly both disable the control, and the built assets
ship with the PR.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Deprecated color: Make sure deprecated style is being applied correctly
* Color and gradient: Make sure to use consistent border radius in wp context
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Nicolas Jaussaud <hi@nicolasjaussaud.me>
Sign up for freeto 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.

2 participants

@juliacanzani@nicolas-jaussaud