gatsby-core-theme 23.0.1 → 24.0.0

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
@@ -1,3 +1,26 @@
1
+ # [24.0.0](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v23.0.2...v24.0.0) (2023-06-27)
2
+
3
+
4
+ ### Code Refactoring
5
+
6
+ * change api url ([cfa8d4c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cfa8d4cedeb519ce9a1447ad38c15cc027044235))
7
+ * changes to image display viewport ([6b93f8a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6b93f8a0ad851488d043ace5f11f60bfea8f2267))
8
+ * changes to left to right menu on hover ([d6e8f41](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d6e8f41a88fd38f586a020f0a8591620e14b86ce))
9
+
10
+
11
+ * Merge branch 'tm-3475-main-menu' into 'master' ([118ff98](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/118ff9840b15b98eb9e6a8549b31802bb9871540))
12
+ * Merge branch 'master' into tm-3475-main-menu ([f4901a2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/f4901a2653b8176f3527d8aa67d148dd21339076))
13
+
14
+ ## [23.0.2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v23.0.1...v23.0.2) (2023-06-23)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * fix for ltr sites ([cce6e0d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/cce6e0dc0d96250f1cf7f79e1a80d38250d7a8e2))
20
+
21
+
22
+ * Merge branch 'tm-3475-main-menu' into 'master' ([93f61fb](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/93f61fb0644bf8c7ace8e0cf0ed455f8e623207b))
23
+
1
24
  ## [23.0.1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v23.0.0...v23.0.1) (2023-06-23)
2
25
 
3
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "23.0.1",
3
+ "version": "24.0.0",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -8,14 +8,7 @@ import styles from './items.module.scss';
8
8
  import { getPositionClass, itemHasChildren } from '~helpers/menu';
9
9
 
10
10
  // Test included with menu molecule test
11
- const Items = ({
12
- item,
13
- menuListRef,
14
- gtmClass = '',
15
- level = 1,
16
- dropdownButtonWidth = 64,
17
- canOpenAllSubMenus = true,
18
- }) => {
11
+ const Items = ({ item, menuListRef, gtmClass = '', level = 1, canOpenAllSubMenus = true }) => {
19
12
  let link;
20
13
  let menu;
21
14
 
@@ -41,19 +34,15 @@ const Items = ({
41
34
 
42
35
  const onClick = (e) => {
43
36
  const { target } = e;
44
- const { width } = target.getBoundingClientRect();
45
37
 
46
- // check if clicked within the arrow area which has a padding of 4.8rem on the li tag
47
- if (e.nativeEvent.layerX > width - dropdownButtonWidth) {
48
- // check if multiple submenus can be opened at same time, if not close them
49
- if (!canOpenAllSubMenus) {
50
- closeOtherMenus(target);
51
- }
52
-
53
- // toggle the clicked menu item
54
- target.classList.toggle(styles.showSubMenu);
55
- target.getElementsByTagName('UL')[0]?.classList.toggle(styles.show);
38
+ // check if multiple submenus can be opened at same time, if not close them
39
+ if (!canOpenAllSubMenus) {
40
+ closeOtherMenus(target);
56
41
  }
42
+
43
+ // toggle the clicked menu item
44
+ target.classList.toggle(styles.showSubMenu);
45
+ target.getElementsByTagName('UL')[0]?.classList.toggle(styles.show);
57
46
  };
58
47
 
59
48
  if (item.children) {
@@ -122,7 +111,6 @@ Items.propTypes = {
122
111
  menuListRef: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
123
112
  gtmClass: PropTypes.string,
124
113
  level: PropTypes.number,
125
- dropdownButtonWidth: PropTypes.number,
126
114
  canOpenAllSubMenus: PropTypes.bool,
127
115
  };
128
116
 
@@ -14,7 +14,7 @@
14
14
  max-height: 3.2rem;
15
15
  border-radius: 0.4rem;
16
16
 
17
- @include min(tablet) {
17
+ @include min(desktop) {
18
18
  display: none;
19
19
  }
20
20
  }
@@ -7,7 +7,7 @@ export const getPositionClass = (target, styles) => {
7
7
  const { left, width } = element.getBoundingClientRect();
8
8
 
9
9
  // eslint-disable-next-line no-unused-expressions
10
- left + width > document.body.clientWidth &&
10
+ (left + width > document.body.clientWidth || left < 0) &&
11
11
  element.classList.add(styles.staticLeft, styles.hoverLeft);
12
12
  break;
13
13
  }
@@ -97,14 +97,17 @@
97
97
  --levelOne-bg-color: var(--color-4);
98
98
  --levelOne-text-color: var(--color-49);
99
99
  --levelOne-hover-bg-color: #EEEEEE;
100
+ --levelOne-hover-text-color: var(--color-49);
100
101
 
101
102
  --levelTwo-bg-color: #FBFBFB;
102
103
  --levelTwo-text-color: var(--color-49);
103
104
  --levelTwo-hover-bg-color: #EEEEEE;
105
+ --levelTwo-hover-text-color: var(--color-49);
104
106
 
105
107
  --levelThree-bg-color: var(--color-4);
106
108
  --levelThree-text-color: var(--color-49);
107
109
  --levelThree-hover-bg-color: #EEEEEE;
110
+ --levelThree-hover-text-color: var(--color-49);
108
111
 
109
112
  // optional menu styles
110
113
  --levelOne-btn-bg-color: var(--color-4);