@conduction/components 1.0.2 → 1.0.6

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 (59) hide show
  1. package/.github/workflows/npm-publish.yml +39 -0
  2. package/lib/components/card/RichContentCard/RichContentCard.js +2 -4
  3. package/lib/components/card/RichContentCard/RichContentCard.module.css +0 -11
  4. package/lib/components/card/detailsCard/DetailsCard.d.ts +14 -0
  5. package/lib/components/card/detailsCard/DetailsCard.js +10 -0
  6. package/lib/components/card/detailsCard/DetailsCard.module.css +48 -0
  7. package/lib/components/card/downloadCard/DownloadCard.d.ts +1 -0
  8. package/lib/components/card/downloadCard/DownloadCard.js +2 -4
  9. package/lib/components/card/index.d.ts +4 -3
  10. package/lib/components/card/index.js +4 -3
  11. package/lib/components/editableTableRow/EditableTableRow.d.ts +3 -0
  12. package/lib/components/editableTableRow/EditableTableRow.js +6 -9
  13. package/lib/components/formFields/checkbox.d.ts +5 -1
  14. package/lib/components/formFields/input.d.ts +6 -1
  15. package/lib/components/formFields/textarea.d.ts +6 -1
  16. package/lib/components/formFields/types.d.ts +0 -14
  17. package/lib/components/pagination/Pagination.d.ts +2 -0
  18. package/lib/components/pagination/Pagination.js +6 -0
  19. package/lib/components/tag/Tag.d.ts +6 -0
  20. package/lib/components/tag/Tag.js +3 -0
  21. package/lib/components/tag/Tag.module.css +9 -0
  22. package/lib/index.d.ts +2 -5
  23. package/lib/index.js +2 -5
  24. package/package.json +2 -17
  25. package/src/components/card/detailsCard/DetailsCard.module.css +48 -0
  26. package/src/components/card/detailsCard/DetailsCard.tsx +56 -0
  27. package/src/components/card/downloadCard/DownloadCard.tsx +4 -6
  28. package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js +0 -0
  29. package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.module.css +0 -0
  30. package/src/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.tsx +0 -0
  31. package/src/components/card/index.tsx +4 -3
  32. package/src/components/card/{RichContentCard → richContentCard}/RichContentCard.js +0 -0
  33. package/src/components/card/{RichContentCard → richContentCard}/RichContentCard.module.css +0 -11
  34. package/src/components/card/{RichContentCard → richContentCard}/RichContentCard.tsx +3 -10
  35. package/src/components/editableTableRow/EditableTableRow.tsx +21 -13
  36. package/src/components/formFields/checkbox.tsx +6 -1
  37. package/src/components/formFields/input.tsx +7 -1
  38. package/src/components/formFields/textarea.tsx +7 -1
  39. package/src/components/formFields/types.ts +0 -17
  40. package/src/components/tag/Tag.module.css +9 -0
  41. package/src/components/tag/Tag.tsx +8 -0
  42. package/src/custom.d.ts +0 -1
  43. package/src/index.ts +10 -7
  44. package/lib/components/casesTable/CasesTable.d.ts +0 -6
  45. package/lib/components/casesTable/CasesTable.js +0 -11
  46. package/lib/components/casesTable/CasesTable.module.css +0 -4
  47. package/lib/components/messageForm/MessageForm.d.ts +0 -2
  48. package/lib/components/messageForm/MessageForm.js +0 -12
  49. package/lib/components/messagesTable/MessagesTable.d.ts +0 -11
  50. package/lib/components/messagesTable/MessagesTable.js +0 -11
  51. package/lib/components/messagesTable/MessagesTable.module.css +0 -4
  52. package/src/components/casesTable/CasesTable.js +0 -11
  53. package/src/components/casesTable/CasesTable.module.css +0 -4
  54. package/src/components/casesTable/CasesTable.tsx +0 -41
  55. package/src/components/messageForm/MessageForm.js +0 -12
  56. package/src/components/messageForm/MessageForm.tsx +0 -32
  57. package/src/components/messagesTable/MessagesTable.js +0 -11
  58. package/src/components/messagesTable/MessagesTable.module.css +0 -4
  59. package/src/components/messagesTable/MessagesTable.tsx +0 -45
@@ -0,0 +1,39 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - development
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - uses: actions/setup-node@v3
17
+ with:
18
+ node-version: 16
19
+
20
+ publish-npm:
21
+ needs: build
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - uses: actions/setup-node@v3
26
+ with:
27
+ node-version: 16
28
+ registry-url: https://registry.npmjs.org/
29
+ - run: |
30
+ git --version
31
+ git config user.name "GitHub Version patch"
32
+ git config user.email "<>"
33
+ git checkout development
34
+ git clean -f -n
35
+ - run: npm install
36
+ - run: npm version patch
37
+ - run: npm publish
38
+ env:
39
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -3,15 +3,13 @@ import { Divider, Link } from "@gemeente-denhaag/components-react";
3
3
  import { navigate } from "gatsby";
4
4
  import * as styles from "./RichContentCard.module.css";
5
5
  import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
6
+ import { Tag } from "../../tag/Tag";
6
7
  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
+ 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, idx) => (_jsx(Tag, { ...{ tag } }, idx))) }), contentLinks && (_jsxs("div", { className: styles.contentLinks, children: [_jsx(Divider, {}), contentLinks.map(({ title, subTitle, href }) => (_jsx(ContentLink, { ...{ title, subTitle, href } })))] }))] }));
8
9
  };
