@coinbase/cds-common 0.0.0 → 8.13.2

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 (695) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +3 -0
  3. package/dts/accordion/AccordionProvider.d.ts +30 -0
  4. package/dts/accordion/AccordionProvider.d.ts.map +1 -0
  5. package/dts/animation/accordion.d.ts +4 -0
  6. package/dts/animation/accordion.d.ts.map +1 -0
  7. package/dts/animation/border.d.ts +10 -0
  8. package/dts/animation/border.d.ts.map +1 -0
  9. package/dts/animation/carousel.d.ts +8 -0
  10. package/dts/animation/carousel.d.ts.map +1 -0
  11. package/dts/animation/collapsible.d.ts +15 -0
  12. package/dts/animation/collapsible.d.ts.map +1 -0
  13. package/dts/animation/dot.d.ts +6 -0
  14. package/dts/animation/dot.d.ts.map +1 -0
  15. package/dts/animation/drawer.d.ts +20 -0
  16. package/dts/animation/drawer.d.ts.map +1 -0
  17. package/dts/animation/dropdown.d.ts +27 -0
  18. package/dts/animation/dropdown.d.ts.map +1 -0
  19. package/dts/animation/fullscreenModal.d.ts +12 -0
  20. package/dts/animation/fullscreenModal.d.ts.map +1 -0
  21. package/dts/animation/likeButton.d.ts +6 -0
  22. package/dts/animation/likeButton.d.ts.map +1 -0
  23. package/dts/animation/menu.d.ts +29 -0
  24. package/dts/animation/menu.d.ts.map +1 -0
  25. package/dts/animation/modal.d.ts +10 -0
  26. package/dts/animation/modal.d.ts.map +1 -0
  27. package/dts/animation/overlay.d.ts +6 -0
  28. package/dts/animation/overlay.d.ts.map +1 -0
  29. package/dts/animation/paddle.d.ts +7 -0
  30. package/dts/animation/paddle.d.ts.map +1 -0
  31. package/dts/animation/progress.d.ts +3 -0
  32. package/dts/animation/progress.d.ts.map +1 -0
  33. package/dts/animation/rotate.d.ts +3 -0
  34. package/dts/animation/rotate.d.ts.map +1 -0
  35. package/dts/animation/select.d.ts +4 -0
  36. package/dts/animation/select.d.ts.map +1 -0
  37. package/dts/animation/sparkline.d.ts +7 -0
  38. package/dts/animation/sparkline.d.ts.map +1 -0
  39. package/dts/animation/tabs.d.ts +5 -0
  40. package/dts/animation/tabs.d.ts.map +1 -0
  41. package/dts/animation/toast.d.ts +12 -0
  42. package/dts/animation/toast.d.ts.map +1 -0
  43. package/dts/animation/tooltip.d.ts +21 -0
  44. package/dts/animation/tooltip.d.ts.map +1 -0
  45. package/dts/cards/getCardBodySpacingProps.d.ts +17 -0
  46. package/dts/cards/getCardBodySpacingProps.d.ts.map +1 -0
  47. package/dts/color/blendColors.d.ts +24 -0
  48. package/dts/color/blendColors.d.ts.map +1 -0
  49. package/dts/color/colorToHex.d.ts +7 -0
  50. package/dts/color/colorToHex.d.ts.map +1 -0
  51. package/dts/color/darkenColor.d.ts +2 -0
  52. package/dts/color/darkenColor.d.ts.map +1 -0
  53. package/dts/color/getAccessibleForegroundGradient.d.ts +18 -0
  54. package/dts/color/getAccessibleForegroundGradient.d.ts.map +1 -0
  55. package/dts/color/getBlendedColor.d.ts +121 -0
  56. package/dts/color/getBlendedColor.d.ts.map +1 -0
  57. package/dts/color/getContrastRatio.d.ts +6 -0
  58. package/dts/color/getContrastRatio.d.ts.map +1 -0
  59. package/dts/color/getLuminance.d.ts +13 -0
  60. package/dts/color/getLuminance.d.ts.map +1 -0
  61. package/dts/color/isAccessibleColor.d.ts +23 -0
  62. package/dts/color/isAccessibleColor.d.ts.map +1 -0
  63. package/dts/color/isLightOrDarkColor.d.ts +2 -0
  64. package/dts/color/isLightOrDarkColor.d.ts.map +1 -0
  65. package/dts/color/overrideAlpha.d.ts +8 -0
  66. package/dts/color/overrideAlpha.d.ts.map +1 -0
  67. package/dts/core/theme.d.ts +285 -0
  68. package/dts/core/theme.d.ts.map +1 -0
  69. package/dts/dates/DateInputValidationError.d.ts +6 -0
  70. package/dts/dates/DateInputValidationError.d.ts.map +1 -0
  71. package/dts/dates/IntlDateFormat.d.ts +42 -0
  72. package/dts/dates/IntlDateFormat.d.ts.map +1 -0
  73. package/dts/dates/generateCalendarMonth.d.ts +5 -0
  74. package/dts/dates/generateCalendarMonth.d.ts.map +1 -0
  75. package/dts/dates/getISOStringLocal.d.ts +5 -0
  76. package/dts/dates/getISOStringLocal.d.ts.map +1 -0
  77. package/dts/dates/getMidnightDate.d.ts +5 -0
  78. package/dts/dates/getMidnightDate.d.ts.map +1 -0
  79. package/dts/dates/getTimesFromDatesAndRanges.d.ts +7 -0
  80. package/dts/dates/getTimesFromDatesAndRanges.d.ts.map +1 -0
  81. package/dts/dates/useDateInput.d.ts +39 -0
  82. package/dts/dates/useDateInput.d.ts.map +1 -0
  83. package/dts/dates/useDateInputValidation.d.ts +55 -0
  84. package/dts/dates/useDateInputValidation.d.ts.map +1 -0
  85. package/dts/hooks/useEventHandler.d.ts +12 -0
  86. package/dts/hooks/useEventHandler.d.ts.map +1 -0
  87. package/dts/hooks/useFallbackShape.d.ts +14 -0
  88. package/dts/hooks/useFallbackShape.d.ts.map +1 -0
  89. package/dts/hooks/useGroupToggler.d.ts +26 -0
  90. package/dts/hooks/useGroupToggler.d.ts.map +1 -0
  91. package/dts/hooks/useHasMounted.d.ts +2 -0
  92. package/dts/hooks/useHasMounted.d.ts.map +1 -0
  93. package/dts/hooks/useIndexCounter.d.ts +25 -0
  94. package/dts/hooks/useIndexCounter.d.ts.map +1 -0
  95. package/dts/hooks/useInputVariant.d.ts +3 -0
  96. package/dts/hooks/useInputVariant.d.ts.map +1 -0
  97. package/dts/hooks/useLogo.d.ts +26 -0
  98. package/dts/hooks/useLogo.d.ts.map +1 -0
  99. package/dts/hooks/useMergeRefs.d.ts +4 -0
  100. package/dts/hooks/useMergeRefs.d.ts.map +1 -0
  101. package/dts/hooks/usePrefixedId.d.ts +18 -0
  102. package/dts/hooks/usePrefixedId.d.ts.map +1 -0
  103. package/dts/hooks/usePreviousValue.d.ts +2 -0
  104. package/dts/hooks/usePreviousValue.d.ts.map +1 -0
  105. package/dts/hooks/usePreviousValues.d.ts +5 -0
  106. package/dts/hooks/usePreviousValues.d.ts.map +1 -0
  107. package/dts/hooks/useRefMap.d.ts +15 -0
  108. package/dts/hooks/useRefMap.d.ts.map +1 -0
  109. package/dts/hooks/useSort.d.ts +19 -0
  110. package/dts/hooks/useSort.d.ts.map +1 -0
  111. package/dts/hooks/useSubBrandLogo.d.ts +70 -0
  112. package/dts/hooks/useSubBrandLogo.d.ts.map +1 -0
  113. package/dts/hooks/useTimer.d.ts +7 -0
  114. package/dts/hooks/useTimer.d.ts.map +1 -0
  115. package/dts/hooks/useToggler.d.ts +10 -0
  116. package/dts/hooks/useToggler.d.ts.map +1 -0
  117. package/dts/hooks/useValueChanges.d.ts +8 -0
  118. package/dts/hooks/useValueChanges.d.ts.map +1 -0
  119. package/dts/index.d.ts +8 -0
  120. package/dts/index.d.ts.map +1 -0
  121. package/dts/internal/data/accounts.d.ts +369 -0
  122. package/dts/internal/data/accounts.d.ts.map +1 -0
  123. package/dts/internal/data/announcementCards.d.ts +10 -0
  124. package/dts/internal/data/announcementCards.d.ts.map +1 -0
  125. package/dts/internal/data/asset.d.ts +171 -0
  126. package/dts/internal/data/asset.d.ts.map +1 -0
  127. package/dts/internal/data/assets.d.ts +81 -0
  128. package/dts/internal/data/assets.d.ts.map +1 -0
  129. package/dts/internal/data/avatars.d.ts +6 -0
  130. package/dts/internal/data/avatars.d.ts.map +1 -0
  131. package/dts/internal/data/dataCards.d.ts +27 -0
  132. package/dts/internal/data/dataCards.d.ts.map +1 -0
  133. package/dts/internal/data/featureEntryCards.d.ts +20 -0
  134. package/dts/internal/data/featureEntryCards.d.ts.map +1 -0
  135. package/dts/internal/data/feedImages.d.ts +2 -0
  136. package/dts/internal/data/feedImages.d.ts.map +1 -0
  137. package/dts/internal/data/iconData.d.ts +2 -0
  138. package/dts/internal/data/iconData.d.ts.map +1 -0
  139. package/dts/internal/data/loremIpsum.d.ts +3 -0
  140. package/dts/internal/data/loremIpsum.d.ts.map +1 -0
  141. package/dts/internal/data/navigation.d.ts +7 -0
  142. package/dts/internal/data/navigation.d.ts.map +1 -0
  143. package/dts/internal/data/prices.d.ts +7 -0
  144. package/dts/internal/data/prices.d.ts.map +1 -0
  145. package/dts/internal/data/product.d.ts +33 -0
  146. package/dts/internal/data/product.d.ts.map +1 -0
  147. package/dts/internal/data/tabs.d.ts +18 -0
  148. package/dts/internal/data/tabs.d.ts.map +1 -0
  149. package/dts/internal/data/users.d.ts +13 -0
  150. package/dts/internal/data/users.d.ts.map +1 -0
  151. package/dts/internal/utils/storyBuilder.d.ts +154 -0
  152. package/dts/internal/utils/storyBuilder.d.ts.map +1 -0
  153. package/dts/internal/visualizations/SparklineInteractiveData.d.ts +13 -0
  154. package/dts/internal/visualizations/SparklineInteractiveData.d.ts.map +1 -0
  155. package/dts/jest/timeTravel.d.ts +15 -0
  156. package/dts/jest/timeTravel.d.ts.map +1 -0
  157. package/dts/lottie/lottieUtils.d.ts +14 -0
  158. package/dts/lottie/lottieUtils.d.ts.map +1 -0
  159. package/dts/lottie/useStatusAnimationPoller.d.ts +35 -0
  160. package/dts/lottie/useStatusAnimationPoller.d.ts.map +1 -0
  161. package/dts/media/getAvatarFallbackColor.d.ts +9 -0
  162. package/dts/media/getAvatarFallbackColor.d.ts.map +1 -0
  163. package/dts/media/remoteImageFallbackSrc.d.ts +8 -0
  164. package/dts/media/remoteImageFallbackSrc.d.ts.map +1 -0
  165. package/dts/motion/animatedCaret.d.ts +3 -0
  166. package/dts/motion/animatedCaret.d.ts.map +1 -0
  167. package/dts/motion/checkbox.d.ts +89 -0
  168. package/dts/motion/checkbox.d.ts.map +1 -0
  169. package/dts/motion/dot.d.ts +89 -0
  170. package/dts/motion/dot.d.ts.map +1 -0
  171. package/dts/motion/hint.d.ts +52 -0
  172. package/dts/motion/hint.d.ts.map +1 -0
  173. package/dts/motion/switch.d.ts +7 -0
  174. package/dts/motion/switch.d.ts.map +1 -0
  175. package/dts/motion/tokens.d.ts +904 -0
  176. package/dts/motion/tokens.d.ts.map +1 -0
  177. package/dts/motion/utils.d.ts +33 -0
  178. package/dts/motion/utils.d.ts.map +1 -0
  179. package/dts/numbers/IntlNumberFormat.d.ts +129 -0
  180. package/dts/numbers/IntlNumberFormat.d.ts.map +1 -0
  181. package/dts/numbers/subscript.d.ts +7 -0
  182. package/dts/numbers/subscript.d.ts.map +1 -0
  183. package/dts/overlays/ModalContext.d.ts +25 -0
  184. package/dts/overlays/ModalContext.d.ts.map +1 -0
  185. package/dts/overlays/OverlayContentContext.d.ts +13 -0
  186. package/dts/overlays/OverlayContentContext.d.ts.map +1 -0
  187. package/dts/overlays/PortalContext.d.ts +8 -0
  188. package/dts/overlays/PortalContext.d.ts.map +1 -0
  189. package/dts/overlays/ToastProvider.d.ts +82 -0
  190. package/dts/overlays/ToastProvider.d.ts.map +1 -0
  191. package/dts/overlays/useAlert.d.ts +8 -0
  192. package/dts/overlays/useAlert.d.ts.map +1 -0
  193. package/dts/overlays/useModal.d.ts +8 -0
  194. package/dts/overlays/useModal.d.ts.map +1 -0
  195. package/dts/overlays/useOverlay.d.ts +6 -0
  196. package/dts/overlays/useOverlay.d.ts.map +1 -0
  197. package/dts/overlays/usePortal.d.ts +2 -0
  198. package/dts/overlays/usePortal.d.ts.map +1 -0
  199. package/dts/overlays/usePortalState.d.ts +24 -0
  200. package/dts/overlays/usePortalState.d.ts.map +1 -0
  201. package/dts/overlays/useToastQueue.d.ts +11 -0
  202. package/dts/overlays/useToastQueue.d.ts.map +1 -0
  203. package/dts/stepper/useStepper.d.ts +45 -0
  204. package/dts/stepper/useStepper.d.ts.map +1 -0
  205. package/dts/stepper/utils.d.ts +29 -0
  206. package/dts/stepper/utils.d.ts.map +1 -0
  207. package/dts/system/EventHandlerProvider.d.ts +33 -0
  208. package/dts/system/EventHandlerProvider.d.ts.map +1 -0
  209. package/dts/system/LocaleProvider.d.ts +15 -0
  210. package/dts/system/LocaleProvider.d.ts.map +1 -0
  211. package/dts/system/RefMapContext.d.ts +10 -0
  212. package/dts/system/RefMapContext.d.ts.map +1 -0
  213. package/dts/tabs/TabsContext.d.ts +5 -0
  214. package/dts/tabs/TabsContext.d.ts.map +1 -0
  215. package/dts/tabs/useTabs.d.ts +34 -0
  216. package/dts/tabs/useTabs.d.ts.map +1 -0
  217. package/dts/tokens/accordion.d.ts +7 -0
  218. package/dts/tokens/accordion.d.ts.map +1 -0
  219. package/dts/tokens/appSwitcher.d.ts +4 -0
  220. package/dts/tokens/appSwitcher.d.ts.map +1 -0
  221. package/dts/tokens/avatar.d.ts +14 -0
  222. package/dts/tokens/avatar.d.ts.map +1 -0
  223. package/dts/tokens/banner.d.ts +15 -0
  224. package/dts/tokens/banner.d.ts.map +1 -0
  225. package/dts/tokens/borderRadius.d.ts +3 -0
  226. package/dts/tokens/borderRadius.d.ts.map +1 -0
  227. package/dts/tokens/button.d.ts +65 -0
  228. package/dts/tokens/button.d.ts.map +1 -0
  229. package/dts/tokens/card.d.ts +29 -0
  230. package/dts/tokens/card.d.ts.map +1 -0
  231. package/dts/tokens/cell.d.ts +30 -0
  232. package/dts/tokens/cell.d.ts.map +1 -0
  233. package/dts/tokens/chip.d.ts +2 -0
  234. package/dts/tokens/chip.d.ts.map +1 -0
  235. package/dts/tokens/dot.d.ts +12 -0
  236. package/dts/tokens/dot.d.ts.map +1 -0
  237. package/dts/tokens/drawer.d.ts +12 -0
  238. package/dts/tokens/drawer.d.ts.map +1 -0
  239. package/dts/tokens/illustrations.d.ts +28 -0
  240. package/dts/tokens/illustrations.d.ts.map +1 -0
  241. package/dts/tokens/input.d.ts +6 -0
  242. package/dts/tokens/input.d.ts.map +1 -0
  243. package/dts/tokens/interactable.d.ts +5 -0
  244. package/dts/tokens/interactable.d.ts.map +1 -0
  245. package/dts/tokens/interactableHeight.d.ts +5 -0
  246. package/dts/tokens/interactableHeight.d.ts.map +1 -0
  247. package/dts/tokens/menu.d.ts +3 -0
  248. package/dts/tokens/menu.d.ts.map +1 -0
  249. package/dts/tokens/multiContentModule.d.ts +2 -0
  250. package/dts/tokens/multiContentModule.d.ts.map +1 -0
  251. package/dts/tokens/navigation.d.ts +2 -0
  252. package/dts/tokens/navigation.d.ts.map +1 -0
  253. package/dts/tokens/overlays.d.ts +3 -0
  254. package/dts/tokens/overlays.d.ts.map +1 -0
  255. package/dts/tokens/page.d.ts +3 -0
  256. package/dts/tokens/page.d.ts.map +1 -0
  257. package/dts/tokens/select.d.ts +7 -0
  258. package/dts/tokens/select.d.ts.map +1 -0
  259. package/dts/tokens/sidebar.d.ts +3 -0
  260. package/dts/tokens/sidebar.d.ts.map +1 -0
  261. package/dts/tokens/sizing.d.ts +3 -0
  262. package/dts/tokens/sizing.d.ts.map +1 -0
  263. package/dts/tokens/sparkline.d.ts +11 -0
  264. package/dts/tokens/sparkline.d.ts.map +1 -0
  265. package/dts/tokens/tags.d.ts +18 -0
  266. package/dts/tokens/tags.d.ts.map +1 -0
  267. package/dts/tokens/tile.d.ts +4 -0
  268. package/dts/tokens/tile.d.ts.map +1 -0
  269. package/dts/tokens/toast.d.ts +5 -0
  270. package/dts/tokens/toast.d.ts.map +1 -0
  271. package/dts/tokens/tooltip.d.ts +4 -0
  272. package/dts/tokens/tooltip.d.ts.map +1 -0
  273. package/dts/tokens/zIndex.d.ts +14 -0
  274. package/dts/tokens/zIndex.d.ts.map +1 -0
  275. package/dts/tour/TourContext.d.ts +6 -0
  276. package/dts/tour/TourContext.d.ts.map +1 -0
  277. package/dts/tour/useTour.d.ts +104 -0
  278. package/dts/tour/useTour.d.ts.map +1 -0
  279. package/dts/types/AvatarBaseProps.d.ts +6 -0
  280. package/dts/types/AvatarBaseProps.d.ts.map +1 -0
  281. package/dts/types/AvatarSize.d.ts +2 -0
  282. package/dts/types/AvatarSize.d.ts.map +1 -0
  283. package/dts/types/BannerBaseProps.d.ts +3 -0
  284. package/dts/types/BannerBaseProps.d.ts.map +1 -0
  285. package/dts/types/BoxBaseProps.d.ts +75 -0
  286. package/dts/types/BoxBaseProps.d.ts.map +1 -0
  287. package/dts/types/ButtonBaseProps.d.ts +8 -0
  288. package/dts/types/ButtonBaseProps.d.ts.map +1 -0
  289. package/dts/types/CardHeaderProps.d.ts +12 -0
  290. package/dts/types/CardHeaderProps.d.ts.map +1 -0
  291. package/dts/types/CardMediaProps.d.ts +33 -0
  292. package/dts/types/CardMediaProps.d.ts.map +1 -0
  293. package/dts/types/CardRemoteImageProps.d.ts +22 -0
  294. package/dts/types/CardRemoteImageProps.d.ts.map +1 -0
  295. package/dts/types/CdsPlatform.d.ts +2 -0
  296. package/dts/types/CdsPlatform.d.ts.map +1 -0
  297. package/dts/types/CellBaseProps.d.ts +8 -0
  298. package/dts/types/CellBaseProps.d.ts.map +1 -0
  299. package/dts/types/Chart.d.ts +29 -0
  300. package/dts/types/Chart.d.ts.map +1 -0
  301. package/dts/types/CollapsibleBaseProps.d.ts +2 -0
  302. package/dts/types/CollapsibleBaseProps.d.ts.map +1 -0
  303. package/dts/types/Color.d.ts +6 -0
  304. package/dts/types/Color.d.ts.map +1 -0
  305. package/dts/types/ComponentEventHandlerProps.d.ts +6 -0
  306. package/dts/types/ComponentEventHandlerProps.d.ts.map +1 -0
  307. package/dts/types/DimensionStyles.d.ts +24 -0
  308. package/dts/types/DimensionStyles.d.ts.map +1 -0
  309. package/dts/types/Display.d.ts +9 -0
  310. package/dts/types/Display.d.ts.map +1 -0
  311. package/dts/types/DotBaseProps.d.ts +5 -0
  312. package/dts/types/DotBaseProps.d.ts.map +1 -0
  313. package/dts/types/DotCountBaseProps.d.ts +5 -0
  314. package/dts/types/DotCountBaseProps.d.ts.map +1 -0
  315. package/dts/types/ElevationLevels.d.ts +7 -0
  316. package/dts/types/ElevationLevels.d.ts.map +1 -0
  317. package/dts/types/FallbackBaseProps.d.ts +10 -0
  318. package/dts/types/FallbackBaseProps.d.ts.map +1 -0
  319. package/dts/types/Grid.d.ts +2 -0
  320. package/dts/types/Grid.d.ts.map +1 -0
  321. package/dts/types/Helpers.d.ts +8 -0
  322. package/dts/types/Helpers.d.ts.map +1 -0
  323. package/dts/types/IconButtonBaseProps.d.ts +3 -0
  324. package/dts/types/IconButtonBaseProps.d.ts.map +1 -0
  325. package/dts/types/IconName.d.ts +3 -0
  326. package/dts/types/IconName.d.ts.map +1 -0
  327. package/dts/types/IconSize.d.ts +3 -0
  328. package/dts/types/IconSize.d.ts.map +1 -0
  329. package/dts/types/IllustrationNames.d.ts +19 -0
  330. package/dts/types/IllustrationNames.d.ts.map +1 -0
  331. package/dts/types/IllustrationProps.d.ts +27 -0
  332. package/dts/types/IllustrationProps.d.ts.map +1 -0
  333. package/dts/types/InputBaseProps.d.ts +25 -0
  334. package/dts/types/InputBaseProps.d.ts.map +1 -0
  335. package/dts/types/LottiePlayer.d.ts +12 -0
  336. package/dts/types/LottiePlayer.d.ts.map +1 -0
  337. package/dts/types/LottieSource.d.ts +30 -0
  338. package/dts/types/LottieSource.d.ts.map +1 -0
  339. package/dts/types/LottieStatusAnimationProps.d.ts +30 -0
  340. package/dts/types/LottieStatusAnimationProps.d.ts.map +1 -0
  341. package/dts/types/Motion.d.ts +71 -0
  342. package/dts/types/Motion.d.ts.map +1 -0
  343. package/dts/types/OverlayLifecycleProps.d.ts +19 -0
  344. package/dts/types/OverlayLifecycleProps.d.ts.map +1 -0
  345. package/dts/types/Palette.d.ts +5 -0
  346. package/dts/types/Palette.d.ts.map +1 -0
  347. package/dts/types/Placement.d.ts +3 -0
  348. package/dts/types/Placement.d.ts.map +1 -0
  349. package/dts/types/Position.d.ts +2 -0
  350. package/dts/types/Position.d.ts.map +1 -0
  351. package/dts/types/ProgressContainerWithButtonsProps.d.ts +8 -0
  352. package/dts/types/ProgressContainerWithButtonsProps.d.ts.map +1 -0
  353. package/dts/types/PulseBaseProps.d.ts +2 -0
  354. package/dts/types/PulseBaseProps.d.ts.map +1 -0
  355. package/dts/types/React.d.ts +3 -0
  356. package/dts/types/React.d.ts.map +1 -0
  357. package/dts/types/Rect.d.ts +8 -0
  358. package/dts/types/Rect.d.ts.map +1 -0
  359. package/dts/types/Responsive.d.ts +10 -0
  360. package/dts/types/Responsive.d.ts.map +1 -0
  361. package/dts/types/ResponsiveProps.d.ts +31 -0
  362. package/dts/types/ResponsiveProps.d.ts.map +1 -0
  363. package/dts/types/SectionHeaderProps.d.ts +20 -0
  364. package/dts/types/SectionHeaderProps.d.ts.map +1 -0
  365. package/dts/types/Shape.d.ts +3 -0
  366. package/dts/types/Shape.d.ts.map +1 -0
  367. package/dts/types/SharedAccessibilityProps.d.ts +34 -0
  368. package/dts/types/SharedAccessibilityProps.d.ts.map +1 -0
  369. package/dts/types/SharedProps.d.ts +9 -0
  370. package/dts/types/SharedProps.d.ts.map +1 -0
  371. package/dts/types/SpacingProps.d.ts +46 -0
  372. package/dts/types/SpacingProps.d.ts.map +1 -0
  373. package/dts/types/SparklineInteractiveHeaderBaseProps.d.ts +8 -0
  374. package/dts/types/SparklineInteractiveHeaderBaseProps.d.ts.map +1 -0
  375. package/dts/types/SpreadPropsSafely.d.ts +28 -0
  376. package/dts/types/SpreadPropsSafely.d.ts.map +1 -0
  377. package/dts/types/StickyFooterProps.d.ts +24 -0
  378. package/dts/types/StickyFooterProps.d.ts.map +1 -0
  379. package/dts/types/TagBaseProps.d.ts +7 -0
  380. package/dts/types/TagBaseProps.d.ts.map +1 -0
  381. package/dts/types/TextBaseProps.d.ts +10 -0
  382. package/dts/types/TextBaseProps.d.ts.map +1 -0
  383. package/dts/types/TooltipBaseProps.d.ts +2 -0
  384. package/dts/types/TooltipBaseProps.d.ts.map +1 -0
  385. package/dts/types/TypeOrNumber.d.ts +3 -0
  386. package/dts/types/TypeOrNumber.d.ts.map +1 -0
  387. package/dts/types/Visibility.d.ts +5 -0
  388. package/dts/types/Visibility.d.ts.map +1 -0
  389. package/dts/types/Weight.d.ts +2 -0
  390. package/dts/types/Weight.d.ts.map +1 -0
  391. package/dts/types/index.d.ts +57 -0
  392. package/dts/types/index.d.ts.map +1 -0
  393. package/dts/utils/cell.d.ts +6 -0
  394. package/dts/utils/cell.d.ts.map +1 -0
  395. package/dts/utils/chart.d.ts +2 -0
  396. package/dts/utils/chart.d.ts.map +1 -0
  397. package/dts/utils/circle.d.ts +4 -0
  398. package/dts/utils/circle.d.ts.map +1 -0
  399. package/dts/utils/convertDimensionToAspectRatio.d.ts +14 -0
  400. package/dts/utils/convertDimensionToAspectRatio.d.ts.map +1 -0
  401. package/dts/utils/convertDimensionToSize.d.ts +8 -0
  402. package/dts/utils/convertDimensionToSize.d.ts.map +1 -0
  403. package/dts/utils/convertSizeWithMultiplier.d.ts +12 -0
  404. package/dts/utils/convertSizeWithMultiplier.d.ts.map +1 -0
  405. package/dts/utils/debounce.d.ts +5 -0
  406. package/dts/utils/debounce.d.ts.map +1 -0
  407. package/dts/utils/delay.d.ts +5 -0
  408. package/dts/utils/delay.d.ts.map +1 -0
  409. package/dts/utils/flattenNodes.d.ts +9 -0
  410. package/dts/utils/flattenNodes.d.ts.map +1 -0
  411. package/dts/utils/formatCount.d.ts +26 -0
  412. package/dts/utils/formatCount.d.ts.map +1 -0
  413. package/dts/utils/getAccessibleColor.d.ts +33 -0
  414. package/dts/utils/getAccessibleColor.d.ts.map +1 -0
  415. package/dts/utils/getButtonSpacingProps.d.ts +19 -0
  416. package/dts/utils/getButtonSpacingProps.d.ts.map +1 -0
  417. package/dts/utils/getDefaultAspectRatioForIllustration.d.ts +11 -0
  418. package/dts/utils/getDefaultAspectRatioForIllustration.d.ts.map +1 -0
  419. package/dts/utils/getDefaultSizeObjectForIllustration.d.ts +6 -0
  420. package/dts/utils/getDefaultSizeObjectForIllustration.d.ts.map +1 -0
  421. package/dts/utils/getRectWidthVariant.d.ts +5 -0
  422. package/dts/utils/getRectWidthVariant.d.ts.map +1 -0
  423. package/dts/utils/getWidthInEm.d.ts +6 -0
  424. package/dts/utils/getWidthInEm.d.ts.map +1 -0
  425. package/dts/utils/join.d.ts +9 -0
  426. package/dts/utils/join.d.ts.map +1 -0
  427. package/dts/utils/mergeProps.d.ts +3 -0
  428. package/dts/utils/mergeProps.d.ts.map +1 -0
  429. package/dts/utils/mockUtils.d.ts +2 -0
  430. package/dts/utils/mockUtils.d.ts.map +1 -0
  431. package/dts/utils/modulate.d.ts +12 -0
  432. package/dts/utils/modulate.d.ts.map +1 -0
  433. package/dts/utils/parseDotCountMaxOverflow.d.ts +3 -0
  434. package/dts/utils/parseDotCountMaxOverflow.d.ts.map +1 -0
  435. package/dts/visualizations/getProgressCircleParams.d.ts +19 -0
  436. package/dts/visualizations/getProgressCircleParams.d.ts.map +1 -0
  437. package/dts/visualizations/getSparklineRange.d.ts +13 -0
  438. package/dts/visualizations/getSparklineRange.d.ts.map +1 -0
  439. package/dts/visualizations/getSparklineTransform.d.ts +8 -0
  440. package/dts/visualizations/getSparklineTransform.d.ts.map +1 -0
  441. package/dts/visualizations/largestTriangleThreeBucket.d.ts +16 -0
  442. package/dts/visualizations/largestTriangleThreeBucket.d.ts.map +1 -0
  443. package/dts/visualizations/useCounter.d.ts +11 -0
  444. package/dts/visualizations/useCounter.d.ts.map +1 -0
  445. package/dts/visualizations/useDateLookup.d.ts +12 -0
  446. package/dts/visualizations/useDateLookup.d.ts.map +1 -0
  447. package/dts/visualizations/useProgressSize.d.ts +3 -0
  448. package/dts/visualizations/useProgressSize.d.ts.map +1 -0
  449. package/dts/visualizations/useSparklineArea.d.ts +3 -0
  450. package/dts/visualizations/useSparklineArea.d.ts.map +1 -0
  451. package/dts/visualizations/useSparklineAreaOpacity.d.ts +2 -0
  452. package/dts/visualizations/useSparklineAreaOpacity.d.ts.map +1 -0
  453. package/dts/visualizations/useSparklineCoordinates.d.ts +28 -0
  454. package/dts/visualizations/useSparklineCoordinates.d.ts.map +1 -0
  455. package/dts/visualizations/useSparklinePath.d.ts +3 -0
  456. package/dts/visualizations/useSparklinePath.d.ts.map +1 -0
  457. package/dts/visualizations/useSparklinePathGenerator.d.ts +24 -0
  458. package/dts/visualizations/useSparklinePathGenerator.d.ts.map +1 -0
  459. package/dts/visualizations/useTimeseriesPaths.d.ts +11 -0
  460. package/dts/visualizations/useTimeseriesPaths.d.ts.map +1 -0
  461. package/dts/visualizations/useVisualizationDimensions.d.ts +20 -0
  462. package/dts/visualizations/useVisualizationDimensions.d.ts.map +1 -0
  463. package/esm/accordion/AccordionProvider.js +38 -0
  464. package/esm/animation/accordion.js +3 -0
  465. package/esm/animation/border.js +10 -0
  466. package/esm/animation/carousel.js +21 -0
  467. package/esm/animation/collapsible.js +75 -0
  468. package/esm/animation/dot.js +15 -0
  469. package/esm/animation/drawer.js +19 -0
  470. package/esm/animation/dropdown.js +31 -0
  471. package/esm/animation/fullscreenModal.js +39 -0
  472. package/esm/animation/likeButton.js +18 -0
  473. package/esm/animation/menu.js +31 -0
  474. package/esm/animation/modal.js +32 -0
  475. package/esm/animation/overlay.js +16 -0
  476. package/esm/animation/paddle.js +17 -0
  477. package/esm/animation/progress.js +4 -0
  478. package/esm/animation/rotate.js +5 -0
  479. package/esm/animation/select.js +16 -0
  480. package/esm/animation/sparkline.js +8 -0
  481. package/esm/animation/tabs.js +5 -0
  482. package/esm/animation/toast.js +36 -0
  483. package/esm/animation/tooltip.js +87 -0
  484. package/esm/cards/getCardBodySpacingProps.js +25 -0
  485. package/esm/color/blendColors.js +44 -0
  486. package/esm/color/colorToHex.js +11 -0
  487. package/esm/color/darkenColor.js +5 -0
  488. package/esm/color/getAccessibleForegroundGradient.js +32 -0
  489. package/esm/color/getBlendedColor.js +202 -0
  490. package/esm/color/getContrastRatio.js +11 -0
  491. package/esm/color/getLuminance.js +28 -0
  492. package/esm/color/isAccessibleColor.js +31 -0
  493. package/esm/color/isLightOrDarkColor.js +21 -0
  494. package/esm/color/overrideAlpha.js +15 -0
  495. package/esm/core/theme.js +26 -0
  496. package/esm/dates/DateInputValidationError.js +7 -0
  497. package/esm/dates/IntlDateFormat.js +66 -0
  498. package/esm/dates/generateCalendarMonth.js +22 -0
  499. package/esm/dates/getISOStringLocal.js +8 -0
  500. package/esm/dates/getMidnightDate.js +4 -0
  501. package/esm/dates/getTimesFromDatesAndRanges.js +16 -0
  502. package/esm/dates/useDateInput.js +105 -0
  503. package/esm/dates/useDateInputValidation.js +50 -0
  504. package/esm/hooks/useEventHandler.js +54 -0
  505. package/esm/hooks/useFallbackShape.js +29 -0
  506. package/esm/hooks/useGroupToggler.js +105 -0
  507. package/esm/hooks/useHasMounted.js +6 -0
  508. package/esm/hooks/useIndexCounter.js +47 -0
  509. package/esm/hooks/useInputVariant.js +4 -0
  510. package/esm/hooks/useLogo.js +60 -0
  511. package/esm/hooks/useMergeRefs.js +14 -0
  512. package/esm/hooks/usePrefixedId.js +25 -0
  513. package/esm/hooks/usePreviousValue.js +16 -0
  514. package/esm/hooks/usePreviousValues.js +26 -0
  515. package/esm/hooks/useRefMap.js +17 -0
  516. package/esm/hooks/useSort.js +26 -0
  517. package/esm/hooks/useSubBrandLogo.js +244 -0
  518. package/esm/hooks/useTimer.js +51 -0
  519. package/esm/hooks/useToggler.js +24 -0
  520. package/esm/hooks/useValueChanges.js +15 -0
  521. package/esm/index.js +7 -0
  522. package/esm/internal/data/accounts.js +1838 -0
  523. package/esm/internal/data/announcementCards.js +23 -0
  524. package/esm/internal/data/asset.js +6345 -0
  525. package/esm/internal/data/assets.js +82 -0
  526. package/esm/internal/data/avatars.js +2 -0
  527. package/esm/internal/data/dataCards.js +22 -0
  528. package/esm/internal/data/featureEntryCards.js +28 -0
  529. package/esm/internal/data/feedImages.js +1 -0
  530. package/esm/internal/data/iconData.js +1 -0
  531. package/esm/internal/data/loremIpsum.js +1 -0
  532. package/esm/internal/data/navigation.js +11 -0
  533. package/esm/internal/data/prices.js +7 -0
  534. package/esm/internal/data/product.js +24 -0
  535. package/esm/internal/data/tabs.js +58 -0
  536. package/esm/internal/data/users.js +9 -0
  537. package/esm/internal/utils/storyBuilder.js +102 -0
  538. package/esm/internal/visualizations/SparklineInteractiveData.js +67 -0
  539. package/esm/jest/timeTravel.js +42 -0
  540. package/esm/lottie/lottieUtils.js +20 -0
  541. package/esm/lottie/lottieUtils.test.js +44 -0
  542. package/esm/lottie/useStatusAnimationPoller.js +67 -0
  543. package/esm/media/getAvatarFallbackColor.js +50 -0
  544. package/esm/media/remoteImageFallbackSrc.js +11 -0
  545. package/esm/motion/animatedCaret.js +6 -0
  546. package/esm/motion/checkbox.js +9 -0
  547. package/esm/motion/dot.js +9 -0
  548. package/esm/motion/hint.js +19 -0
  549. package/esm/motion/switch.js +8 -0
  550. package/esm/motion/tokens.js +71 -0
  551. package/esm/motion/utils.js +17 -0
  552. package/esm/numbers/IntlNumberFormat.js +204 -0
  553. package/esm/numbers/subscript.js +53 -0
  554. package/esm/overlays/ModalContext.js +8 -0
  555. package/esm/overlays/OverlayContentContext.js +24 -0
  556. package/esm/overlays/PortalContext.js +6 -0
  557. package/esm/overlays/ToastProvider.js +51 -0
  558. package/esm/overlays/useAlert.js +8 -0
  559. package/esm/overlays/useModal.js +16 -0
  560. package/esm/overlays/useOverlay.js +28 -0
  561. package/esm/overlays/usePortal.js +10 -0
  562. package/esm/overlays/usePortalState.js +55 -0
  563. package/esm/overlays/useToastQueue.js +67 -0
  564. package/esm/stepper/useStepper.js +124 -0
  565. package/esm/stepper/utils.js +45 -0
  566. package/esm/system/EventHandlerProvider.js +24 -0
  567. package/esm/system/LocaleProvider.js +19 -0
  568. package/esm/system/RefMapContext.js +7 -0
  569. package/esm/tabs/TabsContext.js +7 -0
  570. package/esm/tabs/useTabs.js +43 -0
  571. package/esm/tokens/accordion.js +6 -0
  572. package/esm/tokens/appSwitcher.js +3 -0
  573. package/esm/tokens/avatar.js +13 -0
  574. package/esm/tokens/banner.js +39 -0
  575. package/esm/tokens/borderRadius.js +7 -0
  576. package/esm/tokens/button.js +64 -0
  577. package/esm/tokens/card.js +29 -0
  578. package/esm/tokens/cell.js +40 -0
  579. package/esm/tokens/chip.js +1 -0
  580. package/esm/tokens/dot.js +31 -0
  581. package/esm/tokens/drawer.js +11 -0
  582. package/esm/tokens/illustrations.js +28 -0
  583. package/esm/tokens/input.js +5 -0
  584. package/esm/tokens/interactable.js +4 -0
  585. package/esm/tokens/interactableHeight.js +4 -0
  586. package/esm/tokens/menu.js +2 -0
  587. package/esm/tokens/multiContentModule.js +1 -0
  588. package/esm/tokens/navigation.js +1 -0
  589. package/esm/tokens/overlays.js +1 -0
  590. package/esm/tokens/page.js +2 -0
  591. package/esm/tokens/select.js +26 -0
  592. package/esm/tokens/sidebar.js +2 -0
  593. package/esm/tokens/sizing.js +2 -0
  594. package/esm/tokens/sparkline.js +24 -0
  595. package/esm/tokens/tags.js +66 -0
  596. package/esm/tokens/tile.js +9 -0
  597. package/esm/tokens/toast.js +4 -0
  598. package/esm/tokens/tooltip.js +5 -0
  599. package/esm/tokens/zIndex.js +15 -0
  600. package/esm/tour/TourContext.js +7 -0
  601. package/esm/tour/useTour.js +84 -0
  602. package/esm/types/AvatarBaseProps.js +1 -0
  603. package/esm/types/AvatarSize.js +1 -0
  604. package/esm/types/BannerBaseProps.js +1 -0
  605. package/esm/types/BoxBaseProps.js +1 -0
  606. package/esm/types/ButtonBaseProps.js +1 -0
  607. package/esm/types/CardHeaderProps.js +1 -0
  608. package/esm/types/CardMediaProps.js +1 -0
  609. package/esm/types/CardRemoteImageProps.js +1 -0
  610. package/esm/types/CdsPlatform.js +1 -0
  611. package/esm/types/CellBaseProps.js +1 -0
  612. package/esm/types/Chart.js +1 -0
  613. package/esm/types/CollapsibleBaseProps.js +1 -0
  614. package/esm/types/Color.js +1 -0
  615. package/esm/types/ComponentEventHandlerProps.js +1 -0
  616. package/esm/types/DimensionStyles.js +1 -0
  617. package/esm/types/Display.js +1 -0
  618. package/esm/types/DotBaseProps.js +1 -0
  619. package/esm/types/DotCountBaseProps.js +1 -0
  620. package/esm/types/ElevationLevels.js +1 -0
  621. package/esm/types/FallbackBaseProps.js +1 -0
  622. package/esm/types/Grid.js +1 -0
  623. package/esm/types/Helpers.js +1 -0
  624. package/esm/types/IconButtonBaseProps.js +1 -0
  625. package/esm/types/IconName.js +1 -0
  626. package/esm/types/IconSize.js +1 -0
  627. package/esm/types/IllustrationNames.js +1 -0
  628. package/esm/types/IllustrationProps.js +1 -0
  629. package/esm/types/InputBaseProps.js +1 -0
  630. package/esm/types/LottiePlayer.js +1 -0
  631. package/esm/types/LottieSource.js +1 -0
  632. package/esm/types/LottieStatusAnimationProps.js +1 -0
  633. package/esm/types/Motion.js +1 -0
  634. package/esm/types/OverlayLifecycleProps.js +1 -0
  635. package/esm/types/Palette.js +1 -0
  636. package/esm/types/Placement.js +1 -0
  637. package/esm/types/Position.js +1 -0
  638. package/esm/types/ProgressContainerWithButtonsProps.js +1 -0
  639. package/esm/types/PulseBaseProps.js +1 -0
  640. package/esm/types/React.js +1 -0
  641. package/esm/types/Rect.js +6 -0
  642. package/esm/types/Responsive.js +1 -0
  643. package/esm/types/ResponsiveProps.js +1 -0
  644. package/esm/types/SectionHeaderProps.js +1 -0
  645. package/esm/types/Shape.js +1 -0
  646. package/esm/types/SharedAccessibilityProps.js +1 -0
  647. package/esm/types/SharedProps.js +1 -0
  648. package/esm/types/SpacingProps.js +1 -0
  649. package/esm/types/SparklineInteractiveHeaderBaseProps.js +1 -0
  650. package/esm/types/SpreadPropsSafely.js +1 -0
  651. package/esm/types/StickyFooterProps.js +1 -0
  652. package/esm/types/TagBaseProps.js +1 -0
  653. package/esm/types/TextBaseProps.js +1 -0
  654. package/esm/types/TooltipBaseProps.js +1 -0
  655. package/esm/types/TypeOrNumber.js +1 -0
  656. package/esm/types/Visibility.js +1 -0
  657. package/esm/types/Weight.js +1 -0
  658. package/esm/types/index.js +58 -0
  659. package/esm/utils/cell.js +5 -0
  660. package/esm/utils/chart.js +14 -0
  661. package/esm/utils/circle.js +12 -0
  662. package/esm/utils/convertDimensionToAspectRatio.js +5 -0
  663. package/esm/utils/convertDimensionToSize.js +9 -0
  664. package/esm/utils/convertSizeWithMultiplier.js +7 -0
  665. package/esm/utils/debounce.js +16 -0
  666. package/esm/utils/delay.js +6 -0
  667. package/esm/utils/flattenNodes.js +33 -0
  668. package/esm/utils/formatCount.js +43 -0
  669. package/esm/utils/getAccessibleColor.js +50 -0
  670. package/esm/utils/getButtonSpacingProps.js +24 -0
  671. package/esm/utils/getDefaultAspectRatioForIllustration.js +6 -0
  672. package/esm/utils/getDefaultSizeObjectForIllustration.js +7 -0
  673. package/esm/utils/getRectWidthVariant.js +1 -0
  674. package/esm/utils/getWidthInEm.js +13 -0
  675. package/esm/utils/join.js +11 -0
  676. package/esm/utils/mergeProps.js +25 -0
  677. package/esm/utils/mockUtils.js +1 -0
  678. package/esm/utils/modulate.js +32 -0
  679. package/esm/utils/parseDotCountMaxOverflow.js +7 -0
  680. package/esm/visualizations/getProgressCircleParams.js +18 -0
  681. package/esm/visualizations/getSparklineRange.js +13 -0
  682. package/esm/visualizations/getSparklineTransform.js +19 -0
  683. package/esm/visualizations/largestTriangleThreeBucket.js +57 -0
  684. package/esm/visualizations/useCounter.js +52 -0
  685. package/esm/visualizations/useDateLookup.js +18 -0
  686. package/esm/visualizations/useProgressSize.js +15 -0
  687. package/esm/visualizations/useSparklineArea.js +30 -0
  688. package/esm/visualizations/useSparklineAreaOpacity.js +3 -0
  689. package/esm/visualizations/useSparklineCoordinates.js +73 -0
  690. package/esm/visualizations/useSparklinePath.js +22 -0
  691. package/esm/visualizations/useSparklinePathGenerator.js +38 -0
  692. package/esm/visualizations/useTimeseriesPaths.js +41 -0
  693. package/esm/visualizations/useVisualizationDimensions.js +27 -0
  694. package/package.json +62 -6
  695. package/index.js +0 -1
