@scbt-ecom/ui 0.31.2 → 0.31.3
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/shared/ui/formElements/controlled/index.d.ts +2 -0
- package/dist/shared/ui/formElements/controlled/inputOtp/InputOtpControl.d.ts +12 -0
- package/dist/shared/ui/formElements/controlled/inputOtp/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uncontrolled/index.d.ts +12 -0
- package/dist/shared/ui/formElements/uncontrolled/inputOtp/InputOtpBase.d.ts +51 -0
- package/dist/shared/ui/formElements/uncontrolled/inputOtp/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uncontrolled/inputOtp/ui/InputOtpSlot.d.ts +14 -0
- package/dist/shared/ui/formElements/uncontrolled/inputOtp/ui/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uncontrolled/uploader/UploaderBase.d.ts +2 -2
- package/dist/shared/ui/formElements/uncontrolled/uploader/model/hooks/useUploader.d.ts +2 -2
- package/dist/shared/ui/formElements/uncontrolled/uploader/ui/UploaderFiles.d.ts +1 -1
- package/dist/ui.js +5620 -5538
- package/dist/ui.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { TextareaControlProps } from './textarea';
|
|
2
|
+
export type { InputOtpControlProps } from './inputOtp';
|
|
2
3
|
export declare const Controlled: {
|
|
3
4
|
InputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, helperText, classes, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').InputBaseProps, "classes"> & {
|
|
4
5
|
control: import('react-hook-form').Control<TFieldValues>;
|
|
@@ -108,4 +109,5 @@ export declare const Controlled: {
|
|
|
108
109
|
container?: string;
|
|
109
110
|
};
|
|
110
111
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
112
|
+
InputOtpControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, classes, helperText, ...props }: import('./inputOtp').InputOtpControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
111
113
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FieldValues, Path, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { InputOtpBaseProps } from '../../..';
|
|
3
|
+
type InputOtpControlClasses = InputOtpBaseProps['classes'] & {
|
|
4
|
+
message?: string;
|
|
5
|
+
container?: string;
|
|
6
|
+
};
|
|
7
|
+
export type InputOtpControlProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<InputOtpBaseProps, 'classes'> & {
|
|
8
|
+
classes?: InputOtpControlClasses;
|
|
9
|
+
helperText?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const InputOtpControl: <TFieldValues extends FieldValues = FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, classes, helperText, ...props }: InputOtpControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputOtpControl, type InputOtpControlProps } from './InputOtpControl';
|
|
@@ -8,6 +8,7 @@ export type { AutocompleteBaseProps } from './autocomplete';
|
|
|
8
8
|
export type { RadioGroupBaseProps, RadioOption } from './radio';
|
|
9
9
|
export type { TextareaBaseProps } from './textarea';
|
|
10
10
|
export { isSingleOption } from './select';
|
|
11
|
+
export type { InputOtpBaseProps } from './inputOtp';
|
|
11
12
|
export declare const Uncontrolled: {
|
|
12
13
|
InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
|
|
13
14
|
classes?: import('./input/Input').InputBaseClasses;
|
|
@@ -123,5 +124,16 @@ export declare const Uncontrolled: {
|
|
|
123
124
|
onBlur?: (event: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
124
125
|
};
|
|
125
126
|
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
127
|
+
InputOtpBase: import('react').ForwardRefExoticComponent<Omit<import('input-otp').OTPInputProps, "render"> & {
|
|
128
|
+
classes?: import('./inputOtp').InputOtpBaseClasses;
|
|
129
|
+
initialFocus?: boolean;
|
|
130
|
+
externalHandlers?: {
|
|
131
|
+
onChange?: (value: string) => void;
|
|
132
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
133
|
+
onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
134
|
+
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
135
|
+
};
|
|
136
|
+
invalid?: boolean;
|
|
137
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
126
138
|
UploaderBase: import('react').ForwardRefExoticComponent<import('./uploader').UploaderBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
127
139
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OTPInputProps } from 'input-otp';
|
|
2
|
+
import { InputOTPSlotClasses } from './ui';
|
|
3
|
+
export type InputOtpBaseClasses = {
|
|
4
|
+
input?: string;
|
|
5
|
+
inputContainer?: string;
|
|
6
|
+
container?: string;
|
|
7
|
+
slot?: InputOTPSlotClasses;
|
|
8
|
+
};
|
|
9
|
+
type ExternalHandlers = {
|
|
10
|
+
onChange?: (value: string) => void;
|
|
11
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
12
|
+
onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
13
|
+
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
|
|
14
|
+
};
|
|
15
|
+
export type InputOtpBaseProps = Omit<OTPInputProps, 'render'> & {
|
|
16
|
+
/**
|
|
17
|
+
* Внешние классы которыми можно поменять стили
|
|
18
|
+
*/
|
|
19
|
+
classes?: InputOtpBaseClasses;
|
|
20
|
+
/**
|
|
21
|
+
* Изначальный автофокус
|
|
22
|
+
*/
|
|
23
|
+
initialFocus?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Внешние handlers
|
|
26
|
+
*/
|
|
27
|
+
externalHandlers?: ExternalHandlers;
|
|
28
|
+
/**
|
|
29
|
+
* Для aria-invalid валидное или не валидное поле
|
|
30
|
+
*/
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const InputOtpBase: import('react').ForwardRefExoticComponent<Omit<OTPInputProps, "render"> & {
|
|
34
|
+
/**
|
|
35
|
+
* Внешние классы которыми можно поменять стили
|
|
36
|
+
*/
|
|
37
|
+
classes?: InputOtpBaseClasses;
|
|
38
|
+
/**
|
|
39
|
+
* Изначальный автофокус
|
|
40
|
+
*/
|
|
41
|
+
initialFocus?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Внешние handlers
|
|
44
|
+
*/
|
|
45
|
+
externalHandlers?: ExternalHandlers;
|
|
46
|
+
/**
|
|
47
|
+
* Для aria-invalid валидное или не валидное поле
|
|
48
|
+
*/
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type InputOtpBaseClasses, type InputOtpBaseProps, InputOtpBase } from './InputOtpBase';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type InputOTPSlotClasses = {
|
|
3
|
+
singleChar?: string;
|
|
4
|
+
caretWrapper?: string;
|
|
5
|
+
caret?: string;
|
|
6
|
+
substrate?: string;
|
|
7
|
+
};
|
|
8
|
+
interface InputOTPSlotProps extends ComponentPropsWithoutRef<'div'> {
|
|
9
|
+
index: number;
|
|
10
|
+
classes?: InputOTPSlotClasses;
|
|
11
|
+
invalid?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const InputOTPSlot: import('react').ForwardRefExoticComponent<InputOTPSlotProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputOTPSlot, type InputOTPSlotClasses } from './InputOtpSlot';
|
|
@@ -24,7 +24,7 @@ export interface UploaderBaseProps extends Omit<InputHTMLAttributes<HTMLInputEle
|
|
|
24
24
|
* Сеттер значение
|
|
25
25
|
* @param file - файлы
|
|
26
26
|
*/
|
|
27
|
-
onChange
|
|
27
|
+
onChange?: (file: File[]) => void;
|
|
28
28
|
/**
|
|
29
29
|
* Валидное ли значение
|
|
30
30
|
*/
|
|
@@ -32,7 +32,7 @@ export interface UploaderBaseProps extends Omit<InputHTMLAttributes<HTMLInputEle
|
|
|
32
32
|
/**
|
|
33
33
|
* Значение
|
|
34
34
|
*/
|
|
35
|
-
value
|
|
35
|
+
value?: File[];
|
|
36
36
|
}
|
|
37
37
|
export declare const UploaderBase: import('react').ForwardRefExoticComponent<UploaderBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
38
38
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DropzoneOptions } from 'react-dropzone';
|
|
2
2
|
export type TUseUploader = {
|
|
3
|
-
controlledFiles
|
|
3
|
+
controlledFiles?: File[];
|
|
4
4
|
dropzoneOptions: DropzoneOptions;
|
|
5
|
-
onChange
|
|
5
|
+
onChange?: (files: File[]) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare const useUploader: ({ dropzoneOptions, controlledFiles, onChange }: TUseUploader) => {
|
|
8
8
|
filesStatus: Record<string, "error" | "success" | "loading">;
|