@fountain-ui/core 3.0.0-alpha.4 → 3.0.0-alpha.40

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 (494) hide show
  1. package/build/commonjs/Accordion/Accordion.js +20 -13
  2. package/build/commonjs/Accordion/Accordion.js.map +1 -1
  3. package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
  4. package/build/commonjs/Accordion/useVariantStyleMap.js +15 -8
  5. package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
  6. package/build/commonjs/AppBar/AppBar.js +1 -1
  7. package/build/commonjs/AppBar/AppBar.js.map +1 -1
  8. package/build/commonjs/Badge/Badge.js +4 -3
  9. package/build/commonjs/Badge/Badge.js.map +1 -1
  10. package/build/commonjs/Badge/BadgeProps.js.map +1 -1
  11. package/build/commonjs/Badge/useVariantStyleMap.js +2 -2
  12. package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -1
  13. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +6 -2
  14. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  15. package/build/commonjs/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
  16. package/build/commonjs/Button/Button.js +26 -12
  17. package/build/commonjs/Button/Button.js.map +1 -1
  18. package/build/commonjs/Button/ButtonProps.js.map +1 -1
  19. package/build/commonjs/Button/useVariantStyleMap.js +9 -0
  20. package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
  21. package/build/commonjs/ButtonBase/ButtonBase.js +1 -1
  22. package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
  23. package/build/commonjs/ButtonBase/index.js +2 -2
  24. package/build/commonjs/ButtonBase/index.js.map +1 -1
  25. package/build/commonjs/Checkbox/Checkbox.js +4 -1
  26. package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
  27. package/build/commonjs/Checkbox/useVariantStyleMap.js +6 -2
  28. package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
  29. package/build/commonjs/Chip/Chip.js +25 -14
  30. package/build/commonjs/Chip/Chip.js.map +1 -1
  31. package/build/commonjs/Chip/ChipProps.js +3 -1
  32. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  33. package/build/commonjs/Chip/index.js +6 -0
  34. package/build/commonjs/Chip/index.js.map +1 -1
  35. package/build/commonjs/Chip/useChipStyle.js +51 -31
  36. package/build/commonjs/Chip/useChipStyle.js.map +1 -1
  37. package/build/commonjs/Dialog/Dialog.js +10 -12
  38. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  39. package/build/commonjs/Dialog/DialogProps.js +1 -1
  40. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  41. package/build/commonjs/Dialog/useDialogSectionStyle.js +6 -4
  42. package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
  43. package/build/commonjs/Dialog/useDialogStyle.js +19 -8
  44. package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
  45. package/build/commonjs/DialogActions/DialogActions.js +0 -1
  46. package/build/commonjs/DialogActions/DialogActions.js.map +1 -1
  47. package/build/commonjs/DialogTitle/DialogLargeTitle.js +80 -0
  48. package/build/commonjs/DialogTitle/DialogLargeTitle.js.map +1 -0
  49. package/build/commonjs/DialogTitle/DialogTitle.js +8 -4
  50. package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
  51. package/build/commonjs/Divider/Divider.js +17 -9
  52. package/build/commonjs/Divider/Divider.js.map +1 -1
  53. package/build/commonjs/Divider/DividerProps.js +1 -1
  54. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  55. package/build/commonjs/Empty/Empty.js +1 -1
  56. package/build/commonjs/Empty/Empty.js.map +1 -1
  57. package/build/commonjs/Flexbox/Flexbox.js +2 -0
  58. package/build/commonjs/Flexbox/Flexbox.js.map +1 -1
  59. package/build/commonjs/Flexbox/FlexboxProps.js.map +1 -1
  60. package/build/commonjs/IconButton/IconButton.js +3 -0
  61. package/build/commonjs/IconButton/IconButton.js.map +1 -1
  62. package/build/commonjs/IconButton/IconButtonProps.js +1 -1
  63. package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
  64. package/build/commonjs/Image/Image.js +2 -2
  65. package/build/commonjs/Image/Image.js.map +1 -1
  66. package/build/commonjs/ImageCore/ImageCoreNative.js +1 -1
  67. package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
  68. package/build/commonjs/ListItem/ListItem.js +38 -26
  69. package/build/commonjs/ListItem/ListItem.js.map +1 -1
  70. package/build/commonjs/ListItem/ListItemProps.js.map +1 -1
  71. package/build/commonjs/ListItemIcon/ListItemIcon.js +1 -2
  72. package/build/commonjs/ListItemIcon/ListItemIcon.js.map +1 -1
  73. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  74. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  75. package/build/commonjs/ListItemText/ListItemText.js +20 -21
  76. package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
  77. package/build/commonjs/ListItemText/ListItemTextProps.js.map +1 -1
  78. package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
  79. package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
  80. package/build/commonjs/Modal/Modal.js +1 -1
  81. package/build/commonjs/Modal/Modal.js.map +1 -1
  82. package/build/commonjs/Pagination/NumberPagination.js +4 -2
  83. package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
  84. package/build/commonjs/Pagination/Pagination.js +2 -0
  85. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  86. package/build/commonjs/Pagination/PaginationProps.js +3 -1
  87. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  88. package/build/commonjs/Pagination/index.js +6 -0
  89. package/build/commonjs/Pagination/index.js.map +1 -1
  90. package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
  91. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  92. package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
  93. package/build/commonjs/Radio/Radio.js +11 -4
  94. package/build/commonjs/Radio/Radio.js.map +1 -1
  95. package/build/commonjs/RadioGroup/RadioGroup.js +2 -27
  96. package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
  97. package/build/commonjs/Section/Section.js +32 -0
  98. package/build/commonjs/Section/Section.js.map +1 -0
  99. package/build/commonjs/Section/SectionProps.js +2 -0
  100. package/build/commonjs/Section/SectionProps.js.map +1 -0
  101. package/build/commonjs/Section/index.js +16 -0
  102. package/build/commonjs/Section/index.js.map +1 -0
  103. package/build/commonjs/ShadowView/ShadowView.native.js +4 -0
  104. package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -1
  105. package/build/commonjs/SnackbarContent/SnackbarContent.js +26 -9
  106. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  107. package/build/commonjs/Tab/Tab.js +21 -19
  108. package/build/commonjs/Tab/Tab.js.map +1 -1
  109. package/build/commonjs/Tab/TabProps.js +4 -2
  110. package/build/commonjs/Tab/TabProps.js.map +1 -1
  111. package/build/commonjs/Tab/index.js +14 -0
  112. package/build/commonjs/Tab/index.js.map +1 -1
  113. package/build/commonjs/Tab/useVariantStyleMap.js +59 -18
  114. package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
  115. package/build/commonjs/TabBase/TabBase.js +1 -8
  116. package/build/commonjs/TabBase/TabBase.js.map +1 -1
  117. package/build/commonjs/TabBase/TabBaseProps.js.map +1 -1
  118. package/build/commonjs/Tabs/Tabs.js +23 -7
  119. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  120. package/build/commonjs/Tabs/TabsProps.js.map +1 -1
  121. package/build/commonjs/Tabs/index.js.map +1 -1
  122. package/build/commonjs/Tabs/useTabsStyle.js +81 -0
  123. package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
  124. package/build/commonjs/TextField/TextField.js +60 -15
  125. package/build/commonjs/TextField/TextField.js.map +1 -1
  126. package/build/commonjs/TextField/useVariantStyleMap.js +29 -29
  127. package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
  128. package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
  129. package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
  130. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
  131. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  132. package/build/commonjs/Toolbar/BackButton/index.js +16 -0
  133. package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
  134. package/build/commonjs/Toolbar/Toolbar.js +22 -12
  135. package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
  136. package/build/commonjs/Toolbar/ToolbarProps.js.map +1 -1
  137. package/build/commonjs/Tooltip/Beaks/index.js +32 -0
  138. package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
  139. package/build/commonjs/Tooltip/Tooltip.js +18 -22
  140. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  141. package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
  142. package/build/commonjs/Tooltip/index.js +19 -0
  143. package/build/commonjs/Tooltip/index.js.map +1 -1
  144. package/build/commonjs/Typography/Typography.js +9 -2
  145. package/build/commonjs/Typography/Typography.js.map +1 -1
  146. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  147. package/build/commonjs/hooks/useBreakpointUp.js +4 -1
  148. package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
  149. package/build/commonjs/hooks/useCollapsibleAppBar.js +11 -13
  150. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  151. package/build/commonjs/hooks/useContentContainerStyle.js +39 -25
  152. package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
  153. package/build/commonjs/hooks/useFadeInAppBar.js +4 -4
  154. package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
  155. package/build/commonjs/index.js +21 -0
  156. package/build/commonjs/index.js.map +1 -1
  157. package/build/commonjs/internal/icons/AppBarChevronLeft.js +23 -0
  158. package/build/commonjs/internal/icons/AppBarChevronLeft.js.map +1 -0
  159. package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
  160. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  161. package/build/commonjs/internal/icons/ChevronRight.js +4 -2
  162. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  163. package/build/commonjs/internal/icons/ChipClose.js +23 -0
  164. package/build/commonjs/internal/icons/ChipClose.js.map +1 -0
  165. package/build/commonjs/internal/icons/Clear.js +3 -3
  166. package/build/commonjs/internal/icons/Clear.js.map +1 -1
  167. package/build/commonjs/internal/icons/Close.js +4 -2
  168. package/build/commonjs/internal/icons/Close.js.map +1 -1
  169. package/build/commonjs/internal/icons/Search.js +2 -2
  170. package/build/commonjs/internal/icons/Search.js.map +1 -1
  171. package/build/commonjs/internal/icons/index.js +16 -0
  172. package/build/commonjs/internal/icons/index.js.map +1 -1
  173. package/build/module/Accordion/Accordion.js +20 -13
  174. package/build/module/Accordion/Accordion.js.map +1 -1
  175. package/build/module/Accordion/AccordionProps.js.map +1 -1
  176. package/build/module/Accordion/useVariantStyleMap.js +15 -8
  177. package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
  178. package/build/module/AppBar/AppBar.js +1 -1
  179. package/build/module/AppBar/AppBar.js.map +1 -1
  180. package/build/module/Badge/Badge.js +4 -3
  181. package/build/module/Badge/Badge.js.map +1 -1
  182. package/build/module/Badge/BadgeProps.js.map +1 -1
  183. package/build/module/Badge/useVariantStyleMap.js +2 -2
  184. package/build/module/Badge/useVariantStyleMap.js.map +1 -1
  185. package/build/module/BottomSheetTitle/BottomSheetTitle.js +6 -2
  186. package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  187. package/build/module/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
  188. package/build/module/Button/Button.js +27 -13
  189. package/build/module/Button/Button.js.map +1 -1
  190. package/build/module/Button/ButtonProps.js.map +1 -1
  191. package/build/module/Button/useVariantStyleMap.js +9 -0
  192. package/build/module/Button/useVariantStyleMap.js.map +1 -1
  193. package/build/module/ButtonBase/ButtonBase.js +1 -1
  194. package/build/module/ButtonBase/ButtonBase.js.map +1 -1
  195. package/build/module/ButtonBase/index.js +1 -1
  196. package/build/module/ButtonBase/index.js.map +1 -1
  197. package/build/module/Checkbox/Checkbox.js +4 -1
  198. package/build/module/Checkbox/Checkbox.js.map +1 -1
  199. package/build/module/Checkbox/useVariantStyleMap.js +6 -2
  200. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
  201. package/build/module/Chip/Chip.js +21 -13
  202. package/build/module/Chip/Chip.js.map +1 -1
  203. package/build/module/Chip/ChipProps.js +1 -0
  204. package/build/module/Chip/ChipProps.js.map +1 -1
  205. package/build/module/Chip/index.js +1 -1
  206. package/build/module/Chip/index.js.map +1 -1
  207. package/build/module/Chip/useChipStyle.js +51 -31
  208. package/build/module/Chip/useChipStyle.js.map +1 -1
  209. package/build/module/Dialog/Dialog.js +10 -11
  210. package/build/module/Dialog/Dialog.js.map +1 -1
  211. package/build/module/Dialog/DialogProps.js +1 -1
  212. package/build/module/Dialog/DialogProps.js.map +1 -1
  213. package/build/module/Dialog/useDialogSectionStyle.js +6 -4
  214. package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
  215. package/build/module/Dialog/useDialogStyle.js +18 -8
  216. package/build/module/Dialog/useDialogStyle.js.map +1 -1
  217. package/build/module/DialogActions/DialogActions.js +0 -1
  218. package/build/module/DialogActions/DialogActions.js.map +1 -1
  219. package/build/module/DialogTitle/DialogLargeTitle.js +65 -0
  220. package/build/module/DialogTitle/DialogLargeTitle.js.map +1 -0
  221. package/build/module/DialogTitle/DialogTitle.js +6 -3
  222. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  223. package/build/module/Divider/Divider.js +7 -0
  224. package/build/module/Divider/Divider.js.map +1 -1
  225. package/build/module/Divider/DividerProps.js +1 -1
  226. package/build/module/Divider/DividerProps.js.map +1 -1
  227. package/build/module/Empty/Empty.js +1 -1
  228. package/build/module/Empty/Empty.js.map +1 -1
  229. package/build/module/Flexbox/Flexbox.js +2 -0
  230. package/build/module/Flexbox/Flexbox.js.map +1 -1
  231. package/build/module/Flexbox/FlexboxProps.js.map +1 -1
  232. package/build/module/IconButton/IconButton.js +3 -0
  233. package/build/module/IconButton/IconButton.js.map +1 -1
  234. package/build/module/IconButton/IconButtonProps.js +1 -1
  235. package/build/module/IconButton/IconButtonProps.js.map +1 -1
  236. package/build/module/Image/Image.js +2 -2
  237. package/build/module/Image/Image.js.map +1 -1
  238. package/build/module/ImageCore/ImageCoreNative.js +1 -1
  239. package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
  240. package/build/module/ListItem/ListItem.js +36 -28
  241. package/build/module/ListItem/ListItem.js.map +1 -1
  242. package/build/module/ListItem/ListItemProps.js.map +1 -1
  243. package/build/module/ListItemIcon/ListItemIcon.js +1 -2
  244. package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
  245. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  246. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  247. package/build/module/ListItemText/ListItemText.js +17 -19
  248. package/build/module/ListItemText/ListItemText.js.map +1 -1
  249. package/build/module/ListItemText/ListItemTextProps.js.map +1 -1
  250. package/build/module/ListSubheader/ListSubheader.js +1 -1
  251. package/build/module/ListSubheader/ListSubheader.js.map +1 -1
  252. package/build/module/Modal/Modal.js +1 -1
  253. package/build/module/Modal/Modal.js.map +1 -1
  254. package/build/module/Pagination/NumberPagination.js +4 -2
  255. package/build/module/Pagination/NumberPagination.js.map +1 -1
  256. package/build/module/Pagination/Pagination.js +2 -0
  257. package/build/module/Pagination/Pagination.js.map +1 -1
  258. package/build/module/Pagination/PaginationProps.js +1 -0
  259. package/build/module/Pagination/PaginationProps.js.map +1 -1
  260. package/build/module/Pagination/index.js +1 -1
  261. package/build/module/Pagination/index.js.map +1 -1
  262. package/build/module/PaginationItem/PaginationItem.js +28 -21
  263. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  264. package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
  265. package/build/module/Radio/Radio.js +10 -4
  266. package/build/module/Radio/Radio.js.map +1 -1
  267. package/build/module/RadioGroup/RadioGroup.js +2 -20
  268. package/build/module/RadioGroup/RadioGroup.js.map +1 -1
  269. package/build/module/Section/Section.js +19 -0
  270. package/build/module/Section/Section.js.map +1 -0
  271. package/build/module/Section/SectionProps.js +2 -0
  272. package/build/module/Section/SectionProps.js.map +1 -0
  273. package/build/module/Section/index.js +2 -0
  274. package/build/module/Section/index.js.map +1 -0
  275. package/build/module/ShadowView/ShadowView.native.js +4 -0
  276. package/build/module/ShadowView/ShadowView.native.js.map +1 -1
  277. package/build/module/SnackbarContent/SnackbarContent.js +26 -9
  278. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  279. package/build/module/Tab/Tab.js +22 -19
  280. package/build/module/Tab/Tab.js.map +1 -1
  281. package/build/module/Tab/TabProps.js +2 -1
  282. package/build/module/Tab/TabProps.js.map +1 -1
  283. package/build/module/Tab/index.js +1 -0
  284. package/build/module/Tab/index.js.map +1 -1
  285. package/build/module/Tab/useVariantStyleMap.js +59 -18
  286. package/build/module/Tab/useVariantStyleMap.js.map +1 -1
  287. package/build/module/TabBase/TabBase.js +1 -8
  288. package/build/module/TabBase/TabBase.js.map +1 -1
  289. package/build/module/TabBase/TabBaseProps.js.map +1 -1
  290. package/build/module/Tabs/Tabs.js +21 -7
  291. package/build/module/Tabs/Tabs.js.map +1 -1
  292. package/build/module/Tabs/TabsProps.js.map +1 -1
  293. package/build/module/Tabs/index.js.map +1 -1
  294. package/build/module/Tabs/useTabsStyle.js +71 -0
  295. package/build/module/Tabs/useTabsStyle.js.map +1 -0
  296. package/build/module/TextField/TextField.js +60 -15
  297. package/build/module/TextField/TextField.js.map +1 -1
  298. package/build/module/TextField/useVariantStyleMap.js +29 -29
  299. package/build/module/TextField/useVariantStyleMap.js.map +1 -1
  300. package/build/module/Toolbar/BackButton/BackButton.js +32 -0
  301. package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
  302. package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
  303. package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  304. package/build/module/Toolbar/BackButton/index.js +2 -0
  305. package/build/module/Toolbar/BackButton/index.js.map +1 -0
  306. package/build/module/Toolbar/Toolbar.js +20 -12
  307. package/build/module/Toolbar/Toolbar.js.map +1 -1
  308. package/build/module/Toolbar/ToolbarProps.js.map +1 -1
  309. package/build/module/Tooltip/Beaks/index.js +4 -0
  310. package/build/module/Tooltip/Beaks/index.js.map +1 -1
  311. package/build/module/Tooltip/Tooltip.js +11 -14
  312. package/build/module/Tooltip/Tooltip.js.map +1 -1
  313. package/build/module/Tooltip/TooltipProps.js.map +1 -1
  314. package/build/module/Tooltip/index.js +1 -0
  315. package/build/module/Tooltip/index.js.map +1 -1
  316. package/build/module/Typography/Typography.js +9 -2
  317. package/build/module/Typography/Typography.js.map +1 -1
  318. package/build/module/Typography/TypographyProps.js.map +1 -1
  319. package/build/module/hooks/useBreakpointUp.js +4 -1
  320. package/build/module/hooks/useBreakpointUp.js.map +1 -1
  321. package/build/module/hooks/useCollapsibleAppBar.js +12 -13
  322. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  323. package/build/module/hooks/useContentContainerStyle.js +43 -25
  324. package/build/module/hooks/useContentContainerStyle.js.map +1 -1
  325. package/build/module/hooks/useFadeInAppBar.js +4 -4
  326. package/build/module/hooks/useFadeInAppBar.js.map +1 -1
  327. package/build/module/index.js +2 -0
  328. package/build/module/index.js.map +1 -1
  329. package/build/module/internal/icons/AppBarChevronLeft.js +9 -0
  330. package/build/module/internal/icons/AppBarChevronLeft.js.map +1 -0
  331. package/build/module/internal/icons/ChevronLeft.js +4 -2
  332. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  333. package/build/module/internal/icons/ChevronRight.js +4 -2
  334. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  335. package/build/module/internal/icons/ChipClose.js +9 -0
  336. package/build/module/internal/icons/ChipClose.js.map +1 -0
  337. package/build/module/internal/icons/Clear.js +3 -3
  338. package/build/module/internal/icons/Clear.js.map +1 -1
  339. package/build/module/internal/icons/Close.js +4 -2
  340. package/build/module/internal/icons/Close.js.map +1 -1
  341. package/build/module/internal/icons/Search.js +2 -2
  342. package/build/module/internal/icons/Search.js.map +1 -1
  343. package/build/module/internal/icons/index.js +2 -0
  344. package/build/module/internal/icons/index.js.map +1 -1
  345. package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
  346. package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
  347. package/build/typescript/Badge/BadgeProps.d.ts +10 -5
  348. package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +1 -0
  349. package/build/typescript/Button/ButtonProps.d.ts +5 -0
  350. package/build/typescript/ButtonBase/index.d.ts +1 -1
  351. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
  352. package/build/typescript/Chip/ChipProps.d.ts +11 -4
  353. package/build/typescript/Chip/index.d.ts +1 -1
  354. package/build/typescript/Chip/useChipStyle.d.ts +6 -3
  355. package/build/typescript/Dialog/DialogProps.d.ts +1 -6
  356. package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
  357. package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +9 -0
  358. package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -1
  359. package/build/typescript/Divider/DividerProps.d.ts +1 -1
  360. package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
  361. package/build/typescript/IconButton/IconButtonProps.d.ts +1 -1
  362. package/build/typescript/ListItem/ListItem.d.ts +1 -1
  363. package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
  364. package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
  365. package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
  366. package/build/typescript/Pagination/index.d.ts +2 -2
  367. package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
  368. package/build/typescript/Section/Section.d.ts +3 -0
  369. package/build/typescript/Section/SectionProps.d.ts +6 -0
  370. package/build/typescript/Section/index.d.ts +2 -0
  371. package/build/typescript/Tab/TabProps.d.ts +21 -2
  372. package/build/typescript/Tab/index.d.ts +2 -1
  373. package/build/typescript/Tab/useVariantStyleMap.d.ts +4 -2
  374. package/build/typescript/TabBase/TabBaseProps.d.ts +0 -5
  375. package/build/typescript/Tabs/Tabs.d.ts +1 -1
  376. package/build/typescript/Tabs/TabsProps.d.ts +6 -1
  377. package/build/typescript/Tabs/index.d.ts +1 -1
  378. package/build/typescript/Tabs/useTabsStyle.d.ts +8 -0
  379. package/build/typescript/TextField/useVariantStyleMap.d.ts +2 -0
  380. package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
  381. package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
  382. package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
  383. package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
  384. package/build/typescript/Toolbar/ToolbarProps.d.ts +0 -5
  385. package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
  386. package/build/typescript/Tooltip/TooltipProps.d.ts +2 -2
  387. package/build/typescript/Tooltip/index.d.ts +1 -0
  388. package/build/typescript/Typography/TypographyProps.d.ts +4 -0
  389. package/build/typescript/hooks/useCollapsibleAppBar.d.ts +1 -1
  390. package/build/typescript/hooks/useContentContainerStyle.d.ts +5 -8
  391. package/build/typescript/index.d.ts +2 -0
  392. package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +131 -0
  393. package/build/typescript/internal/icons/ChipClose.d.ts +131 -0
  394. package/build/typescript/internal/icons/index.d.ts +2 -0
  395. package/package.json +5 -5
  396. package/src/Accordion/Accordion.tsx +23 -14
  397. package/src/Accordion/AccordionProps.ts +4 -2
  398. package/src/Accordion/useVariantStyleMap.ts +14 -6
  399. package/src/AppBar/AppBar.tsx +2 -2
  400. package/src/Badge/Badge.tsx +4 -3
  401. package/src/Badge/BadgeProps.ts +12 -6
  402. package/src/Badge/useVariantStyleMap.ts +2 -2
  403. package/src/BottomSheetTitle/BottomSheetTitle.tsx +5 -1
  404. package/src/BottomSheetTitle/BottomSheetTitleProps.ts +1 -0
  405. package/src/Button/Button.tsx +28 -12
  406. package/src/Button/ButtonProps.ts +6 -0
  407. package/src/Button/useVariantStyleMap.ts +9 -0
  408. package/src/ButtonBase/ButtonBase.tsx +1 -1
  409. package/src/ButtonBase/index.ts +1 -1
  410. package/src/Checkbox/Checkbox.tsx +11 -8
  411. package/src/Checkbox/useVariantStyleMap.ts +6 -1
  412. package/src/Chip/Chip.tsx +24 -13
  413. package/src/Chip/ChipProps.ts +13 -4
  414. package/src/Chip/index.ts +1 -1
  415. package/src/Chip/useChipStyle.ts +59 -29
  416. package/src/Dialog/Dialog.tsx +12 -11
  417. package/src/Dialog/DialogProps.ts +1 -7
  418. package/src/Dialog/useDialogSectionStyle.ts +6 -4
  419. package/src/Dialog/useDialogStyle.ts +19 -7
  420. package/src/DialogActions/DialogActions.tsx +0 -1
  421. package/src/DialogTitle/DialogLargeTitle.tsx +95 -0
  422. package/src/DialogTitle/DialogTitle.tsx +6 -1
  423. package/src/Divider/Divider.tsx +5 -0
  424. package/src/Divider/DividerProps.ts +1 -1
  425. package/src/Empty/Empty.tsx +1 -1
  426. package/src/Flexbox/Flexbox.tsx +2 -0
  427. package/src/Flexbox/FlexboxProps.ts +5 -0
  428. package/src/IconButton/IconButton.tsx +2 -0
  429. package/src/IconButton/IconButtonProps.ts +1 -0
  430. package/src/Image/Image.tsx +3 -3
  431. package/src/ImageCore/ImageCoreNative.tsx +1 -1
  432. package/src/ListItem/ListItem.tsx +61 -30
  433. package/src/ListItem/ListItemProps.ts +5 -0
  434. package/src/ListItemIcon/ListItemIcon.tsx +1 -2
  435. package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
  436. package/src/ListItemText/ListItemText.tsx +20 -28
  437. package/src/ListItemText/ListItemTextProps.ts +2 -10
  438. package/src/ListSubheader/ListSubheader.tsx +1 -1
  439. package/src/Modal/Modal.tsx +1 -1
  440. package/src/Pagination/NumberPagination.tsx +7 -2
  441. package/src/Pagination/Pagination.tsx +3 -2
  442. package/src/Pagination/PaginationProps.ts +15 -0
  443. package/src/Pagination/index.ts +2 -2
  444. package/src/PaginationItem/PaginationItem.tsx +31 -24
  445. package/src/PaginationItem/PaginationItemProps.ts +7 -0
  446. package/src/Radio/Radio.tsx +12 -3
  447. package/src/RadioGroup/RadioGroup.tsx +2 -28
  448. package/src/Section/Section.tsx +26 -0
  449. package/src/Section/SectionProps.ts +6 -0
  450. package/src/Section/index.ts +2 -0
  451. package/src/ShadowView/ShadowView.native.tsx +4 -0
  452. package/src/SnackbarContent/SnackbarContent.tsx +36 -15
  453. package/src/Tab/Tab.tsx +32 -22
  454. package/src/Tab/TabProps.ts +25 -2
  455. package/src/Tab/index.ts +2 -1
  456. package/src/Tab/useVariantStyleMap.ts +72 -19
  457. package/src/TabBase/TabBase.tsx +1 -9
  458. package/src/TabBase/TabBaseProps.ts +0 -6
  459. package/src/Tabs/Tabs.tsx +26 -8
  460. package/src/Tabs/TabsProps.ts +7 -1
  461. package/src/Tabs/index.ts +1 -1
  462. package/src/Tabs/useTabsStyle.ts +79 -0
  463. package/src/TextField/TextField.tsx +99 -45
  464. package/src/TextField/useVariantStyleMap.ts +29 -27
  465. package/src/Toolbar/BackButton/BackButton.tsx +44 -0
  466. package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
  467. package/src/Toolbar/BackButton/index.ts +2 -0
  468. package/src/Toolbar/Toolbar.tsx +26 -17
  469. package/src/Toolbar/ToolbarProps.ts +0 -6
  470. package/src/Tooltip/Beaks/index.ts +4 -0
  471. package/src/Tooltip/Tooltip.tsx +10 -12
  472. package/src/Tooltip/TooltipProps.ts +2 -2
  473. package/src/Tooltip/index.ts +1 -0
  474. package/src/Typography/Typography.tsx +3 -1
  475. package/src/Typography/TypographyProps.ts +5 -0
  476. package/src/hooks/useBreakpointUp.ts +3 -1
  477. package/src/hooks/useCollapsibleAppBar.ts +10 -24
  478. package/src/hooks/useContentContainerStyle.ts +43 -31
  479. package/src/hooks/useFadeInAppBar.ts +4 -4
  480. package/src/index.ts +3 -0
  481. package/src/internal/icons/AppBarChevronLeft.tsx +15 -0
  482. package/src/internal/icons/ChevronLeft.tsx +4 -1
  483. package/src/internal/icons/ChevronRight.tsx +4 -1
  484. package/src/internal/icons/ChipClose.tsx +13 -0
  485. package/src/internal/icons/Clear.tsx +3 -3
  486. package/src/internal/icons/Close.tsx +4 -1
  487. package/src/internal/icons/Search.tsx +2 -2
  488. package/src/internal/icons/index.ts +2 -0
  489. package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
  490. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
  491. package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
  492. package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
  493. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
  494. package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
