@alfalab/core-components-bottom-sheet 6.4.2 → 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 +37 -1
  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 +37 -1
  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 +91 -45
  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 +37 -1
  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 +37 -1
  51. package/utils.d.ts +3 -3
  52. package/utils.js +4 -4
package/component.js CHANGED
@@ -9,6 +9,7 @@ var mergeRefs = require('react-merge-refs');
9
9
  var reactSwipeable = require('react-swipeable');
10
10
  var cn = require('classnames');
11
11
  var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
12
+ var coreComponentsShared = require('@alfalab/core-components-shared');
12
13
  var components_footer_Component = require('./components/footer/Component.js');
13
14
  var components_header_Component = require('./components/header/Component.js');
14
15
  var components_swipeableBackdrop_Component = require('./components/swipeable-backdrop/Component.js');
@@ -22,33 +23,32 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
22
23
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
23
24
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
24
25
 
25
- var getDataTestId = function (dataTestId, element) {
26
- var elementPart = element ? "-".concat(element.toLowerCase()) : '';
27
- return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
28
- };
29
-
30
- var styles = {"modal":"bottom-sheet__modal_7sflj","wrapper":"bottom-sheet__wrapper_7sflj","component":"bottom-sheet__component_7sflj","withTransition":"bottom-sheet__withTransition_7sflj","scrollableContainer":"bottom-sheet__scrollableContainer_7sflj","marker":"bottom-sheet__marker_7sflj","content":"bottom-sheet__content_7sflj","noHeader":"bottom-sheet__noHeader_7sflj","noFooter":"bottom-sheet__noFooter_7sflj","scrollLocked":"bottom-sheet__scrollLocked_7sflj","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_7sflj","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_7sflj","appear":"bottom-sheet__appear_7sflj","enter":"bottom-sheet__enter_7sflj","appearActive":"bottom-sheet__appearActive_7sflj","enterActive":"bottom-sheet__enterActive_7sflj","enterDone":"bottom-sheet__enterDone_7sflj","appearDone":"bottom-sheet__appearDone_7sflj","exit":"bottom-sheet__exit_7sflj","exitActive":"bottom-sheet__exitActive_7sflj","background-accent":"bottom-sheet__background-accent_7sflj","background-info":"bottom-sheet__background-info_7sflj","background-attention-muted":"bottom-sheet__background-attention-muted_7sflj","background-positive-muted":"bottom-sheet__background-positive-muted_7sflj","background-negative-muted":"bottom-sheet__background-negative-muted_7sflj","background-primary":"bottom-sheet__background-primary_7sflj","background-primary-inverted":"bottom-sheet__background-primary-inverted_7sflj","background-secondary":"bottom-sheet__background-secondary_7sflj","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_7sflj","background-tertiary":"bottom-sheet__background-tertiary_7sflj","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_7sflj","background-quaternary":"bottom-sheet__background-quaternary_7sflj","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_7sflj","background-specialbg-component":"bottom-sheet__background-specialbg-component_7sflj","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_7sflj","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_7sflj","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_7sflj","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_7sflj","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_7sflj","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_7sflj","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_7sflj","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_7sflj"};
26
+ 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"};
31
27
  require('./index.css')
32
28
 
33
29
  var BottomSheet = React.forwardRef(function (_a, ref) {
34
- var _b, _c, _d, _e;
35
- 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;
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;
36
32
  var hasInitialIdx = initialActiveAreaIndex !== undefined;
37
33
  var fullHeight = reactDiv100vh.use100vh() || 0;
38
34
  // Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
39
35
  var isFirstRender = fullHeight === 0;
40
36
  var magneticAreas = React.useMemo(function () {
41
37
  if (magneticAreasProp) {
42
- return magneticAreasProp.map(function (area) { return utils.convertPercentToNumber(area, fullHeight); });
38
+ return magneticAreasProp.map(function (area) {
39
+ return utils.convertPercentToNumber(area, fullHeight, headerOffset);
40
+ });
43
41
  }
44
- return [0, fullHeight - utils.HEADER_OFFSET];
45
- }, [fullHeight, magneticAreasProp]);
42
+ return [0, fullHeight - headerOffset];
43
+ }, [fullHeight, headerOffset, magneticAreasProp]);
46
44
  var lastMagneticArea = magneticAreas[magneticAreas.length - 1];
