@thecb/components 8.4.9-beta.0 → 8.4.9

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,
@@ -24227,8 +24230,7 @@ var FormSelect = function FormSelect(_ref) {
24227
24230
  variant: "pXS",
24228
24231
  weight: themeValues.fontWeight,
24229
24232
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24230
- id: createIdFromString(labelTextWhenNoError, "error message"),
24231
- "aria-live": "polite"
24233
+ id: createIdFromString(labelTextWhenNoError, "error message")
24232
24234
  }, errorMessages[field.errors[0]]) : /*#__PURE__*/React.createElement(Text$1, {
24233
24235
  extraStyles: "height: ".concat(themeValues.lineHeight, ";")
24234
24236
  })));
@@ -27101,7 +27103,24 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27101
27103
  themeValues = _ref5.themeValues,
27102
27104
  index = _ref5.index,
27103
27105
  _ref5$handleChange = _ref5.handleChange,
27104
- handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange;
27106
+ handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
27107
+ field = _ref5.field,
27108
+ config = _ref5.config;
27109
+
27110
+ var getDefaultChecked = function getDefaultChecked(value, idx) {
27111
+ var selectionExistsInConfig = config.map(function (c) {
27112
+ return c.value;
27113
+ }).includes(field.rawValue);
27114
+
27115
+ if (selectionExistsInConfig) {
27116
+ // if exists, selection comes from the redux-freeform state
27117
+ return field.rawValue === value;
27118
+ } // fallback to first option as default selection
27119
+
27120
+
27121
+ return idx === 0;
27122
+ };
27123
+
27105
27124
  return /*#__PURE__*/React.createElement(InputAndLabelContainer, {
27106
27125
  align: "center",
27107
27126
  childGap: "0.5rem",
@@ -27119,7 +27138,7 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27119
27138
  setValue(e.target.value);
27120
27139
  handleChange(e);
27121
27140
  },
27122
- defaultChecked: index === 0
27141
+ defaultChecked: getDefaultChecked(value, index)
27123
27142
  }), /*#__PURE__*/React.createElement(Text$1, {
27124
27143
  as: "label",
27125
27144
  htmlFor: id,
@@ -27323,14 +27342,16 @@ var fallbackValues$x = {
27323
27342
  };
27324
27343
 
27325
27344
  var SolidDivider = function SolidDivider(_ref) {
27326
- var themeValues = _ref.themeValues;
27345
+ var borderColor = _ref.borderColor,
27346
+ borderSize = _ref.borderSize,
27347
+ themeValues = _ref.themeValues;
27327
27348
  return /*#__PURE__*/React.createElement(Box, {
27328
27349
  padding: "0",
27329
27350
  minWidth: "100%",
27330
27351
  minHeight: "1px",
27331
- borderColor: themeValues.borderColor,
27332
- borderSize: themeValues.borderSize,
27333
- borderWidthOverride: "0px 0px ".concat(themeValues.borderSize, " 0px")
27352
+ borderColor: borderColor || themeValues.borderColor,
27353
+ borderSize: borderSize || themeValues.borderSize,
27354
+ borderWidthOverride: "0px 0px ".concat(borderSize || themeValues.borderSize, " 0px")
27334
27355
  });
27335
27356
  };
27336
27357
 
@@ -46784,26 +46805,30 @@ var fallbackValues$J = {
46784
46805
  */
46785
46806
 
46786
46807
  var Module = function Module(_ref) {
46787
- var heading = _ref.heading,
46808
+ var _ref$variant = _ref.variant,
46809
+ variant = _ref$variant === void 0 ? "default" : _ref$variant,
46810
+ as = _ref.as,
46811
+ disabled = _ref.disabled,
46812
+ heading = _ref.heading,
46813
+ rightTitleContent = _ref.rightTitleContent,
46814
+ _ref$titleID = _ref.titleID,
46815
+ titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
46788
46816
  _ref$spacing = _ref.spacing,
46789
46817
  spacing = _ref$spacing === void 0 ? "1rem" : _ref$spacing,
46790
46818
  _ref$padding = _ref.padding,
46791
46819
  padding = _ref$padding === void 0 ? "0" : _ref$padding,
46820
+ _ref$margin = _ref.margin,
46821
+ margin = _ref$margin === void 0 ? "0" : _ref$margin,
46792
46822
  _ref$spacingBottom = _ref.spacingBottom,
46793
46823
  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
46824
  fontSize = _ref.fontSize,
46798
- as = _ref.as,
46799
- _ref$titleID = _ref.titleID,
46800
- titleID = _ref$titleID === void 0 ? "" : _ref$titleID,
46801
- rightTitleContent = _ref.rightTitleContent,
46825
+ themeValues = _ref.themeValues,
46802
46826
  children = _ref.children;
46803
46827
  var themedFontSize = variant === "small" ? "1.25rem" : variant === "default" ? "1.375rem" : "2rem";
46804
46828
  var computedFontSize = fontSize || themedFontSize;
46805
46829
  var themedElemType = variant === "small" ? "h6" : variant === "default" ? "h5" : "h2";
46806
46830
  var computedElemType = as || themedElemType;
46831
+ var disabledStyles = "opacity: 0.40;";
46807
46832
  var headingText = /*#__PURE__*/React.createElement(Title$1, {
46808
46833
  weight: themeValues.fontWeight,
46809
46834
  color: themeValues.fontColor,
@@ -46813,12 +46838,18 @@ var Module = function Module(_ref) {
46813
46838
  extraStyles: "font-size: ".concat(computedFontSize, ";"),
46814
46839
  id: titleID
46815
46840
  }, heading);
46816
- return /*#__PURE__*/React.createElement(Fragment$1, null, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React.createElement(Cluster, {
46841
+ return /*#__PURE__*/React.createElement(Box, {
46842
+ "aria-disabled": disabled,
46843
+ extraStyles: disabled && disabledStyles,
46844
+ padding: "0",
46845
+ role: "group"
46846
+ }, heading && !rightTitleContent && headingText, heading && rightTitleContent && /*#__PURE__*/React.createElement(Cluster, {
46817
46847
  justify: "space-between",
46818
46848
  align: "center",
46819
46849
  nowrap: true
46820
46850
  }, headingText, rightTitleContent), /*#__PURE__*/React.createElement(Box, {
46821
- padding: "0 0 ".concat(spacingBottom)
46851
+ padding: "0 0 ".concat(spacingBottom),
46852
+ extraStyles: "margin: ".concat(margin)
46822
46853
  }, /*#__PURE__*/React.createElement(Box, {
46823
46854
  padding: padding,
46824
46855
  background: themeValues.backgroundColor,
@@ -49375,6 +49406,8 @@ var RadioGroup = function RadioGroup(_ref) {
49375
49406
  groupName: groupName,
49376
49407
  setValue: setValue,
49377
49408
  handleChange: handleChange,
49409
+ field: field,
49410
+ config: config,
49378
49411
  "aria-invalid": field.dirty && field.hasErrors
49379
49412
  }));
49380
49413
  })));
@@ -49431,6 +49464,8 @@ var RadioSection = function RadioSection(_ref) {
49431
49464
  initiallyOpen = _ref$initiallyOpen === void 0 ? true : _ref$initiallyOpen,
49432
49465
  _ref$openHeight = _ref.openHeight,
49433
49466
  openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
49467
+ _ref$containerStyles = _ref.containerStyles,
49468
+ containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
49434
49469
  ariaDescribedBy = _ref.ariaDescribedBy;
49435
49470
 
49436
49471
  var handleKeyDown = function handleKeyDown(id, e) {
@@ -49483,7 +49518,8 @@ var RadioSection = function RadioSection(_ref) {
49483
49518
  return /*#__PURE__*/React.createElement(Box, {
49484
49519
  padding: "1px",
49485
49520
  border: "1px solid ".concat(themeValues.borderColor),
49486
- borderRadius: "4px"
49521
+ borderRadius: "4px",
49522
+ extraStyles: containerStyles
49487
49523
  }, /*#__PURE__*/React.createElement(Stack, {
49488
49524
  childGap: "0"
49489
49525
  }, sections.filter(function (section) {