@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
|
@@ -11,23 +11,18 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
11
11
|
var Icon = require('../Icon/Icon.js');
|
|
12
12
|
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
18
|
-
|
|
19
|
-
const ButtonElement = styled__default["default"].button `
|
|
14
|
+
const ButtonElement = styled.button `
|
|
20
15
|
display: inline-flex;
|
|
21
16
|
align-items: center;
|
|
22
|
-
font-family: ${theme
|
|
23
|
-
font-weight: ${theme
|
|
24
|
-
font-size: ${({ small }) => (small ? theme
|
|
25
|
-
line-height: ${({ small }) => (small ? theme
|
|
17
|
+
font-family: ${theme.default.fontFamily.default};
|
|
18
|
+
font-weight: ${theme.default.fontWeight.bold};
|
|
19
|
+
font-size: ${({ small }) => (small ? theme.default.fontSize.s : theme.default.fontSize.default)};
|
|
20
|
+
line-height: ${({ small }) => (small ? theme.default.lineHeight.xs : theme.default.lineHeight.default)};
|
|
26
21
|
cursor: pointer;
|
|
27
|
-
color: ${({ darkBg }) => (darkBg ? theme
|
|
22
|
+
color: ${({ darkBg }) => (darkBg ? theme.default.color.text.white : theme.default.color.text.black)};
|
|
28
23
|
background-color: transparent;
|
|
29
24
|
border: 2px solid transparent;
|
|
30
|
-
padding: ${styledUtils.getDividedSize(theme
|
|
25
|
+
padding: ${styledUtils.getDividedSize(theme.default.base.baseWidth, 5)} 0;
|
|
31
26
|
|
|
32
27
|
& svg {
|
|
33
28
|
pointer-events: none;
|
|
@@ -36,12 +31,12 @@ const ButtonElement = styled__default["default"].button `
|
|
|
36
31
|
${({ isReversed }) => isReversed && `flex-direction: row-reverse;`}
|
|
37
32
|
|
|
38
33
|
&:focus {
|
|
39
|
-
border-radius: ${theme
|
|
34
|
+
border-radius: ${theme.default.radius.s};
|
|
40
35
|
text-decoration: underline;
|
|
41
36
|
border: 2px solid
|
|
42
|
-
${({ darkBg }) => (darkBg ? theme
|
|
37
|
+
${({ darkBg }) => (darkBg ? theme.default.color.focus.dark : theme.default.color.focus.light)};
|
|
43
38
|
box-shadow: 0px 0px 0px 2px
|
|
44
|
-
${({ darkBg }) => (darkBg ? theme
|
|
39
|
+
${({ darkBg }) => (darkBg ? theme.default.color.focus.light : theme.default.color.focus.dark)};
|
|
45
40
|
outline: none;
|
|
46
41
|
}
|
|
47
42
|
|
|
@@ -51,13 +46,13 @@ const ButtonElement = styled__default["default"].button `
|
|
|
51
46
|
|
|
52
47
|
&:active {
|
|
53
48
|
color: ${({ darkBg }) => darkBg
|
|
54
|
-
? theme
|
|
55
|
-
: theme
|
|
49
|
+
? theme.default.color.text.white + theme.default.color.transparency.T90
|
|
50
|
+
: theme.default.color.text.black + theme.default.color.transparency.T80};
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
&:disabled,
|
|
59
54
|
&[disabled] {
|
|
60
|
-
color: ${({ darkBg }) => darkBg ? theme
|
|
55
|
+
color: ${({ darkBg }) => darkBg ? theme.default.color.text.white + theme.default.color.transparency.T70 : theme.default.color.text.gray};
|
|
61
56
|
pointer-events: none;
|
|
62
57
|
}
|
|
63
58
|
|
|
@@ -92,9 +87,9 @@ const ButtonElement = styled__default["default"].button `
|
|
|
92
87
|
const ButtonIcon = (_a) => {
|
|
93
88
|
var { icon = icons.EditUnderline, 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = tslib.__rest(_a, ["icon", 'data-testid', 'data-no-close', 'data-track-value']);
|
|
94
89
|
const position = props.isReversed ? 'right' : 'left';
|
|
95
|
-
return (
|
|
96
|
-
|
|
97
|
-
props.children && (
|
|
90
|
+
return (React.createElement(ButtonElement, { id: props.id, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, disabled: props.disabled, hideChildrenMobile: props.hideChildrenMobile, isReversed: props.isReversed, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue }, props.loading ? (React.createElement(PixelLoader.default, { color: props.darkBg ? theme.default.color.default.white : theme.default.color.default.black })) : (React.createElement(React.Fragment, null,
|
|
91
|
+
React.createElement(Icon.default, { icon: icon, color: props.darkBg ? theme.default.color.default.white : theme.default.color.default.pink, size: props.small ? '1.25rem' : '1.5rem', position: props.children ? position : undefined }),
|
|
92
|
+
props.children && (React.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))))));
|
|
98
93
|
};
|
|
99
94
|
|
|
100
|
-
exports
|
|
95
|
+
exports.default = ButtonIcon;
|
|
@@ -6,51 +6,47 @@ var styled = require('styled-components');
|
|
|
6
6
|
var theme = require('../../themes/theme.js');
|
|
7
7
|
var Button = require('./Button.js');
|
|
8
8
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
-
|
|
13
9
|
/** @visibleName Button Primary */
|
|
14
|
-
const ButtonPrimary =
|
|
15
|
-
color: ${theme
|
|
16
|
-
background-color: ${theme
|
|
17
|
-
border: 2px solid ${theme
|
|
10
|
+
const ButtonPrimary = styled(Button.default) `
|
|
11
|
+
color: ${theme.default.color.text.white};
|
|
12
|
+
background-color: ${theme.default.color.default.pink};
|
|
13
|
+
border: 2px solid ${theme.default.color.default.pink};
|
|
18
14
|
|
|
19
15
|
&:focus {
|
|
20
|
-
color: ${theme
|
|
21
|
-
background-color: ${theme
|
|
16
|
+
color: ${theme.default.color.text.white};
|
|
17
|
+
background-color: ${theme.default.color.default.pink};
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
&:hover {
|
|
25
|
-
color: ${theme
|
|
21
|
+
color: ${theme.default.color.text.white};
|
|
26
22
|
background-color: ${Button.shade.pink.darker};
|
|
27
23
|
border: 2px solid ${Button.shade.pink.darker};
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
&:active {
|
|
31
|
-
color: ${theme
|
|
27
|
+
color: ${theme.default.color.text.white};
|
|
32
28
|
background-color: ${Button.shade.pink.lighter};
|
|
33
29
|
border: 2px solid ${Button.shade.pink.lighter};
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
&:disabled,
|
|
37
33
|
&[disabled] {
|
|
38
|
-
background-color: ${theme
|
|
39
|
-
border: 2px solid ${theme
|
|
34
|
+
background-color: ${theme.default.color.default.pink + theme.default.color.transparency.T30};
|
|
35
|
+
border: 2px solid ${theme.default.color.default.pink + theme.default.color.transparency.T30};
|
|
40
36
|
background-clip: padding-box;
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
${({ loading }) => loading &&
|
|
44
40
|
`
|
|
45
41
|
&:focus {
|
|
46
|
-
border-color: ${theme
|
|
42
|
+
border-color: ${theme.default.color.default.pink};
|
|
47
43
|
outline: none;
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
> * > * {
|
|
51
|
-
background-color: ${theme
|
|
47
|
+
background-color: ${theme.default.color.default.white};
|
|
52
48
|
}
|
|
53
49
|
`}
|
|
54
50
|
`;
|
|
55
51
|
|
|
56
|
-
exports
|
|
52
|
+
exports.default = ButtonPrimary;
|
|
@@ -9,17 +9,12 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var ButtonPrimary = require('./ButtonPrimary.js');
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
16
|
-
|
|
17
|
-
const ButtonElement = styled__default["default"](ButtonPrimary["default"]) `
|
|
12
|
+
const ButtonElement = styled(ButtonPrimary.default) `
|
|
18
13
|
display: flex;
|
|
19
14
|
min-width: initial;
|
|
20
|
-
width: ${styledUtils.getMultipliedSize(theme
|
|
21
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
22
|
-
border-radius: ${theme
|
|
15
|
+
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 3.2)};
|
|
16
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 3.2)};
|
|
17
|
+
border-radius: ${theme.default.radius.circle};
|
|
23
18
|
padding: initial;
|
|
24
19
|
text-align: center;
|
|
25
20
|
vertical-align: middle;
|
|
@@ -32,7 +27,7 @@ const ButtonElement = styled__default["default"](ButtonPrimary["default"]) `
|
|
|
32
27
|
*/
|
|
33
28
|
const ButtonRound = (_a) => {
|
|
34
29
|
var { 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = tslib.__rest(_a, ['data-testid', 'data-no-close', 'data-track-value']);
|
|
35
|
-
return (
|
|
30
|
+
return (React.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));
|
|
36
31
|
};
|
|
37
32
|
|
|
38
|
-
exports
|
|
33
|
+
exports.default = ButtonRound;
|
|
@@ -6,51 +6,47 @@ var styled = require('styled-components');
|
|
|
6
6
|
var theme = require('../../themes/theme.js');
|
|
7
7
|
var Button = require('./Button.js');
|
|
8
8
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
-
|
|
13
9
|
/** @visibleName Button Secondary */
|
|
14
|
-
const ButtonSecondary =
|
|
15
|
-
color: ${theme
|
|
16
|
-
background-color: ${theme
|
|
17
|
-
border: 2px solid ${theme
|
|
10
|
+
const ButtonSecondary = styled(Button.default) `
|
|
11
|
+
color: ${theme.default.color.text.plum};
|
|
12
|
+
background-color: ${theme.default.color.background.sand.E02};
|
|
13
|
+
border: 2px solid ${theme.default.color.line.L02};
|
|
18
14
|
|
|
19
15
|
&:focus {
|
|
20
|
-
color: ${theme
|
|
21
|
-
background-color: ${theme
|
|
16
|
+
color: ${theme.default.color.text.plum};
|
|
17
|
+
background-color: ${theme.default.color.background.sand.E02};
|
|
22
18
|
}
|
|
23
19
|
|
|
24
20
|
&:hover {
|
|
25
|
-
color: ${theme
|
|
21
|
+
color: ${theme.default.color.text.plum};
|
|
26
22
|
background-color: ${Button.shade.sand.E02.darker};
|
|
27
23
|
border: 2px solid ${Button.shade.sand.E02.darker};
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
&:active {
|
|
31
|
-
color: ${theme
|
|
27
|
+
color: ${theme.default.color.text.plum};
|
|
32
28
|
background-color: ${Button.shade.sand.E02.lighter};
|
|
33
29
|
border: 2px solid ${Button.shade.sand.E02.lighter};
|
|
34
30
|
}
|
|
35
31
|
|
|
36
32
|
&:disabled,
|
|
37
33
|
&[disabled] {
|
|
38
|
-
background-color: ${theme
|
|
39
|
-
border: 2px solid ${theme
|
|
34
|
+
background-color: ${theme.default.color.background.sand.E02 + theme.default.color.transparency.T30};
|
|
35
|
+
border: 2px solid ${theme.default.color.line.L02 + theme.default.color.transparency.T30};
|
|
40
36
|
background-clip: padding-box;
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
${({ loading }) => loading &&
|
|
44
40
|
`
|
|
45
41
|
&:focus {
|
|
46
|
-
border-color: ${theme
|
|
42
|
+
border-color: ${theme.default.color.line.L02};
|
|
47
43
|
outline: none;
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
> * > * {
|
|
51
|
-
background-color: ${theme
|
|
47
|
+
background-color: ${theme.default.color.default.plum};
|
|
52
48
|
}
|
|
53
49
|
`}
|
|
54
50
|
`;
|
|
55
51
|
|
|
56
|
-
exports
|
|
52
|
+
exports.default = ButtonSecondary;
|
|
@@ -12,31 +12,27 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
12
12
|
var ButtonArrow = require('../Button/ButtonArrow.js');
|
|
13
13
|
var ButtonIcon = require('../Button/ButtonIcon.js');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
-
|
|
19
|
-
const CarouselWrapper = styled["default"].div ``;
|
|
20
|
-
const Header = styled["default"].div `
|
|
15
|
+
const CarouselWrapper = styled.default.div ``;
|
|
16
|
+
const Header = styled.default.div `
|
|
21
17
|
display: flex;
|
|
22
18
|
justify-content: space-between;
|
|
23
19
|
gap: 1.25rem;
|
|
24
20
|
margin-bottom: 1.25rem;
|
|
25
21
|
`;
|
|
26
|
-
const Title = styled
|
|
22
|
+
const Title = styled.default.h2 `
|
|
27
23
|
margin: 0;
|
|
28
24
|
`;
|
|
29
|
-
const Navigation = styled
|
|
25
|
+
const Navigation = styled.default.div `
|
|
30
26
|
display: inline-flex;
|
|
31
27
|
margin-left: auto;
|
|
32
28
|
gap: 0.625rem;
|
|
33
29
|
`;
|
|
34
|
-
const Content = styled
|
|
30
|
+
const Content = styled.default.div `
|
|
35
31
|
position: relative;
|
|
36
32
|
overflow: hidden;
|
|
37
33
|
touch-action: pan-y;
|
|
38
34
|
`;
|
|
39
|
-
const SlidesWrapper = styled
|
|
35
|
+
const SlidesWrapper = styled.default.div `
|
|
40
36
|
position: relative;
|
|
41
37
|
display: flex;
|
|
42
38
|
width: 100%;
|
|
@@ -48,7 +44,7 @@ const SlidesWrapper = styled["default"].div `
|
|
|
48
44
|
transition-delay: 0ms;
|
|
49
45
|
user-select: none;
|
|
50
46
|
`;
|
|
51
|
-
const SlideItem = styled
|
|
47
|
+
const SlideItem = styled.default.div `
|
|
52
48
|
display: block;
|
|
53
49
|
position: relative;
|
|
54
50
|
flex-shrink: 0;
|
|
@@ -56,16 +52,16 @@ const SlideItem = styled["default"].div `
|
|
|
56
52
|
${({ visibleItems, itemWidthCorrection }) => `(100% / ${visibleItems}) - ${itemWidthCorrection}px`}
|
|
57
53
|
);
|
|
58
54
|
`;
|
|
59
|
-
const Footer = styled
|
|
55
|
+
const Footer = styled.default.div `
|
|
60
56
|
${styledUtils.media.md `
|
|
61
57
|
display: grid;
|
|
62
58
|
grid-template-columns: [whitespace] 1fr [pagination] auto [footerButton] 1fr;
|
|
63
59
|
gap: 2rem;
|
|
64
|
-
margin: ${styledUtils.getMultipliedSize(theme
|
|
60
|
+
margin: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)} 0;
|
|
65
61
|
align-items: center;
|
|
66
62
|
`};
|
|
67
63
|
`;
|
|
68
|
-
const Pagination = styled
|
|
64
|
+
const Pagination = styled.default.div `
|
|
69
65
|
display: none;
|
|
70
66
|
|
|
71
67
|
${styledUtils.media.md `
|
|
@@ -77,39 +73,39 @@ const Pagination = styled["default"].div `
|
|
|
77
73
|
width: 100%;
|
|
78
74
|
`};
|
|
79
75
|
`;
|
|
80
|
-
const PaginationItem = styled
|
|
76
|
+
const PaginationItem = styled.default.button `
|
|
81
77
|
display: inline-block;
|
|
82
78
|
cursor: pointer;
|
|
83
79
|
width: 2rem;
|
|
84
80
|
height: 1rem;
|
|
85
|
-
border-radius: ${theme
|
|
86
|
-
border: 2px solid ${theme
|
|
87
|
-
background-color: ${theme
|
|
81
|
+
border-radius: ${theme.default.radius.pill};
|
|
82
|
+
border: 2px solid ${theme.default.color.line.L01};
|
|
83
|
+
background-color: ${theme.default.color.background.white.default};
|
|
88
84
|
transition: all 0.2s ease-in-out;
|
|
89
85
|
|
|
90
86
|
${({ isActive }) => isActive &&
|
|
91
87
|
`
|
|
92
88
|
width: 3rem;
|
|
93
|
-
border-color: ${theme
|
|
94
|
-
background-color: ${theme
|
|
89
|
+
border-color: ${theme.default.color.default.pink};
|
|
90
|
+
background-color: ${theme.default.color.background.pink.default};
|
|
95
91
|
`}
|
|
96
92
|
|
|
97
93
|
&:focus {
|
|
98
|
-
border: 2px solid ${theme
|
|
99
|
-
box-shadow: 0px 0px 0px 2px ${theme
|
|
94
|
+
border: 2px solid ${theme.default.color.focus.light};
|
|
95
|
+
box-shadow: 0px 0px 0px 2px ${theme.default.color.focus.dark};
|
|
100
96
|
outline: none;
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
&:hover {
|
|
104
|
-
border-color: ${theme
|
|
100
|
+
border-color: ${theme.default.color.default.pink};
|
|
105
101
|
}
|
|
106
102
|
`;
|
|
107
|
-
const Scrollbar = styled
|
|
103
|
+
const Scrollbar = styled.default.div `
|
|
108
104
|
width: 100%;
|
|
109
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
105
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.6)};
|
|
110
106
|
margin: 1rem 0;
|
|
111
|
-
border-radius: ${theme
|
|
112
|
-
background-color: ${theme
|
|
107
|
+
border-radius: ${theme.default.radius.pill};
|
|
108
|
+
background-color: ${theme.default.color.background.sand.E02};
|
|
113
109
|
user-select: none;
|
|
114
110
|
touch-action: pan-y;
|
|
115
111
|
|
|
@@ -117,20 +113,20 @@ const Scrollbar = styled["default"].div `
|
|
|
117
113
|
display: none;
|
|
118
114
|
`};
|
|
119
115
|
`;
|
|
120
|
-
const Knob = styled
|
|
116
|
+
const Knob = styled.default.div `
|
|
121
117
|
position: relative;
|
|
122
118
|
top: 0;
|
|
123
119
|
left: 0;
|
|
124
120
|
width: calc(100% / ${({ knobSize }) => knobSize});
|
|
125
121
|
height: 100%;
|
|
126
|
-
border-radius: ${theme
|
|
127
|
-
background-color: ${theme
|
|
122
|
+
border-radius: ${theme.default.radius.pill};
|
|
123
|
+
background-color: ${theme.default.color.background.pink.default};
|
|
128
124
|
transform: translate3d(0px, 0, 0);
|
|
129
125
|
transition-duration: 0ms;
|
|
130
126
|
transition-delay: 0ms;
|
|
131
127
|
user-select: none;
|
|
132
128
|
`;
|
|
133
|
-
const FooterButton = styled
|
|
129
|
+
const FooterButton = styled.default.div `
|
|
134
130
|
grid-column: footerButton;
|
|
135
131
|
text-align: right;
|
|
136
132
|
`;
|
|
@@ -140,7 +136,7 @@ const Carousel = (_a) => {
|
|
|
140
136
|
const slidesWrapperRef = React.useRef(null);
|
|
141
137
|
const scrollbarRef = React.useRef(null);
|
|
142
138
|
const knobRef = React.useRef(null);
|
|
143
|
-
const { isMobile } = useWindowSize
|
|
139
|
+
const { isMobile } = useWindowSize.default(theme.default.breakpoints.md);
|
|
144
140
|
const [currentIndex, setCurrentIndex] = React.useState(0);
|
|
145
141
|
const visibleItems = props.visibleItems || (isMobile ? 1.2 : 1);
|
|
146
142
|
const slidesWrapperGapSizePx = 20;
|
|
@@ -294,20 +290,20 @@ const Carousel = (_a) => {
|
|
|
294
290
|
setElementTransform(knobRef, slidesTransform / data.scrollbarToSlidesRatio);
|
|
295
291
|
}
|
|
296
292
|
}, [currentIndex, data, itemWidthCorrection, props.children, slideScreensCount, visibleItems]);
|
|
297
|
-
return (
|
|
298
|
-
|
|
299
|
-
props.title &&
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
props.footerButton && (
|
|
310
|
-
|
|
293
|
+
return (React.createElement(CarouselWrapper, { id: props.id, className: props.className, "data-testid": dataTestId },
|
|
294
|
+
React.createElement(Header, { "data-testid": dataTestId && `${dataTestId}-header` },
|
|
295
|
+
props.title && React.createElement(Title, null, props.title),
|
|
296
|
+
React.createElement(Navigation, null,
|
|
297
|
+
React.createElement(ButtonArrow.default, { direction: "left", "aria-label": "Previous", onClick: handleNavigationButtonPreviousClick, disabled: currentIndex <= 0 }),
|
|
298
|
+
React.createElement(ButtonArrow.default, { direction: "right", "aria-label": "Next", onClick: handleNavigationButtonNextClick, disabled: currentIndex + visibleItems >= React.Children.count(props.children) }))),
|
|
299
|
+
React.createElement(Content, { "data-testid": dataTestId && `${dataTestId}-content` },
|
|
300
|
+
React.createElement(SlidesWrapper, { ref: slidesWrapperRef, onPointerDown: handleSlidesPointerDown, gap: slidesWrapperGapSizePx / 16 }, React.Children.map(props.children, child => (React.createElement(SlideItem, { visibleItems: visibleItems, itemWidthCorrection: itemWidthCorrection }, child))))),
|
|
301
|
+
React.createElement(Footer, { "data-testid": dataTestId && `${dataTestId}-footer` },
|
|
302
|
+
React.createElement(Pagination, null, [...Array(slideScreensCount).keys()].map((value, index) => (React.createElement(PaginationItem, { key: value, "aria-label": `Move to step ${index + 1}`, "aria-current": index === currentIndex, isActive: index === currentIndex, onClick: handlePaginationItemClick })))),
|
|
303
|
+
React.createElement(Scrollbar, { ref: scrollbarRef, onPointerDown: handleScrollbarPointerDown },
|
|
304
|
+
React.createElement(Knob, { ref: knobRef, knobSize: slideScreensCount })),
|
|
305
|
+
props.footerButton && (React.createElement(FooterButton, null,
|
|
306
|
+
React.createElement(ButtonIcon.default, { icon: icons.ArrowRight, onClick: props.onFooterButtonClick }, props.footerButton))))));
|
|
311
307
|
};
|
|
312
308
|
|
|
313
|
-
exports
|
|
309
|
+
exports.default = Carousel;
|
|
@@ -9,10 +9,6 @@ var styled = require('../../themes/styled.js');
|
|
|
9
9
|
var theme = require('../../themes/theme.js');
|
|
10
10
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
11
11
|
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
|
|
16
12
|
// TODO: Implement proper svg icon after https://jira.dna.fi/browse/STYLE-238 is done
|
|
17
13
|
const SVGIconData = () => {
|
|
18
14
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="16px" height="16px">` +
|
|
@@ -20,33 +16,33 @@ const SVGIconData = () => {
|
|
|
20
16
|
`</svg>`;
|
|
21
17
|
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
22
18
|
};
|
|
23
|
-
const Container = styled
|
|
19
|
+
const Container = styled.default.div `
|
|
24
20
|
display: flex;
|
|
25
|
-
font-size: ${theme
|
|
26
|
-
line-height: ${theme
|
|
27
|
-
margin-bottom: ${styledUtils.getMultipliedSize(theme
|
|
21
|
+
font-size: ${theme.default.fontSize.default};
|
|
22
|
+
line-height: ${theme.default.lineHeight.default};
|
|
23
|
+
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
28
24
|
`;
|
|
29
|
-
const Input = styled
|
|
25
|
+
const Input = styled.default(globalStyles.CheckboxAndRadioInputCore) `
|
|
30
26
|
position: relative;
|
|
31
|
-
top: ${styledUtils.getDividedSize(theme
|
|
27
|
+
top: ${styledUtils.getDividedSize(theme.default.base.baseWidth, 5)};
|
|
32
28
|
|
|
33
29
|
&:checked {
|
|
34
30
|
&::before {
|
|
35
|
-
width: ${styledUtils.getMultipliedSize(theme
|
|
36
|
-
height: ${styledUtils.getMultipliedSize(theme
|
|
31
|
+
width: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)};
|
|
32
|
+
height: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)};
|
|
37
33
|
background-image: url('${SVGIconData}');
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
`;
|
|
41
|
-
const Mandatory = styled
|
|
42
|
-
color: ${theme
|
|
43
|
-
margin-left: ${styledUtils.getMultipliedSize(theme
|
|
37
|
+
const Mandatory = styled.default.span `
|
|
38
|
+
color: ${theme.default.color.default.pink};
|
|
39
|
+
margin-left: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
44
40
|
`;
|
|
45
|
-
const ErrorMessage = styled
|
|
46
|
-
font-size: ${theme
|
|
47
|
-
line-height: ${theme
|
|
48
|
-
color: ${theme
|
|
49
|
-
margin-bottom: ${styledUtils.getMultipliedSize(theme
|
|
41
|
+
const ErrorMessage = styled.default.div `
|
|
42
|
+
font-size: ${theme.default.fontSize.s};
|
|
43
|
+
line-height: ${theme.default.lineHeight.s};
|
|
44
|
+
color: ${theme.default.color.notification.error};
|
|
45
|
+
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 0.5)};
|
|
50
46
|
`;
|
|
51
47
|
const Checkbox = (_a) => {
|
|
52
48
|
var { 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ['data-testid']);
|
|
@@ -55,13 +51,13 @@ const Checkbox = (_a) => {
|
|
|
55
51
|
props.onChange(!props.value);
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
|
-
return (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
return (React.createElement(React.Fragment, null,
|
|
55
|
+
React.createElement(Container, null,
|
|
56
|
+
React.createElement(Input, { id: props.id, name: props.name, type: "checkbox", className: props.className, checked: Boolean(props.value), "aria-checked": Boolean(props.value), onChange: handleChange, disabled: props.disabled, "data-testid": dataTestId }),
|
|
57
|
+
React.createElement("label", { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label` },
|
|
62
58
|
props.label,
|
|
63
|
-
props.required &&
|
|
64
|
-
props.error && props.errorMessage && (
|
|
59
|
+
props.required && React.createElement(Mandatory, null, "*"))),
|
|
60
|
+
props.error && props.errorMessage && (React.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
65
61
|
};
|
|
66
62
|
|
|
67
|
-
exports
|
|
63
|
+
exports.default = Checkbox;
|
|
@@ -8,25 +8,20 @@ var styled = require('styled-components');
|
|
|
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
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
|
-
|
|
16
11
|
const getStyling = ({ $type, $variant, }) => {
|
|
17
|
-
const stylingColor = $type === 'default' ? theme
|
|
12
|
+
const stylingColor = $type === 'default' ? theme.default.color.line.L01 : theme.default.color.notification[$type];
|
|
18
13
|
const border = `border: 2px solid ${stylingColor};`;
|
|
19
|
-
const background = `background-color: ${$variant === 'outlined' ? theme
|
|
20
|
-
const color = `color: ${$variant === 'outlined' ? theme
|
|
14
|
+
const background = `background-color: ${$variant === 'outlined' ? theme.default.color.background.white.default : stylingColor};`;
|
|
15
|
+
const color = `color: ${$variant === 'outlined' ? theme.default.color.text.black : theme.default.color.text.white};`;
|
|
21
16
|
return `${border}${background}${color}`;
|
|
22
17
|
};
|
|
23
|
-
const Element =
|
|
18
|
+
const Element = styled.div `
|
|
24
19
|
display: inline-block;
|
|
25
|
-
border-radius: ${theme
|
|
26
|
-
padding: 1px ${styledUtils.getMultipliedSize(theme
|
|
27
|
-
font-size: ${theme
|
|
28
|
-
line-height: ${theme
|
|
29
|
-
font-weight: ${theme
|
|
20
|
+
border-radius: ${theme.default.radius.pill};
|
|
21
|
+
padding: 1px ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)};
|
|
22
|
+
font-size: ${theme.default.fontSize.s};
|
|
23
|
+
line-height: ${theme.default.lineHeight.s};
|
|
24
|
+
font-weight: ${theme.default.fontWeight.medium};
|
|
30
25
|
text-align: center;
|
|
31
26
|
${({ onClick }) => onClick && `cursor: pointer`};
|
|
32
27
|
|
|
@@ -34,7 +29,7 @@ const Element = styled__default["default"].div `
|
|
|
34
29
|
`;
|
|
35
30
|
const Chip = (_a) => {
|
|
36
31
|
var { type = 'default', variant = 'outlined', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["type", "variant", 'data-testid']);
|
|
37
|
-
return (
|
|
32
|
+
return (React.createElement(Element, { id: props.id, "$type": type, "$variant": variant, onClick: props.onClick, className: props.className, "data-testid": dataTestId }, props.children));
|
|
38
33
|
};
|
|
39
34
|
|
|
40
|
-
exports
|
|
35
|
+
exports.default = Chip;
|