@eeacms/volto-eea-design-system 0.4.5 → 0.5.2
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 +113 -0
- package/package.json +1 -1
- package/src/semantic.less +8 -0
- package/src/ui/ContentBox/ContentBox.jsx +12 -0
- package/src/ui/Header/Header.jsx +64 -34
- package/src/ui/Header/HeaderMenuPopUp.js +215 -54
- package/src/ui/Header/HeaderSearchPopUp.js +4 -4
- package/src/ui/Hero/Hero.jsx +55 -0
- package/src/ui/Hero/Hero.stories.jsx +205 -0
- package/src/ui/Logo/Logo.jsx +2 -3
- package/src/ui/index.js +2 -0
- package/theme/themes/eea/assets/images/forest.png +0 -0
- package/theme/themes/eea/definitions/views/item.less +13 -6
- package/theme/themes/eea/elements/container.overrides +5 -4
- package/theme/themes/eea/elements/image.overrides +39 -0
- package/theme/themes/eea/elements/input.overrides +21 -8
- package/theme/themes/eea/extras/contentBox.less +41 -0
- package/theme/themes/eea/extras/contentBox.variables +19 -0
- package/theme/themes/eea/extras/custom.overrides +4 -0
- package/theme/themes/eea/extras/header.less +479 -511
- package/theme/themes/eea/extras/header.variables +109 -81
- package/theme/themes/eea/extras/hero.less +70 -0
- package/theme/themes/eea/extras/hero.variables +24 -0
- package/theme/themes/eea/globals/site.overrides +9 -16
- package/theme/themes/eea/globals/site.variables +8 -0
- package/theme/themes/eea/globals/utilities.less +13 -2
- package/theme/themes/eea/tokens/colors.less +1 -1
- package/theme/themes/eea/views/item.overrides +18 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,121 @@ 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
|
+
#### [0.5.2](https://github.com/eea/volto-eea-design-system/compare/0.5.1...0.5.2)
|
|
8
|
+
|
|
9
|
+
- [R3] Content box [`#125`](https://github.com/eea/volto-eea-design-system/pull/125)
|
|
10
|
+
- Autobuild of docusaurus docs [`31bc68c`](https://github.com/eea/volto-eea-design-system/commit/31bc68cbfe7ba8b7fc5d02358e777f394e60c48d)
|
|
11
|
+
- feat(ContentBox): Update storybook with available themes [`93b26b2`](https://github.com/eea/volto-eea-design-system/commit/93b26b2f5f1d627aa8049df61257499e4798dd79)
|
|
12
|
+
- feat(ContentBox): Add primary, secondary, tertiary themes [`87cb2fe`](https://github.com/eea/volto-eea-design-system/commit/87cb2fe7e4cd5c2872299756f493e371abcbb05f)
|
|
13
|
+
- Cleanup [`2b128df`](https://github.com/eea/volto-eea-design-system/commit/2b128dface95b560588a343f1ddf7bbaf3efb320)
|
|
14
|
+
- perf(eol): change to lf [`78b2955`](https://github.com/eea/volto-eea-design-system/commit/78b2955ff73d9436134d1a6399040b2d7c7f5714)
|
|
15
|
+
- refactor(contentBox): restructure the component to be more flexible [`f0d2de6`](https://github.com/eea/volto-eea-design-system/commit/f0d2de67e43fafa10052871f99ac841c83cf8157)
|
|
16
|
+
- chore(contentBox) : add lint changes [`5aaf740`](https://github.com/eea/volto-eea-design-system/commit/5aaf740594f0001b1672bb6dc18d973f55c881f0)
|
|
17
|
+
- feat(contentBox) : add new Content Box component [`2ebbb47`](https://github.com/eea/volto-eea-design-system/commit/2ebbb47fe685f9809aa3572263be376d9688371e)
|
|
18
|
+
|
|
19
|
+
#### [0.5.1](https://github.com/eea/volto-eea-design-system/compare/0.5.0...0.5.1)
|
|
20
|
+
|
|
21
|
+
> 13 June 2022
|
|
22
|
+
|
|
23
|
+
- change(header): hero integration fixes [`#193`](https://github.com/eea/volto-eea-design-system/pull/193)
|
|
24
|
+
- Autobuild of docusaurus docs [`ac5df8e`](https://github.com/eea/volto-eea-design-system/commit/ac5df8edab41d37e118d34c6a4b35a64428643d0)
|
|
25
|
+
- change(hero): added styles for adding dark overlay to hero [`bf1d292`](https://github.com/eea/volto-eea-design-system/commit/bf1d292fecfa8a6b222558f0d93f48e19bf6b8ea)
|
|
26
|
+
- Autobuild of docusaurus docs [`3192671`](https://github.com/eea/volto-eea-design-system/commit/31926711a83da6b7744249fd3c801e87ae6910d5)
|
|
27
|
+
- change(homepage): hide stagingBanner on homepage [`fb6e319`](https://github.com/eea/volto-eea-design-system/commit/fb6e319dd10f4d148cc8f3b33dafc43280a0254f)
|
|
28
|
+
- Autobuild of docusaurus docs [`333b2dc`](https://github.com/eea/volto-eea-design-system/commit/333b2dcf0b01bfb4afab2d9613b7cdbf331c51bb)
|
|
29
|
+
- Cleanup available languages [`0c49051`](https://github.com/eea/volto-eea-design-system/commit/0c490512a6a6524efe9a37b4b61ab0061a240abb)
|
|
30
|
+
- Autobuild of docusaurus docs [`fb5f811`](https://github.com/eea/volto-eea-design-system/commit/fb5f811c4723929892953e4303a6b39b85efb79d)
|
|
31
|
+
- change(header): added min-height for mega menu needed for 1 items menus [`18814f4`](https://github.com/eea/volto-eea-design-system/commit/18814f48fb743c88d05554e9a1773f8d85dec86c)
|
|
32
|
+
- Autobuild of docusaurus docs [`e836973`](https://github.com/eea/volto-eea-design-system/commit/e8369731a74139bbaf432d7506d27185e9240b1f)
|
|
33
|
+
- change(tokens): modified grey-4 color to point to a 10% shade from original color [`b406283`](https://github.com/eea/volto-eea-design-system/commit/b406283e61c7356bec9d453567cd1ccde496880d)
|
|
34
|
+
- Autobuild of docusaurus docs [`d44ccdd`](https://github.com/eea/volto-eea-design-system/commit/d44ccdd9be2edfd341a6d11bbe6105dd852a5599)
|
|
35
|
+
- change(header): use variable for homepage hero-block padding [`89ff344`](https://github.com/eea/volto-eea-design-system/commit/89ff3441f269281ffb3da32cd3e5c64715b3204b)
|
|
36
|
+
- Autobuild of docusaurus docs [`0a18ebd`](https://github.com/eea/volto-eea-design-system/commit/0a18ebda890c7bd24b1d4c5e0a36f977c4ab1153)
|
|
37
|
+
- change(hero): hero section block integration #192 [`4ea2f40`](https://github.com/eea/volto-eea-design-system/commit/4ea2f40583951016c164c9abdf22d8e809d207fe)
|
|
38
|
+
- change(header): changed homepage text color [`64ce8b6`](https://github.com/eea/volto-eea-design-system/commit/64ce8b61f8f2150513e09bf2926b48aa2ae1071c)
|
|
39
|
+
- Use 1.5 rem [`1125cd7`](https://github.com/eea/volto-eea-design-system/commit/1125cd7c65332fc5961ffbbbd2d2ab6bcc8b1b5b)
|
|
40
|
+
- Add padding if hero block is not full-width [`808b839`](https://github.com/eea/volto-eea-design-system/commit/808b83957d6a866cc31c928f414fa8fa5da517a1)
|
|
41
|
+
- Add hero block style [`fa39656`](https://github.com/eea/volto-eea-design-system/commit/fa39656fd661d8af95f483a6f33a08e4c93c42f1)
|
|
42
|
+
- Autobuild of docusaurus docs [`ca05477`](https://github.com/eea/volto-eea-design-system/commit/ca0547716cb07ca1cb29f8aee0df1d8f26633df2)
|
|
43
|
+
|
|
44
|
+
#### [0.5.0](https://github.com/eea/volto-eea-design-system/compare/0.4.5...0.5.0)
|
|
45
|
+
|
|
46
|
+
> 11 June 2022
|
|
47
|
+
|
|
48
|
+
- refactor(header): to use mega menu v2 [`#191`](https://github.com/eea/volto-eea-design-system/pull/191)
|
|
49
|
+
- fix(header-dropdown): mobile text is now visible [`#111`](https://github.com/eea/volto-eea-design-system/pull/111)
|
|
50
|
+
- fix(header): Internal links in mega menu [`d8ca135`](https://github.com/eea/volto-eea-design-system/commit/d8ca13558c3e8c336800791f2fea8a8d33a2b602)
|
|
51
|
+
- Update package.json [`9dc3816`](https://github.com/eea/volto-eea-design-system/commit/9dc38165a95deca1faf2dfccdc03fd6cab3d8c54)
|
|
52
|
+
- refactor(header): and mega menu to latest spec #114 [`44fcf68`](https://github.com/eea/volto-eea-design-system/commit/44fcf68be242f97ced852b28ac3ab820dc0e1045)
|
|
53
|
+
- fix(header): show active menu when clicking on children [`a54fa67`](https://github.com/eea/volto-eea-design-system/commit/a54fa67a1a92e2ab4216e6d149f66e1ee53aab89)
|
|
54
|
+
- change(header): use Link instead of a tag for menu items [`9812b3f`](https://github.com/eea/volto-eea-design-system/commit/9812b3fba7b8305399d6972daf135b8a2d88e876)
|
|
55
|
+
- change(header): hide first link(home) from header menu on site [`ae7f3b9`](https://github.com/eea/volto-eea-design-system/commit/ae7f3b9385620eb3d840dd90f512e37cd8556a6d)
|
|
56
|
+
- change(header): renamed mega menu items href attribute to url [`3ed8144`](https://github.com/eea/volto-eea-design-system/commit/3ed8144589f87a9ad219c97193863c999a72cb6d)
|
|
57
|
+
- change(header): disable sticky setting until feature is more stable [`1d7af95`](https://github.com/eea/volto-eea-design-system/commit/1d7af954c85cb6a8a657c1625e4ae863e562346a)
|
|
58
|
+
- refactor(header): add link for menu title inside desktop mega menu [`24355d0`](https://github.com/eea/volto-eea-design-system/commit/24355d000b2bd808b2031cd2b78e60cafb9ad5b1)
|
|
59
|
+
- change(megamenu): typo correction and key setting on list.items [`96d2c4f`](https://github.com/eea/volto-eea-design-system/commit/96d2c4fbfa722d22a215e8d27f1400e65fe9476e)
|
|
60
|
+
- Autobuild of docusaurus docs [`e75be30`](https://github.com/eea/volto-eea-design-system/commit/e75be303421cd7ea70b0a15998636c6416459869)
|
|
61
|
+
- feat(hero): added storybook implementation of hero component #172 [`17b9d16`](https://github.com/eea/volto-eea-design-system/commit/17b9d1693e31bf7b3b41ca84be7bd21f07065674)
|
|
62
|
+
- Autobuild of docusaurus docs [`fe9d209`](https://github.com/eea/volto-eea-design-system/commit/fe9d209da5e493a6ce5c7fee63a47ba3d9788530)
|
|
63
|
+
- feature(item): added themes to item icons #190 [`a6a2907`](https://github.com/eea/volto-eea-design-system/commit/a6a2907df09575a18fb6e81dc52e8d6651eff118)
|
|
64
|
+
- Override tile image in .block parrent [`005655d`](https://github.com/eea/volto-eea-design-system/commit/005655ddff6f45e211f1ff8156b0b7efa1e47a2e)
|
|
65
|
+
- Move item icon themes to item.overrides [`31e8921`](https://github.com/eea/volto-eea-design-system/commit/31e8921f4ee4d92ba3a9c58275b41dd3101cffd2)
|
|
66
|
+
- Override only the width [`8d49270`](https://github.com/eea/volto-eea-design-system/commit/8d4927084e5daedcb69e6f3a57cab73a9016a55f)
|
|
67
|
+
- Add end of line [`51639d8`](https://github.com/eea/volto-eea-design-system/commit/51639d804a2b84f66373fb77c569bcc43b22e303)
|
|
68
|
+
- Add item themes; override .block .ui.image width based on size [`06010db`](https://github.com/eea/volto-eea-design-system/commit/06010db21398638d46d2e007317d72a7aff7e7d9)
|
|
69
|
+
- refactor(hero): add full-heigh control to adjust height [`a45cb7c`](https://github.com/eea/volto-eea-design-system/commit/a45cb7c599cdc11426207001e67d8f7d727233fe)
|
|
70
|
+
- refactor(utilities): update hex with color token [`8dc65ef`](https://github.com/eea/volto-eea-design-system/commit/8dc65ef55a62dcb32b6eb8a684524a8dc1fa6ba6)
|
|
71
|
+
- refactor(headings): update heading sizes for mobile [`19f3cca`](https://github.com/eea/volto-eea-design-system/commit/19f3ccacaf2c744b5f5c2ec8635773de7ef0016b)
|
|
72
|
+
- refactor(header): minor updates on colors and widths [`a70129f`](https://github.com/eea/volto-eea-design-system/commit/a70129fd929fedb344a47e049cca94274e84a3b1)
|
|
73
|
+
- refactor(hero):make button variant and inverted different button controls [`7e182ca`](https://github.com/eea/volto-eea-design-system/commit/7e182ca9ecdb76507205d84f83cad6a79dd74a03)
|
|
74
|
+
- fix(header): fix accessibility issue by David [`783dcec`](https://github.com/eea/volto-eea-design-system/commit/783dcec0d140e6e6e568d0f82833dcbf8a5c7d3d)
|
|
75
|
+
- fix(header): accessibility and dropdown possition fixes [`505ac36`](https://github.com/eea/volto-eea-design-system/commit/505ac36a27d86e620fb5af515a0b8b5979610f0a)
|
|
76
|
+
- refactor(header):main bar sticky on scroll up [`9c9e7c6`](https://github.com/eea/volto-eea-design-system/commit/9c9e7c6f9651c0663a1eab1856d7324a73afb2de)
|
|
77
|
+
- refactor(megaMenu): update mega menu in header component [`2d1ce45`](https://github.com/eea/volto-eea-design-system/commit/2d1ce454553d116efa96288079b8b77649e10abb)
|
|
78
|
+
- refactor(header): add control for inverted logo [`023ca45`](https://github.com/eea/volto-eea-design-system/commit/023ca45e6f263166211cbea0d63b1938d11221da)
|
|
79
|
+
- refactor(hero): move quoted utility to h2 tag [`7376676`](https://github.com/eea/volto-eea-design-system/commit/7376676b4875494f16c49945f6b5dac19c6b8009)
|
|
80
|
+
- refactor(header): update main section and and add color variations [`f2f0fd1`](https://github.com/eea/volto-eea-design-system/commit/f2f0fd1de7c04eff4b2a9b62d03dd13a1b0d69bc)
|
|
81
|
+
- refactor(header): update structure and variables of top bar [`af70909`](https://github.com/eea/volto-eea-design-system/commit/af709094f94f0cc2e2309b1aedb376e45dc7f136)
|
|
82
|
+
- refactor(hero):prettier & style changes [`d846884`](https://github.com/eea/volto-eea-design-system/commit/d84688440417a430afd9fd24f4c8cfeef0121203)
|
|
83
|
+
- refactor(hero): align hero's text and meta seperately [`4fa958f`](https://github.com/eea/volto-eea-design-system/commit/4fa958f7c7cc6d331a8eb7aaf25dc44d6cd3632a)
|
|
84
|
+
- refactor(hero):add button variant controls [`f362a7b`](https://github.com/eea/volto-eea-design-system/commit/f362a7b2ec273131fa0876f23b74c740c7217b3a)
|
|
85
|
+
- refactor(hero): update variables with new design tokens [`1d97922`](https://github.com/eea/volto-eea-design-system/commit/1d9792231c50f12fd68364e201054f6ab0926665)
|
|
86
|
+
- feat(hero): add hero block component and stories [`6019fc8`](https://github.com/eea/volto-eea-design-system/commit/6019fc843ec14a8afc7558e92c2d4b4bb14ee199)
|
|
87
|
+
- refactor(header): add control for main section stickiness [`2f07572`](https://github.com/eea/volto-eea-design-system/commit/2f07572f78074137e7e6a49585273210ed5cedcb)
|
|
88
|
+
- change(header): disabled active menu when clicking on globalnav links [`3f7b5ee`](https://github.com/eea/volto-eea-design-system/commit/3f7b5eedb038b51fbae8a14a683dc6adc919549b)
|
|
89
|
+
- fix(header): transparency class should apply on the current bg color or image [`f9a0033`](https://github.com/eea/volto-eea-design-system/commit/f9a0033c5538cb19f08f26cf28d47954cc52607d)
|
|
90
|
+
- refactor(header) add position sticky & transparent for main section [`29df772`](https://github.com/eea/volto-eea-design-system/commit/29df772edfe23b1752aa3d184659eea90c3c9221)
|
|
91
|
+
- refactor(header): add control that toggles transparency class on main section [`b8d4bdb`](https://github.com/eea/volto-eea-design-system/commit/b8d4bdb9c527f102ffd3718f32bf1a43309a9bb4)
|
|
92
|
+
- refactor(Language List): add less variables [`7ccc1cc`](https://github.com/eea/volto-eea-design-system/commit/7ccc1ccf57419b6eecbf71d479db72b84428d43a)
|
|
93
|
+
- refactor(Language List): render language dropdown as ul and li elements [`3617442`](https://github.com/eea/volto-eea-design-system/commit/3617442da78af07d3f473d0c43c47dd48c9b2ac3)
|
|
94
|
+
- change(header): mark top level active menu item [`665c449`](https://github.com/eea/volto-eea-design-system/commit/665c449bc2667cc1471a4b97923c897ad3506792)
|
|
95
|
+
- change(header): target link instead of span directly [`9e865fb`](https://github.com/eea/volto-eea-design-system/commit/9e865fbb5b256196756c3d84de397296ac0b447a)
|
|
96
|
+
- change(header): introduced item class to the mega menu link content [`00ca376`](https://github.com/eea/volto-eea-design-system/commit/00ca376ea4cf1de4851e84567b97c374ee7f66e3)
|
|
97
|
+
- fix(header): dropdown disappears after window resize #116 [`fc7dd8b`](https://github.com/eea/volto-eea-design-system/commit/fc7dd8bd7911421fb734a696a2dd5d3ad3b652b0)
|
|
98
|
+
- change(header): use viewport width for changing mobile text in header dropdowns [`b50fa58`](https://github.com/eea/volto-eea-design-system/commit/b50fa585c0abeedc04a46395f08e50a9e112c430)
|
|
99
|
+
- update storybook header.topdropdown [`e58ac08`](https://github.com/eea/volto-eea-design-system/commit/e58ac0821af56c06272e3373383647cbbff20978)
|
|
100
|
+
- rename to viewportWidth [`32162e7`](https://github.com/eea/volto-eea-design-system/commit/32162e7c695774bbb68ac63a0008e8b148f1e9f5)
|
|
101
|
+
- don't connect component to store [`470b8ba`](https://github.com/eea/volto-eea-design-system/commit/470b8bade5e8f2eaabb20a7bb02c8e82ca42f8a0)
|
|
102
|
+
- use volto-screen-helper width [`ea156aa`](https://github.com/eea/volto-eea-design-system/commit/ea156aad1100166ba78635163cfacdcfb913c1d4)
|
|
103
|
+
- fix(header): dropdowns disappear on resize [`52338fd`](https://github.com/eea/volto-eea-design-system/commit/52338fd3e711f4918612e052dc2034a8d9bd40bd)
|
|
104
|
+
- fix(header-topdropdown): dedupe html dropdown elements for topdropdowns #115 [`f10a7a8`](https://github.com/eea/volto-eea-design-system/commit/f10a7a8743a5fb2cecd0c3374ec9d894e914143f)
|
|
105
|
+
- behave as mobile under 480 only [`11b99e1`](https://github.com/eea/volto-eea-design-system/commit/11b99e15cb83245a32bb04f3937f5b95a60b1e95)
|
|
106
|
+
- make it account for all mobile-s,m,l [`69e23ae`](https://github.com/eea/volto-eea-design-system/commit/69e23ae8d12042f241dc53c9e296c340d5b17089)
|
|
107
|
+
- fix(header-topdropdown): dedupe html elements for topdropdowns [`cd8a2a7`](https://github.com/eea/volto-eea-design-system/commit/cd8a2a7ea091e81b736438f7c2a87c254af1b092)
|
|
108
|
+
- refactor(header): restore union dropdown after implementation [`7e98bab`](https://github.com/eea/volto-eea-design-system/commit/7e98bab497ee10ad89d2dfed76c7117b633206fe)
|
|
109
|
+
- fix(header): mobile dropdown now visible [`34371b4`](https://github.com/eea/volto-eea-design-system/commit/34371b436f2ec100f3920f78de49983ba16679b0)
|
|
110
|
+
- Add divider content for metadata field in Banner [`327ad1c`](https://github.com/eea/volto-eea-design-system/commit/327ad1c5fdca0d376d04fd36084b940e5dd016ab)
|
|
111
|
+
- refactor(header): update search input [`368962e`](https://github.com/eea/volto-eea-design-system/commit/368962eabb668e2ec1bdcd18ae81658e7b1d911b)
|
|
112
|
+
- refactor(header): remove unused imports [`7e232db`](https://github.com/eea/volto-eea-design-system/commit/7e232db6ce0b2553be79d98d8497fa06f548b772)
|
|
113
|
+
- refactor(header): update search input and file endings [`afab36f`](https://github.com/eea/volto-eea-design-system/commit/afab36f96f245e197eff528cb1d9e6fea45bc7ba)
|
|
114
|
+
- refactor(header): add fluid font sizes [`5f2743e`](https://github.com/eea/volto-eea-design-system/commit/5f2743e39107fd1bd00a54e03bf92963eb9853f2)
|
|
115
|
+
- refactor(header): minor responsive fixes [`16a0006`](https://github.com/eea/volto-eea-design-system/commit/16a000634505c9e8f8b310860a30b62798a0fb87)
|
|
116
|
+
|
|
7
117
|
#### [0.4.5](https://github.com/eea/volto-eea-design-system/compare/0.4.4...0.4.5)
|
|
8
118
|
|
|
119
|
+
> 8 June 2022
|
|
120
|
+
|
|
121
|
+
- change(tabs,footer): tabs styling and react warning fixes [`#188`](https://github.com/eea/volto-eea-design-system/pull/188)
|
|
9
122
|
- Autobuild of docusaurus docs [`728c62b`](https://github.com/eea/volto-eea-design-system/commit/728c62b1ddc9ea5e7f551230b657897c6eafbc57)
|
|
10
123
|
- change(tabs): Add style for tabs accordion template #187 [`fb8adbf`](https://github.com/eea/volto-eea-design-system/commit/fb8adbf84ac564a14d45bb6e8f4e1661811672d5)
|
|
11
124
|
- Autobuild of docusaurus docs [`06fbae7`](https://github.com/eea/volto-eea-design-system/commit/06fbae751c4f14ace793d4aa51f1ba0b52fec735)
|
package/package.json
CHANGED
package/src/semantic.less
CHANGED
|
@@ -257,6 +257,10 @@
|
|
|
257
257
|
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/relatedContent';
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
+
& {
|
|
261
|
+
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/contentBox';
|
|
262
|
+
}
|
|
263
|
+
|
|
260
264
|
& {
|
|
261
265
|
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/downloadLabeledIcon';
|
|
262
266
|
}
|
|
@@ -272,3 +276,7 @@
|
|
|
272
276
|
& {
|
|
273
277
|
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/languageLabeledIcon';
|
|
274
278
|
}
|
|
279
|
+
|
|
280
|
+
& {
|
|
281
|
+
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/hero';
|
|
282
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container } from 'semantic-ui-react';
|
|
3
|
+
|
|
4
|
+
function ContentBox({ children, ...rest }) {
|
|
5
|
+
return (
|
|
6
|
+
<div className={`eea content-box ${rest.variant}`}>
|
|
7
|
+
{rest.container ? <Container>{children}</Container> : children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default ContentBox;
|
package/src/ui/Header/Header.jsx
CHANGED
|
@@ -13,6 +13,12 @@ import burgerIcon from '@eeacms/volto-eea-design-system/../theme/themes/eea/asse
|
|
|
13
13
|
|
|
14
14
|
import HeaderSearchPopUp from './HeaderSearchPopUp';
|
|
15
15
|
import HeaderMenuPopUp from './HeaderMenuPopUp';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
|
|
18
|
+
Header.propTypes = {
|
|
19
|
+
transparency: PropTypes.bool,
|
|
20
|
+
inverted: PropTypes.bool,
|
|
21
|
+
};
|
|
16
22
|
|
|
17
23
|
function Header({ children }) {
|
|
18
24
|
return <div className="eea header">{children}</div>;
|
|
@@ -39,7 +45,7 @@ const TopDropdownMenu = ({
|
|
|
39
45
|
text,
|
|
40
46
|
viewportWidth,
|
|
41
47
|
}) => {
|
|
42
|
-
const isMobile = viewportWidth <
|
|
48
|
+
const isMobile = viewportWidth < 767;
|
|
43
49
|
|
|
44
50
|
const Component = ({ mobileText }) => (
|
|
45
51
|
<Dropdown
|
|
@@ -57,14 +63,39 @@ const TopDropdownMenu = ({
|
|
|
57
63
|
);
|
|
58
64
|
};
|
|
59
65
|
|
|
66
|
+
// disable sticky until it's more stable
|
|
67
|
+
// const useScrollingUp = () => {
|
|
68
|
+
// let prevScroll;
|
|
69
|
+
//
|
|
70
|
+
// if (process.browser) {
|
|
71
|
+
// prevScroll = window.pageYOffset;
|
|
72
|
+
// }
|
|
73
|
+
// const [scrollingUp, setScrollingUp] = React.useState(false);
|
|
74
|
+
// const handleScroll = () => {
|
|
75
|
+
// const currScroll = window.pageYOffset;
|
|
76
|
+
// const isScrolled = prevScroll > currScroll;
|
|
77
|
+
// setScrollingUp(isScrolled);
|
|
78
|
+
// prevScroll = currScroll;
|
|
79
|
+
// };
|
|
80
|
+
// React.useEffect(() => {
|
|
81
|
+
// window.addEventListener('scroll', handleScroll, { passive: true });
|
|
82
|
+
// return () => {
|
|
83
|
+
// window.removeEventListener('scroll', handleScroll, { passive: true });
|
|
84
|
+
// };
|
|
85
|
+
// });
|
|
86
|
+
// return scrollingUp;
|
|
87
|
+
// };
|
|
88
|
+
|
|
60
89
|
const Main = ({
|
|
61
90
|
logo,
|
|
62
91
|
menuItems,
|
|
63
92
|
renderMenuItem,
|
|
64
93
|
renderGlobalMenuItem,
|
|
65
94
|
pathname,
|
|
95
|
+
transparency,
|
|
96
|
+
inverted,
|
|
66
97
|
}) => {
|
|
67
|
-
const [activeItem, setActiveItem] = React.useState(
|
|
98
|
+
const [activeItem, setActiveItem] = React.useState(pathname);
|
|
68
99
|
const [menuIsActive, setMenuIsActive] = React.useState(false);
|
|
69
100
|
const [searchIsActive, setSearchIsActive] = React.useState(false);
|
|
70
101
|
const [burger, setBurger] = React.useState('');
|
|
@@ -73,15 +104,19 @@ const Main = ({
|
|
|
73
104
|
setMenuIsActive(false);
|
|
74
105
|
setSearchIsActive(false);
|
|
75
106
|
setBurger('');
|
|
107
|
+
// remove active menu when we have no pathname which means we hit logo to go home
|
|
108
|
+
if (!pathname) {
|
|
109
|
+
setActiveItem('');
|
|
110
|
+
}
|
|
76
111
|
}, [pathname]);
|
|
77
112
|
|
|
78
113
|
const searchOnClick = (e, x) => {
|
|
79
114
|
if (menuIsActive === true) {
|
|
80
115
|
setBurger('');
|
|
81
116
|
setMenuIsActive(false);
|
|
117
|
+
setActiveItem('');
|
|
82
118
|
}
|
|
83
119
|
setSearchIsActive(!searchIsActive);
|
|
84
|
-
setActiveItem('');
|
|
85
120
|
};
|
|
86
121
|
|
|
87
122
|
const mobileBurgerOnClick = () => {
|
|
@@ -95,49 +130,57 @@ const Main = ({
|
|
|
95
130
|
} else {
|
|
96
131
|
setBurger('');
|
|
97
132
|
setMenuIsActive(false);
|
|
133
|
+
setActiveItem('');
|
|
98
134
|
}
|
|
99
135
|
};
|
|
100
136
|
|
|
101
|
-
const desktopBurgerOnClick = () => {
|
|
102
|
-
setMenuIsActive(false);
|
|
103
|
-
setActiveItem('');
|
|
104
|
-
};
|
|
105
|
-
|
|
106
137
|
const menuOnClick = (e, item) => {
|
|
107
138
|
if (searchIsActive) setSearchIsActive(false);
|
|
108
139
|
setActiveItem(item['@id'] || item.url);
|
|
109
140
|
setMenuIsActive(true);
|
|
110
141
|
};
|
|
111
142
|
|
|
112
|
-
React.useEffect(() => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, [searchIsActive, burger, menuIsActive]);
|
|
143
|
+
// React.useEffect(() => {
|
|
144
|
+
// if (searchIsActive || burger === 'open' || menuIsActive) {
|
|
145
|
+
// document.body.style.overflow = 'hidden';
|
|
146
|
+
// } else {
|
|
147
|
+
// document.body.style.overflow = 'unset';
|
|
148
|
+
// }
|
|
149
|
+
// }, [searchIsActive, burger, menuIsActive]);
|
|
119
150
|
|
|
120
151
|
const node = React.useRef();
|
|
121
152
|
const searchButtonRef = React.useRef();
|
|
122
|
-
const desktopMenuBurgerRef = React.useRef();
|
|
123
153
|
const mobileMenuBurgerRef = React.useRef();
|
|
124
154
|
|
|
155
|
+
// disable sticky setting until feature is more stable
|
|
156
|
+
// const isScrollingUp = useScrollingUp();
|
|
157
|
+
// <div
|
|
158
|
+
// className={`main bar ${transparency ? 'transparency' : ''} ${
|
|
159
|
+
// isScrollingUp ? 'sticky' : ''
|
|
160
|
+
// }`}
|
|
161
|
+
// >
|
|
125
162
|
return (
|
|
126
|
-
<div
|
|
163
|
+
<div
|
|
164
|
+
className={`main bar ${transparency ? 'transparency' : ''}`}
|
|
165
|
+
ref={node}
|
|
166
|
+
>
|
|
127
167
|
<Container>
|
|
128
168
|
<Grid>
|
|
129
169
|
<Grid.Column mobile={8} tablet={8} computer={4}>
|
|
130
170
|
{logo}
|
|
131
171
|
</Grid.Column>
|
|
132
172
|
<Grid.Column mobile={4} tablet={4} computer={8}>
|
|
133
|
-
<div className=
|
|
134
|
-
{
|
|
173
|
+
<div className={inverted ? 'main-menu inverted' : 'main-menu'}>
|
|
174
|
+
{menuItems && (
|
|
135
175
|
<Menu className="eea-main-menu tablet or lower hidden" text>
|
|
136
176
|
{menuItems.map((item) => (
|
|
137
177
|
<Menu.Item
|
|
138
178
|
name={item['@id'] || item.url}
|
|
139
|
-
active={activeItem === item.key}
|
|
140
179
|
key={item['@id'] || item.url}
|
|
180
|
+
active={
|
|
181
|
+
activeItem.indexOf(item['@id']) !== -1 ||
|
|
182
|
+
activeItem.indexOf(item.url) !== -1
|
|
183
|
+
}
|
|
141
184
|
>
|
|
142
185
|
{renderGlobalMenuItem(item, {
|
|
143
186
|
onClick: menuOnClick,
|
|
@@ -146,16 +189,6 @@ const Main = ({
|
|
|
146
189
|
))}
|
|
147
190
|
</Menu>
|
|
148
191
|
)}
|
|
149
|
-
{menuIsActive && (
|
|
150
|
-
<Header.BurgerAction
|
|
151
|
-
className="desktop"
|
|
152
|
-
onClick={desktopBurgerOnClick}
|
|
153
|
-
ref={desktopMenuBurgerRef}
|
|
154
|
-
>
|
|
155
|
-
{/* <Icon name="close" /> */}
|
|
156
|
-
<Image src={closeIcon} alt="menu close icon" />
|
|
157
|
-
</Header.BurgerAction>
|
|
158
|
-
)}
|
|
159
192
|
<div
|
|
160
193
|
className="search-action"
|
|
161
194
|
onClick={searchOnClick}
|
|
@@ -173,9 +206,6 @@ const Main = ({
|
|
|
173
206
|
onClick={mobileBurgerOnClick}
|
|
174
207
|
ref={mobileMenuBurgerRef}
|
|
175
208
|
>
|
|
176
|
-
{/* <Icon
|
|
177
|
-
name={this.state.burger === 'open' ? 'close' : 'bars'}
|
|
178
|
-
></Icon> */}
|
|
179
209
|
<Image
|
|
180
210
|
src={burger === 'open' ? `${closeIcon}` : `${burgerIcon}`}
|
|
181
211
|
alt="menu icon open/close"
|
|
@@ -197,7 +227,7 @@ const Main = ({
|
|
|
197
227
|
activeItem={activeItem}
|
|
198
228
|
menuItems={menuItems}
|
|
199
229
|
onClose={mobileBurgerOnClick}
|
|
200
|
-
triggerRefs={[mobileMenuBurgerRef
|
|
230
|
+
triggerRefs={[mobileMenuBurgerRef]}
|
|
201
231
|
/>
|
|
202
232
|
)}
|
|
203
233
|
</div>
|
|
@@ -1,76 +1,237 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Container,
|
|
4
|
+
Divider,
|
|
5
|
+
Grid,
|
|
6
|
+
List,
|
|
7
|
+
Icon,
|
|
8
|
+
Accordion,
|
|
9
|
+
} from 'semantic-ui-react';
|
|
4
10
|
|
|
11
|
+
import { Link } from 'react-router-dom';
|
|
5
12
|
import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
|
|
6
13
|
|
|
7
|
-
const
|
|
14
|
+
const createColumns = (item, length) => {
|
|
15
|
+
let subArrays = [];
|
|
16
|
+
let size = length;
|
|
17
|
+
for (let i = 0; i < item.items.length; i += size) {
|
|
18
|
+
subArrays.push(item.items.slice(i, i + size));
|
|
19
|
+
}
|
|
8
20
|
|
|
9
|
-
const
|
|
21
|
+
const column = subArrays.map((subArray, index) => (
|
|
22
|
+
<Grid.Column key={index}>
|
|
23
|
+
<List>
|
|
24
|
+
{subArray.map((arrayItem, idx) => (
|
|
25
|
+
<Link role="listitem" className="item" to={arrayItem.url} key={idx}>
|
|
26
|
+
{arrayItem.title}
|
|
27
|
+
</Link>
|
|
28
|
+
))}
|
|
29
|
+
</List>
|
|
30
|
+
</Grid.Column>
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
return column;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const ItemGrid = ({ item, columns, length }) => (
|
|
37
|
+
<>
|
|
38
|
+
<Link className="sub-title" to={item.url}>
|
|
39
|
+
{item.title}
|
|
40
|
+
</Link>
|
|
41
|
+
<Grid columns={columns}>{createColumns(item, length)}</Grid>
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const Item = ({ item, icon = false, iconName }) => (
|
|
10
46
|
<>
|
|
11
|
-
{item.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
47
|
+
<Link className="sub-title" to={item.url}>
|
|
48
|
+
{item.title}
|
|
49
|
+
</Link>
|
|
50
|
+
<List className="menu-list">
|
|
51
|
+
{item.items.map((listItem, index) => (
|
|
52
|
+
<Link role="listitem" className="item" to={listItem.url} key={index}>
|
|
53
|
+
{icon && <Icon className={iconName} />}
|
|
54
|
+
{listItem.title}
|
|
55
|
+
</Link>
|
|
56
|
+
))}
|
|
57
|
+
</List>
|
|
20
58
|
</>
|
|
21
59
|
);
|
|
22
60
|
|
|
23
|
-
const
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
hasSubMenu: item.items?.length > 0,
|
|
36
|
-
active: (item['@id'] || item.url) === activeItem,
|
|
37
|
-
})}
|
|
38
|
-
>
|
|
39
|
-
<Item item={item} renderMenuItem={renderMenuItem} />
|
|
40
|
-
|
|
41
|
-
{item.items.length > 0 && (
|
|
42
|
-
<ItemsList
|
|
43
|
-
items={item.items}
|
|
44
|
-
level={level + 1}
|
|
45
|
-
renderMenuItem={renderMenuItem}
|
|
46
|
-
activeItem={activeItem}
|
|
47
|
-
/>
|
|
61
|
+
const Topics = ({ menuItem }) => (
|
|
62
|
+
<Grid>
|
|
63
|
+
{menuItem.items.map((section, index) => (
|
|
64
|
+
<React.Fragment key={index}>
|
|
65
|
+
{section.title === 'At a glance' ? (
|
|
66
|
+
<Grid.Column width={3} id="at-a-glance">
|
|
67
|
+
<Item item={section} icon={true} iconName="ri-leaf-line" />
|
|
68
|
+
</Grid.Column>
|
|
69
|
+
) : (
|
|
70
|
+
<Grid.Column width={9} key={index}>
|
|
71
|
+
<ItemGrid item={section} columns={4} length={10} />
|
|
72
|
+
</Grid.Column>
|
|
48
73
|
)}
|
|
49
|
-
</
|
|
74
|
+
</React.Fragment>
|
|
75
|
+
))}
|
|
76
|
+
</Grid>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const Countries = ({ menuItem }) => (
|
|
80
|
+
<Grid>
|
|
81
|
+
<Grid.Column width={8}>
|
|
82
|
+
{menuItem.items.map((section, index) => (
|
|
83
|
+
<React.Fragment key={index}>
|
|
84
|
+
{section.title === 'EEA member countries' && (
|
|
85
|
+
<ItemGrid item={section} columns={5} length={7} />
|
|
86
|
+
)}
|
|
87
|
+
</React.Fragment>
|
|
88
|
+
))}
|
|
89
|
+
</Grid.Column>
|
|
90
|
+
<Grid.Column width={4}>
|
|
91
|
+
<Grid columns={1} className="nested-grid">
|
|
92
|
+
{menuItem.items.map((section, index) => (
|
|
93
|
+
<React.Fragment key={index}>
|
|
94
|
+
{section.title !== 'EEA member countries' && (
|
|
95
|
+
<Grid.Column>
|
|
96
|
+
<ItemGrid item={section} columns={2} length={3} />
|
|
97
|
+
</Grid.Column>
|
|
98
|
+
)}
|
|
99
|
+
</React.Fragment>
|
|
100
|
+
))}
|
|
101
|
+
</Grid>
|
|
102
|
+
</Grid.Column>
|
|
103
|
+
</Grid>
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const StandardMegaMenuGrid = ({ menuItem }) => (
|
|
107
|
+
<Grid columns={4}>
|
|
108
|
+
{menuItem.items.map((section, index) => (
|
|
109
|
+
<Grid.Column key={index}>
|
|
110
|
+
<Item item={section} />
|
|
111
|
+
</Grid.Column>
|
|
50
112
|
))}
|
|
51
|
-
</
|
|
113
|
+
</Grid>
|
|
52
114
|
);
|
|
53
115
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
116
|
+
const FirstLevelContent = ({ element }) => {
|
|
117
|
+
const topics = element.title === 'Topics' ? true : false;
|
|
118
|
+
|
|
119
|
+
const firstLevelPanels = [];
|
|
120
|
+
let content;
|
|
121
|
+
if (!topics) {
|
|
122
|
+
element.items.forEach((item, index) => {
|
|
123
|
+
let x = {};
|
|
124
|
+
x.key = item['@id'];
|
|
125
|
+
x.title = (
|
|
126
|
+
<Accordion.Title key={`title=${index}`}>
|
|
127
|
+
{item.title}
|
|
128
|
+
<Icon className="ri-arrow-down-s-line" size="small" />
|
|
129
|
+
</Accordion.Title>
|
|
130
|
+
);
|
|
131
|
+
x.content = (
|
|
132
|
+
<Accordion.Content key={index}>
|
|
133
|
+
<SecondLevelContent element={item} />
|
|
134
|
+
</Accordion.Content>
|
|
135
|
+
);
|
|
136
|
+
firstLevelPanels.push(x);
|
|
137
|
+
});
|
|
138
|
+
content = <Accordion.Accordion panels={firstLevelPanels} />;
|
|
139
|
+
} else {
|
|
140
|
+
content = <SecondLevelContent element={element} topics={true} />;
|
|
141
|
+
}
|
|
142
|
+
return <>{content}</>;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const SecondLevelContent = ({ element, topics = false }) => {
|
|
146
|
+
let content;
|
|
147
|
+
if (topics) {
|
|
148
|
+
const atAGlance = element.items.find(
|
|
149
|
+
(element) => element.title === 'At a glance',
|
|
150
|
+
);
|
|
151
|
+
content = (
|
|
152
|
+
<List>
|
|
153
|
+
{atAGlance.items.map((item, index) => (
|
|
154
|
+
<Link role="listitem" className="item" to={item.url} key={index}>
|
|
155
|
+
{item.title}
|
|
156
|
+
</Link>
|
|
157
|
+
))}
|
|
158
|
+
<Link
|
|
159
|
+
role="listitem"
|
|
160
|
+
className="item"
|
|
161
|
+
to={element.url}
|
|
162
|
+
key={element['@id']}
|
|
163
|
+
>
|
|
164
|
+
A-Z Topics
|
|
165
|
+
</Link>
|
|
166
|
+
</List>
|
|
167
|
+
);
|
|
168
|
+
} else {
|
|
169
|
+
content = (
|
|
170
|
+
<List>
|
|
171
|
+
{element.items.map((item, index) => (
|
|
172
|
+
<Link role="listitem" className="item" to={item.url} key={index}>
|
|
173
|
+
{item.title}
|
|
174
|
+
</Link>
|
|
175
|
+
))}
|
|
176
|
+
</List>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return <>{content}</>;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const NestedAccordion = ({ menuItems }) => {
|
|
184
|
+
const rootPanels = [];
|
|
185
|
+
menuItems.forEach((element, index) => {
|
|
186
|
+
let x = {};
|
|
187
|
+
x.key = index;
|
|
188
|
+
x.title = (
|
|
189
|
+
<Accordion.Title key={`title-${index}`}>
|
|
190
|
+
{element.title}
|
|
191
|
+
<Icon className="ri-arrow-down-s-line" size="small" />
|
|
192
|
+
</Accordion.Title>
|
|
193
|
+
);
|
|
194
|
+
x.content = (
|
|
195
|
+
<Accordion.Content key={index}>
|
|
196
|
+
<FirstLevelContent element={element} />
|
|
197
|
+
</Accordion.Content>
|
|
198
|
+
);
|
|
199
|
+
rootPanels.push(x);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
return <Accordion panels={rootPanels} />;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
function HeaderMenuPopUp({ menuItems, onClose, triggerRefs, activeItem }) {
|
|
61
206
|
const nodeRef = React.useRef();
|
|
62
207
|
useClickOutside({ targetRefs: [nodeRef, ...triggerRefs], callback: onClose });
|
|
63
208
|
|
|
209
|
+
const menuItem = menuItems.find(
|
|
210
|
+
(current) => current.url === activeItem || current['@id'] === activeItem,
|
|
211
|
+
);
|
|
212
|
+
|
|
64
213
|
return (
|
|
65
214
|
<div id="mega-menu" ref={nodeRef}>
|
|
66
215
|
<Container>
|
|
67
|
-
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
216
|
+
{menuItem && (
|
|
217
|
+
<div className="menu-content tablet hidden mobile hidden">
|
|
218
|
+
<h3 className="title">
|
|
219
|
+
<Link to={menuItem.url}>{menuItem.title}</Link>
|
|
220
|
+
</h3>
|
|
221
|
+
<Divider fitted />
|
|
222
|
+
{menuItem.title === 'Topics' ? (
|
|
223
|
+
<Topics menuItem={menuItem} />
|
|
224
|
+
) : menuItem.title === 'Countries' ? (
|
|
225
|
+
<Countries menuItem={menuItem} />
|
|
226
|
+
) : (
|
|
227
|
+
<StandardMegaMenuGrid menuItem={menuItem} />
|
|
228
|
+
)}
|
|
229
|
+
</div>
|
|
230
|
+
)}
|
|
231
|
+
|
|
232
|
+
<div className="tablet only mobile only">
|
|
233
|
+
<NestedAccordion menuItems={menuItems} />
|
|
234
|
+
</div>
|
|
74
235
|
</Container>
|
|
75
236
|
</div>
|
|
76
237
|
);
|