@bifrostui/react 1.4.7 → 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 (118) 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 +6 -14
  11. package/dist/Card/Card.css +1 -1
  12. package/dist/Card/CardContent.css +1 -2
  13. package/dist/Card/CardFooter.css +2 -4
  14. package/dist/Card/CardHeader.css +4 -5
  15. package/dist/Checkbox/Checkbox.js +2 -6
  16. package/dist/Checkbox/CheckboxGroup.js +4 -7
  17. package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
  18. package/dist/Countdown/Countdown.js +5 -12
  19. package/dist/Divider/Divider.js +8 -5
  20. package/dist/Drawer/Drawer.js +4 -10
  21. package/dist/Fade/Fade.js +52 -56
  22. package/dist/IconButton/IconButton.js +5 -12
  23. package/dist/Image/Image.js +112 -119
  24. package/dist/Input/Input.js +4 -10
  25. package/dist/List/List.js +3 -8
  26. package/dist/List/ListItem.js +42 -44
  27. package/dist/List/ListItemContent.js +1 -4
  28. package/dist/List/ListItemExtra.js +9 -4
  29. package/dist/List/ListItemFooter.js +9 -4
  30. package/dist/List/ListItemHeader.js +9 -4
  31. package/dist/Loading/Loading.js +13 -4
  32. package/dist/Modal/Modal.js +0 -6
  33. package/dist/Modal/Modal.miniapp.d.ts +1 -1
  34. package/dist/Modal/Modal.miniapp.js +4 -10
  35. package/dist/NavBar/NavBar.js +0 -1
  36. package/dist/Popover/Popover.css +5 -5
  37. package/dist/Radio/Radio.css +0 -1
  38. package/dist/Radio/Radio.js +2 -6
  39. package/dist/Radio/RadioGroup.js +0 -3
  40. package/dist/Rating/Rating.js +8 -18
  41. package/dist/Select/Select.js +4 -8
  42. package/dist/Skeleton/Skeleton.js +5 -9
  43. package/dist/Slide/Slide.js +69 -74
  44. package/dist/Slider/Slider.js +6 -14
  45. package/dist/Steps/Step.js +81 -82
  46. package/dist/Steps/Steps.d.ts +1 -1
  47. package/dist/Steps/Steps.js +57 -60
  48. package/dist/Switch/Switch.js +75 -78
  49. package/dist/TabBar/TabBar.js +3 -8
  50. package/dist/Tabs/Tab.css +10 -16
  51. package/dist/Tabs/Tab.js +15 -7
  52. package/dist/Tabs/Tabs.css +13 -22
  53. package/dist/Tabs/Tabs.js +26 -42
  54. package/dist/Tabs/Tabs.types.d.ts +0 -10
  55. package/dist/Tag/Tag.css +1 -1
  56. package/dist/Tag/Tag.js +2 -6
  57. package/dist/TextArea/TextArea.js +5 -12
  58. package/dist/Tooltip/Tooltip.css +5 -5
  59. package/dist/Transition/TransitionCore.js +3 -8
  60. package/es/ActionSheet/ActionSheet.css +2 -2
  61. package/es/ActionSheet/ActionSheetItem.js +3 -8
  62. package/es/Avatar/Avatar.js +3 -8
  63. package/es/Avatar/AvatarGroup.js +2 -6
  64. package/es/Badge/Badge.js +3 -8
  65. package/es/Button/Button.css +77 -78
  66. package/es/Button/Button.d.ts +1 -1
  67. package/es/Button/Button.js +3 -9
  68. package/es/Button/Button.types.d.ts +8 -7
  69. package/es/Calendar/Calendar.js +6 -14
  70. package/es/Card/Card.css +1 -1
  71. package/es/Card/CardContent.css +1 -2
  72. package/es/Card/CardFooter.css +2 -4
  73. package/es/Card/CardHeader.css +4 -5
  74. package/es/Checkbox/Checkbox.js +2 -6
  75. package/es/Checkbox/CheckboxGroup.js +4 -7
  76. package/es/CollapsePanel/CollapsePanelItem.js +45 -46
  77. package/es/Countdown/Countdown.js +5 -12
  78. package/es/Divider/Divider.js +8 -5
  79. package/es/Drawer/Drawer.js +4 -10
  80. package/es/Fade/Fade.js +52 -56
  81. package/es/IconButton/IconButton.js +5 -12
  82. package/es/Image/Image.js +112 -119
  83. package/es/Input/Input.js +4 -10
  84. package/es/List/List.js +3 -8
  85. package/es/List/ListItem.js +42 -44
  86. package/es/List/ListItemContent.js +1 -4
  87. package/es/List/ListItemExtra.js +9 -4
  88. package/es/List/ListItemFooter.js +9 -4
  89. package/es/List/ListItemHeader.js +9 -4
  90. package/es/Loading/Loading.js +13 -4
  91. package/es/Modal/Modal.js +0 -6
  92. package/es/Modal/Modal.miniapp.js +4 -10
  93. package/es/NavBar/NavBar.js +0 -1
  94. package/es/Popover/Popover.css +5 -5
  95. package/es/Radio/Radio.css +0 -1
  96. package/es/Radio/Radio.js +2 -6
  97. package/es/Radio/RadioGroup.js +0 -3
  98. package/es/Rating/Rating.js +8 -18
  99. package/es/Select/Select.js +4 -8
  100. package/es/Skeleton/Skeleton.js +5 -9
  101. package/es/Slide/Slide.js +69 -74
  102. package/es/Slider/Slider.js +6 -14
  103. package/es/Steps/Step.js +81 -82
  104. package/es/Steps/Steps.d.ts +1 -1
  105. package/es/Steps/Steps.js +57 -60
  106. package/es/Switch/Switch.js +75 -78
  107. package/es/TabBar/TabBar.js +3 -8
  108. package/es/Tabs/Tab.css +10 -16
  109. package/es/Tabs/Tab.js +15 -7
  110. package/es/Tabs/Tabs.css +13 -22
  111. package/es/Tabs/Tabs.js +28 -55
  112. package/es/Tabs/Tabs.types.d.ts +0 -10
  113. package/es/Tag/Tag.css +1 -1
  114. package/es/Tag/Tag.js +2 -6
  115. package/es/TextArea/TextArea.js +5 -12
  116. package/es/Tooltip/Tooltip.css +5 -5
  117. package/es/Transition/TransitionCore.js +3 -8
  118. package/package.json +6 -6
