@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,68 @@
|
|
|
1
|
+
const OFFSET = 12; // modified from reach-ui/tooltip OFFSET value
|
|
2
|
+
const TRIANGLE_SCALE_X = 6;
|
|
3
|
+
const TRIANGLE_SCALE_Y = 8;
|
|
4
|
+
|
|
5
|
+
const isDirectionUp = (triggerRect, tooltipRect) => {
|
|
6
|
+
const collisions = {
|
|
7
|
+
top: triggerRect.top - tooltipRect.height < 0,
|
|
8
|
+
bottom:
|
|
9
|
+
window.innerHeight < triggerRect.bottom + tooltipRect.height + OFFSET,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return !collisions.top || collisions.bottom;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// modified from @reach/tooltip default positioning function
|
|
16
|
+
// positions Tooltip relative to trigger
|
|
17
|
+
// https://github.com/reach/reach-ui/blob/master/packages/tooltip/src/index.tsx#L532
|
|
18
|
+
const positionTip = (triggerRect, tooltipRect) => {
|
|
19
|
+
if (!triggerRect || !tooltipRect) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const triggerCenter = triggerRect.left + triggerRect.width / 2;
|
|
24
|
+
const left = triggerCenter - tooltipRect.width / 2;
|
|
25
|
+
const maxLeft = window.innerWidth - tooltipRect.width - 2;
|
|
26
|
+
const centerLeft = Math.min(Math.max(2, left), maxLeft) + window.pageXOffset;
|
|
27
|
+
|
|
28
|
+
const directionUp = isDirectionUp(triggerRect, tooltipRect);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
left: `${centerLeft}px`,
|
|
32
|
+
top: directionUp
|
|
33
|
+
? `${
|
|
34
|
+
triggerRect.top - OFFSET - tooltipRect.height + window.pageYOffset
|
|
35
|
+
}px`
|
|
36
|
+
: `${
|
|
37
|
+
triggerRect.top + OFFSET + triggerRect.height + window.pageYOffset
|
|
38
|
+
}px`,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default positionTip;
|
|
43
|
+
|
|
44
|
+
// position triangle relative to tooltip position
|
|
45
|
+
// TODO: figure out a better way to render these updates from within react
|
|
46
|
+
// rendering. This method causes an additional repaint after the Tooltip
|
|
47
|
+
// has been rendered. may require changes to @reach/tooltip.
|
|
48
|
+
export const positionTriangle = (triggerRect, tooltipRect) => {
|
|
49
|
+
const directionUp = isDirectionUp(triggerRect, tooltipRect);
|
|
50
|
+
const triangleTop = directionUp
|
|
51
|
+
? triggerRect.top + window.pageYOffset - OFFSET
|
|
52
|
+
: triggerRect.bottom + window.pageYOffset + OFFSET - TRIANGLE_SCALE_Y;
|
|
53
|
+
|
|
54
|
+
const triangleLeft =
|
|
55
|
+
triggerRect.left - TRIANGLE_SCALE_X + triggerRect.width / 2;
|
|
56
|
+
|
|
57
|
+
const triangleBorder = directionUp
|
|
58
|
+
? `border-top: ${TRIANGLE_SCALE_Y}px solid;`
|
|
59
|
+
: `border-bottom: ${TRIANGLE_SCALE_Y}px solid;`;
|
|
60
|
+
|
|
61
|
+
return `
|
|
62
|
+
border-left: ${TRIANGLE_SCALE_X}px solid transparent;
|
|
63
|
+
border-right: ${TRIANGLE_SCALE_X}px solid transparent;
|
|
64
|
+
left: ${triangleLeft}px;
|
|
65
|
+
top: ${triangleTop}px;
|
|
66
|
+
${triangleBorder}
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
// The content is populated with the following priority order:
|
|
6
|
+
// 1. Use the content in localStorage if it's there
|
|
7
|
+
// 2. If not, make a call to get it from a QPPFE endpoint.
|
|
8
|
+
// Hydrate the localStorage item with the response if localStorage item doesn't match call content.
|
|
9
|
+
// 3. If the call fails, use the default content
|
|
10
|
+
const useGetConfig = ({
|
|
11
|
+
url = '',
|
|
12
|
+
localStorageName = '',
|
|
13
|
+
equalityCheckExclude = [],
|
|
14
|
+
timeout = 30,
|
|
15
|
+
defaultContent,
|
|
16
|
+
}) => {
|
|
17
|
+
const [result, setResult] = useState();
|
|
18
|
+
|
|
19
|
+
if (!url || !localStorageName) {
|
|
20
|
+
throw new Error('Arguments for url and localStorageName are required');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const storageContent = JSON.parse(localStorage.getItem(localStorageName));
|
|
25
|
+
if (
|
|
26
|
+
storageContent?.content &&
|
|
27
|
+
new Date().valueOf() < storageContent.expiration
|
|
28
|
+
) {
|
|
29
|
+
setResult(storageContent);
|
|
30
|
+
} else {
|
|
31
|
+
const origin = window.location.origin;
|
|
32
|
+
axios
|
|
33
|
+
.get(`${origin}${url}`)
|
|
34
|
+
.then(({ data: { data = {} } }) => {
|
|
35
|
+
const expiration = new Date().valueOf() + timeout * 60 * 1000;
|
|
36
|
+
const storageItem = {
|
|
37
|
+
expiration,
|
|
38
|
+
};
|
|
39
|
+
if (
|
|
40
|
+
data?.content &&
|
|
41
|
+
storageContent?.content &&
|
|
42
|
+
Object.keys(data.content).every((key) => {
|
|
43
|
+
if (equalityCheckExclude.includes(key)) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return data.content[key] === storageContent.content[key];
|
|
47
|
+
})
|
|
48
|
+
) {
|
|
49
|
+
storageItem.content = storageContent.content;
|
|
50
|
+
} else {
|
|
51
|
+
storageItem.content = data.content;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
localStorage.setItem(localStorageName, JSON.stringify(storageItem));
|
|
55
|
+
setResult(storageItem);
|
|
56
|
+
})
|
|
57
|
+
.catch((e) => {
|
|
58
|
+
setResult({ content: defaultContent, expiration: 0 });
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const withGetConfig = (Component, options) => {
|
|
67
|
+
function WrappedComponent(props) {
|
|
68
|
+
const result = useGetConfig(options);
|
|
69
|
+
return <Component result={result} {...props} />;
|
|
70
|
+
}
|
|
71
|
+
return WrappedComponent;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default useGetConfig;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import Accordion from './Accordion';
|
|
2
|
+
import Alert from './Alert';
|
|
3
|
+
import Breadcrumb from './Breadcrumb';
|
|
4
|
+
import Button, { TextButton } from './Button';
|
|
5
|
+
import CalloutBox from './CalloutBox';
|
|
6
|
+
import Card from './Card';
|
|
7
|
+
import FlashNotification from './FlashNotification/FlashNotificationUI';
|
|
8
|
+
import Footer from './Footer/FooterUI';
|
|
9
|
+
import Header from './Header/HeaderUI';
|
|
10
|
+
import Modal from './Modal';
|
|
11
|
+
import SideNav from './SideNav/UI/SideNavUI';
|
|
12
|
+
import Spinner from './UnwrappedSpinner';
|
|
13
|
+
import TabPanel from './Tabs/TabPanel';
|
|
14
|
+
import Tabs from './Tabs/index';
|
|
15
|
+
import Tooltip from './Tooltip';
|
|
16
|
+
import Infotip from './Infotip';
|
|
17
|
+
import Search from './Search';
|
|
18
|
+
import TextInput from './TextInput';
|
|
19
|
+
import Dropdown from './Dropdown';
|
|
20
|
+
import DSLink from './Link';
|
|
21
|
+
import {
|
|
22
|
+
MyApplicationsIcon,
|
|
23
|
+
UserSignInIcon,
|
|
24
|
+
MyTestDataIcon,
|
|
25
|
+
ReportDataIcon,
|
|
26
|
+
ManageUsersIcon,
|
|
27
|
+
AccountHomeIcon,
|
|
28
|
+
FacilityBasedPreviewIcon,
|
|
29
|
+
PaymentIcon,
|
|
30
|
+
PhysicianCompareIcon,
|
|
31
|
+
HardshipIcon,
|
|
32
|
+
TargetIcon,
|
|
33
|
+
ReportsIcon,
|
|
34
|
+
HelpSupportIcon,
|
|
35
|
+
DashboardIcon,
|
|
36
|
+
AccountSettings,
|
|
37
|
+
DetailsIcon,
|
|
38
|
+
StarIcon,
|
|
39
|
+
CliniciansIcon,
|
|
40
|
+
GroupReporting,
|
|
41
|
+
IndividualReporting,
|
|
42
|
+
ChevronLeft,
|
|
43
|
+
ChevronRight,
|
|
44
|
+
ChevronDown,
|
|
45
|
+
SwitchPractice,
|
|
46
|
+
ScoreIncrease,
|
|
47
|
+
TooltipIcon,
|
|
48
|
+
NavCollapse,
|
|
49
|
+
NavExpand,
|
|
50
|
+
CloseXIcon,
|
|
51
|
+
CloseXIcon2,
|
|
52
|
+
BellOutline,
|
|
53
|
+
EarlyClaims,
|
|
54
|
+
CliniciansList,
|
|
55
|
+
YoutubeIcon,
|
|
56
|
+
TwitterIcon,
|
|
57
|
+
WiViewReportsIcon,
|
|
58
|
+
WiViewProgressIcon,
|
|
59
|
+
WiManageGroupIcon,
|
|
60
|
+
} from '../lib/SvgComponents.jsx';
|
|
61
|
+
|
|
62
|
+
const Icons = {
|
|
63
|
+
MyApplicationsIcon,
|
|
64
|
+
UserSignInIcon,
|
|
65
|
+
MyTestDataIcon,
|
|
66
|
+
ReportDataIcon,
|
|
67
|
+
ManageUsersIcon,
|
|
68
|
+
AccountHomeIcon,
|
|
69
|
+
FacilityBasedPreviewIcon,
|
|
70
|
+
PaymentIcon,
|
|
71
|
+
PhysicianCompareIcon,
|
|
72
|
+
HardshipIcon,
|
|
73
|
+
TargetIcon,
|
|
74
|
+
ReportsIcon,
|
|
75
|
+
HelpSupportIcon,
|
|
76
|
+
DashboardIcon,
|
|
77
|
+
AccountSettings,
|
|
78
|
+
DetailsIcon,
|
|
79
|
+
StarIcon,
|
|
80
|
+
CliniciansIcon,
|
|
81
|
+
GroupReporting,
|
|
82
|
+
IndividualReporting,
|
|
83
|
+
ChevronLeft,
|
|
84
|
+
ChevronRight,
|
|
85
|
+
ChevronDown,
|
|
86
|
+
SwitchPractice,
|
|
87
|
+
ScoreIncrease,
|
|
88
|
+
TooltipIcon,
|
|
89
|
+
NavCollapse,
|
|
90
|
+
NavExpand,
|
|
91
|
+
CloseXIcon,
|
|
92
|
+
CloseXIcon2,
|
|
93
|
+
BellOutline,
|
|
94
|
+
EarlyClaims,
|
|
95
|
+
CliniciansList,
|
|
96
|
+
YoutubeIcon,
|
|
97
|
+
TwitterIcon,
|
|
98
|
+
WiViewReportsIcon,
|
|
99
|
+
WiViewProgressIcon,
|
|
100
|
+
WiManageGroupIcon,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
Accordion,
|
|
105
|
+
Alert,
|
|
106
|
+
Breadcrumb,
|
|
107
|
+
Button,
|
|
108
|
+
CalloutBox,
|
|
109
|
+
Card,
|
|
110
|
+
FlashNotification,
|
|
111
|
+
Footer,
|
|
112
|
+
Header,
|
|
113
|
+
Icons,
|
|
114
|
+
Infotip,
|
|
115
|
+
Modal,
|
|
116
|
+
Search,
|
|
117
|
+
SideNav,
|
|
118
|
+
Spinner,
|
|
119
|
+
TabPanel,
|
|
120
|
+
Tabs,
|
|
121
|
+
TextButton,
|
|
122
|
+
TextInput,
|
|
123
|
+
Dropdown,
|
|
124
|
+
Tooltip,
|
|
125
|
+
DSLink,
|
|
126
|
+
};
|