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

Add status bold and content foreground bold tokens #3609

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/afraid-jobs-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@salt-ds/theme": minor
---

Added status bold background and content bold foreground tokens

```
--salt-status-info-bold-background
--salt-status-error-bold-background
--salt-status-warning-bold-background
--salt-status-success-bold-background

--salt-content-bold-foreground
--salt-content-bold-foreground-disabled
```
37 changes: 23 additions & 14 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { withResponsiveWrapper } from "docs/decorators/withResponsiveWrapper";
import { WithTextSpacingWrapper } from "docs/decorators/withTextSpacingWrapper";
import { withScaffold } from "docs/decorators/withScaffold";
import { withDateMock } from "docs/decorators/withDateMock";
import { SaltProvider } from "@salt-ds/core";
import { SaltProvider, UNSTABLE_SaltProviderNext } from "@salt-ds/core";
import { DocsContainer } from "@storybook/addon-docs";
import { initialize, mswLoader } from "msw-storybook-addon";

Expand Down Expand Up @@ -147,20 +147,29 @@ export const parameters: Parameters = {
children,
context,
...rest
}: ComponentProps<typeof DocsContainer>) => (
<DocsContainer context={context} {...rest}>
<SaltProvider
/* @ts-ignore Waiting for https://github.com/storybookjs/storybook/issues/12982 */
mode={context.store.globals.globals?.mode}
enableStyleInjection={
}: ComponentProps<typeof DocsContainer>) => {
const ChosenProvider =
/* @ts-ignore Waiting for https://github.com/storybookjs/storybook/issues/12982 */
context.store.globals.globals?.themeNext === "enable"
? UNSTABLE_SaltProviderNext
: SaltProvider;
return (
<DocsContainer context={context} {...rest}>
<ChosenProvider
/* @ts-ignore Waiting for https://github.com/storybookjs/storybook/issues/12982 */
context.store.globals.globals?.styleInjection === "enable"
}
>
{children}
</SaltProvider>
</DocsContainer>
),
mode={context.store.globals.globals?.mode}
enableStyleInjection={
/* @ts-ignore Waiting for https://github.com/storybookjs/storybook/issues/12982 */
context.store.globals.globals?.styleInjection === "enable"
}
/* @ts-ignore Waiting for https://github.com/storybookjs/storybook/issues/12982 */
accent={context.store.globals.globals?.accent}
>
{children}
</ChosenProvider>
</DocsContainer>
);
},
},
// disables snapshotting on a global level
chromatic: { disableSnapshot: true },
Expand Down
3 changes: 3 additions & 0 deletions packages/theme/css/characteristics/content-next.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
--salt-content-secondary-foreground: var(--salt-palette-foreground-secondary);
--salt-content-secondary-foreground-disabled: var(--salt-palette-foreground-secondary-disabled);

--salt-content-bold-foreground: var(--salt-palette-foreground-primary-alt);
--salt-content-bold-foreground-disabled: var(--salt-palette-foreground-primary-alt-disabled);

--salt-content-foreground-hover: var(--salt-palette-foreground-hover);
--salt-content-foreground-active: var(--salt-palette-foreground-active);
--salt-content-foreground-visited: var(--salt-palette-foreground-visited);
Expand Down
3 changes: 3 additions & 0 deletions packages/theme/css/characteristics/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
--salt-content-secondary-foreground: var(--salt-palette-neutral-secondary-foreground);
--salt-content-secondary-foreground-disabled: var(--salt-palette-neutral-secondary-foreground-disabled);

--salt-content-bold-foreground: var(--salt-palette-interact-cta-foreground);
--salt-content-bold-foreground-disabled: var(--salt-palette-interact-cta-foreground-disabled);

--salt-content-foreground-hover: var(--salt-palette-navigate-foreground-hover);
--salt-content-foreground-active: var(--salt-palette-navigate-foreground-active);
--salt-content-foreground-visited: var(--salt-palette-navigate-foreground-visited);
Expand Down
5 changes: 5 additions & 0 deletions packages/theme/css/characteristics/status-next.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
--salt-status-warning-background: var(--salt-palette-warning-weak);
--salt-status-error-background: var(--salt-palette-negative-weak);

--salt-status-info-bold-background: var(--salt-palette-info);
--salt-status-error-bold-background: var(--salt-palette-negative);
--salt-status-warning-bold-background: var(--salt-palette-warning);
--salt-status-success-bold-background: var(--salt-palette-positive);

--salt-status-success-background-selected: var(--salt-palette-positive-weak);
--salt-status-warning-background-selected: var(--salt-palette-warning-weak);
--salt-status-error-background-selected: var(--salt-palette-negative-weak);
Expand Down
5 changes: 5 additions & 0 deletions packages/theme/css/characteristics/status.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
--salt-status-warning-background: var(--salt-palette-warning-background);
--salt-status-success-background: var(--salt-palette-success-background);

--salt-status-info-bold-background: var(--salt-palette-info-bold-background);
--salt-status-error-bold-background: var(--salt-palette-error-bold-background);
--salt-status-warning-bold-background: var(--salt-palette-warning-bold-background);
--salt-status-success-bold-background: var(--salt-palette-success-bold-background);

