Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,67 @@
}
}
}

.nci-imageless-card-group {
ul {
@include u-margin-x('auto');
@include u-width('full');
@include u-display('flex');
@include u-flex('wrap');
row-gap: units(3);
@include at-media('tablet-lg') {
row-gap: units(4);
}
padding-inline-start: 0;
margin-block-start: 0;
margin-block-end: 0;
li {
@include u-display('flex');
flex: 0 0 100%;
@include at-media('tablet-lg') {
flex: 1 0;
@include u-padding-x(2);
}
@include u-padding-x(0);
@include u-margin-bottom(0);
&:last-child {
@include u-margin-bottom(0); // overrides nci-card
}
}
}
&__heading {
@include u-margin-bottom(2);
}
&--one-card > ul {
li {
@include u-padding-x(0);
}
}
@include at-media('tablet-lg') {
&--two-card > ul {
li {
flex: 0 0 50%;
&:nth-child(2n + 1) {
@include u-padding-left(0);
}
&:nth-child(2n + 2) {
@include u-padding-right(0);
}
}
}
&--three-card > ul {
li {
flex: 0 0 33%;
&:nth-child(3n + 2) {
flex: 0 0 34%;
}
&:nth-child(3n + 1) {
@include u-padding-left(0);
}
&:nth-child(3n + 3) {
@include u-padding-right(0);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,60 @@ export default {

const Template = (args) => Component(args);

export const Default = () => <TestCase css={css} html={Template.bind({})(
{
'title': 'CRCHD Diversity Training',
'description': 'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
'imageSource' : img_news1_4x3,
'imageSrc' : img_news1_16x9,
'alt': 'CRCHD Diversity Training',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
)} />;
export const Default = () => (
<TestCase
css={css}
html={Template.bind({})({
title: 'CRCHD Diversity Training',
description:
'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
imageSource: img_news1_4x3,
imageSrc: img_news1_16x9,
alt: 'CRCHD Diversity Training',
ariaLabel: 'Card',
url: 'http://cancer.gov',
})}
/>
);

const TemplateGroup = (args) => ComponentGroup(args);

export const CardGroup = () => <TestCase css={css} html={TemplateGroup.bind({})(
{ 'items': [
{
'title': 'CRCHD Diversity Training',
'description': 'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
'imageSource' : img_news1_4x3,
'imageSrc' : img_news1_16x9,
'alt': 'CRCHD Diversity Training',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
{
'title': 'Grant Application Development, Submission, Review, & Award',
'description': 'In patients with certain variations in the OAS1 gene, treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
'imageSource' : img_news2_4x3,
'imageSrc' : img_news2_16x9,
'alt': 'Grant Application Development, Submission, Review, & Award',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
{
'title': 'Capacitación en diversidad CRCHD',
'description': 'El tratamiento para la COVID-19 grave con interferones disminuyó la carga viral del SARS-CoV-2, según encontró un nuevo estudio.',
'imageSource' : img_news3_4x3,
'imageSrc' : img_news3_16x9,
'alt': 'Capacitación en diversidad CRCHD',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
]},
)} />;
export const CardGroup = () => (
<TestCase
css={css}
html={TemplateGroup.bind({})({
items: [
{
title: 'CRCHD Diversity Training',
description:
'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
imageSource: img_news1_4x3,
imageSrc: img_news1_16x9,
alt: 'CRCHD Diversity Training',
ariaLabel: 'Card',
url: 'http://cancer.gov',
},
{
title: 'Grant Application Development, Submission, Review, & Award',
description:
'In patients with certain variations in the OAS1 gene, treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
imageSource: img_news2_4x3,
imageSrc: img_news2_16x9,
alt: 'Grant Application Development, Submission, Review, & Award',
ariaLabel: 'Card',
url: 'http://cancer.gov',
},
{
title: 'Capacitación en diversidad CRCHD',
description:
'El tratamiento para la COVID-19 grave con interferones disminuyó la carga viral del SARS-CoV-2, según encontró un nuevo estudio.',
imageSource: img_news3_4x3,
imageSrc: img_news3_16x9,
alt: 'Capacitación en diversidad CRCHD',
ariaLabel: 'Card',
url: 'http://cancer.gov',
},
],
})}
/>
);
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
@forward "usa-layout-grid";
@forward "usa-prose";

@use "@nciocpl/ncids-css/packages/usa-section" as section;
@use "@nciocpl/ncids-css/packages/nci-card-group" as card-group;
@use "@nciocpl/ncids-css/packages/nci-card" as card;
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import img_news2_4x3 from './img/news2-4x3.jpg';
import img_news3_16x9 from './img/news3-16x9.jpg';
import img_news3_4x3 from './img/news3-4x3.jpg';

import { ImagelessCardHTML } from './nci-imageless-card-example';

export default {
title: 'components/Card/Test Cases',
argTypes: {},
Expand All @@ -23,57 +25,74 @@ const Template = (args) => Component(args);

const FloatTemplate = (args) => FloatComponent(args);

export const CardGroupWithoutDescription = () => <TestCase css={css} html={Template.bind({})(
{ 'items': [
{
'title': 'CRCHD Diversity Training',
'imageSource' : img_news1_4x3,
'imageSrc' : img_news1_16x9,
'alt': 'CRCHD Diversity Training',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
{
'title': 'Grant Application Development, Submission, Review, & Award',
'imageSource' : img_news2_4x3,
'imageSrc' : img_news2_16x9,
'alt': 'Grant Application Development, Submission, Review, & Award',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
{
'title': 'Capacitación en diversidad CRCHD',
'imageSource' : img_news3_4x3,
'imageSrc' : img_news3_16x9,
'alt': 'Capacitación en diversidad CRCHD',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
]},
)} />;
export const CardGroupWithoutDescription = () => (
<TestCase
css={css}
html={Template.bind({})({
items: [
{
title: 'CRCHD Diversity Training',
imageSource: img_news1_4x3,
imageSrc: img_news1_16x9,
alt: 'CRCHD Diversity Training',
ariaLabel: 'Card',
url: 'http://cancer.gov',
},
{
title: 'Grant Application Development, Submission, Review, & Award',
imageSource: img_news2_4x3,
imageSrc: img_news2_16x9,
alt: 'Grant Application Development, Submission, Review, & Award',
ariaLabel: 'Card',
url: 'http://cancer.gov',
},
{
title: 'Capacitación en diversidad CRCHD',
imageSource: img_news3_4x3,
imageSrc: img_news3_16x9,
alt: 'Capacitación en diversidad CRCHD',
ariaLabel: 'Card',
url: 'http://cancer.gov',
},
],
})}
/>
);

export const CardInTextLeft = () => (
<TestCase
css={css}
html={FloatTemplate.bind({})({
modifier:
'float-left margin-bottom-5 tablet:margin-bottom-4 desktop:margin-x-5',
title: 'CRCHD Diversity Training',
description:
'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
imageSource: img_news1_4x3,
imageSrc: img_news1_16x9,
alt: 'CRCHD Diversity Training',
ariaLabel: 'Card',
url: 'http://cancer.gov',
})}
/>
);

export const CardInTextLeft = () => <TestCase css={css} html={FloatTemplate.bind({})(
{
'modifier': 'float-left margin-bottom-5 tablet:margin-bottom-4 desktop:margin-x-5',
'title': 'CRCHD Diversity Training',
'description': 'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
'imageSource' : img_news1_4x3,
'imageSrc' : img_news1_16x9,
'alt': 'CRCHD Diversity Training',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
)} />;
export const CardInTextRight = () => (
<TestCase
css={css}
html={FloatTemplate.bind({})({
modifier:
'float-right margin-bottom-5 tablet:margin-bottom-4 desktop:margin-x-5',
title: 'CRCHD Diversity Training',
description:
'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
imageSource: img_news1_4x3,
imageSrc: img_news1_16x9,
alt: 'CRCHD Diversity Training',
ariaLabel: 'Card',
url: 'http://cancer.gov',
})}
/>
);

export const CardInTextRight = () => <TestCase css={css} html={FloatTemplate.bind({})(
{
'modifier': 'float-right margin-bottom-5 tablet:margin-bottom-4 desktop:margin-x-5',
'title': 'CRCHD Diversity Training',
'description': 'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
'imageSource' : img_news1_4x3,
'imageSrc' : img_news1_16x9,
'alt': 'CRCHD Diversity Training',
'ariaLabel': 'Card',
'url': 'http://cancer.gov',
},
)} />;
export const ImagelessExample = () => <TestCase css={css} html={ImagelessCardHTML} />;
Loading