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

refactor: update background color integration #1985

Merged
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
20 changes: 8 additions & 12 deletions src/components/Button/Button-v2.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,11 @@ export const InverseRanks: StoryObj<Args> = {
...DefaultRanks.args,
variant: 'inverse',
},
parameters: {
backgrounds: { default: 'background-utility-default-high-emphasis' },
},
render: DefaultRanks.render,
// TODO: find a cleaner way to decorate with unavailable tokens using parameters:backgounds:
decorators: [
(Story) => (
<div className="bg-[var(--eds-color-blue-850)] p-1">{Story()}</div>
),
],
decorators: [(Story) => <div className="p-1">{Story()}</div>],
};

/**
Expand All @@ -145,13 +143,11 @@ export const InverseDisabledRanks: StoryObj<Args> = {
variant: 'inverse',
isDisabled: true,
},
parameters: {
backgrounds: { default: 'background-utility-default-high-emphasis' },
},
render: DefaultRanks.render,
// TODO: find a cleaner way to decorate with unavailable tokens using parameters:backgounds:
decorators: [
(Story) => (
<div className="bg-[var(--eds-color-blue-850)] p-1">{Story()}</div>
),
],
decorators: [(Story) => <div className="p-1">{Story()}</div>],
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/Button/__snapshots__/Button-v2.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ exports[`<Button /> (v2) IconLayouts story renders snapshot 1`] = `

exports[`<Button /> (v2) InverseDisabledRanks story renders snapshot 1`] = `
<div
class="bg-[var(--eds-color-blue-850)] p-1"
class="p-1"
>
<div
class="flex gap-1"
Expand Down Expand Up @@ -289,7 +289,7 @@ exports[`<Button /> (v2) InverseDisabledRanks story renders snapshot 1`] = `

exports[`<Button /> (v2) InverseRanks story renders snapshot 1`] = `
<div
class="bg-[var(--eds-color-blue-850)] p-1"
class="p-1"
>
<div
class="flex gap-1"
Expand Down
10 changes: 5 additions & 5 deletions src/components/Link/Link-v2.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ export const Emphasis: StoryObj<Args> = {
/**
* We also include an inverse variant, for use on dark backgrounds.
*/
export const Inverse: StoryObj<Args> = {
export const InverseVariant: StoryObj<Args> = {
args: {
variant: 'inverse',
},
// TODO: find a cleaner way to decorate with unavailable tokens using parameters:backgounds:
parameters: {
backgrounds: { default: 'background-utility-default-high-emphasis' },
},
decorators: [
(Story) => (
<div className="w-96 bg-[var(--eds-color-blue-850)] p-1 text-center text-utility-inverse">
{Story()}
</div>
<div className="w-96 p-1 text-center text-utility-inverse">{Story()}</div>
),
],
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Link/__snapshots__/Link-v2.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ exports[`<Link /> InheritColor story renders snapshot 1`] = `
</div>
`;

exports[`<Link /> Inverse story renders snapshot 1`] = `
exports[`<Link /> InverseVariant story renders snapshot 1`] = `
<div
class="text-utility-default-primary"
>
<div
class="w-96 bg-[var(--eds-color-blue-850)] p-1 text-center text-utility-inverse"
class="w-96 p-1 text-center text-utility-inverse"
>
<a
class="link link--emphasis-default link--size-lg link--variant-inverse"
Expand Down
10 changes: 3 additions & 7 deletions src/components/TabGroup/TabGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const Default: StoryObj<Args> = {
* TabGroups have an inverted variant, for use on dark backgrounds. Depending on how the background is applied, you can use
* text color tokens to style the individual tabs in the group.
*/
export const Inverted: StoryObj<Args> = {
export const InverseVariant: StoryObj<Args> = {
args: {
variant: 'inverse',
children: (
Expand Down Expand Up @@ -164,14 +164,10 @@ export const Inverted: StoryObj<Args> = {
</>
),
},
// TODO: find a cleaner way to decorate with unavailable tokens using parameters:backgounds:
decorators: [
(Story) => (
<div className="bg-[var(--eds-color-blue-850)] p-1">{Story()}</div>
),
],
decorators: [(Story) => <div className="p-1">{Story()}</div>],
parameters: {
...Default.parameters,
backgrounds: { default: 'background-utility-default-high-emphasis' },
},
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/TabGroup/__snapshots__/TabGroup.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ exports[`<TabGroup /> Default story renders snapshot 1`] = `
</div>
`;

exports[`<TabGroup /> Inverted story renders snapshot 1`] = `
exports[`<TabGroup /> InverseVariant story renders snapshot 1`] = `
<div
class="bg-[var(--eds-color-blue-850)] p-1"
class="p-1"
>
<div
class="tabs"
Expand Down
Loading