@eeacms/volto-eea-design-system 1.21.1 → 1.22.1

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,6 +4,25 @@ 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.22.1](https://github.com/eea/volto-eea-design-system/compare/1.22.0...1.22.1) - 28 November 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix(header): wrong size of items on tablet and for the mobile menu button [David Ichim - [`868897c`](https://github.com/eea/volto-eea-design-system/commit/868897c9c85ee8c896f63c306d075d8aedb3e5db)]
12
+
13
+ ### [1.22.0](https://github.com/eea/volto-eea-design-system/compare/1.21.1...1.22.0) - 24 November 2023
14
+
15
+ #### :rocket: New Features
16
+
17
+ - feat(mega-menu): added ability to set a * option that would hold configuration for non specific layouts [David Ichim - [`11b4b8c`](https://github.com/eea/volto-eea-design-system/commit/11b4b8ca14741d2fac6b11a09ab6ad1af65264b2)]
18
+
19
+ #### :nail_care: Enhancements
20
+
21
+ - change(header): ensure header items are without large gaps when menu goes over 2 lines [David Ichim - [`f6aba05`](https://github.com/eea/volto-eea-design-system/commit/f6aba059320c608cadaf5563085ffa63d0812583)]
22
+
23
+ #### :hammer_and_wrench: Others
24
+
25
+ - Bump package version [David Ichim - [`4304cf6`](https://github.com/eea/volto-eea-design-system/commit/4304cf667fd63ac9ce13524dfaaa972bdd1dd009)]
7
26
  ### [1.21.1](https://github.com/eea/volto-eea-design-system/compare/1.21.0...1.21.1) - 21 November 2023
8
27
 
9
28
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "1.21.1",
3
+ "version": "1.22.1",
4
4
  "description": "@eeacms/volto-eea-design-system: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -345,10 +345,14 @@ function HeaderMenuPopUp({
345
345
  (current) => current.url === activeItem || current['@id'] === activeItem,
346
346
  );
347
347
 
348
+ // Get layout for current menu item and fallback to a * layout that can
349
+ // be used for all menu items that don't have a specific layout
348
350
  const layout =
349
- !!menuItemsLayouts &&
350
- Object.keys(menuItemsLayouts).includes(menuItem?.url) &&
351
- menuItemsLayouts[menuItem.url];
351
+ (!!menuItemsLayouts &&
352
+ Object.keys(menuItemsLayouts).includes(menuItem?.url) &&
353
+ menuItemsLayouts[menuItem.url]) ||
354
+ (!!menuItemsLayouts && menuItemsLayouts['*']) ||
355
+ {};
352
356
 
353
357
  return (
354
358
  <Transition visible={visible} animation="slide down" duration={300}>
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- import { Tab, Container } from 'semantic-ui-react';
2
+ import { Tab, Container, Menu, Icon } from 'semantic-ui-react';
3
+ import cx from 'classnames';
4
+ import './style.less';
3
5
 
4
6
  export default {
5
7
  title: 'Components/Tab',
@@ -216,3 +218,188 @@ Vertical.argTypes = {
216
218
  },
217
219
  },
218
220
  };
221
+
222
+ function IconTabContent({
223
+ variant,
224
+ renderActive,
225
+ hideTabTitle,
226
+ iconPosition,
227
+ iconSize,
228
+ }) {
229
+ const panes = [
230
+ {
231
+ menuItem: (
232
+ <Menu.Item>
233
+ <div
234
+ className={cx({
235
+ 'asset-top': iconPosition === 'top',
236
+ 'asset-left': iconPosition === 'left',
237
+ 'asset-right': iconPosition === 'right',
238
+ })}
239
+ >
240
+ <Icon
241
+ className={cx('aligned ri-sun-line', iconSize)}
242
+ size={iconSize}
243
+ {...{
244
+ ...(hideTabTitle && {
245
+ role: 'img',
246
+ 'aria-hidden': 'false',
247
+ 'aria-label': 'Ground level ozone',
248
+ }),
249
+ }}
250
+ />
251
+ {!hideTabTitle && <>Ground level ozone</>}
252
+ </div>
253
+ </Menu.Item>
254
+ ),
255
+ render: () => (
256
+ <Tab.Pane>
257
+ is not directly emitted into the atmosphere. Instead, it forms in the
258
+ atmosphere from a chain of chemical reactions following emissions of
259
+ certain precursor gases: NOX, carbon monoxide (CO) and NMVOCs and
260
+ methane (CH4).
261
+ </Tab.Pane>
262
+ ),
263
+ },
264
+ {
265
+ menuItem: (
266
+ <Menu.Item>
267
+ <div
268
+ className={cx({
269
+ 'asset-top': iconPosition === 'top',
270
+ 'asset-left': iconPosition === 'left',
271
+ 'asset-right': iconPosition === 'right',
272
+ })}
273
+ >
274
+ <Icon
275
+ className={cx('aligned ri-moon-line', iconSize)}
276
+ size={iconSize}
277
+ {...{
278
+ ...(hideTabTitle && {
279
+ role: 'img',
280
+ 'aria-hidden': 'false',
281
+ 'aria-label': 'Nitrogen oxides',
282
+ }),
283
+ }}
284
+ />
285
+ {!hideTabTitle && <>Nitrogen oxides</>}
286
+ </div>
287
+ </Menu.Item>
288
+ ),
289
+ render: () => (
290
+ <Tab.Pane>
291
+ are emitted during fuel combustion from industrial facilities and the
292
+ road transport sector. NOX is a group of gases comprising nitrogen
293
+ monoxide (NO) and nitrogen dioxide (NO2). NO makes up the majority of
294
+ NOX emissions. NOX contributes to the formation of ozone and
295
+ particulate matter.
296
+ </Tab.Pane>
297
+ ),
298
+ },
299
+ {
300
+ menuItem: (
301
+ <Menu.Item>
302
+ <div
303
+ className={cx({
304
+ 'asset-top': iconPosition === 'top',
305
+ 'asset-left': iconPosition === 'left',
306
+ 'asset-right': iconPosition === 'right',
307
+ })}
308
+ >
309
+ <Icon
310
+ className={cx('aligned ri-flashlight-line', iconSize)}
311
+ size={iconSize}
312
+ {...{
313
+ ...(hideTabTitle && {
314
+ role: 'img',
315
+ 'aria-hidden': 'false',
316
+ 'aria-label': 'Particulate matter',
317
+ }),
318
+ }}
319
+ />
320
+ {!hideTabTitle && <>Particulate matter</>}
321
+ </div>
322
+ </Menu.Item>
323
+ ),
324
+ render: () => (
325
+ <Tab.Pane>
326
+ is a mixture of aerosol particles (solid and liquid) covering a wide
327
+ range of sizes and chemical compositions. PM is either directly
328
+ emitted as primary particles or it forms in the atmosphere from
329
+ emissions of certain precursor pollutants such as SO2, NOX, NH3 and
330
+ NMVOCs. PM is emitted from many anthropogenic sources, including both
331
+ combustion and non-combustion sources. Natural emissions of PM also
332
+ occur, including from sea salt and windblown Saharan dust.
333
+ </Tab.Pane>
334
+ ),
335
+ },
336
+ ];
337
+
338
+ return (
339
+ <Tab
340
+ panes={panes}
341
+ renderActiveOnly={renderActive}
342
+ menu={{
343
+ secondary: true,
344
+ pointing: true,
345
+ fluid: true,
346
+ className: variant,
347
+ tabIndex: 0,
348
+ }}
349
+ ></Tab>
350
+ );
351
+ }
352
+
353
+ const IconTabTemplate = (args) => (
354
+ <Container>
355
+ <IconTabContent {...args}></IconTabContent>
356
+ </Container>
357
+ );
358
+
359
+ export const MenuIcon = IconTabTemplate.bind({});
360
+
361
+ MenuIcon.args = {
362
+ renderActive: true,
363
+ hideTabTitle: false,
364
+ iconPosition: 'top',
365
+ iconSize: 'small',
366
+ variant: 'secondary',
367
+ };
368
+
369
+ MenuIcon.argTypes = {
370
+ hideTabTitle: {
371
+ description: 'hide label',
372
+ table: {
373
+ type: {
374
+ summary: 'boolean',
375
+ },
376
+ defaultValue: {
377
+ summary: false,
378
+ },
379
+ },
380
+ },
381
+ iconPosition: {
382
+ control: {
383
+ type: 'inline-radio',
384
+ options: ['top', 'left', 'right'],
385
+ },
386
+ description: 'icon position',
387
+ type: { name: 'string' },
388
+ table: {
389
+ defaultValue: { summary: '""' },
390
+ },
391
+ },
392
+ iconSize: {
393
+ control: { type: 'inline-radio' },
394
+ options: ['mini', 'tiny', 'small', 'big', 'massive'],
395
+ description: 'icon size',
396
+ table: {
397
+ type: {
398
+ summary: 'string',
399
+ },
400
+ defaultValue: {
401
+ summary: 'large',
402
+ },
403
+ },
404
+ },
405
+ };
@@ -0,0 +1,20 @@
1
+ .ui.menu .asset-top,
2
+ .ui.menu .asset-left,
3
+ .ui.menu .asset-right {
4
+ display: flex;
5
+ align-items: center;
6
+ gap: 0.6em;
7
+ }
8
+
9
+ .ui.menu .asset-top {
10
+ flex-direction: column;
11
+ text-align: center;
12
+ }
13
+
14
+ .ui.menu .asset-left {
15
+ flex-direction: row;
16
+ }
17
+
18
+ .ui.menu .asset-right {
19
+ flex-direction: row-reverse;
20
+ }
@@ -347,7 +347,6 @@
347
347
  overflow: auto;
348
348
  width: 100%;
349
349
  min-height: @mobilePopUpHeight;
350
- align-items: @searchBoxAlignItems;
351
350
  background: @searchBoxBackgroundGradient;
352
351
 
353
352
  .ui.container {
@@ -444,6 +443,7 @@
444
443
  align-items: center;
445
444
  justify-content: center;
446
445
  border: none;
446
+ flex-shrink: 0;
447
447
  background-color: @burgerActionBackgroundColor;
448
448
  cursor: pointer;
449
449
  }
@@ -456,6 +456,7 @@
456
456
 
457
457
  .search-action {
458
458
  display: flex;
459
+ flex-shrink: 0;
459
460
  width: @mobileActionsBoxWidth;
460
461
  height: @mobileMainSectionHeight;
461
462
  align-items: center;
@@ -648,11 +649,11 @@
648
649
 
649
650
  .ui.text.menu {
650
651
  display: flex;
651
- width: 88%;
652
652
  max-height: 100%;
653
653
  flex-wrap: wrap;
654
- justify-content: space-between;
654
+ justify-content: end;
655
655
  margin: 0;
656
+ padding-left: 0;
656
657
 
657
658
  .item {
658
659
  padding: @mainMenuItemPadding;
@@ -681,6 +682,7 @@
681
682
  /* Search box */
682
683
  #search-box {
683
684
  min-height: @computerPopUpHeight;
685
+ align-items: @searchBoxAlignItems;
684
686
 
685
687
  .wrapper {
686
688
  margin: @searchBoxComputerPopupMarginTop 0;
@@ -692,10 +694,20 @@
692
694
  }
693
695
  }
694
696
 
697
+ //@media only screen and (min-width: @smallMonitorBreakpoint) and (max-width: @largestSmallMonitor) {
698
+ //}
695
699
  @media only screen and (min-width: @largestSmallMonitor) {
696
700
  .eea.header .subsite-logo {
697
701
  left: calc(100% + calc(@subsiteFlexGap / 2));
698
702
  }
703
+
704
+ .main-menu {
705
+ gap: 0 @mainMenuGap;
706
+ }
707
+ .main.bar .ui.text.menu {
708
+ gap: 0 @mainMenuGap;
709
+ }
710
+
699
711
  }
700
712
 
701
713
  /************************
@@ -115,6 +115,7 @@
115
115
  @computerLogoMarginTop : @rem-space-5;
116
116
 
117
117
  /* Main menu */
118
+ @mainMenuGap : @component-padding;
118
119
  @mainMenuItemColor : @primaryColor;
119
120
  @mainMenuItemInvertedColor : @white;
120
121
  @mainMenuItemFontSize : ~"min(max(0.875rem, 1.5vw), 1.125rem)";
@@ -104,3 +104,7 @@
104
104
  @size-12: @size-11 + @space-20; // 240px
105
105
  @size-13: @size-12 + @space-20; // 320px
106
106
  @size-14: @size-13 + @size-11; // 480px
107
+
108
+ // start of variables to use instead of direct tokens
109
+ @component-padding: @rem-space-5;
110
+ @component-separator: @rem-space-8;