Skip to content

feat(DSYS-486): migrate Checkbox to ADR-0004 (CheckboxPropsShared)#1040

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/enum-shared-type-migration-081f
Draft

feat(DSYS-486): migrate Checkbox to ADR-0004 (CheckboxPropsShared)#1040
cursor[bot] wants to merge 1 commit intomainfrom
cursor/enum-shared-type-migration-081f

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor bot commented Apr 4, 2026

Description

Migrates the Checkbox component to follow ADR-0004 (Centralized Types Architecture) by creating CheckboxPropsShared in the shared package.

This is an ADR-0004 only migration — Checkbox has no variant/size enums to convert (no ADR-0003 work needed). The shared props extract the common, platform-independent properties: isSelected, isDisabled, isInvalid, label, and onChange.

Changes:

  • Created packages/design-system-shared/src/types/Checkbox/Checkbox.types.ts with CheckboxPropsShared
  • Created packages/design-system-shared/src/types/Checkbox/index.ts
  • Exported CheckboxPropsShared from the shared package index.ts
  • Updated packages/design-system-react/src/components/Checkbox/Checkbox.types.ts to extend CheckboxPropsShared
  • Updated packages/design-system-react-native/src/components/Checkbox/Checkbox.types.ts to extend CheckboxPropsShared

Related issues

Fixes: DSYS-486

Manual testing steps

  1. Run yarn build — should pass with no errors
  2. Run yarn test — all tests should pass with 100% coverage
  3. Run yarn lint — should pass with no errors

Screenshots/Recordings

N/A — internal type refactor, no visual changes.

Before

CheckboxProps defined independently in React and React Native packages with duplicated isSelected, isDisabled, isInvalid, label, and onChange props.

After

Both platform packages extend CheckboxPropsShared from @metamask/design-system-shared, removing duplication while maintaining full backwards compatibility.

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.
Open in Web View Automation 

- Create CheckboxPropsShared in packages/design-system-shared/src/types/Checkbox/
  with isSelected, isDisabled, isInvalid, label, onChange props
- Export CheckboxPropsShared from shared package index (ADR-0004 only,
  no enum const objects needed as Checkbox has no variant/size enums)
- Update React Checkbox.types.ts to extend CheckboxPropsShared from shared
- Update React Native Checkbox.types.ts to extend CheckboxPropsShared from shared
- All tests pass, 100% coverage maintained

Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

📖 Storybook Preview

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.

1 participant