Skip to content

Commit

Permalink
Update PricingOptions bgColor (#664)
Browse files Browse the repository at this point in the history
* change default color instead of applying API update

* revert to global decorator

* update snapshots
  • Loading branch information
rezrah authored Jul 25, 2024
1 parent 3010db6 commit ccd37a5
Show file tree
Hide file tree
Showing 23 changed files with 89 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .changeset/speak-wasps-perfectly.md
Original file line number Diff line number Diff line change
@@ -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`.
1 change: 1 addition & 0 deletions packages/design-tokens/scripts/build-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"brand": {
"PricingOptions": {
"item": {
"bgColor": {
"value": "var(--brand-color-canvas-subtle)",
"dark": "var(--brand-color-canvas-subtle)"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {CopilotIcon} from '@primer/octicons-react'

const decorators = Story => (
<Box
backgroundColor="subtle"
backgroundColor="default"
paddingBlockStart="spacious"
paddingBlockEnd="spacious"
style={{
Expand Down Expand Up @@ -556,6 +556,7 @@ export const WithIncludedAndExcludedFeatures: StoryFn<typeof PricingOptions> = (
</PricingOptions>
)
}

export const WithoutFeatures: StoryFn<typeof PricingOptions> = () => {
return (
<PricingOptions>
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/PricingOptions/PricingOptions.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {

export const Default = () => (
<Box
backgroundColor="subtle"
backgroundColor="default"
paddingBlockStart="spacious"
paddingBlockEnd="spacious"
style={{
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/PricingOptions/PricingOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
* Design tokens
*/
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css'
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css'

/**
* Main stylesheet (as a CSS Module)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const maximumArgs = {
variant: 'size',
logoBarVisible: true,
testimonialsVisible: true,
pricingOptionsVisible: true,
faqVisible: true,
jtbd2Visible: true,
jtbd3Visible: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
VideoPlayer,
Breadcrumbs,
Statistic,
PricingOptions,
} from '../../..'

import pinterestLogo from '../../../fixtures/images/logos/pinterest.png'
Expand Down Expand Up @@ -563,17 +564,67 @@ export function SolutionPage({
</Grid.Column>
</Grid>
)}
<CTABanner hasBorder hasShadow={false} className={styles.ctaBanner} align="center">
<CTABanner.Heading>Get started</CTABanner.Heading>
<CTABanner.Description>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id. Aliquam
luctus sed turpis felis nam pulvinar risus elementum.
</CTABanner.Description>
<CTABanner.ButtonGroup>
<Button>Primary Action</Button>
<Button>Secondary Action</Button>
</CTABanner.ButtonGroup>
</CTABanner>
{variant === 'size' && args.pricingOptionsVisible && (
<PricingOptions variant="cards">
<PricingOptions.Item>
<PricingOptions.Heading>Lorem ipsum</PricingOptions.Heading>
<PricingOptions.Description>Lorem ipsum dolor sit amet</PricingOptions.Description>
<PricingOptions.Price currencySymbol="$" originalPrice="20" trailingText="per user / month">
10
</PricingOptions.Price>
<PricingOptions.FeatureList>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem variant="excluded">
Item not included
</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem variant="excluded">
Item not included
</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem variant="excluded">
Item not included
</PricingOptions.FeatureListItem>
</PricingOptions.FeatureList>
<PricingOptions.SecondaryAction as="a" href="/contact">
Contact sales
</PricingOptions.SecondaryAction>
</PricingOptions.Item>

<PricingOptions.Item>
<PricingOptions.Label>Recommended</PricingOptions.Label>
<PricingOptions.Heading>Lorem ipsum</PricingOptions.Heading>
<PricingOptions.Description>Lorem ipsum dolor sit amet</PricingOptions.Description>
<PricingOptions.Price currencySymbol="$" trailingText="per user / month" originalPrice="49">
39
</PricingOptions.Price>
<PricingOptions.FeatureList>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
<PricingOptions.FeatureListItem>Item included</PricingOptions.FeatureListItem>
</PricingOptions.FeatureList>
<PricingOptions.PrimaryAction as="a" href="/buy">
Primary action
</PricingOptions.PrimaryAction>
</PricingOptions.Item>
</PricingOptions>
)}
{variant !== 'size' && args.pricingOptionsVisible && (
<CTABanner hasBorder hasShadow={false} className={styles.ctaBanner} align="center">
<CTABanner.Heading>Get started</CTABanner.Heading>
<CTABanner.Description>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sapien sit ullamcorper id.
Aliquam luctus sed turpis felis nam pulvinar risus elementum.
</CTABanner.Description>
<CTABanner.ButtonGroup>
<Button>Primary Action</Button>
<Button>Secondary Action</Button>
</CTABanner.ButtonGroup>
</CTABanner>
)}
<Box>
<Stack direction="vertical" padding="none" gap={64} alignItems="center">
<Heading as="h3" size="3">
Expand Down

0 comments on commit ccd37a5

Please sign in to comment.