@arkyn/components 1.4.56 → 1.4.57

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,eAAe,EAAE,MAAM,cAAc,CAAC;AAY5D,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CAkKzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PhoneInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAe,eAAe,EAAE,MAAM,cAAc,CAAC;AAY5D,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CAoKzC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { countries } from "@arkyn/templates";
3
- import { formatToPhone } from "@arkyn/shared";
4
3
  import { useRef, useState } from "react";
5
4
  import { useFormController } from "../Form/FormController";
6
5
  import { PhoneInputContainer } from "./components/PhoneInputContainer";
@@ -17,7 +16,9 @@ function PhoneInput(props) {
17
16
  const [search, setSearch] = useState("");
18
17
  const [showCountryOptions, setShowCountryOptions] = useState(false);
19
18
  const [value, setValue] = useState(defaultData.formattedNumber || "");
20
- const usedValue = formatToPhone(fixedValue) || value;
19
+ const usedValue = fixedValue
20
+ ? getDefaultFormatPhoneNumber(fixedValue).formattedNumber
21
+ : value;
21
22
  const [currentCountry, setCurrentCountry] = useState(() => {
22
23
  if (defaultData.country)
23
24
  return defaultData.country;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/components",
3
- "version": "1.4.56",
3
+ "version": "1.4.57",
4
4
  "main": "./dist/bundle.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Lucas Gonçalves",
@@ -1,5 +1,4 @@
1
1
  import { countries } from "@arkyn/templates";
2
- import { formatToPhone } from "@arkyn/shared";
3
2
  import { CountryType, PhoneInputProps } from "@arkyn/types";
4
3
  import { useRef, useState } from "react";
5
4
 
@@ -36,7 +35,9 @@ function PhoneInput(props: PhoneInputProps) {
36
35
  const [search, setSearch] = useState("");
37
36
  const [showCountryOptions, setShowCountryOptions] = useState(false);
38
37
  const [value, setValue] = useState(defaultData.formattedNumber || "");
39
- const usedValue = formatToPhone(fixedValue) || value;
38
+ const usedValue = fixedValue
39
+ ? getDefaultFormatPhoneNumber(fixedValue).formattedNumber
40
+ : value;
40
41
 
41
42
  const [currentCountry, setCurrentCountry] = useState<CountryType>(() => {
42
43
  if (defaultData.country) return defaultData.country;