@@ -1,60 +1,72 @@
1
- import type { ScrollViewProps, ViewStyle } from 'react-native';
1
+ import type { FountainUiStyle } from '@fountain-ui/styles';
2
+ import { css, useTheme } from '../styles';
2
3
  import type { Theme } from '../types';
3
- import { useTheme } from '../styles';
4
- import useBreakpointUp from './useBreakpointUp';
5
4
 
6
5
  type Breakpoint = keyof Theme['breakpoints']['values'];
7
6
 
8
- type ContentContainerStyle = ScrollViewProps['contentContainerStyle'];
9
-
10
7
  export interface Config {
11
- breakpoint?: Breakpoint;
12
- maxWidth?: Breakpoint;
13
- styleProvider?: (theme: Theme) => ContentContainerStyle;
8
+ maxWidth?: number;
9
+ styleProvider?: (theme: Theme) => FountainUiStyle;
10
+ isHomeScreen?: boolean;
14
11
  }
15
12
 
16
- const defaultConfig: Required<Config> = {
17
- breakpoint: 'lg',
18
- maxWidth: 'md',
19
- styleProvider: () => undefined,
20
- };
13
+ function getMaxWidth(theme: Theme, breakpoint: Breakpoint, customMaxWidth?: number): number | undefined {
14
+ switch (breakpoint) {
15
+ case 'lg':
16
+ case 'md':
17
+ return customMaxWidth ?? theme.breakpoints.values[breakpoint];
18
+ default:
19
+ return undefined;
20
+ }
21
+ }
21
22
 
