@dnanpm/styleguide 3.11.4 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/ButtonPrimary/ButtonPrimary.js +1 -0
- package/build/cjs/components/ButtonSecondary/ButtonSecondary.js +1 -0
- package/build/cjs/components/Drawer/Drawer.js +9 -8
- package/build/cjs/components/Floater/Floater.js +3 -3
- package/build/cjs/components/Footer/Components/FooterComponents.js +26 -3
- package/build/cjs/components/Hero/Hero.d.ts +88 -0
- package/build/cjs/components/Hero/Hero.js +202 -0
- package/build/cjs/components/Input/Input.d.ts +10 -1
- package/build/cjs/components/Input/Input.js +4 -2
- package/build/cjs/components/MainNavigation/ChildComponents/BusinessMenu.js +7 -7
- package/build/cjs/components/MainNavigation/ChildComponents/DesktopMenu.js +7 -7
- package/build/cjs/components/MainNavigation/MainNavigation.js +7 -7
- package/build/cjs/components/PixelLoader/PixelLoader.js +5 -5
- package/build/cjs/components/PriorityNavigation/PriorityNavigation.js +7 -5
- package/build/cjs/components/ProgressIndicator/ProgressIndicator.js +18 -18
- package/build/cjs/components/SecondaryNavigation/SecondaryNavigation.js +27 -27
- package/build/cjs/components/Textarea/Textarea.js +1 -1
- package/build/cjs/components/index.d.ts +1 -0
- package/build/cjs/index.js +2 -0
- package/build/cjs/themes/themeComponents/breakpoints.js +1 -0
- package/build/es/components/ButtonPrimary/ButtonPrimary.js +1 -0
- package/build/es/components/ButtonSecondary/ButtonSecondary.js +1 -0
- package/build/es/components/Drawer/Drawer.js +9 -8
- package/build/es/components/Floater/Floater.js +3 -3
- package/build/es/components/Footer/Components/FooterComponents.js +26 -3
- package/build/es/components/Hero/Hero.d.ts +88 -0
- package/build/es/components/Hero/Hero.js +194 -0
- package/build/es/components/Input/Input.d.ts +10 -1
- package/build/es/components/Input/Input.js +4 -2
- package/build/es/components/MainNavigation/ChildComponents/BusinessMenu.js +7 -7
- package/build/es/components/MainNavigation/ChildComponents/DesktopMenu.js +7 -7
- package/build/es/components/MainNavigation/MainNavigation.js +7 -7
- package/build/es/components/PixelLoader/PixelLoader.js +5 -5
- package/build/es/components/PriorityNavigation/PriorityNavigation.js +7 -5
- package/build/es/components/ProgressIndicator/ProgressIndicator.js +18 -18
- package/build/es/components/SecondaryNavigation/SecondaryNavigation.js +27 -27
- package/build/es/components/Textarea/Textarea.js +1 -1
- package/build/es/components/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/es/themes/themeComponents/breakpoints.js +1 -0
- package/package.json +3 -2
|
@@ -64,7 +64,7 @@ const MobileDropdown = styledComponents.styled.button `
|
|
|
64
64
|
cursor: pointer;
|
|
65
65
|
background: none;
|
|
66
66
|
border: none;
|
|
67
|
-
padding: ${({ isCategoryLabel }) => (isCategoryLabel ? '0.5rem' : '0.75rem')} 1.25rem;
|
|
67
|
+
padding: ${({ $isCategoryLabel }) => ($isCategoryLabel ? '0.5rem' : '0.75rem')} 1.25rem;
|
|
68
68
|
color: ${theme.default.color.text.pink};
|
|
69
69
|
font-size: ${theme.default.fontSize.default};
|
|
70
70
|
line-height: ${theme.default.lineHeight.default};
|
|
@@ -125,8 +125,10 @@ const DropdownList = styledComponents.styled(CoreULStyles) `
|
|
|
125
125
|
background-color: ${theme.default.color.background.white.default};
|
|
126
126
|
border: 1px solid ${theme.default.color.line.L04};
|
|
127
127
|
border-radius: 0 0 ${theme.default.radius.default} ${theme.default.radius.default};
|
|
128
|
-
visibility: ${({ isDropdownListOpen }) => (isDropdownListOpen ? 'visible' : 'hidden')};
|
|
129
|
-
clip-path: inset(
|
|
128
|
+
visibility: ${({ $isDropdownListOpen }) => ($isDropdownListOpen ? 'visible' : 'hidden')};
|
|
129
|
+
clip-path: inset(
|
|
130
|
+
0% 0% ${({ $isDropdownListOpen }) => ($isDropdownListOpen ? '0%' : '100%')} 0%
|
|
131
|
+
);
|
|
130
132
|
transition: all 0.2s ease-in-out;
|
|
131
133
|
|
|
132
134
|
${styledUtils.media.md `
|
|
@@ -327,7 +329,7 @@ const PriorityNavigation = (_a) => {
|
|
|
327
329
|
!isMobile && props.categoryLabel && (React__default.default.createElement(Category, { id: categoryId }, props.categoryLabel)),
|
|
328
330
|
React__default.default.createElement("nav", { "aria-labelledby": categoryId },
|
|
329
331
|
React__default.default.createElement(ListsContainer, { ref: listsContainerRef },
|
|
330
|
-
isMobile && selectedItem && (React__default.default.createElement(MobileDropdown, { onClick: toggleMobileNavigation, "aria-label": mobileDropdownAriaLabel !== null && mobileDropdownAriaLabel !== void 0 ? mobileDropdownAriaLabel : `${props.categoryLabel ? `${props.categoryLabel}, ` : ''}${selectedItem}.`, "aria-expanded": isMobileNavigationOpen, isCategoryLabel: Boolean(props.categoryLabel) },
|
|
332
|
+
isMobile && selectedItem && (React__default.default.createElement(MobileDropdown, { onClick: toggleMobileNavigation, "aria-label": mobileDropdownAriaLabel !== null && mobileDropdownAriaLabel !== void 0 ? mobileDropdownAriaLabel : `${props.categoryLabel ? `${props.categoryLabel}, ` : ''}${selectedItem}.`, "aria-expanded": isMobileNavigationOpen, "$isCategoryLabel": Boolean(props.categoryLabel) },
|
|
331
333
|
React__default.default.createElement(MobileDropdownContent, null,
|
|
332
334
|
props.categoryLabel && React__default.default.createElement(Category, null, props.categoryLabel),
|
|
333
335
|
selectedItem),
|
|
@@ -354,7 +356,7 @@ const PriorityNavigation = (_a) => {
|
|
|
354
356
|
!isMobile && Boolean(state.dropdownItems.length) && (React__default.default.createElement(React__default.default.Fragment, null,
|
|
355
357
|
React__default.default.createElement("div", null,
|
|
356
358
|
React__default.default.createElement(ButtonIcon.default, { ref: dropdownButtonRef, ariaLabel: openMoreSubpagesAriaLabel, ariaExpanded: isDropdownListOpen, onClick: toggleDropdown, icon: isDropdownListOpen ? icons.ChevronUp : icons.ChevronDown, isReversed: true, "data-testid": "dropdown-button" }, dropdownButtonLabel)),
|
|
357
|
-
isDropdownListOpen && (React__default.default.createElement(DropdownList, { isDropdownListOpen: isDropdownListOpen }, state.dropdownItems.map(dropdownItem => React.isValidElement(dropdownItem) &&
|
|
359
|
+
isDropdownListOpen && (React__default.default.createElement(DropdownList, { "$isDropdownListOpen": isDropdownListOpen }, state.dropdownItems.map(dropdownItem => React.isValidElement(dropdownItem) &&
|
|
358
360
|
dropdownItem.type === PriorityNavigationItem.default && (React__default.default.createElement(PriorityNavigationItem.default, { id: dropdownItem.props.id, key: dropdownItem.key, onClick: dropdownItem.props.onClick || props.onClick, onKeyDown: dropdownItem.props.onKeyDown ||
|
|
359
361
|
props.onKeyDown, isActive: dropdownItem.props.isActive, className: dropdownItem.props.className, "data-testid": dropdownItem.props['data-testid'] }, dropdownItem.props.children)))))))))));
|
|
360
362
|
};
|
|
@@ -40,7 +40,7 @@ const ProgressIndicatorItem = styledComponents.styled.li `
|
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
align-items: center;
|
|
42
42
|
flex: 1.5 1 0%;
|
|
43
|
-
gap: ${({ small }) => styledUtils.getMultipliedSize(theme.default.base.baseWidth, small ? 0.5 : 1)};
|
|
43
|
+
gap: ${({ $small }) => styledUtils.getMultipliedSize(theme.default.base.baseWidth, $small ? 0.5 : 1)};
|
|
44
44
|
|
|
45
45
|
&:first-of-type {
|
|
46
46
|
align-items: flex-start;
|
|
@@ -70,34 +70,34 @@ const ProgressIndicatorItem = styledComponents.styled.li `
|
|
|
70
70
|
`;
|
|
71
71
|
const ProgressIndicatorItemConnector = styledComponents.styled.div `
|
|
72
72
|
position: absolute;
|
|
73
|
-
top: ${({ small }) => styledUtils.getMultipliedSize(theme.default.base.baseHeight, small ? 1.5 : 2)};
|
|
73
|
+
top: ${({ $small }) => styledUtils.getMultipliedSize(theme.default.base.baseHeight, $small ? 1.5 : 2)};
|
|
74
74
|
left: -50%;
|
|
75
75
|
right: 50%;
|
|
76
76
|
width: 100%;
|
|
77
|
-
height: ${({ small }) => (small ? '2px' : '4px')};
|
|
78
|
-
background-color: ${({ isActive, isCompleted }) => isActive || isCompleted ? theme.default.color.default.pink : theme.default.color.line.L02};
|
|
77
|
+
height: ${({ $small }) => ($small ? '2px' : '4px')};
|
|
78
|
+
background-color: ${({ $isActive, $isCompleted }) => $isActive || $isCompleted ? theme.default.color.default.pink : theme.default.color.line.L02};
|
|
79
79
|
`;
|
|
80
80
|
const ProgressIndicatorItemNumber = styledComponents.styled.div `
|
|
81
81
|
display: flex;
|
|
82
82
|
justify-content: center;
|
|
83
83
|
align-items: center;
|
|
84
|
-
font-size: ${({ small }) => (small ? theme.default.fontSize.s : theme.default.fontSize.l)};
|
|
84
|
+
font-size: ${({ $small }) => ($small ? theme.default.fontSize.s : theme.default.fontSize.l)};
|
|
85
85
|
font-weight: ${theme.default.fontWeight.bold};
|
|
86
|
-
width: ${({ small }) => styledUtils.getMultipliedSize(theme.default.base.baseWidth, small ? 3 : 4)};
|
|
87
|
-
height: ${({ small }) => styledUtils.getMultipliedSize(theme.default.base.baseHeight, small ? 3 : 4)};
|
|
88
|
-
cursor: ${({ isClickable }) => (isClickable ? 'pointer' : 'default')};
|
|
89
|
-
color: ${({ isActive }) => (isActive ? theme.default.color.text.white : theme.default.color.text.gray)};
|
|
86
|
+
width: ${({ $small }) => styledUtils.getMultipliedSize(theme.default.base.baseWidth, $small ? 3 : 4)};
|
|
87
|
+
height: ${({ $small }) => styledUtils.getMultipliedSize(theme.default.base.baseHeight, $small ? 3 : 4)};
|
|
88
|
+
cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};
|
|
89
|
+
color: ${({ $isActive }) => ($isActive ? theme.default.color.text.white : theme.default.color.text.gray)};
|
|
90
90
|
border-radius: ${theme.default.radius.circle};
|
|
91
|
-
border: ${({ small, isActive, isCompleted, isError }) => `${small ? '3px' : '4px'} solid ${getBorderColor({ isActive, isCompleted, isError })}`};
|
|
91
|
+
border: ${({ $small, $isActive, $isCompleted, $isError }) => `${$small ? '3px' : '4px'} solid ${getBorderColor({ isActive: $isActive, isCompleted: $isCompleted, isError: $isError })}`};
|
|
92
92
|
z-index: 1;
|
|
93
93
|
|
|
94
|
-
${({ isActive, isError }) => getBackgroundColor({ isActive, isError })}
|
|
94
|
+
${({ $isActive, $isError }) => getBackgroundColor({ isActive: $isActive, isError: $isError })}
|
|
95
95
|
`;
|
|
96
96
|
const ProgressIndicatorItemLabel = styledComponents.styled.div `
|
|
97
|
-
font-size: ${({ small }) => (small ? theme.default.fontSize.xs : theme.default.fontSize.s)};
|
|
98
|
-
line-height: ${({ small }) => (small ? theme.default.lineHeight.xs : theme.default.lineHeight.s)};
|
|
97
|
+
font-size: ${({ $small }) => ($small ? theme.default.fontSize.xs : theme.default.fontSize.s)};
|
|
98
|
+
line-height: ${({ $small }) => ($small ? theme.default.lineHeight.xs : theme.default.lineHeight.s)};
|
|
99
99
|
font-weight: ${theme.default.fontWeight.bold};
|
|
100
|
-
color: ${({ isActive }) => (isActive ? theme.default.color.text.black : theme.default.color.text.gray)};
|
|
100
|
+
color: ${({ $isActive }) => ($isActive ? theme.default.color.text.black : theme.default.color.text.gray)};
|
|
101
101
|
|
|
102
102
|
${styledUtils.media.sm `
|
|
103
103
|
&.visually-hidden {
|
|
@@ -133,12 +133,12 @@ const ProgressIndicator = (_a) => {
|
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
const isClickable = isCompleted && Boolean(props.onStepClick);
|
|
136
|
-
return (React__default.default.createElement(ProgressIndicatorItem, { key: id, small: props.small },
|
|
137
|
-
index > 0 && (React__default.default.createElement(ProgressIndicatorItemConnector, { small: props.small, isActive: isActive, isCompleted: isCompleted })),
|
|
138
|
-
React__default.default.createElement(ProgressIndicatorItemNumber, { small: props.small,
|
|
136
|
+
return (React__default.default.createElement(ProgressIndicatorItem, { key: id, "$small": props.small },
|
|
137
|
+
index > 0 && (React__default.default.createElement(ProgressIndicatorItemConnector, { "$small": props.small, "$isActive": isActive, "$isCompleted": isCompleted })),
|
|
138
|
+
React__default.default.createElement(ProgressIndicatorItemNumber, { "$small": props.small, "$isActive": isActive, "$isCompleted": isCompleted, "$isError": isError, "$isClickable": isClickable, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: isClickable || isActive ? 0 : -1, role: "tab", "aria-current": isActive ? 'step' : 'false', "aria-label": isCompleted && props.completedStepLabel
|
|
139
139
|
? `${label}, ${props.completedStepLabel}`
|
|
140
140
|
: label }, isCompleted || isError ? (React__default.default.createElement(Icon.default, { icon: isError ? icons.Warning : icons.Check, color: isError ? theme.default.color.text.white : theme.default.color.text.pink, size: "1rem", "aria-hidden": true })) : (stepNumber)),
|
|
141
|
-
label && (React__default.default.createElement(ProgressIndicatorItemLabel, { "aria-hidden": true, small: props.small,
|
|
141
|
+
label && (React__default.default.createElement(ProgressIndicatorItemLabel, { "aria-hidden": true, "$small": props.small, "$isActive": isActive, onClick: handleClick, className: "visually-hidden" }, label))));
|
|
142
142
|
});
|
|
143
143
|
return (React__default.default.createElement(ProgressIndicatorWrapper, { className: props.className, "data-testid": dataTestId, "aria-label": props.ariaLabel, role: "tablist" }, progressIndicatorItems));
|
|
144
144
|
};
|
|
@@ -18,13 +18,13 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
18
18
|
const SecondaryNavigationWrapper = styledComponents.styled.nav `
|
|
19
19
|
font-size: ${theme.default.fontSize.default};
|
|
20
20
|
padding: 0;
|
|
21
|
-
background-color: ${({ whiteBg }) => whiteBg ? theme.default.color.background.white.default : 'transparent'};
|
|
21
|
+
background-color: ${({ $whiteBg }) => $whiteBg ? theme.default.color.background.white.default : 'transparent'};
|
|
22
22
|
|
|
23
|
-
${({ mobileOnly }) => styledUtils.media.sm `
|
|
24
|
-
display: ${mobileOnly ? 'none' : 'inherit'};
|
|
23
|
+
${({ $mobileOnly }) => styledUtils.media.sm `
|
|
24
|
+
display: ${$mobileOnly ? 'none' : 'inherit'};
|
|
25
25
|
`};
|
|
26
26
|
|
|
27
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
27
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
28
28
|
border-bottom: 1px solid ${theme.default.color.line.L03};
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
@@ -45,7 +45,7 @@ const MobileSelector = styledComponents.styled.button `
|
|
|
45
45
|
cursor: pointer;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
48
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
49
49
|
display: none;
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
@@ -57,14 +57,14 @@ const MobileSelectorArrow = styledComponents.styled.span `
|
|
|
57
57
|
|
|
58
58
|
.dnasg-icon svg {
|
|
59
59
|
transition: transform 0.15s ease-in-out;
|
|
60
|
-
transform: rotate(${({ isOpen }) => (isOpen ? '180deg' : '0deg')});
|
|
60
|
+
transform: rotate(${({ $isOpen }) => ($isOpen ? '180deg' : '0deg')});
|
|
61
61
|
}
|
|
62
62
|
`;
|
|
63
63
|
const MobileSelectorCheck = styledComponents.styled.span `
|
|
64
64
|
margin-left: auto;
|
|
65
65
|
|
|
66
66
|
.dnasg-icon {
|
|
67
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
67
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
68
68
|
display: none;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -79,11 +79,11 @@ const SecondaryNavigationList = styledComponents.styled.ul `
|
|
|
79
79
|
transition:
|
|
80
80
|
max-height 0.2s ease-in-out,
|
|
81
81
|
border-bottom 0.2s linear;
|
|
82
|
-
background-color: ${({ isOpen }) => isOpen ? theme.default.color.background.white.default : 'transparent'};
|
|
83
|
-
max-height: ${({ isOpen }) => (isOpen ? '500vh' : '0')};
|
|
84
|
-
border-bottom: ${({ isOpen }) => (isOpen ? `1px solid ${theme.default.color.line.L03}` : 'none')};
|
|
82
|
+
background-color: ${({ $isOpen }) => $isOpen ? theme.default.color.background.white.default : 'transparent'};
|
|
83
|
+
max-height: ${({ $isOpen }) => ($isOpen ? '500vh' : '0')};
|
|
84
|
+
border-bottom: ${({ $isOpen }) => ($isOpen ? `1px solid ${theme.default.color.line.L03}` : 'none')};
|
|
85
85
|
|
|
86
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
86
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
87
87
|
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 2)};
|
|
88
88
|
max-height: none;
|
|
89
89
|
position: static;
|
|
@@ -101,28 +101,28 @@ const SecondaryNavigationListElement = styledComponents.styled.li `
|
|
|
101
101
|
text-decoration: none;
|
|
102
102
|
padding: 1rem 0;
|
|
103
103
|
justify-content: start;
|
|
104
|
-
color: ${({ isActive }) => (isActive ? theme.default.color.text.pink : theme.default.color.text.black)};
|
|
105
|
-
font-weight: ${({ isActive }) => isActive ? theme.default.fontWeight.bold : theme.default.fontWeight.book};
|
|
104
|
+
color: ${({ $isActive }) => ($isActive ? theme.default.color.text.pink : theme.default.color.text.black)};
|
|
105
|
+
font-weight: ${({ $isActive }) => $isActive ? theme.default.fontWeight.bold : theme.default.fontWeight.book};
|
|
106
106
|
display: flex;
|
|
107
107
|
align-items: center;
|
|
108
108
|
|
|
109
109
|
&:hover {
|
|
110
110
|
color: ${theme.default.color.text.pink};
|
|
111
111
|
text-decoration: none;
|
|
112
|
-
cursor: ${({ isActive }) => (isActive ? 'auto' : 'pointer')};
|
|
112
|
+
cursor: ${({ $isActive }) => ($isActive ? 'auto' : 'pointer')};
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
115
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
116
116
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1.5)} 0;
|
|
117
117
|
font-weight: ${theme.default.fontWeight.book};
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
121
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
122
122
|
margin: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.5)};
|
|
123
123
|
white-space: nowrap;
|
|
124
124
|
transition: border-bottom 0.2s linear;
|
|
125
|
-
border-bottom: ${({ isActive }) => isActive ? `1px solid ${theme.default.color.default.pink}` : 'none'};
|
|
125
|
+
border-bottom: ${({ $isActive }) => $isActive ? `1px solid ${theme.default.color.default.pink}` : 'none'};
|
|
126
126
|
|
|
127
127
|
&:first-of-type {
|
|
128
128
|
margin-left: 0;
|
|
@@ -135,7 +135,7 @@ const IconWrapper = styledComponents.styled.span `
|
|
|
135
135
|
margin-right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1)};
|
|
136
136
|
|
|
137
137
|
&:after {
|
|
138
|
-
display: ${({ showNotification }) => (showNotification ? 'inline' : 'none')};
|
|
138
|
+
display: ${({ $showNotification }) => ($showNotification ? 'inline' : 'none')};
|
|
139
139
|
content: '';
|
|
140
140
|
position: absolute;
|
|
141
141
|
border-radius: ${theme.default.radius.circle};
|
|
@@ -147,7 +147,7 @@ const IconWrapper = styledComponents.styled.span `
|
|
|
147
147
|
background-color: ${theme.default.color.default.pink};
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
150
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
151
151
|
display: none;
|
|
152
152
|
}
|
|
153
153
|
`;
|
|
@@ -176,16 +176,16 @@ const SecondaryNavigation = (_a) => {
|
|
|
176
176
|
const selectedElement = (_b = props.data.pages) === null || _b === void 0 ? void 0 : _b.find(listElement => currentUrl === listElement.urls[lang]);
|
|
177
177
|
const shouldHighlightSelectedElement = (_c = (selectedElement && highlightIds.some(el => el === selectedElement.id))) !== null && _c !== void 0 ? _c : false;
|
|
178
178
|
const checkIsMenuItemLinkAbsolute = (menuItemLink) => menuItemLink.includes('http');
|
|
179
|
-
return (React__default.default.createElement(SecondaryNavigationWrapper, { ref: ref,
|
|
180
|
-
selectedElement && (React__default.default.createElement(MobileSelector, { onClick: toggleNav, collapseSize: collapseSize, "data-testid": "secondary-navigation-dropdown-selector" },
|
|
179
|
+
return (React__default.default.createElement(SecondaryNavigationWrapper, { ref: ref, "data-testid": dataTestId, className: className, "$collapseSize": collapseSize, "$mobileOnly": props.mobileOnly, "$whiteBg": props.whiteBg },
|
|
180
|
+
selectedElement && (React__default.default.createElement(MobileSelector, { onClick: toggleNav, "$collapseSize": collapseSize, "data-testid": "secondary-navigation-dropdown-selector" },
|
|
181
181
|
React__default.default.createElement(MobileSelectorTitleWrapper, null,
|
|
182
|
-
(selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.icon) && (React__default.default.createElement(IconWrapper, { showNotification: shouldHighlightSelectedElement, collapseSize: collapseSize },
|
|
182
|
+
(selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.icon) && (React__default.default.createElement(IconWrapper, { "$showNotification": shouldHighlightSelectedElement, "$collapseSize": collapseSize },
|
|
183
183
|
React__default.default.createElement(Icon.default, { name: selectedElement.icon }))),
|
|
184
184
|
React__default.default.createElement("span", null, selectedElement.titles[lang])),
|
|
185
|
-
React__default.default.createElement(MobileSelectorArrow, { isOpen: isSecondaryNavOpen },
|
|
185
|
+
React__default.default.createElement(MobileSelectorArrow, { "$isOpen": isSecondaryNavOpen },
|
|
186
186
|
React__default.default.createElement(Icon.default, { icon: icons.ChevronDown })))),
|
|
187
187
|
React__default.default.createElement(SecondaryNavigationList, { id: props.data.name ||
|
|
188
|
-
`secondary-navigation-category-${(_d = props.data.categoryId) !== null && _d !== void 0 ? _d : ''}`, isOpen: isSecondaryNavOpen, collapseSize: collapseSize, "max-width": maxWidth, "data-testid": "secondary-nav-menu-ul" }, (_e = props.data.pages) === null || _e === void 0 ? void 0 : _e.map((listElement, index) => {
|
|
188
|
+
`secondary-navigation-category-${(_d = props.data.categoryId) !== null && _d !== void 0 ? _d : ''}`, "$isOpen": isSecondaryNavOpen, "$collapseSize": collapseSize, "max-width": maxWidth, "data-testid": "secondary-nav-menu-ul" }, (_e = props.data.pages) === null || _e === void 0 ? void 0 : _e.map((listElement, index) => {
|
|
189
189
|
const linkUrl = listElement.urls[lang];
|
|
190
190
|
const linkTitle = listElement.titles[lang];
|
|
191
191
|
const iconName = listElement.icon || '';
|
|
@@ -194,12 +194,12 @@ const SecondaryNavigation = (_a) => {
|
|
|
194
194
|
: currentUrl.indexOf(linkUrl) > -1;
|
|
195
195
|
const showNotification = highlightIds.some(el => el === listElement.id);
|
|
196
196
|
const isMenuItemLinkAbsolute = checkIsMenuItemLinkAbsolute(linkUrl);
|
|
197
|
-
return (React__default.default.createElement(SecondaryNavigationListElement, { key: listElement.id,
|
|
197
|
+
return (React__default.default.createElement(SecondaryNavigationListElement, { key: listElement.id, onClick: closeNav, "$isActive": isActive, "$collapseSize": collapseSize }, NextJSSecondaryNavLink && !isMenuItemLinkAbsolute ? (React__default.default.createElement(NextJSSecondaryNavLink, { linkUrl: linkUrl, linkTitle: linkTitle, iconName: iconName, showNotification: showNotification, collapseSize: collapseSize, "data-testid": `secondary-nav-item-link-${index + 1}` }, isActive && (React__default.default.createElement(MobileSelectorCheck, { "$collapseSize": collapseSize },
|
|
198
198
|
React__default.default.createElement(Icon.default, { icon: icons.Check }))))) : (React__default.default.createElement("a", { href: linkUrl, "data-testid": `secondary-nav-item-link-${index + 1}` },
|
|
199
|
-
iconName && (React__default.default.createElement(IconWrapper, { showNotification: showNotification, collapseSize: collapseSize },
|
|
199
|
+
iconName && (React__default.default.createElement(IconWrapper, { "$showNotification": showNotification, "$collapseSize": collapseSize },
|
|
200
200
|
React__default.default.createElement(Icon.default, { name: iconName }))),
|
|
201
201
|
React__default.default.createElement("span", null, linkTitle),
|
|
202
|
-
isActive && (React__default.default.createElement(MobileSelectorCheck, { collapseSize: collapseSize },
|
|
202
|
+
isActive && (React__default.default.createElement(MobileSelectorCheck, { "$collapseSize": collapseSize },
|
|
203
203
|
React__default.default.createElement(Icon.default, { icon: icons.Check })))))));
|
|
204
204
|
}))));
|
|
205
205
|
};
|
|
@@ -88,7 +88,7 @@ const Textarea = (_a) => {
|
|
|
88
88
|
props.label && (React__default.default.createElement(LabelText.default, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label`, status: isErrorStatus ? 'error' : undefined, isMandatory: props.required }, props.label)),
|
|
89
89
|
React__default.default.createElement(StyledTextarea, { id: props.id, name: props.name, ref: inputRef, value: props.value, rows: height, placeholder: props.placeholder, tabIndex: props.tabIndex, onChange: handleChange, onBlur: handleOnBlur, onFocus: props.onFocus, onClick: onClick, onKeyDown: props.onKeyDown, onKeyPress: props.onKeyPress, required: props.required, disabled: props.disabled, "aria-label": !props.label ? ariaLabel : undefined, "aria-invalid": isErrorStatus, "aria-describedby": describedBy, "data-testid": dataTestId }),
|
|
90
90
|
props.commentMessage && (React__default.default.createElement(Message, { id: commentId, "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage)),
|
|
91
|
-
isErrorStatus && props.errorMessage && (React__default.default.createElement(ErrorMessage, { id: errorId, "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
91
|
+
isErrorStatus && props.errorMessage && (React__default.default.createElement(ErrorMessage, { id: errorId, role: "alert", "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
exports.default = Textarea;
|
|
@@ -22,6 +22,7 @@ export { default as EnergyLabel } from './EnergyLabel/EnergyLabel';
|
|
|
22
22
|
export { default as Expander } from './Expander/Expander';
|
|
23
23
|
export { default as Floater } from './Floater/Floater';
|
|
24
24
|
export { default as Footer } from './Footer/Footer';
|
|
25
|
+
export { default as Hero } from './Hero/Hero';
|
|
25
26
|
export { default as Icon } from './Icon/Icon';
|
|
26
27
|
export * from './Icons';
|
|
27
28
|
export { default as InfoDialog } from './InfoDialog/InfoDialog';
|
package/build/cjs/index.js
CHANGED
|
@@ -24,6 +24,7 @@ var EnergyLabel = require('./components/EnergyLabel/EnergyLabel.js');
|
|
|
24
24
|
var Expander = require('./components/Expander/Expander.js');
|
|
25
25
|
var Floater = require('./components/Floater/Floater.js');
|
|
26
26
|
var Footer = require('./components/Footer/Footer.js');
|
|
27
|
+
var Hero = require('./components/Hero/Hero.js');
|
|
27
28
|
var Icon = require('./components/Icon/Icon.js');
|
|
28
29
|
var hlArrowBackSmall = require('./components/Icons/Small/hlArrowBackSmall.js');
|
|
29
30
|
var hlArrowForwardSmall = require('./components/Icons/Small/hlArrowForwardSmall.js');
|
|
@@ -194,6 +195,7 @@ exports.EnergyLabel = EnergyLabel.default;
|
|
|
194
195
|
exports.Expander = Expander.default;
|
|
195
196
|
exports.Floater = Floater.default;
|
|
196
197
|
exports.Footer = Footer.default;
|
|
198
|
+
exports.Hero = Hero.default;
|
|
197
199
|
exports.Icon = Icon.default;
|
|
198
200
|
exports.hlArrowBackSmall = hlArrowBackSmall.default;
|
|
199
201
|
exports.hlArrowForwardSmall = hlArrowForwardSmall.default;
|
|
@@ -2,6 +2,7 @@ import { styled } from 'styled-components';
|
|
|
2
2
|
import theme from '../../themes/theme.js';
|
|
3
3
|
import Button, { shade } from '../Button/Button.js';
|
|
4
4
|
|
|
5
|
+
/* eslint-disable transient-props/transient-props */
|
|
5
6
|
/** @visibleName Button Primary */
|
|
6
7
|
const ButtonPrimary = styled(Button) `
|
|
7
8
|
color: ${theme.color.text.white};
|
|
@@ -2,6 +2,7 @@ import { styled } from 'styled-components';
|
|
|
2
2
|
import theme from '../../themes/theme.js';
|
|
3
3
|
import Button, { shade } from '../Button/Button.js';
|
|
4
4
|
|
|
5
|
+
/* eslint-disable transient-props/transient-props */
|
|
5
6
|
/** @visibleName Button Secondary */
|
|
6
7
|
const ButtonSecondary = styled(Button) `
|
|
7
8
|
color: ${theme.color.text.plum};
|
|
@@ -40,16 +40,17 @@ const slideIn = keyframes `
|
|
|
40
40
|
const StyledReactModal = styled(ReactModal) `
|
|
41
41
|
position: fixed;
|
|
42
42
|
top: 0;
|
|
43
|
-
${({ side }) => (side === 'left' ? 'left: 0' : 'right: 0')};
|
|
44
|
-
width: ${({ size }) => sizeMap[size]};
|
|
43
|
+
${({ $side }) => ($side === 'left' ? 'left: 0' : 'right: 0')};
|
|
44
|
+
width: ${({ $size }) => sizeMap[$size]};
|
|
45
45
|
height: 100dvh;
|
|
46
46
|
max-height: 100%;
|
|
47
47
|
max-width: calc(100vw - ${getMultipliedSize(theme.base.baseWidth, 4)});
|
|
48
|
-
transform: translateX(${({ side }) => side === 'left' && '-'}100%);
|
|
49
|
-
animation: ${slideIn} ${({ size }) => animationMap[size][0]}s forwards;
|
|
48
|
+
transform: translateX(${({ $side }) => $side === 'left' && '-'}100%);
|
|
49
|
+
animation: ${slideIn} ${({ $size }) => animationMap[$size][0]}s forwards;
|
|
50
50
|
|
|
51
51
|
&.ReactModal__Content--before-close {
|
|
52
|
-
animation: ${({ side }) => slideOut(side)} ${({ size }) => animationMap[size][1]}s
|
|
52
|
+
animation: ${({ $side }) => slideOut($side)} ${({ $size }) => animationMap[$size][1]}s
|
|
53
|
+
forwards;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
@media (max-width: ${sizeMap.small}) {
|
|
@@ -143,7 +144,7 @@ const CloseButton = styled(ButtonClose) `
|
|
|
143
144
|
margin: 0;
|
|
144
145
|
padding: 0.5rem;
|
|
145
146
|
border-radius: 0 0 0 ${theme.radius.default};
|
|
146
|
-
background-color: ${({ variant }) => variant === 'light'
|
|
147
|
+
background-color: ${({ $variant }) => $variant === 'light'
|
|
147
148
|
? theme.color.background.sand.E01
|
|
148
149
|
: theme.color.background.plum.default};
|
|
149
150
|
`;
|
|
@@ -168,13 +169,13 @@ const Drawer = (_a) => {
|
|
|
168
169
|
var { appElement = '#__next', size = 'medium', side = 'right', variant = 'light', padding = '1.25rem', closeButton = true, isClosable = true, 'data-testid': dataTestId } = _a, props = __rest(_a, ["appElement", "size", "side", "variant", "padding", "closeButton", "isClosable", 'data-testid']);
|
|
169
170
|
ReactModal.setAppElement(appElement);
|
|
170
171
|
return (React__default.createElement(React__default.Fragment, null,
|
|
171
|
-
React__default.createElement(StyledReactModal, { id: props.id, isOpen: props.isOpen, overlayElement: ModalOverlay, contentElement: ModalContent, onRequestClose: props.onRequestClose, portalClassName: props.className, contentLabel: props.contentLabel, shouldCloseOnEsc: isClosable, shouldCloseOnOverlayClick: isClosable, closeTimeoutMS: 300, size: size, side: side },
|
|
172
|
+
React__default.createElement(StyledReactModal, { id: props.id, isOpen: props.isOpen, overlayElement: ModalOverlay, contentElement: ModalContent, onRequestClose: props.onRequestClose, portalClassName: props.className, contentLabel: props.contentLabel, shouldCloseOnEsc: isClosable, shouldCloseOnOverlayClick: isClosable, closeTimeoutMS: 300, "$size": size, "$side": side },
|
|
172
173
|
React__default.createElement(StyledBox, { "data-testid": dataTestId, elevation: "extraHigh", margin: props.margin, padding: "0" },
|
|
173
174
|
React__default.createElement(ContentContainer, null,
|
|
174
175
|
React__default.createElement(Header, { "$variant": variant, "data-testid": dataTestId && `${dataTestId}-header` },
|
|
175
176
|
React__default.createElement(Title, { "$size": size, "$variant": variant }, props.title),
|
|
176
177
|
props.subtitle && (React__default.createElement(Subtitle, { "$size": size, "$variant": variant }, props.subtitle))),
|
|
177
|
-
closeButton && isClosable && (React__default.createElement(CloseButton, { onClick: props.onRequestClose, "aria-label": props.closeLabel, "data-testid": dataTestId && `${dataTestId}-close-button`, variant: variant },
|
|
178
|
+
closeButton && isClosable && (React__default.createElement(CloseButton, { onClick: props.onRequestClose, "aria-label": props.closeLabel, "data-testid": dataTestId && `${dataTestId}-close-button`, "$variant": variant },
|
|
178
179
|
React__default.createElement(Close, { color: variant === 'light'
|
|
179
180
|
? theme.color.default.plum
|
|
180
181
|
: theme.color.default.white }))),
|
|
@@ -11,12 +11,12 @@ const getInset = ({ position, offset, }) => {
|
|
|
11
11
|
};
|
|
12
12
|
const Element = styled.div `
|
|
13
13
|
position: sticky;
|
|
14
|
-
${({ zIndex }) => zIndex && `z-index: ${zIndex}`};
|
|
15
|
-
${({ $position, offset }) => getInset({ position: $position, offset })}
|
|
14
|
+
${({ $zIndex }) => $zIndex && `z-index: ${$zIndex}`};
|
|
15
|
+
${({ $position = 'top', $offset }) => getInset({ position: $position, offset: $offset })}
|
|
16
16
|
`;
|
|
17
17
|
const Floater = (_a) => {
|
|
18
18
|
var { position = 'top', offset = '0', 'data-testid': dataTestId } = _a, props = __rest(_a, ["position", "offset", 'data-testid']);
|
|
19
|
-
return (React__default.createElement(Element, { id: props.id, "$position": position, offset: offset, zIndex: props.zIndex, className: props.className, "data-testid": dataTestId }, props.children));
|
|
19
|
+
return (React__default.createElement(Element, { id: props.id, "$position": position, "$offset": offset, "$zIndex": props.zIndex, className: props.className, "data-testid": dataTestId }, props.children));
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export { Floater as default };
|
|
@@ -277,14 +277,37 @@ const Categories = ({ categories }) => {
|
|
|
277
277
|
const GeneralInformation = ({ generalInformation }) => {
|
|
278
278
|
const { language } = useContext(FooterContext);
|
|
279
279
|
const currentYear = new Date().getFullYear();
|
|
280
|
-
const
|
|
280
|
+
const COOKIE_SETTINGS_URL = 'cookie-settings';
|
|
281
|
+
const OT_SDK_CLASSNAME = 'ot-sdk-show-settings';
|
|
282
|
+
// TODO after release: Remove redundant `isNewModelUsed` condition and refactor it's usages (STYLE-905)
|
|
283
|
+
const isNewModelUsed = !!generalInformation.mandatoryLinks;
|
|
281
284
|
const typeToClassMap = {
|
|
282
285
|
cookie: 'ot-sdk-show-settings',
|
|
283
286
|
};
|
|
284
|
-
const
|
|
287
|
+
const orderMap = ['privacyPolicy', 'cookieSettings', 'terms'];
|
|
288
|
+
const getOrderedLinks = () => {
|
|
289
|
+
if (isNewModelUsed && Array.isArray(generalInformation.mandatoryLinks)) {
|
|
290
|
+
return generalInformation.mandatoryLinks;
|
|
291
|
+
}
|
|
292
|
+
return orderMap.map(id => new Map(Object.entries(generalInformation)).get(id));
|
|
293
|
+
};
|
|
294
|
+
const getLinkHref = (item) => {
|
|
295
|
+
var _a;
|
|
296
|
+
if (!((_a = item.urls) === null || _a === void 0 ? void 0 : _a[language]))
|
|
297
|
+
return '#!';
|
|
298
|
+
return item.urls[language] !== COOKIE_SETTINGS_URL ? item.urls[language] : '#!';
|
|
299
|
+
};
|
|
300
|
+
const getLinkClassName = (item) => {
|
|
301
|
+
var _a;
|
|
302
|
+
if (isNewModelUsed) {
|
|
303
|
+
return ((_a = item.urls) === null || _a === void 0 ? void 0 : _a[language]) === COOKIE_SETTINGS_URL ? OT_SDK_CLASSNAME : '';
|
|
304
|
+
}
|
|
305
|
+
return item.type ? typeToClassMap[item.type] : '';
|
|
306
|
+
};
|
|
307
|
+
const orderedGeneralInformation = getOrderedLinks();
|
|
285
308
|
return (React__default.createElement(GeneralInformationContainer, { "data-testid": "general-information-section" },
|
|
286
309
|
orderedGeneralInformation.map((item, index) => item && (React__default.createElement(Fragment, { key: `general-information-link-${index}` },
|
|
287
|
-
React__default.createElement("a", { href: (item
|
|
310
|
+
React__default.createElement("a", { href: getLinkHref(item), className: getLinkClassName(item) }, item.titles[language]),
|
|
288
311
|
React__default.createElement("span", { "aria-hidden": "true" }, "|")))),
|
|
289
312
|
"DNA ",
|
|
290
313
|
currentYear));
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { ComponentProps, ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type Label from '../Label/Label';
|
|
4
|
+
import type ButtonPrimary from '../ButtonPrimary/ButtonPrimary';
|
|
5
|
+
import type Button from '../Button/Button';
|
|
6
|
+
interface CommonImageProps {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
src: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
}
|
|
11
|
+
type HeroVariant = 'default' | 'centered' | 'centered-text-left';
|
|
12
|
+
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
13
|
+
type ImageComponent = ComponentType<CommonImageProps> | 'img';
|
|
14
|
+
interface HeroProps {
|
|
15
|
+
/**
|
|
16
|
+
* Visual variant of the hero component
|
|
17
|
+
* - default: Content aligned to left with offset
|
|
18
|
+
* - centered: Content and text centered
|
|
19
|
+
* - centered-text-left: Content centered but text left-aligned
|
|
20
|
+
*
|
|
21
|
+
* @default 'default'
|
|
22
|
+
*/
|
|
23
|
+
variant?: HeroVariant;
|
|
24
|
+
/**
|
|
25
|
+
* Image component to use for background - can be 'img' for plain HTML or a component like Next.js Image
|
|
26
|
+
* @default 'img'
|
|
27
|
+
*/
|
|
28
|
+
Image?: ImageComponent;
|
|
29
|
+
/**
|
|
30
|
+
* Props to pass to the background Image component
|
|
31
|
+
*/
|
|
32
|
+
imageProps?: CommonImageProps;
|
|
33
|
+
/**
|
|
34
|
+
* Background color when no image is provided
|
|
35
|
+
*/
|
|
36
|
+
backgroundColor?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Enable gradient overlay on background
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
hasGradient?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Logo image component for logo-style heroes
|
|
45
|
+
*/
|
|
46
|
+
LogoImage?: ImageComponent;
|
|
47
|
+
/**
|
|
48
|
+
* Props to pass to the Logo image component
|
|
49
|
+
*/
|
|
50
|
+
logoImageProps?: CommonImageProps;
|
|
51
|
+
/**
|
|
52
|
+
* Label content (must use Label component)
|
|
53
|
+
*/
|
|
54
|
+
label?: ReactElement<ComponentProps<typeof Label>>;
|
|
55
|
+
/**
|
|
56
|
+
* Main heading content
|
|
57
|
+
*/
|
|
58
|
+
heading?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Heading level for semantic HTML
|
|
61
|
+
*
|
|
62
|
+
* @default 'h1'
|
|
63
|
+
*/
|
|
64
|
+
headingLevel?: HeadingLevel;
|
|
65
|
+
/**
|
|
66
|
+
* Description text content
|
|
67
|
+
*/
|
|
68
|
+
description?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Primary call-to-action button
|
|
71
|
+
*/
|
|
72
|
+
primaryCta?: ReactElement<ComponentProps<typeof ButtonPrimary>>;
|
|
73
|
+
/**
|
|
74
|
+
* Optional secondary call-to-action button
|
|
75
|
+
*/
|
|
76
|
+
secondaryCta?: ReactElement<ComponentProps<typeof Button>>;
|
|
77
|
+
/**
|
|
78
|
+
* Allows to pass a custom className
|
|
79
|
+
*/
|
|
80
|
+
className?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Allows to pass testid string for testing purposes
|
|
83
|
+
*/
|
|
84
|
+
'data-testid'?: string;
|
|
85
|
+
}
|
|
86
|
+
declare const Hero: ({ variant, headingLevel, Image, LogoImage, "data-testid": dataTestId, ...props }: HeroProps) => React.JSX.Element;
|
|
87
|
+
/** @component */
|
|
88
|
+
export default Hero;
|