@dnanpm/styleguide 3.7.2 → 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 +29 -22
- 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.d.ts +1 -1
- 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 +4 -4
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +28 -30
- 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.d.ts +3 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +9 -11
- 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.d.ts +11 -2
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +41 -43
- 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 +14 -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/Carousel/Carousel.d.ts +1 -1
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.d.ts +4 -4
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +5 -3
- package/build/es/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenuExportedStyles.d.ts +2 -2
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.d.ts +3 -2
- package/build/es/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +4 -2
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.d.ts +11 -2
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +8 -6
- 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 +60 -25
- package/build/es/components/PriorityNavigationItem/PriorityNavigationItem.js +10 -1
- package/build/es/components/ReadMore/ReadMore.js +1 -0
- 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 +49 -53
|
@@ -12,30 +12,26 @@ var ButtonIcon = require('../Button/ButtonIcon.js');
|
|
|
12
12
|
var Icon = require('../Icon/Icon.js');
|
|
13
13
|
var LabelText = require('../LabelText/LabelText.js');
|
|
14
14
|
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
|
|
19
15
|
const iconsMap = {
|
|
20
16
|
success: icons.Check,
|
|
21
17
|
error: icons.Error,
|
|
22
18
|
};
|
|
23
|
-
const FieldContainer = styled
|
|
24
|
-
color: ${theme
|
|
25
|
-
margin-bottom: ${styledUtils.getMultipliedSize(theme
|
|
19
|
+
const FieldContainer = styled.default.div `
|
|
20
|
+
color: ${theme.default.color.text.black};
|
|
21
|
+
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
26
22
|
`;
|
|
27
|
-
const FieldWrapper = styled
|
|
23
|
+
const FieldWrapper = styled.default.div `
|
|
28
24
|
position: relative;
|
|
29
25
|
display: flex;
|
|
30
|
-
border-radius: ${theme
|
|
31
|
-
border: 1px solid ${theme
|
|
32
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
33
|
-
padding: 0 ${styledUtils.getMultipliedSize(theme
|
|
34
|
-
background-color: ${theme
|
|
26
|
+
border-radius: ${theme.default.radius.s};
|
|
27
|
+
border: 1px solid ${theme.default.color.line.L01};
|
|
28
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)};
|
|
29
|
+
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
30
|
+
background-color: ${theme.default.color.background.white.default};
|
|
35
31
|
|
|
36
32
|
${({ status }) => status === 'error' &&
|
|
37
33
|
`
|
|
38
|
-
border-bottom: 4px solid ${theme
|
|
34
|
+
border-bottom: 4px solid ${theme.default.color.notification.error};
|
|
39
35
|
`}
|
|
40
36
|
|
|
41
37
|
${({ $type }) => $type === 'range' &&
|
|
@@ -51,38 +47,38 @@ const FieldWrapper = styled["default"].div `
|
|
|
51
47
|
|
|
52
48
|
${({ $disabled }) => $disabled &&
|
|
53
49
|
`
|
|
54
|
-
background-color: ${theme
|
|
50
|
+
background-color: ${theme.default.color.background.sand.E01};
|
|
55
51
|
`}
|
|
56
52
|
|
|
57
53
|
&:focus-within {
|
|
58
|
-
border: 2px solid ${theme
|
|
59
|
-
box-shadow: 0px 0px 0px 2px ${theme
|
|
60
|
-
border-radius: ${theme
|
|
54
|
+
border: 2px solid ${theme.default.color.focus.light};
|
|
55
|
+
box-shadow: 0px 0px 0px 2px ${theme.default.color.focus.dark};
|
|
56
|
+
border-radius: ${theme.default.radius.s};
|
|
61
57
|
}
|
|
62
58
|
`;
|
|
63
|
-
const IconWrapper = styled
|
|
64
|
-
margin-left: ${styledUtils.getMultipliedSize(theme
|
|
59
|
+
const IconWrapper = styled.default.div `
|
|
60
|
+
margin-left: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
65
61
|
display: flex;
|
|
66
62
|
flex-wrap: nowrap;
|
|
67
|
-
border-radius: ${theme
|
|
63
|
+
border-radius: ${theme.default.radius.s};
|
|
68
64
|
align-items: center;
|
|
69
65
|
|
|
70
66
|
& span.dnasg-icon {
|
|
71
|
-
margin-left: ${styledUtils.getDividedSize(theme
|
|
67
|
+
margin-left: ${styledUtils.getDividedSize(theme.default.base.baseWidth, 2)};
|
|
72
68
|
|
|
73
69
|
&:first-of-type {
|
|
74
70
|
margin-left: 0;
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
73
|
`;
|
|
78
|
-
const StyledInput = styled
|
|
74
|
+
const StyledInput = styled.default.input `
|
|
79
75
|
position: relative;
|
|
80
76
|
display: inline-block;
|
|
81
77
|
appearance: none;
|
|
82
78
|
vertical-align: middle;
|
|
83
|
-
font-family: ${theme
|
|
84
|
-
font-size: ${theme
|
|
85
|
-
border-radius: ${theme
|
|
79
|
+
font-family: ${theme.default.fontFamily.default};
|
|
80
|
+
font-size: ${theme.default.fontSize.default};
|
|
81
|
+
border-radius: ${theme.default.radius.s};
|
|
86
82
|
width: 100%;
|
|
87
83
|
border: 0 none;
|
|
88
84
|
outline: 0;
|
|
@@ -103,19 +99,19 @@ const StyledInput = styled["default"].input `
|
|
|
103
99
|
}
|
|
104
100
|
|
|
105
101
|
&::placeholder {
|
|
106
|
-
color: ${theme
|
|
102
|
+
color: ${theme.default.color.text.black}${theme.default.color.transparency.T40};
|
|
107
103
|
}
|
|
108
104
|
`;
|
|
109
|
-
const Message = styled
|
|
110
|
-
font-size: ${theme
|
|
111
|
-
font-weight: ${theme
|
|
112
|
-
line-height: ${theme
|
|
113
|
-
color: ${theme
|
|
114
|
-
margin-top: ${styledUtils.getMultipliedSize(theme
|
|
105
|
+
const Message = styled.default.div `
|
|
106
|
+
font-size: ${theme.default.fontSize.s};
|
|
107
|
+
font-weight: ${theme.default.fontWeight.book};
|
|
108
|
+
line-height: ${theme.default.lineHeight.s};
|
|
109
|
+
color: ${theme.default.color.text.gray};
|
|
110
|
+
margin-top: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
115
111
|
`;
|
|
116
|
-
const ErrorMessage = styled
|
|
117
|
-
font-weight: ${theme
|
|
118
|
-
color: ${theme
|
|
112
|
+
const ErrorMessage = styled.default(Message) `
|
|
113
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
114
|
+
color: ${theme.default.color.notification.error};
|
|
119
115
|
`;
|
|
120
116
|
const Input = (_a) => {
|
|
121
117
|
var { type = 'text', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["type", 'data-testid']);
|
|
@@ -147,22 +143,22 @@ const Input = (_a) => {
|
|
|
147
143
|
inputRef.current.focus();
|
|
148
144
|
}
|
|
149
145
|
};
|
|
150
|
-
return (
|
|
151
|
-
props.label && (
|
|
152
|
-
|
|
153
|
-
|
|
146
|
+
return (React.createElement(FieldContainer, { className: props.className },
|
|
147
|
+
props.label && (React.createElement(LabelText.default, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label`, status: props.status === 'error' ? props.status : undefined, isMandatory: props.required }, props.label)),
|
|
148
|
+
React.createElement(FieldWrapper, { status: props.status, "$type": type, "$disabled": props.disabled },
|
|
149
|
+
React.createElement(StyledInput, { id: props.id, name: props.name, type: type, value: props.value, placeholder: props.placeholder, onChange: handleChange, onBlur: handleOnBlur, onFocus: props.onFocus, onClick: onClick, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, required: props.required, disabled: props.disabled, autoComplete: props.autocomplete, "aria-disabled": props.disabled, "aria-label": props.id, ref: inputRef, tabIndex: props.tabIndex, "data-testid": dataTestId, readOnly: props.readonly }),
|
|
154
150
|
((props.status && props.status !== 'comment') ||
|
|
155
151
|
props.showPasswordToggle ||
|
|
156
152
|
props.disabled ||
|
|
157
|
-
props.onClearableButtonClick) && (
|
|
158
|
-
props.showPasswordToggle && (
|
|
159
|
-
(props.status === 'success' || props.status === 'error') && (
|
|
160
|
-
props.disabled &&
|
|
153
|
+
props.onClearableButtonClick) && (React.createElement(IconWrapper, null,
|
|
154
|
+
props.showPasswordToggle && (React.createElement(Icon.default, { icon: showPassword ? icons.EyeOpen : icons.EyeClosed, onClick: togglePasswordVisibility })),
|
|
155
|
+
(props.status === 'success' || props.status === 'error') && (React.createElement(Icon.default, { icon: iconsMap[props.status], color: theme.default.color.notification[props.status] })),
|
|
156
|
+
props.disabled && React.createElement(Icon.default, { icon: icons.Lock }),
|
|
161
157
|
props.onClearableButtonClick &&
|
|
162
158
|
Boolean(props.value) &&
|
|
163
|
-
!props.disabled && (
|
|
164
|
-
props.status === 'error' && props.errorMessage && (
|
|
165
|
-
props.status === 'comment' && props.commentMessage && (
|
|
159
|
+
!props.disabled && (React.createElement(ButtonIcon.default, { icon: icons.Close, onClick: props.onClearableButtonClick }))))),
|
|
160
|
+
props.status === 'error' && props.errorMessage && (React.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage)),
|
|
161
|
+
props.status === 'comment' && props.commentMessage && (React.createElement(Message, { "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage))));
|
|
166
162
|
};
|
|
167
163
|
|
|
168
|
-
exports
|
|
164
|
+
exports.default = Input;
|
|
@@ -8,32 +8,28 @@ var styled = require('../../themes/styled.js');
|
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.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 colorsMap = {
|
|
16
|
-
campaign: theme
|
|
17
|
-
new: theme
|
|
18
|
-
presale: theme
|
|
19
|
-
other: theme
|
|
12
|
+
campaign: theme.default.color.background.pink.E01,
|
|
13
|
+
new: theme.default.color.background.lemon.default,
|
|
14
|
+
presale: theme.default.color.background.orange.default,
|
|
15
|
+
other: theme.default.color.background.sky.default,
|
|
20
16
|
};
|
|
21
|
-
const StyledLabel = styled
|
|
17
|
+
const StyledLabel = styled.default.span `
|
|
22
18
|
display: inline-block;
|
|
23
|
-
color: ${theme
|
|
19
|
+
color: ${theme.default.color.text.black};
|
|
24
20
|
background-color: ${({ type }) => colorsMap[type]};
|
|
25
|
-
font-size: ${theme
|
|
26
|
-
font-weight: ${theme
|
|
27
|
-
line-height: ${theme
|
|
28
|
-
padding: ${styledUtils.getDividedSize(theme
|
|
29
|
-
${styledUtils.getMultipliedSize(theme
|
|
21
|
+
font-size: ${theme.default.fontSize.s};
|
|
22
|
+
font-weight: ${theme.default.fontWeight.bold};
|
|
23
|
+
line-height: ${theme.default.lineHeight.s};
|
|
24
|
+
padding: ${styledUtils.getDividedSize(theme.default.base.baseWidth, 5)}
|
|
25
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
30
26
|
text-align: center;
|
|
31
27
|
text-transform: uppercase;
|
|
32
|
-
border-radius: ${theme
|
|
28
|
+
border-radius: ${theme.default.radius.pill};
|
|
33
29
|
`;
|
|
34
30
|
const Label = (_a) => {
|
|
35
31
|
var { 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ['data-testid']);
|
|
36
|
-
return (
|
|
32
|
+
return (React.createElement(StyledLabel, { type: props.type, className: props.className, "data-testid": dataTestId }, props.children));
|
|
37
33
|
};
|
|
38
34
|
|
|
39
|
-
exports
|
|
35
|
+
exports.default = Label;
|
|
@@ -8,28 +8,24 @@ var styled = require('../../themes/styled.js');
|
|
|
8
8
|
var theme = require('../../themes/theme.js');
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
|
|
15
|
-
const Label = styled["default"].label `
|
|
11
|
+
const Label = styled.default.label `
|
|
16
12
|
display: block;
|
|
17
|
-
color: ${({ status }) => (status ? theme
|
|
18
|
-
font-weight: ${theme
|
|
19
|
-
font-size: ${theme
|
|
20
|
-
line-height: ${theme
|
|
21
|
-
margin-bottom: ${styledUtils.getDividedSize(theme
|
|
13
|
+
color: ${({ status }) => (status ? theme.default.color.notification[status] : theme.default.color.text.gray)};
|
|
14
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
15
|
+
font-size: ${theme.default.fontSize.default};
|
|
16
|
+
line-height: ${theme.default.lineHeight.default};
|
|
17
|
+
margin-bottom: ${styledUtils.getDividedSize(theme.default.base.baseWidth, 2)};
|
|
22
18
|
${({ htmlFor }) => htmlFor && `cursor: pointer`};
|
|
23
19
|
`;
|
|
24
|
-
const Mandatory = styled
|
|
25
|
-
color: ${theme
|
|
20
|
+
const Mandatory = styled.default.span `
|
|
21
|
+
color: ${theme.default.color.text.pink};
|
|
26
22
|
`;
|
|
27
23
|
/** @visibleName Label Text */
|
|
28
24
|
const LabelText = (_a) => {
|
|
29
25
|
var { 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ['data-testid']);
|
|
30
|
-
return (
|
|
26
|
+
return (React.createElement(Label, { id: props.id, htmlFor: props.htmlFor, className: props.className, "data-testid": dataTestId, status: props.status },
|
|
31
27
|
props.children,
|
|
32
|
-
props.isMandatory &&
|
|
28
|
+
props.isMandatory && React.createElement(Mandatory, null, "*")));
|
|
33
29
|
};
|
|
34
30
|
|
|
35
|
-
exports
|
|
31
|
+
exports.default = LabelText;
|
|
@@ -7,56 +7,52 @@ var styled = require('../../../themes/styled.js');
|
|
|
7
7
|
var theme = require('../../../themes/theme.js');
|
|
8
8
|
var styledUtils = require('../../../utils/styledUtils.js');
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
font-weight: ${theme["default"].fontWeight.medium};
|
|
19
|
-
font-size: ${theme["default"].fontSize.xs};
|
|
20
|
-
line-height: ${theme["default"].lineHeight.s};
|
|
21
|
-
border-radius: ${theme["default"].radius.pill};
|
|
10
|
+
const BusinessMenuLink = styled.default.a `
|
|
11
|
+
background-color: ${p => p.isActive ? theme.default.color.background.white.default : theme.default.color.background.plum.E02};
|
|
12
|
+
color: ${p => (p.isActive ? theme.default.color.text.black : theme.default.color.text.white)};
|
|
13
|
+
font-family: ${theme.default.fontFamily.default};
|
|
14
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
15
|
+
font-size: ${theme.default.fontSize.xs};
|
|
16
|
+
line-height: ${theme.default.lineHeight.s};
|
|
17
|
+
border-radius: ${theme.default.radius.pill};
|
|
22
18
|
display: block;
|
|
23
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
19
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
24
20
|
${styledUtils.media.md `
|
|
25
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
21
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)} ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
26
22
|
`};
|
|
27
23
|
${styledUtils.media.xs `
|
|
28
|
-
font-size: ${theme
|
|
24
|
+
font-size: ${theme.default.fontSize.s};
|
|
29
25
|
`};
|
|
30
26
|
|
|
31
27
|
&:hover,
|
|
32
28
|
&:focus {
|
|
33
29
|
text-decoration: none;
|
|
34
|
-
color: ${p => (p.isActive ? theme
|
|
30
|
+
color: ${p => (p.isActive ? theme.default.color.text.black : theme.default.color.text.white)};
|
|
35
31
|
background-color: ${p => p.isActive
|
|
36
|
-
? theme
|
|
37
|
-
: theme
|
|
32
|
+
? theme.default.color.background.white.default
|
|
33
|
+
: theme.default.color.background.plum.default};
|
|
38
34
|
outline: none;
|
|
39
35
|
}
|
|
40
36
|
&:focus-visible {
|
|
41
37
|
outline: none;
|
|
42
|
-
box-shadow: 0px 0px 0px 2px ${theme
|
|
43
|
-
0px 0px 0px 4px ${theme
|
|
38
|
+
box-shadow: 0px 0px 0px 2px ${theme.default.color.focus.light},
|
|
39
|
+
0px 0px 0px 4px ${theme.default.color.focus.dark};
|
|
44
40
|
}
|
|
45
41
|
`;
|
|
46
|
-
const BusinessMenuList = styled
|
|
42
|
+
const BusinessMenuList = styled.default.nav `
|
|
47
43
|
display: flex;
|
|
48
|
-
gap: ${styledUtils.getMultipliedSize(theme
|
|
49
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
50
|
-
${styledUtils.getMultipliedSize(theme
|
|
44
|
+
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
45
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)}
|
|
46
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
51
47
|
${styledUtils.media.md `
|
|
52
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
48
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)} ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.5)};
|
|
53
49
|
`};
|
|
54
50
|
`;
|
|
55
51
|
const BusinessMenu = ({ ariaLabel, currentBusinessId, items, lang }) => {
|
|
56
52
|
if (!(items === null || items === void 0 ? void 0 : items.length)) {
|
|
57
53
|
return null;
|
|
58
54
|
}
|
|
59
|
-
return (
|
|
55
|
+
return (React.createElement(BusinessMenuList, { "aria-label": ariaLabel, "data-testid": "business-menu", role: "navigation" }, items.map(item => (React.createElement(BusinessMenuLink, { className: `menu-link ${item.businessId === currentBusinessId ? 'active-site' : ''}`, href: item.urls[lang], isActive: item.businessId === currentBusinessId, key: item.businessId }, item.titles[lang])))));
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
exports
|
|
58
|
+
exports.default = BusinessMenu;
|
|
@@ -14,10 +14,6 @@ var NavContext = require('../context/NavContext.js');
|
|
|
14
14
|
var globalNavStyles = require('../globalNavStyles.js');
|
|
15
15
|
var LinkModifier = require('./LinkModifier.js');
|
|
16
16
|
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
|
|
21
17
|
const fadeIn = styled.keyframes `
|
|
22
18
|
0% {
|
|
23
19
|
opacity: 0;
|
|
@@ -34,56 +30,56 @@ const fadeInAnimation = styled.css `
|
|
|
34
30
|
const noAnimation = styled.css `
|
|
35
31
|
animation: none;
|
|
36
32
|
`;
|
|
37
|
-
const MegaMenuContent = styled
|
|
33
|
+
const MegaMenuContent = styled.default.ul `
|
|
38
34
|
display: grid;
|
|
39
35
|
grid-template-columns: 25% 25% 25% 25%;
|
|
40
36
|
padding-left: 0;
|
|
41
37
|
`;
|
|
42
|
-
const CategoryTitle = styled
|
|
38
|
+
const CategoryTitle = styled.default.span `
|
|
43
39
|
display: flex;
|
|
44
|
-
font-size: ${theme
|
|
45
|
-
line-height: ${theme
|
|
46
|
-
font-weight: ${theme
|
|
47
|
-
padding: 0 ${styledUtils.getMultipliedSize(theme
|
|
48
|
-
${styledUtils.getMultipliedSize(theme
|
|
40
|
+
font-size: ${theme.default.fontSize.default};
|
|
41
|
+
line-height: ${theme.default.lineHeight.default};
|
|
42
|
+
font-weight: ${theme.default.fontWeight.bold};
|
|
43
|
+
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)}
|
|
44
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
49
45
|
${styledUtils.media.xl `
|
|
50
|
-
font-size: ${theme
|
|
46
|
+
font-size: ${theme.default.fontSize.xl};
|
|
51
47
|
`}
|
|
52
48
|
`;
|
|
53
|
-
const CategoryBlock = styled
|
|
49
|
+
const CategoryBlock = styled.default.li `
|
|
54
50
|
display: block;
|
|
55
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
56
|
-
border-right: 1px solid ${theme
|
|
51
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)} 0;
|
|
52
|
+
border-right: 1px solid ${theme.default.color.line.L03};
|
|
57
53
|
|
|
58
54
|
a {
|
|
59
|
-
font-size: ${theme
|
|
60
|
-
line-height: ${theme
|
|
61
|
-
padding: ${styledUtils.getMultipliedSize(theme
|
|
62
|
-
${styledUtils.getMultipliedSize(theme
|
|
55
|
+
font-size: ${theme.default.fontSize.s};
|
|
56
|
+
line-height: ${theme.default.lineHeight.s};
|
|
57
|
+
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)}
|
|
58
|
+
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 3)};
|
|
63
59
|
&:hover,
|
|
64
60
|
&:focus {
|
|
65
|
-
background-color: ${theme
|
|
61
|
+
background-color: ${theme.default.color.background.sand.E01};
|
|
66
62
|
}
|
|
67
63
|
${styledUtils.media.xl `
|
|
68
|
-
font-size: ${theme
|
|
69
|
-
line-height: ${theme
|
|
64
|
+
font-size: ${theme.default.fontSize.default};
|
|
65
|
+
line-height: ${theme.default.lineHeight.default};
|
|
70
66
|
`}
|
|
71
67
|
}
|
|
72
68
|
`;
|
|
73
|
-
const CategoryCollectionBlock = styled
|
|
74
|
-
background-color: ${theme
|
|
69
|
+
const CategoryCollectionBlock = styled.default(CategoryBlock) `
|
|
70
|
+
background-color: ${theme.default.color.background.sand.E01};
|
|
75
71
|
`;
|
|
76
|
-
const SubMenuItem = styled
|
|
72
|
+
const SubMenuItem = styled.default.li `
|
|
77
73
|
> a {
|
|
78
|
-
color: ${p => (p.isHighlighted ? theme
|
|
79
|
-
font-weight: ${p => (p.isHighlighted ? theme
|
|
74
|
+
color: ${p => (p.isHighlighted ? theme.default.color.text.pink : theme.default.color.text.black)};
|
|
75
|
+
font-weight: ${p => (p.isHighlighted ? theme.default.fontWeight.bold : theme.default.fontWeight.book)};
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
`;
|
|
83
|
-
const DesktopMenuList = styled
|
|
79
|
+
const DesktopMenuList = styled.default(globalNavStyles.MenuList) `
|
|
84
80
|
@media (min-width: ${p => p.collapseSize + 1}px) {
|
|
85
81
|
flex-direction: row;
|
|
86
|
-
gap: ${styledUtils.getMultipliedSize(theme
|
|
82
|
+
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.5)};
|
|
87
83
|
}
|
|
88
84
|
ul {
|
|
89
85
|
li {
|
|
@@ -101,16 +97,16 @@ const DesktopMenuList = styled["default"](globalNavStyles.MenuList) `
|
|
|
101
97
|
}
|
|
102
98
|
}
|
|
103
99
|
`;
|
|
104
|
-
const DesktopMenuItem = styled
|
|
100
|
+
const DesktopMenuItem = styled.default(globalNavStyles.MenuItem) `
|
|
105
101
|
> a,
|
|
106
102
|
> button {
|
|
107
103
|
width: auto;
|
|
108
104
|
display: flex;
|
|
109
|
-
gap: ${styledUtils.getMultipliedSize(theme
|
|
105
|
+
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
110
106
|
align-items: center;
|
|
111
|
-
padding: 0 ${styledUtils.getMultipliedSize(theme
|
|
107
|
+
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
112
108
|
height: 100%;
|
|
113
|
-
font-weight: ${theme
|
|
109
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
114
110
|
|
|
115
111
|
> span:first-child {
|
|
116
112
|
position: relative;
|
|
@@ -121,13 +117,13 @@ const DesktopMenuItem = styled["default"](globalNavStyles.MenuItem) `
|
|
|
121
117
|
bottom: -22px;
|
|
122
118
|
left: 0;
|
|
123
119
|
border-bottom: 2px solid
|
|
124
|
-
${p => (p.isActive ? theme
|
|
120
|
+
${p => (p.isActive ? theme.default.color.default.pink : 'transparent')};
|
|
125
121
|
}
|
|
126
122
|
}
|
|
127
123
|
}
|
|
128
124
|
`;
|
|
129
125
|
// MEGAMENU 1st level
|
|
130
|
-
const SubMenuList = styled
|
|
126
|
+
const SubMenuList = styled.default.div `
|
|
131
127
|
position: absolute;
|
|
132
128
|
top: ${navigation.navMaxHeight};
|
|
133
129
|
left: 0;
|
|
@@ -137,9 +133,9 @@ const SubMenuList = styled["default"].div `
|
|
|
137
133
|
${({ menuStates }) => menuStates.level1 && menuStates.animate2 && !menuStates.level2
|
|
138
134
|
? fadeInAnimation
|
|
139
135
|
: noAnimation};
|
|
140
|
-
background-color: ${theme
|
|
141
|
-
max-height: calc(100vh - ${styledUtils.getMultipliedSize(theme
|
|
142
|
-
border-bottom: 1px solid ${theme
|
|
136
|
+
background-color: ${theme.default.color.background.white.default};
|
|
137
|
+
max-height: calc(100vh - ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 3)} - ${navigation.headerMaxHeight});
|
|
138
|
+
border-bottom: 1px solid ${theme.default.color.line.L03};
|
|
143
139
|
overflow: auto;
|
|
144
140
|
ul {
|
|
145
141
|
padding: 0;
|
|
@@ -147,44 +143,44 @@ const SubMenuList = styled["default"].div `
|
|
|
147
143
|
}
|
|
148
144
|
`;
|
|
149
145
|
const SubMenuLevel1 = ({ menuItem }) => {
|
|
150
|
-
const { categoryCollectionText, collapseSize, currentUrl, lang, menuLevel, navZIndex } = React.useContext(NavContext
|
|
146
|
+
const { categoryCollectionText, collapseSize, currentUrl, lang, menuLevel, navZIndex } = React.useContext(NavContext.default);
|
|
151
147
|
const level1HasElements = !!menuItem.pages.length;
|
|
152
148
|
const pagesWithSubItems = menuItem.pages.filter(element => element.pages.length > 0);
|
|
153
149
|
// Helper function to render a sub menu item
|
|
154
|
-
const renderSubMenuItem = (element, index, currUrl) => (
|
|
155
|
-
|
|
150
|
+
const renderSubMenuItem = (element, index, currUrl) => (React.createElement(SubMenuItem, { key: element.id, isHighlighted: LinkModifier.isSelected(currUrl, element.urls[lang], true), "data-testid": `desktop-nav-item-level-2-${index + 1}` },
|
|
151
|
+
React.createElement(LinkModifier.default, { menuItem: element, tabIndex: false })));
|
|
156
152
|
if (!level1HasElements) {
|
|
157
153
|
return null;
|
|
158
154
|
}
|
|
159
|
-
return (
|
|
160
|
-
|
|
161
|
-
pagesWithSubItems.slice(0, 5).map(element => (
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
pagesWithSubItems.length > 5 && (
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
return (React.createElement(SubMenuList, { "aria-hidden": false, menuStates: menuLevel, navItemId: menuItem.id, navZIndex: navZIndex },
|
|
156
|
+
React.createElement(MegaMenuContent, null,
|
|
157
|
+
pagesWithSubItems.slice(0, 5).map(element => (React.createElement(CategoryBlock, { key: element.id },
|
|
158
|
+
React.createElement(CategoryTitle, null, element.titles[lang]),
|
|
159
|
+
React.createElement("ul", { "data-testid": "desktop-nav-menu-ul-level-2" }, element.pages.map((subElement, index) => renderSubMenuItem(subElement, index, currentUrl)))))),
|
|
160
|
+
pagesWithSubItems.length > 5 && (React.createElement(CategoryCollectionBlock, null,
|
|
161
|
+
React.createElement(CategoryTitle, null, categoryCollectionText),
|
|
162
|
+
React.createElement("ul", { "data-testid": "desktop-nav-menu-ul-level-2" }, pagesWithSubItems
|
|
167
163
|
.slice(5)
|
|
168
164
|
.map((element, index) => renderSubMenuItem(element, index, currentUrl))))),
|
|
169
|
-
|
|
165
|
+
React.createElement(globalNavStyles.FeaturedBlock, { collapseSize: collapseSize, "data-testid": "desktop-nav-menu-level-2-featured" }, menuItem.pages.map(element => element.pages.length ? null : (React.createElement(LinkModifier.default, { key: element.id, showIcon: true, menuItem: element, tabIndex: false })))))));
|
|
170
166
|
};
|
|
171
167
|
const MenuItemWithChildren = ({ menuItem, currentLevel }) => {
|
|
172
|
-
const { lang, handleNavMenuClick, currentUrl, menuLevel } = React.useContext(NavContext
|
|
168
|
+
const { lang, handleNavMenuClick, currentUrl, menuLevel } = React.useContext(NavContext.default);
|
|
173
169
|
const menuClickMain = (element) => () => {
|
|
174
170
|
handleNavMenuClick(element.id, 'level1');
|
|
175
171
|
};
|
|
176
|
-
return (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
172
|
+
return (React.createElement(DesktopMenuItem, { isActive: LinkModifier.isSelected(currentUrl, menuItem.urls[lang]), "data-testid": `desktop-nav-item-level-1-${currentLevel + 1}`, role: "presentation" },
|
|
173
|
+
React.createElement(globalNavStyles.MenuLinkWithChildren, { isOpen: menuLevel.level1 === menuItem.id, onClick: menuClickMain(menuItem), role: "menuitem", "aria-haspopup": "true", "data-testid": "menu-button-with-children" },
|
|
174
|
+
React.createElement("span", null, menuItem.titles[lang]),
|
|
175
|
+
React.createElement(Icon.default, { icon: icons.ChevronRight, size: "1rem" })),
|
|
176
|
+
React.createElement(SubMenuLevel1, { menuItem: menuItem })));
|
|
181
177
|
};
|
|
182
178
|
const DesktopMenu = () => {
|
|
183
179
|
var _a;
|
|
184
|
-
const { items, lang, resetMenuEvents, menuLevel, currentUrl, collapseSize } = React.useContext(NavContext
|
|
180
|
+
const { items, lang, resetMenuEvents, menuLevel, currentUrl, collapseSize } = React.useContext(NavContext.default);
|
|
185
181
|
const mainNavigation = ((_a = items === null || items === void 0 ? void 0 : items.mainNavigation) === null || _a === void 0 ? void 0 : _a.pages) || [];
|
|
186
182
|
const ref = React.useRef(null);
|
|
187
|
-
useOutsideClick
|
|
183
|
+
useOutsideClick.default(ref, () => {
|
|
188
184
|
if (menuLevel.level1 || menuLevel.level2) {
|
|
189
185
|
resetMenuEvents();
|
|
190
186
|
}
|
|
@@ -192,15 +188,15 @@ const DesktopMenu = () => {
|
|
|
192
188
|
if (!mainNavigation.length) {
|
|
193
189
|
return null;
|
|
194
190
|
}
|
|
195
|
-
return (
|
|
191
|
+
return (React.createElement(DesktopMenuList, { role: "menu", "aria-hidden": false, ref: ref, "data-testid": "desktop-nav-menu-ul", collapseSize: collapseSize }, mainNavigation.map((navElement, index) => {
|
|
196
192
|
var _a;
|
|
197
193
|
const displaySubMenu = !navElement.pageIsLinkInDesktopNavigation && !!((_a = navElement.pages) === null || _a === void 0 ? void 0 : _a.length);
|
|
198
194
|
if (displaySubMenu) {
|
|
199
|
-
return (
|
|
195
|
+
return (React.createElement(MenuItemWithChildren, { menuItem: navElement, key: navElement.id, currentLevel: index }));
|
|
200
196
|
}
|
|
201
|
-
return (
|
|
202
|
-
|
|
197
|
+
return (React.createElement(DesktopMenuItem, { key: navElement.id, role: "presentation", "data-testid": `desktop-nav-item-level-1-${index + 1}`, isActive: LinkModifier.isSelected(currentUrl, navElement.urls[lang]) },
|
|
198
|
+
React.createElement(LinkModifier.default, { menuItem: navElement, tabIndex: false })));
|
|
203
199
|
})));
|
|
204
200
|
};
|
|
205
201
|
|
|
206
|
-
exports
|
|
202
|
+
exports.default = DesktopMenu;
|
|
@@ -13,27 +13,23 @@ var NavContext = require('../context/NavContext.js');
|
|
|
13
13
|
var globalNavStyles = require('../globalNavStyles.js');
|
|
14
14
|
var MainNavTooltipMenu = require('./MainNavTooltipMenu.js');
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const MenuItem = styled["default"](globalNavStyles.MenuLink) `
|
|
21
|
-
font-weight: ${theme["default"].fontWeight.medium};
|
|
22
|
-
margin: ${styledUtils.getMultipliedSize(theme["default"].base.baseHeight, 1)} auto;
|
|
16
|
+
const MenuItem = styled.default(globalNavStyles.MenuLink) `
|
|
17
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
18
|
+
margin: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)} auto;
|
|
23
19
|
text-align: center;
|
|
24
20
|
`;
|
|
25
|
-
const LangComponent = ({ currentLanguage, languagesObject }) => (
|
|
21
|
+
const LangComponent = ({ currentLanguage, languagesObject }) => (React.createElement(React.Fragment, null, Object.entries(languagesObject)
|
|
26
22
|
.filter(([key]) => key.toLowerCase() !== currentLanguage.toLowerCase())
|
|
27
|
-
.map(([key, value]) => (
|
|
23
|
+
.map(([key, value]) => (React.createElement(MenuItem, { key: `language-${key}`, href: value }, key.toUpperCase())))));
|
|
28
24
|
const LanguageSelector = ({ currentLanguage, languagesObject, languageSelectorLabel, }) => {
|
|
29
|
-
const { isMobileMenu, navZIndex } = React.useContext(NavContext
|
|
30
|
-
const LngComponent = React.useCallback(() => (
|
|
25
|
+
const { isMobileMenu, navZIndex } = React.useContext(NavContext.default);
|
|
26
|
+
const LngComponent = React.useCallback(() => (React.createElement(LangComponent, { languageSelectorLabel: languageSelectorLabel, currentLanguage: currentLanguage, languagesObject: languagesObject })), [currentLanguage, languagesObject, languageSelectorLabel]);
|
|
31
27
|
if (Object.keys(languagesObject).length < 2) {
|
|
32
28
|
return null;
|
|
33
29
|
}
|
|
34
|
-
return (
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
return (React.createElement(MainNavTooltipMenu.default, { ariaLabel: languageSelectorLabel, closeWhenTagClicked: ['a'], contentComponent: LngComponent, contentWidth: "5rem", globalStateString: "lang", tooltipRight: isMobileMenu ? '13.8rem' : '11.8rem', zIndex: navZIndex + 1 },
|
|
31
|
+
React.createElement(Icon.default, { icon: icons.Globe, size: navigation.navIconSize }),
|
|
32
|
+
React.createElement("span", { "data-testid": "header-lang-label" }, currentLanguage.toUpperCase())));
|
|
37
33
|
};
|
|
38
34
|
|
|
39
|
-
exports
|
|
35
|
+
exports.default = LanguageSelector;
|