Problem
PR #666 introduced CollapseButton, currently consumed only by AccordionItemHeader. The existing Collapse component has its own copy of the same chevron-toggle UI.
Solution
Collapse wraps the entire header (title + chevron) in one <button>, so clicking the title toggles. CollapseButton is itself a <button> — nesting them is invalid HTML. So a straight swap isn't possible without making one of these choices:
- A. Move the title out of the button — single code path, cleanest. Breaking: clicking the title no longer toggles.
- B. Hybrid — keep current behaviour when
title is set; use CollapseButton only when title is absent. No breakage, two code paths.
- C. Angular-parity — drop
title, controlsId, toggleLabel, BreakpointSupport, Print integration, titleRowProps, iconOnly, underline. Match Angular's minimal tedi-collapse API. Smallest component, aggressively breaking.
Recommended: A.
Stories simplification
While we're in there, the React Collapse stories should also be simplified to match the Angular structure — Angular's tedi-collapse stories are leaner (no per-state matrix duplication, fewer custom templates). The story file should mirror the Angular set: Default, plus a handful of focused variant stories.
DoD
Problem
PR #666 introduced
CollapseButton, currently consumed only byAccordionItemHeader. The existingCollapsecomponent has its own copy of the same chevron-toggle UI.Solution
Collapsewraps the entire header (title + chevron) in one<button>, so clicking the title toggles.CollapseButtonis itself a<button>— nesting them is invalid HTML. So a straight swap isn't possible without making one of these choices:titleis set; useCollapseButtononly when title is absent. No breakage, two code paths.title,controlsId,toggleLabel,BreakpointSupport, Print integration,titleRowProps,iconOnly,underline. Match Angular's minimaltedi-collapseAPI. Smallest component, aggressively breaking.Recommended: A.
Stories simplification
While we're in there, the React
Collapsestories should also be simplified to match the Angular structure — Angular'stedi-collapsestories are leaner (no per-state matrix duplication, fewer custom templates). The story file should mirror the Angular set:Default, plus a handful of focused variant stories.DoD
semantic-release)