@razorpay/blade 12.49.4 → 12.49.6

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 (624) hide show
  1. package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
  2. package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
  3. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  4. package/build/lib/native/components/ActionList/actionListUtils.js.map +1 -1
  5. package/build/lib/native/components/Alert/Alert.js.map +1 -1
  6. package/build/lib/native/components/Amount/Amount.js.map +1 -1
  7. package/build/lib/native/components/Badge/Badge.js.map +1 -1
  8. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  9. package/build/lib/native/components/BladeProvider/useBladeProvider.js.map +1 -1
  10. package/build/lib/native/components/BottomSheet/BottomSheet.native.js +1 -1
  11. package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
  12. package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
  13. package/build/lib/native/components/Box/Box.js.map +1 -1
  14. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  15. package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
  16. package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
  17. package/build/lib/native/components/Button/IconButton/StyledIconButton.native.js.map +1 -1
  18. package/build/lib/native/components/Card/CardContext.js.map +1 -1
  19. package/build/lib/native/components/Card/CardFooter.js.map +1 -1
  20. package/build/lib/native/components/Card/CardHeader.js.map +1 -1
  21. package/build/lib/native/components/Card/CardRoot.native.js.map +1 -1
  22. package/build/lib/native/components/Card/CardSurface.native.js.map +1 -1
  23. package/build/lib/native/components/Carousel/Carousel.native.js.map +1 -1
  24. package/build/lib/native/components/Carousel/CarouselItem.native.js.map +1 -1
  25. package/build/lib/native/components/Carousel/Indicators/Indicators.js.map +1 -1
  26. package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
  27. package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
  28. package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  29. package/build/lib/native/components/Checkbox/useCheckbox.js.map +1 -1
  30. package/build/lib/native/components/Chip/ChipGroup.js.map +1 -1
  31. package/build/lib/native/components/Chip/chipTokens.js.map +1 -1
  32. package/build/lib/native/components/Chip/useChipGroup.js.map +1 -1
  33. package/build/lib/native/components/Collapsible/Collapsible.js.map +1 -1
  34. package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js.map +1 -1
  35. package/build/lib/native/components/Collapsible/CollapsibleContext.js.map +1 -1
  36. package/build/lib/native/components/Counter/Counter.js.map +1 -1
  37. package/build/lib/native/components/Divider/Divider.js.map +1 -1
  38. package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
  39. package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
  40. package/build/lib/native/components/Dropdown/DropdownButton.js +1 -1
  41. package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
  42. package/build/lib/native/components/Dropdown/DropdownIconButton.js +1 -1
  43. package/build/lib/native/components/Dropdown/DropdownIconButton.js.map +1 -1
  44. package/build/lib/native/components/Dropdown/DropdownLink.js +1 -1
  45. package/build/lib/native/components/Dropdown/DropdownLink.js.map +1 -1
  46. package/build/lib/native/components/Dropdown/DropdownOverlay.native.js.map +1 -1
  47. package/build/lib/native/components/Dropdown/dropdownUtils.js.map +1 -1
  48. package/build/lib/native/components/Form/useFormId.js.map +1 -1
  49. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  50. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  51. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
  52. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  53. package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
  54. package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js +1 -1
  55. package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
  56. package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
  57. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  58. package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
  59. package/build/lib/native/components/Link/BaseLink/StyledBaseLink.native.js.map +1 -1
  60. package/build/lib/native/components/List/ListItem.js.map +1 -1
  61. package/build/lib/native/components/List/getOrderedListItemBullet.js.map +1 -1
  62. package/build/lib/native/components/Popover/PopoverContext.js.map +1 -1
  63. package/build/lib/native/components/PopupArrow/PopupArrow.native.js.map +1 -1
  64. package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js.map +1 -1
  65. package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
  66. package/build/lib/native/components/ProgressBar/ProgressBarFilled.native.js.map +1 -1
  67. package/build/lib/native/components/ProgressBar/progressBarTokens.js.map +1 -1
  68. package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  69. package/build/lib/native/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
  70. package/build/lib/native/components/Radio/RadioIcon/RadioIcon.js.map +1 -1
  71. package/build/lib/native/components/Radio/useRadio.js.map +1 -1
  72. package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  73. package/build/lib/native/components/Spinner/BaseSpinner/SpinningBox.native.js.map +1 -1
  74. package/build/lib/native/components/StepGroup/StepItemMarker.js.map +1 -1
  75. package/build/lib/native/components/Switch/getTrackStyles.js.map +1 -1
  76. package/build/lib/native/components/Tabs/SafeSceneMap.native.js.map +1 -1
  77. package/build/lib/native/components/Tabs/utils.js.map +1 -1
  78. package/build/lib/native/components/Tag/Tag.js.map +1 -1
  79. package/build/lib/native/components/Tag/getTagsGroup.js.map +1 -1
  80. package/build/lib/native/components/Tooltip/TooltipContext.js.map +1 -1
  81. package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
  82. package/build/lib/native/components/Typography/Code/Code.js.map +1 -1
  83. package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
  84. package/build/lib/native/components/Typography/utils.js.map +1 -1
  85. package/build/lib/native/components/VisuallyHidden/ScreenReaderStyles.js.map +1 -1
  86. package/build/lib/native/tokens/global/colors.js.map +1 -1
  87. package/build/lib/native/tokens/global/elevation/elevation.native.js.map +1 -1
  88. package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
  89. package/build/lib/native/tokens/theme/createTheme.js.map +1 -1
  90. package/build/lib/native/utils/getMediaQuery/getMediaQuery.js.map +1 -1
  91. package/build/lib/native/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
  92. package/build/lib/native/utils/logger/logger.js.map +1 -1
  93. package/build/lib/native/utils/makeAccessible/makeAccessible.native.js.map +1 -1
  94. package/build/lib/native/utils/makeBorderSize/makeBorderSize.js.map +1 -1
  95. package/build/lib/native/utils/makeLetterSpacing/makeLetterSpacing.js.map +1 -1
  96. package/build/lib/native/utils/makeSize/makeSize.js.map +1 -1
  97. package/build/lib/native/utils/makeSpace/makeSpace.js.map +1 -1
  98. package/build/lib/native/utils/makeTypographySize/makeTypographySize.native.js.map +1 -1
  99. package/build/lib/native/utils/metaAttribute/metaAttribute.native.js.map +1 -1
  100. package/build/lib/native/utils/useColorScheme/useColorScheme.js.map +1 -1
  101. package/build/lib/native/utils/useId.js.map +1 -1
  102. package/build/lib/native/utils/useMergeRefs.js.map +1 -1
  103. package/build/lib/native/utils/useVerifyAllowedChildren/useVerifyAllowedChildren.js.map +1 -1
  104. package/build/lib/web/development/components/Accordion/Accordion.js +2 -2
  105. package/build/lib/web/development/components/Accordion/Accordion.js.map +1 -1
  106. package/build/lib/web/development/components/ActionList/ActionList.js +1 -1
  107. package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
  108. package/build/lib/web/development/components/ActionList/ActionListBox.web.js +7 -7
  109. package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
  110. package/build/lib/web/development/components/ActionList/ActionListItem.js +4 -4
  111. package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
  112. package/build/lib/web/development/components/ActionList/actionListUtils.js +4 -4
  113. package/build/lib/web/development/components/ActionList/actionListUtils.js.map +1 -1
  114. package/build/lib/web/development/components/Amount/Amount.js +2 -2
  115. package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
  116. package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js.map +1 -1
  117. package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js +2 -2
  118. package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +1 -1
  119. package/build/lib/web/development/components/Avatar/Avatar.web.js +1 -1
  120. package/build/lib/web/development/components/Avatar/Avatar.web.js.map +1 -1
  121. package/build/lib/web/development/components/Badge/Badge.js +1 -1
  122. package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
  123. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +2 -2
  124. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  125. package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js +2 -2
  126. package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js.map +1 -1
  127. package/build/lib/web/development/components/BladeProvider/useTheme.js.map +1 -1
  128. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +19 -19
  129. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  130. package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
  131. package/build/lib/web/development/components/BottomSheet/BottomSheetContext.js.map +1 -1
  132. package/build/lib/web/development/components/BottomSheet/BottomSheetStack.js.map +1 -1
  133. package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +27 -27
  134. package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
  135. package/build/lib/web/development/components/Box/Box.js +1 -1
  136. package/build/lib/web/development/components/Box/Box.js.map +1 -1
  137. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +5 -5
  138. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  139. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
  140. package/build/lib/web/development/components/Button/Button/Button.js +2 -2
  141. package/build/lib/web/development/components/Button/Button/Button.js.map +1 -1
  142. package/build/lib/web/development/components/Button/IconButton/IconButton.js +1 -1
  143. package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
  144. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +1 -1
  145. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  146. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  147. package/build/lib/web/development/components/Card/CardFooter.js +2 -2
  148. package/build/lib/web/development/components/Card/CardFooter.js.map +1 -1
  149. package/build/lib/web/development/components/Card/CardRoot.web.js.map +1 -1
  150. package/build/lib/web/development/components/Carousel/Carousel.web.js +6 -6
  151. package/build/lib/web/development/components/Carousel/Carousel.web.js.map +1 -1
  152. package/build/lib/web/development/components/Carousel/CarouselItem.web.js +2 -2
  153. package/build/lib/web/development/components/Carousel/CarouselItem.web.js.map +1 -1
  154. package/build/lib/web/development/components/Carousel/Indicators/Indicators.js +1 -1
  155. package/build/lib/web/development/components/Carousel/Indicators/Indicators.js.map +1 -1
  156. package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js +1 -1
  157. package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js.map +1 -1
  158. package/build/lib/web/development/components/Checkbox/Checkbox.js +5 -5
  159. package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
  160. package/build/lib/web/development/components/Checkbox/CheckboxGroup/useCheckboxGroup.js.map +1 -1
  161. package/build/lib/web/development/components/Checkbox/useCheckbox.js +1 -1
  162. package/build/lib/web/development/components/Checkbox/useCheckbox.js.map +1 -1
  163. package/build/lib/web/development/components/Chip/Chip.js +5 -5
  164. package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
  165. package/build/lib/web/development/components/Chip/useChipGroup.js.map +1 -1
  166. package/build/lib/web/development/components/Collapsible/Collapsible.js +3 -3
  167. package/build/lib/web/development/components/Collapsible/Collapsible.js.map +1 -1
  168. package/build/lib/web/development/components/Collapsible/CollapsibleButton.js +1 -1
  169. package/build/lib/web/development/components/Collapsible/CollapsibleButton.js.map +1 -1
  170. package/build/lib/web/development/components/Counter/Counter.js +1 -1
  171. package/build/lib/web/development/components/Counter/Counter.js.map +1 -1
  172. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +23 -17
  173. package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  174. package/build/lib/web/development/components/DatePicker/Calendar.web.js +7 -7
  175. package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
  176. package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js +42 -24
  177. package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js.map +1 -1
  178. package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js.map +1 -1
  179. package/build/lib/web/development/components/DatePicker/DateInput.web.js +4 -4
  180. package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
  181. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +1 -1
  182. package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
  183. package/build/lib/web/development/components/DatePicker/useControlledDates.js +1 -1
  184. package/build/lib/web/development/components/DatePicker/useControlledDates.js.map +1 -1
  185. package/build/lib/web/development/components/DatePicker/useDatesState.js +1 -1
  186. package/build/lib/web/development/components/DatePicker/useDatesState.js.map +1 -1
  187. package/build/lib/web/development/components/DatePicker/usePopup.js +2 -2
  188. package/build/lib/web/development/components/DatePicker/usePopup.js.map +1 -1
  189. package/build/lib/web/development/components/DatePicker/utils.js +1 -1
  190. package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
  191. package/build/lib/web/development/components/Drawer/Drawer.web.js +2 -2
  192. package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
  193. package/build/lib/web/development/components/Drawer/DrawerContext.js.map +1 -1
  194. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  195. package/build/lib/web/development/components/Drawer/StackProvider.js.map +1 -1
  196. package/build/lib/web/development/components/Dropdown/Dropdown.js +28 -28
  197. package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
  198. package/build/lib/web/development/components/Dropdown/DropdownButton.js +4 -4
  199. package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
  200. package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  201. package/build/lib/web/development/components/Dropdown/DropdownIconButton.js +4 -4
  202. package/build/lib/web/development/components/Dropdown/DropdownIconButton.js.map +1 -1
  203. package/build/lib/web/development/components/Dropdown/DropdownLink.js +4 -4
  204. package/build/lib/web/development/components/Dropdown/DropdownLink.js.map +1 -1
  205. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +1 -1
  206. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  207. package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +1 -1
  208. package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
  209. package/build/lib/web/development/components/Dropdown/FilterChipGroupContext.web.js.map +1 -1
  210. package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +7 -7
  211. package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
  212. package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +8 -8
  213. package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -1
  214. package/build/lib/web/development/components/Dropdown/useDropdown.js +4 -4
  215. package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
  216. package/build/lib/web/development/components/EmptyState/EmptyState.web.js +1 -1
  217. package/build/lib/web/development/components/EmptyState/EmptyState.web.js.map +1 -1
  218. package/build/lib/web/development/components/FileUpload/FileUpload.web.js +14 -14
  219. package/build/lib/web/development/components/FileUpload/FileUpload.web.js.map +1 -1
  220. package/build/lib/web/development/components/FileUpload/FileUploadItem.js +1 -1
  221. package/build/lib/web/development/components/FileUpload/FileUploadItem.js.map +1 -1
  222. package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +3 -3
  223. package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
  224. package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
  225. package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +1 -1
  226. package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
  227. package/build/lib/web/development/components/Indicator/Indicator.js +1 -1
  228. package/build/lib/web/development/components/Indicator/Indicator.js.map +1 -1
  229. package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js +6 -6
  230. package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js.map +1 -1
  231. package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js.map +1 -1
  232. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +1 -1
  233. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  234. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +110 -110
  235. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  236. package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +8 -8
  237. package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
  238. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +7 -7
  239. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  240. package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js +4 -4
  241. package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js.map +1 -1
  242. package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js +8 -8
  243. package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
  244. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +4 -4
  245. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  246. package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js +3 -3
  247. package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
  248. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +14 -14
  249. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
  250. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +1 -1
  251. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  252. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
  253. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -5
  254. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
  255. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +5 -5
  256. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
  257. package/build/lib/web/development/components/Input/TextArea/TextArea.js +7 -7
  258. package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
  259. package/build/lib/web/development/components/Input/TextInput/TextInput.js +7 -7
  260. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  261. package/build/lib/web/development/components/Input/TextInput/useFormattedInput.js +2 -2
  262. package/build/lib/web/development/components/Input/TextInput/useFormattedInput.js.map +1 -1
  263. package/build/lib/web/development/components/InputGroup/InputGroup.web.js +1 -1
  264. package/build/lib/web/development/components/InputGroup/InputGroup.web.js.map +1 -1
  265. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +3 -3
  266. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
  267. package/build/lib/web/development/components/Link/Link/Link.js +1 -1
  268. package/build/lib/web/development/components/Link/Link/Link.js.map +1 -1
  269. package/build/lib/web/development/components/List/List.js +1 -1
  270. package/build/lib/web/development/components/List/List.js.map +1 -1
  271. package/build/lib/web/development/components/List/getOrderedListItemBullet.js +3 -3
  272. package/build/lib/web/development/components/List/getOrderedListItemBullet.js.map +1 -1
  273. package/build/lib/web/development/components/ListView/ListViewFilters.web.js.map +1 -1
  274. package/build/lib/web/development/components/ListView/ListViewFiltersContext.web.js.map +1 -1
  275. package/build/lib/web/development/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
  276. package/build/lib/web/development/components/Menu/Menu.web.js.map +1 -1
  277. package/build/lib/web/development/components/Menu/MenuItem.web.js +3 -3
  278. package/build/lib/web/development/components/Menu/MenuItem.web.js.map +1 -1
  279. package/build/lib/web/development/components/Menu/useMenu.js.map +1 -1
  280. package/build/lib/web/development/components/Modal/ModalBackdrop.js.map +1 -1
  281. package/build/lib/web/development/components/Modal/ModalContext.js.map +1 -1
  282. package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
  283. package/build/lib/web/development/components/Preview/Preview.web.js +29 -30
  284. package/build/lib/web/development/components/Preview/Preview.web.js.map +1 -1
  285. package/build/lib/web/development/components/QuickFilters/QuickFilterGroup/QuickFilterGroup.js.map +1 -1
  286. package/build/lib/web/development/components/Radio/Radio.js +4 -4
  287. package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
  288. package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js +1 -1
  289. package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
  290. package/build/lib/web/development/components/Radio/useRadio.js +1 -1
  291. package/build/lib/web/development/components/Radio/useRadio.js.map +1 -1
  292. package/build/lib/web/development/components/SideNav/SideNav.web.js +19 -19
  293. package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
  294. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js +6 -6
  295. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  296. package/build/lib/web/development/components/SideNav/SideNavLevel.web.js.map +1 -1
  297. package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js +7 -7
  298. package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
  299. package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
  300. package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
  301. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +1 -1
  302. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  303. package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
  304. package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js +1 -1
  305. package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js.map +1 -1
  306. package/build/lib/web/development/components/StepGroup/StepGroup.web.js +6 -6
  307. package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
  308. package/build/lib/web/development/components/StepGroup/StepItem.web.js +1 -1
  309. package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
  310. package/build/lib/web/development/components/StepGroup/StepLine.web.js +13 -13
  311. package/build/lib/web/development/components/StepGroup/StepLine.web.js.map +1 -1
  312. package/build/lib/web/development/components/Switch/Switch.js +1 -1
  313. package/build/lib/web/development/components/Switch/Switch.js.map +1 -1
  314. package/build/lib/web/development/components/Table/Table.web.js +10 -10
  315. package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
  316. package/build/lib/web/development/components/Table/TableBody.web.js +6 -6
  317. package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
  318. package/build/lib/web/development/components/Table/TableContext.js.map +1 -1
  319. package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
  320. package/build/lib/web/development/components/Table/TablePagination.web.js +2 -2
  321. package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
  322. package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
  323. package/build/lib/web/development/components/Tabs/TabItem.web.js +2 -2
  324. package/build/lib/web/development/components/Tabs/TabItem.web.js.map +1 -1
  325. package/build/lib/web/development/components/Tabs/TabList.web.js +2 -2
  326. package/build/lib/web/development/components/Tabs/TabList.web.js.map +1 -1
  327. package/build/lib/web/development/components/Tabs/Tabs.web.js +1 -1
  328. package/build/lib/web/development/components/Tabs/Tabs.web.js.map +1 -1
  329. package/build/lib/web/development/components/Tabs/utils.js +2 -2
  330. package/build/lib/web/development/components/Tabs/utils.js.map +1 -1
  331. package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
  332. package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
  333. package/build/lib/web/development/components/Toast/Toast.web.js +2 -2
  334. package/build/lib/web/development/components/Toast/Toast.web.js.map +1 -1
  335. package/build/lib/web/development/components/Toast/ToastContainer.web.js.map +1 -1
  336. package/build/lib/web/development/components/Tooltip/Tooltip.web.js +1 -1
  337. package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
  338. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +2 -2
  339. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  340. package/build/lib/web/development/components/TopNav/TabNav/utils.js +2 -2
  341. package/build/lib/web/development/components/TopNav/TabNav/utils.js.map +1 -1
  342. package/build/lib/web/development/components/Typography/Text/Text.js +1 -1
  343. package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
  344. package/build/lib/web/development/tokens/theme/overrideTheme.js +2 -2
  345. package/build/lib/web/development/tokens/theme/overrideTheme.js.map +1 -1
  346. package/build/lib/web/development/utils/bladeCoverage.js +9 -10
  347. package/build/lib/web/development/utils/bladeCoverage.js.map +1 -1
  348. package/build/lib/web/development/utils/fireNativeEvent/fireNativeEvent.web.js +1 -1
  349. package/build/lib/web/development/utils/fireNativeEvent/fireNativeEvent.web.js.map +1 -1
  350. package/build/lib/web/development/utils/hasSameObjectStructure/hasSameObjectStructure.js +6 -6
  351. package/build/lib/web/development/utils/hasSameObjectStructure/hasSameObjectStructure.js.map +1 -1
  352. package/build/lib/web/development/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js +3 -3
  353. package/build/lib/web/development/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
  354. package/build/lib/web/development/utils/isValidAllowedChildren/isValidAllowedChildren.js +2 -2
  355. package/build/lib/web/development/utils/isValidAllowedChildren/isValidAllowedChildren.js.map +1 -1
  356. package/build/lib/web/development/utils/lodashButBetter/cloneDeep.js +3 -3
  357. package/build/lib/web/development/utils/lodashButBetter/get.js +3 -3
  358. package/build/lib/web/development/utils/useControllable.js +1 -1
  359. package/build/lib/web/development/utils/useControllable.js.map +1 -1
  360. package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +2 -2
  361. package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
  362. package/build/lib/web/development/utils/useScrollLock.js.map +1 -1
  363. package/build/lib/web/production/components/Accordion/Accordion.js +2 -2
  364. package/build/lib/web/production/components/Accordion/Accordion.js.map +1 -1
  365. package/build/lib/web/production/components/ActionList/ActionList.js +1 -1
  366. package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
  367. package/build/lib/web/production/components/ActionList/ActionListBox.web.js +7 -7
  368. package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
  369. package/build/lib/web/production/components/ActionList/ActionListItem.js +4 -4
  370. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  371. package/build/lib/web/production/components/ActionList/actionListUtils.js +4 -4
  372. package/build/lib/web/production/components/ActionList/actionListUtils.js.map +1 -1
  373. package/build/lib/web/production/components/Amount/Amount.js +2 -2
  374. package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
  375. package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js.map +1 -1
  376. package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js +2 -2
  377. package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +1 -1
  378. package/build/lib/web/production/components/Avatar/Avatar.web.js +1 -1
  379. package/build/lib/web/production/components/Avatar/Avatar.web.js.map +1 -1
  380. package/build/lib/web/production/components/Badge/Badge.js +1 -1
  381. package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
  382. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +2 -2
  383. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  384. package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js +2 -2
  385. package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js.map +1 -1
  386. package/build/lib/web/production/components/BladeProvider/useTheme.js.map +1 -1
  387. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +19 -19
  388. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  389. package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
  390. package/build/lib/web/production/components/BottomSheet/BottomSheetContext.js.map +1 -1
  391. package/build/lib/web/production/components/BottomSheet/BottomSheetStack.js.map +1 -1
  392. package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +27 -27
  393. package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
  394. package/build/lib/web/production/components/Box/Box.js +1 -1
  395. package/build/lib/web/production/components/Box/Box.js.map +1 -1
  396. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +5 -5
  397. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  398. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
  399. package/build/lib/web/production/components/Button/Button/Button.js +2 -2
  400. package/build/lib/web/production/components/Button/Button/Button.js.map +1 -1
  401. package/build/lib/web/production/components/Button/IconButton/IconButton.js +1 -1
  402. package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
  403. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +1 -1
  404. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  405. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  406. package/build/lib/web/production/components/Card/CardFooter.js +2 -2
  407. package/build/lib/web/production/components/Card/CardFooter.js.map +1 -1
  408. package/build/lib/web/production/components/Card/CardRoot.web.js.map +1 -1
  409. package/build/lib/web/production/components/Carousel/Carousel.web.js +6 -6
  410. package/build/lib/web/production/components/Carousel/Carousel.web.js.map +1 -1
  411. package/build/lib/web/production/components/Carousel/CarouselItem.web.js +2 -2
  412. package/build/lib/web/production/components/Carousel/CarouselItem.web.js.map +1 -1
  413. package/build/lib/web/production/components/Carousel/Indicators/Indicators.js +1 -1
  414. package/build/lib/web/production/components/Carousel/Indicators/Indicators.js.map +1 -1
  415. package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js +1 -1
  416. package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js.map +1 -1
  417. package/build/lib/web/production/components/Checkbox/Checkbox.js +5 -5
  418. package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
  419. package/build/lib/web/production/components/Checkbox/CheckboxGroup/useCheckboxGroup.js.map +1 -1
  420. package/build/lib/web/production/components/Checkbox/useCheckbox.js +1 -1
  421. package/build/lib/web/production/components/Checkbox/useCheckbox.js.map +1 -1
  422. package/build/lib/web/production/components/Chip/Chip.js +5 -5
  423. package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
  424. package/build/lib/web/production/components/Chip/useChipGroup.js.map +1 -1
  425. package/build/lib/web/production/components/Collapsible/Collapsible.js +3 -3
  426. package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
  427. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js +1 -1
  428. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js.map +1 -1
  429. package/build/lib/web/production/components/Counter/Counter.js +1 -1
  430. package/build/lib/web/production/components/Counter/Counter.js.map +1 -1
  431. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +23 -17
  432. package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
  433. package/build/lib/web/production/components/DatePicker/Calendar.web.js +7 -7
  434. package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
  435. package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js +42 -24
  436. package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js.map +1 -1
  437. package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js.map +1 -1
  438. package/build/lib/web/production/components/DatePicker/DateInput.web.js +4 -4
  439. package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
  440. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +1 -1
  441. package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
  442. package/build/lib/web/production/components/DatePicker/useControlledDates.js +1 -1
  443. package/build/lib/web/production/components/DatePicker/useControlledDates.js.map +1 -1
  444. package/build/lib/web/production/components/DatePicker/useDatesState.js +1 -1
  445. package/build/lib/web/production/components/DatePicker/useDatesState.js.map +1 -1
  446. package/build/lib/web/production/components/DatePicker/usePopup.js +2 -2
  447. package/build/lib/web/production/components/DatePicker/usePopup.js.map +1 -1
  448. package/build/lib/web/production/components/DatePicker/utils.js +1 -1
  449. package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
  450. package/build/lib/web/production/components/Drawer/Drawer.web.js +2 -2
  451. package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
  452. package/build/lib/web/production/components/Drawer/DrawerContext.js.map +1 -1
  453. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  454. package/build/lib/web/production/components/Drawer/StackProvider.js.map +1 -1
  455. package/build/lib/web/production/components/Dropdown/Dropdown.js +28 -28
  456. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  457. package/build/lib/web/production/components/Dropdown/DropdownButton.js +4 -4
  458. package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
  459. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  460. package/build/lib/web/production/components/Dropdown/DropdownIconButton.js +4 -4
  461. package/build/lib/web/production/components/Dropdown/DropdownIconButton.js.map +1 -1
  462. package/build/lib/web/production/components/Dropdown/DropdownLink.js +4 -4
  463. package/build/lib/web/production/components/Dropdown/DropdownLink.js.map +1 -1
  464. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +1 -1
  465. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  466. package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +1 -1
  467. package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
  468. package/build/lib/web/production/components/Dropdown/FilterChipGroupContext.web.js.map +1 -1
  469. package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +7 -7
  470. package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
  471. package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +8 -8
  472. package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -1
  473. package/build/lib/web/production/components/Dropdown/useDropdown.js +4 -4
  474. package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
  475. package/build/lib/web/production/components/EmptyState/EmptyState.web.js +1 -1
  476. package/build/lib/web/production/components/EmptyState/EmptyState.web.js.map +1 -1
  477. package/build/lib/web/production/components/FileUpload/FileUpload.web.js +14 -14
  478. package/build/lib/web/production/components/FileUpload/FileUpload.web.js.map +1 -1
  479. package/build/lib/web/production/components/FileUpload/FileUploadItem.js +1 -1
  480. package/build/lib/web/production/components/FileUpload/FileUploadItem.js.map +1 -1
  481. package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +3 -3
  482. package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
  483. package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
  484. package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +1 -1
  485. package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
  486. package/build/lib/web/production/components/Indicator/Indicator.js +1 -1
  487. package/build/lib/web/production/components/Indicator/Indicator.js.map +1 -1
  488. package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js +6 -6
  489. package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js.map +1 -1
  490. package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js.map +1 -1
  491. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +1 -1
  492. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  493. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +110 -110
  494. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  495. package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +8 -8
  496. package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
  497. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +7 -7
  498. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  499. package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js +4 -4
  500. package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js.map +1 -1
  501. package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js +8 -8
  502. package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
  503. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +4 -4
  504. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  505. package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js +3 -3
  506. package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
  507. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +14 -14
  508. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
  509. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +1 -1
  510. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  511. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
  512. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -5
  513. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
  514. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +5 -5
  515. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
  516. package/build/lib/web/production/components/Input/TextArea/TextArea.js +7 -7
  517. package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
  518. package/build/lib/web/production/components/Input/TextInput/TextInput.js +7 -7
  519. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  520. package/build/lib/web/production/components/Input/TextInput/useFormattedInput.js +2 -2
  521. package/build/lib/web/production/components/Input/TextInput/useFormattedInput.js.map +1 -1
  522. package/build/lib/web/production/components/InputGroup/InputGroup.web.js +1 -1
  523. package/build/lib/web/production/components/InputGroup/InputGroup.web.js.map +1 -1
  524. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +3 -3
  525. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
  526. package/build/lib/web/production/components/Link/Link/Link.js +1 -1
  527. package/build/lib/web/production/components/Link/Link/Link.js.map +1 -1
  528. package/build/lib/web/production/components/List/List.js +1 -1
  529. package/build/lib/web/production/components/List/List.js.map +1 -1
  530. package/build/lib/web/production/components/List/getOrderedListItemBullet.js +3 -3
  531. package/build/lib/web/production/components/List/getOrderedListItemBullet.js.map +1 -1
  532. package/build/lib/web/production/components/ListView/ListViewFilters.web.js.map +1 -1
  533. package/build/lib/web/production/components/ListView/ListViewFiltersContext.web.js.map +1 -1
  534. package/build/lib/web/production/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
  535. package/build/lib/web/production/components/Menu/Menu.web.js.map +1 -1
  536. package/build/lib/web/production/components/Menu/MenuItem.web.js +3 -3
  537. package/build/lib/web/production/components/Menu/MenuItem.web.js.map +1 -1
  538. package/build/lib/web/production/components/Menu/useMenu.js.map +1 -1
  539. package/build/lib/web/production/components/Modal/ModalBackdrop.js.map +1 -1
  540. package/build/lib/web/production/components/Modal/ModalContext.js.map +1 -1
  541. package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
  542. package/build/lib/web/production/components/Preview/Preview.web.js +29 -30
  543. package/build/lib/web/production/components/Preview/Preview.web.js.map +1 -1
  544. package/build/lib/web/production/components/QuickFilters/QuickFilterGroup/QuickFilterGroup.js.map +1 -1
  545. package/build/lib/web/production/components/Radio/Radio.js +4 -4
  546. package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
  547. package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js +1 -1
  548. package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
  549. package/build/lib/web/production/components/Radio/useRadio.js +1 -1
  550. package/build/lib/web/production/components/Radio/useRadio.js.map +1 -1
  551. package/build/lib/web/production/components/SideNav/SideNav.web.js +19 -19
  552. package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
  553. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js +6 -6
  554. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  555. package/build/lib/web/production/components/SideNav/SideNavLevel.web.js.map +1 -1
  556. package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +7 -7
  557. package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
  558. package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
  559. package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
  560. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +1 -1
  561. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  562. package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
  563. package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js +1 -1
  564. package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js.map +1 -1
  565. package/build/lib/web/production/components/StepGroup/StepGroup.web.js +6 -6
  566. package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
  567. package/build/lib/web/production/components/StepGroup/StepItem.web.js +1 -1
  568. package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
  569. package/build/lib/web/production/components/StepGroup/StepLine.web.js +13 -13
  570. package/build/lib/web/production/components/StepGroup/StepLine.web.js.map +1 -1
  571. package/build/lib/web/production/components/Switch/Switch.js +1 -1
  572. package/build/lib/web/production/components/Switch/Switch.js.map +1 -1
  573. package/build/lib/web/production/components/Table/Table.web.js +10 -10
  574. package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
  575. package/build/lib/web/production/components/Table/TableBody.web.js +6 -6
  576. package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
  577. package/build/lib/web/production/components/Table/TableContext.js.map +1 -1
  578. package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
  579. package/build/lib/web/production/components/Table/TablePagination.web.js +2 -2
  580. package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
  581. package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
  582. package/build/lib/web/production/components/Tabs/TabItem.web.js +2 -2
  583. package/build/lib/web/production/components/Tabs/TabItem.web.js.map +1 -1
  584. package/build/lib/web/production/components/Tabs/TabList.web.js +2 -2
  585. package/build/lib/web/production/components/Tabs/TabList.web.js.map +1 -1
  586. package/build/lib/web/production/components/Tabs/Tabs.web.js +1 -1
  587. package/build/lib/web/production/components/Tabs/Tabs.web.js.map +1 -1
  588. package/build/lib/web/production/components/Tabs/utils.js +2 -2
  589. package/build/lib/web/production/components/Tabs/utils.js.map +1 -1
  590. package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
  591. package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
  592. package/build/lib/web/production/components/Toast/Toast.web.js +2 -2
  593. package/build/lib/web/production/components/Toast/Toast.web.js.map +1 -1
  594. package/build/lib/web/production/components/Toast/ToastContainer.web.js.map +1 -1
  595. package/build/lib/web/production/components/Tooltip/Tooltip.web.js +1 -1
  596. package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
  597. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +2 -2
  598. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  599. package/build/lib/web/production/components/TopNav/TabNav/utils.js +2 -2
  600. package/build/lib/web/production/components/TopNav/TabNav/utils.js.map +1 -1
  601. package/build/lib/web/production/components/Typography/Text/Text.js +1 -1
  602. package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
  603. package/build/lib/web/production/tokens/theme/overrideTheme.js +2 -2
  604. package/build/lib/web/production/tokens/theme/overrideTheme.js.map +1 -1
  605. package/build/lib/web/production/utils/bladeCoverage.js +9 -10
  606. package/build/lib/web/production/utils/bladeCoverage.js.map +1 -1
  607. package/build/lib/web/production/utils/fireNativeEvent/fireNativeEvent.web.js +1 -1
  608. package/build/lib/web/production/utils/fireNativeEvent/fireNativeEvent.web.js.map +1 -1
  609. package/build/lib/web/production/utils/hasSameObjectStructure/hasSameObjectStructure.js +6 -6
  610. package/build/lib/web/production/utils/hasSameObjectStructure/hasSameObjectStructure.js.map +1 -1
  611. package/build/lib/web/production/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js +3 -3
  612. package/build/lib/web/production/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
  613. package/build/lib/web/production/utils/isValidAllowedChildren/isValidAllowedChildren.js +2 -2
  614. package/build/lib/web/production/utils/isValidAllowedChildren/isValidAllowedChildren.js.map +1 -1
  615. package/build/lib/web/production/utils/lodashButBetter/cloneDeep.js +3 -3
  616. package/build/lib/web/production/utils/lodashButBetter/get.js +3 -3
  617. package/build/lib/web/production/utils/useControllable.js +1 -1
  618. package/build/lib/web/production/utils/useControllable.js.map +1 -1
  619. package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +2 -2
  620. package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
  621. package/build/lib/web/production/utils/useScrollLock.js.map +1 -1
  622. package/build/types/components/index.d.ts +5 -0
  623. package/build/types/components/index.native.d.ts +5 -0
  624. package/package.json +15 -10
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionButton.native.js","sources":["../../../../../src/components/Accordion/AccordionButton.native.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useEffect } from 'react';\nimport type { PressableProps } from 'react-native';\nimport { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport { StyledAccordionButton } from './StyledAccordionButton.native';\nimport type { AccordionButtonProps } from './types';\nimport { useAccordion } from './AccordionContext';\nimport { getBackgroundColor, getTransitionDuration, getTransitionEasing } from './commonStyles';\nimport { AccordionItemHeader } from './AccordionItemHeader';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { castNativeType } from '~utils';\nimport { useCollapsible } from '~components/Collapsible/CollapsibleContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\nconst _AccordionButton = ({\n index,\n icon: Icon,\n title,\n isDeprecatedAPI,\n isDisabled,\n header,\n}: AccordionButtonProps): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n const { showNumberPrefix, expandedIndex } = useAccordion();\n const { theme } = useTheme();\n\n const toggleCollapse = (): void => onExpandChange(!isExpanded);\n const isItemExpanded = expandedIndex === index;\n\n const isPressed = useSharedValue(false);\n\n const duration = castNativeType(getTransitionDuration(theme));\n const easing = castNativeType(getTransitionEasing(theme));\n\n const activeBackgroundColor = useSharedValue(getBackgroundColor({ theme, isActive: true }));\n const inActiveBackgroundColor = useSharedValue(getBackgroundColor({ theme, isActive: false }));\n\n /**\n * `backgroundColor` is derived from `isExpanded` and pressed state.\n *\n * Since we can't directly access return values from JS functions (`getBackgroundColor`) on UI thread,\n * this effect updates the shared values for active / inactive states which are used by `animatedStyles`.\n */\n useEffect(() => {\n activeBackgroundColor.value = getBackgroundColor({ theme, isActive: true });\n inActiveBackgroundColor.value = getBackgroundColor({ theme, isActive: false });\n }, [activeBackgroundColor, inActiveBackgroundColor, theme]);\n\n const animatedStyles = useAnimatedStyle(() => ({\n backgroundColor: withTiming(\n isPressed.value ? activeBackgroundColor.value : inActiveBackgroundColor.value,\n {\n duration,\n easing,\n },\n ),\n }));\n\n const _showNumberPrefix = typeof index === 'number' && showNumberPrefix;\n\n const _index = _showNumberPrefix ? (\n <Text size=\"large\" weight=\"semibold\" marginRight=\"spacing.2\">\n {index + 1}.\n </Text>\n ) : null;\n\n const a11yLabel = _showNumberPrefix ? `${index + 1}. ${title}` : title;\n\n const renderChildren: PressableProps['children'] = ({ pressed }) => {\n isPressed.value = pressed;\n\n const _icon = Icon && (\n <Icon\n size=\"medium\"\n color=\"surface.icon.gray.normal\"\n marginRight=\"spacing.3\"\n marginY=\"spacing.2\"\n />\n );\n\n if (__DEV__) {\n if (_index && _icon) {\n throwBladeError({\n message: \"showNumberPrefix and icon shouldn't be used together\",\n moduleName: 'Accordion',\n });\n }\n }\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n flex={1}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n {isDeprecatedAPI ? <AccordionItemHeader title={title} leading={_icon ?? _index} /> : header}\n </BaseBox>\n );\n };\n\n return (\n <StyledAccordionButton\n isExpanded={isExpanded}\n onPress={toggleCollapse}\n style={animatedStyles}\n disabled={isDisabled}\n {...makeAccessible({\n role: 'button',\n expanded: isItemExpanded,\n controls: collapsibleBodyId,\n label: a11yLabel,\n })}\n {...metaAttribute({ name: MetaConstants.AccordionButton })}\n >\n {renderChildren}\n </StyledAccordionButton>\n );\n};\n\nconst AccordionButton = assignWithoutSideEffects(_AccordionButton, {\n componentId: MetaConstants.AccordionButton,\n});\n\nexport { AccordionButton };\n"],"names":["_AccordionButton","_ref","index","Icon","icon","title","isDeprecatedAPI","isDisabled","header","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","_useAccordion","useAccordion","showNumberPrefix","expandedIndex","_useTheme","useTheme","theme","toggleCollapse","isItemExpanded","isPressed","useSharedValue","duration","castNativeType","getTransitionDuration","easing","getTransitionEasing","activeBackgroundColor","getBackgroundColor","isActive","inActiveBackgroundColor","useEffect","value","animatedStyles","useAnimatedStyle","backgroundColor","withTiming","_showNumberPrefix","_index","_jsxs","Text","size","weight","marginRight","children","a11yLabel","renderChildren","_ref2","pressed","_icon","_jsx","color","marginY","__DEV__","throwBladeError","message","moduleName","BaseBox","display","flexDirection","flex","justifyContent","alignItems","AccordionItemHeader","leading","StyledAccordionButton","Object","assign","onPress","style","disabled","makeAccessible","role","expanded","controls","label","metaAttribute","name","MetaConstants","AccordionButton","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAOoB,CAAA,IANxCC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACCC,IAAI,CAAAF,IAAA,CAAVG,IAAI,CACJC,KAAK,CAAAJ,IAAA,CAALI,KAAK,CACLC,eAAe,CAAAL,IAAA,CAAfK,eAAe,CACfC,UAAU,CAAAN,IAAA,CAAVM,UAAU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AAE,WACd,CAAC,CAAC,CACJ,CACF,CAEA,OACEN,GAAA,CAACO,OAAO,CACNC,CAAAA,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,KAAK,CACnBC,IAAI,CAAE,CAAE,CACRC,cAAc,CAAC,eAAe,CAC9BC,UAAU,CAAC,QAAQ,CAAAlB,QAAA,CAElBzC,eAAe,CAAG+C,GAAA,CAACa,mBAAmB,CAAC7D,CAAAA,KAAK,CAAEA,KAAM,CAAC8D,OAAO,CAAEf,KAAK,EAAA,IAAA,CAALA,KAAK,CAAIX,MAAO,CAAE,CAAC,CAAGjC,MAAM,CACpF,CAAC,CAEd,CAAC,CAED,OACE6C,GAAA,CAACe,qBAAqB,CAAAC,MAAA,CAAAC,MAAA,CACpB1D,CAAAA,UAAU,CAAEA,UAAW,CACvB2D,OAAO,CAAElD,cAAe,CACxBmD,KAAK,CAAEpC,cAAe,CACtBqC,QAAQ,CAAElE,UAAW,CAAA,CACjBmE,cAAc,CAAC,CACjBC,IAAI,CAAE,QAAQ,CACdC,QAAQ,CAAEtD,cAAc,CACxBuD,QAAQ,CAAEhE,iBAAiB,CAC3BiE,KAAK,CAAE9B,SACT,CAAC,CAAC,CACE+B,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,eAAgB,CAAC,CAAC,CAAA,CAAAnC,QAAA,CAEzDE,cAAc,CACM,CAAA,CAAC,CAE5B,CAAC,CAEK,IAAAiC,eAAe,CAAGC,wBAAwB,CAACnF,gBAAgB,CAAE,CACjEoF,WAAW,CAAEH,aAAa,CAACC,eAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"AccordionButton.native.js","sources":["../../../../../src/components/Accordion/AccordionButton.native.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useEffect } from 'react';\nimport type { PressableProps } from 'react-native';\nimport { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport { StyledAccordionButton } from './StyledAccordionButton.native';\nimport type { AccordionButtonProps } from './types';\nimport { useAccordion } from './AccordionContext';\nimport { getBackgroundColor, getTransitionDuration, getTransitionEasing } from './commonStyles';\nimport { AccordionItemHeader } from './AccordionItemHeader';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { castNativeType } from '~utils';\nimport { useCollapsible } from '~components/Collapsible/CollapsibleContext';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\nconst _AccordionButton = ({\n index,\n icon: Icon,\n title,\n isDeprecatedAPI,\n isDisabled,\n header,\n}: AccordionButtonProps): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n const { showNumberPrefix, expandedIndex } = useAccordion();\n const { theme } = useTheme();\n\n const toggleCollapse = (): void => onExpandChange(!isExpanded);\n const isItemExpanded = expandedIndex === index;\n\n const isPressed = useSharedValue(false);\n\n const duration = castNativeType(getTransitionDuration(theme));\n const easing = castNativeType(getTransitionEasing(theme));\n\n const activeBackgroundColor = useSharedValue(getBackgroundColor({ theme, isActive: true }));\n const inActiveBackgroundColor = useSharedValue(getBackgroundColor({ theme, isActive: false }));\n\n /**\n * `backgroundColor` is derived from `isExpanded` and pressed state.\n *\n * Since we can't directly access return values from JS functions (`getBackgroundColor`) on UI thread,\n * this effect updates the shared values for active / inactive states which are used by `animatedStyles`.\n */\n useEffect(() => {\n activeBackgroundColor.value = getBackgroundColor({ theme, isActive: true });\n inActiveBackgroundColor.value = getBackgroundColor({ theme, isActive: false });\n }, [activeBackgroundColor, inActiveBackgroundColor, theme]);\n\n const animatedStyles = useAnimatedStyle(() => ({\n backgroundColor: withTiming(\n isPressed.value ? activeBackgroundColor.value : inActiveBackgroundColor.value,\n {\n duration,\n easing,\n },\n ),\n }));\n\n const _showNumberPrefix = typeof index === 'number' && showNumberPrefix;\n\n const _index = _showNumberPrefix ? (\n <Text size=\"large\" weight=\"semibold\" marginRight=\"spacing.2\">\n {index + 1}.\n </Text>\n ) : null;\n\n const a11yLabel = _showNumberPrefix ? `${index + 1}. ${title}` : title;\n\n const renderChildren: PressableProps['children'] = ({ pressed }) => {\n isPressed.value = pressed;\n\n const _icon = Icon && (\n <Icon\n size=\"medium\"\n color=\"surface.icon.gray.normal\"\n marginRight=\"spacing.3\"\n marginY=\"spacing.2\"\n />\n );\n\n if (__DEV__) {\n if (_index && _icon) {\n throwBladeError({\n message: \"showNumberPrefix and icon shouldn't be used together\",\n moduleName: 'Accordion',\n });\n }\n }\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n flex={1}\n justifyContent=\"space-between\"\n alignItems=\"center\"\n >\n {isDeprecatedAPI ? <AccordionItemHeader title={title} leading={_icon ?? _index} /> : header}\n </BaseBox>\n );\n };\n\n return (\n <StyledAccordionButton\n isExpanded={isExpanded}\n onPress={toggleCollapse}\n style={animatedStyles}\n disabled={isDisabled}\n {...makeAccessible({\n role: 'button',\n expanded: isItemExpanded,\n controls: collapsibleBodyId,\n label: a11yLabel,\n })}\n {...metaAttribute({ name: MetaConstants.AccordionButton })}\n >\n {renderChildren}\n </StyledAccordionButton>\n );\n};\n\nconst AccordionButton = assignWithoutSideEffects(_AccordionButton, {\n componentId: MetaConstants.AccordionButton,\n});\n\nexport { AccordionButton };\n"],"names":["_AccordionButton","_ref","index","Icon","icon","title","isDeprecatedAPI","isDisabled","header","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","_useAccordion","useAccordion","showNumberPrefix","expandedIndex","_useTheme","useTheme","theme","toggleCollapse","isItemExpanded","isPressed","useSharedValue","duration","castNativeType","getTransitionDuration","easing","getTransitionEasing","activeBackgroundColor","getBackgroundColor","isActive","inActiveBackgroundColor","useEffect","value","animatedStyles","useAnimatedStyle","backgroundColor","withTiming","_showNumberPrefix","_index","_jsxs","Text","size","weight","marginRight","children","a11yLabel","renderChildren","_ref2","pressed","_icon","_jsx","color","marginY","__DEV__","throwBladeError","message","moduleName","BaseBox","display","flexDirection","flex","justifyContent","alignItems","AccordionItemHeader","leading","StyledAccordionButton","Object","assign","onPress","style","disabled","makeAccessible","role","expanded","controls","label","metaAttribute","name","MetaConstants","AccordionButton","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAOoB,CAAA,IANxCC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACCC,IAAI,CAAAF,IAAA,CAAVG,IAAI,CACJC,KAAK,CAAAJ,IAAA,CAALI,KAAK,CACLC,eAAe,CAAAL,IAAA,CAAfK,eAAe,CACfC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CACVC,MAAM,CAAAP,IAAA,CAANO,MAAM,CAEN,IAAAC,eAAA,CAA0DC,cAAc,EAAE,CAAlEC,cAAc,CAAAF,eAAA,CAAdE,cAAc,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CAAEC,iBAAiB,CAAAJ,eAAA,CAAjBI,iBAAiB,CACrD,IAAAC,aAAA,CAA4CC,YAAY,EAAE,CAAlDC,gBAAgB,CAAAF,aAAA,CAAhBE,gBAAgB,CAAEC,aAAa,CAAAH,aAAA,CAAbG,aAAa,CACvC,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CAEb,IAAMC,cAAc,CAAG,SAAjBA,cAAcA,EAAA,CAAA,OAAeV,cAAc,CAAC,CAACC,UAAU,CAAC,CAAA,CAAA,CAC9D,IAAMU,cAAc,CAAGL,aAAa,GAAKf,KAAK,CAE9C,IAAMqB,SAAS,CAAGC,cAAc,CAAC,KAAK,CAAC,CAEvC,IAAMC,QAAQ,CAAGC,cAAc,CAACC,qBAAqB,CAACP,KAAK,CAAC,CAAC,CAC7D,IAAMQ,MAAM,CAAGF,cAAc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ACT,CAAC,CAAC,CACE+B,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,eAAgB,CAAC,CAAC,CAAA,CAAAnC,QAAA,CAEzDE,cAAc,CACM,CAAA,CAAC,CAE5B,CAAC,CAEK,IAAAiC,eAAe,CAAGC,wBAAwB,CAACnF,gBAAgB,CAAE,CACjEoF,WAAW,CAAEH,aAAa,CAACC,eAC7B,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionList.js","sources":["../../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles';\nimport { getActionListProperties } from './actionListUtils';\nimport { ActionListBox as ActionListNormalBox, ActionListVirtualizedBox } from './ActionListBox';\nimport { componentIds } from './componentIds';\nimport { ActionListNoResults } from './ActionListNoResults';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n isVirtualized?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({\n children,\n testID,\n isVirtualized,\n ...rest\n}: ActionListProps): React.ReactElement => {\n const {\n setOptions,\n actionListItemRef,\n selectionType,\n dropdownBaseId,\n dropdownTriggerer,\n hasFooterAction,\n filteredValues,\n } = useDropdown();\n\n const ActionListBox = isVirtualized ? ActionListVirtualizedBox : ActionListNormalBox;\n\n const { isInBottomSheet } = useBottomSheetContext();\n\n const { sectionData, childrenWithId, actionListOptions } = React.useMemo(\n () => getActionListProperties(children),\n [children],\n );\n\n React.useEffect(() => {\n setOptions(actionListOptions);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionListOptions]);\n\n if (\n filteredValues.length <= 0 &&\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return <ActionListNoResults />;\n }\n\n const actionListContainerRole = getActionListContainerRole(hasFooterAction, dropdownTriggerer);\n const actionListItemWrapperRole = getActionListItemWrapperRole(\n hasFooterAction,\n dropdownTriggerer,\n );\n const isMultiSelectable = selectionType === 'multiple';\n\n // If we are inside BottomSheet, we don't render The StyledActionList wrapper\n // This is to ensure:\n // 1. We don't render the box wrapper styles which includes shadows, padding, border etc\n // 2. to ensure GorhomBottomSheetSectionList works as expected, if we add extra wrappers GorhomBottomSheet won't render the content inside\n // NOTE: That this also means inside BottomSheet, ActionList won't render any ActionListHeader or Footer.\n return isInBottomSheet ? (\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n {...makeAnalyticsAttribute(rest)}\n />\n ) : (\n <BaseBox\n id={`${dropdownBaseId}-actionlist`}\n {...makeAccessible({\n role: actionListContainerRole,\n multiSelectable: actionListContainerRole === 'listbox' ? isMultiSelectable : undefined,\n labelledBy: `${dropdownBaseId}-label`,\n })}\n {...metaAttribute({ name: MetaConstants.ActionList, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n />\n </BaseBox>\n );\n};\n\n/**\n * ### ActionList\n *\n * List of multiple actionable items. Can be used as menu items inside `Dropdown`,\n * `BottomSheet` and as selectable items when combined with `SelectInput`\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown>\n * <SelectInput label=\"Select Action\" />\n * <DropdownOverlay>\n * <DropdownHeader title=\"Header Title\" />\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * />\n * <ActionListItem\n * title=\"Pricing\"\n * value=\"pricing\"\n * leading={<ActionListItemAsset src=\"https://flagcdn.com/w20/in.png\" alt=\"India Flag\" />}\n * />\n * </ActionList>\n * <DropdownFooter><Button>Apply</Button></DropdownFooter>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n */\nconst ActionList = assignWithoutSideEffects(React.memo(_ActionList), {\n displayName: componentIds.ActionList,\n componentId: componentIds.ActionList,\n});\n\nexport type { ActionListProps };\nexport { ActionList };\n"],"names":["_ActionList","_ref","children","testID","isVirtualized","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","setOptions","actionListItemRef","selectionType","dropdownBaseId","dropdownTriggerer","hasFooterAction","filteredValues","ActionListBox","ActionListVirtualizedBox","ActionListNormalBox","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_React$useMemo","React","useMemo","getActionListProperties","sectionData","childrenWithId","actionListOptions","useEffect","length","dropdownComponentIds","triggers","AutoComplete","_jsx","ActionListNoResults","actionListContainerRole","getActionListContainerRole","actionListItemWrapperRole","getActionListItemWrapperRole","isMultiSelectable","Object","assign","ref","makeAnalyticsAttribute","BaseBox","id","makeAccessible","role","multiSelectable","undefined","labelledBy","metaAttribute","name","MetaConstants","ActionList","assignWithoutSideEffects","memo","displayName","componentIds","componentId"],"mappings":";;;;;;;;;;;;;;;;;;oDAuBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAK0B,CAJzC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,aAAa,CAAAH,IAAA,CAAbG,aAAa,CACVC,I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
1
+ {"version":3,"file":"ActionList.js","sources":["../../../../../src/components/ActionList/ActionList.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles';\nimport { getActionListProperties } from './actionListUtils';\nimport { ActionListBox as ActionListNormalBox, ActionListVirtualizedBox } from './ActionListBox';\nimport { componentIds } from './componentIds';\nimport { ActionListNoResults } from './ActionListNoResults';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n isVirtualized?: boolean;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({\n children,\n testID,\n isVirtualized,\n ...rest\n}: ActionListProps): React.ReactElement => {\n const {\n setOptions,\n actionListItemRef,\n selectionType,\n dropdownBaseId,\n dropdownTriggerer,\n hasFooterAction,\n filteredValues,\n } = useDropdown();\n\n const ActionListBox = isVirtualized ? ActionListVirtualizedBox : ActionListNormalBox;\n\n const { isInBottomSheet } = useBottomSheetContext();\n\n const { sectionData, childrenWithId, actionListOptions } = React.useMemo(\n () => getActionListProperties(children),\n [children],\n );\n\n React.useEffect(() => {\n setOptions(actionListOptions);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionListOptions]);\n\n if (\n filteredValues.length <= 0 &&\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return <ActionListNoResults />;\n }\n\n const actionListContainerRole = getActionListContainerRole(hasFooterAction, dropdownTriggerer);\n const actionListItemWrapperRole = getActionListItemWrapperRole(\n hasFooterAction,\n dropdownTriggerer,\n );\n const isMultiSelectable = selectionType === 'multiple';\n\n // If we are inside BottomSheet, we don't render The StyledActionList wrapper\n // This is to ensure:\n // 1. We don't render the box wrapper styles which includes shadows, padding, border etc\n // 2. to ensure GorhomBottomSheetSectionList works as expected, if we add extra wrappers GorhomBottomSheet won't render the content inside\n // NOTE: That this also means inside BottomSheet, ActionList won't render any ActionListHeader or Footer.\n return isInBottomSheet ? (\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n {...makeAnalyticsAttribute(rest)}\n />\n ) : (\n <BaseBox\n id={`${dropdownBaseId}-actionlist`}\n {...makeAccessible({\n role: actionListContainerRole,\n multiSelectable: actionListContainerRole === 'listbox' ? isMultiSelectable : undefined,\n labelledBy: `${dropdownBaseId}-label`,\n })}\n {...metaAttribute({ name: MetaConstants.ActionList, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <ActionListBox\n isInBottomSheet={isInBottomSheet}\n actionListItemWrapperRole={actionListItemWrapperRole}\n childrenWithId={childrenWithId}\n sectionData={sectionData}\n isMultiSelectable={isMultiSelectable}\n ref={actionListItemRef as any}\n />\n </BaseBox>\n );\n};\n\n/**\n * ### ActionList\n *\n * List of multiple actionable items. Can be used as menu items inside `Dropdown`,\n * `BottomSheet` and as selectable items when combined with `SelectInput`\n *\n * #### Usage\n *\n * ```jsx\n * <Dropdown>\n * <SelectInput label=\"Select Action\" />\n * <DropdownOverlay>\n * <DropdownHeader title=\"Header Title\" />\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * />\n * <ActionListItem\n * title=\"Pricing\"\n * value=\"pricing\"\n * leading={<ActionListItemAsset src=\"https://flagcdn.com/w20/in.png\" alt=\"India Flag\" />}\n * />\n * </ActionList>\n * <DropdownFooter><Button>Apply</Button></DropdownFooter>\n * </DropdownOverlay>\n * </Dropdown>\n * ```\n *\n */\nconst ActionList = assignWithoutSideEffects(React.memo(_ActionList), {\n displayName: componentIds.ActionList,\n componentId: componentIds.ActionList,\n});\n\nexport type { ActionListProps };\nexport { ActionList };\n"],"names":["_ActionList","_ref","children","testID","isVirtualized","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","setOptions","actionListItemRef","selectionType","dropdownBaseId","dropdownTriggerer","hasFooterAction","filteredValues","ActionListBox","ActionListVirtualizedBox","ActionListNormalBox","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_React$useMemo","React","useMemo","getActionListProperties","sectionData","childrenWithId","actionListOptions","useEffect","length","dropdownComponentIds","triggers","AutoComplete","_jsx","ActionListNoResults","actionListContainerRole","getActionListContainerRole","actionListItemWrapperRole","getActionListItemWrapperRole","isMultiSelectable","Object","assign","ref","makeAnalyticsAttribute","BaseBox","id","makeAccessible","role","multiSelectable","undefined","labelledBy","metaAttribute","name","MetaConstants","ActionList","assignWithoutSideEffects","memo","displayName","componentIds","componentId"],"mappings":";;;;;;;;;;;;;;;;;;oDAuBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAK0B,CAJzC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,aAAa,CAAAH,IAAA,CAAbG,aAAa,CACVC,IAAI,CAAAC,wBAAA,CAAAL,IAAA,CAAAM,SAAA,EAEP,IAAAC,YAAA,CAQIC,WAAW,EAAE,CAPfC,UAAU,CAAAF,YAAA,CAAVE,UAAU,CACVC,iBAAiB,CAAAH,YAAA,CAAjBG,iBAAiB,CACjBC,aAAa,CAAAJ,YAAA,CAAbI,aAAa,CACbC,cAAc,CAAAL,YAAA,CAAdK,cAAc,CACdC,iBAAiB,CAAAN,YAAA,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G,CAAEjC,iBAAyB,EAC1BkC,sBAAsB,CAACxC,IAAI,CAAC,CACjC,CAAC,CAEF8B,GAAA,CAACW,OAAO,CAAAJ,MAAA,CAAAC,MAAA,CACNI,CAAAA,EAAE,CAAE,CAAA,EAAGlC,cAAc,CAAA,WAAA,CAAc,EAC/BmC,cAAc,CAAC,CACjBC,IAAI,CAAEZ,uBAAuB,CAC7Ba,eAAe,CAAEb,uBAAuB,GAAK,SAAS,CAAGI,iBAAiB,CAAGU,SAAS,CACtFC,UAAU,CAAE,CAAA,EAAGvC,cAAc,CAC/B,MAAA,CAAA,CAAC,CAAC,CACEwC,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,UAAU,CAAErD,MAAM,CAANA,MAAO,CAAC,CAAC,CACzD0C,sBAAsB,CAACxC,IAAI,CAAC,CAAAH,CAAAA,QAAA,CAEhCiC,GAAA,CAAClB,eAAa,CAAA,CACZK,eAAe,CAAEA,eAAgB,CACjCiB,yBAAyB,CAAEA,yBAA0B,CACrDX,cAAc,CAAEA,cAAe,CAC/BD,WAAW,CAAEA,WAAY,CACzBc,iBAAiB,CAAEA,iBAAkB,CACrCG,GAAG,CAAEjC,iBAAyB,CAC/B,CAAC,EACK,CACV,CACH,CAAC,CAiCK,IAAA6C,UAAU,CAAGC,wBAAwB,CAACjC,cAAK,CAACkC,IAAI,CAAC1D,WAAW,CAAC,CAAE,CACnE2D,WAAW,CAAEC,YAAY,CAACJ,UAAU,CACpCK,WAAW,CAAED,YAAY,CAACJ,UAC5B,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionListItem.js","sources":["../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n /**\n * Internally used to pass index for virtualized lists\n *\n * @private\n */\n _virtualizedIndex?: number;\n /**\n * Internally used to focus on virtualized list\n *\n * @private\n */\n _onVirtualizedFocus?: (_virtuazedIndex: number) => void;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionListSectionTitle = ({\n title,\n isInsideVirtualizedList = false,\n}: {\n title: string;\n isInsideVirtualizedList?: boolean;\n}): React.ReactElement => {\n return (\n <StyledActionListSectionTitle\n {...makeAccessible({\n hidden: !isInsideVirtualizedList,\n role: isInsideVirtualizedList ? 'heading' : undefined,\n })}\n >\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n );\n};\n\nconst ActionListSectionTitle = assignWithoutSideEffects(_ActionListSectionTitle, {\n componentId: componentIds.ActionListSectionTitle,\n});\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n {...makeAnalyticsAttribute(rest as Record<string, unknown>)}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? <ActionListSectionTitle title={title} /> : null}\n\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(React.memo(_ActionListSection), {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\nconst BaseMenuLeadingItem = ({\n isSelected,\n isDisabled,\n}: {\n isSelected?: boolean;\n isDisabled?: boolean;\n}): React.ReactElement => {\n return (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={isDisabled}>\n {/*\n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n );\n};\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInHeader,\n } = useDropdown();\n\n React.useEffect(() => {\n if (activeIndex === props._index && props._virtualizedIndex !== undefined) {\n props._onVirtualizedFocus?.(props._virtualizedIndex as number);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex]);\n\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const hasFilterChipSelectInput =\n dropdownTriggerer === dropdownComponentIds.triggers.FilterChipSelectInput;\n\n const hasInputDropdownButton =\n dropdownTriggerer === dropdownComponentIds.triggers.InputDropdownButton;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput ||\n hasAutoComplete ||\n hasFilterChipSelectInput ||\n hasInputDropdownButton\n ) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n const isVisible = hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true;\n\n return (\n <BaseMenuItem\n isVisible={isVisible}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseMenuLeadingItem\n key={`${dropdownBaseId}-${props._index}-leading-${isSelected}`}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n />\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...makeAnalyticsAttribute({ ...props })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n ActionListSectionTitle,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","props","padding","makeSize","theme","spacing","_ActionListSectionTitle","_ref","title","_ref$isInsideVirtuali","isInsideVirtualizedList","_jsx","Object","assign","makeAccessible","hidden","role","undefined","children","Text","color","size","weight","ActionListSectionTitle","assignWithoutSideEffects","componentId","componentIds","_ActionListSection","_ref2","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","Divider","marginX","marginY","memo","_ActionListItemIcon","_ref3","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","ActionListItemIcon","_ActionListItemBadgeGroup","_ref4","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref5","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","BaseMenuLeadingItem","_ref6","isSelected","pointerEvents","Checkbox","isChecked","tabIndex","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","useEffect","_index","_virtualizedIndex","_onVirtualizedFocus","hasFilterChipSelectInput","FilterChipSelectInput","hasInputDropdownButton","InputDropdownButton","renderOnWebAs","href","getIsSelected","SelectInput","validateActionListItemProps","leading","trailing","titleSuffix","__DEV__","intent","throwBladeError","message","moduleName","isVisible","value","BaseMenuItem","as","id","description","target","className","getActionListItemRole","e","event","castWebType","ActionListItem","onMouseDown","onMouseUp","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAwGA,IAAMA,4BAA4B,CAAGC,MAAM,CAACC,OAAO,CAAC,CAAC,SAACC,KAAK,CAAM,CAAA,OAAA,CAE/DC,OAAO,CAAEC,QAAQ,CAACF,KAAK,CAACG,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAC1C,CAAC,CAAC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AA4B,CAAC,IAAI,CAAC,CACpC,CAAE,CACFsC,SAAS,CAAE,SAAAA,SAAA,EAAM,CAEftC,4BAA4B,CAAC,KAAK,CAAC,CACrC,CAAE,CACF,aAAYnH,KAAK,CAAC4I,KAAM,CACxB,YAAY5I,CAAAA,KAAK,CAACuH,MAAO,CACzBH,aAAa,CAAEA,aAAc,CAC7BjG,KAAK,CAAEnB,KAAK,CAACuI,MAAO,CACpBlB,gBAAgB,CAAEA,gBAAiB,EACpC,CAAC,CAEN,CAAC,CAEK,IAAAkC,cAAc,CAAGhI,wBAAwB,CAACqB,cAAK,CAACsB,IAAI,CAAC2C,eAAe,CAAC,CAAE,CAC3ErF,WAAW,CAAEC,YAAY,CAAC8H,cAAc,CACxCG,WAAW,CAAEjI,YAAY,CAAC8H,cAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"ActionListItem.js","sources":["../../../../../src/components/ActionList/ActionListItem.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { TouchableOpacity } from 'react-native';\nimport { componentIds } from './componentIds';\nimport { validateActionListItemProps, getNormalTextColor } from './actionListUtils';\nimport { getActionListItemRole, getActionListSectionRole } from './getA11yRoles';\nimport { Divider } from '~components/Divider';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport type { Platform } from '~utils';\nimport { castWebType, isReactNative } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, StringChildrenType, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport type { BadgeProps } from '~components/Badge';\nimport { Badge } from '~components/Badge';\nimport { Box } from '~components/Box';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { BaseMenuItem, useBaseMenuItem } from '~components/BaseMenu';\nimport { Checkbox } from '~components/Checkbox';\nimport type { AvatarProps } from '~components/Avatar/types';\nimport { Avatar } from '~components/Avatar';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ActionListItemProps = {\n title: string;\n description?: string;\n onClick?: (clickProps: {\n name: string;\n value?: boolean;\n event: Platform.Select<{\n web: React.MouseEvent;\n native: React.TouchEvent<TouchableOpacity>;\n }>;\n }) => void;\n /**\n * value that you get from `onChange` event on SelectInput or in form submissions.\n */\n value: string;\n /**\n * Link to open when item is clicked.\n */\n href?: string;\n /**\n * HTML target of the link\n */\n target?: string;\n /**\n * Item that goes on left-side of item.\n *\n * Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`\n *\n * Will be overriden in multiselect\n */\n leading?: React.ReactNode;\n /**\n * Item that goes on right-side of item.\n *\n * Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`\n */\n trailing?: React.ReactNode;\n /**\n * Item that goes immediately next to the title.\n *\n * Valid elements - `<ActionListItemBadge />`, `<ActionListItemBadgeGroup />`\n *\n */\n titleSuffix?: React.ReactElement;\n isDisabled?: boolean;\n intent?: Extract<FeedbackColors, 'negative'>;\n /**\n * Can be used in combination of `onClick` to highlight item as selected in Button Triggers.\n *\n * When trigger is SelectInput, Use `value` prop on SelectInput instead to make dropdown controlled.\n */\n isSelected?: boolean;\n /**\n * Internally passed from ActionList. No need to pass it explicitly\n *\n * @private\n */\n _index?: number;\n /**\n * Internally used to pass index for virtualized lists\n *\n * @private\n */\n _virtualizedIndex?: number;\n /**\n * Internally used to focus on virtualized list\n *\n * @private\n */\n _onVirtualizedFocus?: (_virtuazedIndex: number) => void;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst StyledActionListSectionTitle = styled(BaseBox)((props) => ({\n // @TODO: replace this styled-component with new layout box when we have padding shorthand\n padding: makeSize(props.theme.spacing[3]),\n}));\n\ntype ActionListSectionProps = {\n title: string;\n children: React.ReactNode[] | React.ReactNode;\n /**\n * Internally used to hide the divider on final item in React Native\n *\n * Should not be used by consumers (also won't work on web)\n *\n * @private\n */\n _hideDivider?: boolean;\n /**\n * Internally used to hide / show section in AutoComplete\n *\n * @private\n */\n _sectionChildValues?: string[];\n} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionListSectionTitle = ({\n title,\n isInsideVirtualizedList = false,\n}: {\n title: string;\n isInsideVirtualizedList?: boolean;\n}): React.ReactElement => {\n return (\n <StyledActionListSectionTitle\n {...makeAccessible({\n hidden: !isInsideVirtualizedList,\n role: isInsideVirtualizedList ? 'heading' : undefined,\n })}\n >\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n );\n};\n\nconst ActionListSectionTitle = assignWithoutSideEffects(_ActionListSectionTitle, {\n componentId: componentIds.ActionListSectionTitle,\n});\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const isSectionVisible = React.useMemo(() => {\n if (hasAutoComplete) {\n const visibleActionListItemInSection = _sectionChildValues?.find((actionItemValue) =>\n filteredValues.includes(actionItemValue),\n );\n\n return Boolean(visibleActionListItemInSection);\n }\n\n return true;\n }, [_sectionChildValues, hasAutoComplete, filteredValues]);\n\n const showDividerInRN = !(_hideDivider && isReactNative());\n const showDividerInAutoComplete = hasAutoComplete\n ? isSectionVisible && filteredValues.length > 1\n : true;\n\n return (\n <BaseBox\n {...makeAccessible({\n role: getActionListSectionRole(),\n label: title,\n })}\n {...metaAttribute({ name: MetaConstants.ActionListSection, testID })}\n {...makeAnalyticsAttribute(rest as Record<string, unknown>)}\n >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? <ActionListSectionTitle title={title} /> : null}\n\n <BaseBox\n {...makeAccessible({\n // On web, we just wrap it in another listbox to announce item count properly for particular group.\n // On React Native, we ignore it since `menu` + `group` role will take care of accessibility\n role: isReactNative() ? undefined : 'listbox',\n })}\n >\n {children}\n </BaseBox>\n {showDividerInAutoComplete && showDividerInRN ? (\n <Divider marginX=\"spacing.3\" marginY=\"spacing.1\" />\n ) : null}\n </BaseBox>\n );\n};\n\nconst ActionListSection = assignWithoutSideEffects(React.memo(_ActionListSection), {\n componentId: componentIds.ActionListSection,\n});\n\nconst _ActionListItemIcon = ({ icon }: { icon: IconComponent }): React.ReactElement => {\n const Icon = icon;\n const { color, isDisabled } = useBaseMenuItem();\n const iconState = isDisabled ? 'disabled' : 'muted';\n return (\n <Icon\n color={\n color === 'negative'\n ? 'feedback.icon.negative.intense'\n : `interactive.icon.gray.${iconState}`\n }\n size=\"medium\"\n />\n );\n};\n\nconst ActionListItemIcon = assignWithoutSideEffects(_ActionListItemIcon, {\n componentId: componentIds.ActionListItemIcon,\n});\n\nconst _ActionListItemBadgeGroup = ({\n children,\n}: {\n children: React.ReactElement[] | React.ReactElement;\n}): React.ReactElement => {\n return (\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n {children}\n </Box>\n );\n};\n\nconst ActionListItemBadgeGroup = assignWithoutSideEffects(_ActionListItemBadgeGroup, {\n componentId: componentIds.ActionListItemBadgeGroup,\n});\n\nconst _ActionListItemAvatar = (avatarProps: Omit<AvatarProps, 'size' | ''>): React.ReactElement => {\n return <Avatar size=\"xsmall\" {...avatarProps} />;\n};\n\nconst ActionListItemAvatar = assignWithoutSideEffects(_ActionListItemAvatar, {\n componentId: componentIds.ActionListItemAvatar,\n});\n\nconst _ActionListItemBadge = (props: BadgeProps): React.ReactElement => {\n return <Badge size=\"medium\" marginLeft=\"spacing.3\" {...props} />;\n};\n\nconst ActionListItemBadge = assignWithoutSideEffects(_ActionListItemBadge, {\n componentId: componentIds.ActionListItemBadge,\n});\n\nconst _ActionListItemText = ({\n children,\n}: {\n children: StringChildrenType;\n}): React.ReactElement => {\n const { isDisabled } = useBaseMenuItem();\n\n return (\n <Text variant=\"caption\" color={getNormalTextColor(isDisabled, { isMuted: true })}>\n {children}\n </Text>\n );\n};\n\nconst ActionListItemText = assignWithoutSideEffects(_ActionListItemText, {\n componentId: componentIds.ActionListItemText,\n});\n\nconst BaseMenuLeadingItem = ({\n isSelected,\n isDisabled,\n}: {\n isSelected?: boolean;\n isDisabled?: boolean;\n}): React.ReactElement => {\n return (\n <BaseBox\n pointerEvents=\"none\"\n // Adding aria-hidden because the listbox item in multiselect in itself explains the behaviour so announcing checkbox is unneccesary and just a nice UI tweak for us\n {...makeAccessible({\n hidden: true,\n })}\n >\n <Checkbox isChecked={isSelected} tabIndex={-1} isDisabled={isDisabled}>\n {/*\n Checkbox requires children. Didn't want to make it optional because its helpful for consumers\n But for this case in particular, we just want to use Text separately so that we can control spacing and color and keep it consistent with non-multiselect dropdowns\n */}\n {null}\n </Checkbox>\n </BaseBox>\n );\n};\n\ntype ClickHandlerType = (e: React.MouseEvent<HTMLButtonElement>) => void;\n\nconst makeActionListItemClickable = (\n clickHandler: ClickHandlerType,\n): { onPress?: (e: React.TouchEvent<TouchableOpacity>) => void; onClick?: ClickHandlerType } => {\n if (isReactNative()) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: ignoring ReactNative press type for the peace of mind\n return { onPress: clickHandler };\n }\n\n return {\n onClick: clickHandler,\n };\n};\n\n/**\n * ### ActionListItem\n *\n * Creates option inside `ActionList`.\n *\n * #### Usage\n *\n * ```jsx\n * <ActionList>\n * <ActionListItem\n * title=\"Home\"\n * value=\"home\"\n * leading={<ActionListItemIcon icon={HomeIcon} />}\n * trailing={<ActionListItemText>⌘ + S</ActionListItemText>}\n * />\n * </ActionList>\n * ```\n */\nconst _ActionListItem = (props: ActionListItemProps): React.ReactElement => {\n const {\n activeIndex,\n dropdownBaseId,\n onOptionClick,\n selectedIndices,\n setShouldIgnoreBlurAnimation,\n selectionType,\n dropdownTriggerer,\n isKeydownPressed,\n filteredValues,\n hasAutoCompleteInHeader,\n } = useDropdown();\n\n React.useEffect(() => {\n if (activeIndex === props._index && props._virtualizedIndex !== undefined) {\n props._onVirtualizedFocus?.(props._virtualizedIndex as number);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex]);\n\n const hasAutoComplete =\n hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const hasFilterChipSelectInput =\n dropdownTriggerer === dropdownComponentIds.triggers.FilterChipSelectInput;\n\n const hasInputDropdownButton =\n dropdownTriggerer === dropdownComponentIds.triggers.InputDropdownButton;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n /**\n * In SelectInput, returns the isSelected according to selected indexes in the state\n *\n * In Other Triggers (Menu Usecase), returns `props.isSelected` since passing the\n * isSelected prop explicitly is the only way to select item in menu\n */\n const getIsSelected = (): boolean | undefined => {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput ||\n hasAutoComplete ||\n hasFilterChipSelectInput ||\n hasInputDropdownButton\n ) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\n return undefined;\n }\n\n return props.isSelected;\n };\n\n const isSelected = getIsSelected();\n\n React.useEffect(() => {\n validateActionListItemProps({\n leading: props.leading,\n trailing: props.trailing,\n titleSuffix: props.titleSuffix,\n });\n }, [props.leading, props.trailing, props.titleSuffix]);\n\n React.useEffect(() => {\n if (__DEV__) {\n if (\n dropdownTriggerer === dropdownComponentIds.triggers.SelectInput &&\n props.intent === 'negative'\n ) {\n throwBladeError({\n message:\n 'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',\n moduleName: 'ActionListItem',\n });\n }\n }\n }, [props.intent, dropdownTriggerer]);\n\n const isVisible = hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true;\n\n return (\n <BaseMenuItem\n isVisible={isVisible}\n as={!isReactNative() ? renderOnWebAs : undefined}\n id={`${dropdownBaseId}-${props._index}`}\n tabIndex={-1}\n title={props.title}\n description={props.description}\n leading={\n selectionType === 'multiple' ? (\n <BaseMenuLeadingItem\n key={`${dropdownBaseId}-${props._index}-leading-${isSelected}`}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n />\n ) : (\n props.leading\n )\n }\n trailing={props.trailing}\n titleSuffix={props.titleSuffix}\n href={props.href}\n target={props.target}\n className={activeIndex === props._index ? 'active-focus' : ''}\n isSelected={isSelected}\n isDisabled={props.isDisabled}\n role={getActionListItemRole(dropdownTriggerer, props.href)}\n {...makeActionListItemClickable((e: React.MouseEvent<HTMLButtonElement>): void => {\n if (typeof props._index === 'number') {\n onOptionClick(e, props._index);\n props.onClick?.({ name: props.value, value: isSelected, event: castWebType(e) });\n }\n })}\n {...makeAnalyticsAttribute({ ...props })}\n {...metaAttribute({ name: MetaConstants.ActionListItem, testID: props.testID })}\n onMouseDown={() => {\n // We want to keep focus on Dropdown's trigger while option is being clicked\n // So We set this flag that ignores the blur animation to avoid the flicker between focus out + focus in\n setShouldIgnoreBlurAnimation(true);\n }}\n onMouseUp={() => {\n // (Contd from above comment...) We set this flag back to false since blur of SelectInput is done calling by this time\n setShouldIgnoreBlurAnimation(false);\n }}\n data-value={props.value}\n data-index={props._index}\n selectionType={selectionType}\n color={props.intent}\n isKeydownPressed={isKeydownPressed}\n />\n );\n};\n\nconst ActionListItem = assignWithoutSideEffects(React.memo(_ActionListItem), {\n componentId: componentIds.ActionListItem,\n displayName: componentIds.ActionListItem,\n});\n\nexport type { ActionListItemProps, ActionListSectionProps };\nexport {\n ActionListItem,\n ActionListItemIcon,\n ActionListItemText,\n ActionListItemAvatar,\n ActionListItemBadge,\n ActionListItemBadgeGroup,\n ActionListSection,\n ActionListSectionTitle,\n};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","props","padding","makeSize","theme","spacing","_ActionListSectionTitle","_ref","title","_ref$isInsideVirtuali","isInsideVirtualizedList","_jsx","Object","assign","makeAccessible","hidden","role","undefined","children","Text","color","size","weight","ActionListSectionTitle","assignWithoutSideEffects","componentId","componentIds","_ActionListSection","_ref2","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","Divider","marginX","marginY","memo","_ActionListItemIcon","_ref3","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","ActionListItemIcon","_ActionListItemBadgeGroup","_ref4","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref5","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","BaseMenuLeadingItem","_ref6","isSelected","pointerEvents","Checkbox","isChecked","tabIndex","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","useEffect","_index","_virtualizedIndex","_onVirtualizedFocus","hasFilterChipSelectInput","FilterChipSelectInput","hasInputDropdownButton","InputDropdownButton","renderOnWebAs","href","getIsSelected","SelectInput","validateActionListItemProps","leading","trailing","titleSuffix","__DEV__","intent","throwBladeError","message","moduleName","isVisible","value","BaseMenuItem","as","id","description","target","className","getActionListItemRole","e","event","castWebType","ActionListItem","onMouseDown","onMouseUp","displayName"],"mappings":";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AAW,CAAEjI,YAAY,CAAC8H,cAC5B,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"actionListUtils.js","sources":["../../../../../src/components/ActionList/actionListUtils.ts"],"sourcesContent":["import React from 'react';\nimport { componentIds } from './componentIds';\nimport type { ActionListItemProps } from './ActionListItem';\nimport type { OptionsType } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\n/**\n * Returns if there is ActionListItem after ActionListSection\n * and an index of last ActionListSection\n *\n * It is used to decide if ActionListSection add divider at the end\n */\nconst getActionListSectionPosition = (\n children: React.ReactNode,\n): {\n isActionListItemPresentAfterSection: boolean;\n lastActionListSectionIndex: number;\n} => {\n // Creating an array of componentIds\n const childComponentIdArray = React.Children.toArray(children).map((child) =>\n getComponentId(child),\n );\n\n // Reading the last `ActionListSection` component's index\n const lastActionListSectionIndex = childComponentIdArray.lastIndexOf(\n componentIds.ActionListSection,\n );\n\n // Checking if there is any `ActionListItem` present after `ActionListSection`\n const isActionListItemPresentAfterSection = childComponentIdArray\n .slice(lastActionListSectionIndex)\n .includes(componentIds.ActionListItem);\n\n return {\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n };\n};\n\nconst actionListAllowedChildren = [componentIds.ActionListItem, componentIds.ActionListSection];\n\nexport type SectionData = {\n title: string;\n hideDivider: boolean;\n data: ActionListItemProps[];\n}[];\n\n/**\n * Loops over action list items and returns different properties from children like option values, header and footer child, etc\n */\nconst getActionListProperties = (\n children: React.ReactNode,\n): {\n sectionData: SectionData;\n childrenWithId?: React.ReactNode[] | null;\n actionListOptions: OptionsType;\n} => {\n const sectionData: SectionData = [];\n let currentSection: string | null = null;\n const actionListOptions: OptionsType = [];\n\n const getActionListItemWithId = (\n child: React.ReactNode,\n hideDivider: boolean,\n ): React.ReactNode => {\n if (React.isValidElement(child) && !child.props.isDisabled) {\n actionListOptions.push({\n title: child.props.title,\n value: child.props.value,\n onClickTrigger: (value) => {\n const anchorLink = child.props.href;\n child.props.onClick?.({\n name: child.props.value,\n value: child.props.isSelected ?? value,\n });\n\n if (anchorLink && !isReactNative()) {\n const target = child.props.target ?? '_self';\n window.open(anchorLink, target);\n if (window.top) {\n window.top.open(anchorLink, target);\n }\n }\n },\n });\n const currentIndex = actionListOptions.length - 1;\n\n const foundSection = sectionData.find((v) => v.title === currentSection);\n // push the item in the appropriate bucket\n if (foundSection) {\n foundSection?.data.push({\n ...child.props,\n _index: currentIndex,\n });\n } else {\n // create a new bucket\n sectionData.push({\n title: currentSection!,\n hideDivider,\n data: [\n {\n ...child.props,\n _index: currentIndex,\n },\n ],\n });\n }\n\n const clonedChild = React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n _index: currentIndex,\n });\n return clonedChild;\n }\n\n return child;\n };\n\n let isActionListItemPresentAfterSection: boolean;\n // eslint-disable-next-line one-var\n let lastActionListSectionIndex: number;\n\n if (isReactNative()) {\n // We're reading this so that we can decide whether to show the divider or not.\n // If ActionListSection is final item and no ActionListItem is present after that, we hide the divider\n\n // On web, we do it using descendant styling\n ({\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n } = getActionListSectionPosition(children));\n }\n\n // Looping through ActionListItems to add index to them and get an options array for moving focus between items\n const childrenWithId = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child)) {\n if (isValidAllowedChildren(child, componentIds.ActionListSection)) {\n const shouldHideDivider =\n index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;\n const sectionChildValues: string[] = [];\n return React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n children: React.Children.map(child.props.children, (childInSection) => {\n currentSection = child.props.title;\n sectionChildValues.push(childInSection.props.value);\n if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {\n return getActionListItemWithId(childInSection, shouldHideDivider);\n }\n\n return childInSection;\n }),\n // On web, we handle it with descendant styling in css so no need of JS there\n _hideDivider: isReactNative() ? shouldHideDivider : undefined,\n _sectionChildValues: sectionChildValues,\n });\n }\n\n if (isValidAllowedChildren(child, componentIds.ActionListItem)) {\n return getActionListItemWithId(child, true);\n }\n\n if (__DEV__) {\n throwBladeError({\n message: `Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,\n moduleName: 'ActionList',\n });\n }\n }\n return child;\n });\n\n return {\n sectionData,\n childrenWithId,\n actionListOptions,\n };\n};\n\nconst validateActionListItemProps = ({\n leading,\n trailing,\n titleSuffix,\n}: {\n leading: ActionListItemProps['leading'];\n trailing: ActionListItemProps['trailing'];\n titleSuffix: ActionListItemProps['titleSuffix'];\n}): void => {\n if (__DEV__) {\n React.Children.map(trailing, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(titleSuffix, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemBadge) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemBadgeGroup)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(leading, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAsset) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAvatar)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAvatar}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n }\n};\n\nconst getNormalTextColor = (\n isDisabled: boolean | undefined,\n { isMuted }: { isMuted?: boolean } = {},\n): Extract<\n BaseTextProps['color'],\n 'interactive.text.gray.disabled' | 'interactive.text.gray.muted' | 'interactive.text.gray.normal'\n> => {\n if (isDisabled) {\n return 'interactive.text.gray.disabled';\n }\n\n if (isMuted) {\n return 'interactive.text.gray.muted';\n }\n\n return 'interactive.text.gray.normal';\n};\n\nexport { getActionListProperties, validateActionListItemProps, getNormalTextColor };\n"],"names":["getActionListSectionPosition","children","childComponentIdArray","React","Children","toArray","map","child","getComponentId","lastActionListSectionIndex","lastIndexOf","componentIds","ActionListSection","isActionListItemPresentAfterSection","slice","includes","ActionListItem","actionListAllowedChildren","getActionListProperties","sectionData","currentSection","actionListOptions","getActionListItemWithId","hideDivider","isValidElement","props","isDisabled","push","title","value","onClickTrigger","_child$props$isSelect","anchorLink","href","onClick","name","isSelected","isReactNative","_child$props$target","target","window","open","top","currentIndex","length","foundSection","find","v","data","Object","assign","_index","clonedChild","cloneElement","_getActionListSection","childrenWithId","index","isValidAllowedChildren","shouldHideDivider","sectionChildValues","childInSection","_hideDivider","undefined","_sectionChildValues","__DEV__","throwBladeError","message","join","moduleName","validateActionListItemProps","_ref","leading","trailing","titleSuffix","ActionListItemIcon","ActionListItemText","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","ActionListItemAvatar","getNormalTextColor","_ref2","arguments","isMuted"],"mappings":";;;;;;;;;AAeA,IAAMA,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAChCC,QAAyB,CAItB,CAEH,IAAMC,qBAAqB,CAAGC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,GAAG,CAAC,SAACC,KAAK,CACvE,CAAA,OAAAC,cAAc,CAACD,KAAK,CAAC,CACvB,CAAA,CAAC,CAGD,IAAME,0BAA0B,CAAGP,qBAAqB,CAACQ,WAAW,CAClEC,YAAY,CAACC,iBACf,CAAC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gCAAgC,CACzC,CAEA,GAAIyD,OAAO,CAAE,CACX,OAAO,6BAA6B,CACtC,CAEA,OAAO,8BAA8B,CACvC;;;;"}
1
+ {"version":3,"file":"actionListUtils.js","sources":["../../../../../src/components/ActionList/actionListUtils.ts"],"sourcesContent":["import React from 'react';\nimport { componentIds } from './componentIds';\nimport type { ActionListItemProps } from './ActionListItem';\nimport type { OptionsType } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\n/**\n * Returns if there is ActionListItem after ActionListSection\n * and an index of last ActionListSection\n *\n * It is used to decide if ActionListSection add divider at the end\n */\nconst getActionListSectionPosition = (\n children: React.ReactNode,\n): {\n isActionListItemPresentAfterSection: boolean;\n lastActionListSectionIndex: number;\n} => {\n // Creating an array of componentIds\n const childComponentIdArray = React.Children.toArray(children).map((child) =>\n getComponentId(child),\n );\n\n // Reading the last `ActionListSection` component's index\n const lastActionListSectionIndex = childComponentIdArray.lastIndexOf(\n componentIds.ActionListSection,\n );\n\n // Checking if there is any `ActionListItem` present after `ActionListSection`\n const isActionListItemPresentAfterSection = childComponentIdArray\n .slice(lastActionListSectionIndex)\n .includes(componentIds.ActionListItem);\n\n return {\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n };\n};\n\nconst actionListAllowedChildren = [componentIds.ActionListItem, componentIds.ActionListSection];\n\nexport type SectionData = {\n title: string;\n hideDivider: boolean;\n data: ActionListItemProps[];\n}[];\n\n/**\n * Loops over action list items and returns different properties from children like option values, header and footer child, etc\n */\nconst getActionListProperties = (\n children: React.ReactNode,\n): {\n sectionData: SectionData;\n childrenWithId?: React.ReactNode[] | null;\n actionListOptions: OptionsType;\n} => {\n const sectionData: SectionData = [];\n let currentSection: string | null = null;\n const actionListOptions: OptionsType = [];\n\n const getActionListItemWithId = (\n child: React.ReactNode,\n hideDivider: boolean,\n ): React.ReactNode => {\n if (React.isValidElement(child) && !child.props.isDisabled) {\n actionListOptions.push({\n title: child.props.title,\n value: child.props.value,\n onClickTrigger: (value) => {\n const anchorLink = child.props.href;\n child.props.onClick?.({\n name: child.props.value,\n value: child.props.isSelected ?? value,\n });\n\n if (anchorLink && !isReactNative()) {\n const target = child.props.target ?? '_self';\n window.open(anchorLink, target);\n if (window.top) {\n window.top.open(anchorLink, target);\n }\n }\n },\n });\n const currentIndex = actionListOptions.length - 1;\n\n const foundSection = sectionData.find((v) => v.title === currentSection);\n // push the item in the appropriate bucket\n if (foundSection) {\n foundSection?.data.push({\n ...child.props,\n _index: currentIndex,\n });\n } else {\n // create a new bucket\n sectionData.push({\n title: currentSection!,\n hideDivider,\n data: [\n {\n ...child.props,\n _index: currentIndex,\n },\n ],\n });\n }\n\n const clonedChild = React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n _index: currentIndex,\n });\n return clonedChild;\n }\n\n return child;\n };\n\n let isActionListItemPresentAfterSection: boolean;\n // eslint-disable-next-line one-var\n let lastActionListSectionIndex: number;\n\n if (isReactNative()) {\n // We're reading this so that we can decide whether to show the divider or not.\n // If ActionListSection is final item and no ActionListItem is present after that, we hide the divider\n\n // On web, we do it using descendant styling\n ({\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n } = getActionListSectionPosition(children));\n }\n\n // Looping through ActionListItems to add index to them and get an options array for moving focus between items\n const childrenWithId = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child)) {\n if (isValidAllowedChildren(child, componentIds.ActionListSection)) {\n const shouldHideDivider =\n index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;\n const sectionChildValues: string[] = [];\n return React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n children: React.Children.map(child.props.children, (childInSection) => {\n currentSection = child.props.title;\n sectionChildValues.push(childInSection.props.value);\n if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {\n return getActionListItemWithId(childInSection, shouldHideDivider);\n }\n\n return childInSection;\n }),\n // On web, we handle it with descendant styling in css so no need of JS there\n _hideDivider: isReactNative() ? shouldHideDivider : undefined,\n _sectionChildValues: sectionChildValues,\n });\n }\n\n if (isValidAllowedChildren(child, componentIds.ActionListItem)) {\n return getActionListItemWithId(child, true);\n }\n\n if (__DEV__) {\n throwBladeError({\n message: `Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,\n moduleName: 'ActionList',\n });\n }\n }\n return child;\n });\n\n return {\n sectionData,\n childrenWithId,\n actionListOptions,\n };\n};\n\nconst validateActionListItemProps = ({\n leading,\n trailing,\n titleSuffix,\n}: {\n leading: ActionListItemProps['leading'];\n trailing: ActionListItemProps['trailing'];\n titleSuffix: ActionListItemProps['titleSuffix'];\n}): void => {\n if (__DEV__) {\n React.Children.map(trailing, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(titleSuffix, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemBadge) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemBadgeGroup)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(leading, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAsset) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAvatar)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAvatar}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n }\n};\n\nconst getNormalTextColor = (\n isDisabled: boolean | undefined,\n { isMuted }: { isMuted?: boolean } = {},\n): Extract<\n BaseTextProps['color'],\n 'interactive.text.gray.disabled' | 'interactive.text.gray.muted' | 'interactive.text.gray.normal'\n> => {\n if (isDisabled) {\n return 'interactive.text.gray.disabled';\n }\n\n if (isMuted) {\n return 'interactive.text.gray.muted';\n }\n\n return 'interactive.text.gray.normal';\n};\n\nexport { getActionListProperties, validateActionListItemProps, getNormalTextColor };\n"],"names":["getActionListSectionPosition","children","childComponentIdArray","React","Children","toArray","map","child","getComponentId","lastActionListSectionIndex","lastIndexOf","componentIds","ActionListSection","isActionListItemPresentAfterSection","slice","includes","ActionListItem","actionListAllowedChildren","getActionListProperties","sectionData","currentSection","actionListOptions","getActionListItemWithId","hideDivider","isValidElement","props","isDisabled","push","title","value","onClickTrigger","_child$props$isSelect","anchorLink","href","onClick","name","isSelected","isReactNative","_child$props$target","target","window","open","top","currentIndex","length","foundSection","find","v","data","Object","assign","_index","clonedChild","cloneElement","_getActionListSection","childrenWithId","index","isValidAllowedChildren","shouldHideDivider","sectionChildValues","childInSection","_hideDivider","undefined","_sectionChildValues","__DEV__","throwBladeError","message","join","moduleName","validateActionListItemProps","_ref","leading","trailing","titleSuffix","ActionListItemIcon","ActionListItemText","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","ActionListItemAvatar","getNormalTextColor","_ref2","arguments","isMuted"],"mappings":";;;;;;;;;AAeA,IAAMA,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAChCC,QAAyB,CAItB,CAEH,IAAMC,qBAAqB,CAAGC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,GAAG,CAAC,SAACC,KAAK,CACvE,CAAA,OAAAC,cAAc,CAACD,KAAK,CAAC,CACvB,CAAA,CAAC,CAGD,IAAME,0BAA0B,CAAGP,qBAAqB,CAACQ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,CAKT,GAAIzD,UAAU,CAAE,CACd,OAAO,gCAAgC,CACzC,CAEA,GAAIyD,OAAO,CAAE,CACX,OAAO,6BAA6B,CACtC,CAEA,OAAO,8BAA8B,CACvC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ReactChild, ReactElement } from 'react';\nimport React, { Fragment, useState, forwardRef } from 'react';\n\nimport { StyledAlert } from './StyledAlert';\nimport type { IconComponent } from '~components/Icons';\nimport {\n AlertOctagonIcon,\n AlertTriangleIcon,\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n} from '~components/Icons';\nimport { castNativeType, castWebType, useBreakpoint, getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport BaseButton from '~components/Button/BaseButton';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { useTheme } from '~components/BladeProvider';\nimport type {\n DataAnalyticsAttribute,\n BladeElementRef,\n DotNotationSpacingStringToken,\n TestID,\n} from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { MAKE_ANALYTICS_CONSTANTS, makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype PrimaryAction = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionButton = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionLinkButton = {\n text: string;\n href: string;\n onClick?: () => void;\n target?: string;\n /**\n * When `target` is set to `_blank` this is automatically set to `noopener noreferrer`\n */\n rel?: string;\n};\n\ntype SecondaryAction = SecondaryActionButton | SecondaryActionLinkButton;\n\ntype AlertProps = {\n /**\n * Body content, pass text or JSX. Avoid passing components except `Link` to customize the content.\n */\n description: ReactChild;\n\n /**\n * A brief heading\n */\n title?: string;\n\n /**\n * Shows a dismiss button\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * A callback when the dismiss button is clicked\n */\n onDismiss?: () => void;\n\n /**\n * Can be used to render custom icon\n */\n icon?: IconComponent;\n\n /**\n * Can be set to `high` for a more prominent look. Not to be confused with a11y emphasis.\n *\n * @default subtle\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Makes the Alert span the entire container width, instead of the default max width of `584px`.\n * This also makes the alert borderless, useful for creating full bleed layouts.\n *\n * @default false\n */\n isFullWidth?: boolean;\n\n /**\n * Sets the color tone\n */\n color?: FeedbackColors;\n\n /**\n * Renders a primary action button and a secondary action link button\n */\n actions?: {\n /**\n * Renders a button (should **always** be present if `secondary` action is being used)\n */\n primary?: PrimaryAction;\n /**\n * Renders a Link button\n */\n secondary?: SecondaryAction;\n };\n} & TestID &\n StyledPropsBlade &\n DataAnalyticsAttribute;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n// Need extra wrappers on React Native only for alignment\nconst CloseButtonWrapper = isReactNative ? BaseBox : Fragment;\n\nconst intentIconMap = {\n positive: CheckCircleIcon,\n negative: AlertOctagonIcon,\n information: InfoIcon,\n neutral: InfoIcon,\n notice: AlertTriangleIcon,\n};\n\nconst _Alert = (\n {\n description,\n title,\n isDismissible = true,\n onDismiss,\n emphasis = 'subtle',\n isFullWidth = false,\n color = 'neutral',\n actions,\n testID,\n icon,\n ...rest\n }: AlertProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement | null => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const [isVisible, setIsVisible] = useState(true);\n\n const isDesktop = matchedDeviceType === 'desktop';\n const isMobile = !isDesktop;\n\n const Icon = icon ?? intentIconMap[color];\n let iconOffset: DotNotationSpacingStringToken = 'spacing.1';\n\n // certain special cases below needs special care for near perfect alignment\n if (isReactNative) {\n if (isFullWidth && !title) {\n iconOffset = 'spacing.1';\n } else if (!isFullWidth && !title) {\n iconOffset = 'spacing.0';\n } else if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n }\n } else if (isMobile) {\n if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n } else if (isFullWidth && !title) {\n iconOffset = 'spacing.2';\n }\n } else if (isFullWidth) {\n iconOffset = 'spacing.1';\n }\n\n const shouldCenterAlign = isFullWidth && !title;\n let alignment: 'center' | 'flex-start' = 'flex-start';\n if (!isFullWidth) alignment = 'flex-start';\n if (shouldCenterAlign) alignment = 'center';\n\n const leadingIcon = (\n <BaseBox display=\"flex\" alignSelf={alignment} marginTop={iconOffset}>\n <Icon\n color={\n emphasis === 'intense'\n ? 'surface.icon.staticWhite.normal'\n : `feedback.icon.${color}.${emphasis === 'subtle' ? 'intense' : 'subtle'}`\n }\n size=\"medium\"\n />\n </BaseBox>\n );\n\n const textColor =\n emphasis === 'intense' ? 'surface.text.staticWhite.normal' : 'surface.text.gray.subtle';\n const _title = title ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text color={textColor} size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n </BaseBox>\n ) : null;\n\n const _description = (\n <BaseBox marginTop={title || isReactNative ? 'spacing.0' : 'spacing.1'}>\n <Text color={textColor} size=\"small\">\n {description}\n </Text>\n </BaseBox>\n );\n\n const primaryAction = actions?.primary ? (\n <BaseBox\n marginRight=\"spacing.5\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseButton\n size=\"small\"\n onClick={actions.primary.onClick}\n color={emphasis === 'intense' ? 'white' : color}\n variant=\"secondary\"\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.ALERT.PRIMARY_ACTION_BUTTON}\n >\n {actions.primary.text}\n </BaseButton>\n </BaseBox>\n ) : null;\n\n const secondaryActionParams: Partial<SecondaryActionLinkButton> | null = actions?.secondary\n ? {\n onClick: actions.secondary.onClick,\n }\n : null;\n\n /**\n * TS assumes only common properties to be present for `SecondaryAction` union type\n * We add a type guard that checks if href is present on secondary action:\n * - If yes, then TS can assume it to be `SecondaryActionLinkButton` (href being a required property)\n * - If no, then it would be `SecondaryActionButton` (and link properties wouldn't be needed)\n */\n if (actions?.secondary && secondaryActionParams && 'href' in actions.secondary) {\n secondaryActionParams.href = actions.secondary.href;\n secondaryActionParams.target = actions.secondary.target;\n secondaryActionParams.rel = actions.secondary.rel;\n }\n\n const secondaryAction = actions?.secondary ? (\n <BaseBox marginRight=\"spacing.4\" display={(isReactNative ? 'flex' : 'inline-flex') as never}>\n <BaseLink\n size=\"small\"\n color={emphasis === 'intense' ? 'white' : color}\n {...secondaryActionParams}\n >\n {actions.secondary.text}\n </BaseLink>\n </BaseBox>\n ) : null;\n\n // For certain cases we wish to render actions inline with text content\n const showActionsHorizontal = isFullWidth && isDesktop;\n\n const actionsHorizontal =\n showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const actionsVertical =\n !showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox marginTop=\"spacing.4\" flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const onClickDismiss = (): void => {\n if (onDismiss) {\n onDismiss();\n }\n setIsVisible(false);\n };\n const closeButton = isDismissible ? (\n <CloseButtonWrapper>\n <IconButton\n accessibilityLabel=\"Dismiss alert\"\n onClick={onClickDismiss}\n emphasis={emphasis === 'intense' ? 'subtle' : 'intense'}\n size=\"large\"\n icon={CloseIcon}\n />\n </CloseButtonWrapper>\n ) : null;\n\n const a11yProps = makeAccessible({\n // React Native doesn't has status as role\n role: isReactNative || color === 'negative' || color === 'notice' ? 'alert' : 'status',\n // override the implicit live region of role `alert`\n ...(color === 'notice' && { liveRegion: 'polite' }),\n });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <BaseBox\n ref={ref as never}\n {...a11yProps}\n {...metaAttribute({ name: MetaConstants.Alert, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <StyledAlert\n color={color}\n emphasis={emphasis}\n isFullWidth={isFullWidth}\n isDesktop={isDesktop}\n textAlign={'left' as never}\n >\n {leadingIcon}\n <BaseBox\n flex={1}\n paddingLeft={isFullWidth ? 'spacing.4' : 'spacing.3'}\n paddingRight={showActionsHorizontal ? 'spacing.4' : 'spacing.2'}\n >\n {_title}\n {_description}\n {actionsVertical}\n </BaseBox>\n {actionsHorizontal}\n {closeButton}\n </StyledAlert>\n </BaseBox>\n );\n};\n\nconst Alert = forwardRef(_Alert);\n\nexport type { AlertProps };\nexport { Alert };\n"],"names":["isReactNative","getPlatformType","CloseButtonWrapper","BaseBox","Fragment","intentIconMap","positive","CheckCircleIcon","negative","AlertOctagonIcon","information","InfoIcon","neutral","notice","AlertTriangleIcon","_Alert","_ref","ref","description","title","_ref$isDismissible","isDismissible","onDismiss","_ref$emphasis","emphasis","_ref$isFullWidth","isFullWidth","_ref$color","color","actions","testID","icon","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","_useState","useState","_useState2","_slicedToArray","isVisible","setIsVisible","isDesktop","isMobile","Icon","iconOffset","shouldCenterAlign","alignment","leadingIcon","_jsx","display","alignSelf","marginTop","children","size","textColor","_title","marginBottom","Text","weight","_description","primaryAction","primary","marginRight","castNativeType","castWebType","BaseButton","onClick","variant","MAKE_ANALYTICS_CONSTANTS","ALERT","PRIMARY_ACTION_BUTTON","text","secondaryActionParams","secondary","href","target","rel","secondaryAction","BaseLink","Object","assign","showActionsHorizontal","actionsHorizontal","_jsxs","flexDirection","alignItems","actionsVertical","onClickDismiss","closeButton","IconButton","accessibilityLabel","CloseIcon","a11yProps","makeAccessible","role","liveRegion","metaAttribute","name","MetaConstants","Alert","getStyledProps","makeAnalyticsAttribute","StyledA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ACmB,WAAW,CACVjF,CAAAA,KAAK,CAAEA,KAAM,CACbJ,QAAQ,CAAEA,QAAS,CACnBE,WAAW,CAAEA,WAAY,CACzBsB,SAAS,CAAEA,SAAU,CACrB8D,SAAS,CAAE,MAAgB,CAAAnD,QAAA,CAE1BL,CAAAA,WAAW,CACZoC,IAAA,CAACvF,OAAO,CAAA,CACN4G,IAAI,CAAE,CAAE,CACRC,WAAW,CAAEtF,WAAW,CAAG,WAAW,CAAG,WAAY,CACrDuF,YAAY,CAAEzB,qBAAqB,CAAG,WAAW,CAAG,WAAY,CAAA7B,QAAA,CAAA,CAE/DG,MAAM,CACNI,YAAY,CACZ2B,eAAe,CACT,CAAA,CAAC,CACTJ,iBAAiB,CACjBM,WAAW,CAAA,CACD,CAAC,CAAA,CACP,CAAC,CAEd,CAAC,CAEK,IAAAW,KAAK,CAAGQ,UAAU,CAACnG,MAAM;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ReactChild, ReactElement } from 'react';\nimport React, { Fragment, useState, forwardRef } from 'react';\n\nimport { StyledAlert } from './StyledAlert';\nimport type { IconComponent } from '~components/Icons';\nimport {\n AlertOctagonIcon,\n AlertTriangleIcon,\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n} from '~components/Icons';\nimport { castNativeType, castWebType, useBreakpoint, getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport BaseButton from '~components/Button/BaseButton';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { useTheme } from '~components/BladeProvider';\nimport type {\n DataAnalyticsAttribute,\n BladeElementRef,\n DotNotationSpacingStringToken,\n TestID,\n} from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { MAKE_ANALYTICS_CONSTANTS, makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype PrimaryAction = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionButton = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionLinkButton = {\n text: string;\n href: string;\n onClick?: () => void;\n target?: string;\n /**\n * When `target` is set to `_blank` this is automatically set to `noopener noreferrer`\n */\n rel?: string;\n};\n\ntype SecondaryAction = SecondaryActionButton | SecondaryActionLinkButton;\n\ntype AlertProps = {\n /**\n * Body content, pass text or JSX. Avoid passing components except `Link` to customize the content.\n */\n description: ReactChild;\n\n /**\n * A brief heading\n */\n title?: string;\n\n /**\n * Shows a dismiss button\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * A callback when the dismiss button is clicked\n */\n onDismiss?: () => void;\n\n /**\n * Can be used to render custom icon\n */\n icon?: IconComponent;\n\n /**\n * Can be set to `high` for a more prominent look. Not to be confused with a11y emphasis.\n *\n * @default subtle\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Makes the Alert span the entire container width, instead of the default max width of `584px`.\n * This also makes the alert borderless, useful for creating full bleed layouts.\n *\n * @default false\n */\n isFullWidth?: boolean;\n\n /**\n * Sets the color tone\n */\n color?: FeedbackColors;\n\n /**\n * Renders a primary action button and a secondary action link button\n */\n actions?: {\n /**\n * Renders a button (should **always** be present if `secondary` action is being used)\n */\n primary?: PrimaryAction;\n /**\n * Renders a Link button\n */\n secondary?: SecondaryAction;\n };\n} & TestID &\n StyledPropsBlade &\n DataAnalyticsAttribute;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n// Need extra wrappers on React Native only for alignment\nconst CloseButtonWrapper = isReactNative ? BaseBox : Fragment;\n\nconst intentIconMap = {\n positive: CheckCircleIcon,\n negative: AlertOctagonIcon,\n information: InfoIcon,\n neutral: InfoIcon,\n notice: AlertTriangleIcon,\n};\n\nconst _Alert = (\n {\n description,\n title,\n isDismissible = true,\n onDismiss,\n emphasis = 'subtle',\n isFullWidth = false,\n color = 'neutral',\n actions,\n testID,\n icon,\n ...rest\n }: AlertProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement | null => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const [isVisible, setIsVisible] = useState(true);\n\n const isDesktop = matchedDeviceType === 'desktop';\n const isMobile = !isDesktop;\n\n const Icon = icon ?? intentIconMap[color];\n let iconOffset: DotNotationSpacingStringToken = 'spacing.1';\n\n // certain special cases below needs special care for near perfect alignment\n if (isReactNative) {\n if (isFullWidth && !title) {\n iconOffset = 'spacing.1';\n } else if (!isFullWidth && !title) {\n iconOffset = 'spacing.0';\n } else if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n }\n } else if (isMobile) {\n if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n } else if (isFullWidth && !title) {\n iconOffset = 'spacing.2';\n }\n } else if (isFullWidth) {\n iconOffset = 'spacing.1';\n }\n\n const shouldCenterAlign = isFullWidth && !title;\n let alignment: 'center' | 'flex-start' = 'flex-start';\n if (!isFullWidth) alignment = 'flex-start';\n if (shouldCenterAlign) alignment = 'center';\n\n const leadingIcon = (\n <BaseBox display=\"flex\" alignSelf={alignment} marginTop={iconOffset}>\n <Icon\n color={\n emphasis === 'intense'\n ? 'surface.icon.staticWhite.normal'\n : `feedback.icon.${color}.${emphasis === 'subtle' ? 'intense' : 'subtle'}`\n }\n size=\"medium\"\n />\n </BaseBox>\n );\n\n const textColor =\n emphasis === 'intense' ? 'surface.text.staticWhite.normal' : 'surface.text.gray.subtle';\n const _title = title ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text color={textColor} size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n </BaseBox>\n ) : null;\n\n const _description = (\n <BaseBox marginTop={title || isReactNative ? 'spacing.0' : 'spacing.1'}>\n <Text color={textColor} size=\"small\">\n {description}\n </Text>\n </BaseBox>\n );\n\n const primaryAction = actions?.primary ? (\n <BaseBox\n marginRight=\"spacing.5\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseButton\n size=\"small\"\n onClick={actions.primary.onClick}\n color={emphasis === 'intense' ? 'white' : color}\n variant=\"secondary\"\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.ALERT.PRIMARY_ACTION_BUTTON}\n >\n {actions.primary.text}\n </BaseButton>\n </BaseBox>\n ) : null;\n\n const secondaryActionParams: Partial<SecondaryActionLinkButton> | null = actions?.secondary\n ? {\n onClick: actions.secondary.onClick,\n }\n : null;\n\n /**\n * TS assumes only common properties to be present for `SecondaryAction` union type\n * We add a type guard that checks if href is present on secondary action:\n * - If yes, then TS can assume it to be `SecondaryActionLinkButton` (href being a required property)\n * - If no, then it would be `SecondaryActionButton` (and link properties wouldn't be needed)\n */\n if (actions?.secondary && secondaryActionParams && 'href' in actions.secondary) {\n secondaryActionParams.href = actions.secondary.href;\n secondaryActionParams.target = actions.secondary.target;\n secondaryActionParams.rel = actions.secondary.rel;\n }\n\n const secondaryAction = actions?.secondary ? (\n <BaseBox marginRight=\"spacing.4\" display={(isReactNative ? 'flex' : 'inline-flex') as never}>\n <BaseLink\n size=\"small\"\n color={emphasis === 'intense' ? 'white' : color}\n {...secondaryActionParams}\n >\n {actions.secondary.text}\n </BaseLink>\n </BaseBox>\n ) : null;\n\n // For certain cases we wish to render actions inline with text content\n const showActionsHorizontal = isFullWidth && isDesktop;\n\n const actionsHorizontal =\n showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const actionsVertical =\n !showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox marginTop=\"spacing.4\" flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const onClickDismiss = (): void => {\n if (onDismiss) {\n onDismiss();\n }\n setIsVisible(false);\n };\n const closeButton = isDismissible ? (\n <CloseButtonWrapper>\n <IconButton\n accessibilityLabel=\"Dismiss alert\"\n onClick={onClickDismiss}\n emphasis={emphasis === 'intense' ? 'subtle' : 'intense'}\n size=\"large\"\n icon={CloseIcon}\n />\n </CloseButtonWrapper>\n ) : null;\n\n const a11yProps = makeAccessible({\n // React Native doesn't has status as role\n role: isReactNative || color === 'negative' || color === 'notice' ? 'alert' : 'status',\n // override the implicit live region of role `alert`\n ...(color === 'notice' && { liveRegion: 'polite' }),\n });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <BaseBox\n ref={ref as never}\n {...a11yProps}\n {...metaAttribute({ name: MetaConstants.Alert, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <StyledAlert\n color={color}\n emphasis={emphasis}\n isFullWidth={isFullWidth}\n isDesktop={isDesktop}\n textAlign={'left' as never}\n >\n {leadingIcon}\n <BaseBox\n flex={1}\n paddingLeft={isFullWidth ? 'spacing.4' : 'spacing.3'}\n paddingRight={showActionsHorizontal ? 'spacing.4' : 'spacing.2'}\n >\n {_title}\n {_description}\n {actionsVertical}\n </BaseBox>\n {actionsHorizontal}\n {closeButton}\n </StyledAlert>\n </BaseBox>\n );\n};\n\nconst Alert = forwardRef(_Alert);\n\nexport type { AlertProps };\nexport { Alert };\n"],"names":["isReactNative","getPlatformType","CloseButtonWrapper","BaseBox","Fragment","intentIconMap","positive","CheckCircleIcon","negative","AlertOctagonIcon","information","InfoIcon","neutral","notice","AlertTriangleIcon","_Alert","_ref","ref","description","title","_ref$isDismissible","isDismissible","onDismiss","_ref$emphasis","emphasis","_ref$isFullWidth","isFullWidth","_ref$color","color","actions","testID","icon","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","_useState","useState","_useState2","_slicedToArray","isVisible","setIsVisible","isDesktop","isMobile","Icon","iconOffset","shouldCenterAlign","alignment","leadingIcon","_jsx","display","alignSelf","marginTop","children","size","textColor","_title","marginBottom","Text","weight","_description","primaryAction","primary","marginRight","castNativeType","castWebType","BaseButton","onClick","variant","MAKE_ANALYTICS_CONSTANTS","ALERT","PRIMARY_ACTION_BUTTON","text","secondaryActionParams","secondary","href","target","rel","secondaryAction","BaseLink","Object","assign","showActionsHorizontal","actionsHorizontal","_jsxs","flexDirection","alignItems","actionsVertical","onClickDismiss","closeButton","IconButton","accessibilityLabel","CloseIcon","a11yProps","makeAccessible","role","liveRegion","metaAttribute","name","MetaConstants","Alert","getStyledProps","makeAnalyticsAttribute","StyledAlert","textAlign","flex","paddingLeft","paddingRight","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,aAAA,CAAA,OAAA,CAAA,eAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,OAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,CAuHA,IAAMA,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAG1D,IAAMC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AE0E,UAAU,CAAE,QAAS,CAAC,CACnD,CAAC,CAEF,GAAI,CAACxD,SAAS,CAAE,CACd,OAAO,IAAI,CACb,CAEA,OACES,GAAA,CAACpD,OAAO,CAAAmF,MAAA,CAAAC,MAAA,CAAA,CACNtE,GAAG,CAAEA,GAAa,CAAA,CACdkF,SAAS,CACTI,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,KAAK,CAAE5E,MAAM,CAANA,MAAO,CAAC,CAAC,CACpD6E,cAAc,CAAC3E,IAAI,CAAC,CACpB4E,sBAAsB,CAAC5E,IAAI,CAAC,CAAA,CAAA2B,QAAA,CAEhC+B,IAAA,CAACmB,WAAW,CACVjF,CAAAA,KAAK,CAAEA,KAAM,CACbJ,QAAQ,CAAEA,QAAS,CACnBE,WAAW,CAAEA,WAAY,CACzBsB,SAAS,CAAEA,SAAU,CACrB8D,SAAS,CAAE,MAAgB,CAAAnD,QAAA,CAE1BL,CAAAA,WAAW,CACZoC,IAAA,CAACvF,OAAO,CAAA,CACN4G,IAAI,CAAE,CAAE,CACRC,WAAW,CAAEtF,WAAW,CAAG,WAAW,CAAG,WAAY,CACrDuF,YAAY,CAAEzB,qBAAqB,CAAG,WAAW,CAAG,WAAY,CAAA7B,QAAA,CAAA,CAE/DG,MAAM,CACNI,YAAY,CACZ2B,eAAe,CACT,CAAA,CAAC,CACTJ,iBAAiB,CACjBM,WAAW,CAAA,CACD,CAAC,CAAA,CACP,CAAC,CAEd,CAAC,CAEK,IAAAW,KAAK,CAAGQ,UAAU,CAACnG,MAAM;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sources":["../../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport type { CurrencyCodeType } from '@razorpay/i18nify-js/currency';\nimport { formatNumberByParts } from '@razorpay/i18nify-js/currency';\nimport type { AmountTypeProps } from './amountTokens';\nimport { normalAmountSizes, subtleFontSizes, amountLineHeights } from './amountTokens';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { objectKeysWithType } from '~utils/objectKeysWithType';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { Text } from '~components/Typography';\nimport { opacity } from '~tokens/global';\nimport type { FontFamily } from '~tokens/global';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\n/**\n * Pollyfill function to get around the node 18 error\n *\n * This function is maintained by i18nify team. Reach out to them for any change regarding this.\n */\nconst stripTrailingZerosFromParts = (\n parts: ReturnType<typeof formatNumberByParts>,\n): ReturnType<typeof formatNumberByParts> => {\n const decimalPart = parts.rawParts\n .filter(({ type }) => type === 'fraction')\n .map(({ value }) => value)\n .join('');\n\n const hasFraction = parts.rawParts.some(({ type }) => type === 'fraction');\n\n if (hasFraction && /^0+$/.test(decimalPart)) {\n delete parts.decimal;\n delete parts.fraction;\n parts.rawParts = parts.rawParts.filter(({ type }) => type !== 'decimal' && type !== 'fraction');\n }\n\n return parts;\n};\n\n/**\n * Wrapper that uses pollyfill of i18nify team\n */\nconst pollyfilledFormatNumberByParts: typeof formatNumberByParts = (value, options) => {\n const parts = formatNumberByParts(value, options);\n\n if (options?.intlOptions?.trailingZeroDisplay === 'stripIfInteger') {\n return stripTrailingZerosFromParts(parts);\n }\n\n return parts;\n};\n\ntype AmountCommonProps = {\n /**\n * The value to be rendered within the component.\n *\n */\n value: number;\n /**\n * Sets the color of the amount.\n *\n * @default undefined\n */\n color?: BaseTextProps['color'];\n /**\n * Indicates what the suffix of amount should be\n *\n * @default 'decimals'\n */\n suffix?: 'decimals' | 'none' | 'humanize';\n /**\n * Makes the currency indicator(currency symbol/code) and decimal digits small and faded\n *\n * @default true\n */\n isAffixSubtle?: true | false;\n /**\n * Determines the visual representation of the currency, choose between displaying the currency symbol or code.\n *\n * Note: Currency symbol and code is determined by the locale set in user's browser or set via @razorpay/i18nify-react library.\n *\n * @default 'currency-symbol'\n */\n currencyIndicator?: 'currency-symbol' | 'currency-code';\n /**\n * The currency of the amount. Note that this component\n * only displays the provided value in the specified currency, it does not perform any currency conversion.\n *\n * @default 'INR'\n * */\n currency?: CurrencyCodeType;\n /**\n * If true, the amount text will have a line through it.\n *\n * @default false\n */\n isStrikethrough?: boolean;\n /**\n * Controls the number of decimal places to display when suffix is 'decimals'.\n *\n * @default 2\n */\n fractionDigits?: number;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\ntype ColorProps = {\n amountValueColor: BaseTextProps['color'];\n};\n\ntype AmountProps = AmountTypeProps & AmountCommonProps;\n\nconst getTextColorProps = ({ color }: { color: AmountProps['color'] }): ColorProps => {\n const props: ColorProps = {\n amountValueColor: 'surface.text.gray.normal',\n };\n if (!color) return props;\n props.amountValueColor = color;\n return props;\n};\n\ntype AmountType = Partial<ReturnType<typeof formatNumberByParts>>;\n\ninterface AmountValue extends Omit<AmountProps, 'value'> {\n amountValueColor: BaseTextProps['color'];\n amount: AmountType;\n size: Exclude<AmountProps['size'], undefined>;\n}\n\nconst AmountValue = ({\n amount,\n size = 'medium',\n type = 'body',\n weight = 'regular',\n amountValueColor,\n isAffixSubtle,\n suffix,\n}: AmountValue): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n const affixFontSize = isAffixSubtle ? subtleFontSizes[type][size] : normalAmountSizes[type][size];\n const numberFontFamily: keyof FontFamily = type === 'body' ? 'text' : 'heading';\n if (suffix === 'decimals' && isAffixSubtle) {\n // Native does not support alignItems of Text inside a div, instead we need to wrap is in a Text\n const AmountWrapper = isReactNative ? Text : React.Fragment;\n\n return (\n <AmountWrapper>\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n fontFamily={numberFontFamily}\n as={isReactNative ? undefined : 'span'}\n >\n {amount.integer}\n </BaseText>\n <BaseText\n fontWeight={weight}\n fontSize={affixFontSize}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[800] : 1}\n >\n {amount.decimal}\n {amount.fraction}\n </BaseText>\n </AmountWrapper>\n );\n }\n\n return (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n lineHeight={amountLineHeights[type][size]}\n >\n {amount.integer}\n {amount.decimal}\n {amount.fraction}\n {amount.compact}\n </BaseText>\n );\n};\n\ntype FormatAmountWithSuffixType = {\n suffix: AmountProps['suffix'];\n value: number;\n currency: AmountProps['currency'];\n fractionDigits?: number;\n};\n\n/**\n * Returns a parsed object based on the suffix passed in parameters\n * === Logic ===\n * value = 12500.45 \n * if suffix === 'decimals' => {\n \"integer\": \"12,500\",\n \"decimal\": \".\",\n \"fraction\": \"45\",\n \"compact\": \"K\",\n \"isPrefixSymbol\": false,\n \"rawParts\": [{\"type\": \"integer\",\"value\": \"12\"},{\"type\": \"group\",\"value\": \",\"},{\"type\": \"integer\",\"value\": \"500\"},{\"type\": \"decimal\",\"value\": \".\"},{\"type\": \"fraction\",\"value\": \"45\"}]\n}\n * @returns {AmountType}\n */\nexport const getAmountByParts = ({\n suffix,\n value,\n currency,\n fractionDigits = 2,\n}: FormatAmountWithSuffixType): AmountType => {\n try {\n switch (suffix) {\n case 'decimals': {\n const options = {\n intlOptions: {\n maximumFractionDigits: fractionDigits,\n minimumFractionDigits: fractionDigits,\n },\n currency,\n } as const;\n return pollyfilledFormatNumberByParts(value, options);\n }\n case 'humanize': {\n const options = {\n intlOptions: {\n notation: 'compact',\n maximumFractionDigits: 2,\n trailingZeroDisplay: 'stripIfInteger',\n },\n currency,\n } as const;\n return pollyfilledFormatNumberByParts(value, options);\n }\n\n default: {\n const options = {\n intlOptions: {\n maximumFractionDigits: 0,\n roundingMode: 'floor',\n },\n currency,\n } as const;\n return pollyfilledFormatNumberByParts(value, options);\n }\n }\n } catch (err: unknown) {\n return {\n integer: `${value}`,\n currency,\n };\n }\n};\n\nconst _Amount = (\n {\n value,\n suffix = 'decimals',\n type = 'body',\n size = 'medium',\n weight = 'regular',\n isAffixSubtle = true,\n isStrikethrough = false,\n color,\n currencyIndicator = 'currency-symbol',\n currency = 'INR',\n fractionDigits = 2,\n testID,\n ...rest\n }: AmountProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n if (__DEV__) {\n if (typeof value !== 'number') {\n throwBladeError({\n message: '`value` prop must be of type `number` for Amount.',\n moduleName: 'Amount',\n });\n }\n // @ts-expect-error neutral color should throw error\n if (color === 'neutral') {\n throwBladeError({\n message: '`neutral` color is not supported.',\n moduleName: 'Amount',\n });\n }\n\n const bodySizes = objectKeysWithType(normalAmountSizes.body);\n if ((type === 'body' || !type) && !bodySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"body\"`,\n moduleName: 'Amount',\n });\n }\n\n const displaySizes = objectKeysWithType(normalAmountSizes.display);\n if (type === 'display' && !displaySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"display\"`,\n moduleName: 'Amount',\n });\n }\n\n const headingSizes = objectKeysWithType(normalAmountSizes.heading);\n if (type === 'heading' && !headingSizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"heading\"`,\n moduleName: 'Amount',\n });\n }\n }\n\n const { amountValueColor } = getTextColorProps({\n color,\n });\n\n const renderedValue = getAmountByParts({ suffix, value, currency, fractionDigits });\n const isPrefixSymbol = renderedValue.isPrefixSymbol ?? true;\n const currencySymbol = renderedValue.currency ?? currency;\n\n const currencyPosition = isPrefixSymbol ? 'left' : 'right';\n const currencySymbolOrCode = currencyIndicator === 'currency-symbol' ? currencySymbol : currency;\n\n const currencyFontSize = isAffixSubtle\n ? subtleFontSizes[type][size]\n : normalAmountSizes[type][size];\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox\n ref={ref as never}\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n flexDirection=\"row\"\n {...metaAttribute({ name: MetaConstants.Amount, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n alignItems=\"baseline\"\n flexDirection=\"row\"\n position=\"relative\"\n >\n {renderedValue.minusSign ? (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n marginX=\"spacing.2\"\n >\n {renderedValue.minusSign}\n </BaseText>\n ) : null}\n {currencyPosition === 'left' && (\n <BaseText\n marginRight=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[800] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n <AmountValue\n amount={renderedValue}\n amountValueColor={amountValueColor}\n type={type}\n weight={weight}\n size={size}\n isAffixSubtle={isAffixSubtle}\n suffix={suffix}\n currency={currency}\n />\n {currencyPosition === 'right' && (\n <BaseText\n marginLeft=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[800] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n {isStrikethrough && (\n // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: the borderBottomColor error below is thrown here as well\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore- intentionally setting the border color to the color prop for this hacky strikethrough\n borderBottomColor={amountValueColor}\n borderBottomWidth={type === 'body' ? 'thin' : 'thicker'}\n borderBottomStyle=\"solid\"\n position=\"absolute\"\n width=\"100%\"\n top=\"50%\"\n />\n )}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Amount = assignWithoutSideEffects(React.forwardRef(_Amount), {\n displayName: 'Amount',\n componentId: 'Amount',\n});\n\nexport type { AmountProps };\nexport { Amount };\n"],"names":["stripTrailingZerosFromParts","parts","decimalPart","rawParts","filter","_ref","type","map","_ref2","value","join","hasFraction","some","_ref3","test","decimal","fraction","_ref4","pollyfilledFormatNumberByParts","options","_options$intlOptions","formatNumberByParts","intlOptions","trailingZeroDisplay","getTextColorProps","_ref5","color","props","amountValueColor","AmountValue","_ref6","amount","_ref6$size","size","_ref6$type","_ref6$weight","weight","isAffixSubtle","suffix","isReactNative","getPlatformType","affixFontSize","subtleFontSizes","normalAmountSizes","numberFontFamily","AmountWrapper","Text","React","Fragment","_jsxs","children","_jsx","BaseText","fontSize","fontWeight","lineHeight","amountLineHeights","fontFamily","as","undefined","integer","opacity","compact","getAmountByParts","_ref7","currency","_ref7$fractionDigits","fractionDigits","maximumFractionDigits","minimumFractionDigits","notation","roundingMode","err","_Amount","_ref8","ref","_renderedValue$isPref","_renderedValue$curren","_ref8$suffix","_ref8$type","_ref8$size","_ref8$weight","_ref8$isAffixSubtle","_ref8$isStrikethrough","isStrikethrough","_ref8$currencyIndicat","currencyIndicator","_ref8$currency","_ref8$fractionDigits","testID","rest","_objectWithoutProperties","_excluded","__DEV__","throwBladeError","message","moduleName","bodySizes","objectKeysWithType","body","includes","displaySizes","display","headingSizes","heading","_getTextColorProps","renderedValue","isPrefixSymbol","currencySymbol","currencyPosition","currencySymbolOrCode","currencyFontSize","BaseBox","Object","assign","flexDirection","metaAttribute","name","MetaConstants","Amount","getStyledProps","makeAnalyticsAttribute","alignItems","position","minusSign","marginX","marginRight","marginLeft","borderBottomColor","borderBottomWidth","border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M,CAAEA,MAAO,CACf2B,QAAQ,CAAEA,QAAS,CACpB,CAAC,CACD4C,gBAAgB,GAAK,OAAO,EAC3B1D,GAAA,CAACC,QAAQ,CAAA,CACP2E,UAAU,CAAC,WAAW,CACtBzE,UAAU,CAAElB,MAAO,CACnBiB,QAAQ,CAAE0D,gBAAiB,CAC3BrF,KAAK,CAAEE,gBAAiB,CACxB8B,EAAE,CAAEnB,aAAa,CAAGoB,SAAS,CAAG,MAAO,CACvCE,OAAO,CAAExB,aAAa,CAAGwB,OAAO,CAAC,GAAG,CAAC,CAAG,CAAE,CAAAX,QAAA,CAEzC4D,oBAAoB,CACb,CACX,CACA1B,eAAe,EAGdjC,GAAA,CAAC6D,OAAO,CAGNgB,CAAAA,iBAAiB,CAAEpG,gBAAiB,CACpCqG,iBAAiB,CAAE3H,IAAI,GAAK,MAAM,CAAG,MAAM,CAAG,SAAU,CACxD4H,iBAAiB,CAAC,OAAO,CACzBP,QAAQ,CAAC,UAAU,CACnBQ,KAAK,CAAC,MAAM,CACZC,GAAG,CAAC,KAAK,CACV,CACF,CAAA,CACM,CAAC,CACH,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAb,MAAM,CAAGc,wBAAwB,CAACtF,cAAK,CAACuF,UAAU,CAAC7D,OAAO,CAAC,CAAE,CACjE8D,WAAW,CAAE,QAAQ,CACrBC,WAAW,CAAE,QACf,CAAC;;;;"}
1
+ {"version":3,"file":"Amount.js","sources":["../../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport type { CurrencyCodeType } from '@razorpay/i18nify-js/currency';\nimport { formatNumberByParts } from '@razorpay/i18nify-js/currency';\nimport type { AmountTypeProps } from './amountTokens';\nimport { normalAmountSizes, subtleFontSizes, amountLineHeights } from './amountTokens';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { objectKeysWithType } from '~utils/objectKeysWithType';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { Text } from '~components/Typography';\nimport { opacity } from '~tokens/global';\nimport type { FontFamily } from '~tokens/global';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\n/**\n * Pollyfill function to get around the node 18 error\n *\n * This function is maintained by i18nify team. Reach out to them for any change regarding this.\n */\nconst stripTrailingZerosFromParts = (\n parts: ReturnType<typeof formatNumberByParts>,\n): ReturnType<typeof formatNumberByParts> => {\n const decimalPart = parts.rawParts\n .filter(({ type }) => type === 'fraction')\n .map(({ value }) => value)\n .join('');\n\n const hasFraction = parts.rawParts.some(({ type }) => type === 'fraction');\n\n if (hasFraction && /^0+$/.test(decimalPart)) {\n delete parts.decimal;\n delete parts.fraction;\n parts.rawParts = parts.rawParts.filter(({ type }) => type !== 'decimal' && type !== 'fraction');\n }\n\n return parts;\n};\n\n/**\n * Wrapper that uses pollyfill of i18nify team\n */\nconst pollyfilledFormatNumberByParts: typeof formatNumberByParts = (value, options) => {\n const parts = formatNumberByParts(value, options);\n\n if (options?.intlOptions?.trailingZeroDisplay === 'stripIfInteger') {\n return stripTrailingZerosFromParts(parts);\n }\n\n return parts;\n};\n\ntype AmountCommonProps = {\n /**\n * The value to be rendered within the component.\n *\n */\n value: number;\n /**\n * Sets the color of the amount.\n *\n * @default undefined\n */\n color?: BaseTextProps['color'];\n /**\n * Indicates what the suffix of amount should be\n *\n * @default 'decimals'\n */\n suffix?: 'decimals' | 'none' | 'humanize';\n /**\n * Makes the currency indicator(currency symbol/code) and decimal digits small and faded\n *\n * @default true\n */\n isAffixSubtle?: true | false;\n /**\n * Determines the visual representation of the currency, choose between displaying the currency symbol or code.\n *\n * Note: Currency symbol and code is determined by the locale set in user's browser or set via @razorpay/i18nify-react library.\n *\n * @default 'currency-symbol'\n */\n currencyIndicator?: 'currency-symbol' | 'currency-code';\n /**\n * The currency of the amount. Note that this component\n * only displays the provided value in the specified currency, it does not perform any currency conversion.\n *\n * @default 'INR'\n * */\n currency?: CurrencyCodeType;\n /**\n * If true, the amount text will have a line through it.\n *\n * @default false\n */\n isStrikethrough?: boolean;\n /**\n * Controls the number of decimal places to display when suffix is 'decimals'.\n *\n * @default 2\n */\n fractionDigits?: number;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\ntype ColorProps = {\n amountValueColor: BaseTextProps['color'];\n};\n\ntype AmountProps = AmountTypeProps & AmountCommonProps;\n\nconst getTextColorProps = ({ color }: { color: AmountProps['color'] }): ColorProps => {\n const props: ColorProps = {\n amountValueColor: 'surface.text.gray.normal',\n };\n if (!color) return props;\n props.amountValueColor = color;\n return props;\n};\n\ntype AmountType = Partial<ReturnType<typeof formatNumberByParts>>;\n\ninterface AmountValue extends Omit<AmountProps, 'value'> {\n amountValueColor: BaseTextProps['color'];\n amount: AmountType;\n size: Exclude<AmountProps['size'], undefined>;\n}\n\nconst AmountValue = ({\n amount,\n size = 'medium',\n type = 'body',\n weight = 'regular',\n amountValueColor,\n isAffixSubtle,\n suffix,\n}: AmountValue): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n const affixFontSize = isAffixSubtle ? subtleFontSizes[type][size] : normalAmountSizes[type][size];\n const numberFontFamily: keyof FontFamily = type === 'body' ? 'text' : 'heading';\n if (suffix === 'decimals' && isAffixSubtle) {\n // Native does not support alignItems of Text inside a div, instead we need to wrap is in a Text\n const AmountWrapper = isReactNative ? Text : React.Fragment;\n\n return (\n <AmountWrapper>\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n fontFamily={numberFontFamily}\n as={isReactNative ? undefined : 'span'}\n >\n {amount.integer}\n </BaseText>\n <BaseText\n fontWeight={weight}\n fontSize={affixFontSize}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[800] : 1}\n >\n {amount.decimal}\n {amount.fraction}\n </BaseText>\n </AmountWrapper>\n );\n }\n\n return (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n lineHeight={amountLineHeights[type][size]}\n >\n {amount.integer}\n {amount.decimal}\n {amount.fraction}\n {amount.compact}\n </BaseText>\n );\n};\n\ntype FormatAmountWithSuffixType = {\n suffix: AmountProps['suffix'];\n value: number;\n currency: AmountProps['currency'];\n fractionDigits?: number;\n};\n\n/**\n * Returns a parsed object based on the suffix passed in parameters\n * === Logic ===\n * value = 12500.45 \n * if suffix === 'decimals' => {\n \"integer\": \"12,500\",\n \"decimal\": \".\",\n \"fraction\": \"45\",\n \"compact\": \"K\",\n \"isPrefixSymbol\": false,\n \"rawParts\": [{\"type\": \"integer\",\"value\": \"12\"},{\"type\": \"group\",\"value\": \",\"},{\"type\": \"integer\",\"value\": \"500\"},{\"type\": \"decimal\",\"value\": \".\"},{\"type\": \"fraction\",\"value\": \"45\"}]\n}\n * @returns {AmountType}\n */\nexport const getAmountByParts = ({\n suffix,\n value,\n currency,\n fractionDigits = 2,\n}: FormatAmountWithSuffixType): AmountType => {\n try {\n switch (suffix) {\n case 'decimals': {\n const options = {\n intlOptions: {\n maximumFractionDigits: fractionDigits,\n minimumFractionDigits: fractionDigits,\n },\n currency,\n } as const;\n return pollyfilledFormatNumberByParts(value, options);\n }\n case 'humanize': {\n const options = {\n intlOptions: {\n notation: 'compact',\n maximumFractionDigits: 2,\n trailingZeroDisplay: 'stripIfInteger',\n },\n currency,\n } as const;\n return pollyfilledFormatNumberByParts(value, options);\n }\n\n default: {\n const options = {\n intlOptions: {\n maximumFractionDigits: 0,\n roundingMode: 'floor',\n },\n currency,\n } as const;\n return pollyfilledFormatNumberByParts(value, options);\n }\n }\n } catch (err: unknown) {\n return {\n integer: `${value}`,\n currency,\n };\n }\n};\n\nconst _Amount = (\n {\n value,\n suffix = 'decimals',\n type = 'body',\n size = 'medium',\n weight = 'regular',\n isAffixSubtle = true,\n isStrikethrough = false,\n color,\n currencyIndicator = 'currency-symbol',\n currency = 'INR',\n fractionDigits = 2,\n testID,\n ...rest\n }: AmountProps,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n if (__DEV__) {\n if (typeof value !== 'number') {\n throwBladeError({\n message: '`value` prop must be of type `number` for Amount.',\n moduleName: 'Amount',\n });\n }\n // @ts-expect-error neutral color should throw error\n if (color === 'neutral') {\n throwBladeError({\n message: '`neutral` color is not supported.',\n moduleName: 'Amount',\n });\n }\n\n const bodySizes = objectKeysWithType(normalAmountSizes.body);\n if ((type === 'body' || !type) && !bodySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"body\"`,\n moduleName: 'Amount',\n });\n }\n\n const displaySizes = objectKeysWithType(normalAmountSizes.display);\n if (type === 'display' && !displaySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"display\"`,\n moduleName: 'Amount',\n });\n }\n\n const headingSizes = objectKeysWithType(normalAmountSizes.heading);\n if (type === 'heading' && !headingSizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"heading\"`,\n moduleName: 'Amount',\n });\n }\n }\n\n const { amountValueColor } = getTextColorProps({\n color,\n });\n\n const renderedValue = getAmountByParts({ suffix, value, currency, fractionDigits });\n const isPrefixSymbol = renderedValue.isPrefixSymbol ?? true;\n const currencySymbol = renderedValue.currency ?? currency;\n\n const currencyPosition = isPrefixSymbol ? 'left' : 'right';\n const currencySymbolOrCode = currencyIndicator === 'currency-symbol' ? currencySymbol : currency;\n\n const currencyFontSize = isAffixSubtle\n ? subtleFontSizes[type][size]\n : normalAmountSizes[type][size];\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox\n ref={ref as never}\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n flexDirection=\"row\"\n {...metaAttribute({ name: MetaConstants.Amount, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n alignItems=\"baseline\"\n flexDirection=\"row\"\n position=\"relative\"\n >\n {renderedValue.minusSign ? (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n marginX=\"spacing.2\"\n >\n {renderedValue.minusSign}\n </BaseText>\n ) : null}\n {currencyPosition === 'left' && (\n <BaseText\n marginRight=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[800] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n <AmountValue\n amount={renderedValue}\n amountValueColor={amountValueColor}\n type={type}\n weight={weight}\n size={size}\n isAffixSubtle={isAffixSubtle}\n suffix={suffix}\n currency={currency}\n />\n {currencyPosition === 'right' && (\n <BaseText\n marginLeft=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[800] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n {isStrikethrough && (\n // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: the borderBottomColor error below is thrown here as well\n <BaseBox\n // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore- intentionally setting the border color to the color prop for this hacky strikethrough\n borderBottomColor={amountValueColor}\n borderBottomWidth={type === 'body' ? 'thin' : 'thicker'}\n borderBottomStyle=\"solid\"\n position=\"absolute\"\n width=\"100%\"\n top=\"50%\"\n />\n )}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Amount = assignWithoutSideEffects(React.forwardRef(_Amount), {\n displayName: 'Amount',\n componentId: 'Amount',\n});\n\nexport type { AmountProps };\nexport { Amount };\n"],"names":["stripTrailingZerosFromParts","parts","decimalPart","rawParts","filter","_ref","type","map","_ref2","value","join","hasFraction","some","_ref3","test","decimal","fraction","_ref4","pollyfilledFormatNumberByParts","options","_options$intlOptions","formatNumberByParts","intlOptions","trailingZeroDisplay","getTextColorProps","_ref5","color","props","amountValueColor","AmountValue","_ref6","amount","_ref6$size","size","_ref6$type","_ref6$weight","weight","isAffixSubtle","suffix","isReactNative","getPlatformType","affixFontSize","subtleFontSizes","normalAmountSizes","numberFontFamily","AmountWrapper","Text","React","Fragment","_jsxs","children","_jsx","BaseText","fontSize","fontWeight","lineHeight","amountLineHeights","fontFamily","as","undefined","integer","opacity","compact","getAmountByParts","_ref7","currency","_ref7$fractionDigits","fractionDigits","maximumFractionDigits","minimumFractionDigits","notation","roundingMode","err","_Amount","_ref8","ref","_renderedValue$isPref","_renderedValue$curren","_ref8$suffix","_ref8$type","_ref8$size","_ref8$weight","_ref8$isAffixSubtle","_ref8$isStrikethrough","isStrikethrough","_ref8$currencyIndicat","currencyIndicator","_ref8$currency","_ref8$fractionDigits","testID","rest","_objectWithoutProperties","_excluded","__DEV__","throwBladeError","message","moduleName","bodySizes","objectKeysWithType","body","includes","displaySizes","display","headingSizes","heading","_getTextColorProps","renderedValue","isPrefixSymbol","currencySymbol","currencyPosition","currencySymbolOrCode","currencyFontSize","BaseBox","Object","assign","flexDirection","metaAttribute","name","MetaConstants","Amount","getStyledProps","makeAnalyticsAttribute","alignItems","position","minusSign","marginX","marginRight","marginLeft","borderBottomColor","borderBottomWidth","borderBottomStyle","width","top","assignWithoutSideEffects","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;2JA2BA,IAAMA,2BAA2B,CAAG,SAA9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