9
10
  const LabelWithIcon = ({ label, icon }) => {
10
11
  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
  };
12
- const Tag = ({ tag }) => {
13
- return _jsx("span", { className: styles.tag, children: tag });
14
- };
15
13
  const ContentLink = ({ title, subTitle, href }) => {
16
14
  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
15
  };
@@ -56,17 +56,6 @@
56
56
  font-size: var(--conduction-rich-card-label-with-icon-label-size);
57
57
  }
58
58
 
59
- /* Component: Tag */
60
- .tag {
61
- font-size: var(--conduction-tag-font-size);
62
- background-color: var(--denhaag-color-grey-1);
63
- border-radius: var(--nlportal-document-border-radius);
64
- padding-inline-start: var(--nlportal-space-inline-xs);
65
- padding-inline-end: var(--nlportal-space-inline-xs);
66
- padding-block-start: var(--nlportal-space-block-xs);
67
- padding-block-end: var(--nlportal-space-block-xs);
68
- }
69
-
70
59
  /* Content Link */
71
60
  .contentLink {
72
61
  display: flex;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ interface DetailsCardProps {
3
+ title: string;
4
+ introduction: string;
5
+ link: {
6
+ href: string;
7
+ label: string;
8
+ };
9
+ tags?: string[];
10
+ subHeader?: string;
11
+ layoutClassName?: string;
12
+ }
13
+ export declare const DetailsCard: React.FC<DetailsCardProps>;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./DetailsCard.module.css";
3
+ import clsx from "clsx";
4
+ import { Link } from "@gemeente-denhaag/components-react";
5
+ import { navigate } from "gatsby";
6
+ import { ArrowRightIcon } from "@gemeente-denhaag/icons";
7
+ import { Tag } from "../../tag/Tag";
8
+ export const DetailsCard = ({ title, subHeader, introduction, link, tags, layoutClassName, }) => {
9
+ return (_jsx("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), onClick: () => navigate(link.href), children: _jsxs("div", { className: styles.content, children: [_jsxs("div", { children: [_jsx("div", { className: styles.title, children: title }), _jsx("span", { className: styles.subHeader, children: subHeader })] }), tags && (_jsx("div", { className: styles.tags, children: tags.map((tag, idx) => (_jsx(Tag, { ...{ tag } }, idx))) })), _jsx("div", { className: styles.introduction, children: introduction }), _jsx("div", { className: styles.link, children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: link.label }) })] }) }));
10
+ };
@@ -0,0 +1,48 @@
1
+ .container {
2
+ cursor: pointer;
3
+ overflow: hidden;
4
+ border-radius: var(--nlportal-document-border-radius);
5
+ }
6
+
7
+ .content {
8
+ display: flex;
9
+ flex-direction: column;
10
+ padding-inline-start: var(--nlportal-space-inline-lg);
11
+ padding-inline-end: var(--nlportal-space-inline-lg);
12
+ padding-block-start: var(--nlportal-space-block-lg);
13
+ padding-block-end: var(--nlportal-space-block-lg);
14
+ border: var(--nlportal-document-border, 1px solid);
15
+ }
16
+
17
+ .content > *:not(:last-child) {
18
+ margin-block-end: var(--nlportal-space-block-md);
19
+ }
20
+
21
+ .title {
22
+ font-size: var(--denhaag-typography-scale-xl-font-size);
23
+ font-weight: var(--conduction-image-and-details-card-title-font-weight);
24
+ }
25
+
26
+ .subHeader {
27
+ color: var(--denhaag-color-grey-3);
28
+ font-size: var(--denhaag-typography-scale-s-font-size);
29
+ }
30
+
31
+ .tags > *:not(:last-child) {
32
+ margin-inline-end: var(--nlportal-space-inline-md);
33
+ }
34
+
35
+ .introduction {
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ display: -webkit-box;
39
+ -webkit-line-clamp: var(
40
+ --conduction-image-and-details-card-introduction-lines-clamp
41
+ );
42
+ -webkit-box-orient: vertical;
43
+ }
44
+
45
+ .link {
46
+ display: flex;
47
+ justify-content: flex-end;
48
+ }
@@ -3,6 +3,7 @@ interface DownloadCardProps {
3
3
  icon: JSX.Element;
4
4
  label: string;
5
5
  sizeKb: string;
6
+ downloadLabel: string;
6
7
  layoutClassName?: string;
7
8
  }
8
9
  export declare const DownloadCard: React.FC<DownloadCardProps>;
@@ -3,8 +3,6 @@ import * as styles from "./DownloadCard.module.css";
3
3
  import { DownloadIcon } from "@gemeente-denhaag/icons";
4
4
  import { Link } from "@gemeente-denhaag/components-react";
5
5
  import clsx from "clsx";
6
- import { useTranslation } from "react-i18next";
7
- export const DownloadCard = ({ icon, label, sizeKb, layoutClassName }) => {
8
- const { t } = useTranslation();
9
- return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { children: [label, " (", sizeKb, "kb)"] })] }), _jsx(Link, { icon: _jsx(DownloadIcon, {}), iconAlign: "start", children: t("Download") })] }));
6
+ export const DownloadCard = ({ icon, label, sizeKb, layoutClassName, downloadLabel }) => {
7
+ return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { children: [label, " (", sizeKb, "kb)"] })] }), _jsx(Link, { icon: _jsx(DownloadIcon, {}), iconAlign: "start", children: downloadLabel })] }));
10
8
  };
