@bifrostui/react 2.0.0-alpha.12 → 2.0.0-alpha.14

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 (475) hide show
  1. package/dist/ActionSheet/ActionSheet.d.ts +1 -1
  2. package/dist/ActionSheet/ActionSheet.js +8 -8
  3. package/dist/ActionSheet/ActionSheet.types.d.ts +1 -1
  4. package/dist/ActionSheet/ActionSheetContext.d.ts +1 -1
  5. package/dist/ActionSheet/ActionSheetContext.js +2 -2
  6. package/dist/ActionSheet/ActionSheetItem.types.d.ts +1 -1
  7. package/dist/Alert/Alert.d.ts +1 -1
  8. package/dist/Alert/Alert.js +16 -16
  9. package/dist/Alert/__tests__/fixtures/A11yDemos.d.ts +1 -1
  10. package/dist/Alert/__tests__/fixtures/A11yDemos.js +12 -12
  11. package/dist/Avatar/Avatar.d.ts +1 -1
  12. package/dist/Avatar/Avatar.js +5 -5
  13. package/dist/Avatar/Avatar.types.d.ts +1 -1
  14. package/dist/Avatar/AvatarGroup.types.d.ts +1 -1
  15. package/dist/Backdrop/Backdrop.d.ts +1 -1
  16. package/dist/Backdrop/Backdrop.js +3 -3
  17. package/dist/Backdrop/Backdrop.types.d.ts +1 -1
  18. package/dist/Backdrop/__tests__/fixtures/A11yDemos.d.ts +1 -1
  19. package/dist/Backdrop/__tests__/fixtures/A11yDemos.js +3 -3
  20. package/dist/Badge/Badge.d.ts +1 -1
  21. package/dist/Badge/Badge.js +4 -4
  22. package/dist/Badge/__tests__/fixtures/A11yDemos.d.ts +1 -1
  23. package/dist/Badge/__tests__/fixtures/A11yDemos.js +13 -13
  24. package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
  25. package/dist/Breadcrumb/Breadcrumb.js +9 -9
  26. package/dist/Breadcrumb/Breadcrumb.types.d.ts +1 -1
  27. package/dist/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  28. package/dist/Breadcrumb/BreadcrumbItem.js +4 -4
  29. package/dist/Button/Button.d.ts +1 -1
  30. package/dist/Button/Button.js +6 -6
  31. package/dist/Button/Button.types.d.ts +1 -1
  32. package/dist/Button/__tests__/fixtures/A11yDemos.d.ts +1 -1
  33. package/dist/Button/__tests__/fixtures/A11yDemos.js +8 -8
  34. package/dist/Calendar/Calendar.types.d.ts +1 -1
  35. package/dist/Calendar/__tests__/fixtures/A11yDemos.d.ts +1 -1
  36. package/dist/Calendar/__tests__/fixtures/A11yDemos.js +2 -2
  37. package/dist/Card/Card.d.ts +1 -1
  38. package/dist/Card/Card.js +3 -3
  39. package/dist/Card/Card.types.d.ts +1 -1
  40. package/dist/Card/CardContent.d.ts +1 -1
  41. package/dist/Card/CardContent.js +3 -3
  42. package/dist/Card/CardContent.types.d.ts +1 -1
  43. package/dist/Card/CardFooter.d.ts +1 -1
  44. package/dist/Card/CardFooter.js +3 -3
  45. package/dist/Card/CardFooter.types.d.ts +1 -1
  46. package/dist/Card/CardHeader.d.ts +1 -1
  47. package/dist/Card/CardHeader.js +10 -10
  48. package/dist/Checkbox/CheckboxContext.d.ts +1 -1
  49. package/dist/Checkbox/CheckboxContext.js +2 -2
  50. package/dist/Checkbox/__tests__/fixtures/A11yDemos.d.ts +1 -1
  51. package/dist/Checkbox/__tests__/fixtures/A11yDemos.js +4 -4
  52. package/dist/CitySelector/CitySelector.types.d.ts +1 -0
  53. package/dist/CitySelector/Selector/index.d.ts +1 -1
  54. package/dist/CitySelector/Selector/index.js +2 -2
  55. package/dist/Collapse/Collapse.types.d.ts +1 -1
  56. package/dist/CollapsePanel/CollapsePanel.d.ts +1 -1
  57. package/dist/CollapsePanel/CollapsePanel.js +9 -9
  58. package/dist/CollapsePanel/CollapsePanel.types.d.ts +1 -1
  59. package/dist/CollapsePanel/CollapsePanelItem.d.ts +1 -1
  60. package/dist/CollapsePanel/CollapsePanelItem.js +5 -5
  61. package/dist/Countdown/Countdown.types.d.ts +2 -2
  62. package/dist/Countdown/__tests__/fixtures/A11yDemos.d.ts +1 -1
  63. package/dist/Countdown/__tests__/fixtures/A11yDemos.js +10 -10
  64. package/dist/Countdown/utils.d.ts +2 -2
  65. package/dist/Countdown/utils.js +4 -4
  66. package/dist/DatePicker/DatePicker.types.d.ts +1 -1
  67. package/dist/DesktopPicker/DesktopPicker.types.d.ts +1 -1
  68. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +11 -11
  69. package/dist/DesktopTimePicker/useGetTimePickerContent.js +2 -2
  70. package/dist/DesktopTimePicker/utils/utils.d.ts +1 -1
  71. package/dist/DesktopTimePicker/utils/utils.js +3 -3
  72. package/dist/Dialog/__tests__/fixtures/A11yDemos.d.ts +1 -1
  73. package/dist/Dialog/__tests__/fixtures/A11yDemos.js +4 -4
  74. package/dist/Divider/Divider.types.d.ts +1 -1
  75. package/dist/Drawer/Drawer.d.ts +1 -1
  76. package/dist/Drawer/Drawer.js +5 -5
  77. package/dist/Drawer/Drawer.types.d.ts +1 -1
  78. package/dist/Fade/Fade.d.ts +1 -1
  79. package/dist/Fade/Fade.js +4 -4
  80. package/dist/Fade/Fade.types.d.ts +1 -1
  81. package/dist/IconButton/IconButton.d.ts +1 -1
  82. package/dist/IconButton/IconButton.js +6 -6
  83. package/dist/IconButton/IconButton.types.d.ts +1 -1
  84. package/dist/Input/Input.types.d.ts +1 -1
  85. package/dist/Input/__tests__/fixtures/A11yDemos.d.ts +1 -1
  86. package/dist/Input/__tests__/fixtures/A11yDemos.js +7 -7
  87. package/dist/ItemSelector/ItemSelector.miniapp.js +7 -5
  88. package/dist/ItemSelector/ItemSelector.types.d.ts +1 -0
  89. package/dist/ItemSelector/Selector/index.d.ts +1 -1
  90. package/dist/ItemSelector/Selector/index.js +2 -2
  91. package/dist/List/List.d.ts +1 -1
  92. package/dist/List/List.js +4 -4
  93. package/dist/List/ListContext.d.ts +1 -1
  94. package/dist/List/ListContext.js +2 -2
  95. package/dist/List/ListItem.d.ts +1 -1
  96. package/dist/List/ListItem.js +8 -8
  97. package/dist/List/ListItem.types.d.ts +1 -1
  98. package/dist/List/ListItemContent.d.ts +1 -1
  99. package/dist/List/ListItemContent.js +3 -3
  100. package/dist/List/ListItemContent.types.d.ts +1 -1
  101. package/dist/List/ListItemExtra.d.ts +1 -1
  102. package/dist/List/ListItemExtra.js +3 -3
  103. package/dist/List/ListItemExtra.types.d.ts +1 -1
  104. package/dist/List/ListItemFooter.d.ts +1 -1
  105. package/dist/List/ListItemFooter.js +3 -3
  106. package/dist/List/ListItemFooter.types.d.ts +1 -1
  107. package/dist/List/ListItemHeader.d.ts +1 -1
  108. package/dist/List/ListItemHeader.js +3 -3
  109. package/dist/List/ListItemHeader.types.d.ts +1 -1
  110. package/dist/Loading/Loading.d.ts +1 -1
  111. package/dist/Loading/Loading.js +5 -5
  112. package/dist/Loading/Loading.types.d.ts +1 -1
  113. package/dist/Modal/Modal.d.ts +1 -1
  114. package/dist/Modal/Modal.js +6 -6
  115. package/dist/Modal/Modal.miniapp.d.ts +1 -1
  116. package/dist/Modal/Modal.miniapp.js +7 -7
  117. package/dist/Modal/__tests__/fixtures/A11yDemos.d.ts +1 -1
  118. package/dist/Modal/__tests__/fixtures/A11yDemos.js +3 -3
  119. package/dist/Modal/useModal.js +26 -29
  120. package/dist/NavBar/NavBar.d.ts +1 -1
  121. package/dist/NavBar/NavBar.js +10 -10
  122. package/dist/Picker/Picker.js +0 -1
  123. package/dist/Picker/Picker.types.d.ts +1 -1
  124. package/dist/Picker/__tests__/fixtures/A11yDemos.d.ts +1 -1
  125. package/dist/Picker/__tests__/fixtures/A11yDemos.js +2 -2
  126. package/dist/Popover/Popover.d.ts +1 -1
  127. package/dist/Popover/Popover.js +8 -8
  128. package/dist/Popover/Popover.types.d.ts +1 -1
  129. package/dist/Popover/__tests__/fixtures/A11yDemos.d.ts +1 -1
  130. package/dist/Popover/__tests__/fixtures/A11yDemos.js +21 -21
  131. package/dist/Portal/Portal.d.ts +1 -1
  132. package/dist/Portal/Portal.js +3 -3
  133. package/dist/Portal/Portal.types.d.ts +1 -1
  134. package/dist/Progress/Progress.d.ts +1 -1
  135. package/dist/Progress/Progress.js +4 -4
  136. package/dist/Progress/Progress.types.d.ts +1 -1
  137. package/dist/Progress/__tests__/fixtures/A11yDemos.d.ts +1 -1
  138. package/dist/Progress/__tests__/fixtures/A11yDemos.js +9 -9
  139. package/dist/Radio/RadioButtonIcon.d.ts +1 -1
  140. package/dist/Radio/RadioButtonIcon.js +4 -4
  141. package/dist/Radio/RadioContext.d.ts +1 -1
  142. package/dist/Radio/RadioContext.js +2 -2
  143. package/dist/Radio/__tests__/fixtures/A11yDemos.d.ts +1 -1
  144. package/dist/Radio/__tests__/fixtures/A11yDemos.js +4 -4
  145. package/dist/Rating/Rating.types.d.ts +1 -1
  146. package/dist/ScrollView/ScrollView.types.d.ts +1 -1
  147. package/dist/ScrollView/__tests__/fixtures/A11yDemos.d.ts +1 -1
  148. package/dist/ScrollView/__tests__/fixtures/A11yDemos.js +30 -30
  149. package/dist/ScrollView/useScrollView.js +16 -4
  150. package/dist/Skeleton/Skeleton.d.ts +1 -1
  151. package/dist/Skeleton/Skeleton.js +3 -3
  152. package/dist/Skeleton/Skeleton.types.d.ts +1 -1
  153. package/dist/Slide/Slide.d.ts +1 -1
  154. package/dist/Slide/Slide.js +4 -4
  155. package/dist/Slider/Slider.types.d.ts +1 -1
  156. package/dist/Steps/Step.types.d.ts +1 -1
  157. package/dist/Steps/StepsContext.d.ts +1 -1
  158. package/dist/Steps/StepsContext.js +2 -2
  159. package/dist/SwipeAction/SwipeAction.js +7 -8
  160. package/dist/SwipeAction/SwipeAction.types.d.ts +1 -1
  161. package/dist/Swiper/Swiper.types.d.ts +1 -1
  162. package/dist/Swiper/SwiperItem.d.ts +1 -1
  163. package/dist/Swiper/SwiperItem.js +2 -2
  164. package/dist/Switch/__tests__/fixtures/A11yDemos.d.ts +1 -1
  165. package/dist/Switch/__tests__/fixtures/A11yDemos.js +4 -4
  166. package/dist/TabBar/TabBar.d.ts +1 -1
  167. package/dist/TabBar/TabBar.js +5 -5
  168. package/dist/Tabs/Tab.css +1 -24
  169. package/dist/Tabs/Tab.d.ts +2 -2
  170. package/dist/Tabs/Tab.js +42 -34
  171. package/dist/Tabs/Tab.types.d.ts +1 -1
  172. package/dist/Tabs/TabIndicator.d.ts +13 -0
  173. package/dist/Tabs/TabIndicator.js +115 -0
  174. package/dist/Tabs/TabMask.d.ts +9 -0
  175. package/dist/Tabs/TabMask.js +88 -0
  176. package/dist/Tabs/TabPanel.types.d.ts +1 -1
  177. package/dist/Tabs/Tabs.css +15 -5
  178. package/dist/Tabs/Tabs.js +84 -159
  179. package/dist/Tabs/Tabs.types.d.ts +5 -6
  180. package/dist/Tabs/TabsContext.d.ts +15 -6
  181. package/dist/Tabs/TabsContext.js +6 -14
  182. package/dist/Tabs/classes.d.ts +10 -0
  183. package/dist/Tabs/classes.js +54 -0
  184. package/dist/Tabs/index.css +16 -29
  185. package/dist/Tabs/index.d.ts +2 -2
  186. package/dist/Tabs/index.js +4 -4
  187. package/dist/Tabs/index.miniapp.d.ts +5 -0
  188. package/dist/Tabs/index.miniapp.js +50 -0
  189. package/dist/Tabs/miniapp/Tab.d.ts +5 -0
  190. package/dist/Tabs/miniapp/Tab.js +103 -0
  191. package/dist/Tabs/miniapp/TabIndicator.d.ts +15 -0
  192. package/dist/Tabs/miniapp/TabIndicator.js +206 -0
  193. package/dist/Tabs/miniapp/TabMask.d.ts +13 -0
  194. package/dist/Tabs/miniapp/TabMask.js +66 -0
  195. package/dist/Tabs/miniapp/Tabs.d.ts +5 -0
  196. package/dist/Tabs/miniapp/Tabs.js +261 -0
  197. package/dist/Tabs/miniapp/TabsContext.d.ts +17 -0
  198. package/dist/Tabs/miniapp/TabsContext.js +39 -0
  199. package/dist/Tabs/miniapp/index.d.ts +2 -0
  200. package/dist/Tabs/miniapp/index.js +41 -0
  201. package/dist/Tabs/miniapp/scroll.d.ts +21 -0
  202. package/dist/Tabs/miniapp/scroll.js +52 -0
  203. package/dist/Tabs/miniapp/utils/queryBatch.d.ts +68 -0
  204. package/dist/Tabs/miniapp/utils/queryBatch.js +100 -0
  205. package/dist/Tabs/utils/scroll.js +10 -4
  206. package/dist/Tag/Tag.d.ts +1 -1
  207. package/dist/Tag/Tag.js +6 -6
  208. package/dist/Tag/Tag.types.d.ts +1 -1
  209. package/dist/Tag/TagGroup.d.ts +1 -1
  210. package/dist/Tag/TagGroup.js +3 -3
  211. package/dist/Tag/TagGroup.types.d.ts +1 -1
  212. package/dist/Tag/__tests__/fixtures/A11yDemos.js +3 -3
  213. package/dist/TextArea/__tests__/fixtures/A11yDemos.d.ts +1 -1
  214. package/dist/TextArea/__tests__/fixtures/A11yDemos.js +6 -6
  215. package/dist/ThemeProvider/hooks/ThemeContext.d.ts +1 -1
  216. package/dist/ThemeProvider/hooks/ThemeContext.js +2 -2
  217. package/dist/ThemeProvider/hooks/useTheme.js +2 -2
  218. package/dist/ThemeProvider/utils/mountTokens.js +2 -2
  219. package/dist/Toast/Toast.d.ts +1 -1
  220. package/dist/Toast/Toast.js +8 -8
  221. package/dist/Toast/__tests__/fixtures/A11yDemos.d.ts +1 -1
  222. package/dist/Toast/__tests__/fixtures/A11yDemos.js +2 -2
  223. package/dist/Tooltip/Tooltip.d.ts +1 -1
  224. package/dist/Tooltip/Tooltip.js +5 -5
  225. package/dist/Tooltip/Tooltip.types.d.ts +1 -1
  226. package/dist/Tooltip/__tests__/fixtures/A11yDemos.d.ts +1 -1
  227. package/dist/Tooltip/__tests__/fixtures/A11yDemos.js +14 -14
  228. package/dist/Transition/Transition.d.ts +1 -1
  229. package/dist/Transition/Transition.js +3 -3
  230. package/dist/Transition/Transition.miniapp.d.ts +1 -1
  231. package/dist/Transition/Transition.miniapp.js +3 -3
  232. package/dist/Transition/TransitionCore.js +8 -2
  233. package/dist/_.._/benchmarks/components/Button.d.js +15 -0
  234. package/dist/_.._/benchmarks/components/Button.js +2 -2
  235. package/dist/_.._/benchmarks/components/Input.d.js +15 -0
  236. package/dist/_.._/benchmarks/components/Tabs.d.js +15 -0
  237. package/es/ActionSheet/ActionSheet.d.ts +1 -1
  238. package/es/ActionSheet/ActionSheet.js +1 -1
  239. package/es/ActionSheet/ActionSheet.types.d.ts +1 -1
  240. package/es/ActionSheet/ActionSheetContext.d.ts +1 -1
  241. package/es/ActionSheet/ActionSheetContext.js +1 -1
  242. package/es/ActionSheet/ActionSheetItem.types.d.ts +1 -1
  243. package/es/Alert/Alert.d.ts +1 -1
  244. package/es/Alert/Alert.js +1 -1
  245. package/es/Alert/__tests__/fixtures/A11yDemos.d.ts +1 -1
  246. package/es/Alert/__tests__/fixtures/A11yDemos.js +1 -1
  247. package/es/Avatar/Avatar.d.ts +1 -1
  248. package/es/Avatar/Avatar.js +1 -1
  249. package/es/Avatar/Avatar.types.d.ts +1 -1
  250. package/es/Avatar/AvatarGroup.types.d.ts +1 -1
  251. package/es/Backdrop/Backdrop.d.ts +1 -1
  252. package/es/Backdrop/Backdrop.js +1 -1
  253. package/es/Backdrop/Backdrop.types.d.ts +1 -1
  254. package/es/Backdrop/__tests__/fixtures/A11yDemos.d.ts +1 -1
  255. package/es/Backdrop/__tests__/fixtures/A11yDemos.js +1 -1
  256. package/es/Badge/Badge.d.ts +1 -1
  257. package/es/Badge/Badge.js +1 -1
  258. package/es/Badge/__tests__/fixtures/A11yDemos.d.ts +1 -1
  259. package/es/Badge/__tests__/fixtures/A11yDemos.js +1 -1
  260. package/es/Breadcrumb/Breadcrumb.d.ts +1 -1
  261. package/es/Breadcrumb/Breadcrumb.js +1 -1
  262. package/es/Breadcrumb/Breadcrumb.types.d.ts +1 -1
  263. package/es/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  264. package/es/Breadcrumb/BreadcrumbItem.js +1 -1
  265. package/es/Button/Button.d.ts +1 -1
  266. package/es/Button/Button.js +1 -1
  267. package/es/Button/Button.types.d.ts +1 -1
  268. package/es/Button/__tests__/fixtures/A11yDemos.d.ts +1 -1
  269. package/es/Button/__tests__/fixtures/A11yDemos.js +1 -1
  270. package/es/Calendar/Calendar.types.d.ts +1 -1
  271. package/es/Calendar/__tests__/fixtures/A11yDemos.d.ts +1 -1
  272. package/es/Calendar/__tests__/fixtures/A11yDemos.js +1 -1
  273. package/es/Card/Card.d.ts +1 -1
  274. package/es/Card/Card.js +1 -1
  275. package/es/Card/Card.types.d.ts +1 -1
  276. package/es/Card/CardContent.d.ts +1 -1
  277. package/es/Card/CardContent.js +1 -1
  278. package/es/Card/CardContent.types.d.ts +1 -1
  279. package/es/Card/CardFooter.d.ts +1 -1
  280. package/es/Card/CardFooter.js +1 -1
  281. package/es/Card/CardFooter.types.d.ts +1 -1
  282. package/es/Card/CardHeader.d.ts +1 -1
  283. package/es/Card/CardHeader.js +1 -1
  284. package/es/Checkbox/CheckboxContext.d.ts +1 -1
  285. package/es/Checkbox/CheckboxContext.js +1 -1
  286. package/es/Checkbox/__tests__/fixtures/A11yDemos.d.ts +1 -1
  287. package/es/Checkbox/__tests__/fixtures/A11yDemos.js +1 -1
  288. package/es/CitySelector/CitySelector.types.d.ts +1 -0
  289. package/es/CitySelector/Selector/index.d.ts +1 -1
  290. package/es/CitySelector/Selector/index.js +1 -1
  291. package/es/Collapse/Collapse.types.d.ts +1 -1
  292. package/es/CollapsePanel/CollapsePanel.d.ts +1 -1
  293. package/es/CollapsePanel/CollapsePanel.js +1 -1
  294. package/es/CollapsePanel/CollapsePanel.types.d.ts +1 -1
  295. package/es/CollapsePanel/CollapsePanelItem.d.ts +1 -1
  296. package/es/CollapsePanel/CollapsePanelItem.js +1 -1
  297. package/es/Countdown/Countdown.types.d.ts +2 -2
  298. package/es/Countdown/__tests__/fixtures/A11yDemos.d.ts +1 -1
  299. package/es/Countdown/__tests__/fixtures/A11yDemos.js +1 -1
  300. package/es/Countdown/utils.d.ts +2 -2
  301. package/es/Countdown/utils.js +4 -4
  302. package/es/DatePicker/DatePicker.d.ts +1 -1
  303. package/es/DatePicker/DatePicker.types.d.ts +1 -1
  304. package/es/DesktopPicker/DesktopPicker.types.d.ts +1 -1
  305. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +11 -11
  306. package/es/DesktopTimePicker/useGetTimePickerContent.js +3 -3
  307. package/es/DesktopTimePicker/utils/utils.d.ts +1 -1
  308. package/es/DesktopTimePicker/utils/utils.js +2 -2
  309. package/es/Dialog/__tests__/fixtures/A11yDemos.d.ts +1 -1
  310. package/es/Dialog/__tests__/fixtures/A11yDemos.js +1 -1
  311. package/es/Divider/Divider.types.d.ts +1 -1
  312. package/es/Drawer/Drawer.d.ts +1 -1
  313. package/es/Drawer/Drawer.js +1 -1
  314. package/es/Drawer/Drawer.types.d.ts +1 -1
  315. package/es/Fade/Fade.d.ts +1 -1
  316. package/es/Fade/Fade.js +1 -1
  317. package/es/Fade/Fade.types.d.ts +1 -1
  318. package/es/IconButton/IconButton.d.ts +1 -1
  319. package/es/IconButton/IconButton.js +1 -1
  320. package/es/IconButton/IconButton.types.d.ts +1 -1
  321. package/es/Input/Input.types.d.ts +1 -1
  322. package/es/Input/__tests__/fixtures/A11yDemos.d.ts +1 -1
  323. package/es/Input/__tests__/fixtures/A11yDemos.js +1 -1
  324. package/es/ItemSelector/ItemSelector.miniapp.js +7 -5
  325. package/es/ItemSelector/ItemSelector.types.d.ts +1 -0
  326. package/es/ItemSelector/Selector/index.d.ts +1 -1
  327. package/es/ItemSelector/Selector/index.js +1 -1
  328. package/es/List/List.d.ts +1 -1
  329. package/es/List/List.js +1 -1
  330. package/es/List/ListContext.d.ts +1 -1
  331. package/es/List/ListContext.js +1 -1
  332. package/es/List/ListItem.d.ts +1 -1
  333. package/es/List/ListItem.js +1 -1
  334. package/es/List/ListItem.types.d.ts +1 -1
  335. package/es/List/ListItemContent.d.ts +1 -1
  336. package/es/List/ListItemContent.js +1 -1
  337. package/es/List/ListItemContent.types.d.ts +1 -1
  338. package/es/List/ListItemExtra.d.ts +1 -1
  339. package/es/List/ListItemExtra.js +1 -1
  340. package/es/List/ListItemExtra.types.d.ts +1 -1
  341. package/es/List/ListItemFooter.d.ts +1 -1
  342. package/es/List/ListItemFooter.js +1 -1
  343. package/es/List/ListItemFooter.types.d.ts +1 -1
  344. package/es/List/ListItemHeader.d.ts +1 -1
  345. package/es/List/ListItemHeader.js +1 -1
  346. package/es/List/ListItemHeader.types.d.ts +1 -1
  347. package/es/Loading/Loading.d.ts +1 -1
  348. package/es/Loading/Loading.js +1 -1
  349. package/es/Loading/Loading.types.d.ts +1 -1
  350. package/es/Modal/Modal.d.ts +1 -1
  351. package/es/Modal/Modal.js +1 -1
  352. package/es/Modal/Modal.miniapp.d.ts +1 -1
  353. package/es/Modal/Modal.miniapp.js +1 -1
  354. package/es/Modal/__tests__/fixtures/A11yDemos.d.ts +1 -1
  355. package/es/Modal/__tests__/fixtures/A11yDemos.js +1 -1
  356. package/es/Modal/useModal.js +26 -29
  357. package/es/NavBar/NavBar.d.ts +1 -1
  358. package/es/NavBar/NavBar.js +1 -1
  359. package/es/Picker/Picker.js +0 -1
  360. package/es/Picker/Picker.types.d.ts +1 -1
  361. package/es/Picker/__tests__/fixtures/A11yDemos.d.ts +1 -1
  362. package/es/Picker/__tests__/fixtures/A11yDemos.js +1 -1
  363. package/es/Popover/Popover.d.ts +1 -1
  364. package/es/Popover/Popover.js +1 -1
  365. package/es/Popover/Popover.types.d.ts +1 -1
  366. package/es/Popover/__tests__/fixtures/A11yDemos.d.ts +1 -1
  367. package/es/Popover/__tests__/fixtures/A11yDemos.js +1 -1
  368. package/es/Portal/Portal.d.ts +1 -1
  369. package/es/Portal/Portal.js +1 -1
  370. package/es/Portal/Portal.types.d.ts +1 -1
  371. package/es/Progress/Progress.d.ts +1 -1
  372. package/es/Progress/Progress.js +1 -1
  373. package/es/Progress/Progress.types.d.ts +1 -1
  374. package/es/Progress/__tests__/fixtures/A11yDemos.d.ts +1 -1
  375. package/es/Progress/__tests__/fixtures/A11yDemos.js +1 -1
  376. package/es/Radio/RadioButtonIcon.d.ts +1 -1
  377. package/es/Radio/RadioButtonIcon.js +1 -1
  378. package/es/Radio/RadioContext.d.ts +1 -1
  379. package/es/Radio/RadioContext.js +1 -1
  380. package/es/Radio/__tests__/fixtures/A11yDemos.d.ts +1 -1
  381. package/es/Radio/__tests__/fixtures/A11yDemos.js +1 -1
  382. package/es/Rating/Rating.types.d.ts +1 -1
  383. package/es/ScrollView/ScrollView.types.d.ts +1 -1
  384. package/es/ScrollView/__tests__/fixtures/A11yDemos.d.ts +1 -1
  385. package/es/ScrollView/__tests__/fixtures/A11yDemos.js +1 -1
  386. package/es/ScrollView/useScrollView.js +16 -4
  387. package/es/Skeleton/Skeleton.d.ts +1 -1
  388. package/es/Skeleton/Skeleton.js +1 -1
  389. package/es/Skeleton/Skeleton.types.d.ts +1 -1
  390. package/es/Slide/Slide.d.ts +1 -1
  391. package/es/Slide/Slide.js +1 -1
  392. package/es/Slider/Slider.types.d.ts +1 -1
  393. package/es/Steps/Step.types.d.ts +1 -1
  394. package/es/Steps/StepsContext.d.ts +1 -1
  395. package/es/Steps/StepsContext.js +1 -1
  396. package/es/SwipeAction/SwipeAction.js +7 -8
  397. package/es/SwipeAction/SwipeAction.types.d.ts +1 -1
  398. package/es/Swiper/Swiper.js +5 -1
  399. package/es/Swiper/Swiper.types.d.ts +1 -1
  400. package/es/Swiper/SwiperItem.d.ts +1 -1
  401. package/es/Swiper/SwiperItem.js +1 -1
  402. package/es/Switch/__tests__/fixtures/A11yDemos.d.ts +1 -1
  403. package/es/Switch/__tests__/fixtures/A11yDemos.js +1 -1
  404. package/es/TabBar/TabBar.d.ts +1 -1
  405. package/es/TabBar/TabBar.js +1 -1
  406. package/es/Tabs/Tab.css +1 -24
  407. package/es/Tabs/Tab.d.ts +2 -2
  408. package/es/Tabs/Tab.js +44 -36
  409. package/es/Tabs/Tab.types.d.ts +1 -1
  410. package/es/Tabs/TabIndicator.d.ts +13 -0
  411. package/es/Tabs/TabIndicator.js +86 -0
  412. package/es/Tabs/TabMask.d.ts +9 -0
  413. package/es/Tabs/TabMask.js +59 -0
  414. package/es/Tabs/TabPanel.types.d.ts +1 -1
  415. package/es/Tabs/Tabs.css +15 -5
  416. package/es/Tabs/Tabs.js +86 -161
  417. package/es/Tabs/Tabs.types.d.ts +5 -6
  418. package/es/Tabs/TabsContext.d.ts +15 -6
  419. package/es/Tabs/TabsContext.js +6 -4
  420. package/es/Tabs/classes.d.ts +10 -0
  421. package/es/Tabs/classes.js +22 -0
  422. package/es/Tabs/index.css +16 -29
  423. package/es/Tabs/index.d.ts +2 -2
  424. package/es/Tabs/index.js +2 -2
  425. package/es/Tabs/index.miniapp.d.ts +5 -0
  426. package/es/Tabs/index.miniapp.js +11 -0
  427. package/es/Tabs/miniapp/Tab.d.ts +5 -0
  428. package/es/Tabs/miniapp/Tab.js +74 -0
  429. package/es/Tabs/miniapp/TabIndicator.d.ts +15 -0
  430. package/es/Tabs/miniapp/TabIndicator.js +177 -0
  431. package/es/Tabs/miniapp/TabMask.d.ts +13 -0
  432. package/es/Tabs/miniapp/TabMask.js +37 -0
  433. package/es/Tabs/miniapp/Tabs.d.ts +5 -0
  434. package/es/Tabs/miniapp/Tabs.js +239 -0
  435. package/es/Tabs/miniapp/TabsContext.d.ts +17 -0
  436. package/es/Tabs/miniapp/TabsContext.js +16 -0
  437. package/es/Tabs/miniapp/index.d.ts +2 -0
  438. package/es/Tabs/miniapp/index.js +7 -0
  439. package/es/Tabs/miniapp/scroll.d.ts +21 -0
  440. package/es/Tabs/miniapp/scroll.js +29 -0
  441. package/es/Tabs/miniapp/utils/queryBatch.d.ts +68 -0
  442. package/es/Tabs/miniapp/utils/queryBatch.js +65 -0
  443. package/es/Tabs/utils/scroll.js +10 -4
  444. package/es/Tag/Tag.d.ts +1 -1
  445. package/es/Tag/Tag.js +4 -4
  446. package/es/Tag/Tag.types.d.ts +1 -1
  447. package/es/Tag/TagGroup.d.ts +1 -1
  448. package/es/Tag/TagGroup.js +1 -1
  449. package/es/Tag/TagGroup.types.d.ts +1 -1
  450. package/es/Tag/__tests__/fixtures/A11yDemos.js +3 -3
  451. package/es/TextArea/__tests__/fixtures/A11yDemos.d.ts +1 -1
  452. package/es/TextArea/__tests__/fixtures/A11yDemos.js +1 -1
  453. package/es/ThemeProvider/hooks/ThemeContext.d.ts +1 -1
  454. package/es/ThemeProvider/hooks/ThemeContext.js +1 -1
  455. package/es/ThemeProvider/hooks/useTheme.js +1 -1
  456. package/es/ThemeProvider/utils/mountTokens.js +1 -1
  457. package/es/Toast/Toast.d.ts +1 -1
  458. package/es/Toast/Toast.js +1 -1
  459. package/es/Toast/__tests__/fixtures/A11yDemos.d.ts +1 -1
  460. package/es/Toast/__tests__/fixtures/A11yDemos.js +1 -1
  461. package/es/Tooltip/Tooltip.d.ts +1 -1
  462. package/es/Tooltip/Tooltip.js +1 -1
  463. package/es/Tooltip/Tooltip.types.d.ts +1 -1
  464. package/es/Tooltip/__tests__/fixtures/A11yDemos.d.ts +1 -1
  465. package/es/Tooltip/__tests__/fixtures/A11yDemos.js +1 -1
  466. package/es/Transition/Transition.d.ts +1 -1
  467. package/es/Transition/Transition.js +1 -1
  468. package/es/Transition/Transition.miniapp.d.ts +1 -1
  469. package/es/Transition/Transition.miniapp.js +1 -1
  470. package/es/Transition/TransitionCore.js +8 -2
  471. package/es/_.._/benchmarks/components/Button.d.js +0 -0
  472. package/es/_.._/benchmarks/components/Button.js +1 -1
  473. package/es/_.._/benchmarks/components/Input.d.js +0 -0
  474. package/es/_.._/benchmarks/components/Tabs.d.js +0 -0
  475. package/package.json +7 -6
@@ -1,10 +1,5 @@
1
1
  import React, { SyntheticEvent } from 'react';
2
2
  import { OverrideProps } from '@bifrostui/types';
3
- export interface TabHeaderItem {
4
- title: React.ReactNode;
5
- index: string;
6
- disabled?: boolean;
7
- }
8
3
  export interface ITabsChangeData {
9
4
  /** 切换后的tab索引 */
10
5
  index: string;
@@ -19,9 +14,13 @@ export type ITabAlign = 'start' | 'center';
19
14
  export type TabsProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
20
15
  props: P & {
21
16
  /**
22
- * 当前选中面板的索引值,与tabs.index对应
17
+ * 当前选中面板的索引值,与 ITabItem.index 对应
23
18
  */
24
19
  value?: string;
20
+ /**
21
+ * 默认选中面板的索引值(非受控模式)
22
+ */
23
+ defaultValue?: string;
25
24
  /**
26
25
  * 切换面板的数据
27
26
  */
@@ -1,8 +1,17 @@
1
1
  import React from 'react';
2
- import { TabChangeEvent, TabsProps } from './Tabs.types';
3
- type TabsContextValueType = Omit<TabsProps, 'onChange'> & {
4
- triggerChange: TabChangeEvent;
5
- };
6
- declare const TabsContext: React.Context<TabsContextValueType>;
7
- export declare const TabsContextProvider: React.Provider<TabsContextValueType>;
2
+ import { TabChangeEvent } from './Tabs.types';
3
+ export interface TabRegisterData {
4
+ value: string;
5
+ ref: React.RefObject<HTMLElement>;
6
+ }
7
+ export interface TabsContextValueType {
8
+ value?: string;
9
+ triggerChange?: TabChangeEvent;
10
+ onRegister?: (data: TabRegisterData) => void;
11
+ onUnregister?: (data: {
12
+ value: string;
13
+ }) => void;
14
+ }
15
+ declare const TabsContext: import("@bifrostui/utils").Context<TabsContextValueType>;
16
+ export declare const TabsContextProvider: React.Provider<TabsContextValueType> & React.FC<React.ProviderProps<TabsContextValueType>>;
8
17
  export default TabsContext;
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
  var TabsContext_exports = {};
29
19
  __export(TabsContext_exports, {
@@ -31,10 +21,12 @@ __export(TabsContext_exports, {
31
21
  default: () => TabsContext_default
32
22
  });
33
23
  module.exports = __toCommonJS(TabsContext_exports);
34
- var import_react = __toESM(require("react"));
35
- const TabsContext = import_react.default.createContext(
36
- void 0
37
- );
24
+ var import_utils = require("@bifrostui/utils");
25
+ const TabsContext = (0, import_utils.createContext)({
26
+ triggerChange: void 0,
27
+ onRegister: void 0,
28
+ onUnregister: void 0
29
+ });
38
30
  if (process.env.NODE_ENV !== "production") {
39
31
  TabsContext.displayName = "BuiTabsContext";
40
32
  }
@@ -0,0 +1,10 @@
1
+ export declare const tabsRootClass = "bui-tabs";
2
+ export declare const tabRootClass = "bui-tab";
3
+ export declare const tabsScrollClass: string;
4
+ export declare const tabsScrollWrapperClass: string;
5
+ export declare const tabActiveClass: string;
6
+ export declare const tabDisabledClass: string;
7
+ export declare const tabIndicatorClass: string;
8
+ export declare const tabMaskClass: string;
9
+ export declare const tabMaskLeftClass: string;
10
+ export declare const tabMaskRightClass: string;
@@ -0,0 +1,54 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var classes_exports = {};
19
+ __export(classes_exports, {
20
+ tabActiveClass: () => tabActiveClass,
21
+ tabDisabledClass: () => tabDisabledClass,
22
+ tabIndicatorClass: () => tabIndicatorClass,
23
+ tabMaskClass: () => tabMaskClass,
24
+ tabMaskLeftClass: () => tabMaskLeftClass,
25
+ tabMaskRightClass: () => tabMaskRightClass,
26
+ tabRootClass: () => tabRootClass,
27
+ tabsRootClass: () => tabsRootClass,
28
+ tabsScrollClass: () => tabsScrollClass,
29
+ tabsScrollWrapperClass: () => tabsScrollWrapperClass
30
+ });
31
+ module.exports = __toCommonJS(classes_exports);
32
+ const tabsRootClass = "bui-tabs";
33
+ const tabRootClass = "bui-tab";
34
+ const tabsScrollClass = `${tabsRootClass}-tabs`;
35
+ const tabsScrollWrapperClass = `${tabsRootClass}-scroll-wrapper`;
36
+ const tabActiveClass = `${tabRootClass}-active`;
37
+ const tabDisabledClass = `${tabRootClass}-disabled`;
38
+ const tabIndicatorClass = `${tabsRootClass}-indicator`;
39
+ const tabMaskClass = `${tabsRootClass}-mask`;
40
+ const tabMaskLeftClass = `${tabMaskClass}-left`;
41
+ const tabMaskRightClass = `${tabMaskClass}-right`;
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ tabActiveClass,
45
+ tabDisabledClass,
46
+ tabIndicatorClass,
47
+ tabMaskClass,
48
+ tabMaskLeftClass,
49
+ tabMaskRightClass,
50
+ tabRootClass,
51
+ tabsRootClass,
52
+ tabsScrollClass,
53
+ tabsScrollWrapperClass
54
+ });
@@ -29,6 +29,7 @@ xhs-page {
29
29
  flex-wrap: nowrap;
30
30
  justify-content: flex-start;
31
31
  align-items: center;
32
+ white-space: nowrap;
32
33
  position: relative;
33
34
  overflow-x: scroll;
34
35
  scrollbar-width: none;
@@ -36,15 +37,28 @@ xhs-page {
36
37
  .bui-tabs-tabs::-webkit-scrollbar {
37
38
  display: none;
38
39
  }
40
+ .bui-tabs-scroll-wrapper {
41
+ height: 100%;
42
+ display: flex;
43
+ flex-wrap: nowrap;
44
+ justify-content: flex-start;
45
+ align-items: center;
46
+ position: relative;
47
+ min-width: 100%;
48
+ }
39
49
  .bui-tabs-indicator {
40
50
  position: absolute;
51
+ top: unset;
52
+ bottom: var(--bui-tabs-indicator-bottom, 0);
53
+ left: 0;
41
54
  width: var(--bui-tabs-indicator-width);
42
- bottom: var(--bui-tabs-indicator-bottom);
43
55
  height: var(--bui-tabs-indicator-height);
44
56
  color: var(--bui-color-primary);
45
57
  background: var(--bui-tabs-indicator-bg);
46
58
  border-radius: var(--bui-tabs-indicator-border-radius);
47
59
  box-shadow: var(--bui-tabs-indicator-box-shadow);
60
+ z-index: 1;
61
+ pointer-events: none;
48
62
  }
49
63
  .bui-tabs-content {
50
64
  padding: var(--bui-spacing-lg);
@@ -74,12 +88,8 @@ xhs-page {
74
88
  var(--bui-color-bg-view),
75
89
  rgba(255, 255, 255, 0));
76
90
  }
77
- .bui-indicator-invisible {
78
- visibility: hidden;
79
- background-color: transparent;
80
- }
81
91
  .bui-tab {
82
- display: flex;
92
+ display: inline-flex;
83
93
  align-items: center;
84
94
  justify-content: center;
85
95
  white-space: nowrap;
@@ -99,33 +109,10 @@ xhs-page {
99
109
  font-weight: var(--bui-font-weight-bold);
100
110
  font-family: var(--bui-tab-active-font-family);
101
111
  }
102
- .bui-tab-miniapp-active {
103
- color: var(--bui-tab-active-color);
104
- line-height: 1.5;
105
- font-weight: var(--bui-font-weight-bold);
106
- position: relative;
107
- }
108
- .bui-tab-miniapp-active-line {
109
- position: absolute;
110
- bottom: var(--bui-tabs-indicator-bottom);
111
- left: -12px;
112
- right: -12px;
113
- margin: 0 auto !important;
114
- width: var(--bui-tabs-indicator-width);
115
- height: var(--bui-tabs-indicator-height);
116
- transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
117
- background: var(--bui-tabs-indicator-bg);
118
- border-radius: var(--bui-tabs-indicator-border-radius);
119
- box-shadow: var(--bui-tabs-indicator-box-shadow);
120
- }
121
112
  .bui-tab-disabled {
122
113
  opacity: 0.5;
123
114
  pointer-events: none;
124
115
  }
125
- .bui-indicator-invisible {
126
- visibility: hidden;
127
- background-color: transparent;
128
- }
129
116
  .bui-tabpanel {
130
117
  font-family: var(--bui-font-family);
131
118
  }
@@ -1,6 +1,6 @@
1
1
  export { default as Tab } from './Tab';
2
- export * from './Tab.types';
3
2
  export { default as TabPanel } from './TabPanel';
4
- export * from './TabPanel.types';
5
3
  export { default, default as Tabs } from './Tabs';
6
4
  export * from './Tabs.types';
5
+ export * from './Tab.types';
6
+ export * from './TabPanel.types';
@@ -35,17 +35,17 @@ __export(Tabs_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(Tabs_exports);
37
37
  var import_Tab = __toESM(require("./Tab"));
38
- __reExport(Tabs_exports, require("./Tab.types"), module.exports);
39
38
  var import_TabPanel = __toESM(require("./TabPanel"));
40
- __reExport(Tabs_exports, require("./TabPanel.types"), module.exports);
41
39
  var import_Tabs = __toESM(require("./Tabs"));
42
40
  __reExport(Tabs_exports, require("./Tabs.types"), module.exports);
41
+ __reExport(Tabs_exports, require("./Tab.types"), module.exports);
42
+ __reExport(Tabs_exports, require("./TabPanel.types"), module.exports);
43
43
  // Annotate the CommonJS export names for ESM import in node:
44
44
  0 && (module.exports = {
45
45
  Tab,
46
46
  TabPanel,
47
47
  Tabs,
48
+ ...require("./Tabs.types"),
48
49
  ...require("./Tab.types"),
49
- ...require("./TabPanel.types"),
50
- ...require("./Tabs.types")
50
+ ...require("./TabPanel.types")
51
51
  });
@@ -0,0 +1,5 @@
1
+ export { default, Tab, Tabs } from './miniapp';
2
+ export { default as TabPanel } from './TabPanel';
3
+ export * from './Tabs.types';
4
+ export * from './Tab.types';
5
+ export * from './TabPanel.types';
@@ -0,0 +1,50 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var index_miniapp_exports = {};
30
+ __export(index_miniapp_exports, {
31
+ Tab: () => import_miniapp.Tab,
32
+ TabPanel: () => import_TabPanel.default,
33
+ Tabs: () => import_miniapp.Tabs,
34
+ default: () => import_miniapp.default
35
+ });
36
+ module.exports = __toCommonJS(index_miniapp_exports);
37
+ var import_miniapp = __toESM(require("./miniapp"));
38
+ var import_TabPanel = __toESM(require("./TabPanel"));
39
+ __reExport(index_miniapp_exports, require("./Tabs.types"), module.exports);
40
+ __reExport(index_miniapp_exports, require("./Tab.types"), module.exports);
41
+ __reExport(index_miniapp_exports, require("./TabPanel.types"), module.exports);
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ Tab,
45
+ TabPanel,
46
+ Tabs,
47
+ ...require("./Tabs.types"),
48
+ ...require("./Tab.types"),
49
+ ...require("./TabPanel.types")
50
+ });
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { TabProps } from '../Tab.types';
3
+ import '../Tab.less';
4
+ declare const _default: React.NamedExoticComponent<TabProps<"div", {}>>;
5
+ export default _default;
@@ -0,0 +1,103 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var Tab_exports = {};
29
+ __export(Tab_exports, {
30
+ default: () => Tab_default
31
+ });
32
+ module.exports = __toCommonJS(Tab_exports);
33
+ var import_react = __toESM(require("react"));
34
+ var import_clsx = __toESM(require("clsx"));
35
+ var import_utils = require("@bifrostui/utils");
36
+ var import_TabsContext = __toESM(require("./TabsContext"));
37
+ var import_classes = require("../classes");
38
+ var import_Tab2 = require("../Tab.css");
39
+ const Tab = (props) => {
40
+ const {
41
+ className,
42
+ children,
43
+ index,
44
+ disabled = false,
45
+ onClick,
46
+ style
47
+ } = props;
48
+ const isActive = (0, import_utils.useContextSelector)(
49
+ import_TabsContext.default,
50
+ (ctx) => ctx.value === index
51
+ );
52
+ const triggerChange = (0, import_utils.useContextSelector)(
53
+ import_TabsContext.default,
54
+ (ctx) => ctx.triggerChange
55
+ );
56
+ const onRegister = (0, import_utils.useContextSelector)(import_TabsContext.default, (ctx) => ctx.onRegister);
57
+ const onUnregister = (0, import_utils.useContextSelector)(
58
+ import_TabsContext.default,
59
+ (ctx) => ctx.onUnregister
60
+ );
61
+ const tabsContainerId = (0, import_utils.useContextSelector)(
62
+ import_TabsContext.default,
63
+ (ctx) => ctx.tabsContainerId
64
+ );
65
+ (0, import_react.useEffect)(() => {
66
+ if (index !== void 0 && index !== null) {
67
+ onRegister == null ? void 0 : onRegister({ value: index });
68
+ }
69
+ return () => {
70
+ if (index !== void 0 && index !== null) {
71
+ onUnregister == null ? void 0 : onUnregister({ value: index });
72
+ }
73
+ };
74
+ }, [onRegister, onUnregister, index]);
75
+ const rootCls = (0, import_clsx.default)(
76
+ import_classes.tabRootClass,
77
+ {
78
+ [import_classes.tabActiveClass]: isActive,
79
+ [import_classes.tabDisabledClass]: disabled
80
+ },
81
+ className
82
+ );
83
+ const tabId = tabsContainerId ? `${tabsContainerId}-tab-${index}` : void 0;
84
+ return /* @__PURE__ */ import_react.default.createElement(
85
+ "div",
86
+ {
87
+ id: tabId,
88
+ className: rootCls,
89
+ style,
90
+ onClick: (e) => {
91
+ if (disabled)
92
+ return;
93
+ triggerChange == null ? void 0 : triggerChange(e, { index });
94
+ onClick == null ? void 0 : onClick(e, { index });
95
+ }
96
+ },
97
+ children
98
+ );
99
+ };
100
+ Tab.displayName = "BuiTab";
101
+ var Tab_default = /* @__PURE__ */ import_react.default.memo(Tab, (prevProps, nextProps) => {
102
+ return prevProps.index === nextProps.index && prevProps.disabled === nextProps.disabled && prevProps.className === nextProps.className && prevProps.children === nextProps.children;
103
+ });
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface TabIndicatorProps {
3
+ /** 当前选中的 tab 值 */
4
+ currentValue: string;
5
+ /** 已注册的 tabs 值数组(用于生成ID) */
6
+ registeredTabValues: string[];
7
+ /** wrapper 容器的 ID(Tab的父容器) */
8
+ wrapperId: string;
9
+ /** ScrollView 的 ID */
10
+ scrollViewId: string;
11
+ /** 注册版本号,每次 tab 注册/取消注册时递增 */
12
+ registrationVersion: number;
13
+ }
14
+ declare const TabIndicator: React.FC<TabIndicatorProps>;
15
+ export default TabIndicator;
@@ -0,0 +1,206 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var __async = (__this, __arguments, generator) => {
29
+ return new Promise((resolve, reject) => {
30
+ var fulfilled = (value) => {
31
+ try {
32
+ step(generator.next(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ };
37
+ var rejected = (value) => {
38
+ try {
39
+ step(generator.throw(value));
40
+ } catch (e) {
41
+ reject(e);
42
+ }
43
+ };
44
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
+ step((generator = generator.apply(__this, __arguments)).next());
46
+ });
47
+ };
48
+ var TabIndicator_exports = {};
49
+ __export(TabIndicator_exports, {
50
+ default: () => TabIndicator_default
51
+ });
52
+ module.exports = __toCommonJS(TabIndicator_exports);
53
+ var import_react = __toESM(require("react"));
54
+ var import_clsx = __toESM(require("clsx"));
55
+ var import_taro = __toESM(require("@tarojs/taro"));
56
+ var import_utils = require("@bifrostui/utils");
57
+ var import_classes = require("../classes");
58
+ var import_queryBatch = require("./utils/queryBatch");
59
+ const TabIndicator = ({
60
+ currentValue,
61
+ registeredTabValues,
62
+ wrapperId,
63
+ scrollViewId,
64
+ registrationVersion
65
+ }) => {
66
+ const [transform, setTransform] = (0, import_react.useState)("translate(0px, 0px)");
67
+ const [visibility, setVisibility] = (0, import_react.useState)("hidden");
68
+ const animationTimerRef = (0, import_react.useRef)(null);
69
+ const positionCacheRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
70
+ const containerInfoRef = (0, import_react.useRef)(null);
71
+ const indicatorWidthRef = (0, import_react.useRef)(24);
72
+ const isInitializedRef = (0, import_react.useRef)(false);
73
+ const initRetryCountRef = (0, import_react.useRef)(0);
74
+ const maxInitRetries = 5;
75
+ const updateIndicatorPosition = (0, import_utils.useEventCallback)(() => {
76
+ if (!currentValue || !registeredTabValues.includes(currentValue)) {
77
+ setVisibility("hidden");
78
+ return;
79
+ }
80
+ const cachedPosition = positionCacheRef.current.get(currentValue);
81
+ const containerInfo = containerInfoRef.current;
82
+ if (!cachedPosition || !containerInfo) {
83
+ if (!isInitializedRef.current) {
84
+ initializePositions();
85
+ }
86
+ return;
87
+ }
88
+ const activeTabLeft = cachedPosition.left;
89
+ const activeTabWidth = cachedPosition.width;
90
+ const indicatorWidth = indicatorWidthRef.current;
91
+ const x = activeTabLeft + (activeTabWidth - indicatorWidth) / 2;
92
+ setTransform(`translate(${x}px, 0px)`);
93
+ setVisibility("visible");
94
+ });
95
+ const initializePositions = (0, import_utils.useEventCallback)(() => __async(void 0, null, function* () {
96
+ try {
97
+ const result = yield (0, import_queryBatch.batchQueryTabs)({
98
+ scrollViewId,
99
+ wrapperId,
100
+ tabValues: registeredTabValues
101
+ });
102
+ const { scrollView, scrollFields, wrapper, indicator, tabs } = result;
103
+ if (!scrollView || !wrapper || !indicator || !scrollFields) {
104
+ if (initRetryCountRef.current < maxInitRetries) {
105
+ initRetryCountRef.current += 1;
106
+ if (animationTimerRef.current) {
107
+ clearTimeout(animationTimerRef.current);
108
+ }
109
+ animationTimerRef.current = setTimeout(() => {
110
+ initializePositions();
111
+ }, 100);
112
+ }
113
+ return;
114
+ }
115
+ containerInfoRef.current = {
116
+ width: scrollView.width,
117
+ scrollWidth: scrollFields.scrollWidth || scrollView.width
118
+ };
119
+ indicatorWidthRef.current = indicator.width;
120
+ const newCache = /* @__PURE__ */ new Map();
121
+ registeredTabValues.forEach((value, index) => {
122
+ const tabRect = tabs[index];
123
+ if (tabRect && tabRect.width > 0) {
124
+ const relativeLeft = tabRect.left - wrapper.left;
125
+ newCache.set(value, {
126
+ left: relativeLeft,
127
+ width: tabRect.width
128
+ });
129
+ }
130
+ });
131
+ if (newCache.size < registeredTabValues.length) {
132
+ if (initRetryCountRef.current < maxInitRetries) {
133
+ initRetryCountRef.current += 1;
134
+ if (animationTimerRef.current) {
135
+ clearTimeout(animationTimerRef.current);
136
+ }
137
+ animationTimerRef.current = setTimeout(() => {
138
+ initializePositions();
139
+ }, 100);
140
+ }
141
+ return;
142
+ }
143
+ initRetryCountRef.current = 0;
144
+ positionCacheRef.current = newCache;
145
+ isInitializedRef.current = true;
146
+ updateIndicatorPosition();
147
+ } catch (error) {
148
+ console.error("[TabIndicator] \u6279\u91CF\u67E5\u8BE2\u5931\u8D25:", error);
149
+ }
150
+ }));
151
+ (0, import_react.useEffect)(() => {
152
+ if (registeredTabValues.length === 0) {
153
+ return void 0;
154
+ }
155
+ if (animationTimerRef.current) {
156
+ clearTimeout(animationTimerRef.current);
157
+ }
158
+ isInitializedRef.current = false;
159
+ initRetryCountRef.current = 0;
160
+ import_taro.default.nextTick(() => {
161
+ initializePositions();
162
+ });
163
+ return () => {
164
+ if (animationTimerRef.current) {
165
+ clearTimeout(animationTimerRef.current);
166
+ }
167
+ };
168
+ }, [registrationVersion, initializePositions]);
169
+ (0, import_react.useEffect)(() => {
170
+ if (!currentValue) {
171
+ setVisibility("hidden");
172
+ return;
173
+ }
174
+ updateIndicatorPosition();
175
+ }, [currentValue, updateIndicatorPosition]);
176
+ (0, import_react.useEffect)(() => {
177
+ var _a, _b;
178
+ const handleResize = () => {
179
+ isInitializedRef.current = false;
180
+ initRetryCountRef.current = 0;
181
+ positionCacheRef.current.clear();
182
+ import_taro.default.nextTick(() => {
183
+ initializePositions();
184
+ });
185
+ };
186
+ (_b = (_a = import_taro.default).onWindowResize) == null ? void 0 : _b.call(_a, handleResize);
187
+ return () => {
188
+ var _a2, _b2;
189
+ (_b2 = (_a2 = import_taro.default).offWindowResize) == null ? void 0 : _b2.call(_a2, handleResize);
190
+ };
191
+ }, [initializePositions]);
192
+ return /* @__PURE__ */ import_react.default.createElement(
193
+ "div",
194
+ {
195
+ id: `${wrapperId}-indicator`,
196
+ className: (0, import_clsx.default)(import_classes.tabIndicatorClass),
197
+ style: {
198
+ transition: "transform 0.3s ease-in-out",
199
+ transform,
200
+ visibility
201
+ }
202
+ }
203
+ );
204
+ };
205
+ TabIndicator.displayName = "BuiTabsIndicator";
206
+ var TabIndicator_default = TabIndicator;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface TabMaskProps {
3
+ /** 位置:左侧或右侧 */
4
+ position: 'left' | 'right';
5
+ /** 当前滚动位置 */
6
+ scrollLeft: number;
7
+ /** 容器宽度 */
8
+ containerWidth: number;
9
+ /** 滚动区域总宽度 */
10
+ scrollWidth: number;
11
+ }
12
+ declare const _default: React.NamedExoticComponent<TabMaskProps>;
13
+ export default _default;