@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
|
@@ -10,13 +10,13 @@ import Icon from '../Icon/Icon.js';
|
|
|
10
10
|
const SecondaryNavigationWrapper = styled.nav `
|
|
11
11
|
font-size: ${theme.fontSize.default};
|
|
12
12
|
padding: 0;
|
|
13
|
-
background-color: ${({ whiteBg }) => whiteBg ? theme.color.background.white.default : 'transparent'};
|
|
13
|
+
background-color: ${({ $whiteBg }) => $whiteBg ? theme.color.background.white.default : 'transparent'};
|
|
14
14
|
|
|
15
|
-
${({ mobileOnly }) => media.sm `
|
|
16
|
-
display: ${mobileOnly ? 'none' : 'inherit'};
|
|
15
|
+
${({ $mobileOnly }) => media.sm `
|
|
16
|
+
display: ${$mobileOnly ? 'none' : 'inherit'};
|
|
17
17
|
`};
|
|
18
18
|
|
|
19
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
19
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
20
20
|
border-bottom: 1px solid ${theme.color.line.L03};
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
@@ -37,7 +37,7 @@ const MobileSelector = styled.button `
|
|
|
37
37
|
cursor: pointer;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
40
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
41
41
|
display: none;
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
@@ -49,14 +49,14 @@ const MobileSelectorArrow = styled.span `
|
|
|
49
49
|
|
|
50
50
|
.dnasg-icon svg {
|
|
51
51
|
transition: transform 0.15s ease-in-out;
|
|
52
|
-
transform: rotate(${({ isOpen }) => (isOpen ? '180deg' : '0deg')});
|
|
52
|
+
transform: rotate(${({ $isOpen }) => ($isOpen ? '180deg' : '0deg')});
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
55
|
const MobileSelectorCheck = styled.span `
|
|
56
56
|
margin-left: auto;
|
|
57
57
|
|
|
58
58
|
.dnasg-icon {
|
|
59
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
59
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
60
60
|
display: none;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -71,11 +71,11 @@ const SecondaryNavigationList = styled.ul `
|
|
|
71
71
|
transition:
|
|
72
72
|
max-height 0.2s ease-in-out,
|
|
73
73
|
border-bottom 0.2s linear;
|
|
74
|
-
background-color: ${({ isOpen }) => isOpen ? theme.color.background.white.default : 'transparent'};
|
|
75
|
-
max-height: ${({ isOpen }) => (isOpen ? '500vh' : '0')};
|
|
76
|
-
border-bottom: ${({ isOpen }) => (isOpen ? `1px solid ${theme.color.line.L03}` : 'none')};
|
|
74
|
+
background-color: ${({ $isOpen }) => $isOpen ? theme.color.background.white.default : 'transparent'};
|
|
75
|
+
max-height: ${({ $isOpen }) => ($isOpen ? '500vh' : '0')};
|
|
76
|
+
border-bottom: ${({ $isOpen }) => ($isOpen ? `1px solid ${theme.color.line.L03}` : 'none')};
|
|
77
77
|
|
|
78
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
78
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
79
79
|
padding: 0 ${getMultipliedSize(theme.base.baseWidth, 2)};
|
|
80
80
|
max-height: none;
|
|
81
81
|
position: static;
|
|
@@ -93,28 +93,28 @@ const SecondaryNavigationListElement = styled.li `
|
|
|
93
93
|
text-decoration: none;
|
|
94
94
|
padding: 1rem 0;
|
|
95
95
|
justify-content: start;
|
|
96
|
-
color: ${({ isActive }) => (isActive ? theme.color.text.pink : theme.color.text.black)};
|
|
97
|
-
font-weight: ${({ isActive }) => isActive ? theme.fontWeight.bold : theme.fontWeight.book};
|
|
96
|
+
color: ${({ $isActive }) => ($isActive ? theme.color.text.pink : theme.color.text.black)};
|
|
97
|
+
font-weight: ${({ $isActive }) => $isActive ? theme.fontWeight.bold : theme.fontWeight.book};
|
|
98
98
|
display: flex;
|
|
99
99
|
align-items: center;
|
|
100
100
|
|
|
101
101
|
&:hover {
|
|
102
102
|
color: ${theme.color.text.pink};
|
|
103
103
|
text-decoration: none;
|
|
104
|
-
cursor: ${({ isActive }) => (isActive ? 'auto' : 'pointer')};
|
|
104
|
+
cursor: ${({ $isActive }) => ($isActive ? 'auto' : 'pointer')};
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
107
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
108
108
|
padding: ${getMultipliedSize(theme.base.baseHeight, 1.5)} 0;
|
|
109
109
|
font-weight: ${theme.fontWeight.book};
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
113
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
114
114
|
margin: 0 ${getMultipliedSize(theme.base.baseWidth, 1.5)};
|
|
115
115
|
white-space: nowrap;
|
|
116
116
|
transition: border-bottom 0.2s linear;
|
|
117
|
-
border-bottom: ${({ isActive }) => isActive ? `1px solid ${theme.color.default.pink}` : 'none'};
|
|
117
|
+
border-bottom: ${({ $isActive }) => $isActive ? `1px solid ${theme.color.default.pink}` : 'none'};
|
|
118
118
|
|
|
119
119
|
&:first-of-type {
|
|
120
120
|
margin-left: 0;
|
|
@@ -127,7 +127,7 @@ const IconWrapper = styled.span `
|
|
|
127
127
|
margin-right: ${getMultipliedSize(theme.base.baseWidth, 1)};
|
|
128
128
|
|
|
129
129
|
&:after {
|
|
130
|
-
display: ${({ showNotification }) => (showNotification ? 'inline' : 'none')};
|
|
130
|
+
display: ${({ $showNotification }) => ($showNotification ? 'inline' : 'none')};
|
|
131
131
|
content: '';
|
|
132
132
|
position: absolute;
|
|
133
133
|
border-radius: ${theme.radius.circle};
|
|
@@ -139,7 +139,7 @@ const IconWrapper = styled.span `
|
|
|
139
139
|
background-color: ${theme.color.default.pink};
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
@media (min-width: ${({ collapseSize }) => collapseSize + 1}px) {
|
|
142
|
+
@media (min-width: ${({ $collapseSize }) => $collapseSize + 1}px) {
|
|
143
143
|
display: none;
|
|
144
144
|
}
|
|
145
145
|
`;
|
|
@@ -168,16 +168,16 @@ const SecondaryNavigation = (_a) => {
|
|
|
168
168
|
const selectedElement = (_b = props.data.pages) === null || _b === void 0 ? void 0 : _b.find(listElement => currentUrl === listElement.urls[lang]);
|
|
169
169
|
const shouldHighlightSelectedElement = (_c = (selectedElement && highlightIds.some(el => el === selectedElement.id))) !== null && _c !== void 0 ? _c : false;
|
|
170
170
|
const checkIsMenuItemLinkAbsolute = (menuItemLink) => menuItemLink.includes('http');
|
|
171
|
-
return (React__default.createElement(SecondaryNavigationWrapper, { ref: ref,
|
|
172
|
-
selectedElement && (React__default.createElement(MobileSelector, { onClick: toggleNav, collapseSize: collapseSize, "data-testid": "secondary-navigation-dropdown-selector" },
|
|
171
|
+
return (React__default.createElement(SecondaryNavigationWrapper, { ref: ref, "data-testid": dataTestId, className: className, "$collapseSize": collapseSize, "$mobileOnly": props.mobileOnly, "$whiteBg": props.whiteBg },
|
|
172
|
+
selectedElement && (React__default.createElement(MobileSelector, { onClick: toggleNav, "$collapseSize": collapseSize, "data-testid": "secondary-navigation-dropdown-selector" },
|
|
173
173
|
React__default.createElement(MobileSelectorTitleWrapper, null,
|
|
174
|
-
(selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.icon) && (React__default.createElement(IconWrapper, { showNotification: shouldHighlightSelectedElement, collapseSize: collapseSize },
|
|
174
|
+
(selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.icon) && (React__default.createElement(IconWrapper, { "$showNotification": shouldHighlightSelectedElement, "$collapseSize": collapseSize },
|
|
175
175
|
React__default.createElement(Icon, { name: selectedElement.icon }))),
|
|
176
176
|
React__default.createElement("span", null, selectedElement.titles[lang])),
|
|
177
|
-
React__default.createElement(MobileSelectorArrow, { isOpen: isSecondaryNavOpen },
|
|
177
|
+
React__default.createElement(MobileSelectorArrow, { "$isOpen": isSecondaryNavOpen },
|
|
178
178
|
React__default.createElement(Icon, { icon: ChevronDown })))),
|
|
179
179
|
React__default.createElement(SecondaryNavigationList, { id: props.data.name ||
|
|
180
|
-
`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) => {
|
|
180
|
+
`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) => {
|
|
181
181
|
const linkUrl = listElement.urls[lang];
|
|
182
182
|
const linkTitle = listElement.titles[lang];
|
|
183
183
|
const iconName = listElement.icon || '';
|
|
@@ -186,12 +186,12 @@ const SecondaryNavigation = (_a) => {
|
|
|
186
186
|
: currentUrl.indexOf(linkUrl) > -1;
|
|
187
187
|
const showNotification = highlightIds.some(el => el === listElement.id);
|
|
188
188
|
const isMenuItemLinkAbsolute = checkIsMenuItemLinkAbsolute(linkUrl);
|
|
189
|
-
return (React__default.createElement(SecondaryNavigationListElement, { key: listElement.id,
|
|
189
|
+
return (React__default.createElement(SecondaryNavigationListElement, { key: listElement.id, onClick: closeNav, "$isActive": isActive, "$collapseSize": collapseSize }, NextJSSecondaryNavLink && !isMenuItemLinkAbsolute ? (React__default.createElement(NextJSSecondaryNavLink, { linkUrl: linkUrl, linkTitle: linkTitle, iconName: iconName, showNotification: showNotification, collapseSize: collapseSize, "data-testid": `secondary-nav-item-link-${index + 1}` }, isActive && (React__default.createElement(MobileSelectorCheck, { "$collapseSize": collapseSize },
|
|
190
190
|
React__default.createElement(Icon, { icon: Check }))))) : (React__default.createElement("a", { href: linkUrl, "data-testid": `secondary-nav-item-link-${index + 1}` },
|
|
191
|
-
iconName && (React__default.createElement(IconWrapper, { showNotification: showNotification, collapseSize: collapseSize },
|
|
191
|
+
iconName && (React__default.createElement(IconWrapper, { "$showNotification": showNotification, "$collapseSize": collapseSize },
|
|
192
192
|
React__default.createElement(Icon, { name: iconName }))),
|
|
193
193
|
React__default.createElement("span", null, linkTitle),
|
|
194
|
-
isActive && (React__default.createElement(MobileSelectorCheck, { collapseSize: collapseSize },
|
|
194
|
+
isActive && (React__default.createElement(MobileSelectorCheck, { "$collapseSize": collapseSize },
|
|
195
195
|
React__default.createElement(Icon, { icon: Check })))))));
|
|
196
196
|
}))));
|
|
197
197
|
};
|
|
@@ -80,7 +80,7 @@ const Textarea = (_a) => {
|
|
|
80
80
|
props.label && (React__default.createElement(LabelText, { htmlFor: props.id, "data-testid": dataTestId && `${dataTestId}-label`, status: isErrorStatus ? 'error' : undefined, isMandatory: props.required }, props.label)),
|
|
81
81
|
React__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 }),
|
|
82
82
|
props.commentMessage && (React__default.createElement(Message, { id: commentId, "data-testid": dataTestId && `${dataTestId}-comment` }, props.commentMessage)),
|
|
83
|
-
isErrorStatus && props.errorMessage && (React__default.createElement(ErrorMessage, { id: errorId, "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
83
|
+
isErrorStatus && props.errorMessage && (React__default.createElement(ErrorMessage, { id: errorId, role: "alert", "data-testid": dataTestId && `${dataTestId}-error` }, props.errorMessage))));
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export { Textarea as default };
|
|
@@ -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/es/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export { default as EnergyLabel } from './components/EnergyLabel/EnergyLabel.js'
|
|
|
22
22
|
export { default as Expander } from './components/Expander/Expander.js';
|
|
23
23
|
export { default as Floater } from './components/Floater/Floater.js';
|
|
24
24
|
export { default as Footer } from './components/Footer/Footer.js';
|
|
25
|
+
export { default as Hero } from './components/Hero/Hero.js';
|
|
25
26
|
export { default as Icon } from './components/Icon/Icon.js';
|
|
26
27
|
export { default as hlArrowBackSmall } from './components/Icons/Small/hlArrowBackSmall.js';
|
|
27
28
|
export { default as hlArrowForwardSmall } from './components/Icons/Small/hlArrowForwardSmall.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnanpm/styleguide",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "v3.
|
|
4
|
+
"version": "v3.12.0",
|
|
5
5
|
"main": "build/cjs/index.js",
|
|
6
6
|
"module": "build/es/index.js",
|
|
7
7
|
"jsnext:main": "build/es/index.js",
|
|
@@ -71,11 +71,12 @@
|
|
|
71
71
|
"eslint-config-airbnb-typescript": "^17.1.0",
|
|
72
72
|
"eslint-config-prettier": "^10.1.8",
|
|
73
73
|
"eslint-plugin-import": "2.32.0",
|
|
74
|
-
"eslint-plugin-jsdoc": "^
|
|
74
|
+
"eslint-plugin-jsdoc": "^60.4.0",
|
|
75
75
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
76
76
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
77
77
|
"eslint-plugin-react": "^7.37.4",
|
|
78
78
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
79
|
+
"eslint-plugin-transient-props": "file:eslint-plugins/eslint-plugin-transient-props",
|
|
79
80
|
"jest": "^30.0.5",
|
|
80
81
|
"jest-environment-jsdom": "^29.7.0",
|
|
81
82
|
"jest-styled-components": "^7.2.0",
|