@developer-overheid-nl/don-register-components 1.0.1 → 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 ADDED
@@ -0,0 +1,43 @@
1
+ # @developer-overheid-nl/don-register-components
2
+
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 804dc03: Added Analytics component.
8
+ - Added `PiwikPro` component to encapsulate Piwik analytics tracking.
9
+ - Added restProps to `AlignBox` component and `CopyButton` component.
10
+
11
+ ### Patch Changes
12
+
13
+ - 4447980: Updated dependencies
14
+
15
+ Removed standalone postcss.config.cjs files from apps (integrated into astro.config.mjs)
16
+
17
+ - f7034b9: Updated dependencies:
18
+ - @rijkshuisstijl-community/components-css
19
+ - @rijkshuisstijl-community/components-react
20
+ - ded15aa: fix: exclude 'current' property when mapping NavBar items
21
+
22
+ ## 1.0.0
23
+
24
+ ### Major Changes
25
+
26
+ - d8d2e78: Version 1.0!
27
+ - 8dde9ed: Nieuwe componenten
28
+
29
+ - Button
30
+ - Fieldset
31
+ - FormFieldLabel
32
+ - FormFieldTextInput
33
+
34
+ Wijzigingen
35
+
36
+ - ReadOnlyTextInput: fontVariant toegevoegd.
37
+
38
+ ### Patch Changes
39
+
40
+ - 3b4f506: Change value to defaultValue in search form.
41
+ - Updated dependencies [8dde9ed]
42
+ - Updated dependencies [d8d2e78]
43
+ - @developer-overheid-nl/don-register-locales@1.0.0
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.0.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
- "@rijkshuisstijl-community/components-css": "11.0.0",
25
- "@rijkshuisstijl-community/components-react": "10.0.0",
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.7.3",
32
+ "i18next": "25.8.4",
30
33
  "parse-link-header": "^2.0.0",
31
- "react-i18next": "16.5.1",
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.0",
43
+ "vite": "7.3.1",
41
44
  "vite-plugin-dts": "^4.5.4"
42
45
  },
43
46
  "peerDependencies": {
@@ -21,12 +21,11 @@ type Align =
21
21
 
22
22
  type Gap = "none" | "small" | "medium" | "large";
23
23
 
24
- export interface AlignBoxProps {
24
+ export interface AlignBoxProps extends React.HTMLAttributes<HTMLDivElement> {
25
25
  align?: Align;
26
26
  gap?: Gap;
27
27
  direction?: "row" | "column";
28
28
  display?: "block" | "inline";
29
- className?: string;
30
29
  children: ReactNode;
31
30
  }
32
31
 
@@ -87,6 +86,7 @@ const AlignBox: React.FC<AlignBoxProps> = ({
87
86
  display = "block",
88
87
  className,
89
88
  children,
89
+ ...restProps
90
90
  }) => {
91
91
  const alignmentClass = getAlignmentClass(align);
92
92
  const gapClass = getGapClass(gap);
@@ -101,6 +101,7 @@ const AlignBox: React.FC<AlignBoxProps> = ({
101
101
  gapClass,
102
102
  className ?? "",
103
103
  )}
104
+ {...restProps}
104
105
  >
105
106
  {children}
106
107
  </div>
@@ -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";
@@ -5,13 +5,12 @@ import clsx from "clsx";
5
5
  import Icon from "../iconsSprite/Icon";
6
6
  import styles from "./styles.module.css";
7
7
 
8
- const CopyButton = ({
9
- text,
10
- className,
11
- }: {
8
+ interface CopyButtonProps
9
+ extends React.ButtonHTMLAttributes<HTMLButtonElement> {
12
10
  text?: string;
13
- className?: string;
14
- }) => {
11
+ }
12
+
13
+ const CopyButton = ({ text, className, ...restProps }: CopyButtonProps) => {
15
14
  const handleCopy = async () => {
16
15
  if ("clipboard" in navigator) {
17
16
  await navigator.clipboard.writeText(
@@ -29,6 +28,7 @@ const CopyButton = ({
29
28
  onClick={handleCopy}
30
29
  title="Kopieer naar klembord"
31
30
  aria-label="Kopieer naar klembord"
31
+ {...restProps}
32
32
  >
33
33
  <Icon className={styles.icon} name="kopieer-inline" />
34
34
  </SecondaryActionButton>
package/src/i18n.ts CHANGED
@@ -7,6 +7,7 @@ const i18nInstance: i18n = createInstance({
7
7
  lng: "nl",
8
8
  fallbackLng: "nl",
9
9
  // debug: true,
10
+ showSupportNotice: false,
10
11
 
11
12
  interpolation: {
12
13
  escapeValue: false, // not needed for react as it escapes by default