@conduction/components 1.0.2

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.
Files changed (123) hide show
  1. package/.prettierrc +29 -0
  2. package/README.md +1 -0
  3. package/lib/components/card/HorizontalImageCard/HorizontalImageCard.d.ts +13 -0
  4. package/lib/components/card/HorizontalImageCard/HorizontalImageCard.js +9 -0
  5. package/lib/components/card/HorizontalImageCard/HorizontalImageCard.module.css +26 -0
  6. package/lib/components/card/RichContentCard/RichContentCard.d.ts +19 -0
  7. package/lib/components/card/RichContentCard/RichContentCard.js +17 -0
  8. package/lib/components/card/RichContentCard/RichContentCard.module.css +100 -0
  9. package/lib/components/card/downloadCard/DownloadCard.d.ts +9 -0
  10. package/lib/components/card/downloadCard/DownloadCard.js +10 -0
  11. package/lib/components/card/downloadCard/DownloadCard.module.css +23 -0
  12. package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.d.ts +14 -0
  13. package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.js +9 -0
  14. package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.module.css +54 -0
  15. package/lib/components/card/index.d.ts +5 -0
  16. package/lib/components/card/index.js +5 -0
  17. package/lib/components/casesTable/CasesTable.d.ts +6 -0
  18. package/lib/components/casesTable/CasesTable.js +11 -0
  19. package/lib/components/casesTable/CasesTable.module.css +4 -0
  20. package/lib/components/container/Container.d.ts +2 -0
  21. package/lib/components/container/Container.js +3 -0
  22. package/lib/components/container/Container.module.css +5 -0
  23. package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.css +222 -0
  24. package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.d.ts +17 -0
  25. package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.js +20 -0
  26. package/lib/components/editableTableRow/EditableTableRow.d.ts +11 -0
  27. package/lib/components/editableTableRow/EditableTableRow.js +34 -0
  28. package/lib/components/editableTableRow/EditableTableRow.module.css +25 -0
  29. package/lib/components/formFields/checkbox.d.ts +3 -0
  30. package/lib/components/formFields/checkbox.js +3 -0
  31. package/lib/components/formFields/index.d.ts +4 -0
  32. package/lib/components/formFields/index.js +4 -0
  33. package/lib/components/formFields/input.d.ts +7 -0
  34. package/lib/components/formFields/input.js +12 -0
  35. package/lib/components/formFields/textarea.d.ts +3 -0
  36. package/lib/components/formFields/textarea.js +3 -0
  37. package/lib/components/formFields/types.d.ts +20 -0
  38. package/lib/components/formFields/types.js +1 -0
  39. package/lib/components/imageDivider/ImageDivider.d.ts +7 -0
  40. package/lib/components/imageDivider/ImageDivider.js +6 -0
  41. package/lib/components/imageDivider/imageDivider.module.css +5 -0
  42. package/lib/components/logo/Logo.d.ts +8 -0
  43. package/lib/components/logo/Logo.js +10 -0
  44. package/lib/components/logo/Logo.module.css +15 -0
  45. package/lib/components/messageForm/MessageForm.d.ts +2 -0
  46. package/lib/components/messageForm/MessageForm.js +12 -0
  47. package/lib/components/messagesTable/MessagesTable.d.ts +11 -0
  48. package/lib/components/messagesTable/MessagesTable.js +11 -0
  49. package/lib/components/messagesTable/MessagesTable.module.css +4 -0
  50. package/lib/components/metaIcon/MetaIcon.d.ts +7 -0
  51. package/lib/components/metaIcon/MetaIcon.js +3 -0
  52. package/lib/components/metaIcon/MetaIcon.module.css +17 -0
  53. package/lib/components/privateRoute/PrivateRoute.d.ts +6 -0
  54. package/lib/components/privateRoute/PrivateRoute.js +15 -0
  55. package/lib/components/statusSteps/StatusSteps.d.ts +13 -0
  56. package/lib/components/statusSteps/StatusSteps.js +5 -0
  57. package/lib/components/topNav/TopNav.d.ts +12 -0
  58. package/lib/components/topNav/TopNav.js +10 -0
  59. package/lib/components/topNav/TopNav.module.css +22 -0
  60. package/lib/index.d.ts +15 -0
  61. package/lib/index.js +15 -0
  62. package/package.json +56 -0
  63. package/src/components/card/HorizontalImageCard/HorizontalImageCard.js +9 -0
  64. package/src/components/card/HorizontalImageCard/HorizontalImageCard.module.css +26 -0
  65. package/src/components/card/HorizontalImageCard/HorizontalImageCard.tsx +37 -0
  66. package/src/components/card/RichContentCard/RichContentCard.js +17 -0
  67. package/src/components/card/RichContentCard/RichContentCard.module.css +100 -0
  68. package/src/components/card/RichContentCard/RichContentCard.tsx +105 -0
  69. package/src/components/card/downloadCard/DownloadCard.js +10 -0
  70. package/src/components/card/downloadCard/DownloadCard.module.css +23 -0
  71. package/src/components/card/downloadCard/DownloadCard.tsx +33 -0
  72. package/src/components/card/imageAndDetailsCard/ImageAndDetailsCard.js +9 -0
  73. package/src/components/card/imageAndDetailsCard/ImageAndDetailsCard.module.css +54 -0
  74. package/src/components/card/imageAndDetailsCard/ImageAndDetailsCard.tsx +49 -0
  75. package/src/components/card/index.js +5 -0
  76. package/src/components/card/index.tsx +6 -0
  77. package/src/components/casesTable/CasesTable.js +11 -0
  78. package/src/components/casesTable/CasesTable.module.css +4 -0
  79. package/src/components/casesTable/CasesTable.tsx +41 -0
  80. package/src/components/container/Container.js +3 -0
  81. package/src/components/container/Container.module.css +5 -0
  82. package/src/components/container/Container.tsx +4 -0
  83. package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.css +222 -0
  84. package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.js +20 -0
  85. package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.tsx +89 -0
  86. package/src/components/editableTableRow/EditableTableRow.js +34 -0
  87. package/src/components/editableTableRow/EditableTableRow.module.css +25 -0
  88. package/src/components/editableTableRow/EditableTableRow.tsx +130 -0
  89. package/src/components/formFields/checkbox.js +3 -0
  90. package/src/components/formFields/checkbox.tsx +9 -0
  91. package/src/components/formFields/index.js +4 -0
  92. package/src/components/formFields/index.tsx +5 -0
  93. package/src/components/formFields/input.js +12 -0
  94. package/src/components/formFields/input.tsx +88 -0
  95. package/src/components/formFields/textarea.js +3 -0
  96. package/src/components/formFields/textarea.tsx +7 -0
  97. package/src/components/formFields/types.js +1 -0
  98. package/src/components/formFields/types.ts +24 -0
  99. package/src/components/imageDivider/ImageDivider.js +6 -0
  100. package/src/components/imageDivider/ImageDivider.tsx +12 -0
  101. package/src/components/imageDivider/imageDivider.module.css +5 -0
  102. package/src/components/logo/Logo.js +10 -0
  103. package/src/components/logo/Logo.module.css +15 -0
  104. package/src/components/logo/Logo.tsx +25 -0
  105. package/src/components/messageForm/MessageForm.js +12 -0
  106. package/src/components/messageForm/MessageForm.tsx +32 -0
  107. package/src/components/messagesTable/MessagesTable.js +11 -0
  108. package/src/components/messagesTable/MessagesTable.module.css +4 -0
  109. package/src/components/messagesTable/MessagesTable.tsx +45 -0
  110. package/src/components/metaIcon/MetaIcon.js +3 -0
  111. package/src/components/metaIcon/MetaIcon.module.css +17 -0
  112. package/src/components/metaIcon/MetaIcon.tsx +18 -0
  113. package/src/components/privateRoute/PrivateRoute.js +15 -0
  114. package/src/components/privateRoute/PrivateRoute.tsx +22 -0
  115. package/src/components/statusSteps/StatusSteps.js +5 -0
  116. package/src/components/statusSteps/StatusSteps.tsx +54 -0
  117. package/src/components/topNav/TopNav.js +10 -0
  118. package/src/components/topNav/TopNav.module.css +22 -0
  119. package/src/components/topNav/TopNav.tsx +46 -0
  120. package/src/custom.d.ts +5 -0
  121. package/src/index.js +14 -0
  122. package/src/index.ts +50 -0
  123. package/tsconfig.json +18 -0
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * This is a wrapper element based on https://nl-design-system.github.io/denhaag/?path=/docs/css-navigation-breadcrumb--default-story
4
+ *
5
+ * IMPORTANT: DO NOT MAKE CHANGES TO THIS FILE, AS ALL CHANGES WILL BE LOST UPON PACKAGE IMPLEMENTATION
6
+ *
7
+ * Note: we do not use css modules here due to this component being a wrapper
8
+ */
9
+ import { Link } from "gatsby";
10
+ import "./Breadcrumbs.css";
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
+ }) }) }));
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" })] }) }));
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,11 @@
1
+ import * as React from "react";
2
+ interface InputTypes {
3
+ inputType: "text" | "email";
4
+ }
5
+ interface EditableTableRowProps {
6
+ thead: string;
7
+ value: string;
8
+ handleSave: (value: any) => void;
9
+ }
10
+ export declare const EditableTableRow: React.FC<EditableTableRowProps & InputTypes>;
11
+ export {};
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
3
+ import * as styles from "./EditableTableRow.module.css";
4
+ import * as React from "react";
5
+ import { useTranslation } from "react-i18next";
6
+ import { Link } from "@gemeente-denhaag/components-react";
7
+ import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
8
+ import { useForm } from "react-hook-form";
9
+ import { InputEmail, InputText } from "../formFields";
10
+ export const EditableTableRow = ({ thead, value, inputType, handleSave, }) => {
11
+ const [editing, setEditing] = React.useState(false);
12
+ return (_jsxs(TableRow, { children: [_jsx(TableHeader, { className: styles.th, children: thead }), editing && _jsx(EditingTableRow, { ...{ value, inputType, handleSave, setEditing } }), !editing && _jsx(RegularTableRow, { ...{ value, setEditing } })] }));
13
+ };
14
+ const RegularTableRow = ({ value, setEditing }) => {
15
+ const { t } = useTranslation();
16
+ return (_jsxs(_Fragment, { children: [_jsx(TableCell, { children: value }), _jsx(TableCell, { children: _jsx("div", { className: styles.editButton, onClick: () => setEditing(true), children: _jsx(Link, { icon: _jsx(EditIcon, {}), iconAlign: "start", children: t("Edit") }) }) })] }));
17
+ };
18
+ const EditingTableRow = ({ value, setEditing, handleSave, inputType, }) => {
19
+ const { t } = useTranslation();
20
+ const { register, handleSubmit, formState: { errors }, } = useForm();
21
+ const onSubmit = (data) => {
22
+ handleSave(data.value);
23
+ setEditing(false);
24
+ };
25
+ return (_jsxs(_Fragment, { children: [_jsx(TableCell, { children: _jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormField, { ...{ inputType, value, register, errors } }), _jsxs("div", { className: styles.editButtonsContainer, children: [_jsx("button", { type: "submit", className: styles.submit, children: _jsx(Link, { icon: _jsx(CheckedIcon, {}), iconAlign: "start", children: t("Save") }) }), _jsx("div", { onClick: () => setEditing(false), children: _jsx(Link, { icon: _jsx(CloseIcon, {}), iconAlign: "start", className: styles.cancel, children: t("Cancel") }) })] })] }) }), _jsx(TableCell, {})] }));
26
+ };
27
+ const FormField = ({ inputType, value, register, errors }) => {
28
+ switch (inputType) {
29
+ case "email":
30
+ return _jsx(InputEmail, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
31
+ case "text":
32
+ return _jsx(InputText, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
33
+ }
34
+ };
@@ -0,0 +1,25 @@
1
+ .th {
2
+ width: 35%;
3
+ }
4
+
5
+ .cancel {
6
+ color: var(--denhaag-color-grey-3) !important;
7
+ }
8
+
9
+ .editButtonsContainer {
10
+ display: flex;
11
+ margin-block-start: var(--nlportal-space-block-xs);
12
+ }
13
+
14
+ .editButtonsContainer > *:not(:last-child) {
15
+ margin-inline-end: var(--nlportal-space-inline-md);
16
+ }
17
+
18
+ .submit {
19
+ all: unset;
20
+ }
21
+
22
+ .editButton {
23
+ display: flex;
24
+ justify-content: flex-end;
25
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ICheckboxProps, IReactHookFormProps } from "./types";
3
+ export declare const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps>;
@@ -0,0 +1,3 @@
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 } });
@@ -0,0 +1,4 @@
1
+ import { InputText, InputPassword, InputEmail, InputDate, InputNumber } from "./input";
2
+ import { Textarea } from "./textarea";
3
+ import { InputCheckbox } from "./checkbox";
4
+ export { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputCheckbox, Textarea };
@@ -0,0 +1,4 @@
1
+ import { InputText, InputPassword, InputEmail, InputDate, InputNumber } from "./input";
2
+ import { Textarea } from "./textarea";
3
+ import { InputCheckbox } from "./checkbox";
4
+ export { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputCheckbox, Textarea };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { IInputProps, IReactHookFormProps } from "./types";
3
+ export declare const InputPassword: React.FC<IInputProps & IReactHookFormProps>;
4
+ export declare const InputText: React.FC<IInputProps & IReactHookFormProps>;
5
+ export declare const InputEmail: React.FC<IInputProps & IReactHookFormProps>;
6
+ export declare const InputDate: React.FC<IInputProps & IReactHookFormProps>;
7
+ export declare const InputNumber: React.FC<IInputProps & IReactHookFormProps>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { TextField } from "@gemeente-denhaag/components-react";
4
+ import { ShowIcon, HideIcon } from "@gemeente-denhaag/icons";
5
+ export const InputPassword = ({ disabled, name, validation, register, errors, }) => {
6
+ const [showPassword, setShowPassword] = React.useState(false);
7
+ return (_jsx(TextField, { type: showPassword ? "text" : "password", ...{ disabled }, ...register(name, { ...validation }), invalid: errors[name], icon: _jsx("span", { onClick: () => setShowPassword(!showPassword), children: showPassword ? _jsx(HideIcon, {}) : _jsx(ShowIcon, {}) }) }));
8
+ };
9
+ export const InputText = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "text", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
10
+ export const InputEmail = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "email", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
11
+ export const InputDate = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "date", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
12
+ export const InputNumber = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "number", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ import { ITextAreaProps, IReactHookFormProps } from "./types";
3
+ export declare const Textarea: React.FC<ITextAreaProps & IReactHookFormProps>;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { TextArea } from "@gemeente-denhaag/textarea";
3
+ export const Textarea = ({ name, validation, register, errors }) => (_jsx(TextArea, { ...register(name, { ...validation }), invalid: errors[name] }));
@@ -0,0 +1,20 @@
1
+ import { FieldErrors, FieldValues, RegisterOptions, UseFormRegister } from "react-hook-form";
2
+ export interface IReactHookFormProps {
3
+ register: UseFormRegister<FieldValues>;
4
+ errors: FieldErrors;
5
+ validation?: Omit<RegisterOptions<FieldValues, any>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
6
+ }
7
+ export interface IInputProps {
8
+ name: string;
9
+ disabled?: boolean;
10
+ defaultValue?: string;
11
+ }
12
+ export interface ITextAreaProps {
13
+ name: string;
14
+ disabled?: boolean;
15
+ defaultValue?: string;
16
+ }
17
+ export interface ICheckboxProps {
18
+ label: string;
19
+ name: string;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ interface ImageDividerProps {
3
+ image: string;
4
+ layoutClassName: string;
5
+ }
6
+ export declare const ImageDivider: React.FC<ImageDividerProps>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import * as styles from "./imageDivider.module.css";
4
+ export const ImageDivider = ({ image, layoutClassName }) => {
5
+ return _jsx("img", { src: image, className: clsx(styles.divider, layoutClassName) });
6
+ };
@@ -0,0 +1,5 @@
1
+ .divider {
2
+ display: block;
3
+ object-fit: cover;
4
+ width: 100%;
5
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ interface LogoProps {
3
+ layoutClassName: string;
4
+ href?: string;
5
+ }
6
+ export declare const AuthenticatedLogo: React.FC<LogoProps>;
7
+ export declare const UnauthenticatedLogo: React.FC<LogoProps>;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { Link } from "gatsby";
4
+ import * as styles from "./Logo.module.css";
5
+ export const AuthenticatedLogo = ({ layoutClassName, href }) => {
6
+ return (_jsx(Link, { className: styles.logoContainer, to: href ?? "#", children: _jsx("div", { className: clsx(styles.authenticatedLogo, styles.logo, layoutClassName) }) }));
7
+ };
8
+ export const UnauthenticatedLogo = ({ layoutClassName, href }) => {
9
+ return (_jsx(Link, { className: styles.logoContainer, to: href ?? "#", children: _jsx("div", { className: clsx(styles.unauthenticatedLogo, styles.logo, layoutClassName) }) }));
10
+ };
@@ -0,0 +1,15 @@
1
+ .logoContainer {
2
+ height: 100%;
3
+ }
4
+
5
+ .logo {
6
+ background-size: 100% 100%;
7
+ }
8
+
9
+ .authenticatedLogo {
10
+ background-image: var(--conduction-authenticated-logo-background);
11
+ }
12
+
13
+ .unauthenticatedLogo {
14
+ background-image: var(--conduction-unauthenticated-logo-background);
15
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ export declare const MessageForm: React.FC;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useForm } from "react-hook-form";
3
+ import { Button, FormField, FormFieldInput, FormFieldLabel } from "@gemeente-denhaag/components-react";
4
+ import { useTranslation } from "react-i18next";
5
+ import { Textarea } from "../formFields";
6
+ export const MessageForm = () => {
7
+ const { t } = useTranslation();
8
+ const { register, handleSubmit, formState: { errors }, } = useForm();
9
+ //the empty onSubmit is dependend on an API to function. This API is not yet implemented
10
+ const onSubmit = async () => { };
11
+ return (_jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormField, { children: _jsxs(FormFieldInput, { children: [_jsx(FormFieldLabel, { children: t("Message") }), _jsx(Textarea, { ...{ register, errors }, name: "message", validation: { required: true } })] }) }), _jsx(Button, { size: "large", type: "submit", children: t("Send") })] }));
12
+ };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ export interface IMessageTableItem {
3
+ organisation: string;
4
+ date: Date;
5
+ id: string;
6
+ }
7
+ interface MessagesTableProps {
8
+ messages: IMessageTableItem[];
9
+ }
10
+ export declare const MessagesTable: React.FC<MessagesTableProps>;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./MessagesTable.module.css";
3
+ import { Link } from "@gemeente-denhaag/components-react";
4
+ import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
5
+ import { useTranslation } from "react-i18next";
6
+ import { ArrowRightIcon } from "@gemeente-denhaag/icons";
7
+ import { navigate } from "gatsby";
8
+ export const MessagesTable = ({ messages }) => {
9
+ const { t } = useTranslation();
10
+ return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Organisation") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), messages.map(({ organisation, date, id }) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: organisation }), _jsx(TableCell, { children: date }), _jsx(TableCell, { onClick: () => navigate(`/my-messages/${id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View message") }) })] }, id)))] }) }));
11
+ };
@@ -0,0 +1,4 @@
1
+ .contentRow > :last-child {
2
+ display: flex;
3
+ justify-content: flex-end;
4
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export interface MetaIconProps {
3
+ icon: JSX.Element;
4
+ label: string;
5
+ value: string;
6
+ }
7
+ export declare const MetaIcon: React.FC<MetaIconProps>;
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./MetaIcon.module.css";
3
+ export const MetaIcon = ({ icon, label, value }) => (_jsxs("div", { className: styles.container, children: [_jsx("span", { className: styles.icon, children: icon }), _jsx("span", { children: label }), _jsx("span", { className: styles.value, children: value })] }));
@@ -0,0 +1,17 @@
1
+ .container {
2
+ display: flex;
3
+ align-items: center;
4
+ flex-direction: column;
5
+ }
6
+
7
+ .container > *:not(:last-child) {
8
+ margin-block-end: var(--nlportal-space-block-xs);
9
+ }
10
+
11
+ .icon {
12
+ color: var(--nlportal-meta-icon-color);
13
+ }
14
+
15
+ .value {
16
+ font-weight: var(--nlportal-meta-icon-font-weight-bold);
17
+ }
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface PrivateRouteProps {
3
+ isLoggedIn?: boolean;
4
+ }
5
+ export declare const PrivateRoute: React.FC<PrivateRouteProps>;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { navigate } from "gatsby";
4
+ export const PrivateRoute = ({ children, isLoggedIn }) => {
5
+ const [authenticated, setAuthenticated] = React.useState(false);
6
+ React.useEffect(() => {
7
+ if (!isLoggedIn && window.location.pathname !== "/login") {
8
+ navigate("/login");
9
+ }
10
+ isLoggedIn && setAuthenticated(true);
11
+ }, [isLoggedIn]);
12
+ if (!authenticated)
13
+ return _jsx(_Fragment, {});
14
+ return _jsx(_Fragment, { children: children });
15
+ };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ interface IStatusStep {
3
+ title: string;
4
+ checked?: boolean;
5
+ current?: boolean;
6
+ expanded?: boolean;
7
+ subSteps?: string[];
8
+ }
9
+ interface StatusStepsProps {
10
+ steps: IStatusStep[];
11
+ }
12
+ export declare const StatusSteps: React.FC<StatusStepsProps>;
13
+ export {};
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Step, StepExpandedIcon, StepHeader, StepHeading, StepList, StepMarker, StepSection, SubStep, SubStepHeading, SubStepList, SubStepMarker, } from "@gemeente-denhaag/process-steps";
3
+ export const StatusSteps = ({ steps }) => {
4
+ return (_jsx(StepList, { children: steps.map(({ title, checked, current, expanded, subSteps }, idx) => (_jsxs(Step, { ...{ checked, current, expanded }, children: [_jsx(StepSection, { children: _jsxs(StepHeader, { children: [_jsx(StepMarker, { children: idx + 1 }), _jsx(StepHeading, { children: title }), subSteps && _jsx(StepExpandedIcon, {})] }) }), subSteps && (_jsx(SubStepList, { children: subSteps.map((subStep) => (_jsxs(SubStep, { children: [_jsx(SubStepMarker, {}), _jsx(SubStepHeading, { children: subStep })] }, idx))) }))] }, idx))) }));
5
+ };
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export interface ITopNavItem {
3
+ label: string;
4
+ href: string;
5
+ icon?: JSX.Element;
6
+ }
7
+ interface TopNavItemsProps {
8
+ items: ITopNavItem[];
9
+ }
10
+ export declare const PrimaryTopNav: React.FC<TopNavItemsProps>;
11
+ export declare const SecondaryTopNav: React.FC<TopNavItemsProps>;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as styles from "./TopNav.module.css";
3
+ import { Link } from "@gemeente-denhaag/components-react";
4
+ import { navigate } from "gatsby";
5
+ export const PrimaryTopNav = ({ items }) => {
6
+ return (_jsx("nav", { className: styles.primary, children: _jsx("ul", { className: styles.ul, children: items.map(({ label, href, icon }, idx) => (_jsx("li", { className: styles.li, onClick: () => navigate(href), children: _jsx(Link, { icon: icon, iconAlign: "start", children: label }) }, idx))) }) }));
7
+ };
8
+ export const SecondaryTopNav = ({ items }) => {
9
+ return (_jsx("nav", { children: _jsx("ul", { className: styles.ul, children: items.map(({ label, href, icon }, idx) => (_jsx("li", { className: styles.li, onClick: () => navigate(href), children: _jsx(Link, { icon: icon, iconAlign: "start", children: label }) }, idx))) }) }));
10
+ };
@@ -0,0 +1,22 @@
1
+ .ul {
2
+ display: flex;
3
+ }
4
+
5
+ .ul > * {
6
+ flex: 1;
7
+ }
8
+
9
+ .li {
10
+ list-style-type: none;
11
+ padding-block-start: var(--conduction-navbar-padding);
12
+ padding-block-end: var(--conduction-navbar-padding);
13
+ }
14
+
15
+ .li > * {
16
+ text-decoration: none;
17
+ color: var(--conduction-navbar-color);
18
+ }
19
+
20
+ .primary {
21
+ font-weight: bold;
22
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
2
+ import { CasesTable } from "./components/casesTable/CasesTable";
3
+ import { Container } from "./components/container/Container";
4
+ import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
+ import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
6
+ import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox } from "./components/formFields";
7
+ import { ImageDivider } from "./components/imageDivider/ImageDivider";
8
+ import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
9
+ import { MessageForm } from "./components/messageForm/MessageForm";
10
+ import { MessagesTable } from "./components/messagesTable/MessagesTable";
11
+ import { MetaIcon } from "./components/metaIcon/MetaIcon";
12
+ import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
13
+ import { StatusSteps } from "./components/statusSteps/StatusSteps";
14
+ import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
15
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, CasesTable, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MessageForm, MessagesTable, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, };
package/lib/index.js ADDED
@@ -0,0 +1,15 @@
1
+ import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
2
+ import { CasesTable } from "./components/casesTable/CasesTable";
3
+ import { Container } from "./components/container/Container";
4
+ import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
+ import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
6
+ import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, } from "./components/formFields";
7
+ import { ImageDivider } from "./components/imageDivider/ImageDivider";
8
+ import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
9
+ import { MessageForm } from "./components/messageForm/MessageForm";
10
+ import { MessagesTable } from "./components/messagesTable/MessagesTable";
11
+ import { MetaIcon } from "./components/metaIcon/MetaIcon";
12
+ import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
13
+ import { StatusSteps } from "./components/statusSteps/StatusSteps";
14
+ import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
15
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, CasesTable, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MessageForm, MessagesTable, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@conduction/components",
3
+ "version": "1.0.2",
4
+ "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/ConductionNL/conduction-components.git"
13
+ },
14
+ "keywords": ["React", "Gatsby", "Conduction", "Components"],
15
+ "author": "Conduction B.V.",
16
+ "license": "ISC",
17
+ "bugs": {
18
+ "url": "https://github.com/ConductionNL/conduction-components/issues"
19
+ },
20
+ "homepage": "https://github.com/ConductionNL/conduction-components#readme",
21
+ "dependencies": {
22
+ "@fortawesome/fontawesome-svg-core": "^6.1.1",
23
+ "@fortawesome/free-solid-svg-icons": "^6.1.1",
24
+ "@fortawesome/react-fontawesome": "^0.1.18",
25
+ "@gemeente-denhaag/components-react": "^0.1.1-alpha.143",
26
+ "@gemeente-denhaag/design-tokens-components": "^0.2.3-alpha.178",
27
+ "@gemeente-denhaag/form-field": "^0.1.1-alpha.67",
28
+ "@gemeente-denhaag/process-steps": "^0.1.0-alpha.18",
29
+ "@gemeente-denhaag/sidenav": "^0.1.0-alpha.1",
30
+ "@gemeente-denhaag/table": "^0.1.1-alpha.87",
31
+ "@gemeente-denhaag/textarea": "^0.1.1-alpha.65",
32
+ "axios": "^0.25.0",
33
+ "clsx": "^1.1.1",
34
+ "dateformat": "^5.0.3",
35
+ "gatsby": "^4.11.1",
36
+ "gatsby-plugin-breadcrumb": "^12.3.1",
37
+ "gatsby-plugin-layout": "^3.11.0",
38
+ "i18next": "^21.6.16",
39
+ "jwt-decode": "^3.1.2",
40
+ "lodash": "^4.17.21",
41
+ "react": "^17.0.1",
42
+ "react-dom": "^17.0.1",
43
+ "react-hook-form": "^7.29.0",
44
+ "react-i18next": "^11.16.6",
45
+ "react-loading-skeleton": "^3.1.0",
46
+ "react-query": "^3.34.19"
47
+ },
48
+ "devDependencies": {
49
+ "@types/dateformat": "^5.0.0",
50
+ "@types/node": "^17.0.23",
51
+ "@types/react": "^17.0.43",
52
+ "@types/react-dom": "^17.0.14",
53
+ "tsc-hooks": "^1.1.1",
54
+ "typescript": "^4.6.3"
55
+ }
56
+ }
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./HorizontalImageCard.module.css";
3
+ import clsx from "clsx";
4
+ import { Link } from "@gemeente-denhaag/components-react";
5
+ import { navigate } from "gatsby";
6
+ import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
7
+ export const HorizontalImageCard = ({ title, layoutClassName, external, link, iconOrImage, }) => {
8
+ return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), onClick: () => navigate(link.href), children: [_jsx("div", { className: styles.imageOrIconContainer, children: iconOrImage }), _jsxs("div", { className: styles.link, children: [_jsx("div", { className: styles.title, children: title }), _jsx(Link, { icon: external ? _jsx(ExternalLinkIcon, {}) : _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label })] })] }));
9
+ };
@@ -0,0 +1,26 @@
1
+ .container {
2
+ display: flex;
3
+ align-items: center;
4
+ cursor: pointer;
5
+ background-color: var(--denhaag-color-grey-1);
6
+ border-radius: var(--nlportal-border-radius);
7
+ }
8
+
9
+ .link {
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+
14
+ .imageOrIconContainer > :first-child {
15
+ width: var(--conduction-horizontal-image-card-icon-size);
16
+ height: var(--conduction-horizontal-image-card-icon-size);
17
+
18
+ padding-inline-start: var(--nlportal-space-inline-md);
19
+ padding-inline-end: var(--nlportal-space-inline-md);
20
+ padding-block-start: var(--nlportal-space-block-md);
21
+ padding-block-end: var(--nlportal-space-block-md);
22
+ }
23
+
24
+ .title {
25
+ font-size: var(--conduction-horizontal-image-card-font-size);
26
+ }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import * as styles from "./HorizontalImageCard.module.css";
3
+ import clsx from "clsx";
4
+ import { Link } from "@gemeente-denhaag/components-react";
5
+ import { navigate } from "gatsby";
6
+ import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
7
+
8
+ interface HorizontalImageCardProps {
9
+ iconOrImage: JSX.Element;
10
+ title: string;
11
+ link: {
12
+ label: string;
13
+ href: string;
14
+ };
15
+ layoutClassName?: string;
16
+ external?: boolean;
17
+ }
18
+
19
+ export const HorizontalImageCard: React.FC<HorizontalImageCardProps> = ({
20
+ title,
21
+ layoutClassName,
22
+ external,
23
+ link,
24
+ iconOrImage,
25
+ }) => {
26
+ return (
27
+ <div className={clsx(styles.container, [layoutClassName && layoutClassName])} onClick={() => navigate(link.href)}>
28
+ <div className={styles.imageOrIconContainer}>{iconOrImage}</div>
29
+ <div className={styles.link}>
30
+ <div className={styles.title}>{title}</div>
31
+ <Link icon={external ? <ExternalLinkIcon /> : <ArrowRightIcon />} iconAlign="start">
32
+ {link.label}
33
+ </Link>
34
+ </div>
35
+ </div>
36
+ );
37
+ };
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Divider, Link } from "@gemeente-denhaag/components-react";
3
+ import { navigate } from "gatsby";
4
+ import * as styles from "./RichContentCard.module.css";
5
+ import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
6
+ export const RichContentCard = ({ link, labelsWithIcon, tags, contentLinks, linkIsExternal, }) => {
7
+ return (_jsxs("div", { className: styles.container, children: [_jsx("div", { className: styles.link, onClick: () => navigate(link.href), children: _jsx(Link, { icon: linkIsExternal ? _jsx(ExternalLinkIcon, {}) : _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label }) }), _jsx("div", { className: styles.labelsWithIcon, children: labelsWithIcon.map(({ label, icon }) => (_jsx(LabelWithIcon, { ...{ label, icon } }))) }), _jsx("div", { className: styles.tags, children: tags.map((tag) => (_jsx(Tag, { ...{ tag } }))) }), contentLinks && (_jsxs("div", { className: styles.contentLinks, children: [_jsx(Divider, {}), contentLinks.map(({ title, subTitle, href }) => (_jsx(ContentLink, { ...{ title, subTitle, href } })))] }))] }));
8
+ };
9
+ const LabelWithIcon = ({ label, icon }) => {
10
+ return (_jsxs("div", { className: styles.labelWithIcon, children: [_jsx("span", { className: styles.labelWithIcon_icon, children: icon }), _jsx("span", { className: styles.labelWithIcon_label, children: label })] }));
11
+ };
12
+ const Tag = ({ tag }) => {
13
+ return _jsx("span", { className: styles.tag, children: tag });
14
+ };
15
+ const ContentLink = ({ title, subTitle, href }) => {
16
+ return (_jsxs(Link, { className: styles.contentLink, children: [_jsxs("div", { className: styles.contentLink_content, children: [_jsx("span", { className: styles.contentLink_title, children: title }), _jsx("span", { className: styles.contentLink_subTitle, children: subTitle })] }), _jsx("div", { children: _jsx(ArrowRightIcon, {}) })] }));
17
+ };