-
-
Notifications
You must be signed in to change notification settings - Fork 11
feat(shared): migrate Box to ADR-0003 and ADR-0004 shared types (DSYS-482) #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
georgewrmarshall
merged 9 commits into
main
from
cursor/enum-shared-type-migration-8196
Apr 22, 2026
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6c528cc
feat(shared): migrate Box to ADR-0003 and ADR-0004 shared types (DSYS…
cursoragent 62e91f0
chore: lint fix
georgewrmarshall 5f311ae
fix: remove stale InfoAlternative border color token
georgewrmarshall dd92e86
fix: remove stale WarningAlternative and SuccessAlternative color tokens
georgewrmarshall 86c80bd
docs: add Box migration docs for type imports and stale token removal
georgewrmarshall 06c8ae3
chore: fix prettier formatting
georgewrmarshall e68b4b0
fix(react): re-export BoxBorderWidth from barrel
georgewrmarshall 9a6f3fc
fix(rn): update Box story imports after shared type migration
georgewrmarshall c2ba540
fix(rn): import Tag Box color from shared
georgewrmarshall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
9 changes: 4 additions & 5 deletions
9
packages/design-system-react-native/src/components/BannerAlert/BannerAlert.constants.ts
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
3 changes: 2 additions & 1 deletion
3
packages/design-system-react-native/src/components/BannerAlert/BannerAlert.test.tsx
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
15 changes: 7 additions & 8 deletions
15
packages/design-system-react-native/src/components/BannerBase/BannerBase.tsx
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
5 changes: 4 additions & 1 deletion
5
packages/design-system-react-native/src/components/Box/Box.constants.ts
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
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
15 changes: 7 additions & 8 deletions
15
packages/design-system-react-native/src/components/Box/Box.test.tsx
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
129 changes: 8 additions & 121 deletions
129
packages/design-system-react-native/src/components/Box/Box.types.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,123 +1,10 @@ | ||
| import type { BoxPropsShared } from '@metamask/design-system-shared'; | ||
| import type { ViewProps } from 'react-native'; | ||
|
|
||
| import type { | ||
| BoxFlexDirection, | ||
| BoxFlexWrap, | ||
| BoxSpacing, | ||
| BoxBorderWidth, | ||
| BoxAlignItems, | ||
| BoxJustifyContent, | ||
| BoxBackgroundColor, | ||
| BoxBorderColor, | ||
| } from '../../types'; | ||
|
|
||
| export type BoxProps = { | ||
| /** | ||
| * The flexDirection style of the component. | ||
| */ | ||
| flexDirection?: BoxFlexDirection; | ||
| /** | ||
| * The flexWrap style of the component. | ||
| */ | ||
| flexWrap?: BoxFlexWrap; | ||
| /** | ||
| * The gap between the component's children. | ||
| * Use 1-12 for a gap of 4px-48px. | ||
| */ | ||
| gap?: BoxSpacing; | ||
| /** | ||
| * The alignItems style of the component. | ||
| */ | ||
| alignItems?: BoxAlignItems; | ||
| /** | ||
| * The justifyContent style of the component. | ||
| */ | ||
| justifyContent?: BoxJustifyContent; | ||
| /** | ||
| * The margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| margin?: BoxSpacing; | ||
| /** | ||
| * The top margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| marginTop?: BoxSpacing; | ||
| /** | ||
| * The right margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| marginRight?: BoxSpacing; | ||
| /** | ||
| * The bottom margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| marginBottom?: BoxSpacing; | ||
| /** | ||
| * The left margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| marginLeft?: BoxSpacing; | ||
| /** | ||
| * The horizontal margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| marginHorizontal?: BoxSpacing; | ||
| /** | ||
| * The vertical margin of the component. | ||
| * Use 1-12 for margin of 4px-48px. | ||
| */ | ||
| marginVertical?: BoxSpacing; | ||
| /** | ||
| * The padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| padding?: BoxSpacing; | ||
| /** | ||
| * The top padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| paddingTop?: BoxSpacing; | ||
| /** | ||
| * The right padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| paddingRight?: BoxSpacing; | ||
| /** | ||
| * The bottom padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| paddingBottom?: BoxSpacing; | ||
| /** | ||
| * The left padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| paddingLeft?: BoxSpacing; | ||
| /** | ||
| * The horizontal padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| paddingHorizontal?: BoxSpacing; | ||
| /** | ||
| * The vertical padding of the component. | ||
| * Use 1-12 for padding of 4px-48px. | ||
| */ | ||
| paddingVertical?: BoxSpacing; | ||
| /** | ||
| * The border width of the component. | ||
| * Use 0, 1, 2, 4, or 8 for border width of 0px, 1px, 2px, 4px, or 8px. | ||
| */ | ||
| borderWidth?: BoxBorderWidth; | ||
| /** | ||
| * The border color of the component. | ||
| */ | ||
| borderColor?: BoxBorderColor; | ||
| /** | ||
| * The background color of the component. | ||
| */ | ||
| backgroundColor?: BoxBackgroundColor; | ||
| /** | ||
| * Optional prop to add twrnc overriding classNames. | ||
| */ | ||
| twClassName?: string; | ||
| } & ViewProps; | ||
| export type BoxProps = BoxPropsShared & | ||
| ViewProps & { | ||
| /** | ||
| * Optional prop to add twrnc overriding classNames. | ||
| */ | ||
| twClassName?: string; | ||
| }; |
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
2 changes: 1 addition & 1 deletion
2
packages/design-system-react-native/src/components/BoxColumn/BoxColumn.tsx
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
5 changes: 4 additions & 1 deletion
5
packages/design-system-react-native/src/components/BoxRow/BoxRow.tsx
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
3 changes: 2 additions & 1 deletion
3
packages/design-system-react-native/src/components/ButtonBase/ButtonBase.stories.tsx
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This split-import pattern is the correct ADR-0004 boundary in practice.
BannerAlertSeverity,BoxBackgroundColor, andBoxBorderColorare cross-platform design system tokens → imported from@metamask/design-system-shared.IconColorandIconNameare still platform-specific (React Native Icon enum values differ from React) → stay in../../types. This file is a good example of where the shared/platform boundary sits for a real consuming component.