@thecb/components 10.8.1 → 10.9.0-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
@@ -6548,7 +6548,7 @@ var BoxWrapper = styled__default(function (_ref) {
6548
6548
  });
6549
6549
  /* eslint-enable no-unused-vars */
6550
6550
 
6551
- var _excluded$3 = ["autocompleteValue", "padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "focusStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "children"];
6551
+ var _excluded$3 = ["autocompleteValue", "padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "focusStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "id", "children"];
6552
6552
 
6553
6553
  /*
6554
6554
  Box component to create generic boxes
@@ -6597,6 +6597,7 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
6597
6597
  _ref$srOnly = _ref.srOnly,
6598
6598
  srOnly = _ref$srOnly === void 0 ? false : _ref$srOnly,
6599
6599
  dataQa = _ref.dataQa,
6600
+ id = _ref.id,
6600
6601
  children = _ref.children,
6601
6602
  rest = _objectWithoutProperties(_ref, _excluded$3);
6602
6603
  return /*#__PURE__*/React__default.createElement(BoxWrapper, _extends({
@@ -6632,7 +6633,8 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
6632
6633
  onFocus: onFocus,
6633
6634
  onBlur: onBlur,
6634
6635
  onTouchEnd: onTouchEnd,
6635
- ref: ref
6636
+ ref: ref,
6637
+ id: id
6636
6638
  }, rest), children && safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
6637
6639
  });
6638
6640
 
