@razorpay/blade 11.3.1 → 11.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +3 -1
  2. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  3. package/build/lib/native/components/BottomSheet/BottomSheet.native.js +2 -1
  4. package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
  5. package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
  6. package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
  7. package/build/lib/native/components/Drawer/Drawer.native.js +17 -0
  8. package/build/lib/native/components/Drawer/Drawer.native.js.map +1 -0
  9. package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js +17 -0
  10. package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js.map +1 -0
  11. package/build/lib/native/components/Popover/Popover.native.js +3 -2
  12. package/build/lib/native/components/Popover/Popover.native.js.map +1 -1
  13. package/build/lib/native/components/Popover/constants.js +2 -2
  14. package/build/lib/native/components/Popover/constants.js.map +1 -1
  15. package/build/lib/native/components/Tag/Tag.js +1 -1
  16. package/build/lib/native/components/Tag/Tag.js.map +1 -1
  17. package/build/lib/native/components/Tooltip/Tooltip.native.js +3 -2
  18. package/build/lib/native/components/Tooltip/Tooltip.native.js.map +1 -1
  19. package/build/lib/native/components/Tooltip/constants.js +2 -2
  20. package/build/lib/native/components/Tooltip/constants.js.map +1 -1
  21. package/build/lib/native/components/index.js +2 -0
  22. package/build/lib/native/components/index.js.map +1 -1
  23. package/build/lib/native/utils/componentZIndices.js +4 -0
  24. package/build/lib/native/utils/componentZIndices.js.map +1 -0
  25. package/build/lib/native/utils/lodashButBetter/get.js.map +1 -1
  26. package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
  27. package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
  28. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +6 -2
  29. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  30. package/build/lib/web/development/components/BladeProvider/BladeProvider.web.js +5 -2
  31. package/build/lib/web/development/components/BladeProvider/BladeProvider.web.js.map +1 -1
  32. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +2 -1
  33. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  34. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +2 -2
  35. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
  36. package/build/lib/web/development/components/Drawer/Drawer.web.js +229 -0
  37. package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -0
  38. package/build/lib/web/development/components/Drawer/DrawerContext.js +9 -0
  39. package/build/lib/web/development/components/Drawer/DrawerContext.js.map +1 -0
  40. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js +65 -0
  41. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -0
  42. package/build/lib/web/development/components/Drawer/StackProvider.js +57 -0
  43. package/build/lib/web/development/components/Drawer/StackProvider.js.map +1 -0
  44. package/build/lib/web/development/components/Drawer/drawerComponentIds.js +8 -0
  45. package/build/lib/web/development/components/Drawer/drawerComponentIds.js.map +1 -0
  46. package/build/lib/web/development/components/Drawer/index.js +4 -0
  47. package/build/lib/web/development/components/Drawer/index.js.map +1 -0
  48. package/build/lib/web/development/components/Drawer/types.js +2 -0
  49. package/build/lib/web/development/components/Drawer/types.js.map +1 -0
  50. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +2 -2
  51. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  52. package/build/lib/web/development/components/Modal/Modal.web.js +3 -2
  53. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  54. package/build/lib/web/development/components/Modal/ModalHeader.web.js +2 -2
  55. package/build/lib/web/development/components/Modal/ModalHeader.web.js.map +1 -1
  56. package/build/lib/web/development/components/Modal/modalTokens.js +1 -2
  57. package/build/lib/web/development/components/Modal/modalTokens.js.map +1 -1
  58. package/build/lib/web/development/components/Popover/Popover.web.js +3 -2
  59. package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
  60. package/build/lib/web/development/components/Popover/constants.js +1 -2
  61. package/build/lib/web/development/components/Popover/constants.js.map +1 -1
  62. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +2 -2
  63. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  64. package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +3 -2
  65. package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
  66. package/build/lib/web/development/components/SpotlightPopoverTour/tourTokens.js +1 -3
  67. package/build/lib/web/development/components/SpotlightPopoverTour/tourTokens.js.map +1 -1
  68. package/build/lib/web/development/components/Tag/AnimatedTag.web.js +1 -1
  69. package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
  70. package/build/lib/web/development/components/Tag/Tag.js +1 -0
  71. package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
  72. package/build/lib/web/development/components/Tooltip/Tooltip.web.js +3 -2
  73. package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
  74. package/build/lib/web/development/components/Tooltip/constants.js +1 -2
  75. package/build/lib/web/development/components/Tooltip/constants.js.map +1 -1
  76. package/build/lib/web/development/components/index.js +3 -0
  77. package/build/lib/web/development/components/index.js.map +1 -1
  78. package/build/lib/web/development/utils/componentZIndices.js +13 -0
  79. package/build/lib/web/development/utils/componentZIndices.js.map +1 -0
  80. package/build/lib/web/development/utils/lodashButBetter/get.js +1 -1
  81. package/build/lib/web/development/utils/lodashButBetter/get.js.map +1 -1
  82. package/build/lib/web/development/utils/metaAttribute/metaConstants.js +1 -0
  83. package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
  84. package/build/lib/web/development/utils/useVerifyAllowedChildren/index.js +2 -0
  85. package/build/lib/web/development/utils/useVerifyAllowedChildren/index.js.map +1 -0
  86. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +6 -2
  87. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  88. package/build/lib/web/production/components/BladeProvider/BladeProvider.web.js +5 -2
  89. package/build/lib/web/production/components/BladeProvider/BladeProvider.web.js.map +1 -1
  90. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +2 -1
  91. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  92. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +2 -2
  93. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
  94. package/build/lib/web/production/components/Drawer/Drawer.web.js +229 -0
  95. package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -0
  96. package/build/lib/web/production/components/Drawer/DrawerContext.js +9 -0
  97. package/build/lib/web/production/components/Drawer/DrawerContext.js.map +1 -0
  98. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +65 -0
  99. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -0
  100. package/build/lib/web/production/components/Drawer/StackProvider.js +57 -0
  101. package/build/lib/web/production/components/Drawer/StackProvider.js.map +1 -0
  102. package/build/lib/web/production/components/Drawer/drawerComponentIds.js +8 -0
  103. package/build/lib/web/production/components/Drawer/drawerComponentIds.js.map +1 -0
  104. package/build/lib/web/production/components/Drawer/index.js +4 -0
  105. package/build/lib/web/production/components/Drawer/index.js.map +1 -0
  106. package/build/lib/web/production/components/Drawer/types.js +2 -0
  107. package/build/lib/web/production/components/Drawer/types.js.map +1 -0
  108. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +2 -2
  109. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  110. package/build/lib/web/production/components/Modal/Modal.web.js +3 -2
  111. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  112. package/build/lib/web/production/components/Modal/ModalHeader.web.js +2 -2
  113. package/build/lib/web/production/components/Modal/ModalHeader.web.js.map +1 -1
  114. package/build/lib/web/production/components/Modal/modalTokens.js +1 -2
  115. package/build/lib/web/production/components/Modal/modalTokens.js.map +1 -1
  116. package/build/lib/web/production/components/Popover/Popover.web.js +3 -2
  117. package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
  118. package/build/lib/web/production/components/Popover/constants.js +1 -2
  119. package/build/lib/web/production/components/Popover/constants.js.map +1 -1
  120. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +2 -2
  121. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  122. package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +3 -2
  123. package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
  124. package/build/lib/web/production/components/SpotlightPopoverTour/tourTokens.js +1 -3
  125. package/build/lib/web/production/components/SpotlightPopoverTour/tourTokens.js.map +1 -1
  126. package/build/lib/web/production/components/Tag/AnimatedTag.web.js +1 -1
  127. package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
  128. package/build/lib/web/production/components/Tag/Tag.js +1 -0
  129. package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
  130. package/build/lib/web/production/components/Tooltip/Tooltip.web.js +3 -2
  131. package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
  132. package/build/lib/web/production/components/Tooltip/constants.js +1 -2
  133. package/build/lib/web/production/components/Tooltip/constants.js.map +1 -1
  134. package/build/lib/web/production/components/index.js +3 -0
  135. package/build/lib/web/production/components/index.js.map +1 -1
  136. package/build/lib/web/production/utils/componentZIndices.js +13 -0
  137. package/build/lib/web/production/utils/componentZIndices.js.map +1 -0
  138. package/build/lib/web/production/utils/lodashButBetter/get.js +1 -1
  139. package/build/lib/web/production/utils/lodashButBetter/get.js.map +1 -1
  140. package/build/lib/web/production/utils/metaAttribute/metaConstants.js +1 -0
  141. package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
  142. package/build/lib/web/production/utils/useVerifyAllowedChildren/index.js +2 -0
  143. package/build/lib/web/production/utils/useVerifyAllowedChildren/index.js.map +1 -0
  144. package/build/types/components/index.d.ts +131 -2
  145. package/build/types/components/index.native.d.ts +81 -3
  146. package/package.json +1 -1
