@eeacms/volto-eea-design-system 0.7.5 → 0.8.1
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 +88 -0
- package/mockups/EEA component library.fig +0 -0
- package/mockups/page-templates/R1 R3 templates.fig +0 -0
- package/mockups/page-templates/WISE BISE FISE.fig +0 -0
- package/mockups/page-templates/datahub/Data hub updated proposal.fig +0 -0
- package/mockups/page-templates/homepage_selected_upd1.fig +0 -0
- package/mockups/special-designs/Mega Menu.fig +0 -0
- package/mockups/special-designs/New footer.fig +0 -0
- package/mockups/special-designs/Search (Final).fig +0 -0
- package/mockups/special-designs/Side Navigation.fig +0 -0
- package/package.json +1 -1
- package/src/ui/Card/AvatarGrid/AvatarGrid.jsx +25 -13
- package/src/ui/Card/AvatarGrid/AvatarGrid.stories.jsx +33 -13
- package/src/ui/Card/Card.stories.jsx +173 -77
- package/src/ui/Card/IconCard/IconCard.stories.jsx +195 -0
- package/src/ui/Card/PublicationCard.stories.jsx +15 -3
- package/src/ui/Card/RelatedContent/RelatedContent.jsx +30 -8
- package/src/ui/Card/RelatedContent/RelatedContent.stories.jsx +20 -0
- package/src/ui/Card/RoundedCard.stories.jsx +46 -20
- package/src/ui/Footer/Contact.jsx +11 -7
- package/src/ui/Footer/Footer.jsx +1 -1
- package/src/ui/Footer/FooterActions.jsx +24 -7
- package/src/ui/Footer/FooterHeader.jsx +1 -1
- package/src/ui/Footer/FooterSites.jsx +22 -10
- package/src/ui/Footer/SubFooter.jsx +42 -38
- package/theme/themes/eea/assets/images/Footer/Extras/footervisual.svg +2041 -1731
- package/theme/themes/eea/collections/breadcrumb.overrides +4 -0
- package/theme/themes/eea/collections/breadcrumb.variables +1 -1
- package/theme/themes/eea/collections/message.overrides +19 -20
- package/theme/themes/eea/collections/message.variables +45 -23
- package/theme/themes/eea/extras/banner.less +0 -8
- package/theme/themes/eea/extras/custom.overrides +4 -1
- package/theme/themes/eea/extras/footer.less +69 -59
- package/theme/themes/eea/extras/footer.variables +31 -35
- package/theme/themes/eea/extras/header.variables +1 -1
- package/theme/themes/eea/globals/site.overrides +20 -0
- package/theme/themes/eea/globals/site.variables +31 -28
- package/theme/themes/eea/globals/utilities.less +6 -1
- package/theme/themes/eea/tokens/fonts.less +18 -17
- package/theme/themes/eea/views/card.overrides +179 -123
- package/theme/themes/eea/views/card.variables +34 -33
- package/theme/themes/eea/views/item.overrides +15 -1
- package/theme/themes/eea/views/item.variables +5 -2
|
@@ -14,15 +14,15 @@ export default {
|
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
argTypes: {
|
|
17
|
-
|
|
18
|
-
options: [
|
|
17
|
+
variant: {
|
|
18
|
+
options: ['default', 'primary', 'secondary', 'tertiary'],
|
|
19
19
|
control: { type: 'select' },
|
|
20
20
|
description: 'card variation class',
|
|
21
21
|
table: {
|
|
22
22
|
type: {
|
|
23
23
|
summary: 'string',
|
|
24
24
|
},
|
|
25
|
-
defaultValue: { summary: '
|
|
25
|
+
defaultValue: { summary: 'default' },
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
cards: {
|
|
@@ -34,23 +34,51 @@ export default {
|
|
|
34
34
|
defaultValue: { summary: '' },
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
|
+
inverted: {
|
|
38
|
+
description: 'Inverted card',
|
|
39
|
+
table: {
|
|
40
|
+
defaultValue: { summary: 'false' },
|
|
41
|
+
type: { summary: 'boolean' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
37
44
|
},
|
|
38
45
|
};
|
|
39
46
|
|
|
47
|
+
const MetaRight = (args) => (
|
|
48
|
+
<span className="bold text-right">{args.metaRight}</span>
|
|
49
|
+
);
|
|
50
|
+
|
|
40
51
|
const Template = (args) => (
|
|
41
52
|
<Container>
|
|
42
|
-
<Card
|
|
53
|
+
<Card
|
|
54
|
+
fluid={args.fluid}
|
|
55
|
+
className={`${args.variant === 'default' ? '' : args.variant} ${
|
|
56
|
+
args.inverted ? 'inverted' : ''
|
|
57
|
+
}`}
|
|
58
|
+
>
|
|
43
59
|
{args.hasImage && (
|
|
44
|
-
<Image
|
|
60
|
+
<Image
|
|
61
|
+
as="a"
|
|
62
|
+
href={args.href}
|
|
63
|
+
src={args.imgUrl}
|
|
64
|
+
wrapped
|
|
65
|
+
ui={false}
|
|
66
|
+
alt="card image"
|
|
67
|
+
/>
|
|
45
68
|
)}
|
|
46
69
|
<Card.Content>
|
|
47
|
-
<Card.
|
|
70
|
+
<Card.Meta>
|
|
71
|
+
{args.meta} <MetaRight {...args} />
|
|
72
|
+
</Card.Meta>
|
|
73
|
+
<Card.Header>
|
|
74
|
+
<a href={args.href}>{args.title}</a>
|
|
75
|
+
</Card.Header>
|
|
48
76
|
<Card.Description>{args.description}</Card.Description>
|
|
49
77
|
</Card.Content>
|
|
50
78
|
{args.links !== null &&
|
|
51
79
|
args.links.map((item, index) => (
|
|
52
80
|
<Card.Content extra key={index}>
|
|
53
|
-
<a href=
|
|
81
|
+
<a href={args.href}>{item.linkName}</a>
|
|
54
82
|
</Card.Content>
|
|
55
83
|
))}
|
|
56
84
|
</Card>
|
|
@@ -59,15 +87,20 @@ const Template = (args) => (
|
|
|
59
87
|
|
|
60
88
|
export const Default = Template.bind({});
|
|
61
89
|
Default.args = {
|
|
62
|
-
|
|
90
|
+
variant: 'default',
|
|
91
|
+
inverted: false,
|
|
63
92
|
imgUrl:
|
|
64
93
|
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
|
|
94
|
+
|
|
95
|
+
meta: 'Article',
|
|
96
|
+
metaRight: '30/07/2022',
|
|
65
97
|
title: 'Lorem Ipsum',
|
|
66
98
|
description:
|
|
67
99
|
'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
|
|
68
100
|
hasImage: true,
|
|
101
|
+
href: '/#',
|
|
102
|
+
links: null,
|
|
69
103
|
fluid: false,
|
|
70
|
-
links: [{ linkName: 'Link 1' }],
|
|
71
104
|
};
|
|
72
105
|
Default.argTypes = {
|
|
73
106
|
imgUrl:
|
|
@@ -81,45 +114,50 @@ Default.argTypes = {
|
|
|
81
114
|
defaultValue: { summary: true },
|
|
82
115
|
},
|
|
83
116
|
},
|
|
84
|
-
|
|
85
|
-
description: '
|
|
117
|
+
fluid: {
|
|
118
|
+
description: 'take up the width of its container',
|
|
86
119
|
table: {
|
|
87
120
|
type: {
|
|
88
|
-
summary: '
|
|
121
|
+
summary: 'boolean',
|
|
89
122
|
},
|
|
123
|
+
defaultValue: { summary: false },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
meta: {
|
|
127
|
+
description: 'Card metadata',
|
|
128
|
+
table: {
|
|
129
|
+
category: 'Card content',
|
|
130
|
+
type: { summary: 'string' },
|
|
90
131
|
defaultValue: { summary: ' "" ' },
|
|
91
132
|
},
|
|
92
133
|
},
|
|
93
|
-
|
|
94
|
-
description: '
|
|
134
|
+
metaRight: {
|
|
135
|
+
description: 'Card right metadata',
|
|
95
136
|
table: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
137
|
+
category: 'Card content',
|
|
138
|
+
type: { summary: 'string' },
|
|
99
139
|
defaultValue: { summary: ' "" ' },
|
|
100
140
|
},
|
|
101
141
|
},
|
|
102
|
-
|
|
103
|
-
description: '
|
|
142
|
+
title: {
|
|
143
|
+
description: 'card header',
|
|
104
144
|
table: {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
defaultValue: { summary: false },
|
|
145
|
+
category: 'Card content',
|
|
146
|
+
type: { summary: 'string' },
|
|
147
|
+
defaultValue: { summary: ' "" ' },
|
|
109
148
|
},
|
|
110
149
|
},
|
|
111
|
-
|
|
112
|
-
description: '
|
|
150
|
+
description: {
|
|
151
|
+
description: 'card main content',
|
|
113
152
|
table: {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
153
|
+
category: 'Card content',
|
|
154
|
+
type: { summary: 'string' },
|
|
117
155
|
defaultValue: { summary: ' "" ' },
|
|
118
156
|
},
|
|
119
157
|
},
|
|
120
158
|
};
|
|
121
159
|
Default.parameters = {
|
|
122
|
-
controls: { exclude: ['cards'] },
|
|
160
|
+
controls: { exclude: ['cards', 'href', 'links'] },
|
|
123
161
|
hideNoControlsWarning: true,
|
|
124
162
|
};
|
|
125
163
|
|
|
@@ -128,12 +166,29 @@ const GridTemplate = (args) => (
|
|
|
128
166
|
<Grid>
|
|
129
167
|
{args.cards.map((card, index) => (
|
|
130
168
|
<Grid.Column mobile={12} tablet={6} computer={4} key={index}>
|
|
131
|
-
<Card
|
|
169
|
+
<Card
|
|
170
|
+
fluid={card.fluid}
|
|
171
|
+
className={`${args.variant === 'default' ? '' : args.variant} ${
|
|
172
|
+
args.inverted ? 'inverted' : ''
|
|
173
|
+
}`}
|
|
174
|
+
>
|
|
132
175
|
{card.hasImage && (
|
|
133
|
-
<Image
|
|
176
|
+
<Image
|
|
177
|
+
as="a"
|
|
178
|
+
href={card.href}
|
|
179
|
+
src={card.imgUrl}
|
|
180
|
+
wrapped
|
|
181
|
+
ui={false}
|
|
182
|
+
alt="card image"
|
|
183
|
+
/>
|
|
134
184
|
)}
|
|
135
185
|
<Card.Content>
|
|
136
|
-
<Card.
|
|
186
|
+
<Card.Meta>
|
|
187
|
+
{card.meta} <MetaRight {...card} />
|
|
188
|
+
</Card.Meta>
|
|
189
|
+
<Card.Header>
|
|
190
|
+
<a href={args.href}>{card.title}</a>
|
|
191
|
+
</Card.Header>
|
|
137
192
|
<Card.Description>{card.description}</Card.Description>
|
|
138
193
|
</Card.Content>
|
|
139
194
|
{card.links !== null &&
|
|
@@ -151,7 +206,8 @@ const GridTemplate = (args) => (
|
|
|
151
206
|
|
|
152
207
|
export const CardGrid = GridTemplate.bind({});
|
|
153
208
|
CardGrid.args = {
|
|
154
|
-
|
|
209
|
+
variant: 'default',
|
|
210
|
+
inverted: false,
|
|
155
211
|
cards: [
|
|
156
212
|
{
|
|
157
213
|
title: 'Lorem Ipsum',
|
|
@@ -160,8 +216,11 @@ CardGrid.args = {
|
|
|
160
216
|
description:
|
|
161
217
|
'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
|
|
162
218
|
hasImage: true,
|
|
219
|
+
meta: 'Article',
|
|
220
|
+
metaRight: '30/07/2022',
|
|
221
|
+
href: '/#',
|
|
222
|
+
links: null,
|
|
163
223
|
fluid: true,
|
|
164
|
-
links: [{ linkName: 'Link 1' }],
|
|
165
224
|
},
|
|
166
225
|
{
|
|
167
226
|
title: 'Suspendisse iaculis feugiat',
|
|
@@ -170,16 +229,22 @@ CardGrid.args = {
|
|
|
170
229
|
description:
|
|
171
230
|
'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
|
|
172
231
|
hasImage: true,
|
|
232
|
+
meta: 'Article',
|
|
233
|
+
metaRight: '30/07/2022',
|
|
234
|
+
href: '/#',
|
|
235
|
+
links: null,
|
|
173
236
|
fluid: true,
|
|
174
|
-
links: [{ linkName: 'Link 1' }],
|
|
175
237
|
},
|
|
176
238
|
{
|
|
177
239
|
title: 'Eget tellus blandit aenean mattis.',
|
|
178
240
|
description:
|
|
179
241
|
'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.',
|
|
180
242
|
hasImage: false,
|
|
243
|
+
meta: 'Article',
|
|
244
|
+
metaRight: '30/07/2022',
|
|
245
|
+
href: '/#',
|
|
246
|
+
links: null,
|
|
181
247
|
fluid: true,
|
|
182
|
-
links: [{ linkName: 'Link 1' }],
|
|
183
248
|
},
|
|
184
249
|
],
|
|
185
250
|
};
|
|
@@ -199,12 +264,30 @@ const FluidGridTemplate = (args) => (
|
|
|
199
264
|
<Container>
|
|
200
265
|
<div className="fluid-card-row">
|
|
201
266
|
{args.cards.map((card, index) => (
|
|
202
|
-
<Card
|
|
267
|
+
<Card
|
|
268
|
+
fluid={card.fluid}
|
|
269
|
+
className={`${args.variant === 'default' ? '' : args.variant} ${
|
|
270
|
+
args.inverted ? 'inverted' : ''
|
|
271
|
+
}`}
|
|
272
|
+
key={index}
|
|
273
|
+
>
|
|
203
274
|
{card.hasImage && (
|
|
204
|
-
<Image
|
|
275
|
+
<Image
|
|
276
|
+
as="a"
|
|
277
|
+
href={card.href}
|
|
278
|
+
src={card.imgUrl}
|
|
279
|
+
wrapped
|
|
280
|
+
ui={false}
|
|
281
|
+
alt="card image"
|
|
282
|
+
/>
|
|
205
283
|
)}
|
|
206
284
|
<Card.Content>
|
|
207
|
-
<Card.
|
|
285
|
+
<Card.Meta>
|
|
286
|
+
{card.meta} <MetaRight {...card} />
|
|
287
|
+
</Card.Meta>
|
|
288
|
+
<Card.Header>
|
|
289
|
+
<a href={args.href}>{card.title}</a>
|
|
290
|
+
</Card.Header>
|
|
208
291
|
<Card.Description>{card.description}</Card.Description>
|
|
209
292
|
</Card.Content>
|
|
210
293
|
{card.links !== null &&
|
|
@@ -221,7 +304,8 @@ const FluidGridTemplate = (args) => (
|
|
|
221
304
|
|
|
222
305
|
export const FluidGrid = FluidGridTemplate.bind({});
|
|
223
306
|
FluidGrid.args = {
|
|
224
|
-
|
|
307
|
+
variant: 'default',
|
|
308
|
+
inverted: false,
|
|
225
309
|
cards: [
|
|
226
310
|
{
|
|
227
311
|
title: 'Lorem Ipsum',
|
|
@@ -230,8 +314,11 @@ FluidGrid.args = {
|
|
|
230
314
|
description:
|
|
231
315
|
'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
|
|
232
316
|
hasImage: true,
|
|
317
|
+
meta: 'Article',
|
|
318
|
+
metaRight: '30/07/2022',
|
|
319
|
+
href: '/#',
|
|
233
320
|
fluid: true,
|
|
234
|
-
links:
|
|
321
|
+
links: null,
|
|
235
322
|
},
|
|
236
323
|
{
|
|
237
324
|
title: 'Suspendisse iaculis feugiat',
|
|
@@ -240,16 +327,22 @@ FluidGrid.args = {
|
|
|
240
327
|
description:
|
|
241
328
|
'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
|
|
242
329
|
hasImage: true,
|
|
330
|
+
meta: 'Article',
|
|
331
|
+
metaRight: '30/07/2022',
|
|
332
|
+
href: '/#',
|
|
243
333
|
fluid: true,
|
|
244
|
-
links:
|
|
334
|
+
links: null,
|
|
245
335
|
},
|
|
246
336
|
{
|
|
247
337
|
title: 'Eget tellus blandit aenean mattis.',
|
|
248
338
|
description:
|
|
249
339
|
'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.',
|
|
250
340
|
hasImage: false,
|
|
341
|
+
meta: 'Article',
|
|
342
|
+
metaRight: '30/07/2022',
|
|
343
|
+
href: '/#',
|
|
251
344
|
fluid: true,
|
|
252
|
-
links:
|
|
345
|
+
links: null,
|
|
253
346
|
},
|
|
254
347
|
],
|
|
255
348
|
};
|
|
@@ -272,7 +365,7 @@ const Arrows = (props) => {
|
|
|
272
365
|
<>
|
|
273
366
|
<Button
|
|
274
367
|
aria-label="Previous slide"
|
|
275
|
-
className="slider-arrow prev-arrow"
|
|
368
|
+
className="slider-arrow prev-arrow tablet or lower hidden"
|
|
276
369
|
icon
|
|
277
370
|
onClick={() => {
|
|
278
371
|
if (slider.current) {
|
|
@@ -284,7 +377,7 @@ const Arrows = (props) => {
|
|
|
284
377
|
</Button>
|
|
285
378
|
<Button
|
|
286
379
|
aria-label="Next slide"
|
|
287
|
-
className="slider-arrow next-arrow"
|
|
380
|
+
className="slider-arrow next-arrow tablet or lower hidden"
|
|
288
381
|
icon
|
|
289
382
|
onClick={() => {
|
|
290
383
|
if (slider.current) {
|
|
@@ -298,27 +391,35 @@ const Arrows = (props) => {
|
|
|
298
391
|
);
|
|
299
392
|
};
|
|
300
393
|
|
|
301
|
-
function CarouselCardsContent({ settings, cards, ...rest }) {
|
|
394
|
+
function CarouselCardsContent({ variant, inverted, settings, cards, ...rest }) {
|
|
302
395
|
const slider = React.useRef(null);
|
|
303
396
|
return (
|
|
304
397
|
<div className="cards-carousel">
|
|
305
398
|
<Slider {...settings} ref={slider}>
|
|
306
399
|
{cards.map((card, index) => (
|
|
307
|
-
<Card
|
|
400
|
+
<Card
|
|
401
|
+
fluid={card.fluid}
|
|
402
|
+
key={index}
|
|
403
|
+
className={`${variant === 'default' ? '' : variant} ${
|
|
404
|
+
inverted ? 'inverted' : ''
|
|
405
|
+
}`}
|
|
406
|
+
>
|
|
308
407
|
{card.hasImage && (
|
|
309
|
-
<Image
|
|
408
|
+
<Image
|
|
409
|
+
as="a"
|
|
410
|
+
href={card.href}
|
|
411
|
+
src={card.imgUrl}
|
|
412
|
+
wrapped
|
|
413
|
+
ui={false}
|
|
414
|
+
alt="card image"
|
|
415
|
+
/>
|
|
310
416
|
)}
|
|
311
417
|
<Card.Content>
|
|
312
418
|
<Card.Meta>{card.meta}</Card.Meta>
|
|
313
|
-
|
|
314
|
-
|
|
419
|
+
<Card.Header>
|
|
420
|
+
<a href={card.href}>{card.title}</a>
|
|
421
|
+
</Card.Header>
|
|
315
422
|
</Card.Content>
|
|
316
|
-
{/* {card.links !== null &&
|
|
317
|
-
card.links.map((item, index) => (
|
|
318
|
-
<Card.Content extra key={index}>
|
|
319
|
-
<a href="/#">{item.linkName}</a>
|
|
320
|
-
</Card.Content>
|
|
321
|
-
))} */}
|
|
322
423
|
</Card>
|
|
323
424
|
))}
|
|
324
425
|
</Slider>
|
|
@@ -335,19 +436,21 @@ const CarouselCardsTemplate = (args) => (
|
|
|
335
436
|
|
|
336
437
|
export const CarouselCards = CarouselCardsTemplate.bind({});
|
|
337
438
|
CarouselCards.args = {
|
|
338
|
-
|
|
339
|
-
|
|
439
|
+
variant: 'default',
|
|
440
|
+
inverted: false,
|
|
340
441
|
settings: {
|
|
341
442
|
dots: true,
|
|
342
443
|
infinite: true,
|
|
343
444
|
slidesToShow: 4,
|
|
344
445
|
slidesToScroll: 1,
|
|
446
|
+
arrows: false,
|
|
345
447
|
responsive: [
|
|
346
448
|
{
|
|
347
449
|
breakpoint: tabletBreakpoint,
|
|
348
450
|
settings: {
|
|
349
451
|
slidesToShow: 3,
|
|
350
452
|
slidesToScroll: 1,
|
|
453
|
+
arrows: false,
|
|
351
454
|
},
|
|
352
455
|
},
|
|
353
456
|
{
|
|
@@ -355,64 +458,57 @@ CarouselCards.args = {
|
|
|
355
458
|
settings: {
|
|
356
459
|
slidesToShow: 1,
|
|
357
460
|
slidesToScroll: 1,
|
|
461
|
+
arrows: false,
|
|
358
462
|
},
|
|
359
463
|
},
|
|
360
464
|
],
|
|
361
465
|
},
|
|
362
466
|
cards: [
|
|
363
467
|
{
|
|
468
|
+
title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
364
469
|
meta: 'March 20, 2022.',
|
|
365
470
|
imgUrl:
|
|
366
471
|
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
|
|
367
|
-
description:
|
|
368
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non ',
|
|
369
472
|
hasImage: true,
|
|
473
|
+
href: '/#',
|
|
370
474
|
fluid: true,
|
|
371
|
-
links: [{ linkName: 'Link 1' }],
|
|
372
475
|
},
|
|
373
476
|
{
|
|
374
|
-
title: 'Lorem
|
|
477
|
+
title: 'Lorem ipsum.',
|
|
375
478
|
meta: 'March 20, 2022.',
|
|
376
479
|
imgUrl:
|
|
377
480
|
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
|
|
378
|
-
description:
|
|
379
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non ',
|
|
380
481
|
hasImage: true,
|
|
482
|
+
href: '/#',
|
|
381
483
|
fluid: true,
|
|
382
|
-
links: [{ linkName: 'Link 1' }],
|
|
383
484
|
},
|
|
384
485
|
{
|
|
385
|
-
title: 'Lorem
|
|
486
|
+
title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
386
487
|
meta: 'March 20, 2022.',
|
|
387
488
|
imgUrl:
|
|
388
489
|
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
|
|
389
|
-
description:
|
|
390
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non ',
|
|
391
490
|
hasImage: true,
|
|
491
|
+
href: '/#',
|
|
392
492
|
fluid: true,
|
|
393
|
-
links: [{ linkName: 'Link 1' }],
|
|
394
493
|
},
|
|
395
494
|
{
|
|
396
|
-
title:
|
|
495
|
+
title:
|
|
496
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean massa strong.',
|
|
397
497
|
meta: 'March 20, 2022.',
|
|
398
498
|
imgUrl:
|
|
399
499
|
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
|
|
400
|
-
description:
|
|
401
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non ',
|
|
402
500
|
hasImage: true,
|
|
501
|
+
href: '/#',
|
|
403
502
|
fluid: true,
|
|
404
|
-
links: [{ linkName: 'Link 1' }],
|
|
405
503
|
},
|
|
406
504
|
{
|
|
407
|
-
title: 'Lorem
|
|
505
|
+
title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
408
506
|
meta: 'March 20, 2022.',
|
|
409
507
|
imgUrl:
|
|
410
508
|
'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
|
|
411
|
-
description:
|
|
412
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non ',
|
|
413
509
|
hasImage: true,
|
|
510
|
+
href: '/#',
|
|
414
511
|
fluid: true,
|
|
415
|
-
links: [{ linkName: 'Link 1' }],
|
|
416
512
|
},
|
|
417
513
|
],
|
|
418
514
|
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Card, Container, Icon, Grid } from 'semantic-ui-react';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Card/Icon card',
|
|
6
|
+
component: Card,
|
|
7
|
+
parameters: {
|
|
8
|
+
actions: {
|
|
9
|
+
handles: ['click'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
options: ['default', 'primary', 'secondary', 'tertiary'],
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
description: 'card variation class',
|
|
17
|
+
table: {
|
|
18
|
+
type: {
|
|
19
|
+
summary: 'string',
|
|
20
|
+
},
|
|
21
|
+
defaultValue: { summary: 'null' },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
inverted: {
|
|
25
|
+
description: 'Inverted card',
|
|
26
|
+
table: {
|
|
27
|
+
defaultValue: { summary: 'false' },
|
|
28
|
+
type: { summary: 'boolean' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
hasLink: {
|
|
32
|
+
description: 'Clickable card',
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: { summary: 'true' },
|
|
35
|
+
type: { summary: 'boolean' },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const Template = (args) => (
|
|
42
|
+
<Container>
|
|
43
|
+
<Card
|
|
44
|
+
className={`icon text-center ${
|
|
45
|
+
args.variant === 'default' ? '' : args.variant
|
|
46
|
+
} ${args.inverted ? 'inverted' : ''}`}
|
|
47
|
+
>
|
|
48
|
+
{args.hasLink ? (
|
|
49
|
+
<a href={args.href} aria-label={args.title}>
|
|
50
|
+
<Icon className={`${args.size} ${args.icon}`} />
|
|
51
|
+
</a>
|
|
52
|
+
) : (
|
|
53
|
+
<Icon className={`${args.size} ${args.icon}`} />
|
|
54
|
+
)}
|
|
55
|
+
<Card.Content>
|
|
56
|
+
{args.hasLink ? (
|
|
57
|
+
<Card.Header>
|
|
58
|
+
<a href={args.href} aria-label={args.title}>
|
|
59
|
+
{args.title}
|
|
60
|
+
</a>
|
|
61
|
+
</Card.Header>
|
|
62
|
+
) : (
|
|
63
|
+
<Card.Header>{args.title}</Card.Header>
|
|
64
|
+
)}
|
|
65
|
+
</Card.Content>
|
|
66
|
+
</Card>
|
|
67
|
+
</Container>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export const Default = Template.bind({});
|
|
71
|
+
Default.args = {
|
|
72
|
+
variant: 'default',
|
|
73
|
+
inverted: false,
|
|
74
|
+
title: 'Lorem Ipsum',
|
|
75
|
+
icon: 'ri-leaf-line',
|
|
76
|
+
size: 'huge',
|
|
77
|
+
hasLink: true,
|
|
78
|
+
href: '/#',
|
|
79
|
+
};
|
|
80
|
+
Default.argTypes = {
|
|
81
|
+
title: {
|
|
82
|
+
description: 'card header',
|
|
83
|
+
table: {
|
|
84
|
+
type: {
|
|
85
|
+
summary: 'string',
|
|
86
|
+
},
|
|
87
|
+
defaultValue: { summary: ' "" ' },
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
size: {
|
|
91
|
+
control: { type: 'select' },
|
|
92
|
+
options: [
|
|
93
|
+
'mini',
|
|
94
|
+
'tiny',
|
|
95
|
+
'small',
|
|
96
|
+
'medium',
|
|
97
|
+
'large',
|
|
98
|
+
'big',
|
|
99
|
+
'huge',
|
|
100
|
+
'massive',
|
|
101
|
+
],
|
|
102
|
+
description: 'Icon size',
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: 'string' },
|
|
105
|
+
defaultValue: { summary: 'huge' },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const GridTemplate = (args) => (
|
|
111
|
+
<Container>
|
|
112
|
+
<Grid>
|
|
113
|
+
{args.cards !== null &&
|
|
114
|
+
args.cards.map((card, index) => (
|
|
115
|
+
<Grid.Column mobile={6} tablet={4} computer={2} key={index}>
|
|
116
|
+
<Card
|
|
117
|
+
className={`icon text-center ${
|
|
118
|
+
args.variant === 'default' ? '' : args.variant
|
|
119
|
+
} ${args.inverted ? 'inverted' : ''}`}
|
|
120
|
+
>
|
|
121
|
+
{args.hasLink ? (
|
|
122
|
+
<a href={args.href} aria-label={card.title}>
|
|
123
|
+
<Icon className={`${card.size} ${card.icon}`} />
|
|
124
|
+
</a>
|
|
125
|
+
) : (
|
|
126
|
+
<Icon className={`${card.size} ${card.icon}`} />
|
|
127
|
+
)}
|
|
128
|
+
<Card.Content>
|
|
129
|
+
{args.hasLink ? (
|
|
130
|
+
<Card.Header>
|
|
131
|
+
<a href={args.href} aria-label={card.title}>
|
|
132
|
+
{card.title}
|
|
133
|
+
</a>
|
|
134
|
+
</Card.Header>
|
|
135
|
+
) : (
|
|
136
|
+
<Card.Header>{card.title}</Card.Header>
|
|
137
|
+
)}
|
|
138
|
+
</Card.Content>
|
|
139
|
+
</Card>
|
|
140
|
+
</Grid.Column>
|
|
141
|
+
))}
|
|
142
|
+
</Grid>
|
|
143
|
+
</Container>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
export const GridIconCard = GridTemplate.bind({});
|
|
147
|
+
GridIconCard.args = {
|
|
148
|
+
variant: 'default',
|
|
149
|
+
inverted: false,
|
|
150
|
+
hasLink: true,
|
|
151
|
+
href: '/#',
|
|
152
|
+
cards: [
|
|
153
|
+
{
|
|
154
|
+
title: 'Climate',
|
|
155
|
+
icon: 'ri-cloud-line',
|
|
156
|
+
size: 'huge',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
title: 'Economy and resources',
|
|
160
|
+
icon: 'ri-hand-coin-line',
|
|
161
|
+
size: 'huge',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: 'Health',
|
|
165
|
+
icon: 'ri-hospital-line',
|
|
166
|
+
size: 'huge',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
title: 'Nature',
|
|
170
|
+
icon: 'ri-leaf-line',
|
|
171
|
+
size: 'huge',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
title: 'Sustainability',
|
|
175
|
+
icon: 'ri-service-line',
|
|
176
|
+
size: 'huge',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
title: 'State of Europe’s environment',
|
|
180
|
+
icon: 'ri-globe-line',
|
|
181
|
+
size: 'huge',
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
GridIconCard.argTypes = {
|
|
186
|
+
cards: {
|
|
187
|
+
description: 'array with cards data',
|
|
188
|
+
table: {
|
|
189
|
+
type: {
|
|
190
|
+
summary: 'Object',
|
|
191
|
+
},
|
|
192
|
+
defaultValue: { summary: ' "" ' },
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
};
|