@bifrostui/react 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (484) 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/Button/index.css +2 -3
  35. package/dist/Calendar/Calendar.types.d.ts +1 -1
  36. package/dist/Calendar/__tests__/fixtures/A11yDemos.d.ts +1 -1
  37. package/dist/Calendar/__tests__/fixtures/A11yDemos.js +2 -2
  38. package/dist/Card/Card.d.ts +1 -1
  39. package/dist/Card/Card.js +3 -3
  40. package/dist/Card/Card.types.d.ts +1 -1
  41. package/dist/Card/CardContent.d.ts +1 -1
  42. package/dist/Card/CardContent.js +3 -3
  43. package/dist/Card/CardContent.types.d.ts +1 -1
  44. package/dist/Card/CardFooter.d.ts +1 -1
  45. package/dist/Card/CardFooter.js +3 -3
  46. package/dist/Card/CardFooter.types.d.ts +1 -1
  47. package/dist/Card/CardHeader.d.ts +1 -1
  48. package/dist/Card/CardHeader.js +10 -10
  49. package/dist/Checkbox/CheckboxContext.d.ts +1 -1
  50. package/dist/Checkbox/CheckboxContext.js +2 -2
  51. package/dist/Checkbox/__tests__/fixtures/A11yDemos.d.ts +1 -1
  52. package/dist/Checkbox/__tests__/fixtures/A11yDemos.js +4 -4
  53. package/dist/CitySelector/CitySelector.types.d.ts +1 -0
  54. package/dist/CitySelector/Selector/index.d.ts +1 -1
  55. package/dist/CitySelector/Selector/index.js +2 -2
  56. package/dist/Collapse/Collapse.types.d.ts +1 -1
  57. package/dist/CollapsePanel/CollapsePanel.d.ts +1 -1
  58. package/dist/CollapsePanel/CollapsePanel.js +9 -9
  59. package/dist/CollapsePanel/CollapsePanel.types.d.ts +1 -1
  60. package/dist/CollapsePanel/CollapsePanelItem.d.ts +1 -1
  61. package/dist/CollapsePanel/CollapsePanelItem.js +5 -5
  62. package/dist/Countdown/Countdown.types.d.ts +2 -2
  63. package/dist/Countdown/__tests__/fixtures/A11yDemos.d.ts +1 -1
  64. package/dist/Countdown/__tests__/fixtures/A11yDemos.js +10 -10
  65. package/dist/Countdown/utils.d.ts +2 -2
  66. package/dist/Countdown/utils.js +4 -4
  67. package/dist/DatePicker/DatePicker.types.d.ts +1 -1
  68. package/dist/DesktopPicker/DesktopPicker.types.d.ts +1 -1
  69. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +11 -11
  70. package/dist/DesktopTimePicker/useGetTimePickerContent.js +2 -2
  71. package/dist/DesktopTimePicker/utils/utils.d.ts +1 -1
  72. package/dist/DesktopTimePicker/utils/utils.js +3 -3
  73. package/dist/Dialog/__tests__/fixtures/A11yDemos.d.ts +1 -1
  74. package/dist/Dialog/__tests__/fixtures/A11yDemos.js +4 -4
  75. package/dist/Divider/Divider.types.d.ts +1 -1
  76. package/dist/Drawer/Drawer.d.ts +1 -1
  77. package/dist/Drawer/Drawer.js +5 -5
  78. package/dist/Drawer/Drawer.types.d.ts +1 -1
  79. package/dist/Fade/Fade.d.ts +1 -1
  80. package/dist/Fade/Fade.js +4 -4
  81. package/dist/Fade/Fade.miniapp.js +13 -10
  82. package/dist/Fade/Fade.types.d.ts +1 -1
  83. package/dist/IconButton/IconButton.d.ts +1 -1
  84. package/dist/IconButton/IconButton.js +6 -6
  85. package/dist/IconButton/IconButton.types.d.ts +1 -1
  86. package/dist/Input/Input.types.d.ts +1 -1
  87. package/dist/Input/__tests__/fixtures/A11yDemos.d.ts +1 -1
  88. package/dist/Input/__tests__/fixtures/A11yDemos.js +7 -7
  89. package/dist/ItemSelector/ItemSelector.miniapp.js +7 -5
  90. package/dist/ItemSelector/ItemSelector.types.d.ts +1 -0
  91. package/dist/ItemSelector/Selector/index.d.ts +1 -1
  92. package/dist/ItemSelector/Selector/index.js +2 -2
  93. package/dist/List/List.d.ts +1 -1
  94. package/dist/List/List.js +4 -4
  95. package/dist/List/ListContext.d.ts +1 -1
  96. package/dist/List/ListContext.js +2 -2
  97. package/dist/List/ListItem.d.ts +1 -1
  98. package/dist/List/ListItem.js +8 -8
  99. package/dist/List/ListItem.types.d.ts +1 -1
  100. package/dist/List/ListItemContent.d.ts +1 -1
  101. package/dist/List/ListItemContent.js +3 -3
  102. package/dist/List/ListItemContent.types.d.ts +1 -1
  103. package/dist/List/ListItemExtra.d.ts +1 -1
  104. package/dist/List/ListItemExtra.js +3 -3
  105. package/dist/List/ListItemExtra.types.d.ts +1 -1
  106. package/dist/List/ListItemFooter.d.ts +1 -1
  107. package/dist/List/ListItemFooter.js +3 -3
  108. package/dist/List/ListItemFooter.types.d.ts +1 -1
  109. package/dist/List/ListItemHeader.d.ts +1 -1
  110. package/dist/List/ListItemHeader.js +3 -3
  111. package/dist/List/ListItemHeader.types.d.ts +1 -1
  112. package/dist/Loading/Loading.d.ts +1 -1
  113. package/dist/Loading/Loading.js +5 -5
  114. package/dist/Loading/Loading.types.d.ts +1 -1
  115. package/dist/Modal/Modal.d.ts +1 -1
  116. package/dist/Modal/Modal.js +6 -6
  117. package/dist/Modal/Modal.miniapp.d.ts +1 -1
  118. package/dist/Modal/Modal.miniapp.js +7 -7
  119. package/dist/Modal/__tests__/fixtures/A11yDemos.d.ts +1 -1
  120. package/dist/Modal/__tests__/fixtures/A11yDemos.js +3 -3
  121. package/dist/Modal/useModal.js +26 -29
  122. package/dist/NavBar/NavBar.d.ts +1 -1
  123. package/dist/NavBar/NavBar.js +10 -10
  124. package/dist/Picker/Picker.js +0 -1
  125. package/dist/Picker/Picker.types.d.ts +1 -1
  126. package/dist/Picker/__tests__/fixtures/A11yDemos.d.ts +1 -1
  127. package/dist/Picker/__tests__/fixtures/A11yDemos.js +2 -2
  128. package/dist/Popover/Popover.d.ts +1 -1
  129. package/dist/Popover/Popover.js +8 -8
  130. package/dist/Popover/Popover.types.d.ts +1 -1
  131. package/dist/Popover/__tests__/fixtures/A11yDemos.d.ts +1 -1
  132. package/dist/Popover/__tests__/fixtures/A11yDemos.js +21 -21
  133. package/dist/Portal/Portal.d.ts +1 -1
  134. package/dist/Portal/Portal.js +3 -3
  135. package/dist/Portal/Portal.miniapp.js +14 -8
  136. package/dist/Portal/Portal.types.d.ts +1 -1
  137. package/dist/Progress/Progress.d.ts +1 -1
  138. package/dist/Progress/Progress.js +4 -4
  139. package/dist/Progress/Progress.types.d.ts +1 -1
  140. package/dist/Progress/__tests__/fixtures/A11yDemos.d.ts +1 -1
  141. package/dist/Progress/__tests__/fixtures/A11yDemos.js +9 -9
  142. package/dist/Radio/RadioButtonIcon.d.ts +1 -1
  143. package/dist/Radio/RadioButtonIcon.js +4 -4
  144. package/dist/Radio/RadioContext.d.ts +1 -1
  145. package/dist/Radio/RadioContext.js +2 -2
  146. package/dist/Radio/__tests__/fixtures/A11yDemos.d.ts +1 -1
  147. package/dist/Radio/__tests__/fixtures/A11yDemos.js +4 -4
  148. package/dist/Rating/Rating.types.d.ts +1 -1
  149. package/dist/ScrollView/ScrollView.types.d.ts +210 -1
  150. package/dist/ScrollView/__tests__/fixtures/A11yDemos.d.ts +1 -1
  151. package/dist/ScrollView/__tests__/fixtures/A11yDemos.js +30 -30
  152. package/dist/ScrollView/useScrollView.js +16 -4
  153. package/dist/Skeleton/Skeleton.d.ts +1 -1
  154. package/dist/Skeleton/Skeleton.js +3 -3
  155. package/dist/Skeleton/Skeleton.types.d.ts +1 -1
  156. package/dist/Slide/Slide.d.ts +1 -1
  157. package/dist/Slide/Slide.js +4 -4
  158. package/dist/Slide/Slide.miniapp.js +13 -10
  159. package/dist/Slider/Slider.types.d.ts +1 -1
  160. package/dist/Steps/Step.types.d.ts +1 -1
  161. package/dist/Steps/StepsContext.d.ts +1 -1
  162. package/dist/Steps/StepsContext.js +2 -2
  163. package/dist/SwipeAction/SwipeAction.js +7 -8
  164. package/dist/SwipeAction/SwipeAction.types.d.ts +1 -1
  165. package/dist/Swiper/Swiper.types.d.ts +1 -1
  166. package/dist/Swiper/SwiperItem.d.ts +1 -1
  167. package/dist/Swiper/SwiperItem.js +2 -2
  168. package/dist/Switch/__tests__/fixtures/A11yDemos.d.ts +1 -1
  169. package/dist/Switch/__tests__/fixtures/A11yDemos.js +4 -4
  170. package/dist/TabBar/TabBar.d.ts +1 -1
  171. package/dist/TabBar/TabBar.js +5 -5
  172. package/dist/Tabs/Tab.css +1 -23
  173. package/dist/Tabs/Tab.d.ts +2 -2
  174. package/dist/Tabs/Tab.js +42 -34
  175. package/dist/Tabs/Tab.types.d.ts +1 -1
  176. package/dist/Tabs/TabIndicator.d.ts +11 -0
  177. package/dist/Tabs/TabIndicator.js +185 -0
  178. package/dist/Tabs/TabMask.d.ts +7 -0
  179. package/dist/Tabs/TabMask.js +47 -0
  180. package/dist/Tabs/TabPanel.js +4 -4
  181. package/dist/Tabs/TabPanel.types.d.ts +1 -1
  182. package/dist/Tabs/Tabs.css +14 -6
  183. package/dist/Tabs/Tabs.js +99 -157
  184. package/dist/Tabs/Tabs.types.d.ts +5 -6
  185. package/dist/Tabs/TabsContext.d.ts +15 -6
  186. package/dist/Tabs/TabsContext.js +6 -14
  187. package/dist/Tabs/classes.d.ts +13 -0
  188. package/dist/Tabs/classes.js +63 -0
  189. package/dist/Tabs/index.css +15 -29
  190. package/dist/Tabs/index.d.ts +2 -2
  191. package/dist/Tabs/index.js +4 -4
  192. package/dist/Tabs/index.miniapp.d.ts +5 -0
  193. package/dist/Tabs/index.miniapp.js +50 -0
  194. package/dist/Tabs/miniapp/Tab.d.ts +5 -0
  195. package/dist/Tabs/miniapp/Tab.js +106 -0
  196. package/dist/Tabs/miniapp/TabIndicator.d.ts +15 -0
  197. package/dist/Tabs/miniapp/TabIndicator.js +301 -0
  198. package/dist/Tabs/miniapp/Tabs.d.ts +5 -0
  199. package/dist/Tabs/miniapp/Tabs.js +251 -0
  200. package/dist/Tabs/miniapp/TabsContext.d.ts +17 -0
  201. package/dist/Tabs/miniapp/TabsContext.js +39 -0
  202. package/dist/Tabs/miniapp/index.d.ts +2 -0
  203. package/dist/Tabs/miniapp/index.js +41 -0
  204. package/dist/Tabs/miniapp/scroll.d.ts +21 -0
  205. package/dist/Tabs/miniapp/scroll.js +52 -0
  206. package/dist/Tabs/miniapp/utils/queryBatch.d.ts +68 -0
  207. package/dist/Tabs/miniapp/utils/queryBatch.js +100 -0
  208. package/dist/Tabs/utils/scroll.js +10 -4
  209. package/dist/Tag/Tag.css +0 -1
  210. package/dist/Tag/Tag.d.ts +1 -1
  211. package/dist/Tag/Tag.js +6 -6
  212. package/dist/Tag/Tag.types.d.ts +1 -1
  213. package/dist/Tag/TagGroup.d.ts +1 -1
  214. package/dist/Tag/TagGroup.js +3 -3
  215. package/dist/Tag/TagGroup.types.d.ts +1 -1
  216. package/dist/Tag/__tests__/fixtures/A11yDemos.js +3 -3
  217. package/dist/Tag/index.css +0 -1
  218. package/dist/TextArea/__tests__/fixtures/A11yDemos.d.ts +1 -1
  219. package/dist/TextArea/__tests__/fixtures/A11yDemos.js +6 -6
  220. package/dist/ThemeProvider/hooks/ThemeContext.d.ts +1 -1
  221. package/dist/ThemeProvider/hooks/ThemeContext.js +2 -2
  222. package/dist/ThemeProvider/hooks/useTheme.js +2 -2
  223. package/dist/ThemeProvider/utils/mountTokens.js +2 -2
  224. package/dist/Toast/Toast.d.ts +1 -1
  225. package/dist/Toast/Toast.js +8 -8
  226. package/dist/Toast/__tests__/fixtures/A11yDemos.d.ts +1 -1
  227. package/dist/Toast/__tests__/fixtures/A11yDemos.js +2 -2
  228. package/dist/Tooltip/Tooltip.d.ts +1 -1
  229. package/dist/Tooltip/Tooltip.js +5 -5
  230. package/dist/Tooltip/Tooltip.types.d.ts +1 -1
  231. package/dist/Tooltip/__tests__/fixtures/A11yDemos.d.ts +1 -1
  232. package/dist/Tooltip/__tests__/fixtures/A11yDemos.js +14 -14
  233. package/dist/Transition/Transition.d.ts +1 -1
  234. package/dist/Transition/Transition.js +3 -3
  235. package/dist/Transition/Transition.miniapp.d.ts +1 -1
  236. package/dist/Transition/Transition.miniapp.js +3 -3
  237. package/dist/Transition/TransitionCore.js +8 -2
  238. package/dist/_.._/benchmarks/components/Button.d.js +15 -0
  239. package/dist/_.._/benchmarks/components/Button.js +2 -2
  240. package/dist/_.._/benchmarks/components/Input.d.js +15 -0
  241. package/dist/_.._/benchmarks/components/Tabs.d.js +15 -0
  242. package/es/ActionSheet/ActionSheet.d.ts +1 -1
  243. package/es/ActionSheet/ActionSheet.js +1 -1
  244. package/es/ActionSheet/ActionSheet.types.d.ts +1 -1
  245. package/es/ActionSheet/ActionSheetContext.d.ts +1 -1
  246. package/es/ActionSheet/ActionSheetContext.js +1 -1
  247. package/es/ActionSheet/ActionSheetItem.types.d.ts +1 -1
  248. package/es/Alert/Alert.d.ts +1 -1
  249. package/es/Alert/Alert.js +1 -1
  250. package/es/Alert/__tests__/fixtures/A11yDemos.d.ts +1 -1
  251. package/es/Alert/__tests__/fixtures/A11yDemos.js +1 -1
  252. package/es/Avatar/Avatar.d.ts +1 -1
  253. package/es/Avatar/Avatar.js +1 -1
  254. package/es/Avatar/Avatar.types.d.ts +1 -1
  255. package/es/Avatar/AvatarGroup.types.d.ts +1 -1
  256. package/es/Backdrop/Backdrop.d.ts +1 -1
  257. package/es/Backdrop/Backdrop.js +1 -1
  258. package/es/Backdrop/Backdrop.types.d.ts +1 -1
  259. package/es/Backdrop/__tests__/fixtures/A11yDemos.d.ts +1 -1
  260. package/es/Backdrop/__tests__/fixtures/A11yDemos.js +1 -1
  261. package/es/Badge/Badge.d.ts +1 -1
  262. package/es/Badge/Badge.js +1 -1
  263. package/es/Badge/__tests__/fixtures/A11yDemos.d.ts +1 -1
  264. package/es/Badge/__tests__/fixtures/A11yDemos.js +1 -1
  265. package/es/Breadcrumb/Breadcrumb.d.ts +1 -1
  266. package/es/Breadcrumb/Breadcrumb.js +1 -1
  267. package/es/Breadcrumb/Breadcrumb.types.d.ts +1 -1
  268. package/es/Breadcrumb/BreadcrumbItem.d.ts +1 -1
  269. package/es/Breadcrumb/BreadcrumbItem.js +1 -1
  270. package/es/Button/Button.d.ts +1 -1
  271. package/es/Button/Button.js +1 -1
  272. package/es/Button/Button.types.d.ts +1 -1
  273. package/es/Button/__tests__/fixtures/A11yDemos.d.ts +1 -1
  274. package/es/Button/__tests__/fixtures/A11yDemos.js +1 -1
  275. package/es/Button/index.css +2 -3
  276. package/es/Calendar/Calendar.types.d.ts +1 -1
  277. package/es/Calendar/__tests__/fixtures/A11yDemos.d.ts +1 -1
  278. package/es/Calendar/__tests__/fixtures/A11yDemos.js +1 -1
  279. package/es/Card/Card.d.ts +1 -1
  280. package/es/Card/Card.js +1 -1
  281. package/es/Card/Card.types.d.ts +1 -1
  282. package/es/Card/CardContent.d.ts +1 -1
  283. package/es/Card/CardContent.js +1 -1
  284. package/es/Card/CardContent.types.d.ts +1 -1
  285. package/es/Card/CardFooter.d.ts +1 -1
  286. package/es/Card/CardFooter.js +1 -1
  287. package/es/Card/CardFooter.types.d.ts +1 -1
  288. package/es/Card/CardHeader.d.ts +1 -1
  289. package/es/Card/CardHeader.js +1 -1
  290. package/es/Checkbox/CheckboxContext.d.ts +1 -1
  291. package/es/Checkbox/CheckboxContext.js +1 -1
  292. package/es/Checkbox/__tests__/fixtures/A11yDemos.d.ts +1 -1
  293. package/es/Checkbox/__tests__/fixtures/A11yDemos.js +1 -1
  294. package/es/CitySelector/CitySelector.types.d.ts +1 -0
  295. package/es/CitySelector/Selector/index.d.ts +1 -1
  296. package/es/CitySelector/Selector/index.js +1 -1
  297. package/es/Collapse/Collapse.types.d.ts +1 -1
  298. package/es/CollapsePanel/CollapsePanel.d.ts +1 -1
  299. package/es/CollapsePanel/CollapsePanel.js +1 -1
  300. package/es/CollapsePanel/CollapsePanel.types.d.ts +1 -1
  301. package/es/CollapsePanel/CollapsePanelItem.d.ts +1 -1
  302. package/es/CollapsePanel/CollapsePanelItem.js +1 -1
  303. package/es/Countdown/Countdown.types.d.ts +2 -2
  304. package/es/Countdown/__tests__/fixtures/A11yDemos.d.ts +1 -1
  305. package/es/Countdown/__tests__/fixtures/A11yDemos.js +1 -1
  306. package/es/Countdown/utils.d.ts +2 -2
  307. package/es/Countdown/utils.js +4 -4
  308. package/es/DatePicker/DatePicker.types.d.ts +1 -1
  309. package/es/DesktopPicker/DesktopPicker.types.d.ts +1 -1
  310. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +11 -11
  311. package/es/DesktopTimePicker/useGetTimePickerContent.js +3 -3
  312. package/es/DesktopTimePicker/utils/utils.d.ts +1 -1
  313. package/es/DesktopTimePicker/utils/utils.js +2 -2
  314. package/es/Dialog/__tests__/fixtures/A11yDemos.d.ts +1 -1
  315. package/es/Dialog/__tests__/fixtures/A11yDemos.js +1 -1
  316. package/es/Divider/Divider.types.d.ts +1 -1
  317. package/es/Drawer/Drawer.d.ts +1 -1
  318. package/es/Drawer/Drawer.js +1 -1
  319. package/es/Drawer/Drawer.types.d.ts +1 -1
  320. package/es/Fade/Fade.d.ts +1 -1
  321. package/es/Fade/Fade.js +1 -1
  322. package/es/Fade/Fade.miniapp.js +14 -11
  323. package/es/Fade/Fade.types.d.ts +1 -1
  324. package/es/IconButton/IconButton.d.ts +1 -1
  325. package/es/IconButton/IconButton.js +1 -1
  326. package/es/IconButton/IconButton.types.d.ts +1 -1
  327. package/es/Input/Input.types.d.ts +1 -1
  328. package/es/Input/__tests__/fixtures/A11yDemos.d.ts +1 -1
  329. package/es/Input/__tests__/fixtures/A11yDemos.js +1 -1
  330. package/es/ItemSelector/ItemSelector.miniapp.js +7 -5
  331. package/es/ItemSelector/ItemSelector.types.d.ts +1 -0
  332. package/es/ItemSelector/Selector/index.d.ts +1 -1
  333. package/es/ItemSelector/Selector/index.js +1 -1
  334. package/es/List/List.d.ts +1 -1
  335. package/es/List/List.js +1 -1
  336. package/es/List/ListContext.d.ts +1 -1
  337. package/es/List/ListContext.js +1 -1
  338. package/es/List/ListItem.d.ts +1 -1
  339. package/es/List/ListItem.js +1 -1
  340. package/es/List/ListItem.types.d.ts +1 -1
  341. package/es/List/ListItemContent.d.ts +1 -1
  342. package/es/List/ListItemContent.js +1 -1
  343. package/es/List/ListItemContent.types.d.ts +1 -1
  344. package/es/List/ListItemExtra.d.ts +1 -1
  345. package/es/List/ListItemExtra.js +1 -1
  346. package/es/List/ListItemExtra.types.d.ts +1 -1
  347. package/es/List/ListItemFooter.d.ts +1 -1
  348. package/es/List/ListItemFooter.js +1 -1
  349. package/es/List/ListItemFooter.types.d.ts +1 -1
  350. package/es/List/ListItemHeader.d.ts +1 -1
  351. package/es/List/ListItemHeader.js +1 -1
  352. package/es/List/ListItemHeader.types.d.ts +1 -1
  353. package/es/Loading/Loading.d.ts +1 -1
  354. package/es/Loading/Loading.js +1 -1
  355. package/es/Loading/Loading.types.d.ts +1 -1
  356. package/es/Modal/Modal.d.ts +1 -1
  357. package/es/Modal/Modal.js +1 -1
  358. package/es/Modal/Modal.miniapp.d.ts +1 -1
  359. package/es/Modal/Modal.miniapp.js +1 -1
  360. package/es/Modal/__tests__/fixtures/A11yDemos.d.ts +1 -1
  361. package/es/Modal/__tests__/fixtures/A11yDemos.js +1 -1
  362. package/es/Modal/useModal.js +26 -29
  363. package/es/NavBar/NavBar.d.ts +1 -1
  364. package/es/NavBar/NavBar.js +1 -1
  365. package/es/Picker/Picker.js +0 -1
  366. package/es/Picker/Picker.types.d.ts +1 -1
  367. package/es/Picker/__tests__/fixtures/A11yDemos.d.ts +1 -1
  368. package/es/Picker/__tests__/fixtures/A11yDemos.js +1 -1
  369. package/es/Popover/Popover.d.ts +1 -1
  370. package/es/Popover/Popover.js +1 -1
  371. package/es/Popover/Popover.types.d.ts +1 -1
  372. package/es/Popover/__tests__/fixtures/A11yDemos.d.ts +1 -1
  373. package/es/Popover/__tests__/fixtures/A11yDemos.js +1 -1
  374. package/es/Portal/Portal.d.ts +1 -1
  375. package/es/Portal/Portal.js +1 -1
  376. package/es/Portal/Portal.miniapp.js +15 -9
  377. package/es/Portal/Portal.types.d.ts +1 -1
  378. package/es/Progress/Progress.d.ts +1 -1
  379. package/es/Progress/Progress.js +1 -1
  380. package/es/Progress/Progress.types.d.ts +1 -1
  381. package/es/Progress/__tests__/fixtures/A11yDemos.d.ts +1 -1
  382. package/es/Progress/__tests__/fixtures/A11yDemos.js +1 -1
  383. package/es/Radio/RadioButtonIcon.d.ts +1 -1
  384. package/es/Radio/RadioButtonIcon.js +1 -1
  385. package/es/Radio/RadioContext.d.ts +1 -1
  386. package/es/Radio/RadioContext.js +1 -1
  387. package/es/Radio/__tests__/fixtures/A11yDemos.d.ts +1 -1
  388. package/es/Radio/__tests__/fixtures/A11yDemos.js +1 -1
  389. package/es/Rating/Rating.types.d.ts +1 -1
  390. package/es/ScrollView/ScrollView.types.d.ts +210 -1
  391. package/es/ScrollView/__tests__/fixtures/A11yDemos.d.ts +1 -1
  392. package/es/ScrollView/__tests__/fixtures/A11yDemos.js +1 -1
  393. package/es/ScrollView/useScrollView.js +16 -4
  394. package/es/Skeleton/Skeleton.d.ts +1 -1
  395. package/es/Skeleton/Skeleton.js +1 -1
  396. package/es/Skeleton/Skeleton.types.d.ts +1 -1
  397. package/es/Slide/Slide.d.ts +1 -1
  398. package/es/Slide/Slide.js +1 -1
  399. package/es/Slide/Slide.miniapp.js +14 -11
  400. package/es/Slider/Slider.types.d.ts +1 -1
  401. package/es/Steps/Step.types.d.ts +1 -1
  402. package/es/Steps/StepsContext.d.ts +1 -1
  403. package/es/Steps/StepsContext.js +1 -1
  404. package/es/SwipeAction/SwipeAction.js +7 -8
  405. package/es/SwipeAction/SwipeAction.types.d.ts +1 -1
  406. package/es/Swiper/Swiper.js +5 -1
  407. package/es/Swiper/Swiper.types.d.ts +1 -1
  408. package/es/Swiper/SwiperItem.d.ts +1 -1
  409. package/es/Swiper/SwiperItem.js +1 -1
  410. package/es/Switch/__tests__/fixtures/A11yDemos.d.ts +1 -1
  411. package/es/Switch/__tests__/fixtures/A11yDemos.js +1 -1
  412. package/es/TabBar/TabBar.d.ts +1 -1
  413. package/es/TabBar/TabBar.js +1 -1
  414. package/es/Tabs/Tab.css +1 -23
  415. package/es/Tabs/Tab.d.ts +2 -2
  416. package/es/Tabs/Tab.js +44 -36
  417. package/es/Tabs/Tab.types.d.ts +1 -1
  418. package/es/Tabs/TabIndicator.d.ts +11 -0
  419. package/es/Tabs/TabIndicator.js +156 -0
  420. package/es/Tabs/TabMask.d.ts +7 -0
  421. package/es/Tabs/TabMask.js +18 -0
  422. package/es/Tabs/TabPanel.js +8 -4
  423. package/es/Tabs/TabPanel.types.d.ts +1 -1
  424. package/es/Tabs/Tabs.css +14 -6
  425. package/es/Tabs/Tabs.js +100 -158
  426. package/es/Tabs/Tabs.types.d.ts +5 -6
  427. package/es/Tabs/TabsContext.d.ts +15 -6
  428. package/es/Tabs/TabsContext.js +6 -4
  429. package/es/Tabs/classes.d.ts +13 -0
  430. package/es/Tabs/classes.js +28 -0
  431. package/es/Tabs/index.css +15 -29
  432. package/es/Tabs/index.d.ts +2 -2
  433. package/es/Tabs/index.js +2 -2
  434. package/es/Tabs/index.miniapp.d.ts +5 -0
  435. package/es/Tabs/index.miniapp.js +11 -0
  436. package/es/Tabs/miniapp/Tab.d.ts +5 -0
  437. package/es/Tabs/miniapp/Tab.js +77 -0
  438. package/es/Tabs/miniapp/TabIndicator.d.ts +15 -0
  439. package/es/Tabs/miniapp/TabIndicator.js +272 -0
  440. package/es/Tabs/miniapp/Tabs.d.ts +5 -0
  441. package/es/Tabs/miniapp/Tabs.js +229 -0
  442. package/es/Tabs/miniapp/TabsContext.d.ts +17 -0
  443. package/es/Tabs/miniapp/TabsContext.js +16 -0
  444. package/es/Tabs/miniapp/index.d.ts +2 -0
  445. package/es/Tabs/miniapp/index.js +7 -0
  446. package/es/Tabs/miniapp/scroll.d.ts +21 -0
  447. package/es/Tabs/miniapp/scroll.js +29 -0
  448. package/es/Tabs/miniapp/utils/queryBatch.d.ts +68 -0
  449. package/es/Tabs/miniapp/utils/queryBatch.js +65 -0
  450. package/es/Tabs/utils/scroll.js +10 -4
  451. package/es/Tag/Tag.css +0 -1
  452. package/es/Tag/Tag.d.ts +1 -1
  453. package/es/Tag/Tag.js +4 -4
  454. package/es/Tag/Tag.types.d.ts +1 -1
  455. package/es/Tag/TagGroup.d.ts +1 -1
  456. package/es/Tag/TagGroup.js +1 -1
  457. package/es/Tag/TagGroup.types.d.ts +1 -1
  458. package/es/Tag/__tests__/fixtures/A11yDemos.js +3 -3
  459. package/es/Tag/index.css +0 -1
  460. package/es/TextArea/__tests__/fixtures/A11yDemos.d.ts +1 -1
  461. package/es/TextArea/__tests__/fixtures/A11yDemos.js +1 -1
  462. package/es/ThemeProvider/hooks/ThemeContext.d.ts +1 -1
  463. package/es/ThemeProvider/hooks/ThemeContext.js +1 -1
  464. package/es/ThemeProvider/hooks/useTheme.js +1 -1
  465. package/es/ThemeProvider/utils/mountTokens.js +1 -1
  466. package/es/Toast/Toast.d.ts +1 -1
  467. package/es/Toast/Toast.js +1 -1
  468. package/es/Toast/__tests__/fixtures/A11yDemos.d.ts +1 -1
  469. package/es/Toast/__tests__/fixtures/A11yDemos.js +1 -1
  470. package/es/Tooltip/Tooltip.d.ts +1 -1
  471. package/es/Tooltip/Tooltip.js +1 -1
  472. package/es/Tooltip/Tooltip.types.d.ts +1 -1
  473. package/es/Tooltip/__tests__/fixtures/A11yDemos.d.ts +1 -1
  474. package/es/Tooltip/__tests__/fixtures/A11yDemos.js +1 -1
  475. package/es/Transition/Transition.d.ts +1 -1
  476. package/es/Transition/Transition.js +1 -1
  477. package/es/Transition/Transition.miniapp.d.ts +1 -1
  478. package/es/Transition/Transition.miniapp.js +1 -1
  479. package/es/Transition/TransitionCore.js +8 -2
  480. package/es/_.._/benchmarks/components/Button.d.js +0 -0
  481. package/es/_.._/benchmarks/components/Button.js +1 -1
  482. package/es/_.._/benchmarks/components/Input.d.js +0 -0
  483. package/es/_.._/benchmarks/components/Tabs.d.js +0 -0
  484. package/package.json +7 -6
@@ -93,25 +93,31 @@ function useScrollView(parameters) {
93
93
  const scrollVertical = useCallback((top, isAnimation) => {
94
94
  if (top === void 0)
95
95
  return;
96
+ if (!container.current)
97
+ return;
96
98
  if (isAnimation) {
97
99
  easeOutScroll(container.current.scrollTop, top, (pos) => {
98
100
  if (container.current)
99
101
  container.current.scrollTop = pos;
100
102
  });
101
- } else if (container.current)
103
+ } else {
102
104
  container.current.scrollTop = top;
105
+ }
103
106
  }, []);
104
107
  const scrollHorizontal = useCallback(
105
108
  (left, isAnimation) => {
106
109
  if (left === void 0)
107
110
  return;
111
+ if (!container.current)
112
+ return;
108
113
  if (isAnimation) {
109
114
  easeOutScroll(container.current.scrollLeft, left, (pos) => {
110
115
  if (container.current)
111
116
  container.current.scrollLeft = pos;
112
117
  });
113
- } else if (container.current)
118
+ } else {
114
119
  container.current.scrollLeft = left;
120
+ }
115
121
  },
116
122
  []
117
123
  );
@@ -121,9 +127,13 @@ function useScrollView(parameters) {
121
127
  const isAnimation = scrollWithAnimation;
122
128
  if (scrollIntoView && typeof scrollIntoView === "string" && ((_b = (_a2 = container == null ? void 0 : container.current) == null ? void 0 : _a2.querySelector) == null ? void 0 : _b.call(_a2, `#${scrollIntoView}`))) {
123
129
  const doScrollIntoView = (id, alignment = "start", _isAnimation = isAnimation) => {
130
+ if (!container.current)
131
+ return;
124
132
  const target = container.current.querySelector(
125
133
  `#${id}`
126
134
  );
135
+ if (!target)
136
+ return;
127
137
  if (scrollY) {
128
138
  const start = target.offsetTop;
129
139
  const end = target.offsetTop + target.offsetHeight - container.current.clientHeight;
@@ -176,14 +186,14 @@ function useScrollView(parameters) {
176
186
  );
177
187
  }
178
188
  } else {
179
- if (scrollY && typeof scrollTopProp === "number" && scrollTopProp !== container.current.scrollTop) {
189
+ if (scrollY && typeof scrollTopProp === "number" && container.current && scrollTopProp !== container.current.scrollTop) {
180
190
  if (isInit) {
181
191
  setTimeout(() => scrollVertical(scrollTopProp, isAnimation), 10);
182
192
  } else {
183
193
  scrollVertical(scrollTopProp, isAnimation);
184
194
  }
185
195
  }
186
- if (scrollX && typeof scrollLeftProp === "number" && scrollLeftProp !== container.current.scrollLeft) {
196
+ if (scrollX && typeof scrollLeftProp === "number" && container.current && scrollLeftProp !== container.current.scrollLeft) {
187
197
  if (isInit) {
188
198
  setTimeout(() => scrollHorizontal(scrollLeftProp, isAnimation), 10);
189
199
  } else {
@@ -241,6 +251,8 @@ function useScrollView(parameters) {
241
251
  }
242
252
  };
243
253
  const onScrollHandler = (e) => {
254
+ if (!container.current)
255
+ return;
244
256
  const { scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current;
245
257
  Object.defineProperty(e, "detail", {
246
258
  enumerable: true,
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { SkeletonProps } from './Skeleton.types';
3
3
  import './index.less';
4
4
  declare const Skeleton: React.ForwardRefExoticComponent<Omit<SkeletonProps<"div", {}>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
@@ -27,7 +27,7 @@ var __objRest = (source, exclude) => {
27
27
  return target;
28
28
  };
29
29
  import clsx from "clsx";
30
- import React from "react";
30
+ import * as React from "react";
31
31
  import "./index.css";
32
32
  const prefixCls = "bui-skeleton";
33
33
  const Skeleton = /* @__PURE__ */ React.forwardRef(
@@ -1,5 +1,5 @@
1
1
  import { OverrideProps } from '@bifrostui/types';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  export type VariantEnum = 'text' | 'circular' | 'rectangular' | 'rounded';
4
4
  export type animationEnum = 'wave' | 'pulse' | false;
5
5
  export type SkeletonProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { SlideProps } from './Slide.types';
3
3
  declare const Slide: React.ForwardRefExoticComponent<SlideProps & React.RefAttributes<HTMLElement>>;
4
4
  export default Slide;
package/es/Slide/Slide.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  getTransitionProps,
37
37
  useForkRef
38
38
  } from "@bifrostui/utils";
39
- import React from "react";
39
+ import * as React from "react";
40
40
  import Transition from "../Transition";
41
41
  const defaultEasing = {
42
42
  enter: easing.easeOut,
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import React, { useEffect, useState, useRef } from "react";
32
+ import React, { useEffect, useState, useRef, useMemo } from "react";
33
33
  import {
34
34
  createTransitions,
35
35
  duration,
@@ -118,15 +118,18 @@ const Slide = /* @__PURE__ */ React.forwardRef(
118
118
  const transitions = createTransitions();
119
119
  const animationName = getAnimationName(direction, inProp);
120
120
  const animationDurationAndDelay = getAnimationDurationAndDelay();
121
- const animation = transitions.create(
122
- animationName,
123
- getTransitionProps(
124
- __spreadProps(__spreadValues({}, animationDurationAndDelay), {
125
- style,
126
- easing: easingProp
127
- }),
128
- { mode: inProp ? "enter" : "exit" }
129
- )
121
+ const animation = useMemo(
122
+ () => transitions.create(
123
+ animationName,
124
+ getTransitionProps(
125
+ __spreadProps(__spreadValues({}, animationDurationAndDelay), {
126
+ style,
127
+ easing: easingProp
128
+ }),
129
+ { mode: inProp ? "enter" : "exit" }
130
+ )
131
+ ),
132
+ [inProp]
130
133
  );
131
134
  useEffect(() => {
132
135
  if (inProp && !isMounted) {
@@ -147,7 +150,7 @@ const Slide = /* @__PURE__ */ React.forwardRef(
147
150
  } else {
148
151
  onExit == null ? void 0 : onExit(elementRef.current);
149
152
  }
150
- }, [inProp, isMounted, shouldExecuteAnimation, onEnter, onExit]);
153
+ }, [inProp, isMounted]);
151
154
  const handleAnimationStart = () => {
152
155
  if (!shouldExecuteAnimation)
153
156
  return;
@@ -1,5 +1,5 @@
1
1
  import { OverrideProps } from '@bifrostui/types';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  export type SliderValue = number | [number, number];
4
4
  export type SliderProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
5
5
  props: P & {
@@ -1,5 +1,5 @@
1
1
  import { OverrideProps } from '@bifrostui/types';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import { OnChangeEvent } from './Steps.types';
4
4
  export type StatusProps = 'wait' | 'active' | 'finish' | 'error';
5
5
  export type StepProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { StepsContextProps } from './Steps.types';
3
3
  declare const StepsContext: React.Context<StepsContextProps>;
4
4
  export declare const StepsContextProvider: React.Provider<StepsContextProps>;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import * as React from "react";
2
2
  const StepsContext = React.createContext(null);
3
3
  const StepsContextProvider = StepsContext.Provider;
4
4
  var StepsContext_default = StepsContext;
@@ -96,7 +96,7 @@ const SwipeAction = /* @__PURE__ */ React.forwardRef(
96
96
  const startingX = useRef(0);
97
97
  const currentX = useRef(0);
98
98
  const isDragging = useRef(false);
99
- let pretranslateX = 0;
99
+ let preTranslateX = 0;
100
100
  let dragPhase = DragPhaseEnum.START;
101
101
  const dragThreshold = 5;
102
102
  const leftWidthCache = useRef(0);
@@ -163,11 +163,11 @@ const SwipeAction = /* @__PURE__ */ React.forwardRef(
163
163
  100
164
164
  );
165
165
  const emitActionsReveal = (targetX, stop = false) => {
166
- const isSpecial = targetX === pretranslateX && targetX !== 0;
167
- if (targetX === pretranslateX && !isSpecial || stop)
166
+ const isSpecial = targetX === preTranslateX && targetX !== 0;
167
+ if (targetX === preTranslateX && !isSpecial || stop)
168
168
  return;
169
169
  let resStr = null;
170
- const shouldOpen = targetX > 0 && pretranslateX <= 0 || targetX < 0 && pretranslateX >= 0 || isSpecial;
170
+ const shouldOpen = targetX > 0 && preTranslateX <= 0 || targetX < 0 && preTranslateX >= 0 || isSpecial;
171
171
  if (shouldOpen) {
172
172
  if (targetX > 0) {
173
173
  resStr = SideTypeEnum.LEFT;
@@ -202,15 +202,14 @@ const SwipeAction = /* @__PURE__ */ React.forwardRef(
202
202
  }
203
203
  if (dragPhase === DragPhaseEnum.END || isMini) {
204
204
  emitActionsReveal(targetX);
205
- console.log("handleTouchEnd\uFF1A", targetX, e);
206
205
  setTranslateX(targetX);
207
- pretranslateX = targetX;
206
+ preTranslateX = targetX;
208
207
  }
209
208
  currentX.current = 0;
210
209
  });
211
210
  const close = () => {
212
211
  setTranslateX(0);
213
- pretranslateX = 0;
212
+ preTranslateX = 0;
214
213
  setIsOpen(false);
215
214
  };
216
215
  useEffect(() => {
@@ -254,7 +253,7 @@ const SwipeAction = /* @__PURE__ */ React.forwardRef(
254
253
  targetX = yield getLefRefWidth();
255
254
  }
256
255
  setTranslateX(targetX);
257
- pretranslateX = targetX;
256
+ preTranslateX = targetX;
258
257
  emitActionsReveal(targetX);
259
258
  }),
260
259
  close,
@@ -1,5 +1,5 @@
1
1
  import { OverrideProps, ThemeColor } from '@bifrostui/types';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  import { SideTypeEnum } from './constants';
4
4
  export type SwipeActionProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
5
5
  props: P & {
@@ -31,7 +31,11 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import clsx from "clsx";
33
33
  import React, { forwardRef, useEffect, useRef } from "react";
34
- import { Autoplay, EffectFade, Pagination } from "swiper";
34
+ import {
35
+ Autoplay,
36
+ EffectFade,
37
+ Pagination
38
+ } from "swiper";
35
39
  import "swiper/css";
36
40
  import "swiper/css/autoplay";
37
41
  import "swiper/css/pagination";
@@ -1,6 +1,6 @@
1
1
  import { OverrideProps } from '@bifrostui/types';
2
2
  import { SwiperProps as SwiperPropsH5 } from 'swiper/react';
3
- import React from 'react';
3
+ import * as React from 'react';
4
4
  export type SwiperProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
5
5
  props: P & SwiperPropsH5 & {
6
6
  /** 是否显示面板指示点
@@ -1,5 +1,5 @@
1
1
  import { SwiperSlideProps } from 'swiper/react';
2
- import React from 'react';
2
+ import * as React from 'react';
3
3
  declare const SwiperItem: {
4
4
  (props: SwiperSlideProps): React.JSX.Element;
5
5
  displayName: string;
@@ -28,7 +28,7 @@ var __objRest = (source, exclude) => {
28
28
  };
29
29
  import { SwiperSlide } from "swiper/react";
30
30
  import clsx from "clsx";
31
- import React from "react";
31
+ import * as React from "react";
32
32
  const SwiperItem = (props) => {
33
33
  const _a = props, { className, style, children } = _a, restProps = __objRest(_a, ["className", "style", "children"]);
34
34
  const cls = clsx("swiper-slide", className);
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  /**
3
3
  * 自定义 Switch 组件 Demo 集合
4
4
  * 这个文件包含多个测试 demo,展示如何使用 getCustomDemoCodesFromFile 进行无障碍测试
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import * as React from "react";
2
2
  import Switch from "../../Switch";
3
3
  const basicSwitchDemo = () => {
4
4
  return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, /* @__PURE__ */ React.createElement(Switch, null), "Switch"));
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { TabBarProps } from './index.types';
3
3
  import './TabBar.less';
4
4
  declare const TabBar: React.ForwardRefExoticComponent<Omit<TabBarProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -26,7 +26,7 @@ var __objRest = (source, exclude) => {
26
26
  }
27
27
  return target;
28
28
  };
29
- import React from "react";
29
+ import * as React from "react";
30
30
  import clsx from "clsx";
31
31
  import TabBarContext from "./TabBarContext";
32
32
  import "./TabBar.css";
package/es/Tabs/Tab.css CHANGED
@@ -1,5 +1,5 @@
1
1
  .bui-tab {
2
- display: flex;
2
+ display: inline-flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
5
  white-space: nowrap;
@@ -17,30 +17,8 @@
17
17
  .bui-tab-active {
18
18
  color: var(--bui-tab-active-color);
19
19
  font-weight: var(--bui-font-weight-bold);
20
- font-family: var(--bui-tab-active-font-family);
21
- }
22
- .bui-tab-miniapp-active {
23
- color: var(--bui-tab-active-color);
24
- line-height: 1.5;
25
- font-weight: var(--bui-font-weight-bold);
26
- position: relative;
27
- }
28
- .bui-tab-miniapp-active-line {
29
- position: absolute;
30
- bottom: 0;
31
- left: -12px;
32
- right: -12px;
33
- margin: 0 auto !important;
34
- width: 18px;
35
- height: 2px;
36
- transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
37
- background-color: var(--bui-color-primary);
38
20
  }
39
21
  .bui-tab-disabled {
40
22
  opacity: 0.5;
41
23
  pointer-events: none;
42
24
  }
43
- .bui-indicator-invisible {
44
- visibility: hidden;
45
- background-color: transparent;
46
- }
package/es/Tabs/Tab.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TabProps } from './Tab.types';
3
3
  import './Tab.less';
4
- declare const Tab: React.ForwardRefExoticComponent<Omit<TabProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- export default Tab;
4
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<TabProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>>;
5
+ export default _default;
package/es/Tabs/Tab.js CHANGED
@@ -29,43 +29,56 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import React from "react";
32
+ import React, { useEffect, useRef } from "react";
33
33
  import clsx from "clsx";
34
- import { isMini } from "@bifrostui/utils";
34
+ import { isMini, useContextSelector, useForkRef } from "@bifrostui/utils";
35
35
  import TabsContext from "./TabsContext";
36
+ import { tabRootClass, tabActiveClass, tabDisabledClass } from "./classes";
36
37
  import "./Tab.css";
37
- const prefixCls = "bui-tab";
38
38
  const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
39
39
  const _a = props, {
40
40
  className,
41
41
  children,
42
42
  index,
43
43
  disabled = false,
44
- onClick,
45
- role = "tab",
46
- tabIndex,
47
- "aria-selected": ariaSelected,
48
- "aria-disabled": ariaDisabled
44
+ onClick
49
45
  } = _a, others = __objRest(_a, [
50
46
  "className",
51
47
  "children",
52
48
  "index",
53
49
  "disabled",
54
- "onClick",
55
- "role",
56
- "tabIndex",
57
- "aria-selected",
58
- "aria-disabled"
50
+ "onClick"
59
51
  ]);
60
- const tabsContext = React.useContext(TabsContext);
61
- const { value, triggerChange } = tabsContext;
62
- const isActive = index === value;
52
+ const innerRef = useRef(null);
53
+ const handleRef = useForkRef(ref, innerRef);
54
+ const isActive = useContextSelector(
55
+ TabsContext,
56
+ (ctx) => ctx.value === index
57
+ );
58
+ const triggerChange = useContextSelector(
59
+ TabsContext,
60
+ (ctx) => ctx.triggerChange
61
+ );
62
+ const onRegister = useContextSelector(TabsContext, (ctx) => ctx.onRegister);
63
+ const onUnregister = useContextSelector(
64
+ TabsContext,
65
+ (ctx) => ctx.onUnregister
66
+ );
67
+ useEffect(() => {
68
+ if (index !== void 0 && index !== null) {
69
+ onRegister == null ? void 0 : onRegister({ value: index, ref: innerRef });
70
+ }
71
+ return () => {
72
+ if (index !== void 0 && index !== null) {
73
+ onUnregister == null ? void 0 : onUnregister({ value: index });
74
+ }
75
+ };
76
+ }, [onRegister, onUnregister, index]);
63
77
  const rootCls = clsx(
64
- prefixCls,
78
+ tabRootClass,
65
79
  {
66
- [`${prefixCls}-active`]: !isMini && isActive,
67
- [`${prefixCls}-miniapp-active`]: isMini && isActive,
68
- [`${prefixCls}-disabled`]: disabled
80
+ [tabActiveClass]: !isMini && isActive,
81
+ [tabDisabledClass]: disabled
69
82
  },
70
83
  className
71
84
  );
@@ -73,34 +86,29 @@ const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
73
86
  if (disabled)
74
87
  return;
75
88
  e.preventDefault();
76
- triggerChange(e, { index });
89
+ triggerChange == null ? void 0 : triggerChange(e, { index });
77
90
  onClick == null ? void 0 : onClick(e, { index });
78
91
  };
92
+ if (process.env.NODE_ENV !== "production") {
93
+ console.count("Tab render");
94
+ }
79
95
  return /* @__PURE__ */ React.createElement(
80
96
  "div",
81
97
  __spreadProps(__spreadValues({
82
- role,
83
- "aria-selected": ariaSelected != null ? ariaSelected : isActive,
84
- "aria-disabled": ariaDisabled != null ? ariaDisabled : disabled,
85
- tabIndex: tabIndex != null ? tabIndex : disabled ? -1 : 0,
86
- ref,
98
+ role: "tab",
99
+ "aria-selected": isActive,
100
+ "aria-disabled": disabled,
101
+ tabIndex: disabled ? -1 : 0,
102
+ ref: handleRef,
87
103
  className: rootCls
88
104
  }, others), {
89
105
  onClick: handleClick
90
106
  }),
91
- children,
92
- isMini && /* @__PURE__ */ React.createElement(
93
- "div",
94
- {
95
- className: clsx(`${prefixCls}-miniapp-active-line`, {
96
- "bui-indicator-invisible": !isActive
97
- })
98
- }
99
- )
107
+ children
100
108
  );
101
109
  });
102
110
  Tab.displayName = "BuiTab";
103
- var Tab_default = Tab;
111
+ var Tab_default = /* @__PURE__ */ React.memo(Tab);
104
112
  export {
105
113
  Tab_default as default
106
114
  };
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import * as React from 'react';
2
2
  import { OverrideProps } from '@bifrostui/types';
3
3
  import { ITabItem, TabChangeEvent } from './Tabs.types';
4
4
  export type TabProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export interface TabIndicatorProps {
3
+ /** 当前选中的 tab 值 */
4
+ currentValue: string;
5
+ /** 已注册的 tabs 引用映射表 */
6
+ registeredTabs: React.MutableRefObject<Record<string, React.RefObject<HTMLElement>>>;
7
+ /** tabs 容器的引用 */
8
+ tabsContainerRef: React.RefObject<HTMLDivElement>;
9
+ }
10
+ declare const TabIndicator: React.FC<TabIndicatorProps>;
11
+ export default TabIndicator;