@bifrostui/react 1.4.5-beta.3 → 1.4.5

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 +8 -3
  3. package/dist/Avatar/Avatar.js +8 -3
  4. package/dist/Avatar/AvatarGroup.js +6 -2
  5. package/dist/Badge/Badge.js +8 -3
  6. package/dist/Button/Button.css +78 -77
  7. package/dist/Button/Button.d.ts +1 -1
  8. package/dist/Button/Button.js +10 -4
  9. package/dist/Button/Button.types.d.ts +7 -8
  10. package/dist/Calendar/Calendar.js +14 -6
  11. package/dist/Card/Card.css +1 -1
  12. package/dist/Card/CardContent.css +2 -1
  13. package/dist/Card/CardFooter.css +4 -2
  14. package/dist/Card/CardHeader.css +5 -4
  15. package/dist/Checkbox/Checkbox.js +6 -2
  16. package/dist/Checkbox/CheckboxGroup.js +7 -4
  17. package/dist/CollapsePanel/CollapsePanelItem.js +46 -45
  18. package/dist/Countdown/Countdown.js +12 -5
  19. package/dist/Divider/Divider.js +5 -8
  20. package/dist/Drawer/Drawer.js +10 -4
  21. package/dist/Fade/Fade.js +56 -52
  22. package/dist/IconButton/IconButton.js +12 -5
  23. package/dist/Image/Image.js +119 -112
  24. package/dist/Input/Input.js +10 -4
  25. package/dist/List/List.js +8 -3
  26. package/dist/List/ListItem.js +44 -42
  27. package/dist/List/ListItemContent.js +4 -1
  28. package/dist/List/ListItemExtra.js +4 -9
  29. package/dist/List/ListItemFooter.js +4 -9
  30. package/dist/List/ListItemHeader.js +4 -9
  31. package/dist/Loading/Loading.js +4 -13
  32. package/dist/Modal/Modal.js +6 -0
  33. package/dist/Modal/Modal.miniapp.js +10 -4
  34. package/dist/NavBar/NavBar.js +1 -0
  35. package/dist/Popover/Popover.css +5 -5
  36. package/dist/Radio/Radio.css +1 -0
  37. package/dist/Radio/Radio.js +6 -2
  38. package/dist/Radio/RadioGroup.js +3 -0
  39. package/dist/Rating/Rating.js +18 -8
  40. package/dist/Select/Select.js +8 -4
  41. package/dist/Skeleton/Skeleton.js +9 -5
  42. package/dist/Slide/Slide.js +74 -69
  43. package/dist/Slider/Slider.js +14 -6
  44. package/dist/Steps/Step.js +82 -81
  45. package/dist/Steps/Steps.d.ts +1 -1
  46. package/dist/Steps/Steps.js +60 -57
  47. package/dist/Switch/Switch.js +78 -75
  48. package/dist/TabBar/TabBar.js +8 -3
  49. package/dist/Tabs/Tab.css +16 -10
  50. package/dist/Tabs/Tab.js +7 -15
  51. package/dist/Tabs/Tabs.css +22 -13
  52. package/dist/Tabs/Tabs.js +42 -26
  53. package/dist/Tabs/Tabs.types.d.ts +10 -0
  54. package/dist/Tag/Tag.css +1 -1
  55. package/dist/Tag/Tag.js +6 -2
  56. package/dist/TextArea/TextArea.js +12 -5
  57. package/dist/Tooltip/Tooltip.css +5 -5
  58. package/dist/Transition/TransitionCore.js +8 -3
  59. package/es/ActionSheet/ActionSheet.css +2 -2
  60. package/es/ActionSheet/ActionSheetItem.js +8 -3
  61. package/es/Avatar/Avatar.js +8 -3
  62. package/es/Avatar/AvatarGroup.js +6 -2
  63. package/es/Badge/Badge.js +8 -3
  64. package/es/Button/Button.css +78 -77
  65. package/es/Button/Button.d.ts +1 -1
  66. package/es/Button/Button.js +9 -3
  67. package/es/Button/Button.types.d.ts +7 -8
  68. package/es/Calendar/Calendar.js +14 -6
  69. package/es/Card/Card.css +1 -1
  70. package/es/Card/CardContent.css +2 -1
  71. package/es/Card/CardFooter.css +4 -2
  72. package/es/Card/CardHeader.css +5 -4
  73. package/es/Checkbox/Checkbox.js +6 -2
  74. package/es/Checkbox/CheckboxGroup.js +7 -4
  75. package/es/CollapsePanel/CollapsePanelItem.js +46 -45
  76. package/es/Countdown/Countdown.js +12 -5
  77. package/es/Divider/Divider.js +5 -8
  78. package/es/Drawer/Drawer.js +10 -4
  79. package/es/Fade/Fade.js +56 -52
  80. package/es/IconButton/IconButton.js +12 -5
  81. package/es/Image/Image.js +119 -112
  82. package/es/Input/Input.js +10 -4
  83. package/es/List/List.js +8 -3
  84. package/es/List/ListItem.js +44 -42
  85. package/es/List/ListItemContent.js +4 -1
  86. package/es/List/ListItemExtra.js +4 -9
  87. package/es/List/ListItemFooter.js +4 -9
  88. package/es/List/ListItemHeader.js +4 -9
  89. package/es/Loading/Loading.js +4 -13
  90. package/es/Modal/Modal.js +6 -0
  91. package/es/Modal/Modal.miniapp.d.ts +1 -1
  92. package/es/Modal/Modal.miniapp.js +10 -4
  93. package/es/NavBar/NavBar.js +1 -0
  94. package/es/Popover/Popover.css +5 -5
  95. package/es/Radio/Radio.css +1 -0
  96. package/es/Radio/Radio.js +6 -2
  97. package/es/Radio/RadioGroup.js +3 -0
  98. package/es/Rating/Rating.js +18 -8
  99. package/es/Select/Select.js +8 -4
  100. package/es/Skeleton/Skeleton.js +9 -5
  101. package/es/Slide/Slide.js +74 -69
  102. package/es/Slider/Slider.js +14 -6
  103. package/es/Steps/Step.js +82 -81
  104. package/es/Steps/Steps.d.ts +1 -1
  105. package/es/Steps/Steps.js +60 -57
  106. package/es/Switch/Switch.js +78 -75
  107. package/es/TabBar/TabBar.js +8 -3
  108. package/es/Tabs/Tab.css +16 -10
  109. package/es/Tabs/Tab.js +7 -15
  110. package/es/Tabs/Tabs.css +22 -13
  111. package/es/Tabs/Tabs.js +55 -28
  112. package/es/Tabs/Tabs.types.d.ts +10 -0
  113. package/es/Tag/Tag.css +1 -1
  114. package/es/Tag/Tag.js +6 -2
  115. package/es/TextArea/TextArea.js +12 -5
  116. package/es/Tooltip/Tooltip.css +5 -5
  117. package/es/Transition/TransitionCore.js +8 -3
  118. package/package.json +6 -6
package/es/Steps/Step.js CHANGED
@@ -42,98 +42,99 @@ const classes = {
42
42
  title: "bui-step-title",
43
43
  subtitle: "bui-step-subtitle"
44
44
  };
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 });
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" })
74
80
  };
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(
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(
87
106
  "div",
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(
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(
98
114
  "div",
99
115
  {
100
- className: clsx(classes.line, {
101
- [`${classes.line}-${status}`]: status
116
+ className: clsx(classes.title, `${classes.title}-${status}`, {
117
+ [`${classes.title}-${labelPlacement}`]: labelPlacement
102
118
  })
103
- }
119
+ },
120
+ title
104
121
  ),
105
- /* @__PURE__ */ React.createElement("div", { className: classes.icon }, renderIcon()),
106
- /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-content` }, /* @__PURE__ */ React.createElement(
122
+ !!subtitle && /* @__PURE__ */ React.createElement(
107
123
  "div",
108
124
  {
109
- className: clsx(`${classes.title}-wrapper`, {
110
- [`${classes.title}-wrapper-vertical`]: isTitleVertical,
111
- [`${classes.title}-wrapper-line-${status}`]: status
125
+ className: clsx(classes.subtitle, {
126
+ [`${classes.subtitle}-${labelPlacement}`]: labelPlacement
112
127
  })
113
128
  },
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
- );
129
+ subtitle
130
+ )
131
+ ), !!description && /* @__PURE__ */ React.createElement("div", { className: `${classes.root}-desc` }, description))
132
+ );
133
+ });
136
134
  Step.displayName = "Step";
135
+ Step.defaultProps = {
136
+ disabled: false
137
+ };
137
138
  var Step_default = Step;
138
139
  export {
139
140
  Step_default as default
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { StepsProps } from './Steps.types';
3
2
  import './Steps.less';
3
+ import { StepsProps } from './Steps.types';
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,67 +29,70 @@ 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 { StepsContextProvider } from "./StepsContext";
33
32
  import "./Steps.css";
33
+ import { StepsContextProvider } from "./StepsContext";
34
34
  const prefixCls = "bui-steps";
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
- }
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";
65
63
  }
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
- );
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
+ });
92
90
  Steps.displayName = "Steps";
91
+ Steps.defaultProps = {
92
+ current: 0,
93
+ direction: "vertical",
94
+ labelPlacement: "horizontal"
95
+ };
93
96
  var Steps_default = Steps;
94
97
  export {
95
98
  Steps_default as default
@@ -34,82 +34,85 @@ 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(
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
- );
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
+ });
112
110
  Switch.displayName = "BuiSwitch";
111
+ Switch.defaultProps = {
112
+ disabled: false,
113
+ size: "medium",
114
+ color: "primary"
115
+ };
113
116
  var Switch_default = Switch;
114
117
  export {
115
118
  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 = 0,
37
- activeColor = "primary",
38
- color = "default",
36
+ current,
37
+ activeColor,
38
+ color,
39
39
  children,
40
40
  className,
41
41
  onChange
@@ -67,6 +67,11 @@ 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
+ };
70
75
  var TabBar_default = TabBar;
71
76
  export {
72
77
  TabBar_default as default
package/es/Tabs/Tab.css CHANGED
@@ -4,25 +4,31 @@
4
4
  justify-content: center;
5
5
  white-space: nowrap;
6
6
  width: min-content;
7
- height: 100%;
7
+ height: var(--tab-height);
8
8
  box-sizing: border-box;
9
9
  position: relative;
10
10
  cursor: pointer;
11
- font-size: var(--bui-tabs-font-size);
11
+ font-size: var(--font-size);
12
12
  line-height: var(--bui-line-height);
13
- color: var(--bui-tabs-color);
14
- padding: var(--bui-tab-padding);
15
- font-family: var(--bui-tabs-font-family);
13
+ color: var(--color);
14
+ padding: var(--tab-padding);
15
+ font-family: var(--bui-font-family);
16
16
  }
17
17
  .bui-tab-active {
18
- --bui-tabs-font-family: var(--bui-font-family-accent, inherit);
19
- --bui-tabs-color: var(--bui-color-fg-default);
20
- font-weight: 600;
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;
21
26
  }
22
27
  .bui-tab-miniapp-active {
23
- --bui-tabs-color: var(--bui-color-fg-default);
28
+ font-size: var(--font-size);
24
29
  line-height: 1.5;
25
30
  font-weight: var(--bui-font-weight-medium);
31
+ color: var(--active-color);
26
32
  position: relative;
27
33
  }
28
34
  .bui-tab-miniapp-active-line {
@@ -40,7 +46,7 @@
40
46
  opacity: 0.5;
41
47
  pointer-events: none;
42
48
  }
43
- .bui-indicator-invisible {
49
+ .bui-tabline-invisible {
44
50
  visibility: hidden;
45
51
  background-color: transparent;
46
52
  }
package/es/Tabs/Tab.js CHANGED
@@ -36,27 +36,16 @@ 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, {
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
- ]);
39
+ const _a = props, { className, children, index, disabled, onClick } = _a, others = __objRest(_a, ["className", "children", "index", "disabled", "onClick"]);
52
40
  const tabsContext = React.useContext(TabsContext);
53
- const { value, triggerChange } = tabsContext;
41
+ const { value, align, triggerChange } = tabsContext;
54
42
  return /* @__PURE__ */ React.createElement(
55
43
  "div",
56
44
  __spreadProps(__spreadValues({
57
45
  ref,
58
46
  className: clsx(
59
47
  prefixCls,
48
+ align !== "start" && `${prefixCls}-${align}`,
60
49
  {
61
50
  [`${prefixCls}-active`]: !isMini && index === value,
62
51
  [`${prefixCls}-miniapp-active`]: isMini && index === value,
@@ -78,13 +67,16 @@ const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
78
67
  "div",
79
68
  {
80
69
  className: clsx(`${prefixCls}-miniapp-active-line`, {
81
- "bui-indicator-invisible": index !== value
70
+ "bui-tabline-invisible": index !== value
82
71
  })
83
72
  }
84
73
  )
85
74
  );
86
75
  });
87
76
  Tab.displayName = "BuiTab";
77
+ Tab.defaultProps = {
78
+ disabled: false
79
+ };
88
80
  var Tab_default = Tab;
89
81
  export {
90
82
  Tab_default as default
package/es/Tabs/Tabs.css CHANGED
@@ -1,10 +1,20 @@
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));
2
13
  position: relative;
3
- font-family: var(--bui-tabs-font-family);
4
- font-weight: var(--bui-tabs-font-weight);
14
+ font-family: var(--bui-font-family);
5
15
  }
6
16
  .bui-tabs-tabs {
7
- height: var(--bui-tabs-height);
17
+ height: var(--height);
8
18
  display: flex;
9
19
  flex-wrap: nowrap;
10
20
  justify-content: flex-start;
@@ -16,15 +26,14 @@
16
26
  .bui-tabs-tabs::-webkit-scrollbar {
17
27
  display: none;
18
28
  }
19
- .bui-tabs-indicator {
29
+ .bui-tabs-tabline {
20
30
  position: absolute;
21
- width: var(--bui-tabs-indicator-width);
22
- bottom: var(--bui-tabs-indicator-bottom);
23
- height: var(--bui-tabs-indicator-height);
31
+ width: var(--line-width);
32
+ bottom: 0;
33
+ height: var(--line-height);
24
34
  color: var(--bui-color-primary);
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);
35
+ background: var(--line-color);
36
+ border-radius: var(--bui-shape-radius-label);
28
37
  }
29
38
  .bui-tabs-content {
30
39
  padding: var(--bui-spacing-lg);
@@ -34,8 +43,8 @@
34
43
  top: 0;
35
44
  bottom: 0;
36
45
  z-index: 1;
37
- width: 12px;
38
- height: 100%;
46
+ width: var(--mask-width);
47
+ height: var(--mask-height);
39
48
  pointer-events: none;
40
49
  }
41
50
  .bui-tabs-mask-left {
@@ -54,7 +63,7 @@
54
63
  var(--bui-color-bg-view),
55
64
  rgba(255, 255, 255, 0));
56
65
  }
57
- .bui-indicator-invisible {
66
+ .bui-tabline-invisible {
58
67
  visibility: hidden;
59
68
  background-color: transparent;
60
69
  }