@eeacms/volto-eea-design-system 0.9.4 → 0.9.6
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/.release-it.json +1 -1
- package/CHANGELOG.md +2434 -1960
- package/package.json +1 -1
- package/src/semantic.less +4 -0
- package/src/ui/Banner/Banner.stories.jsx +37 -1
- package/src/ui/Copyright/Copyright.jsx +27 -0
- package/src/ui/Copyright/Copyright.stories.jsx +40 -0
- package/src/ui/Hero/Hero.jsx +20 -1
- package/src/ui/Hero/Hero.stories.jsx +70 -0
- package/src/ui/index.js +2 -0
- package/theme/theme.config +1 -0
- package/theme/themes/eea/extras/banner.less +2 -1
- package/theme/themes/eea/extras/copyright.less +29 -0
- package/theme/themes/eea/extras/copyright.variables +11 -0
- package/theme/themes/eea/extras/hero.less +7 -0
- package/theme/themes/eea/extras/hero.variables +5 -1
- package/theme/themes/eea/extras/tagList.less +2 -0
- package/theme/themes/eea/views/statistic.overrides +1 -0
- package/theme/themes/eea/views/statistic.variables +2 -2
package/package.json
CHANGED
package/src/semantic.less
CHANGED
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import Banner from './Banner';
|
|
3
3
|
// eslint-disable-next-line import/no-unresolved
|
|
4
4
|
import imgUrl from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/banner.png';
|
|
5
|
-
import { Popup } from 'semantic-ui-react';
|
|
5
|
+
import { Popup, Icon } from 'semantic-ui-react';
|
|
6
|
+
import Copyright from '../Copyright/Copyright';
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
title: 'Components/Page Header',
|
|
@@ -43,6 +44,32 @@ export default {
|
|
|
43
44
|
type: { summary: 'boolean' },
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
copyrightPosition: {
|
|
48
|
+
name: 'Position',
|
|
49
|
+
control: {
|
|
50
|
+
type: 'inline-radio',
|
|
51
|
+
options: ['left', 'right'],
|
|
52
|
+
},
|
|
53
|
+
type: { name: 'string' },
|
|
54
|
+
table: {
|
|
55
|
+
category: 'Copyright',
|
|
56
|
+
defaultValue: { summary: '"left"' },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
copyrightIcon: {
|
|
60
|
+
table: {
|
|
61
|
+
category: 'Copyright',
|
|
62
|
+
defaultValue: { summary: '""' },
|
|
63
|
+
type: { summary: 'string' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
copyrightText: {
|
|
67
|
+
table: {
|
|
68
|
+
category: 'Copyright',
|
|
69
|
+
defaultValue: { summary: '""' },
|
|
70
|
+
type: { summary: 'string' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
46
73
|
},
|
|
47
74
|
};
|
|
48
75
|
|
|
@@ -100,6 +127,12 @@ const Template = (args) => (
|
|
|
100
127
|
</>
|
|
101
128
|
</Banner.Metadata>
|
|
102
129
|
)}
|
|
130
|
+
<Copyright copyrightPosition={args.copyrightPosition}>
|
|
131
|
+
<Copyright.Icon>
|
|
132
|
+
<Icon className={args.copyrightIcon} />
|
|
133
|
+
</Copyright.Icon>
|
|
134
|
+
<Copyright.Text>{args.copyrightText}</Copyright.Text>
|
|
135
|
+
</Copyright>
|
|
103
136
|
</Banner.Content>
|
|
104
137
|
</Banner>
|
|
105
138
|
);
|
|
@@ -117,4 +150,7 @@ Default.args = {
|
|
|
117
150
|
image: true,
|
|
118
151
|
hideShareButton: false,
|
|
119
152
|
hideDownloadButton: false,
|
|
153
|
+
copyrightPosition: 'left',
|
|
154
|
+
copyrightIcon: 'ri-copyright-line',
|
|
155
|
+
copyrightText: 'Image copyright: Velit fusce sed sem ut.',
|
|
120
156
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
Copyright.propTypes = {
|
|
5
|
+
copyrightPosition: PropTypes.oneOf(['left', 'right']),
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
function Copyright({ children, ...rest }) {
|
|
9
|
+
return (
|
|
10
|
+
<div className={`eea copyright ${rest.copyrightPosition}`}>
|
|
11
|
+
<div className={'wrapper'}>{children}</div>
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Copyright.Icon = ({ children, ...rest }) => (
|
|
17
|
+
<span {...rest} className={'icon-wrapper'}>
|
|
18
|
+
{children}
|
|
19
|
+
</span>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
Copyright.Text = ({ children, ...rest }) => (
|
|
23
|
+
<span {...rest} className={'icon-content'}>
|
|
24
|
+
{children}
|
|
25
|
+
</span>
|
|
26
|
+
);
|
|
27
|
+
export default Copyright;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Copyright from './Copyright';
|
|
3
|
+
import { Container, Icon, Segment } from 'semantic-ui-react';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Copyright',
|
|
7
|
+
component: Copyright,
|
|
8
|
+
argTypes: {
|
|
9
|
+
copyrightPosition: {
|
|
10
|
+
name: 'Position',
|
|
11
|
+
control: {
|
|
12
|
+
type: 'inline-radio',
|
|
13
|
+
options: ['left', 'right'],
|
|
14
|
+
},
|
|
15
|
+
type: { name: 'string' },
|
|
16
|
+
table: {
|
|
17
|
+
defaultValue: { summary: '"left"' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Default = (args) => (
|
|
24
|
+
<Container>
|
|
25
|
+
<Segment className={'inverted'}>
|
|
26
|
+
<Copyright copyrightPosition={args.copyrightPosition}>
|
|
27
|
+
<Copyright.Icon>
|
|
28
|
+
<Icon className={args.icon} />
|
|
29
|
+
</Copyright.Icon>
|
|
30
|
+
<Copyright.Text>{args.text}</Copyright.Text>
|
|
31
|
+
</Copyright>
|
|
32
|
+
</Segment>
|
|
33
|
+
</Container>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
Default.args = {
|
|
37
|
+
copyrightPosition: 'left',
|
|
38
|
+
icon: 'ri-copyright-line',
|
|
39
|
+
text: 'Image copyright: Velit fusce sed sem ut.',
|
|
40
|
+
};
|
package/src/ui/Hero/Hero.jsx
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
+
import { Icon } from 'semantic-ui-react';
|
|
5
|
+
import Copyright from '../Copyright/Copyright';
|
|
6
|
+
|
|
4
7
|
Hero.propTypes = {
|
|
5
8
|
image: PropTypes.bool,
|
|
6
9
|
fullWidth: PropTypes.bool,
|
|
@@ -21,6 +24,11 @@ function Hero({
|
|
|
21
24
|
alignContent,
|
|
22
25
|
backgroundVariant,
|
|
23
26
|
children,
|
|
27
|
+
|
|
28
|
+
has_copyright,
|
|
29
|
+
copyrightPosition,
|
|
30
|
+
copyrightIcon,
|
|
31
|
+
copyrightText,
|
|
24
32
|
}) {
|
|
25
33
|
return (
|
|
26
34
|
// full width prop
|
|
@@ -36,7 +44,18 @@ function Hero({
|
|
|
36
44
|
<div
|
|
37
45
|
className={`hero-block-inner-wrapper d-flex ui container flex-items-${alignContent}`}
|
|
38
46
|
>
|
|
39
|
-
<div className="hero-block-body">
|
|
47
|
+
<div className="hero-block-body">
|
|
48
|
+
{children}
|
|
49
|
+
|
|
50
|
+
{has_copyright && (
|
|
51
|
+
<Copyright copyrightPosition={copyrightPosition}>
|
|
52
|
+
<Copyright.Icon>
|
|
53
|
+
<Icon className={copyrightIcon} />
|
|
54
|
+
</Copyright.Icon>
|
|
55
|
+
<Copyright.Text>{copyrightText}</Copyright.Text>
|
|
56
|
+
</Copyright>
|
|
57
|
+
)}
|
|
58
|
+
</div>
|
|
40
59
|
</div>
|
|
41
60
|
</div>
|
|
42
61
|
</div>
|
|
@@ -54,6 +54,40 @@ export default {
|
|
|
54
54
|
type: { summary: 'boolean' },
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
|
+
has_copyright: {
|
|
58
|
+
name: 'Copyright',
|
|
59
|
+
table: {
|
|
60
|
+
category: 'Copyright',
|
|
61
|
+
defaultValue: { summary: '' },
|
|
62
|
+
type: { summary: 'boolean' },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
copyrightPosition: {
|
|
66
|
+
name: 'Position',
|
|
67
|
+
control: {
|
|
68
|
+
type: 'inline-radio',
|
|
69
|
+
options: ['left', 'right'],
|
|
70
|
+
},
|
|
71
|
+
type: { name: 'string' },
|
|
72
|
+
table: {
|
|
73
|
+
category: 'Copyright',
|
|
74
|
+
defaultValue: { summary: '"left"' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
copyrightIcon: {
|
|
78
|
+
table: {
|
|
79
|
+
category: 'Copyright',
|
|
80
|
+
defaultValue: { summary: '""' },
|
|
81
|
+
type: { summary: 'string' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
copyrightText: {
|
|
85
|
+
table: {
|
|
86
|
+
category: 'Copyright',
|
|
87
|
+
defaultValue: { summary: '""' },
|
|
88
|
+
type: { summary: 'string' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
57
91
|
},
|
|
58
92
|
};
|
|
59
93
|
|
|
@@ -93,6 +127,11 @@ Default.args = {
|
|
|
93
127
|
inverted: true,
|
|
94
128
|
alignContent: 'center',
|
|
95
129
|
backgroundVariant: 'grey',
|
|
130
|
+
|
|
131
|
+
has_copyright: true,
|
|
132
|
+
copyrightPosition: 'left',
|
|
133
|
+
copyrightIcon: 'ri-copyright-line',
|
|
134
|
+
copyrightText: 'Image copyright: Velit fusce sed sem ut.',
|
|
96
135
|
};
|
|
97
136
|
Default.parameters = {
|
|
98
137
|
controls: {
|
|
@@ -125,6 +164,11 @@ Playground.args = {
|
|
|
125
164
|
inverted: true,
|
|
126
165
|
alignContent: 'center',
|
|
127
166
|
backgroundVariant: 'tertiary',
|
|
167
|
+
|
|
168
|
+
has_copyright: true,
|
|
169
|
+
copyrightPosition: 'left',
|
|
170
|
+
copyrightIcon: 'ri-copyright-line',
|
|
171
|
+
copyrightText: 'Image copyright: Velit fusce sed sem ut.',
|
|
128
172
|
};
|
|
129
173
|
Playground.argTypes = {
|
|
130
174
|
fullWidth: {
|
|
@@ -202,4 +246,30 @@ Playground.argTypes = {
|
|
|
202
246
|
type: { summary: 'string' },
|
|
203
247
|
},
|
|
204
248
|
},
|
|
249
|
+
copyrightPosition: {
|
|
250
|
+
name: 'Position',
|
|
251
|
+
control: {
|
|
252
|
+
type: 'inline-radio',
|
|
253
|
+
options: ['left', 'right'],
|
|
254
|
+
},
|
|
255
|
+
type: { name: 'string' },
|
|
256
|
+
table: {
|
|
257
|
+
category: 'Copyright',
|
|
258
|
+
defaultValue: { summary: '"left"' },
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
copyrightIcon: {
|
|
262
|
+
table: {
|
|
263
|
+
category: 'Copyright',
|
|
264
|
+
defaultValue: { summary: '""' },
|
|
265
|
+
type: { summary: 'string' },
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
copyrightText: {
|
|
269
|
+
table: {
|
|
270
|
+
category: 'Copyright',
|
|
271
|
+
defaultValue: { summary: '""' },
|
|
272
|
+
type: { summary: 'string' },
|
|
273
|
+
},
|
|
274
|
+
},
|
|
205
275
|
};
|
package/src/ui/index.js
CHANGED
package/theme/theme.config
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
.metadata {
|
|
44
44
|
font-size: @mobileMetadataFontSize;
|
|
45
45
|
line-height: @mobileMetadataLineHeight;
|
|
46
|
+
margin-bottom: @rem-space-3;
|
|
46
47
|
|
|
47
48
|
.field.type {
|
|
48
49
|
font-weight: @metadataTypeFontWeight;
|
|
@@ -129,7 +130,7 @@
|
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
@media only screen and (max-width: @
|
|
133
|
+
@media only screen and (max-width: @largestMobileScreen) {
|
|
133
134
|
.actions .action {
|
|
134
135
|
margin-bottom: @mobileActionsActionMarginBottom;
|
|
135
136
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@type: 'extra';
|
|
2
|
+
@element: 'copyright';
|
|
3
|
+
|
|
4
|
+
@import (multiple) '../../theme.config';
|
|
5
|
+
|
|
6
|
+
/*-------------------
|
|
7
|
+
Copyright
|
|
8
|
+
--------------------*/
|
|
9
|
+
|
|
10
|
+
.eea.copyright {
|
|
11
|
+
width: @copyrightWidth;
|
|
12
|
+
|
|
13
|
+
.wrapper {
|
|
14
|
+
display: flex;
|
|
15
|
+
color: @copyrightContentColor;
|
|
16
|
+
font-size: @copyrightContentFontSize;
|
|
17
|
+
line-height: @copyrightLineHeight;
|
|
18
|
+
gap: @copyrightContentPaddingRight;
|
|
19
|
+
}
|
|
20
|
+
&.left .wrapper {
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
}
|
|
23
|
+
&.right .wrapper {
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
.icon {
|
|
27
|
+
margin: 0; // override default
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*******************************
|
|
2
|
+
Copyright
|
|
3
|
+
*******************************/
|
|
4
|
+
|
|
5
|
+
@copyrightWidth: 100%;
|
|
6
|
+
|
|
7
|
+
/* Content */
|
|
8
|
+
@copyrightContentColor: var(--text-color, @grey-1);
|
|
9
|
+
@copyrightContentFontSize: @font-size-00;
|
|
10
|
+
@copyrightLineHeight: @font-lineheight-0;
|
|
11
|
+
@copyrightContentPaddingRight: @rem-space-1;
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
height: 100%;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
.hero-block-body .eea.copyright {
|
|
50
|
+
position: absolute;
|
|
51
|
+
bottom: @mobileCopyrightBottom;
|
|
52
|
+
}
|
|
49
53
|
|
|
50
54
|
.hero-block-text .quoted > * {
|
|
51
55
|
display: inline-block;
|
|
@@ -91,4 +95,7 @@
|
|
|
91
95
|
.hero-block-body {
|
|
92
96
|
gap: @desktopHeroBlockBodyGap;
|
|
93
97
|
}
|
|
98
|
+
.hero-block-body .eea.copyright {
|
|
99
|
+
bottom: @desktopCopyrightBottom;
|
|
100
|
+
}
|
|
94
101
|
}
|
|
@@ -30,4 +30,8 @@
|
|
|
30
30
|
/* Body */
|
|
31
31
|
@mobileHeroBlockBodyGap : @rem-space-6;
|
|
32
32
|
@tabletHeroBlockBodyGap : @rem-space-8;
|
|
33
|
-
@desktopHeroBlockBodyGap : @rem-space-10;
|
|
33
|
+
@desktopHeroBlockBodyGap : @rem-space-10;
|
|
34
|
+
|
|
35
|
+
/* Copyright */
|
|
36
|
+
@mobileCopyrightBottom: @rem-space-4;
|
|
37
|
+
@desktopCopyrightBottom: @rem-space-7-50;
|