@utrecht/form-field-css 1.3.0 → 1.5.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @utrecht/form-field-css
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 725617a: Add `tokens.mjs` and `tokens.d.mts` files to CSS packages.
8
+
9
+ ## 1.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - e497b08: Export CSS string as default export in `dist/index.mjs`.
14
+
3
15
  ## 1.3.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.css CHANGED
@@ -1,13 +1,8 @@
1
1
  /**
2
2
  * @license EUPL-1.2
3
- * Copyright (c) 2021 Robbert Broersma
3
+ * Copyright (c) 2020-2024 Frameless B.V.
4
+ * Copyright (c) 2021-2024 Gemeente Utrecht
4
5
  */
5
- /**
6
- * @license EUPL-1.2
7
- * Copyright (c) 2021 Robbert Broersma
8
- */
9
- /* stylelint-disable-next-line block-no-empty */
10
- /** @deprecated */
11
6
  .utrecht-form-field {
12
7
  break-inside: avoid;
13
8
  font-family: var(--utrecht-document-font-family, inherit);
@@ -32,14 +27,6 @@
32
27
  gap: 0 var(--utrecht-checkbox-margin-inline-end, 12px);
33
28
  grid-template-areas: "input label" "input description" "input error-message";
34
29
  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
30
  }
44
31
  .utrecht-form-field--checkbox .utrecht-form-field__label:has(.utrecht-form-field__input) {
45
32
  margin-inline-start: calc(-1 * (var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px)));
@@ -53,14 +40,6 @@
53
40
  gap: 0 var(--utrecht-radio-button-margin-inline-end, 12px);
54
41
  grid-template-areas: "input label" "input description" "input error-message";
55
42
  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
43
  }
65
44
  .utrecht-form-field--radio .utrecht-form-field__label:has(.utrecht-form-field__input) {
66
45
  margin-inline-start: calc(-1 * (var(--utrecht-radio-button-size) + var(--utrecht-radio-button-margin-inline-end, 12px)));
@@ -77,8 +56,6 @@
77
56
  }
78
57
 
79
58
  .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
59
  grid-area: label;
83
60
  margin-block-end: var(--utrecht-form-field-label-margin-block-end);
84
61
  margin-block-start: 0;