@@ -62,12 +62,17 @@ var import_ListItemHeader2 = require("./ListItemHeader.css");
62
62
  const prefixCls = "bui-list-item-header";
63
63
  const ListItemHeader = /* @__PURE__ */ import_react.default.forwardRef(
64
64
  (props, ref) => {
65
- const _a = props, { children, className, component: Component } = _a, others = __objRest(_a, ["children", "className", "component"]);
65
+ const _a = props, {
66
+ children,
67
+ className,
68
+ component: Component = "div"
69
+ } = _a, others = __objRest(_a, [
70
+ "children",
71
+ "className",
72
+ "component"
73
+ ]);
66
74
  return /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({ className: (0, import_clsx.default)(prefixCls, className), ref }, others), children);
67
75
  }
68
76
  );
69
77
  ListItemHeader.displayName = "BuiListItemHeader";
70
- ListItemHeader.defaultProps = {
71
- component: "div"
72
- };
73
78
  var ListItemHeader_default = ListItemHeader;
@@ -62,7 +62,19 @@ var import_icons = require("@bifrostui/icons");
62
62
  var import_Loading2 = require("./Loading.css");
63
63
  const prefixCls = "bui-loading";
64
64
  const Loading = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
65
- const _a = props, { className, icon, IconProps, children, direction } = _a, otherProps = __objRest(_a, ["className", "icon", "IconProps", "children", "direction"]);
65
+ const _a = props, {
66
+ className,
67
+ icon,
68
+ IconProps,
69
+ children,
70
+ direction = "vertical"
71
+ } = _a, otherProps = __objRest(_a, [
72
+ "className",
73
+ "icon",
74
+ "IconProps",
75
+ "children",
76
+ "direction"
77
+ ]);
66
78
  const renderIcon = () => {
67
79
  return icon != null ? icon : /* @__PURE__ */ import_react.default.createElement(
68
80
  import_icons.LoadingThreeQuartersOutlinedIcon,
@@ -82,7 +94,4 @@ const Loading = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
82
94
  );
83
95
  });
84
96
  Loading.displayName = "BuiLoading";
85
- Loading.defaultProps = {
86
- direction: "vertical"
87
- };
88
97
  var Loading_default = Loading;
@@ -136,10 +136,4 @@ const Modal = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
136
136
  ) : null, (open || keepMounted) && children));
137
137
  });
