@alfalab/core-components-bottom-sheet 6.6.2 → 6.7.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.js +12 -3
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +26 -26
- package/components/header/Component.js +1 -1
- package/components/header/index.css +13 -13
- package/cssm/component.js +11 -2
- package/cssm/index.module.css +6 -5
- package/cssm/types.d.ts +9 -1
- package/esm/component.js +12 -3
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +26 -26
- package/esm/components/header/Component.js +1 -1
- package/esm/components/header/index.css +13 -13
- package/esm/index.css +48 -47
- package/esm/types.d.ts +9 -1
- package/index.css +48 -47
- package/modern/component.js +12 -3
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +26 -26
- package/modern/components/header/Component.js +1 -1
- package/modern/components/header/index.css +13 -13
- package/modern/index.css +48 -47
- package/modern/types.d.ts +9 -1
- package/package.json +2 -2
- package/src/component.tsx +27 -2
- package/src/index.module.css +8 -5
- package/src/types.ts +11 -1
- package/types.d.ts +9 -1
package/component.js
CHANGED
|
@@ -23,12 +23,12 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
23
23
|
var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
|
|
24
24
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
25
25
|
|
|
26
|
-
var styles = {"modal":"bottom-
|
|
26
|
+
var styles = {"modal":"bottom-sheet__modal_3cpay","wrapper":"bottom-sheet__wrapper_3cpay","fullscreen":"bottom-sheet__fullscreen_3cpay","component":"bottom-sheet__component_3cpay","withTransition":"bottom-sheet__withTransition_3cpay","scrollableContainer":"bottom-sheet__scrollableContainer_3cpay","marker":"bottom-sheet__marker_3cpay","defaultMarker":"bottom-sheet__defaultMarker_3cpay","content":"bottom-sheet__content_3cpay","noHeader":"bottom-sheet__noHeader_3cpay","noFooter":"bottom-sheet__noFooter_3cpay","scrollLocked":"bottom-sheet__scrollLocked_3cpay","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_3cpay","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_3cpay","appear":"bottom-sheet__appear_3cpay","enter":"bottom-sheet__enter_3cpay","appearActive":"bottom-sheet__appearActive_3cpay","enterActive":"bottom-sheet__enterActive_3cpay","enterDone":"bottom-sheet__enterDone_3cpay","appearDone":"bottom-sheet__appearDone_3cpay","exit":"bottom-sheet__exit_3cpay","exitActive":"bottom-sheet__exitActive_3cpay","background-accent":"bottom-sheet__background-accent_3cpay","background-info":"bottom-sheet__background-info_3cpay","background-attention-muted":"bottom-sheet__background-attention-muted_3cpay","background-positive-muted":"bottom-sheet__background-positive-muted_3cpay","background-negative-muted":"bottom-sheet__background-negative-muted_3cpay","background-primary":"bottom-sheet__background-primary_3cpay","background-primary-inverted":"bottom-sheet__background-primary-inverted_3cpay","background-secondary":"bottom-sheet__background-secondary_3cpay","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_3cpay","background-tertiary":"bottom-sheet__background-tertiary_3cpay","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_3cpay","background-quaternary":"bottom-sheet__background-quaternary_3cpay","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_3cpay","background-specialbg-component":"bottom-sheet__background-specialbg-component_3cpay","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_3cpay","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_3cpay","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_3cpay","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_3cpay","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_3cpay","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_3cpay","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_3cpay","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_3cpay"};
|
|
27
27
|
require('./index.css')
|
|
28
28
|
|
|
29
29
|
var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
30
30
|
var _b, _c, _d, _e, _f;
|
|
31
|
-
var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, 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, _h = _a.titleAlign, titleAlign = _h === void 0 ? 'left' : _h, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _j = _a.stickyFooter, stickyFooter = _j === void 0 ? true : _j, _k = _a.initialHeight, initialHeight = _k === void 0 ? 'default' : _k, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _l = _a.transitionProps, transitionProps = _l === void 0 ? {} : _l, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _m = _a.swipeable, swipeable = _m === void 0 ? true : _m, _o = _a.swipeableContent, swipeableContent = _o === void 0 ? true : _o, _p = _a.swipeThreshold, swipeThreshold = _p === void 0 ? 5 : _p, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _q = _a.scrollableContainerRef, scrollableContainerRef = _q === void 0 ? function () { return null; } : _q, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _r = _a.sheetContainerRef, sheetContainerRef = _r === void 0 ? function () { return null; } : _r, _s = _a.headerOffset, headerOffset = _s === void 0 ? 24 : _s, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange;
|
|
31
|
+
var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, 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, _h = _a.titleAlign, titleAlign = _h === void 0 ? 'left' : _h, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _j = _a.stickyFooter, stickyFooter = _j === void 0 ? true : _j, _k = _a.initialHeight, initialHeight = _k === void 0 ? 'default' : _k, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _l = _a.transitionProps, transitionProps = _l === void 0 ? {} : _l, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _m = _a.swipeable, swipeable = _m === void 0 ? true : _m, _o = _a.swipeableContent, swipeableContent = _o === void 0 ? true : _o, _p = _a.swipeThreshold, swipeThreshold = _p === void 0 ? 5 : _p, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _q = _a.scrollableContainerRef, scrollableContainerRef = _q === void 0 ? function () { return null; } : _q, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _r = _a.sheetContainerRef, sheetContainerRef = _r === void 0 ? function () { return null; } : _r, _s = _a.headerOffset, headerOffset = _s === void 0 ? 24 : _s, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName;
|
|
32
32
|
var hasInitialIdx = initialActiveAreaIndex !== undefined;
|
|
33
33
|
var fullHeight = reactDiv100vh.use100vh() || 0;
|
|
34
34
|
// Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
|
|
@@ -294,6 +294,15 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
294
294
|
height: !isFirstRender && initialHeight === 'full' ? "".concat(lastMagneticArea, "px") : 'unset',
|
|
295
295
|
maxHeight: isFirstRender ? 0 : "".concat(lastMagneticArea, "px"),
|
|
296
296
|
}); };
|
|
297
|
+
var renderMarker = function () {
|
|
298
|
+
if (swipeable) {
|
|
299
|
+
if (swipeableMarker) {
|
|
300
|
+
return (React__default.default.createElement("div", { className: cn__default.default(styles.marker, swipeableMarkerClassName) }, swipeableMarker));
|
|
301
|
+
}
|
|
302
|
+
return (React__default.default.createElement("div", { className: cn__default.default(styles.marker, styles.defaultMarker, swipeableMarkerClassName) }));
|
|
303
|
+
}
|
|
304
|
+
return null;
|
|
305
|
+
};
|
|
297
306
|
var bgClassName = backgroundColor && styles["background-".concat(backgroundColor)];
|
|
298
307
|
return (React__default.default.createElement(coreComponentsBaseModal.BaseModal, { open: open, ref: ref, container: container, dataTestId: dataTestId, zIndex: zIndex, onClose: onClose, usePortal: usePortal, scrollHandler: scrollableContainer, Backdrop: components_swipeableBackdrop_Component.SwipeableBackdrop, backdropProps: tslib.__assign(tslib.__assign({}, backdropProps), { className: styles.disabledPointerEvents, opacity: backdropOpacity, opacityTimeout: utils.TIMEOUT, invisible: hideOverlay }), disableBackdropClick: hideOverlay ? true : disableOverlayClick, className: cn__default.default(styles.modal, modalClassName), wrapperClassName: cn__default.default(modalWrapperClassName, (_b = {},
|
|
299
308
|
_b[styles.disabledPointerEvents] = hideOverlay,
|
|
@@ -304,11 +313,11 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
304
313
|
React__default.default.createElement("div", tslib.__assign({ className: cn__default.default(styles.component, bgClassName, className, (_d = {},
|
|
305
314
|
_d[styles.withTransition] = swipingInProgress === false,
|
|
306
315
|
_d)), style: tslib.__assign(tslib.__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs__default.default([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: handleTransitionEnd }),
|
|
316
|
+
renderMarker(),
|
|
307
317
|
React__default.default.createElement("div", tslib.__assign({}, containerProps, { className: cn__default.default(styles.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_e = {},
|
|
308
318
|
_e[styles.scrollLocked] = scrollLockedProp || swipingInProgress,
|
|
309
319
|
_e[styles.hiddenScrollbar] = hideScrollbar,
|
|
310
320
|
_e)), ref: mergeRefs__default.default([scrollableContainer, scrollableContainerRef]) }),
|
|
311
|
-
swipeable && React__default.default.createElement("div", { className: cn__default.default(styles.marker) }),
|
|
312
321
|
!hideHeader && !emptyHeader && React__default.default.createElement(components_header_Component.Header, tslib.__assign({}, headerProps)),
|
|
313
322
|
React__default.default.createElement("div", { ref: contentRef, className: cn__default.default(styles.content, contentClassName, (_f = {},
|
|
314
323
|
_f[styles.noHeader] = hideHeader || emptyHeader,
|
|
@@ -11,7 +11,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
13
13
|
|
|
14
|
-
var styles = {"footer":"bottom-
|
|
14
|
+
var styles = {"footer":"bottom-sheet__footer_1n4ol","sticky":"bottom-sheet__sticky_1n4ol","highlighted":"bottom-sheet__highlighted_1n4ol","background-accent":"bottom-sheet__background-accent_1n4ol","background-info":"bottom-sheet__background-info_1n4ol","background-attention-muted":"bottom-sheet__background-attention-muted_1n4ol","background-positive-muted":"bottom-sheet__background-positive-muted_1n4ol","background-negative-muted":"bottom-sheet__background-negative-muted_1n4ol","background-primary":"bottom-sheet__background-primary_1n4ol","background-primary-inverted":"bottom-sheet__background-primary-inverted_1n4ol","background-secondary":"bottom-sheet__background-secondary_1n4ol","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1n4ol","background-tertiary":"bottom-sheet__background-tertiary_1n4ol","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1n4ol","background-quaternary":"bottom-sheet__background-quaternary_1n4ol","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1n4ol","background-specialbg-component":"bottom-sheet__background-specialbg-component_1n4ol","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1n4ol","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1n4ol","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1n4ol","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1n4ol","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1n4ol","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1n4ol","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1n4ol","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1n4ol"};
|
|
15
15
|
require('./index.css')
|
|
16
16
|
|
|
17
17
|
var Footer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1ufez */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-accent: #ef3124;
|
|
@@ -41,58 +41,58 @@
|
|
|
41
41
|
} :root {
|
|
42
42
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-secondary);
|
|
43
43
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
44
|
-
} .bottom-
|
|
44
|
+
} .bottom-sheet__footer_1n4ol {
|
|
45
45
|
padding: var(--gap-m) var(--gap-m);
|
|
46
46
|
background-color: var(--color-light-bg-primary);
|
|
47
|
-
} .bottom-
|
|
47
|
+
} .bottom-sheet__sticky_1n4ol {
|
|
48
48
|
position: sticky;
|
|
49
49
|
bottom: 0;
|
|
50
50
|
z-index: 1;
|
|
51
|
-
} .bottom-
|
|
51
|
+
} .bottom-sheet__highlighted_1n4ol {
|
|
52
52
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
53
53
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
54
|
-
} .bottom-sheet__background-
|
|
54
|
+
} .bottom-sheet__background-accent_1n4ol {
|
|
55
55
|
background-color: var(--color-light-bg-accent);
|
|
56
|
-
} .bottom-sheet__background-
|
|
56
|
+
} .bottom-sheet__background-info_1n4ol {
|
|
57
57
|
background-color: var(--color-light-bg-info);
|
|
58
|
-
} .bottom-sheet__background-attention-
|
|
58
|
+
} .bottom-sheet__background-attention-muted_1n4ol {
|
|
59
59
|
background-color: var(--color-light-bg-attention-muted);
|
|
60
|
-
} .bottom-sheet__background-positive-
|
|
60
|
+
} .bottom-sheet__background-positive-muted_1n4ol {
|
|
61
61
|
background-color: var(--color-light-bg-positive-muted);
|
|
62
|
-
} .bottom-sheet__background-negative-
|
|
62
|
+
} .bottom-sheet__background-negative-muted_1n4ol {
|
|
63
63
|
background-color: var(--color-light-bg-negative-muted);
|
|
64
|
-
} .bottom-sheet__background-
|
|
64
|
+
} .bottom-sheet__background-primary_1n4ol {
|
|
65
65
|
background-color: var(--color-light-bg-primary);
|
|
66
|
-
} .bottom-sheet__background-primary-
|
|
66
|
+
} .bottom-sheet__background-primary-inverted_1n4ol {
|
|
67
67
|
background-color: var(--color-light-bg-primary-inverted);
|
|
68
|
-
} .bottom-sheet__background-
|
|
68
|
+
} .bottom-sheet__background-secondary_1n4ol {
|
|
69
69
|
background-color: var(--color-light-bg-secondary);
|
|
70
|
-
} .bottom-sheet__background-secondary-
|
|
70
|
+
} .bottom-sheet__background-secondary-inverted_1n4ol {
|
|
71
71
|
background-color: var(--color-light-bg-secondary-inverted);
|
|
72
|
-
} .bottom-sheet__background-
|
|
72
|
+
} .bottom-sheet__background-tertiary_1n4ol {
|
|
73
73
|
background-color: var(--color-light-bg-tertiary);
|
|
74
|
-
} .bottom-sheet__background-tertiary-
|
|
74
|
+
} .bottom-sheet__background-tertiary-inverted_1n4ol {
|
|
75
75
|
background-color: var(--color-light-bg-tertiary-inverted);
|
|
76
|
-
} .bottom-sheet__background-
|
|
76
|
+
} .bottom-sheet__background-quaternary_1n4ol {
|
|
77
77
|
background-color: var(--color-light-bg-quaternary);
|
|
78
|
-
} .bottom-sheet__background-quaternary-
|
|
78
|
+
} .bottom-sheet__background-quaternary-inverted_1n4ol {
|
|
79
79
|
background-color: var(--color-light-bg-quaternary-inverted);
|
|
80
|
-
} .bottom-sheet__background-specialbg-
|
|
80
|
+
} .bottom-sheet__background-specialbg-component_1n4ol {
|
|
81
81
|
background-color: var(--color-light-specialbg-component);
|
|
82
|
-
} .bottom-sheet__background-specialbg-component-
|
|
82
|
+
} .bottom-sheet__background-specialbg-component-inverted_1n4ol {
|
|
83
83
|
background-color: var(--color-light-specialbg-component-inverted);
|
|
84
|
-
} .bottom-sheet__background-specialbg-primary-
|
|
84
|
+
} .bottom-sheet__background-specialbg-primary-grouped_1n4ol {
|
|
85
85
|
background-color: var(--color-light-specialbg-primary-grouped);
|
|
86
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
86
|
+
} .bottom-sheet__background-specialbg-secondary-grouped_1n4ol {
|
|
87
87
|
background-color: var(--color-light-specialbg-secondary-grouped);
|
|
88
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
88
|
+
} .bottom-sheet__background-specialbg-tertiary-grouped_1n4ol {
|
|
89
89
|
background-color: var(--color-light-specialbg-tertiary-grouped);
|
|
90
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
90
|
+
} .bottom-sheet__background-specialbg-secondary-transparent_1n4ol {
|
|
91
91
|
background-color: var(--color-light-specialbg-secondary-transparent);
|
|
92
|
-
} .bottom-sheet__background-specialbg-secondary-transparent-
|
|
92
|
+
} .bottom-sheet__background-specialbg-secondary-transparent-inverted_1n4ol {
|
|
93
93
|
background-color: var(--color-light-specialbg-secondary-transparent-inverted);
|
|
94
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
94
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent_1n4ol {
|
|
95
95
|
background-color: var(--color-light-specialbg-tertiary-transparent);
|
|
96
|
-
} .bottom-sheet__background-specialbg-tertiary-transparent-
|
|
96
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent-inverted_1n4ol {
|
|
97
97
|
background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
|
|
98
98
|
}
|
|
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
14
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
15
15
|
|
|
16
|
-
var styles = {"headerWrapper":"bottom-
|
|
16
|
+
var styles = {"headerWrapper":"bottom-sheet__headerWrapper_1t48d","hasContent":"bottom-sheet__hasContent_1t48d","header":"bottom-sheet__header_1t48d","sticky":"bottom-sheet__sticky_1t48d","highlighted":"bottom-sheet__highlighted_1t48d","justifyEnd":"bottom-sheet__justifyEnd_1t48d","addon":"bottom-sheet__addon_1t48d","addonFixed":"bottom-sheet__addonFixed_1t48d","title":"bottom-sheet__title_1t48d","titleCenter":"bottom-sheet__titleCenter_1t48d","titleLeft":"bottom-sheet__titleLeft_1t48d","trimTitle":"bottom-sheet__trimTitle_1t48d"};
|
|
17
17
|
require('./index.css')
|
|
18
18
|
|
|
19
19
|
var Header = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1yadn */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
@@ -27,42 +27,42 @@
|
|
|
27
27
|
--bottom-sheet-title-font-weight: 700;
|
|
28
28
|
--bottom-sheet-title-line-height: 24px;
|
|
29
29
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
30
|
-
} .bottom-
|
|
30
|
+
} .bottom-sheet__headerWrapper_1t48d {
|
|
31
31
|
padding: var(--gap-s) var(--gap-xs) var(--gap-2xs);
|
|
32
32
|
border-top-right-radius: var(--border-radius-xl);
|
|
33
33
|
border-top-left-radius: var(--border-radius-xl);
|
|
34
34
|
z-index: 1;
|
|
35
|
-
} .bottom-
|
|
35
|
+
} .bottom-sheet__hasContent_1t48d {
|
|
36
36
|
background-color: inherit;
|
|
37
|
-
} .bottom-
|
|
37
|
+
} .bottom-sheet__header_1t48d {
|
|
38
38
|
display: flex;
|
|
39
|
-
} .bottom-
|
|
39
|
+
} .bottom-sheet__sticky_1t48d {
|
|
40
40
|
position: sticky;
|
|
41
41
|
top: 0;
|
|
42
|
-
} .bottom-
|
|
42
|
+
} .bottom-sheet__highlighted_1t48d {
|
|
43
43
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
44
|
-
} .bottom-
|
|
44
|
+
} .bottom-sheet__justifyEnd_1t48d {
|
|
45
45
|
justify-content: flex-end;
|
|
46
|
-
} .bottom-
|
|
46
|
+
} .bottom-sheet__addon_1t48d {
|
|
47
47
|
display: flex;
|
|
48
48
|
justify-content: center;
|
|
49
49
|
align-items: center;
|
|
50
50
|
min-width: 48px;
|
|
51
51
|
height: 48px;
|
|
52
|
-
} .bottom-
|
|
52
|
+
} .bottom-sheet__addonFixed_1t48d {
|
|
53
53
|
position: fixed;
|
|
54
|
-
} .bottom-
|
|
54
|
+
} .bottom-sheet__title_1t48d {
|
|
55
55
|
padding: var(--gap-s) var(--gap-xs);
|
|
56
56
|
width: 100%;
|
|
57
57
|
font-size: var(--bottom-sheet-title-font-size);
|
|
58
58
|
font-weight: var(--bottom-sheet-title-font-weight);
|
|
59
59
|
line-height: var(--bottom-sheet-title-line-height);
|
|
60
60
|
font-family: var(--bottom-sheet-title-font-family);
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__titleCenter_1t48d {
|
|
62
62
|
text-align: center;
|
|
63
|
-
} .bottom-
|
|
63
|
+
} .bottom-sheet__titleLeft_1t48d {
|
|
64
64
|
text-align: left;
|
|
65
|
-
} .bottom-
|
|
65
|
+
} .bottom-sheet__trimTitle_1t48d {
|
|
66
66
|
white-space: nowrap;
|
|
67
67
|
overflow: hidden;
|
|
68
68
|
text-overflow: ellipsis;
|
package/cssm/component.js
CHANGED
|
@@ -29,7 +29,7 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
|
29
29
|
|
|
30
30
|
var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
31
31
|
var _b, _c, _d, _e, _f;
|
|
32
|
-
var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, 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, _h = _a.titleAlign, titleAlign = _h === void 0 ? 'left' : _h, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _j = _a.stickyFooter, stickyFooter = _j === void 0 ? true : _j, _k = _a.initialHeight, initialHeight = _k === void 0 ? 'default' : _k, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _l = _a.transitionProps, transitionProps = _l === void 0 ? {} : _l, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _m = _a.swipeable, swipeable = _m === void 0 ? true : _m, _o = _a.swipeableContent, swipeableContent = _o === void 0 ? true : _o, _p = _a.swipeThreshold, swipeThreshold = _p === void 0 ? 5 : _p, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _q = _a.scrollableContainerRef, scrollableContainerRef = _q === void 0 ? function () { return null; } : _q, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _r = _a.sheetContainerRef, sheetContainerRef = _r === void 0 ? function () { return null; } : _r, _s = _a.headerOffset, headerOffset = _s === void 0 ? 24 : _s, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange;
|
|
32
|
+
var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, 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, _h = _a.titleAlign, titleAlign = _h === void 0 ? 'left' : _h, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _j = _a.stickyFooter, stickyFooter = _j === void 0 ? true : _j, _k = _a.initialHeight, initialHeight = _k === void 0 ? 'default' : _k, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _l = _a.transitionProps, transitionProps = _l === void 0 ? {} : _l, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _m = _a.swipeable, swipeable = _m === void 0 ? true : _m, _o = _a.swipeableContent, swipeableContent = _o === void 0 ? true : _o, _p = _a.swipeThreshold, swipeThreshold = _p === void 0 ? 5 : _p, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _q = _a.scrollableContainerRef, scrollableContainerRef = _q === void 0 ? function () { return null; } : _q, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _r = _a.sheetContainerRef, sheetContainerRef = _r === void 0 ? function () { return null; } : _r, _s = _a.headerOffset, headerOffset = _s === void 0 ? 24 : _s, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName;
|
|
33
33
|
var hasInitialIdx = initialActiveAreaIndex !== undefined;
|
|
34
34
|
var fullHeight = reactDiv100vh.use100vh() || 0;
|
|
35
35
|
// Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
|
|
@@ -295,6 +295,15 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
295
295
|
height: !isFirstRender && initialHeight === 'full' ? "".concat(lastMagneticArea, "px") : 'unset',
|
|
296
296
|
maxHeight: isFirstRender ? 0 : "".concat(lastMagneticArea, "px"),
|
|
297
297
|
}); };
|
|
298
|
+
var renderMarker = function () {
|
|
299
|
+
if (swipeable) {
|
|
300
|
+
if (swipeableMarker) {
|
|
301
|
+
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.marker, swipeableMarkerClassName) }, swipeableMarker));
|
|
302
|
+
}
|
|
303
|
+
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.marker, styles__default.default.defaultMarker, swipeableMarkerClassName) }));
|
|
304
|
+
}
|
|
305
|
+
return null;
|
|
306
|
+
};
|
|
298
307
|
var bgClassName = backgroundColor && styles__default.default["background-".concat(backgroundColor)];
|
|
299
308
|
return (React__default.default.createElement(coreComponentsBaseModal.BaseModal, { open: open, ref: ref, container: container, dataTestId: dataTestId, zIndex: zIndex, onClose: onClose, usePortal: usePortal, scrollHandler: scrollableContainer, Backdrop: components_swipeableBackdrop_Component.SwipeableBackdrop, backdropProps: tslib.__assign(tslib.__assign({}, backdropProps), { className: styles__default.default.disabledPointerEvents, opacity: backdropOpacity, opacityTimeout: utils.TIMEOUT, invisible: hideOverlay }), disableBackdropClick: hideOverlay ? true : disableOverlayClick, className: cn__default.default(styles__default.default.modal, modalClassName), wrapperClassName: cn__default.default(modalWrapperClassName, (_b = {},
|
|
300
309
|
_b[styles__default.default.disabledPointerEvents] = hideOverlay,
|
|
@@ -305,11 +314,11 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
|
|
|
305
314
|
React__default.default.createElement("div", tslib.__assign({ className: cn__default.default(styles__default.default.component, bgClassName, className, (_d = {},
|
|
306
315
|
_d[styles__default.default.withTransition] = swipingInProgress === false,
|
|
307
316
|
_d)), style: tslib.__assign(tslib.__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs__default.default([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: handleTransitionEnd }),
|
|
317
|
+
renderMarker(),
|
|
308
318
|
React__default.default.createElement("div", tslib.__assign({}, containerProps, { className: cn__default.default(styles__default.default.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_e = {},
|
|
309
319
|
_e[styles__default.default.scrollLocked] = scrollLockedProp || swipingInProgress,
|
|
310
320
|
_e[styles__default.default.hiddenScrollbar] = hideScrollbar,
|
|
311
321
|
_e)), ref: mergeRefs__default.default([scrollableContainer, scrollableContainerRef]) }),
|
|
312
|
-
swipeable && React__default.default.createElement("div", { className: cn__default.default(styles__default.default.marker) }),
|
|
313
322
|
!hideHeader && !emptyHeader && React__default.default.createElement(components_header_Component.Header, tslib.__assign({}, headerProps)),
|
|
314
323
|
React__default.default.createElement("div", { ref: contentRef, className: cn__default.default(styles__default.default.content, contentClassName, (_f = {},
|
|
315
324
|
_f[styles__default.default.noHeader] = hideHeader || emptyHeader,
|
package/cssm/index.module.css
CHANGED
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
pointer-events: none;
|
|
54
54
|
} .wrapper {
|
|
55
55
|
transform: translateY(100%);
|
|
56
|
-
overflow: hidden;
|
|
57
56
|
pointer-events: none;
|
|
58
57
|
border-top-right-radius: var(--border-radius-xl);
|
|
59
58
|
border-top-left-radius: var(--border-radius-xl);
|
|
@@ -61,7 +60,6 @@
|
|
|
61
60
|
} .fullscreen {
|
|
62
61
|
border-radius: 0;
|
|
63
62
|
} .component {
|
|
64
|
-
overflow: hidden;
|
|
65
63
|
position: relative;
|
|
66
64
|
display: flex;
|
|
67
65
|
flex-direction: column;
|
|
@@ -77,16 +75,19 @@
|
|
|
77
75
|
position: relative;
|
|
78
76
|
height: 100%;
|
|
79
77
|
background-color: inherit;
|
|
78
|
+
border-radius: inherit;
|
|
80
79
|
} .marker {
|
|
81
80
|
position: fixed;
|
|
82
81
|
top: var(--gap-2xs);
|
|
83
|
-
|
|
82
|
+
right: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
z-index: 1000;
|
|
84
85
|
width: 36px;
|
|
86
|
+
margin: 0 auto;
|
|
87
|
+
} .defaultMarker {
|
|
85
88
|
height: 4px;
|
|
86
89
|
border-radius: var(--border-radius-xxl);
|
|
87
|
-
transform: translateX(-50%);
|
|
88
90
|
background-color: var(--color-light-graphic-quaternary);
|
|
89
|
-
z-index: 1000;
|
|
90
91
|
} .content {
|
|
91
92
|
position: relative;
|
|
92
93
|
z-index: 0;
|
package/cssm/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
|
-
import { HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactElement, ReactNode, RefObject } from 'react';
|
|
3
3
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
4
4
|
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
5
5
|
import { NavigationBarProps } from "@alfalab/core-components-navigation-bar";
|
|
@@ -88,6 +88,14 @@ type BottomSheetProps = {
|
|
|
88
88
|
* Дополнительный класс для обертки модального окна
|
|
89
89
|
*/
|
|
90
90
|
modalWrapperClassName?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Дополнительный класс для маркера
|
|
93
|
+
*/
|
|
94
|
+
swipeableMarkerClassName?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Кастомный маркер
|
|
97
|
+
*/
|
|
98
|
+
swipeableMarker?: ReactElement;
|
|
91
99
|
/**
|
|
92
100
|
* TransitionProps, прокидываются в компонент CSSTransitionProps.
|
|
93
101
|
*/
|
package/esm/component.js
CHANGED
|
@@ -13,12 +13,12 @@ import { convertPercentToNumber, TIMEOUT, MARKER_HEIGHT, SCROLL_OFFSET, SWIPE_VE
|
|
|
13
13
|
import '@alfalab/core-components-navigation-bar/esm';
|
|
14
14
|
import '@alfalab/core-components-backdrop/esm';
|
|
15
15
|
|
|
16
|
-
var styles = {"modal":"bottom-
|
|
16
|
+
var styles = {"modal":"bottom-sheet__modal_3cpay","wrapper":"bottom-sheet__wrapper_3cpay","fullscreen":"bottom-sheet__fullscreen_3cpay","component":"bottom-sheet__component_3cpay","withTransition":"bottom-sheet__withTransition_3cpay","scrollableContainer":"bottom-sheet__scrollableContainer_3cpay","marker":"bottom-sheet__marker_3cpay","defaultMarker":"bottom-sheet__defaultMarker_3cpay","content":"bottom-sheet__content_3cpay","noHeader":"bottom-sheet__noHeader_3cpay","noFooter":"bottom-sheet__noFooter_3cpay","scrollLocked":"bottom-sheet__scrollLocked_3cpay","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_3cpay","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_3cpay","appear":"bottom-sheet__appear_3cpay","enter":"bottom-sheet__enter_3cpay","appearActive":"bottom-sheet__appearActive_3cpay","enterActive":"bottom-sheet__enterActive_3cpay","enterDone":"bottom-sheet__enterDone_3cpay","appearDone":"bottom-sheet__appearDone_3cpay","exit":"bottom-sheet__exit_3cpay","exitActive":"bottom-sheet__exitActive_3cpay","background-accent":"bottom-sheet__background-accent_3cpay","background-info":"bottom-sheet__background-info_3cpay","background-attention-muted":"bottom-sheet__background-attention-muted_3cpay","background-positive-muted":"bottom-sheet__background-positive-muted_3cpay","background-negative-muted":"bottom-sheet__background-negative-muted_3cpay","background-primary":"bottom-sheet__background-primary_3cpay","background-primary-inverted":"bottom-sheet__background-primary-inverted_3cpay","background-secondary":"bottom-sheet__background-secondary_3cpay","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_3cpay","background-tertiary":"bottom-sheet__background-tertiary_3cpay","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_3cpay","background-quaternary":"bottom-sheet__background-quaternary_3cpay","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_3cpay","background-specialbg-component":"bottom-sheet__background-specialbg-component_3cpay","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_3cpay","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_3cpay","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_3cpay","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_3cpay","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_3cpay","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_3cpay","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_3cpay","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_3cpay"};
|
|
17
17
|
require('./index.css')
|
|
18
18
|
|
|
19
19
|
var BottomSheet = forwardRef(function (_a, ref) {
|
|
20
20
|
var _b, _c, _d, _e, _f;
|
|
21
|
-
var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, 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, _h = _a.titleAlign, titleAlign = _h === void 0 ? 'left' : _h, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _j = _a.stickyFooter, stickyFooter = _j === void 0 ? true : _j, _k = _a.initialHeight, initialHeight = _k === void 0 ? 'default' : _k, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _l = _a.transitionProps, transitionProps = _l === void 0 ? {} : _l, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _m = _a.swipeable, swipeable = _m === void 0 ? true : _m, _o = _a.swipeableContent, swipeableContent = _o === void 0 ? true : _o, _p = _a.swipeThreshold, swipeThreshold = _p === void 0 ? 5 : _p, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _q = _a.scrollableContainerRef, scrollableContainerRef = _q === void 0 ? function () { return null; } : _q, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _r = _a.sheetContainerRef, sheetContainerRef = _r === void 0 ? function () { return null; } : _r, _s = _a.headerOffset, headerOffset = _s === void 0 ? 24 : _s, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange;
|
|
21
|
+
var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _g = _a.titleSize, titleSize = _g === void 0 ? 'default' : _g, 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, _h = _a.titleAlign, titleAlign = _h === void 0 ? 'left' : _h, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _j = _a.stickyFooter, stickyFooter = _j === void 0 ? true : _j, _k = _a.initialHeight, initialHeight = _k === void 0 ? 'default' : _k, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _l = _a.transitionProps, transitionProps = _l === void 0 ? {} : _l, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _m = _a.swipeable, swipeable = _m === void 0 ? true : _m, _o = _a.swipeableContent, swipeableContent = _o === void 0 ? true : _o, _p = _a.swipeThreshold, swipeThreshold = _p === void 0 ? 5 : _p, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _q = _a.scrollableContainerRef, scrollableContainerRef = _q === void 0 ? function () { return null; } : _q, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _r = _a.sheetContainerRef, sheetContainerRef = _r === void 0 ? function () { return null; } : _r, _s = _a.headerOffset, headerOffset = _s === void 0 ? 24 : _s, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName;
|
|
22
22
|
var hasInitialIdx = initialActiveAreaIndex !== undefined;
|
|
23
23
|
var fullHeight = use100vh() || 0;
|
|
24
24
|
// Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
|
|
@@ -284,6 +284,15 @@ var BottomSheet = forwardRef(function (_a, ref) {
|
|
|
284
284
|
height: !isFirstRender && initialHeight === 'full' ? "".concat(lastMagneticArea, "px") : 'unset',
|
|
285
285
|
maxHeight: isFirstRender ? 0 : "".concat(lastMagneticArea, "px"),
|
|
286
286
|
}); };
|
|
287
|
+
var renderMarker = function () {
|
|
288
|
+
if (swipeable) {
|
|
289
|
+
if (swipeableMarker) {
|
|
290
|
+
return (React.createElement("div", { className: cn(styles.marker, swipeableMarkerClassName) }, swipeableMarker));
|
|
291
|
+
}
|
|
292
|
+
return (React.createElement("div", { className: cn(styles.marker, styles.defaultMarker, swipeableMarkerClassName) }));
|
|
293
|
+
}
|
|
294
|
+
return null;
|
|
295
|
+
};
|
|
287
296
|
var bgClassName = backgroundColor && styles["background-".concat(backgroundColor)];
|
|
288
297
|
return (React.createElement(BaseModal, { open: open, ref: ref, container: container, dataTestId: dataTestId, zIndex: zIndex, onClose: onClose, usePortal: usePortal, scrollHandler: scrollableContainer, Backdrop: SwipeableBackdrop, backdropProps: __assign(__assign({}, backdropProps), { className: styles.disabledPointerEvents, opacity: backdropOpacity, opacityTimeout: TIMEOUT, invisible: hideOverlay }), disableBackdropClick: hideOverlay ? true : disableOverlayClick, className: cn(styles.modal, modalClassName), wrapperClassName: cn(modalWrapperClassName, (_b = {},
|
|
289
298
|
_b[styles.disabledPointerEvents] = hideOverlay,
|
|
@@ -294,11 +303,11 @@ var BottomSheet = forwardRef(function (_a, ref) {
|
|
|
294
303
|
React.createElement("div", __assign({ className: cn(styles.component, bgClassName, className, (_d = {},
|
|
295
304
|
_d[styles.withTransition] = swipingInProgress === false,
|
|
296
305
|
_d)), style: __assign(__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: handleTransitionEnd }),
|
|
306
|
+
renderMarker(),
|
|
297
307
|
React.createElement("div", __assign({}, containerProps, { className: cn(styles.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_e = {},
|
|
298
308
|
_e[styles.scrollLocked] = scrollLockedProp || swipingInProgress,
|
|
299
309
|
_e[styles.hiddenScrollbar] = hideScrollbar,
|
|
300
310
|
_e)), ref: mergeRefs([scrollableContainer, scrollableContainerRef]) }),
|
|
301
|
-
swipeable && React.createElement("div", { className: cn(styles.marker) }),
|
|
302
311
|
!hideHeader && !emptyHeader && React.createElement(Header, __assign({}, headerProps)),
|
|
303
312
|
React.createElement("div", { ref: contentRef, className: cn(styles.content, contentClassName, (_f = {},
|
|
304
313
|
_f[styles.noHeader] = hideHeader || emptyHeader,
|
|
@@ -2,7 +2,7 @@ import React, { useContext, useEffect } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { BaseModalContext } from '@alfalab/core-components-base-modal/esm';
|
|
4
4
|
|
|
5
|
-
var styles = {"footer":"bottom-
|
|
5
|
+
var styles = {"footer":"bottom-sheet__footer_1n4ol","sticky":"bottom-sheet__sticky_1n4ol","highlighted":"bottom-sheet__highlighted_1n4ol","background-accent":"bottom-sheet__background-accent_1n4ol","background-info":"bottom-sheet__background-info_1n4ol","background-attention-muted":"bottom-sheet__background-attention-muted_1n4ol","background-positive-muted":"bottom-sheet__background-positive-muted_1n4ol","background-negative-muted":"bottom-sheet__background-negative-muted_1n4ol","background-primary":"bottom-sheet__background-primary_1n4ol","background-primary-inverted":"bottom-sheet__background-primary-inverted_1n4ol","background-secondary":"bottom-sheet__background-secondary_1n4ol","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1n4ol","background-tertiary":"bottom-sheet__background-tertiary_1n4ol","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1n4ol","background-quaternary":"bottom-sheet__background-quaternary_1n4ol","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1n4ol","background-specialbg-component":"bottom-sheet__background-specialbg-component_1n4ol","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1n4ol","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1n4ol","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1n4ol","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1n4ol","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1n4ol","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1n4ol","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1n4ol","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1n4ol"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var Footer = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1ufez */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-accent: #ef3124;
|
|
@@ -41,58 +41,58 @@
|
|
|
41
41
|
} :root {
|
|
42
42
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-secondary);
|
|
43
43
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
44
|
-
} .bottom-
|
|
44
|
+
} .bottom-sheet__footer_1n4ol {
|
|
45
45
|
padding: var(--gap-m) var(--gap-m);
|
|
46
46
|
background-color: var(--color-light-bg-primary);
|
|
47
|
-
} .bottom-
|
|
47
|
+
} .bottom-sheet__sticky_1n4ol {
|
|
48
48
|
position: sticky;
|
|
49
49
|
bottom: 0;
|
|
50
50
|
z-index: 1;
|
|
51
|
-
} .bottom-
|
|
51
|
+
} .bottom-sheet__highlighted_1n4ol {
|
|
52
52
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
53
53
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
54
|
-
} .bottom-sheet__background-
|
|
54
|
+
} .bottom-sheet__background-accent_1n4ol {
|
|
55
55
|
background-color: var(--color-light-bg-accent);
|
|
56
|
-
} .bottom-sheet__background-
|
|
56
|
+
} .bottom-sheet__background-info_1n4ol {
|
|
57
57
|
background-color: var(--color-light-bg-info);
|
|
58
|
-
} .bottom-sheet__background-attention-
|
|
58
|
+
} .bottom-sheet__background-attention-muted_1n4ol {
|
|
59
59
|
background-color: var(--color-light-bg-attention-muted);
|
|
60
|
-
} .bottom-sheet__background-positive-
|
|
60
|
+
} .bottom-sheet__background-positive-muted_1n4ol {
|
|
61
61
|
background-color: var(--color-light-bg-positive-muted);
|
|
62
|
-
} .bottom-sheet__background-negative-
|
|
62
|
+
} .bottom-sheet__background-negative-muted_1n4ol {
|
|
63
63
|
background-color: var(--color-light-bg-negative-muted);
|
|
64
|
-
} .bottom-sheet__background-
|
|
64
|
+
} .bottom-sheet__background-primary_1n4ol {
|
|
65
65
|
background-color: var(--color-light-bg-primary);
|
|
66
|
-
} .bottom-sheet__background-primary-
|
|
66
|
+
} .bottom-sheet__background-primary-inverted_1n4ol {
|
|
67
67
|
background-color: var(--color-light-bg-primary-inverted);
|
|
68
|
-
} .bottom-sheet__background-
|
|
68
|
+
} .bottom-sheet__background-secondary_1n4ol {
|
|
69
69
|
background-color: var(--color-light-bg-secondary);
|
|
70
|
-
} .bottom-sheet__background-secondary-
|
|
70
|
+
} .bottom-sheet__background-secondary-inverted_1n4ol {
|
|
71
71
|
background-color: var(--color-light-bg-secondary-inverted);
|
|
72
|
-
} .bottom-sheet__background-
|
|
72
|
+
} .bottom-sheet__background-tertiary_1n4ol {
|
|
73
73
|
background-color: var(--color-light-bg-tertiary);
|
|
74
|
-
} .bottom-sheet__background-tertiary-
|
|
74
|
+
} .bottom-sheet__background-tertiary-inverted_1n4ol {
|
|
75
75
|
background-color: var(--color-light-bg-tertiary-inverted);
|
|
76
|
-
} .bottom-sheet__background-
|
|
76
|
+
} .bottom-sheet__background-quaternary_1n4ol {
|
|
77
77
|
background-color: var(--color-light-bg-quaternary);
|
|
78
|
-
} .bottom-sheet__background-quaternary-
|
|
78
|
+
} .bottom-sheet__background-quaternary-inverted_1n4ol {
|
|
79
79
|
background-color: var(--color-light-bg-quaternary-inverted);
|
|
80
|
-
} .bottom-sheet__background-specialbg-
|
|
80
|
+
} .bottom-sheet__background-specialbg-component_1n4ol {
|
|
81
81
|
background-color: var(--color-light-specialbg-component);
|
|
82
|
-
} .bottom-sheet__background-specialbg-component-
|
|
82
|
+
} .bottom-sheet__background-specialbg-component-inverted_1n4ol {
|
|
83
83
|
background-color: var(--color-light-specialbg-component-inverted);
|
|
84
|
-
} .bottom-sheet__background-specialbg-primary-
|
|
84
|
+
} .bottom-sheet__background-specialbg-primary-grouped_1n4ol {
|
|
85
85
|
background-color: var(--color-light-specialbg-primary-grouped);
|
|
86
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
86
|
+
} .bottom-sheet__background-specialbg-secondary-grouped_1n4ol {
|
|
87
87
|
background-color: var(--color-light-specialbg-secondary-grouped);
|
|
88
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
88
|
+
} .bottom-sheet__background-specialbg-tertiary-grouped_1n4ol {
|
|
89
89
|
background-color: var(--color-light-specialbg-tertiary-grouped);
|
|
90
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
90
|
+
} .bottom-sheet__background-specialbg-secondary-transparent_1n4ol {
|
|
91
91
|
background-color: var(--color-light-specialbg-secondary-transparent);
|
|
92
|
-
} .bottom-sheet__background-specialbg-secondary-transparent-
|
|
92
|
+
} .bottom-sheet__background-specialbg-secondary-transparent-inverted_1n4ol {
|
|
93
93
|
background-color: var(--color-light-specialbg-secondary-transparent-inverted);
|
|
94
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
94
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent_1n4ol {
|
|
95
95
|
background-color: var(--color-light-specialbg-tertiary-transparent);
|
|
96
|
-
} .bottom-sheet__background-specialbg-tertiary-transparent-
|
|
96
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent-inverted_1n4ol {
|
|
97
97
|
background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
|
|
98
98
|
}
|
|
@@ -4,7 +4,7 @@ import cn from 'classnames';
|
|
|
4
4
|
import { BaseModalContext } from '@alfalab/core-components-base-modal/esm';
|
|
5
5
|
import { NavigationBar } from '@alfalab/core-components-navigation-bar/esm';
|
|
6
6
|
|
|
7
|
-
var styles = {"headerWrapper":"bottom-
|
|
7
|
+
var styles = {"headerWrapper":"bottom-sheet__headerWrapper_1t48d","hasContent":"bottom-sheet__hasContent_1t48d","header":"bottom-sheet__header_1t48d","sticky":"bottom-sheet__sticky_1t48d","highlighted":"bottom-sheet__highlighted_1t48d","justifyEnd":"bottom-sheet__justifyEnd_1t48d","addon":"bottom-sheet__addon_1t48d","addonFixed":"bottom-sheet__addonFixed_1t48d","title":"bottom-sheet__title_1t48d","titleCenter":"bottom-sheet__titleCenter_1t48d","titleLeft":"bottom-sheet__titleLeft_1t48d","trimTitle":"bottom-sheet__trimTitle_1t48d"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
var Header = function (_a) {
|