@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
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { useChipGroupContext } from './ChipGroupContext';\nimport {\n chipIconSizes,\n chipTextSizes,\n chipColorTokens,\n getChipInputHoverTokens,\n chipHeightTokens,\n chipHorizontalPaddingTokens,\n} from './chipTokens';\nimport type { ChipProps } from './types';\nimport { AnimatedChip } from './AnimatedChip';\nimport { StyledChipWrapper } from './StyledChipWrapper';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { SelectorLabel } from '~components/Form/Selector/SelectorLabel';\nimport { SelectorInput } from '~components/Form/Selector/SelectorInput';\nimport type { BladeElementRef } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { useCheckbox } from '~components/Checkbox/useCheckbox';\nimport { useRadio } from '~components/Radio/useRadio';\nimport { isReactNative, makeSize, useBreakpoint } from '~utils';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\n\ntype OnChange = ({\n isChecked,\n event,\n value,\n}: {\n isChecked: boolean;\n event?: React.ChangeEvent;\n value?: string;\n}) => void;\n\nconst _Chip: React.ForwardRefRenderFunction<BladeElementRef, ChipProps> = (\n { isDisabled, value, children, icon: Icon, color, testID, ...styledProps },\n ref,\n) => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const groupProps = useChipGroupContext();\n const isInsideGroup = !isEmpty(groupProps);\n const [isPressed, setIsPressed] = React.useState(false);\n\n if (__DEV__) {\n if (!isInsideGroup) {\n throwBladeError({\n moduleName: 'Chip',\n message:\n '<Chip /> component should only be used within the context of a <ChipGroup /> component',\n });\n }\n }\n\n const hasError = groupProps?.validationState === 'error';\n const _isDisabled = isDisabled ?? groupProps?.isDisabled;\n const _isRequired = groupProps?.isRequired || groupProps?.necessityIndicator === 'required';\n const _name = groupProps?.name;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const _isChecked = groupProps?.state?.isChecked(value!);\n // Check if the defaultValue property of groupProps is undefined\n const defaultChecked =\n typeof groupProps?.defaultValue === 'undefined'\n ? undefined // If undefined, defaultChecked is also undefined\n : groupProps?.defaultValue?.includes(value as string); // If multiple selection, check if value is in defaultValue array\n const useChip = groupProps?.selectionType === 'single' ? useRadio : useCheckbox;\n const _size = groupProps?.size || 'small';\n const chipColor = color ?? groupProps?.color ?? 'primary';\n\n const handleChange: OnChange = ({ isChecked, value }) => {\n if (isChecked) {\n groupProps?.state?.addValue(value!);\n } else {\n groupProps?.state?.removeValue(value!);\n }\n };\n\n const { state, inputProps } = useChip({\n defaultChecked,\n isChecked: _isChecked,\n isDisabled: _isDisabled,\n isRequired: _isRequired,\n hasError,\n name: _name,\n value,\n onChange: handleChange,\n });\n\n const handlePointerPressedIn = React.useCallback(() => {\n if (_isDisabled) return;\n setIsPressed(true);\n }, [_isDisabled]);\n\n const handlePointerPressedOut = React.useCallback(() => {\n if (_isDisabled) return;\n setIsPressed(false);\n }, [_isDisabled]);\n\n const handleKeyboardPressedIn = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (_isDisabled) return;\n if (e.key === ' ') {\n setIsPressed(true);\n }\n },\n [_isDisabled],\n );\n\n const handleKeyboardPressedOut = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (_isDisabled) return;\n if (e.key === ' ') {\n setIsPressed(false);\n }\n },\n [_isDisabled],\n );\n\n let textVariant = 'unchecked';\n if (_isChecked && chipColor) {\n textVariant = chipColor;\n }\n if (_isDisabled) {\n textVariant = 'disabled';\n }\n const chipTextColor = chipColorTokens.text[textVariant];\n const chipIconColor = chipColorTokens.icon[textVariant];\n\n let colorVariant = 'unchecked';\n const stateVariant = _isDisabled ? 'disabled' : 'default';\n if (_isChecked && chipColor) {\n colorVariant = chipColor;\n }\n const chipBackgroundColor = chipColorTokens.background[colorVariant][stateVariant];\n const chipBorderColor = chipColorTokens.border[colorVariant][stateVariant];\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Chip, testID })}\n {...getStyledProps(styledProps)}\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n >\n <SelectorLabel\n componentName={MetaConstants.ChipLabel}\n onTouchStart={handlePointerPressedIn}\n onTouchEnd={handlePointerPressedOut}\n onMouseDown={handlePointerPressedIn}\n onMouseUp={handlePointerPressedOut}\n onMouseOut={handlePointerPressedOut}\n onKeyDown={handleKeyboardPressedIn}\n onKeyUp={handleKeyboardPressedOut}\n inputProps={isReactNative() ? inputProps : {}}\n style={{ cursor: _isDisabled ? 'not-allowed' : 'pointer' }}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n <SelectorInput\n hoverTokens={getChipInputHoverTokens(chipColor)}\n isChecked={state.isChecked}\n isDisabled={_isDisabled}\n inputProps={inputProps}\n hasError={hasError}\n ref={ref}\n />\n <AnimatedChip\n borderColor={chipBorderColor}\n isDisabled={_isDisabled}\n isPressed={isPressed}\n isDesktop={matchedDeviceType === 'desktop'}\n >\n <StyledChipWrapper\n borderColor={chipBorderColor}\n isChecked={_isChecked}\n isDisabled={_isDisabled}\n color={chipColor}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n overflow=\"hidden\"\n backgroundColor={chipBackgroundColor}\n borderRadius=\"max\"\n borderWidth={['xsmall', 'small'].includes(_size) ? 'thinner' : 'thin'}\n paddingLeft={\n chipHorizontalPaddingTokens[Boolean(Icon) ? 'withIcon' : 'withoutIcon'].left[\n _size\n ]\n }\n paddingRight={\n chipHorizontalPaddingTokens[Boolean(Icon) ? 'withIcon' : 'withoutIcon'].right[\n _size\n ]\n }\n height={makeSize(chipHeightTokens[_size])}\n >\n {Icon ? (\n <BaseBox paddingRight=\"spacing.3\" display=\"flex\">\n <Icon color={chipIconColor} size={chipIconSizes[_size]} />\n </BaseBox>\n ) : null}\n <Text {...chipTextSizes[_size]} truncateAfterLines={1} color={chipTextColor}>\n {children}\n </Text>\n </StyledChipWrapper>\n </AnimatedChip>\n </BaseBox>\n </BaseBox>\n </SelectorLabel>\n </BaseBox>\n );\n};\n\nconst Chip = assignWithoutSideEffects(React.forwardRef(_Chip), {\n displayName: 'Chip',\n});\n\nexport { Chip };\nexport type { ChipProps };\n"],"names":["_Chip","_ref","ref","_groupProps$state","_groupProps$defaultVa","_ref2","isDisabled","value","children","Icon","icon","color","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","groupProps","useChipGroupContext","isInsideGroup","isEmpty","_React$useState","React","useState","_React$useState2","_slicedToArray","isPressed","setIsPressed","__DEV__","throwBladeError","moduleName","message","hasError","validationState","_isDisabled","_isRequired","isRequired","necessityIndicator","_name","name","_isChecked","state","isChecked","defaultChecked","defaultValue","undefined","includes","useChip","selectionType","useRadio","useCheckbox","_size","size","chipColor","handleChange","_ref3","_groupProps$state2","addValue","_groupProps$state3","removeValue","_useChip","onChange","inputProps","handlePointerPressedIn","useCallback","handlePointerPressedOut","handleKeyboardPressedIn","e","key","handleKeyboardPressedOut","textVariant","chipTextColor","chipColorTokens","text","chipIconColor","colorVariant","stateVariant","chipBackgroundColor","background","chipBorderColor","border","_jsx","BaseBox","Object","assign","metaAttribute","MetaConstants","Chip","getStyledProps","display","isReactNative","SelectorLabel","componentName","ChipLabel","onTouchStart","onTouchEnd","onMouseDown","onMouseUp","onMouseOut","onKeyDown","onKeyUp","style","cursor","flexDirection","_jsxs","alignItems","SelectorInput","hoverTokens","getChipInputHoverTokens","AnimatedChip","borderColor","isDesktop","StyledChipWrapper","justifyContent","overflow","backgroundColor","borderRadius","borderWidth","paddingLeft","chipHorizontalPaddingTokens","Boolean","left","paddingRight","right","height","makeSize","chipHeightTokens","chipIconSizes","Text","chipTextSizes","truncateAfterLines","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,MAAA,CAAA,OAAA,CAAA,QAAA,CAAA,CAsCA,IAAMA,KAAiE,CAAG,SAApEA,KAAiEA,CAAAC,IAAA,CAErEC,GAAG,CACA,CAAAC,IAAAA,iBAAA,CAAAC,qBAAA,CAAAC,KAAA,CAFD,IAAAC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CAAEC,KAAK,CAAAN,IAAA,CAALM,KAAK,CAAEC,QAAQ,CAAAP,IAAA,CAARO,QAAQ,CAAQC,IAAI,CAAAR,IAAA,CAAVS,IAAI,CAAQC,KAAK,CAAAV,IAAA,CAALU,KAAK,C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AAC;;;;"}
1
+ {"version":3,"file":"Chip.js","sources":["../../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { useChipGroupContext } from './ChipGroupContext';\nimport {\n chipIconSizes,\n chipTextSizes,\n chipColorTokens,\n getChipInputHoverTokens,\n chipHeightTokens,\n chipHorizontalPaddingTokens,\n} from './chipTokens';\nimport type { ChipProps } from './types';\nimport { AnimatedChip } from './AnimatedChip';\nimport { StyledChipWrapper } from './StyledChipWrapper';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { SelectorLabel } from '~components/Form/Selector/SelectorLabel';\nimport { SelectorInput } from '~components/Form/Selector/SelectorInput';\nimport type { BladeElementRef } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { useCheckbox } from '~components/Checkbox/useCheckbox';\nimport { useRadio } from '~components/Radio/useRadio';\nimport { isReactNative, makeSize, useBreakpoint } from '~utils';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype OnChange = ({\n isChecked,\n event,\n value,\n}: {\n isChecked: boolean;\n event?: React.ChangeEvent;\n value?: string;\n}) => void;\n\nconst _Chip: React.ForwardRefRenderFunction<BladeElementRef, ChipProps> = (\n { isDisabled, value, children, icon: Icon, color, testID, ...rest },\n ref,\n) => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const groupProps = useChipGroupContext();\n const isInsideGroup = !isEmpty(groupProps);\n const [isPressed, setIsPressed] = React.useState(false);\n\n if (__DEV__) {\n if (!isInsideGroup) {\n throwBladeError({\n moduleName: 'Chip',\n message:\n '<Chip /> component should only be used within the context of a <ChipGroup /> component',\n });\n }\n }\n\n const hasError = groupProps?.validationState === 'error';\n const _isDisabled = isDisabled ?? groupProps?.isDisabled;\n const _isRequired = groupProps?.isRequired || groupProps?.necessityIndicator === 'required';\n const _name = groupProps?.name;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const _isChecked = groupProps?.state?.isChecked(value!);\n // Check if the defaultValue property of groupProps is undefined\n const defaultChecked =\n typeof groupProps?.defaultValue === 'undefined'\n ? undefined // If undefined, defaultChecked is also undefined\n : groupProps?.defaultValue?.includes(value as string); // If multiple selection, check if value is in defaultValue array\n const useChip = groupProps?.selectionType === 'single' ? useRadio : useCheckbox;\n const _size = groupProps?.size || 'small';\n const chipColor = color ?? groupProps?.color ?? 'primary';\n\n const handleChange: OnChange = ({ isChecked, value }) => {\n if (isChecked) {\n groupProps?.state?.addValue(value!);\n } else {\n groupProps?.state?.removeValue(value!);\n }\n };\n\n const { state, inputProps } = useChip({\n defaultChecked,\n isChecked: _isChecked,\n isDisabled: _isDisabled,\n isRequired: _isRequired,\n hasError,\n name: _name,\n value,\n onChange: handleChange,\n });\n\n const handlePointerPressedIn = React.useCallback(() => {\n if (_isDisabled) return;\n setIsPressed(true);\n }, [_isDisabled]);\n\n const handlePointerPressedOut = React.useCallback(() => {\n if (_isDisabled) return;\n setIsPressed(false);\n }, [_isDisabled]);\n\n const handleKeyboardPressedIn = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (_isDisabled) return;\n if (e.key === ' ') {\n setIsPressed(true);\n }\n },\n [_isDisabled],\n );\n\n const handleKeyboardPressedOut = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (_isDisabled) return;\n if (e.key === ' ') {\n setIsPressed(false);\n }\n },\n [_isDisabled],\n );\n\n let textVariant = 'unchecked';\n if (_isChecked && chipColor) {\n textVariant = chipColor;\n }\n if (_isDisabled) {\n textVariant = 'disabled';\n }\n const chipTextColor = chipColorTokens.text[textVariant];\n const chipIconColor = chipColorTokens.icon[textVariant];\n\n let colorVariant = 'unchecked';\n const stateVariant = _isDisabled ? 'disabled' : 'default';\n if (_isChecked && chipColor) {\n colorVariant = chipColor;\n }\n const chipBackgroundColor = chipColorTokens.background[colorVariant][stateVariant];\n const chipBorderColor = chipColorTokens.border[colorVariant][stateVariant];\n\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Chip, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n >\n <SelectorLabel\n componentName={MetaConstants.ChipLabel}\n onTouchStart={handlePointerPressedIn}\n onTouchEnd={handlePointerPressedOut}\n onMouseDown={handlePointerPressedIn}\n onMouseUp={handlePointerPressedOut}\n onMouseOut={handlePointerPressedOut}\n onKeyDown={handleKeyboardPressedIn}\n onKeyUp={handleKeyboardPressedOut}\n inputProps={isReactNative() ? inputProps : {}}\n style={{ cursor: _isDisabled ? 'not-allowed' : 'pointer' }}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n <SelectorInput\n hoverTokens={getChipInputHoverTokens(chipColor)}\n isChecked={state.isChecked}\n isDisabled={_isDisabled}\n inputProps={inputProps}\n hasError={hasError}\n ref={ref}\n />\n <AnimatedChip\n borderColor={chipBorderColor}\n isDisabled={_isDisabled}\n isPressed={isPressed}\n isDesktop={matchedDeviceType === 'desktop'}\n >\n <StyledChipWrapper\n borderColor={chipBorderColor}\n isChecked={_isChecked}\n isDisabled={_isDisabled}\n color={chipColor}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n overflow=\"hidden\"\n backgroundColor={chipBackgroundColor}\n borderRadius=\"max\"\n borderWidth={['xsmall', 'small'].includes(_size) ? 'thinner' : 'thin'}\n paddingLeft={\n chipHorizontalPaddingTokens[Boolean(Icon) ? 'withIcon' : 'withoutIcon'].left[\n _size\n ]\n }\n paddingRight={\n chipHorizontalPaddingTokens[Boolean(Icon) ? 'withIcon' : 'withoutIcon'].right[\n _size\n ]\n }\n height={makeSize(chipHeightTokens[_size])}\n >\n {Icon ? (\n <BaseBox paddingRight=\"spacing.3\" display=\"flex\">\n <Icon color={chipIconColor} size={chipIconSizes[_size]} />\n </BaseBox>\n ) : null}\n <Text {...chipTextSizes[_size]} truncateAfterLines={1} color={chipTextColor}>\n {children}\n </Text>\n </StyledChipWrapper>\n </AnimatedChip>\n </BaseBox>\n </BaseBox>\n </SelectorLabel>\n </BaseBox>\n );\n};\n\nconst Chip = assignWithoutSideEffects(React.forwardRef(_Chip), {\n displayName: 'Chip',\n});\n\nexport { Chip };\nexport type { ChipProps };\n"],"names":["_Chip","_ref","ref","_groupProps$state","_groupProps$defaultVa","_ref2","isDisabled","value","children","Icon","icon","color","testID","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","groupProps","useChipGroupContext","isInsideGroup","isEmpty","_React$useState","React","useState","_React$useState2","_slicedToArray","isPressed","setIsPressed","__DEV__","throwBladeError","moduleName","message","hasError","validationState","_isDisabled","_isRequired","isRequired","necessityIndicator","_name","name","_isChecked","state","isChecked","defaultChecked","defaultValue","undefined","includes","useChip","selectionType","useRadio","useCheckbox","_size","size","chipColor","handleChange","_ref3","_groupProps$state2","addValue","_groupProps$state3","removeValue","_useChip","onChange","inputProps","handlePointerPressedIn","useCallback","handlePointerPressedOut","handleKeyboardPressedIn","e","key","handleKeyboardPressedOut","textVariant","chipTextColor","chipColorTokens","text","chipIconColor","colorVariant","stateVariant","chipBackgroundColor","background","chipBorderColor","border","_jsx","BaseBox","Object","assign","metaAttribute","MetaConstants","Chip","getStyledProps","makeAnalyticsAttribute","display","isReactNative","SelectorLabel","componentName","ChipLabel","onTouchStart","onTouchEnd","onMouseDown","onMouseUp","onMouseOut","onKeyDown","onKeyUp","style","cursor","flexDirection","_jsxs","alignItems","SelectorInput","hoverTokens","getChipInputHoverTokens","AnimatedChip","borderColor","isDesktop","StyledChipWrapper","justifyContent","overflow","backgroundColor","borderRadius","borderWidth","paddingLeft","chipHorizontalPaddingTokens","Boolean","left","paddingRight","right","height","makeSize","chipHeightTokens","chipIconSizes","Text","chipTextSizes","truncateAfterLines","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,MAAA,CAAA,OAAA,CAAA,QAAA,CAAA,CAuCA,IAAMA,KAAiE,CAAG,SAApEA,KAAiEA,CAAAC,IAAA,CAErEC,GAAG,CACA,CAAAC,IAAAA,iBAAA,CAAAC,qBAAA,CAAAC,KAAA,KAFDC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CAAEC,KAAK,CAAAN,IAAA,CAALM,KAAK,CAAEC,QAAQ,CAAAP,IAAA,CAARO,QAAQ,CAAQC,IAAI,CAAAR,IAAA,CAAVS,IAAI,CAAQC,KAAK,CAAAV,IAAA,CAALU,KAAK,CAAEC,MAAM,CAAAX,IAAA,CAANW,MAAM,CAAKC,IAAI,CAAAC,wBAAA,CAAAb,IAAA,CAAAc,SAAA,CAAA,CAGjE,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CACb,IAAAC,cAAA,CAA8BC,aAAa,CAAC,CAAEC,WAAW,CAAEH,KAAK,CAACG,WAAY,CAAC,CAAC,CAAvEC,iBAAiB,CAAAH,cAAA,CAAjBG,iBAAiB,CACzB,IAAMC,UAAU,CAAGC,mBAAmB,EAAE,CACxC,IAAMC,aAAa,CAAG,CAACC,OAAO,CAACH,UAAU,CAAC,CAC1C,IAAAI,eAAA,CAAkCC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC,CAAAC,gBAAA,CAAAC,cAAA,CAAAJ,eAAA,CAAA,CAAA,CAAA,CAAhDK,SAAS,CAAAF,gBAAA,CAAA,CAAA,CAAA,CAAEG,YA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AC,CAAE,CAAAjD,QAAA,CAEzCC,CAAAA,IAAI,CACH8E,GAAA,CAACC,OAAO,EAACyC,YAAY,CAAC,WAAW,CAACjC,OAAO,CAAC,MAAM,CAAAxF,QAAA,CAC9C+E,GAAA,CAAC9E,IAAI,EAACE,KAAK,CAAEqE,aAAc,CAACtB,IAAI,CAAE4E,aAAa,CAAC7E,KAAK,CAAE,CAAE,CAAC,CACnD,CAAC,CACR,IAAI,CACR8B,GAAA,CAACgD,IAAI,CAAA9C,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAK8C,aAAa,CAAC/E,KAAK,CAAC,CAAEgF,CAAAA,kBAAkB,CAAE,CAAE,CAAC9H,KAAK,CAAEkE,aAAc,CAAArE,QAAA,CACzEA,QAAQ,EACL,CAAC,CAAA,CACU,CAAC,CACR,CAAC,CAAA,CACR,CAAC,CACH,CAAC,CACG,CAAC,CACT,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAqF,IAAI,CAAG6C,wBAAwB,CAAC9G,cAAK,CAAC+G,UAAU,CAAC3I,KAAK,CAAC,CAAE,CAC7D4I,WAAW,CAAE,MACf,CAAC;;;;"}
@@ -19,8 +19,9 @@ import '../Typography/BaseText/BaseText.native.js';
19
19
  import { jsx, jsxs } from 'react/jsx-runtime';
20
20
  import { Text } from '../Typography/Text/Text.js';
21
21
  import '../Typography/Code/Code.js';
22
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
22
23
 
23
- var _excluded=["accessibilityLabel","label","labelPosition","necessityIndicator","validationState","errorText","helpText","isRequired","children","isDisabled","name","defaultValue","onChange","value","size","color","testID","selectionType"];var ChipGroup=function ChipGroup(_ref){var accessibilityLabel=_ref.accessibilityLabel,label=_ref.label,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,_ref$validationState=_ref.validationState,validationState=_ref$validationState===void 0?'none':_ref$validationState,errorText=_ref.errorText,helpText=_ref.helpText,_ref$isRequired=_ref.isRequired,isRequired=_ref$isRequired===void 0?false:_ref$isRequired,children=_ref.children,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,name=_ref.name,defaultValue=_ref.defaultValue,onChange=_ref.onChange,value=_ref.value,_ref$size=_ref.size,size=_ref$size===void 0?'small':_ref$size,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,testID=_ref.testID,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,styledProps=_objectWithoutProperties(_ref,_excluded);var _useChipGroup=useChipGroup({defaultValue:defaultValue,onChange:onChange,value:value,isDisabled:isDisabled,name:name,size:size,color:color,selectionType:selectionType,isRequired:isRequired,validationState:validationState,necessityIndicator:necessityIndicator}),contextValue=_useChipGroup.contextValue,ids=_useChipGroup.ids;var showError=validationState==='error'&&errorText;var showHelpText=!showError&&helpText;var accessibilityText=`${showError?errorText:''} ${showHelpText?helpText:''}`.trim();if(__DEV__){if(selectionType==='single'&&Array.isArray(defaultValue)){throwBladeError({moduleName:'ChipGroup',message:`When "selectionType" is "single", the "defaultValue" prop must be a string value, but an array was provided.`});}if(selectionType==='single'&&Array.isArray(value)){throwBladeError({moduleName:'ChipGroup',message:`When "selectionType" is "single", the "value" prop must be a string value, but an array was provided.`});}}return jsx(ChipGroupProvider,{value:contextValue,children:jsx(BaseBox,Object.assign({},getStyledProps(styledProps),{children:jsxs(SelectorGroupField,{position:labelPosition,accessibilityRole:selectionType==='single'?'radiogroup':'group',labelledBy:ids.labelId,componentName:"chip-group",testID:testID,children:[label?jsx(FormLabel,{as:"span",necessityIndicator:necessityIndicator,position:labelPosition,id:ids.labelId,accessibilityText:accessibilityText&&`,${accessibilityText}`,size:chipGroupLabelSizeTokens[size],children:label}):null,jsxs(BaseBox,{children:[jsx(VisuallyHidden,{children:jsx(Text,{children:accessibilityLabel})}),jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:React__default.Children.map(children,function(child,index){return jsx(BaseBox,{marginBottom:chipGroupGapTokens[size].bottom,marginRight:chipGroupGapTokens[size].right,children:child},index);})}),jsx(FormHint,{size:chipGroupLabelSizeTokens[size],type:validationState==='error'?'error':'help',errorText:errorText,helpText:helpText})]})]})}))});};
24
+ var _excluded=["accessibilityLabel","label","labelPosition","necessityIndicator","validationState","errorText","helpText","isRequired","children","isDisabled","name","defaultValue","onChange","value","size","color","testID","selectionType"];var ChipGroup=function ChipGroup(_ref){var accessibilityLabel=_ref.accessibilityLabel,label=_ref.label,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,_ref$validationState=_ref.validationState,validationState=_ref$validationState===void 0?'none':_ref$validationState,errorText=_ref.errorText,helpText=_ref.helpText,_ref$isRequired=_ref.isRequired,isRequired=_ref$isRequired===void 0?false:_ref$isRequired,children=_ref.children,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,name=_ref.name,defaultValue=_ref.defaultValue,onChange=_ref.onChange,value=_ref.value,_ref$size=_ref.size,size=_ref$size===void 0?'small':_ref$size,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,testID=_ref.testID,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,rest=_objectWithoutProperties(_ref,_excluded);var _useChipGroup=useChipGroup({defaultValue:defaultValue,onChange:onChange,value:value,isDisabled:isDisabled,name:name,size:size,color:color,selectionType:selectionType,isRequired:isRequired,validationState:validationState,necessityIndicator:necessityIndicator}),contextValue=_useChipGroup.contextValue,ids=_useChipGroup.ids;var showError=validationState==='error'&&errorText;var showHelpText=!showError&&helpText;var accessibilityText=`${showError?errorText:''} ${showHelpText?helpText:''}`.trim();if(__DEV__){if(selectionType==='single'&&Array.isArray(defaultValue)){throwBladeError({moduleName:'ChipGroup',message:`When "selectionType" is "single", the "defaultValue" prop must be a string value, but an array was provided.`});}if(selectionType==='single'&&Array.isArray(value)){throwBladeError({moduleName:'ChipGroup',message:`When "selectionType" is "single", the "value" prop must be a string value, but an array was provided.`});}}return jsx(ChipGroupProvider,{value:contextValue,children:jsx(BaseBox,Object.assign({},getStyledProps(rest),{children:jsxs(SelectorGroupField,Object.assign({position:labelPosition,accessibilityRole:selectionType==='single'?'radiogroup':'group',labelledBy:ids.labelId,componentName:"chip-group",testID:testID},makeAnalyticsAttribute(rest),{children:[label?jsx(FormLabel,{as:"span",necessityIndicator:necessityIndicator,position:labelPosition,id:ids.labelId,accessibilityText:accessibilityText&&`,${accessibilityText}`,size:chipGroupLabelSizeTokens[size],children:label}):null,jsxs(BaseBox,{children:[jsx(VisuallyHidden,{children:jsx(Text,{children:accessibilityLabel})}),jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:React__default.Children.map(children,function(child,index){return jsx(BaseBox,{marginBottom:chipGroupGapTokens[size].bottom,marginRight:chipGroupGapTokens[size].right,children:child},index);})}),jsx(FormHint,{size:chipGroupLabelSizeTokens[size],type:validationState==='error'?'error':'help',errorText:errorText,helpText:helpText})]})]}))}))});};
24
25
 
