Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate shadow custom properties from v11 to v12 #10778

Merged
merged 12 commits into from
Sep 29, 2023

Conversation

laurkim
Copy link
Contributor

@laurkim laurkim commented Sep 29, 2023

WHY are these changes introduced?

Resolves #10641.

Migrates shadow custom properties from v11 to v12.
Updates types on Box component shadow prop and ShadowBevel component boxShadow prop.

WHAT is this pull request doing?

To migrate shadow custom properties, the flow was to:

  • Handle automatic migrations

    # Space migration
    npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230922144839 \
    v12-styles-replace-custom-property-shadow \
    'src/**/*.scss'
    # Stage all migrated files
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write
    # Commit automated migrations
    git commit -m "Migrate shadow custom properties from v11 to v12" 
  • Handle manual migrations

    # Bring back the files with "polaris-migrator:" comments
    git stash pop
    • Search for "polaris-migrator:" comments and handle manual migrations
    • Search for and handle manual migrations (e.g. )

    # Stage all manually migrated files 
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write 
    #  Commit manual migrations
    git commit -m "Manually migrate shadow custom properties from v11 to v12"
    
  • Check for errors after all custom property migrations are finished

    # Run stylelint against polaris-react
    npx stylelint 'polaris-react/src/**/*.scss'

How to 🎩

Post-migration validation

After migrating use the following RegExp to check for any additional instances of space custom properties across all file types:

[V12] Check RegExp for hardcoded shadow custom properties across all file types
(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental|--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
Check RegExp for outdated <Box shadow="..." /> props
<Box[^>\w](?:[^>]|\n)*?shadow
Check RegExp for outdated <ShadowBevel boxShadow="..." /> props
<ShadowBevel[^>\w](?:[^>]|\n)*?boxShadow

Replacement maps

Deprecated CSS Custom Property Replacement Value
--p-shadow-inset-lg --p-shadow-inset-200
--p-shadow-inset-md --p-shadow-inset-200
--p-shadow-inset-sm --p-shadow-inset-100
--p-shadow-none --p-shadow-0
--p-shadow-xs --p-shadow-100
--p-shadow-sm --p-shadow-200
--p-shadow-md --p-shadow-300
--p-shadow-lg --p-shadow-400
--p-shadow-xl --p-shadow-500
--p-shadow-2xl --p-shadow-600
--p-shadow-bevel-experimental --p-shadow-bevel-100
--p-shadow-card-sm-experimental --p-shadow-100
--p-shadow-card-md-experimental --p-shadow-200
--p-shadow-card-lg-experimental --p-shadow-300
--p-shadow-button-experimental --p-shadow-button
--p-shadow-button-hover-experimental --p-shadow-button-hover
--p-shadow-button-disabled-experimental inset 0 0 0 1px rgba(227, 227, 227, 1)
--p-shadow-button-primary-strong-experimental --p-shadow-button-primary
--p-shadow-button-primary-strong-inset-experimental --p-shadow-button-primary-inset
--p-shadow-button-primary-strong-hover-experimental --p-shadow-button-primary-hover
--p-shadow-border-inset-experimental --p-shadow-border-inset

Important

The following values were manually migrated based on context:

Deprecated CSS Custom Property Replacement Value
--p-shadow-button-primary-experimental --p-shadow-button-primary-critical
--p-shadow-button-primary-success
--p-shadow-button-primary-hover-experimental --p-shadow-button-primary-critical-hover
--p-shadow-button-primary-success-hover
--p-shadow-button-inset-experimental --p-shadow-button-primary-critical-inset
--p-shadow-button-primary-success-inset

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@laurkim laurkim self-assigned this Sep 29, 2023
@laurkim laurkim force-pushed the lo/migrate-shadow-custom-properties branch from b1bf5f8 to 427014a Compare September 29, 2023 00:55
@laurkim laurkim force-pushed the lo/migrate-shadow-custom-properties branch from 52b831c to e705109 Compare September 29, 2023 12:21
// adjust shine for critical and success buttons
box-shadow: var(--p-shadow-button-primary-experimental);
Copy link
Contributor Author

@laurkim laurkim Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shadow for critical and success primary buttons were combined so I've removed them here to add to the individual classes instead with the token replacement value.

Comment on lines -340 to -343
// stylelint-disable-next-line selector-max-specificity -- set box shadow
&::before {
box-shadow: var(--p-shadow-button-primary-experimental);
}

Copy link
Contributor Author

@laurkim laurkim Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shadow for critical and success primary button hover states were combined so I've removed them here to add to the individual classes instead with the token replacement value.

@@ -351,7 +344,6 @@
&:active {
// stylelint-disable-next-line polaris/conventions/polaris/custom-property-allowed-list -- Button custom property
--pc-button-text: var(--p-color-text-inverse-subdued);
box-shadow: var(--p-shadow-button-inset-experimental);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shadow for critical and success primary button active states were combined so I've removed them here to add to the individual classes instead with the token replacement value.

@laurkim laurkim force-pushed the lo/migrate-shadow-custom-properties branch from 04f6a10 to 3ef555a Compare September 29, 2023 16:36
Comment on lines 112 to +114
'shadow-button-primary': {
value:
'0 1px 0 0 rgba(255, 255, 255, 0.24) inset, 1px 0 0 0 rgba(255, 255, 255, 0.20) inset, -1px 0 0 0 rgba(255, 255, 255, 0.20) inset, 0 -1px 0 0 #000 inset, 0 -1px 0 1px #1A1A1A',
'0px 2px 0px 0px rgba(255, 255, 255, 0.2) inset, 2px 0px 0px 0px rgba(255, 255, 255, 0.2) inset, -2px 0px 0px 0px rgba(255, 255, 255, 0.2) inset, 0px -1px 0px 1px #000 inset, 0px 1px 0px 0px #000 inset',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this token value after discussing with @bernardojoaogarcia and @sarahill when I noticed shadow on primary Button looked off.

Before with prior token value:
29-20-zs87f-wrdxd

Comment on lines 88 to 91
'shadow-bevel-100': {
value:
'0 1px 0 0 rgba(208, 208, 208, 0.40) inset, 1px 0 0 0 #E3E3E3 inset, -1px 0 0 0 #E3E3E3 inset, 0 -1px 0 0 #D4D4D4 inset',
'1px 0px 0px 0px rgba(0, 0, 0, 0.13) inset, -1px 0px 0px 0px rgba(0, 0, 0, 0.13) inset, 0px -1px 0px 0px rgba(0, 0, 0, 0.17) inset, 0px 1px 0px 0px rgba(204, 204, 204, 0.5) inset',
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this token value after discussing with @sarahill and @bernardojoaogarcia when we noticed shadow bevel was a bit off with the previous shadow-bevel-100 value.

@laurkim laurkim merged commit b126f64 into next Sep 29, 2023
12 checks passed
@laurkim laurkim deleted the lo/migrate-shadow-custom-properties branch September 29, 2023 19:14
mrcthms pushed a commit that referenced this pull request Oct 2, 2023
### WHY are these changes introduced?

Resolves #10641.

Migrates `shadow` custom properties from v11 to v12.
Updates types on Box component `shadow` prop and ShadowBevel component
`boxShadow` prop.

### WHAT is this pull request doing?

To migrate `shadow` custom properties, the flow was to: 
- Handle automatic migrations
    ```sh
    # Space migration
npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230922144839 \
    v12-styles-replace-custom-property-shadow \
    'src/**/*.scss'
    # Stage all migrated files
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write
    # Commit automated migrations
    git commit -m "Migrate shadow custom properties from v11 to v12" 
    ```
- Handle manual migrations
    ```sh
    # Bring back the files with "polaris-migrator:" comments
    git stash pop
    ```
- Search for "polaris-migrator:" comments and handle manual migrations
    - Search for and handle manual migrations (e.g. <Box shadow="md">)
    <br>

    ```sh
    # Stage all manually migrated files 
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write 
    #  Commit manual migrations
git commit -m "Manually migrate shadow custom properties from v11 to
v12"

    ```
- Check for errors after all custom property migrations are finished
    ```sh
    # Run stylelint against polaris-react
    npx stylelint 'polaris-react/src/**/*.scss'
    ```

### How to 🎩

#### Post-migration validation

After migrating use the following RegExp to check for any additional
instances of `space` custom properties across all file types:

<details>
<summary>[V12] Check RegExp for hardcoded <code>shadow</code> custom
properties across all file types</summary>

```
(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental|--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;Box shadow="..."
/&gt;</code> props</summary>

```
<Box[^>\w](?:[^>]|\n)*?shadow
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;ShadowBevel boxShadow="..."
/&gt;</code> props</summary>

```
<ShadowBevel[^>\w](?:[^>]|\n)*?boxShadow
```
</details>


#### Replacement maps

| Deprecated CSS Custom Property   | Replacement Value |
| ---------------- | ----------------- |
| `--p-shadow-inset-lg` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-md` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-sm` | `--p-shadow-inset-100`    |
| `--p-shadow-none` | `--p-shadow-0`    |
| `--p-shadow-xs` | `--p-shadow-100`    |
| `--p-shadow-sm` | `--p-shadow-200`    |
| `--p-shadow-md` | `--p-shadow-300`    |
| `--p-shadow-lg` | `--p-shadow-400`    |
| `--p-shadow-xl` | `--p-shadow-500`    |
| `--p-shadow-2xl` | `--p-shadow-600`    |
| `--p-shadow-bevel-experimental` | `--p-shadow-bevel-100`    |
| `--p-shadow-card-sm-experimental` | `--p-shadow-100`    |
| `--p-shadow-card-md-experimental` | `--p-shadow-200`    |
| `--p-shadow-card-lg-experimental` | `--p-shadow-300`    |
| `--p-shadow-button-experimental` | `--p-shadow-button`    |
| `--p-shadow-button-hover-experimental` | `--p-shadow-button-hover` |
| `--p-shadow-button-disabled-experimental` | `inset 0 0 0 1px rgba(227,
227, 227, 1)` |
| `--p-shadow-button-primary-strong-experimental` |
`--p-shadow-button-primary` |
| `--p-shadow-button-primary-strong-inset-experimental` |
`--p-shadow-button-primary-inset` |
| `--p-shadow-button-primary-strong-hover-experimental` |
`--p-shadow-button-primary-hover` |
| `--p-shadow-border-inset-experimental` | `--p-shadow-border-inset` |

> [!IMPORTANT]  
> The following values were manually migrated based on context:

| Deprecated CSS Custom Property | Replacement Value |
| ------------------------- | ------------------------ |  
| `--p-shadow-button-primary-experimental` |
`--p-shadow-button-primary-critical`<br>`--p-shadow-button-primary-success`
|
| `--p-shadow-button-primary-hover-experimental` |
`--p-shadow-button-primary-critical-hover`<br>`--p-shadow-button-primary-success-hover`
|
| `--p-shadow-button-inset-experimental` |
`--p-shadow-button-primary-critical-inset`<br>`--p-shadow-button-primary-success-inset`
|

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
mrcthms pushed a commit that referenced this pull request Oct 3, 2023
### WHY are these changes introduced?

Resolves #10641.

Migrates `shadow` custom properties from v11 to v12.
Updates types on Box component `shadow` prop and ShadowBevel component
`boxShadow` prop.

### WHAT is this pull request doing?

To migrate `shadow` custom properties, the flow was to: 
- Handle automatic migrations
    ```sh
    # Space migration
npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230922144839 \
    v12-styles-replace-custom-property-shadow \
    'src/**/*.scss'
    # Stage all migrated files
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write
    # Commit automated migrations
    git commit -m "Migrate shadow custom properties from v11 to v12" 
    ```
- Handle manual migrations
    ```sh
    # Bring back the files with "polaris-migrator:" comments
    git stash pop
    ```
- Search for "polaris-migrator:" comments and handle manual migrations
    - Search for and handle manual migrations (e.g. <Box shadow="md">)
    <br>

    ```sh
    # Stage all manually migrated files 
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write 
    #  Commit manual migrations
git commit -m "Manually migrate shadow custom properties from v11 to
v12"

    ```
- Check for errors after all custom property migrations are finished
    ```sh
    # Run stylelint against polaris-react
    npx stylelint 'polaris-react/src/**/*.scss'
    ```

### How to 🎩

#### Post-migration validation

After migrating use the following RegExp to check for any additional
instances of `space` custom properties across all file types:

<details>
<summary>[V12] Check RegExp for hardcoded <code>shadow</code> custom
properties across all file types</summary>

```
(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental|--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;Box shadow="..."
/&gt;</code> props</summary>

```
<Box[^>\w](?:[^>]|\n)*?shadow
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;ShadowBevel boxShadow="..."
/&gt;</code> props</summary>

```
<ShadowBevel[^>\w](?:[^>]|\n)*?boxShadow
```
</details>


#### Replacement maps

| Deprecated CSS Custom Property   | Replacement Value |
| ---------------- | ----------------- |
| `--p-shadow-inset-lg` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-md` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-sm` | `--p-shadow-inset-100`    |
| `--p-shadow-none` | `--p-shadow-0`    |
| `--p-shadow-xs` | `--p-shadow-100`    |
| `--p-shadow-sm` | `--p-shadow-200`    |
| `--p-shadow-md` | `--p-shadow-300`    |
| `--p-shadow-lg` | `--p-shadow-400`    |
| `--p-shadow-xl` | `--p-shadow-500`    |
| `--p-shadow-2xl` | `--p-shadow-600`    |
| `--p-shadow-bevel-experimental` | `--p-shadow-bevel-100`    |
| `--p-shadow-card-sm-experimental` | `--p-shadow-100`    |
| `--p-shadow-card-md-experimental` | `--p-shadow-200`    |
| `--p-shadow-card-lg-experimental` | `--p-shadow-300`    |
| `--p-shadow-button-experimental` | `--p-shadow-button`    |
| `--p-shadow-button-hover-experimental` | `--p-shadow-button-hover` |
| `--p-shadow-button-disabled-experimental` | `inset 0 0 0 1px rgba(227,
227, 227, 1)` |
| `--p-shadow-button-primary-strong-experimental` |
`--p-shadow-button-primary` |
| `--p-shadow-button-primary-strong-inset-experimental` |
`--p-shadow-button-primary-inset` |
| `--p-shadow-button-primary-strong-hover-experimental` |
`--p-shadow-button-primary-hover` |
| `--p-shadow-border-inset-experimental` | `--p-shadow-border-inset` |

> [!IMPORTANT]  
> The following values were manually migrated based on context:

| Deprecated CSS Custom Property | Replacement Value |
| ------------------------- | ------------------------ |  
| `--p-shadow-button-primary-experimental` |
`--p-shadow-button-primary-critical`<br>`--p-shadow-button-primary-success`
|
| `--p-shadow-button-primary-hover-experimental` |
`--p-shadow-button-primary-critical-hover`<br>`--p-shadow-button-primary-success-hover`
|
| `--p-shadow-button-inset-experimental` |
`--p-shadow-button-primary-critical-inset`<br>`--p-shadow-button-primary-success-inset`
|

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
sophschneider added a commit that referenced this pull request Oct 3, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to next, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`next` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `next`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @shopify/polaris@12.0.0-beta.2

### Major Changes

- [#10705](#10705)
[`c7c2312f7`](c7c2312)
Thanks [@chloerice](https://github.com/chloerice)! - - Removed the
`subdued` and `status` props from `IndexTable.Row`. Use `tone` instead.


- [#10778](#10778)
[`b126f64e6`](b126f64)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `shadow`
custom properties from v11 to v12


- [#10762](#10762)
[`1ef71164c`](1ef7116)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `font` custom
properties from v11 to v12


- [#10741](#10741)
[`2c2bb0e09`](2c2bb0e)
Thanks [@laurkim](https://github.com/laurkim)! - - Migrated `border`
custom properties from v11 to v12
- Removed backwards compatibility for v11 border tokens on `Tooltip`
component `BorderRadius` type
- Updated JSDoc prop type descriptions to include updated `border`
custom properties on `Divider` and `Tooltip` components


- [#10744](#10744)
[`a4f5e7df3`](a4f5e7d)
Thanks [@mrcthms](https://github.com/mrcthms)! - Removed deprecated
`disable1Password` prop from `TextField`.


- [#10727](#10727)
[`179b481d7`](179b481)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom
properties from v11 to v12
Removed backwards compatibility for v11 border tokens on `Tooltip`
component `Padding` type
Updated JSDoc prop type descriptions to include updated `padding` custom
properties on `Box` component


- [#10669](#10669)
[`794d1f5e4`](794d1f5)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added `border-radius`
semantic layer


- [#10745](#10745)
[`a4205eee1`](a4205ee)
Thanks [@mrcthms](https://github.com/mrcthms)! - [IndexFilters] Remove
IndexFiltersManager in AppProvider


- [#10773](#10773)
[`f6bc29ade`](f6bc29a)
Thanks [@laurkim](https://github.com/laurkim)! - Removed support for
`headingXs` and `heading4xl` variants and replaced usage with
`headingSm` and `heading3xl`

### Minor Changes

- [#10722](#10722)
[`14a94967d`](14a9496)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`emphasis` and `text` tones on `Icon` and migrated `primary` and
`subdued` tone color tokens


- [#10788](#10788)
[`82f10e830`](82f10e8)
Thanks [@mrcthms](https://github.com/mrcthms)! - Deprecated the
IndexFiltersManager component

### Patch Changes

- Updated dependencies
\[[`2a467249f`](2a46724),
[`2cdc59f88`](2cdc59f),
[`794d1f5e4`](794d1f5),
[`08aaf11ec`](08aaf11)]:
    -   @shopify/polaris-tokens@8.0.0-beta.1

## @shopify/polaris-tokens@8.0.0-beta.1

### Major Changes

- [#10760](#10760)
[`2a467249f`](2a46724)
Thanks [@lgriffee](https://github.com/lgriffee)! - Updated `shadow`
token values


- [#10801](#10801)
[`2cdc59f88`](2cdc59f)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! -
Deprecated a collection of types, utils, and JSON exports


- [#10673](#10673)
[`08aaf11ec`](08aaf11)
Thanks [@lgriffee](https://github.com/lgriffee)! - Updated `font-size`
and `font-weight` token values

### Minor Changes

- [#10669](#10669)
[`794d1f5e4`](794d1f5)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added `border-radius`
semantic layer

## @shopify/stylelint-polaris@14.1.2-beta.1

### Patch Changes

- Updated dependencies
\[[`2a467249f`](2a46724),
[`2cdc59f88`](2cdc59f),
[`794d1f5e4`](794d1f5),
[`08aaf11ec`](08aaf11)]:
    -   @shopify/polaris-tokens@8.0.0-beta.1

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sophie Schneider <thesophieschneider@gmail.com>
mrcthms pushed a commit that referenced this pull request Oct 12, 2023
### WHY are these changes introduced?

Resolves #10641.

Migrates `shadow` custom properties from v11 to v12.
Updates types on Box component `shadow` prop and ShadowBevel component
`boxShadow` prop.

### WHAT is this pull request doing?

To migrate `shadow` custom properties, the flow was to: 
- Handle automatic migrations
    ```sh
    # Space migration
npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230922144839 \
    v12-styles-replace-custom-property-shadow \
    'src/**/*.scss'
    # Stage all migrated files
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write
    # Commit automated migrations
    git commit -m "Migrate shadow custom properties from v11 to v12" 
    ```
- Handle manual migrations
    ```sh
    # Bring back the files with "polaris-migrator:" comments
    git stash pop
    ```
- Search for "polaris-migrator:" comments and handle manual migrations
    - Search for and handle manual migrations (e.g. <Box shadow="md">)
    <br>

    ```sh
    # Stage all manually migrated files 
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write 
    #  Commit manual migrations
git commit -m "Manually migrate shadow custom properties from v11 to
v12"

    ```
- Check for errors after all custom property migrations are finished
    ```sh
    # Run stylelint against polaris-react
    npx stylelint 'polaris-react/src/**/*.scss'
    ```

### How to 🎩

#### Post-migration validation

After migrating use the following RegExp to check for any additional
instances of `space` custom properties across all file types:

<details>
<summary>[V12] Check RegExp for hardcoded <code>shadow</code> custom
properties across all file types</summary>

```
(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental|--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;Box shadow="..."
/&gt;</code> props</summary>

```
<Box[^>\w](?:[^>]|\n)*?shadow
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;ShadowBevel boxShadow="..."
/&gt;</code> props</summary>

```
<ShadowBevel[^>\w](?:[^>]|\n)*?boxShadow
```
</details>


#### Replacement maps

| Deprecated CSS Custom Property   | Replacement Value |
| ---------------- | ----------------- |
| `--p-shadow-inset-lg` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-md` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-sm` | `--p-shadow-inset-100`    |
| `--p-shadow-none` | `--p-shadow-0`    |
| `--p-shadow-xs` | `--p-shadow-100`    |
| `--p-shadow-sm` | `--p-shadow-200`    |
| `--p-shadow-md` | `--p-shadow-300`    |
| `--p-shadow-lg` | `--p-shadow-400`    |
| `--p-shadow-xl` | `--p-shadow-500`    |
| `--p-shadow-2xl` | `--p-shadow-600`    |
| `--p-shadow-bevel-experimental` | `--p-shadow-bevel-100`    |
| `--p-shadow-card-sm-experimental` | `--p-shadow-100`    |
| `--p-shadow-card-md-experimental` | `--p-shadow-200`    |
| `--p-shadow-card-lg-experimental` | `--p-shadow-300`    |
| `--p-shadow-button-experimental` | `--p-shadow-button`    |
| `--p-shadow-button-hover-experimental` | `--p-shadow-button-hover` |
| `--p-shadow-button-disabled-experimental` | `inset 0 0 0 1px rgba(227,
227, 227, 1)` |
| `--p-shadow-button-primary-strong-experimental` |
`--p-shadow-button-primary` |
| `--p-shadow-button-primary-strong-inset-experimental` |
`--p-shadow-button-primary-inset` |
| `--p-shadow-button-primary-strong-hover-experimental` |
`--p-shadow-button-primary-hover` |
| `--p-shadow-border-inset-experimental` | `--p-shadow-border-inset` |

> [!IMPORTANT]  
> The following values were manually migrated based on context:

| Deprecated CSS Custom Property | Replacement Value |
| ------------------------- | ------------------------ |  
| `--p-shadow-button-primary-experimental` |
`--p-shadow-button-primary-critical`<br>`--p-shadow-button-primary-success`
|
| `--p-shadow-button-primary-hover-experimental` |
`--p-shadow-button-primary-critical-hover`<br>`--p-shadow-button-primary-success-hover`
|
| `--p-shadow-button-inset-experimental` |
`--p-shadow-button-primary-critical-inset`<br>`--p-shadow-button-primary-success-inset`
|

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
mrcthms pushed a commit that referenced this pull request Oct 12, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to next, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`next` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `next`.

⚠️⚠️⚠️⚠️⚠️⚠️

- [#10705](#10705)
[`c7c2312f7`](c7c2312)
Thanks [@chloerice](https://github.com/chloerice)! - - Removed the
`subdued` and `status` props from `IndexTable.Row`. Use `tone` instead.

- [#10778](#10778)
[`b126f64e6`](b126f64)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `shadow`
custom properties from v11 to v12

- [#10762](#10762)
[`1ef71164c`](1ef7116)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `font` custom
properties from v11 to v12

- [#10741](#10741)
[`2c2bb0e09`](2c2bb0e)
Thanks [@laurkim](https://github.com/laurkim)! - - Migrated `border`
custom properties from v11 to v12
- Removed backwards compatibility for v11 border tokens on `Tooltip`
component `BorderRadius` type
- Updated JSDoc prop type descriptions to include updated `border`
custom properties on `Divider` and `Tooltip` components

- [#10744](#10744)
[`a4f5e7df3`](a4f5e7d)
Thanks [@mrcthms](https://github.com/mrcthms)! - Removed deprecated
`disable1Password` prop from `TextField`.

- [#10727](#10727)
[`179b481d7`](179b481)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom
properties from v11 to v12
Removed backwards compatibility for v11 border tokens on `Tooltip`
component `Padding` type
Updated JSDoc prop type descriptions to include updated `padding` custom
properties on `Box` component

- [#10669](#10669)
[`794d1f5e4`](794d1f5)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added `border-radius`
semantic layer

- [#10745](#10745)
[`a4205eee1`](a4205ee)
Thanks [@mrcthms](https://github.com/mrcthms)! - [IndexFilters] Remove
IndexFiltersManager in AppProvider

- [#10773](#10773)
[`f6bc29ade`](f6bc29a)
Thanks [@laurkim](https://github.com/laurkim)! - Removed support for
`headingXs` and `heading4xl` variants and replaced usage with
`headingSm` and `heading3xl`

- [#10722](#10722)
[`14a94967d`](14a9496)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`emphasis` and `text` tones on `Icon` and migrated `primary` and
`subdued` tone color tokens

- [#10788](#10788)
[`82f10e830`](82f10e8)
Thanks [@mrcthms](https://github.com/mrcthms)! - Deprecated the
IndexFiltersManager component

- Updated dependencies
\[[`2a467249f`](2a46724),
[`2cdc59f88`](2cdc59f),
[`794d1f5e4`](794d1f5),
[`08aaf11ec`](08aaf11)]:
    -   @shopify/polaris-tokens@8.0.0-beta.1

- [#10760](#10760)
[`2a467249f`](2a46724)
Thanks [@lgriffee](https://github.com/lgriffee)! - Updated `shadow`
token values

- [#10801](#10801)
[`2cdc59f88`](2cdc59f)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! -
Deprecated a collection of types, utils, and JSON exports

- [#10673](#10673)
[`08aaf11ec`](08aaf11)
Thanks [@lgriffee](https://github.com/lgriffee)! - Updated `font-size`
and `font-weight` token values

- [#10669](#10669)
[`794d1f5e4`](794d1f5)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added `border-radius`
semantic layer

- Updated dependencies
\[[`2a467249f`](2a46724),
[`2cdc59f88`](2cdc59f),
[`794d1f5e4`](794d1f5),
[`08aaf11ec`](08aaf11)]:
    -   @shopify/polaris-tokens@8.0.0-beta.1

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sophie Schneider <thesophieschneider@gmail.com>
mrcthms pushed a commit that referenced this pull request Oct 12, 2023
### WHY are these changes introduced?

Resolves #10641.

Migrates `shadow` custom properties from v11 to v12.
Updates types on Box component `shadow` prop and ShadowBevel component
`boxShadow` prop.

### WHAT is this pull request doing?

To migrate `shadow` custom properties, the flow was to: 
- Handle automatic migrations
    ```sh
    # Space migration
npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230922144839 \
    v12-styles-replace-custom-property-shadow \
    'src/**/*.scss'
    # Stage all migrated files
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write
    # Commit automated migrations
    git commit -m "Migrate shadow custom properties from v11 to v12" 
    ```
- Handle manual migrations
    ```sh
    # Bring back the files with "polaris-migrator:" comments
    git stash pop
    ```
- Search for "polaris-migrator:" comments and handle manual migrations
    - Search for and handle manual migrations (e.g. <Box shadow="md">)
    <br>

    ```sh
    # Stage all manually migrated files 
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write 
    #  Commit manual migrations
git commit -m "Manually migrate shadow custom properties from v11 to
v12"

    ```
- Check for errors after all custom property migrations are finished
    ```sh
    # Run stylelint against polaris-react
    npx stylelint 'polaris-react/src/**/*.scss'
    ```

### How to 🎩

#### Post-migration validation

After migrating use the following RegExp to check for any additional
instances of `space` custom properties across all file types:

<details>
<summary>[V12] Check RegExp for hardcoded <code>shadow</code> custom
properties across all file types</summary>

```
(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental|--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;Box shadow="..."
/&gt;</code> props</summary>

```
<Box[^>\w](?:[^>]|\n)*?shadow
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;ShadowBevel boxShadow="..."
/&gt;</code> props</summary>

```
<ShadowBevel[^>\w](?:[^>]|\n)*?boxShadow
```
</details>


#### Replacement maps

| Deprecated CSS Custom Property   | Replacement Value |
| ---------------- | ----------------- |
| `--p-shadow-inset-lg` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-md` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-sm` | `--p-shadow-inset-100`    |
| `--p-shadow-none` | `--p-shadow-0`    |
| `--p-shadow-xs` | `--p-shadow-100`    |
| `--p-shadow-sm` | `--p-shadow-200`    |
| `--p-shadow-md` | `--p-shadow-300`    |
| `--p-shadow-lg` | `--p-shadow-400`    |
| `--p-shadow-xl` | `--p-shadow-500`    |
| `--p-shadow-2xl` | `--p-shadow-600`    |
| `--p-shadow-bevel-experimental` | `--p-shadow-bevel-100`    |
| `--p-shadow-card-sm-experimental` | `--p-shadow-100`    |
| `--p-shadow-card-md-experimental` | `--p-shadow-200`    |
| `--p-shadow-card-lg-experimental` | `--p-shadow-300`    |
| `--p-shadow-button-experimental` | `--p-shadow-button`    |
| `--p-shadow-button-hover-experimental` | `--p-shadow-button-hover` |
| `--p-shadow-button-disabled-experimental` | `inset 0 0 0 1px rgba(227,
227, 227, 1)` |
| `--p-shadow-button-primary-strong-experimental` |
`--p-shadow-button-primary` |
| `--p-shadow-button-primary-strong-inset-experimental` |
`--p-shadow-button-primary-inset` |
| `--p-shadow-button-primary-strong-hover-experimental` |
`--p-shadow-button-primary-hover` |
| `--p-shadow-border-inset-experimental` | `--p-shadow-border-inset` |

> [!IMPORTANT]  
> The following values were manually migrated based on context:

| Deprecated CSS Custom Property | Replacement Value |
| ------------------------- | ------------------------ |  
| `--p-shadow-button-primary-experimental` |
`--p-shadow-button-primary-critical`<br>`--p-shadow-button-primary-success`
|
| `--p-shadow-button-primary-hover-experimental` |
`--p-shadow-button-primary-critical-hover`<br>`--p-shadow-button-primary-success-hover`
|
| `--p-shadow-button-inset-experimental` |
`--p-shadow-button-primary-critical-inset`<br>`--p-shadow-button-primary-success-inset`
|

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
mrcthms pushed a commit that referenced this pull request Oct 12, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to next, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`next` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `next`.

⚠️⚠️⚠️⚠️⚠️⚠️

- [#10705](#10705)
[`c7c2312f7`](c7c2312)
Thanks [@chloerice](https://github.com/chloerice)! - - Removed the
`subdued` and `status` props from `IndexTable.Row`. Use `tone` instead.

- [#10778](#10778)
[`b126f64e6`](b126f64)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `shadow`
custom properties from v11 to v12

- [#10762](#10762)
[`1ef71164c`](1ef7116)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `font` custom
properties from v11 to v12

- [#10741](#10741)
[`2c2bb0e09`](2c2bb0e)
Thanks [@laurkim](https://github.com/laurkim)! - - Migrated `border`
custom properties from v11 to v12
- Removed backwards compatibility for v11 border tokens on `Tooltip`
component `BorderRadius` type
- Updated JSDoc prop type descriptions to include updated `border`
custom properties on `Divider` and `Tooltip` components

- [#10744](#10744)
[`a4f5e7df3`](a4f5e7d)
Thanks [@mrcthms](https://github.com/mrcthms)! - Removed deprecated
`disable1Password` prop from `TextField`.

- [#10727](#10727)
[`179b481d7`](179b481)
Thanks [@laurkim](https://github.com/laurkim)! - Migrated `space` custom
properties from v11 to v12
Removed backwards compatibility for v11 border tokens on `Tooltip`
component `Padding` type
Updated JSDoc prop type descriptions to include updated `padding` custom
properties on `Box` component

- [#10669](#10669)
[`794d1f5e4`](794d1f5)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added `border-radius`
semantic layer

- [#10745](#10745)
[`a4205eee1`](a4205ee)
Thanks [@mrcthms](https://github.com/mrcthms)! - [IndexFilters] Remove
IndexFiltersManager in AppProvider

- [#10773](#10773)
[`f6bc29ade`](f6bc29a)
Thanks [@laurkim](https://github.com/laurkim)! - Removed support for
`headingXs` and `heading4xl` variants and replaced usage with
`headingSm` and `heading3xl`

- [#10722](#10722)
[`14a94967d`](14a9496)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for
`emphasis` and `text` tones on `Icon` and migrated `primary` and
`subdued` tone color tokens

- [#10788](#10788)
[`82f10e830`](82f10e8)
Thanks [@mrcthms](https://github.com/mrcthms)! - Deprecated the
IndexFiltersManager component

- Updated dependencies
\[[`2a467249f`](2a46724),
[`2cdc59f88`](2cdc59f),
[`794d1f5e4`](794d1f5),
[`08aaf11ec`](08aaf11)]:
    -   @shopify/polaris-tokens@8.0.0-beta.1

- [#10760](#10760)
[`2a467249f`](2a46724)
Thanks [@lgriffee](https://github.com/lgriffee)! - Updated `shadow`
token values

- [#10801](#10801)
[`2cdc59f88`](2cdc59f)
Thanks [@aaronccasanova](https://github.com/aaronccasanova)! -
Deprecated a collection of types, utils, and JSON exports

- [#10673](#10673)
[`08aaf11ec`](08aaf11)
Thanks [@lgriffee](https://github.com/lgriffee)! - Updated `font-size`
and `font-weight` token values

- [#10669](#10669)
[`794d1f5e4`](794d1f5)
Thanks [@lgriffee](https://github.com/lgriffee)! - Added `border-radius`
semantic layer

- Updated dependencies
\[[`2a467249f`](2a46724),
[`2cdc59f88`](2cdc59f),
[`794d1f5e4`](794d1f5),
[`08aaf11ec`](08aaf11)]:
    -   @shopify/polaris-tokens@8.0.0-beta.1

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sophie Schneider <thesophieschneider@gmail.com>
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
### WHY are these changes introduced?

Resolves Shopify#10641.

Migrates `shadow` custom properties from v11 to v12.
Updates types on Box component `shadow` prop and ShadowBevel component
`boxShadow` prop.

### WHAT is this pull request doing?

To migrate `shadow` custom properties, the flow was to: 
- Handle automatic migrations
    ```sh
    # Space migration
npx @shopify/polaris-migrator@0.0.0-snapshot-release-20230922144839 \
    v12-styles-replace-custom-property-shadow \
    'src/**/*.scss'
    # Stage all migrated files
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write
    # Commit automated migrations
    git commit -m "Migrate shadow custom properties from v11 to v12" 
    ```
- Handle manual migrations
    ```sh
    # Bring back the files with "polaris-migrator:" comments
    git stash pop
    ```
- Search for "polaris-migrator:" comments and handle manual migrations
    - Search for and handle manual migrations (e.g. <Box shadow="md">)
    <br>

    ```sh
    # Stage all manually migrated files 
    git add .
    # Format staged files only
    git diff --staged --name-only | xargs npx prettier --write 
    #  Commit manual migrations
git commit -m "Manually migrate shadow custom properties from v11 to
v12"

    ```
- Check for errors after all custom property migrations are finished
    ```sh
    # Run stylelint against polaris-react
    npx stylelint 'polaris-react/src/**/*.scss'
    ```

### How to 🎩

#### Post-migration validation

After migrating use the following RegExp to check for any additional
instances of `space` custom properties across all file types:

<details>
<summary>[V12] Check RegExp for hardcoded <code>shadow</code> custom
properties across all file types</summary>

```
(?:--p-shadow-inset-lg|--p-shadow-inset-md|--p-shadow-inset-sm|--p-shadow-none|--p-shadow-xs|--p-shadow-sm|--p-shadow-md|--p-shadow-lg|--p-shadow-xl|--p-shadow-2xl|--p-shadow-bevel-experimental|--p-shadow-card-sm-experimental|--p-shadow-card-md-experimental|--p-shadow-card-lg-experimental|--p-shadow-button-experimental|--p-shadow-button-hover-experimental|--p-shadow-button-disabled-experimental|--p-shadow-button-primary-strong-experimental|--p-shadow-button-primary-strong-inset-experimental|--p-shadow-button-primary-strong-hover-experimental|--p-shadow-border-inset-experimental|--p-shadow-button-primary-experimental|--p-shadow-button-primary-hover-experimental|--p-shadow-button-inset-experimental)(?![\w-])
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;Box shadow="..."
/&gt;</code> props</summary>

```
<Box[^>\w](?:[^>]|\n)*?shadow
```
</details>

<details>
<summary>Check RegExp for outdated <code>&lt;ShadowBevel boxShadow="..."
/&gt;</code> props</summary>

```
<ShadowBevel[^>\w](?:[^>]|\n)*?boxShadow
```
</details>


#### Replacement maps

| Deprecated CSS Custom Property   | Replacement Value |
| ---------------- | ----------------- |
| `--p-shadow-inset-lg` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-md` | `--p-shadow-inset-200`    |
| `--p-shadow-inset-sm` | `--p-shadow-inset-100`    |
| `--p-shadow-none` | `--p-shadow-0`    |
| `--p-shadow-xs` | `--p-shadow-100`    |
| `--p-shadow-sm` | `--p-shadow-200`    |
| `--p-shadow-md` | `--p-shadow-300`    |
| `--p-shadow-lg` | `--p-shadow-400`    |
| `--p-shadow-xl` | `--p-shadow-500`    |
| `--p-shadow-2xl` | `--p-shadow-600`    |
| `--p-shadow-bevel-experimental` | `--p-shadow-bevel-100`    |
| `--p-shadow-card-sm-experimental` | `--p-shadow-100`    |
| `--p-shadow-card-md-experimental` | `--p-shadow-200`    |
| `--p-shadow-card-lg-experimental` | `--p-shadow-300`    |
| `--p-shadow-button-experimental` | `--p-shadow-button`    |
| `--p-shadow-button-hover-experimental` | `--p-shadow-button-hover` |
| `--p-shadow-button-disabled-experimental` | `inset 0 0 0 1px rgba(227,
227, 227, 1)` |
| `--p-shadow-button-primary-strong-experimental` |
`--p-shadow-button-primary` |
| `--p-shadow-button-primary-strong-inset-experimental` |
`--p-shadow-button-primary-inset` |
| `--p-shadow-button-primary-strong-hover-experimental` |
`--p-shadow-button-primary-hover` |
| `--p-shadow-border-inset-experimental` | `--p-shadow-border-inset` |

> [!IMPORTANT]  
> The following values were manually migrated based on context:

| Deprecated CSS Custom Property | Replacement Value |
| ------------------------- | ------------------------ |  
| `--p-shadow-button-primary-experimental` |
`--p-shadow-button-primary-critical`<br>`--p-shadow-button-primary-success`
|
| `--p-shadow-button-primary-hover-experimental` |
`--p-shadow-button-primary-critical-hover`<br>`--p-shadow-button-primary-success-hover`
|
| `--p-shadow-button-inset-experimental` |
`--p-shadow-button-primary-critical-inset`<br>`--p-shadow-button-primary-success-inset`
|

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants