@alfalab/core-components-bottom-sheet 3.1.0 → 4.0.1
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/CHANGELOG.md +36 -0
- package/dist/component-99884ac1.d.ts +181 -0
- package/dist/component-99884ac1.js +239 -0
- package/dist/component.d.ts +0 -55
- package/dist/component.js +18 -144
- package/dist/components/backer/Component.d.ts +24 -0
- package/dist/components/backer/Component.js +25 -0
- package/dist/components/backer/index.css +20 -0
- package/dist/components/closer/Component.d.ts +20 -0
- package/dist/components/closer/Component.js +30 -0
- package/dist/components/closer/index.css +20 -0
- package/dist/components/footer/Component.d.ts +4 -0
- package/dist/components/footer/Component.js +4 -3
- package/dist/components/footer/index.css +14 -8
- package/dist/components/header/Component.d.ts +0 -0
- package/dist/components/header/Component.js +24 -0
- package/dist/components/header/index.css +99 -0
- package/dist/components/swipeable-backdrop/Component.d.ts +19 -0
- package/dist/components/swipeable-backdrop/Component.js +12 -4
- package/dist/cssm/component-1deadd87.d.ts +181 -0
- package/dist/cssm/component-1deadd87.js +237 -0
- package/dist/cssm/component.d.ts +0 -55
- package/dist/cssm/component.js +22 -143
- package/dist/cssm/components/backer/Component.d.ts +24 -0
- package/dist/cssm/components/backer/Component.js +24 -0
- package/dist/cssm/components/backer/index.module.css +19 -0
- package/dist/cssm/components/closer/Component.d.ts +20 -0
- package/dist/cssm/components/closer/Component.js +29 -0
- package/dist/cssm/components/closer/index.module.css +19 -0
- package/dist/cssm/components/footer/Component.d.ts +4 -0
- package/dist/cssm/components/footer/Component.js +3 -2
- package/dist/cssm/components/footer/index.module.css +11 -5
- package/dist/cssm/components/header/Component.d.ts +0 -0
- package/dist/cssm/components/header/Component.js +29 -0
- package/dist/cssm/components/header/index.module.css +98 -0
- package/dist/cssm/components/swipeable-backdrop/Component.d.ts +19 -0
- package/dist/cssm/components/swipeable-backdrop/Component.js +12 -4
- package/dist/cssm/index.d.ts +1 -1
- package/dist/cssm/index.js +15 -4
- package/dist/cssm/index.module.css +24 -18
- package/dist/{Component-843c49d1.d.ts → cssm/tslib.es6-ce870b46.d.ts} +1 -19
- package/dist/{Component-843c49d1.js → cssm/tslib.es6-ce870b46.js} +1 -14
- package/dist/esm/component-dbec5cad.d.ts +181 -0
- package/dist/esm/component-dbec5cad.js +229 -0
- package/dist/esm/component.d.ts +0 -55
- package/dist/esm/component.js +15 -141
- package/dist/esm/components/backer/Component.d.ts +24 -0
- package/dist/esm/components/backer/Component.js +16 -0
- package/dist/esm/components/backer/index.css +20 -0
- package/dist/esm/components/closer/Component.d.ts +20 -0
- package/dist/esm/components/closer/Component.js +21 -0
- package/dist/esm/components/closer/index.css +20 -0
- package/dist/esm/components/footer/Component.d.ts +4 -0
- package/dist/esm/components/footer/Component.js +4 -3
- package/dist/esm/components/footer/index.css +14 -8
- package/dist/esm/components/header/Component.d.ts +0 -0
- package/dist/esm/components/header/Component.js +16 -0
- package/dist/esm/components/header/index.css +99 -0
- package/dist/esm/components/swipeable-backdrop/Component.d.ts +19 -0
- package/dist/esm/components/swipeable-backdrop/Component.js +11 -3
- package/dist/esm/index.css +36 -30
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +9 -2
- package/dist/esm/{Component-4a0a88e8.d.ts → tslib.es6-eedcd3d6.d.ts} +1 -19
- package/dist/esm/{Component-4a0a88e8.js → tslib.es6-eedcd3d6.js} +1 -10
- package/dist/index.css +36 -30
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -4
- package/dist/modern/component-5b171f70.d.ts +181 -0
- package/dist/modern/component-5b171f70.js +230 -0
- package/dist/modern/component.d.ts +0 -55
- package/dist/modern/component.js +14 -143
- package/dist/modern/components/backer/Component.d.ts +24 -0
- package/dist/modern/components/backer/Component.js +14 -0
- package/dist/modern/components/backer/index.css +20 -0
- package/dist/modern/components/closer/Component.d.ts +20 -0
- package/dist/modern/components/closer/Component.js +19 -0
- package/dist/modern/components/closer/index.css +20 -0
- package/dist/modern/components/footer/Component.d.ts +4 -0
- package/dist/modern/components/footer/Component.js +4 -3
- package/dist/modern/components/footer/index.css +14 -8
- package/dist/modern/components/header/Component.d.ts +0 -0
- package/dist/modern/components/header/Component.js +15 -0
- package/dist/modern/components/header/index.css +99 -0
- package/dist/modern/index.css +36 -30
- package/dist/modern/index.d.ts +1 -1
- package/dist/modern/index.js +7 -1
- package/dist/{cssm/Component-24200d96.d.ts → tslib.es6-1f6a7f15.d.ts} +1 -19
- package/dist/{cssm/Component-24200d96.js → tslib.es6-1f6a7f15.js} +1 -14
- package/package.json +6 -4
package/dist/component.js
CHANGED
|
@@ -2,151 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
require('./tslib.es6-1f6a7f15.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('react-div-100vh');
|
|
9
|
+
require('react-swipeable');
|
|
10
|
+
require('@alfalab/core-components-base-modal');
|
|
11
|
+
require('@alfalab/core-components-typography');
|
|
12
|
+
require('@alfalab/core-components-icon-button');
|
|
13
|
+
require('@alfalab/icons-glyph/CrossMIcon');
|
|
14
|
+
require('./components/closer/Component.js');
|
|
15
|
+
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
16
|
+
require('./components/backer/Component.js');
|
|
17
|
+
var components_header_Component = require('./component-99884ac1.js');
|
|
18
|
+
require('./components/footer/Component.js');
|
|
12
19
|
require('@alfalab/core-components-backdrop');
|
|
20
|
+
require('./components/swipeable-backdrop/Component.js');
|
|
13
21
|
|
|
14
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
22
|
|
|
16
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
-
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var TIMEOUT = 300;
|
|
23
|
-
var SWIPE_CLOSE_VELOCITY = 0.4;
|
|
24
|
-
var MIN_BACKDROP_OPACITY = 0.2;
|
|
25
|
-
var CLOSE_OFFSET = 0.2;
|
|
26
|
-
var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
27
|
-
var _b, _c;
|
|
28
|
-
var open = _a.open, title = _a.title, actionButton = _a.actionButton, contentClassName = _a.contentClassName, className = _a.className, children = _a.children, zIndex = _a.zIndex, _d = _a.transitionProps, transitionProps = _d === void 0 ? {} : _d, dataTestId = _a.dataTestId, _e = _a.desktopSwipeable, trackMouse = _e === void 0 ? false : _e, onClose = _a.onClose;
|
|
29
|
-
var _f = React.useState(0), sheetOffset = _f[0], setSheetOffset = _f[1];
|
|
30
|
-
var _g = React.useState(1), backdropOpacity = _g[0], setBackdropOpacity = _g[1];
|
|
31
|
-
var _h = React.useState(false), scrollLocked = _h[0], setScrollLocked = _h[1];
|
|
32
|
-
var sheetHeight = React.useRef(0);
|
|
33
|
-
var scrollableContainer = React.useRef(null);
|
|
34
|
-
var scrollableContainerScrollValue = React.useRef(0);
|
|
35
|
-
var getBackdropOpacity = function (offset) {
|
|
36
|
-
if (sheetHeight.current === 0)
|
|
37
|
-
return MIN_BACKDROP_OPACITY;
|
|
38
|
-
var opacity = 1 - (1 - MIN_BACKDROP_OPACITY) * (offset / sheetHeight.current);
|
|
39
|
-
return Number(opacity.toFixed(2));
|
|
40
|
-
};
|
|
41
|
-
var getSheetOffset = function (deltaY) {
|
|
42
|
-
var offset = deltaY > 0 ? 0 : -deltaY;
|
|
43
|
-
offset -= scrollableContainerScrollValue.current;
|
|
44
|
-
return Math.floor(Math.max(0, offset));
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Если контент внутри шторки скроллится - то шторка не должна свайпаться
|
|
48
|
-
*/
|
|
49
|
-
var shouldSkipSwiping = function () {
|
|
50
|
-
if (!scrollableContainer.current) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
if (!scrollableContainerScrollValue.current) {
|
|
54
|
-
scrollableContainerScrollValue.current = Math.floor(scrollableContainer.current.scrollTop);
|
|
55
|
-
}
|
|
56
|
-
return scrollableContainer.current.scrollTop > 0;
|
|
57
|
-
};
|
|
58
|
-
var handleBackdropSwipedDown = function (_a) {
|
|
59
|
-
var velocity = _a.velocity;
|
|
60
|
-
if (velocity > SWIPE_CLOSE_VELOCITY) {
|
|
61
|
-
onClose();
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var handleSheetSwipedDown = function (_a) {
|
|
65
|
-
var velocity = _a.velocity;
|
|
66
|
-
if (shouldSkipSwiping()) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
var shouldClose = sheetOffset > sheetHeight.current * CLOSE_OFFSET || velocity > SWIPE_CLOSE_VELOCITY;
|
|
70
|
-
if (shouldClose) {
|
|
71
|
-
onClose();
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
setSheetOffset(0);
|
|
75
|
-
setBackdropOpacity(1);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var handleSheetSwiped = function () {
|
|
79
|
-
setScrollLocked(false);
|
|
80
|
-
scrollableContainerScrollValue.current = 0;
|
|
81
|
-
};
|
|
82
|
-
var handleSheetSwiping = function (_a) {
|
|
83
|
-
var deltaY = _a.deltaY;
|
|
84
|
-
if (shouldSkipSwiping()) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
var offset = getSheetOffset(deltaY);
|
|
88
|
-
var opacity = getBackdropOpacity(offset);
|
|
89
|
-
setSheetOffset(offset);
|
|
90
|
-
setBackdropOpacity(opacity);
|
|
91
|
-
/**
|
|
92
|
-
* Если шторка начинает свайпаться, то блокируем скролл внутри нее
|
|
93
|
-
*/
|
|
94
|
-
if (offset > 0) {
|
|
95
|
-
setScrollLocked(true);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var backdropSwipeablehandlers = reactSwipeable.useSwipeable({
|
|
99
|
-
onSwipedDown: handleBackdropSwipedDown,
|
|
100
|
-
delta: 100,
|
|
101
|
-
trackMouse: trackMouse,
|
|
102
|
-
});
|
|
103
|
-
var sheetSwipeablehandlers = reactSwipeable.useSwipeable({
|
|
104
|
-
onSwiping: handleSheetSwiping,
|
|
105
|
-
onSwipedDown: handleSheetSwipedDown,
|
|
106
|
-
onSwiped: handleSheetSwiped,
|
|
107
|
-
delta: 5,
|
|
108
|
-
trackMouse: trackMouse,
|
|
109
|
-
});
|
|
110
|
-
var handleExited = React.useCallback(function (node) {
|
|
111
|
-
setBackdropOpacity(1);
|
|
112
|
-
if (transitionProps.onExited) {
|
|
113
|
-
transitionProps.onExited(node);
|
|
114
|
-
}
|
|
115
|
-
}, [transitionProps]);
|
|
116
|
-
var handleEntered = React.useCallback(function (node, isAppearing) {
|
|
117
|
-
if (!sheetHeight.current) {
|
|
118
|
-
sheetHeight.current = node.getBoundingClientRect().height;
|
|
119
|
-
}
|
|
120
|
-
setBackdropOpacity(1);
|
|
121
|
-
if (transitionProps.onEntered) {
|
|
122
|
-
transitionProps.onEntered(node, isAppearing);
|
|
123
|
-
}
|
|
124
|
-
}, [transitionProps]);
|
|
125
|
-
React.useEffect(function () {
|
|
126
|
-
if (!open) {
|
|
127
|
-
setSheetOffset(0);
|
|
128
|
-
}
|
|
129
|
-
}, [open]);
|
|
130
|
-
var getSwipeStyles = function () { return ({
|
|
131
|
-
transform: sheetOffset ? "translateY(" + sheetOffset + "px)" : '',
|
|
132
|
-
}); };
|
|
133
|
-
return (React__default['default'].createElement(coreComponentsBaseModal.BaseModal, { open: open, ref: ref, dataTestId: dataTestId, zIndex: zIndex, onClose: onClose, scrollHandler: scrollableContainer, Backdrop: components_swipeableBackdrop_Component.SwipeableBackdrop, backdropProps: {
|
|
134
|
-
opacity: backdropOpacity,
|
|
135
|
-
handlers: backdropSwipeablehandlers,
|
|
136
|
-
opacityTimeout: TIMEOUT,
|
|
137
|
-
}, className: styles.modal, transitionProps: components_swipeableBackdrop_Component.__assign(components_swipeableBackdrop_Component.__assign({ appear: true, timeout: TIMEOUT, classNames: styles }, transitionProps), { onExited: handleExited, onEntered: handleEntered }) },
|
|
138
|
-
React__default['default'].createElement("div", components_swipeableBackdrop_Component.__assign({ className: cn__default['default'](styles.component, className, (_b = {},
|
|
139
|
-
_b[styles.withTransition] = !sheetOffset,
|
|
140
|
-
_b)), style: getSwipeStyles() }, sheetSwipeablehandlers),
|
|
141
|
-
React__default['default'].createElement("div", { className: styles.marker }),
|
|
142
|
-
React__default['default'].createElement("div", { className: cn__default['default'](styles.scrollableContainer, (_c = {},
|
|
143
|
-
_c[styles.scrollLocked] = scrollLocked,
|
|
144
|
-
_c[styles.withPadding] = !actionButton,
|
|
145
|
-
_c)), ref: scrollableContainer },
|
|
146
|
-
title && (React__default['default'].createElement(coreComponentsTypography.Typography.Title, { view: 'small', font: 'system', tag: 'h2', className: styles.title, color: 'primary' }, title)),
|
|
147
|
-
React__default['default'].createElement("div", { className: cn__default['default'](styles.content, contentClassName) }, children),
|
|
148
|
-
actionButton && React__default['default'].createElement(components_footer_Component.Footer, null, actionButton)))));
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
exports.BottomSheet = BottomSheet;
|
|
152
|
-
exports.CLOSE_OFFSET = CLOSE_OFFSET;
|
|
24
|
+
exports.BottomSheet = components_header_Component.BottomSheet;
|
|
25
|
+
exports.CLOSE_OFFSET = components_header_Component.CLOSE_OFFSET;
|
|
26
|
+
exports.HEADER_OFFSET = components_header_Component.HEADER_OFFSET;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonHTMLAttributes, ElementType } from "react";
|
|
4
|
+
import { IconButtonProps } from "@alfalab/core-components-icon-button";
|
|
5
|
+
type BackerProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Размер кнопки
|
|
12
|
+
*/
|
|
13
|
+
size?: IconButtonProps['size'];
|
|
14
|
+
/**
|
|
15
|
+
* Иконка
|
|
16
|
+
*/
|
|
17
|
+
icon?: ElementType;
|
|
18
|
+
/**
|
|
19
|
+
* Обработчик нажатия
|
|
20
|
+
*/
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
};
|
|
23
|
+
declare const Backer: React.FC<BackerProps>;
|
|
24
|
+
export { BackerProps, Backer };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-1f6a7f15.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
|
|
9
|
+
var ArrowBackMIcon = require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
15
|
+
|
|
16
|
+
var styles = {"backer":"bottom-sheet__backer_1wvld","button":"bottom-sheet__button_1wvld"};
|
|
17
|
+
require('./index.css')
|
|
18
|
+
|
|
19
|
+
var Backer = function (_a) {
|
|
20
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? 'xs' : _b, _c = _a.icon, icon = _c === void 0 ? ArrowBackMIcon.ArrowBackMIcon : _c, onClick = _a.onClick, restProps = tslib_es6.__rest(_a, ["className", "size", "icon", "onClick"]);
|
|
21
|
+
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.backer, className) },
|
|
22
|
+
React__default['default'].createElement(coreComponentsIconButton.IconButton, tslib_es6.__assign({ size: size, className: styles.button, "aria-label": '\u043D\u0430\u0437\u0430\u0434', onClick: onClick, icon: icon }, restProps))));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.Backer = Backer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* hash: 1q51x */
|
|
2
|
+
:root {
|
|
3
|
+
--bottom-sheet-backer-bg-color: var(--color-light-bg-primary-alpha-40);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.bottom-sheet__backer_1wvld {
|
|
7
|
+
width: 32px;
|
|
8
|
+
height: 32px;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.bottom-sheet__button_1wvld {
|
|
16
|
+
background: var(--bottom-sheet-backer-bg-color);
|
|
17
|
+
-webkit-backdrop-filter: blur(10px);
|
|
18
|
+
backdrop-filter: blur(10px);
|
|
19
|
+
border-radius: 50px;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonHTMLAttributes, ElementType } from "react";
|
|
4
|
+
import { IconButtonProps } from "@alfalab/core-components-icon-button";
|
|
5
|
+
type CloserProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
/**
|
|
7
|
+
* Дополнительный класс
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Размер кнопки
|
|
12
|
+
*/
|
|
13
|
+
size?: IconButtonProps['size'];
|
|
14
|
+
/**
|
|
15
|
+
* Иконка
|
|
16
|
+
*/
|
|
17
|
+
icon?: ElementType;
|
|
18
|
+
};
|
|
19
|
+
declare const Closer: React.FC<CloserProps>;
|
|
20
|
+
export { CloserProps, Closer };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-1f6a7f15.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var cn = require('classnames');
|
|
8
|
+
var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
|
|
9
|
+
var coreComponentsIconButton = require('@alfalab/core-components-icon-button');
|
|
10
|
+
var CrossMIcon = require('@alfalab/icons-glyph/CrossMIcon');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
16
|
+
|
|
17
|
+
var styles = {"closer":"bottom-sheet__closer_cc5pc","button":"bottom-sheet__button_cc5pc"};
|
|
18
|
+
require('./index.css')
|
|
19
|
+
|
|
20
|
+
var Closer = function (_a) {
|
|
21
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? 'xs' : _b, _c = _a.icon, icon = _c === void 0 ? CrossMIcon.CrossMIcon : _c, restProps = tslib_es6.__rest(_a, ["className", "size", "icon"]);
|
|
22
|
+
var onClose = React.useContext(coreComponentsBaseModal.BaseModalContext).onClose;
|
|
23
|
+
var handleClick = React.useCallback(function (event) {
|
|
24
|
+
onClose(event, 'closerClick');
|
|
25
|
+
}, [onClose]);
|
|
26
|
+
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.closer, className) },
|
|
27
|
+
React__default['default'].createElement(coreComponentsIconButton.IconButton, tslib_es6.__assign({ size: size, className: styles.button, "aria-label": '\u0437\u0430\u043A\u0440\u044B\u0442\u044C', onClick: handleClick, icon: icon }, restProps))));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.Closer = Closer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* hash: 1s5go */
|
|
2
|
+
:root {
|
|
3
|
+
--bottom-sheet-closer-bg-color: var(--color-light-bg-primary-alpha-40);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.bottom-sheet__closer_cc5pc {
|
|
7
|
+
width: 32px;
|
|
8
|
+
height: 32px;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.bottom-sheet__button_cc5pc {
|
|
16
|
+
background: var(--bottom-sheet-closer-bg-color);
|
|
17
|
+
-webkit-backdrop-filter: blur(10px);
|
|
18
|
+
backdrop-filter: blur(10px);
|
|
19
|
+
border-radius: 50px;
|
|
20
|
+
}
|
|
@@ -11,18 +11,19 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
12
|
var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
|
|
13
13
|
|
|
14
|
-
var styles = {"footer":"bottom-
|
|
14
|
+
var styles = {"footer":"bottom-sheet__footer_10r52","sticky":"bottom-sheet__sticky_10r52","highlighted":"bottom-sheet__highlighted_10r52"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var Footer = function (_a) {
|
|
18
18
|
var _b;
|
|
19
|
-
var children = _a.children, className = _a.className;
|
|
19
|
+
var children = _a.children, className = _a.className, sticky = _a.sticky;
|
|
20
20
|
var _c = React.useContext(coreComponentsBaseModal.BaseModalContext), footerHighlighted = _c.footerHighlighted, setHasFooter = _c.setHasFooter;
|
|
21
21
|
React.useEffect(function () {
|
|
22
22
|
setHasFooter(true);
|
|
23
23
|
}, [setHasFooter]);
|
|
24
24
|
return (React__default['default'].createElement("div", { className: cn__default['default'](styles.footer, className, (_b = {},
|
|
25
|
-
_b[styles.
|
|
25
|
+
_b[styles.sticky] = sticky,
|
|
26
|
+
_b[styles.highlighted] = footerHighlighted && sticky,
|
|
26
27
|
_b)) }, children));
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1s9q9 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
|
+
--color-light-border-primary: #dbdee1;
|
|
4
5
|
}
|
|
5
6
|
:root {
|
|
6
7
|
|
|
7
8
|
/* Hard */
|
|
8
9
|
|
|
9
10
|
/* Up */
|
|
10
|
-
--shadow-s-up: 0 0 8px rgba(11, 31, 53, 0.04), 0 -4px 8px rgba(11, 31, 53, 0.08);
|
|
11
11
|
|
|
12
12
|
/* Hard up */
|
|
13
13
|
}
|
|
14
14
|
:root {
|
|
15
15
|
--gap-m: 16px;
|
|
16
|
-
--gap-3xl: 40px;
|
|
17
16
|
}
|
|
18
|
-
|
|
17
|
+
:root {
|
|
18
|
+
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-primary);
|
|
19
|
+
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
20
|
+
}
|
|
21
|
+
.bottom-sheet__footer_10r52 {
|
|
22
|
+
padding: var(--gap-m) var(--gap-m);
|
|
23
|
+
background-color: var(--color-light-bg-primary);
|
|
24
|
+
}
|
|
25
|
+
.bottom-sheet__sticky_10r52 {
|
|
19
26
|
position: sticky;
|
|
20
27
|
bottom: 0;
|
|
21
|
-
padding: var(--gap-m) var(--gap-m) var(--gap-3xl);
|
|
22
|
-
background-color: var(--color-light-bg-primary);
|
|
23
28
|
}
|
|
24
|
-
.bottom-
|
|
25
|
-
|
|
29
|
+
.bottom-sheet__highlighted_10r52 {
|
|
30
|
+
border-top: var(--bottom-sheet-footer-border-top);
|
|
31
|
+
background-color: var(--bottom-sheet-footer-background-color);
|
|
26
32
|
}
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('../../tslib.es6-1f6a7f15.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('react-div-100vh');
|
|
9
|
+
require('react-swipeable');
|
|
10
|
+
require('@alfalab/core-components-base-modal');
|
|
11
|
+
require('@alfalab/core-components-typography');
|
|
12
|
+
require('@alfalab/core-components-icon-button');
|
|
13
|
+
require('@alfalab/icons-glyph/CrossMIcon');
|
|
14
|
+
require('../closer/Component.js');
|
|
15
|
+
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
16
|
+
require('../backer/Component.js');
|
|
17
|
+
var components_header_Component = require('../../component-99884ac1.js');
|
|
18
|
+
require('../footer/Component.js');
|
|
19
|
+
require('@alfalab/core-components-backdrop');
|
|
20
|
+
require('../swipeable-backdrop/Component.js');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.Header = components_header_Component.Header;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* hash: 1hcnd */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-bg-primary: #fff;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
:root {
|
|
14
|
+
--gap-2xs: 4px;
|
|
15
|
+
--gap-xs: 8px;
|
|
16
|
+
--gap-4xl: 48px;
|
|
17
|
+
}
|
|
18
|
+
:root {
|
|
19
|
+
--font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
|
|
20
|
+
sans-serif;
|
|
21
|
+
}
|
|
22
|
+
:root {
|
|
23
|
+
--border-radius-xl: 16px;
|
|
24
|
+
}
|
|
25
|
+
:root {
|
|
26
|
+
--bottom-sheet-header-border-bottom: none;
|
|
27
|
+
--bottom-sheet-title-font-size: 18px;
|
|
28
|
+
--bottom-sheet-title-font-weight: 700;
|
|
29
|
+
--bottom-sheet-title-line-height: 24px;
|
|
30
|
+
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
31
|
+
--bottom-sheet-title-margin-vertical: var(--gap-2xs);
|
|
32
|
+
}
|
|
33
|
+
.bottom-sheet__header_1qzdw {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
padding: var(--gap-xs);
|
|
37
|
+
padding-bottom: 0;
|
|
38
|
+
background-color: var(--color-light-bg-primary);
|
|
39
|
+
border-top-right-radius: var(--border-radius-xl);
|
|
40
|
+
border-top-left-radius: var(--border-radius-xl);
|
|
41
|
+
}
|
|
42
|
+
.bottom-sheet__sticky_1qzdw {
|
|
43
|
+
position: sticky;
|
|
44
|
+
top: 0;
|
|
45
|
+
}
|
|
46
|
+
.bottom-sheet__highlighted_1qzdw {
|
|
47
|
+
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
48
|
+
}
|
|
49
|
+
.bottom-sheet__justifyEnd_1qzdw {
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
}
|
|
52
|
+
.bottom-sheet__addon_1qzdw {
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
min-width: 48px;
|
|
57
|
+
height: 48px;
|
|
58
|
+
}
|
|
59
|
+
.bottom-sheet__addonFixed_1qzdw {
|
|
60
|
+
position: fixed;
|
|
61
|
+
}
|
|
62
|
+
.bottom-sheet__addonLeft_1qzdw {
|
|
63
|
+
left: 0;
|
|
64
|
+
margin-left: var(--gap-xs);
|
|
65
|
+
}
|
|
66
|
+
.bottom-sheet__addonRight_1qzdw {
|
|
67
|
+
right: 0;
|
|
68
|
+
margin-right: var(--gap-xs);
|
|
69
|
+
}
|
|
70
|
+
.bottom-sheet__title_1qzdw {
|
|
71
|
+
height: 24px;
|
|
72
|
+
padding: var(--gap-xs) var(--gap-xs);
|
|
73
|
+
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
74
|
+
width: 100%;
|
|
75
|
+
font-size: var(--bottom-sheet-title-font-size);
|
|
76
|
+
font-weight: var(--bottom-sheet-title-font-weight);
|
|
77
|
+
line-height: var(--bottom-sheet-title-line-height);
|
|
78
|
+
font-family: var(--bottom-sheet-title-font-family);
|
|
79
|
+
}
|
|
80
|
+
.bottom-sheet__titleCenter_1qzdw {
|
|
81
|
+
text-align: center;
|
|
82
|
+
}
|
|
83
|
+
.bottom-sheet__titleLeft_1qzdw {
|
|
84
|
+
text-align: left;
|
|
85
|
+
}
|
|
86
|
+
.bottom-sheet__trimTitle_1qzdw {
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
text-overflow: ellipsis;
|
|
90
|
+
}
|
|
91
|
+
.bottom-sheet__titleBigIndentHorizontal_1qzdw {
|
|
92
|
+
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
93
|
+
}
|
|
94
|
+
.bottom-sheet__titleIndentRight_1qzdw {
|
|
95
|
+
margin-right: var(--gap-4xl);
|
|
96
|
+
}
|
|
97
|
+
.bottom-sheet__titleIndentLeft_1qzdw {
|
|
98
|
+
margin-left: var(--gap-4xl);
|
|
99
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BackdropProps } from "@alfalab/core-components-backdrop";
|
|
3
|
+
import { SwipeableHandlers } from 'react-swipeable/types';
|
|
4
|
+
type SwipeableBackdropProps = BackdropProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Прозрачность бэкдропа
|
|
7
|
+
*/
|
|
8
|
+
opacity?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Обработчики свайпа
|
|
11
|
+
*/
|
|
12
|
+
handlers?: SwipeableHandlers;
|
|
13
|
+
/**
|
|
14
|
+
* Время анимации opacity
|
|
15
|
+
*/
|
|
16
|
+
opacityTimeout?: number;
|
|
17
|
+
};
|
|
18
|
+
declare const SwipeableBackdrop: FC<SwipeableBackdropProps>;
|
|
19
|
+
export { SwipeableBackdropProps, SwipeableBackdrop };
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('react');
|
|
7
|
-
require('@alfalab/core-components-backdrop');
|
|
5
|
+
var tslib_es6 = require('../../tslib.es6-1f6a7f15.js');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var coreComponentsBackdrop = require('@alfalab/core-components-backdrop');
|
|
8
8
|
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
10
|
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
var SwipeableBackdrop = function (_a) {
|
|
14
|
+
var opacity = _a.opacity, handlers = _a.handlers, opacityTimeout = _a.opacityTimeout, style = _a.style, backdropProps = tslib_es6.__rest(_a, ["opacity", "handlers", "opacityTimeout", "style"]);
|
|
15
|
+
return (React__default['default'].createElement("div", tslib_es6.__assign({}, handlers, { style: tslib_es6.__assign({ opacity: opacity, transition: opacity === 1 ? "opacity " + opacityTimeout + "ms ease-in-out" : '', position: 'relative' }, style) }),
|
|
16
|
+
React__default['default'].createElement(coreComponentsBackdrop.Backdrop, tslib_es6.__assign({}, backdropProps))));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.SwipeableBackdrop = SwipeableBackdrop;
|