@thecb/components 6.0.6 → 6.0.8-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.esm.js CHANGED
@@ -4863,7 +4863,8 @@ var BOSTON_BLUE = "#357fb8";
4863
4863
  var INFO_BLUE = "#E4F4FD";
4864
4864
  var HOVER_LIGHT_BLUE = "#EFFAFF";
4865
4865
  var MATISSE_BLUE = "#15749D";
4866
- var ROYAL_BLUE = "#3181E3"; // GREEN
4866
+ var ROYAL_BLUE = "#3181E3";
4867
+ var ASTRAL_BLUE = "#3176AA"; // GREEN
4867
4868
 
4868
4869
  var FOREST_GREEN = "#19b03F";
4869
4870
  var MEADOW_GREEN = "#16C98D";
@@ -4885,7 +4886,7 @@ var APRICOT_ORANGE = "#FFE8D8"; // RED
4885
4886
  var RED = "#FF0000";
4886
4887
  var CRIMSON_RED = "#ED1C24";
4887
4888
  var THUNDERBIRD_RED = "#C3191F";
4888
- var RAZZMATAZZ_RED = "#ED125F";
4889
+ var RAZZMATAZZ_RED = "#D11053";
4889
4890
  var FANTASY_RED = "#FCF4F4";
4890
4891
  var COSMOS_RED = "#FFD0D3";
4891
4892
  var BLUSH_RED = "#FFF0F5"; // Second level color constants
