diff --git a/.storybook/3.COLORS.stories.mdx b/.storybook/3.COLORS.stories.mdx index fce6ef662..c7a379d53 100644 --- a/.storybook/3.COLORS.stories.mdx +++ b/.storybook/3.COLORS.stories.mdx @@ -50,7 +50,13 @@ Theme colors are color agnostic, semantically neutral and theme compatible desig ```css /** Backgrounds */ var(--color-background-default) +var(--color-background-default-hover) +var(--color-background-default-pressed) var(--color-background-alternative) +var(--color-background-alternative-hover) +var(--color-background-alternative-pressed) +var(--color-background-hover) +var(--color-background-pressed) /** Text */ var(--color-text-default) diff --git a/package.json b/package.json index 123d68999..eb8e18f1b 100644 --- a/package.json +++ b/package.json @@ -230,7 +230,7 @@ "@metamask/browser-passworder": "^4.1.0", "@metamask/contract-metadata": "^2.3.1", "@metamask/controller-utils": "^4.0.1", - "@metamask/design-tokens": "^1.9.0", + "@metamask/design-tokens": "^1.12.0", "@metamask/desktop": "^0.3.0", "@metamask/eth-json-rpc-middleware": "^11.0.0", "@metamask/eth-keyring-controller": "^10.0.1", diff --git a/ui/components/component-library/button-base/button-base.js b/ui/components/component-library/button-base/button-base.js index 21a9e681d..5d38c3d57 100644 --- a/ui/components/component-library/button-base/button-base.js +++ b/ui/components/component-library/button-base/button-base.js @@ -8,7 +8,7 @@ import { Text } from '../text'; import { AlignItems, - DISPLAY, + Display, JustifyContent, TextColor, TextVariant, @@ -65,7 +65,7 @@ export const ButtonBase = ({ className, )} disabled={disabled} - display={DISPLAY.INLINE_FLEX} + display={Display.InlineFlex} justifyContent={JustifyContent.center} alignItems={AlignItems.center} borderRadius={BorderRadius.pill} diff --git a/ui/components/component-library/text/README.mdx b/ui/components/component-library/text/README.mdx index 6d4fd47a8..986673039 100644 --- a/ui/components/component-library/text/README.mdx +++ b/ui/components/component-library/text/README.mdx @@ -31,9 +31,12 @@ Use the `variant` prop and the `TextVariant` enum from `./ui/helpers/constants/d - TextVariant.bodyLgMedium (default renders as `p` tag) - TextVariant.bodyMd (default renders as `p` tag) - TextVariant.bodyMdBold (default renders as `p` tag) +- TextVariant.bodyMdMedium (default renders as `p` tag) - TextVariant.bodySm (default renders as `p` tag) +- TextVariant.bodySmMedium (default renders as `p` tag) - TextVariant.bodySmBold (default renders as `p` tag) - TextVariant.bodyXs (default renders as `p` tag) +- TextVariant.bodyXsMedium (default renders as `p` tag) - TextVariant.inherit (default renders as `span` tag) @@ -51,9 +54,12 @@ import { TextVariant } from '../../../helpers/constants/design-system'; body-lg-medium body-md body-md-bold +body-md-medium body-sm +body-sm-medium body-sm-bold body-xs +body-xs-medium inherit ``` diff --git a/ui/components/component-library/text/__snapshots__/text.test.tsx.snap b/ui/components/component-library/text/__snapshots__/text.test.tsx.snap index f9c068518..de0c46263 100644 --- a/ui/components/component-library/text/__snapshots__/text.test.tsx.snap +++ b/ui/components/component-library/text/__snapshots__/text.test.tsx.snap @@ -32,6 +32,11 @@ exports[`Text should render the Text with proper variant class name 1`] = ` > body-md

+

+ body-md-medium +

@@ -42,6 +47,11 @@ exports[`Text should render the Text with proper variant class name 1`] = ` > body-sm

+

+ body-sm-medium +

@@ -52,5 +62,10 @@ exports[`Text should render the Text with proper variant class name 1`] = ` > body-xs

+

+ body-xs-medium +

