@razorpay/blade 12.20.1 → 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 (126) 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/StepGroup/StepGroup.web.js +26 -4
  74. package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
  75. package/build/lib/web/development/components/StepGroup/StepItem.web.js +2 -1
  76. package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
  77. package/build/lib/web/production/components/ActionList/ActionListBox.web.js +3 -3
  78. package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
  79. package/build/lib/web/production/components/ActionList/ActionListItem.js +4 -4
  80. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  81. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +9 -2
  82. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  83. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +3 -3
  84. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  85. package/build/lib/web/production/components/BottomSheet/BottomSheetContext.js.map +1 -1
  86. package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js +1 -1
  87. package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js.map +1 -1
  88. package/build/lib/web/production/components/Collapsible/Collapsible.js +7 -2
  89. package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
  90. package/build/lib/web/production/components/Collapsible/CollapsibleBody.js +2 -1
  91. package/build/lib/web/production/components/Collapsible/CollapsibleBody.js.map +1 -1
  92. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js +2 -3
  93. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js.map +1 -1
  94. package/build/lib/web/production/components/Collapsible/CollapsibleLink.js +2 -3
  95. package/build/lib/web/production/components/Collapsible/CollapsibleLink.js.map +1 -1
  96. package/build/lib/web/production/components/Collapsible/componentIds.js +9 -0
  97. package/build/lib/web/production/components/Collapsible/componentIds.js.map +1 -0
  98. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +6 -3
  99. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  100. package/build/lib/web/production/components/DatePicker/useDatesState.js +12 -1
  101. package/build/lib/web/production/components/DatePicker/useDatesState.js.map +1 -1
  102. package/build/lib/web/production/components/DatePicker/usePopup.js +5 -1
  103. package/build/lib/web/production/components/DatePicker/usePopup.js.map +1 -1
  104. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +6 -3
  105. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  106. package/build/lib/web/production/components/Dropdown/Dropdown.js +8 -6
  107. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  108. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js +18 -8
  109. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  110. package/build/lib/web/production/components/Dropdown/useDropdown.js +16 -6
  111. package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
  112. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +7 -3
  113. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  114. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +5 -2
  115. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  116. package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js +11 -8
  117. package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
  118. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +24 -12
  119. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  120. package/build/lib/web/production/components/StepGroup/StepGroup.web.js +26 -4
  121. package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
  122. package/build/lib/web/production/components/StepGroup/StepItem.web.js +2 -1
  123. package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
  124. package/build/types/components/index.d.ts +20 -9
  125. package/build/types/components/index.native.d.ts +19 -8
  126. package/package.json +1 -1
@@ -3,6 +3,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
3
3
  import { forwardRef, useState, useRef, useCallback, useMemo, Children } from 'react';
4
4
  import { CollapsibleContext } from './CollapsibleContext.js';
5
5
  import { MAX_WIDTH, MAX_WIDTH_NO_RESTRICTIONS } from './styles.native.js';
6
+ import { componentIds } from './componentIds.js';
6
7
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
7
8
  import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
8
9
  import 'react-native';
@@ -17,9 +18,10 @@ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
17
18
  import { useId } from '../../utils/useId.js';
18
19
  import { isValidAllowedChildren } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
19
20
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
21
+ import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
20
22
  import { jsx } from 'react/jsx-runtime';
21
23
 
22
- var _excluded=["children","direction","defaultIsExpanded","isExpanded","onExpandChange","testID","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations"];var MIN_WIDTH=makeSize(size[200]);var _Collapsible=function _Collapsible(_ref,ref){var children=_ref.children,_ref$direction=_ref.direction,direction=_ref$direction===void 0?'bottom':_ref$direction,_ref$defaultIsExpande=_ref.defaultIsExpanded,defaultIsExpanded=_ref$defaultIsExpande===void 0?false:_ref$defaultIsExpande,isExpanded=_ref.isExpanded,onExpandChange=_ref.onExpandChange,testID=_ref.testID,_ref$_shouldApplyWidt=_ref._shouldApplyWidthRestrictions,_shouldApplyWidthRestrictions=_ref$_shouldApplyWidt===void 0?true:_ref$_shouldApplyWidt,_ref$_dangerouslyDisa=_ref._dangerouslyDisableValidations,_dangerouslyDisableValidations=_ref$_dangerouslyDisa===void 0?false:_ref$_dangerouslyDisa,rest=_objectWithoutProperties(_ref,_excluded);var _useState=useState(isExpanded!=null?isExpanded:defaultIsExpanded),_useState2=_slicedToArray(_useState,2),isBodyExpanded=_useState2[0],setIsBodyExpanded=_useState2[1];var collapsibleBodyId=useId(MetaConstants.CollapsibleBody);var initialDefaultExpanded=useRef(Boolean(defaultIsExpanded||isExpanded));var handleExpandChange=useCallback(function(nextIsExpanded){if(typeof isExpanded!=='undefined'){onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}else {setIsBodyExpanded(nextIsExpanded);onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}},[onExpandChange,isExpanded]);var contextValue=useMemo(function(){return {isExpanded:isExpanded!=null?isExpanded:isBodyExpanded,onExpandChange:handleExpandChange,defaultIsExpanded:initialDefaultExpanded.current,direction:direction,collapsibleBodyId:collapsibleBodyId};},[isBodyExpanded,direction,handleExpandChange,isExpanded,collapsibleBodyId]);if(__DEV__){Children.forEach(children,function(child){if(!(isValidAllowedChildren(child,MetaConstants.CollapsibleBody)||isValidAllowedChildren(child,MetaConstants.CollapsibleButton)||isValidAllowedChildren(child,MetaConstants.CollapsibleLink))&&!_dangerouslyDisableValidations){throwBladeError({message:`only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,moduleName:'Collapsible'});}});}return jsx(CollapsibleContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:ref},metaAttribute({name:MetaConstants.Collapsible,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsx(BaseBox,{display:"flex",flexDirection:direction==='bottom'?'column':'column-reverse',alignItems:"flex-start",minWidth:_shouldApplyWidthRestrictions?MIN_WIDTH:makeSize(size[0]),maxWidth:_shouldApplyWidthRestrictions?MAX_WIDTH:MAX_WIDTH_NO_RESTRICTIONS,children:children})}))});};var Collapsible=forwardRef(_Collapsible);
24
+ var _excluded=["children","direction","defaultIsExpanded","isExpanded","onExpandChange","testID","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations"];var MIN_WIDTH=makeSize(size[200]);var _Collapsible=function _Collapsible(_ref,ref){var children=_ref.children,_ref$direction=_ref.direction,direction=_ref$direction===void 0?'bottom':_ref$direction,_ref$defaultIsExpande=_ref.defaultIsExpanded,defaultIsExpanded=_ref$defaultIsExpande===void 0?false:_ref$defaultIsExpande,isExpanded=_ref.isExpanded,onExpandChange=_ref.onExpandChange,testID=_ref.testID,_ref$_shouldApplyWidt=_ref._shouldApplyWidthRestrictions,_shouldApplyWidthRestrictions=_ref$_shouldApplyWidt===void 0?true:_ref$_shouldApplyWidt,_ref$_dangerouslyDisa=_ref._dangerouslyDisableValidations,_dangerouslyDisableValidations=_ref$_dangerouslyDisa===void 0?false:_ref$_dangerouslyDisa,rest=_objectWithoutProperties(_ref,_excluded);var _useState=useState(isExpanded!=null?isExpanded:defaultIsExpanded),_useState2=_slicedToArray(_useState,2),isBodyExpanded=_useState2[0],setIsBodyExpanded=_useState2[1];var collapsibleBodyId=useId(MetaConstants.CollapsibleBody);var initialDefaultExpanded=useRef(Boolean(defaultIsExpanded||isExpanded));var handleExpandChange=useCallback(function(nextIsExpanded){if(typeof isExpanded!=='undefined'){onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}else {setIsBodyExpanded(nextIsExpanded);onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}},[onExpandChange,isExpanded]);var contextValue=useMemo(function(){return {isExpanded:isExpanded!=null?isExpanded:isBodyExpanded,onExpandChange:handleExpandChange,defaultIsExpanded:initialDefaultExpanded.current,direction:direction,collapsibleBodyId:collapsibleBodyId};},[isBodyExpanded,direction,handleExpandChange,isExpanded,collapsibleBodyId]);if(__DEV__){Children.forEach(children,function(child){if(!(isValidAllowedChildren(child,componentIds.CollapsibleBody)||isValidAllowedChildren(child,componentIds.CollapsibleButton)||isValidAllowedChildren(child,componentIds.CollapsibleLink))&&!_dangerouslyDisableValidations){throwBladeError({message:`only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,moduleName:'Collapsible'});}});}return jsx(CollapsibleContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:ref},metaAttribute({name:MetaConstants.Collapsible,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsx(BaseBox,{display:"flex",flexDirection:direction==='bottom'?'column':'column-reverse',alignItems:"flex-start",minWidth:_shouldApplyWidthRestrictions?MIN_WIDTH:makeSize(size[0]),maxWidth:_shouldApplyWidthRestrictions?MAX_WIDTH:MAX_WIDTH_NO_RESTRICTIONS,children:children})}))});};var Collapsible=assignWithoutSideEffects(forwardRef(_Collapsible),{componentId:componentIds.Collapsible});
23
25
 
24
26
  export { Collapsible };
