@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
@@ -0,0 +1,249 @@
1
+ import React from 'react';
2
+ import { Card, Image, Grid, Container } from 'semantic-ui-react';
3
+
4
+ export default {
5
+ title: 'Components/Card/Default',
6
+ component: Card,
7
+ parameters: {
8
+ actions: {
9
+ handles: ['click'],
10
+ },
11
+ },
12
+ argTypes: {
13
+ class: {
14
+ options: [null, '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
+ },
25
+ };
26
+
27
+ const Template = (args) => (
28
+ <Container>
29
+ <Card fluid={args.fluid} className={args.class}>
30
+ {args.hasImage && (
31
+ <Image src={args.imgUrl} wrapped ui={false} alt="card image" />
32
+ )}
33
+ <Card.Content>
34
+ <Card.Header>{args.title}</Card.Header>
35
+ <Card.Description>{args.description}</Card.Description>
36
+ </Card.Content>
37
+ {args.links !== null &&
38
+ args.links.map((item, index) => (
39
+ <Card.Content extra key={index}>
40
+ <a href="/#">{item.linkName}</a>
41
+ </Card.Content>
42
+ ))}
43
+ </Card>
44
+ </Container>
45
+ );
46
+
47
+ export const Default = Template.bind({});
48
+ Default.args = {
49
+ class: null,
50
+ imgUrl:
51
+ 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
52
+ title: 'Lorem Ipsum',
53
+ description:
54
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
55
+ hasImage: true,
56
+ fluid: false,
57
+ links: [{ linkName: 'Link 1' }],
58
+ };
59
+ Default.argTypes = {
60
+ imgUrl:
61
+ 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
62
+ hasImage: {
63
+ description: 'true if card contains image',
64
+ table: {
65
+ type: {
66
+ summary: 'boolean',
67
+ },
68
+ defaultValue: { summary: true },
69
+ },
70
+ },
71
+ title: {
72
+ description: 'card header',
73
+ table: {
74
+ type: {
75
+ summary: 'string',
76
+ },
77
+ defaultValue: { summary: ' "" ' },
78
+ },
79
+ },
80
+ description: {
81
+ description: 'card main content',
82
+ table: {
83
+ type: {
84
+ summary: 'string',
85
+ },
86
+ defaultValue: { summary: ' "" ' },
87
+ },
88
+ },
89
+ fluid: {
90
+ description: 'take up the width of its container',
91
+ table: {
92
+ type: {
93
+ summary: 'boolean',
94
+ },
95
+ defaultValue: { summary: false },
96
+ },
97
+ },
98
+ links: {
99
+ description: 'array with links to other content',
100
+ table: {
101
+ type: {
102
+ summary: 'Object',
103
+ },
104
+ defaultValue: { summary: ' "" ' },
105
+ },
106
+ },
107
+ };
108
+
109
+ const GridTemplate = (args) => (
110
+ <Container>
111
+ <Grid>
112
+ {args.cards.map((card) => (
113
+ <Grid.Column mobile={12} tablet={6} computer={4}>
114
+ <Card fluid={card.fluid} className={args.class}>
115
+ {card.hasImage && (
116
+ <Image src={card.imgUrl} wrapped ui={false} alt="card image" />
117
+ )}
118
+ <Card.Content>
119
+ <Card.Header>{card.title}</Card.Header>
120
+ <Card.Description>{card.description}</Card.Description>
121
+ </Card.Content>
122
+ {card.links !== null &&
123
+ card.links.map((item, index) => (
124
+ <Card.Content extra key={index}>
125
+ <a href="/#">{item.linkName}</a>
126
+ </Card.Content>
127
+ ))}
128
+ </Card>
129
+ </Grid.Column>
130
+ ))}
131
+ </Grid>
132
+ </Container>
133
+ );
134
+
135
+ export const CardGrid = GridTemplate.bind({});
136
+ CardGrid.args = {
137
+ class: null,
138
+ cards: [
139
+ {
140
+ title: 'Lorem Ipsum',
141
+ imgUrl:
142
+ 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
143
+ description:
144
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
145
+ hasImage: true,
146
+ fluid: true,
147
+ links: [{ linkName: 'Link 1' }],
148
+ },
149
+ {
150
+ title: 'Suspendisse iaculis feugiat',
151
+ imgUrl:
152
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
153
+ description:
154
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
155
+ hasImage: true,
156
+ fluid: true,
157
+ links: [{ linkName: 'Link 1' }],
158
+ },
159
+ {
160
+ title: 'Eget tellus blandit aenean mattis.',
161
+ description:
162
+ '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.',
163
+ hasImage: false,
164
+ fluid: true,
165
+ links: [{ linkName: 'Link 1' }],
166
+ },
167
+ ],
168
+ };
169
+ CardGrid.argTypes = {
170
+ cards: {
171
+ description: 'array with cards data',
172
+ table: {
173
+ type: {
174
+ summary: 'Object',
175
+ },
176
+ defaultValue: { summary: ' "" ' },
177
+ },
178
+ },
179
+ };
180
+
181
+ const FluidGridTemplate = (args) => (
182
+ <Container>
183
+ <div className="fluid-card-row">
184
+ {args.cards.map((card) => (
185
+ <Card fluid={card.fluid} className={args.class}>
186
+ {card.hasImage && (
187
+ <Image src={card.imgUrl} wrapped ui={false} alt="card image" />
188
+ )}
189
+ <Card.Content>
190
+ <Card.Header>{card.title}</Card.Header>
191
+ <Card.Description>{card.description}</Card.Description>
192
+ </Card.Content>
193
+ {card.links !== null &&
194
+ card.links.map((item, index) => (
195
+ <Card.Content extra key={index}>
196
+ <a href="/#">{item.linkName}</a>
197
+ </Card.Content>
198
+ ))}
199
+ </Card>
200
+ ))}
201
+ </div>
202
+ </Container>
203
+ );
204
+
205
+ export const FluidGrid = FluidGridTemplate.bind({});
206
+ FluidGrid.args = {
207
+ class: null,
208
+ cards: [
209
+ {
210
+ title: 'Lorem Ipsum',
211
+ imgUrl:
212
+ 'https://www.eea.europa.eu/media/pictures/european-environment-agency-building-with/image_large',
213
+ description:
214
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
215
+ hasImage: true,
216
+ fluid: true,
217
+ links: [{ linkName: 'Link 1' }],
218
+ },
219
+ {
220
+ title: 'Suspendisse iaculis feugiat',
221
+ imgUrl:
222
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
223
+ description:
224
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
225
+ hasImage: true,
226
+ fluid: true,
227
+ links: [{ linkName: 'Link 1' }],
228
+ },
229
+ {
230
+ title: 'Eget tellus blandit aenean mattis.',
231
+ description:
232
+ '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.',
233
+ hasImage: false,
234
+ fluid: true,
235
+ links: [{ linkName: 'Link 1' }],
236
+ },
237
+ ],
238
+ };
239
+ CardGrid.argTypes = {
240
+ cards: {
241
+ description: 'array with cards data',
242
+ table: {
243
+ type: {
244
+ summary: 'Object',
245
+ },
246
+ defaultValue: { summary: ' "" ' },
247
+ },
248
+ },
249
+ };
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { Card, Image, Container } from 'semantic-ui-react';
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/Card/Publication',
9
+ component: Card,
10
+ argTypes: {
11
+ tag: {
12
+ description: 'publication card tags',
13
+ table: {
14
+ type: { summary: 'string' },
15
+ defaultValue: { summary: '' },
16
+ },
17
+ },
18
+ description: {
19
+ description: 'publication card description',
20
+ table: {
21
+ type: { summary: 'string' },
22
+ defaultValue: { summary: '' },
23
+ },
24
+ },
25
+ },
26
+ };
27
+
28
+ const Template = (args) => (
29
+ <Container>
30
+ <Card className="publication tertiary">
31
+ <Image src={args.image} wrapped ui={false} alt="card image" />
32
+ <Card.Content>
33
+ <Card.Meta>{args.tag}</Card.Meta>
34
+ <Card.Description>{args.description}</Card.Description>
35
+ </Card.Content>
36
+ </Card>
37
+ </Container>
38
+ );
39
+
40
+ export const PublicationCard = Template.bind({});
41
+ PublicationCard.args = {
42
+ tag: '#Publication',
43
+ description:
44
+ '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. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
45
+ image: imageUrl,
46
+ };
@@ -0,0 +1,76 @@
1
+ import React from 'react';
2
+ import { Grid, Button, Card, Image } from 'semantic-ui-react';
3
+
4
+ function RelatedContent({ children, ...rest }) {
5
+ return (
6
+ <div className="related-content-wrapper">
7
+ <Grid>{children}</Grid>
8
+ </div>
9
+ );
10
+ }
11
+
12
+ RelatedContent.Grid = ({ children, ...rest }) => {
13
+ let cards = rest.publicationCards;
14
+ if (rest.publicationCards.length > 4) {
15
+ cards = cards.slice(0, 4);
16
+ }
17
+ const rows = cards.reduce(function (rows, key, index) {
18
+ return (
19
+ (index % 2 === 0 ? rows.push([key]) : rows[rows.length - 1].push(key)) &&
20
+ rows
21
+ );
22
+ }, []);
23
+ return (
24
+ <>
25
+ {cards.length > 2
26
+ ? rows.map((row, rowIndex) => (
27
+ <Grid.Column
28
+ key={rowIndex}
29
+ stretched
30
+ computer={6}
31
+ tablet={12}
32
+ mobile={12}
33
+ >
34
+ {row.map((item, index) => (
35
+ <Card className="publication" key={index}>
36
+ <Image src={item.image} wrapped ui={false} alt="card image" />
37
+ <Card.Content>
38
+ <Card.Meta>{item.tag}</Card.Meta>
39
+ <Card.Description>{item.description}</Card.Description>
40
+ </Card.Content>
41
+ </Card>
42
+ ))}
43
+ </Grid.Column>
44
+ ))
45
+ : cards.map((item, index) => (
46
+ <Grid.Column
47
+ key={index}
48
+ stretched
49
+ computer={6}
50
+ tablet={12}
51
+ mobile={12}
52
+ >
53
+ <Card className="publication">
54
+ <Image src={item.image} wrapped ui={false} alt="card image" />
55
+ <Card.Content>
56
+ <Card.Meta>{item.tag}</Card.Meta>
57
+ <Card.Description>{item.description}</Card.Description>
58
+ </Card.Content>
59
+ </Card>
60
+ </Grid.Column>
61
+ ))}
62
+
63
+ {rest.showButton && rest.publicationCards.length > 4 && (
64
+ <Grid.Row className={!rest.showButton ? 'hidden' : null}>
65
+ <Grid.Column>
66
+ <div className="button-wrapper">
67
+ <Button secondary>{rest.buttonText}</Button>
68
+ </div>
69
+ </Grid.Column>
70
+ </Grid.Row>
71
+ )}
72
+ </>
73
+ );
74
+ };
75
+
76
+ export default RelatedContent;
@@ -0,0 +1,313 @@
1
+ import React from 'react';
2
+ import RelatedContent from './RelatedContent';
3
+ import { Container, Tab } from 'semantic-ui-react';
4
+
5
+ const imageUrl =
6
+ 'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini';
7
+
8
+ export default {
9
+ title: 'Components/Card/Publication',
10
+ component: RelatedContent,
11
+ argTypes: {},
12
+ };
13
+
14
+ const Template = (args) => (
15
+ <Container>
16
+ <RelatedContent>
17
+ <RelatedContent.Grid
18
+ publicationCards={args.publicationCards}
19
+ showButton={args.showButton}
20
+ buttonText={args.buttonText}
21
+ ></RelatedContent.Grid>
22
+ </RelatedContent>
23
+ </Container>
24
+ );
25
+
26
+ export const DefaultEven = Template.bind({});
27
+ DefaultEven.args = {
28
+ publicationCards: [
29
+ {
30
+ tag: '#Publication',
31
+ description:
32
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
33
+ image: imageUrl,
34
+ },
35
+ {
36
+ tag: '#Publication',
37
+ description: 'Leo fermentum sollicitudin suspendisse iaculis feugiat.',
38
+ image: imageUrl,
39
+ },
40
+ {
41
+ tag: '#Publication',
42
+ description:
43
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. ',
44
+ image: imageUrl,
45
+ },
46
+ {
47
+ tag: '#Publication',
48
+ description:
49
+ '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. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. ',
50
+ image: imageUrl,
51
+ },
52
+ {
53
+ tag: '#Publication',
54
+ description:
55
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
56
+ image: imageUrl,
57
+ },
58
+ ],
59
+ buttonText: 'See All',
60
+ showButton: true,
61
+ };
62
+
63
+ DefaultEven.argTypes = {
64
+ publicationCards: {
65
+ description: 'publication cards data',
66
+ table: {
67
+ type: {
68
+ summary: 'Object',
69
+ },
70
+ defaultValue: {
71
+ summary: '',
72
+ },
73
+ },
74
+ },
75
+ buttonText: {
76
+ description: 'related content button text',
77
+ table: {
78
+ type: {
79
+ summary: 'string',
80
+ },
81
+ defaultValue: {
82
+ summary: '',
83
+ },
84
+ },
85
+ },
86
+ showButton: {
87
+ description: 'show/hide related content button',
88
+ table: {
89
+ type: {
90
+ summary: 'boolean',
91
+ },
92
+ defaultValue: {
93
+ summary: 'false',
94
+ },
95
+ },
96
+ },
97
+ };
98
+
99
+ export const DefaultOdd = Template.bind({});
100
+ DefaultOdd.args = {
101
+ publicationCards: [
102
+ {
103
+ tag: '#Publication',
104
+ description:
105
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
106
+ image: imageUrl,
107
+ },
108
+ {
109
+ tag: '#Publication',
110
+ description: 'Leo fermentum sollicitudin suspendisse iaculis feugiat.',
111
+ image: imageUrl,
112
+ },
113
+ {
114
+ tag: '#Publication',
115
+ description:
116
+ '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. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. ',
117
+ image: imageUrl,
118
+ },
119
+ ],
120
+ buttonText: 'See All',
121
+ showButton: true,
122
+ };
123
+
124
+ DefaultOdd.argTypes = {
125
+ publicationCards: {
126
+ description: 'publication cards data',
127
+ table: {
128
+ type: {
129
+ summary: 'Object',
130
+ },
131
+ defaultValue: {
132
+ summary: '',
133
+ },
134
+ },
135
+ },
136
+ buttonText: {
137
+ description: 'related content button text',
138
+ table: {
139
+ type: {
140
+ summary: 'string',
141
+ },
142
+ defaultValue: {
143
+ summary: '',
144
+ },
145
+ },
146
+ },
147
+ showButton: {
148
+ description: 'show/hide related content button',
149
+ table: {
150
+ type: {
151
+ summary: 'boolean',
152
+ },
153
+ defaultValue: {
154
+ summary: 'false',
155
+ },
156
+ },
157
+ },
158
+ };
159
+
160
+ const TabTemplate = (args) => (
161
+ <RelatedContent>
162
+ <RelatedContent.Grid
163
+ publicationCards={args.publicationCards}
164
+ showButton={args.showButton}
165
+ buttonText={args.buttonText}
166
+ ></RelatedContent.Grid>
167
+ </RelatedContent>
168
+ );
169
+
170
+ function TabWithRelatedContent({ panes }) {
171
+ let panesToUse = [];
172
+ if (panes) {
173
+ panesToUse = panes.map((pane) => {
174
+ let args = {
175
+ publicationCards: pane.publicationCards,
176
+ buttonText: pane.buttonText,
177
+ showButton: pane.showButton,
178
+ };
179
+ return {
180
+ menuItem: pane.menuItem,
181
+ render: () => <Tab.Pane>{TabTemplate(args)}</Tab.Pane>,
182
+ };
183
+ });
184
+ }
185
+
186
+ return (
187
+ <Container>
188
+ <Tab
189
+ panes={panesToUse}
190
+ menu={{
191
+ secondary: true,
192
+ pointing: true,
193
+ }}
194
+ />
195
+ </Container>
196
+ );
197
+ }
198
+
199
+ export const RelatedContentInTab = (args) => (
200
+ <TabWithRelatedContent {...args}></TabWithRelatedContent>
201
+ );
202
+ RelatedContentInTab.args = {
203
+ panes: [
204
+ {
205
+ menuItem: 'Briefings',
206
+ publicationCards: [
207
+ {
208
+ tag: '#Publication',
209
+ description:
210
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
211
+ image: imageUrl,
212
+ },
213
+ ],
214
+ buttonText: 'See All',
215
+ showButton: true,
216
+ },
217
+ {
218
+ menuItem: 'News and articles',
219
+ publicationCards: [
220
+ {
221
+ tag: '#Publication',
222
+ description:
223
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
224
+ image: imageUrl,
225
+ },
226
+ {
227
+ tag: '#Publication',
228
+ description:
229
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat.',
230
+ image: imageUrl,
231
+ },
232
+ ],
233
+ buttonText: 'See All',
234
+ showButton: true,
235
+ },
236
+ {
237
+ menuItem: 'Publications',
238
+ publicationCards: [
239
+ {
240
+ tag: '#Publication',
241
+ description:
242
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
243
+ image: imageUrl,
244
+ },
245
+ {
246
+ tag: '#Publication',
247
+ description:
248
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat.',
249
+ image: imageUrl,
250
+ },
251
+ {
252
+ tag: '#Publication',
253
+ description:
254
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. ',
255
+ image: imageUrl,
256
+ },
257
+ ],
258
+ buttonText: 'See All',
259
+ showButton: true,
260
+ },
261
+ {
262
+ menuItem: 'See also',
263
+ publicationCards: [
264
+ {
265
+ tag: '#Publication',
266
+ description:
267
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
268
+ image: imageUrl,
269
+ },
270
+ {
271
+ tag: '#Publication',
272
+ description:
273
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat.',
274
+ image: imageUrl,
275
+ },
276
+ {
277
+ tag: '#Publication',
278
+ description:
279
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. ',
280
+ image: imageUrl,
281
+ },
282
+ {
283
+ tag: '#Publication',
284
+ description:
285
+ '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. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis. ',
286
+ image: imageUrl,
287
+ },
288
+ {
289
+ tag: '#Publication',
290
+ description:
291
+ 'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
292
+ image: imageUrl,
293
+ },
294
+ ],
295
+ buttonText: 'See All',
296
+ showButton: true,
297
+ },
298
+ ],
299
+ };
300
+
301
+ RelatedContentInTab.argTypes = {
302
+ panes: {
303
+ description: 'tab menu items and content data',
304
+ table: {
305
+ type: {
306
+ summary: 'Object',
307
+ },
308
+ defaultValue: {
309
+ summary: '',
310
+ },
311
+ },
312
+ },
313
+ };