@dnanpm/styleguide 3.12.3 → 4.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/build/cjs/components/Button/Button.d.ts +1 -7
- package/build/cjs/components/Button/Button.js +3 -3
- package/build/cjs/components/ButtonArrow/ButtonArrow.d.ts +1 -7
- package/build/cjs/components/ButtonArrow/ButtonArrow.js +2 -2
- package/build/cjs/components/ButtonIcon/ButtonIcon.js +3 -3
- package/build/cjs/components/Chip/Chip.d.ts +2 -18
- package/build/cjs/components/Chip/Chip.js +2 -2
- package/build/cjs/components/Drawer/Drawer.d.ts +0 -7
- package/build/cjs/components/Drawer/Drawer.js +1 -1
- package/build/cjs/components/Footer/Components/FooterComponents.js +0 -1
- package/build/cjs/components/Hero/Hero.js +3 -2
- package/build/cjs/components/Icon/Icon.d.ts +2 -8
- package/build/cjs/components/Icon/Icon.js +3 -10
- package/build/cjs/components/Input/Input.d.ts +1 -10
- package/build/cjs/components/LabelText/LabelText.d.ts +1 -6
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +1 -1
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +2 -2
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +1 -7
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +1 -3
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.d.ts +0 -1
- package/build/cjs/components/MainHeaderNavigation/context/NavContext.js +0 -1
- package/build/cjs/components/Modal/Modal.d.ts +0 -5
- package/build/cjs/components/ReadMore/ReadMore.d.ts +0 -20
- package/build/cjs/components/ReadMore/ReadMore.js +2 -8
- package/build/cjs/components/Tab/Tab.d.ts +2 -30
- package/build/cjs/components/Tab/Tab.js +2 -33
- package/build/cjs/components/Tabs/Tabs.d.ts +1 -9
- package/build/cjs/components/Tabs/Tabs.js +9 -17
- package/build/cjs/components/index.d.ts +0 -4
- package/build/cjs/hooks/useCloseOutsideOrElementClicked.js +1 -1
- package/build/cjs/index.js +0 -8
- package/build/cjs/themes/themeComponents/navigation.js +0 -4
- package/build/es/components/Button/Button.d.ts +1 -7
- package/build/es/components/Button/Button.js +3 -3
- package/build/es/components/ButtonArrow/ButtonArrow.d.ts +1 -7
- package/build/es/components/ButtonArrow/ButtonArrow.js +2 -2
- package/build/es/components/ButtonIcon/ButtonIcon.js +3 -3
- package/build/es/components/Chip/Chip.d.ts +2 -18
- package/build/es/components/Chip/Chip.js +2 -2
- package/build/es/components/Drawer/Drawer.d.ts +0 -7
- package/build/es/components/Drawer/Drawer.js +1 -1
- package/build/es/components/Footer/Components/FooterComponents.js +0 -1
- package/build/es/components/Hero/Hero.js +3 -2
- package/build/es/components/Icon/Icon.d.ts +2 -8
- package/build/es/components/Icon/Icon.js +3 -10
- package/build/es/components/Input/Input.d.ts +1 -10
- package/build/es/components/LabelText/LabelText.d.ts +1 -6
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +2 -2
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +1 -7
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +1 -3
- package/build/es/components/MainHeaderNavigation/context/NavContext.d.ts +0 -1
- package/build/es/components/MainHeaderNavigation/context/NavContext.js +0 -1
- package/build/es/components/Modal/Modal.d.ts +0 -5
- package/build/es/components/ReadMore/ReadMore.d.ts +0 -20
- package/build/es/components/ReadMore/ReadMore.js +2 -8
- package/build/es/components/Tab/Tab.d.ts +2 -30
- package/build/es/components/Tab/Tab.js +2 -33
- package/build/es/components/Tabs/Tabs.d.ts +1 -9
- package/build/es/components/Tabs/Tabs.js +9 -17
- package/build/es/components/index.d.ts +0 -4
- package/build/es/hooks/useCloseOutsideOrElementClicked.js +1 -1
- package/build/es/index.js +0 -4
- package/build/es/themes/themeComponents/navigation.js +1 -3
- package/package.json +12 -12
- package/build/cjs/components/ButtonRound/ButtonRound.d.ts +0 -10
- package/build/cjs/components/ButtonRound/ButtonRound.js +0 -37
- package/build/cjs/components/Icons/index.js +0 -224
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.d.ts +0 -3
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +0 -59
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.d.ts +0 -3
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +0 -259
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +0 -10
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +0 -168
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.d.ts +0 -4
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +0 -38
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.d.ts +0 -9
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +0 -38
- package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.d.ts +0 -6
- package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.js +0 -23
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.d.ts +0 -24
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +0 -104
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +0 -6
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +0 -62
- package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.d.ts +0 -7
- package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.js +0 -26
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.d.ts +0 -3
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +0 -193
- package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.d.ts +0 -6
- package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.js +0 -23
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.d.ts +0 -13
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +0 -74
- package/build/cjs/components/MainNavigation/MainNavigation.d.ts +0 -38
- package/build/cjs/components/MainNavigation/MainNavigation.js +0 -319
- package/build/cjs/components/MainNavigation/context/MobileMenuContext.d.ts +0 -6
- package/build/cjs/components/MainNavigation/context/MobileMenuContext.js +0 -11
- package/build/cjs/components/MainNavigation/context/NavContext.d.ts +0 -29
- package/build/cjs/components/MainNavigation/context/NavContext.js +0 -46
- package/build/cjs/components/MainNavigation/globalNavStyles.d.ts +0 -13
- package/build/cjs/components/MainNavigation/globalNavStyles.js +0 -94
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.d.ts +0 -90
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +0 -207
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +0 -10
- package/build/cjs/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +0 -34
- package/build/cjs/components/TooltipMenu/TooltipMenu.d.ts +0 -45
- package/build/cjs/components/TooltipMenu/TooltipMenu.js +0 -76
- package/build/es/components/ButtonRound/ButtonRound.d.ts +0 -10
- package/build/es/components/ButtonRound/ButtonRound.js +0 -29
- package/build/es/components/Icons/index.js +0 -109
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.d.ts +0 -3
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +0 -51
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.d.ts +0 -3
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +0 -251
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.d.ts +0 -10
- package/build/es/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +0 -159
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.d.ts +0 -4
- package/build/es/components/MainNavigation/ChildComponents/LanguageSelector.js +0 -30
- package/build/es/components/MainNavigation/ChildComponents/LinkModifier.d.ts +0 -9
- package/build/es/components/MainNavigation/ChildComponents/LinkModifier.js +0 -29
- package/build/es/components/MainNavigation/ChildComponents/LoginTooltip.d.ts +0 -6
- package/build/es/components/MainNavigation/ChildComponents/LoginTooltip.js +0 -15
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.d.ts +0 -24
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +0 -96
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +0 -6
- package/build/es/components/MainNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.js +0 -57
- package/build/es/components/MainNavigation/ChildComponents/MinicartTooltip.d.ts +0 -7
- package/build/es/components/MainNavigation/ChildComponents/MinicartTooltip.js +0 -18
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.d.ts +0 -3
- package/build/es/components/MainNavigation/ChildComponents/MobileMenu.js +0 -185
- package/build/es/components/MainNavigation/ChildComponents/PageSearch.d.ts +0 -6
- package/build/es/components/MainNavigation/ChildComponents/PageSearch.js +0 -15
- package/build/es/components/MainNavigation/ChildComponents/Ribbon.d.ts +0 -13
- package/build/es/components/MainNavigation/ChildComponents/Ribbon.js +0 -66
- package/build/es/components/MainNavigation/MainNavigation.d.ts +0 -38
- package/build/es/components/MainNavigation/MainNavigation.js +0 -311
- package/build/es/components/MainNavigation/context/MobileMenuContext.d.ts +0 -6
- package/build/es/components/MainNavigation/context/MobileMenuContext.js +0 -7
- package/build/es/components/MainNavigation/context/NavContext.d.ts +0 -29
- package/build/es/components/MainNavigation/context/NavContext.js +0 -42
- package/build/es/components/MainNavigation/globalNavStyles.d.ts +0 -13
- package/build/es/components/MainNavigation/globalNavStyles.js +0 -89
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.d.ts +0 -90
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +0 -199
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.d.ts +0 -10
- package/build/es/components/TooltipMenu/ChildComponents/TooltipMenuExportedStyles.js +0 -31
- package/build/es/components/TooltipMenu/TooltipMenu.d.ts +0 -45
- package/build/es/components/TooltipMenu/TooltipMenu.js +0 -68
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import { styled } from 'styled-components';
|
|
4
|
-
import theme from '../../themes/theme.js';
|
|
5
|
-
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
6
|
-
import ButtonPrimary from '../ButtonPrimary/ButtonPrimary.js';
|
|
7
|
-
|
|
8
|
-
const ButtonElement = styled(ButtonPrimary) `
|
|
9
|
-
display: flex;
|
|
10
|
-
min-width: initial;
|
|
11
|
-
width: ${getMultipliedSize(theme.base.baseWidth, 3.2)};
|
|
12
|
-
height: ${getMultipliedSize(theme.base.baseHeight, 3.2)};
|
|
13
|
-
border-radius: ${theme.radius.circle};
|
|
14
|
-
padding: initial;
|
|
15
|
-
text-align: center;
|
|
16
|
-
vertical-align: middle;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
`;
|
|
20
|
-
/**
|
|
21
|
-
* @visibleName Button Round
|
|
22
|
-
* @deprecated Use `ButtonArrow` component
|
|
23
|
-
*/
|
|
24
|
-
const ButtonRound = (_a) => {
|
|
25
|
-
var { 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = __rest(_a, ['data-testid', 'data-no-close', 'data-track-value']);
|
|
26
|
-
return (React__default.createElement(ButtonElement, { id: props.id, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, darkBg: props.darkBg, disabled: props.disabled, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue }, props.children));
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export { ButtonRound as default };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
export { default as hlArrowBackSmall } from './Small/hlArrowBackSmall.js';
|
|
2
|
-
export { default as hlArrowForwardSmall } from './Small/hlArrowForwardSmall.js';
|
|
3
|
-
export { default as hlArrowUnderSmall } from './Small/hlArrowUnderSmall.js';
|
|
4
|
-
export { default as hlCalendarSmall } from './Small/hlCalendarSmall.js';
|
|
5
|
-
export { default as hlChevronDownSmall } from './Small/hlChevronDownSmall.js';
|
|
6
|
-
export { default as hlChevronLeftSmall } from './Small/hlChevronLeftSmall.js';
|
|
7
|
-
export { default as hlChevronRightSmall } from './Small/hlChevronRightSmall.js';
|
|
8
|
-
export { default as hlChevronUpSmall } from './Small/hlChevronUpSmall.js';
|
|
9
|
-
export { default as hlClockSmall } from './Small/hlClockSmall.js';
|
|
10
|
-
export { default as hlDownloadSmall } from './Small/hlDownloadSmall.js';
|
|
11
|
-
export { default as hlExternalSmall } from './Small/hlExternalSmall.js';
|
|
12
|
-
export { default as hlUploadSmall } from './Small/hlUploadSmall.js';
|
|
13
|
-
export { default as facebook } from './Social/facebook.js';
|
|
14
|
-
export { default as instagram } from './Social/instagram.js';
|
|
15
|
-
export { default as linkedin } from './Social/linkedin.js';
|
|
16
|
-
export { default as tiktok } from './Social/tiktok.js';
|
|
17
|
-
export { default as twitter } from './Social/twitter.js';
|
|
18
|
-
export { default as youtube } from './Social/youtube.js';
|
|
19
|
-
export { default as hl404 } from './hl404.js';
|
|
20
|
-
export { default as hl4gSim } from './hl4gSim.js';
|
|
21
|
-
export { default as hl5gSim } from './hl5gSim.js';
|
|
22
|
-
export { default as hlBattery } from './hlBattery.js';
|
|
23
|
-
export { default as hlBell } from './hlBell.js';
|
|
24
|
-
export { default as hlCableTVCard } from './hlCableTVCard.js';
|
|
25
|
-
export { default as hlCalendar } from './hlCalendar.js';
|
|
26
|
-
export { default as hlCall } from './hlCall.js';
|
|
27
|
-
export { default as hlCameraBack } from './hlCameraBack.js';
|
|
28
|
-
export { default as hlCameraFront } from './hlCameraFront.js';
|
|
29
|
-
export { default as hlCart } from './hlCart.js';
|
|
30
|
-
export { default as hlCartEmpty } from './hlCartEmpty.js';
|
|
31
|
-
export { default as hlChat } from './hlChat.js';
|
|
32
|
-
export { default as hlCheck, hlSuccess } from './hlCheck.js';
|
|
33
|
-
export { default as hlChevronDown } from './hlChevronDown.js';
|
|
34
|
-
export { default as hlChevronLeft } from './hlChevronLeft.js';
|
|
35
|
-
export { default as hlChevronRight } from './hlChevronRight.js';
|
|
36
|
-
export { default as hlChevronUp } from './hlChevronUp.js';
|
|
37
|
-
export { default as hlCompensation } from './hlCompensation.js';
|
|
38
|
-
export { default as hlCookie } from './hlCookie.js';
|
|
39
|
-
export { default as hlCopy } from './hlCopy.js';
|
|
40
|
-
export { default as hlCoupon } from './hlCoupon.js';
|
|
41
|
-
export { default as hlDelivery } from './hlDelivery.js';
|
|
42
|
-
export { default as hlDigiturva } from './hlDigiturva.js';
|
|
43
|
-
export { default as hlDisplaySize } from './hlDisplaySize.js';
|
|
44
|
-
export { default as hlDocument } from './hlDocument.js';
|
|
45
|
-
export { default as hlDownload } from './hlDownload.js';
|
|
46
|
-
export { default as hlEnvelope } from './hlEnvelope.js';
|
|
47
|
-
export { default as hlError } from './hlError.js';
|
|
48
|
-
export { default as hlEuro } from './hlEuro.js';
|
|
49
|
-
export { default as hlExclamationMark } from './hlExclamationMark.js';
|
|
50
|
-
export { default as hlExpand } from './hlExpand.js';
|
|
51
|
-
export { default as hlExternal } from './hlExternal.js';
|
|
52
|
-
export { default as hlEyeClosed } from './hlEyeClosed.js';
|
|
53
|
-
export { default as hlEyeOpen } from './hlEyeOpen.js';
|
|
54
|
-
export { default as hlFaceId } from './hlFaceId.js';
|
|
55
|
-
export { default as hlFastDelivery } from './hlFastDelivery.js';
|
|
56
|
-
export { default as hlFingerprint } from './hlFingerprint.js';
|
|
57
|
-
export { default as hlGlobe } from './hlGlobe.js';
|
|
58
|
-
export { default as hlHeadphones } from './hlHeadphones.js';
|
|
59
|
-
export { default as hlHeadset } from './hlHeadset.js';
|
|
60
|
-
export { default as hlHeart } from './hlHeart.js';
|
|
61
|
-
export { default as hlHome } from './hlHome.js';
|
|
62
|
-
export { default as hlHub } from './hlHub.js';
|
|
63
|
-
export { default as hlImage } from './hlImage.js';
|
|
64
|
-
export { default as hlInfo } from './hlInfo.js';
|
|
65
|
-
export { default as hlInstallment } from './hlInstallment.js';
|
|
66
|
-
export { default as hlIotSim } from './hlIotSim.js';
|
|
67
|
-
export { default as hlLaptop } from './hlLaptop.js';
|
|
68
|
-
export { default as hlLiveVideo } from './hlLiveVideo.js';
|
|
69
|
-
export { default as hlLock } from './hlLock.js';
|
|
70
|
-
export { default as hlMagnifyingGlass } from './hlMagnifyingGlass.js';
|
|
71
|
-
export { default as hlMarker } from './hlMarker.js';
|
|
72
|
-
export { default as hlMemory } from './hlMemory.js';
|
|
73
|
-
export { default as hlMenu } from './hlMenu.js';
|
|
74
|
-
export { default as hlMinimize } from './hlMinimize.js';
|
|
75
|
-
export { default as hlMinus } from './hlMinus.js';
|
|
76
|
-
export { default as hlMobileData } from './hlMobileData.js';
|
|
77
|
-
export { default as hlMobilePayment } from './hlMobilePayment.js';
|
|
78
|
-
export { default as hlModem } from './hlModem.js';
|
|
79
|
-
export { default as hlMore } from './hlMore.js';
|
|
80
|
-
export { default as hlOs } from './hlOs.js';
|
|
81
|
-
export { default as hlPackage } from './hlPackage.js';
|
|
82
|
-
export { default as hlPaperclip } from './hlPaperclip.js';
|
|
83
|
-
export { default as hlPaytime } from './hlPaytime.js';
|
|
84
|
-
export { default as hlPen } from './hlPen.js';
|
|
85
|
-
export { default as hlPerson } from './hlPerson.js';
|
|
86
|
-
export { default as hlPhone } from './hlPhone.js';
|
|
87
|
-
export { default as hlPlaylist } from './hlPlaylist.js';
|
|
88
|
-
export { default as hlPlus } from './hlPlus.js';
|
|
89
|
-
export { default as hlPrepaid } from './hlPrepaid.js';
|
|
90
|
-
export { default as hlProcessor } from './hlProcessor.js';
|
|
91
|
-
export { default as hlServices } from './hlServices.js';
|
|
92
|
-
export { default as hlSettings } from './hlSettings.js';
|
|
93
|
-
export { default as hlShield } from './hlShield.js';
|
|
94
|
-
export { default as hlSim } from './hlSim.js';
|
|
95
|
-
export { default as hlSimSimple } from './hlSimSimple.js';
|
|
96
|
-
export { default as hlSmile } from './hlSmile.js';
|
|
97
|
-
export { default as hlSpeechBubble } from './hlSpeechBubble.js';
|
|
98
|
-
export { default as hlSquaretrade } from './hlSquaretrade.js';
|
|
99
|
-
export { default as hlStar } from './hlStar.js';
|
|
100
|
-
export { default as hlStarFilled } from './hlStarFilled.js';
|
|
101
|
-
export { default as hlTrash } from './hlTrash.js';
|
|
102
|
-
export { default as hlTv } from './hlTv.js';
|
|
103
|
-
export { default as hlUnlock } from './hlUnlock.js';
|
|
104
|
-
export { default as hlUpload } from './hlUpload.js';
|
|
105
|
-
export { default as hlWarning } from './hlWarning.js';
|
|
106
|
-
export { default as hlWifi } from './hlWifi.js';
|
|
107
|
-
export { default as hlWrench } from './hlWrench.js';
|
|
108
|
-
export { default as hlX } from './hlX.js';
|
|
109
|
-
export { default as hlLink } from './hlLink.js';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React__default, { useContext, useRef } from 'react';
|
|
2
|
-
import { styled } from 'styled-components';
|
|
3
|
-
import theme from '../../../themes/theme.js';
|
|
4
|
-
import { getMultipliedSize } from '../../../utils/styledUtils.js';
|
|
5
|
-
import NavContext from '../context/NavContext.js';
|
|
6
|
-
|
|
7
|
-
const BusinessMenuLink = styled.a `
|
|
8
|
-
color: ${p => (p.$isActive ? theme.color.text.pink : theme.color.text.black)};
|
|
9
|
-
display: block;
|
|
10
|
-
text-decoration: none;
|
|
11
|
-
margin: ${p => !p.$isMobileMenu
|
|
12
|
-
? `0 ${getMultipliedSize(theme.base.baseWidth, 1)}`
|
|
13
|
-
: `${getMultipliedSize(theme.base.baseWidth, 1.25)} ${getMultipliedSize(theme.base.baseWidth, 2)} `};
|
|
14
|
-
&:hover,
|
|
15
|
-
&:focus {
|
|
16
|
-
text-decoration: none;
|
|
17
|
-
color: ${theme.color.text.pink};
|
|
18
|
-
outline: none;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
const BusinessMenuItem = styled.li `
|
|
22
|
-
display: flex;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
`;
|
|
25
|
-
const BusinessMenuList = styled.ul `
|
|
26
|
-
display: ${({ $isMobileMenu }) => (!$isMobileMenu ? 'inline-flex' : 'block')};
|
|
27
|
-
align-items: center;
|
|
28
|
-
position: relative;
|
|
29
|
-
list-style: none;
|
|
30
|
-
margin: ${({ $isMobileMenu }) => $isMobileMenu ? '1rem 0' : `0 ${getMultipliedSize(theme.base.baseWidth, 0.5)}`};
|
|
31
|
-
padding: 0;
|
|
32
|
-
background-color: ${theme.color.background.white.default};
|
|
33
|
-
font-size: ${({ $isMobileMenu }) => $isMobileMenu ? theme.fontSize.default : theme.fontSize.s};
|
|
34
|
-
height: 100%;
|
|
35
|
-
`;
|
|
36
|
-
const BusinessMenu = () => {
|
|
37
|
-
var _a;
|
|
38
|
-
const { items, lang, isMobileMenu, resetMenuEvents } = useContext(NavContext);
|
|
39
|
-
const ref = useRef(null);
|
|
40
|
-
const currentBusinessId = items.businessId;
|
|
41
|
-
const businessMenuItems = (_a = items.businessSelector) === null || _a === void 0 ? void 0 : _a.items;
|
|
42
|
-
if (!(businessMenuItems === null || businessMenuItems === void 0 ? void 0 : businessMenuItems.length) ||
|
|
43
|
-
!currentBusinessId ||
|
|
44
|
-
(!items.businessSelector && (businessMenuItems === null || businessMenuItems === void 0 ? void 0 : businessMenuItems.length) > 0)) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return (React__default.createElement(BusinessMenuList, { "$isMobileMenu": isMobileMenu, ref: ref, role: "menubar", "aria-hidden": "false", "data-testid": "business-menu-ul" }, businessMenuItems.map((item, index) => (React__default.createElement(BusinessMenuItem, { className: "menu-item", key: item.businessId, "data-testid": `business-menu-selection-item-${index + 1}`, role: "none" },
|
|
48
|
-
React__default.createElement(BusinessMenuLink, { className: "menu-link", href: item.urls[lang], onClick: resetMenuEvents, "$isActive": item.businessId === currentBusinessId, "$isMobileMenu": isMobileMenu, role: "menuitem" }, item.titles[lang]))))));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export { BusinessMenu as default };
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import { ChevronRight } from '@dnanpm/icons';
|
|
2
|
-
import React__default, { useContext, useRef, useEffect } from 'react';
|
|
3
|
-
import useOutsideClick from '../../../hooks/useOutsideClick.js';
|
|
4
|
-
import { keyframes, css, styled } from 'styled-components';
|
|
5
|
-
import theme from '../../../themes/theme.js';
|
|
6
|
-
import { subMenuWidth, subMenuWidthXl, menuItemMargin } from '../../../themes/themeComponents/navigation.js';
|
|
7
|
-
import { getMultipliedSize, media } from '../../../utils/styledUtils.js';
|
|
8
|
-
import Box from '../../Box/Box.js';
|
|
9
|
-
import Icon from '../../Icon/Icon.js';
|
|
10
|
-
import NavContext from '../context/NavContext.js';
|
|
11
|
-
import { MenuList, MenuItem, MenuLinkWithChildren } from '../globalNavStyles.js';
|
|
12
|
-
import LinkModifier, { isSelected } from './LinkModifier.js';
|
|
13
|
-
|
|
14
|
-
const fadeIn = keyframes `
|
|
15
|
-
0% {
|
|
16
|
-
opacity: 0;
|
|
17
|
-
transform: translateY(-5px);
|
|
18
|
-
}
|
|
19
|
-
100% {
|
|
20
|
-
opacity: 1;
|
|
21
|
-
transform: translateY(0px);
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
const fadeRight = keyframes `
|
|
25
|
-
0% {
|
|
26
|
-
opacity: 0;
|
|
27
|
-
transform: translateX(-5px);
|
|
28
|
-
}
|
|
29
|
-
100% {
|
|
30
|
-
opacity: 1;
|
|
31
|
-
transform: translate(0px);
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
const fadeInAnimation = css `
|
|
35
|
-
animation: ${fadeIn} 0.3s ease-in-out;
|
|
36
|
-
`;
|
|
37
|
-
const fadeRightAnimation = css `
|
|
38
|
-
animation: ${fadeRight} 0.3s ease-in-out;
|
|
39
|
-
`;
|
|
40
|
-
const noAnimation = css `
|
|
41
|
-
animation: none;
|
|
42
|
-
`;
|
|
43
|
-
const SubMenuListRight = styled.div `
|
|
44
|
-
display: ${({ $menuStates, $navItemId }) => $menuStates.level1 && $menuStates.level2 && $menuStates.level2 === $navItemId
|
|
45
|
-
? 'block'
|
|
46
|
-
: 'none'};
|
|
47
|
-
${({ $menuStates }) => $menuStates.level2 && $menuStates.animate2 ? fadeRightAnimation : noAnimation};
|
|
48
|
-
top: -${getMultipliedSize(theme.base.baseHeight, 2)};
|
|
49
|
-
padding: ${getMultipliedSize(theme.base.baseHeight, 1)};
|
|
50
|
-
position: absolute;
|
|
51
|
-
width: ${subMenuWidth};
|
|
52
|
-
left: 100%;
|
|
53
|
-
transform: translateY(var(--nav-item-overflow-fix));
|
|
54
|
-
|
|
55
|
-
${media.xl `
|
|
56
|
-
width: ${subMenuWidthXl};
|
|
57
|
-
`};
|
|
58
|
-
`;
|
|
59
|
-
const SubMenuItem = styled.li `
|
|
60
|
-
display: block;
|
|
61
|
-
position: relative;
|
|
62
|
-
> a {
|
|
63
|
-
color: ${p => (p.isHighlighted ? theme.color.text.pink : theme.color.text.black)};
|
|
64
|
-
span {
|
|
65
|
-
position: relative;
|
|
66
|
-
&:after {
|
|
67
|
-
position: absolute;
|
|
68
|
-
content: '';
|
|
69
|
-
width: 100%;
|
|
70
|
-
bottom: -6px;
|
|
71
|
-
left: 0;
|
|
72
|
-
border-bottom: 1px solid
|
|
73
|
-
${p => (p.isHighlighted ? theme.color.default.pink : 'transparent')};
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
78
|
-
const DesktopMenuList = styled(MenuList) `
|
|
79
|
-
ul {
|
|
80
|
-
padding-left: 0;
|
|
81
|
-
|
|
82
|
-
li {
|
|
83
|
-
a,
|
|
84
|
-
button {
|
|
85
|
-
line-height: ${theme.lineHeight.s};
|
|
86
|
-
display: flex;
|
|
87
|
-
width: 100%;
|
|
88
|
-
align-items: center;
|
|
89
|
-
padding: ${getMultipliedSize(theme.base.baseHeight, 1)};
|
|
90
|
-
justify-content: space-between;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
> li {
|
|
95
|
-
> a,
|
|
96
|
-
> button {
|
|
97
|
-
white-space: nowrap;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
a,
|
|
101
|
-
button {
|
|
102
|
-
font-size: ${theme.fontSize.s};
|
|
103
|
-
${media.xl `
|
|
104
|
-
font-size: ${theme.fontSize.default};
|
|
105
|
-
`};
|
|
106
|
-
}
|
|
107
|
-
margin-top: -2px;
|
|
108
|
-
`;
|
|
109
|
-
const DesktopMenuItem = styled(MenuItem) `
|
|
110
|
-
&:first-child > ${MenuLinkWithChildren} {
|
|
111
|
-
margin: 0 ${menuItemMargin};
|
|
112
|
-
}
|
|
113
|
-
> a,
|
|
114
|
-
> button {
|
|
115
|
-
width: auto;
|
|
116
|
-
display: flex;
|
|
117
|
-
padding: 0.75rem 0;
|
|
118
|
-
margin: 0 ${getMultipliedSize(theme.base.baseHeight, 1.3)};
|
|
119
|
-
${media.xl `
|
|
120
|
-
margin: 0 ${menuItemMargin};
|
|
121
|
-
`};
|
|
122
|
-
border-bottom: 3px solid ${theme.color.default.white};
|
|
123
|
-
position: relative;
|
|
124
|
-
color: ${p => (p.isActive ? theme.color.text.pink : theme.color.text.black)};
|
|
125
|
-
&:after {
|
|
126
|
-
position: absolute;
|
|
127
|
-
content: '';
|
|
128
|
-
width: 100%;
|
|
129
|
-
bottom: -4px;
|
|
130
|
-
border-bottom: 1px solid ${p => (p.isActive ? theme.color.default.pink : 'transparent')};
|
|
131
|
-
}
|
|
132
|
-
&:hover,
|
|
133
|
-
&:focus {
|
|
134
|
-
border-bottom: 3px solid ${theme.color.default.white};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
&:hover,
|
|
138
|
-
&:focus {
|
|
139
|
-
> a,
|
|
140
|
-
> button {
|
|
141
|
-
cursor: pointer;
|
|
142
|
-
color: ${theme.color.text.pink};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`;
|
|
146
|
-
const SubMenuList = styled.div `
|
|
147
|
-
position: absolute;
|
|
148
|
-
left: -${getMultipliedSize(theme.base.baseHeight, 0.5)};
|
|
149
|
-
display: ${({ $menuStates, $navItemId }) => ($menuStates === null || $menuStates === void 0 ? void 0 : $menuStates.level1) === $navItemId ? 'block' : 'none'};
|
|
150
|
-
z-index: ${({ $navZIndex }) => $navZIndex + 1};
|
|
151
|
-
margin-top: 1px;
|
|
152
|
-
${({ $menuStates }) => $menuStates.level1 && $menuStates.animate2 && !$menuStates.level2
|
|
153
|
-
? fadeInAnimation
|
|
154
|
-
: noAnimation};
|
|
155
|
-
|
|
156
|
-
width: ${subMenuWidth};
|
|
157
|
-
${media.xl `
|
|
158
|
-
width: ${subMenuWidthXl};
|
|
159
|
-
`};
|
|
160
|
-
> div {
|
|
161
|
-
border-top-left-radius: 0;
|
|
162
|
-
border-top-right-radius: 0;
|
|
163
|
-
}
|
|
164
|
-
`;
|
|
165
|
-
const SubMenuLevel2 = ({ menuItem }) => {
|
|
166
|
-
const { lang, menuLevel, currentUrl } = useContext(NavContext);
|
|
167
|
-
// Handle the case where the submenu is not visible
|
|
168
|
-
const measureRef = useRef(null);
|
|
169
|
-
useEffect(() => {
|
|
170
|
-
const subNavArea = measureRef.current;
|
|
171
|
-
const handleOffSet = () => {
|
|
172
|
-
if (menuLevel.level2 === menuItem.id && measureRef.current) {
|
|
173
|
-
const offsetFix = window.innerHeight - subNavArea.getBoundingClientRect().bottom;
|
|
174
|
-
if (offsetFix < 0) {
|
|
175
|
-
subNavArea.style.setProperty('--nav-item-overflow-fix', `${offsetFix}px`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
handleOffSet();
|
|
180
|
-
}, [menuLevel.level2, menuItem.id]);
|
|
181
|
-
return (React__default.createElement(SubMenuListRight, { role: "menu", "$menuStates": menuLevel, "$navItemId": menuItem.id, "data-testid": "desktop-nav-menu-ul-level-3", ref: measureRef },
|
|
182
|
-
React__default.createElement(Box, { elevation: "high", padding: getMultipliedSize(theme.base.baseHeight, 1) },
|
|
183
|
-
React__default.createElement("ul", null, menuItem.pages.map((item, index) => {
|
|
184
|
-
const menuUrl = item.urls[lang];
|
|
185
|
-
return (React__default.createElement(SubMenuItem, { key: item.id, isHighlighted: isSelected(currentUrl, menuUrl, true), role: "none", "data-testid": `desktop-nav-item-level-3-link-${index + 1}` },
|
|
186
|
-
React__default.createElement(LinkModifier, { menuItem: item, tabIndex: false })));
|
|
187
|
-
})))));
|
|
188
|
-
};
|
|
189
|
-
const SubMenuLevel1 = ({ menuItem }) => {
|
|
190
|
-
const { lang, navZIndex, menuLevel, handleNavMenuClick, currentUrl } = useContext(NavContext);
|
|
191
|
-
const level1HasElements = Boolean(menuItem.pages.length);
|
|
192
|
-
const menuClick = (element) => (e) => {
|
|
193
|
-
e.preventDefault();
|
|
194
|
-
handleNavMenuClick(element.id, 'level2');
|
|
195
|
-
};
|
|
196
|
-
if (!level1HasElements) {
|
|
197
|
-
return null;
|
|
198
|
-
}
|
|
199
|
-
return (React__default.createElement(SubMenuList, { "aria-hidden": false, "$menuStates": menuLevel, "$navItemId": menuItem.id, "$navZIndex": navZIndex, "data-testid": "desktop-nav-menu-ul-level-2" },
|
|
200
|
-
React__default.createElement(Box, { elevation: "high", padding: getMultipliedSize(theme.base.baseHeight, 1) },
|
|
201
|
-
React__default.createElement("ul", null, menuItem.pages.map((element, index) => {
|
|
202
|
-
const menuUrl = element.urls[lang];
|
|
203
|
-
if (element.pages.length) {
|
|
204
|
-
return (React__default.createElement(SubMenuItem, { key: element.id, role: "none", "data-testid": `desktop-nav-item-level-2-link-${index + 1}` },
|
|
205
|
-
React__default.createElement(MenuLinkWithChildren, { isActive: menuLevel.level2 === element.id, isHighlighted: isSelected(currentUrl, menuUrl), onClick: menuClick(element), role: "menuitem", "aria-haspopup": "true", "data-testid": "menu-button-with-children" },
|
|
206
|
-
React__default.createElement("span", null, element.titles[lang]),
|
|
207
|
-
React__default.createElement(Icon, { icon: ChevronRight, size: "1rem" })),
|
|
208
|
-
React__default.createElement(SubMenuLevel2, { menuItem: element })));
|
|
209
|
-
}
|
|
210
|
-
return (React__default.createElement(SubMenuItem, { key: element.id, isHighlighted: isSelected(currentUrl, menuUrl, true), role: "none", "data-testid": `desktop-nav-item-level-2-link-${index + 1}` },
|
|
211
|
-
React__default.createElement(LinkModifier, { menuItem: element, tabIndex: false })));
|
|
212
|
-
})))));
|
|
213
|
-
};
|
|
214
|
-
const MenuItemWithChildren = ({ menuItem, currentLevel }) => {
|
|
215
|
-
const { lang, menuLevel, handleNavMenuClick, currentUrl } = useContext(NavContext);
|
|
216
|
-
const menuClickMain = (element) => (e) => {
|
|
217
|
-
e.preventDefault();
|
|
218
|
-
handleNavMenuClick(element.id, 'level1');
|
|
219
|
-
};
|
|
220
|
-
const menuUrl = menuItem.urls[lang];
|
|
221
|
-
return (React__default.createElement(DesktopMenuItem, { isActive: menuLevel.level1 === menuItem.id || isSelected(currentUrl, menuUrl), role: "none", "data-testid": `desktop-nav-item-level-1-link-${currentLevel + 1}` },
|
|
222
|
-
React__default.createElement(MenuLinkWithChildren, { onClick: menuClickMain(menuItem), role: "menuitem", "aria-haspopup": "true", "data-testid": "menu-button-with-children" },
|
|
223
|
-
React__default.createElement("span", null, menuItem.titles[lang])),
|
|
224
|
-
React__default.createElement(SubMenuLevel1, { menuItem: menuItem })));
|
|
225
|
-
};
|
|
226
|
-
const DesktopMenu = () => {
|
|
227
|
-
var _a;
|
|
228
|
-
const { items, lang, resetMenuEvents, menuLevel, currentUrl } = useContext(NavContext);
|
|
229
|
-
const mainNavigation = ((_a = items === null || items === void 0 ? void 0 : items.mainNavigation) === null || _a === void 0 ? void 0 : _a.pages) || [];
|
|
230
|
-
const ref = useRef(null);
|
|
231
|
-
useOutsideClick(ref, () => {
|
|
232
|
-
if (menuLevel.level1 || menuLevel.level2) {
|
|
233
|
-
resetMenuEvents();
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
if (!mainNavigation.length) {
|
|
237
|
-
return null;
|
|
238
|
-
}
|
|
239
|
-
return (React__default.createElement(DesktopMenuList, { role: "menubar", "aria-hidden": false, ref: ref, "data-testid": "desktop-nav-menu-ul" }, mainNavigation.map((navElement, index) => {
|
|
240
|
-
var _a;
|
|
241
|
-
const menuHasChildren = !!((_a = navElement.pages) === null || _a === void 0 ? void 0 : _a.length);
|
|
242
|
-
if (menuHasChildren) {
|
|
243
|
-
return (React__default.createElement(MenuItemWithChildren, { menuItem: navElement, key: navElement.id, currentLevel: index }));
|
|
244
|
-
}
|
|
245
|
-
return (React__default.createElement(DesktopMenuItem, { key: navElement.id, role: "none", "data-testid": `desktop-nav-item-level-1-link-${index + 1}`, isActive: menuLevel.level1 === navElement.id ||
|
|
246
|
-
isSelected(currentUrl, navElement.urls[lang]) },
|
|
247
|
-
React__default.createElement(LinkModifier, { menuItem: navElement, tabIndex: false })));
|
|
248
|
-
})));
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
export { DesktopMenu as default };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { MainNavigationProps } from '../MainNavigation';
|
|
3
|
-
export declare const IconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
|
-
isActive?: boolean;
|
|
5
|
-
collapseSize: number;
|
|
6
|
-
}>> & string;
|
|
7
|
-
declare const HeaderNavigationElements: ({ navElementProps, }: {
|
|
8
|
-
navElementProps: MainNavigationProps;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
export default HeaderNavigationElements;
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { Close, Menu } from '@dnanpm/icons';
|
|
2
|
-
import React__default, { useContext } from 'react';
|
|
3
|
-
import { styled } from 'styled-components';
|
|
4
|
-
import theme from '../../../themes/theme.js';
|
|
5
|
-
import breakpoints from '../../../themes/themeComponents/breakpoints.js';
|
|
6
|
-
import { IconContainerWidth, navIconSizeMobile, navIconSize, wideMenuBreakpoint, mobileLogoSize, desktopLogoSize } from '../../../themes/themeComponents/navigation.js';
|
|
7
|
-
import { getMultipliedSize } from '../../../utils/styledUtils.js';
|
|
8
|
-
import DnaLogo from '../../DnaLogo/DnaLogo.js';
|
|
9
|
-
import Icon from '../../Icon/Icon.js';
|
|
10
|
-
import NavContext from '../context/NavContext.js';
|
|
11
|
-
import BusinessMenu from './BusinessMenu.js';
|
|
12
|
-
import DesktopMenu from './DesktopMenu.js';
|
|
13
|
-
import LanguageSelector from './LanguageSelector.js';
|
|
14
|
-
import LoginTooltip from './LoginTooltip.js';
|
|
15
|
-
import MinicartTooltip from './MinicartTooltip.js';
|
|
16
|
-
import PageSearch from './PageSearch.js';
|
|
17
|
-
|
|
18
|
-
const DesktopMenuContainer = styled.div `
|
|
19
|
-
height: 100%;
|
|
20
|
-
display: none;
|
|
21
|
-
border-bottom: 1px solid ${theme.color.line.L03};
|
|
22
|
-
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
23
|
-
display: block;
|
|
24
|
-
padding-left: ${getMultipliedSize(theme.base.baseWidth, 0.5)};
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
const IconContainer = styled.div `
|
|
28
|
-
margin: 0;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
align-items: center;
|
|
33
|
-
width: ${IconContainerWidth};
|
|
34
|
-
transition: color 0.2s ease-in-out;
|
|
35
|
-
|
|
36
|
-
> span.dnasg-icon > svg {
|
|
37
|
-
display: block;
|
|
38
|
-
height: ${navIconSizeMobile};
|
|
39
|
-
width: ${navIconSizeMobile};
|
|
40
|
-
}
|
|
41
|
-
> span.dnasg-icon > svg,
|
|
42
|
-
> span.dnasg-icon + span {
|
|
43
|
-
color: ${p => (p.isActive ? theme.color.text.pink : 'inherit')};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
47
|
-
> span.dnasg-icon > svg {
|
|
48
|
-
height: ${navIconSize};
|
|
49
|
-
width: ${navIconSize};
|
|
50
|
-
}
|
|
51
|
-
> span.dnasg-icon + span {
|
|
52
|
-
display: block;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
@media (min-width: ${wideMenuBreakpoint}px) {
|
|
56
|
-
margin: 0 ${getMultipliedSize(theme.base.baseHeight, 0.4)} 0
|
|
57
|
-
${getMultipliedSize(theme.base.baseHeight, 2)};
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
|
-
const HeaderIconContainer = styled.div `
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: flex-end;
|
|
63
|
-
border-bottom: 1px solid ${theme.color.line.L03};
|
|
64
|
-
padding-right: 0;
|
|
65
|
-
flex: 1 1 100%;
|
|
66
|
-
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
67
|
-
padding-right: 1rem;
|
|
68
|
-
}
|
|
69
|
-
button {
|
|
70
|
-
&:focus {
|
|
71
|
-
outline: none;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
const HeaderIconWrapper = styled.div `
|
|
76
|
-
display: flex;
|
|
77
|
-
flex: 1 1 100%;
|
|
78
|
-
justify-content: space-between;
|
|
79
|
-
max-width: 18.75rem;
|
|
80
|
-
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
81
|
-
justify-content: flex-end;
|
|
82
|
-
flex: 0 0 100%;
|
|
83
|
-
}
|
|
84
|
-
`;
|
|
85
|
-
const MobileMenuButton = styled.button `
|
|
86
|
-
display: block;
|
|
87
|
-
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
88
|
-
display: none;
|
|
89
|
-
}
|
|
90
|
-
div > span.dnasg-icon > svg {
|
|
91
|
-
height: ${navIconSizeMobile};
|
|
92
|
-
width: ${navIconSizeMobile};
|
|
93
|
-
margin: 0 auto;
|
|
94
|
-
}
|
|
95
|
-
&:focus,
|
|
96
|
-
&:active {
|
|
97
|
-
color: ${theme.color.text.pink};
|
|
98
|
-
}
|
|
99
|
-
font-size: 100%;
|
|
100
|
-
font-family: inherit;
|
|
101
|
-
border: 0;
|
|
102
|
-
padding: 0;
|
|
103
|
-
background: transparent;
|
|
104
|
-
`;
|
|
105
|
-
const MenuWrapper = styled.div `
|
|
106
|
-
height: 50%;
|
|
107
|
-
white-space: nowrap;
|
|
108
|
-
align-self: flex-end;
|
|
109
|
-
`;
|
|
110
|
-
const LogoContainer = styled.div `
|
|
111
|
-
margin: 0;
|
|
112
|
-
width: ${mobileLogoSize};
|
|
113
|
-
height: ${mobileLogoSize};
|
|
114
|
-
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
115
|
-
width: ${desktopLogoSize};
|
|
116
|
-
height: ${desktopLogoSize};
|
|
117
|
-
}
|
|
118
|
-
`;
|
|
119
|
-
const HeaderIconWrapperNoMargin = styled.div `
|
|
120
|
-
margin: 0;
|
|
121
|
-
`;
|
|
122
|
-
const RenderDesktopMenu = ({ collapseSize }) => (React__default.createElement(DesktopMenuContainer, { collapseSize: collapseSize },
|
|
123
|
-
React__default.createElement(MenuWrapper, null,
|
|
124
|
-
React__default.createElement(BusinessMenu, null)),
|
|
125
|
-
React__default.createElement(MenuWrapper, null,
|
|
126
|
-
React__default.createElement(DesktopMenu, null))));
|
|
127
|
-
const MenuFunctionality = ({ menuProps }) => {
|
|
128
|
-
var _a;
|
|
129
|
-
const { collapseSize = breakpoints.md, search: isSearch, searchText: searchLabel, minicart: isMinicart, minicartText: minicartLabel, minicartAmount = 0, login: isLogin, loginText: loginLabel, language = 'fi', languageSelector: languageSelectorActive, items, } = menuProps;
|
|
130
|
-
const languagesObject = (_a = items === null || items === void 0 ? void 0 : items.languageSelector) === null || _a === void 0 ? void 0 : _a.urls;
|
|
131
|
-
const { handleToggleClick, isMobileMenuOpen } = useContext(NavContext);
|
|
132
|
-
return (React__default.createElement(HeaderIconContainer, { collapseSize: collapseSize },
|
|
133
|
-
React__default.createElement(HeaderIconWrapper, { collapseSize: collapseSize },
|
|
134
|
-
languagesObject && languageSelectorActive && (React__default.createElement(IconContainer, { "data-testid": "language-selector-container", collapseSize: collapseSize },
|
|
135
|
-
React__default.createElement(LanguageSelector, { currentLanguage: language, languagesObject: languagesObject }))),
|
|
136
|
-
isSearch && (React__default.createElement(IconContainer, { "data-testid": "header-search-container", collapseSize: collapseSize },
|
|
137
|
-
React__default.createElement(PageSearch, { searchLabel: searchLabel }))),
|
|
138
|
-
isMinicart && (React__default.createElement(IconContainer, { "data-testid": "header-minicart-container", collapseSize: collapseSize },
|
|
139
|
-
React__default.createElement(MinicartTooltip, { minicartAmount: minicartAmount, minicartLabel: minicartLabel }))),
|
|
140
|
-
isLogin && (React__default.createElement(IconContainer, { "data-testid": "header-login-container", collapseSize: collapseSize },
|
|
141
|
-
React__default.createElement(LoginTooltip, { loginLabel: loginLabel }))),
|
|
142
|
-
React__default.createElement(MobileMenuButton, { onClick: handleToggleClick, "aria-label": "menu toggle", role: "button", "aria-expanded": isMobileMenuOpen, collapseSize: collapseSize, "data-testid": "header-mobile-menu-toggle" },
|
|
143
|
-
React__default.createElement(IconContainer, { isActive: isMobileMenuOpen, collapseSize: collapseSize },
|
|
144
|
-
React__default.createElement(Icon, { icon: isMobileMenuOpen ? Close : Menu, size: "2rem" }))))));
|
|
145
|
-
};
|
|
146
|
-
const HeaderNavigationElements = ({ navElementProps, }) => {
|
|
147
|
-
var _a;
|
|
148
|
-
const { collapseSize = breakpoints.md, items, language = 'fi' } = navElementProps;
|
|
149
|
-
const currentBusinessSite = (_a = items === null || items === void 0 ? void 0 : items.businessSelector) === null || _a === void 0 ? void 0 : _a.items.find(item => item.businessId === items.businessId);
|
|
150
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
151
|
-
React__default.createElement(HeaderIconWrapperNoMargin, null,
|
|
152
|
-
React__default.createElement("a", { href: currentBusinessSite === null || currentBusinessSite === void 0 ? void 0 : currentBusinessSite.urls[language], title: "DNA", "aria-label": "DNA", "data-testid": "dna-logo-link" },
|
|
153
|
-
React__default.createElement(LogoContainer, { collapseSize: collapseSize },
|
|
154
|
-
React__default.createElement(DnaLogo, { size: "100%" })))),
|
|
155
|
-
React__default.createElement(RenderDesktopMenu, { collapseSize: collapseSize }),
|
|
156
|
-
React__default.createElement(MenuFunctionality, { menuProps: navElementProps })));
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export { IconContainer, HeaderNavigationElements as default };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Globe } from '@dnanpm/icons';
|
|
2
|
-
import React__default, { useContext, useCallback } from 'react';
|
|
3
|
-
import { styled } from 'styled-components';
|
|
4
|
-
import theme from '../../../themes/theme.js';
|
|
5
|
-
import { getMultipliedSize } from '../../../utils/styledUtils.js';
|
|
6
|
-
import Icon from '../../Icon/Icon.js';
|
|
7
|
-
import NavContext from '../context/NavContext.js';
|
|
8
|
-
import { MenuLink } from '../globalNavStyles.js';
|
|
9
|
-
import MainNavTooltipMenu from './MainNavTooltipMenu.js';
|
|
10
|
-
|
|
11
|
-
const MenuItem = styled(MenuLink) `
|
|
12
|
-
font-weight: ${theme.fontWeight.medium};
|
|
13
|
-
margin: ${getMultipliedSize(theme.base.baseHeight, 1)} auto;
|
|
14
|
-
text-align: center;
|
|
15
|
-
`;
|
|
16
|
-
const LangComponent = ({ currentLanguage, languagesObject }) => (React__default.createElement(React__default.Fragment, null, Object.entries(languagesObject)
|
|
17
|
-
.filter(([key]) => key.toLowerCase() !== currentLanguage.toLowerCase())
|
|
18
|
-
.map(([key, value]) => (React__default.createElement(MenuItem, { key: `language-${key}`, href: value }, key.toUpperCase())))));
|
|
19
|
-
const LanguageSelector = ({ currentLanguage, languagesObject }) => {
|
|
20
|
-
const { isMobileMenu, navZIndex } = useContext(NavContext);
|
|
21
|
-
const LngComponent = useCallback(() => React__default.createElement(LangComponent, { currentLanguage: currentLanguage, languagesObject: languagesObject }), [currentLanguage, languagesObject]);
|
|
22
|
-
if (Object.keys(languagesObject).length < 2) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return (React__default.createElement(MainNavTooltipMenu, { zIndex: navZIndex + 1, tooltipRight: isMobileMenu ? '13.8rem' : '11.8rem', contentComponent: LngComponent, contentWidth: "5rem", globalStateString: "lang", closeWhenTagClicked: ['a'] },
|
|
26
|
-
React__default.createElement(Icon, { icon: Globe, size: "2rem" }),
|
|
27
|
-
React__default.createElement("span", { "data-testid": "header-lang-label" }, currentLanguage.toUpperCase())));
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export { LanguageSelector as default };
|