@thecb/components 10.8.2-beta.0 → 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.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,
@@ -26969,7 +26980,7 @@ var fallbackValues$k = {
26969
26980
  };
26970
26981
 
26971
26982
  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"];
26983
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired", "htmlFor", "inputId"];
26973
26984
  var InputField = styled.input.withConfig({
26974
26985
  displayName: "FormInput__InputField",
26975
26986
  componentId: "sc-l094r1-0"
@@ -27057,6 +27068,10 @@ var FormInput = function FormInput(_ref15) {
27057
27068
  dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
27058
27069
  _ref15$isRequired = _ref15.isRequired,
27059
27070
  isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
27071
+ _ref15$htmlFor = _ref15.htmlFor,
27072
+ htmlFor = _ref15$htmlFor === void 0 ? null : _ref15$htmlFor,
27073
+ _ref15$inputId = _ref15.inputId,
27074
+ inputId = _ref15$inputId === void 0 ? null : _ref15$inputId,
27060
27075
  props = _objectWithoutProperties(_ref15, _excluded2);
27061
27076
  var _useState = useState(false),
27062
27077
  _useState2 = _slicedToArray(_useState, 2),
@@ -27094,7 +27109,8 @@ var FormInput = function FormInput(_ref15) {
27094
27109
  variant: "pS",
27095
27110
  weight: themeValues.fontWeight,
27096
27111
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
27097
- id: createIdFromString(labelTextWhenNoError)
27112
+ id: createIdFromString(labelTextWhenNoError),
27113
+ htmlFor: htmlFor
27098
27114
  }, labelTextWhenNoError), helperModal()) : /*#__PURE__*/React.createElement(Box, {
27099
27115
  padding: "0",
27100
27116
  minWidth: "100%"
@@ -27107,7 +27123,8 @@ var FormInput = function FormInput(_ref15) {
27107
27123
  variant: "pS",
27108
27124
  fontWeight: themeValues.fontWeight,
27109
27125
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
27110
- id: createIdFromString(labelTextWhenNoError)
27126
+ id: createIdFromString(labelTextWhenNoError),
27127
+ htmlFor: htmlFor
27111
27128
  }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React.createElement(Text$1, {
27112
27129
  variant: "pS",
27113
27130
  color: themeValues.linkColor,
@@ -27128,6 +27145,7 @@ var FormInput = function FormInput(_ref15) {
27128
27145
  }, decorator)))), /*#__PURE__*/React.createElement(Box, {
27129
27146
  padding: "0"
27130
27147
  }, formatter ? /*#__PURE__*/React.createElement(FormattedInputField, _extends({
27148
+ id: inputId || (props === null || props === void 0 ? void 0 : props.id),
27131
27149
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
27132
27150
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
27133
27151
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
@@ -27160,6 +27178,7 @@ var FormInput = function FormInput(_ref15) {
27160
27178
  }
27161
27179
  }
27162
27180
  }, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
27181
+ id: inputId || (props === null || props === void 0 ? void 0 : props.id),
27163
27182
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
27164
27183
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
27165
27184
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
@@ -39299,7 +39318,11 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39299
39318
  showErrors = _ref.showErrors,
39300
39319
  countryCode = _ref.countryCode,
39301
39320
  _ref$isRequired = _ref.isRequired,
39302
- isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
39321
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
39322
+ _ref$htmlFor = _ref.htmlFor,
39323
+ htmlFor = _ref$htmlFor === void 0 ? null : _ref$htmlFor,
39324
+ _ref$inputId = _ref.inputId,
39325
+ inputId = _ref$inputId === void 0 ? null : _ref$inputId;
39303
39326
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
39304
39327
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
39305
39328
  return /*#__PURE__*/React.createElement(FormSelect$1, {
@@ -39310,6 +39333,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
39310
39333
  errorMessages: errorMessages,
39311
39334
  showErrors: showErrors,
39312
39335
  autocompleteValue: "address-level1",
39336
+ htmlFor: htmlFor,
39337
+ inputId: inputId,
39313
39338
  isRequired: isRequired
39314
39339
  });
39315
39340
  };
@@ -40835,6 +40860,8 @@ var AddressForm = function AddressForm(_ref) {
40835
40860
  return e.key === "Enter" && handleSubmit(e);
40836
40861
  },
40837
40862
  autocompleteValue: "address-line1",
40863
+ htmlFor: "address-line1",
40864
+ inputId: "address-line1",
40838
40865
  dataQa: "Address",
40839
40866
  isRequired: true
40840
40867
  }), /*#__PURE__*/React.createElement(FormInput$1, {
@@ -40846,6 +40873,8 @@ var AddressForm = function AddressForm(_ref) {
40846
40873
  return e.key === "Enter" && handleSubmit(e);
40847
40874
  },
40848
40875
  autocompleteValue: "address-line2",
40876
+ htmlFor: "address-line2",
40877
+ inputId: "address-line2",
40849
40878
  dataQa: "Address Line 2"
40850
40879
  }), /*#__PURE__*/React.createElement(FormInput$1, {
40851
40880
  labelTextWhenNoError: "City",
@@ -40857,6 +40886,8 @@ var AddressForm = function AddressForm(_ref) {
40857
40886
  return e.key === "Enter" && handleSubmit(e);
40858
40887
  },
40859
40888
  autocompleteValue: "address-level2",
40889
+ htmlFor: "city",
40890
+ inputId: "city",
40860
40891
  dataQa: "City",
40861
40892
  isRequired: true
40862
40893
  }), /*#__PURE__*/React.createElement(FormStateDropdown, {
@@ -40869,6 +40900,9 @@ var AddressForm = function AddressForm(_ref) {
40869
40900
  onKeyDown: function onKeyDown(e) {
40870
40901
  return e.key === "Enter" && handleSubmit(e);
40871
40902
  },
40903
+ autocompleteValue: "address-level1",
40904
+ htmlFor: "stateOrProvince",
40905
+ inputId: "stateOrProvince",
40872
40906
  dataQa: "State or Province",
40873
40907
  isRequired: true
40874
40908
  }), /*#__PURE__*/React.createElement(FormInput$1, {
@@ -40883,6 +40917,8 @@ var AddressForm = function AddressForm(_ref) {
40883
40917
  return e.key === "Enter" && handleSubmit(e);
40884
40918
  },
40885
40919
  autocompleteValue: "postal-code",
40920
+ htmlFor: "postal-code",
40921
+ inputId: "postal-code",
40886
40922
  dataQa: "Zip code",
40887
40923
  isRequired: true
40888
40924
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
@@ -48016,6 +48052,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
48016
48052
  isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
48017
48053
  _ref4$isError = _ref4.isError,
48018
48054
  isError = _ref4$isError === void 0 ? false : _ref4$isError,
48055
+ _ref4$multiCartEnable = _ref4.multiCartEnabled,
48056
+ multiCartEnabled = _ref4$multiCartEnable === void 0 ? false : _ref4$multiCartEnable,
48019
48057
  agencyDisplayName = _ref4.agencyDisplayName;
48020
48058
  var _useState = useState(initiallyOpen),
48021
48059
  _useState2 = _slicedToArray(_useState, 2),
@@ -48056,7 +48094,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
48056
48094
  variant: themeValues.labeledAmountSubtotal
48057
48095
  }, fee)));
48058
48096
  });
48059
- var agencySubheading = /*#__PURE__*/React.createElement(React.Fragment, null, agencyDisplayName && /*#__PURE__*/React.createElement(Cluster, {
48097
+ var agencySubheading = /*#__PURE__*/React.createElement(React.Fragment, null, multiCartEnabled && agencyDisplayName && /*#__PURE__*/React.createElement(Cluster, {
48060
48098
  justify: "space-between",
48061
48099
  align: "center",
48062
48100
  style: {