@conduction/components 1.0.11 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.d.ts +0 -0
- package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js +0 -0
- package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.module.css +0 -0
- package/lib/components/card/{RichContentCard → richContentCard}/RichContentCard.d.ts +0 -0
- package/lib/components/card/{RichContentCard → richContentCard}/RichContentCard.js +0 -0
- package/lib/components/card/{RichContentCard → richContentCard}/RichContentCard.module.css +0 -0
- package/lib/components/container/Container.d.ts +5 -1
- package/lib/components/container/Container.js +2 -1
- package/lib/components/container/Container.module.css +5 -1
- package/lib/components/formFields/index.d.ts +2 -1
- package/lib/components/formFields/index.js +2 -1
- package/lib/components/formFields/select/select.d.ts +6 -6
- package/lib/components/formFields/select.d.ts +17 -0
- package/lib/components/formFields/select.js +14 -0
- package/lib/components/notificationPopUp/NotificationPopUp.d.ts +22 -0
- package/lib/components/notificationPopUp/NotificationPopUp.js +31 -0
- package/lib/components/{modals/NotificationModal.module.css → notificationPopUp/NotificationPopUp.module.css} +12 -8
- package/lib/components/topNav/TopNav.module.css +4 -9
- package/lib/index.d.ts +11 -2
- package/lib/index.js +4 -2
- package/package.json +3 -2
- package/src/components/formFields/index.tsx +12 -1
- package/src/components/formFields/select/select.module.css +65 -0
- package/src/components/formFields/select/select.tsx +58 -0
- package/src/components/notificationPopUp/NotificationPopUp.module.css +60 -0
- package/src/components/notificationPopUp/NotificationPopUp.tsx +82 -0
- package/src/index.ts +12 -0
- package/tsconfig.json +16 -5
- package/lib/components/denhaag-wrappers/paginations/Paginations.css +0 -10
- package/lib/components/denhaag-wrappers/paginations/Paginations.d.ts +0 -20
- package/lib/components/denhaag-wrappers/paginations/Paginations.js +0 -10
- package/lib/components/modals/NotificationModal.d.ts +0 -25
- package/lib/components/modals/NotificationModal.js +0 -34
package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.d.ts
RENAMED
|
File without changes
|
package/lib/components/card/{HorizontalImageCard → horizontalImageCard}/HorizontalImageCard.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as styles from "./Container.module.css";
|
|
3
|
-
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
export const Container = ({ children, layoutClassName }) => (_jsx("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: children }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputText, InputPassword, InputEmail, InputDate, InputNumber } from "./input";
|
|
2
2
|
import { Textarea } from "./textarea";
|
|
3
3
|
import { InputCheckbox } from "./checkbox";
|
|
4
|
-
|
|
4
|
+
import { SelectSingle, SelectMultiple } from "./select/select";
|
|
5
|
+
export { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputCheckbox, Textarea, SelectSingle, SelectMultiple, };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputText, InputPassword, InputEmail, InputDate, InputNumber } from "./input";
|
|
2
2
|
import { Textarea } from "./textarea";
|
|
3
3
|
import { InputCheckbox } from "./checkbox";
|
|
4
|
-
|
|
4
|
+
import { SelectSingle, SelectMultiple } from "./select/select";
|
|
5
|
+
export { InputText, InputPassword, InputEmail, InputDate, InputNumber, InputCheckbox, Textarea, SelectSingle, SelectMultiple, };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { Control, FieldValues } from "react-hook-form";
|
|
2
3
|
import { IReactHookFormProps } from "../types";
|
|
3
|
-
export interface ISelectValue {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
}
|
|
7
4
|
interface ISelectProps {
|
|
8
|
-
control: any
|
|
9
|
-
options:
|
|
5
|
+
control: Control<FieldValues, any>;
|
|
6
|
+
options: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
10
|
name: string;
|
|
11
11
|
defaultValue?: any;
|
|
12
12
|
disabled?: boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Control, FieldValues } from "react-hook-form";
|
|
3
|
+
import { IReactHookFormProps } from "./types";
|
|
4
|
+
export interface ISelectValue {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
interface ISelectProps {
|
|
9
|
+
control: Control<FieldValues, any>;
|
|
10
|
+
options: ISelectValue[];
|
|
11
|
+
name: string;
|
|
12
|
+
defaultValue?: any;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const SelectMultiple: React.FC<ISelectProps & IReactHookFormProps>;
|
|
16
|
+
export declare const SelectSingle: React.FC<ISelectProps & IReactHookFormProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as styles from "./select.module.css";
|
|
3
|
+
import { Controller } from "react-hook-form";
|
|
4
|
+
import ReactSelect from "react-select";
|
|
5
|
+
export const SelectMultiple = ({ name, options, errors, control, validation, defaultValue, disabled, }) => {
|
|
6
|
+
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
7
|
+
return (_jsx(ReactSelect, { className: styles.select, isMulti: true, isDisabled: disabled, ...{ options, value, onChange, errors, defaultValue } }));
|
|
8
|
+
} }));
|
|
9
|
+
};
|
|
10
|
+
export const SelectSingle = ({ name, options, errors, control, validation, }) => {
|
|
11
|
+
return (_jsx(Controller, { ...{ control, name }, rules: validation, render: ({ field: { onChange, value } }) => {
|
|
12
|
+
return _jsx(ReactSelect, { className: styles.select, ...{ options, onChange, value, errors }, isClearable: true });
|
|
13
|
+
} }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface NotificationPopUpProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string | JSX.Element;
|
|
5
|
+
isVisible: boolean;
|
|
6
|
+
hide: () => void;
|
|
7
|
+
primaryButton: {
|
|
8
|
+
label: string;
|
|
9
|
+
handleClick: () => any;
|
|
10
|
+
};
|
|
11
|
+
secondaryButton?: {
|
|
12
|
+
label: string;
|
|
13
|
+
handleClick: () => any;
|
|
14
|
+
};
|
|
15
|
+
layoutClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const NotificationPopUp: React.FC<NotificationPopUpProps>;
|
|
18
|
+
export declare const NotificationPopUpController: () => {
|
|
19
|
+
isVisible: boolean;
|
|
20
|
+
show: () => void;
|
|
21
|
+
hide: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as styles from "./NotificationPopUp.module.css";
|
|
4
|
+
import ReactDOM from "react-dom";
|
|
5
|
+
import { Button, Heading3, Link, Paragraph, StylesProvider } from "@gemeente-denhaag/components-react";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { CloseIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
8
|
+
export const NotificationPopUp = ({ title, description, isVisible, hide, primaryButton, secondaryButton, layoutClassName, }) => {
|
|
9
|
+
const [animationVisible, setAnimationVisible] = React.useState(true);
|
|
10
|
+
const animationDuration = parseInt(styles.animationDuration, 10);
|
|
11
|
+
const handleClick = (clickFunction) => {
|
|
12
|
+
setAnimationVisible(!setAnimationVisible);
|
|
13
|
+
clickFunction && clickFunction();
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
hide();
|
|
16
|
+
setAnimationVisible(true);
|
|
17
|
+
}, animationDuration);
|
|
18
|
+
};
|
|
19
|
+
const modal = (_jsx(StylesProvider, { children: _jsxs("div", { style: { animationDuration: `${animationDuration}ms` }, className: clsx(styles.modal, animationVisible && styles.visible, layoutClassName), children: [_jsx(Heading3, { children: title }), _jsx(Paragraph, { children: description }), _jsxs("div", { className: styles.buttons, children: [secondaryButton && (_jsx("div", { onClick: () => handleClick(secondaryButton.handleClick), children: _jsx(Link, { icon: _jsx(CloseIcon, {}), iconAlign: "start", children: secondaryButton.label }) })), _jsx(Button, { icon: _jsx(ArrowRightIcon, {}), onClick: () => handleClick(primaryButton.handleClick), children: primaryButton.label })] })] }) }));
|
|
20
|
+
return isVisible ? ReactDOM.createPortal(modal, document.body) : null;
|
|
21
|
+
};
|
|
22
|
+
export const NotificationPopUpController = () => {
|
|
23
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
24
|
+
const show = () => setIsVisible(true);
|
|
25
|
+
const hide = () => setIsVisible(false);
|
|
26
|
+
return {
|
|
27
|
+
isVisible,
|
|
28
|
+
show,
|
|
29
|
+
hide,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--conduction-notification-popup-box-shadow: 0px 0px 6px 6px rgb(0 0 0 / 15%);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:export {
|
|
6
|
+
animationDuration: 200ms;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
.modal {
|
|
10
|
+
animation-fill-mode: both;
|
|
2
11
|
background: var(--denhaag-color-warmgrey-1);
|
|
3
12
|
padding-inline-start: var(--nlportal-space-inline-lg);
|
|
4
13
|
padding-inline-end: var(--nlportal-space-inline-lg);
|
|
5
14
|
padding-block-start: var(--nlportal-space-block-lg);
|
|
6
15
|
padding-block-end: var(--nlportal-space-block-lg);
|
|
7
|
-
box-shadow: var(--conduction-notification-box-shadow);
|
|
16
|
+
box-shadow: var(--conduction-notification-popup-box-shadow);
|
|
8
17
|
border-radius: var(--nlportal-document-border-radius);
|
|
9
18
|
}
|
|
10
19
|
|
|
@@ -22,12 +31,7 @@
|
|
|
22
31
|
margin-inline-end: var(--nlportal-space-inline-md);
|
|
23
32
|
}
|
|
24
33
|
|
|
25
|
-
.
|
|
26
|
-
animation-duration: var(--conduction-notification-animation-duration);
|
|
27
|
-
animation-fill-mode: both;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.fadeInBottom {
|
|
34
|
+
.visible {
|
|
31
35
|
animation-name: fadeInBottom;
|
|
32
36
|
}
|
|
33
37
|
|
|
@@ -41,7 +45,7 @@
|
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
.
|
|
48
|
+
.modal:not(.visible) {
|
|
45
49
|
animation-name: fadeOutBottom;
|
|
46
50
|
}
|
|
47
51
|
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
--conduction-top-nav-space-inline-lg: 1.25rem;
|
|
3
3
|
|
|
4
4
|
--conduction-top-nav-color-primary: #ffffff;
|
|
5
|
-
--conduction-top-nav-background-color-primary: #
|
|
6
|
-
--conduction-top-nav-background-color-primary-hover: rgba(
|
|
5
|
+
--conduction-top-nav-background-color-primary: #0b71a1;
|
|
6
|
+
--conduction-top-nav-background-color-primary-hover: rgba(255, 255, 255, 0.2);
|
|
7
7
|
|
|
8
8
|
--conduction-top-nav-font-size-secondary: 16px;
|
|
9
9
|
--conduction-top-nav-color-secondary: #ffffff;
|
|
10
|
-
--conduction-top-nav-background-color-secondary: #
|
|
11
|
-
--conduction-top-nav-background-color-secondary-hover: rgba(
|
|
12
|
-
255,
|
|
13
|
-
255,
|
|
14
|
-
255,
|
|
15
|
-
0.2
|
|
16
|
-
);
|
|
10
|
+
--conduction-top-nav-background-color-secondary: #084f70;
|
|
11
|
+
--conduction-top-nav-background-color-secondary-hover: rgba(0, 0, 0, 0.2);
|
|
17
12
|
}
|
|
18
13
|
|
|
19
14
|
/*
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard } from "./components/card";
|
|
2
3
|
import { Container } from "./components/container/Container";
|
|
3
4
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
4
5
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
5
|
-
import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox } from "./components/formFields";
|
|
6
|
+
import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, SelectMultiple, SelectSingle } from "./components/formFields";
|
|
6
7
|
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
7
8
|
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
8
9
|
import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
@@ -10,4 +11,12 @@ import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
|
10
11
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
11
12
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
12
13
|
import { Tag } from "./components/tag/Tag";
|
|
13
|
-
|
|
14
|
+
declare const NotificationPopUp: {
|
|
15
|
+
controller: () => {
|
|
16
|
+
isVisible: boolean;
|
|
17
|
+
show: () => void;
|
|
18
|
+
hide: () => void;
|
|
19
|
+
};
|
|
20
|
+
NotificationPopUp: import("react").FC<import("./components/notificationPopUp/NotificationPopUp").NotificationPopUpProps>;
|
|
21
|
+
};
|
|
22
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, };
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard
|
|
|
2
2
|
import { Container } from "./components/container/Container";
|
|
3
3
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
4
4
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
5
|
-
import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, } from "./components/formFields";
|
|
5
|
+
import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, SelectMultiple, SelectSingle, } from "./components/formFields";
|
|
6
6
|
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
7
7
|
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
8
8
|
import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
@@ -10,4 +10,6 @@ import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
|
10
10
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
11
11
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
12
12
|
import { Tag } from "./components/tag/Tag";
|
|
13
|
-
|
|
13
|
+
import { NotificationPopUpController, NotificationPopUp as _NotificationPopUp, } from "./components/notificationPopUp/NotificationPopUp";
|
|
14
|
+
const NotificationPopUp = { controller: NotificationPopUpController, NotificationPopUp: _NotificationPopUp };
|
|
15
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, DetailsCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"clsx": "^1.1.1",
|
|
30
30
|
"gatsby": "^4.11.1",
|
|
31
31
|
"react": "^17.0.1",
|
|
32
|
-
"react-hook-form": "
|
|
32
|
+
"react-hook-form": "7.29.0",
|
|
33
|
+
"react-select": "5.3.2"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@types/node": "^17.0.23",
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { InputText, InputPassword, InputEmail, InputDate, InputNumber } from "./input";
|
|
2
2
|
import { Textarea } from "./textarea";
|
|
3
3
|
import { InputCheckbox } from "./checkbox";
|
|
4
|
+
import { SelectSingle, SelectMultiple } from "./select/select";
|
|
4
5
|
|
|
5
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
InputText,
|
|
8
|
+
InputPassword,
|
|
9
|
+
InputEmail,
|
|
10
|
+
InputDate,
|
|
11
|
+
InputNumber,
|
|
12
|
+
InputCheckbox,
|
|
13
|
+
Textarea,
|
|
14
|
+
SelectSingle,
|
|
15
|
+
SelectMultiple,
|
|
16
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.select > div {
|
|
2
|
+
background-color: var(
|
|
3
|
+
--utrecht-textbox-background-color,
|
|
4
|
+
var(--utrecht-form-input-background-color)
|
|
5
|
+
);
|
|
6
|
+
border-width: var(
|
|
7
|
+
--utrecht-textbox-border-width,
|
|
8
|
+
var(--utrecht-form-input-border-width)
|
|
9
|
+
);
|
|
10
|
+
border-bottom-width: var(
|
|
11
|
+
--utrecht-textbox-border-bottom-width,
|
|
12
|
+
var(--utrecht-textbox-border-width, var(--utrecht-form-input-border-width))
|
|
13
|
+
);
|
|
14
|
+
border-color: var(
|
|
15
|
+
--utrecht-textbox-border-color,
|
|
16
|
+
var(--utrecht-form-input-border-color)
|
|
17
|
+
);
|
|
18
|
+
border-radius: var(
|
|
19
|
+
--utrecht-textbox-border-radius,
|
|
20
|
+
var(--utrecht-form-input-border-radius, 0)
|
|
21
|
+
);
|
|
22
|
+
border-style: solid;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
color: var(--utrecht-textbox-color, var(--utrecht-form-input-color));
|
|
25
|
+
font-family: var(
|
|
26
|
+
--utrecht-textbox-font-family,
|
|
27
|
+
var(--utrecht-form-input-font-family)
|
|
28
|
+
);
|
|
29
|
+
font-size: var(
|
|
30
|
+
--utrecht-textbox-font-size,
|
|
31
|
+
var(--utrecht-form-input-font-size, 1em)
|
|
32
|
+
);
|
|
33
|
+
max-inline-size: var(
|
|
34
|
+
--utrecht-textbox-max-inline-size,
|
|
35
|
+
var(--utrecht-form-input-max-inline-size)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
padding-block-start: 6.5px;
|
|
39
|
+
padding-block-end: 6.5px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.select > div:hover {
|
|
43
|
+
border-color: var(
|
|
44
|
+
--utrecht-textbox-border-color,
|
|
45
|
+
var(--utrecht-form-input-border-color)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.select > div:focus-within {
|
|
50
|
+
outline: none;
|
|
51
|
+
box-shadow: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.select > div:focus-within::after {
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
border: var(--denhaag-focus-border);
|
|
57
|
+
border-radius: var(--denhaag-border-radius);
|
|
58
|
+
bottom: -3px;
|
|
59
|
+
content: "";
|
|
60
|
+
display: block;
|
|
61
|
+
left: -3px;
|
|
62
|
+
position: absolute;
|
|
63
|
+
right: -3px;
|
|
64
|
+
top: -3px;
|
|
65
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as styles from "./select.module.css";
|
|
3
|
+
import { Control, Controller, FieldValues } from "react-hook-form";
|
|
4
|
+
import ReactSelect from "react-select";
|
|
5
|
+
import { IReactHookFormProps } from "../types";
|
|
6
|
+
|
|
7
|
+
interface ISelectProps {
|
|
8
|
+
control: Control<FieldValues, any>;
|
|
9
|
+
options: { label: string; value: string }[];
|
|
10
|
+
name: string;
|
|
11
|
+
defaultValue?: any;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const SelectMultiple: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
16
|
+
name,
|
|
17
|
+
options,
|
|
18
|
+
errors,
|
|
19
|
+
control,
|
|
20
|
+
validation,
|
|
21
|
+
defaultValue,
|
|
22
|
+
disabled,
|
|
23
|
+
}) => {
|
|
24
|
+
return (
|
|
25
|
+
<Controller
|
|
26
|
+
{...{ control, name }}
|
|
27
|
+
rules={validation}
|
|
28
|
+
render={({ field: { onChange, value } }) => {
|
|
29
|
+
return (
|
|
30
|
+
<ReactSelect
|
|
31
|
+
className={styles.select}
|
|
32
|
+
isMulti
|
|
33
|
+
isDisabled={disabled}
|
|
34
|
+
{...{ options, value, onChange, errors, defaultValue }}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const SelectSingle: React.FC<ISelectProps & IReactHookFormProps> = ({
|
|
43
|
+
name,
|
|
44
|
+
options,
|
|
45
|
+
errors,
|
|
46
|
+
control,
|
|
47
|
+
validation,
|
|
48
|
+
}) => {
|
|
49
|
+
return (
|
|
50
|
+
<Controller
|
|
51
|
+
{...{ control, name }}
|
|
52
|
+
rules={validation}
|
|
53
|
+
render={({ field: { onChange, value } }) => {
|
|
54
|
+
return <ReactSelect className={styles.select} {...{ options, onChange, value, errors }} isClearable />;
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--conduction-notification-popup-box-shadow: 0px 0px 6px 6px rgb(0 0 0 / 15%);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
:export {
|
|
6
|
+
animationDuration: 200ms;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.modal {
|
|
10
|
+
animation-fill-mode: both;
|
|
11
|
+
background: var(--denhaag-color-warmgrey-1);
|
|
12
|
+
padding-inline-start: var(--nlportal-space-inline-lg);
|
|
13
|
+
padding-inline-end: var(--nlportal-space-inline-lg);
|
|
14
|
+
padding-block-start: var(--nlportal-space-block-lg);
|
|
15
|
+
padding-block-end: var(--nlportal-space-block-lg);
|
|
16
|
+
box-shadow: var(--conduction-notification-popup-box-shadow);
|
|
17
|
+
border-radius: var(--nlportal-document-border-radius);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.modal > *:not(:last-child) {
|
|
21
|
+
margin-block-end: var(--nlportal-space-block-md);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.buttons {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: flex-end;
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.buttons > *:not(:last-child) {
|
|
31
|
+
margin-inline-end: var(--nlportal-space-inline-md);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.visible {
|
|
35
|
+
animation-name: fadeInBottom;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes fadeInBottom {
|
|
39
|
+
from {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: translateY(100%);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.modal:not(.visible) {
|
|
49
|
+
animation-name: fadeOutBottom;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes fadeOutBottom {
|
|
53
|
+
from {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
to {
|
|
57
|
+
opacity: 0;
|
|
58
|
+
transform: translateY(100%);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as styles from "./NotificationPopUp.module.css";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
import { Button, Heading3, Link, Paragraph, StylesProvider } from "@gemeente-denhaag/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { CloseIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
+
|
|
8
|
+
export interface NotificationPopUpProps {
|
|
9
|
+
title: string;
|
|
10
|
+
description: string | JSX.Element;
|
|
11
|
+
isVisible: boolean;
|
|
12
|
+
hide: () => void;
|
|
13
|
+
primaryButton: {
|
|
14
|
+
label: string;
|
|
15
|
+
handleClick: () => any;
|
|
16
|
+
};
|
|
17
|
+
secondaryButton?: {
|
|
18
|
+
label: string;
|
|
19
|
+
handleClick: () => any;
|
|
20
|
+
};
|
|
21
|
+
layoutClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const NotificationPopUp: React.FC<NotificationPopUpProps> = ({
|
|
25
|
+
title,
|
|
26
|
+
description,
|
|
27
|
+
isVisible,
|
|
28
|
+
hide,
|
|
29
|
+
primaryButton,
|
|
30
|
+
secondaryButton,
|
|
31
|
+
layoutClassName,
|
|
32
|
+
}) => {
|
|
33
|
+
const [animationVisible, setAnimationVisible] = React.useState<boolean>(true);
|
|
34
|
+
|
|
35
|
+
const animationDuration = parseInt(styles.animationDuration, 10);
|
|
36
|
+
|
|
37
|
+
const handleClick = (clickFunction?: () => any) => {
|
|
38
|
+
setAnimationVisible(!setAnimationVisible);
|
|
39
|
+
clickFunction && clickFunction();
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
hide();
|
|
42
|
+
setAnimationVisible(true);
|
|
43
|
+
}, animationDuration);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const modal = (
|
|
47
|
+
<StylesProvider>
|
|
48
|
+
<div
|
|
49
|
+
style={{ animationDuration: `${animationDuration}ms` }}
|
|
50
|
+
className={clsx(styles.modal, animationVisible && styles.visible, layoutClassName)}
|
|
51
|
+
>
|
|
52
|
+
<Heading3>{title}</Heading3>
|
|
53
|
+
<Paragraph>{description}</Paragraph>
|
|
54
|
+
<div className={styles.buttons}>
|
|
55
|
+
{secondaryButton && (
|
|
56
|
+
<div onClick={() => handleClick(secondaryButton.handleClick)}>
|
|
57
|
+
<Link icon={<CloseIcon />} iconAlign="start">
|
|
58
|
+
{secondaryButton.label}
|
|
59
|
+
</Link>
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
<Button icon={<ArrowRightIcon />} onClick={() => handleClick(primaryButton.handleClick)}>
|
|
63
|
+
{primaryButton.label}
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</StylesProvider>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return isVisible ? ReactDOM.createPortal(modal, document.body) : null;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const NotificationPopUpController = () => {
|
|
74
|
+
const [isVisible, setIsVisible] = React.useState<boolean>(false);
|
|
75
|
+
const show = () => setIsVisible(true);
|
|
76
|
+
const hide = () => setIsVisible(false);
|
|
77
|
+
return {
|
|
78
|
+
isVisible,
|
|
79
|
+
show,
|
|
80
|
+
hide,
|
|
81
|
+
};
|
|
82
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
InputNumber,
|
|
17
17
|
Textarea,
|
|
18
18
|
InputCheckbox,
|
|
19
|
+
SelectMultiple,
|
|
20
|
+
SelectSingle,
|
|
19
21
|
} from "./components/formFields";
|
|
20
22
|
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
21
23
|
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
@@ -25,6 +27,13 @@ import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
|
25
27
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
26
28
|
import { Tag } from "./components/tag/Tag";
|
|
27
29
|
|
|
30
|
+
import {
|
|
31
|
+
NotificationPopUpController,
|
|
32
|
+
NotificationPopUp as _NotificationPopUp,
|
|
33
|
+
} from "./components/notificationPopUp/NotificationPopUp";
|
|
34
|
+
|
|
35
|
+
const NotificationPopUp = { controller: NotificationPopUpController, NotificationPopUp: _NotificationPopUp };
|
|
36
|
+
|
|
28
37
|
export {
|
|
29
38
|
DownloadCard,
|
|
30
39
|
HorizontalImageCard,
|
|
@@ -41,6 +50,8 @@ export {
|
|
|
41
50
|
InputNumber,
|
|
42
51
|
Textarea,
|
|
43
52
|
InputCheckbox,
|
|
53
|
+
SelectMultiple,
|
|
54
|
+
SelectSingle,
|
|
44
55
|
ImageDivider,
|
|
45
56
|
AuthenticatedLogo,
|
|
46
57
|
UnauthenticatedLogo,
|
|
@@ -50,4 +61,5 @@ export {
|
|
|
50
61
|
PrimaryTopNav,
|
|
51
62
|
SecondaryTopNav,
|
|
52
63
|
Tag,
|
|
64
|
+
NotificationPopUp,
|
|
53
65
|
};
|
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
"declaration": true,
|
|
4
4
|
"outDir": "./lib",
|
|
5
5
|
"target": "esnext",
|
|
6
|
-
"lib": [
|
|
6
|
+
"lib": [
|
|
7
|
+
"dom",
|
|
8
|
+
"esnext"
|
|
9
|
+
],
|
|
7
10
|
"jsx": "react-jsx",
|
|
8
11
|
"module": "esnext",
|
|
9
12
|
"moduleResolution": "node",
|
|
@@ -12,7 +15,15 @@
|
|
|
12
15
|
"strict": true,
|
|
13
16
|
"skipLibCheck": true
|
|
14
17
|
},
|
|
15
|
-
"hooks": [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
"hooks": [
|
|
19
|
+
"copy-files"
|
|
20
|
+
],
|
|
21
|
+
"include": [
|
|
22
|
+
"src",
|
|
23
|
+
"src/**/*.css"
|
|
24
|
+
],
|
|
25
|
+
"exclude": [
|
|
26
|
+
"node_modules",
|
|
27
|
+
"**/__tests__/*"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a wrapper element based on https://nl-design-system.github.io/denhaag/?path=/docs/css-navigation-pagination--default-story
|
|
3
|
-
*
|
|
4
|
-
* IMPORTANT: DO NOT MAKE CHANGES TO THIS FILE, AS ALL CHANGES WILL BE LOST UPON PACKAGE IMPLEMENTATION
|
|
5
|
-
*
|
|
6
|
-
* Note: we do not use css modules here due to this component being a wrapper
|
|
7
|
-
*/
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import "./Paginations.css";
|
|
10
|
-
interface PaginationsProps {
|
|
11
|
-
pages: {
|
|
12
|
-
ariaLabel: string;
|
|
13
|
-
label: string;
|
|
14
|
-
href: string;
|
|
15
|
-
}[];
|
|
16
|
-
nextPageHref: string;
|
|
17
|
-
previousPageHref: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const Paginations: React.FC<PaginationsProps>;
|
|
20
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "./Paginations.css";
|
|
3
|
-
import { Link } from "gatsby";
|
|
4
|
-
export const Paginations = ({ pages, previousPageHref, nextPageHref }) => {
|
|
5
|
-
return (_jsxs("nav", { className: "denhaag-pagination", children: [_jsx(PreviousPage, { href: previousPageHref }), _jsx("span", { className: "denhaag-pagination__links", role: "group", children: pages.map((page) => {
|
|
6
|
-
return (_jsx(Link, { "aria-label": page.ariaLabel, className: "denhaag-pagination__link", to: page.href, children: page.label }));
|
|
7
|
-
}) }), _jsx(NextPage, { href: nextPageHref })] }));
|
|
8
|
-
};
|
|
9
|
-
const PreviousPage = ({ href }) => (_jsx(Link, { "aria-label": "Previous page", className: "denhaag-pagination__link denhaag-pagination__link--arrow", to: href, rel: "prev", children: _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", height: "1em", viewBox: "0 0 7 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M4.9921 10.8143C5.36382 11.1914 5.97222 11.1914 6.34393 10.8143C6.7079 10.4451 6.70822 9.8521 6.34466 9.48248L3.36315 6.45123C2.98039 6.06209 2.98039 5.43791 3.36315 5.04877L6.34466 2.01752C6.70822 1.6479 6.7079 1.05492 6.34394 0.685696C5.97222 0.308599 5.36382 0.308599 4.9921 0.685695L0.692003 5.04799C0.308224 5.43732 0.308224 6.06268 0.692003 6.45201L4.9921 10.8143Z", fill: "currentColor" }) }) }));
|
|
10
|
-
const NextPage = ({ href }) => (_jsx(Link, { "aria-label": "Next page", className: "denhaag-pagination__link denhaag-pagination__link--arrow", to: href, rel: "next", children: _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", height: "1em", viewBox: "0 0 7 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M2.0079 1.1857C1.63618 0.8086 1.02778 0.8086 0.656065 1.18569V1.18569C0.292103 1.55492 0.291779 2.1479 0.655339 2.51752L3.63685 5.54877C4.01961 5.93791 4.01961 6.56209 3.63686 6.95123L0.655339 9.98248C0.291779 10.3521 0.292102 10.9451 0.656065 11.3143V11.3143C1.02778 11.6914 1.63618 11.6914 2.0079 11.3143L6.308 6.95201C6.69178 6.56268 6.69178 5.93732 6.308 5.54799L2.0079 1.1857Z", fill: "currentColor" }) }) }));
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface ModalProps {
|
|
3
|
-
title: string;
|
|
4
|
-
description: string;
|
|
5
|
-
isShown: boolean;
|
|
6
|
-
hide: () => void;
|
|
7
|
-
layoutClassName: string;
|
|
8
|
-
primaryButton: {
|
|
9
|
-
label: string;
|
|
10
|
-
handleClick(): any;
|
|
11
|
-
};
|
|
12
|
-
closeButton?: {
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
infoLink?: {
|
|
16
|
-
label: string;
|
|
17
|
-
link: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare const NotificationModal: React.FC<ModalProps>;
|
|
21
|
-
export declare const toggleNotificationModal: () => {
|
|
22
|
-
isShown: boolean;
|
|
23
|
-
show: () => void;
|
|
24
|
-
hide: () => void;
|
|
25
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as styles from "./NotificationModal.module.css";
|
|
4
|
-
import ReactDOM from "react-dom";
|
|
5
|
-
import { Button, Heading3, Link, Paragraph } from "@gemeente-denhaag/components-react";
|
|
6
|
-
import clsx from "clsx";
|
|
7
|
-
import { CloseIcon, ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
8
|
-
export const NotificationModal = ({ title, description, isShown, hide, primaryButton, closeButton, infoLink, layoutClassName, }) => {
|
|
9
|
-
const [fadeOut, setFadeOut] = React.useState(true);
|
|
10
|
-
const stylesContainer = document.getElementById("stylesContainer");
|
|
11
|
-
const animationDurationToken = getComputedStyle(document.documentElement).getPropertyValue("--conduction-notification-animation-duration");
|
|
12
|
-
const animationDurationString = animationDurationToken.replace(/\D/g, "");
|
|
13
|
-
const animationDuration = parseInt(animationDurationString);
|
|
14
|
-
const handleClick = (clickFunction) => {
|
|
15
|
-
setFadeOut(!setFadeOut);
|
|
16
|
-
clickFunction && clickFunction();
|
|
17
|
-
setTimeout(() => {
|
|
18
|
-
hide();
|
|
19
|
-
setFadeOut(true);
|
|
20
|
-
}, animationDuration);
|
|
21
|
-
};
|
|
22
|
-
const modal = (_jsx("div", { className: clsx(styles.cssanimation, fadeOut ? styles.fadeInBottom : styles.fadeOutBottom, layoutClassName), children: _jsxs("div", { className: styles.modal, children: [_jsx(Heading3, { children: title }), _jsx("div", { children: _jsxs(Paragraph, { children: [description, " ", infoLink ? _jsx(Link, { href: infoLink.link, children: infoLink.label }) : _jsx(_Fragment, {})] }) }), _jsxs("div", { className: styles.buttons, children: [closeButton ? (_jsx("div", { onClick: () => handleClick(), children: _jsx(Link, { icon: _jsx(CloseIcon, {}), iconAlign: "start", children: closeButton.label }) })) : (_jsx(_Fragment, {})), _jsx(Button, { icon: _jsx(ArrowRightIcon, {}), onClick: () => handleClick(primaryButton.handleClick), children: primaryButton.label })] })] }) }));
|
|
23
|
-
return isShown ? ReactDOM.createPortal(modal, stylesContainer) : null;
|
|
24
|
-
};
|
|
25
|
-
export const toggleNotificationModal = () => {
|
|
26
|
-
const [isShown, setIsShown] = React.useState(false);
|
|
27
|
-
const show = () => setIsShown(true);
|
|
28
|
-
const hide = () => setIsShown(false);
|
|
29
|
-
return {
|
|
30
|
-
isShown,
|
|
31
|
-
show,
|
|
32
|
-
hide,
|
|
33
|
-
};
|
|
34
|
-
};
|