feat(shared): migrate Button and ButtonBase to ADR-0003 and ADR-0004 shared types (DSYS-483)#1034
Draft
cursor[bot] wants to merge 2 commits intomainfrom
Draft
feat(shared): migrate Button and ButtonBase to ADR-0003 and ADR-0004 shared types (DSYS-483)#1034cursor[bot] wants to merge 2 commits intomainfrom
cursor[bot] wants to merge 2 commits intomainfrom
Conversation
…shared types (DSYS-483) Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…iles Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
Contributor
📖 Storybook Preview |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrates
ButtonandButtonBasecomponents to follow ADR-0003 (String Unions) and ADR-0004 (Centralized Types Architecture) as part of the DSYS-468 epic.What changed:
ButtonBaseSizeconst object (ADR-0003) andButtonBasePropsSharedtype (ADR-0004) in@metamask/design-system-sharedButtonVariantconst object (ADR-0003) andButtonPropsSharedtype (ADR-0004) in@metamask/design-system-sharedButtonBaseSize,ButtonVariantenums and their aliases (ButtonPrimarySize,ButtonSecondarySize,ButtonTertiarySize,ButtonHeroSize,ButtonSize) from both platformsrc/types/index.tsfilesButtonBaseandButtoncomponents in both React and React Native packages to import from shared../../typesor../../../../typesADR compliance:
ButtonBaseSizeandButtonVariantare nowas constobjects with derived union typesButtonBasePropsSharedandButtonPropsSharedare now centralized in@metamask/design-system-sharedVerification:
yarn workspace @metamask/design-system-shared run build✅yarn workspace @metamask/design-system-react run build✅yarn workspace @metamask/design-system-react run test✅ (100% coverage)yarn workspace @metamask/design-system-react-native run test✅ (100% coverage)Related issues
Fixes: DSYS-483
Manual testing steps
ButtonBaseSize,ButtonVariantfrom@metamask/design-system-shared— verify const object values are correctButtonSize,ButtonVariantfrom@metamask/design-system-react— verify these still workButtonBaseSize,ButtonVariantfrom@metamask/design-system-react-native— verify these still workScreenshots/Recordings
Before
Enums defined separately in both platform packages'
src/types/index.ts.After
Const objects defined once in
@metamask/design-system-shared, re-exported from platform packages for backwards compatibility.Pre-merge author checklist
Pre-merge reviewer checklist