@eeacms/volto-eea-design-system 1.36.6 → 1.37.1

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 CHANGED
@@ -4,7 +4,18 @@ 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.36.6](https://github.com/eea/volto-eea-design-system/compare/1.36.5...1.36.6) - 7 May 2025
7
+ ### [1.37.1](https://github.com/eea/volto-eea-design-system/compare/1.37.0...1.37.1) - 25 June 2025
8
+
9
+ ### [1.37.0](https://github.com/eea/volto-eea-design-system/compare/1.36.6...1.37.0) - 6 June 2025
10
+
11
+ #### :house: Internal changes
12
+
13
+ - style: Automated code fix [eea-jenkins - [`ab9dc4f`](https://github.com/eea/volto-eea-design-system/commit/ab9dc4f95e31c3e2f9d77e793158178c5dbd5f51)]
14
+
15
+ #### :hammer_and_wrench: Others
16
+
17
+ - Release 1.37.0 [Alin Voinea - [`f92f838`](https://github.com/eea/volto-eea-design-system/commit/f92f83820b7c8888ea2d414f1c1a4c233e440876)]
18
+ ### [1.36.6](https://github.com/eea/volto-eea-design-system/compare/1.36.5...1.36.6) - 8 May 2025
8
19
 
9
20
  ### [1.36.5](https://github.com/eea/volto-eea-design-system/compare/1.36.4...1.36.5) - 7 May 2025
10
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "1.36.6",
3
+ "version": "1.37.1",
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",
@@ -1,8 +1,9 @@
1
1
  import React, { useRef } from 'react';
2
+ import cx from 'classnames';
2
3
  import Banner from './Banner';
3
4
  // eslint-disable-next-line import/no-unresolved
4
5
  import imgUrl from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/banner.png';
5
- import { Icon } from 'semantic-ui-react';
6
+ import { Icon, Container } from 'semantic-ui-react';
6
7
  import Popup from '@eeacms/volto-eea-design-system/ui/Popup/Popup';
7
8
  import Copyright from '../Copyright/Copyright';
8
9
 
@@ -132,8 +133,12 @@ const Template = (args) => {
132
133
  </>
133
134
  }
134
135
  >
135
- <Banner.Subtitle>{args.subtitle}</Banner.Subtitle>
136
+ {!args.aboveTitle && args.subtitle && (
137
+ <Banner.Subtitle>{args.subtitle}</Banner.Subtitle>
138
+ )}
139
+ {args.aboveTitle}
136
140
  <Banner.Title>{args.title}</Banner.Title>
141
+ {args.belowTitle}
137
142
  {args.metadata && (
138
143
  <Banner.Metadata>
139
144
  <>
@@ -176,3 +181,119 @@ Default.args = {
176
181
  copyrightIcon: 'ri-copyright-line',
177
182
  copyright: 'John Smith, Well with Nature /EEA',
178
183
  };
184
+
185
+ const InvertedwithHeroTemplate = (args) => (
186
+ <Container
187
+ className={cx(
188
+ 'homepage-inverse homepage-header light-header',
189
+ args.heroHeaderSize ? 'hero-header' : '',
190
+ )}
191
+ fluid
192
+ >
193
+ <Template
194
+ {...args}
195
+ hideShareButton
196
+ hideDownloadButton
197
+ aboveTitle={
198
+ !args.hideContentType ? (
199
+ <div className="content-type">{args.content_type}</div>
200
+ ) : (
201
+ ' '
202
+ )
203
+ }
204
+ belowTitle={
205
+ <>
206
+ <Banner.Subtitle>
207
+ <span className="subtitle-light">{args.subtitle}</span>
208
+ </Banner.Subtitle>
209
+ </>
210
+ }
211
+ />
212
+ </Container>
213
+ );
214
+
215
+ export const InvertedHero = InvertedwithHeroTemplate.bind({});
216
+ InvertedHero.args = {
217
+ ...Default.args,
218
+ metadata: Default.args.metadata.filter((meta) => meta.type !== 'type'),
219
+ hideContentType: false,
220
+ heroHeaderSize: false,
221
+ content_type: 'Web report',
222
+ };
223
+
224
+ const invertedArgTypes = {
225
+ hideContentType: {
226
+ description: 'hide content type',
227
+ table: {
228
+ type: {
229
+ summary: 'boolean',
230
+ },
231
+ defaultValue: {
232
+ summary: false,
233
+ },
234
+ },
235
+ },
236
+ hideShareButton: {
237
+ description: 'hide/show share button',
238
+ table: {
239
+ disable: true,
240
+ },
241
+ control: false,
242
+ },
243
+ hideDownloadButton: {
244
+ description: 'hide/show download button',
245
+ table: {
246
+ disable: true,
247
+ },
248
+ control: false,
249
+ },
250
+ };
251
+
252
+ InvertedHero.argTypes = {
253
+ ...invertedArgTypes,
254
+ heroHeaderSize: {
255
+ description: 'Make banner size of an hero image',
256
+ table: {
257
+ type: {
258
+ summary: 'boolean',
259
+ },
260
+ defaultValue: {
261
+ summary: true,
262
+ },
263
+ },
264
+ },
265
+ };
266
+
267
+ const InvertedTemplate = (args) => (
268
+ <Container
269
+ className={cx('view-viewview homepage-inverse light-header')}
270
+ fluid
271
+ >
272
+ <Template
273
+ {...args}
274
+ hideShareButton
275
+ hideDownloadButton
276
+ aboveTitle={
277
+ <>
278
+ {!args.hideContentType && (
279
+ <div className="content-type">{args.content_type}</div>
280
+ )}
281
+ <div className="subtitle">{args.subtitle}</div>
282
+ </>
283
+ }
284
+ />
285
+ </Container>
286
+ );
287
+
288
+ export const Inverted = InvertedTemplate.bind({});
289
+
290
+ Inverted.args = {
291
+ ...Default.args,
292
+ metadata: Default.args.metadata.filter((meta) => meta.type !== 'type'),
293
+ hideContentType: false,
294
+ content_type: 'Web report page',
295
+ };
296
+
297
+ Inverted.argTypes = {
298
+ ...invertedArgTypes,
299
+ };
@@ -1,5 +1,10 @@
1
1
  import React from 'react';
2
- import { Container } from 'semantic-ui-react';
2
+ import {
3
+ Container,
4
+ Accordion as SemanticAccordion,
5
+ Icon,
6
+ } from 'semantic-ui-react';
7
+ import cx from 'classnames';
3
8
 
4
9
  const sidenavItems = [
5
10
  {
@@ -239,3 +244,132 @@ Default.args = {
239
244
  header: '',
240
245
  sidenavItems: sidenavItems,
241
246
  };
247
+
248
+ const AccordionNavigation = ({ navigation, header }) => {
249
+ const [isNavOpen, setIsNavOpen] = React.useState(true);
250
+ const [activeItems, setActiveItems] = React.useState({});
251
+
252
+ const onClickSummary = (e) => {
253
+ e.preventDefault();
254
+ setIsNavOpen((prev) => !prev);
255
+ };
256
+
257
+ const onKeyDownSummary = (e) => {
258
+ if (e.keyCode === 13 || e.keyCode === 32) {
259
+ e.preventDefault();
260
+ onClickSummary(e);
261
+ }
262
+ };
263
+
264
+ const renderItems = ({ item, level = 0 }) => {
265
+ const {
266
+ title,
267
+ href = item['@id'],
268
+ is_current,
269
+ is_in_path,
270
+ items: childItems,
271
+ type = 'Link',
272
+ } = item;
273
+ const hasChildItems = childItems && childItems.length > 0;
274
+
275
+ const checkIfActive = () => {
276
+ return activeItems[href] !== undefined ? activeItems[href] : is_in_path;
277
+ };
278
+
279
+ const isActive = checkIfActive();
280
+
281
+ const handleTitleClick = () => {
282
+ setActiveItems((prev) => ({ ...prev, [href]: !isActive }));
283
+ };
284
+
285
+ return (
286
+ <li
287
+ className={cx({
288
+ is_in_path,
289
+ 'accordion-list-title': !hasChildItems,
290
+ 'accordion-list-item': hasChildItems,
291
+ })}
292
+ key={href}
293
+ >
294
+ {hasChildItems ? (
295
+ <SemanticAccordion className="default">
296
+ <SemanticAccordion.Title
297
+ active={isActive}
298
+ as={'button'}
299
+ aria-expanded={isActive}
300
+ onClick={handleTitleClick}
301
+ aria-controls={`accordion-content-${title}`}
302
+ id={`accordion-title-${title}`}
303
+ >
304
+ <span className="title-text">{title}</span>
305
+ <Icon
306
+ className={
307
+ isActive ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'
308
+ }
309
+ />
310
+ </SemanticAccordion.Title>
311
+ <SemanticAccordion.Content
312
+ active={isActive}
313
+ role="region"
314
+ id={`accordion-content-${title}`}
315
+ aria-labelledby={`accordion-title-${title}`}
316
+ >
317
+ <ul className="accordion-list">
318
+ {childItems.map((child) =>
319
+ renderItems({ item: child, level: level + 1 }),
320
+ )}
321
+ </ul>
322
+ </SemanticAccordion.Content>
323
+ </SemanticAccordion>
324
+ ) : (
325
+ <a
326
+ href={href}
327
+ className={cx(`title-link contenttype-${type}`, {
328
+ current: is_current,
329
+ in_path: is_in_path,
330
+ })}
331
+ >
332
+ {title}
333
+ </a>
334
+ )}
335
+ </li>
336
+ );
337
+ };
338
+
339
+ return navigation.length ? (
340
+ <Container>
341
+ <nav className="context-navigation" aria-label={header}>
342
+ <details open={isNavOpen}>
343
+ {/* eslint-disable-next-line */}
344
+ <summary
345
+ className="context-navigation-header accordion-header"
346
+ onClick={onClickSummary}
347
+ onKeyDown={onKeyDownSummary}
348
+ >
349
+ {header}
350
+ <Icon
351
+ size="large"
352
+ className={
353
+ isNavOpen ? 'ri-arrow-up-s-line' : 'ri-arrow-down-s-line'
354
+ }
355
+ />
356
+ </summary>
357
+
358
+ <ul
359
+ className="context-navigation-list accordion-list"
360
+ style={{ width: '100%' }}
361
+ >
362
+ {navigation.map((item) => renderItems({ item }))}
363
+ </ul>
364
+ </details>
365
+ </nav>
366
+ </Container>
367
+ ) : null;
368
+ };
369
+
370
+ export const Accordion = AccordionNavigation.bind({});
371
+
372
+ Accordion.args = {
373
+ navigation: sidenavItems,
374
+ header: 'Navigation',
375
+ };
@@ -30,7 +30,8 @@ const ItemGrid = ({
30
30
  renderMenuItem,
31
31
  hideChildrenFromNavigation,
32
32
  }) => {
33
- const item_id = item.title.toLowerCase().replaceAll(' ', '-') + '-sub-title';
33
+ const item_id =
34
+ item?.title?.toLowerCase()?.replaceAll(' ', '-') + '-sub-title';
34
35
  return (
35
36
  <>
36
37
  {renderMenuItem(item, { className: 'sub-title', id: item_id })}
@@ -53,7 +54,8 @@ const Item = ({
53
54
  renderMenuItem,
54
55
  hideChildrenFromNavigation,
55
56
  }) => {
56
- const item_id = item.title.toLowerCase().replaceAll(' ', '-') + '-sub-title';
57
+ const item_id =
58
+ item?.title?.toLowerCase()?.replaceAll(' ', '-') + '-sub-title';
57
59
  return (
58
60
  <>
59
61
  {renderMenuItem(item, {
@@ -349,8 +351,13 @@ function HeaderMenuPopUp({
349
351
  // be used for all menu items that don't have a specific layout
350
352
  const layout =
351
353
  (!!menuItemsLayouts &&
352
- Object.keys(menuItemsLayouts).includes(menuItem?.url) &&
353
- menuItemsLayouts[menuItem.url]) ||
354
+ menuItem?.items?.length > 0 &&
355
+ (menuItemsLayouts[menuItem?.url] ||
356
+ menuItemsLayouts[
357
+ Object.keys(menuItemsLayouts).find((key) =>
358
+ menuItem?.url?.includes(key),
359
+ )
360
+ ])) ||
354
361
  (!!menuItemsLayouts && menuItemsLayouts['*']) ||
355
362
  {};
356
363
 
@@ -344,14 +344,11 @@
344
344
  *******************************/
345
345
 
346
346
  @media print {
347
- .eea.banner .gradient .content,
348
- .eea.banner .image .gradient .content {
349
- padding-top: @printContentPadding;
350
- }
351
-
352
- .eea.banner .gradient .content > div > div {
353
- padding-top: 0;
354
- padding-bottom: 0;
347
+ .eea.banner {
348
+ .gradient .content,
349
+ .image .gradient .content {
350
+ padding: @printContentPadding;
351
+ }
355
352
  }
356
353
  }
357
354
 
@@ -20,7 +20,7 @@
20
20
  @mobileContentPadding : 1rem 0 1.25rem;
21
21
  @tabletContentPadding : 3rem 0 1.25rem;
22
22
  @computerContentPadding : 5rem 0 1.25rem;
23
- @printContentPadding : 15px;
23
+ @printContentPadding : 2rem 1.25rem;
24
24
 
25
25
  @mobileContentPaddingWithImage : 6.25rem 0 1.25rem;
26
26
  @tabletContentPaddingWithImage : 12.5rem 0 1.25rem;
@@ -1017,6 +1017,46 @@
1017
1017
  padding: 0 1.25rem;
1018
1018
  }
1019
1019
  }
1020
+
1021
+ @media print {
1022
+ .top.bar,
1023
+ .main-menu,
1024
+ .eea .header .action,
1025
+ #page-header .action {
1026
+ display: none !important;
1027
+ visibility: hidden;
1028
+ }
1029
+
1030
+ .eea.header {
1031
+ max-width: @containerWidth !important;
1032
+
1033
+ .eea-logo {
1034
+ margin-top: 0;
1035
+ }
1036
+ }
1037
+
1038
+ .logo {
1039
+ margin-left: 0;
1040
+ }
1041
+
1042
+ .main.bar.transparency:before {
1043
+ background-color: transparent !important;
1044
+ }
1045
+
1046
+ .homepage.homepage-inverse {
1047
+ .eea.header {
1048
+ position: absolute;
1049
+ top: 0;
1050
+ left: 0;
1051
+ right: 0;
1052
+
1053
+ .main.bar {
1054
+ padding: @printHeaderMainSectionPadding;
1055
+ }
1056
+ }
1057
+ }
1058
+ }
1059
+
1020
1060
  /*******************************
1021
1061
  /Light Header
1022
1062
  *******************************/
@@ -111,6 +111,7 @@
111
111
  /* Main Section */
112
112
  @headerMainSectionBackground: transparent;
113
113
  @headerMainSectionTransparency: rgba(255, 255, 255, 0.1);
114
+ @printHeaderMainSectionPadding: 1.5em 2.5em 0 2.5em;
114
115
 
115
116
  /* Logo */
116
117
  @logoWidth: 100%;
@@ -8,7 +8,7 @@
8
8
  --------------------*/
9
9
 
10
10
  .block.hero .ui.delete-button {
11
- color: @heroDeleteButtonColor !important;
11
+ color: @heroDeleteButtonColor !important;
12
12
  }
13
13
 
14
14
  .eea.hero-block {
@@ -105,17 +105,22 @@
105
105
  }
106
106
 
107
107
  @media print {
108
+ .homepage.homepage-inverse {
109
+ .hero-block-inner-wrapper {
110
+ padding: @printInverseHeroBlockPrintPadding;
111
+ }
112
+ }
113
+
114
+ .hero-block-inner-wrapper {
115
+ padding: @printHeroBlockPrintPadding;
116
+ }
117
+
108
118
  .eea.hero-block.full-height,
109
119
  .eea.hero-block.full-height .hero-block-image-wrapper,
110
120
  .eea.hero-block.full-height .hero-block-inner-wrapper {
111
121
  min-height: unset;
112
122
  }
113
123
 
114
- .hero-block-inner-wrapper {
115
- padding-top: @heroBlockPrintPadding;
116
- padding-bottom: @heroBlockPrintPadding;
117
- }
118
-
119
124
  .hero-block-image-wrapper {
120
125
  left: 0 !important;
121
126
  right: 0 !important;
@@ -132,8 +137,8 @@
132
137
  }
133
138
 
134
139
  .hero-block-body .eea.copyright {
135
- display: none;
136
- visibility: hidden;
140
+ position: relative;
141
+ bottom: 0;
137
142
  }
138
143
  }
139
144
 
@@ -27,7 +27,8 @@
27
27
  @heroBlockWrapperPadding : 5rem;
28
28
  @tableHeroBlockWrapperPadding: 6rem;
29
29
  @desktopHeroBlockWrapperPadding: 194px 96px;
30
- @heroBlockPrintPadding: 20px;
30
+ @printHeroBlockPrintPadding: 2.5em;
31
+ @printInverseHeroBlockPrintPadding: 8.5em 2.5em 2.5em 2.5em;
31
32
 
32
33
  /* Body */
33
34
  @mobileHeroBlockBodyGap : @rem-space-6;
@@ -206,41 +206,58 @@ a {
206
206
 
207
207
  @media print {
208
208
 
209
+ @page {
210
+ size: A4;
211
+ margin: 1cm;
212
+ }
213
+ * {
214
+ -webkit-print-color-adjust: exact;
215
+ print-color-adjust: exact;
216
+ }
209
217
  .skiplinks-wrapper,
210
- .top.bar,
211
- .main.bar.transparency,
212
- .main-menu,
213
- .eea .header .action,
214
218
  .slider-arrow,
215
219
  #footer,
216
- #page-header .action,
217
- #inpage-navigation {
218
- display: none;
220
+ #inpage-navigation,
221
+ .column.actions,
222
+ .slick-arrows {
223
+ display: none !important;
219
224
  visibility: hidden;
220
225
  }
221
226
 
222
- .logo {
223
- margin-left: 0;
227
+ .block.gridBlock .ui.grid,
228
+ .content-box {
229
+ break-inside: avoid;
224
230
  }
225
231
 
226
- .static-banner {
227
- display: none;
228
- visibility: hidden;
232
+ .ui.segment.breadcrumbs {
233
+ padding: 0;
234
+
235
+ .ui.breadcrumb {
236
+ visibility: hidden;
237
+ }
229
238
  }
230
239
 
231
- .image {
232
- page-break-inside: avoid;
240
+ .ui.tab {
241
+ display: block;
233
242
  }
234
243
 
235
- img {
236
- page-break-inside: avoid;
244
+ .static-banner {
245
+ display: none;
246
+ visibility: hidden;
237
247
  }
238
248
 
239
- .card {
249
+ img,
250
+ .image,
251
+ .card,
252
+ .visualization,
253
+ .embed-map,
254
+ .embed-tableau,
255
+ .embed-map-visualization,
256
+ .embed-visualization {
240
257
  page-break-inside: avoid;
241
258
  }
242
259
 
243
260
  .grid-block-teaser .card {
244
261
  page-break-inside: auto;
245
262
  }
246
- }
263
+ }