@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,182 @@
|
|
|
1
|
+
// Vendor Prefixes
|
|
2
|
+
//
|
|
3
|
+
// All vendor mixins are deprecated as of v3.2.0 due to the introduction of
|
|
4
|
+
// Autoprefixer in our Gruntfile. They have been removed in v4.
|
|
5
|
+
|
|
6
|
+
// - Animations
|
|
7
|
+
// - Backface visibility
|
|
8
|
+
// - Box shadow
|
|
9
|
+
// - Box sizing
|
|
10
|
+
// - Content columns
|
|
11
|
+
// - Hyphens
|
|
12
|
+
// - Placeholder text
|
|
13
|
+
// - Transformations
|
|
14
|
+
// - Transitions
|
|
15
|
+
// - User Select
|
|
16
|
+
|
|
17
|
+
// Drop shadows
|
|
18
|
+
//
|
|
19
|
+
// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
|
|
20
|
+
// supported browsers that have box shadow capabilities now support it.
|
|
21
|
+
@mixin box-shadow($shadow...) {
|
|
22
|
+
-webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
|
|
23
|
+
box-shadow: $shadow;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Box sizing
|
|
27
|
+
@mixin box-sizing($boxmodel) {
|
|
28
|
+
-webkit-box-sizing: $boxmodel;
|
|
29
|
+
-moz-box-sizing: $boxmodel;
|
|
30
|
+
box-sizing: $boxmodel;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// CSS3 Content Columns
|
|
34
|
+
@mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
|
|
35
|
+
-webkit-column-count: $column-count;
|
|
36
|
+
-moz-column-count: $column-count;
|
|
37
|
+
column-count: $column-count;
|
|
38
|
+
-webkit-column-gap: $column-gap;
|
|
39
|
+
-moz-column-gap: $column-gap;
|
|
40
|
+
column-gap: $column-gap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Placeholder text
|
|
44
|
+
@mixin placeholder($color: $input-color-placeholder) {
|
|
45
|
+
// Firefox
|
|
46
|
+
&::-moz-placeholder {
|
|
47
|
+
color: $color;
|
|
48
|
+
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:-ms-input-placeholder {
|
|
52
|
+
color: $color;
|
|
53
|
+
} // Internet Explorer 10+
|
|
54
|
+
|
|
55
|
+
&::-webkit-input-placeholder {
|
|
56
|
+
color: $color;
|
|
57
|
+
} // Safari and Chrome
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Transformations
|
|
61
|
+
@mixin scale($ratio...) {
|
|
62
|
+
-webkit-transform: scale($ratio);
|
|
63
|
+
-ms-transform: scale($ratio); // IE9 only
|
|
64
|
+
-o-transform: scale($ratio);
|
|
65
|
+
transform: scale($ratio);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@mixin scaleX($ratio) {
|
|
69
|
+
-webkit-transform: scaleX($ratio);
|
|
70
|
+
-ms-transform: scaleX($ratio); // IE9 only
|
|
71
|
+
-o-transform: scaleX($ratio);
|
|
72
|
+
transform: scaleX($ratio);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@mixin scaleY($ratio) {
|
|
76
|
+
-webkit-transform: scaleY($ratio);
|
|
77
|
+
-ms-transform: scaleY($ratio); // IE9 only
|
|
78
|
+
-o-transform: scaleY($ratio);
|
|
79
|
+
transform: scaleY($ratio);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@mixin skew($x, $y) {
|
|
83
|
+
-webkit-transform: skewX($x) skewY($y);
|
|
84
|
+
-ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
|
|
85
|
+
-o-transform: skewX($x) skewY($y);
|
|
86
|
+
transform: skewX($x) skewY($y);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@mixin translate($x, $y) {
|
|
90
|
+
-webkit-transform: translate($x, $y);
|
|
91
|
+
-ms-transform: translate($x, $y); // IE9 only
|
|
92
|
+
-o-transform: translate($x, $y);
|
|
93
|
+
transform: translate($x, $y);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@mixin translate3d($x, $y, $z) {
|
|
97
|
+
-webkit-transform: translate3d($x, $y, $z);
|
|
98
|
+
transform: translate3d($x, $y, $z);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@mixin rotate($degrees) {
|
|
102
|
+
-webkit-transform: rotate($degrees);
|
|
103
|
+
-ms-transform: rotate($degrees); // IE9 only
|
|
104
|
+
-o-transform: rotate($degrees);
|
|
105
|
+
transform: rotate($degrees);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@mixin rotateX($degrees) {
|
|
109
|
+
-webkit-transform: rotateX($degrees);
|
|
110
|
+
-ms-transform: rotateX($degrees); // IE9 only
|
|
111
|
+
-o-transform: rotateX($degrees);
|
|
112
|
+
transform: rotateX($degrees);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@mixin rotateY($degrees) {
|
|
116
|
+
-webkit-transform: rotateY($degrees);
|
|
117
|
+
-ms-transform: rotateY($degrees); // IE9 only
|
|
118
|
+
-o-transform: rotateY($degrees);
|
|
119
|
+
transform: rotateY($degrees);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@mixin perspective($perspective) {
|
|
123
|
+
-webkit-perspective: $perspective;
|
|
124
|
+
-moz-perspective: $perspective;
|
|
125
|
+
perspective: $perspective;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@mixin perspective-origin($perspective) {
|
|
129
|
+
-webkit-perspective-origin: $perspective;
|
|
130
|
+
-moz-perspective-origin: $perspective;
|
|
131
|
+
perspective-origin: $perspective;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@mixin transform-origin($origin) {
|
|
135
|
+
-webkit-transform-origin: $origin;
|
|
136
|
+
-moz-transform-origin: $origin;
|
|
137
|
+
-ms-transform-origin: $origin; // IE9 only
|
|
138
|
+
transform-origin: $origin;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Transitions
|
|
142
|
+
@mixin transition($transition...) {
|
|
143
|
+
-webkit-transition: $transition;
|
|
144
|
+
-o-transition: $transition;
|
|
145
|
+
transition: $transition;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
@mixin transition-property($transition-property...) {
|
|
149
|
+
-webkit-transition-property: $transition-property;
|
|
150
|
+
transition-property: $transition-property;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@mixin transition-delay($transition-delay) {
|
|
154
|
+
-webkit-transition-delay: $transition-delay;
|
|
155
|
+
transition-delay: $transition-delay;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@mixin transition-duration($transition-duration...) {
|
|
159
|
+
-webkit-transition-duration: $transition-duration;
|
|
160
|
+
transition-duration: $transition-duration;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@mixin transition-timing-function($timing-function) {
|
|
164
|
+
-webkit-transition-timing-function: $timing-function;
|
|
165
|
+
transition-timing-function: $timing-function;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@mixin transition-transform($transition...) {
|
|
169
|
+
-webkit-transition: -webkit-transform $transition;
|
|
170
|
+
-moz-transition: -moz-transform $transition;
|
|
171
|
+
-o-transition: -o-transform $transition;
|
|
172
|
+
transition: transform $transition;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// User select
|
|
176
|
+
// For selecting text on the page
|
|
177
|
+
@mixin user-select($select) {
|
|
178
|
+
-webkit-user-select: $select;
|
|
179
|
+
-moz-user-select: $select;
|
|
180
|
+
-ms-user-select: $select; // IE10+
|
|
181
|
+
user-select: $select;
|
|
182
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@mixin breakpoint($class) {
|
|
2
|
+
@if $class == xs {
|
|
3
|
+
@media (max-width: 767px) {
|
|
4
|
+
@content;
|
|
5
|
+
}
|
|
6
|
+
} @else if $class == sm {
|
|
7
|
+
@media (min-width: 768px) {
|
|
8
|
+
@content;
|
|
9
|
+
}
|
|
10
|
+
} @else if $class == md {
|
|
11
|
+
@media (min-width: 992px) {
|
|
12
|
+
@content;
|
|
13
|
+
}
|
|
14
|
+
} @else if $class == lg {
|
|
15
|
+
@media (min-width: 1200px) {
|
|
16
|
+
@content;
|
|
17
|
+
}
|
|
18
|
+
} @else if $class == xl {
|
|
19
|
+
@media (min-width: 1400px) {
|
|
20
|
+
@content;
|
|
21
|
+
}
|
|
22
|
+
} @else {
|
|
23
|
+
@warn 'Breakpoint mixin supports: xs, sm, md, lg, xl';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin typography($family, $size, $lineHeight, $color) {
|
|
28
|
+
color: $color;
|
|
29
|
+
font-family: $family, sans-serif;
|
|
30
|
+
font-size: $size;
|
|
31
|
+
line-height: $lineHeight;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin hover($color) {
|
|
36
|
+
&:hover {
|
|
37
|
+
color: $color;
|
|
38
|
+
fill: $color;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin stroke-hover($color) {
|
|
43
|
+
&:hover {
|
|
44
|
+
stroke: $color;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.is-hidden {
|
|
2
|
+
display: none !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.is-rotated-right {
|
|
6
|
+
transform: rotate(90deg);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.text-pad-both {
|
|
10
|
+
padding: 0 0.3em;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.text-pad-right {
|
|
14
|
+
padding: 0 0.3em 0 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.text-pad-left {
|
|
18
|
+
padding: 0 0 0 0.3em;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.graphic-spaced-both {
|
|
22
|
+
padding: 20px 0 40px;
|
|
23
|
+
@include breakpoint(sm) {
|
|
24
|
+
padding: 30px 0 40px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.flex-centered-vertical {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
|
|
32
|
+
h2 {
|
|
33
|
+
margin-top: 0;
|
|
34
|
+
}
|
|
35
|
+
@include breakpoint(sm) {
|
|
36
|
+
// TODO: fix for any height
|
|
37
|
+
height: 288px;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
margin-bottom: 3em;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.flex-centered-horizontal {
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.flex-row {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
justify-content: space-between;
|
|
51
|
+
padding: 1em 0;
|
|
52
|
+
@include breakpoint(sm) {
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.panel,
|
|
57
|
+
.well {
|
|
58
|
+
@include breakpoint(sm) {
|
|
59
|
+
width: calc(50% - 10px);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.sr-only {
|
|
65
|
+
position: absolute;
|
|
66
|
+
width: 1px;
|
|
67
|
+
height: 1px;
|
|
68
|
+
padding: 0;
|
|
69
|
+
margin: -1px;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
clip: rect(0, 0, 0, 0);
|
|
72
|
+
border: 0;
|
|
73
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import Accordion from '../../components/Accordion';
|
|
4
|
+
|
|
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
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import ErrorUI from '../../components/Error/ErrorUI';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
describe('ErrorUI', () => {
|
|
7
|
+
it('renders a list of errors in HTML', () => {
|
|
8
|
+
const code = '404';
|
|
9
|
+
const type = 'Bad thing happened';
|
|
10
|
+
const message = [
|
|
11
|
+
{ contentTitle: 'Not found', content: 'test' },
|
|
12
|
+
{ contentTitle: 'Image not found', content: 'test number 2' },
|
|
13
|
+
];
|
|
14
|
+
const { debug, container } = render(
|
|
15
|
+
<ErrorUI type={type} code={code} message={message} />
|
|
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
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
|
|
7
|
+
class Wrapper extends Component {
|
|
8
|
+
render() {
|
|
9
|
+
return this.props.children;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
});
|
|
61
|
+
|
|
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 = ReactTestUtils.scryRenderedDOMComponentsWithClass(
|
|
70
|
+
component,
|
|
71
|
+
'responsive-container'
|
|
72
|
+
)[1];
|
|
73
|
+
const isNotFullWidthNode = ReactDOM.findDOMNode(isNotFullWidth);
|
|
74
|
+
expect(ReactTestUtils.isDOMComponent(isNotFullWidthNode)).to.be.true;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('explicitly renders the non-authenticated experience', () => {
|
|
78
|
+
const component = ReactTestUtils.renderIntoDocument(
|
|
79
|
+
<Wrapper>
|
|
80
|
+
<FooterUI isFullWidth={false} />
|
|
81
|
+
</Wrapper>
|
|
82
|
+
);
|
|
83
|
+
const isNotFullWidth = ReactTestUtils.scryRenderedDOMComponentsWithClass(
|
|
84
|
+
component,
|
|
85
|
+
'responsive-container'
|
|
86
|
+
)[1];
|
|
87
|
+
const isNotFullWidthNode = ReactDOM.findDOMNode(isNotFullWidth);
|
|
88
|
+
expect(ReactTestUtils.isDOMComponent(isNotFullWidthNode)).to.be.true;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
|
|
7
|
+
import HeaderUI from '../../components/Header/HeaderUI';
|
|
8
|
+
|
|
9
|
+
describe('HeaderUI', () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
moxios.install();
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
afterEach(() => {
|
|
15
|
+
moxios.uninstall();
|
|
16
|
+
});
|
|
17
|
+
|
|
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(() => expect(container.querySelector('nav')).toBeDefined());
|
|
37
|
+
expect(getByText('Test Header Menu')).toBeDefined();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('renders a header with login menu', async () => {
|
|
41
|
+
const { container } = render(<HeaderUI isLoginEnabled={true} />);
|
|
42
|
+
await waitFor(() => expect(container.querySelector('nav')).toBeDefined());
|
|
43
|
+
expect(container.querySelector('.login')).toBeDefined();
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
|
|
8
|
+
describe('Infotip', () => {
|
|
9
|
+
let container;
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
container = document.createElement('div');
|
|
13
|
+
document.body.appendChild(container);
|
|
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);
|
|
24
|
+
});
|
|
25
|
+
const svg = container.querySelector('svg');
|
|
26
|
+
expect(svg).to.be.ok;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('renders white icon when lightIcon prop is true', () => {
|
|
30
|
+
act(() => {
|
|
31
|
+
ReactDOM.render(<Infotip lightIcon label="tooltip text" />, container);
|
|
32
|
+
});
|
|
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
|
+
|
|
38
|
+
it('overrides "touchstart" events for button', () => {
|
|
39
|
+
act(() => {
|
|
40
|
+
ReactDOM.render(<Infotip label="tooltip text" />, container);
|
|
41
|
+
});
|
|
42
|
+
const button = container.querySelector('button');
|
|
43
|
+
const stopPropagation = spy();
|
|
44
|
+
Simulate.touchStart(button, { stopPropagation });
|
|
45
|
+
expect(stopPropagation.called).to.be.true;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('uses "touchend" event on button to prevent default and toggle focus', () => {
|
|
49
|
+
act(() => {
|
|
50
|
+
ReactDOM.render(<Infotip label="tooltip text" />, container);
|
|
51
|
+
});
|
|
52
|
+
const button = container.querySelector('button');
|
|
53
|
+
const preventDefault = spy();
|
|
54
|
+
const focus = spy(button, 'focus');
|
|
55
|
+
const blur = spy(button, 'blur');
|
|
56
|
+
Simulate.touchEnd(button, {
|
|
57
|
+
preventDefault,
|
|
58
|
+
});
|
|
59
|
+
expect(preventDefault.calledOnce).to.be.true;
|
|
60
|
+
expect(button.focus.calledOnce).to.be.true;
|
|
61
|
+
expect(button.blur.calledOnce).to.be.false;
|
|
62
|
+
Simulate.touchEnd(button, {
|
|
63
|
+
preventDefault,
|
|
64
|
+
currentTarget: {
|
|
65
|
+
focus,
|
|
66
|
+
blur,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
expect(preventDefault.calledTwice).to.be.true;
|
|
70
|
+
expect(focus.calledOnce).to.be.true;
|
|
71
|
+
expect(blur.calledOnce).to.be.true;
|
|
72
|
+
});
|
|
73
|
+
});
|