@alfalab/core-components-custom-picker-button 1.0.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/Component-2aef4eba.d.ts +50 -0
- package/Component-3885b0d7.d.ts +71 -0
- package/Component-3e68f8db.d.ts +11 -0
- package/Component-3ebe4754.d.ts +176 -0
- package/Component-5e1b8383.d.ts +4 -0
- package/Component-bdb4c6b9.d.ts +12 -0
- package/Component-ebda875c.d.ts +142 -0
- package/Component.desktop.d.ts +6 -0
- package/Component.desktop.js +28 -0
- package/Component.mobile-ae13210f.d.ts +7 -0
- package/Component.mobile-b2c0420d.d.ts +35 -0
- package/Component.mobile.d.ts +6 -0
- package/Component.mobile.js +28 -0
- package/Component.responsive-2aef4eba.d.ts +28 -0
- package/Component.responsive.d.ts +22 -0
- package/Component.responsive.js +28 -0
- package/Context-bdb4c6b9.d.ts +4 -0
- package/ResponsiveContext-baf4875b.d.ts +5 -0
- package/component-3885b0d7.d.ts +43 -0
- package/consts-f777ba1a.d.ts +2 -0
- package/cssm/Component-2aef4eba.d.ts +50 -0
- package/cssm/Component-3885b0d7.d.ts +71 -0
- package/cssm/Component-3e68f8db.d.ts +11 -0
- package/cssm/Component-3ebe4754.d.ts +176 -0
- package/cssm/Component-5e1b8383.d.ts +4 -0
- package/cssm/Component-bdb4c6b9.d.ts +12 -0
- package/cssm/Component-ebda875c.d.ts +142 -0
- package/cssm/Component.desktop.d.ts +6 -0
- package/cssm/Component.desktop.js +29 -0
- package/cssm/Component.mobile-ae13210f.d.ts +7 -0
- package/cssm/Component.mobile-b2c0420d.d.ts +35 -0
- package/cssm/Component.mobile.d.ts +6 -0
- package/cssm/Component.mobile.js +29 -0
- package/cssm/Component.responsive-2aef4eba.d.ts +28 -0
- package/cssm/Component.responsive.d.ts +22 -0
- package/cssm/Component.responsive.js +29 -0
- package/cssm/Context-bdb4c6b9.d.ts +4 -0
- package/cssm/ResponsiveContext-baf4875b.d.ts +5 -0
- package/cssm/component-3885b0d7.d.ts +43 -0
- package/cssm/consts-f777ba1a.d.ts +2 -0
- package/cssm/desktop.d.ts +2 -0
- package/cssm/desktop.js +17 -0
- package/cssm/field/Component.d.ts +11 -0
- package/cssm/field/Component.js +31 -0
- package/cssm/field/index.d.ts +1 -0
- package/cssm/field/index.js +15 -0
- package/cssm/field/index.module.css +27 -0
- package/cssm/hook-3e68f8db.d.ts +62 -0
- package/cssm/index-136acbb1.d.ts +28 -0
- package/cssm/index-2aef4eba.d.ts +5 -0
- package/cssm/index-3885b0d7.d.ts +3 -0
- package/cssm/index-3e68f8db.d.ts +100 -0
- package/cssm/index-3ebe4754.d.ts +1 -0
- package/cssm/index-425c8522.d.ts +6 -0
- package/cssm/index-701e77da.d.ts +4 -0
- package/cssm/index-bdb4c6b9.d.ts +2 -0
- package/cssm/index-e81c389f.d.ts +3 -0
- package/cssm/index-ebda875c.d.ts +37 -0
- package/cssm/index-f12ee135.d.ts +3 -0
- package/cssm/index.d.ts +2 -0
- package/cssm/index.js +21 -0
- package/cssm/mobile.d.ts +2 -0
- package/cssm/mobile.js +17 -0
- package/cssm/responsive.d.ts +2 -0
- package/cssm/responsive.js +21 -0
- package/cssm/types-5e678ff2.d.ts +219 -0
- package/cssm/types-ebda875c.d.ts +113 -0
- package/cssm/typings-5e1b8383.d.ts +549 -0
- package/cssm/typings-bdb4c6b9.d.ts +52 -0
- package/cssm/utils-1574ad8b.d.ts +29 -0
- package/cssm/utils-5e1b8383.d.ts +38 -0
- package/cssm/utils-b64479aa.d.ts +8 -0
- package/desktop.d.ts +2 -0
- package/desktop.js +16 -0
- package/esm/Component-2aef4eba.d.ts +50 -0
- package/esm/Component-3885b0d7.d.ts +71 -0
- package/esm/Component-3e68f8db.d.ts +11 -0
- package/esm/Component-3ebe4754.d.ts +176 -0
- package/esm/Component-5e1b8383.d.ts +4 -0
- package/esm/Component-bdb4c6b9.d.ts +12 -0
- package/esm/Component-ebda875c.d.ts +142 -0
- package/esm/Component.desktop.d.ts +6 -0
- package/esm/Component.desktop.js +20 -0
- package/esm/Component.mobile-ae13210f.d.ts +7 -0
- package/esm/Component.mobile-b2c0420d.d.ts +35 -0
- package/esm/Component.mobile.d.ts +6 -0
- package/esm/Component.mobile.js +20 -0
- package/esm/Component.responsive-2aef4eba.d.ts +28 -0
- package/esm/Component.responsive.d.ts +22 -0
- package/esm/Component.responsive.js +20 -0
- package/esm/Context-bdb4c6b9.d.ts +4 -0
- package/esm/ResponsiveContext-baf4875b.d.ts +5 -0
- package/esm/component-3885b0d7.d.ts +43 -0
- package/esm/consts-f777ba1a.d.ts +2 -0
- package/esm/desktop.d.ts +2 -0
- package/esm/desktop.js +8 -0
- package/esm/field/Component.d.ts +11 -0
- package/esm/field/Component.js +23 -0
- package/esm/field/index.css +28 -0
- package/esm/field/index.d.ts +1 -0
- package/esm/field/index.js +6 -0
- package/esm/hook-3e68f8db.d.ts +62 -0
- package/esm/index-136acbb1.d.ts +28 -0
- package/esm/index-2aef4eba.d.ts +5 -0
- package/esm/index-3885b0d7.d.ts +3 -0
- package/esm/index-3e68f8db.d.ts +100 -0
- package/esm/index-3ebe4754.d.ts +1 -0
- package/esm/index-425c8522.d.ts +6 -0
- package/esm/index-701e77da.d.ts +4 -0
- package/esm/index-bdb4c6b9.d.ts +2 -0
- package/esm/index-e81c389f.d.ts +3 -0
- package/esm/index-ebda875c.d.ts +37 -0
- package/esm/index-f12ee135.d.ts +3 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +12 -0
- package/esm/mobile.d.ts +2 -0
- package/esm/mobile.js +8 -0
- package/esm/responsive.d.ts +2 -0
- package/esm/responsive.js +12 -0
- package/esm/types-5e678ff2.d.ts +219 -0
- package/esm/types-ebda875c.d.ts +113 -0
- package/esm/typings-5e1b8383.d.ts +549 -0
- package/esm/typings-bdb4c6b9.d.ts +52 -0
- package/esm/utils-1574ad8b.d.ts +29 -0
- package/esm/utils-5e1b8383.d.ts +38 -0
- package/esm/utils-b64479aa.d.ts +8 -0
- package/field/Component.d.ts +11 -0
- package/field/Component.js +32 -0
- package/field/index.css +28 -0
- package/field/index.d.ts +1 -0
- package/field/index.js +14 -0
- package/hook-3e68f8db.d.ts +62 -0
- package/index-136acbb1.d.ts +28 -0
- package/index-2aef4eba.d.ts +5 -0
- package/index-3885b0d7.d.ts +3 -0
- package/index-3e68f8db.d.ts +100 -0
- package/index-3ebe4754.d.ts +1 -0
- package/index-425c8522.d.ts +6 -0
- package/index-701e77da.d.ts +4 -0
- package/index-bdb4c6b9.d.ts +2 -0
- package/index-e81c389f.d.ts +3 -0
- package/index-ebda875c.d.ts +37 -0
- package/index-f12ee135.d.ts +3 -0
- package/index.d.ts +2 -0
- package/index.js +20 -0
- package/mobile.d.ts +2 -0
- package/mobile.js +16 -0
- package/modern/Component-2aef4eba.d.ts +50 -0
- package/modern/Component-3885b0d7.d.ts +71 -0
- package/modern/Component-3e68f8db.d.ts +11 -0
- package/modern/Component-3ebe4754.d.ts +176 -0
- package/modern/Component-5e1b8383.d.ts +4 -0
- package/modern/Component-bdb4c6b9.d.ts +12 -0
- package/modern/Component-ebda875c.d.ts +142 -0
- package/modern/Component.desktop.d.ts +6 -0
- package/modern/Component.desktop.js +16 -0
- package/modern/Component.mobile-ae13210f.d.ts +7 -0
- package/modern/Component.mobile-b2c0420d.d.ts +35 -0
- package/modern/Component.mobile.d.ts +6 -0
- package/modern/Component.mobile.js +16 -0
- package/modern/Component.responsive-2aef4eba.d.ts +28 -0
- package/modern/Component.responsive.d.ts +22 -0
- package/modern/Component.responsive.js +18 -0
- package/modern/Context-bdb4c6b9.d.ts +4 -0
- package/modern/ResponsiveContext-baf4875b.d.ts +5 -0
- package/modern/component-3885b0d7.d.ts +43 -0
- package/modern/consts-f777ba1a.d.ts +2 -0
- package/modern/desktop.d.ts +2 -0
- package/modern/desktop.js +7 -0
- package/modern/field/Component.d.ts +11 -0
- package/modern/field/Component.js +23 -0
- package/modern/field/index.css +28 -0
- package/modern/field/index.d.ts +1 -0
- package/modern/field/index.js +5 -0
- package/modern/hook-3e68f8db.d.ts +62 -0
- package/modern/index-136acbb1.d.ts +28 -0
- package/modern/index-2aef4eba.d.ts +5 -0
- package/modern/index-3885b0d7.d.ts +3 -0
- package/modern/index-3e68f8db.d.ts +100 -0
- package/modern/index-3ebe4754.d.ts +1 -0
- package/modern/index-425c8522.d.ts +6 -0
- package/modern/index-701e77da.d.ts +4 -0
- package/modern/index-bdb4c6b9.d.ts +2 -0
- package/modern/index-e81c389f.d.ts +3 -0
- package/modern/index-ebda875c.d.ts +37 -0
- package/modern/index-f12ee135.d.ts +3 -0
- package/modern/index.d.ts +2 -0
- package/modern/index.js +11 -0
- package/modern/mobile.d.ts +2 -0
- package/modern/mobile.js +7 -0
- package/modern/responsive.d.ts +2 -0
- package/modern/responsive.js +11 -0
- package/modern/types-5e678ff2.d.ts +219 -0
- package/modern/types-ebda875c.d.ts +113 -0
- package/modern/typings-5e1b8383.d.ts +549 -0
- package/modern/typings-bdb4c6b9.d.ts +52 -0
- package/modern/utils-1574ad8b.d.ts +29 -0
- package/modern/utils-5e1b8383.d.ts +38 -0
- package/modern/utils-b64479aa.d.ts +8 -0
- package/package.json +27 -0
- package/responsive.d.ts +2 -0
- package/responsive.js +20 -0
- package/send-stats.js +82 -0
- package/types-5e678ff2.d.ts +219 -0
- package/types-ebda875c.d.ts +113 -0
- package/typings-5e1b8383.d.ts +549 -0
- package/typings-bdb4c6b9.d.ts +52 -0
- package/utils-1574ad8b.d.ts +29 -0
- package/utils-5e1b8383.d.ts +38 -0
- package/utils-b64479aa.d.ts +8 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseSelectProps, OptionShape } from "./index-3e68f8db";
|
|
3
|
+
type UseSelectWithApplyProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Список выбранных пунктов
|
|
6
|
+
*/
|
|
7
|
+
selected: BaseSelectProps['selected'];
|
|
8
|
+
/**
|
|
9
|
+
* Список вариантов выбора
|
|
10
|
+
*/
|
|
11
|
+
options: BaseSelectProps['options'];
|
|
12
|
+
/**
|
|
13
|
+
* Обработчик выбора
|
|
14
|
+
*/
|
|
15
|
+
onChange: BaseSelectProps['onChange'];
|
|
16
|
+
/**
|
|
17
|
+
* Компонент выпадающего меню
|
|
18
|
+
*/
|
|
19
|
+
OptionsList?: BaseSelectProps['OptionsList'];
|
|
20
|
+
/**
|
|
21
|
+
* Пропсы, которые будут прокинуты в компонент списка
|
|
22
|
+
*/
|
|
23
|
+
optionsListProps?: BaseSelectProps['optionsListProps'];
|
|
24
|
+
/**
|
|
25
|
+
* Показывать кнопку очистки
|
|
26
|
+
*/
|
|
27
|
+
showClear?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Показывать пункт "Выбрать все"
|
|
30
|
+
*/
|
|
31
|
+
showSelectAll?: boolean;
|
|
32
|
+
};
|
|
33
|
+
declare const SELECT_ALL_KEY = "select_all";
|
|
34
|
+
declare function useSelectWithApply({ options, selected, onChange, OptionsList, optionsListProps, showClear, showSelectAll, }: UseSelectWithApplyProps): {
|
|
35
|
+
OptionsList: import("react").ForwardRefExoticComponent<import("./index-3e68f8db").OptionsListProps & {
|
|
36
|
+
showClear?: boolean | undefined;
|
|
37
|
+
onClose?: (() => void) | undefined;
|
|
38
|
+
selectedDraft?: OptionShape[] | undefined;
|
|
39
|
+
OptionsList?: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined; /**
|
|
40
|
+
* Пропсы, которые будут прокинуты в компонент списка
|
|
41
|
+
*/
|
|
42
|
+
Footer?: import("react").FC<import("./Component-ebda875c").FooterProps> | undefined;
|
|
43
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
|
+
optionsListProps: {
|
|
45
|
+
OptionsList: import("react").FC<import("./index-3e68f8db").OptionsListProps & import("react").RefAttributes<HTMLDivElement>> | undefined;
|
|
46
|
+
showClear: boolean;
|
|
47
|
+
onClear: () => void;
|
|
48
|
+
onApply: () => void;
|
|
49
|
+
onClose: () => void;
|
|
50
|
+
selectedDraft: OptionShape[];
|
|
51
|
+
};
|
|
52
|
+
allowUnselect: boolean;
|
|
53
|
+
multiple: boolean;
|
|
54
|
+
options: (OptionShape | import("./index-3e68f8db").GroupShape | {
|
|
55
|
+
key: string;
|
|
56
|
+
content: string;
|
|
57
|
+
})[];
|
|
58
|
+
onChange: (payload: import("./index-3e68f8db").BaseSelectChangePayload) => void;
|
|
59
|
+
selected: string | OptionShape | (string | OptionShape)[] | null | undefined;
|
|
60
|
+
};
|
|
61
|
+
export * from "./Component-5e1b8383";
|
|
62
|
+
export { UseSelectWithApplyProps, SELECT_ALL_KEY, useSelectWithApply };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Набор констант для z-index соответствующих классов компонентов.
|
|
5
|
+
* Значения выбраны по приоритету.
|
|
6
|
+
*/
|
|
7
|
+
declare const stackingOrder: {
|
|
8
|
+
FOCUSED: number;
|
|
9
|
+
DEFAULT: number;
|
|
10
|
+
POPOVER: number;
|
|
11
|
+
MODAL: number;
|
|
12
|
+
TOAST: number;
|
|
13
|
+
};
|
|
14
|
+
declare const StackingContext: import("react").Context<number>;
|
|
15
|
+
type StackProps = {
|
|
16
|
+
/**
|
|
17
|
+
* Render prop, в который передается функция.
|
|
18
|
+
* Функция принимает аргумент со значением z-index из текущего контекста.
|
|
19
|
+
*/
|
|
20
|
+
children: (value: number) => ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Исходное значение для z-index.
|
|
23
|
+
* @default 5
|
|
24
|
+
*/
|
|
25
|
+
value?: number;
|
|
26
|
+
};
|
|
27
|
+
declare const Stack: FC<StackProps>;
|
|
28
|
+
export { stackingOrder, StackingContext, StackProps, Stack };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./Component.responsive-2aef4eba";
|
|
2
|
+
export { PickerButtonResponsive as PickerButton };
|
|
3
|
+
export type { PickerButtonResponsiveProps as PickerButtonProps };
|
|
4
|
+
export type { PickerButtonDesktopProps, PickerButtonSize, PickerButtonVariant } from "./Component-2aef4eba";
|
|
5
|
+
export { getIcon } from "./index-701e77da";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { FormControlProps } from "./Component-3ebe4754";
|
|
5
|
+
import { BaseSelectProps, OptionProps, OptionShape } from "./typings-5e1b8383";
|
|
6
|
+
type SelectFieldProps = Omit<FormControlProps, "size"> & Record<string, unknown>;
|
|
7
|
+
type SelectProps = Omit<BaseSelectProps, "fieldProps"> & {
|
|
8
|
+
/**
|
|
9
|
+
* Пропсы, которые будут прокинуты в компонент поля
|
|
10
|
+
*/
|
|
11
|
+
fieldProps?: SelectFieldProps;
|
|
12
|
+
};
|
|
13
|
+
declare const Select: React.ForwardRefExoticComponent<Omit<BaseSelectProps, "fieldProps"> & {
|
|
14
|
+
fieldProps?: SelectFieldProps | undefined;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
+
type useSelectWithLoadingProps = {
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
visibleOptions?: BaseSelectProps["visibleOptions"];
|
|
20
|
+
Option?: React.FC<OptionProps>;
|
|
21
|
+
};
|
|
22
|
+
declare function useSelectWithLoading({ loading, visibleOptions, Option }: useSelectWithLoadingProps): {
|
|
23
|
+
Option: (props: OptionProps) => JSX.Element;
|
|
24
|
+
options: OptionShape[];
|
|
25
|
+
} | null;
|
|
26
|
+
type OptionsFetcherResponse = {
|
|
27
|
+
options: OptionShape[];
|
|
28
|
+
hasMore: boolean;
|
|
29
|
+
};
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
31
|
+
type useLazyLoadingProps = {
|
|
32
|
+
/** Количество элементов на "странице" */
|
|
33
|
+
limit?: number;
|
|
34
|
+
/** Начальный номер "страницы" */
|
|
35
|
+
initialOffset?: number;
|
|
36
|
+
/** Скелетон загружаемых элементов */
|
|
37
|
+
skeleton?: React.ReactNode;
|
|
38
|
+
/** Компонент пункта меню */
|
|
39
|
+
Option?: React.FC<OptionProps>;
|
|
40
|
+
/**
|
|
41
|
+
* Функция-загрузчик опций.
|
|
42
|
+
* @param offset - текущая страница
|
|
43
|
+
* @param limit - количество элементов на странице
|
|
44
|
+
* @param queryString - строчные данные, пробрасываемые для поиска из кастомного инпута, расположенного в заголовке OptionsList
|
|
45
|
+
* @returns Promise<{
|
|
46
|
+
* options - список опций следующей "страницы". Они аппендятся к предыдущим
|
|
47
|
+
* hasMore - указывает, есть ли еще незагруженные элементы (в случае false перестает загружать "следующую страницу")
|
|
48
|
+
* }>
|
|
49
|
+
*/
|
|
50
|
+
optionsFetcher(offset: number, limit: number, queryString?: string): Promise<OptionsFetcherResponse>;
|
|
51
|
+
};
|
|
52
|
+
declare function useLazyLoading({ limit, initialOffset, optionsFetcher, skeleton, Option }: useLazyLoadingProps): {
|
|
53
|
+
optionsProps: {
|
|
54
|
+
Option: (props: OptionProps) => JSX.Element;
|
|
55
|
+
options: OptionShape[];
|
|
56
|
+
optionsListProps: {
|
|
57
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
58
|
+
inputProps: {
|
|
59
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>, payload: {
|
|
60
|
+
value: string;
|
|
61
|
+
}) => void;
|
|
62
|
+
value: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
onOpen: (payload: {
|
|
66
|
+
open?: boolean;
|
|
67
|
+
}) => void;
|
|
68
|
+
};
|
|
69
|
+
reset: () => void;
|
|
70
|
+
};
|
|
71
|
+
type SkeletonProps = {
|
|
72
|
+
/**
|
|
73
|
+
* Флаг, явно задающий состояние, при котором контент закрывается прелоадером
|
|
74
|
+
*/
|
|
75
|
+
visible?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Флаг явного включения анимации скелета
|
|
78
|
+
*/
|
|
79
|
+
animate?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Дополнительный класс
|
|
82
|
+
*/
|
|
83
|
+
className?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
86
|
+
*/
|
|
87
|
+
dataTestId?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Дочерние элементы.
|
|
90
|
+
*/
|
|
91
|
+
children?: ReactNode;
|
|
92
|
+
};
|
|
93
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
94
|
+
export { SelectFieldProps, SelectProps, Select, useSelectWithLoading, useLazyLoading, SkeletonProps, Skeleton };
|
|
95
|
+
export * from "./index-ebda875c";
|
|
96
|
+
export * from "./Component-3885b0d7";
|
|
97
|
+
export * from "./Component-5e1b8383";
|
|
98
|
+
export * from "./hook-3e68f8db";
|
|
99
|
+
export * from "./typings-5e1b8383";
|
|
100
|
+
export * from "./utils-5e1b8383";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component-3ebe4754";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type BackgroundColorType = 'accent' | 'info' | 'attention-muted' | 'positive-muted' | 'negative-muted' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'specialbg-component' | 'specialbg-component-inverted' | 'specialbg-primary-grouped' | 'specialbg-secondary-grouped' | 'specialbg-tertiary-grouped' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
|
|
2
|
+
type BorderColorType = 'accent' | 'key' | 'key-inverted' | 'link' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'underline' | 'underline-inverted' | 'graphic-attention' | 'graphic-link' | 'graphic-negative' | 'graphic-positive' | 'specialbg-secondary-transparent' | 'specialbg-secondary-transparent-inverted' | 'specialbg-tertiary-transparent' | 'specialbg-tertiary-transparent-inverted';
|
|
3
|
+
type GraphicColorType = 'accent' | 'link' | 'attention' | 'positive' | 'negative' | 'primary' | 'primary-inverted' | 'secondary' | 'secondary-inverted' | 'tertiary' | 'tertiary-inverted' | 'quaternary' | 'quaternary-inverted' | 'static-light' | 'static-accent' | 'static-dark';
|
|
4
|
+
type ShadowType = 'shadow-xs' | 'shadow-s' | 'shadow-m' | 'shadow-l' | 'shadow-xl' | 'shadow-xs-hard' | 'shadow-s-hard' | 'shadow-m-hard' | 'shadow-l-hard' | 'shadow-xl-hard' | 'shadow-xs-up' | 'shadow-s-up' | 'shadow-m-up' | 'shadow-l-up' | 'shadow-xl-up' | 'shadow-xs-hard-up' | 'shadow-s-hard-up' | 'shadow-m-hard-up' | 'shadow-l-hard-up' | 'shadow-xl-hard-up';
|
|
5
|
+
type GapType = '3xs' | '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl';
|
|
6
|
+
export { BackgroundColorType, BorderColorType, GraphicColorType, ShadowType, GapType };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react-transition-group" />
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { ButtonHTMLAttributes, ElementType, FC } from "react";
|
|
5
|
+
interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Вид компонента
|
|
8
|
+
*/
|
|
9
|
+
view: "desktop" | "mobile";
|
|
10
|
+
/**
|
|
11
|
+
* Дополнительный класс
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Позиция крестика
|
|
16
|
+
*/
|
|
17
|
+
align?: "left" | "right";
|
|
18
|
+
/**
|
|
19
|
+
* Фиксирует крестик
|
|
20
|
+
*/
|
|
21
|
+
sticky?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Иконка
|
|
24
|
+
*/
|
|
25
|
+
icon?: ElementType;
|
|
26
|
+
/**
|
|
27
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
28
|
+
*/
|
|
29
|
+
dataTestId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Коллбэк закрытия.
|
|
32
|
+
*/
|
|
33
|
+
onClose?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>, reason?: "backdropClick" | "escapeKeyDown" | "closerClick") => void;
|
|
34
|
+
}
|
|
35
|
+
declare const Closer: FC<CloserProps>;
|
|
36
|
+
export { CloserProps, Closer };
|
|
37
|
+
export * from "./Component-ebda875c";
|
package/modern/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { CustomPickerButtonResponsive as CustomPickerButton } from './Component.responsive.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@alfalab/core-components-mq/modern';
|
|
4
|
+
import './Component.desktop.js';
|
|
5
|
+
import '@alfalab/core-components-picker-button/modern/desktop';
|
|
6
|
+
import './field/Component.js';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import '@alfalab/core-components-custom-button/modern';
|
|
9
|
+
import '@alfalab/core-components-picker-button/modern';
|
|
10
|
+
import './Component.mobile.js';
|
|
11
|
+
import '@alfalab/core-components-picker-button/modern/mobile';
|
package/modern/mobile.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CustomPickerButtonMobile } from './Component.mobile.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@alfalab/core-components-picker-button/modern/mobile';
|
|
4
|
+
import './field/Component.js';
|
|
5
|
+
import 'classnames';
|
|
6
|
+
import '@alfalab/core-components-custom-button/modern';
|
|
7
|
+
import '@alfalab/core-components-picker-button/modern';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { CustomPickerButtonResponsive } from './Component.responsive.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '@alfalab/core-components-mq/modern';
|
|
4
|
+
import './Component.desktop.js';
|
|
5
|
+
import '@alfalab/core-components-picker-button/modern/desktop';
|
|
6
|
+
import './field/Component.js';
|
|
7
|
+
import 'classnames';
|
|
8
|
+
import '@alfalab/core-components-custom-button/modern';
|
|
9
|
+
import '@alfalab/core-components-picker-button/modern';
|
|
10
|
+
import './Component.mobile.js';
|
|
11
|
+
import '@alfalab/core-components-picker-button/modern/mobile';
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/// <reference types="react-transition-group" />
|
|
2
|
+
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
3
|
+
import { TransitionProps } from 'react-transition-group/Transition';
|
|
4
|
+
import { BaseModalProps } from "./index-bdb4c6b9";
|
|
5
|
+
import { NavigationBarProps } from "./index-e81c389f";
|
|
6
|
+
import { BackgroundColorType } from "./index-425c8522";
|
|
7
|
+
type BottomSheetTitleAlign = 'center' | 'left';
|
|
8
|
+
type BottomSheetProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Контент
|
|
11
|
+
*/
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Управление видимостью
|
|
15
|
+
*/
|
|
16
|
+
open: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Заголовок
|
|
19
|
+
*/
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Размер заголовка
|
|
23
|
+
*/
|
|
24
|
+
titleSize?: NavigationBarProps['titleSize'];
|
|
25
|
+
/**
|
|
26
|
+
* Подзаголовок.
|
|
27
|
+
*/
|
|
28
|
+
subtitle?: NavigationBarProps['subtitle'];
|
|
29
|
+
/**
|
|
30
|
+
* Кнопка действия (обычно, это кнопка закрытия)
|
|
31
|
+
*/
|
|
32
|
+
actionButton?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Нода, компонент или функция возвращающая их
|
|
35
|
+
*
|
|
36
|
+
* Контейнер к которому будут добавляться порталы
|
|
37
|
+
*/
|
|
38
|
+
container?: BaseModalProps['container'];
|
|
39
|
+
/**
|
|
40
|
+
* Рендерить ли в контейнер через портал.
|
|
41
|
+
*/
|
|
42
|
+
usePortal?: BaseModalProps['usePortal'];
|
|
43
|
+
/**
|
|
44
|
+
* Дополнительный класс
|
|
45
|
+
*/
|
|
46
|
+
className?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Дополнительный класс
|
|
49
|
+
*/
|
|
50
|
+
contentClassName?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Дополнительные пропсы на контейнер.
|
|
53
|
+
*/
|
|
54
|
+
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Дополнительный класс
|
|
57
|
+
*/
|
|
58
|
+
containerClassName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Цвет фона
|
|
61
|
+
*/
|
|
62
|
+
backgroundColor?: Extract<BackgroundColorType, 'primary' | 'secondary'>;
|
|
63
|
+
/**
|
|
64
|
+
* Дополнительный класс шапки
|
|
65
|
+
*/
|
|
66
|
+
headerClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Дополнительный класс футера
|
|
69
|
+
*/
|
|
70
|
+
footerClassName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Дополнительный класс для аддонов
|
|
73
|
+
*/
|
|
74
|
+
addonClassName?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Дополнительный класс для компонента крестика
|
|
77
|
+
*/
|
|
78
|
+
closerClassName?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Дополнительный класс для компонента стрелки назад
|
|
81
|
+
*/
|
|
82
|
+
backerClassName?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Дополнительный класс для компонента модального окна
|
|
85
|
+
*/
|
|
86
|
+
modalClassName?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Дополнительный класс для обертки модального окна
|
|
89
|
+
*/
|
|
90
|
+
modalWrapperClassName?: string;
|
|
91
|
+
/**
|
|
92
|
+
* TransitionProps, прокидываются в компонент CSSTransitionProps.
|
|
93
|
+
*/
|
|
94
|
+
transitionProps?: Partial<TransitionProps>;
|
|
95
|
+
/**
|
|
96
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
97
|
+
*/
|
|
98
|
+
dataTestId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* z-index компонента
|
|
101
|
+
*/
|
|
102
|
+
zIndex?: number;
|
|
103
|
+
/**
|
|
104
|
+
* Будет ли свайпаться шторка
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
swipeable?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Слот слева
|
|
110
|
+
*/
|
|
111
|
+
leftAddons?: ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* Слот справа
|
|
114
|
+
*/
|
|
115
|
+
rightAddons?: ReactNode;
|
|
116
|
+
/**
|
|
117
|
+
* Слот снизу
|
|
118
|
+
*/
|
|
119
|
+
bottomAddons?: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* Наличие компонента крестика
|
|
122
|
+
*/
|
|
123
|
+
hasCloser?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Наличие компонента стрелки назад
|
|
126
|
+
*/
|
|
127
|
+
hasBacker?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Выравнивание заголовка
|
|
130
|
+
*/
|
|
131
|
+
titleAlign?: BottomSheetTitleAlign;
|
|
132
|
+
/**
|
|
133
|
+
* Фиксирует шапку
|
|
134
|
+
*/
|
|
135
|
+
stickyHeader?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Фиксирует футер
|
|
138
|
+
*/
|
|
139
|
+
stickyFooter?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Высота шторки
|
|
142
|
+
*/
|
|
143
|
+
initialHeight?: 'default' | 'full';
|
|
144
|
+
/**
|
|
145
|
+
* Будет ли виден оверлэй
|
|
146
|
+
*/
|
|
147
|
+
hideOverlay?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Будет ли видна шапка
|
|
150
|
+
*/
|
|
151
|
+
hideHeader?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Будет ли обрезан заголовок
|
|
154
|
+
*/
|
|
155
|
+
trimTitle?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Запретить закрытие шторки кликом на оверлэй
|
|
158
|
+
*/
|
|
159
|
+
disableOverlayClick?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Отключает блокировку скролла при открытии модального окна
|
|
162
|
+
*/
|
|
163
|
+
disableBlockingScroll?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
|
|
166
|
+
* Не анимировать шторку при изменении размера вьюпорта
|
|
167
|
+
*/
|
|
168
|
+
ignoreScreenChange?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Свойства для Бэкдропа
|
|
171
|
+
*/
|
|
172
|
+
backdropProps?: BaseModalProps['backdropProps'];
|
|
173
|
+
/**
|
|
174
|
+
* Реф на контейнер, в котором происходит скролл
|
|
175
|
+
*/
|
|
176
|
+
scrollableContainerRef?: RefObject<HTMLElement>;
|
|
177
|
+
/**
|
|
178
|
+
* Реф для управления компонентом.
|
|
179
|
+
*/
|
|
180
|
+
bottomSheetInstanceRef?: RefObject<{
|
|
181
|
+
scrollToArea: (idx: number) => void;
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* Реф на контейнер, в котором находится шторка
|
|
185
|
+
*/
|
|
186
|
+
sheetContainerRef?: RefObject<HTMLElement>;
|
|
187
|
+
/**
|
|
188
|
+
* Магнитные области видимой высоты шторки.
|
|
189
|
+
* Можно использовать значения в пикселях - 10(число), либо в процентах - 10%(строка).
|
|
190
|
+
* По-умолчанию -[0, window.innerHeight - '24px']
|
|
191
|
+
* массив должен состоять минимум из 2 элементов
|
|
192
|
+
*/
|
|
193
|
+
magneticAreas?: Array<number | string>;
|
|
194
|
+
/**
|
|
195
|
+
* Индекс точки из magneticAreas, к которому нужно примагнититься при первом открытии шторки.
|
|
196
|
+
*/
|
|
197
|
+
initialActiveAreaIndex?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Отключает скролл контентной области.
|
|
200
|
+
*/
|
|
201
|
+
scrollLocked?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Скрыть скроллбар внутри шторки
|
|
204
|
+
*/
|
|
205
|
+
hideScrollbar?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Обработчик закрытия
|
|
208
|
+
*/
|
|
209
|
+
onClose: () => void;
|
|
210
|
+
/**
|
|
211
|
+
* Обработчик нажатия на стрелку назад
|
|
212
|
+
*/
|
|
213
|
+
onBack?: () => void;
|
|
214
|
+
/**
|
|
215
|
+
* Вызывается после притягивания к одной из `magneticAreas`
|
|
216
|
+
*/
|
|
217
|
+
onMagnetize?: (index: number) => void;
|
|
218
|
+
};
|
|
219
|
+
export { BottomSheetTitleAlign, BottomSheetProps };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { CloserProps } from "./index-ebda875c";
|
|
5
|
+
type NavigationBarProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Контент шапки
|
|
8
|
+
*/
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Заголовок шапки
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Подзаголовок (доступен только в мобильной версии)
|
|
16
|
+
*/
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Размер заголовка (compact доступен только в мобильной версии)
|
|
20
|
+
*/
|
|
21
|
+
titleSize?: 'default' | 'compact';
|
|
22
|
+
/**
|
|
23
|
+
* Доп. класс для аддонов
|
|
24
|
+
*/
|
|
25
|
+
addonClassName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Слот слева
|
|
28
|
+
*/
|
|
29
|
+
leftAddons?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Слот справа
|
|
32
|
+
*/
|
|
33
|
+
rightAddons?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Дополнительный класс для closer
|
|
36
|
+
*/
|
|
37
|
+
closerClassName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Слот снизу
|
|
40
|
+
*/
|
|
41
|
+
bottomAddons?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Наличие компонента крестика
|
|
44
|
+
*/
|
|
45
|
+
hasCloser?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Наличие кнопки "Назад"
|
|
48
|
+
*/
|
|
49
|
+
hasBackButton?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Дополнительный класс для правого аддона
|
|
52
|
+
*/
|
|
53
|
+
backButtonClassName?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Дополнительный класс
|
|
56
|
+
*/
|
|
57
|
+
className?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Дополнительный класс для контента
|
|
60
|
+
*/
|
|
61
|
+
contentClassName?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Дополнительный класс для нижнего аддона
|
|
64
|
+
*/
|
|
65
|
+
bottomAddonsClassName?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Выравнивание заголовка
|
|
68
|
+
*/
|
|
69
|
+
align?: 'left' | 'center';
|
|
70
|
+
/**
|
|
71
|
+
* Обрезать ли заголовок
|
|
72
|
+
*/
|
|
73
|
+
trim?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Фиксирует шапку
|
|
76
|
+
*/
|
|
77
|
+
sticky?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
80
|
+
*/
|
|
81
|
+
dataTestId?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Фоновое изображение
|
|
84
|
+
*/
|
|
85
|
+
imageUrl?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Иконка closer.
|
|
88
|
+
*/
|
|
89
|
+
closerIcon?: React.ElementType;
|
|
90
|
+
/**
|
|
91
|
+
* Обработчик закрытия
|
|
92
|
+
*/
|
|
93
|
+
onClose?: CloserProps['onClose'];
|
|
94
|
+
/**
|
|
95
|
+
* обработчик клика по кнопке "назад"
|
|
96
|
+
*/
|
|
97
|
+
onBack?: () => void;
|
|
98
|
+
/**
|
|
99
|
+
* Вид шапки - мобильный или десктоп
|
|
100
|
+
*/
|
|
101
|
+
view: 'desktop' | 'mobile';
|
|
102
|
+
/**
|
|
103
|
+
* Ссылка на родительскую ноду overflow: auto
|
|
104
|
+
*/
|
|
105
|
+
scrollableParentRef?: React.RefObject<HTMLDivElement>;
|
|
106
|
+
};
|
|
107
|
+
type ContentParams = {
|
|
108
|
+
extraClassName?: string;
|
|
109
|
+
wrapperRef?: React.RefObject<HTMLDivElement>;
|
|
110
|
+
style?: React.CSSProperties;
|
|
111
|
+
hidden?: boolean;
|
|
112
|
+
};
|
|
113
|
+
export { NavigationBarProps, ContentParams };
|