@bifrostui/react 2.0.0-alpha.15 → 2.0.0-alpha.17

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.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { DatePickerProps } from './DatePicker.types';
3
- declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "defaultValue" | "onChange" | "value" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "value" | "defaultValue" | "onChange" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
4
  export default DatePicker;
@@ -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
- }, keyof import("@bifrostui/types").ICommonProps | "open" | "container" | "disablePortal" | "onClose" | "hideBackdrop" | "BackdropProps" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ }, keyof import("@bifrostui/types").ICommonProps | "open" | "container" | "onClose" | "disablePortal" | "hideBackdrop" | "BackdropProps" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
16
  export default Modal;
package/dist/Tabs/Tab.css CHANGED
@@ -17,7 +17,6 @@
17
17
  .bui-tab-active {
18
18
  color: var(--bui-tab-active-color);
19
19
  font-weight: var(--bui-font-weight-bold);
20
- font-family: var(--bui-tab-active-font-family);
21
20
  }
22
21
  .bui-tab-disabled {
23
22
  opacity: 0.5;
@@ -16,7 +16,6 @@ xhs-page {
16
16
  --bui-tab-height: 100%;
17
17
  --bui-tab-padding: var(--bui-spacing-lg) var(--bui-spacing-lg) 10px;
18
18
  --bui-tab-active-color: var(--bui-color-fg-default);
19
- --bui-tab-active-font-family: var(--bui-font-family-accent, inherit);
20
19
  }
21
20
  .bui-tabs {
22
21
  position: relative;
package/dist/Tabs/Tabs.js CHANGED
@@ -1,6 +1,8 @@
1
1
  var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
8
  var __getProtoOf = Object.getPrototypeOf;
@@ -18,6 +20,7 @@ var __spreadValues = (a, b) => {
18
20
  }
19
21
  return a;
20
22
  };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
24
  var __objRest = (source, exclude) => {
22
25
  var target = {};
23
26
  for (var prop in source)
@@ -147,7 +150,7 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
147
150
  if (process.env.NODE_ENV !== "production") {
148
151
  console.count("Tabs render......");
149
152
  }
150
- return /* @__PURE__ */ import_react.default.createElement("div", __spreadValues({ ref, className: (0, import_clsx.default)(import_classes.tabsRootClass, className) }, others), /* @__PURE__ */ import_react.default.createElement(import_TabMask.default, { tabsContainerRef: tabsRef, position: "left" }), /* @__PURE__ */ import_react.default.createElement(import_TabMask.default, { tabsContainerRef: tabsRef, position: "right" }), /* @__PURE__ */ import_react.default.createElement(
153
+ return /* @__PURE__ */ import_react.default.createElement("div", __spreadProps(__spreadValues({ className: (0, import_clsx.default)(import_classes.tabsRootClass, className) }, others), { ref }), /* @__PURE__ */ import_react.default.createElement(import_TabMask.default, { tabsContainerRef: tabsRef, position: "left" }), /* @__PURE__ */ import_react.default.createElement(import_TabMask.default, { tabsContainerRef: tabsRef, position: "right" }), /* @__PURE__ */ import_react.default.createElement(
151
154
  "div",
152
155
  {
153
156
  className: `${import_classes.tabsRootClass}-tabs`,
@@ -16,7 +16,6 @@ xhs-page {
16
16
  --bui-tab-height: 100%;
17
17
  --bui-tab-padding: var(--bui-spacing-lg) var(--bui-spacing-lg) 10px;
18
18
  --bui-tab-active-color: var(--bui-color-fg-default);
19
- --bui-tab-active-font-family: var(--bui-font-family-accent, inherit);
20
19
  }
21
20
  .bui-tabs {
22
21
  position: relative;
@@ -107,7 +106,6 @@ xhs-page {
107
106
  .bui-tab-active {
108
107
  color: var(--bui-tab-active-color);
109
108
  font-weight: var(--bui-font-weight-bold);
110
- font-family: var(--bui-tab-active-font-family);
111
109
  }
112
110
  .bui-tab-disabled {
113
111
  opacity: 0.5;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TabProps } from '../Tab.types';
3
3
  import '../Tab.less';
4
- declare const _default: React.NamedExoticComponent<TabProps<"div", {}>>;
4
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<TabProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>>;
5
5
  export default _default;
@@ -36,7 +36,7 @@ var import_utils = require("@bifrostui/utils");
36
36
  var import_TabsContext = __toESM(require("./TabsContext"));
37
37
  var import_classes = require("../classes");
38
38
  var import_Tab2 = require("../Tab.css");
39
- const Tab = (props) => {
39
+ const Tab = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
40
40
  const {
41
41
  className,
42
42
  children,
@@ -45,6 +45,8 @@ const Tab = (props) => {
45
45
  onClick,
46
46
  style
47
47
  } = props;
48
+ const innerRef = (0, import_react.useRef)(null);
49
+ const handleRef = (0, import_utils.useForkRef)(ref, innerRef);
48
50
  const isActive = (0, import_utils.useContextSelector)(
49
51
  import_TabsContext.default,
50
52
  (ctx) => ctx.value === index
@@ -85,6 +87,7 @@ const Tab = (props) => {
85
87
  "div",
86
88
  {
87
89
  id: tabId,
90
+ ref: handleRef,
88
91
  className: rootCls,
89
92
  style,
90
93
  onClick: (e) => {
@@ -96,7 +99,7 @@ const Tab = (props) => {
96
99
  },
97
100
  children
98
101
  );
99
- };
102
+ });
100
103
  Tab.displayName = "BuiTab";
101
104
  var Tab_default = /* @__PURE__ */ import_react.default.memo(Tab, (prevProps, nextProps) => {
102
105
  return prevProps.index === nextProps.index && prevProps.disabled === nextProps.disabled && prevProps.className === nextProps.className && prevProps.children === nextProps.children;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TabsProps } from '../Tabs.types';
3
3
  import '../Tabs.less';
4
- declare const Tabs: React.FC<TabsProps>;
4
+ declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  export default Tabs;
@@ -62,7 +62,7 @@ var import_TabsContext = require("./TabsContext");
62
62
  var import_classes = require("../classes");
63
63
  var import_queryBatch = require("./utils/queryBatch");
64
64
  var import_Tabs2 = require("../Tabs.css");
65
- const Tabs = (props) => {
65
+ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
66
66
  const {
67
67
  children,
68
68
  className,
@@ -228,7 +228,7 @@ const Tabs = (props) => {
228
228
  }
229
229
  };
230
230
  }, []);
231
- return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_clsx.default)(import_classes.tabsRootClass, className), style }, /* @__PURE__ */ import_react.default.createElement(
231
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_clsx.default)(import_classes.tabsRootClass, className), style, ref }, /* @__PURE__ */ import_react.default.createElement(
232
232
  import_TabMask.default,
233
233
  {
234
234
  position: "left",
@@ -270,6 +270,6 @@ const Tabs = (props) => {
270
270
  }
271
271
  ), /* @__PURE__ */ import_react.default.createElement(import_TabsContext.TabsContextProvider, { value: contextValue }, renderedTabs))
272
272
  ));
273
- };
273
+ });
274
274
  Tabs.displayName = "BuiTabs";
275
275
  var Tabs_default = Tabs;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { DatePickerProps } from './DatePicker.types';
3
- declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "defaultValue" | "onChange" | "value" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "value" | "defaultValue" | "onChange" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
4
  export default DatePicker;
@@ -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
- }, keyof import("@bifrostui/types").ICommonProps | "open" | "container" | "disablePortal" | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ }, keyof import("@bifrostui/types").ICommonProps | "container" | "open" | "disablePortal" | "hideBackdrop" | "BackdropProps" | "onClose" | "disableScrollLock" | "keepMounted">, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
16
  export default Modal;
package/es/Tabs/Tab.css CHANGED
@@ -17,7 +17,6 @@
17
17
  .bui-tab-active {
18
18
  color: var(--bui-tab-active-color);
19
19
  font-weight: var(--bui-font-weight-bold);
20
- font-family: var(--bui-tab-active-font-family);
21
20
  }
22
21
  .bui-tab-disabled {
23
22
  opacity: 0.5;
package/es/Tabs/Tabs.css CHANGED
@@ -16,7 +16,6 @@ xhs-page {
16
16
  --bui-tab-height: 100%;
17
17
  --bui-tab-padding: var(--bui-spacing-lg) var(--bui-spacing-lg) 10px;
18
18
  --bui-tab-active-color: var(--bui-color-fg-default);
19
- --bui-tab-active-font-family: var(--bui-font-family-accent, inherit);
20
19
  }
21
20
  .bui-tabs {
22
21
  position: relative;
package/es/Tabs/Tabs.js CHANGED
@@ -1,4 +1,6 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
4
6
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -14,6 +16,7 @@ var __spreadValues = (a, b) => {
14
16
  }
15
17
  return a;
16
18
  };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
17
20
  var __objRest = (source, exclude) => {
18
21
  var target = {};
19
22
  for (var prop in source)
@@ -117,7 +120,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
117
120
  if (process.env.NODE_ENV !== "production") {
118
121
  console.count("Tabs render......");
119
122
  }
120
- return /* @__PURE__ */ React.createElement("div", __spreadValues({ ref, className: clsx(tabsRootClass, className) }, others), /* @__PURE__ */ React.createElement(TabMask, { tabsContainerRef: tabsRef, position: "left" }), /* @__PURE__ */ React.createElement(TabMask, { tabsContainerRef: tabsRef, position: "right" }), /* @__PURE__ */ React.createElement(
123
+ return /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({ className: clsx(tabsRootClass, className) }, others), { ref }), /* @__PURE__ */ React.createElement(TabMask, { tabsContainerRef: tabsRef, position: "left" }), /* @__PURE__ */ React.createElement(TabMask, { tabsContainerRef: tabsRef, position: "right" }), /* @__PURE__ */ React.createElement(
121
124
  "div",
122
125
  {
123
126
  className: `${tabsRootClass}-tabs`,
package/es/Tabs/index.css CHANGED
@@ -16,7 +16,6 @@ xhs-page {
16
16
  --bui-tab-height: 100%;
17
17
  --bui-tab-padding: var(--bui-spacing-lg) var(--bui-spacing-lg) 10px;
18
18
  --bui-tab-active-color: var(--bui-color-fg-default);
19
- --bui-tab-active-font-family: var(--bui-font-family-accent, inherit);
20
19
  }
21
20
  .bui-tabs {
22
21
  position: relative;
@@ -107,7 +106,6 @@ xhs-page {
107
106
  .bui-tab-active {
108
107
  color: var(--bui-tab-active-color);
109
108
  font-weight: var(--bui-font-weight-bold);
110
- font-family: var(--bui-tab-active-font-family);
111
109
  }
112
110
  .bui-tab-disabled {
113
111
  opacity: 0.5;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TabProps } from '../Tab.types';
3
3
  import '../Tab.less';
4
- declare const _default: React.NamedExoticComponent<TabProps<"div", {}>>;
4
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<TabProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>>;
5
5
  export default _default;
@@ -1,10 +1,10 @@
1
- import React, { useEffect } from "react";
1
+ import React, { useEffect, useRef } from "react";
2
2
  import clsx from "clsx";
3
- import { useContextSelector } from "@bifrostui/utils";
3
+ import { useContextSelector, useForkRef } from "@bifrostui/utils";
4
4
  import TabsContext from "./TabsContext";
5
5
  import { tabRootClass, tabActiveClass, tabDisabledClass } from "../classes";
6
6
  import "../Tab.css";
7
- const Tab = (props) => {
7
+ const Tab = /* @__PURE__ */ React.forwardRef((props, ref) => {
8
8
  const {
9
9
  className,
10
10
  children,
@@ -13,6 +13,8 @@ const Tab = (props) => {
13
13
  onClick,
14
14
  style
15
15
  } = props;
16
+ const innerRef = useRef(null);
17
+ const handleRef = useForkRef(ref, innerRef);
16
18
  const isActive = useContextSelector(
17
19
  TabsContext,
18
20
  (ctx) => ctx.value === index
@@ -53,6 +55,7 @@ const Tab = (props) => {
53
55
  "div",
54
56
  {
55
57
  id: tabId,
58
+ ref: handleRef,
56
59
  className: rootCls,
57
60
  style,
58
61
  onClick: (e) => {
@@ -64,7 +67,7 @@ const Tab = (props) => {
64
67
  },
65
68
  children
66
69
  );
67
- };
70
+ });
68
71
  Tab.displayName = "BuiTab";
69
72
  var Tab_default = /* @__PURE__ */ React.memo(Tab, (prevProps, nextProps) => {
70
73
  return prevProps.index === nextProps.index && prevProps.disabled === nextProps.disabled && prevProps.className === nextProps.className && prevProps.children === nextProps.children;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TabsProps } from '../Tabs.types';
3
3
  import '../Tabs.less';
4
- declare const Tabs: React.FC<TabsProps>;
4
+ declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  export default Tabs;
@@ -37,7 +37,7 @@ import {
37
37
  batchQueryForScroll
38
38
  } from "./utils/queryBatch";
39
39
  import "../Tabs.css";
40
- const Tabs = (props) => {
40
+ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
41
41
  const {
42
42
  children,
43
43
  className,
@@ -203,7 +203,7 @@ const Tabs = (props) => {
203
203
  }
204
204
  };
205
205
  }, []);
206
- return /* @__PURE__ */ React.createElement("div", { className: clsx(tabsRootClass, className), style }, /* @__PURE__ */ React.createElement(
206
+ return /* @__PURE__ */ React.createElement("div", { className: clsx(tabsRootClass, className), style, ref }, /* @__PURE__ */ React.createElement(
207
207
  TabMask,
208
208
  {
209
209
  position: "left",
@@ -245,7 +245,7 @@ const Tabs = (props) => {
245
245
  }
246
246
  ), /* @__PURE__ */ React.createElement(TabsContextProvider, { value: contextValue }, renderedTabs))
247
247
  ));
248
- };
248
+ });
249
249
  Tabs.displayName = "BuiTabs";
250
250
  var Tabs_default = Tabs;
251
251
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifrostui/react",
3
- "version": "2.0.0-alpha.15",
3
+ "version": "2.0.0-alpha.17",
4
4
  "description": "React components for building mobile application",
5
5
  "homepage": "http://bui.taopiaopiao.com",
6
6
  "license": "MIT",
@@ -43,10 +43,10 @@
43
43
  "clsx": "^2.1.1",
44
44
  "dayjs": "^1.11.7",
45
45
  "swiper": "^8.1.5",
46
- "@bifrostui/icons": "2.0.0-alpha.15",
47
- "@bifrostui/styles": "2.0.0-alpha.15",
48
- "@bifrostui/types": "2.0.0-alpha.15",
49
- "@bifrostui/utils": "2.0.0-alpha.15"
46
+ "@bifrostui/styles": "2.0.0-alpha.17",
47
+ "@bifrostui/types": "2.0.0-alpha.17",
48
+ "@bifrostui/icons": "2.0.0-alpha.17",
49
+ "@bifrostui/utils": "2.0.0-alpha.17"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@tarojs/components": "^3.0.0",