@thecb/components 10.8.2-beta.0 → 10.9.0-beta.1

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
@@ -629,6 +629,8 @@ interface FormSelectProps {
629
629
  smoothScroll?: boolean;
630
630
  dataQa?: string | null;
631
631
  widthFitOptions?: boolean;
632
+ htmlFor?: string;
633
+ inputId?: string;
632
634
  }
633
635
 
634
636
  declare const FormSelect: React.FC<Expand<FormSelectProps> &
@@ -821,6 +823,7 @@ interface BoxProps {
821
823
  extraStyles?: string;
822
824
  srOnly?: boolean;
823
825
  dataQa?: string;
826
+ id?: string;
824
827
  }
825
828
 
826
829
  declare const Box: React.FC<Expand<BoxProps> &
@@ -1103,6 +1106,8 @@ interface TextProps {
1103
1106
  as?: string;
1104
1107
  dataQa?: string;
1105
1108
  variant?: string;
1109
+ htmlFor?: string;
1110
+ inputId?: string;
1106
1111
  }
1107
1112
 
1108
1113
  declare const Text: React.FC<Expand<TextProps> &
package/dist/index.esm.js CHANGED
@@ -6540,7 +6540,7 @@ var BoxWrapper = styled(function (_ref) {
6540
6540
  });
6541
6541
  /* eslint-enable no-unused-vars */
6542
6542
 
6543
- 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"];
6543
+ 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"];
6544
6544
 
6545
6545
  /*
6546
6546
  Box component to create generic boxes
@@ -6589,6 +6589,7 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
6589
6589
  _ref$srOnly = _ref.srOnly,
6590
6590
  srOnly = _ref$srOnly === void 0 ? false : _ref$srOnly,
6591
6591
  dataQa = _ref.dataQa,
6592
+ id = _ref.id,
6592
6593
  children = _ref.children,
6593
6594
  rest = _objectWithoutProperties(_ref, _excluded$3);
6594
6595
  return /*#__PURE__*/React.createElement(BoxWrapper, _extends({
@@ -6624,7 +6625,8 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
6624
6625
  onFocus: onFocus,
6625
6626
  onBlur: onBlur,
6626
6627
  onTouchEnd: onTouchEnd,
6627
- ref: ref
6628
+ ref: ref,
6629
+ id: id
6628
6630
  }, rest), children && safeChildren(children, /*#__PURE__*/React.createElement(Fragment$1, null)));
6629
6631
  });
6630
6632
 
