-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from MetroStar/card-updates
Card Updates
- Loading branch information
Showing
8 changed files
with
247 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 103 additions & 7 deletions
110
packages/comet-uswds/src/components/card/card.figma.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,68 @@ | ||
import React from 'react'; | ||
import { StoryFn, Meta } from '@storybook/react'; | ||
import { Card, CardHeader, CardFooter, CardBody, Button } from '../../index'; | ||
import { CardProps } from './card'; | ||
import { CardMedia, CardProps } from './card'; | ||
|
||
const meta: Meta<typeof Card> = { | ||
title: 'USWDS/Card', | ||
component: Card, | ||
argTypes: { | ||
id: { required: true }, | ||
layout: { control: { type: 'select', options: ['default', 'flag'] } }, | ||
}, | ||
}; | ||
export default meta; | ||
|
||
const Template: StoryFn<typeof Card> = (args: CardProps) => ( | ||
<Card {...args}> | ||
<CardHeader>Card Header</CardHeader> | ||
<CardBody>The meat of the card...</CardBody> | ||
<CardHeader>Card</CardHeader> | ||
<CardBody> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum tenetur quo cupiditate, | ||
eaque qui officia recusandae. | ||
</CardBody> | ||
<CardFooter> | ||
<Button id="card-button" variant="outline"> | ||
Click me... | ||
</Button> | ||
<Button id="card-button">Button</Button> | ||
</CardFooter> | ||
</Card> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
id: 'card-1', | ||
className: '', | ||
layout: 'default', | ||
className: 'maxw-mobile-lg', | ||
}; | ||
|
||
const MediaTemplate: StoryFn<typeof Card> = (args: CardProps) => ( | ||
<Card {...args}> | ||
<CardMedia> | ||
<img | ||
src="https://designsystem.digital.gov/img/introducing-uswds-2-0/built-to-grow--alt.jpg" | ||
alt="a placeholder image" | ||
/> | ||
</CardMedia> | ||
<CardHeader>Card with Media</CardHeader> | ||
<CardBody> | ||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Facilis earum tenetur quo cupiditate, | ||
eaque qui officia recusandae. | ||
</CardBody> | ||
<CardFooter> | ||
<Button id="card-button">Button</Button> | ||
</CardFooter> | ||
</Card> | ||
); | ||
|
||
export const WithMedia = MediaTemplate.bind({}); | ||
WithMedia.args = { | ||
id: 'card-standard-media', | ||
layout: 'default', | ||
className: 'maxw-mobile', | ||
}; | ||
|
||
export const FlagLayout = MediaTemplate.bind({}); | ||
FlagLayout.args = { | ||
id: 'card-flag-media', | ||
layout: 'flag', | ||
mediaRight: false, | ||
className: 'maxw-tablet', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { default, CardHeader, CardBody, CardFooter } from './card'; | ||
export { default, CardHeader, CardMedia, CardBody, CardFooter } from './card'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters