@razorpay/blade 12.20.0 → 12.21.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 (138) hide show
  1. package/build/lib/native/components/ActionList/ActionListItem.js +1 -1
  2. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  3. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -1
  4. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  5. package/build/lib/native/components/BottomSheet/BottomSheet.native.js +1 -1
  6. package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
  7. package/build/lib/native/components/BottomSheet/BottomSheetContext.js.map +1 -1
  8. package/build/lib/native/components/Collapsible/Collapsible.js +3 -1
  9. package/build/lib/native/components/Collapsible/Collapsible.js.map +1 -1
  10. package/build/lib/native/components/Collapsible/CollapsibleBody.js +2 -1
  11. package/build/lib/native/components/Collapsible/CollapsibleBody.js.map +1 -1
  12. package/build/lib/native/components/Collapsible/CollapsibleButton.js +2 -3
  13. package/build/lib/native/components/Collapsible/CollapsibleButton.js.map +1 -1
  14. package/build/lib/native/components/Collapsible/CollapsibleLink.js +2 -3
  15. package/build/lib/native/components/Collapsible/CollapsibleLink.js.map +1 -1
  16. package/build/lib/native/components/Collapsible/componentIds.js +4 -0
  17. package/build/lib/native/components/Collapsible/componentIds.js.map +1 -0
  18. package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
  19. package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
  20. package/build/lib/native/components/Dropdown/DropdownHeaderFooter.js +1 -1
  21. package/build/lib/native/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  22. package/build/lib/native/components/Dropdown/useDropdown.js +1 -1
  23. package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
  24. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  25. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  26. package/build/lib/native/components/Input/DropdownInputTriggers/AutoComplete.js +1 -1
  27. package/build/lib/native/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
  28. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +2 -1
  29. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  30. package/build/lib/web/development/components/ActionList/ActionListBox.web.js +3 -3
  31. package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
  32. package/build/lib/web/development/components/ActionList/ActionListItem.js +4 -4
  33. package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
  34. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +9 -2
  35. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  36. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +3 -3
  37. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  38. package/build/lib/web/development/components/BottomSheet/BottomSheetContext.js.map +1 -1
  39. package/build/lib/web/development/components/BottomSheet/BottomSheetHeader.web.js +1 -1
  40. package/build/lib/web/development/components/BottomSheet/BottomSheetHeader.web.js.map +1 -1
  41. package/build/lib/web/development/components/Collapsible/Collapsible.js +7 -2
  42. package/build/lib/web/development/components/Collapsible/Collapsible.js.map +1 -1
  43. package/build/lib/web/development/components/Collapsible/CollapsibleBody.js +2 -1
  44. package/build/lib/web/development/components/Collapsible/CollapsibleBody.js.map +1 -1
  45. package/build/lib/web/development/components/Collapsible/CollapsibleButton.js +2 -3
  46. package/build/lib/web/development/components/Collapsible/CollapsibleButton.js.map +1 -1
  47. package/build/lib/web/development/components/Collapsible/CollapsibleLink.js +2 -3
  48. package/build/lib/web/development/components/Collapsible/CollapsibleLink.js.map +1 -1
  49. package/build/lib/web/development/components/Collapsible/componentIds.js +9 -0
  50. package/build/lib/web/development/components/Collapsible/componentIds.js.map +1 -0
  51. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +6 -3
  52. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  53. package/build/lib/web/development/components/DatePicker/useDatesState.js +12 -1
  54. package/build/lib/web/development/components/DatePicker/useDatesState.js.map +1 -1
  55. package/build/lib/web/development/components/DatePicker/usePopup.js +5 -1
  56. package/build/lib/web/development/components/DatePicker/usePopup.js.map +1 -1
  57. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js +6 -3
  58. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  59. package/build/lib/web/development/components/Dropdown/Dropdown.js +8 -6
  60. package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
  61. package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js +18 -8
  62. package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  63. package/build/lib/web/development/components/Dropdown/useDropdown.js +16 -6
  64. package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
  65. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +7 -3
  66. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  67. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +5 -2
  68. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  69. package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js +11 -8
  70. package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
  71. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +24 -12
  72. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  73. package/build/lib/web/development/components/SideNav/SideNav.web.js +13 -2
  74. package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
  75. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js +1 -0
  76. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  77. package/build/lib/web/development/components/SideNav/SideNavLevel.web.js +4 -0
  78. package/build/lib/web/development/components/SideNav/SideNavLevel.web.js.map +1 -1
  79. package/build/lib/web/development/components/StepGroup/StepGroup.web.js +26 -4
  80. package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
  81. package/build/lib/web/development/components/StepGroup/StepItem.web.js +2 -1
  82. package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
  83. package/build/lib/web/production/components/ActionList/ActionListBox.web.js +3 -3
  84. package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
  85. package/build/lib/web/production/components/ActionList/ActionListItem.js +4 -4
  86. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  87. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +9 -2
  88. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  89. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +3 -3
  90. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  91. package/build/lib/web/production/components/BottomSheet/BottomSheetContext.js.map +1 -1
  92. package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js +1 -1
  93. package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js.map +1 -1
  94. package/build/lib/web/production/components/Collapsible/Collapsible.js +7 -2
  95. package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
  96. package/build/lib/web/production/components/Collapsible/CollapsibleBody.js +2 -1
  97. package/build/lib/web/production/components/Collapsible/CollapsibleBody.js.map +1 -1
  98. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js +2 -3
  99. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js.map +1 -1
  100. package/build/lib/web/production/components/Collapsible/CollapsibleLink.js +2 -3
  101. package/build/lib/web/production/components/Collapsible/CollapsibleLink.js.map +1 -1
  102. package/build/lib/web/production/components/Collapsible/componentIds.js +9 -0
  103. package/build/lib/web/production/components/Collapsible/componentIds.js.map +1 -0
  104. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +6 -3
  105. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  106. package/build/lib/web/production/components/DatePicker/useDatesState.js +12 -1
  107. package/build/lib/web/production/components/DatePicker/useDatesState.js.map +1 -1
  108. package/build/lib/web/production/components/DatePicker/usePopup.js +5 -1
  109. package/build/lib/web/production/components/DatePicker/usePopup.js.map +1 -1
  110. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +6 -3
  111. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  112. package/build/lib/web/production/components/Dropdown/Dropdown.js +8 -6
  113. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  114. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js +18 -8
  115. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  116. package/build/lib/web/production/components/Dropdown/useDropdown.js +16 -6
  117. package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
  118. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +7 -3
  119. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  120. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +5 -2
  121. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  122. package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js +11 -8
  123. package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
  124. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +24 -12
  125. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  126. package/build/lib/web/production/components/SideNav/SideNav.web.js +13 -2
  127. package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
  128. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js +1 -0
  129. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  130. package/build/lib/web/production/components/SideNav/SideNavLevel.web.js +4 -0
  131. package/build/lib/web/production/components/SideNav/SideNavLevel.web.js.map +1 -1
  132. package/build/lib/web/production/components/StepGroup/StepGroup.web.js +26 -4
  133. package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
  134. package/build/lib/web/production/components/StepGroup/StepItem.web.js +2 -1
  135. package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
  136. package/build/types/components/index.d.ts +20 -9
  137. package/build/types/components/index.native.d.ts +19 -8
  138. 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, 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":";;;;;;;;;;;;;;;;;;;;;;;;;;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D6L,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;;;;"}
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 = limit && !bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader;\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?.hasAutoCompleteInHeader,\n contentHeight,\n footerHeight,\n grabHandleHeight,\n headerHeight,\n ],\n );\n\n // locks the body scroll to prevent accidental scrolling of content when we drag the sheet\n // We are ready when we calculated the height of the content\n const isReady = contentHeight > 0;\n // only lock the body when we atleast have 1 bottomsheet open\n const shouldLock = isReady && stack.length > 0;\n const scrollLockRef = useScrollLock({\n enabled: shouldLock,\n targetRef: scrollRef,\n reserveScrollBarGap: true,\n });\n\n // clear all body locks to avoid memory leaks & accidental body locking\n React.useEffect(() => {\n const hasNoBottomSheets = stack.length < 1;\n if (hasNoBottomSheets) {\n clearAllBodyScrollLocks();\n }\n }, [stack]);\n\n // take the grabHandle's height into headerHeight too\n useIsomorphicLayoutEffect(() => {\n if (!grabHandleRef.current) return;\n setGrabHandleHeight(grabHandleRef.current.getBoundingClientRect().height);\n }, [grabHandleRef.current, _isOpen]);\n\n // if bottomSheet height is >35% & <50% then set initial snapPoint to 35%\n useIsomorphicLayoutEffect(() => {\n if (bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader) {\n initialSnapPoint.current = AUTOCOMPLETE_DEFAULT_SNAPPOINT;\n } else {\n const middleSnapPoint = snapPoints[1] * dimensions.height;\n const lowerSnapPoint = snapPoints[0] * dimensions.height;\n if (totalHeight > lowerSnapPoint && totalHeight < middleSnapPoint) {\n initialSnapPoint.current = snapPoints[0];\n }\n }\n }, [dimensions.height, snapPoints, totalHeight]);\n\n const returnFocus = React.useCallback(() => {\n if (!originalFocusElement.current) return;\n originalFocusElement.current.focus();\n // After returning focus we will clear the original focus\n // Because if sheet can be opened up via multiple triggers\n // We want to ensure the focus returns back to the most recent triggerer\n originalFocusElement.current = null;\n }, [originalFocusElement]);\n\n const focusOnInitialRef = React.useCallback(() => {\n if (!initialFocusRef) {\n // focus on close button\n defaultInitialFocusRef.current?.focus();\n } else {\n // focus on the initialRef passed by the user\n initialFocusRef.current?.focus();\n }\n }, [initialFocusRef]);\n\n // focus on the initial ref when the sheet is opened\n React.useLayoutEffect(() => {\n if (_isOpen) {\n focusOnInitialRef();\n }\n }, [_isOpen, focusOnInitialRef]);\n\n const handleOnOpen = React.useCallback(() => {\n setPositionY(dimensions.height * initialSnapPoint.current);\n scrollLockRef.current.activate();\n // initialize the original focused element\n // On first render it will be the activeElement, eg: the button trigger or select input\n // On Subsequent open operations it won't further update the original focus\n originalFocusElement.current =\n originalFocusElement.current ?? (document.activeElement as HTMLElement);\n }, [dimensions.height, scrollLockRef, setPositionY]);\n\n const handleOnClose = React.useCallback(() => {\n setPositionY(0);\n }, [setPositionY]);\n\n const close = React.useCallback(() => {\n 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","hasAutoCompleteInHeader","maxValue","computeMaxContent","maxHeight","isReady","shouldLock","scrollLockRef","useScrollLock","enabled","targetRef","reserveScrollBarGap","useEffect","hasNoBottomSheets","clearAllBodyScrollLocks","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","middleSnapPoint","lowerSnapPoint","returnFocus","focus","focusOnInitialRef","_defaultInitialFocusR","_initialFocusRef$curr","useLayoutEffect","handleOnOpen","_originalFocusElement","activate","document","activeElement","handleOnClose","close","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":";;;;;;;;;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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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetContext.js","sources":["../../../../../../src/components/BottomSheet/BottomSheetContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport React from 'react';\n\ntype BottomSheetContextProps = {\n headerHeight: number;\n contentHeight: number;\n footerHeight: number;\n isHeaderFloating: boolean;\n setContentHeight: React.Dispatch<React.SetStateAction<number>>;\n setHeaderHeight: React.Dispatch<React.SetStateAction<number>>;\n setFooterHeight: React.Dispatch<React.SetStateAction<number>>;\n setHasBodyPadding: React.Dispatch<React.SetStateAction<boolean>>;\n setIsHeaderEmpty: React.Dispatch<React.SetStateAction<boolean>>;\n /**\n * Closes the bottomsheet\n */\n close: () => void;\n /**\n * scrollRef is the ref to the BottomSheetBody's scrollable content\n *\n * We use this for two purposes:\n *\n * 1. Preventing the scrolling of the content, until the top snap point is reached\n * 2. We use it as the target for body scroll locking, so even when the body is locked this will remain scrollable\n */\n scrollRef: React.Ref<any>;\n /**\n * bind() function comes from useDrag hook\n * https://use-gesture.netlify.app/docs/gestures\n *\n * We spread this function's return values into the element which needs to be draggable\n */\n bind: ((...args: any[]) => ReactDOMAttributes) | null;\n /**\n * Indicates open state of bottomsheet\n */\n isOpen: boolean;\n /**\n * Vertical position of bottomsheet surface\n */\n positionY: number;\n /**\n * This flag is true whenever we access useBottomSheetContext inside BottomSheetContext provider\n */\n isInBottomSheet: boolean;\n /**\n * The element that will get focused when the bottomsheet first opens\n */\n defaultInitialFocusRef: React.MutableRefObject<any>;\n};\n\nconst BottomSheetContext = React.createContext<BottomSheetContextProps>({\n headerHeight: 0,\n contentHeight: 0,\n footerHeight: 0,\n isHeaderFloating: false,\n setContentHeight: () => {},\n setHeaderHeight: () => {},\n setFooterHeight: () => {},\n setHasBodyPadding: () => {},\n setIsHeaderEmpty: () => {},\n close: () => {},\n scrollRef: null,\n bind: null,\n isOpen: false,\n positionY: 0,\n isInBottomSheet: false,\n defaultInitialFocusRef: { current: null },\n});\n\nconst useBottomSheetContext = (): BottomSheetContextProps => {\n const state = React.useContext(BottomSheetContext);\n return state;\n};\n\ntype BottomSheetAndDropdownGlueContext = {\n isOpen: boolean;\n hasAutoCompleteInBottomSheetHeader: boolean;\n /**\n * This flag is true when <Dropdown> contains or renders <BottomSheet> inside of it\n * We can use this flag to alter behavior or styles of Dropdown\n */\n dropdownHasBottomSheet: boolean;\n /**\n * This is the setter for the flag, we set this flag to true inside <BottomSheet>\n */\n setDropdownHasBottomSheet: React.Dispatch<React.SetStateAction<boolean>>;\n onBottomSheetDismiss: () => void;\n} | null;\n\nconst BottomSheetAndDropdownGlueContext = React.createContext<BottomSheetAndDropdownGlueContext>(\n null,\n);\n\n/**\n * This hook provides the bridge between Dropdown And BottomSheet\n *\n * You can hover over the return types to get jsdoc and more information about each\n */\nconst useBottomSheetAndDropdownGlue = (): BottomSheetAndDropdownGlueContext => {\n const state = React.useContext(BottomSheetAndDropdownGlueContext);\n\n return state;\n};\n\nexport type { BottomSheetContextProps };\nexport {\n BottomSheetContext,\n useBottomSheetContext,\n BottomSheetAndDropdownGlueContext,\n useBottomSheetAndDropdownGlue,\n};\n"],"names":["BottomSheetContext","React","createContext","headerHeight","contentHeight","footerHeight","isHeaderFloating","setContentHeight","setHeaderHeight","setFooterHeight","setHasBodyPadding","setIsHeaderEmpty","close","scrollRef","bind","isOpen","positionY","isInBottomSheet","defaultInitialFocusRef","current","useBottomSheetContext","state","useContext","BottomSheetAndDropdownGlueContext","useBottomSheetAndDropdownGlue"],"mappings":";;AAAA;AACA;;AAoDA,IAAMA,kBAAkB,gBAAGC,cAAK,CAACC,aAAa,CAA0B;AACtEC,EAAAA,YAAY,EAAE,CAAC;AACfC,EAAAA,aAAa,EAAE,CAAC;AAChBC,EAAAA,YAAY,EAAE,CAAC;AACfC,EAAAA,gBAAgB,EAAE,KAAK;AACvBC,EAAAA,gBAAgB,EAAE,SAAAA,gBAAA,GAAM,EAAE;AAC1BC,EAAAA,eAAe,EAAE,SAAAA,eAAA,GAAM,EAAE;AACzBC,EAAAA,eAAe,EAAE,SAAAA,eAAA,GAAM,EAAE;AACzBC,EAAAA,iBAAiB,EAAE,SAAAA,iBAAA,GAAM,EAAE;AAC3BC,EAAAA,gBAAgB,EAAE,SAAAA,gBAAA,GAAM,EAAE;AAC1BC,EAAAA,KAAK,EAAE,SAAAA,KAAA,GAAM,EAAE;AACfC,EAAAA,SAAS,EAAE,IAAI;AACfC,EAAAA,IAAI,EAAE,IAAI;AACVC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,SAAS,EAAE,CAAC;AACZC,EAAAA,eAAe,EAAE,KAAK;AACtBC,EAAAA,sBAAsB,EAAE;AAAEC,IAAAA,OAAO,EAAE,IAAA;AAAK,GAAA;AAC1C,CAAC,EAAC;AAEF,IAAMC,qBAAqB,GAAG,SAAxBA,qBAAqBA,GAAkC;AAC3D,EAAA,IAAMC,KAAK,GAAGpB,cAAK,CAACqB,UAAU,CAACtB,kBAAkB,CAAC,CAAA;AAClD,EAAA,OAAOqB,KAAK,CAAA;AACd,EAAC;AAiBD,IAAME,iCAAiC,gBAAGtB,cAAK,CAACC,aAAa,CAC3D,IACF,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA,IAAMsB,6BAA6B,GAAG,SAAhCA,6BAA6BA,GAA4C;AAC7E,EAAA,IAAMH,KAAK,GAAGpB,cAAK,CAACqB,UAAU,CAACC,iCAAiC,CAAC,CAAA;AAEjE,EAAA,OAAOF,KAAK,CAAA;AACd;;;;"}
1
+ {"version":3,"file":"BottomSheetContext.js","sources":["../../../../../../src/components/BottomSheet/BottomSheetContext.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ReactDOMAttributes } from '@use-gesture/react/dist/declarations/src/types';\nimport React from 'react';\n\ntype BottomSheetContextProps = {\n headerHeight: number;\n contentHeight: number;\n footerHeight: number;\n isHeaderFloating: boolean;\n setContentHeight: React.Dispatch<React.SetStateAction<number>>;\n setHeaderHeight: React.Dispatch<React.SetStateAction<number>>;\n setFooterHeight: React.Dispatch<React.SetStateAction<number>>;\n setHasBodyPadding: React.Dispatch<React.SetStateAction<boolean>>;\n setIsHeaderEmpty: React.Dispatch<React.SetStateAction<boolean>>;\n /**\n * Closes the bottomsheet\n */\n close: () => void;\n /**\n * scrollRef is the ref to the BottomSheetBody's scrollable content\n *\n * We use this for two purposes:\n *\n * 1. Preventing the scrolling of the content, until the top snap point is reached\n * 2. We use it as the target for body scroll locking, so even when the body is locked this will remain scrollable\n */\n scrollRef: React.Ref<any>;\n /**\n * bind() function comes from useDrag hook\n * https://use-gesture.netlify.app/docs/gestures\n *\n * We spread this function's return values into the element which needs to be draggable\n */\n bind: ((...args: any[]) => ReactDOMAttributes) | null;\n /**\n * Indicates open state of bottomsheet\n */\n isOpen: boolean;\n /**\n * Vertical position of bottomsheet surface\n */\n positionY: number;\n /**\n * This flag is true whenever we access useBottomSheetContext inside BottomSheetContext provider\n */\n isInBottomSheet: boolean;\n /**\n * The element that will get focused when the bottomsheet first opens\n */\n defaultInitialFocusRef: React.MutableRefObject<any>;\n};\n\nconst BottomSheetContext = React.createContext<BottomSheetContextProps>({\n headerHeight: 0,\n contentHeight: 0,\n footerHeight: 0,\n isHeaderFloating: false,\n setContentHeight: () => {},\n setHeaderHeight: () => {},\n setFooterHeight: () => {},\n setHasBodyPadding: () => {},\n setIsHeaderEmpty: () => {},\n close: () => {},\n scrollRef: null,\n bind: null,\n isOpen: false,\n positionY: 0,\n isInBottomSheet: false,\n defaultInitialFocusRef: { current: null },\n});\n\nconst useBottomSheetContext = (): BottomSheetContextProps => {\n const state = React.useContext(BottomSheetContext);\n return state;\n};\n\ntype BottomSheetAndDropdownGlueContext = {\n isOpen: boolean;\n hasAutoCompleteInHeader: boolean;\n /**\n * This flag is true when <Dropdown> contains or renders <BottomSheet> inside of it\n * We can use this flag to alter behavior or styles of Dropdown\n */\n dropdownHasBottomSheet: boolean;\n /**\n * This is the setter for the flag, we set this flag to true inside <BottomSheet>\n */\n setDropdownHasBottomSheet: React.Dispatch<React.SetStateAction<boolean>>;\n onBottomSheetDismiss: () => void;\n} | null;\n\nconst BottomSheetAndDropdownGlueContext = React.createContext<BottomSheetAndDropdownGlueContext>(\n null,\n);\n\n/**\n * This hook provides the bridge between Dropdown And BottomSheet\n *\n * You can hover over the return types to get jsdoc and more information about each\n */\nconst useBottomSheetAndDropdownGlue = (): BottomSheetAndDropdownGlueContext => {\n const state = React.useContext(BottomSheetAndDropdownGlueContext);\n\n return state;\n};\n\nexport type { BottomSheetContextProps };\nexport {\n BottomSheetContext,\n useBottomSheetContext,\n BottomSheetAndDropdownGlueContext,\n useBottomSheetAndDropdownGlue,\n};\n"],"names":["BottomSheetContext","React","createContext","headerHeight","contentHeight","footerHeight","isHeaderFloating","setContentHeight","setHeaderHeight","setFooterHeight","setHasBodyPadding","setIsHeaderEmpty","close","scrollRef","bind","isOpen","positionY","isInBottomSheet","defaultInitialFocusRef","current","useBottomSheetContext","state","useContext","BottomSheetAndDropdownGlue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AAK,CAAA;AACd;;;;"}
@@ -67,7 +67,7 @@ var _BottomSheetHeader = function _BottomSheetHeader(_ref) {
67
67
  // we don't set focus on close button when it has AutoComplete inside.
68
68
  // We set focus on AutoComplete instead inside AutoComplete component
69
69
  ,
70
- closeButtonRef: bottomSheetAndDropdownGlue !== null && bottomSheetAndDropdownGlue !== void 0 && bottomSheetAndDropdownGlue.hasAutoCompleteInBottomSheetHeader ? undefined : defaultInitialFocusRef
70
+ closeButtonRef: bottomSheetAndDropdownGlue !== null && bottomSheetAndDropdownGlue !== void 0 && bottomSheetAndDropdownGlue.hasAutoCompleteInHeader ? undefined : defaultInitialFocusRef
71
71
  // back button
72
72
  ,
73
73
  showBackButton: showBackButton,
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheetHeader.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheetHeader.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport React from 'react';\nimport { ComponentIds } from './componentIds';\nimport { useBottomSheetAndDropdownGlue, useBottomSheetContext } from './BottomSheetContext';\nimport type { BottomSheetHeaderProps } from './types';\nimport { BottomSheetEmptyHeader } from './BottomSheetCommon';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _BottomSheetHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showBackButton = false,\n onBackButtonClick,\n children,\n ...dataAnalyticsProps\n}: BottomSheetHeaderProps): React.ReactElement => {\n const {\n setHeaderHeight,\n isOpen,\n close,\n bind,\n setIsHeaderEmpty,\n defaultInitialFocusRef,\n } = useBottomSheetContext();\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const ref = React.useRef<HTMLDivElement>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (!ref.current) return;\n setHeaderHeight(ref.current.getBoundingClientRect().height);\n }, [ref, isOpen]);\n\n const isHeaderEmpty = !(title || subtitle || leading || trailing || showBackButton || children);\n\n React.useEffect(() => {\n setIsHeaderEmpty(isHeaderEmpty);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isHeaderEmpty]);\n\n return (\n <BaseBox\n ref={ref}\n overflow={isHeaderEmpty ? 'visible' : 'auto'}\n flexShrink={0}\n {...metaAttribute({ name: MetaConstants.BottomSheetHeader })}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n {isHeaderEmpty ? (\n <BottomSheetEmptyHeader ref={defaultInitialFocusRef} />\n ) : (\n <BaseHeader\n title={title}\n subtitle={subtitle}\n leading={leading}\n trailing={trailing}\n titleSuffix={titleSuffix}\n // we don't set focus on close button when it has AutoComplete inside.\n // We set focus on AutoComplete instead inside AutoComplete component\n closeButtonRef={\n bottomSheetAndDropdownGlue?.hasAutoCompleteInBottomSheetHeader\n ? undefined\n : defaultInitialFocusRef\n }\n // back button\n showBackButton={showBackButton}\n onBackButtonClick={onBackButtonClick}\n // close button\n showCloseButton={true}\n onCloseButtonClick={close}\n {...bind?.()}\n >\n {children}\n </BaseHeader>\n )}\n </BaseBox>\n );\n};\n\nconst BottomSheetHeader = assignWithoutSideEffects(_BottomSheetHeader, {\n componentId: ComponentIds.BottomSheetHeader,\n});\n\nexport { BottomSheetHeader };\n"],"names":["_BottomSheetHeader","_ref","title","subtitle","leading","titleSuffix","trailing","_ref$showBackButton","showBackButton","onBackButtonClick","children","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useBottomSheetContex","useBottomSheetContext","setHeaderHeight","isOpen","close","bind","setIsHeaderEmpty","defaultInitialFocusRef","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","ref","React","useRef","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","isHeaderEmpty","useEffect","_jsx","BaseBox","_objectSpread","overflow","flexShrink","metaAttribute","name","MetaConstants","BottomSheetHeader","makeAnalyticsAttribute","BottomSheetEmptyHeader","BaseHeader","closeButtonRef","hasAutoCompleteInBottomSheetHeader","undefined","showCloseButton","onCloseButtonClick","assignWithoutSideEffects","componentId","ComponentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAU0B;AAAA,EAAA,IAThDC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAAC,mBAAA,GAAAN,IAAA,CACRO,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,mBAAA;IACtBE,iBAAiB,GAAAR,IAAA,CAAjBQ,iBAAiB;IACjBC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;AACLC,IAAAA,kBAAkB,GAAAC,wBAAA,CAAAX,IAAA,EAAAY,SAAA,CAAA,CAAA;AAErB,EAAA,IAAAC,qBAAA,GAOIC,qBAAqB,EAAE;IANzBC,eAAe,GAAAF,qBAAA,CAAfE,eAAe;IACfC,MAAM,GAAAH,qBAAA,CAANG,MAAM;IACNC,KAAK,GAAAJ,qBAAA,CAALI,KAAK;IACLC,IAAI,GAAAL,qBAAA,CAAJK,IAAI;IACJC,gBAAgB,GAAAN,qBAAA,CAAhBM,gBAAgB;IAChBC,sBAAsB,GAAAP,qBAAA,CAAtBO,sBAAsB,CAAA;AAExB,EAAA,IAAMC,0BAA0B,GAAGC,6BAA6B,EAAE,CAAA;AAClE,EAAA,IAAMC,GAAG,GAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC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AAA;MACAwC,cAAc,EACZvB,0BAA0B,KAAA,IAAA,IAA1BA,0BAA0B,KAAA,KAAA,CAAA,IAA1BA,0BAA0B,CAAEwB,kCAAkC,GAC1DC,SAAS,GACT1B,sBAAAA;AAEN;AAAA;AACAb,MAAAA,cAAc,EAAEA,cAAe;AAC/BC,MAAAA,iBAAiB,EAAEA,iBAAAA;AACnB;AAAA;AACAuC,MAAAA,eAAe,EAAE,IAAK;AACtBC,MAAAA,kBAAkB,EAAE/B,KAAAA;AAAM,KAAA,EACtBC,IAAI,KAAJA,IAAAA,IAAAA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,IAAI,EAAI,CAAA,EAAA,EAAA,EAAA;AAAAT,MAAAA,QAAA,EAEXA,QAAAA;KACS,CAAA,CAAA;AACb,GAAA,CACM,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAM+B,iBAAiB,gBAAGS,wBAAwB,CAAClD,kBAAkB,EAAE;EACrEmD,WAAW,EAAEC,YAAY,CAACX,iBAAAA;AAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"BottomSheetHeader.web.js","sources":["../../../../../../src/components/BottomSheet/BottomSheetHeader.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport React from 'react';\nimport { ComponentIds } from './componentIds';\nimport { useBottomSheetAndDropdownGlue, useBottomSheetContext } from './BottomSheetContext';\nimport type { BottomSheetHeaderProps } from './types';\nimport { BottomSheetEmptyHeader } from './BottomSheetCommon';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _BottomSheetHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n showBackButton = false,\n onBackButtonClick,\n children,\n ...dataAnalyticsProps\n}: BottomSheetHeaderProps): React.ReactElement => {\n const {\n setHeaderHeight,\n isOpen,\n close,\n bind,\n setIsHeaderEmpty,\n defaultInitialFocusRef,\n } = useBottomSheetContext();\n const bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();\n const ref = React.useRef<HTMLDivElement>(null);\n\n useIsomorphicLayoutEffect(() => {\n if (!ref.current) return;\n setHeaderHeight(ref.current.getBoundingClientRect().height);\n }, [ref, isOpen]);\n\n const isHeaderEmpty = !(title || subtitle || leading || trailing || showBackButton || children);\n\n React.useEffect(() => {\n setIsHeaderEmpty(isHeaderEmpty);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isHeaderEmpty]);\n\n return (\n <BaseBox\n ref={ref}\n overflow={isHeaderEmpty ? 'visible' : 'auto'}\n flexShrink={0}\n {...metaAttribute({ name: MetaConstants.BottomSheetHeader })}\n {...makeAnalyticsAttribute(dataAnalyticsProps)}\n >\n {isHeaderEmpty ? (\n <BottomSheetEmptyHeader ref={defaultInitialFocusRef} />\n ) : (\n <BaseHeader\n title={title}\n subtitle={subtitle}\n leading={leading}\n trailing={trailing}\n titleSuffix={titleSuffix}\n // we don't set focus on close button when it has AutoComplete inside.\n // We set focus on AutoComplete instead inside AutoComplete component\n closeButtonRef={\n bottomSheetAndDropdownGlue?.hasAutoCompleteInHeader ? undefined : defaultInitialFocusRef\n }\n // back button\n showBackButton={showBackButton}\n onBackButtonClick={onBackButtonClick}\n // close button\n showCloseButton={true}\n onCloseButtonClick={close}\n {...bind?.()}\n >\n {children}\n </BaseHeader>\n )}\n </BaseBox>\n );\n};\n\nconst BottomSheetHeader = assignWithoutSideEffects(_BottomSheetHeader, {\n componentId: ComponentIds.BottomSheetHeader,\n});\n\nexport { BottomSheetHeader };\n"],"names":["_BottomSheetHeader","_ref","title","subtitle","leading","titleSuffix","trailing","_ref$showBackButton","showBackButton","onBackButtonClick","children","dataAnalyticsProps","_objectWithoutProperties","_excluded","_useBottomSheetContex","useBottomSheetContext","setHeaderHeight","isOpen","close","bind","setIsHeaderEmpty","defaultInitialFocusRef","bottomSheetAndDropdownGlue","useBottomSheetAndDropdownGlue","ref","React","useRef","useIsomorphicLayoutEffect","current","getBoundingClientRect","height","isHeaderEmpty","useEffect","_jsx","BaseBox","_objectSpread","overflow","flexShrink","metaAttribute","name","MetaConstants","BottomSheetHeader","makeAnalyticsAttribute","BottomSheetEmptyHeader","BaseHeader","closeButtonRef","hasAutoCompleteInHeader","undefined","showCloseButton","onCloseButtonClick","assignWithoutSideEffects","componentId","ComponentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAU0B;AAAA,EAAA,IAThDC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IAAAC,mBAAA,GAAAN,IAAA,CACRO,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,mBAAA;IACtBE,iBAAiB,GAAAR,IAAA,CAAjBQ,iBAAiB;IACjBC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;AACLC,IAAAA,kBAAkB,GAAAC,wBAAA,CAAAX,IAAA,EAAAY,SAAA,CAAA,CAAA;AAErB,EAAA,IAAAC,qBAAA,GAOIC,qBAAqB,EAAE;IANzBC,eAAe,GAAAF,qBAAA,CAAfE,eAAe;IACfC,MAAM,GAAAH,qBAAA,CAANG,MAAM;IACNC,KAAK,GAAAJ,qBAAA,CAALI,KAAK;IACLC,IAAI,GAAAL,qBAAA,CAAJK,IAAI;IACJC,gBAAgB,GAAAN,qBAAA,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AAA,CAAA;AACTjC,MAAAA,KAAK,EAAEA,KAAM;AACbC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,OAAO,EAAEA,OAAQ;AACjBE,MAAAA,QAAQ,EAAEA,QAAS;AACnBD,MAAAA,WAAW,EAAEA,WAAAA;AACb;AACA;AAAA;MACAwC,cAAc,EACZvB,0BAA0B,KAAA,IAAA,IAA1BA,0BAA0B,KAAA,KAAA,CAAA,IAA1BA,0BAA0B,CAAEwB,uBAAuB,GAAGC,SAAS,GAAG1B,sBAAAA;AAEpE;AAAA;AACAb,MAAAA,cAAc,EAAEA,cAAe;AAC/BC,MAAAA,iBAAiB,EAAEA,iBAAAA;AACnB;AAAA;AACAuC,MAAAA,eAAe,EAAE,IAAK;AACtBC,MAAAA,kBAAkB,EAAE/B,KAAAA;AAAM,KAAA,EACtBC,IAAI,KAAJA,IAAAA,IAAAA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,IAAI,EAAI,CAAA,EAAA,EAAA,EAAA;AAAAT,MAAAA,QAAA,EAEXA,QAAAA;KACS,CAAA,CAAA;AACb,GAAA,CACM,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAM+B,iBAAiB,gBAAGS,wBAAwB,CAAClD,kBAAkB,EAAE;EACrEmD,WAAW,EAAEC,YAAY,CAACX,iBAAAA;AAC5B,CAAC;;;;"}
@@ -4,6 +4,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
4
4
  import { useState, useRef, useCallback, useMemo, Children, forwardRef } from 'react';
5
5
  import { CollapsibleContext } from './CollapsibleContext.js';
6
6
  import { MAX_WIDTH, MAX_WIDTH_NO_RESTRICTIONS } from './styles.web.js';
7
+ import { componentIds } from './componentIds.js';
7
8
  import '../Box/BaseBox/index.js';
8
9
  import '../Box/styledProps/index.js';
9
10
  import '../../utils/index.js';
@@ -13,6 +14,7 @@ import { useId } from '../../utils/useId.js';
13
14
  import '../../utils/isValidAllowedChildren/index.js';
14
15
  import '../../utils/logger/index.js';
15
16
  import '../../utils/makeAnalyticsAttribute/index.js';
17
+ import '../../utils/assignWithoutSideEffects/index.js';
16
18
  import { jsx } from 'react/jsx-runtime';
17
19
  import { makeSize } from '../../utils/makeSize/makeSize.js';
18
20
  import { size } from '../../tokens/global/size.js';
@@ -23,6 +25,7 @@ import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
23
25
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
24
26
  import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
25
27
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
28
+ import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
26
29
 
27
30
  var _excluded = ["children", "direction", "defaultIsExpanded", "isExpanded", "onExpandChange", "testID", "_shouldApplyWidthRestrictions", "_dangerouslyDisableValidations"];
28
31
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -79,7 +82,7 @@ var _Collapsible = function _Collapsible(_ref, ref) {
79
82
  }, [isBodyExpanded, direction, handleExpandChange, isExpanded, collapsibleBodyId]);
80
83
  if (false) {
81
84
  Children.forEach(children, function (child) {
82
- if (!(isValidAllowedChildren(child, MetaConstants.CollapsibleBody) || isValidAllowedChildren(child, MetaConstants.CollapsibleButton) || isValidAllowedChildren(child, MetaConstants.CollapsibleLink)) && !_dangerouslyDisableValidations) {
85
+ if (!(isValidAllowedChildren(child, componentIds.CollapsibleBody) || isValidAllowedChildren(child, componentIds.CollapsibleButton) || isValidAllowedChildren(child, componentIds.CollapsibleLink)) && !_dangerouslyDisableValidations) {
83
86
  throwBladeError({
84
87
  message: "only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink",
85
88
  moduleName: 'Collapsible'
@@ -106,7 +109,9 @@ var _Collapsible = function _Collapsible(_ref, ref) {
106
109
  }))
107
110
  });
108
111
  };
109
- var Collapsible = /*#__PURE__*/forwardRef(_Collapsible);
112
+ var Collapsible = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/forwardRef(_Collapsible), {
113
+ componentId: componentIds.Collapsible
114
+ });
110
115
 
111
116
  export { Collapsible };
112
117
  //# sourceMappingURL=Collapsible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.js","sources":["../../../../../../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Children, useCallback, useRef, useState, useMemo, forwardRef } from 'react';\n\nimport type { CollapsibleContextState } from './CollapsibleContext';\nimport { CollapsibleContext } from './CollapsibleContext';\nimport { MAX_WIDTH, MAX_WIDTH_NO_RESTRICTIONS } from './styles';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BoxProps } from '~components/Box';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useId } from '~utils/useId';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleProps = {\n /**\n * Composes `CollapsibleButton`, `CollapsibleLink`, `CollapsibleBody`\n */\n children: ReactNode;\n\n /**\n * Direction in which the content expands\n *\n * @default bottom\n */\n direction?: 'bottom' | 'top';\n\n /**\n * Expands the collapsible content by default (uncontrolled)\n *\n * @default false\n */\n defaultIsExpanded?: boolean;\n\n /**\n * Expands the collapsible content (controlled)\n *\n * @default undefined\n */\n isExpanded?: boolean;\n\n /**\n * Callback for change in collapsible's expanded state\n *\n * @default undefined\n */\n onExpandChange?: ({ isExpanded }: { isExpanded: boolean }) => void;\n\n /**\n * **Internal**: disables trigger validations. Used for AccordionButton and SideNavLink internally\n */\n _dangerouslyDisableValidations?: boolean;\n /**\n * **Internal**: used to override responsive width restrictions\n */\n _shouldApplyWidthRestrictions?: boolean;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst MIN_WIDTH: BoxProps['minWidth'] = makeSize(size[200]);\n\nconst _Collapsible = (\n {\n children,\n direction = 'bottom',\n defaultIsExpanded = false,\n isExpanded,\n onExpandChange,\n testID,\n _shouldApplyWidthRestrictions = true,\n _dangerouslyDisableValidations = false,\n ...rest\n }: CollapsibleProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const [isBodyExpanded, setIsBodyExpanded] = useState(isExpanded ?? defaultIsExpanded);\n const collapsibleBodyId = useId(MetaConstants.CollapsibleBody);\n\n /**\n * Maintain a ref to the initial value of `defaultExpanded || isExpanded` so changing it has no effect.\n * This will help in determining the correct initial height of collapsing body content\n */\n const initialDefaultExpanded = useRef(Boolean(defaultIsExpanded || isExpanded));\n\n const handleExpandChange = useCallback(\n (nextIsExpanded: boolean) => {\n if (typeof isExpanded !== 'undefined') {\n // controlled\n onExpandChange?.({ isExpanded: nextIsExpanded });\n } else {\n // uncontrolled\n setIsBodyExpanded(nextIsExpanded);\n onExpandChange?.({ isExpanded: nextIsExpanded });\n }\n },\n [onExpandChange, isExpanded],\n );\n\n const contextValue = useMemo<CollapsibleContextState>(\n () => ({\n // controlled behavior if isExpanded is provided\n isExpanded: isExpanded ?? isBodyExpanded,\n onExpandChange: handleExpandChange,\n defaultIsExpanded: initialDefaultExpanded.current,\n direction,\n collapsibleBodyId,\n }),\n [isBodyExpanded, direction, handleExpandChange, isExpanded, collapsibleBodyId],\n );\n\n if (__DEV__) {\n Children.forEach(children, (child) => {\n if (\n !(\n isValidAllowedChildren(child, MetaConstants.CollapsibleBody) ||\n isValidAllowedChildren(child, MetaConstants.CollapsibleButton) ||\n isValidAllowedChildren(child, MetaConstants.CollapsibleLink)\n ) &&\n !_dangerouslyDisableValidations\n ) {\n throwBladeError({\n message: `only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,\n moduleName: 'Collapsible',\n });\n }\n });\n }\n\n return (\n <CollapsibleContext.Provider value={contextValue}>\n <BaseBox\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Collapsible, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n display=\"flex\"\n flexDirection={direction === 'bottom' ? 'column' : 'column-reverse'}\n alignItems=\"flex-start\"\n minWidth={_shouldApplyWidthRestrictions ? MIN_WIDTH : makeSize(size[0])}\n maxWidth={_shouldApplyWidthRestrictions ? MAX_WIDTH : MAX_WIDTH_NO_RESTRICTIONS}\n >\n {children}\n </BaseBox>\n </BaseBox>\n </CollapsibleContext.Provider>\n );\n};\n\nconst Collapsible = forwardRef(_Collapsible);\n\nexport type { CollapsibleProps };\nexport { Collapsible };\n"],"names":["MIN_WIDTH","makeSize","size","_Collapsible","_ref","ref","children","_ref$direction","direction","_ref$defaultIsExpande","defaultIsExpanded","isExpanded","onExpandChange","testID","_ref$_shouldApplyWidt","_shouldApplyWidthRestrictions","_ref$_dangerouslyDisa","_dangerouslyDisableValidations","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isBodyExpanded","setIsBodyExpanded","collapsibleBodyId","useId","MetaConstants","CollapsibleBody","initialDefaultExpanded","useRef","Boolean","handleExpandChange","useCallback","nextIsExpanded","contextValue","useMemo","current","Children","forEach","child","isValidAllowedChildren","CollapsibleButton","CollapsibleLink","throwBladeError","message","moduleName","_jsx","CollapsibleContext","Provider","value","BaseBox","_objectSpread","metaAttribute","name","Collapsible","getStyledProps","makeAnalyticsAttribute","display","flexDirection","alignItems","minWidth","maxWidth","MAX_WIDTH","MAX_WIDTH_NO_RESTRICTIONS","forwardRef"],"mappings":";;;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AAE;AACxE8D,QAAAA,QAAQ,EAAEjD,6BAA6B,GAAGkD,SAAS,GAAGC,yBAA0B;AAAA5D,QAAAA,QAAA,EAE/EA,QAAAA;OACM,CAAA;KACF,CAAA,CAAA;AAAC,GACiB,CAAC,CAAA;AAElC,CAAC,CAAA;AAED,IAAMmD,WAAW,gBAAGU,UAAU,CAAChE,YAAY;;;;"}
1
+ {"version":3,"file":"Collapsible.js","sources":["../../../../../../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Children, useCallback, useRef, useState, useMemo, forwardRef } from 'react';\n\nimport type { CollapsibleContextState } from './CollapsibleContext';\nimport { CollapsibleContext } from './CollapsibleContext';\nimport { MAX_WIDTH, MAX_WIDTH_NO_RESTRICTIONS } from './styles';\nimport { componentIds } from './componentIds';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BoxProps } from '~components/Box';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useId } from '~utils/useId';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\ntype CollapsibleProps = {\n /**\n * Composes `CollapsibleButton`, `CollapsibleLink`, `CollapsibleBody`\n */\n children: ReactNode;\n\n /**\n * Direction in which the content expands\n *\n * @default bottom\n */\n direction?: 'bottom' | 'top';\n\n /**\n * Expands the collapsible content by default (uncontrolled)\n *\n * @default false\n */\n defaultIsExpanded?: boolean;\n\n /**\n * Expands the collapsible content (controlled)\n *\n * @default undefined\n */\n isExpanded?: boolean;\n\n /**\n * Callback for change in collapsible's expanded state\n *\n * @default undefined\n */\n onExpandChange?: ({ isExpanded }: { isExpanded: boolean }) => void;\n\n /**\n * **Internal**: disables trigger validations. Used for AccordionButton and SideNavLink internally\n */\n _dangerouslyDisableValidations?: boolean;\n /**\n * **Internal**: used to override responsive width restrictions\n */\n _shouldApplyWidthRestrictions?: boolean;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst MIN_WIDTH: BoxProps['minWidth'] = makeSize(size[200]);\n\nconst _Collapsible = (\n {\n children,\n direction = 'bottom',\n defaultIsExpanded = false,\n isExpanded,\n onExpandChange,\n testID,\n _shouldApplyWidthRestrictions = true,\n _dangerouslyDisableValidations = false,\n ...rest\n }: CollapsibleProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const [isBodyExpanded, setIsBodyExpanded] = useState(isExpanded ?? defaultIsExpanded);\n const collapsibleBodyId = useId(MetaConstants.CollapsibleBody);\n\n /**\n * Maintain a ref to the initial value of `defaultExpanded || isExpanded` so changing it has no effect.\n * This will help in determining the correct initial height of collapsing body content\n */\n const initialDefaultExpanded = useRef(Boolean(defaultIsExpanded || isExpanded));\n\n const handleExpandChange = useCallback(\n (nextIsExpanded: boolean) => {\n if (typeof isExpanded !== 'undefined') {\n // controlled\n onExpandChange?.({ isExpanded: nextIsExpanded });\n } else {\n // uncontrolled\n setIsBodyExpanded(nextIsExpanded);\n onExpandChange?.({ isExpanded: nextIsExpanded });\n }\n },\n [onExpandChange, isExpanded],\n );\n\n const contextValue = useMemo<CollapsibleContextState>(\n () => ({\n // controlled behavior if isExpanded is provided\n isExpanded: isExpanded ?? isBodyExpanded,\n onExpandChange: handleExpandChange,\n defaultIsExpanded: initialDefaultExpanded.current,\n direction,\n collapsibleBodyId,\n }),\n [isBodyExpanded, direction, handleExpandChange, isExpanded, collapsibleBodyId],\n );\n\n if (__DEV__) {\n Children.forEach(children, (child) => {\n if (\n !(\n isValidAllowedChildren(child, componentIds.CollapsibleBody) ||\n isValidAllowedChildren(child, componentIds.CollapsibleButton) ||\n isValidAllowedChildren(child, componentIds.CollapsibleLink)\n ) &&\n !_dangerouslyDisableValidations\n ) {\n throwBladeError({\n message: `only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,\n moduleName: 'Collapsible',\n });\n }\n });\n }\n\n return (\n <CollapsibleContext.Provider value={contextValue}>\n <BaseBox\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Collapsible, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n display=\"flex\"\n flexDirection={direction === 'bottom' ? 'column' : 'column-reverse'}\n alignItems=\"flex-start\"\n minWidth={_shouldApplyWidthRestrictions ? MIN_WIDTH : makeSize(size[0])}\n maxWidth={_shouldApplyWidthRestrictions ? MAX_WIDTH : MAX_WIDTH_NO_RESTRICTIONS}\n >\n {children}\n </BaseBox>\n </BaseBox>\n </CollapsibleContext.Provider>\n );\n};\n\nconst Collapsible = assignWithoutSideEffects(forwardRef(_Collapsible), {\n componentId: componentIds.Collapsible,\n});\n\nexport type { CollapsibleProps };\nexport { Collapsible };\n"],"names":["MIN_WIDTH","makeSize","size","_Collapsible","_ref","ref","children","_ref$direction","direction","_ref$defaultIsExpande","defaultIsExpanded","isExpanded","onExpandChange","testID","_ref$_shouldApplyWidt","_shouldApplyWidthRestrictions","_ref$_dangerouslyDisa","_dangerouslyDisableValidations","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isBodyExpanded","setIsBodyExpanded","collapsibleBodyId","useId","MetaConstants","CollapsibleBody","initialDefaultExpanded","useRef","Boolean","handleExpandChange","useCallback","nextIsExpanded","contextValue","useMemo","current","Children","forEach","child","isValidAllowedChildren","componentIds","CollapsibleButton","CollapsibleLink","throwBladeError","message","moduleName","_jsx","CollapsibleContext","Provider","value","BaseBox","_objectSpread","metaAttribute","name","Collapsible","getStyledProps","makeAnalyticsAttribute","display","flexDirection","alignItems","minWidth","maxWidth","MAX_WIDTH","MAX_WI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AA6B,GAAGf,SAAS,GAAGC,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAE;AACxE+D,QAAAA,QAAQ,EAAElD,6BAA6B,GAAGmD,SAAS,GAAGC,yBAA0B;AAAA7D,QAAAA,QAAA,EAE/EA,QAAAA;OACM,CAAA;KACF,CAAA,CAAA;AAAC,GACiB,CAAC,CAAA;AAElC,CAAC,CAAA;AAEKoD,IAAAA,WAAW,gBAAGU,wBAAwB,eAACC,UAAU,CAAClE,YAAY,CAAC,EAAE;EACrEmE,WAAW,EAAE1B,YAAY,CAACc,WAAAA;AAC5B,CAAC;;;;"}
@@ -2,6 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
3
  import { CollapsibleBodyContent } from './CollapsibleBodyContent.web.js';
4
4
  import { useCollapsible } from './CollapsibleContext.js';
5
+ import { componentIds } from './componentIds.js';
5
6
  import '../Box/BaseBox/index.js';
6
7
  import '../../utils/metaAttribute/index.js';
7
8
  import '../../utils/makeAccessible/index.js';
@@ -45,7 +46,7 @@ var _CollapsibleBody = function _CollapsibleBody(_ref) {
45
46
  }));
46
47
  };
47
48
  var CollapsibleBody = /*#__PURE__*/assignWithoutSideEffects(_CollapsibleBody, {
48
- componentId: MetaConstants.CollapsibleBody
49
+ componentId: componentIds.CollapsibleBody
49
50
  });
50
51
 
51
52
  export { CollapsibleBody };
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleBody.js","sources":["../../../../../../src/components/Collapsible/CollapsibleBody.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { CollapsibleBodyContent } from './CollapsibleBodyContent';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { CollapsibleBodyProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _CollapsibleBody = ({\n children,\n testID,\n width,\n _hasMargin = true,\n ...rest\n}: CollapsibleBodyProps): ReactElement => {\n const { collapsibleBodyId, isExpanded } = useCollapsible();\n return (\n <BaseBox\n id={collapsibleBodyId}\n width={width}\n {...makeAccessible({ role: 'region', hidden: !isExpanded })}\n {...metaAttribute({ name: MetaConstants.CollapsibleBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <CollapsibleBodyContent _hasMargin={_hasMargin}>{children}</CollapsibleBodyContent>\n </BaseBox>\n );\n};\n\nconst CollapsibleBody = assignWithoutSideEffects(_CollapsibleBody, {\n componentId: MetaConstants.CollapsibleBody,\n});\n\nexport type { CollapsibleBodyProps };\nexport { CollapsibleBody };\n"],"names":["_CollapsibleBody","_ref","children","testID","width","_ref$_hasMargin","_hasMargin","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","collapsibleBodyId","isExpanded","_jsx","BaseBox","_objectSpread","id","makeAccessible","role","hidden","metaAttribute","name","MetaConstants","CollapsibleBody","makeAnalyticsAttribute","CollapsibleBodyContent","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAMoB;AAAA,EAAA,IALxCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAAC,eAAA,GAAAJ,IAAA,CACLK,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,eAAA;AACdE,IAAAA,IAAI,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;AAEP,EAAA,IAAAC,eAAA,GAA0CC,cAAc,EAAE;IAAlDC,iBAAiB,GAAAF,eAAA,CAAjBE,iBAAiB;IAAEC,UAAU,GAAAH,eAAA,CAAVG,UAAU,CAAA;EACrC,oBACEC,GAAA,CAACC,OAAO,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;AACNC,IAAAA,EAAE,EAAEL,iBAAkB;AACtBR,IAAAA,KAAK,EAAEA,KAAAA;AAAM,GAAA,EACTc,cAAc,CAAC;AAAEC,IAAAA,IAAI,EAAE,QAAQ;AAAEC,IAAAA,MAAM,EAAE,CAACP,UAAAA;GAAY,CAAC,CACvDQ,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAEC,aAAa,CAACC,eAAe;AAAErB,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EAC9DsB,sBAAsB,CAAClB,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;IAAAL,QAAA,eAEhCY,GAAA,CAACY,sBAAsB,EAAA;AAACpB,MAAAA,UAAU,EAAEA,UAAW;AAAAJ,MAAAA,QAAA,EAAEA,QAAAA;KAAiC,CAAA;AAAC,GAAA,CAC5E,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMsB,eAAe,gBAAGG,wBAAwB,CAAC3B,gBAAgB,EAAE;EACjE4B,WAAW,EAAEL,aAAa,CAACC,eAAAA;AAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"CollapsibleBody.js","sources":["../../../../../../src/components/Collapsible/CollapsibleBody.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { CollapsibleBodyContent } from './CollapsibleBodyContent';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { CollapsibleBodyProps } from './types';\nimport { componentIds } from './componentIds';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _CollapsibleBody = ({\n children,\n testID,\n width,\n _hasMargin = true,\n ...rest\n}: CollapsibleBodyProps): ReactElement => {\n const { collapsibleBodyId, isExpanded } = useCollapsible();\n return (\n <BaseBox\n id={collapsibleBodyId}\n width={width}\n {...makeAccessible({ role: 'region', hidden: !isExpanded })}\n {...metaAttribute({ name: MetaConstants.CollapsibleBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <CollapsibleBodyContent _hasMargin={_hasMargin}>{children}</CollapsibleBodyContent>\n </BaseBox>\n );\n};\n\nconst CollapsibleBody = assignWithoutSideEffects(_CollapsibleBody, {\n componentId: componentIds.CollapsibleBody,\n});\n\nexport type { CollapsibleBodyProps };\nexport { CollapsibleBody };\n"],"names":["_CollapsibleBody","_ref","children","testID","width","_ref$_hasMargin","_hasMargin","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","collapsibleBodyId","isExpanded","_jsx","BaseBox","_objectSpread","id","makeAccessible","role","hidden","metaAttribute","name","MetaConstants","CollapsibleBody","makeAnalyticsAttribute","CollapsibleBodyContent","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAMoB;AAAA,EAAA,IALxCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAAC,eAAA,GAAAJ,IAAA,CACLK,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,eAAA;AACdE,IAAAA,IAAI,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA,CAAA;AAEP,EAAA,IAAAC,eAAA,GAA0CC,cAAc,EAAE;IAAlDC,iBAAiB,GAAAF,eAAA,CAAjBE,iBAAiB;IAAEC,UAAU,GAAAH,eAAA,CAAVG,UAAU,CAAA;EACrC,oBACEC,GAAA,CAACC,OAAO,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;AACNC,IAAAA,EAAE,EAAEL,iBAAkB;AACtBR,IAAAA,KAAK,EAAEA,KAAAA;AAAM,GAAA,EACTc,cAAc,CAAC;AAAEC,IAAAA,IAAI,EAAE,QAAQ;AAAEC,IAAAA,MAAM,EAAE,CAACP,UAAAA;GAAY,CAAC,CACvDQ,EAAAA,aAAa,CAAC;IAAEC,IAAI,EAAEC,aAAa,CAACC,eAAe;AAAErB,IAAAA,MAAM,EAANA,MAAAA;AAAO,GAAC,CAAC,CAAA,EAC9DsB,sBAAsB,CAAClB,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;IAAAL,QAAA,eAEhCY,GAAA,CAACY,sBAAsB,EAAA;AAACpB,MAAAA,UAAU,EAAEA,UAAW;AAAAJ,MAAAA,QAAA,EAAEA,QAAAA;KAAiC,CAAA;AAAC,GAAA,CAC5E,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMsB,eAAe,gBAAGG,wBAAwB,CAAC3B,gBAAgB,EAAE;EACjE4B,WAAW,EAAEC,YAAY,CAACL,eAAAA;AAC5B,CAAC;;;;"}
@@ -2,8 +2,8 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
3
  import { useCallback, forwardRef } from 'react';
4
4
  import { useCollapsible } from './CollapsibleContext.js';
5
+ import { componentIds } from './componentIds.js';
5
6
  import '../Button/BaseButton/index.js';
6
- import '../../utils/metaAttribute/index.js';
7
7
  import '../../utils/assignWithoutSideEffects/index.js';
8
8
  import '../../utils/index.js';
9
9
  import '../../utils/makeAnalyticsAttribute/index.js';
@@ -12,7 +12,6 @@ import BaseButton from '../Button/BaseButton/BaseButton.js';
12
12
  import { isReactNative } from '../../utils/platform/isReactNative.js';
13
13
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
14
14
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
15
- import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
16
15
 
17
16
  var _excluded = ["children", "variant", "size", "icon", "iconPosition", "isDisabled", "testID", "accessibilityLabel"];
18
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -57,7 +56,7 @@ var _CollapsibleButton = function _CollapsibleButton(_ref, ref) {
57
56
  };
58
57
  var CollapsibleButton = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/forwardRef(_CollapsibleButton), {
59
58
  displayName: 'CollapsibleButton',
60
- componentId: MetaConstants.CollapsibleButton
59
+ componentId: componentIds.CollapsibleButton
61
60
  });
62
61
 
63
62
  export { CollapsibleButton };
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleButton.js","sources":["../../../../../../src/components/Collapsible/CollapsibleButton.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { forwardRef, useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { ButtonProps } from '~components/Button';\nimport type { IconComponent } from '~components/Icons';\nimport BaseButton from '~components/Button/BaseButton';\nimport type { BladeElementRef, DataAnalyticsAttribute } from '~utils/types';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { isReactNative } from '~utils';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleButtonProps = Pick<\n ButtonProps,\n | 'variant'\n | 'size'\n | 'iconPosition'\n | 'isDisabled'\n | 'testID'\n | 'accessibilityLabel'\n | 'icon'\n | 'children'\n> &\n DataAnalyticsAttribute;\n\nconst _CollapsibleButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n CollapsibleButtonProps\n> = (\n { children, variant, size, icon, iconPosition, isDisabled, testID, accessibilityLabel, ...rest },\n ref,\n): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseButton\n variant={variant}\n size={size}\n // Button handles case of icon and children so we don't care about icon type safety here\n icon={icon as IconComponent}\n iconPosition={iconPosition}\n isDisabled={isDisabled}\n testID={testID}\n ref={ref}\n onClick={toggleIsExpanded}\n alignSelf={isReactNative() ? 'flex-start' : undefined}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseButton>\n );\n};\n\nconst CollapsibleButton = assignWithoutSideEffects(forwardRef(_CollapsibleButton), {\n displayName: 'CollapsibleButton',\n componentId: MetaConstants.CollapsibleButton,\n});\n\nexport type { CollapsibleButtonProps };\nexport { CollapsibleButton };\n"],"names":["_CollapsibleButton","_ref","ref","children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseButton","_objectSpread","onClick","alignSelf","isReactNative","undefined","accessibilityProps","label","controls","expanded","makeAnalyticsAttribute","CollapsibleButton","assignWithoutSideEffects","forwardRef","displayName","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAMA,kBAGL,GAAG,SAHEA,kBAGLA,CAAAC,IAAA,EAECC,GAAG,EACc;AAAA,EAAA,IAFfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;IAAEC,YAAY,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EAE/BA,QAAAA;AAAQ,GAAA,CACC,CAAC,CAAA;AAEjB,CAAC,CAAA;AAEK8B,IAAAA,iBAAiB,gBAAGC,wBAAwB,eAACC,UAAU,CAACnC,kBAAkB,CAAC,EAAE;AACjFoC,EAAAA,WAAW,EAAE,mBAAmB;EAChCC,WAAW,EAAEC,aAAa,CAACL,iBAAAA;AAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"CollapsibleButton.js","sources":["../../../../../../src/components/Collapsible/CollapsibleButton.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { forwardRef, useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport { componentIds } from './componentIds';\nimport type { ButtonProps } from '~components/Button';\nimport type { IconComponent } from '~components/Icons';\nimport BaseButton from '~components/Button/BaseButton';\nimport type { BladeElementRef, DataAnalyticsAttribute } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { isReactNative } from '~utils';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleButtonProps = Pick<\n ButtonProps,\n | 'variant'\n | 'size'\n | 'iconPosition'\n | 'isDisabled'\n | 'testID'\n | 'accessibilityLabel'\n | 'icon'\n | 'children'\n> &\n DataAnalyticsAttribute;\n\nconst _CollapsibleButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n CollapsibleButtonProps\n> = (\n { children, variant, size, icon, iconPosition, isDisabled, testID, accessibilityLabel, ...rest },\n ref,\n): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseButton\n variant={variant}\n size={size}\n // Button handles case of icon and children so we don't care about icon type safety here\n icon={icon as IconComponent}\n iconPosition={iconPosition}\n isDisabled={isDisabled}\n testID={testID}\n ref={ref}\n onClick={toggleIsExpanded}\n alignSelf={isReactNative() ? 'flex-start' : undefined}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseButton>\n );\n};\n\nconst CollapsibleButton = assignWithoutSideEffects(forwardRef(_CollapsibleButton), {\n displayName: 'CollapsibleButton',\n componentId: componentIds.CollapsibleButton,\n});\n\nexport type { CollapsibleButtonProps };\nexport { CollapsibleButton };\n"],"names":["_CollapsibleButton","_ref","ref","children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseButton","_objectSpread","onClick","alignSelf","isReactNative","undefined","accessibilityProps","label","controls","expanded","makeAnalyticsAttribute","CollapsibleButton","assignWithoutSideEffects","forwardRef","displayName","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAMA,kBAGL,GAAG,SAHEA,kBAGLA,CAAAC,IAAA,EAECC,GAAG,EACc;AAAA,EAAA,IAFfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IAAEC,IAAI,GAAAL,IAAA,CAAJK,IAAI;IAAEC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IAAEC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IAAEC,MAAM,GAAAR,IAAA,CAANQ,MAAM;IAAEC,kBAAkB,GAAAT,IAAA,CAAlBS,kBAAkB;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAX,IAAA,EAAAY,SAAA,CAAA,CAAA;AAG9F,EAAA,IAAAC,eAAA,GAA0DC,cAAc,EAAE;IAAlEC,cAAc,GAAAF,eAAA,CAAdE,cAAc;IAAEC,UAAU,GAAAH,eAAA,CAAVG,UAAU;IAAEC,iBAAiB,GAAAJ,eAAA,CAAjBI,iBAAiB,CAAA;EAErD,IAAMC,gBAAgB,GAAGC,WAAW,CAAC,YAAA;AAAA,IAAA,OAAMJ,cAAc,CAAC,CAACC,UAAU,CAAC,CAAA;AAAA,GAAA,EAAE,CACtED,cAAc,EACdC,UAAU,CACX,CAAC,CAAA;AAEF,EAAA,oBACEI,GAAA,CAACC,UAAU,EAAAC,aAAA,CAAAA,aAAA,CAAA;AACTnB,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,IAAI,EAAEA,IAAAA;AACN;AAAA;AACAC,IAAAA,IAAI,EAAEA,IAAsB;AAC5BC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,MAAM,EAAEA,MAAO;AACfP,IAAAA,GAAG,EAAEA,GAAI;AACTsB,IAAAA,OAAO,EAAEL,gBAAiB;AAC1BM,IAAAA,SAAS,EAAEC,aAAa,EAAE,GAAG,YAAY,GAAGC,SAAU;AACtDC,IAAAA,kBAAkB,EAAE;AAClBC,MAAAA,KAAK,EAAEnB,kBAAkB;AACzBoB,MAAAA,QAAQ,EAAEZ,iBAAiB;AAC3Ba,MAAAA,QAAQ,EAAEd,UAAAA;AACZ,KAAA;GACIe,EAAAA,sBAAsB,CAACrB,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAR,IAAAA,QAAA,EAE/BA,QAAAA;AAAQ,GAAA,CACC,CAAC,CAAA;AAEjB,CAAC,CAAA;AAEK8B,IAAAA,iBAAiB,gBAAGC,wBAAwB,eAACC,UAAU,CAACnC,kBAAkB,CAAC,EAAE;AACjFoC,EAAAA,WAAW,EAAE,mBAAmB;EAChCC,WAAW,EAAEC,YAAY,CAACL,iBAAAA;AAC5B,CAAC;;;;"}
@@ -3,7 +3,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
3
3
  import { useCallback } from 'react';
4
4
  import { useCollapsible } from './CollapsibleContext.js';
5
5
  import { CollapsibleChevronIcon } from './CollapsibleChevronIcon.web.js';
6
- import '../../utils/metaAttribute/index.js';
6
+ import { componentIds } from './componentIds.js';
7
7
  import '../Link/BaseLink/index.js';
8
8
  import '../../utils/assignWithoutSideEffects/index.js';
9
9
  import '../Box/styledProps/index.js';
@@ -13,7 +13,6 @@ import BaseLink from '../Link/BaseLink/BaseLink.js';
13
13
  import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
14
14
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
15
15
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
16
- import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
17
16
 
18
17
  var _excluded = ["children", "size", "color", "isDisabled", "testID", "accessibilityLabel"];
19
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -53,7 +52,7 @@ var _CollapsibleLink = function _CollapsibleLink(_ref) {
53
52
  }));
54
53
  };
55
54
  var CollapsibleLink = /*#__PURE__*/assignWithoutSideEffects(_CollapsibleLink, {
56
- componentId: MetaConstants.CollapsibleLink
55
+ componentId: componentIds.CollapsibleLink
57
56
  });
58
57
 
59
58
  export { CollapsibleLink };
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleLink.js","sources":["../../../../../../src/components/Collapsible/CollapsibleLink.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport { CollapsibleChevronIcon } from './CollapsibleChevronIcon';\nimport type { LinkProps } from '~components/Link';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleLinkProps = Pick<\n LinkProps,\n 'color' | 'size' | 'isDisabled' | 'testID' | 'accessibilityLabel' | 'children'\n> &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _CollapsibleLink = ({\n children,\n size,\n color = 'primary',\n isDisabled,\n testID,\n accessibilityLabel,\n ...rest\n}: CollapsibleLinkProps): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseLink\n variant=\"button\"\n size={size}\n color={color}\n icon={CollapsibleChevronIcon}\n iconPosition=\"right\"\n isDisabled={isDisabled}\n testID={testID}\n onClick={toggleIsExpanded}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseLink>\n );\n};\n\nconst CollapsibleLink = assignWithoutSideEffects(_CollapsibleLink, {\n componentId: MetaConstants.CollapsibleLink,\n});\n\nexport type { CollapsibleLinkProps };\nexport { CollapsibleLink };\n"],"names":["_CollapsibleLink","_ref","children","size","_ref$color","color","isDisabled","testID","accessibilityLabel","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseLink","_objectSpread","variant","icon","CollapsibleChevronIcon","iconPosition","onClick","accessibilityProps","label","controls","expanded","getStyledProps","makeAnalyticsAttribute","CollapsibleLink","assignWithoutSideEffects","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAQoB;AAAA,EAAA,IAPxCC,QAAQ,GAAAD,IA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,CAACtB,IAAI,CAAC,GACpBuB,sBAAsB,CAACvB,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAP,IAAAA,QAAA,EAE/BA,QAAAA;AAAQ,GAAA,CACD,CAAC,CAAA;AAEf,CAAC,CAAA;AAED,IAAM+B,eAAe,gBAAGC,wBAAwB,CAAClC,gBAAgB,EAAE;EACjEmC,WAAW,EAAEC,aAAa,CAACH,eAAAA;AAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"CollapsibleLink.js","sources":["../../../../../../src/components/Collapsible/CollapsibleLink.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport { CollapsibleChevronIcon } from './CollapsibleChevronIcon';\nimport { componentIds } from './componentIds';\nimport type { LinkProps } from '~components/Link';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleLinkProps = Pick<\n LinkProps,\n 'color' | 'size' | 'isDisabled' | 'testID' | 'accessibilityLabel' | 'children'\n> &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _CollapsibleLink = ({\n children,\n size,\n color = 'primary',\n isDisabled,\n testID,\n accessibilityLabel,\n ...rest\n}: CollapsibleLinkProps): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseLink\n variant=\"button\"\n size={size}\n color={color}\n icon={CollapsibleChevronIcon}\n iconPosition=\"right\"\n isDisabled={isDisabled}\n testID={testID}\n onClick={toggleIsExpanded}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseLink>\n );\n};\n\nconst CollapsibleLink = assignWithoutSideEffects(_CollapsibleLink, {\n componentId: componentIds.CollapsibleLink,\n});\n\nexport type { CollapsibleLinkProps };\nexport { CollapsibleLink };\n"],"names":["_CollapsibleLink","_ref","children","size","_ref$color","color","isDisabled","testID","accessibilityLabel","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseLink","_objectSpread","variant","icon","CollapsibleChevronIcon","iconPosition","onClick","accessibilityProps","label","controls","expanded","getStyledProps","makeAnalyticsAttribute","CollapsibleLink","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAQoB;AAAA,EAAA,IAPxCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,UAAA,GAAAH,IAAA,CACJI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,UAAA;IACjBE,UAAU,GAAAL,IAAA,CAAVK,UAAU;IACVC,MAAM,GAAAN,IAAA,CAANM,MAAM;IACNC,kBAAkB,GAAAP,IAAA,CAAlBO,kBAAkB;AACfC,IAAAA,IAAI,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA,CAAA,CAAA;AAEP,EAAA,IAAAC,eAAA,GAA0DC,cAAc,EAAE;IAAlEC,cAAc,GAAAF,eAAA,CAAdE,cAAc;IAAEC,UAAU,GAAAH,eAAA,CAAVG,UAAU;IAAEC,iBAAiB,GAAAJ,eAAA,CAAjBI,iBAAiB,CAAA;EAErD,IAAMC,gBAAgB,GAAGC,WAAW,CAAC,YAAA;AAAA,IAAA,OAAMJ,cAAc,CAAC,CAACC,UAAU,CAAC,CAAA;AAAA,GAAA,EAAE,CACtED,cAAc,EACdC,UAAU,CACX,CAAC,CAAA;EAEF,oBACEI,GAAA,CAACC,QAAQ,EAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAA;AACPC,IAAAA,OAAO,EAAC,QAAQ;AAChBnB,IAAAA,IAAI,EAAEA,IAAK;AACXE,IAAAA,KAAK,EAAEA,KAAM;AACbkB,IAAAA,IAAI,EAAEC,sBAAuB;AAC7BC,IAAAA,YAAY,EAAC,OAAO;AACpBnB,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,MAAM,EAAEA,MAAO;AACfmB,IAAAA,OAAO,EAAET,gBAAiB;AAC1BU,IAAAA,kBAAkB,EAAE;AAClBC,MAAAA,KAAK,EAAEpB,kBAAkB;AACzBqB,MAAAA,QAAQ,EAAEb,iBAAiB;AAC3Bc,MAAAA,QAAQ,EAAEf,UAAAA;AACZ,KAAA;GACIgB,EAAAA,cAAc,CAACtB,IAAI,CAAC,GACpBuB,sBAAsB,CAACvB,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAP,IAAAA,QAAA,EAE/BA,QAAAA;AAAQ,GAAA,CACD,CAAC,CAAA;AAEf,CAAC,CAAA;AAED,IAAM+B,eAAe,gBAAGC,wBAAwB,CAAClC,gBAAgB,EAAE;EACjEmC,WAAW,EAAEC,YAAY,CAACH,eAAAA;AAC5B,CAAC;;;;"}
@@ -0,0 +1,9 @@
1
+ var componentIds = {
2
+ Collapsible: 'Collapsible',
3
+ CollapsibleBody: 'CollapsibleBody',
4
+ CollapsibleButton: 'CollapsibleButton',
5
+ CollapsibleLink: 'CollapsibleLink'
6
+ };
7
+
8
+ export { componentIds };
9
+ //# sourceMappingURL=componentIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentIds.js","sources":["../../../../../../src/components/Collapsible/componentIds.ts"],"sourcesContent":["export const componentIds = {\n Collapsible: 'Collapsible',\n CollapsibleBody: 'CollapsibleBody',\n CollapsibleButton: 'CollapsibleButton',\n CollapsibleLink: 'CollapsibleLink',\n};\n"],"names":["componentIds","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink"],"mappings":"AAAO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,WAAW,EAAE,aAAa;AAC1BC,EAAAA,eAAe,EAAE,iBAAiB;AAClCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,eAAe,EAAE,iBAAA;AACnB;;;;"}
@@ -178,6 +178,9 @@ var BaseDatePicker = function BaseDatePicker(_ref) {
178
178
  });
179
179
  // we need to update old value everytime datepicker is opened or closed
180
180
  setOldValue(controlledValue);
181
+ setPicker(function () {
182
+ return defaultPicker;
183
+ });
181
184
  }
182
185
  }),
183
186
  _useControllableState4 = _slicedToArray(_useControllableState3, 2),
@@ -327,7 +330,7 @@ var BaseDatePicker = function BaseDatePicker(_ref) {
327
330
  onHoveredDateChange(date);
328
331
  },
329
332
  __onDayClick: function __onDayClick(_event, date) {
330
- onDateChange(date);
333
+ onDateChange(date, 'day');
331
334
  },
332
335
  getMonthControlProps: function getMonthControlProps(date) {
333
336
  return getControlProps(date);
@@ -341,12 +344,12 @@ var BaseDatePicker = function BaseDatePicker(_ref) {
341
344
  onMonthSelect: function onMonthSelect(date) {
342
345
  var _props$onMonthSelect;
343
346
  props === null || props === void 0 ? void 0 : (_props$onMonthSelect = props.onMonthSelect) === null || _props$onMonthSelect === void 0 ? void 0 : _props$onMonthSelect.call(props, date);
344
- onDateChange(date);
347
+ onDateChange(date, 'month');
345
348
  },
346
349
  onYearSelect: function onYearSelect(date) {
347
350
  var _props$onYearSelect;
348
351
  props === null || props === void 0 ? void 0 : (_props$onYearSelect = props.onYearSelect) === null || _props$onYearSelect === void 0 ? void 0 : _props$onYearSelect.call(props, date);
349
- onDateChange(date);
352
+ onDateChange(date, 'year');
350
353
  },
351
354
  onNext: function onNext(data) {
352
355
  var _props$onNext;