@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
@@ -1,26 +1,22 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
- import React, { cloneElement } from 'react';
3
+ import React from 'react';
4
4
  import { Platform, Text, View } from 'react-native';
5
5
  import Badge from '../Badge';
6
- import TabBase from '../TabBase';
7
- import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
8
- import TabIndicator from './TabIndicator';
6
+ import Spacer from '../Spacer';
7
+ import TabBase from '../TabBase/TabBase';
8
+ import { css, StyleSheet, useTheme } from '../styles';
9
+ import { cloneElementSafely } from '../utils';
10
+ import useVariantStyleMap from './useVariantStyleMap';
9
11
  const styles = StyleSheet.create({
10
12
  root: { // TODO: Remove redundant platform checking
11
13
  ...(Platform.OS === 'web' ? {
12
14
  minWidth: 'auto'
13
- } : {}),
14
- minHeight: 40
15
- },
16
- bottomNavigation: {
17
- minHeight: 56
15
+ } : {})
18
16
  },
19
17
  filledInner: {
18
+ alignItems: 'center',
20
19
  justifyContent: 'center'
21
- },
22
- tertiary: {
23
- minHeight: 44
24
20
  }
25
21
  });
26
22
  export default function Tab(props) {
@@ -29,77 +25,45 @@ export default function Tab(props) {
29
25
  children,
30
26
  enableIndicator = false,
31
27
  icon: defaultIcon,
32
- indicatorColor = 'primary',
33
- indicatorSize = 'full',
34
28
  selected = false,
35
29
  selectedIcon,
36
- variant = 'primary',
37
- style,
30
+ variant = 'default',
31
+ style: styleProp,
38
32
  onTabInnerLayout,
39
33
  ...otherProps
40
34
  } = props;
41
35
  const theme = useTheme();
42
36
  const vertical = variant === 'bottom-navigation';
43
- const color = selected ? theme.palette.text.primary : variant === 'contained' ? theme.palette.text.secondary : theme.palette.text.hint;
44
- const containedStyle = {
45
- borderColor: selected ? theme.palette.primary.main : theme.palette.border.default,
46
- borderRadius: theme.shape.roundnessExtra,
47
- borderWidth: selected ? 1.5 : 1,
48
- minHeight: 'auto',
49
- paddingHorizontal: theme.spacing(3),
50
- paddingVertical: theme.spacing(1.5)
51
- };
52
- const tabBaseStyle = css([styles.root, variant === 'bottom-navigation' && styles.bottomNavigation, variant === 'contained' && containedStyle, variant === 'tertiary' && styles.tertiary, style]);
53
- const tabInnerStyle = css([styles.root, styles.filledInner]);
54
- const fontStyle = createFontStyle(theme, {
55
- selector: typo => {
56
- switch (variant) {
57
- case 'primary':
58
- return typo.h2;
59
-
60
- case 'secondary':
61
- return typo.button2;
62
-
63
- case 'tertiary':
64
- return typo.h3;
65
-
66
- case 'contained':
67
- return selected ? { ...typo.subtitle2,
68
- fontWeight: typo.fontWeight.medium
69
- } : typo.body2;
70
-
71
- default:
72
- return typo.flag;
73
- }
74
- },
75
- color
76
- });
37
+ const {
38
+ container: containerStyle,
39
+ inner: innerStyle,
40
+ label: labelStyle
41
+ } = useVariantStyleMap(variant, selected);
42
+ const tabBaseStyle = css([styles.root, containerStyle, styleProp]);
43
+ const tabInnerStyle = css([styles.filledInner, innerStyle]);
77
44
  const pressEffect = selected ? 'none' : 'opacity';
78
45
  const icon = selected ? selectedIcon || defaultIcon : defaultIcon;
79
- const iconElement = icon ? /*#__PURE__*/cloneElement(icon, {
80
- fill: color
81
- }) : null;
82
- const tabElement = typeof children !== 'string' ? /*#__PURE__*/React.cloneElement(children, {
46
+ const iconColor = selected ? theme.palette.icon.strong : theme.palette.icon.base;
47
+ const iconElement = cloneElementSafely(icon, {
48
+ fill: iconColor
49
+ });
50
+ const tabElement = typeof children !== 'string' ? cloneElementSafely(children, {
83
51
  selected
84
- }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Badge, {
85
- children: iconElement,
52
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null, iconElement ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Badge, {
86
53
  invisible: !badgeVisible
87
- }), /*#__PURE__*/React.createElement(Text, {
88
- children: children,
89
- style: css(fontStyle)
90
- }));
91
- const tabIndicator = enableIndicator && selected ? /*#__PURE__*/React.createElement(TabIndicator, {
92
- indicatorSize: indicatorSize,
93
- color: indicatorColor
94
- }) : null;
54
+ }, iconElement), /*#__PURE__*/React.createElement(Spacer, {
55
+ size: 1.25
56
+ })) : null, /*#__PURE__*/React.createElement(Text, {
57
+ style: css(labelStyle)
58
+ }, children));
95
59
  return /*#__PURE__*/React.createElement(TabBase, _extends({
96
60
  pressEffect: pressEffect,
97
61
  style: tabBaseStyle,
98
62
  vertical: vertical
99
- }, otherProps), indicatorSize === 'fit-content' ? /*#__PURE__*/React.createElement(View, {
63
+ }, otherProps), /*#__PURE__*/React.createElement(View, {
100
64
  onLayout: onTabInnerLayout,
101
65
  style: tabInnerStyle
102
- }, tabElement, tabIndicator) : /*#__PURE__*/React.createElement(React.Fragment, null, tabElement, tabIndicator));
66
+ }, tabElement));
103
67
  }