25
27
  //# 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","__DEV__","Children","forEach","child","isValidAllowedChildren","CollapsibleButton","CollapsibleLink","throwBladeError","message","moduleName","_jsx","CollapsibleContext","Provider","value","BaseBox","Object","assign","metaAttribute","name","Collapsible","getStyledProps","makeAnalyticsAttribute","display","flexDirection","alignItems","minWidth","maxWidth","MAX_WIDTH","MAX_WIDTH_NO_RESTRICTIONS","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,IAAA,S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CAC/B,CACA8B,eAAe,CAAC,CACdC,OAAO,CAAG,CAAA,uGAAA,CAAwG,CAClHC,UAAU,CAAE,aACd,CAAC,CAAC,CACJ,CACF,CAAC,CAAC,CACJ,CAEA,OACEC,GAAA,CAACC,kBAAkB,CAACC,QAAQ,CAACC,CAAAA,KAAK,CAAEhB,YAAa,CAAA/B,QAAA,CAC/C4C,GAAA,CAACI,OAAO,CAAAC,MAAA,CAAAC,MAAA,CACNnD,CAAAA,GAAG,CAAEA,GAAa,CACdoD,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAE7B,aAAa,CAAC8B,WAAW,CAAE9C,MAAM,CAANA,MAAO,CAAC,CAAC,CAC1D+C,cAAc,CAAC1C,IAAI,CAAC,CACpB2C,sBAAsB,CAAC3C,IAAI,CAAC,CAAA,CAAAZ,QAAA,CAEhC4C,GAAA,CAACI,OAAO,CACNQ,CAAAA,OAAO,CAAC,MAAM,CACdC,aAAa,CAAEvD,SAAS,GAAK,QAAQ,CAAG,QAAQ,CAAG,gBAAiB,CACpEwD,UAAU,CAAC,YAAY,CACvBC,QAAQ,CAAElD,6BAA6B,CAAGf,SAAS,CAAGC,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAE,CACxEgE,QAAQ,CAAEnD,6BAA6B,CAAGoD,SAAS,CAAGC,yBAA0B,CAAA9D,QAAA,CAE/EA,QAAQ,CACF,CAAC,CACH,CAAA,CAAC,CACiB,CAAC,CAElC,CAAC,CAEK,IAAAqD,WAAW,CAAGU,UAAU,CAAClE,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","__DEV__","Children","forEach","child","isValidAllowedChildren","componentIds","CollapsibleButton","CollapsibleLink","throwBladeError","message","moduleName","_jsx","CollapsibleContext","Provider","value","BaseBox","Object","assign","metaAttribute","name","Collapsible","getStyledProps","makeAnalyticsAttribute","display","flexDirection","alignItems","minWidth","maxWidth","MAX_WIDTH","MAX_WIDTH_NO_RESTRICTIONS","assignWithoutSideEffects","forwardRef","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,WAAA,CAAA,mBAAA,CAAA,YAAA,CAAA,gBAAA,CAAA,QAAA,CAAA,+BAAA,CAAA,gCAAA,CAAA,CAkEA,IAAMA,SAA+B,CAAGC,QAAQ,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC,CAE3D,IAAMC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAYhBC,GAA+B,CACd,CAAA,IAXfC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAAC,cAAA,CAAAH,IAAA,CACRI,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAA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CAC1DgD,cAAc,CAAC3C,IAAI,CAAC,CACpB4C,sBAAsB,CAAC5C,IAAI,CAAC,CAAAZ,CAAAA,QAAA,CAEhC6C,GAAA,CAACI,OAAO,CACNQ,CAAAA,OAAO,CAAC,MAAM,CACdC,aAAa,CAAExD,SAAS,GAAK,QAAQ,CAAG,QAAQ,CAAG,gBAAiB,CACpEyD,UAAU,CAAC,YAAY,CACvBC,QAAQ,CAAEnD,6BAA6B,CAAGf,SAAS,CAAGC,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAE,CACxEiE,QAAQ,CAAEpD,6BAA6B,CAAGqD,SAAS,CAAGC,yBAA0B,CAAA/D,QAAA,CAE/EA,QAAQ,CACF,CAAC,CACH,CAAA,CAAC,CACiB,CAAC,CAElC,CAAC,CAEK,IAAAsD,WAAW,CAAGU,wBAAwB,CAACC,UAAU,CAACpE,YAAY,CAAC,CAAE,CACrEqE,WAAW,CAAE3B,YAAY,CAACe,WAC5B,CAAC;;;;"}
@@ -1,6 +1,7 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
2
  import { CollapsibleBodyContent } from './CollapsibleBodyContent.native.js';
3
3
  import { useCollapsible } from './CollapsibleContext.js';
4
+ import { componentIds } from './componentIds.js';
4
5
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
5
6
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
6
7
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
@@ -9,7 +10,7 @@ import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/a
9
10
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
10
11
  import { jsx } from 'react/jsx-runtime';
11
12
 
12
- var _excluded=["children","testID","width","_hasMargin"];var _CollapsibleBody=function _CollapsibleBody(_ref){var children=_ref.children,testID=_ref.testID,width=_ref.width,_ref$_hasMargin=_ref._hasMargin,_hasMargin=_ref$_hasMargin===void 0?true:_ref$_hasMargin,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),collapsibleBodyId=_useCollapsible.collapsibleBodyId,isExpanded=_useCollapsible.isExpanded;return jsx(BaseBox,Object.assign({id:collapsibleBodyId,width:width},makeAccessible({role:'region',hidden:!isExpanded}),metaAttribute({name:MetaConstants.CollapsibleBody,testID:testID}),makeAnalyticsAttribute(rest),{children:jsx(CollapsibleBodyContent,{_hasMargin:_hasMargin,children:children})}));};var CollapsibleBody=assignWithoutSideEffects(_CollapsibleBody,{componentId:MetaConstants.CollapsibleBody});
13
+ var _excluded=["children","testID","width","_hasMargin"];var _CollapsibleBody=function _CollapsibleBody(_ref){var children=_ref.children,testID=_ref.testID,width=_ref.width,_ref$_hasMargin=_ref._hasMargin,_hasMargin=_ref$_hasMargin===void 0?true:_ref$_hasMargin,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),collapsibleBodyId=_useCollapsible.collapsibleBodyId,isExpanded=_useCollapsible.isExpanded;return jsx(BaseBox,Object.assign({id:collapsibleBodyId,width:width},makeAccessible({role:'region',hidden:!isExpanded}),metaAttribute({name:MetaConstants.CollapsibleBody,testID:testID}),makeAnalyticsAttribute(rest),{children:jsx(CollapsibleBodyContent,{_hasMargin:_hasMargin,children:children})}));};var CollapsibleBody=assignWithoutSideEffects(_CollapsibleBody,{componentId:componentIds.CollapsibleBody});
13
14
 
14
15
  export { CollapsibleBody };
15
16
  //# sourceMappingURL=CollapsibleBody.js.map
@@ -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","Object","assign","id","makeAccessible","role","hidden","metaAttribute","name","MetaConstants","CollapsibleBody","makeAnalyticsAttribute","CollapsibleBodyContent","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;yDAUA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAMoB,CALxC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,KAAK,CAAAH,IAAA,CAALG,KAAK,CAAAC,eAAA,CAAAJ,IAAA,CACLK,UAAU,CAAVA,UAAU,CAAAD,eAAA,UAAG,IAAI,CAAAA,eAAA,CACdE,IAAI,CAAAC,wBAAA,CAAAP,IAAA,CAAAQ,SAAA,EAEP,IAAAC,eAAA,CAA0CC,cAAc,EAAE,CAAlDC,iBAAiB,CAAAF,eAAA,CAAjBE,iBAAiB,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CACrC,OACEC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACNC,EAAE,CAAEN,iBAAkB,CACtBR,KAAK,CAAEA,KAAM,CACTe,CAAAA,cAAc,CAAC,CAAEC,IAAI,CAAE,QAAQ,CAAEC,MAAM,CAAE,CAACR,UAAW,CAAC,CAAC,CACvDS,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,eAAe,CAAEtB,MAAM,CAANA,MAAO,CAAC,CAAC,CAC9DuB,sBAAsB,CAACnB,IAAI,CAAC,CAAA,CAAAL,QAAA,CAEhCY,GAAA,CAACa,sBAAsB,CAAA,CAACrB,UAAU,CAAEA,UAAW,CAAAJ,QAAA,CAAEA,QAAQ,CAAyB,CAAC,EAC5E,CAAC,CAEd,CAAC,CAEK,IAAAuB,eAAe,CAAGG,wBAAwB,CAAC5B,gBAAgB,CAAE,CACjE6B,WAAW,CAAEL,aAAa,CAACC,eAC7B,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","Object","assign","id","makeAccessible","role","hidden","metaAttribute","name","MetaConstants","CollapsibleBody","makeAnalyticsAttribute","CollapsibleBodyContent","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;yDAWA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAMoB,CALxC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,KAAK,CAAAH,IAAA,CAALG,KAAK,CAAAC,eAAA,CAAAJ,IAAA,CACLK,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAA,KAAA,CAAA,CAAG,IAAI,CAAAA,eAAA,CACdE,IAAI,CAAAC,wBAAA,CAAAP,IAAA,CAAAQ,SAAA,CAAA,CAEP,IAAAC,eAAA,CAA0CC,cAAc,EAAE,CAAlDC,iBAAiB,CAAAF,eAAA,CAAjBE,iBAAiB,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CACrC,OACEC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,EACNC,EAAE,CAAEN,iBAAkB,CACtBR,KAAK,CAAEA,KAAM,CAAA,CACTe,cAAc,CAAC,CAAEC,IAAI,CAAE,QAAQ,CAAEC,MAAM,CAAE,CAACR,UAAW,CAAC,CAAC,CACvDS,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,eAAe,CAAEtB,MAAM,CAANA,MAAO,CAAC,CAAC,CAC9DuB,sBAAsB,CAACnB,IAAI,CAAC,CAAA,CAAAL,QAAA,CAEhCY,GAAA,CAACa,sBAAsB,CAAA,CAACrB,UAAU,CAAEA,UAAW,CAAAJ,QAAA,CAAEA,QAAQ,CAAyB,CAAC,EAC5E,CAAC,CAEd,CAAC,CAEK,IAAAuB,eAAe,CAAGG,wBAAwB,CAAC5B,gBAAgB,CAAE,CACjE6B,WAAW,CAAEC,YAAY,CAACL,eAC5B,CAAC;;;;"}
@@ -1,9 +1,8 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
2
  import { forwardRef, useCallback } from 'react';
3
3
  import { useCollapsible } from './CollapsibleContext.js';
4
+ import { componentIds } from './componentIds.js';
4
5
  import BaseButton from '../Button/BaseButton/BaseButton.js';
5
- import '@babel/runtime/helpers/defineProperty';
6
- import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
7
6
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
8
7
  import 'react-native';
9
8
  import '@babel/runtime/helpers/slicedToArray';
@@ -12,7 +11,7 @@ import '../BladeProvider/useTheme.js';
12
11
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
13
12
  import { jsx } from 'react/jsx-runtime';
14
13
 
15
- var _excluded=["children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel"];var _CollapsibleButton=function _CollapsibleButton(_ref,ref){var children=_ref.children,variant=_ref.variant,size=_ref.size,icon=_ref.icon,iconPosition=_ref.iconPosition,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseButton,Object.assign({variant:variant,size:size,icon:icon,iconPosition:iconPosition,isDisabled:isDisabled,testID:testID,ref:ref,onClick:toggleIsExpanded,alignSelf:isReactNative()?'flex-start':undefined,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},makeAnalyticsAttribute(rest),{children:children}));};var CollapsibleButton=assignWithoutSideEffects(forwardRef(_CollapsibleButton),{displayName:'CollapsibleButton',componentId:MetaConstants.CollapsibleButton});
14
+ var _excluded=["children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel"];var _CollapsibleButton=function _CollapsibleButton(_ref,ref){var children=_ref.children,variant=_ref.variant,size=_ref.size,icon=_ref.icon,iconPosition=_ref.iconPosition,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseButton,Object.assign({variant:variant,size:size,icon:icon,iconPosition:iconPosition,isDisabled:isDisabled,testID:testID,ref:ref,onClick:toggleIsExpanded,alignSelf:isReactNative()?'flex-start':undefined,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},makeAnalyticsAttribute(rest),{children:children}));};var CollapsibleButton=assignWithoutSideEffects(forwardRef(_CollapsibleButton),{displayName:'CollapsibleButton',componentId:componentIds.CollapsibleButton});
16
15
 
17
16
  export { CollapsibleButton };
18
17
  //# sourceMappingURL=CollapsibleButton.js.map
