@alfalab/core-components-input-autocomplete 9.3.16 → 9.3.18

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.
Files changed (55) hide show
  1. package/Component-3885b0d7.d.ts +169 -0
  2. package/Component.mobile.d.ts +371 -2
  3. package/Component.mobile.js +1 -1
  4. package/Component.responsive.d.ts +1 -1
  5. package/autocomplete-field/Component.js +1 -1
  6. package/autocomplete-field/index.css +2 -2
  7. package/autocomplete-mobile-field/Component.js +1 -1
  8. package/autocomplete-mobile-field/index.css +8 -8
  9. package/cssm/Component-3885b0d7.d.ts +169 -0
  10. package/cssm/Component.mobile.d.ts +371 -2
  11. package/cssm/Component.responsive.d.ts +1 -1
  12. package/cssm/index-ebda875c.d.ts +56 -22
  13. package/cssm/types-ebda875c.d.ts +113 -0
  14. package/esm/Component-3885b0d7.d.ts +169 -0
  15. package/esm/Component.mobile.d.ts +371 -2
  16. package/esm/Component.mobile.js +1 -1
  17. package/esm/Component.responsive.d.ts +1 -1
  18. package/esm/autocomplete-field/Component.js +1 -1
  19. package/esm/autocomplete-field/index.css +2 -2
  20. package/esm/autocomplete-mobile-field/Component.js +1 -1
  21. package/esm/autocomplete-mobile-field/index.css +8 -8
  22. package/esm/index-ebda875c.d.ts +56 -22
  23. package/esm/mobile.css +4 -4
  24. package/esm/types-ebda875c.d.ts +113 -0
  25. package/index-ebda875c.d.ts +56 -22
  26. package/mobile.css +4 -4
  27. package/modern/Component-3885b0d7.d.ts +169 -0
  28. package/modern/Component.mobile.d.ts +371 -2
  29. package/modern/Component.mobile.js +1 -1
  30. package/modern/Component.responsive.d.ts +1 -1
  31. package/modern/autocomplete-field/Component.js +1 -1
  32. package/modern/autocomplete-field/index.css +2 -2
  33. package/modern/autocomplete-mobile-field/Component.js +1 -1
  34. package/modern/autocomplete-mobile-field/index.css +8 -8
  35. package/modern/index-ebda875c.d.ts +56 -22
  36. package/modern/mobile.css +4 -4
  37. package/modern/types-ebda875c.d.ts +113 -0
  38. package/package.json +2 -2
  39. package/types-ebda875c.d.ts +113 -0
  40. package/Component-7ca84eff.d.ts +0 -5
  41. package/cssm/Component-7ca84eff.d.ts +0 -5
  42. package/cssm/index-7ca84eff.d.ts +0 -215
  43. package/cssm/index-bdb4c6b9.d.ts +0 -207
  44. package/cssm/index-e81c389f.d.ts +0 -341
  45. package/esm/Component-7ca84eff.d.ts +0 -5
  46. package/esm/index-7ca84eff.d.ts +0 -215
  47. package/esm/index-bdb4c6b9.d.ts +0 -207
  48. package/esm/index-e81c389f.d.ts +0 -341
  49. package/index-7ca84eff.d.ts +0 -215
  50. package/index-bdb4c6b9.d.ts +0 -207
  51. package/index-e81c389f.d.ts +0 -341
  52. package/modern/Component-7ca84eff.d.ts +0 -5
  53. package/modern/index-7ca84eff.d.ts +0 -215
  54. package/modern/index-bdb4c6b9.d.ts +0 -207
  55. package/modern/index-e81c389f.d.ts +0 -341
