@tecsinapse/cortex-react 2.1.0-beta.4 → 2.1.0-beta.5

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.
@@ -10,9 +10,8 @@ var context = require('./context.js');
10
10
  const PhoneInputRoot = ({
11
11
  children,
12
12
  className,
13
- defaultCountry,
14
- value,
15
- onChange
13
+ onChange,
14
+ ...rest
16
15
  }) => {
17
16
  const [triggerWidth, setTriggerWidth] = React.useState();
18
17
  const [isOpen, setIsOpen] = React.useState(false);
@@ -25,11 +24,10 @@ const PhoneInputRoot = ({
25
24
  setCountry
26
25
  } = reactInternationalPhone.usePhoneInput({
27
26
  countries: reactInternationalPhone.defaultCountries,
28
- onChange: ({ phone: phone2, ...rest }) => {
29
- onChange?.(phone2, { ...rest });
27
+ onChange: ({ phone: phone2, ...rest2 }) => {
28
+ onChange?.(phone2, { ...rest2 });
30
29
  },
31
- defaultCountry,
32
- value
30
+ ...rest
33
31
  });
34
32
  return /* @__PURE__ */ jsxRuntime.jsx(
35
33
  index.Popover.Root,
@@ -67,7 +67,8 @@ require('react-international-phone');
67
67
 
68
68
  const PhoneInputTrigger = ({
69
69
  disabled = false,
70
- label
70
+ label,
71
+ ...rest
71
72
  }) => {
72
73
  const {
73
74
  setIsOpen,
@@ -89,7 +90,8 @@ const PhoneInputTrigger = ({
89
90
  {
90
91
  value: inputValue,
91
92
  onChange: handlePhoneValueChange,
92
- label: label ?? "Insert a phone number"
93
+ label: label ?? "Insert a phone number",
94
+ ...rest
93
95
  }
94
96
  ),
95
97
  /* @__PURE__ */ jsxRuntime.jsx(index$1.Input.Right, { children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -8,9 +8,8 @@ import { PhoneInputContext } from './context.js';
8
8
  const PhoneInputRoot = ({
9
9
  children,
10
10
  className,
11
- defaultCountry,
12
- value,
13
- onChange
11
+ onChange,
12
+ ...rest
14
13
  }) => {
15
14
  const [triggerWidth, setTriggerWidth] = useState();
16
15
  const [isOpen, setIsOpen] = useState(false);
@@ -23,11 +22,10 @@ const PhoneInputRoot = ({
23
22
  setCountry
24
23
  } = usePhoneInput({
25
24
  countries: defaultCountries,
26
- onChange: ({ phone: phone2, ...rest }) => {
27
- onChange?.(phone2, { ...rest });
25
+ onChange: ({ phone: phone2, ...rest2 }) => {
26
+ onChange?.(phone2, { ...rest2 });
28
27
  },
29
- defaultCountry,
30
- value
28
+ ...rest
31
29
  });
32
30
  return /* @__PURE__ */ jsx(
33
31
  Popover.Root,
@@ -65,7 +65,8 @@ import 'react-international-phone';
65
65
 
66
66
  const PhoneInputTrigger = ({
67
67
  disabled = false,
68
- label
68
+ label,
69
+ ...rest
69
70
  }) => {
70
71
  const {
71
72
  setIsOpen,
@@ -87,7 +88,8 @@ const PhoneInputTrigger = ({
87
88
  {
88
89
  value: inputValue,
89
90
  onChange: handlePhoneValueChange,
90
- label: label ?? "Insert a phone number"
91
+ label: label ?? "Insert a phone number",
92
+ ...rest
91
93
  }
92
94
  ),
93
95
  /* @__PURE__ */ jsx(Input.Right, { children: /* @__PURE__ */ jsxs(
@@ -1,12 +1,2 @@
1
- import { ReactNode } from 'react';
2
- import { ParsedCountry, CountryIso2 } from 'react-international-phone';
3
- export declare const PhoneInputRoot: ({ children, className, defaultCountry, value, onChange, }: {
4
- children: ReactNode;
5
- value?: string;
6
- onChange?: (value: string, rest: {
7
- inputValue: string;
8
- country: ParsedCountry;
9
- }) => void;
10
- className?: string;
11
- defaultCountry?: CountryIso2;
12
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { PhoneInputRootProps } from './types';
2
+ export declare const PhoneInputRoot: ({ children, className, onChange, ...rest }: PhoneInputRootProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,2 @@
1
- export declare const PhoneInputTrigger: ({ disabled, label, }: {
2
- disabled?: boolean;
3
- label?: string;
4
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { PhoneInputTriggerProps } from './types';
2
+ export declare const PhoneInputTrigger: ({ disabled, label, ...rest }: PhoneInputTriggerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,9 @@
1
1
  export declare const PhoneInput: {
2
- Root: ({ children, className, defaultCountry, value, onChange, }: {
3
- children: import("react").ReactNode;
4
- value?: string;
5
- onChange?: (value: string, rest: {
6
- inputValue: string;
7
- country: import("react-international-phone").ParsedCountry;
8
- }) => void;
9
- className?: string;
10
- defaultCountry?: import("react-international-phone").CountryIso2;
11
- }) => import("react/jsx-runtime").JSX.Element;
2
+ Root: ({ children, className, onChange, ...rest }: import("./types").PhoneInputRootProps) => import("react/jsx-runtime").JSX.Element;
12
3
  Popover: ({ children }: {
13
4
  children: import("react").ReactNode;
14
5
  }) => import("react/jsx-runtime").JSX.Element;
15
- Trigger: ({ disabled, label, }: {
16
- disabled?: boolean;
17
- label?: string;
18
- }) => import("react/jsx-runtime").JSX.Element;
6
+ Trigger: ({ disabled, label, ...rest }: import("./types").PhoneInputTriggerProps) => import("react/jsx-runtime").JSX.Element;
19
7
  Option: ({ country, handleSelectCountry, disableClick, }: {
20
8
  country: import("react-international-phone").ParsedCountry;
21
9
  handleSelectCountry: (country: import("react-international-phone").ParsedCountry) => void;
@@ -25,3 +13,4 @@ export declare const PhoneInput: {
25
13
  hasSearch?: boolean;
26
14
  }) => import("react/jsx-runtime").JSX.Element;
27
15
  };
16
+ export * from './types';
@@ -0,0 +1,13 @@
1
+ import { ParsedCountry, UsePhoneInputConfig } from 'react-international-phone';
2
+ import { InputPropsBase } from '../Input';
3
+ import { ReactNode } from 'react';
4
+ export interface PhoneInputTriggerProps extends React.InputHTMLAttributes<HTMLInputElement>, InputPropsBase {
5
+ }
6
+ export interface PhoneInputRootProps extends Omit<UsePhoneInputConfig, 'onChange'> {
7
+ children: ReactNode;
8
+ className?: string;
9
+ onChange?: (value: string, rest: {
10
+ inputValue: string;
11
+ country: ParsedCountry;
12
+ }) => void;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tecsinapse/cortex-react",
3
- "version": "2.1.0-beta.4",
3
+ "version": "2.1.0-beta.5",
4
4
  "description": "React components based in @tecsinapse/cortex-core",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
@@ -49,5 +49,5 @@
49
49
  "react-icons": ">=5.2.0",
50
50
  "tailwindcss": "^4.1.16"
51
51
  },
52
- "gitHead": "a72a848da442227f7e1149ebad300d5e015c4ca5"
52
+ "gitHead": "56ae580d1fcdbfec243b25fa743438398b1883d9"
53
53
  }