@@ -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","Object","assign","onClick","alignSelf","isReactNative","undefined","accessibilityProps","label","controls","expanded","makeAnalyticsAttribute","CollapsibleButton","assignWithoutSideEffects","forwardRef","displayName","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,SAAA,CAAA,MAAA,CAAA,MAAA,CAAA,cAAA,CAAA,YAAA,CAAA,QAAA,CAAA,oBAAA,CAAA,CAwBA,IAAMA,kBAGL,CAAG,SAHEA,kBAGLA,CAAAC,IAAA,CAECC,GAAG,CACc,CAFf,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAEC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CAAEC,IAAI,CAAAJ,IAAA,CAAJI,IAAI,CAAEC,IAAI,CAAAL,IAAA,CAAJK,IAAI,CAAEC,YAAY,CAAAN,IAAA,CAAZM,YAAY,CAAEC,UAAU,CAAAP,IAAA,CAAVO,UAAU,CAAEC,MAAM,CAAAR,IAAA,CAANQ,MAAM,CAAEC,kBAAkB,CAAAT,IAAA,CAAlBS,kBAAkB,CAAKC,IAAI,CAAAC,wBAAA,CAAAX,IAAA,CAAAY,SAAA,CAAA,CAG9F,IAAAC,eAAA,CAA0DC,cAAc,EAAE,CAAlEC,cAAc,CAAAF,eAAA,CAAdE,cAAc,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CAAEC,iBAAiB,CAAAJ,eAAA,CAAjBI,iBAAiB,CAErD,IAAMC,gBAAgB,CAAGC,WAAW,CAAC,UAAA,CAAA,OAAMJ,cAAc,CAAC,CAACC,UAAU,CAAC,CAAE,CAAA,CAAA,CACtED,cAAc,CACdC,UAAU,CACX,CAAC,CAEF,OACEI,GAAA,CAACC,UAAU,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACTpB,OAAO,CAAEA,OAAQ,CACjBC,IAAI,CAAEA,IAAK,CAEXC,IAAI,CAAEA,IAAsB,CAC5BC,YAAY,CAAEA,YAAa,CAC3BC,UAAU,CAAEA,UAAW,CACvBC,MAAM,CAAEA,MAAO,CACfP,GAAG,CAAEA,GAAI,CACTuB,OAAO,CAAEN,gBAAiB,CAC1BO,SAAS,CAAEC,aAAa,EAAE,CAAG,YAAY,CAAGC,SAAU,CACtDC,kBAAkB,CAAE,CAClBC,KAAK,CAAEpB,kBAAkB,CACzBqB,QAAQ,CAAEb,iBAAiB,CAC3Bc,QAAQ,CAAEf,UACZ,CAAE,CAAA,CACEgB,sBAAsB,CAACtB,IAAI,CAAC,CAAAR,CAAAA,QAAA,CAE/BA,QAAQ,CACC,CAAA,CAAC,CAEjB,CAAC,CAEK,IAAA+B,iBAAiB,CAAGC,wBAAwB,CAACC,UAAU,CAACpC,kBAAkB,CAAC,CAAE,CACjFqC,WAAW,CAAE,mBAAmB,CAChCC,WAAW,CAAEC,aAAa,CAACL,iBAC7B,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","Object","assign","onClick","alignSelf","isReactNative","undefined","accessibilityProps","label","controls","expanded","makeAnalyticsAttribute","CollapsibleButton","assignWithoutSideEffects","forwardRef","displayName","componentId","componentIds"],"mappings":";;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,SAAA,CAAA,MAAA,CAAA,MAAA,CAAA,cAAA,CAAA,YAAA,CAAA,QAAA,CAAA,oBAAA,CAAA,CAwBA,IAAMA,kBAGL,CAAG,SAHEA,kBAGLA,CAAAC,IAAA,CAECC,GAAG,CACc,CAFf,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAEC,OAAO,CAAAH,IAAA,CAA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CAACC,UAAU,CAACpC,kBAAkB,CAAC,CAAE,CACjFqC,WAAW,CAAE,mBAAmB,CAChCC,WAAW,CAAEC,YAAY,CAACL,iBAC5B,CAAC;;;;"}
@@ -2,8 +2,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
2
2
  import { useCallback } from 'react';
3
3
  import { useCollapsible } from './CollapsibleContext.js';
4
4
  import { CollapsibleChevronIcon } from './CollapsibleChevronIcon.native.js';
5
- import '@babel/runtime/helpers/defineProperty';
6
- import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
5
+ import { componentIds } from './componentIds.js';
7
6
  import BaseLink from '../Link/BaseLink/BaseLink.js';
8
7
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
9
8
  import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
@@ -15,7 +14,7 @@ import '../BladeProvider/useTheme.js';
15
14
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
16
15
  import { jsx } from 'react/jsx-runtime';
17
16
 
18
- var _excluded=["children","size","color","isDisabled","testID","accessibilityLabel"];var _CollapsibleLink=function _CollapsibleLink(_ref){var children=_ref.children,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseLink,Object.assign({variant:"button",size:size,color:color,icon:CollapsibleChevronIcon,iconPosition:"right",isDisabled:isDisabled,testID:testID,onClick:toggleIsExpanded,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},getStyledProps(rest),makeAnalyticsAttribute(rest),{children:children}));};var CollapsibleLink=assignWithoutSideEffects(_CollapsibleLink,{componentId:MetaConstants.CollapsibleLink});
17
+ var _excluded=["children","size","color","isDisabled","testID","accessibilityLabel"];var _CollapsibleLink=function _CollapsibleLink(_ref){var children=_ref.children,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseLink,Object.assign({variant:"button",size:size,color:color,icon:CollapsibleChevronIcon,iconPosition:"right",isDisabled:isDisabled,testID:testID,onClick:toggleIsExpanded,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},getStyledProps(rest),makeAnalyticsAttribute(rest),{children:children}));};var CollapsibleLink=assignWithoutSideEffects(_CollapsibleLink,{componentId:componentIds.CollapsibleLink});
19
18
 
20
19
  export { CollapsibleLink };
21
20
  //# sourceMappingURL=CollapsibleLink.js.map
@@ -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","Object","assign","variant","icon","CollapsibleChevronIcon","iconPosition","onClick","accessibilityProps","label","controls","expanded","getStyledProps","makeAnalyticsAttribute","CollapsibleLink","assignWithoutSideEffects","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;qFAoBA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAQoB,CAPxC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAAAC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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","Object","assign","variant","icon","CollapsibleChevronIcon","iconPosition","onClick","accessibilityProps","label","controls","expanded","getStyledProps","makeAnalyticsAttribute","CollapsibleLink","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;qFAoBA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAQoB,CAPxC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAAAC,UAAA,CAAAH,IAAA,CACJI,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CACjBE,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,MAAM,CAAAN,IAAA,CAANM,MAAM,CACNC,kBAAkB,CAAAP,IAAA,CAAlBO,kBAAkB,CACfC,IAAI,CAAAC,wBAAA,CAAAT,IAAA,CAAAU,SAAA,CAAA,CAEP,IAAAC,eAAA,CAA0DC,cAAc,EAAE,CAAlEC,cAAc,CAAAF,eAAA,CAAdE,cAAc,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CAAEC,iBAAiB,CAAAJ,eAAA,CAAjBI,iBAAiB,CAErD,IAAMC,gBAAgB,CAAGC,WAAW,CAAC,UAAM,CAAA,OAAAJ,cAAc,CAAC,CAACC,UAAU,CAAC,CAAE,CAAA,CAAA,CACtED,cAAc,CACdC,UAAU,CACX,CAAC,CAEF,OACEI,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CACPC,CAAAA,OAAO,CAAC,QAAQ,CAChBpB,IAAI,CAAEA,IAAK,CACXE,KAAK,CAAEA,KAAM,CACbmB,IAAI,CAAEC,sBAAuB,CAC7BC,YAAY,CAAC,OAAO,CACpBpB,UAAU,CAAEA,UAAW,CACvBC,MAAM,CAAEA,MAAO,CACfoB,OAAO,CAAEV,gBAAiB,CAC1BW,kBAAkB,CAAE,CAClBC,KAAK,CAAErB,kBAAkB,CACzBsB,QAAQ,CAAEd,iBAAiB,CAC3Be,QAAQ,CAAEhB,UACZ,CAAE,CAAA,CACEiB,cAAc,CAACvB,IAAI,CAAC,CACpBwB,sBAAsB,CAACxB,IAAI,CAAC,CAAAP,CAAAA,QAAA,CAE/BA,QAAQ,CACD,CAAA,CAAC,CAEf,CAAC,CAEK,IAAAgC,eAAe,CAAGC,wBAAwB,CAACnC,gBAAgB,CAAE,CACjEoC,WAAW,CAAEC,YAAY,CAACH,eAC5B,CAAC;;;;"}
@@ -0,0 +1,4 @@
1
+ var componentIds={Collapsible:'Collapsible',CollapsibleBody:'CollapsibleBody',CollapsibleButton:'CollapsibleButton',CollapsibleLink:'CollapsibleLink'};
2
+
3
+ export { componentIds };
4
+ //# 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":"AAAa,IAAAA,YAAY,CAAG,CAC1BC,WAAW,CAAE,aAAa,CAC1BC,eAAe,CAAE,iBAAiB,CAClCC,iBAAiB,CAAE,mBAAmB,CACtCC,eAAe,CAAE,iBACnB;;;;"}
@@ -22,7 +22,7 @@ import { mergeRefs } from '../../utils/useMergeRefs.js';
22
22
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
23
23
  import { jsx } from 'react/jsx-runtime';
24
24
 