@@ -4969,6 +4970,7 @@ var colors = /*#__PURE__*/Object.freeze({
4969
4970
  HOVER_LIGHT_BLUE: HOVER_LIGHT_BLUE,
4970
4971
  MATISSE_BLUE: MATISSE_BLUE,
4971
4972
  ROYAL_BLUE: ROYAL_BLUE,
4973
+ ASTRAL_BLUE: ASTRAL_BLUE,
4972
4974
  FOREST_GREEN: FOREST_GREEN,
4973
4975
  MEADOW_GREEN: MEADOW_GREEN,
4974
4976
  POLAR_GREEN: POLAR_GREEN,
@@ -6064,6 +6066,18 @@ var createUniqueId = function createUniqueId() {
6064
6066
  return "_" + Math.random().toString(36).substr(2, 9);
6065
6067
  };
6066
6068
 
6069
+ var createIdFromString = function createIdFromString(text, postscript) {
6070
+ var unique = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6071
+
6072
+ if (text === undefined) {
6073
+ return createUniqueId();
6074
+ } else {
6075
+ // "first name", undefined, false -> "first-name"
6076
+ // "email address", "error message", false -> "email-address-error-message"
6077
+ // "shopping cart", "order item", true -> "shopping-cart-order-item_2ahtlz608"
6078
+ return "".concat(text === null || text === void 0 ? void 0 : text.replace(/\s+/g, "-")).concat(postscript ? "-".concat(postscript === null || postscript === void 0 ? void 0 : postscript.replace(/\s+/g, "-")) : "").concat(unique ? createUniqueId() : "");
6079
+ }
6080
+ };
6067
6081
  var safeChildren = function safeChildren(children) {
6068
6082
  var replacement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6069
6083
  var unsafeValues = [false, undefined, NaN, null];
@@ -6146,6 +6160,7 @@ var general = /*#__PURE__*/Object.freeze({
6146
6160
  displayCurrency: displayCurrency,
6147
6161
  convertCentsToMoneyInt: convertCentsToMoneyInt,
6148
6162
  formatPercent: formatPercent,
6163
+ createIdFromString: createIdFromString,
6149
6164
  safeChildren: safeChildren,
6150
6165
  generateClickHandler: generateClickHandler,
6151
6166
  checkCardBrand: checkCardBrand,
@@ -19028,13 +19043,13 @@ var disabledCheckedStyles = {
19028
19043
  "default": "\n background: #6d717e;\n border: 1px solid #6d717e;\n"
19029
19044
  };
19030
19045
  var disabledStyles = {
19031
- "default": "\n background: ".concat(SEASHELL_WHITE, ";\n border: 1px solid ").concat(GHOST_GREY, ";\n")
19046
+ "default": "\n background: ".concat(SEASHELL_WHITE, ";\n border: 1px solid ").concat(STORM_GREY, ";\n")
19032
19047
  };
19033
19048
  var checkedStyles = {
19034
19049
  "default": "\n background: ".concat(MATISSE_BLUE, "; \n border: 1px solid ").concat(MATISSE_BLUE, ";\n")
19035
19050
  };
19036
19051
  var defaultStyles = {
19037
- "default": "\n background: ".concat(WHITE, "; \n border: 1px solid ").concat(GHOST_GREY, ";\n")
19052
+ "default": "\n background: ".concat(WHITE, "; \n border: 1px solid ").concat(STORM_GREY, ";\n")
19038
19053
  };
19039
19054
  var fallbackValues$c = {
19040
19055
  backgroundColor: backgroundColor$2,
@@ -20710,6 +20725,7 @@ var Dropdown = function Dropdown(_ref8) {
20710
20725
  _ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
20711
20726
  autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
20712
20727
  ariaLabelledby = _ref8.ariaLabelledby,
20728
+ ariaDescribedby = _ref8.ariaDescribedby,
20713
20729
  _ref8$autocompleteVal = _ref8.autocompleteValue,
20714
20730
  autocompleteValue = _ref8$autocompleteVal === void 0 ? "" : _ref8$autocompleteVal,
20715
20731
  _ref8$smoothScroll = _ref8.smoothScroll,
@@ -20959,6 +20975,7 @@ var Dropdown = function Dropdown(_ref8) {
20959
20975
  "aria-owns": "".concat(ariaLabelledby, "_listbox"),
20960
20976
  "aria-haspopup": "listbox",
20961
20977
  "aria-labelledby": ariaLabelledby,
20978
+ "aria-describedby": ariaDescribedby,
20962
20979
  "aria-expanded": isOpen,
20963
20980
  autocomplete: autocompleteValue,
20964
20981
  background: isOpen ? themeValues.hoverColor : WHITE,
@@ -21175,9 +21192,10 @@ var FormSelect = function FormSelect(_ref) {
21175
21192
  color: themeValues.labelColor,
21176
21193
  weight: themeValues.fontWeight,
21177
21194
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
21178
- id: labelTextWhenNoError.replace(/\s+/g, "-")
21195
+ id: createIdFromString(labelTextWhenNoError)
21179
21196
  }, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
21180
- ariaLabelledby: labelTextWhenNoError.replace(/\s+/g, "-"),
21197
+ ariaLabelledby: createIdFromString(labelTextWhenNoError),
21198
+ ariaDescribedby: createIdFromString(labelTextWhenNoError, "error message"),
21181
21199
  maxHeight: dropdownMaxHeight,
21182
21200
  hasTitles: hasTitles,
21183
21201
  placeholder: options[0] ? options[0].text : "",
@@ -21204,7 +21222,8 @@ var FormSelect = function FormSelect(_ref) {
21204
21222
  color: ERROR_COLOR,
21205
21223
  variant: "pXS",
21206
21224
  weight: themeValues.fontWeight,
21207
- extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }"
21225
+ extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
21226
+ id: createIdFromString(labelTextWhenNoError, "error message")
21208
21227
  }, errorMessages[field.errors[0]]) : /*#__PURE__*/React.createElement(Text$1, {
21209
21228
  extraStyles: "height: ".concat(themeValues.lineHeight, ";")
21210
21229
  })));
@@ -22479,8 +22498,8 @@ var labelColor$1 = {
22479
22498
  disabled: "".concat(CHARADE_GREY)
22480
22499
  };
22481
22500
  var borderColor$1 = {
22482
- "default": "".concat(GREY_CHATEAU),
22483
- disabled: "".concat(GREY_CHATEAU)
22501
+ "default": "".concat(STORM_GREY),
22502
+ disabled: "".concat(STORM_GREY)
22484
22503
  };
22485
22504
  var lineHeight$2 = {
22486
22505
  "default": "1rem",
@@ -22627,7 +22646,7 @@ var FormInput = function FormInput(_ref15) {
22627
22646
  variant: "pS",
22628
22647
  weight: themeValues.fontWeight,
22629
22648
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
22630
- id: labelTextWhenNoError.replace(/\s+/g, "-")
22649
+ id: createIdFromString(labelTextWhenNoError)
22631
22650
  }, labelTextWhenNoError), /*#__PURE__*/React.createElement(Text$1, {
22632
22651
  color: themeValues.linkColor,
22633
22652
  variant: "pS",
@@ -22644,7 +22663,7 @@ var FormInput = function FormInput(_ref15) {
22644
22663
  variant: "pS",
22645
22664
  fontWeight: themeValues.fontWeight,
22646
22665
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
22647
- id: labelTextWhenNoError.replace(/\s+/g, "-")
22666
+ id: createIdFromString(labelTextWhenNoError)
22648
22667
  }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React.createElement(Text$1, {
22649
22668
  variant: "pS",
22650
22669
  color: themeValues.linkColor,
@@ -22664,7 +22683,8 @@ var FormInput = function FormInput(_ref15) {
22664
22683
  }, decorator)))), /*#__PURE__*/React.createElement(Box, {
22665
22684
  padding: "0"
22666
22685
  }, formatter ? /*#__PURE__*/React.createElement(FormattedInputField, _extends({
22667
- "aria-labelledby": labelTextWhenNoError.replace(/\s+/g, "-"),
22686
+ "aria-labelledby": createIdFromString(labelTextWhenNoError),
22687
+ "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
22668
22688
  onChange: function onChange(e) {
22669
22689
  return fieldActions.set(e);
22670
22690
  },
@@ -22680,7 +22700,8 @@ var FormInput = function FormInput(_ref15) {
22680
22700
  $customHeight: customHeight,
22681
22701
  $extraStyles: extraStyles
22682
22702
  }, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
22683
- "aria-labelledby": labelTextWhenNoError.replace(/\s+/g, "-"),
22703
+ "aria-labelledby": createIdFromString(labelTextWhenNoError),
22704
+ "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
22684
22705
  onChange: function onChange(e) {
22685
22706
  return fieldActions.set(e.target.value);
22686
22707
  },
@@ -22702,7 +22723,8 @@ var FormInput = function FormInput(_ref15) {
22702
22723
  color: ERROR_COLOR,
22703
22724
  variant: "pXS",
22704
22725
  weight: themeValues.fontWeight,
22705
- extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }"
22726
+ extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
22727
+ id: createIdFromString(labelTextWhenNoError, "error message")
22706
22728
  }, errorMessages[field.errors[0]]) : /*#__PURE__*/React.createElement(Text$1, {
22707
22729
  extraStyles: "height: ".concat(themeValues.lineHeight, ";")
22708
22730
  }), !isMobile && decorator && /*#__PURE__*/React.createElement(Box, {
@@ -40643,7 +40665,7 @@ var TitleModule = function TitleModule(_ref) {
40643
40665
  var color$a = "#15749D";
40644
40666
  var hoverColor$4 = "#116285";
40645
40667
  var activeColor$5 = "#0E506D";
40646
- var linkColor$3 = "#357fb8";
40668
+ var linkColor$3 = "#3176AA";
40647
40669
  var fontWeight$6 = FONT_WEIGHT_REGULAR;
40648
40670
  var modalLinkHoverFocus = "outline: none;\n cursor: pointer;\n text-decoration: underline;\n text-decoration-color: #317D4F;";
40649
40671
  var fallbackValues$z = {
@@ -41824,7 +41846,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
41824
41846
  var PaymentDetails$1 = themeComponent(PaymentDetails, "PaymentDetails", fallbackValues$A, "default");
41825
41847
 
41826
41848
  var linkColor$4 = {
41827
- "default": "#357fb8"
41849
+ "default": "#3176AA"
41828
41850
  };
41829
41851
  var fontSize$a = {
41830
41852
  "default": "1rem"
@@ -42978,7 +43000,7 @@ var backgroundColor$9 = {
42978
43000
  footer: "#ffffff"
42979
43001
  };
42980
43002
  var linkColor$5 = {
42981
- "default": "#357fb8",
43003
+ "default": "#3176AA",
42982
43004
  footer: "#ffffff"
42983
43005
  };
42984
43006
  var border$3 = {