@wix/form-public 0.99.0 → 0.100.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.js CHANGED
@@ -37041,10 +37041,6 @@ var PhoneInput = (_ref2) => {
37041
37041
  id,
37042
37042
  value,
37043
37043
  onChange,
37044
- disabled,
37045
- required,
37046
- onBlur,
37047
- onFocus,
37048
37044
  FieldLayout,
37049
37045
  defaultCountry,
37050
37046
  validation
@@ -37065,9 +37061,7 @@ var PhoneInput = (_ref2) => {
37065
37061
  onChange
37066
37062
  });
37067
37063
  const labelElement = findChildOfType(children, PhoneInput.Label);
37068
- const countryButtonElement = findChildOfType(children, PhoneInput.CountryButton);
37069
- const countryOptionsElement = findChildOfType(children, PhoneInput.CountryOptions);
37070
- const phoneNumberElement = findChildOfType(children, PhoneInput.PhoneNumber);
37064
+ const controlElement = findChildOfType(children, PhoneInput.Control);
37071
37065
  const descriptionElement = findChildOfType(children, PhoneInput.Description);
37072
37066
  const errorElement = findChildOfType(children, PhoneInput.Error);
37073
37067
  const contextValue = {
@@ -37083,19 +37077,7 @@ var PhoneInput = (_ref2) => {
37083
37077
  }, /* @__PURE__ */ React40__default.createElement(FieldLayout, {
37084
37078
  fieldId: id,
37085
37079
  renderLabel: () => labelElement,
37086
- renderInput: () => /* @__PURE__ */ React40__default.createElement("div", {
37087
- style: {
37088
- display: "flex",
37089
- gap: "8px"
37090
- }
37091
- }, /* @__PURE__ */ React40__default.createElement(Select, {
37092
- value: selectedCountryCode ?? null,
37093
- onChange: (key) => handleCountryCodeChange(key),
37094
- isDisabled: disabled,
37095
- isRequired: required,
37096
- onBlur,
37097
- onFocus
37098
- }, countryButtonElement, countryOptionsElement), phoneNumberElement),
37080
+ renderInput: () => controlElement,
37099
37081
  renderDescription: () => /* @__PURE__ */ React40__default.createElement(React40__default.Fragment, null, descriptionElement, errorElement)
37100
37082
  }));
37101
37083
  };
@@ -37270,23 +37252,52 @@ var PhoneNumber2 = (_ref1) => {
37270
37252
  var _ref$current2;
37271
37253
  (_ref$current2 = ref.current) == null || _ref$current2.focus();
37272
37254
  }, id);
37273
- return /* @__PURE__ */ React40__default.createElement(TextField, {
37274
- value: currentValue,
37275
- onChange: handlePhoneChange,
37276
- isDisabled: disabled,
37277
- isRequired: required,
37278
- onBlur,
37279
- onFocus
37280
- }, /* @__PURE__ */ React40__default.createElement(Input$1, {
37255
+ return /* @__PURE__ */ React40__default.createElement(Input$1, {
37281
37256
  ref,
37282
37257
  id: inputId,
37283
37258
  type: "tel",
37259
+ value: currentValue,
37260
+ onChange: (e2) => handlePhoneChange(e2.target.value),
37261
+ disabled,
37262
+ required,
37263
+ onBlur,
37264
+ onFocus,
37284
37265
  "aria-describedby": ariaDescribedBy,
37285
37266
  placeholder,
37286
37267
  className
37287
- }));
37268
+ });
37269
+ };
37270
+ var Control3 = (_ref10) => {
37271
+ let {
37272
+ children,
37273
+ className
37274
+ } = _ref10;
37275
+ const {
37276
+ disabled,
37277
+ required,
37278
+ onBlur,
37279
+ onFocus
37280
+ } = useFieldPropsV2();
37281
+ const {
37282
+ selectedCountryCode,
37283
+ handleCountryCodeChange
37284
+ } = usePhoneInputContext();
37285
+ const countryButtonElement = findChildOfType(children, PhoneInput.CountryButton);
37286
+ const countryOptionsElement = findChildOfType(children, PhoneInput.CountryOptions);
37287
+ const phoneNumberElement = findChildOfType(children, PhoneInput.PhoneNumber);
37288
+ return /* @__PURE__ */ React40__default.createElement("div", {
37289
+ className
37290
+ }, /* @__PURE__ */ React40__default.createElement(Select, {
37291
+ value: selectedCountryCode ?? null,
37292
+ onChange: (key) => handleCountryCodeChange(key),
37293
+ isDisabled: disabled,
37294
+ isRequired: required,
37295
+ onBlur,
37296
+ onFocus
37297
+ }, countryButtonElement, countryOptionsElement), phoneNumberElement);
37288
37298
  };
37289
37299
  PhoneInput.Label = Label;
37300
+ PhoneInput.Control = Control3;
37290
37301
  PhoneInput.CountryButton = CountryButton;
37291
37302
  PhoneInput.CountryOptions = CountryOptions;
37292
37303
  PhoneInput.PhoneNumber = PhoneNumber2;