qpp-style 1.8.2-rm.0 → 1.8.3-rm.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +28 -28
- package/.storybook/.babelrc +4 -0
- package/.storybook/main.js +86 -0
- package/.storybook/preview-head.html +9 -0
- package/.storybook/preview.js +5 -0
- package/README.md +4 -7
- package/components/Breadcrumb/Breadcrumb.stories.js +76 -0
- package/components/Button/Button.stories.js +121 -0
- package/components/CalloutBox/CalloutBox.stories.js +94 -0
- package/components/Card/Card.stories.js +163 -0
- package/components/Dropdown/Dropdown.stories.js +94 -0
- package/components/Footer/Footer.stories.js +13 -0
- package/components/Footer/FooterUI.jsx +2 -3
- package/components/Header/Header.stories.js +32 -0
- package/components/Header/HeaderUI.jsx +5 -13
- package/components/Header/ImpersonatorBanner.jsx +1 -2
- package/components/Infotip/Infotip.jsx +3 -3
- package/components/Infotip/Infotip.stories.js +61 -0
- package/components/Infotip/InfotipContent.jsx +46 -0
- package/components/Link/Link.stories.js +81 -0
- package/components/Modal/Modal.stories.js +159 -0
- package/components/NotificationBanner/NotificationBanner.stories.js +23 -0
- package/components/Search/Search.stories.js +21 -0
- package/components/Search/index.js +2 -2
- package/components/SideNav/Chart/__tests__/__snapshots__/ScoreChart.test.js.snap +9 -9
- package/components/SideNav/Chart/index.js +1 -1
- package/components/SideNav/SideNav.stories.js +379 -0
- package/components/SideNav/helpers.js +0 -5
- package/components/Tabs/Tab.js +12 -15
- package/components/Tabs/TabList.js +26 -0
- package/components/Tabs/TabPanel.js +9 -26
- package/components/Tabs/TabPanel2.js +18 -0
- package/components/Tabs/TabPanelWrapper.js +16 -0
- package/components/Tabs/Tabs.js +77 -0
- package/components/Tabs/Tabs.stories.js +113 -0
- package/components/TextInput/TextInput.stories.js +118 -0
- package/components/Tooltip/Tooltip.jsx +28 -70
- package/components/index.js +6 -6
- package/dist/browser.js +1 -1
- package/dist/browser.js.LICENSE.txt +0 -39
- package/dist/browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -39
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.LICENSE.txt +1 -40
- package/dist/react/index.js.map +1 -1
- package/jest.config.js +132 -139
- package/lib/SvgComponents.jsx +120 -7
- package/package.json +45 -27
- package/styles/qppds/base/_icon.scss +0 -8
- package/styles/qppds/components/_button.scss +0 -4
- package/styles/qppds/components/_footer.scss +2 -2
- package/styles/qppds/components/_link.scss +28 -23
- package/styles/qppds/components/_search.scss +0 -6
- package/styles/qppds/components/index.scss +0 -1
- package/styles/qppds/settings/mixins/_icons.scss +0 -10
- package/test/components/Infotip.test.js +28 -11
- package/test/components/Tooltip.test.js +11 -11
- package/components/DropdownButton/DropdownButton.stories.js +0 -127
- package/components/Tabs/index.js +0 -100
- package/components/Tooltip/Tooltip.stories.js +0 -80
- package/components/Tooltip/index.js +0 -3
- package/components/Tooltip/position.js +0 -68
package/.eslintrc.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
extends: ['eslint:recommended', 'plugin:react/recommended'],
|
|
3
|
+
parser: 'babel-eslint',
|
|
4
|
+
parserOptions: {
|
|
5
|
+
sourceType: 'module',
|
|
6
|
+
ecmaFeatures: {
|
|
7
|
+
jsx: true
|
|
8
|
+
}
|
|
8
9
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
10
|
+
env: {
|
|
11
|
+
es6: true,
|
|
12
|
+
node: true,
|
|
13
|
+
browser: true,
|
|
14
|
+
jquery: true,
|
|
15
|
+
mocha: true
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
'no-unused-vars': [
|
|
19
|
+
'error',
|
|
20
|
+
{
|
|
21
|
+
args: 'none'
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
'linebreak-style': ['error', 'unix'],
|
|
25
|
+
'no-console': 0,
|
|
26
|
+
'no-prototype-builtins': [0]
|
|
27
|
+
},
|
|
28
|
+
settings: {
|
|
29
|
+
react: { version: 'detect' }
|
|
30
|
+
}
|
|
31
31
|
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
stories: [
|
|
7
|
+
'../components/**/*.stories.@(js|jsx|mdx)',
|
|
8
|
+
'../lib/**/*.stories.@(js|jsx|mdx)',
|
|
9
|
+
],
|
|
10
|
+
addons: [
|
|
11
|
+
'@storybook/addon-actions',
|
|
12
|
+
'@storybook/addon-links',
|
|
13
|
+
'@storybook/addon-storysource',
|
|
14
|
+
'@storybook/addon-knobs',
|
|
15
|
+
'@storybook/addon-a11y',
|
|
16
|
+
'@storybook/addon-docs',
|
|
17
|
+
'@storybook/addon-backgrounds',
|
|
18
|
+
'@storybook/addon-viewport',
|
|
19
|
+
'@storybook/addon-postcss',
|
|
20
|
+
],
|
|
21
|
+
webpackFinal: async (config) => {
|
|
22
|
+
// do mutation to the config
|
|
23
|
+
config.plugins.push(
|
|
24
|
+
new CopyWebpackPlugin({
|
|
25
|
+
patterns: [
|
|
26
|
+
{
|
|
27
|
+
from: path.join(__dirname, '..', '..', 'shared', 'fonts/'),
|
|
28
|
+
to: 'fonts/',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
from: path.join(__dirname, '..', '..', 'shared', 'images/'),
|
|
32
|
+
to: 'images/',
|
|
33
|
+
force: true,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
config.module.rules.push({
|
|
39
|
+
test: /\.scss$/,
|
|
40
|
+
resolve: {
|
|
41
|
+
extensions: ['.scss', '.sass'],
|
|
42
|
+
},
|
|
43
|
+
use: [
|
|
44
|
+
{
|
|
45
|
+
loader: 'style-loader',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
loader: 'css-loader',
|
|
49
|
+
options: {
|
|
50
|
+
sourceMap: true,
|
|
51
|
+
importLoaders: 1,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
loader: 'sass-loader',
|
|
56
|
+
options: {
|
|
57
|
+
sourceMap: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
config.module.rules.push({
|
|
64
|
+
test: /\.svg$/i,
|
|
65
|
+
issuer: /\.[jt]sx?$/,
|
|
66
|
+
use: ['@svgr/webpack'],
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const staticAssetLoader = config.module.rules.find((rule) => {
|
|
70
|
+
const regExp = rule.test;
|
|
71
|
+
const isRegExp = regExp && typeof regExp.test === 'function';
|
|
72
|
+
return isRegExp && regExp.test('.svg');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
if (staticAssetLoader) {
|
|
76
|
+
// remove svg matching from storybook's default static asset loader
|
|
77
|
+
staticAssetLoader.test =
|
|
78
|
+
/\.(ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return config;
|
|
82
|
+
},
|
|
83
|
+
core: {
|
|
84
|
+
builder: 'webpack5',
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Boottrap navbar and dropdowns used by <Header> component require jQuery
|
|
3
|
+
TODO: <Header> should be refactored to no longer rely on bootstrap.
|
|
4
|
+
-->
|
|
5
|
+
<script
|
|
6
|
+
src="https://code.jquery.com/jquery-3.5.1.min.js"
|
|
7
|
+
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
|
|
8
|
+
crossorigin="anonymous"
|
|
9
|
+
></script>
|
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This directory contains react implementations of the components for QPP.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A storybook with examples is published at [https://cmsgov.github.io/qpp-style](https://cmsgov.github.io/qpp-style)
|
|
6
6
|
|
|
7
|
+
## Github Branch and Pull Request process
|
|
7
8
|
1. Create branch off main and create a Pull Request into main for the feature.
|
|
8
|
-
|
|
9
|
+
>Example Branch Name: feature/QPPXX-XXXX_make_icon_better
|
|
9
10
|
2. Once merged into main, create release branch from main.
|
|
10
11
|
3. Name the new branch release/x.xx.x
|
|
11
12
|
4. Run the version bump:
|
|
@@ -16,15 +17,13 @@ npm version --no-git-tag-version patch
|
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
Example Commit Message:
|
|
19
|
-
|
|
20
20
|
> x.xx.x release
|
|
21
21
|
|
|
22
22
|
5. Create a pull request against main with the PR Title: x.xx.x release [Example PR](https://github.com/CMSgov/qpp-style/pull/1065)
|
|
23
23
|
6. Enter the change in the description of the pull request i.e.:
|
|
24
|
-
|
|
24
|
+
> Added new svg for Icon Name
|
|
25
25
|
|
|
26
26
|
## Generate an NPM token with Publish permissions
|
|
27
|
-
|
|
28
27
|
1. If you do not already have an access token, sign in to npmjs.com and navigate to access tokens.
|
|
29
28
|
2. Click generate new token.
|
|
30
29
|
3. Select publish under type.
|
|
@@ -35,11 +34,9 @@ export NPM_TOKEN={npm_token}
|
|
|
35
34
|
```
|
|
36
35
|
|
|
37
36
|
## Publish the react qpp-style npm package (used by both react and angular)
|
|
38
|
-
|
|
39
37
|
```bash
|
|
40
38
|
cd qpp-style/react
|
|
41
39
|
npm i
|
|
42
40
|
npm publish
|
|
43
41
|
```
|
|
44
|
-
|
|
45
42
|
7. Once published successfully, merge into main.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Breadcrumb from './index';
|
|
3
|
+
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Breadcrumb',
|
|
7
|
+
component: Breadcrumb,
|
|
8
|
+
decorators: [withKnobs],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ExampleLightBreadcrumb = () => (
|
|
12
|
+
<div className="qppds qpp-u-padding--16 qpp-u-fill--blue-80">
|
|
13
|
+
<Breadcrumb
|
|
14
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
15
|
+
crumbs={[
|
|
16
|
+
{
|
|
17
|
+
url: '/',
|
|
18
|
+
category: 'MainContent',
|
|
19
|
+
label: 'Home',
|
|
20
|
+
title: 'Home',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
url: '/',
|
|
24
|
+
category: 'MainContent',
|
|
25
|
+
label: 'Mips Overview',
|
|
26
|
+
title: 'Mips Overview',
|
|
27
|
+
},
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
ExampleLightBreadcrumb.storyName = 'Light';
|
|
34
|
+
|
|
35
|
+
export const ExampleScreenreaderOnlyBreadcrumb = () => (
|
|
36
|
+
<div className="qppds qpp-u-padding--16 qpp-u-fill--blue-80">
|
|
37
|
+
<Breadcrumb
|
|
38
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
39
|
+
crumbs={[
|
|
40
|
+
{
|
|
41
|
+
url: '/',
|
|
42
|
+
category: 'MainContent',
|
|
43
|
+
label: 'Home',
|
|
44
|
+
title: 'Home',
|
|
45
|
+
},
|
|
46
|
+
'Mips Overview',
|
|
47
|
+
]}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
ExampleScreenreaderOnlyBreadcrumb.storyName = 'SR Only Breadcrumb';
|
|
52
|
+
|
|
53
|
+
export const ExampleDarkBreadcrumb = () => (
|
|
54
|
+
<div className="qppds qpp-u-padding--16">
|
|
55
|
+
<Breadcrumb
|
|
56
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
57
|
+
dark
|
|
58
|
+
crumbs={[
|
|
59
|
+
{
|
|
60
|
+
url: '/',
|
|
61
|
+
category: 'MainContent',
|
|
62
|
+
label: 'Home',
|
|
63
|
+
title: 'Home',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
url: '/',
|
|
67
|
+
category: 'MainContent',
|
|
68
|
+
label: 'Mips Overview',
|
|
69
|
+
title: 'Mips Overview',
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
ExampleDarkBreadcrumb.storyName = 'Dark';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
|
4
|
+
import FeatherIcon from 'feather-icons-react';
|
|
5
|
+
|
|
6
|
+
import Button, { TextButton } from './index';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Button',
|
|
10
|
+
component: Button,
|
|
11
|
+
decorators: [withKnobs],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Container = ({ className = '', children }) => (
|
|
15
|
+
<div className={`qppds qpp-u-padding--16 ${className}`}>{children}</div>
|
|
16
|
+
);
|
|
17
|
+
Container.propTypes = {
|
|
18
|
+
className: PropTypes.string,
|
|
19
|
+
children: PropTypes.node,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Primary = () => (
|
|
23
|
+
<Container>
|
|
24
|
+
<Button>Button</Button>
|
|
25
|
+
</Container>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export const Secondary = () => (
|
|
29
|
+
<Container>
|
|
30
|
+
<Button variant="secondary">Button</Button>
|
|
31
|
+
</Container>
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const Danger = () => (
|
|
35
|
+
<Container>
|
|
36
|
+
<Button variant="danger">Button</Button>
|
|
37
|
+
</Container>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const Outline = () => (
|
|
41
|
+
<Container className="qpp-u-fill--blue-80">
|
|
42
|
+
<Button variant="outline">Button</Button>
|
|
43
|
+
</Container>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export const White = () => (
|
|
47
|
+
<Container className="qpp-u-fill--blue-80">
|
|
48
|
+
<Button variant="white">Button</Button>
|
|
49
|
+
</Container>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export const Icon = () => (
|
|
53
|
+
<Container>
|
|
54
|
+
<Button>
|
|
55
|
+
Icon Button <FeatherIcon icon="chevron-right" />
|
|
56
|
+
</Button>
|
|
57
|
+
<hr />
|
|
58
|
+
<Button variant="secondary">
|
|
59
|
+
<FeatherIcon icon="download" /> Icon Button
|
|
60
|
+
</Button>
|
|
61
|
+
<hr />
|
|
62
|
+
<Button variant="danger">
|
|
63
|
+
Icon Button <FeatherIcon icon="chevron-right" />
|
|
64
|
+
</Button>
|
|
65
|
+
<hr />
|
|
66
|
+
<Button variant="white">
|
|
67
|
+
Icon Button <FeatherIcon icon="chevron-right" />
|
|
68
|
+
</Button>
|
|
69
|
+
</Container>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
export const Big = () => (
|
|
73
|
+
<Container>
|
|
74
|
+
<Button size="big">Big Primary Button</Button>
|
|
75
|
+
<hr />
|
|
76
|
+
<Button size="big" variant="secondary">
|
|
77
|
+
Big Secondary Button
|
|
78
|
+
</Button>
|
|
79
|
+
</Container>
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
export const Link = () => (
|
|
83
|
+
<Container>
|
|
84
|
+
<Button href="https://qpp.cms.gov/">Link Button</Button>
|
|
85
|
+
<hr />
|
|
86
|
+
<Button href="https://qpp.cms.gov/" variant="secondary">
|
|
87
|
+
SecondaryLink Button
|
|
88
|
+
</Button>
|
|
89
|
+
<hr />
|
|
90
|
+
<Button href="https://qpp.cms.gov/" variant="danger">
|
|
91
|
+
Danger Link Button
|
|
92
|
+
</Button>
|
|
93
|
+
<hr />
|
|
94
|
+
<div className="qpp-u-fill--gray-60 qpp-u-padding--8">
|
|
95
|
+
<Button href="https://qpp.cms.gov/" variant="white">
|
|
96
|
+
White Link Button
|
|
97
|
+
</Button>
|
|
98
|
+
</div>
|
|
99
|
+
</Container>
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export const TextButtonStory = () => (
|
|
103
|
+
<Container>
|
|
104
|
+
<TextButton>Button</TextButton>
|
|
105
|
+
<hr />
|
|
106
|
+
<TextButton variant="danger">Button</TextButton>
|
|
107
|
+
<hr />
|
|
108
|
+
<div className="qpp-u-fill--gray-60 qpp-u-padding--8">
|
|
109
|
+
<TextButton variant="white">Button</TextButton>
|
|
110
|
+
</div>
|
|
111
|
+
<hr />
|
|
112
|
+
<TextButton>
|
|
113
|
+
<FeatherIcon icon="download" /> Icon Button
|
|
114
|
+
</TextButton>
|
|
115
|
+
<hr />
|
|
116
|
+
<TextButton>
|
|
117
|
+
Icon Button <FeatherIcon icon="chevron-right" />
|
|
118
|
+
</TextButton>
|
|
119
|
+
</Container>
|
|
120
|
+
);
|
|
121
|
+
TextButtonStory.storyName = 'Text Button';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
|
3
|
+
|
|
4
|
+
import CalloutBox from './index';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'CalloutBox',
|
|
8
|
+
component: CalloutBox,
|
|
9
|
+
decorators: [withKnobs],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = () => {
|
|
13
|
+
return (
|
|
14
|
+
<div className="qpp-u-padding--12" style={{ maxWidth: '80ch' }}>
|
|
15
|
+
<CalloutBox
|
|
16
|
+
title="Call to Action Heading"
|
|
17
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
18
|
+
button={{
|
|
19
|
+
text: 'Call to Action',
|
|
20
|
+
onClick: () => console.log('cta clicked'),
|
|
21
|
+
}}
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const WithHref = () => {
|
|
28
|
+
return (
|
|
29
|
+
<div className="qpp-u-padding--12" style={{ maxWidth: '80ch' }}>
|
|
30
|
+
<CalloutBox
|
|
31
|
+
title="Call to Action Heading"
|
|
32
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
33
|
+
button={{
|
|
34
|
+
text: 'Call to Action',
|
|
35
|
+
href: 'https://example.com',
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const WithTextInput = () => {
|
|
43
|
+
const [value, setValue] = useState('');
|
|
44
|
+
return (
|
|
45
|
+
<div className="qpp-u-padding--12" style={{ maxWidth: '80ch' }}>
|
|
46
|
+
<CalloutBox
|
|
47
|
+
title="Call to Action Heading"
|
|
48
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
49
|
+
input={{
|
|
50
|
+
placeholder: 'Placeholder',
|
|
51
|
+
onChange: (e) => setValue(e.target.value),
|
|
52
|
+
value,
|
|
53
|
+
}}
|
|
54
|
+
button={{
|
|
55
|
+
text: 'Call to Action',
|
|
56
|
+
onClick: () => {
|
|
57
|
+
console.log('cta clicked');
|
|
58
|
+
console.log('input value --- ', value);
|
|
59
|
+
},
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const WithHeaderLevel = () => {
|
|
67
|
+
return (
|
|
68
|
+
<div className="qpp-u-padding--12" style={{ maxWidth: '80ch' }}>
|
|
69
|
+
<CalloutBox
|
|
70
|
+
title="H5 Heading"
|
|
71
|
+
headerLevel={5}
|
|
72
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
73
|
+
button={{
|
|
74
|
+
text: 'Call to Action',
|
|
75
|
+
href: 'https://example.com',
|
|
76
|
+
}}
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const WithButtonOverride = () => {
|
|
83
|
+
const Button = () => <button>My custom button</button>;
|
|
84
|
+
return (
|
|
85
|
+
<div className="qpp-u-padding--12" style={{ maxWidth: '80ch' }}>
|
|
86
|
+
<CalloutBox
|
|
87
|
+
title="H5 Heading"
|
|
88
|
+
headerLevel={5}
|
|
89
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit."
|
|
90
|
+
button={<Button />}
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
|
3
|
+
|
|
4
|
+
import Card from './index';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Card',
|
|
8
|
+
component: Card,
|
|
9
|
+
decorators: [withKnobs],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = () => {
|
|
13
|
+
return (
|
|
14
|
+
<div className="qpp-u-padding--12 qpp-u-width--33">
|
|
15
|
+
<Card
|
|
16
|
+
title="Card Heading"
|
|
17
|
+
eyebrow="Eyebrow"
|
|
18
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
19
|
+
cta={{
|
|
20
|
+
text: 'Call to Action',
|
|
21
|
+
href: '#',
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const CustomButton = () => (
|
|
29
|
+
<div className="qpp-u-padding--12 qpp-u-width--33">
|
|
30
|
+
<Card
|
|
31
|
+
title="Card Heading"
|
|
32
|
+
eyebrow="Eyebrow"
|
|
33
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
34
|
+
cta={
|
|
35
|
+
<button
|
|
36
|
+
className="qpp-c-button"
|
|
37
|
+
onClick={() => console.log("I've been clicked")}
|
|
38
|
+
style={{
|
|
39
|
+
padding: '0.75rem 1rem',
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
Click me
|
|
43
|
+
</button>
|
|
44
|
+
}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const Image = () => (
|
|
50
|
+
<div className="qpp-u-padding--12 qpp-u-width--33">
|
|
51
|
+
<Card
|
|
52
|
+
title="Card Heading"
|
|
53
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
54
|
+
eyebrow="Eyebrow"
|
|
55
|
+
cta={{
|
|
56
|
+
text: 'Call to Action',
|
|
57
|
+
href: '#',
|
|
58
|
+
}}
|
|
59
|
+
img={{
|
|
60
|
+
url: 'https://qpp.cms.gov/images/public/images/resource-data-submission-mips.png',
|
|
61
|
+
alt: 'Card image alt',
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export const SmallImageCard = () => (
|
|
68
|
+
<div className="qpp-u-padding--12 wrap qpp-u-width--25">
|
|
69
|
+
<Card
|
|
70
|
+
title="Card Heading"
|
|
71
|
+
eyebrow="Eyebrow"
|
|
72
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
73
|
+
size="small"
|
|
74
|
+
cta={{
|
|
75
|
+
text: 'Call to Action',
|
|
76
|
+
href: '#',
|
|
77
|
+
}}
|
|
78
|
+
img={{
|
|
79
|
+
url: 'https://qpp.cms.gov/images/public/images/resource-data-submission-mips.png',
|
|
80
|
+
alt: 'Card image alt',
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const MediumImageCard = () => (
|
|
87
|
+
<div className="qpp-u-padding--12 wrap qpp-u-width--33">
|
|
88
|
+
<Card
|
|
89
|
+
title="Card Heading"
|
|
90
|
+
eyebrow="Eyebrow"
|
|
91
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
92
|
+
size="medium"
|
|
93
|
+
cta={{
|
|
94
|
+
text: 'Call to Action',
|
|
95
|
+
href: '#',
|
|
96
|
+
}}
|
|
97
|
+
img={{
|
|
98
|
+
url: 'https://qpp.cms.gov/images/public/images/resource-data-submission-mips.png',
|
|
99
|
+
alt: 'Card image alt',
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
export const LargeImageCard = () => (
|
|
106
|
+
<div className="qpp-u-padding--12 wrap qpp-u-width--100">
|
|
107
|
+
<Card
|
|
108
|
+
title="Card Heading"
|
|
109
|
+
eyebrow="Eyebrow"
|
|
110
|
+
variant="flag"
|
|
111
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
112
|
+
size="large"
|
|
113
|
+
cta={{
|
|
114
|
+
text: 'Call to Action',
|
|
115
|
+
href: '#',
|
|
116
|
+
}}
|
|
117
|
+
img={{
|
|
118
|
+
url: 'https://qpp.cms.gov/images/public/images/resource-data-submission-mips.png',
|
|
119
|
+
alt: 'Card image alt',
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
export const ResponsiveFlagCard = () => (
|
|
126
|
+
<div className="qpp-u-padding--12 wrap qpp-u-width--100">
|
|
127
|
+
<Card
|
|
128
|
+
title="Card Heading"
|
|
129
|
+
eyebrow="Eyebrow"
|
|
130
|
+
responsive
|
|
131
|
+
variant="flag"
|
|
132
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit amet justo et lacus lacinia tristique. Nulla dignissim ipsum sit amet posuere interdum."
|
|
133
|
+
size="large"
|
|
134
|
+
cta={{
|
|
135
|
+
text: 'Call to Action',
|
|
136
|
+
href: '#',
|
|
137
|
+
}}
|
|
138
|
+
img={{
|
|
139
|
+
url: 'https://qpp.cms.gov/images/public/images/resource-data-submission-mips.png',
|
|
140
|
+
alt: 'Card image alt',
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
export const BackgroundImageCard = () => (
|
|
147
|
+
<div className="qpp-u-padding--12 wrap qpp-u-width--33">
|
|
148
|
+
<Card
|
|
149
|
+
className="qpp-c-card--medium qpp-c-card--image qpp-c-xs-card--flag qpp-c-sm-card--default qpp-u-flex--auto qpp-u-sm-flex--1"
|
|
150
|
+
title="QPP Access User Guide"
|
|
151
|
+
description="Download zip file"
|
|
152
|
+
cta={{
|
|
153
|
+
text: 'Call to Action',
|
|
154
|
+
href: '#',
|
|
155
|
+
}}
|
|
156
|
+
img={{
|
|
157
|
+
url: 'https://qpp.cms.gov/images/public/images/resource-pdf.png',
|
|
158
|
+
alt: 'Card image alt',
|
|
159
|
+
useBgImage: true,
|
|
160
|
+
}}
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
);
|