@@ -1,5 +1,6 @@
1
1
  import { DownloadCard } from "./downloadCard/DownloadCard";
2
- import { HorizontalImageCard } from "./HorizontalImageCard/HorizontalImageCard";
2
+ import { HorizontalImageCard } from "./horizontalImageCard/HorizontalImageCard";
3
3
  import { ImageAndDetailsCard } from "./imageAndDetailsCard/ImageAndDetailsCard";
4
- import { RichContentCard } from "./RichContentCard/RichContentCard";
5
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard };
4
+ import { RichContentCard } from "./richContentCard/RichContentCard";
5
+ import { DetailsCard } from "./detailsCard/DetailsCard";
6
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard };
@@ -1,5 +1,6 @@
1
1
  import { DownloadCard } from "./downloadCard/DownloadCard";
2
- import { HorizontalImageCard } from "./HorizontalImageCard/HorizontalImageCard";
2
+ import { HorizontalImageCard } from "./horizontalImageCard/HorizontalImageCard";
3
3
  import { ImageAndDetailsCard } from "./imageAndDetailsCard/ImageAndDetailsCard";
4
- import { RichContentCard } from "./RichContentCard/RichContentCard";
5
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard };
4
+ import { RichContentCard } from "./richContentCard/RichContentCard";
5
+ import { DetailsCard } from "./detailsCard/DetailsCard";
6
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard };
@@ -5,6 +5,9 @@ interface InputTypes {
5
5
  interface EditableTableRowProps {
6
6
  thead: string;
7
7
  value: string;
8
+ saveLabel: string;
9
+ cancelLabel: string;
10
+ editLabel: string;
8
11
  handleSave: (value: any) => void;
9
12
  }
10
13
  export declare const EditableTableRow: React.FC<EditableTableRowProps & InputTypes>;
@@ -2,27 +2,24 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
3
3
  import * as styles from "./EditableTableRow.module.css";
4
4
  import * as React from "react";
5
- import { useTranslation } from "react-i18next";
6
5
  import { Link } from "@gemeente-denhaag/components-react";
7
6
  import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
8
7
  import { useForm } from "react-hook-form";
9
8
  import { InputEmail, InputText } from "../formFields";
10
- export const EditableTableRow = ({ thead, value, inputType, handleSave, }) => {
9
+ export const EditableTableRow = ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }) => {
11
10
  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 } })] }));
11
+ return (_jsxs(TableRow, { children: [_jsx(TableHeader, { className: styles.th, children: thead }), editing && _jsx(EditingTableRow, { ...{ value, inputType, handleSave, setEditing, saveLabel, cancelLabel } }), !editing && _jsx(RegularTableRow, { ...{ value, setEditing, editLabel } })] }));
13
12
  };
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") }) }) })] }));
13
+ const RegularTableRow = ({ value, editLabel, setEditing }) => {
14
+ 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: editLabel }) }) })] }));
17
15
  };
18
- const EditingTableRow = ({ value, setEditing, handleSave, inputType, }) => {
19
- const { t } = useTranslation();
16
+ const EditingTableRow = ({ value, setEditing, handleSave, inputType, saveLabel, cancelLabel, }) => {
20
17
  const { register, handleSubmit, formState: { errors }, } = useForm();
21
18
  const onSubmit = (data) => {
22
19
  handleSave(data.value);
23
20
  setEditing(false);
24
21
  };
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, {})] }));
22
+ 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: saveLabel }) }), _jsx("div", { onClick: () => setEditing(false), children: _jsx(Link, { icon: _jsx(CloseIcon, {}), iconAlign: "start", className: styles.cancel, children: cancelLabel }) })] })] }) }), _jsx(TableCell, {})] }));
26
23
  };