25
26
  export { ChipGroup };
26
27
  //# sourceMappingURL=ChipGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipGroup.js","sources":["../../../../../src/components/Chip/ChipGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { chipGroupGapTokens, chipGroupLabelSizeTokens } from './chipTokens';\nimport { ChipGroupProvider } from './ChipGroupContext';\nimport { useChipGroup } from './useChipGroup';\nimport type { ChipGroupProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { SelectorGroupField } from '~components/Form/Selector/SelectorGroupField';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { VisuallyHidden } from '~components/VisuallyHidden';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\n\nconst ChipGroup = ({\n accessibilityLabel,\n label,\n labelPosition = 'top',\n necessityIndicator = 'none',\n validationState = 'none',\n errorText,\n helpText,\n isRequired = false,\n children,\n isDisabled = false,\n name,\n defaultValue,\n onChange,\n value,\n size = 'small',\n color = 'primary',\n testID,\n selectionType = 'single',\n ...styledProps\n}: ChipGroupProps): React.ReactElement => {\n const { contextValue, ids } = useChipGroup({\n defaultValue,\n onChange,\n value,\n isDisabled,\n name,\n size,\n color,\n selectionType,\n isRequired,\n validationState,\n necessityIndicator,\n });\n const showError = validationState === 'error' && errorText;\n const showHelpText = !showError && helpText;\n const accessibilityText = `${showError ? errorText : ''} ${showHelpText ? helpText : ''}`.trim();\n\n if (__DEV__) {\n if (selectionType === 'single' && Array.isArray(defaultValue)) {\n throwBladeError({\n moduleName: 'ChipGroup',\n message: `When \"selectionType\" is \"single\", the \"defaultValue\" prop must be a string value, but an array was provided.`,\n });\n }\n if (selectionType === 'single' && Array.isArray(value)) {\n throwBladeError({\n moduleName: 'ChipGroup',\n message: `When \"selectionType\" is \"single\", the \"value\" prop must be a string value, but an array was provided.`,\n });\n }\n }\n\n return (\n <ChipGroupProvider value={contextValue}>\n <BaseBox {...getStyledProps(styledProps)}>\n <SelectorGroupField\n position={labelPosition}\n accessibilityRole={selectionType === 'single' ? 'radiogroup' : 'group'}\n labelledBy={ids.labelId}\n componentName=\"chip-group\"\n testID={testID}\n >\n {label ? (\n <FormLabel\n as=\"span\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={ids.labelId}\n accessibilityText={accessibilityText && `,${accessibilityText}`}\n size={chipGroupLabelSizeTokens[size]}\n >\n {label}\n </FormLabel>\n ) : null}\n <BaseBox>\n <VisuallyHidden>\n <Text>{accessibilityLabel}</Text>\n </VisuallyHidden>\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {React.Children.map(children, (child, index) => {\n return (\n <BaseBox\n key={index}\n marginBottom={chipGroupGapTokens[size].bottom}\n marginRight={chipGroupGapTokens[size].right}\n >\n {child}\n </BaseBox>\n );\n })}\n </BaseBox>\n <FormHint\n size={chipGroupLabelSizeTokens[size]}\n type={validationState === 'error' ? 'error' : 'help'}\n errorText={errorText}\n helpText={helpText}\n />\n </BaseBox>\n </SelectorGroupField>\n </BaseBox>\n </ChipGroupProvider>\n );\n};\n\nexport { ChipGroup };\nexport type { ChipGroupProps };\n"],"names":["ChipGroup","_ref","accessibilityLabel","label","_ref$labelPosition","labelPosition","_ref$necessityIndicat","necessityIndicator","_ref$validationState","validationState","errorText","helpText","_ref$isRequired","isRequired","children","_ref$isDisabled","isDisabled","name","defaultValue","onChange","value","_ref$size","size","_ref$color","color","testID","_ref$selectionType","selectionType","styledProps","_objectWithoutProperties","_excluded","_useChipGroup","useChipGroup","contextValue","ids","showError","showHelpText","accessibilityText","trim","__DEV__","Array","isArray","throwBladeError","moduleName","message","_jsx","ChipGroupProvider","BaseBox","Object","assign","getStyledProps","_jsxs","SelectorGroupField","position","accessibilityRole","labelledBy","labelId","componentName","FormLabel","as","id","chipGroupLabelSizeTokens","VisuallyHidden","Text","display","flexDirection","flexWrap","React","Children","map","child","index","marginBottom","chipGroupGapTokens","bottom","marginRight","right","FormHint","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,eAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,WAAA,CAAA,UAAA,CAAA,YAAA,CAAA,UAAA,CAAA,YAAA,CAAA,MAAA,CAAA,cAAA,CAAA,UAAA,CAAA,OAAA,CAAA,MAAA,CAAA,OAAA,CAAA,QAAA,CAAA,eAAA,CAAA,CAaM,IAAAA,SAAS,CAAG,SAAZA,SAASA,CAAAC,IAAA,CAoB2B,CAAA,IAnBxCC,kBAAkB,CAAAD,IAAA,CAA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F,kBAAkB,CAACnD,IAAI,CAAC,CAACsD,KAAM,CAAA9D,QAAA,CAE3CwD,KAAK,CAAA,CAJDC,KAKE,CAAC,CAEd,CAAC,CAAC,CACK,CAAC,CACV1B,GAAA,CAACgC,QAAQ,CACPvD,CAAAA,IAAI,CAAEuC,wBAAwB,CAACvC,IAAI,CAAE,CACrCwD,IAAI,CAAErE,eAAe,GAAK,OAAO,CAAG,OAAO,CAAG,MAAO,CACrDC,SAAS,CAAEA,SAAU,CACrBC,QAAQ,CAAEA,QAAS,CACpB,CAAC,EACK,CAAC,CAAA,CACQ,CAAC,CAAA,CACd,CAAC,CACO,CAAC,CAExB;;;;"}
