@razorpay/blade 11.36.2 → 11.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (560) hide show
  1. package/build/lib/native/components/Accordion/Accordion.js +2 -1
  2. package/build/lib/native/components/Accordion/Accordion.js.map +1 -1
  3. package/build/lib/native/components/Accordion/AccordionItem.js +3 -1
  4. package/build/lib/native/components/Accordion/AccordionItem.js.map +1 -1
  5. package/build/lib/native/components/Accordion/AccordionItemBody.js +3 -2
  6. package/build/lib/native/components/Accordion/AccordionItemBody.js.map +1 -1
  7. package/build/lib/native/components/Accordion/AccordionItemHeader.js +3 -2
  8. package/build/lib/native/components/Accordion/AccordionItemHeader.js.map +1 -1
  9. package/build/lib/native/components/ActionList/ActionList.js +3 -1
  10. package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
  11. package/build/lib/native/components/ActionList/ActionListItem.js +3 -2
  12. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  13. package/build/lib/native/components/Alert/Alert.js +2 -1
  14. package/build/lib/native/components/Alert/Alert.js.map +1 -1
  15. package/build/lib/native/components/Amount/Amount.js +2 -1
  16. package/build/lib/native/components/Amount/Amount.js.map +1 -1
  17. package/build/lib/native/components/Badge/Badge.js +2 -1
  18. package/build/lib/native/components/Badge/Badge.js.map +1 -1
  19. package/build/lib/native/components/BaseHeaderFooter/BaseFooter.js +3 -1
  20. package/build/lib/native/components/BaseHeaderFooter/BaseFooter.js.map +1 -1
  21. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +3 -2
  22. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  23. package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  24. package/build/lib/native/components/Box/Box.js +2 -1
  25. package/build/lib/native/components/Box/Box.js.map +1 -1
  26. package/build/lib/native/components/Button/BaseButton/BaseButton.js +2 -1
  27. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  28. package/build/lib/native/components/Button/Button/Button.js +2 -1
  29. package/build/lib/native/components/Button/Button/Button.js.map +1 -1
  30. package/build/lib/native/components/Button/IconButton/IconButton.js +3 -1
  31. package/build/lib/native/components/Button/IconButton/IconButton.js.map +1 -1
  32. package/build/lib/native/components/Card/Card.js +2 -1
  33. package/build/lib/native/components/Card/Card.js.map +1 -1
  34. package/build/lib/native/components/Card/CardFooter.js +3 -2
  35. package/build/lib/native/components/Card/CardFooter.js.map +1 -1
  36. package/build/lib/native/components/Card/CardHeader.js +3 -2
  37. package/build/lib/native/components/Card/CardHeader.js.map +1 -1
  38. package/build/lib/native/components/Checkbox/Checkbox.js +3 -2
  39. package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
  40. package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -1
  41. package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  42. package/build/lib/native/components/Chip/Chip.js +2 -1
  43. package/build/lib/native/components/Chip/Chip.js.map +1 -1
  44. package/build/lib/native/components/Chip/ChipGroup.js +2 -1
  45. package/build/lib/native/components/Chip/ChipGroup.js.map +1 -1
  46. package/build/lib/native/components/Collapsible/Collapsible.js +2 -1
  47. package/build/lib/native/components/Collapsible/Collapsible.js.map +1 -1
  48. package/build/lib/native/components/Collapsible/CollapsibleBody.js +3 -1
  49. package/build/lib/native/components/Collapsible/CollapsibleBody.js.map +1 -1
  50. package/build/lib/native/components/Collapsible/CollapsibleButton.js +3 -1
  51. package/build/lib/native/components/Collapsible/CollapsibleButton.js.map +1 -1
  52. package/build/lib/native/components/Collapsible/CollapsibleLink.js +2 -1
  53. package/build/lib/native/components/Collapsible/CollapsibleLink.js.map +1 -1
  54. package/build/lib/native/components/Counter/Counter.js +2 -1
  55. package/build/lib/native/components/Counter/Counter.js.map +1 -1
  56. package/build/lib/native/components/Dropdown/Dropdown.js +2 -1
  57. package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
  58. package/build/lib/native/components/Dropdown/DropdownButton.js +1 -1
  59. package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
  60. package/build/lib/native/components/Dropdown/DropdownHeaderFooter.js +3 -1
  61. package/build/lib/native/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  62. package/build/lib/native/components/Dropdown/DropdownLink.js +2 -1
  63. package/build/lib/native/components/Dropdown/DropdownLink.js.map +1 -1
  64. package/build/lib/native/components/Form/Selector/SelectorGroupField.js +3 -1
  65. package/build/lib/native/components/Form/Selector/SelectorGroupField.js.map +1 -1
  66. package/build/lib/native/components/Icons/IndiaFlagIcon/IndiaFlagIcon.js +12 -0
  67. package/build/lib/native/components/Icons/IndiaFlagIcon/IndiaFlagIcon.js.map +1 -0
  68. package/build/lib/native/components/Icons/MagicKonnectIcon/MagicKonnectIcon.js +12 -0
  69. package/build/lib/native/components/Icons/MagicKonnectIcon/MagicKonnectIcon.js.map +1 -0
  70. package/build/lib/native/components/Icons/WorldwideIcon/WorldwideIcon.js +12 -0
  71. package/build/lib/native/components/Icons/WorldwideIcon/WorldwideIcon.js.map +1 -0
  72. package/build/lib/native/components/Indicator/Indicator.js +2 -1
  73. package/build/lib/native/components/Indicator/Indicator.js.map +1 -1
  74. package/build/lib/native/components/Input/BaseInput/BaseInput.js +2 -1
  75. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  76. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +2 -1
  77. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  78. package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js +2 -1
  79. package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
  80. package/build/lib/native/components/Input/OTPInput/OTPInput.js +2 -1
  81. package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
  82. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +1 -1
  83. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  84. package/build/lib/native/components/Input/SearchInput/SearchInput.js +1 -1
  85. package/build/lib/native/components/Input/SearchInput/SearchInput.js.map +1 -1
  86. package/build/lib/native/components/Input/TextArea/TextArea.js +1 -1
  87. package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
  88. package/build/lib/native/components/Input/TextInput/TextInput.js +1 -1
  89. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  90. package/build/lib/native/components/Link/BaseLink/BaseLink.js +2 -1
  91. package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
  92. package/build/lib/native/components/Link/Link/Link.js +2 -1
  93. package/build/lib/native/components/Link/Link/Link.js.map +1 -1
  94. package/build/lib/native/components/ProgressBar/ProgressBar.js +2 -1
  95. package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
  96. package/build/lib/native/components/Radio/Radio.js +2 -1
  97. package/build/lib/native/components/Radio/Radio.js.map +1 -1
  98. package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js +2 -1
  99. package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  100. package/build/lib/native/components/StepGroup/tokens.js +1 -1
  101. package/build/lib/native/components/StepGroup/tokens.js.map +1 -1
  102. package/build/lib/native/components/Switch/Switch.js +2 -1
  103. package/build/lib/native/components/Switch/Switch.js.map +1 -1
  104. package/build/lib/native/components/Tag/Tag.js +2 -1
  105. package/build/lib/native/components/Tag/Tag.js.map +1 -1
  106. package/build/lib/native/components/index.js +3 -0
  107. package/build/lib/native/components/index.js.map +1 -1
  108. package/build/lib/native/tokens/global/size.js +1 -1
  109. package/build/lib/native/tokens/global/size.js.map +1 -1
  110. package/build/lib/native/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js +7 -0
  111. package/build/lib/native/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js.map +1 -0
  112. package/build/lib/web/development/components/Accordion/Accordion.js +5 -3
  113. package/build/lib/web/development/components/Accordion/Accordion.js.map +1 -1
  114. package/build/lib/web/development/components/Accordion/AccordionButton.web.js +8 -3
  115. package/build/lib/web/development/components/Accordion/AccordionButton.web.js.map +1 -1
  116. package/build/lib/web/development/components/Accordion/AccordionItem.js +8 -3
  117. package/build/lib/web/development/components/Accordion/AccordionItem.js.map +1 -1
  118. package/build/lib/web/development/components/Accordion/AccordionItemBody.js +8 -3
  119. package/build/lib/web/development/components/Accordion/AccordionItemBody.js.map +1 -1
  120. package/build/lib/web/development/components/Accordion/AccordionItemHeader.js +10 -4
  121. package/build/lib/web/development/components/Accordion/AccordionItemHeader.js.map +1 -1
  122. package/build/lib/web/development/components/ActionList/ActionList.js +9 -4
  123. package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
  124. package/build/lib/web/development/components/ActionList/ActionListBox.web.js +8 -3
  125. package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
  126. package/build/lib/web/development/components/ActionList/ActionListItem.js +10 -5
  127. package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
  128. package/build/lib/web/development/components/Alert/Alert.js +5 -3
  129. package/build/lib/web/development/components/Alert/Alert.js.map +1 -1
  130. package/build/lib/web/development/components/Amount/Amount.js +5 -8
  131. package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
  132. package/build/lib/web/development/components/Avatar/Avatar.web.js +5 -3
  133. package/build/lib/web/development/components/Avatar/Avatar.web.js.map +1 -1
  134. package/build/lib/web/development/components/Avatar/AvatarGroup.web.js +5 -3
  135. package/build/lib/web/development/components/Avatar/AvatarGroup.web.js.map +1 -1
  136. package/build/lib/web/development/components/Badge/Badge.js +5 -3
  137. package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
  138. package/build/lib/web/development/components/BaseHeaderFooter/BaseFooter.js +8 -3
  139. package/build/lib/web/development/components/BaseHeaderFooter/BaseFooter.js.map +1 -1
  140. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +8 -3
  141. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  142. package/build/lib/web/development/components/BottomNav/BottomNav.web.js +12 -8
  143. package/build/lib/web/development/components/BottomNav/BottomNav.web.js.map +1 -1
  144. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +9 -3
  145. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  146. package/build/lib/web/development/components/BottomSheet/BottomSheetBody.web.js +8 -3
  147. package/build/lib/web/development/components/BottomSheet/BottomSheetBody.web.js.map +1 -1
  148. package/build/lib/web/development/components/BottomSheet/BottomSheetFooter.web.js +8 -3
  149. package/build/lib/web/development/components/BottomSheet/BottomSheetFooter.web.js.map +1 -1
  150. package/build/lib/web/development/components/BottomSheet/BottomSheetHeader.web.js +8 -3
  151. package/build/lib/web/development/components/BottomSheet/BottomSheetHeader.web.js.map +1 -1
  152. package/build/lib/web/development/components/Box/BaseBox/BaseBox.web.js +4 -2
  153. package/build/lib/web/development/components/Box/BaseBox/BaseBox.web.js.map +1 -1
  154. package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  155. package/build/lib/web/development/components/Box/Box.js +4 -2
  156. package/build/lib/web/development/components/Box/Box.js.map +1 -1
  157. package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js +6 -4
  158. package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js.map +1 -1
  159. package/build/lib/web/development/components/Breadcrumb/BreadcrumbItem.web.js +13 -4
  160. package/build/lib/web/development/components/Breadcrumb/BreadcrumbItem.web.js.map +1 -1
  161. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +4 -2
  162. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  163. package/build/lib/web/development/components/Button/Button/Button.js +4 -2
  164. package/build/lib/web/development/components/Button/Button/Button.js.map +1 -1
  165. package/build/lib/web/development/components/Button/IconButton/IconButton.js +11 -5
  166. package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
  167. package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js +8 -3
  168. package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
  169. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +5 -3
  170. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  171. package/build/lib/web/development/components/Card/Card.js +11 -7
  172. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  173. package/build/lib/web/development/components/Card/CardFooter.js +22 -11
  174. package/build/lib/web/development/components/Card/CardFooter.js.map +1 -1
  175. package/build/lib/web/development/components/Card/CardHeader.js +13 -6
  176. package/build/lib/web/development/components/Card/CardHeader.js.map +1 -1
  177. package/build/lib/web/development/components/Carousel/Carousel.web.js +5 -3
  178. package/build/lib/web/development/components/Carousel/Carousel.web.js.map +1 -1
  179. package/build/lib/web/development/components/Carousel/CarouselItem.web.js +9 -3
  180. package/build/lib/web/development/components/Carousel/CarouselItem.web.js.map +1 -1
  181. package/build/lib/web/development/components/Checkbox/Checkbox.js +6 -4
  182. package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
  183. package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js +8 -5
  184. package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  185. package/build/lib/web/development/components/Chip/Chip.js +5 -3
  186. package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
  187. package/build/lib/web/development/components/Chip/ChipGroup.js +8 -5
  188. package/build/lib/web/development/components/Chip/ChipGroup.js.map +1 -1
  189. package/build/lib/web/development/components/Collapsible/Collapsible.js +5 -3
  190. package/build/lib/web/development/components/Collapsible/Collapsible.js.map +1 -1
  191. package/build/lib/web/development/components/Collapsible/CollapsibleBody.js +8 -3
  192. package/build/lib/web/development/components/Collapsible/CollapsibleBody.js.map +1 -1
  193. package/build/lib/web/development/components/Collapsible/CollapsibleButton.js +13 -4
  194. package/build/lib/web/development/components/Collapsible/CollapsibleButton.js.map +1 -1
  195. package/build/lib/web/development/components/Collapsible/CollapsibleLink.js +5 -3
  196. package/build/lib/web/development/components/Collapsible/CollapsibleLink.js.map +1 -1
  197. package/build/lib/web/development/components/Counter/Counter.js +5 -3
  198. package/build/lib/web/development/components/Counter/Counter.js.map +1 -1
  199. package/build/lib/web/development/components/DatePicker/DateInput.web.js +11 -7
  200. package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
  201. package/build/lib/web/development/components/DatePicker/DatePicker.web.js +4 -2
  202. package/build/lib/web/development/components/DatePicker/DatePicker.web.js.map +1 -1
  203. package/build/lib/web/development/components/Drawer/Drawer.web.js +8 -3
  204. package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
  205. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js +11 -3
  206. package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  207. package/build/lib/web/development/components/Dropdown/Dropdown.js +5 -3
  208. package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
  209. package/build/lib/web/development/components/Dropdown/DropdownButton.js +2 -2
  210. package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
  211. package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js +8 -3
  212. package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  213. package/build/lib/web/development/components/Dropdown/DropdownLink.js +5 -3
  214. package/build/lib/web/development/components/Dropdown/DropdownLink.js.map +1 -1
  215. package/build/lib/web/development/components/FileUpload/FileUpload.web.js +6 -4
  216. package/build/lib/web/development/components/FileUpload/FileUpload.web.js.map +1 -1
  217. package/build/lib/web/development/components/Form/Selector/SelectorGroupField.js +8 -3
  218. package/build/lib/web/development/components/Form/Selector/SelectorGroupField.js.map +1 -1
  219. package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +8 -3
  220. package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
  221. package/build/lib/web/development/components/Icons/IndiaFlagIcon/IndiaFlagIcon.js +39 -0
  222. package/build/lib/web/development/components/Icons/IndiaFlagIcon/IndiaFlagIcon.js.map +1 -0
  223. package/build/lib/web/development/components/Icons/IndiaFlagIcon/index.js +2 -0
  224. package/build/lib/web/development/components/Icons/IndiaFlagIcon/index.js.map +1 -0
  225. package/build/lib/web/development/components/Icons/MagicKonnectIcon/MagicKonnectIcon.js +49 -0
  226. package/build/lib/web/development/components/Icons/MagicKonnectIcon/MagicKonnectIcon.js.map +1 -0
  227. package/build/lib/web/development/components/Icons/MagicKonnectIcon/index.js +2 -0
  228. package/build/lib/web/development/components/Icons/MagicKonnectIcon/index.js.map +1 -0
  229. package/build/lib/web/development/components/Icons/WorldwideIcon/WorldwideIcon.js +39 -0
  230. package/build/lib/web/development/components/Icons/WorldwideIcon/WorldwideIcon.js.map +1 -0
  231. package/build/lib/web/development/components/Icons/WorldwideIcon/index.js +2 -0
  232. package/build/lib/web/development/components/Icons/WorldwideIcon/index.js.map +1 -0
  233. package/build/lib/web/development/components/Icons/index.js +3 -0
  234. package/build/lib/web/development/components/Icons/index.js.map +1 -1
  235. package/build/lib/web/development/components/Indicator/Indicator.js +5 -3
  236. package/build/lib/web/development/components/Indicator/Indicator.js.map +1 -1
  237. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +6 -4
  238. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  239. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +5 -2
  240. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  241. package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js +5 -3
  242. package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
  243. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +6 -4
  244. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
  245. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +2 -2
  246. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  247. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +2 -2
  248. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
  249. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +2 -2
  250. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
  251. package/build/lib/web/development/components/Input/TextArea/TextArea.js +2 -2
  252. package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
  253. package/build/lib/web/development/components/Input/TextInput/TextInput.js +2 -2
  254. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  255. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +5 -3
  256. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
  257. package/build/lib/web/development/components/Link/Link/Link.js +4 -2
  258. package/build/lib/web/development/components/Link/Link/Link.js.map +1 -1
  259. package/build/lib/web/development/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js +18 -8
  260. package/build/lib/web/development/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js.map +1 -1
  261. package/build/lib/web/development/components/Modal/Modal.web.js +10 -4
  262. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  263. package/build/lib/web/development/components/Modal/ModalBody.web.js +9 -3
  264. package/build/lib/web/development/components/Modal/ModalBody.web.js.map +1 -1
  265. package/build/lib/web/development/components/Modal/ModalFooter.web.js +7 -2
  266. package/build/lib/web/development/components/Modal/ModalFooter.web.js.map +1 -1
  267. package/build/lib/web/development/components/Modal/ModalHeader.web.js +14 -6
  268. package/build/lib/web/development/components/Modal/ModalHeader.web.js.map +1 -1
  269. package/build/lib/web/development/components/Popover/Popover.web.js +8 -3
  270. package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
  271. package/build/lib/web/development/components/Popover/PopoverInteractiveWrapper.web.js.map +1 -1
  272. package/build/lib/web/development/components/ProgressBar/ProgressBar.js +5 -3
  273. package/build/lib/web/development/components/ProgressBar/ProgressBar.js.map +1 -1
  274. package/build/lib/web/development/components/Radio/Radio.js +6 -4
  275. package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
  276. package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js +8 -5
  277. package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  278. package/build/lib/web/development/components/SideNav/SideNav.web.js +5 -3
  279. package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
  280. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavItem.web.js +13 -4
  281. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavItem.web.js.map +1 -1
  282. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js +10 -4
  283. package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  284. package/build/lib/web/development/components/SideNav/SideNavSection.web.js +10 -4
  285. package/build/lib/web/development/components/SideNav/SideNavSection.web.js.map +1 -1
  286. package/build/lib/web/development/components/StepGroup/StepGroup.web.js +5 -3
  287. package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
  288. package/build/lib/web/development/components/StepGroup/StepItem.web.js +13 -7
  289. package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
  290. package/build/lib/web/development/components/StepGroup/StepLine.web.js +79 -42
  291. package/build/lib/web/development/components/StepGroup/StepLine.web.js.map +1 -1
  292. package/build/lib/web/development/components/StepGroup/tokens.js +6 -6
  293. package/build/lib/web/development/components/StepGroup/tokens.js.map +1 -1
  294. package/build/lib/web/development/components/Switch/Switch.js +5 -3
  295. package/build/lib/web/development/components/Switch/Switch.js.map +1 -1
  296. package/build/lib/web/development/components/Table/Table.web.js +9 -7
  297. package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
  298. package/build/lib/web/development/components/Table/TableBody.web.js +18 -9
  299. package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
  300. package/build/lib/web/development/components/Table/TableFooter.web.js +18 -9
  301. package/build/lib/web/development/components/Table/TableFooter.web.js.map +1 -1
  302. package/build/lib/web/development/components/Table/TableHeader.web.js +18 -9
  303. package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
  304. package/build/lib/web/development/components/Table/TablePagination.web.js +10 -4
  305. package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
  306. package/build/lib/web/development/components/Table/TableToolbar.web.js +13 -8
  307. package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
  308. package/build/lib/web/development/components/Tabs/TabItem.web.js +9 -5
  309. package/build/lib/web/development/components/Tabs/TabItem.web.js.map +1 -1
  310. package/build/lib/web/development/components/Tabs/TabList.web.js +5 -3
  311. package/build/lib/web/development/components/Tabs/TabList.web.js.map +1 -1
  312. package/build/lib/web/development/components/Tabs/TabPanel.web.js +10 -5
  313. package/build/lib/web/development/components/Tabs/TabPanel.web.js.map +1 -1
  314. package/build/lib/web/development/components/Tabs/Tabs.web.js +8 -3
  315. package/build/lib/web/development/components/Tabs/Tabs.web.js.map +1 -1
  316. package/build/lib/web/development/components/Tag/Tag.js +6 -4
  317. package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
  318. package/build/lib/web/development/components/Toast/ToastContainer.web.js +8 -3
  319. package/build/lib/web/development/components/Toast/ToastContainer.web.js.map +1 -1
  320. package/build/lib/web/development/components/Tooltip/Tooltip.web.js +8 -3
  321. package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
  322. package/build/lib/web/development/components/TopNav/TabNav/TabNav.web.js +6 -3
  323. package/build/lib/web/development/components/TopNav/TabNav/TabNav.web.js.map +1 -1
  324. package/build/lib/web/development/components/TopNav/TopNav.web.js +8 -5
  325. package/build/lib/web/development/components/TopNav/TopNav.web.js.map +1 -1
  326. package/build/lib/web/development/components/index.js +3 -0
  327. package/build/lib/web/development/components/index.js.map +1 -1
  328. package/build/lib/web/development/tokens/global/size.js +3 -1
  329. package/build/lib/web/development/tokens/global/size.js.map +1 -1
  330. package/build/lib/web/development/utils/makeAnalyticsAttribute/index.js +2 -0
  331. package/build/lib/web/development/utils/makeAnalyticsAttribute/index.js.map +1 -0
  332. package/build/lib/web/development/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js +20 -0
  333. package/build/lib/web/development/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js.map +1 -0
  334. package/build/lib/web/production/components/Accordion/Accordion.js +5 -3
  335. package/build/lib/web/production/components/Accordion/Accordion.js.map +1 -1
  336. package/build/lib/web/production/components/Accordion/AccordionButton.web.js +8 -3
  337. package/build/lib/web/production/components/Accordion/AccordionButton.web.js.map +1 -1
  338. package/build/lib/web/production/components/Accordion/AccordionItem.js +8 -3
  339. package/build/lib/web/production/components/Accordion/AccordionItem.js.map +1 -1
  340. package/build/lib/web/production/components/Accordion/AccordionItemBody.js +8 -3
  341. package/build/lib/web/production/components/Accordion/AccordionItemBody.js.map +1 -1
  342. package/build/lib/web/production/components/Accordion/AccordionItemHeader.js +10 -4
  343. package/build/lib/web/production/components/Accordion/AccordionItemHeader.js.map +1 -1
  344. package/build/lib/web/production/components/ActionList/ActionList.js +9 -4
  345. package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
  346. package/build/lib/web/production/components/ActionList/ActionListBox.web.js +8 -3
  347. package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
  348. package/build/lib/web/production/components/ActionList/ActionListItem.js +10 -5
  349. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  350. package/build/lib/web/production/components/Alert/Alert.js +5 -3
  351. package/build/lib/web/production/components/Alert/Alert.js.map +1 -1
  352. package/build/lib/web/production/components/Amount/Amount.js +5 -8
  353. package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
  354. package/build/lib/web/production/components/Avatar/Avatar.web.js +5 -3
  355. package/build/lib/web/production/components/Avatar/Avatar.web.js.map +1 -1
  356. package/build/lib/web/production/components/Avatar/AvatarGroup.web.js +5 -3
  357. package/build/lib/web/production/components/Avatar/AvatarGroup.web.js.map +1 -1
  358. package/build/lib/web/production/components/Badge/Badge.js +5 -3
  359. package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
  360. package/build/lib/web/production/components/BaseHeaderFooter/BaseFooter.js +8 -3
  361. package/build/lib/web/production/components/BaseHeaderFooter/BaseFooter.js.map +1 -1
  362. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +8 -3
  363. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  364. package/build/lib/web/production/components/BottomNav/BottomNav.web.js +12 -8
  365. package/build/lib/web/production/components/BottomNav/BottomNav.web.js.map +1 -1
  366. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +9 -3
  367. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  368. package/build/lib/web/production/components/BottomSheet/BottomSheetBody.web.js +8 -3
  369. package/build/lib/web/production/components/BottomSheet/BottomSheetBody.web.js.map +1 -1
  370. package/build/lib/web/production/components/BottomSheet/BottomSheetFooter.web.js +8 -3
  371. package/build/lib/web/production/components/BottomSheet/BottomSheetFooter.web.js.map +1 -1
  372. package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js +8 -3
  373. package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js.map +1 -1
  374. package/build/lib/web/production/components/Box/BaseBox/BaseBox.web.js +4 -2
  375. package/build/lib/web/production/components/Box/BaseBox/BaseBox.web.js.map +1 -1
  376. package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  377. package/build/lib/web/production/components/Box/Box.js +4 -2
  378. package/build/lib/web/production/components/Box/Box.js.map +1 -1
  379. package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js +6 -4
  380. package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js.map +1 -1
  381. package/build/lib/web/production/components/Breadcrumb/BreadcrumbItem.web.js +13 -4
  382. package/build/lib/web/production/components/Breadcrumb/BreadcrumbItem.web.js.map +1 -1
  383. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +4 -2
  384. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  385. package/build/lib/web/production/components/Button/Button/Button.js +4 -2
  386. package/build/lib/web/production/components/Button/Button/Button.js.map +1 -1
  387. package/build/lib/web/production/components/Button/IconButton/IconButton.js +11 -5
  388. package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
  389. package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js +8 -3
  390. package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
  391. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +5 -3
  392. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  393. package/build/lib/web/production/components/Card/Card.js +11 -7
  394. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  395. package/build/lib/web/production/components/Card/CardFooter.js +22 -11
  396. package/build/lib/web/production/components/Card/CardFooter.js.map +1 -1
  397. package/build/lib/web/production/components/Card/CardHeader.js +13 -6
  398. package/build/lib/web/production/components/Card/CardHeader.js.map +1 -1
  399. package/build/lib/web/production/components/Carousel/Carousel.web.js +5 -3
  400. package/build/lib/web/production/components/Carousel/Carousel.web.js.map +1 -1
  401. package/build/lib/web/production/components/Carousel/CarouselItem.web.js +9 -3
  402. package/build/lib/web/production/components/Carousel/CarouselItem.web.js.map +1 -1
  403. package/build/lib/web/production/components/Checkbox/Checkbox.js +6 -4
  404. package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
  405. package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js +8 -5
  406. package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  407. package/build/lib/web/production/components/Chip/Chip.js +5 -3
  408. package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
  409. package/build/lib/web/production/components/Chip/ChipGroup.js +8 -5
  410. package/build/lib/web/production/components/Chip/ChipGroup.js.map +1 -1
  411. package/build/lib/web/production/components/Collapsible/Collapsible.js +5 -3
  412. package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
  413. package/build/lib/web/production/components/Collapsible/CollapsibleBody.js +8 -3
  414. package/build/lib/web/production/components/Collapsible/CollapsibleBody.js.map +1 -1
  415. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js +13 -4
  416. package/build/lib/web/production/components/Collapsible/CollapsibleButton.js.map +1 -1
  417. package/build/lib/web/production/components/Collapsible/CollapsibleLink.js +5 -3
  418. package/build/lib/web/production/components/Collapsible/CollapsibleLink.js.map +1 -1
  419. package/build/lib/web/production/components/Counter/Counter.js +5 -3
  420. package/build/lib/web/production/components/Counter/Counter.js.map +1 -1
  421. package/build/lib/web/production/components/DatePicker/DateInput.web.js +11 -7
  422. package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
  423. package/build/lib/web/production/components/DatePicker/DatePicker.web.js +4 -2
  424. package/build/lib/web/production/components/DatePicker/DatePicker.web.js.map +1 -1
  425. package/build/lib/web/production/components/Drawer/Drawer.web.js +8 -3
  426. package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
  427. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js +11 -3
  428. package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
  429. package/build/lib/web/production/components/Dropdown/Dropdown.js +5 -3
  430. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  431. package/build/lib/web/production/components/Dropdown/DropdownButton.js +2 -2
  432. package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
  433. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js +8 -3
  434. package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
  435. package/build/lib/web/production/components/Dropdown/DropdownLink.js +5 -3
  436. package/build/lib/web/production/components/Dropdown/DropdownLink.js.map +1 -1
  437. package/build/lib/web/production/components/FileUpload/FileUpload.web.js +6 -4
  438. package/build/lib/web/production/components/FileUpload/FileUpload.web.js.map +1 -1
  439. package/build/lib/web/production/components/Form/Selector/SelectorGroupField.js +8 -3
  440. package/build/lib/web/production/components/Form/Selector/SelectorGroupField.js.map +1 -1
  441. package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +8 -3
  442. package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
  443. package/build/lib/web/production/components/Icons/IndiaFlagIcon/IndiaFlagIcon.js +39 -0
  444. package/build/lib/web/production/components/Icons/IndiaFlagIcon/IndiaFlagIcon.js.map +1 -0
  445. package/build/lib/web/production/components/Icons/IndiaFlagIcon/index.js +2 -0
  446. package/build/lib/web/production/components/Icons/IndiaFlagIcon/index.js.map +1 -0
  447. package/build/lib/web/production/components/Icons/MagicKonnectIcon/MagicKonnectIcon.js +49 -0
  448. package/build/lib/web/production/components/Icons/MagicKonnectIcon/MagicKonnectIcon.js.map +1 -0
  449. package/build/lib/web/production/components/Icons/MagicKonnectIcon/index.js +2 -0
  450. package/build/lib/web/production/components/Icons/MagicKonnectIcon/index.js.map +1 -0
  451. package/build/lib/web/production/components/Icons/WorldwideIcon/WorldwideIcon.js +39 -0
  452. package/build/lib/web/production/components/Icons/WorldwideIcon/WorldwideIcon.js.map +1 -0
  453. package/build/lib/web/production/components/Icons/WorldwideIcon/index.js +2 -0
  454. package/build/lib/web/production/components/Icons/WorldwideIcon/index.js.map +1 -0
  455. package/build/lib/web/production/components/Icons/index.js +3 -0
  456. package/build/lib/web/production/components/Icons/index.js.map +1 -1
  457. package/build/lib/web/production/components/Indicator/Indicator.js +5 -3
  458. package/build/lib/web/production/components/Indicator/Indicator.js.map +1 -1
  459. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +6 -4
  460. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  461. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +5 -2
  462. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  463. package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js +5 -3
  464. package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
  465. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +6 -4
  466. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
  467. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +2 -2
  468. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  469. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +2 -2
  470. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
  471. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +2 -2
  472. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
  473. package/build/lib/web/production/components/Input/TextArea/TextArea.js +2 -2
  474. package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
  475. package/build/lib/web/production/components/Input/TextInput/TextInput.js +2 -2
  476. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  477. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +5 -3
  478. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
  479. package/build/lib/web/production/components/Link/Link/Link.js +4 -2
  480. package/build/lib/web/production/components/Link/Link/Link.js.map +1 -1
  481. package/build/lib/web/production/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js +18 -8
  482. package/build/lib/web/production/components/Menu/VisualSubComponents/MenuHeaderFooter.web.js.map +1 -1
  483. package/build/lib/web/production/components/Modal/Modal.web.js +10 -4
  484. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  485. package/build/lib/web/production/components/Modal/ModalBody.web.js +9 -3
  486. package/build/lib/web/production/components/Modal/ModalBody.web.js.map +1 -1
  487. package/build/lib/web/production/components/Modal/ModalFooter.web.js +7 -2
  488. package/build/lib/web/production/components/Modal/ModalFooter.web.js.map +1 -1
  489. package/build/lib/web/production/components/Modal/ModalHeader.web.js +14 -6
  490. package/build/lib/web/production/components/Modal/ModalHeader.web.js.map +1 -1
  491. package/build/lib/web/production/components/Popover/Popover.web.js +8 -3
  492. package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
  493. package/build/lib/web/production/components/Popover/PopoverInteractiveWrapper.web.js.map +1 -1
  494. package/build/lib/web/production/components/ProgressBar/ProgressBar.js +5 -3
  495. package/build/lib/web/production/components/ProgressBar/ProgressBar.js.map +1 -1
  496. package/build/lib/web/production/components/Radio/Radio.js +6 -4
  497. package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
  498. package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js +8 -5
  499. package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  500. package/build/lib/web/production/components/SideNav/SideNav.web.js +5 -3
  501. package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
  502. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavItem.web.js +13 -4
  503. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavItem.web.js.map +1 -1
  504. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js +10 -4
  505. package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
  506. package/build/lib/web/production/components/SideNav/SideNavSection.web.js +10 -4
  507. package/build/lib/web/production/components/SideNav/SideNavSection.web.js.map +1 -1
  508. package/build/lib/web/production/components/StepGroup/StepGroup.web.js +5 -3
  509. package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
  510. package/build/lib/web/production/components/StepGroup/StepItem.web.js +13 -7
  511. package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
  512. package/build/lib/web/production/components/StepGroup/StepLine.web.js +79 -42
  513. package/build/lib/web/production/components/StepGroup/StepLine.web.js.map +1 -1
  514. package/build/lib/web/production/components/StepGroup/tokens.js +6 -6
  515. package/build/lib/web/production/components/StepGroup/tokens.js.map +1 -1
  516. package/build/lib/web/production/components/Switch/Switch.js +5 -3
  517. package/build/lib/web/production/components/Switch/Switch.js.map +1 -1
  518. package/build/lib/web/production/components/Table/Table.web.js +9 -7
  519. package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
  520. package/build/lib/web/production/components/Table/TableBody.web.js +18 -9
  521. package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
  522. package/build/lib/web/production/components/Table/TableFooter.web.js +18 -9
  523. package/build/lib/web/production/components/Table/TableFooter.web.js.map +1 -1
  524. package/build/lib/web/production/components/Table/TableHeader.web.js +18 -9
  525. package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
  526. package/build/lib/web/production/components/Table/TablePagination.web.js +10 -4
  527. package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
  528. package/build/lib/web/production/components/Table/TableToolbar.web.js +13 -8
  529. package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
  530. package/build/lib/web/production/components/Tabs/TabItem.web.js +9 -5
  531. package/build/lib/web/production/components/Tabs/TabItem.web.js.map +1 -1
  532. package/build/lib/web/production/components/Tabs/TabList.web.js +5 -3
  533. package/build/lib/web/production/components/Tabs/TabList.web.js.map +1 -1
  534. package/build/lib/web/production/components/Tabs/TabPanel.web.js +10 -5
  535. package/build/lib/web/production/components/Tabs/TabPanel.web.js.map +1 -1
  536. package/build/lib/web/production/components/Tabs/Tabs.web.js +8 -3
  537. package/build/lib/web/production/components/Tabs/Tabs.web.js.map +1 -1
  538. package/build/lib/web/production/components/Tag/Tag.js +6 -4
  539. package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
  540. package/build/lib/web/production/components/Toast/ToastContainer.web.js +8 -3
  541. package/build/lib/web/production/components/Toast/ToastContainer.web.js.map +1 -1
  542. package/build/lib/web/production/components/Tooltip/Tooltip.web.js +8 -3
  543. package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
  544. package/build/lib/web/production/components/TopNav/TabNav/TabNav.web.js +6 -3
  545. package/build/lib/web/production/components/TopNav/TabNav/TabNav.web.js.map +1 -1
  546. package/build/lib/web/production/components/TopNav/TopNav.web.js +8 -5
  547. package/build/lib/web/production/components/TopNav/TopNav.web.js.map +1 -1
  548. package/build/lib/web/production/components/index.js +3 -0
  549. package/build/lib/web/production/components/index.js.map +1 -1
  550. package/build/lib/web/production/tokens/global/size.js +3 -1
  551. package/build/lib/web/production/tokens/global/size.js.map +1 -1
  552. package/build/lib/web/production/utils/makeAnalyticsAttribute/index.js +2 -0
  553. package/build/lib/web/production/utils/makeAnalyticsAttribute/index.js.map +1 -0
  554. package/build/lib/web/production/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js +20 -0
  555. package/build/lib/web/production/utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js.map +1 -0
  556. package/build/types/components/index.d.ts +228 -190
  557. package/build/types/components/index.native.d.ts +152 -132
  558. package/build/types/tokens/index.d.ts +3 -1
  559. package/build/types/tokens/index.native.d.ts +3 -1
  560. package/package.json +1 -1
@@ -13,9 +13,10 @@ import { makeSize } from '../../utils/makeSize/makeSize.js';
13
13
  import '../BladeProvider/useTheme.js';
14
14
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
15
15
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
16
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
16
17
  import { jsx } from 'react/jsx-runtime';
17
18
 
18
- var _excluded=["defaultExpandedIndex","expandedIndex","onExpandChange","showNumberPrefix","children","variant","size","maxWidth","testID"];var MIN_WIDTH={s:makeSize(size[200]),m:makeSize(size[360]),l:makeSize(size[360])};var getVariantStyles=function getVariantStyles(variant){if(variant==='transparent'){return {};}return {backgroundColor:'surface.background.gray.intense',borderRadius:'medium',borderWidth:'thinner',borderColor:'surface.border.gray.subtle'};};var Accordion=function Accordion(_ref){var defaultExpandedIndex=_ref.defaultExpandedIndex,expandedIndex=_ref.expandedIndex,onExpandChange=_ref.onExpandChange,_ref$showNumberPrefix=_ref.showNumberPrefix,showNumberPrefix=_ref$showNumberPrefix===void 0?false:_ref$showNumberPrefix,children=_ref.children,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'transparent':_ref$variant,_ref$size=_ref.size,size=_ref$size===void 0?'large':_ref$size,maxWidth=_ref.maxWidth,testID=_ref.testID,styledProps=_objectWithoutProperties(_ref,_excluded);var _useState=useState(defaultExpandedIndex),_useState2=_slicedToArray(_useState,2),expandedAccordionItemIndex=_useState2[0],setExpandedAccordionItemIndex=_useState2[1];var numberOfItems=Children.count(children);var handleExpandChange=useCallback(function(nextExpandedIndex){if(typeof expandedIndex!=='undefined'){onExpandChange==null?void 0:onExpandChange({expandedIndex:nextExpandedIndex});}else {setExpandedAccordionItemIndex(nextExpandedIndex);onExpandChange==null?void 0:onExpandChange({expandedIndex:nextExpandedIndex});}},[onExpandChange,expandedIndex]);var accordionContext=useMemo(function(){return {expandedIndex:expandedIndex!=null?expandedIndex:expandedAccordionItemIndex,defaultExpandedIndex:defaultExpandedIndex,onExpandChange:handleExpandChange,showNumberPrefix:showNumberPrefix,variant:variant,numberOfItems:numberOfItems,size:size};},[expandedAccordionItemIndex,handleExpandChange,expandedIndex,showNumberPrefix,defaultExpandedIndex,variant,numberOfItems,size]);return jsx(AccordionContext.Provider,{value:accordionContext,children:jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Accordion,testID:testID}),getStyledProps(styledProps),{children:jsx(BaseBox,Object.assign({},getVariantStyles(variant),{minWidth:MIN_WIDTH,maxWidth:maxWidth!=null?maxWidth:MAX_WIDTH,width:"100%",children:Children.map(children,function(child,index){return cloneElement(child,{_index:index,key:index});})}))}))});};
19
+ var _excluded=["defaultExpandedIndex","expandedIndex","onExpandChange","showNumberPrefix","children","variant","size","maxWidth","testID"];var MIN_WIDTH={s:makeSize(size[200]),m:makeSize(size[360]),l:makeSize(size[360])};var getVariantStyles=function getVariantStyles(variant){if(variant==='transparent'){return {};}return {backgroundColor:'surface.background.gray.intense',borderRadius:'medium',borderWidth:'thinner',borderColor:'surface.border.gray.subtle'};};var Accordion=function Accordion(_ref){var defaultExpandedIndex=_ref.defaultExpandedIndex,expandedIndex=_ref.expandedIndex,onExpandChange=_ref.onExpandChange,_ref$showNumberPrefix=_ref.showNumberPrefix,showNumberPrefix=_ref$showNumberPrefix===void 0?false:_ref$showNumberPrefix,children=_ref.children,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'transparent':_ref$variant,_ref$size=_ref.size,size=_ref$size===void 0?'large':_ref$size,maxWidth=_ref.maxWidth,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useState=useState(defaultExpandedIndex),_useState2=_slicedToArray(_useState,2),expandedAccordionItemIndex=_useState2[0],setExpandedAccordionItemIndex=_useState2[1];var numberOfItems=Children.count(children);var handleExpandChange=useCallback(function(nextExpandedIndex){if(typeof expandedIndex!=='undefined'){onExpandChange==null?void 0:onExpandChange({expandedIndex:nextExpandedIndex});}else {setExpandedAccordionItemIndex(nextExpandedIndex);onExpandChange==null?void 0:onExpandChange({expandedIndex:nextExpandedIndex});}},[onExpandChange,expandedIndex]);var accordionContext=useMemo(function(){return {expandedIndex:expandedIndex!=null?expandedIndex:expandedAccordionItemIndex,defaultExpandedIndex:defaultExpandedIndex,onExpandChange:handleExpandChange,showNumberPrefix:showNumberPrefix,variant:variant,numberOfItems:numberOfItems,size:size};},[expandedAccordionItemIndex,handleExpandChange,expandedIndex,showNumberPrefix,defaultExpandedIndex,variant,numberOfItems,size]);return jsx(AccordionContext.Provider,{value:accordionContext,children:jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Accordion,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsx(BaseBox,Object.assign({},getVariantStyles(variant),{minWidth:MIN_WIDTH,maxWidth:maxWidth!=null?maxWidth:MAX_WIDTH,width:"100%",children:Children.map(children,function(child,index){return cloneElement(child,{_index:index,key:index});})}))}))});};
19
20
 
20
21
  export { Accordion };
21
22
  //# sourceMappingURL=Accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sources":["../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback, useMemo, useState, cloneElement, Children } from 'react';\nimport type { AccordionContextState } from './AccordionContext';\nimport { AccordionContext } from './AccordionContext';\nimport { MAX_WIDTH } from './styles';\nimport type { AccordionProps } from './types';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BoxProps } from '~components/Box';\nimport { size as sizeTokens } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\nconst MIN_WIDTH: BoxProps['minWidth'] = {\n s: makeSize(sizeTokens[200]),\n m: makeSize(sizeTokens[360]),\n l: makeSize(sizeTokens[360]),\n};\n\nconst getVariantStyles = (variant: AccordionProps['variant']): BoxProps => {\n if (variant === 'transparent') {\n return {};\n }\n\n return {\n backgroundColor: 'surface.background.gray.intense',\n borderRadius: 'medium',\n borderWidth: 'thinner',\n borderColor: 'surface.border.gray.subtle',\n };\n};\n\n/**\n * # Accordion\n *\n * An accordion is used to allow users to toggle between different content sections in a compact vertical stack.\n *\n * ## Usage\n *\n * ```jsx\n * <Accordion>\n * <AccordionItem>\n * <AccordionItemHeader title=\"Title\" />\n * <AccordionItemBody>\n * <Text color=\"surface.text.gray.subtle\">\n * Hello this is accordion body content\n * </Text>\n * </AccordionItemBody>\n * </AccordionItem>\n * <AccordionItem>\n * <AccordionItemHeader title=\"Title\" />\n * <AccordionItemBody>\n * <Text color=\"surface.text.gray.subtle\">\n * Hello this is accordion body content\n * </Text>\n * </AccordionItemBody>\n * </AccordionItem>\n * </Accordion>\n * ```\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs\n *\n */\nconst Accordion = ({\n defaultExpandedIndex,\n expandedIndex,\n onExpandChange,\n showNumberPrefix = false,\n children,\n variant = 'transparent',\n size = 'large',\n maxWidth,\n testID,\n ...styledProps\n}: AccordionProps): ReactElement => {\n const [expandedAccordionItemIndex, setExpandedAccordionItemIndex] = useState<number | undefined>(\n defaultExpandedIndex,\n );\n\n const numberOfItems = Children.count(children);\n\n const handleExpandChange = useCallback(\n (nextExpandedIndex: number) => {\n if (typeof expandedIndex !== 'undefined') {\n // controlled\n onExpandChange?.({ expandedIndex: nextExpandedIndex });\n } else {\n // uncontrolled\n setExpandedAccordionItemIndex(nextExpandedIndex);\n onExpandChange?.({ expandedIndex: nextExpandedIndex });\n }\n },\n [onExpandChange, expandedIndex],\n );\n\n const accordionContext = useMemo<AccordionContextState>(\n () => ({\n expandedIndex: expandedIndex ?? expandedAccordionItemIndex,\n defaultExpandedIndex,\n onExpandChange: handleExpandChange,\n showNumberPrefix,\n variant,\n numberOfItems,\n size,\n }),\n [\n expandedAccordionItemIndex,\n handleExpandChange,\n expandedIndex,\n showNumberPrefix,\n defaultExpandedIndex,\n variant,\n numberOfItems,\n size,\n ],\n );\n\n return (\n <AccordionContext.Provider value={accordionContext}>\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Accordion, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n {...getVariantStyles(variant)}\n minWidth={MIN_WIDTH}\n maxWidth={maxWidth ?? MAX_WIDTH}\n width=\"100%\"\n >\n {Children.map(children, (child, index) =>\n cloneElement(child, { _index: index, key: index }),\n )}\n </BaseBox>\n </BaseBox>\n </AccordionContext.Provider>\n );\n};\n\nexport { Accordion };\n"],"names":["MIN_WIDTH","s","makeSize","sizeTokens","m","l","getVariantStyles","variant","backgroundColor","borderRadius","borderWidth","borderColor","Accordion","_ref","defaultExpandedIndex","expandedIndex","onExpandChange","_ref$showNumberPrefix","showNumberPrefix","children","_ref$variant","_ref$size","size","maxWidth","testID","styledProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","expandedAccordionItemIndex","setExpandedAccordionItemIndex","numberOfItems","Children","count","handleExpandChange","useCallback","nextExpandedIndex","accordionContext","useMemo","_jsx","AccordionContext","Provider","value","BaseBox","Object","assign","metaAttribute","name","MetaConstants","getStyledProps","minWidth","MAX_WIDTH","width","map","child","index","cloneElement","_index","key"],"mappings":";;;;;;;;;;;;;;;;;2IAaA,IAAMA,SAA+B,CAAG,CACtCC,CAAC,CAAEC,QAAQ,CAACC,IAAU,CAAC,GAAG,CAAC,CAAC,CAC5BC,CAAC,CAAEF,QAAQ,CAACC,IAAU,CAAC,GAAG,CAAC,CAAC,CAC5BE,CAAC,CAAEH,QAAQ,CAACC,IAAU,CAAC,GAAG,CAAC,CAC7B,CAAC,CAED,IAAMG,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAIC,OAAkC,CAAe,CACzE,GAAIA,OAAO,GAAK,aAAa,CAAE,CAC7B,OAAO,EAAE,CACX,CAEA,OAAO,CACLC,eAAe,CAAE,iCAAiC,CAClDC,YAAY,CAAE,QAAQ,CACtBC,WAAW,CAAE,SAAS,CACtBC,WAAW,CAAE,4BACf,CAAC,CACH,CAAC,CAiCK,IAAAC,SAAS,CAAG,SAAZA,SAASA,CAAAC,IAAA,CAWqB,CAAA,IAVlCC,oBAAoB,CAAAD,IAAA,CAApBC,oBAAoB,CACpBC,aAAa,CAAAF,IAAA,CAAbE,aAAa,CACbC,cAAc,CAAAH,IAAA,CAAdG,cAAc,CAAAC,qBAAA,CAAAJ,IAAA,CACdK,gBAAgB,CAAhBA,gBAAgB,CAAAD,qBAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,qBAAA,CACxBE,QAAQ,CAAAN,IAAA,CAARM,QAAQ,CAAAC,YAAA,CAAAP,IAAA,CACRN,OAAO,CAAPA,OAAO,CAAAa,YAAA,UAAG,aAAa,CAAAA,YAAA,CAAAC,SAAA,CAAAR,IAAA,CACvBS,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAA,KAAA,CAAA,CAAG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,oBAAoB,CACpBP,OAAO,CACP2B,aAAa,CACbZ,IAAI,CAER,CAAC,CAED,OACEoB,GAAA,CAACC,gBAAgB,CAACC,QAAQ,EAACC,KAAK,CAAEL,gBAAiB,CAAArB,QAAA,CACjDuB,GAAA,CAACI,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACFC,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACvC,SAAS,CAAEY,MAAM,CAANA,MAAO,CAAC,CAAC,CACxD4B,cAAc,CAAC3B,WAAW,CAAC,CAAAN,CAAAA,QAAA,CAE/BuB,GAAA,CAACI,OAAO,CAAAC,MAAA,CAAAC,MAAA,CACF1C,EAAAA,CAAAA,gBAAgB,CAACC,OAAO,CAAC,CAC7B8C,CAAAA,QAAQ,CAAErD,SAAU,CACpBuB,QAAQ,CAAEA,QAAQ,EAARA,IAAAA,CAAAA,QAAQ,CAAI+B,SAAU,CAChCC,KAAK,CAAC,MAAM,CAAApC,QAAA,CAEXgB,QAAQ,CAACqB,GAAG,CAACrC,QAAQ,CAAE,SAACsC,KAAK,CAAEC,KAAK,CACnC,CAAA,OAAAC,YAAY,CAACF,KAAK,CAAE,CAAEG,MAAM,CAAEF,KAAK,CAAEG,GAAG,CAAEH,KAAM,CAAC,CAAC,CACpD,CAAA,CAAC,CACM,CAAA,CAAC,CACH,CAAA,CAAC,CACe,CAAC,CAEhC;;;;"}
1
+ {"version":3,"file":"Accordion.js","sources":["../../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback, useMemo, useState, cloneElement, Children } from 'react';\nimport type { AccordionContextState } from './AccordionContext';\nimport { AccordionContext } from './AccordionContext';\nimport { MAX_WIDTH } from './styles';\nimport type { AccordionProps } from './types';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BoxProps } from '~components/Box';\nimport { size as sizeTokens } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst MIN_WIDTH: BoxProps['minWidth'] = {\n s: makeSize(sizeTokens[200]),\n m: makeSize(sizeTokens[360]),\n l: makeSize(sizeTokens[360]),\n};\n\nconst getVariantStyles = (variant: AccordionProps['variant']): BoxProps => {\n if (variant === 'transparent') {\n return {};\n }\n\n return {\n backgroundColor: 'surface.background.gray.intense',\n borderRadius: 'medium',\n borderWidth: 'thinner',\n borderColor: 'surface.border.gray.subtle',\n };\n};\n\n/**\n * # Accordion\n *\n * An accordion is used to allow users to toggle between different content sections in a compact vertical stack.\n *\n * ## Usage\n *\n * ```jsx\n * <Accordion>\n * <AccordionItem>\n * <AccordionItemHeader title=\"Title\" />\n * <AccordionItemBody>\n * <Text color=\"surface.text.gray.subtle\">\n * Hello this is accordion body content\n * </Text>\n * </AccordionItemBody>\n * </AccordionItem>\n * <AccordionItem>\n * <AccordionItemHeader title=\"Title\" />\n * <AccordionItemBody>\n * <Text color=\"surface.text.gray.subtle\">\n * Hello this is accordion body content\n * </Text>\n * </AccordionItemBody>\n * </AccordionItem>\n * </Accordion>\n * ```\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs\n *\n */\nconst Accordion = ({\n defaultExpandedIndex,\n expandedIndex,\n onExpandChange,\n showNumberPrefix = false,\n children,\n variant = 'transparent',\n size = 'large',\n maxWidth,\n testID,\n ...rest\n}: AccordionProps): ReactElement => {\n const [expandedAccordionItemIndex, setExpandedAccordionItemIndex] = useState<number | undefined>(\n defaultExpandedIndex,\n );\n\n const numberOfItems = Children.count(children);\n\n const handleExpandChange = useCallback(\n (nextExpandedIndex: number) => {\n if (typeof expandedIndex !== 'undefined') {\n // controlled\n onExpandChange?.({ expandedIndex: nextExpandedIndex });\n } else {\n // uncontrolled\n setExpandedAccordionItemIndex(nextExpandedIndex);\n onExpandChange?.({ expandedIndex: nextExpandedIndex });\n }\n },\n [onExpandChange, expandedIndex],\n );\n\n const accordionContext = useMemo<AccordionContextState>(\n () => ({\n expandedIndex: expandedIndex ?? expandedAccordionItemIndex,\n defaultExpandedIndex,\n onExpandChange: handleExpandChange,\n showNumberPrefix,\n variant,\n numberOfItems,\n size,\n }),\n [\n expandedAccordionItemIndex,\n handleExpandChange,\n expandedIndex,\n showNumberPrefix,\n defaultExpandedIndex,\n variant,\n numberOfItems,\n size,\n ],\n );\n\n return (\n <AccordionContext.Provider value={accordionContext}>\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Accordion, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n {...getVariantStyles(variant)}\n minWidth={MIN_WIDTH}\n maxWidth={maxWidth ?? MAX_WIDTH}\n width=\"100%\"\n >\n {Children.map(children, (child, index) =>\n cloneElement(child, { _index: index, key: index }),\n )}\n </BaseBox>\n </BaseBox>\n </AccordionContext.Provider>\n );\n};\n\nexport { Accordion };\n"],"names":["MIN_WIDTH","s","makeSize","sizeTokens","m","l","getVariantStyles","variant","backgroundColor","borderRadius","borderWidth","borderColor","Accordion","_ref","defaultExpandedIndex","expandedIndex","onExpandChange","_ref$showNumberPrefix","showNumberPrefix","children","_ref$variant","_ref$size","size","maxWidth","testID","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","expandedAccordionItemIndex","setExpandedAccordionItemIndex","numberOfItems","Children","count","handleExpandChange","useCallback","nextExpandedIndex","accordionContext","useMemo","_jsx","AccordionContext","Provider","value","BaseBox","Object","assign","metaAttribute","name","MetaConstants","getStyledProps","makeAnalyticsAttribute","minWidth","MAX_WIDTH","width","map","child","index","cloneElement","_index","key"],"mappings":";;;;;;;;;;;;;;;;;;2IAcA,IAAMA,SAA+B,CAAG,CACtCC,CAAC,CAAEC,QAAQ,CAACC,IAAU,CAAC,GAAG,CAAC,CAAC,CAC5BC,CAAC,CAAEF,QAAQ,CAACC,IAAU,CAAC,GAAG,CAAC,CAAC,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c,CAAC3B,IAAI,CAAC,CACpB4B,sBAAsB,CAAC5B,IAAI,CAAC,CAAA,CAAAN,QAAA,CAEhCuB,GAAA,CAACI,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACF1C,gBAAgB,CAACC,OAAO,CAAC,CAAA,CAC7B+C,QAAQ,CAAEtD,SAAU,CACpBuB,QAAQ,CAAEA,QAAQ,EAAA,IAAA,CAARA,QAAQ,CAAIgC,SAAU,CAChCC,KAAK,CAAC,MAAM,CAAArC,QAAA,CAEXgB,QAAQ,CAACsB,GAAG,CAACtC,QAAQ,CAAE,SAACuC,KAAK,CAAEC,KAAK,CACnC,CAAA,OAAAC,YAAY,CAACF,KAAK,CAAE,CAAEG,MAAM,CAAEF,KAAK,CAAEG,GAAG,CAAEH,KAAM,CAAC,CAAC,CACpD,CAAA,CAAC,CACM,CAAA,CAAC,CACH,CAAA,CAAC,CACe,CAAC,CAEhC;;;;"}
@@ -1,4 +1,5 @@
1
1
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
3
  import React__default from 'react';
3
4
  import { AccordionButton } from './AccordionButton.native.js';
4
5
  import { useAccordion, AccordionItemContext } from './AccordionContext.js';
@@ -17,9 +18,10 @@ import '../Collapsible/CollapsibleLink.js';
17
18
  import '../Collapsible/CollapsibleButton.js';
18
19
  import { CollapsibleBody } from '../Collapsible/CollapsibleBody.js';
19
20
  import { getComponentId } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
21
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
20
22
  import { jsx, jsxs } from 'react/jsx-runtime';
21
23
 
22
- var AccordionItem=function AccordionItem(_ref){var title=_ref.title,description=_ref.description,icon=_ref.icon,children=_ref.children,isDisabled=_ref.isDisabled,_index=_ref._index,testID=_ref.testID;var _useAccordion=useAccordion(),expandedIndex=_useAccordion.expandedIndex,onExpandChange=_useAccordion.onExpandChange,defaultExpandedIndex=_useAccordion.defaultExpandedIndex,variant=_useAccordion.variant,numberOfItems=_useAccordion.numberOfItems;var isExpanded=expandedIndex===_index;var isDefaultExpanded=defaultExpandedIndex===_index;var isDeprecatedAPI=Boolean(title)||Boolean(description)||Boolean(icon);var _React$Children$toArr=React__default.Children.toArray(children),_React$Children$toArr2=_slicedToArray(_React$Children$toArr,2),header=_React$Children$toArr2[0],body=_React$Children$toArr2[1];if(!isDeprecatedAPI){var headerComponentId=getComponentId(header);var bodyComponentId=getComponentId(body);if(headerComponentId!==componentIds.AccordionItemHeader&&bodyComponentId!==componentIds.AccordionItemBody){throwBladeError({message:'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',moduleName:'AccordionItem'});}}var isLastItem=_index!==undefined&&_index<numberOfItems-1;var handleExpandChange=function handleExpandChange(_ref2){var isExpanded=_ref2.isExpanded;if(isExpanded&&typeof _index!=='undefined'){onExpandChange(_index);}else {onExpandChange(-1);}};return jsx(AccordionItemContext.Provider,{value:{index:_index,isDisabled:isDisabled},children:jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItem,testID:testID}),{children:[jsxs(Collapsible,{isExpanded:isExpanded,defaultIsExpanded:isDefaultExpanded,onExpandChange:handleExpandChange,_shouldApplyWidthRestrictions:false,_dangerouslyDisableValidations:true,children:[jsx(AccordionButton,{index:_index,icon:icon,title:title,header:header,isDisabled:isDisabled,isDeprecatedAPI:isDeprecatedAPI}),jsx(CollapsibleBody,{width:isReactNative()||!isDeprecatedAPI?'100%':undefined,children:isDeprecatedAPI?jsx(AccordionItemBody,{_description:description,children:children}):body})]}),isLastItem||variant==='transparent'?jsx(Divider,{}):null]}))});};
24
+ var _excluded=["title","description","icon","children","isDisabled","_index","testID"];var AccordionItem=function AccordionItem(_ref){var title=_ref.title,description=_ref.description,icon=_ref.icon,children=_ref.children,isDisabled=_ref.isDisabled,_index=_ref._index,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useAccordion=useAccordion(),expandedIndex=_useAccordion.expandedIndex,onExpandChange=_useAccordion.onExpandChange,defaultExpandedIndex=_useAccordion.defaultExpandedIndex,variant=_useAccordion.variant,numberOfItems=_useAccordion.numberOfItems;var isExpanded=expandedIndex===_index;var isDefaultExpanded=defaultExpandedIndex===_index;var isDeprecatedAPI=Boolean(title)||Boolean(description)||Boolean(icon);var _React$Children$toArr=React__default.Children.toArray(children),_React$Children$toArr2=_slicedToArray(_React$Children$toArr,2),header=_React$Children$toArr2[0],body=_React$Children$toArr2[1];if(!isDeprecatedAPI){var headerComponentId=getComponentId(header);var bodyComponentId=getComponentId(body);if(headerComponentId!==componentIds.AccordionItemHeader&&bodyComponentId!==componentIds.AccordionItemBody){throwBladeError({message:'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',moduleName:'AccordionItem'});}}var isLastItem=_index!==undefined&&_index<numberOfItems-1;var handleExpandChange=function handleExpandChange(_ref2){var isExpanded=_ref2.isExpanded;if(isExpanded&&typeof _index!=='undefined'){onExpandChange(_index);}else {onExpandChange(-1);}};return jsx(AccordionItemContext.Provider,{value:{index:_index,isDisabled:isDisabled},children:jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItem,testID:testID}),makeAnalyticsAttribute(rest),{children:[jsxs(Collapsible,{isExpanded:isExpanded,defaultIsExpanded:isDefaultExpanded,onExpandChange:handleExpandChange,_shouldApplyWidthRestrictions:false,_dangerouslyDisableValidations:true,children:[jsx(AccordionButton,{index:_index,icon:icon,title:title,header:header,isDisabled:isDisabled,isDeprecatedAPI:isDeprecatedAPI}),jsx(CollapsibleBody,{width:isReactNative()||!isDeprecatedAPI?'100%':undefined,children:isDeprecatedAPI?jsx(AccordionItemBody,{_description:description,children:children}):body})]}),isLastItem||variant==='transparent'?jsx(Divider,{}):null]}))});};
23
25
 
24
26
  export { AccordionItem };
25
27
  //# sourceMappingURL=AccordionItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/AccordionItem.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport { AccordionButton } from './AccordionButton';\nimport { AccordionItemContext, useAccordion } from './AccordionContext';\nimport { AccordionItemBody } from './AccordionItemBody';\nimport { componentIds } from './componentIds';\nimport { Divider } from '~components/Divider';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { isReactNative } from '~utils';\nimport { Collapsible } from '~components/Collapsible/Collapsible';\nimport { CollapsibleBody } from '~components/Collapsible';\nimport type { TestID } from '~utils/types';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\ntype AccordionItemProps = {\n /**\n * Title text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n title?: string;\n\n /**\n * Body text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n description?: string;\n\n /**\n * Renders a Blade icon as title prefix (requires `showNumberPrefix={false}`)\n *\n * @deprecated Use `leading={<StarIcon size=\"large\" />}` on AccordionItemHeader instead\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n icon?: IconComponent;\n\n /**\n * Slot, renders any custom content\n */\n children?: ReactNode | ReactNode[];\n\n /**\n * Disabled state of the item\n *\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * **Internal:** used for determining numbering, you don't need to pass this,\n * instead pass `showNumberPrefix` to root `Accordion`\n */\n _index?: number;\n} & TestID;\n\nconst AccordionItem = ({\n title,\n description,\n icon,\n children,\n isDisabled,\n _index,\n testID,\n}: AccordionItemProps): ReactElement => {\n const {\n expandedIndex,\n onExpandChange,\n defaultExpandedIndex,\n variant,\n numberOfItems,\n } = useAccordion();\n const isExpanded = expandedIndex === _index;\n const isDefaultExpanded = defaultExpandedIndex === _index;\n const isDeprecatedAPI = Boolean(title) || Boolean(description) || Boolean(icon);\n const [header, body] = React.Children.toArray(children);\n\n if (!isDeprecatedAPI) {\n // Only doing validation in new API. Deprecated API allows everything as AccordionItem children\n const headerComponentId = getComponentId(header);\n const bodyComponentId = getComponentId(body);\n\n if (\n headerComponentId !== componentIds.AccordionItemHeader &&\n bodyComponentId !== componentIds.AccordionItemBody\n ) {\n throwBladeError({\n message:\n 'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',\n moduleName: 'AccordionItem',\n });\n }\n }\n\n const isLastItem = _index !== undefined && _index < numberOfItems - 1;\n\n const handleExpandChange = ({ isExpanded }: { isExpanded: boolean }): void => {\n if (isExpanded && typeof _index !== 'undefined') {\n onExpandChange(_index);\n } else {\n onExpandChange(-1);\n }\n };\n\n return (\n <AccordionItemContext.Provider\n value={{\n index: _index,\n isDisabled,\n }}\n >\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItem, testID })}>\n <Collapsible\n isExpanded={isExpanded}\n defaultIsExpanded={isDefaultExpanded}\n onExpandChange={handleExpandChange}\n // Accordion has its own width restrictions\n _shouldApplyWidthRestrictions={false}\n _dangerouslyDisableValidations={true}\n >\n <AccordionButton\n index={_index}\n icon={icon}\n title={title}\n header={header}\n isDisabled={isDisabled}\n isDeprecatedAPI={isDeprecatedAPI}\n />\n <CollapsibleBody\n // Just React Native things, need this 100% so collapsed content flows correctly inside Accordion\n // In new API, AccordionItemBody takes 100% width to avoid issues like this - https://github.com/razorpay/blade/pull/1814\n width={isReactNative() || !isDeprecatedAPI ? '100%' : undefined}\n >\n {isDeprecatedAPI ? (\n <AccordionItemBody _description={description}>{children}</AccordionItemBody>\n ) : (\n body\n )}\n </CollapsibleBody>\n </Collapsible>\n {isLastItem || variant === 'transparent' ? <Divider /> : null}\n </BaseBox>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type { AccordionItemProps };\nexport { AccordionItem };\n"],"names":["AccordionItem","_ref","title","description","icon","children","isDisabled","_index","testID","_useAccordion","useAccordion","expandedIndex","onExpandChange","defaultExpandedIndex","variant","numberOfItems","isExpanded","isDefaultExpanded","isDeprecatedAPI","Boolean","_React$Children$toArr","React","Children","toArray","_React$Children$toArr2","_slicedToArray","header","body","headerComponentId","getComponentId","bodyComponentId","componentIds","AccordionItemHeader","AccordionItemBody","throwBladeError","message","moduleName","isLastItem","undefined","handleExpandChange","_ref2","_jsx","AccordionItemContext","Provider","value","index","_jsxs","BaseBox","Object","assign","metaAttribute","name","MetaConstants","Collapsible","defaultIsExpanded","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations","AccordionButton","CollapsibleBody","width","isReactNative","_description","Divider"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgEM,IAAAA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CAQqB,CAAA,IAPtCC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CACJC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CACRC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,MAAM,CAAAN,IAAA,CAANM,MAAM,CACNC,MAAM,CAAAP,IAAA,CAANO,MAAM,CAEN,IAAAC,aAAA,CAMIC,YAAY,EAAE,CALhBC,aAAa,CAAAF,aAAA,CAAbE,aAAa,CACbC,cAAc,CAAAH,aAAA,CAAdG,cAAc,CACdC,oBAAoB,CAAAJ,aAAA,CAApBI,oBAAoB,CACpBC,OAAO,CAAAL,aAAA,CAAPK,OAAO,CACPC,aAAa,CAAAN,aAAA,CAAbM,aAAa,CAEf,IAAMC,UAAU,CAAGL,aAAa,GAAKJ,MAAM,CAC3C,IAAMU,iBAAiB,CAAGJ,oBAAoB,GAAKN,MAAM,CACzD,IA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AKC,EAAAA,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACpD,aAAa,CAAEQ,MAAM,CAANA,MAAO,CAAC,CAAC,CAAA,CAAAH,QAAA,CACvEyC,CAAAA,IAAA,CAACO,WAAW,CACVrC,CAAAA,UAAU,CAAEA,UAAW,CACvBsC,iBAAiB,CAAErC,iBAAkB,CACrCL,cAAc,CAAE2B,kBAAmB,CAEnCgB,6BAA6B,CAAE,KAAM,CACrCC,8BAA8B,CAAE,IAAK,CAAAnD,QAAA,CAAA,CAErCoC,GAAA,CAACgB,eAAe,CACdZ,CAAAA,KAAK,CAAEtC,MAAO,CACdH,IAAI,CAAEA,IAAK,CACXF,KAAK,CAAEA,KAAM,CACbwB,MAAM,CAAEA,MAAO,CACfpB,UAAU,CAAEA,UAAW,CACvBY,eAAe,CAAEA,eAAgB,CAClC,CAAC,CACFuB,GAAA,CAACiB,eAAe,EAGdC,KAAK,CAAEC,aAAa,EAAE,EAAI,CAAC1C,eAAe,CAAG,MAAM,CAAGoB,SAAU,CAAAjC,QAAA,CAE/Da,eAAe,CACduB,GAAA,CAACR,iBAAiB,CAAA,CAAC4B,YAAY,CAAE1D,WAAY,CAAAE,QAAA,CAAEA,QAAQ,CAAoB,CAAC,CAE5EsB,IACD,CACc,CAAC,CACP,CAAA,CAAC,CACbU,UAAU,EAAIvB,OAAO,GAAK,aAAa,CAAG2B,GAAA,CAACqB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CACtD,CAAA,CAAA,CAAC,CACmB,CAAC,CAEpC;;;;"}
1
+ {"version":3,"file":"AccordionItem.js","sources":["../../../../../src/components/Accordion/AccordionItem.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport { AccordionButton } from './AccordionButton';\nimport { AccordionItemContext, useAccordion } from './AccordionContext';\nimport { AccordionItemBody } from './AccordionItemBody';\nimport { componentIds } from './componentIds';\nimport { Divider } from '~components/Divider';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { isReactNative } from '~utils';\nimport { Collapsible } from '~components/Collapsible/Collapsible';\nimport { CollapsibleBody } from '~components/Collapsible';\nimport type { TestID, DataAnalyticsAttribute } from '~utils/types';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype AccordionItemProps = {\n /**\n * Title text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n title?: string;\n\n /**\n * Body text content\n *\n * @deprecated Use AccordionItemHeader and AccordionItemBody\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n description?: string;\n\n /**\n * Renders a Blade icon as title prefix (requires `showNumberPrefix={false}`)\n *\n * @deprecated Use `leading={<StarIcon size=\"large\" />}` on AccordionItemHeader instead\n *\n * Checkout https://blade.razorpay.com/?path=/docs/components-accordion--docs for new API\n */\n icon?: IconComponent;\n\n /**\n * Slot, renders any custom content\n */\n children?: ReactNode | ReactNode[];\n\n /**\n * Disabled state of the item\n *\n * @default false\n */\n isDisabled?: boolean;\n\n /**\n * **Internal:** used for determining numbering, you don't need to pass this,\n * instead pass `showNumberPrefix` to root `Accordion`\n */\n _index?: number;\n} & TestID &\n DataAnalyticsAttribute;\n\nconst AccordionItem = ({\n title,\n description,\n icon,\n children,\n isDisabled,\n _index,\n testID,\n ...rest\n}: AccordionItemProps): ReactElement => {\n const {\n expandedIndex,\n onExpandChange,\n defaultExpandedIndex,\n variant,\n numberOfItems,\n } = useAccordion();\n const isExpanded = expandedIndex === _index;\n const isDefaultExpanded = defaultExpandedIndex === _index;\n const isDeprecatedAPI = Boolean(title) || Boolean(description) || Boolean(icon);\n const [header, body] = React.Children.toArray(children);\n\n if (!isDeprecatedAPI) {\n // Only doing validation in new API. Deprecated API allows everything as AccordionItem children\n const headerComponentId = getComponentId(header);\n const bodyComponentId = getComponentId(body);\n\n if (\n headerComponentId !== componentIds.AccordionItemHeader &&\n bodyComponentId !== componentIds.AccordionItemBody\n ) {\n throwBladeError({\n message:\n 'AccordionItem only allows AccordionItemHeader as first component and AccordionItemBody as second. Check Accordion documentation',\n moduleName: 'AccordionItem',\n });\n }\n }\n\n const isLastItem = _index !== undefined && _index < numberOfItems - 1;\n\n const handleExpandChange = ({ isExpanded }: { isExpanded: boolean }): void => {\n if (isExpanded && typeof _index !== 'undefined') {\n onExpandChange(_index);\n } else {\n onExpandChange(-1);\n }\n };\n\n return (\n <AccordionItemContext.Provider\n value={{\n index: _index,\n isDisabled,\n }}\n >\n <BaseBox\n {...metaAttribute({ name: MetaConstants.AccordionItem, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <Collapsible\n isExpanded={isExpanded}\n defaultIsExpanded={isDefaultExpanded}\n onExpandChange={handleExpandChange}\n // Accordion has its own width restrictions\n _shouldApplyWidthRestrictions={false}\n _dangerouslyDisableValidations={true}\n >\n <AccordionButton\n index={_index}\n icon={icon}\n title={title}\n header={header}\n isDisabled={isDisabled}\n isDeprecatedAPI={isDeprecatedAPI}\n />\n <CollapsibleBody\n // Just React Native things, need this 100% so collapsed content flows correctly inside Accordion\n // In new API, AccordionItemBody takes 100% width to avoid issues like this - https://github.com/razorpay/blade/pull/1814\n width={isReactNative() || !isDeprecatedAPI ? '100%' : undefined}\n >\n {isDeprecatedAPI ? (\n <AccordionItemBody _description={description}>{children}</AccordionItemBody>\n ) : (\n body\n )}\n </CollapsibleBody>\n </Collapsible>\n {isLastItem || variant === 'transparent' ? <Divider /> : null}\n </BaseBox>\n </AccordionItemContext.Provider>\n );\n};\n\nexport type { AccordionItemProps };\nexport { AccordionItem };\n"],"names":["AccordionItem","_ref","title","description","icon","children","isDisabled","_index","testID","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","expandedIndex","onExpandChange","defaultExpandedIndex","variant","numberOfItems","isExpanded","isDefaultExpanded","isDeprecatedAPI","Boolean","_React$Children$toArr","React","Children","toArray","_React$Children$toArr2","_slicedToArray","header","body","headerComponentId","getComponentId","bodyComponentId","componentIds","AccordionItemHeader","AccordionItemBody","throwBladeError","message","moduleName","isLastItem","undefined","handleExpandChange","_ref2","_jsx","AccordionItemContext","Provider","value","index","_jsxs","BaseBox","Object","assign","metaAttribute","name","MetaConstants","makeAnalyticsAttribute","Collapsible","defaultIsExpanded","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations","AccordionButton","CollapsibleBody","width","isReactNative","_description","Divider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;uFAkEM,IAAAA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CASqB,CARtC,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CACJC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CACRC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,MAAM,CAAAN,IAAA,CAANM,MAAM,CACNC,MAAM,CAAAP,IAAA,CAANO,MAAM,CACHC,IAAI,CAAAC,wBAAA,CAAAT,IAAA,CAAAU,SAAA,CAAA,CAEP,IAAAC,aAAA,CAMIC,YAAY,EAAE,CALhBC,aAAa,CAAAF,aAAA,CAAbE,aAAa,CACbC,cAAc,CAAAH,aAAA,CAAdG,cAAc,CACdC,oBAAoB,CAAAJ,aAAA,CAApBI,oBAAoB,CACpBC,OAAO,CAAAL,aAAA,CAAPK,OAAO,CACPC,aAAa,CAAAN,aAAA,CAAbM,aAAa,CAEf,IAAMC,UAAU,CAAGL,aAAa,GAAKP,MAAM,CAC3C,IAAMa,iBAAiB,CAAGJ,oBAAoB,GAAKT,MAAM,CACzD,IAAMc,eAAe,CAAGC,OAAO,CAACpB,KAAK,CAAC,EAAIoB,OAAO,C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ACvD,aAAa,CAAEQ,MAAM,CAANA,MAAO,CAAC,CAAC,CAC5DgD,sBAAsB,CAAC/C,IAAI,CAAC,CAAAJ,CAAAA,QAAA,CAEhC4C,CAAAA,IAAA,CAACQ,WAAW,CACVtC,CAAAA,UAAU,CAAEA,UAAW,CACvBuC,iBAAiB,CAAEtC,iBAAkB,CACrCL,cAAc,CAAE2B,kBAAmB,CAEnCiB,6BAA6B,CAAE,KAAM,CACrCC,8BAA8B,CAAE,IAAK,CAAAvD,QAAA,CAErCuC,CAAAA,GAAA,CAACiB,eAAe,CACdb,CAAAA,KAAK,CAAEzC,MAAO,CACdH,IAAI,CAAEA,IAAK,CACXF,KAAK,CAAEA,KAAM,CACb2B,MAAM,CAAEA,MAAO,CACfvB,UAAU,CAAEA,UAAW,CACvBe,eAAe,CAAEA,eAAgB,CAClC,CAAC,CACFuB,GAAA,CAACkB,eAAe,CAAA,CAGdC,KAAK,CAAEC,aAAa,EAAE,EAAI,CAAC3C,eAAe,CAAG,MAAM,CAAGoB,SAAU,CAAApC,QAAA,CAE/DgB,eAAe,CACduB,GAAA,CAACR,iBAAiB,CAAC6B,CAAAA,YAAY,CAAE9D,WAAY,CAAAE,QAAA,CAAEA,QAAQ,CAAoB,CAAC,CAE5EyB,IACD,CACc,CAAC,CACP,CAAA,CAAC,CACbU,UAAU,EAAIvB,OAAO,GAAK,aAAa,CAAG2B,GAAA,CAACsB,OAAO,CAAE,EAAA,CAAC,CAAG,IAAI,CACtD,CAAA,CAAA,CAAC,CACmB,CAAC,CAEpC;;;;"}
@@ -1,7 +1,7 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
2
  import { useAccordion } from './AccordionContext.js';
2
3
  import { componentIds } from './componentIds.js';
3
4
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
4
- import '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import '../Typography/BaseText/BaseText.native.js';
6
6
  import 'react';
7
7
  import '@babel/runtime/helpers/slicedToArray';
@@ -17,8 +17,9 @@ import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.native
17
17
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
18
18
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
19
19
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
20
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
20
21
 
21
- var BLANK_SPACE=' ';var reactNativeMultilineTextOverflowFix=jsx(BaseBox,Object.assign({},makeAccessible({hidden:true}),{children:jsx(Text,{children:BLANK_SPACE})}));var descriptionSizeToken={large:'medium',medium:'small'};var _AccordionItemBody=function _AccordionItemBody(_ref){var children=_ref.children,_description=_ref._description;var _useAccordion=useAccordion(),size=_useAccordion.size;var childrenElement=typeof children==='string'||typeof children==='number'?jsx(Text,{size:descriptionSizeToken[size],color:"surface.text.gray.subtle",children:children}):children;var descriptionElement=_description&&jsx(Text,{size:descriptionSizeToken[size],color:"surface.text.gray.subtle",children:_description});var collapsibleBodyContent=isReactNative()?jsxs(BaseBox,{marginX:"spacing.5",children:[descriptionElement,jsx(BaseBox,{marginTop:_description&&children?'spacing.5':'spacing.0',children:childrenElement}),reactNativeMultilineTextOverflowFix]}):jsxs(BaseBox,{display:"flex",flexDirection:"column",gap:"spacing.5",marginBottom:"spacing.5",marginX:"spacing.5",children:[descriptionElement,childrenElement]});return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItemBody}),{children:collapsibleBodyContent}));};var AccordionItemBody=assignWithoutSideEffects(_AccordionItemBody,{componentId:componentIds.AccordionItemBody});
22
+ var _excluded=["children","_description"];var BLANK_SPACE=' ';var reactNativeMultilineTextOverflowFix=jsx(BaseBox,Object.assign({},makeAccessible({hidden:true}),{children:jsx(Text,{children:BLANK_SPACE})}));var descriptionSizeToken={large:'medium',medium:'small'};var _AccordionItemBody=function _AccordionItemBody(_ref){var children=_ref.children,_description=_ref._description,rest=_objectWithoutProperties(_ref,_excluded);var _useAccordion=useAccordion(),size=_useAccordion.size;var childrenElement=typeof children==='string'||typeof children==='number'?jsx(Text,{size:descriptionSizeToken[size],color:"surface.text.gray.subtle",children:children}):children;var descriptionElement=_description&&jsx(Text,{size:descriptionSizeToken[size],color:"surface.text.gray.subtle",children:_description});var collapsibleBodyContent=isReactNative()?jsxs(BaseBox,{marginX:"spacing.5",children:[descriptionElement,jsx(BaseBox,{marginTop:_description&&children?'spacing.5':'spacing.0',children:childrenElement}),reactNativeMultilineTextOverflowFix]}):jsxs(BaseBox,{display:"flex",flexDirection:"column",gap:"spacing.5",marginBottom:"spacing.5",marginX:"spacing.5",children:[descriptionElement,childrenElement]});return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItemBody}),makeAnalyticsAttribute(rest),{children:collapsibleBodyContent}));};var AccordionItemBody=assignWithoutSideEffects(_AccordionItemBody,{componentId:componentIds.AccordionItemBody});
22
23
 
23
24
  export { AccordionItemBody };
24
25
  //# sourceMappingURL=AccordionItemBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItemBody.js","sources":["../../../../../src/components/Accordion/AccordionItemBody.tsx"],"sourcesContent":["import { useAccordion } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { isReactNative } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { StringChildrenType } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\n\nconst BLANK_SPACE = ' ';\n\n/**\n * On React Native if the `AccordionItem` has a lengthy description which renders a `Text` spanning multiple lines,\n * it sometimes messes up the layout calculation (it thinks of multiline as a single line before flowing in the UI).\n * And during the expanding / collapsing animation, text reflows causing words to jump around across lines.\n *\n * Rendering a blank `Text` at the end seems to fix all this 🤯\n */\nconst reactNativeMultilineTextOverflowFix = (\n // make this hidden from screen readers\n <BaseBox {...makeAccessible({ hidden: true })}>\n <Text>{BLANK_SPACE}</Text>\n </BaseBox>\n);\n\nconst descriptionSizeToken = {\n large: 'medium',\n medium: 'small',\n} as const;\n\nconst _AccordionItemBody = ({\n children,\n _description,\n}: {\n children?: React.ReactNode | StringChildrenType;\n _description?: string;\n}): React.ReactElement => {\n const { size } = useAccordion();\n\n const childrenElement =\n typeof children === 'string' || typeof children === 'number' ? (\n <Text size={descriptionSizeToken[size]} color=\"surface.text.gray.subtle\">\n {children}\n </Text>\n ) : (\n children\n );\n\n const descriptionElement = _description && (\n <Text size={descriptionSizeToken[size]} color=\"surface.text.gray.subtle\">\n {_description}\n </Text>\n );\n\n const collapsibleBodyContent = isReactNative() ? (\n <BaseBox marginX=\"spacing.5\">\n {descriptionElement}\n <BaseBox marginTop={_description && children ? 'spacing.5' : 'spacing.0'}>\n {childrenElement}\n </BaseBox>\n {reactNativeMultilineTextOverflowFix}\n </BaseBox>\n ) : (\n <BaseBox\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"spacing.5\"\n marginBottom=\"spacing.5\"\n marginX=\"spacing.5\"\n >\n {descriptionElement}\n {childrenElement}\n </BaseBox>\n );\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemBody })}>\n {collapsibleBodyContent}\n </BaseBox>\n );\n};\n\nconst AccordionItemBody = assignWithoutSideEffects(_AccordionItemBody, {\n componentId: componentIds.AccordionItemBody,\n});\n\nexport { AccordionItemBody };\n"],"names":["BLANK_SPACE","reactNativeMultilineTextOverflowFix","_jsx","BaseBox","Object","assign","makeAccessible","hidden","children","Text","descriptionSizeToken","large","medium","_AccordionItemBody","_ref","_description","_useAccordion","useAccordion","size","childrenElement","color","descriptionElement","collapsibleBodyContent","isReactNative","_jsxs","marginX","marginTop","display","flexDirection","gap","marginBottom","metaAttribute","name","MetaConstants","AccordionItemBody","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;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CAAG,WAAY,CAAAA,QAAA,CACtEW,eAAe,CACT,CAAC,CACTlB,mCAAmC,CAAA,CAC7B,CAAC,CAEVuB,IAAA,CAACrB,OAAO,EACNwB,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,QAAQ,CACtBC,GAAG,CAAC,WAAW,CACfC,YAAY,CAAC,WAAW,CACxBL,OAAO,CAAC,WAAW,CAAAjB,QAAA,CAAA,CAElBa,kBAAkB,CAClBF,eAAe,CACT,CAAA,CACV,CAED,OACEjB,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAK0B,EAAAA,CAAAA,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,iBAAkB,CAAC,CAAC,CAAA,CAAA1B,QAAA,CAClEc,sBAAsB,CAChB,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAY,iBAAiB,CAAGC,wBAAwB,CAACtB,kBAAkB,CAAE,CACrEuB,WAAW,CAAEC,YAAY,CAACH,iBAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"AccordionItemBody.js","sources":["../../../../../src/components/Accordion/AccordionItemBody.tsx"],"sourcesContent":["import { useAccordion } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { isReactNative } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { DataAnalyticsAttribute, StringChildrenType } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants, metaAttribute } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst BLANK_SPACE = ' ';\n\n/**\n * On React Native if the `AccordionItem` has a lengthy description which renders a `Text` spanning multiple lines,\n * it sometimes messes up the layout calculation (it thinks of multiline as a single line before flowing in the UI).\n * And during the expanding / collapsing animation, text reflows causing words to jump around across lines.\n *\n * Rendering a blank `Text` at the end seems to fix all this 🤯\n */\nconst reactNativeMultilineTextOverflowFix = (\n // make this hidden from screen readers\n <BaseBox {...makeAccessible({ hidden: true })}>\n <Text>{BLANK_SPACE}</Text>\n </BaseBox>\n);\n\nconst descriptionSizeToken = {\n large: 'medium',\n medium: 'small',\n} as const;\n\nconst _AccordionItemBody = ({\n children,\n _description,\n ...rest\n}: {\n children?: React.ReactNode | StringChildrenType;\n _description?: string;\n} & DataAnalyticsAttribute): React.ReactElement => {\n const { size } = useAccordion();\n\n const childrenElement =\n typeof children === 'string' || typeof children === 'number' ? (\n <Text size={descriptionSizeToken[size]} color=\"surface.text.gray.subtle\">\n {children}\n </Text>\n ) : (\n children\n );\n\n const descriptionElement = _description && (\n <Text size={descriptionSizeToken[size]} color=\"surface.text.gray.subtle\">\n {_description}\n </Text>\n );\n\n const collapsibleBodyContent = isReactNative() ? (\n <BaseBox marginX=\"spacing.5\">\n {descriptionElement}\n <BaseBox marginTop={_description && children ? 'spacing.5' : 'spacing.0'}>\n {childrenElement}\n </BaseBox>\n {reactNativeMultilineTextOverflowFix}\n </BaseBox>\n ) : (\n <BaseBox\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"spacing.5\"\n marginBottom=\"spacing.5\"\n marginX=\"spacing.5\"\n >\n {descriptionElement}\n {childrenElement}\n </BaseBox>\n );\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.AccordionItemBody })}\n {...makeAnalyticsAttribute(rest)}\n >\n {collapsibleBodyContent}\n </BaseBox>\n );\n};\n\nconst AccordionItemBody = assignWithoutSideEffects(_AccordionItemBody, {\n componentId: componentIds.AccordionItemBody,\n});\n\nexport { AccordionItemBody };\n"],"names":["BLANK_SPACE","reactNativeMultilineTextOverflowFix","_jsx","BaseBox","Object","assign","makeAccessible","hidden","children","Text","descriptionSizeToken","large","medium","_AccordionItemBody","_ref","_description","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","size","childrenElement","color","descriptionElement","collapsibleBodyContent","isReactNative","_jsxs","marginX","marginTop","display","flexDirection","gap","marginBottom","metaAttribute","name","MetaConstants","AccordionItemBody","makeAnalyticsAttribute","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,cAAA,CAAA,CAWA,IAAMA,WAAW,CAAG,GAAG,CASvB,IAAMC,mCAAmC,CAEvCC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,IAAKC,cAAc,CAAC,CAAEC,MAAM,CAAE,IAAK,CAAC,CAAC,CAAAC,CAAAA,QAAA,CAC3CN,GAAA,CAACO,IAAI,CAAA,CAAAD,QAAA,CAAER,WAAW,CAAO,CAAC,EACnB,CACV,CAED,IAAMU,oBAAoB,CAAG,CAC3BC,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,OACV,CAAU,CAEV,IAAMC,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAAC,IAAA,CAO2B,CANjD,IAAAN,QAAQ,CAAAM,IAAA,CAARN,QAAQ,CACRO,YAAY,CAAAD,IAAA,CAAZC,YAAY,CACTC,IAAI,CAAAC,wBAAA,CAAAH,IAAA,CAAAI,SAAA,CAKP,CAAA,IAAAC,aAAA,CAAiBC,YAAY,EAAE,CAAvBC,IAAI,CAAAF,aAAA,CAAJE,IAAI,CAEZ,IAAMC,eAAe,CACnB,OAAOd,QAAQ,GAAK,QAAQ,EAAI,OAAOA,QAAQ,GAAK,QAAQ,CAC1DN,GAAA,CAACO,IAAI,EAACY,IAAI,CAAEX,oBAAoB,CAACW,IAAI,CAAE,CAACE,KAAK,CAAC,0BAA0B,CAAAf,QAAA,CACrEA,QAAQ,CACL,CAAC,CAEPA,QACD,CAEH,IAAMgB,kBAAkB,CAAGT,YAAY,EACrCb,GAAA,CAACO,IAAI,CAAA,CAACY,IAAI,CAAEX,oBAAoB,CAACW,IAAI,CAAE,CAACE,KAAK,CAAC,0BAA0B,CAAAf,QAAA,CACrEO,YAAY,CACT,CACP,CAED,IAAMU,sBAAsB,CAAGC,aAAa,EAAE,CAC5CC,IAAA,CAACxB,OAAO,EAACyB,OAAO,CAAC,WAAW,CAAApB,QAAA,CACzBgB,CAAAA,kBAAkB,CACnBtB,GAAA,CAACC,OAAO,CAAC0B,CAAAA,SAAS,CAAEd,YAAY,EAAIP,QAAQ,CAAG,WAAW,CAAG,WAAY,CAAAA,QAAA,CACtEc,eAAe,CACT,CAAC,CACTrB,mCAAmC,CAC7B,CAAA,CAAC,CAEV0B,IAAA,CAACxB,OAAO,CAAA,CACN2B,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,QAAQ,CACtBC,GAAG,CAAC,WAAW,CACfC,YAAY,CAAC,WAAW,CACxBL,OAAO,CAAC,WAAW,CAAApB,QAAA,EAElBgB,kBAAkB,CAClBF,eAAe,CAAA,CACT,CACV,CAED,OACEpB,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,IACF6B,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,iBAAkB,CAAC,CAAC,CACxDC,sBAAsB,CAACtB,IAAI,CAAC,CAAAR,CAAAA,QAAA,CAE/BiB,sBAAsB,CAAA,CAChB,CAAC,CAEd,CAAC,CAEK,IAAAY,iBAAiB,CAAGE,wBAAwB,CAAC1B,kBAAkB,CAAE,CACrE2B,WAAW,CAAEC,YAAY,CAACJ,iBAC5B,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
2
  import { useAccordion, useAccordionItemIndex } from './AccordionContext.js';
2
3
  import { componentIds } from './componentIds.js';
3
4
  import { BaseHeader } from '../BaseHeaderFooter/BaseHeader.js';
4
- import '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import '../Typography/BaseText/BaseText.native.js';
6
6
  import 'react';
7
7
  import '@babel/runtime/helpers/slicedToArray';
@@ -17,8 +17,9 @@ import { CollapsibleChevronIcon } from '../Collapsible/CollapsibleChevronIcon.na
17
17
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
18
18
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
19
19
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
20
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
20
21
 
21
- var _AccordionItemHeader=function _AccordionItemHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,children=_ref.children,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix;var _useAccordion=useAccordion(),size=_useAccordion.size,showNumberPrefix=_useAccordion.showNumberPrefix;var _useAccordionItemInde=useAccordionItemIndex(),index=_useAccordionItemInde.index,isDisabled=_useAccordionItemInde.isDisabled;return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItemHeader}),{flex:"1",children:jsx(BaseHeader,{leading:showNumberPrefix&&typeof index==='number'?jsxs(Text,{size:size,weight:"semibold",marginTop:"-2px",as:"span",children:[index+1,"."]}):leading,title:title,subtitle:subtitle,trailing:trailing,titleSuffix:titleSuffix,isDisabled:isDisabled,showBackButton:false,showCloseButton:false,showDivider:false,paddingX:"spacing.5",marginY:"spacing.5",size:size,trailingInteractionElement:jsx(CollapsibleChevronIcon,{color:isDisabled?'interactive.icon.gray.disabled':'interactive.icon.gray.muted',size:"large"}),children:children})}));};var AccordionItemHeader=assignWithoutSideEffects(_AccordionItemHeader,{componentId:componentIds.AccordionItemHeader});
22
+ var _excluded=["title","subtitle","leading","children","trailing","titleSuffix"];var _AccordionItemHeader=function _AccordionItemHeader(_ref){var title=_ref.title,subtitle=_ref.subtitle,leading=_ref.leading,children=_ref.children,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix,rest=_objectWithoutProperties(_ref,_excluded);var _useAccordion=useAccordion(),size=_useAccordion.size,showNumberPrefix=_useAccordion.showNumberPrefix;var _useAccordionItemInde=useAccordionItemIndex(),index=_useAccordionItemInde.index,isDisabled=_useAccordionItemInde.isDisabled;return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.AccordionItemHeader}),{flex:"1",children:jsx(BaseHeader,Object.assign({leading:showNumberPrefix&&typeof index==='number'?jsxs(Text,{size:size,weight:"semibold",marginTop:"-2px",as:"span",children:[index+1,"."]}):leading,title:title,subtitle:subtitle,trailing:trailing,titleSuffix:titleSuffix,isDisabled:isDisabled,showBackButton:false,showCloseButton:false,showDivider:false,paddingX:"spacing.5",marginY:"spacing.5",size:size,trailingInteractionElement:jsx(CollapsibleChevronIcon,{color:isDisabled?'interactive.icon.gray.disabled':'interactive.icon.gray.muted',size:"large"})},makeAnalyticsAttribute(rest),{children:children}))}));};var AccordionItemHeader=assignWithoutSideEffects(_AccordionItemHeader,{componentId:componentIds.AccordionItemHeader});
22
23
 
23
24
  export { AccordionItemHeader };
24
25
  //# sourceMappingURL=AccordionItemHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItemHeader.js","sources":["../../../../../src/components/Accordion/AccordionItemHeader.tsx"],"sourcesContent":["import { useAccordion, useAccordionItemIndex } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CollapsibleChevronIcon } from '~components/Collapsible/CollapsibleChevronIcon';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\nconst _AccordionItemHeader = ({\n title,\n subtitle,\n leading,\n children,\n trailing,\n titleSuffix,\n}: Pick<\n BaseHeaderProps,\n 'title' | 'subtitle' | 'leading' | 'children' | 'trailing' | 'titleSuffix'\n>): React.ReactElement => {\n const { size, showNumberPrefix } = useAccordion();\n const { index, isDisabled } = useAccordionItemIndex();\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemHeader })} flex=\"1\">\n <BaseHeader\n leading={\n showNumberPrefix && typeof index === 'number' ? (\n // we have to add -2px margin to align the number with title of BaseHeader\n <Text size={size} weight=\"semibold\" marginTop=\"-2px\" as=\"span\">\n {index + 1}.\n </Text>\n ) : (\n leading\n )\n }\n title={title}\n subtitle={subtitle}\n trailing={trailing}\n titleSuffix={titleSuffix}\n isDisabled={isDisabled}\n showBackButton={false}\n showCloseButton={false}\n showDivider={false}\n paddingX=\"spacing.5\"\n marginY=\"spacing.5\"\n size={size}\n trailingInteractionElement={\n <CollapsibleChevronIcon\n color={isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'}\n size=\"large\"\n />\n }\n >\n {children}\n </BaseHeader>\n </BaseBox>\n );\n};\n\nconst AccordionItemHeader = assignWithoutSideEffects(_AccordionItemHeader, {\n componentId: componentIds.AccordionItemHeader,\n});\n\nexport { AccordionItemHeader };\n"],"names":["_AccordionItemHeader","_ref","title","subtitle","leading","children","trailing","titleSuffix","_useAccordion","useAccordion","size","showNumberPrefix","_useAccordionItemInde","useAccordionItemIndex","index","isDisabled","_jsx","BaseBox","Object","assign","metaAttribute","name","MetaConstants","AccordionItemHeader","flex","BaseHeader","_jsxs","Text","weight","marginTop","as","showBackButton","showCloseButton","showDivider","paddingX","marginY","trailingInteractionElement","CollapsibleChevronIcon","color","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,oBAAoB,CAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,CAUA,CATxB,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CACPC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CACRC,QAAQ,CAAAL,IAAA,CAARK,QAAQ,CACRC,WAAW,CAAAN,IAAA,CAAXM,WAAW,CAKX,IAAAC,aAAA,CAAmCC,YAAY,EAAE,CAAzC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mB,CAAGgB,wBAAwB,CAACvC,oBAAoB,CAAE,CACzEwC,WAAW,CAAEC,YAAY,CAAClB,mBAC5B,CAAC;;;;"}
1
+ {"version":3,"file":"AccordionItemHeader.js","sources":["../../../../../src/components/Accordion/AccordionItemHeader.tsx"],"sourcesContent":["import { useAccordion, useAccordionItemIndex } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CollapsibleChevronIcon } from '~components/Collapsible/CollapsibleChevronIcon';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _AccordionItemHeader = ({\n title,\n subtitle,\n leading,\n children,\n trailing,\n titleSuffix,\n ...rest\n}: Pick<\n BaseHeaderProps,\n 'title' | 'subtitle' | 'leading' | 'children' | 'trailing' | 'titleSuffix'\n> &\n DataAnalyticsAttribute): React.ReactElement => {\n const { size, showNumberPrefix } = useAccordion();\n const { index, isDisabled } = useAccordionItemIndex();\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemHeader })} flex=\"1\">\n <BaseHeader\n leading={\n showNumberPrefix && typeof index === 'number' ? (\n // we have to add -2px margin to align the number with title of BaseHeader\n <Text size={size} weight=\"semibold\" marginTop=\"-2px\" as=\"span\">\n {index + 1}.\n </Text>\n ) : (\n leading\n )\n }\n title={title}\n subtitle={subtitle}\n trailing={trailing}\n titleSuffix={titleSuffix}\n isDisabled={isDisabled}\n showBackButton={false}\n showCloseButton={false}\n showDivider={false}\n paddingX=\"spacing.5\"\n marginY=\"spacing.5\"\n size={size}\n trailingInteractionElement={\n <CollapsibleChevronIcon\n color={isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'}\n size=\"large\"\n />\n }\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseHeader>\n </BaseBox>\n );\n};\n\nconst AccordionItemHeader = assignWithoutSideEffects(_AccordionItemHeader, {\n componentId: componentIds.AccordionItemHeader,\n});\n\nexport { AccordionItemHeader };\n"],"names":["_AccordionItemHeader","_ref","title","subtitle","leading","children","trailing","titleSuffix","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","size","showNumberPrefix","_useAccordionItemInde","useAccordionItemIndex","index","isDisabled","_jsx","BaseBox","Object","assign","metaAttribute","name","MetaConstants","AccordionItemHeader","flex","BaseHeader","_jsxs","Text","weight","marginTop","as","showBackButton","showCloseButton","showDivider","paddingX","marginY","trailingInteractionElement","CollapsibleChevronIcon","color","makeAnalyticsAttribute","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,SAAA,CAAA,UAAA,CAAA,UAAA,CAAA,aAAA,CAAA,CAYA,IAAMA,oBAAoB,CAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,CAYuB,CAAA,IAX/CC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CACPC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CACRC,QAAQ,CAAAL,IAAA,CAARK,QAAQ,CACRC,WAAW,CAAAN,IAAA,CAAXM,WAAW,CACRC,IAAI,CAAAC,wBAAA,CAAAR,IAAA,CAAAS,SAAA,CAMP,CAAA,IAAAC,aAAA,CAAmCC,YAAY,EAAE,CAAzCC,IAAI,CAAAF,aAAA,CAAJE,IAAI,CAAEC,gBAAgB,CAAAH,aAAA,CAAhBG,gBAAgB,CAC9B,IAAAC,qBAAA,CAA8BC,qBAAqB,EAAE,CAA7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C,WAAW,CAAEC,YAAY,CAACnB,mBAC5B,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
2
  import React__default from 'react';
2
3
  import { getActionListContainerRole, getActionListItemWrapperRole } from './getA11yRoles.js';
3
4
  import { getActionListProperties } from './actionListUtils.js';
@@ -12,9 +13,10 @@ import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
12
13
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
13
14
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
14
15
  import { dropdownComponentIds } from '../Dropdown/dropdownComponentIds.js';
16
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
15
17
  import { jsx } from 'react/jsx-runtime';
16
18
 
17
- var _ActionList=function _ActionList(_ref){var children=_ref.children,testID=_ref.testID;var _useDropdown=useDropdown(),setOptions=_useDropdown.setOptions,actionListItemRef=_useDropdown.actionListItemRef,selectionType=_useDropdown.selectionType,dropdownBaseId=_useDropdown.dropdownBaseId,dropdownTriggerer=_useDropdown.dropdownTriggerer,hasFooterAction=_useDropdown.hasFooterAction,filteredValues=_useDropdown.filteredValues;var _useBottomSheetContex=useBottomSheetContext(),isInBottomSheet=_useBottomSheetContex.isInBottomSheet;var _React$useMemo=React__default.useMemo(function(){return getActionListProperties(children);},[children]),sectionData=_React$useMemo.sectionData,childrenWithId=_React$useMemo.childrenWithId,actionListOptions=_React$useMemo.actionListOptions;React__default.useEffect(function(){setOptions(actionListOptions);},[actionListOptions]);if(filteredValues.length<=0&&dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return jsx(ActionListNoResults,{});}var actionListContainerRole=getActionListContainerRole(hasFooterAction,dropdownTriggerer);var actionListItemWrapperRole=getActionListItemWrapperRole(hasFooterAction,dropdownTriggerer);var isMultiSelectable=selectionType==='multiple';return isInBottomSheet?jsx(ActionListBox,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef}):jsx(BaseBox,Object.assign({id:`${dropdownBaseId}-actionlist`},makeAccessible({role:actionListContainerRole,multiSelectable:actionListContainerRole==='listbox'?isMultiSelectable:undefined,labelledBy:`${dropdownBaseId}-label`}),metaAttribute({name:MetaConstants.ActionList,testID:testID}),{children:jsx(ActionListBox,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef})}));};var ActionList=assignWithoutSideEffects(React__default.memo(_ActionList),{displayName:componentIds.ActionList,componentId:componentIds.ActionList});
19
+ var _excluded=["children","testID"];var _ActionList=function _ActionList(_ref){var children=_ref.children,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),setOptions=_useDropdown.setOptions,actionListItemRef=_useDropdown.actionListItemRef,selectionType=_useDropdown.selectionType,dropdownBaseId=_useDropdown.dropdownBaseId,dropdownTriggerer=_useDropdown.dropdownTriggerer,hasFooterAction=_useDropdown.hasFooterAction,filteredValues=_useDropdown.filteredValues;var _useBottomSheetContex=useBottomSheetContext(),isInBottomSheet=_useBottomSheetContex.isInBottomSheet;var _React$useMemo=React__default.useMemo(function(){return getActionListProperties(children);},[children]),sectionData=_React$useMemo.sectionData,childrenWithId=_React$useMemo.childrenWithId,actionListOptions=_React$useMemo.actionListOptions;React__default.useEffect(function(){setOptions(actionListOptions);},[actionListOptions]);if(filteredValues.length<=0&&dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return jsx(ActionListNoResults,{});}var actionListContainerRole=getActionListContainerRole(hasFooterAction,dropdownTriggerer);var actionListItemWrapperRole=getActionListItemWrapperRole(hasFooterAction,dropdownTriggerer);var isMultiSelectable=selectionType==='multiple';return isInBottomSheet?jsx(ActionListBox,Object.assign({isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef},makeAnalyticsAttribute(rest))):jsx(BaseBox,Object.assign({id:`${dropdownBaseId}-actionlist`},makeAccessible({role:actionListContainerRole,multiSelectable:actionListContainerRole==='listbox'?isMultiSelectable:undefined,labelledBy:`${dropdownBaseId}-label`}),metaAttribute({name:MetaConstants.ActionList,testID:testID}),makeAnalyticsAttribute(rest),{children:jsx(ActionListBox,{isInBottomSheet:isInBottomSheet,actionListItemWrapperRole:actionListItemWrapperRole,childrenWithId:childrenWithId,sectionData:sectionData,isMultiSelectable:isMultiSelectable,ref:actionListItemRef})}));};var ActionList=assignWithoutSideEffects(React__default.memo(_ActionList),{displayName:componentIds.ActionList,componentId:componentIds.ActionList});
18
20
 
19
21
  export { ActionList };
20
22
  //# sourceMappingURL=ActionList.js.map
@@ -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 } 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 { TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\n\ntype ActionListProps = {\n children: React.ReactNode[];\n} & TestID;\n\nconst _ActionList = ({ children, testID }: ActionListProps): React.ReactElement => {\n const {\n setOptions,\n actionListItemRef,\n selectionType,\n dropdownBaseId,\n dropdownTriggerer,\n hasFooterAction,\n filteredValues,\n } = useDropdown();\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 />\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 >\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","_useDropdown","useDropdown","setOptions","actionListItemRef","selectionType","dropdownBaseId","dropdownTriggerer","hasFooterAction","filteredValues","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_React$useMemo","React","useMemo","getActionListProperties","sectionData","childrenWithId","actionListOptions","useEffect","length","dropdownComponentIds","triggers","AutoComplete","_jsx","ActionListNoResults","actionListContainerRole","getActionListContainerRole","actionListItemWrapperRole","getActionListItemWrapperRole","isMultiSelectable","ActionListBox","ref","BaseBox","Object","assign","id","makeAccessible","role","multiSelectable","undefined","labelledBy","metaAttribute","name","MetaConstants","ActionList","assignWithoutSideEffects","memo","displayName","componentIds","componentId"],"mappings":";;;;;;;;;;;;;;;;AAoBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAAkE,CAA5D,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACrC,IAAAC,YAAA,CAQIC,WAAW,EAAE,CAPfC,UAAU,CAAAF,YAAA,C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e,CAC/BD,WAAW,CAAEA,WAAY,CACzBc,iBAAiB,CAAEA,iBAAkB,CACrCE,GAAG,CAAE7B,iBAAyB,CAC/B,CAAC,CAEFqB,GAAA,CAACS,OAAO,CAAAC,MAAA,CAAAC,MAAA,EACNC,EAAE,CAAG,GAAE/B,cAAe,CAAA,WAAA,CAAa,EAC/BgC,cAAc,CAAC,CACjBC,IAAI,CAAEZ,uBAAuB,CAC7Ba,eAAe,CAAEb,uBAAuB,GAAK,SAAS,CAAGI,iBAAiB,CAAGU,SAAS,CACtFC,UAAU,CAAG,CAAEpC,EAAAA,cAAe,QAChC,CAAC,CAAC,CACEqC,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,UAAU,CAAE9C,MAAM,CAANA,MAAO,CAAC,CAAC,CAAA,CAAAD,QAAA,CAE7D0B,GAAA,CAACO,aAAa,CAAA,CACZpB,eAAe,CAAEA,eAAgB,CACjCiB,yBAAyB,CAAEA,yBAA0B,CACrDX,cAAc,CAAEA,cAAe,CAC/BD,WAAW,CAAEA,WAAY,CACzBc,iBAAiB,CAAEA,iBAAkB,CACrCE,GAAG,CAAE7B,iBAAyB,CAC/B,CAAC,EACK,CACV,CACH,CAAC,CAiCK,IAAA0C,UAAU,CAAGC,wBAAwB,CAACjC,cAAK,CAACkC,IAAI,CAACnD,WAAW,CAAC,CAAE,CACnEoD,WAAW,CAAEC,YAAY,CAACJ,UAAU,CACpCK,WAAW,CAAED,YAAY,CAACJ,UAC5B,CAAC;;;;"}
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 } 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} & TestID &\n DataAnalyticsAttribute;\n\nconst _ActionList = ({ children, testID, ...rest }: ActionListProps): React.ReactElement => {\n const {\n setOptions,\n actionListItemRef,\n selectionType,\n dropdownBaseId,\n dropdownTriggerer,\n hasFooterAction,\n filteredValues,\n } = useDropdown();\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","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","setOptions","actionListItemRef","selectionType","dropdownBaseId","dropdownTriggerer","hasFooterAction","filteredValues","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_React$useMemo","React","useMemo","getActionListProperties","sectionData","childrenWithId","actionListOptions","useEffect","length","dropdownComponentIds","triggers","AutoComplete","_jsx","ActionListNoResults","actionListContainerRole","getActionListContainerRole","actionListItemWrapperRole","getActionListItemWrapperRole","isMultiSelectable","ActionListBox","Object","assign","ref","makeAnalyticsAttribute","BaseBox","id","makeAccessible","role","multiSelectable","undefined","labelledBy","metaAttribute","name","MetaConstants","ActionList","assignWithoutSideEffects","memo","displayName","componentIds","componentId"],"mappings":";;;;;;;;;;;;;;;;;;oCAsBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAA2E,KAArEC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,MAAM,CAAAF,IAAA,CAANE,MAAM,CAAKC,IAAI,CAAAC,wBAAA,CAAAJ,IAAA,CAAAK,SAAA,CAC9C,CAAA,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,CAAjBM,iBAAiB,CACjBC,eAAe,CAAAP,YAAA,CAAfO,eAAe,CACfC,cAAc,CAAAR,YAAA,CAAdQ,cAAc,CAGhB,IAAAC,qBAAA,CAA4BC,qBAAqB,EAAE,CAA3CC,eAAe,CAAAF,qBAAA,CAAfE,eAAe,CAEvB,IAAAC,cAAA,CAA2DC,cAAK,CAACC,OAAO,CACtE,UAAA,CAAA,OAAMC,uBAAuB,CAACpB,QAAQ,CAAC,GACvC,CAACA,QAAQ,CACX,CAAC,CAHOqB,WAAW,CAAAJ,cAAA,CAAXI,WAAW,CAAEC,cAAc,CAAAL,cAAA,CAAdK,cAAc,CAAEC,iBAAiB,CAAAN,cAAA,CAAjBM,iBAAiB,CAKtDL,cAAK,CAACM,SAAS,CAAC,UAAM,CACpBjB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AAA,CACZpB,eAAe,CAAEA,eAAgB,CACjCiB,yBAAyB,CAAEA,yBAA0B,CACrDX,cAAc,CAAEA,cAAe,CAC/BD,WAAW,CAAEA,WAAY,CACzBc,iBAAiB,CAAEA,iBAAkB,CACrCI,GAAG,CAAE/B,iBAAyB,CAC/B,CAAC,CACK,CAAA,CACV,CACH,CAAC,CAiCK,IAAA2C,UAAU,CAAGC,wBAAwB,CAAClC,cAAK,CAACmC,IAAI,CAACvD,WAAW,CAAC,CAAE,CACnEwD,WAAW,CAAEC,YAAY,CAACJ,UAAU,CACpCK,WAAW,CAAED,YAAY,CAACJ,UAC5B,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
2
  import React__default from 'react';
2
3
  import styled from 'styled-components/native';
3
4
  import { componentIds } from './componentIds.js';
@@ -6,7 +7,6 @@ import { getActionListItemRole, getActionListSectionRole } from './getA11yRoles.
6
7
  import { Divider } from '../Divider/Divider.js';
7
8
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
8
9
  import { useDropdown } from '../Dropdown/useDropdown.js';
9
- import '@babel/runtime/helpers/objectWithoutProperties';
10
10
  import '../Typography/BaseText/BaseText.native.js';
11
11
  import { throwBladeError } from '../../utils/logger/logger.js';
12
12
  import '@babel/runtime/helpers/slicedToArray';
@@ -37,9 +37,10 @@ import '../BottomSheet/BottomSheetStack.js';
37
37
  import 'react-native-svg';
38
38
  import '../Icons/_Svg/Svg/Svg.native.js';
39
39
  import '../VisuallyHidden/VisuallyHidden.native.js';
40
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
40
41
  import { Avatar } from '../Avatar/Avatar.native.js';
41
42
 
42
- var StyledActionListSectionTitle=styled(BaseBox)(function(props){return {padding:makeSize(props.theme.spacing[3])};});var _ActionListSection=function _ActionListSection(_ref){var title=_ref.title,children=_ref.children,testID=_ref.testID,_hideDivider=_ref._hideDivider,_sectionChildValues=_ref._sectionChildValues;var _useDropdown=useDropdown(),hasAutoCompleteInBottomSheetHeader=_useDropdown.hasAutoCompleteInBottomSheetHeader,dropdownTriggerer=_useDropdown.dropdownTriggerer,filteredValues=_useDropdown.filteredValues;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var isSectionVisible=React__default.useMemo(function(){if(hasAutoComplete){var visibleActionListItemInSection=_sectionChildValues==null?void 0:_sectionChildValues.find(function(actionItemValue){return filteredValues.includes(actionItemValue);});return Boolean(visibleActionListItemInSection);}return true;},[_sectionChildValues,hasAutoComplete,filteredValues]);var showDividerInRN=!(_hideDivider&&isReactNative());var showDividerInAutoComplete=hasAutoComplete?isSectionVisible&&filteredValues.length>1:true;return jsxs(BaseBox,Object.assign({},makeAccessible({role:getActionListSectionRole(),label:title}),metaAttribute({name:MetaConstants.ActionListSection,testID:testID}),{children:[isSectionVisible?jsx(StyledActionListSectionTitle,Object.assign({},makeAccessible({hidden:true}),{children:jsx(Text,{color:"surface.text.gray.muted",size:"small",weight:"semibold",children:title})})):null,jsx(BaseBox,Object.assign({},makeAccessible({role:isReactNative()?undefined:'listbox'}),{children:children})),showDividerInAutoComplete&&showDividerInRN?jsx(Divider,{marginX:"spacing.3",marginY:"spacing.1"}):null]}));};var ActionListSection=assignWithoutSideEffects(_ActionListSection,{componentId:componentIds.ActionListSection});var _ActionListItemIcon=function _ActionListItemIcon(_ref2){var icon=_ref2.icon;var Icon=icon;var _useBaseMenuItem=useBaseMenuItem(),color=_useBaseMenuItem.color,isDisabled=_useBaseMenuItem.isDisabled;var iconState=isDisabled?'disabled':'muted';return jsx(Icon,{color:color==='negative'?'feedback.icon.negative.intense':`interactive.icon.gray.${iconState}`,size:"medium"});};var ActionListItemIcon=assignWithoutSideEffects(_ActionListItemIcon,{componentId:componentIds.ActionListItemIcon});var _ActionListItemBadgeGroup=function _ActionListItemBadgeGroup(_ref3){var children=_ref3.children;return jsx(Box,{display:"flex",alignItems:"center",flexDirection:"row",children:children});};var ActionListItemBadgeGroup=assignWithoutSideEffects(_ActionListItemBadgeGroup,{componentId:componentIds.ActionListItemBadgeGroup});var _ActionListItemAvatar=function _ActionListItemAvatar(avatarProps){return jsx(Avatar,Object.assign({size:"xsmall"},avatarProps));};var ActionListItemAvatar=assignWithoutSideEffects(_ActionListItemAvatar,{componentId:componentIds.ActionListItemAvatar});var _ActionListItemBadge=function _ActionListItemBadge(props){return jsx(Badge,Object.assign({size:"medium",marginLeft:"spacing.3"},props));};var ActionListItemBadge=assignWithoutSideEffects(_ActionListItemBadge,{componentId:componentIds.ActionListItemBadge});var _ActionListItemText=function _ActionListItemText(_ref4){var children=_ref4.children;var _useBaseMenuItem2=useBaseMenuItem(),isDisabled=_useBaseMenuItem2.isDisabled;return jsx(Text,{variant:"caption",color:getNormalTextColor(isDisabled,{isMuted:true}),children:children});};var ActionListItemText=assignWithoutSideEffects(_ActionListItemText,{componentId:componentIds.ActionListItemText});var makeActionListItemClickable=function makeActionListItemClickable(clickHandler){if(isReactNative()){return {onPress:clickHandler};}return {onClick:clickHandler};};var _ActionListItem=function _ActionListItem(props){var _useDropdown2=useDropdown(),activeIndex=_useDropdown2.activeIndex,dropdownBaseId=_useDropdown2.dropdownBaseId,onOptionClick=_useDropdown2.onOptionClick,selectedIndices=_useDropdown2.selectedIndices,setShouldIgnoreBlurAnimation=_useDropdown2.setShouldIgnoreBlurAnimation,selectionType=_useDropdown2.selectionType,dropdownTriggerer=_useDropdown2.dropdownTriggerer,isKeydownPressed=_useDropdown2.isKeydownPressed,filteredValues=_useDropdown2.filteredValues,hasAutoCompleteInBottomSheetHeader=_useDropdown2.hasAutoCompleteInBottomSheetHeader;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var renderOnWebAs=props.href?'a':'button';var getIsSelected=function getIsSelected(){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput||hasAutoComplete){if(typeof props._index==='number'){return selectedIndices.includes(props._index);}return undefined;}return props.isSelected;};var isSelected=getIsSelected();React__default.useEffect(function(){validateActionListItemProps({leading:props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix});},[props.leading,props.trailing,props.titleSuffix]);React__default.useEffect(function(){if(__DEV__){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput&&props.intent==='negative'){throwBladeError({message:'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',moduleName:'ActionListItem'});}}},[props.intent,dropdownTriggerer]);return jsx(BaseMenuItem,Object.assign({isVisible:hasAutoComplete&&filteredValues?filteredValues.includes(props.value):true,as:!isReactNative()?renderOnWebAs:undefined,id:`${dropdownBaseId}-${props._index}`,tabIndex:-1,title:props.title,description:props.description,leading:selectionType==='multiple'?jsx(BaseBox,Object.assign({pointerEvents:"none"},makeAccessible({hidden:true}),{children:jsx(Checkbox,{isChecked:isSelected,tabIndex:-1,isDisabled:props.isDisabled,children:null})})):props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix,href:props.href,target:props.target,className:activeIndex===props._index?'active-focus':'',isSelected:isSelected,isDisabled:props.isDisabled,role:getActionListItemRole(dropdownTriggerer,props.href)},makeActionListItemClickable(function(e){if(typeof props._index==='number'){onOptionClick(e,props._index);props.onClick==null?void 0:props.onClick({name:props.value,value:isSelected,event:castWebType(e)});}}),metaAttribute({name:MetaConstants.ActionListItem,testID:props.testID}),{onMouseDown:function onMouseDown(){setShouldIgnoreBlurAnimation(true);},onMouseUp:function onMouseUp(){setShouldIgnoreBlurAnimation(false);},"data-value":props.value,"data-index":props._index,selectionType:selectionType,color:props.intent,isKeydownPressed:isKeydownPressed}));};var ActionListItem=assignWithoutSideEffects(React__default.memo(_ActionListItem),{componentId:componentIds.ActionListItem,displayName:componentIds.ActionListItem});
43
+ var _excluded=["title","children","testID","_hideDivider","_sectionChildValues"];var StyledActionListSectionTitle=styled(BaseBox)(function(props){return {padding:makeSize(props.theme.spacing[3])};});var _ActionListSection=function _ActionListSection(_ref){var title=_ref.title,children=_ref.children,testID=_ref.testID,_hideDivider=_ref._hideDivider,_sectionChildValues=_ref._sectionChildValues,rest=_objectWithoutProperties(_ref,_excluded);var _useDropdown=useDropdown(),hasAutoCompleteInBottomSheetHeader=_useDropdown.hasAutoCompleteInBottomSheetHeader,dropdownTriggerer=_useDropdown.dropdownTriggerer,filteredValues=_useDropdown.filteredValues;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var isSectionVisible=React__default.useMemo(function(){if(hasAutoComplete){var visibleActionListItemInSection=_sectionChildValues==null?void 0:_sectionChildValues.find(function(actionItemValue){return filteredValues.includes(actionItemValue);});return Boolean(visibleActionListItemInSection);}return true;},[_sectionChildValues,hasAutoComplete,filteredValues]);var showDividerInRN=!(_hideDivider&&isReactNative());var showDividerInAutoComplete=hasAutoComplete?isSectionVisible&&filteredValues.length>1:true;return jsxs(BaseBox,Object.assign({},makeAccessible({role:getActionListSectionRole(),label:title}),metaAttribute({name:MetaConstants.ActionListSection,testID:testID}),makeAnalyticsAttribute(rest),{children:[isSectionVisible?jsx(StyledActionListSectionTitle,Object.assign({},makeAccessible({hidden:true}),{children:jsx(Text,{color:"surface.text.gray.muted",size:"small",weight:"semibold",children:title})})):null,jsx(BaseBox,Object.assign({},makeAccessible({role:isReactNative()?undefined:'listbox'}),{children:children})),showDividerInAutoComplete&&showDividerInRN?jsx(Divider,{marginX:"spacing.3",marginY:"spacing.1"}):null]}));};var ActionListSection=assignWithoutSideEffects(_ActionListSection,{componentId:componentIds.ActionListSection});var _ActionListItemIcon=function _ActionListItemIcon(_ref2){var icon=_ref2.icon;var Icon=icon;var _useBaseMenuItem=useBaseMenuItem(),color=_useBaseMenuItem.color,isDisabled=_useBaseMenuItem.isDisabled;var iconState=isDisabled?'disabled':'muted';return jsx(Icon,{color:color==='negative'?'feedback.icon.negative.intense':`interactive.icon.gray.${iconState}`,size:"medium"});};var ActionListItemIcon=assignWithoutSideEffects(_ActionListItemIcon,{componentId:componentIds.ActionListItemIcon});var _ActionListItemBadgeGroup=function _ActionListItemBadgeGroup(_ref3){var children=_ref3.children;return jsx(Box,{display:"flex",alignItems:"center",flexDirection:"row",children:children});};var ActionListItemBadgeGroup=assignWithoutSideEffects(_ActionListItemBadgeGroup,{componentId:componentIds.ActionListItemBadgeGroup});var _ActionListItemAvatar=function _ActionListItemAvatar(avatarProps){return jsx(Avatar,Object.assign({size:"xsmall"},avatarProps));};var ActionListItemAvatar=assignWithoutSideEffects(_ActionListItemAvatar,{componentId:componentIds.ActionListItemAvatar});var _ActionListItemBadge=function _ActionListItemBadge(props){return jsx(Badge,Object.assign({size:"medium",marginLeft:"spacing.3"},props));};var ActionListItemBadge=assignWithoutSideEffects(_ActionListItemBadge,{componentId:componentIds.ActionListItemBadge});var _ActionListItemText=function _ActionListItemText(_ref4){var children=_ref4.children;var _useBaseMenuItem2=useBaseMenuItem(),isDisabled=_useBaseMenuItem2.isDisabled;return jsx(Text,{variant:"caption",color:getNormalTextColor(isDisabled,{isMuted:true}),children:children});};var ActionListItemText=assignWithoutSideEffects(_ActionListItemText,{componentId:componentIds.ActionListItemText});var makeActionListItemClickable=function makeActionListItemClickable(clickHandler){if(isReactNative()){return {onPress:clickHandler};}return {onClick:clickHandler};};var _ActionListItem=function _ActionListItem(props){var _useDropdown2=useDropdown(),activeIndex=_useDropdown2.activeIndex,dropdownBaseId=_useDropdown2.dropdownBaseId,onOptionClick=_useDropdown2.onOptionClick,selectedIndices=_useDropdown2.selectedIndices,setShouldIgnoreBlurAnimation=_useDropdown2.setShouldIgnoreBlurAnimation,selectionType=_useDropdown2.selectionType,dropdownTriggerer=_useDropdown2.dropdownTriggerer,isKeydownPressed=_useDropdown2.isKeydownPressed,filteredValues=_useDropdown2.filteredValues,hasAutoCompleteInBottomSheetHeader=_useDropdown2.hasAutoCompleteInBottomSheetHeader;var hasAutoComplete=hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;var renderOnWebAs=props.href?'a':'button';var getIsSelected=function getIsSelected(){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput||hasAutoComplete){if(typeof props._index==='number'){return selectedIndices.includes(props._index);}return undefined;}return props.isSelected;};var isSelected=getIsSelected();React__default.useEffect(function(){validateActionListItemProps({leading:props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix});},[props.leading,props.trailing,props.titleSuffix]);React__default.useEffect(function(){if(__DEV__){if(dropdownTriggerer===dropdownComponentIds.triggers.SelectInput&&props.intent==='negative'){throwBladeError({message:'negative intent ActionListItem cannot be used inside Dropdown with SelectInput trigger',moduleName:'ActionListItem'});}}},[props.intent,dropdownTriggerer]);return jsx(BaseMenuItem,Object.assign({isVisible:hasAutoComplete&&filteredValues?filteredValues.includes(props.value):true,as:!isReactNative()?renderOnWebAs:undefined,id:`${dropdownBaseId}-${props._index}`,tabIndex:-1,title:props.title,description:props.description,leading:selectionType==='multiple'?jsx(BaseBox,Object.assign({pointerEvents:"none"},makeAccessible({hidden:true}),{children:jsx(Checkbox,{isChecked:isSelected,tabIndex:-1,isDisabled:props.isDisabled,children:null})})):props.leading,trailing:props.trailing,titleSuffix:props.titleSuffix,href:props.href,target:props.target,className:activeIndex===props._index?'active-focus':'',isSelected:isSelected,isDisabled:props.isDisabled,role:getActionListItemRole(dropdownTriggerer,props.href)},makeActionListItemClickable(function(e){if(typeof props._index==='number'){onOptionClick(e,props._index);props.onClick==null?void 0:props.onClick({name:props.value,value:isSelected,event:castWebType(e)});}}),makeAnalyticsAttribute(Object.assign({},props)),metaAttribute({name:MetaConstants.ActionListItem,testID:props.testID}),{onMouseDown:function onMouseDown(){setShouldIgnoreBlurAnimation(true);},onMouseUp:function onMouseUp(){setShouldIgnoreBlurAnimation(false);},"data-value":props.value,"data-index":props._index,selectionType:selectionType,color:props.intent,isKeydownPressed:isKeydownPressed}));};var ActionListItem=assignWithoutSideEffects(React__default.memo(_ActionListItem),{componentId:componentIds.ActionListItem,displayName:componentIds.ActionListItem});
43
44
 
44
45
  export { ActionListItem, ActionListItemAvatar, ActionListItemBadge, ActionListItemBadgeGroup, ActionListItemIcon, ActionListItemText, ActionListSection };
45
46
  //# sourceMappingURL=ActionListItem.js.map
@@ -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 { 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';\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} & TestID;\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;\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInBottomSheetHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n 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 >\n {/* We're announcing title as group label so we can hide this */}\n {isSectionVisible ? (\n <StyledActionListSectionTitle {...makeAccessible({ hidden: true })}>\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n ) : null}\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(_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\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 hasAutoCompleteInBottomSheetHeader,\n } = useDropdown();\n\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n\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 (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\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 return (\n // We use this context to change the color of subcomponents like ActionListItemIcon, ActionListItemText, etc\n <BaseMenuItem\n isVisible={hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true}\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 <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={props.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 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 {...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};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","props","padding","makeSize","theme","spacing","_ActionListSection","_ref","title","children","testID","_hideDivider","_sectionChildValues","_useDropdown","useDropdown","hasAutoCompleteInBottomSheetHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","Object","assign","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentId","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","ActionListItemIcon","_ActionListItemBadgeGroup","_ref3","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref4","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","renderOnWebAs","href","getIsSelected","SelectInput","_index","isSelected","useEffect","validateActionListItemProps","leading","trailing","titleSuffix","__DEV__","intent","throwBladeError","message","moduleName","BaseMenuItem","isVisible","value","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,IAAMA,4BAA4B,CAAGC,MAAM,CAACC,OAAO,CAAC,CAAC,SAACC,KAAK,CAAA,CAAA,OAAM,CAE/DC,OAAO,CAAEC,QAAQ,CAACF,KAAK,CAACG,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC,CAC1C,CAAC,CAAA,CAAC,CAAC,CAoBH,IAAMC,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAAC,IAAA,CAM0B,KALh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/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} & 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;\nconst _ActionListSection = ({\n title,\n children,\n testID,\n _hideDivider,\n _sectionChildValues,\n ...rest\n}: ActionListSectionProps): React.ReactElement => {\n const { hasAutoCompleteInBottomSheetHeader, dropdownTriggerer, filteredValues } = useDropdown();\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n 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 ? (\n <StyledActionListSectionTitle {...makeAccessible({ hidden: true })}>\n <Text color=\"surface.text.gray.muted\" size=\"small\" weight=\"semibold\">\n {title}\n </Text>\n </StyledActionListSectionTitle>\n ) : null}\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(_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\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 hasAutoCompleteInBottomSheetHeader,\n } = useDropdown();\n\n const hasAutoComplete =\n hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n\n const renderOnWebAs = props.href ? 'a' : 'button';\n\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 (dropdownTriggerer === dropdownComponentIds.triggers.SelectInput || hasAutoComplete) {\n if (typeof props._index === 'number') {\n return selectedIndices.includes(props._index);\n }\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 return (\n // We use this context to change the color of subcomponents like ActionListItemIcon, ActionListItemText, etc\n <BaseMenuItem\n isVisible={hasAutoComplete && filteredValues ? filteredValues.includes(props.value) : true}\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 <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={props.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 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};\n"],"names":["StyledActionListSectionTitle","styled","BaseBox","props","padding","makeSize","theme","spacing","_ActionListSection","_ref","title","children","testID","_hideDivider","_sectionChildValues","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","hasAutoCompleteInBottomSheetHeader","dropdownTriggerer","filteredValues","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","isSectionVisible","React","useMemo","visibleActionListItemInSection","find","actionItemValue","includes","Boolean","showDividerInRN","isReactNative","showDividerInAutoComplete","length","_jsxs","Object","assign","makeAccessible","role","getActionListSectionRole","label","metaAttribute","name","MetaConstants","ActionListSection","makeAnalyticsAttribute","_jsx","hidden","Text","color","size","weight","undefined","Divider","marginX","marginY","assignWithoutSideEffects","componentId","componentIds","_ActionListItemIcon","_ref2","icon","Icon","_useBaseMenuItem","useBaseMenuItem","isDisabled","iconState","ActionListItemIcon","_ActionListItemBadgeGroup","_ref3","Box","display","alignItems","flexDirection","ActionListItemBadgeGroup","_ActionListItemAvatar","avatarProps","Avatar","ActionListItemAvatar","_ActionListItemBadge","Badge","marginLeft","ActionListItemBadge","_ActionListItemText","_ref4","_useBaseMenuItem2","variant","getNormalTextColor","isMuted","ActionListItemText","makeActionListItemClickable","clickHandler","onPress","onClick","_ActionListItem","_useDropdown2","activeIndex","dropdownBaseId","onOptionClick","selectedIndices","setShouldIgnoreBlurAnimation","selectionType","isKeydownPressed","renderOnWebAs","href","getIsSelected","SelectInput","_index","isSelected","useEffect","validateActionListItemProps","leading","trailing","titleSuffix","__DEV__","intent","throwBladeError","message","moduleName","BaseMenuItem","isVisible","value","as","id","tabIndex","description","pointerEvents","Checkbox","isChecked","target","className","getActionListItemRole","e","event","castWebType","ActionListItem","onMouseDown","onMouseUp","memo","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,UAAA,CAAA,QAAA,CAAA,cAAA,CAAA,qBAAA,CAAA,CA2FA,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,EAAC,CAAC,CA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CAAG/E,wBAAwB,CAACjC,cAAK,CAACmH,IAAI,CAAC5C,eAAe,CAAC,CAAE,CAC3ErC,WAAW,CAAEC,YAAY,CAAC6E,cAAc,CACxCI,WAAW,CAAEjF,YAAY,CAAC6E,cAC5B,CAAC;;;;"}
@@ -32,8 +32,9 @@ import '../Typography/Code/Code.js';
32
32
  import BaseButton from '../Button/BaseButton/BaseButton.js';
33
33
  import BaseLink from '../Link/BaseLink/BaseLink.js';
34
34
  import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.native.js';
35
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
35
36
 
36
- var _excluded=["description","title","isDismissible","onDismiss","emphasis","isFullWidth","color","actions","testID","icon"];var isReactNative=getPlatformType()==='react-native';var CloseButtonWrapper=isReactNative?BaseBox:Fragment;var intentIconMap={positive:CheckCircleIcon,negative:AlertOctagonIcon,information:InfoIcon,neutral:InfoIcon,notice:AlertTriangleIcon};var Alert=function Alert(_ref){var description=_ref.description,title=_ref.title,_ref$isDismissible=_ref.isDismissible,isDismissible=_ref$isDismissible===void 0?true:_ref$isDismissible,onDismiss=_ref.onDismiss,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,actions=_ref.actions,testID=_ref.testID,icon=_ref.icon,styledProps=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var _useState=useState(true),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var isDesktop=matchedDeviceType==='desktop';var isMobile=!isDesktop;var Icon=icon!=null?icon:intentIconMap[color];var iconOffset='spacing.1';if(isReactNative){if(isFullWidth&&!title){iconOffset='spacing.1';}else if(!isFullWidth&&!title){iconOffset='spacing.0';}else if(!isFullWidth&&title){iconOffset='spacing.2';}}else if(isMobile){if(!isFullWidth&&title){iconOffset='spacing.2';}else if(isFullWidth&&!title){iconOffset='spacing.2';}}else if(isFullWidth){iconOffset='spacing.1';}var shouldCenterAlign=isFullWidth&&!title;var alignment='flex-start';if(!isFullWidth)alignment='flex-start';if(shouldCenterAlign)alignment='center';var leadingIcon=jsx(BaseBox,{display:"flex",alignSelf:alignment,marginTop:iconOffset,children:jsx(Icon,{color:emphasis==='intense'?'surface.icon.staticWhite.normal':`feedback.icon.${color}.${emphasis==='subtle'?'intense':'subtle'}`,size:"medium"})});var textColor=emphasis==='intense'?'surface.text.staticWhite.normal':'surface.text.gray.subtle';var _title=title?jsx(BaseBox,{marginBottom:"spacing.2",children:jsx(Text,{color:textColor,size:"medium",weight:"semibold",children:title})}):null;var _description=jsx(BaseBox,{marginTop:title||isReactNative?'spacing.0':'spacing.1',children:jsx(Text,{color:textColor,size:"small",children:description})});var primaryAction=actions!=null&&actions.primary?jsx(BaseBox,{marginRight:"spacing.5",display:isReactNative?castNativeType('flex'):castWebType('inline-flex'),children:jsx(BaseButton,{size:"small",onClick:actions.primary.onClick,color:emphasis==='intense'?'white':color,variant:"secondary",children:actions.primary.text})}):null;var secondaryActionParams=actions!=null&&actions.secondary?{onClick:actions.secondary.onClick}:null;if(actions!=null&&actions.secondary&&secondaryActionParams&&'href'in actions.secondary){secondaryActionParams.href=actions.secondary.href;secondaryActionParams.target=actions.secondary.target;secondaryActionParams.rel=actions.secondary.rel;}var secondaryAction=actions!=null&&actions.secondary?jsx(BaseBox,{marginRight:"spacing.4",display:isReactNative?'flex':'inline-flex',children:jsx(BaseLink,Object.assign({size:"small",color:emphasis==='intense'?'white':color},secondaryActionParams,{children:actions.secondary.text}))}):null;var showActionsHorizontal=isFullWidth&&isDesktop;var actionsHorizontal=showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var actionsVertical=!showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{marginTop:"spacing.4",flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var onClickDismiss=function onClickDismiss(){if(onDismiss){onDismiss();}setIsVisible(false);};var closeButton=isDismissible?jsx(CloseButtonWrapper,{children:jsx(IconButton,{accessibilityLabel:"Dismiss alert",onClick:onClickDismiss,emphasis:emphasis==='intense'?'subtle':'intense',size:"large",icon:CloseIcon})}):null;var a11yProps=makeAccessible(Object.assign({role:isReactNative||color==='negative'||color==='notice'?'alert':'status'},color==='notice'&&{liveRegion:'polite'}));if(!isVisible){return null;}return jsx(BaseBox,Object.assign({},a11yProps,metaAttribute({name:MetaConstants.Alert,testID:testID}),getStyledProps(styledProps),{children:jsxs(StyledAlert,{color:color,emphasis:emphasis,isFullWidth:isFullWidth,isDesktop:isDesktop,textAlign:'left',children:[leadingIcon,jsxs(BaseBox,{flex:1,paddingLeft:isFullWidth?'spacing.4':'spacing.3',paddingRight:showActionsHorizontal?'spacing.4':'spacing.2',children:[_title,_description,actionsVertical]}),actionsHorizontal,closeButton]})}));};
37
+ var _excluded=["description","title","isDismissible","onDismiss","emphasis","isFullWidth","color","actions","testID","icon"];var isReactNative=getPlatformType()==='react-native';var CloseButtonWrapper=isReactNative?BaseBox:Fragment;var intentIconMap={positive:CheckCircleIcon,negative:AlertOctagonIcon,information:InfoIcon,neutral:InfoIcon,notice:AlertTriangleIcon};var Alert=function Alert(_ref){var description=_ref.description,title=_ref.title,_ref$isDismissible=_ref.isDismissible,isDismissible=_ref$isDismissible===void 0?true:_ref$isDismissible,onDismiss=_ref.onDismiss,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,actions=_ref.actions,testID=_ref.testID,icon=_ref.icon,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var _useState=useState(true),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var isDesktop=matchedDeviceType==='desktop';var isMobile=!isDesktop;var Icon=icon!=null?icon:intentIconMap[color];var iconOffset='spacing.1';if(isReactNative){if(isFullWidth&&!title){iconOffset='spacing.1';}else if(!isFullWidth&&!title){iconOffset='spacing.0';}else if(!isFullWidth&&title){iconOffset='spacing.2';}}else if(isMobile){if(!isFullWidth&&title){iconOffset='spacing.2';}else if(isFullWidth&&!title){iconOffset='spacing.2';}}else if(isFullWidth){iconOffset='spacing.1';}var shouldCenterAlign=isFullWidth&&!title;var alignment='flex-start';if(!isFullWidth)alignment='flex-start';if(shouldCenterAlign)alignment='center';var leadingIcon=jsx(BaseBox,{display:"flex",alignSelf:alignment,marginTop:iconOffset,children:jsx(Icon,{color:emphasis==='intense'?'surface.icon.staticWhite.normal':`feedback.icon.${color}.${emphasis==='subtle'?'intense':'subtle'}`,size:"medium"})});var textColor=emphasis==='intense'?'surface.text.staticWhite.normal':'surface.text.gray.subtle';var _title=title?jsx(BaseBox,{marginBottom:"spacing.2",children:jsx(Text,{color:textColor,size:"medium",weight:"semibold",children:title})}):null;var _description=jsx(BaseBox,{marginTop:title||isReactNative?'spacing.0':'spacing.1',children:jsx(Text,{color:textColor,size:"small",children:description})});var primaryAction=actions!=null&&actions.primary?jsx(BaseBox,{marginRight:"spacing.5",display:isReactNative?castNativeType('flex'):castWebType('inline-flex'),children:jsx(BaseButton,{size:"small",onClick:actions.primary.onClick,color:emphasis==='intense'?'white':color,variant:"secondary",children:actions.primary.text})}):null;var secondaryActionParams=actions!=null&&actions.secondary?{onClick:actions.secondary.onClick}:null;if(actions!=null&&actions.secondary&&secondaryActionParams&&'href'in actions.secondary){secondaryActionParams.href=actions.secondary.href;secondaryActionParams.target=actions.secondary.target;secondaryActionParams.rel=actions.secondary.rel;}var secondaryAction=actions!=null&&actions.secondary?jsx(BaseBox,{marginRight:"spacing.4",display:isReactNative?'flex':'inline-flex',children:jsx(BaseLink,Object.assign({size:"small",color:emphasis==='intense'?'white':color},secondaryActionParams,{children:actions.secondary.text}))}):null;var showActionsHorizontal=isFullWidth&&isDesktop;var actionsHorizontal=showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var actionsVertical=!showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{marginTop:"spacing.4",flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var onClickDismiss=function onClickDismiss(){if(onDismiss){onDismiss();}setIsVisible(false);};var closeButton=isDismissible?jsx(CloseButtonWrapper,{children:jsx(IconButton,{accessibilityLabel:"Dismiss alert",onClick:onClickDismiss,emphasis:emphasis==='intense'?'subtle':'intense',size:"large",icon:CloseIcon})}):null;var a11yProps=makeAccessible(Object.assign({role:isReactNative||color==='negative'||color==='notice'?'alert':'status'},color==='notice'&&{liveRegion:'polite'}));if(!isVisible){return null;}return jsx(BaseBox,Object.assign({},a11yProps,metaAttribute({name:MetaConstants.Alert,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(StyledAlert,{color:color,emphasis:emphasis,isFullWidth:isFullWidth,isDesktop:isDesktop,textAlign:'left',children:[leadingIcon,jsxs(BaseBox,{flex:1,paddingLeft:isFullWidth?'spacing.4':'spacing.3',paddingRight:showActionsHorizontal?'spacing.4':'spacing.2',children:[_title,_description,actionsVertical]}),actionsHorizontal,closeButton]})}));};
37
38
 
38
39
  export { Alert };
39
40
  //# sourceMappingURL=Alert.js.map