@thecb/components 8.4.11-beta.14 → 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.esm.js CHANGED
@@ -22068,7 +22068,7 @@ var HiddenCheckbox = styled.input.attrs({
22068
22068
  displayName: "Checkbox__HiddenCheckbox",
22069
22069
  componentId: "sc-36kqbv-3"
22070
22070
  })(["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;"]);
22071
- var StyledCheckbox = styled.div.withConfig({
22071
+ var StyledCheckbox = styled.input.withConfig({
22072
22072
  displayName: "Checkbox__StyledCheckbox",
22073
22073
  componentId: "sc-36kqbv-4"
22074
22074
  })(["display:inline-block;width:24px;height:24px;border-radius:2px;transition:all 150ms;", "{visibility:", ";}", ";"], CheckboxIcon, function (_ref2) {
@@ -22141,10 +22141,9 @@ var Checkbox = function Checkbox(_ref4) {
22141
22141
  "aria-label": name,
22142
22142
  checked: checked,
22143
22143
  onChange: onChange,
22144
- tabIndex: "-1",
22145
- "aria-invalid": error,
22146
- "aria-describedby": error ? "".concat(name, "-error-message") : ""
22144
+ tabIndex: "-1"
22147
22145
  }), /*#__PURE__*/React.createElement(StyledCheckbox, {
22146
+ type: "checkbox",
22148
22147
  error: error,
22149
22148
  disabled: disabled,
22150
22149
  checked: checked,
@@ -22154,7 +22153,9 @@ var Checkbox = function Checkbox(_ref4) {
22154
22153
  errorStyles: themeValues.errorStyles,
22155
22154
  disabledStyles: themeValues.disabledStyles,
22156
22155
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22157
- focusedStyles: themeValues.focusedStyles
22156
+ focusedStyles: themeValues.focusedStyles,
22157
+ "aria-invalid": error,
22158
+ "aria-describedby": error ? "".concat(name, "-error-message") : ""
22158
22159
  }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22159
22160
  viewBox: "0 0 24 24",
22160
22161
  disabled: disabled,
@@ -24204,7 +24205,7 @@ var FormSelect = function FormSelect(_ref) {
24204
24205
  weight: themeValues.fontWeight,
24205
24206
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24206
24207
  id: createIdFromString(labelTextWhenNoError)
24207
- }, "".concat(labelTextWhenNoError).concat(options.required ? "*" : "")))), /*#__PURE__*/React.createElement(Dropdown$1, {
24208
+ }, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
24208
24209
  ariaLabelledby: createIdFromString(labelTextWhenNoError),
24209
24210
  ariaDescribedby: "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
24210
24211
  maxHeight: dropdownMaxHeight,
@@ -25846,7 +25847,7 @@ var fallbackValues$k = {
25846
25847
  };
25847
25848
 
25848
25849
  var _excluded$p = ["showErrors", "themeValues"],
25849
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles", "removeFromValue"];
25850
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "isPhone", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocomplete", "extraStyles", "removeFromValue"];
25850
25851
  var InputField = styled.input.withConfig({
25851
25852
  displayName: "FormInput__InputField",
25852
25853
  componentId: "sc-l094r1-0"
@@ -25917,6 +25918,8 @@ var FormInput = function FormInput(_ref15) {
25917
25918
  isNum = _ref15$isNum === void 0 ? false : _ref15$isNum,
25918
25919
  _ref15$isEmail = _ref15.isEmail,
25919
25920
  isEmail = _ref15$isEmail === void 0 ? false : _ref15$isEmail,
25921
+ _ref15$isPhone = _ref15.isPhone,
25922
+ isPhone = _ref15$isPhone === void 0 ? false : _ref15$isPhone,
25920
25923
  _ref15$helperModal = _ref15.helperModal,
25921
25924
  helperModal = _ref15$helperModal === void 0 ? false : _ref15$helperModal,
25922
25925
  field = _ref15.field,
@@ -25993,7 +25996,7 @@ var FormInput = function FormInput(_ref15) {
25993
25996
  "aria-label": showPassword ? "Hide Password" : "Show password",
25994
25997
  "aria-live": "polite",
25995
25998
  onKeyPress: function onKeyPress(e) {
25996
- return (e.key === "Enter" || e.code === "Space") && setShowPassword(!showPassword);
25999
+ return e.key === "Enter" && setShowPassword(!showPassword);
25997
26000
  }
25998
26001
  }, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React.createElement(Box, {
25999
26002
  padding: "0 0 0 auto"
@@ -26009,7 +26012,17 @@ var FormInput = function FormInput(_ref15) {
26009
26012
  type: type,
26010
26013
  value: field.rawValue,
26011
26014
  pattern: isNum ? "[0-9]*" : "",
26012
- inputMode: isNum ? "numeric" : isEmail ? "email" : "text",
26015
+ inputMode: function inputMode() {
26016
+ if (isNum) {
26017
+ return "numeric";
26018
+ } else if (isEmail) {
26019
+ return "email";
26020
+ } else if (isPhone) {
26021
+ return "tel";
26022
+ } else {
26023
+ return "text";
26024
+ }
26025
+ },
26013
26026
  field: field,
26014
26027
  formatter: formatter,
26015
26028
  showErrors: showErrors,
@@ -40344,7 +40357,7 @@ var AddressForm = function AddressForm(_ref) {
40344
40357
  }, []);
40345
40358
  }
40346
40359
 
40347
- var street1ErrorMessages = _defineProperty({}, required.error, "Street is required");
40360
+ var street1ErrorMessages = _defineProperty({}, required.error, "Street address is required");
40348
40361
 
40349
40362
  var cityErrorMessages = _defineProperty({}, required.error, "City is required");
40350
40363
 
@@ -40421,7 +40434,8 @@ var AddressForm = function AddressForm(_ref) {
40421
40434
  return e.key === "Enter" && handleSubmit(e);
40422
40435
  },
40423
40436
  "aria-label": isUS ? "State" : "State or Province",
40424
- required: true
40437
+ required: true,
40438
+ autocomplete: "administrative-area"
40425
40439
  }), /*#__PURE__*/React.createElement(FormInput$1, {
40426
40440
  isNum: isUS,
40427
40441
  formatter: isUS ? zipFormat : null,
@@ -40438,7 +40452,7 @@ var AddressForm = function AddressForm(_ref) {
40438
40452
  required: true
40439
40453
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
40440
40454
  name: "address checkbox",
40441
- title: "Save address to Wallet",
40455
+ title: "Save address to wallet",
40442
40456
  checked: walletCheckboxMarked,
40443
40457
  onChange: saveToWallet
40444
40458
  })));
@@ -48791,11 +48805,14 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48791
48805
  toggleOpen: toggleTerms,
48792
48806
  linkVariant: modalVariant,
48793
48807
  title: modalTitle
48794
- })), showCheckbox && hasError && /*#__PURE__*/React.createElement(Text$1, {
48808
+ })), /*#__PURE__*/React.createElement("div", {
48809
+ "aria-live": "polite",
48810
+ "aria-atomic": true
48811
+ }, showCheckbox && hasError && /*#__PURE__*/React.createElement(Text$1, {
48795
48812
  variant: "pXS",
48796
48813
  color: ERROR_COLOR,
48797
48814
  id: "".concat(id, "-error-message")
48798
- }, errorMessage)))));
48815
+ }, errorMessage))))));
48799
48816
  };
48800
48817
 
48801
48818
  var _excluded$y = ["version"];
@@ -49358,8 +49375,8 @@ var PhoneForm = function PhoneForm(_ref) {
49358
49375
  onKeyUp: function onKeyUp(e) {
49359
49376
  return e.key === "Enter" && handleSubmit(e);
49360
49377
  },
49361
- isNum: true,
49362
- autocomplete: "tel"
49378
+ autocomplete: "tel",
49379
+ isPhone: true
49363
49380
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
49364
49381
  name: "phone checkbox",
49365
49382
  title: "Save phone number to wallet",