best-unit 1.2.20 → 1.2.21

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "1.2.20",
4
+ "version": "1.2.21",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
@@ -49,7 +49,7 @@ function createOfflineTransferFormThemes() {
49
49
  padding: size === Size.SMALL ? 12 : 24,
50
50
  textAlign: "center",
51
51
  cursor: "pointer",
52
- minHeight: size === Size.SMALL ? 80 : 120,
52
+ minHeight: size === Size.SMALL ? 100 : 120,
53
53
  display: "flex",
54
54
  flexDirection: "column",
55
55
  alignItems: "center",
@@ -148,7 +148,7 @@ function createOfflineTransferFormThemes() {
148
148
  padding: size === Size.SMALL ? 12 : 24,
149
149
  textAlign: "center",
150
150
  cursor: "pointer",
151
- minHeight: size === Size.SMALL ? 80 : 120,
151
+ minHeight: size === Size.SMALL ? 100 : 120,
152
152
  display: "flex",
153
153
  flexDirection: "column",
154
154
  alignItems: "center",
@@ -8,7 +8,7 @@ function createOnlineRechargeFormThemes() {
8
8
  return {
9
9
  white: {
10
10
  label: {
11
- marginBottom: size === Size.SMALL ? 4 : 8,
11
+ marginBottom: size === Size.SMALL ? 6 : 8,
12
12
  fontSize: size === Size.SMALL ? 12 : 14,
13
13
  color: "#222",
14
14
  textAlign: "left",
@@ -11,7 +11,7 @@ function createRechargeThemes() {
11
11
  flex: 1,
12
12
  background: active ? "#fff" : "#F7F8FA",
13
13
  color: active ? "#1890ff" : "#222",
14
- border: "none",
14
+ border: "1px solid #F0F1F3",
15
15
  borderRadius: left ? "8px 0 0 8px" : "0 8px 8px 0",
16
16
  fontWeight: active ? 600 : 400,
17
17
  fontSize: size === Size.SMALL ? 12 : 16,
@@ -19,8 +19,6 @@ function createRechargeThemes() {
19
19
  boxShadow: active ? "0 2px 8px 0 rgba(20,20,20,0.04)" : "none",
20
20
  outline: "none",
21
21
  cursor: "pointer",
22
- borderRight: left ? "1px solid #F0F1F3" : undefined,
23
- borderLeft: !left ? "1px solid #F0F1F3" : undefined,
24
22
  transition: "all 0.2s",
25
23
  }),
26
24
  },
@@ -29,7 +27,7 @@ function createRechargeThemes() {
29
27
  flex: 1,
30
28
  background: active ? "#23262F" : "#181A20",
31
29
  color: active ? "#00E8C6" : "#fff",
32
- border: "none",
30
+ border: "1px solid #444C5C",
33
31
  borderRadius: left ? "8px 0 0 8px" : "0 8px 8px 0",
34
32
  fontWeight: active ? 600 : 400,
35
33
  fontSize: size === Size.SMALL ? 12 : 16,
@@ -37,8 +35,6 @@ function createRechargeThemes() {
37
35
  boxShadow: active ? "0 2px 8px 0 rgba(20,20,20,0.10)" : "none",
38
36
  outline: "none",
39
37
  cursor: "pointer",
40
- borderRight: left ? "1px solid #23262F" : undefined,
41
- borderLeft: !left ? "1px solid #23262F" : undefined,
42
38
  transition: "all 0.2s",
43
39
  }),
44
40
  },
@@ -1,7 +1,10 @@
1
1
  import { useState, useRef } from "preact/hooks";
2
2
  import type { FunctionalComponent, JSX } from "preact";
3
3
  import { getHoverPopoverTheme } from "./theme";
4
+ import { getInitParams } from "@/utils/business";
5
+ import { Size } from "@/types";
4
6
 
7
+ const size = getInitParams<Size>("size");
5
8
  export type PopoverPosition = "top" | "bottom" | "leftTop" | "rightTop";
6
9
  interface HoverPopoverProps {
7
10
  popover: JSX.Element;
@@ -19,10 +22,10 @@ interface HoverPopoverProps {
19
22
  const HoverPopover: FunctionalComponent<HoverPopoverProps> = ({
20
23
  popover,
21
24
  children,
22
- popoverWidth = 300,
23
- popoverMinWidth = 200,
24
- offsetY = 16,
25
- offsetX = 16,
25
+ popoverWidth = size === Size.SMALL ? 200 : 300,
26
+ popoverMinWidth = size === Size.SMALL ? 150 : 200,
27
+ offsetY = size === Size.SMALL ? 8 : 16,
28
+ offsetX = size === Size.SMALL ? 8 : 16,
26
29
  popoverPosition = "top",
27
30
  }) => {
28
31
  const [show, setShow] = useState(false);
@@ -72,10 +75,10 @@ const HoverPopover: FunctionalComponent<HoverPopoverProps> = ({
72
75
  position: "absolute",
73
76
  zIndex: 999,
74
77
  borderRadius: 6,
75
- fontSize: 15,
78
+ fontSize: size === Size.SMALL ? 12 : 15,
76
79
  minWidth: popoverMinWidth,
77
80
  width: popoverWidth,
78
- padding: "8px 14px",
81
+ padding: size === Size.SMALL ? "6px 12px" : "8px 14px",
79
82
  pointerEvents: "auto",
80
83
  textAlign: "center",
81
84
  animation: "fadeInUp 0.3s",
@@ -131,7 +134,7 @@ const HoverPopover: FunctionalComponent<HoverPopoverProps> = ({
131
134
  arrowStyle = {
132
135
  ...arrowStyle,
133
136
  right: -8,
134
- top: 12,
137
+ top: size === Size.SMALL ? 8 : 12,
135
138
  borderTop: "8px solid transparent",
136
139
  borderBottom: "8px solid transparent",
137
140
  borderLeft: `8px solid ${theme.arrow.left}`,
package/src/local/en.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // 英文语言包
2
2
  export const en: Record<string, string> = {
3
+ 确定: "Confirm",
3
4
  // 余额相关
4
5
  余额详情: "Balance Details",
5
6
  真实金额: "Real Balance",
package/src/local/zh.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // 中文语言包
2
2
  export const zh: Record<string, string> = {
3
+ 确定: "确定",
3
4
  // 余额相关
4
5
  余额详情: "余额详情",
5
6
  真实金额: "真实金额",