@eeacms/volto-eea-design-system 1.15.0 → 1.16.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/CHANGELOG.md +41 -0
- package/DEVELOP.md +56 -0
- package/README.md +18 -0
- package/docker-compose.yml +28 -0
- package/locales/de/LC_MESSAGES/volto.po +14 -0
- package/locales/it/LC_MESSAGES/volto.po +14 -0
- package/locales/ro/LC_MESSAGES/volto.po +14 -0
- package/locales/volto.pot +16 -0
- package/package.json +1 -1
- package/src/ui/Accordion/Accordion.stories.js +70 -25
- package/src/ui/Banner/Banner.jsx +9 -2
- package/src/ui/Card/Card.stories.jsx +4 -1
- package/src/ui/Header/Header.jsx +4 -0
- package/src/ui/Header/Header.stories.js +26 -4
- package/src/ui/Header/HeaderMenuPopUp.js +116 -103
- package/src/ui/Popup/Popup.jsx +84 -95
- package/src/ui/Popup/Popup.stories.jsx +1 -1
- package/theme/plugins.js +182 -0
- package/theme/themes/eea/elements/input.overrides +1 -1
- package/theme/themes/eea/extras/banner.less +0 -1
- package/theme/themes/eea/extras/custom.overrides +5 -0
- package/theme/themes/eea/extras/header.less +3 -22
- package/theme/themes/eea/extras/header.variables +1 -1
- package/theme/themes/eea/extras/tagList.less +1 -1
- package/theme/themes/eea/extras/tagList.variables +1 -1
- package/theme/themes/eea/globals/site.variables +3 -3
- package/theme/themes/eea/globals/utilities.less +9 -0
- package/theme/themes/eea/modules/accordion.overrides +44 -42
- package/theme/themes/eea/modules/accordion.variables +4 -4
- package/theme/themes/eea/modules/popup.overrides +4 -0
- package/theme/themes/eea/views/card.overrides +5 -1
- package/theme/themes/eea/views/card.variables +1 -0
- package/.i18n.babel.config.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@ 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.16.0](https://github.com/eea/volto-eea-design-system/compare/1.15.0...1.16.0) - 17 August 2023
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat(banner): allow Banner.Action to be a link #254325 #378 from eea/banner_link [ichim-david - [`144f71f`](https://github.com/eea/volto-eea-design-system/commit/144f71fdbf24aec8c35ae7cbb93cd719271a4413)]
|
|
12
|
+
- feat(accordion): eea design filtering support and theme refactoring #379 from eea/accordion-filter [ichim-david - [`7e82454`](https://github.com/eea/volto-eea-design-system/commit/7e82454490777a42bc032646483fee59e7236df4)]
|
|
13
|
+
|
|
14
|
+
#### :bug: Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix: use quanta-toolbar class as trigger #256275 [andreiggr - [`5ede47d`](https://github.com/eea/volto-eea-design-system/commit/5ede47dcc2bd9211ee963c7e881f9ee5663d9d1a)]
|
|
17
|
+
- fix: ensure rule only on quanta-toolbar #256275 [andreiggr - [`4b3e0a4`](https://github.com/eea/volto-eea-design-system/commit/4b3e0a4b6414aac5a9c21686043bc293a194afbd)]
|
|
18
|
+
- fix: teaserGrid controls move only on quanta-toolbar #256275 [andreiggr - [`90c9736`](https://github.com/eea/volto-eea-design-system/commit/90c973679e189587ed3d9afeb5e6a0eb84fa5852)]
|
|
19
|
+
- fix(popup): handle click outside popup area to close the popup [David Ichim - [`a6da52d`](https://github.com/eea/volto-eea-design-system/commit/a6da52d8e03f28fa851b841397e0f896223144b8)]
|
|
20
|
+
- fix(popup): ref error and make sure that all .popup-container .popup get their position fixed [David Ichim - [`4435c1f`](https://github.com/eea/volto-eea-design-system/commit/4435c1fd10f81c9366955567fc1bc6a2c5364ba7)]
|
|
21
|
+
- fix(carousel): lower opacity of arrows when we don't use infinite option [David Ichim - [`b8964c0`](https://github.com/eea/volto-eea-design-system/commit/b8964c0b5637da266c42e3785cfdf3f38babcdae)]
|
|
22
|
+
|
|
23
|
+
#### :nail_care: Enhancements
|
|
24
|
+
|
|
25
|
+
- change(accordion): use real icons for active and inactive panel icons #380 from eea/accordion-filtering [ichim-david - [`bb9e20c`](https://github.com/eea/volto-eea-design-system/commit/bb9e20ca9b68890852baae4f7a06c35db6136286)]
|
|
26
|
+
- change(accordion): simplify change of icon for filter icons [David Ichim - [`a1cb797`](https://github.com/eea/volto-eea-design-system/commit/a1cb797929ddda6513dcc7027f32ebad6992ee14)]
|
|
27
|
+
- change(accordion): make use of css variables for text and background colors [David Ichim - [`a6cddd5`](https://github.com/eea/volto-eea-design-system/commit/a6cddd542abb3d1aba3e985107410a60b697744e)]
|
|
28
|
+
- change(site): use css variable values for inputs for easier customization [David Ichim - [`7a085e2`](https://github.com/eea/volto-eea-design-system/commit/7a085e26496420a503ba5c21b3791e66af96c96c)]
|
|
29
|
+
- change(accordion): use the right selector for accordion panels hovering [dana-cfc4 - [`3b041b2`](https://github.com/eea/volto-eea-design-system/commit/3b041b29a4c871a50844f1054c7c39d3a468a7ae)]
|
|
30
|
+
- change(accordion): use a css variable for icon active and inactive [David Ichim - [`a11bf76`](https://github.com/eea/volto-eea-design-system/commit/a11bf76c8ba5d3f58f330a75e673a0eed7c10c7e)]
|
|
31
|
+
- change(popup): use a functional component for popup component using react-popper [David Ichim - [`3fe2629`](https://github.com/eea/volto-eea-design-system/commit/3fe26294162966d3815d74384f5e53071ad80b26)]
|
|
32
|
+
- change(carousel): modified setting of current dot based on parent li slick-active class [David Ichim - [`4ac957e`](https://github.com/eea/volto-eea-design-system/commit/4ac957ed7fcba588f56ba65f9405ad4e39b568b7)]
|
|
33
|
+
|
|
34
|
+
#### :house: Internal changes
|
|
35
|
+
|
|
36
|
+
- chore(accordion): Improve accordion filter styling -refs#254324 [dana-cfc4 - [`d3ca98e`](https://github.com/eea/volto-eea-design-system/commit/d3ca98e494a4e0a68880dd87ed0f90967c431d50)]
|
|
37
|
+
- chore: Add filter to accordion story -refs #254324 [dana-cfc4 - [`fdc906a`](https://github.com/eea/volto-eea-design-system/commit/fdc906a2e065e250bda198311e4e3b20b0880169)]
|
|
38
|
+
|
|
39
|
+
#### :house: Documentation changes
|
|
40
|
+
|
|
41
|
+
- docs: add links to docusaurus and storybook - refs #253277 [ana-oprea - [`9f7ba84`](https://github.com/eea/volto-eea-design-system/commit/9f7ba848d2e54ea7cd9d9eb92a0171274077e307)]
|
|
42
|
+
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`df303a5`](https://github.com/eea/volto-eea-design-system/commit/df303a56e90581d6ed554e839343a359727bb166)]
|
|
43
|
+
|
|
44
|
+
#### :hammer_and_wrench: Others
|
|
45
|
+
|
|
46
|
+
- bump package release version [David Ichim - [`fff4264`](https://github.com/eea/volto-eea-design-system/commit/fff4264d5a91fbf2fc5fe52fb2cc530c77ea43b1)]
|
|
47
|
+
- Refs #254325; allow setting a Banner.Action to be a link [Tiberiu Ichim - [`18b00bf`](https://github.com/eea/volto-eea-design-system/commit/18b00bf355d8180d7ed4f43810e95fb6cef0e95c)]
|
|
7
48
|
### [1.15.0](https://github.com/eea/volto-eea-design-system/compare/1.14.0...1.15.0) - 26 July 2023
|
|
8
49
|
|
|
9
50
|
#### :rocket: New Features
|
package/DEVELOP.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## Develop
|
|
4
4
|
|
|
5
|
+
1. Make sure you have `docker` and `docker compose` installed and running on your machine:
|
|
6
|
+
|
|
7
|
+
```Bash
|
|
8
|
+
git clone https://github.com/eea/volto-eea-design-system.git
|
|
9
|
+
cd volto-eea-design-system
|
|
10
|
+
git checkout -b bugfix-123456 develop
|
|
11
|
+
make
|
|
12
|
+
make start
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
1. Wait for `Volto started at 0.0.0.0:3000` meesage
|
|
16
|
+
|
|
17
|
+
1. Go to http://localhost:3000
|
|
18
|
+
|
|
19
|
+
1. Happy hacking!
|
|
20
|
+
|
|
21
|
+
```Bash
|
|
22
|
+
cd src/addons/volto-eea-design-system/
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Or add @eeacms/volto-eea-design-system to your Volto project
|
|
26
|
+
|
|
5
27
|
Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
|
|
6
28
|
|
|
7
29
|
1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
|
|
@@ -49,3 +71,37 @@ Before starting make sure your development environment is properly set. See [Vol
|
|
|
49
71
|
1. Happy hacking!
|
|
50
72
|
|
|
51
73
|
cd src/addons/volto-eea-design-system/
|
|
74
|
+
|
|
75
|
+
## Cypress
|
|
76
|
+
|
|
77
|
+
To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
|
|
78
|
+
|
|
79
|
+
You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
|
|
80
|
+
project where you added `volto-eea-design-system` to `mrs.developer.json`
|
|
81
|
+
|
|
82
|
+
Go to:
|
|
83
|
+
|
|
84
|
+
```BASH
|
|
85
|
+
cd src/addons/volto-eea-design-system/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Start:
|
|
89
|
+
|
|
90
|
+
```Bash
|
|
91
|
+
make
|
|
92
|
+
make start
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-eea-design-system` block installed.
|
|
96
|
+
|
|
97
|
+
Open Cypress Interface:
|
|
98
|
+
|
|
99
|
+
```Bash
|
|
100
|
+
make cypress-open
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Or run it:
|
|
104
|
+
|
|
105
|
+
```Bash
|
|
106
|
+
make cypress-run
|
|
107
|
+
```
|
package/README.md
CHANGED
|
@@ -27,10 +27,23 @@ This package provides the following features:
|
|
|
27
27
|
|
|
28
28
|
## Getting started
|
|
29
29
|
|
|
30
|
+
### Try volto-eea-design-system with Docker
|
|
31
|
+
|
|
32
|
+
git clone https://github.com/eea/volto-eea-design-system.git
|
|
33
|
+
cd volto-eea-design-system
|
|
34
|
+
make
|
|
35
|
+
make start
|
|
36
|
+
|
|
37
|
+
Go to http://localhost:3000
|
|
38
|
+
|
|
30
39
|
### Add volto-eea-design-system to your Volto project
|
|
31
40
|
|
|
32
41
|
1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
|
|
33
42
|
|
|
43
|
+
```Bash
|
|
44
|
+
docker compose up backend
|
|
45
|
+
```
|
|
46
|
+
|
|
34
47
|
1. Start Volto frontend
|
|
35
48
|
|
|
36
49
|
- If you already have a volto project, just update `package.json`:
|
|
@@ -76,6 +89,11 @@ Checkout the docs found within the [mockups](https://github.com/eea/volto-eea-de
|
|
|
76
89
|
|
|
77
90
|
See [RELEASE.md](https://github.com/eea/volto-eea-design-system/blob/master/RELEASE.md).
|
|
78
91
|
|
|
92
|
+
## Docusaurus and Storybook
|
|
93
|
+
|
|
94
|
+
See [Docusaurus](https://eea.github.io/).
|
|
95
|
+
See [Storybook](https://eea.github.io/eea-storybook/).
|
|
96
|
+
|
|
79
97
|
## How to contribute
|
|
80
98
|
|
|
81
99
|
See [DEVELOP.md](https://github.com/eea/volto-eea-design-system/blob/develop/DEVELOP.md).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: "3"
|
|
2
|
+
services:
|
|
3
|
+
backend:
|
|
4
|
+
image: plone/plone-backend:${PLONE_VERSION:-6}
|
|
5
|
+
ports:
|
|
6
|
+
- "8080:8080"
|
|
7
|
+
environment:
|
|
8
|
+
SITE: "Plone"
|
|
9
|
+
|
|
10
|
+
frontend:
|
|
11
|
+
build:
|
|
12
|
+
context: ./
|
|
13
|
+
dockerfile: ./Dockerfile
|
|
14
|
+
args:
|
|
15
|
+
ADDON_NAME: "${ADDON_NAME}"
|
|
16
|
+
ADDON_PATH: "${ADDON_PATH}"
|
|
17
|
+
VOLTO_VERSION: ${VOLTO_VERSION:-16}
|
|
18
|
+
ports:
|
|
19
|
+
- "3000:3000"
|
|
20
|
+
- "3001:3001"
|
|
21
|
+
depends_on:
|
|
22
|
+
- backend
|
|
23
|
+
volumes:
|
|
24
|
+
- ./:/app/src/addons/${ADDON_PATH}
|
|
25
|
+
environment:
|
|
26
|
+
RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
|
|
27
|
+
RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
|
|
28
|
+
HOST: "0.0.0.0"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: \n"
|
|
4
|
+
"Report-Msgid-Bugs-To: \n"
|
|
5
|
+
"POT-Creation-Date: \n"
|
|
6
|
+
"PO-Revision-Date: \n"
|
|
7
|
+
"Last-Translator: \n"
|
|
8
|
+
"Language: \n"
|
|
9
|
+
"Language-Team: \n"
|
|
10
|
+
"Content-Type: \n"
|
|
11
|
+
"Content-Transfer-Encoding: \n"
|
|
12
|
+
"Plural-Forms: \n"
|
|
13
|
+
|
|
14
|
+
|
package/locales/volto.pot
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
msgid ""
|
|
2
|
+
msgstr ""
|
|
3
|
+
"Project-Id-Version: Plone\n"
|
|
4
|
+
"POT-Creation-Date: 2023-06-28T10:48:22.678Z\n"
|
|
5
|
+
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
|
+
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
|
+
"MIME-Version: 1.0\n"
|
|
8
|
+
"Content-Type: text/plain; charset=utf-8\n"
|
|
9
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
10
|
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
11
|
+
"Language-Code: en\n"
|
|
12
|
+
"Language-Name: English\n"
|
|
13
|
+
"Preferred-Encodings: utf-8\n"
|
|
14
|
+
"Domain: volto\n"
|
|
15
|
+
|
|
16
|
+
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Accordion, Icon, Container } from 'semantic-ui-react';
|
|
2
|
+
import { Accordion, Icon, Container, Input } from 'semantic-ui-react';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/Accordion',
|
|
@@ -30,11 +30,20 @@ export default {
|
|
|
30
30
|
type: { summary: 'string' },
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
+
enable_filtering: {
|
|
34
|
+
name: 'Enable filtering',
|
|
35
|
+
defaultValue: false,
|
|
36
|
+
table: {
|
|
37
|
+
defaultValue: { summary: false },
|
|
38
|
+
type: { summary: 'boolean' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
33
41
|
},
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
function AccordionContainer({ ...args }) {
|
|
37
45
|
const [activeIndex, setActiveIndex] = useState([0]);
|
|
46
|
+
const [filterValue, setFilterValue] = useState('');
|
|
38
47
|
|
|
39
48
|
const handleClick = (e, titleProps) => {
|
|
40
49
|
const { index } = titleProps;
|
|
@@ -43,33 +52,68 @@ function AccordionContainer({ ...args }) {
|
|
|
43
52
|
setActiveIndex(newIndex);
|
|
44
53
|
};
|
|
45
54
|
|
|
55
|
+
const handleFilteredValueChange = (value) => {
|
|
56
|
+
setFilterValue(value);
|
|
57
|
+
};
|
|
58
|
+
|
|
46
59
|
return (
|
|
47
60
|
<Container>
|
|
48
61
|
<div className="accordion-block">
|
|
49
|
-
{args.
|
|
50
|
-
|
|
51
|
-
<Accordion className={
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
{args.enable_filtering && (
|
|
63
|
+
<Accordion className={args.variant}>
|
|
64
|
+
<Accordion.Title className={'filter'}>
|
|
65
|
+
<Input
|
|
66
|
+
fluid
|
|
67
|
+
className="input-accordion-title"
|
|
68
|
+
transparent
|
|
69
|
+
placeholder="Type to filter..."
|
|
70
|
+
value={filterValue}
|
|
71
|
+
onChange={(e) => handleFilteredValueChange(e.target.value)}
|
|
72
|
+
/>
|
|
73
|
+
<Icon
|
|
74
|
+
className={filterValue ? 'ri-close-line' : 'ri-filter-3-line'}
|
|
75
|
+
onClick={() => handleFilteredValueChange('')}
|
|
76
|
+
/>
|
|
77
|
+
</Accordion.Title>
|
|
78
|
+
</Accordion>
|
|
79
|
+
)}
|
|
80
|
+
{args.panels
|
|
81
|
+
.filter(
|
|
82
|
+
(panel) =>
|
|
83
|
+
!args.enable_filtering ||
|
|
84
|
+
filterValue === '' ||
|
|
85
|
+
(filterValue !== '' &&
|
|
86
|
+
panel.title?.toLowerCase().includes(filterValue.toLowerCase())),
|
|
87
|
+
)
|
|
88
|
+
.map((panel, index) => {
|
|
89
|
+
const active = activeIndex === index;
|
|
90
|
+
return (
|
|
91
|
+
<Accordion className={args.variant} key={index}>
|
|
92
|
+
<Accordion.Title
|
|
93
|
+
index={index}
|
|
94
|
+
tabIndex={0}
|
|
95
|
+
active={active}
|
|
96
|
+
onClick={handleClick}
|
|
97
|
+
as={args.title_size === 'no value' ? '' : args.title_size}
|
|
98
|
+
onKeyDown={(e) => {
|
|
99
|
+
if (e.nativeEvent.keyCode === 13) {
|
|
100
|
+
handleClick(e, { index });
|
|
101
|
+
}
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<span>{panel.title}</span>
|
|
105
|
+
<Icon
|
|
106
|
+
className={
|
|
107
|
+
active ? 'ri-arrow-down-s-line' : 'ri-arrow-up-s-line'
|
|
108
|
+
}
|
|
109
|
+
/>
|
|
110
|
+
</Accordion.Title>
|
|
111
|
+
<Accordion.Content active={active}>
|
|
112
|
+
{panel.content}
|
|
113
|
+
</Accordion.Content>
|
|
114
|
+
</Accordion>
|
|
115
|
+
);
|
|
116
|
+
})}
|
|
73
117
|
</div>
|
|
74
118
|
</Container>
|
|
75
119
|
);
|
|
@@ -80,6 +124,7 @@ export const Default = Template.bind({});
|
|
|
80
124
|
Default.args = {
|
|
81
125
|
variant: 'secondary',
|
|
82
126
|
title_size: 'no value',
|
|
127
|
+
enable_filtering: false,
|
|
83
128
|
panels: [
|
|
84
129
|
{
|
|
85
130
|
title: 'Water and marine environment',
|
package/src/ui/Banner/Banner.jsx
CHANGED
|
@@ -67,12 +67,19 @@ function Banner({ image, metadata, properties, children, ...rest }) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
Banner.Action = React.forwardRef(function (
|
|
70
|
-
{ id, title, titleClass, icon, onClick, className, color },
|
|
70
|
+
{ id, title, titleClass, icon, onClick, className, color, ...rest },
|
|
71
71
|
ref,
|
|
72
72
|
) {
|
|
73
73
|
return (
|
|
74
74
|
<div className="action" ref={ref}>
|
|
75
|
-
<Button
|
|
75
|
+
<Button
|
|
76
|
+
className={className}
|
|
77
|
+
basic
|
|
78
|
+
icon
|
|
79
|
+
inverted
|
|
80
|
+
onClick={onClick}
|
|
81
|
+
{...rest}
|
|
82
|
+
>
|
|
76
83
|
<Icon className={icon} color={color}></Icon>
|
|
77
84
|
<span className={titleClass || 'mobile hidden'}>{title}</span>
|
|
78
85
|
</Button>
|
|
@@ -446,7 +446,10 @@ function CarouselCardsContent(args) {
|
|
|
446
446
|
dots
|
|
447
447
|
.querySelectorAll('.slider-dots-button')
|
|
448
448
|
.forEach(function (el, idx) {
|
|
449
|
-
el.setAttribute(
|
|
449
|
+
el.setAttribute(
|
|
450
|
+
'aria-current',
|
|
451
|
+
el.parentElement.className === 'slick-active',
|
|
452
|
+
);
|
|
450
453
|
});
|
|
451
454
|
}
|
|
452
455
|
},
|
package/src/ui/Header/Header.jsx
CHANGED
|
@@ -17,6 +17,7 @@ import HeaderMenuPopUp from './HeaderMenuPopUp';
|
|
|
17
17
|
import PropTypes from 'prop-types';
|
|
18
18
|
|
|
19
19
|
import { isInternalURL } from '@plone/volto/helpers';
|
|
20
|
+
import config from '@plone/volto/registry';
|
|
20
21
|
|
|
21
22
|
Header.propTypes = {
|
|
22
23
|
transparency: PropTypes.bool,
|
|
@@ -143,6 +144,7 @@ const TopDropdownMenu = ({
|
|
|
143
144
|
const Main = ({
|
|
144
145
|
logo,
|
|
145
146
|
menuItems,
|
|
147
|
+
menuItemsLayouts,
|
|
146
148
|
renderMenuItem,
|
|
147
149
|
renderGlobalMenuItem,
|
|
148
150
|
headerSearchBox,
|
|
@@ -159,6 +161,7 @@ const Main = ({
|
|
|
159
161
|
const [burger, setBurger] = React.useState('');
|
|
160
162
|
const searchInputRef = React.useRef(null);
|
|
161
163
|
const [isClient, setIsClient] = React.useState();
|
|
164
|
+
const itemsLayouts = menuItemsLayouts || config.settings?.menuItemsLayouts;
|
|
162
165
|
|
|
163
166
|
React.useEffect(() => setIsClient(true), []);
|
|
164
167
|
|
|
@@ -357,6 +360,7 @@ const Main = ({
|
|
|
357
360
|
renderMenuItem={renderMenuItem}
|
|
358
361
|
activeItem={activeItem}
|
|
359
362
|
menuItems={menuItems}
|
|
363
|
+
menuItemsLayouts={itemsLayouts}
|
|
360
364
|
pathName={pathname}
|
|
361
365
|
onClose={menuOnClickOutside}
|
|
362
366
|
triggerRefs={[mobileMenuBurgerRef, desktopMenuRef]}
|
|
@@ -12,6 +12,7 @@ import cx from 'classnames';
|
|
|
12
12
|
export default {
|
|
13
13
|
title: 'Layout/Header',
|
|
14
14
|
component: Header,
|
|
15
|
+
excludeStories: /menuItems$/,
|
|
15
16
|
argTypes: {
|
|
16
17
|
links: {
|
|
17
18
|
table: {
|
|
@@ -98,7 +99,7 @@ const languages = [
|
|
|
98
99
|
{ name: 'Türkçe', code: 'tr' },
|
|
99
100
|
];
|
|
100
101
|
|
|
101
|
-
const menuItems = [
|
|
102
|
+
export const menuItems = [
|
|
102
103
|
{
|
|
103
104
|
'@id': 'Topics',
|
|
104
105
|
items: [
|
|
@@ -483,7 +484,7 @@ const menuItems = [
|
|
|
483
484
|
],
|
|
484
485
|
review_state: null,
|
|
485
486
|
title: 'Topics',
|
|
486
|
-
url: '
|
|
487
|
+
url: '/en/topics',
|
|
487
488
|
},
|
|
488
489
|
{
|
|
489
490
|
'@id': 'Analysis-and-data',
|
|
@@ -887,7 +888,7 @@ const menuItems = [
|
|
|
887
888
|
],
|
|
888
889
|
review_state: null,
|
|
889
890
|
title: 'Countries',
|
|
890
|
-
url: '
|
|
891
|
+
url: '/en/countries',
|
|
891
892
|
},
|
|
892
893
|
{
|
|
893
894
|
'@id': 'Newsroom',
|
|
@@ -1143,7 +1144,7 @@ const menuItems = [
|
|
|
1143
1144
|
],
|
|
1144
1145
|
review_state: null,
|
|
1145
1146
|
title: 'About Us',
|
|
1146
|
-
url: '
|
|
1147
|
+
url: '/en/about',
|
|
1147
1148
|
},
|
|
1148
1149
|
];
|
|
1149
1150
|
|
|
@@ -1179,6 +1180,26 @@ const debounce = (func) => {
|
|
|
1179
1180
|
};
|
|
1180
1181
|
};
|
|
1181
1182
|
|
|
1183
|
+
const menuItemsLayouts = {
|
|
1184
|
+
'/en/topics': {
|
|
1185
|
+
menuItemChildrenListColumns: [1, 4],
|
|
1186
|
+
menuItemColumns: [
|
|
1187
|
+
'at-a-glance three wide column',
|
|
1188
|
+
'topics-right-column nine wide column',
|
|
1189
|
+
],
|
|
1190
|
+
hideChildrenFromNavigation: false,
|
|
1191
|
+
},
|
|
1192
|
+
'/en/countries': {
|
|
1193
|
+
menuItemColumns: ['eight wide column', 'four wide column'],
|
|
1194
|
+
menuItemChildrenListColumns: [5, 2],
|
|
1195
|
+
appendExtraMenuItemsToLastColumn: true,
|
|
1196
|
+
hideChildrenFromNavigation: false,
|
|
1197
|
+
},
|
|
1198
|
+
'/en/about': {
|
|
1199
|
+
hideChildrenFromNavigation: false,
|
|
1200
|
+
},
|
|
1201
|
+
};
|
|
1202
|
+
|
|
1182
1203
|
const handleDropdownClick = (event) => {
|
|
1183
1204
|
event.stopPropagation();
|
|
1184
1205
|
};
|
|
@@ -1320,6 +1341,7 @@ const Template = (args) => {
|
|
|
1320
1341
|
pathname={pathname}
|
|
1321
1342
|
logo={<Logo {...logoProps} inverted={args.inverted} />}
|
|
1322
1343
|
menuItems={menuItems}
|
|
1344
|
+
menuItemsLayouts={menuItemsLayouts}
|
|
1323
1345
|
headerSearchBox={headerSearchBox}
|
|
1324
1346
|
renderMenuItem={(item, options = {}, props) => {
|
|
1325
1347
|
const { onClick } = options;
|