@ozen-ui/kit 0.8.0 → 0.9.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/FieldControl/package.json +5 -0
- package/FieldInput/package.json +5 -0
- package/Fieldset/package.json +5 -0
- package/__inner__/cjs/components/Backdrop/Backdrop.d.ts +2 -2
- package/__inner__/cjs/components/Breadcrumbs/types.d.ts +2 -2
- package/__inner__/cjs/components/DataList/DataList.d.ts +1 -1
- package/__inner__/cjs/components/DataList/DataListProvider.d.ts +5 -5
- package/__inner__/cjs/components/FieldControl/FieldControl.css +135 -0
- package/__inner__/cjs/components/FieldControl/FieldControl.d.ts +13 -0
- package/__inner__/cjs/components/FieldControl/FieldControl.js +82 -0
- package/__inner__/cjs/components/FieldControl/FieldControlContext.d.ts +15 -0
- package/__inner__/cjs/components/FieldControl/FieldControlContext.js +6 -0
- package/__inner__/cjs/components/FieldControl/index.d.ts +2 -0
- package/__inner__/cjs/components/FieldControl/index.js +5 -0
- package/__inner__/cjs/components/FieldHint/FieldHint.d.ts +6 -9
- package/__inner__/cjs/components/FieldHint/FieldHint.js +24 -4
- package/__inner__/cjs/components/FieldIcon/FieldIcon.css +1 -21
- package/__inner__/cjs/components/FieldIcon/FieldIcon.d.ts +8 -12
- package/__inner__/cjs/components/FieldIcon/FieldIcon.js +15 -4
- package/__inner__/cjs/components/FieldInput/FieldInput.d.ts +11 -0
- package/__inner__/cjs/components/FieldInput/FieldInput.js +54 -0
- package/__inner__/cjs/components/FieldInput/index.d.ts +1 -0
- package/__inner__/cjs/components/FieldInput/index.js +4 -0
- package/__inner__/cjs/components/FieldLabel/FieldLabel.d.ts +7 -5
- package/__inner__/cjs/components/FieldLabel/FieldLabel.js +39 -10
- package/__inner__/cjs/components/Fieldset/Fieldset.css +13 -0
- package/__inner__/cjs/components/Fieldset/Fieldset.d.ts +10 -0
- package/__inner__/cjs/components/Fieldset/Fieldset.js +15 -0
- package/__inner__/cjs/components/Fieldset/index.d.ts +1 -0
- package/__inner__/cjs/components/Fieldset/index.js +4 -0
- package/__inner__/cjs/components/FilePicker/FilePicker.css +48 -59
- package/__inner__/cjs/components/FilePicker/FilePicker.js +2 -1
- package/__inner__/cjs/components/Input/Input.css +9 -121
- package/__inner__/cjs/components/Input/Input.d.ts +1 -62
- package/__inner__/cjs/components/Input/Input.js +32 -53
- package/__inner__/cjs/components/Input/constants.d.ts +1 -0
- package/__inner__/cjs/components/Input/constants.js +4 -0
- package/__inner__/cjs/components/Input/index.d.ts +1 -0
- package/__inner__/cjs/components/Input/index.js +1 -0
- package/__inner__/cjs/components/Input/types.d.ts +71 -0
- package/__inner__/cjs/components/Input/types.js +13 -0
- package/__inner__/cjs/components/InputNumber/InputNumber.css +60 -74
- package/__inner__/cjs/components/InputNumber/InputNumber.js +2 -1
- package/__inner__/cjs/components/InputNumber/utils.d.ts +2 -2
- package/__inner__/cjs/components/Link/Link.d.ts +1 -1
- package/__inner__/cjs/components/List/components/ListItem/ListItem.d.ts +1 -2
- package/__inner__/cjs/components/List/components/ListItemButton/ListItemButton.d.ts +1 -2
- package/__inner__/cjs/components/List/types.d.ts +3 -3
- package/__inner__/cjs/components/Menu/components/MenuItem/MenuItem.d.ts +1 -1
- package/__inner__/cjs/components/Menu/components/MenuList/MenuList.d.ts +1 -1
- package/__inner__/cjs/components/Modal/Modal.d.ts +1 -1
- package/__inner__/cjs/components/Modal/Modal.js +1 -1
- package/__inner__/cjs/components/Modal/components/ModalConsumer.d.ts +2 -2
- package/__inner__/cjs/components/Pagination/helpers/createPaginationRange/createPaginationRange.d.ts +1 -1
- package/__inner__/cjs/components/Pagination/types.d.ts +5 -5
- package/__inner__/cjs/components/Popover/types.d.ts +4 -5
- package/__inner__/cjs/components/ProgressBar/ProgressBar.d.ts +2 -2
- package/__inner__/cjs/components/Select/Select.css +5 -16
- package/__inner__/cjs/components/Select/components/SelectInput/SelectInput.js +2 -1
- package/__inner__/cjs/components/Select/types.d.ts +3 -4
- package/__inner__/cjs/components/Slider/types.d.ts +1 -1
- package/__inner__/cjs/components/Snackbar/types.d.ts +1 -1
- package/__inner__/cjs/components/Tag/components/RemoveButton/RemoveButton.d.ts +1 -1
- package/__inner__/cjs/components/Textarea/Textarea.css +3 -107
- package/__inner__/cjs/components/Textarea/Textarea.d.ts +1 -59
- package/__inner__/cjs/components/Textarea/Textarea.js +8 -62
- package/__inner__/cjs/components/Textarea/components/TextareaConsumer.d.ts +3 -0
- package/__inner__/cjs/components/Textarea/components/TextareaConsumer.js +36 -0
- package/__inner__/cjs/components/Textarea/components/TextareaCounter.d.ts +7 -0
- package/__inner__/cjs/components/Textarea/components/TextareaCounter.js +25 -0
- package/__inner__/cjs/components/Textarea/components/index.d.ts +2 -0
- package/__inner__/cjs/components/Textarea/components/index.js +5 -0
- package/__inner__/cjs/components/Textarea/constants.d.ts +1 -0
- package/__inner__/cjs/components/Textarea/constants.js +4 -0
- package/__inner__/cjs/components/Textarea/index.d.ts +1 -0
- package/__inner__/cjs/components/Textarea/index.js +1 -0
- package/__inner__/cjs/components/Textarea/types.d.ts +69 -0
- package/__inner__/cjs/components/Textarea/types.js +4 -0
- package/__inner__/cjs/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/cjs/components/Tooltip/types.d.ts +1 -1
- package/__inner__/cjs/hooks/useMultiRef/useMultiRef.d.ts +2 -3
- package/__inner__/cjs/types/ResponsiveValue.d.ts +1 -1
- package/__inner__/cjs/utils/isKey.d.ts +2 -2
- package/__inner__/cjs/utils/polymorphicComponentWithRef.d.ts +0 -1
- package/__inner__/esm/components/Backdrop/Backdrop.d.ts +2 -2
- package/__inner__/esm/components/Backdrop/Backdrop.js +1 -1
- package/__inner__/esm/components/Breadcrumbs/types.d.ts +2 -2
- package/__inner__/esm/components/DataList/DataList.d.ts +1 -1
- package/__inner__/esm/components/DataList/DataListProvider.d.ts +5 -5
- package/__inner__/esm/components/FieldControl/FieldControl.css +135 -0
- package/__inner__/esm/components/FieldControl/FieldControl.d.ts +13 -0
- package/__inner__/esm/components/FieldControl/FieldControl.js +79 -0
- package/__inner__/esm/components/FieldControl/FieldControlContext.d.ts +15 -0
- package/__inner__/esm/components/FieldControl/FieldControlContext.js +2 -0
- package/__inner__/esm/components/FieldControl/index.d.ts +2 -0
- package/__inner__/esm/components/FieldControl/index.js +2 -0
- package/__inner__/esm/components/FieldHint/FieldHint.d.ts +6 -9
- package/__inner__/esm/components/FieldHint/FieldHint.js +25 -5
- package/__inner__/esm/components/FieldIcon/FieldIcon.css +1 -21
- package/__inner__/esm/components/FieldIcon/FieldIcon.d.ts +8 -12
- package/__inner__/esm/components/FieldIcon/FieldIcon.js +16 -5
- package/__inner__/esm/components/FieldInput/FieldInput.d.ts +11 -0
- package/__inner__/esm/components/FieldInput/FieldInput.js +51 -0
- package/__inner__/esm/components/FieldInput/index.d.ts +1 -0
- package/__inner__/esm/components/FieldInput/index.js +1 -0
- package/__inner__/esm/components/FieldLabel/FieldLabel.d.ts +7 -5
- package/__inner__/esm/components/FieldLabel/FieldLabel.js +38 -8
- package/__inner__/esm/components/Fieldset/Fieldset.css +13 -0
- package/__inner__/esm/components/Fieldset/Fieldset.d.ts +10 -0
- package/__inner__/esm/components/Fieldset/Fieldset.js +12 -0
- package/__inner__/esm/components/Fieldset/index.d.ts +1 -0
- package/__inner__/esm/components/Fieldset/index.js +1 -0
- package/__inner__/esm/components/FilePicker/FilePicker.css +48 -59
- package/__inner__/esm/components/FilePicker/FilePicker.js +2 -1
- package/__inner__/esm/components/Input/Input.css +9 -121
- package/__inner__/esm/components/Input/Input.d.ts +1 -62
- package/__inner__/esm/components/Input/Input.js +33 -54
- package/__inner__/esm/components/Input/constants.d.ts +1 -0
- package/__inner__/esm/components/Input/constants.js +1 -0
- package/__inner__/esm/components/Input/index.d.ts +1 -0
- package/__inner__/esm/components/Input/index.js +1 -0
- package/__inner__/esm/components/Input/types.d.ts +71 -0
- package/__inner__/esm/components/Input/types.js +10 -0
- package/__inner__/esm/components/InputNumber/InputNumber.css +60 -74
- package/__inner__/esm/components/InputNumber/InputNumber.js +2 -1
- package/__inner__/esm/components/InputNumber/utils.d.ts +2 -2
- package/__inner__/esm/components/Link/Link.d.ts +1 -1
- package/__inner__/esm/components/List/components/ListItem/ListItem.d.ts +1 -2
- package/__inner__/esm/components/List/components/ListItemButton/ListItemButton.d.ts +1 -2
- package/__inner__/esm/components/List/types.d.ts +3 -3
- package/__inner__/esm/components/Menu/components/MenuItem/MenuItem.d.ts +1 -1
- package/__inner__/esm/components/Menu/components/MenuList/MenuList.d.ts +1 -1
- package/__inner__/esm/components/Modal/Modal.d.ts +1 -1
- package/__inner__/esm/components/Modal/Modal.js +1 -1
- package/__inner__/esm/components/Modal/components/ModalConsumer.d.ts +2 -2
- package/__inner__/esm/components/Pagination/helpers/createPaginationRange/createPaginationRange.d.ts +1 -1
- package/__inner__/esm/components/Pagination/types.d.ts +5 -5
- package/__inner__/esm/components/Popover/types.d.ts +4 -5
- package/__inner__/esm/components/ProgressBar/ProgressBar.d.ts +2 -2
- package/__inner__/esm/components/ProgressBar/ProgressBar.js +1 -1
- package/__inner__/esm/components/Select/Select.css +5 -16
- package/__inner__/esm/components/Select/components/SelectInput/SelectInput.js +2 -1
- package/__inner__/esm/components/Select/types.d.ts +3 -4
- package/__inner__/esm/components/Slider/types.d.ts +1 -1
- package/__inner__/esm/components/Snackbar/types.d.ts +1 -1
- package/__inner__/esm/components/Tag/components/RemoveButton/RemoveButton.d.ts +1 -1
- package/__inner__/esm/components/Textarea/Textarea.css +3 -107
- package/__inner__/esm/components/Textarea/Textarea.d.ts +1 -59
- package/__inner__/esm/components/Textarea/Textarea.js +9 -63
- package/__inner__/esm/components/Textarea/components/TextareaConsumer.d.ts +3 -0
- package/__inner__/esm/components/Textarea/components/TextareaConsumer.js +32 -0
- package/__inner__/esm/components/Textarea/components/TextareaCounter.d.ts +7 -0
- package/__inner__/esm/components/Textarea/components/TextareaCounter.js +21 -0
- package/__inner__/esm/components/Textarea/components/index.d.ts +2 -0
- package/__inner__/esm/components/Textarea/components/index.js +2 -0
- package/__inner__/esm/components/Textarea/constants.d.ts +1 -0
- package/__inner__/esm/components/Textarea/constants.js +1 -0
- package/__inner__/esm/components/Textarea/index.d.ts +1 -0
- package/__inner__/esm/components/Textarea/index.js +1 -0
- package/__inner__/esm/components/Textarea/types.d.ts +69 -0
- package/__inner__/esm/components/Textarea/types.js +1 -0
- package/__inner__/esm/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/__inner__/esm/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/esm/components/Tooltip/Tooltip.js +1 -1
- package/__inner__/esm/components/Tooltip/types.d.ts +1 -1
- package/__inner__/esm/hooks/useMultiRef/useMultiRef.d.ts +2 -3
- package/__inner__/esm/types/ResponsiveValue.d.ts +1 -1
- package/__inner__/esm/utils/isKey.d.ts +2 -2
- package/__inner__/esm/utils/polymorphicComponentWithRef.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
.Textarea {
|
|
2
|
-
--textfield-color: var(--color-content-primary);
|
|
3
|
-
--textfield-background-color: var(--color-background-primary);
|
|
4
|
-
--textfield-border-width: var(--border-width-s);
|
|
5
|
-
--textfield-border-color: var(--color-border-main);
|
|
6
2
|
--textfield-scroll-size: 12px;
|
|
7
|
-
min-block-size: var(--textfield-input-
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
vertical-align: top;
|
|
10
|
-
flex-direction: column;
|
|
3
|
+
min-block-size: var(--textfield-input-height);
|
|
11
4
|
position: relative;
|
|
12
|
-
cursor: text;
|
|
13
5
|
}
|
|
14
6
|
|
|
15
|
-
.Textarea > * {
|
|
16
|
-
cursor: text;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
7
|
.Textarea-Label {
|
|
20
8
|
padding: 0 var(--textfield-gutter-x);
|
|
21
9
|
}
|
|
22
10
|
|
|
23
|
-
.Textarea-Fieldset {
|
|
24
|
-
position: absolute;
|
|
25
|
-
inset-block-end: 0;
|
|
26
|
-
inset-inline-end: 0;
|
|
27
|
-
inset-block-start: 0;
|
|
28
|
-
inset-inline-start: 0;
|
|
29
|
-
margin: 0;
|
|
30
|
-
padding: 0;
|
|
31
|
-
pointer-events: none;
|
|
32
|
-
border-radius: var(--border-radius-xs);
|
|
33
|
-
border: var(--textfield-border-width) solid var(--textfield-border-color);
|
|
34
|
-
transition: border var(--transition-default);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
11
|
.Textarea-Body,
|
|
38
12
|
.Textarea-Field {
|
|
39
13
|
transition: background-color var(--transition-slow);
|
|
@@ -50,10 +24,9 @@
|
|
|
50
24
|
transition: background-color var(--transition-slow);
|
|
51
25
|
color: var(--textfield-color);
|
|
52
26
|
border-radius: var(--border-radius-xs);
|
|
53
|
-
padding-block-start: 16px;
|
|
54
|
-
padding-block-end: 16px;
|
|
55
27
|
min-block-size: inherit;
|
|
56
28
|
block-size: inherit;
|
|
29
|
+
padding: var(--textfield-input-padding);
|
|
57
30
|
}
|
|
58
31
|
|
|
59
32
|
.Textarea-Field {
|
|
@@ -95,7 +68,7 @@
|
|
|
95
68
|
border: none;
|
|
96
69
|
display: flex;
|
|
97
70
|
outline: none;
|
|
98
|
-
font:
|
|
71
|
+
font: inherit;
|
|
99
72
|
background-color: var(--textfield-background-color);
|
|
100
73
|
color: var(--textfield-color);
|
|
101
74
|
padding: 0 var(--textfield-gutter-x);
|
|
@@ -126,80 +99,3 @@
|
|
|
126
99
|
resize: vertical;
|
|
127
100
|
overflow: hidden;
|
|
128
101
|
}
|
|
129
|
-
|
|
130
|
-
.Textarea_hasLabel .Textarea-Field::placeholder {
|
|
131
|
-
opacity: 0;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.Textarea_hasLabel .Textarea-Field:focus::placeholder {
|
|
135
|
-
opacity: 1;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.Textarea_hasLabel .Textarea-Body {
|
|
139
|
-
padding: var(--textfield-input-padding);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.Textarea_fullWidth {
|
|
143
|
-
inline-size: 100%;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.Textarea_size_2xs {
|
|
147
|
-
--textfield-gutter-x: 12px;
|
|
148
|
-
--textfield-input-block-size: 32px;
|
|
149
|
-
--textfield-input-font: var(--typography-text-2xs-font);
|
|
150
|
-
--textfield-input-padding: 8px 0 8px;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.Textarea_size_xs {
|
|
154
|
-
--textfield-gutter-x: 12px;
|
|
155
|
-
--textfield-input-block-size: 40px;
|
|
156
|
-
--textfield-input-font: var(--typography-text-xs-font);
|
|
157
|
-
--textfield-input-padding: 19px 0 4px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.Textarea_size_s {
|
|
161
|
-
--textfield-gutter-x: 16px;
|
|
162
|
-
--textfield-input-block-size: 48px;
|
|
163
|
-
--textfield-input-font: var(--typography-text-s-font);
|
|
164
|
-
--textfield-input-padding: 21px 0 6px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.Textarea_size_m {
|
|
168
|
-
--textfield-gutter-x: 20px;
|
|
169
|
-
--textfield-input-block-size: 56px;
|
|
170
|
-
--textfield-input-font: var(--typography-text-m-font);
|
|
171
|
-
--textfield-input-padding: 24px 0 6px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.Textarea_size_l {
|
|
175
|
-
--textfield-gutter-x: 24px;
|
|
176
|
-
--textfield-input-block-size: 64px;
|
|
177
|
-
--textfield-input-font: var(--typography-text-l-font);
|
|
178
|
-
--textfield-input-padding: 26px 0 6px;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.Textarea:hover {
|
|
182
|
-
--textfield-border-color: var(--color-border-main-hover);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.Textarea_focused,
|
|
186
|
-
.Textarea_focused:hover {
|
|
187
|
-
--textfield-border-width: var(--border-width-m);
|
|
188
|
-
--textfield-background-color: var(--color-background-main);
|
|
189
|
-
--textfield-border-color: var(--color-border-action);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.Textarea_error,
|
|
193
|
-
.Textarea_error.Textarea:hover,
|
|
194
|
-
.Textarea_error.Textarea_focused,
|
|
195
|
-
.Textarea_error.Textarea_focused:hover {
|
|
196
|
-
--textfield-border-color: var(--color-border-error);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.Textarea_disabled {
|
|
200
|
-
--textfield-border-color: var(--color-border-disabled);
|
|
201
|
-
--textfield-background-color: var(--color-background-disabled);
|
|
202
|
-
--textfield-color: var(--color-content-secondary);
|
|
203
|
-
pointer-events: none;
|
|
204
|
-
cursor: default;
|
|
205
|
-
}
|
|
@@ -1,63 +1,5 @@
|
|
|
1
1
|
import './Textarea.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
4
|
-
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
5
|
-
import { type FieldLabelProps } from '../FieldLabel';
|
|
3
|
+
import type { TextareaProps } from './index';
|
|
6
4
|
export declare const cnTextarea: import("@bem-react/classname").ClassNameFormatter;
|
|
7
|
-
export type TextareaSizeVariant = FormElementSizeVariant;
|
|
8
|
-
export declare const textareaExpandVariant: readonly ["autoSize", "verticalResize"];
|
|
9
|
-
export type TextareaExpandVariant = (typeof textareaExpandVariant)[number];
|
|
10
|
-
type TextareaElement = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
11
|
-
export type TextareaProps = {
|
|
12
|
-
/** Атрибут id для элемента input */
|
|
13
|
-
id?: string;
|
|
14
|
-
/** Атрибут name для элемента input */
|
|
15
|
-
name?: string;
|
|
16
|
-
/** Лейбл */
|
|
17
|
-
label?: string;
|
|
18
|
-
/** Размер компонента */
|
|
19
|
-
size?: TextareaSizeVariant;
|
|
20
|
-
/** Подсказка. Отображается, когда вариант не выбран */
|
|
21
|
-
placeholder?: string;
|
|
22
|
-
/** Если {true} устанавливает автофокус */
|
|
23
|
-
autoFocus?: boolean;
|
|
24
|
-
/** Если {true} переводит поле в состояние ошибки */
|
|
25
|
-
error?: boolean;
|
|
26
|
-
/** Если {true} растягивает поле на всю ширину */
|
|
27
|
-
fullWidth?: boolean;
|
|
28
|
-
/** Дополнительное описание к полю */
|
|
29
|
-
hint?: string | null | undefined;
|
|
30
|
-
/** Если {true} делает элемент неактивным */
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
/** Если {true} делает элемент обязательным к заполнению */
|
|
33
|
-
required?: boolean;
|
|
34
|
-
/** Устанавливает максимальное число символов, которое может быть введено пользователем в текстовом поле. */
|
|
35
|
-
maxLength?: number;
|
|
36
|
-
/** Количество колонок */
|
|
37
|
-
cols?: number;
|
|
38
|
-
/** Количество строк */
|
|
39
|
-
rows?: number;
|
|
40
|
-
/** Расширяемость поля */
|
|
41
|
-
expand?: TextareaExpandVariant;
|
|
42
|
-
/** Выбранное значение */
|
|
43
|
-
value?: string;
|
|
44
|
-
/** Значение по умолчанию (неконтролируемый компонент) */
|
|
45
|
-
defaultValue?: string;
|
|
46
|
-
/** Обработчик события на изменение значения поля */
|
|
47
|
-
onChange?: TextareaElement['onChange'];
|
|
48
|
-
/** Ссылка на элемент textarea */
|
|
49
|
-
textareaRef?: Ref<HTMLTextAreaElement>;
|
|
50
|
-
/** Свойства элемента textarea */
|
|
51
|
-
textareaProps?: TextareaElement & {
|
|
52
|
-
'data-testid'?: string;
|
|
53
|
-
};
|
|
54
|
-
/** Ссылка на FieldLabel */
|
|
55
|
-
labelRef?: FieldLabelProps['ref'];
|
|
56
|
-
/** Свойства FieldLabel */
|
|
57
|
-
labelProps?: FieldLabelProps;
|
|
58
|
-
/** Ссылка на корневой DOM-элемент компонента */
|
|
59
|
-
ref?: Ref<HTMLDivElement>;
|
|
60
|
-
'data-testid'?: string;
|
|
61
|
-
} & Omit<HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'onChange'>;
|
|
62
5
|
export declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
-
export {};
|
|
@@ -1,78 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.Textarea = exports.
|
|
3
|
+
exports.Textarea = exports.cnTextarea = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./Textarea.css");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
-
var useMultiRef_1 = require("../../hooks/useMultiRef");
|
|
8
7
|
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
9
8
|
var classname_1 = require("../../utils/classname");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var FieldControl_1 = require("../FieldControl");
|
|
10
|
+
var components_1 = require("./components");
|
|
11
|
+
var constants_1 = require("./constants");
|
|
12
12
|
exports.cnTextarea = (0, classname_1.cn)('Textarea');
|
|
13
|
-
exports.textareaExpandVariant = ['autoSize', 'verticalResize'];
|
|
14
13
|
exports.Textarea = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
15
14
|
var props = (0, useThemeProps_1.useThemeProps)({
|
|
16
15
|
props: inProps,
|
|
17
16
|
name: 'Textarea'
|
|
18
17
|
});
|
|
19
|
-
var _a = props.size, size = _a === void 0 ?
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _b = tslib_1.__read((0, react_1.useState)(), 2), focused = _b[0], setFocused = _b[1];
|
|
23
|
-
var _c = tslib_1.__read((0, react_1.useState)(defaultValue), 2), valueState = _c[0], setValueState = _c[1];
|
|
24
|
-
var filled = isControlled ? !!valueProp : !!valueState;
|
|
25
|
-
// autoSize
|
|
26
|
-
(0, react_1.useEffect)(function () {
|
|
27
|
-
if (fieldRef.current && expand === 'autoSize') {
|
|
28
|
-
fieldRef.current.style.blockSize = '0px';
|
|
29
|
-
var scrollHeight = fieldRef.current.scrollHeight;
|
|
30
|
-
fieldRef.current.style.blockSize = "".concat(scrollHeight, "px");
|
|
31
|
-
}
|
|
32
|
-
}, [valueProp, valueState]);
|
|
33
|
-
// maxLength
|
|
34
|
-
var counter = (0, react_1.useMemo)(function () {
|
|
35
|
-
var _a;
|
|
36
|
-
var value = valueProp || valueState;
|
|
37
|
-
return maxLength ? "".concat((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0, " / ").concat(maxLength) : undefined;
|
|
38
|
-
}, [maxLength, valueProp, valueState]);
|
|
39
|
-
var handleFocus = (0, react_1.useCallback)(function (e) {
|
|
40
|
-
var _a;
|
|
41
|
-
setFocused(true);
|
|
42
|
-
(_a = textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.onFocus) === null || _a === void 0 ? void 0 : _a.call(textareaProps, e);
|
|
43
|
-
}, [textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.onFocus]);
|
|
44
|
-
var handleBlur = (0, react_1.useCallback)(function (e) {
|
|
45
|
-
var _a;
|
|
46
|
-
setFocused(false);
|
|
47
|
-
(_a = textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.onBlur) === null || _a === void 0 ? void 0 : _a.call(textareaProps, e);
|
|
48
|
-
}, [textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.onBlur]);
|
|
49
|
-
var handleChange = (0, react_1.useCallback)(function (e) {
|
|
50
|
-
if (disabled)
|
|
51
|
-
return;
|
|
52
|
-
var value = e.target.value;
|
|
53
|
-
if (!isControlled || maxLength || expand === 'autoSize') {
|
|
54
|
-
setValueState(value);
|
|
55
|
-
}
|
|
56
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
57
|
-
}, [onChange, isControlled, disabled, maxLength, expand]);
|
|
58
|
-
return (react_1["default"].createElement("div", tslib_1.__assign({}, other, { className: (0, exports.cnTextarea)({
|
|
59
|
-
size: size,
|
|
60
|
-
required: required,
|
|
61
|
-
fullWidth: fullWidth,
|
|
62
|
-
error: error,
|
|
63
|
-
disabled: disabled,
|
|
64
|
-
hasLabel: !!label,
|
|
65
|
-
expand: expand,
|
|
66
|
-
focused: focused
|
|
18
|
+
var _a = props.size, size = _a === void 0 ? constants_1.TEXTAREA_DEFAULT_SIZE : _a, autoFocus = props.autoFocus, maxLength = props.maxLength, expand = props.expand, placeholder = props.placeholder, id = props.id, name = props.name, error = props.error, fullWidth = props.fullWidth, cols = props.cols, rows = props.rows, className = props.className, label = props.label, hint = props.hint, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, required = props.required, textareaRef = props.textareaRef, disabled = props.disabled, textareaProps = props.textareaProps, labelRef = props.labelRef, labelProps = props.labelProps, other = tslib_1.__rest(props, ["size", "autoFocus", "maxLength", "expand", "placeholder", "id", "name", "error", "fullWidth", "cols", "rows", "className", "label", "hint", "value", "defaultValue", "onChange", "required", "textareaRef", "disabled", "textareaProps", "labelRef", "labelProps"]);
|
|
19
|
+
return (react_1["default"].createElement(FieldControl_1.FieldControl, tslib_1.__assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { className: (0, exports.cnTextarea)({
|
|
20
|
+
expand: expand
|
|
67
21
|
}, [className]), ref: ref }),
|
|
68
|
-
react_1["default"].createElement(
|
|
69
|
-
label && (react_1["default"].createElement(FieldLabel_1.FieldLabel, tslib_1.__assign({ filled: filled, focused: focused, required: required, disabled: disabled, size: size }, labelProps, { className: (0, exports.cnTextarea)('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef }), label)),
|
|
70
|
-
react_1["default"].createElement("textarea", tslib_1.__assign({ id: id, name: name, cols: cols, rows: rows, disabled: disabled, value: valueProp, required: required, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder, autoFocus: autoFocus }, textareaProps, { className: (0, exports.cnTextarea)('Field', { filled: filled }, [
|
|
71
|
-
textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.className,
|
|
72
|
-
]), onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange, ref: (0, useMultiRef_1.useMultiRef)([textareaRef, fieldRef]) })),
|
|
73
|
-
react_1["default"].createElement("fieldset", { className: (0, exports.cnTextarea)('Fieldset') })),
|
|
74
|
-
(hint || maxLength) && (react_1["default"].createElement(FieldHint_1.FieldHint, { size: size, error: error, disabled: disabled },
|
|
75
|
-
hint,
|
|
76
|
-
maxLength && (react_1["default"].createElement("span", { className: (0, exports.cnTextarea)('Counter', { disabled: disabled }) }, counter))))));
|
|
22
|
+
react_1["default"].createElement(components_1.TextareaConsumer, { autoFocus: autoFocus, maxLength: maxLength, placeholder: placeholder, id: id, name: name, cols: cols, expand: expand, rows: rows, label: label, hint: hint, value: value, defaultValue: defaultValue, onChange: onChange, textareaRef: textareaRef, textareaProps: textareaProps, labelRef: labelRef, labelProps: labelProps })));
|
|
77
23
|
});
|
|
78
24
|
exports.Textarea.displayName = 'Textarea';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.TextareaConsumer = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
var useMultiRef_1 = require("../../../hooks/useMultiRef");
|
|
7
|
+
var FieldControl_1 = require("../../FieldControl");
|
|
8
|
+
var FieldHint_1 = require("../../FieldHint");
|
|
9
|
+
var FieldInput_1 = require("../../FieldInput");
|
|
10
|
+
var FieldLabel_1 = require("../../FieldLabel");
|
|
11
|
+
var Fieldset_1 = require("../../Fieldset");
|
|
12
|
+
var Textarea_1 = require("../../Textarea");
|
|
13
|
+
var index_1 = require("./index");
|
|
14
|
+
var TextareaConsumer = function (_a) {
|
|
15
|
+
var labelProps = _a.labelProps, labelRef = _a.labelRef, maxLength = _a.maxLength, label = _a.label, id = _a.id, name = _a.name, cols = _a.cols, rows = _a.rows, disabled = _a.disabled, valueProp = _a.value, required = _a.required, defaultValue = _a.defaultValue, placeholder = _a.placeholder, autoFocus = _a.autoFocus, textareaProps = _a.textareaProps, onChange = _a.onChange, textareaRef = _a.textareaRef, expand = _a.expand, hint = _a.hint;
|
|
16
|
+
var fieldRef = (0, react_1.useRef)(null);
|
|
17
|
+
var context = (0, react_1.useContext)(FieldControl_1.FieldControlContext);
|
|
18
|
+
var _b = tslib_1.__read(context, 1), value = _b[0].value;
|
|
19
|
+
// autoSize
|
|
20
|
+
(0, react_1.useEffect)(function () {
|
|
21
|
+
if (fieldRef.current && expand === 'autoSize') {
|
|
22
|
+
fieldRef.current.style.blockSize = '0px';
|
|
23
|
+
var scrollHeight = fieldRef.current.scrollHeight;
|
|
24
|
+
fieldRef.current.style.blockSize = "".concat(scrollHeight, "px");
|
|
25
|
+
}
|
|
26
|
+
}, [value]);
|
|
27
|
+
return (react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
28
|
+
react_1["default"].createElement("label", { className: (0, Textarea_1.cnTextarea)('Body') },
|
|
29
|
+
react_1["default"].createElement(FieldLabel_1.FieldLabel, tslib_1.__assign({}, labelProps, { className: (0, Textarea_1.cnTextarea)('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref) }), label),
|
|
30
|
+
react_1["default"].createElement(FieldInput_1.FieldInput, tslib_1.__assign({ as: "textarea", id: id, name: name, cols: cols, rows: rows, disabled: disabled, value: valueProp, required: required, defaultValue: defaultValue, maxLength: maxLength, placeholder: placeholder, autoFocus: autoFocus, onChange: onChange }, textareaProps, { className: (0, Textarea_1.cnTextarea)('Field', {}, [textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.className]), ref: (0, useMultiRef_1.useMultiRef)([textareaRef || (textareaProps === null || textareaProps === void 0 ? void 0 : textareaProps.ref), fieldRef]) })),
|
|
31
|
+
react_1["default"].createElement(Fieldset_1.Fieldset, null)),
|
|
32
|
+
react_1["default"].createElement(FieldHint_1.FieldHint, null,
|
|
33
|
+
hint,
|
|
34
|
+
maxLength && react_1["default"].createElement(index_1.TextareaCounter, { maxLength: maxLength }))));
|
|
35
|
+
};
|
|
36
|
+
exports.TextareaConsumer = TextareaConsumer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, FC } from 'react';
|
|
2
|
+
import type { TextareaProps } from '../index';
|
|
3
|
+
export type TextareaCounter = ComponentPropsWithRef<'span'> & {
|
|
4
|
+
maxLength: TextareaProps['maxLength'];
|
|
5
|
+
disabled?: TextareaProps['disabled'];
|
|
6
|
+
};
|
|
7
|
+
export declare const TextareaCounter: FC<TextareaCounter>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.TextareaCounter = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
var FieldControl_1 = require("../../FieldControl");
|
|
7
|
+
var index_1 = require("../index");
|
|
8
|
+
var TextareaCounter = function (_a) {
|
|
9
|
+
var _b, _c, _d;
|
|
10
|
+
var maxLength = _a.maxLength, disabledProp = _a.disabled;
|
|
11
|
+
var context = (0, react_1.useContext)(FieldControl_1.FieldControlContext);
|
|
12
|
+
var _e = tslib_1.__read(context, 1), fieldControl = _e[0];
|
|
13
|
+
var disabled = disabledProp;
|
|
14
|
+
// maxLength
|
|
15
|
+
var counter = maxLength
|
|
16
|
+
? "".concat((_d = (_c = (_b = fieldControl.value) === null || _b === void 0 ? void 0 : _b.toString()) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0, " / ").concat(maxLength)
|
|
17
|
+
: undefined;
|
|
18
|
+
if (fieldControl) {
|
|
19
|
+
if (disabled === undefined && fieldControl.disabled) {
|
|
20
|
+
disabled = fieldControl.disabled;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return react_1["default"].createElement("span", { className: (0, index_1.cnTextarea)('Counter', { disabled: disabled }) }, counter);
|
|
24
|
+
};
|
|
25
|
+
exports.TextareaCounter = TextareaCounter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TEXTAREA_DEFAULT_SIZE = "m";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Ref, ComponentPropsWithRef, ComponentRef } from 'react';
|
|
2
|
+
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
3
|
+
import type { FIELD_CONTROL_DEFAULT_TAG } from '../FieldControl';
|
|
4
|
+
import type { FieldLabelProps } from '../FieldLabel';
|
|
5
|
+
export type TextareaSizeVariant = FormElementSizeVariant;
|
|
6
|
+
export declare const textareaExpandVariant: readonly ["autoSize", "verticalResize"];
|
|
7
|
+
export type TextareaExpandVariant = (typeof textareaExpandVariant)[number];
|
|
8
|
+
type TextareaPropsDeprecated = {
|
|
9
|
+
/**
|
|
10
|
+
* deprecated
|
|
11
|
+
* Ссылка на FieldLabel
|
|
12
|
+
* */
|
|
13
|
+
labelRef?: FieldLabelProps['ref'];
|
|
14
|
+
/**
|
|
15
|
+
* deprecated
|
|
16
|
+
* Ссылка на элемент textarea
|
|
17
|
+
* */
|
|
18
|
+
textareaRef?: Ref<HTMLTextAreaElement>;
|
|
19
|
+
};
|
|
20
|
+
type TextareaElement = ComponentPropsWithRef<'textarea'>;
|
|
21
|
+
export type TextareaProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFAULT_TAG>, 'size' | 'onChange'> & {
|
|
22
|
+
/** Атрибут id для элемента input */
|
|
23
|
+
id?: string;
|
|
24
|
+
/** Атрибут name для элемента input */
|
|
25
|
+
name?: string;
|
|
26
|
+
/** Лейбл */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Размер компонента */
|
|
29
|
+
size?: TextareaSizeVariant;
|
|
30
|
+
/** Подсказка. Отображается, когда вариант не выбран */
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** Если {true} устанавливает автофокус */
|
|
33
|
+
autoFocus?: boolean;
|
|
34
|
+
/** Если {true} переводит поле в состояние ошибки */
|
|
35
|
+
error?: boolean;
|
|
36
|
+
/** Если {true} растягивает поле на всю ширину */
|
|
37
|
+
fullWidth?: boolean;
|
|
38
|
+
/** Дополнительное описание к полю */
|
|
39
|
+
hint?: string | null | undefined;
|
|
40
|
+
/** Если {true} делает элемент неактивным */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Если {true} делает элемент обязательным к заполнению */
|
|
43
|
+
required?: boolean;
|
|
44
|
+
/** Устанавливает максимальное число символов, которое может быть введено пользователем в текстовом поле. */
|
|
45
|
+
maxLength?: number;
|
|
46
|
+
/** Количество колонок */
|
|
47
|
+
cols?: number;
|
|
48
|
+
/** Количество строк */
|
|
49
|
+
rows?: number;
|
|
50
|
+
/** Расширяемость поля */
|
|
51
|
+
expand?: TextareaExpandVariant;
|
|
52
|
+
/** Выбранное значение */
|
|
53
|
+
value?: string;
|
|
54
|
+
/** Значение по умолчанию (неконтролируемый компонент) */
|
|
55
|
+
defaultValue?: string;
|
|
56
|
+
/** Обработчик события на изменение значения поля */
|
|
57
|
+
onChange?: TextareaElement['onChange'];
|
|
58
|
+
/** Свойства элемента textarea */
|
|
59
|
+
textareaProps?: TextareaElement & {
|
|
60
|
+
'data-testid'?: string;
|
|
61
|
+
};
|
|
62
|
+
/** Свойства FieldLabel */
|
|
63
|
+
labelProps?: FieldLabelProps;
|
|
64
|
+
/** Ссылка на корневой DOM-элемент компонента */
|
|
65
|
+
ref?: ComponentRef<typeof FIELD_CONTROL_DEFAULT_TAG>;
|
|
66
|
+
/** data-атрибут для тестирования */
|
|
67
|
+
'data-testid'?: string;
|
|
68
|
+
} & TextareaPropsDeprecated;
|
|
69
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './ThemeProvider.css';
|
|
2
|
-
import
|
|
2
|
+
import type { ComponentRef, ElementType } from 'react';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import { type PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
4
5
|
import type { Theme } from './types';
|
|
5
6
|
export declare const THEME_DEFAULT_TAG = "div";
|
|
@@ -12,6 +12,7 @@ import type { CollapseProps } from '../Collapse';
|
|
|
12
12
|
import type { ContainerProps } from '../Container';
|
|
13
13
|
import type { DataListProps } from '../DataList';
|
|
14
14
|
import type { DividerProps } from '../Divider';
|
|
15
|
+
import type { FieldControlProps } from '../FieldControl';
|
|
15
16
|
import type { FileProps } from '../File';
|
|
16
17
|
import type { FilePickerProps } from '../FilePicker';
|
|
17
18
|
import type { FormGroupProps } from '../FormGroup';
|
|
@@ -72,6 +73,7 @@ export type Theme = {
|
|
|
72
73
|
Container?: Partial<ContainerProps>;
|
|
73
74
|
DataList?: Partial<DataListProps>;
|
|
74
75
|
Divider?: Partial<DividerProps>;
|
|
76
|
+
FieldControl?: Partial<FieldControlProps>;
|
|
75
77
|
File?: Partial<FileProps>;
|
|
76
78
|
FilePicker?: Partial<FilePickerProps>;
|
|
77
79
|
FormGroup?: Partial<FormGroupProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref, ReactNode, ReactElement, ComponentPropsWithRef } from 'react';
|
|
2
2
|
import type { PopoverBaseProps } from '../Popover';
|
|
3
|
-
import { TOOLTIP_DEFAULT_TAG } from './constants';
|
|
3
|
+
import type { TOOLTIP_DEFAULT_TAG } from './constants';
|
|
4
4
|
export declare const tooltipSizeVariant: readonly ["xs", "s"];
|
|
5
5
|
export type TooltipSizeVariant = (typeof tooltipSizeVariant)[number];
|
|
6
6
|
export declare const tooltipVariant: readonly ["light", "dark"];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
type Ref<T> = React.Ref<T> | Dispatch<SetStateAction<T | undefined>> | null;
|
|
1
|
+
import type { Dispatch, SetStateAction, RefCallback, Ref as ReactRef } from 'react';
|
|
2
|
+
type Ref<T> = ReactRef<T> | Dispatch<SetStateAction<T | undefined>> | null;
|
|
4
3
|
/** Создает несколько ссылок (ref) на один DOM-элемент. */
|
|
5
4
|
export declare function useMultiRef<T>(refs: Array<Ref<T> | undefined>): RefCallback<T> | null;
|
|
6
5
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
2
2
|
import type { KeyCode } from '../types/KeyCode';
|
|
3
|
-
export declare const isKey: (event: KeyboardEvent |
|
|
3
|
+
export declare const isKey: (event: KeyboardEvent | ReactKeyboardEvent, key: KeyCode) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './Backdrop.css';
|
|
2
2
|
import type { CSSProperties, ElementType, ReactNode } from 'react';
|
|
3
|
-
import { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
4
|
-
import { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
3
|
+
import type { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
4
|
+
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
5
5
|
import { BACKDROP_DEFAULT_TAG } from './constants';
|
|
6
6
|
export type BackdropBaseProps = {
|
|
7
7
|
/** Признак по которому компонент будет представлен */
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { CSSTransition } from 'react-transition-group';
|
|
5
5
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
6
6
|
import { cn } from '../../utils/classname';
|
|
7
|
-
import { polymorphicComponentWithRef
|
|
7
|
+
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
8
8
|
import { BACKDROP_DEFAULT_TAG } from './constants';
|
|
9
9
|
export var cnBackdrop = cn('Backdrop');
|
|
10
10
|
export var Backdrop = polymorphicComponentWithRef(function (inProps, ref) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { HTMLAttributes, FC } from 'react';
|
|
2
2
|
import type { IconProps } from '@ozen-ui/icons';
|
|
3
3
|
export declare const breadcrumbsSizeVariant: readonly ["xs", "s"];
|
|
4
4
|
export type BreadcrumbsSizeVariant = (typeof breadcrumbsSizeVariant)[number];
|
|
5
|
-
export type BreadcrumbsSeparatorComponent =
|
|
5
|
+
export type BreadcrumbsSeparatorComponent = FC<IconProps>;
|
|
6
6
|
export type BreadcrumbsContextValue = {
|
|
7
7
|
/** Размер */
|
|
8
8
|
size: BreadcrumbsSizeVariant;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './DataList.css';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
|
-
import { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
4
|
+
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
5
5
|
import { type ListProps } from '../List';
|
|
6
6
|
import { type PopoverProps } from '../Popover';
|
|
7
7
|
export declare const cnDataList: import("@bem-react/classname").ClassNameFormatter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { SyntheticEvent, MouseEvent } from 'react';
|
|
2
2
|
import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
|
|
3
3
|
export type DataListSelectPayload = {
|
|
4
4
|
name?: string;
|
|
@@ -10,9 +10,9 @@ export type DataListContextState = {
|
|
|
10
10
|
selected?: string;
|
|
11
11
|
keyboardHighlight: boolean;
|
|
12
12
|
size: FormElementSizeVariant;
|
|
13
|
-
onSelect?: (event:
|
|
14
|
-
onMouseMove?: (event:
|
|
15
|
-
onMouseLeave?: (event:
|
|
13
|
+
onSelect?: (event: SyntheticEvent, option: string) => void;
|
|
14
|
+
onMouseMove?: (event: MouseEvent<HTMLLIElement>) => void;
|
|
15
|
+
onMouseLeave?: (event: MouseEvent<HTMLLIElement>) => void;
|
|
16
16
|
};
|
|
17
|
-
export declare const DataListContext:
|
|
17
|
+
export declare const DataListContext: import("react").Context<DataListContextState>;
|
|
18
18
|
export declare const useDataListContext: () => DataListContextState;
|