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/dist/best-unit.cjs +9 -9
- package/dist/best-unit.js +688 -690
- package/package.json +1 -1
- package/src/components/business/recharge-sdk/components/offline-transfer-form/theme.tsx +2 -2
- package/src/components/business/recharge-sdk/components/online-recharge-form/theme.tsx +1 -1
- package/src/components/business/recharge-sdk/components/recharge/theme.tsx +2 -6
- package/src/components/common/hover-popover/index.tsx +10 -7
- package/src/local/en.ts +1 -0
- package/src/local/zh.ts +1 -0
package/package.json
CHANGED
|
@@ -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 ?
|
|
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 ?
|
|
151
|
+
minHeight: size === Size.SMALL ? 100 : 120,
|
|
152
152
|
display: "flex",
|
|
153
153
|
flexDirection: "column",
|
|
154
154
|
alignItems: "center",
|
|
@@ -11,7 +11,7 @@ function createRechargeThemes() {
|
|
|
11
11
|
flex: 1,
|
|
12
12
|
background: active ? "#fff" : "#F7F8FA",
|
|
13
13
|
color: active ? "#1890ff" : "#222",
|
|
14
|
-
border: "
|
|
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: "
|
|
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