-
-
Notifications
You must be signed in to change notification settings - Fork 11
Release 35.0.0 #1108
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
Release 35.0.0 #1108
Changes from all commits
f835331
349a6e2
e069cc7
fb9ec3d
f2fa981
e2ccefc
addbae5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ This guide provides detailed instructions for migrating your project from one ve | |
| - [TextField Component](#textfield-component) | ||
| - [ListItem Component](#listitem-component) | ||
| - [Version Updates](#version-updates) | ||
| - [From version 0.19.0 to 0.20.0](#from-version-0190-to-0200) | ||
| - [From version 0.18.0 to 0.19.0](#from-version-0180-to-0190) | ||
| - [From version 0.16.0 to 0.17.0](#from-version-0160-to-0170) | ||
| - [From version 0.15.0 to 0.16.0](#from-version-0150-to-0160) | ||
|
|
@@ -34,6 +35,62 @@ This guide provides detailed instructions for migrating your project from one ve | |
|
|
||
| ## Version Updates | ||
|
|
||
| ### From version 0.19.0 to 0.20.0 | ||
|
|
||
| #### Box: Enum exports now use const objects and string unions | ||
|
|
||
| **What Changed:** | ||
|
|
||
| `BoxFlexDirection`, `BoxFlexWrap`, `BoxAlignItems`, `BoxJustifyContent`, `BoxBackgroundColor`, `BoxBorderColor`, `BoxSpacing`, and `BoxBorderWidth` now follow the ADR-0003 const-object + string-union pattern instead of local enums. | ||
|
|
||
| **Migration:** | ||
|
|
||
| ```tsx | ||
| // Before (0.19.0) | ||
| import { BoxBackgroundColor } from '@metamask/design-system-react-native'; | ||
|
|
||
| // After (0.20.0) | ||
| import { BoxBackgroundColor } from '@metamask/design-system-react-native'; | ||
| ``` | ||
|
|
||
| #### Box: Removed stale `-alternative` color tokens | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This guide is intentionally narrowed to the actionable Box migration only. We removed design-system-shared import guidance because it describes implementation detail rather than the public upgrade path, and we don't mention the Icon section because it had no meaningful before/after change while the removed Box colors do require explicit replacements. |
||
|
|
||
| **What Changed:** | ||
|
|
||
| The following `BoxBackgroundColor` and `BoxBorderColor` entries have been removed. These tokens were removed from `@metamask/design-tokens` in v4.0.0 but were incorrectly carried over into the Box const objects: | ||
|
|
||
| | Removed Entry | Replacement | | ||
| | --------------------------------------- | ----------------------------------- | | ||
| | `BoxBackgroundColor.WarningAlternative` | `BoxBackgroundColor.WarningDefault` | | ||
| | `BoxBackgroundColor.SuccessAlternative` | `BoxBackgroundColor.SuccessDefault` | | ||
| | `BoxBorderColor.WarningAlternative` | `BoxBorderColor.WarningDefault` | | ||
| | `BoxBorderColor.SuccessAlternative` | `BoxBorderColor.SuccessDefault` | | ||
| | `BoxBorderColor.InfoAlternative` | `BoxBorderColor.InfoDefault` | | ||
|
|
||
| **Migration:** | ||
|
|
||
| These tokens had no backing CSS custom property, so any usage was already producing no visible style. Replace with `-default` or `-muted` as appropriate: | ||
|
|
||
| ```tsx | ||
| // Before (0.19.0) | ||
| <Box backgroundColor={BoxBackgroundColor.WarningAlternative} /> | ||
| <Box backgroundColor={BoxBackgroundColor.SuccessAlternative} /> | ||
| <Box borderColor={BoxBorderColor.WarningAlternative} /> | ||
| <Box borderColor={BoxBorderColor.SuccessAlternative} /> | ||
| <Box borderColor={BoxBorderColor.InfoAlternative} /> | ||
|
|
||
| // After (0.20.0) | ||
| <Box backgroundColor={BoxBackgroundColor.WarningDefault} /> | ||
| <Box backgroundColor={BoxBackgroundColor.SuccessDefault} /> | ||
| <Box borderColor={BoxBorderColor.WarningDefault} /> | ||
| <Box borderColor={BoxBorderColor.SuccessDefault} /> | ||
| <Box borderColor={BoxBorderColor.InfoDefault} /> | ||
| ``` | ||
|
|
||
| **Impact:** | ||
|
|
||
| - Any reference to the removed entries will produce a TypeScript error after upgrading. | ||
|
|
||
| ### From version 0.18.0 to 0.19.0 | ||
|
|
||
| #### HeaderRoot: `titleAccessory` no longer renders without `title` | ||
|
|
@@ -99,14 +156,16 @@ If TypeScript now flags props you were previously passing to `Icon`, those props | |
| </View> | ||
| ``` | ||
|
|
||
| #### Box: Type imports moved to `@metamask/design-system-shared` | ||
| #### Box: Enum exports now use const objects and string unions | ||
|
|
||
| `BoxFlexDirection`, `BoxFlexWrap`, `BoxAlignItems`, `BoxJustifyContent`, `BoxBackgroundColor`, `BoxBorderColor`, `BoxSpacing`, and `BoxBorderWidth` are now defined in `@metamask/design-system-shared` and re-exported from `@metamask/design-system-react-native`. All existing import paths through `@metamask/design-system-react-native` continue to work without change. | ||
| `BoxFlexDirection`, `BoxFlexWrap`, `BoxAlignItems`, `BoxJustifyContent`, `BoxBackgroundColor`, `BoxBorderColor`, `BoxSpacing`, and `BoxBorderWidth` now use const-object + string-union types instead of enums. | ||
|
|
||
| ```tsx | ||
| // Both of these work — shared is the source of truth | ||
| // Before (0.18.0) | ||
| import { BoxBackgroundColor } from '@metamask/design-system-react-native'; | ||
|
|
||
| // After (0.19.0) | ||
| import { BoxBackgroundColor } from '@metamask/design-system-react-native'; | ||
| import { BoxBackgroundColor } from '@metamask/design-system-shared'; | ||
| ``` | ||
|
|
||
| #### Box: Removed stale `-alternative` color tokens | ||
|
|
@@ -127,9 +186,9 @@ These tokens had no backing CSS custom property, so any usage was already produc | |
|
|
||
| ### From version 0.16.0 to 0.17.0 | ||
|
|
||
| #### Text: Typography const values moved to `@metamask/design-system-shared` | ||
| #### Text: Typography enum exports now use const objects and string unions | ||
|
|
||
| `FontWeight`, `FontStyle`, `FontFamily`, `TextVariant`, and `TextColor` are now defined in `@metamask/design-system-shared` and re-exported from `@metamask/design-system-react-native`. All existing import paths through `@metamask/design-system-react-native` continue to work without change. | ||
| `FontWeight`, `FontStyle`, `FontFamily`, `TextVariant`, and `TextColor` now follow the ADR-0003 const-object + string-union pattern instead of enums. | ||
|
|
||
| #### `FontWeight` values changed | ||
|
|
||
|
|
@@ -242,7 +301,7 @@ import { BoxRow, BoxColumn } from '@metamask/design-system-react-native'; | |
|
|
||
| - `KeyValueRow` no longer accepts `field` and `value` configuration objects. Use flat props: `keyLabel`, `value`, optional `variant`, start/end accessories, optional `keyTextProps` / `valueTextProps`, and optional `keyEndButtonIconProps` / `valueEndButtonIconProps`. | ||
| - Layout is handled inside the component (`BoxRow` / `Box`). The old stub API used to compose custom rows is removed. | ||
| - `KeyValueRowVariant` is defined in `@metamask/design-system-shared` (shared props follow ADR-0003 / ADR-0004); React Native–specific props remain on `KeyValueRowProps` in this package. | ||
| - `KeyValueRowVariant` now follows the ADR-0003 / ADR-0004 const-object + string-union pattern; React Native–specific props remain on `KeyValueRowProps` in this package. | ||
|
|
||
| **Removed from the public API:** | ||
|
|
||
|
|
@@ -382,7 +441,7 @@ Custom React nodes for key or value remain supported: | |
|
|
||
| **Instructions for downstream consumers:** | ||
|
|
||
| - In **MetaMask Mobile**, **MetaMask extension**, and any shared packages, search for `KeyValueRow` and migrate every usage away from `field` / `value` objects to the new props. | ||
| - In **MetaMask Mobile**, **MetaMask extension**, and any other packages that consume `KeyValueRow`, search for usages and migrate every callsite away from `field` / `value` objects to the new props. | ||
| - Remove imports of deleted symbols (`KeyValueRowStubs`, `KeyValueRowFieldIconSides`, `KeyValueRowSectionAlignments`, `TooltipSizes`, `IconSizes`, and the removed types). | ||
| - If your app defines **KeyValueColumn** or another wrapper that forwards the old `KeyValueRow` props, update that component’s API and all call sites to match the new shape. | ||
|
|
||
|
|
@@ -2496,8 +2555,8 @@ This section covers version-to-version breaking changes within `@metamask/design | |
|
|
||
| ### BadgeWrapper types now use const-object + union definitions | ||
|
|
||
| - `BadgeWrapperPosition`, `BadgeWrapperPositionAnchorShape`, `BadgeWrapperCustomPosition`, and `BadgeWrapperPropsShared` now come from const objects annotated `as const`, which produce string union types rather than TypeScript enums (ADR-0003/ADR-0004). The shared package defines the canonical values and the platform entry points keep re-exporting those names so React Native consumers use the same import paths they already rely on. | ||
| - The switch lets React, React Native, and shared code stay aligned on the string-literal surface without duplicating runtime enums; no import-path change is required. | ||
| - `BadgeWrapperPosition`, `BadgeWrapperPositionAnchorShape`, `BadgeWrapperCustomPosition`, and `BadgeWrapperPropsShared` now come from const objects annotated `as const`, which produce string union types rather than TypeScript enums (ADR-0003/ADR-0004). | ||
| - The exported names and import paths stay the same, so no import-path change is required. | ||
|
|
||
| ## From version 0.11.0 to 0.12.0 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "@metamask/design-system-react-native", | ||
| "version": "0.19.0", | ||
| "version": "0.20.0", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. React Native also gets a minor bump for the same pre-1.0 reason, with both new components and breaking type-surface updates in the same release. The version is meant to tell consumers this is more than a patch-level doc cleanup. |
||
| "description": "Design System React Native", | ||
| "keywords": [ | ||
| "MetaMask", | ||
|
|
||
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.
New components
TitleStandardTitleSubpageandTag