@razorpay/blade 12.0.3 → 12.1.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 (61) hide show
  1. package/build/lib/native/components/Button/IconButton/IconButton.js +1 -1
  2. package/build/lib/native/components/Button/IconButton/IconButton.js.map +1 -1
  3. package/build/lib/native/components/Radio/Radio.js +1 -1
  4. package/build/lib/native/components/Radio/Radio.js.map +1 -1
  5. package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  6. package/build/lib/native/components/Radio/RadioGroup/useRadioGroup.js +1 -1
  7. package/build/lib/native/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
  8. package/build/lib/native/components/Radio/useRadio.js.map +1 -1
  9. package/build/lib/native/utils/useControllable.js +1 -1
  10. package/build/lib/native/utils/useControllable.js.map +1 -1
  11. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +17 -1
  12. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  13. package/build/lib/web/development/components/Button/IconButton/IconButton.js +2 -2
  14. package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
  15. package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js +7 -4
  16. package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
  17. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +7 -17
  18. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  19. package/build/lib/web/development/components/Drawer/Drawer.web.js +6 -4
  20. package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
  21. package/build/lib/web/development/components/Radio/Radio.js +3 -2
  22. package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
  23. package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  24. package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js +7 -6
  25. package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
  26. package/build/lib/web/development/components/Radio/useRadio.js.map +1 -1
  27. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js +14 -7
  28. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  29. package/build/lib/web/development/components/Tooltip/Tooltip.web.js +7 -1
  30. package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
  31. package/build/lib/web/development/components/Tooltip/componentIds.js +6 -0
  32. package/build/lib/web/development/components/Tooltip/componentIds.js.map +1 -0
  33. package/build/lib/web/development/utils/useControllable.js +2 -1
  34. package/build/lib/web/development/utils/useControllable.js.map +1 -1
  35. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +17 -1
  36. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  37. package/build/lib/web/production/components/Button/IconButton/IconButton.js +2 -2
  38. package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
  39. package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js +7 -4
  40. package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
  41. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +7 -17
  42. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  43. package/build/lib/web/production/components/Drawer/Drawer.web.js +6 -4
  44. package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
  45. package/build/lib/web/production/components/Radio/Radio.js +3 -2
  46. package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
  47. package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  48. package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js +7 -6
  49. package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
  50. package/build/lib/web/production/components/Radio/useRadio.js.map +1 -1
  51. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js +14 -7
  52. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  53. package/build/lib/web/production/components/Tooltip/Tooltip.web.js +7 -1
  54. package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
  55. package/build/lib/web/production/components/Tooltip/componentIds.js +6 -0
  56. package/build/lib/web/production/components/Tooltip/componentIds.js.map +1 -0
  57. package/build/lib/web/production/utils/useControllable.js +2 -1
  58. package/build/lib/web/production/utils/useControllable.js.map +1 -1
  59. package/build/types/components/index.d.ts +1168 -45
  60. package/build/types/components/index.native.d.ts +345 -4
  61. 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';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n zIndex = componentZIndices.bottomSheet,\n ...dataAnalyticsProps\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY =\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 // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n 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 motion/react's usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n }),\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 {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$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","useLayoutEffect","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","makeAnalyticsAttribute","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAA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C,GAAG,CAAC;AAC1B/M,QAAAA,aAAa,EAAE+M,SAAS,GAAG,KAAK,GAAG,MAAM;AACzCrF,QAAAA,MAAM,EAAEnD,SAAS;AACjBzD,QAAAA,MAAM,EAAE,CAAC;AACTC,QAAAA,GAAG,EAAE,MAAM;AACXe,QAAAA,MAAM,EAAEmE,iBAAAA;AACV,OAAA;KACImI,EAAAA,sBAAsB,CAACnM,kBAAkB,CAAC,CAAA,EAAA,EAAA,EAAA;MAAAR,QAAA,eAE9C6L,IAAA,CAACe,OAAO,EAAA;AAAC3G,QAAAA,MAAM,EAAC,MAAM;AAAC4G,QAAAA,OAAO,EAAC,MAAM;AAACC,QAAAA,aAAa,EAAC,QAAQ;AAAA9M,QAAAA,QAAA,gBAC1D2L,GAAA,CAACoB,qBAAqB,EAAAd,aAAA,CAAAA,aAAA,CAAA;AACpBe,UAAAA,GAAG,EAAEzJ,aAAc;AACnBgI,UAAAA,gBAAgB,EAAEA,gBAAAA;AAAiB,SAAA,EAC/BW,aAAa,CAAC;UAAEC,IAAI,EAAEc,YAAY,CAACF,qBAAAA;SAAuB,CAAC,GAC3D1F,IAAI,EAAE,CACX,CAAC,EACDrH,QAAQ,CAAA;OACF,CAAA;AAAC,KAAA,CACQ,CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMqM,WAAW,gBAAGa,wBAAwB,CAACtN,YAAY,EAAE;EACzDtC,WAAW,EAAE2P,YAAY,CAACZ,WAAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"BottomSheet.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheet.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/jsx-no-useless-fragment */\n/* eslint-disable consistent-return */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport styled from 'styled-components';\nimport { rubberbandIfOutOfBounds, useDrag } from '@use-gesture/react';\nimport usePresence from 'use-presence';\nimport { clearAllBodyScrollLocks, enableBodyScroll } from 'body-scroll-lock-upgrade';\nimport { BottomSheetHeader } from './BottomSheetHeader';\nimport { BottomSheetFooter } from './BottomSheetFooter';\nimport { BottomSheetBody } from './BottomSheetBody';\nimport type { SnapPoints } from './utils';\nimport { computeMaxContent, computeSnapPointBounds } from './utils';\nimport { BottomSheetBackdrop } from './BottomSheetBackdrop';\nimport type { BottomSheetContextProps } from './BottomSheetContext';\nimport { BottomSheetContext, useBottomSheetAndDropdownGlue } from './BottomSheetContext';\nimport { ComponentIds } from './componentIds';\nimport type { BottomSheetProps } from './types';\nimport { BottomSheetGrabHandle } from './BottomSheetGrabHandle';\nimport { useBottomSheetStack } from './BottomSheetStack';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useScrollLock } from '~utils/useScrollLock';\nimport { useWindowSize } from '~utils/useWindowSize';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { size } from '~tokens/global';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport const BOTTOM_SHEET_EASING = 'cubic-bezier(.15,0,.24,.97)';\nconst AUTOCOMPLETE_DEFAULT_SNAPPOINT = 0.85;\n\nconst BottomSheetSurface = styled.div<{\n windowHeight: number;\n isDragging: boolean;\n}>(({ theme, windowHeight, isDragging }) => {\n return {\n background: theme.colors.popup.background.subtle,\n borderTopLeftRadius: makeSize(size[16]),\n borderTopRightRadius: makeSize(size[16]),\n borderColor: theme.colors.popup.border.subtle,\n // this is reverse top elevation of highRaised elevation token\n boxShadow: '0px -24px 48px -12px hsla(217, 56%, 17%, 0.18)',\n opacity: 0,\n pointerEvents: 'none',\n transitionDuration: isDragging\n ? undefined\n : `${makeMotionTime(theme.motion.duration.moderate)}`,\n transitionTimingFunction: BOTTOM_SHEET_EASING,\n willChange: 'transform, opacity, height',\n transitionProperty: 'transform, opacity, height',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n top: windowHeight,\n backgroundColor: theme.colors.popup.background.subtle,\n justifyContent: 'center',\n alignItems: 'center',\n touchAction: 'none',\n overflow: 'hidden',\n };\n});\n\nconst _BottomSheet = ({\n isOpen,\n onDismiss,\n children,\n initialFocusRef,\n snapPoints = [0.35, 0.5, 0.85],\n zIndex = componentZIndices.bottomSheet,\n ...dataAnalyticsProps\n}: BottomSheetProps): React.ReactElement => {\n const { theme } = useTheme();\n const dimensions = useWindowSize();\n const [contentHeight, setContentHeight] = React.useState(0);\n const [headerHeight, setHeaderHeight] = React.useState(0);\n const [footerHeight, setFooterHeight] = React.useState(0);\n const [grabHandleHeight, setGrabHandleHeight] = React.useState(0);\n const [hasBodyPadding, setHasBodyPadding] = React.useState(true);\n const [isHeaderEmpty, setIsHeaderEmpty] = React.useState(false);\n\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const [positionY, _setPositionY] = React.useState(0);\n const _isOpen = isOpen ?? bottomSheetAndDropdownGlue?.isOpen;\n const [isDragging, setIsDragging] = React.useState(false);\n\n const preventScrollingRef = React.useRef(true);\n const scrollRef = React.useRef<HTMLDivElement>(null);\n const grabHandleRef = React.useRef<HTMLDivElement>(null);\n const defaultInitialFocusRef = React.useRef<any>(null);\n const originalFocusElement = React.useRef<HTMLElement | null>(null);\n const initialSnapPoint = React.useRef<number>(snapPoints[1]);\n const totalHeight = React.useMemo(() => {\n return grabHandleHeight + headerHeight + footerHeight + contentHeight;\n }, [contentHeight, footerHeight, grabHandleHeight, headerHeight]);\n\n const id = useId();\n const {\n stack,\n addBottomSheetToStack,\n removeBottomSheetFromStack,\n getTopOfTheStack,\n getCurrentStackIndexById,\n } = useBottomSheetStack();\n const currentStackIndex = getCurrentStackIndexById(id);\n const isOnTopOfStack = getTopOfTheStack() === id;\n const bottomSheetZIndex = zIndex - currentStackIndex;\n\n const setPositionY = React.useCallback(\n (value: number, limit = true) => {\n // In AutoComplete, we want BottomSheet to be docked to top snappoint so we remove the limits\n const shouldLimitPositionY =\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 // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n 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 motion/react's usePresence hook\n // https://www.framer.com/docs/animate-presence/#usepresence\n const { isMounted, isVisible } = usePresence(Boolean(_isOpen), {\n transitionDuration: theme.motion.duration.moderate,\n });\n\n const isHeaderFloating = !hasBodyPadding && isHeaderEmpty;\n const contextValue: BottomSheetContextProps = React.useMemo(\n () => ({\n isInBottomSheet: true,\n isOpen: Boolean(isVisible),\n close,\n positionY,\n headerHeight,\n contentHeight,\n footerHeight,\n setContentHeight,\n setFooterHeight,\n setHeaderHeight,\n setHasBodyPadding,\n setIsHeaderEmpty,\n scrollRef,\n bind,\n defaultInitialFocusRef,\n isHeaderFloating,\n }),\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 // Remove the bottomsheet from the stack, if it's unmounted forcefully\n React.useEffect(() => {\n return () => {\n if (id === undefined) return;\n removeBottomSheetFromStack(id);\n };\n }, [id, removeBottomSheetFromStack]);\n\n // Disable body scroll lock when the component is unmounted forcefully\n React.useEffect(() => {\n const lockTarget = scrollRef.current!;\n return () => {\n enableBodyScroll(lockTarget);\n };\n }, []);\n\n // We will need to reset these values otherwise the next time the bottomsheet opens\n // this will be populated and the animations won't run\n // why?: because how the usePresence hook works, we actually just unmount the\n // html contents not the whole <BottomSheet /> react component\n React.useEffect(() => {\n if (!isMounted) {\n setHeaderHeight(0);\n setFooterHeight(0);\n setContentHeight(0);\n setGrabHandleHeight(0);\n _setPositionY(0);\n }\n }, [isMounted, scrollLockRef]);\n\n // We don't want to destroy the react tree when we are rendering inside Dropdown\n // Because if we bail out early then ActionList won't render,\n // and Dropdown manages it's state based on the rendered JSX of ActionList\n // If we don't render ActionList Dropdown state will reset each time we open/close BottomSheet\n const isInsideDropdown = Boolean(bottomSheetAndDropdownGlue);\n if (!isMounted && !isInsideDropdown) {\n return <></>;\n }\n\n return (\n <BottomSheetContext.Provider value={contextValue}>\n <BottomSheetBackdrop zIndex={bottomSheetZIndex} />\n <BottomSheetSurface\n {...metaAttribute({\n name: MetaConstants.BottomSheet,\n testID: 'bottomsheet-surface',\n })}\n {...makeAccessible({ modal: true, role: 'dialog' })}\n windowHeight={dimensions.height}\n isDragging={isDragging}\n style={{\n opacity: isVisible ? 1 : 0,\n pointerEvents: isVisible ? 'all' : 'none',\n height: positionY,\n bottom: 0,\n top: 'auto',\n zIndex: bottomSheetZIndex,\n }}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n <BaseBox height=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BottomSheetGrabHandle\n ref={grabHandleRef}\n isHeaderFloating={isHeaderFloating}\n {...metaAttribute({ name: ComponentIds.BottomSheetGrabHandle })}\n {...bind()}\n />\n {children}\n </BaseBox>\n </BottomSheetSurface>\n </BottomSheetContext.Provider>\n );\n};\n\nconst BottomSheet = assignWithoutSideEffects(_BottomSheet, {\n componentId: ComponentIds.BottomSheet,\n});\n\nexport { BottomSheet, BottomSheetBody, BottomSheetHeader, BottomSheetFooter };\nexport type { BottomSheetProps };\n"],"names":["BOTTOM_SHEET_EASING","AUTOCOMPLETE_DEFAULT_SNAPPOINT","BottomSheetSurface","styled","div","withConfig","displayName","componentId","_ref","theme","windowHeight","isDragging","background","colors","popup","subtle","borderTopLeftRadius","makeSize","size","borderTopRightRadius","borderColor","border","boxShadow","opacity","pointerEvents","transitionDuration","undefined","concat","makeMotionTime","motion","duration","moderate","transitionTimingFunction","willChange","transitionProperty","position","left","right","bottom","top","backgroundColor","justifyContent","alignItems","touchAction","overflow","_BottomSheet","_ref2","isOpen","onDismiss","children","initialFocusRef","_ref2$snapPoints","snapPoints","_ref2$zIndex","zIndex","componentZIndices","bottomSheet","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","dimensions","useWindowSize","_React$useState","React","useState","_React$useState2","_slicedToArray","contentHeight","setContentHeight","_React$useState3","_React$useState4","headerHeight","setHeaderHeight","_React$useState5","_React$useState6","footerHeight","setFooterHeight","_React$useState7","_React$useState8","grabHandleHeight","setGrabHandleHeight","_React$useState9","_React$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","useLayoutEffect","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","lockTarget","enableBodyScroll","isInsideDropdown","_jsx","_Fragment","_jsxs","BottomSheetContext","Provider","BottomSheetBackdrop","_objectSpread","metaAttribute","name","MetaConstants","BottomSheet","testID","makeAccessible","modal","role","style","makeAnalyticsAttribute","BaseBox","display","flexDirection","BottomSheetGrabHandle","ref","ComponentIds","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCO,IAAMA,mBAAmB,GAAG,8BAA6B;AAChE,IAAMC,8BAA8B,GAAG,IAAI,CAAA;AAE3C,IAAMC,kBAAkB,gBAAGC,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAGlC,CAAA,CAAA,UAAAC,IAAA,EAAyC;AAAA,EAAA,IAAtCC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EACnC,OAAO;IACLC,UAAU,EAAEH,KAAK,CAACI,MAAM,CAACC,KAAK,CAACF,UAAU,CAACG,MAAM;AAChDC,IAAAA,mBAAmB,EAAEC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvCC,IAAAA,oBAAoB,EAAEF,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxCE,WAAW,EAAEX,KAAK,CAACI,MAAM,CAACC,KAAK,CAACO,MAAM,CAACN,MAAM;AAC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EAAE;AACLtO,QAAAA,OAAO,EAAEgN,SAAS,GAAG,CAAC,GAAG,CAAC;AAC1B/M,QAAAA,aAAa,EAAE+M,SAAS,GAAG,KAAK,GAAG,MAAM;AACzCrF,QAAAA,MAAM,EAAEnD,SAAS;AACjBzD,QAAAA,MAAM,EAAE,CAAC;AACTC,QAAAA,GAAG,EAAE,MAAM;AACXe,QAAAA,MAAM,EAAEmE,iBAAAA;AACV,OAAA;KACIqI,EAAAA,sBAAsB,CAACrM,kBAAkB,CAAC,CAAA,EAAA,EAAA,EAAA;MAAAR,QAAA,eAE9C+L,IAAA,CAACe,OAAO,EAAA;AAAC7G,QAAAA,MAAM,EAAC,MAAM;AAAC8G,QAAAA,OAAO,EAAC,MAAM;AAACC,QAAAA,aAAa,EAAC,QAAQ;AAAAhN,QAAAA,QAAA,gBAC1D6L,GAAA,CAACoB,qBAAqB,EAAAd,aAAA,CAAAA,aAAA,CAAA;AACpBe,UAAAA,GAAG,EAAE3J,aAAc;AACnBgI,UAAAA,gBAAgB,EAAEA,gBAAAA;AAAiB,SAAA,EAC/Ba,aAAa,CAAC;UAAEC,IAAI,EAAEc,YAAY,CAACF,qBAAAA;SAAuB,CAAC,GAC3D5F,IAAI,EAAE,CACX,CAAC,EACDrH,QAAQ,CAAA;OACF,CAAA;AAAC,KAAA,CACQ,CAAC,CAAA;AAAA,GACM,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMuM,WAAW,gBAAGa,wBAAwB,CAACxN,YAAY,EAAE;EACzDtC,WAAW,EAAE6P,YAAY,CAACZ,WAAAA;AAC5B,CAAC;;;;"}