22
- // TODO: Needs to refactor
23
- function getMaxWidth(theme: Theme, breakpoint: Breakpoint): ViewStyle['maxWidth'] {
23
+ function getHomeScreenPaddingHorizontal(theme: Theme, breakpoint: Breakpoint): number {
24
24
  switch (breakpoint) {
25
+ case 'xxs':
25
26
  case 'xs':
26
- return theme.breakpoints.values['sm'];
27
+ return theme.spacing(3);
27
28
  case 'sm':
28
- return theme.breakpoints.values['md'];
29
+ return theme.spacing(6);
29
30
  case 'md':
30
- return theme.breakpoints.values['lg'];
31
31
  case 'lg':
32
- return 'none';
32
+ default:
33
+ return theme.spacing(4);
34
+ }
35
+ }
36
+
37
+ function getPaddingHorizontal(theme: Theme, breakpoint: Breakpoint, isHomeScreen?: boolean): number {
38
+ if (isHomeScreen) {
39
+ return getHomeScreenPaddingHorizontal(theme, breakpoint);
40
+ }
41
+
42
+ switch (breakpoint) {
43
+ case 'sm':
44
+ return theme.spacing(6);
45
+ default:
46
+ return theme.spacing(4);
33
47
  }
34
48
  }
35
49
 
36
- export default function useContentContainerStyle(config: Config = defaultConfig): ContentContainerStyle {
50
+ export default function useContentContainerStyle(config: Config = {}): FountainUiStyle {
37
51
  const {
38
- breakpoint,
39
- maxWidth,
52
+ maxWidth: customMaxWidth,
40
53
  styleProvider,
41
- } = {
42
- ...defaultConfig,
43
- ...config,
44
- };
54
+ isHomeScreen = false,
55
+ } = config;
45
56
 
46
57
  const theme = useTheme();
47
58
 
59
+ const currentBreakpoint = theme.breakpoints.current;
60
+
48
61
  const additionalStyle = styleProvider?.(theme);
49
62
 
50
- const yesStyle: ContentContainerStyle = [
63
+ return css([
51
64
  {
52
65
  alignSelf: 'center',
53
- maxWidth: getMaxWidth(theme, maxWidth),
66
+ maxWidth: getMaxWidth(theme, currentBreakpoint, customMaxWidth),
67
+ paddingHorizontal: getPaddingHorizontal(theme, currentBreakpoint, isHomeScreen),
54
68
  width: '100%',
55
69
  },
56
70
  additionalStyle,
57
- ];
58
-
59
- return useBreakpointUp(breakpoint, yesStyle, additionalStyle);
71
+ ]);
60
72
  };
@@ -76,7 +76,7 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
76
76
  const lastOffsetY = useSharedValue<number>(0);
77
77
  const normalized = useSharedValue<number>(0);
78
78
 
79
- const originalBackgroundColor = theme.palette.background.default;
79
+ const originalBackgroundColor = theme.palette.background.base;
80
80
  const rgbValues = useMemo(() => rgb(originalBackgroundColor), [originalBackgroundColor]);
81
81
 
82
82
  const animatedAppBarStyle = useAnimatedStyle(() => {
@@ -88,11 +88,11 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
88
88
  borderColor: theme.palette.divider,
89
89
  borderBottomWidth: normalized.value >= 1 ? StyleSheet.hairlineWidth : 0,
90
90
  };
91
- }, [rgbValues]);
91
+ }, [rgbValues, normalized, theme]);
92
92
 
