@eeacms/volto-eea-design-system 1.0.0-alpha.9 → 1.0.0-beta.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +186 -1
  2. package/package.json +1 -1
  3. package/src/ui/Banner/Banner.jsx +73 -9
  4. package/src/ui/Banner/Banner.stories.jsx +3 -3
  5. package/src/ui/Card/Card.stories.jsx +265 -238
  6. package/src/ui/Footer/Footer.jsx +1 -1
  7. package/src/ui/Footer/Footer.stories.js +4 -1
  8. package/src/ui/Footer/FooterActions.jsx +17 -6
  9. package/src/ui/Header/Header.jsx +1 -0
  10. package/src/ui/Header/Header.stories.js +1 -1
  11. package/src/ui/Header/HeaderMenuPopUp.js +19 -10
  12. package/templates/eea.hbs +1 -1
  13. package/theme/themes/eea/extras/banner.less +9 -3
  14. package/theme/themes/eea/extras/banner.variables +15 -13
  15. package/theme/themes/eea/extras/contentBox.less +1 -0
  16. package/theme/themes/eea/extras/contentBox.variables +1 -0
  17. package/theme/themes/eea/extras/custom.overrides +9 -0
  18. package/theme/themes/eea/extras/footer.less +19 -19
  19. package/theme/themes/eea/extras/footer.variables +13 -10
  20. package/theme/themes/eea/extras/header.less +84 -31
  21. package/theme/themes/eea/extras/header.variables +22 -5
  22. package/theme/themes/eea/extras/inpageNavigation.less +1 -0
  23. package/theme/themes/eea/extras/keyContent.variables +1 -1
  24. package/theme/themes/eea/globals/mixins.less +16 -0
  25. package/theme/themes/eea/globals/site.overrides +26 -1
  26. package/theme/themes/eea/globals/site.variables +3 -2
  27. package/theme/themes/eea/globals/utilities.less +101 -76
  28. package/theme/themes/eea/tokens/colors.less +1 -1
  29. package/theme/themes/eea/views/card.overrides +65 -0
  30. package/theme/themes/eea/views/card.variables +17 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,192 @@ 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-beta.2](https://github.com/eea/volto-eea-design-system/compare/1.0.0-beta.1...1.0.0-beta.2) - 13 February 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(accessibility): added navigation and footer id's for skip link [David Ichim - [`48354b9`](https://github.com/eea/volto-eea-design-system/commit/48354b908e7d1a87b4e1a965d225e8f1b3e0ac59)]
12
+ - fix(footer): action or copyright links are simple a tags for external link [David Ichim - [`9af5070`](https://github.com/eea/volto-eea-design-system/commit/9af5070187ec975e58387f133afedcf1bbc47a50)]
13
+
14
+ #### :nail_care: Enhancements
15
+
16
+ - change(navigation): raise z-index of go to top link [David Ichim - [`485ca72`](https://github.com/eea/volto-eea-design-system/commit/485ca7291da7a156b6b580c42e46d4f3602211bb)]
17
+ - change(footer): modified footer gap [David Ichim - [`b8a820a`](https://github.com/eea/volto-eea-design-system/commit/b8a820ac90c7d6664e4d4655c2c06edfa976c64e)]
18
+ - change(footer): added gap for actions and copyright [David Ichim - [`7d32ddd`](https://github.com/eea/volto-eea-design-system/commit/7d32ddd3c28a48c6c2fb73dea373bb5873b6f76b)]
19
+ - change(footer): typos and modified footer links to be center aligned [David Ichim - [`ac23f04`](https://github.com/eea/volto-eea-design-system/commit/ac23f046bcac06525985dff7520bb2766dec44ec)]
20
+ - change(footer): removed extra text and date from copyright section [David Ichim - [`af47bbe`](https://github.com/eea/volto-eea-design-system/commit/af47bbec298678fece6f879fbc18fe2e01ab0894)]
21
+
22
+ #### :house: Internal changes
23
+
24
+ - chore(docs): Update eea.hbs template to beta - refs #158717 [Alin Voinea - [`196538e`](https://github.com/eea/volto-eea-design-system/commit/196538ed7bb9dab36a0efb4cef84e96dd3038ff8)]
25
+
26
+ #### :hammer_and_wrench: Others
27
+
28
+ - change version to beta 2 [David Ichim - [`cbb0798`](https://github.com/eea/volto-eea-design-system/commit/cbb07981454b28de840561eca281888e8bc29f9e)]
29
+ - Beta release [Alin Voinea - [`4ad51b3`](https://github.com/eea/volto-eea-design-system/commit/4ad51b3c2bbb75f19af14fa56afdbddf57b6c95e)]
30
+ ### [1.0.0-beta.1](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.15...1.0.0-beta.1) - 9 February 2023
31
+
32
+ #### :rocket: New Features
33
+
34
+ - feat(search): Add search suggestions style #296 from eea/search-suggestions [ichim-david - [`3b0c956`](https://github.com/eea/volto-eea-design-system/commit/3b0c956f569ebdc8400b88249c45067a1f881264)]
35
+ - feat(search): Add search suggestions style [kreafox - [`6b2b77b`](https://github.com/eea/volto-eea-design-system/commit/6b2b77bbaba11541606ae2bc1f4e8ffc823f470d)]
36
+
37
+ #### :nail_care: Enhancements
38
+
39
+ - change(search): Add proper margin for search popup [kreafox - [`190c9f5`](https://github.com/eea/volto-eea-design-system/commit/190c9f5be570215586086f42aebc7e36d6a26ea2)]
40
+
41
+ #### :hammer_and_wrench: Others
42
+
43
+ - Release 1.0.0-beta.1 [Alin Voinea - [`4384ae2`](https://github.com/eea/volto-eea-design-system/commit/4384ae28597c725f66ab0f1361ffd5167ee5e3a1)]
44
+ - Extra bottom padding for header menu [dana-cfc4 - [`4f38c7a`](https://github.com/eea/volto-eea-design-system/commit/4f38c7a96d93fbcd47de4ec60176de2a667c5643)]
45
+ - Back to dev [Alin Voinea - [`c2ee90c`](https://github.com/eea/volto-eea-design-system/commit/c2ee90c1754f17a304897839adf482bc2a111212)]
46
+ ### [1.0.0-alpha.15](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.14...1.0.0-alpha.15) - 8 February 2023
47
+
48
+ #### :rocket: New Features
49
+
50
+ - feat(utilities): Complete list of text-align utilities - refs #160747 [Alin Voinea - [`224fab6`](https://github.com/eea/volto-eea-design-system/commit/224fab602184b8974f588c91a7412e3d03e4e2f7)]
51
+ - feat(small): CSS for small HTML tag - refs #160747 [Alin Voinea - [`ad3c0ad`](https://github.com/eea/volto-eea-design-system/commit/ad3c0adec4efa7cead69153d399c6452131c94cc)]
52
+ - feat(fw-light): Add font weight light utility - refs #160747 [Alin Voinea - [`c44cf57`](https://github.com/eea/volto-eea-design-system/commit/c44cf57db5845fbb9c07233aeedab79e1438f80f)]
53
+ - feat(Card): add teaser card grid story [Antonis Tarantilis - [`53cac0b`](https://github.com/eea/volto-eea-design-system/commit/53cac0b0d1c40ad6ad8c9dc91c5d24bfb160f98e)]
54
+
55
+ #### :bug: Bug Fixes
56
+
57
+ - fix(card): teaser card dimensions on tablet size #290 from eea/teaser-card-grid [ichim-david - [`013fdf5`](https://github.com/eea/volto-eea-design-system/commit/013fdf5cad347aee14bdc51553dbd95d972a7c66)]
58
+
59
+ #### :nail_care: Enhancements
60
+
61
+ - refactor(style-menu): add text-color to paragraphs styles #291 from eea/stylemenu-theme-colors [ichim-david - [`2d78307`](https://github.com/eea/volto-eea-design-system/commit/2d783075b8089184e50b1763226af0d60ed11786)]
62
+ - change(header): Small fix in search popup #292 from eea/search-popup [ichim-david - [`86c1305`](https://github.com/eea/volto-eea-design-system/commit/86c130539455b9a00b4b088b1871a98b9756df79)]
63
+ - change(card): added extra content for teaser card story [David Ichim - [`30690ae`](https://github.com/eea/volto-eea-design-system/commit/30690ae6c499682853cb19db10b0cdc13c6f9508)]
64
+ - change(header): Small fix in search popup [kreafox - [`3d622ea`](https://github.com/eea/volto-eea-design-system/commit/3d622ea99df5a1f1088f70998e38fd5bf43997cf)]
65
+ - refactor(style-menu): add text-color to paragraphs styles [nileshgulia1 - [`3446bc2`](https://github.com/eea/volto-eea-design-system/commit/3446bc2704603bbfead7ff6c72d4e3a1ce81c7d4)]
66
+ - change(color): darkCyan is now replaced everywhere by the new green [David Ichim - [`ef3791d`](https://github.com/eea/volto-eea-design-system/commit/ef3791de6e2ea23487791c717eefc575e21fd283)]
67
+
68
+ #### :hammer_and_wrench: Others
69
+
70
+ - Release alpha 15 [Alin Voinea - [`3b72b29`](https://github.com/eea/volto-eea-design-system/commit/3b72b29aaf9b3e1bfb7015808aafbd73a7167895)]
71
+ ### [1.0.0-alpha.14](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.13.1...1.0.0-alpha.14) - 30 January 2023
72
+
73
+ #### :nail_care: Enhancements
74
+
75
+ - change(mobile menu): integrate a-z topic with menu rendering logic #287 from eea/develop [ichim-david - [`05d4c04`](https://github.com/eea/volto-eea-design-system/commit/05d4c04603e6572cd6f9b255faa03c4636d8efdb)]
76
+ - change(mobile menu): integrate a-z topic with menu rendering logic [David Ichim - [`246d3d8`](https://github.com/eea/volto-eea-design-system/commit/246d3d839b773e2f6e1fff7fed5f9aa7a4968daa)]
77
+
78
+ #### :hammer_and_wrench: Others
79
+
80
+ - bump release to alpha 14 [David Ichim - [`92f0197`](https://github.com/eea/volto-eea-design-system/commit/92f01975a809553ed122824c8407c74da9132c23)]
81
+ - link fix [David Ichim - [`e1c12a1`](https://github.com/eea/volto-eea-design-system/commit/e1c12a132a1a99d773af359ebce071fb37c7e661)]
82
+ ### [1.0.0-alpha.13.1](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.13...1.0.0-alpha.13.1) - 30 January 2023
83
+
84
+ #### :nail_care: Enhancements
85
+
86
+ - change(mobile menu): hardcode a-z topics to '/en/topics-in-depth' #286 from eea/develop [ichim-david - [`6436224`](https://github.com/eea/volto-eea-design-system/commit/6436224e1922fb5d4b4053c874cebe5c57b2a6b9)]
87
+ - change(mobile menu): hardcode a-z topics to '/en/topics-in-depth' [David Ichim - [`5235b52`](https://github.com/eea/volto-eea-design-system/commit/5235b52047a80a8b626aa5ef3ef304c4d9a82003)]
88
+
89
+ #### :hammer_and_wrench: Others
90
+
91
+ - change release to 13.1 [David Ichim - [`70aa564`](https://github.com/eea/volto-eea-design-system/commit/70aa5648e7d9e14796445323b6ebaf7733cc7fd8)]
92
+ ### [1.0.0-alpha.13](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.12...1.0.0-alpha.13) - 27 January 2023
93
+
94
+ #### :rocket: New Features
95
+
96
+ - feat(utilities): added has--bg--top center and bottom utility classes [David Ichim - [`051e6d7`](https://github.com/eea/volto-eea-design-system/commit/051e6d7c33aca7947802ddaa9fe68ac41ed7fe11)]
97
+
98
+ #### :bug: Bug Fixes
99
+
100
+ - fix(header): update green color used in page header #284 from eea/fix-banner-background [ichim-david - [`29d54db`](https://github.com/eea/volto-eea-design-system/commit/29d54db06487d18a367202725e525ac26e5b7c58)]
101
+
102
+ #### :nail_care: Enhancements
103
+
104
+ - refactor(Banner): update banner background green color [Antonis Tarantilis - [`fd4a552`](https://github.com/eea/volto-eea-design-system/commit/fd4a552d9ff7a2973ebd6d18b6fbfd9bba5d98c6)]
105
+ - change(mobile menu): changed link for a-z topics to point to in depth [David Ichim - [`721bf23`](https://github.com/eea/volto-eea-design-system/commit/721bf237d23d2a8e47fc2132912646c4ce182c9d)]
106
+ - change(site): added fixes from customVolto.css to design package [David Ichim - [`51ba9b5`](https://github.com/eea/volto-eea-design-system/commit/51ba9b5df0186bdf075d803dea6032bac52e540f)]
107
+
108
+ #### :hammer_and_wrench: Others
109
+
110
+ - 1.0.0-alpha.13 release #285 from eea/develop [ichim-david - [`c966940`](https://github.com/eea/volto-eea-design-system/commit/c96694005e2d4160876f6a900db13940d42266d5)]
111
+ - bump next version to alpha 13 [David Ichim - [`897e906`](https://github.com/eea/volto-eea-design-system/commit/897e9069062282f1b5cd8d86a02b8e54c40a4690)]
112
+ - Back to dev [Alin Voinea - [`5780dc7`](https://github.com/eea/volto-eea-design-system/commit/5780dc7abeb24da5e77b043a34593ff7a44f350d)]
113
+ ### [1.0.0-alpha.12](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.11...1.0.0-alpha.12) - 24 January 2023
114
+
115
+ #### :rocket: New Features
116
+
117
+ - feat(card, colors): visited color change and title on image option for cards #283 from eea/develop [ichim-david - [`e638ee6`](https://github.com/eea/volto-eea-design-system/commit/e638ee6b77885fd5989179aa9e6532e46e475247)]
118
+
119
+ #### :bug: Bug Fixes
120
+
121
+ - fix(mobile menu): sub links when an accordion section is active [David Ichim - [`bb3be81`](https://github.com/eea/volto-eea-design-system/commit/bb3be81416340ad0e3e992cd4e75642fc50f8ad3)]
122
+
123
+ #### :nail_care: Enhancements
124
+
125
+ - change(card): title padding value for a more balance look [David Ichim - [`74b6556`](https://github.com/eea/volto-eea-design-system/commit/74b65563d973eb9c6afc534935e253f2705fe9ee)]
126
+ - change(card): added image card section, tweaked mobile heading size [David Ichim - [`0f879e1`](https://github.com/eea/volto-eea-design-system/commit/0f879e15d22ae066f020d8188ef3e355c27d016c)]
127
+ - change(cards): moved image gradient overlay to a mixin.less file [David Ichim - [`8b4928a`](https://github.com/eea/volto-eea-design-system/commit/8b4928a87bfe5fae6f64c93d7c8f1f7a3045816c)]
128
+ - change(card): removed uppercase transform from title on image [David Ichim - [`2948ae1`](https://github.com/eea/volto-eea-design-system/commit/2948ae16f748911929910ac53d1e0acf96952317)]
129
+ - change(cards): added image for all storybook card examples [David Ichim - [`3f19413`](https://github.com/eea/volto-eea-design-system/commit/3f194130bb6fb7b9ab04a7e1305f26fa135c23d2)]
130
+ - change(card): implement title on image within image section [David Ichim - [`ff6cc60`](https://github.com/eea/volto-eea-design-system/commit/ff6cc600978355e04dde704d014d2cbe27df1298)]
131
+ - change(colors, Docusaurus): Visited link colour change and thematic logo replacement #278 from eea/refactor-visited-link [ichim-david - [`f82d978`](https://github.com/eea/volto-eea-design-system/commit/f82d9781cc3b34443f181565c2ec1892d534f8e2)]
132
+ - change(banner): restored label value of metadata field when type isn't date [David Ichim - [`571a4f2`](https://github.com/eea/volto-eea-design-system/commit/571a4f27fe73d0465b6482f70dd70b2dc47dffe8)]
133
+ - refactor(docusaurus): applied image naming convention [Giorgos Stamatis - [`ee7bc29`](https://github.com/eea/volto-eea-design-system/commit/ee7bc290084e198f9f94e40fbf44c6d9cb19d1ba)]
134
+ - refactor(card): Update titles value and size [Antonis Tarantilis - [`c35ad5c`](https://github.com/eea/volto-eea-design-system/commit/c35ad5c76caa00556f8a501d2e7d516464790dc4)]
135
+ - refactor(storybook): visited link variables [Dora Anastasiou - [`b209b2f`](https://github.com/eea/volto-eea-design-system/commit/b209b2f7703641926c6d4b1f7162eef39b2a1ad8)]
136
+ - refactor(Card): add image with title css [Antonis Tarantilis - [`6e6e63e`](https://github.com/eea/volto-eea-design-system/commit/6e6e63e2362a27b0bbf4b8dd968f11a0dc87da2a)]
137
+ - refactor(Card): create card template for stories [Antonis Tarantilis - [`2fa77f3`](https://github.com/eea/volto-eea-design-system/commit/2fa77f3f93935dd01cd5e3d77437fe8dc03721da)]
138
+
139
+ #### :house: Documentation changes
140
+
141
+ - docs(colors): visited link update [Dora Anastasiou - [`ece77fe`](https://github.com/eea/volto-eea-design-system/commit/ece77fec130de1d9d8014d40e7da975bf57061ee)]
142
+
143
+ #### :hammer_and_wrench: Others
144
+
145
+ - change version to alpha 12 instead of 1 final [David Ichim - [`3225025`](https://github.com/eea/volto-eea-design-system/commit/32250253f5d7fe9f01126136ad86b8a4f2f5c700)]
146
+ - feature(card): new card variation with title on top of image #267 from eea/title-on-image-card [ichim-david - [`2c0ca95`](https://github.com/eea/volto-eea-design-system/commit/2c0ca95700bb162bc1273c83f2fc4f591de8dcf0)]
147
+ - fix typos in footer gradient variables [David Ichim - [`4006640`](https://github.com/eea/volto-eea-design-system/commit/40066405d97af838e986370101371a8162029e02)]
148
+ - Back to dev [Alin Voinea - [`477d997`](https://github.com/eea/volto-eea-design-system/commit/477d997513ef5152ab98e080ad07f927b5869705)]
149
+ ### [1.0.0-alpha.11](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.10...1.0.0-alpha.11) - 17 January 2023
150
+
151
+ #### :rocket: New Features
152
+
153
+ - feat(docusaurus): Header and footer elements section #277 [ichim-david - [`0df271c`](https://github.com/eea/volto-eea-design-system/commit/0df271c4c79bd8a24750cfe44d69f32cb04a1b63)]
154
+
155
+ #### :bug: Bug Fixes
156
+
157
+ - fix(banner): storybook date input and simplified gradient opacity [David Ichim - [`7674d76`](https://github.com/eea/volto-eea-design-system/commit/7674d767bb770342828d6bea6953ce45b823943f)]
158
+ - fix(banner): re-added title class on banner title [David Ichim - [`6d15799`](https://github.com/eea/volto-eea-design-system/commit/6d157994934c3da9af4e3dd37844f910bddf8377)]
159
+
160
+ #### :nail_care: Enhancements
161
+
162
+ - refactor(banner): sync storybook and Volto component #275 from eea/sync-page-banner-theme [ichim-david - [`4331fb4`](https://github.com/eea/volto-eea-design-system/commit/4331fb4a6d5744e7d7d6a001bca91265a22587fd)]
163
+ - change(banner): removed margin from title [David Ichim - [`17e592c`](https://github.com/eea/volto-eea-design-system/commit/17e592c4f3fd16a78069af50574e2ac608166a0f)]
164
+ - refactor(banner): sync storybook and Volto component [nileshgulia1 - [`c9087cc`](https://github.com/eea/volto-eea-design-system/commit/c9087cc8edc3fb27e0b96b509354861ec306f22a)]
165
+
166
+ #### :house: Documentation changes
167
+
168
+ - docs(footer): updates on header elements [Dora Anastasiou - [`b41c550`](https://github.com/eea/volto-eea-design-system/commit/b41c550475dc5a2eefcad5d75439601d079613e2)]
169
+ - docs(footer): add elements anatomy [Dora Anastasiou - [`d9f0872`](https://github.com/eea/volto-eea-design-system/commit/d9f0872f93a6f7572f798b2c001d3af00eb282e3)]
170
+
171
+ #### :hammer_and_wrench: Others
172
+
173
+ - Release 1.0.0-alpha.11 [Alin Voinea - [`07e8f85`](https://github.com/eea/volto-eea-design-system/commit/07e8f858b0bdeaa6a348c0bfc2b785f26017e1ea)]
174
+ - renamed image elements as requested in review [David Ichim - [`8541fb6`](https://github.com/eea/volto-eea-design-system/commit/8541fb6739d3c935ed8d44a220114546b2aef682)]
175
+ - update(gradient): use 8deg angle [nileshgulia1 - [`6fd597d`](https://github.com/eea/volto-eea-design-system/commit/6fd597d8d7a83fdf8a27939e4c69dfc3975b6a81)]
176
+ - update(gradiant): make it 0deg [nileshgulia1 - [`1bb2696`](https://github.com/eea/volto-eea-design-system/commit/1bb2696375eef233b509e27d9d464b8343421430)]
177
+ - remove(banner-gradiant): image gradiant in favour of text [nileshgulia1 - [`1b58520`](https://github.com/eea/volto-eea-design-system/commit/1b58520490be5e17ea4ce6fc98329d467dad3960)]
178
+ - remove(comment) referencing old verison of title [nileshgulia1 - [`4226d42`](https://github.com/eea/volto-eea-design-system/commit/4226d42e34b119e057cf4e9878b6a99172cb976a)]
179
+ - add(banner): banner title css [nileshgulia1 - [`d003247`](https://github.com/eea/volto-eea-design-system/commit/d0032474d2b57eb63a4b50a882ced2ee743a48e6)]
180
+ ### [1.0.0-alpha.10](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.9...1.0.0-alpha.10) - 13 January 2023
181
+
182
+ #### :bug: Bug Fixes
183
+
184
+ - fix(subsite): Fix logo size on subsite section #279 from eea/subsite-fixes [ichim-david - [`8f6cf94`](https://github.com/eea/volto-eea-design-system/commit/8f6cf94811dbebc2081c0ca812570a72dd977b06)]
185
+ - fix(subsite): Fix logo size on subsite section [kreafox - [`65fff54`](https://github.com/eea/volto-eea-design-system/commit/65fff54503a9ace573dc7198f6bedb372e65d211)]
186
+ - fix(mega-menu): show sub grid only if there are children [David Ichim - [`ddfbd82`](https://github.com/eea/volto-eea-design-system/commit/ddfbd82aab2be723ae230d703f72a8cd489f17d8)]
187
+
188
+ #### :hammer_and_wrench: Others
189
+
190
+ - Release 1.0.0-alpha.10 [Alin Voinea - [`7014d08`](https://github.com/eea/volto-eea-design-system/commit/7014d080ce114bd0bc039abeecbd7229333b0971)]
191
+ - Add variable definitions [kreafox - [`293fe65`](https://github.com/eea/volto-eea-design-system/commit/293fe65e2f24e6290e1286229169a77f9be4750e)]
192
+ - Back to dev [Alin Voinea - [`31d4616`](https://github.com/eea/volto-eea-design-system/commit/31d461662b9184a7bbe190e86f3c47fab39229fe)]
7
193
  ### [1.0.0-alpha.9](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.8...1.0.0-alpha.9) - 28 December 2022
8
194
 
9
195
  #### :nail_care: Enhancements
@@ -12,7 +198,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
12
198
 
13
199
  #### :hammer_and_wrench: Others
14
200
 
15
- - Release alpha 9 [Alin Voinea - [`8d30ef7`](https://github.com/eea/volto-eea-design-system/commit/8d30ef7a14d1476c88ab5c004247c5f4d90f6cd6)]
16
201
  - Show document and folder content-type in Navigation listing [andreiggr - [`8471db3`](https://github.com/eea/volto-eea-design-system/commit/8471db3b3d555e8602f1076d0f96a2ba38a12247)]
17
202
  - Context nav title link to # [andreiggr - [`a27a6b7`](https://github.com/eea/volto-eea-design-system/commit/a27a6b78bcda0eb6037f73f1d36b06e00e3ffc52)]
18
203
  - Default title is text, custom title is link [andreiggr - [`1ae95b0`](https://github.com/eea/volto-eea-design-system/commit/1ae95b05b67423121566448c6b0cededca4b2b1d)]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "1.0.0-alpha.9",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "@eeacms/volto-eea-design-system: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,22 +1,68 @@
1
1
  import React from 'react';
2
2
  import { Container, Icon, Button, Grid } from 'semantic-ui-react';
3
3
  import PropTypes from 'prop-types';
4
+ import { formatDate } from '@plone/volto/helpers/Utils/Date';
5
+ import config from '@plone/volto/registry';
4
6
 
5
7
  Banner.propTypes = {
6
8
  title: PropTypes.string,
7
9
  image: PropTypes.bool,
8
10
  };
9
11
 
10
- function Banner({ image_url, image, children }) {
12
+ const socialPlatforms = {
13
+ facebook: {
14
+ shareLink: (url) => `https://facebook.com/sharer.php?u=${url}`,
15
+ },
16
+ twitter: {
17
+ shareLink: (url) => `https://www.twitter.com/share?url=${url}`,
18
+ },
19
+ linkedin: {
20
+ shareLink: (url) =>
21
+ `https://www.linkedin.com/sharing/share-offsite/?url=${url}`,
22
+ },
23
+ reddit: {
24
+ shareLink: (url, title) => `https://reddit.com/submit?url=${url}`,
25
+ },
26
+ };
27
+
28
+ export const getImageSource = (image) => {
29
+ if (image?.download) return image.download;
30
+ if (image?.encoding)
31
+ return `data:${image['content-type']};${image['encoding']},${image['data']}`;
32
+ return null;
33
+ };
34
+
35
+ export const sharePage = (url, platform) => {
36
+ if (!socialPlatforms[platform]) return;
37
+ const link = document.createElement('a');
38
+ link.setAttribute('href', socialPlatforms[platform].shareLink(url));
39
+ link.setAttribute('target', '_blank');
40
+ link.setAttribute('rel', 'noreferrer');
41
+ link.click();
42
+ };
43
+
44
+ function Banner({ image, metadata, properties, children, ...rest }) {
45
+ if (image) {
46
+ //extract Lead image from page content.
47
+ const content = metadata || properties;
48
+ const imageUrl = getImageSource(content['image']) ?? image;
49
+ return (
50
+ <div className="eea banner">
51
+ <div
52
+ className={imageUrl ? 'image' : ''}
53
+ style={imageUrl ? { backgroundImage: `url(${imageUrl})` } : {}}
54
+ >
55
+ <div className="gradient">
56
+ <Container>{children}</Container>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ );
61
+ }
11
62
  return (
12
63
  <div className="eea banner">
13
- <div
14
- className={image ? 'image' : ''}
15
- style={image ? { backgroundImage: `url(${image_url})` } : {}}
16
- >
17
- <div className="gradient">
18
- <Container>{children}</Container>
19
- </div>
64
+ <div className="gradient">
65
+ <Container>{children}</Container>
20
66
  </div>
21
67
  </div>
22
68
  );
@@ -48,12 +94,30 @@ Banner.Content = ({ children, actions }) => {
48
94
  );
49
95
  };
50
96
 
51
- Banner.Title = ({ children }) => <p className="title">{children}</p>;
97
+ Banner.Title = ({ children }) => {
98
+ return <h1 className="documentFirstHeading title">{children}</h1>;
99
+ };
52
100
  Banner.Subtitle = ({ children }) => <p className="subtitle">{children}</p>;
53
101
  Banner.Metadata = ({ children }) => <p className="metadata">{children}</p>;
54
102
 
55
103
  Banner.MetadataField = ({ hidden, type = 'text', label, value, title }) => {
104
+ const locale = config.settings.dateLocale || 'en-gb';
56
105
  if (hidden || !value) return '';
106
+ if (type === 'date' && value)
107
+ return (
108
+ <span className={`field ${type}`} title={title?.replace('{}', value)}>
109
+ {label}{' '}
110
+ {formatDate({
111
+ date: value,
112
+ format: {
113
+ year: 'numeric',
114
+ month: 'short',
115
+ day: '2-digit',
116
+ },
117
+ locale: locale,
118
+ })}
119
+ </span>
120
+ );
57
121
  return (
58
122
  <span className={`field ${type}`}>
59
123
  {label && <>{label}: </>}
@@ -74,7 +74,7 @@ export default {
74
74
  };
75
75
 
76
76
  const Template = (args) => (
77
- <Banner {...args} image_url={args.image ? imgUrl : null}>
77
+ <Banner {...args} image={args.image ? imgUrl : null}>
78
78
  <Banner.Content
79
79
  actions={
80
80
  <>
@@ -143,8 +143,8 @@ Default.args = {
143
143
  subtitle: 'Lorem ipsum dolor',
144
144
  metadata: [
145
145
  { hidden: false, value: 'Briefing', type: 'type' },
146
- { hidden: false, value: 'Published Date', type: 'date' },
147
- { hidden: false, value: 'Modified Date', type: 'date' },
146
+ { hidden: false, label: 'Published', value: '25 Nov 2022', type: 'date' },
147
+ { hidden: false, label: 'Modified', value: '29 Nov 2022', type: 'date' },
148
148
  { hidden: false, value: '5 min read', type: '' },
149
149
  ],
150
150
  image: true,