@developer-overheid-nl/don-register-components 1.3.1 → 1.6.2
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 +176 -130
- package/LICENSE.md +291 -291
- package/README.md +20 -20
- package/package.json +10 -8
- package/src/Introduction.mdx +52 -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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import Overlay from "./Overlay";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Overlay dekt zijn omliggende content af zolang `active` waar is,
|
|
6
|
+
* bijvoorbeeld tijdens het laden van een formulieractie. Vereist een
|
|
7
|
+
* `position: relative` ouderelement.
|
|
8
|
+
*/
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Components/Overlay",
|
|
11
|
+
component: Overlay,
|
|
12
|
+
tags: ["autodocs", "custom"],
|
|
13
|
+
args: {
|
|
14
|
+
active: true,
|
|
15
|
+
},
|
|
16
|
+
decorators: [
|
|
17
|
+
(Story) => (
|
|
18
|
+
<div style={{ position: "relative", maxWidth: "20rem" }}>
|
|
19
|
+
<p>
|
|
20
|
+
Deze inhoud wordt afgedekt terwijl er bijvoorbeeld op een
|
|
21
|
+
formulieractie wordt gewacht.
|
|
22
|
+
</p>
|
|
23
|
+
<Story />
|
|
24
|
+
</div>
|
|
25
|
+
),
|
|
26
|
+
],
|
|
27
|
+
} satisfies Meta<typeof Overlay>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Active: Story = {};
|
|
33
|
+
|
|
34
|
+
export const Inactive: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
active: false,
|
|
37
|
+
},
|
|
38
|
+
};
|
package/src/overlay/Overlay.tsx
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import styles from "./styles.module.css";
|
|
3
|
-
|
|
4
|
-
const Overlay = ({
|
|
5
|
-
children,
|
|
6
|
-
active,
|
|
7
|
-
}: {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
active: boolean;
|
|
10
|
-
}) => {
|
|
11
|
-
return (
|
|
12
|
-
<div className={clsx(styles.overlay, active && styles.active)}>
|
|
13
|
-
{children}
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default Overlay;
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import styles from "./styles.module.css";
|
|
3
|
+
|
|
4
|
+
const Overlay = ({
|
|
5
|
+
children,
|
|
6
|
+
active,
|
|
7
|
+
}: {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
active: boolean;
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className={clsx(styles.overlay, active && styles.active)}>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Overlay;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
.overlay {
|
|
2
|
-
display: none;
|
|
3
|
-
|
|
4
|
-
&.active {
|
|
5
|
-
position: absolute;
|
|
6
|
-
top: 0;
|
|
7
|
-
left: -1px;
|
|
8
|
-
z-index: 999;
|
|
9
|
-
display: block;
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
background-color: rgba(255, 255, 255, 0.25);
|
|
13
|
-
backdrop-filter: blur(1px);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
.overlay {
|
|
2
|
+
display: none;
|
|
3
|
+
|
|
4
|
+
&.active {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: -1px;
|
|
8
|
+
z-index: 999;
|
|
9
|
+
display: block;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
background-color: rgba(255, 255, 255, 0.25);
|
|
13
|
+
backdrop-filter: blur(1px);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import Pagination from "./Pagination";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Pagination toont een reeks paginalinks, met optionele eerste/vorige/
|
|
6
|
+
* volgende/laatste-links en ellipsissen. De props komen doorgaans uit de
|
|
7
|
+
* `getPagination`-helper in `packages/layouts`.
|
|
8
|
+
*/
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Components/Pagination",
|
|
11
|
+
component: Pagination,
|
|
12
|
+
tags: ["autodocs", "custom"],
|
|
13
|
+
} satisfies Meta<typeof Pagination>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
name: "Middelste pagina (met ellipsis)",
|
|
20
|
+
args: {
|
|
21
|
+
links: [
|
|
22
|
+
{ href: "/apis/pagina/3", label: 3, current: false },
|
|
23
|
+
{ href: "/apis/pagina/4", label: 4, current: false },
|
|
24
|
+
{ href: "/apis/pagina/5", label: 5, current: true, range: [81, 100] },
|
|
25
|
+
{ href: "/apis/pagina/6", label: 6, current: false },
|
|
26
|
+
{ href: "/apis/pagina/7", label: 7, current: false },
|
|
27
|
+
],
|
|
28
|
+
first: { href: "/apis/pagina/1", label: 1 },
|
|
29
|
+
prev: { href: "/apis/pagina/4", label: 4 },
|
|
30
|
+
ellipsisBefore: true,
|
|
31
|
+
ellipsisAfter: true,
|
|
32
|
+
next: { href: "/apis/pagina/6", label: 6 },
|
|
33
|
+
last: { href: "/apis/pagina/10", label: 10 },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const FirstPage: Story = {
|
|
38
|
+
name: "Eerste pagina",
|
|
39
|
+
args: {
|
|
40
|
+
links: [
|
|
41
|
+
{ href: "/apis/pagina/1", label: 1, current: true, range: [1, 20] },
|
|
42
|
+
{ href: "/apis/pagina/2", label: 2, current: false },
|
|
43
|
+
{ href: "/apis/pagina/3", label: 3, current: false },
|
|
44
|
+
],
|
|
45
|
+
first: false,
|
|
46
|
+
prev: false,
|
|
47
|
+
ellipsisBefore: false,
|
|
48
|
+
next: { href: "/apis/pagina/2", label: 2 },
|
|
49
|
+
last: { href: "/apis/pagina/10", label: 10 },
|
|
50
|
+
ellipsisAfter: true,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const LastPage: Story = {
|
|
55
|
+
name: "Laatste pagina",
|
|
56
|
+
args: {
|
|
57
|
+
links: [
|
|
58
|
+
{ href: "/apis/pagina/8", label: 8, current: false },
|
|
59
|
+
{ href: "/apis/pagina/9", label: 9, current: false },
|
|
60
|
+
{
|
|
61
|
+
href: "/apis/pagina/10",
|
|
62
|
+
label: 10,
|
|
63
|
+
current: true,
|
|
64
|
+
range: [181, 200],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
first: { href: "/apis/pagina/1", label: 1 },
|
|
68
|
+
prev: { href: "/apis/pagina/9", label: 9 },
|
|
69
|
+
ellipsisBefore: true,
|
|
70
|
+
next: false,
|
|
71
|
+
last: false,
|
|
72
|
+
ellipsisAfter: false,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const FewPages: Story = {
|
|
77
|
+
name: "Weinig pagina's (geen ellipsis)",
|
|
78
|
+
args: {
|
|
79
|
+
links: [
|
|
80
|
+
{ href: "/apis/pagina/1", label: 1, current: false },
|
|
81
|
+
{ href: "/apis/pagina/2", label: 2, current: true, range: [21, 40] },
|
|
82
|
+
{ href: "/apis/pagina/3", label: 3, current: false },
|
|
83
|
+
],
|
|
84
|
+
prev: { href: "/apis/pagina/1", label: 1 },
|
|
85
|
+
next: { href: "/apis/pagina/3", label: 3 },
|
|
86
|
+
first: false,
|
|
87
|
+
last: false,
|
|
88
|
+
ellipsisBefore: false,
|
|
89
|
+
ellipsisAfter: false,
|
|
90
|
+
},
|
|
91
|
+
};
|