@bifrostui/react 1.4.7-beta.0 → 2.0.0-beta.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 (304) hide show
  1. package/dist/ActionSheet/ActionSheet.css +2 -2
  2. package/dist/ActionSheet/ActionSheetItem.js +3 -8
  3. package/dist/Avatar/Avatar.js +3 -8
  4. package/dist/Avatar/AvatarGroup.js +2 -6
  5. package/dist/Badge/Badge.js +3 -8
  6. package/dist/Button/Button.css +77 -78
  7. package/dist/Button/Button.d.ts +1 -1
  8. package/dist/Button/Button.js +4 -10
  9. package/dist/Button/Button.types.d.ts +8 -7
  10. package/dist/Calendar/Calendar.js +7 -19
  11. package/dist/Calendar/Calendar.types.d.ts +0 -5
  12. package/dist/Card/Card.css +1 -1
  13. package/dist/Card/CardContent.css +1 -2
  14. package/dist/Card/CardFooter.css +2 -4
  15. package/dist/Card/CardHeader.css +4 -5
  16. package/dist/Checkbox/Checkbox.js +2 -6
  17. package/dist/Checkbox/CheckboxGroup.js +4 -7
  18. package/dist/Collapse/Collapse.css +1 -0
  19. package/dist/Collapse/Collapse.d.ts +1 -1
  20. package/dist/Collapse/Collapse.js +8 -11
  21. package/dist/CollapsePanel/CollapsePanel.css +2 -4
  22. package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
  23. package/dist/Countdown/Countdown.js +5 -12
  24. package/dist/Dialog/FunctionalDialog.js +1 -1
  25. package/dist/Divider/Divider.js +8 -5
  26. package/dist/Drawer/Drawer.js +4 -10
  27. package/dist/Fade/Fade.js +52 -56
  28. package/dist/IconButton/IconButton.js +5 -12
  29. package/dist/Image/Image.js +112 -119
  30. package/dist/Input/Input.js +4 -10
  31. package/dist/List/List.js +3 -8
  32. package/dist/List/ListItem.js +42 -44
  33. package/dist/List/ListItemContent.js +1 -4
  34. package/dist/List/ListItemExtra.js +9 -4
  35. package/dist/List/ListItemFooter.js +9 -4
  36. package/dist/List/ListItemHeader.js +9 -4
  37. package/dist/Loading/Loading.js +13 -4
  38. package/dist/Modal/Modal.js +0 -6
  39. package/dist/Modal/Modal.miniapp.js +4 -10
  40. package/dist/NavBar/NavBar.js +0 -1
  41. package/dist/Picker/Picker.css +0 -5
  42. package/dist/Picker/Picker.js +5 -27
  43. package/dist/Picker/Picker.types.d.ts +2 -15
  44. package/dist/Picker/PickerPanel.css +0 -4
  45. package/dist/Picker/PickerPanel.js +6 -7
  46. package/dist/Popover/Popover.css +5 -5
  47. package/dist/Popover/Popover.js +27 -70
  48. package/dist/Portal/Portal.miniapp.js +4 -7
  49. package/dist/Radio/Radio.css +0 -1
  50. package/dist/Radio/Radio.js +2 -6
  51. package/dist/Radio/RadioGroup.js +0 -3
  52. package/dist/Rating/Rating.js +8 -18
  53. package/dist/ScrollView/ScrollView.js +11 -24
  54. package/dist/ScrollView/ScrollView.types.d.ts +1 -0
  55. package/dist/Select/Select.css +4 -1
  56. package/dist/Select/Select.js +41 -68
  57. package/dist/Skeleton/Skeleton.js +5 -9
  58. package/dist/Slide/Slide.js +69 -74
  59. package/dist/Slider/Slider.js +11 -27
  60. package/dist/Steps/Step.js +81 -82
  61. package/dist/Steps/Steps.d.ts +1 -1
  62. package/dist/Steps/Steps.js +57 -60
  63. package/dist/Switch/Switch.js +75 -78
  64. package/dist/TabBar/TabBar.js +3 -8
  65. package/dist/Tabs/Tab.css +10 -16
  66. package/dist/Tabs/Tab.js +2 -3
  67. package/dist/Tabs/Tabs.css +13 -22
  68. package/dist/Tabs/Tabs.js +39 -70
  69. package/dist/Tabs/Tabs.types.d.ts +0 -10
  70. package/dist/Tabs/utils/bound.d.ts +1 -0
  71. package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
  72. package/dist/Tag/Tag.css +1 -1
  73. package/dist/Tag/Tag.js +2 -6
  74. package/dist/TextArea/TextArea.js +5 -12
  75. package/dist/Toast/FunctionalToast.js +1 -1
  76. package/dist/Toast/Toast.css +1 -0
  77. package/dist/Tooltip/Tooltip.css +5 -5
  78. package/dist/Tooltip/Tooltip.js +27 -70
  79. package/dist/Transition/TransitionCore.js +3 -8
  80. package/dist/index.d.ts +0 -6
  81. package/dist/index.js +1 -13
  82. package/dist/locales/base.d.ts +0 -11
  83. package/dist/locales/en-US.js +0 -24
  84. package/dist/locales/zh-CN.js +0 -24
  85. package/dist/locales/zh-TW.js +0 -24
  86. package/es/ActionSheet/ActionSheet.css +2 -2
  87. package/es/ActionSheet/ActionSheetItem.js +3 -8
  88. package/es/Avatar/Avatar.js +3 -8
  89. package/es/Avatar/AvatarGroup.js +2 -6
  90. package/es/Badge/Badge.js +3 -8
  91. package/es/Button/Button.css +77 -78
  92. package/es/Button/Button.d.ts +1 -1
  93. package/es/Button/Button.js +3 -9
  94. package/es/Button/Button.types.d.ts +8 -7
  95. package/es/Calendar/Calendar.js +7 -19
  96. package/es/Calendar/Calendar.types.d.ts +0 -5
  97. package/es/Card/Card.css +1 -1
  98. package/es/Card/CardContent.css +1 -2
  99. package/es/Card/CardFooter.css +2 -4
  100. package/es/Card/CardHeader.css +4 -5
  101. package/es/Checkbox/Checkbox.js +2 -6
  102. package/es/Checkbox/CheckboxGroup.js +4 -7
  103. package/es/Collapse/Collapse.css +1 -0
  104. package/es/Collapse/Collapse.d.ts +1 -1
  105. package/es/Collapse/Collapse.js +8 -11
  106. package/es/CollapsePanel/CollapsePanel.css +2 -4
  107. package/es/CollapsePanel/CollapsePanelItem.js +45 -46
  108. package/es/Countdown/Countdown.js +5 -12
  109. package/es/Dialog/FunctionalDialog.js +2 -2
  110. package/es/Divider/Divider.js +8 -5
  111. package/es/Drawer/Drawer.js +4 -10
  112. package/es/Fade/Fade.js +52 -56
  113. package/es/IconButton/IconButton.js +5 -12
  114. package/es/Image/Image.js +112 -119
  115. package/es/Input/Input.js +4 -10
  116. package/es/List/List.js +3 -8
  117. package/es/List/ListItem.js +42 -44
  118. package/es/List/ListItemContent.js +1 -4
  119. package/es/List/ListItemExtra.js +9 -4
  120. package/es/List/ListItemFooter.js +9 -4
  121. package/es/List/ListItemHeader.js +9 -4
  122. package/es/Loading/Loading.js +13 -4
  123. package/es/Modal/Modal.js +0 -6
  124. package/es/Modal/Modal.miniapp.js +4 -10
  125. package/es/NavBar/NavBar.js +0 -1
  126. package/es/Picker/Picker.css +0 -5
  127. package/es/Picker/Picker.js +5 -27
  128. package/es/Picker/Picker.types.d.ts +2 -15
  129. package/es/Picker/PickerPanel.css +0 -4
  130. package/es/Picker/PickerPanel.js +6 -7
  131. package/es/Popover/Popover.css +5 -5
  132. package/es/Popover/Popover.js +29 -73
  133. package/es/Portal/Portal.miniapp.js +5 -8
  134. package/es/Radio/Radio.css +0 -1
  135. package/es/Radio/Radio.js +2 -6
  136. package/es/Radio/RadioGroup.js +0 -3
  137. package/es/Rating/Rating.js +8 -18
  138. package/es/ScrollView/ScrollView.js +11 -24
  139. package/es/ScrollView/ScrollView.types.d.ts +1 -0
  140. package/es/Select/Select.css +4 -1
  141. package/es/Select/Select.js +42 -68
  142. package/es/Skeleton/Skeleton.js +5 -9
  143. package/es/Slide/Slide.js +69 -74
  144. package/es/Slider/Slider.js +12 -30
  145. package/es/Steps/Step.js +81 -82
  146. package/es/Steps/Steps.d.ts +1 -1
  147. package/es/Steps/Steps.js +57 -60
  148. package/es/Switch/Switch.js +75 -78
  149. package/es/TabBar/TabBar.js +3 -8
  150. package/es/Tabs/Tab.css +10 -16
  151. package/es/Tabs/Tab.js +2 -3
  152. package/es/Tabs/Tabs.css +13 -22
  153. package/es/Tabs/Tabs.js +41 -83
  154. package/es/Tabs/Tabs.types.d.ts +0 -10
  155. package/es/Tabs/utils/bound.d.ts +1 -0
  156. package/es/Tabs/utils/bound.js +13 -0
  157. package/es/Tag/Tag.css +1 -1
  158. package/es/Tag/Tag.js +2 -6
  159. package/es/TextArea/TextArea.js +5 -12
  160. package/es/Toast/FunctionalToast.js +2 -2
  161. package/es/Toast/Toast.css +1 -0
  162. package/es/Tooltip/Tooltip.css +5 -5
  163. package/es/Tooltip/Tooltip.js +29 -73
  164. package/es/Transition/TransitionCore.js +3 -8
  165. package/es/index.d.ts +0 -6
  166. package/es/index.js +0 -6
  167. package/es/locales/base.d.ts +0 -11
  168. package/es/locales/en-US.js +0 -24
  169. package/es/locales/zh-CN.js +0 -24
  170. package/es/locales/zh-TW.js +0 -24
  171. package/package.json +6 -6
  172. package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
  173. package/dist/Collapse/Collapse.miniapp.js +0 -177
  174. package/dist/DatePicker/DatePicker.d.ts +0 -4
  175. package/dist/DatePicker/DatePicker.js +0 -335
  176. package/dist/DatePicker/DatePicker.types.d.ts +0 -43
  177. package/dist/DatePicker/DatePicker.types.js +0 -35
  178. package/dist/DatePicker/index.d.ts +0 -2
  179. package/dist/DatePicker/index.js +0 -41
  180. package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  181. package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
  182. package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  183. package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
  184. package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  185. package/dist/DesktopDatePicker/index.css +0 -61
  186. package/dist/DesktopDatePicker/index.d.ts +0 -2
  187. package/dist/DesktopDatePicker/index.js +0 -41
  188. package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  189. package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
  190. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  191. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
  192. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  193. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
  194. package/dist/DesktopDateTimePicker/index.css +0 -66
  195. package/dist/DesktopDateTimePicker/index.d.ts +0 -2
  196. package/dist/DesktopDateTimePicker/index.js +0 -41
  197. package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
  198. package/dist/DesktopPicker/DesktopPicker.js +0 -238
  199. package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  200. package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
  201. package/dist/DesktopPicker/index.css +0 -37
  202. package/dist/DesktopPicker/index.d.ts +0 -2
  203. package/dist/DesktopPicker/index.js +0 -41
  204. package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  205. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  206. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
  207. package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  208. package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
  209. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  210. package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
  211. package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  212. package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
  213. package/dist/DesktopTimePicker/index.css +0 -170
  214. package/dist/DesktopTimePicker/index.d.ts +0 -2
  215. package/dist/DesktopTimePicker/index.js +0 -41
  216. package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  217. package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -246
  218. package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  219. package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
  220. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  221. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
  222. package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
  223. package/dist/DesktopTimePicker/utils/utils.js +0 -408
  224. package/dist/SwipeAction/SwipeAction.css +0 -79
  225. package/dist/SwipeAction/SwipeAction.d.ts +0 -5
  226. package/dist/SwipeAction/SwipeAction.js +0 -349
  227. package/dist/SwipeAction/SwipeAction.types.d.ts +0 -83
  228. package/dist/SwipeAction/SwipeAction.types.js +0 -39
  229. package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
  230. package/dist/SwipeAction/SwipeActionContext.js +0 -30
  231. package/dist/SwipeAction/SwipeActionItem.css +0 -31
  232. package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
  233. package/dist/SwipeAction/SwipeActionItem.js +0 -105
  234. package/dist/SwipeAction/index.d.ts +0 -4
  235. package/dist/SwipeAction/index.js +0 -45
  236. package/dist/Tabs/utils/scroll.d.ts +0 -2
  237. package/dist/Tabs/utils/scroll.js +0 -55
  238. package/es/Collapse/Collapse.miniapp.d.ts +0 -5
  239. package/es/Collapse/Collapse.miniapp.js +0 -157
  240. package/es/DatePicker/DatePicker.d.ts +0 -4
  241. package/es/DatePicker/DatePicker.js +0 -310
  242. package/es/DatePicker/DatePicker.types.d.ts +0 -43
  243. package/es/DatePicker/DatePicker.types.js +0 -1
  244. package/es/DatePicker/index.d.ts +0 -2
  245. package/es/DatePicker/index.js +0 -6
  246. package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  247. package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
  248. package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  249. package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
  250. package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  251. package/es/DesktopDatePicker/index.css +0 -61
  252. package/es/DesktopDatePicker/index.d.ts +0 -2
  253. package/es/DesktopDatePicker/index.js +0 -6
  254. package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  255. package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
  256. package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  257. package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
  258. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  259. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
  260. package/es/DesktopDateTimePicker/index.css +0 -66
  261. package/es/DesktopDateTimePicker/index.d.ts +0 -2
  262. package/es/DesktopDateTimePicker/index.js +0 -9
  263. package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
  264. package/es/DesktopPicker/DesktopPicker.js +0 -221
  265. package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  266. package/es/DesktopPicker/DesktopPicker.types.js +0 -1
  267. package/es/DesktopPicker/index.css +0 -37
  268. package/es/DesktopPicker/index.d.ts +0 -2
  269. package/es/DesktopPicker/index.js +0 -6
  270. package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  271. package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
  272. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  273. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
  274. package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  275. package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
  276. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  277. package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
  278. package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  279. package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
  280. package/es/DesktopTimePicker/index.css +0 -170
  281. package/es/DesktopTimePicker/index.d.ts +0 -2
  282. package/es/DesktopTimePicker/index.js +0 -6
  283. package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  284. package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -223
  285. package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  286. package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
  287. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  288. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
  289. package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
  290. package/es/DesktopTimePicker/utils/utils.js +0 -365
  291. package/es/SwipeAction/SwipeAction.css +0 -79
  292. package/es/SwipeAction/SwipeAction.d.ts +0 -5
  293. package/es/SwipeAction/SwipeAction.js +0 -337
  294. package/es/SwipeAction/SwipeAction.types.d.ts +0 -83
  295. package/es/SwipeAction/SwipeAction.types.js +0 -1
  296. package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
  297. package/es/SwipeAction/SwipeActionContext.js +0 -11
  298. package/es/SwipeAction/SwipeActionItem.css +0 -31
  299. package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
  300. package/es/SwipeAction/SwipeActionItem.js +0 -78
  301. package/es/SwipeAction/index.d.ts +0 -4
  302. package/es/SwipeAction/index.js +0 -9
  303. package/es/Tabs/utils/scroll.d.ts +0 -2
  304. package/es/Tabs/utils/scroll.js +0 -36
@@ -51,26 +51,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
51
51
  mod
52
52
  ));
53
53
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
54
- var __async = (__this, __arguments, generator) => {
55
- return new Promise((resolve, reject) => {
56
- var fulfilled = (value) => {
57
- try {
58
- step(generator.next(value));
59
- } catch (e) {
60
- reject(e);
61
- }
62
- };
63
- var rejected = (value) => {
64
- try {
65
- step(generator.throw(value));
66
- } catch (e) {
67
- reject(e);
68
- }
69
- };
70
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
71
- step((generator = generator.apply(__this, __arguments)).next());
72
- });
73
- };
74
54
  var Popover_exports = {};
75
55
  __export(Popover_exports, {
76
56
  default: () => Popover_default
@@ -93,9 +73,9 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
93
73
  offsetSpacing = 0,
94
74
  placement = "top",
95
75
  trigger = "click",
76
+ onOpenChange,
96
77
  open,
97
- hideArrow,
98
- onOpenChange
78
+ hideArrow
99
79
  } = _a, others = __objRest(_a, [
100
80
  "className",
101
81
  "style",
@@ -106,9 +86,9 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
106
86
  "offsetSpacing",
107
87
  "placement",
108
88
  "trigger",
89
+ "onOpenChange",
109
90
  "open",
110
- "hideArrow",
111
- "onOpenChange"
91
+ "hideArrow"
112
92
  ]);
113
93
  const controlByUser = typeof open !== "undefined";
114
94
  const { direction, location = "center" } = (0, import_utils.parsePlacement)(placement);
@@ -116,18 +96,11 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
116
96
  const [openStatus, setOpenStatus] = (0, import_react.useState)(defaultOpen);
117
97
  const [arrowDirection, setArrowDirection] = (0, import_react.useState)(direction);
118
98
  const [arrowLocation, setArrowLocation] = (0, import_react.useState)(location);
119
- const [toolStyles, setToolStyles] = (0, import_react.useState)({});
120
- const tipRef = (0, import_react.useRef)(null);
121
- const nodeRef = (0, import_utils.useForkRef)(ref, tipRef);
122
- const clearRef = (status) => {
123
- if (status === false) {
124
- tipRef.current = null;
125
- }
126
- };
99
+ const [tooltyles, setTooltyles] = (0, import_react.useState)({});
100
+ const ttId = (0, import_utils.useUniqueId)();
127
101
  const changeOpenStatus = (event, status) => {
128
102
  if (controlByUser)
129
103
  return;
130
- clearRef(status);
131
104
  setOpenStatus(status);
132
105
  onOpenChange == null ? void 0 : onOpenChange(event, { open: status });
133
106
  };
@@ -146,33 +119,23 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
146
119
  if (!controlByUser)
147
120
  return;
148
121
  setOpenStatus(open);
149
- clearRef(open);
150
122
  }, [open]);