25
- var _excluded=["children","isOpen","onOpenChange","selectionType","testID","_width"];var validDropdownChildren=[dropdownComponentIds.BaseBox,dropdownComponentIds.triggers.SelectInput,dropdownComponentIds.triggers.SearchInput,dropdownComponentIds.triggers.DropdownButton,dropdownComponentIds.triggers.DropdownIconButton,dropdownComponentIds.triggers.DropdownLink,dropdownComponentIds.DropdownOverlay,dropdownComponentIds.triggers.AutoComplete,ComponentIds.BottomSheet,dropdownComponentIds.triggers.FilterChipSelectInput];var _Dropdown=function _Dropdown(_ref,ref){var children=_ref.children,isOpenControlled=_ref.isOpen,onOpenChange=_ref.onOpenChange,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,testID=_ref.testID,_width=_ref._width,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),options=_React$useState2[0],setOptions=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),filteredValues=_React$useState4[0],setFilteredValues=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState9,2),activeIndex=_React$useState10[0],setActiveIndex=_React$useState10[1];var _React$useState11=React__default.useState(-1),_React$useState12=_slicedToArray(_React$useState11,2),activeTagIndex=_React$useState12[0],setActiveTagIndex=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),shouldIgnoreBlurAnimation=_React$useState14[0],setShouldIgnoreBlurAnimation=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasFooterAction=_React$useState16[0],setHasFooterAction=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),hasAutoCompleteInBottomSheetHeader=_React$useState18[0],setHasAutoCompleteInBottomSheetHeader=_React$useState18[1];var _React$useState19=React__default.useState(false),_React$useState20=_slicedToArray(_React$useState19,2),hasUnControlledFilterChipSelectInput=_React$useState20[0],setHasUnControlledFilterChipSelectInput=_React$useState20[1];var _React$useState21=React__default.useState(false),_React$useState22=_slicedToArray(_React$useState21,2),isKeydownPressed=_React$useState22[0],setIsKeydownPressed=_React$useState22[1];var _React$useState23=React__default.useState(0),_React$useState24=_slicedToArray(_React$useState23,2),changeCallbackTriggerer=_React$useState24[0],setChangeCallbackTriggerer=_React$useState24[1];var _React$useState25=React__default.useState(false),_React$useState26=_slicedToArray(_React$useState25,2),isControlled=_React$useState26[0],setIsControlled=_React$useState26[1];var _React$useState27=React__default.useState(false),_React$useState28=_slicedToArray(_React$useState27,2),dropdownHasBottomSheet=_React$useState28[0],setDropdownHasBottomSheet=_React$useState28[1];var triggererWrapperRef=React__default.useRef(null);var triggererRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var dropdownTriggerer=React__default.useRef();var isTagDismissedRef=React__default.useRef({value:false});var visibleTagsCountRef=React__default.useRef({value:0});var dropdownContainerRef=React__default.useRef(null);var dropdownBaseId=useId('dropdown');var isDropdownOpenRef=React__default.useRef(isOpenControlled);var _useControllableState=useControllableState({value:isOpenControlled,defaultValue:false,onChange:function onChange(isOpenControlledValue){isDropdownOpenRef.current=isOpenControlledValue;onOpenChange==null?void 0:onOpenChange(isOpenControlledValue);}}),_useControllableState2=_slicedToArray(_useControllableState,2),isDropdownOpen=_useControllableState2[0],setIsDropdownOpen=_useControllableState2[1];isDropdownOpenRef.current=isDropdownOpen;var setIsOpen=function setIsOpen(isOpenValue){isDropdownOpenRef.current=isOpenValue;setIsDropdownOpen(function(){return isOpenValue;});};var close=React__default.useCallback(function(){setActiveTagIndex(-1);setIsOpen(false);},[]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){if(__DEV__){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throwBladeError({message:`Dropdown can only have one of following elements as children - \n\n ${validDropdownChildren.join(', ')} \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,moduleName:'Dropdown'});}}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SearchInput)){dropdownTriggerer.current='SearchInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownIconButton)){dropdownTriggerer.current='DropdownIconButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.AutoComplete)){dropdownTriggerer.current='AutoComplete';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.FilterChipSelectInput)){dropdownTriggerer.current='FilterChipSelectInput';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,filteredValues:filteredValues,setFilteredValues:setFilteredValues,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,triggererWrapperRef:triggererWrapperRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasAutoCompleteInBottomSheetHeader:hasAutoCompleteInBottomSheetHeader,setHasAutoCompleteInBottomSheetHeader:setHasAutoCompleteInBottomSheetHeader,hasUnControlledFilterChipSelectInput:hasUnControlledFilterChipSelectInput,setHasUnControlledFilterChipSelectInput:setHasUnControlledFilterChipSelectInput,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled,isTagDismissedRef:isTagDismissedRef};},[isDropdownOpen,isOpenControlled,selectedIndices,controlledValueIndices,options,filteredValues,activeIndex,activeTagIndex,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,hasAutoCompleteInBottomSheetHeader:hasAutoCompleteInBottomSheetHeader,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,hasAutoCompleteInBottomSheetHeader,isDropdownOpen,close]);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:mergeRefs(ref,dropdownContainerRef)},metaAttribute({name:MetaConstants.Dropdown,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{width:_width,children:jsx(BaseBox,{position:"relative",textAlign:'left',children:children})}))})});};var Dropdown=assignWithoutSideEffects(React__default.forwardRef(_Dropdown),{componentId:dropdownComponentIds.Dropdown});
25
+ var _excluded=["children","isOpen","onOpenChange","selectionType","testID","_width"];var validDropdownChildren=[dropdownComponentIds.BaseBox,dropdownComponentIds.triggers.SelectInput,dropdownComponentIds.triggers.SearchInput,dropdownComponentIds.triggers.DropdownButton,dropdownComponentIds.triggers.DropdownIconButton,dropdownComponentIds.triggers.DropdownLink,dropdownComponentIds.DropdownOverlay,dropdownComponentIds.triggers.AutoComplete,ComponentIds.BottomSheet,dropdownComponentIds.triggers.FilterChipSelectInput];var _Dropdown=function _Dropdown(_ref,ref){var children=_ref.children,isOpenControlled=_ref.isOpen,onOpenChange=_ref.onOpenChange,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,testID=_ref.testID,_width=_ref._width,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),options=_React$useState2[0],setOptions=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),filteredValues=_React$useState4[0],setFilteredValues=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState9,2),activeIndex=_React$useState10[0],setActiveIndex=_React$useState10[1];var _React$useState11=React__default.useState(-1),_React$useState12=_slicedToArray(_React$useState11,2),activeTagIndex=_React$useState12[0],setActiveTagIndex=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),shouldIgnoreBlurAnimation=_React$useState14[0],setShouldIgnoreBlurAnimation=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasFooterAction=_React$useState16[0],setHasFooterAction=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),hasAutoCompleteInHeader=_React$useState18[0],setHasAutoCompleteInHeader=_React$useState18[1];var _React$useState19=React__default.useState(false),_React$useState20=_slicedToArray(_React$useState19,2),hasUnControlledFilterChipSelectInput=_React$useState20[0],setHasUnControlledFilterChipSelectInput=_React$useState20[1];var _React$useState21=React__default.useState(false),_React$useState22=_slicedToArray(_React$useState21,2),isKeydownPressed=_React$useState22[0],setIsKeydownPressed=_React$useState22[1];var _React$useState23=React__default.useState(0),_React$useState24=_slicedToArray(_React$useState23,2),changeCallbackTriggerer=_React$useState24[0],setChangeCallbackTriggerer=_React$useState24[1];var _React$useState25=React__default.useState(false),_React$useState26=_slicedToArray(_React$useState25,2),isControlled=_React$useState26[0],setIsControlled=_React$useState26[1];var _React$useState27=React__default.useState(false),_React$useState28=_slicedToArray(_React$useState27,2),dropdownHasBottomSheet=_React$useState28[0],setDropdownHasBottomSheet=_React$useState28[1];var triggererWrapperRef=React__default.useRef(null);var triggererRef=React__default.useRef(null);var headerAutoCompleteRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var dropdownTriggerer=React__default.useRef();var isTagDismissedRef=React__default.useRef({value:false});var visibleTagsCountRef=React__default.useRef({value:0});var dropdownContainerRef=React__default.useRef(null);var dropdownBaseId=useId('dropdown');var isDropdownOpenRef=React__default.useRef(isOpenControlled);var _useControllableState=useControllableState({value:isOpenControlled,defaultValue:false,onChange:function onChange(isOpenControlledValue){isDropdownOpenRef.current=isOpenControlledValue;onOpenChange==null?void 0:onOpenChange(isOpenControlledValue);}}),_useControllableState2=_slicedToArray(_useControllableState,2),isDropdownOpen=_useControllableState2[0],setIsDropdownOpen=_useControllableState2[1];isDropdownOpenRef.current=isDropdownOpen;var setIsOpen=function setIsOpen(isOpenValue){isDropdownOpenRef.current=isOpenValue;setIsDropdownOpen(function(){return isOpenValue;});};var close=React__default.useCallback(function(){setActiveTagIndex(-1);setIsOpen(false);},[]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){if(__DEV__){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throwBladeError({message:`Dropdown can only have one of following elements as children - \n\n ${validDropdownChildren.join(', ')} \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,moduleName:'Dropdown'});}}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SearchInput)){dropdownTriggerer.current='SearchInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownIconButton)){dropdownTriggerer.current='DropdownIconButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.AutoComplete)){dropdownTriggerer.current='AutoComplete';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.FilterChipSelectInput)){dropdownTriggerer.current='FilterChipSelectInput';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,filteredValues:filteredValues,setFilteredValues:setFilteredValues,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,headerAutoCompleteRef:headerAutoCompleteRef,triggererWrapperRef:triggererWrapperRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasAutoCompleteInHeader:hasAutoCompleteInHeader,setHasAutoCompleteInHeader:setHasAutoCompleteInHeader,hasUnControlledFilterChipSelectInput:hasUnControlledFilterChipSelectInput,setHasUnControlledFilterChipSelectInput:setHasUnControlledFilterChipSelectInput,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled,isTagDismissedRef:isTagDismissedRef};},[isDropdownOpen,isOpenControlled,selectedIndices,controlledValueIndices,options,filteredValues,activeIndex,activeTagIndex,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,hasAutoCompleteInHeader:hasAutoCompleteInHeader,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,hasAutoCompleteInHeader,isDropdownOpen,close]);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:mergeRefs(ref,dropdownContainerRef)},metaAttribute({name:MetaConstants.Dropdown,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{width:_width,children:jsx(BaseBox,{position:"relative",textAlign:'left',children:children})}))})});};var Dropdown=assignWithoutSideEffects(React__default.forwardRef(_Dropdown),{componentId:dropdownComponentIds.Dropdown});
26
26
 
27
27
  export { Dropdown };
