@thecb/components 8.4.11-beta.15 → 8.4.11-beta.16

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
@@ -22076,7 +22076,7 @@ var HiddenCheckbox = styled__default.input.attrs({
22076
22076
  displayName: "Checkbox__HiddenCheckbox",
22077
22077
  componentId: "sc-36kqbv-3"
22078
22078
  })(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]);
22079
- var StyledCheckbox = styled__default.div.withConfig({
22079
+ var StyledCheckbox = styled__default.input.withConfig({
22080
22080
  displayName: "Checkbox__StyledCheckbox",
22081
22081
  componentId: "sc-36kqbv-4"
22082
22082
  })(["display:inline-block;width:24px;height:24px;border-radius:2px;transition:all 150ms;", "{visibility:", ";}", ";"], CheckboxIcon, function (_ref2) {
@@ -22149,10 +22149,9 @@ var Checkbox = function Checkbox(_ref4) {
22149
22149
  "aria-label": name,
22150
22150
  checked: checked,
22151
22151
  onChange: onChange,
22152
- tabIndex: "-1",
22153
- "aria-invalid": error,
22154
- "aria-describedby": error ? "".concat(name, "-error-message") : ""
22152
+ tabIndex: "-1"
22155
22153
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22154
+ type: "checkbox",
22156
22155
  error: error,
22157
22156
  disabled: disabled,
22158
22157
  checked: checked,
@@ -22162,7 +22161,9 @@ var Checkbox = function Checkbox(_ref4) {
22162
22161
  errorStyles: themeValues.errorStyles,
22163
22162
  disabledStyles: themeValues.disabledStyles,
22164
22163
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22165
- focusedStyles: themeValues.focusedStyles
22164
+ focusedStyles: themeValues.focusedStyles,
22165
+ "aria-invalid": error,
22166
+ "aria-describedby": error ? "".concat(name, "-error-message") : ""
22166
22167
  }, /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22167
22168
  viewBox: "0 0 24 24",
22168
22169
  disabled: disabled,
@@ -24212,7 +24213,7 @@ var FormSelect = function FormSelect(_ref) {
24212
24213
  weight: themeValues.fontWeight,
24213
24214
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24214
24215
  id: createIdFromString(labelTextWhenNoError)
24215
- }, "".concat(labelTextWhenNoError).concat(options.required ? "*" : "")))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
24216
+ }, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
24216
24217
  ariaLabelledby: createIdFromString(labelTextWhenNoError),
24217
24218
  ariaDescribedby: "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
24218
24219
  maxHeight: dropdownMaxHeight,
@@ -25854,7 +25855,7 @@ var fallbackValues$k = {
25854
25855
  };
25855
25856
 
25856
25857
  var _excluded$p = ["showErrors", "themeValues"],
25857
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles", "removeFromValue"];
25858
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "isPhone", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles", "removeFromValue"];
25858
25859
  var InputField = styled__default.input.withConfig({
25859
25860
  displayName: "FormInput__InputField",
25860
25861
  componentId: "sc-l094r1-0"
@@ -25925,6 +25926,8 @@ var FormInput = function FormInput(_ref15) {
25925
25926
  isNum = _ref15$isNum === void 0 ? false : _ref15$isNum,
25926
25927
  _ref15$isEmail = _ref15.isEmail,
25927
25928
  isEmail = _ref15$isEmail === void 0 ? false : _ref15$isEmail,
25929
+ _ref15$isPhone = _ref15.isPhone,
25930
+ isPhone = _ref15$isPhone === void 0 ? false : _ref15$isPhone,
25928
25931
  _ref15$helperModal = _ref15.helperModal,
25929
25932
  helperModal = _ref15$helperModal === void 0 ? false : _ref15$helperModal,
25930
25933
  field = _ref15.field,
@@ -26001,7 +26004,7 @@ var FormInput = function FormInput(_ref15) {
26001
26004
  "aria-label": showPassword ? "Hide Password" : "Show password",
26002
26005
  "aria-live": "polite",
26003
26006
  onKeyPress: function onKeyPress(e) {
26004
- return (e.key === "Enter" || e.code === "Space") && setShowPassword(!showPassword);
26007
+ return e.key === "Enter" && setShowPassword(!showPassword);
26005
26008
  }
26006
26009
  }, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
26007
26010
  padding: "0 0 0 auto"
@@ -26017,7 +26020,17 @@ var FormInput = function FormInput(_ref15) {
26017
26020
  type: type,
26018
26021
  value: field.rawValue,
26019
26022
  pattern: isNum ? "[0-9]*" : "",
26020
- inputMode: isNum ? "numeric" : isEmail ? "email" : "text",
26023
+ inputMode: function inputMode() {
26024
+ if (isNum) {
26025
+ return "numeric";
26026
+ } else if (isEmail) {
26027
+ return "email";
26028
+ } else if (isPhone) {
26029
+ return "tel";
26030
+ } else {
26031
+ return "text";
26032
+ }
26033
+ },
26021
26034
  field: field,
26022
26035
  formatter: formatter,
26023
26036
  showErrors: showErrors,
@@ -40352,7 +40365,7 @@ var AddressForm = function AddressForm(_ref) {
40352
40365
  }, []);
40353
40366
  }
40354
40367
 
40355
- var street1ErrorMessages = _defineProperty({}, required.error, "Street is required");
40368
+ var street1ErrorMessages = _defineProperty({}, required.error, "Street address is required");
40356
40369
 
40357
40370
  var cityErrorMessages = _defineProperty({}, required.error, "City is required");
40358
40371
 
@@ -40429,7 +40442,8 @@ var AddressForm = function AddressForm(_ref) {
40429
40442
  return e.key === "Enter" && handleSubmit(e);
40430
40443
  },
40431
40444
  "aria-label": isUS ? "State" : "State or Province",
40432
- required: true
40445
+ required: true,
40446
+ autocomplete: "administrative-area"
40433
40447
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
40434
40448
  isNum: isUS,
40435
40449
  formatter: isUS ? zipFormat : null,
@@ -40446,7 +40460,7 @@ var AddressForm = function AddressForm(_ref) {
40446
40460
  required: true
40447
40461
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
40448
40462
  name: "address checkbox",
40449
- title: "Save address to Wallet",
40463
+ title: "Save address to wallet",
40450
40464
  checked: walletCheckboxMarked,
40451
40465
  onChange: saveToWallet
40452
40466
  })));
@@ -48799,11 +48813,14 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48799
48813
  toggleOpen: toggleTerms,
48800
48814
  linkVariant: modalVariant,
48801
48815
  title: modalTitle
48802
- })), showCheckbox && hasError && /*#__PURE__*/React__default.createElement(Text$1, {
48816
+ })), /*#__PURE__*/React__default.createElement("div", {
48817
+ "aria-live": "polite",
48818
+ "aria-atomic": true
48819
+ }, showCheckbox && hasError && /*#__PURE__*/React__default.createElement(Text$1, {
48803
48820
  variant: "pXS",
48804
48821
  color: ERROR_COLOR,
48805
48822
  id: "".concat(id, "-error-message")
48806
- }, errorMessage)))));
48823
+ }, errorMessage))))));
48807
48824
  };
48808
48825
 
48809
48826
  var _excluded$y = ["version"];
@@ -49366,8 +49383,8 @@ var PhoneForm = function PhoneForm(_ref) {
49366
49383
  onKeyUp: function onKeyUp(e) {
49367
49384
  return e.key === "Enter" && handleSubmit(e);
49368
49385
  },
49369
- isNum: true,
49370
- autocomplete: "tel"
49386
+ autocomplete: "tel",
49387
+ isPhone: true
49371
49388
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
49372
49389
  name: "phone checkbox",
49373
49390
  title: "Save phone number to wallet",