27
24
  const FormField = ({ inputType, value, register, errors }) => {
28
25
  switch (inputType) {
@@ -1,3 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ICheckboxProps, IReactHookFormProps } from "./types";
2
+ import { IReactHookFormProps } from "./types";
3
+ export interface ICheckboxProps {
4
+ label: string;
5
+ name: string;
6
+ }
3
7
  export declare const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps>;
@@ -1,5 +1,10 @@
1
1
  import * as React from "react";
2
- import { IInputProps, IReactHookFormProps } from "./types";
2
+ import { IReactHookFormProps } from "./types";
3
+ export interface IInputProps {
4
+ name: string;
5
+ disabled?: boolean;
6
+ defaultValue?: string;
7
+ }
3
8
  export declare const InputPassword: React.FC<IInputProps & IReactHookFormProps>;
4
9
  export declare const InputText: React.FC<IInputProps & IReactHookFormProps>;
5
10
  export declare const InputEmail: React.FC<IInputProps & IReactHookFormProps>;
@@ -1,3 +1,8 @@
1
1
  import * as React from "react";
2
- import { ITextAreaProps, IReactHookFormProps } from "./types";
2
+ import { IReactHookFormProps } from "./types";
3
+ export interface ITextAreaProps {
4
+ name: string;
5
+ disabled?: boolean;
6
+ defaultValue?: string;
7
+ }
3
8
  export declare const Textarea: React.FC<ITextAreaProps & IReactHookFormProps>;
@@ -4,17 +4,3 @@ export interface IReactHookFormProps {
4
4
  errors: FieldErrors;
5
5
  validation?: Omit<RegisterOptions<FieldValues, any>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
6
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,2 @@
1
+ import React from "react";
2
+ export declare const Pagination: React.FC;
@@ -0,0 +1,6 @@
1
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from "react";
3
+ export const Pagination = () => {
4
+ const [count, setCount] = React.useState(0);
5
+ return (_jsxs(_Fragment, { children: ["Pagination", _jsxs("div", { children: ["Count: ", count] }), _jsx("button", { onClick: () => setCount(count + 1), children: "click me" })] }));
6
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ interface TagProps {
3
+ tag: string;
4
+ }
5
+ export declare const Tag: React.FC<TagProps>;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as styles from "./Tag.module.css";
3
+ export const Tag = ({ tag }) => _jsx("span", { className: styles.tag, children: tag });
@@ -0,0 +1,9 @@
1
+ .tag {
2
+ font-size: var(--conduction-tag-font-size);
3
+ background-color: var(--denhaag-color-grey-1);
4
+ border-radius: var(--nlportal-document-border-radius);
5
+ padding-inline-start: var(--nlportal-space-inline-xs);
6
+ padding-inline-end: var(--nlportal-space-inline-xs);
7
+ padding-block-start: var(--nlportal-space-block-xs);
8
+ padding-block-end: var(--nlportal-space-block-xs);
9
+ }
package/lib/index.d.ts CHANGED
@@ -1,15 +1,12 @@
1
- import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
2
- import { CasesTable } from "./components/casesTable/CasesTable";
1
+ import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard } from "./components/card";
3
2
  import { Container } from "./components/container/Container";
4
3
  import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
4
  import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
6
5
  import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox } from "./components/formFields";
7
6
  import { ImageDivider } from "./components/imageDivider/ImageDivider";
8
7
  import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
9
- import { MessageForm } from "./components/messageForm/MessageForm";
10
- import { MessagesTable } from "./components/messagesTable/MessagesTable";
11
8
  import { MetaIcon } from "./components/metaIcon/MetaIcon";
12
9
  import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
13
10
  import { StatusSteps } from "./components/statusSteps/StatusSteps";
14
11
  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, };
12
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, };
package/lib/index.js CHANGED
@@ -1,15 +1,12 @@
1
- import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
2
- import { CasesTable } from "./components/casesTable/CasesTable";
1
+ import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, } from "./components/card";
3
2
  import { Container } from "./components/container/Container";
4
3
  import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
4
  import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
6
5
  import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, } from "./components/formFields";
7
6
  import { ImageDivider } from "./components/imageDivider/ImageDivider";
8
7
  import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
9
- import { MessageForm } from "./components/messageForm/MessageForm";
10
- import { MessagesTable } from "./components/messagesTable/MessagesTable";
11
8
  import { MetaIcon } from "./components/metaIcon/MetaIcon";
12
9
  import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
13
10
  import { StatusSteps } from "./components/statusSteps/StatusSteps";
14
11
  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, };
12
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -19,9 +19,6 @@
19
19
  },
20
20
  "homepage": "https://github.com/ConductionNL/conduction-components#readme",
21
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
22
  "@gemeente-denhaag/components-react": "^0.1.1-alpha.143",
26
23
  "@gemeente-denhaag/design-tokens-components": "^0.2.3-alpha.178",
27
24
  "@gemeente-denhaag/form-field": "^0.1.1-alpha.67",
@@ -29,24 +26,12 @@
29
26
  "@gemeente-denhaag/sidenav": "^0.1.0-alpha.1",
30
27
  "@gemeente-denhaag/table": "^0.1.1-alpha.87",
31
28
  "@gemeente-denhaag/textarea": "^0.1.1-alpha.65",
32
- "axios": "^0.25.0",
33
29
  "clsx": "^1.1.1",
34
- "dateformat": "^5.0.3",
35
30
  "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
31
  "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"
32
+ "react-hook-form": "^7.29.0"
47
33
  },
