@thecb/components 11.1.7 → 11.1.8-beta.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/dist/index.cjs.js +22 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +22 -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 +15 -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,9 @@ 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,
|
|
64
|
+
title = ""
|
|
63
65
|
}) => {
|
|
64
66
|
const getDefaultChecked = (value, idx) => {
|
|
65
67
|
const selectionExistsInConfig = config
|
|
@@ -77,9 +79,13 @@ const RadioButtonWithLabel = ({
|
|
|
77
79
|
<InputAndLabelContainer
|
|
78
80
|
align="center"
|
|
79
81
|
childGap="0.5rem"
|
|
80
|
-
|
|
82
|
+
borderColor={
|
|
83
|
+
disabled ? themeValues.inactiveBorderColor : themeValues.activeColor
|
|
84
|
+
}
|
|
85
|
+
title={title}
|
|
81
86
|
>
|
|
82
87
|
<HiddenRadioInput
|
|
88
|
+
disabled={disabled}
|
|
83
89
|
aria-invalid={ariaInvalid}
|
|
84
90
|
style={{ marginTop: 0 }}
|
|
85
91
|
type="radio"
|
|
@@ -105,8 +111,10 @@ const RadioButtonWithLabel = ({
|
|
|
105
111
|
`}
|
|
106
112
|
>
|
|
107
113
|
<Circle
|
|
108
|
-
activeColor={
|
|
109
|
-
|
|
114
|
+
activeColor={
|
|
115
|
+
disabled ? themeValues.disabledColor : themeValues.activeColor
|
|
116
|
+
}
|
|
117
|
+
borderColor={themeValues.inactiveBorderColor}
|
|
110
118
|
/>
|
|
111
119
|
{labelText}
|
|
112
120
|
</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; // or GREY_CHATEAU?
|
|
3
8
|
const inactiveBorderColor = GREY_CHATEAU;
|
|
4
9
|
|
|
5
10
|
export const fallbackValues = {
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
activeColor,
|
|
12
|
+
disabledColor,
|
|
13
|
+
inactiveBorderColor
|
|
8
14
|
};
|