@eeacms/volto-eea-design-system 0.2.1 → 0.2.4

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.
Files changed (71) hide show
  1. package/.github/workflows/auto-comment.yml +20 -0
  2. package/CHANGELOG.md +165 -1
  3. package/package.json +1 -1
  4. package/src/semantic.less +1 -5
  5. package/src/ui/Banner/Banner.jsx +1 -1
  6. package/src/ui/Breadcrumbs/Breadcrumb.stories.jsx +3 -0
  7. package/src/ui/Breadcrumbs/Breadcrumbs.jsx +1 -0
  8. package/src/ui/CallToAction/CallToAction.stories.jsx +239 -0
  9. package/src/ui/{AvatarGrid → Card/AvatarGrid}/AvatarGrid.jsx +14 -14
  10. package/src/ui/{AvatarGrid → Card/AvatarGrid}/AvatarGrid.stories.jsx +24 -21
  11. package/src/ui/Card/Card.stories.jsx +249 -0
  12. package/src/ui/Card/PublicationCard.stories.jsx +46 -0
  13. package/src/ui/Card/RelatedContent/RelatedContent.jsx +76 -0
  14. package/src/ui/Card/RelatedContent/RelatedContent.stories.jsx +313 -0
  15. package/src/ui/Card/RoundedCard.stories.jsx +96 -0
  16. package/src/ui/{Button → Form/Button}/Button.stories.jsx +88 -52
  17. package/src/ui/KeyContent/KeyContent.jsx +9 -3
  18. package/src/ui/KeyContent/KeyContent.stories.jsx +1 -22
  19. package/src/ui/Loader/Loader.stories.jsx +21 -3
  20. package/src/ui/Testimonial/Testimonial.jsx +9 -8
  21. package/src/ui/Testimonial/Testimonial.stories.jsx +14 -11
  22. package/src/ui/Timeline/Timeline.jsx +1 -1
  23. package/src/ui/Timeline/Timeline.stories.jsx +12 -12
  24. package/src/ui/index.js +2 -4
  25. package/theme/theme.config +2 -4
  26. package/theme/themes/eea/collections/breadcrumb.overrides +12 -20
  27. package/theme/themes/eea/collections/breadcrumb.variables +3 -3
  28. package/theme/themes/eea/collections/form.overrides +116 -0
  29. package/theme/themes/eea/elements/button.overrides +172 -113
  30. package/theme/themes/eea/elements/button.variables +20 -6
  31. package/theme/themes/eea/elements/container.overrides +4 -19
  32. package/theme/themes/eea/elements/container.variables +5 -4
  33. package/theme/themes/eea/elements/label.overrides +12 -3
  34. package/theme/themes/eea/elements/label.variables +1 -1
  35. package/theme/themes/eea/elements/list.overrides +10 -0
  36. package/theme/themes/eea/elements/list.variables +3 -1
  37. package/theme/themes/eea/elements/loader.overrides +197 -0
  38. package/theme/themes/eea/elements/loader.variables +12 -1
  39. package/theme/themes/eea/elements/segment.overrides +77 -0
  40. package/theme/themes/eea/elements/segment.variables +2 -2
  41. package/theme/themes/eea/extras/avatarGrid.less +22 -24
  42. package/theme/themes/eea/extras/avatarGrid.variables +4 -8
  43. package/theme/themes/eea/extras/banner.less +32 -41
  44. package/theme/themes/eea/extras/blockquote.less +6 -3
  45. package/theme/themes/eea/extras/footer.less +239 -241
  46. package/theme/themes/eea/extras/header.less +1 -1
  47. package/theme/themes/eea/extras/keyContent.less +18 -16
  48. package/theme/themes/eea/extras/keyContent.variables +13 -7
  49. package/theme/themes/eea/extras/main.overrides +9 -0
  50. package/theme/themes/eea/extras/main.variables +3 -0
  51. package/theme/themes/eea/extras/pullquote.less +3 -3
  52. package/theme/themes/eea/extras/relatedContent.less +27 -0
  53. package/theme/themes/eea/extras/relatedContent.variables +3 -0
  54. package/theme/themes/eea/extras/tagList.less +0 -1
  55. package/theme/themes/eea/globals/site.variables +16 -12
  56. package/theme/themes/eea/modules/modal.overrides +4 -0
  57. package/theme/themes/eea/modules/progress.variables +1 -1
  58. package/theme/themes/eea/modules/tab.overrides +24 -0
  59. package/theme/themes/eea/modules/tab.variables +11 -1
  60. package/theme/themes/eea/views/card.overrides +242 -25
  61. package/theme/themes/eea/views/card.variables +92 -8
  62. package/src/ui/Avatar/Avatar.jsx +0 -32
  63. package/src/ui/Avatar/Avatar.stories.jsx +0 -61
  64. package/src/ui/PublicationCard/PublicationCard.jsx +0 -27
  65. package/src/ui/PublicationCard/PublicationCard.stories.jsx +0 -69
  66. package/src/ui/RelatedContent/RelatedContent.jsx +0 -90
  67. package/src/ui/RelatedContent/RelatedContent.stories.jsx +0 -80
  68. package/theme/themes/eea/extras/avatar.less +0 -97
  69. package/theme/themes/eea/extras/avatar.variables +0 -34
  70. package/theme/themes/eea/extras/publicationCard.less +0 -62
  71. package/theme/themes/eea/extras/publicationCard.variables +0 -24
