@alfalab/core-components-select 13.2.12 → 13.2.13
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/{modern/Component-01c0d01a.d.ts → Component-088caba2.d.ts} +285 -51
- package/{Component-989a84db.js → Component-088caba2.js} +4 -4
- package/{Component-4af19284.d.ts → Component-ca307b80.d.ts} +0 -0
- package/{Component-4af19284.js → Component-ca307b80.js} +1 -1
- package/Component.js +1 -1
- package/Component.responsive.js +3 -3
- package/components/arrow/Component.js +1 -1
- package/components/arrow/index.css +3 -3
- package/components/base-checkmark/Component.js +1 -1
- package/components/base-checkmark/index.css +4 -4
- package/components/base-option/Component.js +1 -1
- package/components/base-option/index.css +13 -13
- package/components/base-select/Component.js +1 -1
- package/components/base-select/index.css +7 -7
- package/components/base-select/index.d.ts +1 -1
- package/components/base-select/index.js +1 -1
- package/components/base-select-mobile/Component.js +3 -3
- package/components/base-select-mobile/checkmark/Component.js +1 -1
- package/components/base-select-mobile/checkmark/index.css +6 -6
- package/components/base-select-mobile/index.css +11 -11
- package/components/base-select-mobile/index.d.ts +1 -1
- package/components/base-select-mobile/index.js +3 -3
- package/components/base-select-mobile/options-list/Component.js +1 -1
- package/components/base-select-mobile/options-list/index.css +9 -9
- package/components/base-select-mobile/virtual-options-list/Component.js +1 -1
- package/components/base-select-mobile/virtual-options-list/index.css +15 -15
- package/components/checkmark/Component.js +1 -1
- package/components/checkmark/index.css +10 -10
- package/components/field/Component.js +1 -1
- package/components/field/index.css +9 -9
- package/components/index.js +3 -3
- package/components/optgroup/Component.js +1 -1
- package/components/optgroup/index.css +6 -6
- package/components/option/Component.js +1 -1
- package/components/option/index.css +20 -20
- package/components/options-list/Component.js +1 -1
- package/components/options-list/index.css +6 -6
- package/components/select-mobile/Component.js +3 -3
- package/components/select-mobile/index.d.ts +1 -1
- package/components/select-mobile/index.js +3 -3
- package/components/select-modal-mobile/Component.js +3 -3
- package/components/select-modal-mobile/index.d.ts +1 -1
- package/components/select-modal-mobile/index.js +3 -3
- package/components/virtual-options-list/Component.js +1 -1
- package/components/virtual-options-list/index.css +12 -12
- package/cssm/Component-8f0723b4.d.ts +285 -51
- package/{Component-989a84db.d.ts → esm/Component-23df669b.d.ts} +285 -51
- package/esm/{Component-b674590a.js → Component-23df669b.js} +4 -4
- package/esm/{Component-a733e47f.d.ts → Component-82c9c6a4.d.ts} +0 -0
- package/esm/{Component-a733e47f.js → Component-82c9c6a4.js} +1 -1
- package/esm/Component.js +1 -1
- package/esm/Component.responsive.js +3 -3
- package/esm/components/arrow/Component.js +1 -1
- package/esm/components/arrow/index.css +3 -3
- package/esm/components/base-checkmark/Component.js +1 -1
- package/esm/components/base-checkmark/index.css +4 -4
- package/esm/components/base-option/Component.js +1 -1
- package/esm/components/base-option/index.css +13 -13
- package/esm/components/base-select/Component.js +1 -1
- package/esm/components/base-select/index.css +7 -7
- package/esm/components/base-select/index.d.ts +1 -1
- package/esm/components/base-select/index.js +1 -1
- package/esm/components/base-select-mobile/Component.js +3 -3
- package/esm/components/base-select-mobile/checkmark/Component.js +1 -1
- package/esm/components/base-select-mobile/checkmark/index.css +6 -6
- package/esm/components/base-select-mobile/index.css +11 -11
- package/esm/components/base-select-mobile/index.d.ts +1 -1
- package/esm/components/base-select-mobile/index.js +3 -3
- package/esm/components/base-select-mobile/options-list/Component.js +1 -1
- package/esm/components/base-select-mobile/options-list/index.css +9 -9
- package/esm/components/base-select-mobile/virtual-options-list/Component.js +1 -1
- package/esm/components/base-select-mobile/virtual-options-list/index.css +15 -15
- package/esm/components/checkmark/Component.js +1 -1
- package/esm/components/checkmark/index.css +10 -10
- package/esm/components/field/Component.js +1 -1
- package/esm/components/field/index.css +9 -9
- package/esm/components/index.js +3 -3
- package/esm/components/optgroup/Component.js +1 -1
- package/esm/components/optgroup/index.css +6 -6
- package/esm/components/option/Component.js +1 -1
- package/esm/components/option/index.css +20 -20
- package/esm/components/options-list/Component.js +1 -1
- package/esm/components/options-list/index.css +6 -6
- package/esm/components/select-mobile/Component.js +3 -3
- package/esm/components/select-mobile/index.d.ts +1 -1
- package/esm/components/select-mobile/index.js +3 -3
- package/esm/components/select-modal-mobile/Component.js +3 -3
- package/esm/components/select-modal-mobile/index.d.ts +1 -1
- package/esm/components/select-modal-mobile/index.js +3 -3
- package/esm/components/virtual-options-list/Component.js +1 -1
- package/esm/components/virtual-options-list/index.css +12 -12
- package/esm/index.js +3 -3
- package/esm/{intersection-observer-de8255b2.d.ts → intersection-observer-12c920c6.d.ts} +0 -0
- package/esm/{intersection-observer-de8255b2.js → intersection-observer-12c920c6.js} +0 -0
- package/esm/presets/index.js +3 -3
- package/esm/presets/useLazyLoading/hook.js +2 -2
- package/esm/presets/useLazyLoading/index.css +2 -2
- package/esm/presets/useSelectWithApply/hook.js +3 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -3
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/esm/presets/useSelectWithApply/options-list-with-apply/index.js +3 -3
- package/esm/presets/useSelectWithLoading/hook.js +1 -1
- package/esm/presets/useSelectWithLoading/index.css +2 -2
- package/esm/responsive.js +3 -3
- package/index.js +3 -3
- package/{intersection-observer-230e176d.d.ts → intersection-observer-31caed5c.d.ts} +0 -0
- package/{intersection-observer-230e176d.js → intersection-observer-31caed5c.js} +0 -0
- package/{esm/Component-b674590a.d.ts → modern/Component-629f202b.d.ts} +285 -51
- package/modern/{Component-01c0d01a.js → Component-629f202b.js} +4 -4
- package/modern/{Component-228a3435.d.ts → Component-c2743e76.d.ts} +0 -0
- package/modern/{Component-228a3435.js → Component-c2743e76.js} +1 -1
- package/modern/Component.js +1 -1
- package/modern/Component.responsive.js +3 -3
- package/modern/components/arrow/Component.js +1 -1
- package/modern/components/arrow/index.css +3 -3
- package/modern/components/base-checkmark/Component.js +1 -1
- package/modern/components/base-checkmark/index.css +4 -4
- package/modern/components/base-option/Component.js +1 -1
- package/modern/components/base-option/index.css +13 -13
- package/modern/components/base-select/Component.js +1 -1
- package/modern/components/base-select/index.css +7 -7
- package/modern/components/base-select/index.d.ts +1 -1
- package/modern/components/base-select/index.js +1 -1
- package/modern/components/base-select-mobile/Component.js +3 -3
- package/modern/components/base-select-mobile/checkmark/Component.js +1 -1
- package/modern/components/base-select-mobile/checkmark/index.css +6 -6
- package/modern/components/base-select-mobile/index.css +11 -11
- package/modern/components/base-select-mobile/index.d.ts +1 -1
- package/modern/components/base-select-mobile/index.js +3 -3
- package/modern/components/base-select-mobile/options-list/Component.js +1 -1
- package/modern/components/base-select-mobile/options-list/index.css +9 -9
- package/modern/components/base-select-mobile/virtual-options-list/Component.js +1 -1
- package/modern/components/base-select-mobile/virtual-options-list/index.css +15 -15
- package/modern/components/checkmark/Component.js +1 -1
- package/modern/components/checkmark/index.css +10 -10
- package/modern/components/field/Component.js +1 -1
- package/modern/components/field/index.css +9 -9
- package/modern/components/index.js +3 -3
- package/modern/components/optgroup/Component.js +1 -1
- package/modern/components/optgroup/index.css +6 -6
- package/modern/components/option/Component.js +1 -1
- package/modern/components/option/index.css +20 -20
- package/modern/components/options-list/Component.js +1 -1
- package/modern/components/options-list/index.css +6 -6
- package/modern/components/select-mobile/Component.js +3 -3
- package/modern/components/select-mobile/index.d.ts +1 -1
- package/modern/components/select-mobile/index.js +3 -3
- package/modern/components/select-modal-mobile/Component.js +3 -3
- package/modern/components/select-modal-mobile/index.d.ts +1 -1
- package/modern/components/select-modal-mobile/index.js +3 -3
- package/modern/components/virtual-options-list/Component.js +1 -1
- package/modern/components/virtual-options-list/index.css +12 -12
- package/modern/index.js +3 -3
- package/modern/{intersection-observer-de8255b2.d.ts → intersection-observer-12c920c6.d.ts} +0 -0
- package/modern/{intersection-observer-de8255b2.js → intersection-observer-12c920c6.js} +0 -0
- package/modern/presets/index.js +3 -3
- package/modern/presets/useLazyLoading/hook.js +2 -2
- package/modern/presets/useLazyLoading/index.css +2 -2
- package/modern/presets/useSelectWithApply/hook.js +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -3
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/modern/presets/useSelectWithApply/options-list-with-apply/index.js +3 -3
- package/modern/presets/useSelectWithLoading/hook.js +1 -1
- package/modern/presets/useSelectWithLoading/index.css +2 -2
- package/modern/responsive.js +3 -3
- package/package.json +4 -4
- package/presets/index.js +3 -3
- package/presets/useLazyLoading/hook.js +2 -2
- package/presets/useLazyLoading/index.css +2 -2
- package/presets/useSelectWithApply/hook.js +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/Component.js +3 -3
- package/presets/useSelectWithApply/options-list-with-apply/index.css +4 -4
- package/presets/useSelectWithApply/options-list-with-apply/index.d.ts +1 -1
- package/presets/useSelectWithApply/options-list-with-apply/index.js +3 -3
- package/presets/useSelectWithLoading/hook.js +1 -1
- package/presets/useSelectWithLoading/index.css +2 -2
- package/responsive.js +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { ReactNode, FC, ButtonHTMLAttributes, ElementType, AnchorHTMLAttributes } from "react";
|
|
3
|
+
import { ReactNode, FC, ButtonHTMLAttributes, ElementType, ForwardRefExoticComponent, RefAttributes, HTMLAttributes, AnchorHTMLAttributes } from "react";
|
|
4
4
|
import { BottomSheetProps } from "@alfalab/core-components-bottom-sheet";
|
|
5
5
|
import { BaseSelectProps, OptionShape, OptionsListProps } from "./typings";
|
|
6
6
|
import { BaseModalProps, BaseModalContext } from "@alfalab/core-components-base-modal";
|
|
@@ -97,35 +97,97 @@ type ContentProps = {
|
|
|
97
97
|
*/
|
|
98
98
|
flex?: boolean;
|
|
99
99
|
};
|
|
100
|
-
|
|
100
|
+
interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
101
|
+
/**
|
|
102
|
+
* Вид компонента
|
|
103
|
+
*/
|
|
104
|
+
view: "desktop" | "mobile";
|
|
105
|
+
/**
|
|
106
|
+
* Дополнительный класс
|
|
107
|
+
*/
|
|
108
|
+
className?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Позиция крестика
|
|
111
|
+
*/
|
|
112
|
+
align?: "left" | "right";
|
|
113
|
+
/**
|
|
114
|
+
* Фиксирует крестик
|
|
115
|
+
*/
|
|
116
|
+
sticky?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Иконка
|
|
119
|
+
*/
|
|
120
|
+
icon?: ElementType;
|
|
121
|
+
/**
|
|
122
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
123
|
+
*/
|
|
124
|
+
dataTestId?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Коллбэк закрытия.
|
|
127
|
+
*/
|
|
128
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
129
|
+
}
|
|
130
|
+
type NavigationBarProps = {
|
|
101
131
|
/**
|
|
102
132
|
* Контент шапки
|
|
103
133
|
*/
|
|
104
134
|
children?: ReactNode;
|
|
135
|
+
/**
|
|
136
|
+
* Заголовок шапки
|
|
137
|
+
*/
|
|
138
|
+
title?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Подзаголовок (доступен только в мобильной версии)
|
|
141
|
+
*/
|
|
142
|
+
subtitle?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Размер заголовка (compact доступен только в мобильной версии)
|
|
145
|
+
*/
|
|
146
|
+
titleSize?: "default" | "compact";
|
|
147
|
+
/**
|
|
148
|
+
* Доп. класс для аддонов
|
|
149
|
+
*/
|
|
150
|
+
addonClassName?: string;
|
|
105
151
|
/**
|
|
106
152
|
* Слот слева
|
|
107
153
|
*/
|
|
108
154
|
leftAddons?: ReactNode;
|
|
155
|
+
/**
|
|
156
|
+
* Слот справа
|
|
157
|
+
*/
|
|
158
|
+
rightAddons?: ReactNode;
|
|
159
|
+
/**
|
|
160
|
+
* Дополнительный класс для closer
|
|
161
|
+
*/
|
|
162
|
+
closerClassName?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Слот снизу
|
|
165
|
+
*/
|
|
166
|
+
bottomAddons?: ReactNode;
|
|
109
167
|
/**
|
|
110
168
|
* Наличие компонента крестика
|
|
111
169
|
*/
|
|
112
|
-
hasCloser?:
|
|
170
|
+
hasCloser?: boolean;
|
|
113
171
|
/**
|
|
114
|
-
*
|
|
172
|
+
* Наличие кнопки "Назад"
|
|
115
173
|
*/
|
|
116
|
-
|
|
174
|
+
hasBackButton?: boolean;
|
|
117
175
|
/**
|
|
118
|
-
* Дополнительный класс для
|
|
176
|
+
* Дополнительный класс для правого аддона
|
|
119
177
|
*/
|
|
120
|
-
|
|
178
|
+
backButtonClassName?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Дополнительный класс
|
|
181
|
+
*/
|
|
182
|
+
className?: string;
|
|
121
183
|
/**
|
|
122
184
|
* Дополнительный класс для контента
|
|
123
185
|
*/
|
|
124
186
|
contentClassName?: string;
|
|
125
187
|
/**
|
|
126
|
-
*
|
|
188
|
+
* Дополнительный класс для нижнего аддона
|
|
127
189
|
*/
|
|
128
|
-
|
|
190
|
+
bottomAddonsClassName?: string;
|
|
129
191
|
/**
|
|
130
192
|
* Выравнивание заголовка
|
|
131
193
|
*/
|
|
@@ -142,7 +204,32 @@ type HeaderProps = {
|
|
|
142
204
|
* Идентификатор для систем автоматизированного тестирования
|
|
143
205
|
*/
|
|
144
206
|
dataTestId?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Фоновое изображение
|
|
209
|
+
*/
|
|
210
|
+
imageUrl?: string;
|
|
211
|
+
/**
|
|
212
|
+
* Иконка closer.
|
|
213
|
+
*/
|
|
214
|
+
closerIcon?: React.ElementType;
|
|
215
|
+
/**
|
|
216
|
+
* Обработчик закрытия
|
|
217
|
+
*/
|
|
218
|
+
onClose?: CloserProps["onClose"];
|
|
219
|
+
/**
|
|
220
|
+
* обработчик клика по кнопке "назад"
|
|
221
|
+
*/
|
|
222
|
+
onBack?: () => void;
|
|
223
|
+
/**
|
|
224
|
+
* Вид шапки - мобильный или десктоп
|
|
225
|
+
*/
|
|
226
|
+
view: "desktop" | "mobile";
|
|
227
|
+
/**
|
|
228
|
+
* Ссылка на родительскую ноду.
|
|
229
|
+
*/
|
|
230
|
+
parentRef?: React.RefObject<HTMLDivElement>;
|
|
145
231
|
};
|
|
232
|
+
type HeaderProps = Omit<NavigationBarProps, "size" | "view" | "parentRef">;
|
|
146
233
|
type FooterProps = {
|
|
147
234
|
/**
|
|
148
235
|
* Контент футера
|
|
@@ -165,77 +252,224 @@ type FooterProps = {
|
|
|
165
252
|
*/
|
|
166
253
|
gap?: 16 | 24 | 32;
|
|
167
254
|
};
|
|
168
|
-
|
|
255
|
+
declare const ModalMobile: React.ForwardRefExoticComponent<ModalMobileProps & React.RefAttributes<HTMLDivElement>> & {
|
|
256
|
+
Content: React.FC<ContentProps>;
|
|
257
|
+
Header: React.FC<HeaderProps>;
|
|
258
|
+
Footer: React.FC<FooterProps>;
|
|
259
|
+
Closer: React.FC<CloserProps>;
|
|
260
|
+
};
|
|
261
|
+
declare const Content: FC<ContentProps>;
|
|
262
|
+
declare const Modal: React.ForwardRefExoticComponent<import("@alfalab/core-components-base-modal").BaseModalProps & {
|
|
263
|
+
size?: "s" | "m" | "l" | "xl" | "fullscreen" | undefined;
|
|
264
|
+
fullscreen?: boolean | undefined;
|
|
265
|
+
fixedPosition?: boolean | undefined;
|
|
266
|
+
hasCloser?: boolean | undefined;
|
|
267
|
+
} & {
|
|
268
|
+
view: View;
|
|
269
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
270
|
+
declare const ResponsiveContext: React.Context<TResponsiveModalContext>;
|
|
271
|
+
interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
169
272
|
/**
|
|
170
|
-
*
|
|
273
|
+
* Текст после иконки
|
|
171
274
|
*/
|
|
172
|
-
|
|
173
|
-
className?: string;
|
|
174
|
-
}>;
|
|
275
|
+
text?: string;
|
|
175
276
|
/**
|
|
176
|
-
*
|
|
277
|
+
* Дополнительный класс
|
|
177
278
|
*/
|
|
178
|
-
|
|
279
|
+
className?: string;
|
|
179
280
|
/**
|
|
180
|
-
*
|
|
281
|
+
* Вид компонента
|
|
181
282
|
*/
|
|
182
|
-
|
|
283
|
+
view: "mobile" | "desktop";
|
|
183
284
|
/**
|
|
184
|
-
*
|
|
285
|
+
* Прозрачность текста
|
|
286
|
+
*/
|
|
287
|
+
textOpacity?: number;
|
|
288
|
+
/**
|
|
289
|
+
* Обработчик клика
|
|
290
|
+
*/
|
|
291
|
+
onClick?: () => void;
|
|
292
|
+
}
|
|
293
|
+
declare const BackArrowAddon: React.FC<BackArrowAddonProps>;
|
|
294
|
+
declare const colors: readonly [
|
|
295
|
+
"tertiary",
|
|
296
|
+
"disabled",
|
|
297
|
+
"accent",
|
|
298
|
+
"primary",
|
|
299
|
+
"attention",
|
|
300
|
+
"positive",
|
|
301
|
+
"secondary",
|
|
302
|
+
"tertiary-inverted",
|
|
303
|
+
"primary-inverted",
|
|
304
|
+
"secondary-inverted",
|
|
305
|
+
"link",
|
|
306
|
+
"negative",
|
|
307
|
+
"static-primary-light",
|
|
308
|
+
"static-secondary-light",
|
|
309
|
+
"static-tertiary-light",
|
|
310
|
+
"static-primary-dark",
|
|
311
|
+
"static-secondary-dark",
|
|
312
|
+
"static-tertiary-dark",
|
|
313
|
+
"static-accent"
|
|
314
|
+
];
|
|
315
|
+
type Color = (typeof colors)[number];
|
|
316
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
317
|
+
type NativeProps = HTMLAttributes<HTMLSpanElement>;
|
|
318
|
+
type TextBaseProps = {
|
|
319
|
+
/**
|
|
320
|
+
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
|
|
321
|
+
*/
|
|
322
|
+
view?: "primary-large" | "primary-medium" | "primary-small" | "secondary-large" | "secondary-medium" | "secondary-small" | "component" | "caps";
|
|
323
|
+
/**
|
|
324
|
+
* Цвет текста
|
|
325
|
+
*/
|
|
326
|
+
color?: Color;
|
|
327
|
+
/**
|
|
328
|
+
* Толщина шрифта
|
|
329
|
+
*/
|
|
330
|
+
weight?: "regular" | "medium" | "bold";
|
|
331
|
+
/**
|
|
332
|
+
* Делает цифры моноширинными
|
|
333
|
+
*/
|
|
334
|
+
monospaceNumbers?: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* HTML тег
|
|
337
|
+
*/
|
|
338
|
+
tag?: "span" | "div";
|
|
339
|
+
/**
|
|
340
|
+
* Css-класс для стилизации (native prop)
|
|
185
341
|
*/
|
|
186
342
|
className?: string;
|
|
187
343
|
/**
|
|
188
|
-
*
|
|
344
|
+
* Id компонента для тестов
|
|
189
345
|
*/
|
|
190
346
|
dataTestId?: string;
|
|
191
347
|
/**
|
|
192
|
-
*
|
|
348
|
+
* Контент (native prop)
|
|
193
349
|
*/
|
|
194
|
-
|
|
195
|
-
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
|
|
196
|
-
type CloserProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
350
|
+
children?: React.ReactNode;
|
|
197
351
|
/**
|
|
198
|
-
*
|
|
352
|
+
* Добавляет отступы к тэгу 'p'
|
|
199
353
|
*/
|
|
200
|
-
|
|
354
|
+
defaultMargins?: never;
|
|
201
355
|
/**
|
|
202
|
-
*
|
|
356
|
+
* Количество строк (не поддерживает IE)
|
|
203
357
|
*/
|
|
204
|
-
|
|
358
|
+
rowLimit?: 1 | 2 | 3;
|
|
359
|
+
};
|
|
360
|
+
type TextPTagProps = Omit<TextBaseProps, "tag" | "defaultMargins"> & {
|
|
361
|
+
tag?: "p";
|
|
362
|
+
defaultMargins?: boolean;
|
|
363
|
+
};
|
|
364
|
+
type TextProps = Omit<NativeProps, "color"> & (TextBaseProps | TextPTagProps);
|
|
365
|
+
type NativeProps$0 = HTMLAttributes<HTMLHeadingElement>;
|
|
366
|
+
type TitleProps = Omit<NativeProps$0, "color"> & {
|
|
205
367
|
/**
|
|
206
|
-
*
|
|
368
|
+
* HTML тег
|
|
207
369
|
*/
|
|
208
|
-
|
|
370
|
+
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div";
|
|
209
371
|
/**
|
|
210
|
-
*
|
|
372
|
+
* [Вариант начертания](https://core-ds.github.io/core-components/master/?path=/docs/guidelines-typography--page)
|
|
211
373
|
*/
|
|
212
|
-
|
|
374
|
+
view?: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
213
375
|
/**
|
|
214
|
-
*
|
|
376
|
+
* Цвет текста
|
|
215
377
|
*/
|
|
216
|
-
|
|
378
|
+
color?: Color;
|
|
217
379
|
/**
|
|
218
|
-
*
|
|
380
|
+
* Толщина шрифта
|
|
381
|
+
*/
|
|
382
|
+
weight?: "regular" | "medium" | "bold";
|
|
383
|
+
/**
|
|
384
|
+
* Шрифт текста
|
|
385
|
+
*/
|
|
386
|
+
font?: "styrene" | "system";
|
|
387
|
+
/**
|
|
388
|
+
* Добавляет отступы
|
|
389
|
+
*/
|
|
390
|
+
defaultMargins?: boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Css-класс для стилизации (native prop)
|
|
393
|
+
*/
|
|
394
|
+
className?: string;
|
|
395
|
+
/**
|
|
396
|
+
* Id компонента для тестов
|
|
219
397
|
*/
|
|
220
398
|
dataTestId?: string;
|
|
399
|
+
/**
|
|
400
|
+
* Контент (native prop)
|
|
401
|
+
*/
|
|
402
|
+
children?: React.ReactNode;
|
|
403
|
+
/**
|
|
404
|
+
* Количество строк (не поддерживает IE)
|
|
405
|
+
*/
|
|
406
|
+
rowLimit?: 1 | 2 | 3;
|
|
221
407
|
};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
408
|
+
type TitleMobileProps = Omit<TitleProps, "defaultMargins">;
|
|
409
|
+
declare const Typography: {
|
|
410
|
+
Title: FC<TitleProps>;
|
|
411
|
+
Text: ForwardRefExoticComponent<TextProps & RefAttributes<TextElementType>>;
|
|
412
|
+
TitleResponsive: FC<TitleProps>;
|
|
413
|
+
TitleMobile: FC<TitleMobileProps>;
|
|
227
414
|
};
|
|
228
|
-
declare const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
415
|
+
declare const typographyPresets: {
|
|
416
|
+
mobile: {
|
|
417
|
+
list: {
|
|
418
|
+
text: {
|
|
419
|
+
primary: {
|
|
420
|
+
tag: string;
|
|
421
|
+
view: string;
|
|
422
|
+
};
|
|
423
|
+
secondary: {
|
|
424
|
+
tag: string;
|
|
425
|
+
color: string;
|
|
426
|
+
view: string;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
declare const TitleResponsive: FC<TitleProps>;
|
|
433
|
+
type IconButtonProps = {
|
|
434
|
+
/**
|
|
435
|
+
* Компонент иконки
|
|
436
|
+
*/
|
|
437
|
+
icon: ElementType<{
|
|
438
|
+
className?: string;
|
|
439
|
+
}>;
|
|
440
|
+
/**
|
|
441
|
+
* Тип кнопки
|
|
442
|
+
*/
|
|
443
|
+
view?: "primary" | "secondary" | "transparent" | "tertiary" | "negative";
|
|
444
|
+
/**
|
|
445
|
+
* Размер компонента
|
|
446
|
+
*/
|
|
447
|
+
size?: "xxs" | "xs" | "s";
|
|
448
|
+
/**
|
|
449
|
+
* Дополнительный класс
|
|
450
|
+
*/
|
|
451
|
+
className?: string;
|
|
452
|
+
/**
|
|
453
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
454
|
+
*/
|
|
455
|
+
dataTestId?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Набор цветов для компонента
|
|
458
|
+
*/
|
|
459
|
+
colors?: "default" | "inverted";
|
|
460
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "download">;
|
|
461
|
+
declare const IconButton: React.ForwardRefExoticComponent<{
|
|
462
|
+
icon: ElementType<{
|
|
463
|
+
className?: string;
|
|
464
|
+
}>;
|
|
465
|
+
view?: "primary" | "secondary" | "tertiary" | "transparent" | "negative" | undefined;
|
|
466
|
+
size?: "s" | "xs" | "xxs" | undefined;
|
|
467
|
+
className?: string | undefined;
|
|
468
|
+
dataTestId?: string | undefined;
|
|
469
|
+
colors?: "default" | "inverted" | undefined;
|
|
470
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "size"> & Pick<ButtonProps, "href" | "loading"> & Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, "download" | "target"> & React.RefAttributes<HTMLButtonElement>>;
|
|
238
471
|
declare const ModalContext: import("react").Context<BaseModalContext>;
|
|
239
472
|
type SelectModalMobileProps = Omit<BaseSelectProps, 'Checkmark' | 'onScroll'>;
|
|
240
473
|
declare const SelectModalMobile: React.ForwardRefExoticComponent<SelectModalMobileProps & React.RefAttributes<unknown>>;
|
|
241
|
-
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, BaseSelectMobile, OptionsListWithApply, ModalMobile, Content, Modal, ResponsiveContext, ModalContext, SelectModalMobileProps, SelectModalMobile };
|
|
474
|
+
export { AdditionalMobileProps, SelectMobileProps, SelectMobile, BaseSelectMobile, OptionsListWithApply, ModalMobile, Content, Modal, ResponsiveContext, BackArrowAddonProps, BackArrowAddon, Typography, typographyPresets, TitleResponsive, IconButtonProps, IconButton, ModalContext, SelectModalMobileProps, SelectModalMobile };
|
|
475
|
+
export type { TitleProps, TextProps, Color };
|
|
@@ -6,7 +6,7 @@ import { useMultipleSelection, useCombobox } from 'downshift';
|
|
|
6
6
|
import { BottomSheet } from '@alfalab/core-components-bottom-sheet/modern';
|
|
7
7
|
import { ModalMobile } from '@alfalab/core-components-modal/modern/mobile';
|
|
8
8
|
import './Component.js';
|
|
9
|
-
import { g as getDataTestId } from './Component-
|
|
9
|
+
import { g as getDataTestId } from './Component-c2743e76.js';
|
|
10
10
|
import { Field } from './components/field/Component.js';
|
|
11
11
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
12
12
|
import { Option } from './components/option/Component.js';
|
|
@@ -17,7 +17,7 @@ import '@alfalab/hooks';
|
|
|
17
17
|
import { processOptions } from './utils.js';
|
|
18
18
|
import { BaseOption } from './components/base-option/Component.js';
|
|
19
19
|
import '@alfalab/core-components-skeleton/modern';
|
|
20
|
-
import './intersection-observer-
|
|
20
|
+
import './intersection-observer-12c920c6.js';
|
|
21
21
|
import { Button } from '@alfalab/core-components-button/modern';
|
|
22
22
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
23
23
|
import '@alfalab/core-components-form-control/modern';
|
|
@@ -30,7 +30,7 @@ import { Checkmark } from './components/base-select-mobile/checkmark/Component.j
|
|
|
30
30
|
import { OptionsList as OptionsList$1 } from './components/base-select-mobile/options-list/Component.js';
|
|
31
31
|
import { VirtualOptionsList } from './components/base-select-mobile/virtual-options-list/Component.js';
|
|
32
32
|
|
|
33
|
-
const styles$1 = {"footer":"
|
|
33
|
+
const styles$1 = {"footer":"select__footer_l8orr","withBorder":"select__withBorder_l8orr"};
|
|
34
34
|
require('./presets/useSelectWithApply/options-list-with-apply/index.css')
|
|
35
35
|
|
|
36
36
|
const OptionsListWithApply = forwardRef(({ toggleMenu, OptionsList: OptionsList$1 = OptionsList, getOptionProps: defaultGetOptionProps, showClear = true, selectedDraft = [], flatOptions = [], onApply = () => null, onClear = () => null, onClose = () => null, visibleOptions = 5, ...restProps }, ref) => {
|
|
@@ -143,7 +143,7 @@ function useSelectWithApply({ options, selected, onChange = () => null, OptionsL
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
const styles = {"component":"
|
|
146
|
+
const styles = {"component":"select__component_mpz1x","popoverInner":"select__popoverInner_mpz1x","sheet":"select__sheet_mpz1x","sheetContent":"select__sheetContent_mpz1x","sheetContainer":"select__sheetContainer_mpz1x","block":"select__block_mpz1x","option":"select__option_mpz1x","optionGroup":"select__optionGroup_mpz1x"};
|
|
147
147
|
require('./components/base-select-mobile/index.css')
|
|
148
148
|
|
|
149
149
|
const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ const getDataTestId = (dataTestId, element) => {
|
|
|
13
13
|
return dataTestId ? `${dataTestId}${elementPart}` : undefined;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const styles = {"component":"
|
|
16
|
+
const styles = {"component":"select__component_1p67t","popoverInner":"select__popoverInner_1p67t","optionsList":"select__optionsList_1p67t","nativeSelect":"select__nativeSelect_1p67t","block":"select__block_1p67t"};
|
|
17
17
|
require('./components/base-select/index.css')
|
|
18
18
|
|
|
19
19
|
const BaseSelect = forwardRef(({ dataTestId, className, fieldClassName, optionsListClassName, optionClassName, popperClassName, options, autocomplete = false, multiple = false, allowUnselect = false, disabled = false, closeOnSelect = !multiple, circularNavigation = false, nativeSelect = false, defaultOpen = false, open: openProp, popoverPosition = 'bottom-start', preventFlip = true, optionsListWidth = 'content', name, id, selected, size = 's', optionsSize = size, error, hint, block, label, labelView, placeholder, fieldProps = {}, optionsListProps = {}, optionProps = {}, valueRenderer, onChange, onOpen, onFocus, onBlur, onScroll, Arrow, Field = () => null, OptionsList = () => null, Optgroup = () => null, Option = () => null, updatePopover, zIndexPopover, showEmptyOptionsList = false, visibleOptions, }, ref) => {
|
package/modern/Component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Arrow } from './components/arrow/Component.js';
|
|
3
|
-
import { B as BaseSelect } from './Component-
|
|
3
|
+
import { B as BaseSelect } from './Component-c2743e76.js';
|
|
4
4
|
import { Field } from './components/field/Component.js';
|
|
5
5
|
import { Optgroup } from './components/optgroup/Component.js';
|
|
6
6
|
import { Option } from './components/option/Component.js';
|
|
@@ -3,8 +3,8 @@ import { useMedia } from '@alfalab/hooks';
|
|
|
3
3
|
import { Select } from './Component.js';
|
|
4
4
|
import 'classnames';
|
|
5
5
|
import '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
6
|
-
import './Component-
|
|
7
|
-
import { S as SelectMobile } from './Component-
|
|
6
|
+
import './Component-c2743e76.js';
|
|
7
|
+
import { S as SelectMobile } from './Component-629f202b.js';
|
|
8
8
|
import '@alfalab/core-components-form-control/modern';
|
|
9
9
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
10
10
|
import '@alfalab/core-components-badge/modern';
|
|
@@ -30,7 +30,7 @@ import '@alfalab/core-components-modal/modern/mobile';
|
|
|
30
30
|
import './components/base-option/Component.js';
|
|
31
31
|
import './components/base-checkmark/Component.js';
|
|
32
32
|
import '@alfalab/core-components-skeleton/modern';
|
|
33
|
-
import './intersection-observer-
|
|
33
|
+
import './intersection-observer-12c920c6.js';
|
|
34
34
|
import '@alfalab/core-components-button/modern';
|
|
35
35
|
import './components/base-select-mobile/options-list/Component.js';
|
|
36
36
|
import '@alfalab/core-components-base-modal/modern';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { ChevronDownMIcon } from '@alfalab/icons-glyph/ChevronDownMIcon';
|
|
4
4
|
|
|
5
|
-
const styles = {"arrow":"
|
|
5
|
+
const styles = {"arrow":"select__arrow_1ydhd","open":"select__open_1ydhd"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Arrow = ({ open, className }) => (React.createElement(ChevronDownMIcon, { className: cn(styles.arrow, className, { [styles.open]: open }) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: dr3f8 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-primary: #0b1f35;
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
/* checkmark */
|
|
27
27
|
|
|
28
28
|
/* optgroup */
|
|
29
|
-
} .
|
|
29
|
+
} .select__arrow_1ydhd {
|
|
30
30
|
display: block;
|
|
31
31
|
width: 24px;
|
|
32
32
|
height: 24px;
|
|
33
33
|
color: var(--select-arrow-color);
|
|
34
34
|
|
|
35
35
|
transition: transform 0.15s ease-in-out, opacity 0.2s ease;
|
|
36
|
-
} .
|
|
36
|
+
} .select__open_1ydhd {
|
|
37
37
|
transform: var(--arrow-transform);
|
|
38
38
|
}
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { Checkbox } from '@alfalab/core-components-checkbox/modern';
|
|
4
4
|
import { CheckmarkMIcon } from '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
5
5
|
|
|
6
|
-
const styles = {"checkmark":"
|
|
6
|
+
const styles = {"checkmark":"select__checkmark_1kd6s","single":"select__single_1kd6s","selected":"select__selected_1kd6s"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const BaseCheckmark = ({ selected, disabled = false, className, multiple, }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: knt3d */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
} :root {
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
/* checkmark */
|
|
24
24
|
|
|
25
25
|
/* optgroup */
|
|
26
|
-
} .
|
|
26
|
+
} .select__checkmark_1kd6s {
|
|
27
27
|
flex-shrink: 0;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
} .
|
|
29
|
+
} .select__single_1kd6s {
|
|
30
30
|
display: flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
justify-content: center;
|
|
33
33
|
opacity: 0
|
|
34
|
-
} .
|
|
34
|
+
} .select__single_1kd6s.select__selected_1kd6s {
|
|
35
35
|
opacity: 1;
|
|
36
36
|
}
|
|
@@ -4,7 +4,7 @@ import { BaseCheckmark } from '../base-checkmark/Component.js';
|
|
|
4
4
|
import '@alfalab/core-components-checkbox/modern';
|
|
5
5
|
import '@alfalab/icons-glyph/CheckmarkMIcon';
|
|
6
6
|
|
|
7
|
-
const styles = {"option":"
|
|
7
|
+
const styles = {"option":"select__option_193gp","disabled":"select__disabled_193gp","checkmarkBefore":"select__checkmarkBefore_193gp","mobile":"select__mobile_193gp","checkmarkAfter":"select__checkmarkAfter_193gp","textContent":"select__textContent_193gp","selected":"select__selected_193gp","highlighted":"select__highlighted_193gp","content":"select__content_193gp"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
const BaseOption = ({ className, option, children, selected, highlighted, disabled, multiple, Checkmark = BaseCheckmark, checkmarkPosition = multiple ? 'before' : 'after', innerProps, dataTestId, mobile = false, }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: ih8e0 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
/* checkmark */
|
|
44
44
|
|
|
45
45
|
/* optgroup */
|
|
46
|
-
} .
|
|
46
|
+
} .select__option_193gp {
|
|
47
47
|
font-size: 16px;
|
|
48
48
|
line-height: 20px;
|
|
49
49
|
font-weight: 400;
|
|
@@ -60,32 +60,32 @@
|
|
|
60
60
|
position: relative;
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
min-height: var(--size-s-height)
|
|
63
|
-
} .
|
|
63
|
+
} .select__option_193gp:not(.select__disabled_193gp):active {
|
|
64
64
|
background: var(--select-option-active-background);
|
|
65
65
|
color: var(--select-option-active-color);
|
|
66
|
-
} .
|
|
66
|
+
} .select__option_193gp.select__checkmarkBefore_193gp {
|
|
67
67
|
padding: 0 0 0 var(--gap-s)
|
|
68
|
-
} .
|
|
68
|
+
} .select__option_193gp.select__checkmarkBefore_193gp.select__mobile_193gp {
|
|
69
69
|
padding-left: var(--gap-m);
|
|
70
|
-
} .
|
|
70
|
+
} .select__option_193gp.select__checkmarkAfter_193gp {
|
|
71
71
|
padding: 0 var(--gap-s) 0 0
|
|
72
|
-
} .
|
|
72
|
+
} .select__option_193gp.select__checkmarkAfter_193gp.select__mobile_193gp {
|
|
73
73
|
padding-right: var(--gap-l);
|
|
74
|
-
} .
|
|
74
|
+
} .select__option_193gp.select__textContent_193gp {
|
|
75
75
|
padding: var(--gap-s)
|
|
76
|
-
} .
|
|
76
|
+
} .select__option_193gp.select__textContent_193gp.select__mobile_193gp {
|
|
77
77
|
padding: var(--gap-m) var(--gap-l) var(--gap-m) var(--gap-m);
|
|
78
|
-
} .
|
|
78
|
+
} .select__selected_193gp {
|
|
79
79
|
background: var(--select-option-selected-background);
|
|
80
80
|
color: var(--select-option-selected-color);
|
|
81
81
|
cursor: default;
|
|
82
|
-
} .
|
|
82
|
+
} .select__highlighted_193gp {
|
|
83
83
|
background: var(--select-option-hover-background);
|
|
84
84
|
color: var(--select-option-hover-color);
|
|
85
|
-
} .
|
|
85
|
+
} .select__disabled_193gp {
|
|
86
86
|
cursor: var(--disabled-cursor);
|
|
87
87
|
background: var(--select-option-disabled-background);
|
|
88
88
|
color: var(--select-option-disabled-color);
|
|
89
|
-
} .
|
|
89
|
+
} .select__content_193gp {
|
|
90
90
|
flex: 1;
|
|
91
91
|
}
|
|
@@ -5,6 +5,6 @@ import 'classnames';
|
|
|
5
5
|
import 'downshift';
|
|
6
6
|
import '@alfalab/core-components-popover/modern';
|
|
7
7
|
import '@alfalab/hooks';
|
|
8
|
-
export { B as BaseSelect } from '../../Component-
|
|
8
|
+
export { B as BaseSelect } from '../../Component-c2743e76.js';
|
|
9
9
|
import '../../utils.js';
|
|
10
10
|
import '../native-select/Component.js';
|