@@ -24888,7 +24890,9 @@ var Dropdown = function Dropdown(_ref13) {
24888
24890
  _ref13$ariaInvalid = _ref13.ariaInvalid,
24889
24891
  ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
24890
24892
  _ref13$isRequired = _ref13.isRequired,
24891
- isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
24893
+ isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired,
24894
+ _ref13$inputId = _ref13.inputId,
24895
+ inputId = _ref13$inputId === void 0 ? false : _ref13$inputId;
24892
24896
  var _useState = useState(""),
24893
24897
  _useState2 = _slicedToArray(_useState, 2),
24894
24898
  inputValue = _useState2[0],
@@ -25097,6 +25101,7 @@ var Dropdown = function Dropdown(_ref13) {
25097
25101
  width: "100%",
25098
25102
  dataQa: "".concat(ariaLabelledby, "-dropdown")
25099
25103
  }, /*#__PURE__*/React.createElement(Box, {
25104
+ id: inputId,
25100
25105
  as: "input",
25101
25106
  autoComplete: autocompleteValue,
25102
25107
  "aria-controls": "".concat(ariaLabelledby, "_listbox"),
@@ -25299,7 +25304,11 @@ var FormSelect = function FormSelect(_ref) {
25299
25304
  _ref$widthFitOptions = _ref.widthFitOptions,
25300
25305
  widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
25301
25306
  _ref$isRequired = _ref.isRequired,
25302
- isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
25307
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
25308
+ _ref$htmlFor = _ref.htmlFor,
25309
+ htmlFor = _ref$htmlFor === void 0 ? null : _ref$htmlFor,
25310
+ _ref$inputId = _ref.inputId,
25311
+ inputId = _ref$inputId === void 0 ? null : _ref$inputId;
25303
25312
  var _useState = useState(false),
25304
25313
  _useState2 = _slicedToArray(_useState, 2),
25305
25314
  open = _useState2[0],
@@ -25333,8 +25342,10 @@ var FormSelect = function FormSelect(_ref) {
25333
25342
  color: themeValues.labelColor,
25334
25343
  weight: themeValues.fontWeight,
25335
25344
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
25336
- id: createIdFromString(labelTextWhenNoError)
25345
+ id: createIdFromString(labelTextWhenNoError),
25346
+ htmlFor: htmlFor
25337
25347
  }, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
25348
+ inputId: inputId,
25338
25349
  ariaLabelledby: createIdFromString(labelTextWhenNoError),
25339
25350
  ariaDescribedby: createIdFromString(labelTextWhenNoError, "error message"),
25340
25351
  maxHeight: dropdownMaxHeight,
@@ -26131,7 +26142,11 @@ var CountryDropdown = function CountryDropdown(_ref) {
26131
26142
  _ref$isRequired = _ref.isRequired,
26132
26143
  isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
26133
26144
  _ref$dataQa = _ref.dataQa,
26134
- dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
26145
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
26146
+ _ref$htmlFor = _ref.htmlFor,
26147
+ htmlFor = _ref$htmlFor === void 0 ? null : _ref$htmlFor,
26148
+ _ref$inputId = _ref.inputId,
26149
+ inputId = _ref$inputId === void 0 ? null : _ref$inputId;
26135
26150
  return /*#__PURE__*/React.createElement(FormSelect$1, {
26136
26151
  options: options,
26137
26152
  field: field,
@@ -26142,6 +26157,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
26142
26157
  showErrors: showErrors,
26143
26158
  onChange: onChange,
26144
26159
  autocompleteValue: "country-name",
26160
+ htmlFor: htmlFor,
26161
+ inputId: inputId,
26145
26162
  isRequired: isRequired
26146
26163
  });
26147
26164
  };
@@ -26969,7 +26986,7 @@ var fallbackValues$k = {
26969
26986
  };
26970
26987
 
26971
26988
  var _excluded$s = ["showErrors", "themeValues"],
26972
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
26989
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "htmlFor", "inputId"];
26973
26990
  var InputField = styled.input.withConfig({
26974
26991
  displayName: "FormInput__InputField",
26975
26992
  componentId: "sc-l094r1-0"
@@ -27057,6 +27074,10 @@ var FormInput = function FormInput(_ref15) {
27057
27074
  dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
27058
27075
  _ref15$isRequired = _ref15.isRequired,
27059
27076
  isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
27077
+ _ref15$htmlFor = _ref15.htmlFor,
27078
+ htmlFor = _ref15$htmlFor === void 0 ? null : _ref15$htmlFor,
27079
+ _ref15$inputId = _ref15.inputId,
27080
+ inputId = _ref15$inputId === void 0 ? null : _ref15$inputId,
27060
27081
  props = _objectWithoutProperties(_ref15, _excluded2);
27061
27082
  var _useState = useState(false),
27062
27083
  _useState2 = _slicedToArray(_useState, 2),
@@ -27094,7 +27115,8 @@ var FormInput = function FormInput(_ref15) {
27094
27115
  variant: "pS",
27095
27116
  weight: themeValues.fontWeight,
27096
27117
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
27097
- id: createIdFromString(labelTextWhenNoError)
27118
+ id: createIdFromString(labelTextWhenNoError),
27119
+ htmlFor: htmlFor
27098
27120
  }, labelTextWhenNoError), helperModal()) : /*#__PURE__*/React.createElement(Box, {
27099
27121
  padding: "0",
27100
27122
  minWidth: "100%"
@@ -27107,7 +27129,8 @@ var FormInput = function FormInput(_ref15) {
27107
27129
  variant: "pS",
27108
27130
  fontWeight: themeValues.fontWeight,
27109
27131
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
27110
- id: createIdFromString(labelTextWhenNoError)
27132
+ id: createIdFromString(labelTextWhenNoError),
27133
+ htmlFor: htmlFor
27111
27134
  }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React.createElement(Text$1, {
27112
27135
  variant: "pS",
27113
27136
  color: themeValues.linkColor,
@@ -27128,6 +27151,7 @@ var FormInput = function FormInput(_ref15) {
27128
27151
  }, decorator)))), /*#__PURE__*/React.createElement(Box, {
27129
27152
  padding: "0"
27130
27153
  }, formatter ? /*#__PURE__*/React.createElement(FormattedInputField, _extends({
27154
+ id: inputId || (props === null || props === void 0 ? void 0 : props.id),
27131
27155
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
27132
27156
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
27133
27157
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
@@ -27160,6 +27184,7 @@ var FormInput = function FormInput(_ref15) {
27160
27184
  }
27161
27185
  }
27162
27186
  }, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
27187
+ id: inputId || (props === null || props === void 0 ? void 0 : props.id),
27163
27188
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
27164
27189
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
27165
27190
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
@@ -39299,7 +39324,11 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39299
39324
  showErrors = _ref.showErrors,
39300
39325
  countryCode = _ref.countryCode,
39301
39326
  _ref$isRequired = _ref.isRequired,
39302
- isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
39327
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
39328
+ _ref$htmlFor = _ref.htmlFor,
39329
+ htmlFor = _ref$htmlFor === void 0 ? null : _ref$htmlFor,
39330
+ _ref$inputId = _ref.inputId,
39331
+ inputId = _ref$inputId === void 0 ? null : _ref$inputId;
39303
39332
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
39304
39333
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
39305
39334
  return /*#__PURE__*/React.createElement(FormSelect$1, {
@@ -39310,6 +39339,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39310
39339
  errorMessages: errorMessages,
39311
39340
  showErrors: showErrors,
39312
39341
  autocompleteValue: "address-level1",
39342
+ htmlFor: htmlFor,
39343
+ inputId: inputId,
39313
39344
  isRequired: isRequired
39314
39345
  });
39315
39346
  };
@@ -40823,6 +40854,8 @@ var AddressForm = function AddressForm(_ref) {
40823
40854
  }
40824
40855
  },
40825
40856
  showErrors: showErrors,
40857
+ htmlFor: "country-name",
40858
+ inputId: "country-name",
40826
40859
  dataQa: "Country",
40827
40860
  isRequired: true
40828
40861
  }), /*#__PURE__*/React.createElement(FormInput$1, {
@@ -40835,6 +40868,8 @@ var AddressForm = function AddressForm(_ref) {
40835
40868
  return e.key === "Enter" && handleSubmit(e);
40836
40869
  },
40837
40870
  autocompleteValue: "address-line1",
40871
+ htmlFor: "address-line1",
40872
+ inputId: "address-line1",
40838
40873
  dataQa: "Address",
40839
40874
  isRequired: true
40840
40875
  }), /*#__PURE__*/React.createElement(FormInput$1, {
@@ -40846,6 +40881,8 @@ var AddressForm = function AddressForm(_ref) {
40846
40881
  return e.key === "Enter" && handleSubmit(e);
40847
40882
  },
40848
40883
  autocompleteValue: "address-line2",
40884
+ htmlFor: "address-line2",
40885
+ inputId: "address-line2",
40849
40886
  dataQa: "Address Line 2"
40850
40887
  }), /*#__PURE__*/React.createElement(FormInput$1, {
40851
40888
  labelTextWhenNoError: "City",
@@ -40857,6 +40894,8 @@ var AddressForm = function AddressForm(_ref) {
40857
40894
  return e.key === "Enter" && handleSubmit(e);
40858
40895
  },
40859
40896
  autocompleteValue: "address-level2",
40897
+ htmlFor: "city",
40898
+ inputId: "city",
40860
40899
  dataQa: "City",
40861
40900
  isRequired: true
40862
40901
  }), /*#__PURE__*/React.createElement(FormStateDropdown, {
@@ -40869,6 +40908,9 @@ var AddressForm = function AddressForm(_ref) {
40869
40908
  onKeyDown: function onKeyDown(e) {
40870
40909
  return e.key === "Enter" && handleSubmit(e);
40871
40910
  },
40911
+ autocompleteValue: "address-level1",
40912
+ htmlFor: "stateOrProvince",
40913
+ inputId: "stateOrProvince",
40872
40914
  dataQa: "State or Province",
40873
40915
  isRequired: true
40874
40916
  }), /*#__PURE__*/React.createElement(FormInput$1, {
@@ -40883,6 +40925,8 @@ var AddressForm = function AddressForm(_ref) {
40883
40925
  return e.key === "Enter" && handleSubmit(e);
40884
40926
  },
40885
40927
  autocompleteValue: "postal-code",
40928
+ htmlFor: "postal-code",
40929
+ inputId: "postal-code",
40886
40930
  dataQa: "Zip code",
40887
40931
  isRequired: true
40888
40932
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
@@ -48016,6 +48060,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
48016
48060
  isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
48017
48061
  _ref4$isError = _ref4.isError,
48018
48062
  isError = _ref4$isError === void 0 ? false : _ref4$isError,
48063
+ _ref4$multiCartEnable = _ref4.multiCartEnabled,
48064
+ multiCartEnabled = _ref4$multiCartEnable === void 0 ? false : _ref4$multiCartEnable,
48019
48065
  agencyDisplayName = _ref4.agencyDisplayName;
48020
48066
  var _useState = useState(initiallyOpen),
48021
48067
  _useState2 = _slicedToArray(_useState, 2),
@@ -48056,7 +48102,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
48056
48102
  variant: themeValues.labeledAmountSubtotal
48057
48103
  }, fee)));
48058
48104
  });
48059
- var agencySubheading = /*#__PURE__*/React.createElement(React.Fragment, null, agencyDisplayName && /*#__PURE__*/React.createElement(Cluster, {
48105
+ var agencySubheading = /*#__PURE__*/React.createElement(React.Fragment, null, multiCartEnabled && agencyDisplayName && /*#__PURE__*/React.createElement(Cluster, {
48060
48106
  justify: "space-between",
48061
48107
  align: "center",
48062
48108
  style: {