@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.d.ts CHANGED
@@ -380,9 +380,9 @@ declare const Card: React.FC<Expand<CardProps> &
380
380
  React.HTMLAttributes<HTMLElement>>;
381
381
 
382
382
  interface Field {
383
- hasErrors?: boolean;
384
- dirty?: boolean;
385
- rawValue?: string;
383
+ hasErrors: boolean;
384
+ dirty: boolean;
385
+ rawValue: string;
386
386
  }
387
387
 
388
388
  interface ReduxAction<T = string, P = {}> {
package/dist/index.esm.js CHANGED
@@ -4989,6 +4989,8 @@ var BLACK_SQUEEZE = "#EAF2F7";
4989
4989
  var GREY_CHATEAU = "#959CA8"; // CBS-500
4990
4990
 
4991
4991
  var COOL_GREY_05 = "#fbfcfd"; // CBS-050
4992
+
4993
+ var MANATEE_GREY = "#878E9B"; // CB-60 (cool)
4992
4994
  // BLUE
4993
4995
 
4994
4996
  var CLOUDBURST_BLUE = "#26395c";
@@ -5123,6 +5125,7 @@ var colors = /*#__PURE__*/Object.freeze({
5123
5125
  CHARADE_GREY: CHARADE_GREY,
5124
5126
  GRECIAN_GREY: GRECIAN_GREY,
5125
5127
  COOL_GREY_05: COOL_GREY_05,
5128
+ MANATEE_GREY: MANATEE_GREY,
5126
5129
  BLACK_SQUEEZE: BLACK_SQUEEZE,
5127
5130
  GREY_CHATEAU: GREY_CHATEAU,
5128
5131
  CLOUDBURST_BLUE: CLOUDBURST_BLUE,
@@ -26006,7 +26009,7 @@ var FormInput = function FormInput(_ref15) {
26006
26009
  themeValues: themeValues,
26007
26010
  $customHeight: customHeight,
26008
26011
  $extraStyles: extraStyles,
26009
- autocomplete: autocomplete
26012
+ autoComplete: autocomplete
26010
26013
  }, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
26011
26014
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26012
26015
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
@@ -26025,10 +26028,11 @@ var FormInput = function FormInput(_ref15) {
26025
26028
  background: background,
26026
26029
  $customHeight: customHeight,
26027
26030
  $extraStyles: extraStyles,
26028
- autocomplete: autocomplete
26031
+ autoComplete: autocomplete
26029
26032
  }, props))), /*#__PURE__*/React.createElement(Stack, {
26030
26033
  direction: "row",
26031
- justify: "space-between"
26034
+ justify: "space-between",
26035
+ "aria-live": "polite"
26032
26036
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React.createElement(Text$1, {
26033
26037
  color: ERROR_COLOR,
26034
26038
  variant: "pXS",
@@ -27101,7 +27105,24 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27101
27105
  themeValues = _ref5.themeValues,
27102
27106
  index = _ref5.index,
27103
27107
  _ref5$handleChange = _ref5.handleChange,
27104
- handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange;
27108
+ handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
27109
+ field = _ref5.field,
27110
+ config = _ref5.config;
27111
+
27112
+ var getDefaultChecked = function getDefaultChecked(value, idx) {
27113
+ var selectionExistsInConfig = config.map(function (c) {
27114
+ return c.value;
27115
+ }).includes(field.rawValue);
27116
+
27117
+ if (selectionExistsInConfig) {
27118
+ // if exists, selection comes from the redux-freeform state
27119
+ return field.rawValue === value;
27120
+ } // fallback to first option as default selection
27121
+
27122
+
27123
+ return idx === 0;
27124
+ };
27125
+
27105
27126
  return /*#__PURE__*/React.createElement(InputAndLabelContainer, {
27106
27127
  align: "center",
27107
27128
  childGap: "0.5rem",
@@ -27119,7 +27140,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27119
27140
  setValue(e.target.value);
27120
27141
  handleChange(e);
27121
27142
  },
27122
- defaultChecked: index === 0
27143
+ defaultChecked: getDefaultChecked(value, index)
27123
27144
  }), /*#__PURE__*/React.createElement(Text$1, {
27124
27145
  as: "label",
27125
27146
  htmlFor: id,
@@ -27323,14 +27344,16 @@ var fallbackValues$x = {
27323
27344
  };
27324
27345
 
27325
27346
  var SolidDivider = function SolidDivider(_ref) {
27326
- var themeValues = _ref.themeValues;
27347
+ var borderColor = _ref.borderColor,
27348
+ borderSize = _ref.borderSize,
27349
+ themeValues = _ref.themeValues;
27327
27350
  return /*#__PURE__*/React.createElement(Box, {
27328
27351
  padding: "0",
27329
27352
  minWidth: "100%",
27330
27353
  minHeight: "1px",
27331
- borderColor: themeValues.borderColor,
27332
- borderSize: themeValues.borderSize,
27333
- borderWidthOverride: "0px 0px ".concat(themeValues.borderSize, " 0px")
27354
+ borderColor: borderColor || themeValues.borderColor,
27355
+ borderSize: borderSize || themeValues.borderSize,
27356
+ borderWidthOverride: "0px 0px ".concat(borderSize || themeValues.borderSize, " 0px")
27334
27357
  });
27335
27358
  };
27336
27359
 
@@ -41321,7 +41344,7 @@ var EmailForm = function EmailForm(_ref) {
41321
41344
  return e.key === "Enter" && handleSubmit(e);
41322
41345
  },
41323
41346
  isEmail: true,
41324
- autocomplete: "email"
41347
+ autoComplete: "email"
41325
41348
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
41326
41349
  name: "email checkbox",
41327
41350
  title: "Save email address to wallet",
@@ -46784,26 +46807,30 @@ var fallbackValues$J = {
46784
46807
  */
46785
46808
 
46786
46809
  var Module = function Module(_ref) {
46787
- var heading = _ref.heading,
46810
+ var _ref$variant = _ref.variant,
46811
+ variant = _ref$variant === void 0 ? "default" : _ref$variant,
46812
+ as = _ref.as,
46813
+ disabled = _ref.disabled,
46814
+ heading = _ref.heading,
46815
+ rightTitleContent = _ref.rightTitleContent,
46816
+ _ref$titleID = _ref.titleID,
46817
+ titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
46788
46818
  _ref$spacing = _ref.spacing,
46789
46819
  spacing = _ref$spacing === void 0 ? "1rem" : _ref$spacing,
46790
46820
  _ref$padding = _ref.padding,
46791
46821
  padding = _ref$padding === void 0 ? "0" : _ref$padding,
46822
+ _ref$margin = _ref.margin,
46823
+ margin = _ref$margin === void 0 ? "0" : _ref$margin,
46792
46824
  _ref$spacingBottom = _ref.spacingBottom,
46793
46825
  spacingBottom = _ref$spacingBottom === void 0 ? "2.5rem" : _ref$spacingBottom,
46794
- themeValues = _ref.themeValues,
46795
- _ref$variant = _ref.variant,
46796
- variant = _ref$variant === void 0 ? "default" : _ref$variant,
46797
46826
  fontSize = _ref.fontSize,
46798
- as = _ref.as,
46799
- _ref$titleID = _ref.titleID,
46800
- titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
46801
- rightTitleContent = _ref.rightTitleContent,
46827
+ themeValues = _ref.themeValues,
46802
46828
  children = _ref.children;
46803
46829
  var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
46804
46830
  var computedFontSize = fontSize || themedFontSize;
46805
46831
  var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
46806
46832
  var computedElemType = as || themedElemType;
46833
+ var disabledStyles = "opacity: 0.40;";
46807
46834
  var headingText = /*#__PURE__*/React.createElement(Title$1, {
46808
46835
  weight: themeValues.fontWeight,
46809
46836
  color: themeValues.fontColor,
@@ -46813,12 +46840,18 @@ var Module = function Module(_ref) {
46813
46840
  extraStyles: "font-size: ".concat(computedFontSize, ";"),
46814
46841
  id: titleID
46815
46842
  }, heading);
46816
- return /*#__PURE__*/React.createElement(Fragment$1, null, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React.createElement(Cluster, {
46843
+ return /*#__PURE__*/React.createElement(Box, {
46844
+ "aria-disabled": disabled,
46845
+ extraStyles: disabled && disabledStyles,
46846
+ padding: "0",
46847
+ role: "group"
46848
+ }, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React.createElement(Cluster, {
46817
46849
  justify: "space-between",
46818
46850
  align: "center",
46819
46851
  nowrap: true
46820
46852
  }, headingText, rightTitleContent), /*#__PURE__*/React.createElement(Box, {
46821
- padding: "0 0 ".concat(spacingBottom)
46853
+ padding: "0 0 ".concat(spacingBottom),
46854
+ extraStyles: "margin: ".concat(margin)
46822
46855
  }, /*#__PURE__*/React.createElement(Box, {
46823
46856
  padding: padding,
46824
46857
  background: themeValues.backgroundColor,
@@ -49375,6 +49408,8 @@ var RadioGroup = function RadioGroup(_ref) {
49375
49408
  groupName: groupName,
49376
49409
  setValue: setValue,
49377
49410
  handleChange: handleChange,
49411
+ field: field,
49412
+ config: config,
49378
49413
  "aria-invalid": field.dirty && field.hasErrors
49379
49414
  }));
49380
49415
  })));
@@ -49431,6 +49466,8 @@ var RadioSection = function RadioSection(_ref) {
49431
49466
  initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
49432
49467
  _ref$openHeight = _ref.openHeight,
49433
49468
  openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
49469
+ _ref$containerStyles = _ref.containerStyles,
49470
+ containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
49434
49471
  ariaDescribedBy = _ref.ariaDescribedBy;
49435
49472
 
49436
49473
  var handleKeyDown = function handleKeyDown(id, e) {
@@ -49483,7 +49520,8 @@ var RadioSection = function RadioSection(_ref) {
49483
49520
  return /*#__PURE__*/React.createElement(Box, {
49484
49521
  padding: "1px",
49485
49522
  border: "1px solid ".concat(themeValues.borderColor),
49486
- borderRadius: "4px"
49523
+ borderRadius: "4px",
49524
+ extraStyles: containerStyles
49487
49525
  }, /*#__PURE__*/React.createElement(Stack, {
49488
49526
  childGap: "0"
49489
49527
  }, sections.filter(function (section) {