@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.
- package/LICENSE.md +291 -291
- package/README.md +20 -20
- package/package.json +1 -1
- package/src/alert/Alert.tsx +19 -19
- package/src/alert/styles.module.css +3 -3
- package/src/alignBox/AlignBox.tsx +110 -110
- package/src/alignBox/styles.module.css +106 -106
- 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 +24 -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
|
@@ -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
|
-
const CopyButton = ({
|
|
9
|
-
text,
|
|
10
|
-
className,
|
|
11
|
-
}: {
|
|
12
|
-
text?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
}) => {
|
|
15
|
-
const handleCopy = async () => {
|
|
16
|
-
if ("clipboard" in navigator) {
|
|
17
|
-
await navigator.clipboard.writeText(
|
|
18
|
-
text || "Sorry, no text to copy was set...",
|
|
19
|
-
);
|
|
20
|
-
} else {
|
|
21
|
-
console.warn("Clipboard API not supported");
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
text && (
|
|
27
|
-
<SecondaryActionButton
|
|
28
|
-
className={clsx([className, styles.button])}
|
|
29
|
-
onClick={handleCopy}
|
|
30
|
-
title="Kopieer naar klembord"
|
|
31
|
-
aria-label="Kopieer naar klembord"
|
|
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
|
+
const CopyButton = ({
|
|
9
|
+
text,
|
|
10
|
+
className,
|
|
11
|
+
}: {
|
|
12
|
+
text?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}) => {
|
|
15
|
+
const handleCopy = async () => {
|
|
16
|
+
if ("clipboard" in navigator) {
|
|
17
|
+
await navigator.clipboard.writeText(
|
|
18
|
+
text || "Sorry, no text to copy was set...",
|
|
19
|
+
);
|
|
20
|
+
} else {
|
|
21
|
+
console.warn("Clipboard API not supported");
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
text && (
|
|
27
|
+
<SecondaryActionButton
|
|
28
|
+
className={clsx([className, styles.button])}
|
|
29
|
+
onClick={handleCopy}
|
|
30
|
+
title="Kopieer naar klembord"
|
|
31
|
+
aria-label="Kopieer naar klembord"
|
|
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;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
.donDataBadge.donDataBadge {
|
|
2
|
-
&.primary {
|
|
3
|
-
--_utrecht-data-badge-color: oklch(
|
|
4
|
-
from var(--utrecht-data-badge-color) calc(l - 0.1) c h
|
|
5
|
-
);
|
|
6
|
-
color: var(--_utrecht-data-badge-color);
|
|
7
|
-
|
|
8
|
-
&:hover {
|
|
9
|
-
color: var(--utrecht-data-badge-color);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.outlined {
|
|
14
|
-
--_utrecht-data-badge-background-color: var(--rhc-color-canvas);
|
|
15
|
-
background-color: var(--_utrecht-data-badge-background-color);
|
|
16
|
-
border: 2px solid var(--utrecht-data-badge-color);
|
|
17
|
-
|
|
18
|
-
&:hover {
|
|
19
|
-
background-color: var(--utrecht-data-badge-background-color);
|
|
20
|
-
border-color: var(--utrecht-data-badge-background-color);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.subtle {
|
|
25
|
-
--_utrecht-data-badge-color: var(--nl-link-color);
|
|
26
|
-
--_utrecht-data-badge-background-color: var(--rhc-color-cool-grey-200);
|
|
27
|
-
--utrecht-data-badge-font-weight: normal;
|
|
28
|
-
color: var(--_utrecht-data-badge-color);
|
|
29
|
-
background-color: var(--_utrecht-data-badge-background-color);
|
|
30
|
-
|
|
31
|
-
&:hover {
|
|
32
|
-
color: var(--rhc-color-cool-grey-50);
|
|
33
|
-
background-color: var(--rhc-color-cool-grey-500);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.badgeLink {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
padding-block: 0.25rem;
|
|
41
|
-
color: inherit;
|
|
42
|
-
text-decoration: inherit;
|
|
43
|
-
}
|
|
1
|
+
.donDataBadge.donDataBadge {
|
|
2
|
+
&.primary {
|
|
3
|
+
--_utrecht-data-badge-color: oklch(
|
|
4
|
+
from var(--utrecht-data-badge-color) calc(l - 0.1) c h
|
|
5
|
+
);
|
|
6
|
+
color: var(--_utrecht-data-badge-color);
|
|
7
|
+
|
|
8
|
+
&:hover {
|
|
9
|
+
color: var(--utrecht-data-badge-color);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.outlined {
|
|
14
|
+
--_utrecht-data-badge-background-color: var(--rhc-color-canvas);
|
|
15
|
+
background-color: var(--_utrecht-data-badge-background-color);
|
|
16
|
+
border: 2px solid var(--utrecht-data-badge-color);
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
background-color: var(--utrecht-data-badge-background-color);
|
|
20
|
+
border-color: var(--utrecht-data-badge-background-color);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.subtle {
|
|
25
|
+
--_utrecht-data-badge-color: var(--nl-link-color);
|
|
26
|
+
--_utrecht-data-badge-background-color: var(--rhc-color-cool-grey-200);
|
|
27
|
+
--utrecht-data-badge-font-weight: normal;
|
|
28
|
+
color: var(--_utrecht-data-badge-color);
|
|
29
|
+
background-color: var(--_utrecht-data-badge-background-color);
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
color: var(--rhc-color-cool-grey-50);
|
|
33
|
+
background-color: var(--rhc-color-cool-grey-500);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.badgeLink {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
padding-block: 0.25rem;
|
|
41
|
+
color: inherit;
|
|
42
|
+
text-decoration: inherit;
|
|
43
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataSummary as RHCDataSummary,
|
|
3
|
-
type DataSummaryProps as RHCDataSummaryProps,
|
|
4
|
-
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
-
import clsx from "clsx";
|
|
6
|
-
import styles from "./styles.module.css";
|
|
7
|
-
|
|
8
|
-
export interface DataSummaryProps extends RHCDataSummaryProps {
|
|
9
|
-
contained?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const DataSummary = (props: DataSummaryProps) => {
|
|
13
|
-
const { className, contained = false, ...restProps } = props;
|
|
14
|
-
return (
|
|
15
|
-
<RHCDataSummary
|
|
16
|
-
className={clsx(className, { [styles.isContained]: contained })}
|
|
17
|
-
{...restProps}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default DataSummary;
|
|
1
|
+
import {
|
|
2
|
+
DataSummary as RHCDataSummary,
|
|
3
|
+
type DataSummaryProps as RHCDataSummaryProps,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import styles from "./styles.module.css";
|
|
7
|
+
|
|
8
|
+
export interface DataSummaryProps extends RHCDataSummaryProps {
|
|
9
|
+
contained?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const DataSummary = (props: DataSummaryProps) => {
|
|
13
|
+
const { className, contained = false, ...restProps } = props;
|
|
14
|
+
return (
|
|
15
|
+
<RHCDataSummary
|
|
16
|
+
className={clsx(className, { [styles.isContained]: contained })}
|
|
17
|
+
{...restProps}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default DataSummary;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataSummaryItem as RHCDataSummaryItem,
|
|
3
|
-
type DataSummaryItemProps as RHCDataSummaryItemProps,
|
|
4
|
-
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
-
|
|
6
|
-
export interface DataSummaryItemProps
|
|
7
|
-
extends Partial<RHCDataSummaryItemProps> {}
|
|
8
|
-
|
|
9
|
-
const DataSummaryItem = (props: DataSummaryItemProps) => {
|
|
10
|
-
const { className, itemKey = "", itemValue = "-", ...restProps } = props;
|
|
11
|
-
return (
|
|
12
|
-
<RHCDataSummaryItem
|
|
13
|
-
itemKey={itemKey}
|
|
14
|
-
itemValue={itemValue}
|
|
15
|
-
className={className}
|
|
16
|
-
{...restProps}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default DataSummaryItem;
|
|
1
|
+
import {
|
|
2
|
+
DataSummaryItem as RHCDataSummaryItem,
|
|
3
|
+
type DataSummaryItemProps as RHCDataSummaryItemProps,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
|
|
6
|
+
export interface DataSummaryItemProps
|
|
7
|
+
extends Partial<RHCDataSummaryItemProps> {}
|
|
8
|
+
|
|
9
|
+
const DataSummaryItem = (props: DataSummaryItemProps) => {
|
|
10
|
+
const { className, itemKey = "", itemValue = "-", ...restProps } = props;
|
|
11
|
+
return (
|
|
12
|
+
<RHCDataSummaryItem
|
|
13
|
+
itemKey={itemKey}
|
|
14
|
+
itemValue={itemValue}
|
|
15
|
+
className={className}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default DataSummaryItem;
|