Disclosure (open/close) aspect for list items. Owns single- or multi-expand state and
generates the trigger/panel ids needed for aria-controls / aria-labelledby. Pairs
with useListGrid's expand-caret slot.
single mode tracks one expanded id; expanding another collapses the previous (matches
the existing OrderedList behaviour).
multi mode tracks a Set<string> of expanded ids; intended for Tree and other
multi-branch disclosure surfaces.
Controlled-ness keys on onValueChange rather than on the value's presence so that
undefined (single mode) and the empty set (multi mode) remain valid "nothing expanded"
values. useControllableState keys on the value's presence, so it flips to uncontrolled when a
controlled value clears to undefined, then re-reads the stale internal state and fails to collapse —
a hand-rolled controller is the only correct option here.
Disclosure (open/close) aspect for list items. Owns single- or multi-expand state and generates the trigger/panel ids needed for
aria-controls/aria-labelledby. Pairs withuseListGrid's expand-caret slot.singlemode tracks one expanded id; expanding another collapses the previous (matches the existingOrderedListbehaviour).multimode tracks aSet<string>of expanded ids; intended forTreeand other multi-branch disclosure surfaces.Controlled-ness keys on
onValueChangerather than on the value's presence so thatundefined(single mode) and the empty set (multi mode) remain valid "nothing expanded" values.useControllableStatekeys on the value's presence, so it flips to uncontrolled when a controlled value clears toundefined, then re-reads the stale internal state and fails to collapse — a hand-rolled controller is the only correct option here.