@@ -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 } 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';\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 zIndex = 100,\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 =\n limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n headerHeight: headerHeight + grabHandleHeight,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader,\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?.hasAutoCompleteInBottomSheetHeader) {\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 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 focusOnInitialRef();\n }, [dimensions.height, focusOnInitialRef, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss();\n returnFocus();\n }, [bottomSheetAndDropdownGlue, onDismiss, 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 args: [{ isContentDragging = false } = {}] = [],\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 setIsDragging(false);\n cancel();\n close();\n return;\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 e.preventDefault();\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 framer-motions 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 }),\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 ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\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 >\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$zIndex","zIndex","_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$useState10","hasBodyPadding","setHasBodyPadding","_React$useState11","_React$useState12","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState13","_React$useState14","positionY","_setPositionY","_isOpen","_React$useState15","_React$useState16","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","hasAutoCompleteInBottomSheetHeader","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","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","onBottomSheetDismiss","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","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","from","filterTaps","scrollElement","preventScrolling","e","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,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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,CAAC,EACD/G,QAAQ,CAAA;OACF,CAAA;AAAC,KAAA,CACQ,CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAM+L,WAAW,gBAAGY,wBAAwB,CAAC/M,YAAY,EAAE;EACzDtC,WAAW,EAAEoP,YAAY,CAACX,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 } 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';\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 zIndex = componentZIndices.bottomSheet,\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 =\n limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader;\n\n const maxValue = computeMaxContent({\n contentHeight,\n footerHeight,\n headerHeight: headerHeight + grabHandleHeight,\n maxHeight: value,\n });\n _setPositionY(shouldLimitPositionY ? maxValue : value);\n },\n [\n bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader,\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?.hasAutoCompleteInBottomSheetHeader) {\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 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 focusOnInitialRef();\n }, [dimensions.height, focusOnInitialRef, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n onDismiss?.();\n bottomSheetAndDropdownGlue?.onBottomSheetDismiss();\n returnFocus();\n }, [bottomSheetAndDropdownGlue, onDismiss, 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 args: [{ isContentDragging = false } = {}] = [],\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 setIsDragging(false);\n cancel();\n close();\n return;\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 e.preventDefault();\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 framer-motions 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 }),\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 ],\n );\n\n React.useEffect(() => {\n if (isMounted) {\n addBottomSheetToStack(id);\n } else {\n removeBottomSheetFromStack(id);\n }\n }, [addBottomSheetToStack, id, isMounted, removeBottomSheetFromStack]);\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 >\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$zIndex","zIndex","componentZIndices","bottomSheet","_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$useState10","hasBodyPadding","setHasBodyPadding","_React$useState11","_React$useState12","isHeaderEmpty","setIsHeaderEmpty","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","_React$useState13","_React$useState14","positionY","_setPositionY","_isOpen","_React$useState15","_React$useState16","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","hasAutoCompleteInBottomSheetHeader","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","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","onBottomSheetDismiss","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","_ref3$args","args","_ref3$args2","_ref3$args3","_ref3$args3$","_ref3$args3$2","_ref3$args3$2$isConte","isContentDragging","Boolean","rawY","upperSnapPoint","predictedDistance","predictedY","Math","max","min","newY","dampening","rubberbandIfOutOfBounds","isPosAtUpperSnapPoint","isContentScrolledAtTop","scrollTop","_computeSnapPointBoun","computeSnapPointBounds","map","point","_computeSnapPointBoun2","nearest","lower","lowerPointBuffer","lowerestSnap","shouldClose","from","filterTaps","scrollElement","preventScrolling","e","preventDefault","preventSafariOverscroll","addEventListener","removeEventListener","_usePresence","usePresence","isMounted","isVisible","isHeaderFloating","contextValue","isInBottomSheet","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,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,CA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;SAAuB,CAAC,GAC3DzF,IAAI,EAAE,CACX,CAAC,EACDjH,QAAQ,CAAA;OACF,CAAA;AAAC,KAAA,CACQ,CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMiM,WAAW,gBAAGY,wBAAwB,CAACjN,YAAY,EAAE;EACzDtC,WAAW,EAAEsP,YAAY,CAACX,WAAAA;AAC5B,CAAC;;;;"}
@@ -160,9 +160,9 @@ var buttonIconOnlyPadding = {
160
160
  xsmall: {
161
161
  top: 0,
162
162
  bottom: 0,
163
- left: 4,
163
+ left: 3,
164
164
  // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token
165
- right: 4 // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token
165
+ right: 3 // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token
166
166
  },
167
167
 
168
168
  small: {
@@ -1 +1 @@
1
- {"version":3,"file":"buttonTokens.js","sources":["../../../../../../../src/components/Button/BaseButton/buttonTokens.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { BaseButtonProps } from './BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconSize } from '~components/Icons';\nimport type { SpinnerProps } from '~components/Spinner';\nimport type { Size } from '~tokens/global';\nimport { size } from '~tokens/global';\nimport type { FeedbackColors } from '~tokens/theme/theme';\n\nexport type ButtonMinHeight = Size[28] | Size[32] | Size[36] | Size[48];\n\nexport type ButtonTypography = {\n fonts: {\n size: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['typography']['fonts']['size']>;\n };\n lineHeights: Record<\n NonNullable<BaseButtonProps['size']>,\n keyof Theme['typography']['lineHeights']\n >;\n};\n\nconst backgroundColor = (property: 'background' | 'border') => {\n const isBorder = property === 'border';\n return {\n base: {\n primary: {\n default: `interactive.${property}.primary.default`,\n highlighted: `interactive.${property}.primary.highlighted`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: isBorder ? 'interactive.border.primary.default' : 'transparent',\n highlighted: isBorder\n ? `interactive.border.primary.default`\n : `interactive.background.primary.faded`,\n disabled: isBorder ? `interactive.border.primary.disabled` : `transparent`,\n },\n tertiary: {\n default: `interactive.${property}.gray.default`,\n highlighted: `interactive.${property}.gray.highlighted`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticWhite.default`,\n highlighted: `interactive.${property}.staticWhite.highlighted`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n secondary: {\n default: isBorder ? 'interactive.border.staticWhite.highlighted' : 'transparent',\n highlighted: isBorder\n ? 'interactive.border.staticWhite.highlighted'\n : 'interactive.background.staticWhite.faded',\n disabled: isBorder ? `interactive.border.staticWhite.disabled` : 'transparent',\n },\n tertiary: {\n default: `interactive.background.staticWhite.faded`,\n highlighted: `interactive.background.staticWhite.fadedHighlighted`,\n disabled: `interactive.background.staticWhite.disabled`,\n },\n },\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.${color}.default`,\n highlighted: `interactive.${property}.${color}.highlighted`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: isBorder\n ? (`interactive.border.${color}.default` as const)\n : (`interactive.background.${color}.faded` as const),\n highlighted: isBorder\n ? (`interactive.border.${color}.default` as const)\n : (`interactive.background.${color}.fadedHighlighted` as const),\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst textColor = (property: 'icon' | 'text') => {\n return {\n base: {\n primary: {\n default: `interactive.${property}.onPrimary.normal`,\n highlighted: `interactive.${property}.onPrimary.normal`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: `interactive.${property}.primary.subtle`,\n highlighted: `interactive.${property}.primary.subtle`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticBlack.muted`,\n highlighted: `interactive.${property}.staticBlack.muted`,\n disabled: `interactive.${property}.staticBlack.disabled`,\n },\n secondary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: `interactive.${property}.${color}.normal`,\n highlighted: `interactive.${property}.${color}.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst typography: ButtonTypography = {\n fonts: {\n size: {\n xsmall: 50,\n small: 50,\n medium: 100,\n large: 200,\n },\n },\n lineHeights: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n};\n\nconst minHeight: Record<NonNullable<BaseButtonProps['size']>, ButtonMinHeight> = {\n xsmall: size[28],\n small: size[32],\n medium: size[36],\n large: size[48],\n};\n\nconst buttonPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n small: {\n top: 0,\n bottom: 0,\n left: 4,\n right: 4,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 6,\n right: 6,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 6,\n right: 6,\n },\n};\n\nconst buttonIconOnlyPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 4, // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token\n right: 4, // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token\n },\n small: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 2,\n right: 2,\n },\n};\n\nconst buttonSizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonIconOnlySizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonSizeToSpinnerSizeMap: Record<\n NonNullable<BaseButtonProps['size']>,\n SpinnerProps['size']\n> = {\n xsmall: 'medium',\n small: 'large',\n medium: 'large',\n large: 'xlarge',\n};\n\nconst buttonIconPadding: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['spacing']> = {\n xsmall: 1,\n small: 1,\n medium: 2,\n large: 2,\n};\n\nexport {\n backgroundColor,\n textColor,\n typography,\n minHeight,\n buttonSizeToIconSizeMap,\n buttonIconOnlySizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonIconPadding,\n buttonPadding,\n buttonIconOnlyPadding,\n};\n"],"names":["backgroundColor","property","isBorder","base","primary","concat","highlighted","disabled","secondary","tertiary","white","color","textColor","typography","fonts","size","xsmall","small","medium","large","lineHeights","minHeight","buttonPadding","top","bottom","left","right","buttonIconOnlyPadding","buttonSizeToIconSizeMap","buttonIconOnlySizeToIconSizeMap","buttonSizeToSpinnerSizeMap","buttonIconPadding"],"mappings":";;;AAAA;;AAqBA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,QAAiC,EAAK;AAC7D,EAAA,IAAMC,QAAQ,GAAGD,QAAQ,KAAK,QAAQ,CAAA;EACtC,OAAO;AACLE,IAAAA,IA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AAA,KAAK,EAAE,CAAC;AACRC,EAAAA,MAAM,EAAE,CAAC;AACTC,EAAAA,KAAK,EAAE,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"buttonTokens.js","sources":["../../../../../../../src/components/Button/BaseButton/buttonTokens.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { BaseButtonProps } from './BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconSize } from '~components/Icons';\nimport type { SpinnerProps } from '~components/Spinner';\nimport type { Size } from '~tokens/global';\nimport { size } from '~tokens/global';\nimport type { FeedbackColors } from '~tokens/theme/theme';\n\nexport type ButtonMinHeight = Size[28] | Size[32] | Size[36] | Size[48];\n\nexport type ButtonTypography = {\n fonts: {\n size: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['typography']['fonts']['size']>;\n };\n lineHeights: Record<\n NonNullable<BaseButtonProps['size']>,\n keyof Theme['typography']['lineHeights']\n >;\n};\n\nconst backgroundColor = (property: 'background' | 'border') => {\n const isBorder = property === 'border';\n return {\n base: {\n primary: {\n default: `interactive.${property}.primary.default`,\n highlighted: `interactive.${property}.primary.highlighted`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: isBorder ? 'interactive.border.primary.default' : 'transparent',\n highlighted: isBorder\n ? `interactive.border.primary.default`\n : `interactive.background.primary.faded`,\n disabled: isBorder ? `interactive.border.primary.disabled` : `transparent`,\n },\n tertiary: {\n default: `interactive.${property}.gray.default`,\n highlighted: `interactive.${property}.gray.highlighted`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticWhite.default`,\n highlighted: `interactive.${property}.staticWhite.highlighted`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n secondary: {\n default: isBorder ? 'interactive.border.staticWhite.highlighted' : 'transparent',\n highlighted: isBorder\n ? 'interactive.border.staticWhite.highlighted'\n : 'interactive.background.staticWhite.faded',\n disabled: isBorder ? `interactive.border.staticWhite.disabled` : 'transparent',\n },\n tertiary: {\n default: `interactive.background.staticWhite.faded`,\n highlighted: `interactive.background.staticWhite.fadedHighlighted`,\n disabled: `interactive.background.staticWhite.disabled`,\n },\n },\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.${color}.default`,\n highlighted: `interactive.${property}.${color}.highlighted`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: isBorder\n ? (`interactive.border.${color}.default` as const)\n : (`interactive.background.${color}.faded` as const),\n highlighted: isBorder\n ? (`interactive.border.${color}.default` as const)\n : (`interactive.background.${color}.fadedHighlighted` as const),\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst textColor = (property: 'icon' | 'text') => {\n return {\n base: {\n primary: {\n default: `interactive.${property}.onPrimary.normal`,\n highlighted: `interactive.${property}.onPrimary.normal`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: `interactive.${property}.primary.subtle`,\n highlighted: `interactive.${property}.primary.subtle`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticBlack.muted`,\n highlighted: `interactive.${property}.staticBlack.muted`,\n disabled: `interactive.${property}.staticBlack.disabled`,\n },\n secondary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: `interactive.${property}.${color}.normal`,\n highlighted: `interactive.${property}.${color}.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst typography: ButtonTypography = {\n fonts: {\n size: {\n xsmall: 50,\n small: 50,\n medium: 100,\n large: 200,\n },\n },\n lineHeights: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n};\n\nconst minHeight: Record<NonNullable<BaseButtonProps['size']>, ButtonMinHeight> = {\n xsmall: size[28],\n small: size[32],\n medium: size[36],\n large: size[48],\n};\n\nconst buttonPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n small: {\n top: 0,\n bottom: 0,\n left: 4,\n right: 4,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 6,\n right: 6,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 6,\n right: 6,\n },\n};\n\nconst buttonIconOnlyPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3, // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token\n right: 3, // should be `6px` as per design but we're making it `8px` since `6px` is not available as a spacing token\n },\n small: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 2,\n right: 2,\n },\n};\n\nconst buttonSizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonIconOnlySizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonSizeToSpinnerSizeMap: Record<\n NonNullable<BaseButtonProps['size']>,\n SpinnerProps['size']\n> = {\n xsmall: 'medium',\n small: 'large',\n medium: 'large',\n large: 'xlarge',\n};\n\nconst buttonIconPadding: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['spacing']> = {\n xsmall: 1,\n small: 1,\n medium: 2,\n large: 2,\n};\n\nexport {\n backgroundColor,\n textColor,\n typography,\n minHeight,\n buttonSizeToIconSizeMap,\n buttonIconOnlySizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonIconPadding,\n buttonPadding,\n buttonIconOnlyPadding,\n};\n"],"names":["backgroundColor","property","isBorder","base","primary","concat","highlighted","disabled","secondary","tertiary","white","color","textColor","typography","fonts","size","xsmall","small","medium","large","lineHeights","minHeight","buttonPadding","top","bottom","left","right","buttonIconOnlyPadding","buttonSizeToIconSizeMap","buttonIconOnlySizeToIconSizeMap","buttonSizeToSpinnerSizeMap","buttonIconPadding"],"mappings":";;;AAAA;;AAqBA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,QAAiC,EAAK;AAC7D,EAAA,IAAMC,QAAQ,GAAGD,QAAQ,KAAK,QAAQ,CAAA;EACtC,OAAO;AACLE,IAAAA,IAAI,EAAE;AACJC,MAAAA,OAAO,EAAE;QACP,SAAAC,EAAAA,cAAAA,CAAAA,MAAA,CAAwBJ,QAAQ,EAAkB,kBAAA,CAAA;AAClDK,QAAAA,WAAW,EAAAD,cAAAA,CAAAA,MAAA,CAAiBJ,QAAQ,EAAsB,sBAAA,CAAA;QAC1DM,QAAQ,EAAA,cAAA,CAAAF,MAAA,CAAiBJ,QAAQ,EAAA,mBAAA,CAAA;OAClC;AACDO,MAAAA,SAAS,EAAE;AACT,QAAA,SAAA,EAASN,QAAQ,GAAG,oCAAoC,GAAG,aAAa;QACxEI,WAAW,EAAEJ,QAAQ,GAEqB,oCAAA,GAAA,sCAAA;AAC1CK,QAAAA,QAAQ,EAAEL,QAAQ,GAAA,q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AAAA,KAAK,EAAE,CAAA;GACR;AACDP,EAAAA,KAAK,EAAE;AACLI,IAAAA,GAAG,EAAE,CAAC;AACNC,IAAAA,MAAM,EAAE,CAAC;AACTC,IAAAA,IAAI,EAAE,CAAC;AACPC,IAAAA,KAAK,EAAE,CAAA;AACT,GAAA;AACF,EAAC;AAED,IAAME,uBAA+E,GAAG;AACtFZ,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,QAAA;AACT,EAAC;AAED,IAAMU,+BAAuF,GAAG;AAC9Fb,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,QAAA;AACT,EAAC;AAED,IAAMW,0BAGL,GAAG;AACFd,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,KAAK,EAAE,QAAA;AACT,EAAC;AAED,IAAMY,iBAAuF,GAAG;AAC9Ff,EAAAA,MAAM,EAAE,CAAC;AACTC,EAAAA,KAAK,EAAE,CAAC;AACRC,EAAAA,MAAM,EAAE,CAAC;AACTC,EAAAA,KAAK,EAAE,CAAA;AACT;;;;"}
@@ -0,0 +1,229 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
+ import { FloatingOverlay, useFloating, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
4
+ import React__default from 'react';
5
+ import styled from 'styled-components';
6
+ import usePresence from 'use-presence';
7
+ import { drawerComponentIds } from './drawerComponentIds.js';
8
+ import { DrawerContext } from './DrawerContext.js';
9
+ import '../Box/BaseBox/index.js';
10
+ import '../../utils/index.js';
11
+ import '../../utils/assignWithoutSideEffects/index.js';
12
+ import { componentZIndices } from '../../utils/componentZIndices.js';
13
+ import { useDrawerStack } from './StackProvider.js';
14
+ import '../../utils/makeAccessible/index.js';
15
+ import '../../utils/metaAttribute/index.js';
16
+ import { useId } from '../../utils/useId.js';
17
+ import '../../utils/useVerifyAllowedChildren/index.js';
18
+ import { jsx, jsxs } from 'react/jsx-runtime';
19
+ import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
20
+ import { castWebType } from '../../utils/platform/castUtils.js';
21
+ import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
22
+ import { useVerifyAllowedChildren } from '../../utils/useVerifyAllowedChildren/useVerifyAllowedChildren.js';
23
+ import useTheme from '../BladeProvider/useTheme.js';
24
+ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
25
+ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
26
+ import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
27
+ import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
28
+
29
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
+ var SHOW_DRAWER = 'show-drawer';
32
+ var AnimatedDrawerContainer = /*#__PURE__*/styled(BaseBox).withConfig({
33
+ displayName: "Drawerweb__AnimatedDrawerContainer",
34
+ componentId: "sc-15ixhgr-0"
35
+ })(function (_ref) {
36
+ var theme = _ref.theme,
37
+ isFirstDrawerInStack = _ref.isFirstDrawerInStack,
38
+ isVisible = _ref.isVisible;
39
+ var entranceTransition = "all ".concat(castWebType(castWebType(makeMotionTime(theme.motion.duration.gentle))), " ").concat(castWebType(theme.motion.easing.entrance.revealing));
40
+ var exitTransition = "all\n ".concat(castWebType(makeMotionTime(theme.motion.duration.xmoderate)), "\n ").concat(castWebType(theme.motion.easing.exit.revealing));
41
+ return {
42
+ opacity: isVisible ? 1 : 0,
43
+ transform: isVisible ? isFirstDrawerInStack ? 'translateX(calc(-100% - 16px))' : 'translateX(-100%)' : 'translateX(0%)',
44
+ transition: isVisible ? entranceTransition : exitTransition,
45
+ animationFillMode: 'initial'
46
+ };
47
+ });
48
+ var DrawerOverlay = /*#__PURE__*/styled(FloatingOverlay).withConfig({
49
+ displayName: "Drawerweb__DrawerOverlay",
50
+ componentId: "sc-15ixhgr-1"
51
+ })(function (_ref2) {
52
+ var theme = _ref2.theme;
53
+ return _defineProperty({
54
+ opacity: 0,
55
+ transition: "opacity\n ".concat(makeMotionTime(theme.motion.duration.xmoderate), "\n ").concat(castWebType(theme.motion.easing.exit.revealing)),
56
+ backgroundColor: theme.colors.overlay.background.subtle
57
+ }, "&.".concat(SHOW_DRAWER), {
58
+ opacity: 1,
59
+ transition: "opacity ".concat(makeMotionTime(theme.motion.duration.gentle), " ").concat(castWebType(theme.motion.easing.entrance.revealing))
60
+ });
61
+ });
62
+ var _Drawer = function _Drawer(_ref4) {
63
+ var isOpen = _ref4.isOpen,
64
+ onDismiss = _ref4.onDismiss,
65
+ _ref4$zIndex = _ref4.zIndex,
66
+ zIndex = _ref4$zIndex === void 0 ? componentZIndices.drawer : _ref4$zIndex,
67
+ children = _ref4.children,
68
+ accessibilityLabel = _ref4.accessibilityLabel,
69
+ _ref4$showOverlay = _ref4.showOverlay,
70
+ showOverlay = _ref4$showOverlay === void 0 ? true : _ref4$showOverlay,
71
+ initialFocusRef = _ref4.initialFocusRef,
72
+ testID = _ref4.testID;
73
+ var closeButtonRef = React__default.useRef(null);
74
+ var _React$useState = React__default.useState(zIndex),
75
+ _React$useState2 = _slicedToArray(_React$useState, 2),
76
+ zIndexState = _React$useState2[0],
77
+ setZIndexState = _React$useState2[1];
78
+ useVerifyAllowedChildren({
79
+ children: children,
80
+ componentName: 'Drawer',
81
+ allowedComponents: [drawerComponentIds.DrawerHeader, drawerComponentIds.DrawerBody]
82
+ });
83
+ var _useTheme = useTheme(),
84
+ theme = _useTheme.theme;
85
+ var drawerId = useId('drawer');
86
+ var _useDrawerStack = useDrawerStack(),
87
+ drawerStack = _useDrawerStack.drawerStack,
88
+ addToDrawerStack = _useDrawerStack.addToDrawerStack,
89
+ removeFromDrawerStack = _useDrawerStack.removeFromDrawerStack;
90
+ var _usePresence = usePresence(isOpen, {
91
+ enterTransitionDuration: theme.motion.duration.gentle,
92
+ exitTransitionDuration: theme.motion.duration.xmoderate,
93
+ initialEnter: true
94
+ }),
95
+ isMounted = _usePresence.isMounted,
96
+ isVisible = _usePresence.isVisible;
97
+ var _React$useMemo = React__default.useMemo(function () {
98
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
99
+ var level = drawerStack.indexOf(drawerId) + 1;
100
+ return {
101
+ stackingLevel: level,
102
+ isFirstDrawerInStack: level === 1 && drawerStack.length > 1
103
+ };
104
+ }, [drawerId, drawerStack]),
105
+ stackingLevel = _React$useMemo.stackingLevel,
106
+ isFirstDrawerInStack = _React$useMemo.isFirstDrawerInStack;
107
+ var _useFloating = useFloating({
108
+ open: isMounted
109
+ }),
110
+ refs = _useFloating.refs,
111
+ context = _useFloating.context;
112
+ React__default.useEffect(function () {
113
+ if (isOpen) {
114
+ addToDrawerStack(drawerId);
115
+ } else {
116
+ removeFromDrawerStack(drawerId);
117
+ }
118
+ // eslint-disable-next-line react-hooks/exhaustive-deps
119
+ }, [isOpen]);
120
+
121
+ // When z-index is not defined by user, we use default drawer z index and add stackingLevel to ensure
122
+ // new drawer that opens, always opens on top of previous one.
123
+ React__default.useEffect(function () {
124
+ // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
125
+ setZIndexState(zIndex + stackingLevel);
126
+ // eslint-disable-next-line react-hooks/exhaustive-deps
127
+ }, [isMounted]);
128
+ return /*#__PURE__*/jsx(DrawerContext.Provider, {
129
+ value: {
130
+ close: onDismiss,
131
+ closeButtonRef: closeButtonRef
132
+ },
133
+ children: /*#__PURE__*/jsx(FloatingPortal, {
134
+ children: isMounted ? /*#__PURE__*/jsx(FloatingFocusManager, {
135
+ context: context,
136
+ initialFocus: initialFocusRef !== null && initialFocusRef !== void 0 ? initialFocusRef : closeButtonRef,
137
+ children: /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread({
138
+ position: "fixed"
139
+ }, metaAttribute({
140
+ name: MetaConstants.Drawer,
141
+ testID: testID
142
+ })), {}, {
143
+ zIndex: zIndexState,
144
+ children: [showOverlay || stackingLevel === 2 ? /*#__PURE__*/jsx(DrawerOverlay, _objectSpread({
145
+ onClick: function onClick() {
146
+ onDismiss();
147
+ },
148
+ className: isVisible ? SHOW_DRAWER : '',
149
+ lockScroll: true
150
+ }, metaAttribute({
151
+ testID: 'drawer-overlay'
152
+ }))) : null, /*#__PURE__*/jsx(AnimatedDrawerContainer, _objectSpread(_objectSpread({
153
+ isVisible: isVisible,
154
+ isFirstDrawerInStack: isFirstDrawerInStack,
155
+ width: {
156
+ base: '90%',
157
+ s: '375px',
158
+ m: '420px'
159
+ }
160
+ }, makeAccessible({
161
+ role: 'dialog',
162
+ modal: true,
163
+ label: accessibilityLabel
164
+ })), {}, {
165
+ position: "fixed",
166
+ top: "spacing.0",
167
+ left: "100%",
168
+ backgroundColor: "popup.background.subtle",
169
+ elevation: "highRaised",
170
+ height: "100%",
171
+ display: "flex",
172
+ flexDirection: "column",
173
+ ref: refs.setFloating,
174
+ onKeyDown: function onKeyDown(event) {
175
+ if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape' || (event === null || event === void 0 ? void 0 : event.code) === 'Escape') {
176
+ onDismiss();
177
+ }
178
+ },
179
+ children: children
180
+ }))]
181
+ }))
182
+ }) : null
183
+ })
184
+ });
185
+ };
186
+
187
+ /**
188
+ * ### Drawer Component
189
+ *
190
+ * A drawer is a panel that slides in mostly from right side of the screen over the existing content in the viewport.
191
+ * It helps in providing additional details or context and can also be used to promote product features or new products.
192
+ *
193
+ * ---
194
+ *
195
+ * #### Usage
196
+ *
197
+ * ```jsx
198
+ const MyDrawer = () => {
199
+ const [showDrawer, setShowDrawer] = React.useState(false);
200
+ return (
201
+ <Box>
202
+ <Button onClick={() => setShowDrawer(true)}>Open Drawer</Button>
203
+ <Drawer
204
+ isOpen={showDrawer}
205
+ onDismiss={() => setShowDrawer(false)}
206
+ >
207
+ <DrawerHeader title="Announcements" />
208
+ <DrawerBody>
209
+ <FTXAnnouncement />
210
+ <CatPictures />
211
+ </DrawerBody>
212
+ <Drawer>
213
+ </Box>
214
+ )
215
+ }
216
+ * ```
217
+ *
218
+ * ---
219
+ *
220
+ * Checkout {@link https://blade.razorpay.com/?path=/docs/components-drawer Drawer Documentation}
221
+ *
222
+ *
223
+ */
224
+ var Drawer = /*#__PURE__*/assignWithoutSideEffects(_Drawer, {
225
+ componentId: drawerComponentIds.Drawer
226
+ });
227
+
228
+ export { Drawer };
229
+ //# sourceMappingURL=Drawer.web.js.map
@@ -0,0 +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, 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';\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.gentle)),\n )} ${castWebType(theme.motion.easing.entrance.revealing)}`;\n\n const exitTransition: CSSProperties['transition'] = `all\n ${castWebType(makeMotionTime(theme.motion.duration.xmoderate))}\n ${castWebType(theme.motion.easing.exit.revealing)}`;\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 };\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.revealing)}`,\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.revealing,\n )}`,\n },\n };\n});\n\nconst _Drawer = ({\n isOpen,\n onDismiss,\n zIndex = componentZIndices.drawer,\n children,\n accessibilityLabel,\n showOverlay = true,\n initialFocusRef,\n testID,\n}: DrawerProps): React.ReactElement => {\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 } = 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 = drawerStack.indexOf(drawerId) + 1;\n return {\n stackingLevel: level,\n isFirstDrawerInStack: level === 1 && drawerStack.length > 1,\n };\n }, [drawerId, drawerStack]);\n\n const { refs, context } = useFloating({\n open: isMounted,\n });\n\n React.useEffect(() => {\n if (isOpen) {\n addToDrawerStack(drawerId);\n } else {\n removeFromDrawerStack(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 return (\n <DrawerContext.Provider value={{ close: onDismiss, closeButtonRef }}>\n <FloatingPortal>\n {isMounted ? (\n <FloatingFocusManager context={context} initialFocus={initialFocusRef ?? closeButtonRef}>\n <BaseBox\n position=\"fixed\"\n {...metaAttribute({\n name: MetaConstants.Drawer,\n testID,\n })}\n zIndex={zIndexState}\n >\n {showOverlay || stackingLevel === 2 ? (\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 top=\"spacing.0\"\n left=\"100%\"\n backgroundColor=\"popup.background.subtle\"\n elevation=\"highRaised\"\n height=\"100%\"\n display=\"flex\"\n flexDirection=\"column\"\n 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(_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","gentle","easing","entrance","revealing","exitTransition","xmoderate","exit","opacity","transform","transition","animationFillMode","DrawerOverlay","FloatingOverlay","_ref2","_defineProperty","backgroundColor","colors","overlay","background","subtle","_Drawer","_ref4","isOpen","onDismiss","_ref4$zIndex","zIndex","componentZIndices","drawer","children","accessibilityLabel","_ref4$showOverlay","showOverlay","initialFocusRef","testID","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","_React$useMemo","useMemo","level","indexOf","stackingLevel","length","_useFloating","useFloating","open","refs","context","useEffect","_jsx","DrawerContext","Provider","value","close","FloatingPortal","FloatingFocusManager","initialFocus","_jsxs","_objectSpread","position","metaAttribute","name","MetaConstants","Drawer","onClick","className","lockScroll","width","base","s","m","makeAccessible","role","modal","label","top","left","elevation","height","display","flexDirection","ref","setFloating","onKeyDown","event","key","code","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,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,MAAM,CAAC,CAC1D,CAAC,EAAAL,GAAAA,CAAAA,CAAAA,MAAA,CAAIC,WAAW,CAACL,KAAK,CAAC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ACbC,YAAAA,OAAO,EAAC,MAAM;AACdC,YAAAA,aAAa,EAAC,QAAQ;YACtBC,GAAG,EAAEnC,IAAI,CAACoC,WAAY;AACtBC,YAAAA,SAAS,EAAE,SAAAA,SAACC,CAAAA,KAAK,EAAK;cACpB,IAAI,CAAAA,KAAK,KAALA,IAAAA,IAAAA,KAAK,uBAALA,KAAK,CAAEC,GAAG,MAAK,QAAQ,IAAI,CAAAD,KAAK,aAALA,KAAK,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAALA,KAAK,CAAEE,IAAI,MAAK,QAAQ,EAAE;AACvD1F,gBAAAA,SAAS,EAAE,CAAA;AACb,eAAA;aACA;AAAAK,YAAAA,QAAA,EAEDA,QAAAA;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;AACA,IAAM8D,MAAM,gBAAGwB,wBAAwB,CAAC9F,OAAO,EAAE;EAC/C/B,WAAW,EAAEyD,kBAAkB,CAAC4C,MAAAA;AAClC,CAAC;;;;"}
@@ -0,0 +1,9 @@
1
+ import React__default from 'react';
2
+
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
4
+ var DrawerContext = /*#__PURE__*/React__default.createContext({
5
+ close: function close() {}
6
+ });
7
+
8
+ export { DrawerContext };
9
+ //# sourceMappingURL=DrawerContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawerContext.js","sources":["../../../../../../src/components/Drawer/DrawerContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\n\nconst DrawerContext = React.createContext<{\n close: () => void;\n closeButtonRef?: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n}>({ close: () => {} });\n\nexport { DrawerContext };\n"],"names":["DrawerContext","React","createContext","close"],"mappings":";;AAAA;AAGA,IAAMA,aAAa,gBAAGC,cAAK,CAACC,aAAa,CAItC;AAAEC,EAAAA,KAAK,EAAE,SAAAA,KAAA,GAAM,EAAC;AAAE,CAAC;;;;"}