Skip to content

Conversation

@georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Dec 4, 2025

Description

This PR improves the Background color stories in both React and React Native Storybook by:

  1. Better component layout: Changed button layout from horizontal row to vertical column with full-width buttons in React Native for better visibility and consistency
  2. Improved structure: Removed Tailwind's space-y-2 in favor of explicit flexDirection and gap props for better React Native compatibility
  3. Fixed text button placement: Moved TextButton from ButtonComponents to TextComponents section where it better fits with other text and icon color demonstrations
  4. Cleaner styling: Replaced inline twClassName padding with explicit padding prop, and removed unnecessary backgroundColor on parent Box components

These changes make the Background stories more consistent between web and React Native, and improve the visual demonstration of the different background color tokens.

Related issues

Fixes: N/A (Internal improvement)

Manual testing steps

  1. Run React Native Storybook: yarn storybook:react-native
  2. Navigate to the Backgrounds story
  3. Verify buttons are displayed vertically and full-width
  4. Verify TextButton appears in the Text & Icon Colors section
  5. Verify all background levels (Default > Section > Subsection) are clearly visible
  6. Run React Storybook: yarn storybook:react
  7. Navigate to the Backgrounds story
  8. Verify the same improvements are reflected

Screenshots/Recordings

Before

TextButton can't be seen on page because of horizontal flexbox

Screenshot 2025-12-04 at 1 50 53 PM

After

All buttons are visible.

Screenshot 2025-12-04 at 1 54 26 PM
bg.color.after.mov

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable
  • I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

🤖 Generated with Claude Code


Note

Reorganizes Backgrounds stories by making RN buttons vertical and full-width, moving TextButton into the text section, and replacing Tailwind spacing/padding with explicit props (with analogous TextButton move in React).

  • React Native Story (apps/storybook-react-native/stories/Backgrounds.stories.tsx)
    • Buttons layout: Change ButtonComponents from row to column with isFullWidth buttons; remove TextButton from this group.
    • Text section: Add TextButton to TextComponents; replace Tailwind space-y-2 with flexDirection={Column} and gap.
    • Styling cleanup: Remove bg-default/parent backgroundColor; switch padding from twClassName to padding prop; keep rounded corners via twClassName.
  • React Story (apps/storybook-react/stories/Backgrounds.stories.tsx)
    • Move TextButton from ButtonComponents to TextComponents to align with RN story.

Written by Cursor Bugbot for commit 230fa35. This will update automatically on new commits. Configure here.

@georgewrmarshall georgewrmarshall requested a review from a team as a code owner December 4, 2025 00:46
@georgewrmarshall georgewrmarshall self-assigned this Dec 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

📖 Storybook Preview

const TextComponents = () => (
<>
<Text variant={TextVariant.HeadingSm}>Text & Icon Colors</Text>
<Box twClassName="space-y-2">
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space-y-2 doesn't work with twrnc

Image

const Backgrounds: React.FC = () => {
const tw = useTailwind();
return (
<ScrollView style={tw`flex-1 bg-default`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

background/default is right up against the edge of text here. Going to move to change storybook background color altogether

<Icon name={IconName.Info} color={IconColor.IconMuted} />
<Text color={TextColor.TextMuted}>Text Muted and Icon Muted</Text>
</Box>
<TextButton>Text Button</TextButton>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving TextButton to text where it's likely to be used instead of in a button group

<Icon name={IconName.Info} color={IconColor.IconMuted} />
<Text color={TextColor.TextMuted}>Text Muted and Icon Muted</Text>
</Box>
<TextButton>Text Button</TextButton>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving TextButton to text where it's likely to be used instead of in a button group

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

📖 Storybook Preview

@georgewrmarshall georgewrmarshall merged commit 18896c0 into main Dec 4, 2025
42 checks passed
@georgewrmarshall georgewrmarshall deleted the background-story-fixes branch December 4, 2025 03:28
@georgewrmarshall georgewrmarshall mentioned this pull request Dec 9, 2025
7 tasks
brianacnguyen pushed a commit that referenced this pull request Dec 9, 2025
## **Description**

This PR releases version 17.0.0 of the MetaMask Design System, featuring
important fixes for mobile font compatibility, the addition of the
ButtonHero component to React, export fixes for React Native, and
various dependency updates including ESLint configuration upgrades.

## **Included PRs**

#836, #837, #838, #840, #843, #845, #846, #847, #848, #850, #851, #852,
#853, #854, #855, #856, #857, #858, #859, #861, #862, #863, #864

## **Manual testing steps**

1. Check package.json version bumps align with included changes
2. Check changelog accurately reflects the release

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release 17.0.0 introducing React `ButtonHero`, RN font naming changes
and TWRNC preset font family rename (both breaking), plus RN export fix
and dependency updates.
> 
> - **Release 17.0.0**
>   - Bump root `package.json` to `17.0.0`.
> - **React (`@metamask/[email protected]`)**
>   - Add `ButtonHero` component for prominent CTAs.
>   - Update `@metamask/utils` peer to `^11.8.1`.
> - **React Native (`@metamask/[email protected]`)**
> - BREAKING: Rename font files to hyphenated PostScript format for iOS
Metro compatibility.
>   - Export missing `TextButtonSize` enum.
> - Peer: require `@metamask/design-system-twrnc-preset@^0.3.0`; update
`@metamask/utils` peer.
> - **TWRNC preset (`@metamask/[email protected]`)**
> - BREAKING: Rename font family names to hyphenated PostScript format
for iOS/expo-font.
> - **Changelogs**
>   - Update `CHANGELOG.md` links and entries for all packages.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9a90311. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants