@eeacms/volto-eea-design-system 1.0.0-alpha.2 → 1.0.0-alpha.3

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.
Files changed (36) hide show
  1. package/.project.eslintrc.js +5 -1
  2. package/CHANGELOG.md +71 -0
  3. package/package.json +1 -1
  4. package/src/index.js +1 -0
  5. package/src/ui/Container/Container.stories.js +34 -1
  6. package/src/ui/ContextNavigation/ContextNavigation.stories.jsx +67 -7
  7. package/src/ui/Header/Header.jsx +7 -1
  8. package/src/ui/Header/Header.stories.js +91 -21
  9. package/src/ui/Header/HeaderMenuPopUp.js +61 -31
  10. package/theme/themes/eea/elements/container.overrides +71 -10
  11. package/theme/themes/eea/elements/container.variables +1 -0
  12. package/theme/themes/eea/extras/avatarGrid.less +2 -0
  13. package/theme/themes/eea/extras/banner.less +3 -0
  14. package/theme/themes/eea/extras/contentBox.less +5 -5
  15. package/theme/themes/eea/extras/contextNavigation.less +20 -4
  16. package/theme/themes/eea/extras/contextNavigation.variables +8 -0
  17. package/theme/themes/eea/extras/custom.overrides +0 -4
  18. package/theme/themes/eea/extras/downloadLabeledIcon.less +2 -0
  19. package/theme/themes/eea/extras/footer.less +3 -1
  20. package/theme/themes/eea/extras/header.less +100 -39
  21. package/theme/themes/eea/extras/header.variables +28 -9
  22. package/theme/themes/eea/extras/hero.less +2 -0
  23. package/theme/themes/eea/extras/inpageNavigation.less +2 -0
  24. package/theme/themes/eea/extras/keyContent.less +2 -0
  25. package/theme/themes/eea/extras/labeledIconGroup.less +2 -0
  26. package/theme/themes/eea/extras/languageLabeledIcon.less +2 -0
  27. package/theme/themes/eea/extras/newTabLabeledIcon.less +2 -0
  28. package/theme/themes/eea/extras/quote.less +2 -0
  29. package/theme/themes/eea/extras/relatedContent.less +2 -0
  30. package/theme/themes/eea/extras/tag.less +2 -0
  31. package/theme/themes/eea/extras/tagList.less +3 -1
  32. package/theme/themes/eea/extras/testimonial.less +1 -0
  33. package/theme/themes/eea/extras/timeline.less +2 -0
  34. package/theme/themes/eea/globals/site.overrides +52 -0
  35. package/theme/themes/eea/globals/site.variables +4 -0
  36. package/website/docs/2-whatsnew.md +77 -1
@@ -1,7 +1,9 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- const projectRootPath = fs.realpathSync('./project'); // __dirname
4
+ const projectRootPath = fs.existsSync('./project')
5
+ ? fs.realpathSync('./project')
6
+ : fs.realpathSync('./../../../');
5
7
  const packageJson = require(path.join(projectRootPath, 'package.json'));
6
8
  const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
7
9
 
@@ -23,6 +25,7 @@ const addonAliases = Object.keys(reg.packages).map(o => [
23
25
  reg.packages[o].modulePath,
24
26
  ]);
25
27
 
28
+
26
29
  module.exports = {
27
30
  extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
28
31
  settings: {
@@ -42,3 +45,4 @@ module.exports = {
42
45
  },
43
46
  },
44
47
  };
