@eeacms/volto-eea-design-system 1.14.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 +67 -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 +2 -2
- package/src/helpers/eventHandlers.js +6 -0
- package/src/helpers/index.js +1 -0
- package/src/ui/Accordion/Accordion.stories.js +70 -25
- package/src/ui/Banner/Banner.jsx +9 -2
- package/src/ui/Card/Card.stories.jsx +57 -32
- 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/Header/HeaderSearchPopUp.js +9 -11
- package/src/ui/Popup/Popup.jsx +84 -95
- package/src/ui/Popup/Popup.stories.jsx +2 -2
- package/src/ui/Statistic/Statistic.stories.js +122 -104
- package/theme/plugins.js +182 -0
- package/theme/themes/eea/elements/input.overrides +20 -7
- 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/main.overrides +6 -0
- 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 +16 -2
- package/theme/themes/eea/views/card.variables +1 -0
- package/.i18n.babel.config.js +0 -1
- /package/src/ui/Hero/{Hero.stories.jsx → Hero.st.jsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,73 @@ 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)]
|
|
48
|
+
### [1.15.0](https://github.com/eea/volto-eea-design-system/compare/1.14.0...1.15.0) - 26 July 2023
|
|
49
|
+
|
|
50
|
+
#### :rocket: New Features
|
|
51
|
+
|
|
52
|
+
- feat(carousel): added story example on how to customize the dots to contain accessibility labels [David Ichim - [`fe5eb46`](https://github.com/eea/volto-eea-design-system/commit/fe5eb46dc94abfeaaa2c79022e507b452b4bb36a)]
|
|
53
|
+
|
|
54
|
+
#### :bug: Bug Fixes
|
|
55
|
+
|
|
56
|
+
- fix(storybook): controls that broke after the Hero stories [David Ichim - [`f8e995d`](https://github.com/eea/volto-eea-design-system/commit/f8e995d30e971163677a198846b1314222dbe408)]
|
|
57
|
+
- fix: hover and focused border for block child - refs #255840 [Claudia Ifrim - [`fdd7783`](https://github.com/eea/volto-eea-design-system/commit/fdd7783b0658711674d251cce498900d9add52af)]
|
|
58
|
+
- fix(storybook): popup story react import [David Ichim - [`18888f9`](https://github.com/eea/volto-eea-design-system/commit/18888f95888f1e3c89d9d1814462e1f27e85ea87)]
|
|
59
|
+
- fix(accessibility): of carousel arrows, dots and role of carousel as a carousel region [David Ichim - [`00257fc`](https://github.com/eea/volto-eea-design-system/commit/00257fcfd0cd3b9959f2f3c68f0b2725c2d96f09)]
|
|
60
|
+
|
|
61
|
+
#### :nail_care: Enhancements
|
|
62
|
+
|
|
63
|
+
- change(carousel): set aria current to current dot button to indicate which slide we are on [David Ichim - [`e711ec8`](https://github.com/eea/volto-eea-design-system/commit/e711ec806be8b45b122a56b84717a0c45057cbbe)]
|
|
64
|
+
- refactor: Use EEA countup instead of react-countup - refs #254634 [dobri1408 - [`146d8c2`](https://github.com/eea/volto-eea-design-system/commit/146d8c2d9d7d55530b39261bfabf7cebd9c8ac0b)]
|
|
65
|
+
- change(search): added search icon as button for proper accessibility support [ACCESSIBILITY 2.1.1.1] #360 from eea/refactor-search-input-icon [ichim-david - [`8f932ff`](https://github.com/eea/volto-eea-design-system/commit/8f932ffba42a96f7d6665c593ff3ad22c3b362fc)]
|
|
66
|
+
- change(search): style icon class instead of i.icon [David Ichim - [`f96a590`](https://github.com/eea/volto-eea-design-system/commit/f96a590beb15ca6b577a169773b740b171b5e3c0)]
|
|
67
|
+
- change(header): use a real button for search submit [David Ichim - [`37e491b`](https://github.com/eea/volto-eea-design-system/commit/37e491ba4af37f16a40bf6377d220d984be17656)]
|
|
68
|
+
- change(header): move handling of key press that checks for enter key to a generic function [David Ichim - [`8df5c8a`](https://github.com/eea/volto-eea-design-system/commit/8df5c8a03f0fb0ad462605df283e622f5b6daf3f)]
|
|
69
|
+
- refactor(SearchBox): add key down handler for search icon [Antonis Tarantilis - [`4f46ba5`](https://github.com/eea/volto-eea-design-system/commit/4f46ba5d3c2457a24e705bf7f34e1cfde2e2f79d)]
|
|
70
|
+
|
|
71
|
+
#### :hammer_and_wrench: Others
|
|
72
|
+
|
|
73
|
+
- Release 1.15.0 [Alin Voinea - [`30152fc`](https://github.com/eea/volto-eea-design-system/commit/30152fcdfffa4ec2262ebf78c1c8a885e222e73c)]
|
|
7
74
|
### [1.14.0](https://github.com/eea/volto-eea-design-system/compare/1.13.2...1.14.0) - 24 July 2023
|
|
8
75
|
|
|
9
76
|
#### :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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-eea-design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
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",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"@eeacms/volto-corsproxy"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@eeacms/countup": "*",
|
|
23
24
|
"@eeacms/volto-corsproxy": "*",
|
|
24
25
|
"@fontsource/roboto": "4.5.8",
|
|
25
|
-
"react-countup": "^6.3.0",
|
|
26
26
|
"react-lazy-load-image-component": "1.5.6",
|
|
27
27
|
"react-slick": "^0.28.1",
|
|
28
28
|
"remixicon": "2.5.0",
|
package/src/helpers/index.js
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>
|
|
@@ -394,50 +394,73 @@ FluidGrid.args = {
|
|
|
394
394
|
fluid: true,
|
|
395
395
|
cards: [...cardModels],
|
|
396
396
|
};
|
|
397
|
+
const PrevArrow = (props) => {
|
|
398
|
+
const { onClick } = props;
|
|
397
399
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
+
return (
|
|
401
|
+
<Button
|
|
402
|
+
aria-label="Previous slide"
|
|
403
|
+
className="slider-arrow prev-arrow tablet or lower hidden"
|
|
404
|
+
icon
|
|
405
|
+
onClick={onClick}
|
|
406
|
+
>
|
|
407
|
+
<Icon className="ri-arrow-left-s-line" />
|
|
408
|
+
</Button>
|
|
409
|
+
);
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const NextArrow = (props) => {
|
|
413
|
+
const { onClick } = props;
|
|
400
414
|
|
|
401
415
|
return (
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
}}
|
|
412
|
-
>
|
|
413
|
-
<Icon className="ri-arrow-left-s-line" />
|
|
414
|
-
</Button>
|
|
415
|
-
<Button
|
|
416
|
-
aria-label="Next slide"
|
|
417
|
-
className="slider-arrow next-arrow tablet or lower hidden"
|
|
418
|
-
icon
|
|
419
|
-
onClick={() => {
|
|
420
|
-
if (slider.current) {
|
|
421
|
-
slider.current.slickNext();
|
|
422
|
-
}
|
|
423
|
-
}}
|
|
424
|
-
>
|
|
425
|
-
<Icon className="ri-arrow-right-s-line" />
|
|
426
|
-
</Button>
|
|
427
|
-
</>
|
|
416
|
+
<Button
|
|
417
|
+
aria-label="Next slide"
|
|
418
|
+
className="slider-arrow next-arrow tablet or lower hidden"
|
|
419
|
+
icon
|
|
420
|
+
onClick={onClick}
|
|
421
|
+
>
|
|
422
|
+
<Icon className="ri-arrow-right-s-line" />
|
|
423
|
+
</Button>
|
|
428
424
|
);
|
|
429
425
|
};
|
|
430
426
|
|
|
431
427
|
function CarouselCardsContent(args) {
|
|
432
428
|
const slider = React.useRef(null);
|
|
429
|
+
const dots_parent = React.useRef(null);
|
|
430
|
+
const settings = {
|
|
431
|
+
...args.settings,
|
|
432
|
+
customPaging: (i) => (
|
|
433
|
+
<button className={'slider-dots-button'} aria-current={i === 0}>
|
|
434
|
+
<span className="slick-dot-icon" aria-hidden="true" />
|
|
435
|
+
<span className="slick-sr-only">Go to slide {i + 1}</span>
|
|
436
|
+
</button>
|
|
437
|
+
),
|
|
438
|
+
appendDots: (dots) => (
|
|
439
|
+
<ul ref={dots_parent} className={'slick-dots'}>
|
|
440
|
+
{dots}
|
|
441
|
+
</ul>
|
|
442
|
+
),
|
|
443
|
+
afterChange: (currentSlide) => {
|
|
444
|
+
const dots = dots_parent.current;
|
|
445
|
+
if (dots) {
|
|
446
|
+
dots
|
|
447
|
+
.querySelectorAll('.slider-dots-button')
|
|
448
|
+
.forEach(function (el, idx) {
|
|
449
|
+
el.setAttribute(
|
|
450
|
+
'aria-current',
|
|
451
|
+
el.parentElement.className === 'slick-active',
|
|
452
|
+
);
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
};
|
|
433
457
|
return (
|
|
434
|
-
<div className="cards-carousel">
|
|
435
|
-
<Slider {...
|
|
458
|
+
<div className="cards-carousel" role={'region'} aria-label={'carousel'}>
|
|
459
|
+
<Slider {...settings} ref={slider}>
|
|
436
460
|
{args.cards.slice(0, args.numberOfCards).map((card, index) => (
|
|
437
461
|
<CardTemplate {...args} card={card} key={index} />
|
|
438
462
|
))}
|
|
439
463
|
</Slider>
|
|
440
|
-
<Arrows slider={slider} />
|
|
441
464
|
</div>
|
|
442
465
|
);
|
|
443
466
|
}
|
|
@@ -464,7 +487,9 @@ CarouselCards.args = {
|
|
|
464
487
|
infinite: true,
|
|
465
488
|
slidesToShow: 4,
|
|
466
489
|
slidesToScroll: 1,
|
|
467
|
-
arrows:
|
|
490
|
+
arrows: true,
|
|
491
|
+
nextArrow: <NextArrow />,
|
|
492
|
+
prevArrow: <PrevArrow />,
|
|
468
493
|
responsive: [
|
|
469
494
|
{
|
|
470
495
|
breakpoint: tabletBreakpoint,
|
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]}
|