Skip to content

refactor: Simplified TextButton and removed start and end accessory#1001

Merged
brianacnguyen merged 8 commits into
mainfrom
fix/textbutton
Mar 27, 2026
Merged

refactor: Simplified TextButton and removed start and end accessory#1001
brianacnguyen merged 8 commits into
mainfrom
fix/textbutton

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates @metamask/design-system-react-native in two areas (depending on what is already on the target branch):

  1. TextButton (breaking simplification)
    • Why: Reduce API surface and implementation complexity so TextButton is a thin, predictable wrapper around design-system Text.
    • What: TextButton now renders Text with onPress / onPressIn / onPressOut only (no Pressable). Press state drives TextColor.PrimaryDefaultPrimaryDefaultPressed.
    • Removed: size, TextButtonSize, isDisabled, isInverse, start/end icons and accessories, and related constants/tests/stories/docs.
    • Consumers: Use Text props such as variant (default TextVariant.BodyMd), fontWeight (default Medium), optional textProps, and twClassName for layout/typography. TextButtonSize is no longer exported from this package—use TextVariant instead.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-655

Manual testing steps

  1. From the repo root: yarn storybook:ios or yarn storybook:android (or your usual RN Storybook flow).
  2. Open TextButton stories: confirm default and variants render, onPress fires, and pressed styling matches design (primary → pressed primary).
  3. If your app used the old API: confirm call sites compile after removing size, isDisabled, isInverse, icons/accessories, and switching sizing to Text variant / props as needed.

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-03-25.at.00.24.12.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.

Note

Medium Risk
Breaking API change removes TextButtonSize, disabled/inverse states, and all icon/accessory support, requiring consumer updates. Interaction styling now relies on Text press events and internal pressed state, which could subtly change behavior/appearance in existing screens.

Overview
Simplifies React Native TextButton into a thin wrapper around Text for inline link-style interactions, using variant/fontWeight and Text press props instead of a Pressable container.

Breaking: removes TextButtonSize and size, all disabled/inverse and start/end icon/accessory props, and stops exporting TextButtonSize from package types/exports. Storybook, tests, Figma code-connect, and docs/migration guide are updated to reflect the new text-only API and recommend tertiary Button when icons are needed.

Also tweaks web TextButton hover/active classes to no longer apply background color.

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

@brianacnguyen brianacnguyen self-assigned this Mar 26, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner March 26, 2026 06:14
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great simplification! Left some suggestions

Comment thread packages/design-system-react-native/src/components/TextButton/README.md Outdated
Comment thread packages/design-system-react-native/src/components/TextButton/TextButton.types.ts Outdated
Comment thread packages/design-system-react-native/CHANGELOG.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Massive improvement. 🚀 One aspect that might improve accessibility that we can talk with @amandaye0h about is visual differentiator for color blind folks like a different weight or underline.

  • checked storybook story in ios simulator ✅

Comment thread packages/design-system-react-native/MIGRATION.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@georgewrmarshall georgewrmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work! 🚀

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@brianacnguyen brianacnguyen enabled auto-merge (squash) March 27, 2026 00:28
@github-actions

Copy link
Copy Markdown
Contributor

📖 Storybook Preview

@brianacnguyen brianacnguyen merged commit 5104da8 into main Mar 27, 2026
44 checks passed
@brianacnguyen brianacnguyen deleted the fix/textbutton branch March 27, 2026 00:32
@georgewrmarshall georgewrmarshall mentioned this pull request Mar 27, 2026
18 tasks
georgewrmarshall added a commit that referenced this pull request Mar 27, 2026
## Release 26.0.0

This release adds new BannerAlert components, introduces `KeyValueRow`
for React Native, includes breaking simplifications to React Native
`TextButton` and `TextField`, and continues ADR-0003/0004 shared type
migrations.

### 📦 Package Versions

- `@metamask/design-system-shared`: **0.5.0**
- `@metamask/design-system-react`: **0.12.0**
- `@metamask/design-system-react-native`: **0.12.0**

