@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,111 @@
|
|
|
1
|
+
# Header Component
|
|
2
|
+
|
|
3
|
+
## Config
|
|
4
|
+
|
|
5
|
+
To populate the header's content, a `content` prop must provided. If one is not provided, the component will use `default-content.json`. The `content` prop is expected to be an array of objects where each object represents one of the header items (i.e. "About", "MIPs", etc.).
|
|
6
|
+
|
|
7
|
+
Here is an example content structure:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
"name": "About",
|
|
13
|
+
"subtitle": "Quality Payment Program",
|
|
14
|
+
"href": "/about"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Resources",
|
|
18
|
+
"subtitle": "Help, Support and Resources",
|
|
19
|
+
"columns": [
|
|
20
|
+
[
|
|
21
|
+
{
|
|
22
|
+
"heading": "Resource column 1",
|
|
23
|
+
"items": [
|
|
24
|
+
{
|
|
25
|
+
"name": "Timeline and Important Deadlines",
|
|
26
|
+
"type": "link",
|
|
27
|
+
"href": "/"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
{
|
|
34
|
+
"heading": "Resource column 2",
|
|
35
|
+
"items": [
|
|
36
|
+
{
|
|
37
|
+
"name": "Help and Support",
|
|
38
|
+
"type": "link",
|
|
39
|
+
"href": "/"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Header Items
|
|
50
|
+
|
|
51
|
+
Each of these objects represent an item in the header. These can be plain links or buttons that trigger a dropdown menu. If an `href` is provided instead of `columns`, the header item will be a link -- and vice versa.
|
|
52
|
+
|
|
53
|
+
| Property name | Type | Required | Description |
|
|
54
|
+
| ------------- | -------- | -------- | ------------------------------------------------------- |
|
|
55
|
+
| `name` | `String` | `true` | Name shown for the header link |
|
|
56
|
+
| `subtitle` | `String` | `true` | Text shown underneath the `name` |
|
|
57
|
+
| `href` | `String` | `false` | URL link path if the header item is not a dropdown menu |
|
|
58
|
+
| `columns` | `Array` | `false` | Columns in the dropdown menu |
|
|
59
|
+
|
|
60
|
+
### Menu Sections
|
|
61
|
+
|
|
62
|
+
Each of these objects represent a section within a column in a header item menu.
|
|
63
|
+
|
|
64
|
+
| Property name | Type | Required | Description |
|
|
65
|
+
| ------------- | -------- | -------- | ------------------------------------ |
|
|
66
|
+
| `heading` | `String` | `false` | Title for link section |
|
|
67
|
+
| `items` | `Array` | `true` | Each link/section in the header menu |
|
|
68
|
+
|
|
69
|
+
### Menu Items
|
|
70
|
+
|
|
71
|
+
Each of these objects represent a link within a header item menu.
|
|
72
|
+
|
|
73
|
+
| Property name | Type | Required | Default | Description |
|
|
74
|
+
| ------------- | -------- | -------- | -------- | ---------------------------------------------------------- |
|
|
75
|
+
| `name` | `String` | `true` | N/A | Name shown for the header link |
|
|
76
|
+
| `href` | `String` | `true` | N/A | URL link path |
|
|
77
|
+
| `type` | `String` | `false` | `'link'` | URL link type. Can be `'link'`, `'button'`, or `'sublink'` |
|
|
78
|
+
|
|
79
|
+
- `'link'`: Normal `<a>` tag link
|
|
80
|
+
- `'button'`: Outline button
|
|
81
|
+
- `'sublink'`: `<li>` link
|
|
82
|
+
|
|
83
|
+
## Cookies
|
|
84
|
+
|
|
85
|
+
When a user succesfully logs into QPP the user will receive the following
|
|
86
|
+
cookies.
|
|
87
|
+
| Cookie | Description |
|
|
88
|
+
|-------------------------------------|--------------------------------------|
|
|
89
|
+
| qpp_auth_token | auth token |
|
|
90
|
+
| qpp_has_authorizations | user has authorizations |
|
|
91
|
+
| qpp_has_non_registry_authorizations | user has non registry authorizations |
|
|
92
|
+
|
|
93
|
+
## Authenticated Links
|
|
94
|
+
|
|
95
|
+
| Link | Cookie | Property |
|
|
96
|
+
| ---------------------------- | ---------------------------------------- | --------------------------------- |
|
|
97
|
+
| Account Home | qpp_auth_token present | |
|
|
98
|
+
| Eligibility & Reporting | qpp_has_authorizations=true | |
|
|
99
|
+
| Performance Feedback | qpp_has_authorizations=true | |
|
|
100
|
+
| Doctors & Clinicians Preview | qpp_has_non_registry_authorizations=true | showPhysicianCompareLink=true |
|
|
101
|
+
| Facility Based Preview | qpp_has_authorizations=true | showFacilityBasedPreviewLink=true |
|
|
102
|
+
| Manage Access | qpp_auth_token present | |
|
|
103
|
+
| Sign Out | qpp_auth_token present | |
|
|
104
|
+
|
|
105
|
+
## Review Claims-based Submission Link
|
|
106
|
+
|
|
107
|
+
Review Claims-based Submission link has been deleted
|
|
108
|
+
|
|
109
|
+
## Dev Pre Environment
|
|
110
|
+
|
|
111
|
+
When the application is in Dev Pre mode the Header only has the Sign Out link.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Header from './HeaderUI';
|
|
3
|
+
import { withKnobs, boolean, text, number } from '@storybook/addon-knobs';
|
|
4
|
+
import { action } from '@storybook/addon-actions';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Header',
|
|
8
|
+
component: Header,
|
|
9
|
+
decorators: [withKnobs],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Example = () => (
|
|
13
|
+
<div id="qpp-nav-header">
|
|
14
|
+
<Header
|
|
15
|
+
isLoginEnabled={boolean('isLoginEnabled', true)}
|
|
16
|
+
skipToContentId={text('skipToContentId', '')}
|
|
17
|
+
includeSkipToSidebar={boolean('includeSkipToSidebar', false)}
|
|
18
|
+
showFacilityBasedPreviewLink={boolean(
|
|
19
|
+
'showFacilityBasedPreviewLink',
|
|
20
|
+
false
|
|
21
|
+
)}
|
|
22
|
+
showCancelButton={boolean('showCancelButton', false)}
|
|
23
|
+
handleCancel={action('handleCancel')}
|
|
24
|
+
showPhysicianCompareLink={boolean('showPhysicianCompareLink', false)}
|
|
25
|
+
performanceYear={number('performanceYear', 2019)}
|
|
26
|
+
feedbackPerformanceYear={text('feedbackPerformanceYear', '')}
|
|
27
|
+
fbpPerformanceYear={text('fbpPerformanceYear', '')}
|
|
28
|
+
showCovidLink={boolean('showCovidLink', false)}
|
|
29
|
+
isDevPre={boolean('isDevPre', false)}
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import cookie from 'cookie';
|
|
4
|
+
import jwtDecode from 'jwt-decode';
|
|
5
|
+
|
|
6
|
+
import { useHeaderState } from './hooks';
|
|
7
|
+
import { setUtagLink } from './utag-helpers';
|
|
8
|
+
import SessionDialogUI from '../SessionDialogUI';
|
|
9
|
+
import {
|
|
10
|
+
performanceFeedbackUrl,
|
|
11
|
+
physicianCompareUrl,
|
|
12
|
+
dashboardUrl,
|
|
13
|
+
manageUrl,
|
|
14
|
+
submissionsUrl,
|
|
15
|
+
facilityBasedPreviewUrl,
|
|
16
|
+
} from '../SideNav/helpers';
|
|
17
|
+
import HeaderMenuItem from './HeaderMenuItem';
|
|
18
|
+
|
|
19
|
+
const HeaderAccountMenu = ({
|
|
20
|
+
handleClick,
|
|
21
|
+
fbpPerformanceYear,
|
|
22
|
+
feedbackPerformanceYear,
|
|
23
|
+
isLoginEnabled,
|
|
24
|
+
isDevPre,
|
|
25
|
+
performanceYear,
|
|
26
|
+
showFacilityBasedPreviewLink,
|
|
27
|
+
showPhysicianCompareLink,
|
|
28
|
+
}) => {
|
|
29
|
+
const cookies = cookie.parse(document.cookie);
|
|
30
|
+
const hasAuthToken = cookies.hasOwnProperty('qpp_auth_token');
|
|
31
|
+
const hasAuthorizations = cookies.qpp_has_authorizations === 'true';
|
|
32
|
+
const hasNonRegistryAuthorizations =
|
|
33
|
+
cookies.qpp_has_non_registry_authorizations === 'true';
|
|
34
|
+
const isDevPreAndNotAuthenticated = !hasAuthToken && isDevPre;
|
|
35
|
+
const { closeMenus, RouterLink } = useHeaderState();
|
|
36
|
+
|
|
37
|
+
if (!isLoginEnabled || isDevPreAndNotAuthenticated) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// login link
|
|
42
|
+
if (!hasAuthToken) {
|
|
43
|
+
if (RouterLink) {
|
|
44
|
+
return (
|
|
45
|
+
<li onClick={handleClick} className="header-item-login login">
|
|
46
|
+
<RouterLink
|
|
47
|
+
className="menu-link"
|
|
48
|
+
to="/login"
|
|
49
|
+
onClick={() => {
|
|
50
|
+
closeMenus();
|
|
51
|
+
setUtagLink('main navbar', 'click', '/login');
|
|
52
|
+
}}
|
|
53
|
+
data-track-category="TopNav"
|
|
54
|
+
data-track-action="click"
|
|
55
|
+
data-track-label="Sign In"
|
|
56
|
+
>
|
|
57
|
+
<div className="nav-title">Sign In</div>
|
|
58
|
+
<div className="nav-description">
|
|
59
|
+
Manage Account <br />
|
|
60
|
+
and Register
|
|
61
|
+
</div>
|
|
62
|
+
</RouterLink>
|
|
63
|
+
</li>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return (
|
|
67
|
+
<li className="header-item-login login">
|
|
68
|
+
<a
|
|
69
|
+
className="menu-link"
|
|
70
|
+
href="/login"
|
|
71
|
+
data-track-category="TopNav"
|
|
72
|
+
data-track-action="click"
|
|
73
|
+
data-track-label="Sign In"
|
|
74
|
+
onClick={() => {
|
|
75
|
+
setUtagLink('main navbar', 'click', '/login');
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<div className="nav-title">Sign In</div>
|
|
79
|
+
<div className="nav-description">
|
|
80
|
+
Manage Account <br />
|
|
81
|
+
and Register
|
|
82
|
+
</div>
|
|
83
|
+
</a>
|
|
84
|
+
</li>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (hasAuthToken) {
|
|
89
|
+
const { firstName } = jwtDecode(cookies.qpp_auth_token);
|
|
90
|
+
const additionalLinks = [];
|
|
91
|
+
if (hasAuthorizations) {
|
|
92
|
+
additionalLinks.push(
|
|
93
|
+
{ type: 'link', href: dashboardUrl, name: 'Eligibility & Reporting' },
|
|
94
|
+
{
|
|
95
|
+
type: 'link',
|
|
96
|
+
href: performanceFeedbackUrl(
|
|
97
|
+
feedbackPerformanceYear || performanceYear
|
|
98
|
+
),
|
|
99
|
+
name: 'Performance Feedback',
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
if (showPhysicianCompareLink && hasNonRegistryAuthorizations) {
|
|
103
|
+
additionalLinks.push({
|
|
104
|
+
type: 'link',
|
|
105
|
+
href: physicianCompareUrl,
|
|
106
|
+
name: 'Doctors & Clinicians Preview',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (showFacilityBasedPreviewLink) {
|
|
110
|
+
additionalLinks.push({
|
|
111
|
+
type: 'link',
|
|
112
|
+
href: facilityBasedPreviewUrl(fbpPerformanceYear || performanceYear),
|
|
113
|
+
name: 'Facility Based Preview',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const columns = [
|
|
118
|
+
[
|
|
119
|
+
{
|
|
120
|
+
items: [
|
|
121
|
+
{ type: 'link', href: submissionsUrl, name: 'Account Home' },
|
|
122
|
+
...additionalLinks,
|
|
123
|
+
{ type: 'link', href: manageUrl, name: 'Manage Access' },
|
|
124
|
+
{ type: 'signout', name: 'Sign Out' },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
];
|
|
129
|
+
const devPreColumns = [
|
|
130
|
+
[{ items: [{ type: 'signout', name: 'Sign Out' }] }],
|
|
131
|
+
];
|
|
132
|
+
return (
|
|
133
|
+
<>
|
|
134
|
+
<SessionDialogUI />
|
|
135
|
+
<HeaderMenuItem
|
|
136
|
+
hasMenu
|
|
137
|
+
menuName="Login"
|
|
138
|
+
name={firstName}
|
|
139
|
+
subtitle="My Account"
|
|
140
|
+
className="account-menu-item"
|
|
141
|
+
columns={isDevPre ? devPreColumns : columns}
|
|
142
|
+
rows={isDevPre ? devPreColumns : columns}
|
|
143
|
+
/>
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
HeaderAccountMenu.propTypes = {
|
|
150
|
+
isLoginEnabled: PropTypes.bool.isRequired,
|
|
151
|
+
showPhysicianCompareLink: PropTypes.bool,
|
|
152
|
+
showFacilityBasedPreviewLink: PropTypes.bool,
|
|
153
|
+
performanceYear: PropTypes.number,
|
|
154
|
+
fbpPerformanceYear: PropTypes.string,
|
|
155
|
+
feedbackPerformanceYear: PropTypes.string,
|
|
156
|
+
isDevPre: PropTypes.bool,
|
|
157
|
+
handleClick: PropTypes.func.isRequired,
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
HeaderAccountMenu.defaultProps = {
|
|
161
|
+
showPhysicianCompareLink: false,
|
|
162
|
+
showFacilityBasedPreviewLink: false,
|
|
163
|
+
performanceYear: 2017,
|
|
164
|
+
fbpPerformanceYear: null,
|
|
165
|
+
feedbackPerformanceYear: null,
|
|
166
|
+
isDevPre: false,
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export default HeaderAccountMenu;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
const HeaderCancel = ({ handleCancel }) => {
|
|
5
|
+
return (
|
|
6
|
+
<button className="header-cancel" onClick={handleCancel}>
|
|
7
|
+
Cancel
|
|
8
|
+
</button>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
HeaderCancel.propTypes = {
|
|
13
|
+
handleCancel: PropTypes.func,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default HeaderCancel;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import HeaderLogo from './HeaderLogo';
|
|
5
|
+
import NotificationBanner from '../NotificationBanner';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Accessibility enhancement that moves focus to an element for "Skip" links
|
|
9
|
+
* @param {Object} e - The native JS event
|
|
10
|
+
* @param {String} id - The HTML ID of the element to be focused
|
|
11
|
+
*/
|
|
12
|
+
function jumpToLink(e, id) {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
document.getElementById(id).focus();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const HeaderContainer = ({
|
|
18
|
+
children,
|
|
19
|
+
includeSkipToSidebar,
|
|
20
|
+
showCancelButton,
|
|
21
|
+
skipToContentId,
|
|
22
|
+
isIESupportPage,
|
|
23
|
+
}) => (
|
|
24
|
+
<>
|
|
25
|
+
<a
|
|
26
|
+
className="skip"
|
|
27
|
+
onClick={(e) => jumpToLink(e, `${skipToContentId || 'mainContent'}`)}
|
|
28
|
+
href={`#${skipToContentId || 'mainContent'}`}
|
|
29
|
+
>
|
|
30
|
+
Skip to content
|
|
31
|
+
</a>
|
|
32
|
+
{includeSkipToSidebar && (
|
|
33
|
+
<a
|
|
34
|
+
className="skip"
|
|
35
|
+
onClick={(e) => jumpToLink(e, 'qppSidebar')}
|
|
36
|
+
href="#qppSidebar"
|
|
37
|
+
>
|
|
38
|
+
Skip to sidebar
|
|
39
|
+
</a>
|
|
40
|
+
)}
|
|
41
|
+
{!isIESupportPage && <NotificationBanner />}
|
|
42
|
+
<header id="top" className={showCancelButton ? 'show-cancel-button' : ''}>
|
|
43
|
+
<HeaderLogo />
|
|
44
|
+
{children}
|
|
45
|
+
</header>
|
|
46
|
+
</>
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
HeaderContainer.propTypes = {
|
|
50
|
+
children: PropTypes.node.isRequired,
|
|
51
|
+
includeSkipToSidebar: PropTypes.bool,
|
|
52
|
+
showCancelButton: PropTypes.bool,
|
|
53
|
+
skipToContentId: PropTypes.string,
|
|
54
|
+
isIESupportPage: PropTypes.bool,
|
|
55
|
+
};
|
|
56
|
+
HeaderContainer.defaultProps = {
|
|
57
|
+
includeSkipToSidebar: false,
|
|
58
|
+
showCancelButton: false,
|
|
59
|
+
skipToContentId: null,
|
|
60
|
+
isIESupportPage: false,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default HeaderContainer;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useHeaderState } from './hooks';
|
|
4
|
+
|
|
5
|
+
const HeaderLogo = () => {
|
|
6
|
+
const { closeMenus, RouterLink } = useHeaderState();
|
|
7
|
+
if (RouterLink) {
|
|
8
|
+
return (
|
|
9
|
+
<RouterLink
|
|
10
|
+
className="header-logo"
|
|
11
|
+
to="/"
|
|
12
|
+
onClick={closeMenus}
|
|
13
|
+
data-track-category="HeaderNav"
|
|
14
|
+
data-track-action="OpenQPPHome"
|
|
15
|
+
data-track-label="Quality Payment Program"
|
|
16
|
+
>
|
|
17
|
+
<img
|
|
18
|
+
className="qpp-logo"
|
|
19
|
+
src="/images/qpp_logo_rgb_color.png"
|
|
20
|
+
alt="QPP logo"
|
|
21
|
+
/>
|
|
22
|
+
</RouterLink>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return (
|
|
26
|
+
<a
|
|
27
|
+
className="header-logo"
|
|
28
|
+
href="/"
|
|
29
|
+
data-track-category="HeaderNav"
|
|
30
|
+
data-track-action="OpenQPPHome"
|
|
31
|
+
data-track-label="Quality Payment Program"
|
|
32
|
+
>
|
|
33
|
+
<img
|
|
34
|
+
className="qpp-logo"
|
|
35
|
+
src="/images/qpp_logo_rgb_color.png"
|
|
36
|
+
alt="QPP logo"
|
|
37
|
+
/>
|
|
38
|
+
</a>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default HeaderLogo;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import { useHeaderState } from './hooks';
|
|
5
|
+
import NavigationButtonIcon from './NavigationButtonIcon';
|
|
6
|
+
import { setUtagLink } from './utag-helpers';
|
|
7
|
+
|
|
8
|
+
const HeaderMenuButton = ({ href, name }) => {
|
|
9
|
+
const { RouterLink, closeMenus } = useHeaderState();
|
|
10
|
+
if (RouterLink) {
|
|
11
|
+
return (
|
|
12
|
+
<RouterLink
|
|
13
|
+
className="btn btn-navigation inverse-hover header-menu-btn"
|
|
14
|
+
to={href}
|
|
15
|
+
onClick={() => {
|
|
16
|
+
closeMenus();
|
|
17
|
+
setUtagLink('main navbar', 'click', href);
|
|
18
|
+
}}
|
|
19
|
+
data-track-category="TopNav"
|
|
20
|
+
data-track-action="click"
|
|
21
|
+
data-track-label={name}
|
|
22
|
+
>
|
|
23
|
+
{name}
|
|
24
|
+
<NavigationButtonIcon />
|
|
25
|
+
</RouterLink>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return (
|
|
29
|
+
<a
|
|
30
|
+
className="btn btn-navigation inverse-hover header-menu-btn"
|
|
31
|
+
href={href}
|
|
32
|
+
data-track-category="TopNav"
|
|
33
|
+
data-track-action="click"
|
|
34
|
+
data-track-label={name}
|
|
35
|
+
onClick={() => {
|
|
36
|
+
setUtagLink('main navbar', 'click', href);
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
{name}
|
|
40
|
+
<NavigationButtonIcon />
|
|
41
|
+
</a>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
HeaderMenuButton.propTypes = {
|
|
46
|
+
href: PropTypes.string.isRequired,
|
|
47
|
+
name: PropTypes.string.isRequired,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default HeaderMenuButton;
|