@bifrostui/react 1.4.4 → 1.4.5-beta.1

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.
package/es/Tabs/Tabs.css CHANGED
@@ -1,39 +1,44 @@
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
+ --bui-tabs-font-family: var(--bui-font-family);
3
+ --bui-tabs-font-size: var(--bui-text-size-1);
4
+ --bui-tabs-height: 39px;
5
+ --bui-tabs-color: var(--bui-color-fg-subtle);
6
+ --bui-tabs-font-weight: var(--bui-font-weight-medium);
7
+ --bui-tabs-indicator-bg: var(--bui-color-primary);
8
+ --bui-tabs-indicator-height: 3px;
9
+ --bui-tabs-indicator-width: 18px;
10
+ --bui-tabs-indicator-border-radius: 3px;
11
+ --bui-tabs-indicator-bottom: 0;
12
+ --bui-tabs-indicator-box-shadow: none;
13
+ --bui-tabs-mask-width: 12px;
14
+ --bui-tabs-mask-height: 100%;
15
+ --bui-tab-padding: var(--bui-spacing-lg) var(--bui-spacing-lg) 10px;
13
16
  position: relative;
14
- font-family: var(--bui-font-family);
17
+ font-family: var(--bui-tabs-font-family);
15
18
  }
16
19
  .bui-tabs-tabs {
17
- height: var(--height);
20
+ height: var(--bui-tabs-height);
18
21
  display: flex;
19
22
  flex-wrap: nowrap;
20
23
  justify-content: flex-start;
21
24
  align-items: center;
22
25
  position: relative;
23
26
  overflow-x: scroll;
27
+ font-weight: var(--bui-tabs-font-weight);
24
28
  scrollbar-width: none;
25
29
  }
26
30
  .bui-tabs-tabs::-webkit-scrollbar {
27
31
  display: none;
28
32
  }
29
- .bui-tabs-tabline {
33
+ .bui-tabs-indicator {
30
34
  position: absolute;
31
- width: var(--line-width);
32
- bottom: 0;
33
- height: var(--line-height);
35
+ width: var(--bui-tabs-indicator-width);
36
+ bottom: var(--bui-tabs-indicator-bottom);
37
+ height: var(--bui-tabs-indicator-height);
34
38
  color: var(--bui-color-primary);
35
- background: var(--line-color);
36
- border-radius: var(--bui-shape-radius-label);
39
+ background: var(--bui-tabs-indicator-bg);
40
+ border-radius: var(--bui-tabs-indicator-border-radius);
41
+ box-shadow: var(--bui-tabs-indicator-box-shadow);
37
42
  }
38
43
  .bui-tabs-content {
39
44
  padding: var(--bui-spacing-lg);
@@ -43,8 +48,8 @@
43
48
  top: 0;
44
49
  bottom: 0;
45
50
  z-index: 1;
46
- width: var(--mask-width);
47
- height: var(--mask-height);
51
+ width: var(--bui-tabs-mask-width);
52
+ height: var(--bui-tabs-mask-height);
48
53
  pointer-events: none;
49
54
  }
50
55
  .bui-tabs-mask-left {
@@ -63,7 +68,7 @@
63
68
  var(--bui-color-bg-view),
64
69
  rgba(255, 255, 255, 0));
65
70
  }
66
- .bui-tabline-invisible {
71
+ .bui-indicator-invisible {
67
72
  visibility: hidden;
68
73
  background-color: transparent;
69
74
  }
package/es/Tabs/Tabs.js CHANGED
@@ -45,8 +45,12 @@ import { TabsContextProvider } from "./TabsContext";
45
45
  import bound from "./utils/bound";
46
46
  import "./Tabs.css";
47
47
  const prefixCls = "bui-tabs";
48
+ const defaultProps = {
49
+ align: "center",
50
+ tabs: []
51
+ };
48
52
  const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
49
- const _a = props, { children, className, value, tabs, align, onChange } = _a, others = __objRest(_a, ["children", "className", "value", "tabs", "align", "onChange"]);
53
+ const _a = __spreadValues(__spreadValues({}, defaultProps), props), { children, className, value, tabs, align, onChange } = _a, others = __objRest(_a, ["children", "className", "value", "tabs", "align", "onChange"]);
50
54
  const [active, setActive] = useState("");
51
55
  const tabsRef = useRef(null);
52
56
  const activeLineRef = useRef(null);
@@ -111,25 +115,6 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
111
115
  tabsRef.current.scrollLeft = nextScrollLeft;
112
116
  }
113
117
  };
