@conduction/components 2.1.12 → 2.1.14

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.14: Refactor checkbox to remove svg errors
8
+ - 2.1.13: Refactor components to remove svg errors (e.g. shape-rendering => shapeRendering)
7
9
  - 2.1.12: Added ToolTip max-width and break-word
8
10
  - 2.1.11: Added CreateKeyValue component disabled state on delete buttons
9
11
  - 2.1.10: PrimaryTopNav overflow scroll removed from desktop
@@ -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" })] }) }));
@@ -0,0 +1,7 @@
1
+ .container {
2
+ user-select: none;
3
+ }
4
+
5
+ .container:hover {
6
+ cursor: pointer;
7
+ }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { IReactHookFormProps } from "./types";
2
+ import { IReactHookFormProps } from "./../types";
3
3
  export interface ICheckboxProps {
4
4
  label: string;
5
5
  name: string;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./Checkbox.module.css";
3
+ export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsxs("div", { className: styles.container, children: [_jsx("input", { type: "checkbox", id: `checkbox${name}`, ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), _jsx("label", { htmlFor: `checkbox${name}`, children: label })] }));
@@ -1,6 +1,6 @@
1
1
  import { InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputFile } from "./input";
2
2
  import { Textarea } from "./textarea";
3
- import { InputCheckbox } from "./checkbox";
3
+ import { InputCheckbox } from "./checkbox/checkbox";
4
4
  import { InputRadio } from "./radio";
5
5
  import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
6
6
  import { CreateKeyValue, IKeyValue } from "./createKeyValue/CreateKeyValue";
@@ -1,6 +1,6 @@
1
1
  import { InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputFile, } from "./input";
2
2
  import { Textarea } from "./textarea";
3
- import { InputCheckbox } from "./checkbox";
3
+ import { InputCheckbox } from "./checkbox/checkbox";
4
4
  import { InputRadio } from "./radio";
5
5
  import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
6
6
  import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
@@ -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] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
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"
@@ -0,0 +1,7 @@
1
+ .container {
2
+ user-select: none;
3
+ }
4
+
5
+ .container:hover {
6
+ cursor: pointer;
7
+ }
@@ -0,0 +1,28 @@
1
+ import * as styles from "./Checkbox.module.css";
2
+ import { IReactHookFormProps } from "./../types";
3
+
4
+ export interface ICheckboxProps {
5
+ label: string;
6
+ name: string;
7
+ defaultChecked?: boolean;
8
+ disabled?: boolean;
9
+ }
10
+
11
+ export const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps> = ({
12
+ name,
13
+ validation,
14
+ register,
15
+ label,
16
+ defaultChecked,
17
+ disabled,
18
+ }) => (
19
+ <div className={styles.container}>
20
+ <input
21
+ type="checkbox"
22
+ id={`checkbox${name}`}
23
+ {...{ defaultChecked, disabled }}
24
+ {...register(name, { ...validation })}
25
+ />
26
+ <label htmlFor={`checkbox${name}`}>{label}</label>
27
+ </div>
28
+ );
@@ -9,7 +9,7 @@ import {
9
9
  InputFile,
10
10
  } from "./input";
11
11
  import { Textarea } from "./textarea";
12
- import { InputCheckbox } from "./checkbox";
12
+ import { InputCheckbox } from "./checkbox/checkbox";
13
13
  import { InputRadio } from "./radio";
14
14
  import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
15
15
  import { CreateKeyValue, IKeyValue } from "./createKeyValue/CreateKeyValue";
@@ -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,3 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FormControlLabel } from "@gemeente-denhaag/components-react";
3
- export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsx(FormControlLabel, { input: _jsx("input", { type: "checkbox", id: `checkbox${name}`, ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), ...{ label } }));
@@ -1,3 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FormControlLabel } from "@gemeente-denhaag/components-react";
3
- export const InputCheckbox = ({ name, validation, register, label, }) => _jsx(FormControlLabel, { input: _jsx("input", { type: "checkbox", ...register(name, { ...validation }) }), ...{ label } });
@@ -1,30 +0,0 @@
1
- import { FormControlLabel } from "@gemeente-denhaag/components-react";
2
- import { IReactHookFormProps } from "./types";
3
-
4
- export interface ICheckboxProps {
5
- label: string;
6
- name: string;
7
- defaultChecked?: boolean;
8
- disabled?: boolean;
9
- }
10
-
11
- export const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps> = ({
12
- name,
13
- validation,
14
- register,
15
- label,
16
- defaultChecked,
17
- disabled,
18
- }) => (
19
- <FormControlLabel
20
- input={
21
- <input
22
- type="checkbox"
23
- id={`checkbox${name}`}
24
- {...{ defaultChecked, disabled }}
25
- {...register(name, { ...validation })}
26
- />
27
- }
28
- {...{ label }}
29
- />
30
- );
package/src/index.js DELETED
@@ -1,14 +0,0 @@
1
- export * from "./components/card";
2
- export * from "./components/casesTable/CasesTable";
3
- export * from "./components/container/Container";
4
- export * from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
- export * from "./components/editableTableRow/EditableTableRow";
6
- export * from "./components/formFields";
7
- export * from "./components/imageDivider/ImageDivider";
8
- export * from "./components/logo/Logo";
9
- export * from "./components/messageForm/MessageForm";
10
- export * from "./components/messagesTable/MessagesTable";
11
- export * from "./components/metaIcon/MetaIcon";
12
- export * from "./components/privateRoute/PrivateRoute";
13
- export * from "./components/statusSteps/StatusSteps";
14
- export * from "./components/topNav/TopNav";