1
+ {"version":3,"file":"ChipGroup.js","sources":["../../../../../src/components/Chip/ChipGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { chipGroupGapTokens, chipGroupLabelSizeTokens } from './chipTokens';\nimport { ChipGroupProvider } from './ChipGroupContext';\nimport { useChipGroup } from './useChipGroup';\nimport type { ChipGroupProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { SelectorGroupField } from '~components/Form/Selector/SelectorGroupField';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { VisuallyHidden } from '~components/VisuallyHidden';\nimport { Text } from '~components/Typography';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst ChipGroup = ({\n accessibilityLabel,\n label,\n labelPosition = 'top',\n necessityIndicator = 'none',\n validationState = 'none',\n errorText,\n helpText,\n isRequired = false,\n children,\n isDisabled = false,\n name,\n defaultValue,\n onChange,\n value,\n size = 'small',\n color = 'primary',\n testID,\n selectionType = 'single',\n ...rest\n}: ChipGroupProps): React.ReactElement => {\n const { contextValue, ids } = useChipGroup({\n defaultValue,\n onChange,\n value,\n isDisabled,\n name,\n size,\n color,\n selectionType,\n isRequired,\n validationState,\n necessityIndicator,\n });\n const showError = validationState === 'error' && errorText;\n const showHelpText = !showError && helpText;\n const accessibilityText = `${showError ? errorText : ''} ${showHelpText ? helpText : ''}`.trim();\n\n if (__DEV__) {\n if (selectionType === 'single' && Array.isArray(defaultValue)) {\n throwBladeError({\n moduleName: 'ChipGroup',\n message: `When \"selectionType\" is \"single\", the \"defaultValue\" prop must be a string value, but an array was provided.`,\n });\n }\n if (selectionType === 'single' && Array.isArray(value)) {\n throwBladeError({\n moduleName: 'ChipGroup',\n message: `When \"selectionType\" is \"single\", the \"value\" prop must be a string value, but an array was provided.`,\n });\n }\n }\n\n return (\n <ChipGroupProvider value={contextValue}>\n <BaseBox {...getStyledProps(rest)}>\n <SelectorGroupField\n position={labelPosition}\n accessibilityRole={selectionType === 'single' ? 'radiogroup' : 'group'}\n labelledBy={ids.labelId}\n componentName=\"chip-group\"\n testID={testID}\n {...makeAnalyticsAttribute(rest)}\n >\n {label ? (\n <FormLabel\n as=\"span\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={ids.labelId}\n accessibilityText={accessibilityText && `,${accessibilityText}`}\n size={chipGroupLabelSizeTokens[size]}\n >\n {label}\n </FormLabel>\n ) : null}\n <BaseBox>\n <VisuallyHidden>\n <Text>{accessibilityLabel}</Text>\n </VisuallyHidden>\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {React.Children.map(children, (child, index) => {\n return (\n <BaseBox\n key={index}\n marginBottom={chipGroupGapTokens[size].bottom}\n marginRight={chipGroupGapTokens[size].right}\n >\n {child}\n </BaseBox>\n );\n })}\n </BaseBox>\n <FormHint\n size={chipGroupLabelSizeTokens[size]}\n type={validationState === 'error' ? 'error' : 'help'}\n errorText={errorText}\n helpText={helpText}\n />\n </BaseBox>\n </SelectorGroupField>\n </BaseBox>\n </ChipGroupProvider>\n );\n};\n\nexport { ChipGroup };\nexport type { ChipGroupProps };\n"],"names":["ChipGroup","_ref","accessibilityLabel","label","_ref$labelPosition","labelPosition","_ref$necessityIndicat","necessityIndicator","_ref$validationState","validationState","errorText","helpText","_ref$isRequired","isRequired","children","_ref$isDisabled","isDisabled","name","defaultValue","onChange","value","_ref$size","size","_ref$color","color","testID","_ref$selectionType","selectionType","rest","_objectWithoutProperties","_excluded","_useChipGroup","useChipGroup","contextValue","ids","showError","showHelpText","accessibilityText","trim","__DEV__","Array","isArray","throwBladeError","moduleName","message","_jsx","ChipGroupProvider","BaseBox","Object","assign","getStyledProps","_jsxs","SelectorGroupField","position","accessibilityRole","labelledBy","labelId","componentName","makeAnalyticsAttribute","FormLabel","as","id","chipGroupLabelSizeTokens","VisuallyHidden","Text","display","flexDirection","flexWrap","React","Children","map","child","index","marginBottom","chipGroupGapTokens","bottom","marginRight","right","FormHint","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,eAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,WAAA,CAAA,UAAA,CAAA,YAAA,CAAA,UAAA,CAAA,YAAA,CAAA,MAAA,CAAA,cAAA,CAAA,UAAA,CAAA,OAAA,CAAA,MAAA,CAAA,OAAA,CAAA,QAAA,CAAA,eAAA,CAAA,CAcM,IAAAA,SAAS,CAAG,SAAZA,SAASA,CAAAC,IAAA,CAoB2B,CAnBxC,IAAAC,kBAAkB,CAAAD,IAAA,CAAlBC,kBAAkB,CAClBC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAAAC,kBAAA,CAAAH,IAAA,CACLI,aAAa,CAAbA,aAAa,CAAAD,kBAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,kBAAA,CAAAE,qBAAA,CAAAL,IAAA,CACrBM,kBAAkB,CAAlBA,kBAAkB,CAAAD,qBAAA,GAAA,KAAA,CAAA,CAAG,MAAM,CAAAA,qBAAA,CAAAE,oBAAA,CAAAP,IAAA,CAC3BQ,eAAe,CAAfA,eAAe,CAAAD,oBAAA,GAAG,KAAA,CAAA,CAAA,MAAM,CAAAA,oBAAA,CACxBE,SAAS,CAAAT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S,CACpB,CAAC,EACK,CAAC,CAAA,CAAA,CACQ,CAAC,CAAA,CACd,CAAC,CACO,CAAC,CAExB;;;;"}
@@ -16,9 +16,10 @@ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js
16
16
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
17
17
  import { useId } from '../../utils/useId.js';
18
18
  import { isValidAllowedChildren } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
19
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
19
20
  import { jsx } from 'react/jsx-runtime';
20
21
 
21
- var _excluded=["children","direction","defaultIsExpanded","isExpanded","onExpandChange","testID","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations"];var MIN_WIDTH=makeSize(size[200]);var Collapsible=function Collapsible(_ref){var children=_ref.children,_ref$direction=_ref.direction,direction=_ref$direction===void 0?'bottom':_ref$direction,_ref$defaultIsExpande=_ref.defaultIsExpanded,defaultIsExpanded=_ref$defaultIsExpande===void 0?false:_ref$defaultIsExpande,isExpanded=_ref.isExpanded,onExpandChange=_ref.onExpandChange,testID=_ref.testID,_ref$_shouldApplyWidt=_ref._shouldApplyWidthRestrictions,_shouldApplyWidthRestrictions=_ref$_shouldApplyWidt===void 0?true:_ref$_shouldApplyWidt,_ref$_dangerouslyDisa=_ref._dangerouslyDisableValidations,_dangerouslyDisableValidations=_ref$_dangerouslyDisa===void 0?false:_ref$_dangerouslyDisa,styledProps=_objectWithoutProperties(_ref,_excluded);var _useState=useState(isExpanded!=null?isExpanded:defaultIsExpanded),_useState2=_slicedToArray(_useState,2),isBodyExpanded=_useState2[0],setIsBodyExpanded=_useState2[1];var collapsibleBodyId=useId(MetaConstants.CollapsibleBody);var initialDefaultExpanded=useRef(Boolean(defaultIsExpanded||isExpanded));var handleExpandChange=useCallback(function(nextIsExpanded){if(typeof isExpanded!=='undefined'){onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}else {setIsBodyExpanded(nextIsExpanded);onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}},[onExpandChange,isExpanded]);var contextValue=useMemo(function(){return {isExpanded:isExpanded!=null?isExpanded:isBodyExpanded,onExpandChange:handleExpandChange,defaultIsExpanded:initialDefaultExpanded.current,direction:direction,collapsibleBodyId:collapsibleBodyId};},[isBodyExpanded,direction,handleExpandChange,isExpanded,collapsibleBodyId]);if(__DEV__){Children.forEach(children,function(child){if(!(isValidAllowedChildren(child,MetaConstants.CollapsibleBody)||isValidAllowedChildren(child,MetaConstants.CollapsibleButton)||isValidAllowedChildren(child,MetaConstants.CollapsibleLink))&&!_dangerouslyDisableValidations){throwBladeError({message:`only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,moduleName:'Collapsible'});}});}return jsx(CollapsibleContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Collapsible,testID:testID}),getStyledProps(styledProps),{children:jsx(BaseBox,{display:"flex",flexDirection:direction==='bottom'?'column':'column-reverse',alignItems:"flex-start",minWidth:_shouldApplyWidthRestrictions?MIN_WIDTH:makeSize(size[0]),maxWidth:_shouldApplyWidthRestrictions?MAX_WIDTH:MAX_WIDTH_NO_RESTRICTIONS,children:children})}))});};
22
+ var _excluded=["children","direction","defaultIsExpanded","isExpanded","onExpandChange","testID","_shouldApplyWidthRestrictions","_dangerouslyDisableValidations"];var MIN_WIDTH=makeSize(size[200]);var Collapsible=function Collapsible(_ref){var children=_ref.children,_ref$direction=_ref.direction,direction=_ref$direction===void 0?'bottom':_ref$direction,_ref$defaultIsExpande=_ref.defaultIsExpanded,defaultIsExpanded=_ref$defaultIsExpande===void 0?false:_ref$defaultIsExpande,isExpanded=_ref.isExpanded,onExpandChange=_ref.onExpandChange,testID=_ref.testID,_ref$_shouldApplyWidt=_ref._shouldApplyWidthRestrictions,_shouldApplyWidthRestrictions=_ref$_shouldApplyWidt===void 0?true:_ref$_shouldApplyWidt,_ref$_dangerouslyDisa=_ref._dangerouslyDisableValidations,_dangerouslyDisableValidations=_ref$_dangerouslyDisa===void 0?false:_ref$_dangerouslyDisa,rest=_objectWithoutProperties(_ref,_excluded);var _useState=useState(isExpanded!=null?isExpanded:defaultIsExpanded),_useState2=_slicedToArray(_useState,2),isBodyExpanded=_useState2[0],setIsBodyExpanded=_useState2[1];var collapsibleBodyId=useId(MetaConstants.CollapsibleBody);var initialDefaultExpanded=useRef(Boolean(defaultIsExpanded||isExpanded));var handleExpandChange=useCallback(function(nextIsExpanded){if(typeof isExpanded!=='undefined'){onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}else {setIsBodyExpanded(nextIsExpanded);onExpandChange==null?void 0:onExpandChange({isExpanded:nextIsExpanded});}},[onExpandChange,isExpanded]);var contextValue=useMemo(function(){return {isExpanded:isExpanded!=null?isExpanded:isBodyExpanded,onExpandChange:handleExpandChange,defaultIsExpanded:initialDefaultExpanded.current,direction:direction,collapsibleBodyId:collapsibleBodyId};},[isBodyExpanded,direction,handleExpandChange,isExpanded,collapsibleBodyId]);if(__DEV__){Children.forEach(children,function(child){if(!(isValidAllowedChildren(child,MetaConstants.CollapsibleBody)||isValidAllowedChildren(child,MetaConstants.CollapsibleButton)||isValidAllowedChildren(child,MetaConstants.CollapsibleLink))&&!_dangerouslyDisableValidations){throwBladeError({message:`only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,moduleName:'Collapsible'});}});}return jsx(CollapsibleContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Collapsible,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsx(BaseBox,{display:"flex",flexDirection:direction==='bottom'?'column':'column-reverse',alignItems:"flex-start",minWidth:_shouldApplyWidthRestrictions?MIN_WIDTH:makeSize(size[0]),maxWidth:_shouldApplyWidthRestrictions?MAX_WIDTH:MAX_WIDTH_NO_RESTRICTIONS,children:children})}))});};
22
23
 
