@conduction/components 2.1.8 → 2.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/components/badgeCounter/BadgeCounter.d.ts +8 -0
- package/lib/components/badgeCounter/BadgeCounter.js +4 -0
- package/lib/components/badgeCounter/BadgeCounter.module.css +27 -0
- package/lib/components/card/detailsCard/DetailsCard.d.ts +14 -0
- package/lib/components/card/detailsCard/DetailsCard.js +10 -0
- package/lib/components/card/detailsCard/DetailsCard.module.css +51 -0
- package/lib/components/card/downloadCard/DownloadCard.d.ts +11 -0
- package/lib/components/card/downloadCard/DownloadCard.js +8 -0
- package/lib/components/card/downloadCard/DownloadCard.module.css +27 -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 +34 -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 +63 -0
- package/lib/components/card/index.d.ts +7 -0
- package/lib/components/card/index.js +7 -0
- package/lib/components/card/infoCard/InfoCard.d.ts +8 -0
- package/lib/components/card/infoCard/InfoCard.js +6 -0
- package/lib/components/card/infoCard/InfoCard.module.css +26 -0
- package/lib/components/card/richContentCard/RichContentCard.d.ts +19 -0
- package/lib/components/card/richContentCard/RichContentCard.js +15 -0
- package/lib/components/card/richContentCard/RichContentCard.module.css +93 -0
- package/lib/components/codeBlock/CodeBlock.d.ts +6 -0
- package/lib/components/codeBlock/CodeBlock.js +3 -0
- package/lib/components/codeBlock/CodeBlock.module.css +6 -0
- package/lib/components/container/Container.d.ts +6 -0
- package/lib/components/container/Container.js +4 -0
- package/lib/components/container/Container.module.css +9 -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/denhaag-wrappers/pagination/Pagination.css +120 -0
- package/lib/components/denhaag-wrappers/pagination/Pagination.d.ts +9 -0
- package/lib/components/denhaag-wrappers/pagination/Pagination.js +15 -0
- package/lib/components/editableTableRow/EditableTableRow.d.ts +14 -0
- package/lib/components/editableTableRow/EditableTableRow.js +31 -0
- package/lib/components/editableTableRow/EditableTableRow.module.css +25 -0
- package/lib/components/formFields/checkbox.d.ts +9 -0
- package/lib/components/formFields/checkbox.js +3 -0
- package/lib/components/formFields/createKeyValue/CreateKeyValue.d.ts +18 -0
- package/lib/components/formFields/createKeyValue/CreateKeyValue.js +31 -0
- package/lib/components/formFields/createKeyValue/CreateKeyValue.module.css +43 -0
- package/lib/components/formFields/index.d.ts +7 -0
- package/lib/components/formFields/index.js +7 -0
- package/lib/components/formFields/input.d.ts +22 -0
- package/lib/components/formFields/input.js +16 -0
- package/lib/components/formFields/radio.d.ts +9 -0
- package/lib/components/formFields/radio.js +3 -0
- package/lib/components/formFields/select/select.d.ts +18 -0
- package/lib/components/formFields/select/select.js +21 -0
- package/lib/components/formFields/select/select.module.css +38 -0
- package/lib/components/formFields/textarea.d.ts +8 -0
- package/lib/components/formFields/textarea.js +3 -0
- package/lib/components/formFields/types.d.ts +6 -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/metaIcon/MetaIcon.d.ts +7 -0
- package/lib/components/metaIcon/MetaIcon.js +3 -0
- package/lib/components/metaIcon/MetaIcon.module.css +29 -0
- package/lib/components/notificationPopUp/NotificationPopUp.d.ts +24 -0
- package/lib/components/notificationPopUp/NotificationPopUp.js +31 -0
- package/lib/components/notificationPopUp/NotificationPopUp.module.css +61 -0
- package/lib/components/privateRoute/PrivateRoute.d.ts +6 -0
- package/lib/components/privateRoute/PrivateRoute.js +15 -0
- package/lib/components/quoteWrapper/QuoteWrapper.d.ts +7 -0
- package/lib/components/quoteWrapper/QuoteWrapper.js +5 -0
- package/lib/components/quoteWrapper/QuoteWrapper.module.css +12 -0
- package/lib/components/statusSteps/StatusSteps.d.ts +13 -0
- package/lib/components/statusSteps/StatusSteps.js +5 -0
- package/lib/components/tag/Tag.d.ts +10 -0
- package/lib/components/tag/Tag.js +6 -0
- package/lib/components/tag/Tag.module.css +44 -0
- package/lib/components/toolTip/ToolTip.d.ts +9 -0
- package/lib/components/toolTip/ToolTip.js +7 -0
- package/lib/components/toolTip/ToolTip.module.css +4 -0
- package/lib/components/topNav/index.d.ts +3 -0
- package/lib/components/topNav/index.js +3 -0
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.d.ts +20 -0
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.js +17 -0
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.module.css +145 -0
- package/lib/components/topNav/secondaryTopNav/SecondaryTopNav.d.ts +12 -0
- package/lib/components/topNav/secondaryTopNav/SecondaryTopNav.js +7 -0
- package/lib/components/topNav/secondaryTopNav/SecondaryTopNav.module.css +63 -0
- package/lib/index.d.ts +27 -0
- package/lib/index.js +20 -0
- package/package.json +2 -7
- package/src/components/topNav/primaryTopNav/PrimaryTopNav.module.css +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
.denhaag-breadcrumb {
|
|
2
|
+
--denhaag-breadcrumb-chevron-display: none;
|
|
3
|
+
--denhaag-breadcrumb-link-background-color: transparent;
|
|
4
|
+
--denhaag-breadcrumb-link-icon-content: "";
|
|
5
|
+
--denhaag-breadcrumb-link-pointer-events: bounding-box;
|
|
6
|
+
--denhaag-breadcrumb-item-display: none;
|
|
7
|
+
|
|
8
|
+
background-color: var(--denhaag-breadcrumb-background-color, transparent);
|
|
9
|
+
color: var(--denhaag-breadcrumb-color, inherit);
|
|
10
|
+
padding-block-end: var(--denhaag-breadcrumb-padding-block);
|
|
11
|
+
padding-block-start: var(--denhaag-breadcrumb-padding-block);
|
|
12
|
+
padding-inline-end: var(--denhaag-breadcrumb-padding-inline);
|
|
13
|
+
padding-inline-start: var(--denhaag-breadcrumb-padding-inline);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.denhaag-breadcrumb__list {
|
|
17
|
+
block-size: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
margin-block-end: 0;
|
|
20
|
+
margin-block-start: 0;
|
|
21
|
+
margin-inline-end: auto;
|
|
22
|
+
margin-inline-start: auto;
|
|
23
|
+
max-width: var(--denhaag-breadcrumb-list-max-width, 100%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
ol.denhaag-breadcrumb__list {
|
|
27
|
+
list-style: none;
|
|
28
|
+
padding-inline-start: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.denhaag-breadcrumb__item {
|
|
32
|
+
align-items: center;
|
|
33
|
+
display: var(--denhaag-breadcrumb-item-display);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.denhaag-breadcrumb__item:nth-last-child(2) {
|
|
37
|
+
--denhaag-breadcrumb-item-display: flex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.denhaag-breadcrumb__item:nth-last-child(2)
|
|
41
|
+
> .denhaag-breadcrumb__link::before {
|
|
42
|
+
background: var(--denhaag-breadcrumb-link-color);
|
|
43
|
+
clip-path: path(
|
|
44
|
+
"M6.756 12.0899C6.43057 12.4153 5.90293 12.4153 5.57749 12.0899L0.577491 7.0899C0.421212 6.93362 0.333414 6.72166 0.333414 6.50065C0.333414 6.27964 0.421212 6.06767 0.577491 5.91139L5.57749 0.911394C5.90293 0.585957 6.43057 0.585957 6.756 0.911394C7.08144 1.23683 7.08144 1.76447 6.756 2.08991L3.17859 5.66732L12.8334 5.66732C13.2937 5.66732 13.6667 6.04041 13.6667 6.50065C13.6667 6.96089 13.2937 7.33398 12.8334 7.33398L3.17859 7.33398L6.756 10.9114C7.08144 11.2368 7.08144 11.7645 6.756 12.0899Z"
|
|
45
|
+
);
|
|
46
|
+
content: var(--denhaag-breadcrumb-link-icon-content);
|
|
47
|
+
height: var(
|
|
48
|
+
--denhaag-breadcrumb-link-icon-height,
|
|
49
|
+
var(--denhaag-breadcrumb-link-icon-width)
|
|
50
|
+
);
|
|
51
|
+
margin-inline-end: var(
|
|
52
|
+
--denhaag-breadcrumb-link-icon-margin-inline,
|
|
53
|
+
var(--denhaag-breadcrumb-link-icon-width)
|
|
54
|
+
);
|
|
55
|
+
width: var(--denhaag-breadcrumb-link-icon-width);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.denhaag-breadcrumb__item:not(:first-child):not(:nth-last-child(2)):not(:last-child) {
|
|
59
|
+
--denhaag-breadcrumb-link-background-color: var(
|
|
60
|
+
--denhaag-breadcrumb-dots-background-color,
|
|
61
|
+
inherit
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.denhaag-breadcrumb__item:not(:first-child):not(:nth-last-child(2)):not(:last-child):hover {
|
|
66
|
+
--denhaag-breadcrumb-link-background-color: var(
|
|
67
|
+
--denhaag-breadcrumb-dots-hover-background-color,
|
|
68
|
+
inherit
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.denhaag-breadcrumb__link {
|
|
73
|
+
align-items: center;
|
|
74
|
+
color: var(--denhaag-breadcrumb-link-color, inherit);
|
|
75
|
+
display: flex;
|
|
76
|
+
padding-block-start: var(--denhaag-breadcrumb-spacing, 8px);
|
|
77
|
+
padding-block-end: var(--denhaag-breadcrumb-spacing, 8px);
|
|
78
|
+
padding-inline-start: var(--denhaag-breadcrumb-spacing, 8px);
|
|
79
|
+
padding-inline-end: var(--denhaag-breadcrumb-spacing, 8px);
|
|
80
|
+
pointer-events: var(--denhaag-breadcrumb-link-pointer-events);
|
|
81
|
+
position: relative;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.denhaag-breadcrumb__link:hover,
|
|
85
|
+
.denhaag-breadcrumb__link--hover {
|
|
86
|
+
--denhaag-breadcrumb-link-color: var(
|
|
87
|
+
--denhaag-breadcrumb-link-hover-color,
|
|
88
|
+
inherit
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.denhaag-breadcrumb__link:focus,
|
|
93
|
+
.denhaag-breadcrumb__link--focus {
|
|
94
|
+
--denhaag-breadcrumb-link-color: var(
|
|
95
|
+
--denhaag-breadcrumb-link-focus-color,
|
|
96
|
+
inherit
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
outline: var(
|
|
100
|
+
--denhaag-breadcrumb-link-focus-outline,
|
|
101
|
+
var(--denhaag-link-focus-outline)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.denhaag-breadcrumb__link--current,
|
|
106
|
+
.denhaag-breadcrumb__link.denhaag-link--current,
|
|
107
|
+
.denhaag-breadcrumb__item:last-child > .denhaag-breadcrumb__link {
|
|
108
|
+
--denhaag-breadcrumb-link-color: var(
|
|
109
|
+
--denhaag-breadcrumb-current-color,
|
|
110
|
+
var(--denhaag-breadcrumb-color, inherit)
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
text-decoration: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.denhaag-breadcrumb__link:not(.denhaag-breadcrumb__link--current):not(.denhaag-breadcrumb__link.denhaag-link--current):not(:last-child
|
|
117
|
+
> .denhaag-breadcrumb__link)
|
|
118
|
+
> :first-child {
|
|
119
|
+
pointer-events: bounding-box;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* SVG for the separator */
|
|
123
|
+
.denhaag-breadcrumb__link > .denhaag-icon + .denhaag-icon,
|
|
124
|
+
.denhaag-breadcrumb__link > .denhaag-breadcrumb__text + .denhaag-icon {
|
|
125
|
+
color: initial;
|
|
126
|
+
font-size: inherit;
|
|
127
|
+
display: var(--denhaag-breadcrumb-chevron-display);
|
|
128
|
+
margin-inline-start: var(--denhaag-breadcrumb-spacing, 8px);
|
|
129
|
+
margin-inline-end: calc(-1 * var(--denhaag-breadcrumb-spacing, 8px));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
[dir="rtl"]
|
|
133
|
+
.denhaag-breadcrumb__link
|
|
134
|
+
> .denhaag-breadcrumb__text
|
|
135
|
+
+ .denhaag-icon,
|
|
136
|
+
[dir="rtl"]
|
|
137
|
+
.denhaag-breadcrumb__item:nth-last-child(2)
|
|
138
|
+
> .denhaag-breadcrumb__link::before {
|
|
139
|
+
transform: scaleX(-1);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.denhaag-breadcrumb__text {
|
|
143
|
+
background-color: var(--denhaag-breadcrumb-link-background-color);
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
position: relative;
|
|
146
|
+
text-overflow: ellipsis;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.denhaag-breadcrumb__item:not(:first-child):not(:nth-last-child(2)):not(:last-child)
|
|
150
|
+
.denhaag-breadcrumb__text {
|
|
151
|
+
aspect-ratio: 24/16;
|
|
152
|
+
border-radius: var(
|
|
153
|
+
--denhaag-breadcrumb-dots-border-radius,
|
|
154
|
+
var(--denhaag-border-radius)
|
|
155
|
+
);
|
|
156
|
+
max-width: calc(var(--denhaag-breadcrumb-spacing, 8px) * 3);
|
|
157
|
+
text-indent: calc(var(--denhaag-breadcrumb-spacing, 8px) * 3);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.denhaag-breadcrumb__item:not(:first-child):not(:nth-last-child(2)):not(:last-child)
|
|
161
|
+
.denhaag-breadcrumb__text::before {
|
|
162
|
+
color: var(--denhaag-breadcrumb-dots-color, inherit);
|
|
163
|
+
content: "...";
|
|
164
|
+
left: calc(50% - 7px);
|
|
165
|
+
line-height: 0;
|
|
166
|
+
position: absolute;
|
|
167
|
+
text-indent: 0;
|
|
168
|
+
top: calc(50% - 5px);
|
|
169
|
+
vertical-align: baseline;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@media (min-width: 481px) {
|
|
173
|
+
.denhaag-breadcrumb {
|
|
174
|
+
--denhaag-breadcrumb-chevron-display: inline-block;
|
|
175
|
+
--denhaag-breadcrumb-link-icon-content: unset;
|
|
176
|
+
--denhaag-breadcrumb-link-pointer-events: none;
|
|
177
|
+
--denhaag-breadcrumb-padding-block: var(
|
|
178
|
+
--denhaag-breadcrumb-padding-block-md
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.denhaag-breadcrumb__item:not(:nth-last-child(2)) {
|
|
183
|
+
--denhaag-breadcrumb-item-display: flex;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@media (min-width: 1124px) {
|
|
188
|
+
.denhaag-breadcrumb {
|
|
189
|
+
--denhaag-breadcrumb-padding-inline: 0;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:root {
|
|
194
|
+
--denhaag-breadcrumb-link-hover-color: var(--denhaag-color-blue-4);
|
|
195
|
+
--denhaag-breadcrumb-link-focus-color: var(--denhaag-color-blue-4);
|
|
196
|
+
--denhaag-breadcrumb-link-color: var(--denhaag-color-blue-3);
|
|
197
|
+
--denhaag-breadcrumb-dots-hover-background-color: var(--denhaag-color-grey-2);
|
|
198
|
+
--denhaag-breadcrumb-dots-color: var(--denhaag-color-grey-3);
|
|
199
|
+
--denhaag-breadcrumb-dots-border-radius: var(--denhaag-border-radius);
|
|
200
|
+
--denhaag-breadcrumb-dots-background-color: var(--denhaag-color-grey-1);
|
|
201
|
+
--denhaag-breadcrumb-current-color: var(--denhaag-color-grey-4);
|
|
202
|
+
--denhaag-breadcrumb-spacing: var(--denhaag-space-inline-xs);
|
|
203
|
+
--denhaag-breadcrumb-color: var(--denhaag-color-grey-4);
|
|
204
|
+
--denhaag-breadcrumb-background-color: var(--denhaag-color-warmgrey-1);
|
|
205
|
+
--denhaag-breadcrumb-link-focus-outline: var(--denhaag-focus-border);
|
|
206
|
+
--utrecht-breadcrumb-item-padding-inline-start: 14px;
|
|
207
|
+
--utrecht-breadcrumb-item-padding-inline-end: 14px;
|
|
208
|
+
--utrecht-breadcrumb-divider-inline-size: 24px;
|
|
209
|
+
--utrecht-breadcrumb-divider-content: ›;
|
|
210
|
+
--denhaag-breadcrumb-list-max-width: 67.5rem;
|
|
211
|
+
--denhaag-breadcrumb-link-icon-margin-inline: 0.75rem;
|
|
212
|
+
--denhaag-breadcrumb-link-icon-width: 0.875rem;
|
|
213
|
+
--denhaag-breadcrumb-link-icon-height: 0.875rem;
|
|
214
|
+
--denhaag-breadcrumb-padding-inline: 0.75rem;
|
|
215
|
+
--denhaag-breadcrumb-padding-block-md: 0.75rem;
|
|
216
|
+
--denhaag-breadcrumb-padding-block: 1rem;
|
|
217
|
+
--utrecht-breadcrumb-link-focus-color: var(--denhaag-color-blue-3);
|
|
218
|
+
--utrecht-breadcrumb-link-color: var(--denhaag-color-blue-4);
|
|
219
|
+
--utrecht-breadcrumb-font-size: var(
|
|
220
|
+
--denhaag-typography-scale-base-font-size
|
|
221
|
+
);
|
|
222
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a wrapper element based on https://nl-design-system.github.io/denhaag/?path=/docs/css-navigation-breadcrumb--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 "./Breadcrumbs.css";
|
|
10
|
+
interface BreadcrumbsProps {
|
|
11
|
+
crumbs: {
|
|
12
|
+
pathname: string;
|
|
13
|
+
crumbLabel: string;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
export declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* This is a wrapper element based on https://nl-design-system.github.io/denhaag/?path=/docs/css-navigation-breadcrumb--default-story
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: DO NOT MAKE CHANGES TO THIS FILE, AS ALL CHANGES WILL BE LOST UPON PACKAGE IMPLEMENTATION
|
|
6
|
+
*
|
|
7
|
+
* Note: we do not use css modules here due to this component being a wrapper
|
|
8
|
+
*/
|
|
9
|
+
import { Link } from "gatsby";
|
|
10
|
+
import "./Breadcrumbs.css";
|
|
11
|
+
export const Breadcrumbs = ({ crumbs }) => {
|
|
12
|
+
return (_jsx("nav", { "aria-label": "Breadcrumb", className: "denhaag-breadcrumb", children: _jsx("ol", { className: "denhaag-breadcrumb__list", itemScope: true, itemType: "https://schema.org/BreadcrumbList", children: crumbs.map((crumb, idx) => {
|
|
13
|
+
if (crumbs.length !== idx + 1) {
|
|
14
|
+
return _jsx(CrumbItem, { ...crumb, ...{ idx } }, idx);
|
|
15
|
+
}
|
|
16
|
+
return _jsx(LastCrumbItem, { ...crumb, ...{ idx } }, idx);
|
|
17
|
+
}) }) }));
|
|
18
|
+
};
|
|
19
|
+
const CrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { className: "denhaag-breadcrumb__link", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", focusable: "false", height: "1em", "shape-rendering": "auto", viewBox: "0 0 24 24", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M9.293 18.707a1 1 0 010-1.414L14.586 12 9.293 6.707a1 1 0 011.414-1.414l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0z", fill: "currentColor" }) }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
|
|
20
|
+
const LastCrumbItem = ({ pathname, crumbLabel, idx }) => (_jsx("li", { "aria-current": "page", className: "denhaag-breadcrumb__item", itemProp: "itemListElement", itemScope: true, itemType: "https://schema.org/ListItem", children: _jsxs(Link, { "aria-current": "page", className: "denhaag-breadcrumb__link denhaag-breadcrumb__link--current", to: pathname, itemProp: "item", children: [_jsx("span", { className: "denhaag-breadcrumb__text", itemProp: "name", children: crumbLabel }), _jsx("meta", { content: idx.toString(), itemProp: "position" })] }) }));
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.denhaag-pagination {
|
|
2
|
+
--denhaag-pagination-align: center;
|
|
3
|
+
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
justify-content: var(--denhaag-pagination-align);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (min-width: 640px) {
|
|
11
|
+
.denhaag-pagination,
|
|
12
|
+
.denhaag-pagination--start {
|
|
13
|
+
--denhaag-pagination-align: flex-start;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.denhaag-pagination--center {
|
|
17
|
+
--denhaag-pagination-align: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.denhaag-pagination--end {
|
|
21
|
+
--denhaag-pagination-align: end;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.denhaag-pagination__links {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.denhaag-pagination__link {
|
|
31
|
+
aspect-ratio: 1 / 1;
|
|
32
|
+
align-items: center;
|
|
33
|
+
background-color: var(--denhaag-pagination-background-color, transparent);
|
|
34
|
+
border: 0;
|
|
35
|
+
border-radius: var(
|
|
36
|
+
--denhaag-pagination-border-radius,
|
|
37
|
+
var(--denhaag-border-radius)
|
|
38
|
+
);
|
|
39
|
+
color: var(--denhaag-pagination-color, var(--denhaag-pagination-link-color));
|
|
40
|
+
display: flex;
|
|
41
|
+
height: var(--denhaag-pagination-size);
|
|
42
|
+
justify-content: center;
|
|
43
|
+
line-height: 1.5;
|
|
44
|
+
position: relative;
|
|
45
|
+
text-align: center;
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
width: var(--denhaag-pagination-size);
|
|
48
|
+
font-style: normal;
|
|
49
|
+
font-weight: var(--denhaag-pagination-font-weight);
|
|
50
|
+
font-size: var(--denhaag-pagination-font-size);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.denhaag-pagination__link:hover,
|
|
54
|
+
.denhaag-pagination__link--hover {
|
|
55
|
+
--denhaag-pagination-color: var(--denhaag-pagination-link-hover-color);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.denhaag-pagination__link:focus,
|
|
60
|
+
.denhaag-pagination__link--focus {
|
|
61
|
+
outline: var(--denhaag-link-focus-outline);
|
|
62
|
+
border-radius: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.denhaag-pagination__link:disabled,
|
|
66
|
+
.denhaag-pagination__link--disabled {
|
|
67
|
+
--denhaag-pagination-color: var(--denhaag-pagination-link-disabled-color);
|
|
68
|
+
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.denhaag-pagination__link--arrow {
|
|
73
|
+
--denhaag-pagination-size: var(--denhaag-pagination-arrow-size);
|
|
74
|
+
--denhaag-pagination-font-size: var(--denhaag-pagination-arrow-font-size);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[dir="rtl"] .denhaag-pagination__link--arrow {
|
|
78
|
+
transform: scaleX(-1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.denhaag-pagination__link + .denhaag-pagination__links,
|
|
82
|
+
.denhaag-pagination__links + .denhaag-pagination__link {
|
|
83
|
+
margin-inline-start: var(--denhaag-pagination-margin-inline, 10px);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.denhaag-pagination__link:not(:first-child):not(:last-child):not(.denhaag-pagination__link--current):not([rel]) {
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
text-indent: calc(var(--denhaag-pagination-size) * 2);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.denhaag-pagination__link:not(:first-child):not(:last-child):not(.denhaag-pagination__link--current):not([rel])::before {
|
|
93
|
+
content: "...";
|
|
94
|
+
left: calc(50% - 7px);
|
|
95
|
+
line-height: 0;
|
|
96
|
+
position: absolute;
|
|
97
|
+
text-indent: 0;
|
|
98
|
+
vertical-align: baseline;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.denhaag-pagination__link--current {
|
|
102
|
+
--denhaag-pagination-color: var(--denhaag-pagination-link-current-color);
|
|
103
|
+
--denhaag-pagination-font-weight: var(
|
|
104
|
+
--denhaag-pagination-link-current-font-weight
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.denhaag-pagination__link--current.denhaag-pagination__link:disabled,
|
|
109
|
+
.denhaag-pagination__link--current.denhaag-pagination__link--disabled {
|
|
110
|
+
--denhaag-pagination-color: var(
|
|
111
|
+
--denhaag-pagination-link-current-disabled-color
|
|
112
|
+
);
|
|
113
|
+
--denhaag-pagination-background-color: var(
|
|
114
|
+
--denhaag-pagination-link-current-disabled-background-color
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.denhaag-pagination .denhaag-icon {
|
|
119
|
+
font-size: inherit;
|
|
120
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import "./Pagination.css";
|
|
4
|
+
export const Pagination = ({ pages, currentPage, setPage }) => {
|
|
5
|
+
return (_jsxs("nav", { className: "denhaag-pagination", children: [_jsx(PreviousButton, { previousPage: currentPage > 1 ? currentPage - 1 : undefined, ...{ setPage } }), _jsx("span", { className: "denhaag-pagination__links", role: "group", children: Array.from({ length: pages }, (_, i) => i + 1).map((page, idx) => (_jsx(Link, { ...{ page }, current: page === currentPage, ...{ setPage } }, idx))) }), _jsx(NextButton, { nextPage: currentPage < pages ? currentPage + 1 : undefined, ...{ setPage } })] }));
|
|
6
|
+
};
|
|
7
|
+
const Link = ({ page, current, setPage }) => {
|
|
8
|
+
return (_jsx("a", { "aria-current": current && "page", "aria-label": `Page ${page}`, className: clsx("denhaag-pagination__link", current && "denhaag-pagination__link--current"), onClick: () => setPage(page), children: page }));
|
|
9
|
+
};
|
|
10
|
+
const PreviousButton = ({ previousPage, setPage }) => {
|
|
11
|
+
return (_jsx("a", { "aria-label": "Previous page", className: clsx("denhaag-pagination__link denhaag-pagination__link--arrow", !previousPage && "denhaag-pagination__link--disabled"), onClick: () => previousPage && setPage(previousPage), 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" }) }) }));
|
|
12
|
+
};
|
|
13
|
+
const NextButton = ({ nextPage, setPage }) => {
|
|
14
|
+
return (_jsx("a", { "aria-label": "Next page", className: clsx("denhaag-pagination__link denhaag-pagination__link--arrow", !nextPage && "denhaag-pagination__link--disabled"), onClick: () => nextPage && setPage(nextPage), 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" }) }) }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface InputTypes {
|
|
3
|
+
inputType: "text" | "email";
|
|
4
|
+
}
|
|
5
|
+
interface EditableTableRowProps {
|
|
6
|
+
thead: string;
|
|
7
|
+
value: string;
|
|
8
|
+
saveLabel: string;
|
|
9
|
+
cancelLabel: string;
|
|
10
|
+
editLabel: string;
|
|
11
|
+
handleSave: (value: any) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const EditableTableRow: React.FC<EditableTableRowProps & InputTypes>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
3
|
+
import * as styles from "./EditableTableRow.module.css";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Link } from "@gemeente-denhaag/components-react";
|
|
6
|
+
import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
import { InputEmail, InputText } from "../formFields";
|
|
9
|
+
export const EditableTableRow = ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }) => {
|
|
10
|
+
const [editing, setEditing] = React.useState(false);
|
|
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 } })] }));
|
|
12
|
+
};
|
|
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 }) }) })] }));
|
|
15
|
+
};
|
|
16
|
+
const EditingTableRow = ({ value, setEditing, handleSave, inputType, saveLabel, cancelLabel, }) => {
|
|
17
|
+
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
18
|
+
const onSubmit = (data) => {
|
|
19
|
+
handleSave(data.value);
|
|
20
|
+
setEditing(false);
|
|
21
|
+
};
|
|
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, {})] }));
|
|
23
|
+
};
|
|
24
|
+
const FormField = ({ inputType, value, register, errors }) => {
|
|
25
|
+
switch (inputType) {
|
|
26
|
+
case "email":
|
|
27
|
+
return _jsx(InputEmail, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
|
|
28
|
+
case "text":
|
|
29
|
+
return _jsx(InputText, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.th {
|
|
2
|
+
width: 35%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cancel {
|
|
6
|
+
color: var(--skeleton-color-grey-3) !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.editButtonsContainer {
|
|
10
|
+
display: flex;
|
|
11
|
+
margin-block-start: var(--skeleton-size-xs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.editButtonsContainer > *:not(:last-child) {
|
|
15
|
+
margin-inline-end: var(--skeleton-size-md);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.submit {
|
|
19
|
+
all: unset;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.editButton {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IReactHookFormProps } from "./types";
|
|
3
|
+
export interface ICheckboxProps {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FormControlLabel } from "@gemeente-denhaag/components-react";
|
|
3
|
+
export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsx(FormControlLabel, { input: _jsx("input", { type: "checkbox", id: `checkbox${name}`, ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), ...{ label } }));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Control, FieldValues } from "react-hook-form";
|
|
3
|
+
import { IReactHookFormProps } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Export KeyValue input component (wrapped in FormFieldGroup)
|
|
6
|
+
*/
|
|
7
|
+
interface CreateKeyValueProps {
|
|
8
|
+
name: string;
|
|
9
|
+
control: Control<FieldValues, any>;
|
|
10
|
+
defaultValue?: IKeyValue[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface IKeyValue {
|
|
14
|
+
key: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const CreateKeyValue: React.FC<CreateKeyValueProps & IReactHookFormProps>;
|
|
18
|
+
export {};
|
|
@@ -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 "./CreateKeyValue.module.css";
|
|
4
|
+
import { Controller } from "react-hook-form";
|
|
5
|
+
import { Button } from "@gemeente-denhaag/components-react";
|
|
6
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
7
|
+
export const CreateKeyValue = ({ name, errors, control, validation, defaultValue, disabled, }) => {
|
|
8
|
+
return (_jsx(Controller, { ...{ control, name, errors }, rules: validation, render: ({ field: { onChange } }) => {
|
|
9
|
+
return _jsx(KeyValueComponent, { handleChange: onChange, ...{ defaultValue, errors, disabled } });
|
|
10
|
+
} }));
|
|
11
|
+
};
|
|
12
|
+
const KeyValueComponent = ({ defaultValue, handleChange, disabled }) => {
|
|
13
|
+
const [currentKey, setCurrentKey] = React.useState("");
|
|
14
|
+
const [currentValue, setCurrentValue] = React.useState("");
|
|
15
|
+
const [keyValues, setKeyValues] = React.useState(defaultValue ?? []);
|
|
16
|
+
const currentKeyRef = React.useRef(null);
|
|
17
|
+
const currentValueRef = React.useRef(null);
|
|
18
|
+
const handleCreate = () => {
|
|
19
|
+
const keyValue = { key: currentKey, value: currentValue };
|
|
20
|
+
setCurrentKey("");
|
|
21
|
+
setCurrentValue("");
|
|
22
|
+
setKeyValues([...keyValues, keyValue]);
|
|
23
|
+
};
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
defaultValue && setKeyValues(defaultValue);
|
|
26
|
+
}, [defaultValue]);
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
handleChange(keyValues);
|
|
29
|
+
}, [keyValues]);
|
|
30
|
+
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableHeader, { children: "Key" }), _jsx(TableHeader, { children: "Value" }), _jsx(TableHeader, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { className: styles.tdDelete, children: _jsx(Button, { onClick: () => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue)), children: "Delete" }) })] }, `${keyValue}${idx}`))) })] })), _jsxs("div", { className: styles.form, children: [_jsx("input", { type: "text", placeholder: "Key", value: currentKey, ref: currentKeyRef, className: "denhaag-textfield__input", onChange: (e) => setCurrentKey(e.target.value), ...{ disabled } }), _jsx("input", { type: "text", placeholder: "Value", value: currentValue, ref: currentValueRef, className: "denhaag-textfield__input", onChange: (e) => setCurrentValue(e.target.value), ...{ disabled } }), _jsx(Button, { onClick: handleCreate, disabled: !currentKey || !currentValue || disabled, children: "Add" })] })] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--conduction-create-key-value-table-row-border: 1px solid var(--skeleton-color-grey-1);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.keyValue {
|
|
6
|
+
width: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.table {
|
|
12
|
+
border-collapse: collapse;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.table td,
|
|
16
|
+
.table th {
|
|
17
|
+
text-align: left;
|
|
18
|
+
padding-inline: 0;
|
|
19
|
+
padding-block: var(--skeleton-size-md);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.tdDelete {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.form {
|
|
28
|
+
width: 100%;
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.form > *:not(:last-child) {
|
|
33
|
+
margin-right: 10px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.form > input {
|
|
37
|
+
flex: 5;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.form > button {
|
|
41
|
+
flex: 2;
|
|
42
|
+
max-width: fit-content;
|
|
43
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputFile } from "./input";
|
|
2
|
+
import { Textarea } from "./textarea";
|
|
3
|
+
import { InputCheckbox } from "./checkbox";
|
|
4
|
+
import { InputRadio } from "./radio";
|
|
5
|
+
import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
|
|
6
|
+
import { CreateKeyValue, IKeyValue } from "./createKeyValue/CreateKeyValue";
|
|
7
|
+
export { InputRadio, InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, SelectCreate, CreateKeyValue, IKeyValue, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputFile, } from "./input";
|
|
2
|
+
import { Textarea } from "./textarea";
|
|
3
|
+
import { InputCheckbox } from "./checkbox";
|
|
4
|
+
import { InputRadio } from "./radio";
|
|
5
|
+
import { SelectSingle, SelectMultiple, SelectCreate } from "./select/select";
|
|
6
|
+
import { CreateKeyValue } from "./createKeyValue/CreateKeyValue";
|
|
7
|
+
export { InputRadio, InputText, InputPassword, InputEmail, InputURL, InputDate, InputDateTime, InputNumber, InputCheckbox, InputFile, Textarea, SelectSingle, SelectMultiple, SelectCreate, CreateKeyValue, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { IReactHookFormProps } from "./types";
|
|
3
|
+
export interface IInputProps {
|
|
4
|
+
name: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
icon?: JSX.Element;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const InputPassword: React.FC<IInputProps & IReactHookFormProps>;
|
|
11
|
+
export declare const InputText: React.FC<IInputProps & IReactHookFormProps>;
|
|
12
|
+
export declare const InputEmail: React.FC<IInputProps & IReactHookFormProps>;
|
|
13
|
+
export declare const InputURL: React.FC<IInputProps & IReactHookFormProps>;
|
|
14
|
+
export declare const InputDate: React.FC<IInputProps & IReactHookFormProps>;
|
|
15
|
+
export declare const InputDateTime: React.FC<IInputProps & IReactHookFormProps>;
|
|
16
|
+
export declare const InputNumber: React.FC<IInputProps & IReactHookFormProps>;
|
|
17
|
+
export declare const InputFloat: React.FC<IInputProps & IReactHookFormProps>;
|
|
18
|
+
interface IInputFileProps {
|
|
19
|
+
accept?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const InputFile: React.FC<IInputFileProps & IInputProps & IReactHookFormProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { TextField } from "@gemeente-denhaag/components-react";
|
|
4
|
+
import { ShowIcon, HideIcon } from "@gemeente-denhaag/icons";
|
|
5
|
+
export const InputPassword = ({ disabled, name, validation, register, placeholder, errors, }) => {
|
|
6
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
|
7
|
+
return (_jsx(TextField, { type: showPassword ? "text" : "password", ...{ disabled, placeholder }, ...register(name, { ...validation }), invalid: errors[name], icon: _jsx("span", { onClick: () => setShowPassword(!showPassword), children: showPassword ? _jsx(HideIcon, {}) : _jsx(ShowIcon, {}) }) }));
|
|
8
|
+
};
|
|
9
|
+
export const InputText = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "text", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
10
|
+
export const InputEmail = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "email", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
11
|
+
export const InputURL = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "url", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
12
|
+
export const InputDate = ({ disabled, name, defaultValue, validation, errors, register, }) => (_jsx(TextField, { type: "date", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
13
|
+
export const InputDateTime = ({ disabled, name, defaultValue, validation, register, errors, }) => (_jsx(TextField, { type: "datetime-local", ...{ defaultValue, disabled }, ...register(name, { ...validation }), invalid: errors[name] }));
|
|
14
|
+
export const InputNumber = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", ...{ defaultValue, disabled, placeholder, icon }, ...register(name, { ...validation, valueAsNumber: true }), invalid: errors[name] }));
|
|
15
|
+
export const InputFloat = ({ disabled, name, defaultValue, validation, register, icon, placeholder, errors, }) => (_jsx(TextField, { type: "number", step: ".01", ...{ disabled, placeholder, icon, defaultValue }, ...register(name, { ...validation, valueAsNumber: true }), invalid: errors[name] }));
|
|
16
|
+
export const InputFile = ({ disabled, name, accept, defaultValue, validation, register, }) => (_jsx("input", { className: "denhaag-textfield__input", type: "file", ...{ defaultValue, disabled, accept }, ...register(name, { ...validation }) }));
|