@alfalab/core-components-bottom-sheet 5.3.1 → 6.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-7f6ec6ba.d.ts → component-4db10e00.d.ts} +14 -67
- package/{component-7f6ec6ba.js → component-4db10e00.js} +23 -67
- package/component.js +2 -7
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +4 -4
- package/components/header/Component.js +3 -8
- package/components/header/index.css +19 -32
- package/cssm/{component-8a02e7db.d.ts → component-b3add484.d.ts} +14 -67
- package/cssm/{component-8a02e7db.js → component-b3add484.js} +21 -65
- package/cssm/component.js +2 -9
- package/cssm/components/header/Component.js +3 -10
- package/cssm/components/header/index.module.css +7 -20
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +2 -9
- package/cssm/index.module.css +4 -5
- package/esm/{component-9a8081cd.d.ts → component-094991ea.d.ts} +14 -67
- package/esm/{component-9a8081cd.js → component-094991ea.js} +24 -68
- package/esm/component.js +2 -7
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +4 -4
- package/esm/components/header/Component.js +3 -8
- package/esm/components/header/index.css +19 -32
- package/esm/index.css +19 -20
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -7
- package/index.css +19 -20
- package/index.d.ts +1 -1
- package/index.js +2 -7
- package/modern/{component-6012913e.d.ts → component-44079f58.d.ts} +14 -67
- package/modern/{component-6012913e.js → component-44079f58.js} +28 -51
- package/modern/component.js +2 -7
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +4 -4
- package/modern/components/header/Component.js +2 -7
- package/modern/components/header/index.css +19 -32
- package/modern/index.css +19 -20
- package/modern/index.d.ts +1 -1
- package/modern/index.js +2 -7
- package/package.json +4 -3
- package/components/backer/Component.d.ts +0 -28
- package/components/backer/Component.js +0 -23
- package/components/backer/index.css +0 -34
- package/components/closer/Component.d.ts +0 -24
- package/components/closer/Component.js +0 -28
- package/components/closer/index.css +0 -34
- package/cssm/components/backer/Component.d.ts +0 -28
- package/cssm/components/backer/Component.js +0 -22
- package/cssm/components/backer/index.module.css +0 -33
- package/cssm/components/closer/Component.d.ts +0 -24
- package/cssm/components/closer/Component.js +0 -27
- package/cssm/components/closer/index.module.css +0 -33
- package/esm/components/backer/Component.d.ts +0 -28
- package/esm/components/backer/Component.js +0 -16
- package/esm/components/backer/index.css +0 -34
- package/esm/components/closer/Component.d.ts +0 -24
- package/esm/components/closer/Component.js +0 -21
- package/esm/components/closer/index.css +0 -34
- package/modern/components/backer/Component.d.ts +0 -28
- package/modern/components/backer/Component.js +0 -12
- package/modern/components/backer/index.css +0 -34
- package/modern/components/closer/Component.d.ts +0 -24
- package/modern/components/closer/Component.js +0 -19
- package/modern/components/closer/index.css +0 -34
|
@@ -1,76 +1,15 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { FC,
|
|
5
|
-
import {
|
|
4
|
+
import { FC, HTMLAttributes, ReactNode, RefObject } from "react";
|
|
5
|
+
import { NavigationBarProps } from "@alfalab/core-components-navigation-bar";
|
|
6
6
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
7
7
|
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
8
|
-
type HeaderProps =
|
|
9
|
-
/**
|
|
10
|
-
* Заголовок
|
|
11
|
-
*/
|
|
12
|
-
title?: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Дополнительный класс
|
|
15
|
-
*/
|
|
16
|
-
headerClassName?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Дополнительный класс для аддонов
|
|
19
|
-
*/
|
|
20
|
-
addonClassName?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Дополнительный класс для компонента крестика
|
|
23
|
-
*/
|
|
24
|
-
closerClassName?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Дополнительный класс для компонента стрелки назад
|
|
27
|
-
*/
|
|
28
|
-
backerClassName?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Слот слева
|
|
31
|
-
*/
|
|
32
|
-
leftAddons?: ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Слот справа
|
|
35
|
-
*/
|
|
36
|
-
rightAddons?: ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* Слот снизу
|
|
39
|
-
*/
|
|
40
|
-
bottomAddons?: ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
* Наличие компонента крестика
|
|
43
|
-
*/
|
|
44
|
-
hasCloser?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Наличие компонента стрелки назад
|
|
47
|
-
*/
|
|
48
|
-
hasBacker?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Выравнивание заголовка
|
|
51
|
-
*/
|
|
52
|
-
titleAlign?: BottomSheetTitleAlign;
|
|
53
|
-
/**
|
|
54
|
-
* Будет ли обрезан заголовок
|
|
55
|
-
*/
|
|
56
|
-
trimTitle?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Фиксирует шапку
|
|
59
|
-
*/
|
|
60
|
-
sticky?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Идентификатор для систем автоматизированного тестирования
|
|
63
|
-
*/
|
|
64
|
-
dataTestId?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Обработчик нажатия на стрелку назад
|
|
67
|
-
*/
|
|
68
|
-
onBack?: () => void;
|
|
69
|
-
};
|
|
8
|
+
type HeaderProps = Omit<NavigationBarProps, "view" | "size">;
|
|
70
9
|
declare const Header: FC<HeaderProps>;
|
|
71
10
|
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
72
11
|
declare const isClient: () => boolean;
|
|
73
|
-
type BottomSheetTitleAlign
|
|
12
|
+
type BottomSheetTitleAlign = 'center' | 'left';
|
|
74
13
|
type BottomSheetProps = {
|
|
75
14
|
/**
|
|
76
15
|
* Контент
|
|
@@ -84,6 +23,14 @@ type BottomSheetProps = {
|
|
|
84
23
|
* Заголовок
|
|
85
24
|
*/
|
|
86
25
|
title?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Размер заголовка
|
|
28
|
+
*/
|
|
29
|
+
titleSize?: NavigationBarProps['titleSize'];
|
|
30
|
+
/**
|
|
31
|
+
* Подзаголовок.
|
|
32
|
+
*/
|
|
33
|
+
subtitle?: NavigationBarProps['subtitle'];
|
|
87
34
|
/**
|
|
88
35
|
* Кнопка действия (обычно, это кнопка закрытия)
|
|
89
36
|
*/
|
|
@@ -178,7 +125,7 @@ type BottomSheetProps = {
|
|
|
178
125
|
/**
|
|
179
126
|
* Выравнивание заголовка
|
|
180
127
|
*/
|
|
181
|
-
titleAlign?: BottomSheetTitleAlign
|
|
128
|
+
titleAlign?: BottomSheetTitleAlign;
|
|
182
129
|
/**
|
|
183
130
|
* Фиксирует шапку
|
|
184
131
|
*/
|
|
@@ -236,4 +183,4 @@ type BottomSheetProps = {
|
|
|
236
183
|
declare const HEADER_OFFSET = 24;
|
|
237
184
|
declare const CLOSE_OFFSET = 0.2;
|
|
238
185
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
239
|
-
export { HeaderProps, Header, getDataTestId, isClient, BottomSheetTitleAlign
|
|
186
|
+
export { HeaderProps, Header, getDataTestId, isClient, BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|
|
@@ -8,10 +8,8 @@ var reactSwipeable = require('react-swipeable');
|
|
|
8
8
|
var cn = require('classnames');
|
|
9
9
|
var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
|
|
10
10
|
var components_footer_Component = require('./components/footer/Component.js');
|
|
11
|
-
var
|
|
11
|
+
var coreComponentsNavigationBar = require('@alfalab/core-components-navigation-bar');
|
|
12
12
|
var components_swipeableBackdrop_Component = require('./components/swipeable-backdrop/Component.js');
|
|
13
|
-
var components_backer_Component = require('./components/backer/Component.js');
|
|
14
|
-
var components_closer_Component = require('./components/closer/Component.js');
|
|
15
13
|
|
|
16
14
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
15
|
|
|
@@ -24,57 +22,28 @@ var getDataTestId = function (dataTestId, element) {
|
|
|
24
22
|
return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
|
|
25
23
|
};
|
|
26
24
|
|
|
27
|
-
var styles$1 = {"headerWrapper":"bottom-
|
|
25
|
+
var styles$1 = {"headerWrapper":"bottom-sheet__headerWrapper_1vrpq","hasContent":"bottom-sheet__hasContent_1vrpq","header":"bottom-sheet__header_1vrpq","sticky":"bottom-sheet__sticky_1vrpq","highlighted":"bottom-sheet__highlighted_1vrpq","justifyEnd":"bottom-sheet__justifyEnd_1vrpq","addon":"bottom-sheet__addon_1vrpq","addonFixed":"bottom-sheet__addonFixed_1vrpq","title":"bottom-sheet__title_1vrpq","titleCenter":"bottom-sheet__titleCenter_1vrpq","titleLeft":"bottom-sheet__titleLeft_1vrpq","trimTitle":"bottom-sheet__trimTitle_1vrpq"};
|
|
28
26
|
require('./components/header/index.css')
|
|
29
27
|
|
|
30
28
|
var Header = function (_a) {
|
|
31
|
-
var _b
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var hasLeftPart = hasBacker || leftAddons || titleAlign === 'center';
|
|
35
|
-
var hasRightPart = hasCloser || rightAddons || titleAlign === 'center';
|
|
36
|
-
var hasHeaderContent = title || hasBacker || hasCloser;
|
|
37
|
-
React.useEffect(function () {
|
|
38
|
-
setHasHeader(true);
|
|
39
|
-
}, [setHasHeader]);
|
|
29
|
+
var _b;
|
|
30
|
+
var className = _a.className, sticky = _a.sticky, title = _a.title, children = _a.children, restProps = tslib.__rest(_a, ["className", "sticky", "title", "children"]);
|
|
31
|
+
var _c = React.useContext(coreComponentsBaseModal.BaseModalContext), setHeaderOffset = _c.setHeaderOffset, setHasHeader = _c.setHasHeader, headerHighlighted = _c.headerHighlighted, onClose = _c.onClose;
|
|
40
32
|
React.useEffect(function () {
|
|
41
33
|
setHeaderOffset(HEADER_OFFSET);
|
|
42
34
|
}, [setHeaderOffset]);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_a[styles$1.titleBigIndentHorizontal] = !sticky && titleAlignedCenter && (hasLeftPart || hasRightPart),
|
|
50
|
-
_a[styles$1.titleIndentLeft] = !sticky && !titleAlignedCenter && hasLeftPart,
|
|
51
|
-
_a[styles$1.titleIndentRight] = !sticky && !titleAlignedCenter && hasRightPart,
|
|
52
|
-
_a));
|
|
53
|
-
};
|
|
54
|
-
return (React__default.default.createElement("div", { className: cn__default.default(styles$1.headerWrapper, headerClassName, (_b = {},
|
|
55
|
-
_b[styles$1.highlighted] = headerHighlighted && sticky,
|
|
35
|
+
React.useEffect(function () {
|
|
36
|
+
setHasHeader(true);
|
|
37
|
+
}, [setHasHeader]);
|
|
38
|
+
var hasContent = Boolean(title || children);
|
|
39
|
+
return (React__default.default.createElement(coreComponentsNavigationBar.NavigationBar, tslib.__assign({}, restProps, { title: title, onClose: onClose, sticky: sticky, view: 'mobile', className: cn__default.default(styles$1.headerWrapper, className, (_b = {},
|
|
40
|
+
_b[styles$1.highlighted] = hasContent && headerHighlighted && sticky,
|
|
56
41
|
_b[styles$1.sticky] = sticky,
|
|
57
|
-
_b
|
|
58
|
-
|
|
59
|
-
_c[styles$1.justifyEnd] = !title,
|
|
60
|
-
_c)) },
|
|
61
|
-
hasLeftPart && (React__default.default.createElement("div", { className: cn__default.default(styles$1.addon, addonClassName, (_d = {},
|
|
62
|
-
_d[styles$1.addonFixed] = !sticky,
|
|
63
|
-
_d[styles$1.addonLeft] = !sticky,
|
|
64
|
-
_d)) }, hasBacker ? (React__default.default.createElement(components_backer_Component.Backer, { className: backerClassName, onClick: onBack, dataTestId: getDataTestId(dataTestId, 'backer') })) : (leftAddons))),
|
|
65
|
-
hasHeaderContent && (React__default.default.createElement(coreComponentsTypography.Typography.Text, { view: 'primary-large', weight: 'bold', className: cn__default.default(styles$1.title, getTitleIndent(), (_e = {},
|
|
66
|
-
_e[styles$1.titleCenter] = titleAlign === 'center',
|
|
67
|
-
_e[styles$1.titleLeft] = titleAlign === 'left',
|
|
68
|
-
_e[styles$1.trimTitle] = trimTitle,
|
|
69
|
-
_e)), color: 'primary', dataTestId: getDataTestId(dataTestId, 'title') }, title)),
|
|
70
|
-
hasRightPart && (React__default.default.createElement("div", { className: cn__default.default(styles$1.addon, addonClassName, (_f = {},
|
|
71
|
-
_f[styles$1.addonFixed] = !sticky,
|
|
72
|
-
_f[styles$1.addonRight] = !sticky,
|
|
73
|
-
_f)) }, hasCloser ? (React__default.default.createElement(components_closer_Component.Closer, { className: closerClassName, dataTestId: getDataTestId(dataTestId, 'closer') })) : (rightAddons)))),
|
|
74
|
-
bottomAddons));
|
|
42
|
+
_b[styles$1.hasContent] = hasContent,
|
|
43
|
+
_b)), contentClassName: cn__default.default(styles$1.title) }), children));
|
|
75
44
|
};
|
|
76
45
|
|
|
77
|
-
var styles = {"modal":"bottom-
|
|
46
|
+
var styles = {"modal":"bottom-sheet__modal_vr4ju","component":"bottom-sheet__component_vr4ju","withTransition":"bottom-sheet__withTransition_vr4ju","scrollableContainer":"bottom-sheet__scrollableContainer_vr4ju","marker":"bottom-sheet__marker_vr4ju","content":"bottom-sheet__content_vr4ju","noHeader":"bottom-sheet__noHeader_vr4ju","noFooter":"bottom-sheet__noFooter_vr4ju","scrollLocked":"bottom-sheet__scrollLocked_vr4ju","appear":"bottom-sheet__appear_vr4ju","enter":"bottom-sheet__enter_vr4ju","appearActive":"bottom-sheet__appearActive_vr4ju","enterActive":"bottom-sheet__enterActive_vr4ju","enterDone":"bottom-sheet__enterDone_vr4ju","appearDone":"bottom-sheet__appearDone_vr4ju","exit":"bottom-sheet__exit_vr4ju","exitActive":"bottom-sheet__exitActive_vr4ju"};
|
|
78
47
|
require('./index.css')
|
|
79
48
|
|
|
80
49
|
var TIMEOUT = 300;
|
|
@@ -87,34 +56,21 @@ var HEADER_OFFSET = 24;
|
|
|
87
56
|
var CLOSE_OFFSET = 0.2;
|
|
88
57
|
var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
89
58
|
var _b, _c, _d;
|
|
90
|
-
var open = _a.open, title = _a.title, container = _a.container, actionButton = _a.actionButton, contentClassName = _a.contentClassName, containerClassName = _a.containerClassName, containerProps = _a.containerProps, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, modalClassName = _a.modalClassName, modalWrapperClassName = _a.modalWrapperClassName, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker,
|
|
91
|
-
var
|
|
92
|
-
var
|
|
93
|
-
var
|
|
59
|
+
var open = _a.open, title = _a.title, container = _a.container, _e = _a.titleSize, titleSize = _e === void 0 ? 'default' : _e, subtitle = _a.subtitle, actionButton = _a.actionButton, contentClassName = _a.contentClassName, containerClassName = _a.containerClassName, containerProps = _a.containerProps, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, addonClassName = _a.addonClassName, closerClassName = _a.closerClassName, backerClassName = _a.backerClassName, modalClassName = _a.modalClassName, modalWrapperClassName = _a.modalWrapperClassName, className = _a.className, leftAddons = _a.leftAddons, rightAddons = _a.rightAddons, bottomAddons = _a.bottomAddons, hasCloser = _a.hasCloser, hasBacker = _a.hasBacker, _f = _a.titleAlign, titleAlign = _f === void 0 ? 'left' : _f, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _g = _a.stickyFooter, stickyFooter = _g === void 0 ? true : _g, _h = _a.initialHeight, initialHeight = _h === void 0 ? 'default' : _h, hideOverlay = _a.hideOverlay, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, children = _a.children, zIndex = _a.zIndex, _j = _a.transitionProps, transitionProps = _j === void 0 ? {} : _j, dataTestId = _a.dataTestId, _k = _a.swipeable, swipeable = _k === void 0 ? true : _k, backdropProps = _a.backdropProps, _l = _a.scrollableContainerRef, scrollableContainerRef = _l === void 0 ? function () { return null; } : _l, onClose = _a.onClose, onBack = _a.onBack;
|
|
60
|
+
var _m = React.useState(0), sheetOffset = _m[0], setSheetOffset = _m[1];
|
|
61
|
+
var _o = React.useState(1), backdropOpacity = _o[0], setBackdropOpacity = _o[1];
|
|
62
|
+
var _p = React.useState(false), scrollLocked = _p[0], setScrollLocked = _p[1];
|
|
94
63
|
var sheetHeight = React.useRef(0);
|
|
95
64
|
var scrollableContainer = React.useRef(null);
|
|
96
65
|
var scrollableContainerScrollValue = React.useRef(0);
|
|
97
|
-
var emptyHeader = !hasCloser && !
|
|
66
|
+
var emptyHeader = !hasCloser && !leftAddons && !title && !hasBacker && !rightAddons;
|
|
98
67
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
99
68
|
var fullHeight = reactDiv100vh.use100vh();
|
|
100
69
|
var targetHeight = "".concat(fullHeight - HEADER_OFFSET, "px");
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
addonClassName: addonClassName,
|
|
105
|
-
closerClassName: closerClassName,
|
|
106
|
-
backerClassName: backerClassName,
|
|
107
|
-
leftAddons: leftAddons,
|
|
108
|
-
rightAddons: rightAddons,
|
|
109
|
-
bottomAddons: bottomAddons,
|
|
110
|
-
hasCloser: hasCloser,
|
|
111
|
-
hasBacker: hasBacker,
|
|
112
|
-
titleAlign: titleAlign,
|
|
113
|
-
trimTitle: trimTitle,
|
|
114
|
-
sticky: stickyHeader,
|
|
115
|
-
dataTestId: getDataTestId(dataTestId, 'header'),
|
|
116
|
-
onBack: onBack,
|
|
117
|
-
};
|
|
70
|
+
var titleIsReactElement = React__default.default.isValidElement(title);
|
|
71
|
+
var headerProps = tslib.__assign(tslib.__assign({}, (titleIsReactElement
|
|
72
|
+
? { children: title }
|
|
73
|
+
: { title: title ? title === null || title === void 0 ? void 0 : title.toString() : undefined })), { parentRef: scrollableContainer, className: headerClassName, addonClassName: addonClassName, closerClassName: closerClassName, backButtonClassName: backerClassName, leftAddons: leftAddons, rightAddons: rightAddons, bottomAddons: bottomAddons, hasCloser: hasCloser, hasBackButton: hasBacker, align: titleAlign, trim: trimTitle, sticky: stickyHeader, dataTestId: getDataTestId(dataTestId, 'header'), onBack: onBack, titleSize: titleSize, subtitle: subtitle, onClose: onClose });
|
|
118
74
|
var getBackdropOpacity = function (offset) {
|
|
119
75
|
if (sheetHeight.current === 0)
|
|
120
76
|
return MIN_BACKDROP_OPACITY;
|
package/component.js
CHANGED
|
@@ -7,15 +7,10 @@ require('react-merge-refs');
|
|
|
7
7
|
require('react-swipeable');
|
|
8
8
|
require('classnames');
|
|
9
9
|
require('@alfalab/core-components-base-modal');
|
|
10
|
-
var components_header_Component = require('./component-
|
|
10
|
+
var components_header_Component = require('./component-4db10e00.js');
|
|
11
11
|
require('./components/footer/Component.js');
|
|
12
12
|
require('./components/swipeable-backdrop/Component.js');
|
|
13
|
-
require('@alfalab/core-components-
|
|
14
|
-
require('./components/backer/Component.js');
|
|
15
|
-
require('@alfalab/core-components-icon-button');
|
|
16
|
-
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
17
|
-
require('./components/closer/Component.js');
|
|
18
|
-
require('@alfalab/icons-glyph/CrossMIcon');
|
|
13
|
+
require('@alfalab/core-components-navigation-bar');
|
|
19
14
|
require('@alfalab/core-components-backdrop');
|
|
20
15
|
|
|
21
16
|
|
|
@@ -9,7 +9,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
10
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
11
11
|
|
|
12
|
-
var styles = {"footer":"bottom-
|
|
12
|
+
var styles = {"footer":"bottom-sheet__footer_1nwuz","sticky":"bottom-sheet__sticky_1nwuz","highlighted":"bottom-sheet__highlighted_1nwuz"};
|
|
13
13
|
require('./index.css')
|
|
14
14
|
|
|
15
15
|
var Footer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1szsw */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
} :root {
|
|
21
21
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-primary);
|
|
22
22
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
23
|
-
} .bottom-
|
|
23
|
+
} .bottom-sheet__footer_1nwuz {
|
|
24
24
|
padding: var(--gap-m) var(--gap-m);
|
|
25
25
|
background-color: var(--color-light-bg-primary);
|
|
26
|
-
} .bottom-
|
|
26
|
+
} .bottom-sheet__sticky_1nwuz {
|
|
27
27
|
position: sticky;
|
|
28
28
|
bottom: 0;
|
|
29
|
-
} .bottom-
|
|
29
|
+
} .bottom-sheet__highlighted_1nwuz {
|
|
30
30
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
31
31
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
32
32
|
}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
require('tslib');
|
|
3
4
|
require('react');
|
|
4
5
|
require('classnames');
|
|
5
6
|
require('@alfalab/core-components-base-modal');
|
|
6
|
-
require('@alfalab/core-components-
|
|
7
|
-
var components_header_Component = require('../../component-
|
|
8
|
-
require('../backer/Component.js');
|
|
9
|
-
require('../closer/Component.js');
|
|
10
|
-
require('tslib');
|
|
7
|
+
require('@alfalab/core-components-navigation-bar');
|
|
8
|
+
var components_header_Component = require('../../component-4db10e00.js');
|
|
11
9
|
require('react-div-100vh');
|
|
12
10
|
require('react-merge-refs');
|
|
13
11
|
require('react-swipeable');
|
|
14
12
|
require('../footer/Component.js');
|
|
15
13
|
require('../swipeable-backdrop/Component.js');
|
|
16
14
|
require('@alfalab/core-components-backdrop');
|
|
17
|
-
require('@alfalab/core-components-icon-button');
|
|
18
|
-
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
19
|
-
require('@alfalab/icons-glyph/CrossMIcon');
|
|
20
15
|
|
|
21
16
|
|
|
22
17
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: pjweg */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-primary: #fff;
|
|
5
|
+
--color-light-border-primary: #dbdee1;
|
|
5
6
|
} :root {
|
|
6
7
|
} :root {
|
|
7
8
|
} :root {
|
|
@@ -16,68 +17,54 @@
|
|
|
16
17
|
} :root {
|
|
17
18
|
--gap-2xs: 4px;
|
|
18
19
|
--gap-xs: 8px;
|
|
19
|
-
--gap-
|
|
20
|
+
--gap-s: 12px;
|
|
20
21
|
} :root {
|
|
21
22
|
--font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
|
|
22
23
|
sans-serif;
|
|
23
24
|
} :root {
|
|
24
25
|
} :root {
|
|
25
|
-
--bottom-sheet-header-border-bottom:
|
|
26
|
+
--bottom-sheet-header-border-bottom: 1px solid var(--color-light-border-primary);
|
|
26
27
|
--bottom-sheet-title-font-size: 18px;
|
|
27
28
|
--bottom-sheet-title-font-weight: 700;
|
|
28
29
|
--bottom-sheet-title-line-height: 24px;
|
|
29
30
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
padding: var(--gap-xs);
|
|
33
|
-
padding-bottom: 0;
|
|
34
|
-
background-color: var(--color-light-bg-primary);
|
|
31
|
+
} .bottom-sheet__headerWrapper_1vrpq {
|
|
32
|
+
padding: var(--gap-s) var(--gap-xs) var(--gap-2xs);
|
|
35
33
|
border-top-right-radius: var(--border-radius-xl);
|
|
36
34
|
border-top-left-radius: var(--border-radius-xl);
|
|
37
35
|
z-index: 1;
|
|
38
|
-
} .bottom-
|
|
36
|
+
} .bottom-sheet__hasContent_1vrpq {
|
|
37
|
+
background-color: var(--color-light-bg-primary);
|
|
38
|
+
} .bottom-sheet__header_1vrpq {
|
|
39
39
|
display: flex;
|
|
40
|
-
} .bottom-
|
|
40
|
+
} .bottom-sheet__sticky_1vrpq {
|
|
41
41
|
position: sticky;
|
|
42
42
|
top: 0;
|
|
43
|
-
} .bottom-
|
|
43
|
+
} .bottom-sheet__highlighted_1vrpq {
|
|
44
44
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
45
|
-
} .bottom-
|
|
45
|
+
} .bottom-sheet__justifyEnd_1vrpq {
|
|
46
46
|
justify-content: flex-end;
|
|
47
|
-
} .bottom-
|
|
47
|
+
} .bottom-sheet__addon_1vrpq {
|
|
48
48
|
display: flex;
|
|
49
49
|
justify-content: center;
|
|
50
50
|
align-items: center;
|
|
51
51
|
min-width: 48px;
|
|
52
52
|
height: 48px;
|
|
53
|
-
} .bottom-
|
|
53
|
+
} .bottom-sheet__addonFixed_1vrpq {
|
|
54
54
|
position: fixed;
|
|
55
|
-
} .bottom-
|
|
56
|
-
|
|
57
|
-
margin-left: var(--gap-xs);
|
|
58
|
-
} .bottom-sheet__addonRight_1veed {
|
|
59
|
-
right: 0;
|
|
60
|
-
margin-right: var(--gap-xs);
|
|
61
|
-
} .bottom-sheet__title_1veed {
|
|
62
|
-
padding: var(--gap-xs) var(--gap-xs);
|
|
63
|
-
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
55
|
+
} .bottom-sheet__title_1vrpq {
|
|
56
|
+
padding: var(--gap-s) var(--gap-xs);
|
|
64
57
|
width: 100%;
|
|
65
58
|
font-size: var(--bottom-sheet-title-font-size);
|
|
66
59
|
font-weight: var(--bottom-sheet-title-font-weight);
|
|
67
60
|
line-height: var(--bottom-sheet-title-line-height);
|
|
68
61
|
font-family: var(--bottom-sheet-title-font-family);
|
|
69
|
-
} .bottom-
|
|
62
|
+
} .bottom-sheet__titleCenter_1vrpq {
|
|
70
63
|
text-align: center;
|
|
71
|
-
} .bottom-
|
|
64
|
+
} .bottom-sheet__titleLeft_1vrpq {
|
|
72
65
|
text-align: left;
|
|
73
|
-
} .bottom-
|
|
66
|
+
} .bottom-sheet__trimTitle_1vrpq {
|
|
74
67
|
white-space: nowrap;
|
|
75
68
|
overflow: hidden;
|
|
76
69
|
text-overflow: ellipsis;
|
|
77
|
-
} .bottom-sheet__titleBigIndentHorizontal_1veed {
|
|
78
|
-
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
79
|
-
} .bottom-sheet__titleIndentRight_1veed {
|
|
80
|
-
margin-right: var(--gap-4xl);
|
|
81
|
-
} .bottom-sheet__titleIndentLeft_1veed {
|
|
82
|
-
margin-left: var(--gap-4xl);
|
|
83
70
|
}
|
|
@@ -1,76 +1,15 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { FC,
|
|
5
|
-
import {
|
|
4
|
+
import { FC, HTMLAttributes, ReactNode, RefObject } from "react";
|
|
5
|
+
import { NavigationBarProps } from "@alfalab/core-components-navigation-bar";
|
|
6
6
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
7
7
|
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
8
|
-
type HeaderProps =
|
|
9
|
-
/**
|
|
10
|
-
* Заголовок
|
|
11
|
-
*/
|
|
12
|
-
title?: ReactNode;
|
|
13
|
-
/**
|
|
14
|
-
* Дополнительный класс
|
|
15
|
-
*/
|
|
16
|
-
headerClassName?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Дополнительный класс для аддонов
|
|
19
|
-
*/
|
|
20
|
-
addonClassName?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Дополнительный класс для компонента крестика
|
|
23
|
-
*/
|
|
24
|
-
closerClassName?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Дополнительный класс для компонента стрелки назад
|
|
27
|
-
*/
|
|
28
|
-
backerClassName?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Слот слева
|
|
31
|
-
*/
|
|
32
|
-
leftAddons?: ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* Слот справа
|
|
35
|
-
*/
|
|
36
|
-
rightAddons?: ReactNode;
|
|
37
|
-
/**
|
|
38
|
-
* Слот снизу
|
|
39
|
-
*/
|
|
40
|
-
bottomAddons?: ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
* Наличие компонента крестика
|
|
43
|
-
*/
|
|
44
|
-
hasCloser?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Наличие компонента стрелки назад
|
|
47
|
-
*/
|
|
48
|
-
hasBacker?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Выравнивание заголовка
|
|
51
|
-
*/
|
|
52
|
-
titleAlign?: BottomSheetTitleAlign;
|
|
53
|
-
/**
|
|
54
|
-
* Будет ли обрезан заголовок
|
|
55
|
-
*/
|
|
56
|
-
trimTitle?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Фиксирует шапку
|
|
59
|
-
*/
|
|
60
|
-
sticky?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Идентификатор для систем автоматизированного тестирования
|
|
63
|
-
*/
|
|
64
|
-
dataTestId?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Обработчик нажатия на стрелку назад
|
|
67
|
-
*/
|
|
68
|
-
onBack?: () => void;
|
|
69
|
-
};
|
|
8
|
+
type HeaderProps = Omit<NavigationBarProps, "view" | "size">;
|
|
70
9
|
declare const Header: FC<HeaderProps>;
|
|
71
10
|
declare const getDataTestId: (dataTestId?: string, element?: string) => string | undefined;
|
|
72
11
|
declare const isClient: () => boolean;
|
|
73
|
-
type BottomSheetTitleAlign
|
|
12
|
+
type BottomSheetTitleAlign = 'center' | 'left';
|
|
74
13
|
type BottomSheetProps = {
|
|
75
14
|
/**
|
|
76
15
|
* Контент
|
|
@@ -84,6 +23,14 @@ type BottomSheetProps = {
|
|
|
84
23
|
* Заголовок
|
|
85
24
|
*/
|
|
86
25
|
title?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Размер заголовка
|
|
28
|
+
*/
|
|
29
|
+
titleSize?: NavigationBarProps['titleSize'];
|
|
30
|
+
/**
|
|
31
|
+
* Подзаголовок.
|
|
32
|
+
*/
|
|
33
|
+
subtitle?: NavigationBarProps['subtitle'];
|
|
87
34
|
/**
|
|
88
35
|
* Кнопка действия (обычно, это кнопка закрытия)
|
|
89
36
|
*/
|
|
@@ -178,7 +125,7 @@ type BottomSheetProps = {
|
|
|
178
125
|
/**
|
|
179
126
|
* Выравнивание заголовка
|
|
180
127
|
*/
|
|
181
|
-
titleAlign?: BottomSheetTitleAlign
|
|
128
|
+
titleAlign?: BottomSheetTitleAlign;
|
|
182
129
|
/**
|
|
183
130
|
* Фиксирует шапку
|
|
184
131
|
*/
|
|
@@ -236,4 +183,4 @@ type BottomSheetProps = {
|
|
|
236
183
|
declare const HEADER_OFFSET = 24;
|
|
237
184
|
declare const CLOSE_OFFSET = 0.2;
|
|
238
185
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
239
|
-
export { HeaderProps, Header, getDataTestId, isClient, BottomSheetTitleAlign
|
|
186
|
+
export { HeaderProps, Header, getDataTestId, isClient, BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|