@bifrostui/react 1.4.8-beta.0 → 2.0.0-alpha.0

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 (556) hide show
  1. package/dist/ActionSheet/ActionSheet.css +16 -6
  2. package/dist/ActionSheet/ActionSheetItem.css +11 -17
  3. package/dist/ActionSheet/ActionSheetItem.js +3 -8
  4. package/dist/ActionSheet/ActionSheetItem.types.d.ts +2 -2
  5. package/dist/ActionSheet/index.css +89 -0
  6. package/dist/Alert/Alert.types.d.ts +3 -3
  7. package/dist/Alert/index.css +18 -14
  8. package/dist/Avatar/Avatar.css +16 -12
  9. package/dist/Avatar/Avatar.js +3 -8
  10. package/dist/Avatar/AvatarGroup.css +19 -15
  11. package/dist/Avatar/AvatarGroup.js +2 -6
  12. package/dist/Avatar/index.css +93 -0
  13. package/dist/Backdrop/Backdrop.d.ts +1 -1
  14. package/dist/Backdrop/Backdrop.js +1 -1
  15. package/dist/Backdrop/{Backdrop.css → index.css} +6 -2
  16. package/dist/Badge/Badge.d.ts +1 -1
  17. package/dist/Badge/Badge.js +4 -9
  18. package/dist/Badge/Badge.types.d.ts +1 -1
  19. package/dist/Badge/{Badge.css → index.css} +47 -27
  20. package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
  21. package/dist/Breadcrumb/Breadcrumb.js +1 -1
  22. package/dist/Breadcrumb/index.css +38 -0
  23. package/dist/Button/Button.d.ts +1 -1
  24. package/dist/Button/Button.js +6 -11
  25. package/dist/Button/Button.types.d.ts +8 -7
  26. package/{es/Button/Button.css → dist/Button/index.css} +93 -63
  27. package/dist/Calendar/Calendar.d.ts +1 -1
  28. package/dist/Calendar/Calendar.js +10 -22
  29. package/dist/Calendar/Calendar.types.d.ts +0 -5
  30. package/dist/Calendar/{Calendar.css → index.css} +35 -31
  31. package/dist/Card/Card.css +9 -0
  32. package/dist/Card/CardContent.css +1 -2
  33. package/dist/Card/CardFooter.css +2 -4
  34. package/dist/Card/CardHeader.css +5 -5
  35. package/dist/Card/CardHeader.js +2 -2
  36. package/dist/Card/index.css +77 -0
  37. package/dist/Checkbox/Checkbox.d.ts +1 -1
  38. package/dist/Checkbox/Checkbox.js +4 -8
  39. package/dist/Checkbox/CheckboxGroup.d.ts +1 -1
  40. package/dist/Checkbox/CheckboxGroup.js +5 -8
  41. package/dist/Checkbox/{Checkbox.css → index.css} +14 -10
  42. package/dist/CitySelector/CitySelector.miniapp.d.ts +0 -1
  43. package/dist/CitySelector/CitySelector.miniapp.js +0 -1
  44. package/dist/CitySelector/CitySelectorCore.d.ts +1 -1
  45. package/dist/CitySelector/CitySelectorCore.js +1 -1
  46. package/dist/CitySelector/Selector/index.css +4 -4
  47. package/{es/CitySelector/CitySelector.css → dist/CitySelector/index.css} +31 -27
  48. package/dist/Collapse/Collapse.d.ts +2 -2
  49. package/dist/Collapse/Collapse.js +9 -12
  50. package/{es/Collapse/Collapse.css → dist/Collapse/index.css} +1 -0
  51. package/dist/CollapsePanel/CollapsePanel.d.ts +1 -1
  52. package/dist/CollapsePanel/CollapsePanel.js +1 -1
  53. package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
  54. package/{es/CollapsePanel/CollapsePanel.css → dist/CollapsePanel/index.css} +12 -10
  55. package/dist/Countdown/Countdown.d.ts +1 -1
  56. package/dist/Countdown/Countdown.js +6 -13
  57. package/{es/Countdown/Countdown.css → dist/Countdown/index.css} +12 -8
  58. package/dist/Dialog/FunctionalDialog.js +1 -1
  59. package/dist/Dialog/index.css +26 -23
  60. package/dist/Divider/Divider.d.ts +1 -1
  61. package/dist/Divider/Divider.js +9 -6
  62. package/{es/Divider/Divider.css → dist/Divider/index.css} +14 -10
  63. package/dist/Drawer/Drawer.d.ts +1 -1
  64. package/dist/Drawer/Drawer.js +5 -11
  65. package/dist/Drawer/{Drawer.css → index.css} +2 -0
  66. package/dist/Fade/Fade.js +52 -56
  67. package/dist/IconButton/IconButton.d.ts +1 -1
  68. package/dist/IconButton/IconButton.js +7 -14
  69. package/dist/IconButton/IconButton.types.d.ts +4 -3
  70. package/{es/IconButton/IconButton.css → dist/IconButton/index.css} +79 -29
  71. package/dist/Image/Image.js +112 -119
  72. package/dist/Image/index.css +6 -2
  73. package/dist/Input/Input.d.ts +1 -1
  74. package/dist/Input/Input.js +6 -12
  75. package/{es/Input/Input.css → dist/Input/index.css} +22 -18
  76. package/dist/ItemSelector/ItemSelector.miniapp.d.ts +0 -1
  77. package/dist/ItemSelector/ItemSelector.miniapp.js +0 -1
  78. package/dist/ItemSelector/ItemSelectorCore.d.ts +1 -1
  79. package/dist/ItemSelector/ItemSelectorCore.js +1 -1
  80. package/dist/List/List.css +7 -3
  81. package/dist/List/List.js +3 -8
  82. package/dist/List/ListItem.css +3 -3
  83. package/dist/List/ListItem.js +42 -44
  84. package/dist/List/ListItemContent.js +1 -4
  85. package/dist/List/ListItemExtra.js +9 -4
  86. package/dist/List/ListItemFooter.js +9 -4
  87. package/dist/List/ListItemHeader.js +9 -4
  88. package/dist/List/index.css +80 -0
  89. package/dist/Loading/Loading.d.ts +1 -1
  90. package/dist/Loading/Loading.js +14 -5
  91. package/{es/Loading/Loading.css → dist/Loading/index.css} +10 -6
  92. package/dist/Modal/Modal.d.ts +1 -1
  93. package/dist/Modal/Modal.js +1 -7
  94. package/dist/Modal/Modal.miniapp.d.ts +2 -2
  95. package/dist/Modal/Modal.miniapp.js +5 -11
  96. package/dist/NavBar/NavBar.d.ts +1 -1
  97. package/dist/NavBar/NavBar.js +1 -2
  98. package/dist/NavBar/index.css +65 -0
  99. package/dist/Picker/Picker.css +21 -21
  100. package/dist/Picker/Picker.js +6 -28
  101. package/dist/Picker/Picker.types.d.ts +4 -17
  102. package/dist/Picker/PickerPanel.css +8 -12
  103. package/dist/Picker/PickerPanel.js +39 -29
  104. package/dist/Picker/index.css +116 -0
  105. package/dist/Popover/Popover.d.ts +1 -1
  106. package/dist/Popover/Popover.js +28 -71
  107. package/{es/Popover/Popover.css → dist/Popover/index.css} +32 -28
  108. package/dist/Portal/Portal.miniapp.js +4 -7
  109. package/dist/Progress/Progress.d.ts +1 -1
  110. package/dist/Progress/Progress.js +1 -1
  111. package/dist/Progress/index.css +28 -0
  112. package/dist/Radio/Radio.d.ts +1 -1
  113. package/dist/Radio/Radio.js +3 -7
  114. package/dist/Radio/RadioButtonIcon.js +6 -1
  115. package/dist/Radio/RadioGroup.d.ts +1 -1
  116. package/dist/Radio/RadioGroup.js +1 -4
  117. package/dist/Radio/{Radio.css → index.css} +10 -7
  118. package/dist/Rating/Rating.d.ts +1 -1
  119. package/dist/Rating/Rating.js +9 -19
  120. package/{es/Rating/Rating.css → dist/Rating/index.css} +20 -7
  121. package/dist/ScrollView/ScrollView.d.ts +1 -1
  122. package/dist/ScrollView/ScrollView.js +12 -25
  123. package/dist/ScrollView/ScrollView.types.d.ts +1 -0
  124. package/dist/Select/Select.d.ts +1 -1
  125. package/dist/Select/Select.js +43 -76
  126. package/dist/Select/SelectOption.d.ts +1 -1
  127. package/dist/Select/SelectOption.js +1 -1
  128. package/dist/Select/{Select.css → index.css} +30 -20
  129. package/dist/Skeleton/Skeleton.d.ts +1 -1
  130. package/dist/Skeleton/Skeleton.js +6 -10
  131. package/dist/Skeleton/{Skeleton.css → index.css} +7 -3
  132. package/dist/Slide/Slide.js +69 -74
  133. package/dist/Slider/Slider.d.ts +1 -1
  134. package/dist/Slider/Slider.js +13 -29
  135. package/dist/Slider/index.css +111 -0
  136. package/dist/Stack/Stack.d.ts +1 -1
  137. package/dist/Stack/Stack.js +1 -1
  138. package/dist/Steps/Step.css +14 -14
  139. package/dist/Steps/Step.js +81 -82
  140. package/dist/Steps/Steps.css +18 -14
  141. package/dist/Steps/Steps.d.ts +1 -1
  142. package/dist/Steps/Steps.js +57 -60
  143. package/dist/Steps/index.css +199 -0
  144. package/dist/Swiper/Swiper.d.ts +1 -1
  145. package/dist/Swiper/Swiper.js +1 -1
  146. package/{es/Swiper/Swiper.css → dist/Swiper/index.css} +6 -2
  147. package/dist/Switch/Switch.d.ts +1 -1
  148. package/dist/Switch/Switch.js +76 -79
  149. package/dist/Switch/Switch.types.d.ts +1 -1
  150. package/{es/Switch/Switch.css → dist/Switch/index.css} +46 -35
  151. package/dist/TabBar/TabBar.css +12 -8
  152. package/dist/TabBar/TabBar.js +3 -8
  153. package/dist/TabBar/TabBarContext.d.ts +3 -3
  154. package/dist/TabBar/TabBarItem.css +6 -0
  155. package/dist/TabBar/TabBarItem.js +3 -3
  156. package/dist/TabBar/index.css +59 -0
  157. package/dist/TabBar/index.types.d.ts +3 -3
  158. package/dist/Tabs/Tab.css +10 -16
  159. package/dist/Tabs/Tab.js +2 -3
  160. package/dist/Tabs/Tabs.css +32 -21
  161. package/dist/Tabs/Tabs.js +39 -70
  162. package/dist/Tabs/Tabs.types.d.ts +0 -10
  163. package/dist/Tabs/index.css +135 -0
  164. package/dist/Tabs/utils/bound.d.ts +1 -0
  165. package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
  166. package/dist/Tag/Tag.css +49 -23
  167. package/dist/Tag/Tag.js +3 -7
  168. package/dist/Tag/Tag.types.d.ts +4 -4
  169. package/dist/Tag/TagGroup.css +15 -11
  170. package/dist/Tag/TagGroup.d.ts +2 -2
  171. package/dist/Tag/TagGroup.js +16 -14
  172. package/dist/Tag/index.css +182 -0
  173. package/dist/TextArea/TextArea.d.ts +1 -1
  174. package/dist/TextArea/TextArea.js +6 -13
  175. package/dist/TextArea/index.css +57 -0
  176. package/dist/ThemeProvider/ThemeProvider.js +1 -4
  177. package/dist/ThemeProvider/ThemeProvider.types.d.ts +5 -10
  178. package/dist/ThemeProvider/utils/constants.d.ts +1 -1
  179. package/dist/ThemeProvider/utils/constants.js +4 -1
  180. package/dist/ThemeProvider/utils/mountTokens.d.ts +4 -4
  181. package/dist/Toast/FunctionalToast.js +1 -1
  182. package/dist/Toast/Toast.d.ts +1 -1
  183. package/dist/Toast/Toast.js +5 -5
  184. package/dist/Toast/index.css +58 -0
  185. package/dist/Tooltip/Tooltip.d.ts +1 -1
  186. package/dist/Tooltip/Tooltip.js +28 -71
  187. package/dist/Tooltip/index.css +95 -0
  188. package/dist/Transition/TransitionCore.js +3 -8
  189. package/dist/index.d.ts +0 -6
  190. package/dist/index.js +1 -13
  191. package/dist/locales/base.d.ts +0 -11
  192. package/dist/locales/en-US.js +0 -24
  193. package/dist/locales/zh-CN.js +0 -24
  194. package/dist/locales/zh-TW.js +0 -24
  195. package/es/ActionSheet/ActionSheet.css +16 -6
  196. package/es/ActionSheet/ActionSheetItem.css +11 -17
  197. package/es/ActionSheet/ActionSheetItem.js +3 -8
  198. package/es/ActionSheet/ActionSheetItem.types.d.ts +2 -2
  199. package/es/ActionSheet/index.css +89 -0
  200. package/es/Alert/Alert.types.d.ts +3 -3
  201. package/es/Alert/index.css +18 -14
  202. package/es/Avatar/Avatar.css +16 -12
  203. package/es/Avatar/Avatar.js +3 -8
  204. package/es/Avatar/AvatarGroup.css +19 -15
  205. package/es/Avatar/AvatarGroup.js +2 -6
  206. package/es/Avatar/index.css +93 -0
  207. package/es/Backdrop/Backdrop.d.ts +1 -1
  208. package/es/Backdrop/Backdrop.js +1 -1
  209. package/es/Backdrop/{Backdrop.css → index.css} +6 -2
  210. package/es/Badge/Badge.d.ts +1 -1
  211. package/es/Badge/Badge.js +4 -9
  212. package/es/Badge/Badge.types.d.ts +1 -1
  213. package/es/Badge/{Badge.css → index.css} +47 -27
  214. package/es/Breadcrumb/Breadcrumb.d.ts +1 -1
  215. package/es/Breadcrumb/Breadcrumb.js +1 -1
  216. package/es/Breadcrumb/index.css +38 -0
  217. package/es/Button/Button.d.ts +1 -1
  218. package/es/Button/Button.js +6 -11
  219. package/es/Button/Button.types.d.ts +8 -7
  220. package/{dist/Button/Button.css → es/Button/index.css} +93 -63
  221. package/es/Calendar/Calendar.d.ts +1 -1
  222. package/es/Calendar/Calendar.js +10 -22
  223. package/es/Calendar/Calendar.types.d.ts +0 -5
  224. package/es/Calendar/{Calendar.css → index.css} +35 -31
  225. package/es/Card/Card.css +9 -0
  226. package/es/Card/CardContent.css +1 -2
  227. package/es/Card/CardFooter.css +2 -4
  228. package/es/Card/CardHeader.css +5 -5
  229. package/es/Card/CardHeader.js +2 -2
  230. package/es/Card/index.css +77 -0
  231. package/es/Checkbox/Checkbox.d.ts +1 -1
  232. package/es/Checkbox/Checkbox.js +4 -8
  233. package/es/Checkbox/CheckboxGroup.d.ts +1 -1
  234. package/es/Checkbox/CheckboxGroup.js +5 -8
  235. package/es/Checkbox/{Checkbox.css → index.css} +14 -10
  236. package/es/CitySelector/CitySelector.miniapp.d.ts +0 -1
  237. package/es/CitySelector/CitySelector.miniapp.js +0 -1
  238. package/es/CitySelector/CitySelectorCore.d.ts +1 -1
  239. package/es/CitySelector/CitySelectorCore.js +1 -1
  240. package/es/CitySelector/Selector/index.css +4 -4
  241. package/{dist/CitySelector/CitySelector.css → es/CitySelector/index.css} +31 -27
  242. package/es/Collapse/Collapse.d.ts +2 -2
  243. package/es/Collapse/Collapse.js +9 -12
  244. package/{dist/Collapse/Collapse.css → es/Collapse/index.css} +1 -0
  245. package/es/CollapsePanel/CollapsePanel.d.ts +1 -1
  246. package/es/CollapsePanel/CollapsePanel.js +1 -1
  247. package/es/CollapsePanel/CollapsePanelItem.js +45 -46
  248. package/{dist/CollapsePanel/CollapsePanel.css → es/CollapsePanel/index.css} +12 -10
  249. package/es/Countdown/Countdown.d.ts +1 -1
  250. package/es/Countdown/Countdown.js +6 -13
  251. package/{dist/Countdown/Countdown.css → es/Countdown/index.css} +12 -8
  252. package/es/Dialog/FunctionalDialog.js +2 -2
  253. package/es/Dialog/index.css +26 -23
  254. package/es/Divider/Divider.d.ts +1 -1
  255. package/es/Divider/Divider.js +9 -6
  256. package/{dist/Divider/Divider.css → es/Divider/index.css} +14 -10
  257. package/es/Drawer/Drawer.d.ts +1 -1
  258. package/es/Drawer/Drawer.js +5 -11
  259. package/es/Drawer/{Drawer.css → index.css} +2 -0
  260. package/es/Fade/Fade.js +52 -56
  261. package/es/IconButton/IconButton.d.ts +1 -1
  262. package/es/IconButton/IconButton.js +7 -14
  263. package/es/IconButton/IconButton.types.d.ts +4 -3
  264. package/{dist/IconButton/IconButton.css → es/IconButton/index.css} +79 -29
  265. package/es/Image/Image.js +112 -119
  266. package/es/Image/index.css +6 -2
  267. package/es/Input/Input.d.ts +1 -1
  268. package/es/Input/Input.js +6 -12
  269. package/{dist/Input/Input.css → es/Input/index.css} +22 -18
  270. package/es/ItemSelector/ItemSelector.miniapp.d.ts +0 -1
  271. package/es/ItemSelector/ItemSelector.miniapp.js +0 -1
  272. package/es/ItemSelector/ItemSelectorCore.d.ts +1 -1
  273. package/es/ItemSelector/ItemSelectorCore.js +1 -1
  274. package/es/List/List.css +7 -3
  275. package/es/List/List.js +3 -8
  276. package/es/List/ListItem.css +3 -3
  277. package/es/List/ListItem.js +42 -44
  278. package/es/List/ListItemContent.js +1 -4
  279. package/es/List/ListItemExtra.js +9 -4
  280. package/es/List/ListItemFooter.js +9 -4
  281. package/es/List/ListItemHeader.js +9 -4
  282. package/es/List/index.css +80 -0
  283. package/es/Loading/Loading.d.ts +1 -1
  284. package/es/Loading/Loading.js +14 -5
  285. package/{dist/Loading/Loading.css → es/Loading/index.css} +10 -6
  286. package/es/Modal/Modal.d.ts +1 -1
  287. package/es/Modal/Modal.js +1 -7
  288. package/es/Modal/Modal.miniapp.d.ts +2 -2
  289. package/es/Modal/Modal.miniapp.js +5 -11
  290. package/es/NavBar/NavBar.d.ts +1 -1
  291. package/es/NavBar/NavBar.js +1 -2
  292. package/es/NavBar/index.css +65 -0
  293. package/es/Picker/Picker.css +21 -21
  294. package/es/Picker/Picker.js +6 -28
  295. package/es/Picker/Picker.types.d.ts +4 -17
  296. package/es/Picker/PickerPanel.css +8 -12
  297. package/es/Picker/PickerPanel.js +52 -31
  298. package/es/Picker/index.css +116 -0
  299. package/es/Popover/Popover.d.ts +1 -1
  300. package/es/Popover/Popover.js +30 -74
  301. package/{dist/Popover/Popover.css → es/Popover/index.css} +32 -28
  302. package/es/Portal/Portal.miniapp.js +5 -8
  303. package/es/Progress/Progress.d.ts +1 -1
  304. package/es/Progress/Progress.js +1 -1
  305. package/es/Progress/index.css +28 -0
  306. package/es/Radio/Radio.d.ts +1 -1
  307. package/es/Radio/Radio.js +3 -7
  308. package/es/Radio/RadioButtonIcon.js +6 -1
  309. package/es/Radio/RadioGroup.d.ts +1 -1
  310. package/es/Radio/RadioGroup.js +1 -4
  311. package/es/Radio/{Radio.css → index.css} +10 -7
  312. package/es/Rating/Rating.d.ts +1 -1
  313. package/es/Rating/Rating.js +9 -19
  314. package/{dist/Rating/Rating.css → es/Rating/index.css} +20 -7
  315. package/es/ScrollView/ScrollView.d.ts +1 -1
  316. package/es/ScrollView/ScrollView.js +12 -25
  317. package/es/ScrollView/ScrollView.types.d.ts +1 -0
  318. package/es/Select/Select.d.ts +1 -1
  319. package/es/Select/Select.js +44 -76
  320. package/es/Select/SelectOption.d.ts +1 -1
  321. package/es/Select/SelectOption.js +1 -1
  322. package/es/Select/{Select.css → index.css} +30 -20
  323. package/es/Skeleton/Skeleton.d.ts +1 -1
  324. package/es/Skeleton/Skeleton.js +6 -10
  325. package/es/Skeleton/{Skeleton.css → index.css} +7 -3
  326. package/es/Slide/Slide.js +69 -74
  327. package/es/Slider/Slider.d.ts +1 -1
  328. package/es/Slider/Slider.js +14 -32
  329. package/es/Slider/index.css +111 -0
  330. package/es/Stack/Stack.d.ts +1 -1
  331. package/es/Stack/Stack.js +1 -1
  332. package/es/Steps/Step.css +14 -14
  333. package/es/Steps/Step.js +81 -82
  334. package/es/Steps/Steps.css +18 -14
  335. package/es/Steps/Steps.d.ts +1 -1
  336. package/es/Steps/Steps.js +57 -60
  337. package/es/Steps/index.css +199 -0
  338. package/es/Swiper/Swiper.d.ts +1 -1
  339. package/es/Swiper/Swiper.js +1 -1
  340. package/{dist/Swiper/Swiper.css → es/Swiper/index.css} +6 -2
  341. package/es/Switch/Switch.d.ts +1 -1
  342. package/es/Switch/Switch.js +76 -79
  343. package/es/Switch/Switch.types.d.ts +1 -1
  344. package/{dist/Switch/Switch.css → es/Switch/index.css} +46 -35
  345. package/es/TabBar/TabBar.css +12 -8
  346. package/es/TabBar/TabBar.js +3 -8
  347. package/es/TabBar/TabBarContext.d.ts +3 -3
  348. package/es/TabBar/TabBarItem.css +6 -0
  349. package/es/TabBar/TabBarItem.js +2 -2
  350. package/es/TabBar/index.css +59 -0
  351. package/es/TabBar/index.types.d.ts +3 -3
  352. package/es/Tabs/Tab.css +10 -16
  353. package/es/Tabs/Tab.js +2 -3
  354. package/es/Tabs/Tabs.css +32 -21
  355. package/es/Tabs/Tabs.js +41 -83
  356. package/es/Tabs/Tabs.types.d.ts +0 -10
  357. package/es/Tabs/index.css +135 -0
  358. package/es/Tabs/utils/bound.d.ts +1 -0
  359. package/es/Tabs/utils/bound.js +13 -0
  360. package/es/Tag/Tag.css +49 -23
  361. package/es/Tag/Tag.js +3 -7
  362. package/es/Tag/Tag.types.d.ts +4 -4
  363. package/es/Tag/TagGroup.css +15 -11
  364. package/es/Tag/TagGroup.d.ts +2 -2
  365. package/es/Tag/TagGroup.js +16 -14
  366. package/es/Tag/index.css +182 -0
  367. package/es/TextArea/TextArea.d.ts +1 -1
  368. package/es/TextArea/TextArea.js +6 -13
  369. package/es/TextArea/index.css +57 -0
  370. package/es/ThemeProvider/ThemeProvider.js +1 -4
  371. package/es/ThemeProvider/ThemeProvider.types.d.ts +5 -10
  372. package/es/ThemeProvider/utils/constants.d.ts +1 -1
  373. package/es/ThemeProvider/utils/constants.js +4 -1
  374. package/es/ThemeProvider/utils/mountTokens.d.ts +4 -4
  375. package/es/Toast/FunctionalToast.js +2 -2
  376. package/es/Toast/Toast.d.ts +1 -1
  377. package/es/Toast/Toast.js +5 -5
  378. package/es/Toast/index.css +58 -0
  379. package/es/Tooltip/Tooltip.d.ts +1 -1
  380. package/es/Tooltip/Tooltip.js +30 -74
  381. package/es/Tooltip/index.css +95 -0
  382. package/es/Transition/TransitionCore.js +3 -8
  383. package/es/index.d.ts +0 -6
  384. package/es/index.js +0 -6
  385. package/es/locales/base.d.ts +0 -11
  386. package/es/locales/en-US.js +0 -24
  387. package/es/locales/zh-CN.js +0 -24
  388. package/es/locales/zh-TW.js +0 -24
  389. package/package.json +14 -6
  390. package/dist/Breadcrumb/Breadcrumb.css +0 -34
  391. package/dist/CitySelector/miniapp.css +0 -4
  392. package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
  393. package/dist/Collapse/Collapse.miniapp.js +0 -177
  394. package/dist/DatePicker/DatePicker.d.ts +0 -4
  395. package/dist/DatePicker/DatePicker.js +0 -335
  396. package/dist/DatePicker/DatePicker.types.d.ts +0 -36
  397. package/dist/DatePicker/DatePicker.types.js +0 -15
  398. package/dist/DatePicker/constants.d.ts +0 -9
  399. package/dist/DatePicker/constants.js +0 -37
  400. package/dist/DatePicker/index.d.ts +0 -3
  401. package/dist/DatePicker/index.js +0 -44
  402. package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  403. package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
  404. package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  405. package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
  406. package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  407. package/dist/DesktopDatePicker/index.css +0 -61
  408. package/dist/DesktopDatePicker/index.d.ts +0 -2
  409. package/dist/DesktopDatePicker/index.js +0 -41
  410. package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  411. package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
  412. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  413. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
  414. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  415. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
  416. package/dist/DesktopDateTimePicker/index.css +0 -66
  417. package/dist/DesktopDateTimePicker/index.d.ts +0 -2
  418. package/dist/DesktopDateTimePicker/index.js +0 -41
  419. package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
  420. package/dist/DesktopPicker/DesktopPicker.js +0 -238
  421. package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  422. package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
  423. package/dist/DesktopPicker/index.css +0 -37
  424. package/dist/DesktopPicker/index.d.ts +0 -2
  425. package/dist/DesktopPicker/index.js +0 -41
  426. package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  427. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  428. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
  429. package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  430. package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
  431. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  432. package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
  433. package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  434. package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
  435. package/dist/DesktopTimePicker/index.css +0 -170
  436. package/dist/DesktopTimePicker/index.d.ts +0 -2
  437. package/dist/DesktopTimePicker/index.js +0 -41
  438. package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  439. package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -249
  440. package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  441. package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
  442. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  443. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
  444. package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
  445. package/dist/DesktopTimePicker/utils/utils.js +0 -408
  446. package/dist/ItemSelector/miniapp.css +0 -4
  447. package/dist/NavBar/NavBar.css +0 -61
  448. package/dist/Progress/Progress.css +0 -24
  449. package/dist/Slider/Slider.css +0 -106
  450. package/dist/SwipeAction/SwipeAction.css +0 -79
  451. package/dist/SwipeAction/SwipeAction.d.ts +0 -5
  452. package/dist/SwipeAction/SwipeAction.js +0 -349
  453. package/dist/SwipeAction/SwipeAction.types.d.ts +0 -75
  454. package/dist/SwipeAction/SwipeAction.types.js +0 -15
  455. package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
  456. package/dist/SwipeAction/SwipeActionContext.js +0 -30
  457. package/dist/SwipeAction/SwipeActionItem.css +0 -31
  458. package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
  459. package/dist/SwipeAction/SwipeActionItem.js +0 -105
  460. package/dist/SwipeAction/constants.d.ts +0 -9
  461. package/dist/SwipeAction/constants.js +0 -39
  462. package/dist/SwipeAction/index.d.ts +0 -5
  463. package/dist/SwipeAction/index.js +0 -50
  464. package/dist/Tabs/utils/scroll.d.ts +0 -2
  465. package/dist/Tabs/utils/scroll.js +0 -55
  466. package/dist/TextArea/TextArea.css +0 -53
  467. package/dist/Toast/Toast.css +0 -53
  468. package/dist/Tooltip/Tooltip.css +0 -91
  469. package/es/Breadcrumb/Breadcrumb.css +0 -34
  470. package/es/CitySelector/miniapp.css +0 -4
  471. package/es/Collapse/Collapse.miniapp.d.ts +0 -5
  472. package/es/Collapse/Collapse.miniapp.js +0 -157
  473. package/es/DatePicker/DatePicker.d.ts +0 -4
  474. package/es/DatePicker/DatePicker.js +0 -308
  475. package/es/DatePicker/DatePicker.types.d.ts +0 -36
  476. package/es/DatePicker/DatePicker.types.js +0 -1
  477. package/es/DatePicker/constants.d.ts +0 -9
  478. package/es/DatePicker/constants.js +0 -14
  479. package/es/DatePicker/index.d.ts +0 -3
  480. package/es/DatePicker/index.js +0 -8
  481. package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  482. package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
  483. package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  484. package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
  485. package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  486. package/es/DesktopDatePicker/index.css +0 -61
  487. package/es/DesktopDatePicker/index.d.ts +0 -2
  488. package/es/DesktopDatePicker/index.js +0 -6
  489. package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  490. package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
  491. package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  492. package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
  493. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  494. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
  495. package/es/DesktopDateTimePicker/index.css +0 -66
  496. package/es/DesktopDateTimePicker/index.d.ts +0 -2
  497. package/es/DesktopDateTimePicker/index.js +0 -9
  498. package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
  499. package/es/DesktopPicker/DesktopPicker.js +0 -221
  500. package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  501. package/es/DesktopPicker/DesktopPicker.types.js +0 -1
  502. package/es/DesktopPicker/index.css +0 -37
  503. package/es/DesktopPicker/index.d.ts +0 -2
  504. package/es/DesktopPicker/index.js +0 -6
  505. package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  506. package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
  507. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  508. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
  509. package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  510. package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
  511. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  512. package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
  513. package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  514. package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
  515. package/es/DesktopTimePicker/index.css +0 -170
  516. package/es/DesktopTimePicker/index.d.ts +0 -2
  517. package/es/DesktopTimePicker/index.js +0 -6
  518. package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  519. package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -226
  520. package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  521. package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
  522. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  523. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
  524. package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
  525. package/es/DesktopTimePicker/utils/utils.js +0 -365
  526. package/es/ItemSelector/miniapp.css +0 -4
  527. package/es/NavBar/NavBar.css +0 -61
  528. package/es/Progress/Progress.css +0 -24
  529. package/es/Slider/Slider.css +0 -106
  530. package/es/SwipeAction/SwipeAction.css +0 -79
  531. package/es/SwipeAction/SwipeAction.d.ts +0 -5
  532. package/es/SwipeAction/SwipeAction.js +0 -334
  533. package/es/SwipeAction/SwipeAction.types.d.ts +0 -75
  534. package/es/SwipeAction/SwipeAction.types.js +0 -1
  535. package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
  536. package/es/SwipeAction/SwipeActionContext.js +0 -11
  537. package/es/SwipeAction/SwipeActionItem.css +0 -31
  538. package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
  539. package/es/SwipeAction/SwipeActionItem.js +0 -78
  540. package/es/SwipeAction/constants.d.ts +0 -9
  541. package/es/SwipeAction/constants.js +0 -15
  542. package/es/SwipeAction/index.d.ts +0 -5
  543. package/es/SwipeAction/index.js +0 -12
  544. package/es/Tabs/utils/scroll.d.ts +0 -2
  545. package/es/Tabs/utils/scroll.js +0 -36
  546. package/es/TextArea/TextArea.css +0 -53
  547. package/es/Toast/Toast.css +0 -53
  548. package/es/Tooltip/Tooltip.css +0 -91
  549. /package/dist/ItemSelector/{ItemSelector.css → index.css} +0 -0
  550. /package/dist/Modal/{Modal.css → index.css} +0 -0
  551. /package/dist/ScrollView/{ScrollView.css → index.css} +0 -0
  552. /package/dist/Stack/{Stack.css → index.css} +0 -0
  553. /package/es/ItemSelector/{ItemSelector.css → index.css} +0 -0
  554. /package/es/Modal/{Modal.css → index.css} +0 -0
  555. /package/es/ScrollView/{ScrollView.css → index.css} +0 -0
  556. /package/es/Stack/{Stack.css → index.css} +0 -0
