@razorpay/blade 12.60.1 → 12.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js +2 -2
- package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js.map +1 -1
- package/build/lib/native/components/index.js +1 -1
- 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/development/components/Drawer/Drawer.web.js +1 -1
- package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
- package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js +39 -4
- package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
- package/build/lib/web/development/components/Drawer/drawerComponentIds.js +1 -0
- package/build/lib/web/development/components/Drawer/drawerComponentIds.js.map +1 -1
- package/build/lib/web/development/components/Drawer/index.js +1 -1
- package/build/lib/web/development/components/index.js +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/build/lib/web/production/components/Drawer/Drawer.web.js +1 -1
- package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
- package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +39 -4
- package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
- package/build/lib/web/production/components/Drawer/drawerComponentIds.js +1 -0
- package/build/lib/web/production/components/Drawer/drawerComponentIds.js.map +1 -1
- package/build/lib/web/production/components/Drawer/index.js +1 -1
- package/build/lib/web/production/components/index.js +1 -1
- package/build/types/components/index.d.ts +32 -3
- package/build/types/components/index.native.d.ts +19 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import '../Typography/Display/Display.js';
|
|
|
6
6
|
import { throwBladeError } from '../../utils/logger/logger.js';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var DrawerHeader=function DrawerHeader(_props){throwBladeError({message:'DrawerHeader is not yet implemented for native',moduleName:'DrawerHeader'});return jsx(Text,{children:"Drawer Component is not available for Native mobile apps."});};var DrawerBody=function DrawerBody(_props){throwBladeError({message:'DrawerBody is not yet implemented for native',moduleName:'DrawerBody'});return jsx(Text,{children:"Drawer Component is not available for Native mobile apps."});};
|
|
9
|
+
var DrawerHeader=function DrawerHeader(_props){throwBladeError({message:'DrawerHeader is not yet implemented for native',moduleName:'DrawerHeader'});return jsx(Text,{children:"Drawer Component is not available for Native mobile apps."});};var DrawerBody=function DrawerBody(_props){throwBladeError({message:'DrawerBody is not yet implemented for native',moduleName:'DrawerBody'});return jsx(Text,{children:"Drawer Component is not available for Native mobile apps."});};var DrawerFooter=function DrawerFooter(_props){throwBladeError({message:'DrawerFooter is not yet implemented for native',moduleName:'DrawerFooter'});return jsx(Text,{children:"Drawer Component is not available for Native mobile apps."});};
|
|
10
10
|
|
|
11
|
-
export { DrawerBody, DrawerHeader };
|
|
11
|
+
export { DrawerBody, DrawerFooter, DrawerHeader };
|
|
12
12
|
//# sourceMappingURL=DrawerSubcomponents.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerSubcomponents.native.js","sources":["../../../../../src/components/Drawer/DrawerSubcomponents.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { DrawerHeaderProps } from './types';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst DrawerHeader = (_props: DrawerHeaderProps): React.ReactElement => {\n throwBladeError({\n message: 'DrawerHeader is not yet implemented for native',\n moduleName: 'DrawerHeader',\n });\n\n return <Text>Drawer Component is not available for Native mobile apps.</Text>;\n};\n\nconst DrawerBody = (_props: { children: React.ReactNode }): React.ReactElement => {\n throwBladeError({\n message: 'DrawerBody is not yet implemented for native',\n moduleName: 'DrawerBody',\n });\n\n return <Text>Drawer Component is not available for Native mobile apps.</Text>;\n};\nexport { DrawerHeader, DrawerBody };\n"],"names":["DrawerHeader","_props","throwBladeError","message","moduleName","_jsx","Text","children","DrawerBody"],"mappings":";;;;;;;;AAKM,IAAAA,YAAY,CAAG,SAAfA,YAAYA,CAAIC,MAAyB,CAAyB,CACtEC,eAAe,CAAC,CACdC,OAAO,CAAE,gDAAgD,CACzDC,UAAU,CAAE,cACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAAC,
|
|
1
|
+
{"version":3,"file":"DrawerSubcomponents.native.js","sources":["../../../../../src/components/Drawer/DrawerSubcomponents.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { DrawerHeaderProps, DrawerFooterProps } from './types';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst DrawerHeader = (_props: DrawerHeaderProps): React.ReactElement => {\n throwBladeError({\n message: 'DrawerHeader is not yet implemented for native',\n moduleName: 'DrawerHeader',\n });\n\n return <Text>Drawer Component is not available for Native mobile apps.</Text>;\n};\n\nconst DrawerBody = (_props: { children: React.ReactNode }): React.ReactElement => {\n throwBladeError({\n message: 'DrawerBody is not yet implemented for native',\n moduleName: 'DrawerBody',\n });\n\n return <Text>Drawer Component is not available for Native mobile apps.</Text>;\n};\n\nconst DrawerFooter = (_props: DrawerFooterProps): React.ReactElement => {\n throwBladeError({\n message: 'DrawerFooter is not yet implemented for native',\n moduleName: 'DrawerFooter',\n });\n\n return <Text>Drawer Component is not available for Native mobile apps.</Text>;\n};\n\nexport { DrawerHeader, DrawerBody, DrawerFooter };\n"],"names":["DrawerHeader","_props","throwBladeError","message","moduleName","_jsx","Text","children","DrawerBody","DrawerFooter"],"mappings":";;;;;;;;AAKM,IAAAA,YAAY,CAAG,SAAfA,YAAYA,CAAIC,MAAyB,CAAyB,CACtEC,eAAe,CAAC,CACdC,OAAO,CAAE,gDAAgD,CACzDC,UAAU,CAAE,cACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAA,CAAAC,QAAA,CAAC,2DAAyD,CAAM,CAAC,CAC/E,EAEM,IAAAC,UAAU,CAAG,SAAbA,UAAUA,CAAIP,MAAqC,CAAyB,CAChFC,eAAe,CAAC,CACdC,OAAO,CAAE,8CAA8C,CACvDC,UAAU,CAAE,YACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAA,CAAAC,QAAA,CAAC,2DAAyD,CAAM,CAAC,CAC/E,EAEM,IAAAE,YAAY,CAAG,SAAfA,YAAYA,CAAIR,MAAyB,CAAyB,CACtEC,eAAe,CAAC,CACdC,OAAO,CAAE,gDAAgD,CACzDC,UAAU,CAAE,cACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAACC,IAAI,CAAAC,CAAAA,QAAA,CAAC,2DAAyD,CAAM,CAAC,CAC/E;;;;"}
|
|
@@ -45,7 +45,7 @@ export { Counter } from './Counter/Counter.js';
|
|
|
45
45
|
export { CounterInput } from './CounterInput/CounterInput.native.js';
|
|
46
46
|
export { Divider } from './Divider/Divider.js';
|
|
47
47
|
export { Drawer } from './Drawer/Drawer.native.js';
|
|
48
|
-
export { DrawerBody, DrawerHeader } from './Drawer/DrawerSubcomponents.native.js';
|
|
48
|
+
export { DrawerBody, DrawerFooter, DrawerHeader } from './Drawer/DrawerSubcomponents.native.js';
|
|
49
49
|
export { DatePicker } from './DatePicker/DatePicker.native.js';
|
|
50
50
|
export { FilterChipDatePicker } from './DatePicker/FilterChipDatePicker/FilterChipDatePicker.native.js';
|
|
51
51
|
export { Dropdown } from './Dropdown/Dropdown.js';
|
|
@@ -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,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,WAAW,EAAEX,KAAK,CAACI,MAAM,CAACC,KAAK,CAACO,MAAM,CAACN,MAAM;AAC7C;AACAO,IAAAA,SAAS,EAAE,gDAAgD;AAC3DC,IAAAA,OAAO,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AAE;AACLjP,QAAAA,OAAO,EAAE2N,SAAS,GAAG,CAAC,GAAG,CAAC;AAC1B1N,QAAAA,aAAa,EAAE0N,SAAS,GAAG,KAAK,GAAG,MAAM;AACzC9F,QAAAA,MAAM,EAAEnD,SAAS;AACjB3D,QAAAA,MAAM,EAAE,CAAC;AACTC,QAAAA,GAAG,EAAE,MAAM;AACXiB,QAAAA,MAAM,EAAEmE,iBAAAA;AACV,OAAA;KACI8I,EAAAA,sBAAsB,CAAC9M,kBAAkB,CAAC,CAAA,EAAA,EAAA,EAAA;MAAAV,QAAA,eAE9C0M,IAAA,CAACe,OAAO,EAAA;AAACtH,QAAAA,MAAM,EAAC,MAAM;AAACuH,QAAAA,OAAO,EAAC,MAAM;AAACC,QAAAA,aAAa,EAAC,QAAQ;AAAA3N,QAAAA,QAAA,gBAC1DwM,GAAA,CAACoB,qBAAqB,EAAAd,aAAA,CAAAA,aAAA,CAAA;AACpBe,UAAAA,GAAG,EAAEpK,aAAc;AACnByI,UAAAA,gBAAgB,EAAEA,gBAAAA;AAAiB,SAAA,EAC/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,EAAEC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvCC,IAAAA,oBAAoB,EAAEF,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxCE,WAAW,EAAEX,KAAK,CAACI,MAAM,CAACC,KAAK,CAACO,MAAM,CAACN,MAAM;AAC7C;AACAO,IAAAA,SAAS,EAAE,gDAAgD;AAC3DC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,aAAa,EAAE,MAAM;AACrBC,IAAAA,kBAAkB,EAAEd,UAAU,GAC1Be,SAAS,GAAA,EAAA,CAAAC,MAAA,CACNC,cAAc,CAACnB,KAAK,CAACoB,MAAM,CAACC,QAAQ,CAACC,QAAQ,CAAC,CAAE;AACvDC,IAAAA,wBAAwB,EAAEhC,mBAAmB;AAC7CiC,IAAAA,UAAU,EAAE,4BAA4B;AACxCC,IAAAA,kBAAkB,EAAE,4B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tD,SAAS;AACjB3D,QAAAA,MAAM,EAAE,CAAC;AACTC,QAAAA,GAAG,EAAE,MAAM;AACXiB,QAAAA,MAAM,EAAEmE,iBAAAA;AACV,OAAA;KACIiJ,EAAAA,sBAAsB,CAACjN,kBAAkB,CAAC,CAAA,EAAA,EAAA,EAAA;MAAAV,QAAA,eAE9C6M,IAAA,CAACe,OAAO,EAAA;AAACtH,QAAAA,MAAM,EAAC,MAAM;AAACuH,QAAAA,OAAO,EAAC,MAAM;AAACC,QAAAA,aAAa,EAAC,QAAQ;AAAA9N,QAAAA,QAAA,gBAC1D2M,GAAA,CAACoB,qBAAqB,EAAAd,aAAA,CAAAA,aAAA,CAAA;AACpBe,UAAAA,GAAG,EAAEvK,aAAc;AACnB4I,UAAAA,gBAAgB,EAAEA,gBAAAA;AAAiB,SAAA,EAC/Ba,aAAa,CAAC;UAAEC,IAAI,EAAEc,YAAY,CAACF,qBAAAA;SAAuB,CAAC,GAC3DnG,IAAI,EAAE,CACX,CAAC,EACD5H,QAAQ,CAAA;OACF,CAAA;AAAC,KAAA,CACQ,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;;;;"}
|
|
@@ -99,7 +99,7 @@ var _Drawer = function _Drawer(_ref5, ref) {
|
|
|
99
99
|
useVerifyAllowedChildren({
|
|
100
100
|
children: children,
|
|
101
101
|
componentName: 'Drawer',
|
|
102
|
-
allowedComponents: [drawerComponentIds.DrawerHeader, drawerComponentIds.DrawerBody]
|
|
102
|
+
allowedComponents: [drawerComponentIds.DrawerHeader, drawerComponentIds.DrawerBody, drawerComponentIds.DrawerFooter]
|
|
103
103
|
});
|
|
104
104
|
var _useTheme = useTheme(),
|
|
105
105
|
theme = _useTheme.theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.web.js","sources":["../../../../../../src/components/Drawer/Drawer.web.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useFloating,\n} from '@floating-ui/react';\nimport type { CSSProperties } from 'react';\nimport React from 'react';\nimport styled from 'styled-components';\nimport usePresence from 'use-presence';\nimport { drawerComponentIds } from './drawerComponentIds';\nimport { DrawerContext } from './DrawerContext';\nimport type { DrawerProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castWebType, getMediaQuery, makeMotionTime, useTheme } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { useDrawerStack } from '~components/Drawer/StackProvider';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useId } from '~utils/useId';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { mergeRefs } from '~utils/useMergeRefs';\n\nconst SHOW_DRAWER = 'show-drawer';\n\nconst AnimatedDrawerContainer = styled(BaseBox)<{\n isFirstDrawerInStack: boolean;\n isVisible: boolean;\n}>(({ theme, isFirstDrawerInStack, isVisible }) => {\n const entranceTransition: CSSProperties['transition'] = `all ${castWebType(\n castWebType(makeMotionTime(theme.motion.duration.xmoderate)),\n )} ${castWebType(theme.motion.easing.entrance)}`;\n\n const exitTransition: CSSProperties['transition'] = `all\n ${castWebType(makeMotionTime(theme.motion.duration.moderate))}\n ${castWebType(theme.motion.easing.exit)}`;\n\n return {\n opacity: isVisible ? 1 : 0,\n transform: isVisible\n ? isFirstDrawerInStack\n ? 'translateX(calc(-100% - 16px))'\n : `translateX(-100%)`\n : 'translateX(0%)',\n transition: isVisible ? entranceTransition : exitTransition,\n animationFillMode: 'initial',\n position: 'fixed',\n top: '0px',\n bottom: '0px',\n left: '100%',\n height: 'auto',\n [`@media ${getMediaQuery({ min: theme.breakpoints.m })}`]: {\n top: isFirstDrawerInStack ? '24px' : '8px',\n bottom: isFirstDrawerInStack ? '24px' : '8px',\n transform: isVisible\n ? isFirstDrawerInStack\n ? 'translateX(calc(-100% - 24px))'\n : `translateX(calc(-100% - ${theme.spacing[3]}px))`\n : 'translateX(0%)',\n },\n };\n});\n\nconst DrawerOverlay = styled(FloatingOverlay)(({ theme }) => {\n return {\n opacity: 0,\n transition: `opacity\n ${makeMotionTime(theme.motion.duration.xmoderate)}\n ${castWebType(theme.motion.easing.exit)}`,\n backgroundColor: theme.colors.overlay.background.subtle,\n\n [`&.${SHOW_DRAWER}`]: {\n opacity: 1,\n transition: `opacity ${makeMotionTime(theme.motion.duration.gentle)} ${castWebType(\n theme.motion.easing.entrance,\n )}`,\n },\n };\n});\n\nconst _Drawer: React.ForwardRefRenderFunction<BladeElementRef, DrawerProps> = (\n {\n isOpen,\n onDismiss,\n onUnmount,\n zIndex = componentZIndices.drawer,\n children,\n accessibilityLabel,\n showOverlay = true,\n initialFocusRef,\n isLazy = true,\n testID,\n ...rest\n },\n ref,\n) => {\n const closeButtonRef = React.useRef<HTMLDivElement>(null);\n const [zIndexState, setZIndexState] = React.useState<number>(zIndex);\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Drawer',\n allowedComponents: [drawerComponentIds.DrawerHeader, drawerComponentIds.DrawerBody],\n });\n\n const { theme } = useTheme();\n const drawerId = useId('drawer');\n const { drawerStack, addToDrawerStack, removeFromDrawerStack } = useDrawerStack();\n\n const { isMounted, isVisible, isExiting } = usePresence(isOpen, {\n enterTransitionDuration: theme.motion.duration.gentle,\n exitTransitionDuration: theme.motion.duration.xmoderate,\n initialEnter: true,\n });\n\n const { stackingLevel, isFirstDrawerInStack } = React.useMemo(() => {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const level = Object.keys(drawerStack).indexOf(drawerId) + 1;\n return {\n stackingLevel: level,\n isFirstDrawerInStack: level === 1 && Object.keys(drawerStack).length > 1,\n };\n }, [drawerId, drawerStack]);\n\n const { refs, context } = useFloating({\n open: isMounted,\n onOpenChange: (open) => {\n if (!open) {\n onUnmount?.();\n }\n },\n });\n\n React.useEffect(() => {\n if (isOpen) {\n addToDrawerStack({ elementId: drawerId, onDismiss });\n } else {\n removeFromDrawerStack({ elementId: drawerId });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n // When z-index is not defined by user, we use default drawer z index and add stackingLevel to ensure\n // new drawer that opens, always opens on top of previous one.\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n setZIndexState(zIndex + stackingLevel);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMounted]);\n\n const contextValue = React.useMemo(\n () => ({\n close: onDismiss,\n closeButtonRef,\n stackingLevel,\n isExiting,\n }),\n [isExiting, onDismiss, stackingLevel],\n );\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <FloatingPortal>\n {isMounted || !isLazy ? (\n <FloatingFocusManager\n context={context}\n initialFocus={initialFocusRef ?? closeButtonRef}\n returnFocus={true}\n >\n <BaseBox\n display={isLazy ? undefined : isMounted ? 'block' : 'none'}\n position=\"fixed\"\n {...metaAttribute({\n name: MetaConstants.Drawer,\n testID,\n })}\n {...makeAnalyticsAttribute(rest)}\n zIndex={zIndexState}\n >\n {showOverlay ? (\n <DrawerOverlay\n onClick={() => {\n onDismiss();\n }}\n className={isVisible ? SHOW_DRAWER : ''}\n lockScroll={true}\n {...metaAttribute({\n testID: 'drawer-overlay',\n })}\n />\n ) : null}\n <AnimatedDrawerContainer\n isVisible={isVisible}\n isFirstDrawerInStack={isFirstDrawerInStack}\n width={{ base: '90%', s: '375px', m: '420px' }}\n {...makeAccessible({\n role: 'dialog',\n modal: true,\n label: accessibilityLabel,\n })}\n position=\"fixed\"\n backgroundColor=\"popup.background.subtle\"\n borderRadius={{ base: 'none', m: 'large' }}\n overflow=\"hidden\"\n elevation=\"highRaised\"\n display=\"flex\"\n flexDirection=\"column\"\n ref={mergeRefs(ref, refs.setFloating)}\n onKeyDown={(event) => {\n if (event?.key === 'Escape' || event?.code === 'Escape') {\n onDismiss();\n }\n }}\n >\n {children}\n </AnimatedDrawerContainer>\n </BaseBox>\n </FloatingFocusManager>\n ) : null}\n </FloatingPortal>\n </DrawerContext.Provider>\n );\n};\n\n/**\n * ### Drawer Component\n * \n * A drawer is a panel that slides in mostly from right side of the screen over the existing content in the viewport. \n * It helps in providing additional details or context and can also be used to promote product features or new products.\n * \n * ---\n * \n * #### Usage\n * \n * ```jsx\n const MyDrawer = () => {\n const [showDrawer, setShowDrawer] = React.useState(false);\n return (\n <Box>\n <Button onClick={() => setShowDrawer(true)}>Open Drawer</Button>\n <Drawer\n isOpen={showDrawer}\n onDismiss={() => setShowDrawer(false)}\n >\n <DrawerHeader title=\"Announcements\" />\n <DrawerBody>\n <FTXAnnouncement />\n <CatPictures />\n </DrawerBody>\n <Drawer>\n </Box>\n )\n }\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-drawer Drawer Documentation}\n * \n * \n */\nconst Drawer = assignWithoutSideEffects(React.forwardRef(_Drawer), {\n displayName: 'Drawer',\n componentId: drawerComponentIds.Drawer,\n});\n\nexport { Drawer };\n"],"names":["SHOW_DRAWER","AnimatedDrawerContainer","styled","BaseBox","withConfig","displayName","componentId","_ref","theme","isFirstDrawerInStack","isVisible","entranceTransition","concat","castWebType","makeMotionTime","motion","duration","xmoderate","easing","entrance","exitTransition","moderate","exit","_defineProperty","opacity","transform","transition","animationFillMode","position","top","bottom","left","height","getMediaQuery","min","breakpoints","m","spacing","DrawerOverlay","FloatingOverlay","_ref3","backgroundColor","colors","overlay","background","subtle","gentle","_Drawer","_ref5","ref","isOpen","onDismiss","onUnmount","_ref5$zIndex","zIndex","componentZIndices","drawer","children","accessibilityLabel","_ref5$showOverlay","showOverlay","initialFocusRef","_ref5$isLazy","isLazy","testID","rest","_objectWithoutProperties","_excluded","closeButtonRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","zIndexState","setZIndexState","useVerifyAllowedChildren","componentName","allowedComponents","drawerComponentIds","DrawerHeader","DrawerBody","_useTheme","useTheme","drawerId","useId","_useDrawerStack","useDrawerStack","drawerStack","addToDrawerStack","removeFromDrawerStack","_usePresence","usePresence","enterTransitionDuration","exitTransitionDuration","initialEnter","isMounted","isExiting","_React$useMemo","useMemo","level","Object","keys","indexOf","stackingLevel","length","_useFloating","useFloating","open","onOpenChange","refs","context","useEffect","elementId","contextValue","close","_jsx","DrawerContext","Provider","value","FloatingPortal","FloatingFocusManager","initialFocus","returnFocus","_jsxs","_objectSpread","display","undefined","metaAttribute","name","MetaConstants","Drawer","makeAnalyticsAttribute","onClick","className","lockScroll","width","base","s","makeAccessible","role","modal","label","borderRadius","overflow","elevation","flexDirection","mergeRefs","setFloating","onKeyDown","event","key","code","assignWithoutSideEffects","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAMA,WAAW,GAAG,aAAa,CAAA;AAEjC,IAAMC,uBAAuB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAG5C,CAAA,CAAA,UAAAC,IAAA,EAAgD;AAAA,EAAA,IAA7CC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS,CAAA;AAC1C,EAAA,IAAMC,kBAA+C,GAAA,MAAA,CAAAC,MAAA,CAAUC,WAAW,CACxEA,WAAW,CAACC,cAAc,CAACN,KAAK,CAACO,MAAM,CAACC,QAAQ,CAACC,SAAS,CAAC,CAC7D,CAAC,EAAAL,GAAAA,CAAAA,CAAAA,MAAA,CAAIC,WAAW,CAACL,KAAK,CAACO,MAA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;AACA;AACA;AACM2E,IAAAA,MAAM,gBAAGsB,wBAAwB,cAACrF,cAAK,CAACsF,UAAU,CAAC5G,OAAO,CAAC,EAAE;AACjE1C,EAAAA,WAAW,EAAE,QAAQ;EACrBC,WAAW,EAAE0E,kBAAkB,CAACoD,MAAAA;AAClC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Drawer.web.js","sources":["../../../../../../src/components/Drawer/Drawer.web.tsx"],"sourcesContent":["import {\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useFloating,\n} from '@floating-ui/react';\nimport type { CSSProperties } from 'react';\nimport React from 'react';\nimport styled from 'styled-components';\nimport usePresence from 'use-presence';\nimport { drawerComponentIds } from './drawerComponentIds';\nimport { DrawerContext } from './DrawerContext';\nimport type { DrawerProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castWebType, getMediaQuery, makeMotionTime, useTheme } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { useDrawerStack } from '~components/Drawer/StackProvider';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useId } from '~utils/useId';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { mergeRefs } from '~utils/useMergeRefs';\n\nconst SHOW_DRAWER = 'show-drawer';\n\nconst AnimatedDrawerContainer = styled(BaseBox)<{\n isFirstDrawerInStack: boolean;\n isVisible: boolean;\n}>(({ theme, isFirstDrawerInStack, isVisible }) => {\n const entranceTransition: CSSProperties['transition'] = `all ${castWebType(\n castWebType(makeMotionTime(theme.motion.duration.xmoderate)),\n )} ${castWebType(theme.motion.easing.entrance)}`;\n\n const exitTransition: CSSProperties['transition'] = `all\n ${castWebType(makeMotionTime(theme.motion.duration.moderate))}\n ${castWebType(theme.motion.easing.exit)}`;\n\n return {\n opacity: isVisible ? 1 : 0,\n transform: isVisible\n ? isFirstDrawerInStack\n ? 'translateX(calc(-100% - 16px))'\n : `translateX(-100%)`\n : 'translateX(0%)',\n transition: isVisible ? entranceTransition : exitTransition,\n animationFillMode: 'initial',\n position: 'fixed',\n top: '0px',\n bottom: '0px',\n left: '100%',\n height: 'auto',\n [`@media ${getMediaQuery({ min: theme.breakpoints.m })}`]: {\n top: isFirstDrawerInStack ? '24px' : '8px',\n bottom: isFirstDrawerInStack ? '24px' : '8px',\n transform: isVisible\n ? isFirstDrawerInStack\n ? 'translateX(calc(-100% - 24px))'\n : `translateX(calc(-100% - ${theme.spacing[3]}px))`\n : 'translateX(0%)',\n },\n };\n});\n\nconst DrawerOverlay = styled(FloatingOverlay)(({ theme }) => {\n return {\n opacity: 0,\n transition: `opacity\n ${makeMotionTime(theme.motion.duration.xmoderate)}\n ${castWebType(theme.motion.easing.exit)}`,\n backgroundColor: theme.colors.overlay.background.subtle,\n\n [`&.${SHOW_DRAWER}`]: {\n opacity: 1,\n transition: `opacity ${makeMotionTime(theme.motion.duration.gentle)} ${castWebType(\n theme.motion.easing.entrance,\n )}`,\n },\n };\n});\n\nconst _Drawer: React.ForwardRefRenderFunction<BladeElementRef, DrawerProps> = (\n {\n isOpen,\n onDismiss,\n onUnmount,\n zIndex = componentZIndices.drawer,\n children,\n accessibilityLabel,\n showOverlay = true,\n initialFocusRef,\n isLazy = true,\n testID,\n ...rest\n },\n ref,\n) => {\n const closeButtonRef = React.useRef<HTMLDivElement>(null);\n const [zIndexState, setZIndexState] = React.useState<number>(zIndex);\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Drawer',\n allowedComponents: [\n drawerComponentIds.DrawerHeader,\n drawerComponentIds.DrawerBody,\n drawerComponentIds.DrawerFooter,\n ],\n });\n\n const { theme } = useTheme();\n const drawerId = useId('drawer');\n const { drawerStack, addToDrawerStack, removeFromDrawerStack } = useDrawerStack();\n\n const { isMounted, isVisible, isExiting } = usePresence(isOpen, {\n enterTransitionDuration: theme.motion.duration.gentle,\n exitTransitionDuration: theme.motion.duration.xmoderate,\n initialEnter: true,\n });\n\n const { stackingLevel, isFirstDrawerInStack } = React.useMemo(() => {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const level = Object.keys(drawerStack).indexOf(drawerId) + 1;\n return {\n stackingLevel: level,\n isFirstDrawerInStack: level === 1 && Object.keys(drawerStack).length > 1,\n };\n }, [drawerId, drawerStack]);\n\n const { refs, context } = useFloating({\n open: isMounted,\n onOpenChange: (open) => {\n if (!open) {\n onUnmount?.();\n }\n },\n });\n\n React.useEffect(() => {\n if (isOpen) {\n addToDrawerStack({ elementId: drawerId, onDismiss });\n } else {\n removeFromDrawerStack({ elementId: drawerId });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen]);\n\n // When z-index is not defined by user, we use default drawer z index and add stackingLevel to ensure\n // new drawer that opens, always opens on top of previous one.\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n setZIndexState(zIndex + stackingLevel);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMounted]);\n\n const contextValue = React.useMemo(\n () => ({\n close: onDismiss,\n closeButtonRef,\n stackingLevel,\n isExiting,\n }),\n [isExiting, onDismiss, stackingLevel],\n );\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <FloatingPortal>\n {isMounted || !isLazy ? (\n <FloatingFocusManager\n context={context}\n initialFocus={initialFocusRef ?? closeButtonRef}\n returnFocus={true}\n >\n <BaseBox\n display={isLazy ? undefined : isMounted ? 'block' : 'none'}\n position=\"fixed\"\n {...metaAttribute({\n name: MetaConstants.Drawer,\n testID,\n })}\n {...makeAnalyticsAttribute(rest)}\n zIndex={zIndexState}\n >\n {showOverlay ? (\n <DrawerOverlay\n onClick={() => {\n onDismiss();\n }}\n className={isVisible ? SHOW_DRAWER : ''}\n lockScroll={true}\n {...metaAttribute({\n testID: 'drawer-overlay',\n })}\n />\n ) : null}\n <AnimatedDrawerContainer\n isVisible={isVisible}\n isFirstDrawerInStack={isFirstDrawerInStack}\n width={{ base: '90%', s: '375px', m: '420px' }}\n {...makeAccessible({\n role: 'dialog',\n modal: true,\n label: accessibilityLabel,\n })}\n position=\"fixed\"\n backgroundColor=\"popup.background.subtle\"\n borderRadius={{ base: 'none', m: 'large' }}\n overflow=\"hidden\"\n elevation=\"highRaised\"\n display=\"flex\"\n flexDirection=\"column\"\n ref={mergeRefs(ref, refs.setFloating)}\n onKeyDown={(event) => {\n if (event?.key === 'Escape' || event?.code === 'Escape') {\n onDismiss();\n }\n }}\n >\n {children}\n </AnimatedDrawerContainer>\n </BaseBox>\n </FloatingFocusManager>\n ) : null}\n </FloatingPortal>\n </DrawerContext.Provider>\n );\n};\n\n/**\n * ### Drawer Component\n * \n * A drawer is a panel that slides in mostly from right side of the screen over the existing content in the viewport. \n * It helps in providing additional details or context and can also be used to promote product features or new products.\n * \n * ---\n * \n * #### Usage\n * \n * ```jsx\n const MyDrawer = () => {\n const [showDrawer, setShowDrawer] = React.useState(false);\n return (\n <Box>\n <Button onClick={() => setShowDrawer(true)}>Open Drawer</Button>\n <Drawer\n isOpen={showDrawer}\n onDismiss={() => setShowDrawer(false)}\n >\n <DrawerHeader title=\"Announcements\" />\n <DrawerBody>\n <FTXAnnouncement />\n <CatPictures />\n </DrawerBody>\n <Drawer>\n </Box>\n )\n }\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-drawer Drawer Documentation}\n * \n * \n */\nconst Drawer = assignWithoutSideEffects(React.forwardRef(_Drawer), {\n displayName: 'Drawer',\n componentId: drawerComponentIds.Drawer,\n});\n\nexport { Drawer };\n"],"names":["SHOW_DRAWER","AnimatedDrawerContainer","styled","BaseBox","withConfig","displayName","componentId","_ref","theme","isFirstDrawerInStack","isVisible","entranceTransition","concat","castWebType","makeMotionTime","motion","duration","xmoderate","easing","entrance","exitTransition","moderate","exit","_defineProperty","opacity","transform","transition","animationFillMode","position","top","bottom","left","height","getMediaQuery","min","breakpoints","m","spacing","DrawerOverlay","FloatingOverlay","_ref3","backgroundColor","colors","overlay","background","subtle","gentle","_Drawer","_ref5","ref","isOpen","onDismiss","onUnmount","_ref5$zIndex","zIndex","componentZIndices","drawer","children","accessibilityLabel","_ref5$showOverlay","showOverlay","initialFocusRef","_ref5$isLazy","isLazy","testID","rest","_objectWithoutProperties","_excluded","closeButtonRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","zIndexState","setZIndexState","useVerifyAllowedChildren","componentName","allowedComponents","drawerComponentIds","DrawerHeader","DrawerBody","DrawerFooter","_useTheme","useTheme","drawerId","useId","_useDrawerStack","useDrawerStack","drawerStack","addToDrawerStack","removeFromDrawerStack","_usePresence","usePresence","enterTransitionDuration","exitTransitionDuration","initialEnter","isMounted","isExiting","_React$useMemo","useMemo","level","Object","keys","indexOf","stackingLevel","length","_useFloating","useFloating","open","onOpenChange","refs","context","useEffect","elementId","contextValue","close","_jsx","DrawerContext","Provider","value","FloatingPortal","FloatingFocusManager","initialFocus","returnFocus","_jsxs","_objectSpread","display","undefined","metaAttribute","name","MetaConstants","Drawer","makeAnalyticsAttribute","onClick","className","lockScroll","width","base","s","makeAccessible","role","modal","label","borderRadius","overflow","elevation","flexDirection","mergeRefs","setFloating","onKeyDown","event","key","code","assignWithoutSideEffects","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAMA,WAAW,GAAG,aAAa,CAAA;AAEjC,IAAMC,uBAAuB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAG5C,CAAA,CAAA,UAAAC,IAAA,EAAgD;AAAA,EAAA,IAA7CC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,oBAAoB,GAAAF,IAAA,CAApBE,oBAAoB;IAAEC,SA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A;AAAQ,WAAA,CACc,CAAC,CAAA;SACnB,CAAA,CAAA;AAAC,OACU,CAAC,GACrB,IAAA;KACU,CAAA;AAAC,GACK,CAAC,CAAA;AAE7B,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACM4E,IAAAA,MAAM,gBAAGsB,wBAAwB,cAACtF,cAAK,CAACuF,UAAU,CAAC7G,OAAO,CAAC,EAAE;AACjE1C,EAAAA,WAAW,EAAE,QAAQ;EACrBC,WAAW,EAAE0E,kBAAkB,CAACqD,MAAAA;AAClC,CAAC;;;;"}
|
|
@@ -5,6 +5,7 @@ import { drawerComponentIds } from './drawerComponentIds.js';
|
|
|
5
5
|
import { DrawerContext } from './DrawerContext.js';
|
|
6
6
|
import { useDrawerStack } from './StackProvider.js';
|
|
7
7
|
import { BaseHeader } from '../BaseHeaderFooter/BaseHeader.js';
|
|
8
|
+
import { BaseFooter } from '../BaseHeaderFooter/BaseFooter.js';
|
|
8
9
|
import '../Box/index.js';
|
|
9
10
|
import '../../utils/assignWithoutSideEffects/index.js';
|
|
10
11
|
import '../../utils/makeAnalyticsAttribute/index.js';
|
|
@@ -15,7 +16,8 @@ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeA
|
|
|
15
16
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
16
17
|
import { Box } from '../Box/Box.js';
|
|
17
18
|
|
|
18
|
-
var _excluded = ["title", "subtitle", "leading", "trailing", "titleSuffix", "children", "color"]
|
|
19
|
+
var _excluded = ["title", "subtitle", "leading", "trailing", "titleSuffix", "children", "color", "showDivider"],
|
|
20
|
+
_excluded2 = ["children", "showDivider"];
|
|
19
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
23
|
var _DrawerHeader = function _DrawerHeader(_ref) {
|
|
@@ -27,6 +29,8 @@ var _DrawerHeader = function _DrawerHeader(_ref) {
|
|
|
27
29
|
children = _ref.children,
|
|
28
30
|
_ref$color = _ref.color,
|
|
29
31
|
color = _ref$color === void 0 ? 'information' : _ref$color,
|
|
32
|
+
_ref$showDivider = _ref.showDivider,
|
|
33
|
+
showDivider = _ref$showDivider === void 0 ? true : _ref$showDivider,
|
|
30
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
35
|
var _React$useContext = React__default.useContext(DrawerContext),
|
|
32
36
|
close = _React$useContext.close,
|
|
@@ -45,7 +49,7 @@ var _DrawerHeader = function _DrawerHeader(_ref) {
|
|
|
45
49
|
};
|
|
46
50
|
var isStackedDrawer = stackingLevel && stackingLevel > 1;
|
|
47
51
|
var isAtleastOneDrawerOpen = Object.keys(drawerStack).length > 0;
|
|
48
|
-
var backgroundGradient = "
|
|
52
|
+
var backgroundGradient = "radial-gradient(150% 100% at 50% 100%, ".concat(theme.colors.transparent, " 0%, ").concat(theme.colors.feedback.background[color].subtle, " 100%)");
|
|
49
53
|
// This condition is to avoid back button disappear while stacked drawer is in the exiting transition
|
|
50
54
|
var isDrawerExiting = isAtleastOneDrawerOpen && isExiting && stackingLevel !== 1;
|
|
51
55
|
return /*#__PURE__*/jsx(BaseHeader
|
|
@@ -66,7 +70,8 @@ var _DrawerHeader = function _DrawerHeader(_ref) {
|
|
|
66
70
|
subtitle: subtitle,
|
|
67
71
|
leading: leading,
|
|
68
72
|
trailing: trailing,
|
|
69
|
-
backgroundImage: backgroundGradient
|
|
73
|
+
backgroundImage: backgroundGradient,
|
|
74
|
+
showDivider: showDivider
|
|
70
75
|
}, makeAnalyticsAttribute(rest)), {}, {
|
|
71
76
|
children: children
|
|
72
77
|
}));
|
|
@@ -102,6 +107,36 @@ var _DrawerBody = function _DrawerBody(_ref2) {
|
|
|
102
107
|
var DrawerBody = /*#__PURE__*/assignWithoutSideEffects(_DrawerBody, {
|
|
103
108
|
componentId: drawerComponentIds.DrawerBody
|
|
104
109
|
});
|
|
110
|
+
var _DrawerFooter = function _DrawerFooter(_ref3) {
|
|
111
|
+
var children = _ref3.children,
|
|
112
|
+
_ref3$showDivider = _ref3.showDivider,
|
|
113
|
+
showDivider = _ref3$showDivider === void 0 ? true : _ref3$showDivider,
|
|
114
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
115
|
+
return /*#__PURE__*/jsx(Box, _objectSpread(_objectSpread({
|
|
116
|
+
position: "sticky"
|
|
117
|
+
}, makeAnalyticsAttribute(rest)), {}, {
|
|
118
|
+
children: /*#__PURE__*/jsx(BaseFooter, {
|
|
119
|
+
showDivider: showDivider,
|
|
120
|
+
children: children
|
|
121
|
+
})
|
|
122
|
+
}));
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* #### Usage
|
|
127
|
+
*
|
|
128
|
+
* ```jsx
|
|
129
|
+
* <DrawerFooter>
|
|
130
|
+
* <Button variant="primary" isFullWidth>
|
|
131
|
+
* Continue
|
|
132
|
+
* </Button>
|
|
133
|
+
* </DrawerFooter>
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
*/
|
|
137
|
+
var DrawerFooter = /*#__PURE__*/assignWithoutSideEffects(_DrawerFooter, {
|
|
138
|
+
componentId: drawerComponentIds.DrawerFooter
|
|
139
|
+
});
|
|
105
140
|
|
|
106
|
-
export { DrawerBody, DrawerHeader, drawerPadding };
|
|
141
|
+
export { DrawerBody, DrawerFooter, DrawerHeader, drawerPadding };
|
|
107
142
|
//# sourceMappingURL=DrawerSubcomponents.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerSubcomponents.web.js","sources":["../../../../../../src/components/Drawer/DrawerSubcomponents.web.tsx"],"sourcesContent":["import React from 'react';\nimport { drawerComponentIds } from './drawerComponentIds';\nimport { DrawerContext } from './DrawerContext';\nimport type { DrawerHeaderProps } from './types';\nimport { useDrawerStack } from './StackProvider';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~utils';\n\nconst _DrawerHeader = ({\n title,\n subtitle,\n leading,\n trailing,\n titleSuffix,\n children,\n color = 'information',\n ...rest\n}: DrawerHeaderProps): React.ReactElement => {\n const { close, closeButtonRef, stackingLevel, isExiting } = React.useContext(DrawerContext);\n const { drawerStack } = useDrawerStack();\n const { theme } = useTheme();\n\n const closeAllDrawers = (): void => {\n for (const onDismiss of Object.values(drawerStack)) {\n onDismiss();\n }\n };\n\n const isStackedDrawer = stackingLevel && stackingLevel > 1;\n\n const isAtleastOneDrawerOpen = Object.keys(drawerStack).length > 0;\n\n const backgroundGradient = `
|
|
1
|
+
{"version":3,"file":"DrawerSubcomponents.web.js","sources":["../../../../../../src/components/Drawer/DrawerSubcomponents.web.tsx"],"sourcesContent":["import React from 'react';\nimport { drawerComponentIds } from './drawerComponentIds';\nimport { DrawerContext } from './DrawerContext';\nimport type { DrawerHeaderProps, DrawerFooterProps } from './types';\nimport { useDrawerStack } from './StackProvider';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseFooter } from '~components/BaseHeaderFooter/BaseFooter';\nimport { Box } from '~components/Box';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useTheme } from '~utils';\n\nconst _DrawerHeader = ({\n title,\n subtitle,\n leading,\n trailing,\n titleSuffix,\n children,\n color = 'information',\n showDivider = true,\n ...rest\n}: DrawerHeaderProps): React.ReactElement => {\n const { close, closeButtonRef, stackingLevel, isExiting } = React.useContext(DrawerContext);\n const { drawerStack } = useDrawerStack();\n const { theme } = useTheme();\n\n const closeAllDrawers = (): void => {\n for (const onDismiss of Object.values(drawerStack)) {\n onDismiss();\n }\n };\n\n const isStackedDrawer = stackingLevel && stackingLevel > 1;\n\n const isAtleastOneDrawerOpen = Object.keys(drawerStack).length > 0;\n\n const backgroundGradient = `radial-gradient(150% 100% at 50% 100%, ${theme.colors.transparent} 0%, ${theme.colors.feedback.background[color].subtle} 100%)` as const;\n // This condition is to avoid back button disappear while stacked drawer is in the exiting transition\n const isDrawerExiting = isAtleastOneDrawerOpen && isExiting && stackingLevel !== 1;\n\n return (\n <BaseHeader\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n showBackButton={isStackedDrawer || isDrawerExiting}\n showCloseButton={true}\n closeButtonRef={closeButtonRef}\n onCloseButtonClick={() => closeAllDrawers()}\n onBackButtonClick={() => close()}\n title={title}\n size=\"xlarge\"\n titleSuffix={titleSuffix}\n subtitle={subtitle}\n leading={leading}\n trailing={trailing}\n backgroundImage={backgroundGradient}\n showDivider={showDivider}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseHeader>\n );\n};\n\n/**\n * #### Usage\n *\n * ```jsx\n * <DrawerHeader\n * title=\"Announcements\"\n * subtitle=\"Checkout what's new in Razorpay\"\n * titleSuffix={<DrawerHeaderBadge>New</DrawerHeaderBadge>}\n * leading={<DrawerHeaderIcon icon={AnnouncementIcon} />}\n * trailing={<Button icon={DownloadIcon} />}\n * />\n * ```\n *\n */\nconst DrawerHeader = assignWithoutSideEffects(_DrawerHeader, {\n componentId: drawerComponentIds.DrawerHeader,\n});\n\nconst drawerPadding = 'spacing.6';\n\nconst _DrawerBody = ({ children }: { children: React.ReactNode }): React.ReactElement => {\n return (\n <Box padding={drawerPadding} overflow=\"auto\" flex=\"1\">\n {children}\n </Box>\n );\n};\nconst DrawerBody = assignWithoutSideEffects(_DrawerBody, {\n componentId: drawerComponentIds.DrawerBody,\n});\n\nconst _DrawerFooter = ({\n children,\n showDivider = true,\n ...rest\n}: DrawerFooterProps): React.ReactElement => {\n return (\n <Box position=\"sticky\" {...makeAnalyticsAttribute(rest)}>\n <BaseFooter showDivider={showDivider}>{children}</BaseFooter>\n </Box>\n );\n};\n\n/**\n * #### Usage\n *\n * ```jsx\n * <DrawerFooter>\n * <Button variant=\"primary\" isFullWidth>\n * Continue\n * </Button>\n * </DrawerFooter>\n * ```\n *\n */\nconst DrawerFooter = assignWithoutSideEffects(_DrawerFooter, {\n componentId: drawerComponentIds.DrawerFooter,\n});\n\nexport { DrawerHeader, DrawerBody, DrawerFooter, drawerPadding };\n"],"names":["_DrawerHeader","_ref","title","subtitle","leading","trailing","titleSuffix","children","_ref$color","color","_ref$showDivider","showDivider","rest","_objectWithoutProperties","_excluded","_React$useContext","React","useContext","DrawerContext","close","closeButtonRef","stackingLevel","isExiting","_useDrawerStack","useDrawerStack","drawerStack","_useTheme","useTheme","theme","closeAllDrawers","_i","_Object$values","Object","values","length","onDismiss","isStackedDrawer","isAtleastOneDrawerOpen","keys","backgroundGradient","concat","colors","transparent","feedback","background","subtle","isDrawerExiting","_jsx","BaseHeader","_objectSpread","showBackButton","showCloseButton","onCloseButtonClick","onBackButtonClick","size","backgroundImage","makeAnalyticsAttribute","DrawerHeader","assignWithoutSideEffects","componentId","drawerComponentIds","drawerPadding","_DrawerBody","_ref2","Box","padding","overflow","flex","DrawerBody","_DrawerFooter","_ref3","_ref3$showDivider","_excluded2","position","Base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;AAEP,EAAA,oBACEzB,GAAA,CAACiB,GAAG,EAAAf,aAAA,CAAAA,aAAA,CAAA;AAACwB,IAAAA,QAAQ,EAAC,QAAA;GAAajB,EAAAA,sBAAsB,CAAC5C,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;IAAAL,QAAA,eACrDwC,GAAA,CAAC2B,UAAU,EAAA;AAAC/D,MAAAA,WAAW,EAAEA,WAAY;AAAAJ,MAAAA,QAAA,EAAEA,QAAAA;KAAqB,CAAA;AAAC,GAAA,CAC1D,CAAC,CAAA;AAEV,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMoE,YAAY,gBAAGjB,wBAAwB,CAACW,aAAa,EAAE;EAC3DV,WAAW,EAAEC,kBAAkB,CAACe,YAAAA;AAClC,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawerComponentIds.js","sources":["../../../../../../src/components/Drawer/drawerComponentIds.ts"],"sourcesContent":["export const drawerComponentIds = {\n DrawerHeader: 'DrawerHeader',\n DrawerBody: 'DrawerBody',\n Drawer: 'Drawer',\n};\n"],"names":["drawerComponentIds","DrawerHeader","DrawerBody","Drawer"],"mappings":"AAAO,IAAMA,kBAAkB,GAAG;AAChCC,EAAAA,YAAY,EAAE,cAAc;AAC5BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,MAAM,EAAE,QAAA;AACV;;;;"}
|
|
1
|
+
{"version":3,"file":"drawerComponentIds.js","sources":["../../../../../../src/components/Drawer/drawerComponentIds.ts"],"sourcesContent":["export const drawerComponentIds = {\n DrawerHeader: 'DrawerHeader',\n DrawerBody: 'DrawerBody',\n DrawerFooter: 'DrawerFooter',\n Drawer: 'Drawer',\n};\n"],"names":["drawerComponentIds","DrawerHeader","DrawerBody","DrawerFooter","Drawer"],"mappings":"AAAO,IAAMA,kBAAkB,GAAG;AAChCC,EAAAA,YAAY,EAAE,cAAc;AAC5BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,YAAY,EAAE,cAAc;AAC5BC,EAAAA,MAAM,EAAE,QAAA;AACV;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Drawer } from './Drawer.web.js';
|
|
2
|
-
export { DrawerBody, DrawerHeader, drawerPadding } from './DrawerSubcomponents.web.js';
|
|
2
|
+
export { DrawerBody, DrawerFooter, DrawerHeader, drawerPadding } from './DrawerSubcomponents.web.js';
|
|
3
3
|
import './types.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -124,7 +124,7 @@ export { Counter } from './Counter/Counter.js';
|
|
|
124
124
|
export { CounterInput } from './CounterInput/CounterInput.web.js';
|
|
125
125
|
export { Divider } from './Divider/Divider.js';
|
|
126
126
|
export { Drawer } from './Drawer/Drawer.web.js';
|
|
127
|
-
export { DrawerBody, DrawerHeader, drawerPadding } from './Drawer/DrawerSubcomponents.web.js';
|
|
127
|
+
export { DrawerBody, DrawerFooter, DrawerHeader, drawerPadding } from './Drawer/DrawerSubcomponents.web.js';
|
|
128
128
|
export { FilterChipDatePicker } from './DatePicker/FilterChipDatePicker/FilterChipDatePicker.web.js';
|
|
129
129
|
export { DatePicker } from './DatePicker/DatePicker.web.js';
|
|
130
130
|
export { Dropdown } from './Dropdown/Dropdown.js';
|
|
@@ -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%
|