48
34
  "devDependencies": {
49
- "@types/dateformat": "^5.0.0",
50
35
  "@types/node": "^17.0.23",
51
36
  "@types/react": "^17.0.43",
52
37
  "@types/react-dom": "^17.0.14",
@@ -0,0 +1,48 @@
1
+ .container {
2
+ cursor: pointer;
3
+ overflow: hidden;
4
+ border-radius: var(--nlportal-document-border-radius);
5
+ }
6
+
7
+ .content {
8
+ display: flex;
9
+ flex-direction: column;
10
+ padding-inline-start: var(--nlportal-space-inline-lg);
11
+ padding-inline-end: var(--nlportal-space-inline-lg);
12
+ padding-block-start: var(--nlportal-space-block-lg);
13
+ padding-block-end: var(--nlportal-space-block-lg);
14
+ border: var(--nlportal-document-border, 1px solid);
15
+ }
16
+
17
+ .content > *:not(:last-child) {
18
+ margin-block-end: var(--nlportal-space-block-md);
19
+ }
20
+
21
+ .title {
22
+ font-size: var(--denhaag-typography-scale-xl-font-size);
23
+ font-weight: var(--conduction-image-and-details-card-title-font-weight);
24
+ }
25
+
26
+ .subHeader {
27
+ color: var(--denhaag-color-grey-3);
28
+ font-size: var(--denhaag-typography-scale-s-font-size);
29
+ }
30
+
31
+ .tags > *:not(:last-child) {
32
+ margin-inline-end: var(--nlportal-space-inline-md);
33
+ }
34
+
35
+ .introduction {
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ display: -webkit-box;
39
+ -webkit-line-clamp: var(
40
+ --conduction-image-and-details-card-introduction-lines-clamp
41
+ );
42
+ -webkit-box-orient: vertical;
43
+ }
44
+
45
+ .link {
46
+ display: flex;
47
+ justify-content: flex-end;
48
+ }
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import * as styles from "./DetailsCard.module.css";
3
+ import clsx from "clsx";
4
+ import { Link } from "@gemeente-denhaag/components-react";
5
+ import { navigate } from "gatsby";
6
+ import { ArrowRightIcon } from "@gemeente-denhaag/icons";
7
+ import { Tag } from "../../tag/Tag";
8
+
9
+ interface DetailsCardProps {
10
+ title: string;
11
+ introduction: string;
12
+ link: {
13
+ href: string;
14
+ label: string;
15
+ };
16
+ tags?: string[];
17
+ subHeader?: string;
18
+ layoutClassName?: string;
19
+ }
20
+
21
+ export const DetailsCard: React.FC<DetailsCardProps> = ({
22
+ title,
23
+ subHeader,
24
+ introduction,
25
+ link,
26
+ tags,
27
+ layoutClassName,
28
+ }) => {
29
+ return (
30
+ <div className={clsx(styles.container, [layoutClassName && layoutClassName])} onClick={() => navigate(link.href)}>
31
+ <div className={styles.content}>
32
+ <div>
33
+ <div className={styles.title}>{title}</div>
34
+
35
+ <span className={styles.subHeader}>{subHeader}</span>
36
+ </div>
37
+
38
+ {tags && (
39
+ <div className={styles.tags}>
40
+ {tags.map((tag, idx) => (
41
+ <Tag key={idx} {...{ tag }} />
42
+ ))}
43
+ </div>
44
+ )}
45
+
46
+ <div className={styles.introduction}>{introduction}</div>
47
+
48
+ <div className={styles.link}>
49
+ <Link icon={<ArrowRightIcon />} iconAlign="start">
50
+ {link.label}
51
+ </Link>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ );
56
+ };
@@ -3,30 +3,28 @@ import * as styles from "./DownloadCard.module.css";
3
3
  import { DownloadIcon } from "@gemeente-denhaag/icons";
4
4
  import { Link } from "@gemeente-denhaag/components-react";
5
5
  import clsx from "clsx";
6
- import { useTranslation } from "react-i18next";
7
6
 
8
7
  interface DownloadCardProps {
9
8
  icon: JSX.Element;
10
9
  label: string;
11
10
  sizeKb: string;
11
+ downloadLabel: string;
12
12
  layoutClassName?: string;
13
13
  }
14
14
 
15
- export const DownloadCard: React.FC<DownloadCardProps> = ({ icon, label, sizeKb, layoutClassName }) => {
16
- const { t } = useTranslation();
17
-
15
+ export const DownloadCard: React.FC<DownloadCardProps> = ({ icon, label, sizeKb, layoutClassName, downloadLabel }) => {
18
16
  return (
19
17
  <div className={clsx(styles.container, [layoutClassName && layoutClassName])}>
20
18
  <div className={styles.content}>
21
19
  <div className={styles.icon}>{icon}</div>
22
-
20
+
23
21
  <div>
24
22
  {label} ({sizeKb}kb)
25
23
  </div>
26
24
  </div>
27
25
 
28
26
  <Link icon={<DownloadIcon />} iconAlign="start">
29
- {t("Download")}
27
+ {downloadLabel}
30
28
  </Link>
31
29
  </div>
32
30
  );
@@ -1,6 +1,7 @@
1
1
  import { DownloadCard } from "./downloadCard/DownloadCard";
2
- import { HorizontalImageCard } from "./HorizontalImageCard/HorizontalImageCard";
2
+ import { HorizontalImageCard } from "./horizontalImageCard/HorizontalImageCard";
3
3
  import { ImageAndDetailsCard } from "./imageAndDetailsCard/ImageAndDetailsCard";
4
- import { RichContentCard } from "./RichContentCard/RichContentCard";
4
+ import { RichContentCard } from "./richContentCard/RichContentCard";
5
+ import { DetailsCard } from "./detailsCard/DetailsCard";
5
6
 
6
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard };
7
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard };
@@ -56,17 +56,6 @@
56
56
  font-size: var(--conduction-rich-card-label-with-icon-label-size);
57
57
  }
58
58
 
59
- /* Component: Tag */
60
- .tag {
61
- font-size: var(--conduction-tag-font-size);
62
- background-color: var(--denhaag-color-grey-1);
63
- border-radius: var(--nlportal-document-border-radius);
64
- padding-inline-start: var(--nlportal-space-inline-xs);
65
- padding-inline-end: var(--nlportal-space-inline-xs);
66
- padding-block-start: var(--nlportal-space-block-xs);
67
- padding-block-end: var(--nlportal-space-block-xs);
68
- }
69
-
70
59
  /* Content Link */
