@eeacms/volto-eea-design-system 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CHANGELOG.md +1879 -1839
  2. package/mockups/EEA component library.fig +0 -0
  3. package/mockups/page-templates/R1 R3 templates.fig +0 -0
  4. package/mockups/page-templates/WISE BISE FISE.fig +0 -0
  5. package/mockups/page-templates/datahub/Data hub updated proposal.fig +0 -0
  6. package/mockups/page-templates/homepage_selected_upd1.fig +0 -0
  7. package/mockups/special-designs/Mega Menu.fig +0 -0
  8. package/mockups/special-designs/New footer.fig +0 -0
  9. package/mockups/special-designs/Search (Final).fig +0 -0
  10. package/mockups/special-designs/Side Navigation.fig +0 -0
  11. package/package.json +1 -1
  12. package/src/ui/ContextNavigation/ContextNavigation.stories.jsx +137 -58
  13. package/src/ui/Header/Header.jsx +12 -2
  14. package/theme/themes/eea/collections/message.overrides +19 -20
  15. package/theme/themes/eea/collections/message.variables +45 -23
  16. package/theme/themes/eea/elements/button.overrides +3 -3
  17. package/theme/themes/eea/elements/button.variables +1 -1
  18. package/theme/themes/eea/extras/contextNavigation.less +66 -59
  19. package/theme/themes/eea/extras/contextNavigation.variables +41 -0
  20. package/theme/themes/eea/extras/footer.less +3 -27
  21. package/theme/themes/eea/extras/footer.variables +4 -5
  22. package/theme/themes/eea/extras/header.less +107 -34
  23. package/theme/themes/eea/extras/header.variables +50 -27
  24. package/theme/themes/eea/globals/site.overrides +15 -0
  25. package/theme/themes/eea/globals/site.variables +27 -23
  26. package/theme/themes/eea/views/card.overrides +40 -33
  27. package/theme/themes/eea/views/card.variables +2 -0
  28. package/theme/themes/eea/views/statistic.overrides +40 -2
  29. package/theme/themes/eea/views/statistic.variables +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "@eeacms/volto-eea-design-system: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,66 +1,144 @@
1
1
  import React from 'react';
2
+ import { Container, Icon } from 'semantic-ui-react';
2
3
 