28
28
  //# sourceMappingURL=Dropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","sources":["../../../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownContext } from './useDropdown';\nimport type { DropdownContextType } from './useDropdown';\nimport type { DropdownProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { useId } from '~utils/useId';\nimport { ComponentIds as bottomSheetComponentIds } from '~components/BottomSheet/componentIds';\nimport { BottomSheetAndDropdownGlueContext } from '~components/BottomSheet/BottomSheetContext';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { throwBladeError } from '~utils/logger';\nimport type { BladeElementRef, ContainerElementType } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport { mergeRefs } from '~utils/useMergeRefs';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst validDropdownChildren = [\n // TODO: Remove Box once CountrySelector's button sizing is fixed\n dropdownComponentIds.BaseBox,\n dropdownComponentIds.triggers.SelectInput,\n dropdownComponentIds.triggers.SearchInput,\n dropdownComponentIds.triggers.DropdownButton,\n dropdownComponentIds.triggers.DropdownIconButton,\n dropdownComponentIds.triggers.DropdownLink,\n dropdownComponentIds.DropdownOverlay,\n dropdownComponentIds.triggers.AutoComplete,\n bottomSheetComponentIds.BottomSheet,\n dropdownComponentIds.triggers.FilterChipSelectInput,\n];\n\n/**\n * ### Dropdown component\n *\n * Dropdown component is generic component that controls the dropdown functionality.\n * It can be used with multiple triggers and mostly contains ActionList component inside it\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown selectionType=\"single\">\n * <SelectInput />\n * <DropdownOverlay>\n * <ActionList>\n * <ActionListItem />\n * <ActionListItem />\n * </ActionList>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select Dropdown Documentation}\n */\nconst _Dropdown = (\n {\n children,\n isOpen: isOpenControlled,\n onOpenChange,\n selectionType = 'single',\n testID,\n _width,\n ...rest\n }: DropdownProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const [options, setOptions] = React.useState<DropdownContextType['options']>([]);\n const [filteredValues, setFilteredValues] = React.useState<string[]>([]);\n const [selectedIndices, setSelectedIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [controlledValueIndices, setControlledValueIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [activeIndex, setActiveIndex] = React.useState(-1);\n const [activeTagIndex, setActiveTagIndex] = React.useState(-1);\n const [shouldIgnoreBlurAnimation, setShouldIgnoreBlurAnimation] = React.useState(false);\n const [hasFooterAction, setHasFooterAction] = React.useState(false);\n const [\n hasAutoCompleteInBottomSheetHeader,\n setHasAutoCompleteInBottomSheetHeader,\n ] = React.useState(false);\n const [\n hasUnControlledFilterChipSelectInput,\n setHasUnControlledFilterChipSelectInput,\n ] = React.useState(false);\n const [isKeydownPressed, setIsKeydownPressed] = React.useState(false);\n const [changeCallbackTriggerer, setChangeCallbackTriggerer] = React.useState<\n DropdownContextType['changeCallbackTriggerer']\n >(0);\n const [isControlled, setIsControlled] = React.useState(false);\n // keep track if dropdown contains bottomsheet\n const [dropdownHasBottomSheet, setDropdownHasBottomSheet] = React.useState(false);\n\n /**\n * In inputs, actual input is smaller than the visible input wrapper.\n * You can set this reference in such cases so floating ui calculations happen correctly\n * */\n const triggererWrapperRef = React.useRef<ContainerElementType>(null);\n const triggererRef = React.useRef<HTMLButtonElement>(null);\n const actionListItemRef = React.useRef<HTMLDivElement>(null);\n const dropdownTriggerer = React.useRef<DropdownContextType['dropdownTriggerer']>();\n const isTagDismissedRef = React.useRef<{ value: boolean } | null>({ value: false });\n const visibleTagsCountRef = React.useRef<{ value: number }>({ value: 0 });\n const dropdownContainerRef = React.useRef<HTMLDivElement>(null);\n\n const dropdownBaseId = useId('dropdown');\n const isDropdownOpenRef = React.useRef(isOpenControlled);\n\n const [isDropdownOpen, setIsDropdownOpen] = useControllableState({\n value: isOpenControlled,\n defaultValue: false,\n onChange: (isOpenControlledValue) => {\n isDropdownOpenRef.current = isOpenControlledValue;\n onOpenChange?.(isOpenControlledValue);\n },\n });\n\n isDropdownOpenRef.current = isDropdownOpen;\n\n const setIsOpen = (isOpenValue: boolean): void => {\n isDropdownOpenRef.current = isOpenValue;\n setIsDropdownOpen(() => isOpenValue);\n };\n\n const close = React.useCallback(() => {\n setActiveTagIndex(-1);\n setIsOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n if (__DEV__) {\n if (!validDropdownChildren.includes(getComponentId(child) ?? '')) {\n throwBladeError({\n message: `Dropdown can only have one of following elements as children - \\n\\n ${validDropdownChildren.join(\n ', ',\n )} \\n\\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,\n moduleName: 'Dropdown',\n });\n }\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SelectInput)) {\n dropdownTriggerer.current = 'SelectInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SearchInput)) {\n dropdownTriggerer.current = 'SearchInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownButton)) {\n dropdownTriggerer.current = 'DropdownButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownIconButton)) {\n dropdownTriggerer.current = 'DropdownIconButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.AutoComplete)) {\n dropdownTriggerer.current = 'AutoComplete';\n }\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.FilterChipSelectInput)) {\n dropdownTriggerer.current = 'FilterChipSelectInput';\n }\n }\n });\n\n const contextValue = React.useMemo<DropdownContextType>(\n () => ({\n isOpen: isDropdownOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n controlledValueIndices,\n setControlledValueIndices,\n options,\n setOptions,\n filteredValues,\n setFilteredValues,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n isKeydownPressed,\n setIsKeydownPressed,\n dropdownBaseId,\n triggererRef,\n triggererWrapperRef,\n actionListItemRef,\n selectionType,\n hasFooterAction,\n setHasFooterAction,\n hasAutoCompleteInBottomSheetHeader,\n setHasAutoCompleteInBottomSheetHeader,\n hasUnControlledFilterChipSelectInput,\n setHasUnControlledFilterChipSelectInput,\n dropdownTriggerer: dropdownTriggerer.current,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setIsControlled,\n isTagDismissedRef,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n isDropdownOpen,\n isOpenControlled,\n selectedIndices,\n controlledValueIndices,\n options,\n filteredValues,\n activeIndex,\n activeTagIndex,\n shouldIgnoreBlurAnimation,\n selectionType,\n hasFooterAction,\n isKeydownPressed,\n changeCallbackTriggerer,\n isControlled,\n ],\n );\n\n const BottomSheetAndDropdownGlueContextValue = React.useMemo((): BottomSheetAndDropdownGlueContext => {\n return {\n isOpen: isDropdownOpen,\n dropdownHasBottomSheet,\n hasAutoCompleteInBottomSheetHeader,\n setDropdownHasBottomSheet,\n // This is the dismiss function which will be injected into the BottomSheet\n // Basically <BottomSheet onDismiss={onBottomSheetDismiss} />\n onBottomSheetDismiss: close,\n };\n }, [dropdownHasBottomSheet, hasAutoCompleteInBottomSheetHeader, isDropdownOpen, close]);\n\n return (\n <BottomSheetAndDropdownGlueContext.Provider value={BottomSheetAndDropdownGlueContextValue}>\n <DropdownContext.Provider value={contextValue}>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={mergeRefs(ref, dropdownContainerRef as any)}\n {...metaAttribute({ name: MetaConstants.Dropdown, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n width={_width}\n >\n <BaseBox position=\"relative\" textAlign={'left' as never}>\n {children}\n </BaseBox>\n </BaseBox>\n </DropdownContext.Provider>\n </BottomSheetAndDropdownGlueContext.Provider>\n );\n};\n\nconst Dropdown = assignWithoutSideEffects(React.forwardRef(_Dropdown), {\n componentId: dropdownComponentIds.Dropdown,\n});\n\nexport { Dropdown };\n"],"names":["validDropdownChildren","dropdownComponentIds","BaseBox","triggers","SelectInput","SearchInput","DropdownButton","DropdownIconButton","DropdownLink","DropdownOverlay","AutoComplete","bottomSheetComponentIds","BottomSheet","FilterChipSelectInput","_Dropdown","_ref","ref","children","isOpenControlled","isOpen","onOpenChange","_ref$selectionType","selectionType","testID","_width","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","options","setOptions","_React$useState3","_React$useState4","filteredValues","setFilteredValues","_React$useState5","_React$useState6","selectedIndices","setSelectedIndices","_React$useState7","_React$useState8","controlledValueIndices","setControlledValueIndices","_React$useState9","_React$useState10","activeIndex","setActiveIndex","_React$useState11","_React$useState12","activeTagIndex","setActiveTagIndex","_React$useState13","_React$useState14","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","_React$useState15","_React$useState16","hasFooterAction","setHasFooterAction","_React$useState17","_React$useState18","hasAutoCompleteInBottomSheetHeader","setHasAutoCompleteInBottomSheetHeader","_React$useState19","_React$useState20","hasUnControlledFilterChipSelectInput","setHasUnControlledFilterChipSelectInput","_React$useState21","_React$useState22","isKeydownPressed","setIsKeydownPressed","_React$useState23","_React$useState24","changeCallbackTriggerer","setChangeCallbackTriggerer","_React$useState25","_React$useState26","isControlled","setIsControlled","_React$useState27","_React$useState28","dropdownHasBottomSheet","setDropdownHasBottomSheet","triggererWrapperRef","useRef","triggererRef","actionListItemRef","dropdownTriggerer","isTagDismissedRef","value","visibleTagsCountRef","dropdownContainerRef","dropdownBaseId","useId","isDropdownOpenRef","_useControllableState","useControllableState","defaultValue","onChange","isOpenControlledValue","current","_useControllableState2","isDropdownOpen","setIsDropdownOpen","setIsOpen","isOpenValue","close","useCallback","Children","map","child","isValidElement","__DEV__","_getComponentId","includes","getComponentId","throwBladeError","message","join","moduleName","isValidAllowedChildren","contextValue","useMemo","BottomSheetAndDropdownGlueContextValue","onBottomSheetDismiss","_jsx","BottomSheetAndDropdownGlueContext","Provider","DropdownContext","Object","assign","mergeRefs","metaAttribute","name","MetaConstants","Dropdown","getStyledProps","makeAnalyticsAttribute","width","position","textAlign","assignWithoutSideEffects","forwardRef","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,QAAA,CAA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CAACC,QAAQ,CAAA,CAACtC,KAAK,CAAEkC,sCAAuC,CAAA9G,QAAA,CACxFgH,GAAA,CAACG,eAAe,CAACD,QAAQ,CAAA,CAACtC,KAAK,CAAEgC,YAAa,CAAA5G,QAAA,CAC5CgH,GAAA,CAAC/H,OAAO,CAAAmI,MAAA,CAAAC,MAAA,CAENtH,CAAAA,GAAG,CAAEuH,SAAS,CAACvH,GAAG,CAAE+E,oBAA2B,CAAE,CAC7CyC,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,QAAQ,CAAEpH,MAAM,CAANA,MAAO,CAAC,CAAC,CACvDqH,cAAc,CAACnH,IAAI,CAAC,CACpBoH,sBAAsB,CAACpH,IAAI,CAAC,CAChCqH,CAAAA,KAAK,CAAEtH,MAAO,CAAAP,QAAA,CAEdgH,GAAA,CAAC/H,OAAO,CAAC6I,CAAAA,QAAQ,CAAC,UAAU,CAACC,SAAS,CAAE,MAAgB,CAAA/H,QAAA,CACrDA,QAAQ,CACF,CAAC,EACH,CAAC,CACc,CAAC,CACe,CAAC,CAEjD,CAAC,CAEK,IAAA0H,QAAQ,CAAGM,wBAAwB,CAACpH,cAAK,CAACqH,UAAU,CAACpI,SAAS,CAAC,CAAE,CACrEqI,WAAW,CAAElJ,oBAAoB,CAAC0I,QACpC,CAAC;;;;"}
