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

feat: added $layer token in the background-color #14726

Merged
8 changes: 8 additions & 0 deletions e2e/components/StructuredList/StructuredList-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ test.describe('StructuredList', () => {
});
});

test('with layer @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'StructuredList',
id: 'components-structuredlist--with-background-layer',
theme,
});
});

test('selection @vrt', async ({ page }) => {
await snapshotStory(page, {
component: 'StructuredList',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,35 +102,36 @@ Default.argTypes = {
},
};

const structuredListBodyRowGenerator = (numRows) => {
return Array.apply(null, Array(numRows)).map((n, i) => (
<StructuredListRow key={`row-${i}`}>
<StructuredListCell>Row {i}</StructuredListCell>
<StructuredListCell>Row {i}</StructuredListCell>
<StructuredListCell>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna,
finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel
euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a
porttitor interdum.
</StructuredListCell>
<StructuredListInput
id={`row-${i}`}
value={`row-${i}`}
title={`row-${i}`}
name="row-0"
aria-label={`row-${i}`}
/>
<StructuredListCell>
<CheckmarkFilled
className={`${prefix}--structured-list-svg`}
aria-label="select an option">
<title>select an option</title>
</CheckmarkFilled>
</StructuredListCell>
</StructuredListRow>
));
};

export const Selection = (args) => {
const structuredListBodyRowGenerator = (numRows) => {
return Array.apply(null, Array(numRows)).map((n, i) => (
<StructuredListRow key={`row-${i}`}>
<StructuredListCell>Row {i}</StructuredListCell>
<StructuredListCell>Row {i}</StructuredListCell>
<StructuredListCell>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui
magna, finibus id tortor sed, aliquet bibendum augue. Aenean posuere
sem vel euismod dignissim. Nulla ut cursus dolor. Pellentesque
vulputate nisl a porttitor interdum.
</StructuredListCell>
<StructuredListInput
id={`row-${i}`}
value={`row-${i}`}
title={`row-${i}`}
name="row-0"
aria-label={`row-${i}`}
/>
<StructuredListCell>
<CheckmarkFilled
className={`${prefix}--structured-list-svg`}
aria-label="select an option">
<title>select an option</title>
</CheckmarkFilled>
</StructuredListCell>
</StructuredListRow>
));
};
return (
<StructuredListWrapper selection {...args}>
<StructuredListHead>
Expand Down Expand Up @@ -160,6 +161,22 @@ Selection.argTypes = {
},
};

export const WithBackgroundLayer = (args) => (
<StructuredListWrapper
selection
{...args}
className={`${prefix}--with-background-layer`}>
<StructuredListHead>
<StructuredListRow head>
<StructuredListCell head>ColumnA</StructuredListCell>
<StructuredListCell head>ColumnB</StructuredListCell>
<StructuredListCell head>ColumnC</StructuredListCell>
</StructuredListRow>
</StructuredListHead>
<StructuredListBody>{structuredListBodyRowGenerator(4)}</StructuredListBody>
</StructuredListWrapper>
);

export const Skeleton = (args) => (
<div style={{ width: '800px' }}>
<StructuredListSkeleton {...args} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

display: table;

background-color: transparent;
background-color: $layer transparent;
border-collapse: collapse;
border-spacing: 0;
inline-size: 100%;
Expand Down Expand Up @@ -72,6 +72,10 @@
}
}

.#{$prefix}--with-background-layer {
background-color: $layer;
}
guidari marked this conversation as resolved.
Show resolved Hide resolved

.#{$prefix}--structured-list-row {
display: table-row;
border-block-start: 1px solid $border-subtle;
Expand Down