3
- const Template = (args) => (
4
- <nav className="context-navigation">
5
- <div className="context-navigation-header">Navigation</div>
6
- <div role="list" className="ui list">
7
- <div role="listitem" className="item level-1">
8
- <div className="content">
9
- <a title="" className="contenttype-folder" href="/api/folder1">
10
- Folder1
11
- </a>
4
+ const sidenavItems = [
5
+ {
6
+ '@id': 'Gravida',
7
+ items: [
8
+ {
9
+ '@id': 'Lorem-ipsum-0',
10
+ description: '',
11
+ items: [],
12
+ review_state: null,
13
+ title: 'Item 1',
14
+ url: '/#',
15
+ },
16
+ {
17
+ '@id': 'item-2',
18
+ description: '',
19
+ items: [],
20
+ review_state: null,
21
+ title: 'Item 2',
22
+ url: '/#',
23
+ },
24
+ {
25
+ '@id': 'item-3',
26
+ description: '',
27
+ items: [],
28
+ review_state: null,
29
+ title: 'Item 3',
30
+ url: '/#',
31
+ },
32
+ ],
33
+ review_state: null,
34
+ title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
35
+ url: '/#',
36
+ },
37
+ {
38
+ '@id': 'Signals-2021',
39
+ description: '',
40
+ items: [],
41
+ review_state: null,
42
+ title: 'Signals 2021',
43
+ url: '/#',
44
+ },
45
+ {
46
+ '@id': 'Articles',
47
+ description: '',
48
+ items: [],
49
+ review_state: null,
50
+ title: 'Articles',
51
+ url: '/#',
52
+ },
53
+ {
54
+ '@id': 'Infographics',
55
+ items: [
56
+ {
57
+ '@id': 'Lorem-ipsum-1',
58
+ description: '',
59
+ items: [],
60
+ review_state: null,
61
+ title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
62
+ url: '/#',
63
+ },
64
+ {
65
+ '@id': 'Signals-2021-infographics',
66
+ description: '',
67
+ items: [],
68
+ review_state: null,
69
+ title: 'Signals 2021',
70
+ url: '/#',
71
+ },
72
+ {
73
+ '@id': 'Articles',
74
+ description: '',
75
+ items: [],
76
+ review_state: null,
77
+ title: 'Articles',
78
+ url: '/#',
79
+ },
80
+ {
81
+ '@id': 'Infographics-overview',
82
+ description: '',
83
+ items: [],
84
+ review_state: null,
85
+ title: 'Infographics',
86
+ url: '/#',
87
+ },
88
+ ],
89
+ review_state: null,
90
+ title: 'Infographics',
91
+ url: '/#',
92
+ },
93
+ ];
94
+
95
+ function Template({ ...args }) {
96
+ return (
97
+ <Container>
98
+ <nav className="context-navigation">
99
+ <div className="context-navigation-header">
100
+ <Icon className="ri-menu-2-line" /> {args.header}
12
101
  </div>
13
- </div>
14
- <div role="listitem" className="item level-1">
15
- <div className="content">
16
- <a
17
- title=""
18
- className="contenttype-folder in_path"
19
- href="/api/folder2/folder21"
20
- >
21
- Folder21
22
- </a>
23
- <div className="list">
24
- <div role="listitem" className="item level-2">
25
- <div className="content">
26
- <a
27
- title=""
28
- className="contenttype-document"
29
- href="/api/folder2/folder21/doc211"
30
- >
31
- Doc211
32
- </a>
33
- </div>
34
- </div>
35
- <div role="listitem" className="active item level-2">
36
- <div className="content">
37
- <a
38
- title=""
39
- className="contenttype-document"
40
- href="/api/folder2/folder21/doc211-copy"
41
- >
42
- Doc212
43
- <div className="content active-indicator">
44
- <svg
45
- xmlns="http://www.w3.org/2000/svg"
46
- viewBox="0 0 36 36"
47
- className="icon"
102
+ <div role="list" className="ui list">
103
+ {args.sidenavItems &&
104
+ args.sidenavItems.map((element, index) => {
105
+ return (
106
+ <div role="listitem" className="item level-1">
107
+ <div className="content">
108
+ <a
109
+ title={element.title}
110
+ className="contenttype-folder"
111
+ href={element.url}
48
112
  >
49
- <path
50
- fill-rule="evenodd"
51
- d="M21.293 9.293L22.707 10.707 15.414 18 22.707 25.293 21.293 26.707 12.586 18z"
52
- ></path>
53
- </svg>
113
+ {element.title}
114
+ </a>
115
+ {element.items.length > 0 &&
116
+ element.items.map((subelement, index) => {
117
+ return (
118
+ <div className="list" role="list">
119
+ <div role="listitem" className="item level-2">
120
+ <div className="content">
121
+ <a
122
+ title={subelement.title}
123
+ className="contenttype-document"
124
+ href={subelement.url}
125
+ >
126
+ {subelement.title}
127
+ </a>
128
+ </div>
129
+ </div>
130
+ </div>
131
+ );
132
+ })}
54
133
  </div>
55
- </a>
56
- </div>
57
- </div>
58
- </div>
134
+ </div>
135
+ );
136
+ })}
59
137
  </div>
60
- </div>
61
- </div>
62
- </nav>
63
- );
138
+ </nav>
139
+ </Container>
140
+ );
141
+ }
64
142
 