93
93
  const animatedTitleStyle = useAnimatedStyle(() => ({
94
94
  opacity: normalized.value,
95
- }), []);
95
+ }), [normalized]);
96
96
 
97
97
  const scrollHandler = useAnimatedScrollHandler({
98
98
  onBeginDrag: () => {
@@ -117,7 +117,7 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
117
117
  onMomentumEnd: (event) => {
118
118
  lastOffsetY.value = event.contentOffset.y;
119
119
  },
120
- }, [keyboardDismissMode]);
120
+ });
121
121
 
122
122
  const appBarStyle = [
123
123
  animatedAppBarStyle,
package/src/index.ts CHANGED
@@ -149,6 +149,9 @@ export * from './RadioGroup';
149
149
  export { default as Row } from './Row';
150
150
  export * from './Row';
151
151
 
152
+ export { default as Section } from './Section';
153
+ export * from './Section';
154
+
152
155
  export { default as ShadowView } from './ShadowView';
153
156
  export * from './ShadowView';
154
157
 
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Path } from 'react-native-svg';
3
+ import { createSvgIcon } from '../../utils';
4
+
5
+ export default createSvgIcon(
6
+ <React.Fragment>
7
+ <Path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929L15.2929 3.29289C15.6834 2.90237 16.3166 2.90237 16.7071 3.29289C17.0976 3.68342 17.0976 4.31658 16.7071 4.70711L9.41421 12L16.7071 19.2929C17.0976 19.6834 17.0976 20.3166 16.7071 20.7071C16.3166 21.0976 15.6834 21.0976 15.2929 20.7071L7.29289 12.7071Z"
11
+ />
12
+ </React.Fragment>,
13
+ 'AppBarChevronLeft',
14
+ '0 0 24 24',
15
+ );
@@ -4,7 +4,10 @@ import { createSvgIcon } from '../../utils';
4
4
 
