@developer-overheid-nl/don-register-components 1.0.0 → 1.1.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 +43 -0
- package/LICENSE.md +291 -291
- package/README.md +20 -20
- package/package.json +10 -7
- package/src/alert/Alert.tsx +19 -19
- package/src/alert/styles.module.css +3 -3
- package/src/alignBox/AlignBox.tsx +111 -110
- package/src/alignBox/styles.module.css +106 -106
- package/src/analytics/PiwikPro.tsx +72 -0
- package/src/analytics/index.ts +1 -0
- package/src/article/Article.tsx +10 -10
- 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 +2 -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 +50 -50
- package/src/dataBadgeLink/styles.module.css +43 -43
- package/src/dataSummary/DataSummary.tsx +22 -22
- package/src/dataSummary/DataSummaryItem.tsx +21 -21
- package/src/dataSummary/styles.module.css +70 -70
- package/src/fieldset/FieldSet.tsx +3 -3
- package/src/filters/Filters.tsx +115 -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/formFieldLabel/FormFieldLabel.tsx +23 -23
- 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 +10 -10
- package/src/headingGroup/HeadingGroup.tsx +48 -48
- package/src/headingGroup/styles.module.css +3 -3
- package/src/i18n.ts +25 -24
- package/src/iconBadge/IconBadge.tsx +32 -32
- package/src/iconBadge/getAppearance.ts +47 -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 +80 -80
- package/src/link/Link.tsx +10 -10
- package/src/markdown/Markdown.tsx +42 -42
- package/src/pagination/Pagination.tsx +144 -144
- package/src/pagination/styles.module.css +13 -13
- package/src/paragraph/Paragraph.tsx +10 -10
- package/src/pillBadge/PillBadge.examples.tsx +107 -107
- package/src/pillBadge/PillBadge.tsx +51 -51
- package/src/pillBadge/styles.module.css +194 -194
- package/src/readOnlyTextInput/ReadOnlyTextInput.tsx +24 -24
- package/src/readOnlyTextInput/styles.module.css +19 -19
- package/src/scoreBadge/ScoreBadge.tsx +132 -132
- package/src/search/Search.tsx +66 -66
- package/src/search/styles.module.css +39 -39
- package/src/siteLogo/SiteLogo.tsx +24 -24
- package/src/topNavigation/TopNavigation.tsx +67 -64
- package/src/topNavigation/styles.module.css +54 -54
- package/tsconfig.json +121 -121
package/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Register Site Components
|
|
2
|
-
|
|
3
|
-
> Deze package bevat de generieke React componenten voor een register site.
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
[](https://www.npmjs.com/package/@developer-overheid-nl/don-register-components)
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
## Gebruik
|
|
10
|
-
|
|
11
|
-
Deze package wordt gebruikt in de register sites van developer.overheid.nl en in register-site-template repository.
|
|
12
|
-
|
|
13
|
-
De package heeft o.a. de volgende dependencies:
|
|
14
|
-
|
|
15
|
-
- [Rijkshuisstijl Community](https://www.rijkshuisstijl-community.nl/) voor de React componenten, CSS en design tokens
|
|
16
|
-
- [@developer-overheid-nl/don-register-locales](https://www.npmjs.com/package/@developer-overheid-nl/don-register-locales)
|
|
17
|
-
|
|
18
|
-
## Changelog
|
|
19
|
-
|
|
20
|
-
Zie de [CHANGELOG](./CHANGELOG.md) voor een overzicht van de wijzigingen in deze package.
|
|
1
|
+
# Register Site Components
|
|
2
|
+
|
|
3
|
+
> Deze package bevat de generieke React componenten voor een register site.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](https://www.npmjs.com/package/@developer-overheid-nl/don-register-components)
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Gebruik
|
|
10
|
+
|
|
11
|
+
Deze package wordt gebruikt in de register sites van developer.overheid.nl en in register-site-template repository.
|
|
12
|
+
|
|
13
|
+
De package heeft o.a. de volgende dependencies:
|
|
14
|
+
|
|
15
|
+
- [Rijkshuisstijl Community](https://www.rijkshuisstijl-community.nl/) voor de React componenten, CSS en design tokens
|
|
16
|
+
- [@developer-overheid-nl/don-register-locales](https://www.npmjs.com/package/@developer-overheid-nl/don-register-locales)
|
|
17
|
+
|
|
18
|
+
## Changelog
|
|
19
|
+
|
|
20
|
+
Zie de [CHANGELOG](./CHANGELOG.md) voor een overzicht van de wijzigingen in deze package.
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.1.0",
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -13,22 +13,25 @@
|
|
|
13
13
|
"exports": {
|
|
14
14
|
".": "./src/index.ts",
|
|
15
15
|
"./client": "./src/client.ts",
|
|
16
|
+
"./analytics": "./src/analytics/index.ts",
|
|
16
17
|
"./i18n": "./src/i18n.ts"
|
|
17
18
|
},
|
|
18
19
|
"main": "./src/index.ts",
|
|
19
20
|
"files": [
|
|
20
21
|
"src/",
|
|
21
|
-
"tsconfig.json"
|
|
22
|
+
"tsconfig.json",
|
|
23
|
+
"CHANGELOG.md"
|
|
22
24
|
],
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@rijkshuisstijl-community/components-
|
|
26
|
+
"@piwikpro/react-piwik-pro": "2.5.0",
|
|
27
|
+
"@rijkshuisstijl-community/components-css": "12.0.0",
|
|
28
|
+
"@rijkshuisstijl-community/components-react": "11.0.0",
|
|
26
29
|
"@rijkshuisstijl-community/design-tokens": "11.0.0",
|
|
27
30
|
"@types/parse-link-header": "^2.0.3",
|
|
28
31
|
"clsx": "2.1.1",
|
|
29
|
-
"i18next": "25.
|
|
32
|
+
"i18next": "25.8.4",
|
|
30
33
|
"parse-link-header": "^2.0.0",
|
|
31
|
-
"react-i18next": "16.5.
|
|
34
|
+
"react-i18next": "16.5.4",
|
|
32
35
|
"react-markdown": "10.1.0",
|
|
33
36
|
"remark-behead": "^3.1.0",
|
|
34
37
|
"@developer-overheid-nl/don-register-locales": "1.0.0"
|
|
@@ -37,7 +40,7 @@
|
|
|
37
40
|
"@vitejs/plugin-react": "^5.1.2",
|
|
38
41
|
"rimraf": "^6.1.2",
|
|
39
42
|
"typescript": "5.9.3",
|
|
40
|
-
"vite": "7.3.
|
|
43
|
+
"vite": "7.3.1",
|
|
41
44
|
"vite-plugin-dts": "^4.5.4"
|
|
42
45
|
},
|
|
43
46
|
"peerDependencies": {
|
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,110 +1,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 {
|
|
25
|
-
align?: Align;
|
|
26
|
-
gap?: Gap;
|
|
27
|
-
direction?: "row" | "column";
|
|
28
|
-
display?: "block" | "inline";
|
|
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
|
-
const alignmentClass = getAlignmentClass(align);
|
|
92
|
-
const gapClass = getGapClass(gap);
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<div
|
|
96
|
-
className={clsx(
|
|
97
|
-
styles.alignBox,
|
|
98
|
-
styles[direction],
|
|
99
|
-
styles[display],
|
|
100
|
-
alignmentClass,
|
|
101
|
-
gapClass,
|
|
102
|
-
className ?? "",
|
|
103
|
-
)}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
+
display?: "block" | "inline";
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const getAlignmentClass = (align: Align): string => {
|
|
33
|
+
switch (align) {
|
|
34
|
+
case "left":
|
|
35
|
+
return styles.left;
|
|
36
|
+
case "center":
|
|
37
|
+
return styles.center;
|
|
38
|
+
case "right":
|
|
39
|
+
return styles.right;
|
|
40
|
+
case "top":
|
|
41
|
+
return styles.top;
|
|
42
|
+
case "bottom":
|
|
43
|
+
return styles.bottom;
|
|
44
|
+
case "middle":
|
|
45
|
+
return styles.middle;
|
|
46
|
+
case "top-left":
|
|
47
|
+
return styles.topLeft;
|
|
48
|
+
case "top-right":
|
|
49
|
+
return styles.topRight;
|
|
50
|
+
case "bottom-left":
|
|
51
|
+
return styles.bottomLeft;
|
|
52
|
+
case "bottom-right":
|
|
53
|
+
return styles.bottomRight;
|
|
54
|
+
case "stretch":
|
|
55
|
+
return styles.stretch;
|
|
56
|
+
case "space-between":
|
|
57
|
+
return styles.spaceBetween;
|
|
58
|
+
case "space-around":
|
|
59
|
+
return styles.spaceAround;
|
|
60
|
+
case "space-evenly":
|
|
61
|
+
return styles.spaceEvenly;
|
|
62
|
+
default:
|
|
63
|
+
return styles.center;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const getGapClass = (gap: Gap): string => {
|
|
68
|
+
switch (gap) {
|
|
69
|
+
case "none":
|
|
70
|
+
return styles.gapNone;
|
|
71
|
+
case "small":
|
|
72
|
+
return styles.gapSmall;
|
|
73
|
+
case "medium":
|
|
74
|
+
return styles.gapMedium;
|
|
75
|
+
case "large":
|
|
76
|
+
return styles.gapLarge;
|
|
77
|
+
default:
|
|
78
|
+
return styles.gapMedium;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const AlignBox: React.FC<AlignBoxProps> = ({
|
|
83
|
+
align = "center",
|
|
84
|
+
gap = "none",
|
|
85
|
+
direction = "row",
|
|
86
|
+
display = "block",
|
|
87
|
+
className,
|
|
88
|
+
children,
|
|
89
|
+
...restProps
|
|
90
|
+
}) => {
|
|
91
|
+
const alignmentClass = getAlignmentClass(align);
|
|
92
|
+
const gapClass = getGapClass(gap);
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<div
|
|
96
|
+
className={clsx(
|
|
97
|
+
styles.alignBox,
|
|
98
|
+
styles[direction],
|
|
99
|
+
styles[display],
|
|
100
|
+
alignmentClass,
|
|
101
|
+
gapClass,
|
|
102
|
+
className ?? "",
|
|
103
|
+
)}
|
|
104
|
+
{...restProps}
|
|
105
|
+
>
|
|
106
|
+
{children}
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default AlignBox;
|
|
@@ -1,106 +1,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
|
-
.left {
|
|
27
|
-
align-items: center;
|
|
28
|
-
justify-content: flex-start;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.center,
|
|
32
|
-
.middle {
|
|
33
|
-
align-items: center;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.right {
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.top {
|
|
43
|
-
align-items: flex-start;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.bottom {
|
|
48
|
-
align-items: flex-end;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.topLeft {
|
|
53
|
-
align-items: flex-start;
|
|
54
|
-
justify-content: flex-start;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.topRight {
|
|
58
|
-
align-items: flex-start;
|
|
59
|
-
justify-content: flex-end;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.bottomLeft {
|
|
63
|
-
align-items: flex-end;
|
|
64
|
-
justify-content: flex-start;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.bottomRight {
|
|
68
|
-
align-items: flex-end;
|
|
69
|
-
justify-content: flex-end;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.stretch {
|
|
73
|
-
align-items: stretch;
|
|
74
|
-
justify-content: stretch;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.spaceBetween {
|
|
78
|
-
align-items: center;
|
|
79
|
-
justify-content: space-between;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.spaceAround {
|
|
83
|
-
align-items: center;
|
|
84
|
-
justify-content: space-around;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.spaceEvenly {
|
|
88
|
-
align-items: center;
|
|
89
|
-
justify-content: space-evenly;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.gapNone {
|
|
93
|
-
gap: 0;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.gapSmall {
|
|
97
|
-
gap: 0.5rem;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.gapMedium {
|
|
101
|
-
gap: 1rem;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.gapLarge {
|
|
105
|
-
gap: 2rem;
|
|
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
|
+
.left {
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: flex-start;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.center,
|
|
32
|
+
.middle {
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.right {
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.top {
|
|
43
|
+
align-items: flex-start;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.bottom {
|
|
48
|
+
align-items: flex-end;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.topLeft {
|
|
53
|
+
align-items: flex-start;
|
|
54
|
+
justify-content: flex-start;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.topRight {
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
justify-content: flex-end;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.bottomLeft {
|
|
63
|
+
align-items: flex-end;
|
|
64
|
+
justify-content: flex-start;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.bottomRight {
|
|
68
|
+
align-items: flex-end;
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.stretch {
|
|
73
|
+
align-items: stretch;
|
|
74
|
+
justify-content: stretch;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.spaceBetween {
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.spaceAround {
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: space-around;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.spaceEvenly {
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: space-evenly;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.gapNone {
|
|
93
|
+
gap: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.gapSmall {
|
|
97
|
+
gap: 0.5rem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.gapMedium {
|
|
101
|
+
gap: 1rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.gapLarge {
|
|
105
|
+
gap: 2rem;
|
|
106
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import PiwikPro, {
|
|
4
|
+
ContentTracking,
|
|
5
|
+
type Dimensions,
|
|
6
|
+
DownloadAndOutlink,
|
|
7
|
+
ErrorTracking,
|
|
8
|
+
PageViews,
|
|
9
|
+
SiteSearch,
|
|
10
|
+
} from "@piwikpro/react-piwik-pro";
|
|
11
|
+
import { useEffect } from "react";
|
|
12
|
+
|
|
13
|
+
interface AnalyticsProps {
|
|
14
|
+
siteId: string;
|
|
15
|
+
accountAddress: string;
|
|
16
|
+
dataLayerName?: string;
|
|
17
|
+
trackJSErrors?: boolean;
|
|
18
|
+
downloadExtensions?: string[];
|
|
19
|
+
pageTitle?: string;
|
|
20
|
+
isSearchPage?: boolean;
|
|
21
|
+
searchObject?: {
|
|
22
|
+
keyword: string;
|
|
23
|
+
category?: string;
|
|
24
|
+
searchCount?: number;
|
|
25
|
+
dimensions?: Dimensions;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Default extra download extensions in addition to the standard ones tracked by Piwik Pro.
|
|
30
|
+
const DOWNLOAD_EXTENSIONS = ["json", "yaml", "yml"];
|
|
31
|
+
|
|
32
|
+
export default function Analytics(props: AnalyticsProps) {
|
|
33
|
+
/* const nonce = `n.${Math.random() * 1000000}`; // TODO: replace with nanoid or uuid */
|
|
34
|
+
const {
|
|
35
|
+
siteId,
|
|
36
|
+
accountAddress,
|
|
37
|
+
dataLayerName,
|
|
38
|
+
trackJSErrors = true,
|
|
39
|
+
pageTitle,
|
|
40
|
+
isSearchPage,
|
|
41
|
+
searchObject,
|
|
42
|
+
} = props;
|
|
43
|
+
const downloadExtensions = [
|
|
44
|
+
...DOWNLOAD_EXTENSIONS,
|
|
45
|
+
...(props.downloadExtensions || []),
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
PiwikPro.initialize(siteId, accountAddress, {
|
|
49
|
+
/* nonce, */
|
|
50
|
+
dataLayerName,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
DownloadAndOutlink.addDownloadExtensions(downloadExtensions);
|
|
54
|
+
|
|
55
|
+
ContentTracking.trackAllContentImpressions();
|
|
56
|
+
ContentTracking.trackVisibleContentImpressions(true);
|
|
57
|
+
|
|
58
|
+
if (trackJSErrors) {
|
|
59
|
+
ErrorTracking.enableJSErrorTracking();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (pageTitle && !isSearchPage) {
|
|
64
|
+
PageViews.trackPageView(pageTitle);
|
|
65
|
+
} else if (isSearchPage && searchObject?.keyword) {
|
|
66
|
+
const { keyword, category, searchCount, dimensions } = searchObject;
|
|
67
|
+
SiteSearch.trackSiteSearch(keyword, category, searchCount, dimensions);
|
|
68
|
+
}
|
|
69
|
+
}, [pageTitle, isSearchPage, searchObject]);
|
|
70
|
+
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PiwikPro } from "./PiwikPro";
|
package/src/article/Article.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ArticleProps,
|
|
3
|
-
Article as RHCArticle,
|
|
4
|
-
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
-
|
|
6
|
-
const Article = (props: ArticleProps) => {
|
|
7
|
-
return <RHCArticle {...props} />;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default Article;
|
|
1
|
+
import {
|
|
2
|
+
type ArticleProps,
|
|
3
|
+
Article as RHCArticle,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
|
|
6
|
+
const Article = (props: ArticleProps) => {
|
|
7
|
+
return <RHCArticle {...props} />;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default Article;
|