@@ -0,0 +1 @@
1
+ .utrecht-form-field{break-inside:avoid;font-family:var(--utrecht-document-font-family,inherit);margin-block-end:calc(var(--utrecht-space-around, 0)*var(--utrecht-form-field-margin-block-end, 0));margin-block-start:calc(var(--utrecht-space-around, 0)*var(--utrecht-form-field-margin-block-start, 0));page-break-inside:avoid}.utrecht-form-field--distanced{--utrecht-space-around:1}.utrecht-form-field--invalid{border-inline-start-color:var(--utrecht-form-field-invalid-border-inline-start-color);border-inline-start-style:solid;border-inline-start-width:var(--utrecht-form-field-invalid-border-inline-start-width,0);padding-inline-start:var(--utrecht-form-field-invalid-padding-inline-start)}.utrecht-form-field--checkbox{display:grid;gap:0 var(--utrecht-checkbox-margin-inline-end,12px);grid-template-areas:"input label" "input description" "input error-message";grid-template-columns:var(--utrecht-checkbox-size) 100fr}.utrecht-form-field--checkbox .utrecht-form-field__label:has(.utrecht-form-field__input){margin-inline-start:calc((var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))*-1)}.utrecht-form-field--checkbox .utrecht-form-field__label .utrecht-form-field__input{margin-inline-end:var(--utrecht-checkbox-margin-inline-end,12px)}.utrecht-form-field--radio{display:grid;gap:0 var(--utrecht-radio-button-margin-inline-end,12px);grid-template-areas:"input label" "input description" "input error-message";grid-template-columns:var(--utrecht-radio-button-size) 100fr}.utrecht-form-field--radio .utrecht-form-field__label:has(.utrecht-form-field__input){margin-inline-start:calc((var(--utrecht-radio-button-size) + var(--utrecht-radio-button-margin-inline-end, 12px))*-1)}.utrecht-form-field--radio .utrecht-form-field__label .utrecht-form-field__input{margin-inline-end:var(--utrecht-radio-button-margin-inline-end,12px)}.utrecht-form-field__input{grid-area:input;margin-block-end:0;margin-block-start:0;order:5}.utrecht-form-field__label{grid-area:label;margin-block-end:var(--utrecht-form-field-label-margin-block-end);margin-block-start:0;order:1}.utrecht-form-field .utrecht-form-field-description{grid-area:description;margin-block-end:var(--utrecht-form-field-description-margin-block-end);margin-block-start:var(--utrecht-form-field-description-margin-block-start);order:2}.utrecht-form-field .utrecht-form-field-description--invalid{grid-area:error-message;order:3}.utrecht-form-field__description{grid-area:description;margin-block-end:var(--utrecht-form-field-description-margin-block-end);margin-block-start:var(--utrecht-form-field-description-margin-block-start);order:2}.utrecht-form-field__description--before{grid-area:description-before;order:4}.utrecht-form-field__error-message{grid-area:error-message;order:3}
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export default ".utrecht-form-field{break-inside:avoid;font-family:var(--utrecht-document-font-family,inherit);margin-block-end:calc(var(--utrecht-space-around, 0)*var(--utrecht-form-field-margin-block-end, 0));margin-block-start:calc(var(--utrecht-space-around, 0)*var(--utrecht-form-field-margin-block-start, 0));page-break-inside:avoid}.utrecht-form-field--distanced{--utrecht-space-around:1}.utrecht-form-field--invalid{border-inline-start-color:var(--utrecht-form-field-invalid-border-inline-start-color);border-inline-start-style:solid;border-inline-start-width:var(--utrecht-form-field-invalid-border-inline-start-width,0);padding-inline-start:var(--utrecht-form-field-invalid-padding-inline-start)}.utrecht-form-field--checkbox{display:grid;gap:0 var(--utrecht-checkbox-margin-inline-end,12px);grid-template-areas:\"input label\" \"input description\" \"input error-message\";grid-template-columns:var(--utrecht-checkbox-size) 100fr}.utrecht-form-field--checkbox .utrecht-form-field__label:has(.utrecht-form-field__input){margin-inline-start:calc((var(--utrecht-checkbox-size) + var(--utrecht-checkbox-margin-inline-end, 12px))*-1)}.utrecht-form-field--checkbox .utrecht-form-field__label .utrecht-form-field__input{margin-inline-end:var(--utrecht-checkbox-margin-inline-end,12px)}.utrecht-form-field--radio{display:grid;gap:0 var(--utrecht-radio-button-margin-inline-end,12px);grid-template-areas:\"input label\" \"input description\" \"input error-message\";grid-template-columns:var(--utrecht-radio-button-size) 100fr}.utrecht-form-field--radio .utrecht-form-field__label:has(.utrecht-form-field__input){margin-inline-start:calc((var(--utrecht-radio-button-size) + var(--utrecht-radio-button-margin-inline-end, 12px))*-1)}.utrecht-form-field--radio .utrecht-form-field__label .utrecht-form-field__input{margin-inline-end:var(--utrecht-radio-button-margin-inline-end,12px)}.utrecht-form-field__input{grid-area:input;margin-block-end:0;margin-block-start:0;order:5}.utrecht-form-field__label{grid-area:label;margin-block-end:var(--utrecht-form-field-label-margin-block-end);margin-block-start:0;order:1}.utrecht-form-field .utrecht-form-field-description{grid-area:description;margin-block-end:var(--utrecht-form-field-description-margin-block-end);margin-block-start:var(--utrecht-form-field-description-margin-block-start);order:2}.utrecht-form-field .utrecht-form-field-description--invalid{grid-area:error-message;order:3}.utrecht-form-field__description{grid-area:description;margin-block-end:var(--utrecht-form-field-description-margin-block-end);margin-block-start:var(--utrecht-form-field-description-margin-block-start);order:2}.utrecht-form-field__description--before{grid-area:description-before;order:4}.utrecht-form-field__error-message{grid-area:error-message;order:3}";
@@ -0,0 +1,2 @@
1
+ declare const css: string;
2
+ export default css;
@@ -0,0 +1,4 @@
1
+
2
+ declare const tokens: any;
3
+
4
+ export default tokens;
@@ -0,0 +1,70 @@
1
+ export default {
2
+ "utrecht": {
3
+ "form-field": {
4
+ "margin-block-start": {
5
+ "$extensions": {
6
+ "nl.nldesignsystem.css.property": {
7
+ "syntax": "<length>",
8
+ "inherits": true
9
+ },
10
+ "nl.nldesignsystem.figma.supports-token": false
11
+ },
12
+ "type": "spacing"
13
+ },
14
+ "margin-block-end": {
15
+ "$extensions": {
16
+ "nl.nldesignsystem.css.property": {
17
+ "syntax": "<length>",
18
+ "inherits": true
19
+ },
20
+ "nl.nldesignsystem.figma.supports-token": false
21
+ },
22
+ "type": "spacing"
23
+ },
24
+ "invalid": {
25
+ "border-inline-start-color": {
26
+ "$extensions": {
27
+ "nl.nldesignsystem.css.property": {
28
+ "syntax": "<color>",
29
+ "inherits": true
30
+ },
31
+ "nl.nldesignsystem.figma.supports-token": true
32
+ },
33
+ "type": "color"
34
+ },
35
+ "border-inline-start-width": {
36
+ "$extensions": {
37
+ "nl.nldesignsystem.css.property": {
38
+ "syntax": "<length>",
39
+ "inherits": true
40
+ },
41
+ "nl.nldesignsystem.figma.supports-token": true
42
+ },
43
+ "type": "borderWidth"
44
+ },
45
+ "padding-inline-start": {
46
+ "$extensions": {
47
+ "nl.nldesignsystem.css.property": {
48
+ "syntax": "<length>",
49
+ "inherits": true
50
+ },
51
+ "nl.nldesignsystem.figma.supports-token": true
52
+ },
53
+ "type": "spacing"
54
+ }
55
+ },
56
+ "label": {
57
+ "margin-block-end": {
58
+ "$extensions": {
59
+ "nl.nldesignsystem.css.property": {
60
+ "syntax": "<length>",
61
+ "inherits": true
62
+ },
63
+ "nl.nldesignsystem.figma.supports-token": false
64
+ },
65
+ "type": "spacing"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.0",
2
+ "version": "1.5.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",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "main": "dist/index.css",
14
14
  "devDependencies": {
15
- "rollup": "4.18.0"
15
+ "@utrecht/build-utils-css": "0.0.1"
16
16
  },
17
17
  "keywords": [
18
18
  "nl-design-system"
@@ -26,7 +26,7 @@
26
26
  "directory": "components/form-field"
27
27
  },
28
28
  "scripts": {
29
- "build": "rollup -c ../rollup.config.mjs",
29
+ "build": "build-css-package",
30
30
  "clean": "rimraf dist"
31
31
  }
32
32
  }
package/src/_mixin.scss CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @license EUPL-1.2
3
- * Copyright (c) 2021 Robbert Broersma
3
+ * Copyright (c) 2020-2024 Frameless B.V.
4
+ * Copyright (c) 2021-2024 Gemeente Utrecht
4
5
  */
5
6
 
6
7
  @mixin reset-p {
package/src/index.scss CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @license EUPL-1.2
3
- * Copyright (c) 2021 Robbert Broersma
3
+ * Copyright (c) 2020-2024 Frameless B.V.
4
+ * Copyright (c) 2021-2024 Gemeente Utrecht
4
5
  */
5
6
 
6
7
  @import "./mixin";
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- var undefined$1 = undefined;export{undefined$1 as default};
@@ -1,4 +0,0 @@
1
- <!-- @license CC0-1.0 -->
2
- <!-- markdownlint-disable MD041 -->
3
-
4
- Als je vraagt om het e-mailadres van een persoon, leg dan uit waar het voor gebruikt zal worden.
@@ -1,6 +0,0 @@
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.
@@ -1,4 +0,0 @@
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.
@@ -1,215 +0,0 @@
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>
@@ -1,136 +0,0 @@
1
- {/* @license CC0-1.0 */}
2
-
3
- import { Canvas, Meta, Story } from "@storybook/blocks";
4
- import { argTypes, defaultArgs, exampleArgs, FormFieldCheckbox } from "../story-template";
5
- import "../../../checkbox/src/index.scss";
6
- import "../../../form-label/src/index.scss";
7
- import "../index.scss";
8
-
9
- export
10
-
11
- <Meta
12
- id="css-form-field--checkbox"
13
- title="CSS Component/Form field/with one checkbox"
14
- component={FormFieldCheckbox}
15
- argTypes={argTypes}
16
- args={defaultArgs}
17
- parameters={{
18
- status: {
19
- type: "WORK IN PROGRESS",
20
- },
21
- }}
22
- />
23
-
24
- # label
25
-
26
- <Canvas>
27
- <Story
28
- name="label"
29
- args={{
30
- ...exampleArgs,
31
- id: "172cd71b-8854-41ee-bcdc-9c8ac856c5d1",
32
- label: "Ik ga akkoord met de algemene voorwaarden",
33
- type: "checkbox",
34
- }}
35
- >
36
- {FormFieldCheckbox.bind({})}
37
- </Story>
38
- </Canvas>
39
-
40
- # Form field with description
41
-
42
- <Canvas>
43
- <Story
44
- name="description"
45
- args={{
46
- ...exampleArgs,
47
- id: "7cdd4f82-e7eb-4573-bad3-2b520aac504b",
48
- label: "Ik ga akkoord met de algemene voorwaarden",
49
- description: "U kunt ons echt vertrouwen!",
50
- type: "checkbox",
51
- }}
52
- >
53
- {FormFieldCheckbox.bind({})}
54
- </Story>
55
- </Canvas>
56
-
57
- ## Invalid
58
-
59
- <Canvas>
60
- <Story
61
- name="invalid"
62
- args={{
63
- ...exampleArgs,
64
- id: "6cfb69fc-3a52-4fd8-b8a1-0c2d0dfb11ed",
65
- label: "Ik ga akkoord met de algemene voorwaarden",
66
- description: "U kunt ons echt vertrouwen!",
67
- invalid: true,
68
- required: true,
69
- invalidDescription: "U moet akkoord gaan met de algemene voorwaarden, anders kunt u niet verder.",
70
- type: "checkbox",
71
- }}
72
- >
73
- {FormFieldCheckbox.bind({})}
74
- </Story>
75
- </Canvas>
76
-
77
- ## Right-to-left script
78
-
79
- <Canvas>
80
- <Story
81
- name="Right-to-left script"
82
- decorators={[
83
- (Story) => (
84
- <div lang="ar" dir="rtl">
85
- {Story()}
86
- </div>
87
- ),
88
- ]}
89
- args={{
90
- ...exampleArgs,
91
- id: "2d692d60-e111-4582-a487-385cdbd3f994",
92
- label: "أوافق على الشروط",
93
- description: "يمكنك حقا أن تثق بنا!",
94
- invalid: true,
95
- required: true,
96
- invalidDescription: "يجب أن توافق على الشروط والأحكام وإلا فلن تتمكن من المتابعة.",
97
- type: "checkbox",
98
- }}
99
- >
100
- {FormFieldCheckbox.bind({})}
101
- </Story>
102
- </Canvas>
103
-
104
- ## Rich text description
105
-
106
- <Canvas>
107
- <Story
108
- name="Rich text description"
109
- args={{
110
- ...exampleArgs,
111
- id: "f23a0d30-29b5-4e82-a6e5-7eb83e5cd47a",
112
- description: (
113
- <>
114
- <p className="utrecht-paragraph">Your new password needs to meet these requirements:</p>
115
- <ul className="utrecht-unordered-list">
116
- <li>At least 1 character</li>
117
- <li>No more than 2 characters</li>
118
- <li>Use at least one uppercase letter and one lowercase letter.</li>
119
- </ul>
120
- </>
121
- ),
122
- invalidDescription: (
123
- <>
124
- <p className="utrecht-paragraph">Your new password does not meet these requirements:</p>
125
- <ul className="utrecht-unordered-list">
126
- <li>Your password is too long.</li>
127
- <li>Use at least one uppercase letter.</li>
128
- </ul>
129
- </>
130
- ),
131
- type: "checkbox",
132
- }}
133
- >
134
- {FormFieldCheckbox.bind({})}
135
- </Story>
136
- </Canvas>