@eeacms/volto-eea-design-system 0.2.1

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 (263) hide show
  1. package/.coverage.babel.config.js +13 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
  3. package/.github/ISSUE_TEMPLATE/feature_request.md +50 -0
  4. package/.github/workflows/node.js.yml +59 -0
  5. package/.prettierignore +4 -0
  6. package/.project.eslintrc.js +45 -0
  7. package/.release-it.json +17 -0
  8. package/.storybook/manager.js +15 -0
  9. package/CHANGELOG.md +1025 -0
  10. package/DEVELOP.md +51 -0
  11. package/LICENSE.md +9 -0
  12. package/README.md +196 -0
  13. package/bootstrap +41 -0
  14. package/cypress.json +17 -0
  15. package/jest-addon.config.js +36 -0
  16. package/locales/volto.pot +0 -0
  17. package/mockups/README.md +1 -0
  18. package/package.json +49 -0
  19. package/razzle.extend.js +23 -0
  20. package/src/helpers/index.js +2 -0
  21. package/src/helpers/useClickOutside.js +30 -0
  22. package/src/helpers/usePrevious.js +9 -0
  23. package/src/i18n.js +180 -0
  24. package/src/index.js +6 -0
  25. package/src/semantic.less +262 -0
  26. package/src/ui/Avatar/Avatar.jsx +32 -0
  27. package/src/ui/Avatar/Avatar.stories.jsx +61 -0
  28. package/src/ui/AvatarGrid/AvatarGrid.jsx +49 -0
  29. package/src/ui/AvatarGrid/AvatarGrid.stories.jsx +66 -0
  30. package/src/ui/Banner/Banner.jsx +59 -0
  31. package/src/ui/Banner/Banner.stories.jsx +121 -0
  32. package/src/ui/Blockquote/Blockquote.jsx +16 -0
  33. package/src/ui/Blockquote/Blockquote.stories.jsx +48 -0
  34. package/src/ui/Breadcrumbs/Breadcrumb.stories.jsx +76 -0
  35. package/src/ui/Breadcrumbs/Breadcrumbs.jsx +67 -0
  36. package/src/ui/Breadcrumbs/Breadcrumbs.stories.jsx +30 -0
  37. package/src/ui/Button/Button.stories.jsx +169 -0
  38. package/src/ui/Divider/Divider.jsx +7 -0
  39. package/src/ui/Footer/Contact.jsx +28 -0
  40. package/src/ui/Footer/Footer.jsx +52 -0
  41. package/src/ui/Footer/FooterActions.jsx +22 -0
  42. package/src/ui/Footer/FooterHeader.jsx +10 -0
  43. package/src/ui/Footer/FooterSites.jsx +33 -0
  44. package/src/ui/Footer/Social.jsx +25 -0
  45. package/src/ui/Footer/SubFooter.jsx +9 -0
  46. package/src/ui/FormFieldWrapper/FormFieldWrapper.jsx +51 -0
  47. package/src/ui/Header/Header.jsx +224 -0
  48. package/src/ui/Header/HeaderMenuPopUp.js +79 -0
  49. package/src/ui/Header/HeaderSearchPopUp.js +33 -0
  50. package/src/ui/InpageNavigation/InpageNavigation.jsx +61 -0
  51. package/src/ui/InpageNavigation/InpageNavigation.stories.jsx +166 -0
  52. package/src/ui/KeyContent/KeyContent.jsx +22 -0
  53. package/src/ui/KeyContent/KeyContent.stories.jsx +62 -0
  54. package/src/ui/Loader/Loader.stories.jsx +45 -0
  55. package/src/ui/Logo/Logo.jsx +31 -0
  56. package/src/ui/Popup/Popup.stories.jsx +97 -0
  57. package/src/ui/PublicationCard/PublicationCard.jsx +27 -0
  58. package/src/ui/PublicationCard/PublicationCard.stories.jsx +69 -0
  59. package/src/ui/Pullquote/Pullquote.jsx +44 -0
  60. package/src/ui/Pullquote/Pullquote.stories.jsx +101 -0
  61. package/src/ui/RelatedContent/RelatedContent.jsx +90 -0
  62. package/src/ui/RelatedContent/RelatedContent.stories.jsx +80 -0
  63. package/src/ui/Segment/Segment.stories.jsx +163 -0
  64. package/src/ui/Tag/Tag.jsx +13 -0
  65. package/src/ui/Tag/Tag.stories.jsx +21 -0
  66. package/src/ui/TagList/TagList.jsx +23 -0
  67. package/src/ui/TagList/TagList.stories.jsx +63 -0
  68. package/src/ui/Testimonial/Testimonial.jsx +53 -0
  69. package/src/ui/Testimonial/Testimonial.stories.jsx +51 -0
  70. package/src/ui/Timeline/Timeline.jsx +44 -0
  71. package/src/ui/Timeline/Timeline.stories.jsx +322 -0
  72. package/src/ui/index.js +31 -0
  73. package/templates/eea.hbs +50 -0
  74. package/theme/theme.config +122 -0
  75. package/theme/theme.less +64 -0
  76. package/theme/themes/eea/assets/images/EEA_Logo_Vertical.png +0 -0
  77. package/theme/themes/eea/assets/images/Footer/EEALogo.png +0 -0
  78. package/theme/themes/eea/assets/images/Footer/EULogo.png +0 -0
  79. package/theme/themes/eea/assets/images/Footer/Extras/Logo1.png +0 -0
  80. package/theme/themes/eea/assets/images/Footer/Extras/Logo10.png +0 -0
  81. package/theme/themes/eea/assets/images/Footer/Extras/Logo2.png +0 -0
  82. package/theme/themes/eea/assets/images/Footer/Extras/Logo3.png +0 -0
  83. package/theme/themes/eea/assets/images/Footer/Extras/Logo4.png +0 -0
  84. package/theme/themes/eea/assets/images/Footer/Extras/Logo5.png +0 -0
  85. package/theme/themes/eea/assets/images/Footer/Extras/Logo6.png +0 -0
  86. package/theme/themes/eea/assets/images/Footer/Extras/Logo7.png +0 -0
  87. package/theme/themes/eea/assets/images/Footer/Extras/Logo8.png +0 -0
  88. package/theme/themes/eea/assets/images/Footer/Extras/Logo9.png +0 -0
  89. package/theme/themes/eea/assets/images/Footer/Extras/abstract-visual.svg +32 -0
  90. package/theme/themes/eea/assets/images/Footer/Extras/footervisual.svg +1755 -0
  91. package/theme/themes/eea/assets/images/Footer/Vector1.png +0 -0
  92. package/theme/themes/eea/assets/images/Footer/Vector2.png +0 -0
  93. package/theme/themes/eea/assets/images/Header/EeaLogo.png +0 -0
  94. package/theme/themes/eea/assets/images/Header/Vector.png +0 -0
  95. package/theme/themes/eea/assets/images/Header/close-line.svg +1 -0
  96. package/theme/themes/eea/assets/images/Header/close.png +0 -0
  97. package/theme/themes/eea/assets/images/Header/down-arrow.png +0 -0
  98. package/theme/themes/eea/assets/images/Header/eea-logo.svg +14 -0
  99. package/theme/themes/eea/assets/images/Header/eea.png +0 -0
  100. package/theme/themes/eea/assets/images/Header/eeaIcon.png +0 -0
  101. package/theme/themes/eea/assets/images/Header/global-line.svg +1 -0
  102. package/theme/themes/eea/assets/images/Header/globeIcon.png +0 -0
  103. package/theme/themes/eea/assets/images/Header/hamburgerMenuIcon.png +0 -0
  104. package/theme/themes/eea/assets/images/Header/menu-left-arrow.svg +3 -0
  105. package/theme/themes/eea/assets/images/Header/menu-line.svg +1 -0
  106. package/theme/themes/eea/assets/images/Header/search-line.svg +1 -0
  107. package/theme/themes/eea/assets/images/Header/search.png +0 -0
  108. package/theme/themes/eea/assets/images/Header/searchIcon.png +0 -0
  109. package/theme/themes/eea/assets/images/arrow-down.svg +10 -0
  110. package/theme/themes/eea/assets/images/avatar.png +0 -0
  111. package/theme/themes/eea/assets/images/banner.png +0 -0
  112. package/theme/themes/eea/assets/images/eea-logo.png +0 -0
  113. package/theme/themes/eea/assets/images/eea_icon.png +0 -0
  114. package/theme/themes/eea/assets/images/europe-flag.svg +4 -0
  115. package/theme/themes/eea/assets/images/home-icon.svg +3 -0
  116. package/theme/themes/eea/assets/images/loaderImage.png +0 -0
  117. package/theme/themes/eea/assets/images/mega-menu-arrow.svg +3 -0
  118. package/theme/themes/eea/assets/logo/EEA-Logo-White-2.svg +9 -0
  119. package/theme/themes/eea/assets/logo/EEA-Logo-white.svg +9 -0
  120. package/theme/themes/eea/assets/logo/EIONETLogo.png +0 -0
  121. package/theme/themes/eea/assets/logo/bise.svg +47 -0
  122. package/theme/themes/eea/assets/logo/cca.svg +20 -0
  123. package/theme/themes/eea/assets/logo/copernicus.svg +62 -0
  124. package/theme/themes/eea/assets/logo/energy.svg +77 -0
  125. package/theme/themes/eea/assets/logo/fise.svg +37 -0
  126. package/theme/themes/eea/assets/logo/freshwater.svg +48 -0
  127. package/theme/themes/eea/assets/logo/industry.svg +40 -0
  128. package/theme/themes/eea/assets/logo/insitu.svg +43 -0
  129. package/theme/themes/eea/assets/logo/ipchem.svg +23 -0
  130. package/theme/themes/eea/assets/logo/marine.svg +63 -0
  131. package/theme/themes/eea/collections/breadcrumb.overrides +44 -0
  132. package/theme/themes/eea/collections/breadcrumb.variables +49 -0
  133. package/theme/themes/eea/collections/form.overrides +56 -0
  134. package/theme/themes/eea/collections/form.variables +211 -0
  135. package/theme/themes/eea/collections/grid.overrides +17 -0
  136. package/theme/themes/eea/collections/grid.variables +103 -0
  137. package/theme/themes/eea/collections/menu.overrides +84 -0
  138. package/theme/themes/eea/collections/menu.variables +471 -0
  139. package/theme/themes/eea/collections/message.overrides +34 -0
  140. package/theme/themes/eea/collections/message.variables +142 -0
  141. package/theme/themes/eea/collections/table.overrides +30 -0
  142. package/theme/themes/eea/collections/table.variables +249 -0
  143. package/theme/themes/eea/definitions/elements/icon.less +499 -0
  144. package/theme/themes/eea/elements/button.overrides +199 -0
  145. package/theme/themes/eea/elements/button.variables +405 -0
  146. package/theme/themes/eea/elements/container.overrides +98 -0
  147. package/theme/themes/eea/elements/container.variables +66 -0
  148. package/theme/themes/eea/elements/divider.overrides +17 -0
  149. package/theme/themes/eea/elements/divider.variables +53 -0
  150. package/theme/themes/eea/elements/flag.overrides +1235 -0
  151. package/theme/themes/eea/elements/flag.variables +13 -0
  152. package/theme/themes/eea/elements/header.overrides +205 -0
  153. package/theme/themes/eea/elements/header.variables +151 -0
  154. package/theme/themes/eea/elements/icon.overrides +5589 -0
  155. package/theme/themes/eea/elements/icon.variables +95 -0
  156. package/theme/themes/eea/elements/image.overrides +3 -0
  157. package/theme/themes/eea/elements/image.variables +44 -0
  158. package/theme/themes/eea/elements/input.overrides +83 -0
  159. package/theme/themes/eea/elements/input.variables +104 -0
  160. package/theme/themes/eea/elements/label.overrides +49 -0
  161. package/theme/themes/eea/elements/label.variables +267 -0
  162. package/theme/themes/eea/elements/list.overrides +28 -0
  163. package/theme/themes/eea/elements/list.variables +233 -0
  164. package/theme/themes/eea/elements/loader.overrides +3 -0
  165. package/theme/themes/eea/elements/loader.variables +73 -0
  166. package/theme/themes/eea/elements/placeholder.overrides +3 -0
  167. package/theme/themes/eea/elements/placeholder.variables +55 -0
  168. package/theme/themes/eea/elements/rail.overrides +3 -0
  169. package/theme/themes/eea/elements/rail.variables +34 -0
  170. package/theme/themes/eea/elements/reveal.overrides +3 -0
  171. package/theme/themes/eea/elements/reveal.variables +18 -0
  172. package/theme/themes/eea/elements/segment.overrides +8 -0
  173. package/theme/themes/eea/elements/segment.variables +154 -0
  174. package/theme/themes/eea/elements/step.overrides +18 -0
  175. package/theme/themes/eea/elements/step.variables +130 -0
  176. package/theme/themes/eea/extras/avatar.less +97 -0
  177. package/theme/themes/eea/extras/avatar.variables +34 -0
  178. package/theme/themes/eea/extras/avatarGrid.less +43 -0
  179. package/theme/themes/eea/extras/avatarGrid.variables +20 -0
  180. package/theme/themes/eea/extras/banner.less +213 -0
  181. package/theme/themes/eea/extras/banner.variables +77 -0
  182. package/theme/themes/eea/extras/blockquote.less +89 -0
  183. package/theme/themes/eea/extras/blockquote.variables +35 -0
  184. package/theme/themes/eea/extras/custom.overrides +0 -0
  185. package/theme/themes/eea/extras/custom.variables +0 -0
  186. package/theme/themes/eea/extras/divider.less +14 -0
  187. package/theme/themes/eea/extras/divider.variables +9 -0
  188. package/theme/themes/eea/extras/footer.less +273 -0
  189. package/theme/themes/eea/extras/footer.variables +109 -0
  190. package/theme/themes/eea/extras/header.less +691 -0
  191. package/theme/themes/eea/extras/header.variables +149 -0
  192. package/theme/themes/eea/extras/inpageNavigation.less +57 -0
  193. package/theme/themes/eea/extras/inpageNavigation.variables +30 -0
  194. package/theme/themes/eea/extras/keyContent.less +36 -0
  195. package/theme/themes/eea/extras/keyContent.variables +18 -0
  196. package/theme/themes/eea/extras/main.overrides +31 -0
  197. package/theme/themes/eea/extras/main.variables +33 -0
  198. package/theme/themes/eea/extras/publicationCard.less +62 -0
  199. package/theme/themes/eea/extras/publicationCard.variables +24 -0
  200. package/theme/themes/eea/extras/pullquote.less +76 -0
  201. package/theme/themes/eea/extras/pullquote.variables +34 -0
  202. package/theme/themes/eea/extras/select.overrides +0 -0
  203. package/theme/themes/eea/extras/select.variables +0 -0
  204. package/theme/themes/eea/extras/tag.less +37 -0
  205. package/theme/themes/eea/extras/tag.variables +22 -0
  206. package/theme/themes/eea/extras/tagList.less +50 -0
  207. package/theme/themes/eea/extras/tagList.variables +13 -0
  208. package/theme/themes/eea/extras/testimonial.less +28 -0
  209. package/theme/themes/eea/extras/testimonial.variables +13 -0
  210. package/theme/themes/eea/extras/timeline.less +114 -0
  211. package/theme/themes/eea/extras/timeline.variables +40 -0
  212. package/theme/themes/eea/globals/reset.overrides +454 -0
  213. package/theme/themes/eea/globals/reset.variables +6 -0
  214. package/theme/themes/eea/globals/site.overrides +27 -0
  215. package/theme/themes/eea/globals/site.variables +1135 -0
  216. package/theme/themes/eea/modules/accordion.overrides +83 -0
  217. package/theme/themes/eea/modules/accordion.variables +114 -0
  218. package/theme/themes/eea/modules/chatroom.overrides +3 -0
  219. package/theme/themes/eea/modules/chatroom.variables +3 -0
  220. package/theme/themes/eea/modules/checkbox.overrides +67 -0
  221. package/theme/themes/eea/modules/checkbox.variables +194 -0
  222. package/theme/themes/eea/modules/dimmer.overrides +3 -0
  223. package/theme/themes/eea/modules/dimmer.variables +58 -0
  224. package/theme/themes/eea/modules/dropdown.overrides +53 -0
  225. package/theme/themes/eea/modules/dropdown.variables +390 -0
  226. package/theme/themes/eea/modules/embed.overrides +3 -0
  227. package/theme/themes/eea/modules/embed.variables +53 -0
  228. package/theme/themes/eea/modules/modal.overrides +3 -0
  229. package/theme/themes/eea/modules/modal.variables +193 -0
  230. package/theme/themes/eea/modules/nag.overrides +3 -0
  231. package/theme/themes/eea/modules/nag.variables +74 -0
  232. package/theme/themes/eea/modules/popup.overrides +83 -0
  233. package/theme/themes/eea/modules/popup.variables +153 -0
  234. package/theme/themes/eea/modules/progress.overrides +3 -0
  235. package/theme/themes/eea/modules/progress.variables +113 -0
  236. package/theme/themes/eea/modules/rating.overrides +74 -0
  237. package/theme/themes/eea/modules/rating.variables +103 -0
  238. package/theme/themes/eea/modules/search.overrides +3 -0
  239. package/theme/themes/eea/modules/search.variables +163 -0
  240. package/theme/themes/eea/modules/shape.overrides +3 -0
  241. package/theme/themes/eea/modules/shape.variables +40 -0
  242. package/theme/themes/eea/modules/sidebar.overrides +3 -0
  243. package/theme/themes/eea/modules/sidebar.variables +45 -0
  244. package/theme/themes/eea/modules/sticky.overrides +3 -0
  245. package/theme/themes/eea/modules/sticky.variables +7 -0
  246. package/theme/themes/eea/modules/tab.overrides +13 -0
  247. package/theme/themes/eea/modules/tab.variables +17 -0
  248. package/theme/themes/eea/modules/transition.overrides +1087 -0
  249. package/theme/themes/eea/modules/transition.variables +10 -0
  250. package/theme/themes/eea/modules/video.overrides +3 -0
  251. package/theme/themes/eea/modules/video.variables +16 -0
  252. package/theme/themes/eea/views/ad.overrides +3 -0
  253. package/theme/themes/eea/views/ad.variables +13 -0
  254. package/theme/themes/eea/views/card.overrides +73 -0
  255. package/theme/themes/eea/views/card.variables +237 -0
  256. package/theme/themes/eea/views/comment.overrides +3 -0
  257. package/theme/themes/eea/views/comment.variables +98 -0
  258. package/theme/themes/eea/views/feed.overrides +3 -0
  259. package/theme/themes/eea/views/feed.variables +141 -0
  260. package/theme/themes/eea/views/item.overrides +8 -0
  261. package/theme/themes/eea/views/item.variables +157 -0
  262. package/theme/themes/eea/views/statistic.overrides +19 -0
  263. package/theme/themes/eea/views/statistic.variables +105 -0
