@developer-overheid-nl/don-register-components 1.0.0 → 1.0.1

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.
Files changed (61) hide show
  1. package/LICENSE.md +291 -291
  2. package/README.md +20 -20
  3. package/package.json +1 -1
  4. package/src/alert/Alert.tsx +19 -19
  5. package/src/alert/styles.module.css +3 -3
  6. package/src/alignBox/AlignBox.tsx +110 -110
  7. package/src/alignBox/styles.module.css +106 -106
  8. package/src/article/Article.tsx +10 -10
  9. package/src/block/Block.tsx +35 -35
  10. package/src/block/styles.module.css +29 -29
  11. package/src/button/Button.tsx +3 -3
  12. package/src/cardAsLink/CardAsLink.tsx +21 -21
  13. package/src/cardAsLink/styles.module.css +23 -23
  14. package/src/cardsList/CardsList.tsx +54 -54
  15. package/src/cardsList/styles.module.css +19 -19
  16. package/src/client.ts +2 -2
  17. package/src/container/Container.tsx +10 -10
  18. package/src/container/styles.module.css +28 -28
  19. package/src/copyButton/CopyButton.tsx +39 -39
  20. package/src/copyButton/styles.module.css +13 -13
  21. package/src/dataBadgeLink/DataBadgeLink.tsx +50 -50
  22. package/src/dataBadgeLink/styles.module.css +43 -43
  23. package/src/dataSummary/DataSummary.tsx +22 -22
  24. package/src/dataSummary/DataSummaryItem.tsx +21 -21
  25. package/src/dataSummary/styles.module.css +70 -70
  26. package/src/fieldset/FieldSet.tsx +3 -3
  27. package/src/filters/Filters.tsx +115 -115
  28. package/src/filters/styles.module.css +26 -26
  29. package/src/footer/Footer.tsx +76 -76
  30. package/src/footer/styles.module.css +103 -103
  31. package/src/formFieldLabel/FormFieldLabel.tsx +23 -23
  32. package/src/formFieldTextInput/FormFieldTextInput.tsx +3 -3
  33. package/src/header/Header.tsx +137 -137
  34. package/src/header/styles.module.css +71 -71
  35. package/src/heading/Heading.tsx +10 -10
  36. package/src/headingGroup/HeadingGroup.tsx +48 -48
  37. package/src/headingGroup/styles.module.css +3 -3
  38. package/src/i18n.ts +24 -24
  39. package/src/iconBadge/IconBadge.tsx +32 -32
  40. package/src/iconBadge/getAppearance.ts +47 -47
  41. package/src/iconBadge/styles.module.css +19 -19
  42. package/src/iconsSprite/Icon.tsx +17 -17
  43. package/src/iconsSprite/IconsSprite.tsx +5 -5
  44. package/src/index.ts +80 -80
  45. package/src/link/Link.tsx +10 -10
  46. package/src/markdown/Markdown.tsx +42 -42
  47. package/src/pagination/Pagination.tsx +144 -144
  48. package/src/pagination/styles.module.css +13 -13
  49. package/src/paragraph/Paragraph.tsx +10 -10
  50. package/src/pillBadge/PillBadge.examples.tsx +107 -107
  51. package/src/pillBadge/PillBadge.tsx +51 -51
  52. package/src/pillBadge/styles.module.css +194 -194
  53. package/src/readOnlyTextInput/ReadOnlyTextInput.tsx +24 -24
  54. package/src/readOnlyTextInput/styles.module.css +19 -19
  55. package/src/scoreBadge/ScoreBadge.tsx +132 -132
  56. package/src/search/Search.tsx +66 -66
  57. package/src/search/styles.module.css +39 -39
  58. package/src/siteLogo/SiteLogo.tsx +24 -24
  59. package/src/topNavigation/TopNavigation.tsx +67 -64
  60. package/src/topNavigation/styles.module.css +54 -54
  61. package/tsconfig.json +121 -121
