@fountain-ui/core 3.0.0-alpha.3 → 3.0.0-alpha.31

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 (481) hide show
  1. package/build/commonjs/Accordion/Accordion.js +15 -8
  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 +7 -2
  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 +5 -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/Pagination/NumberPagination.js +4 -2
  81. package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
  82. package/build/commonjs/Pagination/Pagination.js +2 -0
  83. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  84. package/build/commonjs/Pagination/PaginationProps.js +3 -1
  85. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  86. package/build/commonjs/Pagination/index.js +6 -0
  87. package/build/commonjs/Pagination/index.js.map +1 -1
  88. package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
  89. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  90. package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
  91. package/build/commonjs/Radio/Radio.js +11 -4
  92. package/build/commonjs/Radio/Radio.js.map +1 -1
  93. package/build/commonjs/RadioGroup/RadioGroup.js +2 -27
  94. package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
  95. package/build/commonjs/Section/Section.js +32 -0
  96. package/build/commonjs/Section/Section.js.map +1 -0
  97. package/build/commonjs/Section/SectionProps.js +2 -0
  98. package/build/commonjs/Section/SectionProps.js.map +1 -0
  99. package/build/commonjs/Section/index.js +16 -0
  100. package/build/commonjs/Section/index.js.map +1 -0
  101. package/build/commonjs/ShadowView/ShadowView.native.js +4 -0
  102. package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -1
  103. package/build/commonjs/SnackbarContent/SnackbarContent.js +26 -9
  104. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  105. package/build/commonjs/Tab/Tab.js +21 -19
  106. package/build/commonjs/Tab/Tab.js.map +1 -1
  107. package/build/commonjs/Tab/TabProps.js +4 -2
  108. package/build/commonjs/Tab/TabProps.js.map +1 -1
  109. package/build/commonjs/Tab/index.js +14 -0
  110. package/build/commonjs/Tab/index.js.map +1 -1
  111. package/build/commonjs/Tab/useVariantStyleMap.js +59 -18
  112. package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
  113. package/build/commonjs/TabBase/TabBase.js +1 -8
  114. package/build/commonjs/TabBase/TabBase.js.map +1 -1
  115. package/build/commonjs/TabBase/TabBaseProps.js.map +1 -1
  116. package/build/commonjs/Tabs/Tabs.js +23 -7
  117. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  118. package/build/commonjs/Tabs/TabsProps.js.map +1 -1
  119. package/build/commonjs/Tabs/index.js.map +1 -1
  120. package/build/commonjs/Tabs/useTabsStyle.js +80 -0
  121. package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
  122. package/build/commonjs/TextField/TextField.js +48 -12
  123. package/build/commonjs/TextField/TextField.js.map +1 -1
  124. package/build/commonjs/TextField/useVariantStyleMap.js +29 -29
  125. package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
  126. package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
  127. package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
  128. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
  129. package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  130. package/build/commonjs/Toolbar/BackButton/index.js +16 -0
  131. package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
  132. package/build/commonjs/Toolbar/Toolbar.js +8 -4
  133. package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
  134. package/build/commonjs/Tooltip/Beaks/index.js +32 -0
  135. package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
  136. package/build/commonjs/Tooltip/Tooltip.js +11 -18
  137. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  138. package/build/commonjs/Tooltip/index.js +19 -0
  139. package/build/commonjs/Tooltip/index.js.map +1 -1
  140. package/build/commonjs/Typography/Typography.js +9 -2
  141. package/build/commonjs/Typography/Typography.js.map +1 -1
  142. package/build/commonjs/Typography/TypographyProps.js.map +1 -1
  143. package/build/commonjs/hooks/useBreakpointUp.js +4 -1
  144. package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
  145. package/build/commonjs/hooks/useCollapsibleAppBar.js +3 -10
  146. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  147. package/build/commonjs/hooks/useContentContainerStyle.js +39 -25
  148. package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
  149. package/build/commonjs/hooks/useFadeInAppBar.js +2 -2
  150. package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
  151. package/build/commonjs/index.js +21 -0
  152. package/build/commonjs/index.js.map +1 -1
  153. package/build/commonjs/internal/icons/AppBarChevronLeft.js +23 -0
  154. package/build/commonjs/internal/icons/AppBarChevronLeft.js.map +1 -0
  155. package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
  156. package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
  157. package/build/commonjs/internal/icons/ChevronRight.js +4 -2
  158. package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
  159. package/build/commonjs/internal/icons/ChipClose.js +23 -0
  160. package/build/commonjs/internal/icons/ChipClose.js.map +1 -0
  161. package/build/commonjs/internal/icons/Clear.js +3 -3
  162. package/build/commonjs/internal/icons/Clear.js.map +1 -1
  163. package/build/commonjs/internal/icons/Close.js +4 -2
  164. package/build/commonjs/internal/icons/Close.js.map +1 -1
  165. package/build/commonjs/internal/icons/Search.js +2 -2
  166. package/build/commonjs/internal/icons/Search.js.map +1 -1
  167. package/build/commonjs/internal/icons/index.js +16 -0
  168. package/build/commonjs/internal/icons/index.js.map +1 -1
  169. package/build/module/Accordion/Accordion.js +15 -8
  170. package/build/module/Accordion/Accordion.js.map +1 -1
  171. package/build/module/Accordion/AccordionProps.js.map +1 -1
  172. package/build/module/Accordion/useVariantStyleMap.js +15 -8
  173. package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
  174. package/build/module/AppBar/AppBar.js +6 -2
  175. package/build/module/AppBar/AppBar.js.map +1 -1
  176. package/build/module/Badge/Badge.js +4 -3
  177. package/build/module/Badge/Badge.js.map +1 -1
  178. package/build/module/Badge/BadgeProps.js.map +1 -1
  179. package/build/module/Badge/useVariantStyleMap.js +2 -2
  180. package/build/module/Badge/useVariantStyleMap.js.map +1 -1
  181. package/build/module/BottomSheetTitle/BottomSheetTitle.js +5 -2
  182. package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
  183. package/build/module/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
  184. package/build/module/Button/Button.js +27 -13
  185. package/build/module/Button/Button.js.map +1 -1
  186. package/build/module/Button/ButtonProps.js.map +1 -1
  187. package/build/module/Button/useVariantStyleMap.js +9 -0
  188. package/build/module/Button/useVariantStyleMap.js.map +1 -1
  189. package/build/module/ButtonBase/ButtonBase.js +1 -1
  190. package/build/module/ButtonBase/ButtonBase.js.map +1 -1
  191. package/build/module/ButtonBase/index.js +1 -1
  192. package/build/module/ButtonBase/index.js.map +1 -1
  193. package/build/module/Checkbox/Checkbox.js +4 -1
  194. package/build/module/Checkbox/Checkbox.js.map +1 -1
  195. package/build/module/Checkbox/useVariantStyleMap.js +6 -2
  196. package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
  197. package/build/module/Chip/Chip.js +21 -13
  198. package/build/module/Chip/Chip.js.map +1 -1
  199. package/build/module/Chip/ChipProps.js +1 -0
  200. package/build/module/Chip/ChipProps.js.map +1 -1
  201. package/build/module/Chip/index.js +1 -1
  202. package/build/module/Chip/index.js.map +1 -1
  203. package/build/module/Chip/useChipStyle.js +51 -31
  204. package/build/module/Chip/useChipStyle.js.map +1 -1
  205. package/build/module/Dialog/Dialog.js +10 -11
  206. package/build/module/Dialog/Dialog.js.map +1 -1
  207. package/build/module/Dialog/DialogProps.js +1 -1
  208. package/build/module/Dialog/DialogProps.js.map +1 -1
  209. package/build/module/Dialog/useDialogSectionStyle.js +6 -4
  210. package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
  211. package/build/module/Dialog/useDialogStyle.js +18 -8
  212. package/build/module/Dialog/useDialogStyle.js.map +1 -1
  213. package/build/module/DialogActions/DialogActions.js +0 -1
  214. package/build/module/DialogActions/DialogActions.js.map +1 -1
  215. package/build/module/DialogTitle/DialogLargeTitle.js +65 -0
  216. package/build/module/DialogTitle/DialogLargeTitle.js.map +1 -0
  217. package/build/module/DialogTitle/DialogTitle.js +6 -3
  218. package/build/module/DialogTitle/DialogTitle.js.map +1 -1
  219. package/build/module/Divider/Divider.js +7 -0
  220. package/build/module/Divider/Divider.js.map +1 -1
  221. package/build/module/Divider/DividerProps.js +1 -1
  222. package/build/module/Divider/DividerProps.js.map +1 -1
  223. package/build/module/Empty/Empty.js +1 -1
  224. package/build/module/Empty/Empty.js.map +1 -1
  225. package/build/module/Flexbox/Flexbox.js +2 -0
  226. package/build/module/Flexbox/Flexbox.js.map +1 -1
  227. package/build/module/Flexbox/FlexboxProps.js.map +1 -1
  228. package/build/module/IconButton/IconButton.js +3 -0
  229. package/build/module/IconButton/IconButton.js.map +1 -1
  230. package/build/module/IconButton/IconButtonProps.js +1 -1
  231. package/build/module/IconButton/IconButtonProps.js.map +1 -1
  232. package/build/module/Image/Image.js +2 -2
  233. package/build/module/Image/Image.js.map +1 -1
  234. package/build/module/ImageCore/ImageCoreNative.js +1 -1
  235. package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
  236. package/build/module/ListItem/ListItem.js +36 -28
  237. package/build/module/ListItem/ListItem.js.map +1 -1
  238. package/build/module/ListItem/ListItemProps.js.map +1 -1
  239. package/build/module/ListItemIcon/ListItemIcon.js +1 -2
  240. package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
  241. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
  242. package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
  243. package/build/module/ListItemText/ListItemText.js +17 -19
  244. package/build/module/ListItemText/ListItemText.js.map +1 -1
  245. package/build/module/ListItemText/ListItemTextProps.js.map +1 -1
  246. package/build/module/ListSubheader/ListSubheader.js +1 -1
  247. package/build/module/ListSubheader/ListSubheader.js.map +1 -1
  248. package/build/module/Pagination/NumberPagination.js +4 -2
  249. package/build/module/Pagination/NumberPagination.js.map +1 -1
  250. package/build/module/Pagination/Pagination.js +2 -0
  251. package/build/module/Pagination/Pagination.js.map +1 -1
  252. package/build/module/Pagination/PaginationProps.js +1 -0
  253. package/build/module/Pagination/PaginationProps.js.map +1 -1
  254. package/build/module/Pagination/index.js +1 -1
  255. package/build/module/Pagination/index.js.map +1 -1
  256. package/build/module/PaginationItem/PaginationItem.js +28 -21
  257. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  258. package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
  259. package/build/module/Radio/Radio.js +10 -4
  260. package/build/module/Radio/Radio.js.map +1 -1
  261. package/build/module/RadioGroup/RadioGroup.js +2 -20
  262. package/build/module/RadioGroup/RadioGroup.js.map +1 -1
  263. package/build/module/Section/Section.js +19 -0
  264. package/build/module/Section/Section.js.map +1 -0
  265. package/build/module/Section/SectionProps.js +2 -0
  266. package/build/module/Section/SectionProps.js.map +1 -0
  267. package/build/module/Section/index.js +2 -0
  268. package/build/module/Section/index.js.map +1 -0
  269. package/build/module/ShadowView/ShadowView.native.js +4 -0
  270. package/build/module/ShadowView/ShadowView.native.js.map +1 -1
  271. package/build/module/SnackbarContent/SnackbarContent.js +26 -9
  272. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  273. package/build/module/Tab/Tab.js +22 -19
  274. package/build/module/Tab/Tab.js.map +1 -1
  275. package/build/module/Tab/TabProps.js +2 -1
  276. package/build/module/Tab/TabProps.js.map +1 -1
  277. package/build/module/Tab/index.js +1 -0
  278. package/build/module/Tab/index.js.map +1 -1
  279. package/build/module/Tab/useVariantStyleMap.js +59 -18
  280. package/build/module/Tab/useVariantStyleMap.js.map +1 -1
  281. package/build/module/TabBase/TabBase.js +1 -8
  282. package/build/module/TabBase/TabBase.js.map +1 -1
  283. package/build/module/TabBase/TabBaseProps.js.map +1 -1
  284. package/build/module/Tabs/Tabs.js +21 -7
  285. package/build/module/Tabs/Tabs.js.map +1 -1
  286. package/build/module/Tabs/TabsProps.js.map +1 -1
  287. package/build/module/Tabs/index.js.map +1 -1
  288. package/build/module/Tabs/useTabsStyle.js +70 -0
  289. package/build/module/Tabs/useTabsStyle.js.map +1 -0
  290. package/build/module/TextField/TextField.js +48 -12
  291. package/build/module/TextField/TextField.js.map +1 -1
  292. package/build/module/TextField/useVariantStyleMap.js +29 -29
  293. package/build/module/TextField/useVariantStyleMap.js.map +1 -1
  294. package/build/module/Toolbar/BackButton/BackButton.js +32 -0
  295. package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
  296. package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
  297. package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
  298. package/build/module/Toolbar/BackButton/index.js +2 -0
  299. package/build/module/Toolbar/BackButton/index.js.map +1 -0
  300. package/build/module/Toolbar/Toolbar.js +7 -3
  301. package/build/module/Toolbar/Toolbar.js.map +1 -1
  302. package/build/module/Tooltip/Beaks/index.js +4 -0
  303. package/build/module/Tooltip/Beaks/index.js.map +1 -1
  304. package/build/module/Tooltip/Tooltip.js +4 -10
  305. package/build/module/Tooltip/Tooltip.js.map +1 -1
  306. package/build/module/Tooltip/index.js +1 -0
  307. package/build/module/Tooltip/index.js.map +1 -1
  308. package/build/module/Typography/Typography.js +9 -2
  309. package/build/module/Typography/Typography.js.map +1 -1
  310. package/build/module/Typography/TypographyProps.js.map +1 -1
  311. package/build/module/hooks/useBreakpointUp.js +4 -1
  312. package/build/module/hooks/useBreakpointUp.js.map +1 -1
  313. package/build/module/hooks/useCollapsibleAppBar.js +4 -10
  314. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  315. package/build/module/hooks/useContentContainerStyle.js +43 -25
  316. package/build/module/hooks/useContentContainerStyle.js.map +1 -1
  317. package/build/module/hooks/useFadeInAppBar.js +2 -2
  318. package/build/module/hooks/useFadeInAppBar.js.map +1 -1
  319. package/build/module/index.js +2 -0
  320. package/build/module/index.js.map +1 -1
  321. package/build/module/internal/icons/AppBarChevronLeft.js +9 -0
  322. package/build/module/internal/icons/AppBarChevronLeft.js.map +1 -0
  323. package/build/module/internal/icons/ChevronLeft.js +4 -2
  324. package/build/module/internal/icons/ChevronLeft.js.map +1 -1
  325. package/build/module/internal/icons/ChevronRight.js +4 -2
  326. package/build/module/internal/icons/ChevronRight.js.map +1 -1
  327. package/build/module/internal/icons/ChipClose.js +9 -0
  328. package/build/module/internal/icons/ChipClose.js.map +1 -0
  329. package/build/module/internal/icons/Clear.js +3 -3
  330. package/build/module/internal/icons/Clear.js.map +1 -1
  331. package/build/module/internal/icons/Close.js +4 -2
  332. package/build/module/internal/icons/Close.js.map +1 -1
  333. package/build/module/internal/icons/Search.js +2 -2
  334. package/build/module/internal/icons/Search.js.map +1 -1
  335. package/build/module/internal/icons/index.js +2 -0
  336. package/build/module/internal/icons/index.js.map +1 -1
  337. package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
  338. package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
  339. package/build/typescript/Badge/BadgeProps.d.ts +10 -5
  340. package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +1 -0
  341. package/build/typescript/Button/ButtonProps.d.ts +5 -0
  342. package/build/typescript/ButtonBase/index.d.ts +1 -1
  343. package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
  344. package/build/typescript/Chip/ChipProps.d.ts +11 -4
  345. package/build/typescript/Chip/index.d.ts +1 -1
  346. package/build/typescript/Chip/useChipStyle.d.ts +6 -3
  347. package/build/typescript/Dialog/DialogProps.d.ts +1 -6
  348. package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
  349. package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +9 -0
  350. package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -1
  351. package/build/typescript/Divider/DividerProps.d.ts +1 -1
  352. package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
  353. package/build/typescript/IconButton/IconButtonProps.d.ts +1 -1
  354. package/build/typescript/ListItem/ListItem.d.ts +1 -1
  355. package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
  356. package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
  357. package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
  358. package/build/typescript/Pagination/index.d.ts +2 -2
  359. package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
  360. package/build/typescript/Section/Section.d.ts +3 -0
  361. package/build/typescript/Section/SectionProps.d.ts +6 -0
  362. package/build/typescript/Section/index.d.ts +2 -0
  363. package/build/typescript/Tab/TabProps.d.ts +21 -2
  364. package/build/typescript/Tab/index.d.ts +2 -1
  365. package/build/typescript/Tab/useVariantStyleMap.d.ts +4 -2
  366. package/build/typescript/TabBase/TabBaseProps.d.ts +0 -5
  367. package/build/typescript/Tabs/Tabs.d.ts +1 -1
  368. package/build/typescript/Tabs/TabsProps.d.ts +6 -1
  369. package/build/typescript/Tabs/index.d.ts +1 -1
  370. package/build/typescript/Tabs/useTabsStyle.d.ts +8 -0
  371. package/build/typescript/TextField/useVariantStyleMap.d.ts +2 -0
  372. package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
  373. package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
  374. package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
  375. package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
  376. package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
  377. package/build/typescript/Tooltip/index.d.ts +1 -0
  378. package/build/typescript/Typography/TypographyProps.d.ts +4 -0
  379. package/build/typescript/hooks/useCollapsibleAppBar.d.ts +0 -1
  380. package/build/typescript/hooks/useContentContainerStyle.d.ts +5 -8
  381. package/build/typescript/index.d.ts +2 -0
  382. package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +131 -0
  383. package/build/typescript/internal/icons/ChipClose.d.ts +131 -0
  384. package/build/typescript/internal/icons/index.d.ts +2 -0
  385. package/package.json +5 -5
  386. package/src/Accordion/Accordion.tsx +18 -9
  387. package/src/Accordion/AccordionProps.ts +4 -2
  388. package/src/Accordion/useVariantStyleMap.ts +14 -6
  389. package/src/AppBar/AppBar.tsx +5 -1
  390. package/src/Badge/Badge.tsx +4 -3
  391. package/src/Badge/BadgeProps.ts +12 -6
  392. package/src/Badge/useVariantStyleMap.ts +2 -2
  393. package/src/BottomSheetTitle/BottomSheetTitle.tsx +4 -1
  394. package/src/BottomSheetTitle/BottomSheetTitleProps.ts +1 -0
  395. package/src/Button/Button.tsx +28 -12
  396. package/src/Button/ButtonProps.ts +6 -0
  397. package/src/Button/useVariantStyleMap.ts +9 -0
  398. package/src/ButtonBase/ButtonBase.tsx +1 -1
  399. package/src/ButtonBase/index.ts +1 -1
  400. package/src/Checkbox/Checkbox.tsx +11 -8
  401. package/src/Checkbox/useVariantStyleMap.ts +6 -1
  402. package/src/Chip/Chip.tsx +24 -13
  403. package/src/Chip/ChipProps.ts +13 -4
  404. package/src/Chip/index.ts +1 -1
  405. package/src/Chip/useChipStyle.ts +59 -29
  406. package/src/Dialog/Dialog.tsx +12 -11
  407. package/src/Dialog/DialogProps.ts +1 -7
  408. package/src/Dialog/useDialogSectionStyle.ts +6 -4
  409. package/src/Dialog/useDialogStyle.ts +19 -7
  410. package/src/DialogActions/DialogActions.tsx +0 -1
  411. package/src/DialogTitle/DialogLargeTitle.tsx +95 -0
  412. package/src/DialogTitle/DialogTitle.tsx +6 -1
  413. package/src/Divider/Divider.tsx +5 -0
  414. package/src/Divider/DividerProps.ts +1 -1
  415. package/src/Empty/Empty.tsx +1 -1
  416. package/src/Flexbox/Flexbox.tsx +2 -0
  417. package/src/Flexbox/FlexboxProps.ts +5 -0
  418. package/src/IconButton/IconButton.tsx +2 -0
  419. package/src/IconButton/IconButtonProps.ts +1 -0
  420. package/src/Image/Image.tsx +3 -3
  421. package/src/ImageCore/ImageCoreNative.tsx +1 -1
  422. package/src/ListItem/ListItem.tsx +61 -30
  423. package/src/ListItem/ListItemProps.ts +5 -0
  424. package/src/ListItemIcon/ListItemIcon.tsx +1 -2
  425. package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
  426. package/src/ListItemText/ListItemText.tsx +20 -28
  427. package/src/ListItemText/ListItemTextProps.ts +2 -10
  428. package/src/ListSubheader/ListSubheader.tsx +1 -1
  429. package/src/Pagination/NumberPagination.tsx +7 -2
  430. package/src/Pagination/Pagination.tsx +3 -2
  431. package/src/Pagination/PaginationProps.ts +15 -0
  432. package/src/Pagination/index.ts +2 -2
  433. package/src/PaginationItem/PaginationItem.tsx +31 -24
  434. package/src/PaginationItem/PaginationItemProps.ts +7 -0
  435. package/src/Radio/Radio.tsx +12 -3
  436. package/src/RadioGroup/RadioGroup.tsx +2 -28
  437. package/src/Section/Section.tsx +26 -0
  438. package/src/Section/SectionProps.ts +6 -0
  439. package/src/Section/index.ts +2 -0
  440. package/src/ShadowView/ShadowView.native.tsx +4 -0
  441. package/src/SnackbarContent/SnackbarContent.tsx +36 -15
  442. package/src/Tab/Tab.tsx +32 -22
  443. package/src/Tab/TabProps.ts +25 -2
  444. package/src/Tab/index.ts +2 -1
  445. package/src/Tab/useVariantStyleMap.ts +72 -19
  446. package/src/TabBase/TabBase.tsx +1 -9
  447. package/src/TabBase/TabBaseProps.ts +0 -6
  448. package/src/Tabs/Tabs.tsx +26 -8
  449. package/src/Tabs/TabsProps.ts +7 -1
  450. package/src/Tabs/index.ts +1 -1
  451. package/src/Tabs/useTabsStyle.ts +77 -0
  452. package/src/TextField/TextField.tsx +69 -26
  453. package/src/TextField/useVariantStyleMap.ts +29 -27
  454. package/src/Toolbar/BackButton/BackButton.tsx +44 -0
  455. package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
  456. package/src/Toolbar/BackButton/index.ts +2 -0
  457. package/src/Toolbar/Toolbar.tsx +6 -1
  458. package/src/Tooltip/Beaks/index.ts +4 -0
  459. package/src/Tooltip/Tooltip.tsx +4 -9
  460. package/src/Tooltip/index.ts +1 -0
  461. package/src/Typography/Typography.tsx +3 -1
  462. package/src/Typography/TypographyProps.ts +5 -0
  463. package/src/hooks/useBreakpointUp.ts +3 -1
  464. package/src/hooks/useCollapsibleAppBar.ts +4 -23
  465. package/src/hooks/useContentContainerStyle.ts +43 -31
  466. package/src/hooks/useFadeInAppBar.ts +2 -2
  467. package/src/index.ts +3 -0
  468. package/src/internal/icons/AppBarChevronLeft.tsx +15 -0
  469. package/src/internal/icons/ChevronLeft.tsx +4 -1
  470. package/src/internal/icons/ChevronRight.tsx +4 -1
  471. package/src/internal/icons/ChipClose.tsx +13 -0
  472. package/src/internal/icons/Clear.tsx +3 -3
  473. package/src/internal/icons/Close.tsx +4 -1
  474. package/src/internal/icons/Search.tsx +2 -2
  475. package/src/internal/icons/index.ts +2 -0
  476. package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
  477. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
  478. package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
  479. package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
  480. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
  481. package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
@@ -1 +1 @@
1
- {"version":3,"names":["React","css","ButtonBase","useStyles","root","alignItems","justifyContent","row","flexDirection","column","TabBase","props","children","disabled","onPress","selected","vertical","style","otherProps","styles"],"sources":["TabBase.tsx"],"sourcesContent":["import React from 'react';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport type TabBaseProps from './TabBaseProps';\n\ntype TabBaseStyles = NamedStylesStringUnion<'root' | 'row' | 'column'>;\n\nconst useStyles: UseStyles<TabBaseStyles> = function (): TabBaseStyles {\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n };\n};\n\nexport default function TabBase(props: TabBaseProps) {\n const {\n children,\n disabled = false,\n onPress,\n selected = false,\n vertical = false,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n return (\n <ButtonBase\n onPress={onPress}\n disabled={disabled}\n style={css([\n styles.root,\n vertical ? styles.column : styles.row,\n style,\n ])}\n {...otherProps}\n >\n {children}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,GAAT,QAAuD,qBAAvD;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAKA,MAAMC,SAAmC,GAAG,YAA2B;EACnE,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE;IAFd,CADH;IAKHC,GAAG,EAAE;MACDC,aAAa,EAAE;IADd,CALF;IAQHC,MAAM,EAAE;MACJD,aAAa,EAAE;IADX;EARL,CAAP;AAYH,CAbD;;AAeA,eAAe,SAASE,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,OAHE;IAIFC,QAAQ,GAAG,KAJT;IAKFC,QAAQ,GAAG,KALT;IAMFC,KANE;IAOF,GAAGC;EAPD,IAQFP,KARJ;EAUA,MAAMQ,MAAM,GAAGhB,SAAS,EAAxB;EAEA,oBACI,oBAAC,UAAD;IACI,OAAO,EAAEW,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAEZ,GAAG,CAAC,CACPkB,MAAM,CAACf,IADA,EAEPY,QAAQ,GAAGG,MAAM,CAACV,MAAV,GAAmBU,MAAM,CAACZ,GAF3B,EAGPU,KAHO,CAAD;EAHd,GAQQC,UARR,GAUKN,QAVL,CADJ;AAcH;AAAA"}
1
+ {"version":3,"names":["React","css","ButtonBase","useStyles","root","alignItems","justifyContent","TabBase","props","children","disabled","onPress","selected","style","otherProps","styles"],"sources":["TabBase.tsx"],"sourcesContent":["import React from 'react';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport type TabBaseProps from './TabBaseProps';\n\ntype TabBaseStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<TabBaseStyles> = function (): TabBaseStyles {\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n };\n};\n\nexport default function TabBase(props: TabBaseProps) {\n const {\n children,\n disabled = false,\n onPress,\n selected = false,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n return (\n <ButtonBase\n onPress={onPress}\n disabled={disabled}\n style={css([\n styles.root,\n style,\n ])}\n {...otherProps}\n >\n {children}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,GAAT,QAAuD,qBAAvD;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAKA,MAAMC,SAAmC,GAAG,YAA2B;EACnE,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE;IAFd;EADH,CAAP;AAMH,CAPD;;AASA,eAAe,SAASC,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,OAHE;IAIFC,QAAQ,GAAG,KAJT;IAKFC,KALE;IAMF,GAAGC;EAND,IAOFN,KAPJ;EASA,MAAMO,MAAM,GAAGZ,SAAS,EAAxB;EAEA,oBACI,oBAAC,UAAD;IACI,OAAO,EAAEQ,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAET,GAAG,CAAC,CACPc,MAAM,CAACX,IADA,EAEPS,KAFO,CAAD;EAHd,GAOQC,UAPR,GASKL,QATL,CADJ;AAaH;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["TabBaseProps.ts"],"sourcesContent":["import React from 'react';\nimport type { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport default interface TabBaseProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * Content of the TabBase.\n */\n children: React.ReactNode;\n\n /**\n * If `true`, the component is selected.\n * @default false\n */\n selected?: boolean;\n\n /**\n * Orientation of the TabBase. Default is horizontal.\n * @default false\n */\n vertical?: boolean;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["TabBaseProps.ts"],"sourcesContent":["import React from 'react';\nimport type { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport default interface TabBaseProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * Content of the TabBase.\n */\n children: React.ReactNode;\n\n /**\n * If `true`, the component is selected.\n * @default false\n */\n selected?: boolean;\n}> {}\n"],"mappings":""}
@@ -10,6 +10,8 @@ import useTabInnerContentsWidth from './useTabInnerContentsWidth';
10
10
  import useIndexStore from './useIndexStore';
11
11
  import InternalContext from './InternalContext';
12
12
  import { isEveryTabCoordinatesDefined } from './utils';
13
+ import { defaultCoordinate } from './TabCoordinate';
14
+ import useTabsStyle from './useTabsStyle';
13
15
 
14
16
  const useStyles = function () {
15
17
  const theme = useTheme();
@@ -21,9 +23,6 @@ const useStyles = function () {
21
23
  fixedTab: {
22
24
  flex: 1
23
25
  },
24
- scrollableContainer: {
25
- paddingHorizontal: theme.spacing(1)
26
- },
27
26
  bottomDivider: {
28
27
  borderBottomColor: theme.palette.border.base,
29
28
  borderBottomWidth: 0.5
@@ -46,6 +45,7 @@ const Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
46
45
  scrollable = false,
47
46
  scrollViewContentContainerStyle,
48
47
  showDivider = false,
48
+ size = 'medium',
49
49
  style,
50
50
  variant = 'default',
51
51
  UNSTABLE_sharedIndex,
@@ -57,6 +57,10 @@ const Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
57
57
  const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;
58
58
  const realInitialIndex = sharedIndex.initialValue;
59
59
  const currentIndexRef = useRef(initialIndex);
60
+ const {
61
+ container: containerStyle,
62
+ contentContainer: contentContainerStyle
63
+ } = useTabsStyle(variant, size, scrollable);
60
64
 
61
65
  const setTab = newIndex => {
62
66
  const currentIndex = currentIndexRef.current;
@@ -83,10 +87,16 @@ const Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
83
87
  }
84
88
 
85
89
  return innerContentsWidthList.map((innerContentWidth, idx) => {
90
+ const outerCoordinate = outerCoordinates[idx];
91
+
92
+ if (!outerCoordinate) {
93
+ return defaultCoordinate;
94
+ }
95
+
86
96
  const {
87
97
  x1: outerX1,
88
98
  x2: outerX2
89
- } = outerCoordinates[idx];
99
+ } = outerCoordinate;
90
100
  const tabWidth = outerX2 - outerX1;
91
101
  const distanceFromParent = (tabWidth - innerContentWidth) / 2;
92
102
  const indicatorStartCoordinate = outerX1 + distanceFromParent;
@@ -141,15 +151,19 @@ const Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
141
151
  }; // @ts-ignore
142
152
 
143
153
 
154
+ const tabStyle = child.props.style; // @ts-ignore
155
+
144
156
  const tabElement = /*#__PURE__*/cloneElement(child, {
145
157
  enableIndicator: !disableIndicator && !canRenderIndicator,
146
158
  onTabInnerLayout,
147
159
  onLayout,
148
160
  onPress,
149
161
  onMouseDown,
162
+ parentColor: color,
163
+ size,
150
164
  variant,
151
165
  indicatorSize,
152
- style: scrollable ? undefined : styles.fixedTab
166
+ style: css([scrollable ? undefined : styles.fixedTab, tabStyle])
153
167
  });
154
168
  return /*#__PURE__*/React.createElement(IndexAwareTab, {
155
169
  children: tabElement,
@@ -171,13 +185,13 @@ const Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
171
185
  indexStore
172
186
  }
173
187
  }, /*#__PURE__*/React.createElement(View, {
174
- style: css([styles.root, {
188
+ style: css([styles.root, containerStyle, {
175
189
  backgroundColor: backgroundColorMap[color]
176
190
  }, showDivider ? styles.bottomDivider : undefined, scrollable ? undefined : styles.fixedRoot, style])
177
191
  }, scrollable ? /*#__PURE__*/React.createElement(ScrollableTabsView, {
178
192
  automaticallyAdjustContentInsets: false,
179
193
  bounces: false,
180
- contentContainerStyle: css([styles.scrollableContainer, scrollViewContentContainerStyle]),
194
+ contentContainerStyle: css([contentContainerStyle, scrollViewContentContainerStyle]),
181
195
  coordinates: coordinates,
182
196
  directionalLockEnabled: true,
183
197
  horizontal: true,
@@ -1 +1 @@
1
- {"version":3,"names":["React","cloneElement","forwardRef","useEffect","useImperativeHandle","useMemo","useRef","View","css","useTheme","useSyncAnimatedValue","TabIndicator","ScrollableTabsView","IndexAwareTab","useTabCoordinates","useTabInnerContentsWidth","useIndexStore","InternalContext","isEveryTabCoordinatesDefined","useStyles","theme","root","fixedRoot","flexDirection","fixedTab","flex","scrollableContainer","paddingHorizontal","spacing","bottomDivider","borderBottomColor","palette","border","base","borderBottomWidth","Tabs","props","ref","children","color","initialIndex","disableIndicator","indicatorSize","keyboardDismissMode","keyboardShouldPersistTaps","onChange","scrollable","scrollViewContentContainerStyle","showDivider","style","variant","UNSTABLE_sharedIndex","onTabSelected","fallbackSharedIndex","initialValue","sharedIndex","realInitialIndex","currentIndexRef","setTab","newIndex","currentIndex","current","animatedValue","setValue","styles","outerCoordinates","updateCoordinate","innerContentsWidthList","updateInnerContentsWidth","canRenderIndicator","indexStore","coordinates","length","map","innerContentWidth","idx","x1","outerX1","x2","outerX2","tabWidth","distanceFromParent","indicatorStartCoordinate","subscribe","tabElements","Children","child","index","onTabInnerLayout","event","width","nativeEvent","layout","onLayout","x","onMouseDown","e","preventDefault","onPress","tabElement","enableIndicator","undefined","filter","Boolean","tabIndicator","backgroundColorMap","default","background","alt","backgroundColor"],"sources":["Tabs.tsx"],"sourcesContent":["import React, { cloneElement, forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\nimport type { GestureResponderEvent, LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport { useSyncAnimatedValue } from '../hooks';\nimport type { TabVariant } from '../Tab';\nimport type TabsProps from './TabsProps';\nimport type { TabsColor } from './TabsProps';\nimport type { TabsInstance } from './types';\nimport TabIndicator from './TabIndicator';\nimport ScrollableTabsView from './ScrollableTabsView';\nimport IndexAwareTab from './IndexAwareTab';\nimport useTabCoordinates from './useTabCoordinates';\nimport useTabInnerContentsWidth from './useTabInnerContentsWidth';\nimport useIndexStore from './useIndexStore';\nimport InternalContext from './InternalContext';\nimport { isEveryTabCoordinatesDefined } from './utils';\n\ntype TabsStyleKeys =\n | 'root'\n | 'fixedRoot'\n | 'fixedTab'\n | 'scrollableContainer'\n | 'bottomDivider';\n\ntype TabsStyles = NamedStylesStringUnion<TabsStyleKeys>;\n\nconst useStyles: UseStyles<TabsStyles> = function (): TabsStyles {\n const theme = useTheme();\n\n return {\n root: {},\n fixedRoot: {\n flexDirection: 'row',\n },\n fixedTab: {\n flex: 1,\n },\n scrollableContainer: {\n paddingHorizontal: theme.spacing(1),\n },\n bottomDivider: {\n borderBottomColor: theme.palette.border.base,\n borderBottomWidth: 0.5,\n },\n };\n};\n\nconst Tabs = forwardRef<TabsInstance, TabsProps>(function Tabs(props, ref) {\n const {\n children,\n color = 'default',\n initialIndex = 0,\n disableIndicator = false,\n indicatorSize = 'fit-content',\n keyboardDismissMode = 'none',\n keyboardShouldPersistTaps = 'never',\n onChange,\n scrollable = false,\n scrollViewContentContainerStyle,\n showDivider = false,\n style,\n variant = 'default' as TabVariant,\n UNSTABLE_sharedIndex,\n onTabSelected,\n } = props;\n\n const fallbackSharedIndex = useSyncAnimatedValue({ initialValue: initialIndex });\n const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;\n const realInitialIndex = sharedIndex.initialValue;\n\n const currentIndexRef = useRef(initialIndex);\n\n const setTab = (newIndex: number) => {\n const currentIndex = currentIndexRef.current;\n onTabSelected?.(newIndex, currentIndex);\n\n sharedIndex.animatedValue.setValue(newIndex);\n };\n\n useImperativeHandle(\n ref,\n () => ({\n setTab,\n }),\n [sharedIndex],\n );\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const [outerCoordinates, updateCoordinate] = useTabCoordinates(children);\n const [innerContentsWidthList, updateInnerContentsWidth] = useTabInnerContentsWidth(children);\n\n const canRenderIndicator = indicatorSize === 'fit-content'\n ? isEveryTabCoordinatesDefined(innerContentsWidthList, children)\n : isEveryTabCoordinatesDefined(outerCoordinates, children);\n\n const indexStore = useIndexStore(sharedIndex);\n\n const coordinates = useMemo(() => {\n if (outerCoordinates.length === 0) {\n return [];\n }\n\n if (indicatorSize !== 'fit-content') {\n return outerCoordinates;\n }\n\n return innerContentsWidthList.map((innerContentWidth, idx) => {\n const { x1: outerX1, x2: outerX2 } = outerCoordinates[idx];\n\n const tabWidth = outerX2 - outerX1;\n const distanceFromParent = (tabWidth - innerContentWidth) / 2;\n const indicatorStartCoordinate = outerX1 + distanceFromParent;\n\n return {\n x1: indicatorStartCoordinate,\n x2: indicatorStartCoordinate + innerContentWidth,\n };\n });\n }, [outerCoordinates, innerContentsWidthList]);\n\n useEffect(() => {\n return indexStore.subscribe(newIndex => {\n onChange?.(newIndex);\n currentIndexRef.current = newIndex;\n });\n }, [indexStore, onChange]);\n\n const tabElements = React.Children.map(children, (child, index) => {\n if (!child) {\n return null;\n }\n\n const onTabInnerLayout = (event: LayoutChangeEvent) => {\n const { width } = event.nativeEvent.layout;\n\n updateInnerContentsWidth(index, width);\n };\n\n const onLayout = (event: LayoutChangeEvent) => {\n const { x, width } = event.nativeEvent.layout;\n\n updateCoordinate(index, x, width);\n\n // @ts-ignore\n child.props.onLayout?.(event);\n };\n\n const onMouseDown = (e: GestureResponderEvent) => {\n if (keyboardShouldPersistTaps === 'always') {\n e.preventDefault();\n }\n };\n\n const onPress = () => {\n setTab(index);\n\n // @ts-ignore\n child.props.onPress?.();\n };\n\n // @ts-ignore\n const tabElement = cloneElement(child, {\n enableIndicator: !disableIndicator && !canRenderIndicator,\n onTabInnerLayout,\n onLayout,\n onPress,\n onMouseDown,\n variant,\n indicatorSize,\n style: scrollable ? undefined : styles.fixedTab,\n });\n\n return (\n <IndexAwareTab\n children={tabElement}\n index={index}\n initialIndex={realInitialIndex}\n />\n );\n })?.filter(Boolean);\n\n const tabIndicator = canRenderIndicator ? (\n <TabIndicator\n coordinates={coordinates}\n disabled={disableIndicator}\n initialIndex={realInitialIndex}\n />\n ) : null;\n\n const backgroundColorMap: Record<TabsColor, string> = {\n default: theme.palette.background.base,\n alt: theme.palette.background.alt,\n };\n\n return (\n <InternalContext.Provider value={{ indexStore }}>\n <View\n style={css([\n styles.root,\n { backgroundColor: backgroundColorMap[color] },\n showDivider ? styles.bottomDivider : undefined,\n scrollable ? undefined : styles.fixedRoot,\n style,\n ])}\n >\n {scrollable ? (\n <ScrollableTabsView\n automaticallyAdjustContentInsets={false}\n bounces={false}\n contentContainerStyle={css([\n styles.scrollableContainer,\n scrollViewContentContainerStyle,\n ])}\n coordinates={coordinates}\n directionalLockEnabled={true}\n horizontal={true}\n initialIndex={realInitialIndex}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n keyboardDismissMode={keyboardDismissMode}\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n >\n {tabElements}\n {tabIndicator}\n </ScrollableTabsView>\n ) : (\n <React.Fragment>\n {tabElements}\n {tabIndicator}\n </React.Fragment>\n )}\n </View>\n </InternalContext.Provider>\n );\n});\n\nexport default Tabs;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,YAAhB,EAA8BC,UAA9B,EAA0CC,SAA1C,EAAqDC,mBAArD,EAA0EC,OAA1E,EAAmFC,MAAnF,QAAiG,OAAjG;AAEA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;AACA,SAASC,oBAAT,QAAqC,UAArC;AAKA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,kBAAP,MAA+B,sBAA/B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,SAASC,4BAAT,QAA6C,SAA7C;;AAWA,MAAMC,SAAgC,GAAG,YAAwB;EAC7D,MAAMC,KAAK,GAAGX,QAAQ,EAAtB;EAEA,OAAO;IACHY,IAAI,EAAE,EADH;IAEHC,SAAS,EAAE;MACPC,aAAa,EAAE;IADR,CAFR;IAKHC,QAAQ,EAAE;MACNC,IAAI,EAAE;IADA,CALP;IAQHC,mBAAmB,EAAE;MACjBC,iBAAiB,EAAEP,KAAK,CAACQ,OAAN,CAAc,CAAd;IADF,CARlB;IAWHC,aAAa,EAAE;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AUI,YAAY,EAAEf,gBAVlB;IAWI,YAAY,EAAE,KAXlB;IAYI,8BAA8B,EAAE,KAZpC;IAaI,4BAA4B,EAAE,KAblC;IAcI,mBAAmB,EAAEb,mBAdzB;IAeI,yBAAyB,EAAEC;EAf/B,GAiBKwC,WAjBL,EAkBKoB,YAlBL,CADO,gBAsBP,oBAAC,KAAD,CAAO,QAAP,QACKpB,WADL,EAEKoB,YAFL,CA/BR,CADJ,CADJ;AAyCH,CA/LsB,CAAvB;AAiMA,eAAerE,IAAf"}
1
+ {"version":3,"names":["React","cloneElement","forwardRef","useEffect","useImperativeHandle","useMemo","useRef","View","css","useTheme","useSyncAnimatedValue","TabIndicator","ScrollableTabsView","IndexAwareTab","useTabCoordinates","useTabInnerContentsWidth","useIndexStore","InternalContext","isEveryTabCoordinatesDefined","defaultCoordinate","useTabsStyle","useStyles","theme","root","fixedRoot","flexDirection","fixedTab","flex","bottomDivider","borderBottomColor","palette","border","base","borderBottomWidth","Tabs","props","ref","children","color","initialIndex","disableIndicator","indicatorSize","keyboardDismissMode","keyboardShouldPersistTaps","onChange","scrollable","scrollViewContentContainerStyle","showDivider","size","style","variant","UNSTABLE_sharedIndex","onTabSelected","fallbackSharedIndex","initialValue","sharedIndex","realInitialIndex","currentIndexRef","container","containerStyle","contentContainer","contentContainerStyle","setTab","newIndex","currentIndex","current","animatedValue","setValue","styles","outerCoordinates","updateCoordinate","innerContentsWidthList","updateInnerContentsWidth","canRenderIndicator","indexStore","coordinates","length","map","innerContentWidth","idx","outerCoordinate","x1","outerX1","x2","outerX2","tabWidth","distanceFromParent","indicatorStartCoordinate","subscribe","tabElements","Children","child","index","onTabInnerLayout","event","width","nativeEvent","layout","onLayout","x","onMouseDown","e","preventDefault","onPress","tabStyle","tabElement","enableIndicator","parentColor","undefined","filter","Boolean","tabIndicator","backgroundColorMap","default","background","alt","backgroundColor"],"sources":["Tabs.tsx"],"sourcesContent":["import React, { cloneElement, forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\nimport type { GestureResponderEvent, LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport { useSyncAnimatedValue } from '../hooks';\nimport type { TabSize, TabVariant } from '../Tab';\nimport type TabsProps from './TabsProps';\nimport type { TabsColor } from './TabsProps';\nimport type { TabsInstance } from './types';\nimport TabIndicator from './TabIndicator';\nimport ScrollableTabsView from './ScrollableTabsView';\nimport IndexAwareTab from './IndexAwareTab';\nimport useTabCoordinates from './useTabCoordinates';\nimport useTabInnerContentsWidth from './useTabInnerContentsWidth';\nimport useIndexStore from './useIndexStore';\nimport InternalContext from './InternalContext';\nimport { isEveryTabCoordinatesDefined } from './utils';\nimport { defaultCoordinate } from './TabCoordinate';\nimport useTabsStyle from './useTabsStyle';\n\ntype TabsStyleKeys =\n | 'root'\n | 'fixedRoot'\n | 'fixedTab'\n | 'bottomDivider';\n\ntype TabsStyles = NamedStylesStringUnion<TabsStyleKeys>;\n\nconst useStyles: UseStyles<TabsStyles> = function (): TabsStyles {\n const theme = useTheme();\n\n return {\n root: {},\n fixedRoot: {\n flexDirection: 'row',\n },\n fixedTab: {\n flex: 1,\n },\n bottomDivider: {\n borderBottomColor: theme.palette.border.base,\n borderBottomWidth: 0.5,\n },\n };\n};\n\nconst Tabs = forwardRef<TabsInstance, TabsProps>(function Tabs(props, ref) {\n const {\n children,\n color = 'default',\n initialIndex = 0,\n disableIndicator = false,\n indicatorSize = 'fit-content',\n keyboardDismissMode = 'none',\n keyboardShouldPersistTaps = 'never',\n onChange,\n scrollable = false,\n scrollViewContentContainerStyle,\n showDivider = false,\n size = 'medium' as TabSize,\n style,\n variant = 'default' as TabVariant,\n UNSTABLE_sharedIndex,\n onTabSelected,\n } = props;\n\n const fallbackSharedIndex = useSyncAnimatedValue({ initialValue: initialIndex });\n const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;\n const realInitialIndex = sharedIndex.initialValue;\n\n const currentIndexRef = useRef(initialIndex);\n\n const {\n container: containerStyle,\n contentContainer: contentContainerStyle,\n } = useTabsStyle(variant, size, scrollable);\n\n const setTab = (newIndex: number) => {\n const currentIndex = currentIndexRef.current;\n onTabSelected?.(newIndex, currentIndex);\n\n sharedIndex.animatedValue.setValue(newIndex);\n };\n\n useImperativeHandle(\n ref,\n () => ({\n setTab,\n }),\n [sharedIndex],\n );\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const [outerCoordinates, updateCoordinate] = useTabCoordinates(children);\n const [innerContentsWidthList, updateInnerContentsWidth] = useTabInnerContentsWidth(children);\n\n const canRenderIndicator = indicatorSize === 'fit-content'\n ? isEveryTabCoordinatesDefined(innerContentsWidthList, children)\n : isEveryTabCoordinatesDefined(outerCoordinates, children);\n\n const indexStore = useIndexStore(sharedIndex);\n\n const coordinates = useMemo(() => {\n if (outerCoordinates.length === 0) {\n return [];\n }\n\n if (indicatorSize !== 'fit-content') {\n return outerCoordinates;\n }\n\n return innerContentsWidthList.map((innerContentWidth, idx) => {\n const outerCoordinate = outerCoordinates[idx];\n if (!outerCoordinate) {\n return defaultCoordinate;\n }\n\n const { x1: outerX1, x2: outerX2 } = outerCoordinate;\n\n const tabWidth = outerX2 - outerX1;\n const distanceFromParent = (tabWidth - innerContentWidth) / 2;\n const indicatorStartCoordinate = outerX1 + distanceFromParent;\n\n return {\n x1: indicatorStartCoordinate,\n x2: indicatorStartCoordinate + innerContentWidth,\n };\n });\n }, [outerCoordinates, innerContentsWidthList]);\n\n useEffect(() => {\n return indexStore.subscribe(newIndex => {\n onChange?.(newIndex);\n currentIndexRef.current = newIndex;\n });\n }, [indexStore, onChange]);\n\n const tabElements = React.Children.map(children, (child, index) => {\n if (!child) {\n return null;\n }\n\n const onTabInnerLayout = (event: LayoutChangeEvent) => {\n const { width } = event.nativeEvent.layout;\n\n updateInnerContentsWidth(index, width);\n };\n\n const onLayout = (event: LayoutChangeEvent) => {\n const { x, width } = event.nativeEvent.layout;\n\n updateCoordinate(index, x, width);\n\n // @ts-ignore\n child.props.onLayout?.(event);\n };\n\n const onMouseDown = (e: GestureResponderEvent) => {\n if (keyboardShouldPersistTaps === 'always') {\n e.preventDefault();\n }\n };\n\n const onPress = () => {\n setTab(index);\n\n // @ts-ignore\n child.props.onPress?.();\n };\n\n // @ts-ignore\n const tabStyle = child.props.style;\n\n // @ts-ignore\n const tabElement = cloneElement(child, {\n enableIndicator: !disableIndicator && !canRenderIndicator,\n onTabInnerLayout,\n onLayout,\n onPress,\n onMouseDown,\n parentColor: color,\n size,\n variant,\n indicatorSize,\n style: css([\n scrollable ? undefined : styles.fixedTab,\n tabStyle,\n ]),\n });\n\n return (\n <IndexAwareTab\n children={tabElement}\n index={index}\n initialIndex={realInitialIndex}\n />\n );\n })?.filter(Boolean);\n\n const tabIndicator = canRenderIndicator ? (\n <TabIndicator\n coordinates={coordinates}\n disabled={disableIndicator}\n initialIndex={realInitialIndex}\n />\n ) : null;\n\n const backgroundColorMap: Record<TabsColor, string> = {\n default: theme.palette.background.base,\n alt: theme.palette.background.alt,\n };\n\n return (\n <InternalContext.Provider value={{ indexStore }}>\n <View\n style={css([\n styles.root,\n containerStyle,\n { backgroundColor: backgroundColorMap[color] },\n showDivider ? styles.bottomDivider : undefined,\n scrollable ? undefined : styles.fixedRoot,\n style,\n ])}\n >\n {scrollable ? (\n <ScrollableTabsView\n automaticallyAdjustContentInsets={false}\n bounces={false}\n contentContainerStyle={css([\n contentContainerStyle,\n scrollViewContentContainerStyle,\n ])}\n coordinates={coordinates}\n directionalLockEnabled={true}\n horizontal={true}\n initialIndex={realInitialIndex}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n keyboardDismissMode={keyboardDismissMode}\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n >\n {tabElements}\n {tabIndicator}\n </ScrollableTabsView>\n ) : (\n <React.Fragment>\n {tabElements}\n {tabIndicator}\n </React.Fragment>\n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E6B,WAPjB;IAQI,sBAAsB,EAAE,IAR5B;IASI,UAAU,EAAE,IAThB;IAUI,YAAY,EAAEnB,gBAVlB;IAWI,YAAY,EAAE,KAXlB;IAYI,8BAA8B,EAAE,KAZpC;IAaI,4BAA4B,EAAE,KAblC;IAcI,mBAAmB,EAAEd,mBAdzB;IAeI,yBAAyB,EAAEC;EAf/B,GAiBK8C,WAjBL,EAkBKsB,YAlBL,CADO,gBAsBP,oBAAC,KAAD,CAAO,QAAP,QACKtB,WADL,EAEKsB,YAFL,CAhCR,CADJ,CADJ;AA0CH,CAnNsB,CAAvB;AAqNA,eAAe7E,IAAf"}
@@ -1 +1 @@
1
- {"version":3,"names":["tabsColors","tabIndicatorSizes"],"sources":["TabsProps.ts"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { TabVariant } from '../Tab';\nimport type { ExtendedStyle, OverridableComponentProps, SyncAnimatedValue } from '../types';\nimport type { KeyboardDismissMode, KeyboardShouldPersistTaps, TabsInstance } from './types';\n\nexport const tabsColors = ['default', 'alt'] as const;\nexport type TabsColor = typeof tabsColors[number];\n\nexport const tabIndicatorSizes = ['fit-content', 'full'] as const;\nexport type TabIndicatorSize = typeof tabIndicatorSizes[number];\n\nexport default interface TabsProps extends OverridableComponentProps<ViewProps, {\n ref?: Ref<TabsInstance>;\n\n /**\n * Collection of Tab components.\n */\n children: ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'default'\n */\n color?: TabsColor;\n\n /**\n * If `true`, the indicator is disabled.\n * @default false\n */\n disableIndicator?: boolean;\n\n /**\n * The size of tab indicator.\n * 'full' adjusts the indicator to the size of the Tab,\n * while 'fit-content' adjusts the indicator to the size of the content inside the Tab.\n * @default 'fit-content'\n */\n indicatorSize?: TabIndicatorSize;\n\n /**\n * Index of initial tab that should be selected.\n * @default 0\n */\n initialIndex?: number;\n\n /**\n * keyboard dismissing condition of dragging.\n * @default 'none'\n */\n keyboardDismissMode?: KeyboardDismissMode,\n\n /**\n * keyboard persisting condition of tapping.\n * @default 'never'\n */\n keyboardShouldPersistTaps?: KeyboardShouldPersistTaps,\n\n /**\n * Callback fired when a tab is selected.\n */\n onChange?: (newIndex: number) => void;\n\n /**\n * If `true`, the component will be able to scroll.\n * @default false\n */\n scrollable?: boolean;\n\n /**\n * These styles will be applied to the scroll view content container which wraps all of the child views.\n */\n scrollViewContentContainerStyle?: ExtendedStyle | ExtendedStyle[];\n\n /**\n * Determines whether to display the bottom border.\n * @default false\n */\n showDivider?: boolean;\n\n /**\n * Unstable API.\n */\n UNSTABLE_sharedIndex?: SyncAnimatedValue;\n\n /**\n * The variant to use.\n * @default 'primary'\n */\n variant?: TabVariant;\n\n /**\n * Callback function executed when a Tab is selected.\n * Executed even if the index does not change when a Tab is pressed.\n * Receives the next tab index and the current tab index as parameters.\n */\n onTabSelected?: (newIndex: number, currentIndex: number) => void;\n}> {}\n"],"mappings":"AAMA,OAAO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,KAAZ,CAAnB;AAGP,OAAO,MAAMC,iBAAiB,GAAG,CAAC,aAAD,EAAgB,MAAhB,CAA1B"}
1
+ {"version":3,"names":["tabsColors","tabIndicatorSizes"],"sources":["TabsProps.ts"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { TabSize, TabVariant } from '../Tab';\nimport type { ExtendedStyle, OverridableComponentProps, SyncAnimatedValue } from '../types';\nimport type { KeyboardDismissMode, KeyboardShouldPersistTaps, TabsInstance } from './types';\n\nexport const tabsColors = ['default', 'alt'] as const;\nexport type TabsColor = typeof tabsColors[number];\n\nexport const tabIndicatorSizes = ['fit-content', 'full'] as const;\nexport type TabIndicatorSize = typeof tabIndicatorSizes[number];\n\nexport default interface TabsProps extends OverridableComponentProps<ViewProps, {\n ref?: Ref<TabsInstance>;\n\n /**\n * Collection of Tab components.\n */\n children: ReactNode;\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'default'\n */\n color?: TabsColor;\n\n /**\n * If `true`, the indicator is disabled.\n * @default false\n */\n disableIndicator?: boolean;\n\n /**\n * The size of tab indicator.\n * 'full' adjusts the indicator to the size of the Tab,\n * while 'fit-content' adjusts the indicator to the size of the content inside the Tab.\n * @default 'fit-content'\n */\n indicatorSize?: TabIndicatorSize;\n\n /**\n * Index of initial tab that should be selected.\n * @default 0\n */\n initialIndex?: number;\n\n /**\n * keyboard dismissing condition of dragging.\n * @default 'none'\n */\n keyboardDismissMode?: KeyboardDismissMode,\n\n /**\n * keyboard persisting condition of tapping.\n * @default 'never'\n */\n keyboardShouldPersistTaps?: KeyboardShouldPersistTaps,\n\n /**\n * Callback fired when a tab is selected.\n */\n onChange?: (newIndex: number) => void;\n\n /**\n * If `true`, the component will be able to scroll.\n * @default false\n */\n scrollable?: boolean;\n\n /**\n * These styles will be applied to the scroll view content container which wraps all of the child views.\n */\n scrollViewContentContainerStyle?: ExtendedStyle | ExtendedStyle[];\n\n /**\n * Determines whether to display the bottom border.\n * @default false\n */\n showDivider?: boolean;\n\n /**\n * The size of the Tab.\n * @default 'medium'\n */\n size?: TabSize;\n\n /**\n * Unstable API.\n */\n UNSTABLE_sharedIndex?: SyncAnimatedValue;\n\n /**\n * The variant to use.\n * @default 'primary'\n */\n variant?: TabVariant;\n\n /**\n * Callback function executed when a Tab is selected.\n * Executed even if the index does not change when a Tab is pressed.\n * Receives the next tab index and the current tab index as parameters.\n */\n onTabSelected?: (newIndex: number, currentIndex: number) => void;\n}> {}\n"],"mappings":"AAMA,OAAO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,KAAZ,CAAnB;AAGP,OAAO,MAAMC,iBAAiB,GAAG,CAAC,aAAD,EAAgB,MAAhB,CAA1B"}
@@ -1 +1 @@
1
- {"version":3,"names":["default","tabIndicatorSizes","tabsColors"],"sources":["index.ts"],"sourcesContent":["export { default } from './Tabs';\nexport type { default as TabsProps } from './TabsProps';\nexport { tabIndicatorSizes, tabsColors } from './TabsProps';\nexport type { TabsInstance } from './types';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,SAASC,iBAAT,EAA4BC,UAA5B,QAA8C,aAA9C"}
1
+ {"version":3,"names":["default","tabIndicatorSizes","tabsColors"],"sources":["index.ts"],"sourcesContent":["export { default } from './Tabs';\nexport type { default as TabsProps, TabIndicatorSize, TabsColor } from './TabsProps';\nexport { tabIndicatorSizes, tabsColors } from './TabsProps';\nexport type { TabsInstance } from './types';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,SAASC,iBAAT,EAA4BC,UAA5B,QAA8C,aAA9C"}
@@ -0,0 +1,70 @@
1
+ import { useMemo } from 'react';
2
+ import { useBreakpointUp } from '../hooks';
3
+ import { useTheme } from '../styles';
4
+ export default function useTabsStyle(variant, size, scrollable) {
5
+ const theme = useTheme();
6
+ const isTablet = useBreakpointUp('md', true, false);
7
+ return useMemo(() => {
8
+ switch (variant) {
9
+ case 'circular':
10
+ {
11
+ const paddingHorizontal = isTablet ? 20 : size === 'small' ? 8 : 12;
12
+ return {
13
+ container: {
14
+ paddingBottom: 8,
15
+ paddingHorizontal: scrollable ? 0 : paddingHorizontal
16
+ },
17
+ contentContainer: {
18
+ paddingHorizontal: scrollable ? paddingHorizontal : 0
19
+ }
20
+ };
21
+ }
22
+
23
+ case 'circular-home':
24
+ {
25
+ const paddingHorizontal = isTablet ? 20 : 8;
26
+ return {
27
+ container: {
28
+ paddingBottom: 8,
29
+ paddingHorizontal: scrollable ? 0 : paddingHorizontal
30
+ },
31
+ contentContainer: {
32
+ paddingHorizontal: scrollable ? paddingHorizontal : 0
33
+ }
34
+ };
35
+ }
36
+
37
+ case 'bottom-navigation':
38
+ {
39
+ const paddingHorizontal = 24;
40
+ return {
41
+ container: { ...(isTablet ? {
42
+ alignSelf: 'center',
43
+ minWidth: 460
44
+ } : {}),
45
+ justifyContent: 'space-between',
46
+ paddingHorizontal: scrollable ? 0 : paddingHorizontal
47
+ },
48
+ contentContainer: {
49
+ paddingHorizontal: scrollable ? paddingHorizontal : 0
50
+ }
51
+ };
52
+ }
53
+
54
+ case 'default':
55
+ default:
56
+ {
57
+ const paddingHorizontal = isTablet ? 14 : 6;
58
+ return {
59
+ container: {
60
+ paddingHorizontal: scrollable ? 0 : paddingHorizontal
61
+ },
62
+ contentContainer: {
63
+ paddingHorizontal: scrollable ? paddingHorizontal : 0
64
+ }
65
+ };
66
+ }
67
+ }
68
+ }, [theme, variant, isTablet, size, scrollable]);
69
+ }
70
+ //# sourceMappingURL=useTabsStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMemo","useBreakpointUp","useTheme","useTabsStyle","variant","size","scrollable","theme","isTablet","paddingHorizontal","container","paddingBottom","contentContainer","alignSelf","minWidth","justifyContent"],"sources":["useTabsStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { useBreakpointUp } from '../hooks';\nimport { useTheme } from '../styles';\nimport type { TabSize, TabVariant } from '../Tab';\n\ninterface TabsStyle {\n container: FountainUiStyle;\n contentContainer?: FountainUiStyle;\n}\n\nexport default function useTabsStyle(variant: TabVariant, size: TabSize, scrollable: boolean) {\n const theme = useTheme();\n\n const isTablet = useBreakpointUp('md', true, false);\n\n return useMemo<TabsStyle>(() => {\n switch (variant) {\n case 'circular': {\n const paddingHorizontal = isTablet ? 20 : (size === 'small' ? 8 : 12);\n\n return {\n container: {\n paddingBottom: 8,\n paddingHorizontal: scrollable ? 0 : paddingHorizontal,\n },\n contentContainer: {\n paddingHorizontal: scrollable ? paddingHorizontal : 0,\n },\n };\n }\n case 'circular-home': {\n const paddingHorizontal = isTablet ? 20 : 8;\n\n return {\n container: {\n paddingBottom: 8,\n paddingHorizontal: scrollable ? 0 : paddingHorizontal,\n },\n contentContainer: {\n paddingHorizontal: scrollable ? paddingHorizontal : 0,\n },\n };\n }\n case 'bottom-navigation': {\n const paddingHorizontal = 24;\n\n return {\n container: {\n ...(isTablet ? {\n alignSelf: 'center',\n minWidth: 460,\n } : {}),\n justifyContent: 'space-between',\n paddingHorizontal: scrollable ? 0 : paddingHorizontal,\n },\n contentContainer: {\n paddingHorizontal: scrollable ? paddingHorizontal : 0,\n },\n };\n }\n case 'default':\n default: {\n const paddingHorizontal = isTablet ? 14 : 6;\n\n return {\n container: {\n paddingHorizontal: scrollable ? 0 : paddingHorizontal,\n },\n contentContainer: {\n paddingHorizontal: scrollable ? paddingHorizontal : 0,\n },\n };\n }\n }\n }, [theme, variant, isTablet, size, scrollable]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,eAAT,QAAgC,UAAhC;AACA,SAASC,QAAT,QAAyB,WAAzB;AAQA,eAAe,SAASC,YAAT,CAAsBC,OAAtB,EAA2CC,IAA3C,EAA0DC,UAA1D,EAA+E;EAC1F,MAAMC,KAAK,GAAGL,QAAQ,EAAtB;EAEA,MAAMM,QAAQ,GAAGP,eAAe,CAAC,IAAD,EAAO,IAAP,EAAa,KAAb,CAAhC;EAEA,OAAOD,OAAO,CAAY,MAAM;IAC5B,QAAQI,OAAR;MACI,KAAK,UAAL;QAAiB;UACb,MAAMK,iBAAiB,GAAGD,QAAQ,GAAG,EAAH,GAASH,IAAI,KAAK,OAAT,GAAmB,CAAnB,GAAuB,EAAlE;UAEA,OAAO;YACHK,SAAS,EAAE;cACPC,aAAa,EAAE,CADR;cAEPF,iBAAiB,EAAEH,UAAU,GAAG,CAAH,GAAOG;YAF7B,CADR;YAKHG,gBAAgB,EAAE;cACdH,iBAAiB,EAAEH,UAAU,GAAGG,iBAAH,GAAuB;YADtC;UALf,CAAP;QASH;;MACD,KAAK,eAAL;QAAsB;UAClB,MAAMA,iBAAiB,GAAGD,QAAQ,GAAG,EAAH,GAAQ,CAA1C;UAEA,OAAO;YACHE,SAAS,EAAE;cACPC,aAAa,EAAE,CADR;cAEPF,iBAAiB,EAAEH,UAAU,GAAG,CAAH,GAAOG;YAF7B,CADR;YAKHG,gBAAgB,EAAE;cACdH,iBAAiB,EAAEH,UAAU,GAAGG,iBAAH,GAAuB;YADtC;UALf,CAAP;QASH;;MACD,KAAK,mBAAL;QAA0B;UACtB,MAAMA,iBAAiB,GAAG,EAA1B;UAEA,OAAO;YACHC,SAAS,EAAE,EACP,IAAIF,QAAQ,GAAG;gBACXK,SAAS,EAAE,QADA;gBAEXC,QAAQ,EAAE;cAFC,CAAH,GAGR,EAHJ,CADO;cAKPC,cAAc,EAAE,eALT;cAMPN,iBAAiB,EAAEH,UAAU,GAAG,CAAH,GAAOG;YAN7B,CADR;YASHG,gBAAgB,EAAE;cACdH,iBAAiB,EAAEH,UAAU,GAAGG,iBAAH,GAAuB;YADtC;UATf,CAAP;QAaH;;MACD,KAAK,SAAL;MACA;QAAS;UACL,MAAMA,iBAAiB,GAAGD,QAAQ,GAAG,EAAH,GAAQ,CAA1C;UAEA,OAAO;YACHE,SAAS,EAAE;cACPD,iBAAiB,EAAEH,UAAU,GAAG,CAAH,GAAOG;YAD7B,CADR;YAIHG,gBAAgB,EAAE;cACdH,iBAAiB,EAAEH,UAAU,GAAGG,iBAAH,GAAuB;YADtC;UAJf,CAAP;QAQH;IAxDL;EA0DH,CA3Da,EA2DX,CAACF,KAAD,EAAQH,OAAR,EAAiBI,QAAjB,EAA2BH,IAA3B,EAAiCC,UAAjC,CA3DW,CAAd;AA4DH"}
@@ -16,9 +16,29 @@ const styles = StyleSheet.create({
16
16
  input: {
17
17
  flexGrow: 1
18
18
  },
19
+ inputWrapper: {
20
+ flexGrow: 1
21
+ },
22
+ placeholderWrapper: { ...StyleSheet.absoluteFillObject,
23
+ justifyContent: 'center'
24
+ },
19
25
  secureToggleButton: {
20
26
  alignItems: 'flex-end',
21
27
  padding: 0
28
+ },
29
+ searchIconContainer: {
30
+ left: 12,
31
+ position: 'absolute'
32
+ },
33
+ loadingSinner: {
34
+ height: 19,
35
+ width: 19
36
+ },
37
+ clearButton: {
38
+ height: 36,
39
+ position: 'absolute',
40
+ right: 2,
41
+ width: 32
22
42
  }
23
43
  });
24
44
  const TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {
@@ -31,6 +51,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {
31
51
  onBlur,
32
52
  onChangeText: onChangeTextProp,
33
53
  onFocus,
54
+ placeholder: placeholderProp,
34
55
  placeholderTextColor: placeholderTextColorProp,
35
56
  secureTextEntry: secureTextEntryProp,
36
57
  showClearButton: showClearButtonProp,
@@ -72,13 +93,15 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {
72
93
 
73
94
  const showClearButton = showClearButtonProp ?? isSearch;
74
95
  const titleFontStyle = createFontStyle(theme, {
75
- // selector: (typography) => typography.caption1['semiBold']
96
+ selector: typography => typography.caption1['semiBold'],
76
97
  color: theme.palette.text.strong
77
98
  });
78
- const inputStyle = css([styles.input, variantStyles.inputStyle, Platform.OS === 'web' ? {
99
+ const inputStyle = css([styles.input, variantStyles.inputStyle, variantStyles.inputFontStyle, Platform.OS === 'web' ? {
79
100
  outlineWidth: 0
80
101
  } : {}, styleProp]);
81
- const placeholderTextColor = placeholderTextColorProp ?? theme.palette.status.disabledLabel;
102
+ const placeholderFontStyle = css([variantStyles.inputFontStyle, {
103
+ color: placeholderTextColorProp ?? theme.palette.status.disabledLabel
104
+ }]);
82
105
  const containerStyle = css([styles.root, variantStyles.containerStyle, {
83
106
  opacity: disabled ? 0.3 : 1
84
107
  }, containerStyleProp]);
@@ -87,28 +110,41 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {
87
110
  style: titleFontStyle
88
111
  }) : null, /*#__PURE__*/React.createElement(Row, {
89
112
  style: containerStyle
90
- }, isSearch ? isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, null) : /*#__PURE__*/React.createElement(Search, {
113
+ }, isSearch ? /*#__PURE__*/React.createElement(View, {
114
+ style: styles.searchIconContainer
115
+ }, isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, {
116
+ style: styles.loadingSinner
117
+ }) : /*#__PURE__*/React.createElement(Search, {
91
118
  color: 'base',
92
- height: 18,
93
- width: 18
94
- }) : null, /*#__PURE__*/React.createElement(TextInput, _extends({
119
+ height: 19,
120
+ width: 19
121
+ })) : null, /*#__PURE__*/React.createElement(View, {
122
+ style: styles.inputWrapper
123
+ }, /*#__PURE__*/React.createElement(View, {
124
+ pointerEvents: 'none',
125
+ style: styles.placeholderWrapper
126
+ }, placeholderProp && !value ? /*#__PURE__*/React.createElement(Text, {
127
+ children: placeholderProp,
128
+ numberOfLines: 1,
129
+ style: placeholderFontStyle
130
+ }) : null), /*#__PURE__*/React.createElement(TextInput, _extends({
95
131
  autoFocus: autoFocus,
96
132
  editable: !disabled,
97
133
  onBlur: handleBlur,
98
134
  onChangeText: handleChangeText,
99
135
  onFocus: handleFocus,
100
- placeholderTextColor: placeholderTextColor,
101
136
  ref: ref,
102
137
  secureTextEntry: secureTextEntry,
103
138
  style: inputStyle,
104
139
  value: value
105
- }, otherProps)), showClearButton && value !== null && value !== void 0 && value.length && value.length > 0 ? /*#__PURE__*/React.createElement(IconButton, {
140
+ }, otherProps))), showClearButton && value !== null && value !== void 0 && value.length && value.length > 0 ? /*#__PURE__*/React.createElement(IconButton, {
106
141
  color: 'base',
107
142
  children: /*#__PURE__*/React.createElement(Clear, {
108
- height: 13.75,
109
- width: 15
143
+ height: 17.31,
144
+ width: 15.9
110
145
  }),
111
- onPress: handleClear
146
+ onPress: handleClear,
147
+ style: styles.clearButton
112
148
  }) : null, secureTextEntryProp && !isSearch ? /*#__PURE__*/React.createElement(IconButton, {
113
149
  color: 'base',
114
150
  onPress: handleSecureTogglePress,
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","Platform","StyleSheet","Text","TextInput","View","css","IconButton","Clear","EyeOff","EyeOn","LoadingSpinner","Search","Row","createFontStyle","useTheme","useVariantStyleMap","styles","create","root","alignItems","flexGrow","input","secureToggleButton","padding","TextField","forwardRef","props","ref","autoFocus","containerStyle","containerStyleProp","editable","hint","isLoading","onBlur","onChangeText","onChangeTextProp","onFocus","placeholderTextColor","placeholderTextColorProp","secureTextEntry","secureTextEntryProp","showClearButton","showClearButtonProp","status","style","styleProp","title","value","variant","otherProps","isSearch","disabled","theme","isFocused","setIsFocused","setSecureTextEntry","variantStyles","handleBlur","event","handleFocus","handleSecureTogglePress","current","handleChangeText","text","handleClear","titleFontStyle","color","palette","strong","inputStyle","OS","outlineWidth","disabledLabel","opacity","length","hintStyle"],"sources":["TextField.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type { NativeSyntheticEvent, TextInputFocusEventData } from 'react-native';\nimport { Platform, StyleSheet, Text, TextInput, View } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { css } from '@fountain-ui/styles';\nimport IconButton from '../IconButton/IconButton';\nimport { Clear, EyeOff, EyeOn, LoadingSpinner, Search } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, useTheme } from '../styles';\nimport type TextFieldProps from './TextFieldProps';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n flexGrow: 1,\n },\n input: {\n flexGrow: 1,\n },\n secureToggleButton: {\n alignItems: 'flex-end',\n padding: 0,\n },\n});\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n autoFocus,\n containerStyle: containerStyleProp,\n editable = true,\n hint,\n isLoading,\n onBlur,\n onChangeText: onChangeTextProp,\n onFocus,\n placeholderTextColor: placeholderTextColorProp,\n secureTextEntry: secureTextEntryProp,\n showClearButton: showClearButtonProp,\n status = 'default' as TextFieldStatus,\n style: styleProp,\n title,\n value,\n variant = 'default' as TextFieldVariant,\n ...otherProps\n } = props;\n\n const isSearch = variant === 'search';\n\n const disabled = !editable || isLoading;\n\n const theme = useTheme();\n\n const [isFocused, setIsFocused] = useState<boolean>(autoFocus ?? false);\n const [secureTextEntry, setSecureTextEntry] = useState<boolean>(secureTextEntryProp ?? false);\n\n const variantStyles = useVariantStyleMap(variant, status, isFocused);\n\n const handleBlur = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(false);\n onBlur?.(event);\n };\n\n const handleFocus = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(true);\n onFocus?.(event);\n };\n\n const handleSecureTogglePress = () => {\n setSecureTextEntry((current) => !current);\n };\n\n const handleChangeText = (text: string) => {\n onChangeTextProp?.(text);\n };\n\n const handleClear = () => {\n handleChangeText('');\n };\n\n const showClearButton = showClearButtonProp ?? isSearch;\n\n const titleFontStyle = createFontStyle(theme, {\n // selector: (typography) => typography.caption1['semiBold']\n color: theme.palette.text.strong,\n });\n\n const inputStyle = css([\n styles.input,\n variantStyles.inputStyle,\n Platform.OS === 'web' ? { outlineWidth: 0 } as FountainUiStyle : {},\n styleProp,\n ]);\n\n const placeholderTextColor = placeholderTextColorProp ?? theme.palette.status.disabledLabel;\n\n const containerStyle = css([\n styles.root,\n variantStyles.containerStyle,\n { opacity: disabled ? 0.3 : 1 },\n containerStyleProp,\n ]);\n\n return (\n <View>\n {title && !isSearch ? (\n <Text\n children={title}\n style={titleFontStyle}\n />\n ) : null}\n\n <Row style={containerStyle}>\n {isSearch ? (\n isLoading ? (\n <LoadingSpinner/>\n ) : (\n <Search\n color={'base'}\n height={18}\n width={18}\n />\n )\n ) : null}\n\n <TextInput\n autoFocus={autoFocus}\n editable={!disabled}\n onBlur={handleBlur}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n placeholderTextColor={placeholderTextColor}\n ref={ref}\n secureTextEntry={secureTextEntry}\n style={inputStyle}\n value={value}\n {...otherProps}\n />\n\n {showClearButton && value?.length && value.length > 0 ? (\n <IconButton\n color={'base'}\n children={\n <Clear\n height={13.75}\n width={15}\n />\n }\n onPress={handleClear}\n />\n ) : null}\n\n {secureTextEntryProp && !isSearch ? (\n <IconButton\n color={'base'}\n onPress={handleSecureTogglePress}\n style={styles.secureToggleButton}\n >\n {secureTextEntry ? (\n <EyeOff\n height={19}\n width={17.42}\n />\n ) : (\n <EyeOn\n height={19}\n width={17.42}\n />\n )}\n </IconButton>\n ) : null}\n </Row>\n\n {hint && !isSearch ? (\n <Text\n children={hint}\n style={variantStyles.hintStyle}\n />\n ) : null}\n </View>\n );\n});\n\nexport default TextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,EAAqCC,SAArC,EAAgDC,IAAhD,QAA4D,cAA5D;AAEA,SAASC,GAAT,QAAoB,qBAApB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,KAAxB,EAA+BC,cAA/B,EAA+CC,MAA/C,QAA6D,mBAA7D;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAEA,MAAMC,MAAM,GAAGf,UAAU,CAACgB,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,UAAU,EAAE,QADV;IAEFC,QAAQ,EAAE;EAFR,CADuB;EAK7BC,KAAK,EAAE;IACHD,QAAQ,EAAE;EADP,CALsB;EAQ7BE,kBAAkB,EAAE;IAChBH,UAAU,EAAE,UADI;IAEhBI,OAAO,EAAE;EAFO;AARS,CAAlB,CAAf;AAcA,MAAMC,SAAS,gBAAG1B,KAAK,CAAC2B,UAAN,CAA4C,SAASD,SAAT,CAAmBE,KAAnB,EAA0BC,GAA1B,EAA+B;EACzF,MAAM;IACFC,SADE;IAEFC,cAAc,EAAEC,kBAFd;IAGFC,QAAQ,GAAG,IAHT;IAIFC,IAJE;IAKFC,SALE;IAMFC,MANE;IAOFC,YAAY,EAAEC,g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Y,EAAEK,gBAJlB;IAKI,OAAO,EAAEH,WALb;IAMI,oBAAoB,EAAEtB,oBAN1B;IAOI,GAAG,EAAEX,GAPT;IAQI,eAAe,EAAEa,eARrB;IASI,KAAK,EAAE8B,UATX;IAUI,KAAK,EAAEtB;EAVX,GAWQE,UAXR,EAbJ,EA2BKR,eAAe,IAAIM,KAAJ,aAAIA,KAAJ,eAAIA,KAAK,CAAE2B,MAA1B,IAAoC3B,KAAK,CAAC2B,MAAN,GAAe,CAAnD,gBACG,oBAAC,UAAD;IACI,KAAK,EAAE,MADX;IAEI,QAAQ,eACJ,oBAAC,KAAD;MACI,MAAM,EAAE,KADZ;MAEI,KAAK,EAAE;IAFX,EAHR;IAQI,OAAO,EAAEV;EARb,EADH,GAWG,IAtCR,EAwCKxB,mBAAmB,IAAI,CAACU,QAAxB,gBACG,oBAAC,UAAD;IACI,KAAK,EAAE,MADX;IAEI,OAAO,EAAEU,uBAFb;IAGI,KAAK,EAAE7C,MAAM,CAACM;EAHlB,GAKKkB,eAAe,gBACZ,oBAAC,MAAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EADY,gBAMZ,oBAAC,KAAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EAXR,CADH,GAkBG,IA1DR,CARJ,EAqEKR,IAAI,IAAI,CAACmB,QAAT,gBACG,oBAAC,IAAD;IACI,QAAQ,EAAEnB,IADd;IAEI,KAAK,EAAEyB,aAAa,CAACmB;EAFzB,EADH,GAKG,IA1ER,CADJ;AA8EH,CA3JiB,CAAlB;AA6JA,eAAepD,SAAf"}
1
+ {"version":3,"names":["React","useState","Platform","StyleSheet","Text","TextInput","View","css","IconButton","Clear","EyeOff","EyeOn","LoadingSpinner","Search","Row","createFontStyle","useTheme","useVariantStyleMap","styles","create","root","alignItems","flexGrow","input","inputWrapper","placeholderWrapper","absoluteFillObject","justifyContent","secureToggleButton","padding","searchIconContainer","left","position","loadingSinner","height","width","clearButton","right","TextField","forwardRef","props","ref","autoFocus","containerStyle","containerStyleProp","editable","hint","isLoading","onBlur","onChangeText","onChangeTextProp","onFocus","placeholder","placeholderProp","placeholderTextColor","placeholderTextColorProp","secureTextEntry","secureTextEntryProp","showClearButton","showClearButtonProp","status","style","styleProp","title","value","variant","otherProps","isSearch","disabled","theme","isFocused","setIsFocused","setSecureTextEntry","variantStyles","handleBlur","event","handleFocus","handleSecureTogglePress","current","handleChangeText","text","handleClear","titleFontStyle","selector","typography","caption1","color","palette","strong","inputStyle","inputFontStyle","OS","outlineWidth","placeholderFontStyle","disabledLabel","opacity","length","hintStyle"],"sources":["TextField.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type { NativeSyntheticEvent, TextInputFocusEventData } from 'react-native';\nimport { Platform, StyleSheet, Text, TextInput, View } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { css } from '@fountain-ui/styles';\nimport IconButton from '../IconButton/IconButton';\nimport { Clear, EyeOff, EyeOn, LoadingSpinner, Search } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, useTheme } from '../styles';\nimport type TextFieldProps from './TextFieldProps';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n flexGrow: 1,\n },\n input: {\n flexGrow: 1,\n },\n inputWrapper: {\n flexGrow: 1,\n },\n placeholderWrapper: {\n ...StyleSheet.absoluteFillObject,\n justifyContent: 'center',\n },\n secureToggleButton: {\n alignItems: 'flex-end',\n padding: 0,\n },\n searchIconContainer: {\n left: 12,\n position: 'absolute',\n },\n loadingSinner: {\n height: 19,\n width: 19,\n },\n clearButton: {\n height: 36,\n position: 'absolute',\n right: 2,\n width: 32,\n },\n});\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n autoFocus,\n containerStyle: containerStyleProp,\n editable = true,\n hint,\n isLoading,\n onBlur,\n onChangeText: onChangeTextProp,\n onFocus,\n placeholder: placeholderProp,\n placeholderTextColor: placeholderTextColorProp,\n secureTextEntry: secureTextEntryProp,\n showClearButton: showClearButtonProp,\n status = 'default' as TextFieldStatus,\n style: styleProp,\n title,\n value,\n variant = 'default' as TextFieldVariant,\n ...otherProps\n } = props;\n\n const isSearch = variant === 'search';\n\n const disabled = !editable || isLoading;\n\n const theme = useTheme();\n\n const [isFocused, setIsFocused] = useState<boolean>(autoFocus ?? false);\n const [secureTextEntry, setSecureTextEntry] = useState<boolean>(secureTextEntryProp ?? false);\n\n const variantStyles = useVariantStyleMap(variant, status, isFocused);\n\n const handleBlur = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(false);\n onBlur?.(event);\n };\n\n const handleFocus = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(true);\n onFocus?.(event);\n };\n\n const handleSecureTogglePress = () => {\n setSecureTextEntry((current) => !current);\n };\n\n const handleChangeText = (text: string) => {\n onChangeTextProp?.(text);\n };\n\n const handleClear = () => {\n handleChangeText('');\n };\n\n const showClearButton = showClearButtonProp ?? isSearch;\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.caption1['semiBold'],\n color: theme.palette.text.strong,\n });\n\n const inputStyle = css([\n styles.input,\n variantStyles.inputStyle,\n variantStyles.inputFontStyle,\n Platform.OS === 'web' ? { outlineWidth: 0 } as FountainUiStyle : {},\n styleProp,\n ]);\n\n const placeholderFontStyle = css([\n variantStyles.inputFontStyle,\n { color: placeholderTextColorProp ?? theme.palette.status.disabledLabel },\n ]);\n\n const containerStyle = css([\n styles.root,\n variantStyles.containerStyle,\n { opacity: disabled ? 0.3 : 1 },\n containerStyleProp,\n ]);\n\n return (\n <View>\n {title && !isSearch ? (\n <Text\n children={title}\n style={titleFontStyle}\n />\n ) : null}\n\n <Row style={containerStyle}>\n {isSearch ? (\n <View style={styles.searchIconContainer}>\n {isLoading ? (\n <LoadingSpinner style={styles.loadingSinner}/>\n ) : (\n <Search\n color={'base'}\n height={19}\n width={19}\n />\n )}\n </View>\n ) : null}\n\n <View style={styles.inputWrapper}>\n <View\n pointerEvents={'none'}\n style={styles.placeholderWrapper}\n >\n {placeholderProp && !value ? (\n <Text\n children={placeholderProp}\n numberOfLines={1}\n style={placeholderFontStyle}\n />\n ) : null}\n </View>\n\n <TextInput\n autoFocus={autoFocus}\n editable={!disabled}\n onBlur={handleBlur}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n ref={ref}\n secureTextEntry={secureTextEntry}\n style={inputStyle}\n value={value}\n {...otherProps}\n />\n </View>\n\n {showClearButton && value?.length && value.length > 0 ? (\n <IconButton\n color={'base'}\n children={\n <Clear\n height={17.31}\n width={15.9}\n />\n }\n onPress={handleClear}\n style={styles.clearButton}\n />\n ) : null}\n\n {secureTextEntryProp && !isSearch ? (\n <IconButton\n color={'base'}\n onPress={handleSecureTogglePress}\n style={styles.secureToggleButton}\n >\n {secureTextEntry ? (\n <EyeOff\n height={19}\n width={17.42}\n />\n ) : (\n <EyeOn\n height={19}\n width={17.42}\n />\n )}\n </IconButton>\n ) : null}\n </Row>\n\n {hint && !isSearch ? (\n <Text\n children={hint}\n style={variantStyles.hintStyle}\n />\n ) : null}\n </View>\n );\n});\n\nexport default TextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,EAAqCC,SAArC,EAAgDC,IAAhD,QAA4D,cAA5D;AAEA,SAASC,GAAT,QAAoB,qBAApB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,KAAxB,EAA+BC,cAA/B,EAA+CC,MAA/C,QAA6D,mBAA7D;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAE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I,KAAK,EAAE2B,aAAa,CAACwB;EAFzB,EADH,GAKG,IA3FR,CADJ;AA+FH,CAjLiB,CAAlB;AAmLA,eAAe3D,SAAf"}
@@ -38,25 +38,27 @@ export default function useVariantStyleMap(variant, status, isFocused) {
38
38
  return {
39
39
  containerStyle: {
40
40
  borderBottomColor: status === 'default' && isFocused ? theme.palette.border.strong : borderColor,
41
- borderBottomWidth: 1
41
+ borderBottomWidth: 1,
42
+ minHeight: 60,
43
+ paddingVertical: 16
42
44
  },
43
45
  inputStyle: {
44
- paddingRight: theme.spacing(4),
45
- paddingVertical: theme.spacing(4),
46
- ...createFontStyle(theme, {
47
- selector: _ => typographyOf({
48
- fontSize: 18,
49
- lineHeight: 27,
50
- fontFamily: 'Pretendard-SemiBold',
51
- letterSpacing: 0
52
- }),
53
- color: theme.palette.text.strong
54
- })
46
+ padding: 0,
47
+ paddingRight: 16
55
48
  },
49
+ inputFontStyle: createFontStyle(theme, {
50
+ selector: _ => typographyOf({
51
+ fontSize: 18,
52
+ lineHeight: 27,
53
+ fontFamily: 'PretendardStd-SemiBold',
54
+ letterSpacing: 0
55
+ }),
56
+ color: theme.palette.text.strong
57
+ }),
56
58
  hintStyle: {
57
59
  marginTop: theme.spacing(2),
58
60
  ...createFontStyle(theme, {
59
- // selector: (typography) => typography.caption1['regular']
61
+ selector: typography => typography.caption1['regular'],
60
62
  color: hintColor
61
63
  })
62
64
  }
@@ -69,24 +71,22 @@ export default function useVariantStyleMap(variant, status, isFocused) {
69
71
  borderColor: theme.palette.border.base,
70
72
  borderRadius: theme.shape.radius.md,
71
73
  borderWidth: 0.5,
72
- paddingLeft: theme.spacing(3),
73
- paddingRight: theme.spacing(0.5)
74
+ paddingBottom: 12,
75
+ paddingHorizontal: 39,
76
+ paddingTop: 11
74
77
  },
75
78
  inputStyle: {
76
- paddingBottom: theme.spacing(2.5),
77
- paddingLeft: theme.spacing(2),
78
- paddingRight: theme.spacing(1),
79
- paddingTop: theme.spacing(2.25),
80
- ...createFontStyle(theme, {
81
- selector: _ => typographyOf({
82
- fontSize: 16,
83
- lineHeight: 19.2,
84
- fontFamily: 'Pretendard-SemiBold',
85
- letterSpacing: -0.16
86
- }),
87
- color: theme.palette.text.strong
88
- })
89
- }
79
+ padding: 0
80
+ },
81
+ inputFontStyle: createFontStyle(theme, {
82
+ selector: _ => typographyOf({
83
+ fontSize: 16,
84
+ lineHeight: 19.2,
85
+ fontFamily: 'PretendardStd-SemiBold',
86
+ letterSpacing: -0.16
87
+ }),
88
+ color: theme.palette.text.strong
89
+ })
90
90
  };
91
91
  }
92
92
  }, [theme, borderColor, hintColor, variant, isFocused]);
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","typographyOf","createFontStyle","useTheme","useStatusColor","theme","status","borderColor","palette","border","base","hintColor","text","weak","success","danger","useVariantStyleMap","variant","isFocused","containerStyle","borderBottomColor","strong","borderBottomWidth","inputStyle","paddingRight","spacing","paddingVertical","selector","_","fontSize","lineHeight","fontFamily","letterSpacing","color","hintStyle","marginTop","backgroundColor","surface","supportive","borderRadius","shape","radius","md","borderWidth","paddingLeft","paddingBottom","paddingTop"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle, Theme } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\n\ninterface VariantStyleMap {\n containerStyle?: FountainUiStyle;\n inputStyle?: FountainUiStyle;\n hintStyle?: FountainUiStyle;\n}\n\nfunction useStatusColor(theme: Theme, status: TextFieldStatus): { borderColor: string; hintColor: string; } {\n switch (status) {\n default:\n case 'default':\n return {\n borderColor: theme.palette.border.base,\n hintColor: theme.palette.text.weak,\n };\n case 'success':\n return {\n borderColor: theme.palette.status.success,\n hintColor: theme.palette.status.success,\n };\n case 'error':\n return {\n borderColor: theme.palette.status.danger,\n hintColor: theme.palette.status.danger,\n };\n }\n}\n\nexport default function useVariantStyleMap(variant: TextFieldVariant, status: TextFieldStatus, isFocused: boolean): VariantStyleMap {\n const theme = useTheme();\n\n const {\n borderColor,\n hintColor,\n } = useStatusColor(theme, status);\n\n return useMemo(() => {\n switch (variant) {\n default:\n case 'default':\n return {\n containerStyle: {\n borderBottomColor: status === 'default' && isFocused ? theme.palette.border.strong : borderColor,\n borderBottomWidth: 1,\n },\n inputStyle: {\n paddingRight: theme.spacing(4),\n paddingVertical: theme.spacing(4),\n ...createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 18,\n lineHeight: 27,\n fontFamily: 'Pretendard-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n },\n hintStyle: {\n marginTop: theme.spacing(2),\n ...createFontStyle(theme, {\n // selector: (typography) => typography.caption1['regular']\n color: hintColor,\n }),\n },\n };\n case 'search':\n return {\n containerStyle: {\n backgroundColor: theme.palette.surface.supportive,\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.md,\n borderWidth: 0.5,\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(0.5),\n },\n inputStyle: {\n paddingBottom: theme.spacing(2.5),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(1),\n paddingTop: theme.spacing(2.25),\n ...createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 19.2,\n fontFamily: 'Pretendard-SemiBold',\n letterSpacing: -0.16,\n }),\n color: theme.palette.text.strong,\n }),\n },\n };\n }\n }, [theme, borderColor, hintColor, variant, isFocused]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAEA,SAASC,YAAT,QAA6B,qBAA7B;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;;AASA,SAASC,cAAT,CAAwBC,KAAxB,EAAsCC,MAAtC,EAA4G;EACxG,QAAQA,MAAR;IACI;IACA,KAAK,SAAL;MACI,OAAO;QACHC,WAAW,EAAEF,KAAK,CAACG,O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cI,IAAd,CAAmBS;YAPJ,CAAR;UALV;QATT,CAAP;IA9BR;EAwDH,CAzDa,EAyDX,CAAChB,KAAD,EAAQE,WAAR,EAAqBI,SAArB,EAAgCM,OAAhC,EAAyCC,SAAzC,CAzDW,CAAd;AA0DH"}
1
+ {"version":3,"names":["useMemo","typographyOf","createFontStyle","useTheme","useStatusColor","theme","status","borderColor","palette","border","base","hintColor","text","weak","success","danger","useVariantStyleMap","variant","isFocused","containerStyle","borderBottomColor","strong","borderBottomWidth","minHeight","paddingVertical","inputStyle","padding","paddingRight","inputFontStyle","selector","_","fontSize","lineHeight","fontFamily","letterSpacing","color","hintStyle","marginTop","spacing","typography","caption1","backgroundColor","surface","supportive","borderRadius","shape","radius","md","borderWidth","paddingBottom","paddingHorizontal","paddingTop"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle, Theme } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\n\ninterface VariantStyleMap {\n containerStyle?: FountainUiStyle;\n inputFontStyle?: TextStyle;\n inputStyle?: FountainUiStyle;\n hintStyle?: FountainUiStyle;\n}\n\nfunction useStatusColor(theme: Theme, status: TextFieldStatus): { borderColor: string; hintColor: string; } {\n switch (status) {\n default:\n case 'default':\n return {\n borderColor: theme.palette.border.base,\n hintColor: theme.palette.text.weak,\n };\n case 'success':\n return {\n borderColor: theme.palette.status.success,\n hintColor: theme.palette.status.success,\n };\n case 'error':\n return {\n borderColor: theme.palette.status.danger,\n hintColor: theme.palette.status.danger,\n };\n }\n}\n\nexport default function useVariantStyleMap(variant: TextFieldVariant, status: TextFieldStatus, isFocused: boolean): VariantStyleMap {\n const theme = useTheme();\n\n const {\n borderColor,\n hintColor,\n } = useStatusColor(theme, status);\n\n return useMemo(() => {\n switch (variant) {\n default:\n case 'default':\n return {\n containerStyle: {\n borderBottomColor: status === 'default' && isFocused ? theme.palette.border.strong : borderColor,\n borderBottomWidth: 1,\n minHeight: 60,\n paddingVertical: 16,\n },\n inputStyle: {\n padding: 0,\n paddingRight: 16,\n },\n inputFontStyle: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 18,\n lineHeight: 27,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n hintStyle: {\n marginTop: theme.spacing(2),\n ...createFontStyle(theme, {\n selector: (typography) => typography.caption1['regular'],\n color: hintColor,\n }),\n },\n };\n case 'search':\n return {\n containerStyle: {\n backgroundColor: theme.palette.surface.supportive,\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.md,\n borderWidth: 0.5,\n paddingBottom: 12,\n paddingHorizontal: 39,\n paddingTop: 11,\n },\n inputStyle: {\n padding: 0,\n },\n inputFontStyle: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 19.2,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: -0.16,\n }),\n color: theme.palette.text.strong,\n }),\n };\n }\n }, [theme, borderColor, hintColor, variant, isFocused]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,YAAT,QAA6B,qBAA7B;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;;AAUA,SAASC,cAAT,CAAwBC,KAAxB,EAAsCC,MAAtC,EAA4G;EACxG,QAAQA,MAAR;IACI;IACA,KAAK,SAAL;MACI,OAAO;QACHC,WAAW,EAAEF,KAAK,CAACG,OAAN,CAAcC,MAAd,CAAqBC,IAD/B;QAEHC,SAAS,EAAEN,KAAK,CAACG,OAAN,CAAcI,IAAd,CAAmBC;MAF3B,CAAP;;IAIJ,KAAK,SAAL;MACI,OAAO;QACHN,WAAW,EAAEF,KAAK,CAACG,OAAN,CAAcF,MAAd,CAAqBQ,OAD/B;QAEHH,SAAS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G,KAAD,EAAQ;cACtBwB,QAAQ,EAAGU,UAAD,IAAgBA,UAAU,CAACC,QAAX,CAAoB,SAApB,CADJ;cAEtBL,KAAK,EAAExB;YAFe,CAAR;UAFX;QApBR,CAAP;;MA4BJ,KAAK,QAAL;QACI,OAAO;UACHQ,cAAc,EAAE;YACZsB,eAAe,EAAEpC,KAAK,CAACG,OAAN,CAAckC,OAAd,CAAsBC,UAD3B;YAEZpC,WAAW,EAAEF,KAAK,CAACG,OAAN,CAAcC,MAAd,CAAqBC,IAFtB;YAGZkC,YAAY,EAAEvC,KAAK,CAACwC,KAAN,CAAYC,MAAZ,CAAmBC,EAHrB;YAIZC,WAAW,EAAE,GAJD;YAKZC,aAAa,EAAE,EALH;YAMZC,iBAAiB,EAAE,EANP;YAOZC,UAAU,EAAE;UAPA,CADb;UAUH1B,UAAU,EAAE;YACRC,OAAO,EAAE;UADD,CAVT;UAaHE,cAAc,EAAE1B,eAAe,CAACG,KAAD,EAAQ;YACnCwB,QAAQ,EAAGC,CAAD,IAAO7B,YAAY,CAAC;cAC1B8B,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,IAFc;cAG1BC,UAAU,EAAE,wBAHc;cAI1BC,aAAa,EAAE,CAAC;YAJU,CAAD,CADM;YAOnCC,KAAK,EAAE9B,KAAK,CAACG,OAAN,CAAcI,IAAd,CAAmBS;UAPS,CAAR;QAb5B,CAAP;IAhCR;EAwDH,CAzDa,EAyDX,CAAChB,KAAD,EAAQE,WAAR,EAAqBI,SAArB,EAAgCM,OAAhC,EAAyCC,SAAzC,CAzDW,CAAd;AA0DH"}
@@ -0,0 +1,32 @@
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 from 'react';
4
+ import { StyleSheet } from 'react-native';
5
+ import IconButton from '../../IconButton';
6
+ import { AppBarChevronLeft } from '../../internal';
7
+ import { css } from '@fountain-ui/styles';
8
+ const styles = StyleSheet.create({
9
+ root: {
10
+ height: 40,
11
+ left: 4,
12
+ paddingLeft: 5,
13
+ paddingRight: 11,
14
+ paddingVertical: 8,
15
+ position: 'absolute',
16
+ width: 40
17
+ }
18
+ });
19
+ export default function BackButton(props) {
20
+ const {
21
+ style: styleProp,
22
+ ...otherProps
23
+ } = props;
24
+ const rootStyle = css([styles.root, styleProp]);
25
+ return /*#__PURE__*/React.createElement(IconButton, _extends({
26
+ style: rootStyle
27
+ }, otherProps), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AppBarChevronLeft, {
28
+ height: 24,
29
+ width: 24
30
+ })));
31
+ }
32
+ //# sourceMappingURL=BackButton.js.map