138
138
  Modal.displayName = "BuiModal";
139
- Modal.defaultProps = {
140
- open: false,
141
- disablePortal: false,
142
- disableScrollLock: false,
143
- hideBackdrop: false
144
- };
145
139
  var Modal_default = Modal;
@@ -12,5 +12,5 @@ declare const Modal: React.ForwardRefExoticComponent<Omit<ViewProps & {
12
12
  keepMounted?: boolean;
13
13
  } & import("@bifrostui/types").ICommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
14
  ref?: React.Ref<HTMLDivElement>;
15
- }, "open" | "container" | "disablePortal" | keyof import("@bifrostui/types").ICommonProps | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ }, keyof import("@bifrostui/types").ICommonProps | "open" | "container" | "disablePortal" | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
16
  export default Modal;
@@ -71,13 +71,13 @@ const Modal = /* @__PURE__ */ import_react.default.forwardRef(
71
71
  (props, ref) => {
72
72
  const _a = props, {
73
73
  className,
74
- open,
74
+ open = false,
75
75
  BackdropProps,
76
76
  children,
77
77
  container,
78
- disablePortal,
79
- disableScrollLock,
80
- hideBackdrop,
78
+ disablePortal = false,
79
+ disableScrollLock = false,
80
+ hideBackdrop = false,
81
81
  onClose,
82
82
  keepMounted
83
83
  } = _a, others = __objRest(_a, [
@@ -133,10 +133,4 @@ const Modal = /* @__PURE__ */ import_react.default.forwardRef(
133
133
  }
134
134
  );
135
135
  Modal.displayName = "BuiModal";
136
- Modal.defaultProps = {
137
- open: false,
138
- disablePortal: false,
139
- disableScrollLock: false,
140
- hideBackdrop: false
141
- };
142
136
  var Modal_miniapp_default = Modal;
@@ -133,5 +133,4 @@ const NavBar = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
133
133
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderNavBar(), renderPlaceholder());
134
134
  });
135
135
  NavBar.displayName = "BuiNavBar";
136
- NavBar.defaultProps = {};
137
136
  var NavBar_default = NavBar;
@@ -1,6 +1,6 @@
1
1
  .bui-popover {
2
2
  --arrow-size: var(--bui-popover-arrow-size, 8PX);
3
- --localtion-position: var(--bui-popover-localtion-position, 8PX);
3
+ --location-position: var(--bui-popover-location-position, 8PX);
4
4
  --max-width: var(--bui-popover-max-width, 350px);
5
5
  --content-min-width: var(--bui-popover-content-min-width, 30px);
6
6
  --content-padding: var(--bui-popover-content-padding, 6px 8px);
@@ -16,16 +16,16 @@
16
16
  position: absolute;
17
17
  }
18
18
  .bui-popover .bui-popover-arrow.location-left {
19
- left: var(--localtion-position);
19
+ left: var(--location-position);
20
20
  }
21
21
  .bui-popover .bui-popover-arrow.location-right {
22
- right: var(--localtion-position);
22
+ right: var(--location-position);
23
23
  }
24
24
  .bui-popover .bui-popover-arrow.location-top {
25
- top: var(--localtion-position);
25
+ top: var(--location-position);
26
26
  }
27
27
  .bui-popover .bui-popover-arrow.location-bottom {
28
- bottom: var(--localtion-position);
28
+ bottom: var(--location-position);
29
29
  }
30
30
  .bui-popover.popover-top .location-center,
31
31
  .bui-popover.popover-bottom .location-center {
@@ -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;
@@ -80,12 +80,14 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
80
80
  inputProps,
81
81
  BackdropProps,
82
82
  value,
83
- defaultValue,
83
+ defaultValue = "",
84
84
  disabled,
85
85
  placeholder,
86
86
  icon,
87
87
  open,
88
- scrollContainer,
88
+ scrollContainer = () => {
89
+ return import_utils.isMini ? null : document.body;
90
+ },
89
91
  onChange,
90
92
  onClose,
91
93
  onOpen,
@@ -271,10 +273,4 @@ const Select = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
271
273
  ));
272
274
  });
273
275
  Select.displayName = "BuiSelect";
274
- Select.defaultProps = {
275
- defaultValue: "",
276
- scrollContainer: () => {
277
- return import_utils.isMini ? null : document.body;
278
- }
279
- };
280
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;
@@ -70,80 +70,75 @@ const defaultTimeout = {
70
70
  enter: import_utils.duration.enteringScreen,
71
71
  exit: import_utils.duration.leavingScreen
72
72
  };