47
- var _p = React.useState(0), sheetOffset = _p[0], setSheetOffset = _p[1];
48
- var _q = React.useState(1), backdropOpacity = _q[0], setBackdropOpacity = _q[1];
49
- var _r = React.useState(0), activeArea = _r[0], setActiveArea = _r[1];
50
- var swipingInProgress = React.useRef(null);
45
+ var _t = React.useState(0), sheetOffset = _t[0], setSheetOffset = _t[1];
46
+ var _u = React.useState(1), backdropOpacity = _u[0], setBackdropOpacity = _u[1];
47
+ var _v = React.useState(0), activeArea = _v[0], setActiveArea = _v[1];
48
+ var _w = React.useState(null), swipingInProgress = _w[0], setSwipingInProgress = _w[1];
49
+ var scrollOccurred = React.useRef(false);
51
50
  var headerRef = React.useRef(null);
51
+ var contentRef = React.useRef(null);
52
52
  var sheetHeight = React.useRef(0);
53
53
  var sheetRef = React.useRef(null);
54
54
  var scrollableContainer = React.useRef(null);
@@ -56,7 +56,7 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
56
56
  var titleIsReactElement = React__default.default.isValidElement(title);
57
57
  var headerProps = tslib.__assign(tslib.__assign({}, (titleIsReactElement
58
58
  ? { children: title }
59
- : { 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 });
59
+ : { 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: coreComponentsShared.getDataTestId(dataTestId, 'header'), onBack: onBack, titleSize: titleSize, subtitle: subtitle, onClose: onClose });
60
60
  var getBackdropOpacity = function (offset) {
61
61
  var canClose = magneticAreas[0] === 0;
62
62
  var secondArea = magneticAreas[1];
@@ -81,8 +81,14 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
81
81
  sheetHeight.current = sheetRef.current.getBoundingClientRect().height - sheetOffset;
82
82
  }
83
83
  };
84
+ var handleTransitionEnd = function (event) {
85
+ setSheetHeight();
86
+ if (event.propertyName === 'transform' && event.target === event.currentTarget) {
87
+ onMagnetizeEnd === null || onMagnetizeEnd === void 0 ? void 0 : onMagnetizeEnd();
88
+ }
89
+ };
84
90
  var scrollToArea = function (idx) {
85
- swipingInProgress.current = false;
91
+ setSwipingInProgress(false);
86
92
  var nextArea = magneticAreas[idx];
87
93
  if (nextArea === 0) {
88
94
  onClose();
@@ -91,11 +97,12 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
91
97
  if (nextArea) {
92
98
  setActiveArea(nextArea);
93
99
  setSheetOffset(lastMagneticArea - nextArea);
100
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nextArea));
94
101
  }
95
102
  };
96
- var magnetize = function (dir, velocity, deltaY) {
97
- var shouldMagnetizeDownByVelocity = dir === 'Down' && velocity >= utils.SWIPE_VELOCITY;
98
- var shouldMagnetizeUpByVelocity = dir === 'Up' && velocity >= utils.SWIPE_VELOCITY;
103
+ var magnetize = function (velocity, deltaY) {
104
+ var shouldMagnetizeDownByVelocity = deltaY >= 0 && velocity >= utils.SWIPE_VELOCITY;
105
+ var shouldMagnetizeUpByVelocity = deltaY < 0 && velocity >= utils.SWIPE_VELOCITY;
99
106
  if (shouldMagnetizeDownByVelocity) {
100
107
  var nextArea_1 = magneticAreas
101
108
  .slice()
@@ -110,6 +117,9 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
110
117
  : lastMagneticArea - activeArea;
111
118
  setSheetOffset(offset_1);
112
119
  setActiveArea(function (prevState) { return nextArea_1 !== null && nextArea_1 !== void 0 ? nextArea_1 : prevState; });
120
+ if (nextArea_1) {
121
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nextArea_1));
122
+ }
113
123
  return;
114
124
  }
