Normalize a wrapper's label content the way Button / Tabs do: a bare string
or number becomes a <tag> — the ellipsis-capable label part (a-button-label,
a-tab-label, …) that carries the optical baseline nudge and truncates cleanly;
empty / whitespace strings and NaN carry no content and are dropped; a JSX
element is the consumer's own structure, passed through unwrapped (so an icon-only
child keeps its layout). Shared so the rule lives in one place — don't re-implement
it per component.
Normalize a wrapper's label content the way
Button/Tabsdo: a bare string or number becomes a<tag>— the ellipsis-capable label part (a-button-label,a-tab-label, …) that carries the optical baseline nudge and truncates cleanly; empty / whitespace strings andNaNcarry no content and are dropped; a JSX element is the consumer's own structure, passed through unwrapped (so an icon-only child keeps its layout). Shared so the rule lives in one place — don't re-implement it per component.