@developer-overheid-nl/don-register-components 1.3.1 → 1.6.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/CHANGELOG.md +170 -130
- package/LICENSE.md +291 -291
- package/README.md +20 -20
- package/package.json +10 -6
- package/src/Introduction.mdx +31 -0
- package/src/alert/Alert.stories.tsx +57 -0
- package/src/alert/Alert.tsx +19 -19
- package/src/alert/styles.module.css +3 -3
- package/src/alignBox/AlignBox.stories.tsx +84 -0
- package/src/alignBox/AlignBox.tsx +114 -114
- package/src/alignBox/styles.module.css +110 -110
- package/src/amountLabel/AmountLabel.stories.tsx +28 -0
- package/src/amountLabel/AmountLabel.tsx +21 -16
- package/src/amountLabel/styles.module.css +11 -11
- package/src/analytics/PiwikPro.tsx +94 -94
- package/src/analytics/index.ts +1 -1
- package/src/article/Article.stories.tsx +53 -0
- package/src/article/Article.tsx +10 -10
- package/src/badgeList/BadgeList.tsx +34 -34
- package/src/badgeList/styles.module.css +37 -37
- package/src/block/Block.stories.tsx +58 -0
- package/src/block/Block.tsx +35 -35
- package/src/block/styles.module.css +29 -29
- package/src/button/Button.stories.tsx +56 -0
- package/src/button/Button.tsx +3 -3
- package/src/button/ButtonAction.stories.tsx +62 -0
- package/src/button/ButtonAction.tsx +51 -0
- package/src/cardAsLink/CardAsLink.stories.tsx +81 -0
- package/src/cardAsLink/CardAsLink.tsx +21 -21
- package/src/cardAsLink/styles.module.css +23 -23
- package/src/cardsList/CardsList.tsx +56 -56
- package/src/cardsList/styles.module.css +18 -19
- package/src/client.ts +7 -7
- package/src/container/Container.stories.tsx +21 -0
- package/src/container/Container.tsx +10 -10
- package/src/container/styles.module.css +28 -28
- package/src/copyButton/CopyButton.stories.tsx +41 -0
- package/src/copyButton/CopyButton.tsx +45 -39
- package/src/copyButton/styles.module.css +13 -13
- package/src/dataBadgeLink/DataBadgeLink.stories.tsx +137 -0
- package/src/dataBadgeLink/DataBadgeLink.tsx +59 -53
- package/src/dataBadgeLink/styles.module.css +89 -89
- package/src/dataSummary/DataSummary.tsx +22 -22
- package/src/dataSummary/DataSummaryItem.tsx +21 -21
- package/src/dataSummary/styles.module.css +75 -75
- package/src/facetFilters/FacetFilters.stories.tsx +93 -0
- package/src/facetFilters/FacetFilters.tsx +424 -419
- package/src/facetFilters/styles.module.css +3 -3
- package/src/fieldset/FieldSet.stories.tsx +45 -0
- package/src/fieldset/FieldSet.tsx +3 -3
- package/src/filters/Filters.stories.tsx +45 -0
- package/src/filters/Filters.tsx +116 -116
- package/src/filters/styles.module.css +26 -26
- package/src/footer/Footer.stories.tsx +127 -0
- package/src/footer/Footer.tsx +81 -76
- package/src/footer/styles.module.css +103 -103
- package/src/formFieldCheckboxGroup/FormFieldCheckboxGroup.stories.tsx +48 -0
- package/src/formFieldCheckboxGroup/FormFieldCheckboxGroup.tsx +16 -16
- package/src/formFieldCheckboxGroup/styles.module.css +5 -5
- package/src/formFieldCheckboxOption/FormFieldCheckboxOption.stories.tsx +61 -0
- package/src/formFieldCheckboxOption/FormFieldCheckboxOption.tsx +26 -26
- package/src/formFieldCheckboxOption/styles.module.css +22 -22
- package/src/formFieldLabel/FormFieldLabel.stories.tsx +21 -0
- package/src/formFieldLabel/FormFieldLabel.tsx +23 -23
- package/src/formFieldRadioGroup/FormFieldRadioGroup.stories.tsx +57 -0
- package/src/formFieldRadioGroup/FormFieldRadioGroup.tsx +13 -13
- package/src/formFieldRadioGroup/styles.module.css +5 -5
- package/src/formFieldRadioOption/FormFieldRadioOption.stories.tsx +48 -0
- package/src/formFieldRadioOption/FormFieldRadioOption.tsx +75 -75
- package/src/formFieldRadioOption/styles.module.css +49 -49
- package/src/formFieldSwitch/FormFieldSwitch.stories.tsx +61 -0
- package/src/formFieldSwitch/FormFieldSwitch.tsx +82 -79
- package/src/formFieldSwitch/styles.module.css +32 -32
- package/src/formFieldTextInput/FormFieldTextInput.stories.tsx +45 -0
- package/src/formFieldTextInput/FormFieldTextInput.tsx +3 -3
- package/src/grid/Grid.stories.tsx +37 -0
- package/src/grid/Grid.tsx +48 -0
- package/src/grid/styles.module.css +24 -0
- package/src/header/Header.stories.tsx +54 -0
- package/src/header/Header.tsx +137 -137
- package/src/header/styles.module.css +71 -71
- package/src/heading/Heading.stories.tsx +60 -0
- package/src/heading/Heading.tsx +15 -15
- package/src/headingGroup/HeadingGroup.stories.tsx +57 -0
- package/src/headingGroup/HeadingGroup.tsx +48 -48
- package/src/headingGroup/styles.module.css +3 -3
- package/src/i18n.ts +24 -25
- package/src/iconBadge/IconBadge.stories.tsx +46 -0
- package/src/iconBadge/IconBadge.tsx +35 -35
- package/src/iconBadge/getAppearance.ts +53 -53
- package/src/iconBadge/styles.module.css +19 -19
- package/src/iconsSprite/Icon.stories.tsx +73 -0
- package/src/iconsSprite/Icon.tsx +17 -17
- package/src/iconsSprite/IconsSprite.tsx +5 -5
- package/src/index.ts +117 -107
- package/src/infoButton/InfoButton.stories.tsx +52 -0
- package/src/infoButton/InfoButton.tsx +45 -45
- package/src/infoButton/styles.module.css +43 -43
- package/src/link/Link.stories.tsx +49 -0
- package/src/link/Link.tsx +10 -10
- package/src/markdown/Markdown.stories.tsx +48 -0
- package/src/markdown/Markdown.tsx +42 -42
- package/src/overlay/Overlay.stories.tsx +38 -0
- package/src/overlay/Overlay.tsx +18 -18
- package/src/overlay/styles.module.css +15 -15
- package/src/pagination/Pagination.stories.tsx +91 -0
- package/src/pagination/Pagination.tsx +267 -267
- package/src/pagination/styles.module.css +28 -28
- package/src/paragraph/Paragraph.stories.tsx +45 -0
- package/src/paragraph/Paragraph.tsx +24 -24
- package/src/paragraph/styles.module.css +6 -6
- package/src/pillBadge/PillBadge.examples.tsx +107 -107
- package/src/pillBadge/PillBadge.stories.tsx +257 -0
- package/src/pillBadge/PillBadge.tsx +60 -51
- package/src/pillBadge/styles.module.css +214 -214
- package/src/readOnlyTextInput/ReadOnlyTextInput.stories.tsx +49 -0
- package/src/readOnlyTextInput/ReadOnlyTextInput.tsx +24 -24
- package/src/readOnlyTextInput/styles.module.css +19 -19
- package/src/scoreBadge/ScoreBadge.stories.tsx +45 -0
- package/src/scoreBadge/ScoreBadge.tsx +135 -133
- package/src/search/Search.stories.tsx +65 -0
- package/src/search/Search.tsx +82 -82
- package/src/search/styles.module.css +40 -39
- package/src/siteLogo/ExampleLogo.stories.tsx +40 -0
- package/src/siteLogo/SiteLogo.stories.tsx +28 -0
- package/src/siteLogo/SiteLogo.tsx +24 -24
- package/src/sortForm/SortForm.stories.tsx +111 -0
- package/src/sortForm/SortForm.tsx +121 -0
- package/src/sortForm/styles.module.css +40 -0
- package/src/switch/Switch.stories.tsx +68 -0
- package/src/switch/Switch.tsx +152 -86
- package/src/switch/styles.module.css +54 -7
- package/src/toolTip/ToolTip.stories.tsx +131 -0
- package/src/toolTip/ToolTip.tsx +55 -55
- package/src/toolTip/styles.module.css +49 -49
- package/src/topNavigation/TopNavigation.stories.tsx +71 -0
- package/src/topNavigation/TopNavigation.tsx +67 -67
- package/src/topNavigation/styles.module.css +54 -54
- package/tsconfig.json +122 -121
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
.badgelist {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-wrap: wrap;
|
|
4
|
-
gap: 0.25rem;
|
|
5
|
-
padding: 0;
|
|
6
|
-
list-style: none;
|
|
7
|
-
|
|
8
|
-
&:empty {
|
|
9
|
-
display: none;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.badgelist--row {
|
|
14
|
-
flex-direction: row;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.badgelist--row > * {
|
|
18
|
-
display: inline-flex;
|
|
19
|
-
flex-wrap: wrap;
|
|
20
|
-
gap: 0.25rem;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.badgelist--column {
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.badgelist--table > * {
|
|
28
|
-
display: inline-table;
|
|
29
|
-
|
|
30
|
-
:global(.label) {
|
|
31
|
-
display: table-caption;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:global(:not(.label)) {
|
|
35
|
-
margin-inline-end: 0.25rem;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
.badgelist {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: 0.25rem;
|
|
5
|
+
padding: 0;
|
|
6
|
+
list-style: none;
|
|
7
|
+
|
|
8
|
+
&:empty {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.badgelist--row {
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.badgelist--row > * {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
gap: 0.25rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.badgelist--column {
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badgelist--table > * {
|
|
28
|
+
display: inline-table;
|
|
29
|
+
|
|
30
|
+
:global(.label) {
|
|
31
|
+
display: table-caption;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:global(:not(.label)) {
|
|
35
|
+
margin-inline-end: 0.25rem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import Block from "./Block";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Block is een generiek containerelement met een optionele achtergrond/rand
|
|
6
|
+
* (`appearance`) en eenvoudige flex-layout (`layout`), vaak gebruikt om
|
|
7
|
+
* andere componenten in te groeperen.
|
|
8
|
+
*/
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Components/Block",
|
|
11
|
+
component: Block,
|
|
12
|
+
tags: ["autodocs", "custom"],
|
|
13
|
+
argTypes: {
|
|
14
|
+
appearance: {
|
|
15
|
+
control: "select",
|
|
16
|
+
options: ["clear", "outlined", "filled"],
|
|
17
|
+
},
|
|
18
|
+
layout: {
|
|
19
|
+
control: "select",
|
|
20
|
+
options: ["full", "flex-row", "flex-col"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
appearance: "filled",
|
|
25
|
+
layout: "full",
|
|
26
|
+
children: "Dit is de inhoud van het blok.",
|
|
27
|
+
},
|
|
28
|
+
} satisfies Meta<typeof Block>;
|
|
29
|
+
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
|
|
33
|
+
export const Filled: Story = {};
|
|
34
|
+
|
|
35
|
+
export const Outlined: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
appearance: "outlined",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Clear: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
appearance: "clear",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const FlexRow: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
layout: "flex-row",
|
|
50
|
+
children: (
|
|
51
|
+
<>
|
|
52
|
+
<span>Een</span>
|
|
53
|
+
<span>Twee</span>
|
|
54
|
+
<span>Drie</span>
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
};
|
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
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import Button from "./Button";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Een button biedt de mogelijkheid om een actie uit te voeren.
|
|
6
|
+
*/
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Components/Button",
|
|
9
|
+
component: Button,
|
|
10
|
+
tags: ["autodocs", "re-export"],
|
|
11
|
+
args: {
|
|
12
|
+
children: "API toevoegen",
|
|
13
|
+
type: "button",
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
appearance: {
|
|
17
|
+
control: "select",
|
|
18
|
+
options: [
|
|
19
|
+
"primary-action-button",
|
|
20
|
+
"secondary-action-button",
|
|
21
|
+
"subtle-button",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} satisfies Meta<typeof Button>;
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const Primary: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
appearance: "primary-action-button",
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Secondary: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
appearance: "secondary-action-button",
|
|
39
|
+
children: "Annuleren",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Subtle: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
appearance: "subtle-button",
|
|
46
|
+
children: "Meer opties",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Disabled: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
appearance: "primary-action-button",
|
|
53
|
+
children: "Bezig met laden",
|
|
54
|
+
disabled: true,
|
|
55
|
+
},
|
|
56
|
+
};
|
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;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import ButtonAction from "./ButtonAction";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Een ButtonAction is een link die eruitziet als een knop. Gebruik deze als
|
|
6
|
+
* call to action die naar een andere pagina leidt, zoals "API toevoegen".
|
|
7
|
+
* Voor acties op de huidige pagina gebruik je `Button`.
|
|
8
|
+
*/
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Components/ButtonAction",
|
|
11
|
+
component: ButtonAction,
|
|
12
|
+
tags: ["autodocs", "remixed"],
|
|
13
|
+
args: {
|
|
14
|
+
href: "/apis/toevoegen",
|
|
15
|
+
children: "API toevoegen",
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
appearance: {
|
|
19
|
+
control: "select",
|
|
20
|
+
options: [
|
|
21
|
+
"primary-action-button",
|
|
22
|
+
"secondary-action-button",
|
|
23
|
+
"subtle-button",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta<typeof ButtonAction>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Primary: Story = {};
|
|
33
|
+
|
|
34
|
+
export const WithIcon: Story = {
|
|
35
|
+
name: "Met icoon",
|
|
36
|
+
args: {
|
|
37
|
+
icon: "plus-cirkel-inline",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const WithoutIconEnd: Story = {
|
|
42
|
+
name: "Zonder icoon",
|
|
43
|
+
args: {
|
|
44
|
+
iconEnd: false,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Secondary: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
appearance: "secondary-action-button",
|
|
51
|
+
href: "/repositories/toevoegen",
|
|
52
|
+
children: "Repository toevoegen",
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Subtle: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
appearance: "subtle-button",
|
|
59
|
+
href: "/apis/download",
|
|
60
|
+
children: "Download alle API's",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ButtonLink,
|
|
3
|
+
type ButtonLinkProps,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import Icon from "../iconsSprite/Icon";
|
|
6
|
+
|
|
7
|
+
export interface ButtonActionProps extends ButtonLinkProps {
|
|
8
|
+
/**
|
|
9
|
+
* Visual weight of the call to action. Defaults to the primary action
|
|
10
|
+
* appearance, so the link stands out as the main action on the page.
|
|
11
|
+
*/
|
|
12
|
+
appearance?:
|
|
13
|
+
| "primary-action-button"
|
|
14
|
+
| "secondary-action-button"
|
|
15
|
+
| "subtle-button";
|
|
16
|
+
/**
|
|
17
|
+
* Name of an icon in the sprite (without the `icon-` prefix), rendered
|
|
18
|
+
* before the label, e.g. `plus-cirkel-inline`.
|
|
19
|
+
*/
|
|
20
|
+
icon?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Name of an icon in the sprite (without the `icon-` prefix), rendered
|
|
23
|
+
* after the label. Defaults to `delta-naar-rechts-inline`; pass `false`
|
|
24
|
+
* to render no icon.
|
|
25
|
+
*/
|
|
26
|
+
iconEnd?: string | false;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A link styled as a button, used as a call to action (e.g. "API toevoegen").
|
|
31
|
+
* Use this instead of `Button` when the action navigates to another page.
|
|
32
|
+
*/
|
|
33
|
+
const ButtonAction = (props: ButtonActionProps) => {
|
|
34
|
+
const {
|
|
35
|
+
appearance = "primary-action-button",
|
|
36
|
+
icon,
|
|
37
|
+
iconEnd = "delta-naar-rechts-inline",
|
|
38
|
+
children,
|
|
39
|
+
...restProps
|
|
40
|
+
} = props;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<ButtonLink appearance={appearance} {...restProps}>
|
|
44
|
+
{icon && <Icon name={icon} aria-hidden />}
|
|
45
|
+
{children}
|
|
46
|
+
{iconEnd && <Icon name={iconEnd} aria-hidden />}
|
|
47
|
+
</ButtonLink>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default ButtonAction;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import AlignBox from "../alignBox/AlignBox";
|
|
3
|
+
import DataBadgeLink from "../dataBadgeLink/DataBadgeLink";
|
|
4
|
+
import HeadingGroup from "../headingGroup/HeadingGroup";
|
|
5
|
+
import Markdown from "../markdown/Markdown";
|
|
6
|
+
import Paragraph from "../paragraph/Paragraph";
|
|
7
|
+
import PillBadge from "../pillBadge/PillBadge";
|
|
8
|
+
import CardAsLink from "./CardAsLink";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* CardAsLink is een kaart die als geheel klikbaar is, bijvoorbeeld naar een
|
|
12
|
+
* API- of repository-detailpagina. Kop, beschrijving en metadata worden via
|
|
13
|
+
* named slots (`slot="heading"`, `slot="description"`, `slot="metadata"`)
|
|
14
|
+
* doorgegeven.
|
|
15
|
+
*
|
|
16
|
+
* ## Wijzigingen tov RHC:
|
|
17
|
+
* - Alleen CSS-aanpassingen (hover-onderstreping van de kop); geen
|
|
18
|
+
* wijzigingen in props.
|
|
19
|
+
*/
|
|
20
|
+
const meta = {
|
|
21
|
+
title: "Components/CardAsLink",
|
|
22
|
+
component: CardAsLink,
|
|
23
|
+
tags: ["autodocs", "mixed"],
|
|
24
|
+
} satisfies Meta<typeof CardAsLink>;
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const ApiOverviewCard: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
href: "/apis/basisregistratie-adressen-en-gebouwen",
|
|
32
|
+
linkLabel: "Bekijk details",
|
|
33
|
+
},
|
|
34
|
+
render: (args) => (
|
|
35
|
+
<CardAsLink {...args}>
|
|
36
|
+
<HeadingGroup
|
|
37
|
+
slot="heading"
|
|
38
|
+
title="Basisregistratie Adressen en Gebouwen API"
|
|
39
|
+
level={2}
|
|
40
|
+
appearanceLevel={4}
|
|
41
|
+
>
|
|
42
|
+
<div className="subtitle" slot="subTitle">
|
|
43
|
+
<Paragraph
|
|
44
|
+
slot="subTitle"
|
|
45
|
+
data-content-piece="Organisation Name"
|
|
46
|
+
itemScope={true}
|
|
47
|
+
itemType="https://schema.org/Organization"
|
|
48
|
+
itemID="https://standaarden.overheid.nl/owms/terms/Kadaster"
|
|
49
|
+
className="moveAbove"
|
|
50
|
+
>
|
|
51
|
+
<span itemProp="name">
|
|
52
|
+
<DataBadgeLink
|
|
53
|
+
appearance="subtle"
|
|
54
|
+
href="/apis?organisation=kadaster"
|
|
55
|
+
>
|
|
56
|
+
Kadaster
|
|
57
|
+
</DataBadgeLink>
|
|
58
|
+
</span>
|
|
59
|
+
</Paragraph>
|
|
60
|
+
<div className="header-meta" />
|
|
61
|
+
</div>
|
|
62
|
+
</HeadingGroup>
|
|
63
|
+
<div slot="description" className="description utrecht-html">
|
|
64
|
+
<Markdown
|
|
65
|
+
text="API voor het zoeken en raadplegen van adressen, panden, verblijfsobjecten en gerelateerde gegevens uit de BAG."
|
|
66
|
+
openLinksInNewTab
|
|
67
|
+
allowedElements={["p", "a", "ul", "ol", "li"]}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
<AlignBox align="space-between" slot="metadata" className="meta">
|
|
71
|
+
<PillBadge
|
|
72
|
+
startValue="Status"
|
|
73
|
+
endValue="Actief"
|
|
74
|
+
type="color"
|
|
75
|
+
color="mintgroen"
|
|
76
|
+
/>
|
|
77
|
+
<span className="last-updated">Laatste wijziging: 08-07-2026</span>
|
|
78
|
+
</AlignBox>
|
|
79
|
+
</CardAsLink>
|
|
80
|
+
),
|
|
81
|
+
};
|
|
@@ -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
|
+
}
|