@utrecht/form-field-css 1.0.0 → 1.1.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/dist/index.css +110 -0
- package/dist/index.js +1 -0
- package/package.json +11 -4
- package/src/_mixin.scss +146 -0
- package/src/index.scss +54 -0
- package/src/stories/_email.md +4 -0
- package/src/stories/_new-password.md +6 -0
- package/src/stories/_tel.md +4 -0
- package/src/stories/checkbox-group.stories.mdx +215 -0
- package/src/stories/checkbox.stories.mdx +136 -0
- package/src/stories/example.stories.mdx +292 -0
- package/src/stories/radio-group.stories.mdx +162 -0
- package/src/stories/readme.stories.mdx +6 -0
- package/src/stories/rtl.stories.mdx +404 -0
- package/src/stories/textbox.stories.mdx +128 -0
- package/src/stories/voorvoegsels-tabel-36.json +335 -0
- package/src/story-template.jsx +352 -0
- package/src/tokens.json +68 -0
package/dist/index.css
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @license EUPL-1.2
|
|
7
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
8
|
+
*/
|
|
9
|
+
/* stylelint-disable-next-line block-no-empty */
|
|
10
|
+
.utrecht-form-field {
|
|
11
|
+
break-inside: avoid;
|
|
12
|
+
font-family: var(--utrecht-document-font-family, inherit);
|
|
13
|
+
margin-block-end: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-end, 0));
|
|
14
|
+
margin-block-start: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-start, 0));
|
|
15
|
+
max-inline-size: var(--utrecht-form-field-max-inline-size);
|
|
16
|
+
page-break-inside: avoid;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.utrecht-form-field--distanced {
|
|
20
|
+
--utrecht-space-around: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.utrecht-form-field--invalid {
|
|
24
|
+
border-inline-start-color: var(--utrecht-form-field-invalid-border-inline-start-color);
|
|
25
|
+
border-inline-start-style: solid;
|
|
26
|
+
border-inline-start-width: var(--utrecht-form-field-invalid-border-inline-start-width, 0);
|
|
27
|
+
padding-inline-start: var(--utrecht-form-field-invalid-padding-inline-start);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.utrecht-form-field--checkbox {
|
|
31
|
+
display: grid;
|
|
32
|
+
gap: 0 var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
33
|
+
grid-template-areas: "input label" "input description" "input description-invalid";
|
|
34
|
+
grid-template-columns: var(--utrecht-checkbox-size) 100fr;
|
|
35
|
+
/*
|
|
36
|
+
.utrecht-form-field__label .utrecht-form-field__input {
|
|
37
|
+
margin-inline-start: calc(
|
|
38
|
+
-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))
|
|
39
|
+
);
|
|
40
|
+
margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
41
|
+
}
|
|
42
|
+
*/
|
|
43
|
+
}
|
|
44
|
+
.utrecht-form-field--checkbox .utrecht-form-field__label:has(.utrecht-form-field__input) {
|
|
45
|
+
margin-inline-start: calc(-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px)));
|
|
46
|
+
}
|
|
47
|
+
.utrecht-form-field--checkbox .utrecht-form-field__label .utrecht-form-field__input {
|
|
48
|
+
margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.utrecht-form-field--radio {
|
|
52
|
+
display: grid;
|
|
53
|
+
gap: 0 var(--utrecht-radio-button-margin-inline-end, 12px);
|
|
54
|
+
grid-template-areas: "input label" "input description" "input description-invalid";
|
|
55
|
+
grid-template-columns: var(--utrecht-radio-button-size) 100fr;
|
|
56
|
+
/*
|
|
57
|
+
.utrecht-form-field__label .utrecht-form-field__input {
|
|
58
|
+
margin-inline-start: calc(
|
|
59
|
+
-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))
|
|
60
|
+
);
|
|
61
|
+
margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
62
|
+
}
|
|
63
|
+
*/
|
|
64
|
+
}
|
|
65
|
+
.utrecht-form-field--radio .utrecht-form-field__label:has(.utrecht-form-field__input) {
|
|
66
|
+
margin-inline-start: calc(-1 * (var(--utrecht-radio-button-size) + var(--utrecht-radio-button-margin-inline-end, 12px)));
|
|
67
|
+
}
|
|
68
|
+
.utrecht-form-field--radio .utrecht-form-field__label .utrecht-form-field__input {
|
|
69
|
+
margin-inline-end: var(--utrecht-radio-button-margin-inline-end, 12px);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.utrecht-form-field__input {
|
|
73
|
+
margin-block-end: 0;
|
|
74
|
+
margin-block-start: 0;
|
|
75
|
+
grid-area: input;
|
|
76
|
+
order: 5;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.utrecht-form-field__label {
|
|
80
|
+
/* Assign the margin-block-end to padding instead, so the clickable area of the label increases
|
|
81
|
+
and we avoid a small gap between the label and input that cannot be clicked to focus the input. */
|
|
82
|
+
grid-area: label;
|
|
83
|
+
margin-block-end: var(--utrecht-form-field-label-margin-block-end);
|
|
84
|
+
margin-block-start: 0;
|
|
85
|
+
order: 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.utrecht-form-field .utrecht-form-field-description {
|
|
89
|
+
grid-area: description;
|
|
90
|
+
margin-block-end: var(--utrecht-form-field-description-margin-block-end);
|
|
91
|
+
margin-block-start: var(--utrecht-form-field-description-margin-block-start);
|
|
92
|
+
order: 2;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.utrecht-form-field .utrecht-form-field-description--invalid {
|
|
96
|
+
grid-area: description-invalid;
|
|
97
|
+
order: 3;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.utrecht-form-field__description {
|
|
101
|
+
grid-area: description;
|
|
102
|
+
margin-block-end: var(--utrecht-form-field-description-margin-block-end);
|
|
103
|
+
margin-block-start: var(--utrecht-form-field-description-margin-block-start);
|
|
104
|
+
order: 2;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.utrecht-form-field__description--before {
|
|
108
|
+
grid-area: description-before;
|
|
109
|
+
order: 4;
|
|
110
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var undefined$1 = undefined;export{undefined$1 as default};
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.1.0",
|
|
3
3
|
"author": "Community for NL Design System",
|
|
4
4
|
"description": "Form field component for the Municipality of Utrecht based on the NL Design System architecture",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
6
|
"name": "@utrecht/form-field-css",
|
|
7
7
|
"files": [
|
|
8
|
-
"dist/"
|
|
8
|
+
"dist/",
|
|
9
|
+
"src/"
|
|
9
10
|
],
|
|
10
|
-
"
|
|
11
|
+
"main": "dist/index.css",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"rollup": "3.29.4"
|
|
14
|
+
},
|
|
11
15
|
"keywords": [
|
|
12
16
|
"nl-design-system"
|
|
13
17
|
],
|
|
14
18
|
"publishConfig": {
|
|
15
19
|
"access": "public"
|
|
16
20
|
},
|
|
17
|
-
"scripts": {
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rollup -c ../rollup.config.mjs",
|
|
23
|
+
"clean": "rimraf dist"
|
|
24
|
+
}
|
|
18
25
|
}
|
package/src/_mixin.scss
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@mixin reset-p {
|
|
7
|
+
margin-block-end: 0;
|
|
8
|
+
margin-block-start: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin utrecht-form-field {
|
|
12
|
+
break-inside: avoid;
|
|
13
|
+
font-family: var(--utrecht-document-font-family, inherit);
|
|
14
|
+
margin-block-end: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-end, 0));
|
|
15
|
+
margin-block-start: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-start, 0));
|
|
16
|
+
max-inline-size: var(--utrecht-form-field-max-inline-size);
|
|
17
|
+
page-break-inside: avoid;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin utrecht-form-field--distanced {
|
|
21
|
+
--utrecht-space-around: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* stylelint-disable-next-line block-no-empty */
|
|
25
|
+
@mixin utrecht-form-field--text {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin utrecht-form-field--text-flex {
|
|
29
|
+
--utrecht-space-around: 0;
|
|
30
|
+
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin utrecht-form-field--text-grid {
|
|
36
|
+
--utrecht-space-around: 0;
|
|
37
|
+
|
|
38
|
+
display: grid;
|
|
39
|
+
grid-template-areas: "label" "description" "description-before" "description-invalid" "input" "description-after";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin utrecht-form-field--option {
|
|
43
|
+
display: grid;
|
|
44
|
+
font-family: var(--utrecht-document-font-family, inherit);
|
|
45
|
+
gap: 0 var(--utrecht-space-inline-sm);
|
|
46
|
+
grid-template-areas: "input label" ". description";
|
|
47
|
+
grid-template-columns: auto 1fr;
|
|
48
|
+
grid-template-rows: auto;
|
|
49
|
+
margin-block-end: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-end, 0));
|
|
50
|
+
margin-block-start: calc(var(--utrecht-space-around, 0) * var(--utrecht-form-field-margin-block-start, 0));
|
|
51
|
+
max-inline-size: var(--utrecht-form-field-max-inline-size);
|
|
52
|
+
page-break-inside: avoid;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin utrecht-form-field--invalid {
|
|
56
|
+
border-inline-start-color: var(--utrecht-form-field-invalid-border-inline-start-color);
|
|
57
|
+
border-inline-start-style: solid;
|
|
58
|
+
border-inline-start-width: var(--utrecht-form-field-invalid-border-inline-start-width, 0);
|
|
59
|
+
padding-inline-start: var(--utrecht-form-field-invalid-padding-inline-start);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@mixin utrecht-form-field__input {
|
|
63
|
+
@include reset-p;
|
|
64
|
+
|
|
65
|
+
grid-area: input;
|
|
66
|
+
order: 5;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@mixin utrecht-form-field__label {
|
|
70
|
+
/* Assign the margin-block-end to padding instead, so the clickable area of the label increases
|
|
71
|
+
and we avoid a small gap between the label and input that cannot be clicked to focus the input. */
|
|
72
|
+
grid-area: label;
|
|
73
|
+
margin-block-end: var(--utrecht-form-field-label-margin-block-end);
|
|
74
|
+
|
|
75
|
+
// padding-block-end: var(--utrecht-form-field-label-margin-block-end);
|
|
76
|
+
margin-block-start: 0;
|
|
77
|
+
order: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@mixin utrecht-form-field__description {
|
|
81
|
+
grid-area: description;
|
|
82
|
+
margin-block-end: var(--utrecht-form-field-description-margin-block-end);
|
|
83
|
+
margin-block-start: var(--utrecht-form-field-description-margin-block-start);
|
|
84
|
+
order: 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@mixin utrecht-form-field__description--invalid {
|
|
88
|
+
grid-area: description-invalid;
|
|
89
|
+
order: 3;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@mixin utrecht-form-field__description--after {
|
|
93
|
+
grid-area: description-after;
|
|
94
|
+
order: 6;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@mixin utrecht-form-field__description--before {
|
|
98
|
+
grid-area: description-before;
|
|
99
|
+
order: 4;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@mixin utrecht-form-field--checkbox {
|
|
103
|
+
display: grid;
|
|
104
|
+
gap: 0 var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
105
|
+
grid-template-areas: "input label" "input description" "input description-invalid";
|
|
106
|
+
grid-template-columns: var(--utrecht-checkbox-size) 100fr;
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
.utrecht-form-field__label .utrecht-form-field__input {
|
|
110
|
+
margin-inline-start: calc(
|
|
111
|
+
-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))
|
|
112
|
+
);
|
|
113
|
+
margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
114
|
+
}
|
|
115
|
+
*/
|
|
116
|
+
.utrecht-form-field__label:has(.utrecht-form-field__input) {
|
|
117
|
+
margin-inline-start: calc(-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px)));
|
|
118
|
+
}
|
|
119
|
+
.utrecht-form-field__label .utrecht-form-field__input {
|
|
120
|
+
margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@mixin utrecht-form-field--radio {
|
|
125
|
+
display: grid;
|
|
126
|
+
gap: 0 var(--utrecht-radio-button-margin-inline-end, 12px);
|
|
127
|
+
grid-template-areas: "input label" "input description" "input description-invalid";
|
|
128
|
+
grid-template-columns: var(--utrecht-radio-button-size) 100fr;
|
|
129
|
+
|
|
130
|
+
/*
|
|
131
|
+
.utrecht-form-field__label .utrecht-form-field__input {
|
|
132
|
+
margin-inline-start: calc(
|
|
133
|
+
-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))
|
|
134
|
+
);
|
|
135
|
+
margin-inline-end: var(--utrecht-checkbox-margin-inline-end, 12px);
|
|
136
|
+
}
|
|
137
|
+
*/
|
|
138
|
+
.utrecht-form-field__label:has(.utrecht-form-field__input) {
|
|
139
|
+
margin-inline-start: calc(
|
|
140
|
+
-1 * (var(--utrecht-radio-button-size) + var(--utrecht-radio-button-margin-inline-end, 12px))
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
.utrecht-form-field__label .utrecht-form-field__input {
|
|
144
|
+
margin-inline-end: var(--utrecht-radio-button-margin-inline-end, 12px);
|
|
145
|
+
}
|
|
146
|
+
}
|
package/src/index.scss
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license EUPL-1.2
|
|
3
|
+
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@import "./mixin";
|
|
7
|
+
|
|
8
|
+
.utrecht-form-field {
|
|
9
|
+
@include utrecht-form-field;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.utrecht-form-field--distanced {
|
|
13
|
+
@include utrecht-form-field--distanced;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.utrecht-form-field--invalid {
|
|
17
|
+
@include utrecht-form-field--invalid;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.utrecht-form-field--text {
|
|
21
|
+
@include utrecht-form-field--text;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.utrecht-form-field--checkbox {
|
|
25
|
+
@include utrecht-form-field--checkbox;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.utrecht-form-field--radio {
|
|
29
|
+
@include utrecht-form-field--radio;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.utrecht-form-field__input {
|
|
33
|
+
@include utrecht-form-field__input;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.utrecht-form-field__label {
|
|
37
|
+
@include utrecht-form-field__label;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.utrecht-form-field .utrecht-form-field-description {
|
|
41
|
+
@include utrecht-form-field__description;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.utrecht-form-field .utrecht-form-field-description--invalid {
|
|
45
|
+
@include utrecht-form-field__description--invalid;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.utrecht-form-field__description {
|
|
49
|
+
@include utrecht-form-field__description;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.utrecht-form-field__description--before {
|
|
53
|
+
@include utrecht-form-field__description--before;
|
|
54
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<!-- @license CC0-1.0 -->
|
|
2
|
+
<!-- markdownlint-disable MD041 -->
|
|
3
|
+
|
|
4
|
+
Gebruik voor een nieuw wachtwoord `autocomplete="new-password"`.
|
|
5
|
+
|
|
6
|
+
Gebruik voor een wachtwoord geen `maxlength` attribuut in HTML omdat het problemen veroorzaakt als het niet duidelijk dat een gekozen wachtwoord te lang is. Gebruik een melding wanneer het ingevulde wachtwoord te lang is. Als een gebruiker een wachtwoord plakt of een _password manager_ een wachtwoord invult invult dat langer is dan `maxlength` dan kan het laatste gedeelte ongemerkt ontbreken. Ongemerkt wordt dan een korter wachtwoord opgeslagen, daarna kan de gebruiker niet inloggen met het gekozen wachtwoord.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<!-- @license CC0-1.0 -->
|
|
2
|
+
<!-- markdownlint-disable MD041 -->
|
|
3
|
+
|
|
4
|
+
Als je vraagt om het telefoonnumer van een persoon, leg dan uit waar het voor gebruikt zal worden. Niet alle gebruikers kunnen de telefoon beantwoorden, voor deze gebruikers is e-mail vaak een goed alternatief.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{/* @license CC0-1.0 */}
|
|
2
|
+
|
|
3
|
+
import { Canvas, Meta, Story } from "@storybook/blocks";
|
|
4
|
+
import { argTypes, defaultArgs, exampleArgs, FormFieldCheckboxGroup } from "../story-template";
|
|
5
|
+
import "../../../checkbox/src/index.scss";
|
|
6
|
+
import "../../../form-label/src/index.scss";
|
|
7
|
+
import "../index.scss";
|
|
8
|
+
|
|
9
|
+
<Meta
|
|
10
|
+
id="css-form-field--checkbox-group"
|
|
11
|
+
title="CSS Component/Form field/with checkbox group"
|
|
12
|
+
component={FormFieldCheckboxGroup}
|
|
13
|
+
argTypes={argTypes}
|
|
14
|
+
args={defaultArgs}
|
|
15
|
+
parameters={{
|
|
16
|
+
status: {
|
|
17
|
+
type: "WORK IN PROGRESS",
|
|
18
|
+
},
|
|
19
|
+
}}
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
# Form field with checkbox group
|
|
23
|
+
|
|
24
|
+
## with only a label
|
|
25
|
+
|
|
26
|
+
<Canvas>
|
|
27
|
+
<Story
|
|
28
|
+
name="label"
|
|
29
|
+
args={{
|
|
30
|
+
...exampleArgs,
|
|
31
|
+
groupId: "0128c307-ead5-40d4-9a99-c91aa6fa4a99",
|
|
32
|
+
groupLabel: "Hoe wil je dat wij contact opnemen?",
|
|
33
|
+
options: [
|
|
34
|
+
{
|
|
35
|
+
id: "a374296c-669e-45d0-a26d-e62e959958dd",
|
|
36
|
+
name: "phone",
|
|
37
|
+
value: "true",
|
|
38
|
+
label: "Telefoon",
|
|
39
|
+
checked: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "714205e8-d33b-40d8-9721-e2ea71c62a20",
|
|
43
|
+
name: "email",
|
|
44
|
+
value: "true",
|
|
45
|
+
label: "E-mail",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "67fa8ea7-6b75-4049-ae4f-ebaa816e4c35",
|
|
49
|
+
name: "mail",
|
|
50
|
+
value: "true",
|
|
51
|
+
label: "Brief",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
{FormFieldCheckboxGroup.bind({})}
|
|
57
|
+
</Story>
|
|
58
|
+
</Canvas>
|
|
59
|
+
|
|
60
|
+
## with an checkbox group description
|
|
61
|
+
|
|
62
|
+
<Canvas>
|
|
63
|
+
<Story
|
|
64
|
+
name="group description"
|
|
65
|
+
args={{
|
|
66
|
+
...exampleArgs,
|
|
67
|
+
groupId: "d7218515-bf54-45c1-ba57-a72af5d7fd42",
|
|
68
|
+
groupDescription: "Kies één of meerdere opties.",
|
|
69
|
+
groupLabel: "Hoe wil je dat wij contact opnemen?",
|
|
70
|
+
options: [
|
|
71
|
+
{
|
|
72
|
+
id: "2a5524f5-6ee8-4be1-90a1-87d0d619d2ee",
|
|
73
|
+
name: "phone",
|
|
74
|
+
value: "true",
|
|
75
|
+
label: "Telefoon",
|
|
76
|
+
checked: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "1fe84cc2-16fc-4e9b-9498-856583652181",
|
|
80
|
+
name: "email",
|
|
81
|
+
value: "true",
|
|
82
|
+
label: "E-mail",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "96493bfe-2caa-4cb3-80ce-a4a46fc69c10",
|
|
86
|
+
name: "mail",
|
|
87
|
+
value: "true",
|
|
88
|
+
label: "Brief",
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{FormFieldCheckboxGroup.bind({})}
|
|
94
|
+
</Story>
|
|
95
|
+
</Canvas>
|
|
96
|
+
|
|
97
|
+
## with checkbox option descriptions
|
|
98
|
+
|
|
99
|
+
<Canvas>
|
|
100
|
+
<Story
|
|
101
|
+
name="option description"
|
|
102
|
+
args={{
|
|
103
|
+
...exampleArgs,
|
|
104
|
+
groupId: "764bacdd-94b4-4774-be40-89e9e5f82c19",
|
|
105
|
+
groupLabel: "Hoe wil je dat wij contact opnemen?",
|
|
106
|
+
options: [
|
|
107
|
+
{
|
|
108
|
+
id: "28a9109b-eb9c-4119-abaa-02d09e8f359b",
|
|
109
|
+
name: "phone",
|
|
110
|
+
value: "true",
|
|
111
|
+
label: "Telefoon",
|
|
112
|
+
description: "We bellen je op (085) 555 0000",
|
|
113
|
+
checked: true,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "3bdeeba2-199f-44e9-9184-ed8dbfb2fc37",
|
|
117
|
+
name: "email",
|
|
118
|
+
description: "Web mailen je op info@example.com",
|
|
119
|
+
value: "true",
|
|
120
|
+
label: "E-mail",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "2bb862c1-114e-4529-975e-1776df23f055",
|
|
124
|
+
name: "mail",
|
|
125
|
+
value: "true",
|
|
126
|
+
label: "Brief",
|
|
127
|
+
description: "Je ontvangt een brief op Stadhuisplein 1, Amsterdam",
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
{FormFieldCheckboxGroup.bind({})}
|
|
133
|
+
</Story>
|
|
134
|
+
</Canvas>
|
|
135
|
+
|
|
136
|
+
## with checkbox invalid option descriptions
|
|
137
|
+
|
|
138
|
+
<Canvas>
|
|
139
|
+
<Story
|
|
140
|
+
name="option invalid"
|
|
141
|
+
args={{
|
|
142
|
+
...exampleArgs,
|
|
143
|
+
groupId: "73a3f2c1-00e7-48b8-9ebb-1f51b6550f42",
|
|
144
|
+
groupLabel: "Hoe wil je dat wij contact opnemen?",
|
|
145
|
+
options: [
|
|
146
|
+
{
|
|
147
|
+
checked: true,
|
|
148
|
+
id: "c0972ecc-6eef-4bf9-80ab-c535fc0229b5",
|
|
149
|
+
invalid: true,
|
|
150
|
+
invalidDescription: "Wij hebben geen telefoonnumer van je. Vul eerst je profiel aan.",
|
|
151
|
+
label: "Telefoon",
|
|
152
|
+
name: "phone",
|
|
153
|
+
value: "true",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
checked: true,
|
|
157
|
+
id: "714d33fd-4cc4-4113-9887-4c38e77a6532",
|
|
158
|
+
invalid: true,
|
|
159
|
+
invalidDescription: "Wij hebben geen e-mailadres van je. Vul eerst je profiel aan.",
|
|
160
|
+
label: "E-mail",
|
|
161
|
+
name: "email",
|
|
162
|
+
value: "true",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
checked: true,
|
|
166
|
+
id: "10ee620a-af7e-4c67-9f6d-5519b3c45c6d",
|
|
167
|
+
invalid: true,
|
|
168
|
+
invalidDescription: "Wij hebben geen postadres van je. Vul eerst je profiel aan.",
|
|
169
|
+
label: "Brief",
|
|
170
|
+
name: "mail",
|
|
171
|
+
value: "true",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
{FormFieldCheckboxGroup.bind({})}
|
|
177
|
+
</Story>
|
|
178
|
+
</Canvas>
|
|
179
|
+
|
|
180
|
+
## with checkbox invalid grou description
|
|
181
|
+
|
|
182
|
+
<Canvas>
|
|
183
|
+
<Story
|
|
184
|
+
name="group invalid"
|
|
185
|
+
args={{
|
|
186
|
+
...exampleArgs,
|
|
187
|
+
groupId: "707b7bd8-d476-472c-ac9d-3c1a4caac4c2",
|
|
188
|
+
groupLabel: "Hoe wil je dat wij contact opnemen?",
|
|
189
|
+
groupInvalid: true,
|
|
190
|
+
groupInvalidDescription: "Fout: je hebt geen keuze gemaakt. Kies één of meerdere opties.",
|
|
191
|
+
options: [
|
|
192
|
+
{
|
|
193
|
+
id: "80d14d58-bc99-4c53-824e-36473d6506c7",
|
|
194
|
+
label: "Telefoon",
|
|
195
|
+
name: "phone",
|
|
196
|
+
value: "true",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: "0b4aea63-ec5b-4259-b008-ba8eaf8b03e3",
|
|
200
|
+
label: "E-mail",
|
|
201
|
+
name: "email",
|
|
202
|
+
value: "true",
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: "9360080d-3a48-444d-bc2c-1cd1a40940f9",
|
|
206
|
+
label: "Brief",
|
|
207
|
+
name: "mail",
|
|
208
|
+
value: "true",
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
{FormFieldCheckboxGroup.bind({})}
|
|
214
|
+
</Story>
|
|
215
|
+
</Canvas>
|