@dnanpm/styleguide 3.8.1 → 3.8.2
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/README.md +15 -8
- package/build/cjs/components/Accordion/Accordion.js +7 -12
- package/build/cjs/components/AccordionItem/AccordionItem.js +30 -35
- package/build/cjs/components/AmountSelector/AmountSelector.js +25 -29
- package/build/cjs/components/Box/Box.js +8 -13
- package/build/cjs/components/Button/Button.js +28 -33
- package/build/cjs/components/Button/ButtonArrow.js +16 -21
- package/build/cjs/components/Button/ButtonClose.js +4 -8
- package/build/cjs/components/Button/ButtonIcon.js +17 -22
- package/build/cjs/components/Button/ButtonPrimary.js +13 -17
- package/build/cjs/components/Button/ButtonRound.js +6 -11
- package/build/cjs/components/Button/ButtonSecondary.js +13 -17
- package/build/cjs/components/Carousel/Carousel.js +43 -47
- package/build/cjs/components/Checkbox/Checkbox.js +23 -27
- package/build/cjs/components/Chip/Chip.js +11 -16
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +76 -82
- package/build/cjs/components/Divider/Divider.js +5 -10
- package/build/cjs/components/DnaLogo/DnaLogo.js +14 -18
- package/build/cjs/components/Drawer/Drawer.js +47 -52
- package/build/cjs/components/EmptyState/EmptyState.js +8 -12
- package/build/cjs/components/Expander/Expander.js +13 -17
- package/build/cjs/components/Floater/Floater.js +3 -8
- package/build/cjs/components/Footer/Components/FooterComponents.js +58 -64
- package/build/cjs/components/Footer/Footer.js +63 -67
- package/build/cjs/components/Footer/context/FooterContext.js +2 -2
- package/build/cjs/components/Icon/Icon.js +9 -13
- package/build/cjs/components/Icons/Small/hlArrowBackSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlArrowForwardSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlArrowUnderSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlCalendarSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronDownSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronLeftSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronRightSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlChevronUpSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlClockSmall.js +4 -8
- package/build/cjs/components/Icons/Small/hlDownloadSmall.js +5 -9
- package/build/cjs/components/Icons/Small/hlExternalSmall.js +3 -7
- package/build/cjs/components/Icons/Small/hlUploadSmall.js +5 -9
- package/build/cjs/components/Icons/Social/facebook.js +3 -7
- package/build/cjs/components/Icons/Social/instagram.js +3 -7
- package/build/cjs/components/Icons/Social/linkedin.js +3 -7
- package/build/cjs/components/Icons/Social/tiktok.js +3 -7
- package/build/cjs/components/Icons/Social/twitter.js +3 -7
- package/build/cjs/components/Icons/Social/youtube.js +3 -7
- package/build/cjs/components/Icons/hl404.js +3 -7
- package/build/cjs/components/Icons/hl4gSim.js +3 -7
- package/build/cjs/components/Icons/hl5gSim.js +3 -7
- package/build/cjs/components/Icons/hlBattery.js +5 -9
- package/build/cjs/components/Icons/hlBell.js +3 -7
- package/build/cjs/components/Icons/hlCableTVCard.js +3 -7
- package/build/cjs/components/Icons/hlCalendar.js +14 -18
- package/build/cjs/components/Icons/hlCall.js +3 -7
- package/build/cjs/components/Icons/hlCameraBack.js +5 -9
- package/build/cjs/components/Icons/hlCameraFront.js +4 -8
- package/build/cjs/components/Icons/hlCart.js +5 -9
- package/build/cjs/components/Icons/hlCartEmpty.js +5 -9
- package/build/cjs/components/Icons/hlChat.js +6 -10
- package/build/cjs/components/Icons/hlCheck.js +3 -7
- package/build/cjs/components/Icons/hlChevronDown.js +3 -7
- package/build/cjs/components/Icons/hlChevronLeft.js +3 -7
- package/build/cjs/components/Icons/hlChevronRight.js +3 -7
- package/build/cjs/components/Icons/hlChevronUp.js +3 -7
- package/build/cjs/components/Icons/hlCompensation.js +3 -7
- package/build/cjs/components/Icons/hlCookie.js +3 -7
- package/build/cjs/components/Icons/hlCopy.js +4 -8
- package/build/cjs/components/Icons/hlCoupon.js +5 -9
- package/build/cjs/components/Icons/hlDelivery.js +3 -7
- package/build/cjs/components/Icons/hlDigiturva.js +3 -7
- package/build/cjs/components/Icons/hlDisplaySize.js +5 -9
- package/build/cjs/components/Icons/hlDocument.js +4 -8
- package/build/cjs/components/Icons/hlDownload.js +5 -9
- package/build/cjs/components/Icons/hlEnvelope.js +3 -7
- package/build/cjs/components/Icons/hlError.js +5 -9
- package/build/cjs/components/Icons/hlEuro.js +3 -7
- package/build/cjs/components/Icons/hlExclamationMark.js +3 -7
- package/build/cjs/components/Icons/hlExpand.js +3 -7
- package/build/cjs/components/Icons/hlExternal.js +3 -7
- package/build/cjs/components/Icons/hlEyeClosed.js +3 -7
- package/build/cjs/components/Icons/hlEyeOpen.js +4 -8
- package/build/cjs/components/Icons/hlFaceId.js +3 -7
- package/build/cjs/components/Icons/hlFastDelivery.js +3 -7
- package/build/cjs/components/Icons/hlFingerprint.js +7 -11
- package/build/cjs/components/Icons/hlGlobe.js +3 -7
- package/build/cjs/components/Icons/hlHeadphones.js +3 -7
- package/build/cjs/components/Icons/hlHeadset.js +5 -9
- package/build/cjs/components/Icons/hlHeart.js +3 -7
- package/build/cjs/components/Icons/hlHome.js +3 -7
- package/build/cjs/components/Icons/hlHub.js +4 -8
- package/build/cjs/components/Icons/hlImage.js +3 -7
- package/build/cjs/components/Icons/hlInfo.js +5 -9
- package/build/cjs/components/Icons/hlInstallment.js +4 -8
- package/build/cjs/components/Icons/hlIotSim.js +4 -8
- package/build/cjs/components/Icons/hlLaptop.js +3 -7
- package/build/cjs/components/Icons/hlLink.js +4 -8
- package/build/cjs/components/Icons/hlLiveVideo.js +3 -7
- package/build/cjs/components/Icons/hlLock.js +5 -9
- package/build/cjs/components/Icons/hlMagnifyingGlass.js +4 -8
- package/build/cjs/components/Icons/hlMarker.js +4 -8
- package/build/cjs/components/Icons/hlMemory.js +4 -8
- package/build/cjs/components/Icons/hlMenu.js +3 -7
- package/build/cjs/components/Icons/hlMinimize.js +3 -7
- package/build/cjs/components/Icons/hlMinus.js +3 -7
- package/build/cjs/components/Icons/hlMobileData.js +3 -7
- package/build/cjs/components/Icons/hlMobilePayment.js +5 -9
- package/build/cjs/components/Icons/hlModem.js +7 -11
- package/build/cjs/components/Icons/hlMore.js +5 -9
- package/build/cjs/components/Icons/hlOs.js +4 -8
- package/build/cjs/components/Icons/hlPackage.js +3 -7
- package/build/cjs/components/Icons/hlPaperclip.js +3 -7
- package/build/cjs/components/Icons/hlPaytime.js +3 -7
- package/build/cjs/components/Icons/hlPen.js +3 -7
- package/build/cjs/components/Icons/hlPerson.js +3 -7
- package/build/cjs/components/Icons/hlPhone.js +4 -8
- package/build/cjs/components/Icons/hlPlaylist.js +3 -7
- package/build/cjs/components/Icons/hlPlus.js +4 -8
- package/build/cjs/components/Icons/hlPrepaid.js +3 -7
- package/build/cjs/components/Icons/hlProcessor.js +4 -8
- package/build/cjs/components/Icons/hlServices.js +3 -7
- package/build/cjs/components/Icons/hlSettings.js +3 -7
- package/build/cjs/components/Icons/hlShield.js +4 -8
- package/build/cjs/components/Icons/hlSim.js +4 -8
- package/build/cjs/components/Icons/hlSimSimple.js +5 -9
- package/build/cjs/components/Icons/hlSmile.js +6 -10
- package/build/cjs/components/Icons/hlSpeechBubble.js +4 -8
- package/build/cjs/components/Icons/hlSquaretrade.js +3 -7
- package/build/cjs/components/Icons/hlStar.js +3 -7
- package/build/cjs/components/Icons/hlStarFilled.js +3 -7
- package/build/cjs/components/Icons/hlTrash.js +4 -8
- package/build/cjs/components/Icons/hlTv.js +3 -7
- package/build/cjs/components/Icons/hlUnlock.js +4 -8
- package/build/cjs/components/Icons/hlUpload.js +5 -9
- package/build/cjs/components/Icons/hlWarning.js +5 -9
- package/build/cjs/components/Icons/hlWifi.js +5 -9
- package/build/cjs/components/Icons/hlWrench.js +3 -7
- package/build/cjs/components/Icons/hlX.js +3 -7
- package/build/cjs/components/Icons/index.js +109 -111
- package/build/cjs/components/InfoDialog/InfoDialog.js +18 -22
- package/build/cjs/components/Input/Input.js +44 -48
- package/build/cjs/components/Label/Label.js +14 -18
- package/build/cjs/components/LabelText/LabelText.js +11 -15
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +23 -27
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +59 -63
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +11 -15
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LinkModifier.js +6 -10
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LoginTooltip.js +5 -9
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +2 -3
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +25 -29
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +11 -11
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +6 -10
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +50 -54
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/PageSearch.js +5 -9
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +35 -39
- package/build/cjs/components/MainHeaderNavigation/context/MobileMenuContext.js +1 -1
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.js +1 -1
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.d.ts +5 -5
- package/build/cjs/components/MainHeaderNavigation/globalNavStyles.js +48 -50
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +14 -18
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +49 -53
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +44 -48
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +11 -15
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +7 -11
- package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.js +5 -9
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +21 -25
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +1 -1
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +7 -7
- package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.js +6 -10
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +52 -56
- package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.js +5 -9
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +20 -24
- package/build/cjs/components/MainNavigation/MainNavigation.js +20 -24
- package/build/cjs/components/MainNavigation/context/MobileMenuContext.js +1 -1
- package/build/cjs/components/MainNavigation/context/NavContext.js +1 -1
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +5 -5
- package/build/cjs/components/MainNavigation/globalNavStyles.js +12 -14
- package/build/cjs/components/Modal/Modal.js +20 -25
- package/build/cjs/components/Notification/Notification.js +17 -22
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +8 -12
- package/build/cjs/components/Overlay/Overlay.d.ts +49 -0
- package/build/cjs/components/Overlay/Overlay.js +80 -0
- package/build/cjs/components/Pill/Pill.js +19 -24
- package/build/cjs/components/PixelLoader/PixelLoader.js +9 -13
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.d.ts +10 -0
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.js +84 -53
- package/build/cjs/components/PriorityNavigationItem/PriorityNavigationItem.js +20 -15
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +30 -34
- package/build/cjs/components/RadioButton/RadioButton.js +11 -15
- package/build/cjs/components/ReadMore/ReadMore.js +13 -17
- package/build/cjs/components/Search/Search.js +16 -20
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +53 -57
- package/build/cjs/components/Selectbox/Selectbox.js +44 -49
- package/build/cjs/components/Switch/Switch.js +18 -19
- package/build/cjs/components/Tab/Tab.js +29 -33
- package/build/cjs/components/Tabs/Tabs.js +15 -19
- package/build/cjs/components/Textarea/Textarea.js +29 -33
- package/build/cjs/components/Toaster/Toaster.js +19 -24
- package/build/cjs/components/Tooltip/Tooltip.js +21 -25
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +2 -4
- package/build/cjs/components/TooltipMenu/TooltipMenu.js +20 -24
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/hooks/useCloseOutsideOrElementClicked.js +1 -1
- package/build/cjs/hooks/useDebounce.js +1 -1
- package/build/cjs/hooks/useDocHeight.js +2 -2
- package/build/cjs/hooks/useOutsideClick.js +1 -1
- package/build/cjs/hooks/useResizeObserver.d.ts +1 -1
- package/build/cjs/hooks/useResizeObserver.js +1 -1
- package/build/cjs/hooks/useScrollPosition.d.ts +3 -1
- package/build/cjs/hooks/useScrollPosition.js +1 -1
- package/build/cjs/hooks/useWindowSize.js +1 -1
- package/build/cjs/index.js +164 -164
- package/build/cjs/themes/globalStyles.js +78 -80
- package/build/cjs/themes/gridTheme.js +1 -1
- package/build/cjs/themes/styled.js +2 -2
- package/build/cjs/themes/theme.js +11 -11
- package/build/cjs/themes/themeComponents/base.js +2 -2
- package/build/cjs/themes/themeComponents/breakpoints.js +1 -1
- package/build/cjs/themes/themeComponents/color.js +1 -1
- package/build/cjs/themes/themeComponents/fontFamily.js +1 -1
- package/build/cjs/themes/themeComponents/fontSize.js +14 -14
- package/build/cjs/themes/themeComponents/fontWeight.js +1 -1
- package/build/cjs/themes/themeComponents/forms.js +2 -2
- package/build/cjs/themes/themeComponents/lineHeight.js +14 -14
- package/build/cjs/themes/themeComponents/navigation.js +1 -1
- package/build/cjs/themes/themeComponents/radius.js +1 -1
- package/build/cjs/utils/common.d.ts +1 -1
- package/build/cjs/utils/common.js +4 -4
- package/build/cjs/utils/createStyled.d.ts +2 -163
- package/build/cjs/utils/createStyled.js +4 -5
- package/build/cjs/utils/styledUtils.js +2 -4
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +2 -3
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -2
- package/build/es/components/MainHeaderNavigation/globalNavStyles.d.ts +5 -5
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +1 -1
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +1 -1
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +5 -5
- package/build/es/components/Overlay/Overlay.d.ts +49 -0
- package/build/es/components/Overlay/Overlay.js +76 -0
- package/build/es/components/PriorityNavigation/PriorityNavigation.d.ts +10 -0
- package/build/es/components/PriorityNavigation/PriorityNavigation.js +59 -24
- package/build/es/components/PriorityNavigationItem/PriorityNavigationItem.js +10 -1
- package/build/es/components/index.d.ts +1 -0
- package/build/es/hooks/useResizeObserver.d.ts +1 -1
- package/build/es/hooks/useScrollPosition.d.ts +3 -1
- package/build/es/index.js +1 -0
- package/build/es/themes/themeComponents/base.js +1 -1
- package/build/es/themes/themeComponents/fontSize.js +13 -13
- package/build/es/themes/themeComponents/forms.js +1 -1
- package/build/es/themes/themeComponents/lineHeight.js +13 -13
- package/build/es/utils/common.d.ts +1 -1
- package/build/es/utils/createStyled.d.ts +2 -163
- package/package.json +43 -43
- package/CHANGELOG.md +0 -561
package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ declare const TooltipWrapper: import("styled-components").StyledComponent<"butto
|
|
|
162
162
|
};
|
|
163
163
|
}, {
|
|
164
164
|
collapseSize: number;
|
|
165
|
-
isHighlighted?: boolean
|
|
165
|
+
isHighlighted?: boolean;
|
|
166
166
|
}, never>;
|
|
167
167
|
export default TooltipWrapper;
|
|
168
168
|
export { TooltipWrapper };
|
package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js
CHANGED
|
@@ -6,14 +6,14 @@ var styled = require('../../../themes/styled.js');
|
|
|
6
6
|
var theme = require('../../../themes/theme.js');
|
|
7
7
|
var navigation = require('../../../themes/themeComponents/navigation.js');
|
|
8
8
|
|
|
9
|
-
const TooltipWrapper = styled
|
|
9
|
+
const TooltipWrapper = styled.default.button `
|
|
10
10
|
position: relative;
|
|
11
11
|
border: none;
|
|
12
12
|
margin: 0;
|
|
13
13
|
padding: 0;
|
|
14
14
|
overflow: visible;
|
|
15
15
|
background: transparent;
|
|
16
|
-
color: ${p => (p.isHighlighted ? theme
|
|
16
|
+
color: ${p => (p.isHighlighted ? theme.default.color.text.pink : 'inherit')};
|
|
17
17
|
font: inherit;
|
|
18
18
|
line-height: normal;
|
|
19
19
|
-webkit-font-smoothing: inherit;
|
|
@@ -24,14 +24,14 @@ const TooltipWrapper = styled["default"].button `
|
|
|
24
24
|
&:hover {
|
|
25
25
|
span.dnasg-icon > svg,
|
|
26
26
|
> span {
|
|
27
|
-
color: ${p => (p.isHighlighted ? theme
|
|
27
|
+
color: ${p => (p.isHighlighted ? theme.default.color.text.pink : theme.default.color.text.black)};
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
&:active,
|
|
31
31
|
&:focus {
|
|
32
32
|
span.dnasg-icon > svg,
|
|
33
33
|
> span {
|
|
34
|
-
color: ${theme
|
|
34
|
+
color: ${theme.default.color.text.pink};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
span.dnasg-icon > svg {
|
|
@@ -53,10 +53,10 @@ const TooltipWrapper = styled["default"].button `
|
|
|
53
53
|
overflow: hidden;
|
|
54
54
|
max-width: ${navigation.IconContainerWidth};
|
|
55
55
|
}
|
|
56
|
-
font-size: ${theme
|
|
57
|
-
font-weight: ${theme
|
|
56
|
+
font-size: ${theme.default.fontSize.xs};
|
|
57
|
+
font-weight: ${theme.default.fontWeight.book};
|
|
58
58
|
}
|
|
59
59
|
`;
|
|
60
60
|
|
|
61
61
|
exports.TooltipWrapper = TooltipWrapper;
|
|
62
|
-
exports
|
|
62
|
+
exports.default = TooltipWrapper;
|
|
@@ -10,17 +10,13 @@ var NotificationBadge = require('../../NotificationBadge/NotificationBadge.js');
|
|
|
10
10
|
var NavContext = require('../context/NavContext.js');
|
|
11
11
|
var MainNavTooltipMenu = require('./MainNavTooltipMenu.js');
|
|
12
12
|
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
|
|
17
13
|
const MinicartTooltip = ({ minicartAmount, minicartLabel }) => {
|
|
18
14
|
const globalStateString = 'minicart';
|
|
19
|
-
const { navZIndex, minicartComponent: MinicartComponent } = React.useContext(NavContext
|
|
20
|
-
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
minicartAmount > 0 && (
|
|
15
|
+
const { navZIndex, minicartComponent: MinicartComponent } = React.useContext(NavContext.default);
|
|
16
|
+
return (React.createElement(MainNavTooltipMenu.default, { zIndex: navZIndex + 1, contentWidth: "35rem", tooltipRight: "5rem", contentComponent: MinicartComponent, globalStateString: globalStateString, fullWidthBreakpoint: theme.default.breakpoints.md, closeWhenTagClicked: ['a', 'button'] },
|
|
17
|
+
React.createElement(Icon.default, { icon: icons.Cart, size: "2rem" }),
|
|
18
|
+
React.createElement("span", null, minicartLabel),
|
|
19
|
+
minicartAmount > 0 && (React.createElement(NotificationBadge.default, { top: "-5px", right: "5px", "data-testid": "header-minicart-amount" }, minicartAmount))));
|
|
24
20
|
};
|
|
25
21
|
|
|
26
|
-
exports
|
|
22
|
+
exports.default = MinicartTooltip;
|
|
@@ -16,16 +16,12 @@ var globalNavStyles = require('../globalNavStyles.js');
|
|
|
16
16
|
var BusinessMenu = require('./BusinessMenu.js');
|
|
17
17
|
var LinkModifier = require('./LinkModifier.js');
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
|
|
23
|
-
const MobileMenuWrapper = styled["default"].div `
|
|
19
|
+
const MobileMenuWrapper = styled.default.div `
|
|
24
20
|
width: ${100 * navigation.menuLevelsAmount}%;
|
|
25
21
|
`;
|
|
26
22
|
const mobileMenuWithRibbon = `calc(100vh - ${navigation.mobileNavMaxHeight} - ${navigation.ribbonHeight})`;
|
|
27
23
|
const mobileMenuNoRibbon = `calc(100vh - ${navigation.mobileNavMaxHeight})`;
|
|
28
|
-
const MobileMenuContainer = styled
|
|
24
|
+
const MobileMenuContainer = styled.default.div `
|
|
29
25
|
width: 100%;
|
|
30
26
|
position: absolute;
|
|
31
27
|
top: ${navigation.mobileNavMaxHeight};
|
|
@@ -33,7 +29,7 @@ const MobileMenuContainer = styled["default"].div `
|
|
|
33
29
|
overflow: hidden;
|
|
34
30
|
overflow-y: auto;
|
|
35
31
|
transition: max-height 0.2s ease-in-out;
|
|
36
|
-
background: ${theme
|
|
32
|
+
background: ${theme.default.color.background.white.default};
|
|
37
33
|
max-height: ${mobileMenuNoRibbon};
|
|
38
34
|
height: ${mobileMenuNoRibbon};
|
|
39
35
|
${styledUtils.media.md `
|
|
@@ -42,9 +38,9 @@ const MobileMenuContainer = styled["default"].div `
|
|
|
42
38
|
height: ${mobileMenuWithRibbon};
|
|
43
39
|
`};
|
|
44
40
|
`;
|
|
45
|
-
const MenuLinkBackLink = styled
|
|
46
|
-
const MobileMenu = styled
|
|
47
|
-
background: ${theme
|
|
41
|
+
const MenuLinkBackLink = styled.default(globalNavStyles.MenuLink) ``;
|
|
42
|
+
const MobileMenu = styled.default.div `
|
|
43
|
+
background: ${theme.default.color.background.white.default};
|
|
48
44
|
${globalNavStyles.MenuList} {
|
|
49
45
|
display: block;
|
|
50
46
|
float: left;
|
|
@@ -55,14 +51,14 @@ const MobileMenu = styled["default"].div `
|
|
|
55
51
|
min-height: ${mobileMenuWithRibbon};
|
|
56
52
|
`};
|
|
57
53
|
&:first-of-type {
|
|
58
|
-
background: ${theme
|
|
54
|
+
background: ${theme.default.color.background.white.default};
|
|
59
55
|
> ${globalNavStyles.MenuItem} > ${globalNavStyles.MenuLink} {
|
|
60
|
-
font-weight: ${theme
|
|
61
|
-
border-bottom: 1px solid ${theme
|
|
56
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
57
|
+
border-bottom: 1px solid ${theme.default.color.line.L04};
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
&:not(:first-of-type) {
|
|
65
|
-
background: ${theme
|
|
61
|
+
background: ${theme.default.color.background.sand.default};
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
${globalNavStyles.MenuItem} {
|
|
@@ -73,24 +69,24 @@ const MobileMenu = styled["default"].div `
|
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
${globalNavStyles.MenuLink}, ${globalNavStyles.MenuLinkWithChildren} {
|
|
76
|
-
line-height: ${theme
|
|
77
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
78
|
-
${styledUtils.getMultipliedSize(theme
|
|
79
|
-
${styledUtils.getMultipliedSize(theme
|
|
80
|
-
${styledUtils.getMultipliedSize(theme
|
|
81
|
-
font-size: ${theme
|
|
72
|
+
line-height: ${theme.default.lineHeight.default};
|
|
73
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.75)}
|
|
74
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.5)}
|
|
75
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.75)}
|
|
76
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
77
|
+
font-size: ${theme.default.fontSize.default};
|
|
82
78
|
display: flex;
|
|
83
79
|
flex-grow: 1;
|
|
84
80
|
align-items: center;
|
|
85
81
|
justify-content: space-between;
|
|
86
82
|
}
|
|
87
83
|
${MenuLinkBackLink} {
|
|
88
|
-
font-weight: ${theme
|
|
89
|
-
background: ${theme
|
|
90
|
-
color: ${theme
|
|
84
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
85
|
+
background: ${theme.default.color.background.white.default};
|
|
86
|
+
color: ${theme.default.color.text.pink};
|
|
91
87
|
justify-content: flex-start;
|
|
92
88
|
span.dnasg-icon {
|
|
93
|
-
margin-right: ${styledUtils.getMultipliedSize(theme
|
|
89
|
+
margin-right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)};
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
92
|
${globalNavStyles.MenuLink}:hover {
|
|
@@ -98,7 +94,7 @@ const MobileMenu = styled["default"].div `
|
|
|
98
94
|
}
|
|
99
95
|
`;
|
|
100
96
|
const MenuItemBackLink = ({ currentLevel }) => {
|
|
101
|
-
const { handleNavMenuClick, lang, menuLevel: { scrollPosition }, level1Items, level2Items, getBackLink, } = React.useContext(NavContext
|
|
97
|
+
const { handleNavMenuClick, lang, menuLevel: { scrollPosition }, level1Items, level2Items, getBackLink, } = React.useContext(NavContext.default);
|
|
102
98
|
const levels = {
|
|
103
99
|
level1Items,
|
|
104
100
|
level2Items,
|
|
@@ -111,15 +107,15 @@ const MenuItemBackLink = ({ currentLevel }) => {
|
|
|
111
107
|
};
|
|
112
108
|
const tabNavigationDisabled = scrollPosition !== currentLevel - 1;
|
|
113
109
|
const backLink = getBackLink(menuElements, currentLevel - 1);
|
|
114
|
-
return (
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
return (React.createElement(globalNavStyles.MenuItem, { key: `back-${backLink.id}`, "data-testid": `mobile-nav-menu-backlink-level-${currentLevel}` },
|
|
111
|
+
React.createElement(MenuLinkBackLink, { role: "menuitem", as: "button", onClick: mobileMenuBackClick, tabIndex: tabNavigationDisabled ? -1 : undefined },
|
|
112
|
+
React.createElement(Icon.default, { icon: icons.ChevronLeft, size: "1rem" }),
|
|
117
113
|
backLink.titles[lang])));
|
|
118
114
|
};
|
|
119
115
|
const CreateSubMenuItem = ({ menuItem, currentLevel, itemIndex }) => {
|
|
120
116
|
var _a;
|
|
121
|
-
const { handleNavMenuClick, menuLevel: { scrollPosition }, lang, currentUrl, } = React.useContext(NavContext
|
|
122
|
-
const { mobileMenuRef } = React.useContext(MobileMenuContext
|
|
117
|
+
const { handleNavMenuClick, menuLevel: { scrollPosition }, lang, currentUrl, } = React.useContext(NavContext.default);
|
|
118
|
+
const { mobileMenuRef } = React.useContext(MobileMenuContext.default);
|
|
123
119
|
const hasChildren = (_a = menuItem === null || menuItem === void 0 ? void 0 : menuItem.pages) === null || _a === void 0 ? void 0 : _a.length;
|
|
124
120
|
const indexLevel = currentLevel - 1;
|
|
125
121
|
const tabNavigationDisabled = () => scrollPosition !== indexLevel;
|
|
@@ -137,41 +133,41 @@ const CreateSubMenuItem = ({ menuItem, currentLevel, itemIndex }) => {
|
|
|
137
133
|
handleNavMenuClick(element.id, `level${currentLevel}Mobile`);
|
|
138
134
|
};
|
|
139
135
|
if (hasChildren && currentLevel < 3) {
|
|
140
|
-
return (
|
|
141
|
-
|
|
136
|
+
return (React.createElement(globalNavStyles.MenuItem, { key: menuItem.id, "aria-haspopup": "true", "data-testid": `mobile-menu-level-${currentLevel}-link-${itemIndex + 1}`, isActive: LinkModifier.isSelected(currentUrl, menuUrl) },
|
|
137
|
+
React.createElement(globalNavStyles.MenuLink, { as: "button", onClick: mobileMenuClick(menuItem), role: "menuitem", tabIndex: tabNavigationDisabled() ? -1 : undefined },
|
|
142
138
|
menuItem.titles[lang],
|
|
143
|
-
|
|
139
|
+
React.createElement(Icon.default, { icon: icons.ChevronRight, size: "1rem" }))));
|
|
144
140
|
}
|
|
145
|
-
return (
|
|
146
|
-
|
|
141
|
+
return (React.createElement(globalNavStyles.MenuItem, { key: menuItem.id, role: "menuitem", "data-testid": `mobile-menu-level-${currentLevel}-link-${itemIndex + 1}`, isActive: LinkModifier.isSelected(currentUrl, menuUrl, true) },
|
|
142
|
+
React.createElement(LinkModifier.default, { menuItem: menuItem, tabIndex: tabNavigationDisabled() })));
|
|
147
143
|
};
|
|
148
144
|
const SubMenuMobile = ({ currentLevel, menuItem }) => {
|
|
149
145
|
const navElements = menuItem.pages;
|
|
150
146
|
if (!navElements.length) {
|
|
151
147
|
return null;
|
|
152
148
|
}
|
|
153
|
-
return (
|
|
154
|
-
currentLevel > 1 &&
|
|
155
|
-
navElements.map((subMenuItem, index) => (
|
|
149
|
+
return (React.createElement(React.Fragment, null,
|
|
150
|
+
currentLevel > 1 && React.createElement(MenuItemBackLink, { currentLevel: currentLevel }),
|
|
151
|
+
navElements.map((subMenuItem, index) => (React.createElement(CreateSubMenuItem, { menuItem: subMenuItem, currentLevel: currentLevel, key: subMenuItem.id, itemIndex: index })))));
|
|
156
152
|
};
|
|
157
153
|
const NavigationMenuMobile = () => {
|
|
158
|
-
const { items, menuLevel, level1Items, level2Items } = React.useContext(NavContext
|
|
154
|
+
const { items, menuLevel, level1Items, level2Items } = React.useContext(NavContext.default);
|
|
159
155
|
const { mainNavigation } = items;
|
|
160
156
|
if (!(mainNavigation === null || mainNavigation === void 0 ? void 0 : mainNavigation.pages.length)) {
|
|
161
157
|
return null;
|
|
162
158
|
}
|
|
163
|
-
return (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
menuLevel.level1Mobile !== null && (
|
|
169
|
-
|
|
170
|
-
menuLevel.level2Mobile !== null && (
|
|
171
|
-
|
|
159
|
+
return (React.createElement(React.Fragment, null,
|
|
160
|
+
React.createElement(globalNavStyles.MenuList, { role: "menu", "aria-hidden": menuLevel.scrollPosition !== 0, "aria-disabled": menuLevel.scrollPosition !== 0, "data-testid": "mobile-nav-menu-level-1", isInView: menuLevel.scrollPosition === 0 },
|
|
161
|
+
React.createElement(SubMenuMobile, { currentLevel: 1, menuItem: mainNavigation }),
|
|
162
|
+
React.createElement(globalNavStyles.MenuItem, { key: "business-item", "aria-hidden": menuLevel.scrollPosition !== 0, role: "menuitem" },
|
|
163
|
+
React.createElement(BusinessMenu.default, null))),
|
|
164
|
+
menuLevel.level1Mobile !== null && (React.createElement(globalNavStyles.MenuList, { role: "menu", "aria-hidden": menuLevel.scrollPosition !== 1, "aria-disabled": menuLevel.scrollPosition !== 1, "data-testid": "mobile-nav-menu-level-2", isInView: menuLevel.scrollPosition === 1 },
|
|
165
|
+
React.createElement(SubMenuMobile, { currentLevel: 2, menuItem: level1Items[menuLevel.level1Mobile] }))),
|
|
166
|
+
menuLevel.level2Mobile !== null && (React.createElement(globalNavStyles.MenuList, { role: "menu", "aria-hidden": menuLevel.scrollPosition !== 2, "aria-disabled": menuLevel.scrollPosition !== 2, "data-testid": "mobile-nav-menu-level-3", isInView: menuLevel.scrollPosition === 2 },
|
|
167
|
+
React.createElement(SubMenuMobile, { currentLevel: 3, menuItem: level2Items[menuLevel.level2Mobile] })))));
|
|
172
168
|
};
|
|
173
169
|
const RenderMobileMenu = () => {
|
|
174
|
-
const { menuLevel, isMobileMenuOpen } = React.useContext(NavContext
|
|
170
|
+
const { menuLevel, isMobileMenuOpen } = React.useContext(NavContext.default);
|
|
175
171
|
const mobileMenuRef = React.useRef(null);
|
|
176
172
|
const slidingMenuAnimation = reactSpring.useSpring({
|
|
177
173
|
transform: `translateX(${(menuLevel.scrollPosition / navigation.menuLevelsAmount) * -100}%)`,
|
|
@@ -182,12 +178,12 @@ const RenderMobileMenu = () => {
|
|
|
182
178
|
if (!isMobileMenuOpen) {
|
|
183
179
|
return null;
|
|
184
180
|
}
|
|
185
|
-
return (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
return (React.createElement(MobileMenuContainer, { ref: mobileMenuRef },
|
|
182
|
+
React.createElement(MobileMenuContext.default.Provider, { value: mobileMenuContext },
|
|
183
|
+
React.createElement(MobileMenu, null,
|
|
184
|
+
React.createElement(MobileMenuWrapper, null,
|
|
185
|
+
React.createElement(reactSpring.animated.div, { style: slidingMenuAnimation },
|
|
186
|
+
React.createElement(NavigationMenuMobile, null)))))));
|
|
191
187
|
};
|
|
192
188
|
|
|
193
|
-
exports
|
|
189
|
+
exports.default = RenderMobileMenu;
|
|
@@ -8,16 +8,12 @@ var Icon = require('../../Icon/Icon.js');
|
|
|
8
8
|
var NavContext = require('../context/NavContext.js');
|
|
9
9
|
var MainNavTooltipMenu = require('./MainNavTooltipMenu.js');
|
|
10
10
|
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
|
|
15
11
|
const PageSearch = ({ searchLabel }) => {
|
|
16
12
|
const globalStateString = 'search';
|
|
17
|
-
const { navZIndex, searchComponent: SearchComponent } = React.useContext(NavContext
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const { navZIndex, searchComponent: SearchComponent } = React.useContext(NavContext.default);
|
|
14
|
+
return (React.createElement(MainNavTooltipMenu.default, { zIndex: navZIndex + 1, tooltipRight: "0", contentComponent: SearchComponent, contentWidth: "100%", globalStateString: globalStateString, fullWidthDesktop: true, closeWhenTagClicked: ['a'] },
|
|
15
|
+
React.createElement(Icon.default, { icon: icons.Search, size: "2rem" }),
|
|
16
|
+
React.createElement("span", null, searchLabel)));
|
|
21
17
|
};
|
|
22
18
|
|
|
23
|
-
exports
|
|
19
|
+
exports.default = PageSearch;
|
|
@@ -9,51 +9,47 @@ var navigation = require('../../../themes/themeComponents/navigation.js');
|
|
|
9
9
|
var styledUtils = require('../../../utils/styledUtils.js');
|
|
10
10
|
var Icon = require('../../Icon/Icon.js');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
|
|
16
|
-
const RibbonContainer = styled["default"].div `
|
|
12
|
+
const RibbonContainer = styled.default.div `
|
|
17
13
|
display: none;
|
|
18
14
|
${styledUtils.media.md `
|
|
19
|
-
background: ${theme
|
|
15
|
+
background: ${theme.default.color.background.sand.E01};
|
|
20
16
|
display: block;
|
|
21
17
|
`};
|
|
22
18
|
`;
|
|
23
|
-
const RibbonItems = styled
|
|
19
|
+
const RibbonItems = styled.default.div `
|
|
24
20
|
max-width: 1290px;
|
|
25
21
|
height: ${navigation.ribbonHeight};
|
|
26
|
-
padding: 0 ${styledUtils.getMultipliedSize(theme
|
|
22
|
+
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
27
23
|
margin: 0 auto;
|
|
28
24
|
display: flex;
|
|
29
25
|
justify-content: center;
|
|
30
26
|
align-items: center;
|
|
31
27
|
`;
|
|
32
|
-
const RibbonColumn = styled
|
|
28
|
+
const RibbonColumn = styled.default.div `
|
|
33
29
|
flex: 1 1 auto;
|
|
34
30
|
display: flex;
|
|
35
31
|
justify-content: center;
|
|
36
32
|
align-items: center;
|
|
37
|
-
color: ${theme
|
|
38
|
-
font-size: ${theme
|
|
39
|
-
border-right: 2px solid ${theme
|
|
33
|
+
color: ${theme.default.color.text.gray};
|
|
34
|
+
font-size: ${theme.default.fontSize.xs};
|
|
35
|
+
border-right: 2px solid ${theme.default.color.line.L03};
|
|
40
36
|
&:last-of-type {
|
|
41
37
|
border: none;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
span.dnasg-icon {
|
|
45
|
-
margin-right: ${styledUtils.getMultipliedSize(theme
|
|
41
|
+
margin-right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 0.5)};
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
a {
|
|
49
45
|
display: flex;
|
|
50
46
|
align-items: center;
|
|
51
|
-
color: ${theme
|
|
47
|
+
color: ${theme.default.color.text.gray};
|
|
52
48
|
&:hover,
|
|
53
49
|
&:focus,
|
|
54
50
|
&:active {
|
|
55
51
|
text-decoration: none;
|
|
56
|
-
color: ${theme
|
|
52
|
+
color: ${theme.default.color.text.pink};
|
|
57
53
|
border: none;
|
|
58
54
|
outline: none;
|
|
59
55
|
}
|
|
@@ -62,13 +58,13 @@ const RibbonColumn = styled["default"].div `
|
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
`;
|
|
65
|
-
const Ribbon = ({ ribbonData, lang = 'fi' }) => (
|
|
66
|
-
|
|
67
|
-
ribbon.ribbonLink[lang] && (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
!ribbon.ribbonLink[lang] && (
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
const Ribbon = ({ ribbonData, lang = 'fi' }) => (React.createElement(RibbonContainer, null,
|
|
62
|
+
React.createElement(RibbonItems, null, ribbonData.map(ribbon => (React.createElement(RibbonColumn, { key: `ribbon-${ribbon.ribbonIcon}` },
|
|
63
|
+
ribbon.ribbonLink[lang] && (React.createElement("a", { href: ribbon.ribbonLink[lang] },
|
|
64
|
+
React.createElement(Icon.default, { name: ribbon.ribbonIcon, size: "1rem" }),
|
|
65
|
+
React.createElement("span", null, ribbon.ribbonTexts[lang]))),
|
|
66
|
+
!ribbon.ribbonLink[lang] && (React.createElement(React.Fragment, null,
|
|
67
|
+
React.createElement(Icon.default, { name: ribbon.ribbonIcon, size: "1rem" }),
|
|
68
|
+
React.createElement("span", null, ribbon.ribbonTexts[lang])))))))));
|
|
73
69
|
|
|
74
|
-
exports
|
|
70
|
+
exports.default = Ribbon;
|
|
@@ -16,10 +16,6 @@ var MobileMenu = require('./ChildComponents/MobileMenu.js');
|
|
|
16
16
|
var Ribbon = require('./ChildComponents/Ribbon.js');
|
|
17
17
|
var NavContext = require('./context/NavContext.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
|
|
23
19
|
const GlobalStyle = styled.createGlobalStyle `
|
|
24
20
|
body.overflow-hidden {
|
|
25
21
|
overflow: hidden;
|
|
@@ -65,14 +61,14 @@ const resumeBodyScroll = () => {
|
|
|
65
61
|
});
|
|
66
62
|
}
|
|
67
63
|
};
|
|
68
|
-
const PageOverlay = styled
|
|
64
|
+
const PageOverlay = styled.default.div `
|
|
69
65
|
position: fixed;
|
|
70
66
|
animation: ${fadeIn} 0.2s ease-in-out;
|
|
71
67
|
top: 0;
|
|
72
68
|
left: 0;
|
|
73
69
|
width: 100%;
|
|
74
70
|
height: 100%;
|
|
75
|
-
background: ${theme
|
|
71
|
+
background: ${theme.default.color.background.plum.default + theme.default.color.transparency.T10};
|
|
76
72
|
z-index: ${({ navZIndex }) => navZIndex - 1};
|
|
77
73
|
`;
|
|
78
74
|
const scrollThreshold = 82;
|
|
@@ -82,7 +78,7 @@ const checkThreshold = (prevPos, currPos) => {
|
|
|
82
78
|
}
|
|
83
79
|
return currPos - prevPos > scrollThreshold;
|
|
84
80
|
};
|
|
85
|
-
const GlobalNavigationContainer = styled
|
|
81
|
+
const GlobalNavigationContainer = styled.default.nav `
|
|
86
82
|
z-index: ${({ navZIndex }) => navZIndex};
|
|
87
83
|
position: relative;
|
|
88
84
|
position: sticky;
|
|
@@ -90,18 +86,18 @@ const GlobalNavigationContainer = styled["default"].nav `
|
|
|
90
86
|
top: 0;
|
|
91
87
|
left: 0;
|
|
92
88
|
width: 100%;
|
|
93
|
-
background-color: ${theme
|
|
94
|
-
color: ${theme
|
|
89
|
+
background-color: ${theme.default.color.background.white.default};
|
|
90
|
+
color: ${theme.default.color.text.black};
|
|
95
91
|
top: ${({ menuLevel, tooltipMenuActive }) => (menuLevel === null || menuLevel === void 0 ? void 0 : menuLevel.hideOnScroll) && !(menuLevel === null || menuLevel === void 0 ? void 0 : menuLevel.level1) && !tooltipMenuActive
|
|
96
92
|
? `calc(-${navigation.desktopNavMaxHeight} - ${navigation.ribbonHeight})`
|
|
97
93
|
: '0px'} !important;
|
|
98
94
|
transition: top 0.2s ease-in-out;
|
|
99
95
|
box-sizing: border-box;
|
|
100
96
|
`;
|
|
101
|
-
const NavigationWrapper = styled
|
|
97
|
+
const NavigationWrapper = styled.default.div `
|
|
102
98
|
display: flex;
|
|
103
99
|
width: 100%;
|
|
104
|
-
max-width: ${styledUtils.getMultipliedSize(theme
|
|
100
|
+
max-width: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 256)};
|
|
105
101
|
margin: 0 auto;
|
|
106
102
|
height: ${navigation.mobileNavMaxHeight};
|
|
107
103
|
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
@@ -119,7 +115,7 @@ const initiateScrollToHeader = (componentRef) => {
|
|
|
119
115
|
};
|
|
120
116
|
/** @visibleName Main Navigation */
|
|
121
117
|
const MainNavigation = ({ items = {}, language = 'fi', zIndex = 1030, languageSelector = false, search = true, searchText = 'Haku', searchComponent = false, minicart = true, minicartText = 'Ostoskori', minicartComponent = false, minicartAmount = 0, showMinicart = false, showLoginTooltip = false, login = true, loginText = 'Kirjaudu', loginComponent, isLoggedIn = false, collapseSize = 767, nextJSLinkComponent = false, ribbon = true, ribbonData, className, currentUrl = '', notificationText = '', }) => {
|
|
122
|
-
const { isMobile } = useWindowSize
|
|
118
|
+
const { isMobile } = useWindowSize.default(collapseSize);
|
|
123
119
|
const props = {
|
|
124
120
|
items,
|
|
125
121
|
language,
|
|
@@ -294,23 +290,23 @@ const MainNavigation = ({ items = {}, language = 'fi', zIndex = 1030, languageSe
|
|
|
294
290
|
searchComponent,
|
|
295
291
|
currentUrl,
|
|
296
292
|
]);
|
|
297
|
-
useScrollPosition
|
|
293
|
+
useScrollPosition.default(({ prevPos, currPos }) => {
|
|
298
294
|
const overThreshold = checkThreshold(prevPos.y, currPos.y);
|
|
299
295
|
const isShow = currPos.y < prevPos.y;
|
|
300
296
|
if (isShow !== menuLevel.hideOnScroll && overThreshold && !menuLevel.level1) {
|
|
301
297
|
setMenuLevel(Object.assign(Object.assign({}, menuLevel), { animate1: false, animate2: false, hideOnScroll: isShow }));
|
|
302
298
|
}
|
|
303
299
|
}, undefined, false, 200);
|
|
304
|
-
return (
|
|
305
|
-
isPageOverlay &&
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
!items.mainNavigation && notificationText && (
|
|
310
|
-
ribbon && ribbonData &&
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
isMobile &&
|
|
300
|
+
return (React.createElement(React.Fragment, null,
|
|
301
|
+
isPageOverlay && React.createElement(PageOverlay, { "data-testid": "navigation-overlay", navZIndex: zIndex }),
|
|
302
|
+
React.createElement(GlobalNavigationContainer, { className: className, ref: navigationEl, collapseSize: collapseSize, menuLevel: menuLevel, "data-testid": "main-navigation", navZIndex: zIndex, tooltipMenuActive: tooltipMenuActive },
|
|
303
|
+
React.createElement(NavContext.default.Provider, { value: navigationContext },
|
|
304
|
+
React.createElement(GlobalStyle, null),
|
|
305
|
+
!items.mainNavigation && notificationText && (React.createElement(Notification.default, { type: "info" }, notificationText)),
|
|
306
|
+
ribbon && ribbonData && React.createElement(Ribbon.default, { ribbonData: ribbonData, lang: language }),
|
|
307
|
+
React.createElement(NavigationWrapper, { collapseSize: collapseSize },
|
|
308
|
+
React.createElement(HeaderNavigationElements.default, { navElementProps: props }),
|
|
309
|
+
isMobile && React.createElement(MobileMenu.default, null))))));
|
|
314
310
|
};
|
|
315
311
|
|
|
316
|
-
exports
|
|
312
|
+
exports.default = MainNavigation;
|
|
@@ -161,7 +161,7 @@ export declare const MenuItem: import("styled-components").StyledComponent<"li",
|
|
|
161
161
|
pill: string;
|
|
162
162
|
};
|
|
163
163
|
}, {
|
|
164
|
-
isActive?: boolean
|
|
164
|
+
isActive?: boolean;
|
|
165
165
|
}, never>;
|
|
166
166
|
export declare const MenuLink: import("styled-components").StyledComponent<"a", {
|
|
167
167
|
base: {
|
|
@@ -326,7 +326,7 @@ export declare const MenuLink: import("styled-components").StyledComponent<"a",
|
|
|
326
326
|
pill: string;
|
|
327
327
|
};
|
|
328
328
|
}, {
|
|
329
|
-
isActive?: boolean
|
|
329
|
+
isActive?: boolean;
|
|
330
330
|
}, never>;
|
|
331
331
|
export declare const MenuLinkWithChildren: import("styled-components").StyledComponent<"button", {
|
|
332
332
|
base: {
|
|
@@ -491,8 +491,8 @@ export declare const MenuLinkWithChildren: import("styled-components").StyledCom
|
|
|
491
491
|
pill: string;
|
|
492
492
|
};
|
|
493
493
|
}, {
|
|
494
|
-
isActive?: boolean
|
|
495
|
-
isHighlighted?: boolean
|
|
494
|
+
isActive?: boolean;
|
|
495
|
+
isHighlighted?: boolean;
|
|
496
496
|
}, never>;
|
|
497
497
|
export declare const MenuList: import("styled-components").StyledComponent<"ul", {
|
|
498
498
|
base: {
|
|
@@ -657,5 +657,5 @@ export declare const MenuList: import("styled-components").StyledComponent<"ul",
|
|
|
657
657
|
pill: string;
|
|
658
658
|
};
|
|
659
659
|
}, {
|
|
660
|
-
isInView?: boolean
|
|
660
|
+
isInView?: boolean;
|
|
661
661
|
}, never>;
|