@conduction/components 2.0.7 → 2.0.8

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,10 +4,14 @@
4
4
 
5
5
  - **Version 2**
6
6
 
7
- - 2.0.7:
7
+ - 2.0.8:
8
+ - added new Tooltip component using React-tooltip.
9
+ - added active status to PrimaryTopNav
10
+ - added active status to SecondaryTopNav
11
+ - 2.0.7:
8
12
  - Added new BadgeCounter component.
9
13
  - Added CodeBlock component.
10
- - 2.0.6:
14
+ - 2.0.6:
11
15
  - Added optional icon with default icon to the primary and secondary button in NotificationPopUp
12
16
  - Added a handleClick function to the DownloadCard;
13
17
  - Added clickFunction, layoutClassName and renamed tag to label in the Tag component;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import ReactTooltip from "react-tooltip";
3
+ interface ToolTipProps {
4
+ children: React.ReactNode;
5
+ tooltip: string;
6
+ layoutClassName?: string;
7
+ }
8
+ export declare const ToolTip: React.FC<ToolTipProps>;
9
+ export { ReactTooltip };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ReactTooltip from "react-tooltip";
3
+ import * as styles from "./ToolTip.module.css";
4
+ export const ToolTip = ({ children, layoutClassName, tooltip }) => {
5
+ return (_jsxs("div", { className: styles.wrapper, children: [_jsx("div", { "data-tip": tooltip, className: layoutClassName && layoutClassName, children: children }), _jsx(ReactTooltip, { place: "top", type: "dark", effect: "solid" })] }));
6
+ };
7
+ export { ReactTooltip };
@@ -0,0 +1,4 @@
1
+ .wrapper {
2
+ display: inline-block;
3
+ position: relative;
4
+ }
@@ -2,10 +2,12 @@ import * as React from "react";
2
2
  interface ITopNavItem {
3
3
  label: string;
4
4
  icon?: JSX.Element;
5
+ current?: boolean;
5
6
  handleClick?: () => any;
6
7
  subItems?: {
7
8
  label: string;
8
9
  icon?: JSX.Element;
10
+ current?: boolean;
9
11
  handleClick?: () => any;
10
12
  }[];
11
13
  }
@@ -3,5 +3,5 @@ import { Link } from "@gemeente-denhaag/components-react";
3
3
  import * as styles from "./PrimaryTopNav.module.css";
4
4
  import clsx from "clsx";
5
5
  export const PrimaryTopNav = ({ items, layoutClassName }) => {
6
- return (_jsx("div", { className: clsx(styles.primary, layoutClassName && layoutClassName), children: _jsx("nav", { className: styles.primary, children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, handleClick, subItems }, idx) => (_jsxs("li", { className: styles.li, children: [_jsx("div", { onClick: handleClick, children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }), subItems && (_jsx("ul", { className: styles.dropdown, children: subItems.map(({ label, icon, handleClick }, idx) => (_jsx("li", { className: styles.li, onClick: handleClick, children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }, idx))) }))] }, idx))) }) }) }));
6
+ return (_jsx("div", { className: clsx(styles.primary, layoutClassName && layoutClassName), children: _jsx("nav", { className: styles.primary, children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, current, handleClick, subItems }, idx) => (_jsxs("li", { className: clsx(styles.li, current && styles.current), children: [_jsx("div", { onClick: handleClick, children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }), subItems && (_jsx("ul", { className: styles.dropdown, children: subItems.map(({ label, icon, current, handleClick }, idx) => (_jsx("li", { className: clsx(styles.li, current && styles.current), onClick: handleClick, children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }, idx))) }))] }, idx))) }) }) }));
7
7
  };
@@ -2,8 +2,15 @@
2
2
  --conduction-primary-top-nav-item-padding: var(--skeleton-size-md);
3
3
  --conduction-primary-top-nav-color: var(--skeleton-color-white);
4
4
  --conduction-primary-top-nav-background-color: var(--skeleton-color-secondary-3);
5
- --conduction-primary-top-nav-background-color-hover: var(--skeleton-color-secondary-5);
5
+ --conduction-primary-top-nav-background-color-hover: rgba(255, 255, 255, 0.2);
6
6
  --conduction-primary-top-nav-dropdown-border-radius: var(--skeleton-border-radius-md);
7
+ --conduction-primary-top-nav-background-color-active: rgba(255, 255, 255, 0.2);
8
+ }
9
+
10
+ .primary {
11
+ font-weight: 500;
12
+ width: fit-content;
13
+ background-color: var(--conduction-primary-top-nav-background-color);
7
14
  }
8
15
 
9
16
  .primary:hover {
@@ -23,10 +30,12 @@
23
30
  position: relative;
24
31
  }
25
32
 
26
- .primary {
27
- font-weight: 500;
28
- width: fit-content;
29
- background-color: var(--conduction-primary-top-nav-background-color);
33
+ .li:hover {
34
+ background-color: var(--conduction-primary-top-nav-background-color-hover);
35
+ }
36
+
37
+ .current {
38
+ background-color: var(--conduction-primary-top-nav-background-color-active);
30
39
  }
31
40
 
32
41
  .primary .link {
@@ -38,10 +47,6 @@
38
47
  padding-block-end: var(--conduction-primary-top-nav-item-padding);
39
48
  }
40
49
 
41
- .primary .li:hover {
42
- background-color: var(--conduction-primary-top-nav-background-color-hover);
43
- }
44
-
45
50
  .primary .li:hover .dropdown {
46
51
  display: block;
47
52
  z-index: 1;
@@ -3,6 +3,7 @@ interface TopNavProps {
3
3
  items: {
4
4
  label: string;
5
5
  icon?: JSX.Element;
6
+ current?: boolean;
6
7
  handleClick: () => any;
7
8
  }[];
8
9
  layoutClassName?: string;
@@ -3,5 +3,5 @@ import * as styles from "./SecondaryTopNav.module.css";
3
3
  import { Link } from "@gemeente-denhaag/components-react";
4
4
  import clsx from "clsx";
5
5
  export const SecondaryTopNav = ({ items, layoutClassName }) => {
6
- return (_jsx("div", { className: clsx(styles.secondary, layoutClassName && layoutClassName), children: _jsx("nav", { children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, handleClick }, idx) => (_jsx("li", { className: styles.li, onClick: handleClick, children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }, idx))) }) }) }));
6
+ return (_jsx("div", { className: clsx(styles.secondary, layoutClassName && layoutClassName), children: _jsx("nav", { children: _jsx("ul", { className: styles.ul, children: items.map(({ label, icon, current, handleClick }, idx) => (_jsx("li", { className: clsx(styles.li, current && styles.current), onClick: handleClick, children: _jsx(Link, { className: styles.link, icon: icon, iconAlign: "start", children: label }) }, idx))) }) }) }));
7
7
  };
@@ -3,8 +3,9 @@
3
3
  --conduction-secondary-top-nav-font-size: var(--skeleton-font-size-md);
4
4
  --conduction-secondary-top-nav-color: var(--skeleton-color-white);
5
5
  --conduction-secondary-top-nav-background-color: var(--skeleton-color-secondary-5);
6
- --conduction-secondary-top-nav-background-color-hover: var(--skeleton-color-secondary-3);
6
+ --conduction-secondary-top-nav-background-color-hover: rgba(0, 0, 0, 0.1);
7
7
  --conduction-secondary-top-nav-font-weight: var(--skeleton-font-weight-light);
8
+ --conduction-secondary-top-nav-color-active: rgba(0, 0, 0, 0.1);
8
9
  }
9
10
 
10
11
  .secondary:hover {
@@ -27,6 +28,14 @@
27
28
  padding-block-end: var(--conduction-secondary-top-nav-item-padding);
28
29
  }
29
30
 
31
+ .li:hover {
32
+ background-color: var(--conduction-secondary-top-nav-background-color-hover);
33
+ }
34
+
35
+ .current {
36
+ background-color: var(--conduction-secondary-top-nav-color-active);
37
+ }
38
+
30
39
  .secondary {
31
40
  font-weight: var(--conduction-secondary-top-nav-font-weight);
32
41
  width: fit-content;
@@ -37,7 +46,3 @@
37
46
  .secondary .link {
38
47
  color: var(--conduction-secondary-top-nav-color);
39
48
  }
40
-
41
- .secondary .li:hover {
42
- background-color: var(--conduction-secondary-top-nav-background-color-hover);
43
- }
package/lib/index.d.ts CHANGED
@@ -23,4 +23,5 @@ import { QuoteWrapper } from "./components/quoteWrapper/QuoteWrapper";
23
23
  import { Pagination } from "./components/denhaag-wrappers/pagination/Pagination";
24
24
  import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
25
25
  import { CodeBlock } from "./components/codeBlock/CodeBlock";
26
- export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, };
26
+ import { ToolTip } from "./components/toolTip/ToolTip";
27
+ export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, };
package/lib/index.js CHANGED
@@ -16,4 +16,5 @@ import { QuoteWrapper } from "./components/quoteWrapper/QuoteWrapper";
16
16
  import { Pagination } from "./components/denhaag-wrappers/pagination/Pagination";
17
17
  import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
18
18
  import { CodeBlock } from "./components/codeBlock/CodeBlock";
19
- export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, };
19
+ import { ToolTip } from "./components/toolTip/ToolTip";
20
+ export { InputRadio, DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, InfoCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -30,7 +30,8 @@
30
30
  "gatsby": "^4.11.1",
31
31
  "react": "^17.0.1",
32
32
  "react-hook-form": "7.29.0",
33
- "react-select": "5.3.2"
33
+ "react-select": "5.3.2",
34
+ "react-tooltip": "^4.2.21"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/node": "^17.0.23",
@@ -0,0 +1,4 @@
1
+ .wrapper {
2
+ display: inline-block;
3
+ position: relative;
4
+ }
@@ -0,0 +1,24 @@
1
+ import _ from "lodash";
2
+ import * as React from "react";
3
+ import ReactTooltip from "react-tooltip";
4
+ import * as styles from "./ToolTip.module.css";
5
+
6
+ interface ToolTipProps {
7
+ children: React.ReactNode;
8
+ tooltip: string;
9
+ layoutClassName?: string;
10
+ }
11
+
12
+ export const ToolTip: React.FC<ToolTipProps> = ({ children, layoutClassName, tooltip }) => {
13
+ return (
14
+ <div className={styles.wrapper}>
15
+ <div data-tip={tooltip} className={layoutClassName && layoutClassName}>
16
+ {children}
17
+ </div>
18
+
19
+ <ReactTooltip place={"top"} type={"dark"} effect={"solid"} />
20
+ </div>
21
+ );
22
+ };
23
+
24
+ export { ReactTooltip };
@@ -2,8 +2,15 @@
2
2
  --conduction-primary-top-nav-item-padding: var(--skeleton-size-md);
3
3
  --conduction-primary-top-nav-color: var(--skeleton-color-white);
4
4
  --conduction-primary-top-nav-background-color: var(--skeleton-color-secondary-3);
5
- --conduction-primary-top-nav-background-color-hover: var(--skeleton-color-secondary-5);
5
+ --conduction-primary-top-nav-background-color-hover: rgba(255, 255, 255, 0.2);
6
6
  --conduction-primary-top-nav-dropdown-border-radius: var(--skeleton-border-radius-md);
7
+ --conduction-primary-top-nav-background-color-active: rgba(255, 255, 255, 0.2);
8
+ }
9
+
10
+ .primary {
11
+ font-weight: 500;
12
+ width: fit-content;
13
+ background-color: var(--conduction-primary-top-nav-background-color);
7
14
  }
8
15
 
9
16
  .primary:hover {
@@ -23,10 +30,12 @@
23
30
  position: relative;
24
31
  }
25
32
 
