From 7705d692845b7a0008d2d2d4afa47dc0fec46b7d Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Thu, 17 Nov 2022 08:05:56 -0500 Subject: [PATCH 1/3] [polaris.shopify.com] Fix TextStyle mapping for `variation="strong"` --- polaris.shopify.com/content/components/text-style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polaris.shopify.com/content/components/text-style.md b/polaris.shopify.com/content/components/text-style.md index 1f17f83c8c4..16f48f2157c 100644 --- a/polaris.shopify.com/content/components/text-style.md +++ b/polaris.shopify.com/content/components/text-style.md @@ -37,7 +37,7 @@ status: ```diff - No supplier listed -+ No supplier listed ++ No supplier listed ``` ### Positive From 39c26360983a0f16ec30a62821e0ee4fb56bca76 Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Thu, 17 Nov 2022 08:06:27 -0500 Subject: [PATCH 2/3] Fix migration to replace TextStyle `variation="strong"` with `fontWeight="semibold"` --- .../react-replace-text-components/steps/replace-text-style.ts | 2 +- .../tests/react-replace-text-components.output.tsx | 2 +- .../tests/with-relative.output.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/polaris-migrator/src/migrations/react-replace-text-components/steps/replace-text-style.ts b/polaris-migrator/src/migrations/react-replace-text-components/steps/replace-text-style.ts index 2e4e4ff33ea..11f45ec1e23 100644 --- a/polaris-migrator/src/migrations/react-replace-text-components/steps/replace-text-style.ts +++ b/polaris-migrator/src/migrations/react-replace-text-components/steps/replace-text-style.ts @@ -22,7 +22,7 @@ import type {MigrationOptions} from '../react-replace-text-components'; import {POLARIS_MIGRATOR_COMMENT} from '../../../constants'; const variationMap = { - strong: {fontWeight: 'bold'}, + strong: {fontWeight: 'semibold'}, subdued: {color: 'subdued'}, positive: {color: 'success'}, negative: {color: 'critical'}, diff --git a/polaris-migrator/src/migrations/react-replace-text-components/tests/react-replace-text-components.output.tsx b/polaris-migrator/src/migrations/react-replace-text-components/tests/react-replace-text-components.output.tsx index 31df9d31999..da0bc6e6b15 100644 --- a/polaris-migrator/src/migrations/react-replace-text-components/tests/react-replace-text-components.output.tsx +++ b/polaris-migrator/src/migrations/react-replace-text-components/tests/react-replace-text-components.output.tsx @@ -44,7 +44,7 @@ export function App() { Caption - + Strong diff --git a/polaris-migrator/src/migrations/react-replace-text-components/tests/with-relative.output.tsx b/polaris-migrator/src/migrations/react-replace-text-components/tests/with-relative.output.tsx index 29018d47961..9349f673510 100644 --- a/polaris-migrator/src/migrations/react-replace-text-components/tests/with-relative.output.tsx +++ b/polaris-migrator/src/migrations/react-replace-text-components/tests/with-relative.output.tsx @@ -34,7 +34,7 @@ export function App() { Caption - + Strong From edb179a4c575a7b10cdd8b2a89cc710271c0e89d Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Thu, 17 Nov 2022 08:07:27 -0500 Subject: [PATCH 3/3] Add changeset --- .changeset/tiny-ravens-sing.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/tiny-ravens-sing.md diff --git a/.changeset/tiny-ravens-sing.md b/.changeset/tiny-ravens-sing.md new file mode 100644 index 00000000000..d5c2c312a19 --- /dev/null +++ b/.changeset/tiny-ravens-sing.md @@ -0,0 +1,6 @@ +--- +'@shopify/polaris-migrator': patch +'polaris.shopify.com': patch +--- + +Fixed mapping for `TextStyle` `variation="strong"` to use `Text` `fontWeight="semibold"` instead of `fontWeight="bold"`