feat(button): add hasHorizontalPadding to OceanButton#1092
Conversation
Adds an opt-in `removeHorizontalPadding` flag to OceanButton/OceanButtonModel. When true, the button is rendered without the size-based horizontal content padding, so a tertiary button can be aligned to the surrounding content (matching web's textTertiary and iOS, where tertiary styles use zero padding). Backward-compatible: defaults to false, so existing buttons are unaffected. The interactive preview gets a toggle to demonstrate the behavior.
Code Review —
|
Renames `removeHorizontalPadding` to `hasHorizontalPadding` and inverts the default to `true`, avoiding the double-negative at the call site and matching the predicate-style booleans already used by OceanButton (disabled, showProgress). Behavior and backward compatibility are unchanged.
|
Aplicado o ponto 🟢 #3 do review: o flag foi renomeado de |
|



Summary
Adds an opt-in
hasHorizontalPaddingflag (defaulttrue) toOceanButton/OceanButtonModel. Whenfalse, the button renders without the size-based horizontal content padding, so a tertiary button can be aligned to the surrounding content — matching web'stextTertiaryand iOS (where tertiary styles already use zero horizontal padding viagetPadding() == .zero).What changed
OceanButtonModel: newhasHorizontalPadding: Boolean = trueOceanButton(...): newhasHorizontalPaddingparam;contentPaddinguses the style's size-based padding whentrue, otherwise0.dpPreviewButtonInteractive): toggle to demonstrate the behaviorPreviewButtonHasHorizontalPadding): comparestruevsfalseside by sideBackward compatibility
Defaults to
true→ existing buttons are unaffected.Motivation
Consumers (e.g. blu-mobile-android's contextual hero) currently apply a negative
Modifier.offsetworkaround to align tertiary buttons to the content. This moves that responsibility into the design system, in parity with iOS/web.##Evidences