5
5
  export default createSvgIcon(
6
6
  <Path
7
- d="M7.58594 12L14.293 18.7071C14.6836 19.0976 15.3167 19.0976 15.7073 18.7071C16.0978 18.3166 16.0978 17.6834 15.7073 17.2929L10.4144 12L15.7073 6.70711C16.0978 6.31658 16.0978 5.68342 15.7073 5.29289C15.3167 4.90237 14.6836 4.90237 14.293 5.29289L7.58594 12Z"
7
+ fillRule="evenodd"
8
+ clipRule="evenodd"
9
+ d="M0 12C3.16267e-09 11.7348 0.105357 11.4804 0.292893 11.2929L6.29289 5.29289C6.68342 4.90237 7.31658 4.90237 7.70711 5.29289C8.09763 5.68342 8.09763 6.31658 7.70711 6.70711L2.41421 12L7.70711 17.2929C8.09763 17.6834 8.09763 18.3166 7.70711 18.7071C7.31658 19.0976 6.68342 19.0976 6.29289 18.7071L0.292893 12.7071C0.105357 12.5196 -3.16267e-09 12.2652 0 12Z"
8
10
  />,
9
11
  'ChevronLeft',
12
+ '0 0 8 24',
10
13
  );
@@ -4,7 +4,10 @@ import { createSvgIcon } from '../../utils';
4
4
 
5
5
  export default createSvgIcon(
6
6
  <Path
7
- d="M16.4141 12L9.70696 18.7071C9.31643 19.0976 8.68327 19.0976 8.29274 18.7071C7.90222 18.3166 7.90222 17.6834 8.29274 17.2929L13.5856 12L8.29274 6.70711C7.90222 6.31658 7.90222 5.68342 8.29274 5.29289C8.68327 4.90237 9.31643 4.90237 9.70696 5.29289L16.4141 12Z"
7
+ fillRule="evenodd"
8
+ clipRule="evenodd"
9
+ d="M8 12C8 12.2652 7.89464 12.5196 7.70711 12.7071L1.70711 18.7071C1.31658 19.0976 0.683417 19.0976 0.292892 18.7071C-0.0976309 18.3166 -0.0976309 17.6834 0.292893 17.2929L5.58579 12L0.292894 6.70711C-0.0976304 6.31658 -0.0976304 5.68342 0.292895 5.29289C0.683418 4.90237 1.31658 4.90237 1.70711 5.29289L7.70711 11.2929C7.89464 11.4804 8 11.7348 8 12Z"
8
10
  />,
9
11
  'ChevronRight',
12
+ '0 0 8 24',
10
13
  );
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Path } from 'react-native-svg';
3
+ import { createSvgIcon } from '../../utils';
4
+
5
+ export default createSvgIcon(
6
+ <Path
7
+ fillRule="evenodd"
8
+ clipRule="evenodd"
9
+ d="M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z"
10
+ />,
11
+ 'ChipClose',
12
+ '0 0 9 15',
13
+ );
@@ -7,14 +7,14 @@ export default createSvgIcon(
7
7
  <Path
8
8
  fillRule="evenodd"
9
9
  clipRule="evenodd"
10
- d="M4.68306 5.68306C4.92714 5.43898 5.32286 5.43898 5.56694 5.68306L7 7.11612L8.43306 5.68306C8.67714 5.43898 9.07286 5.43898 9.31694 5.68306C9.56102 5.92714 9.56102 6.32286 9.31694 6.56694L7.88388 8L9.31694 9.43306C9.56102 9.67714 9.56102 10.0729 9.31694 10.3169C9.07286 10.561 8.67714 10.561 8.43306 10.3169L7 8.88388L5.56694 10.3169C5.32286 10.561 4.92714 10.561 4.68306 10.3169C4.43898 10.0729 4.43898 9.67714 4.68306 9.43306L6.11612 8L4.68306 6.56694C4.43898 6.32286 4.43898 5.92714 4.68306 5.68306Z"
10
+ d="M5.32076 6.32681C5.603 6.04521 6.06061 6.04521 6.34285 6.32681L7.99999 7.98019L9.65712 6.32681C9.93937 6.04521 10.397 6.04521 10.6792 6.32681C10.9615 6.60842 10.9615 7.06498 10.6792 7.34659L9.02208 8.99997L10.6792 10.6533C10.9615 10.9349 10.9615 11.3915 10.6792 11.6731C10.397 11.9547 9.93937 11.9547 9.65712 11.6731L7.99999 10.0197L6.34285 11.6731C6.06061 11.9547 5.603 11.9547 5.32076 11.6731C5.03852 11.3915 5.03852 10.9349 5.32076 10.6533L6.9779 8.99997L5.32076 7.34659C5.03852 7.06498 5.03852 6.60842 5.32076 6.32681Z"
11
11
  />
12
12
  <Path
13
13
  fillRule="evenodd"
14
14
  clipRule="evenodd"
15
- d="M7 2.375C3.8934 2.375 1.375 4.8934 1.375 8C1.375 11.1066 3.8934 13.625 7 13.625C10.1066 13.625 12.625 11.1066 12.625 8C12.625 4.8934 10.1066 2.375 7 2.375ZM0.125 8C0.125 4.20304 3.20304 1.125 7 1.125C10.797 1.125 13.875 4.20304 13.875 8C13.875 11.797 10.797 14.875 7 14.875C3.20304 14.875 0.125 11.797 0.125 8Z"
15
+ d="M7.99999 2.51017C4.40763 2.51017 1.49544 5.41575 1.49544 8.99997C1.49544 12.5842 4.40763 15.4898 7.99999 15.4898C11.5923 15.4898 14.5045 12.5842 14.5045 8.99997C14.5045 5.41575 11.5923 2.51017 7.99999 2.51017ZM0.0499878 8.99997C0.0499878 4.61926 3.60932 1.06799 7.99999 1.06799C12.3907 1.06799 15.95 4.61926 15.95 8.99997C15.95 13.3807 12.3907 16.9319 7.99999 16.9319C3.60932 16.9319 0.0499878 13.3807 0.0499878 8.99997Z"
16
16
  />
17
17
  </React.Fragment>,
18
18
  'Clear',
19
- '0 0 14 16',
19
+ '0 0 16 18',
20
20
  );
@@ -4,7 +4,10 @@ import { createSvgIcon } from '../../utils';
4
4
 
5
5
  export default createSvgIcon(
6
6
  <Path
7
- d="M19.7071 5.70711C20.0976 5.31658 20.0976 4.68342 19.7071 4.29289C19.3166 3.90237 18.6834 3.90237 18.2929 4.29289L12 10.5858L5.70711 4.29292C5.31658 3.9024 4.68342 3.9024 4.29289 4.29292C3.90237 4.68345 3.90237 5.31661 4.29289 5.70714L10.5858 12L4.29289 18.2929C3.90237 18.6834 3.90237 19.3166 4.29289 19.7071C4.68342 20.0976 5.31658 20.0976 5.70711 19.7071L12 13.4142L18.2929 19.7071C18.6834 20.0977 19.3166 20.0977 19.7071 19.7071C20.0976 19.3166 20.0976 18.6834 19.7071 18.2929L13.4142 12L19.7071 5.70711Z"
7
+ fillRule="evenodd"
8
+ clipRule="evenodd"
9
+ d="M0.292893 5.29289C0.683417 4.90237 1.31658 4.90237 1.70711 5.29289L7 10.5858L12.2929 5.29289C12.6834 4.90237 13.3166 4.90237 13.7071 5.29289C14.0976 5.68342 14.0976 6.31658 13.7071 6.70711L8.41421 12L13.7071 17.2929C14.0976 17.6834 14.0976 18.3166 13.7071 18.7071C13.3166 19.0976 12.6834 19.0976 12.2929 18.7071L7 13.4142L1.70711 18.7071C1.31658 19.0976 0.683417 19.0976 0.292893 18.7071C-0.0976311 18.3166 -0.0976311 17.6834 0.292893 17.2929L5.58579 12L0.292893 6.70711C-0.0976311 6.31658 -0.0976311 5.68342 0.292893 5.29289Z"
8
10
  />,
9
11
  'Close',
12
+ '0 0 14 24',
10
13
  );
@@ -7,9 +7,9 @@ export default createSvgIcon(
7
7
  <Path
8
8
  fillRule="evenodd"
9
9
  clipRule="evenodd"
10
- d="M8.25 3.5C5.3505 3.5 3 5.8505 3 8.75C3 11.6495 5.3505 14 8.25 14C9.66548 14 10.9501 13.4398 11.8943 12.5291C11.9136 12.5042 11.9346 12.4803 11.9575 12.4575C11.9803 12.4346 12.0042 12.4136 12.0291 12.3943C12.9398 11.4501 13.5 10.1655 13.5 8.75C13.5 5.8505 11.1495 3.5 8.25 3.5ZM13.5239 12.9633C14.4476 11.8085 15 10.3438 15 8.75C15 5.02208 11.9779 2 8.25 2C4.52208 2 1.5 5.02208 1.5 8.75C1.5 12.4779 4.52208 15.5 8.25 15.5C9.84376 15.5 11.3085 14.9476 12.4633 14.0239L15.22 16.7806C15.5129 17.0735 15.9877 17.0735 16.2806 16.7806C16.5735 16.4877 16.5735 16.0129 16.2806 15.72L13.5239 12.9633Z"
10
+ d="M8.70834 3.16665C5.64776 3.16665 3.16667 5.64774 3.16667 8.70831C3.16667 11.7689 5.64776 14.25 8.70834 14.25C10.2024 14.25 11.5585 13.6587 12.5551 12.6973C12.5755 12.6711 12.5977 12.6458 12.6218 12.6217C12.6459 12.5977 12.6711 12.5754 12.6974 12.5551C13.6587 11.5584 14.25 10.2024 14.25 8.70831C14.25 5.64774 11.7689 3.16665 8.70834 3.16665ZM14.2753 13.1556C15.2503 11.9367 15.8333 10.3906 15.8333 8.70831C15.8333 4.77328 12.6434 1.58331 8.70834 1.58331C4.77331 1.58331 1.58334 4.77328 1.58334 8.70831C1.58334 12.6433 4.77331 15.8333 8.70834 15.8333C10.3906 15.8333 11.9368 15.2503 13.1557 14.2752L16.0655 17.1851C16.3747 17.4942 16.8759 17.4942 17.1851 17.1851C17.4943 16.8759 17.4943 16.3747 17.1851 16.0655L14.2753 13.1556Z"
11
11
  />
12
12
  </React.Fragment>,
13
13
  'Search',
14
- '0 0 18 19',
14
+ '0 0 19 19',
15
15
  );