104
68
  ;
105
69
  //# sourceMappingURL=Tab.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","cloneElement","Platform","Text","View","Badge","TabBase","createFontStyle","css","StyleSheet","useTheme","TabIndicator","styles","create","root","OS","minWidth","minHeight","bottomNavigation","filledInner","justifyContent","tertiary","Tab","props","badgeVisible","children","enableIndicator","icon","defaultIcon","indicatorColor","indicatorSize","selected","selectedIcon","variant","style","onTabInnerLayout","otherProps","theme","vertical","color","palette","text","primary","secondary","hint","containedStyle","borderColor","main","border","default","borderRadius","shape","roundnessExtra","borderWidth","paddingHorizontal","spacing","paddingVertical","tabBaseStyle","tabInnerStyle","fontStyle","selector","typo","h2","button2","h3","subtitle2","fontWeight","medium","body2","flag","pressEffect","iconElement","fill","tabElement","tabIndicator"],"sources":["Tab.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { Platform, Text, View } from 'react-native';\nimport Badge from '../Badge';\nimport TabBase from '../TabBase';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport type TabProps from './TabProps';\nimport TabIndicator from './TabIndicator';\n\nconst styles = StyleSheet.create({\n root: {\n // TODO: Remove redundant platform checking\n ...(Platform.OS === 'web' ? { minWidth: 'auto' } : {}),\n minHeight: 40,\n },\n bottomNavigation: {\n minHeight: 56,\n },\n filledInner: {\n justifyContent: 'center',\n },\n tertiary: {\n minHeight: 44,\n },\n});\n\nexport default function Tab(props: TabProps) {\n const {\n badgeVisible = false,\n children,\n enableIndicator = false,\n icon: defaultIcon,\n indicatorColor = 'primary',\n indicatorSize = 'full',\n selected = false,\n selectedIcon,\n variant = 'primary',\n style,\n onTabInnerLayout,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const vertical = variant === 'bottom-navigation';\n\n const color = selected\n ? theme.palette.text.primary\n : variant === 'contained'\n ? theme.palette.text.secondary\n : theme.palette.text.hint;\n\n const containedStyle = {\n borderColor: selected ? theme.palette.primary.main : theme.palette.border.default,\n borderRadius: theme.shape.roundnessExtra,\n borderWidth: selected ? 1.5 : 1,\n minHeight: 'auto',\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n };\n\n const tabBaseStyle = css([\n styles.root,\n variant === 'bottom-navigation' && styles.bottomNavigation,\n variant === 'contained' && containedStyle,\n variant === 'tertiary' && styles.tertiary,\n style,\n ]);\n\n const tabInnerStyle = css([\n styles.root,\n styles.filledInner,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => {\n switch (variant) {\n case 'primary':\n return typo.h2;\n case 'secondary':\n return typo.button2;\n case 'tertiary':\n return typo.h3;\n case 'contained':\n return selected\n ? { ...typo.subtitle2, fontWeight: typo.fontWeight.medium }\n : typo.body2;\n default:\n return typo.flag;\n }\n },\n color,\n });\n const pressEffect = selected ? 'none' : 'opacity';\n\n const icon = selected ? (selectedIcon || defaultIcon) : defaultIcon;\n const iconElement = icon ? cloneElement(icon, { fill: color }) : null;\n\n const tabElement = typeof children !== 'string' ? (\n React.cloneElement(children, {\n selected,\n })\n ) : (\n <React.Fragment>\n <Badge\n children={iconElement}\n invisible={!badgeVisible}\n />\n\n <Text\n children={children}\n style={css(fontStyle)}\n />\n </React.Fragment>\n );\n const tabIndicator = (enableIndicator && selected)\n ? <TabIndicator indicatorSize={indicatorSize} color={indicatorColor}/>\n : null;\n\n return (\n <TabBase\n pressEffect={pressEffect}\n style={tabBaseStyle}\n vertical={vertical}\n {...otherProps}\n >\n {indicatorSize === 'fit-content' ? (\n <View onLayout={onTabInnerLayout} style={tabInnerStyle}>\n {tabElement}\n\n {tabIndicator}\n </View>\n ) : (\n <React.Fragment>\n {tabElement}\n\n {tabIndicator}\n </React.Fragment>\n )}\n </TabBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,YAAhB,QAAoC,OAApC;AACA,SAASC,QAAT,EAAmBC,IAAnB,EAAyBC,IAAzB,QAAqC,cAArC;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,UAA/B,EAA2CC,QAA3C,QAA2D,WAA3D;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,MAAMC,MAAM,GAAGH,UAAU,CAACI,MAAX,CAAkB;EAC7BC,IAAI,EAAE,EACF;IACA,IAAIZ,QAAQ,CAACa,EAAT,KAAgB,KAAhB,GAAwB;MAAEC,QAAQ,EAAE;IAAZ,CAAxB,GAA+C,EAAnD,CAFE;IAGFC,SAAS,EAAE;EAHT,CADuB;EAM7BC,gBAAgB,EAAE;IACdD,SAAS,EAAE;EADG,CANW;EAS7BE,WAAW,EAAE;IACTC,cAAc,EAAE;EADP,CATgB;EAY7BC,QAAQ,EAAE;IACNJ,SAAS,EAAE;EADL;AAZmB,CAAlB,CAAf;AAiBA,eAAe,SAASK,GAAT,CAAaC,KAAb,EAA8B;EACzC,MAAM;IACFC,YAAY,GAAG,KADb;IAEFC,QAFE;IAGFC,eAAe,GAAG,KAHhB;IAIFC,IAAI,EAAEC,WAJJ;IAKFC,cAAc,GAAG,SALf;IAMFC,aAAa,GAAG,MANd;IAOFC,QAAQ,GAAG,KAPT;IAQFC,YARE;IASFC,OAAO,GAAG,SATR;IAUFC,KAVE;IAWFC,gBAXE;IAYF,GAAGC;EAZD,IAaFb,KAbJ;EAeA,MAAMc,KAAK,GAAG3B,QAAQ,EAAtB;EAEA,MAAM4B,QAAQ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AAQ,EAAEK,gBAAhB;IAAkC,KAAK,EAAEuB;EAAzC,GACKe,UADL,EAGKC,YAHL,CADH,gBAOG,oBAAC,KAAD,CAAO,QAAP,QACKD,UADL,EAGKC,YAHL,CAbR,CADJ;AAsBH;AAAA"}
