@razorpay/blade 11.38.1 → 12.0.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 (637) hide show
  1. package/build/lib/native/components/Accordion/Accordion.js +2 -2
  2. package/build/lib/native/components/Accordion/Accordion.js.map +1 -1
  3. package/build/lib/native/components/Accordion/AccordionButton.native.js +8 -10
  4. package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
  5. package/build/lib/native/components/Accordion/AccordionItemBody.js +7 -8
  6. package/build/lib/native/components/Accordion/AccordionItemBody.js.map +1 -1
  7. package/build/lib/native/components/Accordion/AccordionItemHeader.js +3 -8
  8. package/build/lib/native/components/Accordion/AccordionItemHeader.js.map +1 -1
  9. package/build/lib/native/components/Accordion/commonStyles.js +1 -1
  10. package/build/lib/native/components/Accordion/commonStyles.js.map +1 -1
  11. package/build/lib/native/components/ActionList/ActionList.js +1 -1
  12. package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
  13. package/build/lib/native/components/ActionList/ActionListItem.js +9 -8
  14. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  15. package/build/lib/native/components/ActionList/ActionListNoResults.js +2 -1
  16. package/build/lib/native/components/ActionList/ActionListNoResults.js.map +1 -1
  17. package/build/lib/native/components/Alert/Alert.js +4 -3
  18. package/build/lib/native/components/Alert/Alert.js.map +1 -1
  19. package/build/lib/native/components/Amount/Amount.js +4 -2
  20. package/build/lib/native/components/Amount/Amount.js.map +1 -1
  21. package/build/lib/native/components/Badge/Badge.js +10 -9
  22. package/build/lib/native/components/Badge/Badge.js.map +1 -1
  23. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +11 -10
  24. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  25. package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js +8 -6
  26. package/build/lib/native/components/BaseMenu/BaseMenuItem/BaseMenuItem.js.map +1 -1
  27. package/build/lib/native/components/BottomNav/BottomNav.native.js +4 -10
  28. package/build/lib/native/components/BottomNav/BottomNav.native.js.map +1 -1
  29. package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  30. package/build/lib/native/components/Box/Box.js +1 -1
  31. package/build/lib/native/components/Box/Box.js.map +1 -1
  32. package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
  33. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  34. package/build/lib/native/components/Card/Card.js +1 -1
  35. package/build/lib/native/components/Card/Card.js.map +1 -1
  36. package/build/lib/native/components/Card/CardFooter.js +4 -8
  37. package/build/lib/native/components/Card/CardFooter.js.map +1 -1
  38. package/build/lib/native/components/Card/CardHeader.js +5 -9
  39. package/build/lib/native/components/Card/CardHeader.js.map +1 -1
  40. package/build/lib/native/components/Card/CardRoot.native.js +1 -1
  41. package/build/lib/native/components/Card/CardRoot.native.js.map +1 -1
  42. package/build/lib/native/components/Carousel/Carousel.native.js +1 -1
  43. package/build/lib/native/components/Carousel/Carousel.native.js.map +1 -1
  44. package/build/lib/native/components/Carousel/Indicators/StyledIndicatorButton.native.js +1 -1
  45. package/build/lib/native/components/Carousel/Indicators/StyledIndicatorButton.native.js.map +1 -1
  46. package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js +1 -1
  47. package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
  48. package/build/lib/native/components/Carousel/NavigationButton/getNavigationButtonStyles.js +1 -1
  49. package/build/lib/native/components/Carousel/NavigationButton/getNavigationButtonStyles.js.map +1 -1
  50. package/build/lib/native/components/Checkbox/Checkbox.js +6 -4
  51. package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
  52. package/build/lib/native/components/Checkbox/CheckboxIcon/Fade.native.js +1 -1
  53. package/build/lib/native/components/Checkbox/CheckboxIcon/Fade.native.js.map +1 -1
  54. package/build/lib/native/components/Chip/Chip.js +5 -3
  55. package/build/lib/native/components/Chip/Chip.js.map +1 -1
  56. package/build/lib/native/components/Chip/ChipGroup.js +4 -3
  57. package/build/lib/native/components/Chip/ChipGroup.js.map +1 -1
  58. package/build/lib/native/components/Chip/chipTokens.js +1 -1
  59. package/build/lib/native/components/Chip/chipTokens.js.map +1 -1
  60. package/build/lib/native/components/Collapsible/Collapsible.js +2 -2
  61. package/build/lib/native/components/Collapsible/Collapsible.js.map +1 -1
  62. package/build/lib/native/components/Collapsible/commonStyles.js +1 -1
  63. package/build/lib/native/components/Collapsible/commonStyles.js.map +1 -1
  64. package/build/lib/native/components/Counter/Counter.js +13 -12
  65. package/build/lib/native/components/Counter/Counter.js.map +1 -1
  66. package/build/lib/native/components/Divider/Divider.js +2 -2
  67. package/build/lib/native/components/Divider/Divider.js.map +1 -1
  68. package/build/lib/native/components/Drawer/Drawer.native.js +4 -10
  69. package/build/lib/native/components/Drawer/Drawer.native.js.map +1 -1
  70. package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js +4 -9
  71. package/build/lib/native/components/Drawer/DrawerSubcomponents.native.js.map +1 -1
  72. package/build/lib/native/components/Dropdown/Dropdown.js +2 -1
  73. package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
  74. package/build/lib/native/components/Fade/Fade.native.js +11 -0
  75. package/build/lib/native/components/Fade/Fade.native.js.map +1 -0
  76. package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js +3 -9
  77. package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  78. package/build/lib/native/components/Form/FormLabel.js +10 -10
  79. package/build/lib/native/components/Icons/RayIcon/RayIcon.js +12 -0
  80. package/build/lib/native/components/Icons/RayIcon/RayIcon.js.map +1 -0
  81. package/build/lib/native/components/Indicator/Indicator.js +7 -6
  82. package/build/lib/native/components/Indicator/Indicator.js.map +1 -1
  83. package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js +1 -1
  84. package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js.map +1 -1
  85. package/build/lib/native/components/Input/BaseInput/BaseInput.js +2 -1
  86. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  87. package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js +3 -3
  88. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +8 -10
  89. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  90. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +9 -8
  91. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
  92. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +1 -1
  93. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  94. package/build/lib/native/components/Link/BaseLink/BaseLink.js +1 -1
  95. package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
  96. package/build/lib/native/components/List/List.js +1 -1
  97. package/build/lib/native/components/List/List.js.map +1 -1
  98. package/build/lib/native/components/List/ListItem.js +8 -10
  99. package/build/lib/native/components/List/ListItem.js.map +1 -1
  100. package/build/lib/native/components/List/ListItemCode.js +3 -9
  101. package/build/lib/native/components/List/ListItemCode.js.map +1 -1
  102. package/build/lib/native/components/List/ListItemText.js +3 -8
  103. package/build/lib/native/components/List/ListItemText.js.map +1 -1
  104. package/build/lib/native/components/Menu/Menu.native.js +4 -10
  105. package/build/lib/native/components/Menu/Menu.native.js.map +1 -1
  106. package/build/lib/native/components/Menu/MenuItem.native.js +4 -10
  107. package/build/lib/native/components/Menu/MenuItem.native.js.map +1 -1
  108. package/build/lib/native/components/Menu/MenuOverlay.native.js +4 -10
  109. package/build/lib/native/components/Menu/MenuOverlay.native.js.map +1 -1
  110. package/build/lib/native/components/Menu/VisualSubComponents/MenuDivider.native.js +4 -10
  111. package/build/lib/native/components/Menu/VisualSubComponents/MenuDivider.native.js.map +1 -1
  112. package/build/lib/native/components/Menu/VisualSubComponents/MenuHeaderFooter.native.js +4 -10
  113. package/build/lib/native/components/Menu/VisualSubComponents/MenuHeaderFooter.native.js.map +1 -1
  114. package/build/lib/native/components/Modal/Modal.native.js +4 -9
  115. package/build/lib/native/components/Modal/Modal.native.js.map +1 -1
  116. package/build/lib/native/components/Modal/ModalBody.native.js +3 -8
  117. package/build/lib/native/components/Modal/ModalBody.native.js.map +1 -1
  118. package/build/lib/native/components/Modal/ModalFooter.native.js +3 -8
  119. package/build/lib/native/components/Modal/ModalFooter.native.js.map +1 -1
  120. package/build/lib/native/components/Modal/ModalHeader.native.js +3 -8
  121. package/build/lib/native/components/Modal/ModalHeader.native.js.map +1 -1
  122. package/build/lib/native/components/Morph/Morph.native.js +11 -0
  123. package/build/lib/native/components/Morph/Morph.native.js.map +1 -0
  124. package/build/lib/native/components/Move/Move.native.js +11 -0
  125. package/build/lib/native/components/Move/Move.native.js.map +1 -0
  126. package/build/lib/native/components/Popover/PopoverContent.js +6 -8
  127. package/build/lib/native/components/Popover/PopoverContent.js.map +1 -1
  128. package/build/lib/native/components/Popover/PopoverContentWrapper.native.js +1 -1
  129. package/build/lib/native/components/Popover/PopoverContentWrapper.native.js.map +1 -1
  130. package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js +7 -9
  131. package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js.map +1 -1
  132. package/build/lib/native/components/ProgressBar/CircularProgressLabel.js +3 -8
  133. package/build/lib/native/components/ProgressBar/CircularProgressLabel.js.map +1 -1
  134. package/build/lib/native/components/ProgressBar/ProgressBar.js +2 -2
  135. package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
  136. package/build/lib/native/components/Radio/Radio.js +2 -1
  137. package/build/lib/native/components/Radio/Radio.js.map +1 -1
  138. package/build/lib/native/components/Radio/RadioIcon/Fade.native.js +1 -1
  139. package/build/lib/native/components/Radio/RadioIcon/Fade.native.js.map +1 -1
  140. package/build/lib/native/components/Radio/RadioIcon/RadioIconWrapperStyles.js +1 -1
  141. package/build/lib/native/components/Radio/RadioIcon/RadioIconWrapperStyles.js.map +1 -1
  142. package/build/lib/native/components/Scale/Scale.native.js +11 -0
  143. package/build/lib/native/components/Scale/Scale.native.js.map +1 -0
  144. package/build/lib/native/components/SideNav/SideNav.native.js +4 -10
  145. package/build/lib/native/components/SideNav/SideNav.native.js.map +1 -1
  146. package/build/lib/native/components/SideNav/SideNavBody.native.js +4 -10
  147. package/build/lib/native/components/SideNav/SideNavBody.native.js.map +1 -1
  148. package/build/lib/native/components/SideNav/SideNavFooter.native.js +4 -10
  149. package/build/lib/native/components/SideNav/SideNavFooter.native.js.map +1 -1
  150. package/build/lib/native/components/SideNav/SideNavItems/SideNavItem.native.js +4 -10
  151. package/build/lib/native/components/SideNav/SideNavItems/SideNavItem.native.js.map +1 -1
  152. package/build/lib/native/components/SideNav/SideNavItems/SideNavLink.native.js +4 -10
  153. package/build/lib/native/components/SideNav/SideNavItems/SideNavLink.native.js.map +1 -1
  154. package/build/lib/native/components/SideNav/SideNavLevel.native.js +4 -10
  155. package/build/lib/native/components/SideNav/SideNavLevel.native.js.map +1 -1
  156. package/build/lib/native/components/SideNav/SideNavSection.native.js +4 -10
  157. package/build/lib/native/components/SideNav/SideNavSection.native.js.map +1 -1
  158. package/build/lib/native/components/SideNav/tokens.js.map +1 -1
  159. package/build/lib/native/components/Skeleton/PulseAnimation.native.js +1 -1
  160. package/build/lib/native/components/Skeleton/PulseAnimation.native.js.map +1 -1
  161. package/build/lib/native/components/Skeleton/Skeleton.js +2 -2
  162. package/build/lib/native/components/Skeleton/Skeleton.js.map +1 -1
  163. package/build/lib/native/components/Slide/Slide.native.js +11 -0
  164. package/build/lib/native/components/Slide/Slide.native.js.map +1 -0
  165. package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js +4 -3
  166. package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  167. package/build/lib/native/components/Spinner/BaseSpinner/spinnerTokens.js +1 -1
  168. package/build/lib/native/components/Spinner/BaseSpinner/spinnerTokens.js.map +1 -1
  169. package/build/lib/native/components/Spinner/Spinner/Spinner.js +2 -1
  170. package/build/lib/native/components/Spinner/Spinner/Spinner.js.map +1 -1
  171. package/build/lib/native/components/StepGroup/StepGroup.native.js +4 -10
  172. package/build/lib/native/components/StepGroup/StepGroup.native.js.map +1 -1
  173. package/build/lib/native/components/StepGroup/StepItem.native.js +4 -10
  174. package/build/lib/native/components/StepGroup/StepItem.native.js.map +1 -1
  175. package/build/lib/native/components/Switch/Switch.js +2 -1
  176. package/build/lib/native/components/Switch/Switch.js.map +1 -1
  177. package/build/lib/native/components/Switch/getTrackStyles.js +1 -1
  178. package/build/lib/native/components/Switch/getTrackStyles.js.map +1 -1
  179. package/build/lib/native/components/Switch/switchTokens.js +1 -1
  180. package/build/lib/native/components/Switch/switchTokens.js.map +1 -1
  181. package/build/lib/native/components/Table/Table.native.js +4 -9
  182. package/build/lib/native/components/Table/Table.native.js.map +1 -1
  183. package/build/lib/native/components/Table/TableBody.native.js +3 -8
  184. package/build/lib/native/components/Table/TableBody.native.js.map +1 -1
  185. package/build/lib/native/components/Table/TableEditableCell.native.js +3 -9
  186. package/build/lib/native/components/Table/TableEditableCell.native.js.map +1 -1
  187. package/build/lib/native/components/Table/TableFooter.native.js +3 -8
  188. package/build/lib/native/components/Table/TableFooter.native.js.map +1 -1
  189. package/build/lib/native/components/Table/TableHeader.native.js +3 -8
  190. package/build/lib/native/components/Table/TableHeader.native.js.map +1 -1
  191. package/build/lib/native/components/Table/TablePagination.native.js +3 -8
  192. package/build/lib/native/components/Table/TablePagination.native.js.map +1 -1
  193. package/build/lib/native/components/Table/TableToolbar.native.js +3 -8
  194. package/build/lib/native/components/Table/TableToolbar.native.js.map +1 -1
  195. package/build/lib/native/components/Table/tokens.js.map +1 -1
  196. package/build/lib/native/components/Tabs/Tabs.native.js +6 -8
  197. package/build/lib/native/components/Tabs/Tabs.native.js.map +1 -1
  198. package/build/lib/native/components/Tag/AnimatedTag.native.js +1 -1
  199. package/build/lib/native/components/Tag/AnimatedTag.native.js.map +1 -1
  200. package/build/lib/native/components/Tag/Tag.js +3 -2
  201. package/build/lib/native/components/Tag/Tag.js.map +1 -1
  202. package/build/lib/native/components/Tooltip/TooltipContent.js +8 -8
  203. package/build/lib/native/components/Tooltip/TooltipContentWrapper.native.js +1 -1
  204. package/build/lib/native/components/Tooltip/TooltipContentWrapper.native.js.map +1 -1
  205. package/build/lib/native/components/TopNav/TabNav/TabNav.native.js +4 -10
  206. package/build/lib/native/components/TopNav/TabNav/TabNav.native.js.map +1 -1
  207. package/build/lib/native/components/TopNav/TabNav/TabNavItem.native.js +4 -10
  208. package/build/lib/native/components/TopNav/TabNav/TabNavItem.native.js.map +1 -1
  209. package/build/lib/native/components/TopNav/TopNav.native.js +4 -10
  210. package/build/lib/native/components/TopNav/TopNav.native.js.map +1 -1
  211. package/build/lib/native/components/Typography/Code/Code.js +1 -1
  212. package/build/lib/native/components/Typography/Code/Code.js.map +1 -1
  213. package/build/lib/native/components/Typography/Display/Display.js +2 -2
  214. package/build/lib/native/components/Typography/Display/Display.js.map +1 -1
  215. package/build/lib/native/components/Typography/Heading/Heading.js +2 -2
  216. package/build/lib/native/components/Typography/Heading/Heading.js.map +1 -1
  217. package/build/lib/native/components/Typography/Text/Text.js +2 -2
  218. package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
  219. package/build/lib/native/components/index.js +6 -0
  220. package/build/lib/native/components/index.js.map +1 -1
  221. package/build/lib/native/tokens/global/motion.js +1 -1
  222. package/build/lib/native/tokens/global/motion.js.map +1 -1
  223. package/build/lib/native/utils/getMotionRefs.js +4 -0
  224. package/build/lib/native/utils/getMotionRefs.js.map +1 -0
  225. package/build/lib/web/development/components/Accordion/Accordion.js +6 -3
  226. package/build/lib/web/development/components/Accordion/Accordion.js.map +1 -1
  227. package/build/lib/web/development/components/Accordion/commonStyles.js +1 -1
  228. package/build/lib/web/development/components/Accordion/commonStyles.js.map +1 -1
  229. package/build/lib/web/development/components/ActionList/ActionList.js +3 -0
  230. package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
  231. package/build/lib/web/development/components/Alert/Alert.js +6 -3
  232. package/build/lib/web/development/components/Alert/Alert.js.map +1 -1
  233. package/build/lib/web/development/components/Amount/Amount.js +3 -2
  234. package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
  235. package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js +12 -0
  236. package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -0
  237. package/build/lib/web/development/components/Badge/Badge.js +4 -2
  238. package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
  239. package/build/lib/web/development/components/BaseMotion/BaseMotion.js +123 -0
  240. package/build/lib/web/development/components/BaseMotion/BaseMotion.js.map +1 -0
  241. package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js +60 -0
  242. package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js.map +1 -0
  243. package/build/lib/web/development/components/BaseMotion/index.js +3 -0
  244. package/build/lib/web/development/components/BaseMotion/index.js.map +1 -0
  245. package/build/lib/web/development/components/BaseMotion/types.js +2 -0
  246. package/build/lib/web/development/components/BaseMotion/types.js.map +1 -0
  247. package/build/lib/web/development/components/BottomNav/BottomNav.web.js +4 -2
  248. package/build/lib/web/development/components/BottomNav/BottomNav.web.js.map +1 -1
  249. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +1 -1
  250. package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
  251. package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js +1 -1
  252. package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
  253. package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  254. package/build/lib/web/development/components/Box/Box.js +2 -2
  255. package/build/lib/web/development/components/Box/Box.js.map +1 -1
  256. package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js +3 -1
  257. package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js.map +1 -1
  258. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +1 -1
  259. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  260. package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js +1 -1
  261. package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
  262. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +3 -2
  263. package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  264. package/build/lib/web/development/components/Card/Card.js +3 -1
  265. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  266. package/build/lib/web/development/components/Card/CardRoot.web.js +6 -4
  267. package/build/lib/web/development/components/Card/CardRoot.web.js.map +1 -1
  268. package/build/lib/web/development/components/Carousel/Carousel.web.js +6 -3
  269. package/build/lib/web/development/components/Carousel/Carousel.web.js.map +1 -1
  270. package/build/lib/web/development/components/Carousel/Indicators/getIndicatorButtonStyles.js +1 -1
  271. package/build/lib/web/development/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
  272. package/build/lib/web/development/components/Carousel/NavigationButton/getNavigationButtonStyles.js +1 -1
  273. package/build/lib/web/development/components/Carousel/NavigationButton/getNavigationButtonStyles.js.map +1 -1
  274. package/build/lib/web/development/components/Checkbox/Checkbox.js +13 -3
  275. package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
  276. package/build/lib/web/development/components/Checkbox/CheckboxIcon/Fade.web.js +2 -2
  277. package/build/lib/web/development/components/Checkbox/CheckboxIcon/Fade.web.js.map +1 -1
  278. package/build/lib/web/development/components/Chip/Chip.js +11 -2
  279. package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
  280. package/build/lib/web/development/components/Chip/ChipGroup.js +5 -2
  281. package/build/lib/web/development/components/Chip/ChipGroup.js.map +1 -1
  282. package/build/lib/web/development/components/Chip/chipTokens.js +1 -1
  283. package/build/lib/web/development/components/Chip/chipTokens.js.map +1 -1
  284. package/build/lib/web/development/components/Collapsible/Collapsible.js +6 -3
  285. package/build/lib/web/development/components/Collapsible/Collapsible.js.map +1 -1
  286. package/build/lib/web/development/components/Collapsible/commonStyles.js +2 -2
  287. package/build/lib/web/development/components/Collapsible/commonStyles.js.map +1 -1
  288. package/build/lib/web/development/components/Counter/Counter.js +4 -2
  289. package/build/lib/web/development/components/Counter/Counter.js.map +1 -1
  290. package/build/lib/web/development/components/Divider/Divider.js +4 -2
  291. package/build/lib/web/development/components/Divider/Divider.js.map +1 -1
  292. package/build/lib/web/development/components/Drawer/Drawer.web.js +4 -4
  293. package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
  294. package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -3
  295. package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
  296. package/build/lib/web/development/components/Fade/Fade.web.js +62 -0
  297. package/build/lib/web/development/components/Fade/Fade.web.js.map +1 -0
  298. package/build/lib/web/development/components/Fade/index.js +2 -0
  299. package/build/lib/web/development/components/Fade/index.js.map +1 -0
  300. package/build/lib/web/development/components/FileUpload/FileUpload.web.js +11 -2
  301. package/build/lib/web/development/components/FileUpload/FileUpload.web.js.map +1 -1
  302. package/build/lib/web/development/components/FileUpload/fileUploadTokens.js +1 -1
  303. package/build/lib/web/development/components/FileUpload/fileUploadTokens.js.map +1 -1
  304. package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +1 -1
  305. package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
  306. package/build/lib/web/development/components/Icons/RayIcon/RayIcon.js +37 -0
  307. package/build/lib/web/development/components/Icons/RayIcon/RayIcon.js.map +1 -0
  308. package/build/lib/web/development/components/Icons/RayIcon/index.js +2 -0
  309. package/build/lib/web/development/components/Icons/RayIcon/index.js.map +1 -0
  310. package/build/lib/web/development/components/Icons/index.js +1 -0
  311. package/build/lib/web/development/components/Icons/index.js.map +1 -1
  312. package/build/lib/web/development/components/Indicator/Indicator.js +4 -2
  313. package/build/lib/web/development/components/Indicator/Indicator.js.map +1 -1
  314. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +3 -3
  315. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  316. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +21 -7
  317. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  318. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +2 -2
  319. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  320. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +1 -1
  321. package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
  322. package/build/lib/web/development/components/List/List.js +5 -3
  323. package/build/lib/web/development/components/List/List.js.map +1 -1
  324. package/build/lib/web/development/components/Modal/Modal.web.js +2 -2
  325. package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
  326. package/build/lib/web/development/components/Modal/ModalBackdrop.js +2 -2
  327. package/build/lib/web/development/components/Modal/ModalBackdrop.js.map +1 -1
  328. package/build/lib/web/development/components/Morph/Morph.web.js +48 -0
  329. package/build/lib/web/development/components/Morph/Morph.web.js.map +1 -0
  330. package/build/lib/web/development/components/Morph/index.js +2 -0
  331. package/build/lib/web/development/components/Morph/index.js.map +1 -0
  332. package/build/lib/web/development/components/Move/Move.web.js +66 -0
  333. package/build/lib/web/development/components/Move/Move.web.js.map +1 -0
  334. package/build/lib/web/development/components/Move/index.js +2 -0
  335. package/build/lib/web/development/components/Move/index.js.map +1 -0
  336. package/build/lib/web/development/components/ProgressBar/CircularProgressBar.web.js +1 -1
  337. package/build/lib/web/development/components/ProgressBar/CircularProgressBar.web.js.map +1 -1
  338. package/build/lib/web/development/components/ProgressBar/ProgressBar.js +8 -4
  339. package/build/lib/web/development/components/ProgressBar/ProgressBar.js.map +1 -1
  340. package/build/lib/web/development/components/Radio/Radio.js +13 -3
  341. package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
  342. package/build/lib/web/development/components/Radio/RadioIcon/Fade.web.js +3 -3
  343. package/build/lib/web/development/components/Radio/RadioIcon/Fade.web.js.map +1 -1
  344. package/build/lib/web/development/components/Radio/RadioIcon/RadioIconWrapperStyles.js +1 -1
  345. package/build/lib/web/development/components/Radio/RadioIcon/RadioIconWrapperStyles.js.map +1 -1
  346. package/build/lib/web/development/components/Scale/Scale.web.js +47 -0
  347. package/build/lib/web/development/components/Scale/Scale.web.js.map +1 -0
  348. package/build/lib/web/development/components/Scale/index.js +2 -0
  349. package/build/lib/web/development/components/Scale/index.js.map +1 -0
  350. package/build/lib/web/development/components/SideNav/SideNav.web.js +7 -5
  351. package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
  352. package/build/lib/web/development/components/SideNav/tokens.js +1 -1
  353. package/build/lib/web/development/components/SideNav/tokens.js.map +1 -1
  354. package/build/lib/web/development/components/Skeleton/PulseAnimation.web.js +1 -1
  355. package/build/lib/web/development/components/Skeleton/PulseAnimation.web.js.map +1 -1
  356. package/build/lib/web/development/components/Skeleton/Skeleton.js +4 -1
  357. package/build/lib/web/development/components/Skeleton/Skeleton.js.map +1 -1
  358. package/build/lib/web/development/components/Slide/Slide.web.js +119 -0
  359. package/build/lib/web/development/components/Slide/Slide.web.js.map +1 -0
  360. package/build/lib/web/development/components/Slide/index.js +2 -0
  361. package/build/lib/web/development/components/Slide/index.js.map +1 -0
  362. package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js +6 -3
  363. package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  364. package/build/lib/web/development/components/Spinner/BaseSpinner/spinnerTokens.js +1 -1
  365. package/build/lib/web/development/components/Spinner/BaseSpinner/spinnerTokens.js.map +1 -1
  366. package/build/lib/web/development/components/Spinner/Spinner/Spinner.js +4 -1
  367. package/build/lib/web/development/components/Spinner/Spinner/Spinner.js.map +1 -1
  368. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +2 -2
  369. package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  370. package/build/lib/web/development/components/Stagger/StaggerProvider.js +13 -0
  371. package/build/lib/web/development/components/Stagger/StaggerProvider.js.map +1 -0
  372. package/build/lib/web/development/components/StepGroup/StepGroup.web.js +5 -3
  373. package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
  374. package/build/lib/web/development/components/StepGroup/StepItem.web.js +1 -1
  375. package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
  376. package/build/lib/web/development/components/Switch/AnimatedThumbIcon.web.js +1 -1
  377. package/build/lib/web/development/components/Switch/AnimatedThumbIcon.web.js.map +1 -1
  378. package/build/lib/web/development/components/Switch/Switch.js +13 -3
  379. package/build/lib/web/development/components/Switch/Switch.js.map +1 -1
  380. package/build/lib/web/development/components/Switch/getTrackStyles.js +1 -1
  381. package/build/lib/web/development/components/Switch/getTrackStyles.js.map +1 -1
  382. package/build/lib/web/development/components/Switch/switchTokens.js +6 -6
  383. package/build/lib/web/development/components/Switch/switchTokens.js.map +1 -1
  384. package/build/lib/web/development/components/Table/Table.web.js +4 -2
  385. package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
  386. package/build/lib/web/development/components/Table/tokens.js +2 -2
  387. package/build/lib/web/development/components/Table/tokens.js.map +1 -1
  388. package/build/lib/web/development/components/Tabs/TabIndicator.web.js +1 -1
  389. package/build/lib/web/development/components/Tabs/TabIndicator.web.js.map +1 -1
  390. package/build/lib/web/development/components/Tabs/TabItem.web.js +2 -2
  391. package/build/lib/web/development/components/Tabs/TabItem.web.js.map +1 -1
  392. package/build/lib/web/development/components/Tabs/Tabs.web.js +34 -1
  393. package/build/lib/web/development/components/Tabs/Tabs.web.js.map +1 -1
  394. package/build/lib/web/development/components/Tag/AnimatedTag.web.js +2 -2
  395. package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
  396. package/build/lib/web/development/components/Tag/Tag.js +31 -29
  397. package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
  398. package/build/lib/web/development/components/Toast/Toast.web.js +2 -2
  399. package/build/lib/web/development/components/Toast/Toast.web.js.map +1 -1
  400. package/build/lib/web/development/components/Toast/ToastContainer.web.js +1 -1
  401. package/build/lib/web/development/components/Toast/ToastContainer.web.js.map +1 -1
  402. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +2 -2
  403. package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  404. package/build/lib/web/development/components/TopNav/TopNav.web.js +4 -2
  405. package/build/lib/web/development/components/TopNav/TopNav.web.js.map +1 -1
  406. package/build/lib/web/development/components/Typography/Code/Code.js +30 -27
  407. package/build/lib/web/development/components/Typography/Code/Code.js.map +1 -1
  408. package/build/lib/web/development/components/Typography/Display/Display.js +6 -2
  409. package/build/lib/web/development/components/Typography/Display/Display.js.map +1 -1
  410. package/build/lib/web/development/components/Typography/Heading/Heading.js +4 -1
  411. package/build/lib/web/development/components/Typography/Heading/Heading.js.map +1 -1
  412. package/build/lib/web/development/components/Typography/Text/Text.js +6 -10
  413. package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
  414. package/build/lib/web/development/components/index.js +11 -0
  415. package/build/lib/web/development/components/index.js.map +1 -1
  416. package/build/lib/web/development/tokens/global/motion.js +22 -28
  417. package/build/lib/web/development/tokens/global/motion.js.map +1 -1
  418. package/build/lib/web/development/utils/cssBezierToArray.js +12 -0
  419. package/build/lib/web/development/utils/cssBezierToArray.js.map +1 -0
  420. package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js +1 -1
  421. package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
  422. package/build/lib/web/development/utils/getMotionRefs.js +86 -0
  423. package/build/lib/web/development/utils/getMotionRefs.js.map +1 -0
  424. package/build/lib/web/development/utils/msToSeconds.js +6 -0
  425. package/build/lib/web/development/utils/msToSeconds.js.map +1 -0
  426. package/build/lib/web/production/components/Accordion/Accordion.js +6 -3
  427. package/build/lib/web/production/components/Accordion/Accordion.js.map +1 -1
  428. package/build/lib/web/production/components/Accordion/commonStyles.js +1 -1
  429. package/build/lib/web/production/components/Accordion/commonStyles.js.map +1 -1
  430. package/build/lib/web/production/components/ActionList/ActionList.js +3 -0
  431. package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
  432. package/build/lib/web/production/components/Alert/Alert.js +6 -3
  433. package/build/lib/web/production/components/Alert/Alert.js.map +1 -1
  434. package/build/lib/web/production/components/Amount/Amount.js +3 -2
  435. package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
  436. package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js +12 -0
  437. package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -0
  438. package/build/lib/web/production/components/Badge/Badge.js +4 -2
  439. package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
  440. package/build/lib/web/production/components/BaseMotion/BaseMotion.js +123 -0
  441. package/build/lib/web/production/components/BaseMotion/BaseMotion.js.map +1 -0
  442. package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js +60 -0
  443. package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js.map +1 -0
  444. package/build/lib/web/production/components/BaseMotion/index.js +3 -0
  445. package/build/lib/web/production/components/BaseMotion/index.js.map +1 -0
  446. package/build/lib/web/production/components/BaseMotion/types.js +2 -0
  447. package/build/lib/web/production/components/BaseMotion/types.js.map +1 -0
  448. package/build/lib/web/production/components/BottomNav/BottomNav.web.js +4 -2
  449. package/build/lib/web/production/components/BottomNav/BottomNav.web.js.map +1 -1
  450. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +1 -1
  451. package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
  452. package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js +1 -1
  453. package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
  454. package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  455. package/build/lib/web/production/components/Box/Box.js +2 -2
  456. package/build/lib/web/production/components/Box/Box.js.map +1 -1
  457. package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js +3 -1
  458. package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js.map +1 -1
  459. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +1 -1
  460. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  461. package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js +1 -1
  462. package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
  463. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +3 -2
  464. package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
  465. package/build/lib/web/production/components/Card/Card.js +3 -1
  466. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  467. package/build/lib/web/production/components/Card/CardRoot.web.js +6 -4
  468. package/build/lib/web/production/components/Card/CardRoot.web.js.map +1 -1
  469. package/build/lib/web/production/components/Carousel/Carousel.web.js +6 -3
  470. package/build/lib/web/production/components/Carousel/Carousel.web.js.map +1 -1
  471. package/build/lib/web/production/components/Carousel/Indicators/getIndicatorButtonStyles.js +1 -1
  472. package/build/lib/web/production/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
  473. package/build/lib/web/production/components/Carousel/NavigationButton/getNavigationButtonStyles.js +1 -1
  474. package/build/lib/web/production/components/Carousel/NavigationButton/getNavigationButtonStyles.js.map +1 -1
  475. package/build/lib/web/production/components/Checkbox/Checkbox.js +13 -3
  476. package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
  477. package/build/lib/web/production/components/Checkbox/CheckboxIcon/Fade.web.js +2 -2
  478. package/build/lib/web/production/components/Checkbox/CheckboxIcon/Fade.web.js.map +1 -1
  479. package/build/lib/web/production/components/Chip/Chip.js +11 -2
  480. package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
  481. package/build/lib/web/production/components/Chip/ChipGroup.js +5 -2
  482. package/build/lib/web/production/components/Chip/ChipGroup.js.map +1 -1
  483. package/build/lib/web/production/components/Chip/chipTokens.js +1 -1
  484. package/build/lib/web/production/components/Chip/chipTokens.js.map +1 -1
  485. package/build/lib/web/production/components/Collapsible/Collapsible.js +6 -3
  486. package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
  487. package/build/lib/web/production/components/Collapsible/commonStyles.js +2 -2
  488. package/build/lib/web/production/components/Collapsible/commonStyles.js.map +1 -1
  489. package/build/lib/web/production/components/Counter/Counter.js +4 -2
  490. package/build/lib/web/production/components/Counter/Counter.js.map +1 -1
  491. package/build/lib/web/production/components/Divider/Divider.js +4 -2
  492. package/build/lib/web/production/components/Divider/Divider.js.map +1 -1
  493. package/build/lib/web/production/components/Drawer/Drawer.web.js +4 -4
  494. package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
  495. package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -3
  496. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  497. package/build/lib/web/production/components/Fade/Fade.web.js +62 -0
  498. package/build/lib/web/production/components/Fade/Fade.web.js.map +1 -0
  499. package/build/lib/web/production/components/Fade/index.js +2 -0
  500. package/build/lib/web/production/components/Fade/index.js.map +1 -0
  501. package/build/lib/web/production/components/FileUpload/FileUpload.web.js +11 -2
  502. package/build/lib/web/production/components/FileUpload/FileUpload.web.js.map +1 -1
  503. package/build/lib/web/production/components/FileUpload/fileUploadTokens.js +1 -1
  504. package/build/lib/web/production/components/FileUpload/fileUploadTokens.js.map +1 -1
  505. package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +1 -1
  506. package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
  507. package/build/lib/web/production/components/Icons/RayIcon/RayIcon.js +37 -0
  508. package/build/lib/web/production/components/Icons/RayIcon/RayIcon.js.map +1 -0
  509. package/build/lib/web/production/components/Icons/RayIcon/index.js +2 -0
  510. package/build/lib/web/production/components/Icons/RayIcon/index.js.map +1 -0
  511. package/build/lib/web/production/components/Icons/index.js +1 -0
  512. package/build/lib/web/production/components/Icons/index.js.map +1 -1
  513. package/build/lib/web/production/components/Indicator/Indicator.js +4 -2
  514. package/build/lib/web/production/components/Indicator/Indicator.js.map +1 -1
  515. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +3 -3
  516. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  517. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +21 -7
  518. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  519. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +2 -2
  520. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  521. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +1 -1
  522. package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
  523. package/build/lib/web/production/components/List/List.js +5 -3
  524. package/build/lib/web/production/components/List/List.js.map +1 -1
  525. package/build/lib/web/production/components/Modal/Modal.web.js +2 -2
  526. package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
  527. package/build/lib/web/production/components/Modal/ModalBackdrop.js +2 -2
  528. package/build/lib/web/production/components/Modal/ModalBackdrop.js.map +1 -1
  529. package/build/lib/web/production/components/Morph/Morph.web.js +48 -0
  530. package/build/lib/web/production/components/Morph/Morph.web.js.map +1 -0
  531. package/build/lib/web/production/components/Morph/index.js +2 -0
  532. package/build/lib/web/production/components/Morph/index.js.map +1 -0
  533. package/build/lib/web/production/components/Move/Move.web.js +66 -0
  534. package/build/lib/web/production/components/Move/Move.web.js.map +1 -0
  535. package/build/lib/web/production/components/Move/index.js +2 -0
  536. package/build/lib/web/production/components/Move/index.js.map +1 -0
  537. package/build/lib/web/production/components/ProgressBar/CircularProgressBar.web.js +1 -1
  538. package/build/lib/web/production/components/ProgressBar/CircularProgressBar.web.js.map +1 -1
  539. package/build/lib/web/production/components/ProgressBar/ProgressBar.js +8 -4
  540. package/build/lib/web/production/components/ProgressBar/ProgressBar.js.map +1 -1
  541. package/build/lib/web/production/components/Radio/Radio.js +13 -3
  542. package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
  543. package/build/lib/web/production/components/Radio/RadioIcon/Fade.web.js +3 -3
  544. package/build/lib/web/production/components/Radio/RadioIcon/Fade.web.js.map +1 -1
  545. package/build/lib/web/production/components/Radio/RadioIcon/RadioIconWrapperStyles.js +1 -1
  546. package/build/lib/web/production/components/Radio/RadioIcon/RadioIconWrapperStyles.js.map +1 -1
  547. package/build/lib/web/production/components/Scale/Scale.web.js +47 -0
  548. package/build/lib/web/production/components/Scale/Scale.web.js.map +1 -0
  549. package/build/lib/web/production/components/Scale/index.js +2 -0
  550. package/build/lib/web/production/components/Scale/index.js.map +1 -0
  551. package/build/lib/web/production/components/SideNav/SideNav.web.js +7 -5
  552. package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
  553. package/build/lib/web/production/components/SideNav/tokens.js +1 -1
  554. package/build/lib/web/production/components/SideNav/tokens.js.map +1 -1
  555. package/build/lib/web/production/components/Skeleton/PulseAnimation.web.js +1 -1
  556. package/build/lib/web/production/components/Skeleton/PulseAnimation.web.js.map +1 -1
  557. package/build/lib/web/production/components/Skeleton/Skeleton.js +4 -1
  558. package/build/lib/web/production/components/Skeleton/Skeleton.js.map +1 -1
  559. package/build/lib/web/production/components/Slide/Slide.web.js +119 -0
  560. package/build/lib/web/production/components/Slide/Slide.web.js.map +1 -0
  561. package/build/lib/web/production/components/Slide/index.js +2 -0
  562. package/build/lib/web/production/components/Slide/index.js.map +1 -0
  563. package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js +6 -3
  564. package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  565. package/build/lib/web/production/components/Spinner/BaseSpinner/spinnerTokens.js +1 -1
  566. package/build/lib/web/production/components/Spinner/BaseSpinner/spinnerTokens.js.map +1 -1
  567. package/build/lib/web/production/components/Spinner/Spinner/Spinner.js +4 -1
  568. package/build/lib/web/production/components/Spinner/Spinner/Spinner.js.map +1 -1
  569. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +2 -2
  570. package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
  571. package/build/lib/web/production/components/Stagger/StaggerProvider.js +13 -0
  572. package/build/lib/web/production/components/Stagger/StaggerProvider.js.map +1 -0
  573. package/build/lib/web/production/components/StepGroup/StepGroup.web.js +5 -3
  574. package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
  575. package/build/lib/web/production/components/StepGroup/StepItem.web.js +1 -1
  576. package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
  577. package/build/lib/web/production/components/Switch/AnimatedThumbIcon.web.js +1 -1
  578. package/build/lib/web/production/components/Switch/AnimatedThumbIcon.web.js.map +1 -1
  579. package/build/lib/web/production/components/Switch/Switch.js +13 -3
  580. package/build/lib/web/production/components/Switch/Switch.js.map +1 -1
  581. package/build/lib/web/production/components/Switch/getTrackStyles.js +1 -1
  582. package/build/lib/web/production/components/Switch/getTrackStyles.js.map +1 -1
  583. package/build/lib/web/production/components/Switch/switchTokens.js +6 -6
  584. package/build/lib/web/production/components/Switch/switchTokens.js.map +1 -1
  585. package/build/lib/web/production/components/Table/Table.web.js +4 -2
  586. package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
  587. package/build/lib/web/production/components/Table/tokens.js +2 -2
  588. package/build/lib/web/production/components/Table/tokens.js.map +1 -1
  589. package/build/lib/web/production/components/Tabs/TabIndicator.web.js +1 -1
  590. package/build/lib/web/production/components/Tabs/TabIndicator.web.js.map +1 -1
  591. package/build/lib/web/production/components/Tabs/TabItem.web.js +2 -2
  592. package/build/lib/web/production/components/Tabs/TabItem.web.js.map +1 -1
  593. package/build/lib/web/production/components/Tabs/Tabs.web.js +34 -1
  594. package/build/lib/web/production/components/Tabs/Tabs.web.js.map +1 -1
  595. package/build/lib/web/production/components/Tag/AnimatedTag.web.js +2 -2
  596. package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
  597. package/build/lib/web/production/components/Tag/Tag.js +31 -29
  598. package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
  599. package/build/lib/web/production/components/Toast/Toast.web.js +2 -2
  600. package/build/lib/web/production/components/Toast/Toast.web.js.map +1 -1
  601. package/build/lib/web/production/components/Toast/ToastContainer.web.js +1 -1
  602. package/build/lib/web/production/components/Toast/ToastContainer.web.js.map +1 -1
  603. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +2 -2
  604. package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
  605. package/build/lib/web/production/components/TopNav/TopNav.web.js +4 -2
  606. package/build/lib/web/production/components/TopNav/TopNav.web.js.map +1 -1
  607. package/build/lib/web/production/components/Typography/Code/Code.js +30 -27
  608. package/build/lib/web/production/components/Typography/Code/Code.js.map +1 -1
  609. package/build/lib/web/production/components/Typography/Display/Display.js +6 -2
  610. package/build/lib/web/production/components/Typography/Display/Display.js.map +1 -1
  611. package/build/lib/web/production/components/Typography/Heading/Heading.js +4 -1
  612. package/build/lib/web/production/components/Typography/Heading/Heading.js.map +1 -1
  613. package/build/lib/web/production/components/Typography/Text/Text.js +6 -10
  614. package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
  615. package/build/lib/web/production/components/index.js +11 -0
  616. package/build/lib/web/production/components/index.js.map +1 -1
  617. package/build/lib/web/production/tokens/global/motion.js +22 -28
  618. package/build/lib/web/production/tokens/global/motion.js.map +1 -1
  619. package/build/lib/web/production/utils/cssBezierToArray.js +12 -0
  620. package/build/lib/web/production/utils/cssBezierToArray.js.map +1 -0
  621. package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js +1 -1
  622. package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
  623. package/build/lib/web/production/utils/getMotionRefs.js +86 -0
  624. package/build/lib/web/production/utils/getMotionRefs.js.map +1 -0
  625. package/build/lib/web/production/utils/msToSeconds.js +6 -0
  626. package/build/lib/web/production/utils/msToSeconds.js.map +1 -0
  627. package/build/types/components/index.d.ts +17969 -5488
  628. package/build/types/components/index.native.d.ts +7924 -2157
  629. package/build/types/tokens/index.d.ts +103 -93
  630. package/build/types/tokens/index.native.d.ts +103 -93
  631. package/build/types/utils/index.d.ts +84 -71
  632. package/build/types/utils/index.native.d.ts +84 -71
  633. package/codemods/migrate-motion-tokens/transformers/__tests__/migrate-motion-tokens.test.ts +130 -0
  634. package/codemods/migrate-motion-tokens/transformers/index.ts +1 -0
  635. package/codemods/migrate-motion-tokens/transformers/migrate-motion.ts +24 -0
  636. package/codemods/migrate-motion-tokens/transformers/motionTokenMapping.json +11 -0
  637. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CardRoot.native.js","sources":["../../../../../src/components/Card/CardRoot.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';\nimport styled from 'styled-components';\nimport type { CardRootProps } from './types';\nimport { CARD_SCALE_DOWN_VALUE } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castNativeType, makeMotionTime } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport { logger } from '~utils/logger';\nimport { makeAccessible } from '~utils/makeAccessible/makeAccessible.native';\n\nconst StyledCardRoot = styled(BaseBox)<CardRootProps>(({ isSelected, ...props }) => {\n const selectedColor = isSelected\n ? props.theme.colors.surface.border.primary.normal\n : 'transparent';\n return {\n border: `${props.theme.border.width.thicker}px solid ${selectedColor}`,\n };\n});\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nconst openURL = async (href: string): Promise<void> => {\n try {\n const canOpen = await Linking.canOpenURL(href);\n if (canOpen) {\n await Linking.openURL(href);\n }\n } catch {\n if (__DEV__) {\n logger({\n type: 'warn',\n message: `Could not open the link \"href=${href}\"`,\n moduleName: 'BaseButton',\n });\n }\n }\n};\n\nconst CardRoot = ({\n children,\n onClick,\n isSelected,\n shouldScaleOnHover,\n href,\n as,\n accessibilityLabel,\n ...props\n}: CardRootProps): React.ReactElement => {\n const { theme } = useTheme();\n const [isPressed, setIsPressed] = React.useState(false);\n const duration = castNativeType(makeMotionTime(theme.motion.duration.xquick));\n const easing = castNativeType(theme.motion.easing.standard.effective);\n\n const styles = useAnimatedStyle(() => {\n return {\n transform: [\n {\n // TODO: check with design once what to do on mobile\n scale: withTiming(isPressed ? CARD_SCALE_DOWN_VALUE : 1, { duration, easing }),\n },\n ],\n };\n }, [isPressed]);\n\n if (onClick || shouldScaleOnHover || href) {\n return (\n <AnimatedPressable\n {...makeAccessible({\n role: href ? 'link' : undefined,\n label: accessibilityLabel,\n selected: isSelected,\n })}\n style={styles}\n onPressIn={(event) => {\n if (onClick) {\n onClick(event);\n }\n setIsPressed(true);\n }}\n onPressOut={() => {\n if (href) {\n void openURL(href);\n }\n setIsPressed(false);\n }}\n >\n <StyledCardRoot as={undefined} isSelected={isSelected} {...props}>\n {children}\n </StyledCardRoot>\n </AnimatedPressable>\n );\n }\n\n return (\n <StyledCardRoot as={undefined} isSelected={isSelected} {...props}>\n {children}\n </StyledCardRoot>\n );\n};\n\nexport { CardRoot };\n"],"names":["StyledCardRoot","styled","BaseBox","_ref","isSelected","props","_objectWithoutProperties","_excluded","selectedColor","theme","colors","surface","border","primary","normal","width","thicker","AnimatedPressable","Animated","createAnimatedComponent","Pressable","openURL","_ref2","_asyncToGenerator","href","canOpen","Linking","canOpenURL","_unused","__DEV__","logger","type","message","moduleName","_x","apply","arguments","CardRoot","_ref3","children","onClick","shouldScaleOnHover","as","accessibilityLabel","_excluded2","_useTheme","useTheme","_React$useState","React","useState","_React$useState2","_slicedToArray","isPressed","setIsPressed","duration","castNativeType","makeMotionTime","motion","xquick","easing","standard","effective","styles","useAnimatedStyle","transform","scale","withTiming","CARD_SCALE_DOWN_VALUE","_jsx","Object","assign","makeAccessible","role","undefined","label","selected","style","onPressIn","event","onPressOut"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,YAAA,CAAA,CAAA,UAAA,CAAA,CAAA,UAAA,CAAA,SAAA,CAAA,YAAA,CAAA,oBAAA,CAAA,MAAA,CAAA,IAAA,CAAA,oBAAA,CAAA,CAYA,IAAMA,cAAc,CAAGC,MAAM,CAACC,OAAO,CAAC,CAAgB,SAAAC,IAAA,CAA8B,KAA3BC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,CAAAC,wBAAA,CAAAH,IAAA,CAAAI,SAAA,CAC3E,CAAA,IAAMC,aAAa,CAAGJ,UAAU,CAC5BC,KAAK,CAACI,KAAK,CAACC,MAAM,CAACC,OAAO,CAACC,MAAM,CAACC,OAAO,CAACC,MAAM,CAChD,aAAa,CACjB,OAAO,CACLF,MAAM,CAAG,CAAA,EAAEP,KAAK,CAACI,KAAK,CAACG,MAAM,CAACG,KAAK,CAACC,OAAQ,CAAWR,SAAAA,EAAAA,aAAc,CACvE,CAAA,CAAC,CACH,CAAC,CAAC,CAEF,IAAMS,iBAAiB,CAAGC,QAAQ,CAACC,uBAAuB,CAACC,SAAS,CAAC,CAErE,IAAMC,OAAO,CAAAC,UAAAA,CAAAA,IAAAA,KAAA,CAAAC,iBAAA,CAAG,UAAOC,IAAY,CAAoB,CACrD,GAAI,CACF,IAAMC,OAAO,CAAA,MAASC,OAAO,CAACC,UAAU,CAACH,IAAI,CAAC,CAC9C,GAAIC,OAAO,CAAE,CACX,MAAMC,OAAO,CAACL,OAAO,CAACG,IAAI,CAAC,CAC7B,CACF,CAAE,MAAAI,OAAA,CAAM,CACN,GAAIC,OAAO,CAAE,CACXC,MAAM,CAAC,CACLC,IAAI,CAAE,MAAM,CACZC,OAAO,CAAG,iCAAgCR,IAAK,CAAA,CAAA,CAAE,C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":"CardRoot.native.js","sources":["../../../../../src/components/Card/CardRoot.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Linking, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';\nimport styled from 'styled-components';\nimport type { CardRootProps } from './types';\nimport { CARD_SCALE_DOWN_VALUE } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castNativeType, makeMotionTime } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport { logger } from '~utils/logger';\nimport { makeAccessible } from '~utils/makeAccessible/makeAccessible.native';\nimport type { BladeElementRef } from '~utils/types';\n\nconst StyledCardRoot = styled(BaseBox)<CardRootProps>(({ isSelected, ...props }) => {\n const selectedColor = isSelected\n ? props.theme.colors.surface.border.primary.normal\n : 'transparent';\n return {\n border: `${props.theme.border.width.thicker}px solid ${selectedColor}`,\n };\n});\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable);\n\nconst openURL = async (href: string): Promise<void> => {\n try {\n const canOpen = await Linking.canOpenURL(href);\n if (canOpen) {\n await Linking.openURL(href);\n }\n } catch {\n if (__DEV__) {\n logger({\n type: 'warn',\n message: `Could not open the link \"href=${href}\"`,\n moduleName: 'BaseButton',\n });\n }\n }\n};\n\nconst _CardRoot: React.ForwardRefRenderFunction<BladeElementRef, CardRootProps> = (\n { children, onClick, isSelected, shouldScaleOnHover, href, as, accessibilityLabel, ...props },\n ref,\n): React.ReactElement => {\n const { theme } = useTheme();\n const [isPressed, setIsPressed] = React.useState(false);\n const duration = castNativeType(makeMotionTime(theme.motion.duration.xquick));\n const easing = castNativeType(theme.motion.easing.standard);\n\n const styles = useAnimatedStyle(() => {\n return {\n transform: [\n {\n // TODO: check with design once what to do on mobile\n scale: withTiming(isPressed ? CARD_SCALE_DOWN_VALUE : 1, { duration, easing }),\n },\n ],\n };\n }, [isPressed]);\n\n if (onClick || shouldScaleOnHover || href) {\n return (\n <AnimatedPressable\n ref={ref as never}\n {...makeAccessible({\n role: href ? 'link' : undefined,\n label: accessibilityLabel,\n selected: isSelected,\n })}\n style={styles}\n onPressIn={(event) => {\n if (onClick) {\n onClick(event);\n }\n setIsPressed(true);\n }}\n onPressOut={() => {\n if (href) {\n void openURL(href);\n }\n setIsPressed(false);\n }}\n >\n <StyledCardRoot as={undefined} isSelected={isSelected} {...props}>\n {children}\n </StyledCardRoot>\n </AnimatedPressable>\n );\n }\n\n return (\n <StyledCardRoot as={undefined} isSelected={isSelected} {...props}>\n {children}\n </StyledCardRoot>\n );\n};\n\nconst CardRoot = React.forwardRef(_CardRoot);\n\nexport { CardRoot };\n"],"names":["StyledCardRoot","styled","BaseBox","_ref","isSelected","props","_objectWithoutProperties","_excluded","selectedColor","theme","colors","surface","border","primary","normal","width","thicker","AnimatedPressable","Animated","createAnimatedComponent","Pressable","openURL","_ref2","_asyncToGenerator","href","canOpen","Linking","canOpenURL","_unused","__DEV__","logger","type","message","moduleName","_x","apply","arguments","_CardRoot","_ref3","ref","children","onClick","shouldScaleOnHover","as","accessibilityLabel","_excluded2","_useTheme","useTheme","_React$useState","React","useState","_React$useState2","_slicedToArray","isPressed","setIsPressed","duration","castNativeType","makeMotionTime","motion","xquick","easing","standard","styles","useAnimatedStyle","transform","scale","withTiming","CARD_SCALE_DOWN_VALUE","_jsx","Object","assign","makeAccessible","role","undefined","label","selected","style","onPressIn","event","onPressOut","CardRoot","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,YAAA,CAAA,CAAA,UAAA,CAAA,CAAA,UAAA,CAAA,SAAA,CAAA,YAAA,CAAA,oBAAA,CAAA,MAAA,CAAA,IAAA,CAAA,oBAAA,CAAA,CAaA,IAAMA,cAAc,CAAGC,MAAM,CAACC,OAAO,CAAC,CAAgB,SAAAC,IAAA,CAA8B,CAAA,IAA3BC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,CAAAC,wBAAA,CAAAH,IAAA,CAAAI,SAAA,CAAA,CAC3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CAAEvE,UACZ,CAAC,CAAC,CACFwE,CAAAA,KAAK,CAAEd,MAAO,CACde,SAAS,CAAE,SAAAA,SAAAA,CAACC,KAAK,CAAK,CACpB,GAAIrC,OAAO,CAAE,CACXA,OAAO,CAACqC,KAAK,CAAC,CAChB,CACAxB,YAAY,CAAC,IAAI,CAAC,CACpB,CAAE,CACFyB,UAAU,CAAE,SAAAA,UAAAA,EAAM,CAChB,GAAIvD,IAAI,CAAE,CACR,KAAKH,OAAO,CAACG,IAAI,CAAC,CACpB,CACA8B,YAAY,CAAC,KAAK,CAAC,CACrB,CAAE,CAAAd,QAAA,CAEF4B,GAAA,CAACpE,cAAc,CAAAqE,MAAA,CAAAC,MAAA,CAAA,CAAC3B,EAAE,CAAE8B,SAAU,CAACrE,UAAU,CAAEA,UAAW,CAAKC,CAAAA,KAAK,CAAAmC,CAAAA,QAAA,CAC7DA,QAAQ,EACK,CAAC,CAAA,CACA,CAAC,CAExB,CAEA,OACE4B,GAAA,CAACpE,cAAc,CAAAqE,MAAA,CAAAC,MAAA,CAAA,CAAC3B,EAAE,CAAE8B,SAAU,CAACrE,UAAU,CAAEA,UAAW,CAAKC,CAAAA,KAAK,CAAAmC,CAAAA,QAAA,CAC7DA,QAAQ,CAAA,CACK,CAAC,CAErB,CAAC,CAEK,IAAAwC,QAAQ,CAAG/B,cAAK,CAACgC,UAAU,CAAC5C,SAAS;;;;"}
@@ -20,7 +20,7 @@ import { useDidUpdate } from '../../utils/useDidUpdate.js';
20
20
  import { getResponsiveValue } from '../Box/BaseBox/getResponsiveValue.native.js';
21
21
  import { jsx, jsxs } from 'react/jsx-runtime';
22
22
 
23
- var percentageStringToNumber=function percentageStringToNumber(percentage){if(!percentage.endsWith('%')){logger({message:'Only percentage values are allowed',type:'error',moduleName:'Carousel'});}return Number(percentage.substring(0,percentage.length-1))/100;};var Controls=function Controls(_ref){var showIndicators=_ref.showIndicators,activeIndicator=_ref.activeIndicator,totalSlides=_ref.totalSlides,onIndicatorButtonClick=_ref.onIndicatorButtonClick,onNextButtonClick=_ref.onNextButtonClick,onPreviousButtonClick=_ref.onPreviousButtonClick,indicatorVariant=_ref.indicatorVariant,navigationButtonVariant=_ref.navigationButtonVariant;return jsxs(BaseBox,{marginTop:"spacing.7",display:"flex",flexDirection:"row",alignItems:"center",gap:"spacing.4",children:[jsx(BaseBox,{children:jsx(NavigationButton,{type:"previous",variant:navigationButtonVariant,onClick:onPreviousButtonClick})}),showIndicators?jsx(Indicators,{onClick:onIndicatorButtonClick,activeIndex:activeIndicator,totalItems:totalSlides,variant:indicatorVariant}):null,jsx(BaseBox,{children:jsx(NavigationButton,{onClick:onNextButtonClick,type:"next",variant:navigationButtonVariant})})]});};var Carousel=function Carousel(_ref2){var autoPlay=_ref2.autoPlay,_ref2$showIndicators=_ref2.showIndicators,showIndicators=_ref2$showIndicators===void 0?true:_ref2$showIndicators,children=_ref2.children,_ref2$carouselItemWid=_ref2.carouselItemWidth,carouselItemWidth=_ref2$carouselItemWid===void 0?'100%':_ref2$carouselItemWid,accessibilityLabel=_ref2.accessibilityLabel,onChange=_ref2.onChange,_ref2$indicatorVarian=_ref2.indicatorVariant,indicatorVariant=_ref2$indicatorVarian===void 0?'gray':_ref2$indicatorVarian,_ref2$navigationButto=_ref2.navigationButtonVariant,navigationButtonVariant=_ref2$navigationButto===void 0?'filled':_ref2$navigationButto;var containerRef=React__default.useRef(null);var _React$useState=React__default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),activeSlide=_React$useState2[0],setActiveSlide=_React$useState2[1];var _React$useState3=React__default.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),scrollViewWidth=_React$useState4[0],setScrollViewWidth=_React$useState4[1];var _React$useState5=React__default.useState(false),_React$useState6=_slicedToArray(_React$useState5,2),shouldPauseAutoplay=_React$useState6[0],setShouldPauseAutoplay=_React$useState6[1];var id=useId();var _visibleItems=1;var slideWidth=scrollViewWidth*percentageStringToNumber(castNativeType(getResponsiveValue(carouselItemWidth)));var totalNumberOfSlides=React__default.Children.count(children);var goToSlideIndex=function goToSlideIndex(slideIndex){if(!containerRef.current)return;containerRef.current.scrollTo({x:slideIndex*slideWidth,y:0,animated:true});setActiveSlide(slideIndex);};var goToNextSlide=function goToNextSlide(){var slideIndex=activeSlide+1;if(slideIndex>=totalNumberOfSlides){slideIndex=0;}goToSlideIndex(slideIndex);};var goToPreviousSlide=function goToPreviousSlide(){var slideIndex=activeSlide-1;if(activeSlide<=0){slideIndex=totalNumberOfSlides-1;}goToSlideIndex(slideIndex);};var carouselContext=React__default.useMemo(function(){return {isResponsive:false,visibleItems:_visibleItems,carouselItemWidth:carouselItemWidth,carouselId:id,totalNumberOfSlides:totalNumberOfSlides,slideWidth:slideWidth,activeSlide:activeSlide,carouselContainerRef:containerRef,setActiveIndicator:setActiveSlide,carouselItemAlignment:undefined,shouldAddStartEndSpacing:false};},[carouselItemWidth,id,totalNumberOfSlides,slideWidth,activeSlide]);useInterval(function(){goToNextSlide();},{delay:CAROUSEL_AUTOPLAY_INTERVAL,enable:autoPlay&&!shouldPauseAutoplay});useDidUpdate(function(){onChange==null?void 0:onChange(activeSlide);},[activeSlide,onChange]);React__default.useEffect(function(){announce(`Slide ${activeSlide+1} of ${totalNumberOfSlides}`);},[activeSlide,totalNumberOfSlides]);return jsx(CarouselContext.Provider,{value:carouselContext,children:jsxs(BaseBox,{display:"flex",alignItems:"center",flexDirection:"column",children:[jsx(BaseBox,{width:"100%",position:"relative",display:"flex",alignItems:"center",gap:"spacing.4",flexDirection:"row",children:jsx(ScrollView,Object.assign({onScrollBeginDrag:function onScrollBeginDrag(){setShouldPauseAutoplay(true);},onScrollEndDrag:function onScrollEndDrag(){setShouldPauseAutoplay(false);}},makeAccessible({label:accessibilityLabel}),{ref:containerRef,onLayout:function onLayout(e){setScrollViewWidth(e.nativeEvent.layout.width);},onMomentumScrollEnd:function onMomentumScrollEnd(e){var slideIndex=Math.round(e.nativeEvent.contentOffset.x/slideWidth);setActiveSlide(slideIndex);},horizontal:true,snapToAlignment:"start",decelerationRate:"fast",overScrollMode:"never",contentInsetAdjustmentBehavior:"never",automaticallyAdjustContentInsets:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,snapToInterval:slideWidth,contentInset:{left:0,right:0},contentOffset:{x:0,y:0},contentContainerStyle:{paddingVertical:size[10]},children:React__default.Children.map(children,function(child,index){return React__default.cloneElement(child,{index:index,shouldHaveStartSpacing:index===0,shouldHaveEndSpacing:index===totalNumberOfSlides-1});})}))}),jsx(Controls,{totalSlides:totalNumberOfSlides,activeIndicator:activeSlide,showIndicators:showIndicators,onIndicatorButtonClick:goToSlideIndex,onNextButtonClick:goToNextSlide,onPreviousButtonClick:goToPreviousSlide,indicatorVariant:indicatorVariant,navigationButtonVariant:navigationButtonVariant})]})});};
23
+ var percentageStringToNumber=function percentageStringToNumber(percentage){if(!percentage.endsWith('%')){logger({message:'Only percentage values are allowed',type:'error',moduleName:'Carousel'});}return Number(percentage.substring(0,percentage.length-1))/100;};var Controls=function Controls(_ref){var showIndicators=_ref.showIndicators,activeIndicator=_ref.activeIndicator,totalSlides=_ref.totalSlides,onIndicatorButtonClick=_ref.onIndicatorButtonClick,onNextButtonClick=_ref.onNextButtonClick,onPreviousButtonClick=_ref.onPreviousButtonClick,indicatorVariant=_ref.indicatorVariant,navigationButtonVariant=_ref.navigationButtonVariant;return jsxs(BaseBox,{marginTop:"spacing.7",display:"flex",flexDirection:"row",alignItems:"center",gap:"spacing.4",children:[jsx(BaseBox,{children:jsx(NavigationButton,{type:"previous",variant:navigationButtonVariant,onClick:onPreviousButtonClick})}),showIndicators?jsx(Indicators,{onClick:onIndicatorButtonClick,activeIndex:activeIndicator,totalItems:totalSlides,variant:indicatorVariant}):null,jsx(BaseBox,{children:jsx(NavigationButton,{onClick:onNextButtonClick,type:"next",variant:navigationButtonVariant})})]});};var _Carousel=function _Carousel(_ref2,ref){var autoPlay=_ref2.autoPlay,_ref2$showIndicators=_ref2.showIndicators,showIndicators=_ref2$showIndicators===void 0?true:_ref2$showIndicators,children=_ref2.children,_ref2$carouselItemWid=_ref2.carouselItemWidth,carouselItemWidth=_ref2$carouselItemWid===void 0?'100%':_ref2$carouselItemWid,accessibilityLabel=_ref2.accessibilityLabel,onChange=_ref2.onChange,_ref2$indicatorVarian=_ref2.indicatorVariant,indicatorVariant=_ref2$indicatorVarian===void 0?'gray':_ref2$indicatorVarian,_ref2$navigationButto=_ref2.navigationButtonVariant,navigationButtonVariant=_ref2$navigationButto===void 0?'filled':_ref2$navigationButto;var containerRef=React__default.useRef(null);var _React$useState=React__default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),activeSlide=_React$useState2[0],setActiveSlide=_React$useState2[1];var _React$useState3=React__default.useState(0),_React$useState4=_slicedToArray(_React$useState3,2),scrollViewWidth=_React$useState4[0],setScrollViewWidth=_React$useState4[1];var _React$useState5=React__default.useState(false),_React$useState6=_slicedToArray(_React$useState5,2),shouldPauseAutoplay=_React$useState6[0],setShouldPauseAutoplay=_React$useState6[1];var id=useId();var _visibleItems=1;var slideWidth=scrollViewWidth*percentageStringToNumber(castNativeType(getResponsiveValue(carouselItemWidth)));var totalNumberOfSlides=React__default.Children.count(children);var goToSlideIndex=function goToSlideIndex(slideIndex){if(!containerRef.current)return;containerRef.current.scrollTo({x:slideIndex*slideWidth,y:0,animated:true});setActiveSlide(slideIndex);};var goToNextSlide=function goToNextSlide(){var slideIndex=activeSlide+1;if(slideIndex>=totalNumberOfSlides){slideIndex=0;}goToSlideIndex(slideIndex);};var goToPreviousSlide=function goToPreviousSlide(){var slideIndex=activeSlide-1;if(activeSlide<=0){slideIndex=totalNumberOfSlides-1;}goToSlideIndex(slideIndex);};var carouselContext=React__default.useMemo(function(){return {isResponsive:false,visibleItems:_visibleItems,carouselItemWidth:carouselItemWidth,carouselId:id,totalNumberOfSlides:totalNumberOfSlides,slideWidth:slideWidth,activeSlide:activeSlide,carouselContainerRef:containerRef,setActiveIndicator:setActiveSlide,carouselItemAlignment:undefined,shouldAddStartEndSpacing:false};},[carouselItemWidth,id,totalNumberOfSlides,slideWidth,activeSlide]);useInterval(function(){goToNextSlide();},{delay:CAROUSEL_AUTOPLAY_INTERVAL,enable:autoPlay&&!shouldPauseAutoplay});useDidUpdate(function(){onChange==null?void 0:onChange(activeSlide);},[activeSlide,onChange]);React__default.useEffect(function(){announce(`Slide ${activeSlide+1} of ${totalNumberOfSlides}`);},[activeSlide,totalNumberOfSlides]);return jsx(CarouselContext.Provider,{value:carouselContext,children:jsxs(BaseBox,{ref:ref,display:"flex",alignItems:"center",flexDirection:"column",children:[jsx(BaseBox,{width:"100%",position:"relative",display:"flex",alignItems:"center",gap:"spacing.4",flexDirection:"row",children:jsx(ScrollView,Object.assign({onScrollBeginDrag:function onScrollBeginDrag(){setShouldPauseAutoplay(true);},onScrollEndDrag:function onScrollEndDrag(){setShouldPauseAutoplay(false);}},makeAccessible({label:accessibilityLabel}),{ref:containerRef,onLayout:function onLayout(e){setScrollViewWidth(e.nativeEvent.layout.width);},onMomentumScrollEnd:function onMomentumScrollEnd(e){var slideIndex=Math.round(e.nativeEvent.contentOffset.x/slideWidth);setActiveSlide(slideIndex);},horizontal:true,snapToAlignment:"start",decelerationRate:"fast",overScrollMode:"never",contentInsetAdjustmentBehavior:"never",automaticallyAdjustContentInsets:false,showsHorizontalScrollIndicator:false,showsVerticalScrollIndicator:false,snapToInterval:slideWidth,contentInset:{left:0,right:0},contentOffset:{x:0,y:0},contentContainerStyle:{paddingVertical:size[10]},children:React__default.Children.map(children,function(child,index){return React__default.cloneElement(child,{index:index,shouldHaveStartSpacing:index===0,shouldHaveEndSpacing:index===totalNumberOfSlides-1});})}))}),jsx(Controls,{totalSlides:totalNumberOfSlides,activeIndicator:activeSlide,showIndicators:showIndicators,onIndicatorButtonClick:goToSlideIndex,onNextButtonClick:goToNextSlide,onPreviousButtonClick:goToPreviousSlide,indicatorVariant:indicatorVariant,navigationButtonVariant:navigationButtonVariant})]})});};var Carousel=React__default.forwardRef(_Carousel);
24
24
 
25
25
  export { Carousel };
26
26
  //# sourceMappingURL=Carousel.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.native.js","sources":["../../../../../src/components/Carousel/Carousel.native.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView } from 'react-native';\nimport { Indicators } from './Indicators/Indicators';\nimport { NavigationButton } from './NavigationButton';\nimport type { CarouselProps } from './types';\nimport type { CarouselContextProps } from './CarouselContext';\nimport { CarouselContext } from './CarouselContext';\nimport { CAROUSEL_AUTOPLAY_INTERVAL } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useInterval } from '~utils/useInterval';\nimport { makeAccessible } from '~utils/makeAccessible/makeAccessible.native';\nimport { announce } from '~components/LiveAnnouncer/LiveAnnouncer.native';\nimport { castNativeType } from '~utils';\nimport { useId } from '~utils/useId';\nimport { logger } from '~utils/logger';\nimport { size } from '~tokens/global';\nimport { useDidUpdate } from '~utils/useDidUpdate';\nimport { getResponsiveValue } from '~components/Box/BaseBox/getResponsiveValue';\n\nconst percentageStringToNumber = (percentage: string): number => {\n if (!percentage.endsWith('%')) {\n logger({\n message: 'Only percentage values are allowed',\n type: 'error',\n moduleName: 'Carousel',\n });\n }\n\n return Number(percentage.substring(0, percentage.length - 1)) / 100;\n};\n\ntype ControlsProps = Required<\n Pick<CarouselProps, 'indicatorVariant' | 'showIndicators' | 'navigationButtonVariant'>\n> & {\n activeIndicator: number;\n totalSlides: number;\n onIndicatorButtonClick: (index: number) => void;\n onNextButtonClick: () => void;\n onPreviousButtonClick: () => void;\n};\n\nconst Controls = ({\n showIndicators,\n activeIndicator,\n totalSlides,\n onIndicatorButtonClick,\n onNextButtonClick,\n onPreviousButtonClick,\n indicatorVariant,\n navigationButtonVariant,\n}: ControlsProps): React.ReactElement => {\n return (\n <BaseBox\n marginTop=\"spacing.7\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"spacing.4\"\n >\n <BaseBox>\n <NavigationButton\n type=\"previous\"\n variant={navigationButtonVariant}\n onClick={onPreviousButtonClick}\n />\n </BaseBox>\n {showIndicators ? (\n <Indicators\n onClick={onIndicatorButtonClick}\n activeIndex={activeIndicator}\n totalItems={totalSlides}\n variant={indicatorVariant}\n />\n ) : null}\n <BaseBox>\n <NavigationButton\n onClick={onNextButtonClick}\n type=\"next\"\n variant={navigationButtonVariant}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Carousel = ({\n autoPlay,\n showIndicators = true,\n children,\n carouselItemWidth = '100%',\n accessibilityLabel,\n onChange,\n indicatorVariant = 'gray',\n navigationButtonVariant = 'filled',\n}: CarouselProps): React.ReactElement => {\n const containerRef = React.useRef<ScrollView>(null);\n const [activeSlide, setActiveSlide] = React.useState(0);\n const [scrollViewWidth, setScrollViewWidth] = React.useState(0);\n const [shouldPauseAutoplay, setShouldPauseAutoplay] = React.useState(false);\n const id = useId();\n\n const _visibleItems = 1;\n const slideWidth =\n scrollViewWidth *\n percentageStringToNumber(castNativeType(getResponsiveValue(carouselItemWidth)));\n const totalNumberOfSlides = React.Children.count(children);\n\n const goToSlideIndex = (slideIndex: number): void => {\n if (!containerRef.current) return;\n containerRef.current.scrollTo({\n x: slideIndex * slideWidth,\n y: 0,\n animated: true,\n });\n setActiveSlide(slideIndex);\n };\n\n const goToNextSlide = (): void => {\n let slideIndex = activeSlide + 1;\n if (slideIndex >= totalNumberOfSlides) {\n slideIndex = 0;\n }\n goToSlideIndex(slideIndex);\n };\n\n const goToPreviousSlide = (): void => {\n let slideIndex = activeSlide - 1;\n if (activeSlide <= 0) {\n slideIndex = totalNumberOfSlides - 1;\n }\n goToSlideIndex(slideIndex);\n };\n\n const carouselContext = React.useMemo<CarouselContextProps>(() => {\n return {\n isResponsive: false,\n visibleItems: _visibleItems,\n carouselItemWidth,\n carouselId: id,\n totalNumberOfSlides,\n slideWidth,\n activeSlide,\n carouselContainerRef: containerRef as never,\n setActiveIndicator: setActiveSlide,\n carouselItemAlignment: undefined,\n shouldAddStartEndSpacing: false,\n };\n }, [carouselItemWidth, id, totalNumberOfSlides, slideWidth, activeSlide]);\n\n // auto play\n useInterval(\n () => {\n goToNextSlide();\n },\n {\n delay: CAROUSEL_AUTOPLAY_INTERVAL,\n // only enable if autoplay is true & user's intent isn't to interact with carousel\n enable: autoPlay && !shouldPauseAutoplay,\n },\n );\n\n useDidUpdate(() => {\n onChange?.(activeSlide);\n }, [activeSlide, onChange]);\n\n React.useEffect(() => {\n announce(`Slide ${activeSlide + 1} of ${totalNumberOfSlides}`);\n }, [activeSlide, totalNumberOfSlides]);\n\n return (\n <CarouselContext.Provider value={carouselContext}>\n <BaseBox display=\"flex\" alignItems=\"center\" flexDirection=\"column\">\n <BaseBox\n width=\"100%\"\n position=\"relative\"\n display=\"flex\"\n alignItems=\"center\"\n gap=\"spacing.4\"\n flexDirection=\"row\"\n >\n <ScrollView\n onScrollBeginDrag={() => {\n setShouldPauseAutoplay(true);\n }}\n onScrollEndDrag={() => {\n setShouldPauseAutoplay(false);\n }}\n {...makeAccessible({ label: accessibilityLabel })}\n ref={containerRef}\n onLayout={(e) => {\n setScrollViewWidth(e.nativeEvent.layout.width);\n }}\n // Sync active indicator with scroll\n onMomentumScrollEnd={(e) => {\n const slideIndex = Math.round(e.nativeEvent.contentOffset.x / slideWidth);\n setActiveSlide(slideIndex);\n }}\n // https://dev.to/reime005/horizontal-card-carousel-in-react-native-303n\n horizontal\n snapToAlignment=\"start\"\n decelerationRate=\"fast\"\n overScrollMode=\"never\"\n contentInsetAdjustmentBehavior=\"never\"\n automaticallyAdjustContentInsets={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n snapToInterval={slideWidth}\n contentInset={{\n left: 0,\n right: 0,\n }}\n contentOffset={{ x: 0, y: 0 }}\n // adding some padding so that if a card is placed the shadows don't cut off\n contentContainerStyle={{ paddingVertical: size[10] }}\n >\n {React.Children.map(children, (child, index) => {\n return React.cloneElement(child as React.ReactElement, {\n index,\n shouldHaveStartSpacing: index === 0,\n shouldHaveEndSpacing: index === totalNumberOfSlides - 1,\n });\n })}\n </ScrollView>\n </BaseBox>\n <Controls\n totalSlides={totalNumberOfSlides}\n activeIndicator={activeSlide}\n showIndicators={showIndicators}\n onIndicatorButtonClick={goToSlideIndex}\n onNextButtonClick={goToNextSlide}\n onPreviousButtonClick={goToPreviousSlide}\n indicatorVariant={indicatorVariant}\n navigationButtonVariant={navigationButtonVariant}\n />\n </BaseBox>\n </CarouselContext.Provider>\n );\n};\n\nexport { Carousel };\n"],"names":["percentageStringToNumber","percentage","endsWith","logger","message","type","moduleName","Number","substring","length","Controls","_ref","showIndicators","activeIndicator","totalSlides","onIndicatorButtonClick","onNextButtonClick","onPreviousButtonClick","indicatorVariant","navigationButtonVariant","_jsxs","BaseBox","marginTop","display","flexDirection","alignItems","gap","children","_jsx","NavigationButton","variant","onClick","Indicators","activeIndex","totalItems","Carousel","_ref2","autoPlay","_ref2$showIndicators","_ref2$carouselItemWid","carouselItemWidth","accessibilityLabel","onChange","_ref2$indicatorVarian","_ref2$navigationButto","containerRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","activeSlide","setActiveSlide","_React$useState3","_React$useState4","scrollViewWidth","setScrollViewWidth","_React$useState5","_React$useState6","shouldPauseAutoplay","setShouldPauseAutoplay","id","useId","_visibleItems","slideWidth","castNativeType","getResponsiveValue","totalNumberOfSlides","Children","count","goToSlideIndex","slideIndex","current","scrollTo","x","y","animated","goToNextSlide","goToPreviousSlide","carouselContext","useMemo","isResponsive","visibleItems","carouselId","carouselContainerRef","setActiveIndicator","carouselItemAlignment","undefined","shouldAddStartEndSpacing","useInterval","delay","CAROUSEL_AUTOPLAY_INTERVAL","enable","useDidUpdate","useEffect","announce","CarouselContext","Provider","value","width","position","ScrollView","Object","assign","onScrollBeginDrag","onScrollEndDrag","makeAccessible","label","ref","onLayout","e","nativeEvent","layout","onMomentumScrollEnd","Math","round","contentOffset","horizontal","snapToAlignment","decelerationRate","overScrollMode","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","snapToInterval","contentInset","left","right","contentContainerStyle","paddingVertical","size","map","child","index","cloneElement","shouldHaveStartSpacing","shouldHaveEndSpacing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAIC,UAAkB,CAAa,CAC/D,GAAI,CAACA,UAAU,CAACC,QAAQ,CAAC,GAAG,CAAC,CAAE,CAC7BC,MAAM,CAAC,CACLC,OAAO,CAAE,oCAAoC,CAC7CC,IAAI,CAAE,OAAO,CACbC,UAAU,CAAE,UACd,CAAC,CAAC,CACJ,CAEA,OAAOC,MAAM,CAACN,UAAU,CAACO,SAAS,CAAC,CAAC,CAAEP,UAAU,CAACQ,MAAM,CAAG,CAAC,CAAC,CAAC,CAAG,GAAG,CACrE,CAAC,CAYD,IAAMC,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAS2B,KARvCC,cAAc,CAAAD,IAAA,CAAdC,cAAc,CACdC,eAAe,CAAAF,IAAA,CAAfE,eAAe,CACfC,WAAW,CAAAH,IAAA,CAAXG,WAAW,CACXC,sBAAsB,CAAAJ,IAAA,CAAtBI,sBAAsB,CACtBC,iBAAiB,CAAAL,IAAA,CAAjBK,iBAAiB,CACjBC,qBAAqB,CAAAN,IAAA,CAArBM,qBAAqB,CACrBC,gBAAgB,CAAAP,IAAA,CAAhBO,gBAAgB,CAChBC,uBAAuB,CAAAR,IAAA,CAAvBQ,uBAAuB,CAEvB,OACEC,IAAA,CAACC,OAAO,CAAA,CACNC,SAAS,CAAC,WAAW,CACrBC,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,KAAK,CACnBC,UAAU,CAAC,QAAQ,CACnBC,GAAG,CAAC,WAAW,CAAAC,QAAA,CAAA,CAEfC,GAAA,CAACP,OAAO,CAAA,CAAAM,QAAA,CACNC,GAAA,CAACC,gBAAgB,CACfxB,CAAAA,IAA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uBAAuB,CAAEA,uBAAwB,CAClD,CAAC,CAAA,CACK,CAAC,CACc,CAAC,CAE/B;;;;"}
1
+ {"version":3,"file":"Carousel.native.js","sources":["../../../../../src/components/Carousel/Carousel.native.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView } from 'react-native';\nimport { Indicators } from './Indicators/Indicators';\nimport { NavigationButton } from './NavigationButton';\nimport type { CarouselProps } from './types';\nimport type { CarouselContextProps } from './CarouselContext';\nimport { CarouselContext } from './CarouselContext';\nimport { CAROUSEL_AUTOPLAY_INTERVAL } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { useInterval } from '~utils/useInterval';\nimport { makeAccessible } from '~utils/makeAccessible/makeAccessible.native';\nimport { announce } from '~components/LiveAnnouncer/LiveAnnouncer.native';\nimport { castNativeType } from '~utils';\nimport { useId } from '~utils/useId';\nimport { logger } from '~utils/logger';\nimport { size } from '~tokens/global';\nimport { useDidUpdate } from '~utils/useDidUpdate';\nimport { getResponsiveValue } from '~components/Box/BaseBox/getResponsiveValue';\nimport type { BladeElementRef } from '~utils/types';\n\nconst percentageStringToNumber = (percentage: string): number => {\n if (!percentage.endsWith('%')) {\n logger({\n message: 'Only percentage values are allowed',\n type: 'error',\n moduleName: 'Carousel',\n });\n }\n\n return Number(percentage.substring(0, percentage.length - 1)) / 100;\n};\n\ntype ControlsProps = Required<\n Pick<CarouselProps, 'indicatorVariant' | 'showIndicators' | 'navigationButtonVariant'>\n> & {\n activeIndicator: number;\n totalSlides: number;\n onIndicatorButtonClick: (index: number) => void;\n onNextButtonClick: () => void;\n onPreviousButtonClick: () => void;\n};\n\nconst Controls = ({\n showIndicators,\n activeIndicator,\n totalSlides,\n onIndicatorButtonClick,\n onNextButtonClick,\n onPreviousButtonClick,\n indicatorVariant,\n navigationButtonVariant,\n}: ControlsProps): React.ReactElement => {\n return (\n <BaseBox\n marginTop=\"spacing.7\"\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n gap=\"spacing.4\"\n >\n <BaseBox>\n <NavigationButton\n type=\"previous\"\n variant={navigationButtonVariant}\n onClick={onPreviousButtonClick}\n />\n </BaseBox>\n {showIndicators ? (\n <Indicators\n onClick={onIndicatorButtonClick}\n activeIndex={activeIndicator}\n totalItems={totalSlides}\n variant={indicatorVariant}\n />\n ) : null}\n <BaseBox>\n <NavigationButton\n onClick={onNextButtonClick}\n type=\"next\"\n variant={navigationButtonVariant}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst _Carousel = (\n {\n autoPlay,\n showIndicators = true,\n children,\n carouselItemWidth = '100%',\n accessibilityLabel,\n onChange,\n indicatorVariant = 'gray',\n navigationButtonVariant = 'filled',\n }: CarouselProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const containerRef = React.useRef<ScrollView>(null);\n const [activeSlide, setActiveSlide] = React.useState(0);\n const [scrollViewWidth, setScrollViewWidth] = React.useState(0);\n const [shouldPauseAutoplay, setShouldPauseAutoplay] = React.useState(false);\n const id = useId();\n\n const _visibleItems = 1;\n const slideWidth =\n scrollViewWidth *\n percentageStringToNumber(castNativeType(getResponsiveValue(carouselItemWidth)));\n const totalNumberOfSlides = React.Children.count(children);\n\n const goToSlideIndex = (slideIndex: number): void => {\n if (!containerRef.current) return;\n containerRef.current.scrollTo({\n x: slideIndex * slideWidth,\n y: 0,\n animated: true,\n });\n setActiveSlide(slideIndex);\n };\n\n const goToNextSlide = (): void => {\n let slideIndex = activeSlide + 1;\n if (slideIndex >= totalNumberOfSlides) {\n slideIndex = 0;\n }\n goToSlideIndex(slideIndex);\n };\n\n const goToPreviousSlide = (): void => {\n let slideIndex = activeSlide - 1;\n if (activeSlide <= 0) {\n slideIndex = totalNumberOfSlides - 1;\n }\n goToSlideIndex(slideIndex);\n };\n\n const carouselContext = React.useMemo<CarouselContextProps>(() => {\n return {\n isResponsive: false,\n visibleItems: _visibleItems,\n carouselItemWidth,\n carouselId: id,\n totalNumberOfSlides,\n slideWidth,\n activeSlide,\n carouselContainerRef: containerRef as never,\n setActiveIndicator: setActiveSlide,\n carouselItemAlignment: undefined,\n shouldAddStartEndSpacing: false,\n };\n }, [carouselItemWidth, id, totalNumberOfSlides, slideWidth, activeSlide]);\n\n // auto play\n useInterval(\n () => {\n goToNextSlide();\n },\n {\n delay: CAROUSEL_AUTOPLAY_INTERVAL,\n // only enable if autoplay is true & user's intent isn't to interact with carousel\n enable: autoPlay && !shouldPauseAutoplay,\n },\n );\n\n useDidUpdate(() => {\n onChange?.(activeSlide);\n }, [activeSlide, onChange]);\n\n React.useEffect(() => {\n announce(`Slide ${activeSlide + 1} of ${totalNumberOfSlides}`);\n }, [activeSlide, totalNumberOfSlides]);\n\n return (\n <CarouselContext.Provider value={carouselContext}>\n <BaseBox ref={ref as never} display=\"flex\" alignItems=\"center\" flexDirection=\"column\">\n <BaseBox\n width=\"100%\"\n position=\"relative\"\n display=\"flex\"\n alignItems=\"center\"\n gap=\"spacing.4\"\n flexDirection=\"row\"\n >\n <ScrollView\n onScrollBeginDrag={() => {\n setShouldPauseAutoplay(true);\n }}\n onScrollEndDrag={() => {\n setShouldPauseAutoplay(false);\n }}\n {...makeAccessible({ label: accessibilityLabel })}\n ref={containerRef}\n onLayout={(e) => {\n setScrollViewWidth(e.nativeEvent.layout.width);\n }}\n // Sync active indicator with scroll\n onMomentumScrollEnd={(e) => {\n const slideIndex = Math.round(e.nativeEvent.contentOffset.x / slideWidth);\n setActiveSlide(slideIndex);\n }}\n // https://dev.to/reime005/horizontal-card-carousel-in-react-native-303n\n horizontal\n snapToAlignment=\"start\"\n decelerationRate=\"fast\"\n overScrollMode=\"never\"\n contentInsetAdjustmentBehavior=\"never\"\n automaticallyAdjustContentInsets={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n snapToInterval={slideWidth}\n contentInset={{\n left: 0,\n right: 0,\n }}\n contentOffset={{ x: 0, y: 0 }}\n // adding some padding so that if a card is placed the shadows don't cut off\n contentContainerStyle={{ paddingVertical: size[10] }}\n >\n {React.Children.map(children, (child, index) => {\n return React.cloneElement(child as React.ReactElement, {\n index,\n shouldHaveStartSpacing: index === 0,\n shouldHaveEndSpacing: index === totalNumberOfSlides - 1,\n });\n })}\n </ScrollView>\n </BaseBox>\n <Controls\n totalSlides={totalNumberOfSlides}\n activeIndicator={activeSlide}\n showIndicators={showIndicators}\n onIndicatorButtonClick={goToSlideIndex}\n onNextButtonClick={goToNextSlide}\n onPreviousButtonClick={goToPreviousSlide}\n indicatorVariant={indicatorVariant}\n navigationButtonVariant={navigationButtonVariant}\n />\n </BaseBox>\n </CarouselContext.Provider>\n );\n};\n\nconst Carousel = React.forwardRef(_Carousel);\n\nexport { Carousel };\n"],"names":["percentageStringToNumber","percentage","endsWith","logger","message","type","moduleName","Number","substring","length","Controls","_ref","showIndicators","activeIndicator","totalSlides","onIndicatorButtonClick","onNextButtonClick","onPreviousButtonClick","indicatorVariant","navigationButtonVariant","_jsxs","BaseBox","marginTop","display","flexDirection","alignItems","gap","children","_jsx","NavigationButton","variant","onClick","Indicators","activeIndex","totalItems","_Carousel","_ref2","ref","autoPlay","_ref2$showIndicators","_ref2$carouselItemWid","carouselItemWidth","accessibilityLabel","onChange","_ref2$indicatorVarian","_ref2$navigationButto","containerRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","activeSlide","setActiveSlide","_React$useState3","_React$useState4","scrollViewWidth","setScrollViewWidth","_React$useState5","_React$useState6","shouldPauseAutoplay","setShouldPauseAutoplay","id","useId","_visibleItems","slideWidth","castNativeType","getResponsiveValue","totalNumberOfSlides","Children","count","goToSlideIndex","slideIndex","current","scrollTo","x","y","animated","goToNextSlide","goToPreviousSlide","carouselContext","useMemo","isResponsive","visibleItems","carouselId","carouselContainerRef","setActiveIndicator","carouselItemAlignment","undefined","shouldAddStartEndSpacing","useInterval","delay","CAROUSEL_AUTOPLAY_INTERVAL","enable","useDidUpdate","useEffect","announce","CarouselContext","Provider","value","width","position","ScrollView","Object","assign","onScrollBeginDrag","onScrollEndDrag","makeAccessible","label","onLayout","e","nativeEvent","layout","onMomentumScrollEnd","Math","round","contentOffset","horizontal","snapToAlignment","decelerationRate","overScrollMode","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","snapToInterval","contentInset","left","right","contentContainerStyle","paddingVertical","size","map","child","index","cloneElement","shouldHaveStartSpacing","shouldHaveEndSpacing","Carousel","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAIC,UAAkB,CAAa,CAC/D,GAAI,CAACA,UAAU,CAACC,QAAQ,CAAC,GAAG,CAAC,CAAE,CAC7BC,MAAM,CAAC,CACLC,OAAO,CAAE,oCAAoC,CAC7CC,IAAI,CAAE,OAAO,CACbC,UAAU,CAAE,UACd,CAAC,CAAC,CACJ,CAEA,OAAOC,MAAM,CAACN,UAAU,CAACO,SAAS,CAAC,CAAC,CAAEP,UAAU,CAACQ,MAAM,CAAG,CAAC,CAAC,CAAC,CAAG,GAAG,CACrE,CAAC,CAYD,IAAMC,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAS2B,CARvC,IAAAC,cAAc,CAAAD,IAAA,CAAdC,cAAc,CACdC,eAAe,CAAAF,IAAA,CAAfE,eAAe,CACfC,WAAW,CAAAH,IAAA,CAAXG,WAAW,CACXC,sBAAsB,CAAAJ,IAAA,CAAtBI,sBAAsB,CACtBC,iBAAiB,CAAAL,IAAA,CAAjBK,iBAAiB,CACjBC,qBAAqB,CAAAN,IAAA,CAArBM,qBAAqB,CACrBC,gBAAgB,CAAAP,IAAA,CAAhBO,gBAAgB,CAChBC,uBAAuB,CAAAR,IAAA,CAAvBQ,uBAAuB,CAEvB,OACEC,IAAA,CAACC,OAAO,CACNC,CAAAA,SAAS,CAAC,WAAW,CACrBC,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,KAAK,CACnBC,UAAU,CAAC,QAAQ,CAC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Y,CAC7BzC,cAAc,CAAEA,cAAe,CAC/BG,sBAAsB,CAAEyD,cAAe,CACvCxD,iBAAiB,CAAE+D,aAAc,CACjC9D,qBAAqB,CAAE+D,iBAAkB,CACzC9D,gBAAgB,CAAEA,gBAAiB,CACnCC,uBAAuB,CAAEA,uBAAwB,CAClD,CAAC,EACK,CAAC,CACc,CAAC,CAE/B,CAAC,CAEK,IAAAwH,QAAQ,CAAG5F,cAAK,CAAC6F,UAAU,CAACzG,SAAS;;;;"}
@@ -17,7 +17,7 @@ import '../../../tokens/global/typography.js';
17
17
  import '../../../tokens/global/motion.js';
18
18
  import { size } from '../../../tokens/global/size.js';
19
19
 
20
- var _excluded=["onClick","accessibilityLabel"];var PressableIndicatorButton=styled(BaseBox)(function(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;return getIndicatorButtonStyles({theme:theme,isActive:isActive,variant:variant});});var StyledIndicatorButton=function StyledIndicatorButton(_ref2){var onClick=_ref2.onClick,accessibilityLabel=_ref2.accessibilityLabel,props=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var easing=castNativeType(theme.motion.easing.standard.effective);var duration=castNativeType(makeMotionTime(theme.motion.duration.gentle));var style=useAnimatedStyle(function(){return {width:withTiming(props.isActive?size[18]:size[6],{duration:duration,easing:easing})};},[props.isActive]);return jsx(Pressable,{onPress:onClick,accessibilityLabel:accessibilityLabel,children:jsx(PressableIndicatorButton,Object.assign({},props,{children:jsx(Animated.View,{style:style})}))});};
20
+ var _excluded=["onClick","accessibilityLabel"];var PressableIndicatorButton=styled(BaseBox)(function(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;return getIndicatorButtonStyles({theme:theme,isActive:isActive,variant:variant});});var StyledIndicatorButton=function StyledIndicatorButton(_ref2){var onClick=_ref2.onClick,accessibilityLabel=_ref2.accessibilityLabel,props=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var easing=castNativeType(theme.motion.easing.standard);var duration=castNativeType(makeMotionTime(theme.motion.duration.gentle));var style=useAnimatedStyle(function(){return {width:withTiming(props.isActive?size[18]:size[6],{duration:duration,easing:easing})};},[props.isActive]);return jsx(Pressable,{onPress:onClick,accessibilityLabel:accessibilityLabel,children:jsx(PressableIndicatorButton,Object.assign({},props,{children:jsx(Animated.View,{style:style})}))});};
21
21
 
22
22
  export { StyledIndicatorButton };
23
23
  //# sourceMappingURL=StyledIndicatorButton.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StyledIndicatorButton.native.js","sources":["../../../../../../src/components/Carousel/Indicators/StyledIndicatorButton.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable } from 'react-native';\nimport styled from 'styled-components/native';\nimport Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';\nimport { getIndicatorButtonStyles } from './getIndicatorButtonStyles';\nimport type { IndicatorButtonProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castNativeType, makeMotionTime } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport { size } from '~tokens/global';\n\nconst PressableIndicatorButton = styled(BaseBox)<\n Pick<IndicatorButtonProps, 'variant' | 'isActive'>\n>(({ theme, isActive, variant }) => {\n return getIndicatorButtonStyles({ theme, isActive, variant });\n});\n\nconst StyledIndicatorButton = ({\n onClick,\n accessibilityLabel,\n ...props\n}: IndicatorButtonProps & { accessibilityLabel?: string }): React.ReactElement => {\n const { theme } = useTheme();\n const easing = castNativeType(theme.motion.easing.standard.effective);\n const duration = castNativeType(makeMotionTime(theme.motion.duration.gentle));\n\n const style = useAnimatedStyle(() => {\n return {\n width: withTiming(props.isActive ? size[18] : size[6], {\n duration,\n easing,\n }),\n };\n }, [props.isActive]);\n\n return (\n <Pressable onPress={onClick} accessibilityLabel={accessibilityLabel}>\n <PressableIndicatorButton {...props}>\n <Animated.View style={style} />\n </PressableIndicatorButton>\n </Pressable>\n );\n};\n\nexport { StyledIndicatorButton };\n"],"names":["PressableIndicatorButton","styled","BaseBox","_ref","theme","isActive","variant","getIndicatorButtonStyles","StyledIndicatorButton","_ref2","onClick","accessibilityLabel","props","_objectWithoutProperties","_excluded","_useTheme","useTheme","easing","castNativeType","motion","standard","effective","duration","makeMotionTime","gentle","style","useAnimatedStyle","width","withTiming","size","_jsx","Pressable","onPress","children","Object","assign","Animated","View"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,SAAA,CAAA,oBAAA,CAAA,CAWA,IAAMA,wBAAwB,CAAGC,MAAM,CAACC,OAAO,CAAC,CAE9C,SAAAC,IAAA,CAAkC,CAA/B,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAEC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CAC3B,OAAOC,wBAAwB,CAAC,CAAEH,KAAK,CAALA,KAAK,CAAEC,QAAQ,CAARA,QAAQ,CAAEC,OAAO,CAAPA,OAAQ,CAAC,CAAC,CAC/D,CAAC,CAAC,CAEI,IAAAE,qBAAqB,CAAG,SAAxBA,qBAAqBA,CAAAC,KAAA,CAIuD,CAAA,IAHhFC,OAAO,CAAAD,KAAA,CAAPC,OAAO,CACPC,kBAAkB,CAAAF,KAAA,CAAlBE,kBAAkB,CACfC,KAAK,CAAAC,wBAAA,CAAAJ,KAAA,CAAAK,SAAA,CAER,CAAA,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBZ,KAAK,CAAAW,SAAA,CAALX,KAAK,CACb,IAAMa,MAAM,CAAGC,cAAc,CAACd,KAAK,CAACe,MAAM,CAACF,MAAM,CAACG,QAAQ,CAACC,SAAS,CAAC,CACrE,IAAMC,QAAQ,CAAGJ,cAAc,CAACK,cAAc,CAACnB,KAAK,CAACe,MAAM,CAACG,QAAQ,CAACE,MAAM,CAAC,CAAC,CAE7E,IAAMC,KAAK,CAAGC,gBAAgB,CAAC,UAAM,CACnC,OAAO,CACLC,KAAK,CAAEC,UAAU,CAAChB,KAAK,CAACP,QAAQ,CAAGwB,IAAI,CAAC,EAAE,CAAC,CAAGA,IAAI,CAAC,CAAC,CAAC,CAAE,CACrDP,QAAQ,CAARA,QAAQ,CACRL,MAAM,CAANA,MACF,CAAC,CACH,CAAC,CACH,CAAC,CAAE,CAACL,KAAK,CAACP,QAAQ,CAAC,CAAC,CAEpB,OACEyB,GAAA,CAACC,SAAS,CAAA,CAACC,OAAO,CAAEtB,OAAQ,CAACC,kBAAkB,CAAEA,kBAAmB,CAAAsB,QAAA,CAClEH,GAAA,CAAC9B,wBAAwB,CAAAkC,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAKvB,KAAK,CAAA,CAAAqB,QAAA,CACjCH,GAAA,CAACM,QAAQ,CAACC,IAAI,CAACZ,CAAAA,KAAK,CAAEA,KAAM,CAAE,CAAC,CAAA,CACP,CAAC,CAClB,CAAC,CAEhB;;;;"}
1
+ {"version":3,"file":"StyledIndicatorButton.native.js","sources":["../../../../../../src/components/Carousel/Indicators/StyledIndicatorButton.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable } from 'react-native';\nimport styled from 'styled-components/native';\nimport Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated';\nimport { getIndicatorButtonStyles } from './getIndicatorButtonStyles';\nimport type { IndicatorButtonProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castNativeType, makeMotionTime } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport { size } from '~tokens/global';\n\nconst PressableIndicatorButton = styled(BaseBox)<\n Pick<IndicatorButtonProps, 'variant' | 'isActive'>\n>(({ theme, isActive, variant }) => {\n return getIndicatorButtonStyles({ theme, isActive, variant });\n});\n\nconst StyledIndicatorButton = ({\n onClick,\n accessibilityLabel,\n ...props\n}: IndicatorButtonProps & { accessibilityLabel?: string }): React.ReactElement => {\n const { theme } = useTheme();\n const easing = castNativeType(theme.motion.easing.standard);\n const duration = castNativeType(makeMotionTime(theme.motion.duration.gentle));\n\n const style = useAnimatedStyle(() => {\n return {\n width: withTiming(props.isActive ? size[18] : size[6], {\n duration,\n easing,\n }),\n };\n }, [props.isActive]);\n\n return (\n <Pressable onPress={onClick} accessibilityLabel={accessibilityLabel}>\n <PressableIndicatorButton {...props}>\n <Animated.View style={style} />\n </PressableIndicatorButton>\n </Pressable>\n );\n};\n\nexport { StyledIndicatorButton };\n"],"names":["PressableIndicatorButton","styled","BaseBox","_ref","theme","isActive","variant","getIndicatorButtonStyles","StyledIndicatorButton","_ref2","onClick","accessibilityLabel","props","_objectWithoutProperties","_excluded","_useTheme","useTheme","easing","castNativeType","motion","standard","duration","makeMotionTime","gentle","style","useAnimatedStyle","width","withTiming","size","_jsx","Pressable","onPress","children","Object","assign","Animated","View"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,SAAA,CAAA,oBAAA,CAAA,CAWA,IAAMA,wBAAwB,CAAGC,MAAM,CAACC,OAAO,CAAC,CAE9C,SAAAC,IAAA,CAAkC,CAA/B,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CAAEC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CAC3B,OAAOC,wBAAwB,CAAC,CAAEH,KAAK,CAALA,KAAK,CAAEC,QAAQ,CAARA,QAAQ,CAAEC,OAAO,CAAPA,OAAQ,CAAC,CAAC,CAC/D,CAAC,CAAC,CAEI,IAAAE,qBAAqB,CAAG,SAAxBA,qBAAqBA,CAAAC,KAAA,CAIuD,CAHhF,IAAAC,OAAO,CAAAD,KAAA,CAAPC,OAAO,CACPC,kBAAkB,CAAAF,KAAA,CAAlBE,kBAAkB,CACfC,KAAK,CAAAC,wBAAA,CAAAJ,KAAA,CAAAK,SAAA,CAAA,CAER,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBZ,KAAK,CAAAW,SAAA,CAALX,KAAK,CACb,IAAMa,MAAM,CAAGC,cAAc,CAACd,KAAK,CAACe,MAAM,CAACF,MAAM,CAACG,QAAQ,CAAC,CAC3D,IAAMC,QAAQ,CAAGH,cAAc,CAACI,cAAc,CAAClB,KAAK,CAACe,MAAM,CAACE,QAAQ,CAACE,MAAM,CAAC,CAAC,CAE7E,IAAMC,KAAK,CAAGC,gBAAgB,CAAC,UAAM,CACnC,OAAO,CACLC,KAAK,CAAEC,UAAU,CAACf,KAAK,CAACP,QAAQ,CAAGuB,IAAI,CAAC,EAAE,CAAC,CAAGA,IAAI,CAAC,CAAC,CAAC,CAAE,CACrDP,QAAQ,CAARA,QAAQ,CACRJ,MAAM,CAANA,MACF,CAAC,CACH,CAAC,CACH,CAAC,CAAE,CAACL,KAAK,CAACP,QAAQ,CAAC,CAAC,CAEpB,OACEwB,GAAA,CAACC,SAAS,CAAA,CAACC,OAAO,CAAErB,OAAQ,CAACC,kBAAkB,CAAEA,kBAAmB,CAAAqB,QAAA,CAClEH,GAAA,CAAC7B,wBAAwB,CAAAiC,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAKtB,KAAK,CAAA,CAAAoB,QAAA,CACjCH,GAAA,CAACM,QAAQ,CAACC,IAAI,CAACZ,CAAAA,KAAK,CAAEA,KAAM,CAAE,CAAC,CAAA,CACP,CAAC,CAClB,CAAC,CAEhB;;;;"}
@@ -12,7 +12,7 @@ import { makeSize } from '../../../utils/makeSize/makeSize.js';
12
12
  import '../../BladeProvider/useTheme.js';
13
13
  import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.native.js';
14
14
 
15
- var getIndicatorButtonStyles=function getIndicatorButtonStyles(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;var backgroundColor={gray:theme.colors.interactive.icon.gray.muted,white:theme.colors.interactive.icon.staticWhite.normal,blue:theme.colors.interactive.icon.primary.subtle};var easing=castWebType(theme.motion.easing.standard.effective);var duration=castWebType(makeMotionTime(theme.motion.duration.gentle));return Object.assign({border:'none',cursor:'pointer',padding:makeSpace(theme.spacing[0]),borderRadius:theme.border.radius.max,backgroundColor:isActive?backgroundColor[variant]:theme.colors.overlay.background.moderate,width:isActive?makeSize(size[18]):makeSize(size[6]),height:makeSize(size[6])},isReactNative()&&{width:undefined},!isReactNative()&&{transitionProperty:'width',transitionDuration:duration,transitionTimingFunction:easing,'&:before':{content:`""`,padding:makeSize(size[10]),paddingTop:makeSize(size[20])},'&:focus-visible':Object.assign({},getFocusRingStyles())});};
15
+ var getIndicatorButtonStyles=function getIndicatorButtonStyles(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;var backgroundColor={gray:theme.colors.interactive.icon.gray.muted,white:theme.colors.interactive.icon.staticWhite.normal,blue:theme.colors.interactive.icon.primary.subtle};var easing=castWebType(theme.motion.easing.standard);var duration=castWebType(makeMotionTime(theme.motion.duration.gentle));return Object.assign({border:'none',cursor:'pointer',padding:makeSpace(theme.spacing[0]),borderRadius:theme.border.radius.max,backgroundColor:isActive?backgroundColor[variant]:theme.colors.overlay.background.moderate,width:isActive?makeSize(size[18]):makeSize(size[6]),height:makeSize(size[6])},isReactNative()&&{width:undefined},!isReactNative()&&{transitionProperty:'width',transitionDuration:duration,transitionTimingFunction:easing,'&:before':{content:`""`,padding:makeSize(size[10]),paddingTop:makeSize(size[20])},'&:focus-visible':Object.assign({},getFocusRingStyles())});};
16
16
 
17
17
  export { getIndicatorButtonStyles };
18
18
  //# sourceMappingURL=getIndicatorButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getIndicatorButtonStyles.js","sources":["../../../../../../src/components/Carousel/Indicators/getIndicatorButtonStyles.ts"],"sourcesContent":["import type { CSSObject, DefaultTheme } from 'styled-components';\nimport type { IndicatorButtonProps } from './types';\nimport { size } from '~tokens/global';\nimport { castWebType, isReactNative, makeMotionTime, makeSize, makeSpace } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst getIndicatorButtonStyles = ({\n theme,\n isActive,\n variant,\n}: {\n theme: DefaultTheme;\n} & Pick<IndicatorButtonProps, 'isActive' | 'variant'>): CSSObject => {\n const backgroundColor = {\n gray: theme.colors.interactive.icon.gray.muted,\n white: theme.colors.interactive.icon.staticWhite.normal,\n blue: theme.colors.interactive.icon.primary.subtle,\n };\n\n const easing = castWebType(theme.motion.easing.standard.effective);\n const duration = castWebType(makeMotionTime(theme.motion.duration.gentle));\n\n return {\n border: 'none',\n cursor: 'pointer',\n padding: makeSpace(theme.spacing[0]),\n borderRadius: theme.border.radius.max,\n backgroundColor: isActive ? backgroundColor[variant] : theme.colors.overlay.background.moderate,\n width: isActive ? makeSize(size[18]) : makeSize(size[6]),\n height: makeSize(size[6]),\n\n ...(isReactNative() && {\n width: undefined,\n }),\n\n ...(!isReactNative() && {\n transitionProperty: 'width',\n transitionDuration: duration,\n transitionTimingFunction: easing,\n '&:before': {\n content: `\"\"`,\n // increasing the hit area, just random numbers\n padding: makeSize(size[10]),\n paddingTop: makeSize(size[20]),\n },\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n },\n }),\n };\n};\n\nexport { getIndicatorButtonStyles };\n"],"names":["getIndicatorButtonStyles","_ref","theme","isActive","variant","backgroundColor","gray","colors","interactive","icon","muted","white","staticWhite","normal","blue","primary","subtle","easing","castWebType","motion","standard","effective","duration","makeMotionTime","gentle","Object","assign","border","cursor","padding","makeSpace","spacing","borderRadius","radius","max","overlay","background","moderate","width","makeSize","size","height","isReactNative","undefined","transitionProperty","transitionDuration","transitionTimingFunction","content","paddingTop","getFocusRingStyles"],"mappings":";;;;;;;;;;;;;;AAMM,IAAAA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,CAMwC,CAAA,IALpEC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CAIP,IAAMC,eAAe,CAAG,CACtBC,IAAI,CAAEJ,KAAK,CAACK,MAAM,CAACC,WAAW,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U,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAC3BQ,UAAU,CAAET,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAC/B,CAAC,CACD,iBAAiB,CAAAf,MAAA,CAAAC,MAAA,CACZuB,EAAAA,CAAAA,kBAAkB,CAAU,CAAC,CAEpC,CAAC,CAAA,CAEL;;;;"}
1
+ {"version":3,"file":"getIndicatorButtonStyles.js","sources":["../../../../../../src/components/Carousel/Indicators/getIndicatorButtonStyles.ts"],"sourcesContent":["import type { CSSObject, DefaultTheme } from 'styled-components';\nimport type { IndicatorButtonProps } from './types';\nimport { size } from '~tokens/global';\nimport { castWebType, isReactNative, makeMotionTime, makeSize, makeSpace } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst getIndicatorButtonStyles = ({\n theme,\n isActive,\n variant,\n}: {\n theme: DefaultTheme;\n} & Pick<IndicatorButtonProps, 'isActive' | 'variant'>): CSSObject => {\n const backgroundColor = {\n gray: theme.colors.interactive.icon.gray.muted,\n white: theme.colors.interactive.icon.staticWhite.normal,\n blue: theme.colors.interactive.icon.primary.subtle,\n };\n\n const easing = castWebType(theme.motion.easing.standard);\n const duration = castWebType(makeMotionTime(theme.motion.duration.gentle));\n\n return {\n border: 'none',\n cursor: 'pointer',\n padding: makeSpace(theme.spacing[0]),\n borderRadius: theme.border.radius.max,\n backgroundColor: isActive ? backgroundColor[variant] : theme.colors.overlay.background.moderate,\n width: isActive ? makeSize(size[18]) : makeSize(size[6]),\n height: makeSize(size[6]),\n\n ...(isReactNative() && {\n width: undefined,\n }),\n\n ...(!isReactNative() && {\n transitionProperty: 'width',\n transitionDuration: duration,\n transitionTimingFunction: easing,\n '&:before': {\n content: `\"\"`,\n // increasing the hit area, just random numbers\n padding: makeSize(size[10]),\n paddingTop: makeSize(size[20]),\n },\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n },\n }),\n };\n};\n\nexport { getIndicatorButtonStyles };\n"],"names":["getIndicatorButtonStyles","_ref","theme","isActive","variant","backgroundColor","gray","colors","interactive","icon","muted","white","staticWhite","normal","blue","primary","subtle","easing","castWebType","motion","standard","duration","makeMotionTime","gentle","Object","assign","border","cursor","padding","makeSpace","spacing","borderRadius","radius","max","overlay","background","moderate","width","makeSize","size","height","isReactNative","undefined","transitionProperty","transitionDuration","transitionTimingFunction","content","paddingTop","getFocusRingStyles"],"mappings":";;;;;;;;;;;;;;AAMM,IAAAA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,CAMwC,CAAA,IALpEC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,OAAO,CAAAH,IAAA,CAAPG,OAAO,CAIP,IAAMC,eAAe,CAAG,CACtBC,IAAI,CAAEJ,KAAK,CAACK,MAAM,CAACC,WAAW,CAACC,IAAI,CAACH,IAAI,CAACI,KAAK,CAC9CC,KAAK,CAAET,KAAK,CAACK,MAAM,CAACC,WAAW,CAACC,IAAI,CAACG,WAAW,CAACC,MAAM,CACvDC,IAAI,CAAEZ,KAAK,CAACK,MAAM,CAACC,WAAW,CAACC,IAAI,CAACM,OAAO,CAACC,MAC9C,CAAC,CAED,IAAMC,MAAM,CAAGC,WAAW,CAAChB,KAAK,CAACiB,MAAM,CAACF,MAAM,CAACG,QAAQ,CAAC,CACxD,IAAMC,QAAQ,CAAGH,WAAW,CAACI,cAAc,CAACpB,KAAK,CAACiB,MAAM,CAACE,QAAQ,CAACE,MAAM,CAAC,CAAC,CAE1E,OAAAC,MAAA,CAAAC,MAAA,CACEC,CAAAA,MAAM,CAAE,MAAM,CACdC,MAAM,CAAE,SAAS,CACjBC,OAAO,CAAEC,SAAS,CAAC3B,KAAK,CAAC4B,OAAO,CAAC,CAAC,CAAC,CAAC,CACpCC,YAAY,CAAE7B,KAAK,CAACwB,MAAM,CAACM,MAAM,CAACC,GAAG,CACrC5B,eAAe,CAAEF,QAAQ,CAAGE,eAAe,CAACD,OAAO,CAAC,CAAGF,KAAK,CAACK,MAAM,CAAC2B,OAAO,CAACC,UAAU,CAACC,QAAQ,CAC/FC,KAAK,CAAElC,QAAQ,CAAGmC,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAGD,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,CACxDC,MAAM,CAAEF,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA,CAErBE,aAAa,EAAE,EAAI,CACrBJ,KAAK,CAAEK,SACT,CAAC,CAEG,CAACD,aAAa,EAAE,EAAI,CACtBE,kBAAkB,CAAE,OAAO,CAC3BC,kBAAkB,CAAEvB,QAAQ,CAC5BwB,wBAAwB,CAAE5B,MAAM,CAChC,UAAU,CAAE,CACV6B,OAAO,CAAG,CAAA,EAAA,CAAG,CAEblB,OAAO,CAAEU,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAAC,CAC3BQ,UAAU,CAAET,QAAQ,CAACC,IAAI,CAAC,EAAE,CAAC,CAC/B,CAAC,CACD,iBAAiB,CAAAf,MAAA,CAAAC,MAAA,CACZuB,EAAAA,CAAAA,kBAAkB,CAAU,CAAC,CAEpC,CAAC,CAAA,CAEL;;;;"}
@@ -8,7 +8,7 @@ import { makeSpace } from '../../../utils/makeSpace/makeSpace.js';
8
8
  import '../../BladeProvider/useTheme.js';
9
9
  import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.native.js';
10
10
 
11
- var getNavigationButtonStyles=function getNavigationButtonStyles(props){var theme=props.theme,_props$isPressed=props.isPressed,isPressed=_props$isPressed===void 0?false:_props$isPressed,_props$variant=props.variant,variant=_props$variant===void 0?'filled':_props$variant;var motionToken=theme.motion;var iconColor={filled:{default:theme.colors.interactive.icon.staticBlack.muted,highlighted:theme.colors.interactive.icon.staticBlack.muted},stroked:{default:theme.colors.interactive.icon.gray.normal,highlighted:theme.colors.interactive.icon.gray.normal}};var backgroundColor={filled:{default:theme.colors.interactive.background.staticWhite.default,highlighted:theme.colors.interactive.background.staticWhite.highlighted},stroked:{default:theme.colors.interactive.background.staticWhite.faded,highlighted:theme.colors.interactive.background.staticWhite.fadedHighlighted}};var borderColors={filled:theme.colors.transparent,stroked:theme.colors.interactive.border.gray.faded};var borderColor=borderColors[variant];var borderWidth=theme.border.width.thin;var borderRadius=theme.border.radius.max;var state=isPressed?'highlighted':'default';return Object.assign({cursor:'pointer',background:'transparent',border:'none',borderStyle:'solid',borderWidth:borderWidth,borderRadius:borderRadius,borderColor:borderColor,backgroundColor:backgroundColor[variant][state],color:iconColor[variant][state],padding:makeSpace(theme.spacing[3]),display:'flex',alignItems:'center',justifyContent:'center',alignSelf:'center'},isReactNative()?{}:{transitionProperty:'color, box-shadow',transitionDuration:castWebType(makeMotionTime(motionToken.duration.xquick)),transitionTimingFunction:castWebType(motionToken.easing.standard.effective),boxShadow:variant==='filled'?castWebType(theme.elevation.midRaised):undefined,'&:hover':{color:iconColor[variant].highlighted,backgroundColor:backgroundColor[variant].highlighted},'&:focus-visible':Object.assign({},getFocusRingStyles(),{color:iconColor[variant].highlighted,backgroundColor:backgroundColor[variant].highlighted}),'&:active':{color:iconColor[variant].highlighted,backgroundColor:backgroundColor[variant].highlighted}});};
11
+ var getNavigationButtonStyles=function getNavigationButtonStyles(props){var theme=props.theme,_props$isPressed=props.isPressed,isPressed=_props$isPressed===void 0?false:_props$isPressed,_props$variant=props.variant,variant=_props$variant===void 0?'filled':_props$variant;var motionToken=theme.motion;var iconColor={filled:{default:theme.colors.interactive.icon.staticBlack.muted,highlighted:theme.colors.interactive.icon.staticBlack.muted},stroked:{default:theme.colors.interactive.icon.gray.normal,highlighted:theme.colors.interactive.icon.gray.normal}};var backgroundColor={filled:{default:theme.colors.interactive.background.staticWhite.default,highlighted:theme.colors.interactive.background.staticWhite.highlighted},stroked:{default:theme.colors.interactive.background.staticWhite.faded,highlighted:theme.colors.interactive.background.staticWhite.fadedHighlighted}};var borderColors={filled:theme.colors.transparent,stroked:theme.colors.interactive.border.gray.faded};var borderColor=borderColors[variant];var borderWidth=theme.border.width.thin;var borderRadius=theme.border.radius.max;var state=isPressed?'highlighted':'default';return Object.assign({cursor:'pointer',background:'transparent',border:'none',borderStyle:'solid',borderWidth:borderWidth,borderRadius:borderRadius,borderColor:borderColor,backgroundColor:backgroundColor[variant][state],color:iconColor[variant][state],padding:makeSpace(theme.spacing[3]),display:'flex',alignItems:'center',justifyContent:'center',alignSelf:'center'},isReactNative()?{}:{transitionProperty:'color, box-shadow',transitionDuration:castWebType(makeMotionTime(motionToken.duration.xquick)),transitionTimingFunction:castWebType(motionToken.easing.standard),boxShadow:variant==='filled'?castWebType(theme.elevation.midRaised):undefined,'&:hover':{color:iconColor[variant].highlighted,backgroundColor:backgroundColor[variant].highlighted},'&:focus-visible':Object.assign({},getFocusRingStyles(),{color:iconColor[variant].highlighted,backgroundColor:backgroundColor[variant].highlighted}),'&:active':{color:iconColor[variant].highlighted,backgroundColor:backgroundColor[variant].highlighted}});};
12
12
 
13
13
  export { getNavigationButtonStyles };
14
14
  //# sourceMappingURL=getNavigationButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getNavigationButtonStyles.js","sources":["../../../../../../src/components/Carousel/NavigationButton/getNavigationButtonStyles.ts"],"sourcesContent":["import type { CSSObject, DefaultTheme } from 'styled-components';\nimport type { NavigationButtonProps } from './types';\nimport { castWebType, isReactNative, makeMotionTime, makeSpace } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst getNavigationButtonStyles = (props: {\n theme: DefaultTheme;\n isPressed?: boolean;\n variant: NavigationButtonProps['variant'];\n}): CSSObject => {\n const { theme, isPressed = false, variant = 'filled' } = props;\n const motionToken = theme.motion;\n\n const iconColor = {\n filled: {\n default: theme.colors.interactive.icon.staticBlack.muted,\n highlighted: theme.colors.interactive.icon.staticBlack.muted,\n },\n stroked: {\n default: theme.colors.interactive.icon.gray.normal,\n highlighted: theme.colors.interactive.icon.gray.normal,\n },\n };\n\n const backgroundColor = {\n filled: {\n default: theme.colors.interactive.background.staticWhite.default,\n highlighted: theme.colors.interactive.background.staticWhite.highlighted,\n },\n stroked: {\n default: theme.colors.interactive.background.staticWhite.faded,\n highlighted: theme.colors.interactive.background.staticWhite.fadedHighlighted,\n },\n };\n\n const borderColors = {\n filled: theme.colors.transparent,\n stroked: theme.colors.interactive.border.gray.faded,\n } as const;\n\n const borderColor = borderColors[variant];\n const borderWidth = theme.border.width.thin;\n const borderRadius = theme.border.radius.max;\n // on react-native isPressed will be passed\n const state = isPressed ? 'highlighted' : 'default';\n\n return {\n cursor: 'pointer',\n background: 'transparent',\n border: 'none',\n borderStyle: 'solid',\n borderWidth,\n borderRadius,\n borderColor,\n backgroundColor: backgroundColor[variant][state],\n color: iconColor[variant][state],\n\n padding: makeSpace(theme.spacing[3]),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n alignSelf: 'center',\n\n ...(isReactNative()\n ? {}\n : {\n transitionProperty: 'color, box-shadow',\n transitionDuration: castWebType(makeMotionTime(motionToken.duration.xquick)),\n transitionTimingFunction: castWebType(motionToken.easing.standard.effective),\n boxShadow: variant === 'filled' ? castWebType(theme.elevation.midRaised) : undefined,\n\n '&:hover': {\n color: iconColor[variant].highlighted,\n backgroundColor: backgroundColor[variant].highlighted,\n },\n\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n color: iconColor[variant].highlighted,\n backgroundColor: backgroundColor[variant].highlighted,\n },\n\n '&:active': {\n color: iconColor[variant].highlighted,\n backgroundColor: backgroundColor[variant].highlighted,\n },\n }),\n };\n};\n\nexport { getNavigationButtonStyles };\n"],"names":["getNavigationButtonStyles","props","theme","_props$isPressed","isPressed","_props$variant","variant","motionToken","motion","iconColor","filled","default","colors","interactive","icon","staticBlack","muted","highlighted","stroked","gray","normal","backgroundColor","background","staticWhite","faded","fadedHighlighted","borderColors","transparent","border","borderColor","borderWidth","width","thin","borderRadius","radius","max","state","Object","assign","cursor","borderStyle","color","padding","makeSpace","spacing","display","alignItems","justifyContent","alignSelf","isReactNative","transitionProperty","transitionDuration","castWebType","makeMotionTime","duration","xquick","transitionTimingFunction","easing","standard","effective","boxShadow","elevation","midRaised","undefined","getFocusRingStyles"],"mappings":";;;;;;;;;;AAKM,IAAAA,yBAAyB,CAAG,SAA5BA,yBAAyBA,CAAIC,KAIlC,CAAgB,CACf,IAAQC,KAAK,CAA4CD,KAAK,CAAtDC,KAAK,CAAAC,gBAAA,CAA4CF,KAAK,CAA/CG,SAAS,CAATA,SAAS,CAAAD,gBAAA,GAAA,KAAA,CAAA,CAAG,KAAK,CAAAA,gBAAA,CAAAE,cAAA,CAAyBJ,KAAK,CAA5BK,OAAO,CAAPA,OAAO,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,cAAA,CACpD,IAAME,WAAW,CAAGL,KAAK,CAACM,MAAM,CAEhC,IAAMC,SAAS,CAAG,CAChBC,MAAM,CAAE,CACNC,OAAO,CAAET,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACC,WAAW,CAACC,KAAK,CACxDC,WAAW,CAAEf,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACC,WAAW,CAACC,KACzD,CAAC,CACDE,OAAO,CAAE,CACPP,OAAO,CAAET,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACK,IAAI,CAACC,MAAM,CAClDH,WAAW,CAAEf,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACK,IAAI,CAACC,MAClD,CACF,CAAC,CAED,IAAMC,eAAe,CAAG,CACtBX,MAAM,CAAE,CACNC,OAAO,CAAET,KAAK,CAACU,MAAM,CAACC,WAAW,CAACS,UAAU,CAACC,WAAW,CAACZ,OAAO,CAChEM,WAAW,CAAEf,KAAK,CAACU,MAAM,CAACC,WAAW,CAACS,UAAU,CAACC,WAAW,CAACN,WAC/D,CAAC,CACDC,OAAO,CAAE,CACPP,O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AW,CAACC,cAAc,CAAC9C,WAAW,CAAC+C,QAAQ,CAACC,MAAM,CAAC,CAAC,CAC5EC,wBAAwB,CAAEJ,WAAW,CAAC7C,WAAW,CAACkD,MAAM,CAACC,QAAQ,CAACC,SAAS,CAAC,CAC5EC,SAAS,CAAEtD,OAAO,GAAK,QAAQ,CAAG8C,WAAW,CAAClD,KAAK,CAAC2D,SAAS,CAACC,SAAS,CAAC,CAAGC,SAAS,CAEpF,SAAS,CAAE,CACTtB,KAAK,CAAEhC,SAAS,CAACH,OAAO,CAAC,CAACW,WAAW,CACrCI,eAAe,CAAEA,eAAe,CAACf,OAAO,CAAC,CAACW,WAC5C,CAAC,CAED,iBAAiB,CAAAoB,MAAA,CAAAC,MAAA,CAAA,EAAA,CACZ0B,kBAAkB,CAAU,CAAC,CAChCvB,CAAAA,KAAK,CAAEhC,SAAS,CAACH,OAAO,CAAC,CAACW,WAAW,CACrCI,eAAe,CAAEA,eAAe,CAACf,OAAO,CAAC,CAACW,WAAW,CACtD,CAAA,CAED,UAAU,CAAE,CACVwB,KAAK,CAAEhC,SAAS,CAACH,OAAO,CAAC,CAACW,WAAW,CACrCI,eAAe,CAAEA,eAAe,CAACf,OAAO,CAAC,CAACW,WAC5C,CACF,CAAC,CAET,CAAA;;;;"}
1
+ {"version":3,"file":"getNavigationButtonStyles.js","sources":["../../../../../../src/components/Carousel/NavigationButton/getNavigationButtonStyles.ts"],"sourcesContent":["import type { CSSObject, DefaultTheme } from 'styled-components';\nimport type { NavigationButtonProps } from './types';\nimport { castWebType, isReactNative, makeMotionTime, makeSpace } from '~utils';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst getNavigationButtonStyles = (props: {\n theme: DefaultTheme;\n isPressed?: boolean;\n variant: NavigationButtonProps['variant'];\n}): CSSObject => {\n const { theme, isPressed = false, variant = 'filled' } = props;\n const motionToken = theme.motion;\n\n const iconColor = {\n filled: {\n default: theme.colors.interactive.icon.staticBlack.muted,\n highlighted: theme.colors.interactive.icon.staticBlack.muted,\n },\n stroked: {\n default: theme.colors.interactive.icon.gray.normal,\n highlighted: theme.colors.interactive.icon.gray.normal,\n },\n };\n\n const backgroundColor = {\n filled: {\n default: theme.colors.interactive.background.staticWhite.default,\n highlighted: theme.colors.interactive.background.staticWhite.highlighted,\n },\n stroked: {\n default: theme.colors.interactive.background.staticWhite.faded,\n highlighted: theme.colors.interactive.background.staticWhite.fadedHighlighted,\n },\n };\n\n const borderColors = {\n filled: theme.colors.transparent,\n stroked: theme.colors.interactive.border.gray.faded,\n } as const;\n\n const borderColor = borderColors[variant];\n const borderWidth = theme.border.width.thin;\n const borderRadius = theme.border.radius.max;\n // on react-native isPressed will be passed\n const state = isPressed ? 'highlighted' : 'default';\n\n return {\n cursor: 'pointer',\n background: 'transparent',\n border: 'none',\n borderStyle: 'solid',\n borderWidth,\n borderRadius,\n borderColor,\n backgroundColor: backgroundColor[variant][state],\n color: iconColor[variant][state],\n\n padding: makeSpace(theme.spacing[3]),\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n alignSelf: 'center',\n\n ...(isReactNative()\n ? {}\n : {\n transitionProperty: 'color, box-shadow',\n transitionDuration: castWebType(makeMotionTime(motionToken.duration.xquick)),\n transitionTimingFunction: castWebType(motionToken.easing.standard),\n boxShadow: variant === 'filled' ? castWebType(theme.elevation.midRaised) : undefined,\n\n '&:hover': {\n color: iconColor[variant].highlighted,\n backgroundColor: backgroundColor[variant].highlighted,\n },\n\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n color: iconColor[variant].highlighted,\n backgroundColor: backgroundColor[variant].highlighted,\n },\n\n '&:active': {\n color: iconColor[variant].highlighted,\n backgroundColor: backgroundColor[variant].highlighted,\n },\n }),\n };\n};\n\nexport { getNavigationButtonStyles };\n"],"names":["getNavigationButtonStyles","props","theme","_props$isPressed","isPressed","_props$variant","variant","motionToken","motion","iconColor","filled","default","colors","interactive","icon","staticBlack","muted","highlighted","stroked","gray","normal","backgroundColor","background","staticWhite","faded","fadedHighlighted","borderColors","transparent","border","borderColor","borderWidth","width","thin","borderRadius","radius","max","state","Object","assign","cursor","borderStyle","color","padding","makeSpace","spacing","display","alignItems","justifyContent","alignSelf","isReactNative","transitionProperty","transitionDuration","castWebType","makeMotionTime","duration","xquick","transitionTimingFunction","easing","standard","boxShadow","elevation","midRaised","undefined","getFocusRingStyles"],"mappings":";;;;;;;;;;AAKM,IAAAA,yBAAyB,CAAG,SAA5BA,yBAAyBA,CAAIC,KAIlC,CAAgB,CACf,IAAQC,KAAK,CAA4CD,KAAK,CAAtDC,KAAK,CAAAC,gBAAA,CAA4CF,KAAK,CAA/CG,SAAS,CAATA,SAAS,CAAAD,gBAAA,GAAA,KAAA,CAAA,CAAG,KAAK,CAAAA,gBAAA,CAAAE,cAAA,CAAyBJ,KAAK,CAA5BK,OAAO,CAAPA,OAAO,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,cAAA,CACpD,IAAME,WAAW,CAAGL,KAAK,CAACM,MAAM,CAEhC,IAAMC,SAAS,CAAG,CAChBC,MAAM,CAAE,CACNC,OAAO,CAAET,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACC,WAAW,CAACC,KAAK,CACxDC,WAAW,CAAEf,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACC,WAAW,CAACC,KACzD,CAAC,CACDE,OAAO,CAAE,CACPP,OAAO,CAAET,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACK,IAAI,CAACC,MAAM,CAClDH,WAAW,CAAEf,KAAK,CAACU,MAAM,CAACC,WAAW,CAACC,IAAI,CAACK,IAAI,CAACC,MAClD,CACF,CAAC,CAED,IAAMC,eAAe,CAAG,CACtBX,MAAM,CAAE,CACNC,OAAO,CAAET,KAAK,CAACU,MAAM,CAACC,WAAW,CAACS,UAAU,CAACC,WAAW,CAACZ,OAAO,CAChEM,WAAW,CAAEf,KAAK,CAACU,MAAM,CAACC,WA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AE,CACf,EAAE,CACF,CACEC,kBAAkB,CAAE,mBAAmB,CACvCC,kBAAkB,CAAEC,WAAW,CAACC,cAAc,CAAC9C,WAAW,CAAC+C,QAAQ,CAACC,MAAM,CAAC,CAAC,CAC5EC,wBAAwB,CAAEJ,WAAW,CAAC7C,WAAW,CAACkD,MAAM,CAACC,QAAQ,CAAC,CAClEC,SAAS,CAAErD,OAAO,GAAK,QAAQ,CAAG8C,WAAW,CAAClD,KAAK,CAAC0D,SAAS,CAACC,SAAS,CAAC,CAAGC,SAAS,CAEpF,SAAS,CAAE,CACTrB,KAAK,CAAEhC,SAAS,CAACH,OAAO,CAAC,CAACW,WAAW,CACrCI,eAAe,CAAEA,eAAe,CAACf,OAAO,CAAC,CAACW,WAC5C,CAAC,CAED,iBAAiB,CAAAoB,MAAA,CAAAC,MAAA,CAAA,EAAA,CACZyB,kBAAkB,CAAU,CAAC,CAChCtB,CAAAA,KAAK,CAAEhC,SAAS,CAACH,OAAO,CAAC,CAACW,WAAW,CACrCI,eAAe,CAAEA,eAAe,CAACf,OAAO,CAAC,CAACW,WAAW,CACtD,CAAA,CAED,UAAU,CAAE,CACVwB,KAAK,CAAEhC,SAAS,CAACH,OAAO,CAAC,CAACW,WAAW,CACrCI,eAAe,CAAEA,eAAe,CAACf,OAAO,CAAC,CAACW,WAC5C,CACF,CAAC,CAET,CAAA;;;;"}
@@ -19,27 +19,29 @@ import useTheme from '../BladeProvider/useTheme.js';
19
19
  import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
20
20
  import { FormHint } from '../Form/FormHint.js';
21
21
  import '../VisuallyHidden/VisuallyHidden.native.js';
22
- import '../Typography/BaseText/BaseText.native.js';
23
- import { jsxs, jsx } from 'react/jsx-runtime';
22
+ import '../Typography/Heading/Heading.js';
24
23
  import '../Typography/Text/Text.js';
25
24
  import '../Typography/Code/Code.js';
25
+ import '../Typography/Display/Display.js';
26
26
  import 'styled-components/native';
27
27
  import '@gorhom/portal';
28
28
  import 'react-native-gesture-handler';
29
29
  import '../BottomSheet/BottomSheetStack.js';
30
+ import { jsxs, jsx } from 'react/jsx-runtime';
30
31
  import { SelectorLabel } from '../Form/Selector/SelectorLabel.native.js';
31
32
  import { SelectorTitle } from '../Form/Selector/SelectorTitle.js';
32
33
  import { SelectorSupportText } from '../Form/Selector/SelectorSupportText.js';
33
34
  import { SelectorInput } from '../Form/Selector/SelectorInput.native.js';
34
35
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
36
+ import { getOuterMotionRef, getInnerMotionRef } from '../../utils/getMotionRefs.js';
35
37
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
36
38
 
37
- var _excluded=["defaultChecked","validationState","isChecked","isDisabled","isIndeterminate","isRequired","name","onChange","value","children","helpText","errorText","size","tabIndex","testID"];var _Checkbox=function _Checkbox(_ref,ref){var _groupProps$state,_groupProps$size;var defaultChecked=_ref.defaultChecked,validationState=_ref.validationState,isChecked=_ref.isChecked,isDisabled=_ref.isDisabled,isIndeterminate=_ref.isIndeterminate,isRequired=_ref.isRequired,name=_ref.name,onChange=_ref.onChange,value=_ref.value,children=_ref.children,helpText=_ref.helpText,errorText=_ref.errorText,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,tabIndex=_ref.tabIndex,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var groupProps=useCheckboxGroupContext();var hasValidationState=!isUndefined(validationState);var hasName=!isUndefined(name);var hasDefaultChecked=!isUndefined(defaultChecked);var hasIsChecked=!isUndefined(isChecked);var hasOnChange=!isUndefined(onChange);if(__DEV__){if((hasValidationState||hasName||hasDefaultChecked||hasIsChecked||hasOnChange)&&!isEmpty(groupProps)){var props=[hasValidationState?'validationState':undefined,hasName?'name':undefined,hasDefaultChecked?'defaultChecked':undefined,hasIsChecked?'isChecked':undefined,hasOnChange?'onChange':undefined].filter(Boolean).join(',');throwBladeError({message:`Cannot set \`${props}\` on <Checkbox /> when it's inside <CheckboxGroup />, Please set it on the <CheckboxGroup /> itself`,moduleName:'Checkbox'});}if(!value&&!isEmpty(groupProps)){throw new Error(`[Blade Checkbox]: <CheckboxGroup /> requires that you pass unique "value" prop to each <Checkbox />
39
+ var _excluded=["defaultChecked","validationState","isChecked","isDisabled","isIndeterminate","isRequired","name","onChange","value","children","helpText","errorText","size","tabIndex","testID","_motionMeta"];var _Checkbox=function _Checkbox(_ref,ref){var _groupProps$state,_groupProps$size;var defaultChecked=_ref.defaultChecked,validationState=_ref.validationState,isChecked=_ref.isChecked,isDisabled=_ref.isDisabled,isIndeterminate=_ref.isIndeterminate,isRequired=_ref.isRequired,name=_ref.name,onChange=_ref.onChange,value=_ref.value,children=_ref.children,helpText=_ref.helpText,errorText=_ref.errorText,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,tabIndex=_ref.tabIndex,testID=_ref.testID,_motionMeta=_ref._motionMeta,rest=_objectWithoutProperties(_ref,_excluded);var groupProps=useCheckboxGroupContext();var hasValidationState=!isUndefined(validationState);var hasName=!isUndefined(name);var hasDefaultChecked=!isUndefined(defaultChecked);var hasIsChecked=!isUndefined(isChecked);var hasOnChange=!isUndefined(onChange);if(__DEV__){if((hasValidationState||hasName||hasDefaultChecked||hasIsChecked||hasOnChange)&&!isEmpty(groupProps)){var props=[hasValidationState?'validationState':undefined,hasName?'name':undefined,hasDefaultChecked?'defaultChecked':undefined,hasIsChecked?'isChecked':undefined,hasOnChange?'onChange':undefined].filter(Boolean).join(',');throwBladeError({message:`Cannot set \`${props}\` on <Checkbox /> when it's inside <CheckboxGroup />, Please set it on the <CheckboxGroup /> itself`,moduleName:'Checkbox'});}if(!value&&!isEmpty(groupProps)){throw new Error(`[Blade Checkbox]: <CheckboxGroup /> requires that you pass unique "value" prop to each <Checkbox />
38
40
  <CheckboxGroup>
39
41
  <Checkbox value="apple">Apple</Checkbox>
40
42
  <Checkbox value="mango">Mango</Checkbox>
41
43
  </CheckboxGroup>
42
- `);}}var _validationState=validationState!=null?validationState:groupProps==null?void 0:groupProps.validationState;var _hasError=_validationState==='error';var _isDisabled=isDisabled!=null?isDisabled:groupProps==null?void 0:groupProps.isDisabled;var _isRequired=Boolean(isRequired||(groupProps==null?void 0:groupProps.isRequired)||(groupProps==null?void 0:groupProps.necessityIndicator)==='required');var _name=name!=null?name:groupProps==null?void 0:groupProps.name;var _isChecked=isChecked!=null?isChecked:groupProps==null?void 0:(_groupProps$state=groupProps.state)==null?void 0:_groupProps$state.isChecked(value);var _size=(_groupProps$size=groupProps.size)!=null?_groupProps$size:size;var _useTheme=useTheme(),theme=_useTheme.theme;var formHintSize={small:'medium',medium:'medium',large:'large'};var showSupportingText=helpText;var handleChange=function handleChange(_ref2){var isChecked=_ref2.isChecked,event=_ref2.event,value=_ref2.value;if(isChecked){var _groupProps$state2;groupProps==null?void 0:(_groupProps$state2=groupProps.state)==null?void 0:_groupProps$state2.addValue(value);}else {var _groupProps$state3;groupProps==null?void 0:(_groupProps$state3=groupProps.state)==null?void 0:_groupProps$state3.removeValue(value);}onChange==null?void 0:onChange({isChecked:isChecked,event:event,value:value});};var _useCheckbox=useCheckbox({defaultChecked:defaultChecked,isChecked:_isChecked,isIndeterminate:isIndeterminate,hasError:_hasError,hasHelperText:Boolean(showSupportingText),isDisabled:_isDisabled,isRequired:_isRequired,name:_name,value:value,onChange:handleChange}),state=_useCheckbox.state,ids=_useCheckbox.ids,inputProps=_useCheckbox.inputProps;var helpTextLeftSpacing=makeSize(checkboxSizes.icon[size].width+theme.spacing[3]);return jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Checkbox,testID:testID}),getStyledProps(rest),{children:[jsx(SelectorLabel,{componentName:MetaConstants.CheckboxLabel,inputProps:state.isReactNative?inputProps:{},style:{cursor:isDisabled?'not-allowed':'pointer'},children:jsxs(BaseBox,{display:"flex",flexDirection:"column",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",children:[jsx(SelectorInput,Object.assign({hoverTokens:checkboxHoverTokens,isChecked:state.isChecked||Boolean(isIndeterminate),isDisabled:_isDisabled,hasError:_hasError,inputProps:inputProps,tabIndex:tabIndex,ref:ref},makeAnalyticsAttribute(rest))),jsx(CheckboxIcon,{size:_size,isChecked:state.isChecked,isIndeterminate:isIndeterminate,isDisabled:_isDisabled,isNegative:_hasError}),children?jsx(SelectorTitle,{size:_size,isDisabled:_isDisabled,children:children}):null]}),showSupportingText?jsx(BaseBox,{marginLeft:helpTextLeftSpacing,children:jsx(SelectorSupportText,{size:_size,id:ids==null?void 0:ids.helpTextId,children:helpText})}):null]})}),jsx(FormHint,{size:formHintSize[_size],errorText:errorText,errorTextId:ids==null?void 0:ids.errorTextId,type:validationState==='error'?'error':'help'})]}));};var Checkbox=assignWithoutSideEffects(React__default.forwardRef(_Checkbox),{displayName:'Checkbox'});
44
+ `);}}var _validationState=validationState!=null?validationState:groupProps==null?void 0:groupProps.validationState;var _hasError=_validationState==='error';var _isDisabled=isDisabled!=null?isDisabled:groupProps==null?void 0:groupProps.isDisabled;var _isRequired=Boolean(isRequired||(groupProps==null?void 0:groupProps.isRequired)||(groupProps==null?void 0:groupProps.necessityIndicator)==='required');var _name=name!=null?name:groupProps==null?void 0:groupProps.name;var _isChecked=isChecked!=null?isChecked:groupProps==null?void 0:(_groupProps$state=groupProps.state)==null?void 0:_groupProps$state.isChecked(value);var _size=(_groupProps$size=groupProps.size)!=null?_groupProps$size:size;var _useTheme=useTheme(),theme=_useTheme.theme;var formHintSize={small:'medium',medium:'medium',large:'large'};var showSupportingText=helpText;var handleChange=function handleChange(_ref2){var isChecked=_ref2.isChecked,event=_ref2.event,value=_ref2.value;if(isChecked){var _groupProps$state2;groupProps==null?void 0:(_groupProps$state2=groupProps.state)==null?void 0:_groupProps$state2.addValue(value);}else {var _groupProps$state3;groupProps==null?void 0:(_groupProps$state3=groupProps.state)==null?void 0:_groupProps$state3.removeValue(value);}onChange==null?void 0:onChange({isChecked:isChecked,event:event,value:value});};var _useCheckbox=useCheckbox({defaultChecked:defaultChecked,isChecked:_isChecked,isIndeterminate:isIndeterminate,hasError:_hasError,hasHelperText:Boolean(showSupportingText),isDisabled:_isDisabled,isRequired:_isRequired,name:_name,value:value,onChange:handleChange}),state=_useCheckbox.state,ids=_useCheckbox.ids,inputProps=_useCheckbox.inputProps;var helpTextLeftSpacing=makeSize(checkboxSizes.icon[size].width+theme.spacing[3]);return jsxs(BaseBox,Object.assign({ref:getOuterMotionRef({_motionMeta:_motionMeta,ref:ref})},metaAttribute({name:MetaConstants.Checkbox,testID:testID}),getStyledProps(rest),{children:[jsx(SelectorLabel,{componentName:MetaConstants.CheckboxLabel,inputProps:state.isReactNative?inputProps:{},style:{cursor:isDisabled?'not-allowed':'pointer'},children:jsxs(BaseBox,{display:"flex",flexDirection:"column",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",children:[jsx(SelectorInput,Object.assign({hoverTokens:checkboxHoverTokens,isChecked:state.isChecked||Boolean(isIndeterminate),isDisabled:_isDisabled,hasError:_hasError,inputProps:inputProps,tabIndex:tabIndex,ref:getInnerMotionRef({_motionMeta:_motionMeta,ref:ref})},makeAnalyticsAttribute(rest))),jsx(CheckboxIcon,{size:_size,isChecked:state.isChecked,isIndeterminate:isIndeterminate,isDisabled:_isDisabled,isNegative:_hasError}),children?jsx(SelectorTitle,{size:_size,isDisabled:_isDisabled,children:children}):null]}),showSupportingText?jsx(BaseBox,{marginLeft:helpTextLeftSpacing,children:jsx(SelectorSupportText,{size:_size,id:ids==null?void 0:ids.helpTextId,children:helpText})}):null]})}),jsx(FormHint,{size:formHintSize[_size],errorText:errorText,errorTextId:ids==null?void 0:ids.errorTextId,type:validationState==='error'?'error':'help'})]}));};var Checkbox=assignWithoutSideEffects(React__default.forwardRef(_Checkbox),{displayName:'Checkbox'});
43
45
 
44
46
  export { Checkbox };
45
47
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\n/* eslint-disable @typescript-eslint/no-shadow */\nimport React from 'react';\nimport { useCheckboxGroupContext } from './CheckboxGroup/CheckboxGroupContext';\nimport { CheckboxIcon } from './CheckboxIcon';\nimport { useCheckbox } from './useCheckbox';\nimport { checkboxHoverTokens, checkboxSizes } from './checkboxTokens';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport isUndefined from '~utils/lodashButBetter/isUndefined';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint } from '~components/Form';\nimport { SelectorLabel } from '~components/Form/Selector/SelectorLabel';\nimport { SelectorTitle } from '~components/Form/Selector/SelectorTitle';\nimport { SelectorSupportText } from '~components/Form/Selector/SelectorSupportText';\nimport { SelectorInput } from '~components/Form/Selector/SelectorInput';\nimport type { BladeElementRef, DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { makeSize, useTheme } from '~utils';\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\ntype CheckboxProps = {\n /**\n * If `true`, The checkbox will be checked. This also makes the checkbox controlled\n * Use `onChange` to update its value\n *\n * @default false\n */\n isChecked?: boolean;\n /**\n * If `true`, the checkbox will be initially checked. This also makes the checkbox uncontrolled\n *\n * @default false\n */\n defaultChecked?: boolean;\n /**\n * The callback invoked when the checked state of the `Checkbox` changes.\n */\n onChange?: OnChange;\n /**\n * Sets the label of the checkbox\n */\n children?: React.ReactNode;\n /**\n * Help text for the checkbox\n */\n helpText?: string;\n /**\n * Error text for the checkbox\n *\n * Renders when `validationState` is set to 'error'\n */\n errorText?: string;\n /**\n * If `true`, the checkbox will be indeterminate.\n * This does not modify the isChecked property.\n *\n * @default false\n */\n isIndeterminate?: boolean;\n /**\n * The name of the input field in a checkbox\n * (Useful for form submission).\n */\n name?: string;\n /**\n * The value to be used in the checkbox input.\n * This is the value that will be returned on form submission.\n */\n value?: string;\n /**\n * If `true`, the checkbox will be disabled\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * If `true`, the checkbox input is marked as required,\n * and `required` attribute will be added\n *\n * @default false\n */\n isRequired?: boolean;\n /**\n * If `error`, the checkbox input is marked as invalid,\n * and `invalid` attribute will be added\n */\n validationState?: 'error' | 'none';\n /**\n * Size of the checkbox\n *\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Sets the tab-index property on checkbox element\n *\n */\n tabIndex?: number;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst _Checkbox: React.ForwardRefRenderFunction<BladeElementRef, CheckboxProps> = (\n {\n defaultChecked,\n validationState,\n isChecked,\n isDisabled,\n isIndeterminate,\n isRequired,\n name,\n onChange,\n value,\n children,\n helpText,\n errorText,\n size = 'medium',\n tabIndex,\n testID,\n ...rest\n },\n ref,\n) => {\n const groupProps = useCheckboxGroupContext();\n\n // ban certain props in checkbox while inside group\n const hasValidationState = !isUndefined(validationState);\n const hasName = !isUndefined(name);\n const hasDefaultChecked = !isUndefined(defaultChecked);\n const hasIsChecked = !isUndefined(isChecked);\n const hasOnChange = !isUndefined(onChange);\n\n if (__DEV__) {\n if (\n (hasValidationState || hasName || hasDefaultChecked || hasIsChecked || hasOnChange) &&\n !isEmpty(groupProps)\n ) {\n const props = [\n hasValidationState ? 'validationState' : undefined,\n hasName ? 'name' : undefined,\n hasDefaultChecked ? 'defaultChecked' : undefined,\n hasIsChecked ? 'isChecked' : undefined,\n hasOnChange ? 'onChange' : undefined,\n ]\n .filter(Boolean)\n .join(',');\n\n throwBladeError({\n message: `Cannot set \\`${props}\\` on <Checkbox /> when it's inside <CheckboxGroup />, Please set it on the <CheckboxGroup /> itself`,\n moduleName: 'Checkbox',\n });\n }\n\n // mandate value prop when using inside group\n if (!value && !isEmpty(groupProps)) {\n throw new Error(\n `[Blade Checkbox]: <CheckboxGroup /> requires that you pass unique \"value\" prop to each <Checkbox />\n <CheckboxGroup>\n <Checkbox value=\"apple\">Apple</Checkbox>\n <Checkbox value=\"mango\">Mango</Checkbox>\n </CheckboxGroup>\n `,\n );\n }\n }\n\n const _validationState = validationState ?? groupProps?.validationState;\n const _hasError = _validationState === 'error';\n const _isDisabled = isDisabled ?? groupProps?.isDisabled;\n const _isRequired = Boolean(\n isRequired || groupProps?.isRequired || groupProps?.necessityIndicator === 'required',\n );\n const _name = name ?? groupProps?.name;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const _isChecked = isChecked ?? groupProps?.state?.isChecked(value!);\n const _size = groupProps.size ?? size;\n const { theme } = useTheme();\n const formHintSize = {\n small: 'medium',\n medium: 'medium',\n large: 'large',\n } as const;\n\n const showSupportingText = helpText;\n\n const handleChange: OnChange = ({ isChecked, event, value }) => {\n if (isChecked) {\n groupProps?.state?.addValue(value!);\n } else {\n groupProps?.state?.removeValue(value!);\n }\n\n onChange?.({ isChecked, event, value });\n };\n\n const { state, ids, inputProps } = useCheckbox({\n defaultChecked,\n isChecked: _isChecked,\n isIndeterminate,\n hasError: _hasError,\n hasHelperText: Boolean(showSupportingText),\n isDisabled: _isDisabled,\n isRequired: _isRequired,\n name: _name,\n value,\n onChange: handleChange,\n });\n\n // Checkbox icon's size & margin + margin-left of SelectorTitle which is 2\n const helpTextLeftSpacing = makeSize(checkboxSizes.icon[size].width + theme.spacing[3]);\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.Checkbox, testID })} {...getStyledProps(rest)}>\n <SelectorLabel\n componentName={MetaConstants.CheckboxLabel}\n inputProps={state.isReactNative ? inputProps : {}}\n style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox display=\"flex\" flexDirection=\"row\">\n <SelectorInput\n hoverTokens={checkboxHoverTokens}\n isChecked={state.isChecked || Boolean(isIndeterminate)}\n isDisabled={_isDisabled}\n hasError={_hasError}\n inputProps={inputProps}\n tabIndex={tabIndex}\n ref={ref}\n {...makeAnalyticsAttribute(rest)}\n />\n <CheckboxIcon\n size={_size}\n isChecked={state.isChecked}\n isIndeterminate={isIndeterminate}\n isDisabled={_isDisabled}\n isNegative={_hasError}\n />\n {children ? (\n <SelectorTitle size={_size} isDisabled={_isDisabled}>\n {children}\n </SelectorTitle>\n ) : null}\n </BaseBox>\n {showSupportingText ? (\n <BaseBox marginLeft={helpTextLeftSpacing}>\n <SelectorSupportText size={_size} id={ids?.helpTextId}>\n {helpText}\n </SelectorSupportText>\n </BaseBox>\n ) : null}\n </BaseBox>\n </SelectorLabel>\n <FormHint\n size={formHintSize[_size]}\n errorText={errorText}\n errorTextId={ids?.errorTextId}\n type={validationState === 'error' ? 'error' : 'help'}\n />\n </BaseBox>\n );\n};\n\nconst Checkbox = assignWithoutSideEffects(React.forwardRef(_Checkbox), {\n displayName: 'Checkbox',\n});\n\nexport type { CheckboxProps };\nexport { Checkbox };\n"],"names":["_Checkbox","_ref","ref","_groupProps$state","_groupProps$size","defaultChecked","validationState","isChecked","isDisabled","isIndeterminate","isRequired","name","onChange","value","children","helpText","errorText","_ref$size","size","tabIndex","testID","rest","_objectWithoutProperties","_excluded","groupProps","useCheckboxGroupContext","hasValidationState","isUndefined","hasName","hasDefaultChecked","hasIsChecked","hasOnChange","__DEV__","isEmpty","props","undefined","filter","Boolean","join","throwBladeError","message","moduleName","Error","_validationState","_hasError","_isDisabled","_isRequired","necessityIndicator","_name","_isChecked","state","_size","_useTheme","useTheme","theme","formHintSize","small","medium","large","showSupportingText","handleChange","_ref2","event","_groupProps$state2","addValue","_groupProps$state3","removeValue","_useCheckbox","useCheckbox","hasError","hasHelperText","ids","inputProps","helpTextLeftSpacing","makeSize","checkboxSizes","icon","width","spacing","_jsxs","BaseBox","Object","assign","metaAttribute","MetaConstants","Checkbox","getStyledProps","_jsx","SelectorLabel","componentName","CheckboxLabel","isReactNative","style","cursor","display","flexDirection","SelectorInput","hoverTokens","checkboxHoverTokens","makeAnalyticsAttribute","CheckboxIcon","isNegative","SelectorTitle","marginLeft","SelectorSupportText","id","helpTextId","FormHint","errorTextId","type","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,gBAAA,CAAA,iBAAA,CAAA,WAAA,CAAA,YAAA,CAAA,iBAAA,CAAA,YAAA,CAAA,MAAA,CAAA,UAAA,CAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,WAAA,CAAA,MAAA,CAAA,UAAA,CAAA,QAAA,CAAA,CAkHA,IAAMA,SAAyE,CAAG,SAA5EA,SAAyEA,CAAAC,IAAA,CAmB7EC,GAAG,CACA,CAAA,IAAAC,iBAAA,CAAAC,gBAAA,KAlBDC,cAAc,CAAAJ,IAAA,CAAdI,cAAc,CACdC,eAAe,CAAAL,IAAA,CAAfK,eAAe,CACfC,SAAS,CAAAN,IAAA,CAATM,SAAS,CACTC,UAAU,CAAAP,IAAA,CAAVO,UAAU,CACVC,eAAe,CAAAR,IAAA,CAAfQ,eAAe,CACfC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACVC,IAAI,CAAAV,IAAA,CAAJU,IAAI,CACJC,QAAQ,CAAAX,IAAA,CAARW,QAAQ,CACRC,KAAK,CAAAZ,IAAA,CAALY,KAAK,CACLC,QAAQ,CAAAb,IAAA,CAARa,QAAQ,CACRC,QAAQ,CAAAd,IAAA,CAARc,QAAQ,CACRC,SAAS,CAAAf,IAAA,CAATe,SAAS,CAAAC,SAAA,CAAAhB,IAAA,CACTiB,IAAI,CAAJA,IAAI,CAAAD,SAAA,UAAG,QAAQ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C,WAAY,CACxBwD,UAAU,CAAEzD,SAAU,CACvB,CAAC,CACD9B,QAAQ,CACPyE,GAAA,CAACe,aAAa,EAACpF,IAAI,CAAEiC,KAAM,CAAC3C,UAAU,CAAEqC,WAAY,CAAA/B,QAAA,CACjDA,QAAQ,CACI,CAAC,CACd,IAAI,CACD,CAAA,CAAC,CACT6C,kBAAkB,CACjB4B,GAAA,CAACP,OAAO,CAAA,CAACuB,UAAU,CAAE9B,mBAAoB,CAAA3D,QAAA,CACvCyE,GAAA,CAACiB,mBAAmB,CAAA,CAACtF,IAAI,CAAEiC,KAAM,CAACsD,EAAE,CAAElC,GAAG,EAAA,IAAA,CAAA,KAAA,CAAA,CAAHA,GAAG,CAAEmC,UAAW,CAAA5F,QAAA,CACnDC,QAAQ,CACU,CAAC,CACf,CAAC,CACR,IAAI,CACD,CAAA,CAAC,CACG,CAAC,CAChBwE,GAAA,CAACoB,QAAQ,CAAA,CACPzF,IAAI,CAAEqC,YAAY,CAACJ,KAAK,CAAE,CAC1BnC,SAAS,CAAEA,SAAU,CACrB4F,WAAW,CAAErC,GAAG,EAAA,IAAA,CAAA,KAAA,CAAA,CAAHA,GAAG,CAAEqC,WAAY,CAC9BC,IAAI,CAAEvG,eAAe,GAAK,OAAO,CAAG,OAAO,CAAG,MAAO,CACtD,CAAC,GACK,CAAC,CAEd,CAAC,CAEK,IAAA+E,QAAQ,CAAGyB,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAChH,SAAS,CAAC,CAAE,CACrEiH,WAAW,CAAE,UACf,CAAC;;;;"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/restrict-plus-operands */\n/* eslint-disable @typescript-eslint/no-shadow */\nimport React from 'react';\nimport { useCheckboxGroupContext } from './CheckboxGroup/CheckboxGroupContext';\nimport { CheckboxIcon } from './CheckboxIcon';\nimport { useCheckbox } from './useCheckbox';\nimport { checkboxHoverTokens, checkboxSizes } from './checkboxTokens';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport isUndefined from '~utils/lodashButBetter/isUndefined';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint } from '~components/Form';\nimport { SelectorLabel } from '~components/Form/Selector/SelectorLabel';\nimport { SelectorTitle } from '~components/Form/Selector/SelectorTitle';\nimport { SelectorSupportText } from '~components/Form/Selector/SelectorSupportText';\nimport { SelectorInput } from '~components/Form/Selector/SelectorInput';\nimport type { BladeElementRef, DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { makeSize, useTheme } from '~utils';\nimport { getInnerMotionRef, getOuterMotionRef } from '~utils/getMotionRefs';\nimport type { MotionMetaProp } from '~components/BaseMotion';\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\ntype CheckboxProps = {\n /**\n * If `true`, The checkbox will be checked. This also makes the checkbox controlled\n * Use `onChange` to update its value\n *\n * @default false\n */\n isChecked?: boolean;\n /**\n * If `true`, the checkbox will be initially checked. This also makes the checkbox uncontrolled\n *\n * @default false\n */\n defaultChecked?: boolean;\n /**\n * The callback invoked when the checked state of the `Checkbox` changes.\n */\n onChange?: OnChange;\n /**\n * Sets the label of the checkbox\n */\n children?: React.ReactNode;\n /**\n * Help text for the checkbox\n */\n helpText?: string;\n /**\n * Error text for the checkbox\n *\n * Renders when `validationState` is set to 'error'\n */\n errorText?: string;\n /**\n * If `true`, the checkbox will be indeterminate.\n * This does not modify the isChecked property.\n *\n * @default false\n */\n isIndeterminate?: boolean;\n /**\n * The name of the input field in a checkbox\n * (Useful for form submission).\n */\n name?: string;\n /**\n * The value to be used in the checkbox input.\n * This is the value that will be returned on form submission.\n */\n value?: string;\n /**\n * If `true`, the checkbox will be disabled\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * If `true`, the checkbox input is marked as required,\n * and `required` attribute will be added\n *\n * @default false\n */\n isRequired?: boolean;\n /**\n * If `error`, the checkbox input is marked as invalid,\n * and `invalid` attribute will be added\n */\n validationState?: 'error' | 'none';\n /**\n * Size of the checkbox\n *\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Sets the tab-index property on checkbox element\n *\n */\n tabIndex?: number;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade &\n MotionMetaProp;\n\nconst _Checkbox: React.ForwardRefRenderFunction<BladeElementRef, CheckboxProps> = (\n {\n defaultChecked,\n validationState,\n isChecked,\n isDisabled,\n isIndeterminate,\n isRequired,\n name,\n onChange,\n value,\n children,\n helpText,\n errorText,\n size = 'medium',\n tabIndex,\n testID,\n _motionMeta,\n ...rest\n },\n ref,\n) => {\n const groupProps = useCheckboxGroupContext();\n\n // ban certain props in checkbox while inside group\n const hasValidationState = !isUndefined(validationState);\n const hasName = !isUndefined(name);\n const hasDefaultChecked = !isUndefined(defaultChecked);\n const hasIsChecked = !isUndefined(isChecked);\n const hasOnChange = !isUndefined(onChange);\n\n if (__DEV__) {\n if (\n (hasValidationState || hasName || hasDefaultChecked || hasIsChecked || hasOnChange) &&\n !isEmpty(groupProps)\n ) {\n const props = [\n hasValidationState ? 'validationState' : undefined,\n hasName ? 'name' : undefined,\n hasDefaultChecked ? 'defaultChecked' : undefined,\n hasIsChecked ? 'isChecked' : undefined,\n hasOnChange ? 'onChange' : undefined,\n ]\n .filter(Boolean)\n .join(',');\n\n throwBladeError({\n message: `Cannot set \\`${props}\\` on <Checkbox /> when it's inside <CheckboxGroup />, Please set it on the <CheckboxGroup /> itself`,\n moduleName: 'Checkbox',\n });\n }\n\n // mandate value prop when using inside group\n if (!value && !isEmpty(groupProps)) {\n throw new Error(\n `[Blade Checkbox]: <CheckboxGroup /> requires that you pass unique \"value\" prop to each <Checkbox />\n <CheckboxGroup>\n <Checkbox value=\"apple\">Apple</Checkbox>\n <Checkbox value=\"mango\">Mango</Checkbox>\n </CheckboxGroup>\n `,\n );\n }\n }\n\n const _validationState = validationState ?? groupProps?.validationState;\n const _hasError = _validationState === 'error';\n const _isDisabled = isDisabled ?? groupProps?.isDisabled;\n const _isRequired = Boolean(\n isRequired || groupProps?.isRequired || groupProps?.necessityIndicator === 'required',\n );\n const _name = name ?? groupProps?.name;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const _isChecked = isChecked ?? groupProps?.state?.isChecked(value!);\n const _size = groupProps.size ?? size;\n const { theme } = useTheme();\n const formHintSize = {\n small: 'medium',\n medium: 'medium',\n large: 'large',\n } as const;\n\n const showSupportingText = helpText;\n\n const handleChange: OnChange = ({ isChecked, event, value }) => {\n if (isChecked) {\n groupProps?.state?.addValue(value!);\n } else {\n groupProps?.state?.removeValue(value!);\n }\n\n onChange?.({ isChecked, event, value });\n };\n\n const { state, ids, inputProps } = useCheckbox({\n defaultChecked,\n isChecked: _isChecked,\n isIndeterminate,\n hasError: _hasError,\n hasHelperText: Boolean(showSupportingText),\n isDisabled: _isDisabled,\n isRequired: _isRequired,\n name: _name,\n value,\n onChange: handleChange,\n });\n\n // Checkbox icon's size & margin + margin-left of SelectorTitle which is 2\n const helpTextLeftSpacing = makeSize(checkboxSizes.icon[size].width + theme.spacing[3]);\n\n return (\n <BaseBox\n ref={getOuterMotionRef({ _motionMeta, ref })}\n {...metaAttribute({ name: MetaConstants.Checkbox, testID })}\n {...getStyledProps(rest)}\n >\n <SelectorLabel\n componentName={MetaConstants.CheckboxLabel}\n inputProps={state.isReactNative ? inputProps : {}}\n style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox display=\"flex\" flexDirection=\"row\">\n <SelectorInput\n hoverTokens={checkboxHoverTokens}\n isChecked={state.isChecked || Boolean(isIndeterminate)}\n isDisabled={_isDisabled}\n hasError={_hasError}\n inputProps={inputProps}\n tabIndex={tabIndex}\n ref={getInnerMotionRef({ _motionMeta, ref })}\n {...makeAnalyticsAttribute(rest)}\n />\n <CheckboxIcon\n size={_size}\n isChecked={state.isChecked}\n isIndeterminate={isIndeterminate}\n isDisabled={_isDisabled}\n isNegative={_hasError}\n />\n {children ? (\n <SelectorTitle size={_size} isDisabled={_isDisabled}>\n {children}\n </SelectorTitle>\n ) : null}\n </BaseBox>\n {showSupportingText ? (\n <BaseBox marginLeft={helpTextLeftSpacing}>\n <SelectorSupportText size={_size} id={ids?.helpTextId}>\n {helpText}\n </SelectorSupportText>\n </BaseBox>\n ) : null}\n </BaseBox>\n </SelectorLabel>\n <FormHint\n size={formHintSize[_size]}\n errorText={errorText}\n errorTextId={ids?.errorTextId}\n type={validationState === 'error' ? 'error' : 'help'}\n />\n </BaseBox>\n );\n};\n\nconst Checkbox = assignWithoutSideEffects(React.forwardRef(_Checkbox), {\n displayName: 'Checkbox',\n});\n\nexport type { CheckboxProps };\nexport { Checkbox };\n"],"names":["_Checkbox","_ref","ref","_groupProps$state","_groupProps$size","defaultChecked","validationState","isChecked","isDisabled","isIndeterminate","isRequired","name","onChange","value","children","helpText","errorText","_ref$size","size","tabIndex","testID","_motionMeta","rest","_objectWithoutProperties","_excluded","groupProps","useCheckboxGroupContext","hasValidationState","isUndefined","hasName","hasDefaultChecked","hasIsChecked","hasOnChange","__DEV__","isEmpty","props","undefined","filter","Boolean","join","throwBladeError","message","moduleName","Error","_validationState","_hasError","_isDisabled","_isRequired","necessityIndicator","_name","_isChecked","state","_size","_useTheme","useTheme","theme","formHintSize","small","medium","large","showSupportingText","handleChange","_ref2","event","_groupProps$state2","addValue","_groupProps$state3","removeValue","_useCheckbox","useCheckbox","hasError","hasHelperText","ids","inputProps","helpTextLeftSpacing","makeSize","checkboxSizes","icon","width","spacing","_jsxs","BaseBox","Object","assign","getOuterMotionRef","metaAttribute","MetaConstants","Checkbox","getStyledProps","_jsx","SelectorLabel","componentName","CheckboxLabel","isReactNative","style","cursor","display","flexDirection","SelectorInput","hoverTokens","checkboxHoverTokens","getInnerMotionRef","makeAnalyticsAttribute","CheckboxIcon","isNegative","SelectorTitle","marginLeft","SelectorSupportText","id","helpTextId","FormHint","errorTextId","type","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,gBAAA,CAAA,iBAAA,CAAA,WAAA,CAAA,YAAA,CAAA,iBAAA,CAAA,YAAA,CAAA,MAAA,CAAA,UAAA,CAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,WAAA,CAAA,MAAA,CAAA,UAAA,CAAA,QAAA,CAAA,aAAA,CAAA,CAqHA,IAAMA,SAAyE,CAAG,SAA5EA,SAAyEA,CAAAC,IAAA,CAoB7EC,GAAG,CACA,CAAAC,IAAAA,iBAAA,CAAAC,gBAAA,CAAA,IAnBDC,cAAc,CAAAJ,IAAA,CAAdI,cAAc,CACdC,eAAe,CAAAL,IAAA,CAAfK,eAAe,CACfC,SAAS,CAAAN,IAAA,CAATM,SAAS,CACTC,UAAU,CAAAP,IAAA,CAAVO,UAAU,CACVC,eAAe,CAAAR,IAAA,CAAfQ,eAAe,CACfC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACVC,IAAI,CAAAV,IAAA,CAAJU,IAAI,CACJC,QAAQ,CAAAX,IAAA,CAARW,QAAQ,CACRC,KAAK,CAAAZ,IAAA,CAALY,KAAK,CACLC,QAAQ,CAAAb,IAAA,CAARa,QAAQ,CACRC,QAAQ,CAAAd,IAAA,CAARc,QAAQ,CACRC,SAAS,CAAAf,IAAA,CAATe,SAAS,CAAAC,SAAA,CAAAhB,IAAA,CACTiB,IAAI,CAAJA,IAAI,CAAAD,SAAA,GA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AC,CAEK,IAAAiF,QAAQ,CAAG0B,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACnH,SAAS,CAAC,CAAE,CACrEoH,WAAW,CAAE,UACf,CAAC;;;;"}
@@ -9,7 +9,7 @@ import '@babel/runtime/helpers/slicedToArray';
9
9
  import '../../BottomSheet/BottomSheetStack.js';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
 
12
- var StyledFade=styled(Animated.View)(function(_ref){var styles=_ref.styles;return Object.assign({},styles);});var Fade=function Fade(_ref2){var children=_ref2.children,show=_ref2.show,styles=_ref2.styles;var _useTheme=useTheme(),theme=_useTheme.theme;var fadeInEasing=theme.motion.easing.entrance.effective;var fadeOutEasing=theme.motion.easing.exit.effective;var fadeIn=new Keyframe({from:{transform:[{scale:0.6}],opacity:0,easing:fadeInEasing},to:{transform:[{scale:1}],opacity:1,easing:fadeInEasing}}).duration(theme.motion.duration.quick);var fadeOut=new Keyframe({from:{transform:[{scale:1}],opacity:1,easing:fadeOutEasing},to:{transform:[{scale:0.6}],opacity:0,easing:fadeOutEasing}}).duration(theme.motion.duration.quick);return show?jsx(StyledFade,{styles:styles,entering:fadeIn,exiting:fadeOut,children:children}):null;};
12
+ var StyledFade=styled(Animated.View)(function(_ref){var styles=_ref.styles;return Object.assign({},styles);});var Fade=function Fade(_ref2){var children=_ref2.children,show=_ref2.show,styles=_ref2.styles;var _useTheme=useTheme(),theme=_useTheme.theme;var fadeInEasing=theme.motion.easing.entrance;var fadeOutEasing=theme.motion.easing.exit;var fadeIn=new Keyframe({from:{transform:[{scale:0.6}],opacity:0,easing:fadeInEasing},to:{transform:[{scale:1}],opacity:1,easing:fadeInEasing}}).duration(theme.motion.duration.quick);var fadeOut=new Keyframe({from:{transform:[{scale:1}],opacity:1,easing:fadeOutEasing},to:{transform:[{scale:0.6}],opacity:0,easing:fadeOutEasing}}).duration(theme.motion.duration.quick);return show?jsx(StyledFade,{styles:styles,entering:fadeIn,exiting:fadeOut,children:children}):null;};
13
13
 
14
14
  export { Fade };
15
15
  //# sourceMappingURL=Fade.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Fade.native.js","sources":["../../../../../../src/components/Checkbox/CheckboxIcon/Fade.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React from 'react';\nimport type { EasingFn } from 'react-native-reanimated';\nimport Animated, { Keyframe } from 'react-native-reanimated';\nimport type { CSSObject } from 'styled-components';\nimport styled from 'styled-components/native';\nimport type { FadeProps } from './types';\nimport { useTheme } from '~components/BladeProvider';\n\nconst StyledFade = styled(Animated.View)<{ styles: CSSObject }>(({ styles }) => {\n return {\n ...styles,\n };\n});\n\nconst Fade = ({ children, show, styles }: FadeProps) => {\n const { theme } = useTheme();\n\n const fadeInEasing = (theme.motion.easing.entrance.effective as unknown) as EasingFn;\n const fadeOutEasing = (theme.motion.easing.exit.effective as unknown) as EasingFn;\n const fadeIn = new Keyframe({\n from: {\n transform: [{ scale: 0.6 }],\n opacity: 0,\n easing: fadeInEasing,\n },\n to: {\n transform: [{ scale: 1 }],\n opacity: 1,\n easing: fadeInEasing,\n },\n }).duration(theme.motion.duration.quick);\n\n const fadeOut = new Keyframe({\n from: {\n transform: [{ scale: 1 }],\n opacity: 1,\n easing: fadeOutEasing,\n },\n to: {\n transform: [{ scale: 0.6 }],\n opacity: 0,\n easing: fadeOutEasing,\n },\n }).duration(theme.motion.duration.quick);\n\n return show ? (\n <StyledFade styles={styles as CSSObject} entering={fadeIn} exiting={fadeOut}>\n {children}\n </StyledFade>\n ) : null;\n};\n\nexport { Fade };\n"],"names":["StyledFade","styled","Animated","View","_ref","styles","Object","assign","Fade","_ref2","children","show","_useTheme","useTheme","theme","fadeInEasing","motion","easing","entrance","effective","fadeOutEasing","exit","fadeIn","Keyframe","from","transform","scale","opacity","to","duration","quick","fadeOut","_jsx","entering","exiting"],"mappings":";;;;;;;;;;;AAUA,IAAMA,UAAU,CAAG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CAAC,CAAEC,KAAK,CAAE,GAAI,CAAC,CAAC,CAC3BC,OAAO,CAAE,CAAC,CACVV,MAAM,CAAEG,aACV,CACF,CAAC,CAAC,CAACS,QAAQ,CAACf,KAAK,CAACE,MAAM,CAACa,QAAQ,CAACC,KAAK,CAAC,CAExC,OAAOnB,IAAI,CACTqB,GAAA,CAAChC,UAAU,CAACK,CAAAA,MAAM,CAAEA,MAAoB,CAAC4B,QAAQ,CAAEX,MAAO,CAACY,OAAO,CAAEH,OAAQ,CAAArB,QAAA,CACzEA,QAAQ,CACC,CAAC,CACX,IAAI,CACV;;;;"}
1
+ {"version":3,"file":"Fade.native.js","sources":["../../../../../../src/components/Checkbox/CheckboxIcon/Fade.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React from 'react';\nimport type { EasingFn } from 'react-native-reanimated';\nimport Animated, { Keyframe } from 'react-native-reanimated';\nimport type { CSSObject } from 'styled-components';\nimport styled from 'styled-components/native';\nimport type { FadeProps } from './types';\nimport { useTheme } from '~components/BladeProvider';\n\nconst StyledFade = styled(Animated.View)<{ styles: CSSObject }>(({ styles }) => {\n return {\n ...styles,\n };\n});\n\nconst Fade = ({ children, show, styles }: FadeProps) => {\n const { theme } = useTheme();\n\n const fadeInEasing = (theme.motion.easing.entrance as unknown) as EasingFn;\n const fadeOutEasing = (theme.motion.easing.exit as unknown) as EasingFn;\n const fadeIn = new Keyframe({\n from: {\n transform: [{ scale: 0.6 }],\n opacity: 0,\n easing: fadeInEasing,\n },\n to: {\n transform: [{ scale: 1 }],\n opacity: 1,\n easing: fadeInEasing,\n },\n }).duration(theme.motion.duration.quick);\n\n const fadeOut = new Keyframe({\n from: {\n transform: [{ scale: 1 }],\n opacity: 1,\n easing: fadeOutEasing,\n },\n to: {\n transform: [{ scale: 0.6 }],\n opacity: 0,\n easing: fadeOutEasing,\n },\n }).duration(theme.motion.duration.quick);\n\n return show ? (\n <StyledFade styles={styles as CSSObject} entering={fadeIn} exiting={fadeOut}>\n {children}\n </StyledFade>\n ) : null;\n};\n\nexport { Fade };\n"],"names":["StyledFade","styled","Animated","View","_ref","styles","Object","assign","Fade","_ref2","children","show","_useTheme","useTheme","theme","fadeInEasing","motion","easing","entrance","fadeOutEasing","exit","fadeIn","Keyframe","from","transform","scale","opacity","to","duration","quick","fadeOut","_jsx","entering","exiting"],"mappings":";;;;;;;;;;;AAUA,IAAMA,UAAU,CAAGC,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAAwB,SAAAC,IAAA,CAAgB,CAAb,IAAAC,MAAM,CAAAD,IAAA,CAANC,MAAM,CACvE,OAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CACKF,MAAM,CAAA,CAEb,CAAC,CAAC,CAEI,IAAAG,IAAI,CAAG,SAAPA,IAAIA,CAAAC,KAAA,CAA8C,CAAxC,IAAAC,QAAQ,CAAAD,KAAA,CAARC,QAAQ,CAAEC,IAAI,CAAAF,KAAA,CAAJE,IAAI,CAAEN,MAAM,CAAAI,KAAA,CAANJ,MAAM,CACpC,IAAAO,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CAEb,IAAMC,YAAY,CAAID,KAAK,CAACE,MAAM,CAACC,MAAM,CAACC,QAAgC,CAC1E,IAAMC,aAAa,CAAIL,KAAK,CAACE,MAAM,CAACC,MAAM,CAACG,IAA4B,CACvE,IAAMC,MAAM,CAAG,IAAIC,QAAQ,CAAC,CAC1BC,IAAI,CAAE,CACJC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAE,GAAI,CAAC,CAAC,CAC3BC,OAAO,CAAE,CAAC,CACVT,MAAM,CAAEF,YACV,CAAC,CACDY,EAAE,CAAE,CACFH,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAE,CAAE,CAAC,CAAC,CACzBC,OAAO,CAAE,CAAC,CACVT,MAAM,CAAEF,YACV,CACF,CAAC,CAAC,CAACa,QAAQ,CAACd,KAAK,CAACE,MAAM,CAACY,QAAQ,CAACC,KAAK,CAAC,CAExC,IAAMC,OAAO,CAAG,IAAIR,QAAQ,CAAC,CAC3BC,IAAI,CAAE,CACJC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAE,CAAE,CAAC,CAAC,CACzBC,OAAO,CAAE,CAAC,CACVT,MAAM,CAAEE,aACV,CAAC,CACDQ,EAAE,CAAE,CACFH,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAE,GAAI,CAAC,CAAC,CAC3BC,OAAO,CAAE,CAAC,CACVT,MAAM,CAAEE,aACV,CACF,CAAC,CAAC,CAACS,QAAQ,CAACd,KAAK,CAACE,MAAM,CAACY,QAAQ,CAACC,KAAK,CAAC,CAExC,OAAOlB,IAAI,CACToB,GAAA,CAAC/B,UAAU,CAACK,CAAAA,MAAM,CAAEA,MAAoB,CAAC2B,QAAQ,CAAEX,MAAO,CAACY,OAAO,CAAEH,OAAQ,CAAApB,QAAA,CACzEA,QAAQ,CACC,CAAC,CACX,IAAI,CACV;;;;"}
@@ -23,17 +23,19 @@ import { SelectorInput } from '../Form/Selector/SelectorInput.native.js';
23
23
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
24
24
  import { useCheckbox } from '../Checkbox/useCheckbox.js';
25
25
  import { useRadio } from '../Radio/useRadio.js';
26
- import '../Typography/BaseText/BaseText.native.js';
27
- import { jsx, jsxs } from 'react/jsx-runtime';
26
+ import '../Typography/Heading/Heading.js';
28
27
  import { Text } from '../Typography/Text/Text.js';
29
28
  import '../Typography/Code/Code.js';
29
+ import '../Typography/Display/Display.js';
30
30
  import 'styled-components/native';
31
31
  import '@gorhom/portal';
32
32
  import 'react-native-gesture-handler';
33
33
  import '../BottomSheet/BottomSheetStack.js';
34
+ import { jsx, jsxs } from 'react/jsx-runtime';
35
+ import { getOuterMotionRef, getInnerMotionRef } from '../../utils/getMotionRefs.js';
34
36
  import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
35
37
 
36
- var _excluded=["isDisabled","value","children","icon","color","testID"];var _Chip=function _Chip(_ref,ref){var _groupProps$state,_groupProps$defaultVa,_ref2;var isDisabled=_ref.isDisabled,value=_ref.value,children=_ref.children,Icon=_ref.icon,color=_ref.color,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var groupProps=useChipGroupContext();var isInsideGroup=!isEmpty(groupProps);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPressed=_React$useState2[0],setIsPressed=_React$useState2[1];if(__DEV__){if(!isInsideGroup){throwBladeError({moduleName:'Chip',message:'<Chip /> component should only be used within the context of a <ChipGroup /> component'});}}var hasError=(groupProps==null?void 0:groupProps.validationState)==='error';var _isDisabled=isDisabled!=null?isDisabled:groupProps==null?void 0:groupProps.isDisabled;var _isRequired=(groupProps==null?void 0:groupProps.isRequired)||(groupProps==null?void 0:groupProps.necessityIndicator)==='required';var _name=groupProps==null?void 0:groupProps.name;var _isChecked=groupProps==null?void 0:(_groupProps$state=groupProps.state)==null?void 0:_groupProps$state.isChecked(value);var defaultChecked=typeof(groupProps==null?void 0:groupProps.defaultValue)==='undefined'?undefined:groupProps==null?void 0:(_groupProps$defaultVa=groupProps.defaultValue)==null?void 0:_groupProps$defaultVa.includes(value);var useChip=(groupProps==null?void 0:groupProps.selectionType)==='single'?useRadio:useCheckbox;var _size=(groupProps==null?void 0:groupProps.size)||'small';var chipColor=(_ref2=color!=null?color:groupProps==null?void 0:groupProps.color)!=null?_ref2:'primary';var handleChange=function handleChange(_ref3){var isChecked=_ref3.isChecked,value=_ref3.value;if(isChecked){var _groupProps$state2;groupProps==null?void 0:(_groupProps$state2=groupProps.state)==null?void 0:_groupProps$state2.addValue(value);}else {var _groupProps$state3;groupProps==null?void 0:(_groupProps$state3=groupProps.state)==null?void 0:_groupProps$state3.removeValue(value);}};var _useChip=useChip({defaultChecked:defaultChecked,isChecked:_isChecked,isDisabled:_isDisabled,isRequired:_isRequired,hasError:hasError,name:_name,value:value,onChange:handleChange}),state=_useChip.state,inputProps=_useChip.inputProps;var handlePointerPressedIn=React__default.useCallback(function(){if(_isDisabled)return;setIsPressed(true);},[_isDisabled]);var handlePointerPressedOut=React__default.useCallback(function(){if(_isDisabled)return;setIsPressed(false);},[_isDisabled]);var handleKeyboardPressedIn=React__default.useCallback(function(e){if(_isDisabled)return;if(e.key===' '){setIsPressed(true);}},[_isDisabled]);var handleKeyboardPressedOut=React__default.useCallback(function(e){if(_isDisabled)return;if(e.key===' '){setIsPressed(false);}},[_isDisabled]);var textVariant='unchecked';if(_isChecked&&chipColor){textVariant=chipColor;}if(_isDisabled){textVariant='disabled';}var chipTextColor=chipColorTokens.text[textVariant];var chipIconColor=chipColorTokens.icon[textVariant];var colorVariant='unchecked';var stateVariant=_isDisabled?'disabled':'default';if(_isChecked&&chipColor){colorVariant=chipColor;}var chipBackgroundColor=chipColorTokens.background[colorVariant][stateVariant];var chipBorderColor=chipColorTokens.border[colorVariant][stateVariant];return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Chip,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{display:isReactNative()?'flex':'inline-flex',children:jsx(SelectorLabel,{componentName:MetaConstants.ChipLabel,onTouchStart:handlePointerPressedIn,onTouchEnd:handlePointerPressedOut,onMouseDown:handlePointerPressedIn,onMouseUp:handlePointerPressedOut,onMouseOut:handlePointerPressedOut,onKeyDown:handleKeyboardPressedIn,onKeyUp:handleKeyboardPressedOut,inputProps:isReactNative()?inputProps:{},style:{cursor:_isDisabled?'not-allowed':'pointer'},children:jsx(BaseBox,{display:"flex",flexDirection:"column",children:jsxs(BaseBox,{display:"flex",alignItems:"center",flexDirection:"row",children:[jsx(SelectorInput,{hoverTokens:getChipInputHoverTokens(chipColor),isChecked:state.isChecked,isDisabled:_isDisabled,inputProps:inputProps,hasError:hasError,ref:ref}),jsx(AnimatedChip,{borderColor:chipBorderColor,isDisabled:_isDisabled,isPressed:isPressed,isDesktop:matchedDeviceType==='desktop',children:jsxs(StyledChipWrapper,{borderColor:chipBorderColor,isChecked:_isChecked,isDisabled:_isDisabled,color:chipColor,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",backgroundColor:chipBackgroundColor,borderRadius:"max",borderWidth:['xsmall','small'].includes(_size)?'thinner':'thin',paddingLeft:chipHorizontalPaddingTokens[Boolean(Icon)?'withIcon':'withoutIcon'].left[_size],paddingRight:chipHorizontalPaddingTokens[Boolean(Icon)?'withIcon':'withoutIcon'].right[_size],height:makeSize(chipHeightTokens[_size]),children:[Icon?jsx(BaseBox,{paddingRight:"spacing.3",display:"flex",children:jsx(Icon,{color:chipIconColor,size:chipIconSizes[_size]})}):null,jsx(Text,Object.assign({},chipTextSizes[_size],{truncateAfterLines:1,color:chipTextColor,children:children}))]})})]})})})}));};var Chip=assignWithoutSideEffects(React__default.forwardRef(_Chip),{displayName:'Chip'});
38
+ var _excluded=["isDisabled","value","children","icon","color","testID","_motionMeta"];var _Chip=function _Chip(_ref,ref){var _groupProps$state,_groupProps$defaultVa,_ref2;var isDisabled=_ref.isDisabled,value=_ref.value,children=_ref.children,Icon=_ref.icon,color=_ref.color,testID=_ref.testID,_motionMeta=_ref._motionMeta,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var groupProps=useChipGroupContext();var isInsideGroup=!isEmpty(groupProps);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPressed=_React$useState2[0],setIsPressed=_React$useState2[1];if(__DEV__){if(!isInsideGroup){throwBladeError({moduleName:'Chip',message:'<Chip /> component should only be used within the context of a <ChipGroup /> component'});}}var hasError=(groupProps==null?void 0:groupProps.validationState)==='error';var _isDisabled=isDisabled!=null?isDisabled:groupProps==null?void 0:groupProps.isDisabled;var _isRequired=(groupProps==null?void 0:groupProps.isRequired)||(groupProps==null?void 0:groupProps.necessityIndicator)==='required';var _name=groupProps==null?void 0:groupProps.name;var _isChecked=groupProps==null?void 0:(_groupProps$state=groupProps.state)==null?void 0:_groupProps$state.isChecked(value);var defaultChecked=typeof(groupProps==null?void 0:groupProps.defaultValue)==='undefined'?undefined:groupProps==null?void 0:(_groupProps$defaultVa=groupProps.defaultValue)==null?void 0:_groupProps$defaultVa.includes(value);var useChip=(groupProps==null?void 0:groupProps.selectionType)==='single'?useRadio:useCheckbox;var _size=(groupProps==null?void 0:groupProps.size)||'small';var chipColor=(_ref2=color!=null?color:groupProps==null?void 0:groupProps.color)!=null?_ref2:'primary';var handleChange=function handleChange(_ref3){var isChecked=_ref3.isChecked,value=_ref3.value;if(isChecked){var _groupProps$state2;groupProps==null?void 0:(_groupProps$state2=groupProps.state)==null?void 0:_groupProps$state2.addValue(value);}else {var _groupProps$state3;groupProps==null?void 0:(_groupProps$state3=groupProps.state)==null?void 0:_groupProps$state3.removeValue(value);}};var _useChip=useChip({defaultChecked:defaultChecked,isChecked:_isChecked,isDisabled:_isDisabled,isRequired:_isRequired,hasError:hasError,name:_name,value:value,onChange:handleChange}),state=_useChip.state,inputProps=_useChip.inputProps;var handlePointerPressedIn=React__default.useCallback(function(){if(_isDisabled)return;setIsPressed(true);},[_isDisabled]);var handlePointerPressedOut=React__default.useCallback(function(){if(_isDisabled)return;setIsPressed(false);},[_isDisabled]);var handleKeyboardPressedIn=React__default.useCallback(function(e){if(_isDisabled)return;if(e.key===' '){setIsPressed(true);}},[_isDisabled]);var handleKeyboardPressedOut=React__default.useCallback(function(e){if(_isDisabled)return;if(e.key===' '){setIsPressed(false);}},[_isDisabled]);var textVariant='unchecked';if(_isChecked&&chipColor){textVariant=chipColor;}if(_isDisabled){textVariant='disabled';}var chipTextColor=chipColorTokens.text[textVariant];var chipIconColor=chipColorTokens.icon[textVariant];var colorVariant='unchecked';var stateVariant=_isDisabled?'disabled':'default';if(_isChecked&&chipColor){colorVariant=chipColor;}var chipBackgroundColor=chipColorTokens.background[colorVariant][stateVariant];var chipBorderColor=chipColorTokens.border[colorVariant][stateVariant];return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Chip,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{display:isReactNative()?'flex':'inline-flex',ref:getOuterMotionRef({_motionMeta:_motionMeta,ref:ref}),children:jsx(SelectorLabel,{componentName:MetaConstants.ChipLabel,onTouchStart:handlePointerPressedIn,onTouchEnd:handlePointerPressedOut,onMouseDown:handlePointerPressedIn,onMouseUp:handlePointerPressedOut,onMouseOut:handlePointerPressedOut,onKeyDown:handleKeyboardPressedIn,onKeyUp:handleKeyboardPressedOut,inputProps:isReactNative()?inputProps:{},style:{cursor:_isDisabled?'not-allowed':'pointer'},children:jsx(BaseBox,{display:"flex",flexDirection:"column",children:jsxs(BaseBox,{display:"flex",alignItems:"center",flexDirection:"row",children:[jsx(SelectorInput,{hoverTokens:getChipInputHoverTokens(chipColor),isChecked:state.isChecked,isDisabled:_isDisabled,inputProps:inputProps,hasError:hasError,ref:getInnerMotionRef({_motionMeta:_motionMeta,ref:ref})}),jsx(AnimatedChip,{borderColor:chipBorderColor,isDisabled:_isDisabled,isPressed:isPressed,isDesktop:matchedDeviceType==='desktop',children:jsxs(StyledChipWrapper,{borderColor:chipBorderColor,isChecked:_isChecked,isDisabled:_isDisabled,color:chipColor,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",backgroundColor:chipBackgroundColor,borderRadius:"max",borderWidth:['xsmall','small'].includes(_size)?'thinner':'thin',paddingLeft:chipHorizontalPaddingTokens[Boolean(Icon)?'withIcon':'withoutIcon'].left[_size],paddingRight:chipHorizontalPaddingTokens[Boolean(Icon)?'withIcon':'withoutIcon'].right[_size],height:makeSize(chipHeightTokens[_size]),children:[Icon?jsx(BaseBox,{paddingRight:"spacing.3",display:"flex",children:jsx(Icon,{color:chipIconColor,size:chipIconSizes[_size]})}):null,jsx(Text,Object.assign({},chipTextSizes[_size],{truncateAfterLines:1,color:chipTextColor,children:children}))]})})]})})})}));};var Chip=assignWithoutSideEffects(React__default.forwardRef(_Chip),{displayName:'Chip'});
37
39
 
38
40
  export { Chip };
39
41
  //# sourceMappingURL=Chip.js.map