26
- .primary {
27
- font-weight: 500;
28
- width: fit-content;
29
- background-color: var(--conduction-primary-top-nav-background-color);
33
+ .li:hover {
34
+ background-color: var(--conduction-primary-top-nav-background-color-hover);
35
+ }
36
+
37
+ .current {
38
+ background-color: var(--conduction-primary-top-nav-background-color-active);
30
39
  }
31
40
 
32
41
  .primary .link {
@@ -38,10 +47,6 @@
38
47
  padding-block-end: var(--conduction-primary-top-nav-item-padding);
39
48
  }
40
49
 
41
- .primary .li:hover {
42
- background-color: var(--conduction-primary-top-nav-background-color-hover);
43
- }
44
-
45
50
  .primary .li:hover .dropdown {
46
51
  display: block;
47
52
  z-index: 1;
@@ -6,10 +6,12 @@ import clsx from "clsx";
6
6
  interface ITopNavItem {
7
7
  label: string;
8
8
  icon?: JSX.Element;
9
+ current?: boolean;
9
10
  handleClick?: () => any;
10
11
  subItems?: {
11
12
  label: string;
12
13
  icon?: JSX.Element;
14
+ current?: boolean;
13
15
  handleClick?: () => any;
14
16
  }[];
15
17
  }
@@ -24,8 +26,8 @@ export const PrimaryTopNav: React.FC<TopNavProps> = ({ items, layoutClassName })
24
26
  <div className={clsx(styles.primary, layoutClassName && layoutClassName)}>
25
27
  <nav className={styles.primary}>
26
28
  <ul className={styles.ul}>
27
- {items.map(({ label, icon, handleClick, subItems }, idx) => (
28
- <li className={styles.li} key={idx}>
29
+ {items.map(({ label, icon, current, handleClick, subItems }, idx) => (
30
+ <li className={clsx(styles.li, current && styles.current)} key={idx}>
29
31
  <div onClick={handleClick}>
30
32
  <Link className={styles.link} icon={icon} iconAlign="start">
31
33
  {label}
@@ -34,8 +36,8 @@ export const PrimaryTopNav: React.FC<TopNavProps> = ({ items, layoutClassName })
34
36
 
35
37
  {subItems && (
36
38
  <ul className={styles.dropdown}>
37
- {subItems.map(({ label, icon, handleClick }, idx) => (
38
- <li key={idx} className={styles.li} onClick={handleClick}>
39
+ {subItems.map(({ label, icon, current, handleClick }, idx) => (
40
+ <li key={idx} className={clsx(styles.li, current && styles.current)} onClick={handleClick}>
39
41
  <Link className={styles.link} icon={icon} iconAlign="start">
40
42
  {label}
41
43
  </Link>
@@ -3,8 +3,9 @@
3
3
  --conduction-secondary-top-nav-font-size: var(--skeleton-font-size-md);
4
4
  --conduction-secondary-top-nav-color: var(--skeleton-color-white);
5
5
  --conduction-secondary-top-nav-background-color: var(--skeleton-color-secondary-5);
6
- --conduction-secondary-top-nav-background-color-hover: var(--skeleton-color-secondary-3);
6
+ --conduction-secondary-top-nav-background-color-hover: rgba(0, 0, 0, 0.1);
7
7
  --conduction-secondary-top-nav-font-weight: var(--skeleton-font-weight-light);
8
+ --conduction-secondary-top-nav-color-active: rgba(0, 0, 0, 0.1);
8
9
  }
9
10
 
10
11
  .secondary:hover {
@@ -27,6 +28,14 @@
27
28
  padding-block-end: var(--conduction-secondary-top-nav-item-padding);
28
29
  }
29
30
 
31
+ .li:hover {
32
+ background-color: var(--conduction-secondary-top-nav-background-color-hover);
33
+ }
34
+
35
+ .current {
36
+ background-color: var(--conduction-secondary-top-nav-color-active);
37
+ }
38
+
30
39
  .secondary {
31
40
  font-weight: var(--conduction-secondary-top-nav-font-weight);
32
41
  width: fit-content;
@@ -37,7 +46,3 @@
37
46
  .secondary .link {
38
47
  color: var(--conduction-secondary-top-nav-color);
39
48
  }
40
-
41
- .secondary .li:hover {
42
- background-color: var(--conduction-secondary-top-nav-background-color-hover);
43
- }
@@ -4,7 +4,7 @@ import { Link } from "@gemeente-denhaag/components-react";
4
4
  import clsx from "clsx";
5
5
 
6
6
  interface TopNavProps {
7
- items: { label: string; icon?: JSX.Element; handleClick: () => any }[];
7
+ items: { label: string; icon?: JSX.Element; current?: boolean; handleClick: () => any }[];
8
8
  layoutClassName?: string;
9
9
  }
10
10
 
@@ -13,8 +13,8 @@ export const SecondaryTopNav: React.FC<TopNavProps> = ({ items, layoutClassName
13
13
  <div className={clsx(styles.secondary, layoutClassName && layoutClassName)}>
14
14
  <nav>
15
15
  <ul className={styles.ul}>
16
- {items.map(({ label, icon, handleClick }, idx) => (
17
- <li className={styles.li} key={idx} onClick={handleClick}>
16
+ {items.map(({ label, icon, current, handleClick }, idx) => (
17
+ <li className={clsx(styles.li, current && styles.current)} key={idx} onClick={handleClick}>
18
18
  <Link className={styles.link} icon={icon} iconAlign="start">
19
19
  {label}
20
20
  </Link>
package/src/index.ts CHANGED
@@ -38,6 +38,7 @@ import { QuoteWrapper } from "./components/quoteWrapper/QuoteWrapper";
38
38
  import { Pagination } from "./components/denhaag-wrappers/pagination/Pagination";
39
39
  import { BadgeCounter } from "./components/badgeCounter/BadgeCounter";
40
40
  import { CodeBlock } from "./components/codeBlock/CodeBlock";
41
+ import { ToolTip } from "./components/toolTip/ToolTip";
41
42
 
42
43
  export {
43
44
  InputRadio,
@@ -74,4 +75,5 @@ export {
74
75
  Pagination,
75
76
  BadgeCounter,
76
77
  CodeBlock,
78
+ ToolTip,
77
79
  };