@conduction/components 2.2.38 → 2.2.40

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/README.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  - **Version 2.2 (breaking changes from 2.1.x)**
6
6
 
7
+ - 2.2.40:
8
+ - Updated DownloadCard to only accept fontawesome icons.
9
+ - Removed tooltip from PrimaryTopNav component and updated dropdown.
10
+ - 2.2.39:
11
+ - Updated PrimaryTopNav component to include tooltip and better dropdown.
12
+ - Updated Logo component to have navbar option.
7
13
  - 2.2.38: Updated DownloadCard to show only one icon.
8
14
  - 2.2.37: Updated DownloadCard to include tooltip and Removed opacity token from Tooltip the fix bug.
9
15
  - 2.2.35 & 2.2.36:
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { IconDefinition } from "@fortawesome/free-solid-svg-icons";
2
3
  interface DownloadCardProps {
3
4
  label: string;
4
5
  size: string;
@@ -7,7 +8,7 @@ interface DownloadCardProps {
7
8
  id: string;
8
9
  tooltip: string;
9
10
  };
10
- icon?: JSX.Element;
11
+ icon?: IconDefinition;
11
12
  layoutClassName?: string;
12
13
  handleClick: () => any;
13
14
  }
@@ -43,5 +43,5 @@ export const DownloadCard = ({ icon, label, size, type, labelTooltip, layoutClas
43
43
  return faDatabase;
44
44
  }
45
45
  };
46
- return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsx("div", { className: styles.icon, children: icon ?? _jsx(FontAwesomeIcon, { icon: getIconFromType(type) }) }), _jsxs("div", { className: styles.content, children: [_jsx(Heading3, { "data-tooltip-id": labelTooltip && labelTooltip.id, "data-tooltip-content": labelTooltip && labelTooltip.tooltip, className: styles.title, children: label }), _jsxs("div", { children: ["(", _.toUpper(type), size && `, ${size}kB`, ")"] })] }), _jsxs(Link, { className: styles.link, href: "", onClick: (e) => onClick(e), children: [_jsx(FontAwesomeIcon, { className: styles.icon, icon: faDownload }), " Download"] })] }));
46
+ return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsx("div", { className: styles.icon, children: _jsx(FontAwesomeIcon, { icon: icon ?? getIconFromType(type) }) }), _jsxs("div", { className: styles.content, children: [_jsx(Heading3, { "data-tooltip-id": labelTooltip && labelTooltip.id, "data-tooltip-content": labelTooltip && labelTooltip.tooltip, className: styles.title, children: label }), _jsxs("div", { children: ["(", _.toUpper(type), size && `, ${size}kB`, ")"] })] }), _jsxs(Link, { className: styles.link, href: "", onClick: (e) => onClick(e), children: [_jsx(FontAwesomeIcon, { className: styles.icon, icon: faDownload }), " Download"] })] }));
47
47
  };
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  interface LogoProps {
3
- variant?: "header" | "footer";
3
+ variant?: "header" | "footer" | "navbar";
4
4
  onClick?: () => any;
5
5
  layoutClassName?: string;
6
6
  }
@@ -5,7 +5,11 @@
5
5
 
6
6
  --conduction-logo-footer-inline-size: 330px;
7
7
  --conduction-logo-footer-block-size: 60px;
8
- --conduction-logo-footer-background-image: url("https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png");
8
+ --conduction-logo-footer-background-image: url("https://raw.githubusercontent.com/OpenCatalogi/web-app/df1e0533081d780c05b1d0b57ab327d97adcbdc6/pwa/src/assets/svgs/LogoConduction.svg");
9
+
10
+ --conduction-logo-navbar-inline-size: 150px;
11
+ --conduction-logo-navbar-block-size: 40px;
12
+ --conduction-logo-navbar-background-image: url("https://raw.githubusercontent.com/OpenCatalogi/web-app/df1e0533081d780c05b1d0b57ab327d97adcbdc6/pwa/src/assets/svgs/LogoConduction.svg");
9
13
  }
10
14
 
11
15
  .container {
@@ -26,6 +30,12 @@
26
30
  background-image: var(--conduction-logo-footer-background-image);
27
31
  }
28
32
 
33
+ .container.navbar {
34
+ inline-size: var(--conduction-logo-navbar-inline-size);
35
+ block-size: var(--conduction-logo-navbar-block-size);
36
+ background-image: var(--conduction-logo-navbar-background-image);
37
+ }
38
+
29
39
  .container.clickable:hover {
30
40
  cursor: pointer;
31
41
  }
@@ -19,5 +19,5 @@ export const PrimaryTopNav = ({ items, mobileLogo, layoutClassName }) => {
19
19
  setIsOpen(false);
20
20
  handleClick();
21
21
  };
22
- return (_jsxs("div", { className: clsx(styles.container, layoutClassName && layoutClassName), children: [_jsxs("div", { className: styles.menuToggleContainer, children: [mobileLogo, _jsx("button", { className: styles.menuToggle, onClick: () => setIsOpen((o) => !o), children: _jsx(FontAwesomeIcon, { icon: faBars }) })] }), _jsx("nav", { className: clsx(styles.primary, isOpen && styles.isOpen), children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, current, handleClick, subItems }, idx) => (_jsxs("li", { onClick: handleClick, className: clsx(styles.li, current && styles.current), children: [_jsxs(Link, { className: clsx(styles.link, styles.label, subItems && styles.mobileLink, current && styles.currentLink), children: [icon, label, " ", subItems && isMobile && _jsx(FontAwesomeIcon, { className: styles.toggleIcon, icon: faChevronRight })] }), subItems && (_jsx("ul", { className: styles.dropdown, children: subItems.map(({ label, icon, current, handleClick }, idx) => (_jsx("li", { className: clsx(styles.li, current && styles.current), onClick: () => handleSubItemClick(handleClick), children: _jsxs(Link, { className: clsx(styles.link, styles.label, current && styles.currentLink), children: [icon, label] }) }, idx))) }))] }, idx))) }) })] }));
22
+ return (_jsxs("div", { className: clsx(styles.container, layoutClassName && layoutClassName), children: [_jsxs("div", { className: styles.menuToggleContainer, children: [mobileLogo, _jsx("button", { className: styles.menuToggle, onClick: () => setIsOpen((o) => !o), children: _jsx(FontAwesomeIcon, { icon: faBars }) })] }), _jsx("nav", { className: clsx(styles.primary, isOpen && styles.isOpen), children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, current, handleClick, subItems }, idx) => (_jsxs("li", { onClick: handleClick, className: clsx(styles.li, current && styles.current), children: [_jsxs(Link, { className: clsx(styles.link, styles.label, subItems && styles.mobileLink, current && styles.currentLink), children: [icon && icon, label, " ", subItems && isMobile && _jsx(FontAwesomeIcon, { className: styles.toggleIcon, icon: faChevronRight })] }), subItems && (_jsx("ul", { className: clsx(styles.dropdown, [subItems.length > 8 && styles.dropdownOverflow]), children: subItems.map(({ label, icon, current, handleClick }, idx) => (_jsx("li", { className: clsx(styles.li, current && styles.current), onClick: () => handleSubItemClick(handleClick), children: _jsxs(Link, { className: clsx(styles.link, styles.label, current && styles.currentLink), children: [icon, label] }) }, idx))) }))] }, idx))) }) })] }));
23
23
  };
@@ -4,7 +4,7 @@
4
4
  --conduction-primary-top-nav-toggle-icon-size: 24px;
5
5
  --conduction-primary-top-nav-mobile-logo-padding: 18px;
6
6
 
7
- --conduction-primary-top-nav-item-padding: var(--skeleton-size-md);
7
+ --conduction-primary-top-nav-item-padding: 18px;
8
8
  --conduction-primary-top-nav-item-icon-margin: var(--skeleton-size-2x);
9
9
  /* --conduction-primary-top-nav-item-border-radius: var(--skeleton-size-2x); */
10
10
 
@@ -103,6 +103,7 @@
103
103
  .current:hover {
104
104
  box-shadow: var(--conduction-primary-top-nav-current-box-shadow);
105
105
  }
106
+
106
107
  .current:hover > .currentLink {
107
108
  color: var(--conduction-primary-top-nav-hover-color) !important;
108
109
  }
@@ -111,8 +112,12 @@
111
112
  color: var(--conduction-primary-top-nav-current-color) !important;
112
113
  }
113
114
 
115
+ .currentLink svg path {
116
+ fill: var(--conduction-primary-top-nav-current-color) !important;
117
+ }
118
+
114
119
  .mobileLink {
115
- margin-block-end: var(--skeleton-size-md);
120
+ margin-block-end: 18px;
116
121
  }
117
122
  .primary .link {
118
123
  text-decoration: none;
@@ -128,10 +133,18 @@
128
133
  color: var(--conduction-primary-top-nav-color);
129
134
  }
130
135
 
136
+ .primary .link:not(.currentLink) svg path {
137
+ fill: var(--conduction-primary-top-nav-color);
138
+ }
139
+
131
140
  .primary .li:hover .link {
132
141
  color: var(--conduction-primary-top-nav-hover-color);
133
142
  }
134
143
 
144
+ .primary .li:hover svg path {
145
+ fill: var(--conduction-primary-top-nav-hover-color);
146
+ }
147
+
135
148
  .link > * {
136
149
  margin-inline-end: 8px;
137
150
  }
@@ -144,6 +157,15 @@
144
157
  display: none;
145
158
  list-style-type: none;
146
159
  background-color: var(--conduction-primary-top-nav-dropdown-background-color, var(--conduction-primary-top-nav-background-color));
160
+ width: fit-content;
161
+ max-width: 200px;
162
+ }
163
+
164
+ .dropdownOverflow {
165
+ display: none;
166
+ max-height: 430px;
167
+ overflow-y: scroll;
168
+ border: 1px solid rgba(0, 0, 0, 0.2);
147
169
  }
148
170
 
149
171
  .dropdown.isOpen {
@@ -168,7 +190,7 @@
168
190
  }
169
191
 
170
192
  .dropdown > li {
171
- padding-inline-start: var(--skeleton-size-md);
193
+ padding-inline-start: 18px;
172
194
  }
173
195
 
174
196
  .toggleIcon {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.2.38",
3
+ "version": "2.2.40",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -5,6 +5,7 @@ import clsx from "clsx";
5
5
  import { Heading3, Link } from "@utrecht/component-library-react/dist/css-module";
6
6
  import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
7
7
  import {
8
+ IconDefinition,
8
9
  faDatabase,
9
10
  faDownload,
10
11
  faFileAudio,
@@ -24,7 +25,7 @@ interface DownloadCardProps {
24
25
  id: string;
25
26
  tooltip: string;
26
27
  };
27
- icon?: JSX.Element;
28
+ icon?: IconDefinition;
28
29
  layoutClassName?: string;
29
30
  handleClick: () => any;
30
31
  }
@@ -79,7 +80,7 @@ export const DownloadCard = ({
79
80
 
80
81
  return (
81
82
  <div className={clsx(styles.container, [layoutClassName && layoutClassName])}>
82
- <div className={styles.icon}>{icon ?? <FontAwesomeIcon icon={getIconFromType(type)} />}</div>
83
+ <div className={styles.icon}>{<FontAwesomeIcon icon={icon ?? getIconFromType(type)} />}</div>
83
84
  <div className={styles.content}>
84
85
  <Heading3
85
86
  data-tooltip-id={labelTooltip && labelTooltip.id}
@@ -5,7 +5,11 @@
5
5
 
6
6
  --conduction-logo-footer-inline-size: 330px;
7
7
  --conduction-logo-footer-block-size: 60px;
8
- --conduction-logo-footer-background-image: url("https://conduction.nl/wp-content/uploads/2021/07/cropped-conductionlogo-1.png");
8
+ --conduction-logo-footer-background-image: url("https://raw.githubusercontent.com/OpenCatalogi/web-app/df1e0533081d780c05b1d0b57ab327d97adcbdc6/pwa/src/assets/svgs/LogoConduction.svg");
9
+
10
+ --conduction-logo-navbar-inline-size: 150px;
11
+ --conduction-logo-navbar-block-size: 40px;
12
+ --conduction-logo-navbar-background-image: url("https://raw.githubusercontent.com/OpenCatalogi/web-app/df1e0533081d780c05b1d0b57ab327d97adcbdc6/pwa/src/assets/svgs/LogoConduction.svg");
9
13
  }
10
14
 
11
15
  .container {
@@ -26,6 +30,12 @@
26
30
  background-image: var(--conduction-logo-footer-background-image);
27
31
  }
28
32
 
33
+ .container.navbar {
34
+ inline-size: var(--conduction-logo-navbar-inline-size);
35
+ block-size: var(--conduction-logo-navbar-block-size);
36
+ background-image: var(--conduction-logo-navbar-background-image);
37
+ }
38
+
29
39
  .container.clickable:hover {
30
40
  cursor: pointer;
31
41
  }
@@ -3,7 +3,7 @@ import * as styles from "./Logo.module.css";
3
3
  import clsx from "clsx";
4
4
 
5
5
  interface LogoProps {
6
- variant?: "header" | "footer";
6
+ variant?: "header" | "footer" | "navbar";
7
7
  onClick?: () => any;
8
8
  layoutClassName?: string;
9
9
  }
@@ -4,7 +4,7 @@
4
4
  --conduction-primary-top-nav-toggle-icon-size: 24px;
5
5
  --conduction-primary-top-nav-mobile-logo-padding: 18px;
6
6
 
7
- --conduction-primary-top-nav-item-padding: var(--skeleton-size-md);
7
+ --conduction-primary-top-nav-item-padding: 18px;
8
8
  --conduction-primary-top-nav-item-icon-margin: var(--skeleton-size-2x);
9
9
  /* --conduction-primary-top-nav-item-border-radius: var(--skeleton-size-2x); */
10
10
 
@@ -103,6 +103,7 @@
103
103
  .current:hover {
104
104
  box-shadow: var(--conduction-primary-top-nav-current-box-shadow);
105
105
  }
106
+
106
107
  .current:hover > .currentLink {
107
108
  color: var(--conduction-primary-top-nav-hover-color) !important;
108
109
  }
@@ -111,8 +112,12 @@
111
112
  color: var(--conduction-primary-top-nav-current-color) !important;
112
113
  }
113
114
 
115
+ .currentLink svg path {
116
+ fill: var(--conduction-primary-top-nav-current-color) !important;
117
+ }
118
+
114
119
  .mobileLink {
115
- margin-block-end: var(--skeleton-size-md);
120
+ margin-block-end: 18px;
116
121
  }
117
122
  .primary .link {
118
123
  text-decoration: none;
@@ -128,10 +133,18 @@
128
133
  color: var(--conduction-primary-top-nav-color);
129
134
  }
130
135
 
136
+ .primary .link:not(.currentLink) svg path {
137
+ fill: var(--conduction-primary-top-nav-color);
138
+ }
139
+
131
140
  .primary .li:hover .link {
132
141
  color: var(--conduction-primary-top-nav-hover-color);
133
142
  }
134
143
 
144
+ .primary .li:hover svg path {
145
+ fill: var(--conduction-primary-top-nav-hover-color);
146
+ }
147
+
135
148
  .link > * {
136
149
  margin-inline-end: 8px;
137
150
  }
@@ -144,6 +157,15 @@
144
157
  display: none;
145
158
  list-style-type: none;
146
159
  background-color: var(--conduction-primary-top-nav-dropdown-background-color, var(--conduction-primary-top-nav-background-color));
160
+ width: fit-content;
161
+ max-width: 200px;
162
+ }
163
+
164
+ .dropdownOverflow {
165
+ display: none;
166
+ max-height: 430px;
167
+ overflow-y: scroll;
168
+ border: 1px solid rgba(0, 0, 0, 0.2);
147
169
  }
148
170
 
149
171
  .dropdown.isOpen {
@@ -168,7 +190,7 @@
168
190
  }
169
191
 
170
192
  .dropdown > li {
171
- padding-inline-start: var(--skeleton-size-md);
193
+ padding-inline-start: 18px;
172
194
  }
173
195
 
174
196
  .toggleIcon {
@@ -103,13 +103,13 @@ export const PrimaryTopNav = ({ items, mobileLogo, layoutClassName }: TopNavProp
103
103
  current && styles.currentLink,
104
104
  )}
105
105
  >
106
- {icon}
106
+ {icon && icon}
107
107
  {label}{" "}
108
108
  {subItems && isMobile && <FontAwesomeIcon className={styles.toggleIcon} icon={faChevronRight} />}
109
109
  </Link>
110
110
 
111
111
  {subItems && (
112
- <ul className={styles.dropdown}>
112
+ <ul className={clsx(styles.dropdown, [subItems.length > 8 && styles.dropdownOverflow])}>
113
113
  {subItems.map(({ label, icon, current, handleClick }, idx) => (
114
114
  <li
115
115
  key={idx}