23
24
  export { Collapsible };
24
25
  //# sourceMappingURL=Collapsible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Collapsible.js","sources":["../../../../../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Children, useCallback, useRef, useState, useMemo } from 'react';\n\nimport type { CollapsibleContextState } from './CollapsibleContext';\nimport { CollapsibleContext } from './CollapsibleContext';\nimport { MAX_WIDTH, MAX_WIDTH_NO_RESTRICTIONS } from './styles';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TestID } from '~utils/types';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BoxProps } from '~components/Box';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useId } from '~utils/useId';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\ntype CollapsibleProps = {\n /**\n * Composes `CollapsibleButton`, `CollapsibleLink`, `CollapsibleBody`\n */\n children: ReactNode;\n\n /**\n * Direction in which the content expands\n *\n * @default bottom\n */\n direction?: 'bottom' | 'top';\n\n /**\n * Expands the collapsible content by default (uncontrolled)\n *\n * @default false\n */\n defaultIsExpanded?: boolean;\n\n /**\n * Expands the collapsible content (controlled)\n *\n * @default undefined\n */\n isExpanded?: boolean;\n\n /**\n * Callback for change in collapsible's expanded state\n *\n * @default undefined\n */\n onExpandChange?: ({ isExpanded }: { isExpanded: boolean }) => void;\n\n /**\n * **Internal**: disables trigger validations. Used for AccordionButton and SideNavLink internally\n */\n _dangerouslyDisableValidations?: boolean;\n /**\n * **Internal**: used to override responsive width restrictions\n */\n _shouldApplyWidthRestrictions?: boolean;\n} & TestID &\n StyledPropsBlade;\n\nconst MIN_WIDTH: BoxProps['minWidth'] = makeSize(size[200]);\n\nconst Collapsible = ({\n children,\n direction = 'bottom',\n defaultIsExpanded = false,\n isExpanded,\n onExpandChange,\n testID,\n _shouldApplyWidthRestrictions = true,\n _dangerouslyDisableValidations = false,\n ...styledProps\n}: CollapsibleProps): ReactElement => {\n const [isBodyExpanded, setIsBodyExpanded] = useState(isExpanded ?? defaultIsExpanded);\n const collapsibleBodyId = useId(MetaConstants.CollapsibleBody);\n\n /**\n * Maintain a ref to the initial value of `defaultExpanded || isExpanded` so changing it has no effect.\n * This will help in determining the correct initial height of collapsing body content\n */\n const initialDefaultExpanded = useRef(Boolean(defaultIsExpanded || isExpanded));\n\n const handleExpandChange = useCallback(\n (nextIsExpanded: boolean) => {\n if (typeof isExpanded !== 'undefined') {\n // controlled\n onExpandChange?.({ isExpanded: nextIsExpanded });\n } else {\n // uncontrolled\n setIsBodyExpanded(nextIsExpanded);\n onExpandChange?.({ isExpanded: nextIsExpanded });\n }\n },\n [onExpandChange, isExpanded],\n );\n\n const contextValue = useMemo<CollapsibleContextState>(\n () => ({\n // controlled behavior if isExpanded is provided\n isExpanded: isExpanded ?? isBodyExpanded,\n onExpandChange: handleExpandChange,\n defaultIsExpanded: initialDefaultExpanded.current,\n direction,\n collapsibleBodyId,\n }),\n [isBodyExpanded, direction, handleExpandChange, isExpanded, collapsibleBodyId],\n );\n\n if (__DEV__) {\n Children.forEach(children, (child) => {\n if (\n !(\n isValidAllowedChildren(child, MetaConstants.CollapsibleBody) ||\n isValidAllowedChildren(child, MetaConstants.CollapsibleButton) ||\n isValidAllowedChildren(child, MetaConstants.CollapsibleLink)\n ) &&\n !_dangerouslyDisableValidations\n ) {\n throwBladeError({\n message: `only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,\n moduleName: 'Collapsible',\n });\n }\n });\n }\n\n return (\n <CollapsibleContext.Provider value={contextValue}>\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Collapsible, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display=\"flex\"\n flexDirection={direction === 'bottom' ? 'column' : 'column-reverse'}\n alignItems=\"flex-start\"\n minWidth={_shouldApplyWidthRestrictions ? MIN_WIDTH : makeSize(size[0])}\n maxWidth={_shouldApplyWidthRestrictions ? MAX_WIDTH : MAX_WIDTH_NO_RESTRICTIONS}\n >\n {children}\n </BaseBox>\n </BaseBox>\n </CollapsibleContext.Provider>\n );\n};\n\nexport type { CollapsibleProps };\nexport { Collapsible };\n"],"names":["MIN_WIDTH","makeSize","size","Collapsible","_ref","children","_ref$direction","direction","_ref$defaultIsExpande","defaultIsExpanded","isExpanded","onExpandChange","testID","_ref$_shouldApplyWidt","_shouldApplyWidthRestrictions","_ref$_dangerouslyDisa","_dangerouslyDisableValidations","styledProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isBodyExpanded","setIsBodyExpanded","collapsibleBodyId","useId","MetaConstants","CollapsibleBody","initialDefaultExpanded","useRef","Boolean","handleExpandChange","useCallback","nextIsExpanded","contextValue","useMemo","current","__DEV__","Children","forEach","child","isValidAllowedChildren","CollapsibleButton","CollapsibleLink","throwBladeError","message","moduleName","_jsx","CollapsibleContext","Provider","value","BaseBox","Object","assign","metaAttribute","name","getStyledProps","display","flexDirection","alignItems","minWidth","maxWidth","MAX_WIDTH","MAX_WIDTH_NO_RESTRICTIONS"],"mappings":";;;;;;;;;;;;;;;;;;;;mKA+DA,IAAMA,SAA+B,CAAGC,QAAQ,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC,CAErD,IAAAC,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAUqB,CATpC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAAC,cAAA,CAAAF,IAAA,CACRG,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,cAAA,CAAAE,qBAAA,CAAAJ,IAAA,CACpBK,iBAAiB,CAAjBA,iBAAiB,CAAAD,qBAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,qBAAA,CACzBE,UAAU,CAAAN,IAAA,CA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,YAAY,CACvBC,QAAQ,CAAEhD,6BAA6B,CAAGd,SAAS,CAAGC,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAE,CACxE6D,QAAQ,CAAEjD,6BAA6B,CAAGkD,SAAS,CAAGC,yBAA0B,CAAA5D,QAAA,CAE/EA,QAAQ,CACF,CAAC,CACH,CAAA,CAAC,CACiB,CAAC,CAElC;;;;"}
1
+ {"version":3,"file":"Collapsible.js","sources":["../../../../../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport { Children, useCallback, useRef, useState, useMemo } from 'react';\n\nimport type { CollapsibleContextState } from './CollapsibleContext';\nimport { CollapsibleContext } from './CollapsibleContext';\nimport { MAX_WIDTH, MAX_WIDTH_NO_RESTRICTIONS } from './styles';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { BoxProps } from '~components/Box';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { useId } from '~utils/useId';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleProps = {\n /**\n * Composes `CollapsibleButton`, `CollapsibleLink`, `CollapsibleBody`\n */\n children: ReactNode;\n\n /**\n * Direction in which the content expands\n *\n * @default bottom\n */\n direction?: 'bottom' | 'top';\n\n /**\n * Expands the collapsible content by default (uncontrolled)\n *\n * @default false\n */\n defaultIsExpanded?: boolean;\n\n /**\n * Expands the collapsible content (controlled)\n *\n * @default undefined\n */\n isExpanded?: boolean;\n\n /**\n * Callback for change in collapsible's expanded state\n *\n * @default undefined\n */\n onExpandChange?: ({ isExpanded }: { isExpanded: boolean }) => void;\n\n /**\n * **Internal**: disables trigger validations. Used for AccordionButton and SideNavLink internally\n */\n _dangerouslyDisableValidations?: boolean;\n /**\n * **Internal**: used to override responsive width restrictions\n */\n _shouldApplyWidthRestrictions?: boolean;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst MIN_WIDTH: BoxProps['minWidth'] = makeSize(size[200]);\n\nconst Collapsible = ({\n children,\n direction = 'bottom',\n defaultIsExpanded = false,\n isExpanded,\n onExpandChange,\n testID,\n _shouldApplyWidthRestrictions = true,\n _dangerouslyDisableValidations = false,\n ...rest\n}: CollapsibleProps): ReactElement => {\n const [isBodyExpanded, setIsBodyExpanded] = useState(isExpanded ?? defaultIsExpanded);\n const collapsibleBodyId = useId(MetaConstants.CollapsibleBody);\n\n /**\n * Maintain a ref to the initial value of `defaultExpanded || isExpanded` so changing it has no effect.\n * This will help in determining the correct initial height of collapsing body content\n */\n const initialDefaultExpanded = useRef(Boolean(defaultIsExpanded || isExpanded));\n\n const handleExpandChange = useCallback(\n (nextIsExpanded: boolean) => {\n if (typeof isExpanded !== 'undefined') {\n // controlled\n onExpandChange?.({ isExpanded: nextIsExpanded });\n } else {\n // uncontrolled\n setIsBodyExpanded(nextIsExpanded);\n onExpandChange?.({ isExpanded: nextIsExpanded });\n }\n },\n [onExpandChange, isExpanded],\n );\n\n const contextValue = useMemo<CollapsibleContextState>(\n () => ({\n // controlled behavior if isExpanded is provided\n isExpanded: isExpanded ?? isBodyExpanded,\n onExpandChange: handleExpandChange,\n defaultIsExpanded: initialDefaultExpanded.current,\n direction,\n collapsibleBodyId,\n }),\n [isBodyExpanded, direction, handleExpandChange, isExpanded, collapsibleBodyId],\n );\n\n if (__DEV__) {\n Children.forEach(children, (child) => {\n if (\n !(\n isValidAllowedChildren(child, MetaConstants.CollapsibleBody) ||\n isValidAllowedChildren(child, MetaConstants.CollapsibleButton) ||\n isValidAllowedChildren(child, MetaConstants.CollapsibleLink)\n ) &&\n !_dangerouslyDisableValidations\n ) {\n throwBladeError({\n message: `only the following are supported as valid children: CollapsibleBody, CollapsibleButton, CollapsibleLink`,\n moduleName: 'Collapsible',\n });\n }\n });\n }\n\n return (\n <CollapsibleContext.Provider value={contextValue}>\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Collapsible, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n display=\"flex\"\n flexDirection={direction === 'bottom' ? 'column' : 'column-reverse'}\n alignItems=\"flex-start\"\n minWidth={_shouldApplyWidthRestrictions ? MIN_WIDTH : makeSize(size[0])}\n maxWidth={_shouldApplyWidthRestrictions ? MAX_WIDTH : MAX_WIDTH_NO_RESTRICTIONS}\n >\n {children}\n </BaseBox>\n </BaseBox>\n </CollapsibleContext.Provider>\n );\n};\n\nexport type { CollapsibleProps };\nexport { Collapsible };\n"],"names":["MIN_WIDTH","makeSize","size","Collapsible","_ref","children","_ref$direction","direction","_ref$defaultIsExpande","defaultIsExpanded","isExpanded","onExpandChange","testID","_ref$_shouldApplyWidt","_shouldApplyWidthRestrictions","_ref$_dangerouslyDisa","_dangerouslyDisableValidations","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","isBodyExpanded","setIsBodyExpanded","collapsibleBodyId","useId","MetaConstants","CollapsibleBody","initialDefaultExpanded","useRef","Boolean","handleExpandChange","useCallback","nextIsExpanded","contextValue","useMemo","current","__DEV__","Children","forEach","child","isValidAllowedChildren","CollapsibleButton","CollapsibleLink","throwBladeError","message","moduleName","_jsx","CollapsibleContext","Provider","value","BaseBox","Object","assign","metaAttribute","name","getStyledProps","makeAnalyticsAttribute","display","flexDirection","alignItems","minWidth","maxWidth","MAX_WIDTH","MAX_WIDTH_NO_RESTRICTIONS"],"mappings":";;;;;;;;;;;;;;;;;;;;;mKAiEA,IAAMA,SAA+B,CAAGC,QAAQ,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC,CAErD,IAAAC,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAUqB,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AAAA,aAAa,CAAC,CAAEC,IAAI,CAAE7B,aAAa,CAACzB,WAAW,CAAES,MAAM,CAANA,MAAO,CAAC,CAAC,CAC1D8C,cAAc,CAACzC,IAAI,CAAC,CACpB0C,sBAAsB,CAAC1C,IAAI,CAAC,CAAAZ,CAAAA,QAAA,CAEhC4C,GAAA,CAACI,OAAO,CACNO,CAAAA,OAAO,CAAC,MAAM,CACdC,aAAa,CAAEtD,SAAS,GAAK,QAAQ,CAAG,QAAQ,CAAG,gBAAiB,CACpEuD,UAAU,CAAC,YAAY,CACvBC,QAAQ,CAAEjD,6BAA6B,CAAGd,SAAS,CAAGC,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAE,CACxE8D,QAAQ,CAAElD,6BAA6B,CAAGmD,SAAS,CAAGC,yBAA0B,CAAA7D,QAAA,CAE/EA,QAAQ,CACF,CAAC,CACH,CAAA,CAAC,CACiB,CAAC,CAElC;;;;"}
@@ -1,3 +1,4 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
2
  import { CollapsibleBodyContent } from './CollapsibleBodyContent.native.js';
