Skip to content

Commit

Permalink
Replace changed colour names in Spotlight
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentSmedinga committed Nov 19, 2024
1 parent 063ff27 commit dca4c14
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 40 deletions.
16 changes: 8 additions & 8 deletions packages/css/src/components/spotlight/spotlight.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
* Copyright Gemeente Amsterdam
*/

.ams-spotlight--blue {
background-color: var(--ams-spotlight-blue-background-color);
}

.ams-spotlight--dark-blue {
background-color: var(--ams-spotlight-dark-blue-background-color);
.ams-spotlight--azure {
background-color: var(--ams-spotlight-azure-background-color);
}

.ams-spotlight--dark-green {
background-color: var(--ams-spotlight-dark-green-background-color);
.ams-spotlight--blue {
background-color: var(--ams-spotlight-blue-background-color);
}

.ams-spotlight--green {
background-color: var(--ams-spotlight-green-background-color);
}

.ams-spotlight--lime {
background-color: var(--ams-spotlight-lime-background-color);
}

.ams-spotlight--magenta {
background-color: var(--ams-spotlight-magenta-background-color);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Footer/FooterTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type FooterTopProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>>

export const FooterTop = forwardRef(
({ children, className, ...restProps }: FooterTopProps, ref: ForwardedRef<HTMLDivElement>) => (
<Spotlight {...restProps} color="dark-blue" ref={ref} className={clsx('ams-footer__top', className)}>
<Spotlight {...restProps} color="blue" ref={ref} className={clsx('ams-footer__top', className)}>
{children}
</Spotlight>
),
Expand Down
13 changes: 2 additions & 11 deletions packages/react/src/Spotlight/Spotlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@
import clsx from 'clsx'
import { forwardRef, HTMLAttributes, PropsWithChildren } from 'react'

export const spotlightColors = [
'blue',
'dark-blue',
'dark-green',
'green',
'magenta',
'orange',
'purple',
'yellow',
] as const
export const spotlightColors = ['azure', 'blue', 'green', 'lime', 'magenta', 'orange', 'purple', 'yellow'] as const

type SpotlightColor = (typeof spotlightColors)[number]

Expand All @@ -27,7 +18,7 @@ export type SpotlightProps = {
} & PropsWithChildren<HTMLAttributes<HTMLElement>>

export const Spotlight = forwardRef(
({ children, className, as: Tag = 'div', color = 'dark-blue', ...restProps }: SpotlightProps, ref: any) => (
({ children, className, as: Tag = 'div', color = 'blue', ...restProps }: SpotlightProps, ref: any) => (
<Tag {...restProps} ref={ref} className={clsx('ams-spotlight', `ams-spotlight--${color}`, className)}>
{children}
</Tag>
Expand Down
8 changes: 4 additions & 4 deletions proprietary/tokens/src/components/ams/spotlight.tokens.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"ams": {
"spotlight": {
"blue": {
"azure": {
"background-color": { "value": "{ams.brand.color.azure.60}" }
},
"dark-blue": {
"blue": {
"background-color": { "value": "{ams.brand.color.blue.60}" }
},
"dark-green": {
"green": {
"background-color": { "value": "{ams.brand.color.green.60}" }
},
"green": {
"lime": {
"background-color": { "value": "{ams.brand.color.lime.60}" }
},
"magenta": {
Expand Down
14 changes: 7 additions & 7 deletions storybook/src/components/Spotlight/Spotlight.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ import README from "../../../../packages/css/src/components/spotlight/README.md?

## Examples

### Blue
### Azure

<Canvas of={SpotlightStories.Blue} />
<Canvas of={SpotlightStories.Azure} />

### Dark Blue
### Blue

<Canvas of={SpotlightStories.DarkBlue} />
<Canvas of={SpotlightStories.Blue} />

### Dark Green
### Green

<Canvas of={SpotlightStories.DarkGreen} />
<Canvas of={SpotlightStories.Green} />

### Green

<Canvas of={SpotlightStories.Green} />
<Canvas of={SpotlightStories.Lime} />

### Magenta

Expand Down
18 changes: 9 additions & 9 deletions storybook/src/components/Spotlight/Spotlight.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const meta = {
<Spotlight as={as} color={color}>
<Grid paddingVertical="medium">
<Grid.Cell span="all">
<Blockquote inverseColor={!color || !['green', 'yellow'].includes(color)}>{quote}</Blockquote>
<Blockquote inverseColor={!color || !['lime', 'yellow'].includes(color)}>{quote}</Blockquote>
</Grid.Cell>
</Grid>
</Spotlight>
Expand All @@ -30,27 +30,27 @@ type Story = StoryObj<typeof meta>

export const Default: Story = {}

export const Blue: Story = {
export const Azure: Story = {
args: {
color: 'blue',
color: 'azure',
},
}

export const DarkBlue: Story = {
export const Blue: Story = {
args: {
color: 'dark-blue',
color: 'blue',
},
}

export const DarkGreen: Story = {
export const Green: Story = {
args: {
color: 'dark-green',
color: 'green',
},
}

export const Green: Story = {
export const Lime: Story = {
args: {
color: 'green',
color: 'lime',
},
}

Expand Down

0 comments on commit dca4c14

Please sign in to comment.