@eeacms/volto-eea-design-system 1.0.7 → 1.11.0
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 +60 -1
- package/package.json +1 -1
- package/src/semantic.less +0 -4
- package/src/ui/Accordion/Accordion.stories.js +52 -123
- package/src/ui/Card/Card.stories.jsx +153 -11
- package/src/ui/Footer/Contact.jsx +31 -6
- package/src/ui/Footer/Footer.stories.js +76 -25
- package/src/ui/Header/Header.jsx +9 -3
- package/src/ui/Header/HeaderMenuPopUp.js +22 -8
- package/src/ui/Header/HeaderSearchPopUp.js +2 -1
- package/src/ui/Video/Video.jsx +44 -0
- package/src/ui/Video/Video.stories.jsx +53 -0
- package/src/ui/index.js +2 -2
- package/theme/theme.config +0 -3
- package/theme/themes/eea/assets/video/demo-track-el.vtt +11 -0
- package/theme/themes/eea/assets/video/demo-track-en.vtt +11 -0
- package/theme/themes/eea/assets/video/demo-track-ro.vtt +11 -0
- package/theme/themes/eea/collections/table.variables +1 -1
- package/theme/themes/eea/elements/image.overrides +6 -0
- package/theme/themes/eea/elements/image.variables +1 -0
- package/theme/themes/eea/extras/header.less +0 -2
- package/theme/themes/eea/globals/mixins.less +8 -0
- package/theme/themes/eea/globals/utilities.less +47 -0
- package/theme/themes/eea/modules/accordion.overrides +7 -0
- package/theme/themes/eea/views/card.overrides +14 -11
- package/src/ui/Card/AvatarGrid/AvatarGrid.jsx +0 -61
- package/src/ui/Card/AvatarGrid/AvatarGrid.stories.jsx +0 -89
- package/src/ui/Card/RoundedCard.stories.jsx +0 -122
- package/theme/themes/eea/extras/avatar.variables +0 -28
- package/theme/themes/eea/extras/avatarGrid.less +0 -43
- package/theme/themes/eea/extras/avatarGrid.variables +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,65 @@ 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.11.0](https://github.com/eea/volto-eea-design-system/compare/1.0.7...1.11.0) - 11 May 2023
|
|
8
|
+
|
|
9
|
+
#### :boom: Breaking Change
|
|
10
|
+
|
|
11
|
+
- breaking(table): cell text align is again inherited instead of center [David Ichim - [`46602c5`](https://github.com/eea/volto-eea-design-system/commit/46602c59bfebd0eae8ede2dcc345efdc635e35f6)]
|
|
12
|
+
|
|
13
|
+
#### :rocket: New Features
|
|
14
|
+
|
|
15
|
+
- feat(docusaurus): Add Video block to docusaurus #343 from eea/feature-video-block [ichim-david - [`f692fd4`](https://github.com/eea/volto-eea-design-system/commit/f692fd42a8c0171db3e86a95c504b7a6f8b89b30)]
|
|
16
|
+
- feat(cards): added image position and title and description max lines also to storybook #335 from eea/rounded-card-control [ichim-david - [`9cba23b`](https://github.com/eea/volto-eea-design-system/commit/9cba23bef8d74cdd5cf3505b9a9f3d51b68eedcf)]
|
|
17
|
+
- feat(accordion): Add control to change the heading tag of the title within storybook #337 from eea/accordion-refactor [ichim-david - [`3bf19bd`](https://github.com/eea/volto-eea-design-system/commit/3bf19bdc4053d9e5b8c69226d55b358632d82c5e)]
|
|
18
|
+
- feat(cards): add teaser card image alignment styles refs #250422 #338 from eea/teaser-image-alignment [ichim-david - [`1e5677c`](https://github.com/eea/volto-eea-design-system/commit/1e5677c8d40aeb5013097219d45954b869974e90)]
|
|
19
|
+
- feat(storybook): Add Video block to storybook based on existing Volto EEA add-on #331 from eea/feature-video-block [ichim-david - [`1b539c8`](https://github.com/eea/volto-eea-design-system/commit/1b539c8ccfab459fa7682cca7f75dd6aaaabca24)]
|
|
20
|
+
- feat(teaser): add object-fit and object-position classnames [nileshgulia1 - [`68c9567`](https://github.com/eea/volto-eea-design-system/commit/68c9567179e4e67136a9fd53758d1f6fb43f005c)]
|
|
21
|
+
- feat(video) initial component work in progress [Antonis Tarantilis - [`1c99c91`](https://github.com/eea/volto-eea-design-system/commit/1c99c914161827528bc3a6bf9f8c13bef4ba5817)]
|
|
22
|
+
- feat(video): add video block story [Antonis Tarantilis - [`e1addf5`](https://github.com/eea/volto-eea-design-system/commit/e1addf5df1219af4d6663310342ffb8587404e12)]
|
|
23
|
+
|
|
24
|
+
#### :bug: Bug Fixes
|
|
25
|
+
|
|
26
|
+
- fix(listing): link size for image block by setting display to block [David Ichim - [`5afa665`](https://github.com/eea/volto-eea-design-system/commit/5afa6651ce35aaef0b09da71f13dd90b90ac5052)]
|
|
27
|
+
- fix(footer): Check contact url if is internal #250343 #342 from eea/footer_url_internal_check [ichim-david - [`d753c21`](https://github.com/eea/volto-eea-design-system/commit/d753c2150ec211ec5f4838afc6dd53f89c8a3b7b)]
|
|
28
|
+
- fix: fill links in Storybook #250343 [andreiggr - [`e09995b`](https://github.com/eea/volto-eea-design-system/commit/e09995b1488176017d4e9c04ee89b84a8145d0c4)]
|
|
29
|
+
- fix(card): overrides file missing { and cleaned duplicated css code [David Ichim - [`0979032`](https://github.com/eea/volto-eea-design-system/commit/0979032827318d3af186e05d23bf781094d8e82f)]
|
|
30
|
+
- fix(cards): title from next line becoming visible with large titles [David Ichim - [`c196f1a`](https://github.com/eea/volto-eea-design-system/commit/c196f1a35ee06a0bec1d7b2e33d02f0744fe57fd)]
|
|
31
|
+
- fix(cards): use css variables [nileshgulia1 - [`71abd31`](https://github.com/eea/volto-eea-design-system/commit/71abd31ece6c24d85d32698fea448a9493475452)]
|
|
32
|
+
- fix(video): fix lint track error [Antonis Tarantilis - [`6249f9e`](https://github.com/eea/volto-eea-design-system/commit/6249f9e93b21c15883974ccbfa980749e342e4ab)]
|
|
33
|
+
- fix(video): fix tracks after the file loader module update [Antonis Tarantilis - [`a3a3614`](https://github.com/eea/volto-eea-design-system/commit/a3a3614e19ce25e65d8f51e70c47d6c634a15a0e)]
|
|
34
|
+
|
|
35
|
+
#### :nail_care: Enhancements
|
|
36
|
+
|
|
37
|
+
- change(cards, utilities): modified name of object fit and position classes to have hyphens [David Ichim - [`5fb39ab`](https://github.com/eea/volto-eea-design-system/commit/5fb39ab2601d36b92cf896a7de66025ba56928a6)]
|
|
38
|
+
- change(search): added possibility to configure button url in search popup #345 from eea/searchpopup_update [ichim-david - [`112e97e`](https://github.com/eea/volto-eea-design-system/commit/112e97e2139cd5bed5be23cd1bcc80065ae2ce09)]
|
|
39
|
+
- refactor(card): restore designs & add max lines controls [Antonis Tarantilis - [`e7d6e39`](https://github.com/eea/volto-eea-design-system/commit/e7d6e395dfc4110a361d27cd25af4a950a283aa4)]
|
|
40
|
+
- refactor(card): delete rounded card code and stories [Antonis Tarantilis - [`5177697`](https://github.com/eea/volto-eea-design-system/commit/5177697eac60b9876160b5f2741f0389e4bf8196)]
|
|
41
|
+
- refactor(card): add image controls [Antonis Tarantilis - [`5c1c0b8`](https://github.com/eea/volto-eea-design-system/commit/5c1c0b8081fdc5f944fcf495e17379a9526e25d0)]
|
|
42
|
+
- change(cards): set object fit and position on any ui images [David Ichim - [`1185305`](https://github.com/eea/volto-eea-design-system/commit/118530573145055ddb11e717ce2ba80270586c66)]
|
|
43
|
+
- refactor(accordion): update structure [Antonis Tarantilis - [`fc9847f`](https://github.com/eea/volto-eea-design-system/commit/fc9847fdc11576a73770caee0f141992652bb001)]
|
|
44
|
+
- refactor(card): add rounded control for cards [Antonis Tarantilis - [`df2e6a0`](https://github.com/eea/volto-eea-design-system/commit/df2e6a0bea91ee87a522a0c0eb3ea16d2eb61f0a)]
|
|
45
|
+
|
|
46
|
+
#### :house: Documentation changes
|
|
47
|
+
|
|
48
|
+
- docs(video): docusaurus page for video component [Dora Anastasiou - [`6e5b51e`](https://github.com/eea/volto-eea-design-system/commit/6e5b51e8fed58c4abc37b6d4a86a89256c9422a2)]
|
|
49
|
+
|
|
50
|
+
#### :hammer_and_wrench: Others
|
|
51
|
+
|
|
52
|
+
- Release 1.11.0 [alin - [`acc76ea`](https://github.com/eea/volto-eea-design-system/commit/acc76ea7b81e31a8d83179cb0af48482a8f84709)]
|
|
53
|
+
- bump package version [David Ichim - [`3dfa3f0`](https://github.com/eea/volto-eea-design-system/commit/3dfa3f088a4c012ac1bb36f3ef08fac9079f3f81)]
|
|
54
|
+
- added possibility to configure button url [Zoltan Szabo - [`91cd277`](https://github.com/eea/volto-eea-design-system/commit/91cd27764f646429f168c09361b370632e900c80)]
|
|
55
|
+
- Update Footer.stories.js [ichim-david - [`4001536`](https://github.com/eea/volto-eea-design-system/commit/400153652a87b141c5f081fa443127f40d8b2d61)]
|
|
56
|
+
- no need for title in link [andreiggr - [`b01c361`](https://github.com/eea/volto-eea-design-system/commit/b01c361c7e346d485214d69f33a7fc22180f5b5c)]
|
|
57
|
+
- Check contact url if is internal [andreiggr - [`5996d4e`](https://github.com/eea/volto-eea-design-system/commit/5996d4efc26aa00f2644f658252d6b817f06c177)]
|
|
58
|
+
- (feat): Make menu aware of pathname #151573 #336 from eea/ionut-menu [ichim-david - [`d4a2a96`](https://github.com/eea/volto-eea-design-system/commit/d4a2a96807bf9ea11ffaf08f2abeaa629c3dc876)]
|
|
59
|
+
- remove default acitve index [Dobricean Ioan Dorian - [`57235c6`](https://github.com/eea/volto-eea-design-system/commit/57235c6ad03730c23fe97f01c20a0a955cdcb732)]
|
|
60
|
+
- add default active index back [Dobricean Ioan Dorian - [`5020467`](https://github.com/eea/volto-eea-design-system/commit/5020467ed33612804626cf51dd5f2140d914757c)]
|
|
61
|
+
- remove console [Dobricean Ioan Dorian - [`7320e3a`](https://github.com/eea/volto-eea-design-system/commit/7320e3a3e2c1c8190480570edec3a57180c4eb4f)]
|
|
62
|
+
- ismultilingual [Dobricean Ioan Dorian - [`367c07c`](https://github.com/eea/volto-eea-design-system/commit/367c07c500cb8db3fb5941513ecba5eb357bc6af)]
|
|
63
|
+
- activeIndex [Dobricean Ioan Dorian - [`ba9d4b3`](https://github.com/eea/volto-eea-design-system/commit/ba9d4b3b1bf0ace3adc2b4dd55c09c509293138f)]
|
|
64
|
+
- Back to dev [Alin Voinea - [`98d0031`](https://github.com/eea/volto-eea-design-system/commit/98d00316740230cc3b4b95e031e0c1987effde76)]
|
|
65
|
+
- removed babel override, loader change should be done in storybook config [David Ichim - [`d63233e`](https://github.com/eea/volto-eea-design-system/commit/d63233ef24eb47a1f4ab68b454895886a0728fc7)]
|
|
7
66
|
### [1.0.7](https://github.com/eea/volto-eea-design-system/compare/1.0.6...1.0.7) - 10 April 2023
|
|
8
67
|
|
|
9
68
|
#### :rocket: New Features
|
|
@@ -161,7 +220,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
161
220
|
- fixed accordion selector typo [David Ichim - [`f4cabc8`](https://github.com/eea/volto-eea-design-system/commit/f4cabc8f2222cf587af9e04b0ea196799b84202f)]
|
|
162
221
|
### [1.0.1](https://github.com/eea/volto-eea-design-system/compare/1.0.0...1.0.1) - 13 March 2023
|
|
163
222
|
|
|
164
|
-
|
|
223
|
+
## [1.0.0](https://github.com/eea/volto-eea-design-system/compare/1.0.0-beta.6...1.0.0) - 13 March 2023
|
|
165
224
|
|
|
166
225
|
#### :bug: Bug Fixes
|
|
167
226
|
|
package/package.json
CHANGED
package/src/semantic.less
CHANGED
|
@@ -249,10 +249,6 @@
|
|
|
249
249
|
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/tagList';
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
& {
|
|
253
|
-
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/avatarGrid';
|
|
254
|
-
}
|
|
255
|
-
|
|
256
252
|
& {
|
|
257
253
|
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/keyContent';
|
|
258
254
|
}
|
|
@@ -15,85 +15,28 @@ export default {
|
|
|
15
15
|
defaultValue: 'primary',
|
|
16
16
|
options: ['default', 'primary', 'secondary', 'tertiary'],
|
|
17
17
|
control: { type: 'select' },
|
|
18
|
-
description: 'call to action variation',
|
|
19
18
|
table: {
|
|
20
19
|
defaultValue: { summary: 'primary' },
|
|
21
20
|
type: { summary: 'string' },
|
|
22
21
|
},
|
|
23
22
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
defaultValue: {
|
|
31
|
-
summary: '""',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
toggle2: {
|
|
36
|
-
description: 'Text of the accordion toggler',
|
|
37
|
-
table: {
|
|
38
|
-
type: {
|
|
39
|
-
summary: 'string',
|
|
40
|
-
},
|
|
41
|
-
defaultValue: {
|
|
42
|
-
summary: '""',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
toggle3: {
|
|
47
|
-
description: 'Text of the accordion toggler',
|
|
48
|
-
table: {
|
|
49
|
-
type: {
|
|
50
|
-
summary: 'string',
|
|
51
|
-
},
|
|
52
|
-
defaultValue: {
|
|
53
|
-
summary: '""',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
content1: {
|
|
58
|
-
description: 'Text of the hidden content',
|
|
59
|
-
table: {
|
|
60
|
-
type: {
|
|
61
|
-
summary: 'array',
|
|
62
|
-
},
|
|
63
|
-
defaultValue: {
|
|
64
|
-
summary: '""',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
content2: {
|
|
69
|
-
description: 'Text of the hidden content',
|
|
70
|
-
table: {
|
|
71
|
-
type: {
|
|
72
|
-
summary: 'array',
|
|
73
|
-
},
|
|
74
|
-
defaultValue: {
|
|
75
|
-
summary: '""',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
content3: {
|
|
80
|
-
description: 'Text of the hidden content',
|
|
23
|
+
title_size: {
|
|
24
|
+
name: 'Title size',
|
|
25
|
+
defaultValue: 'primary',
|
|
26
|
+
options: ['no value', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
|
27
|
+
control: { type: 'select' },
|
|
81
28
|
table: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
defaultValue: {
|
|
86
|
-
summary: '""',
|
|
87
|
-
},
|
|
29
|
+
defaultValue: { summary: 'primary' },
|
|
30
|
+
type: { summary: 'string' },
|
|
88
31
|
},
|
|
89
32
|
},
|
|
90
33
|
},
|
|
91
34
|
};
|
|
92
35
|
|
|
93
36
|
function AccordionContainer({ ...args }) {
|
|
94
|
-
const [activeIndex, setActiveIndex] = useState();
|
|
37
|
+
const [activeIndex, setActiveIndex] = useState([0]);
|
|
95
38
|
|
|
96
|
-
const
|
|
39
|
+
const handleClick = (e, titleProps) => {
|
|
97
40
|
const { index } = titleProps;
|
|
98
41
|
const newIndex = activeIndex === index ? -1 : index;
|
|
99
42
|
|
|
@@ -102,70 +45,56 @@ function AccordionContainer({ ...args }) {
|
|
|
102
45
|
|
|
103
46
|
return (
|
|
104
47
|
<Container>
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{args.content2.length > 0 &&
|
|
132
|
-
args.content2.map((item, index) => <p key={index}>{item}</p>)}
|
|
133
|
-
</Accordion.Content>
|
|
134
|
-
|
|
135
|
-
<Accordion.Title
|
|
136
|
-
active={activeIndex === 2}
|
|
137
|
-
index={2}
|
|
138
|
-
onClick={toggleOpenAccordion}
|
|
139
|
-
as="button"
|
|
140
|
-
>
|
|
141
|
-
{args.toggle3}
|
|
142
|
-
<Icon className="ri-arrow-down-s-line" />
|
|
143
|
-
</Accordion.Title>
|
|
144
|
-
<Accordion.Content active={activeIndex === 2}>
|
|
145
|
-
{args.content3.length > 0 &&
|
|
146
|
-
args.content3.map((item, index) => <p key={index}>{item}</p>)}
|
|
147
|
-
</Accordion.Content>
|
|
148
|
-
</Accordion>
|
|
48
|
+
<div className="accordion-block">
|
|
49
|
+
{args.panels.map((panel, index) => {
|
|
50
|
+
return (
|
|
51
|
+
<Accordion className={args.variant} key={index}>
|
|
52
|
+
<Accordion.Title
|
|
53
|
+
index={index}
|
|
54
|
+
tabIndex={0}
|
|
55
|
+
active={activeIndex === index}
|
|
56
|
+
onClick={handleClick}
|
|
57
|
+
as={args.title_size === 'no value' ? '' : args.title_size}
|
|
58
|
+
onKeyDown={(e) => {
|
|
59
|
+
if (e.nativeEvent.keyCode === 13) {
|
|
60
|
+
handleClick(e, { index });
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
<span>{panel.title}</span>
|
|
65
|
+
<Icon className="ri-arrow-down-s-line" />
|
|
66
|
+
</Accordion.Title>
|
|
67
|
+
<Accordion.Content active={activeIndex === index}>
|
|
68
|
+
{panel.content}
|
|
69
|
+
</Accordion.Content>
|
|
70
|
+
</Accordion>
|
|
71
|
+
);
|
|
72
|
+
})}
|
|
73
|
+
</div>
|
|
149
74
|
</Container>
|
|
150
75
|
);
|
|
151
76
|
}
|
|
152
77
|
|
|
153
78
|
const Template = (args) => <AccordionContainer {...args}></AccordionContainer>;
|
|
154
|
-
|
|
155
79
|
export const Default = Template.bind({});
|
|
156
80
|
Default.args = {
|
|
157
81
|
variant: 'secondary',
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
82
|
+
title_size: 'no value',
|
|
83
|
+
panels: [
|
|
84
|
+
{
|
|
85
|
+
title: 'Water and marine environment',
|
|
86
|
+
content:
|
|
87
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Urna nisi mauris enim felis eget id sed tristique. At laoreet ligula pretium, pulvinar. Accumsan egestas ultricies erat sed. Eget non quis libero, odio elementum lectus lectus ullamcorper elit. In quam pulvinar amet, habitasse mi lorem nunc. Sed sed elementum est purus elementum eget. Elementum tortor at nulla nunc, tempor rhoncus, bibendum. Massa mauris, mauris, vel elementum adipiscing.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'Resource efficiency and waste',
|
|
91
|
+
content:
|
|
92
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Urna nisi mauris enim felis eget id sed tristique. At laoreet ligula pretium, pulvinar. Accumsan egestas ultricies erat sed. Eget non quis libero, odio elementum lectus lectus ullamcorper elit. In quam pulvinar amet, habitasse mi lorem nunc. Sed sed elementum est purus elementum eget. Elementum tortor at nulla nunc, tempor rhoncus, bibendum. Massa mauris, mauris, vel elementum adipiscing.',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: 'Air pollution',
|
|
96
|
+
content:
|
|
97
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Urna nisi mauris enim felis eget id sed tristique. At laoreet ligula pretium, pulvinar. Accumsan egestas ultricies erat sed. Eget non quis libero, odio elementum lectus lectus ullamcorper elit. In quam pulvinar amet, habitasse mi lorem nunc. Sed sed elementum est purus elementum eget. Elementum tortor at nulla nunc, tempor rhoncus, bibendum. Massa mauris, mauris, vel elementum adipiscing.',
|
|
98
|
+
},
|
|
170
99
|
],
|
|
171
100
|
};
|
|
@@ -43,23 +43,85 @@ export default {
|
|
|
43
43
|
type: { summary: 'boolean' },
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
+
rounded: {
|
|
47
|
+
table: {
|
|
48
|
+
defaultValue: { summary: 'false' },
|
|
49
|
+
type: { summary: 'boolean' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
objectFit: {
|
|
53
|
+
name: 'Image fit',
|
|
54
|
+
options: ['unset', 'cover', 'contain', 'fill', 'scale-down'],
|
|
55
|
+
control: { type: 'select' },
|
|
56
|
+
table: {
|
|
57
|
+
category: 'Image',
|
|
58
|
+
defaultValue: { summary: 'cover' },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
objectPosition: {
|
|
62
|
+
name: 'Image position',
|
|
63
|
+
options: ['none', 'center', 'top', 'bottom', 'left', 'right'],
|
|
64
|
+
control: { type: 'select' },
|
|
65
|
+
table: {
|
|
66
|
+
category: 'Image',
|
|
67
|
+
defaultValue: { summary: 'center' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
titleMaxLines: {
|
|
71
|
+
name: 'Title max lines',
|
|
72
|
+
options: ['none', '1', '2', '3', '4', '5'],
|
|
73
|
+
control: { type: 'select' },
|
|
74
|
+
table: {
|
|
75
|
+
category: 'Content',
|
|
76
|
+
defaultValue: { summary: '2' },
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
maxLines: {
|
|
80
|
+
name: 'Content max lines',
|
|
81
|
+
options: ['none', '1', '2', '3', '4', '5'],
|
|
82
|
+
control: { type: 'select' },
|
|
83
|
+
table: {
|
|
84
|
+
category: 'Content',
|
|
85
|
+
defaultValue: { summary: '2' },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
46
88
|
cards: {
|
|
89
|
+
name: 'Cards content',
|
|
47
90
|
table: {
|
|
48
91
|
type: {
|
|
49
92
|
summary: 'Object',
|
|
50
93
|
},
|
|
94
|
+
category: 'Content',
|
|
51
95
|
defaultValue: { summary: ' "" ' },
|
|
52
96
|
},
|
|
53
97
|
},
|
|
54
98
|
},
|
|
55
99
|
};
|
|
56
100
|
|
|
57
|
-
const CardTemplate = ({
|
|
101
|
+
const CardTemplate = ({
|
|
102
|
+
variant,
|
|
103
|
+
inverted,
|
|
104
|
+
titleOnImage,
|
|
105
|
+
rounded,
|
|
106
|
+
objectFit,
|
|
107
|
+
objectPosition,
|
|
108
|
+
titleMaxLines,
|
|
109
|
+
maxLines,
|
|
110
|
+
card,
|
|
111
|
+
}) => (
|
|
58
112
|
<Card
|
|
59
113
|
fluid={card.fluid}
|
|
60
|
-
className={
|
|
114
|
+
className={`u-card ${variant === 'default' ? '' : variant} ${
|
|
61
115
|
inverted ? 'inverted' : ''
|
|
62
|
-
}
|
|
116
|
+
} ${variant} ${rounded ? 'rounded' : ''} ${
|
|
117
|
+
objectFit === 'unset' ? '' : 'has--object-fit--' + objectFit
|
|
118
|
+
} ${
|
|
119
|
+
objectPosition === 'none' ? '' : 'has--object-position--' + objectPosition
|
|
120
|
+
} ${
|
|
121
|
+
titleMaxLines === 'none'
|
|
122
|
+
? 'title-max-0-lines'
|
|
123
|
+
: 'title-max-' + titleMaxLines + '-lines'
|
|
124
|
+
} ${maxLines === 'none' ? 'max-0-lines' : 'max-' + maxLines + '-lines'}`}
|
|
63
125
|
>
|
|
64
126
|
{/* Card Image */}
|
|
65
127
|
{card.hasImage ? (
|
|
@@ -127,6 +189,11 @@ const Template = (args) => (
|
|
|
127
189
|
variant={args.variant}
|
|
128
190
|
titleOnImage={args.titleOnImage}
|
|
129
191
|
inverted={args.inverted}
|
|
192
|
+
rounded={args.rounded}
|
|
193
|
+
objectFit={args.objectFit}
|
|
194
|
+
objectPosition={args.objectPosition}
|
|
195
|
+
titleMaxLines={args.titleMaxLines}
|
|
196
|
+
maxLines={args.maxLines}
|
|
130
197
|
card={card}
|
|
131
198
|
key={index}
|
|
132
199
|
/>
|
|
@@ -139,6 +206,11 @@ Default.args = {
|
|
|
139
206
|
titleOnImage: false,
|
|
140
207
|
variant: 'default',
|
|
141
208
|
inverted: false,
|
|
209
|
+
rounded: false,
|
|
210
|
+
objectFit: 'cover',
|
|
211
|
+
objectPosition: 'center',
|
|
212
|
+
titleMaxLines: '2',
|
|
213
|
+
maxLines: '2',
|
|
142
214
|
cards: [
|
|
143
215
|
{
|
|
144
216
|
title: 'Economy and resources',
|
|
@@ -164,6 +236,11 @@ const GridTemplate = (args) => (
|
|
|
164
236
|
variant={args.variant}
|
|
165
237
|
titleOnImage={args.titleOnImage}
|
|
166
238
|
inverted={args.inverted}
|
|
239
|
+
rounded={args.rounded}
|
|
240
|
+
objectFit={args.objectFit}
|
|
241
|
+
objectPosition={args.objectPosition}
|
|
242
|
+
titleMaxLines={args.titleMaxLines}
|
|
243
|
+
maxLines={args.maxLines}
|
|
167
244
|
card={card}
|
|
168
245
|
key={index}
|
|
169
246
|
/>
|
|
@@ -178,6 +255,11 @@ CardGrid.args = {
|
|
|
178
255
|
titleOnImage: false,
|
|
179
256
|
variant: 'default',
|
|
180
257
|
inverted: false,
|
|
258
|
+
rounded: false,
|
|
259
|
+
objectFit: 'cover',
|
|
260
|
+
objectPosition: 'center',
|
|
261
|
+
titleMaxLines: '2',
|
|
262
|
+
maxLines: '2',
|
|
181
263
|
cards: [
|
|
182
264
|
{
|
|
183
265
|
title: 'Nature',
|
|
@@ -223,6 +305,11 @@ ImageGrid.args = {
|
|
|
223
305
|
titleOnImage: true,
|
|
224
306
|
variant: 'default',
|
|
225
307
|
inverted: false,
|
|
308
|
+
rounded: false,
|
|
309
|
+
objectFit: 'center',
|
|
310
|
+
objectPosition: 'cover',
|
|
311
|
+
titleMaxLines: '2',
|
|
312
|
+
maxLines: '2',
|
|
226
313
|
cards: [
|
|
227
314
|
{
|
|
228
315
|
title: 'Nature',
|
|
@@ -259,6 +346,11 @@ const FluidGridTemplate = (args) => (
|
|
|
259
346
|
variant={args.variant}
|
|
260
347
|
titleOnImage={args.titleOnImage}
|
|
261
348
|
inverted={args.inverted}
|
|
349
|
+
rounded={args.rounded}
|
|
350
|
+
objectFit={args.objectFit}
|
|
351
|
+
objectPosition={args.objectPosition}
|
|
352
|
+
titleMaxLines={args.titleMaxLines}
|
|
353
|
+
maxLines={args.maxLines}
|
|
262
354
|
card={card}
|
|
263
355
|
key={index}
|
|
264
356
|
/>
|
|
@@ -272,6 +364,11 @@ FluidGrid.args = {
|
|
|
272
364
|
titleOnImage: false,
|
|
273
365
|
variant: 'default',
|
|
274
366
|
inverted: false,
|
|
367
|
+
rounded: false,
|
|
368
|
+
objectFit: 'cover',
|
|
369
|
+
objectPosition: 'center',
|
|
370
|
+
titleMaxLines: '2',
|
|
371
|
+
maxLines: '2',
|
|
275
372
|
cards: [
|
|
276
373
|
{
|
|
277
374
|
title: 'Nature',
|
|
@@ -349,7 +446,12 @@ function CarouselCardsContent({
|
|
|
349
446
|
titleOnImage,
|
|
350
447
|
variant,
|
|
351
448
|
inverted,
|
|
449
|
+
rounded,
|
|
450
|
+
objectFit,
|
|
352
451
|
settings,
|
|
452
|
+
objectPosition,
|
|
453
|
+
titleMaxLines,
|
|
454
|
+
maxLines,
|
|
353
455
|
cards,
|
|
354
456
|
}) {
|
|
355
457
|
const slider = React.useRef(null);
|
|
@@ -361,6 +463,11 @@ function CarouselCardsContent({
|
|
|
361
463
|
variant={variant}
|
|
362
464
|
titleOnImage={titleOnImage}
|
|
363
465
|
inverted={inverted}
|
|
466
|
+
rounded={rounded}
|
|
467
|
+
objectFit={objectFit}
|
|
468
|
+
objectPosition={objectPosition}
|
|
469
|
+
titleMaxLines={titleMaxLines}
|
|
470
|
+
maxLines={maxLines}
|
|
364
471
|
card={card}
|
|
365
472
|
key={index}
|
|
366
473
|
/>
|
|
@@ -382,6 +489,11 @@ CarouselCards.args = {
|
|
|
382
489
|
titleOnImage: false,
|
|
383
490
|
variant: 'default',
|
|
384
491
|
inverted: false,
|
|
492
|
+
rounded: false,
|
|
493
|
+
objectFit: 'cover',
|
|
494
|
+
objectPosition: 'center',
|
|
495
|
+
titleMaxLines: '2',
|
|
496
|
+
maxLines: '2',
|
|
385
497
|
settings: {
|
|
386
498
|
dots: true,
|
|
387
499
|
infinite: true,
|
|
@@ -467,17 +579,37 @@ CarouselCards.argTypes = {
|
|
|
467
579
|
},
|
|
468
580
|
};
|
|
469
581
|
|
|
470
|
-
const TeaserCard = ({
|
|
582
|
+
const TeaserCard = ({
|
|
583
|
+
variant,
|
|
584
|
+
titleOnImage,
|
|
585
|
+
inverted,
|
|
586
|
+
rounded,
|
|
587
|
+
objectFit,
|
|
588
|
+
objectPosition,
|
|
589
|
+
titleMaxLines,
|
|
590
|
+
maxLines,
|
|
591
|
+
card,
|
|
592
|
+
}) => (
|
|
471
593
|
<div className="column grid-block-teaser">
|
|
472
594
|
<div
|
|
473
|
-
className={`styled-teaser styled ${
|
|
474
|
-
variant === 'default' ? '' : variant
|
|
475
|
-
} ${inverted ? 'inverted' : ''}`}
|
|
595
|
+
className={`styled-teaser styled ${variant === 'default' ? '' : variant}`}
|
|
476
596
|
>
|
|
477
597
|
<div
|
|
478
|
-
className={`ui card u-card
|
|
479
|
-
|
|
480
|
-
} ${variant}
|
|
598
|
+
className={`ui card u-card ${card.fluid ? 'fluid' : ''} ${
|
|
599
|
+
inverted ? 'inverted' : ''
|
|
600
|
+
} ${variant} ${rounded ? 'rounded' : ''} ${
|
|
601
|
+
objectFit === 'unset' ? '' : 'has--object-fit--' + objectFit
|
|
602
|
+
} ${
|
|
603
|
+
objectPosition === 'none'
|
|
604
|
+
? ''
|
|
605
|
+
: 'has--object-position--' + objectPosition
|
|
606
|
+
} ${
|
|
607
|
+
titleMaxLines === 'none'
|
|
608
|
+
? 'title-max-0-lines'
|
|
609
|
+
: 'title-max-' + titleMaxLines + '-lines'
|
|
610
|
+
} ${
|
|
611
|
+
maxLines === 'none' ? 'max-0-lines' : 'max-' + maxLines + '-lines'
|
|
612
|
+
}`}
|
|
481
613
|
>
|
|
482
614
|
<a className="image" href={card.href}>
|
|
483
615
|
<img src={card.imgUrl} alt={card.title} className="ui image" />
|
|
@@ -510,6 +642,11 @@ const TeaserTemplate = (args) => (
|
|
|
510
642
|
variant={args.variant}
|
|
511
643
|
titleOnImage={args.titleOnImage}
|
|
512
644
|
inverted={args.inverted}
|
|
645
|
+
rounded={args.rounded}
|
|
646
|
+
objectFit={args.objectFit}
|
|
647
|
+
objectPosition={args.objectPosition}
|
|
648
|
+
titleMaxLines={args.titleMaxLines}
|
|
649
|
+
maxLines={args.maxLines}
|
|
513
650
|
card={card}
|
|
514
651
|
key={index}
|
|
515
652
|
/>
|
|
@@ -524,6 +661,11 @@ TeaserCardGrid.args = {
|
|
|
524
661
|
titleOnImage: false,
|
|
525
662
|
variant: 'default',
|
|
526
663
|
inverted: false,
|
|
664
|
+
rounded: false,
|
|
665
|
+
objectFit: 'cover',
|
|
666
|
+
objectPosition: 'center',
|
|
667
|
+
titleMaxLines: '2',
|
|
668
|
+
maxLines: '2',
|
|
527
669
|
cards: [
|
|
528
670
|
{
|
|
529
671
|
title: "State of Europe's environment",
|
|
@@ -538,7 +680,7 @@ TeaserCardGrid.args = {
|
|
|
538
680
|
{
|
|
539
681
|
title: 'Climate',
|
|
540
682
|
imgUrl:
|
|
541
|
-
'https://www.eea.europa.eu/
|
|
683
|
+
'https://www.eea.europa.eu/publications/eea-eionet-strategy-2021-2030/image_mini',
|
|
542
684
|
hasImage: true,
|
|
543
685
|
description:
|
|
544
686
|
'Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.Leo fermentum sollicitudin suspendisse iaculis feugiat. Eget tellus blandit aenean mattis.',
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
+
import { isInternalURL } from '@plone/volto/helpers/Url/Url';
|
|
6
|
+
|
|
5
7
|
const Contact = ({ children, contacts }) =>
|
|
6
8
|
children?.length ? (
|
|
7
9
|
children
|
|
@@ -9,15 +11,38 @@ const Contact = ({ children, contacts }) =>
|
|
|
9
11
|
<div className="contact-block">
|
|
10
12
|
{contacts?.map((contact, index) => (
|
|
11
13
|
<div className="contact" key={index}>
|
|
12
|
-
|
|
13
|
-
{contact.
|
|
14
|
-
|
|
14
|
+
{isInternalURL(contact.link) ? (
|
|
15
|
+
<Link to={contact.link} className="bold">
|
|
16
|
+
{contact.text}
|
|
17
|
+
</Link>
|
|
18
|
+
) : (
|
|
19
|
+
<a
|
|
20
|
+
href={contact.link}
|
|
21
|
+
target={'_blank'}
|
|
22
|
+
rel="noopener noreferrer"
|
|
23
|
+
className={'bold'}
|
|
24
|
+
>
|
|
25
|
+
{contact.text}
|
|
26
|
+
</a>
|
|
27
|
+
)}
|
|
15
28
|
{contact.children && (
|
|
16
29
|
<div className="subcontact">
|
|
17
30
|
{contact.children.map((child, index) => (
|
|
18
|
-
|
|
19
|
-
{child.
|
|
20
|
-
|
|
31
|
+
<>
|
|
32
|
+
{isInternalURL(child.link) ? (
|
|
33
|
+
<Link to={child.link} key={index}>
|
|
34
|
+
{child.text}
|
|
35
|
+
</Link>
|
|
36
|
+
) : (
|
|
37
|
+
<a
|
|
38
|
+
href={child.link}
|
|
39
|
+
target={'_blank'}
|
|
40
|
+
rel="noopener noreferrer"
|
|
41
|
+
>
|
|
42
|
+
{child.text}
|
|
43
|
+
</a>
|
|
44
|
+
)}
|
|
45
|
+
</>
|
|
21
46
|
))}
|
|
22
47
|
</div>
|
|
23
48
|
)}
|