@@ -0,0 +1,75 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ import { durations } from '../motion/tokens';
7
+ export const collapsibleHiddenOpacity = 0;
8
+ export const collapsibleVisibleOpacity = 1;
9
+ export const collapsibleHiddenMaxSize = 0;
10
+ // for web, mobile will be determined by content height dynamically
11
+ export const collapsibleVisibleMaxSize = 1000;
12
+ export const easing = 'global';
13
+ export const inDuration = 'slow1';
14
+ export const outDuration = 'moderate3';
15
+ export const animateInOpacityConfig = {
16
+ vertical: {
17
+ property: 'opacity',
18
+ easing,
19
+ duration: inDuration,
20
+ toValue: collapsibleVisibleOpacity,
21
+ fromValue: collapsibleHiddenOpacity,
22
+ useNativeDriver: false
23
+ },
24
+ horizontal: {
25
+ property: 'opacity',
26
+ easing: 'exitFunctional',
27
+ duration: 'fast1',
28
+ delay: durations.fast1,
29
+ toValue: collapsibleVisibleOpacity,
30
+ fromValue: collapsibleHiddenOpacity,
31
+ useNativeDriver: false
32
+ }
33
+ };
34
+ export const animateOutOpacityConfig = {
35
+ vertical: _objectSpread(_objectSpread({}, animateInOpacityConfig.vertical), {}, {
36
+ duration: outDuration,
37
+ toValue: collapsibleHiddenOpacity,
38
+ fromValue: collapsibleVisibleOpacity
39
+ }),
40
+ horizontal: _objectSpread(_objectSpread({}, animateInOpacityConfig.horizontal), {}, {
41
+ toValue: collapsibleHiddenOpacity,
42
+ fromValue: collapsibleVisibleOpacity,
43
+ delay: undefined
44
+ })
45
+ };
46
+ export const animateInMaxSizeConfig = {
47
+ vertical: {
48
+ property: 'height',
49
+ easing,
50
+ duration: inDuration,
51
+ toValue: collapsibleVisibleMaxSize,
52
+ fromValue: collapsibleHiddenMaxSize,
53
+ useNativeDriver: false
54
+ },
55
+ horizontal: {
56
+ property: 'width',
57
+ easing: 'global',
58
+ duration: 'fast1',
59
+ useNativeDriver: false,
60
+ toValue: collapsibleVisibleMaxSize,
61
+ fromValue: collapsibleHiddenMaxSize
62
+ }
63
+ };
64
+ export const animateOutMaxSizeConfig = {
65
+ vertical: _objectSpread(_objectSpread({}, animateInMaxSizeConfig.vertical), {}, {
66
+ duration: outDuration,
67
+ toValue: collapsibleHiddenMaxSize,
68
+ fromValue: collapsibleVisibleMaxSize
69
+ }),
70
+ horizontal: _objectSpread(_objectSpread({}, animateInMaxSizeConfig.horizontal), {}, {
71
+ delay: durations.fast1,
72
+ toValue: collapsibleHiddenMaxSize,
73
+ fromValue: collapsibleVisibleMaxSize
74
+ })
75
+ };
@@ -0,0 +1,15 @@
1
+ import { durations } from '../motion/tokens';
2
+ export const dotHidden = 0;
3
+ export const dotVisible = 1;
4
+ export const animateDotWidthConfig = {
5
+ property: 'width',
6
+ easing: 'global',
7
+ duration: 'fast1',
8
+ useNativeDriver: false
9
+ };
10
+ export const animateDotOpacityConfig = {
11
+ property: 'opacity',
12
+ easing: 'exitFunctional',
13
+ duration: 'fast1',
14
+ delay: durations.fast1
15
+ };
@@ -0,0 +1,19 @@
1
+ /** Upper limit for how much the drawer can be extended in length by panning */
2
+ export const MAX_OVER_DRAG = 40;
3
+ /** Dragging a Drawer by more than this percentage of the Drawer will dismiss it */
4
+ export const DISMISSAL_DRAG_THRESHOLD = 150;
5
+ /** Quick swipes will dismiss the Tray, especially useful for Trays that are very short */
6
+ export const DISMISSAL_VELOCITY_THRESHOLD = 0.8;
7
+ /** Minimum panning distance required to capture pan gesture */
8
+ export const MIN_PAN_DISTANCE = 2;
9
+ export const drawerAnimationDefaultDuration = 'moderate3';
10
+ export const animateDrawerInConfig = {
11
+ toValue: 1,
12
+ easing: 'enterFunctional',
13
+ duration: drawerAnimationDefaultDuration
14
+ };
15
+ export const animateDrawerOutConfig = {
16
+ toValue: 0,
17
+ easing: 'exitFunctional',
18
+ duration: drawerAnimationDefaultDuration
19
+ };
@@ -0,0 +1,31 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ const baseDropdownAnimations = {
7
+ easing: 'global',
8
+ duration: 'moderate3'
9
+ };
10
+ const fromTransformValue = -16;
11
+ const toTransformValue = 0;
12
+ export const animateDropdownOpacityInConfig = _objectSpread({
13
+ property: 'opacity',
14
+ fromValue: 0,
15
+ toValue: 1
16
+ }, baseDropdownAnimations);
17
+ export const animateDropdownOpacityOutConfig = _objectSpread({
18
+ property: 'opacity',
19
+ fromValue: 1,
20
+ toValue: 0
21
+ }, baseDropdownAnimations);
22
+
23
+ // property based on placement
24
+ export const animateDropdownTransformInConfig = _objectSpread({
25
+ fromValue: fromTransformValue,
26
+ toValue: toTransformValue
27
+ }, baseDropdownAnimations);
28
+ export const animateDropdownTransformOutConfig = _objectSpread({
29
+ fromValue: toTransformValue,
30
+ toValue: fromTransformValue
31
+ }, baseDropdownAnimations);
@@ -0,0 +1,39 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ export const modalHiddenOpacity = 0;
7
+ export const modalHiddenTranslateY = 80;
8
+ export const modalVisibleOpacity = 1;
9
+ export const modalVisibleTranslateY = 0;
10
+ export const animateInOpacityConfig = {
11
+ property: 'opacity',
12
+ easing: 'enterFunctional',
13
+ duration: 'moderate3',
14
+ toValue: modalVisibleOpacity
15
+ };
16
+ export const animateOutOpacityConfig = {
17
+ property: 'opacity',
18
+ easing: 'exitFunctional',
19
+ duration: 'moderate1',
20
+ toValue: modalHiddenOpacity
21
+ };
22
+ export const animateInTranslateYConfig = {
23
+ property: 'y',
24
+ easing: 'enterFunctional',
25
+ duration: 'moderate3',
26
+ toValue: modalVisibleTranslateY
27
+ };
28
+ export const animateOutTranslateYConfig = {
29
+ property: 'y',
30
+ easing: 'exitFunctional',
31
+ duration: 'moderate1',
32
+ toValue: modalHiddenTranslateY
33
+ };
34
+ export const animateInOverlayOpacityConfig = _objectSpread(_objectSpread({}, animateInOpacityConfig), {}, {
35
+ easing: 'global'
36
+ });
37
+ export const animateOutOverlayOpacityConfig = _objectSpread(_objectSpread({}, animateOutOpacityConfig), {}, {
38
+ easing: 'global'
39
+ });
@@ -0,0 +1,18 @@
1
+ export const activeScale = 1.2;
2
+ export const inactiveScale = 1;
3
+ export const scaleInConfig = {
4
+ property: 'scale',
5
+ easing: 'exitFunctional',
6
+ duration: 'fast1',
7
+ fromValue: inactiveScale,
8
+ toValue: activeScale,
9
+ useNativeDriver: true
10
+ };
11
+ export const scaleOutConfig = {
12
+ property: 'scale',
13
+ easing: 'enterFunctional',
14
+ duration: 'slow3',
15
+ fromValue: activeScale,
16
+ toValue: inactiveScale,
17
+ useNativeDriver: true
18
+ };
@@ -0,0 +1,31 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ const basePopoverMenuAnimations = {
7
+ easing: 'global',
8
+ duration: 'moderate3'
9
+ };
10
+ const yFromValue = -16;
11
+ const yToValue = 0;
12
+ export const animateMenuOpacityInConfig = _objectSpread({
13
+ property: 'opacity',
14
+ fromValue: 0,
15
+ toValue: 1
16
+ }, basePopoverMenuAnimations);
17
+ export const animateMenuOpacityOutConfig = _objectSpread({
18
+ property: 'opacity',
19
+ fromValue: 1,
20
+ toValue: 0
21
+ }, basePopoverMenuAnimations);
22
+ export const animateMenuTransformInConfig = _objectSpread({
23
+ property: 'transform',
24
+ fromValue: yFromValue,
25
+ toValue: yToValue
26
+ }, basePopoverMenuAnimations);
27
+ export const animateMenuTransformOutConfig = _objectSpread({
28
+ property: 'transform',
29
+ fromValue: yToValue,
30
+ toValue: yFromValue
31
+ }, basePopoverMenuAnimations);
@@ -0,0 +1,32 @@
1
+ export const modalHiddenOpacity = 0;
2
+ export const modalHiddenScale = 0.98;
3
+ export const modalVisibleOpacity = 1;
4
+ export const modalVisibleScale = 1;
5
+ export const animateInOpacityConfig = {
6
+ property: 'opacity',
7
+ easing: 'enterFunctional',
8
+ duration: 'fast1',
9
+ toValue: modalVisibleOpacity,
10
+ fromValue: modalHiddenOpacity
11
+ };
12
+ export const animateOutOpacityConfig = {
13
+ property: 'opacity',
14
+ easing: 'global',
15
+ duration: 'fast1',
16
+ toValue: modalHiddenOpacity,
17
+ fromValue: modalVisibleOpacity
18
+ };
19
+ export const animateInScaleConfig = {
20
+ property: 'scale',
21
+ easing: 'enterFunctional',
22
+ duration: 'moderate3',
23
+ toValue: modalVisibleScale,
24
+ fromValue: modalHiddenScale
25
+ };
26
+ export const animateOutScaleConfig = {
27
+ property: 'scale',
28
+ easing: 'global',
29
+ duration: 'fast1',
30
+ toValue: modalHiddenScale,
31
+ fromValue: modalVisibleScale
32
+ };
@@ -0,0 +1,16 @@
1
+ export const overlayHiddenOpacity = 0;
2
+ export const overlayVisibleOpacity = 1;
3
+ export const animateInOpacityConfig = {
4
+ property: 'opacity',
5
+ easing: 'enterFunctional',
6
+ duration: 'moderate1',
7
+ toValue: overlayVisibleOpacity,
8
+ fromValue: overlayHiddenOpacity
9
+ };
10
+ export const animateOutOpacityConfig = {
11
+ property: 'opacity',
12
+ easing: 'global',
13
+ duration: 'fast1',
14
+ toValue: overlayHiddenOpacity,
15
+ fromValue: overlayVisibleOpacity
16
+ };
@@ -0,0 +1,17 @@
1
+ export const paddleHidden = 0;
2
+ export const paddleVisible = 1;
3
+ export const animateGradientScaleConfig = {
4
+ property: 'scale',
5
+ easing: 'global',
6
+ duration: 'fast1'
7
+ };
8
+ export const animatePaddleOpacityConfig = {
9
+ property: 'opacity',
10
+ easing: 'enterFunctional',
11
+ duration: 'moderate1'
12
+ };
13
+ export const animatePaddleScaleConfig = {
14
+ property: 'scale',
15
+ easing: 'global',
16
+ duration: 'moderate1'
17
+ };
@@ -0,0 +1,4 @@
1
+ export const animateProgressBaseSpec = {
2
+ easing: 'global',
3
+ duration: 'slow3'
4
+ };
@@ -0,0 +1,5 @@
1
+ export const baseConfig = {
2
+ property: 'transform',
3
+ easing: 'enterFunctional',
4
+ duration: 'moderate1'
5
+ };
@@ -0,0 +1,16 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ const baseConfig = {
7
+ property: 'transform',
8
+ easing: 'enterFunctional',
9
+ duration: 'moderate1'
10
+ };
11
+ export const animateCaretInConfig = _objectSpread(_objectSpread({}, baseConfig), {}, {
12
+ toValue: 1
13
+ });
14
+ export const animateCaretOutConfig = _objectSpread(_objectSpread({}, baseConfig), {}, {
15
+ toValue: 0
16
+ });
@@ -0,0 +1,8 @@
1
+ const CHART_ANIMATED_PATH_DURATION = 450;
2
+ function easeOutQuint(x) {
3
+ return 1 - (1 - x) ** 5;
4
+ }
5
+ export const animatedPathConfig = {
6
+ easing: easeOutQuint,
7
+ duration: CHART_ANIMATED_PATH_DURATION
8
+ };
@@ -0,0 +1,5 @@
1
+ export const animateTabIndicatorBaseSpec = {
2
+ property: 'x',
3
+ easing: 'global',
4
+ duration: 'moderate1'
5
+ };
@@ -0,0 +1,36 @@
1
+ export const toastHiddenOpacity = 0;
2
+ export const toastHiddenBottom = 25;
3
+ export const toastVisibleOpacity = 1;
4
+ export const toastVisibleBottom = 0;
5
+ export const animateInOpacityConfig = {
6
+ property: 'opacity',
7
+ easing: 'enterFunctional',
8
+ duration: 'moderate3',
9
+ toValue: toastVisibleOpacity,
10
+ fromValue: toastHiddenOpacity
11
+ };
12
+ export const animateOutOpacityConfig = {
13
+ property: 'opacity',
14
+ easing: 'exitFunctional',
15
+ duration: 'moderate3',
16
+ toValue: toastHiddenOpacity,
17
+ fromValue: toastVisibleOpacity
18
+ };
19
+ export const animateInBottomConfig = {
20
+ property: 'y',
21
+ easing: 'enterFunctional',
22
+ duration: 'moderate3',
23
+ toValue: toastVisibleBottom,
24
+ fromValue: toastHiddenBottom
25
+ };
26
+ export const animateOutBottomConfig = {
27
+ property: 'y',
28
+ easing: 'exitFunctional',
29
+ duration: 'moderate3',
30
+ toValue: toastHiddenBottom,
31
+ fromValue: toastVisibleBottom
32
+ };
33
+
34
+ // pan responder configs
35
+ export const horizontalPanThreshold = 50;
36
+ export const bottomPanThreshold = 10;
@@ -0,0 +1,87 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
+ export const tooltipHiddenOpacity = 0;
7
+ export const tooltipVisibleOpacity = 1;
8
+ export const tooltipHiddenY = 16;
9
+ export const tooltipVisibleY = 0;
10
+ const baseTiming = {
11
+ duration: 'fast1',
12
+ delay: 25
13
+ };
14
+ export const animateInOpacityConfig = _objectSpread(_objectSpread({
15
+ property: 'opacity'
16
+ }, baseTiming), {}, {
17
+ easing: 'enterFunctional',
18
+ toValue: tooltipVisibleOpacity,
19
+ fromValue: tooltipHiddenOpacity
20
+ });
21
+ export const animateOutOpacityConfig = _objectSpread(_objectSpread({
22
+ property: 'opacity'
23
+ }, baseTiming), {}, {
24
+ easing: 'exitFunctional',
25
+ toValue: tooltipHiddenOpacity,
26
+ fromValue: tooltipVisibleOpacity
27
+ });
28
+
29
+ /**
30
+ * Build tooltip translation config base on placement
31
+ * @param placement Tooltip placement
32
+ * @param transitionType animation type
33
+ * @returns Motion config
34
+ */
35
+ export const getTranslateConfigByPlacement = _ref => {
36
+ let {
37
+ placement,
38
+ isExiting = false
39
+ } = _ref;
40
+ let config;
41
+ switch (placement) {
42
+ case 'top':
43
+ config = {
44
+ property: 'translateY',
45
+ fromValue: 16,
46
+ toValue: 0
47
+ };
48
+ break;
49
+ case 'bottom':
50
+ config = {
51
+ property: 'translateY',
52
+ fromValue: -16,
53
+ toValue: 0
54
+ };
55
+ break;
56
+ case 'left':
57
+ config = {
58
+ property: 'translateX',
59
+ fromValue: 16,
60
+ toValue: 0
61
+ };
62
+ break;
63
+ case 'right':
64
+ config = {
65
+ property: 'translateX',
66
+ fromValue: -16,
67
+ toValue: 0
68
+ };
69
+ break;
70
+ default:
71
+ config = {
72
+ property: 'translateY',
73
+ fromValue: 16,
74
+ toValue: 0
75
+ };
76
+ }
77
+
78
+ // swap from and to value for exit config
79
+ if (isExiting) {
80
+ const tempValue = config.fromValue;
81
+ config.fromValue = config.toValue;
82
+ config.toValue = tempValue;
83
+ }
84
+ return _objectSpread(_objectSpread(_objectSpread({}, baseTiming), config), {}, {
85
+ easing: isExiting ? 'exitFunctional' : 'enterFunctional'
86
+ });
87
+ };
@@ -0,0 +1,25 @@
1
+ export const getCardBodySpacingProps = _ref => {
2
+ var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15;
3
+ let {
4
+ padding,
5
+ paddingX,
6
+ paddingY,
7
+ paddingTop,
8
+ paddingEnd,
9
+ paddingBottom,
10
+ paddingStart,
11
+ compact
12
+ } = _ref;
13
+ if (compact) return {
14
+ paddingBottom: (_ref2 = (_ref3 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : paddingY) !== null && _ref3 !== void 0 ? _ref3 : padding) !== null && _ref2 !== void 0 ? _ref2 : 1,
15
+ paddingTop: (_ref4 = (_ref5 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : paddingY) !== null && _ref5 !== void 0 ? _ref5 : padding) !== null && _ref4 !== void 0 ? _ref4 : 2,
16
+ paddingStart: (_ref6 = (_ref7 = paddingStart !== null && paddingStart !== void 0 ? paddingStart : paddingX) !== null && _ref7 !== void 0 ? _ref7 : padding) !== null && _ref6 !== void 0 ? _ref6 : 2,
17
+ paddingEnd: (_ref8 = (_ref9 = paddingEnd !== null && paddingEnd !== void 0 ? paddingEnd : paddingX) !== null && _ref9 !== void 0 ? _ref9 : padding) !== null && _ref8 !== void 0 ? _ref8 : 2
18
+ };
19
+ return {
20
+ paddingBottom: (_ref0 = (_ref1 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : paddingY) !== null && _ref1 !== void 0 ? _ref1 : padding) !== null && _ref0 !== void 0 ? _ref0 : 3,
21
+ paddingTop: (_ref10 = (_ref11 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : paddingY) !== null && _ref11 !== void 0 ? _ref11 : padding) !== null && _ref10 !== void 0 ? _ref10 : 3,
22
+ paddingStart: (_ref12 = (_ref13 = paddingStart !== null && paddingStart !== void 0 ? paddingStart : paddingX) !== null && _ref13 !== void 0 ? _ref13 : padding) !== null && _ref12 !== void 0 ? _ref12 : 3,
23
+ paddingEnd: (_ref14 = (_ref15 = paddingEnd !== null && paddingEnd !== void 0 ? paddingEnd : paddingX) !== null && _ref15 !== void 0 ? _ref15 : padding) !== null && _ref14 !== void 0 ? _ref14 : 3
24
+ };
25
+ };
@@ -0,0 +1,44 @@
1
+ import { rgb } from 'd3-color';
2
+ export const getRGBColor = color => {
3
+ if (typeof color === 'string') {
4
+ return rgb(color);
5
+ }
6
+ if ('r' in color && 'g' in color && 'b' in color) {
7
+ return rgb(color.r, color.g, color.b, color.opacity);
8
+ }
9
+ return rgb(color);
10
+ };
11
+
12
+ /**
13
+ * The overlayColor value must have an alpha less than 1 in order to output a different color.
14
+ * @param underlayColor ColorValue
15
+ * @param overlayColor ColorValue
16
+ * @returns rbgString
17
+ */
18
+ export const blendColors = _ref => {
19
+ let {
20
+ underlayColor,
21
+ overlayColor
22
+ } = _ref;
23
+ const {
24
+ r: underlayR,
25
+ g: underlayG,
26
+ b: underlayB,
27
+ opacity: underlayOpacity
28
+ } = getRGBColor(underlayColor);
29
+ const {
30
+ r: OverlayR,
31
+ g: OverlayG,
32
+ b: OverlayB,
33
+ opacity: overlayOpacity
34
+ } = getRGBColor(overlayColor);
35
+ const mix = [];
36
+ mix[3] = 1 - (1 - overlayOpacity) * (1 - underlayOpacity); // alpha
37
+ // red
38
+ mix[0] = Math.round(OverlayR * overlayOpacity / mix[3] + underlayR * underlayOpacity * (1 - overlayOpacity) / mix[3]);
39
+ // green
40
+ mix[1] = Math.round(OverlayG * overlayOpacity / mix[3] + underlayG * underlayOpacity * (1 - overlayOpacity) / mix[3]);
41
+ // blue
42
+ mix[2] = Math.round(OverlayB * overlayOpacity / mix[3] + underlayB * underlayOpacity * (1 - overlayOpacity) / mix[3]);
43
+ return rgb(mix[0], mix[1], mix[2]);
44
+ };
@@ -0,0 +1,11 @@
1
+ import { color } from 'd3-color';
2
+
3
+ /**
4
+ * @param color - any valid color value, i.e. `rgba(255, 255, 255, 1)`
5
+ * @returns hex - `#ffffff`
6
+ * @website https://github.com/d3/d3-color#color
7
+ */
8
+ export const colorToHex = value => {
9
+ var _color$formatHex, _color;
10
+ return (_color$formatHex = (_color = color(value)) === null || _color === void 0 ? void 0 : _color.formatHex()) !== null && _color$formatHex !== void 0 ? _color$formatHex : value;
11
+ };
@@ -0,0 +1,5 @@
1
+ import { color } from 'd3-color';
2
+ export const darkenColor = value => {
3
+ const d3Color = color(value);
4
+ return d3Color === null || d3Color === void 0 ? void 0 : d3Color.darker().formatHex();
5
+ };
@@ -0,0 +1,32 @@
1
+ import { getAccessibleColor } from '../utils/getAccessibleColor';
2
+ import { darkenColor } from './darkenColor';
3
+ export const getAccessibleForegroundGradient = _ref => {
4
+ let {
5
+ background,
6
+ color,
7
+ colorScheme,
8
+ usage
9
+ } = _ref;
10
+ let color1 = color;
11
+ let color2 = color;
12
+ // Disable gradients in dark mode
13
+ if (colorScheme === 'dark' || color === 'auto') {
14
+ color1 = color !== 'auto' ? color : getAccessibleColor({
15
+ background,
16
+ foreground: 'auto',
17
+ usage
18
+ });
19
+ color2 = color1;
20
+ } else {
21
+ var _darkenColor;
22
+ color1 = color;
23
+ color2 = (_darkenColor = darkenColor(color)) !== null && _darkenColor !== void 0 ? _darkenColor : color;
24
+ }
25
+ return [{
26
+ offset: '0%',
27
+ color: color1
28
+ }, {
29
+ offset: '100%',
30
+ color: color2
31
+ }];
32
+ };