Commit e89b851
authored
refactor(identity): migrate deprecated component-library imports to @metamask/design-system-react (#41448)
## **Description**
Migrates deprecated `Box`, `Text`, `Icon`, `IconName`, `Button`,
`ButtonVariant`, and `ButtonSize` imports from the internal
`ui/components/component-library` to `@metamask/design-system-react` in
the accounts-team-owned identity components.
**Why:** The component-library versions are all marked `@deprecated` and
will be removed in a future release. This is PR 2 of a planned series to
eliminate deprecated imports across all accounts-team-owned files.
**Files changed (4):**
-
`ui/components/app/identity/backup-and-sync-toggle/backup-and-sync-toggle.tsx`
-
`ui/components/app/identity/backup-and-sync-features-toggles/backup-and-sync-features-toggles.tsx`
-
`ui/components/app/modals/identity/turn-on-backup-and-sync-modal/turn-on-backup-and-sync-modal.tsx`
-
`ui/components/app/modals/identity/confirm-turn-on-backup-and-sync-modal/confirm-turn-on-backup-and-sync-modal.tsx`
**Key API migration notes:**
- `Box`: `display={Display.Flex}` removed;
`flexDirection={BoxFlexDirection.Row}` used instead (DSR Box
auto-applies `display:flex` when `flexDirection` is set). `Box as="img"`
converted to a plain `<img>` element (DSR Box does not support the `as`
polymorphic prop).
- `Text`: camelCase enum variants (`bodyMd`, `textAlternative`) updated
to PascalCase (`BodyMd`, `TextAlternative`). `bodyMdMedium` replaced
with `BodyMd` + `fontWeight={FontWeight.Medium}`. `as="a"` / `as="div"`
usages replaced with the `asChild` pattern (Radix Slot). Spacing props
on `Text` moved to a wrapping `Box`.
- `Button`: import source updated; `width={BlockSize.Half}` replaced
with `className="w-1/2"`.
- `Modal*` components (`Modal`, `ModalOverlay`, `ModalContent`,
`ModalHeader`, `ModalBody`, `ModalFooter`) remain imported from
`component-library` — they are not yet available in
`@metamask/design-system-react`.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
<!--
## **Manual testing steps**
1. Go to this page...
2.
3.
-->
<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.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.
Made with [Cursor](https://cursor.com)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Pure UI refactor swapping component imports and prop APIs; main risk
is small visual/layout regressions (spacing, link rendering) rather than
behavioral changes.
>
> **Overview**
> Refactors the Backup & Sync settings UI and related modals to replace
deprecated `component-library` `Box`/`Text`/`Icon`/`Button` usage with
`@metamask/design-system-react` equivalents.
>
> This updates layout and typography props (e.g.,
`BoxFlexDirection`/`BoxJustifyContent`, `TextVariant`/`TextColor`
casing, `FontWeight`), switches various `Text as=...` usages to the
`asChild` pattern, and replaces a polymorphic `Box as="img"` with a
plain `<img>` plus utility classes (e.g., `w-1/2`, `rounded-md`).
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
0b1ccbc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 26e4171 commit e89b851
4 files changed
Lines changed: 154 additions & 147 deletions
File tree
- ui/components/app
- identity
- backup-and-sync-features-toggles
- backup-and-sync-toggle
- modals/identity
- confirm-turn-on-backup-and-sync-modal
- turn-on-backup-and-sync-modal
Lines changed: 27 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
4 | 16 | | |
5 | 17 | | |
6 | 18 | | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
10 | 22 | | |
11 | | - | |
12 | 23 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
116 | | - | |
| 120 | + | |
117 | 121 | | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
194 | | - | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
Lines changed: 36 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | 16 | | |
| |||
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | | - | |
19 | 28 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
205 | 207 | | |
206 | 208 | | |
207 | | - | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
233 | 235 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 258 | + | |
256 | 259 | | |
257 | 260 | | |
258 | 261 | | |
| |||
Lines changed: 27 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
6 | 17 | | |
7 | 18 | | |
8 | 19 | | |
9 | 20 | | |
10 | | - | |
11 | | - | |
12 | 21 | | |
13 | | - | |
14 | | - | |
15 | 22 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 67 | + | |
74 | 68 | | |
75 | 69 | | |
76 | 70 | | |
77 | 71 | | |
78 | 72 | | |
79 | 73 | | |
80 | 74 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
85 | 78 | | |
86 | 79 | | |
87 | | - | |
| 80 | + | |
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
| |||
94 | 87 | | |
95 | 88 | | |
96 | 89 | | |
97 | | - | |
| 90 | + | |
98 | 91 | | |
99 | | - | |
100 | 92 | | |
101 | | - | |
| 93 | + | |
102 | 94 | | |
103 | 95 | | |
| 96 | + | |
104 | 97 | | |
105 | | - | |
106 | | - | |
| 98 | + | |
| 99 | + | |
107 | 100 | | |
108 | | - | |
| 101 | + | |
109 | 102 | | |
110 | 103 | | |
111 | 104 | | |
112 | 105 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 106 | + | |
| 107 | + | |
120 | 108 | | |
121 | 109 | | |
122 | | - | |
| 110 | + | |
123 | 111 | | |
124 | 112 | | |
125 | 113 | | |
| |||
128 | 116 | | |
129 | 117 | | |
130 | 118 | | |
131 | | - | |
| 119 | + | |
132 | 120 | | |
133 | 121 | | |
134 | 122 | | |
| |||
0 commit comments