package/DEVELOP.md ADDED
@@ -0,0 +1,51 @@
1
+ # volto-eea-design-system
2
+
3
+ ## Develop
4
+
5
+ Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
6
+
7
+ 1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`
8
+
9
+ npm install -g yo @plone/generator-volto mrs-developer
10
+
11
+ 1. Create new volto app
12
+
13
+ yo @plone/volto my-volto-project --addon @eeacms/volto-eea-design-system --skip-install
14
+ cd my-volto-project
15
+
16
+ 1. Add the following to `mrs.developer.json`:
17
+
18
+ {
19
+ "volto-eea-design-system": {
20
+ "url": "https://github.com/eea/volto-eea-design-system.git",
21
+ "package": "@eeacms/volto-eea-design-system",
22
+ "branch": "develop",
23
+ "path": "src"
24
+ }
25
+ }
26
+
27
+ 1. Install
28
+
29
+ yarn develop
30
+ yarn
31
+
32
+ 1. Start backend
33
+
34
+ docker pull plone
35
+ docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
36
+
37
+ ...wait for backend to setup and start - `Ready to handle requests`:
38
+
39
+ docker logs -f plone
40
+
41
+ ...you can also check http://localhost:8080/Plone
42
+
43
+ 1. Start frontend
44
+
45
+ yarn start
46
+
47
+ 1. Go to http://localhost:3000
48
+
49
+ 1. Happy hacking!
50
+
51
+ cd src/addons/volto-eea-design-system/
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 European Environment Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,196 @@
1
+ # volto-eea-design-system
2
+
3
+ [![Releases](https://img.shields.io/github/v/release/eea/volto-eea-design-system)](https://github.com/eea/volto-eea-design-system/releases)
4
+
5
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-eea-design-system%2Fmaster&subject=master)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-eea-design-system/job/master/display/redirect)
6
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-master&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-master)
7
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-master&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-master)
8
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-master&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-master)
9
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-master&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-master)
10
+
11
+ [![Pipeline](https://ci.eionet.europa.eu/buildStatus/icon?job=volto-addons%2Fvolto-eea-design-system%2Fdevelop&subject=develop)](https://ci.eionet.europa.eu/view/Github/job/volto-addons/job/volto-eea-design-system/job/develop/display/redirect)
12
+ [![Lines of Code](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-develop&metric=ncloc)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-develop)
13
+ [![Coverage](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-develop&metric=coverage)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-develop)
14
+ [![Bugs](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-develop&metric=bugs)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-develop)
15
+ [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-eea-design-system-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-eea-design-system-develop)
16
+
17
+
18
+ [Volto](https://github.com/plone/volto) EEA Design System
19
+
20
+ ## Features
21
+
22
+ This package provides the following features:
23
+
24
+ 1. A Semantic UI theme
25
+ 2. A repository for the design system source files and mockups
26
+ 3. A website to showcase the design system
27
+
28
+ ## Getting started
29
+
30
+ ### Try volto-eea-design-system with Docker
31
+
32
+ 1. Get the latest Docker images
33
+
34
+ ```
35
+ docker pull plone
36
+ docker pull plone/volto
37
+ ```
38
+
39
+ 2. Start Plone backend
40
+ ```
41
+ docker run -v $(pwd)/var:/data -e SITE=Plone -p 8080:8080 -e PROFILES="profile-plone.restapi:blocks" --name eea-plone -it --rm plone fg
42
+ ```
43
+ 3. Wait until you get the following message:
44
+
45
+ ```
46
+ Serving on http://0.0.0.0:8080
47
+ ```
48
+
49
+ 4. Start Volto frontend
50
+
51
+ ```
52
+ docker run -it --rm -p 3000:3000 --link eea-plone -e ADDONS="@eeacms/volto-eea-design-system" plone/volto
53
+ ```
54
+
55
+ 5. Wait until you get the following message:
56
+
57
+ ```
58
+ Volto started at http://localhost:8080
59
+ ```
60
+
61
+ 6. Go to http://localhost:3000, login with admin:admin if you need to edit the site.
62
+
63
+ ### Add volto-eea-design-system to your Volto project
64
+
65
+ 1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
66
+
67
+ 1. Start Volto frontend
68
+
69
+ - If you already have a volto project, just update `package.json`:
70
+
71
+ ```JSON
72
+ "addons": [
73
+ "@eeacms/volto-eea-design-system"
74
+ ],
75
+
76
+ "dependencies": {
77
+ "@eeacms/volto-eea-design-system": "^1.0.0"
78
+ }
79
+ ```
80
+
81
+ - If not, create one:
82
+
83
+ ```
84
+ npm install -g yo @plone/generator-volto
85
+ yo @plone/volto my-volto-project --addon @eeacms/volto-eea-design-system
86
+ cd my-volto-project
87
+ ```
88
+
89
+ 1. Install the new add-ons by updating `package.json` and restart Volto:
90
+
91
+ ```
92
+ yarn
93
+ yarn start
94
+ ```
95
+
96
+ 2. Go to http://localhost:3000
97
+
98
+ 3. Happy editing!
99
+
100
+ ### Try the design system website
101
+
102
+ Checkout the docs found within the [website](https://github.com/eea/volto-eea-design-system/blob/develop/website/README.md) folder
103
+
104
+ ### Try the design system mockups
105
+
106
+ Checkout the docs found within the [mockups](https://github.com/eea/volto-eea-design-system/blob/develop/mockups/README.md) folder
107
+
108
+ ## Release
109
+
110
+ ### Automatic release using Jenkins
111
+
112
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
113
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
114
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
115
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
116
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
117
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
118
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
119
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
120
+
121
+ ### Manual release from the develop branch ( beta release )
122
+
123
+ #### Installation and configuration of release-it
124
+
125
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
126
+
127
+ ```
128
+ npm install -g release-it
129
+ ```
130
+
131
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
132
+
133
+ Release-it is a tool that automates 4 important steps in the release process:
134
+
135
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
136
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
137
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
138
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
139
+
140
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
141
+
142
+ ```
143
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
144
+ ```
145
+
146
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
147
+
148
+ ```
149
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
150
+ ```
151
+
152
+ #### Using release-it tool
153
+
154
+ There are 3 yarn scripts that can be run to do the release
155
+
156
+ ##### yarn release-beta
157
+
158
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
159
+
160
+ ```
161
+ ? Select increment (next version):
162
+ ❯ prepatch (0.1.1-beta.0)
163
+ preminor (0.2.0-beta.0)
164
+ premajor (1.0.0-beta.0)
165
+ Other, please specify...
166
+ ```
167
+
168
+ ##### yarn release-major-beta
169
+
170
+ Same as `yarn release-beta`, but with premajor version pre-selected.
171
+
172
+ ##### yarn release
173
+
174
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
175
+
176
+ #### Important notes
177
+
178
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
179
+
180
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
181
+
182
+
183
+ ## How to contribute
184
+
185
+ See [DEVELOP.md](https://github.com/eea/volto-eea-design-system/blob/develop/DEVELOP.md).
186
+
187
+ ## Copyright and license
188
+
189
+ The Initial Owner of the Original Code is European Environment Agency (EEA).
190
+ All Rights Reserved.
191
+
192
+ See [LICENSE.md](https://github.com/eea/volto-eea-design-system/blob/develop/LICENSE.md) for details.
193
+
194
+ ## Funding
195
+
196
+ [European Environment Agency (EU)](http://eea.europa.eu)
package/bootstrap ADDED
@@ -0,0 +1,41 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const ejs = require('ejs');
4
+
5
+ const currentDir = path.basename(process.cwd());
6
+
7
+ const bootstrap = function (ofile) {
8
+ fs.readFile(ofile, 'utf8', function (err, data) {
9
+ if (err) {
10
+ return console.log(err);
11
+ }
12
+ const result = ejs.render(data, {
13
+ addonName: `@eeacms/${currentDir}`,
14
+ name: currentDir
15
+ });
16
+ const output = ofile.replace('.tpl', '');
17
+ fs.writeFile(output, result, 'utf8', function (err) {
18
+ if (err) {
19
+ return console.log(err);
20
+ }
21
+ });
22
+ if (ofile.includes('.tpl')) {
23
+ fs.unlink(ofile, (err) => {
24
+ if (err) {
25
+ return console.error(err);
26
+ }
27
+ });
28
+ }
29
+ });
30
+ }
31
+
32
+ fs.readdir(".", { withFileTypes: true }, (err, dirents) => {
33
+ const files = dirents
34
+ .filter(dirent => dirent.isFile())
35
+ .map(dirent => dirent.name);
36
+ files.forEach(function (file) {
37
+ if (file != 'bootstrap') {
38
+ bootstrap(file);
39
+ }
40
+ });
41
+ });
package/cypress.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "baseUrl": "http://localhost:3000",
3
+ "viewportWidth": 1280,
4
+ "defaultCommandTimeout": 8888,
5
+ "chromeWebSecurity": false,
6
+ "reporter": "junit",
7
+ "video": true,
8
+ "retries": {
9
+ "runMode": 8,
10
+ "openMode": 0
11
+ },
12
+ "reporterOptions": {
13
+ "mochaFile": "cypress/reports/cypress-[hash].xml",
14
+ "jenkinsMode": true,
15
+ "toConsole": true
16
+ }
17
+ }
@@ -0,0 +1,36 @@
1
+ module.exports = {
2
+ testMatch: ['**/src/addons/**/?(*.)+(spec|test).[jt]s?(x)'],
3
+ collectCoverageFrom: [
4
+ 'src/addons/**/src/**/*.{js,jsx,ts,tsx}',
5
+ '!src/**/*.d.ts',
6
+ ],
7
+ moduleNameMapper: {
8
+ '@plone/volto/cypress': '<rootDir>/node_modules/@plone/volto/cypress',
9
+ '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
+ '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
+ '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
+ '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
+ 'volto-slate/(.*)$': '<rootDir>/src/addons/volto-slate/src/$1',
15
+ '~/(.*)$': '<rootDir>/src/$1',
16
+ 'load-volto-addons':
17
+ '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
18
+ },
19
+ transform: {
20
+ '^.+\\.js(x)?$': 'babel-jest',
21
+ '^.+\\.css$': 'jest-css-modules',
22
+ '^.+\\.less$': 'jest-css-modules',
23
+ '^.+\\.scss$': 'jest-css-modules',
24
+ '^.+\\.(png)$': 'jest-file',
25
+ '^.+\\.(jpg)$': 'jest-file',
26
+ '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
27
+ },
28
+ coverageThreshold: {
29
+ global: {
30
+ branches: 5,
31
+ functions: 5,
32
+ lines: 5,
33
+ statements: 5,
34
+ },
35
+ },
36
+ };
File without changes
@@ -0,0 +1 @@
1
+ ### EEA Design mockups
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@eeacms/volto-eea-design-system",
3
+ "version": "0.2.1",
4
+ "description": "@eeacms/volto-eea-design-system: Volto add-on",
5
+ "main": "src/index.js",
6
+ "author": "European Environment Agency: IDM2 A-Team",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/eea/volto-eea-design-system",
9
+ "keywords": [
10
+ "volto-addon",
11
+ "volto",
12
+ "plone",
13
+ "react"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git@github.com:eea/volto-eea-design-system.git"
18
+ },
19
+ "addons": [
20
+ "@eeacms/volto-corsproxy"
21
+ ],
22
+ "dependencies": {
23
+ "@eeacms/volto-corsproxy": "*",
24
+ "remixicon": "2.5.0"
25
+ },
26
+ "devDependencies": {
27
+ "@cypress/code-coverage": "^3.9.5",
28
+ "babel-plugin-transform-class-properties": "^6.24.1"
29
+ },
30
+ "scripts": {
31
+ "release": "release-it",
32
+ "release-major-beta": "release-it major --preRelease=beta",
33
+ "release-beta": "release-it --preRelease=beta",
34
+ "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
35
+ "test": "make test",
36
+ "test:fix": "make test-update",
37
+ "i18n": "rm -rf build/messages && NODE_ENV=production node src/i18n.js",
38
+ "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
39
+ "stylelint": "../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'",
40
+ "stylelint:overrides": "../../../node_modules/.bin/stylelint --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
41
+ "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
42
+ "prettier": "../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'",
43
+ "prettier:fix": "../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'",
44
+ "lint": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
45
+ "lint:fix": "../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
46
+ "cypress:run": "../../../node_modules/cypress/bin/cypress run",
47
+ "cypress:open": "../../../node_modules/cypress/bin/cypress open"
48
+ }
49
+ }
@@ -0,0 +1,23 @@
1
+ const path = require('path');
2
+ const plugins = (defaultPlugins) => {
3
+ return defaultPlugins;
4
+ };
5
+ const modify = (config, { target, dev }, webpack) => {
6
+ const themeConfigPath = `${__dirname}/theme/theme.config`;
7
+ config.resolve.alias['../../theme.config$'] = themeConfigPath;
8
+ config.resolve.alias['../../theme.config'] = themeConfigPath;
9
+
10
+ const projectRootPath = path.resolve('.');
11
+ const themesPath = `${projectRootPath}/node_modules/@eeacms/volto-eea-design-system/theme/themes`;
12
+
13
+ config.resolve.alias['eea-volto-themes'] = themesPath;
14
+ config.resolve.alias['ui-theme'] = `${themesPath}/eea/`;
15
+ config.resolve.alias['ui-assets'] = `${themesPath}/eea/assets`;
16
+
17
+ return config;
18
+ };
19
+
20
+ module.exports = {
21
+ plugins,
22
+ modify,
23
+ };
@@ -0,0 +1,2 @@
1
+ export useClickOutside from './useClickOutside';
2
+ export usePrevious from './usePrevious';
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib';
3
+
4
+ /**
5
+ * Call the callback when a click happens outside the targetRefs elements
6
+ */
7
+ export default function useClickOutside({ targetRefs = [], callback }) {
8
+ const handleClickOutside = React.useCallback(
9
+ (e) => {
10
+ const isInsideTarget =
11
+ targetRefs.findIndex(
12
+ (nodeRef) =>
13
+ nodeRef.current && doesNodeContainClick(nodeRef.current, e),
14
+ ) > -1;
15
+
16
+ if (isInsideTarget) return;
17
+ callback();
18
+ },
19
+ [callback, targetRefs],
20
+ );
21
+
22
+ React.useLayoutEffect(() => {
23
+ document.addEventListener('mousedown', handleClickOutside, false);
24
+ return () => {
25
+ document.removeEventListener('mousedown', handleClickOutside, false);
26
+ };
27
+ }, [handleClickOutside]);
28
+
29
+ return null;
30
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ export default function usePrevious(value) {
4
+ const ref = React.useRef();
5
+ React.useEffect(() => {
6
+ ref.current = value;
7
+ });
8
+ return ref.current;
9
+ }
package/src/i18n.js ADDED
@@ -0,0 +1,180 @@
1
+ /* eslint no-console: 0 */
2
+ /**
3
+ * i18n script.
4
+ * @module scripts/i18n
5
+ */
6
+
7
+ const { find, keys, map, concat, reduce } = require('lodash');
8
+ const glob = require('glob').sync;
9
+ const fs = require('fs');
10
+ const Pofile = require('pofile');
11
+ const babel = require('@babel/core');
12
+
13
+ /**
14
+ * Extract messages into separate JSON files
15
+ * @function extractMessages
16
+ * @return {undefined}
17
+ */
18
+ function extractMessages() {
19
+ map(glob('src/**/*.js?(x)'), (filename) => {
20
+ babel.transformFileSync(filename, {}, (err) => {
21
+ if (err) {
22
+ console.log(err);
23
+ }
24
+ });
25
+ });
26
+ }
27
+
28
+ /**
29
+ * Get messages from separate JSON files
30
+ * @function getMessages
31
+ * @return {Object} Object with messages
32
+ */
33
+ function getMessages() {
34
+ return reduce(
35
+ concat(
36
+ {},
37
+ ...map(
38
+ // We ignore the existing customized shadowed components ones, since most
39
+ // probably we won't be overriding them
40
+ // If so, we should do it in the config object or somewhere else
41
+ glob('build/messages/src/**/*.json', {
42
+ ignore: 'build/messages/src/customizations/**',
43
+ }),
44
+ (filename) =>
45
+ map(JSON.parse(fs.readFileSync(filename, 'utf8')), (message) => ({
46
+ ...message,
47
+ filename: filename.match(/build\/messages\/src\/(.*).json$/)[1],
48
+ })),
49
+ ),
50
+ ),
51
+ (current, value) => {
52
+ let result = current;
53
+ if (current.id) {
54
+ result = {
55
+ [current.id]: {
56
+ defaultMessage: current.defaultMessage,
57
+ filenames: [current.filename],
58
+ },
59
+ };
60
+ }
61
+
62
+ if (result[value.id]) {
63
+ result[value.id].filenames.push(value.filename);
64
+ } else {
65
+ result[value.id] = {
66
+ defaultMessage: value.defaultMessage,
67
+ filenames: [value.filename],
68
+ };
69
+ }
70
+ return result;
71
+ },
72
+ );
73
+ }
74
+
75
+ /**
76
+ * Convert messages to pot format
77
+ * @function messagesToPot
78
+ * @param {Object} messages Messages
79
+ * @return {string} Formatted pot string
80
+ */
81
+ function messagesToPot(messages) {
82
+ return map(keys(messages).sort(), (key) =>
83
+ [
84
+ ...map(messages[key].filenames, (filename) => `#: ${filename}`),
85
+ `# defaultMessage: ${messages[key].defaultMessage}`,
86
+ `msgid "${key}"`,
87
+ 'msgstr ""',
88
+ ].join('\n'),
89
+ ).join('\n\n');
90
+ }
91
+
92
+ /**
93
+ * Pot header
94
+ * @function potHeader
95
+ * @return {string} Formatted pot header
96
+ */
97
+ function potHeader() {
98
+ return `msgid ""
99
+ msgstr ""
100
+ "Project-Id-Version: Plone\\n"
101
+ "POT-Creation-Date: ${new Date().toISOString()}\\n"
102
+ "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\\n"
103
+ "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\\n"
104
+ "MIME-Version: 1.0\\n"
105
+ "Content-Type: text/plain; charset=utf-8\\n"
106
+ "Content-Transfer-Encoding: 8bit\\n"
107
+ "Plural-Forms: nplurals=1; plural=0;\\n"
108
+ "Language-Code: en\\n"
109
+ "Language-Name: English\\n"
110
+ "Preferred-Encodings: utf-8\\n"
111
+ "Domain: volto\\n"
112
+
113
+ `;
114
+ }
115
+
116
+ /**
117
+ * Format header
118
+ * @function formatHeader
119
+ * @param {Array} comments Array of comments
120
+ * @param {Object} headers Object of header items
121
+ * @return {string} Formatted header
122
+ */
123
+ function formatHeader(comments, headers) {
124
+ return [
125
+ ...map(comments, (comment) => `# ${comment}`),
126
+ 'msgid ""',
127
+ 'msgstr ""',
128
+ ...map(keys(headers), (key) => `"${key}: ${headers[key]}\\n"`),
129
+ '',
130
+ ].join('\n');
131
+ }
132
+
133
+ /**
134
+ * Sync po by the pot file
135
+ * @function syncPoByPot
136
+ * @return {undefined}
137
+ */
138
+ function syncPoByPot() {
139
+ const pot = Pofile.parse(fs.readFileSync('locales/volto.pot', 'utf8'));
140
+
141
+ map(glob('locales/**/*.po'), (filename) => {
142
+ const po = Pofile.parse(fs.readFileSync(filename, 'utf8'));
143
+
144
+ fs.writeFileSync(
145
+ filename,
146
+ `${formatHeader(po.comments, po.headers)}
147
+ ${map(pot.items, (item) => {
148
+ const poItem = find(po.items, { msgid: item.msgid });
149
+ return [
150
+ `${map(item.references, (ref) => `#: ${ref}`).join('\n')}`,
151
+ `msgid "${item.msgid}"`,
152
+ `msgstr "${poItem ? poItem.msgstr : ''}"`,
153
+ ].join('\n');
154
+ }).join('\n\n')}\n`,
155
+ );
156
+ });
157
+ }
158
+
159
+ // Main tasks
160
+ console.log('Extracting messages from source files...');
161
+ extractMessages();
162
+ console.log('Synchronizing messages to pot file...');
163
+ // We only write the pot file if it's really different
164
+ const newPot = `${potHeader()}${messagesToPot(getMessages())}\n`.replace(
165
+ /"POT-Creation-Date:(.*)\\n"/,
166
+ '',
167
+ );
168
+ const oldPot = fs
169
+ .readFileSync('locales/volto.pot', 'utf8')
170
+ .replace(/"POT-Creation-Date:(.*)\\n"/, '');
171
+
172
+ if (newPot !== oldPot) {
173
+ fs.writeFileSync(
174
+ 'locales/volto.pot',
175
+ `${potHeader()}${messagesToPot(getMessages())}\n`,
176
+ );
177
+ }
178
+ console.log('Synchronizing messages to po files...');
179
+ syncPoByPot();
180
+ console.log('done!');
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ const applyConfig = (config) => {
2
+ config.settings.navDepth = 3;
3
+ return config;
4
+ };
5
+
6
+ export default applyConfig;