From 56463fa837b69b80a12c1800425fbe42417a330f Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Thu, 28 Sep 2023 19:04:53 -0400 Subject: [PATCH 1/3] [Text] Remove `headingXs` and `heading4xl` types on `variant` prop --- polaris-react/src/components/Text/Text.scss | 9 --------- polaris-react/src/components/Text/Text.tsx | 2 -- 2 files changed, 11 deletions(-) diff --git a/polaris-react/src/components/Text/Text.scss b/polaris-react/src/components/Text/Text.scss index b08f33bd69c..1fa0888f7ca 100644 --- a/polaris-react/src/components/Text/Text.scss +++ b/polaris-react/src/components/Text/Text.scss @@ -61,11 +61,6 @@ line-height: var(--p-text-heading-sm-font-line-height); } -.headingXs { - font-weight: var(--p-font-weight-semibold); - @include _headingSm; -} - .headingSm { font-weight: var(--p-text-heading-sm-font-weight); @include _headingSm; @@ -125,10 +120,6 @@ @include _heading3xl; } -.heading4xl { - @include _heading3xl; -} - .bodySm { font-size: var(--p-text-body-sm-font-size); font-weight: var(--p-text-body-sm-font-weight); diff --git a/polaris-react/src/components/Text/Text.tsx b/polaris-react/src/components/Text/Text.tsx index 8f90e22c9f1..feb6f8c38a6 100644 --- a/polaris-react/src/components/Text/Text.tsx +++ b/polaris-react/src/components/Text/Text.tsx @@ -20,14 +20,12 @@ type Element = | 'legend'; type Variant = - | 'headingXs' | 'headingSm' | 'headingMd' | 'headingLg' | 'headingXl' | 'heading2xl' | 'heading3xl' - | 'heading4xl' | 'bodySm' | 'bodyMd' | 'bodyLg'; From beeaea0b97c47844a31b4ab8ea00231f2017a369 Mon Sep 17 00:00:00 2001 From: Lo Kim Date: Thu, 28 Sep 2023 19:05:54 -0400 Subject: [PATCH 2/3] Manually migrate `Text` variant `headingXs` to `headingSm` --- .../src/components/Avatar/Avatar.stories.tsx | 14 +++++++------- .../src/components/Badge/Badge.stories.tsx | 8 ++++---- .../src/components/Divider/Divider.stories.tsx | 8 ++++---- .../Listbox/components/Header/Header.tsx | 2 +- .../components/Header/tests/Header.test.tsx | 2 +- .../src/components/OptionList/OptionList.tsx | 2 +- .../RangeSlider/components/DualThumb/DualThumb.tsx | 4 ++-- .../components/SingleThumb/SingleThumb.tsx | 2 +- .../src/components/Sheet/Sheet.stories.tsx | 2 +- polaris-react/src/components/Text/Text.stories.tsx | 3 --- .../content/components/deprecated/subheading.md | 2 +- .../content/components/typography/text.md | 3 +-- polaris.shopify.com/content/design/typography.md | 4 ++-- .../pages/examples/divider-with-border-color.tsx | 8 ++++---- .../legacy-card-with-custom-react-node-title.tsx | 2 +- .../examples/sheet-with-searchable-listbox.tsx | 2 +- .../pages/examples/text-heading.tsx | 3 --- 17 files changed, 32 insertions(+), 39 deletions(-) diff --git a/polaris-react/src/components/Avatar/Avatar.stories.tsx b/polaris-react/src/components/Avatar/Avatar.stories.tsx index 8c34070dc60..402150552f4 100644 --- a/polaris-react/src/components/Avatar/Avatar.stories.tsx +++ b/polaris-react/src/components/Avatar/Avatar.stories.tsx @@ -64,7 +64,7 @@ export function All() { - + Default @@ -74,7 +74,7 @@ export function All() { - + With customer @@ -84,7 +84,7 @@ export function All() { - + With image @@ -92,25 +92,25 @@ export function All() { - + With icon (all styles) - + With default initials (all styles) - + With long initials (all styles) - + With long and wide initials diff --git a/polaris-react/src/components/Badge/Badge.stories.tsx b/polaris-react/src/components/Badge/Badge.stories.tsx index bf3b8fc726e..297371bd60c 100644 --- a/polaris-react/src/components/Badge/Badge.stories.tsx +++ b/polaris-react/src/components/Badge/Badge.stories.tsx @@ -139,7 +139,7 @@ export function All() { Size: {sizeLabel} - + Tone only @@ -155,7 +155,7 @@ export function All() { - + Tone with progress {progressEntries.map(([progress]) => ( @@ -176,7 +176,7 @@ export function All() { {/* Remove `size` condition when micro icons are available */} {size === 'large' && ( - + Tone with icon @@ -195,7 +195,7 @@ export function All() { )} {/* TODO: Re-enable the following examples when designs are available (post se23) */} {/* - + Tone with icon only diff --git a/polaris-react/src/components/Divider/Divider.stories.tsx b/polaris-react/src/components/Divider/Divider.stories.tsx index 9d608e78642..2fae94e32ff 100644 --- a/polaris-react/src/components/Divider/Divider.stories.tsx +++ b/polaris-react/src/components/Divider/Divider.stories.tsx @@ -13,19 +13,19 @@ export function Default() { export function WithBorderStyles() { return ( - + Default - + Border - + Border inverse - + Transparent diff --git a/polaris-react/src/components/Listbox/components/Header/Header.tsx b/polaris-react/src/components/Listbox/components/Header/Header.tsx index 41049db27c3..6168e361ca8 100644 --- a/polaris-react/src/components/Listbox/components/Header/Header.tsx +++ b/polaris-react/src/components/Listbox/components/Header/Header.tsx @@ -20,7 +20,7 @@ export function Header({children}: HeaderProps) { paddingBlockEnd="200" paddingInlineEnd="400" > - + {children} diff --git a/polaris-react/src/components/Listbox/components/Header/tests/Header.test.tsx b/polaris-react/src/components/Listbox/components/Header/tests/Header.test.tsx index 9cf3b0f1b0a..4bd74722425 100644 --- a/polaris-react/src/components/Listbox/components/Header/tests/Header.test.tsx +++ b/polaris-react/src/components/Listbox/components/Header/tests/Header.test.tsx @@ -28,7 +28,7 @@ describe('Header', () => { expect(header).toContainReactComponent(Box); expect(header.find(Box)).toContainReactComponent(Text, { as: 'span', - variant: 'headingXs', + variant: 'headingSm', tone: 'subdued', }); }); diff --git a/polaris-react/src/components/OptionList/OptionList.tsx b/polaris-react/src/components/OptionList/OptionList.tsx index 859fc7f8c89..c4b2b153424 100644 --- a/polaris-react/src/components/OptionList/OptionList.tsx +++ b/polaris-react/src/components/OptionList/OptionList.tsx @@ -130,7 +130,7 @@ export function OptionList({ paddingInlineEnd="150" borderColor="border-subdued" > - + {title} diff --git a/polaris-react/src/components/RangeSlider/components/DualThumb/DualThumb.tsx b/polaris-react/src/components/RangeSlider/components/DualThumb/DualThumb.tsx index d192986f30c..53741f76a83 100644 --- a/polaris-react/src/components/RangeSlider/components/DualThumb/DualThumb.tsx +++ b/polaris-react/src/components/RangeSlider/components/DualThumb/DualThumb.tsx @@ -190,7 +190,7 @@ export class DualThumb extends Component { }} >
- + {value[0]}
@@ -208,7 +208,7 @@ export class DualThumb extends Component { }} >
- + {value[1]}
diff --git a/polaris-react/src/components/RangeSlider/components/SingleThumb/SingleThumb.tsx b/polaris-react/src/components/RangeSlider/components/SingleThumb/SingleThumb.tsx index 57bd7097b58..28b777f881c 100644 --- a/polaris-react/src/components/RangeSlider/components/SingleThumb/SingleThumb.tsx +++ b/polaris-react/src/components/RangeSlider/components/SingleThumb/SingleThumb.tsx @@ -66,7 +66,7 @@ export function SingleThumb(props: SingleThumbProps) { const outputMarkup = !disabled && output && (
- + {clampedValue}
diff --git a/polaris-react/src/components/Sheet/Sheet.stories.tsx b/polaris-react/src/components/Sheet/Sheet.stories.tsx index 5239fa0281e..16515063dc3 100644 --- a/polaris-react/src/components/Sheet/Sheet.stories.tsx +++ b/polaris-react/src/components/Sheet/Sheet.stories.tsx @@ -470,7 +470,7 @@ export function WithSearchableListbox() { marginBottom: 'var(--p-space-200)', }} > - + Action