@eeacms/volto-eea-design-system 1.0.0-alpha.10 → 1.0.0-alpha.12

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 CHANGED
@@ -4,7 +4,70 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- ### [1.0.0-alpha.10](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.9...1.0.0-alpha.10) - 12 January 2023
7
+ ### [1.0.0-alpha.12](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.11...1.0.0-alpha.12) - 24 January 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(mobile menu): sub links when an accordion section is active [David Ichim - [`bb3be81`](https://github.com/eea/volto-eea-design-system/commit/bb3be81416340ad0e3e992cd4e75642fc50f8ad3)]
12
+
13
+ #### :nail_care: Enhancements
14
+
15
+ - change(card): title padding value for a more balance look [David Ichim - [`74b6556`](https://github.com/eea/volto-eea-design-system/commit/74b65563d973eb9c6afc534935e253f2705fe9ee)]
16
+ - change(card): added image card section, tweaked mobile heading size [David Ichim - [`0f879e1`](https://github.com/eea/volto-eea-design-system/commit/0f879e15d22ae066f020d8188ef3e355c27d016c)]
17
+ - change(cards): moved image gradient overlay to a mixin.less file [David Ichim - [`8b4928a`](https://github.com/eea/volto-eea-design-system/commit/8b4928a87bfe5fae6f64c93d7c8f1f7a3045816c)]
18
+ - change(card): removed uppercase transform from title on image [David Ichim - [`2948ae1`](https://github.com/eea/volto-eea-design-system/commit/2948ae16f748911929910ac53d1e0acf96952317)]
19
+ - change(cards): added image for all storybook card examples [David Ichim - [`3f19413`](https://github.com/eea/volto-eea-design-system/commit/3f194130bb6fb7b9ab04a7e1305f26fa135c23d2)]
20
+ - change(card): implement title on image within image section [David Ichim - [`ff6cc60`](https://github.com/eea/volto-eea-design-system/commit/ff6cc600978355e04dde704d014d2cbe27df1298)]
21
+ - change(colors, Docusaurus): Visited link colour change and thematic logo replacement #278 from eea/refactor-visited-link [ichim-david - [`f82d978`](https://github.com/eea/volto-eea-design-system/commit/f82d9781cc3b34443f181565c2ec1892d534f8e2)]
22
+ - change(banner): restored label value of metadata field when type isn't date [David Ichim - [`571a4f2`](https://github.com/eea/volto-eea-design-system/commit/571a4f27fe73d0465b6482f70dd70b2dc47dffe8)]
23
+ - refactor(docusaurus): applied image naming convention [Giorgos Stamatis - [`ee7bc29`](https://github.com/eea/volto-eea-design-system/commit/ee7bc290084e198f9f94e40fbf44c6d9cb19d1ba)]
24
+ - refactor(card): Update titles value and size [Antonis Tarantilis - [`c35ad5c`](https://github.com/eea/volto-eea-design-system/commit/c35ad5c76caa00556f8a501d2e7d516464790dc4)]
25
+ - refactor(storybook): visited link variables [Dora Anastasiou - [`b209b2f`](https://github.com/eea/volto-eea-design-system/commit/b209b2f7703641926c6d4b1f7162eef39b2a1ad8)]
26
+ - refactor(Card): add image with title css [Antonis Tarantilis - [`6e6e63e`](https://github.com/eea/volto-eea-design-system/commit/6e6e63e2362a27b0bbf4b8dd968f11a0dc87da2a)]
27
+ - refactor(Card): create card template for stories [Antonis Tarantilis - [`2fa77f3`](https://github.com/eea/volto-eea-design-system/commit/2fa77f3f93935dd01cd5e3d77437fe8dc03721da)]
28
+
29
+ #### :house: Documentation changes
30
+
31
+ - docs(colors): visited link update [Dora Anastasiou - [`ece77fe`](https://github.com/eea/volto-eea-design-system/commit/ece77fec130de1d9d8014d40e7da975bf57061ee)]
32
+
33
+ #### :hammer_and_wrench: Others
34
+
35
+ - change version to alpha 12 instead of 1 final [David Ichim - [`3225025`](https://github.com/eea/volto-eea-design-system/commit/32250253f5d7fe9f01126136ad86b8a4f2f5c700)]
36
+ - feature(card): new card variation with title on top of image #267 from eea/title-on-image-card [ichim-david - [`2c0ca95`](https://github.com/eea/volto-eea-design-system/commit/2c0ca95700bb162bc1273c83f2fc4f591de8dcf0)]
37
+ - fix typos in footer gradient variables [David Ichim - [`4006640`](https://github.com/eea/volto-eea-design-system/commit/40066405d97af838e986370101371a8162029e02)]
38
+ - Back to dev [Alin Voinea - [`477d997`](https://github.com/eea/volto-eea-design-system/commit/477d997513ef5152ab98e080ad07f927b5869705)]
39
+ ### [1.0.0-alpha.11](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.10...1.0.0-alpha.11) - 17 January 2023
40
+
41
+ #### :rocket: New Features
42
+
43
+ - feat(docusaurus): Header and footer elements section #277 [ichim-david - [`0df271c`](https://github.com/eea/volto-eea-design-system/commit/0df271c4c79bd8a24750cfe44d69f32cb04a1b63)]
44
+
45
+ #### :bug: Bug Fixes
46
+
47
+ - fix(banner): storybook date input and simplified gradient opacity [David Ichim - [`7674d76`](https://github.com/eea/volto-eea-design-system/commit/7674d767bb770342828d6bea6953ce45b823943f)]
48
+ - fix(banner): re-added title class on banner title [David Ichim - [`6d15799`](https://github.com/eea/volto-eea-design-system/commit/6d157994934c3da9af4e3dd37844f910bddf8377)]
49
+
50
+ #### :nail_care: Enhancements
51
+
52
+ - refactor(banner): sync storybook and Volto component #275 from eea/sync-page-banner-theme [ichim-david - [`4331fb4`](https://github.com/eea/volto-eea-design-system/commit/4331fb4a6d5744e7d7d6a001bca91265a22587fd)]
53
+ - change(banner): removed margin from title [David Ichim - [`17e592c`](https://github.com/eea/volto-eea-design-system/commit/17e592c4f3fd16a78069af50574e2ac608166a0f)]
54
+ - refactor(banner): sync storybook and Volto component [nileshgulia1 - [`c9087cc`](https://github.com/eea/volto-eea-design-system/commit/c9087cc8edc3fb27e0b96b509354861ec306f22a)]
55
+
56
+ #### :house: Documentation changes
57
+
58
+ - docs(footer): updates on header elements [Dora Anastasiou - [`b41c550`](https://github.com/eea/volto-eea-design-system/commit/b41c550475dc5a2eefcad5d75439601d079613e2)]
59
+ - docs(footer): add elements anatomy [Dora Anastasiou - [`d9f0872`](https://github.com/eea/volto-eea-design-system/commit/d9f0872f93a6f7572f798b2c001d3af00eb282e3)]
60
+
61
+ #### :hammer_and_wrench: Others
62
+
63
+ - Release 1.0.0-alpha.11 [Alin Voinea - [`07e8f85`](https://github.com/eea/volto-eea-design-system/commit/07e8f858b0bdeaa6a348c0bfc2b785f26017e1ea)]
64
+ - renamed image elements as requested in review [David Ichim - [`8541fb6`](https://github.com/eea/volto-eea-design-system/commit/8541fb6739d3c935ed8d44a220114546b2aef682)]
65
+ - update(gradient): use 8deg angle [nileshgulia1 - [`6fd597d`](https://github.com/eea/volto-eea-design-system/commit/6fd597d8d7a83fdf8a27939e4c69dfc3975b6a81)]
66
+ - update(gradiant): make it 0deg [nileshgulia1 - [`1bb2696`](https://github.com/eea/volto-eea-design-system/commit/1bb2696375eef233b509e27d9d464b8343421430)]
67
+ - remove(banner-gradiant): image gradiant in favour of text [nileshgulia1 - [`1b58520`](https://github.com/eea/volto-eea-design-system/commit/1b58520490be5e17ea4ce6fc98329d467dad3960)]
68
+ - remove(comment) referencing old verison of title [nileshgulia1 - [`4226d42`](https://github.com/eea/volto-eea-design-system/commit/4226d42e34b119e057cf4e9878b6a99172cb976a)]
69
+ - add(banner): banner title css [nileshgulia1 - [`d003247`](https://github.com/eea/volto-eea-design-system/commit/d0032474d2b57eb63a4b50a882ced2ee743a48e6)]
70
+ ### [1.0.0-alpha.10](https://github.com/eea/volto-eea-design-system/compare/1.0.0-alpha.9...1.0.0-alpha.10) - 13 January 2023
8
71
 
9
72
  #### :bug: Bug Fixes
10
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.12",
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,22 +1,68 @@
1
1
  import React from 'react';
2
2
  import { Container, Icon, Button, Grid } from 'semantic-ui-react';
3
3
  import PropTypes from 'prop-types';
4
+ import { formatDate } from '@plone/volto/helpers/Utils/Date';
5
+ import config from '@plone/volto/registry';
4
6
 
5
7
  Banner.propTypes = {
6
8
  title: PropTypes.string,
7
9
  image: PropTypes.bool,
8
10
  };
9
11
 
10
- function Banner({ image_url, image, children }) {
12
+ const socialPlatforms = {
13
+ facebook: {
14
+ shareLink: (url) => `https://facebook.com/sharer.php?u=${url}`,
15
+ },
16
+ twitter: {
17
+ shareLink: (url) => `https://www.twitter.com/share?url=${url}`,
18
+ },
19
+ linkedin: {
20
+ shareLink: (url) =>
21
+ `https://www.linkedin.com/sharing/share-offsite/?url=${url}`,
22
+ },
23
+ reddit: {
24
+ shareLink: (url, title) => `https://reddit.com/submit?url=${url}`,
25
+ },
26
+ };
27
+
28
+ export const getImageSource = (image) => {
29
+ if (image?.download) return image.download;
30
+ if (image?.encoding)
31
+ return `data:${image['content-type']};${image['encoding']},${image['data']}`;
32
+ return null;
33
+ };
34
+
35
+ export const sharePage = (url, platform) => {
36
+ if (!socialPlatforms[platform]) return;
37
+ const link = document.createElement('a');
38
+ link.setAttribute('href', socialPlatforms[platform].shareLink(url));
39
+ link.setAttribute('target', '_blank');
40
+ link.setAttribute('rel', 'noreferrer');
41
+ link.click();
42
+ };
43
+
44
+ function Banner({ image, metadata, properties, children, ...rest }) {
45
+ if (image) {
46
+ //extract Lead image from page content.
47
+ const content = metadata || properties;
48
+ const imageUrl = getImageSource(content['image']) ?? image;
49
+ return (
50
+ <div className="eea banner">
51
+ <div
52
+ className={imageUrl ? 'image' : ''}
53
+ style={imageUrl ? { backgroundImage: `url(${imageUrl})` } : {}}
54
+ >
55
+ <div className="gradient">
56
+ <Container>{children}</Container>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ );
61
+ }
11
62
  return (
12
63
  <div className="eea banner">
13
- <div
14
- className={image ? 'image' : ''}
15
- style={image ? { backgroundImage: `url(${image_url})` } : {}}
16
- >
17
- <div className="gradient">
18
- <Container>{children}</Container>
19
- </div>
64
+ <div className="gradient">
65
+ <Container>{children}</Container>
20
66
  </div>
21
67
  </div>
22
68
  );
@@ -48,12 +94,30 @@ Banner.Content = ({ children, actions }) => {
48
94
  );
49
95
  };
50
96
 
51
- Banner.Title = ({ children }) => <p className="title">{children}</p>;
97
+ Banner.Title = ({ children }) => {
98
+ return <h1 className="documentFirstHeading title">{children}</h1>;
99
+ };
52
100
  Banner.Subtitle = ({ children }) => <p className="subtitle">{children}</p>;
53
101
  Banner.Metadata = ({ children }) => <p className="metadata">{children}</p>;
54
102
 
55
103
  Banner.MetadataField = ({ hidden, type = 'text', label, value, title }) => {
104
+ const locale = config.settings.dateLocale || 'en-gb';
56
105
  if (hidden || !value) return '';
106
+ if (type === 'date' && value)
107
+ return (
108
+ <span className={`field ${type}`} title={title?.replace('{}', value)}>
109
+ {label}{' '}
110
+ {formatDate({
111
+ date: value,
112
+ format: {
113
+ year: 'numeric',
114
+ month: 'short',
115
+ day: '2-digit',
116
+ },
117
+ locale: locale,
118
+ })}
119
+ </span>
120
+ );
57
121
  return (
58
122
  <span className={`field ${type}`}>
59
123
  {label && <>{label}: </>}
@@ -74,7 +74,7 @@ export default {
74
74
  };
75
75
 
76
76
  const Template = (args) => (
77
- <Banner {...args} image_url={args.image ? imgUrl : null}>
77
+ <Banner {...args} image={args.image ? imgUrl : null}>
78
78
  <Banner.Content
79
79
  actions={
80
80
  <>
@@ -143,8 +143,8 @@ Default.args = {
143
143
  subtitle: 'Lorem ipsum dolor',
144
144
  metadata: [
145
145
  { hidden: false, value: 'Briefing', type: 'type' },
146
- { hidden: false, value: 'Published Date', type: 'date' },
147
- { hidden: false, value: 'Modified Date', type: 'date' },
146
+ { hidden: false, label: 'Published', value: '25 Nov 2022', type: 'date' },
147
+ { hidden: false, label: 'Modified', value: '29 Nov 2022', type: 'date' },
148
148
  { hidden: false, value: '5 min read', type: '' },
149
149
  ],
150
150
  image: true,
@@ -17,6 +17,15 @@ export default {
17
17
  },
18
18
  },
19
19
  argTypes: {
20
+ titleOnImage: {
21
+ name: 'Display title on image',
22
+ table: {
23
+ type: {
24
+ summary: 'boolean',
25
+ },
26
+ defaultValue: { summary: false },
27
+ },
28
+ },
20
29
  variant: {
21
30
  options: ['default', 'primary', 'secondary', 'tertiary'],
22
31
  control: { type: 'select' },
@@ -28,140 +37,120 @@ export default {
28
37
  defaultValue: { summary: 'default' },
29
38
  },
30
39
  },
31
- cards: {
32
- description: 'cards data',
33
- table: {
34
- type: {
35
- summary: 'object',
36
- },
37
- defaultValue: { summary: '' },
38
- },
39
- },
40
40
  inverted: {
41
- description: 'Inverted card',
42
41
  table: {
43
42
  defaultValue: { summary: 'false' },
44
43
  type: { summary: 'boolean' },
45
44
  },
46
45
  },
46
+ cards: {
47
+ table: {
48
+ type: {
49
+ summary: 'Object',
50
+ },
51
+ defaultValue: { summary: ' "" ' },
52
+ },
53
+ },
47
54
  },
48
55
  };
49
56
 
50
- const MetaRight = (args) => (
51
- <span className="bold text-right">{args.metaRight}</span>
52
- );
53
-
54
- const Template = (args) => (
55
- <Container>
56
- <Card
57
- fluid={args.fluid}
58
- className={`${args.variant === 'default' ? '' : args.variant} ${
59
- args.inverted ? 'inverted' : ''
60
- }`}
61
- >
62
- {args.hasImage && (
57
+ const CardTemplate = ({ variant, inverted, titleOnImage, card }) => (
58
+ <Card
59
+ fluid={card.fluid}
60
+ className={`${variant === 'default' ? '' : variant} ${
61
+ inverted ? 'inverted' : ''
62
+ }`}
63
+ >
64
+ {/* Card Image */}
65
+ {card.hasImage ? (
66
+ titleOnImage ? (
67
+ <CardImage {...card} />
68
+ ) : (
63
69
  <Image
64
70
  as="a"
65
- href={args.href}
66
- src={args.imgUrl}
71
+ href={card.href}
72
+ src={card.imgUrl}
67
73
  wrapped
68
74
  ui={false}
69
75
  alt="card image"
70
76
  />
77
+ )
78
+ ) : (
79
+ ''
80
+ )}
81
+ <Card.Content>
82
+ {/* Type & Date */}
83
+ <Card.Meta>
84
+ {card.meta} <MetaRight {...card} />
85
+ </Card.Meta>
86
+
87
+ {/* Title */}
88
+ {!titleOnImage || !card.hasImage ? (
89
+ <Card.Header>{card.title}</Card.Header>
90
+ ) : (
91
+ ''
71
92
  )}
72
- <Card.Content>
73
- <Card.Meta>
74
- {args.meta} <MetaRight {...args} />
75
- </Card.Meta>
76
- <Card.Header>
77
- <a href={args.href}>{args.title}</a>
78
- </Card.Header>
79
- <Card.Description>{args.description}</Card.Description>
80
- </Card.Content>
81
- {args.links !== null &&
82
- args.links.map((item, index) => (
83
- <Card.Content extra key={index}>
84
- <a href={args.href}>{item.linkName}</a>
85
- </Card.Content>
86
- ))}
87
- </Card>
93
+
94
+ {/* Description */}
95
+ <Card.Description>{card.description}</Card.Description>
96
+ </Card.Content>
97
+
98
+ {/* Additional links */}
99
+ {card.links &&
100
+ card.links.map((item, index) => (
101
+ <Card.Content extra key={index}>
102
+ <a href={card.href}>{item.linkName}</a>
103
+ </Card.Content>
104
+ ))}
105
+ </Card>
106
+ );
107
+
108
+ const CardImage = (card) => (
109
+ <a href={card.href} className={'image'}>
110
+ <Image src={card.imgUrl} ui={false} alt="card image" />
111
+ <div className="gradient">
112
+ <Card.Header>{card.title}</Card.Header>
113
+ </div>
114
+ </a>
115
+ );
116
+
117
+ const MetaRight = (args) => (
118
+ <span className="bold text-right">{args.metaRight}</span>
119
+ );
120
+
121
+ const Template = (args) => (
122
+ <Container>
123
+ {args.cards.map((card, index) => (
124
+ <CardTemplate
125
+ variant={args.variant}
126
+ titleOnImage={args.titleOnImage}
127
+ inverted={args.inverted}
128
+ card={card}
129
+ key={index}
130
+ />
131
+ ))}
88
132
  </Container>
89
133
  );
90
134
 
91
135
  export const Default = Template.bind({});
92
136
  Default.args = {
137
+ titleOnImage: false,
93
138
  variant: 'default',
94
139
  inverted: false,
95
- imgUrl:
96
- 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
97
-
98
- meta: 'Article',
99
- metaRight: '30/07/2022',
100
- title: 'Lorem Ipsum',
101
- description:
102
- 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
103
- hasImage: true,
104
- href: '/#',
105
- links: null,
106
- fluid: false,
107
- };
108
- Default.argTypes = {
109
- imgUrl:
110
- 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
111
- hasImage: {
112
- description: 'true if card contains image',
113
- table: {
114
- type: {
115
- summary: 'boolean',
116
- },
117
- defaultValue: { summary: true },
118
- },
119
- },
120
- fluid: {
121
- description: 'take up the width of its container',
122
- table: {
123
- type: {
124
- summary: 'boolean',
125
- },
126
- defaultValue: { summary: false },
127
- },
128
- },
129
- meta: {
130
- description: 'Card metadata',
131
- table: {
132
- category: 'Card content',
133
- type: { summary: 'string' },
134
- defaultValue: { summary: ' "" ' },
135
- },
136
- },
137
- metaRight: {
138
- description: 'Card right metadata',
139
- table: {
140
- category: 'Card content',
141
- type: { summary: 'string' },
142
- defaultValue: { summary: ' "" ' },
143
- },
144
- },
145
- title: {
146
- description: 'card header',
147
- table: {
148
- category: 'Card content',
149
- type: { summary: 'string' },
150
- defaultValue: { summary: ' "" ' },
151
- },
152
- },
153
- description: {
154
- description: 'card main content',
155
- table: {
156
- category: 'Card content',
157
- type: { summary: 'string' },
158
- defaultValue: { summary: ' "" ' },
140
+ cards: [
141
+ {
142
+ title: 'Economy and resources',
143
+ imgUrl:
144
+ 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
145
+ description:
146
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
147
+ hasImage: true,
148
+ meta: 'Article',
149
+ metaRight: '30/07/2022',
150
+ href: '/#',
151
+ fluid: false,
159
152
  },
160
- },
161
- };
162
- Default.parameters = {
163
- controls: { exclude: ['cards', 'href', 'links'] },
164
- hideNoControlsWarning: true,
153
+ ],
165
154
  };
166
155
 
167
156
  const GridTemplate = (args) => (
@@ -169,38 +158,13 @@ const GridTemplate = (args) => (
169
158
  <Grid>
170
159
  {args.cards.map((card, index) => (
171
160
  <Grid.Column mobile={12} tablet={6} computer={4} key={index}>
172
- <Card
173
- fluid={card.fluid}
174
- className={`${args.variant === 'default' ? '' : args.variant} ${
175
- args.inverted ? 'inverted' : ''
176
- }`}
177
- >
178
- {card.hasImage && (
179
- <Image
180
- as="a"
181
- href={card.href}
182
- src={card.imgUrl}
183
- wrapped
184
- ui={false}
185
- alt="card image"
186
- />
187
- )}
188
- <Card.Content>
189
- <Card.Meta>
190
- {card.meta} <MetaRight {...card} />
191
- </Card.Meta>
192
- <Card.Header>
193
- <a href={args.href}>{card.title}</a>
194
- </Card.Header>
195
- <Card.Description>{card.description}</Card.Description>
196
- </Card.Content>
197
- {card.links !== null &&
198
- card.links.map((item, index) => (
199
- <Card.Content extra key={index}>
200
- <a href="/#">{item.linkName}</a>
201
- </Card.Content>
202
- ))}
203
- </Card>
161
+ <CardTemplate
162
+ variant={args.variant}
163
+ titleOnImage={args.titleOnImage}
164
+ inverted={args.inverted}
165
+ card={card}
166
+ key={index}
167
+ />
204
168
  </Grid.Column>
205
169
  ))}
206
170
  </Grid>
@@ -209,11 +173,12 @@ const GridTemplate = (args) => (
209
173
 
210
174
  export const CardGrid = GridTemplate.bind({});
211
175
  CardGrid.args = {
176
+ titleOnImage: false,
212
177
  variant: 'default',
213
178
  inverted: false,
214
179
  cards: [
215
180
  {
216
- title: 'Lorem Ipsum',
181
+ title: 'Nature',
217
182
  imgUrl:
218
183
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
219
184
  description:
@@ -222,11 +187,10 @@ CardGrid.args = {
222
187
  meta: 'Article',
223
188
  metaRight: '30/07/2022',
224
189
  href: '/#',
225
- links: null,
226
190
  fluid: true,
227
191
  },
228
192
  {
229
- title: 'Suspendisse iaculis feugiat',
193
+ title: 'Economy and resources',
230
194
  imgUrl:
231
195
  'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
232
196
  description:
@@ -235,71 +199,67 @@ CardGrid.args = {
235
199
  meta: 'Article',
236
200
  metaRight: '30/07/2022',
237
201
  href: '/#',
238
- links: null,
239
202
  fluid: true,
240
203
  },
241
204
  {
242
- title: 'Eget tellus blandit aenean mattis.',
205
+ title: "State of Europe's environment",
206
+ imgUrl:
207
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
243
208
  description:
244
209
  'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
245
- hasImage: false,
210
+ hasImage: true,
246
211
  meta: 'Article',
247
212
  metaRight: '30/07/2022',
248
213
  href: '/#',
249
- links: null,
250
214
  fluid: true,
251
215
  },
252
216
  ],
253
217
  };
254
- CardGrid.argTypes = {
255
- cards: {
256
- description: 'array with cards data',
257
- table: {
258
- type: {
259
- summary: 'Object',
260
- },
261
- defaultValue: { summary: ' "" ' },
218
+
219
+ export const ImageGrid = GridTemplate.bind({});
220
+ ImageGrid.args = {
221
+ titleOnImage: true,
222
+ variant: 'default',
223
+ inverted: false,
224
+ cards: [
225
+ {
226
+ title: 'Nature',
227
+ imgUrl:
228
+ 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
229
+ hasImage: true,
230
+ href: '/#',
231
+ fluid: true,
262
232
  },
263
- },
233
+ {
234
+ title: 'Economy and resources',
235
+ imgUrl:
236
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
237
+ hasImage: true,
238
+ href: '/#',
239
+ fluid: true,
240
+ },
241
+ {
242
+ title: "State of Europe's environment",
243
+ imgUrl:
244
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
245
+ hasImage: true,
246
+ href: '/#',
247
+ fluid: true,
248
+ },
249
+ ],
264
250
  };
265
251
 
266
252
  const FluidGridTemplate = (args) => (
267
253
  <Container>
268
254
  <div className="fluid-card-row">
269
255
  {args.cards.map((card, index) => (
270
- <Card
271
- fluid={card.fluid}
272
- className={`${args.variant === 'default' ? '' : args.variant} ${
273
- args.inverted ? 'inverted' : ''
274
- }`}
256
+ <CardTemplate
257
+ variant={args.variant}
258
+ titleOnImage={args.titleOnImage}
259
+ inverted={args.inverted}
260
+ card={card}
275
261
  key={index}
276
- >
277
- {card.hasImage && (
278
- <Image
279
- as="a"
280
- href={card.href}
281
- src={card.imgUrl}
282
- wrapped
283
- ui={false}
284
- alt="card image"
285
- />
286
- )}
287
- <Card.Content>
288
- <Card.Meta>
289
- {card.meta} <MetaRight {...card} />
290
- </Card.Meta>
291
- <Card.Header>
292
- <a href={args.href}>{card.title}</a>
293
- </Card.Header>
294
- <Card.Description>{card.description}</Card.Description>
295
- </Card.Content>
296
- {card.links !== null &&
297
- card.links.map((item, index) => (
298
- <Card.Content extra key={index}>
299
- <a href="/#">{item.linkName}</a>
300
- </Card.Content>
301
- ))}
302
- </Card>
262
+ />
303
263
  ))}
304
264
  </div>
305
265
  </Container>
@@ -307,11 +267,12 @@ const FluidGridTemplate = (args) => (
307
267
 
308
268
  export const FluidGrid = FluidGridTemplate.bind({});
309
269
  FluidGrid.args = {
270
+ titleOnImage: false,
310
271
  variant: 'default',
311
272
  inverted: false,
312
273
  cards: [
313
274
  {
314
- title: 'Lorem Ipsum',
275
+ title: 'Nature',
315
276
  imgUrl:
316
277
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
317
278
  description:
@@ -321,10 +282,9 @@ FluidGrid.args = {
321
282
  metaRight: '30/07/2022',
322
283
  href: '/#',
323
284
  fluid: true,
324
- links: null,
325
285
  },
326
286
  {
327
- title: 'Suspendisse iaculis feugiat',
287
+ title: 'Health',
328
288
  imgUrl:
329
289
  'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
330
290
  description:
@@ -334,32 +294,21 @@ FluidGrid.args = {
334
294
  metaRight: '30/07/2022',
335
295
  href: '/#',
336
296
  fluid: true,
337
- links: null,
338
297
  },
339
298
  {
340
- title: 'Eget tellus blandit aenean mattis.',
299
+ title: "State of Europe's environment",
300
+ imgUrl:
301
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
341
302
  description:
342
303
  'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
343
- hasImage: false,
304
+ hasImage: true,
344
305
  meta: 'Article',
345
306
  metaRight: '30/07/2022',
346
307
  href: '/#',
347
308
  fluid: true,
348
- links: null,
349
309
  },
350
310
  ],
351
311
  };
352
- CardGrid.argTypes = {
353
- cards: {
354
- description: 'array with cards data',
355
- table: {
356
- type: {
357
- summary: 'Object',
358
- },
359
- defaultValue: { summary: ' "" ' },
360
- },
361
- },
362
- };
363
312
 
364
313
  const Arrows = (props) => {
365
314
  const { slider = {} } = props;
@@ -394,36 +343,25 @@ const Arrows = (props) => {
394
343
  );
395
344
  };
396
345
 
397
- function CarouselCardsContent({ variant, inverted, settings, cards, ...rest }) {
346
+ function CarouselCardsContent({
347
+ titleOnImage,
348
+ variant,
349
+ inverted,
350
+ settings,
351
+ cards,
352
+ }) {
398
353
  const slider = React.useRef(null);
399
354
  return (
400
355
  <div className="cards-carousel">
401
356
  <Slider {...settings} ref={slider}>
402
357
  {cards.map((card, index) => (
403
- <Card
404
- fluid={card.fluid}
358
+ <CardTemplate
359
+ variant={variant}
360
+ titleOnImage={titleOnImage}
361
+ inverted={inverted}
362
+ card={card}
405
363
  key={index}
406
- className={`${variant === 'default' ? '' : variant} ${
407
- inverted ? 'inverted' : ''
408
- }`}
409
- >
410
- {card.hasImage && (
411
- <Image
412
- as="a"
413
- href={card.href}
414
- src={card.imgUrl}
415
- wrapped
416
- ui={false}
417
- alt="card image"
418
- />
419
- )}
420
- <Card.Content>
421
- <Card.Meta>{card.meta}</Card.Meta>
422
- <Card.Header>
423
- <a href={card.href}>{card.title}</a>
424
- </Card.Header>
425
- </Card.Content>
426
- </Card>
364
+ />
427
365
  ))}
428
366
  </Slider>
429
367
  <Arrows slider={slider} />
@@ -439,6 +377,7 @@ const CarouselCardsTemplate = (args) => (
439
377
 
440
378
  export const CarouselCards = CarouselCardsTemplate.bind({});
441
379
  CarouselCards.args = {
380
+ titleOnImage: false,
442
381
  variant: 'default',
443
382
  inverted: false,
444
383
  settings: {
@@ -468,7 +407,7 @@ CarouselCards.args = {
468
407
  },
469
408
  cards: [
470
409
  {
471
- title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
410
+ title: "State of Europe's environment",
472
411
  meta: 'March 20, 2022.',
473
412
  imgUrl:
474
413
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
@@ -477,7 +416,7 @@ CarouselCards.args = {
477
416
  fluid: true,
478
417
  },
479
418
  {
480
- title: 'Lorem ipsum.',
419
+ title: 'Nature',
481
420
  meta: 'March 20, 2022.',
482
421
  imgUrl:
483
422
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
@@ -486,7 +425,7 @@ CarouselCards.args = {
486
425
  fluid: true,
487
426
  },
488
427
  {
489
- title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
428
+ title: 'Health',
490
429
  meta: 'March 20, 2022.',
491
430
  imgUrl:
492
431
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
@@ -495,8 +434,7 @@ CarouselCards.args = {
495
434
  fluid: true,
496
435
  },
497
436
  {
498
- title:
499
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean massa strong.',
437
+ title: 'Climate',
500
438
  meta: 'March 20, 2022.',
501
439
  imgUrl:
502
440
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
@@ -505,7 +443,7 @@ CarouselCards.args = {
505
443
  fluid: true,
506
444
  },
507
445
  {
508
- title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
446
+ title: 'Economy and resources',
509
447
  meta: 'March 20, 2022.',
510
448
  imgUrl:
511
449
  'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
@@ -135,5 +135,4 @@
135
135
  @import (optional) "@{siteFolder}/@{addon}/@{addontype}s/@{addonelement}.overrides";
136
136
  }
137
137
 
138
-
139
138
  /* End Config */
@@ -91,13 +91,20 @@
91
91
  background-size: @imageBackgroundSize;
92
92
 
93
93
  .gradient {
94
- background-image: @backgroundGradientWithImage;
95
-
96
94
  .content {
97
95
  padding: @mobileContentPaddingWithImage;
98
96
  }
99
97
  }
100
98
  }
99
+
100
+ .documentFirstHeading {
101
+ border-bottom: @titleBorderBottom;
102
+ margin-bottom: @titleMarginBottom;
103
+
104
+ &::before {
105
+ content: @titleBorderBottom;
106
+ }
107
+ }
101
108
  }
102
109
 
103
110
  /*Share Popup*/
@@ -218,4 +225,3 @@
218
225
  }
219
226
 
220
227
  .loadUIOverrides();
221
-
@@ -10,8 +10,7 @@
10
10
  @imageBackgroundPosition : center;
11
11
 
12
12
  /* Gradient */
13
- @backgroundGradient : linear-gradient(8deg, #0c1b28b3 32%, rgba(0, 36, 78, 0) 80%);
14
- @backgroundGradientWithImage : linear-gradient(0deg, rgb(20, 33, 44, 90%) 24%, rgba(0, 36, 78, 0) 80%);
13
+ @backgroundGradient : linear-gradient(8deg,rgba(12,27,40, 0.7) 32%,rgba(0,36,78,0) 80%);
15
14
  @backgroundGradientOpacity : 1;
16
15
 
17
16
  /* Content */
@@ -26,15 +25,18 @@
26
25
  /* Title */
27
26
  @titleFontWeight : @bold;
28
27
  @titleMaxWidth : 100%;
29
- @mobileTitleFontSize : 1.25rem;
30
- @tabletTitleFontSize : 2.25rem;
31
- @computerTitleFontSize : 3rem;
32
- @mobileTitleLineHeight : 1.375rem;
33
- @tabletTitleLineHeight : 2.75rem;
34
- @computerTitleLineHeight : 3.5rem;
35
- @mobileTitleMargin : 0 0 0.5rem 0;
36
- @tabletTitleMargin : 0 0 0.813rem 0;
37
- @computerTitleMargin : 0 0 1.125rem 0;
28
+ @titleMarginBottom : 0;
29
+ @titleBorderBottom : none;
30
+ @mobileTitleFontSize : @mobileH1;
31
+ @tabletTitleFontSize : @h2;
32
+ @computerTitleFontSize : @h1;
33
+ @mobileTitleLineHeight : @headerLineHeight;
34
+ @tabletTitleLineHeight : @headerLineHeight;
35
+ @computerTitleLineHeight : @headerLineHeight;
36
+ @mobileTitleMargin : 0 0 0 0;
37
+ @tabletTitleMargin : 0 0 0 0;
38
+ @computerTitleMargin : 0 0 0 0;
39
+
38
40
 
39
41
  /* Subtitle */
40
42
  @subtitleFontWeight : @bold;
@@ -85,4 +87,4 @@
85
87
  @sharePopupLineHeight: 1rem;
86
88
  // Actions
87
89
  @sharePopupActionsIconColor: @pineGreen;
88
- @sharePopupActionsIconMargin: 0;
90
+ @sharePopupActionsIconMargin: 0;
@@ -11,7 +11,7 @@ footer {
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  align-items: center;
14
- background: @mobileFooterBackgroundGrandient;
14
+ background: @mobileFooterBackgroundGradient;
15
15
  color: @white;
16
16
 
17
17
  .footer-wrapper {
@@ -78,7 +78,7 @@ footer .theme-sites {
78
78
  display: flex;
79
79
  justify-content: @mobileSocialJustifyContent;
80
80
  margin: @mobileSocialIconsMargin;
81
-
81
+
82
82
  a {
83
83
  color: @socialIconColor;
84
84
 
@@ -132,7 +132,7 @@ footer .footer-wrapper .menu {
132
132
 
133
133
  @media only screen and (min-width: @tabletBreakpoint) {
134
134
  footer {
135
- background: @computerFooterBackgroundGrandient;
135
+ background: @computerFooterBackgroundGradient;
136
136
  }
137
137
  footer .theme-sites {
138
138
  .header {
@@ -246,11 +246,11 @@ footer .footer-wrapper .menu {
246
246
  }
247
247
 
248
248
  .footer .footer-wrapper .menu {
249
-
249
+
250
250
  a {
251
251
  font-size: @computerMenuFontSize;
252
252
  }
253
- }
253
+ }
254
254
  }
255
255
 
256
- .loadUIOverrides();
256
+ .loadUIOverrides();
@@ -2,9 +2,9 @@
2
2
  Footer
3
3
  *******************************/
4
4
 
5
- /* @footerBackgroundGrandient: linear-gradient(220.4deg, #009591 8.29%, #2E3E4C 56.3%, #212D38 89.06%); */
6
- @mobileFooterBackgroundGrandient: linear-gradient(220.4deg, @green-5 8.29%, @blue-grey-6 56.3%, #212D38 89.06%);
7
- @computerFooterBackgroundGrandient: linear-gradient(212.33deg, @green-5 6.78%, #212D38 69.54%, #212D38 98.23%);
5
+ /* @footerBackgroundGradient: linear-gradient(220.4deg, #009591 8.29%, #2E3E4C 56.3%, #212D38 89.06%); */
6
+ @mobileFooterBackgroundGradient: linear-gradient(220.4deg, @green-5 8.29%, @blue-grey-6 56.3%, #212D38 89.06%);
7
+ @computerFooterBackgroundGradient: linear-gradient(212.33deg, @green-5 6.78%, #212D38 69.54%, #212D38 98.23%);
8
8
 
9
9
  /* Titles */
10
10
  @footerTitleFontWeight : @font-weight-7;
@@ -833,7 +833,8 @@
833
833
  display: none;
834
834
  }
835
835
 
836
- #main #mega-menu .ui.accordion .title:first-child + .content {
836
+ // hide content of accordion titles that are not active
837
+ #main #mega-menu .ui.accordion .title:first-child + .content:not(.active) {
837
838
  display: none;
838
839
  }
839
840
 
@@ -0,0 +1,16 @@
1
+ // Gradient Mixin
2
+ .gradientMix(@type; @colors; @dir: 0deg; @prefixes: webkit, moz, ms, o; @index: length(@prefixes)) when (@index > 0) {
3
+ .gradientMix(@type; @colors; @dir; @prefixes; (@index - 1));
4
+
5
+ @prefix : extract(@prefixes, @index);
6
+ @dir-old : 90 - (@dir);
7
+
8
+ background-image: ~"-@{prefix}-@{type}-gradient(@{dir-old}, @{colors})";
9
+ & when ( @index = length(@prefixes) ) {
10
+ background-image: ~"@{type}-gradient(@{dir}, @{colors})";
11
+ }
12
+ }
13
+
14
+ .image-overlay-gradient() {
15
+ .gradientMix(linear; rgba(46, 62, 76, 0.65) 38.6%, rgba(46, 62, 76, 0.169) 59.52%, rgba(69, 95, 106, 0) 79.64%; 13.39deg)
16
+ }
@@ -3,6 +3,7 @@
3
3
  *******************************/
4
4
 
5
5
  @import '@eeacms/volto-eea-design-system/../theme/themes/eea/tokens/tokens';
6
+ @import '@eeacms/volto-eea-design-system/../theme/themes/eea/globals/mixins';
6
7
 
7
8
  /*-------------------
8
9
  Fonts
@@ -209,7 +210,7 @@
209
210
 
210
211
  @linkColor : @blue-4;
211
212
  @linkHoverColor : @blue-5;
212
- @linkVisitedColor : @purple-5;
213
+ @linkVisitedColor : @purple-4;
213
214
  @linkActiveColor : @blue-6;
214
215
  @linkUnderline : none;
215
216
  @linkHoverUnderline : @linkUnderline;
@@ -10,7 +10,7 @@
10
10
  @purple-1: #DFD6E7;
11
11
  @purple-2: #BEADCE;
12
12
  @purple-3: #9E84B6;
13
- @purple-4: #7D5B9D;
13
+ @purple-4: #753AAD;
14
14
  @purple-5: #5C3285;
15
15
  @purple-6: #3C096C;
16
16
 
@@ -14,6 +14,7 @@
14
14
 
15
15
  /* Cards must have same height */
16
16
  .ui.card {
17
+ min-width: @minWidth;
17
18
  height: 100%;
18
19
  text-align: var(--text-align, @cardTextAlign);
19
20
  background-color: var(--card-background-color, @background);
@@ -24,6 +25,7 @@
24
25
  margin-left: @cardMetaDateMarginLeft;
25
26
  }
26
27
 
28
+ .ui.cards > .card:not(.rounded) > .image,
27
29
  .ui.card:not(.rounded) > .image {
28
30
  overflow: @cardImageOverflow;
29
31
  height: @cardImageHeight;
@@ -249,6 +251,46 @@
249
251
  }
250
252
  }
251
253
 
254
+ /*******************************
255
+ Image with title
256
+ *******************************/
257
+ // Adding the default image css for image inside image-with-title
258
+ .ui.cards > .card > .image {
259
+ position: relative;
260
+ display: block;
261
+ flex: 0 0 auto;
262
+ padding: 0;
263
+ background: transparent;
264
+ }
265
+
266
+
267
+ .card .gradient {
268
+ display: flex;
269
+ align-items: end;
270
+ position: absolute;
271
+ bottom: 0;
272
+ width: 100%;
273
+ height: 100%;
274
+ padding: @imageTitlePadding;
275
+ .image-overlay-gradient();
276
+ }
277
+
278
+ .gradient .header {
279
+ font-size: var(--image-header-font-size, @imageTitleMobileFontSize);
280
+ color: @imageTitleColor;
281
+ font-weight: @imageTitleFontWeight;
282
+ line-height: @imageTitleLineHeight;
283
+ }
284
+
285
+ @media only screen and (min-width: @tabletBreakpoint) {
286
+ .card .gradient {
287
+ padding-block: @imageTitlePaddingBlock;
288
+ }
289
+ .gradient .header {
290
+ --image-header-font-size: @imageTitleFontSize;
291
+ }
292
+ }
293
+
252
294
  /*******************************
253
295
  Carousel
254
296
  *******************************/
@@ -22,6 +22,7 @@
22
22
  @minHeight: 0px;
23
23
  @padding: 0em;
24
24
  @width: 290px;
25
+ @minWidth: 250px;
25
26
  @borderWidth: 1px;
26
27
  @borderShadow: 0px 0px 0px @borderWidth @solidBorderColor;
27
28
  @boxShadow: @eeaGlobalShadow;
@@ -262,6 +263,17 @@
262
263
  @invertedTertiaryCardColor: @tertiaryColor;
263
264
  @invertedTertiaryCardBackgroundColor: @white;
264
265
 
266
+ /*******************************
267
+ Image with title
268
+ *******************************/
269
+ @imageTitleColor: @white;
270
+ @imageTitleFontSize: @h2;
271
+ @imageTitleMobileFontSize: @mobileH1;
272
+ @imageTitleFontWeight: @font-weight-7;
273
+ @imageTitleLineHeight: @font-lineheight-0;
274
+ @imageTitlePadding: @rem-space-6;
275
+ @imageTitlePaddingBlock: @rem-space-4;
276
+
265
277
  /*******************************
266
278
  Rounded Card
267
279
  *******************************/