@eeacms/volto-eea-design-system 1.0.5 → 1.0.7
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 +77 -16
- package/package.json +1 -1
- package/src/ui/Banner/Banner.jsx +2 -1
- package/src/ui/Breadcrumbs/Breadcrumb.stories.jsx +6 -34
- package/src/ui/Breadcrumbs/Breadcrumbs.jsx +24 -24
- package/src/ui/Card/Card.stories.jsx +6 -2
- package/src/ui/Comment/Comment.stories.js +25 -19
- package/src/ui/ContextNavigation/ContextNavigation.stories.jsx +18 -4
- package/src/ui/DownloadLabeledIcon/DownloadLabeledIcon.stories.jsx +3 -2
- package/src/ui/Form/Button/Button.stories.jsx +1 -1
- package/src/ui/Header/Header.jsx +13 -3
- package/src/ui/Header/Header.stories.js +112 -210
- package/src/ui/Header/HeaderMenuPopUp.js +50 -55
- package/src/ui/InpageNavigation/InpageNavigation.jsx +4 -4
- package/src/ui/InpageNavigation/InpageNavigation.stories.jsx +5 -4
- package/src/ui/Label/Label.stories.js +3 -1
- package/src/ui/LabeledIconGroup/LabeledIconGroup.jsx +5 -4
- package/src/ui/LanguageLabeledIcon/LanguageLabeledIcon.stories.jsx +3 -2
- package/src/ui/Modal/Modal.stories.js +9 -2
- package/src/ui/NewTabLabeledIcon/NewTabLabeledIcon.jsx +9 -3
- package/src/ui/Tag/Tag.stories.jsx +1 -1
- package/theme/plugins.js +41 -0
- package/theme/theme.less +2 -0
- package/theme/themes/eea/assets/logo/eionet.svg +80 -11
- package/theme/themes/eea/collections/breadcrumb.overrides +11 -0
- package/theme/themes/eea/elements/button.overrides +26 -7
- package/theme/themes/eea/elements/button.variables +1 -0
- package/theme/themes/eea/elements/container.overrides +0 -1
- package/theme/themes/eea/elements/label.overrides +12 -8
- package/theme/themes/eea/extras/contextNavigation.less +4 -2
- package/theme/themes/eea/extras/contextNavigation.variables +1 -1
- package/theme/themes/eea/extras/downloadLabeledIcon.less +31 -22
- package/theme/themes/eea/extras/downloadLabeledIcon.variables +16 -14
- package/theme/themes/eea/extras/header.less +8 -0
- package/theme/themes/eea/extras/header.variables +4 -1
- package/theme/themes/eea/extras/inpageNavigation.less +2 -0
- package/theme/themes/eea/extras/inpageNavigation.variables +2 -0
- package/theme/themes/eea/extras/labeledIconGroup.variables +3 -3
- package/theme/themes/eea/extras/languageLabeledIcon.less +28 -20
- package/theme/themes/eea/extras/languageLabeledIcon.variables +18 -16
- package/theme/themes/eea/extras/newTabLabeledIcon.less +21 -15
- package/theme/themes/eea/extras/newTabLabeledIcon.variables +7 -5
- package/theme/themes/eea/globals/site.overrides +4 -1
- package/theme/themes/eea/modules/checkbox.overrides +6 -0
- package/theme/themes/eea/modules/checkbox.variables +3 -3
- package/theme/themes/eea/modules/modal.overrides +13 -0
- package/theme/themes/eea/modules/modal.variables +5 -1
- package/theme/themes/eea/views/card.overrides +9 -0
- package/theme/themes/eea/views/card.variables +6 -2
- package/theme/themes/eea/views/item.overrides +2 -2
|
@@ -6,64 +6,59 @@ import { cloneDeep } from 'lodash';
|
|
|
6
6
|
|
|
7
7
|
import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
|
|
8
8
|
|
|
9
|
-
const createColumns = (item,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const createColumns = (item, renderMenuItem, item_id) => {
|
|
10
|
+
const itemList = item.items.map((item, index) => (
|
|
11
|
+
<React.Fragment key={index}>
|
|
12
|
+
{renderMenuItem(item, {
|
|
13
|
+
className: 'item',
|
|
14
|
+
key: index,
|
|
15
|
+
id: item_id,
|
|
16
|
+
})}
|
|
17
|
+
</React.Fragment>
|
|
18
|
+
));
|
|
19
|
+
return itemList;
|
|
20
|
+
};
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const ItemGrid = ({ sectionTitle, item, columns, renderMenuItem }) => {
|
|
23
|
+
const item_id = item.title.toLowerCase().replaceAll(' ', '-') + '-sub-title';
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
{renderMenuItem(item, { className: 'sub-title', id: item_id })}
|
|
27
|
+
{item.items.length ? (
|
|
28
|
+
<List aria-labelledby={item_id} style={{ columns: `${columns}` }}>
|
|
29
|
+
{createColumns(item, renderMenuItem, item_id)}
|
|
30
|
+
</List>
|
|
31
|
+
) : null}
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const Item = ({ item, icon = false, iconName, renderMenuItem }) => {
|
|
37
|
+
const item_id = item.title.toLowerCase().replaceAll(' ', '-') + '-sub-title';
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
{renderMenuItem(item, {
|
|
41
|
+
className: 'sub-title',
|
|
42
|
+
id: item_id,
|
|
43
|
+
})}
|
|
44
|
+
<List className="menu-list" aria-labelledby={item_id}>
|
|
45
|
+
{item.items.map((listItem, index) => (
|
|
46
|
+
<React.Fragment key={index}>
|
|
47
|
+
{renderMenuItem(
|
|
48
|
+
listItem,
|
|
49
|
+
{
|
|
50
|
+
className: 'item',
|
|
51
|
+
key: index,
|
|
52
|
+
},
|
|
53
|
+
{ children: icon && <Icon className={iconName} /> },
|
|
54
|
+
)}
|
|
26
55
|
</React.Fragment>
|
|
27
56
|
))}
|
|
28
57
|
</List>
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
return column;
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
33
60
|
};
|
|
34
61
|
|
|
35
|
-
const ItemGrid = ({ item, columns, length, renderMenuItem }) => (
|
|
36
|
-
<>
|
|
37
|
-
{renderMenuItem(item, { className: 'sub-title' })}
|
|
38
|
-
{item.items.length ? (
|
|
39
|
-
<Grid columns={columns}>
|
|
40
|
-
{createColumns(item, length, renderMenuItem)}
|
|
41
|
-
</Grid>
|
|
42
|
-
) : null}
|
|
43
|
-
</>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const Item = ({ item, icon = false, iconName, renderMenuItem }) => (
|
|
47
|
-
<>
|
|
48
|
-
{renderMenuItem(item, { className: 'sub-title' })}
|
|
49
|
-
<List className="menu-list">
|
|
50
|
-
{item.items.map((listItem, index) => (
|
|
51
|
-
<React.Fragment key={index}>
|
|
52
|
-
{renderMenuItem(
|
|
53
|
-
listItem,
|
|
54
|
-
{
|
|
55
|
-
className: 'item',
|
|
56
|
-
key: index,
|
|
57
|
-
role: 'listitem',
|
|
58
|
-
},
|
|
59
|
-
{ children: icon && <Icon className={iconName} /> },
|
|
60
|
-
)}
|
|
61
|
-
</React.Fragment>
|
|
62
|
-
))}
|
|
63
|
-
</List>
|
|
64
|
-
</>
|
|
65
|
-
);
|
|
66
|
-
|
|
67
62
|
const Topics = ({ menuItem, renderMenuItem }) => (
|
|
68
63
|
<Grid>
|
|
69
64
|
{menuItem.items.map((section, index) => (
|
|
@@ -75,9 +70,9 @@ const Topics = ({ menuItem, renderMenuItem }) => (
|
|
|
75
70
|
) : (
|
|
76
71
|
<Grid.Column width={9} key={index} id="topics-right-column">
|
|
77
72
|
<ItemGrid
|
|
73
|
+
sectionTitle={section.title}
|
|
78
74
|
item={section}
|
|
79
75
|
columns={4}
|
|
80
|
-
length={10}
|
|
81
76
|
key={index}
|
|
82
77
|
renderMenuItem={renderMenuItem}
|
|
83
78
|
/>
|
|
@@ -95,9 +90,9 @@ const Countries = ({ menuItem, renderMenuItem }) => (
|
|
|
95
90
|
<React.Fragment key={index}>
|
|
96
91
|
{section.title === 'EEA member countries' && (
|
|
97
92
|
<ItemGrid
|
|
93
|
+
sectionTitle={section.title}
|
|
98
94
|
item={section}
|
|
99
95
|
columns={5}
|
|
100
|
-
length={7}
|
|
101
96
|
renderMenuItem={renderMenuItem}
|
|
102
97
|
/>
|
|
103
98
|
)}
|
|
@@ -111,9 +106,9 @@ const Countries = ({ menuItem, renderMenuItem }) => (
|
|
|
111
106
|
{section.title !== 'EEA member countries' && (
|
|
112
107
|
<Grid.Column>
|
|
113
108
|
<ItemGrid
|
|
109
|
+
sectionTitle={section.title}
|
|
114
110
|
item={section}
|
|
115
111
|
columns={2}
|
|
116
|
-
length={3}
|
|
117
112
|
renderMenuItem={renderMenuItem}
|
|
118
113
|
/>
|
|
119
114
|
</Grid.Column>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { Container, Icon } from 'semantic-ui-react';
|
|
2
|
+
import { Container, Button, Icon } from 'semantic-ui-react';
|
|
3
3
|
|
|
4
4
|
class InpageNavigation extends Component {
|
|
5
5
|
constructor(props) {
|
|
@@ -39,11 +39,11 @@ class InpageNavigation extends Component {
|
|
|
39
39
|
render() {
|
|
40
40
|
return (
|
|
41
41
|
<Container>
|
|
42
|
-
<
|
|
42
|
+
<Button
|
|
43
43
|
id="inpage-navigation"
|
|
44
44
|
onClick={this.onInpageNavigationClick}
|
|
45
|
-
role="none"
|
|
46
45
|
className={this.state.removeClass}
|
|
46
|
+
title="Go to top"
|
|
47
47
|
>
|
|
48
48
|
<div className="mobile tablet only">
|
|
49
49
|
<Icon className="ri-arrow-up-s-line" />
|
|
@@ -52,7 +52,7 @@ class InpageNavigation extends Component {
|
|
|
52
52
|
<Icon className="ri-arrow-up-s-line" />
|
|
53
53
|
<div className="text">top</div>
|
|
54
54
|
</div>
|
|
55
|
-
</
|
|
55
|
+
</Button>
|
|
56
56
|
</Container>
|
|
57
57
|
);
|
|
58
58
|
}
|
|
@@ -12,6 +12,7 @@ function InpageNavigationExample() {
|
|
|
12
12
|
return (
|
|
13
13
|
<div id="anchor">
|
|
14
14
|
<Container>
|
|
15
|
+
<h3>Scroll to reveal Inpage Navigation</h3>
|
|
15
16
|
<p>
|
|
16
17
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis
|
|
17
18
|
arcu egestas ultrices mollis. In facilisis, velit vel varius
|
|
@@ -52,7 +53,7 @@ function InpageNavigationExample() {
|
|
|
52
53
|
tempor blandit. Curabitur iaculis risus ac ipsum semper egestas. Sed
|
|
53
54
|
in condimentum lacus. Donec ac efficitur sapien. Integer sit amet
|
|
54
55
|
bibendum urna, eget rhoncus elit. Nam a diam sed dui consectetur
|
|
55
|
-
aliquet.
|
|
56
|
+
aliquet. <a href="/#">Link example</a>
|
|
56
57
|
</p>
|
|
57
58
|
<p>
|
|
58
59
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis
|
|
@@ -80,7 +81,7 @@ function InpageNavigationExample() {
|
|
|
80
81
|
tempor blandit. Curabitur iaculis risus ac ipsum semper egestas. Sed
|
|
81
82
|
in condimentum lacus. Donec ac efficitur sapien. Integer sit amet
|
|
82
83
|
bibendum urna, eget rhoncus elit. Nam a diam sed dui consectetur
|
|
83
|
-
aliquet.
|
|
84
|
+
aliquet. <a href="/#">Link example</a>
|
|
84
85
|
</p>
|
|
85
86
|
<p>
|
|
86
87
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis
|
|
@@ -108,7 +109,7 @@ function InpageNavigationExample() {
|
|
|
108
109
|
tempor blandit. Curabitur iaculis risus ac ipsum semper egestas. Sed
|
|
109
110
|
in condimentum lacus. Donec ac efficitur sapien. Integer sit amet
|
|
110
111
|
bibendum urna, eget rhoncus elit. Nam a diam sed dui consectetur
|
|
111
|
-
aliquet.
|
|
112
|
+
aliquet. <a href="/#">Link example</a>
|
|
112
113
|
</p>
|
|
113
114
|
<p>
|
|
114
115
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis
|
|
@@ -136,7 +137,7 @@ function InpageNavigationExample() {
|
|
|
136
137
|
tempor blandit. Curabitur iaculis risus ac ipsum semper egestas. Sed
|
|
137
138
|
in condimentum lacus. Donec ac efficitur sapien. Integer sit amet
|
|
138
139
|
bibendum urna, eget rhoncus elit. Nam a diam sed dui consectetur
|
|
139
|
-
aliquet.
|
|
140
|
+
aliquet. <a href="/#">Link example</a>
|
|
140
141
|
</p>
|
|
141
142
|
<p>
|
|
142
143
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis
|
|
@@ -64,10 +64,13 @@ export const Ribbon = (args) => (
|
|
|
64
64
|
<Segment raised>
|
|
65
65
|
<Label
|
|
66
66
|
as="a"
|
|
67
|
+
href={args.link}
|
|
67
68
|
ribbon
|
|
68
69
|
className={args.importance ? args.importance : ''}
|
|
69
70
|
{...args}
|
|
70
71
|
></Label>
|
|
72
|
+
<br />
|
|
73
|
+
<br />
|
|
71
74
|
<Image
|
|
72
75
|
src="https://react.semantic-ui.com/images/wireframe/paragraph.png"
|
|
73
76
|
alt="paragraph"
|
|
@@ -91,7 +94,6 @@ export const Corner = (args) => (
|
|
|
91
94
|
<Image
|
|
92
95
|
src="https://react.semantic-ui.com/images/wireframe/image.png"
|
|
93
96
|
label={{
|
|
94
|
-
as: 'a',
|
|
95
97
|
corner: 'right',
|
|
96
98
|
icon: 'save',
|
|
97
99
|
className: `${args.importance ? args.importance : ''}`,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Button } from 'semantic-ui-react';
|
|
2
3
|
import NewTabLabeledIcon from '../NewTabLabeledIcon/NewTabLabeledIcon';
|
|
3
4
|
import DownloadLabeledIcon from '../DownloadLabeledIcon/DownloadLabeledIcon';
|
|
4
5
|
import LanguageLabeledIcon from '../LanguageLabeledIcon/LanguageLabeledIcon';
|
|
@@ -17,12 +18,12 @@ LabeledIconGroup.Download = ({ children, ...rest }) => {
|
|
|
17
18
|
<DownloadLabeledIcon
|
|
18
19
|
{...rest}
|
|
19
20
|
trigger={
|
|
20
|
-
<
|
|
21
|
+
<Button className="text">
|
|
21
22
|
<DownloadLabeledIcon.Icon {...rest}>
|
|
22
23
|
{rest.icon}
|
|
23
24
|
</DownloadLabeledIcon.Icon>
|
|
24
25
|
<DownloadLabeledIcon.Label>{rest.label}</DownloadLabeledIcon.Label>
|
|
25
|
-
</
|
|
26
|
+
</Button>
|
|
26
27
|
}
|
|
27
28
|
>
|
|
28
29
|
<DownloadLabeledIcon.Dropdown {...rest}></DownloadLabeledIcon.Dropdown>
|
|
@@ -48,12 +49,12 @@ LabeledIconGroup.Language = ({ children, ...rest }) => {
|
|
|
48
49
|
<LanguageLabeledIcon
|
|
49
50
|
{...rest}
|
|
50
51
|
trigger={
|
|
51
|
-
<
|
|
52
|
+
<Button className="text">
|
|
52
53
|
<LanguageLabeledIcon.Icon
|
|
53
54
|
icon={rest.icon}
|
|
54
55
|
></LanguageLabeledIcon.Icon>
|
|
55
56
|
<LanguageLabeledIcon.Label>{rest.label}</LanguageLabeledIcon.Label>
|
|
56
|
-
</
|
|
57
|
+
</Button>
|
|
57
58
|
}
|
|
58
59
|
>
|
|
59
60
|
<LanguageLabeledIcon.Dropdown
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Button } from 'semantic-ui-react';
|
|
2
3
|
import LanguageLabeledIcon from './LanguageLabeledIcon';
|
|
3
4
|
import LabeledIconGroup from '../LabeledIconGroup/LabeledIconGroup';
|
|
4
5
|
|
|
@@ -35,10 +36,10 @@ const Template = (args) => (
|
|
|
35
36
|
<LanguageLabeledIcon
|
|
36
37
|
{...args}
|
|
37
38
|
trigger={
|
|
38
|
-
<
|
|
39
|
+
<Button className="text">
|
|
39
40
|
<LanguageLabeledIcon.Icon icon={args.icon}></LanguageLabeledIcon.Icon>
|
|
40
41
|
<LanguageLabeledIcon.Label>{args.label}</LanguageLabeledIcon.Label>
|
|
41
|
-
</
|
|
42
|
+
</Button>
|
|
42
43
|
}
|
|
43
44
|
>
|
|
44
45
|
<LanguageLabeledIcon.Dropdown
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button, Modal } from 'semantic-ui-react';
|
|
2
|
+
import { Button, Modal, Icon } from 'semantic-ui-react';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Components/Modal',
|
|
@@ -84,7 +84,6 @@ function ModalEEA({
|
|
|
84
84
|
const [open, setOpen] = React.useState(false);
|
|
85
85
|
return (
|
|
86
86
|
<Modal
|
|
87
|
-
closeIcon
|
|
88
87
|
onClose={() => setOpen(false)}
|
|
89
88
|
onOpen={() => setOpen(true)}
|
|
90
89
|
open={open}
|
|
@@ -93,6 +92,14 @@ function ModalEEA({
|
|
|
93
92
|
size={size}
|
|
94
93
|
dimmer={dimmer}
|
|
95
94
|
>
|
|
95
|
+
<Button
|
|
96
|
+
className="close icon"
|
|
97
|
+
onClick={() => setOpen(false)}
|
|
98
|
+
title="Close modal dialog"
|
|
99
|
+
>
|
|
100
|
+
<Icon name="close" />
|
|
101
|
+
</Button>
|
|
102
|
+
|
|
96
103
|
<Modal.Header>{header}</Modal.Header>
|
|
97
104
|
<Modal.Content>
|
|
98
105
|
<Modal.Description>{content}</Modal.Description>
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Icon } from 'semantic-ui-react';
|
|
2
|
+
import { Button, Icon } from 'semantic-ui-react';
|
|
3
3
|
|
|
4
4
|
function NewTabLabeledIcon({ children, ...rest }) {
|
|
5
5
|
return (
|
|
6
6
|
<div className="eea new tab labeled icon">
|
|
7
|
-
<
|
|
7
|
+
<Button
|
|
8
|
+
target="_blank"
|
|
9
|
+
rel="noreferrer"
|
|
10
|
+
href={rest.link}
|
|
11
|
+
as="a"
|
|
12
|
+
className="text"
|
|
13
|
+
>
|
|
8
14
|
{children}
|
|
9
|
-
</
|
|
15
|
+
</Button>
|
|
10
16
|
</div>
|
|
11
17
|
);
|
|
12
18
|
}
|
package/theme/plugins.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
install(less, pluginManager, functions) {
|
|
3
|
+
functions.add('vw', function (percentage) {
|
|
4
|
+
return new less.tree.Call('calc', [
|
|
5
|
+
new less.tree.Operation(
|
|
6
|
+
'*',
|
|
7
|
+
[
|
|
8
|
+
new less.tree.Call('var', [
|
|
9
|
+
new less.tree.UnicodeDescriptor('--vw'),
|
|
10
|
+
new less.tree.Dimension(
|
|
11
|
+
1,
|
|
12
|
+
new less.tree.Unit(['vw'], null, 'vw'),
|
|
13
|
+
),
|
|
14
|
+
]),
|
|
15
|
+
percentage,
|
|
16
|
+
],
|
|
17
|
+
true,
|
|
18
|
+
),
|
|
19
|
+
]);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
functions.add('vh', function (percentage) {
|
|
23
|
+
return new less.tree.Call('calc', [
|
|
24
|
+
new less.tree.Operation(
|
|
25
|
+
'*',
|
|
26
|
+
[
|
|
27
|
+
new less.tree.Call('var', [
|
|
28
|
+
new less.tree.UnicodeDescriptor('--vh'),
|
|
29
|
+
new less.tree.Dimension(
|
|
30
|
+
1,
|
|
31
|
+
new less.tree.Unit(['vh'], null, 'vh'),
|
|
32
|
+
),
|
|
33
|
+
]),
|
|
34
|
+
percentage,
|
|
35
|
+
],
|
|
36
|
+
true,
|
|
37
|
+
),
|
|
38
|
+
]);
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
};
|