1
+ {"version":3,"names":["React","Platform","Text","View","Badge","Spacer","TabBase","css","StyleSheet","useTheme","cloneElementSafely","useVariantStyleMap","styles","create","root","OS","minWidth","filledInner","alignItems","justifyContent","Tab","props","badgeVisible","children","enableIndicator","icon","defaultIcon","selected","selectedIcon","variant","style","styleProp","onTabInnerLayout","otherProps","theme","vertical","container","containerStyle","inner","innerStyle","label","labelStyle","tabBaseStyle","tabInnerStyle","pressEffect","iconColor","palette","strong","base","iconElement","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/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 {tabElement}\n </View>\n </TabBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAmBC,IAAnB,EAAyBC,IAAzB,QAAqC,cAArC;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,SAASC,GAAT,EAAcC,UAAd,EAA0BC,QAA1B,QAA0C,WAA1C;AACA,SAASC,kBAAT,QAAmC,UAAnC;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAEA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EAC7BC,IAAI,EAAE,EACF;IACA,IAAIb,QAAQ,CAACc,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;AAWA,eAAe,SAASC,GAAT,CAAaC,KAAb,EAA8B;EACzC,MAAM;IACFC,YAAY,GAAG,KADb;IAEFC,QAFE;IAGFC,eAAe,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2B,WADL,CADJ,eAKI,oBAAC,MAAD;IAAQ,IAAI,EAAE;EAAd,EALJ,CADQ,GAQR,IATR,eAWI,oBAAC,IAAD;IAAM,KAAK,EAAE1C,GAAG,CAACkC,UAAD;EAAhB,GACKlB,QADL,CAXJ,CALJ;EAsBA,oBACI,oBAAC,OAAD;IACI,WAAW,EAAEqB,WADjB;IAEI,KAAK,EAAEF,YAFX;IAGI,QAAQ,EAAEP;EAHd,GAIQF,UAJR,gBAMI,oBAAC,IAAD;IAAM,QAAQ,EAAED,gBAAhB;IAAkC,KAAK,EAAEW;EAAzC,GACKQ,UADL,CANJ,CADJ;AAYH;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","useTheme","useStyles","color","indicatorSize","theme","root","backgroundColor","palette","main","bottom","height","left","right","position","TabIndicator","styles","memo"],"sources":["TabIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { TabIndicatorColor, TabIndicatorSize } from './TabProps';\n\ntype TabIndicatorStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: (color: TabIndicatorColor, indicatorSize: TabIndicatorSize) => TabIndicatorStyles =\n function (color: TabIndicatorColor, indicatorSize): TabIndicatorStyles {\n const theme = useTheme();\n\n return {\n root: {\n backgroundColor: theme.palette[color].main,\n bottom: 0,\n height: 2,\n left: indicatorSize === 'fit-content' ? 0 : 12,\n right: indicatorSize === 'fit-content' ? 0 : 12,\n position: 'absolute',\n },\n };\n };\n\nconst TabIndicator = function TabIndicator({ indicatorSize, color }: { indicatorSize: TabIndicatorSize; color: TabIndicatorColor }) {\n const styles = useStyles(color, indicatorSize);\n\n return (\n <View\n style={styles.root}\n />\n );\n};\n\nexport default React.memo(TabIndicator);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,QAAT,QAAyB,WAAzB;;AAKA,MAAMC,SAA4F,GAC9F,UAAUC,KAAV,EAAoCC,aAApC,EAAuE;EACnE,MAAMC,KAAK,GAAGJ,QAAQ,EAAtB;EAEA,OAAO;IACHK,IAAI,EAAE;MACFC,eAAe,EAAEF,KAAK,CAACG,OAAN,CAAcL,KAAd,EAAqBM,IADpC;MAEFC,MAAM,EAAE,CAFN;MAGFC,MAAM,EAAE,CAHN;MAIFC,IAAI,EAAER,aAAa,KAAK,aAAlB,GAAkC,CAAlC,GAAsC,EAJ1C;MAKFS,KAAK,EAAET,aAAa,KAAK,aAAlB,GAAkC,CAAlC,GAAsC,EAL3C;MAMFU,QAAQ,EAAE;IANR;EADH,CAAP;AAUH,CAdL;;AAgBA,MAAMC,YAAY,GAAG,SAASA,YAAT,OAA+G;EAAA,IAAzF;IAAEX,aAAF;IAAiBD;EAAjB,CAAyF;EAChI,MAAMa,MAAM,GAAGd,SAAS,CAACC,KAAD,EAAQC,aAAR,CAAxB;EAEA,oBACI,oBAAC,IAAD;IACI,KAAK,EAAEY,MAAM,CAACV;EADlB,EADJ;AAKH,CARD;;AAUA,4BAAeP,KAAK,CAACkB,IAAN,CAAWF,YAAX,CAAf"}
1
+ {"version":3,"names":["React","View","useTheme","useStyles","color","indicatorSize","theme","root","backgroundColor","palette","main","bottom","height","left","right","position","TabIndicator","styles","memo"],"sources":["TabIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { TabIndicatorColor, TabIndicatorSize } from './LegacyTabProps';\n\ntype TabIndicatorStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: (color: TabIndicatorColor, indicatorSize: TabIndicatorSize) => TabIndicatorStyles =\n function (color: TabIndicatorColor, indicatorSize): TabIndicatorStyles {\n const theme = useTheme();\n\n return {\n root: {\n backgroundColor: theme.palette[color].main,\n bottom: 0,\n height: 2,\n left: indicatorSize === 'fit-content' ? 0 : 12,\n right: indicatorSize === 'fit-content' ? 0 : 12,\n position: 'absolute',\n },\n };\n };\n\nconst TabIndicator = function TabIndicator({\n indicatorSize,\n color,\n}: { indicatorSize: TabIndicatorSize; color: TabIndicatorColor }) {\n const styles = useStyles(color, indicatorSize);\n\n return (\n <View\n style={styles.root}\n />\n );\n};\n\nexport default React.memo(TabIndicator);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,QAAT,QAAyB,WAAzB;;AAKA,MAAMC,SAA4F,GAC9F,UAAUC,KAAV,EAAoCC,aAApC,EAAuE;EACnE,MAAMC,KAAK,GAAGJ,QAAQ,EAAtB;EAEA,OAAO;IACHK,IAAI,EAAE;MACFC,eAAe,EAAEF,KAAK,CAACG,OAAN,CAAcL,KAAd,EAAqBM,IADpC;MAEFC,MAAM,EAAE,CAFN;MAGFC,MAAM,EAAE,CAHN;MAIFC,IAAI,EAAER,aAAa,KAAK,aAAlB,GAAkC,CAAlC,GAAsC,EAJ1C;MAKFS,KAAK,EAAET,aAAa,KAAK,aAAlB,GAAkC,CAAlC,GAAsC,EAL3C;MAMFU,QAAQ,EAAE;IANR;EADH,CAAP;AAUH,CAdL;;AAgBA,MAAMC,YAAY,GAAG,SAASA,YAAT,OAG6C;EAAA,IAHvB;IACvCX,aADuC;IAEvCD;EAFuC,CAGuB;EAC9D,MAAMa,MAAM,GAAGd,SAAS,CAACC,KAAD,EAAQC,aAAR,CAAxB;EAEA,oBACI,oBAAC,IAAD;IACI,KAAK,EAAEY,MAAM,CAACV;EADlB,EADJ;AAKH,CAXD;;AAaA,4BAAeP,KAAK,CAACkB,IAAN,CAAWF,YAAX,CAAf"}
@@ -1,2 +1,2 @@
1
-
1
+ export const tabVariants = ['default', 'circular', 'bottom-navigation'];
2
2
  //# sourceMappingURL=TabProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"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 type TabVariant = 'primary' | 'secondary' | 'tertiary' | 'bottom-navigation' | 'contained';\nexport type TabIndicatorColor = 'primary' | 'secondary';\nexport type TabIndicatorSize = 'full' | 'fit-content';\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 * Tab indicator color\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 * If supplied, use this icon on selected state.\n */\n selectedIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'primary'\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":""}
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":"AAKA,OAAO,MAAMA,WAAW,GAAG,CAAC,SAAD,EAAY,UAAZ,EAAwB,mBAAxB,CAApB"}
@@ -1,2 +1,2 @@
1
- export { default } from './Tab';
1
+ export { default } from './LegacyTab';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Tab';\nexport type { default as TabProps, TabVariant, TabIndicatorSize } from './TabProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB"}
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyTab';\nexport type { default as TabProps, TabVariant, TabIndicatorSize } from './LegacyTabProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,aAAxB"}
@@ -0,0 +1,70 @@
1
+ import { useMemo } from 'react';
2
+ import { typographyOf } from '@fountain-ui/styles';
3
+ import { createFontStyle, useTheme } from '../styles';
4
+ export default function useVariantStyleMap(variant, selected) {
5
+ const theme = useTheme();
6
+ return useMemo(() => {
7
+ switch (variant) {
8
+ case 'circular':
9
+ return {
10
+ container: {
11
+ paddingHorizontal: theme.spacing(0.75),
12
+ paddingVertical: theme.spacing(1)
13
+ },
14
+ inner: {
15
+ backgroundColor: selected ? theme.palette.fill.base : theme.palette.fill.weaker,
16
+ borderRadius: theme.shape.radius.full,
17
+ paddingHorizontal: theme.spacing(4),
18
+ paddingVertical: theme.spacing(1.75)
19
+ },
20
+ label: createFontStyle(theme, {
21
+ selector: _ => typographyOf({
22
+ fontSize: 14,
23
+ lineHeight: 18.2,
24
+ fontFamily: 'Pretendard-SemiBold',
25
+ letterSpacing: 0
26
+ }),
27
+ color: selected ? theme.palette.text.strongInverse : theme.palette.text.strong
28
+ })
29
+ };
30
+
31
+ case 'bottom-navigation':
32
+ return {
33
+ container: {
34
+ alignItems: 'center',
35
+ height: 49,
36
+ justifyContent: 'flex-start',
37
+ paddingTop: theme.spacing(2.625),
38
+ width: 48
39
+ },
40
+ label: createFontStyle(theme, {
41
+ selector: _ => typographyOf({
42
+ fontSize: 10,
43
+ lineHeight: 10,
44
+ fontFamily: 'Pretendard-Medium',
45
+ letterSpacing: -0.1
46
+ }),
47
+ color: selected ? theme.palette.text.strong : theme.palette.text.base
48
+ })
49
+ };
50
+
51
+ case 'default':
52
+ default:
53
+ return {
54
+ container: {
55
+ padding: theme.spacing(2.5)
56
+ },
57
+ label: createFontStyle(theme, {
58
+ selector: _ => typographyOf({
59
+ fontSize: 15,
60
+ lineHeight: 18.75,
61
+ fontFamily: 'Pretendard-SemiBold',
62
+ letterSpacing: 0
63
+ }),
64
+ color: selected ? theme.palette.text.strong : theme.palette.text.base
65
+ })
66
+ };
67
+ }
68
+ }, [theme, variant, selected]);
69
+ }
70
+ //# sourceMappingURL=useVariantStyleMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMemo","typographyOf","createFontStyle","useTheme","useVariantStyleMap","variant","selected","theme","container","paddingHorizontal","spacing","paddingVertical","inner","backgroundColor","palette","fill","base","weaker","borderRadius","shape","radius","full","label","selector","_","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,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,YAAT,QAA6B,qBAA7B;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AASA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAiDC,QAAjD,EAAkF;EAC7F,MAAMC,KAAK,GAAGJ,QAAQ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AAD,IAAOvB,YAAY,CAAC;cAC1BwB,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,EAFc;cAG1BC,UAAU,EAAE,mBAHc;cAI1BC,aAAa,EAAE,CAAC;YAJU,CAAD,CADH;YAO1BC,KAAK,EAAEvB,QAAQ,GACTC,KAAK,CAACO,OAAN,CAAcgB,IAAd,CAAmBE,MADV,GAETzB,KAAK,CAACO,OAAN,CAAcgB,IAAd,CAAmBd;UATC,CAAR;QARnB,CAAP;;MAoBJ,KAAK,SAAL;MACA;QACI,OAAO;UACHR,SAAS,EAAE;YACP8B,OAAO,EAAE/B,KAAK,CAACG,OAAN,CAAc,GAAd;UADF,CADR;UAIHY,KAAK,EAAEpB,eAAe,CAACK,KAAD,EAAQ;YAC1BgB,QAAQ,EAAGC,CAAD,IAAOvB,YAAY,CAAC;cAC1BwB,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,KAFc;cAG1BC,UAAU,EAAE,qBAHc;cAI1BC,aAAa,EAAE;YAJW,CAAD,CADH;YAO1BC,KAAK,EAAEvB,QAAQ,GACTC,KAAK,CAACO,OAAN,CAAcgB,IAAd,CAAmBE,MADV,GAETzB,KAAK,CAACO,OAAN,CAAcgB,IAAd,CAAmBd;UATC,CAAR;QAJnB,CAAP;IAlDR;EAmEH,CApEa,EAoEX,CAACT,KAAD,EAAQF,OAAR,EAAiBC,QAAjB,CApEW,CAAd;AAqEH"}
@@ -0,0 +1,44 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from 'react';
4
+ import { css } from '@fountain-ui/styles';
5
+ import { useTheme } from '../styles';
6
+ import ButtonBase from '../ButtonBase';
7
+
8
+ const useStyles = function () {
9
+ const theme = useTheme();
10
+ return {
11
+ root: {
12
+ alignItems: 'center',
13
+ justifyContent: 'center',
14
+ paddingHorizontal: theme.spacing(3),
15
+ minHeight: 48
16
+ },
17
+ row: {
18
+ flexDirection: 'row'
19
+ },
20
+ column: {
21
+ flexDirection: 'column'
22
+ }
23
+ };
24
+ };
25
+
26
+ export default function TabBase(props) {
27
+ const {
28
+ children,
29
+ disabled = false,
30
+ onPress,
31
+ selected = false,
32
+ vertical = false,
33
+ style,
34
+ ...otherProps
35
+ } = props;
36
+ const styles = useStyles();
37
+ return /*#__PURE__*/React.createElement(ButtonBase, _extends({
38
+ onPress: onPress,
39
+ disabled: disabled,
40
+ style: css([styles.root, vertical ? styles.column : styles.row, style])
41
+ }, otherProps), children);
42
+ }
43
+ ;
44
+ //# sourceMappingURL=LegacyTabBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","css","useTheme","ButtonBase","useStyles","theme","root","alignItems","justifyContent","paddingHorizontal","spacing","minHeight","row","flexDirection","column","TabBase","props","children","disabled","onPress","selected","vertical","style","otherProps","styles"],"sources":["LegacyTabBase.tsx"],"sourcesContent":["import React from 'react';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useTheme } from '../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 const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(3),\n minHeight: 48,\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n };\n};\n\nexport default function TabBase(props: TabBaseProps) {\n const {\n children,\n disabled = false,\n onPress,\n selected = false,\n vertical = false,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n return (\n <ButtonBase\n onPress={onPress}\n disabled={disabled}\n style={css([\n styles.root,\n vertical ? styles.column : styles.row,\n style,\n ])}\n {...otherProps}\n >\n {children}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,GAAT,QAAuD,qBAAvD;AACA,SAASC,QAAT,QAAyB,WAAzB;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAKA,MAAMC,SAAmC,GAAG,YAA2B;EACnE,MAAMC,KAAK,GAAGH,QAAQ,EAAtB;EAEA,OAAO;IACHI,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE,QAFd;MAGFC,iBAAiB,EAAEJ,KAAK,CAACK,OAAN,CAAc,CAAd,CAHjB;MAIFC,SAAS,EAAE;IAJT,CADH;IAOHC,GAAG,EAAE;MACDC,aAAa,EAAE;IADd,CAPF;IAUHC,MAAM,EAAE;MACJD,aAAa,EAAE;IADX;EAVL,CAAP;AAcH,CAjBD;;AAmBA,eAAe,SAASE,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,OAHE;IAIFC,QAAQ,GAAG,KAJT;IAKFC,QAAQ,GAAG,KALT;IAMFC,KANE;IAOF,GAAGC;EAPD,IAQFP,KARJ;EAUA,MAAMQ,MAAM,GAAGpB,SAAS,EAAxB;EAEA,oBACI,oBAAC,UAAD;IACI,OAAO,EAAEe,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAEjB,GAAG,CAAC,CACPuB,MAAM,CAAClB,IADA,EAEPe,QAAQ,GAAGG,MAAM,CAACV,MAAV,GAAmBU,MAAM,CAACZ,GAF3B,EAGPU,KAHO,CAAD;EAHd,GAQQC,UARR,GAUKN,QAVL,CADJ;AAcH;AAAA"}
@@ -2,17 +2,13 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2
2
 
3
3
  import React from 'react';
4
4
  import { css } from '@fountain-ui/styles';
5
- import { useTheme } from '../styles';
6
5
  import ButtonBase from '../ButtonBase';
7
6
 
8
7
  const useStyles = function () {
9
- const theme = useTheme();
10
8
  return {
11
9
  root: {
12
10
  alignItems: 'center',
13
- justifyContent: 'center',
14
- paddingHorizontal: theme.spacing(3),
15
- minHeight: 48
11
+ justifyContent: 'center'
16
12
  },
17
13
  row: {
18
14
  flexDirection: 'row'
@@ -1 +1 @@
1
- {"version":3,"names":["React","css","useTheme","ButtonBase","useStyles","theme","root","alignItems","justifyContent","paddingHorizontal","spacing","minHeight","row","flexDirection","column","TabBase","props","children","disabled","onPress","selected","vertical","style","otherProps","styles"],"sources":["TabBase.tsx"],"sourcesContent":["import React from 'react';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useTheme } from '../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 const theme = useTheme();\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(3),\n minHeight: 48,\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n };\n};\n\nexport default function TabBase(props: TabBaseProps) {\n const {\n children,\n disabled = false,\n onPress,\n selected = false,\n vertical = false,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n return (\n <ButtonBase\n onPress={onPress}\n disabled={disabled}\n style={css([\n styles.root,\n vertical ? styles.column : styles.row,\n style,\n ])}\n {...otherProps}\n >\n {children}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,GAAT,QAAuD,qBAAvD;AACA,SAASC,QAAT,QAAyB,WAAzB;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAKA,MAAMC,SAAmC,GAAG,YAA2B;EACnE,MAAMC,KAAK,GAAGH,QAAQ,EAAtB;EAEA,OAAO;IACHI,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE,QAFd;MAGFC,iBAAiB,EAAEJ,KAAK,CAACK,OAAN,CAAc,CAAd,CAHjB;MAIFC,SAAS,EAAE;IAJT,CADH;IAOHC,GAAG,EAAE;MACDC,aAAa,EAAE;IADd,CAPF;IAUHC,MAAM,EAAE;MACJD,aAAa,EAAE;IADX;EAVL,CAAP;AAcH,CAjBD;;AAmBA,eAAe,SAASE,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,OAHE;IAIFC,QAAQ,GAAG,KAJT;IAKFC,QAAQ,GAAG,KALT;IAMFC,KANE;IAOF,GAAGC;EAPD,IAQFP,KARJ;EAUA,MAAMQ,MAAM,GAAGpB,SAAS,EAAxB;EAEA,oBACI,oBAAC,UAAD;IACI,OAAO,EAAEe,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAEjB,GAAG,CAAC,CACPuB,MAAM,CAAClB,IADA,EAEPe,QAAQ,GAAGG,MAAM,CAACV,MAAV,GAAmBU,MAAM,CAACZ,GAF3B,EAGPU,KAHO,CAAD;EAHd,GAQQC,UARR,GAUKN,QAVL,CADJ;AAcH;AAAA"}
1
+ {"version":3,"names":["React","css","ButtonBase","useStyles","root","alignItems","justifyContent","row","flexDirection","column","TabBase","props","children","disabled","onPress","selected","vertical","style","otherProps","styles"],"sources":["TabBase.tsx"],"sourcesContent":["import React from 'react';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport ButtonBase from '../ButtonBase';\nimport type TabBaseProps from './TabBaseProps';\n\ntype TabBaseStyles = NamedStylesStringUnion<'root' | 'row' | 'column'>;\n\nconst useStyles: UseStyles<TabBaseStyles> = function (): TabBaseStyles {\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n };\n};\n\nexport default function TabBase(props: TabBaseProps) {\n const {\n children,\n disabled = false,\n onPress,\n selected = false,\n vertical = false,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n return (\n <ButtonBase\n onPress={onPress}\n disabled={disabled}\n style={css([\n styles.root,\n vertical ? styles.column : styles.row,\n style,\n ])}\n {...otherProps}\n >\n {children}\n </ButtonBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,GAAT,QAAuD,qBAAvD;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAKA,MAAMC,SAAmC,GAAG,YAA2B;EACnE,OAAO;IACHC,IAAI,EAAE;MACFC,UAAU,EAAE,QADV;MAEFC,cAAc,EAAE;IAFd,CADH;IAKHC,GAAG,EAAE;MACDC,aAAa,EAAE;IADd,CALF;IAQHC,MAAM,EAAE;MACJD,aAAa,EAAE;IADX;EARL,CAAP;AAYH,CAbD;;AAeA,eAAe,SAASE,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,OAHE;IAIFC,QAAQ,GAAG,KAJT;IAKFC,QAAQ,GAAG,KALT;IAMFC,KANE;IAOF,GAAGC;EAPD,IAQFP,KARJ;EAUA,MAAMQ,MAAM,GAAGhB,SAAS,EAAxB;EAEA,oBACI,oBAAC,UAAD;IACI,OAAO,EAAEW,OADb;IAEI,QAAQ,EAAED,QAFd;IAGI,KAAK,EAAEZ,GAAG,CAAC,CACPkB,MAAM,CAACf,IADA,EAEPY,QAAQ,GAAGG,MAAM,CAACV,MAAV,GAAmBU,MAAM,CAACZ,GAF3B,EAGPU,KAHO,CAAD;EAHd,GAQQC,UARR,GAUKN,QAVL,CADJ;AAcH;AAAA"}
@@ -1,2 +1,2 @@
1
- export { default } from './TabBase';
1
+ export { default } from './LegacyTabBase';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './TabBase';\nexport type { default as TabBaseProps } from './TabBaseProps';"],"mappings":"AAAA,SAASA,OAAT,QAAwB,WAAxB"}
1
+ {"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyTabBase';\nexport type { default as TabBaseProps } from './TabBaseProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB"}
@@ -0,0 +1,98 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React, { useCallback, useContext, useEffect } from 'react';
4
+ import { Animated, Easing } from 'react-native';
5
+ import { useTheme } from '../styles';
6
+ import { useAnimatedValue } from '../hooks';
7
+ import { isNotAndroid12 } from '../utils';
8
+ import { defaultCoordinate } from './TabCoordinate';
9
+ import InternalContext from './InternalContext';
10
+ const INDICATOR_WIDTH = 10;
11
+ const INDICATOR_HEIGHT = 2;
12
+ const SCROLLABLE_TABS_INSET = 12 * 2;
13
+
14
+ const useStyles = function (color) {
15
+ const theme = useTheme();
16
+ return {
17
+ root: {
18
+ backgroundColor: theme.palette[color].main,
19
+ left: 0,
20
+ bottom: 0,
21
+ width: INDICATOR_WIDTH,
22
+ height: INDICATOR_HEIGHT,
23
+ position: 'absolute'
24
+ },
25
+ disabled: {
26
+ height: 0
27
+ }
28
+ };
29
+ };
30
+
31
+ const startAnimation = (value, toValue) => {
32
+ Animated.timing(value, {
33
+ toValue: toValue,
34
+ duration: 300,
35
+ easing: Easing.bezier(0.25, 1, 0.5, 1),
36
+ useNativeDriver: isNotAndroid12
37
+ }).start();
38
+ };
39
+
40
+ export default function TabIndicator(props) {
41
+ const {
42
+ color = 'primary',
43
+ coordinates,
44
+ disabled,
45
+ initialIndex,
46
+ scrollable,
47
+ style,
48
+ ...otherProps
49
+ } = props;
50
+ const styles = useStyles(color);
51
+ const computeAnimationValues = useCallback(currentIndex => {
52
+ const {
53
+ x1,
54
+ x2
55
+ } = coordinates[currentIndex] ?? defaultCoordinate;
56
+ const tabWidth = x2 - x1;
57
+ const nextTranslateX = x1 + (tabWidth - INDICATOR_WIDTH) / 2;
58
+ const inset = scrollable ? SCROLLABLE_TABS_INSET : 0;
59
+ const nextScaleX = (tabWidth - inset) / INDICATOR_WIDTH;
60
+ return {
61
+ tx: nextTranslateX,
62
+ sx: nextScaleX
63
+ };
64
+ }, [coordinates, scrollable]);
65
+ const {
66
+ tx: initialTx,
67
+ sx: initialSx
68
+ } = computeAnimationValues(initialIndex);
69
+ const translateX = useAnimatedValue(initialTx);
70
+ const scaleX = useAnimatedValue(initialSx);
71
+ const {
72
+ indexStore
73
+ } = useContext(InternalContext);
74
+ useEffect(() => {
75
+ const scrollToIndex = index => {
76
+ const {
77
+ tx,
78
+ sx
79
+ } = computeAnimationValues(index);
80
+ startAnimation(translateX, tx);
81
+ startAnimation(scaleX, sx);
82
+ };
83
+
84
+ scrollToIndex(indexStore.getState());
85
+ return indexStore.subscribe(scrollToIndex);
86
+ }, [computeAnimationValues, coordinates, indexStore]);
87
+ return /*#__PURE__*/React.createElement(Animated.View, _extends({
88
+ style: [styles.root, disabled ? styles.disabled : undefined, {
89
+ transform: [{
90
+ translateX
91
+ }, {
92
+ scaleX
93
+ }]
94
+ }, style]
95
+ }, otherProps));
96
+ }
97
+ ;
98
+ //# sourceMappingURL=LegacyTabIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useContext","useEffect","Animated","Easing","useTheme","useAnimatedValue","isNotAndroid12","defaultCoordinate","InternalContext","INDICATOR_WIDTH","INDICATOR_HEIGHT","SCROLLABLE_TABS_INSET","useStyles","color","theme","root","backgroundColor","palette","main","left","bottom","width","height","position","disabled","startAnimation","value","toValue","timing","duration","easing","bezier","useNativeDriver","start","TabIndicator","props","coordinates","initialIndex","scrollable","style","otherProps","styles","computeAnimationValues","currentIndex","x1","x2","tabWidth","nextTranslateX","inset","nextScaleX","tx","sx","initialTx","initialSx","translateX","scaleX","indexStore","scrollToIndex","index","getState","subscribe","undefined","transform"],"sources":["LegacyTabIndicator.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 './LegacyTabIndicatorProps';\nimport type { TabIndicatorColor } from './LegacyTabIndicatorProps';\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};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,UAA7B,EAAyCC,SAAzC,QAA0D,OAA1D;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,cAAjC;AAEA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,gBAAT,QAAiC,UAAjC;AACA,SAASC,cAAT,QAA+B,UAA/B;AAGA,SAASC,iBAAT,QAAkC,iBAAlC;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAIA,MAAMC,eAAe,GAAG,EAAxB;AACA,MAAMC,gBAAgB,GAAG,CAAzB;AAEA,MAAMC,qBAAqB,GAAG,KAAK,CAAnC;;AAEA,MAAMC,SAA2D,GAC7D,UAAUC,KAAV,EAAwD;EACpD,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;EAEA,OAAO;IACHW,IAAI,EAAE;MACFC,eAAe,EAAEF,KAAK,CAACG,OAAN,CAAcJ,KAAd,EAAqBK,IADpC;MAEFC,IAAI,EAAE,CAFJ;MAGFC,MAAM,EAAE,CAHN;MAIFC,KAAK,EAAEZ,eAJL;MAKFa,MAAM,EAAEZ,gBALN;MAMFa,Q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,SADF;IAEFD,EAAE,EAAEE;EAFF,IAGFX,sBAAsB,CAACL,YAAD,CAH1B;EAKA,MAAMiB,UAAU,GAAGjD,gBAAgB,CAAC+C,SAAD,CAAnC;EACA,MAAMG,MAAM,GAAGlD,gBAAgB,CAACgD,SAAD,CAA/B;EAEA,MAAM;IAAEG;EAAF,IAAiBxD,UAAU,CAACQ,eAAD,CAAjC;EAEAP,SAAS,CAAC,MAAM;IACZ,MAAMwD,aAAa,GAAIC,KAAD,IAAmB;MACrC,MAAM;QAAER,EAAF;QAAMC;MAAN,IAAaT,sBAAsB,CAACgB,KAAD,CAAzC;MAEAjC,cAAc,CAAC6B,UAAD,EAAaJ,EAAb,CAAd;MACAzB,cAAc,CAAC8B,MAAD,EAASJ,EAAT,CAAd;IACH,CALD;;IAOAM,aAAa,CAACD,UAAU,CAACG,QAAX,EAAD,CAAb;IAEA,OAAOH,UAAU,CAACI,SAAX,CAAqBH,aAArB,CAAP;EACH,CAXQ,EAWN,CACCf,sBADD,EAECN,WAFD,EAGCoB,UAHD,CAXM,CAAT;EAiBA,oBACI,oBAAC,QAAD,CAAU,IAAV;IACI,KAAK,EAAE,CACHf,MAAM,CAAC1B,IADJ,EAEHS,QAAQ,GAAGiB,MAAM,CAACjB,QAAV,GAAqBqC,SAF1B,EAGH;MAAEC,SAAS,EAAE,CAAC;QAAER;MAAF,CAAD,EAAiB;QAAEC;MAAF,CAAjB;IAAb,CAHG,EAIHhB,KAJG;EADX,GAOQC,UAPR,EADJ;AAWH;AAAA"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=LegacyTabIndicatorProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["LegacyTabIndicatorProps.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":""}