@@ -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,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 {
25
- align?: Align;
26
- gap?: Gap;
27
- direction?: "row" | "column";
28
- display?: "block" | "inline";
29
- className?: string;
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
- display = "block",
88
- className,
89
- children,
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
- {children}
106
- </div>
107
- );
108
- };
109
-
110
- export default AlignBox;
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
+ className?: string;
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
+ display = "block",
88
+ className,
89
+ children,
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
+ {children}
106
+ </div>
107
+ );
108
+ };
109
+
110
+ 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
+ }
@@ -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;
@@ -1,35 +1,35 @@
1
- import clsx from "clsx";
2
- import type { HTMLAttributes, ReactNode } from "react";
3
- import styles from "./styles.module.css";
4
-
5
- export interface BlockProps extends HTMLAttributes<HTMLDivElement> {
6
- className?: string;
7
- children?: ReactNode;
8
- appearance?: "clear" | "outlined" | "filled";
9
- layout?: "full" | "flex-row" | "flex-col";
10
- }
11
-
12
- const Block = (props: BlockProps) => {
13
- const {
14
- className,
15
- appearance = "filled",
16
- layout = "full",
17
- ...restProps
18
- } = props;
19
-
20
- return (
21
- <div
22
- className={clsx([
23
- styles.block,
24
- className,
25
- styles[appearance],
26
- styles[layout],
27
- ])}
28
- {...restProps}
29
- >
30
- {props.children}
31
- </div>
32
- );
33
- };
34
-
35
- export default Block;
1
+ import clsx from "clsx";
2
+ import type { HTMLAttributes, ReactNode } from "react";
3
+ import styles from "./styles.module.css";
4
+
5
+ export interface BlockProps extends HTMLAttributes<HTMLDivElement> {
6
+ className?: string;
7
+ children?: ReactNode;
8
+ appearance?: "clear" | "outlined" | "filled";
9
+ layout?: "full" | "flex-row" | "flex-col";
10
+ }
11
+
12
+ const Block = (props: BlockProps) => {
13
+ const {
14
+ className,
15
+ appearance = "filled",
16
+ layout = "full",
17
+ ...restProps
18
+ } = props;
19
+
20
+ return (
21
+ <div
22
+ className={clsx([
23
+ styles.block,
24
+ className,
25
+ styles[appearance],
26
+ styles[layout],
27
+ ])}
28
+ {...restProps}
29
+ >
30
+ {props.children}
31
+ </div>
32
+ );
33
+ };
34
+
35
+ export default Block;
@@ -1,29 +1,29 @@
1
- .block {
2
- padding: 1rem;
3
- border-radius: var(--rhc-card-as-link-border-radius);
4
-
5
- &.flex-row,
6
- &.flex-col {
7
- display: flex;
8
- align-items: center;
9
- justify-content: space-between;
10
- }
11
-
12
- &.flex-col {
13
- flex-direction: column;
14
- gap: 1rem;
15
- align-items: flex-start;
16
- }
17
-
18
- &.clear {
19
- background-color: transparent;
20
- }
21
-
22
- &.filled {
23
- background-color: var(--rhc-card-as-link-hover-background-color);
24
- }
25
-
26
- &.outlined {
27
- border: 1px solid var(--rhc-card-as-link-border-color);
28
- }
29
- }
1
+ .block {
2
+ padding: 1rem;
3
+ border-radius: var(--rhc-card-as-link-border-radius);
4
+
5
+ &.flex-row,
6
+ &.flex-col {
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: space-between;
10
+ }
11
+
12
+ &.flex-col {
13
+ flex-direction: column;
14
+ gap: 1rem;
15
+ align-items: flex-start;
16
+ }
17
+
18
+ &.clear {
19
+ background-color: transparent;
20
+ }
21
+
22
+ &.filled {
23
+ background-color: var(--rhc-card-as-link-hover-background-color);
24
+ }
25
+
26
+ &.outlined {
27
+ border: 1px solid var(--rhc-card-as-link-border-color);
28
+ }
29
+ }
@@ -1,3 +1,3 @@
1
- import { Button } from "@rijkshuisstijl-community/components-react";
2
-
3
- export default Button;
1
+ import { Button } from "@rijkshuisstijl-community/components-react";
2
+
3
+ export default Button;
@@ -1,21 +1,21 @@
1
- import {
2
- CardAsLink as RHCCardAsLink,
3
- type CardAsLinkProps as RHCCardAsLinkProps,
4
- } from "@rijkshuisstijl-community/components-react";
5
- import clsx from "clsx";
6
- import styles from "./styles.module.css";
7
-
8
- export interface CardAsLinksProps extends RHCCardAsLinkProps {}
9
-
10
- const CardAsLink = (props: CardAsLinksProps) => {
11
- const { className, ...restProps } = props;
12
-
13
- return (
14
- <RHCCardAsLink
15
- className={clsx(className, styles.cardAsLink)}
16
- {...restProps}
17
- />
18
- );
19
- };
20
-
21
- export default CardAsLink;
1
+ import {
2
+ CardAsLink as RHCCardAsLink,
3
+ type CardAsLinkProps as RHCCardAsLinkProps,
4
+ } from "@rijkshuisstijl-community/components-react";
5
+ import clsx from "clsx";
6
+ import styles from "./styles.module.css";
7
+
8
+ export interface CardAsLinksProps extends RHCCardAsLinkProps {}
9
+
10
+ const CardAsLink = (props: CardAsLinksProps) => {
11
+ const { className, ...restProps } = props;
12
+
13
+ return (
14
+ <RHCCardAsLink
15
+ className={clsx(className, styles.cardAsLink)}
16
+ {...restProps}
17
+ />
18
+ );
19
+ };
20
+
21
+ export default CardAsLink;