From 6e5fff5ea091a6099ec2875ead6fed575f113dc3 Mon Sep 17 00:00:00 2001 From: Kyle Durand Date: Thu, 17 Aug 2023 08:03:08 -0400 Subject: [PATCH] Add variant prop to Layout.Section (#10041) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### WHY are these changes introduced? Fixes https://github.com/Shopify/polaris/issues/9982 ### WHAT is this pull request doing? Replaces boolean props on Layout.Section and replaces them with `variant` prop ### How to 🎩 --- .changeset/silly-ligers-heal.md | 5 +++ .../guides/migrating-from-v11-to-v12.md | 31 +++++++++++++++++++ polaris-react/playground/DetailsPage.tsx | 2 +- .../src/components/Layout/Layout.scss | 5 --- .../src/components/Layout/Layout.stories.tsx | 12 +++---- .../Layout/components/Section/Section.tsx | 21 ++----------- .../SkeletonPage/SkeletonPage.stories.tsx | 10 +++--- .../layout-annotated-with-sections.tsx | 2 +- .../layout-three-columns-with-equal-width.tsx | 6 ++-- .../layout-two-columns-with-equal-width.tsx | 4 +-- ...umns-with-primary-and-secondary-widths.tsx | 2 +- .../skeleton-page-with-dynamic-content.tsx | 2 +- .../skeleton-page-with-static-content.tsx | 9 ++++-- 13 files changed, 66 insertions(+), 45 deletions(-) create mode 100644 .changeset/silly-ligers-heal.md create mode 100644 documentation/guides/migrating-from-v11-to-v12.md diff --git a/.changeset/silly-ligers-heal.md b/.changeset/silly-ligers-heal.md new file mode 100644 index 00000000000..0436fd5230d --- /dev/null +++ b/.changeset/silly-ligers-heal.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': major +--- + +Replaced boolean props: `secondary`, `fullWidth`, `oneHalf`, `oneThird` on Layout.Section with `variant` diff --git a/documentation/guides/migrating-from-v11-to-v12.md b/documentation/guides/migrating-from-v11-to-v12.md new file mode 100644 index 00000000000..2f1c5aa8209 --- /dev/null +++ b/documentation/guides/migrating-from-v11-to-v12.md @@ -0,0 +1,31 @@ +# Migrating from v11 to v12 + +Polaris v12.0.0 ([full release notes](https://github.com/Shopify/polaris/releases/tag/v12.0.0)) prop replacement, removal of components, renamed components, and token changes. + +## Table of Contents + +- [Quick migration guide](#quick-migration-guide) + +## Quick migration guide + +**Layout.Section** + +One third: + +`npx @shopify/polaris-migrator react-rename-component-prop --componentName="Layout.Section" --from="oneThird" --to="variant" --newValue="oneThird"` + +One half: + +`npx @shopify/polaris-migrator react-rename-component-prop --componentName="Layout.Section" --from="oneHalf" --to="variant" --newValue="oneHalf"` + +Full width: + +`npx @shopify/polaris-migrator react-rename-component-prop --componentName="Layout.Section" --from="fullWidth" --to="variant" --newValue="fullWidth"` + +Secondary, becomes oneThird: + +`npx @shopify/polaris-migrator react-rename-component-prop --componentName="Layout.Section" --from="secondary" --to="variant" --newValue="oneThird"` + +**TextField** + +`npx @shopify/polaris-migrator react-rename-component-prop --componentName="TextField" --from="borderless" --to="variant" --newValue="borderless"` diff --git a/polaris-react/playground/DetailsPage.tsx b/polaris-react/playground/DetailsPage.tsx index 46f54b024b4..2d90fa76db3 100644 --- a/polaris-react/playground/DetailsPage.tsx +++ b/polaris-react/playground/DetailsPage.tsx @@ -625,7 +625,7 @@ export function DetailsPage() { - +