@scbt-ecom/ui 0.21.1 → 0.22.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/README.md CHANGED
@@ -34,7 +34,7 @@ export default {
34
34
  - На проекте для unit тестирования используется vitest, документация — https://vitest.dev/
35
35
  - Все тесты лежат в папке test, она полностью должно дублировать структуру папки lib, собственно, что мы и тестируем
36
36
  - Снепшоты создаются также с помощью vitest, функция toMatchSnapshot(). Тут главное не нужно создавать на всё подряд их, желательно для реакт компонентов, каких-то больших и сложных объектов, конфигурационных файлов, API-ответов, сложных выходных данных
37
- - Чтобы обновить снепшоты введите
37
+ - Чтобы обновить снепшоты введите.
38
38
 
39
39
  ```
40
40
  npx vitest -u
@@ -21,8 +21,8 @@ type CheckboxControlProps<TFieldValues extends FieldValues = FieldValues, TName
21
21
  /**
22
22
  * Дополнительный текст
23
23
  */
24
- textHint?: string;
24
+ helperText?: string;
25
25
  };
26
- declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, classes, className, name, rules, shouldUnregister, defaultValue, disabled, children, textHint, ...props }: CheckboxControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
26
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, classes, className, name, rules, shouldUnregister, defaultValue, disabled, children, helperText, ...props }: CheckboxControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
27
27
  export declare const CheckboxControl: typeof InnerComponent;
28
28
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
2
2
  import { Calendar, MaskInputProps } from '../../..';
3
+ import { TFieldContainerConfig } from '../../ui';
3
4
  type CalendarProps = React.ComponentPropsWithoutRef<typeof Calendar>;
4
5
  type DayPickerControlClasses = MaskInputProps['classes'] & {
5
6
  message?: string;
@@ -16,12 +17,16 @@ export type DayPickerControlProps<TFieldValues extends FieldValues = FieldValues
16
17
  /**
17
18
  * Дополнительный текст
18
19
  */
19
- textHint?: string;
20
+ helperText?: string;
20
21
  /**
21
22
  * Дополнительные стили компонента
22
23
  */
23
24
  classes?: DayPickerControlClasses;
25
+ /**
26
+ * Размер контейнера для поля
27
+ */
28
+ size?: TFieldContainerConfig['size'];
24
29
  };
25
- declare const InnerComponent: <T extends FieldValues = FieldValues>({ control, name, disabled, rules, shouldUnregister, defaultValue, inputProps, textHint, classes, ...props }: DayPickerControlProps<T>) => import("react/jsx-runtime").JSX.Element;
30
+ declare const InnerComponent: <T extends FieldValues = FieldValues>({ control, name, disabled, rules, shouldUnregister, defaultValue, inputProps, helperText, classes, size, ...props }: DayPickerControlProps<T>) => import("react/jsx-runtime").JSX.Element;
26
31
  export declare const DayPickerControl: typeof InnerComponent;
27
32
  export {};
@@ -1,7 +1,7 @@
1
1
  export declare const Controlled: {
2
- InputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, textHint, classes, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').InputBaseProps, "classes"> & {
2
+ InputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, helperText, classes, size, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').InputBaseProps, "classes"> & {
3
3
  control: import('react-hook-form').Control<TFieldValues>;
4
- textHint?: string;
4
+ helperText?: string;
5
5
  classes?: {
6
6
  container?: string;
7
7
  input?: string;
@@ -9,8 +9,9 @@ export declare const Controlled: {
9
9
  } & {
10
10
  message?: string;
11
11
  };
12
+ size?: import('../ui').TFieldContainerConfig["size"];
12
13
  }) => import("react/jsx-runtime").JSX.Element;
13
- MaskInputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, classes, textHint, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').MaskInputProps, "classes"> & {
14
+ MaskInputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, classes, helperText, size, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').MaskInputProps, "classes"> & {
14
15
  control: import('react-hook-form').Control<TFieldValues>;
15
16
  classes?: {
16
17
  container?: string;
@@ -19,10 +20,11 @@ export declare const Controlled: {
19
20
  } & {
20
21
  message?: string;
21
22
  };
22
- textHint?: string;
23
+ helperText?: string;
24
+ size?: import('../ui').TFieldContainerConfig["size"];
23
25
  }) => import("react/jsx-runtime").JSX.Element;
24
- DayPickerControl: <T extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, disabled, rules, shouldUnregister, defaultValue, inputProps, textHint, classes, ...props }: import('./dayPickerControl/dayPickerControl').DayPickerControlProps<T>) => import("react/jsx-runtime").JSX.Element;
25
- CheckboxControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, classes, className, name, rules, shouldUnregister, defaultValue, disabled, children, textHint, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').CheckboxBaseProps, "classes"> & {
26
+ DayPickerControl: <T extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, disabled, rules, shouldUnregister, defaultValue, inputProps, helperText, classes, size, ...props }: import('./dayPickerControl/dayPickerControl').DayPickerControlProps<T>) => import("react/jsx-runtime").JSX.Element;
27
+ CheckboxControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, classes, className, name, rules, shouldUnregister, defaultValue, disabled, children, helperText, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').CheckboxBaseProps, "classes"> & {
26
28
  control: import('react-hook-form').Control<TFieldValues>;
27
29
  children: React.ReactElement | string;
28
30
  classes?: {
@@ -33,9 +35,9 @@ export declare const Controlled: {
33
35
  message?: string;
34
36
  label?: string;
35
37
  };
36
- textHint?: string;
38
+ helperText?: string;
37
39
  }) => import("react/jsx-runtime").JSX.Element;
38
- SelectControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, classes, className, name, rules, shouldUnregister, disabled, defaultValue, returnValue, options, textHint, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('react-select').Props<import('..').SelectItemOption, boolean>, "options" | "defaultValue" | "placeholder" | "isSearchable"> & Pick<import('..').InputBaseProps, "invalid" | "label" | "attachmentProps"> & {
40
+ SelectControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, classes, name, rules, shouldUnregister, disabled, defaultValue, returnValue, options, helperText, size, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('react-select').Props<import('..').SelectItemOption, boolean>, "options" | "defaultValue" | "placeholder" | "isSearchable"> & Pick<import('..').InputBaseProps, "invalid" | "label" | "attachmentProps"> & {
39
41
  isSearchable?: boolean;
40
42
  returnValue?: (option: import('..').SelectItemOption) => string;
41
43
  displayValue?: (option: import('..').SelectItemOption) => string;
@@ -58,10 +60,11 @@ export declare const Controlled: {
58
60
  container?: string;
59
61
  message?: string;
60
62
  };
61
- textHint?: string;
63
+ helperText?: string;
64
+ size?: import('../ui').TFieldContainerConfig["size"];
62
65
  }) => import("react/jsx-runtime").JSX.Element;
63
- SwitchControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ classes, className, control, name, rules, defaultValue, disabled, shouldUnregister, children, textHint, tooltip, popoverProps, ...props }: import('./switch/SwitchControl').SwitchControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
64
- RadioGroupControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ classes, className, control, name, rules, shouldUnregister, disabled, defaultValue, textHint, label, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').RadioGroupBaseProps, "classes"> & {
66
+ SwitchControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ classes, className, control, name, rules, defaultValue, disabled, shouldUnregister, children, helperText, tooltip, popoverProps, ...props }: import('./switch/SwitchControl').SwitchControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
67
+ RadioGroupControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ classes, className, control, name, rules, shouldUnregister, disabled, defaultValue, helperText, label, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').RadioGroupBaseProps, "classes"> & {
65
68
  label: string;
66
69
  control: import('react-hook-form').Control<TFieldValues>;
67
70
  classes?: {
@@ -76,6 +79,6 @@ export declare const Controlled: {
76
79
  message?: string;
77
80
  label?: string;
78
81
  };
79
- textHint?: string;
82
+ helperText?: string;
80
83
  }) => import("react/jsx-runtime").JSX.Element;
81
84
  };
@@ -1,5 +1,6 @@
1
1
  import { Control, FieldValues, Path, UseControllerProps } from 'react-hook-form';
2
2
  import { InputBaseProps } from '../../uncontrolled';
3
+ import { TFieldContainerConfig } from '../../ui';
3
4
  type InputControlClasses = InputBaseProps['classes'] & {
4
5
  message?: string;
5
6
  };
@@ -11,12 +12,16 @@ type InputControlProps<TFieldValues extends FieldValues = FieldValues, TName ext
11
12
  /**
12
13
  * Дополнительный текст
13
14
  */
14
- textHint?: string;
15
+ helperText?: string;
15
16
  /**
16
17
  * Дополнительные стили компонента
17
18
  */
18
19
  classes?: InputControlClasses;
20
+ /**
21
+ * Размер контейнера для поля
22
+ */
23
+ size?: TFieldContainerConfig['size'];
19
24
  };
20
- declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, textHint, classes, ...props }: InputControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
25
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, helperText, classes, size, ...props }: InputControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
21
26
  export declare const InputControl: typeof InnerComponent;
22
27
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
2
2
  import { MaskInputProps } from '../../uncontrolled';
3
+ import { TFieldContainerConfig } from '../../ui';
3
4
  type MaskInputClasses = MaskInputProps['classes'] & {
4
5
  message?: string;
5
6
  };
@@ -15,8 +16,12 @@ type MaskInputControlProps<TFieldValues extends FieldValues = FieldValues, TName
15
16
  /**
16
17
  * Дополнительный текст
17
18
  */
18
- textHint?: string;
19
+ helperText?: string;
20
+ /**
21
+ * Размер контейнера для поля
22
+ */
23
+ size?: TFieldContainerConfig['size'];
19
24
  };
20
- declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, classes, textHint, ...props }: MaskInputControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
25
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, classes, helperText, size, ...props }: MaskInputControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
21
26
  export declare const MaskInputControl: typeof InnerComponent;
22
27
  export {};
@@ -21,8 +21,8 @@ type RadioGroupControlProps<TFieldValues extends FieldValues = FieldValues, TNam
21
21
  /**
22
22
  * Дополнительный текст
23
23
  */
24
- textHint?: string;
24
+ helperText?: string;
25
25
  };
26
- declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ classes, className, control, name, rules, shouldUnregister, disabled, defaultValue, textHint, label, ...props }: RadioGroupControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
26
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ classes, className, control, name, rules, shouldUnregister, disabled, defaultValue, helperText, label, ...props }: RadioGroupControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
27
27
  export declare const RadioGroupControl: typeof InnerComponent;
28
28
  export {};
@@ -1,5 +1,6 @@
1
1
  import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
2
2
  import { SelectBaseProps } from '../../..';
3
+ import { TFieldContainerConfig } from '../../ui';
3
4
  type SelectControlClasses = SelectBaseProps['classes'] & {
4
5
  container?: string;
5
6
  message?: string;
@@ -16,8 +17,12 @@ type SelectControlProps<TFieldValues extends FieldValues = FieldValues, TName ex
16
17
  /**
17
18
  * Дополнительный текст
18
19
  */
19
- textHint?: string;
20
+ helperText?: string;
21
+ /**
22
+ * Размер контейнера для поля
23
+ */
24
+ size?: TFieldContainerConfig['size'];
20
25
  };
21
- declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, classes, className, name, rules, shouldUnregister, disabled, defaultValue, returnValue, options, textHint, ...props }: SelectControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
26
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, classes, name, rules, shouldUnregister, disabled, defaultValue, returnValue, options, helperText, size, ...props }: SelectControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
22
27
  export declare const SelectControl: typeof InnerComponent;
23
28
  export {};
@@ -21,7 +21,7 @@ export type SwitchControlProps<TFieldValues extends FieldValues = FieldValues, T
21
21
  /**
22
22
  * Дополнительный текст
23
23
  */
24
- textHint?: string;
24
+ helperText?: string;
25
25
  /**
26
26
  * Текст всплывающей подсказки
27
27
  */
@@ -31,6 +31,6 @@ export type SwitchControlProps<TFieldValues extends FieldValues = FieldValues, T
31
31
  */
32
32
  popoverProps?: PopoverProps;
33
33
  };
34
- declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ classes, className, control, name, rules, defaultValue, disabled, shouldUnregister, children, textHint, tooltip, popoverProps, ...props }: SwitchControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
34
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ classes, className, control, name, rules, defaultValue, disabled, shouldUnregister, children, helperText, tooltip, popoverProps, ...props }: SwitchControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
35
35
  export declare const SwitchControl: typeof InnerComponent;
36
36
  export {};
@@ -5,7 +5,7 @@ export type { CheckboxBaseProps, CheckedState } from './checkbox';
5
5
  export type { SwitchBaseProps } from './switch';
6
6
  export type { RadioGroupBaseProps, RadioOption } from './radio';
7
7
  export declare const Uncontrolled: {
8
- InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
8
+ InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
9
9
  classes?: {
10
10
  container?: string;
11
11
  input?: string;
@@ -16,7 +16,7 @@ export declare const Uncontrolled: {
16
16
  attachmentProps?: import('../../../types').DeepPartial<import('../ui').IFieldAttachmentProps>;
17
17
  renderValues?: () => React.JSX.Element | null;
18
18
  } & import('react').RefAttributes<HTMLInputElement>>;
19
- MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
19
+ MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
20
20
  classes?: {
21
21
  container?: string;
22
22
  input?: string;
@@ -6,7 +6,7 @@ type InputBaseClasses = {
6
6
  label?: string;
7
7
  };
8
8
  type FieldAttachmentProps = React.ComponentPropsWithoutRef<typeof FieldAttachment>;
9
- export type InputBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'placeholder'> & {
9
+ export type InputBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'placeholder' | 'size'> & {
10
10
  /**
11
11
  * Дополнительные стили внутренних компонентов
12
12
  */
@@ -28,7 +28,7 @@ export type InputBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, '
28
28
  */
29
29
  renderValues?: () => React.JSX.Element | null;
30
30
  };
31
- export declare const InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
31
+ export declare const InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
32
32
  /**
33
33
  * Дополнительные стили внутренних компонентов
34
34
  */
@@ -25,7 +25,7 @@ export type MaskInputProps = InputBaseProps & {
25
25
  * @typeParam `A` позволяет вводить любые буквы русского и английского алфавита (regexp: `/[A-Za-zА-Яа-я]/g`)
26
26
  * @typeParam `C` позволяет вводить любые буквы, которые определены для использования в гос номерах автомобилей (regexp: `/([АВЕКМНОРСТУХавекмнорстух])/`)
27
27
  */
28
- export declare const MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
28
+ export declare const MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
29
29
  classes?: {
30
30
  container?: string;
31
31
  input?: string;
@@ -1,9 +1,9 @@
1
1
  import { TModalHeaderClasses } from './ui/ModalHeader';
2
2
  import * as React from 'react';
3
3
  type IModalClasses = {
4
- overlay: string;
5
- modal: string;
6
- content: string;
4
+ overlay?: string;
5
+ modal?: string;
6
+ content?: string;
7
7
  modalHeader?: TModalHeaderClasses;
8
8
  };
9
9
  export interface IModalProps {