@@ -1,3 +1,4 @@
1
+ export { default as AppBarChevronLeft } from './AppBarChevronLeft';
1
2
  export { default as Check } from './Check';
2
3
  export { default as Checkbox } from './Checkbox';
3
4
  export { default as CheckboxChecked } from './CheckboxChecked';
@@ -6,6 +7,7 @@ export { default as CheckCircle } from './CheckCircle';
6
7
  export { default as ChevronDown } from './ChevronDown';
7
8
  export { default as ChevronLeft } from './ChevronLeft';
8
9
  export { default as ChevronRight } from './ChevronRight';
10
+ export { default as ChipClose } from './ChipClose';
9
11
  export { default as CircularProgress } from './CircularProgress';
10
12
  export { default as Clear } from './Clear';
11
13
  export { default as Close } from './Close';
@@ -1,126 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ORIGINAL_OPACITY = exports.DISABLED_OPACITY = void 0;
7
- exports.default = ButtonBase;
8
-
9
- var _react = _interopRequireWildcard(require("react"));
10
-
11
- var _reactNative = require("react-native");
12
-
13
- var _hooks = require("../hooks");
14
-
15
- var _utils = require("../utils");
16
-
17
- var _animated = require("../animated");
18
-
19
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
-
21
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
-
23
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24
-
25
- const ORIGINAL_OPACITY = 1;
26
- exports.ORIGINAL_OPACITY = ORIGINAL_OPACITY;
27
- const DISABLED_OPACITY = .3;
28
- exports.DISABLED_OPACITY = DISABLED_OPACITY;
29
- const ACTIVE_OPACITY = .65;
30
- const ORIGINAL_SCALE = 1;
31
- const MINIFIED_SCALE = .96; // at "node_modules/react-native/Libraries/Pressability.js"
32
- // const DEFAULT_MIN_PRESS_DURATION = 130;
33
-
34
- const SCALE_EFFECT_PRESS_IN_DELAY = 130;
35
- const OPACITY_EFFECT_PRESS_IN_DELAY = 0;
36
-
37
- const startTimingAnimationWithDefaults = (value, toValue) => {
38
- _reactNative.Animated.timing(value, {
39
- toValue,
40
- duration: 150,
41
- useNativeDriver: _utils.isNotAndroid12
42
- }).start();
43
- };
44
-
45
- const getOpacityByDisabled = disabled => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;
46
-
47
- function ButtonBase(props) {
48
- const {
49
- children,
50
- disabled = false,
51
- disableThrottle = false,
52
- onPress,
53
- onPressOut,
54
- pressEffect = 'opacity',
55
- pressDelay: pressDelayOrNil,
56
- style: styleProp,
57
- throttleMillis = 650,
58
- ...otherProps
59
- } = props;
60
- const handlePress = (0, _hooks.useThrottle)({
61
- periodMillis: disableThrottle ? 0 : throttleMillis,
62
- callback: onPress
63
- });
64
- const opacity = (0, _hooks.useAnimatedValue)(getOpacityByDisabled(disabled));
65
- const scale = (0, _hooks.useAnimatedValue)(ORIGINAL_SCALE);
66
- (0, _react.useEffect)(() => {
67
- opacity.setValue(getOpacityByDisabled(disabled));
68
- }, [disabled, pressEffect]);
69
- const startScaleAnimation = (0, _react.useCallback)((pressIn, isHover) => {
70
- if (!isHover) {
71
- startTimingAnimationWithDefaults(scale, pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE);
72
- }
73
- }, []);
74
- const startOpacityAnimation = (0, _react.useCallback)(pressIn => {
75
- if (pressIn) {
76
- opacity.setValue(ACTIVE_OPACITY);
77
- } else {
78
- startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);
79
- }
80
- }, []);
81
- const startPressAnimation = (0, _react.useCallback)(function (pressIn) {
82
- let isHover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
83
-
84
- if (pressEffect === 'scale') {
85
- startScaleAnimation(pressIn, isHover);
86
- } else if (pressEffect === 'opacity') {
87
- startOpacityAnimation(pressIn, isHover);
88
- }
89
- }, [pressEffect]);
90
- const handlePressIn = (0, _react.useCallback)(() => {
91
- startPressAnimation(true, false);
92
- }, [startPressAnimation]);
93
- const handlePressOut = (0, _react.useCallback)(() => {
94
- onPressOut && onPressOut();
95
- startPressAnimation(false, false);
96
- }, [startPressAnimation, onPressOut]);
97
- const animatedStyle = {
98
- opacity,
99
- transform: [{
100
- scale
101
- }]
102
- };
103
- const defaultPressDelay = pressEffect === 'scale' ? SCALE_EFFECT_PRESS_IN_DELAY : OPACITY_EFFECT_PRESS_IN_DELAY;
104
- const pressDelay = pressDelayOrNil ?? defaultPressDelay;
105
- return /*#__PURE__*/_react.default.createElement(_animated.AnimatedPressable, _extends({
106
- disabled: disabled,
107
- onPress: handlePress,
108
- onPressIn: handlePressIn,
109
- onPressOut: handlePressOut,
110
- style: [animatedStyle, styleProp],
111
- unstable_pressDelay: pressDelay
112
- }, otherProps), typeof children !== 'function' ? _ref => {
113
- let {
114
- hovered
115
- } = _ref;
116
-
117
- if (hovered !== undefined && !disabled) {
118
- startPressAnimation(hovered, true);
119
- }
120
-
121
- return children;
122
- } : children);
123
- }
124
-
125
- ;
126
- //# sourceMappingURL=LegacyButtonBase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ORIGINAL_OPACITY","DISABLED_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","Animated","timing","duration","useNativeDriver","isNotAndroid12","start","getOpacityByDisabled","disabled","ButtonBase","props","children","disableThrottle","onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","useThrottle","periodMillis","callback","opacity","useAnimatedValue","scale","useEffect","setValue","startScaleAnimation","useCallback","pressIn","isHover","startOpacityAnimation","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["LegacyButtonBase.tsx"],"sourcesContent":["import React, { useCallback, useEffect } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nexport const DISABLED_OPACITY = .3;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\n\n// at \"node_modules/react-native/Libraries/Pressability.js\"\n// const DEFAULT_MIN_PRESS_DURATION = 130;\nconst SCALE_EFFECT_PRESS_IN_DELAY = 130;\nconst OPACITY_EFFECT_PRESS_IN_DELAY = 0;\n\ntype TimingAnimationValue = Animated.Value | Animated.ValueXY;\ntype TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];\n\nconst startTimingAnimationWithDefaults = (\n value: TimingAnimationValue,\n toValue: TimingAnimationToValue,\n) => {\n Animated.timing(value, {\n toValue,\n duration: 150,\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nconst getOpacityByDisabled = (disabled: boolean) => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(getOpacityByDisabled(disabled));\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n useEffect(() => {\n opacity.setValue(getOpacityByDisabled(disabled));\n }, [disabled, pressEffect]);\n\n const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {\n if (!isHover) {\n startTimingAnimationWithDefaults(\n scale,\n pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,\n );\n }\n }, []);\n\n const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {\n if (pressIn) {\n opacity.setValue(ACTIVE_OPACITY);\n } else {\n startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);\n }\n }, []);\n\n const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {\n if (pressEffect === 'scale') {\n startScaleAnimation(pressIn, isHover);\n } else if (pressEffect === 'opacity') {\n startOpacityAnimation(pressIn, isHover);\n }\n }, [pressEffect]);\n\n const handlePressIn = useCallback(() => {\n startPressAnimation(true, false);\n }, [startPressAnimation]);\n\n const handlePressOut = useCallback(() => {\n onPressOut && onPressOut();\n\n startPressAnimation(false, false);\n }, [startPressAnimation, onPressOut]);\n\n const animatedStyle = {\n opacity,\n transform: [{ scale }],\n };\n\n const defaultPressDelay = pressEffect === 'scale'\n ? SCALE_EFFECT_PRESS_IN_DELAY\n : OPACITY_EFFECT_PRESS_IN_DELAY;\n const pressDelay = pressDelayOrNil ?? defaultPressDelay;\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n style={[\n animatedStyle,\n styleProp,\n ]}\n unstable_pressDelay={pressDelay}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startPressAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":"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"}
@@ -1,106 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import React, { useCallback, useEffect } from 'react';
4
- import { Animated } from 'react-native';
5
- import { useAnimatedValue, useThrottle } from '../hooks';
6
- import { isNotAndroid12 } from '../utils';
7
- import { AnimatedPressable } from '../animated';
8
- export const ORIGINAL_OPACITY = 1;
9
- export const DISABLED_OPACITY = .3;
10
- const ACTIVE_OPACITY = .65;
11
- const ORIGINAL_SCALE = 1;
12
- const MINIFIED_SCALE = .96; // at "node_modules/react-native/Libraries/Pressability.js"
13
- // const DEFAULT_MIN_PRESS_DURATION = 130;
14
-
15
- const SCALE_EFFECT_PRESS_IN_DELAY = 130;
16
- const OPACITY_EFFECT_PRESS_IN_DELAY = 0;
17
-
18
- const startTimingAnimationWithDefaults = (value, toValue) => {
19
- Animated.timing(value, {
20
- toValue,
21
- duration: 150,
22
- useNativeDriver: isNotAndroid12
23
- }).start();
24
- };
25
-
26
- const getOpacityByDisabled = disabled => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;
27
-
28
- export default function ButtonBase(props) {
29
- const {
30
- children,
31
- disabled = false,
32
- disableThrottle = false,
33
- onPress,
34
- onPressOut,
35
- pressEffect = 'opacity',
36
- pressDelay: pressDelayOrNil,
37
- style: styleProp,
38
- throttleMillis = 650,
39
- ...otherProps
40
- } = props;
41
- const handlePress = useThrottle({
42
- periodMillis: disableThrottle ? 0 : throttleMillis,
43
- callback: onPress
44
- });
45
- const opacity = useAnimatedValue(getOpacityByDisabled(disabled));
46
- const scale = useAnimatedValue(ORIGINAL_SCALE);
47
- useEffect(() => {
48
- opacity.setValue(getOpacityByDisabled(disabled));
49
- }, [disabled, pressEffect]);
50
- const startScaleAnimation = useCallback((pressIn, isHover) => {
51
- if (!isHover) {
52
- startTimingAnimationWithDefaults(scale, pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE);
53
- }
54
- }, []);
55
- const startOpacityAnimation = useCallback(pressIn => {
56
- if (pressIn) {
57
- opacity.setValue(ACTIVE_OPACITY);
58
- } else {
59
- startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);
60
- }
61
- }, []);
62
- const startPressAnimation = useCallback(function (pressIn) {
63
- let isHover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
64
-
65
- if (pressEffect === 'scale') {
66
- startScaleAnimation(pressIn, isHover);
67
- } else if (pressEffect === 'opacity') {
68
- startOpacityAnimation(pressIn, isHover);
69
- }
70
- }, [pressEffect]);
71
- const handlePressIn = useCallback(() => {
72
- startPressAnimation(true, false);
73
- }, [startPressAnimation]);
74
- const handlePressOut = useCallback(() => {
75
- onPressOut && onPressOut();
76
- startPressAnimation(false, false);
77
- }, [startPressAnimation, onPressOut]);
78
- const animatedStyle = {
79
- opacity,
80
- transform: [{
81
- scale
82
- }]
83
- };
84
- const defaultPressDelay = pressEffect === 'scale' ? SCALE_EFFECT_PRESS_IN_DELAY : OPACITY_EFFECT_PRESS_IN_DELAY;
85
- const pressDelay = pressDelayOrNil ?? defaultPressDelay;
86
- return /*#__PURE__*/React.createElement(AnimatedPressable, _extends({
87
- disabled: disabled,
88
- onPress: handlePress,
89
- onPressIn: handlePressIn,
90
- onPressOut: handlePressOut,
91
- style: [animatedStyle, styleProp],
92
- unstable_pressDelay: pressDelay
93
- }, otherProps), typeof children !== 'function' ? _ref => {
94
- let {
95
- hovered
96
- } = _ref;
97
-
98
- if (hovered !== undefined && !disabled) {
99
- startPressAnimation(hovered, true);
100
- }
101
-
102
- return children;
103
- } : children);
104
- }
105
- ;
106
- //# sourceMappingURL=LegacyButtonBase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useCallback","useEffect","Animated","useAnimatedValue","useThrottle","isNotAndroid12","AnimatedPressable","ORIGINAL_OPACITY","DISABLED_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","timing","duration","useNativeDriver","start","getOpacityByDisabled","disabled","ButtonBase","props","children","disableThrottle","onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","periodMillis","callback","opacity","scale","setValue","startScaleAnimation","pressIn","isHover","startOpacityAnimation","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["LegacyButtonBase.tsx"],"sourcesContent":["import React, { useCallback, useEffect } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nexport const DISABLED_OPACITY = .3;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\n\n// at \"node_modules/react-native/Libraries/Pressability.js\"\n// const DEFAULT_MIN_PRESS_DURATION = 130;\nconst SCALE_EFFECT_PRESS_IN_DELAY = 130;\nconst OPACITY_EFFECT_PRESS_IN_DELAY = 0;\n\ntype TimingAnimationValue = Animated.Value | Animated.ValueXY;\ntype TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];\n\nconst startTimingAnimationWithDefaults = (\n value: TimingAnimationValue,\n toValue: TimingAnimationToValue,\n) => {\n Animated.timing(value, {\n toValue,\n duration: 150,\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nconst getOpacityByDisabled = (disabled: boolean) => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(getOpacityByDisabled(disabled));\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n useEffect(() => {\n opacity.setValue(getOpacityByDisabled(disabled));\n }, [disabled, pressEffect]);\n\n const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {\n if (!isHover) {\n startTimingAnimationWithDefaults(\n scale,\n pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,\n );\n }\n }, []);\n\n const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {\n if (pressIn) {\n opacity.setValue(ACTIVE_OPACITY);\n } else {\n startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);\n }\n }, []);\n\n const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {\n if (pressEffect === 'scale') {\n startScaleAnimation(pressIn, isHover);\n } else if (pressEffect === 'opacity') {\n startOpacityAnimation(pressIn, isHover);\n }\n }, [pressEffect]);\n\n const handlePressIn = useCallback(() => {\n startPressAnimation(true, false);\n }, [startPressAnimation]);\n\n const handlePressOut = useCallback(() => {\n onPressOut && onPressOut();\n\n startPressAnimation(false, false);\n }, [startPressAnimation, onPressOut]);\n\n const animatedStyle = {\n opacity,\n transform: [{ scale }],\n };\n\n const defaultPressDelay = pressEffect === 'scale'\n ? SCALE_EFFECT_PRESS_IN_DELAY\n : OPACITY_EFFECT_PRESS_IN_DELAY;\n const pressDelay = pressDelayOrNil ?? defaultPressDelay;\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n style={[\n animatedStyle,\n styleProp,\n ]}\n unstable_pressDelay={pressDelay}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startPressAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":"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"}
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import type ButtonBaseProps from './ButtonBaseProps';
3
- export declare const ORIGINAL_OPACITY = 1;
4
- export declare const DISABLED_OPACITY = 0.3;
5
- export default function ButtonBase(props: ButtonBaseProps): JSX.Element;