@eeacms/volto-eea-design-system 0.7.0 → 0.7.3

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,36 @@ 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.3](https://github.com/eea/volto-eea-design-system/compare/0.7.2...0.7.3)
8
+
9
+ - Autobuild of docusaurus docs [`93ddb4d`](https://github.com/eea/volto-eea-design-system/commit/93ddb4d3c856adc4a99ad3260671d7c78615bd74)
10
+ - change(megamenu): added icon on mega menu header section [`d0ad4d8`](https://github.com/eea/volto-eea-design-system/commit/d0ad4d80fc4941e0cdbd8a2d81415387f86efc1c)
11
+
12
+ #### [0.7.2](https://github.com/eea/volto-eea-design-system/compare/0.7.1...0.7.2)
13
+
14
+ > 3 August 2022
15
+
16
+ - Develop [`#217`](https://github.com/eea/volto-eea-design-system/pull/217)
17
+ - Search input focus [`#215`](https://github.com/eea/volto-eea-design-system/pull/215)
18
+ - Make cypress tests work with both slate and draft selectors [`4d8e5b1`](https://github.com/eea/volto-eea-design-system/commit/4d8e5b1d7719637a46eac8232891fc5ed1f51b6f)
19
+ - Autobuild of docusaurus docs [`580af5b`](https://github.com/eea/volto-eea-design-system/commit/580af5b9d1791804239db8bd40f740d7fafc8a2a)
20
+ - fix(contentBox): z-index of content hidden by bg when using content-box-inner [`c5a7dac`](https://github.com/eea/volto-eea-design-system/commit/c5a7dac923d648d8fe9c9a9cbb8001969d32aea2)
21
+ - Autobuild of docusaurus docs [`2438b3e`](https://github.com/eea/volto-eea-design-system/commit/2438b3ef8035ffa2ad50c0d36bfac281fe7e5d68)
22
+ - Set focus on search input field in the popup on click [`d12c051`](https://github.com/eea/volto-eea-design-system/commit/d12c05106d9b95df1885ffa12cb284a0e50e0dfd)
23
+
24
+ #### [0.7.1](https://github.com/eea/volto-eea-design-system/compare/0.7.0...0.7.1)
25
+
26
+ > 1 August 2022
27
+
28
+ - Release [`#214`](https://github.com/eea/volto-eea-design-system/pull/214)
29
+ - Replace useLayoutEffect with useEffect, less notifications [`#213`](https://github.com/eea/volto-eea-design-system/pull/213)
30
+ - Autobuild of docusaurus docs [`d763e15`](https://github.com/eea/volto-eea-design-system/commit/d763e15196988c7224fd79be9cbab1034caa0920)
31
+
7
32
  #### [0.7.0](https://github.com/eea/volto-eea-design-system/compare/0.6.5...0.7.0)
8
33
 
34
+ > 1 August 2022
35
+
36
+ - Release [`#212`](https://github.com/eea/volto-eea-design-system/pull/212)
9
37
  - Autobuild of docusaurus docs [`dd56a87`](https://github.com/eea/volto-eea-design-system/commit/dd56a87ca49282b8660b2fc1edc73f31441cceb2)
10
38
  - change(mega menu): use non variable to fix build of volto-kitkat-frontend [`3ecd652`](https://github.com/eea/volto-eea-design-system/commit/3ecd652405ba616c9defc86fd793f8c066c0af1e)
11
39
  - Autobuild of docusaurus docs [`a67aeb8`](https://github.com/eea/volto-eea-design-system/commit/a67aeb89dd7590605af9fd1fc4d99812061e166b)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "0.7.0",
3
+ "version": "0.7.3",
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",
@@ -19,7 +19,7 @@ export default function useClickOutside({ targetRefs = [], callback }) {
19
19
  [callback, targetRefs],
20
20
  );
21
21
 
22
- React.useLayoutEffect(() => {
22
+ React.useEffect(() => {
23
23
  document.addEventListener('mousedown', handleClickOutside, false);
24
24
  return () => {
25
25
  document.removeEventListener('mousedown', handleClickOutside, false);
@@ -101,6 +101,7 @@ const Main = ({
101
101
  const [menuIsActive, setMenuIsActive] = React.useState(false);
102
102
  const [searchIsActive, setSearchIsActive] = React.useState(false);
103
103
  const [burger, setBurger] = React.useState('');
104
+ const searchInputRef = React.useRef(null);
104
105
 
105
106
  React.useEffect(() => {
106
107
  setMenuIsActive(false);
@@ -112,6 +113,12 @@ const Main = ({
112
113
  }
113
114
  }, [pathname]);
114
115
 
116
+ React.useEffect(() => {
117
+ if (searchIsActive) {
118
+ searchInputRef.current && searchInputRef.current.focus();
119
+ }
120
+ }, [searchIsActive]);
121
+
115
122
  const searchOnClick = (e, x) => {
116
123
  if (menuIsActive === true) {
117
124
  setBurger('');
@@ -237,6 +244,7 @@ const Main = ({
237
244
  {searchIsActive && (
238
245
  <HeaderSearchPopUp
239
246
  onClose={searchOnClick}
247
+ searchInputRef={searchInputRef}
240
248
  triggerRefs={[searchButtonRef]}
241
249
  />
242
250
  )}
@@ -12,6 +12,8 @@ import {
12
12
  import { Link } from 'react-router-dom';
13
13
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
14
14
 
15
+ import linkArrowsSVG from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Svg/arrow-double-right.svg';
16
+
15
17
  const createColumns = (item, length, renderMenuItem) => {
16
18
  let subArrays = [];
17
19
  let size = length;
@@ -37,7 +39,6 @@ const createColumns = (item, length, renderMenuItem) => {
37
39
 
38
40
  return column;
39
41
  };
40
-
41
42
  const ItemGrid = ({ item, columns, length, renderMenuItem }) => (
42
43
  <>
43
44
  {renderMenuItem(item, { className: 'sub-title' })}
@@ -289,7 +290,22 @@ function HeaderMenuPopUp({
289
290
  <Container>
290
291
  {menuItem && (
291
292
  <div className="menu-content tablet hidden mobile hidden">
292
- <h3 className="title">{renderMenuItem(menuItem)}</h3>
293
+ <h3 className="title">
294
+ {renderMenuItem(
295
+ menuItem,
296
+ { className: 'title-link' },
297
+ {
298
+ iconPosition: 'right',
299
+ children: (
300
+ <img
301
+ src={linkArrowsSVG}
302
+ className={'title-img'}
303
+ alt={'Title icon'}
304
+ />
305
+ ),
306
+ },
307
+ )}
308
+ </h3>
293
309
  <Divider fitted />
294
310
  {menuItem.title === 'Topics' ? (
295
311
  <Topics menuItem={menuItem} renderMenuItem={renderMenuItem} />
@@ -3,7 +3,7 @@ import { Container, Input } from 'semantic-ui-react';
3
3
 
4
4
  import { useClickOutside } from '@eeacms/volto-eea-design-system/helpers';
5
5
 
6
- function HeaderSearchPopUp({ onClose, triggerRefs = [] }) {
6
+ function HeaderSearchPopUp({ onClose, searchInputRef, triggerRefs = [] }) {
7
7
  const nodeRef = React.useRef();
8
8
 
9
9
  useClickOutside({ targetRefs: [nodeRef, ...triggerRefs], callback: onClose });
@@ -13,6 +13,7 @@ function HeaderSearchPopUp({ onClose, triggerRefs = [] }) {
13
13
  <Container>
14
14
  <div className="wrapper">
15
15
  <Input
16
+ ref={searchInputRef}
16
17
  className="search"
17
18
  icon={{ className: 'ri-search-line', link: true }}
18
19
  placeholder="Search..."
@@ -0,0 +1,4 @@
1
+ <svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M3.81846 5.50017L-3.83247e-07 1.66422L1.09077 0.568456L6 5.50017L1.09077 10.4319L-4.78974e-08 9.33612L3.81846 5.50017Z" fill="white"/>
3
+ <path d="M9.81846 5.50017L6 1.66422L7.09077 0.568456L12 5.50017L7.09077 10.4319L6 9.33612L9.81846 5.50017Z" fill="white"/>
4
+ </svg>
@@ -27,6 +27,8 @@
27
27
  .content-box-inner {
28
28
  padding-top: @contentBoxContainerMarginTop;
29
29
  padding-bottom: @contentBoxContainerMarginBottom;
30
+ position: relative;
31
+ z-index: 1;
30
32
  }
31
33
 
32
34
  &.primary {
@@ -543,6 +543,9 @@
543
543
  .title {
544
544
  font-size: @megaMenuTitleFontSize;
545
545
  font-weight: @megaMenuTitleFontWeight;
546
+ .title-img {
547
+ margin-left: @megaMenuTitleImgMarginLeft;
548
+ }
546
549
  }
547
550
 
548
551
  .sub-title {
@@ -142,6 +142,7 @@
142
142
  /* Title */
143
143
  @megaMenuTitleFontSize: @font-size-4;
144
144
  @megaMenuTitleFontWeight: @font-weight-7;
145
+ @megaMenuTitleImgMarginLeft: 4px;
145
146
 
146
147
  /* Sub Title */
147
148
  @megaMenuSubTitleFontSize: @font-size-2;