@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
@@ -11,8 +11,6 @@ var _reactNative = require("react-native");
11
11
 
12
12
  var _Badge = _interopRequireDefault(require("../Badge"));
13
13
 
14
- var _Spacer = _interopRequireDefault(require("../Spacer"));
15
-
16
14
  var _TabBase = _interopRequireDefault(require("../TabBase"));
17
15
 
18
16
  var _styles = require("../styles");
@@ -43,41 +41,45 @@ function Tab(props) {
43
41
  children,
44
42
  enableIndicator = false,
45
43
  icon: defaultIcon,
44
+ parentColor = 'default',
46
45
  selected = false,
47
46
  selectedIcon,
47
+ size = 'medium',
48
48
  variant = 'default',
49
49
  style: styleProp,
50
+ innerStyle: innerStyleProp,
50
51
  onTabInnerLayout,
51
52
  ...otherProps
52
53
  } = props;
53
- const theme = (0, _styles.useTheme)();
54
- const vertical = variant === 'bottom-navigation';
55
54
  const {
56
55
  container: containerStyle,
56
+ iconContainer: iconContainerStyle,
57
57
  inner: innerStyle,
58
58
  label: labelStyle
59
- } = (0, _useVariantStyleMap.default)(variant, selected);
59
+ } = (0, _useVariantStyleMap.default)(variant, selected, size, parentColor);
60
60
  const tabBaseStyle = (0, _styles.css)([styles.root, containerStyle, styleProp]);
61
- const tabInnerStyle = (0, _styles.css)([styles.filledInner, innerStyle]);
62
- const pressEffect = selected ? 'none' : 'opacity';
61
+ const tabInnerStyle = (0, _styles.css)([styles.filledInner, innerStyle, innerStyleProp]);
63
62
  const icon = selected ? selectedIcon || defaultIcon : defaultIcon;
