@alfalab/core-components-bottom-sheet 6.15.6 → 6.16.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 (44) hide show
  1. package/component.js +16 -9
  2. package/components/footer/Component.js +1 -1
  3. package/components/footer/index.css +26 -26
  4. package/components/header/Component.js +1 -1
  5. package/components/header/index.css +13 -13
  6. package/cssm/component.js +15 -8
  7. package/cssm/hooks/index.d.ts +1 -0
  8. package/cssm/hooks/index.js +9 -0
  9. package/cssm/hooks/use-visualviewport-size.d.ts +3 -0
  10. package/cssm/hooks/use-visualviewport-size.js +36 -0
  11. package/cssm/types.d.ts +4 -0
  12. package/esm/component.js +16 -9
  13. package/esm/components/footer/Component.js +1 -1
  14. package/esm/components/footer/index.css +26 -26
  15. package/esm/components/header/Component.js +1 -1
  16. package/esm/components/header/index.css +13 -13
  17. package/esm/hooks/index.d.ts +1 -0
  18. package/esm/hooks/index.js +1 -0
  19. package/esm/hooks/use-visualviewport-size.d.ts +3 -0
  20. package/esm/hooks/use-visualviewport-size.js +32 -0
  21. package/esm/index.css +45 -45
  22. package/esm/types.d.ts +4 -0
  23. package/hooks/index.d.ts +1 -0
  24. package/hooks/index.js +9 -0
  25. package/hooks/use-visualviewport-size.d.ts +3 -0
  26. package/hooks/use-visualviewport-size.js +36 -0
  27. package/index.css +45 -45
  28. package/modern/component.js +11 -5
  29. package/modern/components/footer/Component.js +1 -1
  30. package/modern/components/footer/index.css +26 -26
  31. package/modern/components/header/Component.js +1 -1
  32. package/modern/components/header/index.css +13 -13
  33. package/modern/hooks/index.d.ts +1 -0
  34. package/modern/hooks/index.js +1 -0
  35. package/modern/hooks/use-visualviewport-size.d.ts +3 -0
  36. package/modern/hooks/use-visualviewport-size.js +27 -0
  37. package/modern/index.css +45 -45
  38. package/modern/types.d.ts +4 -0
  39. package/package.json +2 -2
  40. package/src/component.tsx +12 -3
  41. package/src/hooks/index.ts +1 -0
  42. package/src/hooks/use-visualviewport-size.ts +39 -0
  43. package/src/types.ts +5 -0
  44. package/types.d.ts +4 -0
package/component.js CHANGED
@@ -14,6 +14,7 @@ var components_footer_Component = require('./components/footer/Component.js');
14
14
  var components_header_Component = require('./components/header/Component.js');
15
15
  var components_swipeableBackdrop_Component = require('./components/swipeable-backdrop/Component.js');
16
16
  var consts_swipeConsts = require('./consts/swipeConsts.js');
17
+ var hooks_useVisualviewportSize = require('./hooks/use-visualviewport-size.js');
17
18
  var utils = require('./utils.js');
18
19
 
19
20
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -22,14 +23,17 @@ 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 styles = {"modal":"bottom-sheet__modal_e10od","wrapper":"bottom-sheet__wrapper_e10od","fullscreen":"bottom-sheet__fullscreen_e10od","component":"bottom-sheet__component_e10od","withTransition":"bottom-sheet__withTransition_e10od","scrollableContainer":"bottom-sheet__scrollableContainer_e10od","marker":"bottom-sheet__marker_e10od","defaultMarker":"bottom-sheet__defaultMarker_e10od","content":"bottom-sheet__content_e10od","noHeader":"bottom-sheet__noHeader_e10od","noFooter":"bottom-sheet__noFooter_e10od","scrollLocked":"bottom-sheet__scrollLocked_e10od","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_e10od","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_e10od","appear":"bottom-sheet__appear_e10od","enter":"bottom-sheet__enter_e10od","appearActive":"bottom-sheet__appearActive_e10od","enterActive":"bottom-sheet__enterActive_e10od","enterDone":"bottom-sheet__enterDone_e10od","appearDone":"bottom-sheet__appearDone_e10od","exit":"bottom-sheet__exit_e10od","exitActive":"bottom-sheet__exitActive_e10od","safeAreaBottom":"bottom-sheet__safeAreaBottom_e10od","background-accent":"bottom-sheet__background-accent_e10od","background-info":"bottom-sheet__background-info_e10od","background-attention-muted":"bottom-sheet__background-attention-muted_e10od","background-positive-muted":"bottom-sheet__background-positive-muted_e10od","background-negative-muted":"bottom-sheet__background-negative-muted_e10od","background-primary":"bottom-sheet__background-primary_e10od","background-primary-inverted":"bottom-sheet__background-primary-inverted_e10od","background-secondary":"bottom-sheet__background-secondary_e10od","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_e10od","background-tertiary":"bottom-sheet__background-tertiary_e10od","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_e10od","background-quaternary":"bottom-sheet__background-quaternary_e10od","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_e10od","background-specialbg-component":"bottom-sheet__background-specialbg-component_e10od","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_e10od","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_e10od","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_e10od","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_e10od","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_e10od","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_e10od","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_e10od","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_e10od"};
26
+ var styles = {"modal":"bottom-sheet__modal_90r42","wrapper":"bottom-sheet__wrapper_90r42","fullscreen":"bottom-sheet__fullscreen_90r42","component":"bottom-sheet__component_90r42","withTransition":"bottom-sheet__withTransition_90r42","scrollableContainer":"bottom-sheet__scrollableContainer_90r42","marker":"bottom-sheet__marker_90r42","defaultMarker":"bottom-sheet__defaultMarker_90r42","content":"bottom-sheet__content_90r42","noHeader":"bottom-sheet__noHeader_90r42","noFooter":"bottom-sheet__noFooter_90r42","scrollLocked":"bottom-sheet__scrollLocked_90r42","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_90r42","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_90r42","appear":"bottom-sheet__appear_90r42","enter":"bottom-sheet__enter_90r42","appearActive":"bottom-sheet__appearActive_90r42","enterActive":"bottom-sheet__enterActive_90r42","enterDone":"bottom-sheet__enterDone_90r42","appearDone":"bottom-sheet__appearDone_90r42","exit":"bottom-sheet__exit_90r42","exitActive":"bottom-sheet__exitActive_90r42","safeAreaBottom":"bottom-sheet__safeAreaBottom_90r42","background-accent":"bottom-sheet__background-accent_90r42","background-info":"bottom-sheet__background-info_90r42","background-attention-muted":"bottom-sheet__background-attention-muted_90r42","background-positive-muted":"bottom-sheet__background-positive-muted_90r42","background-negative-muted":"bottom-sheet__background-negative-muted_90r42","background-primary":"bottom-sheet__background-primary_90r42","background-primary-inverted":"bottom-sheet__background-primary-inverted_90r42","background-secondary":"bottom-sheet__background-secondary_90r42","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_90r42","background-tertiary":"bottom-sheet__background-tertiary_90r42","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_90r42","background-quaternary":"bottom-sheet__background-quaternary_90r42","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_90r42","background-specialbg-component":"bottom-sheet__background-specialbg-component_90r42","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_90r42","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_90r42","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_90r42","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_90r42","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_90r42","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_90r42","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_90r42","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_90r42"};
26
27
  require('./index.css')
27
28
 
28
29
  var isNil = coreComponentsShared.fnUtils.isNil;
29
30
  var BottomSheet = React.forwardRef(function (_a, ref) {
30
31
  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, onSwipeStart = _a.onSwipeStart, onSwipeEnd = _a.onSwipeEnd, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName, backButtonProps = _a.backButtonProps, _t = _a.iOSLock, iOSLock = _t === void 0 ? false : _t;
32
- var fullHeight = reactDiv100vh.use100vh() || 0;
32
+ var _g, _h;
33
+ var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _j = _a.titleSize, titleSize = _j === void 0 ? 'default' : _j, 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, _k = _a.titleAlign, titleAlign = _k === void 0 ? 'left' : _k, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _l = _a.stickyFooter, stickyFooter = _l === void 0 ? true : _l, _m = _a.initialHeight, initialHeight = _m === void 0 ? 'default' : _m, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _o = _a.transitionProps, transitionProps = _o === void 0 ? {} : _o, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _p = _a.swipeable, swipeable = _p === void 0 ? true : _p, _q = _a.swipeableContent, swipeableContent = _q === void 0 ? true : _q, _r = _a.swipeThreshold, swipeThreshold = _r === void 0 ? 5 : _r, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _s = _a.scrollableContainerRef, scrollableContainerRef = _s === void 0 ? function () { return null; } : _s, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _t = _a.sheetContainerRef, sheetContainerRef = _t === void 0 ? function () { return null; } : _t, _u = _a.headerOffset, headerOffset = _u === void 0 ? 24 : _u, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, onSwipeStart = _a.onSwipeStart, onSwipeEnd = _a.onSwipeEnd, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName, backButtonProps = _a.backButtonProps, _v = _a.iOSLock, iOSLock = _v === void 0 ? false : _v, _w = _a.virtualKeyboard, virtualKeyboard = _w === void 0 ? false : _w;
34
+ var windowHeight = (_g = reactDiv100vh.use100vh()) !== null && _g !== void 0 ? _g : 0;
35
+ var visibleViewportSize = hooks_useVisualviewportSize.useVisibleViewportSize(virtualKeyboard);
36
+ var fullHeight = virtualKeyboard ? (_h = visibleViewportSize === null || visibleViewportSize === void 0 ? void 0 : visibleViewportSize.height) !== null && _h !== void 0 ? _h : 0 : windowHeight;
33
37
  // Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
34
38
  var isFirstRender = fullHeight === 0;
35
39
  var initialIndexRef = React.useRef(initialActiveAreaIndex);
@@ -43,14 +47,14 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
43
47
  var iOSViewHeight = coreComponentsShared.isClient()
44
48
  ? ((_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || (window === null || window === void 0 ? void 0 : window.innerHeight)
45
49
  : 0;
46
- var viewHeight = coreComponentsShared.os.isIOS() ? iOSViewHeight : fullHeight;
50
+ var viewHeight = coreComponentsShared.os.isIOS() && !virtualKeyboard ? iOSViewHeight : fullHeight;
47
51
  return [0, viewHeight - headerOffset];
48
- }, [fullHeight, headerOffset, magneticAreasProp]);
52
+ }, [fullHeight, headerOffset, magneticAreasProp, virtualKeyboard]);
49
53
  var lastMagneticArea = magneticAreas[magneticAreas.length - 1];
50
- var _u = React.useState(0), sheetOffset = _u[0], setSheetOffset = _u[1];
51
- var _v = React.useState(1), backdropOpacity = _v[0], setBackdropOpacity = _v[1];
52
- var _w = React.useState(-1), activeAreaIdx = _w[0], setActiveAreaIdx = _w[1];
53
- var _x = React.useState(null), swipingInProgress = _x[0], setSwipingInProgress = _x[1];
54
+ var _x = React.useState(0), sheetOffset = _x[0], setSheetOffset = _x[1];
55
+ var _y = React.useState(1), backdropOpacity = _y[0], setBackdropOpacity = _y[1];
56
+ var _z = React.useState(-1), activeAreaIdx = _z[0], setActiveAreaIdx = _z[1];
57
+ var _0 = React.useState(null), swipingInProgress = _0[0], setSwipingInProgress = _0[1];
54
58
  var scrollOccurred = React.useRef(false);
55
59
  var headerRef = React.useRef(null);
56
60
  var contentRef = React.useRef(null);
@@ -353,6 +357,9 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
353
357
  ? "".concat(lastMagneticArea, "px")
354
358
  : 'unset',
355
359
  maxHeight: isFirstRender ? 0 : "".concat(lastMagneticArea, "px"),
360
+ marginBottom: virtualKeyboard && visibleViewportSize && windowHeight > visibleViewportSize.height
361
+ ? windowHeight - visibleViewportSize.height - visibleViewportSize.offsetTop
362
+ : undefined,
356
363
  }); };
357
364
  var renderMarker = function () {
358
365
  if (swipeable) {
@@ -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_1xypz","sticky":"bottom-sheet__sticky_1xypz","highlighted":"bottom-sheet__highlighted_1xypz","background-accent":"bottom-sheet__background-accent_1xypz","background-info":"bottom-sheet__background-info_1xypz","background-attention-muted":"bottom-sheet__background-attention-muted_1xypz","background-positive-muted":"bottom-sheet__background-positive-muted_1xypz","background-negative-muted":"bottom-sheet__background-negative-muted_1xypz","background-primary":"bottom-sheet__background-primary_1xypz","background-primary-inverted":"bottom-sheet__background-primary-inverted_1xypz","background-secondary":"bottom-sheet__background-secondary_1xypz","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1xypz","background-tertiary":"bottom-sheet__background-tertiary_1xypz","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1xypz","background-quaternary":"bottom-sheet__background-quaternary_1xypz","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1xypz","background-specialbg-component":"bottom-sheet__background-specialbg-component_1xypz","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1xypz","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1xypz","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1xypz","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1xypz","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1xypz","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1xypz","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1xypz","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1xypz"};
14
+ var styles = {"footer":"bottom-sheet__footer_10j16","sticky":"bottom-sheet__sticky_10j16","highlighted":"bottom-sheet__highlighted_10j16","background-accent":"bottom-sheet__background-accent_10j16","background-info":"bottom-sheet__background-info_10j16","background-attention-muted":"bottom-sheet__background-attention-muted_10j16","background-positive-muted":"bottom-sheet__background-positive-muted_10j16","background-negative-muted":"bottom-sheet__background-negative-muted_10j16","background-primary":"bottom-sheet__background-primary_10j16","background-primary-inverted":"bottom-sheet__background-primary-inverted_10j16","background-secondary":"bottom-sheet__background-secondary_10j16","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_10j16","background-tertiary":"bottom-sheet__background-tertiary_10j16","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_10j16","background-quaternary":"bottom-sheet__background-quaternary_10j16","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_10j16","background-specialbg-component":"bottom-sheet__background-specialbg-component_10j16","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_10j16","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_10j16","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_10j16","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_10j16","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_10j16","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_10j16","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_10j16","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_10j16"};
15
15
  require('./index.css')
16
16
 
17
17
  var Footer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: yy5gy */
1
+ /* hash: 1pai5 */
2
2
  :root { /* 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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-modal-bg-primary: #fff;
@@ -46,58 +46,58 @@
46
46
  /* footer */
47
47
  --bottom-sheet-footer-border-top: 1px solid var(--color-light-neutral-300);
48
48
  --bottom-sheet-footer-background-color: var(--color-light-modal-bg-primary);
49
- } .bottom-sheet__footer_1xypz {
49
+ } .bottom-sheet__footer_10j16 {
50
50
  padding: var(--gap-m) var(--gap-m);
51
51
  background-color: var(--color-light-modal-bg-primary);
52
- } .bottom-sheet__sticky_1xypz {
52
+ } .bottom-sheet__sticky_10j16 {
53
53
  position: sticky;
54
54
  bottom: 0;
55
55
  z-index: 1;
56
- } .bottom-sheet__highlighted_1xypz {
56
+ } .bottom-sheet__highlighted_10j16 {
57
57
  border-top: var(--bottom-sheet-footer-border-top);
58
58
  background-color: var(--bottom-sheet-footer-background-color);
59
- } .bottom-sheet__background-accent_1xypz {
59
+ } .bottom-sheet__background-accent_10j16 {
60
60
  background-color: var(--color-light-bg-accent);
61
- } .bottom-sheet__background-info_1xypz {
61
+ } .bottom-sheet__background-info_10j16 {
62
62
  background-color: var(--color-light-bg-info);
63
- } .bottom-sheet__background-attention-muted_1xypz {
63
+ } .bottom-sheet__background-attention-muted_10j16 {
64
64
  background-color: var(--color-light-bg-attention-muted);
65
- } .bottom-sheet__background-positive-muted_1xypz {
65
+ } .bottom-sheet__background-positive-muted_10j16 {
66
66
  background-color: var(--color-light-bg-positive-muted);
67
- } .bottom-sheet__background-negative-muted_1xypz {
67
+ } .bottom-sheet__background-negative-muted_10j16 {
68
68
  background-color: var(--color-light-bg-negative-muted);
69
- } .bottom-sheet__background-primary_1xypz {
69
+ } .bottom-sheet__background-primary_10j16 {
70
70
  background-color: var(--color-light-bg-primary);
71
- } .bottom-sheet__background-primary-inverted_1xypz {
71
+ } .bottom-sheet__background-primary-inverted_10j16 {
72
72
  background-color: var(--color-light-bg-primary-inverted);
73
- } .bottom-sheet__background-secondary_1xypz {
73
+ } .bottom-sheet__background-secondary_10j16 {
74
74
  background-color: var(--color-light-bg-secondary);
75
- } .bottom-sheet__background-secondary-inverted_1xypz {
75
+ } .bottom-sheet__background-secondary-inverted_10j16 {
76
76
  background-color: var(--color-light-bg-secondary-inverted);
77
- } .bottom-sheet__background-tertiary_1xypz {
77
+ } .bottom-sheet__background-tertiary_10j16 {
78
78
  background-color: var(--color-light-bg-tertiary);
79
- } .bottom-sheet__background-tertiary-inverted_1xypz {
79
+ } .bottom-sheet__background-tertiary-inverted_10j16 {
80
80
  background-color: var(--color-light-bg-tertiary-inverted);
81
- } .bottom-sheet__background-quaternary_1xypz {
81
+ } .bottom-sheet__background-quaternary_10j16 {
82
82
  background-color: var(--color-light-bg-quaternary);
83
- } .bottom-sheet__background-quaternary-inverted_1xypz {
83
+ } .bottom-sheet__background-quaternary-inverted_10j16 {
84
84
  background-color: var(--color-light-bg-quaternary-inverted);
85
- } .bottom-sheet__background-specialbg-component_1xypz {
85
+ } .bottom-sheet__background-specialbg-component_10j16 {
86
86
  background-color: var(--color-light-specialbg-component);
87
- } .bottom-sheet__background-specialbg-component-inverted_1xypz {
87
+ } .bottom-sheet__background-specialbg-component-inverted_10j16 {
88
88
  background-color: var(--color-light-specialbg-component-inverted);
89
- } .bottom-sheet__background-specialbg-primary-grouped_1xypz {
89
+ } .bottom-sheet__background-specialbg-primary-grouped_10j16 {
90
90
  background-color: var(--color-light-specialbg-primary-grouped);
91
- } .bottom-sheet__background-specialbg-secondary-grouped_1xypz {
91
+ } .bottom-sheet__background-specialbg-secondary-grouped_10j16 {
92
92
  background-color: var(--color-light-specialbg-secondary-grouped);
93
- } .bottom-sheet__background-specialbg-tertiary-grouped_1xypz {
93
+ } .bottom-sheet__background-specialbg-tertiary-grouped_10j16 {
94
94
  background-color: var(--color-light-specialbg-tertiary-grouped);
95
- } .bottom-sheet__background-specialbg-secondary-transparent_1xypz {
95
+ } .bottom-sheet__background-specialbg-secondary-transparent_10j16 {
96
96
  background-color: var(--color-light-specialbg-secondary-transparent);
97
- } .bottom-sheet__background-specialbg-secondary-transparent-inverted_1xypz {
97
+ } .bottom-sheet__background-specialbg-secondary-transparent-inverted_10j16 {
98
98
  background-color: var(--color-light-specialbg-secondary-transparent-inverted);
99
- } .bottom-sheet__background-specialbg-tertiary-transparent_1xypz {
99
+ } .bottom-sheet__background-specialbg-tertiary-transparent_10j16 {
100
100
  background-color: var(--color-light-specialbg-tertiary-transparent);
101
- } .bottom-sheet__background-specialbg-tertiary-transparent-inverted_1xypz {
101
+ } .bottom-sheet__background-specialbg-tertiary-transparent-inverted_10j16 {
102
102
  background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
103
103
  }
@@ -13,7 +13,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
13
13
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
15
15
 
16
- var styles = {"headerWrapper":"bottom-sheet__headerWrapper_iull4","hasContent":"bottom-sheet__hasContent_iull4","header":"bottom-sheet__header_iull4","sticky":"bottom-sheet__sticky_iull4","highlighted":"bottom-sheet__highlighted_iull4","justifyEnd":"bottom-sheet__justifyEnd_iull4","addon":"bottom-sheet__addon_iull4","addonFixed":"bottom-sheet__addonFixed_iull4","title":"bottom-sheet__title_iull4","titleCenter":"bottom-sheet__titleCenter_iull4","titleLeft":"bottom-sheet__titleLeft_iull4","trimTitle":"bottom-sheet__trimTitle_iull4"};
16
+ var styles = {"headerWrapper":"bottom-sheet__headerWrapper_16ikx","hasContent":"bottom-sheet__hasContent_16ikx","header":"bottom-sheet__header_16ikx","sticky":"bottom-sheet__sticky_16ikx","highlighted":"bottom-sheet__highlighted_16ikx","justifyEnd":"bottom-sheet__justifyEnd_16ikx","addon":"bottom-sheet__addon_16ikx","addonFixed":"bottom-sheet__addonFixed_16ikx","title":"bottom-sheet__title_16ikx","titleCenter":"bottom-sheet__titleCenter_16ikx","titleLeft":"bottom-sheet__titleLeft_16ikx","trimTitle":"bottom-sheet__trimTitle_16ikx"};
17
17
  require('./index.css')
18
18
 
19
19
  var Header = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: cbu4w */
1
+ /* hash: 1l0li */
2
2
  :root { /* 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 */ /* 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 */
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-300: #e7e8eb; /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */ /* 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 */
@@ -30,42 +30,42 @@
30
30
  --bottom-sheet-title-font-family: var(--font-family-system);
31
31
 
32
32
  /* footer */
33
- } .bottom-sheet__headerWrapper_iull4 {
33
+ } .bottom-sheet__headerWrapper_16ikx {
34
34
  padding: var(--gap-s) var(--gap-xs) var(--gap-2xs);
35
35
  border-top-left-radius: inherit;
36
36
  border-top-right-radius: inherit;
37
37
  z-index: 1;
38
- } .bottom-sheet__hasContent_iull4 {
38
+ } .bottom-sheet__hasContent_16ikx {
39
39
  background-color: inherit;
40
- } .bottom-sheet__header_iull4 {
40
+ } .bottom-sheet__header_16ikx {
41
41
  display: flex;
42
- } .bottom-sheet__sticky_iull4 {
42
+ } .bottom-sheet__sticky_16ikx {
43
43
  position: sticky;
44
44
  top: 0;
45
- } .bottom-sheet__highlighted_iull4 {
45
+ } .bottom-sheet__highlighted_16ikx {
46
46
  border-bottom: var(--bottom-sheet-header-border-bottom);
47
- } .bottom-sheet__justifyEnd_iull4 {
47
+ } .bottom-sheet__justifyEnd_16ikx {
48
48
  justify-content: flex-end;
49
- } .bottom-sheet__addon_iull4 {
49
+ } .bottom-sheet__addon_16ikx {
50
50
  display: flex;
51
51
  justify-content: center;
52
52
  align-items: center;
53
53
  min-width: 48px;
54
54
  height: 48px;
55
- } .bottom-sheet__addonFixed_iull4 {
55
+ } .bottom-sheet__addonFixed_16ikx {
56
56
  position: fixed;
57
- } .bottom-sheet__title_iull4 {
57
+ } .bottom-sheet__title_16ikx {
58
58
  padding: var(--gap-s) var(--gap-xs);
59
59
  width: 100%;
60
60
  font-size: var(--bottom-sheet-title-font-size);
61
61
  font-weight: var(--bottom-sheet-title-font-weight);
62
62
  line-height: var(--bottom-sheet-title-line-height);
63
63
  font-family: var(--bottom-sheet-title-font-family);
64
- } .bottom-sheet__titleCenter_iull4 {
64
+ } .bottom-sheet__titleCenter_16ikx {
65
65
  text-align: center;
66
- } .bottom-sheet__titleLeft_iull4 {
66
+ } .bottom-sheet__titleLeft_16ikx {
67
67
  text-align: left;
68
- } .bottom-sheet__trimTitle_iull4 {
68
+ } .bottom-sheet__trimTitle_16ikx {
69
69
  white-space: nowrap;
70
70
  overflow: hidden;
71
71
  text-overflow: ellipsis;
package/cssm/component.js CHANGED
@@ -14,6 +14,7 @@ var components_footer_Component = require('./components/footer/Component.js');
14
14
  var components_header_Component = require('./components/header/Component.js');
15
15
  var components_swipeableBackdrop_Component = require('./components/swipeable-backdrop/Component.js');
16
16
  var consts_swipeConsts = require('./consts/swipeConsts.js');
17
+ var hooks_useVisualviewportSize = require('./hooks/use-visualviewport-size.js');
17
18
  var utils = require('./utils.js');
18
19
  var styles = require('./index.module.css');
19
20
 
@@ -27,8 +28,11 @@ var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
27
28
  var isNil = coreComponentsShared.fnUtils.isNil;
28
29
  var BottomSheet = React.forwardRef(function (_a, ref) {
29
30
  var _b, _c, _d, _e, _f;
30
- 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, onSwipeStart = _a.onSwipeStart, onSwipeEnd = _a.onSwipeEnd, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName, backButtonProps = _a.backButtonProps, _t = _a.iOSLock, iOSLock = _t === void 0 ? false : _t;
31
- var fullHeight = reactDiv100vh.use100vh() || 0;
31
+ var _g, _h;
32
+ var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _j = _a.titleSize, titleSize = _j === void 0 ? 'default' : _j, 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, _k = _a.titleAlign, titleAlign = _k === void 0 ? 'left' : _k, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _l = _a.stickyFooter, stickyFooter = _l === void 0 ? true : _l, _m = _a.initialHeight, initialHeight = _m === void 0 ? 'default' : _m, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _o = _a.transitionProps, transitionProps = _o === void 0 ? {} : _o, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _p = _a.swipeable, swipeable = _p === void 0 ? true : _p, _q = _a.swipeableContent, swipeableContent = _q === void 0 ? true : _q, _r = _a.swipeThreshold, swipeThreshold = _r === void 0 ? 5 : _r, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _s = _a.scrollableContainerRef, scrollableContainerRef = _s === void 0 ? function () { return null; } : _s, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _t = _a.sheetContainerRef, sheetContainerRef = _t === void 0 ? function () { return null; } : _t, _u = _a.headerOffset, headerOffset = _u === void 0 ? 24 : _u, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, onSwipeStart = _a.onSwipeStart, onSwipeEnd = _a.onSwipeEnd, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName, backButtonProps = _a.backButtonProps, _v = _a.iOSLock, iOSLock = _v === void 0 ? false : _v, _w = _a.virtualKeyboard, virtualKeyboard = _w === void 0 ? false : _w;
33
+ var windowHeight = (_g = reactDiv100vh.use100vh()) !== null && _g !== void 0 ? _g : 0;
34
+ var visibleViewportSize = hooks_useVisualviewportSize.useVisibleViewportSize(virtualKeyboard);
35
+ var fullHeight = virtualKeyboard ? (_h = visibleViewportSize === null || visibleViewportSize === void 0 ? void 0 : visibleViewportSize.height) !== null && _h !== void 0 ? _h : 0 : windowHeight;
32
36
  // Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
33
37
  var isFirstRender = fullHeight === 0;
34
38
  var initialIndexRef = React.useRef(initialActiveAreaIndex);
@@ -42,14 +46,14 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
42
46
  var iOSViewHeight = coreComponentsShared.isClient()
43
47
  ? ((_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || (window === null || window === void 0 ? void 0 : window.innerHeight)
44
48
  : 0;
45
- var viewHeight = coreComponentsShared.os.isIOS() ? iOSViewHeight : fullHeight;
49
+ var viewHeight = coreComponentsShared.os.isIOS() && !virtualKeyboard ? iOSViewHeight : fullHeight;
46
50
  return [0, viewHeight - headerOffset];
47
- }, [fullHeight, headerOffset, magneticAreasProp]);
51
+ }, [fullHeight, headerOffset, magneticAreasProp, virtualKeyboard]);
48
52
  var lastMagneticArea = magneticAreas[magneticAreas.length - 1];
49
- var _u = React.useState(0), sheetOffset = _u[0], setSheetOffset = _u[1];
50
- var _v = React.useState(1), backdropOpacity = _v[0], setBackdropOpacity = _v[1];
51
- var _w = React.useState(-1), activeAreaIdx = _w[0], setActiveAreaIdx = _w[1];
52
- var _x = React.useState(null), swipingInProgress = _x[0], setSwipingInProgress = _x[1];
53
+ var _x = React.useState(0), sheetOffset = _x[0], setSheetOffset = _x[1];
54
+ var _y = React.useState(1), backdropOpacity = _y[0], setBackdropOpacity = _y[1];
55
+ var _z = React.useState(-1), activeAreaIdx = _z[0], setActiveAreaIdx = _z[1];
56
+ var _0 = React.useState(null), swipingInProgress = _0[0], setSwipingInProgress = _0[1];
53
57
  var scrollOccurred = React.useRef(false);
54
58
  var headerRef = React.useRef(null);
55
59
  var contentRef = React.useRef(null);
@@ -352,6 +356,9 @@ var BottomSheet = React.forwardRef(function (_a, ref) {
352
356
  ? "".concat(lastMagneticArea, "px")
353
357
  : 'unset',
354
358
  maxHeight: isFirstRender ? 0 : "".concat(lastMagneticArea, "px"),
359
+ marginBottom: virtualKeyboard && visibleViewportSize && windowHeight > visibleViewportSize.height
360
+ ? windowHeight - visibleViewportSize.height - visibleViewportSize.offsetTop
361
+ : undefined,
355
362
  }); };
356
363
  var renderMarker = function () {
357
364
  if (swipeable) {
@@ -0,0 +1 @@
1
+ export { useVisibleViewportSize } from "./use-visualviewport-size";
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var hooks_useVisualviewportSize = require('./use-visualviewport-size.js');
6
+
7
+
8
+
9
+ exports.useVisibleViewportSize = hooks_useVisualviewportSize.useVisibleViewportSize;
@@ -0,0 +1,3 @@
1
+ type VisualViewportSize = Pick<VisualViewport, 'height' | 'offsetTop'>;
2
+ declare function useVisibleViewportSize(enabled?: boolean): VisualViewportSize | null;
3
+ export { useVisibleViewportSize };
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var coreComponentsShared = require('@alfalab/core-components-shared/cssm');
7
+
8
+ var measureVisualViewport = function (visualViewport) {
9
+ if (!visualViewport)
10
+ return null;
11
+ var height = visualViewport.height, offsetTop = visualViewport.offsetTop;
12
+ return { height: height, offsetTop: offsetTop };
13
+ };
14
+ function useVisibleViewportSize(enabled) {
15
+ if (enabled === void 0) { enabled = false; }
16
+ var _a = React.useState(function () {
17
+ return coreComponentsShared.isClient() ? measureVisualViewport(window.visualViewport) : null;
18
+ }), size = _a[0], setSize = _a[1];
19
+ React.useEffect(function () {
20
+ var visualViewport = window.visualViewport;
21
+ if (!coreComponentsShared.isClient() || !enabled || !visualViewport)
22
+ return coreComponentsShared.fnUtils.noop;
23
+ var listener = function (event) {
24
+ return setSize(measureVisualViewport(event.target));
25
+ };
26
+ visualViewport.addEventListener('resize', listener);
27
+ visualViewport.addEventListener('scroll', listener);
28
+ return function () {
29
+ visualViewport.removeEventListener('resize', listener);
30
+ visualViewport.removeEventListener('scroll', listener);
31
+ };
32
+ }, [enabled]);
33
+ return size;
34
+ }
35
+
36
+ exports.useVisibleViewportSize = useVisibleViewportSize;
package/cssm/types.d.ts CHANGED
@@ -281,5 +281,9 @@ type BottomSheetProps = {
281
281
  * Блокирует скролл когда модальное окно открыто. Работает только на iOS
282
282
  */
283
283
  iOSLock?: boolean;
284
+ /**
285
+ * Учитывать высоту виртуальной клавиатуры
286
+ */
287
+ virtualKeyboard?: boolean;
284
288
  };
285
289
  export { BottomSheetTitleAlign, BottomSheetProps };
package/esm/component.js CHANGED
@@ -10,16 +10,20 @@ import { Footer } from './components/footer/Component.js';
10
10
  import { Header } from './components/header/Component.js';
11
11
  import { SwipeableBackdrop } from './components/swipeable-backdrop/Component.js';
12
12
  import { horizontalDirections } from './consts/swipeConsts.js';
13
+ import { useVisibleViewportSize } from './hooks/use-visualviewport-size.js';
13
14
  import { convertPercentToNumber, TIMEOUT, MARKER_HEIGHT, SCROLL_OFFSET, SWIPE_VELOCITY, CLOSE_OFFSET } from './utils.js';
14
15
 
15
- var styles = {"modal":"bottom-sheet__modal_e10od","wrapper":"bottom-sheet__wrapper_e10od","fullscreen":"bottom-sheet__fullscreen_e10od","component":"bottom-sheet__component_e10od","withTransition":"bottom-sheet__withTransition_e10od","scrollableContainer":"bottom-sheet__scrollableContainer_e10od","marker":"bottom-sheet__marker_e10od","defaultMarker":"bottom-sheet__defaultMarker_e10od","content":"bottom-sheet__content_e10od","noHeader":"bottom-sheet__noHeader_e10od","noFooter":"bottom-sheet__noFooter_e10od","scrollLocked":"bottom-sheet__scrollLocked_e10od","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_e10od","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_e10od","appear":"bottom-sheet__appear_e10od","enter":"bottom-sheet__enter_e10od","appearActive":"bottom-sheet__appearActive_e10od","enterActive":"bottom-sheet__enterActive_e10od","enterDone":"bottom-sheet__enterDone_e10od","appearDone":"bottom-sheet__appearDone_e10od","exit":"bottom-sheet__exit_e10od","exitActive":"bottom-sheet__exitActive_e10od","safeAreaBottom":"bottom-sheet__safeAreaBottom_e10od","background-accent":"bottom-sheet__background-accent_e10od","background-info":"bottom-sheet__background-info_e10od","background-attention-muted":"bottom-sheet__background-attention-muted_e10od","background-positive-muted":"bottom-sheet__background-positive-muted_e10od","background-negative-muted":"bottom-sheet__background-negative-muted_e10od","background-primary":"bottom-sheet__background-primary_e10od","background-primary-inverted":"bottom-sheet__background-primary-inverted_e10od","background-secondary":"bottom-sheet__background-secondary_e10od","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_e10od","background-tertiary":"bottom-sheet__background-tertiary_e10od","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_e10od","background-quaternary":"bottom-sheet__background-quaternary_e10od","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_e10od","background-specialbg-component":"bottom-sheet__background-specialbg-component_e10od","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_e10od","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_e10od","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_e10od","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_e10od","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_e10od","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_e10od","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_e10od","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_e10od"};
16
+ var styles = {"modal":"bottom-sheet__modal_90r42","wrapper":"bottom-sheet__wrapper_90r42","fullscreen":"bottom-sheet__fullscreen_90r42","component":"bottom-sheet__component_90r42","withTransition":"bottom-sheet__withTransition_90r42","scrollableContainer":"bottom-sheet__scrollableContainer_90r42","marker":"bottom-sheet__marker_90r42","defaultMarker":"bottom-sheet__defaultMarker_90r42","content":"bottom-sheet__content_90r42","noHeader":"bottom-sheet__noHeader_90r42","noFooter":"bottom-sheet__noFooter_90r42","scrollLocked":"bottom-sheet__scrollLocked_90r42","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_90r42","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_90r42","appear":"bottom-sheet__appear_90r42","enter":"bottom-sheet__enter_90r42","appearActive":"bottom-sheet__appearActive_90r42","enterActive":"bottom-sheet__enterActive_90r42","enterDone":"bottom-sheet__enterDone_90r42","appearDone":"bottom-sheet__appearDone_90r42","exit":"bottom-sheet__exit_90r42","exitActive":"bottom-sheet__exitActive_90r42","safeAreaBottom":"bottom-sheet__safeAreaBottom_90r42","background-accent":"bottom-sheet__background-accent_90r42","background-info":"bottom-sheet__background-info_90r42","background-attention-muted":"bottom-sheet__background-attention-muted_90r42","background-positive-muted":"bottom-sheet__background-positive-muted_90r42","background-negative-muted":"bottom-sheet__background-negative-muted_90r42","background-primary":"bottom-sheet__background-primary_90r42","background-primary-inverted":"bottom-sheet__background-primary-inverted_90r42","background-secondary":"bottom-sheet__background-secondary_90r42","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_90r42","background-tertiary":"bottom-sheet__background-tertiary_90r42","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_90r42","background-quaternary":"bottom-sheet__background-quaternary_90r42","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_90r42","background-specialbg-component":"bottom-sheet__background-specialbg-component_90r42","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_90r42","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_90r42","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_90r42","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_90r42","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_90r42","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_90r42","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_90r42","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_90r42"};
16
17
  require('./index.css')
17
18
 
18
19
  var isNil = fnUtils.isNil;
19
20
  var BottomSheet = forwardRef(function (_a, ref) {
20
21
  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, onSwipeStart = _a.onSwipeStart, onSwipeEnd = _a.onSwipeEnd, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName, backButtonProps = _a.backButtonProps, _t = _a.iOSLock, iOSLock = _t === void 0 ? false : _t;
22
- var fullHeight = use100vh() || 0;
22
+ var _g, _h;
23
+ var open = _a.open, title = _a.title, container = _a.container, usePortal = _a.usePortal, backgroundColor = _a.backgroundColor, _j = _a.titleSize, titleSize = _j === void 0 ? 'default' : _j, 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, _k = _a.titleAlign, titleAlign = _k === void 0 ? 'left' : _k, trimTitle = _a.trimTitle, stickyHeader = _a.stickyHeader, _l = _a.stickyFooter, stickyFooter = _l === void 0 ? true : _l, _m = _a.initialHeight, initialHeight = _m === void 0 ? 'default' : _m, hideOverlay = _a.hideOverlay, hideScrollbar = _a.hideScrollbar, hideHeader = _a.hideHeader, disableOverlayClick = _a.disableOverlayClick, disableBlockingScroll = _a.disableBlockingScroll, disableFocusLock = _a.disableFocusLock, children = _a.children, zIndex = _a.zIndex, _o = _a.transitionProps, transitionProps = _o === void 0 ? {} : _o, magneticAreasProp = _a.magneticAreas, initialActiveAreaIndex = _a.initialActiveAreaIndex, dataTestId = _a.dataTestId, _p = _a.swipeable, swipeable = _p === void 0 ? true : _p, _q = _a.swipeableContent, swipeableContent = _q === void 0 ? true : _q, _r = _a.swipeThreshold, swipeThreshold = _r === void 0 ? 5 : _r, scrollLockedProp = _a.scrollLocked, backdropProps = _a.backdropProps, _s = _a.scrollableContainerRef, scrollableContainerRef = _s === void 0 ? function () { return null; } : _s, bottomSheetInstanceRef = _a.bottomSheetInstanceRef, _t = _a.sheetContainerRef, sheetContainerRef = _t === void 0 ? function () { return null; } : _t, _u = _a.headerOffset, headerOffset = _u === void 0 ? 24 : _u, onClose = _a.onClose, onBack = _a.onBack, onMagnetize = _a.onMagnetize, onSwipeStart = _a.onSwipeStart, onSwipeEnd = _a.onSwipeEnd, disableRestoreFocus = _a.disableRestoreFocus, disableAutoFocus = _a.disableAutoFocus, disableEscapeKeyDown = _a.disableEscapeKeyDown, keepMounted = _a.keepMounted, onMagnetizeEnd = _a.onMagnetizeEnd, onOffsetChange = _a.onOffsetChange, swipeableMarker = _a.swipeableMarker, swipeableMarkerClassName = _a.swipeableMarkerClassName, backButtonProps = _a.backButtonProps, _v = _a.iOSLock, iOSLock = _v === void 0 ? false : _v, _w = _a.virtualKeyboard, virtualKeyboard = _w === void 0 ? false : _w;
24
+ var windowHeight = (_g = use100vh()) !== null && _g !== void 0 ? _g : 0;
25
+ var visibleViewportSize = useVisibleViewportSize(virtualKeyboard);
26
+ var fullHeight = virtualKeyboard ? (_h = visibleViewportSize === null || visibleViewportSize === void 0 ? void 0 : visibleViewportSize.height) !== null && _h !== void 0 ? _h : 0 : windowHeight;
23
27
  // Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
24
28
  var isFirstRender = fullHeight === 0;
25
29
  var initialIndexRef = useRef(initialActiveAreaIndex);
@@ -33,14 +37,14 @@ var BottomSheet = forwardRef(function (_a, ref) {
33
37
  var iOSViewHeight = isClient()
34
38
  ? ((_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.clientHeight) || (window === null || window === void 0 ? void 0 : window.innerHeight)
35
39
  : 0;
36
- var viewHeight = os.isIOS() ? iOSViewHeight : fullHeight;
40
+ var viewHeight = os.isIOS() && !virtualKeyboard ? iOSViewHeight : fullHeight;
37
41
  return [0, viewHeight - headerOffset];
38
- }, [fullHeight, headerOffset, magneticAreasProp]);
42
+ }, [fullHeight, headerOffset, magneticAreasProp, virtualKeyboard]);
39
43
  var lastMagneticArea = magneticAreas[magneticAreas.length - 1];
40
- var _u = useState(0), sheetOffset = _u[0], setSheetOffset = _u[1];
41
- var _v = useState(1), backdropOpacity = _v[0], setBackdropOpacity = _v[1];
42
- var _w = useState(-1), activeAreaIdx = _w[0], setActiveAreaIdx = _w[1];
43
- var _x = useState(null), swipingInProgress = _x[0], setSwipingInProgress = _x[1];
44
+ var _x = useState(0), sheetOffset = _x[0], setSheetOffset = _x[1];
45
+ var _y = useState(1), backdropOpacity = _y[0], setBackdropOpacity = _y[1];
46
+ var _z = useState(-1), activeAreaIdx = _z[0], setActiveAreaIdx = _z[1];
47
+ var _0 = useState(null), swipingInProgress = _0[0], setSwipingInProgress = _0[1];
44
48
  var scrollOccurred = useRef(false);
45
49
  var headerRef = useRef(null);
46
50
  var contentRef = useRef(null);
@@ -343,6 +347,9 @@ var BottomSheet = forwardRef(function (_a, ref) {
343
347
  ? "".concat(lastMagneticArea, "px")
344
348
  : 'unset',
345
349
  maxHeight: isFirstRender ? 0 : "".concat(lastMagneticArea, "px"),
350
+ marginBottom: virtualKeyboard && visibleViewportSize && windowHeight > visibleViewportSize.height
351
+ ? windowHeight - visibleViewportSize.height - visibleViewportSize.offsetTop
352
+ : undefined,
346
353
  }); };
347
354
  var renderMarker = function () {
348
355
  if (swipeable) {
@@ -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_1xypz","sticky":"bottom-sheet__sticky_1xypz","highlighted":"bottom-sheet__highlighted_1xypz","background-accent":"bottom-sheet__background-accent_1xypz","background-info":"bottom-sheet__background-info_1xypz","background-attention-muted":"bottom-sheet__background-attention-muted_1xypz","background-positive-muted":"bottom-sheet__background-positive-muted_1xypz","background-negative-muted":"bottom-sheet__background-negative-muted_1xypz","background-primary":"bottom-sheet__background-primary_1xypz","background-primary-inverted":"bottom-sheet__background-primary-inverted_1xypz","background-secondary":"bottom-sheet__background-secondary_1xypz","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_1xypz","background-tertiary":"bottom-sheet__background-tertiary_1xypz","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_1xypz","background-quaternary":"bottom-sheet__background-quaternary_1xypz","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_1xypz","background-specialbg-component":"bottom-sheet__background-specialbg-component_1xypz","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_1xypz","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_1xypz","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_1xypz","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_1xypz","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_1xypz","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_1xypz","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_1xypz","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_1xypz"};
5
+ var styles = {"footer":"bottom-sheet__footer_10j16","sticky":"bottom-sheet__sticky_10j16","highlighted":"bottom-sheet__highlighted_10j16","background-accent":"bottom-sheet__background-accent_10j16","background-info":"bottom-sheet__background-info_10j16","background-attention-muted":"bottom-sheet__background-attention-muted_10j16","background-positive-muted":"bottom-sheet__background-positive-muted_10j16","background-negative-muted":"bottom-sheet__background-negative-muted_10j16","background-primary":"bottom-sheet__background-primary_10j16","background-primary-inverted":"bottom-sheet__background-primary-inverted_10j16","background-secondary":"bottom-sheet__background-secondary_10j16","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_10j16","background-tertiary":"bottom-sheet__background-tertiary_10j16","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_10j16","background-quaternary":"bottom-sheet__background-quaternary_10j16","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_10j16","background-specialbg-component":"bottom-sheet__background-specialbg-component_10j16","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_10j16","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_10j16","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_10j16","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_10j16","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_10j16","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_10j16","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_10j16","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_10j16"};
6
6
  require('./index.css')
7
7
 
8
8
  var Footer = function (_a) {