@alfalab/core-components-bottom-sheet 6.5.0 → 6.6.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.
Files changed (52) hide show
  1. package/component.js +102 -56
  2. package/components/footer/Component.js +1 -1
  3. package/components/footer/index.css +26 -26
  4. package/components/header/Component.d.ts +1 -0
  5. package/components/header/Component.js +4 -5
  6. package/components/header/index.css +13 -13
  7. package/cssm/component.js +101 -55
  8. package/cssm/components/header/Component.d.ts +1 -0
  9. package/cssm/components/header/Component.js +3 -4
  10. package/cssm/index.js +1 -0
  11. package/cssm/index.module.css +3 -0
  12. package/cssm/types.d.ts +30 -10
  13. package/cssm/utils.d.ts +3 -3
  14. package/cssm/utils.js +4 -4
  15. package/esm/component.js +103 -57
  16. package/esm/components/footer/Component.js +1 -1
  17. package/esm/components/footer/index.css +26 -26
  18. package/esm/components/header/Component.d.ts +1 -0
  19. package/esm/components/header/Component.js +4 -5
  20. package/esm/components/header/index.css +13 -13
  21. package/esm/index.css +44 -41
  22. package/esm/index.js +1 -0
  23. package/esm/types.d.ts +30 -10
  24. package/esm/utils.d.ts +3 -3
  25. package/esm/utils.js +4 -4
  26. package/index.css +44 -41
  27. package/index.js +1 -0
  28. package/modern/component.js +90 -44
  29. package/modern/components/footer/Component.js +1 -1
  30. package/modern/components/footer/index.css +26 -26
  31. package/modern/components/header/Component.d.ts +1 -0
  32. package/modern/components/header/Component.js +4 -5
  33. package/modern/components/header/index.css +13 -13
  34. package/modern/index.css +44 -41
  35. package/modern/index.js +1 -0
  36. package/modern/types.d.ts +30 -10
  37. package/modern/utils.d.ts +3 -3
  38. package/modern/utils.js +3 -4
  39. package/package.json +5 -4
  40. package/src/component.tsx +572 -0
  41. package/src/components/footer/Component.tsx +42 -0
  42. package/src/components/footer/index.module.css +24 -0
  43. package/src/components/header/Component.tsx +54 -0
  44. package/src/components/header/index.module.css +72 -0
  45. package/src/components/swipeable-backdrop/Component.tsx +41 -0
  46. package/src/index.module.css +136 -0
  47. package/src/index.ts +3 -0
  48. package/src/types.ts +318 -0
  49. package/src/utils.ts +30 -0
  50. package/types.d.ts +30 -10
  51. package/utils.d.ts +3 -3
  52. package/utils.js +4 -4
package/esm/component.js CHANGED
@@ -5,40 +5,40 @@ import mergeRefs from 'react-merge-refs';
5
5
  import { useSwipeable } from 'react-swipeable';
6
6
  import cn from 'classnames';
7
7
  import { BaseModal } from '@alfalab/core-components-base-modal/esm';
8
+ import { getDataTestId } from '@alfalab/core-components-shared/esm';
8
9
  import { Footer } from './components/footer/Component.js';
9
10
  import { Header } from './components/header/Component.js';
10
11
  import { SwipeableBackdrop } from './components/swipeable-backdrop/Component.js';
11
- import { convertPercentToNumber, HEADER_OFFSET, TIMEOUT, MARKER_HEIGHT, SCROLL_OFFSET, SWIPE_VELOCITY, CLOSE_OFFSET } from './utils.js';
12
+ import { convertPercentToNumber, TIMEOUT, MARKER_HEIGHT, SCROLL_OFFSET, SWIPE_VELOCITY, CLOSE_OFFSET } from './utils.js';
12
13
  import '@alfalab/core-components-navigation-bar/esm';
13
14
  import '@alfalab/core-components-backdrop/esm';
14
15
 
15
- var getDataTestId = function (dataTestId, element) {
16
- var elementPart = element ? "-".concat(element.toLowerCase()) : '';
17
- return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
18
- };
19
-
20
- var styles = {"modal":"bottom-sheet__modal_1ttf0","wrapper":"bottom-sheet__wrapper_1ttf0","component":"bottom-sheet__component_1ttf0","withTransition":"bottom-sheet__withTransition_1ttf0","scrollableContainer":"bottom-sheet__scrollableContainer_1ttf0","marker":"bottom-sheet__marker_1ttf0","content":"bottom-sheet__content_1ttf0","noHeader":"bottom-sheet__noHeader_1ttf0","noFooter":"bottom-sheet__noFooter_1ttf0","scrollLocked":"bottom-sheet__scrollLocked_1ttf0","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_1ttf0","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_1ttf0","appear":"bottom-sheet__appear_1ttf0","enter":"bottom-sheet__enter_1ttf0","appearActive":"bottom-sheet__appearActive_1ttf0","enterActive":"bottom-sheet__enterActive_1ttf0","enterDone":"bottom-sheet__enterDone_1ttf0","appearDone":"bottom-sheet__appearDone_1ttf0","exit":"bottom-sheet__exit_1ttf0","exitActive":"bottom-sheet__exitActive_1ttf0","background-accent":"bottom-sheet__background-accent_1ttf0","background-info":"bottom-sheet__background-info_1ttf0","background-attention-muted":"bottom-sheet__background-attention-muted_1ttf0","background-positive-muted":"bottom-sheet__background-positive-muted_1ttf0","background-negative-muted":"bottom-sheet__background-negative-muted_1ttf0","background-primary":"bottom-sheet__background-primary_1ttf0","background-primary-inverted":"bottom-sheet__background-primary-inverted_1ttf0","background-secondary":"bottom-sheet__background-secondary_1ttf0","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1ttf0","background-tertiary":"bottom-sheet__background-tertiary_1ttf0","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1ttf0","background-quaternary":"bottom-sheet__background-quaternary_1ttf0","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1ttf0","background-specialbg-component":"bottom-sheet__background-specialbg-component_1ttf0","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1ttf0","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1ttf0","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1ttf0","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1ttf0","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1ttf0","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1ttf0","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1ttf0","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1ttf0"};
16
+ var styles = {"modal":"bottom-sheet__modal_1vjtp","wrapper":"bottom-sheet__wrapper_1vjtp","fullscreen":"bottom-sheet__fullscreen_1vjtp","component":"bottom-sheet__component_1vjtp","withTransition":"bottom-sheet__withTransition_1vjtp","scrollableContainer":"bottom-sheet__scrollableContainer_1vjtp","marker":"bottom-sheet__marker_1vjtp","content":"bottom-sheet__content_1vjtp","noHeader":"bottom-sheet__noHeader_1vjtp","noFooter":"bottom-sheet__noFooter_1vjtp","scrollLocked":"bottom-sheet__scrollLocked_1vjtp","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_1vjtp","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_1vjtp","appear":"bottom-sheet__appear_1vjtp","enter":"bottom-sheet__enter_1vjtp","appearActive":"bottom-sheet__appearActive_1vjtp","enterActive":"bottom-sheet__enterActive_1vjtp","enterDone":"bottom-sheet__enterDone_1vjtp","appearDone":"bottom-sheet__appearDone_1vjtp","exit":"bottom-sheet__exit_1vjtp","exitActive":"bottom-sheet__exitActive_1vjtp","background-accent":"bottom-sheet__background-accent_1vjtp","background-info":"bottom-sheet__background-info_1vjtp","background-attention-muted":"bottom-sheet__background-attention-muted_1vjtp","background-positive-muted":"bottom-sheet__background-positive-muted_1vjtp","background-negative-muted":"bottom-sheet__background-negative-muted_1vjtp","background-primary":"bottom-sheet__background-primary_1vjtp","background-primary-inverted":"bottom-sheet__background-primary-inverted_1vjtp","background-secondary":"bottom-sheet__background-secondary_1vjtp","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1vjtp","background-tertiary":"bottom-sheet__background-tertiary_1vjtp","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1vjtp","background-quaternary":"bottom-sheet__background-quaternary_1vjtp","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1vjtp","background-specialbg-component":"bottom-sheet__background-specialbg-component_1vjtp","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1vjtp","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1vjtp","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1vjtp","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1vjtp","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1vjtp","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1vjtp","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1vjtp","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1vjtp"};
21
17
  require('./index.css')
22
18
 
23
19
  var BottomSheet = forwardRef(function (_a, ref) {
24
- var _b, _c, _d, _e;
25
- var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _f = _a.titleSize, titleSize = _f === void 0 ? 'default' : _f, 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, _g = _a.titleAlign, titleAlign = _g === void 0 ? 'left' : _g, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _h = _a.stickyFooter, stickyFooter = _h === void 0 ? true : _h, _j = _a.initialHeight, initialHeight = _j === void 0 ? 'default' : _j, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _k = _a.transitionProps, transitionProps = _k === void 0 ? {} : _k, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _l = _a.swipeable, swipeable = _l === void 0 ? true : _l, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _m = _a.scrollableContainerRef, scrollableContainerRef = _m === void 0 ? function () { return null; } : _m, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _o = _a.sheetContainerRef, sheetContainerRef = _o === void 0 ? function () { return null; } : _o, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted;
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;
26
22
  var hasInitialIdx = initialActiveAreaIndex !== undefined;
27
23
  var fullHeight = use100vh() || 0;
28
24
  // Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
29
25
  var isFirstRender = fullHeight === 0;
30
26
  var magneticAreas = useMemo(function () {
31
27
  if (magneticAreasProp) {
32
- return magneticAreasProp.map(function (area) { return convertPercentToNumber(area, fullHeight); });
28
+ return magneticAreasProp.map(function (area) {
29
+ return convertPercentToNumber(area, fullHeight, headerOffset);
30
+ });
33
31
  }
34
- return [0, fullHeight - HEADER_OFFSET];
35
- }, [fullHeight, magneticAreasProp]);
32
+ return [0, fullHeight - headerOffset];
33
+ }, [fullHeight, headerOffset, magneticAreasProp]);
36
34
  var lastMagneticArea = magneticAreas[magneticAreas.length - 1];
37
- var _p = useState(0), sheetOffset = _p[0], setSheetOffset = _p[1];
38
- var _q = useState(1), backdropOpacity = _q[0], setBackdropOpacity = _q[1];
39
- var _r = useState(0), activeArea = _r[0], setActiveArea = _r[1];
40
- var swipingInProgress = useRef(null);
35
+ var _t = useState(0), sheetOffset = _t[0], setSheetOffset = _t[1];
36
+ var _u = useState(1), backdropOpacity = _u[0], setBackdropOpacity = _u[1];
37
+ var _v = useState(0), activeArea = _v[0], setActiveArea = _v[1];
38
+ var _w = useState(null), swipingInProgress = _w[0], setSwipingInProgress = _w[1];
39
+ var scrollOccurred = useRef(false);
41
40
  var headerRef = useRef(null);
41
+ var contentRef = useRef(null);
42
42
  var sheetHeight = useRef(0);
43
43
  var sheetRef = useRef(null);
44
44
  var scrollableContainer = useRef(null);
@@ -46,7 +46,7 @@ var BottomSheet = forwardRef(function (_a, ref) {
46
46
  var titleIsReactElement = React.isValidElement(title);
47
47
  var headerProps = __assign(__assign({}, (titleIsReactElement
48
48
  ? { children: title }
49
- : { title: title ? title === null || title === void 0 ? void 0 : title.toString() : undefined })), { scrollableParentRef: scrollableContainer, headerRef: headerRef, 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 });
49
+ : { title: title ? title === null || title === void 0 ? void 0 : title.toString() : undefined })), { scrollableParentRef: scrollableContainer, headerRef: headerRef, headerOffset: headerOffset, 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 });
50
50
  var getBackdropOpacity = function (offset) {
51
51
  var canClose = magneticAreas[0] === 0;
52
52
  var secondArea = magneticAreas[1];
@@ -71,8 +71,14 @@ var BottomSheet = forwardRef(function (_a, ref) {
71
71
  sheetHeight.current = sheetRef.current.getBoundingClientRect().height - sheetOffset;
72
72
  }
73
73
  };
74
+ var handleTransitionEnd = function (event) {
75
+ setSheetHeight();
76
+ if (event.propertyName === 'transform' && event.target === event.currentTarget) {
77
+ onMagnetizeEnd === null || onMagnetizeEnd === void 0 ? void 0 : onMagnetizeEnd();
78
+ }
79
+ };
74
80
  var scrollToArea = function (idx) {
75
- swipingInProgress.current = false;
81
+ setSwipingInProgress(false);
76
82
  var nextArea = magneticAreas[idx];
77
83
  if (nextArea === 0) {
78
84
  onClose();
@@ -81,11 +87,12 @@ var BottomSheet = forwardRef(function (_a, ref) {
81
87
  if (nextArea) {
82
88
  setActiveArea(nextArea);
83
89
  setSheetOffset(lastMagneticArea - nextArea);
90
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nextArea));
84
91
  }
85
92
  };
86
- var magnetize = function (dir, velocity, deltaY) {
87
- var shouldMagnetizeDownByVelocity = dir === 'Down' && velocity >= SWIPE_VELOCITY;
88
- var shouldMagnetizeUpByVelocity = dir === 'Up' && velocity >= SWIPE_VELOCITY;
93
+ var magnetize = function (velocity, deltaY) {
94
+ var shouldMagnetizeDownByVelocity = deltaY >= 0 && velocity >= SWIPE_VELOCITY;
95
+ var shouldMagnetizeUpByVelocity = deltaY < 0 && velocity >= SWIPE_VELOCITY;
89
96
  if (shouldMagnetizeDownByVelocity) {
90
97
  var nextArea_1 = magneticAreas
91
98
  .slice()
@@ -100,6 +107,9 @@ var BottomSheet = forwardRef(function (_a, ref) {
100
107
  : lastMagneticArea - activeArea;
101
108
  setSheetOffset(offset_1);
102
109
  setActiveArea(function (prevState) { return nextArea_1 !== null && nextArea_1 !== void 0 ? nextArea_1 : prevState; });
110
+ if (nextArea_1) {
111
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nextArea_1));
112
+ }
103
113
  return;
104
114
  }
105
115
  if (shouldMagnetizeUpByVelocity) {
@@ -107,13 +117,16 @@ var BottomSheet = forwardRef(function (_a, ref) {
107
117
  var offset_2 = nextArea_2 ? lastMagneticArea - nextArea_2 : 0;
108
118
  setSheetOffset(offset_2);
109
119
  setActiveArea(function (prevState) { return nextArea_2 !== null && nextArea_2 !== void 0 ? nextArea_2 : prevState; });
120
+ if (nextArea_2) {
121
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nextArea_2));
122
+ }
110
123
  return;
111
124
  }
112
125
  var offset = getSheetOffset(deltaY);
113
126
  var currentSheetHeight = lastMagneticArea - offset;
114
127
  var secondArea = magneticAreas[1];
115
128
  var isSecondArea = activeArea === secondArea;
116
- var canClose = magneticAreas[0] === 0 && dir === 'Down';
129
+ var canClose = magneticAreas[0] === 0 && deltaY >= 0;
117
130
  var shouldCloseByOffset = isSecondArea && canClose && 1 - currentSheetHeight / activeArea > CLOSE_OFFSET;
118
131
  if (shouldCloseByOffset) {
119
132
  onClose();
@@ -136,16 +149,21 @@ var BottomSheet = forwardRef(function (_a, ref) {
136
149
  setSheetOffset(lastMagneticArea - nearestArea);
137
150
  setActiveArea(nearestArea);
138
151
  setBackdropOpacity(1);
152
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nearestArea));
139
153
  }
140
154
  };
141
155
  /**
142
156
  * Если контент внутри шторки скроллится - то шторка не должна свайпаться
143
157
  * Если шапка внутри шторки зафиксирована - то шторка должна свайпаться только в области шапки
144
158
  */
145
- var shouldSkipSwiping = function (dir, startY) {
159
+ var shouldSkipSwiping = function (deltaY, startY, event) {
160
+ var _a;
146
161
  if (!swipeable)
147
162
  return true;
148
- if (scrollLockedProp || swipingInProgress.current)
163
+ if (!swipeableContent && ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
164
+ return true;
165
+ }
166
+ if (scrollLockedProp || swipingInProgress)
149
167
  return false;
150
168
  var scrollableNode = scrollableContainer.current;
151
169
  // Точка верхней границы (y координата)
@@ -157,35 +175,43 @@ var BottomSheet = forwardRef(function (_a, ref) {
157
175
  Math.abs(bottomSheetTopY - startY) <= headerRef.current.clientHeight)) {
158
176
  return false;
159
177
  }
160
- return dir === 'Down'
178
+ var shouldScroll = deltaY >= 0
161
179
  ? scrollableNode.scrollTop > 0
162
180
  : scrollableNode.scrollHeight -
163
181
  scrollableNode.scrollTop -
164
182
  scrollableNode.clientHeight >
165
183
  SCROLL_OFFSET;
184
+ if (!scrollOccurred.current && shouldScroll) {
185
+ scrollOccurred.current = true;
186
+ }
187
+ return shouldScroll;
166
188
  };
167
189
  var handleSheetSwipe = function (_a) {
168
- var dir = _a.dir, initial = _a.initial, velocity = _a.velocity, deltaY = _a.deltaY;
169
- if (shouldSkipSwiping(dir, initial[1])) {
190
+ var initial = _a.initial, velocity = _a.velocity, deltaY = _a.deltaY, event = _a.event;
191
+ if (scrollOccurred.current || shouldSkipSwiping(deltaY, initial[1], event)) {
170
192
  return;
171
193
  }
172
- magnetize(dir, velocity, deltaY);
194
+ magnetize(velocity, deltaY);
173
195
  };
174
196
  var handleSheetSwipeStart = function (_a) {
175
- var dir = _a.dir, initial = _a.initial;
176
- if (shouldSkipSwiping(dir, initial[1])) {
197
+ var deltaY = _a.deltaY, initial = _a.initial, event = _a.event;
198
+ if (shouldSkipSwiping(deltaY, initial[1], event)) {
177
199
  return;
178
200
  }
179
- swipingInProgress.current = true;
201
+ setSwipingInProgress(true);
180
202
  };
181
- var handleSheetSwiped = function () {
182
- swipingInProgress.current = false;
203
+ var handleTouchEnd = function () {
204
+ setSwipingInProgress(false);
205
+ scrollOccurred.current = false;
183
206
  };
184
207
  var handleSheetSwiping = function (_a) {
185
- var initial = _a.initial, deltaY = _a.deltaY, dir = _a.dir;
186
- if (shouldSkipSwiping(dir, initial[1])) {
208
+ var initial = _a.initial, deltaY = _a.deltaY, event = _a.event;
209
+ if (scrollOccurred.current || shouldSkipSwiping(deltaY, initial[1], event)) {
187
210
  return;
188
211
  }
212
+ if (!swipingInProgress) {
213
+ setSwipingInProgress(true);
214
+ }
189
215
  var offset = getSheetOffset(deltaY);
190
216
  var opacity = getBackdropOpacity(offset);
191
217
  setSheetOffset(offset);
@@ -194,26 +220,40 @@ var BottomSheet = forwardRef(function (_a, ref) {
194
220
  var sheetSwipeableHandlers = useSwipeable({
195
221
  onSwipeStart: handleSheetSwipeStart,
196
222
  onSwiping: handleSheetSwiping,
197
- onSwipedDown: handleSheetSwipe,
198
- onSwipedUp: handleSheetSwipe,
199
- onSwiped: handleSheetSwiped,
223
+ onSwiped: handleSheetSwipe,
224
+ onTouchEndOrOnMouseUp: handleTouchEnd,
200
225
  trackMouse: swipeable,
201
- delta: 5,
226
+ delta: swipeThreshold,
202
227
  });
203
228
  var handleExited = function (node) {
204
229
  var idx = initialActiveAreaIndex;
230
+ var nextArea = hasInitialIdx ? magneticAreas[idx] : lastMagneticArea;
205
231
  setBackdropOpacity(1);
206
232
  setSheetOffset(hasInitialIdx ? lastMagneticArea - magneticAreas[idx] : magneticAreas[0]);
207
- setActiveArea(hasInitialIdx ? magneticAreas[idx] : lastMagneticArea);
233
+ setActiveArea(nextArea);
234
+ onMagnetizeEnd === null || onMagnetizeEnd === void 0 ? void 0 : onMagnetizeEnd();
208
235
  if (transitionProps.onExited) {
209
236
  transitionProps.onExited(node);
210
237
  }
211
238
  };
239
+ var handleEnter = function (node, isAppearing) {
240
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(initialActiveAreaIndex || magneticAreas.length - 1);
241
+ if (transitionProps.onEnter) {
242
+ transitionProps.onEnter(node, isAppearing);
243
+ }
244
+ };
245
+ var handleExit = function (node) {
246
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(0);
247
+ if (transitionProps.onExit) {
248
+ transitionProps.onExit(node);
249
+ }
250
+ };
212
251
  var handleEntered = function (node, isAppearing) {
213
252
  setBackdropOpacity(1);
214
253
  setSheetHeight();
215
254
  // Ready for swiping
216
- swipingInProgress.current = false;
255
+ setSwipingInProgress(false);
256
+ onMagnetizeEnd === null || onMagnetizeEnd === void 0 ? void 0 : onMagnetizeEnd();
217
257
  if (transitionProps.onEntered) {
218
258
  transitionProps.onEntered(node, isAppearing);
219
259
  }
@@ -227,9 +267,13 @@ var BottomSheet = forwardRef(function (_a, ref) {
227
267
  // eslint-disable-next-line react-hooks/exhaustive-deps
228
268
  }, [isFirstRender]);
229
269
  useEffect(function () {
230
- onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(open ? getActiveAreaIndex(activeArea) : 0);
231
- // eslint-disable-next-line react-hooks/exhaustive-deps
232
- }, [activeArea, open]);
270
+ if (!sheetRef.current)
271
+ return;
272
+ var maxOffset = fullHeight - headerOffset;
273
+ var offset = open ? sheetOffset : maxOffset;
274
+ var percent = (offset / maxOffset) * 100;
275
+ onOffsetChange === null || onOffsetChange === void 0 ? void 0 : onOffsetChange(offset, percent);
276
+ }, [fullHeight, headerOffset, onOffsetChange, open, sheetOffset]);
233
277
  useImperativeHandle(bottomSheetInstanceRef, function () { return ({
234
278
  scrollToArea: scrollToArea,
235
279
  }); });
@@ -243,21 +287,23 @@ var BottomSheet = forwardRef(function (_a, ref) {
243
287
  var bgClassName = backgroundColor && styles["background-".concat(backgroundColor)];
244
288
  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 = {},
245
289
  _b[styles.disabledPointerEvents] = hideOverlay,
246
- _b)), disableBlockingScroll: disableBlockingScroll, disableFocusLock: disableFocusLock, transitionProps: __assign(__assign({ appear: true, timeout: TIMEOUT, classNames: styles }, transitionProps), { onExited: handleExited, onEntered: handleEntered }), disableAutoFocus: disableAutoFocus, disableEscapeKeyDown: disableEscapeKeyDown, disableRestoreFocus: disableRestoreFocus, keepMounted: keepMounted },
247
- React.createElement("div", { style: __assign({}, getHeightStyles()), className: styles.wrapper, onTransitionEnd: setSheetHeight },
248
- React.createElement("div", __assign({ className: cn(styles.component, bgClassName, className, (_c = {},
249
- _c[styles.withTransition] = swipingInProgress.current === false,
250
- _c)), style: __assign(__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: setSheetHeight }),
251
- React.createElement("div", __assign({}, containerProps, { className: cn(styles.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_d = {},
252
- _d[styles.scrollLocked] = scrollLockedProp || swipingInProgress.current,
253
- _d[styles.hiddenScrollbar] = hideScrollbar,
254
- _d)), ref: mergeRefs([scrollableContainer, scrollableContainerRef]) }),
290
+ _b)), disableBlockingScroll: disableBlockingScroll, disableFocusLock: disableFocusLock, transitionProps: __assign(__assign({ appear: true, timeout: TIMEOUT, classNames: styles }, transitionProps), { onExited: handleExited, onEntered: handleEntered, onEnter: handleEnter, onExit: handleExit }), disableAutoFocus: disableAutoFocus, disableEscapeKeyDown: disableEscapeKeyDown, disableRestoreFocus: disableRestoreFocus, keepMounted: keepMounted },
291
+ React.createElement("div", { style: __assign({}, getHeightStyles()), className: cn(styles.wrapper, (_c = {},
292
+ _c[styles.fullscreen] = headerOffset === 0 && sheetOffset === 0,
293
+ _c)), onTransitionEnd: setSheetHeight },
294
+ React.createElement("div", __assign({ className: cn(styles.component, bgClassName, className, (_d = {},
295
+ _d[styles.withTransition] = swipingInProgress === false,
296
+ _d)), style: __assign(__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: handleTransitionEnd }),
297
+ React.createElement("div", __assign({}, containerProps, { className: cn(styles.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_e = {},
298
+ _e[styles.scrollLocked] = scrollLockedProp || swipingInProgress,
299
+ _e[styles.hiddenScrollbar] = hideScrollbar,
300
+ _e)), ref: mergeRefs([scrollableContainer, scrollableContainerRef]) }),
255
301
  swipeable && React.createElement("div", { className: cn(styles.marker) }),
256
302
  !hideHeader && !emptyHeader && React.createElement(Header, __assign({}, headerProps)),
257
- React.createElement("div", { className: cn(styles.content, contentClassName, (_e = {},
258
- _e[styles.noHeader] = hideHeader || emptyHeader,
259
- _e[styles.noFooter] = !actionButton,
260
- _e)) }, children),
303
+ React.createElement("div", { ref: contentRef, className: cn(styles.content, contentClassName, (_f = {},
304
+ _f[styles.noHeader] = hideHeader || emptyHeader,
305
+ _f[styles.noFooter] = !actionButton,
306
+ _f)) }, children),
261
307
  actionButton && (React.createElement(Footer, { sticky: stickyFooter, className: cn(bgClassName, footerClassName) }, actionButton)))))));
262
308
  });
263
309
 
@@ -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-sheet__footer_lxt3v","sticky":"bottom-sheet__sticky_lxt3v","highlighted":"bottom-sheet__highlighted_lxt3v","background-accent":"bottom-sheet__background-accent_lxt3v","background-info":"bottom-sheet__background-info_lxt3v","background-attention-muted":"bottom-sheet__background-attention-muted_lxt3v","background-positive-muted":"bottom-sheet__background-positive-muted_lxt3v","background-negative-muted":"bottom-sheet__background-negative-muted_lxt3v","background-primary":"bottom-sheet__background-primary_lxt3v","background-primary-inverted":"bottom-sheet__background-primary-inverted_lxt3v","background-secondary":"bottom-sheet__background-secondary_lxt3v","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_lxt3v","background-tertiary":"bottom-sheet__background-tertiary_lxt3v","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_lxt3v","background-quaternary":"bottom-sheet__background-quaternary_lxt3v","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_lxt3v","background-specialbg-component":"bottom-sheet__background-specialbg-component_lxt3v","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_lxt3v","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_lxt3v","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_lxt3v","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_lxt3v","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_lxt3v","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_lxt3v","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_lxt3v","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_lxt3v"};
5
+ var styles = {"footer":"bottom-sheet__footer_idw6b","sticky":"bottom-sheet__sticky_idw6b","highlighted":"bottom-sheet__highlighted_idw6b","background-accent":"bottom-sheet__background-accent_idw6b","background-info":"bottom-sheet__background-info_idw6b","background-attention-muted":"bottom-sheet__background-attention-muted_idw6b","background-positive-muted":"bottom-sheet__background-positive-muted_idw6b","background-negative-muted":"bottom-sheet__background-negative-muted_idw6b","background-primary":"bottom-sheet__background-primary_idw6b","background-primary-inverted":"bottom-sheet__background-primary-inverted_idw6b","background-secondary":"bottom-sheet__background-secondary_idw6b","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_idw6b","background-tertiary":"bottom-sheet__background-tertiary_idw6b","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_idw6b","background-quaternary":"bottom-sheet__background-quaternary_idw6b","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_idw6b","background-specialbg-component":"bottom-sheet__background-specialbg-component_idw6b","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_idw6b","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_idw6b","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_idw6b","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_idw6b","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_idw6b","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_idw6b","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_idw6b","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_idw6b"};
6
6
  require('./index.css')
7
7
 
8
8
  var Footer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: v6ubm */
1
+ /* hash: 7xgye */
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-sheet__footer_lxt3v {
44
+ } .bottom-sheet__footer_idw6b {
45
45
  padding: var(--gap-m) var(--gap-m);
46
46
  background-color: var(--color-light-bg-primary);
47
- } .bottom-sheet__sticky_lxt3v {
47
+ } .bottom-sheet__sticky_idw6b {
48
48
  position: sticky;
49
49
  bottom: 0;
50
50
  z-index: 1;
51
- } .bottom-sheet__highlighted_lxt3v {
51
+ } .bottom-sheet__highlighted_idw6b {
52
52
  border-top: var(--bottom-sheet-footer-border-top);
53
53
  background-color: var(--bottom-sheet-footer-background-color);
54
- } .bottom-sheet__background-accent_lxt3v {
54
+ } .bottom-sheet__background-accent_idw6b {
55
55
  background-color: var(--color-light-bg-accent);
56
- } .bottom-sheet__background-info_lxt3v {
56
+ } .bottom-sheet__background-info_idw6b {
57
57
  background-color: var(--color-light-bg-info);
58
- } .bottom-sheet__background-attention-muted_lxt3v {
58
+ } .bottom-sheet__background-attention-muted_idw6b {
59
59
  background-color: var(--color-light-bg-attention-muted);
60
- } .bottom-sheet__background-positive-muted_lxt3v {
60
+ } .bottom-sheet__background-positive-muted_idw6b {
61
61
  background-color: var(--color-light-bg-positive-muted);
62
- } .bottom-sheet__background-negative-muted_lxt3v {
62
+ } .bottom-sheet__background-negative-muted_idw6b {
63
63
  background-color: var(--color-light-bg-negative-muted);
64
- } .bottom-sheet__background-primary_lxt3v {
64
+ } .bottom-sheet__background-primary_idw6b {
65
65
  background-color: var(--color-light-bg-primary);
66
- } .bottom-sheet__background-primary-inverted_lxt3v {
66
+ } .bottom-sheet__background-primary-inverted_idw6b {
67
67
  background-color: var(--color-light-bg-primary-inverted);
68
- } .bottom-sheet__background-secondary_lxt3v {
68
+ } .bottom-sheet__background-secondary_idw6b {
69
69
  background-color: var(--color-light-bg-secondary);
70
- } .bottom-sheet__background-secondary-inverted_lxt3v {
70
+ } .bottom-sheet__background-secondary-inverted_idw6b {
71
71
  background-color: var(--color-light-bg-secondary-inverted);
72
- } .bottom-sheet__background-tertiary_lxt3v {
72
+ } .bottom-sheet__background-tertiary_idw6b {
73
73
  background-color: var(--color-light-bg-tertiary);
74
- } .bottom-sheet__background-tertiary-inverted_lxt3v {
74
+ } .bottom-sheet__background-tertiary-inverted_idw6b {
75
75
  background-color: var(--color-light-bg-tertiary-inverted);
76
- } .bottom-sheet__background-quaternary_lxt3v {
76
+ } .bottom-sheet__background-quaternary_idw6b {
77
77
  background-color: var(--color-light-bg-quaternary);
78
- } .bottom-sheet__background-quaternary-inverted_lxt3v {
78
+ } .bottom-sheet__background-quaternary-inverted_idw6b {
79
79
  background-color: var(--color-light-bg-quaternary-inverted);
80
- } .bottom-sheet__background-specialbg-component_lxt3v {
80
+ } .bottom-sheet__background-specialbg-component_idw6b {
81
81
  background-color: var(--color-light-specialbg-component);
82
- } .bottom-sheet__background-specialbg-component-inverted_lxt3v {
82
+ } .bottom-sheet__background-specialbg-component-inverted_idw6b {
83
83
  background-color: var(--color-light-specialbg-component-inverted);
84
- } .bottom-sheet__background-specialbg-primary-grouped_lxt3v {
84
+ } .bottom-sheet__background-specialbg-primary-grouped_idw6b {
85
85
  background-color: var(--color-light-specialbg-primary-grouped);
86
- } .bottom-sheet__background-specialbg-secondary-grouped_lxt3v {
86
+ } .bottom-sheet__background-specialbg-secondary-grouped_idw6b {
87
87
  background-color: var(--color-light-specialbg-secondary-grouped);
88
- } .bottom-sheet__background-specialbg-tertiary-grouped_lxt3v {
88
+ } .bottom-sheet__background-specialbg-tertiary-grouped_idw6b {
89
89
  background-color: var(--color-light-specialbg-tertiary-grouped);
90
- } .bottom-sheet__background-specialbg-secondary-transparent_lxt3v {
90
+ } .bottom-sheet__background-specialbg-secondary-transparent_idw6b {
91
91
  background-color: var(--color-light-specialbg-secondary-transparent);
92
- } .bottom-sheet__background-specialbg-secondary-transparent-inverted_lxt3v {
92
+ } .bottom-sheet__background-specialbg-secondary-transparent-inverted_idw6b {
93
93
  background-color: var(--color-light-specialbg-secondary-transparent-inverted);
94
- } .bottom-sheet__background-specialbg-tertiary-transparent_lxt3v {
94
+ } .bottom-sheet__background-specialbg-tertiary-transparent_idw6b {
95
95
  background-color: var(--color-light-specialbg-tertiary-transparent);
96
- } .bottom-sheet__background-specialbg-tertiary-transparent-inverted_lxt3v {
96
+ } .bottom-sheet__background-specialbg-tertiary-transparent-inverted_idw6b {
97
97
  background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
98
98
  }
@@ -2,6 +2,7 @@ import { FC, RefObject } from 'react';
2
2
  import { NavigationBarProps } from "@alfalab/core-components-navigation-bar";
3
3
  type HeaderProps = Omit<NavigationBarProps, 'view' | 'size'> & {
4
4
  headerRef: RefObject<HTMLDivElement>;
5
+ headerOffset: number;
5
6
  };
6
7
  declare const Header: FC<HeaderProps>;
7
8
  export { HeaderProps, Header };
@@ -3,18 +3,17 @@ import React, { useContext, useEffect } from 'react';
3
3
  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
- import { HEADER_OFFSET } from '../../utils.js';
7
6
 
8
- var styles = {"headerWrapper":"bottom-sheet__headerWrapper_sn0d0","hasContent":"bottom-sheet__hasContent_sn0d0","header":"bottom-sheet__header_sn0d0","sticky":"bottom-sheet__sticky_sn0d0","highlighted":"bottom-sheet__highlighted_sn0d0","justifyEnd":"bottom-sheet__justifyEnd_sn0d0","addon":"bottom-sheet__addon_sn0d0","addonFixed":"bottom-sheet__addonFixed_sn0d0","title":"bottom-sheet__title_sn0d0","titleCenter":"bottom-sheet__titleCenter_sn0d0","titleLeft":"bottom-sheet__titleLeft_sn0d0","trimTitle":"bottom-sheet__trimTitle_sn0d0"};
7
+ var styles = {"headerWrapper":"bottom-sheet__headerWrapper_5k9j1","hasContent":"bottom-sheet__hasContent_5k9j1","header":"bottom-sheet__header_5k9j1","sticky":"bottom-sheet__sticky_5k9j1","highlighted":"bottom-sheet__highlighted_5k9j1","justifyEnd":"bottom-sheet__justifyEnd_5k9j1","addon":"bottom-sheet__addon_5k9j1","addonFixed":"bottom-sheet__addonFixed_5k9j1","title":"bottom-sheet__title_5k9j1","titleCenter":"bottom-sheet__titleCenter_5k9j1","titleLeft":"bottom-sheet__titleLeft_5k9j1","trimTitle":"bottom-sheet__trimTitle_5k9j1"};
9
8
  require('./index.css')
10
9
 
11
10
  var Header = function (_a) {
12
11
  var _b;
13
- var className = _a.className, sticky = _a.sticky, headerRef = _a.headerRef, title = _a.title, children = _a.children, restProps = __rest(_a, ["className", "sticky", "headerRef", "title", "children"]);
12
+ var className = _a.className, sticky = _a.sticky, headerRef = _a.headerRef, headerOffset = _a.headerOffset, title = _a.title, children = _a.children, restProps = __rest(_a, ["className", "sticky", "headerRef", "headerOffset", "title", "children"]);
14
13
  var _c = useContext(BaseModalContext), setHeaderOffset = _c.setHeaderOffset, setHasHeader = _c.setHasHeader, headerHighlighted = _c.headerHighlighted, onClose = _c.onClose;
15
14
  useEffect(function () {
16
- setHeaderOffset(HEADER_OFFSET);
17
- }, [setHeaderOffset]);
15
+ setHeaderOffset(headerOffset);
16
+ }, [headerOffset, setHeaderOffset]);
18
17
  useEffect(function () {
19
18
  setHasHeader(true);
20
19
  }, [setHasHeader]);
@@ -1,4 +1,4 @@
1
- /* hash: yhu9a */
1
+ /* hash: 1pq8y */
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-sheet__headerWrapper_sn0d0 {
30
+ } .bottom-sheet__headerWrapper_5k9j1 {
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-sheet__hasContent_sn0d0 {
35
+ } .bottom-sheet__hasContent_5k9j1 {
36
36
  background-color: inherit;
37
- } .bottom-sheet__header_sn0d0 {
37
+ } .bottom-sheet__header_5k9j1 {
38
38
  display: flex;
39
- } .bottom-sheet__sticky_sn0d0 {
39
+ } .bottom-sheet__sticky_5k9j1 {
40
40
  position: sticky;
41
41
  top: 0;
42
- } .bottom-sheet__highlighted_sn0d0 {
42
+ } .bottom-sheet__highlighted_5k9j1 {
43
43
  border-bottom: var(--bottom-sheet-header-border-bottom);
44
- } .bottom-sheet__justifyEnd_sn0d0 {
44
+ } .bottom-sheet__justifyEnd_5k9j1 {
45
45
  justify-content: flex-end;
46
- } .bottom-sheet__addon_sn0d0 {
46
+ } .bottom-sheet__addon_5k9j1 {
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-sheet__addonFixed_sn0d0 {
52
+ } .bottom-sheet__addonFixed_5k9j1 {
53
53
  position: fixed;
54
- } .bottom-sheet__title_sn0d0 {
54
+ } .bottom-sheet__title_5k9j1 {
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-sheet__titleCenter_sn0d0 {
61
+ } .bottom-sheet__titleCenter_5k9j1 {
62
62
  text-align: center;
63
- } .bottom-sheet__titleLeft_sn0d0 {
63
+ } .bottom-sheet__titleLeft_5k9j1 {
64
64
  text-align: left;
65
- } .bottom-sheet__trimTitle_sn0d0 {
65
+ } .bottom-sheet__trimTitle_5k9j1 {
66
66
  white-space: nowrap;
67
67
  overflow: hidden;
68
68
  text-overflow: ellipsis;