@thecb/components 4.1.31-beta.0 → 4.1.32-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 CHANGED
@@ -21607,8 +21607,7 @@ var PlaceholderContentWrapper = function PlaceholderContentWrapper(_ref) {
21607
21607
  dataQa = _ref.dataQa;
21608
21608
  return isLink ? /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
21609
21609
  to: destination,
21610
- dataQa: dataQa,
21611
- tabIndex: "0"
21610
+ dataQa: dataQa
21612
21611
  }, /*#__PURE__*/React__default.createElement(Box, {
21613
21612
  padding: "0",
21614
21613
  minHeight: "100%",
@@ -21618,8 +21617,7 @@ var PlaceholderContentWrapper = function PlaceholderContentWrapper(_ref) {
21618
21617
  padding: "0",
21619
21618
  minHeight: "100%",
21620
21619
  extraStyles: "cursor: pointer;",
21621
- dataQa: dataQa,
21622
- tabIndex: "0"
21620
+ dataQa: dataQa
21623
21621
  }, children);
21624
21622
  };
21625
21623
 
@@ -21651,7 +21649,11 @@ var Placeholder = function Placeholder(_ref2) {
21651
21649
  }, /*#__PURE__*/React__default.createElement(Center, {
21652
21650
  maxWidth: "300px"
21653
21651
  }, /*#__PURE__*/React__default.createElement(Box, {
21654
- padding: "0px 0px 0px 0px"
21652
+ padding: "0",
21653
+ tabIndex: "0",
21654
+ onKeyPress: function onKeyPress(e) {
21655
+ return e.key === "Enter" && action();
21656
+ }
21655
21657
  }, /*#__PURE__*/React__default.createElement(Cluster, {
21656
21658
  justify: "center",
21657
21659
  align: "center",
@@ -34587,8 +34589,6 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
34587
34589
  };
34588
34590
  return /*#__PURE__*/React__default.createElement(Motion, {
34589
34591
  padding: "0",
34590
- tabIndex: "0",
34591
- onKeyDown: handleKeyDown,
34592
34592
  hoverStyles: "outline: none;",
34593
34593
  animate: isOpen ? "open" : "closed",
34594
34594
  positionTransition: true
@@ -34601,7 +34601,8 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
34601
34601
  onTouchEnd: isMobile && supportsTouch ? toggleSection : noop,
34602
34602
  key: "header",
34603
34603
  hoverStyles: "cursor: pointer;",
34604
- tabIndex: "0"
34604
+ tabIndex: "0",
34605
+ onKeyDown: handleKeyDown
34605
34606
  }, /*#__PURE__*/React__default.createElement(Cluster, {
34606
34607
  justify: "space-between",
34607
34608
  align: "center"
@@ -34743,7 +34744,7 @@ var EditableList = function EditableList(_ref) {
34743
34744
  useModal = _ref$useModal === void 0 ? false : _ref$useModal,
34744
34745
  Modal = _ref.modal,
34745
34746
  modalProps = _ref.modalProps,
34746
- autoPayMethod = _ref.autoPayMethod,
34747
+ autoPayMethods = _ref.autoPayMethods,
34747
34748
  qaPrefix = _ref.qaPrefix;
34748
34749
  return /*#__PURE__*/React__default.createElement(Box, {
34749
34750
  padding: "0rem 0rem 1.5rem 0rem"
@@ -34767,7 +34768,9 @@ var EditableList = function EditableList(_ref) {
34767
34768
  toggleModal = _useState2[1];
34768
34769
 
34769
34770
  return /*#__PURE__*/React__default.createElement(EditableListItem, {
34770
- listItemSize: !!item.id && item.id === autoPayMethod ? "big" : listItemSize,
34771
+ listItemSize: !!item.id && autoPayMethods.some(function (methodID) {
34772
+ return methodID === item.id;
34773
+ }) ? "big" : listItemSize,
34771
34774
  key: item.id || item
34772
34775
  }, /*#__PURE__*/React__default.createElement(Text$1, {
34773
34776
  variant: "p",
@@ -40093,6 +40096,10 @@ var modalLinkHoverFocus$2 = {
40093
40096
  "default": "outline: none; text-decoration: underline;",
40094
40097
  footer: "outline: none; text-decoration: underline;"
40095
40098
  };
40099
+ var accessibilityColor = {
40100
+ "default": "#3181E3",
40101
+ footer: "#3181E3"
40102
+ };
40096
40103
  var fallbackValues$B = {
40097
40104
  backgroundColor: backgroundColor$9,
40098
40105
  linkColor: linkColor$5,
@@ -40100,7 +40107,8 @@ var fallbackValues$B = {
40100
40107
  fontSize: fontSize$a,
40101
40108
  lineHeight: lineHeight$6,
40102
40109
  fontWeight: fontWeight$8,
40103
- modalLinkHoverFocus: modalLinkHoverFocus$2
40110
+ modalLinkHoverFocus: modalLinkHoverFocus$2,
40111
+ accessibilityColor: accessibilityColor
40104
40112
  };
40105
40113
 
40106
40114
  var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
@@ -40150,7 +40158,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
40150
40158
  color: themeValues.linkColor,
40151
40159
  weight: themeValues.fontWeight,
40152
40160
  hoverStyles: themeValues.modalLinkHoverFocus,
40153
- extraStyles: "cursor: pointer;"
40161
+ extraStyles: "cursor: pointer; \n &:focus { \n outline: 3px solid ".concat(themeValues.accessibilityColor, "; \n outline-offset: 2px; \n }")
40154
40162
  }, link));
40155
40163
  };
40156
40164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.1.31-beta.0",
3
+ "version": "4.1.32-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",
@@ -21,7 +21,7 @@ const PlaceholderContentWrapper = ({
21
21
  dataQa
22
22
  }) =>
23
23
  isLink ? (
24
- <Link to={destination} dataQa={dataQa} tabIndex="0">
24
+ <Link to={destination} dataQa={dataQa}>
25
25
  <Box padding="0" minHeight="100%" extraStyles={`cursor: pointer;`}>
26
26
  {children}
27
27
  </Box>
@@ -33,7 +33,6 @@ const PlaceholderContentWrapper = ({
33
33
  minHeight="100%"
34
34
  extraStyles={`cursor: pointer;`}
35
35
  dataQa={dataQa}
36
- tabIndex="0"
37
36
  >
38
37
  {children}
39
38
  </Box>
@@ -88,7 +87,11 @@ const Placeholder = ({
88
87
  };`}
89
88
  >
90
89
  <Center maxWidth="300px">
91
- <Box padding="0px 0px 0px 0px">
90
+ <Box
91
+ padding="0"
92
+ tabIndex="0"
93
+ onKeyPress={e => e.key === "Enter" && action()}
94
+ >
92
95
  <Cluster justify="center" align="center" minHeight="100%">
93
96
  <Switcher maxChildren={2} childGap="0">
94
97
  {variant === "large" && <div></div>}
@@ -64,8 +64,6 @@ const CollapsibleSection = ({
64
64
  return (
65
65
  <Motion
66
66
  padding="0"
67
- tabIndex="0"
68
- onKeyDown={handleKeyDown}
69
67
  hoverStyles={`outline: none;`}
70
68
  animate={isOpen ? "open" : "closed"}
71
69
  positionTransition
@@ -80,6 +78,7 @@ const CollapsibleSection = ({
80
78
  key="header"
81
79
  hoverStyles={`cursor: pointer;`}
82
80
  tabIndex="0"
81
+ onKeyDown={handleKeyDown}
83
82
  >
84
83
  <Cluster justify="space-between" align="center">
85
84
  {customTitle ? (
@@ -32,7 +32,7 @@ const EditableList = ({
32
32
  useModal = false,
33
33
  modal: Modal,
34
34
  modalProps,
35
- autoPayMethod,
35
+ autoPayMethods,
36
36
  qaPrefix
37
37
  }) => (
38
38
  <Box padding="0rem 0rem 1.5rem 0rem">
@@ -60,7 +60,10 @@ const EditableList = ({
60
60
  return (
61
61
  <EditableListItem
62
62
  listItemSize={
63
- !!item.id && item.id === autoPayMethod ? "big" : listItemSize
63
+ !!item.id &&
64
+ autoPayMethods.some(methodID => methodID === item.id)
65
+ ? "big"
66
+ : listItemSize
64
67
  }
65
68
  key={item.id || item}
66
69
  >
@@ -47,7 +47,11 @@ const TermsAndConditionsModal = ({
47
47
  color={themeValues.linkColor}
48
48
  weight={themeValues.fontWeight}
49
49
  hoverStyles={themeValues.modalLinkHoverFocus}
50
- extraStyles={`cursor: pointer;`}
50
+ extraStyles={`cursor: pointer;
51
+ &:focus {
52
+ outline: 3px solid ${themeValues.accessibilityColor};
53
+ outline-offset: 2px;
54
+ }`}
51
55
  >
52
56
  {link}
53
57
  </Text>
@@ -16,6 +16,7 @@ const modalLinkHoverFocus = {
16
16
  default: `outline: none; text-decoration: underline;`,
17
17
  footer: `outline: none; text-decoration: underline;`
18
18
  };
19
+ const accessibilityColor = { default: "#3181E3", footer: "#3181E3" };
19
20
 
20
21
  export const fallbackValues = {
21
22
  backgroundColor,
@@ -24,5 +25,6 @@ export const fallbackValues = {
24
25
  fontSize,
25
26
  lineHeight,
26
27
  fontWeight,
27
- modalLinkHoverFocus
28
+ modalLinkHoverFocus,
29
+ accessibilityColor
28
30
  };