@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.1.7",
3
+ "version": "11.1.8",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
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: ${({ inactiveBorderColor }) => `1px solid ${inactiveBorderColor}`};
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: ${({ activeColor }) => `1px solid ${activeColor};`}
44
+ border: ${({ borderColor }) => `1px solid ${borderColor};`}
45
45
  }
46
46
  ${HiddenRadioInput}:focus + label ${Circle} { {
47
- box-shadow: ${({ activeColor }) => `0px 0px 2px 1px ${activeColor};`}
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
- activeColor={themeValues.activeColor}
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={themeValues.activeColor}
109
- inactiveBorderColor={themeValues.inactiveBorderColor}
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 { GREY_CHATEAU, MATISSE_BLUE } from "../../../constants/colors";
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
- inactiveBorderColor,
7
- activeColor
11
+ activeColor,
12
+ disabledColor,
13
+ inactiveBorderColor
8
14
  };