@dnanpm/styleguide 3.9.0 → 3.9.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/build/cjs/components/Accordion/Accordion.js +8 -3
- package/build/cjs/components/AccordionItem/AccordionItem.js +19 -14
- package/build/cjs/components/AmountSelector/AmountSelector.js +8 -4
- package/build/cjs/components/Box/Box.js +7 -2
- package/build/cjs/components/Button/Button.d.ts +4 -0
- package/build/cjs/components/Button/Button.js +8 -3
- package/build/cjs/components/ButtonArrow/ButtonArrow.js +8 -3
- package/build/cjs/components/ButtonCard/ButtonCard.d.ts +4 -0
- package/build/cjs/components/ButtonCard/ButtonCard.js +21 -16
- package/build/cjs/components/ButtonClose/ButtonClose.js +5 -1
- package/build/cjs/components/ButtonIcon/ButtonIcon.js +9 -4
- package/build/cjs/components/ButtonPrimary/ButtonPrimary.js +5 -1
- package/build/cjs/components/ButtonRound/ButtonRound.js +7 -2
- package/build/cjs/components/ButtonSecondary/ButtonSecondary.js +5 -1
- package/build/cjs/components/Carousel/Carousel.js +18 -14
- package/build/cjs/components/Checkbox/Checkbox.js +10 -6
- package/build/cjs/components/Chip/Chip.js +7 -2
- package/build/cjs/components/DateTimePicker/DateTimePicker.js +16 -10
- package/build/cjs/components/Divider/Divider.js +7 -2
- package/build/cjs/components/DnaLogo/DnaLogo.js +16 -12
- package/build/cjs/components/Drawer/Drawer.js +22 -17
- package/build/cjs/components/EmptyState/EmptyState.js +8 -4
- package/build/cjs/components/Expander/Expander.js +9 -5
- package/build/cjs/components/Floater/Floater.js +7 -2
- package/build/cjs/components/Footer/Components/FooterComponents.js +21 -17
- package/build/cjs/components/Footer/Footer.js +25 -21
- package/build/cjs/components/Icon/Icon.js +9 -5
- package/build/cjs/components/Icons/Small/hlArrowBackSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlArrowForwardSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlArrowUnderSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlCalendarSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlChevronDownSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlChevronLeftSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlChevronRightSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlChevronUpSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlClockSmall.js +7 -3
- package/build/cjs/components/Icons/Small/hlDownloadSmall.js +8 -4
- package/build/cjs/components/Icons/Small/hlExternalSmall.js +6 -2
- package/build/cjs/components/Icons/Small/hlUploadSmall.js +8 -4
- package/build/cjs/components/Icons/Social/facebook.js +6 -2
- package/build/cjs/components/Icons/Social/instagram.js +6 -2
- package/build/cjs/components/Icons/Social/linkedin.js +6 -2
- package/build/cjs/components/Icons/Social/tiktok.js +6 -2
- package/build/cjs/components/Icons/Social/twitter.js +6 -2
- package/build/cjs/components/Icons/Social/youtube.js +6 -2
- package/build/cjs/components/Icons/hl404.js +6 -2
- package/build/cjs/components/Icons/hl4gSim.js +6 -2
- package/build/cjs/components/Icons/hl5gSim.js +6 -2
- package/build/cjs/components/Icons/hlBattery.js +8 -4
- package/build/cjs/components/Icons/hlBell.js +6 -2
- package/build/cjs/components/Icons/hlCableTVCard.js +6 -2
- package/build/cjs/components/Icons/hlCalendar.js +17 -13
- package/build/cjs/components/Icons/hlCall.js +6 -2
- package/build/cjs/components/Icons/hlCameraBack.js +8 -4
- package/build/cjs/components/Icons/hlCameraFront.js +7 -3
- package/build/cjs/components/Icons/hlCart.js +8 -4
- package/build/cjs/components/Icons/hlCartEmpty.js +8 -4
- package/build/cjs/components/Icons/hlChat.js +9 -5
- package/build/cjs/components/Icons/hlCheck.js +6 -2
- package/build/cjs/components/Icons/hlChevronDown.js +6 -2
- package/build/cjs/components/Icons/hlChevronLeft.js +6 -2
- package/build/cjs/components/Icons/hlChevronRight.js +6 -2
- package/build/cjs/components/Icons/hlChevronUp.js +6 -2
- package/build/cjs/components/Icons/hlCompensation.js +6 -2
- package/build/cjs/components/Icons/hlCookie.js +6 -2
- package/build/cjs/components/Icons/hlCopy.js +7 -3
- package/build/cjs/components/Icons/hlCoupon.js +8 -4
- package/build/cjs/components/Icons/hlDelivery.js +6 -2
- package/build/cjs/components/Icons/hlDigiturva.js +6 -2
- package/build/cjs/components/Icons/hlDisplaySize.js +8 -4
- package/build/cjs/components/Icons/hlDocument.js +7 -3
- package/build/cjs/components/Icons/hlDownload.js +8 -4
- package/build/cjs/components/Icons/hlEnvelope.js +6 -2
- package/build/cjs/components/Icons/hlError.js +8 -4
- package/build/cjs/components/Icons/hlEuro.js +6 -2
- package/build/cjs/components/Icons/hlExclamationMark.js +6 -2
- package/build/cjs/components/Icons/hlExpand.js +6 -2
- package/build/cjs/components/Icons/hlExternal.js +6 -2
- package/build/cjs/components/Icons/hlEyeClosed.js +6 -2
- package/build/cjs/components/Icons/hlEyeOpen.js +7 -3
- package/build/cjs/components/Icons/hlFaceId.js +6 -2
- package/build/cjs/components/Icons/hlFastDelivery.js +6 -2
- package/build/cjs/components/Icons/hlFingerprint.js +10 -6
- package/build/cjs/components/Icons/hlGlobe.js +6 -2
- package/build/cjs/components/Icons/hlHeadphones.js +6 -2
- package/build/cjs/components/Icons/hlHeadset.js +8 -4
- package/build/cjs/components/Icons/hlHeart.js +6 -2
- package/build/cjs/components/Icons/hlHome.js +6 -2
- package/build/cjs/components/Icons/hlHub.js +7 -3
- package/build/cjs/components/Icons/hlImage.js +6 -2
- package/build/cjs/components/Icons/hlInfo.js +8 -4
- package/build/cjs/components/Icons/hlInstallment.js +7 -3
- package/build/cjs/components/Icons/hlIotSim.js +7 -3
- package/build/cjs/components/Icons/hlLaptop.js +6 -2
- package/build/cjs/components/Icons/hlLink.js +7 -3
- package/build/cjs/components/Icons/hlLiveVideo.js +6 -2
- package/build/cjs/components/Icons/hlLock.js +8 -4
- package/build/cjs/components/Icons/hlMagnifyingGlass.js +7 -3
- package/build/cjs/components/Icons/hlMarker.js +7 -3
- package/build/cjs/components/Icons/hlMemory.js +7 -3
- package/build/cjs/components/Icons/hlMenu.js +6 -2
- package/build/cjs/components/Icons/hlMinimize.js +6 -2
- package/build/cjs/components/Icons/hlMinus.js +6 -2
- package/build/cjs/components/Icons/hlMobileData.js +6 -2
- package/build/cjs/components/Icons/hlMobilePayment.js +8 -4
- package/build/cjs/components/Icons/hlModem.js +10 -6
- package/build/cjs/components/Icons/hlMore.js +8 -4
- package/build/cjs/components/Icons/hlOs.js +7 -3
- package/build/cjs/components/Icons/hlPackage.js +6 -2
- package/build/cjs/components/Icons/hlPaperclip.js +6 -2
- package/build/cjs/components/Icons/hlPaytime.js +6 -2
- package/build/cjs/components/Icons/hlPen.js +6 -2
- package/build/cjs/components/Icons/hlPerson.js +6 -2
- package/build/cjs/components/Icons/hlPhone.js +7 -3
- package/build/cjs/components/Icons/hlPlaylist.js +6 -2
- package/build/cjs/components/Icons/hlPlus.js +7 -3
- package/build/cjs/components/Icons/hlPrepaid.js +6 -2
- package/build/cjs/components/Icons/hlProcessor.js +7 -3
- package/build/cjs/components/Icons/hlServices.js +6 -2
- package/build/cjs/components/Icons/hlSettings.js +6 -2
- package/build/cjs/components/Icons/hlShield.js +7 -3
- package/build/cjs/components/Icons/hlSim.js +7 -3
- package/build/cjs/components/Icons/hlSimSimple.js +8 -4
- package/build/cjs/components/Icons/hlSmile.js +9 -5
- package/build/cjs/components/Icons/hlSpeechBubble.js +7 -3
- package/build/cjs/components/Icons/hlSquaretrade.js +6 -2
- package/build/cjs/components/Icons/hlStar.js +6 -2
- package/build/cjs/components/Icons/hlStarFilled.js +6 -2
- package/build/cjs/components/Icons/hlTrash.js +7 -3
- package/build/cjs/components/Icons/hlTv.js +6 -2
- package/build/cjs/components/Icons/hlUnlock.js +7 -3
- package/build/cjs/components/Icons/hlUpload.js +8 -4
- package/build/cjs/components/Icons/hlWarning.js +8 -4
- package/build/cjs/components/Icons/hlWifi.js +8 -4
- package/build/cjs/components/Icons/hlWrench.js +6 -2
- package/build/cjs/components/Icons/hlX.js +6 -2
- package/build/cjs/components/InfoDialog/InfoDialog.js +5 -1
- package/build/cjs/components/Input/Input.js +15 -11
- package/build/cjs/components/Label/Label.js +5 -1
- package/build/cjs/components/LabelText/LabelText.js +6 -2
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/BusinessMenu.js +5 -1
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/DesktopMenu.js +24 -20
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LanguageSelector.js +10 -6
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LinkModifier.js +8 -4
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/LoginTooltip.js +7 -3
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MainNavTooltipMenu.js +11 -7
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MinicartTooltip.js +8 -4
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/MobileMenu.js +23 -19
- package/build/cjs/components/MainHeaderNavigation/ChildComponents/PageSearch.js +7 -3
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +25 -21
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +6 -2
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +27 -23
- package/build/cjs/components/MainNavigation/ChildComponents/HeaderNavigationElements.js +29 -25
- package/build/cjs/components/MainNavigation/ChildComponents/LanguageSelector.js +10 -6
- package/build/cjs/components/MainNavigation/ChildComponents/LinkModifier.js +9 -5
- package/build/cjs/components/MainNavigation/ChildComponents/LoginTooltip.js +7 -3
- package/build/cjs/components/MainNavigation/ChildComponents/MainNavTooltipMenu.js +10 -6
- package/build/cjs/components/MainNavigation/ChildComponents/MinicartTooltip.js +8 -4
- package/build/cjs/components/MainNavigation/ChildComponents/MobileMenu.js +30 -26
- package/build/cjs/components/MainNavigation/ChildComponents/PageSearch.js +7 -3
- package/build/cjs/components/MainNavigation/ChildComponents/Ribbon.js +12 -8
- package/build/cjs/components/MainNavigation/MainNavigation.js +14 -10
- package/build/cjs/components/Modal/Modal.js +16 -11
- package/build/cjs/components/Notification/Notification.js +15 -10
- package/build/cjs/components/NotificationBadge/NotificationBadge.js +5 -1
- package/build/cjs/components/Overlay/Overlay.js +6 -2
- package/build/cjs/components/Pill/Pill.js +9 -4
- package/build/cjs/components/PixelLoader/PixelLoader.js +9 -5
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.js +20 -16
- package/build/cjs/components/PriorityNavigationItem/PriorityNavigationItem.js +5 -1
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +9 -5
- package/build/cjs/components/RadioButton/RadioButton.js +7 -3
- package/build/cjs/components/ReadMore/ReadMore.js +8 -4
- package/build/cjs/components/Search/Search.js +7 -3
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +20 -16
- package/build/cjs/components/Selectbox/Selectbox.js +18 -13
- package/build/cjs/components/Switch/Switch.js +3 -2
- package/build/cjs/components/Tab/Tab.js +10 -6
- package/build/cjs/components/Tabs/Tabs.js +8 -4
- package/build/cjs/components/Textarea/Textarea.js +9 -5
- package/build/cjs/components/Toaster/Toaster.js +17 -12
- package/build/cjs/components/Tooltip/Tooltip.js +8 -4
- package/build/cjs/components/TooltipMenu/TooltipMenu.js +15 -11
- package/build/cjs/utils/createStyled.js +3 -2
- package/build/es/components/Button/Button.d.ts +4 -0
- package/build/es/components/Button/Button.js +1 -1
- package/build/es/components/ButtonArrow/ButtonArrow.js +1 -1
- package/build/es/components/ButtonCard/ButtonCard.d.ts +4 -0
- package/build/es/components/ButtonCard/ButtonCard.js +1 -1
- package/build/es/components/ButtonIcon/ButtonIcon.js +1 -1
- package/package.json +2 -2
|
@@ -9,7 +9,12 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var AccordionItem = require('../AccordionItem/AccordionItem.js');
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
16
|
+
|
|
17
|
+
const AccordionContainer = styled__default.default.div `
|
|
13
18
|
${p => p.type === 'box' &&
|
|
14
19
|
styled.css `
|
|
15
20
|
& > * {
|
|
@@ -58,14 +63,14 @@ const Accordion = (_a) => {
|
|
|
58
63
|
const accordionItems = React.Children.map(props.children, (child, index) => {
|
|
59
64
|
if (React.isValidElement(child) && child.type === AccordionItem.default) {
|
|
60
65
|
const id = getAccordionItemId(index, child.props.title);
|
|
61
|
-
return (
|
|
66
|
+
return (React__default.default.createElement(AccordionItem.default, { id: id, key: id, type: type, title: child.props.title, isExpanded: itemList[id], highlightSelected: highlightSelected, hasCloseButton: hasCloseButton, openLabel: props.openLabel, closeLabel: props.closeLabel, onClick: handleClick, onKeyDown: handleKeyDown, className: child.props.className }, child.props.children));
|
|
62
67
|
}
|
|
63
68
|
return null;
|
|
64
69
|
});
|
|
65
70
|
if (!accordionItems) {
|
|
66
71
|
return null;
|
|
67
72
|
}
|
|
68
|
-
return (
|
|
73
|
+
return (React__default.default.createElement(AccordionContainer, { type: type, className: props.className }, accordionItems));
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
exports.default = Accordion;
|
|
@@ -12,13 +12,18 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
12
12
|
var Box = require('../Box/Box.js');
|
|
13
13
|
var Icon = require('../Icon/Icon.js');
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
19
|
+
|
|
20
|
+
const AccordionItemContainer = styled__default.default.div `
|
|
16
21
|
${p => p.type === 'panel' &&
|
|
17
22
|
styled.css `
|
|
18
23
|
border-bottom: 1px solid ${theme.default.color.line.L02};
|
|
19
24
|
`}
|
|
20
25
|
`;
|
|
21
|
-
const AccordionItemTitle =
|
|
26
|
+
const AccordionItemTitle = styled__default.default.div `
|
|
22
27
|
font-size: ${theme.default.fontSize.default};
|
|
23
28
|
line-height: ${theme.default.lineHeight.default};
|
|
24
29
|
font-weight: ${theme.default.fontWeight.bold};
|
|
@@ -39,17 +44,17 @@ const AccordionItemTitle = styled.div `
|
|
|
39
44
|
}
|
|
40
45
|
`}
|
|
41
46
|
`;
|
|
42
|
-
const AccordionItemContentWrapper =
|
|
47
|
+
const AccordionItemContentWrapper = styled__default.default.div `
|
|
43
48
|
overflow: hidden;
|
|
44
49
|
transition: all 0.2s ease;
|
|
45
50
|
height: ${p => (p.isExpanded ? p.maxHeight / 16 + 1.25 : 0)}rem;
|
|
46
51
|
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
47
52
|
visibility: ${p => (p.isExpanded ? 'visible' : 'hidden')};
|
|
48
53
|
`;
|
|
49
|
-
const AccordionItemContent =
|
|
54
|
+
const AccordionItemContent = styled__default.default.div `
|
|
50
55
|
padding-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.6)};
|
|
51
56
|
`;
|
|
52
|
-
const AccordionItemCloseButton =
|
|
57
|
+
const AccordionItemCloseButton = styled__default.default.div `
|
|
53
58
|
display: flex;
|
|
54
59
|
justify-content: flex-end;
|
|
55
60
|
line-height: ${theme.default.lineHeight.default};
|
|
@@ -64,16 +69,16 @@ const AccordionItem = (_a) => {
|
|
|
64
69
|
const contentRef = React.useRef(null);
|
|
65
70
|
// Get height when element dimensions change
|
|
66
71
|
const { height: contentHeight } = useResizeObserver.default(contentRef);
|
|
67
|
-
const itemContent = (
|
|
68
|
-
|
|
72
|
+
const itemContent = (React__default.default.createElement(AccordionItemContainer, { id: props.id, type: type, "aria-expanded": Boolean(props.isExpanded), className: props.className },
|
|
73
|
+
React__default.default.createElement(AccordionItemTitle, { tabIndex: 0, onClick: props.onClick, onKeyDown: props.onKeyDown, isExpanded: Boolean(props.isExpanded), highlightSelected: highlightSelected, role: "button" },
|
|
69
74
|
props.title,
|
|
70
|
-
props.isExpanded ? (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
hasCloseButton && props.isExpanded && (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return type === 'box' ? (
|
|
75
|
+
props.isExpanded ? (React__default.default.createElement(Icon.default, { icon: icons.ChevronUp, color: theme.default.color.default.black, position: "right", "aria-label": props.closeLabel })) : (React__default.default.createElement(Icon.default, { icon: icons.ChevronDown, color: theme.default.color.default.black, position: "right", "aria-label": props.openLabel }))),
|
|
76
|
+
React__default.default.createElement(AccordionItemContentWrapper, { maxHeight: contentHeight, isExpanded: props.isExpanded },
|
|
77
|
+
React__default.default.createElement(AccordionItemContent, { ref: contentRef }, props.children)),
|
|
78
|
+
hasCloseButton && props.isExpanded && (React__default.default.createElement(AccordionItemCloseButton, { tabIndex: 0, onClick: props.onClick, onKeyDown: props.onKeyDown, "aria-label": props.closeLabel, role: "button" },
|
|
79
|
+
React__default.default.createElement("span", null, props.closeLabel),
|
|
80
|
+
React__default.default.createElement(Icon.default, { icon: icons.Close })))));
|
|
81
|
+
return type === 'box' ? (React__default.default.createElement(Box.default, { elevation: props.isExpanded ? 'low' : 'none', padding: "0" }, itemContent)) : (itemContent);
|
|
77
82
|
};
|
|
78
83
|
|
|
79
84
|
exports.default = AccordionItem;
|
|
@@ -11,6 +11,10 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
11
11
|
var ButtonArrow = require('../ButtonArrow/ButtonArrow.js');
|
|
12
12
|
var Icon = require('../Icon/Icon.js');
|
|
13
13
|
|
|
14
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
17
|
+
|
|
14
18
|
const Container = styled.default.div `
|
|
15
19
|
display: flex;
|
|
16
20
|
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 12)};
|
|
@@ -103,11 +107,11 @@ const AmountSelector = (_a) => {
|
|
|
103
107
|
onChange(min);
|
|
104
108
|
}
|
|
105
109
|
};
|
|
106
|
-
return (
|
|
107
|
-
|
|
110
|
+
return (React__default.default.createElement(Container, { "data-testid": dataTestId, className: props.className },
|
|
111
|
+
React__default.default.createElement(Button, { icon: React__default.default.createElement(Icon.default, { icon: props.removable && isMinReached(value - step) ? icons.Trash : icons.Minus, size: styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2) }), variant: "secondary", onClick: decrease, disabled: disabled, type: "button", "data-testid": dataTestId &&
|
|
108
112
|
`${dataTestId}${props.removable && isMinReached(value - step) ? '-remove' : '-decrease'}` }),
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
React__default.default.createElement(Input, { id: props.id, name: props.name, type: "number", onChange: handleChange, value: value, readOnly: readonly || disabled, disabled: disabled }),
|
|
114
|
+
React__default.default.createElement(Button, { icon: React__default.default.createElement(Icon.default, { icon: icons.Plus, size: styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2) }), variant: "secondary", onClick: increase, disabled: disabled, type: "button", "data-testid": dataTestId ? `${dataTestId}-increase` : undefined })));
|
|
111
115
|
};
|
|
112
116
|
|
|
113
117
|
exports.default = AmountSelector;
|
|
@@ -9,7 +9,12 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var common = require('../../utils/common.js');
|
|
10
10
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
16
|
+
|
|
17
|
+
const BoxWrapper = styled__default.default.div `
|
|
13
18
|
border: 1px solid ${theme.default.color.line.L04};
|
|
14
19
|
${({ width }) => width && `width: ${width}`};
|
|
15
20
|
${({ height }) => height && `height: ${height}`};
|
|
@@ -21,7 +26,7 @@ const BoxWrapper = styled.div `
|
|
|
21
26
|
`;
|
|
22
27
|
const Box = (_a) => {
|
|
23
28
|
var { elevation = 'none', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["elevation", 'data-testid']);
|
|
24
|
-
return (
|
|
29
|
+
return (React__default.default.createElement(BoxWrapper, { id: props.id, "$elevation": elevation, shadow: props.shadow, width: props.width, height: props.height, margin: props.margin, padding: props.padding, className: props.className, "data-testid": dataTestId }, props.children));
|
|
25
30
|
};
|
|
26
31
|
|
|
27
32
|
exports.default = Box;
|
|
@@ -78,6 +78,10 @@ export interface Props {
|
|
|
78
78
|
* Allows to pass testid string for testing purposes
|
|
79
79
|
*/
|
|
80
80
|
'data-testid'?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Allows to pass any data-* attribute
|
|
83
|
+
*/
|
|
84
|
+
dataAttributes?: Record<`data-${string}`, string>;
|
|
81
85
|
}
|
|
82
86
|
export declare const shade: {
|
|
83
87
|
pink: {
|
|
@@ -9,6 +9,11 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var PixelLoader = require('../PixelLoader/PixelLoader.js');
|
|
11
11
|
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
16
|
+
|
|
12
17
|
// Only Button component specific shades to be used on user interaction styles
|
|
13
18
|
const shade = {
|
|
14
19
|
pink: {
|
|
@@ -26,7 +31,7 @@ const shade = {
|
|
|
26
31
|
},
|
|
27
32
|
},
|
|
28
33
|
};
|
|
29
|
-
const Element =
|
|
34
|
+
const Element = styled__default.default.button `
|
|
30
35
|
display: inline-block;
|
|
31
36
|
font-family: ${theme.default.fontFamily.default};
|
|
32
37
|
font-weight: ${theme.default.fontWeight.bold};
|
|
@@ -118,10 +123,10 @@ const Element = styled.button `
|
|
|
118
123
|
/** @visibleName Button */
|
|
119
124
|
const Button = (_a) => {
|
|
120
125
|
var { type = 'submit', 'data-testid': dataTestId, 'data-no-close': dataNoClose, 'data-track-value': dataTrackValue } = _a, props = tslib.__rest(_a, ["type", 'data-testid', 'data-no-close', 'data-track-value']);
|
|
121
|
-
return (
|
|
126
|
+
return (React__default.default.createElement(Element, Object.assign({ id: props.id, as: props.href ? 'a' : undefined, type: props.href ? undefined : type, href: props.href, onClick: props.onClick, onMouseDown: props.onMouseDown, small: props.small, darkBg: props.darkBg, fullWidth: props.fullWidth, "$loading": props.loading, tabIndex: props.loading ? -1 : 0, "data-loading": props.loading, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue }, props.dataAttributes, (!props.href && {
|
|
122
127
|
name: props.name,
|
|
123
128
|
disabled: props.disabled,
|
|
124
|
-
})), props.loading ? (
|
|
129
|
+
})), props.loading ? (React__default.default.createElement(PixelLoader.default, { color: props.darkBg ? theme.default.color.default.white : theme.default.color.default.plum })) : (React__default.default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))));
|
|
125
130
|
};
|
|
126
131
|
|
|
127
132
|
exports.default = Button;
|
|
@@ -12,6 +12,11 @@ var ButtonPrimary = require('../ButtonPrimary/ButtonPrimary.js');
|
|
|
12
12
|
var ButtonSecondary = require('../ButtonSecondary/ButtonSecondary.js');
|
|
13
13
|
var Icon = require('../Icon/Icon.js');
|
|
14
14
|
|
|
15
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
19
|
+
|
|
15
20
|
const iconsMap = {
|
|
16
21
|
up: icons.ChevronUp,
|
|
17
22
|
right: icons.ChevronRight,
|
|
@@ -30,7 +35,7 @@ const overrideStyles = `
|
|
|
30
35
|
align-items: center;
|
|
31
36
|
`;
|
|
32
37
|
const buttonsMap = {
|
|
33
|
-
primary:
|
|
38
|
+
primary: styled__default.default(ButtonPrimary.default) `
|
|
34
39
|
${overrideStyles};
|
|
35
40
|
border-radius: ${theme.default.radius.circle};
|
|
36
41
|
|
|
@@ -39,7 +44,7 @@ const buttonsMap = {
|
|
|
39
44
|
color: ${theme.default.color.text.black};
|
|
40
45
|
}
|
|
41
46
|
`,
|
|
42
|
-
secondary:
|
|
47
|
+
secondary: styled__default.default(ButtonSecondary.default) `
|
|
43
48
|
${overrideStyles};
|
|
44
49
|
color: ${theme.default.color.text.black};
|
|
45
50
|
border: 1px solid ${theme.default.color.line.L01};
|
|
@@ -68,7 +73,7 @@ const buttonsMap = {
|
|
|
68
73
|
const ButtonArrow = (_a) => {
|
|
69
74
|
var { variant = 'primary', 'data-testid': dataTestId, 'data-track-value': dataTrackValue } = _a, props = tslib.__rest(_a, ["variant", 'data-testid', 'data-track-value']);
|
|
70
75
|
const Element = buttonsMap[variant];
|
|
71
|
-
return (
|
|
76
|
+
return (React__default.default.createElement(Element, { id: props.id, href: props.href, 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-track-value": dataTrackValue, dataAttributes: props.dataAttributes }, props.direction ? (React__default.default.createElement(Icon.default, { icon: iconsMap[props.direction], size: "1rem" })) : (React.isValidElement(props.icon) && props.icon.type === Icon.default && props.icon)));
|
|
72
77
|
};
|
|
73
78
|
|
|
74
79
|
exports.default = ButtonArrow;
|
|
@@ -63,6 +63,10 @@ interface Props {
|
|
|
63
63
|
* Allows to pass testid string for testing purposes
|
|
64
64
|
*/
|
|
65
65
|
'data-testid'?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Allows to pass any data-* attribute
|
|
68
|
+
*/
|
|
69
|
+
dataAttributes?: Record<`data-${string}`, string>;
|
|
66
70
|
}
|
|
67
71
|
/** @visibleName Button Card */
|
|
68
72
|
declare const ButtonCard: ({ type, size, "data-testid": dataTestId, ...props }: Props) => React.JSX.Element;
|
|
@@ -10,7 +10,12 @@ var theme = require('../../themes/theme.js');
|
|
|
10
10
|
var Box = require('../Box/Box.js');
|
|
11
11
|
var Icon = require('../Icon/Icon.js');
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
17
|
+
|
|
18
|
+
const ButtonCardWrapper = styled__default.default.button `
|
|
14
19
|
display: block;
|
|
15
20
|
padding: 0;
|
|
16
21
|
border: 0 none;
|
|
@@ -38,7 +43,7 @@ const ButtonCardWrapper = styled.button `
|
|
|
38
43
|
text-decoration: none;
|
|
39
44
|
}
|
|
40
45
|
`;
|
|
41
|
-
const StyledBox =
|
|
46
|
+
const StyledBox = styled__default.default(Box.default) `
|
|
42
47
|
display: flex;
|
|
43
48
|
gap: ${({ size }) => (size === 'small' ? '0.313rem' : '1rem')};
|
|
44
49
|
border: 1px solid ${theme.default.color.line.L03};
|
|
@@ -46,13 +51,13 @@ const StyledBox = styled(Box.default) `
|
|
|
46
51
|
${({ size }) => size === 'small' && 'flex-direction: column'};
|
|
47
52
|
${({ size }) => size !== 'small' && 'align-items: center'};
|
|
48
53
|
`;
|
|
49
|
-
const VisualContent =
|
|
54
|
+
const VisualContent = styled__default.default.div `
|
|
50
55
|
display: flex;
|
|
51
56
|
align-items: center;
|
|
52
57
|
width: ${({ size }) => (size === 'small' ? '2.5rem' : '3.75rem')};
|
|
53
58
|
height: ${({ size }) => (size === 'small' ? '2.5rem' : '3.75rem')};
|
|
54
59
|
`;
|
|
55
|
-
const TextContentWrapper =
|
|
60
|
+
const TextContentWrapper = styled__default.default.div `
|
|
56
61
|
display: flex;
|
|
57
62
|
flex-grow: 1;
|
|
58
63
|
align-items: center;
|
|
@@ -60,13 +65,13 @@ const TextContentWrapper = styled.div `
|
|
|
60
65
|
gap: ${({ size }) => (size === 'small' ? '0.625rem' : '1rem')};
|
|
61
66
|
min-width: 0;
|
|
62
67
|
`;
|
|
63
|
-
const TextContent =
|
|
68
|
+
const TextContent = styled__default.default.div `
|
|
64
69
|
display: flex;
|
|
65
70
|
align-items: flex-start;
|
|
66
71
|
flex-direction: column;
|
|
67
72
|
min-width: 0;
|
|
68
73
|
`;
|
|
69
|
-
const Title =
|
|
74
|
+
const Title = styled__default.default.div `
|
|
70
75
|
font-size: ${theme.default.fontSize.default};
|
|
71
76
|
line-height: ${theme.default.lineHeight.default};
|
|
72
77
|
font-weight: ${theme.default.fontWeight.bold};
|
|
@@ -88,7 +93,7 @@ const Title = styled.div `
|
|
|
88
93
|
font-size: ${theme.default.fontSize.xl};
|
|
89
94
|
`};
|
|
90
95
|
`;
|
|
91
|
-
const Subtitle =
|
|
96
|
+
const Subtitle = styled__default.default.div `
|
|
92
97
|
color: ${theme.default.color.text.gray};
|
|
93
98
|
font-size: ${theme.default.fontSize.s};
|
|
94
99
|
line-height: ${theme.default.lineHeight.s};
|
|
@@ -110,7 +115,7 @@ const Subtitle = styled.div `
|
|
|
110
115
|
font-size: ${theme.default.fontSize.default};
|
|
111
116
|
`};
|
|
112
117
|
`;
|
|
113
|
-
const CtaIcon =
|
|
118
|
+
const CtaIcon = styled__default.default(Icon.default) `
|
|
114
119
|
color: ${theme.default.color.text.pink};
|
|
115
120
|
|
|
116
121
|
${ButtonCardWrapper}:hover & {
|
|
@@ -120,16 +125,16 @@ const CtaIcon = styled(Icon.default) `
|
|
|
120
125
|
/** @visibleName Button Card */
|
|
121
126
|
const ButtonCard = (_a) => {
|
|
122
127
|
var { type = 'submit', size = 'medium', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["type", "size", 'data-testid']);
|
|
123
|
-
return (
|
|
128
|
+
return (React__default.default.createElement(ButtonCardWrapper, Object.assign({ id: props.id, as: props.href ? 'a' : undefined, type: props.href ? undefined : type, href: props.href, onClick: props.onClick, className: props.className, "data-testid": dataTestId }, props.dataAttributes, (!props.href && {
|
|
124
129
|
name: props.name,
|
|
125
130
|
})),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
props.subtitle && (
|
|
132
|
-
|
|
131
|
+
React__default.default.createElement(StyledBox, { elevation: "low", size: size },
|
|
132
|
+
React__default.default.createElement(VisualContent, { size: size, "data-testid": dataTestId && `${dataTestId}-content` }, props.children),
|
|
133
|
+
React__default.default.createElement(TextContentWrapper, { size: size },
|
|
134
|
+
React__default.default.createElement(TextContent, null,
|
|
135
|
+
React__default.default.createElement(Title, { size: size, "data-testid": dataTestId && `${dataTestId}-title` }, props.title),
|
|
136
|
+
props.subtitle && (React__default.default.createElement(Subtitle, { size: size, "data-testid": dataTestId && `${dataTestId}-subtitle` }, props.subtitle))),
|
|
137
|
+
React__default.default.createElement(CtaIcon, { icon: props.isExternal ? icons.Open : icons.ChevronRight, size: size === 'small' ? '1rem' : '1.5rem', "data-testid": dataTestId && `${dataTestId}-cta` })))));
|
|
133
138
|
};
|
|
134
139
|
|
|
135
140
|
exports.default = ButtonCard;
|
|
@@ -8,6 +8,10 @@ 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 _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
|
|
11
15
|
const ButtonElement = styled.default.button `
|
|
12
16
|
position: absolute;
|
|
13
17
|
top: 0;
|
|
@@ -22,7 +26,7 @@ const ButtonElement = styled.default.button `
|
|
|
22
26
|
/** @visibleName Button Close */
|
|
23
27
|
const ButtonClose = (_a) => {
|
|
24
28
|
var { 'data-testid': dataTestId, 'aria-label': ariaLabel } = _a, props = tslib.__rest(_a, ['data-testid', 'aria-label']);
|
|
25
|
-
return (
|
|
29
|
+
return (React__default.default.createElement(ButtonElement, { id: props.id, name: props.name, onClick: props.onClick, onMouseDown: props.onMouseDown, className: props.className, "data-testid": dataTestId, "aria-label": ariaLabel }, props.children));
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
exports.default = ButtonClose;
|
|
@@ -11,7 +11,12 @@ 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
|
-
|
|
14
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
17
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
18
|
+
|
|
19
|
+
const ButtonElement = styled__default.default.button `
|
|
15
20
|
display: inline-flex;
|
|
16
21
|
align-items: center;
|
|
17
22
|
font-family: ${theme.default.fontFamily.default};
|
|
@@ -87,9 +92,9 @@ const ButtonElement = styled.button `
|
|
|
87
92
|
const ButtonIcon = (_a) => {
|
|
88
93
|
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']);
|
|
89
94
|
const position = props.isReversed ? 'right' : 'left';
|
|
90
|
-
return (
|
|
91
|
-
|
|
92
|
-
props.children && (
|
|
95
|
+
return (React__default.default.createElement(ButtonElement, Object.assign({ 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.dataAttributes), props.loading ? (React__default.default.createElement(PixelLoader.default, { color: props.darkBg ? theme.default.color.default.white : theme.default.color.default.black })) : (React__default.default.createElement(React__default.default.Fragment, null,
|
|
96
|
+
React__default.default.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 }),
|
|
97
|
+
props.children && (React__default.default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text`, "data-no-close": dataNoClose }, props.children))))));
|
|
93
98
|
};
|
|
94
99
|
|
|
95
100
|
exports.default = ButtonIcon;
|
|
@@ -6,8 +6,12 @@ var styled = require('styled-components');
|
|
|
6
6
|
var theme = require('../../themes/theme.js');
|
|
7
7
|
var Button = require('../Button/Button.js');
|
|
8
8
|
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
12
|
+
|
|
9
13
|
/** @visibleName Button Primary */
|
|
10
|
-
const ButtonPrimary =
|
|
14
|
+
const ButtonPrimary = styled__default.default(Button.default) `
|
|
11
15
|
color: ${theme.default.color.text.white};
|
|
12
16
|
background-color: ${theme.default.color.default.pink};
|
|
13
17
|
border: 2px solid ${theme.default.color.default.pink};
|
|
@@ -9,7 +9,12 @@ var theme = require('../../themes/theme.js');
|
|
|
9
9
|
var styledUtils = require('../../utils/styledUtils.js');
|
|
10
10
|
var ButtonPrimary = require('../ButtonPrimary/ButtonPrimary.js');
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
16
|
+
|
|
17
|
+
const ButtonElement = styled__default.default(ButtonPrimary.default) `
|
|
13
18
|
display: flex;
|
|
14
19
|
min-width: initial;
|
|
15
20
|
width: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 3.2)};
|
|
@@ -27,7 +32,7 @@ const ButtonElement = styled(ButtonPrimary.default) `
|
|
|
27
32
|
*/
|
|
28
33
|
const ButtonRound = (_a) => {
|
|
29
34
|
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']);
|
|
30
|
-
return (
|
|
35
|
+
return (React__default.default.createElement(ButtonElement, { id: props.id, name: props.name, type: props.type, onClick: props.onClick, onMouseDown: props.onMouseDown, darkBg: props.darkBg, disabled: props.disabled, className: props.className, "data-testid": dataTestId, "data-no-close": dataNoClose, "data-track-value": dataTrackValue }, props.children));
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
exports.default = ButtonRound;
|
|
@@ -6,8 +6,12 @@ var styled = require('styled-components');
|
|
|
6
6
|
var theme = require('../../themes/theme.js');
|
|
7
7
|
var Button = require('../Button/Button.js');
|
|
8
8
|
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
12
|
+
|
|
9
13
|
/** @visibleName Button Secondary */
|
|
10
|
-
const ButtonSecondary =
|
|
14
|
+
const ButtonSecondary = styled__default.default(Button.default) `
|
|
11
15
|
color: ${theme.default.color.text.plum};
|
|
12
16
|
background-color: ${theme.default.color.background.sand.E02};
|
|
13
17
|
border: 2px solid ${theme.default.color.line.L02};
|
|
@@ -12,6 +12,10 @@ var styledUtils = require('../../utils/styledUtils.js');
|
|
|
12
12
|
var ButtonArrow = require('../ButtonArrow/ButtonArrow.js');
|
|
13
13
|
var ButtonIcon = require('../ButtonIcon/ButtonIcon.js');
|
|
14
14
|
|
|
15
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
+
|
|
15
19
|
const CarouselWrapper = styled.default.div ``;
|
|
16
20
|
const Header = styled.default.div `
|
|
17
21
|
display: flex;
|
|
@@ -290,20 +294,20 @@ const Carousel = (_a) => {
|
|
|
290
294
|
setElementTransform(knobRef, slidesTransform / data.scrollbarToSlidesRatio);
|
|
291
295
|
}
|
|
292
296
|
}, [currentIndex, data, itemWidthCorrection, props.children, slideScreensCount, visibleItems]);
|
|
293
|
-
return (
|
|
294
|
-
|
|
295
|
-
props.title &&
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
props.footerButton && (
|
|
306
|
-
|
|
297
|
+
return (React__default.default.createElement(CarouselWrapper, { id: props.id, className: props.className, "data-testid": dataTestId },
|
|
298
|
+
React__default.default.createElement(Header, { "data-testid": dataTestId && `${dataTestId}-header` },
|
|
299
|
+
props.title && React__default.default.createElement(Title, null, props.title),
|
|
300
|
+
React__default.default.createElement(Navigation, null,
|
|
301
|
+
React__default.default.createElement(ButtonArrow.default, { direction: "left", "aria-label": "Previous", onClick: handleNavigationButtonPreviousClick, disabled: currentIndex <= 0 }),
|
|
302
|
+
React__default.default.createElement(ButtonArrow.default, { direction: "right", "aria-label": "Next", onClick: handleNavigationButtonNextClick, disabled: currentIndex + visibleItems >= React.Children.count(props.children) }))),
|
|
303
|
+
React__default.default.createElement(Content, { "data-testid": dataTestId && `${dataTestId}-content` },
|
|
304
|
+
React__default.default.createElement(SlidesWrapper, { ref: slidesWrapperRef, onPointerDown: handleSlidesPointerDown, gap: slidesWrapperGapSizePx / 16 }, React.Children.map(props.children, child => (React__default.default.createElement(SlideItem, { visibleItems: visibleItems, itemWidthCorrection: itemWidthCorrection }, child))))),
|
|
305
|
+
React__default.default.createElement(Footer, { "data-testid": dataTestId && `${dataTestId}-footer` },
|
|
306
|
+
React__default.default.createElement(Pagination, null, [...Array(slideScreensCount).keys()].map((value, index) => (React__default.default.createElement(PaginationItem, { key: value, "aria-label": `Move to step ${index + 1}`, "aria-current": index === currentIndex, isActive: index === currentIndex, onClick: handlePaginationItemClick })))),
|
|
307
|
+
React__default.default.createElement(Scrollbar, { ref: scrollbarRef, onPointerDown: handleScrollbarPointerDown },
|
|
308
|
+
React__default.default.createElement(Knob, { ref: knobRef, knobSize: slideScreensCount })),
|
|
309
|
+
props.footerButton && (React__default.default.createElement(FooterButton, null,
|
|
310
|
+
React__default.default.createElement(ButtonIcon.default, { icon: icons.ArrowRight, onClick: props.onFooterButtonClick }, props.footerButton))))));
|
|
307
311
|
};
|
|
308
312
|
|
|
309
313
|
exports.default = Carousel;
|
|
@@ -9,6 +9,10 @@ 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 _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
|
|
12
16
|
// TODO: Implement proper svg icon after https://jira.dna.fi/browse/STYLE-238 is done
|
|
13
17
|
const SVGIconData = () => {
|
|
14
18
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="16px" height="16px">` +
|
|
@@ -51,13 +55,13 @@ const Checkbox = (_a) => {
|
|
|
51
55
|
props.onChange(!props.value);
|
|
52
56
|
}
|
|
53
57
|
};
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
return (React__default.default.createElement(React__default.default.Fragment, null,
|
|
59
|
+
React__default.default.createElement(Container, null,
|
|
60
|
+
React__default.default.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 }),
|
|
61
|
+
React__default.default.createElement("label", { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label` },
|
|
58
62
|
props.label,
|
|
59
|
-
props.required &&
|
|
60
|
-
props.error && props.errorMessage && (
|
|
63
|
+
props.required && React__default.default.createElement(Mandatory, null, "*"))),
|
|
64
|
+
props.error && props.errorMessage && (React__default.default.createElement(ErrorMessage, { "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
exports.default = Checkbox;
|
|
@@ -8,6 +8,11 @@ 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 _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
15
|
+
|
|
11
16
|
const getStyling = ({ $type, $variant, }) => {
|
|
12
17
|
const stylingColor = $type === 'default' ? theme.default.color.line.L01 : theme.default.color.notification[$type];
|
|
13
18
|
const border = `border: 2px solid ${stylingColor};`;
|
|
@@ -15,7 +20,7 @@ const getStyling = ({ $type, $variant, }) => {
|
|
|
15
20
|
const color = `color: ${$variant === 'outlined' ? theme.default.color.text.black : theme.default.color.text.white};`;
|
|
16
21
|
return `${border}${background}${color}`;
|
|
17
22
|
};
|
|
18
|
-
const Element =
|
|
23
|
+
const Element = styled__default.default.div `
|
|
19
24
|
display: inline-block;
|
|
20
25
|
border-radius: ${theme.default.radius.pill};
|
|
21
26
|
padding: 1px ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)};
|
|
@@ -29,7 +34,7 @@ const Element = styled.div `
|
|
|
29
34
|
`;
|
|
30
35
|
const Chip = (_a) => {
|
|
31
36
|
var { type = 'default', variant = 'outlined', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["type", "variant", 'data-testid']);
|
|
32
|
-
return (
|
|
37
|
+
return (React__default.default.createElement(Element, { id: props.id, "$type": type, "$variant": variant, onClick: props.onClick, className: props.className, "data-testid": dataTestId }, props.children));
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
exports.default = Chip;
|