2
3
  import { useCollapsible } from './CollapsibleContext.js';
3
4
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
@@ -5,9 +6,10 @@ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js
5
6
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
6
7
  import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.native.js';
7
8
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
9
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
8
10
  import { jsx } from 'react/jsx-runtime';
9
11
 
10
- var _CollapsibleBody=function _CollapsibleBody(_ref){var children=_ref.children,testID=_ref.testID,width=_ref.width,_ref$_hasMargin=_ref._hasMargin,_hasMargin=_ref$_hasMargin===void 0?true:_ref$_hasMargin;var _useCollapsible=useCollapsible(),collapsibleBodyId=_useCollapsible.collapsibleBodyId,isExpanded=_useCollapsible.isExpanded;return jsx(BaseBox,Object.assign({id:collapsibleBodyId,width:width},makeAccessible({role:'region',hidden:!isExpanded}),metaAttribute({name:MetaConstants.CollapsibleBody,testID:testID}),{children:jsx(CollapsibleBodyContent,{_hasMargin:_hasMargin,children:children})}));};var CollapsibleBody=assignWithoutSideEffects(_CollapsibleBody,{componentId:MetaConstants.CollapsibleBody});
12
+ var _excluded=["children","testID","width","_hasMargin"];var _CollapsibleBody=function _CollapsibleBody(_ref){var children=_ref.children,testID=_ref.testID,width=_ref.width,_ref$_hasMargin=_ref._hasMargin,_hasMargin=_ref$_hasMargin===void 0?true:_ref$_hasMargin,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),collapsibleBodyId=_useCollapsible.collapsibleBodyId,isExpanded=_useCollapsible.isExpanded;return jsx(BaseBox,Object.assign({id:collapsibleBodyId,width:width},makeAccessible({role:'region',hidden:!isExpanded}),metaAttribute({name:MetaConstants.CollapsibleBody,testID:testID}),makeAnalyticsAttribute(rest),{children:jsx(CollapsibleBodyContent,{_hasMargin:_hasMargin,children:children})}));};var CollapsibleBody=assignWithoutSideEffects(_CollapsibleBody,{componentId:MetaConstants.CollapsibleBody});
11
13
 
12
14
  export { CollapsibleBody };
13
15
  //# sourceMappingURL=CollapsibleBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleBody.js","sources":["../../../../../src/components/Collapsible/CollapsibleBody.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { CollapsibleBodyContent } from './CollapsibleBodyContent';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { CollapsibleBodyProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst _CollapsibleBody = ({\n children,\n testID,\n width,\n _hasMargin = true,\n}: CollapsibleBodyProps): ReactElement => {\n const { collapsibleBodyId, isExpanded } = useCollapsible();\n return (\n <BaseBox\n id={collapsibleBodyId}\n width={width}\n {...makeAccessible({ role: 'region', hidden: !isExpanded })}\n {...metaAttribute({ name: MetaConstants.CollapsibleBody, testID })}\n >\n <CollapsibleBodyContent _hasMargin={_hasMargin}>{children}</CollapsibleBodyContent>\n </BaseBox>\n );\n};\n\nconst CollapsibleBody = assignWithoutSideEffects(_CollapsibleBody, {\n componentId: MetaConstants.CollapsibleBody,\n});\n\nexport type { CollapsibleBodyProps };\nexport { CollapsibleBody };\n"],"names":["_CollapsibleBody","_ref","children","testID","width","_ref$_hasMargin","_hasMargin","_useCollapsible","useCollapsible","collapsibleBodyId","isExpanded","_jsx","BaseBox","Object","assign","id","makeAccessible","role","hidden","metaAttribute","name","MetaConstants","CollapsibleBody","CollapsibleBodyContent","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;AASA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAKoB,CAAA,IAJxCC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,KAAK,CAAAH,IAAA,CAALG,KAAK,CAAAC,eAAA,CAAAJ,IAAA,CACLK,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CAAA,CAAA,IAAI,CAAAA,eAAA,CAEjB,IAAAE,eAAA,CAA0CC,cAAc,EAAE,CAAlDC,iBAAiB,CAAAF,eAAA,CAAjBE,iBAAiB,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CACrC,OACEC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,CACNC,CAAAA,EAAE,CAAEN,iBAAkB,CACtBL,KAAK,CAAEA,KAAM,EACTY,cAAc,CAAC,CAAEC,IAAI,CAAE,QAAQ,CAAEC,MAAM,CAAE,CAACR,UAAW,CAAC,CAAC,CACvDS,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,eAAe,CAAEnB,MAAM,CAANA,MAAO,CAAC,CAAC,CAAA,CAAAD,QAAA,CAElES,GAAA,CAACY,sBAAsB,CAAA,CAACjB,UAAU,CAAEA,UAAW,CAAAJ,QAAA,CAAEA,QAAQ,CAAyB,CAAC,CAC5E,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAoB,eAAe,CAAGE,wBAAwB,CAACxB,gBAAgB,CAAE,CACjEyB,WAAW,CAAEJ,aAAa,CAACC,eAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"CollapsibleBody.js","sources":["../../../../../src/components/Collapsible/CollapsibleBody.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { CollapsibleBodyContent } from './CollapsibleBodyContent';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { CollapsibleBodyProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _CollapsibleBody = ({\n children,\n testID,\n width,\n _hasMargin = true,\n ...rest\n}: CollapsibleBodyProps): ReactElement => {\n const { collapsibleBodyId, isExpanded } = useCollapsible();\n return (\n <BaseBox\n id={collapsibleBodyId}\n width={width}\n {...makeAccessible({ role: 'region', hidden: !isExpanded })}\n {...metaAttribute({ name: MetaConstants.CollapsibleBody, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <CollapsibleBodyContent _hasMargin={_hasMargin}>{children}</CollapsibleBodyContent>\n </BaseBox>\n );\n};\n\nconst CollapsibleBody = assignWithoutSideEffects(_CollapsibleBody, {\n componentId: MetaConstants.CollapsibleBody,\n});\n\nexport type { CollapsibleBodyProps };\nexport { CollapsibleBody };\n"],"names":["_CollapsibleBody","_ref","children","testID","width","_ref$_hasMargin","_hasMargin","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","collapsibleBodyId","isExpanded","_jsx","BaseBox","Object","assign","id","makeAccessible","role","hidden","metaAttribute","name","MetaConstants","CollapsibleBody","makeAnalyticsAttribute","CollapsibleBodyContent","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;yDAUA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAMoB,CALxC,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,KAAK,CAAAH,IAAA,CAALG,KAAK,CAAAC,eAAA,CAAAJ,IAAA,CACLK,UAAU,CAAVA,UAAU,CAAAD,eAAA,UAAG,IAAI,CAAAA,eAAA,CACdE,IAAI,CAAAC,wBAAA,CAAAP,IAAA,CAAAQ,SAAA,EAEP,IAAAC,eAAA,CAA0CC,cAAc,EAAE,CAAlDC,iBAAiB,CAAAF,eAAA,CAAjBE,iBAAiB,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CACrC,OACEC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACNC,EAAE,CAAEN,iBAAkB,CACtBR,KAAK,CAAEA,KAAM,CACTe,CAAAA,cAAc,CAAC,CAAEC,IAAI,CAAE,QAAQ,CAAEC,MAAM,CAAE,CAACR,UAAW,CAAC,CAAC,CACvDS,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACC,eAAe,CAAEtB,MAAM,CAANA,MAAO,CAAC,CAAC,CAC9DuB,sBAAsB,CAACnB,IAAI,CAAC,CAAA,CAAAL,QAAA,CAEhCY,GAAA,CAACa,sBAAsB,CAAA,CAACrB,UAAU,CAAEA,UAAW,CAAAJ,QAAA,CAAEA,QAAQ,CAAyB,CAAC,EAC5E,CAAC,CAEd,CAAC,CAEK,IAAAuB,eAAe,CAAGG,wBAAwB,CAAC5B,gBAAgB,CAAE,CACjE6B,WAAW,CAAEL,aAAa,CAACC,eAC7B,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
1
2
  import { forwardRef, useCallback } from 'react';
2
3
  import { useCollapsible } from './CollapsibleContext.js';
3
4
  import BaseButton from '../Button/BaseButton/BaseButton.js';
@@ -8,9 +9,10 @@ import 'react-native';
8
9
  import '@babel/runtime/helpers/slicedToArray';
9
10
  import { isReactNative } from '../../utils/platform/isReactNative.js';
10
11
  import '../BladeProvider/useTheme.js';
12
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
11
13
  import { jsx } from 'react/jsx-runtime';
12
14
 
13
- var _CollapsibleButton=function _CollapsibleButton(_ref,ref){var children=_ref.children,variant=_ref.variant,size=_ref.size,icon=_ref.icon,iconPosition=_ref.iconPosition,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel;var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseButton,{variant:variant,size:size,icon:icon,iconPosition:iconPosition,isDisabled:isDisabled,testID:testID,ref:ref,onClick:toggleIsExpanded,alignSelf:isReactNative()?'flex-start':undefined,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded},children:children});};var CollapsibleButton=assignWithoutSideEffects(forwardRef(_CollapsibleButton),{displayName:'CollapsibleButton',componentId:MetaConstants.CollapsibleButton});
15
+ var _excluded=["children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel"];var _CollapsibleButton=function _CollapsibleButton(_ref,ref){var children=_ref.children,variant=_ref.variant,size=_ref.size,icon=_ref.icon,iconPosition=_ref.iconPosition,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseButton,Object.assign({variant:variant,size:size,icon:icon,iconPosition:iconPosition,isDisabled:isDisabled,testID:testID,ref:ref,onClick:toggleIsExpanded,alignSelf:isReactNative()?'flex-start':undefined,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},makeAnalyticsAttribute(rest),{children:children}));};var CollapsibleButton=assignWithoutSideEffects(forwardRef(_CollapsibleButton),{displayName:'CollapsibleButton',componentId:MetaConstants.CollapsibleButton});
14
16
 
15
17
  export { CollapsibleButton };
