@developer-overheid-nl/don-register-components 1.1.0 → 1.3.0
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/CHANGELOG.md +118 -43
- package/LICENSE.md +291 -291
- package/README.md +20 -20
- package/package.json +3 -3
- package/src/alert/Alert.tsx +19 -19
- package/src/alert/styles.module.css +3 -3
- package/src/alignBox/AlignBox.tsx +114 -111
- package/src/alignBox/styles.module.css +110 -106
- package/src/amountLabel/AmountLabel.tsx +16 -0
- package/src/amountLabel/styles.module.css +11 -0
- package/src/analytics/PiwikPro.tsx +94 -72
- package/src/analytics/index.ts +1 -1
- package/src/article/Article.tsx +10 -10
- package/src/badgeList/BadgeList.tsx +34 -0
- package/src/badgeList/styles.module.css +37 -0
- package/src/block/Block.tsx +35 -35
- package/src/block/styles.module.css +29 -29
- package/src/button/Button.tsx +3 -3
- package/src/cardAsLink/CardAsLink.tsx +21 -21
- package/src/cardAsLink/styles.module.css +23 -23
- package/src/cardsList/CardsList.tsx +54 -54
- package/src/cardsList/styles.module.css +19 -19
- package/src/client.ts +7 -2
- package/src/container/Container.tsx +10 -10
- package/src/container/styles.module.css +28 -28
- package/src/copyButton/CopyButton.tsx +39 -39
- package/src/copyButton/styles.module.css +13 -13
- package/src/dataBadgeLink/DataBadgeLink.tsx +53 -50
- package/src/dataBadgeLink/styles.module.css +89 -43
- package/src/dataSummary/DataSummary.tsx +22 -22
- package/src/dataSummary/DataSummaryItem.tsx +21 -21
- package/src/dataSummary/styles.module.css +75 -70
- package/src/facetFilters/FacetFilters.tsx +367 -0
- package/src/facetFilters/styles.module.css +3 -0
- package/src/fieldset/FieldSet.tsx +3 -3
- package/src/filters/Filters.tsx +116 -115
- package/src/filters/styles.module.css +26 -26
- package/src/footer/Footer.tsx +76 -76
- package/src/footer/styles.module.css +103 -103
- package/src/formFieldCheckboxGroup/FormFieldCheckboxGroup.tsx +16 -0
- package/src/formFieldCheckboxGroup/styles.module.css +5 -0
- package/src/formFieldCheckboxOption/FormFieldCheckboxOption.tsx +26 -0
- package/src/formFieldCheckboxOption/styles.module.css +22 -0
- package/src/formFieldLabel/FormFieldLabel.tsx +23 -23
- package/src/formFieldRadioGroup/FormFieldRadioGroup.tsx +13 -0
- package/src/formFieldRadioGroup/styles.module.css +5 -0
- package/src/formFieldRadioOption/FormFieldRadioOption.tsx +75 -0
- package/src/formFieldRadioOption/styles.module.css +49 -0
- package/src/formFieldSwitch/FormFieldSwitch.tsx +79 -0
- package/src/formFieldSwitch/styles.module.css +32 -0
- package/src/formFieldTextInput/FormFieldTextInput.tsx +3 -3
- package/src/header/Header.tsx +137 -137
- package/src/header/styles.module.css +71 -71
- package/src/heading/Heading.tsx +15 -10
- package/src/headingGroup/HeadingGroup.tsx +48 -48
- package/src/headingGroup/styles.module.css +3 -3
- package/src/i18n.ts +25 -25
- package/src/iconBadge/IconBadge.tsx +35 -32
- package/src/iconBadge/getAppearance.ts +53 -47
- package/src/iconBadge/styles.module.css +19 -19
- package/src/iconsSprite/Icon.tsx +17 -17
- package/src/iconsSprite/IconsSprite.tsx +5 -5
- package/src/index.ts +107 -80
- package/src/infoButton/InfoButton.tsx +45 -0
- package/src/infoButton/styles.module.css +43 -0
- package/src/link/Link.tsx +10 -10
- package/src/markdown/Markdown.tsx +42 -42
- package/src/overlay/Overlay.tsx +18 -0
- package/src/overlay/styles.module.css +15 -0
- package/src/pagination/Pagination.tsx +267 -144
- package/src/pagination/styles.module.css +28 -13
- package/src/paragraph/Paragraph.tsx +24 -10
- package/src/paragraph/styles.module.css +6 -0
- package/src/pillBadge/PillBadge.examples.tsx +107 -107
- package/src/pillBadge/PillBadge.tsx +51 -51
- package/src/pillBadge/styles.module.css +214 -194
- package/src/readOnlyTextInput/ReadOnlyTextInput.tsx +24 -24
- package/src/readOnlyTextInput/styles.module.css +19 -19
- package/src/scoreBadge/ScoreBadge.tsx +133 -132
- package/src/search/Search.tsx +82 -66
- package/src/search/styles.module.css +39 -39
- package/src/siteLogo/SiteLogo.tsx +24 -24
- package/src/switch/Switch.tsx +86 -0
- package/src/switch/styles.module.css +7 -0
- package/src/toolTip/ToolTip.tsx +55 -0
- package/src/toolTip/styles.module.css +49 -0
- package/src/topNavigation/TopNavigation.tsx +67 -67
- package/src/topNavigation/styles.module.css +54 -54
- package/tsconfig.json +121 -121
package/src/alert/Alert.tsx
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Alert as RHCAlert,
|
|
3
|
-
type AlertProps as RHCAlertProps,
|
|
4
|
-
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
-
import clsx from "clsx";
|
|
6
|
-
import type { PropsWithChildren } from "react";
|
|
7
|
-
import styles from "./styles.module.css";
|
|
8
|
-
|
|
9
|
-
export interface AlertProps extends RHCAlertProps {
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const Alert = (props: PropsWithChildren<AlertProps>) => {
|
|
14
|
-
const { className } = props;
|
|
15
|
-
|
|
16
|
-
return <RHCAlert className={clsx(className, styles.alert)} {...props} />;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default Alert;
|
|
1
|
+
import {
|
|
2
|
+
Alert as RHCAlert,
|
|
3
|
+
type AlertProps as RHCAlertProps,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import type { PropsWithChildren } from "react";
|
|
7
|
+
import styles from "./styles.module.css";
|
|
8
|
+
|
|
9
|
+
export interface AlertProps extends RHCAlertProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Alert = (props: PropsWithChildren<AlertProps>) => {
|
|
14
|
+
const { className } = props;
|
|
15
|
+
|
|
16
|
+
return <RHCAlert className={clsx(className, styles.alert)} {...props} />;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default Alert;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.alert {
|
|
2
|
-
--utrecht-space-around: 1;
|
|
3
|
-
}
|
|
1
|
+
.alert {
|
|
2
|
+
--utrecht-space-around: 1;
|
|
3
|
+
}
|
|
@@ -1,111 +1,114 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import type React from "react";
|
|
3
|
-
import type { ReactNode } from "react";
|
|
4
|
-
import styles from "./styles.module.css";
|
|
5
|
-
|
|
6
|
-
type Align =
|
|
7
|
-
| "left"
|
|
8
|
-
| "center"
|
|
9
|
-
| "right"
|
|
10
|
-
| "top"
|
|
11
|
-
| "bottom"
|
|
12
|
-
| "middle"
|
|
13
|
-
| "top-left"
|
|
14
|
-
| "top-right"
|
|
15
|
-
| "bottom-left"
|
|
16
|
-
| "bottom-right"
|
|
17
|
-
| "stretch"
|
|
18
|
-
| "space-between"
|
|
19
|
-
| "space-around"
|
|
20
|
-
| "space-evenly";
|
|
21
|
-
|
|
22
|
-
type Gap = "none" | "small" | "medium" | "large";
|
|
23
|
-
|
|
24
|
-
export interface AlignBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
25
|
-
align?: Align;
|
|
26
|
-
gap?: Gap;
|
|
27
|
-
direction?: "row" | "column";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
styles
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import styles from "./styles.module.css";
|
|
5
|
+
|
|
6
|
+
type Align =
|
|
7
|
+
| "left"
|
|
8
|
+
| "center"
|
|
9
|
+
| "right"
|
|
10
|
+
| "top"
|
|
11
|
+
| "bottom"
|
|
12
|
+
| "middle"
|
|
13
|
+
| "top-left"
|
|
14
|
+
| "top-right"
|
|
15
|
+
| "bottom-left"
|
|
16
|
+
| "bottom-right"
|
|
17
|
+
| "stretch"
|
|
18
|
+
| "space-between"
|
|
19
|
+
| "space-around"
|
|
20
|
+
| "space-evenly";
|
|
21
|
+
|
|
22
|
+
type Gap = "none" | "small" | "medium" | "large";
|
|
23
|
+
|
|
24
|
+
export interface AlignBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
align?: Align;
|
|
26
|
+
gap?: Gap;
|
|
27
|
+
direction?: "row" | "column";
|
|
28
|
+
wrap?: boolean;
|
|
29
|
+
display?: "block" | "inline";
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const getAlignmentClass = (align: Align): string => {
|
|
34
|
+
switch (align) {
|
|
35
|
+
case "left":
|
|
36
|
+
return styles.left;
|
|
37
|
+
case "center":
|
|
38
|
+
return styles.center;
|
|
39
|
+
case "right":
|
|
40
|
+
return styles.right;
|
|
41
|
+
case "top":
|
|
42
|
+
return styles.top;
|
|
43
|
+
case "bottom":
|
|
44
|
+
return styles.bottom;
|
|
45
|
+
case "middle":
|
|
46
|
+
return styles.middle;
|
|
47
|
+
case "top-left":
|
|
48
|
+
return styles.topLeft;
|
|
49
|
+
case "top-right":
|
|
50
|
+
return styles.topRight;
|
|
51
|
+
case "bottom-left":
|
|
52
|
+
return styles.bottomLeft;
|
|
53
|
+
case "bottom-right":
|
|
54
|
+
return styles.bottomRight;
|
|
55
|
+
case "stretch":
|
|
56
|
+
return styles.stretch;
|
|
57
|
+
case "space-between":
|
|
58
|
+
return styles.spaceBetween;
|
|
59
|
+
case "space-around":
|
|
60
|
+
return styles.spaceAround;
|
|
61
|
+
case "space-evenly":
|
|
62
|
+
return styles.spaceEvenly;
|
|
63
|
+
default:
|
|
64
|
+
return styles.center;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const getGapClass = (gap: Gap): string => {
|
|
69
|
+
switch (gap) {
|
|
70
|
+
case "none":
|
|
71
|
+
return styles.gapNone;
|
|
72
|
+
case "small":
|
|
73
|
+
return styles.gapSmall;
|
|
74
|
+
case "medium":
|
|
75
|
+
return styles.gapMedium;
|
|
76
|
+
case "large":
|
|
77
|
+
return styles.gapLarge;
|
|
78
|
+
default:
|
|
79
|
+
return styles.gapMedium;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const AlignBox: React.FC<AlignBoxProps> = ({
|
|
84
|
+
align = "center",
|
|
85
|
+
gap = "none",
|
|
86
|
+
direction = "row",
|
|
87
|
+
wrap = false,
|
|
88
|
+
display = "block",
|
|
89
|
+
className,
|
|
90
|
+
children,
|
|
91
|
+
...restProps
|
|
92
|
+
}) => {
|
|
93
|
+
const alignmentClass = getAlignmentClass(align);
|
|
94
|
+
const gapClass = getGapClass(gap);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<div
|
|
98
|
+
className={clsx(
|
|
99
|
+
styles.alignBox,
|
|
100
|
+
styles[direction],
|
|
101
|
+
wrap && styles.wrap,
|
|
102
|
+
styles[display],
|
|
103
|
+
alignmentClass,
|
|
104
|
+
gapClass,
|
|
105
|
+
className ?? "",
|
|
106
|
+
)}
|
|
107
|
+
{...restProps}
|
|
108
|
+
>
|
|
109
|
+
{children}
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default AlignBox;
|
|
@@ -1,106 +1,110 @@
|
|
|
1
|
-
.alignBox {
|
|
2
|
-
display: flex;
|
|
3
|
-
inline-size: 100%;
|
|
4
|
-
|
|
5
|
-
:global(.no-shrink) {
|
|
6
|
-
flex-shrink: 0;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.inline {
|
|
11
|
-
inline-size: max-content;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.block {
|
|
15
|
-
inline-size: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.row {
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.column {
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.
|
|
97
|
-
gap: 0
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.
|
|
101
|
-
gap:
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.
|
|
105
|
-
gap:
|
|
106
|
-
}
|
|
1
|
+
.alignBox {
|
|
2
|
+
display: flex;
|
|
3
|
+
inline-size: 100%;
|
|
4
|
+
|
|
5
|
+
:global(.no-shrink) {
|
|
6
|
+
flex-shrink: 0;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.inline {
|
|
11
|
+
inline-size: max-content;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.block {
|
|
15
|
+
inline-size: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.row {
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.column {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.wrap {
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.left {
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: flex-start;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.center,
|
|
36
|
+
.middle {
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.right {
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: flex-end;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.top {
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.bottom {
|
|
52
|
+
align-items: flex-end;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.topLeft {
|
|
57
|
+
align-items: flex-start;
|
|
58
|
+
justify-content: flex-start;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.topRight {
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
justify-content: flex-end;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bottomLeft {
|
|
67
|
+
align-items: flex-end;
|
|
68
|
+
justify-content: flex-start;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.bottomRight {
|
|
72
|
+
align-items: flex-end;
|
|
73
|
+
justify-content: flex-end;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.stretch {
|
|
77
|
+
align-items: stretch;
|
|
78
|
+
justify-content: stretch;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.spaceBetween {
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: space-between;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.spaceAround {
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: space-around;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.spaceEvenly {
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: space-evenly;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.gapNone {
|
|
97
|
+
gap: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.gapSmall {
|
|
101
|
+
gap: 0.5rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.gapMedium {
|
|
105
|
+
gap: 1rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.gapLarge {
|
|
109
|
+
gap: 2rem;
|
|
110
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import styles from "./styles.module.css";
|
|
3
|
+
|
|
4
|
+
export interface AmountLabelProps {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
amount?: string | number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const AmountLabel = ({ label, amount }: AmountLabelProps) => (
|
|
10
|
+
<div className={styles.amountLabel}>
|
|
11
|
+
<span className={styles.labelText}>{label}</span>
|
|
12
|
+
{amount ? <span className={styles.amountText}>({amount})</span> : null}
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default AmountLabel;
|