@@ -0,0 +1,65 @@
1
+ :root,
2
+ page,
3
+ xhs-page {
4
+ --bui-navbar-width: 100%;
5
+ --bui-navbar-height: 45px;
6
+ --bui-navbar-padding: 0 8px;
7
+ --bui-navbar-title-padding: 0 8px;
8
+ --bui-navbar-icon-font-size: 24px;
9
+ --bui-navbar-background-color: var(--bui-color-white);
10
+ --bui-navbar-border-bottom: none;
11
+ --bui-navbar-z-index: auto;
12
+ --bui-navbar-title-max-width: 60%;
13
+ }
14
+ .bui-navbar {
15
+ position: relative;
16
+ width: var(--bui-navbar-width);
17
+ height: var(--bui-navbar-height);
18
+ box-sizing: border-box;
19
+ padding: var(--bui-navbar-padding);
20
+ display: flex;
21
+ justify-content: center;
22
+ align-items: center;
23
+ background-color: var(--bui-navbar-background-color);
24
+ border-bottom: var(--bui-navbar-border-bottom);
25
+ user-select: none;
26
+ z-index: var(--bui-navbar-z-index);
27
+ font-family: var(--bui-font-family);
28
+ }
29
+ .bui-navbar-fixed {
30
+ position: fixed;
31
+ top: 0;
32
+ left: 0;
33
+ width: 100%;
34
+ }
35
+ .bui-navbar-title {
36
+ max-width: var(--bui-navbar-title-max-width);
37
+ padding: var(--bui-navbar-title-padding);
38
+ font-size: var(--bui-title-size-2);
39
+ width: auto;
40
+ overflow: hidden;
41
+ text-overflow: ellipsis;
42
+ white-space: nowrap;
43
+ }
44
+ .bui-navbar-left,
45
+ .bui-navbar-right {
46
+ flex: 1;
47
+ display: flex;
48
+ align-items: center;
49
+ font-size: var(--bui-title-size-3);
50
+ }
51
+ .bui-navbar-left {
52
+ justify-content: flex-start;
53
+ text-align: left;
54
+ }
55
+ .bui-navbar-right {
56
+ justify-content: flex-end;
57
+ text-align: right;
58
+ align-self: stretch;
59
+ }
60
+ .bui-navbar-icon {
61
+ font-size: var(--bui-navbar-icon-font-size);
62
+ }
63
+ .bui-navbar-placeholder {
64
+ width: 100%;
65
+ }
@@ -1,32 +1,36 @@
1
+ :root,
2
+ page,
3
+ xhs-page {
4
+ --bui-picker-header-height: 50px;
5
+ --bui-picker-header-padding: 0 var(--bui-spacing-lg);
6
+ --bui-picker-cancel-height: 100%;
7
+ --bui-picker-cancel-line-height: 50px;
8
+ --bui-picker-confirm-height: 100%;
9
+ --bui-picker-confirm-line-height: 50px;
10
+ --bui-picker-panel-height: 260px;
11
+ --bui-picker-indicator-top: 108px;
12
+ --bui-picker-option-height: 36px;
13
+ --bui-picker-option-font-size: var(--bui-title-size-4);
14
+ }
1
15
  .bui-picker {
2
- --header-height: var(--bui-picker-header-height, 50px);
3
- --header-padding: var(--bui-picker-header-padding, 0 var(--bui-spacing-lg));
4
- --cancel-height: var(--bui-picker-cancel-height, 100%);
5
- --cancel-line-height: var(--bui-picker-cancel-line-height, 50px);
6
- --confirm-height: var(--bui-picker-confirm-height, 100%);
7
- --confirm-line-height: var(--bui-picker-confirm-line-height, 50px);
8
- --panel-container-height: var(--bui-picker-panel-height, 260px);
9
- --indicator-top: var(--bui-picker-indicator-top, 108px);
10
- --option-height: var(--bui-picker-option-height, 36px);
11
- --bui-picker-confirm-disabled-opacity: 0.38;
12
16
  font-family: var(--bui-font-family);
13
17
  }
14
18
  .bui-picker .bui-drawer-content {
15
19
  border-radius: var(--bui-shape-radius-drawer) var(--bui-shape-radius-drawer) 0 0;
16
20
  }
17
21
  .bui-picker-header {
18
- height: var(--header-height);
22
+ height: var(--bui-picker-header-height);
19
23
  display: flex;
20
24
  align-items: center;
21
25
  justify-content: space-between;
22
- padding: var(--header-padding);
26
+ padding: var(--bui-picker-header-padding);
23
27
  }
24
28
  .bui-picker-cancel {
25
29
  cursor: pointer;
26
- height: var(--cancel-height);
30
+ height: var(--bui-picker-cancel-height);
27
31
  font-size: var(--bui-title-size-4);
28
32
  text-align: center;
29
- line-height: var(--cancel-line-height);
33
+ line-height: var(--bui-picker-cancel-line-height);
30
34
  color: var(--bui-color-fg-default);
31
35
  }
32
36
  .bui-picker-title {
@@ -36,19 +40,15 @@
36
40
  }
37
41
  .bui-picker-confirm {
38
42
  cursor: pointer;
39
- height: var(--confirm-height);
43
+ height: var(--bui-picker-confirm-height);
40
44
  font-size: var(--bui-title-size-4);
41
45
  text-align: center;
42
- line-height: var(--confirm-line-height);
46
+ line-height: var(--bui-picker-confirm-line-height);
43
47
  color: var(--bui-color-primary);
44
48
  }
