@kroo-web/design-system 1.3.0 → 1.5.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/cjs/index.js +8 -8
- package/dist/cjs/src/components/NumberField/index.d.ts +17 -1
- package/dist/cjs/src/components/PhoneField/index.d.ts +20 -1
- package/dist/cjs/src/components/shared/FormField/index.d.ts +2 -1
- package/dist/esm/index.js +9 -9
- package/dist/esm/src/components/NumberField/index.d.ts +17 -1
- package/dist/esm/src/components/PhoneField/index.d.ts +20 -1
- package/dist/esm/src/components/shared/FormField/index.d.ts +2 -1
- package/dist/types.d.ts +37 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { DetailedHTMLProps, InputHTMLAttributes } from 'react';
|
|
2
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
export type TNumberFieldProps<T extends FieldValues> = {
|
|
4
4
|
helper?: {
|
|
@@ -11,3 +11,19 @@ export type TNumberFieldProps<T extends FieldValues> = {
|
|
|
11
11
|
width?: number;
|
|
12
12
|
};
|
|
13
13
|
export declare const NumberField: <T extends FieldValues>(props: TNumberFieldProps<T>) => React.JSX.Element;
|
|
14
|
+
export type TNativeNumberFieldProps = {
|
|
15
|
+
defaultValue?: number;
|
|
16
|
+
error?: {
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
helper?: {
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
max?: number | string;
|
|
25
|
+
min?: number | string;
|
|
26
|
+
missing?: boolean;
|
|
27
|
+
width?: number;
|
|
28
|
+
} & Omit<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'max' | 'min' | 'type'>;
|
|
29
|
+
export declare const NativeNumberField: React.ForwardRefExoticComponent<Omit<TNativeNumberFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { ChangeEventHandler, DetailedHTMLProps, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
export type TPhoneFieldProps<T extends FieldValues> = {
|
|
4
4
|
className?: string;
|
|
@@ -11,3 +11,22 @@ export type TPhoneFieldProps<T extends FieldValues> = {
|
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const PhoneField: <T extends FieldValues>(props: TPhoneFieldProps<T>) => React.JSX.Element;
|
|
14
|
+
export type TNativeCountrySelectProps = {
|
|
15
|
+
id: string;
|
|
16
|
+
onChange?: ChangeEventHandler<HTMLSelectElement>;
|
|
17
|
+
} & DetailedHTMLProps<InputHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
|
|
18
|
+
export type TNativeInputProps = {
|
|
19
|
+
className?: string;
|
|
20
|
+
error?: {
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
id: string;
|
|
24
|
+
placeholder: string;
|
|
25
|
+
} & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
26
|
+
export declare const NativePhoneField: {
|
|
27
|
+
CountrySelect: React.ForwardRefExoticComponent<Omit<TNativeCountrySelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
28
|
+
Input: React.ForwardRefExoticComponent<Omit<TNativeInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
Root: ({ children }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}) => React.JSX.Element;
|
|
32
|
+
};
|
|
@@ -3,7 +3,8 @@ export type TFormFieldProps = {
|
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
error?: string;
|
|
5
5
|
helper?: ReactNode | string;
|
|
6
|
+
hideLabel?: boolean;
|
|
6
7
|
id: string;
|
|
7
8
|
label?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare const FormField: ({ children, error, helper, id, label }: TFormFieldProps) => React.JSX.Element;
|
|
10
|
+
export declare const FormField: ({ children, error, helper, hideLabel, id, label }: TFormFieldProps) => React.JSX.Element;
|