48
+
package/CHANGELOG.md CHANGED
@@ -4,6 +4,77 @@ 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-alpha.3](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.2...1.0.0-alpha.3) - 16 November 2022
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat(Header): Add subsite section styling #263 from eea/subsite [ichim-david - [`00398b8`](https://github.com/eea/volto-eea-design-system/commit/00398b8a6c5d83241c30d0ba85d95c115edf2480)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix(search): position now changed by default to absolute from relative [David Ichim - [`51b08fc`](https://github.com/eea/volto-eea-design-system/commit/51b08fc217e25c1391a2bac0b42a8c3f7ae091c7)]
16
+ - fix(megaMenu): remove paddings for buttons added by active class [Antonis Tarantilis - [`ec33ebf`](https://github.com/eea/volto-eea-design-system/commit/ec33ebfe23a6064c88383ab465bd45edee2dba9b)]
17
+
18
+ #### :nail_care: Enhancements
19
+
20
+ - change(mega-menu): hide home link and accordion content from mobile menu [David Ichim - [`1a69172`](https://github.com/eea/volto-eea-design-system/commit/1a691729b6d61c0daf46c5de035c1c55b0fda0d9)]
21
+ - change(container): width from min width 1280px to 1365px max width [David Ichim - [`66e551e`](https://github.com/eea/volto-eea-design-system/commit/66e551e532da2cc5e9716e5179f943f172663be4)]
22
+ - change(theme): modified wide width to point to 1320px as it's perfectly divisible by 4 [David Ichim - [`8f82573`](https://github.com/eea/volto-eea-design-system/commit/8f825737d6dafd595024bb4537eab624a47a9ad0)]
23
+ - change(theme): modified wide width to point to 1368px as it's perfectly divisible by 4 [David Ichim - [`2349fee`](https://github.com/eea/volto-eea-design-system/commit/2349fee36ee72783665a0b101d684389f1fdf834)]
24
+ - change(container): fullwidth now take into account devices without hover [David Ichim - [`5a35a65`](https://github.com/eea/volto-eea-design-system/commit/5a35a65ce4928972027325bd01265db3f046f0e8)]
25
+ - change(container): ensure only the top level elements behave like containers [David Ichim - [`98b85d1`](https://github.com/eea/volto-eea-design-system/commit/98b85d1fb285919a8851454fa3007131b2a0ffc3)]
26
+ - change(container): modified column-block grid to remove margin and padding when using full width class [David Ichim - [`35c1cee`](https://github.com/eea/volto-eea-design-system/commit/35c1cee7b3b35e7c361562ab7a430240f0117cc3)]
27
+ - change(components): load overrides files for our defined semantic files [David Ichim - [`adde7a9`](https://github.com/eea/volto-eea-design-system/commit/adde7a9519f38fa779d8d038f3b6817281f0b4a2)]
28
+ - change(container): story to avoid adding containerwidth property to container div [David Ichim - [`c13d83c`](https://github.com/eea/volto-eea-design-system/commit/c13d83cdbc8741bf4075cdfcd884f39f3f71d73c)]
29
+ - change(container): story to add classes that modify the max width of the containers [David Ichim - [`37948f8`](https://github.com/eea/volto-eea-design-system/commit/37948f89ee797738bd8bbb0023bc5dca018d7331)]
30
+ - change(container): renamed content-text-width to container-text-width [David Ichim - [`6f788c2`](https://github.com/eea/volto-eea-design-system/commit/6f788c282348292dd4b5deb47ffe83ca4573e5c8)]
31
+ - change(container): removed app extras and view setting of layout sizes [David Ichim - [`f6dc1ee`](https://github.com/eea/volto-eea-design-system/commit/f6dc1ee602634df85140f6db75e41293b72eacf1)]
32
+ - change(homepage): removed hiding of staging banner from homepage [David Ichim - [`4ba2cd7`](https://github.com/eea/volto-eea-design-system/commit/4ba2cd7fc17cdf1bf58381aa58e05acad0ac77ba)]
33
+ - change(site): add a 1rem margin top and bottom on all styled classes [David Ichim - [`dabf6c1`](https://github.com/eea/volto-eea-design-system/commit/dabf6c1162fe23cef61a2053eefd7e687f649a56)]
34
+ - change(container): use important flag for left and right margin [David Ichim - [`a49c83a`](https://github.com/eea/volto-eea-design-system/commit/a49c83abe9a045d28118a680558de5416a0516a3)]
35
+ - change(views): moved narrow style bellow the default container width styles [David Ichim - [`72fa58d`](https://github.com/eea/volto-eea-design-system/commit/72fa58dce9ea03a1e4f409a9f9aab21b01efbfc8)]
36
+ - change(view): set container width for view-viewview class as well [David Ichim - [`29dc324`](https://github.com/eea/volto-eea-design-system/commit/29dc324319d6dc2450dd0e906c1b4c93fd65ed56)]
37
+ - change(listing): provide ui container fallback if no class is passed to default view [David Ichim - [`af9e94d`](https://github.com/eea/volto-eea-design-system/commit/af9e94ded1e301f4c811749badbcc1f59e6d0de5)]
38
+ - change(narrow-view): re-added container class to page-document [David Ichim - [`56b44a6`](https://github.com/eea/volto-eea-design-system/commit/56b44a6e09d45f96c106dc471bb2e1cde58ef10f)]
39
+ - change(container): unset values of page-document on 1200+ browser width [David Ichim - [`dd5bea3`](https://github.com/eea/volto-eea-design-system/commit/dd5bea37d414e2a8689eaf6cc99c7b3a3d4b0e08)]
40
+ - change(container): affect only left and right margin of containers [David Ichim - [`183265b`](https://github.com/eea/volto-eea-design-system/commit/183265b7dd8d20359b6c3956ea05b62df6e70f75)]
41
+ - change(containers): modified class names after layout checks [David Ichim - [`1dc3689`](https://github.com/eea/volto-eea-design-system/commit/1dc3689509001031f0afd30422f517de5316e47a)]
42
+ - change(listing): removed container from default view page-document area [David Ichim - [`69f3d8f`](https://github.com/eea/volto-eea-design-system/commit/69f3d8f422e3cb95e89937929aaef48b5569bcdf)]
43
+ - change(views): rename classes names to width_view and added app extras layout component [David Ichim - [`745b772`](https://github.com/eea/volto-eea-design-system/commit/745b7720839754d1e248795cb1263f8c02f5f3c2)]
44
+ - change(container): add variables for edit and add section of containers [David Ichim - [`f2e2c33`](https://github.com/eea/volto-eea-design-system/commit/f2e2c335dc82c120d15d4c536c400ae742f68fe7)]
45
+ - change(columns): implement narrow, container and wide width classes [David Ichim - [`9696b54`](https://github.com/eea/volto-eea-design-system/commit/9696b5457e50ba3186406a584da16f5248c14439)]
46
+ - change(views): customized DefaultView to pass class into page-document area [David Ichim - [`91123aa`](https://github.com/eea/volto-eea-design-system/commit/91123aad429f4bb086110b4997e43e9809a97581)]
47
+ - change(megamenu): set children to be appended to the right of the menu title [David Ichim - [`b69c23a`](https://github.com/eea/volto-eea-design-system/commit/b69c23a20ef2ded1f0382650ff8e85d1bead6941)]
48
+ - refactor(sidemenu): add is_in_path and is_current attributes for an active example [Antonis Tarantilis - [`a3fe7fd`](https://github.com/eea/volto-eea-design-system/commit/a3fe7fd8da93db0a065d4408ce154c9d8c26b568)]
49
+ - refactor(sidemenu): add third level list and items & update active indication [Antonis Tarantilis - [`e2d87da`](https://github.com/eea/volto-eea-design-system/commit/e2d87da9fddca2b867f3d065a007c0b921587a61)]
50
+ - refactor(megaMenu): update padding variables [Antonis Tarantilis - [`c5f2583`](https://github.com/eea/volto-eea-design-system/commit/c5f25838ba9ec367a58c98c929921ebf09cd8ad8)]
51
+ - refactor(megaMenu): update sub-title paddings [Antonis Tarantilis - [`992f919`](https://github.com/eea/volto-eea-design-system/commit/992f919bb5155c8e6fc169e43adf00dcae41f400)]
52
+ - refactor(megaMenu): style sub-title and nav-description [Antonis Tarantilis - [`b2a48fd`](https://github.com/eea/volto-eea-design-system/commit/b2a48fd3588ffdc75f61f0b8d52284d13edf2d92)]
53
+ - refactor(megaMenu): add nav_title and nav_description attributes [Antonis Tarantilis - [`0d7a568`](https://github.com/eea/volto-eea-design-system/commit/0d7a5686daab2ecec87d78728437d8f994606448)]
54
+ - refactor(megaMenu): mobile - use buttons for menu section titles [Antonis Tarantilis - [`a7b632f`](https://github.com/eea/volto-eea-design-system/commit/a7b632fd29a8ac815d2e590509baa51f1279e659)]
55
+ - refactor(megaMenu): desktop - use buttons for menu section titles and readjust content [Antonis Tarantilis - [`cb9315f`](https://github.com/eea/volto-eea-design-system/commit/cb9315f2b999193b7b64cec27c49fc8dda306899)]
56
+
57
+ #### :house: Internal changes
58
+
59
+ - style: load header/footer overrides [Miu Razvan - [`e5b5e0f`](https://github.com/eea/volto-eea-design-system/commit/e5b5e0fc00c61d81f45c12f119bd2f06a91b1b5c)]
60
+ - style(megaMenu): restore item description color [Antonis Tarantilis - [`8a19bbb`](https://github.com/eea/volto-eea-design-system/commit/8a19bbb4866cdeb31d87b782587c499e621055b7)]
61
+ - style(megaMenu): restore accordion content bottom padding [Antonis Tarantilis - [`8e0c5a7`](https://github.com/eea/volto-eea-design-system/commit/8e0c5a79f06247d353511b412b0122c6f614f5ec)]
62
+
63
+ #### :hammer_and_wrench: Others
64
+
65
+ - Release 1.0.0-alpha.3 [Alin Voinea - [`8fc86a7`](https://github.com/eea/volto-eea-design-system/commit/8fc86a7d0bf4ad06ab339b3066ff56ea61d48878)]
66
+ - code cleanup [David Ichim - [`2cdc3e5`](https://github.com/eea/volto-eea-design-system/commit/2cdc3e590b6d36865f16890c45ce56d32963e1d0)]
67
+ - Add subsite styling [kreafox - [`e79c0ed`](https://github.com/eea/volto-eea-design-system/commit/e79c0ed7931d6287dbeb3bab1e9155b8707481a3)]
68
+ - test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`aaeaa07`](https://github.com/eea/volto-eea-design-system/commit/aaeaa07b27491551daba29bbfdd7cab4a54b6bec)]
69
+ - modified left value of full width classes with toolbars [David Ichim - [`70d82d4`](https://github.com/eea/volto-eea-design-system/commit/70d82d47fbc2c00a3a709de0d5c087c8443a1eae)]
70
+ - WIP settings column grid width when using full size class [David Ichim - [`affc7ac`](https://github.com/eea/volto-eea-design-system/commit/affc7ac99527aa92d5a192d90dc8c9ec46a66404)]
71
+ - fix eslint [Miu Razvan - [`30c52e4`](https://github.com/eea/volto-eea-design-system/commit/30c52e4eb443555ca44c1b35df064e73d52c0a8b)]
72
+ - fix broken variable call for contentBox.variables introduced in previous commit by mistake [David Ichim - [`d249c11`](https://github.com/eea/volto-eea-design-system/commit/d249c1160d19bedb174a2fde3fdab48d9ce297d4)]
73
+ - clean up [Miu Razvan - [`89f3cb3`](https://github.com/eea/volto-eea-design-system/commit/89f3cb33d70a14806a953f0acd1807e94169ee5c)]
74
+ - Feature(container): flexible container size #260 from eea/feature-flexible-container [ichim-david - [`8f84c5b`](https://github.com/eea/volto-eea-design-system/commit/8f84c5b67afe9cbe01b2a44a8f92a9a554e1036a)]
75
+ - removed console log from code [David Ichim - [`fad86ae`](https://github.com/eea/volto-eea-design-system/commit/fad86ae581dd81d0c29fc03d8528e57cadadd3fb)]
76
+ - jslint fix [David Ichim - [`9846159`](https://github.com/eea/volto-eea-design-system/commit/98461593605344d0b6d8cba81f91d1cafc2653cd)]
77
+ - feature(content): added NarrowView useful for modifying the containers from content-area [David Ichim - [`d937df7`](https://github.com/eea/volto-eea-design-system/commit/d937df7c262e8d8cc6e78eebec736e28263fc657)]
7
78
  ### [1.0.0-alpha.2](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.1...1.0.0-alpha.2) - 28 October 2022
8
79
 
9
80
  #### :nail_care: Enhancements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
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",
package/src/index.js CHANGED
@@ -3,6 +3,7 @@ const applyConfig = (config) => {
3
3
  ...(config.settings || {}),
4
4
  navDepth: 3,
5
5
  };
6
+
6
7
  return config;
7
8
  };
8
9
 
@@ -23,6 +23,26 @@ export default {
23
23
  },
24
24
  },
25
25
  },
26
+ containerWidth: {
27
+ control: {
28
+ type: 'inline-radio',
29
+ labels: {
30
+ narrow_width: 'Narrow',
31
+ container_width: 'Default',
32
+ wide_width: 'Wide',
33
+ },
34
+ },
35
+ options: ['narrow_width', 'container_width', 'wide_width'],
36
+ description: 'Container width',
37
+ table: {
38
+ type: {
39
+ summary: 'text',
40
+ },
41
+ defaultValue: {
42
+ summary: 'container_width',
43
+ },
44
+ },
45
+ },
26
46
  content: {
27
47
  description: 'container content',
28
48
  table: {
@@ -54,7 +74,20 @@ const content = (
54
74
  </p>
55
75
  );
56
76
 
57
- const Template = (args) => <Container {...args}></Container>;
77
+ const Template = (args) => {
78
+ const { containerWidth, ...options } = args;
79
+ return (
80
+ <>
81
+ <div id={'main'}>
82
+ <Container
83
+ id={'page-document'}
84
+ {...options}
85
+ className={containerWidth || 'container_width'}
86
+ ></Container>
87
+ </div>
88
+ </>
89
+ );
90
+ };
58
91
 
59
92
  export const Default = Template.bind({});
60
93
  Default.args = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Container, Icon } from 'semantic-ui-react';
2
+ import { Container } from 'semantic-ui-react';
3
3
 
4
4
  const sidenavItems = [
5
5
  {
@@ -72,10 +72,30 @@ const sidenavItems = [
72
72
  {
73
73
  '@id': 'Articles',
74
74
  description: '',
75
- items: [],
75
+ items: [
76
+ {
77
+ '@id': 'article-1',
78
+ description: '',
79
+ items: [],
80
+ review_state: null,
81
+ title: 'Summer 2022: Living in a state of multiple crises',
82
+ url: '/#',
83
+ is_current: true,
84
+ },
85
+ {
86
+ '@id': 'article-2',
87
+ description: '',
88
+ items: [],
89
+ review_state: null,
90
+ title:
91
+ 'Interview — Prosumers and the energy crisis: citizens contributing to Europe’s energy transition',
92
+ url: '/#',
93
+ },
94
+ ],
76
95
  review_state: null,
77
96
  title: 'Articles',
78
97
  url: '/#',
98
+ is_in_path: true,
79
99
  },
80
100
  {
81
101
  '@id': 'Infographics-overview',
@@ -89,6 +109,7 @@ const sidenavItems = [
89
109
  review_state: null,
90
110
  title: 'Infographics',
91
111
  url: '/#',
112
+ is_in_path: true,
92
113
  },
93
114
  ];
94
115
 
@@ -96,14 +117,19 @@ function Template({ ...args }) {
96
117
  return (
97
118
  <Container>
98
119
  <nav className="context-navigation">
99
- <div className="context-navigation-header">
100
- <Icon className="ri-menu-2-line" /> {args.header}
101
- </div>
120
+ <div className="context-navigation-header">{args.header}</div>
102
121
  <div role="list" className="ui list">
103
122
  {args.sidenavItems &&
104
123
  args.sidenavItems.map((element, index) => {
105
124
  return (
106
- <div role="listitem" className="item level-1">
125
+ <div
126
+ role="listitem"
127
+ className={
128
+ (element.is_current ? 'active ' : '') +
129
+ (element.is_in_path ? 'in_path ' : '') +
130
+ 'item level-1'
131
+ }
132
+ >
107
133
  <div className="content">
108
134
  <a
109
135
  title={element.title}
@@ -116,7 +142,14 @@ function Template({ ...args }) {
116
142
  element.items.map((subelement, index) => {
117
143
  return (
118
144
  <div className="list" role="list">
119
- <div role="listitem" className="item level-2">
145
+ <div
146
+ role="listitem"
147
+ className={
148
+ (subelement.is_current ? 'active ' : '') +
149
+ (subelement.is_in_path ? 'in_path ' : '') +
150
+ 'item level-2'
151
+ }
152
+ >
120
153
  <div className="content">
121
154
  <a
122
155
  title={subelement.title}
@@ -125,6 +158,33 @@ function Template({ ...args }) {
125
158
  >
126
159
  {subelement.title}
127
160
  </a>
161
+ {subelement.items.length > 0 &&
162
+ subelement.items.map(
163
+ (subparelement, index) => {
164
+ return (
165
+ <div className="list" role="list">
166
+ <div
167
+ role="listitem"
168
+ className={
169
+ (subparelement.is_current
170
+ ? 'active '
171
+ : '') + 'item level-3'
172
+ }
173
+ >
174
+ <div className="content">
175
+ <a
176
+ title={subparelement.title}
177
+ className="contenttype-document"
178
+ href={subparelement.url}
179
+ >
180
+ {subparelement.title}
181
+ </a>
182
+ </div>
183
+ </div>
184
+ </div>
185
+ );
186
+ },
187
+ )}
128
188
  </div>
129
189
  </div>
130
190
  </div>
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import React from 'react'; // , { Component }
7
+ import { useHistory } from 'react-router-dom';
7
8
  import cx from 'classnames';
8
9
  import { Container, Image, Menu, Grid, Dropdown } from 'semantic-ui-react'; // Dropdown,
9
10
 
@@ -107,6 +108,7 @@ const Main = ({
107
108
  transparency,
108
109
  inverted,
109
110
  }) => {
111
+ const history = useHistory();
110
112
  const [activeItem, setActiveItem] = React.useState(pathname);
111
113
  const [menuIsActive, setMenuIsActive] = React.useState(false);
112
114
  const [searchIsActive, setSearchIsActive] = React.useState(false);
@@ -169,7 +171,11 @@ const Main = ({
169
171
  const menuOnClick = (e, item) => {
170
172
  if (searchIsActive) setSearchIsActive(false);
171
173
  setActiveItem(item['@id'] || item.url);
172
- setMenuIsActive(true);
174
+ if (item.items.length) {
175
+ setMenuIsActive(true);
176
+ } else {
177
+ history.push(item.url);
178
+ }
173
179
  };
174
180
 
175
181
  // React.useEffect(() => {
@@ -486,13 +486,72 @@ const menuItems = [
486
486
  url: '/#',
487
487
  },
488
488
  {
489
- '@id': 'Data-and-publications',
490
- items: [],
489
+ '@id': 'Analysis-and-data',
490
+ items: [
491
+ {
492
+ '@id': 'Reports',
493
+ nav_description:
494
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
495
+ items: [],
496
+ review_state: null,
497
+ title: 'Briefings',
498
+ nav_title: 'Briefings nav',
499
+ url: '/#',
500
+ },
501
+ {
502
+ '@id': 'Briefings',
503
+ nav_description:
504
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
505
+ items: [],
506
+ review_state: null,
507
+ title: 'Reports',
508
+ nav_title: 'Reports nav',
509
+ url: '/#',
510
+ },
511
+ {
512
+ '@id': 'Indicators',
513
+ nav_description:
514
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
515
+ items: [],
516
+ review_state: null,
517
+ title: 'Indicators',
518
+ nav_title: 'Indicators nav',
519
+ url: '/#',
520
+ },
521
+ {
522
+ '@id': 'Datahub',
523
+ nav_description:
524
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
525
+ items: [],
526
+ review_state: null,
527
+ title: 'Datahub',
528
+ nav_title: 'Datahub nav',
529
+ url: '/#',
530
+ },
531
+ {
532
+ '@id': 'Maps-and-charts',
533
+ nav_description:
534
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
535
+ items: [],
536
+ review_state: null,
537
+ title: 'Maps and charts',
538
+ url: '/#',
539
+ },
540
+ {
541
+ '@id': 'Country-fact-sheets',
542
+ nav_description:
543
+ 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.',
544
+ items: [],
545
+ review_state: null,
546
+ title: 'Country fact sheets',
547
+ nav_title: '',
548
+ url: '/#',
549
+ },
550
+ ],
491
551
  review_state: null,
492
- title: 'Data and publications',
552
+ title: 'Analysis and data',
493
553
  url: '/#',
494
554
  },
495
-
496
555
  {
497
556
  '@id': 'Countries',
498
557
  items: [
@@ -1332,23 +1391,34 @@ const Template = (args) => {
1332
1391
  renderMenuItem={(item, options = {}, props) => {
1333
1392
  const { onClick } = options;
1334
1393
  return (
1335
- <a
1336
- onClick={(e) => {
1337
- const path = item['@id'] || item.url;
1338
- setPathname(path);
1339
- e.preventDefault();
1340
- onClick && onClick(e, item);
1341
- }}
1342
- href={item['@id'] || item.url}
1343
- {...options}
1344
- className={cx(options?.className, {
1345
- active: item['@id'] === pathname,
1346
- })}
1347
- >
1348
- {props?.iconPosition !== 'right' && props?.children}
1349
- <span>{item.title}</span>
1350
- {props?.iconPosition === 'right' && props?.children}
1351
- </a>
1394
+ <>
1395
+ <a
1396
+ onClick={(e) => {
1397
+ const path = item['@id'] || item.url;
1398
+ setPathname(path);
1399
+ e.preventDefault();
1400
+ onClick && onClick(e, item);
1401
+ }}
1402
+ href={item['@id'] || item.url}
1403
+ {...options}
1404
+ className={cx(options?.className, {
1405
+ active: item['@id'] === pathname,
1406
+ })}
1407
+ >
1408
+ {/* nav_title ovverides title */}
1409
+ {item.nav_title && item.nav_title !== '' ? (
1410
+ <span>{item.nav_title}</span>
1411
+ ) : (
1412
+ <span>{item.title}</span>
1413
+ )}
1414
+ {/* Contains a string and an icon for the buttons */}
1415
+ {props?.children}
1416
+ </a>
1417
+ {/* Item description */}
1418
+ {item.nav_description && (
1419
+ <p className="nav-description">{item.nav_description}</p>
1420
+ )}
1421
+ </>
1352
1422
  );
1353
1423
  }}
1354
1424
  renderGlobalMenuItem={(item, options = {}) => {
@@ -1,21 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Transition } from 'semantic-ui-react';
3
- import {
4
- Container,
5
- Divider,
6
- Grid,
7
- List,
8
- Icon,
9
- Accordion,
10
- } from 'semantic-ui-react';
3
+ import { Container, Grid, List, Icon, Accordion } from 'semantic-ui-react';
11
4
 
12
5
  import { cloneDeep } from 'lodash';
13
6
 
14
7
  import { Link } from 'react-router-dom';
15
8
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
16
9
 
17
- import linkArrowsSVG from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Svg/arrow-double-right.svg';
18
-
19
10
  const createColumns = (item, length, renderMenuItem) => {
20
11
  let subArrays = [];
21
12
  let size = length;
@@ -76,10 +67,28 @@ const Topics = ({ menuItem, renderMenuItem }) => (
76
67
  <React.Fragment key={index}>
77
68
  {section.title === 'At a glance' ? (
78
69
  <Grid.Column width={3} id="at-a-glance">
70
+ <div className="mega-menu-title">
71
+ {/* Inverted right labeled button as a category title,
72
+ for topics the button goes inside the grid */}
73
+ {renderMenuItem(
74
+ menuItem,
75
+ { className: 'ui button inverted icon right labeled' },
76
+ {
77
+ iconPosition: 'right',
78
+ children: (
79
+ <>
80
+ {/* Add word overview to titles */}
81
+ <span> overview</span>
82
+ <Icon className={'arrow right icon'} alt={'Title icon'} />
83
+ </>
84
+ ),
85
+ },
86
+ )}
87
+ </div>
79
88
  <Item item={section} key={index} renderMenuItem={renderMenuItem} />
80
89
  </Grid.Column>
81
90
  ) : (
82
- <Grid.Column width={9} key={index}>
91
+ <Grid.Column width={9} key={index} id="topics-right-column">
83
92
  <ItemGrid
84
93
  item={section}
85
94
  columns={4}
@@ -154,7 +163,7 @@ const FirstLevelContent = ({ element, renderMenuItem, pathName }) => {
154
163
  if (!item.items.length) {
155
164
  return (
156
165
  <React.Fragment key={index}>
157
- {renderMenuItem(item, { className: 'item' })}
166
+ {renderMenuItem(item, { className: 'item sub-title' })}
158
167
  </React.Fragment>
159
168
  );
160
169
  }
@@ -267,10 +276,25 @@ const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
267
276
  </Accordion.Title>
268
277
  );
269
278
  let overview = cloneDeep(element);
270
- overview.title = 'See all';
271
279
  x.content = (
272
280
  <Accordion.Content key={index}>
273
- {renderMenuItem(overview, { className: 'item' })}
281
+ <div className="mega-menu-title">
282
+ {/* Inverted right labeled button as a category title - Mobile */}
283
+ {renderMenuItem(
284
+ overview,
285
+ { className: 'ui button inverted icon right labeled' },
286
+ {
287
+ iconPosition: 'right',
288
+ children: (
289
+ <>
290
+ {/* Add word overview to titles */}
291
+ <span> overview</span>
292
+ <Icon className={'arrow right icon'} alt={'Title icon'} />
293
+ </>
294
+ ),
295
+ },
296
+ )}
297
+ </div>
274
298
  <FirstLevelContent
275
299
  element={element}
276
300
  renderMenuItem={renderMenuItem}
@@ -306,23 +330,29 @@ function HeaderMenuPopUp({
306
330
  <Container>
307
331
  {menuItem && (
308
332
  <div className="menu-content tablet hidden mobile hidden">
309
- <h3 className="title">
310
- {renderMenuItem(
311
- menuItem,
312
- { className: 'title-link' },
313
- {
314
- iconPosition: 'right',
315
- children: (
316
- <img
317
- src={linkArrowsSVG}
318
- className={'title-img'}
319
- alt={'Title icon'}
320
- />
321
- ),
322
- },
323
- )}
324
- </h3>
325
- <Divider fitted />
333
+ {/* Inverted right labeled button as a category title,
334
+ for topics the button goes inside the grid */}
335
+ {menuItem.title !== 'Topics' && (
336
+ <div className="mega-menu-title">
337
+ {renderMenuItem(
338
+ menuItem,
339
+ { className: 'ui button inverted icon right labeled' },
340
+ {
341
+ iconPosition: 'right',
342
+ children: (
343
+ <>
344
+ {/* Add word overview to titles */}
345
+ <span> overview</span>
346
+ <Icon
347
+ className={'arrow right icon'}
348
+ alt={'Title icon'}
349
+ />
350
+ </>
351
+ ),
352
+ },
353
+ )}
354
+ </div>
355
+ )}
326
356
  {menuItem.title === 'Topics' ? (
327
357
  <Topics menuItem={menuItem} renderMenuItem={renderMenuItem} />
328
358
  ) : menuItem.title === 'Countries' ? (