@madie/madie-design-system 1.0.2 → 1.0.3
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/.storybook/main.js +3 -0
- package/components/Accordion/Accordion.stories.js +11 -11
- package/components/Accordion/index.jsx +78 -76
- package/components/Alert/Alert.stories.js +60 -51
- package/components/Alert/index.js +46 -37
- package/components/Breadcrumb/Breadcrumb.stories.js +62 -62
- package/components/Breadcrumb/index.js +80 -71
- package/components/Button/Button.stories.js +92 -86
- package/components/Button/index.js +65 -65
- package/components/CalloutBox/CalloutBox.stories.js +75 -75
- package/components/CalloutBox/index.js +92 -92
- package/components/Card/Card.stories.js +135 -135
- package/components/Card/index.js +128 -121
- package/components/Dropdown/Dropdown.stories.js +73 -73
- package/components/Dropdown/index.js +72 -72
- package/components/Error/Collapsible.jsx +75 -70
- package/components/Error/ErrorUI.jsx +22 -22
- package/components/Error/error.js +20 -20
- package/components/FlashNotification/FlashNotificationUI.jsx +77 -77
- package/components/FlashNotification/index.js +23 -23
- package/components/Footer/Footer.stories.js +13 -13
- package/components/Footer/FooterUI.jsx +264 -252
- package/components/Footer/LegacyFooterUI.jsx +190 -180
- package/components/Footer/SocialLinks.jsx +58 -55
- package/components/Footer/Subscribe.jsx +29 -29
- package/components/Footer/footer.js +21 -21
- package/components/FormControlLabel/index.jsx +23 -0
- package/components/Header/Header.stories.js +29 -26
- package/components/Header/HeaderAccountMenu.jsx +163 -149
- package/components/Header/HeaderCancel.jsx +8 -8
- package/components/Header/HeaderContainer.jsx +48 -43
- package/components/Header/HeaderLogo.jsx +34 -34
- package/components/Header/HeaderMenuButton.js +39 -39
- package/components/Header/HeaderMenuItem.jsx +252 -205
- package/components/Header/HeaderMenuLink.js +37 -37
- package/components/Header/HeaderMenuSignOutButton.js +50 -50
- package/components/Header/HeaderMobileButton.js +29 -29
- package/components/Header/HeaderUI.jsx +164 -147
- package/components/Header/HelpIcon.jsx +15 -15
- package/components/Header/ImpersonatorBanner.jsx +50 -47
- package/components/Header/NavigationButtonIcon.jsx +21 -21
- package/components/Header/header.js +36 -34
- package/components/Header/hooks.js +42 -35
- package/components/Header/utag-helpers.js +8 -8
- package/components/Infotip/Infotip.jsx +48 -48
- package/components/Infotip/Infotip.stories.js +32 -30
- package/components/Infotip/InfotipIcon.jsx +30 -30
- package/components/Infotip/index.js +1 -1
- package/components/InputLabel/index.jsx +58 -0
- package/components/Link/Link.stories.js +65 -64
- package/components/Link/index.js +46 -46
- package/components/Modal/LegacyModal.jsx +56 -54
- package/components/Modal/Modal.jsx +121 -121
- package/components/Modal/Modal.stories.js +152 -144
- package/components/Modal/index.jsx +11 -11
- package/components/NotificationBanner/NotificationBanner.stories.js +16 -16
- package/components/NotificationBanner/index.js +239 -225
- package/components/Pagination/index.jsx +171 -160
- package/components/SanitizedContent/index.jsx +183 -183
- package/components/Search/Search.stories.js +14 -14
- package/components/Search/index.js +72 -72
- package/components/Select/Select.stories.js +168 -0
- package/components/Select/index.jsx +103 -0
- package/components/SessionDialog/sessionDialog.js +20 -20
- package/components/SessionDialogUI.jsx +231 -219
- package/components/SideNav/AnimationGroup/AnimationGroup.jsx +19 -17
- package/components/SideNav/Chart/ScoreChart.jsx +238 -229
- package/components/SideNav/Chart/__tests__/ScoreChart.test.js +15 -15
- package/components/SideNav/Chart/index.js +1 -1
- package/components/SideNav/Content/LevelOneContent.jsx +194 -190
- package/components/SideNav/Content/LevelTwoContent.jsx +208 -195
- package/components/SideNav/Content/index.js +2 -2
- package/components/SideNav/Details/IndividualDetails.jsx +10 -10
- package/components/SideNav/Details/PracticeDetails.jsx +36 -34
- package/components/SideNav/Details/index.js +2 -2
- package/components/SideNav/Links/CmsSwitchLink.jsx +32 -32
- package/components/SideNav/Links/NavItemInline.jsx +44 -44
- package/components/SideNav/Links/NavLinkContainer.jsx +27 -25
- package/components/SideNav/Links/NavLinkDrawer.jsx +267 -231
- package/components/SideNav/Links/NavLinkInline.jsx +94 -92
- package/components/SideNav/Links/NavLinkToggle.jsx +25 -25
- package/components/SideNav/Links/index.js +10 -10
- package/components/SideNav/SideNav.stories.js +320 -288
- package/components/SideNav/UI/SideNavUI.jsx +321 -301
- package/components/SideNav/UI/index.js +1 -1
- package/components/SideNav/helpers.js +33 -33
- package/components/SideNav/index.js +46 -46
- package/components/Spinner/index.js +6 -6
- package/components/Tabs/Tab.js +19 -19
- package/components/Tabs/TabPanel.js +31 -24
- package/components/Tabs/Tabs.stories.js +118 -108
- package/components/Tabs/index.js +81 -76
- package/components/TextField/TextField.stories.js +103 -0
- package/components/TextField/index.jsx +80 -0
- package/components/TextInput/TextInput.stories.js +84 -84
- package/components/TextInput/index.js +123 -123
- package/components/Tooltip/Tooltip.jsx +57 -57
- package/components/Tooltip/Tooltip.stories.js +50 -50
- package/components/Tooltip/index.js +1 -1
- package/components/Tooltip/position.js +42 -34
- package/components/UnwrappedSpinner/index.js +5 -5
- package/components/hooks/useGetConfig.js +64 -55
- package/components/index.js +129 -121
- package/coverage/clover.xml +368 -331
- package/coverage/coverage-final.json +57 -54
- package/coverage/lcov-report/InputLabel/index.html +116 -0
- package/coverage/lcov-report/InputLabel/index.jsx.html +214 -0
- package/coverage/lcov-report/Select/index.html +116 -0
- package/coverage/lcov-report/Select/index.jsx.html +391 -0
- package/coverage/lcov-report/Textfield/index.html +116 -0
- package/coverage/lcov-report/Textfield/index.jsx.html +322 -0
- package/coverage/lcov-report/index.html +54 -9
- package/coverage/lcov-report/react/components/Accordion/index.html +1 -1
- package/coverage/lcov-report/react/components/Accordion/index.jsx.html +84 -78
- package/coverage/lcov-report/react/components/Button/index.html +1 -1
- package/coverage/lcov-report/react/components/Button/index.js.html +66 -66
- package/coverage/lcov-report/react/components/Error/Collapsible.jsx.html +87 -72
- package/coverage/lcov-report/react/components/Error/ErrorUI.jsx.html +23 -23
- package/coverage/lcov-report/react/components/Error/error.js.html +21 -21
- package/coverage/lcov-report/react/components/Error/index.html +1 -1
- package/coverage/lcov-report/react/components/Footer/FooterUI.jsx.html +290 -254
- package/coverage/lcov-report/react/components/Footer/LegacyFooterUI.jsx.html +212 -182
- package/coverage/lcov-report/react/components/Footer/SocialLinks.jsx.html +66 -57
- package/coverage/lcov-report/react/components/Footer/Subscribe.jsx.html +30 -30
- package/coverage/lcov-report/react/components/Footer/footer.js.html +22 -22
- package/coverage/lcov-report/react/components/Footer/index.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderAccountMenu.jsx.html +193 -151
- package/coverage/lcov-report/react/components/Header/HeaderCancel.jsx.html +9 -9
- package/coverage/lcov-report/react/components/Header/HeaderContainer.jsx.html +60 -45
- package/coverage/lcov-report/react/components/Header/HeaderLogo.jsx.html +36 -36
- package/coverage/lcov-report/react/components/Header/HeaderMenuButton.js.html +40 -40
- package/coverage/lcov-report/react/components/Header/HeaderMenuItem.jsx.html +348 -207
- package/coverage/lcov-report/react/components/Header/HeaderMenuLink.js.html +38 -38
- package/coverage/lcov-report/react/components/Header/HeaderMenuSignOutButton.js.html +51 -51
- package/coverage/lcov-report/react/components/Header/HeaderMobileButton.js.html +30 -30
- package/coverage/lcov-report/react/components/Header/HeaderUI.jsx.html +201 -150
- package/coverage/lcov-report/react/components/Header/HelpIcon.jsx.html +16 -16
- package/coverage/lcov-report/react/components/Header/ImpersonatorBanner.jsx.html +58 -49
- package/coverage/lcov-report/react/components/Header/NavigationButtonIcon.jsx.html +22 -22
- package/coverage/lcov-report/react/components/Header/header.js.html +42 -36
- package/coverage/lcov-report/react/components/Header/hooks.js.html +58 -37
- package/coverage/lcov-report/react/components/Header/index.html +1 -1
- package/coverage/lcov-report/react/components/Header/utag-helpers.js.html +9 -9
- package/coverage/lcov-report/react/components/Infotip/Infotip.jsx.html +49 -49
- package/coverage/lcov-report/react/components/Infotip/InfotipIcon.jsx.html +31 -31
- package/coverage/lcov-report/react/components/Infotip/index.html +1 -1
- package/coverage/lcov-report/react/components/Infotip/index.js.html +2 -2
- package/coverage/lcov-report/react/components/InputLabel/index.html +116 -0
- package/coverage/lcov-report/react/components/InputLabel/index.jsx.html +214 -0
- package/coverage/lcov-report/react/components/Modal/LegacyModal.jsx.html +62 -56
- package/coverage/lcov-report/react/components/Modal/Modal.jsx.html +122 -122
- package/coverage/lcov-report/react/components/Modal/index.html +1 -1
- package/coverage/lcov-report/react/components/Modal/index.jsx.html +12 -12
- package/coverage/lcov-report/react/components/NotificationBanner/index.html +1 -1
- package/coverage/lcov-report/react/components/NotificationBanner/index.js.html +269 -227
- package/coverage/lcov-report/react/components/Pagination/index.html +1 -1
- package/coverage/lcov-report/react/components/Pagination/index.jsx.html +195 -162
- package/coverage/lcov-report/react/components/SanitizedContent/index.html +1 -1
- package/coverage/lcov-report/react/components/SanitizedContent/index.jsx.html +184 -184
- package/coverage/lcov-report/react/components/Select/index.html +116 -0
- package/coverage/lcov-report/react/components/Select/index.jsx.html +391 -0
- package/coverage/lcov-report/react/components/SessionDialog/index.html +1 -1
- package/coverage/lcov-report/react/components/SessionDialog/sessionDialog.js.html +21 -21
- package/coverage/lcov-report/react/components/SessionDialogUI.jsx.html +257 -221
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/AnimationGroup.jsx.html +25 -19
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Chart/ScoreChart.jsx.html +261 -234
- package/coverage/lcov-report/react/components/SideNav/Chart/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Chart/index.js.html +2 -2
- package/coverage/lcov-report/react/components/SideNav/Content/LevelOneContent.jsx.html +197 -185
- package/coverage/lcov-report/react/components/SideNav/Content/LevelTwoContent.jsx.html +236 -197
- package/coverage/lcov-report/react/components/SideNav/Content/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/index.js.html +3 -3
- package/coverage/lcov-report/react/components/SideNav/Details/IndividualDetails.jsx.html +11 -11
- package/coverage/lcov-report/react/components/SideNav/Details/PracticeDetails.jsx.html +42 -36
- package/coverage/lcov-report/react/components/SideNav/Details/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Details/index.js.html +3 -3
- package/coverage/lcov-report/react/components/SideNav/Links/CmsSwitchLink.jsx.html +33 -33
- package/coverage/lcov-report/react/components/SideNav/Links/NavItemInline.jsx.html +45 -45
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkContainer.jsx.html +33 -27
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkDrawer.jsx.html +323 -215
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkInline.jsx.html +100 -94
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkToggle.jsx.html +26 -26
- package/coverage/lcov-report/react/components/SideNav/Links/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/index.js.html +11 -11
- package/coverage/lcov-report/react/components/SideNav/UI/SideNavUI.jsx.html +363 -303
- package/coverage/lcov-report/react/components/SideNav/UI/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/UI/index.js.html +2 -2
- package/coverage/lcov-report/react/components/SideNav/helpers.js.html +34 -34
- package/coverage/lcov-report/react/components/SideNav/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/index.js.html +47 -47
- package/coverage/lcov-report/react/components/Textfield/index.html +116 -0
- package/coverage/lcov-report/react/components/Textfield/index.jsx.html +322 -0
- package/coverage/lcov-report/react/components/Tooltip/Tooltip.jsx.html +58 -58
- package/coverage/lcov-report/react/components/Tooltip/index.html +1 -1
- package/coverage/lcov-report/react/components/Tooltip/index.js.html +2 -2
- package/coverage/lcov-report/react/components/Tooltip/position.js.html +60 -36
- package/coverage/lcov-report/react/components/hooks/index.html +1 -1
- package/coverage/lcov-report/react/components/hooks/useGetConfig.js.html +84 -57
- package/coverage/lcov-report/react/components/index.html +1 -1
- package/coverage/lcov-report/react/index.html +1 -1
- package/coverage/lcov-report/react/index.js.html +1 -1
- package/coverage/lcov-report/react/lib/Chevron.jsx.html +1 -1
- package/coverage/lcov-report/react/lib/SvgComponents.jsx.html +1 -1
- package/coverage/lcov-report/react/lib/index.html +1 -1
- package/coverage/lcov-report/react/lib/svg-definitions.svg.html +1 -1
- package/coverage/lcov-report/react/session/index.html +1 -1
- package/coverage/lcov-report/react/session/index.js.html +1 -1
- package/coverage/lcov-report/react/session/logout.js.html +1 -1
- package/coverage/lcov-report/react/session/refresh.js.html +1 -1
- package/coverage/lcov-report/react/session/ttl.js.html +1 -1
- package/coverage/lcov.info +855 -779
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +16 -16
- package/dist/react/index.js.LICENSE.txt +1 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +16 -9
- package/styles/qppds/components/_button.scss +29 -1
- package/test/components/Accordion.test.js +10 -10
- package/test/components/ErrorUI.test.js +29 -30
- package/test/components/FooterUI.test.js +82 -80
- package/test/components/HeaderUI.test.js +42 -38
- package/test/components/Infotip.test.js +64 -61
- package/test/components/Pagination.test.js +50 -50
- package/test/components/Select.test.js +113 -0
- package/test/components/SessionDialogUI.test.js +302 -294
- package/test/components/SideNavUI.test.js +19 -19
- package/test/components/TextField.test.js +50 -0
- package/test/components/Tooltip.test.js +133 -133
- package/test/index.test.js +6 -6
- package/test/session/session.test.js +200 -200
- package/storybook-static/0.5651be4a8d0b1984a772.manager.bundle.js +0 -2
- package/storybook-static/0.5651be4a8d0b1984a772.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/0.ce0ed568.iframe.bundle.js +0 -1
- package/storybook-static/1.1b179d27.iframe.bundle.js +0 -3
- package/storybook-static/1.1b179d27.iframe.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/1.1b179d27.iframe.bundle.js.map +0 -1
- package/storybook-static/1.c46d7d065aa0aa5a87ca.manager.bundle.js +0 -1
- package/storybook-static/10.99011d85.iframe.bundle.js +0 -3
- package/storybook-static/10.99011d85.iframe.bundle.js.LICENSE.txt +0 -11
- package/storybook-static/10.99011d85.iframe.bundle.js.map +0 -1
- package/storybook-static/2.35ddc55d.iframe.bundle.js +0 -1
- package/storybook-static/3.ed97833d.iframe.bundle.js +0 -1
- package/storybook-static/5.333e450fad8648669908.manager.bundle.js +0 -1
- package/storybook-static/6.505ea3c696ed314e90c8.manager.bundle.js +0 -2
- package/storybook-static/6.505ea3c696ed314e90c8.manager.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/7.94be8178.iframe.bundle.js +0 -1
- package/storybook-static/7.d26483fcb6f4087398a8.manager.bundle.js +0 -1
- package/storybook-static/8.68cd1217.iframe.bundle.js +0 -3
- package/storybook-static/8.68cd1217.iframe.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
- package/storybook-static/8.7adf0ef161215cd35a66.manager.bundle.js +0 -1
- package/storybook-static/9.488e3969.iframe.bundle.js +0 -1
- package/storybook-static/fonts/FontAwesome.otf +0 -0
- package/storybook-static/fonts/OFL.txt +0 -92
- package/storybook-static/fonts/Rubik-Black.ttf +0 -0
- package/storybook-static/fonts/Rubik-BlackItalic.ttf +0 -0
- package/storybook-static/fonts/Rubik-Bold.ttf +0 -0
- package/storybook-static/fonts/Rubik-BoldItalic.ttf +0 -0
- package/storybook-static/fonts/Rubik-Italic.ttf +0 -0
- package/storybook-static/fonts/Rubik-Light.ttf +0 -0
- package/storybook-static/fonts/Rubik-LightItalic.ttf +0 -0
- package/storybook-static/fonts/Rubik-Medium.ttf +0 -0
- package/storybook-static/fonts/Rubik-MediumItalic.ttf +0 -0
- package/storybook-static/fonts/Rubik-Regular.ttf +0 -0
- package/storybook-static/fonts/fontawesome-webfont.eot +0 -0
- package/storybook-static/fonts/fontawesome-webfont.svg +0 -2671
- package/storybook-static/fonts/fontawesome-webfont.ttf +0 -0
- package/storybook-static/fonts/fontawesome-webfont.woff +0 -0
- package/storybook-static/fonts/fontawesome-webfont.woff2 +0 -0
- package/storybook-static/iframe.html +0 -348
- package/storybook-static/images/favicon/android-chrome-192x192.png +0 -0
- package/storybook-static/images/favicon/android-chrome-256x256.png +0 -0
- package/storybook-static/images/favicon/apple-touch-icon.png +0 -0
- package/storybook-static/images/favicon/browserconfig.xml +0 -9
- package/storybook-static/images/favicon/favicon-16x16.png +0 -0
- package/storybook-static/images/favicon/favicon-32x32.png +0 -0
- package/storybook-static/images/favicon/favicon.ico +0 -0
- package/storybook-static/images/favicon/manifest.json +0 -18
- package/storybook-static/images/favicon/mstile-150x150.png +0 -0
- package/storybook-static/images/favicon/safari-pinned-tab.svg +0 -32
- package/storybook-static/images/hhs-logo-black.svg +0 -10
- package/storybook-static/images/hhs-logo-white.svg +0 -10
- package/storybook-static/images/icons/close-x.svg +0 -6
- package/storybook-static/images/icons/help-headset.svg +0 -21
- package/storybook-static/images/icons/svg/arrow-down.svg +0 -1
- package/storybook-static/images/icons/svg/arrow-download.svg +0 -1
- package/storybook-static/images/icons/svg/arrow-right.svg +0 -1
- package/storybook-static/images/icons/svg/calendar.svg +0 -1
- package/storybook-static/images/icons/svg/close.svg +0 -1
- package/storybook-static/images/icons/svg/download.svg +0 -1
- package/storybook-static/images/icons/svg/external.svg +0 -1
- package/storybook-static/images/icons/svg/file-upload.svg +0 -1
- package/storybook-static/images/icons/svg/print.svg +0 -1
- package/storybook-static/images/icons/svg/search.svg +0 -7
- package/storybook-static/images/icons/svg/tooltip-question.svg +0 -6
- package/storybook-static/images/icons/svg/trash.svg +0 -1
- package/storybook-static/images/icons/svg/upload.svg +0 -1
- package/storybook-static/images/qpp_logo_reversed.png +0 -0
- package/storybook-static/images/qpp_logo_rgb_color.png +0 -0
- package/storybook-static/index.html +0 -59
- package/storybook-static/main.5ae8041695a4f0c06f75.manager.bundle.js +0 -1
- package/storybook-static/main.ee2cae16.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.7eeb017b9a4ce6a70a00.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.e2794f2d.iframe.bundle.js +0 -1
- package/storybook-static/static/media/Bitter-Bold.091bd4b7.woff +0 -0
- package/storybook-static/static/media/Bitter-Bold.24bf01e4.woff2 +0 -0
- package/storybook-static/static/media/Bitter-Bold.46bc29e4.ttf +0 -0
- package/storybook-static/static/media/Bitter-Bold.790f4f2f.eot +0 -0
- package/storybook-static/static/media/Bitter-Italic.1fa5390c.eot +0 -0
- package/storybook-static/static/media/Bitter-Italic.25e5675f.woff +0 -0
- package/storybook-static/static/media/Bitter-Italic.2eb18f5a.ttf +0 -0
- package/storybook-static/static/media/Bitter-Italic.34644574.woff2 +0 -0
- package/storybook-static/static/media/Bitter-Regular.4b22b6e8.woff +0 -0
- package/storybook-static/static/media/Bitter-Regular.559e7075.eot +0 -0
- package/storybook-static/static/media/Bitter-Regular.8db0301b.ttf +0 -0
- package/storybook-static/static/media/Bitter-Regular.f4e2f1f1.woff2 +0 -0
- package/storybook-static/static/media/FontAwesome.91f80bba.otf +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.202d819d.eot +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.92e570c6.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.da71e99a.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.e75949bb.woff +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.72daa33a.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.74ead3a8.woff +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.ae19388f.eot +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.ec7a2746.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.63a5fa7d.woff +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.66451be4.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.7882d20f.eot +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.ca4dd835.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.17ded75f.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.2a5adf6c.woff +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.6059fecb.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.c9808185.eot +0 -0
- package/storybook-static/static/media/Rubik-Bold.31bbd4d2.ttf +0 -0
- package/storybook-static/static/media/Rubik-Light.c90e2014.ttf +0 -0
- package/storybook-static/static/media/Rubik-Medium.5daa89aa.ttf +0 -0
- package/storybook-static/static/media/Rubik-Regular.cdf97d58.ttf +0 -0
- package/storybook-static/static/media/fontawesome-webfont.1e59d233.ttf +0 -0
- package/storybook-static/static/media/fontawesome-webfont.20fd1704.woff2 +0 -0
- package/storybook-static/static/media/fontawesome-webfont.8b43027f.eot +0 -0
- package/storybook-static/static/media/fontawesome-webfont.f691f37e.woff +0 -0
- package/storybook-static/vendors~main.c7e1bdf2e91d9cdba380.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.c7e1bdf2e91d9cdba380.manager.bundle.js.LICENSE.txt +0 -104
- package/storybook-static/vendors~main.f299a23f.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.f299a23f.iframe.bundle.js.LICENSE.txt +0 -145
- package/storybook-static/vendors~main.f299a23f.iframe.bundle.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@madie/madie-design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Shared style guide across the Madie program.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"precommit": "npm run format && npm run lint && npm run format-styles",
|
|
17
17
|
"prepush": "npm test",
|
|
18
18
|
"format": "prettier --write 'components/**/*.(js|jsx)'",
|
|
19
|
+
"format-test": "prettier --write 'test/**/*.(js|jsx)'",
|
|
19
20
|
"lint": "eslint 'components/**/*.{js,jsx}'",
|
|
20
21
|
"stylelint": "stylelint 'styles/**/*.{css,scss}'",
|
|
21
22
|
"format-styles": "prettier 'styles/**/*.{css,scss}' --write --quiet",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@storybook/addon-storysource": "^6.4.13",
|
|
41
42
|
"@storybook/addon-viewport": "^6.4.13",
|
|
42
43
|
"@storybook/addons": "^6.4.13",
|
|
44
|
+
"@storybook/manager-webpack5": "^6.4.19",
|
|
43
45
|
"@storybook/react": "^6.4.19",
|
|
44
46
|
"@testing-library/react": "^12.1.2",
|
|
45
47
|
"autoprefixer": "^10.4.2",
|
|
@@ -80,7 +82,6 @@
|
|
|
80
82
|
"style-loader": "^1.3.0",
|
|
81
83
|
"svgo": "^1.3.2",
|
|
82
84
|
"svgo-loader": "^2.2.2",
|
|
83
|
-
"terser-webpack-plugin": "^4.2.3",
|
|
84
85
|
"webpack": "^5.70.0",
|
|
85
86
|
"webpack-cli": "^4.9.2"
|
|
86
87
|
},
|
|
@@ -103,14 +104,11 @@
|
|
|
103
104
|
},
|
|
104
105
|
"dependencies": {
|
|
105
106
|
"@cmsgov/design-system": "^2.13.0",
|
|
106
|
-
"@emotion/react": "11.4.1",
|
|
107
|
-
"@emotion/styled": "11.3.0",
|
|
108
|
-
"@mui/icons-material": "^5.5.0",
|
|
109
|
-
"@mui/material": "5.0.2",
|
|
110
|
-
"@mui/styles": "^5.5.0",
|
|
111
107
|
"@reach/portal": "^0.16.2",
|
|
112
108
|
"@reach/tooltip": "^0.16.2",
|
|
109
|
+
"@storybook/builder-webpack5": "^6.4.19",
|
|
113
110
|
"@testing-library/jest-dom": "^5.16.2",
|
|
111
|
+
"@testing-library/user-event": "^13.5.0",
|
|
114
112
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
|
|
115
113
|
"axios": "^0.24.0",
|
|
116
114
|
"classnames": "^2.3.1",
|
|
@@ -126,7 +124,16 @@
|
|
|
126
124
|
"xss": "^1.0.10"
|
|
127
125
|
},
|
|
128
126
|
"peerDependencies": {
|
|
129
|
-
"react": "
|
|
130
|
-
"
|
|
127
|
+
"@emotion/react": "^11.8.2",
|
|
128
|
+
"@emotion/styled": "^11.8.1",
|
|
129
|
+
"@mui/icons-material": "^5.5.0",
|
|
130
|
+
"@mui/material": "5.0.2",
|
|
131
|
+
"@mui/styles": "^5.5.0",
|
|
132
|
+
"@mui/system": "^5.5.2",
|
|
133
|
+
"react": "^17.0.2",
|
|
134
|
+
"react-dom": "^17.0.2"
|
|
135
|
+
},
|
|
136
|
+
"overrides": {
|
|
137
|
+
"webpack": "^5.70.0"
|
|
131
138
|
}
|
|
132
139
|
}
|
|
@@ -138,7 +138,35 @@
|
|
|
138
138
|
padding: 1px;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
// cyan
|
|
142
|
+
&.qpp-c-button--cyan {
|
|
143
|
+
background-color: $cyan-40;
|
|
144
|
+
border-color: $cyan-40;
|
|
145
|
+
&:disabled,
|
|
146
|
+
&.qpp-c-button--disabled {
|
|
147
|
+
background-color: $gray-04;
|
|
148
|
+
color: $gray-60;
|
|
149
|
+
border-color: $gray-04;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:hover,
|
|
153
|
+
&.qpp-c-button--hover {
|
|
154
|
+
background-color: $cyan-50;
|
|
155
|
+
border-color:$cyan-50;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:active,
|
|
159
|
+
&.qpp-c-button--active {
|
|
160
|
+
background-color: fade-out($cyan-40, 0.2);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:focus,
|
|
164
|
+
&.qpp-c-button--focus {
|
|
165
|
+
border: 1px solid #048087;
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
box-shadow: 0px 0px 0px 4px rgba(32, 159, 166, 0.2);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
142
170
|
// Outline Button
|
|
143
171
|
&.qpp-c-button--outline {
|
|
144
172
|
background-color: transparent;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render } from
|
|
3
|
-
import Accordion from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@testing-library/react";
|
|
3
|
+
import Accordion from "../../components/Accordion";
|
|
4
4
|
|
|
5
|
-
describe(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
describe("Accordion", () => {
|
|
6
|
+
it("Should render okay", () => {
|
|
7
|
+
const { getByTestId } = render(
|
|
8
|
+
<Accordion title="Title">Content</Accordion>
|
|
9
|
+
);
|
|
10
|
+
expect(getByTestId("accordion")).toBeTruthy();
|
|
11
|
+
});
|
|
12
12
|
});
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { render } from
|
|
3
|
-
import ErrorUI from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@testing-library/react";
|
|
3
|
+
import ErrorUI from "../../components/Error/ErrorUI";
|
|
4
4
|
|
|
5
|
+
describe("ErrorUI", () => {
|
|
6
|
+
it("renders a list of errors in HTML", () => {
|
|
7
|
+
const code = "404";
|
|
8
|
+
const type = "Bad thing happened";
|
|
9
|
+
const message = [
|
|
10
|
+
{ contentTitle: "Not found", content: "test" },
|
|
11
|
+
{ contentTitle: "Image not found", content: "test number 2" },
|
|
12
|
+
];
|
|
13
|
+
const { debug, container } = render(
|
|
14
|
+
<ErrorUI type={type} code={code} message={message} />
|
|
15
|
+
);
|
|
16
|
+
expect(container.querySelector(".page-error")).toBeTruthy();
|
|
17
|
+
expect(container.querySelector(".collapsible-details")).toBeTruthy();
|
|
18
|
+
expect(container.querySelectorAll(".items li").length).toBe(2);
|
|
19
|
+
});
|
|
5
20
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
expect(container.querySelector('.page-error')).toBeTruthy()
|
|
18
|
-
expect(container.querySelector('.collapsible-details')).toBeTruthy()
|
|
19
|
-
expect(container.querySelectorAll('.items li').length).toBe(2)
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('renders a string instead of an array', () => {
|
|
23
|
-
const code = '404';
|
|
24
|
-
const type = 'Bad thing happened';
|
|
25
|
-
const message = 'Not found';
|
|
26
|
-
const { getByText, container } = render(
|
|
27
|
-
<ErrorUI type={type} code={code} message={message} />
|
|
28
|
-
);
|
|
29
|
-
expect(container.querySelector('.page-error')).toBeTruthy()
|
|
30
|
-
expect(container.querySelector('.collapsible-details')).toBeTruthy()
|
|
31
|
-
expect(getByText(/not found/i)).toBeTruthy()
|
|
32
|
-
});
|
|
21
|
+
it("renders a string instead of an array", () => {
|
|
22
|
+
const code = "404";
|
|
23
|
+
const type = "Bad thing happened";
|
|
24
|
+
const message = "Not found";
|
|
25
|
+
const { getByText, container } = render(
|
|
26
|
+
<ErrorUI type={type} code={code} message={message} />
|
|
27
|
+
);
|
|
28
|
+
expect(container.querySelector(".page-error")).toBeTruthy();
|
|
29
|
+
expect(container.querySelector(".collapsible-details")).toBeTruthy();
|
|
30
|
+
expect(getByText(/not found/i)).toBeTruthy();
|
|
31
|
+
});
|
|
33
32
|
});
|
|
@@ -1,90 +1,92 @@
|
|
|
1
|
-
import React, { Component } from
|
|
2
|
-
import ReactDOM from
|
|
3
|
-
import ReactTestUtils from
|
|
4
|
-
import { expect } from
|
|
5
|
-
import FooterUI from
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import ReactTestUtils from "react-dom/test-utils";
|
|
4
|
+
import { expect } from "chai";
|
|
5
|
+
import FooterUI from "../../components/Footer/FooterUI";
|
|
6
6
|
|
|
7
7
|
class Wrapper extends Component {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
render() {
|
|
9
|
+
return this.props.children;
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
describe(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
describe("FooterUI", () => {
|
|
14
|
+
it("renders the footer HTML", () => {
|
|
15
|
+
// Native elements and functional stateless react components don't have public instances and
|
|
16
|
+
// cannot be used with renderIntoDocument. React has a separate package install for a shallow
|
|
17
|
+
// renderer that allows this. Otherwise, you need a wrapper when testing presentational components.
|
|
18
|
+
const component = ReactTestUtils.renderIntoDocument(
|
|
19
|
+
<Wrapper>
|
|
20
|
+
<FooterUI />
|
|
21
|
+
</Wrapper>
|
|
22
|
+
);
|
|
23
|
+
const footer = ReactTestUtils.findRenderedDOMComponentWithTag(
|
|
24
|
+
component,
|
|
25
|
+
"footer"
|
|
26
|
+
);
|
|
27
|
+
const footerNode = ReactDOM.findDOMNode(footer);
|
|
28
|
+
expect(ReactTestUtils.isDOMComponent(footerNode)).to.be.true;
|
|
29
|
+
});
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
it("renders the footer HTML", () => {
|
|
32
|
+
const version = "1.2.3.4";
|
|
33
|
+
const component = ReactTestUtils.renderIntoDocument(
|
|
34
|
+
<Wrapper>
|
|
35
|
+
<FooterUI buildVersion={version} />
|
|
36
|
+
</Wrapper>
|
|
37
|
+
);
|
|
38
|
+
const buildVersion = ReactTestUtils.findRenderedDOMComponentWithClass(
|
|
39
|
+
component,
|
|
40
|
+
"build-version"
|
|
41
|
+
);
|
|
42
|
+
const buildVersionNode = ReactDOM.findDOMNode(buildVersion);
|
|
43
|
+
expect(ReactTestUtils.isDOMComponent(buildVersionNode)).to.be.true;
|
|
44
|
+
expect(buildVersion.textContent).to.equal(version);
|
|
45
|
+
});
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
it("renders the footer properly in the Authenticated experience", () => {
|
|
48
|
+
const component = ReactTestUtils.renderIntoDocument(
|
|
49
|
+
<Wrapper>
|
|
50
|
+
<FooterUI isFullWidth={true} />
|
|
51
|
+
</Wrapper>
|
|
52
|
+
);
|
|
53
|
+
const isFullWidth = ReactTestUtils.scryRenderedDOMComponentsWithClass(
|
|
54
|
+
component,
|
|
55
|
+
"container-full-width"
|
|
56
|
+
)[1];
|
|
57
|
+
const isFullWidthNode = ReactDOM.findDOMNode(isFullWidth);
|
|
58
|
+
expect(ReactTestUtils.isDOMComponent(isFullWidthNode)).to.be.true;
|
|
59
|
+
});
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
describe(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
describe("renders the footer properly in the non-authenticated experience", () => {
|
|
63
|
+
it("renders by default the non-authenticated experience", () => {
|
|
64
|
+
const component = ReactTestUtils.renderIntoDocument(
|
|
65
|
+
<Wrapper>
|
|
66
|
+
<FooterUI />
|
|
67
|
+
</Wrapper>
|
|
68
|
+
);
|
|
69
|
+
const isNotFullWidth =
|
|
70
|
+
ReactTestUtils.scryRenderedDOMComponentsWithClass(
|
|
71
|
+
component,
|
|
72
|
+
"responsive-container"
|
|
73
|
+
)[1];
|
|
74
|
+
const isNotFullWidthNode = ReactDOM.findDOMNode(isNotFullWidth);
|
|
75
|
+
expect(ReactTestUtils.isDOMComponent(isNotFullWidthNode)).to.be.true;
|
|
76
|
+
});
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
it("explicitly renders the non-authenticated experience", () => {
|
|
79
|
+
const component = ReactTestUtils.renderIntoDocument(
|
|
80
|
+
<Wrapper>
|
|
81
|
+
<FooterUI isFullWidth={false} />
|
|
82
|
+
</Wrapper>
|
|
83
|
+
);
|
|
84
|
+
const isNotFullWidth =
|
|
85
|
+
ReactTestUtils.scryRenderedDOMComponentsWithClass(
|
|
86
|
+
component,
|
|
87
|
+
"responsive-container"
|
|
88
|
+
)[1];
|
|
89
|
+
const isNotFullWidthNode = ReactDOM.findDOMNode(isNotFullWidth);
|
|
90
|
+
expect(ReactTestUtils.isDOMComponent(isNotFullWidthNode)).to.be.true;
|
|
91
|
+
});
|
|
90
92
|
});
|
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import ReactDOM from
|
|
3
|
-
import ReactTestUtils from
|
|
4
|
-
import { waitFor, cleanup, fireEvent, render } from
|
|
5
|
-
import moxios from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import ReactTestUtils from "react-dom/test-utils";
|
|
4
|
+
import { waitFor, cleanup, fireEvent, render } from "@testing-library/react";
|
|
5
|
+
import moxios from "moxios";
|
|
6
6
|
|
|
7
|
-
import HeaderUI from
|
|
7
|
+
import HeaderUI from "../../components/Header/HeaderUI";
|
|
8
8
|
|
|
9
|
-
describe(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
describe("HeaderUI", () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
moxios.install();
|
|
12
|
+
});
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
moxios.uninstall();
|
|
16
|
+
});
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
it("renders a header", async () => {
|
|
19
|
+
window.location = {
|
|
20
|
+
origin: "localhost:3000",
|
|
21
|
+
};
|
|
22
|
+
moxios.stubRequest(`${window.location.origin}/config/header`, {
|
|
23
|
+
status: 200,
|
|
24
|
+
responseText: JSON.stringify({
|
|
25
|
+
data: {
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
name: "Test Header Menu",
|
|
29
|
+
subtitle: "The test menu item",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
const { container, getByText } = render(<HeaderUI />);
|
|
36
|
+
await waitFor(() =>
|
|
37
|
+
expect(container.querySelector("nav")).toBeDefined()
|
|
38
|
+
);
|
|
39
|
+
expect(getByText("Test Header Menu")).toBeDefined();
|
|
34
40
|
});
|
|
35
|
-
const { container, getByText } = render(<HeaderUI />);
|
|
36
|
-
await waitFor(() => expect(container.querySelector('nav')).toBeDefined());
|
|
37
|
-
expect(getByText('Test Header Menu')).toBeDefined();
|
|
38
|
-
});
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
it("renders a header with login menu", async () => {
|
|
43
|
+
const { container } = render(<HeaderUI isLoginEnabled={true} />);
|
|
44
|
+
await waitFor(() =>
|
|
45
|
+
expect(container.querySelector("nav")).toBeDefined()
|
|
46
|
+
);
|
|
47
|
+
expect(container.querySelector(".login")).toBeDefined();
|
|
48
|
+
});
|
|
45
49
|
});
|
|
@@ -1,73 +1,76 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import ReactDOM from
|
|
3
|
-
import { act, Simulate } from
|
|
4
|
-
import { expect } from
|
|
5
|
-
import { spy } from
|
|
6
|
-
import Infotip from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import { act, Simulate } from "react-dom/test-utils";
|
|
4
|
+
import { expect } from "chai";
|
|
5
|
+
import { spy } from "sinon";
|
|
6
|
+
import Infotip from "../../components/Infotip";
|
|
7
7
|
|
|
8
|
-
describe(
|
|
9
|
-
|
|
8
|
+
describe("Infotip", () => {
|
|
9
|
+
let container;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
document.body.removeChild(container);
|
|
18
|
-
container = null;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('renders an svg icon for tooltip anchor', () => {
|
|
22
|
-
act(() => {
|
|
23
|
-
ReactDOM.render(<Infotip label="tooltip text" />, container);
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
container = document.createElement("div");
|
|
13
|
+
document.body.appendChild(container);
|
|
24
14
|
});
|
|
25
|
-
const svg = container.querySelector('svg');
|
|
26
|
-
expect(svg).to.be.ok;
|
|
27
|
-
});
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
document.body.removeChild(container);
|
|
18
|
+
container = null;
|
|
32
19
|
});
|
|
33
|
-
const paths = container.querySelectorAll('path');
|
|
34
|
-
expect(paths[1].getAttribute('fill')).to.equal('#FFF');
|
|
35
|
-
expect(paths[2].getAttribute('fill')).to.equal('#04838A');
|
|
36
|
-
});
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
it("renders an svg icon for tooltip anchor", () => {
|
|
22
|
+
act(() => {
|
|
23
|
+
ReactDOM.render(<Infotip label="tooltip text" />, container);
|
|
24
|
+
});
|
|
25
|
+
const svg = container.querySelector("svg");
|
|
26
|
+
expect(svg).to.be.ok;
|
|
41
27
|
});
|
|
42
|
-
const button = container.querySelector('button');
|
|
43
|
-
const stopPropagation = spy();
|
|
44
|
-
Simulate.touchStart(button, { stopPropagation });
|
|
45
|
-
expect(stopPropagation.called).to.be.true;
|
|
46
|
-
});
|
|
47
28
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
it("renders white icon when lightIcon prop is true", () => {
|
|
30
|
+
act(() => {
|
|
31
|
+
ReactDOM.render(
|
|
32
|
+
<Infotip lightIcon label="tooltip text" />,
|
|
33
|
+
container
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
const paths = container.querySelectorAll("path");
|
|
37
|
+
expect(paths[1].getAttribute("fill")).to.equal("#FFF");
|
|
38
|
+
expect(paths[2].getAttribute("fill")).to.equal("#04838A");
|
|
51
39
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
|
|
41
|
+
it('overrides "touchstart" events for button', () => {
|
|
42
|
+
act(() => {
|
|
43
|
+
ReactDOM.render(<Infotip label="tooltip text" />, container);
|
|
44
|
+
});
|
|
45
|
+
const button = container.querySelector("button");
|
|
46
|
+
const stopPropagation = spy();
|
|
47
|
+
Simulate.touchStart(button, { stopPropagation });
|
|
48
|
+
expect(stopPropagation.called).to.be.true;
|
|
58
49
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
|
|
51
|
+
it('uses "touchend" event on button to prevent default and toggle focus', () => {
|
|
52
|
+
act(() => {
|
|
53
|
+
ReactDOM.render(<Infotip label="tooltip text" />, container);
|
|
54
|
+
});
|
|
55
|
+
const button = container.querySelector("button");
|
|
56
|
+
const preventDefault = spy();
|
|
57
|
+
const focus = spy(button, "focus");
|
|
58
|
+
const blur = spy(button, "blur");
|
|
59
|
+
Simulate.touchEnd(button, {
|
|
60
|
+
preventDefault,
|
|
61
|
+
});
|
|
62
|
+
expect(preventDefault.calledOnce).to.be.true;
|
|
63
|
+
expect(button.focus.calledOnce).to.be.true;
|
|
64
|
+
expect(button.blur.calledOnce).to.be.false;
|
|
65
|
+
Simulate.touchEnd(button, {
|
|
66
|
+
preventDefault,
|
|
67
|
+
currentTarget: {
|
|
68
|
+
focus,
|
|
69
|
+
blur,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
expect(preventDefault.calledTwice).to.be.true;
|
|
73
|
+
expect(focus.calledOnce).to.be.true;
|
|
74
|
+
expect(blur.calledOnce).to.be.true;
|
|
68
75
|
});
|
|
69
|
-
expect(preventDefault.calledTwice).to.be.true;
|
|
70
|
-
expect(focus.calledOnce).to.be.true;
|
|
71
|
-
expect(blur.calledOnce).to.be.true;
|
|
72
|
-
});
|
|
73
76
|
});
|