@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.
- package/.prettierrc +29 -0
- package/README.md +1 -0
- package/lib/components/card/HorizontalImageCard/HorizontalImageCard.d.ts +13 -0
- package/lib/components/card/HorizontalImageCard/HorizontalImageCard.js +9 -0
- package/lib/components/card/HorizontalImageCard/HorizontalImageCard.module.css +26 -0
- package/lib/components/card/RichContentCard/RichContentCard.d.ts +19 -0
- package/lib/components/card/RichContentCard/RichContentCard.js +17 -0
- package/lib/components/card/RichContentCard/RichContentCard.module.css +100 -0
- package/lib/components/card/downloadCard/DownloadCard.d.ts +9 -0
- package/lib/components/card/downloadCard/DownloadCard.js +10 -0
- package/lib/components/card/downloadCard/DownloadCard.module.css +23 -0
- package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.d.ts +14 -0
- package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.js +9 -0
- package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.module.css +54 -0
- package/lib/components/card/index.d.ts +5 -0
- package/lib/components/card/index.js +5 -0
- package/lib/components/casesTable/CasesTable.d.ts +6 -0
- package/lib/components/casesTable/CasesTable.js +11 -0
- package/lib/components/casesTable/CasesTable.module.css +4 -0
- package/lib/components/container/Container.d.ts +2 -0
- package/lib/components/container/Container.js +3 -0
- package/lib/components/container/Container.module.css +5 -0
- package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.css +222 -0
- package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.d.ts +17 -0
- package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.js +20 -0
- package/lib/components/editableTableRow/EditableTableRow.d.ts +11 -0
- package/lib/components/editableTableRow/EditableTableRow.js +34 -0
- package/lib/components/editableTableRow/EditableTableRow.module.css +25 -0
- package/lib/components/formFields/checkbox.d.ts +3 -0
- package/lib/components/formFields/checkbox.js +3 -0
- package/lib/components/formFields/index.d.ts +4 -0
- package/lib/components/formFields/index.js +4 -0
- package/lib/components/formFields/input.d.ts +7 -0
- package/lib/components/formFields/input.js +12 -0
- package/lib/components/formFields/textarea.d.ts +3 -0
- package/lib/components/formFields/textarea.js +3 -0
- package/lib/components/formFields/types.d.ts +20 -0
- package/lib/components/formFields/types.js +1 -0
- package/lib/components/imageDivider/ImageDivider.d.ts +7 -0
- package/lib/components/imageDivider/ImageDivider.js +6 -0
- package/lib/components/imageDivider/imageDivider.module.css +5 -0
- package/lib/components/logo/Logo.d.ts +8 -0
- package/lib/components/logo/Logo.js +10 -0
- package/lib/components/logo/Logo.module.css +15 -0
- package/lib/components/messageForm/MessageForm.d.ts +2 -0
- package/lib/components/messageForm/MessageForm.js +12 -0
- package/lib/components/messagesTable/MessagesTable.d.ts +11 -0
- package/lib/components/messagesTable/MessagesTable.js +11 -0
- package/lib/components/messagesTable/MessagesTable.module.css +4 -0
- package/lib/components/metaIcon/MetaIcon.d.ts +7 -0
- package/lib/components/metaIcon/MetaIcon.js +3 -0
- package/lib/components/metaIcon/MetaIcon.module.css +17 -0
- package/lib/components/privateRoute/PrivateRoute.d.ts +6 -0
- package/lib/components/privateRoute/PrivateRoute.js +15 -0
- package/lib/components/statusSteps/StatusSteps.d.ts +13 -0
- package/lib/components/statusSteps/StatusSteps.js +5 -0
- package/lib/components/topNav/TopNav.d.ts +12 -0
- package/lib/components/topNav/TopNav.js +10 -0
- package/lib/components/topNav/TopNav.module.css +22 -0
- package/lib/index.d.ts +15 -0
- package/lib/index.js +15 -0
- package/package.json +56 -0
- package/src/components/card/HorizontalImageCard/HorizontalImageCard.js +9 -0
- package/src/components/card/HorizontalImageCard/HorizontalImageCard.module.css +26 -0
- package/src/components/card/HorizontalImageCard/HorizontalImageCard.tsx +37 -0
- package/src/components/card/RichContentCard/RichContentCard.js +17 -0
- package/src/components/card/RichContentCard/RichContentCard.module.css +100 -0
- package/src/components/card/RichContentCard/RichContentCard.tsx +105 -0
- package/src/components/card/downloadCard/DownloadCard.js +10 -0
- package/src/components/card/downloadCard/DownloadCard.module.css +23 -0
- package/src/components/card/downloadCard/DownloadCard.tsx +33 -0
- package/src/components/card/imageAndDetailsCard/ImageAndDetailsCard.js +9 -0
- package/src/components/card/imageAndDetailsCard/ImageAndDetailsCard.module.css +54 -0
- package/src/components/card/imageAndDetailsCard/ImageAndDetailsCard.tsx +49 -0
- package/src/components/card/index.js +5 -0
- package/src/components/card/index.tsx +6 -0
- package/src/components/casesTable/CasesTable.js +11 -0
- package/src/components/casesTable/CasesTable.module.css +4 -0
- package/src/components/casesTable/CasesTable.tsx +41 -0
- package/src/components/container/Container.js +3 -0
- package/src/components/container/Container.module.css +5 -0
- package/src/components/container/Container.tsx +4 -0
- package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.css +222 -0
- package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.js +20 -0
- package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.tsx +89 -0
- package/src/components/editableTableRow/EditableTableRow.js +34 -0
- package/src/components/editableTableRow/EditableTableRow.module.css +25 -0
- package/src/components/editableTableRow/EditableTableRow.tsx +130 -0
- package/src/components/formFields/checkbox.js +3 -0
- package/src/components/formFields/checkbox.tsx +9 -0
- package/src/components/formFields/index.js +4 -0
- package/src/components/formFields/index.tsx +5 -0
- package/src/components/formFields/input.js +12 -0
- package/src/components/formFields/input.tsx +88 -0
- package/src/components/formFields/textarea.js +3 -0
- package/src/components/formFields/textarea.tsx +7 -0
- package/src/components/formFields/types.js +1 -0
- package/src/components/formFields/types.ts +24 -0
- package/src/components/imageDivider/ImageDivider.js +6 -0
- package/src/components/imageDivider/ImageDivider.tsx +12 -0
- package/src/components/imageDivider/imageDivider.module.css +5 -0
- package/src/components/logo/Logo.js +10 -0
- package/src/components/logo/Logo.module.css +15 -0
- package/src/components/logo/Logo.tsx +25 -0
- package/src/components/messageForm/MessageForm.js +12 -0
- package/src/components/messageForm/MessageForm.tsx +32 -0
- package/src/components/messagesTable/MessagesTable.js +11 -0
- package/src/components/messagesTable/MessagesTable.module.css +4 -0
- package/src/components/messagesTable/MessagesTable.tsx +45 -0
- package/src/components/metaIcon/MetaIcon.js +3 -0
- package/src/components/metaIcon/MetaIcon.module.css +17 -0
- package/src/components/metaIcon/MetaIcon.tsx +18 -0
- package/src/components/privateRoute/PrivateRoute.js +15 -0
- package/src/components/privateRoute/PrivateRoute.tsx +22 -0
- package/src/components/statusSteps/StatusSteps.js +5 -0
- package/src/components/statusSteps/StatusSteps.tsx +54 -0
- package/src/components/topNav/TopNav.js +10 -0
- package/src/components/topNav/TopNav.module.css +22 -0
- package/src/components/topNav/TopNav.tsx +46 -0
- package/src/custom.d.ts +5 -0
- package/src/index.js +14 -0
- package/src/index.ts +50 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FieldErrors, FieldValues, RegisterOptions, UseFormRegister } from "react-hook-form";
|
|
2
|
+
|
|
3
|
+
export interface IReactHookFormProps {
|
|
4
|
+
register: UseFormRegister<FieldValues>;
|
|
5
|
+
errors: FieldErrors;
|
|
6
|
+
validation?: Omit<RegisterOptions<FieldValues, any>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
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,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,12 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as styles from "./imageDivider.module.css";
|
|
4
|
+
|
|
5
|
+
interface ImageDividerProps {
|
|
6
|
+
image: string;
|
|
7
|
+
layoutClassName: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const ImageDivider: React.FC<ImageDividerProps> = ({ image, layoutClassName }) => {
|
|
11
|
+
return <img src={image} className={clsx(styles.divider, layoutClassName)} />;
|
|
12
|
+
};
|
|
@@ -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,25 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { Link } from "gatsby";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as styles from "./Logo.module.css";
|
|
5
|
+
|
|
6
|
+
interface LogoProps {
|
|
7
|
+
layoutClassName: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const AuthenticatedLogo: React.FC<LogoProps> = ({ layoutClassName, href }) => {
|
|
12
|
+
return (
|
|
13
|
+
<Link className={styles.logoContainer} to={href ?? "#"}>
|
|
14
|
+
<div className={clsx(styles.authenticatedLogo, styles.logo, layoutClassName)} />
|
|
15
|
+
</Link>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const UnauthenticatedLogo: React.FC<LogoProps> = ({ layoutClassName, href }) => {
|
|
20
|
+
return (
|
|
21
|
+
<Link className={styles.logoContainer} to={href ?? "#"}>
|
|
22
|
+
<div className={clsx(styles.unauthenticatedLogo, styles.logo, layoutClassName)} />
|
|
23
|
+
</Link>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -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,32 @@
|
|
|
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
|
+
};
|
|
@@ -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,45 @@
|
|
|
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
|
+
};
|
|
@@ -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,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as styles from "./MetaIcon.module.css";
|
|
3
|
+
|
|
4
|
+
export interface MetaIconProps {
|
|
5
|
+
icon: JSX.Element;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const MetaIcon: React.FC<MetaIconProps> = ({ icon, label, value }) => (
|
|
11
|
+
<div className={styles.container}>
|
|
12
|
+
<span className={styles.icon}>{icon}</span>
|
|
13
|
+
|
|
14
|
+
<span>{label}</span>
|
|
15
|
+
|
|
16
|
+
<span className={styles.value}>{value}</span>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
@@ -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,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { navigate } from "gatsby";
|
|
3
|
+
|
|
4
|
+
interface PrivateRouteProps {
|
|
5
|
+
isLoggedIn?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const PrivateRoute: React.FC<PrivateRouteProps> = ({ children, isLoggedIn }) => {
|
|
9
|
+
const [authenticated, setAuthenticated] = React.useState<boolean>(false);
|
|
10
|
+
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
if (!isLoggedIn && window.location.pathname !== "/login") {
|
|
13
|
+
navigate("/login");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
isLoggedIn && setAuthenticated(true);
|
|
17
|
+
}, [isLoggedIn]);
|
|
18
|
+
|
|
19
|
+
if (!authenticated) return <></>;
|
|
20
|
+
|
|
21
|
+
return <>{children}</>;
|
|
22
|
+
};
|
|
@@ -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,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Step,
|
|
4
|
+
StepExpandedIcon,
|
|
5
|
+
StepHeader,
|
|
6
|
+
StepHeading,
|
|
7
|
+
StepList,
|
|
8
|
+
StepMarker,
|
|
9
|
+
StepSection,
|
|
10
|
+
SubStep,
|
|
11
|
+
SubStepHeading,
|
|
12
|
+
SubStepList,
|
|
13
|
+
SubStepMarker,
|
|
14
|
+
} from "@gemeente-denhaag/process-steps";
|
|
15
|
+
|
|
16
|
+
interface IStatusStep {
|
|
17
|
+
title: string;
|
|
18
|
+
checked?: boolean;
|
|
19
|
+
current?: boolean;
|
|
20
|
+
expanded?: boolean;
|
|
21
|
+
subSteps?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface StatusStepsProps {
|
|
25
|
+
steps: IStatusStep[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const StatusSteps: React.FC<StatusStepsProps> = ({ steps }) => {
|
|
29
|
+
return (
|
|
30
|
+
<StepList>
|
|
31
|
+
{steps.map(({ title, checked, current, expanded, subSteps }, idx) => (
|
|
32
|
+
<Step key={idx} {...{ checked, current, expanded }}>
|
|
33
|
+
<StepSection>
|
|
34
|
+
<StepHeader>
|
|
35
|
+
<StepMarker>{idx + 1}</StepMarker>
|
|
36
|
+
<StepHeading>{title}</StepHeading>
|
|
37
|
+
{subSteps && <StepExpandedIcon />}
|
|
38
|
+
</StepHeader>
|
|
39
|
+
</StepSection>
|
|
40
|
+
{subSteps && (
|
|
41
|
+
<SubStepList>
|
|
42
|
+
{subSteps.map((subStep: string) => (
|
|
43
|
+
<SubStep key={idx}>
|
|
44
|
+
<SubStepMarker />
|
|
45
|
+
<SubStepHeading>{subStep}</SubStepHeading>
|
|
46
|
+
</SubStep>
|
|
47
|
+
))}
|
|
48
|
+
</SubStepList>
|
|
49
|
+
)}
|
|
50
|
+
</Step>
|
|
51
|
+
))}
|
|
52
|
+
</StepList>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -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", { className: styles.secondary, 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
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as styles from "./TopNav.module.css";
|
|
3
|
+
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
+
import { navigate } from "gatsby";
|
|
5
|
+
|
|
6
|
+
export interface ITopNavItem {
|
|
7
|
+
label: string;
|
|
8
|
+
href: string;
|
|
9
|
+
icon?: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface TopNavItemsProps {
|
|
13
|
+
items: ITopNavItem[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PrimaryTopNav: React.FC<TopNavItemsProps> = ({ items }) => {
|
|
17
|
+
return (
|
|
18
|
+
<nav className={styles.primary}>
|
|
19
|
+
<ul className={styles.ul}>
|
|
20
|
+
{items.map(({ label, href, icon }, idx) => (
|
|
21
|
+
<li className={styles.li} key={idx} onClick={() => navigate(href)}>
|
|
22
|
+
<Link icon={icon} iconAlign="start">
|
|
23
|
+
{label}
|
|
24
|
+
</Link>
|
|
25
|
+
</li>
|
|
26
|
+
))}
|
|
27
|
+
</ul>
|
|
28
|
+
</nav>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const SecondaryTopNav: React.FC<TopNavItemsProps> = ({ items }) => {
|
|
33
|
+
return (
|
|
34
|
+
<nav>
|
|
35
|
+
<ul className={styles.ul}>
|
|
36
|
+
{items.map(({ label, href, icon }, idx) => (
|
|
37
|
+
<li className={styles.li} key={idx} onClick={() => navigate(href)}>
|
|
38
|
+
<Link icon={icon} iconAlign="start">
|
|
39
|
+
{label}
|
|
40
|
+
</Link>
|
|
41
|
+
</li>
|
|
42
|
+
))}
|
|
43
|
+
</ul>
|
|
44
|
+
</nav>
|
|
45
|
+
);
|
|
46
|
+
};
|
package/src/custom.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./components/card";
|
|
2
|
+
export * from "./components/casesTable/CasesTable";
|
|
3
|
+
export * from "./components/container/Container";
|
|
4
|
+
export * from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
5
|
+
export * from "./components/editableTableRow/EditableTableRow";
|
|
6
|
+
export * from "./components/formFields";
|
|
7
|
+
export * from "./components/imageDivider/ImageDivider";
|
|
8
|
+
export * from "./components/logo/Logo";
|
|
9
|
+
export * from "./components/messageForm/MessageForm";
|
|
10
|
+
export * from "./components/messagesTable/MessagesTable";
|
|
11
|
+
export * from "./components/metaIcon/MetaIcon";
|
|
12
|
+
export * from "./components/privateRoute/PrivateRoute";
|
|
13
|
+
export * from "./components/statusSteps/StatusSteps";
|
|
14
|
+
export * from "./components/topNav/TopNav";
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
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 {
|
|
7
|
+
InputText,
|
|
8
|
+
InputPassword,
|
|
9
|
+
InputEmail,
|
|
10
|
+
InputDate,
|
|
11
|
+
InputNumber,
|
|
12
|
+
Textarea,
|
|
13
|
+
InputCheckbox,
|
|
14
|
+
} from "./components/formFields";
|
|
15
|
+
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
16
|
+
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
17
|
+
import { MessageForm } from "./components/messageForm/MessageForm";
|
|
18
|
+
import { MessagesTable } from "./components/messagesTable/MessagesTable";
|
|
19
|
+
import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
20
|
+
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
21
|
+
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
22
|
+
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
DownloadCard,
|
|
26
|
+
HorizontalImageCard,
|
|
27
|
+
ImageAndDetailsCard,
|
|
28
|
+
RichContentCard,
|
|
29
|
+
CasesTable,
|
|
30
|
+
Container,
|
|
31
|
+
Breadcrumbs,
|
|
32
|
+
EditableTableRow,
|
|
33
|
+
InputText,
|
|
34
|
+
InputPassword,
|
|
35
|
+
InputEmail,
|
|
36
|
+
InputDate,
|
|
37
|
+
InputNumber,
|
|
38
|
+
Textarea,
|
|
39
|
+
InputCheckbox,
|
|
40
|
+
ImageDivider,
|
|
41
|
+
AuthenticatedLogo,
|
|
42
|
+
UnauthenticatedLogo,
|
|
43
|
+
MessageForm,
|
|
44
|
+
MessagesTable,
|
|
45
|
+
MetaIcon,
|
|
46
|
+
PrivateRoute,
|
|
47
|
+
StatusSteps,
|
|
48
|
+
PrimaryTopNav,
|
|
49
|
+
SecondaryTopNav,
|
|
50
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"outDir": "./lib",
|
|
5
|
+
"target": "esnext",
|
|
6
|
+
"lib": ["dom", "esnext"],
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"module": "esnext",
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"skipLibCheck": true
|
|
14
|
+
},
|
|
15
|
+
"hooks": ["copy-files"],
|
|
16
|
+
"include": ["src", "src/**/*.css"],
|
|
17
|
+
"exclude": ["node_modules", "**/__tests__/*"]
|
|
18
|
+
}
|