151
- (0, import_react.useEffect)(() => {
152
- if (!openStatus) {
153
- setToolStyles({
154
- visibility: "hidden"
155
- });
156
- }
157
- }, [openStatus]);
158
123
  const clickEventHandler = (event) => {
159
124
  if (trigger === "hover" || (trigger == null ? void 0 : trigger.length) === 1 && (trigger == null ? void 0 : trigger[0]) === "hover")
160
125
  return;
161
126
  hidePopover(event);
162
127
  };
163
- const onRootElementMouted = (0, import_utils.throttle)(() => __async(void 0, null, function* () {
164
- if (!tipRef.current)
165
- return;
128
+ const onRootElementMouted = (0, import_utils.throttle)(() => {
166
129
  const {
167
130
  direction: newParsedDirection,
168
131
  location: newParsedLocation = "center"
169
132
  } = (0, import_utils.parsePlacement)(placement);
170
- const result = yield (0, import_utils.getStylesAndLocation)({
133
+ const result = (0, import_utils.getStylesAndLocation)({
171
134
  childrenRef,
172
135
  arrowDirection: newParsedDirection,
173
136
  arrowLocation: newParsedLocation,
174
137
  offsetSpacing,
175
- tipRef
138
+ selector: `[data-id="tt_${ttId}"]`
176
139
  });
177
140
  if (!result)
178
141
  return;
@@ -183,32 +146,26 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
183
146
  if (newArrowLocation !== arrowLocation) {
184
147
  setArrowLocation(newArrowLocation);
185
148
  }
186
- setToolStyles(styles);
187
- }), 100);
149
+ setTooltyles(styles);
150
+ }, 100);
151
+ const bindEvent = () => {
152
+ if (!controlByUser) {
153
+ document.addEventListener("click", clickEventHandler);
154
+ }
155
+ window.addEventListener("resize", onRootElementMouted);
156
+ };
157
+ const unbindEvent = () => {
158
+ if (!controlByUser) {
159
+ document.removeEventListener("click", clickEventHandler);
160
+ }
161
+ window.removeEventListener("resize", onRootElementMouted);
162
+ };
188
163
  (0, import_react.useEffect)(() => {
189
- const bindEvent = () => {
190
- if (!tipRef.current)
191
- return;
192
- if (!controlByUser) {
193
- document.addEventListener("click", clickEventHandler);
194
- }
195
- if (!import_utils.isMini) {
196
- window.addEventListener("resize", onRootElementMouted);
197
- }
198
- };
199
- const unbindEvent = () => {
200
- if (!controlByUser) {
201
- document.removeEventListener("click", clickEventHandler);
202
- }
203
- if (!import_utils.isMini) {
204
- window.removeEventListener("resize", onRootElementMouted);
205
- }
206
- };
207
164
  bindEvent();
208
165
  return () => {
209
166
  unbindEvent();
210
167
  };
211
- }, [openStatus]);
168
+ }, []);
212
169
  if (!title && !content)
213
170
  return null;
214
171
  let triggerEventOption;
@@ -223,14 +180,14 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
223
180
  const childrenOptions = __spreadValues({
224
181
  ref: childrenRef
225
182
  }, triggerEventOption);
226
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, open || openStatus ? /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { onRootElementMouted }, /* @__PURE__ */ import_react.default.createElement(
183
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, open || openStatus ? /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { onRootElementMouted, ref }, /* @__PURE__ */ import_react.default.createElement(
227
184
  "div",
228
185
  __spreadValues({
229
186
  className: (0, import_clsx.default)(prefixCls, className, `popover-${arrowDirection}`, {
230
187
  "bui-popover-arrow-hide": hideArrow
231
188
  }),
232
- style: __spreadValues(__spreadValues({}, style), toolStyles),
233
- ref: nodeRef
189
+ "data-id": `tt_${ttId}`,
190
+ style: __spreadValues(__spreadValues({}, style), tooltyles)
234
191
  }, others),
235
192
  !hideArrow ? /* @__PURE__ */ import_react.default.createElement(
236
193
  "div",
@@ -53,9 +53,7 @@ var import_react = __toESM(require("react"));
53
53
  var import_PortalCore = __toESM(require("./PortalCore"));
54
54
  const Portal = (0, import_react.forwardRef)((props, ref) => {
55
55
  const { disablePortal } = props;
56
- const [rootWrapperElement, setRootWrapperElement] = (0, import_react.useState)();
57
- (0, import_react.useEffect)(() => {
58
- let root;
56
+ const rootWrapperElement = (0, import_react.useMemo)(() => {
59
57
  if (!disablePortal) {
60
58
  const currentPages = import_taro.default.getCurrentPages() || [];
61
59
  const currentPage = currentPages[currentPages.length - 1];
@@ -67,12 +65,11 @@ const Portal = (0, import_react.forwardRef)((props, ref) => {
67
65
  const view = document.createElement("view");
68
66
  view.id = portalId;
69
67
  rootElement == null ? void 0 : rootElement.appendChild(view);
70
- root = view;
71
- } else {
72
- root = portalWrapperElement;
68
+ return view;
73
69
  }
70
+ return portalWrapperElement;
74
71
  }
75
- setRootWrapperElement(root);
72
+ return void 0;
76
73
  }, []);
77
74
  return /* @__PURE__ */ import_react.default.createElement(import_PortalCore.default, __spreadProps(__spreadValues({}, props), { ref, rootElement: rootWrapperElement }));
78
75
  });
@@ -1,7 +1,6 @@
1
1
  .bui-radio {
2
2
  --label-color: var(--bui-radio-label-color, var(--bui-color-fg-default));
3
3
  --label-font-size: var(--bui-radio-label-font-size, var(--bui-text-size-1));
4
- --icon-font-size: var(--bui-radio-icon-font-size, var(--bui-title-size-2));
5
4
  --icon-padding: var(--bui-radio-icon-padding, 5px);
6
5
  display: inline-flex;
7
6
  align-items: center;
@@ -69,7 +69,7 @@ const prefixCls = "bui-radio";
69
69
  const Radio = (0, import_react.forwardRef)((props, ref) => {
70
70
  const _a = props, {
71
71
  className,
72
- defaultChecked,
72
+ defaultChecked = false,
73
73
  checked,
74
74
  inputProps,
75
75
  inputRef,
@@ -78,7 +78,7 @@ const Radio = (0, import_react.forwardRef)((props, ref) => {
78
78
  disabled,
79
79
  icon,
80
80
  checkedIcon,
81
- labelPlacement,
81
+ labelPlacement = "right",
82
82
  onChange,
83
83
  children
84
84
  } = _a, others = __objRest(_a, [
@@ -177,8 +177,4 @@ const Radio = (0, import_react.forwardRef)((props, ref) => {
177
177
  );
178
178
  });
179
179
  Radio.displayName = "BuiRadio";
180
- Radio.defaultProps = {
181
- defaultChecked: false,
182
- labelPlacement: "right"
183
- };
184
180
  var Radio_default = Radio;
@@ -100,7 +100,4 @@ const RadioGroup = (0, import_react.forwardRef)((props, ref) => {
100
100
  );
101
101
  });
102
102
  RadioGroup.displayName = "BuiRadioGroup";
103
- RadioGroup.defaultProps = {
104
- disabled: false
105
- };
106
103
  var RadioGroup_default = RadioGroup;
@@ -69,18 +69,18 @@ const classes = {
69
69
  const Rating = (0, import_react.forwardRef)((props, ref) => {
70
70
  const _a = props, {
71
71
  className,
72
- size,
72
+ size = "medium",
73
73
  defaultValue,
74
- allowHalf,
75
- icon,
76
- checkedIcon,
77
- count,
78
- readOnly,
79
- disabled,
74
+ allowHalf = false,
75
+ icon = /* @__PURE__ */ import_react.default.createElement(import_icons.StarFilledIcon, { htmlColor: "#ced1d6" }),
76
+ checkedIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.StarFilledIcon, { color: "warning" }),
77
+ count = 5,
78
+ readOnly = false,
79
+ disabled = false,
80
80
  value,
81
81
  onChange,
82
82
  name,
83
- disableClear
83
+ disableClear = false
84
84
  } = _a, others = __objRest(_a, [
85
85
  "className",
86
86
  "size",
@@ -164,14 +164,4 @@ const Rating = (0, import_react.forwardRef)((props, ref) => {
164
164
  );
165
165
  });
166
166
  Rating.displayName = "BuiRating";
167
- Rating.defaultProps = {
168
- size: "medium",
169
- count: 5,
170
- icon: /* @__PURE__ */ import_react.default.createElement(import_icons.StarFilledIcon, { htmlColor: "#ced1d6" }),
171
- checkedIcon: /* @__PURE__ */ import_react.default.createElement(import_icons.StarFilledIcon, { color: "warning" }),
172
- readOnly: false,
173
- disabled: false,
174
- allowHalf: false,
175
- disableClear: false
176
- };
177
167
  var Rating_default = Rating;
@@ -34,14 +34,12 @@ var import_utils = require("@bifrostui/utils");
34
34
  var import_clsx = __toESM(require("clsx"));
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_ScrollView = require("./ScrollView.css");
37
- function easeOutScroll(from, to, callback, dur) {
38
- if (dur <= 0) {
39
- dur = 500;
40
- }
37
+ function easeOutScroll(from, to, callback) {
41
38
  if (from === to || typeof from !== "number") {
42
39
  return;
43
40
  }
44
41
  const change = to - from;
42
+ const dur = 500;
45
43
  const sTime = +/* @__PURE__ */ new Date();
46
44
  function linear(t, b, c, d) {
47
45
  return c * t / d + b;
@@ -76,8 +74,7 @@ const ScrollView = (0, import_react.forwardRef)(
76
74
  scrollIntoView,
77
75
  onTouchMove: propsOnTouchMove,
78
76
  scrollIntoViewAlignment,
79
- children,
80
- scrollAnimationDuration = 500
77
+ children
81
78
  } = props;
82
79
  const container = (0, import_react.useRef)(null);
83
80
  const handleRef = (0, import_utils.useForkRef)(ref, container);
@@ -87,15 +84,10 @@ const ScrollView = (0, import_react.forwardRef)(
87
84
  if (top === void 0)
88
85
  return;
89
86
  if (isAnimation) {
90
- easeOutScroll(
91
- container.current.scrollTop,
92
- top,
93
- (pos) => {
94
- if (container.current)
95
- container.current.scrollTop = pos;
96
- },
97
- scrollAnimationDuration
98
- );
87
+ easeOutScroll(container.current.scrollTop, top, (pos) => {
88
+ if (container.current)
89
+ container.current.scrollTop = pos;
90
+ });
99
91
  } else if (container.current)
100
92
  container.current.scrollTop = top;
101
93
  }, []);
@@ -103,15 +95,10 @@ const ScrollView = (0, import_react.forwardRef)(
103
95
  if (left === void 0)
104
96
  return;
105
97
  if (isAnimation) {
106
- easeOutScroll(
107
- container.current.scrollLeft,
108
- left,
109
- (pos) => {
110
- if (container.current)
111
- container.current.scrollLeft = pos;
112
- },
113
- scrollAnimationDuration
114
- );
98
+ easeOutScroll(container.current.scrollLeft, left, (pos) => {
99
+ if (container.current)
100
+ container.current.scrollLeft = pos;
101
+ });
115
102
  } else if (container.current)
116
103
  container.current.scrollLeft = left;
117
104
  }, []);
@@ -138,6 +138,7 @@ export type ScrollViewProps<D extends React.ElementType = 'div', P = {}> = Overr
138
138
  */
139
139
  fastDeceleration?: boolean;
140
140
  /** 当 scroll-with-animation设置为 true 时,可以设置 scroll-animation-duration 来控制动画的执行时间,单位 ms。
141
+ * 仅小程序可用
141
142
  */
142
143
  scrollAnimationDuration?: number;
143
144
  /** 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。
@@ -48,9 +48,13 @@
48
48
  .bui-select-option-container {
49
49
  position: absolute;
50
50
  box-sizing: border-box;
51
+ top: 100%;
52
+ left: 0;
53
+ width: 100%;
51
54
  font-size: var(--bui-select-font-size, var(--bui-title-size-3));
52
55
  z-index: var(--bui-z-index-tooltip);
53
56
  border-radius: 3px;
57
+ background-color: var(--bui-color-bg-view);
54
58
  padding: 2px;
55
59
  overflow: hidden;
56
60
  }
@@ -67,7 +71,6 @@
67
71
  border-radius: 3px;
68
72
  padding: var(--bui-select-option-container-padding, 3px 0);
69
73
  box-shadow: 0 0 0 2px var(--bui-color-bg-default);
70
- background-color: var(--bui-color-bg-view);
71
74
  overflow: hidden;
72
75
  }
73
76
  .bui-select-option {
@@ -54,26 +54,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
54
54
  mod
55
55
  ));
56
56
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
- var __async = (__this, __arguments, generator) => {
58
- return new Promise((resolve, reject) => {
59
- var fulfilled = (value) => {
60
- try {
61
- step(generator.next(value));
62
- } catch (e) {
63
- reject(e);
64
- }
65
- };
66
- var rejected = (value) => {
67
- try {
68
- step(generator.throw(value));
69
- } catch (e) {
70
- reject(e);
71
- }
72
- };
73
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
74
- step((generator = generator.apply(__this, __arguments)).next());
75
- });
76
- };
77
57
  var Select_exports = {};
78
58
  __export(Select_exports, {
79
59
  default: () => Select_default
@@ -100,12 +80,14 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
100
80
  inputProps,
101
81
  BackdropProps,
102
82
  value,
103
- defaultValue,
83
+ defaultValue = "",
104
84
  disabled,
105
85
  placeholder,
106
86
  icon,
107
87
  open,
108
- scrollContainer,
88
+ scrollContainer = () => {
89
+ return import_utils.isMini ? null : document.body;
90
+ },
109
91
  onChange,
110
92
  onClose,
111
93
  onOpen,
@@ -141,36 +123,38 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
141
123
  const isOpen = open !== void 0 ? open : internalOpen;
142
124
  const locatorRef = (0, import_react.useRef)(null);
143
125
  const rootRef = (0, import_utils.useForkRef)(ref, locatorRef);
144
- const optionContainerRef = (0, import_react.useRef)(null);
145
- const optionMainRef = (0, import_react.useRef)(null);
146
- const updateOptionStyle = () => __async(void 0, null, function* () {
126
+ const ttId = (0, import_utils.useUniqueId)();
127
+ const dataId = `${prefixCls}-tt-${ttId}`;
128
+ const updateOptionStyle = (0, import_utils.throttle)(() => {
147
129
  const curScrollRoot = scrollContainer();
148
- const result = yield (0, import_utils.getStylesAndLocation)({
149
- scrollRoot: curScrollRoot,
150
- childrenRef: locatorRef,
151
- tipRef: optionContainerRef,
152
- arrowDirection: defaultPlacement,
153
- arrowLocation: "none",
154
- offsetSpacing: 0
155
- });
156
- if (!result)
157
- return;
158
- const { styles, childrenStyle, newArrowDirection } = result;
159
- optionMainRef.current.style.transition = "none";
160
- optionMainRef.current.style.transform = `translateY(${newArrowDirection === "bottom" ? "-100%" : "100%"})`;
161
- setPlacement(newArrowDirection);
162
- setOptionStyle(__spreadProps(__spreadValues({}, styles), { width: childrenStyle == null ? void 0 : childrenStyle.width }));
163
- });
164
- const changeOpen = (newOpen) => __async(void 0, null, function* () {
130
+ if (!import_utils.isMini && curScrollRoot) {
131
+ const result = (0, import_utils.getStylesAndLocation)({
132
+ scrollRoot: curScrollRoot,
133
+ childrenRef: locatorRef,
134
+ arrowDirection: defaultPlacement,
135
+ arrowLocation: "none",
136
+ selector: `[data-id="${dataId}"]`,
137
+ offsetSpacing: 0
138
+ });
139
+ if (!result)
140
+ return;
141
+ const { styles, childrenStyle, newArrowDirection } = result;
142
+ setPlacement(newArrowDirection);
143
+ setOptionStyle(__spreadProps(__spreadValues({}, styles), { width: childrenStyle.width }));
144
+ }
145
+ }, 100);
146
+ const changeOpen = (newOpen) => {
165
147
  if (newOpen) {
166
- yield updateOptionStyle();
167
- setInternalOpen(newOpen);
168
- onOpen == null ? void 0 : onOpen();
148
+ updateOptionStyle();
149
+ setTimeout(() => {
150
+ setInternalOpen(newOpen);
151
+ onOpen == null ? void 0 : onOpen();
152
+ }, 100);
169
153
  } else {
170
154
  onClose == null ? void 0 : onClose();
171
155
  setInternalOpen(newOpen);
172
156
  }
173
- });
157
+ };
174
158
  const handleSelectClick = (e) => {
175
159
  if (disabled)
176
160
  return;
@@ -195,11 +179,10 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
195
179
  [selectValue, onChange, setRenderValue]
196
180
  );
197
181
  (0, import_react.useEffect)(() => {
198
- const resizeCb = (0, import_utils.throttle)(updateOptionStyle, 100);
199
182
  if (!import_utils.isMini) {
200
- window.addEventListener("resize", resizeCb);
183
+ window.addEventListener("resize", updateOptionStyle);
201
184
  return () => {
202
- window.removeEventListener("resize", resizeCb);
185
+ window.removeEventListener("resize", updateOptionStyle);
203
186
  };
204
187
  }
205
188
  }, []);
@@ -217,8 +200,8 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
217
200
  {
218
201
  in: isOpen,
219
202
  timeout: {
220
- enter: 167,
221
- exit: 167
203
+ enter: 150,
204
+ exit: 150
222
205
  }
223
206
  },
224
207
  /* @__PURE__ */ import_react.default.createElement(
@@ -232,7 +215,7 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
232
215
  [`${prefixCls}-option-container-hide`]: !isOpen
233
216
  }
234
217
  ),
235
- ref: optionContainerRef,
218
+ "data-id": dataId,
236
219
  style: optionStyle
237
220
  },
238
221
  /* @__PURE__ */ import_react.default.createElement(
@@ -241,18 +224,11 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
241
224
  in: isOpen,
242
225
  direction: placement === "bottom" ? "down" : "up",
243
226
  timeout: {
244
- enter: 167,
245
- exit: 167
227
+ enter: 150,
228
+ exit: 150
246
229
  }
247
230
  },
248
- /* @__PURE__ */ import_react.default.createElement(
249
- "div",
250
- {
251
- className: (0, import_clsx.default)(`${prefixCls}-option-main`),
252
- ref: optionMainRef
253
- },
254
- children
255
- )
231
+ /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_clsx.default)(`${prefixCls}-option-main`) }, children)
256
232
  )
257
233
  )
258
234
  );
@@ -280,8 +256,9 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
280
256
  [inputProps == null ? void 0 : inputProps.className]: inputProps == null ? void 0 : inputProps.className
281
257
  })
282
258
  })
283
- ), icon || defaultIcon)
284
- ), /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { onRootElementMouted: updateOptionStyle }, renderOptions()), /* @__PURE__ */ import_react.default.createElement(
259
+ ), icon || defaultIcon),
260
+ import_utils.isMini && renderOptions()
261
+ ), !import_utils.isMini && /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { onRootElementMouted: updateOptionStyle }, renderOptions()), /* @__PURE__ */ import_react.default.createElement(
285
262
  import_Backdrop.default,
286
263
  __spreadProps(__spreadValues({
287
264
  open: isOpen,
@@ -296,8 +273,4 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
296
273
  ));
297
274
  });
298
275
  Select.displayName = "BuiSelect";
299
- Select.defaultProps = {
300
- defaultValue: "",
301
- scrollContainer: () => null
302
- };
303
276
  var Select_default = Select;
@@ -61,16 +61,16 @@ var import_react = __toESM(require("react"));
61
61
  var import_Skeleton = require("./Skeleton.css");
62
62
  const prefixCls = "bui-skeleton";
63
63
  const Skeleton = /* @__PURE__ */ import_react.default.forwardRef(
64
- (props, ref) => {
65
- const _a = props, {
64
+ (_a, ref) => {
65
+ var _b = _a, {
66
66
  className,
67
67
  style,
68
- animation,
68
+ animation = "wave",
69
69
  width,
70
70
  height,
71
- variant,
71
+ variant = "text",
72
72
  children
73
- } = _a, others = __objRest(_a, [
73
+ } = _b, others = __objRest(_b, [
74
74
  "className",
75
75
  "style",
76
76
  "animation",
@@ -99,8 +99,4 @@ const Skeleton = /* @__PURE__ */ import_react.default.forwardRef(
99
99
  }
100
100
  );
101
101
  Skeleton.displayName = "BuiSkeleton";
102
- Skeleton.defaultProps = {
103
- animation: "wave",
104
- variant: "text"
105
- };
106
102
  var Skeleton_default = Skeleton;