@thecb/components 11.1.7 → 11.1.8
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.cjs.js +19 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +13 -7
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.theme.js +9 -3
package/package.json
CHANGED
|
Binary file
|
|
@@ -19,7 +19,7 @@ const Circle = styled.div`
|
|
|
19
19
|
margin-right: 8px;
|
|
20
20
|
width: 1.5rem;
|
|
21
21
|
height 1.5rem;
|
|
22
|
-
border: ${({
|
|
22
|
+
border: ${({ borderColor }) => `1px solid ${borderColor}`};
|
|
23
23
|
border-radius: 50%;
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
padding: 2px;
|
|
@@ -41,10 +41,10 @@ const InputAndLabelContainer = styled(Cluster)`
|
|
|
41
41
|
transition: transform 0.15s;
|
|
42
42
|
}
|
|
43
43
|
${HiddenRadioInput}:checked + label ${Circle} {
|
|
44
|
-
border: ${({
|
|
44
|
+
border: ${({ borderColor }) => `1px solid ${borderColor};`}
|
|
45
45
|
}
|
|
46
46
|
${HiddenRadioInput}:focus + label ${Circle} { {
|
|
47
|
-
box-shadow: ${({
|
|
47
|
+
box-shadow: ${({ borderColor }) => `0px 0px 2px 1px ${borderColor};`}
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
50
|
|
|
@@ -59,7 +59,8 @@ const RadioButtonWithLabel = ({
|
|
|
59
59
|
index,
|
|
60
60
|
handleChange = noop, // optional, for custom event handling in ingesting app
|
|
61
61
|
field,
|
|
62
|
-
config
|
|
62
|
+
config,
|
|
63
|
+
disabled = false
|
|
63
64
|
}) => {
|
|
64
65
|
const getDefaultChecked = (value, idx) => {
|
|
65
66
|
const selectionExistsInConfig = config
|
|
@@ -77,9 +78,12 @@ const RadioButtonWithLabel = ({
|
|
|
77
78
|
<InputAndLabelContainer
|
|
78
79
|
align="center"
|
|
79
80
|
childGap="0.5rem"
|
|
80
|
-
|
|
81
|
+
borderColor={
|
|
82
|
+
disabled ? themeValues.inactiveBorderColor : themeValues.activeColor
|
|
83
|
+
}
|
|
81
84
|
>
|
|
82
85
|
<HiddenRadioInput
|
|
86
|
+
disabled={disabled}
|
|
83
87
|
aria-invalid={ariaInvalid}
|
|
84
88
|
style={{ marginTop: 0 }}
|
|
85
89
|
type="radio"
|
|
@@ -105,8 +109,10 @@ const RadioButtonWithLabel = ({
|
|
|
105
109
|
`}
|
|
106
110
|
>
|
|
107
111
|
<Circle
|
|
108
|
-
activeColor={
|
|
109
|
-
|
|
112
|
+
activeColor={
|
|
113
|
+
disabled ? themeValues.disabledColor : themeValues.activeColor
|
|
114
|
+
}
|
|
115
|
+
borderColor={themeValues.inactiveBorderColor}
|
|
110
116
|
/>
|
|
111
117
|
{labelText}
|
|
112
118
|
</Text>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
GREY_CHATEAU,
|
|
3
|
+
MATISSE_BLUE,
|
|
4
|
+
MANATEE_GREY
|
|
5
|
+
} from "../../../constants/colors";
|
|
2
6
|
const activeColor = MATISSE_BLUE;
|
|
7
|
+
const disabledColor = MANATEE_GREY;
|
|
3
8
|
const inactiveBorderColor = GREY_CHATEAU;
|
|
4
9
|
|
|
5
10
|
export const fallbackValues = {
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
activeColor,
|
|
12
|
+
disabledColor,
|
|
13
|
+
inactiveBorderColor
|
|
8
14
|
};
|