@eeacms/volto-eea-design-system 1.0.6 → 1.11.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 +119 -1
- package/package.json +1 -1
- package/src/semantic.less +0 -4
- package/src/ui/Accordion/Accordion.stories.js +52 -123
- package/src/ui/Breadcrumbs/Breadcrumb.stories.jsx +6 -34
- package/src/ui/Breadcrumbs/Breadcrumbs.jsx +24 -24
- package/src/ui/Card/Card.stories.jsx +159 -13
- 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/Footer/Contact.jsx +31 -6
- package/src/ui/Footer/Footer.stories.js +76 -25
- package/src/ui/Form/Button/Button.stories.jsx +1 -1
- package/src/ui/Header/Header.jsx +22 -6
- package/src/ui/Header/Header.stories.js +112 -210
- package/src/ui/Header/HeaderMenuPopUp.js +72 -63
- package/src/ui/Header/HeaderSearchPopUp.js +2 -1
- 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/src/ui/Video/Video.jsx +44 -0
- package/src/ui/Video/Video.stories.jsx +53 -0
- package/src/ui/index.js +2 -2
- package/theme/theme.config +0 -3
- package/theme/themes/eea/assets/logo/eionet.svg +80 -11
- package/theme/themes/eea/assets/video/demo-track-el.vtt +11 -0
- package/theme/themes/eea/assets/video/demo-track-en.vtt +11 -0
- package/theme/themes/eea/assets/video/demo-track-ro.vtt +11 -0
- package/theme/themes/eea/collections/breadcrumb.overrides +11 -0
- package/theme/themes/eea/collections/table.variables +1 -1
- package/theme/themes/eea/elements/button.overrides +26 -7
- package/theme/themes/eea/elements/button.variables +1 -0
- package/theme/themes/eea/elements/image.overrides +6 -0
- package/theme/themes/eea/elements/image.variables +1 -0
- 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 -2
- 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/mixins.less +8 -0
- package/theme/themes/eea/globals/site.overrides +4 -1
- package/theme/themes/eea/globals/utilities.less +47 -0
- package/theme/themes/eea/modules/accordion.overrides +7 -0
- 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 +20 -8
- package/theme/themes/eea/views/card.variables +6 -2
- package/theme/themes/eea/views/item.overrides +2 -2
- package/src/ui/Card/AvatarGrid/AvatarGrid.jsx +0 -61
- package/src/ui/Card/AvatarGrid/AvatarGrid.stories.jsx +0 -89
- package/src/ui/Card/RoundedCard.stories.jsx +0 -122
- package/theme/themes/eea/extras/avatar.variables +0 -28
- package/theme/themes/eea/extras/avatarGrid.less +0 -43
- package/theme/themes/eea/extras/avatarGrid.variables +0 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Transition } from 'semantic-ui-react';
|
|
3
3
|
import { Container, Grid, List, Icon, Accordion } from 'semantic-ui-react';
|
|
4
4
|
|
|
@@ -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>
|
|
@@ -249,17 +244,31 @@ const SecondLevelContent = ({ element, topics = false, renderMenuItem }) => {
|
|
|
249
244
|
};
|
|
250
245
|
|
|
251
246
|
const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
|
|
252
|
-
|
|
247
|
+
const [activeIndex, setActiveIndex] = useState(-1);
|
|
248
|
+
|
|
249
|
+
useEffect(() => {
|
|
250
|
+
let index = 0;
|
|
251
|
+
menuItems.forEach((menuItem) => {
|
|
252
|
+
if (pathName.includes(menuItem.url)) setActiveIndex(index);
|
|
253
|
+
++index;
|
|
254
|
+
});
|
|
255
|
+
}, [menuItems, pathName]);
|
|
256
|
+
|
|
253
257
|
const rootPanels = [];
|
|
254
258
|
menuItems.forEach((element, index) => {
|
|
255
259
|
let x = {};
|
|
256
260
|
x.key = index;
|
|
257
|
-
|
|
258
|
-
if (pathName.indexOf(element.url) !== -1) {
|
|
259
|
-
defaultIndex = index;
|
|
260
|
-
}
|
|
261
261
|
x.title = (
|
|
262
|
-
<Accordion.Title
|
|
262
|
+
<Accordion.Title
|
|
263
|
+
key={`title-${index}`}
|
|
264
|
+
index={index}
|
|
265
|
+
as="button"
|
|
266
|
+
onClick={() => {
|
|
267
|
+
if (activeIndex === index) {
|
|
268
|
+
setActiveIndex(-1);
|
|
269
|
+
} else setActiveIndex(index);
|
|
270
|
+
}}
|
|
271
|
+
>
|
|
263
272
|
{element.title}
|
|
264
273
|
<Icon className="ri-arrow-down-s-line" size="small" />
|
|
265
274
|
</Accordion.Title>
|
|
@@ -294,7 +303,7 @@ const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
|
|
|
294
303
|
rootPanels.push(x);
|
|
295
304
|
});
|
|
296
305
|
|
|
297
|
-
return <Accordion
|
|
306
|
+
return <Accordion activeIndex={activeIndex} panels={rootPanels} />;
|
|
298
307
|
};
|
|
299
308
|
|
|
300
309
|
function HeaderMenuPopUp({
|
|
@@ -30,6 +30,7 @@ function HeaderSearchPopUp({
|
|
|
30
30
|
const {
|
|
31
31
|
path = '',
|
|
32
32
|
buttonTitle,
|
|
33
|
+
buttonUrl,
|
|
33
34
|
description,
|
|
34
35
|
placeholder = 'Search',
|
|
35
36
|
searchSuggestions,
|
|
@@ -115,7 +116,7 @@ function HeaderSearchPopUp({
|
|
|
115
116
|
<Container>
|
|
116
117
|
<div>{description}</div>
|
|
117
118
|
<a
|
|
118
|
-
href={defaultView[0].path}
|
|
119
|
+
href={buttonUrl || defaultView[0].path}
|
|
119
120
|
className="ui button white inverted"
|
|
120
121
|
title="Advanced search"
|
|
121
122
|
>
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
|
|
4
|
+
function Video({ children, align }) {
|
|
5
|
+
return <div className={cx('block video align', align)}>{children}</div>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
Video.Body = ({ children, align }) => (
|
|
9
|
+
<div className={cx('video-inner', { 'full-width': align === 'full' })}>
|
|
10
|
+
{children}
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
Video.Embed = ({
|
|
15
|
+
children,
|
|
16
|
+
url,
|
|
17
|
+
loop,
|
|
18
|
+
autoPlay,
|
|
19
|
+
align,
|
|
20
|
+
placeholder_image,
|
|
21
|
+
required_caption,
|
|
22
|
+
}) => {
|
|
23
|
+
return (
|
|
24
|
+
<video
|
|
25
|
+
src={url}
|
|
26
|
+
controls={!autoPlay}
|
|
27
|
+
autoPlay={autoPlay}
|
|
28
|
+
muted={autoPlay}
|
|
29
|
+
loop={loop}
|
|
30
|
+
poster={placeholder_image}
|
|
31
|
+
type="video/mp4"
|
|
32
|
+
>
|
|
33
|
+
<track kind="captions" {...required_caption} />
|
|
34
|
+
{children}
|
|
35
|
+
</video>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
Video.Track = ({ tracks }) =>
|
|
40
|
+
tracks.map((track, index) => {
|
|
41
|
+
return <track {...track} />;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export default Video;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container } from 'semantic-ui-react';
|
|
3
|
+
import Video from './Video';
|
|
4
|
+
import englishTrack from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/video/demo-track-en.vtt';
|
|
5
|
+
import romanianTrack from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/video/demo-track-ro.vtt';
|
|
6
|
+
import greekTrack from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/video/demo-track-el.vtt';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Video',
|
|
10
|
+
component: Video,
|
|
11
|
+
argTypes: {
|
|
12
|
+
align: {
|
|
13
|
+
options: ['center', 'right', 'left'],
|
|
14
|
+
control: {
|
|
15
|
+
type: 'select',
|
|
16
|
+
labels: {
|
|
17
|
+
'': 'default',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultValue: 'center',
|
|
21
|
+
table: {
|
|
22
|
+
defaultValue: { summary: 'center' },
|
|
23
|
+
type: { summary: 'string' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const Template = (args) => (
|
|
30
|
+
<Container>
|
|
31
|
+
<Video align={args.align}>
|
|
32
|
+
<Video.Body align={args.align}>
|
|
33
|
+
<Video.Embed {...args}>
|
|
34
|
+
<Video.Track tracks={args.tracks} />
|
|
35
|
+
</Video.Embed>
|
|
36
|
+
</Video.Body>
|
|
37
|
+
</Video>
|
|
38
|
+
</Container>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const Default = Template.bind({});
|
|
42
|
+
Default.args = {
|
|
43
|
+
url: 'https://cmshare.eea.europa.eu/s/Xw7kH2TJGCibHJf/download',
|
|
44
|
+
autoPlay: false,
|
|
45
|
+
loop: false,
|
|
46
|
+
align: 'center',
|
|
47
|
+
placeholder_image: '',
|
|
48
|
+
required_caption: { src: englishTrack, srclang: 'en', label: 'English' },
|
|
49
|
+
tracks: [
|
|
50
|
+
{ src: romanianTrack, kind: 'captions', srclang: 'ro', label: 'Română' },
|
|
51
|
+
{ src: greekTrack, kind: 'captions', srclang: 'el', label: 'Ελλήνικά' },
|
|
52
|
+
],
|
|
53
|
+
};
|
package/src/ui/index.js
CHANGED
|
@@ -22,8 +22,6 @@ export Timeline from './Timeline/Timeline';
|
|
|
22
22
|
|
|
23
23
|
export Testimonial from './Quote/Testimonial/Testimonial';
|
|
24
24
|
|
|
25
|
-
export AvatarGrid from './Card/AvatarGrid/AvatarGrid';
|
|
26
|
-
|
|
27
25
|
export KeyContent from './KeyContent/KeyContent';
|
|
28
26
|
|
|
29
27
|
export DownloadLabeledIcon from './DownloadLabeledIcon/DownloadLabeledIcon';
|
|
@@ -39,3 +37,5 @@ export RelatedContent from './Card/RelatedContent/RelatedContent';
|
|
|
39
37
|
export Hero from './Hero/Hero';
|
|
40
38
|
|
|
41
39
|
export Copyright from './Copyright/Copyright';
|
|
40
|
+
|
|
41
|
+
export Video from './Video/Video';
|
package/theme/theme.config
CHANGED
|
@@ -88,10 +88,8 @@
|
|
|
88
88
|
@tagList : 'eea';
|
|
89
89
|
@inpageNavigation : 'eea';
|
|
90
90
|
@contextNavigation : 'eea';
|
|
91
|
-
@avatar : 'eea';
|
|
92
91
|
@divider : 'eea';
|
|
93
92
|
@testimonial : 'eea';
|
|
94
|
-
@avatarGrid : 'eea';
|
|
95
93
|
@keyContent : 'eea';
|
|
96
94
|
@publicationCard : 'eea';
|
|
97
95
|
@contentBox : 'eea';
|
|
@@ -135,5 +133,4 @@
|
|
|
135
133
|
@import (optional) "@{siteFolder}/@{addon}/@{addontype}s/@{addonelement}.overrides";
|
|
136
134
|
}
|
|
137
135
|
|
|
138
|
-
|
|
139
136
|
/* End Config */
|