@bifrostui/react 2.0.0-alpha.26 → 2.0.0-alpha.28

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.
@@ -57,6 +57,9 @@ const StackDemo = () => {
57
57
  {
58
58
  onClick: () => {
59
59
  setOpen((prev) => !prev);
60
+ },
61
+ style: {
62
+ marginBottom: "18px"
60
63
  }
61
64
  },
62
65
  open ? "Exit" : "Enter"
@@ -1,6 +1,3 @@
1
- .bui-btn {
2
- margin-bottom: 18px;
3
- }
4
1
  .slide-enter {
5
2
  transform: translate3d(-100%, 0, 0);
6
3
  }
@@ -33,11 +33,11 @@ export interface DialogProps extends Omit<ModalProps, 'title' | 'content'> {
33
33
  /**
34
34
  * 透传给内部Button组件的属性
35
35
  */
36
- okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, string>;
36
+ okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
37
37
  /**
38
38
  * 透传给内部Button组件的属性
39
39
  */
40
- cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, string>;
40
+ cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
41
41
  /**
42
42
  * 确认按钮文本内容
43
43
  */
@@ -80,6 +80,10 @@ export type DialogOptions = Omit<DialogProps, 'placeholder' | 'inputProps' | 'on
80
80
  * 取消回调
81
81
  */
82
82
  onCancel?: (e: React.SyntheticEvent) => void;
83
+ /**
84
+ * 透传 data- 属性
85
+ */
86
+ [key: `data-${string}`]: any;
83
87
  };
84
88
  /**
85
89
  * prompt函数式调用配置参数
@@ -39,6 +39,7 @@ xhs-page {
39
39
  .bui-tabs-scroll-wrapper {
40
40
  height: 100%;
41
41
  display: flex;
42
+ flex-direction: row;
42
43
  flex-wrap: nowrap;
43
44
  justify-content: flex-start;
44
45
  align-items: center;
@@ -39,6 +39,7 @@ xhs-page {
39
39
  .bui-tabs-scroll-wrapper {
40
40
  height: 100%;
41
41
  display: flex;
42
+ flex-direction: row;
42
43
  flex-wrap: nowrap;
43
44
  justify-content: flex-start;
44
45
  align-items: center;
@@ -232,8 +232,7 @@ const Tabs = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
232
232
  onScroll: handleScroll,
233
233
  enhanced: true,
234
234
  showScrollbar: false,
235
- enablePassive: true,
236
- enableFlex: true
235
+ enablePassive: true
237
236
  },
238
237
  /* @__PURE__ */ import_react.default.createElement("div", { id: wrapperId, className: import_classes.tabsScrollWrapperClass }, /* @__PURE__ */ import_react.default.createElement(
239
238
  import_TabIndicator.default,
@@ -86,8 +86,7 @@ const Toast = (props) => {
86
86
  };
87
87
  const _a = options, { container } = _a, restOptions = __objRest(_a, ["container"]);
88
88
  const rootWrapper = document.createElement("div");
89
- const rootElement = (0, import_utils.getRootContainer)(container);
90
- rootElement == null ? void 0 : rootElement.appendChild(rootWrapper);
89
+ document.body.appendChild(rootWrapper);
91
90
  const ToastComponent = () => {
92
91
  const _a2 = restOptions, { duration, multiple, onClose, onExited } = _a2, others = __objRest(_a2, ["duration", "multiple", "onClose", "onExited"]);
93
92
  const [open, setOpen] = (0, import_react.useState)(true);
@@ -125,7 +124,7 @@ const Toast = (props) => {
125
124
  }
126
125
  };
127
126
  instance.close = close;
128
- return /* @__PURE__ */ import_react.default.createElement(import_Toast.default, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited }));
127
+ return /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { container }, /* @__PURE__ */ import_react.default.createElement(import_Toast.default, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited })));
129
128
  };
130
129
  (0, import_utils.render)(/* @__PURE__ */ import_react.default.createElement(ToastComponent, null), rootWrapper);
131
130
  return instance;
@@ -15,10 +15,13 @@ xhs-page {
15
15
  }
16
16
  .bui-toast {
17
17
  position: fixed;
18
- left: 50%;
18
+ left: 0;
19
+ right: 0;
20
+ margin: 0 auto;
19
21
  z-index: var(--bui-z-index-toast);
20
22
  min-width: var(--bui-toast-min-width);
21
23
  max-width: var(--bui-toast-max-width);
24
+ width: fit-content;
22
25
  padding: var(--bui-toast-padding);
23
26
  font-size: var(--bui-text-size-1);
24
27
  color: var(--bui-color-white);
@@ -31,20 +34,19 @@ xhs-page {
31
34
  }
32
35
  .bui-toast.bui-toast-allow-click {
33
36
  position: fixed;
34
- right: unset;
35
37
  bottom: unset;
36
38
  }
37
39
  .bui-toast-center {
38
40
  top: 50%;
39
- transform: translate(-50%, -50%);
41
+ transform: translateY(-50%);
40
42
  }
41
43
  .bui-toast-top {
42
44
  top: var(--bui-toast-position-top);
43
- transform: translate(-50%, calc(-1 * var(--bui-toast-position-top)));
45
+ transform: translateY(calc(-1 * var(--bui-toast-position-top)));
44
46
  }
45
47
  .bui-toast-bottom {
46
48
  top: var(--bui-toast-position-bottom);
47
- transform: translate(-50%, calc(-1 * var(--bui-toast-position-bottom)));
49
+ transform: translateY(calc(-1 * var(--bui-toast-position-bottom)));
48
50
  }
49
51
  .bui-toast-icon {
50
52
  display: flex;
@@ -25,6 +25,9 @@ const StackDemo = () => {
25
25
  {
26
26
  onClick: () => {
27
27
  setOpen((prev) => !prev);
28
+ },
29
+ style: {
30
+ marginBottom: "18px"
28
31
  }
29
32
  },
30
33
  open ? "Exit" : "Enter"
@@ -1,6 +1,3 @@
1
- .bui-btn {
2
- margin-bottom: 18px;
3
- }
4
1
  .slide-enter {
5
2
  transform: translate3d(-100%, 0, 0);
6
3
  }
@@ -33,11 +33,11 @@ export interface DialogProps extends Omit<ModalProps, 'title' | 'content'> {
33
33
  /**
34
34
  * 透传给内部Button组件的属性
35
35
  */
36
- okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, string>;
36
+ okButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
37
37
  /**
38
38
  * 透传给内部Button组件的属性
39
39
  */
40
- cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, string>;
40
+ cancelButtonProps?: Partial<ButtonProps> & Record<`data-${string}`, any>;
41
41
  /**
42
42
  * 确认按钮文本内容
43
43
  */
@@ -80,6 +80,10 @@ export type DialogOptions = Omit<DialogProps, 'placeholder' | 'inputProps' | 'on
80
80
  * 取消回调
81
81
  */
82
82
  onCancel?: (e: React.SyntheticEvent) => void;
83
+ /**
84
+ * 透传 data- 属性
85
+ */
86
+ [key: `data-${string}`]: any;
83
87
  };
84
88
  /**
85
89
  * prompt函数式调用配置参数
package/es/Tabs/Tabs.css CHANGED
@@ -39,6 +39,7 @@ xhs-page {
39
39
  .bui-tabs-scroll-wrapper {
40
40
  height: 100%;
41
41
  display: flex;
42
+ flex-direction: row;
42
43
  flex-wrap: nowrap;
43
44
  justify-content: flex-start;
44
45
  align-items: center;
package/es/Tabs/index.css CHANGED
@@ -39,6 +39,7 @@ xhs-page {
39
39
  .bui-tabs-scroll-wrapper {
40
40
  height: 100%;
41
41
  display: flex;
42
+ flex-direction: row;
42
43
  flex-wrap: nowrap;
43
44
  justify-content: flex-start;
44
45
  align-items: center;
@@ -207,8 +207,7 @@ const Tabs = /* @__PURE__ */ React.forwardRef((props, ref) => {
207
207
  onScroll: handleScroll,
208
208
  enhanced: true,
209
209
  showScrollbar: false,
210
- enablePassive: true,
211
- enableFlex: true
210
+ enablePassive: true
212
211
  },
213
212
  /* @__PURE__ */ React.createElement("div", { id: wrapperId, className: tabsScrollWrapperClass }, /* @__PURE__ */ React.createElement(
214
213
  TabIndicator,
@@ -35,7 +35,7 @@ import React, {
35
35
  useState,
36
36
  useRef
37
37
  } from "react";
38
- import { render, unmount, getRootContainer } from "@bifrostui/utils";
38
+ import { render, unmount } from "@bifrostui/utils";
39
39
  import Portal from "../Portal";
40
40
  import ToastView from "./Toast";
41
41
  const defaultProps = {
@@ -61,8 +61,7 @@ const Toast = (props) => {
61
61
  };
62
62
  const _a = options, { container } = _a, restOptions = __objRest(_a, ["container"]);
63
63
  const rootWrapper = document.createElement("div");
64
- const rootElement = getRootContainer(container);
65
- rootElement == null ? void 0 : rootElement.appendChild(rootWrapper);
64
+ document.body.appendChild(rootWrapper);
66
65
  const ToastComponent = () => {
67
66
  const _a2 = restOptions, { duration, multiple, onClose, onExited } = _a2, others = __objRest(_a2, ["duration", "multiple", "onClose", "onExited"]);
68
67
  const [open, setOpen] = useState(true);
@@ -100,7 +99,7 @@ const Toast = (props) => {
100
99
  }
101
100
  };
102
101
  instance.close = close;
103
- return /* @__PURE__ */ React.createElement(ToastView, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited }));
102
+ return /* @__PURE__ */ React.createElement(Portal, { container }, /* @__PURE__ */ React.createElement(ToastView, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited })));
104
103
  };
105
104
  render(/* @__PURE__ */ React.createElement(ToastComponent, null), rootWrapper);
106
105
  return instance;
@@ -15,10 +15,13 @@ xhs-page {
15
15
  }
16
16
  .bui-toast {
17
17
  position: fixed;
18
- left: 50%;
18
+ left: 0;
19
+ right: 0;
20
+ margin: 0 auto;
19
21
  z-index: var(--bui-z-index-toast);
20
22
  min-width: var(--bui-toast-min-width);
21
23
  max-width: var(--bui-toast-max-width);
24
+ width: fit-content;
22
25
  padding: var(--bui-toast-padding);
23
26
  font-size: var(--bui-text-size-1);
24
27
  color: var(--bui-color-white);
@@ -31,20 +34,19 @@ xhs-page {
31
34
  }
32
35
  .bui-toast.bui-toast-allow-click {
33
36
  position: fixed;
34
- right: unset;
35
37
  bottom: unset;
36
38
  }
37
39
  .bui-toast-center {
38
40
  top: 50%;
39
- transform: translate(-50%, -50%);
41
+ transform: translateY(-50%);
40
42
  }
41
43
  .bui-toast-top {
42
44
  top: var(--bui-toast-position-top);
43
- transform: translate(-50%, calc(-1 * var(--bui-toast-position-top)));
45
+ transform: translateY(calc(-1 * var(--bui-toast-position-top)));
44
46
  }
45
47
  .bui-toast-bottom {
46
48
  top: var(--bui-toast-position-bottom);
47
- transform: translate(-50%, calc(-1 * var(--bui-toast-position-bottom)));
49
+ transform: translateY(calc(-1 * var(--bui-toast-position-bottom)));
48
50
  }
49
51
  .bui-toast-icon {
50
52
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bifrostui/react",
3
- "version": "2.0.0-alpha.26",
3
+ "version": "2.0.0-alpha.28",
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.26",
47
- "@bifrostui/styles": "2.0.0-alpha.26",
48
- "@bifrostui/types": "2.0.0-alpha.26",
49
- "@bifrostui/utils": "2.0.0-alpha.26"
46
+ "@bifrostui/icons": "2.0.0-alpha.28",
47
+ "@bifrostui/styles": "2.0.0-alpha.28",
48
+ "@bifrostui/types": "2.0.0-alpha.28",
49
+ "@bifrostui/utils": "2.0.0-alpha.28"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@tarojs/components": "^3.0.0",