@@ -56,11 +56,11 @@
56
56
  @primaryColor : @darkCerulean;
57
57
  @secondaryColor : @pineGreen;
58
58
 
59
- @lightPrimaryColor : @darkCyan;
60
- @lightSecondaryColor : @mediumPersianBlue;
59
+ @lightPrimaryColor : @mediumPersianBlue;
60
+ @lightSecondaryColor : @darkCyan;
61
61
 
62
- @darkPrimaryColor : @bottleGreen;
63
- @darkSecondaryColor : @darkMidnightBlue;
62
+ @darkPrimaryColor : @darkMidnightBlue;
63
+ @darkSecondaryColor : @bottleGreen;
64
64
 
65
65
  /*--------------
66
66
  Page Heading
@@ -284,10 +284,15 @@
284
284
  --------------------*/
285
285
 
286
286
  @mobileBreakpoint : 320px;
287
- @tabletBreakpoint : 480px;
288
- @computerBreakpoint : 835px;
289
- @largeMonitorBreakpoint : 1025px;
290
- @widescreenMonitorBreakpoint : 1200px;
287
+ @mobileLandscapeBreakpoint : 480px; // introduced for the design system
288
+ @tabletBreakpoint : 768px;
289
+ @contentBreakpoint : 835px; // introduced for the design system
290
+ @computerBreakpoint : 992px;
291
+ @smallMonitorBreakpoint : 1024px; // introduced for the design system
292
+ @largeMonitorBreakpoint : 1200px;
293
+ @laptopMonitorBreakpoint : 1280px; // introduced for the design system
294
+ @siteBreakpoint : 1400px; // introduced for the design system
295
+ @widescreenMonitorBreakpoint : 1920px;
291
296
 
292
297
  /* Paddings for breakpoints */
293
298
  @mobilePadding : 1.875rem;
@@ -428,9 +433,9 @@
428
433
  @progressBarFrom0to30 : @midBlue;
429
434
  @progressBarFrom30to40 : @mediumPersianBlue;
430
435
  @progressBarFrom40to60 : @mediumPersianBlue;
431
- @progressBarFrom60to70 : @darkCyan;
432
- @progressBarFrom70to90 : @darkCyan;
433
- @progressBarFrom90to100 : @pineGreen;
436
+ @progressBarFrom60to70 : @pineGreen;
437
+ @progressBarFrom70to90 : @pineGreen;
438
+ @progressBarFrom90to100 : @bottleGreen;
434
439
 
435
440
  /*-------------------
436
441
  Alpha Colors
@@ -664,7 +669,6 @@
664
669
  @largestTabletScreen : (@computerBreakpoint - @1px);
665
670
  @largestSmallMonitor : (@largeMonitorBreakpoint - @1px);
666
671
  @largestLargeMonitor : (@widescreenMonitorBreakpoint - @1px);
667
- @mobileWidth: 1279px;
668
672
 
669
673
 
670
674
  /*-------------------
@@ -1,3 +1,7 @@
1
1
  /*******************************
2
2
  Theme Overrides
3
3
  *******************************/
