@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
@@ -30,55 +30,54 @@ import React from "react";
30
30
  import clsx from "clsx";
31
31
  import { Collapse } from "../Collapse";
32
32
  const prefixCls = "bui-collapse-panel-item";
33
- const CollapsePanelItem = /* @__PURE__ */ React.forwardRef((props, ref) => {
34
- const _a = props, {
35
- className,
36
- style,
37
- label,
38
- children,
39
- icon,
40
- active,
41
- onClick
42
- } = _a, others = __objRest(_a, [
43
- "className",
44
- "style",
45
- "label",
46
- "children",
47
- "icon",
48
- "active",
49
- "onClick"
50
- ]);
51
- const isControlledIcon = typeof icon === "function";
52
- const getIcon = () => {
53
- return typeof icon === "function" ? icon(active) : icon;
54
- };
55
- return /* @__PURE__ */ React.createElement(
56
- "div",
57
- __spreadValues({
58
- className: clsx(prefixCls, active && `${prefixCls}-active`, className),
33
+ const CollapsePanelItem = /* @__PURE__ */ React.forwardRef(
34
+ (_a, ref) => {
35
+ var _b = _a, {
36
+ className,
59
37
  style,
60
- ref
61
- }, others),
62
- /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-header`, onClick }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-header-label` }, label), /* @__PURE__ */ React.createElement(
38
+ label,
39
+ children,
40
+ icon,
41
+ active = false,
42
+ onClick
43
+ } = _b, others = __objRest(_b, [
44
+ "className",
45
+ "style",
46
+ "label",
47
+ "children",
48
+ "icon",
49
+ "active",
50
+ "onClick"
51
+ ]);
52
+ const isControlledIcon = typeof icon === "function";
53
+ const getIcon = () => {
54
+ return typeof icon === "function" ? icon(active) : icon;
55
+ };
56
+ return /* @__PURE__ */ React.createElement(
63
57
  "div",
64
- {
65
- className: clsx(
66
- `${prefixCls}-header-icon`,
67
- `${prefixCls}-header-icon-arrow`,
68
- {
69
- [`${prefixCls}-header-icon-arrow-active`]: !isControlledIcon && active
70
- }
71
- )
72
- },
73
- getIcon()
74
- )),
75
- /* @__PURE__ */ React.createElement(Collapse, { in: active, direction: "vertical", timeout: 300 }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-content` }, children))
76
- );
77
- });
58
+ __spreadValues({
59
+ className: clsx(prefixCls, active && `${prefixCls}-active`, className),
60
+ style,
61
+ ref
62
+ }, others),
63
+ /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-header`, onClick }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-header-label` }, label), /* @__PURE__ */ React.createElement(
64
+ "div",
65
+ {
66
+ className: clsx(
67
+ `${prefixCls}-header-icon`,
68
+ `${prefixCls}-header-icon-arrow`,
69
+ {
70
+ [`${prefixCls}-header-icon-arrow-active`]: !isControlledIcon && active
71
+ }
72
+ )
73
+ },
74
+ getIcon()
75
+ )),
76
+ /* @__PURE__ */ React.createElement(Collapse, { in: active, direction: "vertical", timeout: 300 }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-content` }, children))
77
+ );
78
+ }
79
+ );
78
80
  CollapsePanelItem.displayName = "BuiCollapsePanelItem";
79
- CollapsePanelItem.defaultProps = {
80
- active: false
81
- };
82
81
  var CollapsePanelItem_default = CollapsePanelItem;
83
82
  export {
84
83
  CollapsePanelItem_default as default
@@ -38,11 +38,11 @@ const Countdown = forwardRef((props, ref) => {
38
38
  className,
39
39
  serverTimestamp,
40
40
  endTimestamp,
41
- remainingTime,
42
- format,
43
- unitStyle,
44
- valueStyle,
45
- timeSliceStyle,
41
+ remainingTime = 0,
42
+ format = "HH:mm:ss",
43
+ unitStyle = {},
44
+ valueStyle = [{}, {}],
45
+ timeSliceStyle = {},
46
46
  renderContent,
47
47
  onChange,
48
48
  onFinish
@@ -122,13 +122,6 @@ const Countdown = forwardRef((props, ref) => {
122
122
  return /* @__PURE__ */ React.createElement("div", __spreadValues({ ref, className: clsx(prefixCls, className) }, others), renderContent ? renderContent(time) : defaultRender(time));
123
123
  });
124
124
  Countdown.displayName = "BuiCountdown";
125
- Countdown.defaultProps = {
126
- format: "HH:mm:ss",
127
- remainingTime: 0,
128
- unitStyle: {},
129
- valueStyle: [{}, {}],
130
- timeSliceStyle: {}
131
- };
132
125
  var Countdown_default = Countdown;
133
126
  export {
134
127
  Countdown_default as default
@@ -50,7 +50,7 @@ var __async = (__this, __arguments, generator) => {
50
50
  });
51
51
  };
52
52
  import React, { useCallback, useEffect, useState } from "react";
53
- import { getRootContainer, render, unmount } from "@bifrostui/utils";
53
+ import { getRootElement, render, unmount } from "@bifrostui/utils";
54
54
  import Popup from "./Dialog";
55
55
  const { isValidElement, Component } = React;
56
56
  const formatProps = (props) => {
@@ -61,7 +61,7 @@ const formatProps = (props) => {
61
61
  };
62
62
  const DialogGenerator = (options) => {
63
63
  const rootWrapper = document.createElement("div");
64
- const rootElement = getRootContainer();
64
+ const rootElement = getRootElement();
65
65
  rootElement.appendChild(rootWrapper);
66
66
  const DialogComponent = () => {
67
67
  const _a = options, { onConfirm, onCancel, ref } = _a, others = __objRest(_a, ["onConfirm", "onCancel", "ref"]);
@@ -19,7 +19,14 @@ import React, { forwardRef } from "react";
19
19
  import "./Divider.css";
20
20
  const prefixCls = "bui-divider";
21
21
  const Divider = forwardRef((props, ref) => {
22
- const { className, style, direction, dashed, size, children } = props;
22
+ const {
23
+ className,
24
+ style,
25
+ direction = "vertical",
26
+ dashed = false,
27
+ size,
28
+ children
29
+ } = props;
23
30
  const isVertical = direction === "vertical";
24
31
  const hasChildren = !!React.Children.toArray(children).length;
25
32
  let propsStyle = {};
@@ -46,10 +53,6 @@ const Divider = forwardRef((props, ref) => {
46
53
  );
47
54
  });
48
55
  Divider.displayName = "BuiDivider";
49
- Divider.defaultProps = {
50
- direction: "vertical",
51
- dashed: false
52
- };
53
56
  var Divider_default = Divider;
54
57
  export {
55
58
  Divider_default as default
@@ -43,15 +43,15 @@ const oppositeDirection = {
43
43
  };
44
44
  const Drawer = /* @__PURE__ */ React.forwardRef((props, ref) => {
45
45
  const _a = props, {
46
- anchor: anchorProp,
46
+ anchor: anchorProp = "bottom",
47
47
  container,
48
48
  children,
49
49
  className,
50
- hideBackdrop,
50
+ hideBackdrop = false,
51
51
  onClose,
52
52
  SlideProps,
53
- open,
54
- disablePortal,
53
+ open = false,
54
+ disablePortal = false,
55
55
  contentProps,
56
56
  transitionDuration
57
57
  } = _a, others = __objRest(_a, [
@@ -105,12 +105,6 @@ const Drawer = /* @__PURE__ */ React.forwardRef((props, ref) => {
105
105
  );
106
106
  });
107
107
  Drawer.displayName = "BuiDrawer";
108
- Drawer.defaultProps = {
109
- anchor: "bottom",
110
- hideBackdrop: false,
111
- open: false,
112
- disablePortal: false
113
- };
114
108
  var Drawer_default = Drawer;
115
109
  export {
116
110
  Drawer_default as default
package/es/Fade/Fade.js CHANGED
@@ -46,64 +46,60 @@ const defaultTimeout = {
46
46
  enter: duration.enteringScreen,
47
47
  exit: duration.leavingScreen
48
48
  };
49
- const Fade = /* @__PURE__ */ React.forwardRef((props, ref) => {
50
- const _a = props, {
51
- appear,
52
- children,
53
- in: inProp,
54
- easing: easingProp,
55
- style,
56
- timeout,
57
- delay
58
- } = _a, others = __objRest(_a, [
59
- "appear",
60
- "children",
61
- "in",
62
- "easing",
63
- "style",
64
- "timeout",
65
- "delay"
66
- ]);
67
- const transitions = createTransitions();
68
- const nodeRef = useForkRef(ref, children == null ? void 0 : children.ref);
69
- return /* @__PURE__ */ React.createElement(
70
- Transition,
71
- __spreadProps(__spreadValues({
72
- appear,
49
+ const Fade = /* @__PURE__ */ React.forwardRef(
50
+ (_a, ref) => {
51
+ var _b = _a, {
52
+ appear = true,
53
+ children,
73
54
  in: inProp,
74
- timeout,
75
- delay
76
- }, others), {
77
- ref: nodeRef
78
- }),
79
- (state, childProps) => {
80
- const transition = transitions.create(
81
- "opacity",
82
- getTransitionProps(
83
- { timeout, style, easing: easingProp, delay },
84
- {
85
- mode: state
86
- }
87
- )
88
- );
89
- return React.cloneElement(children, __spreadValues({
90
- style: __spreadValues(__spreadValues({
91
- visibility: state === "exited" ? "hidden" : "visible",
92
- transition,
93
- WebkitTransition: transition,
94
- opacity: state === "entering" || state === "entered" ? "1" : "0"
95
- }, style), children.props.style)
96
- }, childProps));
97
- }
98
- );
99
- });
55
+ easing: easingProp = defaultEasing,
56
+ style,
57
+ timeout = defaultTimeout,
58
+ delay = 0
59
+ } = _b, others = __objRest(_b, [
60
+ "appear",
61
+ "children",
62
+ "in",
63
+ "easing",
64
+ "style",
65
+ "timeout",
66
+ "delay"
67
+ ]);
68
+ const transitions = createTransitions();
69
+ const nodeRef = useForkRef(ref, children == null ? void 0 : children.ref);
70
+ return /* @__PURE__ */ React.createElement(
71
+ Transition,
72
+ __spreadProps(__spreadValues({
73
+ appear,
74
+ in: inProp,
75
+ timeout,
76
+ delay
77
+ }, others), {
78
+ ref: nodeRef
79
+ }),
80
+ (state, childProps) => {
81
+ const transition = transitions.create(
82
+ "opacity",
83
+ getTransitionProps(
84
+ { timeout, style, easing: easingProp, delay },
85
+ {
86
+ mode: state
87
+ }
88
+ )
89
+ );
90
+ return React.cloneElement(children, __spreadValues({
91
+ style: __spreadValues(__spreadValues({
92
+ visibility: state === "exited" ? "hidden" : "visible",
93
+ transition,
94
+ WebkitTransition: transition,
95
+ opacity: state === "entering" || state === "entered" ? "1" : "0"
96
+ }, style), children.props.style)
97
+ }, childProps));
98
+ }
99
+ );
100
+ }
101
+ );
100
102
  Fade.displayName = "BuiFade";
101
- Fade.defaultProps = {
102
- easing: defaultEasing,
103
- timeout: defaultTimeout,
104
- appear: true,
105
- delay: 0
106
- };
107
103
  var Fade_default = Fade;
108
104
  export {
109
105
  Fade_default as default
@@ -37,11 +37,11 @@ const IconButton = /* @__PURE__ */ React.forwardRef(
37
37
  const _a = props, {
38
38
  className,
39
39
  children,
40
- color,
41
- disabled,
42
- size,
43
- variant,
44
- shape
40
+ color = "default",
41
+ disabled = false,
42
+ size = "medium",
43
+ variant = "default",
44
+ shape = "circular"
45
45
  } = _a, others = __objRest(_a, [
46
46
  "className",
47
47
  "children",
@@ -78,13 +78,6 @@ const IconButton = /* @__PURE__ */ React.forwardRef(
78
78
  }
79
79
  );
80
80
  IconButton.displayName = "BuiIconButton";
81
- IconButton.defaultProps = {
82
- size: "medium",
83
- variant: "default",
84
- shape: "circular",
85
- color: "default",
86
- disabled: false
87
- };
88
81
  var IconButton_default = IconButton;
89
82
  export {
90
83
  IconButton_default as default
package/es/Image/Image.js CHANGED
@@ -34,127 +34,120 @@ import clsx from "clsx";
34
34
  import React, { useLayoutEffect, useState } from "react";
35
35
  import "./index.css";
36
36
  const prefixCls = "bui-image";
37
- const Image = /* @__PURE__ */ React.forwardRef((props, ref) => {
38
- const [loaded, setLoaded] = useState(false);
39
- const [failed, setFailed] = useState(false);
40
- const _a = props, {
41
- fit,
42
- src,
43
- lazy,
44
- style,
45
- webp,
46
- alt,
47
- showMenu,
48
- width,
49
- height,
50
- fallback,
51
- className,
52
- placeholder,
53
- onClick,
54
- onLoad,
55
- onError,
56
- imgProps
57
- } = _a, others = __objRest(_a, [
58
- "fit",
59
- "src",
60
- "lazy",
61
- "style",
62
- "webp",
63
- "alt",
64
- "showMenu",
65
- "width",
66
- "height",
67
- "fallback",
68
- "className",
69
- "placeholder",
70
- "onClick",
71
- "onLoad",
72
- "onError",
73
- "imgProps"
74
- ]);
75
- const modeEnum = {
76
- none: "center",
77
- // 被替换的内容将保持其原有的尺寸居中裁切展示
78
- contain: "aspectFit",
79
- // 被替换的内容将被缩放,以在填充元素的内容框时保持其宽高比。 整个对象在填充盒子的同时保留其长宽比,因此如果宽高比与框的宽高比不匹配
80
- cover: "aspectFill",
81
- // 被替换的内容在保持其宽高比的同时填充元素的整个内容框。如果对象的宽高比与内容框不相匹配,该对象将被剪裁以适应内容框。
82
- fill: "scaleToFill",
83
- // 被替换的内容正好填充元素的内容框。整个对象将完全填充此框。如果对象的宽高比与内容框不相匹配,那么该对象将被拉伸以适应内容框
84
- "scale-down": "aspectFit",
85
- // 内容的尺寸与 none 或 contain 中的一个相同,取决于它们两个之间谁得到的对象尺寸会更小一些。
86
- widthFix: "widthFix",
87
- // 【微信小程序】缩放模式,宽度不变,高度自动变化,保持原图宽高比不变。
88
- heightFix: "heightFix"
89
- // 【微信小程序】缩放模式,高度不变,宽度自动变化,保持原图宽高比不变。
90
- };
91
- useLayoutEffect(() => {
92
- setLoaded(false);
93
- setFailed(false);
94
- }, [src]);
95
- function defaultIconWrap(icon) {
96
- return /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-default-icon-wrap` }, icon);
97
- }
98
- const defaultIcon = defaultIconWrap(
99
- /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-default-icon-item` })
100
- );
101
- const defaultPlaceholder = placeholder === false ? [] : placeholder !== true && defaultIconWrap(placeholder) || defaultIcon;
102
- const defaultFallback = fallback && defaultIconWrap(fallback) || defaultPlaceholder;
103
- const miniAttr = {
104
- webp,
105
- lazyLoad: lazy,
106
- "lazy-load": lazy,
107
- mode: fit && modeEnum[fit],
108
- showMenuByLongpress: showMenu
109
- };
110
- const imgEle = /* @__PURE__ */ React.createElement(
111
- "img",
112
- __spreadValues(__spreadProps(__spreadValues({
113
- src,
114
- loading: lazy ? "lazy" : "eager",
115
- onLoad: (e) => {
116
- setLoaded(true);
117
- onLoad == null ? void 0 : onLoad(e);
118
- },
119
- onError: (e) => {
120
- setFailed(true);
121
- onError == null ? void 0 : onError(e);
122
- },
123
- alt
124
- }, imgProps), {
125
- style: __spreadValues({ objectFit: fit }, (imgProps == null ? void 0 : imgProps.style) || {}),
126
- className: clsx(
127
- `${prefixCls}-img`,
128
- // 无占位且不onFail时直接展示img本体
129
- (loaded || placeholder === false && !failed) && `${prefixCls}-loaded`,
130
- imgProps == null ? void 0 : imgProps.className
131
- )
132
- }), isMini ? miniAttr : {})
133
- );
134
- function renderImgEle() {
135
- return /* @__PURE__ */ React.createElement(React.Fragment, null, failed && defaultFallback || !loaded && defaultPlaceholder || null, imgEle);
136
- }
137
- return /* @__PURE__ */ React.createElement(
138
- "div",
139
- __spreadValues({
140
- ref,
37
+ const Image = /* @__PURE__ */ React.forwardRef(
38
+ (_a, ref) => {
39
+ var _b = _a, {
40
+ fit = "fill",
41
+ src = "",
42
+ lazy = false,
43
+ style,
44
+ webp,
45
+ alt,
46
+ showMenu,
47
+ width,
48
+ height,
49
+ fallback = null,
50
+ className,
51
+ placeholder = false,
141
52
  onClick,
142
- style: __spreadValues({ width, height }, style),
143
- className: clsx(prefixCls, className)
144
- }, others),
145
- renderImgEle()
146
- );
147
- });
53
+ onLoad,
54
+ onError,
55
+ imgProps
56
+ } = _b, others = __objRest(_b, [
57
+ "fit",
58
+ "src",
59
+ "lazy",
60
+ "style",
61
+ "webp",
62
+ "alt",
63
+ "showMenu",
64
+ "width",
65
+ "height",
66
+ "fallback",
67
+ "className",
68
+ "placeholder",
69
+ "onClick",
70
+ "onLoad",
71
+ "onError",
72
+ "imgProps"
73
+ ]);
74
+ const [loaded, setLoaded] = useState(false);
75
+ const [failed, setFailed] = useState(false);
76
+ const modeEnum = {
77
+ none: "center",
78
+ // 被替换的内容将保持其原有的尺寸居中裁切展示
79
+ contain: "aspectFit",
80
+ // 被替换的内容将被缩放,以在填充元素的内容框时保持其宽高比。 整个对象在填充盒子的同时保留其长宽比,因此如果宽高比与框的宽高比不匹配
81
+ cover: "aspectFill",
82
+ // 被替换的内容在保持其宽高比的同时填充元素的整个内容框。如果对象的宽高比与内容框不相匹配,该对象将被剪裁以适应内容框。
83
+ fill: "scaleToFill",
84
+ // 被替换的内容正好填充元素的内容框。整个对象将完全填充此框。如果对象的宽高比与内容框不匹配,那么该对象将被拉伸以适应内容框
85
+ "scale-down": "aspectFit",
86
+ // 内容的尺寸与 none 或 contain 中的一个相同,取决于它们两个之间谁得到的对象尺寸会更小一些。
87
+ widthFix: "widthFix",
88
+ // 【微信小程序】缩放模式,宽度不变,高度自动变化,保持原图宽高比不变。
89
+ heightFix: "heightFix"
90
+ // 【微信小程序】缩放模式,高度不变,宽度自动变化,保持原图宽高比不变。
91
+ };
92
+ useLayoutEffect(() => {
93
+ setLoaded(false);
94
+ setFailed(false);
95
+ }, [src]);
96
+ function defaultIconWrap(icon) {
97
+ return /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-default-icon-wrap` }, icon);
98
+ }
99
+ const defaultIcon = defaultIconWrap(
100
+ /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-default-icon-item` })
101
+ );
102
+ const defaultPlaceholder = placeholder === false ? [] : placeholder !== true && defaultIconWrap(placeholder) || defaultIcon;
103
+ const defaultFallback = fallback && defaultIconWrap(fallback) || defaultPlaceholder;
104
+ const miniAttr = {
105
+ webp,
106
+ lazyLoad: lazy,
107
+ "lazy-load": lazy,
108
+ mode: fit && modeEnum[fit],
109
+ showMenuByLongpress: showMenu
110
+ };
111
+ const imgEle = /* @__PURE__ */ React.createElement(
112
+ "img",
113
+ __spreadValues(__spreadProps(__spreadValues({
114
+ src,
115
+ loading: lazy ? "lazy" : "eager",
116
+ onLoad: (e) => {
117
+ setLoaded(true);
118
+ onLoad == null ? void 0 : onLoad(e);
119
+ },
120
+ onError: (e) => {
121
+ setFailed(true);
122
+ onError == null ? void 0 : onError(e);
123
+ },
124
+ alt
125
+ }, imgProps), {
126
+ style: __spreadValues({ objectFit: fit }, (imgProps == null ? void 0 : imgProps.style) || {}),
127
+ className: clsx(
128
+ `${prefixCls}-img`,
129
+ // 无占位且不onFail时直接展示img本体
130
+ (loaded || placeholder === false && !failed) && `${prefixCls}-loaded`,
131
+ imgProps == null ? void 0 : imgProps.className
132
+ )
133
+ }), isMini ? miniAttr : {})
134
+ );
135
+ function renderImgEle() {
136
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, failed && defaultFallback || !loaded && defaultPlaceholder || null, imgEle);
137
+ }
138
+ return /* @__PURE__ */ React.createElement(
139
+ "div",
140
+ __spreadValues({
141
+ ref,
142
+ onClick,
143
+ style: __spreadValues({ width, height }, style),
144
+ className: clsx(prefixCls, className)
145
+ }, others),
146
+ renderImgEle()
147
+ );
148
+ }
149
+ );
148
150
  Image.displayName = "BuiImage";
149
- Image.defaultProps = {
150
- src: "",
151
- lazy: false,
152
- fallback: null,
153
- placeholder: false,
154
- width: void 0,
155
- height: void 0,
156
- fit: "fill"
157
- };
158
151
  var Image_default = Image;
159
152
  export {
160
153
  Image_default as default
package/es/Input/Input.js CHANGED
@@ -38,17 +38,17 @@ const prefixCls = "bui-input";
38
38
  const Input = forwardRef((props, ref) => {
39
39
  const _a = props, {
40
40
  className,
41
- defaultValue,
41
+ defaultValue = "",
42
42
  value,
43
43
  inputProps,
44
44
  inputRef,
45
45
  name,
46
- type,
47
- clearable,
46
+ type = "text",
47
+ clearable = false,
48
48
  startIcon,
49
49
  endIcon,
50
50
  placeholder,
51
- disabled,
51
+ disabled = false,
52
52
  onClear,
53
53
  onChange,
54
54
  onFocus,
@@ -146,12 +146,6 @@ const Input = forwardRef((props, ref) => {
146
146
  );
147
147
  });
148
148
  Input.displayName = "BuiInput";
149
- Input.defaultProps = {
150
- defaultValue: "",
151
- type: "text",
152
- clearable: false,
153
- disabled: false
154
- };
155
149
  var Input_default = Input;
156
150
  export {
157
151
  Input_default as default
package/es/List/List.js CHANGED
@@ -33,11 +33,11 @@ import "./List.css";
33
33
  const prefixCls = "bui-list";
34
34
  const List = /* @__PURE__ */ React.forwardRef((props, ref) => {
35
35
  const _a = props, {
36
- hideDivider,
36
+ hideDivider = false,
37
37
  children,
38
38
  className,
39
- size,
40
- component: Component,
39
+ size = "medium",
40
+ component: Component = "div",
41
41
  header,
42
42
  subheader
43
43
  } = _a, others = __objRest(_a, [
@@ -66,11 +66,6 @@ const List = /* @__PURE__ */ React.forwardRef((props, ref) => {
66
66
  ));
67
67
  });
68
68
  List.displayName = "BuiList";
69
- List.defaultProps = {
70
- hideDivider: false,
71
- size: "medium",
72
- component: "div"
73
- };
74
69
  var List_default = List;
75
70
  export {
76
71
  List_default as default