`; diff --git a/ui/components/component-library/text/text.scss b/ui/components/component-library/text/text.scss index 9726f7f2b..2185ea659 100644 --- a/ui/components/component-library/text/text.scss +++ b/ui/components/component-library/text/text.scss @@ -4,7 +4,7 @@ $text-variants: ( display: ("md"), heading: ( "sm", "md", "lg"), - body: ("xs", "sm", "sm-bold", "md", "md-bold", "lg-medium"), + body: ("xs", "xs-medium", "sm", "sm-medium", "sm-bold", "md", "md-medium", "md-bold", "lg-medium"), ); // Variable output mixin diff --git a/ui/components/component-library/text/text.test.tsx b/ui/components/component-library/text/text.test.tsx index 1a22db879..2de6ce764 100644 --- a/ui/components/component-library/text/text.test.tsx +++ b/ui/components/component-library/text/text.test.tsx @@ -76,10 +76,13 @@ describe('Text', () => { heading-sm body-lg-medium body-md + body-md-medium body-md-bold body-sm + body-sm-medium body-sm-bold body-xs + body-xs-medium , ); @@ -89,10 +92,13 @@ describe('Text', () => { expect(getByText('heading-sm')).toHaveClass('mm-text--heading-sm'); expect(getByText('body-lg-medium')).toHaveClass('mm-text--body-lg-medium'); expect(getByText('body-md')).toHaveClass('mm-text--body-md'); + expect(getByText('body-md-medium')).toHaveClass('mm-text--body-md-medium'); expect(getByText('body-md-bold')).toHaveClass('mm-text--body-md-bold'); expect(getByText('body-sm')).toHaveClass('mm-text--body-sm'); + expect(getByText('body-sm-medium')).toHaveClass('mm-text--body-sm-medium'); expect(getByText('body-sm-bold')).toHaveClass('mm-text--body-sm-bold'); expect(getByText('body-xs')).toHaveClass('mm-text--body-xs'); + expect(getByText('body-xs-medium')).toHaveClass('mm-text--body-xs-medium'); expect(container).toMatchSnapshot(); }); diff --git a/ui/components/component-library/text/text.types.ts b/ui/components/component-library/text/text.types.ts index 295c4de2c..c83a41ce7 100644 --- a/ui/components/component-library/text/text.types.ts +++ b/ui/components/component-library/text/text.types.ts @@ -86,9 +86,12 @@ export interface TextProps extends BoxProps { * `headingSm` large screen: 18px / small screen: 16px, * `bodyLgMedium` large screen: 18px / small screen: 16px, * `bodyMd` large screen: 16px / small screen: 14px, + * `bodyMdMedium` large screen: 16px / small screen: 14px, * `bodyMdBold` large screen: 16px / small screen: 14px, * `bodySm` large screen: 14px / small screen: 12px, + * `bodySmMedium` large screen: 14px / small screen: 12px, * `bodySmBold` large screen: 14px / small screen: 12px, + * `bodyXsMedium` large screen: 12px / small screen: 10px, * `bodyXs` large screen: 12px / small screen: 10px, * `inherit` */ diff --git a/ui/helpers/constants/design-system.ts b/ui/helpers/constants/design-system.ts index 18372b589..89530360a 100644 --- a/ui/helpers/constants/design-system.ts +++ b/ui/helpers/constants/design-system.ts @@ -187,10 +187,13 @@ export enum TextVariant { headingSm = 'heading-sm', bodyLgMedium = 'body-lg-medium', bodyMd = 'body-md', + bodyMdMedium = 'body-md-medium', bodyMdBold = 'body-md-bold', bodySm = 'body-sm', + bodySmMedium = 'body-sm-medium', bodySmBold = 'body-sm-bold', bodyXs = 'body-xs', + bodyXsMedium = 'body-xs-medium', inherit = 'inherit', } diff --git a/yarn.lock b/yarn.lock index 6c7da3567..7111efda5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4024,10 +4024,10 @@ __metadata: languageName: node linkType: hard -"@metamask/design-tokens@npm:^1.6.0, @metamask/design-tokens@npm:^1.9.0": - version: 1.11.1 - resolution: "@metamask/design-tokens@npm:1.11.1" - checksum: 38677f66167861826c35f7b0e6efc3c69269178e3dad5de41a9c9a7925dfb1f560f673e02a51acd7f7983762546130132f83dcaefe8ab47e16301775cff0b968 +"@metamask/design-tokens@npm:^1.12.0, @metamask/design-tokens@npm:^1.6.0": + version: 1.12.0 + resolution: "@metamask/design-tokens@npm:1.12.0" + checksum: 9b6c5485c846171aa7fcef03cbe93b4d94ffaa76faf953aa27a689fd3d494438cd657de6ea1aa5a40cc2af15dcf10f8dd860fd3d90f5e9806807e37020bdccd9 languageName: node linkType: hard @@ -24489,7 +24489,7 @@ __metadata: "@metamask/browser-passworder": ^4.1.0 "@metamask/contract-metadata": ^2.3.1 "@metamask/controller-utils": ^4.0.1 - "@metamask/design-tokens": ^1.9.0 + "@metamask/design-tokens": ^1.12.0 "@metamask/desktop": ^0.3.0 "@metamask/eslint-config": ^9.0.0 "@metamask/eslint-config-jest": ^9.0.0