@@ -13,27 +13,41 @@ const ColorInputs = ({
13
13
onColorChange,
14
14
error,
15
15
alternative,
16
- contrasts ,
16
+ contrastGroups ,
17
17
} : ColorInputsType ) => {
18
18
const { t } = useTranslation ( ) ;
19
19
return (
20
20
< >
21
21
< DBDivider />
22
- < p className = "font-bold" > { name } </ p >
23
- < div className = "flex flex-wrap gap-fix-sm" >
24
- { contrasts ?. map ( ( contrast , index ) => (
25
- < DBInfotext
26
- key = { `${ name } -contrast-${ index } ` }
27
- semantic = {
28
- contrast . value < ( contrast . min ?? 3 ) ? "critical" : "successful"
29
- }
30
- size = "small"
31
- >
32
- { contrast . name ? `${ contrast . name } : ` : "" }
33
- { contrast . value . toFixed ( 2 ) } :1
34
- </ DBInfotext >
35
- ) ) }
36
- </ div >
22
+ < span className = "font-bold" > { name } </ span >
23
+ { contrastGroups ?. map ( ( contrastGroup , indexGroup ) => (
24
+ < div
25
+ className = "flex flex-col gap-fix-2xs"
26
+ key = { `${ name } -contrast-group-${ indexGroup } ` }
27
+ >
28
+ { contrastGroup . groupName && (
29
+ < small className = "text-adaptive-on-basic-emphasis-80-default" >
30
+ { contrastGroup . groupName }
31
+ </ small >
32
+ ) }
33
+ < div className = "flex flex-wrap gap-fix-sm" >
34
+ { contrastGroup . contrasts . map ( ( contrast , index ) => (
35
+ < DBInfotext
36
+ key = { `${ name } -contrast-${ index } ` }
37
+ semantic = {
38
+ contrast . value < ( contrast . min ?? 3 )
39
+ ? "critical"
40
+ : "successful"
41
+ }
42
+ size = "small"
43
+ >
44
+ { contrast . name ? `${ contrast . name } : ` : "" }
45
+ { contrast . value . toFixed ( 2 ) } :1
46
+ </ DBInfotext >
47
+ ) ) }
48
+ </ div >
49
+ </ div >
50
+ ) ) }
37
51
< div className = "grid grid-cols-2 gap-fix-md" >
38
52
< DBInput
39
53
label = { t ( "colorInputPicker" ) }
0 commit comments