1
+ {"version":3,"file":"Dropdown.js","sources":["../../../../../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownContext } from './useDropdown';\nimport type { DropdownContextType } from './useDropdown';\nimport type { DropdownProps } from './types';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport { useId } from '~utils/useId';\nimport { ComponentIds as bottomSheetComponentIds } from '~components/BottomSheet/componentIds';\nimport { BottomSheetAndDropdownGlueContext } from '~components/BottomSheet/BottomSheetContext';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { throwBladeError } from '~utils/logger';\nimport type { BladeElementRef, ContainerElementType } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport { mergeRefs } from '~utils/useMergeRefs';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst validDropdownChildren = [\n // TODO: Remove Box once CountrySelector's button sizing is fixed\n dropdownComponentIds.BaseBox,\n dropdownComponentIds.triggers.SelectInput,\n dropdownComponentIds.triggers.SearchInput,\n dropdownComponentIds.triggers.DropdownButton,\n dropdownComponentIds.triggers.DropdownIconButton,\n dropdownComponentIds.triggers.DropdownLink,\n dropdownComponentIds.DropdownOverlay,\n dropdownComponentIds.triggers.AutoComplete,\n bottomSheetComponentIds.BottomSheet,\n dropdownComponentIds.triggers.FilterChipSelectInput,\n];\n\n/**\n * ### Dropdown component\n *\n * Dropdown component is generic component that controls the dropdown functionality.\n * It can be used with multiple triggers and mostly contains ActionList component inside it\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown selectionType=\"single\">\n * <SelectInput />\n * <DropdownOverlay>\n * <ActionList>\n * <ActionListItem />\n * <ActionListItem />\n * </ActionList>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n * ---\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select Dropdown Documentation}\n */\nconst _Dropdown = (\n {\n children,\n isOpen: isOpenControlled,\n onOpenChange,\n selectionType = 'single',\n testID,\n _width,\n ...rest\n }: DropdownProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const [options, setOptions] = React.useState<DropdownContextType['options']>([]);\n const [filteredValues, setFilteredValues] = React.useState<string[]>([]);\n const [selectedIndices, setSelectedIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [controlledValueIndices, setControlledValueIndices] = React.useState<\n DropdownContextType['selectedIndices']\n >([]);\n const [activeIndex, setActiveIndex] = React.useState(-1);\n const [activeTagIndex, setActiveTagIndex] = React.useState(-1);\n const [shouldIgnoreBlurAnimation, setShouldIgnoreBlurAnimation] = React.useState(false);\n const [hasFooterAction, setHasFooterAction] = React.useState(false);\n const [hasAutoCompleteInHeader, setHasAutoCompleteInHeader] = React.useState(false);\n const [\n hasUnControlledFilterChipSelectInput,\n setHasUnControlledFilterChipSelectInput,\n ] = React.useState(false);\n const [isKeydownPressed, setIsKeydownPressed] = React.useState(false);\n const [changeCallbackTriggerer, setChangeCallbackTriggerer] = React.useState<\n DropdownContextType['changeCallbackTriggerer']\n >(0);\n const [isControlled, setIsControlled] = React.useState(false);\n // keep track if dropdown contains bottomsheet\n const [dropdownHasBottomSheet, setDropdownHasBottomSheet] = React.useState(false);\n\n /**\n * In inputs, actual input is smaller than the visible input wrapper.\n * You can set this reference in such cases so floating ui calculations happen correctly\n * */\n const triggererWrapperRef = React.useRef<ContainerElementType>(null);\n const triggererRef = React.useRef<HTMLButtonElement>(null);\n const headerAutoCompleteRef = React.useRef<HTMLButtonElement>(null);\n const actionListItemRef = React.useRef<HTMLDivElement>(null);\n const dropdownTriggerer = React.useRef<DropdownContextType['dropdownTriggerer']>();\n const isTagDismissedRef = React.useRef<{ value: boolean } | null>({ value: false });\n const visibleTagsCountRef = React.useRef<{ value: number }>({ value: 0 });\n const dropdownContainerRef = React.useRef<HTMLDivElement>(null);\n\n const dropdownBaseId = useId('dropdown');\n const isDropdownOpenRef = React.useRef(isOpenControlled);\n\n const [isDropdownOpen, setIsDropdownOpen] = useControllableState({\n value: isOpenControlled,\n defaultValue: false,\n onChange: (isOpenControlledValue) => {\n isDropdownOpenRef.current = isOpenControlledValue;\n onOpenChange?.(isOpenControlledValue);\n },\n });\n\n isDropdownOpenRef.current = isDropdownOpen;\n\n const setIsOpen = (isOpenValue: boolean): void => {\n isDropdownOpenRef.current = isOpenValue;\n setIsDropdownOpen(() => isOpenValue);\n };\n\n const close = React.useCallback(() => {\n setActiveTagIndex(-1);\n setIsOpen(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n if (__DEV__) {\n if (!validDropdownChildren.includes(getComponentId(child) ?? '')) {\n throwBladeError({\n message: `Dropdown can only have one of following elements as children - \\n\\n ${validDropdownChildren.join(\n ', ',\n )} \\n\\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,\n moduleName: 'Dropdown',\n });\n }\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SelectInput)) {\n dropdownTriggerer.current = 'SelectInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.SearchInput)) {\n dropdownTriggerer.current = 'SearchInput';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownButton)) {\n dropdownTriggerer.current = 'DropdownButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.DropdownIconButton)) {\n dropdownTriggerer.current = 'DropdownIconButton';\n }\n\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.AutoComplete)) {\n dropdownTriggerer.current = 'AutoComplete';\n }\n if (isValidAllowedChildren(child, dropdownComponentIds.triggers.FilterChipSelectInput)) {\n dropdownTriggerer.current = 'FilterChipSelectInput';\n }\n }\n });\n\n const contextValue = React.useMemo<DropdownContextType>(\n () => ({\n isOpen: isDropdownOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n controlledValueIndices,\n setControlledValueIndices,\n options,\n setOptions,\n filteredValues,\n setFilteredValues,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n isKeydownPressed,\n setIsKeydownPressed,\n dropdownBaseId,\n triggererRef,\n headerAutoCompleteRef,\n triggererWrapperRef,\n actionListItemRef,\n selectionType,\n hasFooterAction,\n setHasFooterAction,\n hasAutoCompleteInHeader,\n setHasAutoCompleteInHeader,\n hasUnControlledFilterChipSelectInput,\n setHasUnControlledFilterChipSelectInput,\n dropdownTriggerer: dropdownTriggerer.current,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setIsControlled,\n isTagDismissedRef,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n isDropdownOpen,\n isOpenControlled,\n selectedIndices,\n controlledValueIndices,\n options,\n filteredValues,\n activeIndex,\n activeTagIndex,\n shouldIgnoreBlurAnimation,\n selectionType,\n hasFooterAction,\n isKeydownPressed,\n changeCallbackTriggerer,\n isControlled,\n ],\n );\n\n const BottomSheetAndDropdownGlueContextValue = React.useMemo((): BottomSheetAndDropdownGlueContext => {\n return {\n isOpen: isDropdownOpen,\n dropdownHasBottomSheet,\n hasAutoCompleteInHeader,\n setDropdownHasBottomSheet,\n // This is the dismiss function which will be injected into the BottomSheet\n // Basically <BottomSheet onDismiss={onBottomSheetDismiss} />\n onBottomSheetDismiss: close,\n };\n }, [dropdownHasBottomSheet, hasAutoCompleteInHeader, isDropdownOpen, close]);\n\n return (\n <BottomSheetAndDropdownGlueContext.Provider value={BottomSheetAndDropdownGlueContextValue}>\n <DropdownContext.Provider value={contextValue}>\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={mergeRefs(ref, dropdownContainerRef as any)}\n {...metaAttribute({ name: MetaConstants.Dropdown, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n width={_width}\n >\n <BaseBox position=\"relative\" textAlign={'left' as never}>\n {children}\n </BaseBox>\n </BaseBox>\n </DropdownContext.Provider>\n </BottomSheetAndDropdownGlueContext.Provider>\n );\n};\n\nconst Dropdown = assignWithoutSideEffects(React.forwardRef(_Dropdown), {\n componentId: dropdownComponentIds.Dropdown,\n});\n\nexport { Dropdown };\n"],"names":["validDropdownChildren","dropdownComponentIds","BaseBox","triggers","SelectInput","SearchInput","DropdownButton","DropdownIconButton","DropdownLink","DropdownOverlay","AutoComplete","bottomSheetComponentIds","BottomSheet","FilterChipSelectInput","_Dropdown","_ref","ref","children","isOpenControlled","isOpen","onOpenChange","_ref$selectionType","selectionType","testID","_width","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","options","setOptions","_React$useState3","_React$useState4","filteredValues","setFilteredValues","_React$useState5","_React$useState6","selectedIndices","setSelectedIndices","_React$useState7","_React$useState8","controlledValueIndices","setControlledValueIndices","_React$useState9","_React$useState10","activeIndex","setActiveIndex","_React$useState11","_React$useState12","activeTagIndex","setActiveTagIndex","_React$useState13","_React$useState14","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","_React$useState15","_React$useState16","hasFooterAction","setHasFooterAction","_React$useState17","_React$useState18","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","_React$useState19","_React$useState20","hasUnControlledFilterChipSelectInput","setHasUnControlledFilterChipSelectInput","_React$useState21","_React$useState22","isKeydownPressed","setIsKeydownPressed","_React$useState23","_React$useState24","changeCallbackTriggerer","setChangeCallbackTriggerer","_React$useState25","_React$useState26","isControlled","setIsControlled","_React$useState27","_React$useState28","dropdownHasBottomSheet","setDropdownHasBottomSheet","triggererWrapperRef","useRef","triggererRef","headerAutoCompleteRef","actionListItemRef","dropdownTriggerer","isTagDismissedRef","value","visibleTagsCountRef","dropdownContainerRef","dropdownBaseId","useId","isDropdownOpenRef","_useControllableState","useControllableState","defaultValue","onChange","isOpenControlledValue","current","_useControllableState2","isDropdownOpen","setIsDropdownOpen","setIsOpen","isOpenValue","close","useCallback","Children","map","child","isValidElement","__DEV__","_getComponentId","includes","getComponentId","throwBladeError","message","join","moduleName","isValidAllowedChildren","contextValue","useMemo","BottomSheetAndDropdownGlueContextValue","onBottomSheetDismiss","_jsx","BottomSheetAndDropdownGlueContext","Provider","DropdownContext","Object","assign","mergeRefs","metaAttribute","name","MetaConstants","Dropdown","getStyledProps","makeAnalyticsAttribute","width","position","textAlign","assignWitho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ACH,CAAC,CAAE,CAAC1B,sBAAsB,CAAEpB,uBAAuB,CAAE0C,cAAc,CAAEI,KAAK,CAAC,CAAC,CAE5E,OACEmB,GAAA,CAACC,iCAAiC,CAACC,QAAQ,CAACtC,CAAAA,KAAK,CAAEkC,sCAAuC,CAAA/G,QAAA,CACxFiH,GAAA,CAACG,eAAe,CAACD,QAAQ,EAACtC,KAAK,CAAEgC,YAAa,CAAA7G,QAAA,CAC5CiH,GAAA,CAAChI,OAAO,CAAAoI,MAAA,CAAAC,MAAA,CAAA,CAENvH,GAAG,CAAEwH,SAAS,CAACxH,GAAG,CAAEgF,oBAA2B,CAAE,CAAA,CAC7CyC,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,QAAQ,CAAErH,MAAM,CAANA,MAAO,CAAC,CAAC,CACvDsH,cAAc,CAACpH,IAAI,CAAC,CACpBqH,sBAAsB,CAACrH,IAAI,CAAC,CAAA,CAChCsH,KAAK,CAAEvH,MAAO,CAAAP,QAAA,CAEdiH,GAAA,CAAChI,OAAO,CAAA,CAAC8I,QAAQ,CAAC,UAAU,CAACC,SAAS,CAAE,MAAgB,CAAAhI,QAAA,CACrDA,QAAQ,CACF,CAAC,EACH,CAAC,CACc,CAAC,CACe,CAAC,CAEjD,CAAC,CAEK,IAAA2H,QAAQ,CAAGM,wBAAwB,CAACrH,cAAK,CAACsH,UAAU,CAACrI,SAAS,CAAC,CAAE,CACrEsI,WAAW,CAAEnJ,oBAAoB,CAAC2I,QACpC,CAAC;;;;"}
@@ -14,7 +14,7 @@ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
14
14
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
15
15
  import { jsx } from 'react/jsx-runtime';
16
16
 
17
- var _excluded=["title","subtitle","leading","titleSuffix","trailing","testID"];var _DropdownHeader=function _DropdownHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,titleSuffix=_ref.titleSuffix,trailing=_ref.trailing,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);return jsx(BaseBox,Object.assign({flexShrink:0},isReactNative()?{}:{onMouseDown:function onMouseDown(e){e.preventDefault();}},{children:jsx(BaseHeader,Object.assign({title:title,subtitle:subtitle,leading:leading,trailing:trailing,titleSuffix:titleSuffix,metaComponentName:MetaConstants.DropdownHeader,testID:testID,showBackButton:false,showCloseButton:false},makeAnalyticsAttribute(rest)))}));};var DropdownHeader=assignWithoutSideEffects(_DropdownHeader,{componentId:'DropdownHeader'});var _DropdownFooter=function _DropdownFooter(_ref2){var children=_ref2.children,testID=_ref2.testID;var _useDropdown=useDropdown(),setHasFooterAction=_useDropdown.setHasFooterAction,isOpen=_useDropdown.isOpen;var footerRef=React__default.useRef(null);React__default.useEffect(function(){setHasFooterAction(true);},[]);return jsx(BaseBox,Object.assign({ref:footerRef},makeAccessible({role:isReactNative()?undefined:'group'}),{children:jsx(BaseFooter,{metaComponentName:MetaConstants.DropdownFooter,testID:testID,children:isOpen?children:null})}));};var DropdownFooter=assignWithoutSideEffects(_DropdownFooter,{componentId:'DropdownFooter'});
17
+ var _excluded=["title","subtitle","leading","titleSuffix","trailing","testID","children"];var _DropdownHeader=function _DropdownHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,titleSuffix=_ref.titleSuffix,trailing=_ref.trailing,testID=_ref.testID,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),hasAutoCompleteInHeader=_useDropdown.hasAutoCompleteInHeader,setShouldIgnoreBlurAnimation=_useDropdown.setShouldIgnoreBlurAnimation;return jsx(BaseBox,Object.assign({flexShrink:0},isReactNative()?{}:{onMouseDown:function onMouseDown(e){if(!hasAutoCompleteInHeader){e.preventDefault();}else {setShouldIgnoreBlurAnimation(false);}}},{children:jsx(BaseHeader,Object.assign({title:title,subtitle:subtitle,leading:leading,trailing:trailing,titleSuffix:titleSuffix,metaComponentName:MetaConstants.DropdownHeader,testID:testID,showBackButton:false,showCloseButton:false},makeAnalyticsAttribute(rest),{children:children}))}));};var DropdownHeader=assignWithoutSideEffects(_DropdownHeader,{componentId:'DropdownHeader'});var _DropdownFooter=function _DropdownFooter(_ref2){var children=_ref2.children,testID=_ref2.testID;var _useDropdown2=useDropdown(),setHasFooterAction=_useDropdown2.setHasFooterAction,isOpen=_useDropdown2.isOpen;var footerRef=React__default.useRef(null);React__default.useEffect(function(){setHasFooterAction(true);},[]);return jsx(BaseBox,Object.assign({ref:footerRef},makeAccessible({role:isReactNative()?undefined:'group'}),{children:jsx(BaseFooter,{metaComponentName:MetaConstants.DropdownFooter,testID:testID,children:isOpen?children:null})}));};var DropdownFooter=assignWithoutSideEffects(_DropdownFooter,{componentId:'DropdownFooter'});
18
18
 
19
19
  export { DropdownFooter, DropdownHeader };
20
20
  //# sourceMappingURL=DropdownHeaderFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownHeaderFooter.js","sources":["../../../../../src/components/Dropdown/DropdownHeaderFooter.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport React from 'react';\nimport { useDropdown } from './useDropdown';\nimport { BaseFooter } from '~components/BaseHeaderFooter/BaseFooter';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport type { BaseFooterProps } from '~components/BaseHeaderFooter/BaseFooter';\nimport BaseBox from '~components/Box/BaseBox';\nimport { isReactNative } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { MetaConstants } from '~utils/metaAttribute/metaConstants';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype DropdownHeaderProps = Pick<\n BaseHeaderProps,\n | 'title'\n | 'subtitle'\n | 'leading'\n | 'trailing'\n | 'titleSuffix'\n | 'testID'\n | keyof DataAnalyticsAttribute\n>;\n\nconst _DropdownHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n testID,\n ...rest\n}: DropdownHeaderProps): React.ReactElement => {\n return (\n <BaseBox\n flexShrink={0}\n {...(isReactNative()\n ? {}\n : {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onMouseDown: (e: any) => {\n // we don't want focus to ever move on header because its static element\n e.preventDefault();\n },\n })}\n >\n <BaseHeader\n title={title}\n subtitle={subtitle}\n leading={leading}\n trailing={trailing}\n titleSuffix={titleSuffix}\n metaComponentName={MetaConstants.DropdownHeader}\n testID={testID}\n // back button\n showBackButton={false}\n // close button\n showCloseButton={false}\n {...makeAnalyticsAttribute(rest)}\n />\n </BaseBox>\n );\n};\n\nconst DropdownHeader = assignWithoutSideEffects(_DropdownHeader, {\n componentId: 'DropdownHeader',\n});\n\ntype DropdownFooter = Pick<BaseFooterProps, 'children' | 'testID'>;\n\nconst _DropdownFooter = ({ children, testID }: DropdownFooter): React.ReactElement => {\n const { setHasFooterAction, isOpen } = useDropdown();\n const footerRef = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n setHasFooterAction(true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={footerRef as any}\n {...makeAccessible({\n role: isReactNative() ? undefined : 'group',\n })}\n >\n <BaseFooter metaComponentName={MetaConstants.DropdownFooter} testID={testID}>\n {/* We don't want any of the interactive children to get focussed on TAB when dropdown is closed so we remove them from DOM itself */}\n {isOpen ? children : null}\n </BaseFooter>\n </BaseBox>\n );\n};\n\nconst DropdownFooter = assignWithoutSideEffects(_DropdownFooter, {\n componentId: 'DropdownFooter',\n});\n\nexport { DropdownHeader, DropdownFooter };\n"],"names":["_DropdownHeader","_ref","title","subtitle","leading","titleSuffix","trailing","testID","rest","_objectWithoutProperties","_excluded","_jsx","BaseBox","Object","assign","flexShrink","isReactNative","onMouseDown","e","preventDefault","children","BaseHeader","metaComponentName","MetaConstants","DropdownHeader","showBackButton","showCloseButton","makeAnalyticsAttribute","assignWithoutSideEffects","componentId","_DropdownFooter","_ref2","_useDropdown","useDropdown","setHasFooterAction","isOpen","footerRef","React","useRef","useEffect","ref","makeAccessible","role","undefined","BaseFooter","DropdownFooter"],"mappings":";;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,SAAA,CAAA,aAAA,CAAA,UAAA,CAAA,QAAA,CAAA,CAyBA,IAAMA,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAQ0B,CAP7C,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CACPC,WAAW,CAAAJ,IAAA,CAAXI,WAAW,CACXC,QAAQ,CAAAL,IAAA,CAARK,QAAQ,CACRC,MAAM,CAAAN,IAAA,CAANM,MAAM,CACHC,IAAI,CAAAC,wBAAA,CAAAR,IAAA,CAAAS,SAAA,CAEP,CAAA,OACEC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,EACNC,UAAU,CAAE,CAAE,CACTC,CAAAA,aAAa,EAAE,CAChB,EAAE,CACF,CAEEC,WAAW,CAAE,SAAAA,WAAAA,CAACC,CAAM,CAAK,CAEvBA,CAAC,CAACC,cAAc,EAAE,CACpB,CACF,CAAC,CAAAC,CAAAA,QAAA,CAELT,GAAA,CAACU,UAAU,CAAAR,MAAA,CAAAC,MAAA,CAAA,CACTZ,KAAK,CAAEA,KAAM,CACbC,QAAQ,CAAEA,QAAS,CACnBC,OAAO,CAAEA,OAAQ,CACjBE,QAAQ,CAAEA,QAAS,CACnBD,WAAW,CAAEA,WAAY,CACzBiB,iBAAiB,CAAEC,aAAa,CAACC,cAAe,CAChDjB,MAAM,CAAEA,MAAO,CAEfkB,cAA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Content":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport React from 'react';\nimport { useDropdown } from './useDropdown';\nimport { BaseFooter } from '~components/BaseHeaderFooter/BaseFooter';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport type { BaseFooterProps } from '~components/BaseHeaderFooter/BaseFooter';\nimport BaseBox from '~components/Box/BaseBox';\nimport { isReactNative } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { MetaConstants } from '~utils/metaAttribute/metaConstants';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype DropdownHeaderProps = Pick<\n BaseHeaderProps,\n | 'title'\n | 'subtitle'\n | 'leading'\n | 'trailing'\n | 'titleSuffix'\n | 'testID'\n | 'children'\n | keyof DataAnalyticsAttribute\n>;\n\nconst _DropdownHeader = ({\n title,\n subtitle,\n leading,\n titleSuffix,\n trailing,\n testID,\n children,\n ...rest\n}: DropdownHeaderProps): React.ReactElement => {\n const { hasAutoCompleteInHeader, setShouldIgnoreBlurAnimation } = useDropdown();\n\n return (\n <BaseBox\n flexShrink={0}\n {...(isReactNative()\n ? {}\n : {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onMouseDown: (e: any) => {\n // we don't want focus to ever move on header because its static element except when autocomplete is present\n if (!hasAutoCompleteInHeader) {\n e.preventDefault();\n } else {\n setShouldIgnoreBlurAnimation(false);\n }\n },\n })}\n >\n <BaseHeader\n title={title}\n subtitle={subtitle}\n leading={leading}\n trailing={trailing}\n titleSuffix={titleSuffix}\n metaComponentName={MetaConstants.DropdownHeader}\n testID={testID}\n // back button\n showBackButton={false}\n // close button\n showCloseButton={false}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseHeader>\n </BaseBox>\n );\n};\n\nconst DropdownHeader = assignWithoutSideEffects(_DropdownHeader, {\n componentId: 'DropdownHeader',\n});\n\ntype DropdownFooter = Pick<BaseFooterProps, 'children' | 'testID'>;\n\nconst _DropdownFooter = ({ children, testID }: DropdownFooter): React.ReactElement => {\n const { setHasFooterAction, isOpen } = useDropdown();\n const footerRef = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n setHasFooterAction(true);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={footerRef as any}\n {...makeAccessible({\n role: isReactNative() ? undefined : 'group',\n })}\n >\n <BaseFooter metaComponentName={MetaConstants.DropdownFooter} testID={testID}>\n {/* We don't want any of the interactive children to get focussed on TAB when dropdown is closed so we remove them from DOM itself */}\n {isOpen ? children : null}\n </BaseFooter>\n </BaseBox>\n );\n};\n\nconst DropdownFooter = assignWithoutSideEffects(_DropdownFooter, {\n componentId: 'DropdownFooter',\n});\n\nexport { DropdownHeader, DropdownFooter };\n"],"names":["_DropdownHeader","_ref","title","subtitle","leading","titleSuffix","trailing","testID","children","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInHeader","setShouldIgnoreBlurAnimation","_jsx","BaseBox","Object","assign","flexShrink","isReactNative","onMouseDown","e","preventDefault","BaseHeader","metaComponentName","MetaConstants","DropdownHeader","showBackButton","showCloseButton","makeAnalyticsAttribute","assignWithoutSideEffects","componentId","_DropdownFooter","_ref2","_useDropdown2","setHasFooterAction","isOpen","footerRef","React","useRef","useEffect","ref","makeAccessible","role","undefined","BaseFooter","DropdownFooter"],"mappings":";;;;;;;;;;;;;;;;0FA2BA,IAAMA,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAS0B,KAR7CC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CACPC,WAAW,CAA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CAAiE,CAAA,IAA3D3B,QAAQ,CAAA2B,KAAA,CAAR3B,QAAQ,CAAED,MAAM,CAAA4B,KAAA,CAAN5B,MAAM,CACzC,IAAA6B,aAAA,CAAuCvB,WAAW,EAAE,CAA5CwB,kBAAkB,CAAAD,aAAA,CAAlBC,kBAAkB,CAAEC,MAAM,CAAAF,aAAA,CAANE,MAAM,CAClC,IAAMC,SAAS,CAAGC,cAAK,CAACC,MAAM,CAAiB,IAAI,CAAC,CAEpDD,cAAK,CAACE,SAAS,CAAC,UAAM,CACpBL,kBAAkB,CAAC,IAAI,CAAC,CAE1B,CAAC,CAAE,EAAE,CAAC,CAEN,OACErB,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,CAENwB,GAAG,CAAEJ,SAAiB,EAClBK,cAAc,CAAC,CACjBC,IAAI,CAAExB,aAAa,EAAE,CAAGyB,SAAS,CAAG,OACtC,CAAC,CAAC,CAAA,CAAAtC,QAAA,CAEFQ,GAAA,CAAC+B,UAAU,CAAA,CAACrB,iBAAiB,CAAEC,aAAa,CAACqB,cAAe,CAACzC,MAAM,CAAEA,MAAO,CAAAC,QAAA,CAEzE8B,MAAM,CAAG9B,QAAQ,CAAG,IAAI,CACf,CAAC,EACN,CAAC,CAEd,CAAC,CAEK,IAAAwC,cAAc,CAAGhB,wBAAwB,CAACE,eAAe,CAAE,CAC/DD,WAAW,CAAE,gBACf,CAAC;;;;"}
@@ -10,7 +10,7 @@ import { isBrowser } from '../../utils/platform/isBrowser.js';
10
10
  import '../BladeProvider/useTheme.js';
11
11
  import { fireNativeEvent } from '../../utils/fireNativeEvent/fireNativeEvent.native.js';
12
12
 
13
- var _excluded=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices","filteredValues","dropdownTriggerer"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,filteredValues:[],setFilteredValues:noop,activeIndex:-1,setActiveIndex:noop,activeTagIndex:-1,setActiveTagIndex:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasAutoCompleteInBottomSheetHeader:false,setHasAutoCompleteInBottomSheetHeader:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,hasUnControlledFilterChipSelectInput:false,setHasUnControlledFilterChipSelectInput:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{current:null},isTagDismissedRef:{current:null},visibleTagsCountRef:{current:null},triggererWrapperRef:{current:null}});var searchTimeout;var searchString='';var useDropdown=function useDropdown(){var _React$useContext=React__default.useContext(DropdownContext),isOpen=_React$useContext.isOpen,setIsOpen=_React$useContext.setIsOpen,close=_React$useContext.close,selectedIndices=_React$useContext.selectedIndices,setSelectedIndices=_React$useContext.setSelectedIndices,activeIndex=_React$useContext.activeIndex,setActiveIndex=_React$useContext.setActiveIndex,activeTagIndex=_React$useContext.activeTagIndex,setActiveTagIndex=_React$useContext.setActiveTagIndex,visibleTagsCountRef=_React$useContext.visibleTagsCountRef,isKeydownPressed=_React$useContext.isKeydownPressed,setIsKeydownPressed=_React$useContext.setIsKeydownPressed,options=_React$useContext.options,selectionType=_React$useContext.selectionType,changeCallbackTriggerer=_React$useContext.changeCallbackTriggerer,setChangeCallbackTriggerer=_React$useContext.setChangeCallbackTriggerer,isControlled=_React$useContext.isControlled,setControlledValueIndices=_React$useContext.setControlledValueIndices,filteredValues=_React$useContext.filteredValues,dropdownTriggerer=_React$useContext.dropdownTriggerer,rest=_objectWithoutProperties(_React$useContext,_excluded);var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};var removeOption=function removeOption(index){var existingItemIndex=selectedIndices.indexOf(index);if(existingItemIndex<0){return;}setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));};var selectOption=function selectOption(index){var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{closeOnSelection:true};var isSelected=false;if(index<0||index>options.length-1){return isSelected;}if(selectionType==='multiple'){if(selectedIndices.includes(index)){removeOption(index);isSelected=false;}else {setIndices([].concat(_toConsumableArray(selectedIndices),[index]));isSelected=true;}}else {setIndices([index]);isSelected=true;}setChangeCallbackTriggerer(changeCallbackTriggerer+1);if(activeIndex!==index){setActiveIndex(index);}if(properties!=null&&properties.closeOnSelection&&selectionType!=='multiple'){close();}return isSelected;};var onTriggerClick=function onTriggerClick(){if(isOpen){close();}else {setIsOpen(true);}};var onOptionChange=function onOptionChange(actionType,index){setActiveTagIndex(-1);var newIndex=index!=null?index:activeIndex;var updatedIndex;var hasAutoComplete=rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;if(hasAutoComplete&&filteredValues.length>0){var filteredIndexes=filteredValues.map(function(filteredValue){return options.findIndex(function(option){return option.value===filteredValue;});}).sort(function(a,b){return a-b;});updatedIndex=filteredIndexes[getUpdatedIndex({currentIndex:filteredIndexes.indexOf(newIndex),maxIndex:filteredIndexes.length-1,actionType:actionType})];}else {updatedIndex=getUpdatedIndex({currentIndex:newIndex,maxIndex:options.length-1,actionType:actionType});}setActiveIndex(updatedIndex);var optionValues=options.map(function(option){return option.value;});ensureScrollVisiblity(updatedIndex,rest.actionListItemRef.current,optionValues);if(isBrowser()){fireNativeEvent(rest.actionListItemRef);}};var onOptionClick=function onOptionClick(e,index){var actionType=getActionFromKey(e,isOpen,dropdownTriggerer);if(typeof actionType==='number'){onOptionChange(actionType,index);}selectOption(index);if(!isReactNative()){var _rest$triggererRef$cu;(_rest$triggererRef$cu=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu.focus();}};var onComboType=function onComboType(letter,actionType){setIsOpen(true);if(rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return;}if(typeof searchTimeout==='number'){window.clearTimeout(searchTimeout);}searchTimeout=window.setTimeout(function(){searchString='';},500);searchString=searchString+letter;var optionTitles=options.map(function(option){return option.title;});var searchIndex=getIndexByLetter(optionTitles,searchString,activeIndex+1);if(searchIndex>=0){onOptionChange(actionType,searchIndex);}else {window.clearTimeout(searchTimeout);searchString='';}};var onTriggerKeydown=function onTriggerKeydown(e){if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen,dropdownTriggerer);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;if(activeIndex<0){return;}var isSelected=selectOption(activeIndex);if(rest.hasFooterAction&&!isReactNative()){var _rest$triggererRef$cu2;(_rest$triggererRef$cu2=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu2.focus();}(_options$activeIndex$=(_options$activeIndex=options[activeIndex]).onClickTrigger)==null?void 0:_options$activeIndex$.call(_options$activeIndex,isSelected);}});}};return Object.assign({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,filteredValues:filteredValues,removeOption:removeOption,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType,dropdownTriggerer:dropdownTriggerer},rest);};
13
+ var _excluded=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices","filteredValues","dropdownTriggerer"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,filteredValues:[],setFilteredValues:noop,activeIndex:-1,setActiveIndex:noop,activeTagIndex:-1,setActiveTagIndex:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasAutoCompleteInHeader:false,setHasAutoCompleteInHeader:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,hasUnControlledFilterChipSelectInput:false,setHasUnControlledFilterChipSelectInput:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{current:null},headerAutoCompleteRef:{current:null},isTagDismissedRef:{current:null},visibleTagsCountRef:{current:null},triggererWrapperRef:{current:null}});var searchTimeout;var searchString='';var useDropdown=function useDropdown(){var _React$useContext=React__default.useContext(DropdownContext),isOpen=_React$useContext.isOpen,setIsOpen=_React$useContext.setIsOpen,close=_React$useContext.close,selectedIndices=_React$useContext.selectedIndices,setSelectedIndices=_React$useContext.setSelectedIndices,activeIndex=_React$useContext.activeIndex,setActiveIndex=_React$useContext.setActiveIndex,activeTagIndex=_React$useContext.activeTagIndex,setActiveTagIndex=_React$useContext.setActiveTagIndex,visibleTagsCountRef=_React$useContext.visibleTagsCountRef,isKeydownPressed=_React$useContext.isKeydownPressed,setIsKeydownPressed=_React$useContext.setIsKeydownPressed,options=_React$useContext.options,selectionType=_React$useContext.selectionType,changeCallbackTriggerer=_React$useContext.changeCallbackTriggerer,setChangeCallbackTriggerer=_React$useContext.setChangeCallbackTriggerer,isControlled=_React$useContext.isControlled,setControlledValueIndices=_React$useContext.setControlledValueIndices,filteredValues=_React$useContext.filteredValues,dropdownTriggerer=_React$useContext.dropdownTriggerer,rest=_objectWithoutProperties(_React$useContext,_excluded);var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};var removeOption=function removeOption(index){var existingItemIndex=selectedIndices.indexOf(index);if(existingItemIndex<0){return;}setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));};var selectOption=function selectOption(index){var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{closeOnSelection:true};var isSelected=false;if(index<0||index>options.length-1){return isSelected;}if(selectionType==='multiple'){if(selectedIndices.includes(index)){removeOption(index);isSelected=false;}else {setIndices([].concat(_toConsumableArray(selectedIndices),[index]));isSelected=true;}}else {setIndices([index]);isSelected=true;}setChangeCallbackTriggerer(changeCallbackTriggerer+1);if(activeIndex!==index){setActiveIndex(index);}if(properties!=null&&properties.closeOnSelection&&selectionType!=='multiple'){close();}return isSelected;};var onTriggerClick=function onTriggerClick(){if(isOpen){close();}else {setIsOpen(true);}};var onOptionChange=function onOptionChange(actionType,index){setActiveTagIndex(-1);var newIndex=index!=null?index:activeIndex;var updatedIndex;var hasAutoComplete=rest.hasAutoCompleteInHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;if(hasAutoComplete&&filteredValues.length>0){var filteredIndexes=filteredValues.map(function(filteredValue){return options.findIndex(function(option){return option.value===filteredValue;});}).sort(function(a,b){return a-b;});updatedIndex=filteredIndexes[getUpdatedIndex({currentIndex:filteredIndexes.indexOf(newIndex),maxIndex:filteredIndexes.length-1,actionType:actionType})];}else {updatedIndex=getUpdatedIndex({currentIndex:newIndex,maxIndex:options.length-1,actionType:actionType});}setActiveIndex(updatedIndex);var optionValues=options.map(function(option){return option.value;});ensureScrollVisiblity(updatedIndex,rest.actionListItemRef.current,optionValues);if(isBrowser()){fireNativeEvent(rest.actionListItemRef);}};var onOptionClick=function onOptionClick(e,index){setIsKeydownPressed(false);var actionType=getActionFromKey(e,isOpen,dropdownTriggerer);if(typeof actionType==='number'){onOptionChange(actionType,index);}selectOption(index);if(!isReactNative()){if(rest.hasAutoCompleteInHeader){var _rest$headerAutoCompl;(_rest$headerAutoCompl=rest.headerAutoCompleteRef.current)==null?void 0:_rest$headerAutoCompl.focus();}else {var _rest$triggererRef$cu;(_rest$triggererRef$cu=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu.focus();}}};var onComboType=function onComboType(letter,actionType){setIsOpen(true);if(rest.hasAutoCompleteInHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return;}if(typeof searchTimeout==='number'){window.clearTimeout(searchTimeout);}searchTimeout=window.setTimeout(function(){searchString='';},500);searchString=searchString+letter;var optionTitles=options.map(function(option){return option.title;});var searchIndex=getIndexByLetter(optionTitles,searchString,activeIndex+1);if(searchIndex>=0){onOptionChange(actionType,searchIndex);}else {window.clearTimeout(searchTimeout);searchString='';}};var onTriggerKeydown=function onTriggerKeydown(e){if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen,dropdownTriggerer);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;if(activeIndex<0){return;}var isSelected=selectOption(activeIndex);if(rest.hasFooterAction&&!isReactNative()){var _rest$triggererRef$cu2;(_rest$triggererRef$cu2=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu2.focus();}(_options$activeIndex$=(_options$activeIndex=options[activeIndex]).onClickTrigger)==null?void 0:_options$activeIndex$.call(_options$activeIndex,isSelected);}});}};return Object.assign({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,filteredValues:filteredValues,removeOption:removeOption,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType,dropdownTriggerer:dropdownTriggerer},rest);};
14
14
 
15
15
  export { DropdownContext, useDropdown };
16
16
  //# sourceMappingURL=useDropdown.js.map