@conduction/components 2.1.11 → 2.1.13

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,8 @@
4
4
 
5
5
  - **Version 2.1 (breaking changes from 2.0.x)**
6
6
 
7
+ - 2.1.13: Refactor components to remove svg errors (e.g. shape-rendering => shapeRendering)
8
+ - 2.1.12: Added ToolTip max-width and break-word
7
9
  - 2.1.11: Added CreateKeyValue component disabled state on delete buttons
8
10
  - 2.1.10: PrimaryTopNav overflow scroll removed from desktop
9
11
  - 2.1.8 & 2.1.9: PrimaryTopNav will always show subItems on mobile
@@ -16,5 +16,5 @@ export const Breadcrumbs = ({ crumbs }) => {
16
16
  return _jsx(LastCrumbItem, { ...crumb, ...{ idx } }, idx);
17
17
  }) }) }));
18
18
  };
19
- const CrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { className: "denhaag-breadcrumb__link", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", focusable: "false", height: "1em", "shape-rendering": "auto", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9.293 18.707a1 1 0 010-1.414L14.586 12 9.293 6.707a1 1 0 011.414-1.414l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0z", fill: "currentColor" }) }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
19
+ const CrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { className: "denhaag-breadcrumb__link", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", focusable: "false", height: "1em", shapeRendering: "auto", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9.293 18.707a1 1 0 010-1.414L14.586 12 9.293 6.707a1 1 0 011.414-1.414l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0z", fill: "currentColor" }) }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
20
20
  const LastCrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { "aria-current": "page", className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { "aria-current": "page", className: "denhaag-breadcrumb__link denhaag-breadcrumb__link--current", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { TextField } from "@gemeente-denhaag/components-react";
4
- import { ShowIcon, HideIcon } from "@gemeente-denhaag/icons";
4
+ import { faEyeSlash, faEye } from "@fortawesome/free-solid-svg-icons";
5
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
6
  export const InputPassword = ({ disabled, name, validation, register, placeholder, errors, }) => {
6
7
  const [showPassword, setShowPassword] = React.useState(false);
7
- return (_jsx(TextField, { type: showPassword ? "text" : "password", ...{ disabled, placeholder }, ...register(name, { ...validation }), invalid: errors[name], icon: _jsx("span", { onClick: () => setShowPassword(!showPassword), children: showPassword ? _jsx(HideIcon, {}) : _jsx(ShowIcon, {}) }) }));
8
+ return (_jsx(TextField, { type: showPassword ? "text" : "password", ...{ disabled, placeholder }, ...register(name, { ...validation }), invalid: errors[name], icon: _jsx("span", { onClick: () => setShowPassword(!showPassword), children: showPassword ? _jsx(FontAwesomeIcon, { icon: faEye }) : _jsx(FontAwesomeIcon, { icon: faEyeSlash }) }) }));
8
9
  };
9
10
  export const InputText = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "text", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
10
11
  export const InputEmail = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "email", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ReactTooltip from "react-tooltip";
3
3
  import * as styles from "./ToolTip.module.css";
4
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" })] }));
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", className: styles.tooltip })] }));
6
6
  };
7
7
  export { ReactTooltip };
@@ -1,4 +1,13 @@
1
+ :root {
2
+ --conduction-tooltip-max-width: 500px;
3
+ }
4
+
1
5
  .wrapper {
2
6
  display: inline-block;
3
7
  position: relative;
4
8
  }
9
+
10
+ .tooltip {
11
+ max-width: var(--conduction-tooltip-max-width);
12
+ word-break: break-word;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.1.11",
3
+ "version": "2.1.13",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -9,12 +9,76 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  import { Link } from "gatsby";
10
10
  import "./Breadcrumbs.css";
11
11
  export const Breadcrumbs = ({ crumbs }) => {
12
- return (_jsx("nav", { "aria-label": "Breadcrumb", className: "denhaag-breadcrumb", children: _jsx("ol", { className: "denhaag-breadcrumb__list", itemScope: true, itemType: "https://schema.org/BreadcrumbList", children: crumbs.map((crumb, idx) => {
13
- if (crumbs.length !== idx + 1) {
14
- return _jsx(CrumbItem, { ...crumb, ...{ idx } }, idx);
15
- }
16
- return _jsx(LastCrumbItem, { ...crumb, ...{ idx } }, idx);
17
- }) }) }));
12
+ return _jsx("nav", {
13
+ "aria-label": "Breadcrumb",
14
+ className: "denhaag-breadcrumb",
15
+ children: _jsx("ol", {
16
+ className: "denhaag-breadcrumb__list",
17
+ itemScope: true,
18
+ itemType: "https://schema.org/BreadcrumbList",
19
+ children: crumbs.map((crumb, idx) => {
20
+ if (crumbs.length !== idx + 1) {
21
+ return _jsx(CrumbItem, { ...crumb, ...{ idx } }, idx);
22
+ }
23
+ return _jsx(LastCrumbItem, { ...crumb, ...{ idx } }, idx);
24
+ }),
25
+ }),
26
+ });
18
27
  };
19
- const CrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { className: "denhaag-breadcrumb__link", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", focusable: "false", height: "1em", "shape-rendering": "auto", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9.293 18.707a1 1 0 010-1.414L14.586 12 9.293 6.707a1 1 0 011.414-1.414l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0z", fill: "currentColor" }) }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
20
- const LastCrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { "aria-current": "page", className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { "aria-current": "page", className: "denhaag-breadcrumb__link denhaag-breadcrumb__link--current", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
28
+ const CrumbItem = ({ pathname, crumbLabel, idx }) =>
29
+ _jsx("li", {
30
+ className: "denhaag-breadcrumb__item",
31
+ itemProp: "itemListElement",
32
+ itemScope: true,
33
+ itemType: "https://schema.org/ListItem",
34
+ children: _jsxs(Link, {
35
+ className: "denhaag-breadcrumb__link",
36
+ to: pathname,
37
+ itemProp: "item",
38
+ children: [
39
+ _jsx("span", {
40
+ className: "denhaag-breadcrumb__text",
41
+ itemProp: "name",
42
+ children: crumbLabel,
43
+ }),
44
+ _jsx("svg", {
45
+ "aria-hidden": "true",
46
+ className: "denhaag-icon",
47
+ fill: "none",
48
+ focusable: "false",
49
+ height: "1em",
50
+ shapeRendering: "auto",
51
+ viewBox: "0 0 24 24",
52
+ width: "1em",
53
+ xmlns: "http://www.w3.org/2000/svg",
54
+ children: _jsx("path", {
55
+ d: "M9.293 18.707a1 1 0 010-1.414L14.586 12 9.293 6.707a1 1 0 011.414-1.414l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0z",
56
+ fill: "currentColor",
57
+ }),
58
+ }),
59
+ _jsx("meta", { content: idx.toString(), itemProp: "position" }),
60
+ ],
61
+ }),
62
+ });
63
+ const LastCrumbItem = ({ pathname, crumbLabel, idx }) =>
64
+ _jsx("li", {
65
+ "aria-current": "page",
66
+ className: "denhaag-breadcrumb__item",
67
+ itemProp: "itemListElement",
68
+ itemScope: true,
69
+ itemType: "https://schema.org/ListItem",
70
+ children: _jsxs(Link, {
71
+ "aria-current": "page",
72
+ className: "denhaag-breadcrumb__link denhaag-breadcrumb__link--current",
73
+ to: pathname,
74
+ itemProp: "item",
75
+ children: [
76
+ _jsx("span", {
77
+ className: "denhaag-breadcrumb__text",
78
+ itemProp: "name",
79
+ children: crumbLabel,
80
+ }),
81
+ _jsx("meta", { content: idx.toString(), itemProp: "position" }),
82
+ ],
83
+ }),
84
+ });
@@ -51,7 +51,7 @@ const CrumbItem: React.FC<CrumbItemProps> = ({ pathname, crumbLabel, idx }) => (
51
51
  fill="none"
52
52
  focusable="false"
53
53
  height="1em"
54
- shape-rendering="auto"
54
+ shapeRendering="auto"
55
55
  viewBox="0 0 24 24"
56
56
  width="1em"
57
57
  xmlns="http://www.w3.org/2000/svg"
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { TextField } from "@gemeente-denhaag/components-react";
3
- import { ShowIcon, HideIcon } from "@gemeente-denhaag/icons";
4
3
  import { IReactHookFormProps } from "./types";
4
+ import { faEyeSlash, faEye } from "@fortawesome/free-solid-svg-icons";
5
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
6
 
6
7
  export interface IInputProps {
7
8
  name: string;
@@ -27,7 +28,11 @@ export const InputPassword: React.FC<IInputProps & IReactHookFormProps> = ({
27
28
  {...{ disabled, placeholder }}
28
29
  {...register(name, { ...validation })}
29
30
  invalid={errors[name]}
30
- icon={<span onClick={() => setShowPassword(!showPassword)}>{showPassword ? <HideIcon /> : <ShowIcon />}</span>}
31
+ icon={
32
+ <span onClick={() => setShowPassword(!showPassword)}>
33
+ {showPassword ? <FontAwesomeIcon icon={faEye} /> : <FontAwesomeIcon icon={faEyeSlash} />}
34
+ </span>
35
+ }
31
36
  />
32
37
  );
33
38
  };
@@ -1,4 +1,13 @@
1
+ :root {
2
+ --conduction-tooltip-max-width: 500px;
3
+ }
4
+
1
5
  .wrapper {
2
6
  display: inline-block;
3
7
  position: relative;
4
8
  }
9
+
10
+ .tooltip {
11
+ max-width: var(--conduction-tooltip-max-width);
12
+ word-break: break-word;
13
+ }
@@ -16,7 +16,7 @@ export const ToolTip: React.FC<ToolTipProps> = ({ children, layoutClassName, too
16
16
  {children}
17
17
  </div>
18
18
 
19
- <ReactTooltip place={"top"} type={"dark"} effect={"solid"} />
19
+ <ReactTooltip place={"top"} type={"dark"} effect={"solid"} className={styles.tooltip} />
20
20
  </div>
21
21
  );
22
22
  };