diff --git a/.changeset/speak-wasps-perfectly.md b/.changeset/speak-wasps-perfectly.md new file mode 100644 index 000000000..4cb6b397e --- /dev/null +++ b/.changeset/speak-wasps-perfectly.md @@ -0,0 +1,7 @@ +--- +'@primer/react-brand': minor +--- + +`PricingOptions` now applies the `subtle` background color by default. This is to ensure adequate contrast on a standard `canvas-default` background. + +To apply the previous `default` background color (or custom color), you may override a new design token that has been provided for this reason: `--brand-PricingOptions-item-bgColor`. diff --git a/packages/design-tokens/scripts/build-tokens.js b/packages/design-tokens/scripts/build-tokens.js index 93c296654..ad6f6578a 100644 --- a/packages/design-tokens/scripts/build-tokens.js +++ b/packages/design-tokens/scripts/build-tokens.js @@ -243,6 +243,7 @@ const darkJson = require('../src/tokens/base/colors/dark') `tokens/functional/components/breadcrumbs/colors.js`, `tokens/functional/components/tooltip/colors.json`, `tokens/functional/components/river-story-scroll/colors.js`, + `tokens/functional/components/pricing-options/colors.json`, ] for (const path of filesForColorModes) { diff --git a/packages/design-tokens/src/tokens/functional/components/pricing-options/colors.json b/packages/design-tokens/src/tokens/functional/components/pricing-options/colors.json new file mode 100644 index 000000000..d81faddc0 --- /dev/null +++ b/packages/design-tokens/src/tokens/functional/components/pricing-options/colors.json @@ -0,0 +1,12 @@ +{ + "brand": { + "PricingOptions": { + "item": { + "bgColor": { + "value": "var(--brand-color-canvas-subtle)", + "dark": "var(--brand-color-canvas-subtle)" + } + } + } + } +} diff --git a/packages/react/src/PricingOptions/PricingOptions.features.stories.tsx b/packages/react/src/PricingOptions/PricingOptions.features.stories.tsx index 16c10dcf0..c6fb90a3e 100644 --- a/packages/react/src/PricingOptions/PricingOptions.features.stories.tsx +++ b/packages/react/src/PricingOptions/PricingOptions.features.stories.tsx @@ -9,7 +9,7 @@ import {CopilotIcon} from '@primer/octicons-react' const decorators = Story => ( = ( ) } + export const WithoutFeatures: StoryFn = () => { return ( diff --git a/packages/react/src/PricingOptions/PricingOptions.module.css b/packages/react/src/PricingOptions/PricingOptions.module.css index ae1b4d157..e8398e33b 100644 --- a/packages/react/src/PricingOptions/PricingOptions.module.css +++ b/packages/react/src/PricingOptions/PricingOptions.module.css @@ -20,7 +20,7 @@ .PricingOptions--variant-default { border-radius: var(--brand-borderRadius-xlarge); border: solid var(--brand-borderWidth-thin) var(--brand-color-border-default); - background-color: var(--brand-color-canvas-default); + background-color: var(--brand-PricingOptions-item-bgColor); } @media (min-width: 63.25rem) { @@ -72,7 +72,7 @@ padding-inline: var(--base-size-32); border-radius: var(--brand-borderRadius-xlarge); border: solid 1px var(--brand-color-border-default); - background-color: var(--brand-color-canvas-default); + background-color: var(--brand-PricingOptions-item-bgColor); padding-block: var(--base-size-32); } diff --git a/packages/react/src/PricingOptions/PricingOptions.stories.tsx b/packages/react/src/PricingOptions/PricingOptions.stories.tsx index c67c95d64..95aa0a3f1 100644 --- a/packages/react/src/PricingOptions/PricingOptions.stories.tsx +++ b/packages/react/src/PricingOptions/PricingOptions.stories.tsx @@ -10,7 +10,7 @@ export default { export const Default = () => ( )} - - Get started - - Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id. Aliquam - luctus sed turpis felis nam pulvinar risus elementum. - - - - - - + {variant === 'size' && args.pricingOptionsVisible && ( + + + Lorem ipsum + Lorem ipsum dolor sit amet + + 10 + + + Item included + Item included + Item included + + Item not included + + + Item not included + + + Item not included + + + + Contact sales + + + + + Recommended + Lorem ipsum + Lorem ipsum dolor sit amet + + 39 + + + Item included + Item included + Item included + Item included + Item included + Item included + + + Primary action + + + + )} + {variant !== 'size' && args.pricingOptionsVisible && ( + + Get started + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id. + Aliquam luctus sed turpis felis nam pulvinar risus elementum. + + + + + + + )}