@eeacms/volto-eea-design-system 0.7.1 → 0.7.2

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,20 @@ 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.2](https://github.com/eea/volto-eea-design-system/compare/0.7.1...0.7.2)
8
+
9
+ - Search input focus [`#215`](https://github.com/eea/volto-eea-design-system/pull/215)
10
+ - Make cypress tests work with both slate and draft selectors [`4d8e5b1`](https://github.com/eea/volto-eea-design-system/commit/4d8e5b1d7719637a46eac8232891fc5ed1f51b6f)
11
+ - Autobuild of docusaurus docs [`580af5b`](https://github.com/eea/volto-eea-design-system/commit/580af5b9d1791804239db8bd40f740d7fafc8a2a)
12
+ - 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)
13
+ - Autobuild of docusaurus docs [`2438b3e`](https://github.com/eea/volto-eea-design-system/commit/2438b3ef8035ffa2ad50c0d36bfac281fe7e5d68)
14
+ - Set focus on search input field in the popup on click [`d12c051`](https://github.com/eea/volto-eea-design-system/commit/d12c05106d9b95df1885ffa12cb284a0e50e0dfd)
15
+
7
16
  #### [0.7.1](https://github.com/eea/volto-eea-design-system/compare/0.7.0...0.7.1)
8
17
 
18
+ > 1 August 2022
19
+
20
+ - Release [`#214`](https://github.com/eea/volto-eea-design-system/pull/214)
9
21
  - Replace useLayoutEffect with useEffect, less notifications [`#213`](https://github.com/eea/volto-eea-design-system/pull/213)
10
22
  - Autobuild of docusaurus docs [`d763e15`](https://github.com/eea/volto-eea-design-system/commit/d763e15196988c7224fd79be9cbab1034caa0920)
11
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
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",
@@ -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
  )}
@@ -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..."
@@ -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 {