@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.1.7",
3
+ "version": "11.1.8-beta.0",
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,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
- activeColor={themeValues.activeColor}
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={themeValues.activeColor}
109
- inactiveBorderColor={themeValues.inactiveBorderColor}
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 { 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; // or GREY_CHATEAU?
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
  };