--salt-status-error-background-selected: var(--salt-palette-error-background-selected);
--salt-status-warning-background-selected: var(--salt-palette-warning-background-selected);
--salt-status-success-background-selected: var(--salt-palette-success-background-selected);
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/css/palette/error.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.salt-theme[data-mode="light"] {
--salt-palette-error-background: var(--salt-color-red-10);
--salt-palette-error-bold-background: var(--salt-color-red-500);
--salt-palette-error-background-selected: var(--salt-color-red-20);
--salt-palette-error-border: var(--salt-color-red-500);
--salt-palette-error-foreground-decorative: var(--salt-color-red-500);
Expand All @@ -8,6 +9,7 @@

.salt-theme[data-mode="dark"] {
--salt-palette-error-background: var(--salt-color-red-900);
--salt-palette-error-bold-background: var(--salt-color-red-500);
--salt-palette-error-background-selected: var(--salt-color-red-900);
--salt-palette-error-border: var(--salt-color-red-400);
--salt-palette-error-foreground-decorative: var(--salt-color-red-400);
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/css/palette/info.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
.salt-theme[data-mode="light"] {
--salt-palette-info-background: var(--salt-color-blue-10);
--salt-palette-info-bold-background: var(--salt-color-blue-500);
--salt-palette-info-border: var(--salt-color-blue-500);
--salt-palette-info-foreground-decorative: var(--salt-color-blue-500);
--salt-palette-info-foreground-informative: var(--salt-color-blue-600);
}

.salt-theme[data-mode="dark"] {
--salt-palette-info-background: var(--salt-color-blue-900);
--salt-palette-info-bold-background: var(--salt-color-blue-500);
--salt-palette-info-border: var(--salt-color-blue-400);
--salt-palette-info-foreground-decorative: var(--salt-color-blue-400);
--salt-palette-info-foreground-informative: var(--salt-color-blue-200);
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/css/palette/success.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.salt-theme[data-mode="light"] {
--salt-palette-success-background: var(--salt-color-green-10);
--salt-palette-success-bold-background: var(--salt-color-green-500);
--salt-palette-success-background-selected: var(--salt-color-green-20);
--salt-palette-success-border: var(--salt-color-green-500);
--salt-palette-success-foreground-decorative: var(--salt-color-green-500);
Expand All @@ -8,6 +9,7 @@

.salt-theme[data-mode="dark"] {
--salt-palette-success-background: var(--salt-color-green-900);
--salt-palette-success-bold-background: var(--salt-color-green-500);
--salt-palette-success-background-selected: var(--salt-color-green-900);
--salt-palette-success-border: var(--salt-color-green-400);
--salt-palette-success-foreground-decorative: var(--salt-color-green-400);
Expand Down
2 changes: 2 additions & 0 deletions packages/theme/css/palette/warning.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.salt-theme[data-mode="light"] {
--salt-palette-warning-background: var(--salt-color-orange-10);
--salt-palette-warning-bold-background: var(--salt-color-orange-800);
--salt-palette-warning-background-selected: var(--salt-color-orange-20);
--salt-palette-warning-border: var(--salt-color-orange-700);
--salt-palette-warning-foreground-decorative: var(--salt-color-orange-700);
Expand All @@ -8,6 +9,7 @@

.salt-theme[data-mode="dark"] {
--salt-palette-warning-background: var(--salt-color-orange-900);
--salt-palette-warning-bold-background: var(--salt-color-orange-800);
--salt-palette-warning-background-selected: var(--salt-color-orange-900);
--salt-palette-warning-border: var(--salt-color-orange-500);
--salt-palette-warning-foreground-decorative: var(--salt-color-orange-500);
Expand Down
26 changes: 26 additions & 0 deletions packages/theme/stories/characteristics/content.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Meta } from "@storybook/blocks";
import { ColorContainer } from "docs/components/ColorContainer";
import { ColorItem, ColorPalette } from "@storybook/blocks";

<Meta title="Theme/Characteristics/Content" />

## Foreground

<ColorContainer className="paletteContainer">
<ColorPalette>
<ColorItem
title="Bold"
subtitle={`--salt-content-bold-foreground`}
colors={{
[`--salt-content-bold-foreground`]: `var(--salt-content-bold-foreground)`,
}}
/>
<ColorItem
title="Bold disabled"
subtitle={`--salt-content-bold-foreground-disabled`}
colors={{
[`--salt-content-bold-foreground-disabled`]: `var(--salt-content-bold-foreground-disabled)`,
}}
/>
</ColorPalette>
</ColorContainer>
42 changes: 42 additions & 0 deletions packages/theme/stories/characteristics/status.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Meta } from "@storybook/blocks";
import { ColorContainer } from "docs/components/ColorContainer";
import { ColorItem, ColorPalette } from "@storybook/blocks";

<Meta title="Theme/Characteristics/Status" />

# Status

## Bold Background

<ColorContainer className="paletteContainer">
<ColorPalette>
<ColorItem
title="Info"
subtitle={`--salt-status-info-bold-background`}
colors={{
[`--salt-status-info-bold-background`]: `var(--salt-status-info-bold-background)`,
}}
/>
<ColorItem
title="Error"
subtitle={`--salt-status-error-bold-background`}
colors={{
[`--salt-status-error-bold-background`]: `var(--salt-status-error-bold-background)`,
}}
/>
<ColorItem
title="Warning"
subtitle={`--salt-status-warning-bold-background`}
colors={{
[`--salt-status-warning-bold-background`]: `var(--salt-status-warning-bold-background)`,
}}
/>
<ColorItem
title="Success"
subtitle={`--salt-status-success-bold-background`}
colors={{
[`--salt-status-success-bold-background`]: `var(--salt-status-success-bold-background)`,
}}
/>
</ColorPalette>
</ColorContainer>
Loading