@miljodirektoratet/md-css 3.6.0 → 3.6.2
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/package.json
CHANGED
|
@@ -11,24 +11,15 @@ See [Storybook](https://miljodir.github.io/md-components) for examples and more
|
|
|
11
11
|
<div className="md-radiogroup__label">
|
|
12
12
|
<div>{label}</div>
|
|
13
13
|
|
|
14
|
-
<div className="md-
|
|
14
|
+
<div className="md-radiogroup_help-button"><MdHelpButton /> <- see MdHelpButton styles</div>
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
|
-
<div className="md-
|
|
17
|
+
<div className="md-radiogroup_help-text [md-radiogroup_help-text--open]">
|
|
18
18
|
<MdHelpText>{ helpText }</MdHelpText> <- see MdHelpText styles
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
<div className="md-radiogroup__options [md-radiogroup__options--vertical]">
|
|
22
|
-
|
|
23
|
-
<span className="md-radiogroup-option__check-area" id="">
|
|
24
|
-
<!-- if selected option -->
|
|
25
|
-
<span className="md-radiogroup-option__selected-dot"></span>
|
|
26
|
-
</span>
|
|
27
|
-
<input id="" type="radio" value="some value" checked={true/false} onChange={handleChange} disabled={true/false}
|
|
28
|
-
onFocus={handleFocus} onBlur={handleBlur} />
|
|
29
|
-
<span className="md-radiogroup-option__text"> {option.text} </span>
|
|
30
|
-
</label>
|
|
31
|
-
... ...
|
|
22
|
+
<MdRadioButton/> <- see MdRadioButton styles
|
|
32
23
|
</div>
|
|
33
24
|
|
|
34
25
|
<!-- if error -->
|
|
@@ -5,40 +5,40 @@
|
|
|
5
5
|
padding: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.md-
|
|
8
|
+
.md-radiogroup__label {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
font-weight: 600;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.md-
|
|
14
|
+
.md-radiogroup__label > * + * {
|
|
15
15
|
margin-left: 1em;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.md-
|
|
18
|
+
.md-radiogroup__help-text {
|
|
19
19
|
max-height: 0;
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
transition: max-height 0.15s ease-out;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.md-
|
|
24
|
+
.md-radiogroup__help-text--open {
|
|
25
25
|
padding-top: 0.5em;
|
|
26
26
|
max-height: 2000px;
|
|
27
27
|
transition: max-height 0.5s ease-in;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.md-
|
|
30
|
+
.md-radiogroup__options {
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: row;
|
|
33
33
|
gap: 1em;
|
|
34
34
|
margin: 0.7em 0;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.md-
|
|
37
|
+
.md-radiogroup__options--vertical {
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.md-radiogroup
|
|
41
|
+
.md-radiogroup-option {
|
|
42
42
|
margin-right: 1.2rem;
|
|
43
43
|
display: flex;
|
|
44
44
|
align-items: center;
|
|
@@ -46,62 +46,13 @@
|
|
|
46
46
|
position: relative;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.md-
|
|
49
|
+
.md-radiogroup__options--vertical .md-radiogroup-option {
|
|
50
50
|
margin-bottom: 1em;
|
|
51
51
|
}
|
|
52
|
-
.md-
|
|
52
|
+
.md-radiogroup__options--vertical .md-radiogroup-option:last-child {
|
|
53
53
|
margin-bottom: 0.2em;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.md-radiogroup .md-radiogroup-option:focus-within {
|
|
57
|
-
outline: 2px solid var(--mdPrimaryColor);
|
|
58
|
-
outline-offset: 2px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.md-radiogroup .md-radiogroup-option:hover {
|
|
62
|
-
text-decoration: underline;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.md-radiogroup .md-radiogroup-option input[type='radio'] {
|
|
66
|
-
position: absolute;
|
|
67
|
-
left: 0;
|
|
68
|
-
opacity: 0;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.md-radiogroup .md-radiogroup-option__check-area {
|
|
73
|
-
width: 1.45rem;
|
|
74
|
-
height: 1.45rem;
|
|
75
|
-
display: block;
|
|
76
|
-
background-color: #fff;
|
|
77
|
-
border: 1px solid var(--mdPrimaryColor);
|
|
78
|
-
border-radius: 50%;
|
|
79
|
-
margin: 0 0.5rem 0 0;
|
|
80
|
-
box-sizing: border-box;
|
|
81
|
-
position: relative;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.md-radiogroup:not(.md-radiogroup--disabled) .md-radiogroup-option:focus-within .md-radiogroup-option__check-area,
|
|
85
|
-
.md-radiogroup:not(.md-radiogroup--disabled) .md-radiogroup-option:hover .md-radiogroup-option__check-area {
|
|
86
|
-
background-color: var(--mdPrimaryColor20);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.md-radiogroup .md-radiogroup-option__selected-dot {
|
|
90
|
-
width: 0.6em;
|
|
91
|
-
height: 0.6em;
|
|
92
|
-
display: block;
|
|
93
|
-
background-color: var(--mdPrimaryColor);
|
|
94
|
-
border-radius: 50%;
|
|
95
|
-
margin: 0 auto;
|
|
96
|
-
position: absolute;
|
|
97
|
-
left: 0;
|
|
98
|
-
right: 0;
|
|
99
|
-
top: 50%;
|
|
100
|
-
transform: translateY(-50%);
|
|
101
|
-
opacity: 0;
|
|
102
|
-
animation: fadeIn 0.3s ease-out 1 forwards;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
56
|
.md-radiogroup__error {
|
|
106
57
|
color: var(--mdErrorColor);
|
|
107
58
|
font-size: 0.88em;
|
|
@@ -122,13 +73,13 @@
|
|
|
122
73
|
|
|
123
74
|
/* Media */
|
|
124
75
|
@media (max-width: 768px) {
|
|
125
|
-
.md-
|
|
76
|
+
.md-radiogroup__options {
|
|
126
77
|
flex-wrap: wrap;
|
|
127
78
|
}
|
|
128
|
-
.md-radiogroup
|
|
79
|
+
.md-radiogroup-option {
|
|
129
80
|
margin-bottom: 0.5em;
|
|
130
81
|
}
|
|
131
|
-
.md-
|
|
82
|
+
.md-radiogroup__help-text {
|
|
132
83
|
width: 100%;
|
|
133
84
|
}
|
|
134
85
|
}
|