@chekinapp/ui 0.0.141 → 0.0.143

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 CHANGED
@@ -14575,6 +14575,9 @@ var PhoneInput = React50.forwardRef(
14575
14575
  onChange,
14576
14576
  onFocus,
14577
14577
  onBlur,
14578
+ onKeyDown,
14579
+ onFieldFocus,
14580
+ onFieldBlur,
14578
14581
  name,
14579
14582
  codeName,
14580
14583
  numberName,
@@ -14594,14 +14597,15 @@ var PhoneInput = React50.forwardRef(
14594
14597
  className,
14595
14598
  autoDetectCode = true,
14596
14599
  searchable = true,
14597
- defaultCode
14600
+ defaultCode,
14601
+ defaultNumber
14598
14602
  }, ref) {
14599
14603
  const { t } = (0, import_react_i18next33.useTranslation)();
14600
14604
  const groupLabelId = React50.useId();
14601
14605
  const errorMsgId = React50.useId();
14602
14606
  const numberInputRef = React50.useRef(null);
14603
14607
  const [codeSearchValue, setCodeSearchValue] = React50.useState("");
14604
- const safeValue = toPhoneValue(value);
14608
+ const safeValue = toPhoneValue(value, defaultCode, defaultNumber);
14605
14609
  const effectiveCode = safeValue.code || defaultCode || "";
14606
14610
  const resolvedLabel = label ?? "";
14607
14611
  const hasExternalError = Boolean(error);
@@ -14743,7 +14747,9 @@ var PhoneInput = React50.forwardRef(
14743
14747
  className: "max-w-none w-auto",
14744
14748
  dropdownClassName: "right-auto w-[280px]",
14745
14749
  inputValue: searchable ? codeSearchValue : void 0,
14746
- onInputChange: setCodeSearchValue
14750
+ onInputChange: setCodeSearchValue,
14751
+ onFocus: () => onFieldFocus?.("code"),
14752
+ onBlur: () => onFieldBlur?.("code")
14747
14753
  }
14748
14754
  ),
14749
14755
  /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
@@ -14764,8 +14770,15 @@ var PhoneInput = React50.forwardRef(
14764
14770
  "aria-label": resolvedLabel || name,
14765
14771
  "aria-describedby": errorMessage ? errorMsgId : void 0,
14766
14772
  onChange: handleNumberChange,
14767
- onFocus,
14768
- onBlur,
14773
+ onKeyDown,
14774
+ onFocus: (event) => {
14775
+ onFocus?.(event);
14776
+ onFieldFocus?.("number");
14777
+ },
14778
+ onBlur: (event) => {
14779
+ onBlur?.(event);
14780
+ onFieldBlur?.("number");
14781
+ },
14769
14782
  renderErrorMessage: false,
14770
14783
  wrapperClassName: "max-w-none w-auto",
14771
14784
  contentClassName: readOnly ? "!cursor-default" : void 0,