mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
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 <george.marshall@consensys.net> * readme fix * Update ui/components/component-library/button-link/button-link.stories.tsx Co-authored-by: George Marshall <george.marshall@consensys.net> --------- Co-authored-by: George Marshall <george.marshall@consensys.net>
This commit is contained in:
parent
91f6545c09
commit
70a13296c9
@ -50,7 +50,7 @@ exports[`CustomSpendingCap should match snapshot 1`] = `
|
|||||||
value="7"
|
value="7"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="custom-spending-cap-max-button"
|
data-testid="custom-spending-cap-max-button"
|
||||||
>
|
>
|
||||||
Max
|
Max
|
||||||
@ -74,7 +74,7 @@ exports[`CustomSpendingCap should match snapshot 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-link mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-link mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://support.metamask.io/hc/en-us/articles/6055177143579-How-to-customize-token-approvals-with-a-spending-cap"
|
href="https://support.metamask.io/hc/en-us/articles/6055177143579-How-to-customize-token-approvals-with-a-spending-cap"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -37,7 +37,7 @@ exports[`LedgerInstructionField Component rendering should render properly with
|
|||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-text--text-align-left mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-text--text-align-left mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Go to full screen to connect your Ledger.
|
Go to full screen to connect your Ledger.
|
||||||
</button>
|
</button>
|
||||||
|
@ -37,7 +37,7 @@ exports[`Customize Nonce should match snapshot 1`] = `
|
|||||||
>
|
>
|
||||||
This is an advanced feature, use cautiously.
|
This is an advanced feature, use cautiously.
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base customize-nonce-modal__link mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base customize-nonce-modal__link mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://metamask.zendesk.com/hc/en-us/articles/7417499333531-How-to-customize-a-transaction-nonce"
|
href="https://metamask.zendesk.com/hc/en-us/articles/7417499333531-How-to-customize-a-transaction-nonce"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -61,7 +61,7 @@ exports[`Customize Nonce should match snapshot 1`] = `
|
|||||||
class="mm-box mm-box--width-1/6"
|
class="mm-box mm-box--width-1/6"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base customize-nonce-modal__reset mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base customize-nonce-modal__reset mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="customize-nonce-reset"
|
data-testid="customize-nonce-reset"
|
||||||
>
|
>
|
||||||
Reset
|
Reset
|
||||||
|
@ -32,7 +32,7 @@ exports[`Eth Sign Modal should match snapshot 1`] = `
|
|||||||
>
|
>
|
||||||
Allowing eth_sign requests can make you vulnerable to phishing attacks. Always review the URL and be careful when signing messages that contain code.
|
Allowing eth_sign requests can make you vulnerable to phishing attacks. Always review the URL and be careful when signing messages that contain code.
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://support.metamask.io/hc/en-us/articles/14764161421467"
|
href="https://support.metamask.io/hc/en-us/articles/14764161421467"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -77,12 +77,12 @@ exports[`Eth Sign Modal should match snapshot 1`] = `
|
|||||||
class="box box--margin-top-6 box--display-flex box--gap-4 box--flex-direction-row box--justify-content-space-between"
|
class="box box--margin-top-6 box--display-flex box--gap-4 box--flex-direction-row box--justify-content-space-between"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-base--block mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-base--block mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
disabled=""
|
disabled=""
|
||||||
>
|
>
|
||||||
Continue
|
Continue
|
||||||
|
@ -120,13 +120,13 @@ exports[`Export PrivateKey Modal should match snapshot 1`] = `
|
|||||||
class="box box--margin-top-3 box--padding-5 box--md:padding-5 box--display-flex box--flex-direction-row box--justify-content-space-between box--width-full"
|
class="box box--margin-top-3 box--padding-5 box--md:padding-5 box--display-flex box--flex-direction-row box--justify-content-space-between box--width-full"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-primary mm-text--body-md-medium mm-box--margin-right-4 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-1/2 mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-primary mm-text--body-md-medium mm-box--margin-right-4 mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-1/2 mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
type="secondary"
|
type="secondary"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-1/2 mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-1/2 mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
disabled=""
|
disabled=""
|
||||||
type="primary"
|
type="primary"
|
||||||
>
|
>
|
||||||
|
@ -31,7 +31,7 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo
|
|||||||
|
|
||||||
Security advice by
|
Security advice by
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://blockaid.io/"
|
href="https://blockaid.io/"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -77,7 +77,7 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp
|
|||||||
|
|
||||||
Security advice by
|
Security advice by
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://blockaid.io/"
|
href="https://blockaid.io/"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -162,7 +162,7 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = `
|
|||||||
|
|
||||||
Security advice by
|
Security advice by
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://blockaid.io/"
|
href="https://blockaid.io/"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Severity } from '../../../helpers/constants/design-system';
|
import { Severity } from '../../../helpers/constants/design-system';
|
||||||
import { ButtonLink, BUTTON_LINK_SIZES, Text } from '../../component-library';
|
import { ButtonLink, ButtonLinkSize, Text } from '../../component-library';
|
||||||
import { SecurityProvider } from '../../../../shared/constants/security-provider';
|
import { SecurityProvider } from '../../../../shared/constants/security-provider';
|
||||||
import SecurityProviderBannerAlert from './security-provider-banner-alert';
|
import SecurityProviderBannerAlert from './security-provider-banner-alert';
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ const mockPlainText =
|
|||||||
const MockDescriptionWithLinks = () => (
|
const MockDescriptionWithLinks = () => (
|
||||||
<>
|
<>
|
||||||
Description shouldn’t repeat title. 1-3 lines. Can contain a{' '}
|
Description shouldn’t repeat title. 1-3 lines. Can contain a{' '}
|
||||||
<ButtonLink size={BUTTON_LINK_SIZES.INHERIT}>hyperlink</ButtonLink>. It can
|
<ButtonLink size={ButtonLinkSize.Inherit}>hyperlink</ButtonLink>. It can
|
||||||
also contain a toggle to enable progressive disclosure.
|
also contain a toggle to enable progressive disclosure.
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -208,7 +208,7 @@ exports[`Signature Request Component render should match snapshot when we are us
|
|||||||
</h6>
|
</h6>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base signature-request-content__verify-contract-details mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base signature-request-content__verify-contract-details mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="verify-contract-details"
|
data-testid="verify-contract-details"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -766,7 +766,7 @@ exports[`Signature Request Component render should match snapshot when we are us
|
|||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base signature-request__reject-all-button mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base signature-request__reject-all-button mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="signature-request-reject-all"
|
data-testid="signature-request-reject-all"
|
||||||
>
|
>
|
||||||
Reject 2 requests
|
Reject 2 requests
|
||||||
@ -983,7 +983,7 @@ exports[`Signature Request Component render should match snapshot when we want t
|
|||||||
</h6>
|
</h6>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base signature-request-content__verify-contract-details mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base signature-request-content__verify-contract-details mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="verify-contract-details"
|
data-testid="verify-contract-details"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -1541,7 +1541,7 @@ exports[`Signature Request Component render should match snapshot when we want t
|
|||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base signature-request__reject-all-button mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base signature-request__reject-all-button mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="signature-request-reject-all"
|
data-testid="signature-request-reject-all"
|
||||||
>
|
>
|
||||||
Reject 2 requests
|
Reject 2 requests
|
||||||
|
@ -6,10 +6,10 @@ import Popover from '../../../ui/popover';
|
|||||||
import {
|
import {
|
||||||
AvatarIcon,
|
AvatarIcon,
|
||||||
Button,
|
Button,
|
||||||
BUTTON_LINK_SIZES,
|
|
||||||
BUTTON_SIZES,
|
BUTTON_SIZES,
|
||||||
BUTTON_VARIANT,
|
BUTTON_VARIANT,
|
||||||
ButtonLink,
|
ButtonLink,
|
||||||
|
ButtonLinkSize,
|
||||||
IconName,
|
IconName,
|
||||||
IconSize,
|
IconSize,
|
||||||
Text,
|
Text,
|
||||||
@ -79,7 +79,7 @@ export default function SnapPrivacyWarning({ onAccepted, onCanceled }) {
|
|||||||
{t('snapsPrivacyWarningFirstMessage', [
|
{t('snapsPrivacyWarningFirstMessage', [
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
key="privacyNoticeTermsOfUseLink"
|
key="privacyNoticeTermsOfUseLink"
|
||||||
size={BUTTON_LINK_SIZES.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
href={TERMS_OF_USE_LINK}
|
href={TERMS_OF_USE_LINK}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
BadgeWrapper,
|
BadgeWrapper,
|
||||||
Box,
|
Box,
|
||||||
ButtonLink,
|
ButtonLink,
|
||||||
BUTTON_LINK_SIZES,
|
ButtonLinkSize,
|
||||||
Text,
|
Text,
|
||||||
} from '..';
|
} from '..';
|
||||||
import README from './README.mdx';
|
import README from './README.mdx';
|
||||||
@ -98,14 +98,14 @@ export const SizeStory: StoryFn<typeof AvatarToken> = (args) => (
|
|||||||
<Text marginBottom={4}>
|
<Text marginBottom={4}>
|
||||||
Sizes with{' '}
|
Sizes with{' '}
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={BUTTON_LINK_SIZES.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
href="/docs/components-componentlibrary-buttonlink--default-story"
|
href="/docs/components-componentlibrary-buttonlink--default-story"
|
||||||
>
|
>
|
||||||
AvatarNetwork
|
AvatarNetwork
|
||||||
</ButtonLink>{' '}
|
</ButtonLink>{' '}
|
||||||
and{' '}
|
and{' '}
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={BUTTON_LINK_SIZES.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
href="/docs/components-componentlibrary-badgewrapper--default-story"
|
href="/docs/components-componentlibrary-badgewrapper--default-story"
|
||||||
>
|
>
|
||||||
BadgeWrapper
|
BadgeWrapper
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
exports[`ButtonBase should render anchor element correctly by href and externalLink, href target and rel exist 1`] = `
|
exports[`ButtonBase should render anchor element correctly by href and externalLink, href target and rel exist 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-pill"
|
||||||
data-testid="button-base"
|
data-testid="button-base"
|
||||||
href="https://www.test.com/"
|
href="https://www.test.com/"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
@ -17,7 +17,7 @@ exports[`ButtonBase should render anchor element correctly by href and externalL
|
|||||||
exports[`ButtonBase should render button element correctly and match snapshot 1`] = `
|
exports[`ButtonBase should render button element correctly and match snapshot 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-text-default mm-box--background-color-background-alternative mm-box--rounded-pill"
|
||||||
data-testid="button-base"
|
data-testid="button-base"
|
||||||
>
|
>
|
||||||
Button base
|
Button base
|
||||||
|
@ -58,6 +58,7 @@ export const ButtonBase: ButtonBaseComponent = React.forwardRef(
|
|||||||
{...(href && externalLink
|
{...(href && externalLink
|
||||||
? { target: '_blank', rel: 'noopener noreferrer' }
|
? { target: '_blank', rel: 'noopener noreferrer' }
|
||||||
: {})}
|
: {})}
|
||||||
|
padding={0}
|
||||||
paddingLeft={4}
|
paddingLeft={4}
|
||||||
paddingRight={4}
|
paddingRight={4}
|
||||||
ellipsis={ellipsis}
|
ellipsis={ellipsis}
|
||||||
|
@ -13,8 +13,6 @@ The `ButtonLink` is an extension of `ButtonBase` to support link styles
|
|||||||
|
|
||||||
## Props
|
## Props
|
||||||
|
|
||||||
The `ButtonLink` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) and [ButtonBase](/docs/components-componentlibrary-buttonbase--default-story#props) component props
|
|
||||||
|
|
||||||
<ArgsTable of={ButtonLink} />
|
<ArgsTable of={ButtonLink} />
|
||||||
|
|
||||||
The `ButtonLink` accepts all [ButtonBase](/docs/components-componentlibrary-buttonbase--default-story#props) component props
|
The `ButtonLink` accepts all [ButtonBase](/docs/components-componentlibrary-buttonbase--default-story#props) component props
|
||||||
@ -23,52 +21,49 @@ The `ButtonLink` accepts all [ButtonBase](/docs/components-componentlibrary-butt
|
|||||||
|
|
||||||
### Size
|
### Size
|
||||||
|
|
||||||
Use the `size` prop and the `Size` object from `./ui/helpers/constants/design-system.js` to change the size of `ButtonLink`. Defaults to `Size.auto`.
|
Use the `size` prop and the `ButtonLinkSize` enum from `./ui/components/component-library` to change the size of `ButtonLink`. Defaults to `ButtonLinkSize.Auto`
|
||||||
|
|
||||||
Optional: `BUTTON_LINK_SIZES` from `../../component-library` object can be used instead of `Size`
|
|
||||||
|
|
||||||
Possible sizes include:
|
Possible sizes include:
|
||||||
|
|
||||||
- `Size.auto` sets the height to auto but retains `ButtonLink` font-size
|
- `ButtonLinkSize.Auto` sets the height to auto but retains `ButtonLink` font-size
|
||||||
- `Size.SM` 32px
|
- `ButtonLinkSize.Sm` 32px
|
||||||
- `Size.MD` 40px
|
- `ButtonLinkSize.Md` 40px
|
||||||
- `Size.LG` 48px
|
- `ButtonLinkSize.Lg` 48px
|
||||||
- `Size.inherit` inherits the font-size of the parent element. Used for inline links in paragraphs.
|
- `ButtonLinkSize.Inherit` inherits the font-size of the parent element. Used for inline links in paragraphs.
|
||||||
|
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<Story id="components-componentlibrary-buttonlink--size-story" />
|
<Story id="components-componentlibrary-buttonlink--size-story" />
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import { Size } from '../../../helpers/constants/design-system';
|
import { ButtonLink, ButtonLinkSize, Text, TextVariant } from '../../component-library';
|
||||||
import { ButtonLink, Text, TextVariant } from '../../component-library';
|
|
||||||
|
|
||||||
<ButtonLink size={Size.auto}>
|
<ButtonLink size={ButtonLinkSize.Auto}>
|
||||||
Auto (default)
|
Auto (default)
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.SM}>
|
<ButtonLink size={ButtonLinkSize.Sm}>
|
||||||
Small
|
Small
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.MD}>
|
<ButtonLink size={ButtonLinkSize.Md}>
|
||||||
Medium
|
Medium
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.LG}>
|
<ButtonLink size={ButtonLinkSize.Lg}>
|
||||||
Large
|
Large
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
|
|
||||||
<Text variant={TextVariant.bodyLgMedium}>
|
<Text variant={TextVariant.bodyLgMedium}>
|
||||||
Inherits the font-size of the parent element. <ButtonLink size={Size.inherit}>Learn more</ButtonLink>
|
Inherits the font-size of the parent element. <ButtonLink size={ButtonLinkSize.Inherit}>Learn more</ButtonLink>
|
||||||
</Text>
|
</Text>
|
||||||
<Text variant={TextVariant.bodyMd}>
|
<Text variant={TextVariant.bodyMd}>
|
||||||
Inherits the font-size of the parent element. <ButtonLink size={Size.inherit}>Learn more</ButtonLink>
|
Inherits the font-size of the parent element. <ButtonLink size={ButtonLinkSize.Inherit}>Learn more</ButtonLink>
|
||||||
</Text>
|
</Text>
|
||||||
<Text variant={TextVariant.bodySm}>
|
<Text variant={TextVariant.bodySm}>
|
||||||
Inherits the font-size of the parent element. <ButtonLink size={Size.inherit}>Learn more</ButtonLink>
|
Inherits the font-size of the parent element. <ButtonLink size={ButtonLinkSize.Inherit}>Learn more</ButtonLink>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text variant={TextVariant.bodyXs}>
|
<Text variant={TextVariant.bodyXs}>
|
||||||
Inherits the font-size of the parent element and example with override for a success color.
|
Inherits the font-size of the parent element and example with override for a success color.
|
||||||
<ButtonLink size={Size.inherit}>Learn more</ButtonLink>
|
<ButtonLink size={ButtonLinkSize.Inherit}>Learn more</ButtonLink>
|
||||||
</Text>
|
</Text>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -121,28 +116,28 @@ import { ButtonLink } from '../../component-library';
|
|||||||
|
|
||||||
### Hit area
|
### Hit area
|
||||||
|
|
||||||
The default hit area for `ButtonLink` is the width of the text and height based on the `size` prop which is set to `Size.auto` by default. There may be times when you want to increase the hit area of the `ButtonLink`. To do this you can use the `Box` props `paddingLeft` and `paddingRight`. Or alternatively you can use the `block` prop which sets the width to 100%.
|
The default hit area for `ButtonLink` is the width of the text and height based on the `size` prop which is set to `ButtonLinkSize.Auto` by default. There may be times when you want to increase the hit area of the `ButtonLink`. To do this you can use the `Box` props `paddingLeft` and `paddingRight`. Or alternatively you can use the `block` prop which sets the width to 100%.
|
||||||
|
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<Story id="components-componentlibrary-buttonlink--hit-area" />
|
<Story id="components-componentlibrary-buttonlink--hit-area" />
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import { ButtonLink } from '../../component-library';
|
import { ButtonLink, ButtonLinkSize } from '../../component-library';
|
||||||
|
|
||||||
<ButtonLink paddingLeft={4} paddingRight={4}>
|
<ButtonLink paddingLeft={4} paddingRight={4}>
|
||||||
Auto (default)
|
Auto (default)
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.SM} paddingLeft={4} paddingRight={4}>
|
<ButtonLink size={ButtonLinkSize.Sm} paddingLeft={4} paddingRight={4}>
|
||||||
Small
|
Small
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.MD} paddingLeft={4} paddingRight={4}>
|
<ButtonLink size={ButtonLinkSize.Md} paddingLeft={4} paddingRight={4}>
|
||||||
Medium
|
Medium
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.LG} paddingLeft={4} paddingRight={4}>
|
<ButtonLink size={ButtonLinkSize.Lg} paddingLeft={4} paddingRight={4}>
|
||||||
Large
|
Large
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
<ButtonLink size={Size.LG} block>
|
<ButtonLink size={ButtonLinkSize.Lg} block>
|
||||||
Large block
|
Large block
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
```
|
```
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
exports[`ButtonLink should render button element correctly 1`] = `
|
exports[`ButtonLink should render button element correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="button-link"
|
data-testid="button-link"
|
||||||
>
|
>
|
||||||
Button Link
|
Button Link
|
@ -1,9 +0,0 @@
|
|||||||
import { Size } from '../../../helpers/constants/design-system';
|
|
||||||
|
|
||||||
export const BUTTON_LINK_SIZES = {
|
|
||||||
SM: Size.SM,
|
|
||||||
MD: Size.MD,
|
|
||||||
LG: Size.LG,
|
|
||||||
AUTO: Size.auto,
|
|
||||||
INHERIT: Size.inherit,
|
|
||||||
};
|
|
@ -1,70 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import classnames from 'classnames';
|
|
||||||
|
|
||||||
import { ButtonBase } from '../button-base';
|
|
||||||
import {
|
|
||||||
BackgroundColor,
|
|
||||||
Color,
|
|
||||||
Size,
|
|
||||||
} from '../../../helpers/constants/design-system';
|
|
||||||
import { BUTTON_LINK_SIZES } from './button-link.constants';
|
|
||||||
|
|
||||||
export const ButtonLink = ({
|
|
||||||
className,
|
|
||||||
danger,
|
|
||||||
disabled,
|
|
||||||
size = Size.auto,
|
|
||||||
...props
|
|
||||||
}) => {
|
|
||||||
return (
|
|
||||||
<ButtonBase
|
|
||||||
className={classnames(className, 'mm-button-link', {
|
|
||||||
'mm-button-link--type-danger': danger,
|
|
||||||
'mm-button-link--disabled': disabled,
|
|
||||||
'mm-button-link--size-inherit': size === BUTTON_LINK_SIZES.INHERIT,
|
|
||||||
'mm-button-link--size-auto': size === BUTTON_LINK_SIZES.AUTO,
|
|
||||||
})}
|
|
||||||
paddingLeft={0}
|
|
||||||
paddingRight={0}
|
|
||||||
size={size === BUTTON_LINK_SIZES.INHERIT ? null : size}
|
|
||||||
backgroundColor={BackgroundColor.transparent}
|
|
||||||
color={danger ? Color.errorDefault : Color.primaryDefault}
|
|
||||||
borderRadius={null}
|
|
||||||
startIconProps={{
|
|
||||||
size: size === BUTTON_LINK_SIZES.INHERIT ? Size.inherit : Size.SM,
|
|
||||||
}}
|
|
||||||
endIconProps={{
|
|
||||||
size: size === BUTTON_LINK_SIZES.INHERIT ? Size.inherit : Size.SM,
|
|
||||||
}}
|
|
||||||
iconLoadingProps={{
|
|
||||||
size: size === BUTTON_LINK_SIZES.INHERIT ? Size.inherit : Size.MD,
|
|
||||||
}}
|
|
||||||
{...{ disabled, ...props }}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
ButtonLink.propTypes = {
|
|
||||||
/**
|
|
||||||
* An additional className to apply to the ButtonLink.
|
|
||||||
*/
|
|
||||||
className: PropTypes.string,
|
|
||||||
/**
|
|
||||||
* Boolean to change button type to Danger when true
|
|
||||||
*/
|
|
||||||
danger: PropTypes.bool,
|
|
||||||
/**
|
|
||||||
* Boolean to disable button
|
|
||||||
*/
|
|
||||||
disabled: PropTypes.bool,
|
|
||||||
/**
|
|
||||||
* Possible size values: 'SIZES.AUTO'(auto), 'SIZES.SM'(32px), 'SIZES.MD'(40px), 'SIZES.LG'(48px), 'SIZES.INHERIT'(inherits parents font-size)
|
|
||||||
* Default value is 'SIZES.AUTO'.
|
|
||||||
*/
|
|
||||||
size: PropTypes.oneOf(Object.values(BUTTON_LINK_SIZES)),
|
|
||||||
/**
|
|
||||||
* ButtonLink accepts all the props from ButtonBase
|
|
||||||
*/
|
|
||||||
...ButtonBase.propTypes,
|
|
||||||
};
|
|
@ -16,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--type-danger {
|
&--type-danger:not(&--disabled) {
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--color-error-default);
|
color: var(--color-error-default);
|
||||||
}
|
}
|
||||||
@ -49,4 +49,8 @@
|
|||||||
text-decoration-thickness: auto;
|
text-decoration-thickness: auto;
|
||||||
text-underline-offset: 2px;
|
text-underline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--loading:hover:not(&--disabled) {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,256 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
AlignItems,
|
|
||||||
BorderColor,
|
|
||||||
BorderStyle,
|
|
||||||
DISPLAY,
|
|
||||||
Size,
|
|
||||||
TextVariant,
|
|
||||||
TextColor,
|
|
||||||
} from '../../../helpers/constants/design-system';
|
|
||||||
import Box from '../../ui/box/box';
|
|
||||||
import { IconName } from '..';
|
|
||||||
import { Text } from '../text';
|
|
||||||
import { ButtonLink } from './button-link';
|
|
||||||
import { BUTTON_LINK_SIZES } from './button-link.constants';
|
|
||||||
import README from './README.mdx';
|
|
||||||
|
|
||||||
const marginSizeControlOptions = [
|
|
||||||
undefined,
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
12,
|
|
||||||
'auto',
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Components/ComponentLibrary/ButtonLink',
|
|
||||||
|
|
||||||
component: ButtonLink,
|
|
||||||
parameters: {
|
|
||||||
docs: {
|
|
||||||
page: README,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
argTypes: {
|
|
||||||
as: {
|
|
||||||
control: 'select',
|
|
||||||
options: ['button', 'a'],
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
block: {
|
|
||||||
control: 'boolean',
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
children: {
|
|
||||||
control: 'text',
|
|
||||||
},
|
|
||||||
className: {
|
|
||||||
control: 'text',
|
|
||||||
},
|
|
||||||
danger: {
|
|
||||||
control: 'boolean',
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
control: 'boolean',
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
href: {
|
|
||||||
control: 'text',
|
|
||||||
},
|
|
||||||
externalLink: {
|
|
||||||
control: 'boolean',
|
|
||||||
},
|
|
||||||
startIconName: {
|
|
||||||
control: 'select',
|
|
||||||
options: Object.values(IconName),
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
endIconName: {
|
|
||||||
control: 'select',
|
|
||||||
options: Object.values(IconName),
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
startIconProps: {
|
|
||||||
control: 'object',
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
endIconProps: {
|
|
||||||
control: 'object',
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
loading: {
|
|
||||||
control: 'boolean',
|
|
||||||
table: { category: 'button base props' },
|
|
||||||
},
|
|
||||||
size: {
|
|
||||||
control: 'select',
|
|
||||||
options: Object.values(BUTTON_LINK_SIZES),
|
|
||||||
},
|
|
||||||
marginTop: {
|
|
||||||
options: marginSizeControlOptions,
|
|
||||||
control: 'select',
|
|
||||||
table: { category: 'box props' },
|
|
||||||
},
|
|
||||||
marginRight: {
|
|
||||||
options: marginSizeControlOptions,
|
|
||||||
control: 'select',
|
|
||||||
table: { category: 'box props' },
|
|
||||||
},
|
|
||||||
marginBottom: {
|
|
||||||
options: marginSizeControlOptions,
|
|
||||||
control: 'select',
|
|
||||||
table: { category: 'box props' },
|
|
||||||
},
|
|
||||||
marginLeft: {
|
|
||||||
options: marginSizeControlOptions,
|
|
||||||
control: 'select',
|
|
||||||
table: { category: 'box props' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
args: {
|
|
||||||
children: 'Button Link',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DefaultStory = (args) => <ButtonLink {...args} />;
|
|
||||||
|
|
||||||
DefaultStory.storyName = 'Default';
|
|
||||||
|
|
||||||
export const SizeStory = (args) => (
|
|
||||||
<>
|
|
||||||
<Box display={DISPLAY.FLEX} alignItems={AlignItems.flexStart} gap={4}>
|
|
||||||
<ButtonLink {...args} size={Size.auto}>
|
|
||||||
Auto (default)
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} size={Size.SM}>
|
|
||||||
Small
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} size={Size.MD}>
|
|
||||||
Medium
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} size={Size.LG}>
|
|
||||||
Large
|
|
||||||
</ButtonLink>
|
|
||||||
</Box>
|
|
||||||
<Text variant={TextVariant.bodyLgMedium}>
|
|
||||||
Inherits the font-size of the parent element.{' '}
|
|
||||||
<ButtonLink {...args} size={Size.inherit}>
|
|
||||||
Learn more
|
|
||||||
</ButtonLink>
|
|
||||||
</Text>
|
|
||||||
<Text variant={TextVariant.bodyMd}>
|
|
||||||
Inherits the font-size of the parent element.{' '}
|
|
||||||
<ButtonLink {...args} size={Size.inherit}>
|
|
||||||
Learn more
|
|
||||||
</ButtonLink>
|
|
||||||
</Text>
|
|
||||||
<Text variant={TextVariant.bodySm}>
|
|
||||||
Inherits the font-size of the parent element.{' '}
|
|
||||||
<ButtonLink {...args} size={Size.inherit}>
|
|
||||||
Learn more
|
|
||||||
</ButtonLink>
|
|
||||||
</Text>
|
|
||||||
<Text variant={TextVariant.bodyXs}>
|
|
||||||
Inherits the font-size of the parent element and example with override for
|
|
||||||
a success color.{' '}
|
|
||||||
<ButtonLink
|
|
||||||
{...args}
|
|
||||||
size={Size.inherit}
|
|
||||||
color={TextColor.successDefault}
|
|
||||||
>
|
|
||||||
Learn more
|
|
||||||
</ButtonLink>
|
|
||||||
</Text>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
SizeStory.storyName = 'Size';
|
|
||||||
|
|
||||||
export const Danger = (args) => (
|
|
||||||
<Box display={DISPLAY.FLEX} gap={4}>
|
|
||||||
<ButtonLink {...args}>Normal</ButtonLink>
|
|
||||||
{/* Test Anchor tag to match exactly as button */}
|
|
||||||
<ButtonLink as="a" {...args} href="#" danger>
|
|
||||||
Danger
|
|
||||||
</ButtonLink>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
|
|
||||||
export const Href = (args) => <ButtonLink {...args}>Href example</ButtonLink>;
|
|
||||||
|
|
||||||
Href.args = {
|
|
||||||
href: '/metamask',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const ExternalLink = (args) => (
|
|
||||||
<ButtonLink {...args}>Anchor element with external link</ButtonLink>
|
|
||||||
);
|
|
||||||
|
|
||||||
ExternalLink.args = {
|
|
||||||
href: 'https://metamask.io/',
|
|
||||||
externalLink: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const HitArea = (args) => (
|
|
||||||
<>
|
|
||||||
<Text marginBottom={4}>Default</Text>
|
|
||||||
<Box
|
|
||||||
display={DISPLAY.FLEX}
|
|
||||||
alignItems={AlignItems.flexStart}
|
|
||||||
gap={4}
|
|
||||||
marginBottom={4}
|
|
||||||
>
|
|
||||||
<ButtonLink {...args} size={Size.auto}>
|
|
||||||
Auto (default)
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} size={Size.SM}>
|
|
||||||
Small
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} size={Size.MD}>
|
|
||||||
Medium
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} size={Size.LG}>
|
|
||||||
Large
|
|
||||||
</ButtonLink>
|
|
||||||
</Box>
|
|
||||||
<Text marginBottom={4}>Add paddingLeft and paddingRight props</Text>
|
|
||||||
<Box
|
|
||||||
display={DISPLAY.FLEX}
|
|
||||||
alignItems={AlignItems.flexStart}
|
|
||||||
gap={4}
|
|
||||||
marginBottom={4}
|
|
||||||
>
|
|
||||||
<ButtonLink {...args} paddingLeft={4} paddingRight={4} size={Size.auto}>
|
|
||||||
Auto (default)
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} paddingLeft={4} paddingRight={4} size={Size.SM}>
|
|
||||||
Small
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} paddingLeft={4} paddingRight={4} size={Size.MD}>
|
|
||||||
Medium
|
|
||||||
</ButtonLink>
|
|
||||||
<ButtonLink {...args} paddingLeft={4} paddingRight={4} size={Size.LG}>
|
|
||||||
Large
|
|
||||||
</ButtonLink>
|
|
||||||
</Box>
|
|
||||||
<Text marginBottom={4}>Add block prop</Text>
|
|
||||||
<ButtonLink {...args} size={Size.LG} block>
|
|
||||||
Large block
|
|
||||||
</ButtonLink>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
|
|
||||||
HitArea.args = {
|
|
||||||
borderColor: BorderColor.errorDefault,
|
|
||||||
borderStyle: BorderStyle.dashed,
|
|
||||||
};
|
|
@ -0,0 +1,201 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { StoryFn, Meta } from '@storybook/react';
|
||||||
|
import {
|
||||||
|
AlignItems,
|
||||||
|
BorderColor,
|
||||||
|
BorderStyle,
|
||||||
|
Display,
|
||||||
|
TextVariant,
|
||||||
|
TextColor,
|
||||||
|
} from '../../../helpers/constants/design-system';
|
||||||
|
import { Box, Text } from '..';
|
||||||
|
import README from './README.mdx';
|
||||||
|
import { ButtonLink, ButtonLinkSize } from '.';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'Components/ComponentLibrary/ButtonLink',
|
||||||
|
component: ButtonLink,
|
||||||
|
parameters: {
|
||||||
|
docs: {
|
||||||
|
page: README,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
argTypes: {
|
||||||
|
as: {
|
||||||
|
control: 'select',
|
||||||
|
options: ['button', 'a'],
|
||||||
|
},
|
||||||
|
children: {
|
||||||
|
control: 'text',
|
||||||
|
},
|
||||||
|
className: {
|
||||||
|
control: 'text',
|
||||||
|
},
|
||||||
|
danger: {
|
||||||
|
control: 'boolean',
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
control: 'select',
|
||||||
|
options: Object.values(ButtonLinkSize),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
children: 'Button Link',
|
||||||
|
},
|
||||||
|
} as Meta<typeof ButtonLink>;
|
||||||
|
|
||||||
|
export const DefaultStory: StoryFn<typeof ButtonLink> = (args) => (
|
||||||
|
<ButtonLink {...args} />
|
||||||
|
);
|
||||||
|
|
||||||
|
DefaultStory.storyName = 'Default';
|
||||||
|
|
||||||
|
export const SizeStory: StoryFn<typeof ButtonLink> = (args) => (
|
||||||
|
<>
|
||||||
|
<Box display={Display.Flex} alignItems={AlignItems.flexStart} gap={4}>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Auto}>
|
||||||
|
Auto (default)
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Sm}>
|
||||||
|
Small
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Md}>
|
||||||
|
Medium
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Lg}>
|
||||||
|
Large
|
||||||
|
</ButtonLink>
|
||||||
|
</Box>
|
||||||
|
<Text variant={TextVariant.bodyLgMedium}>
|
||||||
|
Inherits the font-size of the parent element.{' '}
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Inherit}>
|
||||||
|
Learn more
|
||||||
|
</ButtonLink>
|
||||||
|
</Text>
|
||||||
|
<Text variant={TextVariant.bodyMd}>
|
||||||
|
Inherits the font-size of the parent element.{' '}
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Inherit}>
|
||||||
|
Learn more
|
||||||
|
</ButtonLink>
|
||||||
|
</Text>
|
||||||
|
<Text variant={TextVariant.bodySm}>
|
||||||
|
Inherits the font-size of the parent element.{' '}
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Inherit}>
|
||||||
|
Learn more
|
||||||
|
</ButtonLink>
|
||||||
|
</Text>
|
||||||
|
<Text variant={TextVariant.bodyXs}>
|
||||||
|
Inherits the font-size of the parent element and example with override for
|
||||||
|
a success color.{' '}
|
||||||
|
<ButtonLink
|
||||||
|
{...args}
|
||||||
|
size={ButtonLinkSize.Inherit}
|
||||||
|
color={TextColor.successDefault}
|
||||||
|
>
|
||||||
|
Learn more
|
||||||
|
</ButtonLink>
|
||||||
|
</Text>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
SizeStory.storyName = 'Size';
|
||||||
|
|
||||||
|
export const Danger: StoryFn<typeof ButtonLink> = (args) => (
|
||||||
|
<Box display={Display.Flex} gap={4}>
|
||||||
|
<ButtonLink {...args}>Normal</ButtonLink>
|
||||||
|
{/* Test Anchor tag to match exactly as button */}
|
||||||
|
<ButtonLink as="a" {...args} href="#" danger>
|
||||||
|
Danger
|
||||||
|
</ButtonLink>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
|
||||||
|
export const Href: StoryFn<typeof ButtonLink> = (args) => (
|
||||||
|
<ButtonLink {...args}>Href example</ButtonLink>
|
||||||
|
);
|
||||||
|
|
||||||
|
Href.args = {
|
||||||
|
href: '/metamask',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ExternalLink: StoryFn<typeof ButtonLink> = (args) => (
|
||||||
|
<ButtonLink {...args}>Anchor element with external link</ButtonLink>
|
||||||
|
);
|
||||||
|
|
||||||
|
ExternalLink.args = {
|
||||||
|
href: 'https://metamask.io/',
|
||||||
|
externalLink: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const HitArea: StoryFn<typeof ButtonLink> = (args) => (
|
||||||
|
<>
|
||||||
|
<Text marginBottom={4}>Default</Text>
|
||||||
|
<Box
|
||||||
|
display={Display.Flex}
|
||||||
|
alignItems={AlignItems.flexStart}
|
||||||
|
gap={4}
|
||||||
|
marginBottom={4}
|
||||||
|
>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Auto}>
|
||||||
|
Auto (default)
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Sm}>
|
||||||
|
Small
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Md}>
|
||||||
|
Medium
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Lg}>
|
||||||
|
Large
|
||||||
|
</ButtonLink>
|
||||||
|
</Box>
|
||||||
|
<Text marginBottom={4}>Add paddingLeft and paddingRight props</Text>
|
||||||
|
<Box
|
||||||
|
display={Display.Flex}
|
||||||
|
alignItems={AlignItems.flexStart}
|
||||||
|
gap={4}
|
||||||
|
marginBottom={4}
|
||||||
|
>
|
||||||
|
<ButtonLink
|
||||||
|
{...args}
|
||||||
|
paddingLeft={4}
|
||||||
|
paddingRight={4}
|
||||||
|
size={ButtonLinkSize.Auto}
|
||||||
|
>
|
||||||
|
Auto (default)
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink
|
||||||
|
{...args}
|
||||||
|
paddingLeft={4}
|
||||||
|
paddingRight={4}
|
||||||
|
size={ButtonLinkSize.Sm}
|
||||||
|
>
|
||||||
|
Small
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink
|
||||||
|
{...args}
|
||||||
|
paddingLeft={4}
|
||||||
|
paddingRight={4}
|
||||||
|
size={ButtonLinkSize.Md}
|
||||||
|
>
|
||||||
|
Medium
|
||||||
|
</ButtonLink>
|
||||||
|
<ButtonLink
|
||||||
|
{...args}
|
||||||
|
paddingLeft={4}
|
||||||
|
paddingRight={4}
|
||||||
|
size={ButtonLinkSize.Lg}
|
||||||
|
>
|
||||||
|
Large
|
||||||
|
</ButtonLink>
|
||||||
|
</Box>
|
||||||
|
<Text marginBottom={4}>Add block prop</Text>
|
||||||
|
<ButtonLink {...args} size={ButtonLinkSize.Lg} block>
|
||||||
|
Large block
|
||||||
|
</ButtonLink>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
HitArea.args = {
|
||||||
|
borderColor: BorderColor.errorDefault,
|
||||||
|
borderStyle: BorderStyle.dashed,
|
||||||
|
};
|
@ -1,10 +1,8 @@
|
|||||||
/* eslint-disable jest/require-top-level-describe */
|
/* eslint-disable jest/require-top-level-describe */
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Size } from '../../../helpers/constants/design-system';
|
|
||||||
import { IconName } from '..';
|
import { IconName } from '..';
|
||||||
import { ButtonLink } from './button-link';
|
import { ButtonLink, ButtonLinkSize } from '.';
|
||||||
import { BUTTON_LINK_SIZES } from './button-link.constants';
|
|
||||||
|
|
||||||
describe('ButtonLink', () => {
|
describe('ButtonLink', () => {
|
||||||
it('should render button element correctly', () => {
|
it('should render button element correctly', () => {
|
||||||
@ -41,22 +39,28 @@ describe('ButtonLink', () => {
|
|||||||
it('should render with different size classes', () => {
|
it('should render with different size classes', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
<>
|
<>
|
||||||
<ButtonLink size={Size.SM} data-testid={Size.SM} />
|
<ButtonLink size={ButtonLinkSize.Sm} data-testid={ButtonLinkSize.Sm} />
|
||||||
<ButtonLink size={Size.MD} data-testid={Size.MD} />
|
<ButtonLink size={ButtonLinkSize.Md} data-testid={ButtonLinkSize.Md} />
|
||||||
<ButtonLink size={Size.LG} data-testid={Size.LG} />
|
<ButtonLink size={ButtonLinkSize.Lg} data-testid={ButtonLinkSize.Lg} />
|
||||||
</>,
|
</>,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(getByTestId(Size.SM)).toHaveClass(`mm-button-base--size-${Size.SM}`);
|
expect(getByTestId(ButtonLinkSize.Sm)).toHaveClass(
|
||||||
expect(getByTestId(Size.MD)).toHaveClass(`mm-button-base--size-${Size.MD}`);
|
`mm-button-base--size-${ButtonLinkSize.Sm}`,
|
||||||
expect(getByTestId(Size.LG)).toHaveClass(`mm-button-base--size-${Size.LG}`);
|
);
|
||||||
|
expect(getByTestId(ButtonLinkSize.Md)).toHaveClass(
|
||||||
|
`mm-button-base--size-${ButtonLinkSize.Md}`,
|
||||||
|
);
|
||||||
|
expect(getByTestId(ButtonLinkSize.Lg)).toHaveClass(
|
||||||
|
`mm-button-base--size-${ButtonLinkSize.Lg}`,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render ButtonLink inherit size', () => {
|
it('should render ButtonLink inherit size', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
<ButtonLink size={BUTTON_LINK_SIZES.INHERIT} data-testid="inherit" />,
|
<ButtonLink size={ButtonLinkSize.Inherit} data-testid="inherit" />,
|
||||||
);
|
);
|
||||||
// Different size classname compared to Size.SM, Size.MD, Size.LG
|
// Different size classname compared to ButtonLinkSize.Sm, ButtonLinkSize.Md, ButtonLinkSize.Lg
|
||||||
expect(getByTestId('inherit')).toHaveClass(`mm-button-link--size-inherit`);
|
expect(getByTestId('inherit')).toHaveClass(`mm-button-link--size-inherit`);
|
||||||
});
|
});
|
||||||
|
|
59
ui/components/component-library/button-link/button-link.tsx
Normal file
59
ui/components/component-library/button-link/button-link.tsx
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
import { ButtonBase, IconSize } from '..';
|
||||||
|
import {
|
||||||
|
BackgroundColor,
|
||||||
|
Color,
|
||||||
|
} from '../../../helpers/constants/design-system';
|
||||||
|
import type { PolymorphicRef } from '../box';
|
||||||
|
import type { ButtonBaseProps } from '../button-base';
|
||||||
|
import type { ButtonLinkProps } from './button-link.types';
|
||||||
|
import { ButtonLinkSize, ButtonLinkComponent } from './button-link.types';
|
||||||
|
|
||||||
|
export const ButtonLink: ButtonLinkComponent = React.forwardRef(
|
||||||
|
<C extends React.ElementType = 'button' | 'a'>(
|
||||||
|
{
|
||||||
|
className,
|
||||||
|
color,
|
||||||
|
danger,
|
||||||
|
disabled,
|
||||||
|
loading,
|
||||||
|
size = ButtonLinkSize.Auto,
|
||||||
|
...props
|
||||||
|
}: ButtonLinkProps<C>,
|
||||||
|
ref?: PolymorphicRef<C>,
|
||||||
|
) => {
|
||||||
|
return (
|
||||||
|
<ButtonBase
|
||||||
|
className={classnames(className, 'mm-button-link', {
|
||||||
|
'mm-button-link--type-danger': danger,
|
||||||
|
'mm-button-link--disabled': disabled,
|
||||||
|
'mm-button-link--loading': loading,
|
||||||
|
'mm-button-link--size-inherit': size === ButtonLinkSize.Inherit,
|
||||||
|
'mm-button-link--size-auto': size === ButtonLinkSize.Auto,
|
||||||
|
})}
|
||||||
|
paddingLeft={0}
|
||||||
|
paddingRight={0}
|
||||||
|
size={size === ButtonLinkSize.Inherit ? null : size}
|
||||||
|
backgroundColor={BackgroundColor.transparent}
|
||||||
|
color={color || (danger ? Color.errorDefault : Color.primaryDefault)}
|
||||||
|
borderRadius={null}
|
||||||
|
startIconProps={{
|
||||||
|
size:
|
||||||
|
size === ButtonLinkSize.Inherit ? IconSize.Inherit : IconSize.Sm,
|
||||||
|
}}
|
||||||
|
endIconProps={{
|
||||||
|
size:
|
||||||
|
size === ButtonLinkSize.Inherit ? IconSize.Inherit : IconSize.Sm,
|
||||||
|
}}
|
||||||
|
iconLoadingProps={{
|
||||||
|
size:
|
||||||
|
size === ButtonLinkSize.Inherit ? IconSize.Inherit : IconSize.Md,
|
||||||
|
color: color || (danger ? Color.errorDefault : Color.primaryDefault),
|
||||||
|
}}
|
||||||
|
ref={ref}
|
||||||
|
{...{ disabled, loading, ...(props as ButtonBaseProps<C>) }}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
@ -0,0 +1,42 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import type { PolymorphicComponentPropWithRef } from '../box';
|
||||||
|
import type { ButtonBaseStyleUtilityProps } from '../button-base/button-base.types';
|
||||||
|
|
||||||
|
export enum ButtonLinkSize {
|
||||||
|
Auto = 'auto',
|
||||||
|
Sm = 'sm',
|
||||||
|
Md = 'md',
|
||||||
|
Lg = 'lg',
|
||||||
|
Inherit = 'inherit',
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ButtonLinkStyleUtilityProps
|
||||||
|
extends Omit<ButtonBaseStyleUtilityProps, 'size'> {
|
||||||
|
/**
|
||||||
|
* Boolean to change button type to Danger when true
|
||||||
|
*/
|
||||||
|
danger: boolean;
|
||||||
|
/**
|
||||||
|
* Boolean to disable button
|
||||||
|
*/
|
||||||
|
disabled: boolean;
|
||||||
|
/**
|
||||||
|
* Boolean to show loading spinner in button
|
||||||
|
*/
|
||||||
|
loading: boolean;
|
||||||
|
/**
|
||||||
|
* Possible size values: 'ButtonLinkSize.Auto'(auto), 'ButtonLinkSize.Sm'(32px), 'ButtonLinkSize.Md'(40px), 'ButtonLinkSize.Lg'(48px), 'ButtonLinkSize.Inherit'(inherits parents font-size)
|
||||||
|
* Default value is 'ButtonLinkSize.Auto'.
|
||||||
|
*/
|
||||||
|
size: ButtonLinkSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ButtonLinkProps<C extends React.ElementType> =
|
||||||
|
PolymorphicComponentPropWithRef<C, ButtonLinkStyleUtilityProps>;
|
||||||
|
|
||||||
|
export type ButtonLinkComponent = <
|
||||||
|
C extends React.ElementType = 'button' | 'a',
|
||||||
|
>(
|
||||||
|
props: ButtonLinkProps<C>,
|
||||||
|
) => React.ReactElement | null;
|
@ -1,2 +0,0 @@
|
|||||||
export { ButtonLink } from './button-link';
|
|
||||||
export { BUTTON_LINK_SIZES } from './button-link.constants';
|
|
3
ui/components/component-library/button-link/index.ts
Normal file
3
ui/components/component-library/button-link/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export { ButtonLink } from './button-link';
|
||||||
|
export { ButtonLinkSize } from './button-link.types';
|
||||||
|
export type { ButtonLinkProps } from './button-link.types';
|
@ -3,7 +3,7 @@
|
|||||||
exports[`ButtonPrimary should render button element correctly 1`] = `
|
exports[`ButtonPrimary should render button element correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="button-primary"
|
data-testid="button-primary"
|
||||||
>
|
>
|
||||||
Button Primary
|
Button Primary
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
exports[`ButtonSecondary should render button element correctly 1`] = `
|
exports[`ButtonSecondary should render button element correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
data-testid="button-secondary"
|
data-testid="button-secondary"
|
||||||
>
|
>
|
||||||
Button Secondary
|
Button Secondary
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
exports[`Button should render button element correctly 1`] = `
|
exports[`Button should render button element correctly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="button"
|
data-testid="button"
|
||||||
>
|
>
|
||||||
Button
|
Button
|
||||||
@ -14,19 +14,19 @@ exports[`Button should render button element correctly 1`] = `
|
|||||||
exports[`Button should render with different button types 1`] = `
|
exports[`Button should render with different button types 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="primary"
|
data-testid="primary"
|
||||||
>
|
>
|
||||||
Button
|
Button
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
data-testid="secondary"
|
data-testid="secondary"
|
||||||
>
|
>
|
||||||
Button
|
Button
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="link"
|
data-testid="link"
|
||||||
>
|
>
|
||||||
Button
|
Button
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
TextVariant,
|
TextVariant,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
import { IconName } from '..';
|
import { IconName } from '..';
|
||||||
import { BUTTON_LINK_SIZES } from '../button-link/button-link.constants';
|
import { ButtonLinkSize } from '../button-link';
|
||||||
import Box from '../../ui/box/box';
|
import Box from '../../ui/box/box';
|
||||||
import { Text } from '../text';
|
import { Text } from '../text';
|
||||||
import README from './README.mdx';
|
import README from './README.mdx';
|
||||||
@ -83,7 +83,7 @@ export default {
|
|||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
control: 'select',
|
control: 'select',
|
||||||
options: Object.values(BUTTON_LINK_SIZES),
|
options: Object.values(ButtonLinkSize),
|
||||||
},
|
},
|
||||||
variant: {
|
variant: {
|
||||||
options: Object.values(BUTTON_VARIANT),
|
options: Object.values(BUTTON_VARIANT),
|
||||||
|
@ -13,19 +13,20 @@ import {
|
|||||||
BackgroundColor,
|
BackgroundColor,
|
||||||
BorderColor,
|
BorderColor,
|
||||||
Color,
|
Color,
|
||||||
|
TextColor,
|
||||||
BorderRadius,
|
BorderRadius,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ButtonIcon,
|
ButtonIcon,
|
||||||
ButtonLink,
|
ButtonLink,
|
||||||
|
ButtonLinkSize,
|
||||||
Label,
|
Label,
|
||||||
Text,
|
Text,
|
||||||
TextField,
|
TextField,
|
||||||
TextFieldSearch,
|
TextFieldSearch,
|
||||||
TEXT_FIELD_SIZES,
|
TEXT_FIELD_SIZES,
|
||||||
ButtonIconSize,
|
ButtonIconSize,
|
||||||
BUTTON_LINK_SIZES,
|
|
||||||
Box,
|
Box,
|
||||||
} from '..';
|
} from '..';
|
||||||
|
|
||||||
@ -153,8 +154,8 @@ export const DefaultStory: StoryFn<typeof Icon> = (args) => {
|
|||||||
<Text>
|
<Text>
|
||||||
No matches. Please try again or ask in the{' '}
|
No matches. Please try again or ask in the{' '}
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={BUTTON_LINK_SIZES.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
color={Color.primaryDefault}
|
color={TextColor.primaryDefault}
|
||||||
href="https://consensys.slack.com/archives/C0354T27M5M"
|
href="https://consensys.slack.com/archives/C0354T27M5M"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
|
@ -18,7 +18,7 @@ export { Box } from './box';
|
|||||||
export { Button, BUTTON_VARIANT, BUTTON_SIZES } from './button';
|
export { Button, BUTTON_VARIANT, BUTTON_SIZES } from './button';
|
||||||
export { ButtonBase, ButtonBaseSize } from './button-base';
|
export { ButtonBase, ButtonBaseSize } from './button-base';
|
||||||
export { ButtonIcon, ButtonIconSize } from './button-icon';
|
export { ButtonIcon, ButtonIconSize } from './button-icon';
|
||||||
export { ButtonLink, BUTTON_LINK_SIZES } from './button-link';
|
export { ButtonLink, ButtonLinkSize } from './button-link';
|
||||||
export { ButtonPrimary, ButtonPrimarySize } from './button-primary';
|
export { ButtonPrimary, ButtonPrimarySize } from './button-primary';
|
||||||
export { ButtonSecondary, BUTTON_SECONDARY_SIZES } from './button-secondary';
|
export { ButtonSecondary, BUTTON_SECONDARY_SIZES } from './button-secondary';
|
||||||
export { Checkbox } from './checkbox';
|
export { Checkbox } from './checkbox';
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Button,
|
Button,
|
||||||
ButtonLink,
|
ButtonLink,
|
||||||
BUTTON_LINK_SIZES,
|
ButtonLinkSize,
|
||||||
TextFieldSearch,
|
TextFieldSearch,
|
||||||
IconName,
|
IconName,
|
||||||
} from '..';
|
} from '..';
|
||||||
@ -72,7 +72,7 @@ export default {
|
|||||||
const LoremIpsum = (props) => (
|
const LoremIpsum = (props) => (
|
||||||
<Text marginBottom={8} {...props}>
|
<Text marginBottom={8} {...props}>
|
||||||
Lorem ipsum dolor sit amet, conse{' '}
|
Lorem ipsum dolor sit amet, conse{' '}
|
||||||
<ButtonLink size={BUTTON_LINK_SIZES.INHERIT}>
|
<ButtonLink size={ButtonLinkSize.Inherit}>
|
||||||
random focusable button
|
random focusable button
|
||||||
</ButtonLink>{' '}
|
</ButtonLink>{' '}
|
||||||
ctetur adipiscing elit. Phasellus posuere nunc enim, quis efficitur dolor
|
ctetur adipiscing elit. Phasellus posuere nunc enim, quis efficitur dolor
|
||||||
@ -127,7 +127,7 @@ const Template: ComponentStory<typeof Modal> = (args) => {
|
|||||||
showLoremIpsum ? IconName.Arrow2Up : IconName.Arrow2Down
|
showLoremIpsum ? IconName.Arrow2Up : IconName.Arrow2Down
|
||||||
}
|
}
|
||||||
onClick={handleMoreContent}
|
onClick={handleMoreContent}
|
||||||
size={BUTTON_LINK_SIZES.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
marginBottom={2}
|
marginBottom={2}
|
||||||
>
|
>
|
||||||
{showMoreModalContent ? 'Hide' : 'Show more'}
|
{showMoreModalContent ? 'Hide' : 'Show more'}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
exports[`AccountPicker renders properly 1`] = `
|
exports[`AccountPicker renders properly 1`] = `
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-base--ellipsis multichain-account-picker mm-button-primary mm-text--body-md-medium mm-text--ellipsis mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-transparent mm-box--rounded-lg"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-base--ellipsis multichain-account-picker mm-button-primary mm-text--body-md-medium mm-text--ellipsis mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-transparent mm-box--rounded-lg"
|
||||||
data-testid="account-menu-icon"
|
data-testid="account-menu-icon"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -228,7 +228,7 @@ exports[`App Header should match snapshot 1`] = `
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-base--ellipsis multichain-account-picker mm-button-primary mm-text--body-md-medium mm-text--ellipsis mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-transparent mm-box--rounded-lg"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-base--ellipsis multichain-account-picker mm-button-primary mm-text--body-md-medium mm-text--ellipsis mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-transparent mm-box--rounded-lg"
|
||||||
data-testid="account-menu-icon"
|
data-testid="account-menu-icon"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -17,7 +17,7 @@ exports[`DetectedTokensBanner should render correctly 1`] = `
|
|||||||
3 new tokens found in this account
|
3 new tokens found in this account
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Import tokens
|
Import tokens
|
||||||
</button>
|
</button>
|
||||||
|
@ -7,7 +7,7 @@ exports[`Json should match snapshot 1`] = `
|
|||||||
>
|
>
|
||||||
Used by a variety of different clients
|
Used by a variety of different clients
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://metamask.zendesk.com/hc/en-us/articles/360015289932"
|
href="https://metamask.zendesk.com/hc/en-us/articles/360015289932"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -43,12 +43,12 @@ exports[`Json should match snapshot 1`] = `
|
|||||||
class="mm-box mm-box--display-flex mm-box--gap-4"
|
class="mm-box mm-box--display-flex mm-box--gap-4"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-base--block mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-base--block mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="import-account-confirm-button"
|
data-testid="import-account-confirm-button"
|
||||||
disabled=""
|
disabled=""
|
||||||
>
|
>
|
||||||
|
@ -9,7 +9,7 @@ exports[`Import Token Link should match snapshot for goerli chainId 1`] = `
|
|||||||
class="mm-box mm-box--display-flex mm-box--align-items-center"
|
class="mm-box mm-box--display-flex mm-box--align-items-center"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="import-token-button"
|
data-testid="import-token-button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -23,7 +23,7 @@ exports[`Import Token Link should match snapshot for goerli chainId 1`] = `
|
|||||||
class="mm-box mm-box--padding-top-2 mm-box--display-flex mm-box--align-items-center"
|
class="mm-box mm-box--padding-top-2 mm-box--display-flex mm-box--align-items-center"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="refresh-list-button"
|
data-testid="refresh-list-button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -46,7 +46,7 @@ exports[`Import Token Link should match snapshot for mainnet chainId 1`] = `
|
|||||||
class="mm-box mm-box--display-flex mm-box--align-items-center"
|
class="mm-box mm-box--display-flex mm-box--align-items-center"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="import-token-button"
|
data-testid="import-token-button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
@ -60,7 +60,7 @@ exports[`Import Token Link should match snapshot for mainnet chainId 1`] = `
|
|||||||
class="mm-box mm-box--padding-top-2 mm-box--display-flex mm-box--align-items-center"
|
class="mm-box mm-box--padding-top-2 mm-box--display-flex mm-box--align-items-center"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-link mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="refresh-list-button"
|
data-testid="refresh-list-button"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -140,7 +140,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr
|
|||||||
Nonce
|
Nonce
|
||||||
</h6>
|
</h6>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
@ -325,7 +325,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr
|
|||||||
Nonce
|
Nonce
|
||||||
</h6>
|
</h6>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
@ -510,7 +510,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr
|
|||||||
Nonce
|
Nonce
|
||||||
</h6>
|
</h6>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
@ -695,7 +695,7 @@ exports[`ConfirmApproveContent Component should render Confirm approve page corr
|
|||||||
Nonce
|
Nonce
|
||||||
</h6>
|
</h6>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-left-3 mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Edit
|
Edit
|
||||||
</button>
|
</button>
|
||||||
|
@ -207,7 +207,7 @@ exports[`Confirm Signature Request Component render should match snapshot 1`] =
|
|||||||
</h6>
|
</h6>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base signature-request-content__verify-contract-details mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base signature-request-content__verify-contract-details mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="verify-contract-details"
|
data-testid="verify-contract-details"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
@ -112,7 +112,7 @@ exports[`ConnectHardwareForm should match snapshot 1`] = `
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled hw-connect__connect-btn mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled hw-connect__connect-btn mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
disabled=""
|
disabled=""
|
||||||
>
|
>
|
||||||
Continue
|
Continue
|
||||||
|
@ -156,7 +156,7 @@ exports[`Desktop Pairing page should render otp component 1`] = `
|
|||||||
class="box box--flex-direction-row"
|
class="box box--flex-direction-row"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
>
|
>
|
||||||
Done
|
Done
|
||||||
</button>
|
</button>
|
||||||
|
@ -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"
|
class="mm-box mm-text custody-account-list__item mm-text--body-md mm-box--display-flex mm-box--color-text-default"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://etherscan.io/address/0x1234567890123456789012345678901234567890"
|
href="https://etherscan.io/address/0x1234567890123456789012345678901234567890"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -121,7 +121,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"
|
class="mm-box mm-text custody-account-list__item mm-text--body-md mm-box--display-flex mm-box--color-text-default"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://etherscan.io/address/0x0987654321098765432109876543210987654321"
|
href="https://etherscan.io/address/0x0987654321098765432109876543210987654321"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -171,13 +171,13 @@ exports[`CustodyAccountList renders accounts 1`] = `
|
|||||||
class="mm-box mm-box--display-flex mm-box--gap-4"
|
class="mm-box mm-box--display-flex mm-box--gap-4"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block custody-account-list__button mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block custody-account-list__button mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
data-testid="custody-account-cancel-button"
|
data-testid="custody-account-cancel-button"
|
||||||
>
|
>
|
||||||
[cancel]
|
[cancel]
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-base--block custody-account-list__button mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-base--block custody-account-list__button mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="custody-account-connect-button"
|
data-testid="custody-account-connect-button"
|
||||||
disabled=""
|
disabled=""
|
||||||
>
|
>
|
||||||
|
@ -81,7 +81,7 @@ exports[`CustodyPage renders CustodyPage 2`] = `
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="custody-connect-button"
|
data-testid="custody-connect-button"
|
||||||
>
|
>
|
||||||
Select
|
Select
|
||||||
|
@ -95,12 +95,12 @@ exports[`Interactive Replacement Token Page should reject if there are errors 2`
|
|||||||
class="mm-box mm-box--display-flex mm-box--gap-4"
|
class="mm-box mm-box--display-flex mm-box--gap-4"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
>
|
>
|
||||||
Reject
|
Reject
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--block mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
>
|
>
|
||||||
displayName
|
displayName
|
||||||
</button>
|
</button>
|
||||||
|
@ -17,7 +17,7 @@ exports[`Reveal Seed Page should match snapshot 1`] = `
|
|||||||
|
|
||||||
The
|
The
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://metamask.zendesk.com/hc/en-us/articles/360060826432-What-is-a-Secret-Recovery-Phrase-and-how-to-keep-your-crypto-wallet-secure"
|
href="https://metamask.zendesk.com/hc/en-us/articles/360060826432-What-is-a-Secret-Recovery-Phrase-and-how-to-keep-your-crypto-wallet-secure"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -42,7 +42,7 @@ exports[`Reveal Seed Page should match snapshot 1`] = `
|
|||||||
|
|
||||||
MetaMask is a
|
MetaMask is a
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-inherit mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://metamask.zendesk.com/hc/en-us/articles/360059952212-MetaMask-is-a-non-custodial-wallet"
|
href="https://metamask.zendesk.com/hc/en-us/articles/360059952212-MetaMask-is-a-non-custodial-wallet"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -104,12 +104,12 @@ exports[`Reveal Seed Page should match snapshot 1`] = `
|
|||||||
class="box box--margin-top-auto box--display-flex box--gap-4 box--flex-direction-row"
|
class="box box--margin-top-auto box--display-flex box--gap-4 box--flex-direction-row"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-full mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-full mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-full mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-base--disabled mm-button-primary mm-button-primary--disabled mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--width-full mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
disabled=""
|
disabled=""
|
||||||
>
|
>
|
||||||
Next
|
Next
|
||||||
|
@ -12,7 +12,7 @@ exports[`SnapAccountDetails should take a snapshot 1`] = `
|
|||||||
class="mm-box mm-box--margin-bottom-4 mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
|
class="mm-box mm-box--margin-bottom-4 mm-box--display-flex mm-box--flex-direction-row mm-box--align-items-center"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-right-4 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--margin-right-4 mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
>
|
>
|
||||||
Create a Snap Account
|
Create a Snap Account
|
||||||
</button>
|
</button>
|
||||||
@ -42,7 +42,7 @@ exports[`SnapAccountDetails should take a snapshot 1`] = `
|
|||||||
class="mm-box"
|
class="mm-box"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
>
|
>
|
||||||
Install snap
|
Install snap
|
||||||
</button>
|
</button>
|
||||||
@ -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"
|
class="mm-box mm-text mm-text--body-md mm-box--color-text-default"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="auditUrl1"
|
href="auditUrl1"
|
||||||
>
|
>
|
||||||
auditUrl1
|
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"
|
class="mm-box mm-text mm-text--body-md mm-box--color-text-default"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="auditUrl2"
|
href="auditUrl2"
|
||||||
>
|
>
|
||||||
auditUrl2
|
auditUrl2
|
||||||
|
@ -24,7 +24,7 @@ exports[`SnapCard should render 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-secondary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md mm-button-secondary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent mm-box--rounded-pill mm-box--border-color-primary-default box--border-style-solid box--border-width-1"
|
||||||
data-testid="install-snap-button"
|
data-testid="install-snap-button"
|
||||||
>
|
>
|
||||||
Install
|
Install
|
||||||
|
@ -24,7 +24,7 @@ exports[`Security Tab should match snapshot 1`] = `
|
|||||||
class="settings-page__content-padded"
|
class="settings-page__content-padded"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-lg mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
data-testid="reveal-seed-words"
|
data-testid="reveal-seed-words"
|
||||||
type="danger"
|
type="danger"
|
||||||
>
|
>
|
||||||
@ -423,7 +423,7 @@ exports[`Security Tab should match snapshot 1`] = `
|
|||||||
class="settings-page__content-item-col"
|
class="settings-page__content-item-col"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-md settings-page__button mm-button-primary mm-text--body-md-medium mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
class="mm-box mm-text mm-button-base mm-button-base--size-md settings-page__button mm-button-primary mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-4 mm-box--padding-left-4 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-inverse mm-box--background-color-primary-default mm-box--rounded-pill"
|
||||||
type="secondary"
|
type="secondary"
|
||||||
>
|
>
|
||||||
Add custom network
|
Add custom network
|
||||||
|
@ -118,6 +118,7 @@ import {
|
|||||||
IconSize,
|
IconSize,
|
||||||
TextField,
|
TextField,
|
||||||
ButtonLink,
|
ButtonLink,
|
||||||
|
ButtonLinkSize,
|
||||||
Modal,
|
Modal,
|
||||||
ModalOverlay,
|
ModalOverlay,
|
||||||
ModalContent,
|
ModalContent,
|
||||||
@ -1054,7 +1055,7 @@ export default function PrepareSwapPage({
|
|||||||
</Text>
|
</Text>
|
||||||
{!verificationClicked && (
|
{!verificationClicked && (
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={Size.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
textProps={{
|
textProps={{
|
||||||
variant: TextVariant.bodyMd,
|
variant: TextVariant.bodyMd,
|
||||||
alignItems: AlignItems.flexStart,
|
alignItems: AlignItems.flexStart,
|
||||||
|
@ -7,7 +7,6 @@ import {
|
|||||||
DISPLAY,
|
DISPLAY,
|
||||||
AlignItems,
|
AlignItems,
|
||||||
SEVERITIES,
|
SEVERITIES,
|
||||||
Size,
|
|
||||||
TextVariant,
|
TextVariant,
|
||||||
BLOCK_SIZES,
|
BLOCK_SIZES,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
@ -15,6 +14,7 @@ import { GasRecommendations } from '../../../../shared/constants/gas';
|
|||||||
import {
|
import {
|
||||||
BannerAlert,
|
BannerAlert,
|
||||||
ButtonLink,
|
ButtonLink,
|
||||||
|
ButtonLinkSize,
|
||||||
Text,
|
Text,
|
||||||
} from '../../../components/component-library';
|
} from '../../../components/component-library';
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ export default function ViewQuotePriceDifference(props) {
|
|||||||
</Text>
|
</Text>
|
||||||
{!acknowledged && (
|
{!acknowledged && (
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={Size.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
textProps={{
|
textProps={{
|
||||||
variant: TextVariant.bodyMd,
|
variant: TextVariant.bodyMd,
|
||||||
alignItems: AlignItems.flexStart,
|
alignItems: AlignItems.flexStart,
|
||||||
|
@ -8,10 +8,13 @@ import Box from '../../../components/ui/box';
|
|||||||
import {
|
import {
|
||||||
AlignItems,
|
AlignItems,
|
||||||
SEVERITIES,
|
SEVERITIES,
|
||||||
Size,
|
|
||||||
TextVariant,
|
TextVariant,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
import { ButtonLink, Text } from '../../../components/component-library';
|
import {
|
||||||
|
ButtonLink,
|
||||||
|
ButtonLinkSize,
|
||||||
|
Text,
|
||||||
|
} from '../../../components/component-library';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
QUOTES_EXPIRED_ERROR,
|
QUOTES_EXPIRED_ERROR,
|
||||||
@ -42,7 +45,7 @@ export default function SwapsBannerAlert({ swapsErrorKey }) {
|
|||||||
{t('swapSlippageOverLimitDescription')}
|
{t('swapSlippageOverLimitDescription')}
|
||||||
</Text>
|
</Text>
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={Size.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
textProps={{
|
textProps={{
|
||||||
variant: TextVariant.bodyMd,
|
variant: TextVariant.bodyMd,
|
||||||
alignItems: AlignItems.flexStart,
|
alignItems: AlignItems.flexStart,
|
||||||
@ -83,7 +86,7 @@ export default function SwapsBannerAlert({ swapsErrorKey }) {
|
|||||||
{t('swapSlippageNegativeDescription')}
|
{t('swapSlippageNegativeDescription')}
|
||||||
</Text>
|
</Text>
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={Size.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
textProps={{
|
textProps={{
|
||||||
variant: TextVariant.bodyMd,
|
variant: TextVariant.bodyMd,
|
||||||
alignItems: AlignItems.flexStart,
|
alignItems: AlignItems.flexStart,
|
||||||
@ -106,7 +109,7 @@ export default function SwapsBannerAlert({ swapsErrorKey }) {
|
|||||||
{t('swapQuotesNotAvailableDescription')}
|
{t('swapQuotesNotAvailableDescription')}
|
||||||
</Text>
|
</Text>
|
||||||
<ButtonLink
|
<ButtonLink
|
||||||
size={Size.INHERIT}
|
size={ButtonLinkSize.Inherit}
|
||||||
textProps={{
|
textProps={{
|
||||||
variant: TextVariant.bodyMd,
|
variant: TextVariant.bodyMd,
|
||||||
alignItems: AlignItems.flexStart,
|
alignItems: AlignItems.flexStart,
|
||||||
|
@ -391,7 +391,7 @@ exports[`TokenAllowancePage should match snapshot 1`] = `
|
|||||||
value="7"
|
value="7"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-link mm-button-link--size-auto mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
data-testid="custom-spending-cap-max-button"
|
data-testid="custom-spending-cap-max-button"
|
||||||
>
|
>
|
||||||
Max
|
Max
|
||||||
@ -415,7 +415,7 @@ exports[`TokenAllowancePage should match snapshot 1`] = `
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-link mm-text--body-md-medium mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
class="mm-box mm-text mm-button-base mm-button-base--size-sm mm-button-link mm-text--body-md-medium mm-box--padding-0 mm-box--padding-right-0 mm-box--padding-left-0 mm-box--display-inline-flex mm-box--justify-content-center mm-box--align-items-center mm-box--color-primary-default mm-box--background-color-transparent"
|
||||||
href="https://support.metamask.io/hc/en-us/articles/6055177143579-How-to-customize-token-approvals-with-a-spending-cap"
|
href="https://support.metamask.io/hc/en-us/articles/6055177143579-How-to-customize-token-approvals-with-a-spending-cap"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
Loading…
Reference in New Issue
Block a user