115
125
  if (shouldMagnetizeUpByVelocity) {
@@ -117,13 +127,16 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
117
127
  var offset_2 = nextArea_2 ? lastMagneticArea - nextArea_2 : 0;
118
128
  setSheetOffset(offset_2);
119
129
  setActiveArea(function (prevState) { return nextArea_2 !== null && nextArea_2 !== void 0 ? nextArea_2 : prevState; });
130
+ if (nextArea_2) {
131
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nextArea_2));
132
+ }
120
133
  return;
121
134
  }
122
135
  var offset = getSheetOffset(deltaY);
123
136
  var currentSheetHeight = lastMagneticArea - offset;
124
137
  var secondArea = magneticAreas[1];
125
138
  var isSecondArea = activeArea === secondArea;
126
- var canClose = magneticAreas[0] === 0 && dir === 'Down';
139
+ var canClose = magneticAreas[0] === 0 && deltaY >= 0;
127
140
  var shouldCloseByOffset = isSecondArea && canClose && 1 - currentSheetHeight / activeArea > utils.CLOSE_OFFSET;
128
141
  if (shouldCloseByOffset) {
129
142
  onClose();
@@ -146,16 +159,21 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
146
159
  setSheetOffset(lastMagneticArea - nearestArea);
147
160
  setActiveArea(nearestArea);
148
161
  setBackdropOpacity(1);
162
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(getActiveAreaIndex(nearestArea));
149
163
  }
150
164
  };
151
165
  /**
152
166
  * Если контент внутри шторки скроллится - то шторка не должна свайпаться
153
167
  * Если шапка внутри шторки зафиксирована - то шторка должна свайпаться только в области шапки
154
168
  */
155
- var shouldSkipSwiping = function (dir, startY) {
169
+ var shouldSkipSwiping = function (deltaY, startY, event) {
170
+ var _a;
156
171
  if (!swipeable)
157
172
  return true;
158
- if (scrollLockedProp || swipingInProgress.current)
173
+ if (!swipeableContent && ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
174
+ return true;
175
+ }
176
+ if (scrollLockedProp || swipingInProgress)
159
177
  return false;
160
178
  var scrollableNode = scrollableContainer.current;
161
179
  // Точка верхней границы (y координата)
@@ -167,35 +185,43 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
167
185
  Math.abs(bottomSheetTopY - startY) <= headerRef.current.clientHeight)) {
168
186
  return false;
169
187
  }
170
- return dir === 'Down'
188
+ var shouldScroll = deltaY >= 0
171
189
  ? scrollableNode.scrollTop > 0
172
190
  : scrollableNode.scrollHeight -
173
191
  scrollableNode.scrollTop -
174
192
  scrollableNode.clientHeight >
175
193
  utils.SCROLL_OFFSET;
194
+ if (!scrollOccurred.current && shouldScroll) {
195
+ scrollOccurred.current = true;
196
+ }
197
+ return shouldScroll;
176
198
  };
177
199
  var handleSheetSwipe = function (_a) {
178
- var dir = _a.dir, initial = _a.initial, velocity = _a.velocity, deltaY = _a.deltaY;
179
- if (shouldSkipSwiping(dir, initial[1])) {
200
+ var initial = _a.initial, velocity = _a.velocity, deltaY = _a.deltaY, event = _a.event;
201
+ if (scrollOccurred.current || shouldSkipSwiping(deltaY, initial[1], event)) {
180
202
  return;
181
203
  }
182
- magnetize(dir, velocity, deltaY);
204
+ magnetize(velocity, deltaY);
183
205
  };
184
206
  var handleSheetSwipeStart = function (_a) {
185
- var dir = _a.dir, initial = _a.initial;
186
- if (shouldSkipSwiping(dir, initial[1])) {
207
+ var deltaY = _a.deltaY, initial = _a.initial, event = _a.event;
208
+ if (shouldSkipSwiping(deltaY, initial[1], event)) {
187
209
  return;
188
210
  }
189
- swipingInProgress.current = true;
211
+ setSwipingInProgress(true);
190
212
  };
191
- var handleSheetSwiped = function () {
192
- swipingInProgress.current = false;
213
+ var handleTouchEnd = function () {
214
+ setSwipingInProgress(false);
215
+ scrollOccurred.current = false;
193
216
  };
194
217
  var handleSheetSwiping = function (_a) {
195
- var initial = _a.initial, deltaY = _a.deltaY, dir = _a.dir;
196
- if (shouldSkipSwiping(dir, initial[1])) {
218
+ var initial = _a.initial, deltaY = _a.deltaY, event = _a.event;
219
+ if (scrollOccurred.current || shouldSkipSwiping(deltaY, initial[1], event)) {
197
220
  return;
198
221
  }
222
+ if (!swipingInProgress) {
223
+ setSwipingInProgress(true);
224
+ }
199
225
  var offset = getSheetOffset(deltaY);
200
226
  var opacity = getBackdropOpacity(offset);
201
227
  setSheetOffset(offset);
@@ -204,26 +230,40 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
204
230
  var sheetSwipeableHandlers = reactSwipeable.useSwipeable({
205
231
  onSwipeStart: handleSheetSwipeStart,
206
232
  onSwiping: handleSheetSwiping,
207
- onSwipedDown: handleSheetSwipe,
208
- onSwipedUp: handleSheetSwipe,
209
- onSwiped: handleSheetSwiped,
233
+ onSwiped: handleSheetSwipe,
234
+ onTouchEndOrOnMouseUp: handleTouchEnd,
210
235
  trackMouse: swipeable,
211
- delta: 5,
236
+ delta: swipeThreshold,
212
237
  });
213
238
  var handleExited = function (node) {
214
239
  var idx = initialActiveAreaIndex;
240
+ var nextArea = hasInitialIdx ? magneticAreas[idx] : lastMagneticArea;
215
241
  setBackdropOpacity(1);
216
242
  setSheetOffset(hasInitialIdx ? lastMagneticArea - magneticAreas[idx] : magneticAreas[0]);
217
- setActiveArea(hasInitialIdx ? magneticAreas[idx] : lastMagneticArea);
243
+ setActiveArea(nextArea);
244
+ onMagnetizeEnd === null || onMagnetizeEnd === void 0 ? void 0 : onMagnetizeEnd();
218
245
  if (transitionProps.onExited) {
219
246
  transitionProps.onExited(node);
220
247
  }
221
248
  };
249
+ var handleEnter = function (node, isAppearing) {
250
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(initialActiveAreaIndex || magneticAreas.length - 1);
251
+ if (transitionProps.onEnter) {
252
+ transitionProps.onEnter(node, isAppearing);
253
+ }
254
+ };
255
+ var handleExit = function (node) {
256
+ onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(0);
257
+ if (transitionProps.onExit) {
258
+ transitionProps.onExit(node);
259
+ }
260
+ };
222
261
  var handleEntered = function (node, isAppearing) {
223
262
  setBackdropOpacity(1);
224
263
  setSheetHeight();
225
264
  // Ready for swiping
226
- swipingInProgress.current = false;
265
+ setSwipingInProgress(false);
266
+ onMagnetizeEnd === null || onMagnetizeEnd === void 0 ? void 0 : onMagnetizeEnd();
227
267
  if (transitionProps.onEntered) {
228
268
  transitionProps.onEntered(node, isAppearing);
229
269
  }
@@ -237,9 +277,13 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
237
277
  // eslint-disable-next-line react-hooks/exhaustive-deps
238
278
  }, [isFirstRender]);
239
279
  React.useEffect(function () {
240
- onMagnetize === null || onMagnetize === void 0 ? void 0 : onMagnetize(open ? getActiveAreaIndex(activeArea) : 0);
241
- // eslint-disable-next-line react-hooks/exhaustive-deps
242
- }, [activeArea, open]);
280
+ if (!sheetRef.current)
281
+ return;
282
+ var maxOffset = fullHeight - headerOffset;
283
+ var offset = open ? sheetOffset : maxOffset;
284
+ var percent = (offset / maxOffset) * 100;
285
+ onOffsetChange === null || onOffsetChange === void 0 ? void 0 : onOffsetChange(offset, percent);
286
+ }, [fullHeight, headerOffset, onOffsetChange, open, sheetOffset]);
243
287
  React.useImperativeHandle(bottomSheetInstanceRef, function () { return ({
244
288
  scrollToArea: scrollToArea,
245
289
  }); });
@@ -253,21 +297,23 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
253
297
  var bgClassName = backgroundColor && styles["background-".concat(backgroundColor)];
254
298
  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 = {},
255
299
  _b[styles.disabledPointerEvents] = hideOverlay,
256
- _b)), disableBlockingScroll: disableBlockingScroll, disableFocusLock: disableFocusLock, transitionProps: tslib.__assign(tslib.__assign({ appear: true, timeout: utils.TIMEOUT, classNames: styles }, transitionProps), { onExited: handleExited, onEntered: handleEntered }) },
257
- React__default.default.createElement("div", { style: tslib.__assign({}, getHeightStyles()), className: styles.wrapper, onTransitionEnd: setSheetHeight },
258
- React__default.default.createElement("div", tslib.__assign({ className: cn__default.default(styles.component, bgClassName, className, (_c = {},
259
- _c[styles.withTransition] = swipingInProgress.current === false,
260
- _c)), style: tslib.__assign(tslib.__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs__default.default([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: setSheetHeight }),
261
- React__default.default.createElement("div", tslib.__assign({}, containerProps, { className: cn__default.default(styles.scrollableContainer, containerProps === null || containerProps === void 0 ? void 0 : containerProps.className, containerClassName, (_d = {},
262
- _d[styles.scrollLocked] = scrollLockedProp || swipingInProgress.current,
263
- _d[styles.hiddenScrollbar] = hideScrollbar,
264
- _d)), ref: mergeRefs__default.default([scrollableContainer, scrollableContainerRef]) }),
300
+ _b)), disableBlockingScroll: disableBlockingScroll, disableFocusLock: disableFocusLock, transitionProps: tslib.__assign(tslib.__assign({ appear: true, timeout: utils.TIMEOUT, classNames: styles }, transitionProps), { onExited: handleExited, onEntered: handleEntered, onEnter: handleEnter, onExit: handleExit }), disableAutoFocus: disableAutoFocus, disableEscapeKeyDown: disableEscapeKeyDown, disableRestoreFocus: disableRestoreFocus, keepMounted: keepMounted },
301
+ React__default.default.createElement("div", { style: tslib.__assign({}, getHeightStyles()), className: cn__default.default(styles.wrapper, (_c = {},
302
+ _c[styles.fullscreen] = headerOffset === 0 && sheetOffset === 0,
303
+ _c)), onTransitionEnd: setSheetHeight },
304
+ React__default.default.createElement("div", tslib.__assign({ className: cn__default.default(styles.component, bgClassName, className, (_d = {},
305
+ _d[styles.withTransition] = swipingInProgress === false,
306
+ _d)), style: tslib.__assign(tslib.__assign({}, getSwipeStyles()), getHeightStyles()) }, sheetSwipeableHandlers, { ref: mergeRefs__default.default([sheetRef, sheetContainerRef, sheetSwipeableHandlers.ref]), onTransitionEnd: handleTransitionEnd }),
307
+ 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
+ _e[styles.scrollLocked] = scrollLockedProp || swipingInProgress,
309
+ _e[styles.hiddenScrollbar] = hideScrollbar,
310
+ _e)), ref: mergeRefs__default.default([scrollableContainer, scrollableContainerRef]) }),
265
311
  swipeable && React__default.default.createElement("div", { className: cn__default.default(styles.marker) }),
266
312
  !hideHeader && !emptyHeader && React__default.default.createElement(components_header_Component.Header, tslib.__assign({}, headerProps)),
267
- React__default.default.createElement("div", { className: cn__default.default(styles.content, contentClassName, (_e = {},
268
- _e[styles.noHeader] = hideHeader || emptyHeader,
269
- _e[styles.noFooter] = !actionButton,
270
- _e)) }, children),
313
+ React__default.default.createElement("div", { ref: contentRef, className: cn__default.default(styles.content, contentClassName, (_f = {},
314
+ _f[styles.noHeader] = hideHeader || emptyHeader,
315
+ _f[styles.noFooter] = !actionButton,
316
+ _f)) }, children),
271
317
  actionButton && (React__default.default.createElement(components_footer_Component.Footer, { sticky: stickyFooter, className: cn__default.default(bgClassName, footerClassName) }, actionButton)))))));
272
318
  });
273
319
 
@@ -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-sheet__footer_1boh7","sticky":"bottom-sheet__sticky_1boh7","highlighted":"bottom-sheet__highlighted_1boh7","background-accent":"bottom-sheet__background-accent_1boh7","background-info":"bottom-sheet__background-info_1boh7","background-attention-muted":"bottom-sheet__background-attention-muted_1boh7","background-positive-muted":"bottom-sheet__background-positive-muted_1boh7","background-negative-muted":"bottom-sheet__background-negative-muted_1boh7","background-primary":"bottom-sheet__background-primary_1boh7","background-primary-inverted":"bottom-sheet__background-primary-inverted_1boh7","background-secondary":"bottom-sheet__background-secondary_1boh7","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1boh7","background-tertiary":"bottom-sheet__background-tertiary_1boh7","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1boh7","background-quaternary":"bottom-sheet__background-quaternary_1boh7","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1boh7","background-specialbg-component":"bottom-sheet__background-specialbg-component_1boh7","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1boh7","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1boh7","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1boh7","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1boh7","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1boh7","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1boh7","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1boh7","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1boh7"};
14
+ 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"};
15
15
  require('./index.css')
16
16
 
17
17
  var Footer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: pan92 */
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_1boh7 {
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_1boh7 {
47
+ } .bottom-sheet__sticky_idw6b {
48
48
  position: sticky;
49
49
  bottom: 0;
50
50
  z-index: 1;
51
- } .bottom-sheet__highlighted_1boh7 {
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_1boh7 {
54
+ } .bottom-sheet__background-accent_idw6b {
55
55
  background-color: var(--color-light-bg-accent);
56
- } .bottom-sheet__background-info_1boh7 {
56
+ } .bottom-sheet__background-info_idw6b {
57
57
  background-color: var(--color-light-bg-info);
58
- } .bottom-sheet__background-attention-muted_1boh7 {
58
+ } .bottom-sheet__background-attention-muted_idw6b {
59
59
  background-color: var(--color-light-bg-attention-muted);
60
- } .bottom-sheet__background-positive-muted_1boh7 {
60
+ } .bottom-sheet__background-positive-muted_idw6b {
61
61
  background-color: var(--color-light-bg-positive-muted);
62
- } .bottom-sheet__background-negative-muted_1boh7 {
62
+ } .bottom-sheet__background-negative-muted_idw6b {
63
63
  background-color: var(--color-light-bg-negative-muted);
64
- } .bottom-sheet__background-primary_1boh7 {
64
+ } .bottom-sheet__background-primary_idw6b {
65
65
  background-color: var(--color-light-bg-primary);
66
- } .bottom-sheet__background-primary-inverted_1boh7 {
66
+ } .bottom-sheet__background-primary-inverted_idw6b {
67
67
  background-color: var(--color-light-bg-primary-inverted);
68
- } .bottom-sheet__background-secondary_1boh7 {
68
+ } .bottom-sheet__background-secondary_idw6b {
69
69
  background-color: var(--color-light-bg-secondary);
70
- } .bottom-sheet__background-secondary-inverted_1boh7 {
70
+ } .bottom-sheet__background-secondary-inverted_idw6b {
71
71
  background-color: var(--color-light-bg-secondary-inverted);
72
- } .bottom-sheet__background-tertiary_1boh7 {
72
+ } .bottom-sheet__background-tertiary_idw6b {
73
73
  background-color: var(--color-light-bg-tertiary);
74
- } .bottom-sheet__background-tertiary-inverted_1boh7 {
74
+ } .bottom-sheet__background-tertiary-inverted_idw6b {
75
75
  background-color: var(--color-light-bg-tertiary-inverted);
76
- } .bottom-sheet__background-quaternary_1boh7 {
76
+ } .bottom-sheet__background-quaternary_idw6b {
77
77
  background-color: var(--color-light-bg-quaternary);
78
- } .bottom-sheet__background-quaternary-inverted_1boh7 {
78
+ } .bottom-sheet__background-quaternary-inverted_idw6b {
79
79
  background-color: var(--color-light-bg-quaternary-inverted);
80
- } .bottom-sheet__background-specialbg-component_1boh7 {
80
+ } .bottom-sheet__background-specialbg-component_idw6b {
81
81
  background-color: var(--color-light-specialbg-component);
82
- } .bottom-sheet__background-specialbg-component-inverted_1boh7 {
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_1boh7 {
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_1boh7 {
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_1boh7 {
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_1boh7 {
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_1boh7 {
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_1boh7 {
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_1boh7 {
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 };
@@ -7,23 +7,22 @@ var React = require('react');
7
7
  var cn = require('classnames');
8
8
  var coreComponentsBaseModal = require('@alfalab/core-components-base-modal');
9
9
  var coreComponentsNavigationBar = require('@alfalab/core-components-navigation-bar');
10
- var utils = require('../../utils.js');
11
10
 
12
11
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
13
12
 
14
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
15
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
16
15
 
17
- var styles = {"headerWrapper":"bottom-sheet__headerWrapper_131bw","hasContent":"bottom-sheet__hasContent_131bw","header":"bottom-sheet__header_131bw","sticky":"bottom-sheet__sticky_131bw","highlighted":"bottom-sheet__highlighted_131bw","justifyEnd":"bottom-sheet__justifyEnd_131bw","addon":"bottom-sheet__addon_131bw","addonFixed":"bottom-sheet__addonFixed_131bw","title":"bottom-sheet__title_131bw","titleCenter":"bottom-sheet__titleCenter_131bw","titleLeft":"bottom-sheet__titleLeft_131bw","trimTitle":"bottom-sheet__trimTitle_131bw"};
16
+ 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"};
18
17
  require('./index.css')
19
18
 
20
19
  var Header = function (_a) {
21
20
  var _b;
22
- var className = _a.className, sticky = _a.sticky, headerRef = _a.headerRef, title = _a.title, children = _a.children, restProps = tslib.__rest(_a, ["className", "sticky", "headerRef", "title", "children"]);
21
+ var className = _a.className, sticky = _a.sticky, headerRef = _a.headerRef, headerOffset = _a.headerOffset, title = _a.title, children = _a.children, restProps = tslib.__rest(_a, ["className", "sticky", "headerRef", "headerOffset", "title", "children"]);
23
22
  var _c = React.useContext(coreComponentsBaseModal.BaseModalContext), setHeaderOffset = _c.setHeaderOffset, setHasHeader = _c.setHasHeader, headerHighlighted = _c.headerHighlighted, onClose = _c.onClose;
24
23
  React.useEffect(function () {
25
- setHeaderOffset(utils.HEADER_OFFSET);
26
- }, [setHeaderOffset]);
24
+ setHeaderOffset(headerOffset);
25
+ }, [headerOffset, setHeaderOffset]);
27
26
  React.useEffect(function () {
28
27
  setHasHeader(true);
29
28
  }, [setHasHeader]);
@@ -1,4 +1,4 @@
1
- /* hash: 82b7b */
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_131bw {
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_131bw {
35
+ } .bottom-sheet__hasContent_5k9j1 {
36
36
  background-color: inherit;
37
- } .bottom-sheet__header_131bw {
37
+ } .bottom-sheet__header_5k9j1 {
38
38
  display: flex;
39
- } .bottom-sheet__sticky_131bw {
39
+ } .bottom-sheet__sticky_5k9j1 {
40
40
  position: sticky;
41
41
  top: 0;
42
- } .bottom-sheet__highlighted_131bw {
42
+ } .bottom-sheet__highlighted_5k9j1 {
43
43
  border-bottom: var(--bottom-sheet-header-border-bottom);
44
- } .bottom-sheet__justifyEnd_131bw {
44
+ } .bottom-sheet__justifyEnd_5k9j1 {
45
45
  justify-content: flex-end;
46
- } .bottom-sheet__addon_131bw {
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_131bw {
52
+ } .bottom-sheet__addonFixed_5k9j1 {
53
53
  position: fixed;
54
- } .bottom-sheet__title_131bw {
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_131bw {
61
+ } .bottom-sheet__titleCenter_5k9j1 {
62
62
  text-align: center;
63
- } .bottom-sheet__titleLeft_131bw {
63
+ } .bottom-sheet__titleLeft_5k9j1 {
64
64
  text-align: left;
65
- } .bottom-sheet__trimTitle_131bw {
65
+ } .bottom-sheet__trimTitle_5k9j1 {
66
66
  white-space: nowrap;
67
67
  overflow: hidden;
68
68
  text-overflow: ellipsis;