64
- const iconColor = selected ? theme.palette.icon.strong : theme.palette.icon.base;
65
- const iconElement = (0, _utils.cloneElementSafely)(icon, {
66
- fill: iconColor
67
- });
63
+ const iconElement = (0, _utils.cloneElementSafely)(icon);
68
64
  const tabElement = typeof children !== 'string' ? (0, _utils.cloneElementSafely)(children, {
69
65
  selected
70
66
  }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconElement ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Badge.default, {
71
- invisible: !badgeVisible
72
- }, iconElement), /*#__PURE__*/_react.default.createElement(_Spacer.default, {
73
- size: 1.25
74
- })) : null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
67
+ horizontalOffset: -4,
68
+ invisible: !badgeVisible,
69
+ verticalOffset: -4
70
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
71
+ style: iconContainerStyle
72
+ }, iconElement)), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
73
+ style: (0, _styles.css)(labelStyle)
74
+ }, children)) : /*#__PURE__*/_react.default.createElement(_Badge.default, {
75
+ horizontalOffset: -7,
76
+ invisible: !badgeVisible,
77
+ verticalOffset: 3
78
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
75
79
  style: (0, _styles.css)(labelStyle)
76
- }, children));
80
+ }, children)));
77
81
  return /*#__PURE__*/_react.default.createElement(_TabBase.default, _extends({
78
- pressEffect: pressEffect,
79
- style: tabBaseStyle,
80
- vertical: vertical
82
+ style: tabBaseStyle
81
83
  }, otherProps), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
82
84
  onLayout: onTabInnerLayout,
83
85
  style: tabInnerStyle
@@ -1 +1 @@
1
- {"version":3,"names":["styles","StyleSheet","create","root","Platform","OS","minWidth","filledInner","alignItems","justifyContent","Tab","props","badgeVisible","children","enableIndicator","icon","defaultIcon","selected","selectedIcon","variant","style","styleProp","onTabInnerLayout","otherProps","theme","useTheme","vertical","container","containerStyle","inner","innerStyle","label","labelStyle","useVariantStyleMap","tabBaseStyle","css","tabInnerStyle","pressEffect","iconColor","palette","strong","base","iconElement","cloneElementSafely","fill","tabElement"],"sources":["Tab.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, View } from 'react-native';\nimport Badge from '../Badge';\nimport Spacer from '../Spacer';\nimport TabBase from '../TabBase';\nimport { css, StyleSheet, useTheme } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type TabProps from './TabProps';\nimport type { TabVariant } from './TabProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst styles = StyleSheet.create({\n root: {\n // TODO: Remove redundant platform checking\n ...(Platform.OS === 'web' ? { minWidth: 'auto' } : {}),\n },\n filledInner: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport default function Tab(props: TabProps) {\n const {\n badgeVisible = false,\n children,\n enableIndicator = false,\n icon: defaultIcon,\n selected = false,\n selectedIcon,\n variant = 'default' as TabVariant,\n style: styleProp,\n onTabInnerLayout,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const vertical = variant === 'bottom-navigation';\n\n const {\n container: containerStyle,\n inner: innerStyle,\n label: labelStyle,\n } = useVariantStyleMap(variant, selected);\n\n const tabBaseStyle = css([\n styles.root,\n containerStyle,\n styleProp,\n ]);\n\n const tabInnerStyle = css([\n styles.filledInner,\n innerStyle,\n ]);\n\n const pressEffect = selected ? 'none' : 'opacity';\n\n const icon = selected ? (selectedIcon || defaultIcon) : defaultIcon;\n const iconColor = selected ? theme.palette.icon.strong : theme.palette.icon.base;\n const iconElement = cloneElementSafely(icon, { fill: iconColor });\n\n const tabElement = typeof children !== 'string' ? (\n cloneElementSafely(children, {\n selected,\n })\n ) : (\n <React.Fragment>\n {iconElement ? (\n <React.Fragment>\n <Badge invisible={!badgeVisible}>\n {iconElement}\n </Badge>\n\n <Spacer size={1.25}/>\n </React.Fragment>\n ) : null}\n\n <Text style={css(labelStyle)}>\n {children}\n </Text>\n </React.Fragment>\n );\n\n return (\n <TabBase\n pressEffect={pressEffect}\n style={tabBaseStyle}\n vertical={vertical}\n {...otherProps}\n >\n <View onLayout={onTabInnerLayout} style={tabInnerStyle}>\n {t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WAApB,GAAmCA,WAAxD;EACA,MAAMsB,SAAS,GAAGrB,QAAQ,GAAGO,KAAK,CAACe,OAAN,CAAcxB,IAAd,CAAmByB,MAAtB,GAA+BhB,KAAK,CAACe,OAAN,CAAcxB,IAAd,CAAmB0B,IAA5E;EACA,MAAMC,WAAW,GAAG,IAAAC,yBAAA,EAAmB5B,IAAnB,EAAyB;IAAE6B,IAAI,EAAEN;EAAR,CAAzB,CAApB;EAEA,MAAMO,UAAU,GAAG,OAAOhC,QAAP,KAAoB,QAApB,GACf,IAAA8B,yBAAA,EAAmB9B,QAAnB,EAA6B;IACzBI;EADyB,CAA7B,CADe,gBAKf,6BAAC,cAAD,CAAO,QAAP,QACKyB,WAAW,gBACR,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,cAAD;IAAO,SAAS,EAAE,CAAC9B;EAAnB,GACK8B,WADL,CADJ,eAKI,6BAAC,eAAD;IAAQ,IAAI,EAAE;EAAd,EALJ,CADQ,GAQR,IATR,eAWI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAP,WAAA,EAAIH,UAAJ;EAAb,GACKnB,QADL,CAXJ,CALJ;EAsBA,oBACI,6BAAC,gBAAD;IACI,WAAW,EAAEwB,WADjB;IAEI,KAAK,EAAEH,YAFX;IAGI,QAAQ,EAAER;EAHd,GAIQH,UAJR,gBAMI,6BAAC,iBAAD;IAAM,QAAQ,EAAED,gBAAhB;IAAkC,KAAK,EAAEc;EAAzC,GACKS,UADL,CANJ,CADJ;AAYH;;AAAA"}
1
+ {"version":3,"names":["styles","StyleSheet","create","root","Platform","OS","minWidth","filledInner","alignItems","justifyContent","Tab","props","badgeVisible","children","enableIndicator","icon","defaultIcon","parentColor","selected","selectedIcon","size","variant","style","styleProp","innerStyle","innerStyleProp","onTabInnerLayout","otherProps","container","containerStyle","iconContainer","iconContainerStyle","inner","label","labelStyle","useVariantStyleMap","tabBaseStyle","css","tabInnerStyle","iconElement","cloneElementSafely","tabElement"],"sources":["Tab.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, View } from 'react-native';\nimport Badge from '../Badge';\nimport TabBase from '../TabBase';\nimport type { TabsColor } from '../Tabs';\nimport { css, StyleSheet } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type TabProps from './TabProps';\nimport type { TabSize, TabVariant } from './TabProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst styles = StyleSheet.create({\n root: {\n // TODO: Remove redundant platform checking\n ...(Platform.OS === 'web' ? { minWidth: 'auto' } : {}),\n },\n filledInner: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport default function Tab(props: TabProps) {\n const {\n badgeVisible = false,\n children,\n enableIndicator = false,\n icon: defaultIcon,\n parentColor = 'default' as TabsColor,\n selected = false,\n selectedIcon,\n size = 'medium' as TabSize,\n variant = 'default' as TabVariant,\n style: styleProp,\n innerStyle: innerStyleProp,\n onTabInnerLayout,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n iconContainer: iconContainerStyle,\n inner: innerStyle,\n label: labelStyle,\n } = useVariantStyleMap(variant, selected, size, parentColor);\n\n const tabBaseStyle = css([\n styles.root,\n containerStyle,\n styleProp,\n ]);\n\n const tabInnerStyle = css([\n styles.filledInner,\n innerStyle,\n innerStyleProp,\n ]);\n\n const icon = selected ? (selectedIcon || defaultIcon) : defaultIcon;\n const iconElement = cloneElementSafely(icon);\n\n const tabElement = typeof children !== 'string' ? (\n cloneElementSafely(children, {\n selected,\n })\n ) : (\n <React.Fragment>\n {iconElement ? (\n <React.Fragment>\n <Badge\n horizontalOffset={-4}\n invisible={!badgeVisible}\n verticalOffset={-4}\n >\n <View style={iconContainerStyle}>\n {iconElement}\n </View>\n </Badge>\n\n <Text style={css(labelStyle)}>\n {children}\n </Text>\n </React.Fragment>\n ) : (\n <Badge\n horizontalOffset={-7}\n invisible={!badgeVisible}\n verticalOffset={3}\n >\n <Text style={css(labelStyle)}>\n {children}\n </Text>\n </Badge>\n )}\n </React.Fragment>\n );\n\n return (\n <TabBase\n style={tabBaseStyle}\n {...otherProps}\n >\n <View onLayout={onTabInnerLayout} style={tabInnerStyle}>\n {tabElement}\n </View>\n </TabBase>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAGA;;;;;;AAEA,MAAMA,MAAM,GAAGC,kBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE,EACF;IACA,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAAhB,GAAwB;MAAEC,QAAQ,EAAE;IAAZ,CAAxB,GAA+C,EAAnD;EAFE,CADuB;EAK7BC,WAAW,EAAE;IACTC,UAAU,EAAE,QADH;IAETC,cAAc,EAAE;EAFP;AALgB,CAAlB,CAAf;;AAWe,SAASC,GAAT,CAAaC,KAAb,EAA8B;EACzC,MAAM;IACFC,YAAY,GAAG,KADb;IAEFC,QAFE;IAGFC,eAAe,GAAG,KAHhB;IAIFC,IAAI,EAAEC,WAJJ;IAKFC,WAAW,GAAG,SALZ;IAMFC,QAAQ,GAAG,KANT;IAOFC,YAPE;IAQFC,IAAI,GAAG,QARL;IASFC,OAAO,GAAG,SATR;IAUFC,KAAK,EAAEC,SAVL;IAWFC,UAAU,EAAEC,cAXV;IAYFC,gBAZE;IAaF,GAAGC;EAbD,IAcFhB,KAdJ;EAgBA,MAAM;IACFiB,SAAS,EAAEC,cADT;IAEFC,aAAa,EAAEC,kBAFb;IAGFC,KAAK,EAAER,UAHL;IAIFS,KAAK,EAAEC;EAJL,IAKF,IAAAC,2BAAA,EAAmBd,OAAnB,EAA4BH,QAA5B,EAAsCE,IAAtC,EAA4CH,WAA5C,CALJ;EAOA,MAAMmB,YAAY,GAAG,IAAAC,WAAA,EAAI,CACrBrC,MAAM,CAACG,IADc,EAErB0B,cAFqB,EAGrBN,SAHqB,CAAJ,CAArB;EAMA,MAAMe,aAAa,GAAG,IAAAD,WAAA,EAAI,CACtBrC,MAAM,CAACO,WADe,EAEtBiB,UAFsB,EAGtBC,cAHsB,CAAJ,CAAtB;EAMA,MAAMV,IAAI,GAAGG,QAAQ,GAAIC,YAAY,IAAIH,WAApB,GAAmCA,WAAxD;EACA,MAAMuB,WAAW,GAAG,IAAAC,yBAAA,EAAmBzB,IAAnB,CAApB;EAEA,MAAM0B,UAAU,GAAG,OAAO5B,QAAP,KAAoB,QAApB,GACf,IAAA2B,yBAAA,EAAmB3B,QAAnB,EAA6B;IACzBK;EADyB,CAA7B,CADe,gBAKf,6BAAC,cAAD,CAAO,QAAP,QACKqB,WAAW,gBACR,6BAAC,cAAD,CAAO,QAAP,qBACI,6BAAC,cAAD;IACI,gBAAgB,EAAE,CAAC,CADvB;IAEI,SAAS,EAAE,CAAC3B,YAFhB;IAGI,cAAc,EAAE,CAAC;EAHrB,gBAKI,6BAAC,iBAAD;IAAM,KAAK,EAAEmB;EAAb,GACKQ,WADL,CALJ,CADJ,eAWI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAF,WAAA,EAAIH,UAAJ;EAAb,GACKrB,QADL,CAXJ,CADQ,gBAiBR,6BAAC,cAAD;IACI,gBAAgB,EAAE,CAAC,CADvB;IAEI,SAAS,EAAE,CAACD,YAFhB;IAGI,cAAc,EAAE;EAHpB,gBAKI,6BAAC,iBAAD;IAAM,KAAK,EAAE,IAAAyB,WAAA,EAAIH,UAAJ;EAAb,GACKrB,QADL,CALJ,CAlBR,CALJ;EAoCA,oBACI,6BAAC,gBAAD;IACI,KAAK,EAAEuB;EADX,GAEQT,UAFR,gBAII,6BAAC,iBAAD;IAAM,QAAQ,EAAED,gBAAhB;IAAkC,KAAK,EAAEY;EAAzC,GACKG,UADL,CAJJ,CADJ;AAUH;;AAAA"}
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tabVariants = void 0;
7
- const tabVariants = ['default', 'circular', 'bottom-navigation'];
6
+ exports.tabVariants = exports.tabSizes = void 0;
7
+ const tabSizes = ['small', 'medium'];
8
+ exports.tabSizes = tabSizes;
9
+ const tabVariants = ['default', 'circular', 'circular-home', 'bottom-navigation'];
8
10
  exports.tabVariants = tabVariants;
9
11
  //# sourceMappingURL=TabProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tabVariants"],"sources":["TabProps.ts"],"sourcesContent":["import React from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport type { TabBaseProps } from '../TabBase';\nimport type { OverridableComponentProps } from '../types';\n\nexport const tabVariants = ['default', 'circular', 'bottom-navigation'] as const;\nexport type TabVariant = typeof tabVariants[number];\n\nexport default interface TabProps extends OverridableComponentProps<TabBaseProps, {\n /**\n * If `true`, the badge is visible.\n * @default false\n */\n badgeVisible?: boolean;\n\n /**\n * The label of the Tab.\n */\n children: string | React.ReactElement;\n\n /**\n * If `true`, the indicator is enabled.\n * @default false\n */\n enableIndicator?: boolean;\n\n /**\n * If `true`, the component is selected.\n * @default false\n */\n selected?: boolean;\n\n /**\n * Element placed before the children.\n */\n icon?: React.ReactElement;\n\n /**\n * If supplied, use this icon on selected state.\n */\n selectedIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'default'\n */\n variant?: TabVariant;\n\n /**\n * Function to be passed to the child component's onLayout prop.\n */\n onTabInnerLayout?: (event: LayoutChangeEvent) => void;\n}> {}\n"],"mappings":";;;;;;AAKO,MAAMA,WAAW,GAAG,CAAC,SAAD,EAAY,UAAZ,EAAwB,mBAAxB,CAApB"}
1
+ {"version":3,"names":["tabSizes","tabVariants"],"sources":["TabProps.ts"],"sourcesContent":["import React from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport type { TabBaseProps } from '../TabBase';\nimport type { TabsColor } from '../Tabs';\nimport type { ExtendedStyle, OverridableComponentProps } from '../types';\n\nexport const tabSizes = ['small', 'medium'] as const;\nexport type TabSize = typeof tabSizes[number];\n\nexport const tabVariants = ['default', 'circular', 'circular-home', 'bottom-navigation'] as const;\nexport type TabVariant = typeof tabVariants[number];\n\nexport default interface TabProps extends OverridableComponentProps<TabBaseProps, {\n /**\n * If `true`, the badge is visible.\n * @default false\n */\n badgeVisible?: boolean;\n\n /**\n * The label of the Tab.\n */\n children: string | React.ReactElement;\n\n /**\n * If `true`, the indicator is enabled.\n * @default false\n */\n enableIndicator?: boolean;\n\n /**\n * The color value inherited from the parent Tabs component.\n * This allows Tab components to apply consistent styling based on the Tabs container's color scheme.\n * @default 'default'\n */\n parentColor?: TabsColor;\n\n /**\n * If `true`, the component is selected.\n * @default false\n */\n selected?: boolean;\n\n /**\n * Element placed before the children.\n */\n icon?: React.ReactElement;\n\n /**\n * If supplied, use this icon on selected state.\n */\n selectedIcon?: React.ReactElement;\n\n /**\n * The size of the Tab.\n * @default 'medium'\n */\n size?: TabSize;\n\n /**\n * The variant to use.\n * @default 'default'\n */\n variant?: TabVariant;\n\n /**\n * Function to be passed to the child component's onLayout prop.\n */\n onTabInnerLayout?: (event: LayoutChangeEvent) => void;\n\n /**\n * Custom style to apply to the inner container of the Tab.\n * This allows customization of the tab's inner layout and appearance.\n */\n innerStyle?: ExtendedStyle | ExtendedStyle[];\n}> {}\n"],"mappings":";;;;;;AAMO,MAAMA,QAAQ,GAAG,CAAC,OAAD,EAAU,QAAV,CAAjB;;AAGA,MAAMC,WAAW,GAAG,CAAC,SAAD,EAAY,UAAZ,EAAwB,eAAxB,EAAyC,mBAAzC,CAApB"}
@@ -9,8 +9,22 @@ Object.defineProperty(exports, "default", {
9
9
  return _Tab.default;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "tabSizes", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _TabProps.tabSizes;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "tabVariants", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _TabProps.tabVariants;
22
+ }
23
+ });
12
24
 
13
25
  var _Tab = _interopRequireDefault(require("./Tab"));
14
26
 
27
+ var _TabProps = require("./TabProps");
28
+
15
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Tab';\nexport type { default as TabProps, TabVariant } from './TabProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Tab';\nexport type { default as TabProps, TabSize, TabVariant } from './TabProps';\nexport { tabSizes, tabVariants } from './TabProps';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA"}
@@ -11,7 +11,7 @@ var _styles = require("@fountain-ui/styles");
11
11
 
12
12
  var _styles2 = require("../styles");
13
13
 
14
- function useVariantStyleMap(variant, selected) {
14
+ function useVariantStyleMap(variant, selected, size, parentColor) {
15
15
  const theme = (0, _styles2.useTheme)();
16
16
  return (0, _react.useMemo)(() => {
17
17
  switch (variant) {
@@ -22,19 +22,50 @@ function useVariantStyleMap(variant, selected) {
22
22
  paddingVertical: theme.spacing(1)
23
23
  },
24
24
  inner: {
25
- backgroundColor: selected ? theme.palette.fill.base : theme.palette.fill.weaker,
25
+ backgroundColor: selected ? theme.palette.fill.base : parentColor === 'alt' ? theme.palette.surface.base : theme.palette.fill.weaker,
26
26
  borderRadius: theme.shape.radius.full,
27
- paddingHorizontal: theme.spacing(4),
28
- paddingVertical: theme.spacing(1.75)
27
+ flexDirection: 'row',
28
+ gap: 5,
29
+ paddingBottom: 7.5,
30
+ paddingHorizontal: 14,
31
+ paddingTop: 6.5
32
+ },
33
+ label: (0, _styles2.createFontStyle)(theme, {
34
+ selector: _ => (0, _styles.typographyOf)({
35
+ fontSize: size === 'small' ? 14 : 15,
36
+ lineHeight: size === 'small' ? 18.2 : 19.5,
37
+ fontFamily: 'PretendardStd-SemiBold',
38
+ letterSpacing: 0
39
+ }),
40
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.base
41
+ })
42
+ };
43
+
44
+ case 'circular-home':
45
+ return {
46
+ container: {
47
+ paddingBottom: 4,
48
+ paddingHorizontal: 3
49
+ },
50
+ inner: {
51
+ backgroundColor: selected ? theme.palette.fill.base : theme.palette.surface.base,
52
+ borderRadius: theme.shape.radius.full,
53
+ borderWidth: selected ? undefined : 0.5,
54
+ borderColor: selected ? undefined : theme.palette.border.weak,
55
+ flexDirection: 'row',
56
+ gap: 5,
57
+ paddingBottom: 7.5,
58
+ paddingHorizontal: 14,
59
+ paddingTop: 6.5
29
60
  },
30
61
  label: (0, _styles2.createFontStyle)(theme, {
31
62
  selector: _ => (0, _styles.typographyOf)({
32
63
  fontSize: 14,
33
64
  lineHeight: 18.2,
34
- fontFamily: 'Pretendard-SemiBold',
35
- letterSpacing: 0
65
+ fontFamily: 'LexendDeca-Medium',
66
+ letterSpacing: -0.28
36
67
  }),
37
- color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
68
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.base
38
69
  })
39
70
  };
40
71
 
@@ -44,15 +75,19 @@ function useVariantStyleMap(variant, selected) {
44
75
  alignItems: 'center',
45
76
  height: 49,
46
77
  justifyContent: 'flex-start',
47
- paddingTop: theme.spacing(2.625),
48
- width: 48
78
+ maxWidth: 64,
79
+ paddingTop: 10
80
+ },
81
+ inner: {
82
+ flexDirection: 'column',
83
+ gap: 5
49
84
  },
50
85
  label: (0, _styles2.createFontStyle)(theme, {
51
86
  selector: _ => (0, _styles.typographyOf)({
52
- fontSize: 10,
53
- lineHeight: 10,
54
- fontFamily: 'Pretendard-Medium',
55
- letterSpacing: -0.1
87
+ fontSize: 10.5,
88
+ lineHeight: 10.5,
89
+ fontFamily: 'PretendardStd-Medium',
90
+ letterSpacing: -0.105
56
91
  }),
57
92
  color: selected ? theme.palette.text.strong : theme.palette.text.base
58
93
  })
@@ -62,19 +97,25 @@ function useVariantStyleMap(variant, selected) {
62
97
  default:
63
98
  return {
64
99
  container: {
65
- padding: theme.spacing(2.5)
100
+ paddingHorizontal: 10
101
+ },
102
+ inner: {
103
+ flexDirection: 'row',
104
+ gap: 5,
105
+ paddingHorizontal: 1,
106
+ paddingVertical: 10
66
107
  },
67
108
  label: (0, _styles2.createFontStyle)(theme, {
68
109
  selector: _ => (0, _styles.typographyOf)({
69
- fontSize: 15,
70
- lineHeight: 18.75,
71
- fontFamily: 'Pretendard-SemiBold',
110
+ fontSize: size === 'small' ? 15 : 16,
111
+ lineHeight: size === 'small' ? 18.75 : 20,
112
+ fontFamily: selected ? 'PretendardStd-SemiBold' : 'PretendardStd-Medium',
72
113
  letterSpacing: 0
73
114
  }),
74
115
  color: selected ? theme.palette.text.strong : theme.palette.text.base
75
116
  })
76
117
  };
77
118
  }
78
- }, [theme, variant, selected]);
119
+ }, [theme, variant, selected, size, parentColor]);
79
120
  }
80
121
  //# sourceMappingURL=useVariantStyleMap.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useVariantStyleMap","variant","selected","theme","useTheme","useMemo","container","paddingHorizontal","spacing","paddingVertical","inner","backgroundColor","palette","fill","base","weaker","borderRadius","shape","radius","full","label","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","text","strongInverse","strong","alignItems","height","justifyContent","paddingTop","width","padding"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { TabVariant } from './TabProps';\n\ninterface VariantStyle {\n container: FountainUiStyle;\n inner?: FountainUiStyle;\n label: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: TabVariant, selected: boolean): VariantStyle {\n const theme = useTheme();\n\n return useMemo<VariantStyle>(() => {\n switch (variant) {\n case 'circular':\n return {\n container: {\n paddingHorizontal: theme.spacing(0.75),\n paddingVertical: theme.spacing(1),\n },\n inner: {\n backgroundColor: selected\n ? theme.palette.fill.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.75),\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 14,\n lineHeight: 18.2,\n fontFamily: 'Pretendard-SemiBold',\n letterSpacing: 0,\n }),\n color: selected\n ? theme.palette.text.strongInverse\n : theme.palette.text.strong,\n }),\n };\n case 'bottom-navigation':\n return {\n container: {\n alignItems: 'center',\n height: 49,\n justifyContent: 'flex-start',\n paddingTop: theme.spacing(2.625),\n width: 48,\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 10,\n lineHeight: 10,\n fontFamily: 'Pretendard-Medium',\n letterSpacing: -0.1,\n }),\n color: selected\n ? theme.palette.text.strong\n : theme.palette.text.base,\n }),\n };\n case 'default':\n default:\n return {\n container: {\n padding: theme.spacing(2.5),\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 15,\n lineHeight: 18.75,\n fontFamily: 'Pretendard-SemiBold',\n letterSpacing: 0,\n }),\n color: selected\n ? theme.palette.text.strong\n : theme.palette.text.base,\n }),\n };\n }\n }, [theme, variant, selected]);\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;AASe,SAASA,kBAAT,CAA4BC,OAA5B,EAAiDC,QAAjD,EAAkF;EAC7F,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAsB,MAAM;IAC/B,QAAQJ,OAAR;MACI,KAAK,UAAL;QACI,OAAO;UACHK,SAAS,EAAE;YACPC,iBAAiB,EAAEJ,KAAK,CAACK,OAAN,CAAc,IAAd,CADZ;YAEPC,eAAe,EAAEN,KAAK,CAACK,OAAN,CAAc,CAAd;UAFV,CADR;UAKHE,KAAK,EAAE;YACHC,eAAe,EAAET,QAAQ,GACnBC,KAAK,CAACS,OAAN,CAAcC,IAAd,CAAmBC,IADA,GAEnBX,KAAK,CAACS,OAAN,CAAcC,IAAd,CAAmBE,MAHtB;YAIHC,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AE;YACPgC,OAAO,EAAEnC,KAAK,CAACK,OAAN,CAAc,GAAd;UADF,CADR;UAIHY,KAAK,EAAE,IAAAC,wBAAA,EAAgBlB,KAAhB,EAAuB;YAC1BmB,QAAQ,EAAGC,CAAD,IAAO,IAAAC,oBAAA,EAAa;cAC1BC,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,KAFc;cAG1BC,UAAU,EAAE,qBAHc;cAI1BC,aAAa,EAAE;YAJW,CAAb,CADS;YAO1BC,KAAK,EAAE3B,QAAQ,GACTC,KAAK,CAACS,OAAN,CAAckB,IAAd,CAAmBE,MADV,GAET7B,KAAK,CAACS,OAAN,CAAckB,IAAd,CAAmBhB;UATC,CAAvB;QAJJ,CAAP;IAlDR;EAmEH,CApEM,EAoEJ,CAACX,KAAD,EAAQF,OAAR,EAAiBC,QAAjB,CApEI,CAAP;AAqEH"}
1
+ {"version":3,"names":["useVariantStyleMap","variant","selected","size","parentColor","theme","useTheme","useMemo","container","paddingHorizontal","spacing","paddingVertical","inner","backgroundColor","palette","fill","base","surface","weaker","borderRadius","shape","radius","full","flexDirection","gap","paddingBottom","paddingTop","label","createFontStyle","selector","_","typographyOf","fontSize","lineHeight","fontFamily","letterSpacing","color","text","strongInverse","borderWidth","undefined","borderColor","border","weak","alignItems","height","justifyContent","maxWidth","strong"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport type { TabsColor } from '../Tabs';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { TabSize, TabVariant } from './TabProps';\n\ninterface VariantStyle {\n container: FountainUiStyle;\n iconContainer?: FountainUiStyle;\n inner?: FountainUiStyle;\n label: TextStyle;\n}\n\nexport default function useVariantStyleMap(\n variant: TabVariant,\n selected: boolean,\n size: TabSize,\n parentColor: TabsColor,\n): VariantStyle {\n const theme = useTheme();\n\n return useMemo<VariantStyle>(() => {\n switch (variant) {\n case 'circular':\n return {\n container: {\n paddingHorizontal: theme.spacing(0.75),\n paddingVertical: theme.spacing(1),\n },\n inner: {\n backgroundColor: selected\n ? theme.palette.fill.base\n : parentColor === 'alt'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n gap: 5,\n paddingBottom: 7.5,\n paddingHorizontal: 14,\n paddingTop: 6.5,\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: size === 'small' ? 14 : 15,\n lineHeight: size === 'small' ? 18.2 : 19.5,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: selected\n ? theme.palette.text.strongInverse\n : theme.palette.text.base,\n }),\n };\n case 'circular-home':\n return {\n container: {\n paddingBottom: 4,\n paddingHorizontal: 3,\n },\n inner: {\n backgroundColor: selected\n ? theme.palette.fill.base\n : theme.palette.surface.base,\n borderRadius: theme.shape.radius.full,\n borderWidth: selected ? undefined : 0.5,\n borderColor: selected ? undefined : theme.palette.border.weak,\n flexDirection: 'row',\n gap: 5,\n paddingBottom: 7.5,\n paddingHorizontal: 14,\n paddingTop: 6.5,\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 14,\n lineHeight: 18.2,\n fontFamily: 'LexendDeca-Medium',\n letterSpacing: -0.28,\n }),\n color: selected\n ? theme.palette.text.strongInverse\n : theme.palette.text.base,\n }),\n };\n case 'bottom-navigation':\n return {\n container: {\n alignItems: 'center',\n height: 49,\n justifyContent: 'flex-start',\n maxWidth: 64,\n paddingTop: 10,\n },\n inner: {\n flexDirection: 'column',\n gap: 5,\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 10.5,\n lineHeight: 10.5,\n fontFamily: 'PretendardStd-Medium',\n letterSpacing: -0.105,\n }),\n color: selected\n ? theme.palette.text.strong\n : theme.palette.text.base,\n }),\n };\n case 'default':\n default:\n return {\n container: {\n paddingHorizontal: 10,\n },\n inner: {\n flexDirection: 'row',\n gap: 5,\n paddingHorizontal: 1,\n paddingVertical: 10,\n },\n label: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: size === 'small' ? 15 : 16,\n lineHeight: size === 'small' ? 18.75 : 20,\n fontFamily: selected ? 'PretendardStd-SemiBold' : 'PretendardStd-Medium',\n letterSpacing: 0,\n }),\n color: selected\n ? theme.palette.text.strong\n : theme.palette.text.base,\n }),\n };\n }\n }, [theme, variant, selected, size, parentColor]);\n}\n"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA;;AAUe,SAASA,kBAAT,CACXC,OADW,EAEXC,QAFW,EAGXC,IAHW,EAIXC,WAJW,EAKC;EACZ,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAsB,MAAM;IAC/B,QAAQN,OAAR;MACI,KAAK,UAAL;QACI,OAAO;UACHO,SAAS,EAAE;YACPC,iBAAiB,EAAEJ,KAAK,CAACK,OAAN,CAAc,IAAd,CADZ;YAEPC,eAAe,EAAEN,KAAK,CAACK,OAAN,CAAc,CAAd;UAFV,CADR;UAKHE,KAAK,EAAE;YACHC,eAAe,EAAEX,QAAQ,GACnBG,KAAK,CAACS,OAAN,CAAcC,IAAd,CAAmBC,IADA,GAEnBZ,WAAW,KAAK,KAAhB,GACIC,KAAK,CAACS,OAAN,CAAcG,OAAd,CAAsBD,IAD1B,GAEIX,KAAK,CAACS,OAAN,CAAcC,IAAd,CAAmBG,MAL1B;YAMHC,YAAY,EAAEd,KAAK,CAACe,KAAN,CAAYC,MAAZ,CAAmBC,IAN9B;YAOHC,aAAa,EAAE,KAPZ;YAQHC,GAAG,EAAE,CARF;YASHC,aAAa,EAAE,GATZ;YAUHhB,iBAAiB,EAAE,EAVhB;YAWHiB,UAAU,EAAE;UAXT,CALJ;UAkBHC,KAAK,EAAE,IAAAC,wBAAA,EAAgBvB,KAAhB,EAAuB;YAC1BwB,QAAQ,EAAGC,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ADR;cAE1B8B,UAAU,EAAE9B,IAAI,KAAK,OAAT,GAAmB,KAAnB,GAA2B,EAFb;cAG1B+B,UAAU,EAAEhC,QAAQ,GAAG,wBAAH,GAA8B,sBAHxB;cAI1BiC,aAAa,EAAE;YAJW,CAAb,CADS;YAO1BC,KAAK,EAAElC,QAAQ,GACTG,KAAK,CAACS,OAAN,CAAcuB,IAAd,CAAmBW,MADV,GAET3C,KAAK,CAACS,OAAN,CAAcuB,IAAd,CAAmBrB;UATC,CAAvB;QAVJ,CAAP;IA1FR;EAiHH,CAlHM,EAkHJ,CAACX,KAAD,EAAQJ,OAAR,EAAiBC,QAAjB,EAA2BC,IAA3B,EAAiCC,WAAjC,CAlHI,CAAP;AAmHH"}
@@ -20,12 +20,6 @@ const useStyles = function () {
20
20
  root: {
21
21
  alignItems: 'center',
22
22
  justifyContent: 'center'
23
- },
24
- row: {
25
- flexDirection: 'row'
26
- },
27
- column: {
28
- flexDirection: 'column'
29
23
  }
30
24
  };
