@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
package/es/Steps/Step.js CHANGED
@@ -42,99 +42,98 @@ const classes = {
42
42
  title: "bui-step-title",
43
43
  subtitle: "bui-step-subtitle"
44
44
  };
45
- const Step = forwardRef((props, ref) => {
46
- const _a = props, {
47
- className,
48
- description,
49
- icon,
50
- title,
51
- subtitle,
52
- status,
53
- disabled,
54
- onClick
55
- } = _a, others = __objRest(_a, [
56
- "className",
57
- "description",
58
- "icon",
59
- "title",
60
- "subtitle",
61
- "status",
62
- "disabled",
63
- "onClick"
64
- ]);
65
- const stepsContext = useContext(StepsContext);
66
- const { direction, labelPlacement, current, onChange } = stepsContext;
67
- const isTitleVertical = labelPlacement === "vertical";
68
- const handleClick = (e) => {
69
- if (disabled)
70
- return;
71
- onClick == null ? void 0 : onClick(e, { current });
72
- onChange == null ? void 0 : onChange(e, { current });
73
- };
74
- const renderIcon = () => {
75
- const icons = {
76
- active: /* @__PURE__ */ React.createElement("div", { className: `${classes.icon}-active` }),
77
- wait: /* @__PURE__ */ React.createElement(CircleOutlinedIcon, { htmlColor: "#ced1d6" }),
78
- finish: /* @__PURE__ */ React.createElement(SuccessCircleFilledIcon, { color: "primary" }),
79
- error: /* @__PURE__ */ React.createElement(ErrorCircleFilledIcon, { color: "primary" })
45
+ const Step = forwardRef(
46
+ (_a, ref) => {
47
+ var _b = _a, {
48
+ className,
49
+ description,
50
+ icon,
51
+ title,
52
+ subtitle,
53
+ status,
54
+ disabled = false,
55
+ onClick
56
+ } = _b, others = __objRest(_b, [
57
+ "className",
58
+ "description",
59
+ "icon",
60
+ "title",
61
+ "subtitle",
62
+ "status",
63
+ "disabled",
64
+ "onClick"
65
+ ]);
66
+ const stepsContext = useContext(StepsContext);
67
+ const { direction, labelPlacement, current, onChange } = stepsContext;
68
+ const isTitleVertical = labelPlacement === "vertical";
69
+ const handleClick = (e) => {
70
+ if (disabled)
71
+ return;
72
+ onClick == null ? void 0 : onClick(e, { current });
73
+ onChange == null ? void 0 : onChange(e, { current });
80
74
  };
81
- if (icon)
82
- return icon;
83
- return icons[status];
84
- };
85
- return /* @__PURE__ */ React.createElement(
86
- "div",
87
- __spreadValues({
88
- className: clsx(classes.root, className, {
89
- [`${classes.root}-${direction}`]: direction,
90
- [`${classes.root}-label-${labelPlacement}`]: labelPlacement,
91
- [`${classes.root}-disabled`]: disabled
92
- }),
93
- ref,
94
- onClick: handleClick
95
- }, others),
96
- /* @__PURE__ */ React.createElement(
97
- "div",
98
- {
99
- className: clsx(classes.line, {
100
- [`${classes.line}-${status}`]: status
101
- })
102
- }
103
- ),
104
- /* @__PURE__ */ React.createElement("div", { className: classes.icon }, renderIcon()),
105
- /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ React.createElement(
75
+ const renderIcon = () => {
76
+ const icons = {
77
+ active: /* @__PURE__ */ React.createElement("div", { className: `${classes.icon}-active` }),
78
+ wait: /* @__PURE__ */ React.createElement(CircleOutlinedIcon, { htmlColor: "#ced1d6" }),
79
+ finish: /* @__PURE__ */ React.createElement(SuccessCircleFilledIcon, { color: "primary" }),
80
+ error: /* @__PURE__ */ React.createElement(ErrorCircleFilledIcon, { color: "primary" })
81
+ };
82
+ if (icon)
83
+ return icon;
84
+ return icons[status];
85
+ };
86
+ return /* @__PURE__ */ React.createElement(
106
87
  "div",
107
- {
108
- className: clsx(`${classes.title}-wrapper`, {
109
- [`${classes.title}-wrapper-vertical`]: isTitleVertical,
110
- [`${classes.title}-wrapper-line-${status}`]: status
111
- })
112
- },
113
- !!title && /* @__PURE__ */ React.createElement(
88
+ __spreadValues({
89
+ className: clsx(classes.root, className, {
90
+ [`${classes.root}-${direction}`]: direction,
91
+ [`${classes.root}-label-${labelPlacement}`]: labelPlacement,
92
+ [`${classes.root}-disabled`]: disabled
93
+ }),
94
+ ref,
95
+ onClick: handleClick
96
+ }, others),
97
+ /* @__PURE__ */ React.createElement(
114
98
  "div",
115
99
  {
116
- className: clsx(classes.title, `${classes.title}-${status}`, {
117
- [`${classes.title}-${labelPlacement}`]: labelPlacement
100
+ className: clsx(classes.line, {
101
+ [`${classes.line}-${status}`]: status
118
102
  })
119
- },
120
- title
103
+ }
121
104
  ),
122
- !!subtitle && /* @__PURE__ */ React.createElement(
105
+ /* @__PURE__ */ React.createElement("div", { className: classes.icon }, renderIcon()),
106
+ /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ React.createElement(
123
107
  "div",
124
108
  {
125
- className: clsx(classes.subtitle, {
126
- [`${classes.subtitle}-${labelPlacement}`]: labelPlacement
109
+ className: clsx(`${classes.title}-wrapper`, {
110
+ [`${classes.title}-wrapper-vertical`]: isTitleVertical,
111
+ [`${classes.title}-wrapper-line-${status}`]: status
127
112
  })
128
113
  },
129
- subtitle
130
- )
131
- ), !!description && /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-desc` }, description))
132
- );
133
- });
114
+ !!title && /* @__PURE__ */ React.createElement(
115
+ "div",
116
+ {
117
+ className: clsx(classes.title, `${classes.title}-${status}`, {
118
+ [`${classes.title}-${labelPlacement}`]: labelPlacement
119
+ })
120
+ },
121
+ title
122
+ ),
123
+ !!subtitle && /* @__PURE__ */ React.createElement(
124
+ "div",
125
+ {
126
+ className: clsx(classes.subtitle, {
127
+ [`${classes.subtitle}-${labelPlacement}`]: labelPlacement
128
+ })
129
+ },
130
+ subtitle
131
+ )
132
+ ), !!description && /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-desc` }, description))
133
+ );
134
+ }
135
+ );
134
136
  Step.displayName = "Step";
135
- Step.defaultProps = {
136
- disabled: false
137
- };
138
137
  var Step_default = Step;
139
138
  export {
140
139
  Step_default as default
@@ -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;
package/es/Steps/Steps.js CHANGED
@@ -29,70 +29,67 @@ var __objRest = (source, exclude) => {
29
29
  import { toArray } from "@bifrostui/utils";
30
30
  import clsx from "clsx";
31
31
  import React, { cloneElement, forwardRef } from "react";
32
- import "./Steps.css";
33
32
  import { StepsContextProvider } from "./StepsContext";
33
+ import "./Steps.css";
34
34
  const prefixCls = "bui-steps";
35
- const Steps = forwardRef((props, ref) => {
36
- const _a = props, {
37
- className,
38
- children,
39
- direction,
40
- current,
41
- labelPlacement,
42
- onChange
43
- } = _a, others = __objRest(_a, [
44
- "className",
45
- "children",
46
- "direction",
47
- "current",
48
- "labelPlacement",
49
- "onChange"
50
- ]);
51
- const renderStep = () => {
52
- return toArray(children).map((child, index) => {
53
- const childProps = __spreadValues({
54
- key: index
55
- }, child.props);
56
- if (!child.props.status) {
57
- if (index === current) {
58
- childProps.status = "active";
59
- } else if (index < current) {
60
- childProps.status = "finish";
61
- } else {
62
- childProps.status = "wait";
35
+ const Steps = forwardRef(
36
+ (_a, ref) => {
37
+ var _b = _a, {
38
+ className,
39
+ children,
40
+ direction = "vertical",
41
+ current = 0,
42
+ labelPlacement = "horizontal",
43
+ onChange
44
+ } = _b, others = __objRest(_b, [
45
+ "className",
46
+ "children",
47
+ "direction",
48
+ "current",
49
+ "labelPlacement",
50
+ "onChange"
51
+ ]);
52
+ const renderStep = () => {
53
+ return toArray(children).map((child, index) => {
54
+ const childProps = __spreadValues({
55
+ key: index
56
+ }, child.props);
57
+ if (!child.props.status) {
58
+ if (index === current) {
59
+ childProps.status = "active";
60
+ } else if (index < current) {
61
+ childProps.status = "finish";
62
+ } else {
63
+ childProps.status = "wait";
64
+ }
63
65
  }
64
- }
65
- return cloneElement(child, childProps);
66
- });
67
- };
68
- return /* @__PURE__ */ React.createElement(
69
- StepsContextProvider,
70
- {
71
- value: {
72
- direction,
73
- current,
74
- labelPlacement,
75
- onChange
76
- }
77
- },
78
- /* @__PURE__ */ React.createElement(
79
- "div",
80
- __spreadValues({
81
- className: clsx(prefixCls, className, {
82
- [`${prefixCls}-${direction}`]: direction
83
- }),
84
- ref
85
- }, others),
86
- renderStep()
87
- )
88
- );
89
- });
66
+ return cloneElement(child, childProps);
67
+ });
68
+ };
69
+ return /* @__PURE__ */ React.createElement(
70
+ StepsContextProvider,
71
+ {
72
+ value: {
73
+ direction,
74
+ current,
75
+ labelPlacement,
76
+ onChange
77
+ }
78
+ },
79
+ /* @__PURE__ */ React.createElement(
80
+ "div",
81
+ __spreadValues({
82
+ className: clsx(prefixCls, className, {
83
+ [`${prefixCls}-${direction}`]: direction
84
+ }),
85
+ ref
86
+ }, others),
87
+ renderStep()
88
+ )
89
+ );
90
+ }
91
+ );
90
92
  Steps.displayName = "Steps";
91
- Steps.defaultProps = {
92
- current: 0,
93
- direction: "vertical",
94
- labelPlacement: "horizontal"
95
- };
96
93
  var Steps_default = Steps;
97
94
  export {
98
95
  Steps_default as default
@@ -34,85 +34,82 @@ import clsx from "clsx";
34
34
  import React, { forwardRef } from "react";
35
35
  import "./Switch.css";
36
36
  const prefixCls = "bui-switch";
37
- const Switch = forwardRef((props, ref) => {
38
- const _a = props, {
39
- className,
40
- checked,
41
- defaultChecked,
42
- inputProps,
43
- inputRef,
44
- name,
45
- checkedChildren,
46
- unCheckedChildren,
47
- disabled,
48
- size,
49
- color,
50
- onChange
51
- } = _a, others = __objRest(_a, [
52
- "className",
53
- "checked",
54
- "defaultChecked",
55
- "inputProps",
56
- "inputRef",
57
- "name",
58
- "checkedChildren",
59
- "unCheckedChildren",
60
- "disabled",
61
- "size",
62
- "color",
63
- "onChange"
64
- ]);
65
- const [switchChecked, triggerChange] = useValue({
66
- value: checked,
67
- defaultValue: !!defaultChecked
68
- });
69
- const changeAction = (e, isChecked) => {
70
- triggerChange(e, isChecked);
71
- onChange == null ? void 0 : onChange(e, { checked: isChecked });
72
- };
73
- const handleChange = (e) => {
74
- var _a2;
75
- const isChecked = !switchChecked;
76
- changeAction(e, isChecked);
77
- (_a2 = inputProps == null ? void 0 : inputProps.onChange) == null ? void 0 : _a2.call(inputProps, e);
78
- };
79
- return /* @__PURE__ */ React.createElement(
80
- "div",
81
- __spreadValues({
82
- ref,
83
- className: clsx(
84
- `${prefixCls}`,
85
- `${prefixCls}-${size}`,
86
- `${prefixCls}-${color}`,
87
- {
88
- [`${prefixCls}-checked`]: switchChecked,
89
- [`${prefixCls}-disabled`]: disabled
90
- },
91
- className
92
- )
93
- }, others),
94
- /* @__PURE__ */ React.createElement(
95
- "input",
96
- __spreadProps(__spreadValues({
97
- ref: inputRef,
98
- type: "checkbox",
99
- name,
100
- checked: switchChecked,
101
- disabled
102
- }, inputProps), {
103
- onChange: handleChange,
104
- className: clsx(`${prefixCls}-input`, inputProps == null ? void 0 : inputProps.className)
105
- })
106
- ),
107
- (checkedChildren || unCheckedChildren) && /* @__PURE__ */ React.createElement("span", { className: `${prefixCls}-inner` }, switchChecked ? checkedChildren : unCheckedChildren)
108
- );
109
- });
37
+ const Switch = forwardRef(
38
+ (_a, ref) => {
39
+ var _b = _a, {
40
+ className,
41
+ checked,
42
+ defaultChecked,
43
+ inputProps,
44
+ inputRef,
45
+ name,
46
+ checkedChildren,
47
+ unCheckedChildren,
48
+ disabled = false,
49
+ size = "medium",
50
+ color = "primary",
51
+ onChange
52
+ } = _b, others = __objRest(_b, [
53
+ "className",
54
+ "checked",
55
+ "defaultChecked",
56
+ "inputProps",
57
+ "inputRef",
58
+ "name",
59
+ "checkedChildren",
60
+ "unCheckedChildren",
61
+ "disabled",
62
+ "size",
63
+ "color",
64
+ "onChange"
65
+ ]);
66
+ const [switchChecked, triggerChange] = useValue({
67
+ value: checked,
68
+ defaultValue: !!defaultChecked
69
+ });
70
+ const changeAction = (e, isChecked) => {
71
+ triggerChange(e, isChecked);
72
+ onChange == null ? void 0 : onChange(e, { checked: isChecked });
73
+ };
74
+ const handleChange = (e) => {
75
+ var _a2;
76
+ const isChecked = !switchChecked;
77
+ changeAction(e, isChecked);
78
+ (_a2 = inputProps == null ? void 0 : inputProps.onChange) == null ? void 0 : _a2.call(inputProps, e);
79
+ };
80
+ return /* @__PURE__ */ React.createElement(
81
+ "div",
82
+ __spreadValues({
83
+ ref,
84
+ className: clsx(
85
+ `${prefixCls}`,
86
+ `${prefixCls}-${size}`,
87
+ `${prefixCls}-${color}`,
88
+ {
89
+ [`${prefixCls}-checked`]: switchChecked,
90
+ [`${prefixCls}-disabled`]: disabled
91
+ },
92
+ className
93
+ )
94
+ }, others),
95
+ /* @__PURE__ */ React.createElement(
96
+ "input",
97
+ __spreadProps(__spreadValues({
98
+ ref: inputRef,
99
+ type: "checkbox",
100
+ name,
101
+ checked: switchChecked,
102
+ disabled
103
+ }, inputProps), {
104
+ onChange: handleChange,
105
+ className: clsx(`${prefixCls}-input`, inputProps == null ? void 0 : inputProps.className)
106
+ })
107
+ ),
108
+ (checkedChildren || unCheckedChildren) && /* @__PURE__ */ React.createElement("span", { className: `${prefixCls}-inner` }, switchChecked ? checkedChildren : unCheckedChildren)
109
+ );
110
+ }
111
+ );
110
112
  Switch.displayName = "BuiSwitch";
111
- Switch.defaultProps = {
112
- disabled: false,
113
- size: "medium",
114
- color: "primary"
115
- };
116
113
  var Switch_default = Switch;
117
114
  export {
118
115
  Switch_default as default
@@ -33,9 +33,9 @@ import "./TabBar.css";
33
33
  const prefixCls = "bui-tab-bar";
34
34
  const TabBar = /* @__PURE__ */ React.forwardRef((props, ref) => {
35
35
  const _a = props || {}, {
36
- current,
37
- activeColor,
38
- color,
36
+ current = 0,
37
+ activeColor = "primary",
38
+ color = "default",
39
39
  children,
40
40
  className,
41
41
  onChange
@@ -67,11 +67,6 @@ const TabBar = /* @__PURE__ */ React.forwardRef((props, ref) => {
67
67
  );
68
68
  });
69
69
  TabBar.displayName = "BuiTabBar";
70
- TabBar.defaultProps = {
71
- activeColor: "primary",
72
- color: "default",
73
- current: 0
74
- };
75
70
  var TabBar_default = TabBar;
76
71
  export {
77
72
  TabBar_default as default
package/es/Tabs/Tab.css CHANGED
@@ -4,31 +4,25 @@
4
4
  justify-content: center;
5
5
  white-space: nowrap;
6
6
  width: min-content;
7
- height: var(--tab-height);
7
+ height: 100%;
8
8
  box-sizing: border-box;
9
9
  position: relative;
10
10
  cursor: pointer;
11
- font-size: var(--font-size);
11
+ font-size: var(--bui-tabs-font-size);
12
12
  line-height: var(--bui-line-height);
13
- color: var(--color);
14
- padding: var(--tab-padding);
15
- font-family: var(--bui-font-family);
13
+ color: var(--bui-tabs-color);
14
+ padding: var(--bui-tab-padding);
15
+ font-family: var(--bui-tabs-font-family);
16
16
  }
17
17
  .bui-tab-active {
18
- font-size: var(--font-size);
19
- line-height: var(--bui-line-height);
20
- font-weight: var(--bui-font-weight-medium);
21
- color: var(--active-color);
22
- }
23
- .bui-tab-center {
24
- flex: 1 0 0;
25
- margin: 0 auto;
18
+ --bui-tabs-font-family: var(--bui-font-family-accent, inherit);
19
+ --bui-tabs-color: var(--bui-color-fg-default);
20
+ font-weight: 600;
26
21
  }
27
22
  .bui-tab-miniapp-active {
28
- font-size: var(--font-size);
23
+ --bui-tabs-color: var(--bui-color-fg-default);
29
24
  line-height: 1.5;
30
25
  font-weight: var(--bui-font-weight-medium);
31
- color: var(--active-color);
32
26
  position: relative;
33
27
  }
34
28
  .bui-tab-miniapp-active-line {
@@ -46,7 +40,7 @@
46
40
  opacity: 0.5;
47
41
  pointer-events: none;
48
42
  }
49
- .bui-tabline-invisible {
43
+ .bui-indicator-invisible {
50
44
  visibility: hidden;
51
45
  background-color: transparent;
52
46
  }
package/es/Tabs/Tab.js CHANGED
@@ -36,16 +36,27 @@ import TabsContext from "./TabsContext";
36
36
  import "./Tab.css";
37
37
  const prefixCls = "bui-tab";
38
38
  const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
39
- const _a = props, { className, children, index, disabled, onClick } = _a, others = __objRest(_a, ["className", "children", "index", "disabled", "onClick"]);
39
+ const _a = props, {
40
+ className,
41
+ children,
42
+ index,
43
+ disabled = false,
44
+ onClick
45
+ } = _a, others = __objRest(_a, [
46
+ "className",
47
+ "children",
48
+ "index",
49
+ "disabled",
50
+ "onClick"
51
+ ]);
40
52
  const tabsContext = React.useContext(TabsContext);
41
- const { value, align, triggerChange } = tabsContext;
53
+ const { value, triggerChange } = tabsContext;
42
54
  return /* @__PURE__ */ React.createElement(
43
55
  "div",
44
56
  __spreadProps(__spreadValues({
45
57
  ref,
46
58
  className: clsx(
47
59
  prefixCls,
48
- align !== "start" && `${prefixCls}-${align}`,
49
60
  {
50
61
  [`${prefixCls}-active`]: !isMini && index === value,
51
62
  [`${prefixCls}-miniapp-active`]: isMini && index === value,
@@ -67,16 +78,13 @@ const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
67
78
  "div",
68
79
  {
69
80
  className: clsx(`${prefixCls}-miniapp-active-line`, {
70
- "bui-tabline-invisible": index !== value
81
+ "bui-indicator-invisible": index !== value
71
82
  })
72
83
  }
73
84
  )
74
85
  );
75
86
  });
76
87
  Tab.displayName = "BuiTab";
77
- Tab.defaultProps = {
78
- disabled: false
79
- };
80
88
  var Tab_default = Tab;
81
89
  export {
82
90
  Tab_default as default
package/es/Tabs/Tabs.css CHANGED
@@ -1,20 +1,10 @@
1
1
  .bui-tabs {
2
- --height: var(--bui-tabs-height, 39px);
3
- --color: var(--bui-tabs-color, var(--bui-color-fg-subtle));
4
- --active-color: var(--bui-tabs-active-color, var(--bui-color-fg-default));
5
- --line-color: var(--bui-tabs-line-color, var(--bui-color-primary));
6
- --line-height: var(--bui-tabs-line-height, 3PX);
7
- --line-width: var(--bui-tabs-line-width, 18px);
8
- --mask-width: var(--bui-tabs-mask-width, 12px);
9
- --mask-height: var(--bui-tabs-mask-height, 100%);
10
- --tab-height: var(--bui-tab-height, 100%);
11
- --tab-padding: var(--bui-tab-padding, var(--bui-spacing-lg) var(--bui-spacing-lg) 10px);
12
- --font-size: var(--bui-tab-font-size, var(--bui-text-size-1));
13
2
  position: relative;
14
- font-family: var(--bui-font-family);
3
+ font-family: var(--bui-tabs-font-family);
4
+ font-weight: var(--bui-tabs-font-weight);
15
5
  }
16
6
  .bui-tabs-tabs {
17
- height: var(--height);
7
+ height: var(--bui-tabs-height);
18
8
  display: flex;
19
9
  flex-wrap: nowrap;
20
10
  justify-content: flex-start;
@@ -26,14 +16,15 @@
26
16
  .bui-tabs-tabs::-webkit-scrollbar {
27
17
  display: none;
28
18
  }
29
- .bui-tabs-tabline {
19
+ .bui-tabs-indicator {
30
20
  position: absolute;
31
- width: var(--line-width);
32
- bottom: 0;
33
- height: var(--line-height);
21
+ width: var(--bui-tabs-indicator-width);
22
+ bottom: var(--bui-tabs-indicator-bottom);
23
+ height: var(--bui-tabs-indicator-height);
34
24
  color: var(--bui-color-primary);
35
- background: var(--line-color);
36
- border-radius: var(--bui-shape-radius-label);
25
+ background: var(--bui-tabs-indicator-bg);
26
+ border-radius: var(--bui-tabs-indicator-border-radius);
27
+ box-shadow: var(--bui-tabs-indicator-box-shadow);
37
28
  }
38
29
  .bui-tabs-content {
39
30
  padding: var(--bui-spacing-lg);
@@ -43,8 +34,8 @@
43
34
  top: 0;
44
35
  bottom: 0;
45
36
  z-index: 1;
46
- width: var(--mask-width);
47
- height: var(--mask-height);
37
+ width: 12px;
38
+ height: 100%;
48
39
  pointer-events: none;
49
40
  }
50
41
  .bui-tabs-mask-left {
@@ -63,7 +54,7 @@
63
54
  var(--bui-color-bg-view),
64
55
  rgba(255, 255, 255, 0));
65
56
  }
66
- .bui-tabline-invisible {
57
+ .bui-indicator-invisible {
67
58
  visibility: hidden;
68
59
  background-color: transparent;
69
60
  }