@eeacms/volto-eea-design-system 1.16.0 → 1.18.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 +57 -0
- package/docker-compose.yml +5 -1
- package/locales/en/LC_MESSAGES/volto.po +14 -0
- package/package.json +1 -1
- package/src/helpers/index.js +4 -4
- package/src/helpers/useClickOutside.test.js +63 -0
- package/src/helpers/useFirstVisited.test.js +54 -0
- package/src/ui/Accordion/Accordion.stories.js +3 -1
- package/src/ui/Accordion/Accordion.stories.test.js +45 -0
- package/src/ui/Banner/Banner.test.jsx +292 -0
- package/src/ui/CallToAction/CallToAction.stories.test.jsx +69 -0
- package/src/ui/Card/Card.stories.test.jsx +78 -0
- package/src/ui/Card/IconCard/IconCard.stories.test.jsx +64 -0
- package/src/ui/Card/RelatedContent/RelatedContent.jsx +1 -1
- package/src/ui/Card/RelatedContent/RelatedContent.stories.jsx +2 -2
- package/src/ui/Card/RelatedContent/RelatedContent.stories.test.jsx +65 -0
- package/src/ui/Confirm/Confirm.stories.test.js +27 -0
- package/src/ui/ContextNavigation/ContextNavigation.stories.test.jsx +170 -0
- package/src/ui/Divider/Divider.stories.test.jsx +44 -0
- package/src/ui/DownloadLabeledIcon/DownloadLabeledIcon.stories.test.jsx +24 -0
- package/src/ui/Footer/Description.test.jsx +11 -0
- package/src/ui/Footer/Footer.stories.test.js +131 -0
- package/src/ui/Footer/Social.test.jsx +11 -0
- package/src/ui/Form/Button/Button.stories.test.jsx +55 -0
- package/src/ui/Form/Checkbox.stories.test.js +79 -0
- package/src/ui/Form/Dropdown.stories.test.js +24 -0
- package/src/ui/Form/Radio.stories.test.js +55 -0
- package/src/ui/Form/Textarea.stories.test.js +41 -0
- package/src/ui/Form/input.stories.test.js +52 -0
- package/src/ui/Grid/ComponentGrid.stories.test.js +21 -0
- package/src/ui/Header/Header.stories.test.js +158 -0
- package/src/ui/Header/Header.test.jsx +293 -0
- package/src/ui/Header/HeaderMenuPopUp.js +12 -4
- package/src/ui/Header/HeaderSearchPopUp.test.js +114 -0
- package/src/ui/Hero/Hero.stories.test.jsx +67 -0
- package/src/ui/InpageNavigation/InpageNavigation.stories.test.jsx +10 -0
- package/src/ui/InpageNavigation/InpageNavigation.test.jsx +87 -0
- package/src/ui/Item/Item.stories.test.js +39 -0
- package/src/ui/Item/ItemGroupWithIcons.stories.test.js +119 -0
- package/src/ui/Label/Label.stories.test.js +76 -0
- package/src/ui/LabeledIconGroup/LabeledIconGroup.stories.test.jsx +19 -0
- package/src/ui/LanguageLabeledIcon/LanguageLabeledIcon.jsx +3 -2
- package/src/ui/LanguageLabeledIcon/LanguangeLabeledIcon.test.jsx +60 -0
- package/src/ui/Loader/Loader.stories.test.jsx +30 -0
- package/src/ui/Logo/Logo.stories.test.jsx +81 -0
- package/src/ui/Media/Image.stories.test.js +35 -0
- package/src/ui/Message/Message.stories.test.js +44 -0
- package/src/ui/Modal/Modal.stories.test.js +45 -0
- package/src/ui/Popup/Popup.jsx +24 -17
- package/src/ui/Popup/Popup.test.jsx +60 -0
- package/src/ui/Progress/Progress.stories.test.js +30 -0
- package/src/ui/Quote/Testimonial/Testimonial.stories.test.jsx +18 -0
- package/src/ui/Statistic/Statistic.stories.test.js +93 -0
- package/src/ui/Table/Table.stories.js +8 -0
- package/src/ui/Table/Table.stories.test.js +54 -0
- package/src/ui/Timeline/Timeline.stories.test.jsx +43 -0
- package/src/ui/index.js +21 -41
- package/theme/themes/eea/assets/images/Footer/Extras/footer-visual.svg +1 -2065
- package/theme/themes/eea/extras/banner.less +3 -3
- package/theme/themes/eea/modules/accordion.overrides +36 -11
- package/theme/themes/eea/modules/accordion.variables +2 -0
- package/theme/themes/eea/views/item.overrides +21 -0
- package/src/i18n.js +0 -180
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
align-items: @mobileActionsAlignItems;
|
|
60
60
|
justify-content: flex-end;
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
.action {
|
|
63
63
|
.ui.basic.inverted.button {
|
|
64
|
-
/* used basic inverted button for
|
|
64
|
+
/* used basic inverted button for minimum overrides on box-shadow and active state background */
|
|
65
65
|
box-shadow: @bannerActionButtonBoxShadow !important;
|
|
66
66
|
|
|
67
67
|
&:active {
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
flex-direction: @tabletActionsFlexDirection;
|
|
167
167
|
align-items: @tabletActionsAlignItems;
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
.action {
|
|
170
170
|
min-width: @tabletActionsActionMinWidth;
|
|
171
171
|
|
|
172
172
|
.ui.basic.inverted.button i.icon {
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.ui.accordion button.title {
|
|
10
|
-
background: transparent;
|
|
11
10
|
width: 100%;
|
|
12
11
|
border: none;
|
|
12
|
+
background: transparent;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.ui.accordion {
|
|
@@ -60,7 +60,18 @@
|
|
|
60
60
|
color: @iconColor;
|
|
61
61
|
font-size: @iconFontSize;
|
|
62
62
|
line-height: @iconFontSize;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.filter {
|
|
66
|
+
.icon {
|
|
67
|
+
margin: @filterIconMargin;
|
|
68
|
+
color: var(--text-color, @filterTextColor);
|
|
69
|
+
font-size: @filterIconFontSize;
|
|
70
|
+
}
|
|
63
71
|
|
|
72
|
+
.ui.input input::placeholder {
|
|
73
|
+
color: var(--text-color, @filterTextColor);
|
|
74
|
+
}
|
|
64
75
|
}
|
|
65
76
|
}
|
|
66
77
|
|
|
@@ -75,9 +86,9 @@
|
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
.content {
|
|
89
|
+
padding: @contentPadding;
|
|
78
90
|
background: @contentBackground;
|
|
79
91
|
color: @contentColor;
|
|
80
|
-
padding: @contentPadding;
|
|
81
92
|
}
|
|
82
93
|
}
|
|
83
94
|
|
|
@@ -94,11 +105,12 @@
|
|
|
94
105
|
Styled
|
|
95
106
|
---------------*/
|
|
96
107
|
|
|
97
|
-
.ui.styled.accordion
|
|
98
|
-
.ui.styled.accordion
|
|
99
|
-
.ui.styled.accordion
|
|
108
|
+
.ui.styled.accordion .title,
|
|
109
|
+
.ui.styled.accordion .title:hover,
|
|
110
|
+
.ui.styled.accordion .title:focus-visible {
|
|
100
111
|
background-color: @styledActiveTitleBackground;
|
|
101
112
|
}
|
|
113
|
+
|
|
102
114
|
.ui.styled.accordion .active.title input {
|
|
103
115
|
color: @styledActiveTitleColor;
|
|
104
116
|
}
|
|
@@ -125,8 +137,7 @@
|
|
|
125
137
|
Variations
|
|
126
138
|
---------------*/
|
|
127
139
|
.ui.accordion[class*='ary'] .active.title,
|
|
128
|
-
.ui.accordion[class*='ary'] .filter
|
|
129
|
-
{
|
|
140
|
+
.ui.accordion[class*='ary'] .filter {
|
|
130
141
|
--text-color-hover: white;
|
|
131
142
|
--text-color: white;
|
|
132
143
|
}
|
|
@@ -136,6 +147,7 @@
|
|
|
136
147
|
.ui.accordion.primary .filter {
|
|
137
148
|
--bg-color: @primaryColorCSSVar;
|
|
138
149
|
}
|
|
150
|
+
|
|
139
151
|
.ui.accordion.primary .title:not(.active, .filter):hover,
|
|
140
152
|
.ui.accordion.primary .title:not(.active, .filter):focus-visible {
|
|
141
153
|
--text-color-hover: @primaryColorCSSVar;
|
|
@@ -146,6 +158,7 @@
|
|
|
146
158
|
.ui.accordion.secondary .filter {
|
|
147
159
|
--bg-color: @secondaryColorCSSVar;
|
|
148
160
|
}
|
|
161
|
+
|
|
149
162
|
.ui.accordion.secondary .title:not(.active, .filter):hover,
|
|
150
163
|
.ui.accordion.secondary .title:not(.active, .filter):focus-visible {
|
|
151
164
|
--text-color-hover: @secondaryColorCSSVar;
|
|
@@ -156,14 +169,26 @@
|
|
|
156
169
|
.ui.accordion.tertiary .filter {
|
|
157
170
|
--bg-color: @tertiaryColorCSSVar;
|
|
158
171
|
}
|
|
172
|
+
|
|
159
173
|
.ui.accordion.tertiary .title:not(.active, .filter):hover,
|
|
160
174
|
.ui.accordion.tertiary .title:not(.active, .filter):focus-visible {
|
|
161
175
|
--text-color-hover: @tertiaryColorCSSVar;
|
|
162
176
|
}
|
|
163
177
|
|
|
164
178
|
@media only screen and (max-width: @largestMobileScreen) {
|
|
165
|
-
.accordion-block h1 * {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
179
|
+
.accordion-block h1 * {
|
|
180
|
+
font-size: @mobileH1;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.accordion-block h2 * {
|
|
184
|
+
font-size: @mobileH2;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.accordion-block h3 * {
|
|
188
|
+
font-size: @mobileH3;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.accordion-block h4 * {
|
|
192
|
+
font-size: @mobileH4;
|
|
193
|
+
}
|
|
169
194
|
}
|
|
@@ -172,6 +172,27 @@
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
.flex-items-wrapper.items-2-columns .flex-item {
|
|
176
|
+
width: var(--flex-item-width, 100%);
|
|
177
|
+
}
|
|
178
|
+
@media only screen and (min-width: @tabletBreakpoint) {
|
|
179
|
+
.flex-items-wrapper.items-2-columns .flex-item {
|
|
180
|
+
--flex-item-width: calc(@width / 2 - 1%);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.flex-items-wrapper.items-3-columns .flex-item {
|
|
184
|
+
--flex-item-width: calc(@width / 3);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.flex-items-wrapper.items-4-columns .flex-item {
|
|
188
|
+
--flex-item-width: calc(@width / 4);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.flex-items-wrapper.items-5-columns .flex-item {
|
|
192
|
+
--flex-item-width: calc(@width / 5);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
175
196
|
|
|
176
197
|
@media only screen and (max-width: @largestMobileScreen) {
|
|
177
198
|
.ui.items.row > .item {
|
package/src/i18n.js
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
/* eslint no-console: 0 */
|
|
2
|
-
/**
|
|
3
|
-
* i18n script.
|
|
4
|
-
* @module scripts/i18n
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const { find, keys, map, concat, reduce } = require('lodash');
|
|
8
|
-
const glob = require('glob').sync;
|
|
9
|
-
const fs = require('fs');
|
|
10
|
-
const Pofile = require('pofile');
|
|
11
|
-
const babel = require('@babel/core');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Extract messages into separate JSON files
|
|
15
|
-
* @function extractMessages
|
|
16
|
-
* @return {undefined}
|
|
17
|
-
*/
|
|
18
|
-
function extractMessages() {
|
|
19
|
-
map(glob('src/**/*.js?(x)'), (filename) => {
|
|
20
|
-
babel.transformFileSync(filename, {}, (err) => {
|
|
21
|
-
if (err) {
|
|
22
|
-
console.log(err);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Get messages from separate JSON files
|
|
30
|
-
* @function getMessages
|
|
31
|
-
* @return {Object} Object with messages
|
|
32
|
-
*/
|
|
33
|
-
function getMessages() {
|
|
34
|
-
return reduce(
|
|
35
|
-
concat(
|
|
36
|
-
{},
|
|
37
|
-
...map(
|
|
38
|
-
// We ignore the existing customized shadowed components ones, since most
|
|
39
|
-
// probably we won't be overriding them
|
|
40
|
-
// If so, we should do it in the config object or somewhere else
|
|
41
|
-
glob('build/messages/src/**/*.json', {
|
|
42
|
-
ignore: 'build/messages/src/customizations/**',
|
|
43
|
-
}),
|
|
44
|
-
(filename) =>
|
|
45
|
-
map(JSON.parse(fs.readFileSync(filename, 'utf8')), (message) => ({
|
|
46
|
-
...message,
|
|
47
|
-
filename: filename.match(/build\/messages\/src\/(.*).json$/)[1],
|
|
48
|
-
})),
|
|
49
|
-
),
|
|
50
|
-
),
|
|
51
|
-
(current, value) => {
|
|
52
|
-
let result = current;
|
|
53
|
-
if (current.id) {
|
|
54
|
-
result = {
|
|
55
|
-
[current.id]: {
|
|
56
|
-
defaultMessage: current.defaultMessage,
|
|
57
|
-
filenames: [current.filename],
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (result[value.id]) {
|
|
63
|
-
result[value.id].filenames.push(value.filename);
|
|
64
|
-
} else {
|
|
65
|
-
result[value.id] = {
|
|
66
|
-
defaultMessage: value.defaultMessage,
|
|
67
|
-
filenames: [value.filename],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Convert messages to pot format
|
|
77
|
-
* @function messagesToPot
|
|
78
|
-
* @param {Object} messages Messages
|
|
79
|
-
* @return {string} Formatted pot string
|
|
80
|
-
*/
|
|
81
|
-
function messagesToPot(messages) {
|
|
82
|
-
return map(keys(messages).sort(), (key) =>
|
|
83
|
-
[
|
|
84
|
-
...map(messages[key].filenames, (filename) => `#: ${filename}`),
|
|
85
|
-
`# defaultMessage: ${messages[key].defaultMessage}`,
|
|
86
|
-
`msgid "${key}"`,
|
|
87
|
-
'msgstr ""',
|
|
88
|
-
].join('\n'),
|
|
89
|
-
).join('\n\n');
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Pot header
|
|
94
|
-
* @function potHeader
|
|
95
|
-
* @return {string} Formatted pot header
|
|
96
|
-
*/
|
|
97
|
-
function potHeader() {
|
|
98
|
-
return `msgid ""
|
|
99
|
-
msgstr ""
|
|
100
|
-
"Project-Id-Version: Plone\\n"
|
|
101
|
-
"POT-Creation-Date: ${new Date().toISOString()}\\n"
|
|
102
|
-
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\\n"
|
|
103
|
-
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\\n"
|
|
104
|
-
"MIME-Version: 1.0\\n"
|
|
105
|
-
"Content-Type: text/plain; charset=utf-8\\n"
|
|
106
|
-
"Content-Transfer-Encoding: 8bit\\n"
|
|
107
|
-
"Plural-Forms: nplurals=1; plural=0;\\n"
|
|
108
|
-
"Language-Code: en\\n"
|
|
109
|
-
"Language-Name: English\\n"
|
|
110
|
-
"Preferred-Encodings: utf-8\\n"
|
|
111
|
-
"Domain: volto\\n"
|
|
112
|
-
|
|
113
|
-
`;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Format header
|
|
118
|
-
* @function formatHeader
|
|
119
|
-
* @param {Array} comments Array of comments
|
|
120
|
-
* @param {Object} headers Object of header items
|
|
121
|
-
* @return {string} Formatted header
|
|
122
|
-
*/
|
|
123
|
-
function formatHeader(comments, headers) {
|
|
124
|
-
return [
|
|
125
|
-
...map(comments, (comment) => `# ${comment}`),
|
|
126
|
-
'msgid ""',
|
|
127
|
-
'msgstr ""',
|
|
128
|
-
...map(keys(headers), (key) => `"${key}: ${headers[key]}\\n"`),
|
|
129
|
-
'',
|
|
130
|
-
].join('\n');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Sync po by the pot file
|
|
135
|
-
* @function syncPoByPot
|
|
136
|
-
* @return {undefined}
|
|
137
|
-
*/
|
|
138
|
-
function syncPoByPot() {
|
|
139
|
-
const pot = Pofile.parse(fs.readFileSync('locales/volto.pot', 'utf8'));
|
|
140
|
-
|
|
141
|
-
map(glob('locales/**/*.po'), (filename) => {
|
|
142
|
-
const po = Pofile.parse(fs.readFileSync(filename, 'utf8'));
|
|
143
|
-
|
|
144
|
-
fs.writeFileSync(
|
|
145
|
-
filename,
|
|
146
|
-
`${formatHeader(po.comments, po.headers)}
|
|
147
|
-
${map(pot.items, (item) => {
|
|
148
|
-
const poItem = find(po.items, { msgid: item.msgid });
|
|
149
|
-
return [
|
|
150
|
-
`${map(item.references, (ref) => `#: ${ref}`).join('\n')}`,
|
|
151
|
-
`msgid "${item.msgid}"`,
|
|
152
|
-
`msgstr "${poItem ? poItem.msgstr : ''}"`,
|
|
153
|
-
].join('\n');
|
|
154
|
-
}).join('\n\n')}\n`,
|
|
155
|
-
);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Main tasks
|
|
160
|
-
console.log('Extracting messages from source files...');
|
|
161
|
-
extractMessages();
|
|
162
|
-
console.log('Synchronizing messages to pot file...');
|
|
163
|
-
// We only write the pot file if it's really different
|
|
164
|
-
const newPot = `${potHeader()}${messagesToPot(getMessages())}\n`.replace(
|
|
165
|
-
/"POT-Creation-Date:(.*)\\n"/,
|
|
166
|
-
'',
|
|
167
|
-
);
|
|
168
|
-
const oldPot = fs
|
|
169
|
-
.readFileSync('locales/volto.pot', 'utf8')
|
|
170
|
-
.replace(/"POT-Creation-Date:(.*)\\n"/, '');
|
|
171
|
-
|
|
172
|
-
if (newPot !== oldPot) {
|
|
173
|
-
fs.writeFileSync(
|
|
174
|
-
'locales/volto.pot',
|
|
175
|
-
`${potHeader()}${messagesToPot(getMessages())}\n`,
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
console.log('Synchronizing messages to po files...');
|
|
179
|
-
syncPoByPot();
|
|
180
|
-
console.log('done!');
|