@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/src/block/Block.tsx
CHANGED
|
@@ -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
|
+
}
|
package/src/button/Button.tsx
CHANGED
|
@@ -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;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
.cardAsLink.cardAsLink {
|
|
2
|
-
&:hover {
|
|
3
|
-
:global(.rhc-card-as-link__heading) {
|
|
4
|
-
text-decoration: none;
|
|
5
|
-
}
|
|
6
|
-
:global(.nl-heading) {
|
|
7
|
-
text-decoration: var(
|
|
8
|
-
--rhc-card-as-link-active-text-decoration,
|
|
9
|
-
underline
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
:global(.rhc-card-as-link__metadata) {
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: baseline;
|
|
18
|
-
justify-content: flex-end;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:global(.rhc-card-as-link__footer) {
|
|
22
|
-
--rhc-card-as-link-padding-block-start: 0;
|
|
23
|
-
}
|
|
1
|
+
.cardAsLink.cardAsLink {
|
|
2
|
+
&:hover {
|
|
3
|
+
:global(.rhc-card-as-link__heading) {
|
|
4
|
+
text-decoration: none;
|
|
5
|
+
}
|
|
6
|
+
:global(.nl-heading) {
|
|
7
|
+
text-decoration: var(
|
|
8
|
+
--rhc-card-as-link-active-text-decoration,
|
|
9
|
+
underline
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:global(.rhc-card-as-link__metadata) {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: baseline;
|
|
18
|
+
justify-content: flex-end;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:global(.rhc-card-as-link__footer) {
|
|
22
|
+
--rhc-card-as-link-padding-block-start: 0;
|
|
23
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import type { CardAsLink } from "@rijkshuisstijl-community/components-react";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import type { HTMLAttributes, PropsWithChildren, ReactNode } from "react";
|
|
4
|
-
import styles from "./styles.module.css";
|
|
5
|
-
|
|
6
|
-
export interface CardsListProps extends HTMLAttributes<HTMLOListElement> {
|
|
7
|
-
/**
|
|
8
|
-
* Array of items to display in the list.
|
|
9
|
-
* This will encapsulate the `CardAsLink`s in `<li>` elements.
|
|
10
|
-
* If not provided, the component will render its children instead and will not wrap them in `<li>` elements.
|
|
11
|
-
* You can then use the `CardsListItem` component to wrap individual items.
|
|
12
|
-
*
|
|
13
|
-
* @type {?Array<React.JSX.Element | string>}
|
|
14
|
-
*/
|
|
15
|
-
items?: Array<typeof CardAsLink>;
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const CardsList = (props: PropsWithChildren<CardsListProps>) => {
|
|
20
|
-
const { id, items, className, children } = props;
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<ol className={clsx(styles.cardsList, className)} id={id}>
|
|
24
|
-
{items && items.length > 0
|
|
25
|
-
? items.map((item, index, array) => (
|
|
26
|
-
<CardsListItem
|
|
27
|
-
key={`${id || "don-cards"}_${index}`}
|
|
28
|
-
index={index}
|
|
29
|
-
setsize={array.length}
|
|
30
|
-
>
|
|
31
|
-
{item as unknown as ReactNode}
|
|
32
|
-
</CardsListItem>
|
|
33
|
-
))
|
|
34
|
-
: children}
|
|
35
|
-
</ol>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export interface CardsListItemProps {
|
|
40
|
-
index: number;
|
|
41
|
-
setsize: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const CardsListItem = ({
|
|
45
|
-
index,
|
|
46
|
-
setsize,
|
|
47
|
-
children,
|
|
48
|
-
}: PropsWithChildren<CardsListItemProps>) => (
|
|
49
|
-
<li aria-posinset={index + 1} aria-setsize={setsize}>
|
|
50
|
-
{children}
|
|
51
|
-
</li>
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
export default CardsList;
|
|
1
|
+
import type { CardAsLink } from "@rijkshuisstijl-community/components-react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import type { HTMLAttributes, PropsWithChildren, ReactNode } from "react";
|
|
4
|
+
import styles from "./styles.module.css";
|
|
5
|
+
|
|
6
|
+
export interface CardsListProps extends HTMLAttributes<HTMLOListElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Array of items to display in the list.
|
|
9
|
+
* This will encapsulate the `CardAsLink`s in `<li>` elements.
|
|
10
|
+
* If not provided, the component will render its children instead and will not wrap them in `<li>` elements.
|
|
11
|
+
* You can then use the `CardsListItem` component to wrap individual items.
|
|
12
|
+
*
|
|
13
|
+
* @type {?Array<React.JSX.Element | string>}
|
|
14
|
+
*/
|
|
15
|
+
items?: Array<typeof CardAsLink>;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const CardsList = (props: PropsWithChildren<CardsListProps>) => {
|
|
20
|
+
const { id, items, className, children } = props;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<ol className={clsx(styles.cardsList, className)} id={id}>
|
|
24
|
+
{items && items.length > 0
|
|
25
|
+
? items.map((item, index, array) => (
|
|
26
|
+
<CardsListItem
|
|
27
|
+
key={`${id || "don-cards"}_${index}`}
|
|
28
|
+
index={index}
|
|
29
|
+
setsize={array.length}
|
|
30
|
+
>
|
|
31
|
+
{item as unknown as ReactNode}
|
|
32
|
+
</CardsListItem>
|
|
33
|
+
))
|
|
34
|
+
: children}
|
|
35
|
+
</ol>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export interface CardsListItemProps {
|
|
40
|
+
index: number;
|
|
41
|
+
setsize: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const CardsListItem = ({
|
|
45
|
+
index,
|
|
46
|
+
setsize,
|
|
47
|
+
children,
|
|
48
|
+
}: PropsWithChildren<CardsListItemProps>) => (
|
|
49
|
+
<li aria-posinset={index + 1} aria-setsize={setsize}>
|
|
50
|
+
{children}
|
|
51
|
+
</li>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export default CardsList;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
.cardsList {
|
|
2
|
-
--rhc-card-as-link-inline-size: 100%;
|
|
3
|
-
--rhc-card-as-link-active-text-decoration: none;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
row-gap: var(--rhc-space-200);
|
|
7
|
-
padding-inline-start: 0;
|
|
8
|
-
list-style-type: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
:global(
|
|
12
|
-
.rhc-card-as-link:hover
|
|
13
|
-
.rhc-card-as-link__heading.rhc-card-as-link__heading
|
|
14
|
-
) {
|
|
15
|
-
/* TODO: specifity */
|
|
16
|
-
:global(.nl-heading) {
|
|
17
|
-
text-decoration: underline;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
.cardsList {
|
|
2
|
+
--rhc-card-as-link-inline-size: 100%;
|
|
3
|
+
--rhc-card-as-link-active-text-decoration: none;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
row-gap: var(--rhc-space-200);
|
|
7
|
+
padding-inline-start: 0;
|
|
8
|
+
list-style-type: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:global(
|
|
12
|
+
.rhc-card-as-link:hover
|
|
13
|
+
.rhc-card-as-link__heading.rhc-card-as-link__heading
|
|
14
|
+
) {
|
|
15
|
+
/* TODO: specifity */
|
|
16
|
+
:global(.nl-heading) {
|
|
17
|
+
text-decoration: underline;
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Barrel export for client-side components
|
|
2
|
-
export { default as CopyButton } from "./copyButton/CopyButton";
|
|
1
|
+
// Barrel export for client-side components
|
|
2
|
+
export { default as CopyButton } from "./copyButton/CopyButton";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import styles from "./styles.module.css";
|
|
2
|
-
|
|
3
|
-
export default function Container(props: React.HTMLProps<HTMLDivElement>) {
|
|
4
|
-
const { children, className, ...restProps } = props || {};
|
|
5
|
-
return (
|
|
6
|
-
<div className={`${styles.container} ${className || ""}`} {...restProps}>
|
|
7
|
-
{children}
|
|
8
|
-
</div>
|
|
9
|
-
);
|
|
10
|
-
}
|
|
1
|
+
import styles from "./styles.module.css";
|
|
2
|
+
|
|
3
|
+
export default function Container(props: React.HTMLProps<HTMLDivElement>) {
|
|
4
|
+
const { children, className, ...restProps } = props || {};
|
|
5
|
+
return (
|
|
6
|
+
<div className={`${styles.container} ${className || ""}`} {...restProps}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
inline-size: var(--rhc-nav-bar-container-inline-size);
|
|
6
|
-
|
|
7
|
-
> * {
|
|
8
|
-
flex: 1;
|
|
9
|
-
max-inline-size: var(--rhc-nav-bar-max-inline-size);
|
|
10
|
-
padding-inline-start: var(--rhc-nav-bar-link-padding-inline-start);
|
|
11
|
-
padding-inline-end: var(--rhc-nav-bar-link-padding-inline-end);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@media (--xs-and-below-viewport) {
|
|
16
|
-
.container {
|
|
17
|
-
> * {
|
|
18
|
-
padding-inline-start: calc(
|
|
19
|
-
var(--rhc-nav-bar-link-padding-inline-start) *
|
|
20
|
-
0.5
|
|
21
|
-
);
|
|
22
|
-
padding-inline-end: calc(
|
|
23
|
-
var(--rhc-nav-bar-link-padding-inline-end) *
|
|
24
|
-
0.5
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
inline-size: var(--rhc-nav-bar-container-inline-size);
|
|
6
|
+
|
|
7
|
+
> * {
|
|
8
|
+
flex: 1;
|
|
9
|
+
max-inline-size: var(--rhc-nav-bar-max-inline-size);
|
|
10
|
+
padding-inline-start: var(--rhc-nav-bar-link-padding-inline-start);
|
|
11
|
+
padding-inline-end: var(--rhc-nav-bar-link-padding-inline-end);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (--xs-and-below-viewport) {
|
|
16
|
+
.container {
|
|
17
|
+
> * {
|
|
18
|
+
padding-inline-start: calc(
|
|
19
|
+
var(--rhc-nav-bar-link-padding-inline-start) *
|
|
20
|
+
0.5
|
|
21
|
+
);
|
|
22
|
+
padding-inline-end: calc(
|
|
23
|
+
var(--rhc-nav-bar-link-padding-inline-end) *
|
|
24
|
+
0.5
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { SecondaryActionButton } from "@rijkshuisstijl-community/components-react";
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
import Icon from "../iconsSprite/Icon";
|
|
6
|
-
import styles from "./styles.module.css";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
>
|
|
33
|
-
<Icon className={styles.icon} name="kopieer-inline" />
|
|
34
|
-
</SecondaryActionButton>
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default CopyButton;
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SecondaryActionButton } from "@rijkshuisstijl-community/components-react";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import Icon from "../iconsSprite/Icon";
|
|
6
|
+
import styles from "./styles.module.css";
|
|
7
|
+
|
|
8
|
+
interface CopyButtonProps
|
|
9
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
text?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const CopyButton = ({ text, className, ...restProps }: CopyButtonProps) => {
|
|
14
|
+
const handleCopy = async () => {
|
|
15
|
+
if ("clipboard" in navigator) {
|
|
16
|
+
await navigator.clipboard.writeText(
|
|
17
|
+
text || "Sorry, no text to copy was set...",
|
|
18
|
+
);
|
|
19
|
+
} else {
|
|
20
|
+
console.warn("Clipboard API not supported");
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
text && (
|
|
26
|
+
<SecondaryActionButton
|
|
27
|
+
className={clsx([className, styles.button])}
|
|
28
|
+
onClick={handleCopy}
|
|
29
|
+
title="Kopieer naar klembord"
|
|
30
|
+
aria-label="Kopieer naar klembord"
|
|
31
|
+
{...restProps}
|
|
32
|
+
>
|
|
33
|
+
<Icon className={styles.icon} name="kopieer-inline" />
|
|
34
|
+
</SecondaryActionButton>
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default CopyButton;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
--utrecht-button-padding-block-end: 0.125rem;
|
|
3
|
-
--utrecht-button-padding-block-start: 0.125rem;
|
|
4
|
-
--utrecht-button-padding-inline-end: 0.125rem;
|
|
5
|
-
--utrecht-button-padding-inline-start: 0.125rem;
|
|
6
|
-
--utrecht-button-min-block-size: 36px;
|
|
7
|
-
--utrecht-button-min-inline-size: 36px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.icon {
|
|
11
|
-
width: 1.5rem;
|
|
12
|
-
height: 1.5rem;
|
|
13
|
-
}
|
|
1
|
+
.button {
|
|
2
|
+
--utrecht-button-padding-block-end: 0.125rem;
|
|
3
|
+
--utrecht-button-padding-block-start: 0.125rem;
|
|
4
|
+
--utrecht-button-padding-inline-end: 0.125rem;
|
|
5
|
+
--utrecht-button-padding-inline-start: 0.125rem;
|
|
6
|
+
--utrecht-button-min-block-size: 36px;
|
|
7
|
+
--utrecht-button-min-inline-size: 36px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.icon {
|
|
11
|
+
width: 1.5rem;
|
|
12
|
+
height: 1.5rem;
|
|
13
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataBadgeButton,
|
|
3
|
-
type DataBadgeButtonProps,
|
|
4
|
-
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
-
import clsx from "clsx";
|
|
6
|
-
import styles from "./styles.module.css";
|
|
7
|
-
|
|
8
|
-
export interface DataBadgeLinkProps
|
|
9
|
-
extends Omit<DataBadgeButtonProps, "aria-pressed" | "pressed"> {
|
|
10
|
-
href: string;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
target?: React.HTMLAttributeAnchorTarget;
|
|
13
|
-
rel?: string;
|
|
14
|
-
className?: string;
|
|
15
|
-
role?: string;
|
|
16
|
-
appearance?: "primary" | "outlined" | "subtle";
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const DataBadgeLink = (props: DataBadgeLinkProps) => {
|
|
20
|
-
const {
|
|
21
|
-
href,
|
|
22
|
-
target,
|
|
23
|
-
rel,
|
|
24
|
-
children,
|
|
25
|
-
className,
|
|
26
|
-
role,
|
|
27
|
-
appearance = "primary",
|
|
28
|
-
...restProps
|
|
29
|
-
} = props;
|
|
30
|
-
return (
|
|
31
|
-
<DataBadgeButton
|
|
32
|
-
className={clsx(className, styles.donDataBadge, styles[appearance])}
|
|
33
|
-
/* biome-ignore lint/a11y/useValidAriaValues: {null} is needed to remove it */
|
|
34
|
-
aria-pressed={undefined}
|
|
35
|
-
role={role}
|
|
36
|
-
{...restProps}
|
|
37
|
-
>
|
|
38
|
-
<a
|
|
39
|
-
className={clsx(styles.badgeLink)}
|
|
40
|
-
href={href}
|
|
41
|
-
target={target}
|
|
42
|
-
rel={rel}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
</a>
|
|
46
|
-
</DataBadgeButton>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export default DataBadgeLink;
|
|
1
|
+
import {
|
|
2
|
+
DataBadgeButton,
|
|
3
|
+
type DataBadgeButtonProps,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import styles from "./styles.module.css";
|
|
7
|
+
|
|
8
|
+
export interface DataBadgeLinkProps
|
|
9
|
+
extends Omit<DataBadgeButtonProps, "aria-pressed" | "pressed"> {
|
|
10
|
+
href: string;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
target?: React.HTMLAttributeAnchorTarget;
|
|
13
|
+
rel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
role?: string;
|
|
16
|
+
appearance?: "primary" | "outlined" | "subtle";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const DataBadgeLink = (props: DataBadgeLinkProps) => {
|
|
20
|
+
const {
|
|
21
|
+
href,
|
|
22
|
+
target,
|
|
23
|
+
rel,
|
|
24
|
+
children,
|
|
25
|
+
className,
|
|
26
|
+
role,
|
|
27
|
+
appearance = "primary",
|
|
28
|
+
...restProps
|
|
29
|
+
} = props;
|
|
30
|
+
return (
|
|
31
|
+
<DataBadgeButton
|
|
32
|
+
className={clsx(className, styles.donDataBadge, styles[appearance])}
|
|
33
|
+
/* biome-ignore lint/a11y/useValidAriaValues: {null} is needed to remove it */
|
|
34
|
+
aria-pressed={undefined}
|
|
35
|
+
role={role}
|
|
36
|
+
{...restProps}
|
|
37
|
+
>
|
|
38
|
+
<a
|
|
39
|
+
className={clsx(styles.badgeLink)}
|
|
40
|
+
href={href}
|
|
41
|
+
target={target}
|
|
42
|
+
rel={rel}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</a>
|
|
46
|
+
</DataBadgeButton>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default DataBadgeLink;
|