@eeacms/volto-eea-design-system 0.6.5 → 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,72 @@ 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
+
16
+ #### [0.7.1](https://github.com/eea/volto-eea-design-system/compare/0.7.0...0.7.1)
17
+
18
+ > 1 August 2022
19
+
20
+ - Release [`#214`](https://github.com/eea/volto-eea-design-system/pull/214)
21
+ - Replace useLayoutEffect with useEffect, less notifications [`#213`](https://github.com/eea/volto-eea-design-system/pull/213)
22
+ - Autobuild of docusaurus docs [`d763e15`](https://github.com/eea/volto-eea-design-system/commit/d763e15196988c7224fd79be9cbab1034caa0920)
23
+
24
+ #### [0.7.0](https://github.com/eea/volto-eea-design-system/compare/0.6.5...0.7.0)
25
+
26
+ > 1 August 2022
27
+
28
+ - Release [`#212`](https://github.com/eea/volto-eea-design-system/pull/212)
29
+ - Autobuild of docusaurus docs [`dd56a87`](https://github.com/eea/volto-eea-design-system/commit/dd56a87ca49282b8660b2fc1edc73f31441cceb2)
30
+ - change(mega menu): use non variable to fix build of volto-kitkat-frontend [`3ecd652`](https://github.com/eea/volto-eea-design-system/commit/3ecd652405ba616c9defc86fd793f8c066c0af1e)
31
+ - Autobuild of docusaurus docs [`a67aeb8`](https://github.com/eea/volto-eea-design-system/commit/a67aeb89dd7590605af9fd1fc4d99812061e166b)
32
+ - change(header): prefix mega-menu active class for adding border [`32898cb`](https://github.com/eea/volto-eea-design-system/commit/32898cb19c20ee7696c51b99cd9df25a333ae6e9)
33
+ - bump release version to 0.7.0 [`fa82cbd`](https://github.com/eea/volto-eea-design-system/commit/fa82cbd7d50765c322bc5c7c58abb5675e0aadad)
34
+ - Theme fixes, mega menu selected element both in desktop and mobile #211 [`b482729`](https://github.com/eea/volto-eea-design-system/commit/b4827292a9badb02f178b7431cc63e11070784ea)
35
+ - change(tests): try to modify tests to use slate instead of draft [`a2e2485`](https://github.com/eea/volto-eea-design-system/commit/a2e248593433a7a8bf612008c12a3a20a0049d86)
36
+ - change(tests): use data-slate-editor instead of contents that was found in draft js instead of slate [`1e0413c`](https://github.com/eea/volto-eea-design-system/commit/1e0413cf117c098b188e00249c323f2f718b9299)
37
+ - fix(container): add padding also for block editors when we are on the add page not just edit [`b857aad`](https://github.com/eea/volto-eea-design-system/commit/b857aad7855c30c5059b0f0f7c0f720826a71aa7)
38
+ - fix eslint warnings [`3b30282`](https://github.com/eea/volto-eea-design-system/commit/3b30282ea4df59f2d05644cae5c1d703b4dc48b3)
39
+ - feature(megamenu): open default accordions on mobile navigation based on pathname [`cc299c1`](https://github.com/eea/volto-eea-design-system/commit/cc299c1047f96aa5f85cdc4bb8bb9b3b4fb9ca5e)
40
+ - fix(megamenu): key warning errors [`4ecd279`](https://github.com/eea/volto-eea-design-system/commit/4ecd27921546204dfa4aa23d25188876e52cda7a)
41
+ - change(megamenu): set active class on storybook list items [`112bff1`](https://github.com/eea/volto-eea-design-system/commit/112bff195cd07e789b352ae239a148a168b4d877)
42
+ - change(megamenu): add border for active element of menu [`5e7dfa5`](https://github.com/eea/volto-eea-design-system/commit/5e7dfa539dc0d126dfb057ac2d293c94b31561bb)
43
+ - change(megamenu): use renderMenuItem in order to render menu items [`9ed5cbd`](https://github.com/eea/volto-eea-design-system/commit/9ed5cbdf120ee2c92e5f14c09e5289a5abe3f8b0)
44
+ - change(megamenu): WIP bringing back rendering of item with callback and path modification [`6e43d43`](https://github.com/eea/volto-eea-design-system/commit/6e43d4340ea82afde950e5fee44a76119060fc28)
45
+ - Autobuild of docusaurus docs [`4772d30`](https://github.com/eea/volto-eea-design-system/commit/4772d30900d7689d8d3e64fab989f5d7e845074a)
46
+ - change(footer): replaced eionet logo with an svg variant and tweaked size of eionet to match size of eea logo [`32ce462`](https://github.com/eea/volto-eea-design-system/commit/32ce4623ad454edec864ad6c8b45cbf99465bede)
47
+ - Autobuild of docusaurus docs [`4b6cc9b`](https://github.com/eea/volto-eea-design-system/commit/4b6cc9b997f3ce4821843f7c36d163aa571e6e43)
48
+ - fix(header): bump opacity of gradient class to get rid of green hue of header text [`2011b40`](https://github.com/eea/volto-eea-design-system/commit/2011b40d384ae5b54a0525e6d9afc88c02f6ca90)
49
+ - Autobuild of docusaurus docs [`1453ad3`](https://github.com/eea/volto-eea-design-system/commit/1453ad3dec7ba4b020215cd34e3105e8442cb363)
50
+ - feat(accordion,buttons): primary, secondary and tertiary variations #209 [`c34617f`](https://github.com/eea/volto-eea-design-system/commit/c34617f7a7d7b6b7568c3127f4ae0f52bd57cf8a)
51
+ - change(stories): hide variant control from button link story [`43f8c41`](https://github.com/eea/volto-eea-design-system/commit/43f8c412f6762edbed9c60e613736d5b60677cd1)
52
+ - change(stories): hide variant control from button link story [`aea7126`](https://github.com/eea/volto-eea-design-system/commit/aea712668331f5681028d961b42a05655f1113d3)
53
+ - Autobuild of docusaurus docs [`b517dc8`](https://github.com/eea/volto-eea-design-system/commit/b517dc88b193f9c99580a9950f0bfe51cca13843)
54
+ - feature(mega-menu): added menu slide down animation #208 [`4360d0e`](https://github.com/eea/volto-eea-design-system/commit/4360d0ef570fbfcc9989170219f7826e5ed780cf)
55
+ - change(accordion): style default accordion using the grey from semantic ui [`e24907d`](https://github.com/eea/volto-eea-design-system/commit/e24907df397457bd9704905aa29ea5d7e1d396cd)
56
+ - Autobuild of docusaurus docs [`03e8086`](https://github.com/eea/volto-eea-design-system/commit/03e8086444f33224a21563ff01a51541232c8a0f)
57
+ - change(package): condition modification of navDepth settings [`dd21dad`](https://github.com/eea/volto-eea-design-system/commit/dd21dadf34f87f08223be3b98c06e7a2f0714326)
58
+ - Autobuild of docusaurus docs [`8efc75b`](https://github.com/eea/volto-eea-design-system/commit/8efc75b7446283129d3ee68dbab1f7dbd2e4c5ba)
59
+ - feature(theme): added context navigation component story and default style [`5a6955f`](https://github.com/eea/volto-eea-design-system/commit/5a6955fe935cf6a07f6593164014ed4c9e77d88f)
60
+ - refactor(callToAction): update tertiary state colors [`159668a`](https://github.com/eea/volto-eea-design-system/commit/159668ac526a98032392bcbd2c115dc448193152)
61
+ - refactor(accordion): add variations and create a default export [`4a9c68f`](https://github.com/eea/volto-eea-design-system/commit/4a9c68ffe933c9d700e46db3e0cbbd9e3820c7c7)
62
+ - refactor(accordion): add color variations [`3504c15`](https://github.com/eea/volto-eea-design-system/commit/3504c15cc861803dc263fb2ad3b6a478043ced33)
63
+ - refactor(callToAction): add tertiary variant and restructure exports [`ac6695a`](https://github.com/eea/volto-eea-design-system/commit/ac6695ab3066c41739ec4852f0ec3c3bb6cea346)
64
+ - refactor(colors): add tertiary shades for element states [`1e24a7e`](https://github.com/eea/volto-eea-design-system/commit/1e24a7e13b50f1ee7bd9bd44f3b2eb8e4460c691)
65
+ - fix(header): remove console log [`3a20023`](https://github.com/eea/volto-eea-design-system/commit/3a200233609bbcea39d8e519dc292a132a98aaa3)
66
+ - refactor(megaMenu): add slide down transition and update targetRefs on close [`9667157`](https://github.com/eea/volto-eea-design-system/commit/96671574f5f7dd992269c42e509598f62bba516d)
67
+
7
68
  #### [0.6.5](https://github.com/eea/volto-eea-design-system/compare/0.6.1...0.6.5)
8
69
 
70
+ > 6 July 2022
71
+
72
+ - change(design-systems): header section fixes [`#207`](https://github.com/eea/volto-eea-design-system/pull/207)
9
73
  - change(package): bump package version to 0.6.5 denoting bug fixes release [`0585aeb`](https://github.com/eea/volto-eea-design-system/commit/0585aebaeb9e3483ba230110d99a1a875590ad66)
10
74
  - Autobuild of docusaurus docs [`590c55f`](https://github.com/eea/volto-eea-design-system/commit/590c55f1099d926959c2cca929ca8fab32fe41b4)
11
75
  - fix(menu): removed minHeight that enlarged the global menu [`133be1e`](https://github.com/eea/volto-eea-design-system/commit/133be1e43d9b7778fd94388629400c5f2b707ff4)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-design-system",
3
- "version": "0.6.5",
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",
@@ -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);
package/src/index.js CHANGED
@@ -1,5 +1,8 @@
1
1
  const applyConfig = (config) => {
2
- config.settings.navDepth = 3;
2
+ config.settings = {
3
+ ...(config.settings || {}),
4
+ navDepth: 3,
5
+ };
3
6
  return config;
4
7
  };
5
8
 
package/src/semantic.less CHANGED
@@ -229,6 +229,10 @@
229
229
  @import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/header';
230
230
  }
231
231
 
232
+ & {
233
+ @import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/contextNavigation';
234
+ }
235
+
232
236
  & {
233
237
  @import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/inpageNavigation';
234
238
  }
@@ -5,6 +5,17 @@ export default {
5
5
  title: 'Components/Call To Action',
6
6
  component: Button,
7
7
  argTypes: {
8
+ variant: {
9
+ name: 'Variation',
10
+ defaultValue: 'primary',
11
+ options: ['default', 'primary', 'secondary', 'tertiary'],
12
+ control: { type: 'select' },
13
+ description: 'call to action variation',
14
+ table: {
15
+ defaultValue: { summary: 'primary' },
16
+ type: { summary: 'string' },
17
+ },
18
+ },
8
19
  label: {
9
20
  description: 'link label',
10
21
  table: {
@@ -37,49 +48,11 @@ export default {
37
48
 
38
49
  //Default Call To Action
39
50
  export const Default = (args) => {
40
- return (
41
- <Container>
42
- <Button as="a" disabled={args.disabled} href={args.href} target="_blank">
43
- {args.label}
44
- </Button>
45
- </Container>
46
- );
47
- };
48
- Default.args = {
49
- label: 'Default Call To Action',
50
- href: '/#',
51
- disabled: false,
52
- };
53
-
54
- //Primary Call To Action
55
- export const Primary = (args) => {
56
- return (
57
- <Container>
58
- <Button
59
- primary
60
- as="a"
61
- disabled={args.disabled}
62
- href={args.href}
63
- target="_blank"
64
- >
65
- {args.label}
66
- </Button>
67
- </Container>
68
- );
69
- };
70
- Primary.args = {
71
- label: 'Primary Call To Action',
72
- href: '/#',
73
- disabled: false,
74
- };
75
-
76
- //Secondary Call To Action
77
- export const Secondary = (args) => {
78
51
  return (
79
52
  <Container>
80
53
  <Button
81
- secondary
82
54
  as="a"
55
+ className={args.variant === 'default' ? '' : args.variant}
83
56
  disabled={args.disabled}
84
57
  href={args.href}
85
58
  target="_blank"
@@ -89,8 +62,9 @@ export const Secondary = (args) => {
89
62
  </Container>
90
63
  );
91
64
  };
92
- Secondary.args = {
93
- label: 'Secondary Call To Action',
65
+ Default.args = {
66
+ variant: 'primary',
67
+ label: 'Call To Action',
94
68
  href: '/#',
95
69
  disabled: false,
96
70
  };
@@ -99,64 +73,39 @@ Secondary.args = {
99
73
  export const Inverted = (args) => {
100
74
  return (
101
75
  <Container>
102
- <Segment compact>
76
+ <Segment compact className={args.variant === 'default' ? 'inverted' : ''}>
103
77
  <Button
104
- primary
105
78
  inverted
106
79
  as="a"
107
80
  disabled={args.disabled}
108
- href={args.href1}
81
+ href={args.href}
109
82
  target="_blank"
83
+ className={args.variant === 'default' ? '' : args.variant}
110
84
  >
111
- {args.button1}
112
- </Button>
113
- </Segment>
114
- <Segment compact>
115
- <Button
116
- secondary
117
- inverted
118
- as="a"
119
- disabled={args.disabled}
120
- href={args.href2}
121
- target="_blank"
122
- >
123
- {args.button2}
124
- </Button>
125
- </Segment>
126
- <Segment inverted compact>
127
- <Button
128
- inverted
129
- as="a"
130
- disabled={args.disabled}
131
- href={args.href3}
132
- target="_blank"
133
- >
134
- {args.button3}
85
+ {args.label}
135
86
  </Button>
136
87
  </Segment>
137
88
  </Container>
138
89
  );
139
90
  };
140
91
  Inverted.args = {
141
- button1: 'Primary Call To Action',
142
- button2: 'Secondary Call To Action',
143
- button3: 'Default Call To Action',
144
- href1: '/#',
145
- href2: '/#',
146
- href3: '/#',
92
+ variant: 'primary',
93
+ label: 'Inverted Call To Action',
94
+ href: '/#',
147
95
  disabled: false,
148
96
  };
149
- Inverted.parameters = {
150
- controls: { exclude: ['label', 'href'] },
151
- hideNoControlsWarning: true,
152
- };
153
97
 
154
98
  //Labeled Call To Action
155
99
  export const Labeled = (args) => {
156
100
  return (
157
101
  <Container>
158
102
  <Button
159
- className={args.variant + ' icon ' + args.icon_position + ' labeled'}
103
+ className={
104
+ (args.variant === 'default' ? '' : args.variant) +
105
+ ' icon ' +
106
+ args.icon_position +
107
+ ' labeled'
108
+ }
160
109
  as="a"
161
110
  disabled={args.disabled}
162
111
  href={args.href}
@@ -169,22 +118,14 @@ export const Labeled = (args) => {
169
118
  );
170
119
  };
171
120
  Labeled.args = {
121
+ variant: 'primary',
172
122
  label: 'Labeled Call To Action',
173
123
  icon: 'chevron right',
124
+ icon_position: 'right',
174
125
  href: '/#',
175
126
  disabled: false,
176
127
  };
177
128
  Labeled.argTypes = {
178
- variant: {
179
- options: ['primary', 'secondary', 'default'],
180
- description: 'call to action class',
181
- control: { type: 'radio' },
182
- defaultValue: 'secondary',
183
- table: {
184
- defaultValue: { summary: 'secondary' },
185
- type: { summary: 'string' },
186
- },
187
- },
188
129
  icon: {
189
130
  name: 'icon',
190
131
  defaultValue: 'chevron right',
@@ -213,10 +154,10 @@ Labeled.argTypes = {
213
154
  icon_position: {
214
155
  options: ['left', 'right'],
215
156
  control: { type: 'radio' },
216
- defaultValue: 'left',
157
+ defaultValue: 'right',
217
158
  description: 'icon left or right position',
218
159
  table: {
219
- defaultValue: { summary: 'left' },
160
+ defaultValue: { summary: 'right' },
220
161
  type: { summary: 'string' },
221
162
  },
222
163
  },
@@ -235,5 +176,6 @@ Link.args = {
235
176
  href: '/#',
236
177
  };
237
178
  Link.parameters = {
179
+ controls: { exclude: ['Variation', 'disabled'] },
238
180
  hideNoControlsWarning: true,
239
181
  };
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+
3
+ const Template = (args) => (
4
+ <nav className="context-navigation">
5
+ <div className="context-navigation-header">Navigation</div>
6
+ <div role="list" className="ui list">
7
+ <div role="listitem" className="item level-1">
8
+ <div className="content">
9
+ <a title="" className="contenttype-folder" href="/api/folder1">
10
+ Folder1
11
+ </a>
12
+ </div>
13
+ </div>
14
+ <div role="listitem" className="item level-1">
15
+ <div className="content">
16
+ <a
17
+ title=""
18
+ className="contenttype-folder in_path"
19
+ href="/api/folder2/folder21"
20
+ >
21
+ Folder21
22
+ </a>
23
+ <div className="list">
24
+ <div role="listitem" className="item level-2">
25
+ <div className="content">
26
+ <a
27
+ title=""
28
+ className="contenttype-document"
29
+ href="/api/folder2/folder21/doc211"
30
+ >
31
+ Doc211
32
+ </a>
33
+ </div>
34
+ </div>
35
+ <div role="listitem" className="active item level-2">
36
+ <div className="content">
37
+ <a
38
+ title=""
39
+ className="contenttype-document"
40
+ href="/api/folder2/folder21/doc211-copy"
41
+ >
42
+ Doc212
43
+ <div className="content active-indicator">
44
+ <svg
45
+ xmlns="http://www.w3.org/2000/svg"
46
+ viewBox="0 0 36 36"
47
+ className="icon"
48
+ >
49
+ <path
50
+ fill-rule="evenodd"
51
+ d="M21.293 9.293L22.707 10.707 15.414 18 22.707 25.293 21.293 26.707 12.586 18z"
52
+ ></path>
53
+ </svg>
54
+ </div>
55
+ </a>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </nav>
63
+ );
64
+
65
+ export default {
66
+ title: 'Components/Navigation portlet',
67
+ component: Template,
68
+ };
69
+
70
+ export const Default = Template.bind({});
71
+ Default.args = {
72
+ root: 'https://www.eea.europa.eu/',
73
+ };
@@ -54,6 +54,8 @@ const TopDropdownMenu = ({
54
54
  text={mobileText || text}
55
55
  icon={icon || 'chevron down'}
56
56
  aria-label="dropdown"
57
+ closeOnChange={false}
58
+ closeOnBlur={false}
57
59
  >
58
60
  <Dropdown.Menu role="group">{children}</Dropdown.Menu>
59
61
  </Dropdown>
@@ -99,6 +101,7 @@ const Main = ({
99
101
  const [menuIsActive, setMenuIsActive] = React.useState(false);
100
102
  const [searchIsActive, setSearchIsActive] = React.useState(false);
101
103
  const [burger, setBurger] = React.useState('');
104
+ const searchInputRef = React.useRef(null);
102
105
 
103
106
  React.useEffect(() => {
104
107
  setMenuIsActive(false);
@@ -110,6 +113,12 @@ const Main = ({
110
113
  }
111
114
  }, [pathname]);
112
115
 
116
+ React.useEffect(() => {
117
+ if (searchIsActive) {
118
+ searchInputRef.current && searchInputRef.current.focus();
119
+ }
120
+ }, [searchIsActive]);
121
+
113
122
  const searchOnClick = (e, x) => {
114
123
  if (menuIsActive === true) {
115
124
  setBurger('');
@@ -164,6 +173,7 @@ const Main = ({
164
173
  const node = React.useRef();
165
174
  const searchButtonRef = React.useRef();
166
175
  const mobileMenuBurgerRef = React.useRef();
176
+ const desktopMenuRef = React.useRef();
167
177
 
168
178
  // disable sticky setting until feature is more stable
169
179
  // const isScrollingUp = useScrollingUp();
@@ -185,7 +195,10 @@ const Main = ({
185
195
  <Grid.Column mobile={4} tablet={4} computer={8}>
186
196
  <div className={inverted ? 'main-menu inverted' : 'main-menu'}>
187
197
  {menuItems && (
188
- <Menu className="eea-main-menu tablet or lower hidden" text>
198
+ <div
199
+ className="ui text eea-main-menu tablet or lower hidden menu"
200
+ ref={desktopMenuRef}
201
+ >
189
202
  {menuItems.map((item) => (
190
203
  <Menu.Item
191
204
  name={item['@id'] || item.url}
@@ -200,7 +213,7 @@ const Main = ({
200
213
  })}
201
214
  </Menu.Item>
202
215
  ))}
203
- </Menu>
216
+ </div>
204
217
  )}
205
218
  <div
206
219
  className="search-action"
@@ -231,18 +244,19 @@ const Main = ({
231
244
  {searchIsActive && (
232
245
  <HeaderSearchPopUp
233
246
  onClose={searchOnClick}
247
+ searchInputRef={searchInputRef}
234
248
  triggerRefs={[searchButtonRef]}
235
249
  />
236
250
  )}
237
- {menuIsActive && (
238
- <HeaderMenuPopUp
239
- renderMenuItem={renderMenuItem}
240
- activeItem={activeItem}
241
- menuItems={menuItems}
242
- onClose={menuOnClickOutside}
243
- triggerRefs={[mobileMenuBurgerRef]}
244
- />
245
- )}
251
+ <HeaderMenuPopUp
252
+ renderMenuItem={renderMenuItem}
253
+ activeItem={activeItem}
254
+ menuItems={menuItems}
255
+ pathName={pathname}
256
+ onClose={menuOnClickOutside}
257
+ triggerRefs={[mobileMenuBurgerRef, desktopMenuRef]}
258
+ visible={menuIsActive}
259
+ />
246
260
  </div>
247
261
  );
248
262
  };