@helsenorge/designsystem-react 14.9.2 → 14.11.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/lib/BabyMobileMedium.js +1 -1
- package/lib/CHANGELOG.md +17 -0
- package/lib/Checkbox.js +25 -48
- package/lib/Checkbox.js.map +1 -1
- package/lib/Checkbox3.js +68 -0
- package/lib/Checkbox3.js.map +1 -0
- package/lib/CheckboxMarker.js +60 -0
- package/lib/CheckboxMarker.js.map +1 -0
- package/lib/ChildMedium.js +1 -1
- package/lib/EyeContactMedium.js +79 -0
- package/lib/EyeContactMedium.js.map +1 -0
- package/lib/FacialRecognitionFingerprintMedium.js +1 -1
- package/lib/FormGroup.js +5 -5
- package/lib/FormGroup.js.map +1 -1
- package/lib/GiveBabyFoodMedium.js +1 -1
- package/lib/Illustration.js +1 -1
- package/lib/IllustrationNames.js +4 -0
- package/lib/IllustrationNames.js.map +1 -1
- package/lib/LazyIllustration.js +5 -1
- package/lib/LazyIllustration.js.map +1 -1
- package/lib/Radio.js +73 -0
- package/lib/Radio.js.map +1 -0
- package/lib/RadioButton.js +95 -3
- package/lib/RadioButton.js.map +1 -1
- package/lib/RadioButton2.js +5 -0
- package/lib/RadioButton2.js.map +1 -0
- package/lib/RadioMarker.js +37 -0
- package/lib/RadioMarker.js.map +1 -0
- package/lib/ReadLettersMedium.js +1 -1
- package/lib/SkinToSkinMedium.js +106 -0
- package/lib/SkinToSkinMedium.js.map +1 -0
- package/lib/StorkMedium.js +1 -1
- package/lib/StrollerMedium.js +1 -1
- package/lib/Support2Medium.js +1 -1
- package/lib/TableBody.js +1 -1
- package/lib/TableHead.js +1 -1
- package/lib/TableRow.js +1 -1
- package/lib/ThinkingMedium.js +1 -1
- package/lib/VisualCheckbox.js +77 -0
- package/lib/VisualCheckbox.js.map +1 -0
- package/lib/VisualRadio.js +77 -0
- package/lib/VisualRadio.js.map +1 -0
- package/lib/components/Checkbox/CheckboxMarker/CheckboxMarker.d.ts +20 -0
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss +309 -0
- package/lib/components/Checkbox/CheckboxMarker/styles.module.scss.d.ts +25 -0
- package/lib/components/Checkbox/styles.module.scss +9 -269
- package/lib/components/Checkbox/styles.module.scss.d.ts +1 -17
- package/lib/components/Illustration/index.js +1 -1
- package/lib/components/Illustrations/BabyMobile.js +1 -1
- package/lib/components/Illustrations/Child.js +1 -1
- package/lib/components/Illustrations/Doctor.js +1 -1
- package/lib/components/Illustrations/EyeContact.d.ts +8 -0
- package/lib/components/Illustrations/EyeContact.js +16 -0
- package/lib/components/Illustrations/EyeContact.js.map +1 -0
- package/lib/components/Illustrations/EyeContactMedium.d.ts +3 -0
- package/lib/components/Illustrations/EyeContactMedium.js +2 -0
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js +1 -1
- package/lib/components/Illustrations/GiveBabyFood.js +1 -1
- package/lib/components/Illustrations/HealthcarePersonnel.js +1 -1
- package/lib/components/Illustrations/IllustrationNames.d.ts +1 -1
- package/lib/components/Illustrations/ReadLetters.js +1 -1
- package/lib/components/Illustrations/SkinToSkin.d.ts +8 -0
- package/lib/components/Illustrations/SkinToSkin.js +16 -0
- package/lib/components/Illustrations/SkinToSkin.js.map +1 -0
- package/lib/components/Illustrations/SkinToSkinMedium.d.ts +3 -0
- package/lib/components/Illustrations/SkinToSkinMedium.js +2 -0
- package/lib/components/Illustrations/Stork.js +1 -1
- package/lib/components/Illustrations/Stroller.js +1 -1
- package/lib/components/Illustrations/Support2.js +1 -1
- package/lib/components/Illustrations/Thinking.js +1 -1
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/PanelList/index.js +1 -1
- package/lib/components/RadioButton/RadioMarker/RadioMarker.d.ts +20 -0
- package/lib/components/RadioButton/RadioMarker/styles.module.scss +259 -0
- package/lib/components/RadioButton/RadioMarker/styles.module.scss.d.ts +24 -0
- package/lib/components/RadioButton/index.d.ts +0 -1
- package/lib/components/RadioButton/index.js +3 -3
- package/lib/components/RadioButton/styles.module.scss +11 -273
- package/lib/components/RadioButton/styles.module.scss.d.ts +1 -9
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Validation/index.js +1 -1
- package/lib/components/VisualCheckboxCloud/Checkbox/Checkbox.d.ts +21 -0
- package/lib/components/VisualCheckboxCloud/Checkbox/index.d.ts +3 -0
- package/lib/components/VisualCheckboxCloud/Checkbox/index.js +5 -0
- package/lib/components/VisualCheckboxCloud/Checkbox/index.js.map +1 -0
- package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss +10 -0
- package/lib/components/VisualCheckboxCloud/Checkbox/styles.module.scss.d.ts +15 -0
- package/lib/components/VisualCheckboxCloud/VisualCheckboxCloud.d.ts +29 -0
- package/lib/components/VisualCheckboxCloud/index.d.ts +3 -0
- package/lib/components/VisualCheckboxCloud/index.js +38 -0
- package/lib/components/VisualCheckboxCloud/index.js.map +1 -0
- package/lib/components/VisualCheckboxCloud/styles.module.scss +6 -0
- package/lib/components/VisualCheckboxCloud/styles.module.scss.d.ts +9 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualCheckbox.d.ts +26 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/VisualContent.d.ts +10 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.d.ts +3 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js +5 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/index.js.map +1 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss +7 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckbox/styles.module.scss.d.ts +18 -0
- package/lib/components/VisualCheckboxGroup/VisualCheckboxGroup.d.ts +33 -0
- package/lib/components/VisualCheckboxGroup/index.d.ts +3 -0
- package/lib/components/VisualCheckboxGroup/index.js +43 -0
- package/lib/components/VisualCheckboxGroup/index.js.map +1 -0
- package/lib/components/VisualCheckboxGroup/styles.module.scss +6 -0
- package/lib/components/VisualCheckboxGroup/styles.module.scss.d.ts +10 -0
- package/lib/components/VisualRadioCloud/Radio/Radio.d.ts +23 -0
- package/lib/components/VisualRadioCloud/Radio/index.d.ts +3 -0
- package/lib/components/VisualRadioCloud/Radio/index.js +5 -0
- package/lib/components/VisualRadioCloud/Radio/index.js.map +1 -0
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss +7 -0
- package/lib/components/VisualRadioCloud/Radio/styles.module.scss.d.ts +15 -0
- package/lib/components/VisualRadioCloud/VisualRadioCloud.d.ts +39 -0
- package/lib/components/VisualRadioCloud/index.d.ts +3 -0
- package/lib/components/VisualRadioCloud/index.js +58 -0
- package/lib/components/VisualRadioCloud/index.js.map +1 -0
- package/lib/components/VisualRadioCloud/styles.module.scss +6 -0
- package/lib/components/VisualRadioCloud/styles.module.scss.d.ts +9 -0
- package/lib/components/VisualRadioGroup/VisualRadio/VisualContent.d.ts +10 -0
- package/lib/components/VisualRadioGroup/VisualRadio/VisualRadio.d.ts +26 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.d.ts +3 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.js +5 -0
- package/lib/components/VisualRadioGroup/VisualRadio/index.js.map +1 -0
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss +7 -0
- package/lib/components/VisualRadioGroup/VisualRadio/styles.module.scss.d.ts +18 -0
- package/lib/components/VisualRadioGroup/VisualRadioGroup.d.ts +39 -0
- package/lib/components/VisualRadioGroup/index.d.ts +3 -0
- package/lib/components/VisualRadioGroup/index.js +63 -0
- package/lib/components/VisualRadioGroup/index.js.map +1 -0
- package/lib/components/VisualRadioGroup/styles.module.scss +6 -0
- package/lib/components/VisualRadioGroup/styles.module.scss.d.ts +10 -0
- package/lib/scss/_visual-form.scss +345 -0
- package/lib/utils3.js +10 -98
- package/lib/utils3.js.map +1 -1
- package/lib/utils4.js +28 -11
- package/lib/utils4.js.map +1 -1
- package/lib/utils5.js +58 -28
- package/lib/utils5.js.map +1 -1
- package/package.json +115 -1
- package/scss/_visual-form.scss +345 -0
- package/lib/components/RadioButton/utils.d.ts +0 -2
- package/lib/utils6.js +0 -60
- package/lib/utils6.js.map +0 -1
|
@@ -1,42 +1,13 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
-
@use 'sass:meta';
|
|
3
|
-
@use 'sass:string';
|
|
4
2
|
@use '../../scss/spacers' as spacers;
|
|
5
3
|
@use '../../scss/palette' as palette;
|
|
6
4
|
@use '../../scss/font-settings' as font-settings;
|
|
7
5
|
@use '../../scss/breakpoints' as breakpoints;
|
|
6
|
+
@use '../../scss/screen-reader' as *;
|
|
8
7
|
|
|
9
8
|
$padding-clickable-area-top-bottom: 8px;
|
|
10
9
|
$padding-clickable-area-left: 8px;
|
|
11
10
|
|
|
12
|
-
@mixin dashed-border() {
|
|
13
|
-
box-shadow: none;
|
|
14
|
-
position: relative;
|
|
15
|
-
|
|
16
|
-
&::after {
|
|
17
|
-
position: absolute;
|
|
18
|
-
content: '';
|
|
19
|
-
|
|
20
|
-
$encoded-color: string.slice(meta.inspect(palette.$neutral600), 2);
|
|
21
|
-
|
|
22
|
-
// Variabler for å lettere styre dashen i background-imaget under
|
|
23
|
-
$stroke: 4;
|
|
24
|
-
$dash: 0.2;
|
|
25
|
-
$gap: 7;
|
|
26
|
-
$scale: 1;
|
|
27
|
-
$stroke-scaled: $stroke * $scale;
|
|
28
|
-
$dash-scaled: $dash * $scale;
|
|
29
|
-
$gap-scaled: $gap * $scale;
|
|
30
|
-
|
|
31
|
-
border-radius: 100px;
|
|
32
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Crect width='100%25' height='100%25' fill='none' rx='100' ry='100' stroke='%23#{$encoded-color}' stroke-width='#{$stroke-scaled}' stroke-dasharray='#{$dash-scaled},#{$gap-scaled}' stroke-linecap='square'/%3E%3C/svg%3E");
|
|
33
|
-
background-repeat: no-repeat;
|
|
34
|
-
width: 28px;
|
|
35
|
-
height: 28px;
|
|
36
|
-
inset: -2px;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
11
|
.radio-button-errors {
|
|
41
12
|
font-size: font-settings.$font-size-sm;
|
|
42
13
|
font-weight: 600;
|
|
@@ -50,20 +21,20 @@ $padding-clickable-area-left: 8px;
|
|
|
50
21
|
&__large {
|
|
51
22
|
margin: spacers.getSpacer(2xs) 0;
|
|
52
23
|
|
|
53
|
-
|
|
24
|
+
&:has(input:focus-visible) {
|
|
54
25
|
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
55
26
|
color: palette.$neutral500;
|
|
56
27
|
}
|
|
57
28
|
|
|
58
|
-
&--
|
|
29
|
+
&--on-blueberry:has(input:focus-visible) {
|
|
59
30
|
color: palette.$blueberry500;
|
|
60
31
|
}
|
|
61
32
|
|
|
62
|
-
&--
|
|
33
|
+
&--selected:has(input:focus-visible) {
|
|
63
34
|
color: palette.$blueberry900;
|
|
64
35
|
}
|
|
65
36
|
|
|
66
|
-
&--
|
|
37
|
+
&--invalid:has(input:focus-visible) {
|
|
67
38
|
color: palette.$cherry400;
|
|
68
39
|
}
|
|
69
40
|
}
|
|
@@ -86,7 +57,7 @@ $padding-clickable-area-left: 8px;
|
|
|
86
57
|
}
|
|
87
58
|
|
|
88
59
|
&--disabled {
|
|
89
|
-
cursor:
|
|
60
|
+
cursor: not-allowed;
|
|
90
61
|
color: palette.$neutral700;
|
|
91
62
|
}
|
|
92
63
|
|
|
@@ -99,7 +70,7 @@ $padding-clickable-area-left: 8px;
|
|
|
99
70
|
background-color: palette.$neutral100;
|
|
100
71
|
}
|
|
101
72
|
|
|
102
|
-
|
|
73
|
+
&:has(input:focus-visible) {
|
|
103
74
|
border: 1px solid var(--color-action-border-ondark-focus);
|
|
104
75
|
}
|
|
105
76
|
|
|
@@ -203,244 +174,11 @@ $padding-clickable-area-left: 8px;
|
|
|
203
174
|
}
|
|
204
175
|
|
|
205
176
|
.radio-button {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
display: flex;
|
|
209
|
-
justify-content: center;
|
|
210
|
-
align-items: center;
|
|
211
|
-
border-radius: 10rem;
|
|
212
|
-
margin: 0 spacers.getSpacer(s) 0 0;
|
|
213
|
-
height: 1.5rem;
|
|
214
|
-
width: 1.5rem;
|
|
215
|
-
min-height: 1.5rem;
|
|
216
|
-
min-width: 1.5rem;
|
|
217
|
-
color: palette.$neutral700;
|
|
218
|
-
box-shadow: 0 0 0 spacers.getSpacer(4xs);
|
|
219
|
-
outline: none;
|
|
220
|
-
|
|
221
|
-
&:focus {
|
|
222
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
223
|
-
color: palette.$black;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
&:hover {
|
|
227
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
228
|
-
background-color: palette.$neutral100;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
:active > & {
|
|
232
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
233
|
-
color: palette.$black;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
&:checked {
|
|
237
|
-
color: palette.$blueberry500;
|
|
238
|
-
|
|
239
|
-
&:hover {
|
|
240
|
-
box-shadow: 0 0 0 spacers.getSpacer(4xs);
|
|
241
|
-
background-color: palette.$blueberry50;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
&:focus {
|
|
245
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
246
|
-
color: palette.$black;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
&--on-blueberry {
|
|
251
|
-
color: palette.$blueberry500;
|
|
252
|
-
|
|
253
|
-
:hover > & {
|
|
254
|
-
background-color: palette.$blueberry100;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
&--on-dark {
|
|
259
|
-
color: palette.$neutral200;
|
|
260
|
-
|
|
261
|
-
&:hover {
|
|
262
|
-
background-color: palette.$inverted-hover-old;
|
|
263
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
&:focus {
|
|
267
|
-
color: palette.$white;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
:active > & {
|
|
271
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
272
|
-
color: palette.$white;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
&:checked {
|
|
276
|
-
color: palette.$blueberry200;
|
|
277
|
-
|
|
278
|
-
&:hover {
|
|
279
|
-
background-color: palette.$inverted-hover-old;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
&:focus {
|
|
283
|
-
color: palette.$white;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
&--invalid {
|
|
289
|
-
color: palette.$cherry600;
|
|
290
|
-
|
|
291
|
-
&:hover {
|
|
292
|
-
background-color: palette.$cherry100;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
&:active {
|
|
296
|
-
color: palette.$black;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
&:focus {
|
|
300
|
-
color: palette.$black;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
&:checked {
|
|
304
|
-
color: palette.$cherry600;
|
|
305
|
-
|
|
306
|
-
&:hover {
|
|
307
|
-
background-color: palette.$cherry100;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
&--disabled {
|
|
313
|
-
cursor: default;
|
|
314
|
-
|
|
315
|
-
@include dashed-border;
|
|
316
|
-
|
|
317
|
-
background-color: transparent;
|
|
318
|
-
|
|
319
|
-
&:hover {
|
|
320
|
-
box-shadow: none;
|
|
321
|
-
background-color: transparent;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
:hover > & {
|
|
325
|
-
background-color: transparent;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
&:active {
|
|
329
|
-
color: palette.$neutral600;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
&:checked {
|
|
333
|
-
color: palette.$neutral600;
|
|
334
|
-
|
|
335
|
-
&:hover {
|
|
336
|
-
box-shadow: none;
|
|
337
|
-
background-color: transparent;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
// :before er dot i RadioButton
|
|
343
|
-
&:checked::before {
|
|
344
|
-
content: '';
|
|
345
|
-
display: flex;
|
|
346
|
-
background-color: palette.$blueberry500;
|
|
347
|
-
width: 0.875rem;
|
|
348
|
-
height: 0.875rem;
|
|
349
|
-
border-radius: 10rem;
|
|
350
|
-
|
|
351
|
-
// Vi overstyrer farger satt ved high-contrast mode i nettleser/os
|
|
352
|
-
@media (forced-colors: active) {
|
|
353
|
-
forced-color-adjust: none;
|
|
354
|
-
background-color: #fff !important;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
&--on-dark:checked::before {
|
|
359
|
-
background-color: palette.$blueberry200;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
&--invalid:checked::before {
|
|
363
|
-
background-color: palette.$cherry600;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
&--disabled:checked::before {
|
|
367
|
-
background-color: palette.$neutral600;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
&__large {
|
|
371
|
-
&:checked {
|
|
372
|
-
outline: none;
|
|
373
|
-
color: palette.$blueberry100;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
&:hover {
|
|
377
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
&:focus {
|
|
381
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
382
|
-
color: palette.$black;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
&:focus:checked {
|
|
386
|
-
color: palette.$white;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
&:checked::before {
|
|
390
|
-
background-color: palette.$blueberry100;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
&:checked:hover {
|
|
394
|
-
box-shadow: 0 0 0 spacers.getSpacer(4xs);
|
|
395
|
-
background-color: unset;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
&:checked:hover:focus {
|
|
399
|
-
box-shadow: 0 0 0 spacers.getSpacer(3xs);
|
|
400
|
-
color: palette.$white;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
&--invalid {
|
|
404
|
-
&:checked {
|
|
405
|
-
color: palette.$cherry500;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
&:checked::before {
|
|
409
|
-
background-color: palette.$cherry500;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
&:checked:hover {
|
|
413
|
-
background-color: transparent;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
&:checked:focus {
|
|
417
|
-
color: palette.$black;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
&:checked:focus:hover {
|
|
421
|
-
color: palette.$black;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
&--disabled {
|
|
426
|
-
&:hover,
|
|
427
|
-
&:focus,
|
|
428
|
-
&:checked:hover {
|
|
429
|
-
box-shadow: none;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
&:checked::before {
|
|
433
|
-
background-color: palette.$neutral600;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
177
|
+
@include sr-only;
|
|
178
|
+
}
|
|
437
179
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
forced-color-adjust: none;
|
|
441
|
-
color: #fff !important;
|
|
442
|
-
background-color: transparent !important;
|
|
443
|
-
}
|
|
180
|
+
.radio-button__marker-wrapper {
|
|
181
|
+
margin-right: spacers.getSpacer(s);
|
|
444
182
|
}
|
|
445
183
|
|
|
446
184
|
.radiobutton-sublabel-wrapper {
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
export type Styles = {
|
|
2
2
|
'radio-button': string;
|
|
3
|
-
'radio-
|
|
4
|
-
'radio-button__large--disabled': string;
|
|
5
|
-
'radio-button__large--invalid': string;
|
|
6
|
-
'radio-button--disabled': string;
|
|
7
|
-
'radio-button--invalid': string;
|
|
8
|
-
'radio-button--on-blueberry': string;
|
|
9
|
-
'radio-button--on-dark': string;
|
|
3
|
+
'radio-button__marker-wrapper': string;
|
|
10
4
|
'radio-button-errors': string;
|
|
11
5
|
'radio-button-label': string;
|
|
12
6
|
'radio-button-label__large': string;
|
|
13
7
|
'radio-button-label__large--disabled': string;
|
|
14
|
-
'radio-button-label__large--focused': string;
|
|
15
8
|
'radio-button-label__large--on-blueberry': string;
|
|
16
9
|
'radio-button-label__large--on-grey': string;
|
|
17
10
|
'radio-button-label__large--selected': string;
|
|
@@ -21,7 +14,6 @@ export type Styles = {
|
|
|
21
14
|
'radio-button-label--on-dark': string;
|
|
22
15
|
'radio-button-wrapper': string;
|
|
23
16
|
'radio-button-wrapper__large': string;
|
|
24
|
-
'radio-button-wrapper__large--focused': string;
|
|
25
17
|
'radio-button-wrapper__large--invalid': string;
|
|
26
18
|
'radio-button-wrapper__large--on-blueberry': string;
|
|
27
19
|
'radio-button-wrapper__large--selected': string;
|
|
@@ -5,7 +5,7 @@ import { t as useIsVisible } from "../../useIsVisible.js";
|
|
|
5
5
|
import { t as useLayoutEvent } from "../../useLayoutEvent.js";
|
|
6
6
|
import { t as HorizontalScroll_default } from "../../HorizontalScroll.js";
|
|
7
7
|
import { a as TextAlign, i as SortDirection, n as ModeType, o as defaultConfig, r as ResponsiveTableVariant, s as simpleConfig, t as HeaderCategory } from "../../constants3.js";
|
|
8
|
-
import { a as omitProps, i as mapChildrenWithMode, n as getCenteredOverflowTableStyle, r as getCurrentConfig, t as getBreakpointClass } from "../../
|
|
8
|
+
import { a as omitProps, i as mapChildrenWithMode, n as getCenteredOverflowTableStyle, r as getCurrentConfig, t as getBreakpointClass } from "../../utils5.js";
|
|
9
9
|
import { n as TableBody } from "../../TableBody.js";
|
|
10
10
|
import { n as TableCell } from "../../TableCell.js";
|
|
11
11
|
import { n as TableExpandedRow } from "../../TableExpandedRow.js";
|
|
@@ -9,7 +9,7 @@ import { t as Textarea_default } from "../../Textarea.js";
|
|
|
9
9
|
import { n as FormGroup_default } from "../../FormGroup.js";
|
|
10
10
|
import { t as Input_default } from "../../Input2.js";
|
|
11
11
|
import { t as List_default } from "../../List.js";
|
|
12
|
-
import { t as RadioButton_default } from "../../
|
|
12
|
+
import { t as RadioButton_default } from "../../RadioButton2.js";
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import React, { useId } from "react";
|
|
15
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ErrorWrapperClassNameProps } from '../../ErrorWrapper';
|
|
2
|
+
export interface CheckboxProps extends ErrorWrapperClassNameProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'id' | 'className' | 'children' | 'size'> {
|
|
3
|
+
/** Adds custom classes to the root element. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Label text shown inside the pill. */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** input id of the underlying checkbox */
|
|
8
|
+
inputId?: string;
|
|
9
|
+
/** Activates error styling. Can be true while errorText is empty (e.g. when used in a FormGroup). */
|
|
10
|
+
error?: boolean;
|
|
11
|
+
/** Error text to show above the component. */
|
|
12
|
+
errorText?: string;
|
|
13
|
+
/** Error text id */
|
|
14
|
+
errorTextId?: string;
|
|
15
|
+
/** Sets the data-testid attribute. */
|
|
16
|
+
testId?: string;
|
|
17
|
+
/** Ref forwarded to the underlying input element. */
|
|
18
|
+
ref?: React.Ref<HTMLInputElement | null>;
|
|
19
|
+
}
|
|
20
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
|
21
|
+
export default Checkbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/VisualCheckboxCloud/Checkbox/index.ts"],"sourcesContent":["import Checkbox from './Checkbox';\nexport * from './Checkbox';\nexport default Checkbox;\n"],"mappings":";AAEA,IAAA,mBAAe"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@use '../../../scss/visual-form' as visual-form;
|
|
2
|
+
@import '../../../scss/supernova/styles/colors.css';
|
|
3
|
+
@import '../../../scss/supernova/styles/spacers.css';
|
|
4
|
+
|
|
5
|
+
.visual-checkbox {
|
|
6
|
+
@include visual-form.visual-form-pill(
|
|
7
|
+
$pill-padding-mobile: var(--core-space-3xs) 1.75rem,
|
|
8
|
+
$checked-pill-padding-md: var(--core-space-3xs) 1.25rem
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
'visual-checkbox': string;
|
|
3
|
+
'visual-checkbox__icon': string;
|
|
4
|
+
'visual-checkbox__input': string;
|
|
5
|
+
'visual-checkbox__label': string;
|
|
6
|
+
'visual-checkbox__pill': string;
|
|
7
|
+
'visual-checkbox--checked': string;
|
|
8
|
+
'visual-checkbox--invalid': string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type ClassNames = keyof Styles;
|
|
12
|
+
|
|
13
|
+
declare const styles: Styles;
|
|
14
|
+
|
|
15
|
+
export default styles;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as Checkbox } from './Checkbox/Checkbox';
|
|
3
|
+
export interface VisualCheckboxCloudProps {
|
|
4
|
+
/** Items in the cloud. Should be VisualCheckboxCloud.Checkbox elements. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Name shared by all child Checkbox elements (overridable per child) */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Error message shown above the cloud */
|
|
9
|
+
error?: string;
|
|
10
|
+
/** Error text id (auto-generated if omitted) */
|
|
11
|
+
errorTextId?: string;
|
|
12
|
+
/** Renders the error component (Default: true) */
|
|
13
|
+
renderError?: boolean;
|
|
14
|
+
/** Ref passed to the error message element */
|
|
15
|
+
errorMessageRef?: React.Ref<HTMLDivElement | null>;
|
|
16
|
+
/** Adds custom classes to the root element. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Adds custom classes to the errorWrapper */
|
|
19
|
+
errorWrapperClassName?: string;
|
|
20
|
+
/** Sets the data-testid attribute. */
|
|
21
|
+
testId?: string;
|
|
22
|
+
/** Sets the data-testid attribute for the error wrapper */
|
|
23
|
+
errorWrapperTestId?: string;
|
|
24
|
+
}
|
|
25
|
+
interface VisualCheckboxCloudComponent extends React.FC<VisualCheckboxCloudProps> {
|
|
26
|
+
Checkbox: typeof Checkbox;
|
|
27
|
+
}
|
|
28
|
+
export declare const VisualCheckboxCloud: VisualCheckboxCloudComponent;
|
|
29
|
+
export default VisualCheckboxCloud;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as isComponent } from "../../component.js";
|
|
2
|
+
import { t as useIdWithFallback } from "../../useIdWithFallback.js";
|
|
3
|
+
import { t as ErrorWrapper_default } from "../../ErrorWrapper.js";
|
|
4
|
+
import { t as Checkbox_default } from "../../Checkbox3.js";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import styles from "./styles.module.scss";
|
|
9
|
+
const VisualCheckboxCloud = (props) => {
|
|
10
|
+
const { children, name, error, errorTextId: errorTextIdProp, renderError = true, errorMessageRef, className, errorWrapperClassName, testId, errorWrapperTestId } = props;
|
|
11
|
+
const errorTextId = useIdWithFallback(errorTextIdProp);
|
|
12
|
+
const mapChild = (child) => {
|
|
13
|
+
if (isComponent(child, Checkbox_default)) return React.cloneElement(child, {
|
|
14
|
+
name: child.props.name ?? name,
|
|
15
|
+
error: !!error || child.props.error,
|
|
16
|
+
errorTextId: child.props.errorTextId ?? errorTextId
|
|
17
|
+
});
|
|
18
|
+
return child;
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsx(ErrorWrapper_default, {
|
|
21
|
+
className: classNames(errorWrapperClassName, className),
|
|
22
|
+
errorText: error,
|
|
23
|
+
errorTextId,
|
|
24
|
+
renderError,
|
|
25
|
+
errorMessageRef,
|
|
26
|
+
testId: errorWrapperTestId,
|
|
27
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
28
|
+
className: styles["visual-checkbox-cloud"],
|
|
29
|
+
"data-testid": testId,
|
|
30
|
+
children: React.Children.map(children, mapChild)
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
VisualCheckboxCloud.Checkbox = Checkbox_default;
|
|
35
|
+
var VisualCheckboxCloud_default = VisualCheckboxCloud;
|
|
36
|
+
export { VisualCheckboxCloud, VisualCheckboxCloud_default as default };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["VisualCheckboxCloud: VisualCheckboxCloudComponent"],"sources":["../../../src/components/VisualCheckboxCloud/VisualCheckboxCloud.tsx","../../../src/components/VisualCheckboxCloud/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { CheckboxProps } from './Checkbox/Checkbox';\n\nimport Checkbox from './Checkbox/Checkbox';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { isComponent } from '../../utils/component';\nimport ErrorWrapper from '../ErrorWrapper';\n\nimport styles from './styles.module.scss';\n\nexport interface VisualCheckboxCloudProps {\n /** Items in the cloud. Should be VisualCheckboxCloud.Checkbox elements. */\n children?: React.ReactNode;\n /** Name shared by all child Checkbox elements (overridable per child) */\n name?: string;\n /** Error message shown above the cloud */\n error?: string;\n /** Error text id (auto-generated if omitted) */\n errorTextId?: string;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n /** Adds custom classes to the root element. */\n className?: string;\n /** Adds custom classes to the errorWrapper */\n errorWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error wrapper */\n errorWrapperTestId?: string;\n}\n\ninterface VisualCheckboxCloudComponent extends React.FC<VisualCheckboxCloudProps> {\n Checkbox: typeof Checkbox;\n}\n\nexport const VisualCheckboxCloud: VisualCheckboxCloudComponent = props => {\n const {\n children,\n name,\n error,\n errorTextId: errorTextIdProp,\n renderError = true,\n errorMessageRef,\n className,\n errorWrapperClassName,\n testId,\n errorWrapperTestId,\n } = props;\n\n const errorTextId = useIdWithFallback(errorTextIdProp);\n\n const mapChild = (child: React.ReactNode): React.ReactNode => {\n if (isComponent<CheckboxProps>(child, Checkbox)) {\n return React.cloneElement(child, {\n name: child.props.name ?? name,\n error: !!error || child.props.error,\n errorTextId: child.props.errorTextId ?? errorTextId,\n });\n }\n return child;\n };\n\n return (\n <ErrorWrapper\n className={classNames(errorWrapperClassName, className)}\n errorText={error}\n errorTextId={errorTextId}\n renderError={renderError}\n errorMessageRef={errorMessageRef}\n testId={errorWrapperTestId}\n >\n <div className={styles['visual-checkbox-cloud']} data-testid={testId}>\n {React.Children.map(children, mapChild)}\n </div>\n </ErrorWrapper>\n );\n};\n\nVisualCheckboxCloud.Checkbox = Checkbox;\n\nexport default VisualCheckboxCloud;\n","import VisualCheckboxCloud from './VisualCheckboxCloud';\nexport * from './VisualCheckboxCloud';\nexport default VisualCheckboxCloud;\n"],"mappings":";;;;;;;;AAwCA,MAAaA,uBAAoD,UAAS;CACxE,MAAM,EACJ,UACA,MACA,OACA,aAAa,iBACb,cAAc,MACd,iBACA,WACA,uBACA,QACA,uBACE;CAEJ,MAAM,cAAc,kBAAkB,gBAAgB;CAEtD,MAAM,YAAY,UAA4C;AAC5D,MAAI,YAA2B,OAAO,iBAAS,CAC7C,QAAO,MAAM,aAAa,OAAO;GAC/B,MAAM,MAAM,MAAM,QAAQ;GAC1B,OAAO,CAAC,CAAC,SAAS,MAAM,MAAM;GAC9B,aAAa,MAAM,MAAM,eAAe;GACzC,CAAC;AAEJ,SAAO;;AAGT,QACE,oBAAC,sBAAA;EACC,WAAW,WAAW,uBAAuB,UAAU;EACvD,WAAW;EACE;EACA;EACI;EACjB,QAAQ;YAER,oBAAC,OAAA;GAAI,WAAW,OAAO;GAA0B,eAAa;aAC3D,MAAM,SAAS,IAAI,UAAU,SAAS;IACnC;GACO;;AAInB,oBAAoB,WAAW;ACjF/B,IAAA,8BDmFe"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ErrorWrapperClassNameProps } from '../../ErrorWrapper';
|
|
2
|
+
export type VisualCheckboxVariant = 'line' | 'rectangle';
|
|
3
|
+
export interface VisualCheckboxProps extends ErrorWrapperClassNameProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'id' | 'className' | 'children' | 'size'> {
|
|
4
|
+
/** Adds custom classes to the root element. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Label rendered inside the checkbox frame. */
|
|
7
|
+
children: string;
|
|
8
|
+
/** Content rendered inside the circular visual slot. */
|
|
9
|
+
visualContent: React.ReactNode;
|
|
10
|
+
/** Layout variant. `line` is a thin horizontal pill, `rectangle` is a vertical card. */
|
|
11
|
+
variant?: VisualCheckboxVariant;
|
|
12
|
+
/** input id of the underlying checkbox */
|
|
13
|
+
inputId?: string;
|
|
14
|
+
/** Activates error styling. Can be true while errorText is empty (e.g. when used in a FormGroup). */
|
|
15
|
+
error?: boolean;
|
|
16
|
+
/** Error text to show above the component. */
|
|
17
|
+
errorText?: string;
|
|
18
|
+
/** Error text id */
|
|
19
|
+
errorTextId?: string;
|
|
20
|
+
/** Sets the data-testid attribute. */
|
|
21
|
+
testId?: string;
|
|
22
|
+
/** Ref forwarded to the underlying input element. */
|
|
23
|
+
ref?: React.Ref<HTMLInputElement | null>;
|
|
24
|
+
}
|
|
25
|
+
declare const VisualCheckbox: React.FC<VisualCheckboxProps>;
|
|
26
|
+
export default VisualCheckbox;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface VisualContentProps {
|
|
2
|
+
/** Content rendered inside the circular area – typically an <img> or illustration component. */
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/** Adds custom classes to the root element. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Sets the data-testid attribute. */
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const VisualContent: React.FC<VisualContentProps>;
|
|
10
|
+
export default VisualContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/VisualCheckboxGroup/VisualCheckbox/index.ts"],"sourcesContent":["import VisualCheckbox from './VisualCheckbox';\nexport * from './VisualCheckbox';\nexport default VisualCheckbox;\n"],"mappings":";AAEA,IAAA,yBAAe"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
'visual-checkbox': string;
|
|
3
|
+
'visual-checkbox__frame': string;
|
|
4
|
+
'visual-checkbox__icon': string;
|
|
5
|
+
'visual-checkbox__input': string;
|
|
6
|
+
'visual-checkbox__label': string;
|
|
7
|
+
'visual-checkbox__visual-content': string;
|
|
8
|
+
'visual-checkbox--checked': string;
|
|
9
|
+
'visual-checkbox--invalid': string;
|
|
10
|
+
'visual-checkbox--variant-line': string;
|
|
11
|
+
'visual-checkbox--variant-rectangle': string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type ClassNames = keyof Styles;
|
|
15
|
+
|
|
16
|
+
declare const styles: Styles;
|
|
17
|
+
|
|
18
|
+
export default styles;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VisualCheckboxVariant, default as VisualCheckbox } from './VisualCheckbox/VisualCheckbox';
|
|
3
|
+
export interface VisualCheckboxGroupProps {
|
|
4
|
+
/** Items in the group. Should be VisualCheckboxGroup.VisualCheckbox elements. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Name shared by all child VisualCheckbox elements (overridable per child) */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Variant applied to all child VisualCheckbox elements (overridable per child). */
|
|
9
|
+
variant?: VisualCheckboxVariant;
|
|
10
|
+
/** When set and the number of VisualCheckbox children exceeds this limit on the mobile breakpoint, the variant is forced to `line`. */
|
|
11
|
+
mobileLineVariantLimit?: number;
|
|
12
|
+
/** Error message shown above the group */
|
|
13
|
+
error?: string;
|
|
14
|
+
/** Error text id (auto-generated if omitted) */
|
|
15
|
+
errorTextId?: string;
|
|
16
|
+
/** Renders the error component (Default: true) */
|
|
17
|
+
renderError?: boolean;
|
|
18
|
+
/** Ref passed to the error message element */
|
|
19
|
+
errorMessageRef?: React.Ref<HTMLDivElement | null>;
|
|
20
|
+
/** Adds custom classes to the root element. */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** Adds custom classes to the errorWrapper */
|
|
23
|
+
errorWrapperClassName?: string;
|
|
24
|
+
/** Sets the data-testid attribute. */
|
|
25
|
+
testId?: string;
|
|
26
|
+
/** Sets the data-testid attribute for the error wrapper */
|
|
27
|
+
errorWrapperTestId?: string;
|
|
28
|
+
}
|
|
29
|
+
interface VisualCheckboxGroupComponent extends React.FC<VisualCheckboxGroupProps> {
|
|
30
|
+
VisualCheckbox: typeof VisualCheckbox;
|
|
31
|
+
}
|
|
32
|
+
export declare const VisualCheckboxGroup: VisualCheckboxGroupComponent;
|
|
33
|
+
export default VisualCheckboxGroup;
|