From 70a13296c9e0ed3d2fceff9cc5820a02ac666a61 Mon Sep 17 00:00:00 2001 From: Garrett Bear Date: Fri, 4 Aug 2023 14:00:05 -0700 Subject: [PATCH] Feat/18889/update buttonlink ts (#20372) * fix buttonlink alignment * ButtonLink TS migration * fix lint * remove ButtonBase loading error feat * move padding 0 to ButtonBase * fix color issue * fix test file * fix snapshot * Update ui/components/component-library/button-link/README.mdx Co-authored-by: George Marshall * readme fix * Update ui/components/component-library/button-link/button-link.stories.tsx Co-authored-by: George Marshall --------- Co-authored-by: George Marshall --- .../custom-spending-cap.test.js.snap | 4 +- .../ledger-instruction-field.test.js.snap | 2 +- .../customize-nonce.test.js.snap | 4 +- .../__snapshots__/eth-sign-modal.test.js.snap | 6 +- .../export-private-key-modal.test.js.snap | 4 +- .../blockaid-banner-alert.test.js.snap | 6 +- .../security-provider-banner-alert.stories.js | 4 +- .../signature-request.test.js.snap | 8 +- .../snap-privacy-warning.js | 4 +- .../avatar-token/avatar-token.stories.tsx | 6 +- .../__snapshots__/button-base.test.tsx.snap | 4 +- .../button-base/button-base.tsx | 1 + .../component-library/button-link/README.mdx | 47 ++-- ...test.js.snap => button-link.test.tsx.snap} | 2 +- .../button-link/button-link.constants.js | 9 - .../button-link/button-link.js | 70 ----- .../button-link/button-link.scss | 6 +- .../button-link/button-link.stories.js | 256 ------------------ .../button-link/button-link.stories.tsx | 201 ++++++++++++++ ...tton-link.test.js => button-link.test.tsx} | 26 +- .../button-link/button-link.tsx | 59 ++++ .../button-link/button-link.types.ts | 42 +++ .../component-library/button-link/index.js | 2 - .../component-library/button-link/index.ts | 3 + .../button-primary.test.tsx.snap | 2 +- .../button-secondary.test.js.snap | 2 +- .../button/__snapshots__/button.test.js.snap | 8 +- .../button/button.stories.js | 4 +- .../component-library/icon/icon.stories.tsx | 7 +- ui/components/component-library/index.js | 2 +- .../component-library/modal/modal.stories.tsx | 6 +- .../__snapshots__/account-picker.test.js.snap | 2 +- .../__snapshots__/app-header.test.js.snap | 2 +- .../detected-token-banner.test.js.snap | 2 +- .../__snapshots__/json.test.tsx.snap | 6 +- .../import-token-link.test.js.snap | 8 +- ...irm-approve-content.component.test.js.snap | 8 +- .../__snapshots__/index.test.js.snap | 2 +- .../__snapshots__/index.test.tsx.snap | 2 +- .../desktop-pairing.test.js.snap | 2 +- .../__snapshots__/account-list.test.js.snap | 8 +- .../__snapshots__/custody.test.js.snap | 2 +- ...active-replacement-token-page.test.js.snap | 4 +- .../__snapshots__/reveal-seed.test.js.snap | 8 +- .../snap-account-detail-page.test.tsx.snap | 8 +- .../__snapshots__/snap-card.test.tsx.snap | 2 +- .../__snapshots__/security-tab.test.js.snap | 4 +- .../prepare-swap-page/prepare-swap-page.js | 3 +- .../view-quote-price-difference.js | 4 +- .../swaps-banner-alert/swaps-banner-alert.js | 13 +- .../token-allowance.test.js.snap | 4 +- 51 files changed, 439 insertions(+), 462 deletions(-) rename ui/components/component-library/button-link/__snapshots__/{button-link.test.js.snap => button-link.test.tsx.snap} (50%) delete mode 100644 ui/components/component-library/button-link/button-link.constants.js delete mode 100644 ui/components/component-library/button-link/button-link.js delete mode 100644 ui/components/component-library/button-link/button-link.stories.js create mode 100644 ui/components/component-library/button-link/button-link.stories.tsx rename ui/components/component-library/button-link/{button-link.test.js => button-link.test.tsx} (76%) create mode 100644 ui/components/component-library/button-link/button-link.tsx create mode 100644 ui/components/component-library/button-link/button-link.types.ts delete mode 100644 ui/components/component-library/button-link/index.js create mode 100644 ui/components/component-library/button-link/index.ts diff --git a/ui/components/app/custom-spending-cap/__snapshots__/custom-spending-cap.test.js.snap b/ui/components/app/custom-spending-cap/__snapshots__/custom-spending-cap.test.js.snap index 23ac5400f..79f64dd5f 100644 --- a/ui/components/app/custom-spending-cap/__snapshots__/custom-spending-cap.test.js.snap +++ b/ui/components/app/custom-spending-cap/__snapshots__/custom-spending-cap.test.js.snap @@ -50,7 +50,7 @@ exports[`CustomSpendingCap should match snapshot 1`] = ` value="7" /> diff --git a/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap b/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap index 23dd22bb3..53c02de3c 100644 --- a/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap +++ b/ui/components/app/modals/customize-nonce/__snapshots__/customize-nonce.test.js.snap @@ -37,7 +37,7 @@ exports[`Customize Nonce should match snapshot 1`] = ` > This is an advanced feature, use cautiously. diff --git a/ui/components/multichain/import-account/__snapshots__/json.test.tsx.snap b/ui/components/multichain/import-account/__snapshots__/json.test.tsx.snap index 61de94813..d65d6e5bd 100644 --- a/ui/components/multichain/import-account/__snapshots__/json.test.tsx.snap +++ b/ui/components/multichain/import-account/__snapshots__/json.test.tsx.snap @@ -7,7 +7,7 @@ exports[`Json should match snapshot 1`] = ` > Used by a variety of different clients @@ -325,7 +325,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr Nonce @@ -510,7 +510,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr Nonce @@ -695,7 +695,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr Nonce diff --git a/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap b/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap index faf175d6c..8a3e10304 100644 --- a/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap +++ b/ui/pages/confirm-signature-request/__snapshots__/index.test.js.snap @@ -207,7 +207,7 @@ exports[`Confirm Signature Request Component render should match snapshot 1`] =
diff --git a/ui/pages/institutional/connect-custody/__snapshots__/account-list.test.js.snap b/ui/pages/institutional/connect-custody/__snapshots__/account-list.test.js.snap index 0430157d0..555d1689c 100644 --- a/ui/pages/institutional/connect-custody/__snapshots__/account-list.test.js.snap +++ b/ui/pages/institutional/connect-custody/__snapshots__/account-list.test.js.snap @@ -46,7 +46,7 @@ exports[`CustodyAccountList renders accounts 1`] = ` class="mm-box mm-text custody-account-list__item mm-text--body-md mm-box--display-flex mm-box--color-text-default" >
diff --git a/ui/pages/keychains/__snapshots__/reveal-seed.test.js.snap b/ui/pages/keychains/__snapshots__/reveal-seed.test.js.snap index 1c97baf36..6b07b9254 100644 --- a/ui/pages/keychains/__snapshots__/reveal-seed.test.js.snap +++ b/ui/pages/keychains/__snapshots__/reveal-seed.test.js.snap @@ -17,7 +17,7 @@ exports[`Reveal Seed Page should match snapshot 1`] = ` The @@ -42,7 +42,7 @@ exports[`SnapAccountDetails should take a snapshot 1`] = ` class="mm-box" > @@ -180,7 +180,7 @@ exports[`SnapAccountDetails should take a snapshot 1`] = ` class="mm-box mm-text mm-text--body-md mm-box--color-text-default" > auditUrl1 @@ -190,7 +190,7 @@ exports[`SnapAccountDetails should take a snapshot 1`] = ` class="mm-box mm-text mm-text--body-md mm-box--color-text-default" > auditUrl2 diff --git a/ui/pages/keyring-snaps/snap-card/__snapshots__/snap-card.test.tsx.snap b/ui/pages/keyring-snaps/snap-card/__snapshots__/snap-card.test.tsx.snap index e8f1fc13e..8e7bc0b25 100644 --- a/ui/pages/keyring-snaps/snap-card/__snapshots__/snap-card.test.tsx.snap +++ b/ui/pages/keyring-snaps/snap-card/__snapshots__/snap-card.test.tsx.snap @@ -24,7 +24,7 @@ exports[`SnapCard should render 1`] = `