65
143
  export default {
66
144
  title: 'Components/Navigation portlet',
@@ -69,5 +147,6 @@ export default {
69
147
 
70
148
  export const Default = Template.bind({});
71
149
  Default.args = {
72
- root: 'https://www.eea.europa.eu/',
150
+ header: 'Navigation',
151
+ sidenavItems: sidenavItems,
73
152
  };
@@ -41,10 +41,12 @@ const TopDropdownMenu = ({
41
41
  className,
42
42
  icon,
43
43
  id,
44
+ tabletText,
44
45
  mobileText,
45
46
  text,
46
47
  viewportWidth,
47
48
  }) => {
49
+ const isTablet = viewportWidth < 991;
48
50
  const isMobile = viewportWidth < 767;
49
51
 
50
52
  const Component = ({ mobileText }) => (
@@ -55,13 +57,21 @@ const TopDropdownMenu = ({
55
57
  icon={icon || 'chevron down'}
56
58
  aria-label="dropdown"
57
59
  closeOnChange={false}
58
- closeOnBlur={false}
60
+ closeOnBlur={true}
59
61
  >
60
62
  <Dropdown.Menu role="group">{children}</Dropdown.Menu>
61
63
  </Dropdown>
62
64
  );
63
65
  return (
64
- <>{isMobile ? <Component mobileText={mobileText} /> : <Component />}</>
66
+ <>
67
+ {isMobile ? (
68
+ <Component mobileText={mobileText} />
69
+ ) : isTablet ? (
70
+ <Component mobileText={tabletText} />
71
+ ) : (
72
+ <Component />
73
+ )}
74
+ </>
65
75
  );
66
76
  };
67
77
 
@@ -2,33 +2,32 @@
2
2
  Theme Overrides
3
3
  *******************************/
4
4
 
5
- /* Text size and weight */
6
- .ui.message p {
7
- font-size: @messageFontSize;
5
+ /* Old custom messages | update in form refactoring
6
+
7
+ .field-wrapper .ui.message p {
8
8
  font-weight: @messageFontWeight;
9
9
  }
10
-
11
- /* Text color for non state messages */
12
- .ui.message:not(.success):not(.error):not(.warning):not(.info):not(.negative):not(.positive) {
10
+ .field-wrapper .ui.message:not(.success):not(.error):not(.warning):not(.info):not(.negative):not(.positive) {
13
11
  color: @messageColor;
14
12
  }
15
13
 
16
- /* Align icon next to header */
17
- .ui.icon.message {
14
+ .field-wrapper .ui.icon.message {
18
15
  align-items: @messageItemsAlign;
19
16
  }
20
-
21
- /* Icon margin to align with header text size */
22
- div.ui.icon.message > .icon,
23
- div.ui.icon.message > .icon:not(.close) {
17
+ .field-wrapper div.ui.icon.message > .icon,
18
+ .field-wrapper div.ui.icon.message > .icon:not(.close) {
24
19
  margin: @iconMargin;
20
+ line-height: @iconLineHeight;
25
21
  }
22
+ */
26
23
 
27
- .ui.success.message,
28
- .ui.warning.message,
29
- .ui.error.message,
30
- .ui.info.message,
31
- .ui.positive.message,
32
- .ui.negative.message {
33
- background: @background;
34
- }
24
+ // No background or border for form messages
25
+ .field-wrapper .ui.success.message,
26
+ .field-wrapper .ui.warning.message,
27
+ .field-wrapper .ui.error.message,
28
+ .field-wrapper .ui.info.message,
29
+ .field-wrapper .ui.positive.message,
30
+ .field-wrapper .ui.negative.message {
31
+ background: transparent;
32
+ box-shadow: none;
33
+ }
@@ -2,24 +2,32 @@
2
2
  Message
3
3
  *******************************/
4
4
 
5
+ @messageFontWeight: @bold;
6
+ @messageColor: @black;
7
+ @messageItemsAlign: flex-start;
8
+ @iconLineHeight: 1.29;
9
+ @iconMargin: 0.75rem;
5
10
 
6
11
  /*-------------------
7
12
  Elements
8
13
  --------------------*/
9
14
 
10
15
  @verticalMargin: 1em;
11
- @verticalPadding: 0.5rem;
12
- @horizontalPadding: 0;
16
+ @verticalPadding: 1.5em;
17
+ @verticalPadding: 1em;
18
+ @horizontalPadding: 1.5em;
13
19
  @padding: @verticalPadding @horizontalPadding;
14
- @background: transparent;
20
+ @background: #F8F8F9;
15
21
  @lineHeightOffset: ((@lineHeight - 1em) / 2);
16
- @messageItemsAlign: flex-start;
17
22
 
18
- @borderRadius: @defaultBorderRadius;
19
- @borderWidth: 0;
23
+ @borderRadius: 0;
24
+ @borderWidth: 1px;
20
25
  @borderShadow: 0px 0px 0px @borderWidth @strongBorderColor inset;
21
26
  @shadowShadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
22
- @boxShadow: none;
27
+ @boxShadow:
28
+ @borderShadow,
29
+ @shadowShadow
30
+ ;
23
31
 
24
32
  @transition:
25
33
  opacity @defaultDuration @defaultEasing,
@@ -29,7 +37,7 @@
29
37
  ;
30
38
 
31
39
  /* Header */
32
- @headerFontSize: 0.875rem;
40
+ @headerFontSize: @relativeLarge;
33
41
  @headerFontWeight: @bold;
34
42
  @headerDisplay: block;
35
43
  @headerDistance: 0rem;
@@ -37,11 +45,8 @@
37
45
  @headerParagraphDistance: 0.15em;
38
46
 
39
47
  /* Paragraph */
40
- @messageTextOpacity: 1;
41
- @messageParagraphMargin: 0;
42
- @messageColor: @black;
43
- @messageFontSize: 0.875rem;
44
- @messageFontWeight: @bold;
48
+ @messageTextOpacity: 0.85;
49
+ @messageParagraphMargin: 0.75em;
45
50
 
46
51
  /* List */
47
52
  @listOpacity: 0.85;
@@ -51,7 +56,7 @@
51
56
  @listItemMargin: 0.3em;
52
57
 
53
58
  /* Icon */
54
- @iconDistance: 0.3em;
59
+ @iconDistance: @rem-space-4;
55
60
 
56
61
  /* Close Icon */
57
62
  @closeTopDistance: @verticalPadding - @lineHeightOffset;
@@ -65,9 +70,8 @@
65
70
  --------------------*/
66
71
 
67
72
  /* Icon Message */
68
- @iconMargin: 0.09rem 0.6rem 0 0;
69
- @iconSize: 1rem;
70
- @iconOpacity: 1;
73
+ @iconSize: 2em;
74
+ @iconOpacity: 0.8;
71
75
  @iconContentDistance: 0rem;
72
76
  @iconVerticalAlign: top;
73
77
 
@@ -133,10 +137,28 @@
133
137
  ;
134
138
 
135
139
  /* Warning / Positive / Negative / Info */
136
- @positiveBoxShadow: none;
137
- @negativeBoxShadow: none;
138
- @infoBoxShadow: none;
139
- @warningBoxShadow: none;
140
- @errorBoxShadow: none;
141
- @successBoxShadow: none;
140
+ @positiveBoxShadow:
141
+ 0px 0px 0px @borderWidth @positiveBorderColor inset,
142
+ @shadowShadow
143
+ ;
144
+ @negativeBoxShadow:
145
+ 0px 0px 0px @borderWidth @negativeBorderColor inset,
146
+ @shadowShadow
147
+ ;
148
+ @infoBoxShadow:
149
+ 0px 0px 0px @borderWidth @infoBorderColor inset,
150
+ @shadowShadow
151
+ ;
152
+ @warningBoxShadow:
153
+ 0px 0px 0px @borderWidth @warningBorderColor inset,
154
+ @shadowShadow
155
+ ;
156
+ @errorBoxShadow:
157
+ 0px 0px 0px @borderWidth @errorBorderColor inset,
158
+ @shadowShadow
159
+ ;
160
+ @successBoxShadow:
161
+ 0px 0px 0px @borderWidth @successBorderColor inset,
162
+ @shadowShadow
163
+ ;
142
164
 
@@ -197,7 +197,7 @@ p.ui.button {
197
197
  .ui.inverted.primary.button.active,
198
198
  .ui.inverted.primary.buttons .button:active,
199
199
  .ui.inverted.primary.button:active {
200
- color: @invertedHoveredTextColor;
200
+ color: @invertedHoveredTextColor !important;
201
201
  }
202
202
 
203
203
  .ui.inverted.primary.buttons .button:hover,
@@ -235,7 +235,7 @@ p.ui.button {
235
235
  .ui.inverted.secondary.button.active,
236
236
  .ui.inverted.secondary.buttons .button:active,
237
237
  .ui.inverted.secondary.button:active {
238
- color: @invertedHoveredTextColor;
238
+ color: @invertedHoveredTextColor !important;
239
239
  }
240
240
 
241
241
  .ui.inverted.secondary.buttons .button:hover,
@@ -280,7 +280,7 @@ p.ui.button {
280
280
  .ui.inverted.tertiary.buttons .button:active,
281
281
  .ui.inverted.tertiary.button:active {
282
282
  box-shadow: none !important; // button.less - L:3142
283
- color: @invertedHoveredTextColor;
283
+ color: @invertedHoveredTextColor !important;
284
284
  }
285
285
 
286
286
  .ui.tertiary.buttons .button:hover,
@@ -48,7 +48,7 @@
48
48
  @searchButtonIconLeft: 1.25rem;
49
49
  @searchButtonIconOpacity: 0.625rem;
50
50
 
51
- @verticalMargin: 0em;
51
+ @verticalMargin: 0.25em;
52
52
  @horizontalMargin: 0.25em;
53
53
  @backgroundColor: @silverGray;
54
54
  @backgroundImage: none;
@@ -3,78 +3,85 @@
3
3
 
4
4
  @import (multiple) '../../theme.config';
5
5
 
6
-
7
- // default styles delete
8
- .list .content .list a {
9
- padding-left: 2rem !important;
10
- }
11
- .in_path {
12
- font-weight: bold !important;
13
- }
14
- .list .content .list {
15
- padding-top: 0!important;
16
- padding-bottom: 0!important;
17
- border-top: 1px solid #eee;
18
- border-bottom: 1px solid #eee;
19
- }
20
6
  .context-navigation {
21
- margin-right: 1rem;
22
- background : white;
23
- padding : 0;
24
- max-width : 210px;
25
- box-shadow : 0 0 12px rgba(0, 0, 0, 0.2);
26
- list-style-type: none;
27
- border-radius : 4px;
28
- overflow : hidden;
7
+ max-width : @widescreenSidenavMaxWidth;
8
+ background : @sidenavBackground;
9
+ margin-right : @sidenavMarginRight;
10
+ padding-left : @sidenavPaddingLeft;
11
+ overflow : @sidenavOverflow;
29
12
  }
30
- @media(max-width: 1200px) {
13
+ @media (max-width: @largeMonitorBreakpoint) {
31
14
  .context-navigation {
32
- box-shadow: none;
33
- max-width: 200px;
34
- margin: 2rem auto;
15
+ max-width: @sidenavMaxWidth;
16
+ margin: @sidenavMargin;
35
17
  }
36
18
  }
19
+
37
20
  .context-navigation .item a {
38
- padding : .6rem 1rem;
39
- font-size : 1rem;
40
- font-weight: 400;
41
21
  display : block;
42
- position: relative;
43
- color: #444;
22
+ padding : @sidenavItemPadding;
23
+ font-size : @sidenavItemFontSize;
24
+ font-weight: @sidenavItemFontWeight;
25
+ color : @sidenavItemColor;
26
+
27
+ &:hover {
28
+ background: @sidenavItemHoverBackground;
29
+ color : @sidenavItemHoverColor;
30
+ }
44
31
  }
45
- @media (min-width: 1200px) and (max-width: 1500px) {
46
- .context-navigation .item a {
47
- font-size: .9rem;
32
+
33
+ .context-navigation-header {
34
+ display : flex;
35
+ color : @sidenavHeaderColor;
36
+ font-size : @sidenavHeaderFontSize;
37
+ font-weight: @sidenavHeaderFontWeight;
38
+ padding : @sidenavHeaderPadding;
39
+ border-bottom: @sidenavHeaderBorderBottom;
40
+
41
+ i.icon {
42
+ margin-right: @sidenavHeaderIconMarginRight;
48
43
  }
49
44
  }
50
- .context-navigation .item a:hover {
51
- background: #cc4400 !important;
52
- color : white !important;
45
+
46
+ .context-navigation a.contenttype-folder {
47
+ font-size : @sidenavFolderFontSize;
48
+ font-weight: @sidenavFolderFontWeight;
49
+ padding : @sidenavFolderItemPadding;
50
+ }
51
+
52
+ .context-navigation .ui.list > .item > .content {
53
+ border-bottom: @sidenavContentBorderBottom;
53
54
  }
54
- .context-navigation-header {
55
- color : #333;
56
- font-size : 16px;
57
- font-weight: 500;
58
- padding : 1rem;
59
- box-shadow : 0 4px 19px rgba(0, 0, 1, 0.07);
60
- border-bottom: 3px solid #cc4400;
55
+
56
+ // Hide last border
57
+ .context-navigation .ui.list > .item:last-child > .content {
58
+ border-bottom: none;
61
59
  }
62
- .context-navigation-header a {
63
- color: #444;
64
- font-size: 1.3rem;
65
- font-weight: 100;
60
+
61
+ // Nav custom list
62
+ .context-navigation .ui.list {
63
+ margin: 0;
64
+
65
+ .item,
66
+ .item .list {
67
+ padding: 0;
68
+ }
66
69
  }
67
- .context-navigation .active-indicator {
68
- position: absolute;
69
- right: 0;
70
- top: 50%;
71
- transform: translateY(-50%);
72
- color: #cc4400;
73
- font-weight: bold;
70
+
71
+ .context-navigation .level-1 .item:last-child a {
72
+ margin-bottom: @sidenavLastItemMarginBottom;
74
73
  }
75
- .active-indicator .icon {
76
- height: 30px;
74
+
75
+ .context-navigation .item.level-1 .ui.divider {
76
+ border-bottom: none;
77
77
  }
78
- .context-navigation .item a:hover .active-indicator {
79
- color : white !important;
78
+
79
+ // Active indicator
80
+ .context-navigation .item a.active {
81
+ color: @sidenavItemActiveColor;
82
+ font-weight: @sidenavItemActiveFontWeight;
80
83
  }
84
+
85
+ .context-navigation .item a.active:hover {
86
+ color : @sidenavItemActiveColorHover;
87
+ }
@@ -0,0 +1,41 @@
1
+ /*******************************
2
+ Sidebar Nav
3
+ *******************************/
4
+
5
+ @sidenavMaxWidth: 350px;
6
+ @widescreenSidenavMaxWidth: 300px;
7
+ @sidenavBackground: @grey-0;
8
+ @sidenavMarginRight: @rem-space-4;
9
+ @sidenavPaddingLeft: @rem-space-4;
10
+ @sidenavOverflow: hidden;
11
+ @sidenavMargin: @rem-space-8 auto;
12
+
13
+ /* Header */
14
+ @sidenavHeaderColor: @blue-grey-5;
15
+ @sidenavHeaderFontSize: @font-size-3;
16
+ @sidenavHeaderFontWeight: @font-weight-7;
17
+ @sidenavHeaderPadding: @rem-space-4;
18
+ @sidenavHeaderBorderBottom: @2px solid @blue-grey-5;
19
+ @sidenavHeaderIconMarginRight: @rem-space-4;
20
+
21
+ /* Content */
22
+ @sidenavContentBorderBottom: 1px solid @tertiaryColor;
23
+
24
+ /* Nav item */
25
+ @sidenavItemPadding: @rem-space-2 0 @rem-space-2 @rem-space-8;
26
+ @sidenavItemFontSize: @font-size-1;
27
+ @sidenavItemFontWeight: @font-weight-4;
28
+ @sidenavItemColor: @blue-grey-5;
29
+ @sidenavItemHoverBackground: @blue-grey-5;
30
+ @sidenavItemHoverColor: @grey-0;
31
+ @sidenavLastItemMarginBottom: @rem-space-2;
32
+
33
+ /* Item active */
34
+ @sidenavItemActiveColor: @secondaryColor;
35
+ @sidenavItemActiveFontWeight: @font-weight-7;
36
+ @sidenavItemActiveColorHover: @grey-0;
37
+
38
+ /* Folders - Level 1 */
39
+ @sidenavFolderFontSize: @font-size-2;
40
+ @sidenavFolderFontWeight: @font-weight-7;
41
+ @sidenavFolderItemPadding: @rem-space-4 0 @rem-space-4 @rem-space-4;