@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.
Files changed (316) hide show
  1. package/.babelrc +10 -0
  2. package/.editorconfig +22 -0
  3. package/.eslintignore +5 -0
  4. package/.eslintrc.js +31 -0
  5. package/.storybook/.babelrc +4 -0
  6. package/.storybook/main.js +89 -0
  7. package/.storybook/preview-head.html +9 -0
  8. package/.storybook/preview.js +5 -0
  9. package/README.md +5 -0
  10. package/components/Accordion/Accordion.stories.js +20 -0
  11. package/components/Accordion/index.jsx +93 -0
  12. package/components/Alert/Alert.stories.js +61 -0
  13. package/components/Alert/index.js +46 -0
  14. package/components/Breadcrumb/Breadcrumb.md +28 -0
  15. package/components/Breadcrumb/Breadcrumb.stories.js +76 -0
  16. package/components/Breadcrumb/index.js +83 -0
  17. package/components/Button/Button.stories.js +121 -0
  18. package/components/Button/index.js +90 -0
  19. package/components/CalloutBox/CalloutBox.stories.js +94 -0
  20. package/components/CalloutBox/index.js +109 -0
  21. package/components/Card/Card.stories.js +163 -0
  22. package/components/Card/index.js +137 -0
  23. package/components/Dropdown/Dropdown.stories.js +94 -0
  24. package/components/Dropdown/index.js +85 -0
  25. package/components/Error/Collapsible.jsx +88 -0
  26. package/components/Error/ErrorUI.jsx +31 -0
  27. package/components/Error/error.js +26 -0
  28. package/components/FlashNotification/FlashNotificationUI.jsx +91 -0
  29. package/components/FlashNotification/index.js +30 -0
  30. package/components/Footer/Footer.stories.js +20 -0
  31. package/components/Footer/FooterUI.jsx +269 -0
  32. package/components/Footer/LegacyFooterUI.jsx +194 -0
  33. package/components/Footer/SocialLinks.jsx +60 -0
  34. package/components/Footer/Subscribe.jsx +34 -0
  35. package/components/Footer/footer.js +30 -0
  36. package/components/Header/Header.md +111 -0
  37. package/components/Header/Header.stories.js +32 -0
  38. package/components/Header/HeaderAccountMenu.jsx +169 -0
  39. package/components/Header/HeaderCancel.jsx +16 -0
  40. package/components/Header/HeaderContainer.jsx +63 -0
  41. package/components/Header/HeaderLogo.jsx +42 -0
  42. package/components/Header/HeaderMenuButton.js +50 -0
  43. package/components/Header/HeaderMenuItem.jsx +232 -0
  44. package/components/Header/HeaderMenuLink.js +50 -0
  45. package/components/Header/HeaderMenuSignOutButton.js +62 -0
  46. package/components/Header/HeaderMobileButton.js +37 -0
  47. package/components/Header/HeaderUI.jsx +167 -0
  48. package/components/Header/HelpIcon.jsx +32 -0
  49. package/components/Header/ImpersonatorBanner.jsx +57 -0
  50. package/components/Header/NavigationButtonIcon.jsx +27 -0
  51. package/components/Header/default-content.json +280 -0
  52. package/components/Header/header.js +40 -0
  53. package/components/Header/hooks.js +52 -0
  54. package/components/Header/utag-helpers.js +9 -0
  55. package/components/Infotip/Infotip.jsx +75 -0
  56. package/components/Infotip/Infotip.stories.js +50 -0
  57. package/components/Infotip/InfotipIcon.jsx +41 -0
  58. package/components/Infotip/index.js +3 -0
  59. package/components/Link/Link.stories.js +81 -0
  60. package/components/Link/index.js +61 -0
  61. package/components/Modal/LegacyModal.jsx +72 -0
  62. package/components/Modal/Modal.jsx +140 -0
  63. package/components/Modal/Modal.stories.js +159 -0
  64. package/components/Modal/index.jsx +22 -0
  65. package/components/NotificationBanner/NotificationBanner.stories.js +23 -0
  66. package/components/NotificationBanner/index.js +265 -0
  67. package/components/SanitizedContent/index.jsx +200 -0
  68. package/components/Search/Search.stories.js +21 -0
  69. package/components/Search/index.js +85 -0
  70. package/components/SessionDialog/sessionDialog.js +26 -0
  71. package/components/SessionDialogUI.jsx +261 -0
  72. package/components/SideNav/AnimationGroup/AnimationGroup.jsx +27 -0
  73. package/components/SideNav/Chart/ScoreChart.jsx +268 -0
  74. package/components/SideNav/Chart/__tests__/ScoreChart.test.js +22 -0
  75. package/components/SideNav/Chart/__tests__/__snapshots__/ScoreChart.test.js.snap +173 -0
  76. package/components/SideNav/Chart/index.js +3 -0
  77. package/components/SideNav/Content/LevelOneContent.jsx +208 -0
  78. package/components/SideNav/Content/LevelTwoContent.jsx +216 -0
  79. package/components/SideNav/Content/index.js +4 -0
  80. package/components/SideNav/Details/IndividualDetails.jsx +18 -0
  81. package/components/SideNav/Details/PracticeDetails.jsx +45 -0
  82. package/components/SideNav/Details/index.js +4 -0
  83. package/components/SideNav/Links/CmsSwitchLink.jsx +41 -0
  84. package/components/SideNav/Links/NavItemInline.jsx +54 -0
  85. package/components/SideNav/Links/NavLinkContainer.jsx +38 -0
  86. package/components/SideNav/Links/NavLinkDrawer.jsx +249 -0
  87. package/components/SideNav/Links/NavLinkInline.jsx +107 -0
  88. package/components/SideNav/Links/NavLinkToggle.jsx +34 -0
  89. package/components/SideNav/Links/index.js +13 -0
  90. package/components/SideNav/SideNav.md +50 -0
  91. package/components/SideNav/SideNav.stories.js +379 -0
  92. package/components/SideNav/UI/SideNavUI.jsx +333 -0
  93. package/components/SideNav/UI/default-content.json +99 -0
  94. package/components/SideNav/UI/index.js +3 -0
  95. package/components/SideNav/helpers.js +49 -0
  96. package/components/SideNav/index.js +53 -0
  97. package/components/Spinner/index.js +9 -0
  98. package/components/Tabs/Tab.js +26 -0
  99. package/components/Tabs/TabPanel.js +34 -0
  100. package/components/Tabs/Tabs.stories.js +120 -0
  101. package/components/Tabs/index.js +95 -0
  102. package/components/TextInput/TextInput.stories.js +118 -0
  103. package/components/TextInput/index.js +137 -0
  104. package/components/Tooltip/Tooltip.jsx +88 -0
  105. package/components/Tooltip/Tooltip.stories.js +80 -0
  106. package/components/Tooltip/index.js +3 -0
  107. package/components/Tooltip/position.js +68 -0
  108. package/components/UnwrappedSpinner/index.js +8 -0
  109. package/components/hooks/useGetConfig.js +74 -0
  110. package/components/index.js +126 -0
  111. package/dist/browser.js +3 -0
  112. package/dist/browser.js.LICENSE.txt +54 -0
  113. package/dist/browser.js.map +1 -0
  114. package/dist/index.js +3 -0
  115. package/dist/index.js.LICENSE.txt +54 -0
  116. package/dist/index.js.map +1 -0
  117. package/dist/react/index.js +3 -0
  118. package/dist/react/index.js.LICENSE.txt +71 -0
  119. package/dist/react/index.js.map +1 -0
  120. package/fonts/FontAwesome.otf +0 -0
  121. package/fonts/OFL.txt +92 -0
  122. package/fonts/Rubik-Black.ttf +0 -0
  123. package/fonts/Rubik-BlackItalic.ttf +0 -0
  124. package/fonts/Rubik-Bold.ttf +0 -0
  125. package/fonts/Rubik-BoldItalic.ttf +0 -0
  126. package/fonts/Rubik-Italic.ttf +0 -0
  127. package/fonts/Rubik-Light.ttf +0 -0
  128. package/fonts/Rubik-LightItalic.ttf +0 -0
  129. package/fonts/Rubik-Medium.ttf +0 -0
  130. package/fonts/Rubik-MediumItalic.ttf +0 -0
  131. package/fonts/Rubik-Regular.ttf +0 -0
  132. package/fonts/fontawesome-webfont.eot +0 -0
  133. package/fonts/fontawesome-webfont.svg +2671 -0
  134. package/fonts/fontawesome-webfont.ttf +0 -0
  135. package/fonts/fontawesome-webfont.woff +0 -0
  136. package/fonts/fontawesome-webfont.woff2 +0 -0
  137. package/images/favicon/android-chrome-192x192.png +0 -0
  138. package/images/favicon/android-chrome-256x256.png +0 -0
  139. package/images/favicon/apple-touch-icon.png +0 -0
  140. package/images/favicon/browserconfig.xml +9 -0
  141. package/images/favicon/favicon-16x16.png +0 -0
  142. package/images/favicon/favicon-32x32.png +0 -0
  143. package/images/favicon/favicon.ico +0 -0
  144. package/images/favicon/manifest.json +18 -0
  145. package/images/favicon/mstile-150x150.png +0 -0
  146. package/images/favicon/safari-pinned-tab.svg +32 -0
  147. package/images/hhs-logo-black.svg +10 -0
  148. package/images/hhs-logo-white.svg +10 -0
  149. package/images/icons/close-x.svg +6 -0
  150. package/images/icons/help-headset.svg +21 -0
  151. package/images/icons/svg/arrow-down.svg +1 -0
  152. package/images/icons/svg/arrow-download.svg +1 -0
  153. package/images/icons/svg/arrow-right.svg +1 -0
  154. package/images/icons/svg/calendar.svg +1 -0
  155. package/images/icons/svg/close.svg +1 -0
  156. package/images/icons/svg/download.svg +1 -0
  157. package/images/icons/svg/external.svg +1 -0
  158. package/images/icons/svg/file-upload.svg +1 -0
  159. package/images/icons/svg/print.svg +1 -0
  160. package/images/icons/svg/search.svg +7 -0
  161. package/images/icons/svg/tooltip-question.svg +6 -0
  162. package/images/icons/svg/trash.svg +1 -0
  163. package/images/icons/svg/upload.svg +1 -0
  164. package/images/qpp_logo_reversed.png +0 -0
  165. package/images/qpp_logo_rgb_color.png +0 -0
  166. package/index.js +31 -0
  167. package/jest/mediaFileTransformer.js +9 -0
  168. package/jest.config.js +188 -0
  169. package/lib/Chevron.jsx +32 -0
  170. package/lib/SvgComponents.jsx +539 -0
  171. package/lib/svg-definitions.svg +125 -0
  172. package/package.json +125 -0
  173. package/session/index.js +5 -0
  174. package/session/logout.js +65 -0
  175. package/session/refresh.js +49 -0
  176. package/session/ttl.js +37 -0
  177. package/styles/_global.scss +106 -0
  178. package/styles/_main.scss +15 -0
  179. package/styles/_paths.scss +1 -0
  180. package/styles/_qpp-style.scss +31 -0
  181. package/styles/components/_accordion.scss +289 -0
  182. package/styles/components/_alerts.scss +54 -0
  183. package/styles/components/_autocomplete.scss +47 -0
  184. package/styles/components/_breadcrumbs.scss +64 -0
  185. package/styles/components/_buttons.scss +580 -0
  186. package/styles/components/_error-page.scss +56 -0
  187. package/styles/components/_flash-notification.scss +98 -0
  188. package/styles/components/_fonts.scss +42 -0
  189. package/styles/components/_forms.scss +277 -0
  190. package/styles/components/_grid.scss +37 -0
  191. package/styles/components/_info-modal.scss +139 -0
  192. package/styles/components/_links.scss +12 -0
  193. package/styles/components/_modals.scss +18 -0
  194. package/styles/components/_notification-banner.scss +165 -0
  195. package/styles/components/_panels.scss +61 -0
  196. package/styles/components/_pie-chart.scss +13 -0
  197. package/styles/components/_score-chart.scss +164 -0
  198. package/styles/components/_spinner.scss +7 -0
  199. package/styles/components/_tables.scss +111 -0
  200. package/styles/components/_tabs.scss +69 -0
  201. package/styles/components/_text.scss +150 -0
  202. package/styles/components/_toggles.scss +3 -0
  203. package/styles/components/_tooltip.scss +23 -0
  204. package/styles/components/_variables.scss +157 -0
  205. package/styles/components/_wells.scss +92 -0
  206. package/styles/qppds/README.md +0 -0
  207. package/styles/qppds/base/_backgrounds.scss +7 -0
  208. package/styles/qppds/base/_fonts.scss +26 -0
  209. package/styles/qppds/base/_icon.scss +23 -0
  210. package/styles/qppds/base/_layout.scss +5 -0
  211. package/styles/qppds/base/_typography.scss +85 -0
  212. package/styles/qppds/base/index.scss +8 -0
  213. package/styles/qppds/components/_alert.scss +95 -0
  214. package/styles/qppds/components/_breadcrumbs.scss +70 -0
  215. package/styles/qppds/components/_button.scss +292 -0
  216. package/styles/qppds/components/_card.scss +175 -0
  217. package/styles/qppds/components/_dropdown.scss +55 -0
  218. package/styles/qppds/components/_footer.scss +597 -0
  219. package/styles/qppds/components/_header.scss +892 -0
  220. package/styles/qppds/components/_link.scss +52 -0
  221. package/styles/qppds/components/_modal.scss +118 -0
  222. package/styles/qppds/components/_page-header.scss +67 -0
  223. package/styles/qppds/components/_pagination.scss +227 -0
  224. package/styles/qppds/components/_search.scss +112 -0
  225. package/styles/qppds/components/_sidebar.scss +9 -0
  226. package/styles/qppds/components/_table.scss +139 -0
  227. package/styles/qppds/components/_tabs.scss +197 -0
  228. package/styles/qppds/components/_text-input.scss +60 -0
  229. package/styles/qppds/components/index.scss +16 -0
  230. package/styles/qppds/components/sidebar/_animations.scss +38 -0
  231. package/styles/qppds/components/sidebar/_cms.scss +61 -0
  232. package/styles/qppds/components/sidebar/_details.scss +58 -0
  233. package/styles/qppds/components/sidebar/_links.scss +444 -0
  234. package/styles/qppds/components/sidebar/_sidebar-animation.scss +125 -0
  235. package/styles/qppds/components/sidebar/_sidebar-tooltip.scss +33 -0
  236. package/styles/qppds/components/sidebar/_sidebar.scss +146 -0
  237. package/styles/qppds/components/sidebar/project-specific/_wi.scss +42 -0
  238. package/styles/qppds/index.scss +4 -0
  239. package/styles/qppds/settings/_functions.scss +4 -0
  240. package/styles/qppds/settings/_index.scss +3 -0
  241. package/styles/qppds/settings/mixins/_borders.scss +6 -0
  242. package/styles/qppds/settings/mixins/_focus.scss +28 -0
  243. package/styles/qppds/settings/mixins/_icons.scss +33 -0
  244. package/styles/qppds/settings/mixins/_index.scss +8 -0
  245. package/styles/qppds/settings/mixins/_layout.scss +74 -0
  246. package/styles/qppds/settings/mixins/_lists.scss +12 -0
  247. package/styles/qppds/settings/mixins/_table.scss +91 -0
  248. package/styles/qppds/settings/mixins/_type.scss +65 -0
  249. package/styles/qppds/settings/mixins/_visually-hidden.scss +30 -0
  250. package/styles/qppds/settings/variables/_color.scss +86 -0
  251. package/styles/qppds/settings/variables/_index.scss +3 -0
  252. package/styles/qppds/settings/variables/_layout.scss +67 -0
  253. package/styles/qppds/settings/variables/_type.scss +132 -0
  254. package/styles/qppds/utilities/_background-color.scss +134 -0
  255. package/styles/qppds/utilities/_color.scss +32 -0
  256. package/styles/qppds/utilities/_display-visibility.scss +83 -0
  257. package/styles/qppds/utilities/_flexbox.scss +240 -0
  258. package/styles/qppds/utilities/_font-family.scss +9 -0
  259. package/styles/qppds/utilities/_font-size.scss +8 -0
  260. package/styles/qppds/utilities/_font-weight.scss +8 -0
  261. package/styles/qppds/utilities/_height.scss +38 -0
  262. package/styles/qppds/utilities/_margin.scss +136 -0
  263. package/styles/qppds/utilities/_padding.scss +76 -0
  264. package/styles/qppds/utilities/_position.scss +24 -0
  265. package/styles/qppds/utilities/_text-align.scss +40 -0
  266. package/styles/qppds/utilities/_text-transform.scss +7 -0
  267. package/styles/qppds/utilities/_truncate.scss +8 -0
  268. package/styles/qppds/utilities/_width.scss +79 -0
  269. package/styles/qppds/utilities/index.scss +15 -0
  270. package/styles/qppds.scss +2 -0
  271. package/styles/third-party/_legacy-bootstrap.scss +19 -0
  272. package/styles/third-party/legacy-bootstrap/_buttons.scss +126 -0
  273. package/styles/third-party/legacy-bootstrap/_dropdowns.scss +211 -0
  274. package/styles/third-party/legacy-bootstrap/_forms.scss +510 -0
  275. package/styles/third-party/legacy-bootstrap/_grid.scss +73 -0
  276. package/styles/third-party/legacy-bootstrap/_mixins.scss +27 -0
  277. package/styles/third-party/legacy-bootstrap/_navbar.scss +644 -0
  278. package/styles/third-party/legacy-bootstrap/_navs.scss +193 -0
  279. package/styles/third-party/legacy-bootstrap/_normalize.scss +385 -0
  280. package/styles/third-party/legacy-bootstrap/_scaffolding.scss +116 -0
  281. package/styles/third-party/legacy-bootstrap/_variables.scss +858 -0
  282. package/styles/third-party/legacy-bootstrap/mixins/_buttons.scss +70 -0
  283. package/styles/third-party/legacy-bootstrap/mixins/_clearfix.scss +22 -0
  284. package/styles/third-party/legacy-bootstrap/mixins/_forms.scss +108 -0
  285. package/styles/third-party/legacy-bootstrap/mixins/_grid-framework.scss +86 -0
  286. package/styles/third-party/legacy-bootstrap/mixins/_grid.scss +112 -0
  287. package/styles/third-party/legacy-bootstrap/mixins/_labels.scss +12 -0
  288. package/styles/third-party/legacy-bootstrap/mixins/_nav-divider.scss +10 -0
  289. package/styles/third-party/legacy-bootstrap/mixins/_nav-vertical-align.scss +9 -0
  290. package/styles/third-party/legacy-bootstrap/mixins/_opacity.scss +7 -0
  291. package/styles/third-party/legacy-bootstrap/mixins/_panels.scss +30 -0
  292. package/styles/third-party/legacy-bootstrap/mixins/_reset-filter.scss +7 -0
  293. package/styles/third-party/legacy-bootstrap/mixins/_reset-text.scss +18 -0
  294. package/styles/third-party/legacy-bootstrap/mixins/_resize.scss +6 -0
  295. package/styles/third-party/legacy-bootstrap/mixins/_responsive-visibility.scss +25 -0
  296. package/styles/third-party/legacy-bootstrap/mixins/_size.scss +10 -0
  297. package/styles/third-party/legacy-bootstrap/mixins/_tab-focus.scss +9 -0
  298. package/styles/third-party/legacy-bootstrap/mixins/_table-row.scss +28 -0
  299. package/styles/third-party/legacy-bootstrap/mixins/_text-emphasis.scss +12 -0
  300. package/styles/third-party/legacy-bootstrap/mixins/_text-overflow.scss +8 -0
  301. package/styles/third-party/legacy-bootstrap/mixins/_vendor-prefixes.scss +182 -0
  302. package/styles/utility/_mixins.scss +46 -0
  303. package/styles/utility/_utilities.scss +73 -0
  304. package/test/components/Accordion.test.js +12 -0
  305. package/test/components/ErrorUI.test.js +33 -0
  306. package/test/components/FooterUI.test.js +90 -0
  307. package/test/components/HeaderUI.test.js +45 -0
  308. package/test/components/Infotip.test.js +73 -0
  309. package/test/components/SessionDialogUI.test.js +339 -0
  310. package/test/components/SideNavUI.test.js +23 -0
  311. package/test/components/Tooltip.test.js +147 -0
  312. package/test/index.test.js +8 -0
  313. package/test/session/session.test.js +221 -0
  314. package/test-setup.js +9 -0
  315. package/webpack.config.js +147 -0
  316. package/webpack.config.react.js +86 -0
