@madie/madie-design-system 1.0.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/.babelrc +10 -0
- package/.editorconfig +22 -0
- package/.eslintignore +5 -0
- package/.eslintrc.js +31 -0
- package/.storybook/.babelrc +4 -0
- package/.storybook/main.js +89 -0
- package/.storybook/preview-head.html +9 -0
- package/.storybook/preview.js +5 -0
- package/README.md +5 -0
- package/components/Accordion/Accordion.stories.js +20 -0
- package/components/Accordion/index.jsx +93 -0
- package/components/Alert/Alert.stories.js +61 -0
- package/components/Alert/index.js +46 -0
- package/components/Breadcrumb/Breadcrumb.md +28 -0
- package/components/Breadcrumb/Breadcrumb.stories.js +76 -0
- package/components/Breadcrumb/index.js +83 -0
- package/components/Button/Button.stories.js +121 -0
- package/components/Button/index.js +90 -0
- package/components/CalloutBox/CalloutBox.stories.js +94 -0
- package/components/CalloutBox/index.js +109 -0
- package/components/Card/Card.stories.js +163 -0
- package/components/Card/index.js +137 -0
- package/components/Dropdown/Dropdown.stories.js +94 -0
- package/components/Dropdown/index.js +85 -0
- package/components/Error/Collapsible.jsx +88 -0
- package/components/Error/ErrorUI.jsx +31 -0
- package/components/Error/error.js +26 -0
- package/components/FlashNotification/FlashNotificationUI.jsx +91 -0
- package/components/FlashNotification/index.js +30 -0
- package/components/Footer/Footer.stories.js +20 -0
- package/components/Footer/FooterUI.jsx +269 -0
- package/components/Footer/LegacyFooterUI.jsx +194 -0
- package/components/Footer/SocialLinks.jsx +60 -0
- package/components/Footer/Subscribe.jsx +34 -0
- package/components/Footer/footer.js +30 -0
- package/components/Header/Header.md +111 -0
- package/components/Header/Header.stories.js +32 -0
- package/components/Header/HeaderAccountMenu.jsx +169 -0
- package/components/Header/HeaderCancel.jsx +16 -0
- package/components/Header/HeaderContainer.jsx +63 -0
- package/components/Header/HeaderLogo.jsx +42 -0
- package/components/Header/HeaderMenuButton.js +50 -0
- package/components/Header/HeaderMenuItem.jsx +232 -0
- package/components/Header/HeaderMenuLink.js +50 -0
- package/components/Header/HeaderMenuSignOutButton.js +62 -0
- package/components/Header/HeaderMobileButton.js +37 -0
- package/components/Header/HeaderUI.jsx +167 -0
- package/components/Header/HelpIcon.jsx +32 -0
- package/components/Header/ImpersonatorBanner.jsx +57 -0
- package/components/Header/NavigationButtonIcon.jsx +27 -0
- package/components/Header/default-content.json +280 -0
- package/components/Header/header.js +40 -0
- package/components/Header/hooks.js +52 -0
- package/components/Header/utag-helpers.js +9 -0
- package/components/Infotip/Infotip.jsx +75 -0
- package/components/Infotip/Infotip.stories.js +50 -0
- package/components/Infotip/InfotipIcon.jsx +41 -0
- package/components/Infotip/index.js +3 -0
- package/components/Link/Link.stories.js +81 -0
- package/components/Link/index.js +61 -0
- package/components/Modal/LegacyModal.jsx +72 -0
- package/components/Modal/Modal.jsx +140 -0
- package/components/Modal/Modal.stories.js +159 -0
- package/components/Modal/index.jsx +22 -0
- package/components/NotificationBanner/NotificationBanner.stories.js +23 -0
- package/components/NotificationBanner/index.js +265 -0
- package/components/SanitizedContent/index.jsx +200 -0
- package/components/Search/Search.stories.js +21 -0
- package/components/Search/index.js +85 -0
- package/components/SessionDialog/sessionDialog.js +26 -0
- package/components/SessionDialogUI.jsx +261 -0
- package/components/SideNav/AnimationGroup/AnimationGroup.jsx +27 -0
- package/components/SideNav/Chart/ScoreChart.jsx +268 -0
- package/components/SideNav/Chart/__tests__/ScoreChart.test.js +22 -0
- package/components/SideNav/Chart/__tests__/__snapshots__/ScoreChart.test.js.snap +173 -0
- package/components/SideNav/Chart/index.js +3 -0
- package/components/SideNav/Content/LevelOneContent.jsx +208 -0
- package/components/SideNav/Content/LevelTwoContent.jsx +216 -0
- package/components/SideNav/Content/index.js +4 -0
- package/components/SideNav/Details/IndividualDetails.jsx +18 -0
- package/components/SideNav/Details/PracticeDetails.jsx +45 -0
- package/components/SideNav/Details/index.js +4 -0
- package/components/SideNav/Links/CmsSwitchLink.jsx +41 -0
- package/components/SideNav/Links/NavItemInline.jsx +54 -0
- package/components/SideNav/Links/NavLinkContainer.jsx +38 -0
- package/components/SideNav/Links/NavLinkDrawer.jsx +249 -0
- package/components/SideNav/Links/NavLinkInline.jsx +107 -0
- package/components/SideNav/Links/NavLinkToggle.jsx +34 -0
- package/components/SideNav/Links/index.js +13 -0
- package/components/SideNav/SideNav.md +50 -0
- package/components/SideNav/SideNav.stories.js +379 -0
- package/components/SideNav/UI/SideNavUI.jsx +333 -0
- package/components/SideNav/UI/default-content.json +99 -0
- package/components/SideNav/UI/index.js +3 -0
- package/components/SideNav/helpers.js +49 -0
- package/components/SideNav/index.js +53 -0
- package/components/Spinner/index.js +9 -0
- package/components/Tabs/Tab.js +26 -0
- package/components/Tabs/TabPanel.js +34 -0
- package/components/Tabs/Tabs.stories.js +120 -0
- package/components/Tabs/index.js +95 -0
- package/components/TextInput/TextInput.stories.js +118 -0
- package/components/TextInput/index.js +137 -0
- package/components/Tooltip/Tooltip.jsx +88 -0
- package/components/Tooltip/Tooltip.stories.js +80 -0
- package/components/Tooltip/index.js +3 -0
- package/components/Tooltip/position.js +68 -0
- package/components/UnwrappedSpinner/index.js +8 -0
- package/components/hooks/useGetConfig.js +74 -0
- package/components/index.js +126 -0
- package/dist/browser.js +3 -0
- package/dist/browser.js.LICENSE.txt +54 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.LICENSE.txt +54 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.LICENSE.txt +71 -0
- package/dist/react/index.js.map +1 -0
- package/fonts/FontAwesome.otf +0 -0
- package/fonts/OFL.txt +92 -0
- package/fonts/Rubik-Black.ttf +0 -0
- package/fonts/Rubik-BlackItalic.ttf +0 -0
- package/fonts/Rubik-Bold.ttf +0 -0
- package/fonts/Rubik-BoldItalic.ttf +0 -0
- package/fonts/Rubik-Italic.ttf +0 -0
- package/fonts/Rubik-Light.ttf +0 -0
- package/fonts/Rubik-LightItalic.ttf +0 -0
- package/fonts/Rubik-Medium.ttf +0 -0
- package/fonts/Rubik-MediumItalic.ttf +0 -0
- package/fonts/Rubik-Regular.ttf +0 -0
- package/fonts/fontawesome-webfont.eot +0 -0
- package/fonts/fontawesome-webfont.svg +2671 -0
- package/fonts/fontawesome-webfont.ttf +0 -0
- package/fonts/fontawesome-webfont.woff +0 -0
- package/fonts/fontawesome-webfont.woff2 +0 -0
- package/images/favicon/android-chrome-192x192.png +0 -0
- package/images/favicon/android-chrome-256x256.png +0 -0
- package/images/favicon/apple-touch-icon.png +0 -0
- package/images/favicon/browserconfig.xml +9 -0
- package/images/favicon/favicon-16x16.png +0 -0
- package/images/favicon/favicon-32x32.png +0 -0
- package/images/favicon/favicon.ico +0 -0
- package/images/favicon/manifest.json +18 -0
- package/images/favicon/mstile-150x150.png +0 -0
- package/images/favicon/safari-pinned-tab.svg +32 -0
- package/images/hhs-logo-black.svg +10 -0
- package/images/hhs-logo-white.svg +10 -0
- package/images/icons/close-x.svg +6 -0
- package/images/icons/help-headset.svg +21 -0
- package/images/icons/svg/arrow-down.svg +1 -0
- package/images/icons/svg/arrow-download.svg +1 -0
- package/images/icons/svg/arrow-right.svg +1 -0
- package/images/icons/svg/calendar.svg +1 -0
- package/images/icons/svg/close.svg +1 -0
- package/images/icons/svg/download.svg +1 -0
- package/images/icons/svg/external.svg +1 -0
- package/images/icons/svg/file-upload.svg +1 -0
- package/images/icons/svg/print.svg +1 -0
- package/images/icons/svg/search.svg +7 -0
- package/images/icons/svg/tooltip-question.svg +6 -0
- package/images/icons/svg/trash.svg +1 -0
- package/images/icons/svg/upload.svg +1 -0
- package/images/qpp_logo_reversed.png +0 -0
- package/images/qpp_logo_rgb_color.png +0 -0
- package/index.js +31 -0
- package/jest/mediaFileTransformer.js +9 -0
- package/jest.config.js +188 -0
- package/lib/Chevron.jsx +32 -0
- package/lib/SvgComponents.jsx +539 -0
- package/lib/svg-definitions.svg +125 -0
- package/package.json +125 -0
- package/session/index.js +5 -0
- package/session/logout.js +65 -0
- package/session/refresh.js +49 -0
- package/session/ttl.js +37 -0
- package/styles/_global.scss +106 -0
- package/styles/_main.scss +15 -0
- package/styles/_paths.scss +1 -0
- package/styles/_qpp-style.scss +31 -0
- package/styles/components/_accordion.scss +289 -0
- package/styles/components/_alerts.scss +54 -0
- package/styles/components/_autocomplete.scss +47 -0
- package/styles/components/_breadcrumbs.scss +64 -0
- package/styles/components/_buttons.scss +580 -0
- package/styles/components/_error-page.scss +56 -0
- package/styles/components/_flash-notification.scss +98 -0
- package/styles/components/_fonts.scss +42 -0
- package/styles/components/_forms.scss +277 -0
- package/styles/components/_grid.scss +37 -0
- package/styles/components/_info-modal.scss +139 -0
- package/styles/components/_links.scss +12 -0
- package/styles/components/_modals.scss +18 -0
- package/styles/components/_notification-banner.scss +165 -0
- package/styles/components/_panels.scss +61 -0
- package/styles/components/_pie-chart.scss +13 -0
- package/styles/components/_score-chart.scss +164 -0
- package/styles/components/_spinner.scss +7 -0
- package/styles/components/_tables.scss +111 -0
- package/styles/components/_tabs.scss +69 -0
- package/styles/components/_text.scss +150 -0
- package/styles/components/_toggles.scss +3 -0
- package/styles/components/_tooltip.scss +23 -0
- package/styles/components/_variables.scss +157 -0
- package/styles/components/_wells.scss +92 -0
- package/styles/qppds/README.md +0 -0
- package/styles/qppds/base/_backgrounds.scss +7 -0
- package/styles/qppds/base/_fonts.scss +26 -0
- package/styles/qppds/base/_icon.scss +23 -0
- package/styles/qppds/base/_layout.scss +5 -0
- package/styles/qppds/base/_typography.scss +85 -0
- package/styles/qppds/base/index.scss +8 -0
- package/styles/qppds/components/_alert.scss +95 -0
- package/styles/qppds/components/_breadcrumbs.scss +70 -0
- package/styles/qppds/components/_button.scss +292 -0
- package/styles/qppds/components/_card.scss +175 -0
- package/styles/qppds/components/_dropdown.scss +55 -0
- package/styles/qppds/components/_footer.scss +597 -0
- package/styles/qppds/components/_header.scss +892 -0
- package/styles/qppds/components/_link.scss +52 -0
- package/styles/qppds/components/_modal.scss +118 -0
- package/styles/qppds/components/_page-header.scss +67 -0
- package/styles/qppds/components/_pagination.scss +227 -0
- package/styles/qppds/components/_search.scss +112 -0
- package/styles/qppds/components/_sidebar.scss +9 -0
- package/styles/qppds/components/_table.scss +139 -0
- package/styles/qppds/components/_tabs.scss +197 -0
- package/styles/qppds/components/_text-input.scss +60 -0
- package/styles/qppds/components/index.scss +16 -0
- package/styles/qppds/components/sidebar/_animations.scss +38 -0
- package/styles/qppds/components/sidebar/_cms.scss +61 -0
- package/styles/qppds/components/sidebar/_details.scss +58 -0
- package/styles/qppds/components/sidebar/_links.scss +444 -0
- package/styles/qppds/components/sidebar/_sidebar-animation.scss +125 -0
- package/styles/qppds/components/sidebar/_sidebar-tooltip.scss +33 -0
- package/styles/qppds/components/sidebar/_sidebar.scss +146 -0
- package/styles/qppds/components/sidebar/project-specific/_wi.scss +42 -0
- package/styles/qppds/index.scss +4 -0
- package/styles/qppds/settings/_functions.scss +4 -0
- package/styles/qppds/settings/_index.scss +3 -0
- package/styles/qppds/settings/mixins/_borders.scss +6 -0
- package/styles/qppds/settings/mixins/_focus.scss +28 -0
- package/styles/qppds/settings/mixins/_icons.scss +33 -0
- package/styles/qppds/settings/mixins/_index.scss +8 -0
- package/styles/qppds/settings/mixins/_layout.scss +74 -0
- package/styles/qppds/settings/mixins/_lists.scss +12 -0
- package/styles/qppds/settings/mixins/_table.scss +91 -0
- package/styles/qppds/settings/mixins/_type.scss +65 -0
- package/styles/qppds/settings/mixins/_visually-hidden.scss +30 -0
- package/styles/qppds/settings/variables/_color.scss +86 -0
- package/styles/qppds/settings/variables/_index.scss +3 -0
- package/styles/qppds/settings/variables/_layout.scss +67 -0
- package/styles/qppds/settings/variables/_type.scss +132 -0
- package/styles/qppds/utilities/_background-color.scss +134 -0
- package/styles/qppds/utilities/_color.scss +32 -0
- package/styles/qppds/utilities/_display-visibility.scss +83 -0
- package/styles/qppds/utilities/_flexbox.scss +240 -0
- package/styles/qppds/utilities/_font-family.scss +9 -0
- package/styles/qppds/utilities/_font-size.scss +8 -0
- package/styles/qppds/utilities/_font-weight.scss +8 -0
- package/styles/qppds/utilities/_height.scss +38 -0
- package/styles/qppds/utilities/_margin.scss +136 -0
- package/styles/qppds/utilities/_padding.scss +76 -0
- package/styles/qppds/utilities/_position.scss +24 -0
- package/styles/qppds/utilities/_text-align.scss +40 -0
- package/styles/qppds/utilities/_text-transform.scss +7 -0
- package/styles/qppds/utilities/_truncate.scss +8 -0
- package/styles/qppds/utilities/_width.scss +79 -0
- package/styles/qppds/utilities/index.scss +15 -0
- package/styles/qppds.scss +2 -0
- package/styles/third-party/_legacy-bootstrap.scss +19 -0
- package/styles/third-party/legacy-bootstrap/_buttons.scss +126 -0
- package/styles/third-party/legacy-bootstrap/_dropdowns.scss +211 -0
- package/styles/third-party/legacy-bootstrap/_forms.scss +510 -0
- package/styles/third-party/legacy-bootstrap/_grid.scss +73 -0
- package/styles/third-party/legacy-bootstrap/_mixins.scss +27 -0
- package/styles/third-party/legacy-bootstrap/_navbar.scss +644 -0
- package/styles/third-party/legacy-bootstrap/_navs.scss +193 -0
- package/styles/third-party/legacy-bootstrap/_normalize.scss +385 -0
- package/styles/third-party/legacy-bootstrap/_scaffolding.scss +116 -0
- package/styles/third-party/legacy-bootstrap/_variables.scss +858 -0
- package/styles/third-party/legacy-bootstrap/mixins/_buttons.scss +70 -0
- package/styles/third-party/legacy-bootstrap/mixins/_clearfix.scss +22 -0
- package/styles/third-party/legacy-bootstrap/mixins/_forms.scss +108 -0
- package/styles/third-party/legacy-bootstrap/mixins/_grid-framework.scss +86 -0
- package/styles/third-party/legacy-bootstrap/mixins/_grid.scss +112 -0
- package/styles/third-party/legacy-bootstrap/mixins/_labels.scss +12 -0
- package/styles/third-party/legacy-bootstrap/mixins/_nav-divider.scss +10 -0
- package/styles/third-party/legacy-bootstrap/mixins/_nav-vertical-align.scss +9 -0
- package/styles/third-party/legacy-bootstrap/mixins/_opacity.scss +7 -0
- package/styles/third-party/legacy-bootstrap/mixins/_panels.scss +30 -0
- package/styles/third-party/legacy-bootstrap/mixins/_reset-filter.scss +7 -0
- package/styles/third-party/legacy-bootstrap/mixins/_reset-text.scss +18 -0
- package/styles/third-party/legacy-bootstrap/mixins/_resize.scss +6 -0
- package/styles/third-party/legacy-bootstrap/mixins/_responsive-visibility.scss +25 -0
- package/styles/third-party/legacy-bootstrap/mixins/_size.scss +10 -0
- package/styles/third-party/legacy-bootstrap/mixins/_tab-focus.scss +9 -0
- package/styles/third-party/legacy-bootstrap/mixins/_table-row.scss +28 -0
- package/styles/third-party/legacy-bootstrap/mixins/_text-emphasis.scss +12 -0
- package/styles/third-party/legacy-bootstrap/mixins/_text-overflow.scss +8 -0
- package/styles/third-party/legacy-bootstrap/mixins/_vendor-prefixes.scss +182 -0
- package/styles/utility/_mixins.scss +46 -0
- package/styles/utility/_utilities.scss +73 -0
- package/test/components/Accordion.test.js +12 -0
- package/test/components/ErrorUI.test.js +33 -0
- package/test/components/FooterUI.test.js +90 -0
- package/test/components/HeaderUI.test.js +45 -0
- package/test/components/Infotip.test.js +73 -0
- package/test/components/SessionDialogUI.test.js +339 -0
- package/test/components/SideNavUI.test.js +23 -0
- package/test/components/Tooltip.test.js +147 -0
- package/test/index.test.js +8 -0
- package/test/session/session.test.js +221 -0
- package/test-setup.js +9 -0
- package/webpack.config.js +147 -0
- package/webpack.config.react.js +86 -0
|
@@ -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,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
const VARIANTS = ['secondary', 'outline', 'danger', 'white'];
|
|
5
|
+
const SIZES = ['big'];
|
|
6
|
+
|
|
7
|
+
const Button = ({
|
|
8
|
+
children,
|
|
9
|
+
className,
|
|
10
|
+
href,
|
|
11
|
+
loading,
|
|
12
|
+
onClick,
|
|
13
|
+
size,
|
|
14
|
+
variant,
|
|
15
|
+
type,
|
|
16
|
+
...rest
|
|
17
|
+
}) => {
|
|
18
|
+
let btnClass = 'qpp-c-button';
|
|
19
|
+
|
|
20
|
+
if (VARIANTS.includes(variant)) {
|
|
21
|
+
btnClass = btnClass.concat(' ', `qpp-c-button--${variant}`);
|
|
22
|
+
}
|
|
23
|
+
if (SIZES.includes(size)) {
|
|
24
|
+
btnClass = btnClass.concat(' ', `qpp-c-button--${size}`);
|
|
25
|
+
}
|
|
26
|
+
if (className) {
|
|
27
|
+
btnClass = btnClass.concat(' ', className);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (href) {
|
|
31
|
+
return (
|
|
32
|
+
<a
|
|
33
|
+
href={href}
|
|
34
|
+
data-testid="ds-btn"
|
|
35
|
+
className={btnClass || ''}
|
|
36
|
+
onClick={onClick}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</a>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return (
|
|
43
|
+
<button
|
|
44
|
+
data-testid="ds-btn"
|
|
45
|
+
className={btnClass || ''}
|
|
46
|
+
onClick={onClick}
|
|
47
|
+
disabled={loading}
|
|
48
|
+
type={type}
|
|
49
|
+
{...rest}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</button>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
Button.propTypes = {
|
|
57
|
+
children: PropTypes.node,
|
|
58
|
+
className: PropTypes.string,
|
|
59
|
+
href: PropTypes.string,
|
|
60
|
+
loading: PropTypes.bool,
|
|
61
|
+
onClick: PropTypes.func,
|
|
62
|
+
size: PropTypes.oneOf(SIZES),
|
|
63
|
+
type: PropTypes.string,
|
|
64
|
+
variant: PropTypes.oneOf(VARIANTS),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
Button.defaultProps = {
|
|
68
|
+
children: false,
|
|
69
|
+
className: '',
|
|
70
|
+
href: '',
|
|
71
|
+
loading: false,
|
|
72
|
+
onClick: () => null,
|
|
73
|
+
size: null,
|
|
74
|
+
type: 'button',
|
|
75
|
+
variant: null,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const TextButton = ({ className = '', ...props }) => (
|
|
79
|
+
<Button className={`qpp-c-button--text ${className}`} {...props} />
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
TextButton.propTypes = {
|
|
83
|
+
className: PropTypes.string,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
TextButton.defaultProps = {
|
|
87
|
+
className: '',
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default 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,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import FeatherIcon from 'feather-icons-react';
|
|
4
|
+
|
|
5
|
+
import Button from '../Button';
|
|
6
|
+
|
|
7
|
+
const getCtaButton = (button) => {
|
|
8
|
+
if (button) {
|
|
9
|
+
if (React.isValidElement(button)) {
|
|
10
|
+
return button;
|
|
11
|
+
}
|
|
12
|
+
if (button.href) {
|
|
13
|
+
const { href, text, ...restLink } = button;
|
|
14
|
+
return (
|
|
15
|
+
<a
|
|
16
|
+
className="qpp-c-button qpp-c-button--secondary qpp-c-button--icon-after"
|
|
17
|
+
href={href}
|
|
18
|
+
{...restLink}
|
|
19
|
+
>
|
|
20
|
+
{text}
|
|
21
|
+
<FeatherIcon icon="chevron-right" />
|
|
22
|
+
</a>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
const { onClick, text, ...restButton } = button;
|
|
26
|
+
return (
|
|
27
|
+
<Button
|
|
28
|
+
variant="secondary"
|
|
29
|
+
className="qpp-c-button--icon-after"
|
|
30
|
+
onClick={onClick}
|
|
31
|
+
{...restButton}
|
|
32
|
+
>
|
|
33
|
+
{text}
|
|
34
|
+
<FeatherIcon icon="chevron-right" />
|
|
35
|
+
</Button>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const CalloutBox = ({
|
|
42
|
+
title,
|
|
43
|
+
description,
|
|
44
|
+
button,
|
|
45
|
+
input,
|
|
46
|
+
children,
|
|
47
|
+
headerLevel,
|
|
48
|
+
}) => {
|
|
49
|
+
const Header = `h${headerLevel}`;
|
|
50
|
+
return (
|
|
51
|
+
<aside className="qppds qpp-u-sm-padding--32 qpp-u-padding--24 qpp-u-fill--blue-70">
|
|
52
|
+
{title && (
|
|
53
|
+
<Header className="qpp-u-font-size--24 qpp-u-color--white qpp-u-margin-bottom--16 qpp-u-margin-top--0 qpp-u-font-weight--regular">
|
|
54
|
+
{title}
|
|
55
|
+
</Header>
|
|
56
|
+
)}
|
|
57
|
+
{description && (
|
|
58
|
+
<p className="qpp-u-color--white qpp-u-margin-bottom--0 qpp-u-font-size--18">
|
|
59
|
+
{description}
|
|
60
|
+
</p>
|
|
61
|
+
)}
|
|
62
|
+
{children && (
|
|
63
|
+
<div className="qpp-u-color--white qpp-u-margin-bottom--0 qpp-u-font-size--18">
|
|
64
|
+
{children}
|
|
65
|
+
</div>
|
|
66
|
+
)}
|
|
67
|
+
{(input || button) && (
|
|
68
|
+
<div className="qpp-u-display--flex qpp-u-align-items--center qpp-u-flex-wrap--wrap qpp-u-margin-top--24">
|
|
69
|
+
{input && (
|
|
70
|
+
<input
|
|
71
|
+
className="qpp-c-text-input qpp-u-sm-margin-right--16 qpp-u-margin-bottom--16 qpp-u-sm-margin-bottom--0 qpp-u-sm-width--auto qpp-u-width--100"
|
|
72
|
+
type="text"
|
|
73
|
+
{...input}
|
|
74
|
+
/>
|
|
75
|
+
)}
|
|
76
|
+
{getCtaButton(button)}
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
79
|
+
</aside>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
CalloutBox.propTypes = {
|
|
84
|
+
title: PropTypes.string,
|
|
85
|
+
description: PropTypes.string,
|
|
86
|
+
button: PropTypes.shape({
|
|
87
|
+
text: PropTypes.string,
|
|
88
|
+
onClick: PropTypes.func,
|
|
89
|
+
href: PropTypes.string,
|
|
90
|
+
}),
|
|
91
|
+
input: PropTypes.shape({
|
|
92
|
+
value: PropTypes.string,
|
|
93
|
+
name: PropTypes.string,
|
|
94
|
+
id: PropTypes.string,
|
|
95
|
+
}),
|
|
96
|
+
children: PropTypes.node,
|
|
97
|
+
headerLevel: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
CalloutBox.defaultProps = {
|
|
101
|
+
title: null,
|
|
102
|
+
description: null,
|
|
103
|
+
button: null,
|
|
104
|
+
input: null,
|
|
105
|
+
children: null,
|
|
106
|
+
headerLevel: 2,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default CalloutBox;
|
|
@@ -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
|
+
);
|