@razorpay/blade 12.60.1 → 12.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +2 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +2 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/package.json +1 -1
|
@@ -182,7 +182,8 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
182
182
|
// take the grabHandle's height into headerHeight too
|
|
183
183
|
useIsomorphicLayoutEffect(function () {
|
|
184
184
|
if (!grabHandleRef.current) return;
|
|
185
|
-
|
|
185
|
+
var marginBottom = window.getComputedStyle(grabHandleRef.current).marginBottom;
|
|
186
|
+
setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height + parseFloat(marginBottom));
|
|
186
187
|
}, [grabHandleRef.current, _isOpen]);
|
|
187
188
|
|
|
188
189
|
// if bottomSheet height is >35% & <50% then set initial snapPoint to 35%
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks, enableBodyScroll } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n isDismissible = true,\n zIndex = componentZIndices.bottomSheet,\n ...dataAnalyticsProps\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY = limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n // If headerHeight is zero no need to add height of grabHandleHeight.\n headerHeight: headerHeight > 0 ? headerHeight + grabHandleHeight : 0,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height);\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n if (isDismissible) {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss?.();\n }\n returnFocus();\n }, [isDismissible, onDismiss, bottomSheetAndDropdownGlue, returnFocus]);\n\n // sync controlled state to our actions\n React.useEffect(() => {\n if (_isOpen) {\n // open on the next frame, otherwise the animations will not run on first render\n window.setTimeout(() => {\n handleOnOpen();\n });\n } else {\n handleOnClose();\n }\n }, [_isOpen, handleOnClose, handleOnOpen]);\n\n // let the Dropdown component know that it's rendering a bottomsheet\n React.useEffect(() => {\n if (!bottomSheetAndDropdownGlue) return;\n bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);\n }, [bottomSheetAndDropdownGlue]);\n\n const bind = useDrag(\n ({\n active,\n last,\n cancel,\n tap,\n movement: [_movementX, movementY],\n velocity: [_velocityX, velocityY],\n lastOffset: [_, lastOffsetY],\n down,\n dragging,\n event,\n args: [{ isContentDragging = false } = {}] = [],\n }) => {\n // Check if the touch started on a scrollable element (e.g., SpinWheel in TimePicker)\n // This prevents BottomSheet drag gestures from interfering with internal scrolling\n const touchTarget = event?.target as Element | undefined;\n const isScrollableContent = touchTarget?.closest('[data-allow-scroll]');\n\n if (isScrollableContent) {\n return;\n }\n setIsDragging(Boolean(dragging));\n // lastOffsetY is the previous position user stopped dragging the sheet\n // movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives\n // and rawY is the calculated offset from the last position of the bottomsheet to current drag amount.\n const rawY = lastOffsetY - movementY;\n\n const lowerSnapPoint = dimensions.height * snapPoints[0];\n const upperSnapPoint = dimensions.height * snapPoints[snapPoints.length - 1];\n\n // predictedY is used to create velocity driven swipe\n // the faster you swipe the more distance you cover\n // this enables users to reach upper & lower snappoint with a single swipe\n const predictedDistance = movementY * (velocityY / 2);\n const predictedY = Math.max(\n lowerSnapPoint,\n Math.min(upperSnapPoint, rawY - predictedDistance * 2),\n );\n\n let newY = rawY;\n\n if (down) {\n // Ensure that users aren't able to drag the sheet\n // more than the upperSnapPoint or maximum height of the sheet\n // this is basically a clamp() function but creates a nice rubberband effect\n const dampening = 0.55;\n if (totalHeight < upperSnapPoint) {\n newY = rubberbandIfOutOfBounds(rawY, 0, totalHeight, dampening);\n } else {\n newY = rubberbandIfOutOfBounds(rawY, 0, upperSnapPoint, dampening);\n }\n } else {\n newY = predictedY;\n }\n\n const isPosAtUpperSnapPoint = newY >= upperSnapPoint;\n\n if (isContentDragging) {\n if (isPosAtUpperSnapPoint) {\n newY = upperSnapPoint;\n }\n\n // keep the newY at upper snap point\n // until the scrollable content is not at top\n // and previously saved Y position is greater than or equal to upper snap point\n // Note: how using newY won't work here since we need the previous value of the newY\n // since we always keep updating the newY,\n // this is cruicial in making the scroll feel natural\n const isContentScrolledAtTop = scrollRef.current && scrollRef.current.scrollTop <= 0;\n if (lastOffsetY === upperSnapPoint && !isContentScrolledAtTop) {\n newY = upperSnapPoint;\n }\n preventScrollingRef.current = newY < upperSnapPoint;\n }\n\n if (last) {\n // calculate the nearest snapPoint\n const [nearest, lower] = computeSnapPointBounds(\n newY,\n snapPoints.map((point) => dimensions.height * point) as SnapPoints,\n );\n\n // This ensure that the lower snapPoint will always have atleast some buffer\n // When the bottomsheet total height is less than the lower snapPoint\n // Video walkthrough: https://www.loom.com/share/a9a8db7688d64194b13df8b3e25859ae\n const lowerPointBuffer = 60;\n const lowerestSnap = Math.min(lower, totalHeight) - lowerPointBuffer;\n\n const shouldClose = rawY < lowerestSnap;\n if (shouldClose) {\n if (isDismissible) {\n // Allow closing if dismissible\n setIsDragging(false);\n cancel();\n close();\n return;\n } else {\n // If not dismissible, snap back to first snap point instead of closing\n setIsDragging(false);\n cancel();\n const firstSnapPoint = dimensions.height * snapPoints[0];\n setPositionY(firstSnapPoint, true);\n return;\n }\n }\n\n // if we stop dragging assign snap to the nearest point\n if (!active && !tap) {\n newY = nearest;\n }\n }\n\n setPositionY(newY, !down);\n },\n {\n from: [0, positionY],\n filterTaps: true,\n enabled: isOnTopOfStack && _isOpen,\n },\n );\n\n // Here we are preventing the scrolling of the content, until the preventScrollingRef value is true\n useIsomorphicLayoutEffect(() => {\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const preventScrolling = (e: Event) => {\n if (preventScrollingRef?.current) {\n // Allow scrolling for components that explicitly need scroll functionality\n const target = e.target as Element;\n const isAllowedComponent = target.closest('[data-allow-scroll]');\n\n if (!isAllowedComponent) {\n e.preventDefault();\n }\n }\n };\n\n // https://www.bram.us/2016/05/02/prevent-overscroll-bounce-in-ios-mobilesafari-pure-css/\n const preventSafariOverscroll = (e: Event) => {\n if (scrollElement.scrollTop < 0) {\n // TODO: figure this out, it doesn't seem to work >iOS12\n // requestAnimationFrame(() => {\n // elem.style.overflow = 'hidden';\n // elem.scrollTop = 0;\n // elem.style.removeProperty('overflow');\n // });\n e.preventDefault();\n }\n };\n\n scrollElement.addEventListener('scroll', preventScrolling);\n scrollElement.addEventListener('touchmove', preventScrolling);\n scrollElement.addEventListener('touchstart', preventSafariOverscroll);\n return () => {\n scrollElement.removeEventListener('scroll', preventScrolling);\n scrollElement.removeEventListener('touchmove', preventScrolling);\n scrollElement.removeEventListener('touchstart', preventSafariOverscroll);\n };\n // Only run this hook when we know all the layout calculations are done,\n // Otherwise the scrollRef.current will be null.\n // isReady prop will ensure that we are done measuring the content height\n }, [isReady]);\n\n // usePresence hook waits for the animation to finish before unmounting the component\n // It's similar to motion/react's usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n }),\n [\n isVisible,\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\n\n // Remove the bottomsheet from the stack, if it's unmounted forcefully\n React.useEffect(() => {\n return () => {\n if (id === undefined) return;\n removeBottomSheetFromStack(id);\n };\n }, [id, removeBottomSheetFromStack]);\n\n // Disable body scroll lock when the component is unmounted forcefully\n React.useEffect(() => {\n const lockTarget = scrollRef.current;\n return () => {\n if (lockTarget) {\n enableBodyScroll(lockTarget);\n }\n };\n // when BottomSheet is mounted with isOpen={false}, then BottomSheetBody does not set scrollRef\n // so, we added scrollRef to dependencies array to ensure that we update lockTarget when scrollRef is updated\n // which will avoid passing null to enableBodyScroll\n }, [scrollRef]);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$isDismissible","isDismissible","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$useState0","hasBodyPadding","setHasBodyPadding","_React$useState1","_React$useState10","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState11","_React$useState12","positionY","_setPositionY","_isOpen","_React$useState13","_React$useState14","setIsDragging","preventScrollingRef","useRef","scrollRef","grabHandleRef","defaultInitialFocusRef","originalFocusElement","initialSnapPoint","totalHeight","useMemo","id","useId","_useBottomSheetStack","useBottomSheetStack","stack","addBottomSheetToStack","removeBottomSheetFromStack","getTopOfTheStack","getCurrentStackIndexById","currentStackIndex","isOnTopOfStack","bottomSheetZIndex","setPositionY","useCallback","value","limit","arguments","length","shouldLimitPositionY","hasAutoCompleteInHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","useLayoutEffect","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","_bottomSheetAndDropdo","onBottomSheetDismiss","call","window","setTimeout","setDropdownHasBottomSheet","bind","useDrag","_ref3","active","last","cancel","tap","_ref3$movement","movement","_movementX","movementY","_ref3$velocity","velocity","_velocityX","velocityY","_ref3$lastOffset","lastOffset","_","lastOffsetY","down","dragging","event","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","touchTarget","target","isScrollableContent","closest","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","firstSnapPoint","from","filterTaps","scrollElement","preventScrolling","e","isAllowedComponent","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","lockTarget","enableBodyScroll","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","makeAnalyticsAttribute","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,E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ba,aAAa,CAAC;UAAEC,IAAI,EAAEc,YAAY,CAACF,qBAAAA;SAAuB,CAAC,GAC3DnG,IAAI,EAAE,CACX,CAAC,EACDzH,QAAQ,CAAA;OACF,CAAA;AAAC,KAAA,CACQ,CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMkN,WAAW,gBAAGa,wBAAwB,CAACnO,YAAY,EAAE;EACzDtC,WAAW,EAAEwQ,YAAY,CAACZ,WAAAA;AAC5B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BottomSheet.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks, enableBodyScroll } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n isDismissible = true,\n zIndex = componentZIndices.bottomSheet,\n ...dataAnalyticsProps\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY = limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n // If headerHeight is zero no need to add height of grabHandleHeight.\n headerHeight: headerHeight > 0 ? headerHeight + grabHandleHeight : 0,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n const marginBottom = window.getComputedStyle(grabHandleRef.current).marginBottom;\n setGrabHandleHeight(\n grabHandleRef.current.getBoundingClientRect().height + parseFloat(marginBottom),\n );\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n if (isDismissible) {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss?.();\n }\n returnFocus();\n }, [isDismissible, onDismiss, bottomSheetAndDropdownGlue, returnFocus]);\n\n // sync controlled state to our actions\n React.useEffect(() => {\n if (_isOpen) {\n // open on the next frame, otherwise the animations will not run on first render\n window.setTimeout(() => {\n handleOnOpen();\n });\n } else {\n handleOnClose();\n }\n }, [_isOpen, handleOnClose, handleOnOpen]);\n\n // let the Dropdown component know that it's rendering a bottomsheet\n React.useEffect(() => {\n if (!bottomSheetAndDropdownGlue) return;\n bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);\n }, [bottomSheetAndDropdownGlue]);\n\n const bind = useDrag(\n ({\n active,\n last,\n cancel,\n tap,\n movement: [_movementX, movementY],\n velocity: [_velocityX, velocityY],\n lastOffset: [_, lastOffsetY],\n down,\n dragging,\n event,\n args: [{ isContentDragging = false } = {}] = [],\n }) => {\n // Check if the touch started on a scrollable element (e.g., SpinWheel in TimePicker)\n // This prevents BottomSheet drag gestures from interfering with internal scrolling\n const touchTarget = event?.target as Element | undefined;\n const isScrollableContent = touchTarget?.closest('[data-allow-scroll]');\n\n if (isScrollableContent) {\n return;\n }\n setIsDragging(Boolean(dragging));\n // lastOffsetY is the previous position user stopped dragging the sheet\n // movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives\n // and rawY is the calculated offset from the last position of the bottomsheet to current drag amount.\n const rawY = lastOffsetY - movementY;\n\n const lowerSnapPoint = dimensions.height * snapPoints[0];\n const upperSnapPoint = dimensions.height * snapPoints[snapPoints.length - 1];\n\n // predictedY is used to create velocity driven swipe\n // the faster you swipe the more distance you cover\n // this enables users to reach upper & lower snappoint with a single swipe\n const predictedDistance = movementY * (velocityY / 2);\n const predictedY = Math.max(\n lowerSnapPoint,\n Math.min(upperSnapPoint, rawY - predictedDistance * 2),\n );\n\n let newY = rawY;\n\n if (down) {\n // Ensure that users aren't able to drag the sheet\n // more than the upperSnapPoint or maximum height of the sheet\n // this is basically a clamp() function but creates a nice rubberband effect\n const dampening = 0.55;\n if (totalHeight < upperSnapPoint) {\n newY = rubberbandIfOutOfBounds(rawY, 0, totalHeight, dampening);\n } else {\n newY = rubberbandIfOutOfBounds(rawY, 0, upperSnapPoint, dampening);\n }\n } else {\n newY = predictedY;\n }\n\n const isPosAtUpperSnapPoint = newY >= upperSnapPoint;\n\n if (isContentDragging) {\n if (isPosAtUpperSnapPoint) {\n newY = upperSnapPoint;\n }\n\n // keep the newY at upper snap point\n // until the scrollable content is not at top\n // and previously saved Y position is greater than or equal to upper snap point\n // Note: how using newY won't work here since we need the previous value of the newY\n // since we always keep updating the newY,\n // this is cruicial in making the scroll feel natural\n const isContentScrolledAtTop = scrollRef.current && scrollRef.current.scrollTop <= 0;\n if (lastOffsetY === upperSnapPoint && !isContentScrolledAtTop) {\n newY = upperSnapPoint;\n }\n preventScrollingRef.current = newY < upperSnapPoint;\n }\n\n if (last) {\n // calculate the nearest snapPoint\n const [nearest, lower] = computeSnapPointBounds(\n newY,\n snapPoints.map((point) => dimensions.height * point) as SnapPoints,\n );\n\n // This ensure that the lower snapPoint will always have atleast some buffer\n // When the bottomsheet total height is less than the lower snapPoint\n // Video walkthrough: https://www.loom.com/share/a9a8db7688d64194b13df8b3e25859ae\n const lowerPointBuffer = 60;\n const lowerestSnap = Math.min(lower, totalHeight) - lowerPointBuffer;\n\n const shouldClose = rawY < lowerestSnap;\n if (shouldClose) {\n if (isDismissible) {\n // Allow closing if dismissible\n setIsDragging(false);\n cancel();\n close();\n return;\n } else {\n // If not dismissible, snap back to first snap point instead of closing\n setIsDragging(false);\n cancel();\n const firstSnapPoint = dimensions.height * snapPoints[0];\n setPositionY(firstSnapPoint, true);\n return;\n }\n }\n\n // if we stop dragging assign snap to the nearest point\n if (!active && !tap) {\n newY = nearest;\n }\n }\n\n setPositionY(newY, !down);\n },\n {\n from: [0, positionY],\n filterTaps: true,\n enabled: isOnTopOfStack && _isOpen,\n },\n );\n\n // Here we are preventing the scrolling of the content, until the preventScrollingRef value is true\n useIsomorphicLayoutEffect(() => {\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const preventScrolling = (e: Event) => {\n if (preventScrollingRef?.current) {\n // Allow scrolling for components that explicitly need scroll functionality\n const target = e.target as Element;\n const isAllowedComponent = target.closest('[data-allow-scroll]');\n\n if (!isAllowedComponent) {\n e.preventDefault();\n }\n }\n };\n\n // https://www.bram.us/2016/05/02/prevent-overscroll-bounce-in-ios-mobilesafari-pure-css/\n const preventSafariOverscroll = (e: Event) => {\n if (scrollElement.scrollTop < 0) {\n // TODO: figure this out, it doesn't seem to work >iOS12\n // requestAnimationFrame(() => {\n // elem.style.overflow = 'hidden';\n // elem.scrollTop = 0;\n // elem.style.removeProperty('overflow');\n // });\n e.preventDefault();\n }\n };\n\n scrollElement.addEventListener('scroll', preventScrolling);\n scrollElement.addEventListener('touchmove', preventScrolling);\n scrollElement.addEventListener('touchstart', preventSafariOverscroll);\n return () => {\n scrollElement.removeEventListener('scroll', preventScrolling);\n scrollElement.removeEventListener('touchmove', preventScrolling);\n scrollElement.removeEventListener('touchstart', preventSafariOverscroll);\n };\n // Only run this hook when we know all the layout calculations are done,\n // Otherwise the scrollRef.current will be null.\n // isReady prop will ensure that we are done measuring the content height\n }, [isReady]);\n\n // usePresence hook waits for the animation to finish before unmounting the component\n // It's similar to motion/react's usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n }),\n [\n isVisible,\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\n\n // Remove the bottomsheet from the stack, if it's unmounted forcefully\n React.useEffect(() => {\n return () => {\n if (id === undefined) return;\n removeBottomSheetFromStack(id);\n };\n }, [id, removeBottomSheetFromStack]);\n\n // Disable body scroll lock when the component is unmounted forcefully\n React.useEffect(() => {\n const lockTarget = scrollRef.current;\n return () => {\n if (lockTarget) {\n enableBodyScroll(lockTarget);\n }\n };\n // when BottomSheet is mounted with isOpen={false}, then BottomSheetBody does not set scrollRef\n // so, we added scrollRef to dependencies array to ensure that we update lockTarget when scrollRef is updated\n // which will avoid passing null to enableBodyScroll\n }, [scrollRef]);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$isDismissible","isDismissible","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$useState0","hasBodyPadding","setHasBodyPadding","_React$useState1","_React$useState10","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState11","_React$useState12","positionY","_setPositionY","_isOpen","_React$useState13","_React$useState14","setIsDragging","preventScrollingRef","useRef","scrollRef","grabHandleRef","defaultInitialFocusRef","originalFocusElement","initialSnapPoint","totalHeight","useMemo","id","useId","_useBottomSheetStack","useBottomSheetStack","stack","addBottomSheetToStack","removeBottomSheetFromStack","getTopOfTheStack","getCurrentStackIndexById","currentStackIndex","isOnTopOfStack","bottomSheetZIndex","setPositionY","useCallback","value","limit","arguments","length","shouldLimitPositionY","hasAutoCompleteInHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","marginBottom","window","getComputedStyle","getBoundingClientRect","height","parseFloat","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","useLayoutEffect","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","_bottomSheetAndDropdo","onBottomSheetDismiss","call","setTimeout","setDropdownHasBottomSheet","bind","useDrag","_ref3","active","last","cancel","tap","_ref3$movement","movement","_movementX","movementY","_ref3$velocity","velocity","_velocityX","velocityY","_ref3$lastOffset","lastOffset","_","lastOffsetY","down","dragging","event","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","touchTarget","target","isScrollableContent","closest","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","firstSnapPoint","from","filterTaps","scrollElement","preventScrolling","e","isAllowedComponent","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","lockTarget","enableBodyScroll","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","makeAnalyticsAttribute","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EACnC,OAAO;IACLC,UAAU,EAAEH,KAAK,CAACI,MAAM,CAACC,KAAK,CAACF,UAAU,CAACG,MAAM;AAChDC,IAAAA,mBAAmB,EA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CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMqN,WAAW,gBAAGa,wBAAwB,CAACtO,YAAY,EAAE;EACzDtC,WAAW,EAAE2Q,YAAY,CAACZ,WAAAA;AAC5B,CAAC;;;;"}
|
|
@@ -182,7 +182,8 @@ var _BottomSheet = function _BottomSheet(_ref2) {
|
|
|
182
182
|
// take the grabHandle's height into headerHeight too
|
|
183
183
|
useIsomorphicLayoutEffect(function () {
|
|
184
184
|
if (!grabHandleRef.current) return;
|
|
185
|
-
|
|
185
|
+
var marginBottom = window.getComputedStyle(grabHandleRef.current).marginBottom;
|
|
186
|
+
setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height + parseFloat(marginBottom));
|
|
186
187
|
}, [grabHandleRef.current, _isOpen]);
|
|
187
188
|
|
|
188
189
|
// if bottomSheet height is >35% & <50% then set initial snapPoint to 35%
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks, enableBodyScroll } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n isDismissible = true,\n zIndex = componentZIndices.bottomSheet,\n ...dataAnalyticsProps\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY = limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n // If headerHeight is zero no need to add height of grabHandleHeight.\n headerHeight: headerHeight > 0 ? headerHeight + grabHandleHeight : 0,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height);\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n if (isDismissible) {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss?.();\n }\n returnFocus();\n }, [isDismissible, onDismiss, bottomSheetAndDropdownGlue, returnFocus]);\n\n // sync controlled state to our actions\n React.useEffect(() => {\n if (_isOpen) {\n // open on the next frame, otherwise the animations will not run on first render\n window.setTimeout(() => {\n handleOnOpen();\n });\n } else {\n handleOnClose();\n }\n }, [_isOpen, handleOnClose, handleOnOpen]);\n\n // let the Dropdown component know that it's rendering a bottomsheet\n React.useEffect(() => {\n if (!bottomSheetAndDropdownGlue) return;\n bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);\n }, [bottomSheetAndDropdownGlue]);\n\n const bind = useDrag(\n ({\n active,\n last,\n cancel,\n tap,\n movement: [_movementX, movementY],\n velocity: [_velocityX, velocityY],\n lastOffset: [_, lastOffsetY],\n down,\n dragging,\n event,\n args: [{ isContentDragging = false } = {}] = [],\n }) => {\n // Check if the touch started on a scrollable element (e.g., SpinWheel in TimePicker)\n // This prevents BottomSheet drag gestures from interfering with internal scrolling\n const touchTarget = event?.target as Element | undefined;\n const isScrollableContent = touchTarget?.closest('[data-allow-scroll]');\n\n if (isScrollableContent) {\n return;\n }\n setIsDragging(Boolean(dragging));\n // lastOffsetY is the previous position user stopped dragging the sheet\n // movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives\n // and rawY is the calculated offset from the last position of the bottomsheet to current drag amount.\n const rawY = lastOffsetY - movementY;\n\n const lowerSnapPoint = dimensions.height * snapPoints[0];\n const upperSnapPoint = dimensions.height * snapPoints[snapPoints.length - 1];\n\n // predictedY is used to create velocity driven swipe\n // the faster you swipe the more distance you cover\n // this enables users to reach upper & lower snappoint with a single swipe\n const predictedDistance = movementY * (velocityY / 2);\n const predictedY = Math.max(\n lowerSnapPoint,\n Math.min(upperSnapPoint, rawY - predictedDistance * 2),\n );\n\n let newY = rawY;\n\n if (down) {\n // Ensure that users aren't able to drag the sheet\n // more than the upperSnapPoint or maximum height of the sheet\n // this is basically a clamp() function but creates a nice rubberband effect\n const dampening = 0.55;\n if (totalHeight < upperSnapPoint) {\n newY = rubberbandIfOutOfBounds(rawY, 0, totalHeight, dampening);\n } else {\n newY = rubberbandIfOutOfBounds(rawY, 0, upperSnapPoint, dampening);\n }\n } else {\n newY = predictedY;\n }\n\n const isPosAtUpperSnapPoint = newY >= upperSnapPoint;\n\n if (isContentDragging) {\n if (isPosAtUpperSnapPoint) {\n newY = upperSnapPoint;\n }\n\n // keep the newY at upper snap point\n // until the scrollable content is not at top\n // and previously saved Y position is greater than or equal to upper snap point\n // Note: how using newY won't work here since we need the previous value of the newY\n // since we always keep updating the newY,\n // this is cruicial in making the scroll feel natural\n const isContentScrolledAtTop = scrollRef.current && scrollRef.current.scrollTop <= 0;\n if (lastOffsetY === upperSnapPoint && !isContentScrolledAtTop) {\n newY = upperSnapPoint;\n }\n preventScrollingRef.current = newY < upperSnapPoint;\n }\n\n if (last) {\n // calculate the nearest snapPoint\n const [nearest, lower] = computeSnapPointBounds(\n newY,\n snapPoints.map((point) => dimensions.height * point) as SnapPoints,\n );\n\n // This ensure that the lower snapPoint will always have atleast some buffer\n // When the bottomsheet total height is less than the lower snapPoint\n // Video walkthrough: https://www.loom.com/share/a9a8db7688d64194b13df8b3e25859ae\n const lowerPointBuffer = 60;\n const lowerestSnap = Math.min(lower, totalHeight) - lowerPointBuffer;\n\n const shouldClose = rawY < lowerestSnap;\n if (shouldClose) {\n if (isDismissible) {\n // Allow closing if dismissible\n setIsDragging(false);\n cancel();\n close();\n return;\n } else {\n // If not dismissible, snap back to first snap point instead of closing\n setIsDragging(false);\n cancel();\n const firstSnapPoint = dimensions.height * snapPoints[0];\n setPositionY(firstSnapPoint, true);\n return;\n }\n }\n\n // if we stop dragging assign snap to the nearest point\n if (!active && !tap) {\n newY = nearest;\n }\n }\n\n setPositionY(newY, !down);\n },\n {\n from: [0, positionY],\n filterTaps: true,\n enabled: isOnTopOfStack && _isOpen,\n },\n );\n\n // Here we are preventing the scrolling of the content, until the preventScrollingRef value is true\n useIsomorphicLayoutEffect(() => {\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const preventScrolling = (e: Event) => {\n if (preventScrollingRef?.current) {\n // Allow scrolling for components that explicitly need scroll functionality\n const target = e.target as Element;\n const isAllowedComponent = target.closest('[data-allow-scroll]');\n\n if (!isAllowedComponent) {\n e.preventDefault();\n }\n }\n };\n\n // https://www.bram.us/2016/05/02/prevent-overscroll-bounce-in-ios-mobilesafari-pure-css/\n const preventSafariOverscroll = (e: Event) => {\n if (scrollElement.scrollTop < 0) {\n // TODO: figure this out, it doesn't seem to work >iOS12\n // requestAnimationFrame(() => {\n // elem.style.overflow = 'hidden';\n // elem.scrollTop = 0;\n // elem.style.removeProperty('overflow');\n // });\n e.preventDefault();\n }\n };\n\n scrollElement.addEventListener('scroll', preventScrolling);\n scrollElement.addEventListener('touchmove', preventScrolling);\n scrollElement.addEventListener('touchstart', preventSafariOverscroll);\n return () => {\n scrollElement.removeEventListener('scroll', preventScrolling);\n scrollElement.removeEventListener('touchmove', preventScrolling);\n scrollElement.removeEventListener('touchstart', preventSafariOverscroll);\n };\n // Only run this hook when we know all the layout calculations are done,\n // Otherwise the scrollRef.current will be null.\n // isReady prop will ensure that we are done measuring the content height\n }, [isReady]);\n\n // usePresence hook waits for the animation to finish before unmounting the component\n // It's similar to motion/react's usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n }),\n [\n isVisible,\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\n\n // Remove the bottomsheet from the stack, if it's unmounted forcefully\n React.useEffect(() => {\n return () => {\n if (id === undefined) return;\n removeBottomSheetFromStack(id);\n };\n }, [id, removeBottomSheetFromStack]);\n\n // Disable body scroll lock when the component is unmounted forcefully\n React.useEffect(() => {\n const lockTarget = scrollRef.current;\n return () => {\n if (lockTarget) {\n enableBodyScroll(lockTarget);\n }\n };\n // when BottomSheet is mounted with isOpen={false}, then BottomSheetBody does not set scrollRef\n // so, we added scrollRef to dependencies array to ensure that we update lockTarget when scrollRef is updated\n // which will avoid passing null to enableBodyScroll\n }, [scrollRef]);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$isDismissible","isDismissible","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$useState0","hasBodyPadding","setHasBodyPadding","_React$useState1","_React$useState10","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState11","_React$useState12","positionY","_setPositionY","_isOpen","_React$useState13","_React$useState14","setIsDragging","preventScrollingRef","useRef","scrollRef","grabHandleRef","defaultInitialFocusRef","originalFocusElement","initialSnapPoint","totalHeight","useMemo","id","useId","_useBottomSheetStack","useBottomSheetStack","stack","addBottomSheetToStack","removeBottomSheetFromStack","getTopOfTheStack","getCurrentStackIndexById","currentStackIndex","isOnTopOfStack","bottomSheetZIndex","setPositionY","useCallback","value","limit","arguments","length","shouldLimitPositionY","hasAutoCompleteInHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","useLayoutEffect","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","_bottomSheetAndDropdo","onBottomSheetDismiss","call","window","setTimeout","setDropdownHasBottomSheet","bind","useDrag","_ref3","active","last","cancel","tap","_ref3$movement","movement","_movementX","movementY","_ref3$velocity","velocity","_velocityX","velocityY","_ref3$lastOffset","lastOffset","_","lastOffsetY","down","dragging","event","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","touchTarget","target","isScrollableContent","closest","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","firstSnapPoint","from","filterTaps","scrollElement","preventScrolling","e","isAllowedComponent","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","lockTarget","enableBodyScroll","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","makeAnalyticsAttribute","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAA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AAAC,KAAA,CACQ,CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMkN,WAAW,gBAAGa,wBAAwB,CAACnO,YAAY,EAAE;EACzDtC,WAAW,EAAEwQ,YAAY,CAACZ,WAAAA;AAC5B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BottomSheet.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks, enableBodyScroll } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n isDismissible = true,\n zIndex = componentZIndices.bottomSheet,\n ...dataAnalyticsProps\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY = limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n // If headerHeight is zero no need to add height of grabHandleHeight.\n headerHeight: headerHeight > 0 ? headerHeight + grabHandleHeight : 0,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n const marginBottom = window.getComputedStyle(grabHandleRef.current).marginBottom;\n setGrabHandleHeight(\n grabHandleRef.current.getBoundingClientRect().height + parseFloat(marginBottom),\n );\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n if (isDismissible) {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss?.();\n }\n returnFocus();\n }, [isDismissible, onDismiss, bottomSheetAndDropdownGlue, returnFocus]);\n\n // sync controlled state to our actions\n React.useEffect(() => {\n if (_isOpen) {\n // open on the next frame, otherwise the animations will not run on first render\n window.setTimeout(() => {\n handleOnOpen();\n });\n } else {\n handleOnClose();\n }\n }, [_isOpen, handleOnClose, handleOnOpen]);\n\n // let the Dropdown component know that it's rendering a bottomsheet\n React.useEffect(() => {\n if (!bottomSheetAndDropdownGlue) return;\n bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);\n }, [bottomSheetAndDropdownGlue]);\n\n const bind = useDrag(\n ({\n active,\n last,\n cancel,\n tap,\n movement: [_movementX, movementY],\n velocity: [_velocityX, velocityY],\n lastOffset: [_, lastOffsetY],\n down,\n dragging,\n event,\n args: [{ isContentDragging = false } = {}] = [],\n }) => {\n // Check if the touch started on a scrollable element (e.g., SpinWheel in TimePicker)\n // This prevents BottomSheet drag gestures from interfering with internal scrolling\n const touchTarget = event?.target as Element | undefined;\n const isScrollableContent = touchTarget?.closest('[data-allow-scroll]');\n\n if (isScrollableContent) {\n return;\n }\n setIsDragging(Boolean(dragging));\n // lastOffsetY is the previous position user stopped dragging the sheet\n // movementY is the drag amount from the bottom of the screen, so as you drag up the movementY goes into negatives\n // and rawY is the calculated offset from the last position of the bottomsheet to current drag amount.\n const rawY = lastOffsetY - movementY;\n\n const lowerSnapPoint = dimensions.height * snapPoints[0];\n const upperSnapPoint = dimensions.height * snapPoints[snapPoints.length - 1];\n\n // predictedY is used to create velocity driven swipe\n // the faster you swipe the more distance you cover\n // this enables users to reach upper & lower snappoint with a single swipe\n const predictedDistance = movementY * (velocityY / 2);\n const predictedY = Math.max(\n lowerSnapPoint,\n Math.min(upperSnapPoint, rawY - predictedDistance * 2),\n );\n\n let newY = rawY;\n\n if (down) {\n // Ensure that users aren't able to drag the sheet\n // more than the upperSnapPoint or maximum height of the sheet\n // this is basically a clamp() function but creates a nice rubberband effect\n const dampening = 0.55;\n if (totalHeight < upperSnapPoint) {\n newY = rubberbandIfOutOfBounds(rawY, 0, totalHeight, dampening);\n } else {\n newY = rubberbandIfOutOfBounds(rawY, 0, upperSnapPoint, dampening);\n }\n } else {\n newY = predictedY;\n }\n\n const isPosAtUpperSnapPoint = newY >= upperSnapPoint;\n\n if (isContentDragging) {\n if (isPosAtUpperSnapPoint) {\n newY = upperSnapPoint;\n }\n\n // keep the newY at upper snap point\n // until the scrollable content is not at top\n // and previously saved Y position is greater than or equal to upper snap point\n // Note: how using newY won't work here since we need the previous value of the newY\n // since we always keep updating the newY,\n // this is cruicial in making the scroll feel natural\n const isContentScrolledAtTop = scrollRef.current && scrollRef.current.scrollTop <= 0;\n if (lastOffsetY === upperSnapPoint && !isContentScrolledAtTop) {\n newY = upperSnapPoint;\n }\n preventScrollingRef.current = newY < upperSnapPoint;\n }\n\n if (last) {\n // calculate the nearest snapPoint\n const [nearest, lower] = computeSnapPointBounds(\n newY,\n snapPoints.map((point) => dimensions.height * point) as SnapPoints,\n );\n\n // This ensure that the lower snapPoint will always have atleast some buffer\n // When the bottomsheet total height is less than the lower snapPoint\n // Video walkthrough: https://www.loom.com/share/a9a8db7688d64194b13df8b3e25859ae\n const lowerPointBuffer = 60;\n const lowerestSnap = Math.min(lower, totalHeight) - lowerPointBuffer;\n\n const shouldClose = rawY < lowerestSnap;\n if (shouldClose) {\n if (isDismissible) {\n // Allow closing if dismissible\n setIsDragging(false);\n cancel();\n close();\n return;\n } else {\n // If not dismissible, snap back to first snap point instead of closing\n setIsDragging(false);\n cancel();\n const firstSnapPoint = dimensions.height * snapPoints[0];\n setPositionY(firstSnapPoint, true);\n return;\n }\n }\n\n // if we stop dragging assign snap to the nearest point\n if (!active && !tap) {\n newY = nearest;\n }\n }\n\n setPositionY(newY, !down);\n },\n {\n from: [0, positionY],\n filterTaps: true,\n enabled: isOnTopOfStack && _isOpen,\n },\n );\n\n // Here we are preventing the scrolling of the content, until the preventScrollingRef value is true\n useIsomorphicLayoutEffect(() => {\n const scrollElement = scrollRef.current;\n if (!scrollElement) return;\n\n const preventScrolling = (e: Event) => {\n if (preventScrollingRef?.current) {\n // Allow scrolling for components that explicitly need scroll functionality\n const target = e.target as Element;\n const isAllowedComponent = target.closest('[data-allow-scroll]');\n\n if (!isAllowedComponent) {\n e.preventDefault();\n }\n }\n };\n\n // https://www.bram.us/2016/05/02/prevent-overscroll-bounce-in-ios-mobilesafari-pure-css/\n const preventSafariOverscroll = (e: Event) => {\n if (scrollElement.scrollTop < 0) {\n // TODO: figure this out, it doesn't seem to work >iOS12\n // requestAnimationFrame(() => {\n // elem.style.overflow = 'hidden';\n // elem.scrollTop = 0;\n // elem.style.removeProperty('overflow');\n // });\n e.preventDefault();\n }\n };\n\n scrollElement.addEventListener('scroll', preventScrolling);\n scrollElement.addEventListener('touchmove', preventScrolling);\n scrollElement.addEventListener('touchstart', preventSafariOverscroll);\n return () => {\n scrollElement.removeEventListener('scroll', preventScrolling);\n scrollElement.removeEventListener('touchmove', preventScrolling);\n scrollElement.removeEventListener('touchstart', preventSafariOverscroll);\n };\n // Only run this hook when we know all the layout calculations are done,\n // Otherwise the scrollRef.current will be null.\n // isReady prop will ensure that we are done measuring the content height\n }, [isReady]);\n\n // usePresence hook waits for the animation to finish before unmounting the component\n // It's similar to motion/react's usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n }),\n [\n isVisible,\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n isDismissible,\n ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\n\n // Remove the bottomsheet from the stack, if it's unmounted forcefully\n React.useEffect(() => {\n return () => {\n if (id === undefined) return;\n removeBottomSheetFromStack(id);\n };\n }, [id, removeBottomSheetFromStack]);\n\n // Disable body scroll lock when the component is unmounted forcefully\n React.useEffect(() => {\n const lockTarget = scrollRef.current;\n return () => {\n if (lockTarget) {\n enableBodyScroll(lockTarget);\n }\n };\n // when BottomSheet is mounted with isOpen={false}, then BottomSheetBody does not set scrollRef\n // so, we added scrollRef to dependencies array to ensure that we update lockTarget when scrollRef is updated\n // which will avoid passing null to enableBodyScroll\n }, [scrollRef]);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$isDismissible","isDismissible","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$useState0","hasBodyPadding","setHasBodyPadding","_React$useState1","_React$useState10","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState11","_React$useState12","positionY","_setPositionY","_isOpen","_React$useState13","_React$useState14","setIsDragging","preventScrollingRef","useRef","scrollRef","grabHandleRef","defaultInitialFocusRef","originalFocusElement","initialSnapPoint","totalHeight","useMemo","id","useId","_useBottomSheetStack","useBottomSheetStack","stack","addBottomSheetToStack","removeBottomSheetFromStack","getTopOfTheStack","getCurrentStackIndexById","currentStackIndex","isOnTopOfStack","bottomSheetZIndex","setPositionY","useCallback","value","limit","arguments","length","shouldLimitPositionY","hasAutoCompleteInHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","marginBottom","window","getComputedStyle","getBoundingClientRect","height","parseFloat","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","useLayoutEffect","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","_bottomSheetAndDropdo","onBottomSheetDismiss","call","setTimeout","setDropdownHasBottomSheet","bind","useDrag","_ref3","active","last","cancel","tap","_ref3$movement","movement","_movementX","movementY","_ref3$velocity","velocity","_velocityX","velocityY","_ref3$lastOffset","lastOffset","_","lastOffsetY","down","dragging","event","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","touchTarget","target","isScrollableContent","closest","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","firstSnapPoint","from","filterTaps","scrollElement","preventScrolling","e","isAllowedComponent","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","lockTarget","enableBodyScroll","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","makeAnalyticsAttribute","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EACnC,OAAO;IACLC,UAAU,EAAEH,KAAK,CAACI,MAAM,CAACC,KAAK,CAACF,UAAU,CAACG,MAAM;AAChDC,IAAAA,mBAAmB,EAAEC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvCC,IAAAA,oBAAoB,EAAEF,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxCE,WAA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