@eeacms/volto-eea-design-system 0.8.1 → 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.
- package/CHANGELOG.md +1879 -1862
- package/mockups/EEA component library.fig +0 -0
- package/package.json +1 -1
- package/src/ui/ContextNavigation/ContextNavigation.stories.jsx +137 -58
- package/src/ui/Header/Header.jsx +12 -2
- package/theme/themes/eea/elements/button.overrides +3 -3
- package/theme/themes/eea/elements/button.variables +1 -1
- package/theme/themes/eea/extras/contextNavigation.less +66 -59
- package/theme/themes/eea/extras/contextNavigation.variables +41 -0
- package/theme/themes/eea/extras/header.less +107 -34
- package/theme/themes/eea/extras/header.variables +50 -27
- package/theme/themes/eea/globals/site.overrides +15 -0
- package/theme/themes/eea/globals/site.variables +5 -3
- package/theme/themes/eea/views/card.overrides +40 -33
- package/theme/themes/eea/views/card.variables +2 -0
- package/theme/themes/eea/views/statistic.overrides +40 -2
- package/theme/themes/eea/views/statistic.variables +5 -2
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,66 +1,144 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Container, Icon } from 'semantic-ui-react';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
</
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
})}
|
|
59
137
|
</div>
|
|
60
|
-
</
|
|
61
|
-
</
|
|
62
|
-
|
|
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
|
-
|
|
150
|
+
header: 'Navigation',
|
|
151
|
+
sidenavItems: sidenavItems,
|
|
73
152
|
};
|
package/src/ui/Header/Header.jsx
CHANGED
|
@@ -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={
|
|
60
|
+
closeOnBlur={true}
|
|
59
61
|
>
|
|
60
62
|
<Dropdown.Menu role="group">{children}</Dropdown.Menu>
|
|
61
63
|
</Dropdown>
|
|
62
64
|
);
|
|
63
65
|
return (
|
|
64
|
-
<>
|
|
66
|
+
<>
|
|
67
|
+
{isMobile ? (
|
|
68
|
+
<Component mobileText={mobileText} />
|
|
69
|
+
) : isTablet ? (
|
|
70
|
+
<Component mobileText={tabletText} />
|
|
71
|
+
) : (
|
|
72
|
+
<Component />
|
|
73
|
+
)}
|
|
74
|
+
</>
|
|
65
75
|
);
|
|
66
76
|
};
|
|
67
77
|
|
|
@@ -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,
|
|
@@ -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
|
-
|
|
22
|
-
background :
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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:
|
|
13
|
+
@media (max-width: @largeMonitorBreakpoint) {
|
|
31
14
|
.context-navigation {
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
76
|
-
|
|
74
|
+
|
|
75
|
+
.context-navigation .item.level-1 .ui.divider {
|
|
76
|
+
border-bottom: none;
|
|
77
77
|
}
|
|
78
|
-
|
|
79
|
-
|
|
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;
|