@developer-overheid-nl/don-register-components 0.0.1-beta.6 → 1.0.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/README.md +20 -0
- package/package.json +2 -2
- package/src/button/Button.tsx +3 -0
- package/src/fieldset/FieldSet.tsx +3 -0
- package/src/formFieldLabel/FormFieldLabel.tsx +23 -0
- package/src/formFieldTextInput/FormFieldTextInput.tsx +3 -0
- package/src/header/Header.tsx +6 -6
- package/src/index.ts +4 -0
- package/src/readOnlyTextInput/ReadOnlyTextInput.tsx +7 -3
- package/src/readOnlyTextInput/styles.module.css +13 -0
- package/src/search/Search.tsx +1 -1
- package/src/topNavigation/TopNavigation.tsx +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Register Site Components
|
|
2
|
+
|
|
3
|
+
> Deze package bevat de generieke React componenten voor een register site.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](https://www.npmjs.com/package/@developer-overheid-nl/don-register-components)
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Gebruik
|
|
10
|
+
|
|
11
|
+
Deze package wordt gebruikt in de register sites van developer.overheid.nl en in register-site-template repository.
|
|
12
|
+
|
|
13
|
+
De package heeft o.a. de volgende dependencies:
|
|
14
|
+
|
|
15
|
+
- [Rijkshuisstijl Community](https://www.rijkshuisstijl-community.nl/) voor de React componenten, CSS en design tokens
|
|
16
|
+
- [@developer-overheid-nl/don-register-locales](https://www.npmjs.com/package/@developer-overheid-nl/don-register-locales)
|
|
17
|
+
|
|
18
|
+
## Changelog
|
|
19
|
+
|
|
20
|
+
Zie de [CHANGELOG](./CHANGELOG.md) voor een overzicht van de wijzigingen in deze package.
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "0.0
|
|
8
|
+
"version": "1.0.0",
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-i18next": "16.5.1",
|
|
32
32
|
"react-markdown": "10.1.0",
|
|
33
33
|
"remark-behead": "^3.1.0",
|
|
34
|
-
"@developer-overheid-nl/don-register-locales": "0.0
|
|
34
|
+
"@developer-overheid-nl/don-register-locales": "1.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@vitejs/plugin-react": "^5.1.2",
|
|
@@ -0,0 +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;
|
package/src/header/Header.tsx
CHANGED
|
@@ -33,10 +33,10 @@ interface LogoNavProps {
|
|
|
33
33
|
* Note: translation keys: `components.back-to-homepage-landmark`, ...
|
|
34
34
|
*/
|
|
35
35
|
logoLinkBehaviour?:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
| "no-link"
|
|
37
|
+
| "site-home"
|
|
38
|
+
| "main-site"
|
|
39
|
+
| "main-site-on-home";
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function LogoNav(props: LogoNavProps) {
|
|
@@ -67,8 +67,8 @@ function LogoNav(props: LogoNavProps) {
|
|
|
67
67
|
href = isRoot ? mainSite.url : urlHomepage[0] || "/";
|
|
68
68
|
landmark = isRoot
|
|
69
69
|
? t("components.back-to-main-site-landmark", {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
siteName: mainSite.name,
|
|
71
|
+
})
|
|
72
72
|
: t("components.back-to-homepage-landmark");
|
|
73
73
|
title = isRoot
|
|
74
74
|
? t("components.back-to-main-site", { siteName: mainSite.name })
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { type AlertProps, default as Alert } from "./alert/Alert";
|
|
|
3
3
|
export { type AlignBoxProps, default as AlignBox } from "./alignBox/AlignBox";
|
|
4
4
|
export { default as Article } from "./article/Article";
|
|
5
5
|
export { type BlockProps, default as Block } from "./block/Block";
|
|
6
|
+
export { default as Button } from "./button/Button";
|
|
6
7
|
export {
|
|
7
8
|
type CardAsLinksProps,
|
|
8
9
|
default as CardAsLink,
|
|
@@ -27,12 +28,15 @@ export {
|
|
|
27
28
|
type DataSummaryItemProps,
|
|
28
29
|
default as DataSummaryItem,
|
|
29
30
|
} from "./dataSummary/DataSummaryItem";
|
|
31
|
+
export { default as Fieldset } from "./fieldset/FieldSet";
|
|
30
32
|
export { default as Filters } from "./filters/Filters";
|
|
31
33
|
export {
|
|
32
34
|
type ColumnProps,
|
|
33
35
|
default as Footer,
|
|
34
36
|
type FooterProps,
|
|
35
37
|
} from "./footer/Footer";
|
|
38
|
+
export { default as FormFieldLabel } from "./formFieldLabel/FormFieldLabel";
|
|
39
|
+
export { default as FormFieldTextInput } from "./formFieldTextInput/FormFieldTextInput";
|
|
36
40
|
export { default as Header, type HeaderProps } from "./header/Header";
|
|
37
41
|
export { default as Heading } from "./heading/Heading";
|
|
38
42
|
export {
|
|
@@ -5,13 +5,17 @@ import {
|
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import styles from "./styles.module.css";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
interface ReadOnlyTextInputProps extends TextInputProps {
|
|
9
|
+
fontVariant?: "slashed-zero" | "monospace" | "normal";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const ReadOnlyTextInput = (props: ReadOnlyTextInputProps) => {
|
|
13
|
+
const { className, fontVariant = "normal", ...restProps } = props;
|
|
10
14
|
|
|
11
15
|
return (
|
|
12
16
|
<TextInput
|
|
13
17
|
readOnly
|
|
14
|
-
className={clsx(styles.input, className)}
|
|
18
|
+
className={clsx(styles.input, styles[fontVariant], className)}
|
|
15
19
|
{...restProps}
|
|
16
20
|
/>
|
|
17
21
|
);
|
|
@@ -4,3 +4,16 @@
|
|
|
4
4
|
/* field-sizing: content; */
|
|
5
5
|
inline-size: -webkit-fill-available;
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
.normal {
|
|
9
|
+
font-variant: normal;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.input.slashed-zero {
|
|
13
|
+
/* find a way to use RO font with slashed zero */
|
|
14
|
+
font-variant-numeric: slashed-zero;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.input.monospace {
|
|
18
|
+
font-family: monospace;
|
|
19
|
+
}
|
package/src/search/Search.tsx
CHANGED
|
@@ -42,7 +42,7 @@ export const processNavBarItems = (
|
|
|
42
42
|
): NavBarItemProps[] => {
|
|
43
43
|
return items.map((item) => ({
|
|
44
44
|
...item,
|
|
45
|
-
// TODO: remove current from this output
|
|
45
|
+
// TODO: remove current from this output. Issue #188
|
|
46
46
|
bold: item.current,
|
|
47
47
|
icon: processIcon(item.icon),
|
|
48
48
|
}));
|