@@ -1,207 +0,0 @@
1
- /// <reference types="react-transition-group" />
2
- /// <reference types="react" />
3
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
4
- import React from "react";
5
- import { FC, KeyboardEvent, MouseEvent, MutableRefObject, ReactNode, Ref, RefObject } from "react";
6
- import { TransitionProps } from "react-transition-group/Transition";
7
- import { BackdropProps } from "./index-ebda875c";
8
- type PortalProps = {
9
- /** Контент */
10
- children?: ReactNode;
11
- /**
12
- * Функция, возвращающая контейнер, в который будут рендериться дочерние элементы
13
- */
14
- getPortalContainer?: () => Element;
15
- /**
16
- * Немедленно отрендерить дочерние элементы (false - контент будет отрендерен на след. рендер).
17
- */
18
- immediateMount?: boolean;
19
- };
20
- type BaseModalProps = {
21
- /**
22
- * Контент
23
- */
24
- children?: ReactNode;
25
- /**
26
- * Компонент бэкдропа
27
- */
28
- Backdrop?: FC<BackdropProps>;
29
- /**
30
- * Свойства для Бэкдропа
31
- */
32
- backdropProps?: Partial<BackdropProps> & Record<string, unknown>;
33
- /**
34
- * Нода, компонент или функция возвращающая их
35
- *
36
- * Контейнер к которому будут добавляться порталы
37
- */
38
- container?: PortalProps["getPortalContainer"];
39
- /**
40
- * Отключает автоматический перевод фокуса на модалку при открытии
41
- * @default false
42
- */
43
- disableAutoFocus?: boolean;
44
- /**
45
- * Отключает ловушку фокуса
46
- * @default false
47
- */
48
- disableFocusLock?: boolean;
49
- /**
50
- * Отключает восстановление фокуса на предыдущем элементе после закрытия модалки
51
- * @default false
52
- */
53
- disableRestoreFocus?: boolean;
54
- /**
55
- * Отключает вызов `callback` при нажатии Escape
56
- * @default false
57
- */
58
- disableEscapeKeyDown?: boolean;
59
- /**
60
- * Отключает вызов `callback` при клике на бэкдроп
61
- * @default false
62
- */
63
- disableBackdropClick?: boolean;
64
- /**
65
- * Отключает блокировку скролла при открытии модального окна
66
- * @default false
67
- */
68
- disableBlockingScroll?: boolean;
69
- /**
70
- * Содержимое модалки всегда в DOM
71
- * @default false
72
- */
73
- keepMounted?: boolean;
74
- /**
75
- * Управление видимостью модалки
76
- */
77
- open: boolean;
78
- /**
79
- * Дополнительный класс
80
- */
81
- className?: string;
82
- /**
83
- * Дополнительный класс
84
- */
85
- contentClassName?: string;
86
- /**
87
- * Дополнительный класс для обертки (Modal)
88
- */
89
- wrapperClassName?: string;
90
- /**
91
- * Обработчик скролла контента
92
- */
93
- scrollHandler?: "wrapper" | "content" | MutableRefObject<HTMLDivElement | null>;
94
- /**
95
- * Пропсы для анимации (CSSTransition)
96
- */
97
- transitionProps?: Partial<TransitionProps>;
98
- /**
99
- * Обработчик события нажатия на бэкдроп
100
- */
101
- onBackdropClick?: (event: MouseEvent) => void;
102
- /**
103
- * Обработчик события нажатия на Escape
104
- *
105
- * Если `disableEscapeKeyDown` - false и модальное окно в фокусе
106
- */
107
- onEscapeKeyDown?: (event: KeyboardEvent) => void;
108
- /**
109
- * Обработчик закрытия
110
- */
111
- onClose?: (event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
112
- /**
113
- * Обработчик события onEntered компонента Transition
114
- */
115
- onMount?: () => void;
116
- /**
117
- * Обработчик события onExited компонента Transition
118
- */
119
- onUnmount?: () => void;
120
- /**
121
- * Идентификатор для систем автоматизированного тестирования
122
- */
123
- dataTestId?: string;
124
- /**
125
- * z-index компонента
126
- */
127
- zIndex?: number;
128
- /**
129
- * Реф, который должен быть установлен компонентной области
130
- */
131
- componentRef?: MutableRefObject<HTMLDivElement | null>;
132
- };
133
- type BaseModalContext = {
134
- parentRef: React.RefObject<HTMLDivElement>;
135
- componentRef: React.RefObject<HTMLDivElement>;
136
- hasFooter?: boolean;
137
- hasHeader?: boolean;
138
- hasScroll?: boolean;
139
- headerHighlighted?: boolean;
140
- footerHighlighted?: boolean;
141
- headerOffset?: number;
142
- setHeaderOffset: (offset: number) => void;
143
- contentRef: Ref<HTMLElement>;
144
- setHasHeader: (exists: boolean) => void;
145
- setHasFooter: (exists: boolean) => void;
146
- onClose: Required<BaseModalProps>["onClose"];
147
- };
148
- // eslint-disable-next-line @typescript-eslint/no-redeclare
149
- declare const BaseModalContext: React.Context<BaseModalContext>;
150
- declare const BaseModal: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
151
- declare function isScrolledToTop(target: HTMLElement): boolean;
152
- declare function isScrolledToBottom(target: HTMLElement): boolean;
153
- declare function hasScrollbar(target: HTMLElement): boolean;
154
- declare const getScrollbarSize: () => number;
155
- declare const restoreContainerStyles: (container: HTMLElement) => void;
156
- declare const handleContainer: (container?: HTMLElement) => void;
157
- /**
158
- * Набор констант для z-index соответствующих классов компонентов.
159
- * Значения выбраны по приоритету.
160
- */
161
- declare const stackingOrder: {
162
- FOCUSED: number;
163
- DEFAULT: number;
164
- POPOVER: number;
165
- MODAL: number;
166
- TOAST: number;
167
- };
168
- declare const StackingContext: import("react").Context<number>;
169
- type StackProps = {
170
- /**
171
- * Render prop, в который передается функция.
172
- * Функция принимает аргумент со значением z-index из текущего контекста.
173
- */
174
- children: (value: number) => ReactNode;
175
- /**
176
- * Исходное значение для z-index.
177
- * @default 5
178
- */
179
- value?: number;
180
- };
181
- declare const Stack: FC<StackProps>;
182
- declare const PORTAL_CONTAINER_ATTRIBUTE = "alfa-portal-container";
183
- declare const getDefaultPortalContainer: () => Element;
184
- declare function setRef<T>(ref: RefObject<T> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
185
- type SavedStyle = {
186
- value: string;
187
- key: string;
188
- el: HTMLElement;
189
- };
190
- type RestoreStyle = {
191
- container: HTMLElement;
192
- modals: number;
193
- styles: SavedStyle[];
194
- };
195
- declare class ModalStore {
196
- private readonly restoreStyles;
197
- constructor();
198
- getRestoreStyles: () => RestoreStyle[];
199
- }
200
- declare const getModalStore: () => ModalStore;
201
- declare class GlobalStore {
202
- private readonly modalStore;
203
- constructor();
204
- getModalStore: () => ModalStore;
205
- }
206
- export { BaseModalProps, BaseModalContext, BaseModal, isScrolledToTop, isScrolledToBottom, hasScrollbar, getScrollbarSize, restoreContainerStyles, handleContainer, stackingOrder, StackingContext, StackProps, Stack, PORTAL_CONTAINER_ATTRIBUTE, getDefaultPortalContainer, setRef, getModalStore, GlobalStore };
207
- export type { SavedStyle };
@@ -1,341 +0,0 @@
1
- /// <reference types="react" />
2
- /* eslint-disable complexity */
3
- import React from "react";
4
- import { FC, ReactNode, ButtonHTMLAttributes, ElementType, ForwardRefExoticComponent, RefAttributes, HTMLAttributes, AnchorHTMLAttributes } from "react";
5
- import { ButtonProps } from "@alfalab/core-components-button";
6
- interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
- /**
8
- * Вид компонента
9
- */
10
- view: "desktop" | "mobile";
11
- /**
12
- * Дополнительный класс
13
- */
14
- className?: string;
15
- /**
16
- * Позиция крестика
17
- */
18
- align?: "left" | "right";
19
- /**
20
- * Фиксирует крестик
21
- */
22
- sticky?: boolean;
23
- /**
24
- * Иконка
25
- */
26
- icon?: ElementType;
27
- /**
28
- * Идентификатор для систем автоматизированного тестирования
29
- */
30
- dataTestId?: string;
31
- /**
32
- * Коллбэк закрытия.
33
- */
34
- onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
35
- }
36
- declare const Closer: FC<CloserProps>;
37
- type NavigationBarProps = {
38
- /**
39
- * Контент шапки
40
- */
41
- children?: ReactNode;
42
- /**
43
- * Заголовок шапки
44
- */
45
- title?: string;
46
- /**
47
- * Подзаголовок (доступен только в мобильной версии)
48
- */
49
- subtitle?: string;
50
- /**
51
- * Размер заголовка (compact доступен только в мобильной версии)
52
- */
53
- titleSize?: "default" | "compact";
54
- /**
55
- * Доп. класс для аддонов
56
- */
57
- addonClassName?: string;
58
- /**
59
- * Слот слева
60
- */
61
- leftAddons?: ReactNode;
62
- /**
63
- * Слот справа
64
- */
65
- rightAddons?: ReactNode;
66
- /**
67
- * Дополнительный класс для closer
68
- */
69
- closerClassName?: string;
70
- /**
71
- * Слот снизу
72
- */
73
- bottomAddons?: ReactNode;
74
- /**
75
- * Наличие компонента крестика
76
- */
77
- hasCloser?: boolean;
78
- /**
79
- * Наличие кнопки "Назад"
80
- */
81
- hasBackButton?: boolean;
82
- /**
83
- * Дополнительный класс для правого аддона
84
- */
85
- backButtonClassName?: string;
86
- /**
87
- * Дополнительный класс
88
- */
89
- className?: string;
90
- /**
91
- * Дополнительный класс для контента
92
- */
93
- contentClassName?: string;
94
- /**
95
- * Дополнительный класс для нижнего аддона
96
- */
97
- bottomAddonsClassName?: string;
98
- /**
99
- * Выравнивание заголовка
100
- */
101
- align?: "left" | "center";
102
- /**
103
- * Обрезать ли заголовок
104
- */
105
- trim?: boolean;
106
- /**
107
- * Фиксирует шапку
108
- */
109
- sticky?: boolean;
110
- /**
111
- * Идентификатор для систем автоматизированного тестирования
112
- */
113
- dataTestId?: string;
114
- /**
115
- * Фоновое изображение
116
- */
117
- imageUrl?: string;
118
- /**
119
- * Иконка closer.
120
- */
121
- closerIcon?: React.ElementType;
122
- /**
123
- * Обработчик закрытия
124
- */
125
- onClose?: CloserProps["onClose"];
126
- /**
127
- * обработчик клика по кнопке "назад"
128
- */
129
- onBack?: () => void;
130
- /**
131
- * Вид шапки - мобильный или десктоп
132
- */
133
- view: "desktop" | "mobile";
134
- /**
135
- * Ссылка на родительскую ноду overflow: auto
136
- */
137
- scrollableParentRef?: React.RefObject<HTMLDivElement>;
138
- };
139
- declare const NavigationBar: FC<NavigationBarProps>;
140
- interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
141
- /**
142
- * Текст после иконки
143
- */
144
- text?: string;
145
- /**
146
- * Дополнительный класс
147
- */
148
- className?: string;
149
- /**
150
- * Вид компонента
151
- */
152
- view: "mobile" | "desktop";
153
- /**
154
- * Прозрачность текста
155
- */
156
- textOpacity?: number;
157
- /**
158
- * Обработчик клика
159
- */
160
- onClick?: () => void;
161
- }
162
- declare const BackArrowAddon: React.FC<BackArrowAddonProps>;
163
- declare const colors: readonly [
164
- "tertiary",
165
- "disabled",
166
- "accent",
167
- "primary",
168
- "attention",
169
- "positive",
170
- "secondary",
171
- "tertiary-inverted",
172
- "primary-inverted",
173
- "secondary-inverted",
174
- "link",
175
- "negative",
176
- "static-primary-light",
177
- "static-secondary-light",
178
- "static-tertiary-light",
179
- "static-primary-dark",
180
- "static-secondary-dark",
181
- "static-tertiary-dark",
182
- "static-accent"
183
- ];
184
- type Color = (typeof colors)[number];
185
- type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
186
- type NativeProps = HTMLAttributes<HTMLSpanElement>;
187
- type TextBaseProps = {
188
- /**
189
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
190
- */
191
- view?: "primary-large" | "primary-medium" | "primary-small" | "secondary-large" | "secondary-medium" | "secondary-small" | "component" | "caps";
192
- /**
193
- * Цвет текста
194
- */
195
- color?: Color;
196
- /**
197
- * Толщина шрифта
198
- */
199
- weight?: "regular" | "medium" | "bold";
200
- /**
201
- * Делает цифры моноширинными
202
- */
203
- monospaceNumbers?: boolean;
204
- /**
205
- * HTML тег
206
- */
207
- tag?: "span" | "div";
208
- /**
209
- * Css-класс для стилизации (native prop)
210
- */
211
- className?: string;
212
- /**
213
- * Id компонента для тестов
214
- */
215
- dataTestId?: string;
216
- /**
217
- * Контент (native prop)
218
- */
219
- children?: React.ReactNode;
220
- /**
221
- * Добавляет отступы к тэгу 'p'
222
- */
223
- defaultMargins?: never;
224
- /**
225
- * Количество строк (не поддерживает IE)
226
- */
227
- rowLimit?: 1 | 2 | 3;
228
- };
229
- type TextPTagProps = Omit<TextBaseProps, "tag" | "defaultMargins"> & {
230
- tag?: "p";
231
- defaultMargins?: boolean;
232
- };
233
- type TextProps = Omit<NativeProps, "color"> & (TextBaseProps | TextPTagProps);
234
- type NativeProps$0 = HTMLAttributes<HTMLHeadingElement>;
235
- type TitleProps = Omit<NativeProps$0, "color"> & {
236
- /**
237
- * HTML тег
238
- */
239
- tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
240
- /**
241
- * [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
242
- */
243
- view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
244
- /**
245
- * Цвет текста
246
- */
247
- color?: Color;
248
- /**
249
- * Толщина шрифта
250
- */
251
- weight?: "regular" | "medium" | "bold";
252
- /**
253
- * Шрифт текста
254
- */
255
- font?: "styrene" | "system";
256
- /**
257
- * Добавляет отступы
258
- */
259
- defaultMargins?: boolean;
260
- /**
261
- * Css-класс для стилизации (native prop)
262
- */
263
- className?: string;
264
- /**
265
- * Id компонента для тестов
266
- */
267
- dataTestId?: string;
268
- /**
269
- * Контент (native prop)
270
- */
271
- children?: React.ReactNode;
272
- /**
273
- * Количество строк (не поддерживает IE)
274
- */
275
- rowLimit?: 1 | 2 | 3;
276
- };
277
- type TitleMobileProps = Omit<TitleProps, "defaultMargins">;
278
- declare const Typography: {
279
- Title: FC<TitleProps>;
280
- Text: ForwardRefExoticComponent<TextProps & RefAttributes<TextElementType>>;
281
- TitleResponsive: FC<TitleProps>;
282
- TitleMobile: FC<TitleMobileProps>;
283
- };
284
- declare const typographyPresets: {
285
- mobile: {
286
- list: {
287
- text: {
288
- primary: {
289
- tag: string;
290
- view: string;
291
- };
292
- secondary: {
293
- tag: string;
294
- color: string;
295
- view: string;
296
- };
297
- };
298
- };
299
- };
300
- };
301
- declare const TitleResponsive: FC<TitleProps>;
302
- type IconButtonProps = {
303
- /**
304
- * Компонент иконки
305
- */
306
- icon: ElementType<{
307
- className?: string;
308
- }>;
309
- /**
310
- * Тип кнопки
311
- */
312
- view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
313
- /**
314
- * Размер компонента
315
- */
316
- size?: "xxs" | "xs" | "s";
317
- /**
318
- * Дополнительный класс
319
- */
320
- className?: string;
321
- /**
322
- * Идентификатор для систем автоматизированного тестирования
323
- */
324
- dataTestId?: string;
325
- /**
326
- * Набор цветов для компонента
327
- */
328
- colors?: "default" | "inverted";
329
- } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
330
- declare const IconButton: React.ForwardRefExoticComponent<{
331
- icon: ElementType<{
332
- className?: string;
333
- }>;
334
- view?: "negative" | "tertiary" | "secondary" | "primary" | "transparent" | undefined;
335
- size?: "s" | "xs" | "xxs" | undefined;
336
- className?: string | undefined;
337
- dataTestId?: string | undefined;
338
- colors?: "default" | "inverted" | undefined;
339
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
340
- export { NavigationBar, BackArrowAddonProps, BackArrowAddon, Typography, typographyPresets, TitleResponsive, IconButtonProps, IconButton, CloserProps, Closer };
341
- export type { TitleProps, TextProps, Color, NavigationBarProps };