Overview
Follow-up from #1172. SegmentButton and SelectButton can pass an empty string into ButtonBase's loading spinner color path.
Problem
ButtonBase derives the loading spinner color from textClassName(pressed) when textClassName is provided:
color={
textClassName
? (textClassName(pressed) as IconColor)
: IconColor.IconDefault
}
The new components sometimes return '' from textClassName / iconClassName:
SegmentButton: unselected states return ''
SelectButton: tertiary variant returns ''
Because '' is still passed as an explicit color prop, it bypasses Spinner's IconColor.IconDefault default and leaves the loading icon without a valid design-system color class.
Acceptance Criteria
References
Overview
Follow-up from #1172.
SegmentButtonandSelectButtoncan pass an empty string intoButtonBase's loading spinner color path.Problem
ButtonBasederives the loading spinner color fromtextClassName(pressed)whentextClassNameis provided:The new components sometimes return
''fromtextClassName/iconClassName:SegmentButton: unselected states return''SelectButton: tertiary variant returns''Because
''is still passed as an explicitcolorprop, it bypassesSpinner'sIconColor.IconDefaultdefault and leaves the loading icon without a valid design-system color class.Acceptance Criteria
SegmentButtonvariant/selected combination.SelectButtonvariant.References
packages/design-system-react-native/src/components/SegmentButton/SegmentButton.tsxpackages/design-system-react-native/src/components/SelectButton/SelectButton.tsxpackages/design-system-react-native/src/components/ButtonBase/ButtonBase.tsx