@developer-overheid-nl/don-register-components 1.1.0 → 1.2.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/CHANGELOG.md +42 -0
- package/package.json +3 -3
- package/src/alignBox/AlignBox.tsx +3 -0
- package/src/alignBox/styles.module.css +4 -0
- package/src/amountLabel/AmountLabel.tsx +16 -0
- package/src/amountLabel/styles.module.css +11 -0
- package/src/analytics/PiwikPro.tsx +27 -5
- package/src/badgeList/BadgeList.tsx +26 -0
- package/src/badgeList/styles.module.css +24 -0
- package/src/client.ts +5 -0
- package/src/dataBadgeLink/DataBadgeLink.tsx +3 -0
- package/src/dataBadgeLink/styles.module.css +26 -0
- package/src/dataSummary/styles.module.css +10 -5
- package/src/facetFilters/FacetFilters.tsx +313 -0
- package/src/facetFilters/styles.module.css +3 -0
- package/src/formFieldCheckboxGroup/FormFieldCheckboxGroup.tsx +16 -0
- package/src/formFieldCheckboxGroup/styles.module.css +5 -0
- package/src/formFieldCheckboxOption/FormFieldCheckboxOption.tsx +26 -0
- package/src/formFieldCheckboxOption/styles.module.css +22 -0
- package/src/formFieldRadioGroup/FormFieldRadioGroup.tsx +13 -0
- package/src/formFieldRadioGroup/styles.module.css +5 -0
- package/src/formFieldRadioOption/FormFieldRadioOption.tsx +75 -0
- package/src/formFieldRadioOption/styles.module.css +49 -0
- package/src/formFieldSwitch/FormFieldSwitch.tsx +79 -0
- package/src/formFieldSwitch/styles.module.css +32 -0
- package/src/heading/Heading.tsx +5 -0
- package/src/iconBadge/IconBadge.tsx +3 -0
- package/src/iconBadge/getAppearance.ts +7 -1
- package/src/index.ts +27 -1
- package/src/infoButton/InfoButton.tsx +45 -0
- package/src/infoButton/styles.module.css +43 -0
- package/src/overlay/Overlay.tsx +18 -0
- package/src/overlay/styles.module.css +15 -0
- package/src/paragraph/Paragraph.tsx +16 -2
- package/src/paragraph/styles.module.css +6 -0
- package/src/pillBadge/styles.module.css +20 -0
- package/src/scoreBadge/ScoreBadge.tsx +1 -0
- package/src/switch/Switch.tsx +86 -0
- package/src/switch/styles.module.css +7 -0
- package/src/toolTip/ToolTip.tsx +55 -0
- package/src/toolTip/styles.module.css +48 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type FormFieldCheckboxGroupProps,
|
|
3
|
+
FormFieldCheckboxGroup as RHCFormFieldCheckboxGroup,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import styles from "./styles.module.css";
|
|
6
|
+
|
|
7
|
+
const FormFieldCheckboxGroup = (props: FormFieldCheckboxGroupProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<RHCFormFieldCheckboxGroup
|
|
10
|
+
className={styles.formFieldCheckboxGroup}
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default FormFieldCheckboxGroup;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormFieldCheckboxOption as RHCFormFieldCheckboxOption,
|
|
3
|
+
type FormFieldCheckboxOptionProps as RHCFormFieldCheckboxOptionProps,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import AmountLabel, { type AmountLabelProps } from "../amountLabel/AmountLabel";
|
|
7
|
+
import styles from "./styles.module.css";
|
|
8
|
+
|
|
9
|
+
export interface FormFieldCheckboxOptionProps
|
|
10
|
+
extends Omit<RHCFormFieldCheckboxOptionProps, "label">,
|
|
11
|
+
AmountLabelProps {}
|
|
12
|
+
|
|
13
|
+
const FormFieldCheckboxOption = (props: FormFieldCheckboxOptionProps) => {
|
|
14
|
+
const { amount, label, className, children, ...restProps } = props;
|
|
15
|
+
return (
|
|
16
|
+
<RHCFormFieldCheckboxOption
|
|
17
|
+
className={clsx(styles.checkbox, className)}
|
|
18
|
+
label={<AmountLabel label={label} amount={amount} />}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
<span className={styles.info}>{children}</span>
|
|
22
|
+
</RHCFormFieldCheckboxOption>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default FormFieldCheckboxOption;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.checkbox.checkbox {
|
|
2
|
+
--utrecht-form-field-label-margin-block-end: 0;
|
|
3
|
+
|
|
4
|
+
grid-template-areas:
|
|
5
|
+
'input label info'
|
|
6
|
+
'input description description'
|
|
7
|
+
'input error-message error-message'
|
|
8
|
+
'input status status';
|
|
9
|
+
|
|
10
|
+
:global(.utrecht-form-label) {
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:global(.utrecht-checkbox) {
|
|
15
|
+
order: initial;
|
|
16
|
+
margin-block-start: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.info {
|
|
21
|
+
grid-area: info;
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type FormFieldRadioGroupProps,
|
|
3
|
+
FormFieldRadioGroup as RHCFormFieldRadioGroup,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import styles from "./styles.module.css";
|
|
6
|
+
|
|
7
|
+
const FormFieldRadioGroup = (props: FormFieldRadioGroupProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<RHCFormFieldRadioGroup className={styles.formFieldRadioGroup} {...props} />
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default FormFieldRadioGroup;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CustomFormFieldProps,
|
|
3
|
+
FormField,
|
|
4
|
+
Radio as RHCRadio,
|
|
5
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { Fragment, useId } from "react";
|
|
8
|
+
import AmountLabel, { type AmountLabelProps } from "../amountLabel/AmountLabel";
|
|
9
|
+
import styles from "./styles.module.css";
|
|
10
|
+
|
|
11
|
+
export interface FormFieldRadioOptionProps
|
|
12
|
+
extends Omit<
|
|
13
|
+
CustomFormFieldProps,
|
|
14
|
+
"label" | "statusId" | "errorMessageId" | "descriptionId" | "input"
|
|
15
|
+
>,
|
|
16
|
+
AmountLabelProps {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
statusId?: CustomFormFieldProps["statusId"];
|
|
22
|
+
errorMessageId?: CustomFormFieldProps["errorMessageId"];
|
|
23
|
+
descriptionId?: CustomFormFieldProps["descriptionId"];
|
|
24
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const FormFieldRadioOption = (props: FormFieldRadioOptionProps) => {
|
|
28
|
+
const genId = useId();
|
|
29
|
+
const {
|
|
30
|
+
id = genId,
|
|
31
|
+
statusId = genId,
|
|
32
|
+
errorMessageId = genId,
|
|
33
|
+
descriptionId = genId,
|
|
34
|
+
name,
|
|
35
|
+
value,
|
|
36
|
+
defaultChecked,
|
|
37
|
+
checked,
|
|
38
|
+
amount,
|
|
39
|
+
label,
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
onChange,
|
|
43
|
+
...restProps
|
|
44
|
+
} = props;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<FormField
|
|
48
|
+
type="radio" // although not exposed by RHC
|
|
49
|
+
className={clsx("utrecht-form-field--radio", styles.radio, className)}
|
|
50
|
+
statusId={statusId}
|
|
51
|
+
errorMessageId={errorMessageId}
|
|
52
|
+
descriptionId={descriptionId}
|
|
53
|
+
label={
|
|
54
|
+
<Fragment>
|
|
55
|
+
<RHCRadio
|
|
56
|
+
id={id}
|
|
57
|
+
name={name}
|
|
58
|
+
value={value}
|
|
59
|
+
checked={checked}
|
|
60
|
+
defaultChecked={defaultChecked}
|
|
61
|
+
className="utrecht-checkbox--custom utrecht-form-field__input"
|
|
62
|
+
onChange={onChange}
|
|
63
|
+
/>
|
|
64
|
+
<AmountLabel label={label} amount={amount} />
|
|
65
|
+
</Fragment>
|
|
66
|
+
}
|
|
67
|
+
input={null}
|
|
68
|
+
{...restProps}
|
|
69
|
+
>
|
|
70
|
+
<span className={styles.info}>{children}</span>
|
|
71
|
+
</FormField>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default FormFieldRadioOption;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.radio.radio {
|
|
2
|
+
--utrecht-form-field-label-margin-block-end: 0;
|
|
3
|
+
|
|
4
|
+
grid-template-areas:
|
|
5
|
+
'input label info'
|
|
6
|
+
'input description description'
|
|
7
|
+
'input error-message error-message'
|
|
8
|
+
'input status status';
|
|
9
|
+
|
|
10
|
+
:global(.utrecht-form-field--radio .utrecht-form-field__label) {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:global(.utrecht-form-label) {
|
|
15
|
+
/* like checkbox */
|
|
16
|
+
display: flex;
|
|
17
|
+
font-weight: var(
|
|
18
|
+
--utrecht-form-label-checkbox-font-weight,
|
|
19
|
+
var(--utrecht-form-label-font-weight)
|
|
20
|
+
);
|
|
21
|
+
color: var(
|
|
22
|
+
--utrecht-form-label-checkbox-color,
|
|
23
|
+
var(--utrecht-form-label-color)
|
|
24
|
+
);
|
|
25
|
+
cursor: var(--utrecht-action-activate-cursor, revert);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:global(.utrecht-radio-button) {
|
|
29
|
+
order: initial;
|
|
30
|
+
margin-block-start: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:global(
|
|
34
|
+
.utrecht-form-field--radio
|
|
35
|
+
.utrecht-form-field__label:has(.utrecht-form-field__input)
|
|
36
|
+
) {
|
|
37
|
+
margin-inline-start: calc(
|
|
38
|
+
-1 *
|
|
39
|
+
(
|
|
40
|
+
var(--utrecht-radio-button-size) +
|
|
41
|
+
var(--utrecht-checkbox-margin-inline-end, 12px)
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.info {
|
|
48
|
+
grid-area: info;
|
|
49
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CustomFormFieldProps,
|
|
3
|
+
FormField,
|
|
4
|
+
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { useId } from "react";
|
|
7
|
+
import AmountLabel, { type AmountLabelProps } from "../amountLabel/AmountLabel";
|
|
8
|
+
import Switch, { type SwitchLabels } from "../switch/Switch";
|
|
9
|
+
import styles from "./styles.module.css";
|
|
10
|
+
|
|
11
|
+
export interface FormFieldSwitchProps
|
|
12
|
+
extends Omit<
|
|
13
|
+
CustomFormFieldProps,
|
|
14
|
+
"label" | "statusId" | "errorMessageId" | "descriptionId" | "input"
|
|
15
|
+
>,
|
|
16
|
+
AmountLabelProps {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
defaultChecked?: boolean;
|
|
21
|
+
statusId?: CustomFormFieldProps["statusId"];
|
|
22
|
+
errorMessageId?: CustomFormFieldProps["errorMessageId"];
|
|
23
|
+
descriptionId?: CustomFormFieldProps["descriptionId"];
|
|
24
|
+
labelledById?: string;
|
|
25
|
+
labels?: SwitchLabels;
|
|
26
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const FormFieldSwitch = (props: FormFieldSwitchProps) => {
|
|
30
|
+
const genId = useId();
|
|
31
|
+
const {
|
|
32
|
+
id = genId,
|
|
33
|
+
statusId = genId,
|
|
34
|
+
errorMessageId = genId,
|
|
35
|
+
descriptionId = genId,
|
|
36
|
+
labelledById,
|
|
37
|
+
name,
|
|
38
|
+
value,
|
|
39
|
+
defaultChecked,
|
|
40
|
+
checked,
|
|
41
|
+
amount,
|
|
42
|
+
label,
|
|
43
|
+
labels,
|
|
44
|
+
onChange,
|
|
45
|
+
className,
|
|
46
|
+
children,
|
|
47
|
+
...restProps
|
|
48
|
+
} = props;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<FormField
|
|
52
|
+
id={id}
|
|
53
|
+
type="checkbox"
|
|
54
|
+
className={clsx("utrecht-form-field--checkbox", styles.switch, className)}
|
|
55
|
+
statusId={statusId}
|
|
56
|
+
errorMessageId={errorMessageId}
|
|
57
|
+
descriptionId={descriptionId}
|
|
58
|
+
label={<AmountLabel label={label} amount={amount} />}
|
|
59
|
+
input={
|
|
60
|
+
<Switch
|
|
61
|
+
id={id}
|
|
62
|
+
name={name}
|
|
63
|
+
value={value}
|
|
64
|
+
checked={checked}
|
|
65
|
+
defaultChecked={defaultChecked}
|
|
66
|
+
className="utrecht-form-field__input"
|
|
67
|
+
labels={labels}
|
|
68
|
+
aria-labelledby={`${labelledById} ${id}`}
|
|
69
|
+
onChange={onChange}
|
|
70
|
+
/>
|
|
71
|
+
}
|
|
72
|
+
{...restProps}
|
|
73
|
+
>
|
|
74
|
+
<span className={styles.info}>{children}</span>
|
|
75
|
+
</FormField>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default FormFieldSwitch;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.switch.switch {
|
|
2
|
+
--utrecht-form-field-label-margin-block-end: 0;
|
|
3
|
+
--utrecht-checkbox-size: var(--utrecht-form-toggle-width);
|
|
4
|
+
|
|
5
|
+
grid-template-areas:
|
|
6
|
+
'input label info'
|
|
7
|
+
'input description description'
|
|
8
|
+
'input error-message error-message'
|
|
9
|
+
'input status status';
|
|
10
|
+
|
|
11
|
+
:global(.utrecht-form-field--radio .utrecht-form-field__label) {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:global(.utrecht-form-label) {
|
|
16
|
+
/* like checkbox */
|
|
17
|
+
display: flex;
|
|
18
|
+
font-weight: var(
|
|
19
|
+
--utrecht-form-label-checkbox-font-weight,
|
|
20
|
+
var(--utrecht-form-label-font-weight)
|
|
21
|
+
);
|
|
22
|
+
color: var(
|
|
23
|
+
--utrecht-form-label-checkbox-color,
|
|
24
|
+
var(--utrecht-form-label-color)
|
|
25
|
+
);
|
|
26
|
+
cursor: var(--utrecht-action-activate-cursor, revert);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.info {
|
|
31
|
+
grid-area: info;
|
|
32
|
+
}
|
package/src/heading/Heading.tsx
CHANGED
|
@@ -3,6 +3,11 @@ import {
|
|
|
3
3
|
Heading as RHCHeading,
|
|
4
4
|
} from "@rijkshuisstijl-community/components-react";
|
|
5
5
|
|
|
6
|
+
export type { HeadingProps } from "@rijkshuisstijl-community/components-react";
|
|
7
|
+
|
|
8
|
+
export const clampHeadingLevel = (headingLevel: number) =>
|
|
9
|
+
Math.max(1, Math.min(headingLevel + 1, 5)) as HeadingProps["level"];
|
|
10
|
+
|
|
6
11
|
const Heading = (props: HeadingProps) => {
|
|
7
12
|
return <RHCHeading {...props} />;
|
|
8
13
|
};
|
|
@@ -8,6 +8,9 @@ export interface IconBadgeProps extends HTMLProps<HTMLSpanElement> {
|
|
|
8
8
|
appearance?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated API Register specific component (and not used anymore)
|
|
13
|
+
*/
|
|
11
14
|
export default function IconBadge(props: IconBadgeProps) {
|
|
12
15
|
const { className, name, appearance, ...restProps } = props;
|
|
13
16
|
const iconClassName = `don-icon don-icon-${name} ${className || ""}`.trim();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
/* biome-ignore-all lint:
|
|
1
|
+
/* biome-ignore-all lint: is deprecated and refactored */
|
|
2
2
|
type status = "active" | "deprecated" | "sunset" | "retired";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated API Register specific function (moved and refactored to `apps/api-register/src/components/`)
|
|
6
|
+
*/
|
|
4
7
|
export function getDate(object?: Partial<Record<"status" | status, any>>) {
|
|
5
8
|
if (!object) return;
|
|
6
9
|
|
|
@@ -24,6 +27,9 @@ export function getDate(object?: Partial<Record<"status" | status, any>>) {
|
|
|
24
27
|
);
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated API Register specific function (moved and refactored to `apps/api-register/src/components/`)
|
|
32
|
+
*/
|
|
27
33
|
export default function getAppearance(
|
|
28
34
|
object?: Partial<Record<"status" | status, any>>,
|
|
29
35
|
) {
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
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
|
+
export {
|
|
6
|
+
type BadgeListProps,
|
|
7
|
+
default as BadgeList,
|
|
8
|
+
} from "./badgeList/BadgeList";
|
|
5
9
|
export { type BlockProps, default as Block } from "./block/Block";
|
|
6
10
|
export { default as Button } from "./button/Button";
|
|
7
11
|
export {
|
|
@@ -28,6 +32,12 @@ export {
|
|
|
28
32
|
type DataSummaryItemProps,
|
|
29
33
|
default as DataSummaryItem,
|
|
30
34
|
} from "./dataSummary/DataSummaryItem";
|
|
35
|
+
export {
|
|
36
|
+
default as FacetFilters,
|
|
37
|
+
type FacetFiltersProps,
|
|
38
|
+
type FilterData,
|
|
39
|
+
getSelectedFilters,
|
|
40
|
+
} from "./facetFilters/FacetFilters";
|
|
31
41
|
export { default as Fieldset } from "./fieldset/FieldSet";
|
|
32
42
|
export { default as Filters } from "./filters/Filters";
|
|
33
43
|
export {
|
|
@@ -35,10 +45,19 @@ export {
|
|
|
35
45
|
default as Footer,
|
|
36
46
|
type FooterProps,
|
|
37
47
|
} from "./footer/Footer";
|
|
48
|
+
export { default as FormFieldCheckboxGroup } from "./formFieldCheckboxGroup/FormFieldCheckboxGroup";
|
|
49
|
+
export { default as FormFieldCheckboxOption } from "./formFieldCheckboxOption/FormFieldCheckboxOption";
|
|
38
50
|
export { default as FormFieldLabel } from "./formFieldLabel/FormFieldLabel";
|
|
51
|
+
export { default as FormFieldRadioGroup } from "./formFieldRadioGroup/FormFieldRadioGroup";
|
|
52
|
+
export { default as FormFieldRadioOption } from "./formFieldRadioOption/FormFieldRadioOption";
|
|
53
|
+
export { default as FormFieldSwitch } from "./formFieldSwitch/FormFieldSwitch";
|
|
39
54
|
export { default as FormFieldTextInput } from "./formFieldTextInput/FormFieldTextInput";
|
|
40
55
|
export { default as Header, type HeaderProps } from "./header/Header";
|
|
41
|
-
export {
|
|
56
|
+
export {
|
|
57
|
+
clampHeadingLevel,
|
|
58
|
+
default as Heading,
|
|
59
|
+
type HeadingProps,
|
|
60
|
+
} from "./heading/Heading";
|
|
42
61
|
export {
|
|
43
62
|
default as HeadingGroup,
|
|
44
63
|
type HeadingGroupProps,
|
|
@@ -50,12 +69,17 @@ export {
|
|
|
50
69
|
} from "./iconBadge/IconBadge";
|
|
51
70
|
export { default as Icon } from "./iconsSprite/Icon";
|
|
52
71
|
export { default as IconsSprite } from "./iconsSprite/IconsSprite";
|
|
72
|
+
export {
|
|
73
|
+
default as InfoButton,
|
|
74
|
+
type InfoButtonProps,
|
|
75
|
+
} from "./infoButton/InfoButton";
|
|
53
76
|
export { default as Link } from "./link/Link";
|
|
54
77
|
export {
|
|
55
78
|
default as Markdown,
|
|
56
79
|
type HeadingLevels,
|
|
57
80
|
type MarkdownProps,
|
|
58
81
|
} from "./markdown/Markdown";
|
|
82
|
+
export { default as Overlay } from "./overlay/Overlay";
|
|
59
83
|
export {
|
|
60
84
|
default as Pagination,
|
|
61
85
|
type PaginationProps,
|
|
@@ -72,6 +96,8 @@ export {
|
|
|
72
96
|
} from "./scoreBadge/ScoreBadge";
|
|
73
97
|
export { default as Search, type SearchProps } from "./search/Search";
|
|
74
98
|
export { default as SiteLogo } from "./siteLogo/SiteLogo";
|
|
99
|
+
export { default as Switch, type SwitchProps } from "./switch/Switch";
|
|
100
|
+
export { default as ToolTip } from "./toolTip/ToolTip";
|
|
75
101
|
export {
|
|
76
102
|
default as TopNavigation,
|
|
77
103
|
type NavBarItem,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import type { ButtonHTMLAttributes, HTMLProps } from "react";
|
|
3
|
+
import Icon from "../iconsSprite/Icon";
|
|
4
|
+
import styles from "./styles.module.css";
|
|
5
|
+
|
|
6
|
+
export interface InfoButtonProps extends HTMLProps<HTMLButtonElement> {
|
|
7
|
+
iconSize?: "small" | "default" | "large";
|
|
8
|
+
iconColor?: "default" | "current";
|
|
9
|
+
type?: ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
|
10
|
+
commandfor?: string;
|
|
11
|
+
command?:
|
|
12
|
+
| "show-modal"
|
|
13
|
+
| "close"
|
|
14
|
+
| "request-close"
|
|
15
|
+
| "show-popover"
|
|
16
|
+
| "hide-popover"
|
|
17
|
+
| "toggle-popover"
|
|
18
|
+
| `--${string}`;
|
|
19
|
+
interestfor?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const InfoButton = (props: InfoButtonProps) => {
|
|
23
|
+
const {
|
|
24
|
+
iconSize = "default",
|
|
25
|
+
iconColor = "default",
|
|
26
|
+
type = "button",
|
|
27
|
+
...restProps
|
|
28
|
+
} = props;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<button
|
|
32
|
+
className={clsx(
|
|
33
|
+
styles.infoButton,
|
|
34
|
+
styles[`${iconSize}Size`],
|
|
35
|
+
styles[`${iconColor}Color`],
|
|
36
|
+
)}
|
|
37
|
+
type={type}
|
|
38
|
+
{...restProps}
|
|
39
|
+
>
|
|
40
|
+
<Icon name="info" />
|
|
41
|
+
</button>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default InfoButton;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--don-info-button-color: var(--rhc-color-hemelblauw-500);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.infoButton {
|
|
6
|
+
display: grid;
|
|
7
|
+
place-content: center;
|
|
8
|
+
padding: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
appearance: none;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
background: none;
|
|
13
|
+
border: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.defaultColor {
|
|
17
|
+
color: var(--don-info-button-color, currentColor);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.currentColor {
|
|
21
|
+
color: currentColor;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.smallSize {
|
|
25
|
+
svg {
|
|
26
|
+
width: 1rem;
|
|
27
|
+
height: 1rem;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.defaultSize {
|
|
32
|
+
svg {
|
|
33
|
+
width: 1.5rem;
|
|
34
|
+
height: 1.5rem;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.largeSize {
|
|
39
|
+
svg {
|
|
40
|
+
width: 2rem;
|
|
41
|
+
height: 2rem;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +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,10 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type ParagraphProps,
|
|
3
2
|
Paragraph as RHCParagraph,
|
|
3
|
+
type ParagraphProps as RHCParagraphProps,
|
|
4
4
|
} from "@rijkshuisstijl-community/components-react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import styles from "./styles.module.css";
|
|
7
|
+
|
|
8
|
+
interface ParagraphProps extends RHCParagraphProps {
|
|
9
|
+
purpose?: "lead" | "short";
|
|
10
|
+
}
|
|
5
11
|
|
|
6
12
|
const Paragraph = (props: ParagraphProps) => {
|
|
7
|
-
|
|
13
|
+
const { className, purpose } = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<RHCParagraph
|
|
17
|
+
className={clsx(className, purpose === "short" && styles.short)}
|
|
18
|
+
purpose={purpose}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
8
22
|
};
|
|
9
23
|
|
|
10
24
|
export default Paragraph;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
rgba(51, 51, 51, 0.25),
|
|
15
15
|
rgba(204, 204, 204, 0.25)
|
|
16
16
|
);
|
|
17
|
+
--don-pill-badge-outline-hover-color: var(--rhc-color-cool-grey-300);
|
|
17
18
|
--don-pill-badge-border-width: 1px;
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -33,6 +34,25 @@
|
|
|
33
34
|
background-color: var(--don-pill-badge-background-color);
|
|
34
35
|
border-radius: var(--don-pill-badge-border-radius);
|
|
35
36
|
|
|
37
|
+
a:any-link:has(&) {
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
outline-width: 2px;
|
|
42
|
+
outline-style: auto;
|
|
43
|
+
outline-color: var(--don-pill-badge-outline-hover-color);
|
|
44
|
+
outline-offset: 0.125rem;
|
|
45
|
+
border-radius: var(--don-pill-badge-border-radius);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus,
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
outline-style: auto;
|
|
51
|
+
outline-offset: 0.125rem;
|
|
52
|
+
border-radius: var(--don-pill-badge-border-radius);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
36
56
|
/* Because Biome CSS parser does not yet support modern attr() some of the following is commented out.
|
|
37
57
|
* Fixme: remove this workaround when https://github.com/biomejs/biome/issues/6183 is closed and tested */
|
|
38
58
|
|