@@ -33,7 +33,7 @@ var _IconButton = function _IconButton(_ref, ref) {
33
33
  isHighlighted = _ref.isHighlighted,
34
34
  _tabIndex = _ref._tabIndex,
35
35
  rest = _objectWithoutProperties(_ref, _excluded);
36
- return /*#__PURE__*/jsx(StyledIconButton, _objectSpread({
36
+ return /*#__PURE__*/jsx(StyledIconButton, _objectSpread(_objectSpread({
37
37
  ref: ref,
38
38
  onClick: onClick,
39
39
  emphasis: emphasis,
@@ -51,7 +51,7 @@ var _IconButton = function _IconButton(_ref, ref) {
51
51
  onPointerEnter: onPointerEnter,
52
52
  onTouchEnd: onTouchEnd,
53
53
  onTouchStart: onTouchStart
54
- }, makeAnalyticsAttribute(rest)));
54
+ }, makeAnalyticsAttribute(rest)), rest));
55
55
  };
56
56
  var IconButton = /*#__PURE__*/React__default.forwardRef(_IconButton);
57
57
 
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.js","sources":["../../../../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledIconButton from './StyledIconButton';\nimport type { IconComponent } from '~components/Icons';\nimport type { BladeElementRef, DataAnalyticsAttribute } from '~utils/types';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { Platform } from '~utils';\nimport type { SubtleOrIntense } from '~tokens/theme/theme';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype IconButtonProps = {\n /**\n * Icon component to be rendered, eg. `CloseIcon`\n */\n icon: IconComponent;\n\n /**\n * Icon size\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Icon contrast\n *\n * @default 'intense'\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Sets aria-label to help users know what the action does, eg 'Dismiss alert'\n */\n accessibilityLabel: string;\n\n /**\n * Disabled state for IconButton\n */\n isDisabled?: boolean;\n\n /**\n * Sets tabindex property on button element\n */\n _tabIndex?: number;\n} & DataAnalyticsAttribute &\n BladeCommonEvents &\n Platform.Select<{\n web: {\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * This changes the hover interaction to highlight icon more\n *\n * **Only available on web currently**\n */\n isHighlighted?: boolean;\n };\n native: {\n onClick: (event: GestureResponderEvent) => void;\n isHighlighted?: undefined;\n };\n }>;\n\n/**\n * Component for making clickable icons with transparent background.\n * For other cases please use `Button` component with `icon` prop.\n */\nconst _IconButton: React.ForwardRefRenderFunction<BladeElementRef, IconButtonProps> = (\n {\n icon,\n onClick,\n size = 'medium',\n emphasis = 'intense',\n accessibilityLabel,\n isDisabled,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchEnd,\n onTouchStart,\n isHighlighted,\n _tabIndex,\n ...rest\n },\n ref,\n) => {\n return (\n <StyledIconButton\n ref={ref as any}\n onClick={onClick}\n emphasis={emphasis}\n size={size}\n icon={icon}\n tabIndex={_tabIndex}\n accessibilityLabel={accessibilityLabel}\n isDisabled={isDisabled}\n isHighlighted={isHighlighted}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchEnd={onTouchEnd}\n onTouchStart={onTouchStart}\n {...makeAnalyticsAttribute(rest)}\n />\n );\n};\n\nconst IconButton = React.forwardRef(_IconButton);\n\nexport type { IconButtonProps };\nexport { IconButton };\n"],"names":["_IconButton","_ref","ref","icon","onClick","_ref$size","size","_ref$emphasis","emphasis","accessibilityLabel","isDisabled","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchEnd","onTouchStart","isHighlighted","_tabIndex","rest","_objectWithoutProperties","_excluded","_jsx","StyledIconButton","_objectSpread","tabIndex","makeAnalyticsAttribute","IconButton","React","forwardRef"],"mappings":";;;;;;;;;;;AAgEA;AACA;AACA;AACA;AACA,IAAMA,WAA6E,GAAG,SAAhFA,WAA6EA,CAAAC,IAAA,EAoBjFC,GAAG,EACA;AAAA,EAAA,IAnBDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAAC,SAAA,GAAAJ,IAAA,CACPK,IAAI;AAAJA,IAAAA,IAAI,GAAA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BC,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAAA,EACvBU,sBAAsB,CAACP,IAAI,CAAC,CACjC,CAAC,CAAA;AAEN,CAAC,CAAA;AAED,IAAMQ,UAAU,gBAAGC,cAAK,CAACC,UAAU,CAAC/B,WAAW;;;;"}
1
+ {"version":3,"file":"IconButton.js","sources":["../../../../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledIconButton from './StyledIconButton';\nimport type { IconComponent } from '~components/Icons';\nimport type { BladeElementRef, DataAnalyticsAttribute } from '~utils/types';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { Platform } from '~utils';\nimport type { SubtleOrIntense } from '~tokens/theme/theme';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\n\ntype IconButtonProps = {\n /**\n * Icon component to be rendered, eg. `CloseIcon`\n */\n icon: IconComponent;\n\n /**\n * Icon size\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Icon contrast\n *\n * @default 'intense'\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Sets aria-label to help users know what the action does, eg 'Dismiss alert'\n */\n accessibilityLabel: string;\n\n /**\n * Disabled state for IconButton\n */\n isDisabled?: boolean;\n\n /**\n * Sets tabindex property on button element\n */\n _tabIndex?: number;\n} & DataAnalyticsAttribute &\n BladeCommonEvents &\n StyledPropsBlade &\n Platform.Select<{\n web: {\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * This changes the hover interaction to highlight icon more\n *\n * **Only available on web currently**\n */\n isHighlighted?: boolean;\n };\n native: {\n onClick: (event: GestureResponderEvent) => void;\n isHighlighted?: undefined;\n };\n }>;\n\n/**\n * Component for making clickable icons with transparent background.\n * For other cases please use `Button` component with `icon` prop.\n */\nconst _IconButton: React.ForwardRefRenderFunction<BladeElementRef, IconButtonProps> = (\n {\n icon,\n onClick,\n size = 'medium',\n emphasis = 'intense',\n accessibilityLabel,\n isDisabled,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchEnd,\n onTouchStart,\n isHighlighted,\n _tabIndex,\n ...rest\n },\n ref,\n) => {\n return (\n <StyledIconButton\n ref={ref as any}\n onClick={onClick}\n emphasis={emphasis}\n size={size}\n icon={icon}\n tabIndex={_tabIndex}\n accessibilityLabel={accessibilityLabel}\n isDisabled={isDisabled}\n isHighlighted={isHighlighted}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchEnd={onTouchEnd}\n onTouchStart={onTouchStart}\n {...makeAnalyticsAttribute(rest)}\n {...rest}\n />\n );\n};\n\nconst IconButton = React.forwardRef(_IconButton);\n\nexport type { IconButtonProps };\nexport { IconButton };\n"],"names":["_IconButton","_ref","ref","icon","onClick","_ref$size","size","_ref$emphasis","emphasis","accessibilityLabel","isDisabled","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchEnd","onTouchStart","isHighlighted","_tabIndex","rest","_objectWithoutProperties","_excluded","_jsx","StyledIconButton","_objectSpread","tabIndex","makeAnalyticsAttribute","IconButton","React","forwardRef"],"mappings":";;;;;;;;;;;AAkEA;AACA;AACA;AACA;AACA,IAAMA,WAA6E,GAAG,SAAhFA,WAA6EA,CAAAC,IAAA,EAoBjFC,GAAG,EACA;AAAA,EAAA,IAnBDC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAAC,SAAA,GAAAJ,I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AY,EAAEA,YAAa;AAC3BC,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,YAAY,EAAEA,YAAAA;AAAa,GAAA,EACvBU,sBAAsB,CAACP,IAAI,CAAC,CAC5BA,EAAAA,IAAI,CACT,CAAC,CAAA;AAEN,CAAC,CAAA;AAED,IAAMQ,UAAU,gBAAGC,cAAK,CAACC,UAAU,CAAC/B,WAAW;;;;"}
@@ -11,7 +11,9 @@ import '../../../utils/getFocusRingStyles/index.js';
11
11
  import '../../../utils/logger/index.js';
12
12
  import getIn from '../../../utils/lodashButBetter/get.js';
13
13
  import '../../../utils/makeAnalyticsAttribute/index.js';
14
+ import '../../Box/styledProps/index.js';
14
15
  import { jsx } from 'react/jsx-runtime';
16
+ import { useStyledProps } from '../../Box/styledProps/useStyledProps.js';
15
17
  import { throwBladeError } from '../../../utils/logger/logger.js';
16
18
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
17
19
  import { castWebType } from '../../../utils/platform/castUtils.js';
@@ -32,6 +34,7 @@ var StyledButton = /*#__PURE__*/styled.button.withConfig({
32
34
  var theme = props.theme,
33
35
  emphasis = props.emphasis;
34
36
  var motionToken = theme.motion;
37
+ var styledPropsCSSObject = useStyledProps(props);
35
38
  var emphasisColor = emphasis === 'intense' ? 'gray' : 'staticWhite';
36
39
  if (false) {
37
40
  if (props.$size === 'large' && props.$isHighlighted) {
@@ -42,7 +45,7 @@ var StyledButton = /*#__PURE__*/styled.button.withConfig({
42
45
  return null;
43
46
  }
44
47
  }
45
- return {
48
+ return _objectSpread({
46
49
  border: 'none',
47
50
  cursor: props.disabled ? 'not-allowed' : 'pointer',
48
51
  padding: 0,
@@ -71,7 +74,7 @@ var StyledButton = /*#__PURE__*/styled.button.withConfig({
71
74
  '&:active': {
72
75
  color: theme.colors.interactive.icon[emphasisColor].subtle
73
76
  }
74
- };
77
+ }, styledPropsCSSObject);
75
78
  });
76
79
  var StyledIconButton = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
77
80
  var Icon = _ref.icon,
@@ -92,7 +95,7 @@ var StyledIconButton = /*#__PURE__*/React__default.forwardRef(function (_ref, re
92
95
  onTouchStart = _ref.onTouchStart,
93
96
  tabIndex = _ref.tabIndex,
94
97
  rest = _objectWithoutProperties(_ref, _excluded);
95
- return /*#__PURE__*/jsx(StyledButton, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
98
+ return /*#__PURE__*/jsx(StyledButton, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
96
99
  ref: ref,
97
100
  onClick: castWebType(onClick),
98
101
  emphasis: emphasis,
@@ -114,7 +117,7 @@ var StyledIconButton = /*#__PURE__*/React__default.forwardRef(function (_ref, re
114
117
  })), metaAttribute({
115
118
  name: MetaConstants.IconButton,
116
119
  testID: testID
117
- })), makeAnalyticsAttribute(rest)), {}, {
120
+ })), makeAnalyticsAttribute(rest)), rest), {}, {
118
121
  children: /*#__PURE__*/jsx(Icon, {
119
122
  size: size,
120
123
  color: isDisabled ? 'interactive.icon.gray.disabled' : 'currentColor'
@@ -1 +1 @@
1
- {"version":3,"file":"StyledIconButton.web.js","sources":["../../../../../../../src/components/Button/IconButton/StyledIconButton.web.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport styled from 'styled-components';\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport type { StyledIconButtonProps } from './types';\nimport { highlightedButtonSizeMap, highlightedHoverColorMap } from './tokens';\nimport { castWebType, makeSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { SubtleOrIntense } from '~tokens/theme/theme';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport { throwBladeError } from '~utils/logger';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype StyledButtonProps = {\n emphasis: SubtleOrIntense;\n $isHighlighted: StyledIconButtonProps['isHighlighted'];\n $size: StyledIconButtonProps['size'];\n};\n\nconst StyledButton = styled.button<StyledButtonProps>((props) => {\n const { theme, emphasis } = props;\n const motionToken = theme.motion;\n\n const emphasisColor = emphasis === 'intense' ? 'gray' : 'staticWhite';\n\n if (__DEV__) {\n if (props.$size === 'large' && props.$isHighlighted) {\n throwBladeError({\n moduleName: 'IconButton',\n message: 'size large is not allowed with isHighlighted true',\n });\n return null;\n }\n }\n\n return {\n border: 'none',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n padding: 0,\n height: props.$isHighlighted\n ? // We throw error for size large on top\n makeSize(highlightedButtonSizeMap[props.$size as 'small' | 'medium'])\n : undefined,\n width: props.$isHighlighted\n ? makeSize(highlightedButtonSizeMap[props.$size as 'small' | 'medium'])\n : undefined,\n borderRadius: props.$isHighlighted ? theme.border.radius.round : theme.border.radius.small,\n background: 'transparent',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: props.disabled\n ? theme.colors.interactive.icon[emphasisColor].disabled\n : theme.colors.interactive.icon[emphasisColor].muted,\n transitionProperty: 'color, box-shadow',\n transitionDuration: castWebType(makeMotionTime(motionToken.duration.xquick)),\n transitionTimingFunction: motionToken.easing.standard as string,\n\n '&:hover:not([disabled])': {\n color: theme.colors.interactive.icon[emphasisColor].subtle,\n backgroundColor: props.$isHighlighted\n ? getIn(theme.colors, highlightedHoverColorMap[emphasis])\n : 'transparent',\n },\n\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n color: theme.colors.interactive.icon[emphasisColor].subtle,\n },\n\n '&:active': {\n color: theme.colors.interactive.icon[emphasisColor].subtle,\n },\n };\n});\n\nconst StyledIconButton = React.forwardRef<HTMLButtonElement, StyledIconButtonProps>(\n (\n {\n icon: Icon,\n onClick,\n size,\n emphasis,\n accessibilityLabel,\n isDisabled,\n isHighlighted,\n testID,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchEnd,\n onTouchStart,\n tabIndex,\n ...rest\n },\n ref,\n ): ReactElement => (\n <StyledButton\n ref={ref}\n onClick={castWebType(onClick)}\n emphasis={emphasis}\n type=\"button\"\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchEnd={onTouchEnd}\n onTouchStart={onTouchStart}\n disabled={isDisabled}\n $isHighlighted={isHighlighted}\n $size={size}\n tabIndex={tabIndex}\n {...makeAccessible({ label: accessibilityLabel })}\n {...metaAttribute({ name: MetaConstants.IconButton, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <Icon size={size} color={isDisabled ? 'interactive.icon.gray.disabled' : 'currentColor'} />\n </StyledButton>\n ),\n);\n\nexport default StyledIconButton;\n"],"names":["StyledButton","styled","button","withConfig","displayName","componentId","props","theme","emphasis","motionToken","motion","emphasisColor","$size","$isHighlighted","throwBladeError","moduleName","message","border","cursor","disabled","padding","height","makeSize","highlightedButtonSizeMap","undefined","width","borderRadius","radius","round","small","background","display","alignItems","justifyContent","color","colors","interactive","icon","muted","transitionProperty","transitionDuration","castWebType","makeMotionTime","duration","xquick","transitionTimingFunction","easing","standard","subtle","backgroundColor","getIn","highlightedHoverColorMap","_objectSpread","getFocusRingStyles","StyledIconButton","React","forwardRef","_ref","ref","Icon","onClick","size","accessibilityLabel","isDisabled","isHighlighted","testID","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchEnd","onTouchStart","tabIndex","rest","_objectWithoutProperties","_excluded","_jsx","type","makeAccessible","label","metaAttribute","name","MetaConstants","IconButton","makeAnalyticsAttribute","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAMA,YAAY,gBAAGC,MAAM,CAAC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AAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BtD,IAAAA,QAAQ,EAAE4C,UAAW;AACrBlD,IAAAA,cAAc,EAAEmD,aAAc;AAC9BpD,IAAAA,KAAK,EAAEiD,IAAK;AACZa,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,EACfM,cAAc,CAAC;AAAEC,IAAAA,KAAK,EAAEnB,kBAAAA;GAAoB,CAAC,CAC7CoB,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAEC,aAAa,CAACC,UAAU;AAAEpB,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EACzDqB,sBAAsB,CAACX,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;IAAAY,QAAA,eAEhCT,GAAA,CAACnB,IAAI,EAAA;AAACE,MAAAA,IAAI,EAAEA,IAAK;AAAC3B,MAAAA,KAAK,EAAE6B,UAAU,GAAG,gCAAgC,GAAG,cAAA;KAAiB,CAAA;AAAC,GAAA,CAC/E,CAAC,CAAA;AAAA,CAEnB;;;;"}
1
+ {"version":3,"file":"StyledIconButton.web.js","sources":["../../../../../../../src/components/Button/IconButton/StyledIconButton.web.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport styled from 'styled-components';\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport type { StyledIconButtonProps } from './types';\nimport { highlightedButtonSizeMap, highlightedHoverColorMap } from './tokens';\nimport { castWebType, makeSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { SubtleOrIntense } from '~tokens/theme/theme';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport { throwBladeError } from '~utils/logger';\nimport getIn from '~utils/lodashButBetter/get';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useStyledProps } from '~components/Box/styledProps';\n\ntype StyledButtonProps = {\n emphasis: SubtleOrIntense;\n $isHighlighted: StyledIconButtonProps['isHighlighted'];\n $size: StyledIconButtonProps['size'];\n};\n\nconst StyledButton = styled.button<StyledButtonProps>((props) => {\n const { theme, emphasis } = props;\n const motionToken = theme.motion;\n const styledPropsCSSObject = useStyledProps(props);\n const emphasisColor = emphasis === 'intense' ? 'gray' : 'staticWhite';\n\n if (__DEV__) {\n if (props.$size === 'large' && props.$isHighlighted) {\n throwBladeError({\n moduleName: 'IconButton',\n message: 'size large is not allowed with isHighlighted true',\n });\n return null;\n }\n }\n\n return {\n border: 'none',\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n padding: 0,\n height: props.$isHighlighted\n ? // We throw error for size large on top\n makeSize(highlightedButtonSizeMap[props.$size as 'small' | 'medium'])\n : undefined,\n width: props.$isHighlighted\n ? makeSize(highlightedButtonSizeMap[props.$size as 'small' | 'medium'])\n : undefined,\n borderRadius: props.$isHighlighted ? theme.border.radius.round : theme.border.radius.small,\n background: 'transparent',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: props.disabled\n ? theme.colors.interactive.icon[emphasisColor].disabled\n : theme.colors.interactive.icon[emphasisColor].muted,\n transitionProperty: 'color, box-shadow',\n transitionDuration: castWebType(makeMotionTime(motionToken.duration.xquick)),\n transitionTimingFunction: motionToken.easing.standard as string,\n\n '&:hover:not([disabled])': {\n color: theme.colors.interactive.icon[emphasisColor].subtle,\n backgroundColor: props.$isHighlighted\n ? getIn(theme.colors, highlightedHoverColorMap[emphasis])\n : 'transparent',\n },\n\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n color: theme.colors.interactive.icon[emphasisColor].subtle,\n },\n\n '&:active': {\n color: theme.colors.interactive.icon[emphasisColor].subtle,\n },\n ...styledPropsCSSObject,\n };\n});\n\nconst StyledIconButton = React.forwardRef<HTMLButtonElement, StyledIconButtonProps>(\n (\n {\n icon: Icon,\n onClick,\n size,\n emphasis,\n accessibilityLabel,\n isDisabled,\n isHighlighted,\n testID,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchEnd,\n onTouchStart,\n tabIndex,\n ...rest\n },\n ref,\n ): ReactElement => (\n <StyledButton\n ref={ref}\n onClick={castWebType(onClick)}\n emphasis={emphasis}\n type=\"button\"\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchEnd={onTouchEnd}\n onTouchStart={onTouchStart}\n disabled={isDisabled}\n $isHighlighted={isHighlighted}\n $size={size}\n tabIndex={tabIndex}\n {...makeAccessible({ label: accessibilityLabel })}\n {...metaAttribute({ name: MetaConstants.IconButton, testID })}\n {...makeAnalyticsAttribute(rest)}\n {...rest}\n >\n <Icon size={size} color={isDisabled ? 'interactive.icon.gray.disabled' : 'currentColor'} />\n </StyledButton>\n ),\n);\n\nexport default StyledIconButton;\n"],"names":["StyledButton","styled","button","withConfig","displayName","componentId","props","theme","emphasis","motionToken","motion","styledPropsCSSObject","useStyledProps","emphasisColor","$size","$isHighlighted","throwBladeError","moduleName","message","_objectSpread","border","cursor","disabled","padding","height","makeSize","highlightedButtonSizeMap","undefined","width","borderRadius","radius","round","small","background","display","alignItems","justifyContent","color","colors","interactive","icon","muted","transitionProperty","transitionDuration","castWebType","makeMotionTime","duration","xquick","transitionTimingFunction","easing","standard","subtle","backgroundColor","getIn","highlightedHoverColorMap","getFocusRingStyles","StyledIconButton","React","forwardRef","_ref","ref","Icon","onClick","size","accessibilityLabel","isDisabled","isHighlighted","testID","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchEnd","onTouchStart","tabIndex","rest","_objectWithoutProperties","_excluded","_jsx","type","makeAccessible","label","metaAttribute","name","MetaConstants","IconButton","makeAnalytic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O,CAAE;AAC9BtD,IAAAA,QAAQ,EAAEA,QAAS;AACnByE,IAAAA,IAAI,EAAC,QAAQ;AACbb,IAAAA,MAAM,EAAEA,MAAO;AACfC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BrD,IAAAA,QAAQ,EAAE2C,UAAW;AACrBlD,IAAAA,cAAc,EAAEmD,aAAc;AAC9BpD,IAAAA,KAAK,EAAEiD,IAAK;AACZa,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,EACfM,cAAc,CAAC;AAAEC,IAAAA,KAAK,EAAEnB,kBAAAA;GAAoB,CAAC,CAC7CoB,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAEC,aAAa,CAACC,UAAU;AAAEpB,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CACzDqB,EAAAA,sBAAsB,CAACX,IAAI,CAAC,GAC5BA,IAAI,CAAA,EAAA,EAAA,EAAA;IAAAY,QAAA,eAERT,GAAA,CAACnB,IAAI,EAAA;AAACE,MAAAA,IAAI,EAAEA,IAAK;AAAC1B,MAAAA,KAAK,EAAE4B,UAAU,GAAG,gCAAgC,GAAG,cAAA;KAAiB,CAAA;AAAC,GAAA,CAC/E,CAAC,CAAA;AAAA,CAEnB;;;;"}
@@ -11,18 +11,16 @@ import '../../utils/assignWithoutSideEffects/index.js';
11
11
  import '../../utils/index.js';
12
12
  import getIn from '../../utils/lodashButBetter/get.js';
13
13
  import { getBackgroundColorToken } from '../Button/BaseButton/BaseButton.js';
14
- import '../../utils/logger/index.js';
15
- import '../../utils/isValidAllowedChildren/index.js';
16
14
  import '../../utils/makeAnalyticsAttribute/index.js';
15
+ import '../../utils/useVerifyAllowedChildren/index.js';
17
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
18
17
  import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
19
18
  import { makeBorderSize } from '../../utils/makeBorderSize/makeBorderSize.js';
19
+ import { useVerifyAllowedChildren } from '../../utils/useVerifyAllowedChildren/useVerifyAllowedChildren.js';
20
20
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
21
21
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
22
22
  import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
23
23
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
24
- import { isValidAllowedChildren } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
25
- import { throwBladeError } from '../../utils/logger/logger.js';
26
24
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
27
25
 
28
26
  var _excluded = ["children", "isDisabled", "size", "color", "variant", "isFullWidth", "testID"];
@@ -86,6 +84,11 @@ var _ButtonGroup = function _ButtonGroup(_ref3, ref) {
86
84
  variant: variant,
87
85
  isFullWidth: isFullWidth
88
86
  };
87
+ useVerifyAllowedChildren({
88
+ allowedComponents: ['Button', 'Dropdown', 'Tooltip', 'Popover'],
89
+ componentName: 'ButtonGroup',
90
+ children: children
91
+ });
89
92
  return /*#__PURE__*/jsx(ButtonGroupProvider, {
90
93
  value: contextValue,
91
94
  children: /*#__PURE__*/jsx(StyledButtonGroup, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
@@ -100,19 +103,6 @@ var _ButtonGroup = function _ButtonGroup(_ref3, ref) {
100
103
  })), getStyledProps(rest)), makeAnalyticsAttribute(rest)), {}, {
101
104
  role: "group",
102
105
  children: React__default.Children.map(children, function (child, index) {
103
- if (false) {
104
- // throw error if child is not a button or dropdown with button trigger
105
- /* eslint-disable no-restricted-properties */
106
- if (!isValidAllowedChildren(child, 'Button') && !(isValidAllowedChildren(child, 'Dropdown') && child.props.children.some(function (c) {
107
- return isValidAllowedChildren(c, 'DropdownButton');
108
- }))) {
109
- throwBladeError({
110
- moduleName: 'ButtonGroup',
111
- message: "Only \"Button\" or \"Dropdown\" component with Button trigger are allowed as children."
112
- });
113
- }
114
- /* eslint-enable no-restricted-properties */
115
- }
116
106
  return /*#__PURE__*/jsxs(Fragment, {
117
107
  children: [child, React__default.Children.count(children) - 1 !== index && /*#__PURE__*/jsx(StyledDivider, {
118
108
  variant: variant,
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonGroup.web.js","sources":["../../../../../../src/components/ButtonGroup/ButtonGroup.web.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { ButtonGroupProps } from './types';\nimport { StyledButtonGroup } from './StyledButtonGroup';\nimport { ButtonGroupProvider } from './ButtonGroupContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeBorderSize } from '~utils';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport getIn from '~utils/lodashButBetter/get';\nimport { getBackgroundColorToken } from '~components/Button/BaseButton/BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport { throwBladeError } from '~utils/logger';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport type { BladeElementRef } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst getDividerColorToken = ({\n color,\n variant,\n isDisabled,\n}: Pick<ButtonGroupProps, 'color' | 'isDisabled' | 'variant'>): DotNotationToken<\n Theme['colors']\n> => {\n if (variant === 'primary') {\n return 'surface.border.gray.subtle';\n }\n\n if (variant === 'secondary') {\n return getBackgroundColorToken({\n property: 'border',\n variant,\n color,\n state: isDisabled ? 'disabled' : 'default',\n });\n }\n\n return 'surface.border.gray.muted';\n};\n\nconst StyledDivider = styled(BaseBox)<Pick<ButtonGroupProps, 'color' | 'isDisabled' | 'variant'>>(\n ({ theme, color, variant, isDisabled }) => {\n return {\n borderWidth: 0,\n borderLeftStyle: 'solid',\n borderLeftWidth: makeBorderSize(theme.border.width.thin),\n alignSelf: 'stretch',\n color: getIn(theme.colors, getDividerColorToken({ color, variant, isDisabled })),\n };\n },\n);\n\nconst _ButtonGroup = (\n {\n children,\n isDisabled = false,\n size = 'medium',\n color = 'primary',\n variant = 'primary',\n isFullWidth = false,\n testID,\n ...rest\n }: ButtonGroupProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const contextValue = {\n isDisabled,\n size,\n color,\n variant,\n isFullWidth,\n };\n\n return (\n <ButtonGroupProvider value={contextValue}>\n <StyledButtonGroup\n ref={ref as never}\n color={color}\n variant={variant}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n {...metaAttribute({ name: MetaConstants.ButtonGroup, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n role=\"group\"\n >\n {React.Children.map(children, (child, index) => {\n if (__DEV__) {\n // throw error if child is not a button or dropdown with button trigger\n /* eslint-disable no-restricted-properties */\n if (\n !isValidAllowedChildren(child, 'Button') &&\n !(\n isValidAllowedChildren(child, 'Dropdown') &&\n (child as ReactElement).props.children.some((c: ReactElement) =>\n isValidAllowedChildren(c, 'DropdownButton'),\n )\n )\n ) {\n throwBladeError({\n moduleName: 'ButtonGroup',\n message: `Only \"Button\" or \"Dropdown\" component with Button trigger are allowed as children.`,\n });\n }\n /* eslint-enable no-restricted-properties */\n }\n\n return (\n <>\n {child}\n {React.Children.count(children) - 1 !== index && (\n <StyledDivider variant={variant} color={color} isDisabled={isDisabled} />\n )}\n </>\n );\n })}\n </StyledButtonGroup>\n </ButtonGroupProvider>\n );\n};\n\n/**\n * ### ButtonGroup Component\n * \n * The ButtonGroup component is used to group related buttons together.\n * \n * ---\n * \n * #### Usage\n * \n * ```jsx\n const App = () => {\n return (\n <ButtonGroup>\n <Button icon={RefreshIcon}>Sync</Button>\n <Button icon={ShareIcon}>Share</Button>\n <Button icon={DownloadIcon}>Download</Button>\n </ButtonGroup>\n );\n }\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-buttongroup FileUpload Documentation}\n * \n */\nconst ButtonGroup = assignWithoutSideEffects(React.forwardRef(_ButtonGroup), {\n displayName: 'ButtonGroup',\n componentId: 'ButtonGroup',\n});\n\nexport { ButtonGroup };\nexport type { ButtonGroupProps };\n"],"names":["getDividerColorToken","_ref","color","variant","isDisabled","getBackgroundColorToken","property","state","StyledDivider","styled","BaseBox","withConfig","displayName","componentId","_ref2","theme","borderWidth","borderLeftStyle","borderLeftWidth","makeBorderSize","border","width","thin","alignSelf","getIn","colors","_ButtonGroup","_ref3","ref","children","_ref3$isDisabled","_ref3$size","size","_ref3$color","_ref3$variant","_ref3$isFullWidth","isFullWidth","testID","rest","_objectWithoutProperties","_excluded","contextValue","_jsx","ButtonGroupProvider","value","StyledButtonGroup","_objectSpread","metaAttribute","name","MetaConstants","ButtonGroup","getStyledProps","makeAnalyticsAttribute","role","React","Children","map","child","index","isValidAllowedChildren","props","some","c","throwBladeError","moduleName","message","_jsxs","_Fragment","count","assignWithoutSideEffects","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAMrB;AAAA,EAAA,IALHC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EAIV,IAAID,OAAO,KAAK,SAAS,EAAE;AACzB,IAAA,OAAO,4BAA4B,CAAA;AACrC,GAAA;EAEA,IAAIA,OAAO,KAAK,WAAW,EAAE;AAC3B,IAAA,OAAOE,uBAAuB,CAAC;AAC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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACM8C,IAAAA,WAAW,gBAAGmB,wBAAwB,eAACf,cAAK,CAACgB,UAAU,CAAC5C,YAAY,CAAC,EAAE;AAC3Ed,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,WAAW,EAAE,aAAA;AACf,CAAC;;;;"}
1
+ {"version":3,"file":"ButtonGroup.web.js","sources":["../../../../../../src/components/ButtonGroup/ButtonGroup.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport type { ButtonGroupProps } from './types';\nimport { StyledButtonGroup } from './StyledButtonGroup';\nimport { ButtonGroupProvider } from './ButtonGroupContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeBorderSize } from '~utils';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\nimport getIn from '~utils/lodashButBetter/get';\nimport { getBackgroundColorToken } from '~components/Button/BaseButton/BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { BladeElementRef } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren';\n\nconst getDividerColorToken = ({\n color,\n variant,\n isDisabled,\n}: Pick<ButtonGroupProps, 'color' | 'isDisabled' | 'variant'>): DotNotationToken<\n Theme['colors']\n> => {\n if (variant === 'primary') {\n return 'surface.border.gray.subtle';\n }\n\n if (variant === 'secondary') {\n return getBackgroundColorToken({\n property: 'border',\n variant,\n color,\n state: isDisabled ? 'disabled' : 'default',\n });\n }\n\n return 'surface.border.gray.muted';\n};\n\nconst StyledDivider = styled(BaseBox)<Pick<ButtonGroupProps, 'color' | 'isDisabled' | 'variant'>>(\n ({ theme, color, variant, isDisabled }) => {\n return {\n borderWidth: 0,\n borderLeftStyle: 'solid',\n borderLeftWidth: makeBorderSize(theme.border.width.thin),\n alignSelf: 'stretch',\n color: getIn(theme.colors, getDividerColorToken({ color, variant, isDisabled })),\n };\n },\n);\n\nconst _ButtonGroup = (\n {\n children,\n isDisabled = false,\n size = 'medium',\n color = 'primary',\n variant = 'primary',\n isFullWidth = false,\n testID,\n ...rest\n }: ButtonGroupProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const contextValue = {\n isDisabled,\n size,\n color,\n variant,\n isFullWidth,\n };\n\n useVerifyAllowedChildren({\n allowedComponents: ['Button', 'Dropdown', 'Tooltip', 'Popover'],\n componentName: 'ButtonGroup',\n children,\n });\n\n return (\n <ButtonGroupProvider value={contextValue}>\n <StyledButtonGroup\n ref={ref as never}\n color={color}\n variant={variant}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n {...metaAttribute({ name: MetaConstants.ButtonGroup, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n role=\"group\"\n >\n {React.Children.map(children, (child, index) => {\n return (\n <>\n {child}\n {React.Children.count(children) - 1 !== index && (\n <StyledDivider variant={variant} color={color} isDisabled={isDisabled} />\n )}\n </>\n );\n })}\n </StyledButtonGroup>\n </ButtonGroupProvider>\n );\n};\n\n/**\n * ### ButtonGroup Component\n * \n * The ButtonGroup component is used to group related buttons together.\n * \n * ---\n * \n * #### Usage\n * \n * ```jsx\n const App = () => {\n return (\n <ButtonGroup>\n <Button icon={RefreshIcon}>Sync</Button>\n <Button icon={ShareIcon}>Share</Button>\n <Button icon={DownloadIcon}>Download</Button>\n </ButtonGroup>\n );\n }\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-buttongroup FileUpload Documentation}\n * \n */\nconst ButtonGroup = assignWithoutSideEffects(React.forwardRef(_ButtonGroup), {\n displayName: 'ButtonGroup',\n componentId: 'ButtonGroup',\n});\n\nexport { ButtonGroup };\nexport type { ButtonGroupProps };\n"],"names":["getDividerColorToken","_ref","color","variant","isDisabled","getBackgroundColorToken","property","state","StyledDivider","styled","BaseBox","withConfig","displayName","componentId","_ref2","theme","borderWidth","borderLeftStyle","borderLeftWidth","makeBorderSize","border","width","thin","alignSelf","getIn","colors","_ButtonGroup","_ref3","ref","children","_ref3$isDisabled","_ref3$size","size","_ref3$color","_ref3$variant","_ref3$isFullWidth","isFullWidth","testID","rest","_objectWithoutProperties","_excluded","contextValue","useVerifyAllowedChildren","allowedComponents","componentName","_jsx","ButtonGroupProvider","value","StyledButtonGroup","_objectSpread","metaAttribute","name","MetaConstants","ButtonGroup","getStyledProps","makeAnalyticsAttribute","role","React","Children","map","child","index","_jsxs","_Fragment","count","assignWithoutSideEffects","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAMrB;AAAA,EAAA,IALHC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,UAAU,GAAAH,IAAA,CAAVG,UAAU,CAAA;EAIV,IAAID,OAAO,KAAK,SAAS,EAAE;AACzB,IAAA,OAAO,4BAA4B,CAAA;AACrC,GAAA;EAEA,IAAIA,OAAO,KAAK,WAAW,EAAE;AAC3B,IAAA,OAAOE,uBAAuB,CAAC;AAC7BC,MAAAA,QAAQ,EAAE,QAAQ;AAClBH,MAAAA,OAAO,EAAPA,OAAO;AACPD,MAAAA,KAAK,EAALA,KAAK;AACLK,MAAAA,KAAK,EAAEH,UAAU,GAAG,UAAU,GAAG,SAAA;AACnC,KAAC,CAAC,CAAA;AACJ,GAAA;AAEA,EAAA,OAAO,2BAA2B,CAAA;AACpC,CAAC,CAAA;AAED,IAAMI,aAAa,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,+BAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAC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CkB,MAAAA,IAAI,EAAC,OAAO;AAAA3B,MAAAA,QAAA,EAEX4B,cAAK,CAACC,QAAQ,CAACC,GAAG,CAAC9B,QAAQ,EAAE,UAAC+B,KAAK,EAAEC,KAAK,EAAK;QAC9C,oBACEC,IAAA,CAAAC,QAAA,EAAA;AAAAlC,UAAAA,QAAA,GACG+B,KAAK,EACLH,cAAK,CAACC,QAAQ,CAACM,KAAK,CAACnC,QAAQ,CAAC,GAAG,CAAC,KAAKgC,KAAK,iBAC3ChB,GAAA,CAACrC,aAAa,EAAA;AAACL,YAAAA,OAAO,EAAEA,OAAQ;AAACD,YAAAA,KAAK,EAAEA,KAAM;AAACE,YAAAA,UAAU,EAAEA,UAAAA;AAAW,WAAE,CACzE,CAAA;AAAA,SACD,CAAC,CAAA;OAEN,CAAA;KACgB,CAAA,CAAA;AAAC,GACD,CAAC,CAAA;AAE1B,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;AACMiD,IAAAA,WAAW,gBAAGY,wBAAwB,eAACR,cAAK,CAACS,UAAU,CAACxC,YAAY,CAAC,EAAE;AAC3Ed,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,WAAW,EAAE,aAAA;AACf,CAAC;;;;"}
@@ -17,6 +17,7 @@ import '../../utils/metaAttribute/index.js';
17
17
  import { useId } from '../../utils/useId.js';
18
18
  import '../../utils/useVerifyAllowedChildren/index.js';
19
19
  import '../../utils/makeAnalyticsAttribute/index.js';
20
+ import { mergeRefs } from '../../utils/useMergeRefs.js';
20
21
  import { jsx, jsxs } from 'react/jsx-runtime';
21
22
  import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
22
23
  import { castWebType } from '../../utils/platform/castUtils.js';
@@ -63,7 +64,7 @@ var DrawerOverlay = /*#__PURE__*/styled(FloatingOverlay).withConfig({
63
64
  transition: "opacity ".concat(makeMotionTime(theme.motion.duration.gentle), " ").concat(castWebType(theme.motion.easing.entrance))
64
65
  });
65
66
  });
66
- var _Drawer = function _Drawer(_ref4) {
67
+ var _Drawer = function _Drawer(_ref4, ref) {
67
68
  var isOpen = _ref4.isOpen,
68
69
  onDismiss = _ref4.onDismiss,
69
70
  _ref4$zIndex = _ref4.zIndex,
@@ -161,7 +162,7 @@ var _Drawer = function _Drawer(_ref4) {
161
162
  testID: testID
162
163
  })), makeAnalyticsAttribute(rest)), {}, {
163
164
  zIndex: zIndexState,
164
- children: [showOverlay || stackingLevel === 2 ? /*#__PURE__*/jsx(DrawerOverlay, _objectSpread({
165
+ children: [showOverlay ? /*#__PURE__*/jsx(DrawerOverlay, _objectSpread({
165
166
  onClick: function onClick() {
166
167
  onDismiss();
167
168
  },
@@ -190,7 +191,7 @@ var _Drawer = function _Drawer(_ref4) {
190
191
  height: "100%",
191
192
  display: "flex",
192
193
  flexDirection: "column",
193
- ref: refs.setFloating,
194
+ ref: mergeRefs(ref, refs.setFloating),
194
195
  onKeyDown: function onKeyDown(event) {
195
196
  if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape' || (event === null || event === void 0 ? void 0 : event.code) === 'Escape') {
196
197
  onDismiss();
@@ -241,7 +242,8 @@ var _Drawer = function _Drawer(_ref4) {
241
242
  *
242
243
  *
243
244
  */
244
- var Drawer = /*#__PURE__*/assignWithoutSideEffects(_Drawer, {
245
+ var Drawer = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_Drawer), {
246
+ displayName: 'Drawer',
245
247
  componentId: drawerComponentIds.Drawer
246
248
  });
247
249