@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,103 +1,103 @@
|
|
|
1
|
-
.footer {
|
|
2
|
-
--utrecht-page-footer-padding-block-end: 2rem;
|
|
3
|
-
--utrecht-page-footer-padding-block-start: 1rem;
|
|
4
|
-
--utrecht-page-footer-padding-inline-end: var(
|
|
5
|
-
--rhc-nav-bar-link-padding-inline-end
|
|
6
|
-
);
|
|
7
|
-
--utrecht-page-footer-padding-inline-start: var(
|
|
8
|
-
--rhc-nav-bar-link-padding-inline-start
|
|
9
|
-
);
|
|
10
|
-
--rhc-page-footer-outlined-color: #154273;
|
|
11
|
-
--rhc-page-footer-outlined-border-color: var(--rhc-nav-bar-border-color);
|
|
12
|
-
--rhc-page-footer-border-block-start-width: var(
|
|
13
|
-
--rhc-nav-bar-border-block-end-width
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.footer {
|
|
18
|
-
:global(.utrecht-column-layout) {
|
|
19
|
-
display: flex;
|
|
20
|
-
justify-content: space-between;
|
|
21
|
-
inline-size: 100%;
|
|
22
|
-
|
|
23
|
-
> * {
|
|
24
|
-
flex-grow: 0;
|
|
25
|
-
flex-shrink: 0;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.numColumns,
|
|
30
|
-
&.numColumns1 {
|
|
31
|
-
:global(.utrecht-column-layout) {
|
|
32
|
-
row-gap: 0.5rem;
|
|
33
|
-
|
|
34
|
-
> * {
|
|
35
|
-
flex-basis: 100%;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.numColumns2 {
|
|
41
|
-
:global(.utrecht-column-layout) {
|
|
42
|
-
> * {
|
|
43
|
-
flex-basis: calc(50% - var(--utrecht-column-layout-gap, 2em));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.numColumns3 {
|
|
49
|
-
:global(.utrecht-column-layout) {
|
|
50
|
-
> * {
|
|
51
|
-
flex-basis: calc(33.333% - var(--utrecht-column-layout-gap, 2em));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
&.numColumns4 {
|
|
56
|
-
:global(.utrecht-column-layout) {
|
|
57
|
-
flex-wrap: wrap;
|
|
58
|
-
|
|
59
|
-
> * {
|
|
60
|
-
flex-basis: calc(25% - var(--utrecht-column-layout-gap, 2em));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:global(.utrecht-link-list__link) {
|
|
66
|
-
align-items: center;
|
|
67
|
-
:global(.don-icon-externe-link-inline) {
|
|
68
|
-
order: 1;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@media (--xs-and-below-viewport) {
|
|
74
|
-
.footer.footer {
|
|
75
|
-
:global(.utrecht-column-layout) {
|
|
76
|
-
row-gap: 0.5rem;
|
|
77
|
-
|
|
78
|
-
> * {
|
|
79
|
-
flex-basis: calc(50% - var(--utrecht-column-layout-gap, 2em));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@media (--xxs-and-below-viewport) {
|
|
86
|
-
.footer.footer {
|
|
87
|
-
:global(.utrecht-column-layout) {
|
|
88
|
-
row-gap: 0.5rem;
|
|
89
|
-
|
|
90
|
-
> * {
|
|
91
|
-
flex-basis: 100%;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:global(.rhc-page-prefooter.rhc-page-prefooter) {
|
|
98
|
-
margin-block-start: 2rem;
|
|
99
|
-
|
|
100
|
-
&:before {
|
|
101
|
-
background-color: var(--rhc-nav-bar-border-color);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
1
|
+
.footer {
|
|
2
|
+
--utrecht-page-footer-padding-block-end: 2rem;
|
|
3
|
+
--utrecht-page-footer-padding-block-start: 1rem;
|
|
4
|
+
--utrecht-page-footer-padding-inline-end: var(
|
|
5
|
+
--rhc-nav-bar-link-padding-inline-end
|
|
6
|
+
);
|
|
7
|
+
--utrecht-page-footer-padding-inline-start: var(
|
|
8
|
+
--rhc-nav-bar-link-padding-inline-start
|
|
9
|
+
);
|
|
10
|
+
--rhc-page-footer-outlined-color: #154273;
|
|
11
|
+
--rhc-page-footer-outlined-border-color: var(--rhc-nav-bar-border-color);
|
|
12
|
+
--rhc-page-footer-border-block-start-width: var(
|
|
13
|
+
--rhc-nav-bar-border-block-end-width
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.footer {
|
|
18
|
+
:global(.utrecht-column-layout) {
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
inline-size: 100%;
|
|
22
|
+
|
|
23
|
+
> * {
|
|
24
|
+
flex-grow: 0;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.numColumns,
|
|
30
|
+
&.numColumns1 {
|
|
31
|
+
:global(.utrecht-column-layout) {
|
|
32
|
+
row-gap: 0.5rem;
|
|
33
|
+
|
|
34
|
+
> * {
|
|
35
|
+
flex-basis: 100%;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.numColumns2 {
|
|
41
|
+
:global(.utrecht-column-layout) {
|
|
42
|
+
> * {
|
|
43
|
+
flex-basis: calc(50% - var(--utrecht-column-layout-gap, 2em));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.numColumns3 {
|
|
49
|
+
:global(.utrecht-column-layout) {
|
|
50
|
+
> * {
|
|
51
|
+
flex-basis: calc(33.333% - var(--utrecht-column-layout-gap, 2em));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
&.numColumns4 {
|
|
56
|
+
:global(.utrecht-column-layout) {
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
|
|
59
|
+
> * {
|
|
60
|
+
flex-basis: calc(25% - var(--utrecht-column-layout-gap, 2em));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:global(.utrecht-link-list__link) {
|
|
66
|
+
align-items: center;
|
|
67
|
+
:global(.don-icon-externe-link-inline) {
|
|
68
|
+
order: 1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (--xs-and-below-viewport) {
|
|
74
|
+
.footer.footer {
|
|
75
|
+
:global(.utrecht-column-layout) {
|
|
76
|
+
row-gap: 0.5rem;
|
|
77
|
+
|
|
78
|
+
> * {
|
|
79
|
+
flex-basis: calc(50% - var(--utrecht-column-layout-gap, 2em));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media (--xxs-and-below-viewport) {
|
|
86
|
+
.footer.footer {
|
|
87
|
+
:global(.utrecht-column-layout) {
|
|
88
|
+
row-gap: 0.5rem;
|
|
89
|
+
|
|
90
|
+
> * {
|
|
91
|
+
flex-basis: 100%;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:global(.rhc-page-prefooter.rhc-page-prefooter) {
|
|
98
|
+
margin-block-start: 2rem;
|
|
99
|
+
|
|
100
|
+
&:before {
|
|
101
|
+
background-color: var(--rhc-nav-bar-border-color);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import type React from "react";
|
|
3
|
-
|
|
4
|
-
interface FormFieldLabelProps {
|
|
5
|
-
htmlFor?: string;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
required?: boolean;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const FormFieldLabel: React.FC<FormFieldLabelProps> = ({
|
|
12
|
-
htmlFor,
|
|
13
|
-
children,
|
|
14
|
-
className,
|
|
15
|
-
}) => {
|
|
16
|
-
return (
|
|
17
|
-
<label htmlFor={htmlFor} className={clsx("utrecht-form-label", className)}>
|
|
18
|
-
{children}
|
|
19
|
-
</label>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default FormFieldLabel;
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
|
|
4
|
+
interface FormFieldLabelProps {
|
|
5
|
+
htmlFor?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const FormFieldLabel: React.FC<FormFieldLabelProps> = ({
|
|
12
|
+
htmlFor,
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<label htmlFor={htmlFor} className={clsx("utrecht-form-label", className)}>
|
|
18
|
+
{children}
|
|
19
|
+
</label>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default FormFieldLabel;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FormFieldTextInput } from "@rijkshuisstijl-community/components-react";
|
|
2
|
-
|
|
3
|
-
export default FormFieldTextInput;
|
|
1
|
+
import { FormFieldTextInput } from "@rijkshuisstijl-community/components-react";
|
|
2
|
+
|
|
3
|
+
export default FormFieldTextInput;
|
package/src/header/Header.tsx
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
import { Lint } from "@developer-overheid-nl/proprietary";
|
|
2
|
-
import {
|
|
3
|
-
Heading /*, Link */,
|
|
4
|
-
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
-
import { I18nextProvider, useTranslation } from "react-i18next";
|
|
6
|
-
import i18n from "../i18n";
|
|
7
|
-
import SiteLogo from "../siteLogo/SiteLogo";
|
|
8
|
-
import styles from "./styles.module.css";
|
|
9
|
-
// import { IconDeltaNaarLinksInline } from "../../../../proprietary/icons";
|
|
10
|
-
|
|
11
|
-
export interface HeaderProps extends LogoNavProps {
|
|
12
|
-
titleSite: string;
|
|
13
|
-
titlePage: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface LogoNavProps {
|
|
17
|
-
mainSite: { name: string; url: string };
|
|
18
|
-
urlCurrent?: string;
|
|
19
|
-
/**
|
|
20
|
-
* routePattern(s) that are considered hompages, e.g. `/`, `/apis`, `/apis/[...pages]`
|
|
21
|
-
* The first item in the array will be used for the homepage link.
|
|
22
|
-
*
|
|
23
|
-
* @type string[]
|
|
24
|
-
*/
|
|
25
|
-
urlHomepage?: string[];
|
|
26
|
-
/**
|
|
27
|
-
* How the link around the logo should behave.
|
|
28
|
-
* - `no-link`: always no link around the logo
|
|
29
|
-
* - `site-home`: (default) a link around the logo that links back to this site, no link on hompeage
|
|
30
|
-
* - `main-site`: a link around the logo that links always back to the main site
|
|
31
|
-
* - `main-site-on-home`: a link around the logo that links back to this site's homepage, but on the homepage links back to the main site
|
|
32
|
-
*
|
|
33
|
-
* Note: translation keys: `components.back-to-homepage-landmark`, ...
|
|
34
|
-
*/
|
|
35
|
-
logoLinkBehaviour?:
|
|
36
|
-
| "no-link"
|
|
37
|
-
| "site-home"
|
|
38
|
-
| "main-site"
|
|
39
|
-
| "main-site-on-home";
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function LogoNav(props: LogoNavProps) {
|
|
43
|
-
const { t } = useTranslation();
|
|
44
|
-
const {
|
|
45
|
-
mainSite,
|
|
46
|
-
urlCurrent = "/",
|
|
47
|
-
urlHomepage = ["/"],
|
|
48
|
-
logoLinkBehaviour,
|
|
49
|
-
} = props;
|
|
50
|
-
let isRoot: boolean = urlHomepage.includes(urlCurrent);
|
|
51
|
-
let href: string = "/";
|
|
52
|
-
let landmark: string | undefined;
|
|
53
|
-
let title: string | undefined;
|
|
54
|
-
|
|
55
|
-
switch (logoLinkBehaviour) {
|
|
56
|
-
case "no-link":
|
|
57
|
-
isRoot = true;
|
|
58
|
-
break;
|
|
59
|
-
case "main-site":
|
|
60
|
-
isRoot = false;
|
|
61
|
-
href = mainSite.url;
|
|
62
|
-
landmark = t("components.back-to-main-site-landmark", {
|
|
63
|
-
siteName: mainSite.name,
|
|
64
|
-
});
|
|
65
|
-
break;
|
|
66
|
-
case "main-site-on-home":
|
|
67
|
-
href = isRoot ? mainSite.url : urlHomepage[0] || "/";
|
|
68
|
-
landmark = isRoot
|
|
69
|
-
? t("components.back-to-main-site-landmark", {
|
|
70
|
-
siteName: mainSite.name,
|
|
71
|
-
})
|
|
72
|
-
: t("components.back-to-homepage-landmark");
|
|
73
|
-
title = isRoot
|
|
74
|
-
? t("components.back-to-main-site", { siteName: mainSite.name })
|
|
75
|
-
: t("components.back-to-homepage");
|
|
76
|
-
isRoot = false;
|
|
77
|
-
break;
|
|
78
|
-
default:
|
|
79
|
-
href = urlHomepage[0] || "/";
|
|
80
|
-
landmark = isRoot ? undefined : t("components.back-to-homepage-landmark");
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return landmark ? (
|
|
85
|
-
<nav aria-label={landmark} title={title}>
|
|
86
|
-
<SiteLogo isRoot={isRoot} href={href} />
|
|
87
|
-
</nav>
|
|
88
|
-
) : (
|
|
89
|
-
<div className="nav">
|
|
90
|
-
<SiteLogo isRoot={isRoot} href={href} />
|
|
91
|
-
</div>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function Header({
|
|
96
|
-
titleSite,
|
|
97
|
-
titlePage,
|
|
98
|
-
mainSite,
|
|
99
|
-
urlCurrent,
|
|
100
|
-
urlHomepage,
|
|
101
|
-
logoLinkBehaviour,
|
|
102
|
-
}: HeaderProps) {
|
|
103
|
-
// const { t } = useTranslation();
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
<header className={styles.header}>
|
|
107
|
-
<LogoNav
|
|
108
|
-
mainSite={mainSite}
|
|
109
|
-
urlCurrent={urlCurrent}
|
|
110
|
-
urlHomepage={urlHomepage}
|
|
111
|
-
logoLinkBehaviour={logoLinkBehaviour}
|
|
112
|
-
/>
|
|
113
|
-
<Lint className={styles.lint} />
|
|
114
|
-
<div className={styles.title}>
|
|
115
|
-
<Heading level={1} appearanceLevel={3} className={styles.heading}>
|
|
116
|
-
{titleSite}
|
|
117
|
-
<span className="sr-only">: {titlePage}</span>
|
|
118
|
-
</Heading>
|
|
119
|
-
{/* TODO: uncomment and update component if backlink here is still needed... */}
|
|
120
|
-
{/* <nav aria-label={t('components.back-to-main-site-landmark')}>
|
|
121
|
-
<Link href={mainSite.url} className={styles.link}>
|
|
122
|
-
<IconDeltaNaarLinksInline className={styles.icon} />
|
|
123
|
-
{t('components.back-to-main-site', { siteName: mainSite.name })}
|
|
124
|
-
</Link>
|
|
125
|
-
</nav> */}
|
|
126
|
-
</div>
|
|
127
|
-
</header>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export default function TranslatedHeader(props: HeaderProps) {
|
|
132
|
-
return (
|
|
133
|
-
<I18nextProvider i18n={i18n}>
|
|
134
|
-
<Header {...props} />
|
|
135
|
-
</I18nextProvider>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
1
|
+
import { Lint } from "@developer-overheid-nl/proprietary";
|
|
2
|
+
import {
|
|
3
|
+
Heading /*, Link */,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import { I18nextProvider, useTranslation } from "react-i18next";
|
|
6
|
+
import i18n from "../i18n";
|
|
7
|
+
import SiteLogo from "../siteLogo/SiteLogo";
|
|
8
|
+
import styles from "./styles.module.css";
|
|
9
|
+
// import { IconDeltaNaarLinksInline } from "../../../../proprietary/icons";
|
|
10
|
+
|
|
11
|
+
export interface HeaderProps extends LogoNavProps {
|
|
12
|
+
titleSite: string;
|
|
13
|
+
titlePage: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface LogoNavProps {
|
|
17
|
+
mainSite: { name: string; url: string };
|
|
18
|
+
urlCurrent?: string;
|
|
19
|
+
/**
|
|
20
|
+
* routePattern(s) that are considered hompages, e.g. `/`, `/apis`, `/apis/[...pages]`
|
|
21
|
+
* The first item in the array will be used for the homepage link.
|
|
22
|
+
*
|
|
23
|
+
* @type string[]
|
|
24
|
+
*/
|
|
25
|
+
urlHomepage?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* How the link around the logo should behave.
|
|
28
|
+
* - `no-link`: always no link around the logo
|
|
29
|
+
* - `site-home`: (default) a link around the logo that links back to this site, no link on hompeage
|
|
30
|
+
* - `main-site`: a link around the logo that links always back to the main site
|
|
31
|
+
* - `main-site-on-home`: a link around the logo that links back to this site's homepage, but on the homepage links back to the main site
|
|
32
|
+
*
|
|
33
|
+
* Note: translation keys: `components.back-to-homepage-landmark`, ...
|
|
34
|
+
*/
|
|
35
|
+
logoLinkBehaviour?:
|
|
36
|
+
| "no-link"
|
|
37
|
+
| "site-home"
|
|
38
|
+
| "main-site"
|
|
39
|
+
| "main-site-on-home";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function LogoNav(props: LogoNavProps) {
|
|
43
|
+
const { t } = useTranslation();
|
|
44
|
+
const {
|
|
45
|
+
mainSite,
|
|
46
|
+
urlCurrent = "/",
|
|
47
|
+
urlHomepage = ["/"],
|
|
48
|
+
logoLinkBehaviour,
|
|
49
|
+
} = props;
|
|
50
|
+
let isRoot: boolean = urlHomepage.includes(urlCurrent);
|
|
51
|
+
let href: string = "/";
|
|
52
|
+
let landmark: string | undefined;
|
|
53
|
+
let title: string | undefined;
|
|
54
|
+
|
|
55
|
+
switch (logoLinkBehaviour) {
|
|
56
|
+
case "no-link":
|
|
57
|
+
isRoot = true;
|
|
58
|
+
break;
|
|
59
|
+
case "main-site":
|
|
60
|
+
isRoot = false;
|
|
61
|
+
href = mainSite.url;
|
|
62
|
+
landmark = t("components.back-to-main-site-landmark", {
|
|
63
|
+
siteName: mainSite.name,
|
|
64
|
+
});
|
|
65
|
+
break;
|
|
66
|
+
case "main-site-on-home":
|
|
67
|
+
href = isRoot ? mainSite.url : urlHomepage[0] || "/";
|
|
68
|
+
landmark = isRoot
|
|
69
|
+
? t("components.back-to-main-site-landmark", {
|
|
70
|
+
siteName: mainSite.name,
|
|
71
|
+
})
|
|
72
|
+
: t("components.back-to-homepage-landmark");
|
|
73
|
+
title = isRoot
|
|
74
|
+
? t("components.back-to-main-site", { siteName: mainSite.name })
|
|
75
|
+
: t("components.back-to-homepage");
|
|
76
|
+
isRoot = false;
|
|
77
|
+
break;
|
|
78
|
+
default:
|
|
79
|
+
href = urlHomepage[0] || "/";
|
|
80
|
+
landmark = isRoot ? undefined : t("components.back-to-homepage-landmark");
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return landmark ? (
|
|
85
|
+
<nav aria-label={landmark} title={title}>
|
|
86
|
+
<SiteLogo isRoot={isRoot} href={href} />
|
|
87
|
+
</nav>
|
|
88
|
+
) : (
|
|
89
|
+
<div className="nav">
|
|
90
|
+
<SiteLogo isRoot={isRoot} href={href} />
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function Header({
|
|
96
|
+
titleSite,
|
|
97
|
+
titlePage,
|
|
98
|
+
mainSite,
|
|
99
|
+
urlCurrent,
|
|
100
|
+
urlHomepage,
|
|
101
|
+
logoLinkBehaviour,
|
|
102
|
+
}: HeaderProps) {
|
|
103
|
+
// const { t } = useTranslation();
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<header className={styles.header}>
|
|
107
|
+
<LogoNav
|
|
108
|
+
mainSite={mainSite}
|
|
109
|
+
urlCurrent={urlCurrent}
|
|
110
|
+
urlHomepage={urlHomepage}
|
|
111
|
+
logoLinkBehaviour={logoLinkBehaviour}
|
|
112
|
+
/>
|
|
113
|
+
<Lint className={styles.lint} />
|
|
114
|
+
<div className={styles.title}>
|
|
115
|
+
<Heading level={1} appearanceLevel={3} className={styles.heading}>
|
|
116
|
+
{titleSite}
|
|
117
|
+
<span className="sr-only">: {titlePage}</span>
|
|
118
|
+
</Heading>
|
|
119
|
+
{/* TODO: uncomment and update component if backlink here is still needed... */}
|
|
120
|
+
{/* <nav aria-label={t('components.back-to-main-site-landmark')}>
|
|
121
|
+
<Link href={mainSite.url} className={styles.link}>
|
|
122
|
+
<IconDeltaNaarLinksInline className={styles.icon} />
|
|
123
|
+
{t('components.back-to-main-site', { siteName: mainSite.name })}
|
|
124
|
+
</Link>
|
|
125
|
+
</nav> */}
|
|
126
|
+
</div>
|
|
127
|
+
</header>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export default function TranslatedHeader(props: HeaderProps) {
|
|
132
|
+
return (
|
|
133
|
+
<I18nextProvider i18n={i18n}>
|
|
134
|
+
<Header {...props} />
|
|
135
|
+
</I18nextProvider>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
.header {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
padding-block: 0 0.5rem;
|
|
6
|
-
|
|
7
|
-
> * {
|
|
8
|
-
flex-basis: 33.3333%;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@media (--xxs-and-below-viewport) {
|
|
13
|
-
.header {
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
|
|
16
|
-
> * {
|
|
17
|
-
flex-basis: auto;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@media (--xs-and-below-viewport) {
|
|
23
|
-
.header {
|
|
24
|
-
flex-wrap: wrap;
|
|
25
|
-
row-gap: 0.5rem;
|
|
26
|
-
|
|
27
|
-
> * {
|
|
28
|
-
flex-basis: auto;
|
|
29
|
-
order: 2;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.lint {
|
|
34
|
-
flex-basis: 100%;
|
|
35
|
-
order: 1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.title {
|
|
40
|
-
margin-inline-start: 1rem;
|
|
41
|
-
text-align: end;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.heading {
|
|
45
|
-
margin: 0;
|
|
46
|
-
margin-block-end: 0.5rem;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.icon {
|
|
50
|
-
inline-size: 0.875rem;
|
|
51
|
-
block-size: 0.875rem;
|
|
52
|
-
fill: currentColor;
|
|
53
|
-
transition: all 0.25s ease-in-out;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.link.link:any-link {
|
|
57
|
-
align-items: center;
|
|
58
|
-
text-decoration-line: none;
|
|
59
|
-
transition: all 0.25s ease-in-out;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.link.link:any-link:hover {
|
|
63
|
-
text-decoration-line: underline;
|
|
64
|
-
/* first skip-ink needed for Chromium browsers, otherwise .nl-link `none` is used */
|
|
65
|
-
text-decoration-skip-ink: auto;
|
|
66
|
-
text-decoration-skip-ink: all; /* bugged in Chromium */
|
|
67
|
-
|
|
68
|
-
.icon {
|
|
69
|
-
transform: translateX(-0.0625rem);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
.header {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
padding-block: 0 0.5rem;
|
|
6
|
+
|
|
7
|
+
> * {
|
|
8
|
+
flex-basis: 33.3333%;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (--xxs-and-below-viewport) {
|
|
13
|
+
.header {
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
|
|
16
|
+
> * {
|
|
17
|
+
flex-basis: auto;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (--xs-and-below-viewport) {
|
|
23
|
+
.header {
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
row-gap: 0.5rem;
|
|
26
|
+
|
|
27
|
+
> * {
|
|
28
|
+
flex-basis: auto;
|
|
29
|
+
order: 2;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.lint {
|
|
34
|
+
flex-basis: 100%;
|
|
35
|
+
order: 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.title {
|
|
40
|
+
margin-inline-start: 1rem;
|
|
41
|
+
text-align: end;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.heading {
|
|
45
|
+
margin: 0;
|
|
46
|
+
margin-block-end: 0.5rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.icon {
|
|
50
|
+
inline-size: 0.875rem;
|
|
51
|
+
block-size: 0.875rem;
|
|
52
|
+
fill: currentColor;
|
|
53
|
+
transition: all 0.25s ease-in-out;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.link.link:any-link {
|
|
57
|
+
align-items: center;
|
|
58
|
+
text-decoration-line: none;
|
|
59
|
+
transition: all 0.25s ease-in-out;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.link.link:any-link:hover {
|
|
63
|
+
text-decoration-line: underline;
|
|
64
|
+
/* first skip-ink needed for Chromium browsers, otherwise .nl-link `none` is used */
|
|
65
|
+
text-decoration-skip-ink: auto;
|
|
66
|
+
text-decoration-skip-ink: all; /* bugged in Chromium */
|
|
67
|
+
|
|
68
|
+
.icon {
|
|
69
|
+
transform: translateX(-0.0625rem);
|
|
70
|
+
}
|
|
71
|
+
}
|