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.d.ts CHANGED
@@ -323,7 +323,7 @@ declare const AppMultiSelector: React$1.ForwardRefExoticComponent<Omit<AppMultiS
323
323
 
324
324
  interface AppPhoneNoInputProps {
325
325
  name: string;
326
- label?: string;
326
+ label: string;
327
327
  required?: boolean;
328
328
  defaultCountry?: string;
329
329
  placeholder?: string;
@@ -332,6 +332,8 @@ interface AppPhoneNoInputProps {
332
332
  labelSx?: SxProps<Theme>;
333
333
  inputSx?: React__default.CSSProperties;
334
334
  errorSx?: SxProps<Theme>;
335
+ international?: boolean;
336
+ withCountryCallingCode?: boolean;
335
337
  }
336
338
  declare const AppPhoneNoInput: React__default.FC<AppPhoneNoInputProps>;
337
339
 
package/dist/index.js CHANGED
@@ -14,8 +14,8 @@ var Autocomplete3 = require('@mui/material/Autocomplete');
14
14
  var Typography9 = require('@mui/material/Typography');
15
15
  var react$1 = require('@iconify/react');
16
16
  var Select = require('@mui/material/Select');
17
- var PhoneInput = require('react-phone-input-2');
18
- require('react-phone-input-2/lib/style.css');
17
+ var PhoneInput = require('react-phone-number-input');
18
+ require('react-phone-number-input/style.css');
19
19
  var react$2 = require('@tiptap/react');
20
20
  var StarterKit = require('@tiptap/starter-kit');
21
21
  var Link = require('@tiptap/extension-link');
@@ -1507,13 +1507,15 @@ var AppPhoneNoInput = ({
1507
1507
  name,
1508
1508
  label,
1509
1509
  required = false,
1510
- defaultCountry = "us",
1511
- placeholder,
1510
+ defaultCountry = "US",
1511
+ placeholder = "Enter phone number",
1512
1512
  sx,
1513
1513
  containerSx,
1514
1514
  labelSx,
1515
1515
  inputSx,
1516
- errorSx
1516
+ errorSx,
1517
+ international = true,
1518
+ withCountryCallingCode = true
1517
1519
  }) => {
1518
1520
  const { values, errors, touched, setFieldValue, setFieldTouched } = formik.useFormikContext();
1519
1521
  const fieldError = react.useMemo(() => _19__default.default.get(errors, name), [errors, name]);
@@ -1552,32 +1554,39 @@ var AppPhoneNoInput = ({
1552
1554
  }
1553
1555
  ),
1554
1556
  /* @__PURE__ */ jsxRuntime.jsx(
1555
- PhoneInput__default.default,
1557
+ material.Box,
1556
1558
  {
1557
- country: defaultCountry,
1558
- specialLabel: "",
1559
- placeholder,
1560
- inputProps: {
1561
- name,
1562
- id: name,
1563
- required,
1564
- "aria-describedby": fieldError ? `${name}-error` : void 0,
1565
- "aria-invalid": !!fieldError,
1566
- "aria-required": required
1567
- },
1568
- inputStyle: {
1569
- width: "100%",
1570
- border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
1571
- padding: "10px",
1572
- borderRadius: "4px",
1573
- ...inputSx
1574
- },
1575
- containerStyle: {
1576
- width: "100%"
1559
+ sx: {
1560
+ "& .PhoneInput": {
1561
+ width: "100%"
1562
+ },
1563
+ "& .PhoneInputInput": {
1564
+ width: "100%",
1565
+ border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
1566
+ padding: "10px",
1567
+ borderRadius: "4px",
1568
+ fontFamily: "inherit",
1569
+ fontSize: "inherit",
1570
+ ...inputSx
1571
+ },
1572
+ "& .PhoneInputCountrySelect": {
1573
+ border: isTouched && fieldError ? "1px solid #f44336" : "1px solid #ccc",
1574
+ borderRadius: "4px"
1575
+ }
1577
1576
  },
1578
- value: values[name],
1579
- onChange: (value) => setFieldValue(name, value),
1580
- onBlur: () => setFieldTouched(name, true)
1577
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1578
+ PhoneInput__default.default,
1579
+ {
1580
+ international,
1581
+ withCountryCallingCode,
1582
+ defaultCountry,
1583
+ placeholder,
1584
+ value: values[name],
1585
+ onChange: (value) => setFieldValue(name, value || ""),
1586
+ onBlur: () => setFieldTouched(name, true),
1587
+ error: fieldError ? "Invalid phone number" : void 0
1588
+ }
1589
+ )
1581
1590
  }
1582
1591
  ),
1583
1592
  isTouched && fieldError && /* @__PURE__ */ jsxRuntime.jsx(