@fountain-ui/core 3.0.0-alpha.1 → 3.0.0-alpha.11

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 (455) hide show
  1. package/build/commonjs/Accordion/Accordion.js +4 -1
  2. package/build/commonjs/Accordion/Accordion.js.map +1 -1
  3. package/build/commonjs/Accordion/index.js +8 -0
  4. package/build/commonjs/Accordion/index.js.map +1 -1
  5. package/build/commonjs/Accordion/useVariantStyleMap.js +11 -10
  6. package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
  7. package/build/commonjs/AppBar/AppBar.js +6 -1
  8. package/build/commonjs/AppBar/AppBar.js.map +1 -1
  9. package/build/commonjs/AppBar/index.js +8 -0
  10. package/build/commonjs/AppBar/index.js.map +1 -1
  11. package/build/commonjs/Badge/index.js +26 -0
  12. package/build/commonjs/Badge/index.js.map +1 -1
  13. package/build/commonjs/Badge/useVariantStyleMap.js +2 -2
  14. package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -1
  15. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +1 -0
  16. package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  17. package/build/commonjs/Button/Button.js +15 -3
  18. package/build/commonjs/Button/Button.js.map +1 -1
  19. package/build/commonjs/Button/ButtonProps.js +7 -7
  20. package/build/commonjs/Button/ButtonProps.js.map +1 -1
  21. package/build/commonjs/Button/index.js +20 -0
  22. package/build/commonjs/Button/index.js.map +1 -1
  23. package/build/commonjs/Button/useVariantStyleMap.js +5 -7
  24. package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
  25. package/build/commonjs/ButtonBase/index.js +2 -2
  26. package/build/commonjs/ButtonBase/index.js.map +1 -1
  27. package/build/commonjs/Checkbox/Checkbox.js +5 -2
  28. package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
  29. package/build/commonjs/Checkbox/index.js +8 -0
  30. package/build/commonjs/Checkbox/index.js.map +1 -1
  31. package/build/commonjs/Checkbox/useVariantStyleMap.js +6 -2
  32. package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
  33. package/build/commonjs/Chip/Chip.js +21 -14
  34. package/build/commonjs/Chip/Chip.js.map +1 -1
  35. package/build/commonjs/Chip/ChipProps.js +3 -1
  36. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  37. package/build/commonjs/Chip/index.js +20 -0
  38. package/build/commonjs/Chip/index.js.map +1 -1
  39. package/build/commonjs/Chip/useChipStyle.js +31 -37
  40. package/build/commonjs/Chip/useChipStyle.js.map +1 -1
  41. package/build/commonjs/Dialog/Dialog.js +7 -8
  42. package/build/commonjs/Dialog/Dialog.js.map +1 -1
  43. package/build/commonjs/Dialog/DialogProps.js +1 -1
  44. package/build/commonjs/Dialog/DialogProps.js.map +1 -1
  45. package/build/commonjs/Dialog/index.js +8 -0
  46. package/build/commonjs/Dialog/index.js.map +1 -1
  47. package/build/commonjs/Dialog/useDialogSectionStyle.js +5 -5
  48. package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
  49. package/build/commonjs/Dialog/useDialogStyle.js +9 -8
  50. package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
  51. package/build/commonjs/DialogContent/DialogContent.js +1 -2
  52. package/build/commonjs/DialogContent/DialogContent.js.map +1 -1
  53. package/build/commonjs/DialogTitle/BackButton.js +47 -0
  54. package/build/commonjs/DialogTitle/BackButton.js.map +1 -0
  55. package/build/commonjs/DialogTitle/CloseButton.js +45 -0
  56. package/build/commonjs/DialogTitle/CloseButton.js.map +1 -0
  57. package/build/commonjs/DialogTitle/DialogTitle.js +11 -4
  58. package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
  59. package/build/commonjs/Divider/Divider.js +18 -10
  60. package/build/commonjs/Divider/Divider.js.map +1 -1
  61. package/build/commonjs/Divider/DividerProps.js +4 -4
  62. package/build/commonjs/Divider/DividerProps.js.map +1 -1
  63. package/build/commonjs/Divider/index.js +14 -0
  64. package/build/commonjs/Divider/index.js.map +1 -1
  65. package/build/commonjs/Empty/Empty.js +1 -2
  66. package/build/commonjs/Empty/Empty.js.map +1 -1
  67. package/build/commonjs/Flexbox/Flexbox.js +2 -0
  68. package/build/commonjs/Flexbox/Flexbox.js.map +1 -1
  69. package/build/commonjs/Flexbox/FlexboxProps.js.map +1 -1
  70. package/build/commonjs/IconButton/index.js +8 -0
  71. package/build/commonjs/IconButton/index.js.map +1 -1
  72. package/build/commonjs/ListItem/ListItem.js +47 -25
  73. package/build/commonjs/ListItem/ListItem.js.map +1 -1
  74. package/build/commonjs/ListItem/ListItemProps.js.map +1 -1
  75. package/build/commonjs/ListItemIcon/ListItemIcon.js +1 -2
  76. package/build/commonjs/ListItemIcon/ListItemIcon.js.map +1 -1
  77. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  78. package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  79. package/build/commonjs/ListItemText/ListItemText.js +20 -21
  80. package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
  81. package/build/commonjs/ListItemText/ListItemTextProps.js.map +1 -1
  82. package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
  83. package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
  84. package/build/commonjs/Pagination/NumberPagination.js +1 -1
  85. package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
  86. package/build/commonjs/Pagination/Pagination.js +2 -0
  87. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  88. package/build/commonjs/Pagination/PaginationProps.js +3 -1
  89. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  90. package/build/commonjs/Pagination/index.js +14 -0
  91. package/build/commonjs/Pagination/index.js.map +1 -1
  92. package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
  93. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  94. package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
  95. package/build/commonjs/Radio/Radio.js +6 -2
  96. package/build/commonjs/Radio/Radio.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/Snackbar/index.js +8 -0
  106. package/build/commonjs/Snackbar/index.js.map +1 -1
  107. package/build/commonjs/SnackbarContent/SnackbarContent.js +27 -12
  108. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  109. package/build/commonjs/SvgIcon/index.js +14 -0
  110. package/build/commonjs/SvgIcon/index.js.map +1 -1
  111. package/build/commonjs/Tab/useVariantStyleMap.js +3 -3
  112. package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
  113. package/build/commonjs/Tabs/Tabs.js +6 -1
  114. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  115. package/build/commonjs/Tabs/index.js +14 -0
  116. package/build/commonjs/Tabs/index.js.map +1 -1
  117. package/build/commonjs/Tabs/useTabsStyle.js +42 -0
  118. package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
  119. package/build/commonjs/TextField/TextField.js +1 -1
  120. package/build/commonjs/TextField/TextField.js.map +1 -1
  121. package/build/commonjs/TextField/index.js +8 -0
  122. package/build/commonjs/TextField/index.js.map +1 -1
  123. package/build/commonjs/TextField/useVariantStyleMap.js +2 -2
  124. package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
  125. package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
  126. package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
  127. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
  128. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  129. package/build/commonjs/Toolbar/BackButton/index.js +16 -0
  130. package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
  131. package/build/commonjs/Toolbar/Toolbar.js +8 -4
  132. package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
  133. package/build/commonjs/Toolbar/index.js +8 -0
  134. package/build/commonjs/Toolbar/index.js.map +1 -1
  135. package/build/commonjs/Tooltip/Beaks/index.js +32 -0
  136. package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
  137. package/build/commonjs/Tooltip/Tooltip.js +11 -24
  138. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  139. package/build/commonjs/Tooltip/index.js +39 -0
  140. package/build/commonjs/Tooltip/index.js.map +1 -1
  141. package/build/commonjs/Typography/Typography.js +9 -2
  142. package/build/commonjs/Typography/Typography.js.map +1 -1
  143. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  144. package/build/commonjs/Typography/index.js +8 -0
  145. package/build/commonjs/Typography/index.js.map +1 -1
  146. package/build/commonjs/hooks/useBreakpointUp.js +4 -1
  147. package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
  148. package/build/commonjs/hooks/useContentContainerStyle.js +21 -28
  149. package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
  150. package/build/commonjs/index.js +21 -0
  151. package/build/commonjs/index.js.map +1 -1
  152. package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
  153. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  154. package/build/commonjs/internal/icons/ChevronRight.js +4 -2
  155. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  156. package/build/commonjs/internal/icons/Close.js +4 -2
  157. package/build/commonjs/internal/icons/Close.js.map +1 -1
  158. package/build/module/Accordion/Accordion.js +4 -1
  159. package/build/module/Accordion/Accordion.js.map +1 -1
  160. package/build/module/Accordion/index.js +1 -0
  161. package/build/module/Accordion/index.js.map +1 -1
  162. package/build/module/Accordion/useVariantStyleMap.js +11 -10
  163. package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
  164. package/build/module/AppBar/AppBar.js +5 -1
  165. package/build/module/AppBar/AppBar.js.map +1 -1
  166. package/build/module/AppBar/index.js +1 -0
  167. package/build/module/AppBar/index.js.map +1 -1
  168. package/build/module/Badge/index.js +1 -0
  169. package/build/module/Badge/index.js.map +1 -1
  170. package/build/module/Badge/useVariantStyleMap.js +2 -2
  171. package/build/module/Badge/useVariantStyleMap.js.map +1 -1
  172. package/build/module/BottomSheetTitle/BottomSheetTitle.js +1 -0
  173. package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  174. package/build/module/Button/Button.js +16 -4
  175. package/build/module/Button/Button.js.map +1 -1
  176. package/build/module/Button/ButtonProps.js +3 -3
  177. package/build/module/Button/ButtonProps.js.map +1 -1
  178. package/build/module/Button/index.js +1 -0
  179. package/build/module/Button/index.js.map +1 -1
  180. package/build/module/Button/useVariantStyleMap.js +5 -7
  181. package/build/module/Button/useVariantStyleMap.js.map +1 -1
  182. package/build/module/ButtonBase/index.js +1 -1
  183. package/build/module/ButtonBase/index.js.map +1 -1
  184. package/build/module/Checkbox/Checkbox.js +5 -2
  185. package/build/module/Checkbox/Checkbox.js.map +1 -1
  186. package/build/module/Checkbox/index.js +1 -0
  187. package/build/module/Checkbox/index.js.map +1 -1
  188. package/build/module/Checkbox/useVariantStyleMap.js +6 -2
  189. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
  190. package/build/module/Chip/Chip.js +17 -13
  191. package/build/module/Chip/Chip.js.map +1 -1
  192. package/build/module/Chip/ChipProps.js +1 -0
  193. package/build/module/Chip/ChipProps.js.map +1 -1
  194. package/build/module/Chip/index.js +1 -0
  195. package/build/module/Chip/index.js.map +1 -1
  196. package/build/module/Chip/useChipStyle.js +31 -36
  197. package/build/module/Chip/useChipStyle.js.map +1 -1
  198. package/build/module/Dialog/Dialog.js +7 -8
  199. package/build/module/Dialog/Dialog.js.map +1 -1
  200. package/build/module/Dialog/DialogProps.js +1 -1
  201. package/build/module/Dialog/DialogProps.js.map +1 -1
  202. package/build/module/Dialog/index.js +1 -0
  203. package/build/module/Dialog/index.js.map +1 -1
  204. package/build/module/Dialog/useDialogSectionStyle.js +5 -5
  205. package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
  206. package/build/module/Dialog/useDialogStyle.js +9 -8
  207. package/build/module/Dialog/useDialogStyle.js.map +1 -1
  208. package/build/module/DialogContent/DialogContent.js +1 -2
  209. package/build/module/DialogContent/DialogContent.js.map +1 -1
  210. package/build/module/DialogTitle/BackButton.js +32 -0
  211. package/build/module/DialogTitle/BackButton.js.map +1 -0
  212. package/build/module/DialogTitle/CloseButton.js +30 -0
  213. package/build/module/DialogTitle/CloseButton.js.map +1 -0
  214. package/build/module/DialogTitle/DialogTitle.js +8 -3
  215. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  216. package/build/module/Divider/Divider.js +8 -1
  217. package/build/module/Divider/Divider.js.map +1 -1
  218. package/build/module/Divider/DividerProps.js +2 -2
  219. package/build/module/Divider/DividerProps.js.map +1 -1
  220. package/build/module/Divider/index.js +1 -0
  221. package/build/module/Divider/index.js.map +1 -1
  222. package/build/module/Empty/Empty.js +1 -2
  223. package/build/module/Empty/Empty.js.map +1 -1
  224. package/build/module/Flexbox/Flexbox.js +2 -0
  225. package/build/module/Flexbox/Flexbox.js.map +1 -1
  226. package/build/module/Flexbox/FlexboxProps.js.map +1 -1
  227. package/build/module/IconButton/index.js +1 -0
  228. package/build/module/IconButton/index.js.map +1 -1
  229. package/build/module/ListItem/ListItem.js +45 -27
  230. package/build/module/ListItem/ListItem.js.map +1 -1
  231. package/build/module/ListItem/ListItemProps.js.map +1 -1
  232. package/build/module/ListItemIcon/ListItemIcon.js +1 -2
  233. package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
  234. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  235. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  236. package/build/module/ListItemText/ListItemText.js +17 -19
  237. package/build/module/ListItemText/ListItemText.js.map +1 -1
  238. package/build/module/ListItemText/ListItemTextProps.js.map +1 -1
  239. package/build/module/ListSubheader/ListSubheader.js +1 -1
  240. package/build/module/ListSubheader/ListSubheader.js.map +1 -1
  241. package/build/module/Pagination/NumberPagination.js +1 -1
  242. package/build/module/Pagination/NumberPagination.js.map +1 -1
  243. package/build/module/Pagination/Pagination.js +2 -0
  244. package/build/module/Pagination/Pagination.js.map +1 -1
  245. package/build/module/Pagination/PaginationProps.js +1 -0
  246. package/build/module/Pagination/PaginationProps.js.map +1 -1
  247. package/build/module/Pagination/index.js +1 -0
  248. package/build/module/Pagination/index.js.map +1 -1
  249. package/build/module/PaginationItem/PaginationItem.js +28 -21
  250. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  251. package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
  252. package/build/module/Radio/Radio.js +5 -2
  253. package/build/module/Radio/Radio.js.map +1 -1
  254. package/build/module/Section/Section.js +19 -0
  255. package/build/module/Section/Section.js.map +1 -0
  256. package/build/module/Section/SectionProps.js +2 -0
  257. package/build/module/Section/SectionProps.js.map +1 -0
  258. package/build/module/Section/index.js +2 -0
  259. package/build/module/Section/index.js.map +1 -0
  260. package/build/module/ShadowView/ShadowView.native.js +4 -0
  261. package/build/module/ShadowView/ShadowView.native.js.map +1 -1
  262. package/build/module/Snackbar/index.js +1 -0
  263. package/build/module/Snackbar/index.js.map +1 -1
  264. package/build/module/SnackbarContent/SnackbarContent.js +27 -12
  265. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  266. package/build/module/SvgIcon/index.js +1 -0
  267. package/build/module/SvgIcon/index.js.map +1 -1
  268. package/build/module/Tab/useVariantStyleMap.js +3 -3
  269. package/build/module/Tab/useVariantStyleMap.js.map +1 -1
  270. package/build/module/Tabs/Tabs.js +5 -1
  271. package/build/module/Tabs/Tabs.js.map +1 -1
  272. package/build/module/Tabs/index.js +1 -0
  273. package/build/module/Tabs/index.js.map +1 -1
  274. package/build/module/Tabs/useTabsStyle.js +32 -0
  275. package/build/module/Tabs/useTabsStyle.js.map +1 -0
  276. package/build/module/TextField/TextField.js +1 -1
  277. package/build/module/TextField/TextField.js.map +1 -1
  278. package/build/module/TextField/index.js +1 -0
  279. package/build/module/TextField/index.js.map +1 -1
  280. package/build/module/TextField/useVariantStyleMap.js +2 -2
  281. package/build/module/TextField/useVariantStyleMap.js.map +1 -1
  282. package/build/module/Toolbar/BackButton/BackButton.js +32 -0
  283. package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
  284. package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
  285. package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  286. package/build/module/Toolbar/BackButton/index.js +2 -0
  287. package/build/module/Toolbar/BackButton/index.js.map +1 -0
  288. package/build/module/Toolbar/Toolbar.js +7 -3
  289. package/build/module/Toolbar/Toolbar.js.map +1 -1
  290. package/build/module/Toolbar/index.js +1 -0
  291. package/build/module/Toolbar/index.js.map +1 -1
  292. package/build/module/Tooltip/Beaks/index.js +4 -0
  293. package/build/module/Tooltip/Beaks/index.js.map +1 -1
  294. package/build/module/Tooltip/Tooltip.js +4 -16
  295. package/build/module/Tooltip/Tooltip.js.map +1 -1
  296. package/build/module/Tooltip/index.js +2 -0
  297. package/build/module/Tooltip/index.js.map +1 -1
  298. package/build/module/Typography/Typography.js +9 -2
  299. package/build/module/Typography/Typography.js.map +1 -1
  300. package/build/module/Typography/TypographyProps.js.map +1 -1
  301. package/build/module/Typography/index.js +1 -0
  302. package/build/module/Typography/index.js.map +1 -1
  303. package/build/module/hooks/useBreakpointUp.js +4 -1
  304. package/build/module/hooks/useBreakpointUp.js.map +1 -1
  305. package/build/module/hooks/useContentContainerStyle.js +23 -26
  306. package/build/module/hooks/useContentContainerStyle.js.map +1 -1
  307. package/build/module/index.js +2 -0
  308. package/build/module/index.js.map +1 -1
  309. package/build/module/internal/icons/ChevronLeft.js +4 -2
  310. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  311. package/build/module/internal/icons/ChevronRight.js +4 -2
  312. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  313. package/build/module/internal/icons/Close.js +4 -2
  314. package/build/module/internal/icons/Close.js.map +1 -1
  315. package/build/typescript/Accordion/index.d.ts +1 -0
  316. package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
  317. package/build/typescript/AppBar/index.d.ts +1 -0
  318. package/build/typescript/Badge/index.d.ts +2 -1
  319. package/build/typescript/Button/ButtonProps.d.ts +11 -6
  320. package/build/typescript/Button/index.d.ts +1 -0
  321. package/build/typescript/ButtonBase/index.d.ts +1 -1
  322. package/build/typescript/Checkbox/index.d.ts +1 -0
  323. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
  324. package/build/typescript/Chip/ChipProps.d.ts +11 -4
  325. package/build/typescript/Chip/index.d.ts +1 -0
  326. package/build/typescript/Chip/useChipStyle.d.ts +4 -3
  327. package/build/typescript/Dialog/DialogProps.d.ts +1 -6
  328. package/build/typescript/Dialog/index.d.ts +1 -0
  329. package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
  330. package/build/typescript/DialogTitle/BackButton.d.ts +6 -0
  331. package/build/typescript/DialogTitle/CloseButton.d.ts +6 -0
  332. package/build/typescript/DialogTitle/DialogTitle.d.ts +8 -1
  333. package/build/typescript/Divider/DividerProps.d.ts +4 -4
  334. package/build/typescript/Divider/index.d.ts +1 -0
  335. package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
  336. package/build/typescript/IconButton/index.d.ts +1 -0
  337. package/build/typescript/ListItem/ListItem.d.ts +1 -1
  338. package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
  339. package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
  340. package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
  341. package/build/typescript/Pagination/index.d.ts +2 -1
  342. package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
  343. package/build/typescript/Section/Section.d.ts +3 -0
  344. package/build/typescript/Section/SectionProps.d.ts +6 -0
  345. package/build/typescript/Section/index.d.ts +2 -0
  346. package/build/typescript/Snackbar/index.d.ts +1 -0
  347. package/build/typescript/SvgIcon/index.d.ts +1 -0
  348. package/build/typescript/Tabs/index.d.ts +1 -0
  349. package/build/typescript/Tabs/useTabsStyle.d.ts +7 -0
  350. package/build/typescript/TextField/index.d.ts +1 -0
  351. package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
  352. package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
  353. package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
  354. package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
  355. package/build/typescript/Toolbar/index.d.ts +1 -0
  356. package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
  357. package/build/typescript/Tooltip/index.d.ts +3 -1
  358. package/build/typescript/Typography/TypographyProps.d.ts +4 -0
  359. package/build/typescript/Typography/index.d.ts +1 -0
  360. package/build/typescript/hooks/useContentContainerStyle.d.ts +4 -8
  361. package/build/typescript/index.d.ts +2 -0
  362. package/package.json +3 -3
  363. package/src/Accordion/Accordion.tsx +4 -1
  364. package/src/Accordion/index.ts +1 -0
  365. package/src/Accordion/useVariantStyleMap.ts +12 -10
  366. package/src/AppBar/AppBar.tsx +4 -0
  367. package/src/AppBar/index.ts +1 -0
  368. package/src/Badge/index.ts +12 -1
  369. package/src/Badge/useVariantStyleMap.ts +2 -2
  370. package/src/BottomSheetTitle/BottomSheetTitle.tsx +1 -0
  371. package/src/Button/Button.tsx +19 -4
  372. package/src/Button/ButtonProps.ts +12 -6
  373. package/src/Button/index.ts +1 -0
  374. package/src/Button/useVariantStyleMap.ts +3 -7
  375. package/src/ButtonBase/index.ts +1 -1
  376. package/src/Checkbox/Checkbox.tsx +12 -9
  377. package/src/Checkbox/index.ts +1 -0
  378. package/src/Checkbox/useVariantStyleMap.ts +6 -1
  379. package/src/Chip/Chip.tsx +20 -13
  380. package/src/Chip/ChipProps.ts +13 -4
  381. package/src/Chip/index.ts +1 -0
  382. package/src/Chip/useChipStyle.ts +36 -34
  383. package/src/Dialog/Dialog.tsx +7 -8
  384. package/src/Dialog/DialogProps.ts +1 -7
  385. package/src/Dialog/index.ts +1 -0
  386. package/src/Dialog/useDialogSectionStyle.ts +4 -4
  387. package/src/Dialog/useDialogStyle.ts +9 -7
  388. package/src/DialogContent/DialogContent.tsx +1 -2
  389. package/src/DialogTitle/BackButton.tsx +44 -0
  390. package/src/DialogTitle/CloseButton.tsx +42 -0
  391. package/src/DialogTitle/DialogTitle.tsx +9 -1
  392. package/src/Divider/Divider.tsx +6 -1
  393. package/src/Divider/DividerProps.ts +4 -4
  394. package/src/Divider/index.ts +1 -0
  395. package/src/Empty/Empty.tsx +1 -2
  396. package/src/Flexbox/Flexbox.tsx +2 -0
  397. package/src/Flexbox/FlexboxProps.ts +5 -0
  398. package/src/IconButton/index.ts +1 -0
  399. package/src/ListItem/ListItem.tsx +69 -28
  400. package/src/ListItem/ListItemProps.ts +5 -0
  401. package/src/ListItemIcon/ListItemIcon.tsx +1 -2
  402. package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
  403. package/src/ListItemText/ListItemText.tsx +20 -28
  404. package/src/ListItemText/ListItemTextProps.ts +2 -10
  405. package/src/ListSubheader/ListSubheader.tsx +1 -1
  406. package/src/Pagination/NumberPagination.tsx +1 -1
  407. package/src/Pagination/Pagination.tsx +3 -2
  408. package/src/Pagination/PaginationProps.ts +15 -0
  409. package/src/Pagination/index.ts +2 -1
  410. package/src/PaginationItem/PaginationItem.tsx +31 -24
  411. package/src/PaginationItem/PaginationItemProps.ts +7 -0
  412. package/src/Radio/Radio.tsx +8 -2
  413. package/src/Section/Section.tsx +26 -0
  414. package/src/Section/SectionProps.ts +6 -0
  415. package/src/Section/index.ts +2 -0
  416. package/src/ShadowView/ShadowView.native.tsx +4 -0
  417. package/src/Snackbar/index.ts +1 -0
  418. package/src/SnackbarContent/SnackbarContent.tsx +37 -18
  419. package/src/SvgIcon/index.ts +1 -0
  420. package/src/Tab/useVariantStyleMap.ts +3 -3
  421. package/src/Tabs/Tabs.tsx +4 -0
  422. package/src/Tabs/index.ts +1 -0
  423. package/src/Tabs/useTabsStyle.ts +38 -0
  424. package/src/TextField/TextField.tsx +1 -1
  425. package/src/TextField/index.tsx +1 -0
  426. package/src/TextField/useVariantStyleMap.ts +2 -2
  427. package/src/Toolbar/BackButton/BackButton.tsx +42 -0
  428. package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
  429. package/src/Toolbar/BackButton/index.ts +2 -0
  430. package/src/Toolbar/Toolbar.tsx +6 -1
  431. package/src/Toolbar/index.ts +1 -0
  432. package/src/Tooltip/Beaks/index.ts +4 -0
  433. package/src/Tooltip/Tooltip.tsx +5 -16
  434. package/src/Tooltip/index.ts +3 -1
  435. package/src/Typography/Typography.tsx +3 -1
  436. package/src/Typography/TypographyProps.ts +5 -0
  437. package/src/Typography/index.ts +1 -0
  438. package/src/hooks/useBreakpointUp.ts +3 -1
  439. package/src/hooks/useContentContainerStyle.ts +26 -34
  440. package/src/index.ts +3 -0
  441. package/src/internal/icons/ChevronLeft.tsx +4 -1
  442. package/src/internal/icons/ChevronRight.tsx +4 -1
  443. package/src/internal/icons/Close.tsx +4 -1
  444. package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
  445. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
  446. package/build/commonjs/TextField/InputLabel.js +0 -163
  447. package/build/commonjs/TextField/InputLabel.js.map +0 -1
  448. package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
  449. package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
  450. package/build/module/TextField/InputLabel.js +0 -149
  451. package/build/module/TextField/InputLabel.js.map +0 -1
  452. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
  453. package/build/typescript/TextField/InputLabel.d.ts +0 -33
  454. package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
  455. package/src/TextField/InputLabel.tsx +0 -234
@@ -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
  );
@@ -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
  );
@@ -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":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAOO,MAAMA,gBAAgB,GAAG,CAAzB;;AACA,MAAMC,gBAAgB,GAAG,EAAzB;;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB,C,CAEA;AACA;;AACA,MAAMC,2BAA2B,GAAG,GAApC;AACA,MAAMC,6BAA6B,GAAG,CAAtC;;AAKA,MAAMC,gCAAgC,GAAG,CACrCC,KADqC,EAErCC,OAFqC,KAGpC;EACDC,qBAAA,CAASC,MAAT,CAAgBH,KAAhB,EAAuB;IACnBC,OADmB;IAEnBG,QAAQ,EAAE,GAFS;IAGnBC,eAAe,EAAEC;EAHE,CAAvB,EAIGC,KAJH;AAKH,CATD;;AAWA,MAAMC,oBAAoB,GAAIC,QAAD,IAAuBA,QAAQ,GAAGhB,gBAAH,GAAsBD,gBAAlF;;AAEe,SAASkB,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFH,QAAQ,GAAG,KAFT;IAGFI,eAAe,GAAG,KAHhB;IAIFC,OAJE;IAKFC,UALE;IAMFC,WAAW,GAAG,SANZ;IAOFC,UAAU,EAAEC,eAPV;IAQFC,KAAK,EAAEC,SARL;IASFC,cAAc,GAAG,GATf;IAUF,GAAGC;EAVD,IAWFX,KAXJ;EAaA,MAAMY,WAAW,GAAG,IAAAC,kBAAA,EAAY;IAC5BC,YAAY,EAAEZ,eAAe,GAAG,CAAH,GAAOQ,cADR;IAE5BK,QAAQ,EAAEZ;EAFkB,CAAZ,CAApB;EAKA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D,CAFmB,CAAtB;EAIA,MAAME,cAAc,GAAG,IAAAN,kBAAA,EAAY,MAAM;IACrClB,UAAU,IAAIA,UAAU,EAAxB;IAEAsB,mBAAmB,CAAC,KAAD,EAAQ,KAAR,CAAnB;EACH,CAJsB,EAIpB,CAACA,mBAAD,EAAsBtB,UAAtB,CAJoB,CAAvB;EAMA,MAAMyB,aAAa,GAAG;IAClBb,OADkB;IAElBc,SAAS,EAAE,CAAC;MAAEZ;IAAF,CAAD;EAFO,CAAtB;EAKA,MAAMa,iBAAiB,GAAG1B,WAAW,KAAK,OAAhB,GACpBnB,2BADoB,GAEpBC,6BAFN;EAGA,MAAMmB,UAAU,GAAGC,eAAe,IAAIwB,iBAAtC;EAEA,oBACI,6BAAC,2BAAD;IACI,QAAQ,EAAEjC,QADd;IAEI,OAAO,EAAEc,WAFb;IAGI,SAAS,EAAEe,aAHf;IAII,UAAU,EAAEC,cAJhB;IAKI,KAAK,EAAE,CACHC,aADG,EAEHpB,SAFG,CALX;IASI,mBAAmB,EAAEH;EATzB,GAUQK,UAVR,GAYK,OAAOV,QAAP,KAAoB,UAApB,GACG,QAAiB;IAAA,IAAhB;MAAE+B;IAAF,CAAgB;;IACb,IAAIA,OAAO,KAAKC,SAAZ,IAAyB,CAACnC,QAA9B,EAAwC;MACpC4B,mBAAmB,CAACM,OAAD,EAAU,IAAV,CAAnB;IACH;;IAED,OAAO/B,QAAP;EACH,CAPJ,GAQGA,QApBR,CADJ;AAwBH;;AAAA"}
@@ -1,163 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _reactNative = require("react-native");
11
-
12
- var _styles = require("../styles");
13
-
14
- var _usePaperStyles = _interopRequireDefault(require("../Paper/usePaperStyles"));
15
-
16
- var _utils = require("./utils");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- const useStyles = function () {
21
- return {
22
- background: {
23
- position: 'absolute',
24
- top: 6,
25
- left: 10,
26
- bottom: 0,
27
- right: 0,
28
- width: 8,
29
- height: 4
30
- },
31
- backgroundText: {
32
- position: 'absolute',
33
- left: 18,
34
- paddingHorizontal: 0,
35
- color: 'transparent'
36
- },
37
- placeholder: {
38
- position: 'absolute',
39
- left: 0,
40
- paddingHorizontal: _utils.inputPaddingHorizontal
41
- }
42
- };
43
- };
44
-
45
- const InputLabel = props => {
46
- const {
47
- activeColor,
48
- animatedError,
49
- animatedLabel,
50
- error = false,
51
- errorColor,
52
- focused,
53
- fontSize,
54
- hasActiveOutline,
55
- label,
56
- labelLayout,
57
- labelScale,
58
- labelTranslateX,
59
- labelTranslateY,
60
- onLayoutAnimatedText,
61
- paddingOffset,
62
- placeholderColor,
63
- placeholderOpacity,
64
- topPosition,
65
- value
66
- } = props;
67
- const theme = (0, _styles.useTheme)();
68
- const styles = useStyles();
69
- const paperStyles = (0, _usePaperStyles.default)();
70
- const backgroundStyle = {
71
- backgroundColor: (paperStyles === null || paperStyles === void 0 ? void 0 : paperStyles.backgroundColor) ?? theme.palette.background.default
72
- };
73
- const hasFocus = hasActiveOutline || value;
74
- const opacity = animatedLabel.interpolate({
75
- inputRange: [0, 1],
76
- outputRange: [hasFocus ? 1 : 0, 0]
77
- });
78
- const labelTranslationX = {
79
- transform: [{
80
- translateX: animatedLabel.interpolate({
81
- inputRange: [0, 1],
82
- outputRange: [labelTranslateX, 0 || 0]
83
- })
84
- }]
85
- };
86
- const labelTextFontStyle = (0, _styles.createFontStyle)(theme, {
87
- selector: typo => typo.caption2
88
- });
89
- const labelStyle = {
90
- fontSize,
91
- transform: [{
92
- translateX: animatedError.interpolate({
93
- inputRange: [0, 0.5, 1],
94
- outputRange: [0, value && error ? 4 : 0, 0]
95
- })
96
- }, {
97
- translateY: animatedLabel.interpolate({
98
- inputRange: [0, 1],
99
- outputRange: [labelTranslateY, 0]
100
- })
101
- }, {
102
- scale: animatedLabel.interpolate({
103
- inputRange: [0, 1],
104
- outputRange: [labelScale, 1]
105
- })
106
- }]
107
- };
108
- return label ? /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
109
- pointerEvents: 'none',
110
- style: [_reactNative.StyleSheet.absoluteFill, {
111
- opacity: value || focused ? labelLayout.measured ? 1 : 0 : 1
112
- }, labelTranslationX]
113
- }, [/*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
114
- key: 'labelBackground-view',
115
- pointerEvents: 'none',
116
- style: [styles.background, backgroundStyle, {
117
- opacity,
118
- transform: [{
119
- translateX: animatedLabel.interpolate({
120
- inputRange: [0, 1],
121
- outputRange: [-labelTranslateX, 0]
122
- })
123
- }]
124
- }]
125
- }), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.Text, {
126
- key: 'labelBackground-text',
127
- style: [labelTextFontStyle, styles.placeholder, styles.backgroundText, backgroundStyle, labelStyle, {
128
- top: topPosition + 1,
129
- opacity,
130
- transform: [...labelStyle.transform, {
131
- scaleY: animatedLabel.interpolate({
132
- inputRange: [0, 1],
133
- outputRange: [0.2, 1]
134
- })
135
- }]
136
- }],
137
- numberOfLines: 1
138
- }, label)], /*#__PURE__*/_react.default.createElement(_reactNative.Animated.Text, {
139
- onLayout: onLayoutAnimatedText,
140
- style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
141
- textAlign: 'left',
142
- top: topPosition,
143
- color: error && errorColor ? errorColor : activeColor,
144
- opacity: animatedLabel.interpolate({
145
- inputRange: [0, 1],
146
- outputRange: [hasActiveOutline ? 1 : 0, 0]
147
- })
148
- }],
149
- numberOfLines: 1
150
- }, label), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.Text, {
151
- style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
152
- textAlign: 'left',
153
- top: topPosition,
154
- color: error && errorColor ? errorColor : placeholderColor,
155
- opacity: placeholderOpacity
156
- }],
157
- numberOfLines: 1
158
- }, label)) : null;
159
- };
160
-
161
- var _default = InputLabel;
162
- exports.default = _default;
163
- //# sourceMappingURL=InputLabel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useStyles","background","position","top","left","bottom","right","width","height","backgroundText","paddingHorizontal","color","placeholder","inputPaddingHorizontal","InputLabel","props","activeColor","animatedError","animatedLabel","error","errorColor","focused","fontSize","hasActiveOutline","label","labelLayout","labelScale","labelTranslateX","labelTranslateY","onLayoutAnimatedText","paddingOffset","placeholderColor","placeholderOpacity","topPosition","value","theme","useTheme","styles","paperStyles","usePaperStyles","backgroundStyle","backgroundColor","palette","default","hasFocus","opacity","interpolate","inputRange","outputRange","labelTranslationX","transform","translateX","labelTextFontStyle","createFontStyle","selector","typo","caption2","labelStyle","translateY","scale","StyleSheet","absoluteFill","measured","scaleY","textAlign"],"sources":["InputLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport usePaperStyles from '../Paper/usePaperStyles';\nimport { inputPaddingHorizontal } from './utils';\n\ninterface LabelProps {\n activeColor: string;\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n error?: boolean;\n errorColor?: string;\n focused?: boolean;\n fontSize?: number;\n hasActiveOutline?: boolean;\n label?: string;\n labelLayout: { measured: boolean; width: number; height: number };\n labelScale: number;\n labelTranslateX: number;\n labelTranslateY: number;\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n paddingOffset?: { paddingLeft: number; paddingRight: number };\n placeholder?: string;\n placeholderColor?: string;\n placeholderOpacity: number | Animated.AnimatedInterpolation;\n topPosition: number;\n value?: string;\n}\n\ntype InputLabelStyles = NamedStylesStringUnion<'background' | 'backgroundText' | 'placeholder'>;\n\nconst useStyles: UseStyles<InputLabelStyles> = function (): InputLabelStyles {\n return {\n background: {\n position: 'absolute',\n top: 6,\n left: 10,\n bottom: 0,\n right: 0,\n width: 8,\n height: 4,\n },\n backgroundText: {\n position: 'absolute',\n left: 18,\n paddingHorizontal: 0,\n color: 'transparent',\n },\n placeholder: {\n position: 'absolute',\n left: 0,\n paddingHorizontal: inputPaddingHorizontal,\n },\n };\n};\n\nconst InputLabel = (props: LabelProps) => {\n const {\n activeColor,\n animatedError,\n animatedLabel,\n error = false,\n errorColor,\n focused,\n fontSize,\n hasActiveOutline,\n label,\n labelLayout,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n paddingOffset,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const paperStyles = usePaperStyles();\n\n const backgroundStyle = {\n backgroundColor: paperStyles?.backgroundColor ?? theme.palette.background.default,\n };\n\n const hasFocus = hasActiveOutline || value;\n const opacity = animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasFocus ? 1 : 0, 0],\n });\n\n const labelTranslationX = {\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateX, 0 || 0],\n }),\n },\n ],\n };\n\n const labelTextFontStyle = createFontStyle(theme, { selector: (typo) => typo.caption2 });\n\n const labelStyle = {\n fontSize,\n transform: [\n {\n translateX: animatedError.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [0, value && error ? 4 : 0, 0],\n }),\n },\n {\n translateY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateY, 0],\n }),\n },\n {\n scale: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelScale, 1],\n }),\n },\n ],\n };\n\n return (label ? (\n <Animated.View\n pointerEvents={'none'}\n style={[\n StyleSheet.absoluteFill,\n {\n opacity: value || focused ? (labelLayout.measured ? 1 : 0) : 1,\n },\n labelTranslationX,\n ]}\n >\n {[\n <Animated.View\n key={'labelBackground-view'}\n pointerEvents={'none'}\n style={[\n styles.background,\n backgroundStyle,\n {\n opacity,\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [-labelTranslateX, 0],\n }),\n },\n ],\n },\n ]}\n />,\n <Animated.Text\n key={'labelBackground-text'}\n style={[\n labelTextFontStyle,\n styles.placeholder,\n styles.backgroundText,\n backgroundStyle,\n labelStyle,\n {\n top: topPosition + 1,\n opacity,\n transform: [\n ...labelStyle.transform,\n {\n scaleY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1],\n }),\n },\n ],\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>,\n ]}\n <Animated.Text\n onLayout={onLayoutAnimatedText}\n style={[\n styles.placeholder,\n labelTextFontStyle,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : activeColor,\n opacity: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 1 : 0, 0],\n }),\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n <Animated.Text\n style={[\n styles.placeholder,\n labelTextFontStyle,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : placeholderColor,\n opacity: placeholderOpacity,\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n </Animated.View>\n ) : null);\n};\n\nexport default InputLabel;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;AA2BA,MAAMA,SAAsC,GAAG,YAA8B;EACzE,OAAO;IACHC,UAAU,EAAE;MACRC,QAAQ,EAAE,UADF;MAERC,GAAG,EAAE,CAFG;MAGRC,IAAI,EAAE,EAHE;MAIRC,MAAM,EAAE,CAJA;MAKRC,KAAK,EAAE,CALC;MAMRC,KAAK,EAAE,CANC;MAORC,MAAM,EAAE;IAPA,CADT;IAUHC,cAAc,EAAE;MACZP,QAAQ,EAAE,UADE;MAEZE,IAAI,EAAE,EAFM;MAGZM,iBAAiB,EAAE,CAH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gB,GAAG,CAAH,GAAO,CAAxB,EAA2B,CAA3B;MAFkB,CAA1B;IAJb,CALG,CAFX;IAiBI,aAAa,EAAE;EAjBnB,GAmBKC,KAnBL,CAzDJ,eA8EI,6BAAC,qBAAD,CAAU,IAAV;IACI,KAAK,EAAE,CACHa,MAAM,CAACzB,WADJ,EAEHwC,kBAFG,EAGHK,UAHG,EAIH3B,aAJG,EAKH;MACIkC,SAAS,EAAE,MADf;MAEI7D,GAAG,EAAE8B,WAFT;MAGItB,KAAK,EAAEQ,KAAK,IAAIC,UAAT,GAAsBA,UAAtB,GAAmCW,gBAH9C;MAIIc,OAAO,EAAEb;IAJb,CALG,CADX;IAaI,aAAa,EAAE;EAbnB,GAeKR,KAfL,CA9EJ,CADS,GAiGT,IAjGJ;AAkGH,CA9KD;;eAgLeV,U"}
@@ -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":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,SAA7B,QAA8C,OAA9C;AACA,SAASC,QAAT,QAAyB,cAAzB;AACA,SAASC,gBAAT,EAA2BC,WAA3B,QAA8C,UAA9C;AACA,SAASC,cAAT,QAA+B,UAA/B;AACA,SAASC,iBAAT,QAAkC,aAAlC;AAOA,OAAO,MAAMC,gBAAgB,GAAG,CAAzB;AACP,OAAO,MAAMC,gBAAgB,GAAG,EAAzB;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB,C,CAEA;AACA;;AACA,MAAMC,2BAA2B,GAAG,GAApC;AACA,MAAMC,6BAA6B,GAAG,CAAtC;;AAKA,MAAMC,gCAAgC,GAAG,CACrCC,KADqC,EAErCC,OAFqC,KAGpC;EACDd,QAAQ,CAACe,MAAT,CAAgBF,KAAhB,EAAuB;IACnBC,OADmB;IAEnBE,QA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GACG,QAAiB;IAAA,IAAhB;MAAE2B;IAAF,CAAgB;;IACb,IAAIA,OAAO,KAAKC,SAAZ,IAAyB,CAAC/B,QAA9B,EAAwC;MACpCwB,mBAAmB,CAACM,OAAD,EAAU,IAAV,CAAnB;IACH;;IAED,OAAO3B,QAAP;EACH,CAPJ,GAQGA,QApBR,CADJ;AAwBH;AAAA"}
@@ -1,149 +0,0 @@
1
- import React from 'react';
2
- import { Animated, StyleSheet } from 'react-native';
3
- import { createFontStyle, useTheme } from '../styles';
4
- import usePaperStyles from '../Paper/usePaperStyles';
5
- import { inputPaddingHorizontal } from './utils';
6
-
7
- const useStyles = function () {
8
- return {
9
- background: {
10
- position: 'absolute',
11
- top: 6,
12
- left: 10,
13
- bottom: 0,
14
- right: 0,
15
- width: 8,
16
- height: 4
17
- },
18
- backgroundText: {
19
- position: 'absolute',
20
- left: 18,
21
- paddingHorizontal: 0,
22
- color: 'transparent'
23
- },
24
- placeholder: {
25
- position: 'absolute',
26
- left: 0,
27
- paddingHorizontal: inputPaddingHorizontal
28
- }
29
- };
30
- };
31
-
32
- const InputLabel = props => {
33
- const {
34
- activeColor,
35
- animatedError,
36
- animatedLabel,
37
- error = false,
38
- errorColor,
39
- focused,
40
- fontSize,
41
- hasActiveOutline,
42
- label,
43
- labelLayout,
44
- labelScale,
45
- labelTranslateX,
46
- labelTranslateY,
47
- onLayoutAnimatedText,
48
- paddingOffset,
49
- placeholderColor,
50
- placeholderOpacity,
51
- topPosition,
52
- value
53
- } = props;
54
- const theme = useTheme();
55
- const styles = useStyles();
56
- const paperStyles = usePaperStyles();
57
- const backgroundStyle = {
58
- backgroundColor: (paperStyles === null || paperStyles === void 0 ? void 0 : paperStyles.backgroundColor) ?? theme.palette.background.default
59
- };
60
- const hasFocus = hasActiveOutline || value;
61
- const opacity = animatedLabel.interpolate({
62
- inputRange: [0, 1],
63
- outputRange: [hasFocus ? 1 : 0, 0]
64
- });
65
- const labelTranslationX = {
66
- transform: [{
67
- translateX: animatedLabel.interpolate({
68
- inputRange: [0, 1],
69
- outputRange: [labelTranslateX, 0 || 0]
70
- })
71
- }]
72
- };
73
- const labelTextFontStyle = createFontStyle(theme, {
74
- selector: typo => typo.caption2
75
- });
76
- const labelStyle = {
77
- fontSize,
78
- transform: [{
79
- translateX: animatedError.interpolate({
80
- inputRange: [0, 0.5, 1],
81
- outputRange: [0, value && error ? 4 : 0, 0]
82
- })
83
- }, {
84
- translateY: animatedLabel.interpolate({
85
- inputRange: [0, 1],
86
- outputRange: [labelTranslateY, 0]
87
- })
88
- }, {
89
- scale: animatedLabel.interpolate({
90
- inputRange: [0, 1],
91
- outputRange: [labelScale, 1]
92
- })
93
- }]
94
- };
95
- return label ? /*#__PURE__*/React.createElement(Animated.View, {
96
- pointerEvents: 'none',
97
- style: [StyleSheet.absoluteFill, {
98
- opacity: value || focused ? labelLayout.measured ? 1 : 0 : 1
99
- }, labelTranslationX]
100
- }, [/*#__PURE__*/React.createElement(Animated.View, {
101
- key: 'labelBackground-view',
102
- pointerEvents: 'none',
103
- style: [styles.background, backgroundStyle, {
104
- opacity,
105
- transform: [{
106
- translateX: animatedLabel.interpolate({
107
- inputRange: [0, 1],
108
- outputRange: [-labelTranslateX, 0]
109
- })
110
- }]
111
- }]
112
- }), /*#__PURE__*/React.createElement(Animated.Text, {
113
- key: 'labelBackground-text',
114
- style: [labelTextFontStyle, styles.placeholder, styles.backgroundText, backgroundStyle, labelStyle, {
115
- top: topPosition + 1,
116
- opacity,
117
- transform: [...labelStyle.transform, {
118
- scaleY: animatedLabel.interpolate({
119
- inputRange: [0, 1],
120
- outputRange: [0.2, 1]
121
- })
122
- }]
123
- }],
124
- numberOfLines: 1
125
- }, label)], /*#__PURE__*/React.createElement(Animated.Text, {
126
- onLayout: onLayoutAnimatedText,
127
- style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
128
- textAlign: 'left',
129
- top: topPosition,
130
- color: error && errorColor ? errorColor : activeColor,
131
- opacity: animatedLabel.interpolate({
132
- inputRange: [0, 1],
133
- outputRange: [hasActiveOutline ? 1 : 0, 0]
134
- })
135
- }],
136
- numberOfLines: 1
137
- }, label), /*#__PURE__*/React.createElement(Animated.Text, {
138
- style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
139
- textAlign: 'left',
140
- top: topPosition,
141
- color: error && errorColor ? errorColor : placeholderColor,
142
- opacity: placeholderOpacity
143
- }],
144
- numberOfLines: 1
145
- }, label)) : null;
146
- };
147
-
148
- export default InputLabel;
149
- //# sourceMappingURL=InputLabel.js.map