31
25
  };
@@ -36,7 +30,6 @@ function TabBase(props) {
36
30
  disabled = false,
37
31
  onPress,
38
32
  selected = false,
39
- vertical = false,
40
33
  style,
41
34
  ...otherProps
42
35
  } = props;
@@ -44,7 +37,7 @@ function TabBase(props) {
44
37
  return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
45
38
  onPress: onPress,
46
39
  disabled: disabled,
47
- style: (0, _styles.css)([styles.root, vertical ? styles.column : styles.row, style])
40
+ style: (0, _styles.css)([styles.root, style])
48
41
  }, otherProps), children);
49
42
  }
50
43
 
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","root","alignItems","justifyContent","row","flexDirection","column","TabBase","props","children","disabled","onPress","selected","vertical","style","otherProps","styles","css"],"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;;AACA;;AACA;;;;;;AAKA,MAAMA,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;;AAee,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,6BAAC,mBAAD;IACI,OAAO,EAAEW,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAE,IAAAO,WAAA,EAAI,CACPD,MAAM,CAACf,IADA,EAEPY,QAAQ,GAAGG,MAAM,CAACV,MAAV,GAAmBU,MAAM,CAACZ,GAF3B,EAGPU,KAHO,CAAJ;EAHX,GAQQC,UARR,GAUKN,QAVL,CADJ;AAcH;;AAAA"}
1
+ {"version":3,"names":["useStyles","root","alignItems","justifyContent","TabBase","props","children","disabled","onPress","selected","style","otherProps","styles","css"],"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;;AACA;;AACA;;;;;;AAKA,MAAMA,SAAmC,GAAG,YAA2B;EACnE,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE;IAFd;EADH,CAAP;AAMH,CAPD;;AASe,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,6BAAC,mBAAD;IACI,OAAO,EAAEQ,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAE,IAAAM,WAAA,EAAI,CACPD,MAAM,CAACX,IADA,EAEPS,KAFO,CAAJ;EAHX,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":""}
@@ -29,6 +29,10 @@ var _InternalContext = _interopRequireDefault(require("./InternalContext"));
29
29
 
30
30
  var _utils = require("./utils");
31
31
 
32
+ var _TabCoordinate = require("./TabCoordinate");
33
+
34
+ var _useTabsStyle = _interopRequireDefault(require("./useTabsStyle"));
35
+
32
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
37
 
34
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -45,9 +49,6 @@ const useStyles = function () {
45
49
  fixedTab: {
46
50
  flex: 1
47
51
  },
48
- scrollableContainer: {
49
- paddingHorizontal: theme.spacing(1)
50
- },
51
52
  bottomDivider: {
52
53
  borderBottomColor: theme.palette.border.base,
53
54
  borderBottomWidth: 0.5
@@ -70,6 +71,7 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
70
71
  scrollable = false,
71
72
  scrollViewContentContainerStyle,
72
73
  showDivider = false,
74
+ size = 'medium',
73
75
  style,
74
76
  variant = 'default',
75
77
  UNSTABLE_sharedIndex,
@@ -81,6 +83,10 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
81
83
  const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;
82
84
  const realInitialIndex = sharedIndex.initialValue;
83
85
  const currentIndexRef = (0, _react.useRef)(initialIndex);
86
+ const {
87
+ container: containerStyle,
88
+ contentContainer: contentContainerStyle
89
+ } = (0, _useTabsStyle.default)(variant, size, scrollable);
84
90
 
85
91
  const setTab = newIndex => {
86
92
  const currentIndex = currentIndexRef.current;
@@ -107,10 +113,16 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
107
113
  }
108
114
 
109
115
  return innerContentsWidthList.map((innerContentWidth, idx) => {
116
+ const outerCoordinate = outerCoordinates[idx];
117
+
118
+ if (!outerCoordinate) {
119
+ return _TabCoordinate.defaultCoordinate;
120
+ }
121
+
110
122
  const {
111
123
  x1: outerX1,
112
124
  x2: outerX2
113
- } = outerCoordinates[idx];
125
+ } = outerCoordinate;
114
126
  const tabWidth = outerX2 - outerX1;
115
127
  const distanceFromParent = (tabWidth - innerContentWidth) / 2;
116
128
  const indicatorStartCoordinate = outerX1 + distanceFromParent;
@@ -165,15 +177,19 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
165
177
  }; // @ts-ignore
166
178
 
167
179
 
180
+ const tabStyle = child.props.style; // @ts-ignore
181
+
168
182
  const tabElement = /*#__PURE__*/(0, _react.cloneElement)(child, {
169
183
  enableIndicator: !disableIndicator && !canRenderIndicator,
170
184
  onTabInnerLayout,
171
185
  onLayout,
172
186
  onPress,
173
187
  onMouseDown,
188
+ parentColor: color,
189
+ size,
174
190
  variant,
175
191
  indicatorSize,
176
- style: scrollable ? undefined : styles.fixedTab
192
+ style: (0, _styles.css)([scrollable ? undefined : styles.fixedTab, tabStyle])
177
193
  });
178
194
  return /*#__PURE__*/_react.default.createElement(_IndexAwareTab.default, {
179
195
  children: tabElement,
@@ -195,13 +211,13 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
195
211
  indexStore
196
212
  }
197
213
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
198
- style: (0, _styles.css)([styles.root, {
214
+ style: (0, _styles.css)([styles.root, containerStyle, {
199
215
  backgroundColor: backgroundColorMap[color]
200
216
  }, showDivider ? styles.bottomDivider : undefined, scrollable ? undefined : styles.fixedRoot, style])
201
217
  }, scrollable ? /*#__PURE__*/_react.default.createElement(_ScrollableTabsView.default, {
202
218
  automaticallyAdjustContentInsets: false,
203
219
  bounces: false,
204
- contentContainerStyle: (0, _styles.css)([styles.scrollableContainer, scrollViewContentContainerStyle]),
220
+ contentContainerStyle: (0, _styles.css)([contentContainerStyle, scrollViewContentContainerStyle]),
205
221
  coordinates: coordinates,
206
222
  directionalLockEnabled: true,
207
223
  horizontal: true,
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","theme","useTheme","root","fixedRoot","flexDirection","fixedTab","flex","scrollableContainer","paddingHorizontal","spacing","bottomDivider","borderBottomColor","palette","border","base","borderBottomWidth","Tabs","forwardRef","props","ref","children","color","initialIndex","disableIndicator","indicatorSize","keyboardDismissMode","keyboardShouldPersistTaps","onChange","scrollable","scrollViewContentContainerStyle","showDivider","style","variant","UNSTABLE_sharedIndex","onTabSelected","fallbackSharedIndex","useSyncAnimatedValue","initialValue","sharedIndex","realInitialIndex","currentIndexRef","useRef","setTab","newIndex","currentIndex","current","animatedValue","setValue","useImperativeHandle","styles","outerCoordinates","updateCoordinate","useTabCoordinates","innerContentsWidthList","updateInnerContentsWidth","useTabInnerContentsWidth","canRenderIndicator","isEveryTabCoordinatesDefined","indexStore","useIndexStore","coordinates","useMemo","length","map","innerContentWidth","idx","x1","outerX1","x2","outerX2","tabWidth","distanceFromParent","indicatorStartCoordinate","useEffect","subscribe","tabElements","React","Children","child","index","onTabInnerLayout","event","width","nativeEvent","layout","onLayout","x","onMouseDown","e","preventDefault","onPress","tabElement","cloneElement","enableIndicator","undefined","filter","Boolean","tabIndicator","backgroundColorMap","default","background","alt","css","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});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AE,IAAA4C,WAAA,EAAI,CACPrD,MAAM,CAAC/C,IADA,EAEP;MAAEqG,eAAe,EAAEL,kBAAkB,CAAC7E,KAAD;IAArC,CAFO,EAGPS,WAAW,GAAGmB,MAAM,CAACvC,aAAV,GAA0BoF,SAH9B,EAIPlE,UAAU,GAAGkE,SAAH,GAAe7C,MAAM,CAAC9C,SAJzB,EAKP4B,KALO,CAAJ;EADX,GASKH,UAAU,gBACP,6BAAC,2BAAD;IACI,gCAAgC,EAAE,KADtC;IAEI,OAAO,EAAE,KAFb;IAGI,qBAAqB,EAAE,IAAA0E,WAAA,EAAI,CACvBrD,MAAM,CAAC1C,mBADgB,EAEvBsB,+BAFuB,CAAJ,CAH3B;IAOI,WAAW,EAAE+B,WAPjB;IAQI,sBAAsB,EAAE,IAR5B;IASI,UAAU,EAAE,IAThB;IAUI,YAAY,EAAErB,gBAVlB;IAWI,YAAY,EAAE,KAXlB;IAYI,8BAA8B,EAAE,KAZpC;IAaI,4BAA4B,EAAE,KAblC;IAcI,mBAAmB,EAAEd,mBAdzB;IAeI,yBAAyB,EAAEC;EAf/B,GAiBKiD,WAjBL,EAkBKsB,YAlBL,CADO,gBAsBP,6BAAC,cAAD,CAAO,QAAP,QACKtB,WADL,EAEKsB,YAFL,CA/BR,CADJ,CADJ;AAyCH,CA/LY,CAAb;eAiMejF,I"}
1
+ {"version":3,"names":["useStyles","theme","useTheme","root","fixedRoot","flexDirection","fixedTab","flex","bottomDivider","borderBottomColor","palette","border","base","borderBottomWidth","Tabs","forwardRef","props","ref","children","color","initialIndex","disableIndicator","indicatorSize","keyboardDismissMode","keyboardShouldPersistTaps","onChange","scrollable","scrollViewContentContainerStyle","showDivider","size","style","variant","UNSTABLE_sharedIndex","onTabSelected","fallbackSharedIndex","useSyncAnimatedValue","initialValue","sharedIndex","realInitialIndex","currentIndexRef","useRef","container","containerStyle","contentContainer","contentContainerStyle","useTabsStyle","setTab","newIndex","currentIndex","current","animatedValue","setValue","useImperativeHandle","styles","outerCoordinates","updateCoordinate","useTabCoordinates","innerContentsWidthList","updateInnerContentsWidth","useTabInnerContentsWidth","canRenderIndicator","isEveryTabCoordinatesDefined","indexStore","useIndexStore","coordinates","useMemo","length","map","innerContentWidth","idx","outerCoordinate","defaultCoordinate","x1","outerX1","x2","outerX2","tabWidth","distanceFromParent","indicatorStartCoordinate","useEffect","subscribe","tabElements","React","Children","child","index","onTabInnerLayout","event","width","nativeEvent","layout","onLayout","x","onMouseDown","e","preventDefault","onPress","tabStyle","tabElement","cloneElement","enableIndicator","parentColor","css","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 )}\n </View>\n </InternalContext.Provider>\n );\n});\n\nexport default Tabs;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAUA,MAAMA,SAAgC,GAAG,YAAwB;EAC7D,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE,EADH;IAEHC,SAAS,EAAE;MACPC,aAAa,EAAE;IADR,CAFR;IAKHC,QAAQ,EAAE;MACNC,IAAI,EAAE;IADA,CALP;IAQHC,aAAa,EAAE;MACXC,iBAAiB,EAAER,KAAK,CAACS,OAAN,CAAcC,MAAd,CAAqBC,IAD7B;MAEXC,iBAAiB,EAAE;IAFR;EARZ,CAAP;AAaH,CAhBD;;AAkBA,MAAMC,IAAI,gBAAG,IAAAC,iBAAA,EAAoC,SAASD,IAAT,CAAcE,KAAd,EAAqBC,GAArB,EAA0B;EAAA;;EACvE,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,YAAY,GAAG,CAHb;IAIFC,gBAAgB,GAAG,KAJjB;IAKFC,aAAa,GAAG,aALd;IAMFC,mBAAmB,GAAG,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EAAE,IAAA4E,WAAA,EAAI,CACvB1D,qBADuB,EAEvBjB,+BAFuB,CAAJ,CAH3B;IAOI,WAAW,EAAEqC,WAPjB;IAQI,sBAAsB,EAAE,IAR5B;IASI,UAAU,EAAE,IAThB;IAUI,YAAY,EAAE1B,gBAVlB;IAWI,YAAY,EAAE,KAXlB;IAYI,8BAA8B,EAAE,KAZpC;IAaI,4BAA4B,EAAE,KAblC;IAcI,mBAAmB,EAAEf,mBAdzB;IAeI,yBAAyB,EAAEC;EAf/B,GAiBKyD,WAjBL,EAkBKyB,YAlBL,CADO,gBAsBP,6BAAC,cAAD,CAAO,QAAP,QACKzB,WADL,EAEKyB,YAFL,CAhCR,CADJ,CADJ;AA0CH,CAnNY,CAAb;eAqNe5F,I"}
@@ -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":";;;;;;AAMO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,KAAZ,CAAnB;;AAGA,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":";;;;;;AAMO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,KAAZ,CAAnB;;AAGA,MAAMC,iBAAiB,GAAG,CAAC,aAAD,EAAgB,MAAhB,CAA1B"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"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;;AAEA"}
1
+ {"version":3,"names":[],"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;;AAEA"}