@kroo-web/design-system 1.1.103 → 1.1.106
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/examples/CheckboxWithController/index.d.ts +6 -0
- package/dist/cjs/examples/ComboBoxWithController/index.d.ts +6 -0
- package/dist/cjs/examples/MagicForm/index.d.ts +7 -0
- package/dist/cjs/examples/NumberFieldWithController/index.d.ts +6 -0
- package/dist/cjs/examples/PhoneFieldWithController/index.d.ts +6 -0
- package/dist/cjs/examples/PinInputWithController/index.d.ts +6 -0
- package/dist/cjs/examples/RadioGroupWithController/index.d.ts +8 -0
- package/dist/cjs/examples/form/index.d.ts +35 -1
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/src/components/Accordion/index.d.ts +2 -2
- package/dist/cjs/src/components/Checkbox/index.d.ts +5 -4
- package/dist/cjs/src/components/ComboBox/index.d.ts +6 -5
- package/dist/cjs/src/components/DatePicker/index.d.ts +16 -7
- package/dist/cjs/src/components/Form/index.d.ts +3 -7
- package/dist/cjs/src/components/NumberField/index.d.ts +18 -8
- package/dist/cjs/src/components/PhoneField/index.d.ts +24 -4
- package/dist/cjs/src/components/PinInput/index.d.ts +4 -4
- package/dist/cjs/src/components/RadioGroup/index.d.ts +14 -6
- package/dist/cjs/src/components/Range/index.d.ts +19 -9
- package/dist/cjs/src/components/Select/index.d.ts +7 -6
- package/dist/cjs/src/components/TextField/index.d.ts +5 -4
- package/dist/cjs/src/components/Typography/index.d.ts +3 -2
- package/dist/cjs/src/utils/composeRefs.d.ts +2 -0
- package/dist/cjs/src/utils/parseInt.d.ts +1 -0
- package/dist/esm/examples/CheckboxWithController/index.d.ts +6 -0
- package/dist/esm/examples/ComboBoxWithController/index.d.ts +6 -0
- package/dist/esm/examples/MagicForm/index.d.ts +7 -0
- package/dist/esm/examples/NumberFieldWithController/index.d.ts +6 -0
- package/dist/esm/examples/PhoneFieldWithController/index.d.ts +6 -0
- package/dist/esm/examples/PinInputWithController/index.d.ts +6 -0
- package/dist/esm/examples/RadioGroupWithController/index.d.ts +8 -0
- package/dist/esm/examples/form/index.d.ts +35 -1
- package/dist/esm/index.js +12 -12
- package/dist/esm/src/components/Accordion/index.d.ts +2 -2
- package/dist/esm/src/components/Checkbox/index.d.ts +5 -4
- package/dist/esm/src/components/ComboBox/index.d.ts +6 -5
- package/dist/esm/src/components/DatePicker/index.d.ts +16 -7
- package/dist/esm/src/components/Form/index.d.ts +3 -7
- package/dist/esm/src/components/NumberField/index.d.ts +18 -8
- package/dist/esm/src/components/PhoneField/index.d.ts +24 -4
- package/dist/esm/src/components/PinInput/index.d.ts +4 -4
- package/dist/esm/src/components/RadioGroup/index.d.ts +14 -6
- package/dist/esm/src/components/Range/index.d.ts +19 -9
- package/dist/esm/src/components/Select/index.d.ts +7 -6
- package/dist/esm/src/components/TextField/index.d.ts +5 -4
- package/dist/esm/src/components/Typography/index.d.ts +3 -2
- package/dist/esm/src/utils/composeRefs.d.ts +2 -0
- package/dist/esm/src/utils/parseInt.d.ts +1 -0
- package/dist/types.d.ts +125 -57
- package/package.json +1 -1
|
@@ -10,8 +10,8 @@ export type TAccordionTriggerProps<C extends React.ElementType = 'p'> = React.Co
|
|
|
10
10
|
controls?: React.ReactNode;
|
|
11
11
|
};
|
|
12
12
|
export declare const Accordion: {
|
|
13
|
-
Root:
|
|
14
|
-
Item: React.
|
|
13
|
+
Root: (props: TAccordionRootProps) => React.JSX.Element;
|
|
14
|
+
Item: (props: React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>) => React.JSX.Element;
|
|
15
15
|
Trigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
16
16
|
as?: "p" | undefined;
|
|
17
17
|
size?: "regular" | "large";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export type TCheckboxProps<T extends FieldValues> = {
|
|
2
|
+
export type TCheckboxProps = {
|
|
4
3
|
id: string;
|
|
5
|
-
name: Path<T>;
|
|
6
4
|
label: string | ReactNode;
|
|
7
5
|
disabled?: boolean;
|
|
8
6
|
className?: string;
|
|
9
7
|
variant?: 'radio' | 'checkbox';
|
|
8
|
+
onChange?: (value: boolean) => void;
|
|
9
|
+
onBlur?: () => void;
|
|
10
|
+
value?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const Checkbox:
|
|
12
|
+
export declare const Checkbox: ({ id, label, variant, value, onChange, onBlur }: TCheckboxProps) => React.JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ControllerRenderProps, FieldValues } from 'react-hook-form';
|
|
3
2
|
export type TComboBoxItem = {
|
|
4
3
|
text: string;
|
|
5
4
|
img?: string;
|
|
@@ -7,11 +6,13 @@ export type TComboBoxItem = {
|
|
|
7
6
|
};
|
|
8
7
|
export type TComboBoxProps = {
|
|
9
8
|
label: string;
|
|
10
|
-
name: string;
|
|
11
9
|
options: TComboBoxItem[];
|
|
12
10
|
onSelect?: (item: TComboBoxItem) => void;
|
|
13
11
|
alwaysOpen?: boolean;
|
|
14
|
-
field:
|
|
12
|
+
field: {
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
onBlur: () => void;
|
|
16
|
+
};
|
|
15
17
|
};
|
|
16
|
-
export declare const ComboBox: (props:
|
|
17
|
-
export declare const Field: ({ label, options, onSelect, alwaysOpen, field: { onBlur, ...restField } }: TComboBoxProps) => React.JSX.Element;
|
|
18
|
+
export declare const ComboBox: (props: TComboBoxProps) => React.JSX.Element;
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export type TDatePicker<T extends FieldValues> = {
|
|
2
|
+
export type TDatePickerProps = {
|
|
4
3
|
id: string;
|
|
5
|
-
name: Path<T>;
|
|
6
4
|
label: string;
|
|
7
5
|
helper?: {
|
|
8
6
|
message: string;
|
|
9
7
|
};
|
|
10
|
-
min?: string;
|
|
11
|
-
max?: string;
|
|
12
8
|
disabled?: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
13
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
helper?: {
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
error?: {
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
} & React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import React, { PropsWithChildren,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
methods: UseFormReturn<T>;
|
|
5
|
-
onSubmit: (values: T) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const Form: <T extends FieldValues>({ methods, children, onSubmit, ...rest }: TFormProps<T>) => React.JSX.Element;
|
|
1
|
+
import React, { PropsWithChildren, DetailedHTMLProps, InputHTMLAttributes } from 'react';
|
|
2
|
+
type TFormProps = PropsWithChildren<DetailedHTMLProps<InputHTMLAttributes<HTMLFormElement>, HTMLFormElement>>;
|
|
3
|
+
export declare const Form: ({ children, ...rest }: TFormProps) => React.JSX.Element;
|
|
8
4
|
export {};
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React, { DetailedHTMLProps, InputHTMLAttributes } from 'react';
|
|
2
|
+
export type TNumberFieldProps = {
|
|
3
|
+
id: string;
|
|
4
4
|
label: string;
|
|
5
|
-
name: Path<T>;
|
|
6
|
-
min?: number;
|
|
7
|
-
max?: number;
|
|
8
5
|
width?: number;
|
|
9
6
|
helper?: {
|
|
10
7
|
message: string;
|
|
11
8
|
};
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
onChange?: (value: number) => void;
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
} & DetailedHTMLProps<InputHTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
15
|
+
/**
|
|
16
|
+
* NumberField - A component for rendering a number input field.
|
|
17
|
+
*
|
|
18
|
+
* @param {TNumberFieldProps} props - The properties for the number field component.
|
|
19
|
+
* @returns {JSX.Element} The rendered number field component.
|
|
20
|
+
*
|
|
21
|
+
* !!! If using this component with react-hook-form, you will need to wrap this component in a Controller component.
|
|
22
|
+
*/
|
|
23
|
+
export declare const NumberField: (props: TNumberFieldProps) => React.JSX.Element;
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export type TPhoneFieldProps<T extends FieldValues> = {
|
|
2
|
+
export type TPhoneFieldProps = {
|
|
4
3
|
id: string;
|
|
5
|
-
name: Path<T>;
|
|
6
4
|
disabled?: boolean;
|
|
5
|
+
error?: {
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
7
8
|
helper?: {
|
|
8
9
|
message: ReactNode | string;
|
|
9
10
|
};
|
|
10
11
|
className?: string;
|
|
11
12
|
placeholder?: string;
|
|
13
|
+
onChange?: (value: {
|
|
14
|
+
code: string;
|
|
15
|
+
number: string;
|
|
16
|
+
formatted: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
onBlur?: () => void;
|
|
19
|
+
value?: {
|
|
20
|
+
code: string;
|
|
21
|
+
number: string;
|
|
22
|
+
formatted: string;
|
|
23
|
+
};
|
|
12
24
|
};
|
|
13
|
-
|
|
25
|
+
/**
|
|
26
|
+
* PhoneField - A component for rendering a number input field.
|
|
27
|
+
*
|
|
28
|
+
* @param {TPhoneFieldProps} props - The properties for the phone field component.
|
|
29
|
+
* @returns {JSX.Element} The rendered number field component.
|
|
30
|
+
*
|
|
31
|
+
* !!! If using this component with react-hook-form, you will need to wrap this component in a Controller component.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PhoneField: (props: TPhoneFieldProps) => React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface TPinInputProps<T extends FieldValues> {
|
|
4
|
-
name: Path<T>;
|
|
2
|
+
export interface TPinInputProps {
|
|
5
3
|
length: number;
|
|
6
4
|
label: string;
|
|
7
5
|
isOTP?: boolean;
|
|
8
6
|
isPassword?: boolean;
|
|
9
7
|
isNumeric?: boolean;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
onBlur?: () => void;
|
|
10
10
|
}
|
|
11
|
-
export declare const PinInput:
|
|
11
|
+
export declare const PinInput: ({ length, label, isOTP, isPassword, isNumeric, onChange, onBlur }: TPinInputProps) => React.JSX.Element;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as RadixRadioGroup from '@radix-ui/react-radio-group';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
name
|
|
3
|
+
export type TRadioGroupProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
name?: string;
|
|
6
6
|
label: string;
|
|
7
7
|
variant?: 'cards' | 'circle';
|
|
8
|
-
error?:
|
|
9
|
-
|
|
8
|
+
error?: {
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
onBlur?: () => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
value?: string;
|
|
15
|
+
};
|
|
10
16
|
export declare const RadioGroup: {
|
|
11
|
-
Root: <
|
|
17
|
+
Root: React.ForwardRefExoticComponent<TRadioGroupProps & {
|
|
18
|
+
children?: React.ReactNode | undefined;
|
|
19
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
20
|
Item: ({ children, className, variant, ...props }: RadixRadioGroup.RadioGroupItemProps & {
|
|
13
21
|
variant?: "circle" | "cards";
|
|
14
22
|
}) => React.JSX.Element;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export type TRangeProps<T extends FieldValues> = {
|
|
1
|
+
import React, { ChangeEvent } from 'react';
|
|
2
|
+
export type TRangeProps = {
|
|
4
3
|
id: string;
|
|
5
4
|
label: string;
|
|
6
|
-
name: Path<T>;
|
|
7
|
-
min?: number;
|
|
8
|
-
max?: number;
|
|
9
5
|
step?: number;
|
|
10
|
-
showValue?: boolean;
|
|
11
6
|
helper?: {
|
|
12
7
|
message: string;
|
|
13
8
|
};
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
error?: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
14
|
+
export declare const Range: React.ForwardRefExoticComponent<{
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
step?: number;
|
|
18
|
+
helper?: {
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
error?: {
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
25
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React, { OptionHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { FieldValues, Path } from 'react-hook-form';
|
|
1
|
+
import React, { DetailedHTMLProps, OptionHTMLAttributes, ReactNode } from 'react';
|
|
3
2
|
export type TItem = {
|
|
4
3
|
id: string;
|
|
5
4
|
title: string;
|
|
6
5
|
};
|
|
7
|
-
export type TSelectProps
|
|
6
|
+
export type TSelectProps = {
|
|
8
7
|
id: string;
|
|
9
8
|
label: string;
|
|
10
|
-
name: Path<T>;
|
|
11
9
|
helper?: {
|
|
12
10
|
message: string;
|
|
13
11
|
};
|
|
@@ -21,5 +19,8 @@ export type TSelectProps<T extends FieldValues> = {
|
|
|
21
19
|
defaultValue?: string;
|
|
22
20
|
missing?: boolean;
|
|
23
21
|
children?: ReactNode;
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
error?: {
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
} & DetailedHTMLProps<React.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>;
|
|
26
|
+
export declare const Select: React.ForwardRefExoticComponent<Omit<TSelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, { DetailedHTMLProps, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export type TTextFieldProps<T extends FieldValues> = {
|
|
2
|
+
export type TTextFieldProps = {
|
|
4
3
|
id: string;
|
|
5
4
|
label: string;
|
|
6
|
-
name: Path<T>;
|
|
7
5
|
disabled?: boolean;
|
|
8
6
|
helper?: {
|
|
9
7
|
message: ReactNode | string;
|
|
@@ -16,5 +14,8 @@ export type TTextFieldProps<T extends FieldValues> = {
|
|
|
16
14
|
leftContent?: ReactNode | string;
|
|
17
15
|
missing?: boolean;
|
|
18
16
|
disableError?: boolean;
|
|
17
|
+
error?: {
|
|
18
|
+
message: ReactNode | string;
|
|
19
|
+
};
|
|
19
20
|
} & DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
20
|
-
export declare const TextField: React.ForwardRefExoticComponent<Omit<TTextFieldProps
|
|
21
|
+
export declare const TextField: React.ForwardRefExoticComponent<Omit<TTextFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ForwardedRef } from 'react';
|
|
2
2
|
export type TLegacyMarketingText = 'marketing-text-light' | 'marketing-text-regular' | 'marketing-text-semi-bold' | 'marketing-quote-light' | 'marketing-quote-regular' | 'marketing-quote-semi-bold' | 'marketing-small-light' | 'marketing-small-regular' | 'marketing-small-semi-bold' | 'marketing-medium-light' | 'marketing-medium-regular' | 'marketing-medium-semi-bold' | 'marketing-large-light' | 'marketing-large-regular' | 'marketing-large-semi-bold' | 'marketing-tag-light' | 'marketing-tag-regular' | 'marketing-tag-semi-bold';
|
|
3
3
|
export type TLegacyMarketingHeading = 'marketing-heading-1' | 'marketing-heading-2' | 'marketing-heading-3' | 'marketing-heading-4' | 'marketing-heading-5' | 'marketing-heading-6' | 'marketing-heading-7';
|
|
4
4
|
export type TLegacyMarketingFooter = 'footer-regular' | 'footer-semi-bold';
|
|
@@ -10,4 +10,5 @@ export type TTypographyProps<C extends React.ElementType = 'p'> = {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
12
|
} & React.ComponentPropsWithoutRef<C>;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const TypographyComponent: <C extends React.ElementType = "p">(props: TTypographyProps<C>, forwardRef: ForwardedRef<C>) => React.JSX.Element;
|
|
14
|
+
export declare const Typography: React.ForwardRefExoticComponent<Omit<TTypographyProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseIntSafe: (value: string) => number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TCheckboxProps } from '../../src';
|
|
4
|
+
import { TFieldWithController } from '../form';
|
|
5
|
+
export type TCheckboxControllerProps<T extends FieldValues> = TFieldWithController<T, TCheckboxProps>;
|
|
6
|
+
export declare const CheckboxWithController: <T extends FieldValues>({ control, name, props }: TCheckboxControllerProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TComboBoxProps } from '../../src';
|
|
4
|
+
import { TFieldWithController } from '../form';
|
|
5
|
+
export type TComboBoxControllerProps<T extends FieldValues> = TFieldWithController<T, Omit<TComboBoxProps, "field" | "name">>;
|
|
6
|
+
export declare const ComboBoxWithController: <T extends FieldValues>({ control, name, props, }: TComboBoxControllerProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TNumberFieldProps } from '../../src';
|
|
4
|
+
import { TFieldWithController } from '../form';
|
|
5
|
+
export type TNumberFieldControllerProps<T extends FieldValues> = TFieldWithController<T, TNumberFieldProps>;
|
|
6
|
+
export declare const NumberFieldWithController: <T extends FieldValues>({ control, name, props }: TNumberFieldControllerProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TPhoneFieldProps } from '../../src';
|
|
4
|
+
import { TFieldWithController } from '../form';
|
|
5
|
+
export type TPhoneFieldControllerProps<T extends FieldValues> = TFieldWithController<T, TPhoneFieldProps>;
|
|
6
|
+
export declare const PhoneFieldWithController: <T extends FieldValues>({ control, name, props }: TPhoneFieldControllerProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TFieldWithController } from '../form';
|
|
4
|
+
import { TPinInputProps } from '../../src';
|
|
5
|
+
export type TPhoneFieldControllerProps<T extends FieldValues> = TFieldWithController<T, Omit<TPinInputProps, 'onChange'>>;
|
|
6
|
+
export declare const PinInputWithController: <T extends FieldValues>({ control, name, props }: TPhoneFieldControllerProps<T>) => React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
|
+
import { TRadioGroupProps } from '../../src';
|
|
4
|
+
import { TFieldWithController } from '../form';
|
|
5
|
+
export type TRadioGroupControllerProps<T extends FieldValues> = TFieldWithController<T, TRadioGroupProps> & {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const RadioGroupWithController: <T extends FieldValues>({ control, name, props, children }: TRadioGroupControllerProps<T>) => React.JSX.Element;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
4
|
+
export type TFieldWithController<T extends FieldValues, C> = {
|
|
5
|
+
control: Control<T, object>;
|
|
6
|
+
name: Path<T>;
|
|
7
|
+
props: C;
|
|
8
|
+
};
|
|
3
9
|
export declare const exampleSchema: z.ZodObject<{
|
|
4
10
|
textField: z.ZodString;
|
|
5
11
|
select: z.ZodString;
|
|
@@ -9,24 +15,33 @@ export declare const exampleSchema: z.ZodObject<{
|
|
|
9
15
|
disclosureTextField: z.ZodString;
|
|
10
16
|
range: z.ZodNumber;
|
|
11
17
|
processor: z.ZodString;
|
|
18
|
+
phoneField: z.ZodString;
|
|
19
|
+
terms: z.ZodBoolean;
|
|
20
|
+
pin: z.ZodString;
|
|
12
21
|
}, "strip", z.ZodTypeAny, {
|
|
13
22
|
select: string;
|
|
14
23
|
radioGroup: string;
|
|
24
|
+
pin: string;
|
|
15
25
|
range: number;
|
|
16
26
|
textField: string;
|
|
17
27
|
numberField: number;
|
|
18
28
|
disclosureTextField: string;
|
|
19
29
|
datePicker: Date;
|
|
20
30
|
processor: string;
|
|
31
|
+
phoneField: string;
|
|
32
|
+
terms: boolean;
|
|
21
33
|
}, {
|
|
22
34
|
select: string;
|
|
23
35
|
radioGroup: string;
|
|
36
|
+
pin: string;
|
|
24
37
|
range: number;
|
|
25
38
|
textField: string;
|
|
26
39
|
numberField: number;
|
|
27
40
|
disclosureTextField: string;
|
|
28
41
|
datePicker: Date;
|
|
29
42
|
processor: string;
|
|
43
|
+
phoneField: string;
|
|
44
|
+
terms: boolean;
|
|
30
45
|
}>;
|
|
31
46
|
export type TFormExample = {
|
|
32
47
|
values: {
|
|
@@ -39,6 +54,25 @@ export type TFormExample = {
|
|
|
39
54
|
disclosureTextField?: string;
|
|
40
55
|
range?: number;
|
|
41
56
|
processor?: string;
|
|
57
|
+
phoneField?: string;
|
|
58
|
+
terms?: boolean;
|
|
59
|
+
pin?: string;
|
|
42
60
|
};
|
|
61
|
+
error?: boolean;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type FormValues = {
|
|
65
|
+
textField: string;
|
|
66
|
+
currencyField: string;
|
|
67
|
+
select: string;
|
|
68
|
+
radioGroup: string;
|
|
69
|
+
numberField: number;
|
|
70
|
+
datePicker: string;
|
|
71
|
+
disclosureTextField: string;
|
|
72
|
+
range: number;
|
|
73
|
+
processor: string;
|
|
74
|
+
phoneField: string;
|
|
75
|
+
terms: boolean;
|
|
76
|
+
pin: string;
|
|
43
77
|
};
|
|
44
|
-
export declare const FormExample: ({ values }: TFormExample) => React.JSX.Element;
|
|
78
|
+
export declare const FormExample: ({ values, error, disabled }: TFormExample) => React.JSX.Element;
|