@fountain-ui/core 2.0.0-beta.93 → 2.0.0-beta.94

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 (579) hide show
  1. package/build/commonjs/Accordion/Accordion.js +50 -52
  2. package/build/commonjs/Accordion/Accordion.js.map +1 -1
  3. package/build/commonjs/Accordion/AccordionProps.js +7 -0
  4. package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
  5. package/build/commonjs/Accordion/LegacyAccordion.js +171 -0
  6. package/build/commonjs/Accordion/LegacyAccordion.js.map +1 -0
  7. package/build/commonjs/Accordion/LegacyAccordionProps.js +2 -0
  8. package/build/commonjs/Accordion/LegacyAccordionProps.js.map +1 -0
  9. package/build/commonjs/Accordion/index.js +2 -2
  10. package/build/commonjs/Accordion/index.js.map +1 -1
  11. package/build/commonjs/Accordion/useVariantStyleMap.js +126 -0
  12. package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -0
  13. package/build/commonjs/Badge/Badge.js +16 -20
  14. package/build/commonjs/Badge/Badge.js.map +1 -1
  15. package/build/commonjs/Badge/BadgeProps.js +15 -0
  16. package/build/commonjs/Badge/BadgeProps.js.map +1 -1
  17. package/build/commonjs/Badge/LegacyBadge.js +61 -0
  18. package/build/commonjs/Badge/LegacyBadge.js.map +1 -0
  19. package/build/commonjs/Badge/LegacyBadgeProps.js +2 -0
  20. package/build/commonjs/Badge/LegacyBadgeProps.js.map +1 -0
  21. package/build/commonjs/Badge/index.js +2 -2
  22. package/build/commonjs/Badge/index.js.map +1 -1
  23. package/build/commonjs/Badge/useVariantStyleMap.js +74 -0
  24. package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -0
  25. package/build/commonjs/Button/Button.js +65 -23
  26. package/build/commonjs/Button/Button.js.map +1 -1
  27. package/build/commonjs/Button/ButtonProps.js +1 -1
  28. package/build/commonjs/Button/ButtonProps.js.map +1 -1
  29. package/build/commonjs/Button/useVariantStyleMap.js +86 -7
  30. package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
  31. package/build/commonjs/ButtonBase/ButtonBase.js +4 -10
  32. package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
  33. package/build/commonjs/ButtonBase/LegacyButtonBase.js +126 -0
  34. package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +1 -0
  35. package/build/commonjs/ButtonBase/index.js +2 -2
  36. package/build/commonjs/ButtonBase/index.js.map +1 -1
  37. package/build/commonjs/Chip/Chip.js +24 -62
  38. package/build/commonjs/Chip/Chip.js.map +1 -1
  39. package/build/commonjs/Chip/ChipProps.js +9 -0
  40. package/build/commonjs/Chip/ChipProps.js.map +1 -1
  41. package/build/commonjs/Chip/LegacyChip.js +98 -0
  42. package/build/commonjs/Chip/LegacyChip.js.map +1 -0
  43. package/build/commonjs/Chip/LegacyChipProps.js +2 -0
  44. package/build/commonjs/Chip/LegacyChipProps.js.map +1 -0
  45. package/build/commonjs/Chip/index.js +2 -2
  46. package/build/commonjs/Chip/index.js.map +1 -1
  47. package/build/commonjs/Chip/useChipStyle.js +113 -0
  48. package/build/commonjs/Chip/useChipStyle.js.map +1 -0
  49. package/build/commonjs/Empty/Empty.js +86 -0
  50. package/build/commonjs/Empty/Empty.js.map +1 -0
  51. package/build/commonjs/Empty/EmptyProps.js +2 -0
  52. package/build/commonjs/Empty/EmptyProps.js.map +1 -0
  53. package/build/commonjs/Empty/index.js +16 -0
  54. package/build/commonjs/Empty/index.js.map +1 -0
  55. package/build/commonjs/IconButton/LegacyIconButton.js +3 -2
  56. package/build/commonjs/IconButton/LegacyIconButton.js.map +1 -1
  57. package/build/commonjs/IconButton/LegacyIconButtonProps.js.map +1 -1
  58. package/build/commonjs/Pagination/LegacyPagination.js +145 -0
  59. package/build/commonjs/Pagination/LegacyPagination.js.map +1 -0
  60. package/build/commonjs/Pagination/LegacyPaginationProps.js +2 -0
  61. package/build/commonjs/Pagination/LegacyPaginationProps.js.map +1 -0
  62. package/build/commonjs/Pagination/NumberPagination.js +71 -0
  63. package/build/commonjs/Pagination/NumberPagination.js.map +1 -0
  64. package/build/commonjs/Pagination/Pagination.js +9 -5
  65. package/build/commonjs/Pagination/Pagination.js.map +1 -1
  66. package/build/commonjs/Pagination/PaginationProps.js +7 -0
  67. package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
  68. package/build/commonjs/Pagination/index.js +2 -2
  69. package/build/commonjs/Pagination/index.js.map +1 -1
  70. package/build/commonjs/PaginationItem/LegacyPaginationItem.js +53 -0
  71. package/build/commonjs/PaginationItem/LegacyPaginationItem.js.map +1 -0
  72. package/build/commonjs/PaginationItem/PaginationItem.js +2 -2
  73. package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
  74. package/build/commonjs/Snackbar/LegacySnackbar.js +134 -0
  75. package/build/commonjs/Snackbar/LegacySnackbar.js.map +1 -0
  76. package/build/commonjs/Snackbar/LegacySnackbarProps.js +2 -0
  77. package/build/commonjs/Snackbar/LegacySnackbarProps.js.map +1 -0
  78. package/build/commonjs/Snackbar/Snackbar.js +7 -5
  79. package/build/commonjs/Snackbar/Snackbar.js.map +1 -1
  80. package/build/commonjs/Snackbar/SnackbarProps.js +7 -0
  81. package/build/commonjs/Snackbar/SnackbarProps.js.map +1 -1
  82. package/build/commonjs/Snackbar/index.js +2 -2
  83. package/build/commonjs/Snackbar/index.js.map +1 -1
  84. package/build/commonjs/SnackbarContent/LegacySnackbarContent.js +105 -0
  85. package/build/commonjs/SnackbarContent/LegacySnackbarContent.js.map +1 -0
  86. package/build/commonjs/SnackbarContent/LegacySnackbarContentProps.js +2 -0
  87. package/build/commonjs/SnackbarContent/LegacySnackbarContentProps.js.map +1 -0
  88. package/build/commonjs/SnackbarContent/SnackbarContent.js +48 -38
  89. package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
  90. package/build/commonjs/SnackbarContent/SnackbarContentProps.js.map +1 -1
  91. package/build/commonjs/SnackbarContent/StatusIcon.js +43 -0
  92. package/build/commonjs/SnackbarContent/StatusIcon.js.map +1 -0
  93. package/build/commonjs/SnackbarContent/index.js +2 -2
  94. package/build/commonjs/SnackbarContent/index.js.map +1 -1
  95. package/build/commonjs/Tab/LegacyTab.js +126 -0
  96. package/build/commonjs/Tab/LegacyTab.js.map +1 -0
  97. package/build/commonjs/Tab/LegacyTabProps.js +2 -0
  98. package/build/commonjs/Tab/LegacyTabProps.js.map +1 -0
  99. package/build/commonjs/Tab/Tab.js +31 -69
  100. package/build/commonjs/Tab/Tab.js.map +1 -1
  101. package/build/commonjs/Tab/TabIndicator.js.map +1 -1
  102. package/build/commonjs/Tab/TabProps.js +7 -0
  103. package/build/commonjs/Tab/TabProps.js.map +1 -1
  104. package/build/commonjs/Tab/index.js +2 -2
  105. package/build/commonjs/Tab/index.js.map +1 -1
  106. package/build/commonjs/Tab/useVariantStyleMap.js +80 -0
  107. package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -0
  108. package/build/commonjs/TabBase/LegacyTabBase.js +57 -0
  109. package/build/commonjs/TabBase/LegacyTabBase.js.map +1 -0
  110. package/build/commonjs/TabBase/TabBase.js +1 -6
  111. package/build/commonjs/TabBase/TabBase.js.map +1 -1
  112. package/build/commonjs/TabBase/index.js +2 -2
  113. package/build/commonjs/TabBase/index.js.map +1 -1
  114. package/build/commonjs/Tabs/LegacyTabIndicator.js +119 -0
  115. package/build/commonjs/Tabs/LegacyTabIndicator.js.map +1 -0
  116. package/build/commonjs/Tabs/LegacyTabIndicatorProps.js +2 -0
  117. package/build/commonjs/Tabs/LegacyTabIndicatorProps.js.map +1 -0
  118. package/build/commonjs/Tabs/LegacyTabs.js +205 -0
  119. package/build/commonjs/Tabs/LegacyTabs.js.map +1 -0
  120. package/build/commonjs/Tabs/LegacyTabsProps.js +2 -0
  121. package/build/commonjs/Tabs/LegacyTabsProps.js.map +1 -0
  122. package/build/commonjs/Tabs/TabIndicator.js +5 -9
  123. package/build/commonjs/Tabs/TabIndicator.js.map +1 -1
  124. package/build/commonjs/Tabs/TabIndicatorProps.js.map +1 -1
  125. package/build/commonjs/Tabs/Tabs.js +10 -9
  126. package/build/commonjs/Tabs/Tabs.js.map +1 -1
  127. package/build/commonjs/Tabs/TabsProps.js +7 -0
  128. package/build/commonjs/Tabs/TabsProps.js.map +1 -1
  129. package/build/commonjs/Tabs/index.js +2 -2
  130. package/build/commonjs/Tabs/index.js.map +1 -1
  131. package/build/commonjs/TextField/LegacyTextField.js +195 -0
  132. package/build/commonjs/TextField/LegacyTextField.js.map +1 -0
  133. package/build/commonjs/TextField/LegacyTextFieldProps.js +2 -0
  134. package/build/commonjs/TextField/LegacyTextFieldProps.js.map +1 -0
  135. package/build/commonjs/TextField/OutlinedTextField.js.map +1 -1
  136. package/build/commonjs/TextField/TextField.js +105 -147
  137. package/build/commonjs/TextField/TextField.js.map +1 -1
  138. package/build/commonjs/TextField/TextFieldProps.js +9 -0
  139. package/build/commonjs/TextField/TextFieldProps.js.map +1 -1
  140. package/build/commonjs/TextField/index.js +2 -2
  141. package/build/commonjs/TextField/index.js.map +1 -1
  142. package/build/commonjs/TextField/useVariantStyleMap.js +103 -0
  143. package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -0
  144. package/build/commonjs/Tooltip/Beaks/Beak.js +69 -0
  145. package/build/commonjs/Tooltip/Beaks/Beak.js.map +1 -0
  146. package/build/commonjs/Tooltip/Beaks/BeakProps.js +2 -0
  147. package/build/commonjs/Tooltip/Beaks/BeakProps.js.map +1 -0
  148. package/build/commonjs/Tooltip/Beaks/HorizontalLargeBeak.js +25 -0
  149. package/build/commonjs/Tooltip/Beaks/HorizontalLargeBeak.js.map +1 -0
  150. package/build/commonjs/Tooltip/Beaks/HorizontalSmallBeak.js +25 -0
  151. package/build/commonjs/Tooltip/Beaks/HorizontalSmallBeak.js.map +1 -0
  152. package/build/commonjs/Tooltip/Beaks/VerticalLargeBeak.js +25 -0
  153. package/build/commonjs/Tooltip/Beaks/VerticalLargeBeak.js.map +1 -0
  154. package/build/commonjs/Tooltip/Beaks/VerticalSmallBeak.js +25 -0
  155. package/build/commonjs/Tooltip/Beaks/VerticalSmallBeak.js.map +1 -0
  156. package/build/commonjs/Tooltip/Beaks/index.js +16 -0
  157. package/build/commonjs/Tooltip/Beaks/index.js.map +1 -0
  158. package/build/commonjs/Tooltip/LegacyTooltip.js +147 -0
  159. package/build/commonjs/Tooltip/LegacyTooltip.js.map +1 -0
  160. package/build/commonjs/Tooltip/LegacyTooltipProps.js +2 -0
  161. package/build/commonjs/Tooltip/LegacyTooltipProps.js.map +1 -0
  162. package/build/commonjs/Tooltip/Tooltip.js +101 -52
  163. package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
  164. package/build/commonjs/Tooltip/TooltipProps.js +11 -0
  165. package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
  166. package/build/commonjs/Tooltip/index.js +2 -2
  167. package/build/commonjs/Tooltip/index.js.map +1 -1
  168. package/build/commonjs/hooks/useCollapsibleAppBar.js +2 -3
  169. package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
  170. package/build/commonjs/index.js +21 -0
  171. package/build/commonjs/index.js.map +1 -1
  172. package/build/commonjs/internal/icons/CheckCircle.js +27 -0
  173. package/build/commonjs/internal/icons/CheckCircle.js.map +1 -0
  174. package/build/commonjs/internal/icons/Clear.js +27 -0
  175. package/build/commonjs/internal/icons/Clear.js.map +1 -0
  176. package/build/commonjs/internal/icons/EyeOff.js +31 -0
  177. package/build/commonjs/internal/icons/EyeOff.js.map +1 -0
  178. package/build/commonjs/internal/icons/EyeOn.js +27 -0
  179. package/build/commonjs/internal/icons/EyeOn.js.map +1 -0
  180. package/build/commonjs/internal/icons/InfoCircle.js +27 -0
  181. package/build/commonjs/internal/icons/InfoCircle.js.map +1 -0
  182. package/build/commonjs/internal/icons/LoadingSpinner/LoadingSpinnerProps.js +2 -0
  183. package/build/commonjs/internal/icons/LoadingSpinner/LoadingSpinnerProps.js.map +1 -0
  184. package/build/commonjs/internal/icons/LoadingSpinner/index.js +36 -0
  185. package/build/commonjs/internal/icons/LoadingSpinner/index.js.map +1 -0
  186. package/build/commonjs/internal/icons/LoadingSpinner/index.native.js +36 -0
  187. package/build/commonjs/internal/icons/LoadingSpinner/index.native.js.map +1 -0
  188. package/build/commonjs/internal/icons/LoadingSpinner/loadingSpinnerGray.json +1 -0
  189. package/build/commonjs/internal/icons/LoadingSpinner/loadingSpinnerWhite.json +1 -0
  190. package/build/commonjs/internal/icons/LoadingSpinner/utils.js +25 -0
  191. package/build/commonjs/internal/icons/LoadingSpinner/utils.js.map +1 -0
  192. package/build/commonjs/internal/icons/Search.js +23 -0
  193. package/build/commonjs/internal/icons/Search.js.map +1 -0
  194. package/build/commonjs/internal/icons/index.js +56 -0
  195. package/build/commonjs/internal/icons/index.js.map +1 -1
  196. package/build/module/Accordion/Accordion.js +47 -50
  197. package/build/module/Accordion/Accordion.js.map +1 -1
  198. package/build/module/Accordion/AccordionProps.js +1 -1
  199. package/build/module/Accordion/AccordionProps.js.map +1 -1
  200. package/build/module/Accordion/LegacyAccordion.js +148 -0
  201. package/build/module/Accordion/LegacyAccordion.js.map +1 -0
  202. package/build/module/Accordion/LegacyAccordionProps.js +2 -0
  203. package/build/module/Accordion/LegacyAccordionProps.js.map +1 -0
  204. package/build/module/Accordion/index.js +1 -1
  205. package/build/module/Accordion/index.js.map +1 -1
  206. package/build/module/Accordion/useVariantStyleMap.js +116 -0
  207. package/build/module/Accordion/useVariantStyleMap.js.map +1 -0
  208. package/build/module/Badge/Badge.js +17 -23
  209. package/build/module/Badge/Badge.js.map +1 -1
  210. package/build/module/Badge/BadgeProps.js +5 -1
  211. package/build/module/Badge/BadgeProps.js.map +1 -1
  212. package/build/module/Badge/LegacyBadge.js +48 -0
  213. package/build/module/Badge/LegacyBadge.js.map +1 -0
  214. package/build/module/Badge/LegacyBadgeProps.js +2 -0
  215. package/build/module/Badge/LegacyBadgeProps.js.map +1 -0
  216. package/build/module/Badge/index.js +1 -1
  217. package/build/module/Badge/index.js.map +1 -1
  218. package/build/module/Badge/useVariantStyleMap.js +64 -0
  219. package/build/module/Badge/useVariantStyleMap.js.map +1 -0
  220. package/build/module/Button/Button.js +59 -19
  221. package/build/module/Button/Button.js.map +1 -1
  222. package/build/module/Button/ButtonProps.js +1 -1
  223. package/build/module/Button/ButtonProps.js.map +1 -1
  224. package/build/module/Button/useVariantStyleMap.js +86 -7
  225. package/build/module/Button/useVariantStyleMap.js.map +1 -1
  226. package/build/module/ButtonBase/ButtonBase.js +4 -9
  227. package/build/module/ButtonBase/ButtonBase.js.map +1 -1
  228. package/build/module/ButtonBase/LegacyButtonBase.js +106 -0
  229. package/build/module/ButtonBase/LegacyButtonBase.js.map +1 -0
  230. package/build/module/ButtonBase/index.js +1 -1
  231. package/build/module/ButtonBase/index.js.map +1 -1
  232. package/build/module/Chip/Chip.js +25 -64
  233. package/build/module/Chip/Chip.js.map +1 -1
  234. package/build/module/Chip/ChipProps.js +2 -1
  235. package/build/module/Chip/ChipProps.js.map +1 -1
  236. package/build/module/Chip/LegacyChip.js +84 -0
  237. package/build/module/Chip/LegacyChip.js.map +1 -0
  238. package/build/module/Chip/LegacyChipProps.js +2 -0
  239. package/build/module/Chip/LegacyChipProps.js.map +1 -0
  240. package/build/module/Chip/index.js +1 -1
  241. package/build/module/Chip/index.js.map +1 -1
  242. package/build/module/Chip/useChipStyle.js +104 -0
  243. package/build/module/Chip/useChipStyle.js.map +1 -0
  244. package/build/module/Empty/Empty.js +71 -0
  245. package/build/module/Empty/Empty.js.map +1 -0
  246. package/build/module/Empty/EmptyProps.js +2 -0
  247. package/build/module/Empty/EmptyProps.js.map +1 -0
  248. package/build/module/Empty/index.js +2 -0
  249. package/build/module/Empty/index.js.map +1 -0
  250. package/build/module/IconButton/LegacyIconButton.js +3 -2
  251. package/build/module/IconButton/LegacyIconButton.js.map +1 -1
  252. package/build/module/IconButton/LegacyIconButtonProps.js.map +1 -1
  253. package/build/module/Pagination/LegacyPagination.js +129 -0
  254. package/build/module/Pagination/LegacyPagination.js.map +1 -0
  255. package/build/module/Pagination/LegacyPaginationProps.js +2 -0
  256. package/build/module/Pagination/LegacyPaginationProps.js.map +1 -0
  257. package/build/module/Pagination/NumberPagination.js +57 -0
  258. package/build/module/Pagination/NumberPagination.js.map +1 -0
  259. package/build/module/Pagination/Pagination.js +8 -5
  260. package/build/module/Pagination/Pagination.js.map +1 -1
  261. package/build/module/Pagination/PaginationProps.js +1 -1
  262. package/build/module/Pagination/PaginationProps.js.map +1 -1
  263. package/build/module/Pagination/index.js +1 -1
  264. package/build/module/Pagination/index.js.map +1 -1
  265. package/build/module/PaginationItem/LegacyPaginationItem.js +40 -0
  266. package/build/module/PaginationItem/LegacyPaginationItem.js.map +1 -0
  267. package/build/module/PaginationItem/PaginationItem.js +2 -2
  268. package/build/module/PaginationItem/PaginationItem.js.map +1 -1
  269. package/build/module/Snackbar/LegacySnackbar.js +107 -0
  270. package/build/module/Snackbar/LegacySnackbar.js.map +1 -0
  271. package/build/module/Snackbar/LegacySnackbarProps.js +2 -0
  272. package/build/module/Snackbar/LegacySnackbarProps.js.map +1 -0
  273. package/build/module/Snackbar/Snackbar.js +7 -5
  274. package/build/module/Snackbar/Snackbar.js.map +1 -1
  275. package/build/module/Snackbar/SnackbarProps.js +1 -1
  276. package/build/module/Snackbar/SnackbarProps.js.map +1 -1
  277. package/build/module/Snackbar/index.js +1 -1
  278. package/build/module/Snackbar/index.js.map +1 -1
  279. package/build/module/SnackbarContent/LegacySnackbarContent.js +84 -0
  280. package/build/module/SnackbarContent/LegacySnackbarContent.js.map +1 -0
  281. package/build/module/SnackbarContent/LegacySnackbarContentProps.js +2 -0
  282. package/build/module/SnackbarContent/LegacySnackbarContentProps.js.map +1 -0
  283. package/build/module/SnackbarContent/SnackbarContent.js +48 -35
  284. package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
  285. package/build/module/SnackbarContent/SnackbarContentProps.js.map +1 -1
  286. package/build/module/SnackbarContent/StatusIcon.js +31 -0
  287. package/build/module/SnackbarContent/StatusIcon.js.map +1 -0
  288. package/build/module/SnackbarContent/index.js +1 -1
  289. package/build/module/SnackbarContent/index.js.map +1 -1
  290. package/build/module/Tab/LegacyTab.js +105 -0
  291. package/build/module/Tab/LegacyTab.js.map +1 -0
  292. package/build/module/Tab/LegacyTabProps.js +2 -0
  293. package/build/module/Tab/LegacyTabProps.js.map +1 -0
  294. package/build/module/Tab/Tab.js +30 -66
  295. package/build/module/Tab/Tab.js.map +1 -1
  296. package/build/module/Tab/TabIndicator.js.map +1 -1
  297. package/build/module/Tab/TabProps.js +1 -1
  298. package/build/module/Tab/TabProps.js.map +1 -1
  299. package/build/module/Tab/index.js +1 -1
  300. package/build/module/Tab/index.js.map +1 -1
  301. package/build/module/Tab/useVariantStyleMap.js +70 -0
  302. package/build/module/Tab/useVariantStyleMap.js.map +1 -0
  303. package/build/module/TabBase/LegacyTabBase.js +44 -0
  304. package/build/module/TabBase/LegacyTabBase.js.map +1 -0
  305. package/build/module/TabBase/TabBase.js +1 -5
  306. package/build/module/TabBase/TabBase.js.map +1 -1
  307. package/build/module/TabBase/index.js +1 -1
  308. package/build/module/TabBase/index.js.map +1 -1
  309. package/build/module/Tabs/LegacyTabIndicator.js +98 -0
  310. package/build/module/Tabs/LegacyTabIndicator.js.map +1 -0
  311. package/build/module/Tabs/LegacyTabIndicatorProps.js +2 -0
  312. package/build/module/Tabs/LegacyTabIndicatorProps.js.map +1 -0
  313. package/build/module/Tabs/LegacyTabs.js +180 -0
  314. package/build/module/Tabs/LegacyTabs.js.map +1 -0
  315. package/build/module/Tabs/LegacyTabsProps.js +2 -0
  316. package/build/module/Tabs/LegacyTabsProps.js.map +1 -0
  317. package/build/module/Tabs/TabIndicator.js +5 -9
  318. package/build/module/Tabs/TabIndicator.js.map +1 -1
  319. package/build/module/Tabs/TabIndicatorProps.js.map +1 -1
  320. package/build/module/Tabs/Tabs.js +10 -9
  321. package/build/module/Tabs/Tabs.js.map +1 -1
  322. package/build/module/Tabs/TabsProps.js +1 -1
  323. package/build/module/Tabs/TabsProps.js.map +1 -1
  324. package/build/module/Tabs/index.js +1 -1
  325. package/build/module/Tabs/index.js.map +1 -1
  326. package/build/module/TextField/LegacyTextField.js +169 -0
  327. package/build/module/TextField/LegacyTextField.js.map +1 -0
  328. package/build/module/TextField/LegacyTextFieldProps.js +2 -0
  329. package/build/module/TextField/LegacyTextFieldProps.js.map +1 -0
  330. package/build/module/TextField/OutlinedTextField.js.map +1 -1
  331. package/build/module/TextField/TextField.js +104 -144
  332. package/build/module/TextField/TextField.js.map +1 -1
  333. package/build/module/TextField/TextFieldProps.js +2 -1
  334. package/build/module/TextField/TextFieldProps.js.map +1 -1
  335. package/build/module/TextField/index.js +1 -1
  336. package/build/module/TextField/index.js.map +1 -1
  337. package/build/module/TextField/useVariantStyleMap.js +94 -0
  338. package/build/module/TextField/useVariantStyleMap.js.map +1 -0
  339. package/build/module/Tooltip/Beaks/Beak.js +56 -0
  340. package/build/module/Tooltip/Beaks/Beak.js.map +1 -0
  341. package/build/module/Tooltip/Beaks/BeakProps.js +2 -0
  342. package/build/module/Tooltip/Beaks/BeakProps.js.map +1 -0
  343. package/build/module/Tooltip/Beaks/HorizontalLargeBeak.js +14 -0
  344. package/build/module/Tooltip/Beaks/HorizontalLargeBeak.js.map +1 -0
  345. package/build/module/Tooltip/Beaks/HorizontalSmallBeak.js +14 -0
  346. package/build/module/Tooltip/Beaks/HorizontalSmallBeak.js.map +1 -0
  347. package/build/module/Tooltip/Beaks/VerticalLargeBeak.js +14 -0
  348. package/build/module/Tooltip/Beaks/VerticalLargeBeak.js.map +1 -0
  349. package/build/module/Tooltip/Beaks/VerticalSmallBeak.js +14 -0
  350. package/build/module/Tooltip/Beaks/VerticalSmallBeak.js.map +1 -0
  351. package/build/module/Tooltip/Beaks/index.js +2 -0
  352. package/build/module/Tooltip/Beaks/index.js.map +1 -0
  353. package/build/module/Tooltip/LegacyTooltip.js +121 -0
  354. package/build/module/Tooltip/LegacyTooltip.js.map +1 -0
  355. package/build/module/Tooltip/LegacyTooltipProps.js +2 -0
  356. package/build/module/Tooltip/LegacyTooltipProps.js.map +1 -0
  357. package/build/module/Tooltip/Tooltip.js +97 -46
  358. package/build/module/Tooltip/Tooltip.js.map +1 -1
  359. package/build/module/Tooltip/TooltipProps.js +3 -1
  360. package/build/module/Tooltip/TooltipProps.js.map +1 -1
  361. package/build/module/Tooltip/index.js +1 -1
  362. package/build/module/Tooltip/index.js.map +1 -1
  363. package/build/module/hooks/useCollapsibleAppBar.js +2 -3
  364. package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
  365. package/build/module/index.js +2 -0
  366. package/build/module/index.js.map +1 -1
  367. package/build/module/internal/icons/CheckCircle.js +13 -0
  368. package/build/module/internal/icons/CheckCircle.js.map +1 -0
  369. package/build/module/internal/icons/Clear.js +13 -0
  370. package/build/module/internal/icons/Clear.js.map +1 -0
  371. package/build/module/internal/icons/EyeOff.js +17 -0
  372. package/build/module/internal/icons/EyeOff.js.map +1 -0
  373. package/build/module/internal/icons/EyeOn.js +13 -0
  374. package/build/module/internal/icons/EyeOn.js.map +1 -0
  375. package/build/module/internal/icons/InfoCircle.js +13 -0
  376. package/build/module/internal/icons/InfoCircle.js.map +1 -0
  377. package/build/module/internal/icons/LoadingSpinner/LoadingSpinnerProps.js +2 -0
  378. package/build/module/internal/icons/LoadingSpinner/LoadingSpinnerProps.js.map +1 -0
  379. package/build/module/internal/icons/LoadingSpinner/index.js +23 -0
  380. package/build/module/internal/icons/LoadingSpinner/index.js.map +1 -0
  381. package/build/module/internal/icons/LoadingSpinner/index.native.js +23 -0
  382. package/build/module/internal/icons/LoadingSpinner/index.native.js.map +1 -0
  383. package/build/module/internal/icons/LoadingSpinner/loadingSpinnerGray.json +1 -0
  384. package/build/module/internal/icons/LoadingSpinner/loadingSpinnerWhite.json +1 -0
  385. package/build/module/internal/icons/LoadingSpinner/utils.js +12 -0
  386. package/build/module/internal/icons/LoadingSpinner/utils.js.map +1 -0
  387. package/build/module/internal/icons/Search.js +9 -0
  388. package/build/module/internal/icons/Search.js.map +1 -0
  389. package/build/module/internal/icons/index.js +7 -0
  390. package/build/module/internal/icons/index.js.map +1 -1
  391. package/build/typescript/Accordion/Accordion.d.ts +1 -1
  392. package/build/typescript/Accordion/AccordionProps.d.ts +8 -1
  393. package/build/typescript/Accordion/LegacyAccordion.d.ts +3 -0
  394. package/build/typescript/Accordion/LegacyAccordionProps.d.ts +28 -0
  395. package/build/typescript/Accordion/index.d.ts +2 -2
  396. package/build/typescript/Accordion/useVariantStyleMap.d.ts +13 -0
  397. package/build/typescript/Badge/Badge.d.ts +1 -1
  398. package/build/typescript/Badge/BadgeProps.d.ts +28 -2
  399. package/build/typescript/Badge/LegacyBadge.d.ts +3 -0
  400. package/build/typescript/Badge/LegacyBadgeProps.d.ts +34 -0
  401. package/build/typescript/Badge/index.d.ts +2 -2
  402. package/build/typescript/Badge/useVariantStyleMap.d.ts +9 -0
  403. package/build/typescript/Button/ButtonProps.d.ts +6 -1
  404. package/build/typescript/Button/useVariantStyleMap.d.ts +2 -2
  405. package/build/typescript/ButtonBase/ButtonBase.d.ts +0 -1
  406. package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +5 -0
  407. package/build/typescript/ButtonBase/index.d.ts +1 -1
  408. package/build/typescript/Chip/ChipProps.d.ts +13 -6
  409. package/build/typescript/Chip/LegacyChip.d.ts +3 -0
  410. package/build/typescript/Chip/LegacyChipProps.d.ts +28 -0
  411. package/build/typescript/Chip/index.d.ts +2 -2
  412. package/build/typescript/Chip/useChipStyle.d.ts +11 -0
  413. package/build/typescript/Empty/Empty.d.ts +3 -0
  414. package/build/typescript/Empty/EmptyProps.d.ts +27 -0
  415. package/build/typescript/Empty/index.d.ts +2 -0
  416. package/build/typescript/IconButton/LegacyIconButtonProps.d.ts +4 -0
  417. package/build/typescript/Pagination/LegacyPagination.d.ts +3 -0
  418. package/build/typescript/Pagination/LegacyPaginationProps.d.ts +71 -0
  419. package/build/typescript/Pagination/NumberPagination.d.ts +8 -0
  420. package/build/typescript/Pagination/PaginationProps.d.ts +7 -0
  421. package/build/typescript/Pagination/index.d.ts +2 -2
  422. package/build/typescript/PaginationItem/LegacyPaginationItem.d.ts +5 -0
  423. package/build/typescript/Snackbar/LegacySnackbar.d.ts +3 -0
  424. package/build/typescript/Snackbar/LegacySnackbarProps.d.ts +51 -0
  425. package/build/typescript/Snackbar/SnackbarProps.d.ts +9 -2
  426. package/build/typescript/Snackbar/index.d.ts +2 -2
  427. package/build/typescript/SnackbarContent/LegacySnackbarContent.d.ts +3 -0
  428. package/build/typescript/SnackbarContent/LegacySnackbarContentProps.d.ts +26 -0
  429. package/build/typescript/SnackbarContent/SnackbarContentProps.d.ts +5 -24
  430. package/build/typescript/SnackbarContent/StatusIcon.d.ts +7 -0
  431. package/build/typescript/SnackbarContent/index.d.ts +2 -2
  432. package/build/typescript/Tab/LegacyTab.d.ts +3 -0
  433. package/build/typescript/Tab/LegacyTabProps.d.ts +58 -0
  434. package/build/typescript/Tab/TabIndicator.d.ts +2 -2
  435. package/build/typescript/Tab/TabProps.d.ts +3 -16
  436. package/build/typescript/Tab/index.d.ts +2 -2
  437. package/build/typescript/Tab/useVariantStyleMap.d.ts +10 -0
  438. package/build/typescript/TabBase/LegacyTabBase.d.ts +3 -0
  439. package/build/typescript/TabBase/index.d.ts +1 -1
  440. package/build/typescript/Tabs/LegacyTabIndicator.d.ts +3 -0
  441. package/build/typescript/Tabs/LegacyTabIndicatorProps.d.ts +28 -0
  442. package/build/typescript/Tabs/LegacyTabs.d.ts +5 -0
  443. package/build/typescript/Tabs/LegacyTabsProps.d.ts +74 -0
  444. package/build/typescript/Tabs/TabIndicatorProps.d.ts +0 -10
  445. package/build/typescript/Tabs/Tabs.d.ts +1 -1
  446. package/build/typescript/Tabs/TabsProps.d.ts +10 -10
  447. package/build/typescript/Tabs/index.d.ts +2 -2
  448. package/build/typescript/TextField/LegacyTextField.d.ts +5 -0
  449. package/build/typescript/TextField/LegacyTextFieldProps.d.ts +67 -0
  450. package/build/typescript/TextField/OutlinedTextField.d.ts +1 -1
  451. package/build/typescript/TextField/TextField.d.ts +1 -1
  452. package/build/typescript/TextField/TextFieldProps.d.ts +25 -51
  453. package/build/typescript/TextField/index.d.ts +2 -2
  454. package/build/typescript/TextField/useVariantStyleMap.d.ts +9 -0
  455. package/build/typescript/Tooltip/Beaks/Beak.d.ts +3 -0
  456. package/build/typescript/Tooltip/Beaks/BeakProps.d.ts +4 -0
  457. package/build/typescript/Tooltip/Beaks/HorizontalLargeBeak.d.ts +3 -0
  458. package/build/typescript/Tooltip/Beaks/HorizontalSmallBeak.d.ts +3 -0
  459. package/build/typescript/Tooltip/Beaks/VerticalLargeBeak.d.ts +3 -0
  460. package/build/typescript/Tooltip/Beaks/VerticalSmallBeak.d.ts +3 -0
  461. package/build/typescript/Tooltip/Beaks/index.d.ts +2 -0
  462. package/build/typescript/Tooltip/LegacyTooltip.d.ts +3 -0
  463. package/build/typescript/Tooltip/LegacyTooltipProps.d.ts +72 -0
  464. package/build/typescript/Tooltip/TooltipProps.d.ts +19 -9
  465. package/build/typescript/Tooltip/index.d.ts +2 -2
  466. package/build/typescript/index.d.ts +2 -0
  467. package/build/typescript/internal/icons/CheckCircle.d.ts +8 -0
  468. package/build/typescript/internal/icons/Clear.d.ts +8 -0
  469. package/build/typescript/internal/icons/EyeOff.d.ts +8 -0
  470. package/build/typescript/internal/icons/EyeOn.d.ts +8 -0
  471. package/build/typescript/internal/icons/InfoCircle.d.ts +8 -0
  472. package/build/typescript/internal/icons/LoadingSpinner/LoadingSpinnerProps.d.ts +9 -0
  473. package/build/typescript/internal/icons/LoadingSpinner/index.d.ts +3 -0
  474. package/build/typescript/internal/icons/LoadingSpinner/index.native.d.ts +3 -0
  475. package/build/typescript/internal/icons/LoadingSpinner/utils.d.ts +3 -0
  476. package/build/typescript/internal/icons/Search.d.ts +8 -0
  477. package/build/typescript/internal/icons/index.d.ts +7 -0
  478. package/package.json +2 -2
  479. package/src/Accordion/Accordion.tsx +75 -72
  480. package/src/Accordion/AccordionProps.ts +11 -2
  481. package/src/Accordion/LegacyAccordion.tsx +188 -0
  482. package/src/Accordion/LegacyAccordionProps.ts +34 -0
  483. package/src/Accordion/index.ts +2 -2
  484. package/src/Accordion/useVariantStyleMap.ts +127 -0
  485. package/src/Badge/Badge.tsx +23 -29
  486. package/src/Badge/BadgeProps.ts +35 -2
  487. package/src/Badge/LegacyBadge.tsx +66 -0
  488. package/src/Badge/LegacyBadgeProps.ts +40 -0
  489. package/src/Badge/index.ts +2 -2
  490. package/src/Badge/useVariantStyleMap.ts +73 -0
  491. package/src/Button/Button.tsx +72 -22
  492. package/src/Button/ButtonProps.ts +8 -0
  493. package/src/Button/useVariantStyleMap.ts +88 -9
  494. package/src/ButtonBase/ButtonBase.tsx +4 -10
  495. package/src/ButtonBase/LegacyButtonBase.tsx +135 -0
  496. package/src/ButtonBase/index.ts +2 -2
  497. package/src/Chip/Chip.tsx +26 -82
  498. package/src/Chip/ChipProps.ts +16 -7
  499. package/src/Chip/LegacyChip.tsx +116 -0
  500. package/src/Chip/LegacyChipProps.ts +33 -0
  501. package/src/Chip/index.ts +2 -2
  502. package/src/Chip/useChipStyle.ts +123 -0
  503. package/src/Empty/Empty.tsx +108 -0
  504. package/src/Empty/EmptyProps.ts +31 -0
  505. package/src/Empty/index.ts +2 -0
  506. package/src/IconButton/LegacyIconButton.tsx +3 -2
  507. package/src/IconButton/LegacyIconButtonProps.ts +5 -0
  508. package/src/Pagination/LegacyPagination.tsx +168 -0
  509. package/src/Pagination/LegacyPaginationProps.ts +85 -0
  510. package/src/Pagination/NumberPagination.tsx +78 -0
  511. package/src/Pagination/Pagination.tsx +15 -5
  512. package/src/Pagination/PaginationProps.ts +9 -0
  513. package/src/Pagination/index.ts +2 -2
  514. package/src/PaginationItem/LegacyPaginationItem.tsx +52 -0
  515. package/src/PaginationItem/PaginationItem.tsx +2 -2
  516. package/src/Snackbar/LegacySnackbar.tsx +130 -0
  517. package/src/Snackbar/LegacySnackbarProps.ts +61 -0
  518. package/src/Snackbar/Snackbar.tsx +7 -5
  519. package/src/Snackbar/SnackbarProps.ts +11 -3
  520. package/src/Snackbar/index.ts +2 -2
  521. package/src/SnackbarContent/LegacySnackbarContent.tsx +129 -0
  522. package/src/SnackbarContent/LegacySnackbarContentProps.ts +30 -0
  523. package/src/SnackbarContent/SnackbarContent.tsx +53 -48
  524. package/src/SnackbarContent/SnackbarContentProps.ts +10 -27
  525. package/src/SnackbarContent/StatusIcon.tsx +37 -0
  526. package/src/SnackbarContent/index.ts +2 -2
  527. package/src/Tab/LegacyTab.tsx +141 -0
  528. package/src/Tab/LegacyTabProps.ts +68 -0
  529. package/src/Tab/Tab.tsx +36 -79
  530. package/src/Tab/TabIndicator.tsx +5 -2
  531. package/src/Tab/TabProps.ts +3 -18
  532. package/src/Tab/index.ts +2 -2
  533. package/src/Tab/useVariantStyleMap.ts +86 -0
  534. package/src/TabBase/LegacyTabBase.tsx +55 -0
  535. package/src/TabBase/TabBase.tsx +0 -5
  536. package/src/TabBase/index.ts +2 -2
  537. package/src/Tabs/LegacyTabIndicator.tsx +111 -0
  538. package/src/Tabs/LegacyTabIndicatorProps.ts +33 -0
  539. package/src/Tabs/LegacyTabs.tsx +225 -0
  540. package/src/Tabs/LegacyTabsProps.ts +87 -0
  541. package/src/Tabs/TabIndicator.tsx +6 -12
  542. package/src/Tabs/TabIndicatorProps.ts +0 -13
  543. package/src/Tabs/Tabs.tsx +12 -8
  544. package/src/Tabs/TabsProps.ts +12 -11
  545. package/src/Tabs/index.ts +2 -2
  546. package/src/TextField/LegacyTextField.tsx +168 -0
  547. package/src/TextField/LegacyTextFieldProps.ts +80 -0
  548. package/src/TextField/OutlinedTextField.tsx +1 -1
  549. package/src/TextField/TextField.tsx +155 -137
  550. package/src/TextField/TextFieldProps.ts +27 -57
  551. package/src/TextField/index.tsx +2 -2
  552. package/src/TextField/useVariantStyleMap.ts +100 -0
  553. package/src/Tooltip/Beaks/Beak.tsx +53 -0
  554. package/src/Tooltip/Beaks/BeakProps.ts +4 -0
  555. package/src/Tooltip/Beaks/HorizontalLargeBeak.tsx +18 -0
  556. package/src/Tooltip/Beaks/HorizontalSmallBeak.tsx +18 -0
  557. package/src/Tooltip/Beaks/VerticalLargeBeak.tsx +18 -0
  558. package/src/Tooltip/Beaks/VerticalSmallBeak.tsx +18 -0
  559. package/src/Tooltip/Beaks/index.ts +2 -0
  560. package/src/Tooltip/LegacyTooltip.tsx +167 -0
  561. package/src/Tooltip/LegacyTooltipProps.ts +86 -0
  562. package/src/Tooltip/Tooltip.tsx +114 -66
  563. package/src/Tooltip/TooltipProps.ts +28 -10
  564. package/src/Tooltip/index.ts +2 -2
  565. package/src/hooks/useCollapsibleAppBar.ts +2 -3
  566. package/src/index.ts +3 -0
  567. package/src/internal/icons/CheckCircle.tsx +20 -0
  568. package/src/internal/icons/Clear.tsx +20 -0
  569. package/src/internal/icons/EyeOff.tsx +25 -0
  570. package/src/internal/icons/EyeOn.tsx +20 -0
  571. package/src/internal/icons/InfoCircle.tsx +21 -0
  572. package/src/internal/icons/LoadingSpinner/LoadingSpinnerProps.ts +11 -0
  573. package/src/internal/icons/LoadingSpinner/index.native.tsx +31 -0
  574. package/src/internal/icons/LoadingSpinner/index.tsx +31 -0
  575. package/src/internal/icons/LoadingSpinner/loadingSpinnerGray.json +1 -0
  576. package/src/internal/icons/LoadingSpinner/loadingSpinnerWhite.json +1 -0
  577. package/src/internal/icons/LoadingSpinner/utils.ts +14 -0
  578. package/src/internal/icons/Search.tsx +15 -0
  579. package/src/internal/icons/index.ts +7 -0
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _styles = require("../styles");
13
+
14
+ var _hooks = require("../hooks");
15
+
16
+ var _LegacyTabIndicator = _interopRequireDefault(require("./LegacyTabIndicator"));
17
+
18
+ var _ScrollableTabsView = _interopRequireDefault(require("./ScrollableTabsView"));
19
+
20
+ var _IndexAwareTab = _interopRequireDefault(require("./IndexAwareTab"));
21
+
22
+ var _useTabCoordinates = _interopRequireDefault(require("./useTabCoordinates"));
23
+
24
+ var _useTabInnerContentsWidth = _interopRequireDefault(require("./useTabInnerContentsWidth"));
25
+
26
+ var _useIndexStore = _interopRequireDefault(require("./useIndexStore"));
27
+
28
+ var _InternalContext = _interopRequireDefault(require("./InternalContext"));
29
+
30
+ var _utils = require("./utils");
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
+
34
+ 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); }
35
+
36
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
+
38
+ const useStyles = function () {
39
+ const theme = (0, _styles.useTheme)();
40
+ return {
41
+ root: {},
42
+ fixedRoot: {
43
+ flexDirection: 'row'
44
+ },
45
+ fixedTab: {
46
+ flex: 1
47
+ },
48
+ scrollableContainer: {
49
+ paddingHorizontal: theme.spacing(1)
50
+ }
51
+ };
52
+ };
53
+
54
+ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
55
+ var _React$Children$map;
56
+
57
+ const {
58
+ children,
59
+ indicatorColor = 'primary',
60
+ initialIndex = 0,
61
+ disableIndicator = false,
62
+ indicatorSize = 'full',
63
+ keyboardDismissMode = 'none',
64
+ keyboardShouldPersistTaps = 'never',
65
+ onChange,
66
+ scrollable = false,
67
+ scrollViewContentContainerStyle,
68
+ style,
69
+ variant = 'primary',
70
+ UNSTABLE_sharedIndex,
71
+ onTabSelected
72
+ } = props;
73
+ const fallbackSharedIndex = (0, _hooks.useSyncAnimatedValue)({
74
+ initialValue: initialIndex
75
+ });
76
+ const sharedIndex = UNSTABLE_sharedIndex ?? fallbackSharedIndex;
77
+ const realInitialIndex = sharedIndex.initialValue;
78
+ const currentIndexRef = (0, _react.useRef)(initialIndex);
79
+
80
+ const setTab = newIndex => {
81
+ const currentIndex = currentIndexRef.current;
82
+ onTabSelected === null || onTabSelected === void 0 ? void 0 : onTabSelected(newIndex, currentIndex);
83
+ sharedIndex.animatedValue.setValue(newIndex);
84
+ };
85
+
86
+ (0, _react.useImperativeHandle)(ref, () => ({
87
+ setTab
88
+ }), [sharedIndex]);
89
+ const styles = useStyles();
90
+ const [outerCoordinates, updateCoordinate] = (0, _useTabCoordinates.default)(children);
91
+ const [innerContentsWidthList, updateInnerContentsWidth] = (0, _useTabInnerContentsWidth.default)(children);
92
+ const canRenderIndicator = indicatorSize === 'fit-content' ? (0, _utils.isEveryTabCoordinatesDefined)(innerContentsWidthList, children) : (0, _utils.isEveryTabCoordinatesDefined)(outerCoordinates, children);
93
+ const indexStore = (0, _useIndexStore.default)(sharedIndex);
94
+ const coordinates = (0, _react.useMemo)(() => {
95
+ if (indicatorSize !== 'fit-content') {
96
+ return outerCoordinates;
97
+ }
98
+
99
+ return innerContentsWidthList.map((innerContentWidth, idx) => {
100
+ const {
101
+ x1: outerX1,
102
+ x2: outerX2
103
+ } = outerCoordinates[idx];
104
+ const tabWidth = outerX2 - outerX1;
105
+ const distanceFromParent = (tabWidth - innerContentWidth) / 2;
106
+ const indicatorStartCoordinate = outerX1 + distanceFromParent;
107
+ return {
108
+ x1: indicatorStartCoordinate,
109
+ x2: indicatorStartCoordinate + innerContentWidth
110
+ };
111
+ });
112
+ }, [outerCoordinates, innerContentsWidthList, variant]);
113
+ (0, _react.useEffect)(() => {
114
+ return indexStore.subscribe(newIndex => {
115
+ onChange === null || onChange === void 0 ? void 0 : onChange(newIndex);
116
+ currentIndexRef.current = newIndex;
117
+ });
118
+ }, [indexStore, onChange]);
119
+ const tabElements = (_React$Children$map = _react.default.Children.map(children, (child, index) => {
120
+ if (!child) {
121
+ return null;
122
+ }
123
+
124
+ const onTabInnerLayout = event => {
125
+ const {
126
+ width
127
+ } = event.nativeEvent.layout;
128
+ updateInnerContentsWidth(index, width);
129
+ };
130
+
131
+ const onLayout = event => {
132
+ var _child$props$onLayout, _child$props;
133
+
134
+ const {
135
+ x,
136
+ width
137
+ } = event.nativeEvent.layout;
138
+ updateCoordinate(index, x, width); // @ts-ignore
139
+
140
+ (_child$props$onLayout = (_child$props = child.props).onLayout) === null || _child$props$onLayout === void 0 ? void 0 : _child$props$onLayout.call(_child$props, event);
141
+ };
142
+
143
+ const onMouseDown = e => {
144
+ if (keyboardShouldPersistTaps === 'always') {
145
+ e.preventDefault();
146
+ }
147
+ };
148
+
149
+ const onPress = () => {
150
+ var _child$props$onPress, _child$props2;
151
+
152
+ setTab(index); // @ts-ignore
153
+
154
+ (_child$props$onPress = (_child$props2 = child.props).onPress) === null || _child$props$onPress === void 0 ? void 0 : _child$props$onPress.call(_child$props2);
155
+ }; // @ts-ignore
156
+
157
+
158
+ const tabElement = /*#__PURE__*/(0, _react.cloneElement)(child, {
159
+ enableIndicator: !disableIndicator && !canRenderIndicator,
160
+ indicatorColor,
161
+ onTabInnerLayout,
162
+ onLayout,
163
+ onPress,
164
+ onMouseDown,
165
+ variant,
166
+ indicatorSize,
167
+ style: scrollable ? undefined : styles.fixedTab
168
+ });
169
+ return /*#__PURE__*/_react.default.createElement(_IndexAwareTab.default, {
170
+ children: tabElement,
171
+ index: index,
172
+ initialIndex: realInitialIndex
173
+ });
174
+ })) === null || _React$Children$map === void 0 ? void 0 : _React$Children$map.filter(Boolean);
175
+ const tabIndicator = canRenderIndicator ? /*#__PURE__*/_react.default.createElement(_LegacyTabIndicator.default, {
176
+ color: indicatorColor,
177
+ coordinates: coordinates,
178
+ disabled: disableIndicator,
179
+ initialIndex: realInitialIndex,
180
+ scrollable: scrollable
181
+ }) : null;
182
+ return /*#__PURE__*/_react.default.createElement(_InternalContext.default.Provider, {
183
+ value: {
184
+ indexStore
185
+ }
186
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
187
+ style: (0, _styles.css)([styles.root, scrollable ? undefined : styles.fixedRoot, style])
188
+ }, scrollable ? /*#__PURE__*/_react.default.createElement(_ScrollableTabsView.default, {
189
+ automaticallyAdjustContentInsets: false,
190
+ bounces: false,
191
+ contentContainerStyle: (0, _styles.css)([styles.scrollableContainer, scrollViewContentContainerStyle]),
192
+ coordinates: coordinates,
193
+ directionalLockEnabled: true,
194
+ horizontal: true,
195
+ initialIndex: realInitialIndex,
196
+ scrollsToTop: false,
197
+ showsHorizontalScrollIndicator: false,
198
+ showsVerticalScrollIndicator: false,
199
+ keyboardDismissMode: keyboardDismissMode,
200
+ keyboardShouldPersistTaps: keyboardShouldPersistTaps
201
+ }, tabElements, tabIndicator) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, tabElements, tabIndicator)));
202
+ });
203
+ var _default = Tabs;
204
+ exports.default = _default;
205
+ //# sourceMappingURL=LegacyTabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useStyles","theme","useTheme","root","fixedRoot","flexDirection","fixedTab","flex","scrollableContainer","paddingHorizontal","spacing","Tabs","forwardRef","props","ref","children","indicatorColor","initialIndex","disableIndicator","indicatorSize","keyboardDismissMode","keyboardShouldPersistTaps","onChange","scrollable","scrollViewContentContainerStyle","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","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","css"],"sources":["LegacyTabs.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 TabsProps from './LegacyTabsProps';\nimport type { TabsInstance } from './types';\nimport TabIndicator from './LegacyTabIndicator';\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\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 };\n};\n\nconst Tabs = forwardRef<TabsInstance, TabsProps>(function Tabs(props, ref) {\n const {\n children,\n indicatorColor = 'primary',\n initialIndex = 0,\n disableIndicator = false,\n indicatorSize = 'full',\n keyboardDismissMode = 'none',\n keyboardShouldPersistTaps = 'never',\n onChange,\n scrollable = false,\n scrollViewContentContainerStyle,\n style,\n variant = 'primary',\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 [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 (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, variant]);\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 indicatorColor,\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 color={indicatorColor}\n coordinates={coordinates}\n disabled={disableIndicator}\n initialIndex={realInitialIndex}\n scrollable={scrollable}\n />\n ) : null;\n\n return (\n <InternalContext.Provider value={{ indexStore }}>\n <View\n style={css([\n styles.root,\n scrollable ? undefined : styles.fixedRoot,\n style,\n ])}\n >\n {scrollable ? (\n <ScrollableTabsView\n automaticallyAdjustContentInsets={false}\n bounces={false}\n contentContainerStyle={css([\n styles.scrollableContainer,\n scrollViewContentContainerStyle,\n ])}\n coordinates={coordinates}\n directionalLockEnabled={true}\n horizontal={true}\n initialIndex={realInitialIndex}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n keyboardDismissMode={keyboardDismissMode}\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n >\n {tabElements}\n {tabIndicator}\n </ScrollableTabsView>\n ) : (\n <React.Fragment>\n {tabElements}\n {tabIndicator}\n </React.Fragment>\n )}\n </View>\n </InternalContext.Provider>\n );\n});\n\nexport default Tabs;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AAGA;;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,mBAAmB,EAAE;MACjBC,iBAAiB,EAAER,KAAK,CAACS,OAAN,CAAc,CAAd;IADF;EARlB,CAAP;AAYH,CAfD;;AAiBA,MAAMC,IAAI,gBAAG,IAAAC,iBAAA,EAAoC,SAASD,IAAT,CAAcE,KAAd,EAAqBC,GAArB,EAA0B;EAAA;;EACvE,MAAM;IACFC,QADE;IAEFC,cAAc,GAAG,SAFf;IAGFC,YAAY,GAAG,CAHb;IAIFC,gBAAgB,GAAG,KAJjB;IAKFC,aAAa,GAAG,MALd;IAMFC,mBAAmB,GAAG,MANpB;IAOFC,yBAAyB,GAAG,OAP1B;IAQFC,QARE;IASFC,UAAU,GAAG,KATX;IAUFC,+BAVE;IAWFC,KAXE;IAYFC,OAAO,GAAG,SAZR;IAaFC,oBAbE;IAcFC;EAdE,IAeFf,KAfJ;EAiBA,MAAMgB,mBAAmB,GAAG,IAAAC,2BAAA,EAAqB;IAAEC,YAAY,EAAEd;EAAhB,CAArB,CAA5B;EACA,MAAMe,WAAW,GAAGL,oBAAoB,IAAIE,mBAA5C;EACA,MAAMI,gBAAgB,GAAGD,WAAW,CAACD,YAArC;EAEA,MAAMG,eAAe,GAAG,IAAAC,aAAA,EAAOlB,YAAP,CAAxB;;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oE,WAAA,EAAI,CACvBhD,MAAM,CAACnC,mBADgB,EAEvBgB,+BAFuB,CAAJ,CAH3B;IAOI,WAAW,EAAE8B,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,EAAEb,mBAdzB;IAeI,yBAAyB,EAAEC;EAf/B,GAiBK+C,WAjBL,EAkBKsB,YAlBL,CADO,gBAsBP,6BAAC,cAAD,CAAO,QAAP,QACKtB,WADL,EAEKsB,YAFL,CA7BR,CADJ,CADJ;AAuCH,CApLY,CAAb;eAsLe/E,I"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=LegacyTabsProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LegacyTabsProps.ts"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { TabVariant, TabIndicatorSize } from '../Tab';\nimport type { ExtendedStyle, OverridableComponentProps, SyncAnimatedValue } from '../types';\nimport type { TabIndicatorColor } from './LegacyTabIndicatorProps';\nimport type { KeyboardDismissMode, KeyboardShouldPersistTaps, TabsInstance } from './types';\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 * If `true`, the indicator is disabled.\n * @default false\n */\n disableIndicator?: boolean;\n\n /**\n * The color of tab indicator\n * @default 'primary'\n */\n indicatorColor?: TabIndicatorColor;\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 'full'\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 * 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":""}
@@ -29,13 +29,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
29
29
 
30
30
  const INDICATOR_WIDTH = 10;
31
31
  const INDICATOR_HEIGHT = 2;
32
- const SCROLLABLE_TABS_INSET = 12 * 2;
33
32
 
34
- const useStyles = function (color) {
33
+ const useStyles = function () {
35
34
  const theme = (0, _styles.useTheme)();
36
35
  return {
37
36
  root: {
38
- backgroundColor: theme.palette[color].main,
37
+ backgroundColor: theme.palette.icon.strong,
39
38
  left: 0,
40
39
  bottom: 0,
41
40
  width: INDICATOR_WIDTH,
@@ -59,15 +58,13 @@ const startAnimation = (value, toValue) => {
59
58
 
60
59
  function TabIndicator(props) {
61
60
  const {
62
- color = 'primary',
63
61
  coordinates,
64
62
  disabled,
65
63
  initialIndex,
66
- scrollable,
67
64
  style,
68
65
  ...otherProps
69
66
  } = props;
70
- const styles = useStyles(color);
67
+ const styles = useStyles();
71
68
  const computeAnimationValues = (0, _react.useCallback)(currentIndex => {
72
69
  const {
73
70
  x1,
@@ -75,13 +72,12 @@ function TabIndicator(props) {
75
72
  } = coordinates[currentIndex] ?? _TabCoordinate.defaultCoordinate;
76
73
  const tabWidth = x2 - x1;
77
74
  const nextTranslateX = x1 + (tabWidth - INDICATOR_WIDTH) / 2;
78
- const inset = scrollable ? SCROLLABLE_TABS_INSET : 0;
79
- const nextScaleX = (tabWidth - inset) / INDICATOR_WIDTH;
75
+ const nextScaleX = tabWidth / INDICATOR_WIDTH;
80
76
  return {
81
77
  tx: nextTranslateX,
82
78
  sx: nextScaleX
83
79
  };
84
- }, [coordinates, scrollable]);
80
+ }, [coordinates]);
85
81
  const {
86
82
  tx: initialTx,
87
83
  sx: initialSx
@@ -1 +1 @@
1
- {"version":3,"names":["INDICATOR_WIDTH","INDICATOR_HEIGHT","SCROLLABLE_TABS_INSET","useStyles","color","theme","useTheme","root","backgroundColor","palette","main","left","bottom","width","height","position","disabled","startAnimation","value","toValue","Animated","timing","duration","easing","Easing","bezier","useNativeDriver","isNotAndroid12","start","TabIndicator","props","coordinates","initialIndex","scrollable","style","otherProps","styles","computeAnimationValues","useCallback","currentIndex","x1","x2","defaultCoordinate","tabWidth","nextTranslateX","inset","nextScaleX","tx","sx","initialTx","initialSx","translateX","useAnimatedValue","scaleX","indexStore","useContext","InternalContext","useEffect","scrollToIndex","index","getState","subscribe","undefined","transform"],"sources":["TabIndicator.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect } from 'react';\nimport { Animated, Easing } from 'react-native';\nimport { NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { useAnimatedValue } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport type TabIndicatorProps from './TabIndicatorProps';\nimport type { TabIndicatorColor } from './TabIndicatorProps';\nimport { defaultCoordinate } from './TabCoordinate';\nimport InternalContext from './InternalContext';\n\ntype TabIndicatorStyles = NamedStylesStringUnion<'root' | 'disabled'>;\n\nconst INDICATOR_WIDTH = 10;\nconst INDICATOR_HEIGHT = 2;\n\nconst SCROLLABLE_TABS_INSET = 12 * 2;\n\nconst useStyles: (color: TabIndicatorColor) => TabIndicatorStyles =\n function (color: TabIndicatorColor): TabIndicatorStyles {\n const theme = useTheme();\n\n return {\n root: {\n backgroundColor: theme.palette[color].main,\n left: 0,\n bottom: 0,\n width: INDICATOR_WIDTH,\n height: INDICATOR_HEIGHT,\n position: 'absolute',\n },\n disabled: {\n height: 0,\n },\n };\n };\n\nconst startAnimation = (value: Animated.Value, toValue: number) => {\n Animated.timing(value, {\n toValue: toValue,\n duration: 300,\n easing: Easing.bezier(0.25, 1, 0.5, 1),\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nexport default function TabIndicator(props: TabIndicatorProps) {\n const {\n color = 'primary',\n coordinates,\n disabled,\n initialIndex,\n scrollable,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles(color);\n\n const computeAnimationValues = useCallback((currentIndex: number) => {\n const { x1, x2 } = coordinates[currentIndex] ?? defaultCoordinate;\n\n const tabWidth = x2 - x1;\n\n const nextTranslateX = x1 + (tabWidth - INDICATOR_WIDTH) / 2;\n\n const inset = scrollable ? SCROLLABLE_TABS_INSET : 0;\n const nextScaleX = (tabWidth - inset) / INDICATOR_WIDTH;\n\n return { tx: nextTranslateX, sx: nextScaleX };\n }, [coordinates, scrollable]);\n\n const {\n tx: initialTx,\n sx: initialSx,\n } = computeAnimationValues(initialIndex);\n\n const translateX = useAnimatedValue(initialTx);\n const scaleX = useAnimatedValue(initialSx);\n\n const { indexStore } = useContext(InternalContext);\n\n useEffect(() => {\n const scrollToIndex = (index: number) => {\n const { tx, sx } = computeAnimationValues(index);\n\n startAnimation(translateX, tx);\n startAnimation(scaleX, sx);\n };\n\n scrollToIndex(indexStore.getState());\n\n return indexStore.subscribe(scrollToIndex);\n }, [\n computeAnimationValues,\n coordinates,\n indexStore,\n ]);\n\n return (\n <Animated.View\n style={[\n styles.root,\n disabled ? styles.disabled : undefined,\n { transform: [{ translateX }, { scaleX }] },\n style,\n ]}\n {...otherProps}\n />\n );\n};\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J,EAEHS,QAAQ,GAAGoB,MAAM,CAACpB,QAAV,GAAqB8C,SAF1B,EAGH;MAAEC,SAAS,EAAE,CAAC;QAAEZ;MAAF,CAAD,EAAiB;QAAEE;MAAF,CAAjB;IAAb,CAHG,EAIHnB,KAJG;EADX,GAOQC,UAPR,EADJ;AAWH;;AAAA"}
1
+ {"version":3,"names":["INDICATOR_WIDTH","INDICATOR_HEIGHT","useStyles","theme","useTheme","root","backgroundColor","palette","icon","strong","left","bottom","width","height","position","disabled","startAnimation","value","toValue","Animated","timing","duration","easing","Easing","bezier","useNativeDriver","isNotAndroid12","start","TabIndicator","props","coordinates","initialIndex","style","otherProps","styles","computeAnimationValues","useCallback","currentIndex","x1","x2","defaultCoordinate","tabWidth","nextTranslateX","nextScaleX","tx","sx","initialTx","initialSx","translateX","useAnimatedValue","scaleX","indexStore","useContext","InternalContext","useEffect","scrollToIndex","index","getState","subscribe","undefined","transform"],"sources":["TabIndicator.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect } from 'react';\nimport { Animated, Easing } from 'react-native';\nimport { NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { useAnimatedValue } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport type TabIndicatorProps from './TabIndicatorProps';\nimport { defaultCoordinate } from './TabCoordinate';\nimport InternalContext from './InternalContext';\n\ntype TabIndicatorStyles = NamedStylesStringUnion<'root' | 'disabled'>;\n\nconst INDICATOR_WIDTH = 10;\nconst INDICATOR_HEIGHT = 2;\n\nconst useStyles: () => TabIndicatorStyles =\n function (): TabIndicatorStyles {\n const theme = useTheme();\n\n return {\n root: {\n backgroundColor: theme.palette.icon.strong,\n left: 0,\n bottom: 0,\n width: INDICATOR_WIDTH,\n height: INDICATOR_HEIGHT,\n position: 'absolute',\n },\n disabled: {\n height: 0,\n },\n };\n };\n\nconst startAnimation = (value: Animated.Value, toValue: number) => {\n Animated.timing(value, {\n toValue: toValue,\n duration: 300,\n easing: Easing.bezier(0.25, 1, 0.5, 1),\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nexport default function TabIndicator(props: TabIndicatorProps) {\n const {\n coordinates,\n disabled,\n initialIndex,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const computeAnimationValues = useCallback((currentIndex: number) => {\n const { x1, x2 } = coordinates[currentIndex] ?? defaultCoordinate;\n\n const tabWidth = x2 - x1;\n\n const nextTranslateX = x1 + (tabWidth - INDICATOR_WIDTH) / 2;\n\n const nextScaleX = tabWidth / INDICATOR_WIDTH;\n\n return { tx: nextTranslateX, sx: nextScaleX };\n }, [coordinates]);\n\n const {\n tx: initialTx,\n sx: initialSx,\n } = computeAnimationValues(initialIndex);\n\n const translateX = useAnimatedValue(initialTx);\n const scaleX = useAnimatedValue(initialSx);\n\n const { indexStore } = useContext(InternalContext);\n\n useEffect(() => {\n const scrollToIndex = (index: number) => {\n const { tx, sx } = computeAnimationValues(index);\n\n startAnimation(translateX, tx);\n startAnimation(scaleX, sx);\n };\n\n scrollToIndex(indexStore.getState());\n\n return indexStore.subscribe(scrollToIndex);\n }, [\n computeAnimationValues,\n coordinates,\n indexStore,\n ]);\n\n return (\n <Animated.View\n style={[\n styles.root,\n disabled ? styles.disabled : undefined,\n { transform: [{ translateX }, { scaleX }] },\n style,\n ]}\n {...otherProps}\n />\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAIA,MAAMA,eAAe,GAAG,EAAxB;AACA,MAAMC,gBAAgB,GAAG,CAAzB;;AAEA,MAAMC,SAAmC,GACrC,YAAgC;EAC5B,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,eAAe,EAAEH,KAAK,CAACI,OAAN,CAAcC,IAAd,CAAmBC,MADlC;MAEFC,IAAI,EAAE,CAFJ;MAGFC,MAAM,EAAE,CAHN;MAIFC,KAAK,EAAEZ,eAJ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,SAAjB,CAAnB;EACA,MAAMI,MAAM,GAAG,IAAAD,uBAAA,EAAiBF,SAAjB,CAAf;EAEA,MAAM;IAAEI;EAAF,IAAiB,IAAAC,iBAAA,EAAWC,wBAAX,CAAvB;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACZ,MAAMC,aAAa,GAAIC,KAAD,IAAmB;MACrC,MAAM;QAAEZ,EAAF;QAAMC;MAAN,IAAaV,sBAAsB,CAACqB,KAAD,CAAzC;MAEAxC,cAAc,CAACgC,UAAD,EAAaJ,EAAb,CAAd;MACA5B,cAAc,CAACkC,MAAD,EAASL,EAAT,CAAd;IACH,CALD;;IAOAU,aAAa,CAACJ,UAAU,CAACM,QAAX,EAAD,CAAb;IAEA,OAAON,UAAU,CAACO,SAAX,CAAqBH,aAArB,CAAP;EACH,CAXD,EAWG,CACCpB,sBADD,EAECL,WAFD,EAGCqB,UAHD,CAXH;EAiBA,oBACI,6BAAC,qBAAD,CAAU,IAAV;IACI,KAAK,EAAE,CACHjB,MAAM,CAAC7B,IADJ,EAEHU,QAAQ,GAAGmB,MAAM,CAACnB,QAAV,GAAqB4C,SAF1B,EAGH;MAAEC,SAAS,EAAE,CAAC;QAAEZ;MAAF,CAAD,EAAiB;QAAEE;MAAF,CAAjB;IAAb,CAHG,EAIHlB,KAJG;EADX,GAOQC,UAPR,EADJ;AAWH;;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["TabIndicatorProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport type TabCoordinate from './TabCoordinate';\n\nexport type TabIndicatorColor = 'primary' | 'secondary';\n\nexport default interface TabIndicatorProps extends OverridableComponentProps<ViewProps, {\n /**\n * Tab item coordinates.\n */\n coordinates: TabCoordinate[];\n\n /**\n * Indicator color.\n * @default: 'primary'\n */\n color?: TabIndicatorColor;\n\n /**\n * If `true`, the indicator is disabled.\n */\n disabled: boolean;\n\n /**\n * Initial index.\n */\n initialIndex: number;\n\n /**\n * If `true`, the tab will be able to scroll.\n */\n scrollable: boolean;\n}> {}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["TabIndicatorProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport type TabCoordinate from './TabCoordinate';\n\nexport default interface TabIndicatorProps extends OverridableComponentProps<ViewProps, {\n /**\n * Tab item coordinates.\n */\n coordinates: TabCoordinate[];\n\n /**\n * If `true`, the indicator is disabled.\n */\n disabled: boolean;\n\n /**\n * Initial index.\n */\n initialIndex: number;\n}> {}\n"],"mappings":""}
@@ -47,6 +47,10 @@ const useStyles = function () {
47
47
  },
48
48
  scrollableContainer: {
49
49
  paddingHorizontal: theme.spacing(1)
50
+ },
51
+ bottomDivider: {
52
+ borderBottomColor: theme.palette.border.base,
53
+ borderBottomWidth: 1
50
54
  }
51
55
  };
52
56
  };
@@ -56,17 +60,17 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
56
60
 
57
61
  const {
58
62
  children,
59
- indicatorColor = 'primary',
60
63
  initialIndex = 0,
61
64
  disableIndicator = false,
62
- indicatorSize = 'full',
65
+ indicatorSize = 'fit-content',
63
66
  keyboardDismissMode = 'none',
64
67
  keyboardShouldPersistTaps = 'never',
65
68
  onChange,
66
69
  scrollable = false,
67
70
  scrollViewContentContainerStyle,
71
+ showDivider = false,
68
72
  style,
69
- variant = 'primary',
73
+ variant = 'default',
70
74
  UNSTABLE_sharedIndex,
71
75
  onTabSelected
72
76
  } = props;
@@ -109,7 +113,7 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
109
113
  x2: indicatorStartCoordinate + innerContentWidth
110
114
  };
111
115
  });
112
- }, [outerCoordinates, innerContentsWidthList, variant]);
116
+ }, [outerCoordinates, innerContentsWidthList, indicatorSize]);
113
117
  (0, _react.useEffect)(() => {
114
118
  return indexStore.subscribe(newIndex => {
115
119
  onChange === null || onChange === void 0 ? void 0 : onChange(newIndex);
@@ -157,7 +161,6 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
157
161
 
158
162
  const tabElement = /*#__PURE__*/(0, _react.cloneElement)(child, {
159
163
  enableIndicator: !disableIndicator && !canRenderIndicator,
160
- indicatorColor,
161
164
  onTabInnerLayout,
162
165
  onLayout,
163
166
  onPress,
@@ -173,18 +176,16 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)(function Tabs(props, ref) {
173
176
  });
174
177
  })) === null || _React$Children$map === void 0 ? void 0 : _React$Children$map.filter(Boolean);
175
178
  const tabIndicator = canRenderIndicator ? /*#__PURE__*/_react.default.createElement(_TabIndicator.default, {
176
- color: indicatorColor,
177
179
  coordinates: coordinates,
178
180
  disabled: disableIndicator,
179
- initialIndex: realInitialIndex,
180
- scrollable: scrollable
181
+ initialIndex: realInitialIndex
181
182
  }) : null;
182
183
  return /*#__PURE__*/_react.default.createElement(_InternalContext.default.Provider, {
183
184
  value: {
184
185
  indexStore
185
186
  }
186
187
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
187
- style: (0, _styles.css)([styles.root, scrollable ? undefined : styles.fixedRoot, style])
188
+ style: (0, _styles.css)([styles.root, showDivider ? styles.bottomDivider : undefined, scrollable ? undefined : styles.fixedRoot, style])
188
189
  }, scrollable ? /*#__PURE__*/_react.default.createElement(_ScrollableTabsView.default, {
189
190
  automaticallyAdjustContentInsets: false,
190
191
  bounces: false,
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","theme","useTheme","root","fixedRoot","flexDirection","fixedTab","flex","scrollableContainer","paddingHorizontal","spacing","Tabs","forwardRef","props","ref","children","indicatorColor","initialIndex","disableIndicator","indicatorSize","keyboardDismissMode","keyboardShouldPersistTaps","onChange","scrollable","scrollViewContentContainerStyle","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","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","css"],"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 TabsProps 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\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 };\n};\n\nconst Tabs = forwardRef<TabsInstance, TabsProps>(function Tabs(props, ref) {\n const {\n children,\n indicatorColor = 'primary',\n initialIndex = 0,\n disableIndicator = false,\n indicatorSize = 'full',\n keyboardDismissMode = 'none',\n keyboardShouldPersistTaps = 'never',\n onChange,\n scrollable = false,\n scrollViewContentContainerStyle,\n style,\n variant = 'primary',\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 [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 (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, variant]);\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 indicatorColor,\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 color={indicatorColor}\n coordinates={coordinates}\n disabled={disableIndicator}\n initialIndex={realInitialIndex}\n scrollable={scrollable}\n />\n ) : null;\n\n return (\n <InternalContext.Provider value={{ indexStore }}>\n <View\n style={css([\n styles.root,\n scrollable ? undefined : styles.fixedRoot,\n style,\n ])}\n >\n {scrollable ? (\n <ScrollableTabsView\n automaticallyAdjustContentInsets={false}\n bounces={false}\n contentContainerStyle={css([\n styles.scrollableContainer,\n scrollViewContentContainerStyle,\n ])}\n coordinates={coordinates}\n directionalLockEnabled={true}\n horizontal={true}\n initialIndex={realInitialIndex}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n keyboardDismissMode={keyboardDismissMode}\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n >\n {tabElements}\n {tabIndicator}\n </ScrollableTabsView>\n ) : (\n <React.Fragment>\n {tabElements}\n {tabIndicator}\n </React.Fragment>\n )}\n </View>\n </InternalContext.Provider>\n );\n});\n\nexport default Tabs;\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IAThB;IAUI,YAAY,EAAErB,gBAVlB;IAWI,YAAY,EAAE,KAXlB;IAYI,8BAA8B,EAAE,KAZpC;IAaI,4BAA4B,EAAE,KAblC;IAcI,mBAAmB,EAAEb,mBAdzB;IAeI,yBAAyB,EAAEC;EAf/B,GAiBK+C,WAjBL,EAkBKsB,YAlBL,CADO,gBAsBP,6BAAC,cAAD,CAAO,QAAP,QACKtB,WADL,EAEKsB,YAFL,CA7BR,CADJ,CADJ;AAuCH,CApLY,CAAb;eAsLe/E,I"}
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","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","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","css"],"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/TabProps';\nimport type TabsProps 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: 1,\n },\n };\n};\n\nconst Tabs = forwardRef<TabsInstance, TabsProps>(function Tabs(props, ref) {\n const {\n children,\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 [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 (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, indicatorSize]);\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 return (\n <InternalContext.Provider value={{ indexStore }}>\n <View\n style={css([\n styles.root,\n showDivider ? styles.bottomDivider : undefined,\n scrollable ? undefined : styles.fixedRoot,\n style,\n ])}\n >\n {scrollable ? (\n <ScrollableTabsView\n automaticallyAdjustContentInsets={false}\n bounces={false}\n contentContainerStyle={css([\n styles.scrollableContainer,\n scrollViewContentContainerStyle,\n ])}\n coordinates={coordinates}\n directionalLockEnabled={true}\n horizontal={true}\n initialIndex={realInitialIndex}\n scrollsToTop={false}\n showsHorizontalScrollIndicator={false}\n showsVerticalScrollIndicator={false}\n keyboardDismissMode={keyboardDismissMode}\n keyboardShouldPersistTaps={keyboardShouldPersistTaps}\n >\n {tabElements}\n {tabIndicator}\n </ScrollableTabsView>\n ) : (\n <React.Fragment>\n {tabElements}\n {tabIndicator}\n </React.Fragment>\n )}\n </View>\n </InternalContext.Provider>\n );\n});\n\nexport default Tabs;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAWA,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,mBAAmB,EAAE;MACjBC,iBAAiB,EAAER,KAAK,CAACS,OAAN,CAAc,CAAd;IADF,CARlB;IAWHC,aAAa,EAAE;MACXC,iBAAiB,EAAEX,KAAK,CAACY,OAAN,CAAcC,MAAd,CA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1
  "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tabIndicatorSizes = void 0;
7
+ const tabIndicatorSizes = ['fit-content', 'full'];
8
+ exports.tabIndicatorSizes = tabIndicatorSizes;
2
9
  //# sourceMappingURL=TabsProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["TabsProps.ts"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { TabIndicatorColor } from './TabIndicatorProps';\nimport type { TabVariant, TabIndicatorSize } from '../Tab';\nimport type { OverridableComponentProps, SyncAnimatedValue } from '../types';\nimport type { KeyboardDismissMode, KeyboardShouldPersistTaps, TabsInstance } from './types';\nimport type { ExtendedStyle } from '../types';\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 * If `true`, the indicator is disabled.\n * @default false\n */\n disableIndicator?: boolean;\n\n /**\n * The color of tab indicator\n * @default 'primary'\n */\n indicatorColor?: TabIndicatorColor;\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 'full'\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 * 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":""}
1
+ {"version":3,"names":["tabIndicatorSizes"],"sources":["TabsProps.ts"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { TabVariant } from '../Tab/TabProps';\nimport type { ExtendedStyle, OverridableComponentProps, SyncAnimatedValue } from '../types';\nimport type { KeyboardDismissMode, KeyboardShouldPersistTaps, TabsInstance } from './types';\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 * 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,iBAAiB,GAAG,CAAC,aAAD,EAAgB,MAAhB,CAA1B"}
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _Tabs.default;
9
+ return _LegacyTabs.default;
10
10
  }
11
11
  });
12
12
 
13
- var _Tabs = _interopRequireDefault(require("./Tabs"));
13
+ var _LegacyTabs = _interopRequireDefault(require("./LegacyTabs"));
14
14
 
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Tabs';\nexport type { default as TabsProps } from './TabsProps';\nexport type { TabsInstance } from './types';\n"],"mappings":";;;;;;;;;;;;AAAA"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyTabs';\nexport type { default as TabsProps } from './LegacyTabsProps';\nexport type { TabsInstance } from './types';\n"],"mappings":";;;;;;;;;;;;AAAA"}