@@ -0,0 +1,333 @@
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import SVGInline from 'react-svg-inline';
4
+
5
+ import { withGetConfig } from '../../hooks/useGetConfig';
6
+ import { LevelOneContent, LevelTwoContent } from '../Content';
7
+ import {
8
+ NavLinkContainer,
9
+ NavLinkInline,
10
+ NavLinkDrawer,
11
+ NavLinkToggle,
12
+ } from '../Links';
13
+ import AnimationGroup from '../AnimationGroup/AnimationGroup';
14
+ import { PracticeDetails, IndividualDetails } from '../Details';
15
+ import { ScoreChart } from '../Chart';
16
+ import SanitizedContent from '../../SanitizedContent';
17
+ import * as SvgComponents from '../../../lib/SvgComponents.jsx';
18
+ import SVGIcons from '../../../lib/svg-definitions.svg';
19
+ import CmsSwitchLink from '../Links/CmsSwitchLink';
20
+ import defaultContent from './default-content';
21
+
22
+ const SideNavUI = ({
23
+ chartData,
24
+ config,
25
+ currentLevel,
26
+ isAltStyle,
27
+ isExpanded,
28
+ items,
29
+ onCollapsed,
30
+ onExpanded,
31
+ performanceYear,
32
+ showReportingLinks,
33
+ svgIcons,
34
+ result,
35
+ }) => {
36
+ const [isExpandedState, setIsExpandedState] = useState(isExpanded);
37
+ const [itemsState, setItemsState] = useState(items);
38
+ const [currentLevelState, setCurrentLevelState] = useState(currentLevel);
39
+
40
+ const collapseRef = useRef(null);
41
+
42
+ const expand = () => {
43
+ setIsExpandedState(true);
44
+ if (onExpanded) {
45
+ onExpanded();
46
+ }
47
+ };
48
+
49
+ const collapse = () => {
50
+ setIsExpandedState(false);
51
+ if (onCollapsed) {
52
+ onCollapsed();
53
+ }
54
+ };
55
+
56
+ const toggleExpanded = () => {
57
+ isExpandedState ? collapse() : expand();
58
+ };
59
+
60
+ const getLevelContent = () => {
61
+ return (
62
+ {
63
+ 2: (
64
+ <LevelTwoContent
65
+ showReportingLinks={showReportingLinks}
66
+ isExpanded={isExpandedState}
67
+ chartData={chartData}
68
+ config={config}
69
+ />
70
+ ),
71
+ }[currentLevelState] || (
72
+ <LevelOneContent
73
+ levelOneContent={result?.content}
74
+ isExpanded={isExpandedState}
75
+ config={config}
76
+ />
77
+ )
78
+ );
79
+ };
80
+
81
+ const getDynamicContent = (contentItems, className, recursionId) => {
82
+ const { openDrawersByDefault, linkActiveFunc, linkCallback, useTooltips } =
83
+ config;
84
+ const linkClass = isExpandedState ? 'link-inline' : 'link-collapsed';
85
+ const containerRecursionId = recursionId || 0;
86
+
87
+ const getDynamicIcon = (icon) => {
88
+ const Component = SvgComponents[icon];
89
+ return Component ? <Component /> : null;
90
+ };
91
+
92
+ const hasDarkerBackground = (darkerBackground) => {
93
+ return darkerBackground ? 'hr-smaller-vertical-spacing' : '';
94
+ }
95
+
96
+ const itemsMarkup = (contentItems || []).map((item, index) => {
97
+ const key = `${JSON.stringify(item)}-${index}-${containerRecursionId}`;
98
+ return (
99
+ {
100
+ divider: (
101
+ <AnimationGroup display={isExpandedState} key={key} darkerBackground={item.darkerBackground}>
102
+ <hr className={`${hasDarkerBackground(item.darkerBackground)}`}/>
103
+ </AnimationGroup>
104
+ ),
105
+ container: getDynamicContent(
106
+ item.items,
107
+ item.className,
108
+ containerRecursionId + 1
109
+ ),
110
+ linkBack: (
111
+ <AnimationGroup display={isExpandedState} key={key}>
112
+ <NavLinkInline
113
+ className="link-back"
114
+ icon={getDynamicIcon('ChevronLeft')}
115
+ url={item.url}
116
+ label={item.label}
117
+ linkCallback={linkCallback}
118
+ showLabel={true}
119
+ useTooltips={useTooltips}
120
+ />
121
+ </AnimationGroup>
122
+ ),
123
+ linkHome: (
124
+ <AnimationGroup display={isExpandedState} key={key}>
125
+ <NavLinkInline
126
+ className="account-home-link"
127
+ icon={getDynamicIcon(item?.icon)}
128
+ url={item.url}
129
+ label={item.label}
130
+ linkCallback={linkCallback}
131
+ showLabel={true}
132
+ useTooltips={useTooltips}
133
+ />
134
+ </AnimationGroup>
135
+ ),
136
+ practiceDetails: (
137
+ <AnimationGroup
138
+ display={isExpandedState}
139
+ className={'details'}
140
+ key={key}
141
+ >
142
+ <PracticeDetails
143
+ practiceName={item.practiceName}
144
+ {...(!item.practiceTin
145
+ ? {}
146
+ : { practiceTin: item.practiceTin })}
147
+ {...(!item.apmEntityId
148
+ ? {}
149
+ : { apmEntityId: item.apmEntityId })}
150
+ {...(!item.vgId ? {} : { vgId: item.vgId })}
151
+ {...(!item.cpcPlusId ? {} : { cpcPlusId: item.cpcPlusId })}
152
+ {...(!item.pcfId ? {} : { pcfId: item.pcfId })}
153
+ />
154
+ </AnimationGroup>
155
+ ),
156
+ individualDetails: (
157
+ <AnimationGroup display={isExpandedState} key={key}>
158
+ <IndividualDetails
159
+ individualName={item.individualName}
160
+ individualNpi={item.individualNpi}
161
+ />
162
+ </AnimationGroup>
163
+ ),
164
+ linkDrawer: (
165
+ <NavLinkDrawer
166
+ key={key}
167
+ isExpanded={isExpandedState}
168
+ isAlwaysOpen={item.isAlwaysOpen}
169
+ openByDefault={openDrawersByDefault}
170
+ rightIcon="chevron-down"
171
+ leftIcon={getDynamicIcon(item?.icon)}
172
+ className={linkClass}
173
+ label={item.label}
174
+ linkActiveFunc={linkActiveFunc}
175
+ linkCallback={linkCallback}
176
+ listOfLinks={item.items}
177
+ url={item.url}
178
+ sidebarExpand={expand}
179
+ isHighlighted={item.isHighlighted}
180
+ darkerBackground={item.darkerBackground}
181
+ leftBorderHighlightDisabled={item.leftBorderHighlightDisabled}
182
+ largerDrawerBottomPadding={item.largerDrawerBottomPadding}
183
+ />
184
+ ),
185
+ custom: (
186
+ <AnimationGroup display={isExpandedState} key={key}>
187
+ <SanitizedContent
188
+ html={item.content}
189
+ customClassName={item.customClassName}
190
+ />
191
+ </AnimationGroup>
192
+ ),
193
+ chart: (
194
+ <AnimationGroup display={isExpandedState} key={key}>
195
+ <ScoreChart
196
+ chartData={item.chartData}
197
+ linkCallback={linkCallback}
198
+ performanceYear={performanceYear}
199
+ />
200
+ </AnimationGroup>
201
+ ),
202
+ switchLink: (
203
+ <AnimationGroup display={isExpandedState} key={key}>
204
+ <CmsSwitchLink
205
+ linkCallback={linkCallback}
206
+ label={item.label}
207
+ url={item.url}
208
+ />
209
+ </AnimationGroup>
210
+ ),
211
+ }[item.type] || (
212
+ <NavLinkInline
213
+ key={key}
214
+ icon={getDynamicIcon(item?.icon)}
215
+ className={item.className ? item.className : linkClass}
216
+ url={item.url}
217
+ label={item.label}
218
+ linkCallback={linkCallback}
219
+ showLabel={isExpandedState}
220
+ disabled={item.disabled}
221
+ useTooltips={useTooltips}
222
+ target={item.target}
223
+ />
224
+ )
225
+ );
226
+ });
227
+
228
+ if (className === 'link-container') {
229
+ return (
230
+ <div
231
+ className="animation-flat"
232
+ key={`nav-link-container-${recursionId}`}
233
+ >
234
+ <NavLinkContainer
235
+ listOfLinks={itemsMarkup}
236
+ linkActiveFunc={linkActiveFunc}
237
+ />
238
+ </div>
239
+ );
240
+ } else {
241
+ return <div className={className}>{itemsMarkup}</div>;
242
+ }
243
+ };
244
+
245
+ const content = itemsState
246
+ ? getDynamicContent(
247
+ itemsState,
248
+ 'sidebar-content' + (isAltStyle ? ' alt-style' : '')
249
+ )
250
+ : getLevelContent();
251
+
252
+ useEffect(() => {
253
+ setIsExpandedState(isExpanded);
254
+ }, [isExpanded]);
255
+
256
+ useEffect(() => {
257
+ setCurrentLevelState(currentLevel);
258
+ }, [currentLevel]);
259
+
260
+ useEffect(() => {
261
+ setItemsState(items);
262
+ }, [items]);
263
+
264
+ return (
265
+ <aside
266
+ id="qppSidebar"
267
+ tabIndex="-1"
268
+ className={`${isExpandedState ? 'sidebar' : 'sidebar closed'} sidebar-${
269
+ config.navClassName
270
+ }`}
271
+ >
272
+ <SVGInline svg={svgIcons} />
273
+ {content}
274
+ <NavLinkToggle
275
+ isAltStyle={isAltStyle}
276
+ collapseRef={collapseRef}
277
+ isExpanded={isExpandedState}
278
+ onClick={toggleExpanded}
279
+ />
280
+ </aside>
281
+ );
282
+ };
283
+
284
+ SideNavUI.propTypes = {
285
+ currentLevel: PropTypes.number,
286
+ isExpanded: PropTypes.bool,
287
+ onExpanded: PropTypes.func,
288
+ onCollapsed: PropTypes.func,
289
+ chartData: PropTypes.object,
290
+ config: PropTypes.object,
291
+ items: PropTypes.object,
292
+ isAltStyle: PropTypes.bool,
293
+ showReportingLinks: PropTypes.bool,
294
+ performanceYear: PropTypes.string,
295
+ svgIcons: PropTypes.string,
296
+ result: PropTypes.shape({
297
+ content: PropTypes.shape({
298
+ default: PropTypes.arrayOf(PropTypes.object),
299
+ devPre: PropTypes.arrayOf(PropTypes.object),
300
+ internalReviewers: PropTypes.arrayOf(PropTypes.object),
301
+ viewer: PropTypes.arrayOf(PropTypes.object),
302
+ }),
303
+ }),
304
+ };
305
+
306
+ SideNavUI.defaultProps = {
307
+ currentLevel: 1,
308
+ isExpanded: true,
309
+ onExpanded: () => {},
310
+ onCollapsed: () => {},
311
+ chartData: {},
312
+ config: {},
313
+ items: null,
314
+ isAltStyle: false,
315
+ showReportingLinks: false,
316
+ performanceYear: '2017',
317
+ svgIcons: SVGIcons,
318
+ result: {
319
+ content: {
320
+ default: [],
321
+ devPre: [],
322
+ internalReviewers: [],
323
+ viewer: [],
324
+ },
325
+ },
326
+ };
327
+
328
+ export default withGetConfig(SideNavUI, {
329
+ timeout: 5,
330
+ url: '/config/side-navigation',
331
+ localStorageName: 'qpp_side_navigation',
332
+ defaultContent,
333
+ });
@@ -0,0 +1,99 @@
1
+ {
2
+ "default": [
3
+ {
4
+ "url": "/user/submissions",
5
+ "label": "Account Home"
6
+ },
7
+ {
8
+ "url": "/user/dashboard",
9
+ "label": "Eligibility & Reporting"
10
+ },
11
+ {
12
+ "url": "/user/submissions/facility-based-preview",
13
+ "label": "Facility Based Preview"
14
+ },
15
+ {
16
+ "urlExpressionToMatch": "/user/submissions/feedback/[0-9][0-9][0-9][0-9]",
17
+ "url": "/user/submissions/feedback",
18
+ "label": "Performance Feedback"
19
+ },
20
+ {
21
+ "url": "/user/apm-incentive-payments",
22
+ "label": "APM Incentive Payments"
23
+ },
24
+ {
25
+ "url": "/user/submissions/doctors-clinicians-preview",
26
+ "label": "Doctors & Clinicians Preview"
27
+ },
28
+ {
29
+ "url": "/user/exception/#/landing",
30
+ "label": "Exceptions Application"
31
+ },
32
+ {
33
+ "className": "stroke-based-icon",
34
+ "url": "/user/targeted-review/#/landing",
35
+ "label": "Targeted Review"
36
+ },
37
+ {
38
+ "url": "/user/submissions/reports",
39
+ "label": "Reports"
40
+ },
41
+ {
42
+ "url": "/user/manage-access",
43
+ "label": "Manage Access",
44
+ "listOfLinks": [
45
+ {
46
+ "url": "/user/impersonate",
47
+ "label": "QPP User Impersonation"
48
+ },
49
+ {
50
+ "url": "/user/self-nomination/#/landing",
51
+ "label": "Registry/QCDR Self-Nomination",
52
+ "items": []
53
+ }
54
+ ]
55
+ },
56
+ {
57
+ "url": "/resources/help-and-support",
58
+ "label": "Help and Support"
59
+ }
60
+ ],
61
+ "devPre": [
62
+ {
63
+ "url": "/user/applications",
64
+ "label": "My Applications"
65
+ },
66
+ {
67
+ "url": "/user/test-data",
68
+ "label": "My Test Data"
69
+ },
70
+ {
71
+ "url": "/user/manage-access",
72
+ "label": "Manage Access"
73
+ },
74
+ {
75
+ "url": "/developers",
76
+ "label": "Developer Tools"
77
+ }
78
+ ],
79
+ "internalReviewers": [
80
+ {
81
+ "url": "/user/reviewers",
82
+ "label": "Dashboard Home"
83
+ },
84
+ {
85
+ "url": "/reviewer/exception",
86
+ "label": "Exceptions Application"
87
+ },
88
+ {
89
+ "className": "stroke-based-icon",
90
+ "url": "/reviewer/targeted-review",
91
+ "label": "Targeted Review"
92
+ },
93
+ {
94
+ "url": "/self-nomination",
95
+ "label": "Self Nomination"
96
+ }
97
+ ],
98
+ "viewer": []
99
+ }
@@ -0,0 +1,3 @@
1
+ import SideNavUI from './SideNavUI';
2
+
3
+ export { SideNavUI };
@@ -0,0 +1,49 @@
1
+ const submissionsUrl = '/user/submissions';
2
+ const dashboardUrl = '/user/dashboard';
3
+ const manageUrl = '/user/manage-access';
4
+ const feedbackUrl = `${submissionsUrl}/feedback`;
5
+ const physicianCompareUrl = `${submissionsUrl}/doctors-clinicians-preview`;
6
+ const reportsPortalUrl = `${submissionsUrl}/reports`;
7
+ const facilityBasedPreviewBaseUrl = `${submissionsUrl}/facility-based-preview`;
8
+
9
+ const performanceFeedbackUrl = (performanceYear) => {
10
+ if (performanceYear) {
11
+ return `${feedbackUrl}/${performanceYear}`;
12
+ } else {
13
+ return feedbackUrl;
14
+ }
15
+ };
16
+
17
+ const facilityBasedPreviewUrl = (performanceYear) => {
18
+ return `${facilityBasedPreviewBaseUrl}/${performanceYear}`;
19
+ };
20
+
21
+ const handleNavigation = (e, linkCallbackFunction, label) => {
22
+ if (linkCallbackFunction) {
23
+ const { pathname, hash, search } = e.currentTarget;
24
+ e.preventDefault();
25
+ e.stopPropagation();
26
+ linkCallbackFunction(`${pathname}${hash}${search}`);
27
+ }
28
+ window?.utag?.link({
29
+ ga_event_category: 'side navbar',
30
+ ga_event_action: 'click',
31
+ ga_event_label: label,
32
+ page_title: `${window.document.title}`,
33
+ page_url: `${window.location.pathname}`,
34
+ event: 'trackEvent',
35
+ });
36
+ };
37
+
38
+ module.exports = {
39
+ submissionsUrl,
40
+ dashboardUrl,
41
+ feedbackUrl,
42
+ manageUrl,
43
+ physicianCompareUrl,
44
+ performanceFeedbackUrl,
45
+ facilityBasedPreviewUrl,
46
+ handleNavigation,
47
+ reportsPortalUrl,
48
+ facilityBasedPreviewBaseUrl,
49
+ };
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { render } from 'react-dom';
3
+ import { SideNavUI } from './UI';
4
+
5
+ const SideNav = (options = {}) => {
6
+ const {
7
+ rootElement,
8
+ isExpanded,
9
+ onExpanded,
10
+ onCollapsed,
11
+ chartData,
12
+ currentLevel,
13
+ config,
14
+ feedbackPerformanceYear,
15
+ fbpPerformanceYear,
16
+ showDevPreDfpLink,
17
+ showPhysicianCompareLink,
18
+ showFacilityBasedPreviewLink,
19
+ showSelfNomination,
20
+ showApmIncentivePaymentLink,
21
+ items,
22
+ isAltStyle,
23
+ showReportsPortal,
24
+ showTargetedReviewLink,
25
+ } = options;
26
+
27
+ const { expand, collapse } = render(
28
+ <SideNavUI
29
+ isExpanded={isExpanded}
30
+ onExpanded={onExpanded}
31
+ onCollapsed={onCollapsed}
32
+ chartData={chartData}
33
+ currentLevel={currentLevel}
34
+ config={config}
35
+ feedbackPerformanceYear={feedbackPerformanceYear}
36
+ fbpPerformanceYear={fbpPerformanceYear}
37
+ showDevPreDfpLink={showDevPreDfpLink}
38
+ showPhysicianCompareLink={showPhysicianCompareLink}
39
+ showFacilityBasedPreviewLink={showFacilityBasedPreviewLink}
40
+ showSelfNomination={showSelfNomination}
41
+ showApmIncentivePaymentLink={showApmIncentivePaymentLink}
42
+ items={items}
43
+ isAltStyle={isAltStyle}
44
+ showReportsPortal={showReportsPortal}
45
+ showTargetedReviewLink={showTargetedReviewLink}
46
+ />,
47
+ rootElement
48
+ );
49
+
50
+ return { expand, collapse };
51
+ };
52
+
53
+ export default SideNav;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { render } from 'react-dom';
3
+ import DSSpinner from '@cmsgov/design-system/dist/components/Spinner/Spinner';
4
+
5
+ export default class Spinner {
6
+ constructor(options) {
7
+ render(<DSSpinner />, options.rootElement);
8
+ }
9
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import MuiTab from '@material-ui/core/Tab';
4
+
5
+ const Tab = ({ href, ...rest }) => {
6
+ return (
7
+ <MuiTab
8
+ component="a"
9
+ disableRipple
10
+ onClick={(e) => {
11
+ e.preventDefault();
12
+ if (window.history && href) {
13
+ window.history.replaceState({}, document.title, href);
14
+ }
15
+ }}
16
+ className="qpp-c-tabs__item"
17
+ {...rest}
18
+ />
19
+ );
20
+ };
21
+
22
+ Tab.propTypes = {
23
+ href: PropTypes.string,
24
+ };
25
+
26
+ export default Tab
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ export const TabPanel = ({ children, value, id, index, className, disabled }) => {
5
+ const classes = ['qpp-c-tabs__panel', className].filter(Boolean).join(' ');
6
+ return (
7
+ <div
8
+ role="tabpanel"
9
+ id={id}
10
+ aria-hidden={value !== index}
11
+ aria-labelledby={`qpp-c-tabs__item--${id}`}
12
+ aria-disabled={disabled}
13
+ className={classes}
14
+ >
15
+ {value === index && children}
16
+ </div>
17
+ );
18
+ };
19
+
20
+ TabPanel.propTypes = {
21
+ children: PropTypes.node,
22
+ className: PropTypes.string,
23
+ index: PropTypes.number.isRequired,
24
+ id: PropTypes.string,
25
+ value: PropTypes.number.isRequired,
26
+ disabled: PropTypes.bool,
27
+ };
28
+
29
+ TabPanel.defaultProps = {
30
+ index: 0,
31
+ value: 0,
32
+ };
33
+
34
+ export default TabPanel;