qpp-style 1.3.3 → 1.4.0-rm.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +10 -0
- package/.editorconfig +22 -0
- package/.eslintignore +5 -0
- package/.eslintrc.js +31 -0
- package/.husky/pre-commit +5 -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 +35 -50
- 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 +53 -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/DropdownButton/DropdownButton.stories.js +137 -0
- package/components/DropdownButton/index.js +148 -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 +13 -0
- package/components/Footer/FooterUI.jsx +207 -0
- package/components/Footer/SocialLinks.jsx +60 -0
- package/components/Footer/Subscribe.jsx +34 -0
- package/components/Footer/footer.js +20 -0
- package/components/GovBanner/index.js +117 -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 +65 -0
- package/components/Header/HeaderLogo.jsx +42 -0
- package/components/Header/HeaderMenuButton.js +50 -0
- package/components/Header/HeaderMenuItem.jsx +239 -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 +82 -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 +98 -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 +276 -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 +338 -0
- package/components/SideNav/UI/default-content.json +99 -0
- package/components/SideNav/UI/index.js +3 -0
- package/components/SideNav/helpers.js +51 -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 +41 -0
- package/components/Tabs/Tabs.stories.js +120 -0
- package/components/Tabs/index.js +100 -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/coverage/clover.xml +1280 -0
- package/coverage/coverage-final.json +69 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +461 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/react/components/Accordion/index.html +116 -0
- package/coverage/lcov-report/react/components/Accordion/index.jsx.html +364 -0
- package/coverage/lcov-report/react/components/Button/index.html +116 -0
- package/coverage/lcov-report/react/components/Button/index.js.html +355 -0
- package/coverage/lcov-report/react/components/Error/Collapsible.jsx.html +349 -0
- package/coverage/lcov-report/react/components/Error/ErrorUI.jsx.html +178 -0
- package/coverage/lcov-report/react/components/Error/error.js.html +163 -0
- package/coverage/lcov-report/react/components/Error/index.html +146 -0
- package/coverage/lcov-report/react/components/Footer/FooterUI.jsx.html +706 -0
- package/coverage/lcov-report/react/components/Footer/SocialLinks.jsx.html +265 -0
- package/coverage/lcov-report/react/components/Footer/Subscribe.jsx.html +187 -0
- package/coverage/lcov-report/react/components/Footer/footer.js.html +145 -0
- package/coverage/lcov-report/react/components/Footer/index.html +161 -0
- package/coverage/lcov-report/react/components/GovBanner/index.html +116 -0
- package/coverage/lcov-report/react/components/GovBanner/index.js.html +436 -0
- package/coverage/lcov-report/react/components/Header/HeaderAccountMenu.jsx.html +592 -0
- package/coverage/lcov-report/react/components/Header/HeaderCancel.jsx.html +133 -0
- package/coverage/lcov-report/react/components/Header/HeaderContainer.jsx.html +280 -0
- package/coverage/lcov-report/react/components/Header/HeaderLogo.jsx.html +211 -0
- package/coverage/lcov-report/react/components/Header/HeaderMenuButton.js.html +235 -0
- package/coverage/lcov-report/react/components/Header/HeaderMenuItem.jsx.html +802 -0
- package/coverage/lcov-report/react/components/Header/HeaderMenuLink.js.html +235 -0
- package/coverage/lcov-report/react/components/Header/HeaderMenuSignOutButton.js.html +271 -0
- package/coverage/lcov-report/react/components/Header/HeaderMobileButton.js.html +196 -0
- package/coverage/lcov-report/react/components/Header/HeaderUI.jsx.html +586 -0
- package/coverage/lcov-report/react/components/Header/HelpIcon.jsx.html +181 -0
- package/coverage/lcov-report/react/components/Header/ImpersonatorBanner.jsx.html +331 -0
- package/coverage/lcov-report/react/components/Header/NavigationButtonIcon.jsx.html +166 -0
- package/coverage/lcov-report/react/components/Header/header.js.html +205 -0
- package/coverage/lcov-report/react/components/Header/hooks.js.html +241 -0
- package/coverage/lcov-report/react/components/Header/index.html +341 -0
- package/coverage/lcov-report/react/components/Header/utag-helpers.js.html +112 -0
- package/coverage/lcov-report/react/components/Infotip/Infotip.jsx.html +310 -0
- package/coverage/lcov-report/react/components/Infotip/InfotipIcon.jsx.html +208 -0
- package/coverage/lcov-report/react/components/Infotip/index.html +146 -0
- package/coverage/lcov-report/react/components/Infotip/index.js.html +94 -0
- package/coverage/lcov-report/react/components/Modal/LegacyModal.jsx.html +301 -0
- package/coverage/lcov-report/react/components/Modal/Modal.jsx.html +505 -0
- package/coverage/lcov-report/react/components/Modal/index.html +146 -0
- package/coverage/lcov-report/react/components/Modal/index.jsx.html +151 -0
- package/coverage/lcov-report/react/components/NotificationBanner/index.html +116 -0
- package/coverage/lcov-report/react/components/NotificationBanner/index.js.html +880 -0
- package/coverage/lcov-report/react/components/SanitizedContent/index.html +116 -0
- package/coverage/lcov-report/react/components/SanitizedContent/index.jsx.html +685 -0
- package/coverage/lcov-report/react/components/SessionDialog/index.html +116 -0
- package/coverage/lcov-report/react/components/SessionDialog/sessionDialog.js.html +163 -0
- package/coverage/lcov-report/react/components/SessionDialogUI.jsx.html +868 -0
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/AnimationGroup.jsx.html +166 -0
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/index.html +116 -0
- package/coverage/lcov-report/react/components/SideNav/Chart/ScoreChart.jsx.html +889 -0
- package/coverage/lcov-report/react/components/SideNav/Chart/index.html +131 -0
- package/coverage/lcov-report/react/components/SideNav/Chart/index.js.html +94 -0
- package/coverage/lcov-report/react/components/SideNav/Content/LevelOneContent.jsx.html +709 -0
- package/coverage/lcov-report/react/components/SideNav/Content/LevelTwoContent.jsx.html +733 -0
- package/coverage/lcov-report/react/components/SideNav/Content/index.html +146 -0
- package/coverage/lcov-report/react/components/SideNav/Content/index.js.html +97 -0
- package/coverage/lcov-report/react/components/SideNav/Details/IndividualDetails.jsx.html +139 -0
- package/coverage/lcov-report/react/components/SideNav/Details/PracticeDetails.jsx.html +220 -0
- package/coverage/lcov-report/react/components/SideNav/Details/index.html +146 -0
- package/coverage/lcov-report/react/components/SideNav/Details/index.js.html +97 -0
- package/coverage/lcov-report/react/components/SideNav/Links/CmsSwitchLink.jsx.html +208 -0
- package/coverage/lcov-report/react/components/SideNav/Links/NavItemInline.jsx.html +247 -0
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkContainer.jsx.html +199 -0
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkDrawer.jsx.html +913 -0
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkInline.jsx.html +406 -0
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkToggle.jsx.html +187 -0
- package/coverage/lcov-report/react/components/SideNav/Links/index.html +206 -0
- package/coverage/lcov-report/react/components/SideNav/Links/index.js.html +124 -0
- package/coverage/lcov-report/react/components/SideNav/UI/SideNavUI.jsx.html +1099 -0
- package/coverage/lcov-report/react/components/SideNav/UI/index.html +131 -0
- package/coverage/lcov-report/react/components/SideNav/UI/index.js.html +94 -0
- package/coverage/lcov-report/react/components/SideNav/helpers.js.html +238 -0
- package/coverage/lcov-report/react/components/SideNav/index.html +131 -0
- package/coverage/lcov-report/react/components/SideNav/index.js.html +244 -0
- package/coverage/lcov-report/react/components/Tooltip/Tooltip.jsx.html +349 -0
- package/coverage/lcov-report/react/components/Tooltip/index.html +146 -0
- package/coverage/lcov-report/react/components/Tooltip/index.js.html +94 -0
- package/coverage/lcov-report/react/components/Tooltip/position.js.html +289 -0
- package/coverage/lcov-report/react/components/hooks/index.html +116 -0
- package/coverage/lcov-report/react/components/hooks/useGetConfig.js.html +307 -0
- package/coverage/lcov-report/react/components/index.html +116 -0
- package/coverage/lcov-report/react/index.html +116 -0
- package/coverage/lcov-report/react/index.js.html +178 -0
- package/coverage/lcov-report/react/lib/Chevron.jsx.html +181 -0
- package/coverage/lcov-report/react/lib/SvgComponents.jsx.html +1702 -0
- package/coverage/lcov-report/react/lib/index.html +146 -0
- package/coverage/lcov-report/react/lib/svg-definitions.svg.html +460 -0
- package/coverage/lcov-report/react/session/index.html +161 -0
- package/coverage/lcov-report/react/session/index.js.html +100 -0
- package/coverage/lcov-report/react/session/logout.js.html +307 -0
- package/coverage/lcov-report/react/session/refresh.js.html +232 -0
- package/coverage/lcov-report/react/session/ttl.js.html +196 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +2876 -0
- package/dist/browser.js +3 -24128
- package/dist/browser.js.LICENSE.txt +63 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.js +3 -24448
- package/dist/index.js.LICENSE.txt +63 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.LICENSE.txt +89 -0
- package/dist/react/index.js.map +1 -0
- package/fonts/PublicSans-Black.ttf +0 -0
- package/fonts/PublicSans-BlackItalic.ttf +0 -0
- package/fonts/PublicSans-Bold.ttf +0 -0
- package/fonts/PublicSans-BoldItalic.ttf +0 -0
- package/fonts/PublicSans-ExtraBold.ttf +0 -0
- package/fonts/PublicSans-ExtraBoldItalic.ttf +0 -0
- package/fonts/PublicSans-ExtraLight.ttf +0 -0
- package/fonts/PublicSans-ExtraLightItalic.ttf +0 -0
- package/fonts/PublicSans-Italic.ttf +0 -0
- package/fonts/PublicSans-Light.ttf +0 -0
- package/fonts/PublicSans-LightItalic.ttf +0 -0
- package/fonts/PublicSans-Medium.ttf +0 -0
- package/fonts/PublicSans-MediumItalic.ttf +0 -0
- package/fonts/PublicSans-Regular.ttf +0 -0
- package/fonts/PublicSans-SemiBold.ttf +0 -0
- package/fonts/PublicSans-SemiBoldItalic.ttf +0 -0
- package/fonts/PublicSans-Thin.ttf +0 -0
- package/fonts/PublicSans-ThinItalic.ttf +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/{img → images}/favicon/browserconfig.xml +2 -2
- package/images/favicon/favicon-16x16.png +0 -0
- package/images/favicon/favicon-32x32.png +0 -0
- package/images/favicon/favicon.ico +0 -0
- package/{img → images}/favicon/manifest.json +4 -4
- 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/icon-dot-gov.svg +1 -0
- package/images/icon-https.svg +1 -0
- package/images/icons/close-x.svg +6 -0
- package/images/icons/help-headset.svg +21 -0
- package/images/icons/svg/arrow-down.svg +3 -0
- package/images/icons/svg/arrow-download.svg +1 -0
- package/images/icons/svg/arrow-right.svg +1 -0
- package/images/icons/svg/arrow-up.svg +3 -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/dropdown-arrow.svg +1 -0
- package/images/icons/svg/external.svg +1 -0
- package/images/icons/svg/file-download.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 +1 -0
- package/images/icons/svg/tooltip-question.svg +1 -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/{img/logo.png → images/qpp_logo_rgb_color.png} +0 -0
- package/images/us_flag_small.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 +96 -36
- package/session/index.js +5 -0
- package/session/logout.js +74 -0
- package/session/refresh.js +49 -0
- package/session/ttl.js +37 -0
- package/styles/_global.scss +81 -55
- package/styles/_main.scss +11 -3
- package/styles/_paths.scss +1 -1
- package/styles/_qpp-style.scss +10 -7
- package/styles/components/_accordion.scss +266 -149
- package/styles/components/_alerts.scss +9 -6
- package/styles/components/_autocomplete.scss +47 -0
- package/styles/components/_breadcrumbs.scss +52 -9
- package/styles/components/_buttons.scss +545 -277
- package/styles/components/_error-page.scss +56 -0
- package/styles/components/_flash-notification.scss +98 -0
- package/styles/components/_fonts.scss +12 -13
- package/styles/components/_forms.scss +144 -70
- package/styles/components/_grid.scss +35 -3
- package/styles/components/_info-modal.scss +139 -0
- package/styles/components/_links.scss +4 -3
- package/styles/components/_modals.scss +10 -9
- package/styles/components/_notification-banner.scss +165 -0
- package/styles/components/_panels.scss +23 -21
- package/styles/components/_pie-chart.scss +3 -3
- package/styles/components/_score-chart.scss +164 -0
- package/styles/components/_spinner.scss +7 -0
- package/styles/components/_tables.scss +96 -72
- package/styles/components/_tabs.scss +69 -0
- package/styles/components/_text.scss +114 -48
- package/styles/components/_tooltip.scss +23 -0
- package/styles/components/_variables.scss +91 -41
- package/styles/components/_wells.scss +39 -29
- package/styles/qppds/README.md +0 -0
- package/styles/qppds/base/_backgrounds.scss +7 -0
- package/styles/qppds/base/_fonts.scss +50 -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 +302 -0
- package/styles/qppds/components/_card.scss +175 -0
- package/styles/qppds/components/_circular-loader.scss +47 -0
- package/styles/qppds/components/_dropdown-menu.scss +119 -0
- package/styles/qppds/components/_dropdown.scss +56 -0
- package/styles/qppds/components/_footer.scss +604 -0
- package/styles/qppds/components/_gov-banner.scss +344 -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/_step-indicator.scss +190 -0
- package/styles/qppds/components/_table.scss +157 -0
- package/styles/qppds/components/_tabs.scss +197 -0
- package/styles/qppds/components/_text-input.scss +60 -0
- package/styles/qppds/components/index.scss +20 -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 +449 -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 +135 -0
- package/styles/qppds/utilities/_background-color.scss +134 -0
- package/styles/qppds/utilities/_color.scss +36 -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/_vertical-align.scss +72 -0
- package/styles/qppds/utilities/_width.scss +79 -0
- package/styles/qppds/utilities/index.scss +16 -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 +28 -20
- package/styles/utility/_utilities.scss +12 -1
- package/test/components/Accordion.test.js +12 -0
- package/test/components/ErrorUI.test.js +33 -0
- package/test/components/FooterUI.test.js +60 -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 +5 -0
- package/webpack.config.js +147 -0
- package/webpack.config.react.js +86 -0
- package/.npmignore +0 -20
- package/.sass-cache/3e7387cd32ce4392e618d792efcd09e792ce05b8/_footer.scssc +0 -0
- package/.sass-cache/3e7387cd32ce4392e618d792efcd09e792ce05b8/_header.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_accordion.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_alerts.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_breadcrumbs.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_buttons.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_fonts.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_forms.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_grid.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_links.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_modals.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_panels.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_pie-chart.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_sidebar.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_tables.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_text.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_toggles.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_tool-tips.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_variables.scssc +0 -0
- package/.sass-cache/4bd2b87409801cd1c2c2d14f3b4ba7f954836013/_wells.scssc +0 -0
- package/.sass-cache/5c21c43f3d373dd19958b57d9f271467abf65ccf/_layout.scssc +0 -0
- package/.sass-cache/6b6017e458fe0ea5864ebd9da1d35223cfce75de/_global.scssc +0 -0
- package/.sass-cache/6b6017e458fe0ea5864ebd9da1d35223cfce75de/_main.scssc +0 -0
- package/.sass-cache/6b6017e458fe0ea5864ebd9da1d35223cfce75de/_paths.scssc +0 -0
- package/.sass-cache/6b6017e458fe0ea5864ebd9da1d35223cfce75de/_qpp-style.scssc +0 -0
- package/.sass-cache/c7cd1c57e96d43cd7197e070665e8c3abeda3881/_mixins.scssc +0 -0
- package/.sass-cache/c7cd1c57e96d43cd7197e070665e8c3abeda3881/_utilities.scssc +0 -0
- package/_layouts/base.html +0 -42
- package/css/main.scss +0 -5
- package/dist/default.css +0 -166
- package/img/favicon/android-chrome-192x192.png +0 -0
- package/img/favicon/android-chrome-512x512.png +0 -0
- package/img/favicon/apple-touch-icon.png +0 -0
- package/img/favicon/favicon-16x16.png +0 -0
- package/img/favicon/favicon-32x32.png +0 -0
- package/img/favicon/favicon.ico +0 -0
- package/img/favicon/mstile-150x150.png +0 -0
- package/img/favicon/safari-pinned-tab.svg +0 -41
- package/js/components/SideNav/AccountLink.jsx +0 -14
- package/js/components/SideNav/AccountLinks.jsx +0 -29
- package/js/components/SideNav/AccountSummary.jsx +0 -39
- package/js/components/SideNav/PracticesPane.jsx +0 -90
- package/js/components/SideNavUI.jsx +0 -77
- package/js/components/sidenav.js +0 -9
- package/js/index.js +0 -6
- package/styles/components/_sidebar.scss +0 -233
- package/styles/components/_tool-tips.scss +0 -6
- package/styles/guide/_layout.scss +0 -119
- package/styles/layout/_footer.scss +0 -92
- package/styles/layout/_header.scss +0 -335
package/.babelrc
ADDED
package/.editorconfig
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# EditorConfig helps developers define and maintain consistent
|
|
2
|
+
# coding styles between different editors and IDEs
|
|
3
|
+
# editorconfig.org
|
|
4
|
+
|
|
5
|
+
root = true
|
|
6
|
+
|
|
7
|
+
[*]
|
|
8
|
+
indent_style = space
|
|
9
|
+
indent_size = 4
|
|
10
|
+
end_of_line = lf
|
|
11
|
+
charset = utf-8
|
|
12
|
+
trim_trailing_whitespace = true
|
|
13
|
+
insert_final_newline = true
|
|
14
|
+
|
|
15
|
+
[*.scss]
|
|
16
|
+
indent_style = tab
|
|
17
|
+
|
|
18
|
+
[*.md]
|
|
19
|
+
trim_trailing_whitespace = false
|
|
20
|
+
|
|
21
|
+
[*.{pug, yml, yaml, rb, py}]
|
|
22
|
+
indent_size = 2
|
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['eslint:recommended', 'plugin:react/recommended'],
|
|
3
|
+
parser: 'babel-eslint',
|
|
4
|
+
parserOptions: {
|
|
5
|
+
sourceType: 'module',
|
|
6
|
+
ecmaFeatures: {
|
|
7
|
+
jsx: true
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
env: {
|
|
11
|
+
es6: true,
|
|
12
|
+
node: true,
|
|
13
|
+
browser: true,
|
|
14
|
+
jquery: true,
|
|
15
|
+
mocha: true
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
'no-unused-vars': [
|
|
19
|
+
'error',
|
|
20
|
+
{
|
|
21
|
+
args: 'none'
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
'linebreak-style': ['error', 'unix'],
|
|
25
|
+
'no-console': 0,
|
|
26
|
+
'no-prototype-builtins': [0]
|
|
27
|
+
},
|
|
28
|
+
settings: {
|
|
29
|
+
react: { version: 'detect' }
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
stories: [
|
|
6
|
+
'../components/**/*.stories.@(js|jsx|mdx)',
|
|
7
|
+
'../lib/**/*.stories.@(js|jsx|mdx)',
|
|
8
|
+
],
|
|
9
|
+
addons: [
|
|
10
|
+
'@storybook/addon-actions',
|
|
11
|
+
'@storybook/addon-links',
|
|
12
|
+
'@storybook/addon-storysource',
|
|
13
|
+
'@storybook/addon-knobs',
|
|
14
|
+
'@storybook/addon-a11y',
|
|
15
|
+
'@storybook/addon-docs',
|
|
16
|
+
'@storybook/addon-backgrounds',
|
|
17
|
+
'@storybook/addon-viewport',
|
|
18
|
+
'@storybook/addon-postcss',
|
|
19
|
+
],
|
|
20
|
+
webpackFinal: async (config) => {
|
|
21
|
+
// do mutation to the config
|
|
22
|
+
|
|
23
|
+
config.plugins.push(
|
|
24
|
+
new CopyWebpackPlugin([
|
|
25
|
+
{
|
|
26
|
+
from: path.join(__dirname, '..', '..', 'shared', 'fonts/'),
|
|
27
|
+
to: 'fonts/',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
from: path.join(__dirname, '..', '..', 'shared', 'images/'),
|
|
31
|
+
to: 'images/',
|
|
32
|
+
force: true,
|
|
33
|
+
},
|
|
34
|
+
])
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
config.module.rules.push({
|
|
38
|
+
test: /\.scss$/,
|
|
39
|
+
resolve: {
|
|
40
|
+
extensions: ['.scss', '.sass'],
|
|
41
|
+
},
|
|
42
|
+
use: [
|
|
43
|
+
{ loader: 'style-loader' },
|
|
44
|
+
{
|
|
45
|
+
loader: 'css-loader',
|
|
46
|
+
options: { sourceMap: true, importLoaders: 1 },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
loader: 'sass-loader',
|
|
50
|
+
options: {
|
|
51
|
+
sourceMap: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
config.module.rules.push({
|
|
58
|
+
test: /\.svg$/,
|
|
59
|
+
use: [
|
|
60
|
+
'raw-loader',
|
|
61
|
+
{
|
|
62
|
+
loader: 'svgo-loader',
|
|
63
|
+
options: {
|
|
64
|
+
plugins: [
|
|
65
|
+
{ removeTitle: true },
|
|
66
|
+
{ convertColors: { shorthex: false } },
|
|
67
|
+
{ convertPathData: false },
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Modify default storybook SVG loader so we can use the one expected by qpp-style
|
|
75
|
+
// NOTE: When updating storybook dependency, double check this override.
|
|
76
|
+
const staticAssetLoader = config.module.rules.find((rule) => {
|
|
77
|
+
const regExp = rule.test;
|
|
78
|
+
const isRegExp = regExp && typeof regExp.test === 'function';
|
|
79
|
+
return isRegExp && regExp.test('.svg');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
if (staticAssetLoader) {
|
|
83
|
+
// remove svg matching from storybook's default static asset loader
|
|
84
|
+
staticAssetLoader.test = /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return config;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Boottrap navbar and dropdowns used by <Header> component require jQuery
|
|
3
|
+
TODO: <Header> should be refactored to no longer rely on bootstrap.
|
|
4
|
+
-->
|
|
5
|
+
<script
|
|
6
|
+
src="https://code.jquery.com/jquery-3.5.1.min.js"
|
|
7
|
+
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
|
|
8
|
+
crossorigin="anonymous"
|
|
9
|
+
></script>
|
package/README.md
CHANGED
|
@@ -1,57 +1,42 @@
|
|
|
1
|
-
#
|
|
2
|
-
Shared style guide across the QPP program.
|
|
1
|
+
# QPP-Style React
|
|
3
2
|
|
|
4
|
-
This
|
|
3
|
+
This directory contains react implementations of the components for QPP.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
A storybook with examples is published at [https://cmsgov.github.io/qpp-style](https://cmsgov.github.io/qpp-style)
|
|
7
6
|
|
|
8
|
-
##
|
|
9
|
-
|
|
7
|
+
## Github Branch and Pull Request process
|
|
8
|
+
1. Create branch off main and create a Pull Request into main for the feature.
|
|
9
|
+
>Example Branch Name: feature/QPPXX-XXXX_make_icon_better
|
|
10
|
+
2. Once merged into main, create release branch from main.
|
|
11
|
+
3. Name the new branch release/x.xx.x
|
|
12
|
+
4. Run the version bump:
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
```bash
|
|
15
|
+
cd qpp-style/react
|
|
16
|
+
npm version --no-git-tag-version patch
|
|
12
17
|
```
|
|
13
|
-
|
|
18
|
+
|
|
19
|
+
Example Commit Message:
|
|
20
|
+
> x.xx.x release
|
|
21
|
+
|
|
22
|
+
5. Create a pull request against main with the PR Title: x.xx.x release [Example PR](https://github.com/CMSgov/qpp-style/pull/1065)
|
|
23
|
+
6. Enter the change in the description of the pull request i.e.:
|
|
24
|
+
> Added new svg for Icon Name
|
|
25
|
+
|
|
26
|
+
## Generate an NPM token with Publish permissions
|
|
27
|
+
1. If you do not already have an access token, sign in to npmjs.com and navigate to access tokens.
|
|
28
|
+
2. Click generate new token.
|
|
29
|
+
3. Select publish under type.
|
|
30
|
+
4. Copy the npm token and set its value as the environment variable: NPM_TOKEN
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
export NPM_TOKEN={npm_token}
|
|
14
34
|
```
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
$ npm install
|
|
22
|
-
$ npm start
|
|
23
|
-
```
|
|
24
|
-
1. Copy assets to project directory:
|
|
25
|
-
```sh
|
|
26
|
-
$ popd
|
|
27
|
-
$ mkdir -p public
|
|
28
|
-
$ cp -r ./node_modules/qpp-style/build/* public
|
|
29
|
-
```
|
|
30
|
-
1. Create webpage:
|
|
31
|
-
```sh
|
|
32
|
-
$ touch public/index.html
|
|
33
|
-
```
|
|
34
|
-
1. Link to css in html:
|
|
35
|
-
```html
|
|
36
|
-
<html lang="en">
|
|
37
|
-
<head>
|
|
38
|
-
<link href="/css/qpp-style.css" type="text/css" rel="stylesheet" />
|
|
39
|
-
</head>
|
|
40
|
-
<body>
|
|
41
|
-
<h1>QPP Quality Payment Program</h1>
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Another way to use the style is by importing the sass into your project. This can be done in the following way:
|
|
47
|
-
|
|
48
|
-
1. Copy the fonts to `/fonts`:
|
|
49
|
-
```sh
|
|
50
|
-
$ mkdir -p fonts
|
|
51
|
-
$ cp -r ./node_modules/qpp-style/fonts/* fonts
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
1. Create a `.scss` file and adding this line:
|
|
55
|
-
```scss
|
|
56
|
-
@import "../node_modules/qpp-style/styles/qpp_style";
|
|
35
|
+
|
|
36
|
+
## Publish the react qpp-style npm package (used by both react and angular)
|
|
37
|
+
```bash
|
|
38
|
+
cd qpp-style/react
|
|
39
|
+
npm i
|
|
40
|
+
npm publish
|
|
57
41
|
```
|
|
42
|
+
7. Once published successfully, merge into main.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Accordion from '.';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Accordion',
|
|
6
|
+
component: Accordion,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Example = () => (
|
|
10
|
+
<div style={{ padding: '20px', maxWidth: '500px' }}>
|
|
11
|
+
<Accordion title="Accordion title">My accordion content</Accordion>
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const Focus = () => (
|
|
16
|
+
<div style={{ padding: '20px', maxWidth: '500px' }}>
|
|
17
|
+
<input />
|
|
18
|
+
<Accordion title="Accordion title">My accordion content</Accordion>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Chevron } from '../../lib/Chevron.jsx';
|
|
4
|
+
|
|
5
|
+
const Accordion = (props) => {
|
|
6
|
+
const content = useRef(null);
|
|
7
|
+
const [setActive, setActiveState] = useState(props.isOpen ? 'active' : '');
|
|
8
|
+
const ariaPressed = setActive ? 'true' : 'false';
|
|
9
|
+
const getHeight = (node) => {
|
|
10
|
+
if (node) {
|
|
11
|
+
return `${node.scrollHeight}px`;
|
|
12
|
+
}
|
|
13
|
+
return 'auto';
|
|
14
|
+
};
|
|
15
|
+
const height = setActive ? getHeight(content.current) : '0px';
|
|
16
|
+
const rotate = setActive ? 'accordion-icon rotate' : 'accordion-icon';
|
|
17
|
+
|
|
18
|
+
function toggleAccordion() {
|
|
19
|
+
setActiveState(setActive === '' ? 'active' : '');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function openAccordion() {
|
|
23
|
+
setActiveState('active');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function closeAccordion() {
|
|
27
|
+
setActiveState('');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (props.isOpen) {
|
|
32
|
+
openAccordion();
|
|
33
|
+
} else {
|
|
34
|
+
closeAccordion();
|
|
35
|
+
}
|
|
36
|
+
}, [props.isOpen]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className="accordion-section" data-testid="accordion">
|
|
40
|
+
<button
|
|
41
|
+
className={`accordion ${setActive}`}
|
|
42
|
+
aria-label={props.title}
|
|
43
|
+
aria-pressed={ariaPressed}
|
|
44
|
+
aria-expanded={ariaPressed}
|
|
45
|
+
tabIndex="0"
|
|
46
|
+
onClick={toggleAccordion}
|
|
47
|
+
>
|
|
48
|
+
<div className="accordion-left-title">
|
|
49
|
+
<p className="accordion-title">{props.title}</p>
|
|
50
|
+
{props.subTitle && (
|
|
51
|
+
<p className="accordion-subtitle">{props.subTitle}</p>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
{props.centerItem && (
|
|
55
|
+
<div className="accordion-center">
|
|
56
|
+
<p>{props.centerItem}</p>
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
{props.rightItem && (
|
|
60
|
+
<div className="accordion-right">
|
|
61
|
+
<p>{props.rightItem}</p>
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
<div className="chevron-container">
|
|
65
|
+
<Chevron className={rotate} />
|
|
66
|
+
</div>
|
|
67
|
+
</button>
|
|
68
|
+
<div
|
|
69
|
+
ref={content}
|
|
70
|
+
style={{ maxHeight: height }}
|
|
71
|
+
className="accordion-content"
|
|
72
|
+
>
|
|
73
|
+
<div className="accordion-text dashed-border">{props.children}</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
Accordion.propTypes = {
|
|
80
|
+
title: PropTypes.string.isRequired,
|
|
81
|
+
subTitle: PropTypes.string,
|
|
82
|
+
children: PropTypes.any.isRequired,
|
|
83
|
+
centerItem: PropTypes.string,
|
|
84
|
+
rightItem: PropTypes.string,
|
|
85
|
+
isOpen: PropTypes.bool,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
Accordion.defaultProps = {
|
|
89
|
+
title: '',
|
|
90
|
+
isOpen: false,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default Accordion;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Alert from './index';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Alert',
|
|
7
|
+
component: Alert,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = () => (
|
|
11
|
+
<div className="qpp-u-padding--16">
|
|
12
|
+
<h1 className="h3">Information</h1>
|
|
13
|
+
<Alert
|
|
14
|
+
title="Information Alert"
|
|
15
|
+
description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida."
|
|
16
|
+
/>
|
|
17
|
+
<h2 className="h3">Warning</h2>
|
|
18
|
+
<Alert
|
|
19
|
+
variant="warning"
|
|
20
|
+
title={{ headingLevel: 'h3', text: 'Warning Alert' }}
|
|
21
|
+
>
|
|
22
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet
|
|
23
|
+
consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida.
|
|
24
|
+
</Alert>
|
|
25
|
+
<h2 className="h3">Error</h2>
|
|
26
|
+
<Alert variant="error" title={{ headingLevel: 'h3', text: 'Error Alert' }}>
|
|
27
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet
|
|
28
|
+
consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida.
|
|
29
|
+
</Alert>
|
|
30
|
+
<h2 className="h3">Success</h2>
|
|
31
|
+
<Alert
|
|
32
|
+
variant="success"
|
|
33
|
+
title={{ headingLevel: 'h3', text: 'Success Alert' }}
|
|
34
|
+
>
|
|
35
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet
|
|
36
|
+
consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida.
|
|
37
|
+
</Alert>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const WithoutHeading = () => (
|
|
42
|
+
<div className="qpp-u-padding--16">
|
|
43
|
+
<h1 className="h3">Information</h1>
|
|
44
|
+
<Alert description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida." />
|
|
45
|
+
<h1 className="h3">Warning</h1>
|
|
46
|
+
<Alert variant="warning">
|
|
47
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet
|
|
48
|
+
consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida.
|
|
49
|
+
</Alert>
|
|
50
|
+
<h1 className="h3">Error</h1>
|
|
51
|
+
<Alert variant="error">
|
|
52
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet
|
|
53
|
+
consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida.
|
|
54
|
+
</Alert>
|
|
55
|
+
<h1 className="h3">Success</h1>
|
|
56
|
+
<Alert variant="success">
|
|
57
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi imperdiet
|
|
58
|
+
consequat ex ut vestibulum. Sed vel erat aliquet arcu eleifend gravida.
|
|
59
|
+
</Alert>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
const Alert = ({
|
|
5
|
+
title,
|
|
6
|
+
children,
|
|
7
|
+
description,
|
|
8
|
+
variant,
|
|
9
|
+
className,
|
|
10
|
+
...rest
|
|
11
|
+
}) => {
|
|
12
|
+
const HeadingComponent = title?.headingLevel || 'h2';
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={`qpp-c-alert qpp-c-alert--${variant} ${className}`}
|
|
16
|
+
role="alert"
|
|
17
|
+
{...rest}
|
|
18
|
+
>
|
|
19
|
+
<div className="qpp-c-alert__body">
|
|
20
|
+
{title && (
|
|
21
|
+
<HeadingComponent className="h4 qpp-c-alert__heading">
|
|
22
|
+
{typeof title === 'object' ? title.text : title}
|
|
23
|
+
</HeadingComponent>
|
|
24
|
+
)}
|
|
25
|
+
{description && <p className="qpp-c-alert__text">{description}</p>}
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
Alert.propTypes = {
|
|
33
|
+
children: PropTypes.node,
|
|
34
|
+
className: PropTypes.string,
|
|
35
|
+
description: PropTypes.string,
|
|
36
|
+
title: PropTypes.oneOfType([
|
|
37
|
+
PropTypes.string,
|
|
38
|
+
PropTypes.shape({
|
|
39
|
+
text: PropTypes.string,
|
|
40
|
+
headingLevel: PropTypes.string,
|
|
41
|
+
}),
|
|
42
|
+
]),
|
|
43
|
+
variant: PropTypes.oneOf(['info', 'warning', 'success', 'error']),
|
|
44
|
+
};
|
|
45
|
+
Alert.defaultProps = {
|
|
46
|
+
children: null,
|
|
47
|
+
className: '',
|
|
48
|
+
description: null,
|
|
49
|
+
title: null,
|
|
50
|
+
variant: 'info',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default Alert;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Breadcrumb Component
|
|
2
|
+
|
|
3
|
+
The Breadcrumb component is a secondary navigation scheme that reveals the user's location.
|
|
4
|
+
|
|
5
|
+
### Props
|
|
6
|
+
|
|
7
|
+
| Property name | Type | Required | Default Value | Description |
|
|
8
|
+
| --------------------- | ---------- | -------- | ------------- | ------------------------------------------ |
|
|
9
|
+
| `breadcrumbClass` | `String` | `false` | '' | class to append to Breadcrumb nav element |
|
|
10
|
+
| `crumbs` | `Array` | `true` | | array of breadcrumbs |
|
|
11
|
+
| `dark` | `Boolean` | `false` | `false` | Use dark mode theme |
|
|
12
|
+
| `RouterLink` | `Function` | `false` | `null` | Link component to use instead of `<a>` |
|
|
13
|
+
| `routerExcludedLinks` | `Array` | `false` | `[]` | Array of paths to exclude from using Link |
|
|
14
|
+
|
|
15
|
+
### Crumbs
|
|
16
|
+
|
|
17
|
+
Each crumb can be a string or an object with the following properties.
|
|
18
|
+
|
|
19
|
+
| Property name | Type | Required | Description |
|
|
20
|
+
| ------------- | -------- | -------- | -------------------------- |
|
|
21
|
+
| `url` | `String` | `true` | url |
|
|
22
|
+
| `title` | `String` | `true` | Menu item string displayed |
|
|
23
|
+
| `category` | `String` | `true` | Data tracking category |
|
|
24
|
+
| `label` | `String` | `true` | Data tracking label |
|
|
25
|
+
|
|
26
|
+
### RouterLink
|
|
27
|
+
|
|
28
|
+
The `RouterLink` is only used by the Frontend to enable using push state for navigation. The `routerExcludedLinks` provides a way to opt certain links out of using the RouterLink.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Breadcrumb from './index';
|
|
3
|
+
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Breadcrumb',
|
|
7
|
+
component: Breadcrumb,
|
|
8
|
+
decorators: [withKnobs],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ExampleLightBreadcrumb = () => (
|
|
12
|
+
<div className="qppds qpp-u-padding--16 qpp-u-fill--blue-80">
|
|
13
|
+
<Breadcrumb
|
|
14
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
15
|
+
crumbs={[
|
|
16
|
+
{
|
|
17
|
+
url: '/',
|
|
18
|
+
category: 'MainContent',
|
|
19
|
+
label: 'Home',
|
|
20
|
+
title: 'Home',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
url: '/',
|
|
24
|
+
category: 'MainContent',
|
|
25
|
+
label: 'Mips Overview',
|
|
26
|
+
title: 'Mips Overview',
|
|
27
|
+
},
|
|
28
|
+
]}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
ExampleLightBreadcrumb.storyName = 'Light';
|
|
34
|
+
|
|
35
|
+
export const ExampleScreenreaderOnlyBreadcrumb = () => (
|
|
36
|
+
<div className="qppds qpp-u-padding--16 qpp-u-fill--blue-80">
|
|
37
|
+
<Breadcrumb
|
|
38
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
39
|
+
crumbs={[
|
|
40
|
+
{
|
|
41
|
+
url: '/',
|
|
42
|
+
category: 'MainContent',
|
|
43
|
+
label: 'Home',
|
|
44
|
+
title: 'Home',
|
|
45
|
+
},
|
|
46
|
+
'Mips Overview',
|
|
47
|
+
]}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
ExampleScreenreaderOnlyBreadcrumb.storyName = 'SR Only Breadcrumb';
|
|
52
|
+
|
|
53
|
+
export const ExampleDarkBreadcrumb = () => (
|
|
54
|
+
<div className="qppds qpp-u-padding--16">
|
|
55
|
+
<Breadcrumb
|
|
56
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
57
|
+
dark
|
|
58
|
+
crumbs={[
|
|
59
|
+
{
|
|
60
|
+
url: '/',
|
|
61
|
+
category: 'MainContent',
|
|
62
|
+
label: 'Home',
|
|
63
|
+
title: 'Home',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
url: '/',
|
|
67
|
+
category: 'MainContent',
|
|
68
|
+
label: 'Mips Overview',
|
|
69
|
+
title: 'Mips Overview',
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
ExampleDarkBreadcrumb.storyName = 'Dark';
|