114
- useEffect(() => {
115
- setActive(value);
116
- }, [value]);
117
- useLayoutEffect(() => {
118
- animate({ transitionInUse: false });
119
- }, []);
120
- useEffect(() => {
121
- const handleResize = debounce(() => {
122
- animate({ transitionInUse: true });
123
- updateMask();
124
- }, 100);
125
- window.addEventListener("resize", handleResize);
126
- return () => {
127
- window.removeEventListener("resize", handleResize);
128
- };
129
- }, [active]);
130
- useDidMountEffect(() => {
131
- animate({ transitionInUse: true });
132
- }, [active, tabs, children]);
133
118
  const updateMask = useMemo(
134
119
  () => throttle(
135
120
  () => {
@@ -152,6 +137,25 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
152
137
  ),
153
138
  []
154
139
  );
140
+ useEffect(() => {
141
+ setActive(value);
142
+ }, [value]);
143
+ useLayoutEffect(() => {
144
+ animate({ transitionInUse: false });
145
+ }, []);
146
+ useEffect(() => {
147
+ const handleResize = debounce(() => {
148
+ animate({ transitionInUse: true });
149
+ updateMask();
150
+ }, 100);
151
+ window.addEventListener("resize", handleResize);
152
+ return () => {
153
+ window.removeEventListener("resize", handleResize);
154
+ };
155
+ }, [active]);
156
+ useDidMountEffect(() => {
157
+ animate({ transitionInUse: true });
158
+ }, [active, tabs, children]);
155
159
  useLayoutEffect(() => {
156
160
  updateMask();
157
161
  }, []);
@@ -192,11 +196,11 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
192
196
  "div",
193
197
  {
194
198
  ref: activeLineRef,
195
- className: clsx(`${prefixCls}-tabline`, {
196
- "bui-tabline-invisible": isMini || !lineData.hasActiveTab
199
+ className: clsx(`${prefixCls}-indicator`, {
200
+ "bui-indicator-invisible": isMini || !lineData.hasActiveTab
197
201
  }),
198
202
  style: {
199
- transition: lineData.transitionInUse ? "transform 0.25s ease-in-out" : void 0,
203
+ transition: lineData.transitionInUse ? "transform 0.3s ease-in-out" : void 0,
200
204
  transform: `translate3d(${lineData.x}px, 0px, 0px)`
201
205
  }
202
206
  }
@@ -213,10 +217,6 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
213
217
  }), children)));
214
218
  });
215
219
  Tabs.displayName = "BuiTabs";
216
- Tabs.defaultProps = {
217
- align: "center",
218
- tabs: []
219
- };
220
220
  var Tabs_default = Tabs;
221
221
  export {
222
222
  Tabs_default as default
@@ -3,9 +3,6 @@ import React, { SyntheticEvent } from 'react';
3
3
  export interface TabHeaderItem {
4
4
  title: React.ReactNode;
5
5
  index: string;
6
- /**
7
- * 是否禁止点击
8
- */
9
6
  disabled?: boolean;
10
7
  }
11
8
  export interface ITabsChangeData {
@@ -14,11 +11,8 @@ export interface ITabsChangeData {
14
11
  }
15
12
  export type TabChangeEvent = (e?: SyntheticEvent, data?: ITabsChangeData) => void;
16
13
  export interface ITabItem {
17
- /** 面板标题 */
18
14
  title: React.ReactNode;
19
- /** 面板的索引值 */
20
15
  index: string;
21
- /** 面板是否禁用 */
22
16
  disabled?: boolean;
23
17
  }
24
18
  export type ITabAlign = 'start' | 'center';
package/es/Tag/Tag.css CHANGED
@@ -47,7 +47,7 @@
47
47
  border: 1px solid var(--bui-color-border-danger);
48
48
  }
49
49
  .bui-tag-outlined.bui-tag-vip {
50
- color: var(--bui-color-red);
50
+ color: var(--bui-color-primary);
51
51
  border: 1px solid var(--bui-color-border-primary);
52
52
  }
53
53
  .bui-tag-contained {
@@ -1,6 +1,6 @@
1
1
  .bui-tooltip {
2
2
  --arrow-size: var(--bui-tooltip-arrow-size, 8PX);
3
- --localtion-position: var(--bui-tooltip-localtion-position, 8PX);
3
+ --location-position: var(--bui-tooltip-location-position, 8PX);
4
4
  --max-width: var(--bui-tooltip-max-width, 350px);
5
5
  --content-min-width: var(--bui-tooltip-content-min-width, 30px);
6
6
  --content-min-height: var(--bui-tooltip-content-min-height, 32px);
@@ -17,16 +17,16 @@
17
17
  position: absolute;
18
18
  }
19
19
  .bui-tooltip .bui-tooltip-arrow.location-left {
20
- left: var(--localtion-position);
20
+ left: var(--location-position);
21
21
  }
22
22
  .bui-tooltip .bui-tooltip-arrow.location-right {
23
- right: var(--localtion-position);
23
+ right: var(--location-position);
24
24
  }
25
25
  .bui-tooltip .bui-tooltip-arrow.location-top {
26
- top: var(--localtion-position);
26
+ top: var(--location-position);
27
27
  }
28
28
  .bui-tooltip .bui-tooltip-arrow.location-bottom {
29
- bottom: var(--localtion-position);
29
+ bottom: var(--location-position);
30
30
  }
31
31
  .bui-tooltip.tooltip-top .location-center,
32
32
  .bui-tooltip.tooltip-bottom .location-center {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifrostui/react",
3
- "version": "1.4.4",
3
+ "version": "1.4.5-beta.1",
4
4
  "description": "React components for building mobile application",
5
5
  "homepage": "http://bui.taopiaopiao.com",
6
6
  "license": "MIT",
@@ -30,13 +30,13 @@
30
30
  "glob": "11.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "clsx": "^1.2.1",
33
+ "clsx": "^2.1.1",
34
34
  "dayjs": "^1.11.7",
35
35
  "swiper": "^8.1.5",
36
- "@bifrostui/icons": "1.4.4",
37
- "@bifrostui/styles": "1.4.4",
38
- "@bifrostui/types": "1.4.4",
39
- "@bifrostui/utils": "1.4.4"
36
+ "@bifrostui/icons": "1.4.5-beta.1",
37
+ "@bifrostui/types": "1.4.5-beta.1",
38
+ "@bifrostui/styles": "1.4.5-beta.1",
39
+ "@bifrostui/utils": "1.4.5-beta.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@tarojs/components": "^3.0.0",