4
+
5
+ .ui.modal > :last-child {
6
+ overflow: hidden; // clear floats from modal
7
+ }
@@ -40,7 +40,7 @@
40
40
  @progressLeft: auto;
41
41
  @progressBottom: auto;
42
42
  @progressOffset: -0.5em;
43
- @progressColor: @invertedLightTextColor;
43
+ @progressColor: @white;
44
44
  @progressTextShadow: none;
45
45
  @progressFontWeight: @bold;
46
46
  @progressTextAlign: left;
@@ -11,3 +11,27 @@
11
11
  color: @tabActiveItemHoverColor;
12
12
  }
13
13
  }
14
+
15
+ // Contain images inside vertical tab content
16
+ .stretched.wide.column > .tab img {
17
+ max-width: @verticalTabPaneImageMaxWidth;
18
+ }
19
+
20
+ .ui.pointing.secondary.menu::-webkit-scrollbar {
21
+ height: @mobileTabScrollbarHeight;
22
+ }
23
+
24
+ @media only screen and (min-width: @tabletBreakpoint) {
25
+ .ui.pointing.secondary.menu::-webkit-scrollbar {
26
+ height: @tabletTabScrollbarHeight;
27
+ }
28
+ }
29
+
30
+ @media only screen and (max-width: @largestMobileScreen) {
31
+ .ui.pointing.secondary.vertical.menu {
32
+ .item {
33
+ padding: @mobileItemPadding;
34
+ font-size: @mobileItemFontSize;
35
+ }
36
+ }
37
+ }
@@ -4,6 +4,9 @@
4
4
 
5
5
  @tabActiveItemHoverColor: @secondaryColor;
6
6
 
7
+ @mobileItemFontSize: 1rem;
8
+ @mobileItemPadding: 1rem 0.25rem;
9
+
7
10
  @headerSize: @h4;
8
11
  @headerSizeResponsive: @fontSize;
9
12
  @contentSize: @fontSize;
@@ -14,4 +17,11 @@
14
17
  @loadingContentOffset: -10000px;
15
18
 
16
19
  @loaderDistanceFromTop: 100px;
17
- @loaderSize: 2.5em;
20
+ @loaderSize: 2.5em;
21
+
22
+ /* Scrollbar */
23
+ @mobileTabScrollbarHeight: 0;
24
+ @tabletTabScrollbarHeight: 0.3rem;
25
+
26
+ /* Images */
27
+ @verticalTabPaneImageMaxWidth: 100%;
@@ -2,31 +2,6 @@
2
2
  Theme Overrides
3
3
  *******************************/
4
4
 
5
- /* Inverted Card */
6
- .ui.card.inverted {
7
- background: @invertedBackground;
8
-
9
- > .content > .header {
10
- color: @invertedHeaderColor;
11
- }
12
-
13
- > .content > .description {
14
- color: @invertedDescriptionColor;
15
- }
16
-
17
- > .extra.content a:not(.ui) {
18
- color: @invertedExtraLinkColor;
19
-
20
- &:hover {
21
- color: @invertedExtraLinkHoverColor;
22
- }
23
- }
24
-
25
- > .content > .meta {
26
- color: @invertedMetaColor;
27
- }
28
- }
29
-
30
5
  /* Avoid long links from spilling outside of card body area */
31
6
  .ui.cards > .card > .extra,
