@thecb/components 8.4.10-beta.4 → 8.4.10

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
@@ -4997,6 +4997,8 @@ var BLACK_SQUEEZE = "#EAF2F7";
4997
4997
  var GREY_CHATEAU = "#959CA8"; // CBS-500
4998
4998
 
4999
4999
  var COOL_GREY_05 = "#fbfcfd"; // CBS-050
5000
+
5001
+ var MANATEE_GREY = "#878E9B"; // CB-60 (cool)
5000
5002
  // BLUE
5001
5003
 
5002
5004
  var CLOUDBURST_BLUE = "#26395c";
@@ -5131,6 +5133,7 @@ var colors = /*#__PURE__*/Object.freeze({
5131
5133
  CHARADE_GREY: CHARADE_GREY,
5132
5134
  GRECIAN_GREY: GRECIAN_GREY,
5133
5135
  COOL_GREY_05: COOL_GREY_05,
5136
+ MANATEE_GREY: MANATEE_GREY,
5134
5137
  BLACK_SQUEEZE: BLACK_SQUEEZE,
5135
5138
  GREY_CHATEAU: GREY_CHATEAU,
5136
5139
  CLOUDBURST_BLUE: CLOUDBURST_BLUE,
@@ -26014,7 +26017,7 @@ var FormInput = function FormInput(_ref15) {
26014
26017
  themeValues: themeValues,
26015
26018
  $customHeight: customHeight,
26016
26019
  $extraStyles: extraStyles,
26017
- autocomplete: autocomplete
26020
+ autoComplete: autocomplete
26018
26021
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
26019
26022
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26020
26023
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
@@ -26033,10 +26036,11 @@ var FormInput = function FormInput(_ref15) {
26033
26036
  background: background,
26034
26037
  $customHeight: customHeight,
26035
26038
  $extraStyles: extraStyles,
26036
- autocomplete: autocomplete
26039
+ autoComplete: autocomplete
26037
26040
  }, props))), /*#__PURE__*/React__default.createElement(Stack, {
26038
26041
  direction: "row",
26039
- justify: "space-between"
26042
+ justify: "space-between",
26043
+ "aria-live": "polite"
26040
26044
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
26041
26045
  color: ERROR_COLOR,
26042
26046
  variant: "pXS",
@@ -27109,7 +27113,24 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27109
27113
  themeValues = _ref5.themeValues,
27110
27114
  index = _ref5.index,
27111
27115
  _ref5$handleChange = _ref5.handleChange,
27112
- handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange;
27116
+ handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
27117
+ field = _ref5.field,
27118
+ config = _ref5.config;
27119
+
27120
+ var getDefaultChecked = function getDefaultChecked(value, idx) {
27121
+ var selectionExistsInConfig = config.map(function (c) {
27122
+ return c.value;
27123
+ }).includes(field.rawValue);
27124
+
27125
+ if (selectionExistsInConfig) {
27126
+ // if exists, selection comes from the redux-freeform state
27127
+ return field.rawValue === value;
27128
+ } // fallback to first option as default selection
27129
+
27130
+
27131
+ return idx === 0;
27132
+ };
27133
+
27113
27134
  return /*#__PURE__*/React__default.createElement(InputAndLabelContainer, {
27114
27135
  align: "center",
27115
27136
  childGap: "0.5rem",
@@ -27127,7 +27148,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27127
27148
  setValue(e.target.value);
27128
27149
  handleChange(e);
27129
27150
  },
27130
- defaultChecked: index === 0
27151
+ defaultChecked: getDefaultChecked(value, index)
27131
27152
  }), /*#__PURE__*/React__default.createElement(Text$1, {
27132
27153
  as: "label",
27133
27154
  htmlFor: id,
@@ -27331,14 +27352,16 @@ var fallbackValues$x = {
27331
27352
  };
27332
27353
 
27333
27354
  var SolidDivider = function SolidDivider(_ref) {
27334
- var themeValues = _ref.themeValues;
27355
+ var borderColor = _ref.borderColor,
27356
+ borderSize = _ref.borderSize,
27357
+ themeValues = _ref.themeValues;
27335
27358
  return /*#__PURE__*/React__default.createElement(Box, {
27336
27359
  padding: "0",
27337
27360
  minWidth: "100%",
27338
27361
  minHeight: "1px",
27339
- borderColor: themeValues.borderColor,
27340
- borderSize: themeValues.borderSize,
27341
- borderWidthOverride: "0px 0px ".concat(themeValues.borderSize, " 0px")
27362
+ borderColor: borderColor || themeValues.borderColor,
27363
+ borderSize: borderSize || themeValues.borderSize,
27364
+ borderWidthOverride: "0px 0px ".concat(borderSize || themeValues.borderSize, " 0px")
27342
27365
  });
27343
27366
  };
27344
27367
 
@@ -41329,7 +41352,7 @@ var EmailForm = function EmailForm(_ref) {
41329
41352
  return e.key === "Enter" && handleSubmit(e);
41330
41353
  },
41331
41354
  isEmail: true,
41332
- autocomplete: "email"
41355
+ autoComplete: "email"
41333
41356
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
41334
41357
  name: "email checkbox",
41335
41358
  title: "Save email address to wallet",
@@ -46792,26 +46815,30 @@ var fallbackValues$J = {
46792
46815
  */
46793
46816
 
46794
46817
  var Module = function Module(_ref) {
46795
- var heading = _ref.heading,
46818
+ var _ref$variant = _ref.variant,
46819
+ variant = _ref$variant === void 0 ? "default" : _ref$variant,
46820
+ as = _ref.as,
46821
+ disabled = _ref.disabled,
46822
+ heading = _ref.heading,
46823
+ rightTitleContent = _ref.rightTitleContent,
46824
+ _ref$titleID = _ref.titleID,
46825
+ titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
46796
46826
  _ref$spacing = _ref.spacing,
46797
46827
  spacing = _ref$spacing === void 0 ? "1rem" : _ref$spacing,
46798
46828
  _ref$padding = _ref.padding,
46799
46829
  padding = _ref$padding === void 0 ? "0" : _ref$padding,
46830
+ _ref$margin = _ref.margin,
46831
+ margin = _ref$margin === void 0 ? "0" : _ref$margin,
46800
46832
  _ref$spacingBottom = _ref.spacingBottom,
46801
46833
  spacingBottom = _ref$spacingBottom === void 0 ? "2.5rem" : _ref$spacingBottom,
46802
- themeValues = _ref.themeValues,
46803
- _ref$variant = _ref.variant,
46804
- variant = _ref$variant === void 0 ? "default" : _ref$variant,
46805
46834
  fontSize = _ref.fontSize,
46806
- as = _ref.as,
46807
- _ref$titleID = _ref.titleID,
46808
- titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
46809
- rightTitleContent = _ref.rightTitleContent,
46835
+ themeValues = _ref.themeValues,
46810
46836
  children = _ref.children;
46811
46837
  var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
46812
46838
  var computedFontSize = fontSize || themedFontSize;
46813
46839
  var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
46814
46840
  var computedElemType = as || themedElemType;
46841
+ var disabledStyles = "opacity: 0.40;";
46815
46842
  var headingText = /*#__PURE__*/React__default.createElement(Title$1, {
46816
46843
  weight: themeValues.fontWeight,
46817
46844
  color: themeValues.fontColor,
@@ -46821,12 +46848,18 @@ var Module = function Module(_ref) {
46821
46848
  extraStyles: "font-size: ".concat(computedFontSize, ";"),
46822
46849
  id: titleID
46823
46850
  }, heading);
46824
- return /*#__PURE__*/React__default.createElement(React.Fragment, null, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React__default.createElement(Cluster, {
46851
+ return /*#__PURE__*/React__default.createElement(Box, {
46852
+ "aria-disabled": disabled,
46853
+ extraStyles: disabled && disabledStyles,
46854
+ padding: "0",
46855
+ role: "group"
46856
+ }, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React__default.createElement(Cluster, {
46825
46857
  justify: "space-between",
46826
46858
  align: "center",
46827
46859
  nowrap: true
46828
46860
  }, headingText, rightTitleContent), /*#__PURE__*/React__default.createElement(Box, {
46829
- padding: "0 0 ".concat(spacingBottom)
46861
+ padding: "0 0 ".concat(spacingBottom),
46862
+ extraStyles: "margin: ".concat(margin)
46830
46863
  }, /*#__PURE__*/React__default.createElement(Box, {
46831
46864
  padding: padding,
46832
46865
  background: themeValues.backgroundColor,
@@ -49383,6 +49416,8 @@ var RadioGroup = function RadioGroup(_ref) {
49383
49416
  groupName: groupName,
49384
49417
  setValue: setValue,
49385
49418
  handleChange: handleChange,
49419
+ field: field,
49420
+ config: config,
49386
49421
  "aria-invalid": field.dirty && field.hasErrors
49387
49422
  }));
49388
49423
  })));
@@ -49439,6 +49474,8 @@ var RadioSection = function RadioSection(_ref) {
49439
49474
  initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
49440
49475
  _ref$openHeight = _ref.openHeight,
49441
49476
  openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
49477
+ _ref$containerStyles = _ref.containerStyles,
49478
+ containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
49442
49479
  ariaDescribedBy = _ref.ariaDescribedBy;
49443
49480
 
49444
49481
  var handleKeyDown = function handleKeyDown(id, e) {
@@ -49491,7 +49528,8 @@ var RadioSection = function RadioSection(_ref) {
49491
49528
  return /*#__PURE__*/React__default.createElement(Box, {
49492
49529
  padding: "1px",
49493
49530
  border: "1px solid ".concat(themeValues.borderColor),
49494
- borderRadius: "4px"
49531
+ borderRadius: "4px",
49532
+ extraStyles: containerStyles
49495
49533
  }, /*#__PURE__*/React__default.createElement(Stack, {
49496
49534
  childGap: "0"
49497
49535
  }, sections.filter(function (section) {