@eeacms/volto-eea-design-system 0.7.3 → 0.7.5
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
CHANGED
|
@@ -4,8 +4,24 @@ 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
|
+
#### [0.7.5](https://github.com/eea/volto-eea-design-system/compare/0.7.3...0.7.5)
|
|
8
|
+
|
|
9
|
+
- Update package.json [`e21e00d`](https://github.com/eea/volto-eea-design-system/commit/e21e00dc1e0b54daef2c71311a9da709bc1f7e6d)
|
|
10
|
+
- Autobuild of docusaurus docs [`ca7c756`](https://github.com/eea/volto-eea-design-system/commit/ca7c75680763219f0acdc4c91d348c4520de13f4)
|
|
11
|
+
- change(megamenu): mobile menu improvements #223 [`b3cabfe`](https://github.com/eea/volto-eea-design-system/commit/b3cabfe3ddc42c2ea39ae20d01bb6fd0db478ecc)
|
|
12
|
+
- change(megamenu): enable active border only for items not titles [`fb0b869`](https://github.com/eea/volto-eea-design-system/commit/fb0b8696dd73cbf3083c3006a7cff5a1901a6bac)
|
|
13
|
+
- change(megamenu): removed icon from at a change menu items and they are no longer bold as requested [`043e772`](https://github.com/eea/volto-eea-design-system/commit/043e77219979711d2f25845c6811b546e791fbf7)
|
|
14
|
+
- change(megamenu): mobile menu design tweaks as seen in latest figma [`26d74dc`](https://github.com/eea/volto-eea-design-system/commit/26d74dc063f0b3f8d541c714a10038d79145047e)
|
|
15
|
+
- change(megamenu): handle default active sub accordion [`6192a99`](https://github.com/eea/volto-eea-design-system/commit/6192a9938b53522682953cb73d7ccfc6ef9c1aec)
|
|
16
|
+
- change(megamenu): fixed key error warnings [`075bf01`](https://github.com/eea/volto-eea-design-system/commit/075bf0167554869e9fc2f4938c972112e4afa2f7)
|
|
17
|
+
- change(megamenu): reset first level panels after each item pass [`175351b`](https://github.com/eea/volto-eea-design-system/commit/175351bdc9bab5c2d02b2717c24071ba62d4b924)
|
|
18
|
+
- change(megamenu): render accordion only if children have children [`be63ce2`](https://github.com/eea/volto-eea-design-system/commit/be63ce2a8e240eac26eedeff0ca104813afbc6b3)
|
|
19
|
+
|
|
7
20
|
#### [0.7.3](https://github.com/eea/volto-eea-design-system/compare/0.7.2...0.7.3)
|
|
8
21
|
|
|
22
|
+
> 4 August 2022
|
|
23
|
+
|
|
24
|
+
- Release [`#218`](https://github.com/eea/volto-eea-design-system/pull/218)
|
|
9
25
|
- Autobuild of docusaurus docs [`93ddb4d`](https://github.com/eea/volto-eea-design-system/commit/93ddb4d3c856adc4a99ad3260671d7c78615bd74)
|
|
10
26
|
- change(megamenu): added icon on mega menu header section [`d0ad4d8`](https://github.com/eea/volto-eea-design-system/commit/d0ad4d80fc4941e0cdbd8a2d81415387f86efc1c)
|
|
11
27
|
|
package/package.json
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
Accordion,
|
|
10
10
|
} from 'semantic-ui-react';
|
|
11
11
|
|
|
12
|
+
import { cloneDeep } from 'lodash';
|
|
13
|
+
|
|
12
14
|
import { Link } from 'react-router-dom';
|
|
13
15
|
import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
|
|
14
16
|
|
|
@@ -39,6 +41,7 @@ const createColumns = (item, length, renderMenuItem) => {
|
|
|
39
41
|
|
|
40
42
|
return column;
|
|
41
43
|
};
|
|
44
|
+
|
|
42
45
|
const ItemGrid = ({ item, columns, length, renderMenuItem }) => (
|
|
43
46
|
<>
|
|
44
47
|
{renderMenuItem(item, { className: 'sub-title' })}
|
|
@@ -73,13 +76,7 @@ const Topics = ({ menuItem, renderMenuItem }) => (
|
|
|
73
76
|
<React.Fragment key={index}>
|
|
74
77
|
{section.title === 'At a glance' ? (
|
|
75
78
|
<Grid.Column width={3} id="at-a-glance">
|
|
76
|
-
<Item
|
|
77
|
-
item={section}
|
|
78
|
-
icon={true}
|
|
79
|
-
iconName="ri-leaf-line"
|
|
80
|
-
key={index}
|
|
81
|
-
renderMenuItem={renderMenuItem}
|
|
82
|
-
/>
|
|
79
|
+
<Item item={section} key={index} renderMenuItem={renderMenuItem} />
|
|
83
80
|
</Grid.Column>
|
|
84
81
|
) : (
|
|
85
82
|
<Grid.Column width={9} key={index}>
|
|
@@ -148,45 +145,62 @@ const FirstLevelContent = ({ element, renderMenuItem, pathName }) => {
|
|
|
148
145
|
const topics = element.title === 'Topics' ? true : false;
|
|
149
146
|
let defaultIndex = -1;
|
|
150
147
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
148
|
+
return (
|
|
149
|
+
<>
|
|
150
|
+
{!topics ? (
|
|
151
|
+
<React.Fragment>
|
|
152
|
+
{element.items.map((item, index) => {
|
|
153
|
+
let firstLevelPanels = [];
|
|
154
|
+
if (!item.items.length) {
|
|
155
|
+
return (
|
|
156
|
+
<React.Fragment key={index}>
|
|
157
|
+
{renderMenuItem(item, { className: 'item' })}
|
|
158
|
+
</React.Fragment>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
let x = {};
|
|
162
|
+
x.key = item['@id'] || item['url'];
|
|
163
|
+
if (pathName.indexOf(item.url) !== -1) {
|
|
164
|
+
defaultIndex = index;
|
|
165
|
+
}
|
|
166
|
+
x.title = (
|
|
167
|
+
<Accordion.Title key={`title=${index}`}>
|
|
168
|
+
{item.title}
|
|
169
|
+
<Icon className="ri-arrow-down-s-line" size="small" />
|
|
170
|
+
</Accordion.Title>
|
|
171
|
+
);
|
|
172
|
+
let overflow_item = cloneDeep(item);
|
|
173
|
+
overflow_item.title = 'See all';
|
|
174
|
+
x.content = (
|
|
175
|
+
<Accordion.Content>
|
|
176
|
+
{renderMenuItem(overflow_item, {
|
|
177
|
+
className: 'item title-item',
|
|
178
|
+
})}
|
|
179
|
+
<SecondLevelContent
|
|
180
|
+
element={item}
|
|
181
|
+
renderMenuItem={renderMenuItem}
|
|
182
|
+
/>
|
|
183
|
+
</Accordion.Content>
|
|
184
|
+
);
|
|
185
|
+
firstLevelPanels.push(x);
|
|
186
|
+
return (
|
|
187
|
+
<Accordion.Accordion
|
|
188
|
+
panels={firstLevelPanels}
|
|
189
|
+
key={index}
|
|
190
|
+
defaultActiveIndex={defaultIndex === index ? 0 : -1}
|
|
191
|
+
/>
|
|
192
|
+
);
|
|
193
|
+
})}
|
|
194
|
+
</React.Fragment>
|
|
195
|
+
) : (
|
|
196
|
+
<SecondLevelContent
|
|
197
|
+
element={element}
|
|
198
|
+
topics={true}
|
|
199
|
+
renderMenuItem={renderMenuItem}
|
|
200
|
+
/>
|
|
201
|
+
)}
|
|
202
|
+
</>
|
|
203
|
+
);
|
|
190
204
|
};
|
|
191
205
|
|
|
192
206
|
const SecondLevelContent = ({ element, topics = false, renderMenuItem }) => {
|
|
@@ -252,9 +266,11 @@ const NestedAccordion = ({ menuItems, renderMenuItem, pathName }) => {
|
|
|
252
266
|
<Icon className="ri-arrow-down-s-line" size="small" />
|
|
253
267
|
</Accordion.Title>
|
|
254
268
|
);
|
|
269
|
+
let overview = cloneDeep(element);
|
|
270
|
+
overview.title = 'See all';
|
|
255
271
|
x.content = (
|
|
256
272
|
<Accordion.Content key={index}>
|
|
257
|
-
{renderMenuItem(
|
|
273
|
+
{renderMenuItem(overview, { className: 'item' })}
|
|
258
274
|
<FirstLevelContent
|
|
259
275
|
element={element}
|
|
260
276
|
renderMenuItem={renderMenuItem}
|
|
@@ -565,7 +565,11 @@
|
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
|
|
568
|
+
|
|
569
|
+
#mega-menu .ui.list {
|
|
570
|
+
margin: 0;
|
|
571
|
+
}
|
|
572
|
+
#mega-menu .item {
|
|
569
573
|
display: flex;
|
|
570
574
|
font-size: @megaMenuListItemFontSize;
|
|
571
575
|
font-weight: @megaMenuListItemFontWeight;
|
|
@@ -574,6 +578,10 @@
|
|
|
574
578
|
|
|
575
579
|
#mega-menu a.item {
|
|
576
580
|
color: @megaMenuTextColor;
|
|
581
|
+
display: @megaMenuTextDisplay;
|
|
582
|
+
&:hover {
|
|
583
|
+
text-decoration: @megaMenuTextHoverDecoration;
|
|
584
|
+
}
|
|
577
585
|
|
|
578
586
|
i.icon {
|
|
579
587
|
color: @megaMenuTextColor;
|
|
@@ -586,7 +594,7 @@
|
|
|
586
594
|
// To override the grid column paddings
|
|
587
595
|
padding: @megaMenuGlancePaddingLeft !important;
|
|
588
596
|
|
|
589
|
-
.
|
|
597
|
+
.item {
|
|
590
598
|
font-size: @megaMenuGlanceListItemFontSize;
|
|
591
599
|
font-weight: @megaMenuGlanceListItemFontWeight;
|
|
592
600
|
margin: @megaMenuGlanceListItemMargin;
|
|
@@ -607,8 +615,9 @@
|
|
|
607
615
|
padding-top: @megaMenuContentPaddingTop;
|
|
608
616
|
}
|
|
609
617
|
|
|
610
|
-
#mega-menu .active > span {
|
|
611
|
-
border-
|
|
618
|
+
#mega-menu .active:not(.title-link) > span {
|
|
619
|
+
border-left: @megaMenuListItemActiveBorder;
|
|
620
|
+
padding-left: @megaMenuListItemActivePadding;
|
|
612
621
|
}
|
|
613
622
|
|
|
614
623
|
/*Mega Menu Accordion - Tablet & Mobile */
|
|
@@ -133,7 +133,9 @@
|
|
|
133
133
|
/* Mega menu */
|
|
134
134
|
@mobileMegaMenuWidth: 94%;
|
|
135
135
|
@megaMenuBackgroundColor: @darkMidnightBlue;
|
|
136
|
+
@megaMenuTextDisplay: flex;
|
|
136
137
|
@megaMenuTextColor: @white;
|
|
138
|
+
@megaMenuTextHoverDecoration: underline;
|
|
137
139
|
@mobileMegaMenuPadding: @rem-space-4 0;
|
|
138
140
|
@tabletMegaMenuPadding: @rem-space-9;
|
|
139
141
|
@computerMegaMenuPadding: @rem-space-10 0 0 0;
|
|
@@ -152,14 +154,15 @@
|
|
|
152
154
|
@megaMenuListItemFontSize: @font-size-1;
|
|
153
155
|
@megaMenuListItemFontWeight: @font-weight-4;
|
|
154
156
|
@megaMenuListItemPadding: @rem-space-2 0;
|
|
155
|
-
@megaMenuListItemActiveBorder:
|
|
157
|
+
@megaMenuListItemActiveBorder: 4px solid #FFF;
|
|
158
|
+
@megaMenuListItemActivePadding: 8px;
|
|
156
159
|
|
|
157
160
|
/* At a glance */
|
|
158
161
|
@megaMenuGlanceBackgroundColor: @secondaryColor;
|
|
159
162
|
@megaMenuGlancePaddingLeft: @rem-space-8 @rem-space-5;
|
|
160
163
|
@megaMenuGlanceListItemFontSize: @font-size-2;
|
|
161
|
-
@megaMenuGlanceListItemFontWeight: @font-weight-
|
|
162
|
-
@megaMenuGlanceListItemMargin: @rem-space-
|
|
164
|
+
@megaMenuGlanceListItemFontWeight: @font-weight-4;
|
|
165
|
+
@megaMenuGlanceListItemMargin: @rem-space-4 0;
|
|
163
166
|
|
|
164
167
|
/* Accordion */
|
|
165
168
|
@megaMenuAccordionTitleFontSize: @font-size-3;
|