@@ -24896,7 +24898,9 @@ var Dropdown = function Dropdown(_ref13) {
24896
24898
  _ref13$ariaInvalid = _ref13.ariaInvalid,
24897
24899
  ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
24898
24900
  _ref13$isRequired = _ref13.isRequired,
24899
- isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
24901
+ isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired,
24902
+ _ref13$inputId = _ref13.inputId,
24903
+ inputId = _ref13$inputId === void 0 ? false : _ref13$inputId;
24900
24904
  var _useState = React.useState(""),
24901
24905
  _useState2 = _slicedToArray(_useState, 2),
24902
24906
  inputValue = _useState2[0],
@@ -25105,6 +25109,7 @@ var Dropdown = function Dropdown(_ref13) {
25105
25109
  width: "100%",
25106
25110
  dataQa: "".concat(ariaLabelledby, "-dropdown")
25107
25111
  }, /*#__PURE__*/React__default.createElement(Box, {
25112
+ id: inputId,
25108
25113
  as: "input",
25109
25114
  autoComplete: autocompleteValue,
25110
25115
  "aria-controls": "".concat(ariaLabelledby, "_listbox"),
@@ -25307,7 +25312,11 @@ var FormSelect = function FormSelect(_ref) {
25307
25312
  _ref$widthFitOptions = _ref.widthFitOptions,
25308
25313
  widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
25309
25314
  _ref$isRequired = _ref.isRequired,
25310
- isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
25315
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
25316
+ _ref$htmlFor = _ref.htmlFor,
25317
+ htmlFor = _ref$htmlFor === void 0 ? null : _ref$htmlFor,
25318
+ _ref$inputId = _ref.inputId,
25319
+ inputId = _ref$inputId === void 0 ? null : _ref$inputId;
25311
25320
  var _useState = React.useState(false),
25312
25321
  _useState2 = _slicedToArray(_useState, 2),
25313
25322
  open = _useState2[0],
@@ -25341,8 +25350,10 @@ var FormSelect = function FormSelect(_ref) {
25341
25350
  color: themeValues.labelColor,
25342
25351
  weight: themeValues.fontWeight,
25343
25352
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
25344
- id: createIdFromString(labelTextWhenNoError)
25353
+ id: createIdFromString(labelTextWhenNoError),
25354
+ htmlFor: htmlFor
25345
25355
  }, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
25356
+ inputId: inputId,
25346
25357
  ariaLabelledby: createIdFromString(labelTextWhenNoError),
25347
25358
  ariaDescribedby: createIdFromString(labelTextWhenNoError, "error message"),
25348
25359
  maxHeight: dropdownMaxHeight,
@@ -26977,7 +26988,7 @@ var fallbackValues$k = {
26977
26988
  };
26978
26989
 
26979
26990
  var _excluded$s = ["showErrors", "themeValues"],
26980
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
26991
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "htmlFor", "inputId"];
26981
26992
  var InputField = styled__default.input.withConfig({
26982
26993
  displayName: "FormInput__InputField",
26983
26994
  componentId: "sc-l094r1-0"
@@ -27065,6 +27076,10 @@ var FormInput = function FormInput(_ref15) {
27065
27076
  dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
27066
27077
  _ref15$isRequired = _ref15.isRequired,
27067
27078
  isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
27079
+ _ref15$htmlFor = _ref15.htmlFor,
27080
+ htmlFor = _ref15$htmlFor === void 0 ? null : _ref15$htmlFor,
27081
+ _ref15$inputId = _ref15.inputId,
27082
+ inputId = _ref15$inputId === void 0 ? null : _ref15$inputId,
27068
27083
  props = _objectWithoutProperties(_ref15, _excluded2);
27069
27084
  var _useState = React.useState(false),
27070
27085
  _useState2 = _slicedToArray(_useState, 2),
@@ -27102,7 +27117,8 @@ var FormInput = function FormInput(_ref15) {
27102
27117
  variant: "pS",
27103
27118
  weight: themeValues.fontWeight,
27104
27119
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
27105
- id: createIdFromString(labelTextWhenNoError)
27120
+ id: createIdFromString(labelTextWhenNoError),
27121
+ htmlFor: htmlFor
27106
27122
  }, labelTextWhenNoError), helperModal()) : /*#__PURE__*/React__default.createElement(Box, {
27107
27123
  padding: "0",
27108
27124
  minWidth: "100%"
@@ -27115,7 +27131,8 @@ var FormInput = function FormInput(_ref15) {
27115
27131
  variant: "pS",
27116
27132
  fontWeight: themeValues.fontWeight,
27117
27133
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
27118
- id: createIdFromString(labelTextWhenNoError)
27134
+ id: createIdFromString(labelTextWhenNoError),
27135
+ htmlFor: htmlFor
27119
27136
  }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(Text$1, {
27120
27137
  variant: "pS",
27121
27138
  color: themeValues.linkColor,
@@ -27136,6 +27153,7 @@ var FormInput = function FormInput(_ref15) {
27136
27153
  }, decorator)))), /*#__PURE__*/React__default.createElement(Box, {
27137
27154
  padding: "0"
27138
27155
  }, formatter ? /*#__PURE__*/React__default.createElement(FormattedInputField, _extends({
27156
+ id: inputId || (props === null || props === void 0 ? void 0 : props.id),
27139
27157
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
27140
27158
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
27141
27159
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
@@ -27168,6 +27186,7 @@ var FormInput = function FormInput(_ref15) {
27168
27186
  }
27169
27187
  }
27170
27188
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
27189
+ id: inputId || (props === null || props === void 0 ? void 0 : props.id),
27171
27190
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
27172
27191
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
27173
27192
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
@@ -39307,7 +39326,11 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39307
39326
  showErrors = _ref.showErrors,
39308
39327
  countryCode = _ref.countryCode,
39309
39328
  _ref$isRequired = _ref.isRequired,
39310
- isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
39329
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
39330
+ _ref$htmlFor = _ref.htmlFor,
39331
+ htmlFor = _ref$htmlFor === void 0 ? null : _ref$htmlFor,
39332
+ _ref$inputId = _ref.inputId,
39333
+ inputId = _ref$inputId === void 0 ? null : _ref$inputId;
39311
39334
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
39312
39335
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
39313
39336
  return /*#__PURE__*/React__default.createElement(FormSelect$1, {
@@ -39318,6 +39341,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39318
39341
  errorMessages: errorMessages,
39319
39342
  showErrors: showErrors,
39320
39343
  autocompleteValue: "address-level1",
39344
+ htmlFor: htmlFor,
39345
+ inputId: inputId,
39321
39346
  isRequired: isRequired
39322
39347
  });
39323
39348
  };
@@ -40843,6 +40868,8 @@ var AddressForm = function AddressForm(_ref) {
40843
40868
  return e.key === "Enter" && handleSubmit(e);
40844
40869
  },
40845
40870
  autocompleteValue: "address-line1",
40871
+ htmlFor: "address-line1",
40872
+ inputId: "address-line1",
40846
40873
  dataQa: "Address",
40847
40874
  isRequired: true
40848
40875
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
@@ -40854,6 +40881,8 @@ var AddressForm = function AddressForm(_ref) {
40854
40881
  return e.key === "Enter" && handleSubmit(e);
40855
40882
  },
40856
40883
  autocompleteValue: "address-line2",
40884
+ htmlFor: "address-line2",
40885
+ inputId: "address-line2",
40857
40886
  dataQa: "Address Line 2"
40858
40887
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
40859
40888
  labelTextWhenNoError: "City",
@@ -40865,6 +40894,8 @@ var AddressForm = function AddressForm(_ref) {
40865
40894
  return e.key === "Enter" && handleSubmit(e);
40866
40895
  },
40867
40896
  autocompleteValue: "address-level2",
40897
+ htmlFor: "city",
40898
+ inputId: "city",
40868
40899
  dataQa: "City",
40869
40900
  isRequired: true
40870
40901
  }), /*#__PURE__*/React__default.createElement(FormStateDropdown, {
@@ -40877,6 +40908,9 @@ var AddressForm = function AddressForm(_ref) {
40877
40908
  onKeyDown: function onKeyDown(e) {
40878
40909
  return e.key === "Enter" && handleSubmit(e);
40879
40910
  },
40911
+ autocompleteValue: "address-level1",
40912
+ htmlFor: "stateOrProvince",
40913
+ inputId: "stateOrProvince",
40880
40914
  dataQa: "State or Province",
40881
40915
  isRequired: true
40882
40916
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
@@ -40891,6 +40925,8 @@ var AddressForm = function AddressForm(_ref) {
40891
40925
  return e.key === "Enter" && handleSubmit(e);
40892
40926
  },
40893
40927
  autocompleteValue: "postal-code",
40928
+ htmlFor: "postal-code",
40929
+ inputId: "postal-code",
40894
40930
  dataQa: "Zip code",
40895
40931
  isRequired: true
40896
40932
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {