@eeacms/volto-eea-design-system 1.0.0-beta.4 → 1.0.0-beta.5
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/CHANGELOG.md +26 -1
- package/package.json +2 -1
- package/src/helpers/index.js +1 -0
- package/src/helpers/useOnScreen.js +32 -0
- package/src/ui/Footer/Footer.jsx +8 -1
- package/src/ui/Footer/FooterSites.jsx +8 -2
- package/src/ui/Footer/SubFooter.jsx +7 -2
- package/src/ui/Header/Header.jsx +6 -2
- package/theme/themes/eea/extras/footer.less +38 -23
- package/theme/themes/eea/extras/footer.variables +1 -0
- package/theme/themes/eea/globals/utilities.less +13 -0
- package/theme/themes/eea/views/card.overrides +7 -4
- package/theme/themes/eea/views/card.variables +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,32 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
### [1.0.0-beta.
|
|
7
|
+
### [1.0.0-beta.5](https://github.com/eea/volto-eea-design-system/compare/1.0.0-beta.4...1.0.0-beta.5) - 7 March 2023
|
|
8
|
+
|
|
9
|
+
#### :nail_care: Enhancements
|
|
10
|
+
|
|
11
|
+
- change(footer): removed min width and height from links [David Ichim - [`ac33219`](https://github.com/eea/volto-eea-design-system/commit/ac33219fb77f23bb5148355551a7aad9f453d2e7)]
|
|
12
|
+
- change(carousel): tweak size of carousel dots for better touch interaction [David Ichim - [`e1fb823`](https://github.com/eea/volto-eea-design-system/commit/e1fb8230806de2e157a9a5ea87e63765769565b4)]
|
|
13
|
+
|
|
14
|
+
#### :house: Internal changes
|
|
15
|
+
|
|
16
|
+
- style(hiddenStructure): Add hiddenStructure utility to be used with h1 heading on frontpage - refs #158717 [Alin Voinea - [`672cca2`](https://github.com/eea/volto-eea-design-system/commit/672cca2401003f56e5ea104f18103ea090e38fd7)]
|
|
17
|
+
|
|
18
|
+
#### :hammer_and_wrench: Others
|
|
19
|
+
|
|
20
|
+
- Release 1.0.0-beta.5 [Alin Voinea - [`e4417e1`](https://github.com/eea/volto-eea-design-system/commit/e4417e121477511c350ae3fbe4e70aadb445ed86)]
|
|
21
|
+
- better useOnScreen hook [Andrei Grigore - [`c214b6b`](https://github.com/eea/volto-eea-design-system/commit/c214b6b76443f81c795ce2f3aa457562ec088b30)]
|
|
22
|
+
- feature(mobile): increased performance by lazy loading footer images #303 from eea/increase_performance [ichim-david - [`80d1df1`](https://github.com/eea/volto-eea-design-system/commit/80d1df1c459680331d486f9e8e6a95c9db0adbf6)]
|
|
23
|
+
- prettier [David Ichim - [`a7f8384`](https://github.com/eea/volto-eea-design-system/commit/a7f838470c1bcc4e2be115d514d92a1b686a5e9b)]
|
|
24
|
+
- fixed less build failure due to changes in footer.less [David Ichim - [`190bc8c`](https://github.com/eea/volto-eea-design-system/commit/190bc8cfa88191b45808f1e27c6e2737ee3d15b1)]
|
|
25
|
+
- useOnScreen default export [andreiggr - [`3e6cfdd`](https://github.com/eea/volto-eea-design-system/commit/3e6cfdd4dcb814aad328f97be7af41af071ccba6)]
|
|
26
|
+
- lazyload bg img on footer also [andreiggr - [`ae07162`](https://github.com/eea/volto-eea-design-system/commit/ae07162ba1b27bff58fed70eaabc28c78c5f45a3)]
|
|
27
|
+
- lazyload footer images [andreiggr - [`a0633c9`](https://github.com/eea/volto-eea-design-system/commit/a0633c9ec4ccfb63a48eb4e4c4a63c90daac1a37)]
|
|
28
|
+
- use aria-labels on dropdown [andreiggr - [`27e1443`](https://github.com/eea/volto-eea-design-system/commit/27e144315416ceace0f01def03b5b24640f5c7da)]
|
|
29
|
+
- role change for accessibility [andreiggr - [`5e758e0`](https://github.com/eea/volto-eea-design-system/commit/5e758e0a7fa8c56ba688d0a43de5890686f14ea3)]
|
|
30
|
+
- minimum tap dimension for mobile [andreiggr - [`a25e9a8`](https://github.com/eea/volto-eea-design-system/commit/a25e9a8ba8a8a0f24d287ed7513e549ae2caab0f)]
|
|
31
|
+
- Increase performance - mobile friendly [dana-cfc4 - [`07d86c8`](https://github.com/eea/volto-eea-design-system/commit/07d86c8e77568f91d50b3a45248de9427140a295)]
|
|
32
|
+
### [1.0.0-beta.4](https://github.com/eea/volto-eea-design-system/compare/1.0.0-beta.3...1.0.0-beta.4) - 1 March 2023
|
|
8
33
|
|
|
9
34
|
#### :rocket: New Features
|
|
10
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-eea-design-system",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "@eeacms/volto-eea-design-system: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: IDM2 A-Team",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@eeacms/volto-corsproxy": "*",
|
|
24
24
|
"react-countup": "^6.3.0",
|
|
25
|
+
"react-lazy-load-image-component": "1.5.6",
|
|
25
26
|
"react-slick": "^0.28.1",
|
|
26
27
|
"remixicon": "2.5.0",
|
|
27
28
|
"slick-carousel": "^1.8.1"
|
package/src/helpers/index.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function useOnScreen(ref, rootMargin = '0px') {
|
|
6
|
+
const [isIntersecting, setIntersecting] = React.useState(false);
|
|
7
|
+
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const observer = new IntersectionObserver(
|
|
10
|
+
([entry]) => {
|
|
11
|
+
setIntersecting(entry.isIntersecting);
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
rootMargin,
|
|
15
|
+
threshold: 0,
|
|
16
|
+
root: null,
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
if (ref?.current) {
|
|
20
|
+
observer.observe(ref.current);
|
|
21
|
+
}
|
|
22
|
+
return () => {
|
|
23
|
+
if (ref?.current) {
|
|
24
|
+
observer.unobserve(ref.current);
|
|
25
|
+
}
|
|
26
|
+
observer.disconnect();
|
|
27
|
+
};
|
|
28
|
+
}, [ref, rootMargin]);
|
|
29
|
+
return isIntersecting;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default useOnScreen;
|
package/src/ui/Footer/Footer.jsx
CHANGED
|
@@ -12,6 +12,7 @@ import FooterHeader from '@eeacms/volto-eea-design-system/ui/Footer/FooterHeader
|
|
|
12
12
|
import SubFooter from '@eeacms/volto-eea-design-system/ui/Footer/SubFooter';
|
|
13
13
|
import Social from '@eeacms/volto-eea-design-system/ui/Footer/Social';
|
|
14
14
|
import Contact from '@eeacms/volto-eea-design-system/ui/Footer/Contact';
|
|
15
|
+
import useOnScreen from '../../helpers/useOnScreen';
|
|
15
16
|
import Description from '@eeacms/volto-eea-design-system/ui/Footer/Description';
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -23,9 +24,15 @@ import Description from '@eeacms/volto-eea-design-system/ui/Footer/Description';
|
|
|
23
24
|
|
|
24
25
|
const Footer = (props) => {
|
|
25
26
|
const { children } = props;
|
|
27
|
+
|
|
28
|
+
const bgImgRef = React.useRef();
|
|
29
|
+
const onScreen = useOnScreen(bgImgRef);
|
|
26
30
|
return (
|
|
27
31
|
<footer id={'footer'}>
|
|
28
|
-
<div
|
|
32
|
+
<div
|
|
33
|
+
ref={bgImgRef}
|
|
34
|
+
className={onScreen ? 'footer-wrapper' : 'footer-wrapper-nobg'}
|
|
35
|
+
>
|
|
29
36
|
<Container>{children}</Container>
|
|
30
37
|
</div>
|
|
31
38
|
</footer>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Grid, Image } from 'semantic-ui-react';
|
|
3
|
+
import { LazyLoadComponent } from 'react-lazy-load-image-component';
|
|
4
|
+
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
6
|
|
|
5
7
|
const Sites = (props) => {
|
|
@@ -11,10 +13,14 @@ const Sites = (props) => {
|
|
|
11
13
|
column.push(
|
|
12
14
|
<Grid.Column className="logo" key={i}>
|
|
13
15
|
<a className="logo" href={item.link}>
|
|
14
|
-
<
|
|
16
|
+
<LazyLoadComponent>
|
|
17
|
+
<Image src={item.src} alt={item.alt}></Image>
|
|
18
|
+
</LazyLoadComponent>
|
|
15
19
|
</a>
|
|
16
20
|
<a className="logo" href={nextItem.link}>
|
|
17
|
-
<
|
|
21
|
+
<LazyLoadComponent>
|
|
22
|
+
<Image src={nextItem.src} alt={nextItem.alt}></Image>
|
|
23
|
+
</LazyLoadComponent>
|
|
18
24
|
</a>
|
|
19
25
|
</Grid.Column>,
|
|
20
26
|
);
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Footer from './Footer';
|
|
3
3
|
|
|
4
4
|
import { Grid, Image } from 'semantic-ui-react';
|
|
5
|
+
import { LazyLoadComponent } from 'react-lazy-load-image-component';
|
|
5
6
|
|
|
6
7
|
const SubFooter = (props) => {
|
|
7
8
|
if (props.children) {
|
|
@@ -23,7 +24,9 @@ const SubFooter = (props) => {
|
|
|
23
24
|
<div className="item">
|
|
24
25
|
<div className={manager.className}>
|
|
25
26
|
<a href={manager.link}>
|
|
26
|
-
<
|
|
27
|
+
<LazyLoadComponent>
|
|
28
|
+
<Image src={manager.src} alt={manager.alt}></Image>
|
|
29
|
+
</LazyLoadComponent>
|
|
27
30
|
</a>
|
|
28
31
|
</div>
|
|
29
32
|
</div>
|
|
@@ -55,7 +58,9 @@ const SubFooter = (props) => {
|
|
|
55
58
|
<div className="item">
|
|
56
59
|
<div className={manager.className}>
|
|
57
60
|
<a href={manager.link}>
|
|
58
|
-
<
|
|
61
|
+
<LazyLoadComponent>
|
|
62
|
+
<Image src={manager.src} alt={manager.alt}></Image>
|
|
63
|
+
</LazyLoadComponent>
|
|
59
64
|
</a>
|
|
60
65
|
</div>
|
|
61
66
|
</div>
|
package/src/ui/Header/Header.jsx
CHANGED
|
@@ -62,11 +62,13 @@ const TopDropdownMenu = ({
|
|
|
62
62
|
text={mobileText || text}
|
|
63
63
|
icon={icon || 'chevron down'}
|
|
64
64
|
aria-label="dropdown"
|
|
65
|
+
role="dropdown"
|
|
66
|
+
lazyLoad
|
|
65
67
|
closeOnChange={true}
|
|
66
68
|
closeOnBlur={false}
|
|
67
69
|
closeOnEscape={true}
|
|
68
70
|
>
|
|
69
|
-
<Dropdown.Menu role="
|
|
71
|
+
<Dropdown.Menu role="option">{children}</Dropdown.Menu>
|
|
70
72
|
</Dropdown>
|
|
71
73
|
)
|
|
72
74
|
) : (
|
|
@@ -75,12 +77,14 @@ const TopDropdownMenu = ({
|
|
|
75
77
|
className={className}
|
|
76
78
|
text={mobileText || text}
|
|
77
79
|
icon={icon || 'chevron down'}
|
|
80
|
+
role="dropdown"
|
|
78
81
|
aria-label="dropdown"
|
|
82
|
+
lazyLoad
|
|
79
83
|
closeOnChange={true}
|
|
80
84
|
closeOnBlur={false}
|
|
81
85
|
closeOnEscape={true}
|
|
82
86
|
>
|
|
83
|
-
<Dropdown.Menu role="
|
|
87
|
+
<Dropdown.Menu role="option">{children}</Dropdown.Menu>
|
|
84
88
|
</Dropdown>
|
|
85
89
|
)}
|
|
86
90
|
</>
|
|
@@ -21,6 +21,10 @@ footer {
|
|
|
21
21
|
background-position: @wrapperBackgroundPosition;
|
|
22
22
|
background-size: @mobileWrapperBackgroundSize;
|
|
23
23
|
}
|
|
24
|
+
.footer-wrapper-nobg {
|
|
25
|
+
width: @wrapperWidth;
|
|
26
|
+
padding: @mobileWrapperPadding;
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
footer .theme-sites {
|
|
@@ -144,6 +148,10 @@ footer .footer-wrapper .menu {
|
|
|
144
148
|
font-size: @mobileMenuCopyrightFontSize;
|
|
145
149
|
font-weight: @mobileMenuCopyrightFontWeight;
|
|
146
150
|
}
|
|
151
|
+
|
|
152
|
+
.contact-block .subcontact {
|
|
153
|
+
margin-top: @mobileSubcontactBlockMarginTop;
|
|
154
|
+
}
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
@media only screen and (min-width: @tabletBreakpoint) {
|
|
@@ -221,38 +229,45 @@ footer .footer-wrapper .menu {
|
|
|
221
229
|
.subfooter .logo-header {
|
|
222
230
|
// To match the figma align
|
|
223
231
|
margin-left: @computerLogoHeaderMarginLeft;
|
|
224
|
-
}
|
|
225
232
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
.subfooter .item {
|
|
234
|
+
.header {
|
|
235
|
+
margin-bottom: @computerItemHeaderMarginBottom;
|
|
236
|
+
}
|
|
230
237
|
|
|
231
|
-
|
|
232
|
-
align-items: center;
|
|
233
|
-
font-size: @contactFontSize;
|
|
234
|
-
gap: @contactGap;
|
|
238
|
+
}
|
|
235
239
|
|
|
236
|
-
|
|
237
|
-
font-size: @
|
|
240
|
+
.contact-block .subcontact a {
|
|
241
|
+
font-size: @computerSubContactIconFontSize;
|
|
242
|
+
margin-right: @computerSubContactIconMarginRight;
|
|
238
243
|
}
|
|
239
|
-
}
|
|
240
244
|
|
|
241
|
-
|
|
242
|
-
|
|
245
|
+
.subfooter .contact {
|
|
246
|
+
align-items: center;
|
|
247
|
+
font-size: @contactFontSize;
|
|
248
|
+
gap: @contactGap;
|
|
243
249
|
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
i.big.icon {
|
|
251
|
+
font-size: @computerContactIconFontSize;
|
|
252
|
+
}
|
|
246
253
|
}
|
|
247
|
-
}
|
|
248
254
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
255
|
+
.subfooter .footer-description {
|
|
256
|
+
margin: @computerFooterDescriptionMargin;
|
|
252
257
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
258
|
+
p {
|
|
259
|
+
font-size: @computerFooterDescriptionFontSize;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.subfooter .social {
|
|
264
|
+
margin: @computerSocialIconsMargin;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.footer .footer-wrapper .menu {
|
|
268
|
+
a {
|
|
269
|
+
font-size: @computerMenuFontSize;
|
|
270
|
+
}
|
|
256
271
|
}
|
|
257
272
|
}
|
|
258
273
|
}
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
@tabletContactGap : @rem-space-4;
|
|
43
43
|
@contactGap : @rem-space-8;
|
|
44
44
|
@mobileContactIconMarginRight : @space-3;
|
|
45
|
+
@mobileSubcontactBlockMarginTop : @space-3;
|
|
45
46
|
@mobileContactIconFontSize : @font-size-4;
|
|
46
47
|
@computerContactIconFontSize : @font-size-9;
|
|
47
48
|
@tabletSubContactIconFontSize : @font-size-0;
|
|
@@ -99,3 +99,16 @@ h1, h2, h3, h4, h5, h6, p, span, .header {
|
|
|
99
99
|
.fw-light {
|
|
100
100
|
font-weight: @font-weight-3;
|
|
101
101
|
}
|
|
102
|
+
|
|
103
|
+
.hiddenStructure {
|
|
104
|
+
border: 0 !important;
|
|
105
|
+
clip: rect(0 0 0 0) !important;
|
|
106
|
+
clip-path: inset(50%) !important;
|
|
107
|
+
height: 1px !important;
|
|
108
|
+
margin: -1px !important;
|
|
109
|
+
overflow: hidden !important;
|
|
110
|
+
padding: 0 !important;
|
|
111
|
+
position: absolute !important;
|
|
112
|
+
white-space: nowrap !important;
|
|
113
|
+
width: 1px !important;
|
|
114
|
+
}
|
|
@@ -370,6 +370,7 @@
|
|
|
370
370
|
position: relative;
|
|
371
371
|
bottom: 0;
|
|
372
372
|
}
|
|
373
|
+
|
|
373
374
|
.cards-carousel .slick-dots li button:before {
|
|
374
375
|
background-color: @carouselDotsBackgroundColor;
|
|
375
376
|
color: transparent;
|
|
@@ -390,11 +391,13 @@
|
|
|
390
391
|
outline-style: auto;
|
|
391
392
|
}
|
|
392
393
|
|
|
393
|
-
@media only screen and (
|
|
394
|
-
.cards-carousel .slick-dots li
|
|
395
|
-
|
|
396
|
-
|
|
394
|
+
@media only screen and (max-width: @tabletBreakpoint) {
|
|
395
|
+
.cards-carousel .slick-dots li,
|
|
396
|
+
.cards-carousel .slick-dots li button {
|
|
397
|
+
width: @mobileCarouselDotsButtonWidth;
|
|
398
|
+
height: @mobileCarouselDotsButtonHeight;
|
|
397
399
|
}
|
|
400
|
+
|
|
398
401
|
}
|
|
399
402
|
|
|
400
403
|
/*******************************
|
|
@@ -346,8 +346,10 @@
|
|
|
346
346
|
@carouselDotsBorder: 1px solid @darkCerulean;
|
|
347
347
|
@carouselDotsBackgroundColor: @white;
|
|
348
348
|
@carouselDotsActiveBackgroundColor: @darkCerulean;
|
|
349
|
-
@mobileCarouselDotsWidth:
|
|
350
|
-
@mobileCarouselDotsHeight:
|
|
349
|
+
@mobileCarouselDotsWidth: 1.25rem;
|
|
350
|
+
@mobileCarouselDotsHeight: 1.25rem;
|
|
351
|
+
@mobileCarouselDotsButtonWidth: 1.875rem;
|
|
352
|
+
@mobileCarouselDotsButtonHeight: 1.875rem;
|
|
351
353
|
|
|
352
354
|
/* Slick wrapper */
|
|
353
355
|
@slickListMargin: 0 -0.75em;
|