diff --git a/documentation/guides/migrating-from-v10-to-v11.md b/documentation/guides/migrating-from-v10-to-v11.md index cb130d0772b..4b6d0c5d74f 100644 --- a/documentation/guides/migrating-from-v10-to-v11.md +++ b/documentation/guides/migrating-from-v10-to-v11.md @@ -9,6 +9,12 @@ Polaris v11.0.0 ([full release notes](https://github.com/Shopify/polaris/release - [Removed deprecated Collapsible argument](#removed-deprecated-collapsible-argument) - [Removed KonamiCode component](#removed-konamicode-component) - [Tokens](#tokens) + - [Border](#border) + - [Color](#color) + - [Depth](#depth) + - [Motion](#motion) + - [Legacy](#legacy) + - [Z-index](#z-index) ## Node support @@ -43,3 +49,250 @@ We've removed the following deprecated prop from the Collapsible component: We are removing low usage components from Polaris. We love fun but we also want to ensure we are shipping exactly what our users need. If you want to use this in your project feel free to copy the [component sourcecode](https://github.com/Shopify/polaris/blob/%40shopify/polaris%4010.24.0/polaris-react/src/components/KonamiCode/KonamiCode.tsx). ## Tokens + +The following tokens have either been renamed or removed. You will need to replace any instances of them with their new name or value equivalents. + +### Border + +| Deprecated Token | Replacement Value | +| ---------------------------- | ------------------------------------------------------------- | +| `--p-border-radius-base` | `--p-border-radius-1` | +| `--p-border-radius-large` | `--p-border-radius-2` | +| `--p-border-radius-half` | `--p-border-radius-full` | +| `--p-border-base` | `var(--p-border-width-1) solid var(--p-color-border-subdued)` | +| `--p-border-dark` | `var(--p-border-width-1) solid var(--p-color-border)` | +| `--p-border-transparent` | `var(--p-border-width-1) solid transparent` | +| `--p-border-divider` | `var(--p-border-width-1) solid var(--p-color-border-subdued)` | +| `--p-border-divider-on-dark` | `var(--p-border-width-1) solid var(--p-color-border-inverse)` | + +### Color + +| Deprecated Token | Replacement Value | +| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--p-text-warning` | `--p-color-text-caution` | +| `--p-text-success` | `--p-color-text-success` | +| `--p-text-subdued-on-dark` | `--p-color-text-inverse-subdued` | +| `--p-text-subdued` | `--p-color-text-subdued` | +| `--p-text-primary-pressed` | `--p-color-text-primary` | +| `--p-text-primary-hovered` | `--p-color-text-primary-hover` | +| `--p-text-primary` | `--p-color-text-primary` | +| `--p-text-on-primary` | `--p-color-text-on-color` | +| `--p-text-on-interactive` | `--p-color-text-on-color` | +| `--p-text-on-dark` | `--p-color-text-inverse` | +| `--p-text-on-critical` | `--p-color-text-on-color` | +| `--p-text-highlight` | `--p-color-text-info` | +| `--p-text-disabled` | `--p-color-text-disabled` | +| `--p-text-critical` | `--p-color-text-critical` | +| `--p-text` | `--p-color-text` | +| `--p-surface-warning-subdued-pressed` | `--p-color-bg-caution-subdued-active` | +| `--p-surface-warning-subdued-hovered` | `--p-color-bg-caution-subdued-hover` | +| `--p-surface-warning-subdued` | `--p-color-bg-caution-subdued` | +| `--p-surface-warning` | `--p-color-bg-warning` | +| `--p-surface-success-subdued-pressed` | `--p-color-bg-success-subdued-active` | +| `--p-surface-success-subdued-hovered` | `--p-color-bg-success-subdued-hover` | +| `--p-surface-success-subdued ` | `--p-color-bg-success-subdued` | +| `--p-surface-success` | `--p-color-bg-success` | +| `--p-surface-subdued` | `--p-color-bg-subdued` | +| `--p-surface-selected-pressed` | `--p-color-bg-interactive-subdued-active` | +| `--p-surface-selected-hovered` | `--p-color-bg-interactive-subdued-hover` | +| `--p-surface-selected` | `--p-color-bg-interactive-selected` | +| `--p-surface-search-field-dark` | `--p-color-bg-inverse` | +| `--p-surface-search-field` | `--p-color-bg-inset` | +| `--p-surface-primary-selected-pressed` | `--p-color-bg-primary-subdued-active` | +| `--p-surface-primary-selected-hovered` | `--p-color-bg-primary-subdued-hover` | +| `--p-surface-primary-selected` | `--p-color-bg-primary-subdued-selected` | +| `--p-surface-pressed-dark` | `--p-color-bg-inverse-active` | +| `--p-surface-pressed` | `--p-color-bg-active` | +| `--p-surface-neutral-subdued-dark` | `--p-color-bg-inverse` | +| `--p-surface-neutral-subdued` | `--p-color-bg-subdued` | +| `--p-surface-neutral-pressed` | `--p-color-bg-strong-active` | +| `--p-surface-neutral-hovered` | `--p-color-bg-strong-hover` | +| `--p-surface-neutral-disabled` | `--p-color-bg-disabled` | +| `--p-surface-neutral` | `--p-color-bg-strong` | +| `--p-surface-hovered-dark` | `--p-color-bg-inverse-hover` | +| `--p-surface-hovered` | `--p-color-bg-hover` | +| `--p-surface-highlight-subdued-pressed` | `--p-color-bg-info-subdued-active` | +| `--p-surface-highlight-subdued-hovered` | `--p-color-bg-info-subdued-hover` | +| `--p-surface-highlight-subdued` | `--p-color-bg-info-subdued` | +| `--p-surface-highlight` | `--p-color-bg-info` | +| `--p-surface-disabled` | `--p-color-bg-disabled` | +| `--p-surface-depressed` | `--p-color-bg-inset` | +| `--p-surface-dark` | `--p-color-bg-inverse` | +| `--p-surface-critical-subdued-pressed` | `--p-color-bg-critical-subdued-active` | +| `--p-surface-critical-subdued-hovered` | `--p-color-bg-critical-subdued-hover` | +| `--p-surface-critical-subdued-depressed` | `--p-color-bg-critical` | +| `--p-surface-critical-subdued` | `--p-color-bg-critical-subdued` | +| `--p-surface-critical` | `--p-color-bg-critical` | +| `--p-surface-attention` | `--p-color-bg-caution` | +| `--p-surface` | `--p-color-bg` | +| `--p-shadow-color-picker-dragger` | `rgba(33, 43, 54, 0.32)` | +| `--p-shadow-color-picker` | `rgba(0, 0, 0, 0.5)` | +| `--p-overlay` | `rgba(255, 255, 255, 0.5)` | +| `--p-interactive-pressed-on-dark` | `--p-color-text-interactive-inverse` | +| `--p-interactive-pressed` | For `color` properties: `--p-color-text-interactive-active`
For `background` properties: `--p-color-bg-interactive-active`
For `border` properties: `--p-color-border-interactive-active`
For `fill` properties: `--p-color-icon-interactive-active` | +| `--p-interactive-on-dark` | `--p-color-text-interactive-inverse` | +| `--p-interactive-hovered` | For `color` properties: `--p-color-text-interactive-hover`
For `background` properties: `--p-color-bg-interactive-hover`
For `border` properties: `--p-color-border-interactive-hover`
For `fill` properties: `--p-color-icon-interactive-hover` | +| `--p-interactive-disabled` | For `color` properties: `--p-color-text-interactive-disabled`
For `background` properties: `--p-color-bg-interactive-disabled`
For `border` properties: `--p-color-border-interactive-disabled`
For `fill` properties: `--p-color-icon-interactive-disabled` | +| `--p-interactive-critical-pressed` | `--p-color-text-critical-active` | +| `--p-interactive-critical-hovered` | `--p-color-bg-critical-strong-hover` | +| `--p-interactive-critical-disabled` | `--p-color-text-disabled` | +| `--p-interactive-critical` | For `color` properties: `--p-color-text-critical`
For `background` properties: `--p-color-bg-critical`
For `border` properties: `--p-color-border-critical`
For `fill` properties: `--p-color-icon-critical` | +| `--p-interactive` | For `color` properties: `--p-color-text-interactive`
For `background` properties: `--p-color-bg-interactive`
For `border` properties: `--p-color-border-interactive`
For `fill` properties: `--p-color-icon-interactive` | +| `--p-icon-warning` | `--p-color-icon-caution` | +| `--p-icon-success` | `--p-color-icon-success` | +| `--p-icon-subdued` | `--p-color-icon-subdued` | +| `--p-icon-pressed` | `--p-color-icon-active` | +| `--p-icon-on-primary` | `--p-color-icon-on-color` | +| `--p-icon-on-interactive` | `--p-color-icon-on-color` | +| `--p-icon-on-dark` | `--p-color-icon-inverse` | +| `--p-icon-on-critical` | `--p-color-icon-on-color` | +| `--p-icon-hovered` | `--p-color-icon-hover` | +| `--p-icon-highlight` | `--p-color-icon-info` | +| `--p-icon-disabled` | `--p-color-icon-disabled` | +| `--p-icon-critical` | `--p-color-icon-critical` | +| `--p-icon-attention` | `--p-color-icon-caution` | +| `--p-icon` | `--p-color-icon` | +| `--p-hint-from-direct-light` | `rgba(0, 0, 0, 0.15)` | +| `--p-focused` | `--p-color-border-interactive-focus` | +| `--p-divider-dark` | `--p-color-border-inverse` | +| `--p-divider` | `--p-color-border-subdued` | +| `--p-decorative-two-text` | `rgba(73, 11, 28, 1)` | +| `--p-decorative-two-surface` | `rgba(255, 196, 176, 1)` | +| `--p-decorative-two-icon` | `rgba(175, 41, 78, 1)` | +| `--p-decorative-three-text` | `rgba(0, 47, 25, 1)` | +| `--p-decorative-three-surface` | `rgba(146, 230, 181, 1)` | +| `--p-decorative-three-icon` | `rgba(0, 109, 65, 1)` | +| `--p-decorative-one-text` | `rgba(61, 40, 0, 1)` | +| `--p-decorative-one-surface` | `rgba(255, 201, 107, 1)` | +| `--p-decorative-one-icon` | `rgba(126, 87, 0, 1)` | +| `--p-decorative-four-text` | `rgba(0, 45, 45, 1)` | +| `--p-decorative-four-surface` | `rgba(145, 224, 214, 1)` | +| `--p-decorative-four-icon` | `rgba(0, 106, 104, 1)` | +| `--p-decorative-five-text` | `rgba(79, 14, 31, 1)` | +| `--p-decorative-five-surface` | `rgba(253, 201, 208, 1)` | +| `--p-decorative-five-icon` | `rgba(174, 43, 76, 1)` | +| `--p-border-warning-subdued` | `--p-color-border-caution-subdued` | +| `--p-border-warning` | `--p-color-border-caution` | +| `--p-border-success-subdued` | `--p-color-border-success-subdued` | +| `--p-border-success` | `--p-color-border-success` | +| `--p-border-subdued` | `--p-color-border-subdued` | +| `--p-border-shadow-subdued` | `--p-color-border-input` | +| `--p-border-shadow` | `--p-color-border-input` | +| `--p-border-on-dark` | `--p-color-border-inverse` | +| `--p-border-neutral-subdued` | `--p-color-border-strong` | +| `--p-border-hovered` | `--p-color-border-hover` | +| `--p-border-highlight-subdued` | `--p-color-border-info-subdued` | +| `--p-border-highlight` | `--p-color-border-info` | +| `--p-border-disabled` | `--p-color-border-disabled` | +| `--p-border-depressed` | `--p-color-border-inverse` | +| `--p-border-critical-subdued` | `--p-color-border-critical-subdued` | +| `--p-border-critical-disabled` | `--p-color-border-disabled` | +| `--p-border-critical` | `--p-color-border-critical` | +| `--p-border` | `--p-color-border` | +| `--p-background-selected` | `--p-color-bg-app-selected` | +| `--p-background-pressed` | `--p-color-bg-app-active` | +| `--p-background-hovered` | `--p-color-bg-app-hover` | +| `--p-background` | `--p-color-bg-app` | +| `--p-backdrop` | `rgba(0, 0, 0, 0.5)` | +| `--p-action-secondary-pressed-dark` | `--p-color-bg-inverse-active` | +| `--p-action-secondary-pressed` | `--p-color-bg-subdued-active` | +| `--p-action-secondary-hovered-dark` | `--p-color-bg-inverse-hover` | +| `--p-action-secondary-hovered` | `--p-color-bg-subdued-hover` | +| `--p-action-secondary-disabled` | `--p-color-bg-disabled` | +| `--p-action-secondary-depressed` | `--p-color-bg-inset-strong` | +| `--p-action-secondary` | `--p-color-bg-subdued` | +| `--p-action-primary-pressed` | `--p-color-bg-primary-active` | +| `--p-action-primary-hovered` | `--p-color-bg-primary-hover` | +| `--p-action-primary-disabled` | `--p-color-bg-disabled` | +| `--p-action-primary-depressed` | `--p-color-bg-primary-active` | +| `--p-action-primary` | For `color` properties: `--p-color-text-primary`
For `background` properties: `--p-color-bg-primary`
For `border` properties: `--p-color-border-primary`
For `fill` properties: `--p-color-icon-primary` | +| `--p-action-critical-pressed` | `--p-color-bg-critical-strong-active` | +| `--p-action-critical-hovered` | `--p-color-bg-critical-strong-hover` | +| `--p-action-critical-disabled` | `--p-color-bg-disabled` | +| `--p-action-critical-depressed` | `--p-color-bg-critical-strong-active` | +| `--p-action-critical` | `--p-color-bg-critical-strong` | + +### Depth + +| Deprecated Token | Replacement Value | +| ---------------------------------- | --------------------- | +| `--p-shadow-transparent` | `--p-shadow-none` | +| `--p-shadow-faint` | `--p-shadow-sm` | +| `--p-shadow-base` | `--p-shadow-md` | +| `--p-shadow-deep` | `--p-shadow-md` | +| `--p-shadow-button` | `--p-shadow-sm` | +| `--p-shadow-top-bar` | `--p-shadow-sm` | +| `--p-shadow-card` | `--p-shadow-md` | +| `--p-shadow-popover` | `--p-shadow-xl` | +| `--p-shadow-layer` | `--p-shadow-2xl` | +| `--p-shadow-modal` | `--p-shadow-2xl` | +| `--p-shadows-inset-button` | `--p-shadow-none` | +| `--p-shadows-inset-button-pressed` | `--p-shadow-inset-md` | + +### Legacy + +| Deprecated Token | Replacement Value | +| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--p-override-loading-z-index` | `--p-z-index-6` | +| `--p-choice-size` | `20px` / `1.25rem` | +| `--p-icon-size-small` | `8px` / `0.5rem` | +| `--p-icon-size-medium` | `20px` / `1.25rem` | +| `--p-choice-margin` | `--p-space-025` | +| `--p-control-border-width` | `--p-border-width-2` | +| `--p-banner-border-default` | `inset 0 var(--p-border-width-1) 0 0 var(--p-color-border-strong), inset 0 0 0 (--p-border-width-1) var(--p-color-border-strong)` | +| `--p-banner-border-success` | `inset 0 var(--p-border-width-1) 0 0 var(--p-color-border-success-subdued), inset 0 0 0 (--p-border-width-1) var(--p-color-border-success-subdued)` | +| `--p-banner-border-highlight` | `inset 0 var(--p-border-width-1) 0 0 var(--p-color-border-info-subdued), inset 0 0 0 (--p-border-width-1) var(--p-color-border-info-subdued)` | +| `--p-banner-border-warning` | `inset 0 var(--p-border-width-1) 0 0 var(--p-color-border-caution-subdued), inset 0 0 0 (--p-border-width-1)var(--p-color-border-caution-subdued)` | +| `--p-banner-border-critical` | `inset 0 var(--p-border-width-1) 0 0 var(--p-color-border-critical-subdued), inset 0 0 0 (--p-border-width-1) var(--p-color-border-critical-subdued)` | +| `--p-thin-border-subdued` | `var(--p-border-width-1) solid var(--p-color-border-subdued)` | +| `--p-text-field-spinner-offset` | `2px` / `0.125rem` | +| `--p-text-field-focus-ring-offset` | `-4px` / `-0.25rem` | +| `--p-button-group-item-spacing` | `calc(-1 * var(--p-space-025))` | +| `--p-range-slider-thumb-size-base` | `16px` / `1rem` | +| `--p-range-slider-thumb-size-active` | `24px` / `1.5rem` | +| `--p-frame-offset` | `0` | + +### Motion + +| Deprecated Token | Replacement Value | +| ---------------------------- | ----------------------------------- | +| `--p-linear` | `--p-motion-linear` | +| `--p-ease-in-out` | `--p-motion-ease-in-out` | +| `--p-ease-out` | `--p-motion-ease-out` | +| `--p-ease-in` | `--p-motion-ease-in` | +| `--p-ease` | `--p-motion-ease` | +| `--p-duration-0` | `--p-motion-duration-0` | +| `--p-duration-50` | `--p-motion-duration-50` | +| `--p-duration-100` | `--p-motion-duration-100` | +| `--p-duration-150` | `--p-motion-duration-150` | +| `--p-duration-200` | `--p-motion-duration-200` | +| `--p-duration-250` | `--p-motion-duration-250` | +| `--p-duration-300` | `--p-motion-duration-300` | +| `--p-duration-350` | `--p-motion-duration-350` | +| `--p-duration-400` | `--p-motion-duration-400` | +| `--p-duration-450` | `--p-motion-duration-450` | +| `--p-duration-500` | `--p-motion-duration-500` | +| `--p-duration-5000` | `--p-motion-duration-5000` | +| `--p-keyframes-bounce` | `--p-motion-keyframes-bounce` | +| `--p-keyframes-fade-in` | `--p-motion-keyframes-fade-in` | +| `--p-keyframes-pulse` | `--p-motion-keyframes-pulse` | +| `--p-keyframes-spin` | `--p-motion-keyframes-spin` | +| `--p-keyframes-appear-above` | `--p-motion-keyframes-appear-above` | +| `--p-keyframes-appear-below` | `--p-motion-keyframes-appear-below` | + +### Z-index + +| Deprecated Token | Replacement Value | +| ---------------- | ----------------- | +| `--p-z-1` | `--p-z-index-1` | +| `--p-z-2` | `--p-z-index-2` | +| `--p-z-3` | `--p-z-index-3` | +| `--p-z-4` | `--p-z-index-4` | +| `--p-z-5` | `--p-z-index-5` | +| `--p-z-6` | `--p-z-index-6` | +| `--p-z-7` | `--p-z-index-7` | +| `--p-z-8` | `--p-z-index-8` | +| `--p-z-9` | `--p-z-index-9` | +| `--p-z-10` | `--p-z-index-10` | +| `--p-z-11` | `--p-z-index-11` | +| `--p-z-12` | `--p-z-index-12` | diff --git a/polaris-codemods/src/codemods/v9-scss-replace-color/transform.ts b/polaris-codemods/src/codemods/v9-scss-replace-color/transform.ts index 2a69c7a1cfe..6bf657f7165 100644 --- a/polaris-codemods/src/codemods/v9-scss-replace-color/transform.ts +++ b/polaris-codemods/src/codemods/v9-scss-replace-color/transform.ts @@ -2,7 +2,8 @@ import type {FileInfo, API, Options} from 'jscodeshift'; import type {Plugin} from 'postcss'; import postcss from 'postcss'; import valueParser from 'postcss-value-parser'; -import {colors as tokenColors, createVar} from '@shopify/polaris-tokens'; +import {colors as tokenColors} from './v10-legacy-colors'; +import {createVar} from '@shopify/polaris-tokens'; import type {NamespaceOptions} from '../../utilities/sass'; import { diff --git a/polaris-tokens/src/token-groups/colors.ts b/polaris-codemods/src/codemods/v9-scss-replace-color/v10-legacy-colors.ts similarity index 84% rename from polaris-tokens/src/token-groups/colors.ts rename to polaris-codemods/src/codemods/v9-scss-replace-color/v10-legacy-colors.ts index 7f76aa17b3b..0b3c16e379b 100644 --- a/polaris-tokens/src/token-groups/colors.ts +++ b/polaris-codemods/src/codemods/v9-scss-replace-color/v10-legacy-colors.ts @@ -1,172 +1,4 @@ -import type {MetadataProperties} from '../types'; - -export type ColorsBackgroundTokenAlias = - | 'background' - | 'background-hovered' - | 'background-pressed' - | 'background-selected'; - -export type ColorsActionTokenAlias = - | 'action-critical' - | 'action-critical-depressed' - | 'action-critical-disabled' - | 'action-critical-hovered' - | 'action-critical-pressed' - | 'action-primary' - | 'action-primary-depressed' - | 'action-primary-disabled' - | 'action-primary-hovered' - | 'action-primary-pressed' - | 'action-secondary' - | 'action-secondary-depressed' - | 'action-secondary-disabled' - | 'action-secondary-hovered' - | 'action-secondary-hovered-dark' - | 'action-secondary-pressed' - | 'action-secondary-pressed-dark'; - -export type ColorsSurfaceTokenAlias = - | 'surface' - | 'surface-attention' - | 'surface-critical' - | 'surface-critical-subdued' - | 'surface-critical-subdued-depressed' - | 'surface-critical-subdued-hovered' - | 'surface-critical-subdued-pressed' - | 'surface-dark' - | 'surface-depressed' - | 'surface-disabled' - | 'surface-highlight' - | 'surface-highlight-subdued' - | 'surface-highlight-subdued-hovered' - | 'surface-highlight-subdued-pressed' - | 'surface-hovered' - | 'surface-hovered-dark' - | 'surface-neutral' - | 'surface-neutral-disabled' - | 'surface-neutral-hovered' - | 'surface-neutral-pressed' - | 'surface-neutral-subdued' - | 'surface-neutral-subdued-dark' - | 'surface-pressed' - | 'surface-pressed-dark' - | 'surface-primary-selected' - | 'surface-primary-selected-hovered' - | 'surface-primary-selected-pressed' - | 'surface-search-field' - | 'surface-search-field-dark' - | 'surface-selected' - | 'surface-selected-hovered' - | 'surface-selected-pressed' - | 'surface-subdued' - | 'surface-success' - | 'surface-success-subdued' - | 'surface-success-subdued-hovered' - | 'surface-success-subdued-pressed' - | 'surface-warning' - | 'surface-warning-subdued' - | 'surface-warning-subdued-hovered' - | 'surface-warning-subdued-pressed'; - -export type ColorsBackdropTokenAlias = 'backdrop'; - -export type ColorsOverlayTokenAlias = 'overlay'; - -export type ColorsBorderTokenAlias = - | 'border' - | 'border-on-dark' - | 'border-neutral-subdued' - | 'border-hovered' - | 'border-disabled' - | 'border-subdued' - | 'border-depressed' - | 'border-shadow' - | 'border-shadow-subdued' - | 'border-critical' - | 'border-critical-subdued' - | 'border-critical-disabled' - | 'border-warning' - | 'border-warning-subdued' - | 'border-highlight' - | 'border-highlight-subdued' - | 'border-success' - | 'border-success-subdued'; - -export type ColorsTokenName = - | ColorsBackgroundTokenAlias - | ColorsActionTokenAlias - | ColorsSurfaceTokenAlias - | ColorsBackdropTokenAlias - | ColorsOverlayTokenAlias - | ColorsBorderTokenAlias - | 'decorative-five-icon' - | 'decorative-five-surface' - | 'decorative-five-text' - | 'decorative-four-icon' - | 'decorative-four-surface' - | 'decorative-four-text' - | 'decorative-one-icon' - | 'decorative-one-surface' - | 'decorative-one-text' - | 'decorative-three-icon' - | 'decorative-three-surface' - | 'decorative-three-text' - | 'decorative-two-icon' - | 'decorative-two-surface' - | 'decorative-two-text' - | 'divider-dark' - | 'divider' - | 'focused' - | 'hint-from-direct-light' - | 'icon-attention' - | 'icon-critical' - | 'icon-disabled' - | 'icon-highlight' - | 'icon-hovered' - | 'icon-on-critical' - | 'icon-on-dark' - | 'icon-on-interactive' - | 'icon-on-primary' - | 'icon-pressed' - | 'icon-subdued' - | 'icon-success' - | 'icon-warning' - | 'icon' - | 'interactive-critical-disabled' - | 'interactive-critical-hovered' - | 'interactive-critical-pressed' - | 'interactive-critical' - | 'interactive-disabled' - | 'interactive-hovered' - | 'interactive-on-dark' - | 'interactive-pressed-on-dark' - | 'interactive-pressed' - | 'interactive' - | 'shadow-color-picker-dragger' - | 'shadow-color-picker' - | 'text' - | 'text-critical' - | 'text-disabled' - | 'text-highlight' - | 'text-on-critical' - | 'text-on-dark' - | 'text-on-interactive' - | 'text-on-primary' - | 'text-primary-hovered' - | 'text-primary-pressed' - | 'text-primary' - | 'text-subdued-on-dark' - | 'text-subdued' - | 'text-success' - | 'text-warning'; - -export type ColorsTokenGroup = { - [TokenName in ColorsTokenName]: string; -}; - -export const colors: { - [TokenName in ColorsTokenName]: MetadataProperties; -} = { +export const colors = { background: { value: 'rgba(246, 246, 247, 1)', description: diff --git a/polaris-for-vscode/src/server.ts b/polaris-for-vscode/src/server.ts index 3adf4caedd5..c467521d8bc 100644 --- a/polaris-for-vscode/src/server.ts +++ b/polaris-for-vscode/src/server.ts @@ -15,13 +15,7 @@ import type { } from 'vscode-languageserver/node'; import {TextDocument} from 'vscode-languageserver-textdocument'; -const excludedTokenGroupNames = [ - 'colors', - 'depth', - 'legacy', - 'spacing', - 'shape', -] as const; +const excludedTokenGroupNames = [] as const; type ExcludedTokenGroupName = typeof excludedTokenGroupNames[number]; diff --git a/polaris-migrator/src/migrations/v9-scss-replace-color/v10-legacy-colors.ts b/polaris-migrator/src/migrations/v9-scss-replace-color/v10-legacy-colors.ts new file mode 100644 index 00000000000..0b3c16e379b --- /dev/null +++ b/polaris-migrator/src/migrations/v9-scss-replace-color/v10-legacy-colors.ts @@ -0,0 +1,647 @@ +export const colors = { + background: { + value: 'rgba(246, 246, 247, 1)', + description: + 'For use as a background color, in components such as Page and Frame backgrounds.', + }, + 'background-hovered': { + value: 'rgba(241, 242, 243, 1)', + description: + 'For use when an action or navigation is used on a background.', + }, + 'background-pressed': { + value: 'rgba(237, 238, 239, 1)', + description: + 'For use when an action or navigation is used on a background.', + }, + 'background-selected': { + value: 'rgba(237, 238, 239, 1)', + description: 'For use in the selected item in navigation', + }, + surface: { + value: 'rgba(255, 255, 255, 1)', + description: + 'For use as a background color, in components such as Card, Modal, and Popover.', + }, + 'surface-dark': { + value: 'rgba(32, 33, 35, 1)', + description: + 'For use as a dark background color, in components such as Card, Modal, and Popover.', + }, + 'surface-neutral': { + value: 'rgba(228, 229, 231, 1)', + description: 'For use as a background color in neutral badges.', + }, + 'surface-neutral-hovered': { + value: 'rgba(219, 221, 223, 1)', + description: 'For use as a hovered background color in neutral badges.', + }, + 'surface-neutral-pressed': { + value: 'rgba(201, 204, 208, 1)', + description: 'For use as a pressed background color in neutral badges.', + }, + 'surface-neutral-disabled': { + value: 'rgba(241, 242, 243, 1)', + description: 'For use as a disabled background color in neutral badges.', + }, + 'surface-neutral-subdued': { + value: 'rgba(246, 246, 247, 1)', + description: 'For use as a background color in neutral banners.', + }, + 'surface-neutral-subdued-dark': { + value: 'rgba(68, 71, 74, 1)', + description: 'For use as a dark background color in neutral banners.', + }, + 'surface-subdued': { + value: 'rgba(250, 251, 251, 1)', + description: + 'For use as a subdued background color, in components such as Card, Modal, and Popover.', + }, + 'surface-disabled': { + value: 'rgba(250, 251, 251, 1)', + description: + 'For use as a surface color on disabled interactive elements such as option list items and action list items when in a disabled state.', + }, + 'surface-hovered': { + value: 'rgba(246, 246, 247, 1)', + description: + 'For use as a surface color on interactive elements such as resource list items and action list items when in a hovered state.', + }, + 'surface-hovered-dark': { + value: 'rgba(47, 49, 51, 1)', + description: + 'For use as a dark surface color on interactive elements such as resource list items and action list items when in a hovered state.', + }, + 'surface-pressed': { + value: 'rgba(241, 242, 243, 1)', + description: + 'For use as a surface color on interactive elements such as resource list items and action list items when in a pressed state.', + }, + 'surface-pressed-dark': { + value: 'rgba(62, 64, 67, 1)', + description: + 'For use as a dark surface color on interactive elements such as resource list items and action list items when in a pressed state.', + }, + 'surface-depressed': { + value: 'rgba(237, 238, 239, 1)', + description: + 'For use as a surface color on interactive elements such as resource list items and action list items when in a depressed state.', + }, + 'surface-search-field': { + value: 'rgba(241, 242, 243, 1)', + description: + 'For use as a background color, in components on surface elements such as SearchField', + }, + 'surface-search-field-dark': { + value: 'rgba(47, 49, 51, 1)', + description: + 'For use as a dark background color, in components on surface elements such as SearchField', + }, + backdrop: { + value: 'rgba(0, 0, 0, 0.5)', + description: + 'For use as the background color of the backdrop component for navigation and modal. This color has an alpha of `0.5`.', + }, + overlay: { + value: 'rgba(255, 255, 255, 0.5)', + description: + 'For use as the background color of elements which lay on top of surfaces to obscure their contents. This color has an alpha of `0.5`.', + }, + 'shadow-color-picker': { + value: 'rgba(0, 0, 0, 0.5)', + }, + 'shadow-color-picker-dragger': { + value: 'rgba(33, 43, 54, 0.32)', + }, + 'hint-from-direct-light': { + value: 'rgba(0, 0, 0, 0.15)', + description: 'For use in building shadows scrollables.', + }, + border: { + value: 'rgba(140, 145, 150, 1)', + description: 'For use as the default border on elements.', + }, + 'border-on-dark': { + value: 'rgba(80, 83, 86, 1)', + description: 'For use as the default border on dark elements.', + }, + 'border-neutral-subdued': { + value: 'rgba(186, 191, 195, 1)', + description: 'For use as the border on banners.', + }, + 'border-hovered': { + value: 'rgba(153, 158, 164, 1)', + description: 'Used for borders on hovered interactive elements', + }, + 'border-disabled': { + value: 'rgba(210, 213, 216, 1)', + description: 'Used for disabled borders on interactive elements', + }, + 'border-subdued': { + value: 'rgba(201, 204, 207, 1)', + description: 'For use as a subdued border on elements.', + }, + 'border-depressed': { + value: 'rgba(87, 89, 89, 1)', + description: 'For use as a border on depressed elements.', + }, + 'border-shadow': { + value: 'rgba(174, 180, 185, 1)', + description: 'For use as an additional bottom border on elements.', + }, + 'border-shadow-subdued': { + value: 'rgba(186, 191, 196, 1)', + description: 'For use as an additional, subdued bottom border on elements.', + }, + divider: { + value: 'rgba(225, 227, 229, 1)', + description: 'For use as a divider between elements.', + }, + 'divider-dark': { + value: 'rgba(69, 71, 73, 1)', + description: 'For use as a dark divider between elements.', + }, + icon: { + value: 'rgba(92, 95, 98, 1)', + description: 'For use as the fill color of icons.', + }, + 'icon-on-dark': { + value: 'rgba(166, 172, 178, 1)', + description: 'For use as the fill color of dark icons.', + }, + 'icon-hovered': { + value: 'rgba(26, 28, 29, 1)', + description: 'For use as the fill color of hovered icons.', + }, + 'icon-pressed': { + value: 'rgba(68, 71, 74, 1)', + description: 'For use as the fill color of pressed icons.', + }, + 'icon-disabled': { + value: 'rgba(186, 190, 195, 1)', + description: 'For use as the fill color of disabled icons.', + }, + 'icon-subdued': { + value: 'rgba(140, 145, 150, 1)', + description: 'For use as the fill color of subdued icons.', + }, + text: { + value: 'rgba(32, 34, 35, 1)', + description: 'For use as a text color.', + }, + 'text-on-dark': { + value: 'rgba(227, 229, 231, 1)', + description: 'For use as a text color on dark elements.', + }, + 'text-disabled': { + value: 'rgba(140, 145, 150, 1)', + description: + 'For use as a disabled text color and as a placeholder text color.', + }, + 'text-subdued': { + value: 'rgba(109, 113, 117, 1)', + description: 'For use as a subdued text color.', + }, + 'text-subdued-on-dark': { + value: 'rgba(153, 159, 164, 1)', + description: 'For use as a subdued text color on dark elements.', + }, + interactive: { + value: 'rgba(44, 110, 203, 1)', + description: + 'Used for links, plain buttons, and as the fill color for selected checkboxes and radio buttons.', + }, + 'interactive-on-dark': { + value: 'rgba(54, 163, 255, 1)', + description: + 'Used for links, plain buttons, and as the fill color for selected checkboxes and radio buttons when on a dark element.', + }, + 'interactive-disabled': { + value: 'rgba(189, 193, 204, 1)', + description: 'Used for disabled links and plain buttons.', + }, + 'interactive-hovered': { + value: 'rgba(31, 81, 153, 1)', + description: 'Used for hovered links and plain buttons.', + }, + 'interactive-pressed': { + value: 'rgba(16, 50, 98, 1)', + description: 'Used for pressed links and plain buttons.', + }, + 'interactive-pressed-on-dark': { + value: 'rgba(136, 188, 255, 1)', + description: 'Used for pressed links and plain buttons on dark elements.', + }, + focused: { + value: 'rgba(69, 143, 255, 1)', + description: 'For use in the focus ring on interactive elements.', + }, + 'surface-selected': { + value: 'rgba(242, 247, 254, 1)', + description: + 'For use as a surface color in selected interactive elements, in components such as action list and resource list.', + }, + 'surface-selected-hovered': { + value: 'rgba(237, 244, 254, 1)', + description: + 'For use as a surface color in selected interactive elements that are hovered, in components such as action list and resource list.', + }, + 'surface-selected-pressed': { + value: 'rgba(229, 239, 253, 1)', + description: + 'For use as a surface color in selected interactive elements that are pressed, in components such as action list and resource list.', + }, + 'icon-on-interactive': { + value: 'rgba(255, 255, 255, 1)', + description: 'For use as a fill color for icons on interactive elements.', + }, + 'text-on-interactive': { + value: 'rgba(255, 255, 255, 1)', + description: 'For use as a text color on interactive elements.', + }, + 'action-secondary': { + value: 'rgba(255, 255, 255, 1)', + description: + 'Used for secondary buttons and tertiary buttons, as well as in form elements as a background color and pontentially other secondary surfaces.', + }, + 'action-secondary-disabled': { + value: 'rgba(255, 255, 255, 1)', + description: 'Used as a disabled state for secondary buttons', + }, + 'action-secondary-hovered': { + value: 'rgba(246, 246, 247, 1)', + description: 'Used as a hovered state for secondary buttons', + }, + 'action-secondary-hovered-dark': { + value: 'rgba(84, 87, 91, 1)', + description: 'Used as a dark hovered state for secondary buttons', + }, + 'action-secondary-pressed': { + value: 'rgba(241, 242, 243, 1)', + description: 'Used as a pressed state for secondary buttons', + }, + 'action-secondary-pressed-dark': { + value: 'rgba(96, 100, 103, 1)', + description: 'Used as a dark pressed state for secondary buttons', + }, + 'action-secondary-depressed': { + value: 'rgba(109, 113, 117, 1)', + description: 'Used as a depressed state for secondary buttons', + }, + 'action-primary': { + value: 'rgba(0, 128, 96, 1)', + description: + 'Used as the background color for primary actions, and as the fill color for icons and the text color in navigation and tabs to communicate interaction states.', + }, + 'action-primary-disabled': { + value: 'rgba(241, 241, 241, 1)', + description: + 'Used as the background color for disabled primary actions, and as the fill color for icons and the text color in navigation and tabs to communicate interaction states.', + }, + 'action-primary-hovered': { + value: 'rgba(0, 110, 82, 1)', + description: + 'Used as the background color for hovered primary actions, and as the fill color for icons and the text color in navigation and tabs to communicate interaction states.', + }, + 'action-primary-pressed': { + value: 'rgba(0, 94, 70, 1)', + description: + 'Used as the background color for pressed primary actions, and as the fill color for icons and the text color in navigation and tabs to communicate interaction states.', + }, + 'action-primary-depressed': { + value: 'rgba(0, 61, 44, 1)', + description: + 'Used as the background color for pressed primary actions, and as the fill color for icons and the text color in navigation and tabs to communicate interaction states.', + }, + 'icon-on-primary': { + value: 'rgba(255, 255, 255, 1)', + description: + 'For use as a fill color for icons on primary actions. Not for use in icons on navigation and tabs.', + }, + 'text-on-primary': { + value: 'rgba(255, 255, 255, 1)', + description: + 'For use as a text color on primary actions. Not for use in text on navigation and tabs.', + }, + 'text-primary': { + value: 'rgba(0, 123, 92, 1)', + description: + 'For use as primary text color on background. For use in text in components such as Navigation.', + }, + 'text-primary-hovered': { + value: 'rgba(0, 108, 80, 1)', + description: + 'For use as primary hovered text color on background. For use in text in components such as Navigation.', + }, + 'text-primary-pressed': { + value: 'rgba(0, 92, 68, 1)', + description: + 'For use as primary pressed text color on background. For use in text in components such as Navigation.', + }, + 'surface-primary-selected': { + value: 'rgba(241, 248, 245, 1)', + description: + 'Used as a surface color to indicate selected interactive states in navigation and tabs.', + }, + 'surface-primary-selected-hovered': { + value: 'rgba(179, 208, 195, 1)', + description: + 'Used as a surface color to indicate selected interactive states that are hovered in navigation and tabs.', + }, + 'surface-primary-selected-pressed': { + value: 'rgba(162, 188, 176, 1)', + description: + 'Used as a surface color to indicate selected interactive states that are pressed in navigation and tabs.', + }, + 'border-critical': { + value: 'rgba(253, 87, 73, 1)', + description: + 'For use as a border on critical components such as an outline on interactive elements in an error state.', + }, + 'border-critical-subdued': { + value: 'rgba(224, 179, 178, 1)', + description: 'For use as a border on critical components such as banners.', + }, + 'border-critical-disabled': { + value: 'rgba(255, 167, 163, 1)', + description: + 'For use as a disabled border on critical components such as banners, and as an outline on interactive elements in an error state.', + }, + 'icon-critical': { + value: 'rgba(215, 44, 13, 1)', + description: 'For use as an icon fill color on top of critical elements.', + }, + 'surface-critical': { + value: 'rgba(254, 211, 209, 1)', + description: + 'For use as a surface color on critical elements including badges.', + }, + 'surface-critical-subdued': { + value: 'rgba(255, 244, 244, 1)', + description: + 'For use as a subdued surface color on critical elements including banners.', + }, + 'surface-critical-subdued-hovered': { + value: 'rgba(255, 240, 240, 1)', + description: + 'For use as a surface color on critical interactive elements including action list items in a hovered state.', + }, + 'surface-critical-subdued-pressed': { + value: 'rgba(255, 233, 232, 1)', + description: + 'For use as a surface color on critical interactive elements including action list items in a pressed state.', + }, + 'surface-critical-subdued-depressed': { + value: 'rgba(254, 188, 185, 1)', + description: + 'For use as a surface color on critical interactive elements including action list items in a depressed state.', + }, + 'text-critical': { + value: 'rgba(215, 44, 13, 1)', + description: + 'For use as a text color in inert critical elements such as exception list. Not for use as a text color on banners and badges.', + }, + 'action-critical': { + value: 'rgba(216, 44, 13, 1)', + description: + 'For use as the background color for destructive buttons, and as the background color for error toast messages.', + }, + 'action-critical-disabled': { + value: 'rgba(241, 241, 241, 1)', + description: + 'For use as the background color for disabled destructive buttons, and as the background color for error toast messages.', + }, + 'action-critical-hovered': { + value: 'rgba(188, 34, 0, 1)', + description: + 'For use as the background color for hovered destructive buttons, and as the background color for error toast messages.', + }, + 'action-critical-pressed': { + value: 'rgba(162, 27, 0, 1)', + description: + 'For use as the background color for pressed destructive buttons, and as the background color for error toast messages.', + }, + 'action-critical-depressed': { + value: 'rgba(108, 15, 0, 1)', + description: + 'For use as the background color for depressed destructive buttons, and as the background color for error toast messages.', + }, + 'icon-on-critical': { + value: 'rgba(255, 255, 255, 1)', + description: 'For use as a fill color for icons on critical actions.', + }, + 'text-on-critical': { + value: 'rgba(255, 255, 255, 1)', + description: 'For use as a text color on critical actions.', + }, + 'interactive-critical': { + value: 'rgba(216, 44, 13, 1)', + description: + 'For use as the text color for destructive interactive elements: links, plain buttons, error state of selected checkboxes and radio buttons, as well as a text color on destructive action list items. Not for use on critical banners and badges.', + }, + 'interactive-critical-disabled': { + value: 'rgba(253, 147, 141, 1)', + description: + 'For use as a text color in disabled destructive plain buttons, as well as a text color on destructive action list items. Not for use on critical banners and badges.', + }, + 'interactive-critical-hovered': { + value: 'rgba(205, 41, 12, 1)', + description: + 'For use as a text color in hovered destructive plain buttons, as well as a text color on destructive action list items. Not for use on critical banners and badges.', + }, + 'interactive-critical-pressed': { + value: 'rgba(103, 15, 3, 1)', + description: + 'For use as a text color in pressed destructive plain buttons, as well as a text color on destructive action list items. Not for use on critical banners and badges.', + }, + 'border-warning': { + value: 'rgba(185, 137, 0, 1)', + description: 'For use as a border on warning components such as...', + }, + 'border-warning-subdued': { + value: 'rgba(225, 184, 120, 1)', + description: 'For use as a border on warning components such as banners.', + }, + 'icon-warning': { + value: 'rgba(185, 137, 0, 1)', + description: 'For use as an icon fill color on top of warning elements.', + }, + 'surface-warning': { + value: 'rgba(255, 215, 157, 1)', + description: + 'For use as a surface color on warning elements including badges.', + }, + 'surface-warning-subdued': { + value: 'rgba(255, 245, 234, 1)', + description: + 'For use as a subdued surface color on warning elements including banners.', + }, + 'surface-warning-subdued-hovered': { + value: 'rgba(255, 242, 226, 1)', + description: + 'For use as a subdued surface color on warning elements including banners.', + }, + 'surface-warning-subdued-pressed': { + value: 'rgba(255, 235, 211, 1)', + description: + 'For use as a subdued surface color on warning elements including banners.', + }, + 'text-warning': { + value: 'rgba(145, 106, 0, 1)', + description: + 'For use as a text color in inert critical elements such as exception list. Not for use as a text color on banners and badges.', + }, + 'border-highlight': { + value: 'rgba(68, 157, 167, 1)', + description: 'For use as a border on informational components such as...', + }, + 'border-highlight-subdued': { + value: 'rgba(152, 198, 205, 1)', + description: + 'For use as a border on informational components such as banners.', + }, + 'icon-highlight': { + value: 'rgba(0, 160, 172, 1)', + description: + 'For use as an icon fill color on top of informational elements.', + }, + 'surface-highlight': { + value: 'rgba(164, 232, 242, 1)', + description: + 'For use as a surface color on information elements including badges.', + }, + 'surface-highlight-subdued': { + value: 'rgba(235, 249, 252, 1)', + description: + 'For use as a surface color on information elements including banners.', + }, + 'surface-highlight-subdued-hovered': { + value: 'rgba(228, 247, 250, 1)', + description: + 'For use as a surface color on information elements including banners.', + }, + 'surface-highlight-subdued-pressed': { + value: 'rgba(213, 243, 248, 1)', + description: + 'For use as a surface color on information elements including banners.', + }, + 'text-highlight': { + value: 'rgba(52, 124, 132, 1)', + description: + 'For use as a text color in inert informational elements. Not for use as a text color on banners and badges.', + }, + 'border-success': { + value: 'rgba(0, 164, 124, 1)', + description: + 'For use as a border on success components such as text inputs.', + }, + 'border-success-subdued': { + value: 'rgba(149, 201, 180, 1)', + description: 'For use as a border on success components such as banners.', + }, + 'icon-success': { + value: 'rgba(0, 127, 95, 1)', + description: 'For use as an icon fill color on top of success elements.', + }, + 'surface-success': { + value: 'rgba(174, 233, 209, 1)', + description: + 'For use as a surface color on success elements including badges.', + }, + 'surface-success-subdued': { + value: 'rgba(241, 248, 245, 1)', + description: + 'For use as a surface color on information elements including banners.', + }, + 'surface-success-subdued-hovered': { + value: 'rgba(236, 246, 241, 1)', + description: + 'For use as a surface color on information elements including banners.', + }, + 'surface-success-subdued-pressed': { + value: 'rgba(226, 241, 234, 1)', + description: + 'For use as a surface color on information elements including banners.', + }, + 'text-success': { + value: 'rgba(0, 128, 96, 1)', + description: + 'For use as a text color in inert success elements. Not for use as a text color on banners and badges.', + }, + 'icon-attention': { + value: 'rgba(138, 97, 22, 1)', + }, + 'surface-attention': { + value: 'rgba(255, 234, 138, 1)', + }, + 'decorative-one-icon': { + value: 'rgba(126, 87, 0, 1)', + description: + 'For use as a decorative icon color that is applied on a decorative surface.', + }, + 'decorative-one-surface': { + value: 'rgba(255, 201, 107, 1)', + description: 'For use as a decorative surface color.', + }, + 'decorative-one-text': { + value: 'rgba(61, 40, 0, 1)', + description: + 'For use as a decorative text color that is applied on a decorative surface.', + }, + 'decorative-two-icon': { + value: 'rgba(175, 41, 78, 1)', + description: + 'For use as a decorative icon color that is applied on a decorative surface.', + }, + 'decorative-two-surface': { + value: 'rgba(255, 196, 176, 1)', + description: 'For use as a decorative surface color.', + }, + 'decorative-two-text': { + value: 'rgba(73, 11, 28, 1)', + description: + 'For use as a decorative text color that is applied on a decorative surface.', + }, + 'decorative-three-icon': { + value: 'rgba(0, 109, 65, 1)', + description: + 'For use as a decorative icon color that is applied on a decorative surface.', + }, + 'decorative-three-surface': { + value: 'rgba(146, 230, 181, 1)', + description: 'For use as a decorative surface color.', + }, + 'decorative-three-text': { + value: 'rgba(0, 47, 25, 1)', + description: + 'For use as a decorative text color that is applied on a decorative surface.', + }, + 'decorative-four-icon': { + value: 'rgba(0, 106, 104, 1)', + description: + 'For use as a decorative icon color that is applied on a decorative surface.', + }, + 'decorative-four-surface': { + value: 'rgba(145, 224, 214, 1)', + description: 'For use as a decorative surface color.', + }, + 'decorative-four-text': { + value: 'rgba(0, 45, 45, 1)', + description: + 'For use as a decorative text color that is applied on a decorative surface.', + }, + 'decorative-five-icon': { + value: 'rgba(174, 43, 76, 1)', + description: + 'For use as a decorative icon color that is applied on a decorative surface.', + }, + 'decorative-five-surface': { + value: 'rgba(253, 201, 208, 1)', + description: 'For use as a decorative surface color.', + }, + 'decorative-five-text': { + value: 'rgba(79, 14, 31, 1)', + description: + 'For use as a decorative text color that is applied on a decorative surface.', + }, +}; diff --git a/polaris-migrator/src/migrations/v9-scss-replace-color/v9-scss-replace-color.ts b/polaris-migrator/src/migrations/v9-scss-replace-color/v9-scss-replace-color.ts index afdd6fda4c6..02ddcf003f0 100644 --- a/polaris-migrator/src/migrations/v9-scss-replace-color/v9-scss-replace-color.ts +++ b/polaris-migrator/src/migrations/v9-scss-replace-color/v9-scss-replace-color.ts @@ -2,7 +2,7 @@ import type {FileInfo, API, Options} from 'jscodeshift'; import postcss from 'postcss'; import type {Plugin} from 'postcss'; import valueParser from 'postcss-value-parser'; -import {colors as tokenColors, createVar} from '@shopify/polaris-tokens'; +import {createVar} from '@shopify/polaris-tokens'; import { namespace, @@ -13,6 +13,8 @@ import { import type {NamespaceOptions} from '../../utilities/sass'; import {isKeyOf} from '../../utilities/type-guards'; +import {colors as tokenColors} from './v10-legacy-colors'; + export default function scssReplaceColor( file: FileInfo, _: API, diff --git a/polaris-react/scripts/build-validate.js b/polaris-react/scripts/build-validate.js index e38a49eaf2a..b134f8a9f4d 100644 --- a/polaris-react/scripts/build-validate.js +++ b/polaris-react/scripts/build-validate.js @@ -43,7 +43,7 @@ function validateStandardBuild() { const cssContent = fs.readFileSync('./build/esm/styles.css', 'utf-8'); assert.ok(cssContent.includes('.Polaris-Avatar {')); assert.ok(cssContent.includes('.Polaris-BulkActions__BulkActionButton {')); - assert.ok(cssContent.includes('@keyframes p-keyframes-bounce {')); + assert.ok(cssContent.includes('@keyframes p-motion-keyframes-bounce {')); assert.ok( cssContent.includes( '--p-motion-keyframes-bounce:p-motion-keyframes-bounce;', @@ -70,7 +70,9 @@ function validateEsNextBuild() { 'utf-8', ); assert.ok(cssContent.includes('.Polaris-Avatar_z763p {')); - assert.ok(cssKeyframesContent.includes('@keyframes p-keyframes-spin {')); + assert.ok( + cssKeyframesContent.includes('@keyframes p-motion-keyframes-spin {'), + ); assert.ok( cssKeyframesContent.includes( '--p-motion-keyframes-spin:p-motion-keyframes-spin;', diff --git a/polaris-react/src/components/Filters/Filters.scss b/polaris-react/src/components/Filters/Filters.scss index 27b9f6e6b9e..0d89f50303a 100644 --- a/polaris-react/src/components/Filters/Filters.scss +++ b/polaris-react/src/components/Filters/Filters.scss @@ -183,8 +183,8 @@ background: linear-gradient( 90deg, rgba(255, 255, 255, 0) 0%, - var(--p-surface) 70%, - var(--p-surface) 100% + var(--p-color-bg) 70%, + var(--p-color-bg) 100% ); // stylelint-enable } diff --git a/polaris-react/src/components/Filters/Filters.tsx b/polaris-react/src/components/Filters/Filters.tsx index a44624bfece..c49caeaa631 100644 --- a/polaris-react/src/components/Filters/Filters.tsx +++ b/polaris-react/src/components/Filters/Filters.tsx @@ -22,7 +22,7 @@ const TRANSITION_DURATION = 'var(--p-motion-duration-150)'; const TRANSITION_MARGIN = '-36px'; const defaultStyle = { - transition: `opacity ${TRANSITION_DURATION} var(--p-ease)`, + transition: `opacity ${TRANSITION_DURATION} var(--p-motion-ease)`, opacity: 0, }; @@ -35,7 +35,7 @@ const transitionStyles = { }; const defaultFilterStyles = { - transition: `opacity ${TRANSITION_DURATION} var(--p-ease), margin ${TRANSITION_DURATION} var(--p-ease)`, + transition: `opacity ${TRANSITION_DURATION} var(--p-motion-ease), margin ${TRANSITION_DURATION} var(--p-motion-ease)`, opacity: 0, marginTop: TRANSITION_MARGIN, }; diff --git a/polaris-react/src/components/Frame/Frame.tsx b/polaris-react/src/components/Frame/Frame.tsx index c5294742a70..547d92fff2c 100644 --- a/polaris-react/src/components/Frame/Frame.tsx +++ b/polaris-react/src/components/Frame/Frame.tsx @@ -137,7 +137,7 @@ class FrameInner extends PureComponent { appear={isNavigationCollapsed} exit={isNavigationCollapsed} in={showMobileNavigation} - timeout={parseInt(motion['duration-300'], 10)} + timeout={parseInt(motion['motion-duration-300'], 10)} classNames={navTransitionClasses} >
diff --git a/polaris-react/src/components/Popover/components/PopoverOverlay/PopoverOverlay.tsx b/polaris-react/src/components/Popover/components/PopoverOverlay/PopoverOverlay.tsx index e8c87e0c083..0efc4be794c 100644 --- a/polaris-react/src/components/Popover/components/PopoverOverlay/PopoverOverlay.tsx +++ b/polaris-react/src/components/Popover/components/PopoverOverlay/PopoverOverlay.tsx @@ -107,7 +107,7 @@ export class PopoverOverlay extends PureComponent { this.clearTransitionTimeout(); this.enteringTimer = window.setTimeout(() => { this.setState({transitionStatus: TransitionStatus.Entered}); - }, parseInt(motion['duration-100'], 10)); + }, parseInt(motion['motion-duration-100'], 10)); }); } diff --git a/polaris-react/src/components/ProgressBar/ProgressBar.tsx b/polaris-react/src/components/ProgressBar/ProgressBar.tsx index c93b03a3736..c9991b5ccb2 100644 --- a/polaris-react/src/components/ProgressBar/ProgressBar.tsx +++ b/polaris-react/src/components/ProgressBar/ProgressBar.tsx @@ -63,8 +63,8 @@ export function ProgressBar({ const parsedProgress = parseProgress(progress, warningMessage); const progressBarDuration = hasAppearAnimation - ? motion['duration-500'] - : motion['duration-0']; + ? motion['motion-duration-500'] + : motion['motion-duration-0']; /* eslint-disable @shopify/jsx-no-hardcoded-content */ return ( diff --git a/polaris-react/src/components/Sheet/Sheet.tsx b/polaris-react/src/components/Sheet/Sheet.tsx index ed50cfb1baf..a7f8ae7f361 100644 --- a/polaris-react/src/components/Sheet/Sheet.tsx +++ b/polaris-react/src/components/Sheet/Sheet.tsx @@ -94,7 +94,7 @@ export function Sheet({ classNames={ isNavigationCollapsed ? BOTTOM_CLASS_NAMES : RIGHT_CLASS_NAMES } - timeout={parseInt(motion['duration-300'], 10)} + timeout={parseInt(motion['motion-duration-300'], 10)} in={open} mountOnEnter unmountOnExit diff --git a/polaris-tokens/README.md b/polaris-tokens/README.md index 70812e59198..8202166c451 100644 --- a/polaris-tokens/README.md +++ b/polaris-tokens/README.md @@ -24,13 +24,13 @@ Accessing all of the available token groups // Token values only import {tokens} from '@shopify/polaris-tokens'; -console.log(tokens.colors.background); // 'rgba(246, 246, 247, 1)' +console.log(tokens.color['color-bg']); // 'rgba(...)' // Tokens with metadata import {metadata} from '@shopify/polaris-tokens'; -console.log(metadata.colors.background.value); // 'rgba(246, 246, 247, 1)' -console.log(metadata.colors.background.description); // 'For use as a background color, in components such as Page and Frame backgrounds.' +console.log(metadata.color['color-bg'].value); // 'rgba(...)' +console.log(metadata.color['color-bg'].description); // 'For use as a background color, in components such as Page and Frame backgrounds.' ``` #### CSS @@ -41,7 +41,7 @@ Importing all of the css variables. CSS variables are prefixed with `--p` to sig import '@shopify/polaris-tokens/css/styles.css'; div { - background: var(--p-background); + background: var(--p-color-bg); } ``` diff --git a/polaris-tokens/src/index.ts b/polaris-tokens/src/index.ts index bcc39ac7360..299e7355a59 100644 --- a/polaris-tokens/src/index.ts +++ b/polaris-tokens/src/index.ts @@ -7,23 +7,19 @@ export type { MetadataGroup, } from './types'; +export type { + BorderTokenGroup, + BorderTokenName, + BorderRadiusScale, + BorderWidthScale, +} from './token-groups/border'; + export type { BreakpointsTokenGroup, BreakpointsTokenName, BreakpointsAlias, } from './token-groups/breakpoints'; -export type { - ColorsTokenGroup, - ColorsTokenName, - ColorsBackgroundTokenAlias, - ColorsActionTokenAlias, - ColorsSurfaceTokenAlias, - ColorsBackdropTokenAlias, - ColorsOverlayTokenAlias, - ColorsBorderTokenAlias, -} from './token-groups/colors'; - export type { ColorTokenGroup, ColorTokenName, @@ -33,12 +29,6 @@ export type { ColorTextAlias, } from './token-groups/color'; -export type { - DepthTokenGroup, - DepthTokenName, - DepthShadowAlias, -} from './token-groups/depth'; - export type { FontTokenGroup, FontTokenName, @@ -60,27 +50,6 @@ export type { ShadowAlias, } from './token-groups/shadow'; -export type { - ShapeTokenGroup, - ShapeTokenName, - ShapeBorderRadiusScale, - ShapeBorderRadiusAlias, - ShapeBorderWidthScale, -} from './token-groups/shape'; - -export type { - BorderTokenGroup, - BorderTokenName, - BorderRadiusScale, - BorderWidthScale, -} from './token-groups/border'; - -export type { - SpacingTokenGroup, - SpacingTokenName, - SpacingSpaceScale, -} from './token-groups/spacing'; - export type { SpaceTokenGroup, SpaceTokenName, diff --git a/polaris-tokens/src/metadata.ts b/polaris-tokens/src/metadata.ts index ed8a0c08cb3..01f1a1943e3 100644 --- a/polaris-tokens/src/metadata.ts +++ b/polaris-tokens/src/metadata.ts @@ -1,15 +1,11 @@ import type {Exact, MetadataBase} from './types'; import {tokensToRems} from './utilities'; -import {breakpoints} from './token-groups/breakpoints'; import {border} from './token-groups/border'; -import {depth} from './token-groups/depth'; -import {font} from './token-groups/font'; +import {breakpoints} from './token-groups/breakpoints'; import {color} from './token-groups/color'; -import {colors} from './token-groups/colors'; +import {font} from './token-groups/font'; import {motion} from './token-groups/motion'; import {shadow} from './token-groups/shadow'; -import {shape} from './token-groups/shape'; -import {spacing} from './token-groups/spacing'; import {space} from './token-groups/space'; import {zIndex} from './token-groups/zIndex'; @@ -17,13 +13,9 @@ export const metadata = createMetadata({ breakpoints: tokensToRems(breakpoints), border: tokensToRems(border), color, - colors, - depth, font: tokensToRems(font), motion, shadow: tokensToRems(shadow), - shape: tokensToRems(shape), - spacing: tokensToRems(spacing), space: tokensToRems(space), zIndex, }); diff --git a/polaris-tokens/src/token-groups/depth.ts b/polaris-tokens/src/token-groups/depth.ts deleted file mode 100644 index cce049fd992..00000000000 --- a/polaris-tokens/src/token-groups/depth.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type {MetadataProperties} from '../types'; - -export type DepthShadowAlias = - | 'base' - | 'transparent' - | 'faint' - | 'deep' - | 'button' - | 'top-bar' - | 'card' - | 'popover' - | 'layer' - | 'modal'; - -type DepthShadowsAlias = 'inset-button' | 'inset-button-pressed'; - -export type DepthTokenName = - | `shadow-${DepthShadowAlias}` - | `shadows-${DepthShadowsAlias}`; - -export type DepthTokenGroup = { - [TokenName in DepthTokenName]: string; -}; - -export const depth: { - [TokenName in DepthTokenName]: MetadataProperties; -} = { - 'shadow-transparent': { - value: '0 0 0 0 transparent', - }, - 'shadow-faint': { - value: '0 1px 0 0 rgba(22, 29, 37, 0.05)', - }, - 'shadow-base': { - value: - '0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px 0 rgba(63, 63, 68, 0.15)', - }, - 'shadow-deep': { - value: '0 0 0 1px rgba(6, 44, 82, 0.1), 0 2px 16px rgba(33, 43, 54, 0.08)', - }, - 'shadow-button': { - value: '0 1px 0 rgba(0, 0, 0, 0.05)', - }, - 'shadow-top-bar': { - value: '0 2px 2px -1px rgba(0, 0, 0, 0.15)', - }, - 'shadow-card': { - value: '0 0 5px rgba(23, 24, 24, 0.05), 0 1px 2px rgba(0, 0, 0, 0.15)', - }, - 'shadow-popover': { - value: - '0 3px 6px -3px rgba(23, 24, 24, 0.08), 0 8px 20px -4px rgba(23, 24, 24, 0.12)', - }, - 'shadow-layer': { - value: - '0 31px 41px 0 rgba(32, 42, 53, 0.2), 0 2px 16px 0 rgba(32, 42, 54, 0.08)', - }, - 'shadow-modal': { - value: '0 26px 80px rgba(0, 0, 0, 0.2), 0 0px 1px rgba(0, 0, 0, 0.2)', - }, - 'shadows-inset-button': { - value: 'inset 0 -1px 0 rgba(0, 0, 0, 0.2)', - }, - 'shadows-inset-button-pressed': { - value: 'inset 0 1px 0 rgba(0, 0, 0, 0.15)', - }, -}; diff --git a/polaris-tokens/src/token-groups/motion.ts b/polaris-tokens/src/token-groups/motion.ts index e7d7cccc419..6bf7428badd 100644 --- a/polaris-tokens/src/token-groups/motion.ts +++ b/polaris-tokens/src/token-groups/motion.ts @@ -30,9 +30,6 @@ type MotionTimingFunctionAlias = | 'linear'; export type MotionTokenName = - | `duration-${MotionDurationScale}` - | `keyframes-${MotionKeyframesAlias}` - | MotionTimingFunctionAlias | `motion-duration-${MotionDurationScale}` | `motion-keyframes-${MotionKeyframesAlias}` | `motion-${MotionTimingFunctionAlias}`; @@ -44,87 +41,6 @@ export type MotionTokenGroup = { export const motion: { [TokenName in MotionTokenName]: MetadataProperties; } = { - 'duration-0': { - value: '0ms', - }, - 'duration-50': { - value: '50ms', - }, - 'duration-100': { - value: '100ms', - }, - 'duration-150': { - value: '150ms', - }, - 'duration-200': { - value: '200ms', - }, - 'duration-250': { - value: '250ms', - }, - 'duration-300': { - value: '300ms', - }, - 'duration-350': { - value: '350ms', - }, - 'duration-400': { - value: '400ms', - }, - 'duration-450': { - value: '450ms', - }, - 'duration-500': { - value: '500ms', - }, - 'duration-5000': { - value: '5000ms', - }, - ease: { - value: 'cubic-bezier(0.25, 0.1, 0.25, 1)', - description: - 'Responds quickly and finishes with control. A great default for any user interaction.', - }, - 'ease-in': { - value: 'cubic-bezier(0.42, 0, 1, 1)', - description: 'Starts slowly and finishes at top speed. Use sparingly.', - }, - 'ease-out': { - value: 'cubic-bezier(0, 0, 0.58, 1)', - description: 'Starts at top speed and finishes slowly. Use sparingly.', - }, - 'ease-in-out': { - value: 'cubic-bezier(0.42, 0, 0.58, 1)', - description: - 'Starts and finishes with equal speed. A good default for transitions triggered by the system.', - }, - linear: { - value: 'cubic-bezier(0, 0, 1, 1)', - description: - 'Moves with constant speed. Use for continuous and mechanical animations, such as rotating spinners.', - }, - 'keyframes-bounce': { - value: - '{ from, 65%, 85% { transform: scale(1) } 75% { transform: scale(0.85) } 82.5% { transform: scale(1.05) } }', - }, - 'keyframes-fade-in': { - value: '{ to { opacity: 1 } }', - }, - 'keyframes-pulse': { - value: - '{ from, 75% { transform: scale(0.85); opacity: 1; } to { transform: scale(2.5); opacity: 0; } }', - }, - 'keyframes-spin': { - value: '{ to { transform: rotate(1turn) } }', - }, - 'keyframes-appear-above': { - value: - '{ from { transform: translateY(var(--p-space-1)); opacity: 0; } to { transform: none; opacity: 1; } }', - }, - 'keyframes-appear-below': { - value: - '{ from { transform: translateY(calc(var(--p-space-1) * -1)); opacity: 0; } to { transform: none; opacity: 1; } }', - }, 'motion-duration-0': { value: '0ms', }, diff --git a/polaris-tokens/src/token-groups/shape.ts b/polaris-tokens/src/token-groups/shape.ts deleted file mode 100644 index f430216eff2..00000000000 --- a/polaris-tokens/src/token-groups/shape.ts +++ /dev/null @@ -1,100 +0,0 @@ -import type {MetadataProperties} from '../types'; - -export type ShapeBorderRadiusScale = - | '05' - | '1' - | '2' - | '3' - | '4' - | '5' - | '6' - | 'full'; - -export type ShapeBorderRadiusAlias = 'base' | 'large' | 'half'; - -export type ShapeBorderWidthScale = '1' | '2' | '3' | '4' | '5'; - -type ShapeBorderAlias = - | 'base' - | 'dark' - | 'transparent' - | 'divider' - | 'divider-on-dark'; - -export type ShapeTokenName = - | `border-radius-${ShapeBorderRadiusScale}` - | `border-radius-${ShapeBorderRadiusAlias}` - | `border-width-${ShapeBorderWidthScale}` - | `border-${ShapeBorderAlias}`; - -export type ShapeTokenGroup = { - [TokenName in ShapeTokenName]: string; -}; - -export const shape: { - [TokenName in ShapeTokenName]: MetadataProperties; -} = { - 'border-radius-05': { - value: '2px', - }, - 'border-radius-1': { - value: '4px', - }, - 'border-radius-2': { - value: '8px', - }, - 'border-radius-3': { - value: '12px', - }, - 'border-radius-4': { - value: '16px', - }, - 'border-radius-5': { - value: '20px', - }, - 'border-radius-6': { - value: '30px', - }, - 'border-radius-full': { - value: '9999px', - }, - 'border-radius-base': { - value: '3px', - }, - 'border-radius-large': { - value: '6px', - }, - 'border-radius-half': { - value: '50%', - }, - 'border-width-1': { - value: '1px', - }, - 'border-width-2': { - value: '2px', - }, - 'border-width-3': { - value: '3px', - }, - 'border-width-4': { - value: '4px', - }, - 'border-width-5': { - value: '5px', - }, - 'border-base': { - value: 'var(--p-border-width-1) solid var(--p-color-border-subdued)', - }, - 'border-dark': { - value: 'var(--p-border-width-1) solid var(--p-color-border)', - }, - 'border-transparent': { - value: 'var(--p-border-width-1) solid transparent', - }, - 'border-divider': { - value: 'var(--p-border-width-1) solid var(--p-color-border-subdued)', - }, - 'border-divider-on-dark': { - value: 'var(--p-border-width-1) solid var(--p-color-border-inverse)', - }, -}; diff --git a/polaris-tokens/src/token-groups/spacing.ts b/polaris-tokens/src/token-groups/spacing.ts deleted file mode 100644 index 070f1463353..00000000000 --- a/polaris-tokens/src/token-groups/spacing.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type {MetadataProperties} from '../types'; - -export type SpacingSpaceScale = - | '0' - | '025' - | '05' - | '1' - | '2' - | '3' - | '4' - | '5' - | '6' - | '8' - | '10' - | '12' - | '16' - | '20' - | '24' - | '28' - | '32'; - -export type SpacingTokenName = `space-${SpacingSpaceScale}`; - -export type SpacingTokenGroup = { - [TokenName in SpacingTokenName]: string; -}; - -export const spacing: { - [TokenName in SpacingTokenName]: MetadataProperties; -} = { - 'space-0': { - value: '0', - }, - 'space-025': { - value: '1px', - }, - 'space-05': { - value: '2px', - }, - 'space-1': { - value: '4px', - }, - 'space-2': { - value: '8px', - }, - 'space-3': { - value: '12px', - }, - 'space-4': { - value: '16px', - }, - 'space-5': { - value: '20px', - }, - 'space-6': { - value: '24px', - }, - 'space-8': { - value: '32px', - }, - 'space-10': { - value: '40px', - }, - 'space-12': { - value: '48px', - }, - 'space-16': { - value: '64px', - }, - 'space-20': { - value: '80px', - }, - 'space-24': { - value: '96px', - }, - 'space-28': { - value: '112px', - }, - 'space-32': { - value: '128px', - }, -}; diff --git a/polaris-tokens/src/token-groups/zIndex.ts b/polaris-tokens/src/token-groups/zIndex.ts index e61819dfdb1..2aef2296b60 100644 --- a/polaris-tokens/src/token-groups/zIndex.ts +++ b/polaris-tokens/src/token-groups/zIndex.ts @@ -14,7 +14,7 @@ export type ZIndexZScale = | '11' | '12'; -export type ZIndexTokenName = `z-index-${ZIndexZScale}` | `z-${ZIndexZScale}`; +export type ZIndexTokenName = `z-index-${ZIndexZScale}`; export type ZIndexTokenGroup = { [TokenName in ZIndexTokenName]: string; @@ -59,40 +59,4 @@ export const zIndex: { 'z-index-12': { value: '520', }, - 'z-1': { - value: '100', - }, - 'z-2': { - value: '400', - }, - 'z-3': { - value: '510', - }, - 'z-4': { - value: '512', - }, - 'z-5': { - value: '513', - }, - 'z-6': { - value: '514', - }, - 'z-7': { - value: '515', - }, - 'z-8': { - value: '516', - }, - 'z-9': { - value: '517', - }, - 'z-10': { - value: '518', - }, - 'z-11': { - value: '519', - }, - 'z-12': { - value: '520', - }, }; diff --git a/polaris-tokens/src/utilities.ts b/polaris-tokens/src/utilities.ts index f059df57931..9b22adbd758 100644 --- a/polaris-tokens/src/utilities.ts +++ b/polaris-tokens/src/utilities.ts @@ -110,7 +110,7 @@ export function getKeyframeNames(motionTokenGroup: TokenGroup) { /** * Allowed Polaris token custom properties. * - * Result: ['--p-background', '--p-text', etc...] + * Result: ['--p-color-bg-app', '--p-color-text', etc...] */ export function getCustomPropertyNames(tokens: Tokens) { return Object.entries(tokens) diff --git a/polaris-tokens/tests/toStyleSheet.test.js b/polaris-tokens/tests/toStyleSheet.test.js index 7fa3bda3c40..9f2cf34af76 100644 --- a/polaris-tokens/tests/toStyleSheet.test.js +++ b/polaris-tokens/tests/toStyleSheet.test.js @@ -24,14 +24,13 @@ const mockMotionTokenGroup = { }; const mockTokens = { - colors: {}, border: {}, - // Note: We don't need to assign mock values to the remaining static tokens. - depth: mockTokenGroup, + color: {}, font: {}, motion: {}, - shape: {}, - spacing: {}, + // Note: We don't need to assign mock values to the remaining static tokens. + shadow: mockTokenGroup, + space: {}, zIndex: {}, }; diff --git a/polaris-tokens/tests/utilities.test.js b/polaris-tokens/tests/utilities.test.js index 94e8314fdeb..69ab3e9f533 100644 --- a/polaris-tokens/tests/utilities.test.js +++ b/polaris-tokens/tests/utilities.test.js @@ -30,14 +30,13 @@ const mockMotionTokenGroup = { }; const mockTokens = { - colors: mockTokenGroup, - border: {}, // Note: We don't need to assign mock values to the remaining static tokens. - depth: {}, + color: mockTokenGroup, + border: {}, + font: {}, motion: {}, - shape: {}, - spacing: {}, - typography: {}, + shadow: {}, + space: {}, zIndex: {}, }; diff --git a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-at-rule-disallowed-list.md b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-at-rule-disallowed-list.md index 45a9c845473..91a4872b00d 100644 --- a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-at-rule-disallowed-list.md +++ b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-at-rule-disallowed-list.md @@ -9,7 +9,7 @@ keywords: ```diff // Do -+ animation: var(--p-keyframes-spin) var(--p-duration-500) linear infinite; ++ animation: var(--p-motion-keyframes-spin) var(--p-motion-duration-500) linear infinite; // Don't - @keyframes spin { - from { diff --git a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-declaration-property-unit-disallowed-list.md b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-declaration-property-unit-disallowed-list.md index c9563f26b3b..a7f0d7aac8d 100644 --- a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-declaration-property-unit-disallowed-list.md +++ b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-declaration-property-unit-disallowed-list.md @@ -9,7 +9,7 @@ keywords: ```diff // Do -+ transition-duration: var(--p-duration-200); ++ transition-duration: var(--p-motion-duration-200); // Don't - transition-duration: 200ms; ``` diff --git a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-function-disallowed-list.md b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-function-disallowed-list.md index dd352d9e0e7..3d68f75fbc4 100644 --- a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-function-disallowed-list.md +++ b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-function-disallowed-list.md @@ -9,7 +9,7 @@ keywords: ```diff // Do -+ transition-duration: var(--p-duration-200); ++ transition-duration: var(--p-motion-duration-200); // Don't - transition-duration: 200ms; ``` diff --git a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-global-disallowed-list.md b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-global-disallowed-list.md index 11cf625cfdc..ce30d28f7cd 100644 --- a/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-global-disallowed-list.md +++ b/polaris.shopify.com/content/tools/stylelint-polaris/rules/motion-global-disallowed-list.md @@ -9,7 +9,7 @@ keywords: ```diff // Do -+ transition: var(--p-duration-500) var(--p-ease); ++ transition: var(--p-motion-duration-500) var(--p-motion-ease); // Don't - duration: $skeleton-shimmer-duration var(--p-ease); ``` diff --git a/polaris.shopify.com/pages/api/search/v0/index.tsx b/polaris.shopify.com/pages/api/search/v0/index.tsx index 2a99250a183..d63e0bd1bf3 100644 --- a/polaris.shopify.com/pages/api/search/v0/index.tsx +++ b/polaris.shopify.com/pages/api/search/v0/index.tsx @@ -74,14 +74,14 @@ const getSearchResults = (query?: string) => { }); }); - const {color, border, font, motion, shadow, spacing, zIndex} = metadata; + const {color, border, font, motion, shadow, space, zIndex} = metadata; const tokenGroups = { color, border, font, motion, shadow, - spacing, + space, zIndex, };