skillgrid 0.0.24 → 0.0.25-dev-40846-input.1178444
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/components/InputBase/Input.type.d.ts +6 -2
- package/dist/components/InputBase/InputBase.type.d.ts +8 -4
- package/dist/components/List/List.d.ts +2 -3
- package/dist/components/Palette/Palette.d.ts +0 -1
- package/dist/components/TextArea/TextArea.type.d.ts +7 -3
- package/dist/components/TextArea/lib/constants.d.ts +17 -17
- package/dist/components/TextArea/lib/getters.d.ts +1 -1
- package/dist/components/TextInput/TextInput.type.d.ts +7 -3
- package/dist/components/TextInput/lib/constants.d.ts +4 -3
- package/dist/components/TextInput/lib/getters.d.ts +10 -6
- package/dist/index.cjs.js +11 -11
- package/dist/index.css +1 -1
- package/dist/index.es.js +1390 -1298
- package/package.json +2 -2
|
@@ -6,11 +6,11 @@ export type InputComponent = 'input' | 'textarea';
|
|
|
6
6
|
/**
|
|
7
7
|
* Размер компонента Input
|
|
8
8
|
*/
|
|
9
|
-
export type InputSize = '
|
|
9
|
+
export type InputSize = 'S' | 'M' | 'L' | 'XL';
|
|
10
10
|
/**
|
|
11
11
|
* Размер компонента InputWrapper
|
|
12
12
|
*/
|
|
13
|
-
export type InputWrapperSize = '
|
|
13
|
+
export type InputWrapperSize = 'S' | 'M' | 'L' | 'XL';
|
|
14
14
|
/**
|
|
15
15
|
* Пропсы для компонента Input
|
|
16
16
|
*/
|
|
@@ -35,6 +35,8 @@ export interface InputProps {
|
|
|
35
35
|
onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
36
36
|
/** Обработчик нажатия клавиши */
|
|
37
37
|
onKeyUp?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
38
|
+
/** Обработчик нажатия клавиши */
|
|
39
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
38
40
|
/** Максимальная длина */
|
|
39
41
|
maxLength?: number;
|
|
40
42
|
/** CSS классы */
|
|
@@ -102,6 +104,8 @@ export interface InputWrapperProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
102
104
|
prefix?: React.ReactNode;
|
|
103
105
|
/** Суффикс (иконка справа) */
|
|
104
106
|
suffix?: React.ReactNode;
|
|
107
|
+
/** Обработчик клика по суффиксу */
|
|
108
|
+
onSuffixClick?: () => void;
|
|
105
109
|
/** Плейсхолдер для поля */
|
|
106
110
|
placeholder?: string;
|
|
107
111
|
/** Показывать ли метку */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes } from 'react';
|
|
1
|
+
import { ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, ChangeEvent } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Размеры для компонента InputBase
|
|
4
4
|
*/
|
|
5
|
-
export type InputBaseSize = '
|
|
5
|
+
export type InputBaseSize = 'S' | 'M' | 'L' | 'XL';
|
|
6
6
|
/**
|
|
7
7
|
* Типы компонентов для InputBase
|
|
8
8
|
*/
|
|
@@ -43,10 +43,14 @@ export interface InputBaseProps {
|
|
|
43
43
|
onFocus?: () => void;
|
|
44
44
|
/** Обработчик потери фокуса */
|
|
45
45
|
onBlur?: () => void;
|
|
46
|
+
/** Обработчик нажатия клавиши */
|
|
47
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
48
|
+
/** Обработчик клика по суффиксу */
|
|
49
|
+
onSuffixClick?: () => void;
|
|
46
50
|
/** Обработчик изменения значения */
|
|
47
|
-
onChange?: (
|
|
51
|
+
onChange?: (text: string, e?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
48
52
|
/** Текущее значение */
|
|
49
|
-
value?: string;
|
|
53
|
+
value?: string | null;
|
|
50
54
|
/** Стили для обертки */
|
|
51
55
|
wrapperProps?: HTMLAttributes<HTMLDivElement>;
|
|
52
56
|
/** Стили для метки */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { ListProps } from './List.type';
|
|
3
|
-
export declare const List:
|
|
4
|
-
Item:
|
|
2
|
+
export declare const List: import('react').ForwardRefExoticComponent<ListProps & import('react').RefAttributes<HTMLOListElement | HTMLUListElement>> & {
|
|
3
|
+
Item: import('react').FC<import('./ListItem/ListItem').ListItemProps>;
|
|
5
4
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TextareaHTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { TextareaHTMLAttributes, ReactNode, ChangeEvent } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Размеры для компонента TextArea
|
|
4
4
|
*/
|
|
5
|
-
export type TextAreaSize = '
|
|
5
|
+
export type TextAreaSize = 'M' | 'L';
|
|
6
6
|
/**
|
|
7
7
|
* Пропсы для компонента TextArea
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ export interface TextAreaProps {
|
|
|
10
10
|
/** Значение поля */
|
|
11
11
|
value?: string | null;
|
|
12
12
|
/** Обработчик изменения значения */
|
|
13
|
-
onChange?: (
|
|
13
|
+
onChange?: (text: string, e?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
14
14
|
/** Плейсхолдер для поля */
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
/** Максимальная длина */
|
|
@@ -41,6 +41,10 @@ export interface TextAreaProps {
|
|
|
41
41
|
onFocus?: () => void;
|
|
42
42
|
/** Обработчик потери фокуса */
|
|
43
43
|
onBlur?: () => void;
|
|
44
|
+
/** Обработчик очистки поля */
|
|
45
|
+
onClear?: () => void;
|
|
46
|
+
/** Обработчик нажатия клавиши */
|
|
47
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
44
48
|
/** Дополнительные CSS классы */
|
|
45
49
|
className?: string;
|
|
46
50
|
/** Количество строк для textarea */
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* Константы для размеров TextArea
|
|
3
3
|
*/
|
|
4
4
|
export declare const SIZES: {
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
5
|
+
readonly M: "M";
|
|
6
|
+
readonly L: "L";
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Константы для позиций
|
|
10
10
|
*/
|
|
11
11
|
export declare const POSITIONS: {
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
12
|
+
readonly M: "12px";
|
|
13
|
+
readonly L: "16px";
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Константы для размеров иконок
|
|
17
17
|
*/
|
|
18
18
|
export declare const ICON_SIZES: {
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
19
|
+
readonly M: "xs";
|
|
20
|
+
readonly L: "sm";
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* Константы для resize режимов
|
|
@@ -32,32 +32,32 @@ export declare const RESIZE_MODES: {
|
|
|
32
32
|
* Константы для высот wrapper
|
|
33
33
|
*/
|
|
34
34
|
export declare const WRAPPER_HEIGHTS: {
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
35
|
+
readonly M: "112px";
|
|
36
|
+
readonly L: "56px";
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Константы для высот textarea
|
|
40
40
|
*/
|
|
41
41
|
export declare const TEXTAREA_HEIGHTS: {
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
42
|
+
readonly M: "48px";
|
|
43
|
+
readonly L: "22px";
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Константы для padding
|
|
47
47
|
*/
|
|
48
48
|
export declare const PADDING: {
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
readonly
|
|
49
|
+
readonly M: "12px 12px 12px 12px";
|
|
50
|
+
readonly L: "16px 16px 16px 16px";
|
|
51
|
+
readonly L_WITH_PREFIX: "12px 16px 12px 16px";
|
|
52
|
+
readonly L_FLOATING_LABEL: "8px 16px 8px 16px";
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
55
|
* Константы для minHeight значений
|
|
56
56
|
*/
|
|
57
57
|
export declare const MIN_HEIGHTS: {
|
|
58
|
-
readonly
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
58
|
+
readonly M: 48;
|
|
59
|
+
readonly L: 56;
|
|
60
|
+
readonly XL: 112;
|
|
61
61
|
};
|
|
62
62
|
export type TextAreaSize = (typeof SIZES)[keyof typeof SIZES];
|
|
63
63
|
export type TextAreaPosition = (typeof POSITIONS)[keyof typeof POSITIONS];
|
|
@@ -23,7 +23,7 @@ export declare const getPadding: (size: TextAreaSize, minHeight?: number, should
|
|
|
23
23
|
/**
|
|
24
24
|
* Получает размер для InputBase в зависимости от размера TextArea и minHeight
|
|
25
25
|
*/
|
|
26
|
-
export declare const getInputBaseSize: (size: TextAreaSize, minHeight?: number) => "
|
|
26
|
+
export declare const getInputBaseSize: (size: TextAreaSize, minHeight?: number) => "M" | "L";
|
|
27
27
|
/**
|
|
28
28
|
* Получает размер иконки в зависимости от размера TextArea
|
|
29
29
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { InputHTMLAttributes, ReactNode, ChangeEvent } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
* Размеры для компонента TextInput
|
|
4
4
|
*/
|
|
5
|
-
export type TextInputSize = '
|
|
5
|
+
export type TextInputSize = 'S' | 'M' | 'L' | 'XL';
|
|
6
6
|
/**
|
|
7
7
|
* Пропсы для компонента TextInput
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ export interface TextInputProps {
|
|
|
10
10
|
/** Значение поля */
|
|
11
11
|
value?: string | null;
|
|
12
12
|
/** Обработчик изменения значения */
|
|
13
|
-
onChange?: (
|
|
13
|
+
onChange?: (text: string, e?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
14
14
|
/** Плейсхолдер для поля */
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
/** Тип элемента input */
|
|
@@ -47,6 +47,10 @@ export interface TextInputProps {
|
|
|
47
47
|
onFocus?: () => void;
|
|
48
48
|
/** Обработчик потери фокуса */
|
|
49
49
|
onBlur?: () => void;
|
|
50
|
+
/** Обработчик клика по суффиксу */
|
|
51
|
+
onSuffixClick?: () => void;
|
|
52
|
+
/** Обработчик очистки поля */
|
|
53
|
+
onClear?: () => void;
|
|
50
54
|
/** Дополнительные CSS классы */
|
|
51
55
|
className?: string;
|
|
52
56
|
/** Включить обрезку текста с многоточием */
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Константы для размеров TextInput
|
|
3
3
|
*/
|
|
4
4
|
export declare const SIZES: {
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
5
|
+
readonly S: "S";
|
|
6
|
+
readonly M: "M";
|
|
7
|
+
readonly L: "L";
|
|
8
|
+
readonly XL: "XL";
|
|
8
9
|
};
|
|
9
10
|
export type TextInputSize = (typeof SIZES)[keyof typeof SIZES];
|
|
@@ -21,17 +21,21 @@ export declare const getHeight: (size: TextInputSize) => string;
|
|
|
21
21
|
*/
|
|
22
22
|
export declare const getPrefixSuffixSpacing: (size: TextInputSize) => number;
|
|
23
23
|
/**
|
|
24
|
-
* Получает стили для
|
|
24
|
+
* Получает стили для S размера
|
|
25
25
|
*/
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const getSSizeStyles: (height: string, padding: string, spacing: number) => SizeStyles;
|
|
27
27
|
/**
|
|
28
|
-
* Получает стили для
|
|
28
|
+
* Получает стили для XL размера
|
|
29
29
|
*/
|
|
30
|
-
export declare const
|
|
30
|
+
export declare const getXLSizeStyles: (height: string, padding: string, spacing: number) => SizeStyles;
|
|
31
31
|
/**
|
|
32
|
-
* Получает стили для
|
|
32
|
+
* Получает стили для L размера
|
|
33
33
|
*/
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const getLSizeStyles: (height: string, padding: string, spacing: number) => SizeStyles;
|
|
35
|
+
/**
|
|
36
|
+
* Получает стили для M размера
|
|
37
|
+
*/
|
|
38
|
+
export declare const getMSizeStyles: (height: string, padding: string, spacing: number) => SizeStyles;
|
|
35
39
|
/**
|
|
36
40
|
* Основная функция для получения стилей размеров
|
|
37
41
|
*/
|