71
60
  .contentLink {
72
61
  display: flex;
@@ -3,6 +3,7 @@ import { navigate } from "gatsby";
3
3
  import * as React from "react";
4
4
  import * as styles from "./RichContentCard.module.css";
5
5
  import { ExternalLinkIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
6
+ import { Tag } from "../../tag/Tag";
6
7
 
7
8
  export interface RichContentCardProps {
8
9
  link: {
@@ -44,8 +45,8 @@ export const RichContentCard: React.FC<RichContentCardProps> = ({
44
45
  </div>
45
46
 
46
47
  <div className={styles.tags}>
47
- {tags.map((tag) => (
48
- <Tag {...{ tag }} />
48
+ {tags.map((tag, idx) => (
49
+ <Tag key={idx} {...{ tag }} />
49
50
  ))}
50
51
  </div>
51
52
 
@@ -75,14 +76,6 @@ const LabelWithIcon: React.FC<LabelWithIconProps> = ({ label, icon }) => {
75
76
  );
76
77
  };
77
78
 
78
- interface TagProps {
79
- tag: string;
80
- }
81
-
82
- const Tag: React.FC<TagProps> = ({ tag }) => {
83
- return <span className={styles.tag}>{tag}</span>;
84
- };
85
-
86
79
  interface ContentLinkProps {
87
80
  title: string;
88
81
  subTitle: string;
@@ -1,7 +1,6 @@
1
1
  import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
2
2
  import * as styles from "./EditableTableRow.module.css";
3
3
  import * as React from "react";
4
- import { useTranslation } from "react-i18next";
5
4
  import { Link } from "@gemeente-denhaag/components-react";
6
5
  import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
7
6
  import { FieldValues, useForm, UseFormRegister } from "react-hook-form";
@@ -14,6 +13,9 @@ interface InputTypes {
14
13
  interface EditableTableRowProps {
15
14
  thead: string;
16
15
  value: string;
16
+ saveLabel: string;
17
+ cancelLabel: string;
18
+ editLabel: string;
17
19
  handleSave: (value: any) => void;
18
20
  }
19
21
 
@@ -21,6 +23,9 @@ export const EditableTableRow: React.FC<EditableTableRowProps & InputTypes> = ({
21
23
  thead,
22
24
  value,
23
25
  inputType,
26
+ editLabel,
27
+ cancelLabel,
28
+ saveLabel,
24
29
  handleSave,
25
30
  }) => {
26
31
  const [editing, setEditing] = React.useState<boolean>(false);
@@ -29,8 +34,8 @@ export const EditableTableRow: React.FC<EditableTableRowProps & InputTypes> = ({
29
34
  <TableRow>
30
35
  <TableHeader className={styles.th}>{thead}</TableHeader>
31
36
 
32
- {editing && <EditingTableRow {...{ value, inputType, handleSave, setEditing }} />}
33
- {!editing && <RegularTableRow {...{ value, setEditing }} />}
37
+ {editing && <EditingTableRow {...{ value, inputType, handleSave, setEditing, saveLabel, cancelLabel }} />}
38
+ {!editing && <RegularTableRow {...{ value, setEditing, editLabel }} />}
34
39
  </TableRow>
35
40
  );
36
41
  };
@@ -39,14 +44,13 @@ export const EditableTableRow: React.FC<EditableTableRowProps & InputTypes> = ({
39
44
  * Specific rows based on editing (Regular: not editing & Editing: editing)
40
45
  */
41
46
 
42
- interface SpecificRowsProps {
47
+ interface RegularTableRowProps {
43
48
  value: string;
49
+ editLabel: string;
44
50
  setEditing: React.Dispatch<React.SetStateAction<boolean>>;
45
51
  }
46
52
 
47
- const RegularTableRow: React.FC<SpecificRowsProps> = ({ value, setEditing }) => {
48
- const { t } = useTranslation();
49
-
53
+ const RegularTableRow: React.FC<RegularTableRowProps> = ({ value, editLabel, setEditing }) => {
50
54
  return (
51
55
  <>
52
56
  <TableCell>{value}</TableCell>
@@ -54,7 +58,7 @@ const RegularTableRow: React.FC<SpecificRowsProps> = ({ value, setEditing }) =>
54
58
  <TableCell>
55
59
  <div className={styles.editButton} onClick={() => setEditing(true)}>
56
60
  <Link icon={<EditIcon />} iconAlign="start">
57
- {t("Edit")}
61
+ {editLabel}
58
62
  </Link>
59
63
  </div>
60
64
  </TableCell>
@@ -63,17 +67,21 @@ const RegularTableRow: React.FC<SpecificRowsProps> = ({ value, setEditing }) =>
63
67
  };
64
68
 
65
69
  interface EditingTableRowProps {
70
+ value: string;
71
+ setEditing: React.Dispatch<React.SetStateAction<boolean>>;
72
+ saveLabel: string;
73
+ cancelLabel: string;
66
74
  handleSave: (value: any) => void;
67
75
  }
68
76
 
69
- const EditingTableRow: React.FC<SpecificRowsProps & EditingTableRowProps & InputTypes> = ({
77
+ const EditingTableRow: React.FC<EditingTableRowProps & InputTypes> = ({
70
78
  value,
71
79
  setEditing,
72
80
  handleSave,
73
81
  inputType,
82
+ saveLabel,
83
+ cancelLabel,
74
84
  }) => {
75
- const { t } = useTranslation();
76
-
77
85
  const {
78
86
  register,
79
87
  handleSubmit,
@@ -94,13 +102,13 @@ const EditingTableRow: React.FC<SpecificRowsProps & EditingTableRowProps & Input
94
102
  <div className={styles.editButtonsContainer}>
95
103
  <button type="submit" className={styles.submit}>
96
104
  <Link icon={<CheckedIcon />} iconAlign="start">
97
- {t("Save")}
105
+ {saveLabel}
98
106
  </Link>
99
107
  </button>
100
108
 
101
109
  <div onClick={() => setEditing(false)}>
102
110
  <Link icon={<CloseIcon />} iconAlign="start" className={styles.cancel}>
103
- {t("Cancel")}
111
+ {cancelLabel}
104
112
  </Link>
105
113
  </div>
106
114
  </div>
@@ -1,5 +1,10 @@
1
1
  import { FormControlLabel } from "@gemeente-denhaag/components-react";
2
- import { ICheckboxProps, IReactHookFormProps } from "./types";
2
+ import { IReactHookFormProps } from "./types";
3
+
4
+ export interface ICheckboxProps {
5
+ label: string;
6
+ name: string;
7
+ }
3
8
 
4
9
  export const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps> = ({
5
10
  name,
@@ -1,7 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { TextField } from "@gemeente-denhaag/components-react";
3
3
  import { ShowIcon, HideIcon } from "@gemeente-denhaag/icons";
4
- import { IInputProps, IReactHookFormProps } from "./types";
4
+ import { IReactHookFormProps } from "./types";
5
+
6
+ export interface IInputProps {
7
+ name: string;
8
+ disabled?: boolean;
9
+ defaultValue?: string;
10
+ }
5
11
 
6
12
  export const InputPassword: React.FC<IInputProps & IReactHookFormProps> = ({
7
13
  disabled,
@@ -1,6 +1,12 @@
1
1
  import * as React from "react";
2
2
  import { TextArea } from "@gemeente-denhaag/textarea";
3
- import { ITextAreaProps, IReactHookFormProps } from "./types";
3
+ import { IReactHookFormProps } from "./types";
4
+
5
+ export interface ITextAreaProps {
6
+ name: string;
7
+ disabled?: boolean;
8
+ defaultValue?: string;
9
+ }
4
10
 
5
11
  export const Textarea: React.FC<ITextAreaProps & IReactHookFormProps> = ({ name, validation, register, errors }) => (
6
12
  <TextArea {...register(name, { ...validation })} invalid={errors[name]} />
@@ -5,20 +5,3 @@ export interface IReactHookFormProps {
5
5
  errors: FieldErrors;
6
6
  validation?: Omit<RegisterOptions<FieldValues, any>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
7
7
  }
8
-
9
- export interface IInputProps {
10
- name: string;
11
- disabled?: boolean;
12
- defaultValue?: string;
13
- }
14
-
15
- export interface ITextAreaProps {
16
- name: string;
17
- disabled?: boolean;
18
- defaultValue?: string;
19
- }
20
-
21
- export interface ICheckboxProps {
22
- label: string;
23
- name: string;
24
- }
@@ -0,0 +1,9 @@
1
+ .tag {
2
+ font-size: var(--conduction-tag-font-size);
3
+ background-color: var(--denhaag-color-grey-1);
4
+ border-radius: var(--nlportal-document-border-radius);
5
+ padding-inline-start: var(--nlportal-space-inline-xs);
6
+ padding-inline-end: var(--nlportal-space-inline-xs);
7
+ padding-block-start: var(--nlportal-space-block-xs);
8
+ padding-block-end: var(--nlportal-space-block-xs);
9
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import * as styles from "./Tag.module.css";
3
+
4
+ interface TagProps {
5
+ tag: string;
6
+ }
7
+
8
+ export const Tag: React.FC<TagProps> = ({ tag }) => <span className={styles.tag}>{tag}</span>;
package/src/custom.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  declare module "*.svg";
2
-
3
2
  declare module "*.jpg";
4
3
  declare module "*.png";
5
4
  declare module "*.module.css";
package/src/index.ts CHANGED
@@ -1,5 +1,10 @@
1
- import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
2
- import { CasesTable } from "./components/casesTable/CasesTable";
1
+ import {
2
+ DownloadCard,
3
+ HorizontalImageCard,
4
+ ImageAndDetailsCard,
5
+ RichContentCard,
6
+ DetailsCard,
7
+ } from "./components/card";
3
8
  import { Container } from "./components/container/Container";
4
9
  import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
5
10
  import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
@@ -14,19 +19,18 @@ import {
14
19
  } from "./components/formFields";
15
20
  import { ImageDivider } from "./components/imageDivider/ImageDivider";
16
21
  import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
17
- import { MessageForm } from "./components/messageForm/MessageForm";
18
- import { MessagesTable } from "./components/messagesTable/MessagesTable";
19
22
  import { MetaIcon } from "./components/metaIcon/MetaIcon";
20
23
  import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
21
24
  import { StatusSteps } from "./components/statusSteps/StatusSteps";
22
25
  import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
26
+ import { Tag } from "./components/tag/Tag";
23
27
 
24
28
  export {
25
29
  DownloadCard,
26
30
  HorizontalImageCard,
27
31
  ImageAndDetailsCard,
28
32
  RichContentCard,
29
- CasesTable,
33
+ DetailsCard,
30
34
  Container,
31
35
  Breadcrumbs,
32
36
  EditableTableRow,
@@ -40,11 +44,10 @@ export {
40
44
  ImageDivider,
41
45
  AuthenticatedLogo,
42
46
  UnauthenticatedLogo,
43
- MessageForm,
44
- MessagesTable,
45
47
  MetaIcon,
46
48
  PrivateRoute,
47
49
  StatusSteps,
48
50
  PrimaryTopNav,
49
51
  SecondaryTopNav,
52
+ Tag,
50
53
  };
@@ -1,6 +0,0 @@
1
- import * as React from "react";
2
- interface CasesTableProps {
3
- cases: any[];
4
- }
5
- export declare const CasesTable: React.FC<CasesTableProps>;
6
- export {};
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as styles from "./CasesTable.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 CasesTable = ({ cases }) => {
9
- const { t } = useTranslation();
10
- return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Title") }), _jsx(TableHeader, { children: t("Status") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), cases.map((_case) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: _case.omschrijving }), _jsx(TableCell, { children: _case.status }), _jsx(TableCell, { children: _case.startdatum }), _jsx(TableCell, { onClick: () => navigate(`/my-cases/${_case.id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View case") }) })] }, _case.id)))] }) }));
11
- };
@@ -1,4 +0,0 @@
1
- .contentRow > :last-child {
2
- display: flex;
3
- justify-content: flex-end;
4
- }
@@ -1,2 +0,0 @@
1
- import * as React from "react";
2
- export declare const MessageForm: React.FC;
@@ -1,12 +0,0 @@
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
- };
@@ -1,11 +0,0 @@
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 {};
@@ -1,11 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- .contentRow > :last-child {
2
- display: flex;
3
- justify-content: flex-end;
4
- }
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as styles from "./CasesTable.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 CasesTable = ({ cases }) => {
9
- const { t } = useTranslation();
10
- return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Title") }), _jsx(TableHeader, { children: t("Status") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), cases.map((_case) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: _case.omschrijving }), _jsx(TableCell, { children: _case.status }), _jsx(TableCell, { children: _case.startdatum }), _jsx(TableCell, { onClick: () => navigate(`/my-cases/${_case.id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View case") }) })] }, _case.id)))] }) }));
11
- };
@@ -1,4 +0,0 @@
1
- .contentRow > :last-child {
2
- display: flex;
3
- justify-content: flex-end;
4
- }
@@ -1,41 +0,0 @@
1
- import * as React from "react";
2
- import * as styles from "./CasesTable.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
-
9
- interface CasesTableProps {
10
- cases: any[];
11
- }
12
-
13
- export const CasesTable: React.FC<CasesTableProps> = ({ cases }) => {
14
- const { t } = useTranslation();
15
-
16
- return (
17
- <Table>
18
- <TableBody>
19
- <TableRow>
20
- <TableHeader>{t("Title")}</TableHeader>
21
- <TableHeader>{t("Status")}</TableHeader>
22
- <TableHeader>{t("Date")}</TableHeader>
23
- <TableHeader />
24
- </TableRow>
25
- {cases.map((_case) => (
26
- <TableRow key={_case.id} className={styles.contentRow}>
27
- <TableCell>{_case.omschrijving}</TableCell>
28
- <TableCell>{_case.status}</TableCell>
29
- <TableCell>{_case.startdatum}</TableCell>
30
-
31
- <TableCell onClick={() => navigate(`/my-cases/${_case.id}`)}>
32
- <Link icon={<ArrowRightIcon />} iconAlign="start">
33
- {t("View case")}
34
- </Link>
35
- </TableCell>
36
- </TableRow>
37
- ))}
38
- </TableBody>
39
- </Table>
40
- );
41
- };
@@ -1,12 +0,0 @@
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
- };
@@ -1,32 +0,0 @@
1
- import * as React from "react";
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
-
7
- export const MessageForm: React.FC = () => {
8
- const { t } = useTranslation();
9
-
10
- const {
11
- register,
12
- handleSubmit,
13
- formState: { errors },
14
- } = useForm();
15
-
16
- //the empty onSubmit is dependend on an API to function. This API is not yet implemented
17
- const onSubmit = async () => {};
18
-
19
- return (
20
- <form onSubmit={handleSubmit(onSubmit)}>
21
- <FormField>
22
- <FormFieldInput>
23
- <FormFieldLabel>{t("Message")}</FormFieldLabel>
24
- <Textarea {...{ register, errors }} name="message" validation={{ required: true }} />
25
- </FormFieldInput>
26
- </FormField>
27
- <Button size="large" type="submit">
28
- {t("Send")}
29
- </Button>
30
- </form>
31
- );
32
- };
@@ -1,11 +0,0 @@
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
- };
@@ -1,4 +0,0 @@
1
- .contentRow > :last-child {
2
- display: flex;
3
- justify-content: flex-end;
4
- }
@@ -1,45 +0,0 @@
1
- import * as React from "react";
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
-
9
- export interface IMessageTableItem {
10
- organisation: string;
11
- date: Date;
12
- id: string;
13
- }
14
-
15
- interface MessagesTableProps {
16
- messages: IMessageTableItem[];
17
- }
18
-
19
- export const MessagesTable: React.FC<MessagesTableProps> = ({ messages }) => {
20
- const { t } = useTranslation();
21
-
22
- return (
23
- <Table>
24
- <TableBody>
25
- <TableRow>
26
- <TableHeader>{t("Organisation")}</TableHeader>
27
- <TableHeader>{t("Date")}</TableHeader>
28
- <TableHeader />
29
- </TableRow>
30
- {messages.map(({ organisation, date, id }) => (
31
- <TableRow key={id} className={styles.contentRow}>
32
- <TableCell>{organisation}</TableCell>
33
- <TableCell>{date}</TableCell>
34
-
35
- <TableCell onClick={() => navigate(`/my-messages/${id}`)}>
36
- <Link icon={<ArrowRightIcon />} iconAlign="start">
37
- {t("View message")}
38
- </Link>
39
- </TableCell>
40
- </TableRow>
41
- ))}
42
- </TableBody>
43
- </Table>
44
- );
45
- };