73
- const Slide = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
74
- const _a = props, {
75
- appear,
76
- in: inProp,
77
- children,
78
- style,
79
- easing: easingProp,
80
- timeout,
81
- direction,
82
- delay
83
- } = _a, others = __objRest(_a, [
84
- "appear",
85
- "in",
86
- "children",
87
- "style",
88
- "easing",
89
- "timeout",
90
- "direction",
91
- "delay"
92
- ]);
93
- const transitions = (0, import_utils.createTransitions)();
94
- const nodeRef = (0, import_utils.useForkRef)(ref, children == null ? void 0 : children.ref);
95
- const getTranslateValue = (_direction) => {
96
- if (_direction === "left") {
97
- return "translateX(100%)";
98
- }
99
- if (_direction === "right") {
100
- return "translateX(-100%)";
101
- }
102
- if (_direction === "up") {
103
- return "translateY(100%)";
104
- }
105
- return "translateY(-100%)";
106
- };
107
- if (!children)
108
- return null;
109
- return /* @__PURE__ */ import_react.default.createElement(
110
- import_Transition.default,
111
- __spreadProps(__spreadValues({}, others), {
112
- appear,
73
+ const Slide = /* @__PURE__ */ import_react.default.forwardRef(
74
+ (_a, ref) => {
75
+ var _b = _a, {
76
+ appear = true,
113
77
  in: inProp,
114
- timeout,
115
- delay,
116
- ref: nodeRef
117
- }),
118
- (state, childProps) => {
119
- const transition = transitions.create(
120
- "transform",
121
- (0, import_utils.getTransitionProps)(
122
- { timeout, style, easing: easingProp, delay },
123
- {
124
- mode: state
125
- }
126
- )
127
- );
128
- const transform = state === "entering" || state === "entered" ? "none" : getTranslateValue(direction);
129
- return import_react.default.cloneElement(children, __spreadValues({
130
- style: __spreadValues(__spreadValues({
131
- visibility: state === "exited" ? "hidden" : "visible",
132
- transition,
133
- WebkitTransition: transition,
134
- transform,
135
- WebkitTransform: transform
136
- }, style), children.props.style)
137
- }, childProps));
138
- }
139
- );
140
- });
78
+ children,
79
+ style,
80
+ easing: easingProp = defaultEasing,
81
+ timeout = defaultTimeout,
82
+ direction = "down",
83
+ delay = 0
84
+ } = _b, others = __objRest(_b, [
85
+ "appear",
86
+ "in",
87
+ "children",
88
+ "style",
89
+ "easing",
90
+ "timeout",
91
+ "direction",
92
+ "delay"
93
+ ]);
94
+ const transitions = (0, import_utils.createTransitions)();
95
+ const nodeRef = (0, import_utils.useForkRef)(ref, children == null ? void 0 : children.ref);
96
+ const getTranslateValue = (_direction) => {
97
+ if (_direction === "left") {
98
+ return "translateX(100%)";
99
+ }
100
+ if (_direction === "right") {
101
+ return "translateX(-100%)";
102
+ }
103
+ if (_direction === "up") {
104
+ return "translateY(100%)";
105
+ }
106
+ return "translateY(-100%)";
107
+ };
108
+ if (!children)
109
+ return null;
110
+ return /* @__PURE__ */ import_react.default.createElement(
111
+ import_Transition.default,
112
+ __spreadProps(__spreadValues({}, others), {
113
+ appear,
114
+ in: inProp,
115
+ timeout,
116
+ delay,
117
+ ref: nodeRef
118
+ }),
119
+ (state, childProps) => {
120
+ const transition = transitions.create(
121
+ "transform",
122
+ (0, import_utils.getTransitionProps)(
123
+ { timeout, style, easing: easingProp, delay },
124
+ {
125
+ mode: state
126
+ }
127
+ )
128
+ );
129
+ const transform = state === "entering" || state === "entered" ? "none" : getTranslateValue(direction);
130
+ return import_react.default.cloneElement(children, __spreadValues({
131
+ style: __spreadValues(__spreadValues({
132
+ visibility: state === "exited" ? "hidden" : "visible",
133
+ transition,
134
+ WebkitTransition: transition,
135
+ transform,
136
+ WebkitTransform: transform
137
+ }, style), children.props.style)
138
+ }, childProps));
139
+ }
140
+ );
141
+ }
142
+ );
141
143
  Slide.displayName = "BuiSlide";
142
- Slide.defaultProps = {
143
- appear: true,
144
- easing: defaultEasing,
145
- timeout: defaultTimeout,
146
- direction: "down",
147
- delay: 0
148
- };
149
144
  var Slide_default = Slide;
@@ -97,15 +97,15 @@ const Slider = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
97
97
  className,
98
98
  defaultValue,
99
99
  value: valueProp,
100
- min,
101
- max,
102
- step,
103
- tipVisible,
104
- tooltipRender,
100
+ min = 0,
101
+ max = 100,
102
+ step = 1,
103
+ tipVisible = false,
104
+ tooltipRender = (value2) => value2,
105
105
  disabled,
106
106
  startIcon,
107
107
  endIcon,
108
- disableSwap,
108
+ disableSwap = false,
109
109
  onChange
110
110
  } = _a, others = __objRest(_a, [
111
111
  "className",
@@ -314,12 +314,4 @@ const Slider = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
314
314
  );
315
315
  });
316
316
  Slider.displayName = "BuiSlider";
317
- Slider.defaultProps = {
318
- min: 0,
319
- max: 100,
320
- step: 1,
321
- disableSwap: false,
322
- tipVisible: false,
323
- tooltipRender: (value) => value
324
- };
325
317
  var Slider_default = Slider;
@@ -68,97 +68,96 @@ const classes = {
68
68
  title: "bui-step-title",
69
69
  subtitle: "bui-step-subtitle"
70
70
  };
71
- const Step = (0, import_react.forwardRef)((props, ref) => {
72
- const _a = props, {
73
- className,
74
- description,
75
- icon,
76
- title,
77
- subtitle,
78
- status,
79
- disabled,
80
- onClick
81
- } = _a, others = __objRest(_a, [
82
- "className",
83
- "description",
84
- "icon",
85
- "title",
86
- "subtitle",
87
- "status",
88
- "disabled",
89
- "onClick"
90
- ]);
91
- const stepsContext = (0, import_react.useContext)(import_StepsContext.default);
92
- const { direction, labelPlacement, current, onChange } = stepsContext;
93
- const isTitleVertical = labelPlacement === "vertical";
94
- const handleClick = (e) => {
95
- if (disabled)
96
- return;
97
- onClick == null ? void 0 : onClick(e, { current });
98
- onChange == null ? void 0 : onChange(e, { current });
99
- };
100
- const renderIcon = () => {
101
- const icons = {
102
- active: /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.icon}-active` }),
103
- wait: /* @__PURE__ */ import_react.default.createElement(import_icons.CircleOutlinedIcon, { htmlColor: "#ced1d6" }),
104
- finish: /* @__PURE__ */ import_react.default.createElement(import_icons.SuccessCircleFilledIcon, { color: "primary" }),
105
- error: /* @__PURE__ */ import_react.default.createElement(import_icons.ErrorCircleFilledIcon, { color: "primary" })
71
+ const Step = (0, import_react.forwardRef)(
72
+ (_a, ref) => {
73
+ var _b = _a, {
74
+ className,
75
+ description,
76
+ icon,
77
+ title,
78
+ subtitle,
79
+ status,
80
+ disabled = false,
81
+ onClick
82
+ } = _b, others = __objRest(_b, [
83
+ "className",
84
+ "description",
85
+ "icon",
86
+ "title",
87
+ "subtitle",
88
+ "status",
89
+ "disabled",
90
+ "onClick"
91
+ ]);
92
+ const stepsContext = (0, import_react.useContext)(import_StepsContext.default);
93
+ const { direction, labelPlacement, current, onChange } = stepsContext;
94
+ const isTitleVertical = labelPlacement === "vertical";
95
+ const handleClick = (e) => {
96
+ if (disabled)
97
+ return;
98
+ onClick == null ? void 0 : onClick(e, { current });
99
+ onChange == null ? void 0 : onChange(e, { current });
106
100
  };
107
- if (icon)
108
- return icon;
109
- return icons[status];
110
- };
111
- return /* @__PURE__ */ import_react.default.createElement(
112
- "div",
113
- __spreadValues({
114
- className: (0, import_clsx.default)(classes.root, className, {
115
- [`${classes.root}-${direction}`]: direction,
116
- [`${classes.root}-label-${labelPlacement}`]: labelPlacement,
117
- [`${classes.root}-disabled`]: disabled
118
- }),
119
- ref,
120
- onClick: handleClick
121
- }, others),
122
- /* @__PURE__ */ import_react.default.createElement(
123
- "div",
124
- {
125
- className: (0, import_clsx.default)(classes.line, {
126
- [`${classes.line}-${status}`]: status
127
- })
128
- }
129
- ),
130
- /* @__PURE__ */ import_react.default.createElement("div", { className: classes.icon }, renderIcon()),
131
- /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ import_react.default.createElement(
101
+ const renderIcon = () => {
102
+ const icons = {
103
+ active: /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.icon}-active` }),
104
+ wait: /* @__PURE__ */ import_react.default.createElement(import_icons.CircleOutlinedIcon, { htmlColor: "#ced1d6" }),
105
+ finish: /* @__PURE__ */ import_react.default.createElement(import_icons.SuccessCircleFilledIcon, { color: "primary" }),
106
+ error: /* @__PURE__ */ import_react.default.createElement(import_icons.ErrorCircleFilledIcon, { color: "primary" })
107
+ };
108
+ if (icon)
109
+ return icon;
110
+ return icons[status];
111
+ };
112
+ return /* @__PURE__ */ import_react.default.createElement(
132
113
  "div",
133
- {
134
- className: (0, import_clsx.default)(`${classes.title}-wrapper`, {
135
- [`${classes.title}-wrapper-vertical`]: isTitleVertical,
136
- [`${classes.title}-wrapper-line-${status}`]: status
137
- })
138
- },
139
- !!title && /* @__PURE__ */ import_react.default.createElement(
114
+ __spreadValues({
115
+ className: (0, import_clsx.default)(classes.root, className, {
116
+ [`${classes.root}-${direction}`]: direction,
117
+ [`${classes.root}-label-${labelPlacement}`]: labelPlacement,
118
+ [`${classes.root}-disabled`]: disabled
119
+ }),
120
+ ref,
121
+ onClick: handleClick
122
+ }, others),
123
+ /* @__PURE__ */ import_react.default.createElement(
140
124
  "div",
141
125
  {
142
- className: (0, import_clsx.default)(classes.title, `${classes.title}-${status}`, {
143
- [`${classes.title}-${labelPlacement}`]: labelPlacement
126
+ className: (0, import_clsx.default)(classes.line, {
127
+ [`${classes.line}-${status}`]: status
144
128
  })
145
- },
146
- title
129
+ }
147
130
  ),
148
- !!subtitle && /* @__PURE__ */ import_react.default.createElement(
131
+ /* @__PURE__ */ import_react.default.createElement("div", { className: classes.icon }, renderIcon()),
132
+ /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ import_react.default.createElement(
149
133
  "div",
150
134
  {
151
- className: (0, import_clsx.default)(classes.subtitle, {
152
- [`${classes.subtitle}-${labelPlacement}`]: labelPlacement
135
+ className: (0, import_clsx.default)(`${classes.title}-wrapper`, {
136
+ [`${classes.title}-wrapper-vertical`]: isTitleVertical,
137
+ [`${classes.title}-wrapper-line-${status}`]: status
153
138
  })
154
139
  },
155
- subtitle
156
- )
157
- ), !!description && /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.root}-desc` }, description))
158
- );
159
- });
140
+ !!title && /* @__PURE__ */ import_react.default.createElement(
141
+ "div",
142
+ {
143
+ className: (0, import_clsx.default)(classes.title, `${classes.title}-${status}`, {
144
+ [`${classes.title}-${labelPlacement}`]: labelPlacement
145
+ })
146
+ },
147
+ title
148
+ ),
149
+ !!subtitle && /* @__PURE__ */ import_react.default.createElement(
150
+ "div",
151
+ {
152
+ className: (0, import_clsx.default)(classes.subtitle, {
153
+ [`${classes.subtitle}-${labelPlacement}`]: labelPlacement
154
+ })
155
+ },
156
+ subtitle
157
+ )
158
+ ), !!description && /* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.root}-desc` }, description))
159
+ );
160
+ }
161
+ );
160
162
  Step.displayName = "Step";
161
- Step.defaultProps = {
162
- disabled: false
163
- };
164
163
  var Step_default = Step;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import './Steps.less';
3
2
  import { StepsProps } from './Steps.types';
3
+ import './Steps.less';
4
4
  declare const Steps: React.ForwardRefExoticComponent<Omit<StepsProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  export default Steps;