@thecb/components 5.2.1 → 5.3.3-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": "5.2.1",
3
+ "version": "5.3.3-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -124,7 +124,7 @@ const ButtonWithAction = ({
124
124
  activeStyles={activeStyles}
125
125
  disabledStyles={disabledStyles}
126
126
  as="button"
127
- onClick={!isLoading && action}
127
+ onClick={isLoading ? undefined : action}
128
128
  borderRadius="2px"
129
129
  theme={themeContext}
130
130
  extraStyles={`margin: 0.5rem; ${extraStyles}`}
@@ -11,15 +11,10 @@ const DropdownIcon = () => (
11
11
  width="12"
12
12
  >
13
13
  <g transform="translate(1 1)">
14
- <g fillRule="evenodd" fill="none" id="Symbols_1548197283918">
15
- <g
16
- fill="#333"
17
- transform="translate(-155 -22)"
18
- id="Dropdown/Closed_1548197283918"
19
- >
14
+ <g fillRule="evenodd" fill="none">
15
+ <g fill="#333" transform="translate(-155 -22)">
20
16
  <polygon
21
17
  points="165.59 22.59 161 27.17 156.41 22.59 155 24 161 30 167 24"
22
- id="Path_1548197283918"
23
18
  vectorEffect="non-scaling-stroke"
24
19
  />
25
20
  </g>
@@ -13,7 +13,9 @@ import { CHARADE_GREY, ASH_GREY, FIRE_YELLOW } from "../../../constants/colors";
13
13
  {
14
14
  title: <React Component(s)>,
15
15
  id: <String> "identifier of section",
16
- disabled: boolean,
16
+ disabled: boolean, (displays section and grayed out radio but disables interaction)
17
+ hideRadioButton: boolean, (keeps section displayed but hides radio and disables open/close function),
18
+ hidden: boolean, (hides section entirely)
17
19
  dataQa: string,
18
20
  content: <React Component(s)> e.g.: <Box><Stack>cool content stuff</Stack></Box> (any collection of components will work)
19
21
  }
@@ -141,7 +143,7 @@ const RadioSection = ({
141
143
  .filter(section => !section.hidden)
142
144
  .map(section => (
143
145
  <Motion
144
- tabIndex="0"
146
+ tabIndex={section.hideRadioButton ? "-1" : "0"}
145
147
  onKeyDown={e => handleKeyDown(section.id, e)}
146
148
  onFocus={() => setFocused(section.id)}
147
149
  onBlur={() => setFocused(null)}
@@ -47,11 +47,6 @@ const TermsAndConditionsModal = ({
47
47
  color={themeValues.linkColor}
48
48
  weight={themeValues.fontWeight}
49
49
  hoverStyles={themeValues.modalLinkHoverFocus}
50
- extraStyles={`cursor: pointer;
51
- &:focus {
52
- outline: 3px solid ${themeValues.accessibilityColor};
53
- outline-offset: 2px;
54
- }`}
55
50
  >
56
51
  {link}
57
52
  </Text>
@@ -12,11 +12,20 @@ const fontWeight = {
12
12
  default: FONT_WEIGHT_REGULAR,
13
13
  footer: FONT_WEIGHT_SEMIBOLD
14
14
  };
15
+ const standardInteractionStyles = `
16
+ &:hover {
17
+ outline: none;
18
+ text-decoration: underline;
19
+ }
20
+ &:focus {
21
+ outline: 3px solid #3181E3;
22
+ outline-offset: 2px;
23
+ }
24
+ `;
15
25
  const modalLinkHoverFocus = {
16
- default: `outline: none; text-decoration: underline;`,
17
- footer: `outline: none; text-decoration: underline;`
26
+ default: standardInteractionStyles,
27
+ footer: standardInteractionStyles
18
28
  };
19
- const accessibilityColor = { default: "#3181E3", footer: "#3181E3" };
20
29
 
21
30
  export const fallbackValues = {
22
31
  backgroundColor,
@@ -25,6 +34,5 @@ export const fallbackValues = {
25
34
  fontSize,
26
35
  lineHeight,
27
36
  fontWeight,
28
- modalLinkHoverFocus,
29
- accessibilityColor
37
+ modalLinkHoverFocus
30
38
  };