45
- .bui-picker-confirm-disabled {
46
- color: var(--bui-color-fg-default);
47
- opacity: var(--bui-picker-confirm-disabled-opacity);
48
- }
49
49
  .bui-picker-container {
50
50
  width: 100%;
51
- height: var(--panel-container-height);
51
+ height: var(--bui-picker-panel-height);
52
52
  display: flex;
53
53
  overflow: hidden;
54
54
  }
@@ -37,12 +37,6 @@ import { useLocaleText } from "../locales";
37
37
  import { formatOptions, pickerPanelType, safeData } from "./utils";
38
38
  import "./Picker.css";
39
39
  const prefixCls = "bui-picker";
40
- const checkDisabled = (values, columns) => values.find(
41
- (value, index) => {
42
- var _a, _b;
43
- return (_b = (_a = columns == null ? void 0 : columns[index]) == null ? void 0 : _a.find((column) => (column == null ? void 0 : column.value) === value)) == null ? void 0 : _b.disabled;
44
- }
45
- );
46
40
  const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
47
41
  const _a = props, {
48
42
  className,
@@ -50,8 +44,6 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
50
44
  title,
51
45
  options = [],
52
46
  value,
53
- confirmText: propConfirmText,
54
- cancelText: propCancelText,
55
47
  contentProps,
56
48
  onConfirm,
57
49
  onOptionChange,
@@ -63,8 +55,6 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
63
55
  "title",
64
56
  "options",
65
57
  "value",
66
- "confirmText",
67
- "cancelText",
68
58
  "contentProps",
69
59
  "onConfirm",
70
60
  "onOptionChange",
@@ -76,7 +66,6 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
76
66
  const [columns, setColumns] = useState([]);
77
67
  const [internalValue, setInternalValue] = useState([]);
78
68
  const { cancel: cancelText, confirm: confirmText } = useLocaleText("picker");
79
- const disabled = checkDisabled(internalValue, columns);
80
69
  useEffect(() => {
81
70
  if (!open)
82
71
  return;
@@ -99,7 +88,7 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
99
88
  }, [value, options]);
100
89
  const confirm = (e) => {
101
90
  const isMoving = rollerRefs.current.some((roller) => roller == null ? void 0 : roller.isMoving);
102
- if (isMoving || disabled)
91
+ if (isMoving)
103
92
  return;
104
93
  const { safeValue } = safeData({
105
94
  value: internalValue,
@@ -158,8 +147,7 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
158
147
  onOptionChange == null ? void 0 : onOptionChange(e, {
159
148
  value: conbineValues,
160
149
  options: formatted,
161
- currentOption: columnOption,
162
- columnIndex
150
+ currentOption: columnOption
163
151
  });
164
152
  } else {
165
153
  const result = [...internalValue];
@@ -168,8 +156,7 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
168
156
  onOptionChange == null ? void 0 : onOptionChange(e, {
169
157
  value: result,
170
158
  options,
171
- currentOption: columnOption,
172
- columnIndex
159
+ currentOption: columnOption
173
160
  });
174
161
  }
175
162
  }
@@ -211,16 +198,7 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
211
198
  __spreadProps(__spreadValues({}, contentProps), {
212
199
  className: clsx(`${prefixCls}-content`, contentProps == null ? void 0 : contentProps.className)
213
200
  }),
214
- /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-header` }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-cancel`, onClick: cancel }, propCancelText || cancelText), title && /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-title` }, title), /* @__PURE__ */ React.createElement(
215
- "div",
216
- {
217
- className: clsx(`${prefixCls}-confirm`, {
218
- [`${prefixCls}-confirm-disabled`]: disabled
219
- }),
220
- onClick: confirm
221
- },
222
- propConfirmText || confirmText
223
- )),
201
+ /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-header` }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-cancel`, onClick: cancel }, cancelText), title && /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-title` }, title), /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-confirm`, onClick: confirm }, confirmText)),
224
202
  /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-container` }, columns.map((column, index) => /* @__PURE__ */ React.createElement(
225
203
  PickerPanel,
226
204
  {
@@ -228,9 +206,9 @@ const Picker = /* @__PURE__ */ React.forwardRef((props, ref) => {
228
206
  key: index,
229
207
  options: column,
230
208
  columnIndex: index,
231
- value: internalValue == null ? void 0 : internalValue[index],
209
+ defaultValue: internalValue == null ? void 0 : internalValue[index],
232
210
  onSelect: handleSelect,
233
- pickerStyle: others == null ? void 0 : others.style
211
+ open
234
212
  }
235
213
  )))
236
214
  )
@@ -10,10 +10,6 @@ export interface IPickerOptionItem {
10
10
  * 选项对应唯一的值
11
11
  */
12
12
  value: string | number;
13
- /**
14
- * 是否禁用
15
- */
16
- disabled?: boolean;
17
13
  }
18
14
  export type ICascadePickerChildOptionItem = IPickerOptionItem & {
19
15
  /**
@@ -38,14 +34,6 @@ export type PickerProps<D extends React.ElementType = 'div', P = DrawerProps> =
38
34
  * 标题
39
35
  */
40
36
  title?: string;
41
- /**
42
- * 确认文本内容
43
- */
44
- confirmText?: string;
45
- /**
46
- * 取消文本内容
47
- */
48
- cancelText?: string;
49
37
  /**
50
38
  * 列表数据
51
39
  * @default []
@@ -73,7 +61,6 @@ export type PickerProps<D extends React.ElementType = 'div', P = DrawerProps> =
73
61
  value: (string | number)[];
74
62
  options: ICascadePickerChildOptionItem[][];
75
63
  currentOption: ICascadePickerChildOptionItem;
76
- columnIndex: number;
77
64
  }) => void;
78
65
  /**
79
66
  * 点击取消按钮时候回调
@@ -98,17 +85,17 @@ export type PickerPanelProps<D extends React.ElementType = 'div', P = {}> = Over
98
85
  */
99
86
  options?: ICascadePickerChildOptionItem[];
100
87
  /**
101
- * 选中值
88
+ * 默认值
102
89
  */
103
- value?: string | number;
90
+ defaultValue?: string | number;
104
91
  /**
105
92
  * 列索引
106
93
  */
107
94
  columnIndex?: number;
108
95
  /**
109
- * Piker组件的样式,PickerPanel的主题定制与css变量传入的Tokens有关,需要透传计算
96
+ * 是否展示选择器
110
97
  */
111
- pickerStyle?: React.CSSProperties;
98
+ open?: boolean;
112
99
  /**
113
100
  * 选择选项时的回调
114
101
  */
@@ -1,5 +1,4 @@
1
1
  .bui-picker-panel {
2
- --bui-picker-option-disabled-opacity: 0.38;
3
2
  flex: 1;
4
3
  flex-shrink: 0;
5
4
  position: relative;
@@ -9,9 +8,9 @@
9
8
  transform: rotate3d(1, 0, 0, 60deg);
10
9
  transform-style: preserve-3d;
11
10
  position: absolute;
12
- top: var(--indicator-top);
11
+ top: var(--bui-picker-indicator-top);
13
12
  width: 100%;
14
- height: var(--option-height);
13
+ height: var(--bui-picker-option-height);
15
14
  }
16
15
  .bui-picker-panel-mask {
17
16
  position: absolute;
@@ -29,14 +28,14 @@
29
28
  var(--bui-color-bg-alpha-light-9),
30
29
  var(--bui-color-bg-alpha-light-3));
31
30
  background-position: top, bottom;
32
- background-size: 100% var(--indicator-top);
31
+ background-size: 100% var(--bui-picker-indicator-top);
33
32
  background-repeat: no-repeat;
34
33
  transform: translateZ(0);
35
34
  }
36
35
  .bui-picker-panel-indicator {
37
36
  position: absolute;
38
- top: var(--indicator-top);
39
- height: var(--option-height);
37
+ top: var(--bui-picker-indicator-top);
38
+ height: var(--bui-picker-option-height);
40
39
  width: 100%;
41
40
  border-top: 1px solid var(--bui-color-border-default);
42
41
  border-bottom: 1px solid var(--bui-color-border-default);
@@ -46,10 +45,10 @@
46
45
  top: 0;
47
46
  left: 0;
48
47
  text-align: center;
49
- height: var(--option-height);
50
- line-height: var(--option-height);
48
+ height: var(--bui-picker-option-height);
49
+ line-height: var(--bui-picker-option-height);
51
50
  color: var(--bui-color-fg-default);
52
- font-size: var(--option-font-size);
51
+ font-size: var(--bui-picker-option-font-size);
53
52
  backface-visibility: hidden;
54
53
  width: auto;
55
54
  overflow: hidden;
@@ -57,9 +56,6 @@
57
56
  white-space: nowrap;
58
57
  width: 100%;
59
58
  }
60
- .bui-picker-panel-option-disabled {
61
- opacity: var(--bui-picker-option-disabled-opacity);
62
- }
63
59
  .bui-picker-panel-option-hidden {
64
60
  visibility: hidden;
65
61
  opacity: 0;
@@ -27,25 +27,35 @@ var __objRest = (source, exclude) => {
27
27
  return target;
28
28
  };
29
29
  import clsx from "clsx";
30
- import React, { useEffect, useState, useRef, useImperativeHandle } from "react";
31
- import { useTouch, useForkRef, useTouchEmulator } from "@bifrostui/utils";
30
+ import React, {
31
+ useEffect,
32
+ useState,
33
+ useRef,
34
+ useImperativeHandle,
35
+ useLayoutEffect
36
+ } from "react";
37
+ import {
38
+ useTouch,
39
+ useForkRef,
40
+ useTouchEmulator,
41
+ getBoundingClientRect
42
+ } from "@bifrostui/utils";
32
43
  import "./PickerPanel.css";
33
44
  const prefixCls = "bui-picker-panel";
34
45
  const PickerPanel = /* @__PURE__ */ React.forwardRef(
35
46
  (props, ref) => {
36
- var _b;
37
47
  const _a = props, {
38
48
  options = [],
39
- value,
49
+ defaultValue,
40
50
  onSelect,
41
51
  columnIndex,
42
- pickerStyle
52
+ open
43
53
  } = _a, others = __objRest(_a, [
44
54
  "options",
45
- "value",
55
+ "defaultValue",
46
56
  "onSelect",
47
57
  "columnIndex",
48
- "pickerStyle"
58
+ "open"
49
59
  ]);
50
60
  const touch = useTouch();
51
61
  let timer;
@@ -55,9 +65,8 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
55
65
  const ROTATION = 20;
56
66
  const TOUCH_END = "end";
57
67
  const DEFAULT_LINE_SPACING = 36;
58
- const LINE_SPACING_STR = (_b = ((pickerStyle == null ? void 0 : pickerStyle["--option-height"]) ? `${pickerStyle == null ? void 0 : pickerStyle["--option-height"]}` : `${DEFAULT_LINE_SPACING}`).match(/\d+/)) == null ? void 0 : _b[0];
59
- const LINE_SPACING = parseInt(LINE_SPACING_STR, 10);
60
- const INDICATOR_OFFSET = LINE_SPACING * 108 / DEFAULT_LINE_SPACING;
68
+ const lineSpacing = useRef(DEFAULT_LINE_SPACING);
69
+ const [indicatorOffset, setIndicatorOffset] = useState(108);
61
70
  const [startY, setStartY] = useState(0);
62
71
  const [currIndex, setCurrIndex] = useState(1);
63
72
  const [startTime, setStartTime] = useState(0);
@@ -66,15 +75,23 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
66
75
  const [scrollDistance, setScrollDistance] = useState(0);
67
76
  const transformY = useRef(0);
68
77
  const isVerticalMoving = useRef(false);
69
- const rollerRef = useRef(null);
78
+ const fitstOptionRef = useRef(null);
70
79
  const PickerPanelRef = useRef(null);
71
80
  const pickerPanelRef = useForkRef(PickerPanelRef, ref);
72
81
  useTouchEmulator(PickerPanelRef.current);
82
+ useLayoutEffect(() => {
83
+ if (!open)
84
+ return;
85
+ getBoundingClientRect(fitstOptionRef.current).then((rect) => {
86
+ lineSpacing.current = (rect == null ? void 0 : rect.height) || DEFAULT_LINE_SPACING;
87
+ setIndicatorOffset(lineSpacing.current * 108 / DEFAULT_LINE_SPACING);
88
+ });
89
+ }, [open]);
73
90
  const updateSelect = () => {
74
91
  let index = -1;
75
- if (value) {
92
+ if (defaultValue) {
76
93
  options.some((item, idx) => {
77
- if (item.value === value) {
94
+ if (item.value === defaultValue) {
78
95
  index = idx;
79
96
  return true;
80
97
  }
@@ -82,7 +99,7 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
82
99
  });
83
100
  }
84
101
  setCurrIndex(index === -1 ? 1 : index + 1);
85
- const move = index === -1 ? 0 : index * LINE_SPACING;
102
+ const move = index === -1 ? 0 : index * lineSpacing.current;
86
103
  setMove({ move: -move });
87
104
  };
88
105
  useEffect(() => {
@@ -92,7 +109,7 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
92
109
  return () => {
93
110
  clearTimeout(timer);
94
111
  };
95
- }, [options, value]);
112
+ }, [options]);
96
113
  const setTransform = (type, deg, time = DEFAULT_DURATION, translateY = 0) => {
97
114
  let nTime = time;
98
115
  if (type !== TOUCH_END) {
@@ -109,22 +126,24 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
109
126
  if (updateMove > 0) {
110
127
  updateMove = 0;
111
128
  }
112
- if (updateMove < -(options.length - 1) * LINE_SPACING) {
113
- updateMove = -(options.length - 1) * LINE_SPACING;
129
+ if (updateMove < -(options.length - 1) * lineSpacing.current) {
130
+ updateMove = -(options.length - 1) * lineSpacing.current;
114
131
  }
115
- const endMove = Math.round(updateMove / LINE_SPACING) * LINE_SPACING;
116
- const deg = `${(Math.abs(Math.round(endMove / LINE_SPACING)) + 1) * ROTATION}deg`;
132
+ const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
133
+ const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * ROTATION}deg`;
117
134
  setTransform(type, deg, time, endMove);
118
- setCurrIndex(Math.abs(Math.round(endMove / LINE_SPACING)) + 1);
135
+ setCurrIndex(Math.abs(Math.round(endMove / lineSpacing.current)) + 1);
119
136
  } else {
120
137
  let deg = 0;
121
- const currentDeg = (-updateMove / LINE_SPACING + 1) * ROTATION;
138
+ const currentDeg = (-updateMove / lineSpacing.current + 1) * ROTATION;
122
139
  const maxDeg = (options.length + 1) * ROTATION;
123
140
  const minDeg = 0;
124
141
  deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
125
142
  if (minDeg < deg && deg < maxDeg) {
126
143
  setTransform("", `${deg}deg`, void 0, updateMove);
127
- setCurrIndex(Math.abs(Math.round(updateMove / LINE_SPACING)) + 1);
144
+ setCurrIndex(
145
+ Math.abs(Math.round(updateMove / lineSpacing.current)) + 1
146
+ );
128
147
  }
129
148
  }
130
149
  };
@@ -173,17 +192,17 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
173
192
  }, 0);
174
193
  };
175
194
  useEffect(() => {
176
- var _a2, _b2, _c;
195
+ var _a2, _b, _c;
177
196
  (_a2 = PickerPanelRef.current) == null ? void 0 : _a2.addEventListener("touchstart", panelTouchStart);
178
- (_b2 = PickerPanelRef.current) == null ? void 0 : _b2.addEventListener("touchmove", panelTouchMove);
197
+ (_b = PickerPanelRef.current) == null ? void 0 : _b.addEventListener("touchmove", panelTouchMove);
179
198
  (_c = PickerPanelRef.current) == null ? void 0 : _c.addEventListener("touchend", panelTouchEnd);
180
199
  return () => {
181
- var _a3, _b3, _c2;
200
+ var _a3, _b2, _c2;
182
201
  (_a3 = PickerPanelRef.current) == null ? void 0 : _a3.removeEventListener(
183
202
  "touchstart",
184
203
  panelTouchStart
185
204
  );
186
- (_b3 = PickerPanelRef.current) == null ? void 0 : _b3.removeEventListener(
205
+ (_b2 = PickerPanelRef.current) == null ? void 0 : _b2.removeEventListener(
187
206
  "touchmove",
188
207
  panelTouchMove
189
208
  );
@@ -194,7 +213,7 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
194
213
  isVerticalMoving.current = false;
195
214
  setTouchTime(0);
196
215
  onSelect == null ? void 0 : onSelect(e, {
197
- columnOption: options == null ? void 0 : options[Math.round(-scrollDistance / LINE_SPACING)],
216
+ columnOption: options == null ? void 0 : options[Math.round(-scrollDistance / lineSpacing.current)],
198
217
  columnIndex
199
218
  });
200
219
  };
@@ -214,7 +233,6 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
214
233
  "div",
215
234
  {
216
235
  className: `${prefixCls}-roller`,
217
- ref: rollerRef,
218
236
  style: {
219
237
  transition: `transform ${touchTime}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
220
238
  transform: `rotate3d(1, 0, 0, ${touchDeg})`
@@ -224,13 +242,16 @@ const PickerPanel = /* @__PURE__ */ React.forwardRef(
224
242
  options.map((item, i) => /* @__PURE__ */ React.createElement(
225
243
  "div",
226
244
  {
245
+ ref: (el) => {
246
+ if (i === 0 && !fitstOptionRef.current)
247
+ fitstOptionRef.current = el;
248
+ },
227
249
  className: clsx(`${prefixCls}-option`, {
228
- [`${prefixCls}-option-hidden`]: i + 1 <= currIndex - 8 || i + 1 >= currIndex + 8,
229
- [`${prefixCls}-option-disabled`]: item == null ? void 0 : item.disabled
250
+ [`${prefixCls}-option-hidden`]: i + 1 <= currIndex - 8 || i + 1 >= currIndex + 8
230
251
  }),
231
252
  key: `${item == null ? void 0 : item.value}-${i}`,
232
253
  style: {
233
- transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px, ${INDICATOR_OFFSET}px)`
254
+ transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px, ${indicatorOffset}px)`
234
255
  }
235
256
  },
236
257
  item == null ? void 0 : item.label
@@ -0,0 +1,116 @@
1
+ :root,
2
+ page,
3
+ xhs-page {
4
+ --bui-picker-header-height: 50px;
5
+ --bui-picker-header-padding: 0 var(--bui-spacing-lg);
6
+ --bui-picker-cancel-height: 100%;
7
+ --bui-picker-cancel-line-height: 50px;
8
+ --bui-picker-confirm-height: 100%;
9
+ --bui-picker-confirm-line-height: 50px;
10
+ --bui-picker-panel-height: 260px;
11
+ --bui-picker-indicator-top: 108px;
12
+ --bui-picker-option-height: 36px;
13
+ --bui-picker-option-font-size: var(--bui-title-size-4);
14
+ }
15
+ .bui-picker {
16
+ font-family: var(--bui-font-family);
17
+ }
18
+ .bui-picker .bui-drawer-content {
19
+ border-radius: var(--bui-shape-radius-drawer) var(--bui-shape-radius-drawer) 0 0;
20
+ }
21
+ .bui-picker-header {
22
+ height: var(--bui-picker-header-height);
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: space-between;
26
+ padding: var(--bui-picker-header-padding);
27
+ }
28
+ .bui-picker-cancel {
29
+ cursor: pointer;
30
+ height: var(--bui-picker-cancel-height);
31
+ font-size: var(--bui-title-size-4);
32
+ text-align: center;
33
+ line-height: var(--bui-picker-cancel-line-height);
34
+ color: var(--bui-color-fg-default);
35
+ }
36
+ .bui-picker-title {
37
+ font-size: var(--bui-title-size-3);
38
+ color: var(--bui-color-fg-default);
39
+ font-weight: var(--bui-font-weight-medium);
40
+ }
41
+ .bui-picker-confirm {
42
+ cursor: pointer;
43
+ height: var(--bui-picker-confirm-height);
44
+ font-size: var(--bui-title-size-4);
45
+ text-align: center;
46
+ line-height: var(--bui-picker-confirm-line-height);
47
+ color: var(--bui-color-primary);
48
+ }
49
+ .bui-picker-container {
50
+ width: 100%;
51
+ height: var(--bui-picker-panel-height);
52
+ display: flex;
53
+ overflow: hidden;
54
+ }
55
+ .bui-picker-panel {
56
+ flex: 1;
57
+ flex-shrink: 0;
58
+ position: relative;
59
+ font-family: var(--bui-font-family);
60
+ }
61
+ .bui-picker-panel-roller {
62
+ transform: rotate3d(1, 0, 0, 60deg);
63
+ transform-style: preserve-3d;
64
+ position: absolute;
65
+ top: var(--bui-picker-indicator-top);
66
+ width: 100%;
67
+ height: var(--bui-picker-option-height);
68
+ }
69
+ .bui-picker-panel-mask {
70
+ position: absolute;
71
+ top: 0;
72
+ left: 0;
73
+ width: 100%;
74
+ height: 100%;
75
+ background-image:
76
+ linear-gradient(
77
+ 180deg,
78
+ var(--bui-color-bg-alpha-light-9),
79
+ var(--bui-color-bg-alpha-light-3)),
80
+ linear-gradient(
81
+ 0deg,
82
+ var(--bui-color-bg-alpha-light-9),
83
+ var(--bui-color-bg-alpha-light-3));
84
+ background-position: top, bottom;
85
+ background-size: 100% var(--bui-picker-indicator-top);
86
+ background-repeat: no-repeat;
87
+ transform: translateZ(0);
88
+ }
89
+ .bui-picker-panel-indicator {
90
+ position: absolute;
91
+ top: var(--bui-picker-indicator-top);
92
+ height: var(--bui-picker-option-height);
93
+ width: 100%;
94
+ border-top: 1px solid var(--bui-color-border-default);
95
+ border-bottom: 1px solid var(--bui-color-border-default);
96
+ }
97
+ .bui-picker-panel-option {
98
+ position: absolute;
99
+ top: 0;
100
+ left: 0;
101
+ text-align: center;
102
+ height: var(--bui-picker-option-height);
103
+ line-height: var(--bui-picker-option-height);
104
+ color: var(--bui-color-fg-default);
105
+ font-size: var(--bui-picker-option-font-size);
106
+ backface-visibility: hidden;
107
+ width: auto;
108
+ overflow: hidden;
109
+ text-overflow: ellipsis;
110
+ white-space: nowrap;
111
+ width: 100%;
112
+ }
113
+ .bui-picker-panel-option-hidden {
114
+ visibility: hidden;
115
+ opacity: 0;
116
+ }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import './Popover.less';
3
2
  import { PopoverProps } from './Popover.types';
3
+ import './index.less';
4
4
  declare const Popover: React.ForwardRefExoticComponent<Omit<PopoverProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  export default Popover;