### 🔄 Shared Type Updates (0.5.0)

#### Component Type Additions (#975, #997)

**What Changed:**

- Added `BannerAlertSeverity` const object + `BannerAlertPropsShared`
- Added `AvatarNetworkPropsShared` type (ADR-0004)

**Impact:**

- Enables consistent cross-platform `BannerAlert` severity/types
- Continues ADR-0003/ADR-0004 const-object + string-union + shared types
adoption

### 🌐 React Web Updates (0.12.0)

#### Added

- Added `BannerAlert` component (#975)

#### Changed

- Updated `TextButton` hover/pressed styles to be text-only (no
background fill) (#1001)
- Updated `Candlestick` icon asset with smaller size variant (#998)

### 📱 React Native Updates (0.12.0)

#### Added

- Added `BannerAlert` component (#966)
- Added `KeyValueRow` component (#959)

#### Changed

- **BREAKING:** Simplified `TextButton` to a text-only control and
removed `size`/`TextButtonSize`, inverse/disabled props, and
icon/accessory props (#1001)
- Migration:
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`
- **BREAKING:** Removed `TextFieldSize` and the `size` prop; `TextField`
is now a single fixed-height (48px) row (#1000)
- Migration:
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`
- Updated `Candlestick` icon asset with smaller size variant (#998)

#### Fixed

- Improved `Input` single-line typography alignment (including iOS
placeholder behavior) (#1000)

### ⚠️ Breaking Changes

#### TextButton API (React Native)

**What Changed:**

- Removed `size`/`TextButtonSize`, `isDisabled`, `isInverse`, and
start/end icon & accessory props
- `TextButton` now aligns with `Text` typography and press handlers
(`variant`, `fontWeight`, `onPress`, etc.)

**Migration:**

See
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`.

**Impact:**

- Affects all React Native `TextButton` usages relying on the removed
props

#### TextField Size API (React Native)

**What Changed:**

- Removed `TextFieldSize` and the `size` prop
- `TextField` is now a single fixed-height (48px) row

**Migration:**

See
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`.

**Impact:**

- Affects all React Native `TextField` usages passing `size` / importing
`TextFieldSize`

### ✅ Checklist

- [x] Changelogs updated with human-readable descriptions
- [x] Changelog validation passed (`yarn changelog:validate`)
- [x] Version bumps follow semantic versioning
  - [x] design-system-shared: minor (0.4.0 → 0.5.0) - new shared types
- [x] design-system-react: minor (0.11.0 → 0.12.0) - new component +
non-breaking changes
- [x] design-system-react-native: minor (0.11.0 → 0.12.0) - new
components + breaking API changes (pre-1.0)
- [x] Breaking changes documented with migration guidance
- [x] Migration guides updated with before/after examples (if breaking
changes)
- [x] PR references included in changelog entries

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've reviewed the [Release
Workflow](./.cursor/rules/release-workflow.md) cursor rule
- [x] All tests pass (`yarn build && yarn test && yarn lint`)
- [x] Changelog validation passes (`yarn changelog:validate`)

## **Pre-merge reviewer checklist**

- [ ] I've reviewed the [Reviewing Release
PRs](./docs/reviewing-release-prs.md) guide
- [ ] Package versions follow semantic versioning
- [ ] Changelog entries are consumer-facing (not commit message
regurgitation)
- [ ] Breaking changes are documented in MIGRATION.md with examples
- [ ] All unreleased changes are accounted for in changelogs

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Mostly a version/changelog release PR, but includes documented
**breaking** React Native API removals for `TextButton` and `TextField`
that can break downstream consumers on upgrade.
> 
> **Overview**
> Bumps the monorepo version to `26.0.0` and releases
`@metamask/design-system-react`/`@metamask/design-system-react-native`
to `0.12.0` and `@metamask/design-system-shared` to `0.5.0`.
> 
> Updates changelogs and the React Native migration guide to reflect new
`BannerAlert` (web + RN) and `KeyValueRow` (RN), shared type additions
(`BannerAlertSeverity`/`BannerAlertPropsShared`,
`AvatarNetworkPropsShared`), and **breaking** RN API changes removing
`TextButton` sizing/icons/disabled/inverse props and removing
`TextField` sizing (`TextFieldSize`/`size`) in favor of a fixed-height
row.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5ead00c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
georgewrmarshall pushed a commit that referenced this pull request Apr 27, 2026
…1001)

## **Description**

This PR updates **`@metamask/design-system-react-native`** in two areas
(depending on what is already on the target branch):

1. **`TextButton` (breaking simplification)**  
- **Why:** Reduce API surface and implementation complexity so
`TextButton` is a thin, predictable wrapper around design-system `Text`.
- **What:** `TextButton` now renders `Text` with `onPress` / `onPressIn`
/ `onPressOut` only (no `Pressable`). Press state drives
`TextColor.PrimaryDefault` → `PrimaryDefaultPressed`.
- **Removed:** `size`, `TextButtonSize`, `isDisabled`, `isInverse`,
start/end icons and accessories, and related
constants/tests/stories/docs.
- **Consumers:** Use `Text` props such as `variant` (default
`TextVariant.BodyMd`), `fontWeight` (default `Medium`), optional
`textProps`, and `twClassName` for layout/typography. `TextButtonSize`
is no longer exported from this package—use `TextVariant` instead.

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-655

## **Manual testing steps**

1. From the repo root: `yarn storybook:ios` or `yarn storybook:android`
(or your usual RN Storybook flow).
2. Open **TextButton** stories: confirm default and variants render,
`onPress` fires, and pressed styling matches design (primary → pressed
primary).
3. If your app used the old API: confirm call sites compile after
removing `size`, `isDisabled`, `isInverse`, icons/accessories, and
switching sizing to `Text` `variant` / props as needed.

## **Screenshots/Recordings**

### **Before**



### **After**


https://github.com/user-attachments/assets/156a3514-97fb-407f-9a6f-d35a2f8ed0e4

## **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]
> **Medium Risk**
> Medium risk because it is a breaking API change that removes multiple
exported props/enums (`TextButtonSize`, icons/accessories,
inverse/disabled handling) and changes interaction styling behavior,
requiring downstream app migrations.
> 
> **Overview**
> **Breaking refactor of `TextButton` in
`@metamask/design-system-react-native`.** `TextButton` is now a
text-only inline link that renders `Text` directly, taking
`variant`/`fontWeight` and `Text` press handlers; pressed state is
handled internally to switch between `TextColor.PrimaryDefault` and
`PrimaryDefaultPressed`.
> 
> The old API surface is removed: `TextButtonSize` (enum + export),
`size`, `isDisabled`, `isInverse`, start/end icons and accessories,
`textProps`, and the `Pressable`-based implementation (including related
constants). Stories, tests, and component docs are rewritten to match
the new props, and `MIGRATION.md` adds a 0.11.0→0.12.0 guide for
updating call sites.
> 
> Separately, the web `TextButton` styles drop
`hover:bg-hover`/`active:bg-pressed` background classes, keeping
text/decoration state changes only.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2d1a0bb. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
georgewrmarshall added a commit that referenced this pull request Apr 27, 2026
## Release 26.0.0

This release adds new BannerAlert components, introduces `KeyValueRow`
for React Native, includes breaking simplifications to React Native
`TextButton` and `TextField`, and continues ADR-0003/0004 shared type
migrations.

### 📦 Package Versions

- `@metamask/design-system-shared`: **0.5.0**
- `@metamask/design-system-react`: **0.12.0**
- `@metamask/design-system-react-native`: **0.12.0**

### 🔄 Shared Type Updates (0.5.0)

#### Component Type Additions (#975, #997)

**What Changed:**

- Added `BannerAlertSeverity` const object + `BannerAlertPropsShared`
- Added `AvatarNetworkPropsShared` type (ADR-0004)

**Impact:**

- Enables consistent cross-platform `BannerAlert` severity/types
- Continues ADR-0003/ADR-0004 const-object + string-union + shared types
adoption

### 🌐 React Web Updates (0.12.0)

#### Added

- Added `BannerAlert` component (#975)

#### Changed

- Updated `TextButton` hover/pressed styles to be text-only (no
background fill) (#1001)
- Updated `Candlestick` icon asset with smaller size variant (#998)

### 📱 React Native Updates (0.12.0)

#### Added

- Added `BannerAlert` component (#966)
- Added `KeyValueRow` component (#959)

#### Changed

- **BREAKING:** Simplified `TextButton` to a text-only control and
removed `size`/`TextButtonSize`, inverse/disabled props, and
icon/accessory props (#1001)
- Migration:
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`
- **BREAKING:** Removed `TextFieldSize` and the `size` prop; `TextField`
is now a single fixed-height (48px) row (#1000)
- Migration:
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`
- Updated `Candlestick` icon asset with smaller size variant (#998)

#### Fixed

- Improved `Input` single-line typography alignment (including iOS
placeholder behavior) (#1000)

### ⚠️ Breaking Changes

#### TextButton API (React Native)

**What Changed:**

- Removed `size`/`TextButtonSize`, `isDisabled`, `isInverse`, and
start/end icon & accessory props
- `TextButton` now aligns with `Text` typography and press handlers
(`variant`, `fontWeight`, `onPress`, etc.)

**Migration:**

See
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`.

**Impact:**

- Affects all React Native `TextButton` usages relying on the removed
props

#### TextField Size API (React Native)

**What Changed:**

- Removed `TextFieldSize` and the `size` prop
- `TextField` is now a single fixed-height (48px) row

**Migration:**

See
`./packages/design-system-react-native/MIGRATION.md#from-version-0110-to-0120`.

**Impact:**

- Affects all React Native `TextField` usages passing `size` / importing
`TextFieldSize`

### ✅ Checklist

- [x] Changelogs updated with human-readable descriptions
- [x] Changelog validation passed (`yarn changelog:validate`)
- [x] Version bumps follow semantic versioning
  - [x] design-system-shared: minor (0.4.0 → 0.5.0) - new shared types
- [x] design-system-react: minor (0.11.0 → 0.12.0) - new component +
non-breaking changes
- [x] design-system-react-native: minor (0.11.0 → 0.12.0) - new
components + breaking API changes (pre-1.0)
- [x] Breaking changes documented with migration guidance
- [x] Migration guides updated with before/after examples (if breaking
changes)
- [x] PR references included in changelog entries

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs)
- [x] I've reviewed the [Release
Workflow](./.cursor/rules/release-workflow.md) cursor rule
- [x] All tests pass (`yarn build && yarn test && yarn lint`)
- [x] Changelog validation passes (`yarn changelog:validate`)

## **Pre-merge reviewer checklist**

- [ ] I've reviewed the [Reviewing Release
PRs](./docs/reviewing-release-prs.md) guide
- [ ] Package versions follow semantic versioning
- [ ] Changelog entries are consumer-facing (not commit message
regurgitation)
- [ ] Breaking changes are documented in MIGRATION.md with examples
- [ ] All unreleased changes are accounted for in changelogs

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Mostly a version/changelog release PR, but includes documented
**breaking** React Native API removals for `TextButton` and `TextField`
that can break downstream consumers on upgrade.
> 
> **Overview**
> Bumps the monorepo version to `26.0.0` and releases
`@metamask/design-system-react`/`@metamask/design-system-react-native`
to `0.12.0` and `@metamask/design-system-shared` to `0.5.0`.
> 
> Updates changelogs and the React Native migration guide to reflect new
`BannerAlert` (web + RN) and `KeyValueRow` (RN), shared type additions
(`BannerAlertSeverity`/`BannerAlertPropsShared`,
`AvatarNetworkPropsShared`), and **breaking** RN API changes removing
`TextButton` sizing/icons/disabled/inverse props and removing
`TextField` sizing (`TextFieldSize`/`size`) in favor of a fixed-height
row.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5ead00c. 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants