@crystaldesign/diva-core 25.13.0-rc.15 → 25.13.0-rc.16

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.
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext } from './index-232f8624.js';
1
+ import { s as styleInject, u as useDivaCoreContext } from './index-c7cc596b.js';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@mui/material/Button';
@@ -42,7 +42,6 @@ import 'axios';
42
42
  import '@crystaldesign/product-handler';
43
43
  import 'classnames';
44
44
  import '@babel/runtime/helpers/objectDestructuringEmpty';
45
- import 'vaul';
46
45
  import '@crystaldesign/content-box';
47
46
  import '@crystaldesign/diva-core';
48
47
  import 'react-qr-code';
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-232f8624.js';
1
+ import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-c7cc596b.js';
2
2
  import { forwardRef, useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -42,7 +42,6 @@ import 'lodash/debounce';
42
42
  import 'axios';
43
43
  import '@crystaldesign/product-handler';
44
44
  import '@babel/runtime/helpers/objectDestructuringEmpty';
45
- import 'vaul';
46
45
  import 'react-qr-code';
47
46
  import '@mui/icons-material/Close';
48
47
  import '@mui/material/IconButton';
@@ -34,9 +34,8 @@ import axios from 'axios';
34
34
  import { ProductHandlerAbstract } from '@crystaldesign/product-handler';
35
35
  import classnames from 'classnames';
36
36
  import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
37
- import { Drawer } from 'vaul';
37
+ import { SwipeableDrawer, Button, Snackbar, SnackbarContent, IconButton, Card, CardHeader, CardContent } from '@mui/material';
38
38
  import { ContentBoxComponent } from '@crystaldesign/content-box';
39
- import { Button, Snackbar, SnackbarContent, IconButton, Card, CardHeader, CardContent } from '@mui/material';
40
39
  import { useTranslation as useTranslation$1, useDivaCore as useDivaCore$1 } from '@crystaldesign/diva-core';
41
40
  import QRCode from 'react-qr-code';
42
41
  import CloseIcon from '@mui/icons-material/Close';
@@ -46,7 +45,7 @@ import { actions } from '@storybook/addon-actions';
46
45
  import * as Styles from '@mui/styles';
47
46
 
48
47
  (function() {
49
- const env = {"STAGE":"production","VERSION":"25.13.0-rc.15"};
48
+ const env = {"STAGE":"production","VERSION":"25.13.0-rc.16"};
50
49
  try {
51
50
  if (process) {
52
51
  process.env = Object.assign({}, process.env);
@@ -9494,10 +9493,7 @@ var closeIcon = "close-icon-1kDyU";
9494
9493
  var css_248z$4 = ".overlay-34l68 {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: #fff;\n z-index: 999;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n.absolute-overlay-cG7uO {\n height: 100% !important;\n}\n\n.absolute-overlay-cG7uO {\n background-color: #fff;\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow: hidden;\n z-index: 1000000;\n display: block;\n width: 100vw;\n}\n\n.diva-pseudo-fullscreen body {\n height: auto !important;\n}\n.diva-pseudo-fullscreen, .diva-pseudo-fullscreen body {\n overflow: hidden !important;\n}\n\n.close-icon-1kDyU {\n position: absolute;\n right: 32px;\n top: 32px;\n width: 50px;\n height: 40px;\n opacity: 0.3;\n z-index: 700;\n cursor: pointer;\n}\n\n.close-icon-1kDyU:before {\n transform: rotate(45deg);\n}\n\n.close-icon-1kDyU:after {\n transform: rotate(-45deg);\n}\n\n.close-icon-1kDyU:before,\n.close-icon-1kDyU:after {\n position: absolute;\n left: 23px;\n top: 5px;\n content: ' ';\n height: 33px;\n width: 3px;\n background-color: #4b4b4b;\n}\n\n.close-icon-1kDyU:hover {\n opacity: 0.8;\n transition: opacity 0.2s ease-in-out;\n}\n";
9495
9494
  styleInject(css_248z$4);
9496
9495
 
9497
- var drawerWrapper = "drawer-wrapper-QY9a7";
9498
- var left = "left-SicAa";
9499
- var right = "right-p1mpA";
9500
- var handle = "handle-5tzN-";
9496
+ var drawerContent = "drawer-content-3-85N";
9501
9497
  var overlay = "overlay-vhpU9";
9502
9498
  var drawerHandleLine = "drawer-handle-line-65wJw";
9503
9499
  var drawerHandle = "drawer-handle-zhmPW";
@@ -9506,39 +9502,224 @@ var drawerHeader = "drawer-header-FOHFa";
9506
9502
  var scrollWrapper = "scroll-wrapper-f27j2";
9507
9503
  var closeButton = "close-button-Tg2c5";
9508
9504
  var bottom = "bottom-VZZjn";
9505
+ var left = "left-SicAa";
9506
+ var right = "right-p1mpA";
9509
9507
  var top = "top-o1Wjp";
9510
9508
  var bottomSpacer = "bottom-spacer-kdhiH";
9511
9509
  var onSide = "on-side-JUQWn";
9512
- var css_248z$3 = ".drawer-wrapper-QY9a7 {\n transition:\n opacity 0.3s ease,\n transform 0.5s cubic-bezier(0.32, 0.72, 0, 1) !important;\n}\n\n.drawer-wrapper-QY9a7 {\n outline: medium none invert;\n outline: initial;\n position: fixed;\n width: 100%;\n z-index: 14000;\n pointer-events: auto;\n opacity: 1;\n}\n\n.drawer-wrapper-QY9a7.vaul-dragging {\n transition: opacity 0.3s ease !important;\n}\n\n[data-state='closed'].drawer-wrapper-QY9a7.left-SicAa,\n[data-state='closed'].drawer-wrapper-QY9a7.right-p1mpA {\n opacity: 0;\n}\n\ndiv.handle-5tzN- {\n background: transparent;\n}\n\n.overlay-vhpU9 {\n background-color: rgba(0, 0, 0, 0.4);\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n animation: fadeIn-W2rJo 0.3s ease-in forwards;\n z-index: 10000;\n}\n\n@keyframes fadeIn-W2rJo {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.drawer-handle-line-65wJw {\n width: calc(36px);\n height: 4px;\n background-color: rgba(234, 234, 234, 0.9);\n border-radius: 2px;\n}\n\n.drawer-handle-zhmPW {\n position: absolute;\n left: 50%;\n transform: translate(-50%, -10px);\n width: 40px;\n height: 40px;\n touch-action: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.drawer-P-5-0 {\n display: flex;\n flex-direction: column;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n border: 0px solid #e4e4e7;\n border-bottom: none;\n border-top-width: 1px;\n z-index: 2000000;\n box-shadow: 0 -5px 16px rgba(0, 0, 0, 0.1);\n background-color: rgba(255, 255, 255, 0.95);\n}\n\n.drawer-header-FOHFa {\n padding: 8px 32px;\n}\n\n.drawer-open #Diva-content-wrapper {\n overflow: visible !important;\n z-index: 3 !important;\n}\n\n.scroll-wrapper-f27j2 {\n overflow-y: auto;\n overflow-x: hidden;\n overscroll-behavior: contain;\n padding: 0px 32px;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n gap: 12px;\n}\n\n.close-button-Tg2c5 {\n position: absolute;\n top: 18px;\n right: 18px;\n width: 32px;\n height: 32px;\n background: center / 70% no-repeat url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 height%3D%2248%22 viewBox%3D%220 -960 960 960%22 width%3D%2248%22 fill%3D%22%23ccc%22%3E%3Cpath d%3D%22m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z%22%2F%3E%3C%2Fsvg%3E\");\n transition:\n border-color 0.2s ease-in,\n background-image 0.2s ease-in;\n cursor: pointer;\n z-index: 500;\n border: 1px solid transparent;\n border-radius: 50%;\n padding: 0px;\n}\n\n.close-button-Tg2c5:hover {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 height%3D%2248%22 viewBox%3D%220 -960 960 960%22 width%3D%2248%22 fill%3D%22%23aaa%22%3E%3Cpath d%3D%22m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z%22%2F%3E%3C%2Fsvg%3E\");\n border: 1px solid #aaa;\n}\n\n.bottom-VZZjn {\n bottom: 0;\n right: 0;\n left: 0;\n}\n\n.left-SicAa,\n.right-p1mpA {\n bottom: 0;\n}\n.right-p1mpA {\n right: 0;\n}\n\n.top-o1Wjp {\n top: 0;\n right: 0;\n left: 0;\n}\n\nhtml body[data-scroll-locked] {\n position: static !important;\n}\n\n.bottom-spacer-kdhiH {\n min-height: 12px;\n}\n\n.on-side-JUQWn {\n width: 100%;\n}\n";
9510
+ var css_248z$3 = ".drawer-content-3-85N {\n outline: medium none invert;\n outline: initial;\n position: absolute;\n z-index: 14000;\n pointer-events: auto;\n opacity: 1;\n overscroll-behavior: contain;\n backface-visibility: hidden;\n -webkit-backface-visibility: hidden;\n transform: translateZ(0);\n -webkit-transform: translateZ(0);\n /* Optimize for smooth swiping animations */\n contain: layout style paint;\n}\n.MuiDrawer-anchorRight.MuiDrawer-root.MuiDrawer-modal.MuiModal-root,\n.MuiDrawer-anchorLeft.MuiDrawer-root.MuiDrawer-modal.MuiModal-root {\n position: absolute;\n}\n\n/* Fix for mobile browser address bar showing/hiding */\n@supports (height: 100dvh) {\n .drawer-content-3-85N {\n max-height: 100dvh;\n }\n}\n\n.overlay-vhpU9 {\n background-color: rgba(0, 0, 0, 0.4);\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n animation: fadeIn-W2rJo 0.3s ease-in forwards;\n z-index: 10000;\n}\n\n@keyframes fadeIn-W2rJo {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.drawer-handle-line-65wJw {\n width: calc(36px);\n height: 4px;\n background-color: rgba(234, 234, 234, 0.9);\n border-radius: 2px;\n}\n\n.drawer-handle-zhmPW {\n position: absolute;\n left: 50%;\n transform: translate(-50%, -32px);\n width: 40px;\n height: 40px;\n touch-action: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border-top-right-radius: 10px;\n border-top-left-radius: 10px;\n cursor: grab;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n}\n\n.drawer-P-5-0 {\n display: flex;\n flex-direction: column;\n z-index: 20000;\n background-color: rgba(255, 255, 255, 0.95);\n overflow: hidden;\n flex: 1;\n min-height: 0;\n}\n\n.drawer-header-FOHFa {\n padding: 8px 32px;\n flex-shrink: 0;\n}\n\n.drawer-open #Diva-content-wrapper {\n overflow: visible !important;\n z-index: 3 !important;\n}\n\n.scroll-wrapper-f27j2 {\n overflow-y: auto;\n overflow-x: hidden;\n overscroll-behavior: contain;\n padding: 0px 32px;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n gap: 12px;\n flex: 1;\n min-height: 0;\n /* Smooth scrolling on iOS */\n -webkit-overflow-scrolling: touch;\n /* Prevent pull-to-refresh interference */\n touch-action: pan-y;\n}\n\n.close-button-Tg2c5 {\n position: absolute;\n top: 18px;\n right: 18px;\n width: 32px;\n height: 32px;\n background: center / 70% no-repeat url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 height%3D%2248%22 viewBox%3D%220 -960 960 960%22 width%3D%2248%22 fill%3D%22%23ccc%22%3E%3Cpath d%3D%22m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z%22%2F%3E%3C%2Fsvg%3E\");\n transition:\n border-color 0.2s ease-in,\n background-image 0.2s ease-in;\n cursor: pointer;\n z-index: 500;\n border: 1px solid transparent;\n border-radius: 50%;\n padding: 0px;\n}\n\n.close-button-Tg2c5:hover {\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 height%3D%2248%22 viewBox%3D%220 -960 960 960%22 width%3D%2248%22 fill%3D%22%23aaa%22%3E%3Cpath d%3D%22m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z%22%2F%3E%3C%2Fsvg%3E\");\n border: 1px solid #aaa;\n}\n\n.bottom-VZZjn {\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.left-SicAa {\n left: 0;\n bottom: 0;\n top: 0;\n}\n\n.right-p1mpA {\n right: 0;\n bottom: 0;\n top: 0;\n}\n\n.top-o1Wjp {\n top: 0;\n left: 0;\n right: 0;\n}\n\nhtml body[data-scroll-locked] {\n position: static !important;\n}\n\n.bottom-spacer-kdhiH {\n min-height: 12px;\n}\n\n.on-side-JUQWn {\n width: 100%;\n}\n";
9513
9511
  styleInject(css_248z$3);
9514
9512
 
9513
+ var useSwipeToDismiss = function useSwipeToDismiss(direction, onDismiss) {
9514
+ var _useState = useState(false),
9515
+ _useState2 = _slicedToArray(_useState, 2),
9516
+ isDragging = _useState2[0],
9517
+ setIsDragging = _useState2[1];
9518
+ var _useState3 = useState(0),
9519
+ _useState4 = _slicedToArray(_useState3, 2),
9520
+ dragOffset = _useState4[0],
9521
+ setDragOffset = _useState4[1];
9522
+ var wrapperRef = useRef(null);
9523
+ var startPos = useRef(null);
9524
+ var scrollAtBoundary = useRef(false);
9525
+ var startTime = useRef(0);
9526
+ var scrollableElement = useRef(null);
9527
+ var lastSwipeTime = useRef(0);
9528
+ var lastSwipeDistance = useRef(0);
9529
+ var hasConfirmedFastSwipe = useRef(false);
9530
+ var isVertical = direction === 'top' || direction === 'bottom';
9531
+
9532
+ // Velocity threshold: minimum pixels per second for a "fast swipe"
9533
+ // Lower thresholds for horizontal swipes as they're less common and more intentional
9534
+ var MIN_VELOCITY = isVertical ? 800 : 100; // 800px/s for vertical, 500px/s for horizontal
9535
+ var CONFIRMATION_DISTANCE = isVertical ? 150 : 15; // 150px for vertical, 100px for horizontal
9536
+
9537
+ var checkScrollBoundary = useCallback(function (element) {
9538
+ if (isVertical) {
9539
+ var scrollTop = element.scrollTop,
9540
+ scrollHeight = element.scrollHeight,
9541
+ clientHeight = element.clientHeight;
9542
+ if (direction === 'bottom') {
9543
+ // For bottom drawer, check if at top
9544
+ return scrollTop <= 1; // Small tolerance for floating point
9545
+ } else {
9546
+ // For top drawer, check if at bottom
9547
+ return scrollTop + clientHeight >= scrollHeight - 1;
9548
+ }
9549
+ } else {
9550
+ var scrollLeft = element.scrollLeft,
9551
+ scrollWidth = element.scrollWidth,
9552
+ clientWidth = element.clientWidth;
9553
+ if (direction === 'left') {
9554
+ // For left drawer, check if at left edge
9555
+ return scrollLeft <= 1;
9556
+ } else {
9557
+ // For right drawer, check if at right edge
9558
+ return scrollLeft + clientWidth >= scrollWidth - 1;
9559
+ }
9560
+ }
9561
+ }, [direction, isVertical]);
9562
+ var findScrollableParent = function findScrollableParent(element) {
9563
+ if (!element) return null;
9564
+ var isScrollable = function isScrollable(el) {
9565
+ var style = window.getComputedStyle(el);
9566
+ var overflowY = style.overflowY;
9567
+ var overflowX = style.overflowX;
9568
+ return isVertical && (overflowY === 'auto' || overflowY === 'scroll') || !isVertical && (overflowX === 'auto' || overflowX === 'scroll');
9569
+ };
9570
+ var current = element;
9571
+ while (current && current !== wrapperRef.current) {
9572
+ if (isScrollable(current)) {
9573
+ return current;
9574
+ }
9575
+ current = current.parentElement;
9576
+ }
9577
+ return wrapperRef.current;
9578
+ };
9579
+ var handleTouchStart = useCallback(function (e) {
9580
+ var target = e.target;
9581
+
9582
+ // Ignore swipe if touch starts on or within an element with diva-stop-swipe-detection
9583
+ if (target.closest('.diva-stop-swipe-detection')) {
9584
+ return;
9585
+ }
9586
+ var touch = e.touches[0];
9587
+ startPos.current = {
9588
+ x: touch.clientX,
9589
+ y: touch.clientY
9590
+ };
9591
+ startTime.current = Date.now();
9592
+ lastSwipeTime.current = Date.now();
9593
+ lastSwipeDistance.current = 0;
9594
+ hasConfirmedFastSwipe.current = false; // Reset confirmation
9595
+ setIsDragging(false);
9596
+ setDragOffset(0);
9597
+
9598
+ // Find scrollable element
9599
+ var element = findScrollableParent(target);
9600
+ scrollableElement.current = element;
9601
+ if (element) {
9602
+ scrollAtBoundary.current = checkScrollBoundary(element);
9603
+ } else {
9604
+ scrollAtBoundary.current = false;
9605
+ }
9606
+ }, [checkScrollBoundary]);
9607
+ var handleTouchMove = useCallback(function (e) {
9608
+ if (!startPos.current) return;
9609
+ var touch = e.touches[0];
9610
+ var deltaX = touch.clientX - startPos.current.x;
9611
+ var deltaY = touch.clientY - startPos.current.y;
9612
+ var currentTime = Date.now();
9613
+
9614
+ // Calculate current velocity
9615
+ var timeDelta = currentTime - lastSwipeTime.current;
9616
+ var currentDistance = isVertical ? Math.abs(deltaY) : Math.abs(deltaX);
9617
+ var distanceDelta = currentDistance - lastSwipeDistance.current;
9618
+ var velocity = timeDelta > 0 ? distanceDelta / timeDelta * 1000 : 0; // pixels per second
9619
+
9620
+ // Update tracking
9621
+ lastSwipeTime.current = currentTime;
9622
+ lastSwipeDistance.current = currentDistance;
9623
+
9624
+ // Determine if gesture is in dismiss direction
9625
+ var dismissDirection = false;
9626
+ var offset = 0;
9627
+ if (isVertical) {
9628
+ offset = deltaY;
9629
+ if (direction === 'bottom') {
9630
+ dismissDirection = deltaY > 0; // Swipe down
9631
+ } else {
9632
+ dismissDirection = deltaY < 0; // Swipe up
9633
+ }
9634
+ } else {
9635
+ offset = deltaX;
9636
+ if (direction === 'left') {
9637
+ dismissDirection = deltaX < 0; // Swipe left
9638
+ } else {
9639
+ dismissDirection = deltaX > 0; // Swipe right
9640
+ }
9641
+ }
9642
+ var absOffset = Math.abs(offset);
9643
+ var isFastSwipe = velocity > MIN_VELOCITY;
9644
+ var isMainlyVertical = Math.abs(deltaY) > Math.abs(deltaX) * 1.5;
9645
+ var isMainlyHorizontal = Math.abs(deltaX) > Math.abs(deltaY) * 1.5;
9646
+ var correctAxis = isVertical ? isMainlyVertical : isMainlyHorizontal;
9647
+
9648
+ // PESSIMISTIC: Only confirm fast swipe once we've traveled enough distance at high velocity
9649
+ if (!hasConfirmedFastSwipe.current && scrollAtBoundary.current && dismissDirection && correctAxis && isFastSwipe && absOffset > CONFIRMATION_DISTANCE) {
9650
+ hasConfirmedFastSwipe.current = true;
9651
+ }
9652
+
9653
+ // Only show visual feedback AFTER confirmation
9654
+ if (hasConfirmedFastSwipe.current && scrollAtBoundary.current && dismissDirection && correctAxis) {
9655
+ e.preventDefault();
9656
+ setIsDragging(true);
9657
+ // Visual feedback during fast swipe
9658
+ var resistance = Math.min(absOffset / 3, 100);
9659
+ setDragOffset(offset > 0 ? resistance : -resistance);
9660
+ } else if (isDragging) {
9661
+ // Reset if conditions no longer met
9662
+ setIsDragging(false);
9663
+ setDragOffset(0);
9664
+ }
9665
+ }, [direction, isVertical, isDragging]);
9666
+ var handleTouchEnd = useCallback(function () {
9667
+ if (!startPos.current) {
9668
+ setIsDragging(false);
9669
+ setDragOffset(0);
9670
+ return;
9671
+ }
9672
+
9673
+ // Calculate final velocity
9674
+ var duration = Date.now() - startTime.current;
9675
+ var totalDistance = lastSwipeDistance.current;
9676
+ var avgVelocity = duration > 0 ? totalDistance / duration * 1000 : 0; // pixels per second
9677
+
9678
+ // Dismiss only if it was confirmed as a fast swipe
9679
+ var wasFastSwipe = hasConfirmedFastSwipe.current && avgVelocity > MIN_VELOCITY * 0.7 && scrollAtBoundary.current;
9680
+ if (wasFastSwipe) {
9681
+ onDismiss();
9682
+ }
9683
+
9684
+ // Reset state
9685
+ setIsDragging(false);
9686
+ setDragOffset(0);
9687
+ startPos.current = null;
9688
+ scrollAtBoundary.current = false;
9689
+ lastSwipeDistance.current = 0;
9690
+ lastSwipeTime.current = 0;
9691
+ hasConfirmedFastSwipe.current = false;
9692
+ }, [onDismiss]);
9693
+ return {
9694
+ isDragging: isDragging,
9695
+ dragOffset: dragOffset,
9696
+ handleTouchStart: handleTouchStart,
9697
+ handleTouchMove: handleTouchMove,
9698
+ handleTouchEnd: handleTouchEnd,
9699
+ wrapperRef: wrapperRef
9700
+ };
9701
+ };
9702
+
9515
9703
  function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9516
9704
  function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9517
- var MobileDrawer = function MobileDrawer(_ref) {
9518
- var _contentStore$drawerM, _contentStore$drawerM2;
9705
+ var DrawerMenu = function DrawerMenu(_ref) {
9706
+ var _contentStore$drawerM;
9519
9707
  _objectDestructuringEmpty(_ref);
9520
9708
  var _useDivaCoreContext = useDivaCoreContext(),
9521
9709
  contentStore = _useDivaCoreContext.contentStore;
9522
- var _useState = useState(0),
9523
- _useState2 = _slicedToArray(_useState, 2),
9524
- activeSnapPoint = _useState2[0],
9525
- _setActiveSnapPoint = _useState2[1];
9526
9710
  var useMove = useMemo(function () {
9527
9711
  return function (ev) {
9528
9712
  return ev.preventDefault();
9529
9713
  };
9530
9714
  }, []);
9531
- var closeDrawerMenu = contentStore.closeDrawerMenu;
9532
- var _ref2 = (_contentStore$drawerM = contentStore.drawerMenu) !== null && _contentStore$drawerM !== void 0 ? _contentStore$drawerM : {},
9715
+ var _ref2 = (_contentStore$drawerM = contentStore === null || contentStore === void 0 ? void 0 : contentStore.drawerMenu) !== null && _contentStore$drawerM !== void 0 ? _contentStore$drawerM : {},
9533
9716
  showOverlay = _ref2.showOverlay,
9534
- _ref2$mountElementId = _ref2.mountElementId,
9535
- mountElementId = _ref2$mountElementId === void 0 ? 'DivaCore' : _ref2$mountElementId,
9717
+ mountElement = _ref2.mountElement,
9536
9718
  onClose = _ref2.onClose,
9537
9719
  open = _ref2.open,
9538
9720
  _ref2$direction = _ref2.direction,
9539
9721
  direction = _ref2$direction === void 0 ? 'bottom' : _ref2$direction,
9540
9722
  title = _ref2.title,
9541
- snapPoints = _ref2.snapPoints,
9542
9723
  noModal = _ref2.noModal,
9543
9724
  handleInternScroll = _ref2.handleInternScroll,
9544
9725
  hideCloseButton = _ref2.hideCloseButton,
@@ -9546,7 +9727,12 @@ var MobileDrawer = function MobileDrawer(_ref) {
9546
9727
  backgroundColor = _ref2.backgroundColor,
9547
9728
  drawerStyle = _ref2.drawerStyle,
9548
9729
  wrapperStyle = _ref2.wrapperStyle;
9730
+ var _useState = useState(open !== null && open !== void 0 ? open : false),
9731
+ _useState2 = _slicedToArray(_useState, 2),
9732
+ isOpen = _useState2[0],
9733
+ setIsOpen = _useState2[1];
9549
9734
  useEffect(function () {
9735
+ setIsOpen(open !== null && open !== void 0 ? open : false);
9550
9736
  //when drawer is open, prevent swipe to refresh the page on android
9551
9737
  if (open) {
9552
9738
  window.addEventListener('touchmove', useMove, {
@@ -9561,102 +9747,130 @@ var MobileDrawer = function MobileDrawer(_ref) {
9561
9747
  window.removeEventListener('touchmove', useMove);
9562
9748
  if (!noModal) document.body.classList.remove('drawer-open');
9563
9749
  };
9564
- }, [(_contentStore$drawerM2 = contentStore.drawerMenu) === null || _contentStore$drawerM2 === void 0 ? void 0 : _contentStore$drawerM2.open]);
9565
- if (!contentStore.drawerMenu) return /*#__PURE__*/jsx(Fragment, {});
9566
- var mountElement = mountElementId ? document.getElementById(mountElementId) : undefined;
9567
- if (!mountElement) {
9568
- return /*#__PURE__*/jsx(Fragment, {});
9569
- }
9750
+ }, [open]);
9570
9751
  var close = function close() {
9571
- closeDrawerMenu();
9752
+ setIsOpen(false);
9572
9753
  //delay the state changes so the animation of the drawer is not interrupted
9573
9754
  setTimeout(function () {
9574
9755
  onClose === null || onClose === void 0 || onClose();
9575
9756
  }, 400);
9576
9757
  };
9577
- var contentHeight = '100%';
9578
- if (['bottom', 'top'].includes(direction)) {
9579
- if (snapPoints) {
9580
- if (snapPoints[activeSnapPoint] > 1) {
9581
- contentHeight = snapPoints[activeSnapPoint] + 'px';
9582
- } else contentHeight = 'calc(' + (snapPoints === null || snapPoints === void 0 ? void 0 : snapPoints[activeSnapPoint]) * 100 + '%' + ' - 5px)';
9583
- } else {
9584
- contentHeight = 'fit-content';
9585
- }
9586
- }
9587
- var maxHeight = contentHeight === 'fit-content' && mountElement ? mountElement === null || mountElement === void 0 ? void 0 : mountElement.getBoundingClientRect().height : undefined;
9588
- var maxWidth = ['left', 'right'].includes(direction) ? 400 : undefined;
9589
- return /*#__PURE__*/jsx(Drawer.Root, {
9590
- container: mountElement,
9591
- open: !!open,
9592
- direction: direction,
9758
+ var anchor = direction === 'left' ? 'left' : direction === 'right' ? 'right' : direction === 'top' ? 'top' : 'bottom';
9759
+ var isVertical = ['bottom', 'top'].includes(direction);
9760
+ var maxWidth = !isVertical ? 400 : undefined;
9761
+
9762
+ // Swipe to dismiss functionality
9763
+ var _useSwipeToDismiss = useSwipeToDismiss(direction, close),
9764
+ isDragging = _useSwipeToDismiss.isDragging,
9765
+ dragOffset = _useSwipeToDismiss.dragOffset,
9766
+ handleTouchStart = _useSwipeToDismiss.handleTouchStart,
9767
+ handleTouchMove = _useSwipeToDismiss.handleTouchMove,
9768
+ handleTouchEnd = _useSwipeToDismiss.handleTouchEnd,
9769
+ wrapperRef = _useSwipeToDismiss.wrapperRef;
9770
+ var iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent);
9771
+ if (!(contentStore !== null && contentStore !== void 0 && contentStore.drawerMenu)) return /*#__PURE__*/jsx(Fragment, {});
9772
+ return /*#__PURE__*/jsxs(SwipeableDrawer, {
9773
+ anchor: anchor,
9774
+ open: !!isOpen,
9593
9775
  onClose: close,
9594
- activeSnapPoint: snapPoints === null || snapPoints === void 0 ? void 0 : snapPoints[activeSnapPoint],
9595
- setActiveSnapPoint: function setActiveSnapPoint(s) {
9596
- var _snapPoints$indexOf;
9597
- return _setActiveSnapPoint((_snapPoints$indexOf = snapPoints === null || snapPoints === void 0 ? void 0 : snapPoints.indexOf(s)) !== null && _snapPoints$indexOf !== void 0 ? _snapPoints$indexOf : 0);
9776
+ disableBackdropTransition: !iOS,
9777
+ disableDiscovery: iOS,
9778
+ hideBackdrop: !showOverlay,
9779
+ onOpen: function onOpen() {},
9780
+ disableSwipeToOpen: true,
9781
+ container: mountElement,
9782
+ variant: 'temporary',
9783
+ ModalProps: {
9784
+ keepMounted: true,
9785
+ style: _objectSpread$5(_objectSpread$5({}, noModal ? {
9786
+ pointerEvents: 'none'
9787
+ } : undefined), (drawerStyle === null || drawerStyle === void 0 ? void 0 : drawerStyle.zIndex) !== undefined ? {
9788
+ zIndex: drawerStyle.zIndex
9789
+ } : undefined),
9790
+ disableEnforceFocus: !showOverlay,
9791
+ // Allow focus outside drawer when no overlay
9792
+ disableAutoFocus: !showOverlay // Don't auto-focus drawer content when no overlay
9598
9793
  },
9599
- snapPoints: snapPoints,
9600
- closeThreshold: 0.8,
9601
- repositionInputs: false,
9602
- modal: !noModal,
9603
- children: /*#__PURE__*/jsxs(Drawer.Portal, {
9604
- children: [showOverlay && /*#__PURE__*/jsx(Drawer.Overlay, {
9605
- className: overlay
9606
- }), /*#__PURE__*/jsxs(Drawer.Content, {
9607
- className: classnames(drawerWrapper, direction === 'bottom' ? bottom : direction === 'left' ? left : direction === 'right' ? right : direction === 'top' ? top : undefined),
9794
+ slotProps: _objectSpread$5(_objectSpread$5({}, showOverlay ? {
9795
+ backdrop: {
9796
+ className: overlay,
9797
+ style: {
9798
+ position: 'absolute'
9799
+ }
9800
+ }
9801
+ } : {}), {}, {
9802
+ paper: {
9803
+ className: classnames(drawerContent, direction === 'bottom' ? bottom : direction === 'left' ? left : direction === 'right' ? right : direction === 'top' ? top : undefined),
9608
9804
  style: _objectSpread$5({
9609
- height: contentHeight,
9610
- maxHeight: maxHeight ? maxHeight + 'px' : undefined,
9611
- maxWidth: maxWidth
9805
+ height: isVertical ? 'auto' : '100%',
9806
+ maxHeight: isVertical ? '85%' : undefined,
9807
+ maxWidth: maxWidth,
9808
+ position: 'absolute',
9809
+ borderTopRightRadius: ['bottom', 'left'].includes(direction) ? '10px' : '0px',
9810
+ borderTopLeftRadius: ['bottom', 'right'].includes(direction) ? '10px' : '0px',
9811
+ borderBottomRightRadius: ['top', 'right'].includes(direction) ? '10px' : '0px',
9812
+ borderBottomLeftRadius: ['top', 'left'].includes(direction) ? '10px' : '0px',
9813
+ display: 'flex',
9814
+ flexDirection: 'column',
9815
+ transform: isDragging ? "translate".concat(isVertical ? 'Y' : 'X', "(").concat(dragOffset, "px)") : undefined,
9816
+ transition: isDragging ? 'none' : 'transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1)',
9817
+ willChange: isDragging ? 'transform' : 'auto'
9612
9818
  }, drawerStyle),
9613
- children: [/*#__PURE__*/jsx(Drawer.Title, {
9614
- style: {
9615
- display: 'none'
9616
- },
9617
- children: "Settings Drawer"
9618
- }), ['bottom', 'top'].includes(direction) && /*#__PURE__*/jsx(Drawer.Handle, {
9619
- className: handle,
9620
- children: /*#__PURE__*/jsx("div", {
9621
- className: drawerHandle,
9622
- children: /*#__PURE__*/jsx("div", {
9623
- className: drawerHandleLine
9624
- })
9625
- })
9626
- }), /*#__PURE__*/jsxs("div", {
9627
- className: classnames(drawer, ['left', 'right'].includes(direction) ? onSide : undefined),
9628
- onTouchMove: function onTouchMove(e) {
9629
- if (!e.target.closest('.diva-stop-swipe-detection')) e.stopPropagation();
9630
- },
9631
- style: _objectSpread$5({
9632
- height: contentHeight,
9633
- maxWidth: maxWidth,
9634
- maxHeight: maxHeight ? maxHeight - 22 + 'px' : undefined,
9635
- backgroundColor: backgroundColor
9636
- }, wrapperStyle),
9637
- children: [!hideCloseButton && /*#__PURE__*/jsx("button", {
9638
- className: closeButton,
9639
- onClick: close
9640
- }), title !== undefined && /*#__PURE__*/jsx("div", {
9641
- className: classnames(drawerHeader),
9642
- children: title
9643
- }), !handleInternScroll ? /*#__PURE__*/jsxs("div", {
9644
- className: classnames(scrollWrapper),
9645
- children: [content, /*#__PURE__*/jsx("div", {
9646
- className: bottomSpacer
9647
- })]
9648
- }) : content]
9819
+ elevation: 0
9820
+ }
9821
+ }),
9822
+ children: [isVertical && /*#__PURE__*/jsx("div", {
9823
+ className: drawerHandle,
9824
+ children: /*#__PURE__*/jsx("div", {
9825
+ className: drawerHandleLine
9826
+ })
9827
+ }), title !== undefined && /*#__PURE__*/jsx("div", {
9828
+ className: classnames(drawerHeader),
9829
+ children: title
9830
+ }), /*#__PURE__*/jsxs("div", {
9831
+ className: classnames(drawer, !isVertical ? onSide : undefined),
9832
+ onTouchMove: function onTouchMove(e) {
9833
+ if (!e.target.closest('.diva-stop-swipe-detection')) e.stopPropagation();
9834
+ },
9835
+ style: _objectSpread$5({
9836
+ maxWidth: maxWidth,
9837
+ backgroundColor: backgroundColor
9838
+ }, wrapperStyle),
9839
+ children: [!hideCloseButton && /*#__PURE__*/jsx("button", {
9840
+ className: closeButton,
9841
+ onClick: close
9842
+ }), !handleInternScroll ? /*#__PURE__*/jsxs("div", {
9843
+ ref: wrapperRef,
9844
+ className: classnames(scrollWrapper),
9845
+ onTouchStart: handleTouchStart,
9846
+ onTouchMove: handleTouchMove,
9847
+ onTouchEnd: handleTouchEnd,
9848
+ children: [content, /*#__PURE__*/jsx("div", {
9849
+ className: bottomSpacer
9649
9850
  })]
9851
+ }) : /*#__PURE__*/jsx("div", {
9852
+ ref: wrapperRef,
9853
+ style: {
9854
+ flex: 1,
9855
+ minHeight: 0,
9856
+ overflow: 'hidden',
9857
+ display: 'flex',
9858
+ flexDirection: 'column'
9859
+ },
9860
+ onTouchStart: handleTouchStart,
9861
+ onTouchMove: handleTouchMove,
9862
+ onTouchEnd: handleTouchEnd,
9863
+ children: content
9650
9864
  })]
9651
- })
9865
+ })]
9652
9866
  });
9653
9867
  };
9654
- var DrawerMenu = observer(MobileDrawer);
9868
+ var DrawerMenu$1 = observer(DrawerMenu);
9655
9869
 
9656
9870
  function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9657
9871
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9658
9872
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
9659
- return import('./ModalsWrapper-8f4bf458.js');
9873
+ return import('./ModalsWrapper-fd0c0509.js');
9660
9874
  });
9661
9875
  function Fullscreen(_ref) {
9662
9876
  var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
@@ -9752,7 +9966,7 @@ function Fullscreen(_ref) {
9752
9966
  style: isMobile ? (_c$state$absoluteFull = c.state.absoluteFullscreenStyle) === null || _c$state$absoluteFull === void 0 ? void 0 : _c$state$absoluteFull.mobile : (_c$state$absoluteFull2 = c.state.absoluteFullscreenStyle) === null || _c$state$absoluteFull2 === void 0 ? void 0 : _c$state$absoluteFull2.desktop,
9753
9967
  children: [/*#__PURE__*/jsx(Fullscreen, {
9754
9968
  inAbsoluteFullscreen: true
9755
- }), /*#__PURE__*/jsx(Spinner$1, {}), /*#__PURE__*/jsx(DrawerMenu, {}), configurationStore.enableModals && /*#__PURE__*/jsx(LazyModals$1, {}), /*#__PURE__*/jsx(Suspense, {
9969
+ }), /*#__PURE__*/jsx(Spinner$1, {}), /*#__PURE__*/jsx(DrawerMenu$1, {}), configurationStore.enableModals && /*#__PURE__*/jsx(LazyModals$1, {}), /*#__PURE__*/jsx(Suspense, {
9756
9970
  fallback: /*#__PURE__*/jsx(Fallback, {}),
9757
9971
  children: /*#__PURE__*/jsx(C, _objectSpread$4({}, c.state))
9758
9972
  })]
@@ -9765,7 +9979,7 @@ function Fullscreen(_ref) {
9765
9979
  style: {
9766
9980
  zIndex: contentStore.fullscreen.overwrittenZIndex
9767
9981
  },
9768
- children: [!contentStore.fullscreen.hideSpinner && /*#__PURE__*/jsx(Spinner$1, {}), /*#__PURE__*/jsx(DrawerMenu, {}), configurationStore.enableModals && /*#__PURE__*/jsx(LazyModals$1, {}), !contentStore.fullscreen.hideClose && /*#__PURE__*/jsx("div", {
9982
+ children: [!contentStore.fullscreen.hideSpinner && /*#__PURE__*/jsx(Spinner$1, {}), /*#__PURE__*/jsx(DrawerMenu$1, {}), configurationStore.enableModals && /*#__PURE__*/jsx(LazyModals$1, {}), !contentStore.fullscreen.hideClose && /*#__PURE__*/jsx("div", {
9769
9983
  className: closeIcon,
9770
9984
  onClick: onClose,
9771
9985
  "data-test-id": "closeFullscreenBtn",
@@ -10116,10 +10330,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
10116
10330
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10117
10331
  var LOG$2 = getLogger('Framework', 'Root');
10118
10332
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
10119
- return import('./index-c0408136.js');
10333
+ return import('./index-22d234c5.js');
10120
10334
  });
10121
10335
  var LazyModals = /*#__PURE__*/React.lazy(function () {
10122
- return import('./ModalsWrapper-8f4bf458.js');
10336
+ return import('./ModalsWrapper-fd0c0509.js');
10123
10337
  });
10124
10338
  function ContentComponent() {
10125
10339
  var context = useDivaCoreContext();
@@ -10130,7 +10344,7 @@ function ContentComponent() {
10130
10344
  children: [/*#__PURE__*/jsxs(Suspense, {
10131
10345
  fallback: /*#__PURE__*/jsx(Fragment, {}),
10132
10346
  children: [context.configurationStore.hasAuthentication && /*#__PURE__*/jsx(LazyAuth, {}), context.configurationStore.enableModals && !context.contentStore.fullscreen && !context.contentStore.isFullscreenComponentDefined && /*#__PURE__*/jsx(LazyModals, {})]
10133
- }), /*#__PURE__*/jsx(Banner$1, {}), /*#__PURE__*/jsx(Fullscreen$1, {}), /*#__PURE__*/jsx(SnackBar, {}), !context.contentStore.isFullscreenComponentDefined && /*#__PURE__*/jsx(DrawerMenu, {}), /*#__PURE__*/jsxs("div", {
10347
+ }), /*#__PURE__*/jsx(Banner$1, {}), /*#__PURE__*/jsx(Fullscreen$1, {}), /*#__PURE__*/jsx(SnackBar, {}), !context.contentStore.isFullscreenComponentDefined && /*#__PURE__*/jsx(DrawerMenu$1, {}), /*#__PURE__*/jsxs("div", {
10134
10348
  style: {
10135
10349
  position: 'relative',
10136
10350
  width: '100%',
@@ -11100,4 +11314,4 @@ LOG.startTransaction({
11100
11314
  });
11101
11315
  window.DIVA_VERSION = "v".concat(process.env.VERSION);
11102
11316
 
11103
- export { AuthorizationHandler as A, Content as C, DivaCore as D, HelpButton as H, ONE_DAY_UNIX as O, ProductHandler as P, RequestStatus as R, SupportHandler as S, useDivaCore as a, AnalyticsHandler as b, OrganizationHandler as c, ClientArticleHandler as d, DivaMockProvider as e, storyBookCoreMock as f, getLogger as g, styleInject as s, useDivaCoreContext as u };
11317
+ export { AuthorizationHandler as A, Content as C, DrawerMenu$1 as D, HelpButton as H, ONE_DAY_UNIX as O, ProductHandler as P, RequestStatus as R, SupportHandler as S, useDivaCore as a, DivaCore as b, AnalyticsHandler as c, OrganizationHandler as d, ClientArticleHandler as e, DivaMockProvider as f, getLogger as g, storyBookCoreMock as h, styleInject as s, useDivaCoreContext as u };
@@ -1,4 +1,4 @@
1
- export { b as AnalyticsHandler, A as AuthorizationHandler, d as ClientArticleHandler, C as Content, e as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, c as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, g as getLogger, f as storyBookCoreMock, a as useDivaCore } from './index-232f8624.js';
1
+ export { c as AnalyticsHandler, A as AuthorizationHandler, e as ClientArticleHandler, C as Content, f as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, d as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, h as storyBookCoreMock, a as useDivaCore } from './index-c7cc596b.js';
2
2
  export { DivaError, default as DivaUtils } from '@crystaldesign/diva-utils';
3
3
  export { Trans, useTranslation } from 'react-i18next';
4
4
  export * from '@crystaldesign/basket-model';
@@ -34,9 +34,8 @@ import 'axios';
34
34
  import '@crystaldesign/product-handler';
35
35
  import 'classnames';
36
36
  import '@babel/runtime/helpers/objectDestructuringEmpty';
37
- import 'vaul';
38
- import '@crystaldesign/content-box';
39
37
  import '@mui/material';
38
+ import '@crystaldesign/content-box';
40
39
  import '@crystaldesign/diva-core';
41
40
  import 'react-qr-code';
42
41
  import '@mui/icons-material/Close';
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- type Props = {};
3
- declare const _default: (({}: Props) => React.JSX.Element) & {
2
+ declare const _default: (({}: {}) => React.JSX.Element) & {
4
3
  displayName: string;
5
4
  };
6
5
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/DrawerMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAuB5D,KAAK,KAAK,GAAG,EAAE,CAAC;8BAEU,KAAK;;;AAuI/B,wBAAsC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/DrawerMenu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;;;;AAqL5D,wBAAoC"}
@@ -0,0 +1,11 @@
1
+ interface SwipeToDismissResult {
2
+ isDragging: boolean;
3
+ dragOffset: number;
4
+ handleTouchStart: (e: React.TouchEvent) => void;
5
+ handleTouchMove: (e: React.TouchEvent) => void;
6
+ handleTouchEnd: () => void;
7
+ wrapperRef: React.RefObject<HTMLDivElement>;
8
+ }
9
+ export declare const useSwipeToDismiss: (direction: "left" | "right" | "top" | "bottom", onDismiss: () => void) => SwipeToDismissResult;
10
+ export {};
11
+ //# sourceMappingURL=useSwipeToDismiss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSwipeToDismiss.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/DrawerMenu/useSwipeToDismiss.ts"],"names":[],"mappings":"AAEA,UAAU,oBAAoB;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAChD,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC/C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED,eAAO,MAAM,iBAAiB,cAAe,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,aAAa,MAAM,IAAI,KAAG,oBA6MzG,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface HeightAnimatorProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ duration?: number;
6
+ }
7
+ export declare const HeightAnimator: React.FC<HeightAnimatorProps>;
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map