This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathva-card.stories.tsx
More file actions
73 lines (64 loc) · 1.72 KB
/
va-card.stories.tsx
File metadata and controls
73 lines (64 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { getWebComponentDocs, propStructure, StoryDocs } from './wc-helpers';
const cardDocs = getWebComponentDocs('va-card');
export default {
title: 'Components/Card',
id: 'components/va-card',
parameters: {
componentSubtitle: 'va-card web component',
docs: {
page: () => <StoryDocs storyDefault={Default} data={cardDocs} />,
},
},
};
const defaultArgs = {
'show-shadow': false,
'background': false,
'icon-name': '',
'has-cta': false,
};
const Template = ({ 'show-shadow': showShadow, 'background': background, 'icon-name': iconName, 'has-cta': hasCta }) => (
<va-card show-shadow={showShadow} background={background} icon-name={iconName}>
<div>
<h3 className='vads-u-margin-top--1'>Example card title</h3>
<p>Example card content</p>
{hasCta ? (
<va-link
href="https://www.va.gov"
text="Example call to action link"
/>
) : null}
</div>
</va-card>
);
export const Default = Template.bind(null);
Default.args = {
...defaultArgs,
};
Default.argTypes = propStructure(cardDocs);
export const withBackground = Template.bind(null);
withBackground.args = {
...defaultArgs,
background: true,
};
export const withDropShadow = Template.bind(null);
withDropShadow.args = {
...defaultArgs,
'show-shadow': true,
};
export const withIcon = Template.bind(null);
withIcon.args = {
...defaultArgs,
'icon-name': 'location_city',
};
withIcon.argTypes = {
...propStructure(cardDocs),
'icon-name': {
control: 'text',
description: 'Displays an icon at the top of the card in a blue circle. Value is the icon name.',
},
};
export const withCallToAction = Template.bind(null);
withCallToAction.args = {
...defaultArgs,
'has-cta': true,
};