16
18
  //# sourceMappingURL=CollapsibleButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleButton.js","sources":["../../../../../src/components/Collapsible/CollapsibleButton.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { forwardRef, useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { ButtonProps } from '~components/Button';\nimport type { IconComponent } from '~components/Icons';\nimport BaseButton from '~components/Button/BaseButton';\nimport type { BladeElementRef } from '~utils/types';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { isReactNative } from '~utils';\n\ntype CollapsibleButtonProps = Pick<\n ButtonProps,\n | 'variant'\n | 'size'\n | 'iconPosition'\n | 'isDisabled'\n | 'testID'\n | 'accessibilityLabel'\n | 'icon'\n | 'children'\n>;\n\nconst _CollapsibleButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n CollapsibleButtonProps\n> = (\n { children, variant, size, icon, iconPosition, isDisabled, testID, accessibilityLabel },\n ref,\n): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseButton\n variant={variant}\n size={size}\n // Button handles case of icon and children so we don't care about icon type safety here\n icon={icon as IconComponent}\n iconPosition={iconPosition}\n isDisabled={isDisabled}\n testID={testID}\n ref={ref}\n onClick={toggleIsExpanded}\n alignSelf={isReactNative() ? 'flex-start' : undefined}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n >\n {children}\n </BaseButton>\n );\n};\n\nconst CollapsibleButton = assignWithoutSideEffects(forwardRef(_CollapsibleButton), {\n displayName: 'CollapsibleButton',\n componentId: MetaConstants.CollapsibleButton,\n});\n\nexport type { CollapsibleButtonProps };\nexport { CollapsibleButton };\n"],"names":["_CollapsibleButton","_ref","ref","children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseButton","onClick","alignSelf","isReactNative","undefined","accessibilityProps","label","controls","expanded","CollapsibleButton","assignWithoutSideEffects","forwardRef","displayName","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;AAuBA,IAAMA,kBAGL,CAAG,SAHEA,kBAGLA,CAAAC,IAAA,CAECC,GAAG,CACc,CAAA,IAFfC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAEC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CAAEC,IAAI,CAAAJ,IAAA,CAAJI,IAAI,CAAEC,IAAI,CAAAL,IAAA,CAAJK,IAAI,CAAEC,YAAY,CAAAN,IAAA,CAAZM,YAAY,CAAEC,UAAU,CAAAP,IAAA,CAAVO,UAAU,CAAEC,MAAM,CAAAR,IAAA,CAANQ,MAAM,CAAEC,kBAAkB,CAAAT,IAAA,CAAlBS,kBAAkB,CAGrF,IAAAC,eAAA,CAA0DC,cAAc,EAAE,CAAlEC,cAAc,CAAAF,eAAA,CAAdE,cAAc,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CAAEC,iBAAiB,CAAAJ,eAAA,CAAjBI,iBAAiB,CAErD,IAAMC,gBAAgB,CAAGC,WAAW,CAAC,UAAA,CAAA,OAAMJ,cAAc,CAAC,CAACC,UAAU,CAAC,CAAA,CAAA,CAAE,CACtED,cAAc,CACdC,UAAU,CACX,CAAC,CAEF,OACEI,GAAA,CAACC,UAAU,CAAA,CACTf,OAAO,CAAEA,OAAQ,CACjBC,IAAI,CAAEA,IAAK,CAEXC,IAAI,CAAEA,IAAsB,CAC5BC,YAAY,CAAEA,YAAa,CAC3BC,UAAU,CAAEA,UAAW,CACvBC,MAAM,CAAEA,MAAO,CACfP,GAAG,CAAEA,GAAI,CACTkB,OAAO,CAAEJ,gBAAiB,CAC1BK,SAAS,CAAEC,aAAa,EAAE,CAAG,YAAY,CAAGC,SAAU,CACtDC,kBAAkB,CAAE,CAClBC,KAAK,CAAEf,kBAAkB,CACzBgB,QAAQ,CAAEX,iBAAiB,CAC3BY,QAAQ,CAAEb,UACZ,CAAE,CAAAX,QAAA,CAEDA,QAAQ,CACC,CAAC,CAEjB,CAAC,CAEK,IAAAyB,iBAAiB,CAAGC,wBAAwB,CAACC,UAAU,CAAC9B,kBAAkB,CAAC,CAAE,CACjF+B,WAAW,CAAE,mBAAmB,CAChCC,WAAW,CAAEC,aAAa,CAACL,iBAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"CollapsibleButton.js","sources":["../../../../../src/components/Collapsible/CollapsibleButton.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { forwardRef, useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport type { ButtonProps } from '~components/Button';\nimport type { IconComponent } from '~components/Icons';\nimport BaseButton from '~components/Button/BaseButton';\nimport type { BladeElementRef, DataAnalyticsAttribute } from '~utils/types';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { isReactNative } from '~utils';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleButtonProps = Pick<\n ButtonProps,\n | 'variant'\n | 'size'\n | 'iconPosition'\n | 'isDisabled'\n | 'testID'\n | 'accessibilityLabel'\n | 'icon'\n | 'children'\n> &\n DataAnalyticsAttribute;\n\nconst _CollapsibleButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n CollapsibleButtonProps\n> = (\n { children, variant, size, icon, iconPosition, isDisabled, testID, accessibilityLabel, ...rest },\n ref,\n): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseButton\n variant={variant}\n size={size}\n // Button handles case of icon and children so we don't care about icon type safety here\n icon={icon as IconComponent}\n iconPosition={iconPosition}\n isDisabled={isDisabled}\n testID={testID}\n ref={ref}\n onClick={toggleIsExpanded}\n alignSelf={isReactNative() ? 'flex-start' : undefined}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseButton>\n );\n};\n\nconst CollapsibleButton = assignWithoutSideEffects(forwardRef(_CollapsibleButton), {\n displayName: 'CollapsibleButton',\n componentId: MetaConstants.CollapsibleButton,\n});\n\nexport type { CollapsibleButtonProps };\nexport { CollapsibleButton };\n"],"names":["_CollapsibleButton","_ref","ref","children","variant","size","icon","iconPosition","isDisabled","testID","accessibilityLabel","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseButton","Object","assign","onClick","alignSelf","isReactNative","undefined","accessibilityProps","label","controls","expanded","makeAnalyticsAttribute","CollapsibleButton","assignWithoutSideEffects","forwardRef","displayName","componentId","MetaConstants"],"mappings":";;;;;;;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,YAAY,CAAGC,SAAU,CACtDC,kBAAkB,CAAE,CAClBC,KAAK,CAAEpB,kBAAkB,CACzBqB,QAAQ,CAAEb,iBAAiB,CAC3Bc,QAAQ,CAAEf,UACZ,CAAE,CAAA,CACEgB,sBAAsB,CAACtB,IAAI,CAAC,CAAAR,CAAAA,QAAA,CAE/BA,QAAQ,CACC,CAAA,CAAC,CAEjB,CAAC,CAEK,IAAA+B,iBAAiB,CAAGC,wBAAwB,CAACC,UAAU,CAACpC,kBAAkB,CAAC,CAAE,CACjFqC,WAAW,CAAE,mBAAmB,CAChCC,WAAW,CAAEC,aAAa,CAACL,iBAC7B,CAAC;;;;"}
@@ -12,9 +12,10 @@ import 'react-native';
12
12
  import '../../tokens/global/typography.js';
13
13
  import '../../tokens/global/motion.js';
14
14
  import '../BladeProvider/useTheme.js';
15
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
15
16
  import { jsx } from 'react/jsx-runtime';
16
17
 
17
- var _excluded=["children","size","color","isDisabled","testID","accessibilityLabel"];var _CollapsibleLink=function _CollapsibleLink(_ref){var children=_ref.children,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,styledProps=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseLink,Object.assign({variant:"button",size:size,color:color,icon:CollapsibleChevronIcon,iconPosition:"right",isDisabled:isDisabled,testID:testID,onClick:toggleIsExpanded,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},getStyledProps(styledProps),{children:children}));};var CollapsibleLink=assignWithoutSideEffects(_CollapsibleLink,{componentId:MetaConstants.CollapsibleLink});
18
+ var _excluded=["children","size","color","isDisabled","testID","accessibilityLabel"];var _CollapsibleLink=function _CollapsibleLink(_ref){var children=_ref.children,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel,rest=_objectWithoutProperties(_ref,_excluded);var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseLink,Object.assign({variant:"button",size:size,color:color,icon:CollapsibleChevronIcon,iconPosition:"right",isDisabled:isDisabled,testID:testID,onClick:toggleIsExpanded,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded}},getStyledProps(rest),makeAnalyticsAttribute(rest),{children:children}));};var CollapsibleLink=assignWithoutSideEffects(_CollapsibleLink,{componentId:MetaConstants.CollapsibleLink});
18
19
 
19
20
  export { CollapsibleLink };
20
21
  //# sourceMappingURL=CollapsibleLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsibleLink.js","sources":["../../../../../src/components/Collapsible/CollapsibleLink.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport { CollapsibleChevronIcon } from './CollapsibleChevronIcon';\nimport type { LinkProps } from '~components/Link';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\n\ntype CollapsibleLinkProps = Pick<\n LinkProps,\n 'color' | 'size' | 'isDisabled' | 'testID' | 'accessibilityLabel' | 'children'\n> &\n StyledPropsBlade;\n\nconst _CollapsibleLink = ({\n children,\n size,\n color = 'primary',\n isDisabled,\n testID,\n accessibilityLabel,\n ...styledProps\n}: CollapsibleLinkProps): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseLink\n variant=\"button\"\n size={size}\n color={color}\n icon={CollapsibleChevronIcon}\n iconPosition=\"right\"\n isDisabled={isDisabled}\n testID={testID}\n onClick={toggleIsExpanded}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...getStyledProps(styledProps)}\n >\n {children}\n </BaseLink>\n );\n};\n\nconst CollapsibleLink = assignWithoutSideEffects(_CollapsibleLink, {\n componentId: MetaConstants.CollapsibleLink,\n});\n\nexport type { CollapsibleLinkProps };\nexport { CollapsibleLink };\n"],"names":["_CollapsibleLink","_ref","children","size","_ref$color","color","isDisabled","testID","accessibilityLabel","styledProps","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseLink","Object","assign","variant","icon","CollapsibleChevronIcon","iconPosition","onClick","accessibilityProps","label","controls","expanded","getStyledProps","CollapsibleLink","assignWithoutSideEffects","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;qFAiBA,IAAMA,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,CAQoB,CAAA,IAPxCC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAAAC,UAAA,CAAAH,IAAA,CACJI,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAG,KAAA,CAAA,CAAA,SAAS,CAAAA,UAAA,CACjBE,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,MAAM,CAAAN,IAAA,CAANM,MAAM,CACNC,kBAAkB,CAAAP,IAAA,CAAlBO,kBAAkB,CACfC,WAAW,CAAAC,wBAAA,CAAAT,IAAA,CAAAU,SAAA,CAAA,CAEd,IAAAC,eAAA,CAA0DC,cAAc,EAAE,CAAlEC,cAAc,CAAAF,eAAA,CAAdE,cAAc,CAAEC,UAAU,CAAAH,eAAA,CAAVG,UAAU,CAAEC,iBAAiB,CAAAJ,eAAA,CAAjBI,iBAAiB,CAErD,IAAMC,gBAAgB,CAAGC,WAAW,CAAC,UAAA,CAAA,OAAMJ,cAAc,CAAC,CAACC,UAAU,CAAC,CAAA,CAAA,CAAE,CACtED,cAAc,CACdC,UAAU,CACX,CAAC,CAEF,OACEI,GAAA,CAACC,QAAQ,CAAAC,MAAA,CAAAC,MAAA,CACPC,CAAAA,OAAO,CAAC,QAAQ,CAChBpB,IAAI,CAAEA,IAAK,CACXE,KAAK,CAAEA,KAAM,CACbmB,IAAI,CAAEC,sBAAuB,CAC7BC,YAAY,CAAC,OAAO,CACpBpB,UAAU,CAAEA,UAAW,CACvBC,MAAM,CAAEA,MAAO,CACfoB,OAAO,CAAEV,gBAAiB,CAC1BW,kBAAkB,CAAE,CAClBC,KAAK,CAAErB,kBAAkB,CACzBsB,QAAQ,CAAEd,iBAAiB,CAC3Be,QAAQ,CAAEhB,UACZ,CAAE,CAAA,CACEiB,cAAc,CAACvB,WAAW,CAAC,EAAAP,QAAA,CAE9BA,QAAQ,CAAA,CACD,CAAC,CAEf,CAAC,CAEK,IAAA+B,eAAe,CAAGC,wBAAwB,CAAClC,gBAAgB,CAAE,CACjEmC,WAAW,CAAEC,aAAa,CAACH,eAC7B,CAAC;;;;"}
