formik-form-components 0.2.23 → 0.2.25

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.mjs CHANGED
@@ -12,8 +12,8 @@ import Autocomplete3 from '@mui/material/Autocomplete';
12
12
  import Typography9 from '@mui/material/Typography';
13
13
  import { Icon } from '@iconify/react';
14
14
  import Select from '@mui/material/Select';
15
- import PhoneInput from 'react-phone-input-2';
16
- import 'react-phone-input-2/lib/style.css';
15
+ import PhoneInput from 'react-phone-number-input';
16
+ import 'react-phone-number-input/style.css';
17
17
  import { useEditor, EditorContent } from '@tiptap/react';
18
18
  import StarterKit from '@tiptap/starter-kit';
19
19
  import Link from '@tiptap/extension-link';
@@ -1479,13 +1479,15 @@ var AppPhoneNoInput = ({
1479
1479
  name,
1480
1480
  label,
1481
1481
  required = false,
1482
- defaultCountry = "us",
1483
- placeholder,
1482
+ defaultCountry = "US",
1483
+ placeholder = "Enter phone number",
1484
1484
  sx,
1485
1485
  containerSx,
1486
1486
  labelSx,
1487
1487
  inputSx,
1488
- errorSx
1488
+ errorSx,
1489
+ international = true,
1490
+ withCountryCallingCode = true
1489
1491
  }) => {
1490
1492
  const { values, errors, touched, setFieldValue, setFieldTouched } = useFormikContext();
1491
1493
  const fieldError = useMemo(() => _19.get(errors, name), [errors, name]);
@@ -1524,32 +1526,39 @@ var AppPhoneNoInput = ({
1524
1526
  }
1525
1527
  ),
1526
1528
  /* @__PURE__ */ jsx(
1527
- PhoneInput,
1529
+ Box,
1528
1530
  {
1529
- country: defaultCountry,
1530
- specialLabel: "",
1531
- placeholder,
1532
- inputProps: {
1533
- name,
1534
- id: name,
1535
- required,
1536
- "aria-describedby": fieldError ? `${name}-error` : void 0,
1537
- "aria-invalid": !!fieldError,
1538
- "aria-required": required
1539
- },
1540
- inputStyle: {
1541
- width: "100%",
1542
- border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
1543
- padding: "10px",
1544
- borderRadius: "4px",
1545
- ...inputSx
1546
- },
1547
- containerStyle: {
1548
- width: "100%"
1531
+ sx: {
1532
+ "& .PhoneInput": {
1533
+ width: "100%"
1534
+ },
1535
+ "& .PhoneInputInput": {
1536
+ width: "100%",
1537
+ border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
1538
+ padding: "10px",
1539
+ borderRadius: "4px",
1540
+ fontFamily: "inherit",
1541
+ fontSize: "inherit",
1542
+ ...inputSx
1543
+ },
1544
+ "& .PhoneInputCountrySelect": {
1545
+ border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
1546
+ borderRadius: "4px"
1547
+ }
1549
1548
  },
1550
- value: values[name],
1551
- onChange: (value) => setFieldValue(name, value),
1552
- onBlur: () => setFieldTouched(name, true)
1549
+ children: /* @__PURE__ */ jsx(
1550
+ PhoneInput,
1551
+ {
1552
+ international,
1553
+ withCountryCallingCode,
1554
+ defaultCountry,
1555
+ placeholder,
1556
+ value: values[name],
1557
+ onChange: (value) => setFieldValue(name, value || ""),
1558
+ onBlur: () => setFieldTouched(name, true),
1559
+ error: fieldError ? "Invalid phone number" : void 0
1560
+ }
1561
+ )
1553
1562
  }
1554
1563
  ),
1555
1564
  isTouched && fieldError && /* @__PURE__ */ jsx(