32
7
  .ui.card > .extra {
@@ -71,3 +46,245 @@
71
46
  .ui.right.card {
72
47
  margin-left: auto;
73
48
  }
49
+
50
+ /*******************************
51
+ Primary
52
+ *******************************/
53
+
54
+ .ui.card.primary {
55
+ background: @primaryBackground;
56
+ }
57
+
58
+ .ui.card.primary > .content > .header {
59
+ color: @primaryHeaderColor;
60
+ }
61
+
62
+ .ui.card.primary > .content > .description {
63
+ color: @primaryDescriptionColor;
64
+ }
65
+
66
+ .ui.card.primary > .extra.content a:not(.ui) {
67
+ color: @primaryExtraLinkColor;
68
+
69
+ &:hover {
70
+ color: @primaryExtraLinkHoverColor;
71
+ }
72
+ }
73
+
74
+ .ui.card.primary > .content > .meta {
75
+ color: @primaryMetaColor;
76
+ }
77
+
78
+ /*******************************
79
+ Secondary
80
+ *******************************/
81
+
82
+ .ui.card.secondary {
83
+ background: @secondaryBackground;
84
+ }
85
+
86
+ .ui.card.secondary > .content > .header {
87
+ color: @secondaryHeaderColor;
88
+ }
89
+
90
+ .ui.card.secondary > .content > .description {
91
+ color: @secondaryDescriptionColor;
92
+ }
93
+
94
+ .ui.card.secondary > .extra.content a:not(.ui) {
95
+ color: @secondaryExtraLinkColor;
96
+
97
+ &:hover {
98
+ color: @secondaryExtraLinkHoverColor;
99
+ }
100
+ }
101
+
102
+ .ui.card.secondary > .content > .meta {
103
+ color: @secondaryMetaColor;
104
+ }
105
+
106
+ /*******************************
107
+ Tertiary
108
+ *******************************/
109
+
110
+ .ui.card.tertiary {
111
+ background: @tertiaryBackground;
112
+ }
113
+
114
+ .ui.card.tertiary > .content > .header {
115
+ color: @tertiaryHeaderColor;
116
+ }
117
+
118
+ .ui.card.tertiary > .content > .description {
119
+ color: @tertiaryDescriptionColor;
120
+ }
121
+
122
+ .ui.card.tertiary > .extra.content a:not(.ui) {
123
+ color: @tertiaryExtraLinkColor;
124
+
125
+ &:hover {
126
+ color: @tertiaryExtraLinkHoverColor;
127
+ }
128
+ }
129
+
130
+ .ui.card.tertiary > .content > .meta {
131
+ color: @tertiaryMetaColor;
132
+ }
133
+
134
+ /*******************************
135
+ Rounded Card
136
+ *******************************/
137
+
138
+ .ui.cards > .ui.card.rounded > .image,
139
+ .ui.card.rounded > .image {
140
+ height: auto;
141
+ }
142
+
143
+ .ui.card.rounded {
144
+ width: @roundedWidth;
145
+ border: none;
146
+
147
+ .content {
148
+ justify-content: center;
149
+ border-top: none;
150
+
151
+ .image {
152
+ display: flex;
153
+ justify-content: center;
154
+ background-color: @white;
155
+ }
156
+
157
+ .header {
158
+ margin-bottom: @roundedContentTitleMarginBottom;
159
+ font-size: @roundedContentTitleFontSize;
160
+ font-weight: @roundedContentTitleFontWeight;
161
+ text-align: center;
162
+ }
163
+
164
+ .description {
165
+ text-align: center;
166
+ }
167
+ }
168
+ }
169
+
170
+ .ui.card.rounded.big {
171
+ .image {
172
+ display: flex;
173
+ justify-content: center;
174
+ background-color: @white;
175
+
176
+ img {
177
+ width: @roundedBigImageWidth;
178
+ height: @roundedBigImageHeight;
179
+ border-radius: 50%;
180
+ }
181
+ }
182
+
183
+ .description {
184
+ font-size: @roundedBigMetadataFontSize;
185
+ font-weight: @roundedBigMetadataFontWeight;
186
+ }
187
+ }
188
+
189
+ .ui.rounded.small {
190
+ .image {
191
+ display: flex;
192
+ justify-content: center;
193
+ background-color: @white;
194
+
195
+ img {
196
+ display: flex;
197
+ width: @roundedSmallImageWidth;
198
+ height: @roundedSmallImageHeight;
199
+ border-radius: @roundedImageBorderRadius;
200
+ }
201
+ }
202
+
203
+ .header {
204
+ color: @roundedSmallTitleColor;
205
+ }
206
+
207
+ .description {
208
+ font-size: @roundedSmallMetadataFontSize;
209
+ font-weight: @roundedSmallMetadataFontWeight;
210
+ }
211
+ }
212
+
213
+ /*******************************
214
+ Publication Card
215
+ *******************************/
216
+
217
+ .ui.card.publication {
218
+ width: @mobilePublicationCardWidth;
219
+ border: none;
220
+
221
+ .image {
222
+ height: @mobilePublicationcardImageHeight;
223
+ flex-grow: 1;
224
+ }
225
+
226
+ .content {
227
+ height: @mobileCardContentHeight;
228
+ max-height: @cardContentMaxHeight;
229
+ padding: @cardContentPadding;
230
+ background-color: @publicationCardDescriptionColor;
231
+
232
+ .meta {
233
+ color: @publicationCardtextColor;
234
+ font-size: @cardMetaFontSize;
235
+ font-weight: @cardMetaTagFontWeight;
236
+ }
237
+
238
+ .description {
239
+ display: -webkit-box;
240
+ overflow: hidden;
241
+ margin-top: 0;
242
+ -webkit-box-orient: vertical;
243
+ color: @publicationCardtextColor;
244
+ font-size: @cardDescriptionTextFontSize;
245
+ font-weight: @cardDescriptionTextFontWeight;
246
+ -webkit-line-clamp: @cardDescriptionTextLineClampMobile;
247
+ text-overflow: ellipsis;
248
+ }
249
+ }
250
+ }
251
+
252
+ @media only screen and (min-width: @tabletBreakpoint) {
253
+ .ui.card.publication {
254
+ width: @tabletPublicationCardWidth;
255
+
256
+ .image {
257
+ height: @tabletPublicationcardImageHeight;
258
+ }
259
+
260
+ .content {
261
+ height: @tabletCardContentHeight;
262
+ max-height: @tabletCardContentMaxHeight;
263
+
264
+ .description {
265
+ -webkit-line-clamp: @cardDescriptionTextLineClampTablet;
266
+ }
267
+ }
268
+ }
269
+ }
270
+
271
+ @media only screen and (min-width: @computerBreakpoint) {
272
+ .ui.card.publication {
273
+ width: @computerPublicationCardWidth;
274
+
275
+ .image {
276
+ height: @computerPublicationcardImageHeight;
277
+ }
278
+ }
279
+ }
280
+
281
+ .fluid-card-row {
282
+ display: grid;
283
+ justify-content: space-between;
284
+ gap: 1.25rem;
285
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
286
+
287
+ .ui.card {
288
+ margin: 0;
289
+ }
290
+ }
@@ -9,14 +9,6 @@
9
9
  @cardBorder: 1px solid @midGray;
10
10
  @background: @white;
11
11
 
12
- /* Inverted */
13
- @invertedBackground: @darkCerulean;
14
- @invertedHeaderColor: @white;
15
- @invertedDescriptionColor: @white;
16
- @invertedExtraLinkColor: @white;
17
- @invertedExtraLinkHoverColor: @white;
18
- @invertedMetaColor: @white;
19
-
20
12
  /* Shadow */
21
13
  @shadowDistance: 1px;
22
14
  @shadowBoxShadow: 0px @shadowDistance 3px 0px @solidBorderColor;
@@ -235,3 +227,95 @@
235
227
 
236
228
  /* Colored */
237
229
  @coloredShadowDistance: 2px;
230
+
231
+
232
+ /*******************************
233
+ Primary
234
+ *******************************/
235
+ @primaryBackground: @primaryColor;
236
+ @primaryHeaderColor: @white;
237
+ @primaryDescriptionColor: @white;
238
+ @primaryExtraLinkColor: @white;
239
+ @primaryExtraLinkHoverColor: @white;
240
+ @primaryMetaColor: @white;
241
+
242
+ /*******************************
243
+ Secondary
244
+ *******************************/
245
+ @secondaryBackground: @secondaryColor;
246
+ @secondaryHeaderColor: @white;
247
+ @secondaryDescriptionColor: @white;
248
+ @secondaryExtraLinkColor: @white;
249
+ @secondaryExtraLinkHoverColor: @white;
250
+ @secondaryMetaColor: @white;
251
+
252
+ /*******************************
253
+ Tertiary
254
+ *******************************/
255
+ @tertiaryBackground: #3D5265;
256
+ @tertiaryHeaderColor: @white;
257
+ @tertiaryDescriptionColor: @white;
258
+ @tertiaryExtraLinkColor: @white;
259
+ @tertiaryExtraLinkHoverColor: @white;
260
+ @tertiaryMetaColor: @white;
261
+
262
+ /*******************************
263
+ Rounded Card
264
+ *******************************/
265
+ /* Global */
266
+ @roundedWidth : 100%;
267
+ @roundedWrapperWidth : 100%;
268
+ @roundedWrapperGap : @largeGap;
269
+ @roundedContentWrapperWidth : 100%;
270
+ @roundedImageBorderRadius : @circularRadius;
271
+ @roundedContentTitleMarginBottom : 0;
272
+ @roundedImageWrapperWidth : 100%;
273
+ @roundedImageBackgroundSize : cover;
274
+ @roundedContentTitleFontWeight : @bold;
275
+ @roundedContentTitleFontSize : 1.25rem;
276
+
277
+ /* Big */
278
+ @roundedBigImageHeight : 173px;
279
+ @roundedBigImageWidth : 173px;
280
+ @roundedBigMetadataFontSize : 1.25rem;
281
+ @roundedBigMetadataFontWeight : @normal;
282
+
283
+ /* Small */
284
+ @roundedSmallImageHeight : 150px;
285
+ @roundedSmallImageWidth : 150px;
286
+ @roundedSmallTitleColor : @secondaryColor;
287
+ @roundedSmallMetadataFontSize : 1rem;
288
+ @roundedSmallMetadataFontWeight : 300;
289
+
290
+ /*******************************
291
+ Publication Card
292
+ *******************************/
293
+ @mobilePublicationCardWidth: 300px;
294
+ @tabletPublicationCardWidth: 660px;
295
+ @computerPublicationCardWidth: 530px;
296
+
297
+ /* Image */
298
+ @mobilePublicationcardImageHeight: 150px;
299
+ @tabletPublicationcardImageHeight: 250px;
300
+ @computerPublicationcardImageHeight: 160px;
301
+
302
+ /* Colors */
303
+ @publicationCardDescriptionColor: #3D5265;
304
+ @publicationCardtextColor: @white;
305
+
306
+ /* Content */
307
+ @cardContentPadding: 20px;
308
+ @cardContentMaxHeight: 135px;
309
+ @mobileCardContentHeight: 135px;
310
+ @tabletCardContentMaxHeight: 110px;
311
+ @tabletCardContentHeight: 110px;
312
+
313
+ /* Description */
314
+ @cardDescriptionTextLineClampMobile: 3;
315
+ @cardDescriptionTextLineClampTablet: 2;
316
+ @cardDescriptionTextFontSize: 16px;
317
+ @cardDescriptionTextFontWeight: 700;
318
+
319
+ /* Meta */
320
+ @cardMetaFontSize: 12px;
321
+ @cardMetaTagFontWeight: 400;
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- Avatar.propTypes = {
5
- title: PropTypes.string,
6
- info: PropTypes.string,
7
- };
8
-
9
- function Avatar({ image_url, children, ...rest }) {
10
- return (
11
- <div className={`eea avatar ${rest.avatarSize}`} {...rest}>
12
- <div className="wrapper">
13
- <div className="image-wrapper">
14
- <div
15
- className="image"
16
- style={{ backgroundImage: `url(${image_url})` }}
17
- ></div>
18
- </div>
19
- <div className="content-wrapper">{children}</div>
20
- </div>
21
- </div>
22
- );
23
- }
24
-
25
- Avatar.Content = ({ children }) => {
26
- return <div className="content">{children}</div>;
27
- };
28
-
29
- Avatar.Title = ({ children }) => <p className="title">{children}</p>;
30
- Avatar.Metadata = ({ children }) => <p className="metadata">{children}</p>;
31
-
32
- export default Avatar;
@@ -1,61 +0,0 @@
1
- import React from 'react';
2
- import Avatar from './Avatar';
3
- // eslint-disable-next-line import/no-unresolved
4
- import imgUrl from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/avatar.png';
5
-
6
- export default {
7
- title: 'Components/Avatar',
8
- component: Avatar,
9
- argTypes: {
10
- title: {
11
- description: 'avatar title',
12
- table: {
13
- defaultValue: { summary: '""' },
14
- type: { summary: 'string' },
15
- },
16
- },
17
- info: {
18
- description: 'avatar secondary info',
19
- table: {
20
- defaultValue: { summary: '""' },
21
- type: { summary: 'string' },
22
- },
23
- },
24
- image: {
25
- description: 'avatar image',
26
- table: {
27
- defaultValue: { summary: '""' },
28
- },
29
- },
30
- },
31
- };
32
-
33
- const DefaultTemplate = (args) => (
34
- <Avatar avatarSize="big" {...args} image_url={imgUrl}>
35
- <Avatar.Content>
36
- <Avatar.Title>{args.title}</Avatar.Title>
37
- <Avatar.Metadata>{args.info}</Avatar.Metadata>
38
- </Avatar.Content>
39
- </Avatar>
40
- );
41
-
42
- export const Default = DefaultTemplate.bind({});
43
- Default.args = {
44
- title: 'Lorem ipsum',
45
- info: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
46
- };
47
-
48
- const SmallTemplate = (args) => (
49
- <Avatar avatarSize="small" {...args} image_url={imgUrl}>
50
- <Avatar.Content>
51
- <Avatar.Title>{args.title}</Avatar.Title>
52
- <Avatar.Metadata>{args.info}</Avatar.Metadata>
53
- </Avatar.Content>
54
- </Avatar>
55
- );
56
-
57
- export const Small = SmallTemplate.bind({});
58
- Small.args = {
59
- title: 'Lorem ipsum',
60
- info: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
61
- };
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
-
3
- function PublicationCard({ children, ...rest }) {
4
- return (
5
- <div className="eea publication card">
6
- <a href={rest.href}>{children}</a>
7
- </div>
8
- );
9
- }
10
-
11
- PublicationCard.Header = ({ children, ...rest }) => (
12
- <div
13
- className="header"
14
- style={rest.image ? { backgroundImage: `url(${rest.image_url})` } : {}}
15
- >
16
- {children}
17
- </div>
18
- );
19
-
20
- PublicationCard.Info = ({ children, ...rest }) => (
21
- <div className="description">
22
- <div className="tag">#{rest.tag}</div>
23
- <p className="text">{rest.description}</p>
24
- </div>
25
- );
26
-
27
- export default PublicationCard;
@@ -1,69 +0,0 @@
1
- import React from 'react';
2
- import PublicationCard from './PublicationCard';
3
-
4
- const imageUrl =
5
- 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini';
6
-
7
- export default {
8
- title: 'Components/PublicationCard',
9
- component: PublicationCard,
10
- argTypes: {
11
- tag: {
12
- description: 'publication tags',
13
- table: {
14
- type: { summary: 'string' },
15
- defaultValue: { summary: '' },
16
- },
17
- },
18
- description: {
19
- description: 'publication description',
20
- table: {
21
- type: { summary: 'string' },
22
- defaultValue: { summary: '' },
23
- },
24
- },
25
- href: {
26
- description: 'publication link url',
27
- table: {
28
- type: { summary: 'string' },
29
- defaultValue: { summary: '' },
30
- },
31
- },
32
- },
33
- };
34
-
35
- const Template = (args) => (
36
- <PublicationCard {...args}>
37
- <PublicationCard.Header
38
- image_url={args.image ? imageUrl : null}
39
- image={args.image}
40
- />
41
- <PublicationCard.Info description={args.description} tag={args.tag} />
42
- </PublicationCard>
43
- );
44
-
45
- export const Default = Template.bind({});
46
- Default.args = {
47
- tag: 'Publication',
48
- description:
49
- 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
50
- href: '/#',
51
- };
52
-
53
- export const PublicationCardWithImage = Template.bind({});
54
- PublicationCardWithImage.args = {
55
- tag: 'Publication',
56
- description:
57
- 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
58
- image: true,
59
- href: '/#',
60
- };
61
- PublicationCardWithImage.argTypes = {
62
- image: {
63
- description: 'set or unset publication backgroung image',
64
- table: {
65
- type: { summary: 'boolean' },
66
- defaultValue: { summary: 'false' },
67
- },
68
- },
69
- };