1
+ {"version":3,"file":"CollapsibleLink.js","sources":["../../../../../src/components/Collapsible/CollapsibleLink.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { useCallback } from 'react';\nimport { useCollapsible } from './CollapsibleContext';\nimport { CollapsibleChevronIcon } from './CollapsibleChevronIcon';\nimport type { LinkProps } from '~components/Link';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype CollapsibleLinkProps = Pick<\n LinkProps,\n 'color' | 'size' | 'isDisabled' | 'testID' | 'accessibilityLabel' | 'children'\n> &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _CollapsibleLink = ({\n children,\n size,\n color = 'primary',\n isDisabled,\n testID,\n accessibilityLabel,\n ...rest\n}: CollapsibleLinkProps): ReactElement => {\n const { onExpandChange, isExpanded, collapsibleBodyId } = useCollapsible();\n\n const toggleIsExpanded = useCallback(() => onExpandChange(!isExpanded), [\n onExpandChange,\n isExpanded,\n ]);\n\n return (\n <BaseLink\n variant=\"button\"\n size={size}\n color={color}\n icon={CollapsibleChevronIcon}\n iconPosition=\"right\"\n isDisabled={isDisabled}\n testID={testID}\n onClick={toggleIsExpanded}\n accessibilityProps={{\n label: accessibilityLabel,\n controls: collapsibleBodyId,\n expanded: isExpanded,\n }}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseLink>\n );\n};\n\nconst CollapsibleLink = assignWithoutSideEffects(_CollapsibleLink, {\n componentId: MetaConstants.CollapsibleLink,\n});\n\nexport type { CollapsibleLinkProps };\nexport { CollapsibleLink };\n"],"names":["_CollapsibleLink","_ref","children","size","_ref$color","color","isDisabled","testID","accessibilityLabel","rest","_objectWithoutProperties","_excluded","_useCollapsible","useCollapsible","onExpandChange","isExpanded","collapsibleBodyId","toggleIsExpanded","useCallback","_jsx","BaseLink","Object","assign","variant","icon","CollapsibleChevronIcon","iconPosition","onClick","accessibilityProps","label","controls","expanded","getStyledProps","makeAnalyticsAttribute","CollapsibleLink","assignWithoutSideEffects","componentId","Meta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B,sBAAsB,CAACxB,IAAI,CAAC,CAAAP,CAAAA,QAAA,CAE/BA,QAAQ,CACD,CAAA,CAAC,CAEf,CAAC,CAEK,IAAAgC,eAAe,CAAGC,wBAAwB,CAACnC,gBAAgB,CAAE,CACjEoC,WAAW,CAAEC,aAAa,CAACH,eAC7B,CAAC;;;;"}
@@ -22,8 +22,9 @@ import '../BottomSheet/BottomSheetStack.js';
22
22
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
23
23
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
24
24
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
25
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
25
26
 
26
- var _excluded=["value","max","color","emphasis","size","testID"];var getColorProps=function getColorProps(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis;var props={textColor:'feedback.text.neutral.intense',backgroundColor:'feedback.background.neutral.subtle'};if(color==='primary'){props.textColor=emphasis==='intense'?`surface.text.staticWhite.normal`:`surface.text.primary.normal`;props.backgroundColor=`surface.background.primary.${emphasis}`;}else {props.textColor=emphasis==='intense'?`surface.text.staticWhite.normal`:`feedback.text.${color}.intense`;props.backgroundColor=`feedback.background.${color}.${emphasis}`;}return props;};var _Counter=function _Counter(_ref2){var value=_ref2.value,max=_ref2.max,_ref2$color=_ref2.color,color=_ref2$color===void 0?'neutral':_ref2$color,_ref2$emphasis=_ref2.emphasis,emphasis=_ref2$emphasis===void 0?'subtle':_ref2$emphasis,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded);var content=`${value}`;if(max&&value>max){content=`${max}+`;}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps({color:color,emphasis:emphasis}),backgroundColor=_getColorProps.backgroundColor,textColor=_getColorProps.textColor;var counterTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'medium'}};return jsx(BaseBox,Object.assign({display:isReactNative()?'flex':'inline-flex'},metaAttribute({name:MetaConstants.Counter,testID:testID}),getStyledProps(styledProps),{children:jsx(StyledCounter,{minHeight:makeSize(counterHeight[size]),backgroundColor:backgroundColor,size:size,platform:platform,children:jsx(BaseBox,{paddingX:horizontalPadding[size],display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:jsx(Text,Object.assign({},counterTextSizes[size],{textAlign:"center",weight:"medium",truncateAfterLines:1,color:textColor,children:content}))})})}));};var Counter=assignWithoutSideEffects(_Counter,{displayName:'Counter',componentId:'Counter'});
27
+ var _excluded=["value","max","color","emphasis","size","testID"];var getColorProps=function getColorProps(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis;var props={textColor:'feedback.text.neutral.intense',backgroundColor:'feedback.background.neutral.subtle'};if(color==='primary'){props.textColor=emphasis==='intense'?`surface.text.staticWhite.normal`:`surface.text.primary.normal`;props.backgroundColor=`surface.background.primary.${emphasis}`;}else {props.textColor=emphasis==='intense'?`surface.text.staticWhite.normal`:`feedback.text.${color}.intense`;props.backgroundColor=`feedback.background.${color}.${emphasis}`;}return props;};var _Counter=function _Counter(_ref2){var value=_ref2.value,max=_ref2.max,_ref2$color=_ref2.color,color=_ref2$color===void 0?'neutral':_ref2$color,_ref2$emphasis=_ref2.emphasis,emphasis=_ref2$emphasis===void 0?'subtle':_ref2$emphasis,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,testID=_ref2.testID,rest=_objectWithoutProperties(_ref2,_excluded);var content=`${value}`;if(max&&value>max){content=`${max}+`;}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps({color:color,emphasis:emphasis}),backgroundColor=_getColorProps.backgroundColor,textColor=_getColorProps.textColor;var counterTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'medium'}};return jsx(BaseBox,Object.assign({display:isReactNative()?'flex':'inline-flex'},metaAttribute({name:MetaConstants.Counter,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsx(StyledCounter,{minHeight:makeSize(counterHeight[size]),backgroundColor:backgroundColor,size:size,platform:platform,children:jsx(BaseBox,{paddingX:horizontalPadding[size],display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:jsx(Text,Object.assign({},counterTextSizes[size],{textAlign:"center",weight:"medium",truncateAfterLines:1,color:textColor,children:content}))})})}));};var Counter=assignWithoutSideEffects(_Counter,{displayName:'Counter',componentId:'Counter'});
27
28
 
28
29
  export { Counter };
29
30
  //# sourceMappingURL=Counter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Counter.js","sources":["../../../../../src/components/Counter/Counter.tsx"],"sourcesContent":["import { StyledCounter } from './StyledCounter';\nimport type { StyledCounterProps } from './types';\nimport { counterHeight, horizontalPadding } from './counterTokens';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useTheme } from '~components/BladeProvider';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { TestID } from '~utils/types';\nimport { isReactNative, makeSize } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nexport type CounterProps = {\n /**\n * Sets the value for the counter.\n */\n value: number;\n /**\n * Sets the max value for the counter.\n * If value exceedes `max` it will render `value+`\n */\n max?: number;\n /**\n * Sets the color of the counter.\n *\n * @default 'neutral'\n */\n color?: FeedbackColors | 'primary';\n /**\n * Sets the contrast of the counter.\n *\n * @default 'subtle'\n */\n emphasis?: SubtleOrIntense;\n /**\n * Sets the size of the counter.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n} & TestID &\n StyledPropsBlade;\n\ntype ColorProps = {\n textColor: BaseTextProps['color'];\n backgroundColor: StyledCounterProps['backgroundColor'];\n};\n\nconst getColorProps = ({\n color = 'neutral',\n emphasis = 'subtle',\n}: {\n color: NonNullable<CounterProps['color']>;\n emphasis: NonNullable<CounterProps['emphasis']>;\n}): ColorProps => {\n const props: ColorProps = {\n textColor: 'feedback.text.neutral.intense',\n backgroundColor: 'feedback.background.neutral.subtle',\n };\n\n if (color === 'primary') {\n // primary color badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `surface.text.primary.normal`;\n props.backgroundColor = `surface.background.primary.${emphasis}`;\n } else {\n // feedback colors badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `feedback.text.${color}.intense`;\n props.backgroundColor = `feedback.background.${color}.${emphasis}`;\n }\n return props;\n};\n\nconst _Counter = ({\n value,\n max,\n color = 'neutral',\n emphasis = 'subtle',\n size = 'medium',\n testID,\n ...styledProps\n}: CounterProps): React.ReactElement => {\n let content = `${value}`;\n if (max && value > max) {\n content = `${max}+`;\n }\n\n const { platform } = useTheme();\n const { backgroundColor, textColor } = getColorProps({\n color,\n emphasis,\n });\n\n const counterTextSizes = {\n small: {\n variant: 'body',\n size: 'xsmall',\n },\n medium: {\n variant: 'body',\n size: 'small',\n },\n large: {\n variant: 'body',\n size: 'medium',\n },\n } as const;\n\n return (\n <BaseBox\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n {...metaAttribute({ name: MetaConstants.Counter, testID })}\n {...getStyledProps(styledProps)}\n >\n <StyledCounter\n minHeight={makeSize(counterHeight[size])}\n backgroundColor={backgroundColor}\n size={size}\n platform={platform}\n >\n <BaseBox\n paddingX={horizontalPadding[size]}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n overflow=\"hidden\"\n >\n <Text\n {...counterTextSizes[size]}\n textAlign=\"center\"\n weight=\"medium\"\n truncateAfterLines={1}\n color={textColor}\n >\n {content}\n </Text>\n </BaseBox>\n </StyledCounter>\n </BaseBox>\n );\n};\n\nconst Counter = assignWithoutSideEffects(_Counter, {\n displayName: 'Counter',\n componentId: 'Counter',\n});\n\nexport { Counter };\n"],"names":["getColorProps","_ref","_ref$color","color","_ref$emphasis","emphasis","props","textColor","backgroundColor","_Counter","_ref2","value","max","_ref2$color","_ref2$emphasis","_ref2$size","size","testID","styledProps","_objectWithoutProperties","_excluded","content","_useTheme","useTheme","platform","_getColorProps","counterTextSizes","small","variant","medium","large","_jsx","BaseBox","Object","assign","display","isReactNative","metaAttribute","name","MetaConstants","Counter","getStyledProps","children","StyledCounter","minHeight","makeSize","counterHeight","paddingX","horizontalPadding","flexDirection","justifyContent","alignItems","overflow","Text","textAlign","weight","truncateAfterLines","assignWithoutSideEffects","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;iEAmDA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CAMD,CAAA,IAAAC,UAAA,CAAAD,IAAA,CALhBE,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,aAAA,CAAAH,IAAA,CACjBI,QAAQ,CAARA,QAAQ,CAAAD,aAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,aAAA,CAKnB,IAAME,KAAiB,CAAG,CACxBC,SAAS,CAAE,+BAA+B,CAC1CC,eAAe,CAAE,oCACnB,CAAC,CAED,GAAIL,KAAK,GAAK,SAAS,CAAE,CAEvBG,KAAK,CAACC,SAAS,CACbF,QAAQ,GAAK,SAAS,CAAI,CAAA,+BAAA,CAAgC,CAAI,CAAA,2BAAA,CAA4B,CAC5FC,KAAK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AE,CAAE,CACtBrD,KAAK,CAAEI,SAAU,CAAAmC,QAAA,CAEhBrB,OAAO,CAAA,CACJ,CAAC,CACA,CAAC,CACG,CAAC,CAAA,CACT,CAAC,CAEd,CAAC,CAEK,IAAAmB,OAAO,CAAGiB,wBAAwB,CAAChD,QAAQ,CAAE,CACjDiD,WAAW,CAAE,SAAS,CACtBC,WAAW,CAAE,SACf,CAAC;;;;"}
1
+ {"version":3,"file":"Counter.js","sources":["../../../../../src/components/Counter/Counter.tsx"],"sourcesContent":["import { StyledCounter } from './StyledCounter';\nimport type { StyledCounterProps } from './types';\nimport { counterHeight, horizontalPadding } from './counterTokens';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useTheme } from '~components/BladeProvider';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { isReactNative, makeSize } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nexport type CounterProps = {\n /**\n * Sets the value for the counter.\n */\n value: number;\n /**\n * Sets the max value for the counter.\n * If value exceedes `max` it will render `value+`\n */\n max?: number;\n /**\n * Sets the color of the counter.\n *\n * @default 'neutral'\n */\n color?: FeedbackColors | 'primary';\n /**\n * Sets the contrast of the counter.\n *\n * @default 'subtle'\n */\n emphasis?: SubtleOrIntense;\n /**\n * Sets the size of the counter.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\ntype ColorProps = {\n textColor: BaseTextProps['color'];\n backgroundColor: StyledCounterProps['backgroundColor'];\n};\n\nconst getColorProps = ({\n color = 'neutral',\n emphasis = 'subtle',\n}: {\n color: NonNullable<CounterProps['color']>;\n emphasis: NonNullable<CounterProps['emphasis']>;\n}): ColorProps => {\n const props: ColorProps = {\n textColor: 'feedback.text.neutral.intense',\n backgroundColor: 'feedback.background.neutral.subtle',\n };\n\n if (color === 'primary') {\n // primary color badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `surface.text.primary.normal`;\n props.backgroundColor = `surface.background.primary.${emphasis}`;\n } else {\n // feedback colors badge\n props.textColor =\n emphasis === 'intense' ? `surface.text.staticWhite.normal` : `feedback.text.${color}.intense`;\n props.backgroundColor = `feedback.background.${color}.${emphasis}`;\n }\n return props;\n};\n\nconst _Counter = ({\n value,\n max,\n color = 'neutral',\n emphasis = 'subtle',\n size = 'medium',\n testID,\n ...rest\n}: CounterProps): React.ReactElement => {\n let content = `${value}`;\n if (max && value > max) {\n content = `${max}+`;\n }\n\n const { platform } = useTheme();\n const { backgroundColor, textColor } = getColorProps({\n color,\n emphasis,\n });\n\n const counterTextSizes = {\n small: {\n variant: 'body',\n size: 'xsmall',\n },\n medium: {\n variant: 'body',\n size: 'small',\n },\n large: {\n variant: 'body',\n size: 'medium',\n },\n } as const;\n\n return (\n <BaseBox\n display={(isReactNative() ? 'flex' : 'inline-flex') as never}\n {...metaAttribute({ name: MetaConstants.Counter, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <StyledCounter\n minHeight={makeSize(counterHeight[size])}\n backgroundColor={backgroundColor}\n size={size}\n platform={platform}\n >\n <BaseBox\n paddingX={horizontalPadding[size]}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent=\"center\"\n alignItems=\"center\"\n overflow=\"hidden\"\n >\n <Text\n {...counterTextSizes[size]}\n textAlign=\"center\"\n weight=\"medium\"\n truncateAfterLines={1}\n color={textColor}\n >\n {content}\n </Text>\n </BaseBox>\n </StyledCounter>\n </BaseBox>\n );\n};\n\nconst Counter = assignWithoutSideEffects(_Counter, {\n displayName: 'Counter',\n componentId: 'Counter',\n});\n\nexport { Counter };\n"],"names":["getColorProps","_ref","_ref$color","color","_ref$emphasis","emphasis","props","textColor","backgroundColor","_Counter","_ref2","value","max","_ref2$color","_ref2$emphasis","_ref2$size","size","testID","rest","_objectWithoutProperties","_excluded","content","_useTheme","useTheme","platform","_getColorProps","counterTextSizes","small","variant","medium","large","_jsx","BaseBox","Object","assign","display","isReactNative","metaAttribute","name","MetaConstants","Counter","getStyledProps","makeAnalyticsAttribute","children","StyledCounter","minHeight","makeSize","counterHeight","paddingX","horizontalPadding","flexDirection","justifyContent","alignItems","overflow","Text","textAlign","weight","truncateAfterLines","assignWithoutSideEffects","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,KAAA,CAAA,OAAA,CAAA,UAAA,CAAA,MAAA,CAAA,QAAA,CAAA,CAqDA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CAMD,CAAA,IAAAC,UAAA,CAAAD,IAAA,CALhBE,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,aAAA,CAAAH,IAAA,CACjBI,QAAQ,CAARA,QAAQ,CAAAD,aAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,aAAA,CAKnB,IAAME,KAAiB,CAAG,CACxBC,SAAS,CAAE,+BAA+B,CAC1CC,eAAe,CAAE,oCACnB,CAAC,CAED,GAAIL,KAAK,GAAK,SAAS,CAAE,CAEvBG,KAAK,CAACC,SAAS,CACbF,QAAQ,GAAK,SAAS,CAAI,CAAgC,+BAAA,CAAA,CAAI,CAA4B,2BAAA,CAAA,CAC5FC,KAAK,CAACE,eAAe,CAAI,CAA6BH,2BAAAA,EAAAA,QAAS,CAAC,CAAA,CAClE,CAAC,KAAM,CAELC,KAAK,CAACC,SAAS,CACbF,QAAQ,GA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,CAAA,CAAC,CACA,CAAC,CACG,CAAC,CACT,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAmB,OAAO,CAAGkB,wBAAwB,CAACjD,QAAQ,CAAE,CACjDkD,WAAW,CAAE,SAAS,CACtBC,WAAW,CAAE,SACf,CAAC;;;;"}
@@ -18,9 +18,10 @@ import { getComponentId, isValidAllowedChildren } from '../../utils/isValidAllow
18
18
  import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
19
19
  import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
20
20
  import { useControllableState } from '../../utils/useControllable.js';
21
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
21
22
  import { jsx } from 'react/jsx-runtime';
22
23
 
23
- var _excluded=["children","isOpen","onOpenChange","selectionType","testID","_width"];var validDropdownChildren=[dropdownComponentIds.BaseBox,dropdownComponentIds.triggers.SelectInput,dropdownComponentIds.triggers.SearchInput,dropdownComponentIds.triggers.DropdownButton,dropdownComponentIds.triggers.DropdownLink,dropdownComponentIds.DropdownOverlay,dropdownComponentIds.triggers.AutoComplete,ComponentIds.BottomSheet];var _Dropdown=function _Dropdown(_ref){var children=_ref.children,isOpenControlled=_ref.isOpen,onOpenChange=_ref.onOpenChange,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,testID=_ref.testID,_width=_ref._width,styledProps=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),options=_React$useState2[0],setOptions=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),filteredValues=_React$useState4[0],setFilteredValues=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState9,2),activeIndex=_React$useState10[0],setActiveIndex=_React$useState10[1];var _React$useState11=React__default.useState(-1),_React$useState12=_slicedToArray(_React$useState11,2),activeTagIndex=_React$useState12[0],setActiveTagIndex=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),shouldIgnoreBlurAnimation=_React$useState14[0],setShouldIgnoreBlurAnimation=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasFooterAction=_React$useState16[0],setHasFooterAction=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),hasAutoCompleteInBottomSheetHeader=_React$useState18[0],setHasAutoCompleteInBottomSheetHeader=_React$useState18[1];var _React$useState19=React__default.useState(false),_React$useState20=_slicedToArray(_React$useState19,2),isKeydownPressed=_React$useState20[0],setIsKeydownPressed=_React$useState20[1];var _React$useState21=React__default.useState(0),_React$useState22=_slicedToArray(_React$useState21,2),changeCallbackTriggerer=_React$useState22[0],setChangeCallbackTriggerer=_React$useState22[1];var _React$useState23=React__default.useState(false),_React$useState24=_slicedToArray(_React$useState23,2),isControlled=_React$useState24[0],setIsControlled=_React$useState24[1];var _React$useState25=React__default.useState(false),_React$useState26=_slicedToArray(_React$useState25,2),dropdownHasBottomSheet=_React$useState26[0],setDropdownHasBottomSheet=_React$useState26[1];var triggererWrapperRef=React__default.useRef(null);var triggererRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var dropdownTriggerer=React__default.useRef();var isTagDismissedRef=React__default.useRef({value:false});var visibleTagsCountRef=React__default.useRef({value:0});var dropdownContainerRef=React__default.useRef(null);var dropdownBaseId=useId('dropdown');var isDropdownOpenRef=React__default.useRef(isOpenControlled);var _useControllableState=useControllableState({value:isOpenControlled,defaultValue:false,onChange:function onChange(isOpenControlledValue){isDropdownOpenRef.current=isOpenControlledValue;onOpenChange==null?void 0:onOpenChange(isOpenControlledValue);}}),_useControllableState2=_slicedToArray(_useControllableState,2),isDropdownOpen=_useControllableState2[0],setIsDropdownOpen=_useControllableState2[1];isDropdownOpenRef.current=isDropdownOpen;var setIsOpen=function setIsOpen(isOpenValue){isDropdownOpenRef.current=isOpenValue;setIsDropdownOpen(function(){return isOpenValue;});};var close=React__default.useCallback(function(){setActiveTagIndex(-1);setIsOpen(false);},[]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){if(__DEV__){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throwBladeError({message:`Dropdown can only have one of following elements as children - \n\n ${validDropdownChildren.join(', ')} \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,moduleName:'Dropdown'});}}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SearchInput)){dropdownTriggerer.current='SearchInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.AutoComplete)){dropdownTriggerer.current='AutoComplete';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,filteredValues:filteredValues,setFilteredValues:setFilteredValues,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,triggererWrapperRef:triggererWrapperRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasAutoCompleteInBottomSheetHeader:hasAutoCompleteInBottomSheetHeader,setHasAutoCompleteInBottomSheetHeader:setHasAutoCompleteInBottomSheetHeader,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled,isTagDismissedRef:isTagDismissedRef};},[isDropdownOpen,isOpenControlled,selectedIndices,controlledValueIndices,options,filteredValues,activeIndex,activeTagIndex,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,hasAutoCompleteInBottomSheetHeader:hasAutoCompleteInBottomSheetHeader,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,hasAutoCompleteInBottomSheetHeader,isDropdownOpen,close]);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:dropdownContainerRef},metaAttribute({name:MetaConstants.Dropdown,testID:testID}),getStyledProps(styledProps),{width:_width,children:jsx(BaseBox,{position:"relative",textAlign:'left',children:children})}))})});};var Dropdown=assignWithoutSideEffects(_Dropdown,{componentId:dropdownComponentIds.Dropdown});
24
+ var _excluded=["children","isOpen","onOpenChange","selectionType","testID","_width"];var validDropdownChildren=[dropdownComponentIds.BaseBox,dropdownComponentIds.triggers.SelectInput,dropdownComponentIds.triggers.SearchInput,dropdownComponentIds.triggers.DropdownButton,dropdownComponentIds.triggers.DropdownLink,dropdownComponentIds.DropdownOverlay,dropdownComponentIds.triggers.AutoComplete,ComponentIds.BottomSheet];var _Dropdown=function _Dropdown(_ref){var children=_ref.children,isOpenControlled=_ref.isOpen,onOpenChange=_ref.onOpenChange,_ref$selectionType=_ref.selectionType,selectionType=_ref$selectionType===void 0?'single':_ref$selectionType,testID=_ref.testID,_width=_ref._width,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React__default.useState([]),_React$useState2=_slicedToArray(_React$useState,2),options=_React$useState2[0],setOptions=_React$useState2[1];var _React$useState3=React__default.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),filteredValues=_React$useState4[0],setFilteredValues=_React$useState4[1];var _React$useState5=React__default.useState([]),_React$useState6=_slicedToArray(_React$useState5,2),selectedIndices=_React$useState6[0],setSelectedIndices=_React$useState6[1];var _React$useState7=React__default.useState([]),_React$useState8=_slicedToArray(_React$useState7,2),controlledValueIndices=_React$useState8[0],setControlledValueIndices=_React$useState8[1];var _React$useState9=React__default.useState(-1),_React$useState10=_slicedToArray(_React$useState9,2),activeIndex=_React$useState10[0],setActiveIndex=_React$useState10[1];var _React$useState11=React__default.useState(-1),_React$useState12=_slicedToArray(_React$useState11,2),activeTagIndex=_React$useState12[0],setActiveTagIndex=_React$useState12[1];var _React$useState13=React__default.useState(false),_React$useState14=_slicedToArray(_React$useState13,2),shouldIgnoreBlurAnimation=_React$useState14[0],setShouldIgnoreBlurAnimation=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),hasFooterAction=_React$useState16[0],setHasFooterAction=_React$useState16[1];var _React$useState17=React__default.useState(false),_React$useState18=_slicedToArray(_React$useState17,2),hasAutoCompleteInBottomSheetHeader=_React$useState18[0],setHasAutoCompleteInBottomSheetHeader=_React$useState18[1];var _React$useState19=React__default.useState(false),_React$useState20=_slicedToArray(_React$useState19,2),isKeydownPressed=_React$useState20[0],setIsKeydownPressed=_React$useState20[1];var _React$useState21=React__default.useState(0),_React$useState22=_slicedToArray(_React$useState21,2),changeCallbackTriggerer=_React$useState22[0],setChangeCallbackTriggerer=_React$useState22[1];var _React$useState23=React__default.useState(false),_React$useState24=_slicedToArray(_React$useState23,2),isControlled=_React$useState24[0],setIsControlled=_React$useState24[1];var _React$useState25=React__default.useState(false),_React$useState26=_slicedToArray(_React$useState25,2),dropdownHasBottomSheet=_React$useState26[0],setDropdownHasBottomSheet=_React$useState26[1];var triggererWrapperRef=React__default.useRef(null);var triggererRef=React__default.useRef(null);var actionListItemRef=React__default.useRef(null);var dropdownTriggerer=React__default.useRef();var isTagDismissedRef=React__default.useRef({value:false});var visibleTagsCountRef=React__default.useRef({value:0});var dropdownContainerRef=React__default.useRef(null);var dropdownBaseId=useId('dropdown');var isDropdownOpenRef=React__default.useRef(isOpenControlled);var _useControllableState=useControllableState({value:isOpenControlled,defaultValue:false,onChange:function onChange(isOpenControlledValue){isDropdownOpenRef.current=isOpenControlledValue;onOpenChange==null?void 0:onOpenChange(isOpenControlledValue);}}),_useControllableState2=_slicedToArray(_useControllableState,2),isDropdownOpen=_useControllableState2[0],setIsDropdownOpen=_useControllableState2[1];isDropdownOpenRef.current=isDropdownOpen;var setIsOpen=function setIsOpen(isOpenValue){isDropdownOpenRef.current=isOpenValue;setIsDropdownOpen(function(){return isOpenValue;});};var close=React__default.useCallback(function(){setActiveTagIndex(-1);setIsOpen(false);},[]);React__default.Children.map(children,function(child){if(React__default.isValidElement(child)){if(__DEV__){var _getComponentId;if(!validDropdownChildren.includes((_getComponentId=getComponentId(child))!=null?_getComponentId:'')){throwBladeError({message:`Dropdown can only have one of following elements as children - \n\n ${validDropdownChildren.join(', ')} \n\n Check out: https://blade.razorpay.com/?path=/story/components-dropdown`,moduleName:'Dropdown'});}}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SelectInput)){dropdownTriggerer.current='SelectInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.SearchInput)){dropdownTriggerer.current='SearchInput';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.DropdownButton)){dropdownTriggerer.current='DropdownButton';}if(isValidAllowedChildren(child,dropdownComponentIds.triggers.AutoComplete)){dropdownTriggerer.current='AutoComplete';}}});var contextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,controlledValueIndices:controlledValueIndices,setControlledValueIndices:setControlledValueIndices,options:options,setOptions:setOptions,filteredValues:filteredValues,setFilteredValues:setFilteredValues,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,dropdownBaseId:dropdownBaseId,triggererRef:triggererRef,triggererWrapperRef:triggererWrapperRef,actionListItemRef:actionListItemRef,selectionType:selectionType,hasFooterAction:hasFooterAction,setHasFooterAction:setHasFooterAction,hasAutoCompleteInBottomSheetHeader:hasAutoCompleteInBottomSheetHeader,setHasAutoCompleteInBottomSheetHeader:setHasAutoCompleteInBottomSheetHeader,dropdownTriggerer:dropdownTriggerer.current,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,setIsControlled:setIsControlled,isTagDismissedRef:isTagDismissedRef};},[isDropdownOpen,isOpenControlled,selectedIndices,controlledValueIndices,options,filteredValues,activeIndex,activeTagIndex,shouldIgnoreBlurAnimation,selectionType,hasFooterAction,isKeydownPressed,changeCallbackTriggerer,isControlled]);var BottomSheetAndDropdownGlueContextValue=React__default.useMemo(function(){return {isOpen:isDropdownOpen,dropdownHasBottomSheet:dropdownHasBottomSheet,hasAutoCompleteInBottomSheetHeader:hasAutoCompleteInBottomSheetHeader,setDropdownHasBottomSheet:setDropdownHasBottomSheet,onBottomSheetDismiss:close};},[dropdownHasBottomSheet,hasAutoCompleteInBottomSheetHeader,isDropdownOpen,close]);return jsx(BottomSheetAndDropdownGlueContext.Provider,{value:BottomSheetAndDropdownGlueContextValue,children:jsx(DropdownContext.Provider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:dropdownContainerRef},metaAttribute({name:MetaConstants.Dropdown,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{width:_width,children:jsx(BaseBox,{position:"relative",textAlign:'left',children:children})}))})});};var Dropdown=assignWithoutSideEffects(_Dropdown,{componentId:dropdownComponentIds.Dropdown});
24
25
 
25
26
  export { Dropdown };
26
27
  //# sourceMappingURL=Dropdown.js.map