@blofin/blofin-ui 1.0.0-beta.15 → 1.0.0-beta.16
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/Checkbox.es.js +5 -4
- package/dist/Drawer.es.js +110 -55
- package/dist/Notification.es.js +3 -2
- package/dist/Sort.es.js +15 -14
- package/dist/Toast.es.js +3 -2
- package/dist/blofin.css +1 -1
- package/dist/components/Drawer/animations.d.ts +19 -0
- package/dist/components/Drawer/useDrawerCallbacks.d.ts +12 -0
- package/dist/components/Sort/index.d.ts +2 -1
- package/dist/index-54c64fd8.js +469 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +80 -78
- package/dist/index.module-4db476ff.js +13 -0
- package/dist/proxy-50241ce1.js +4863 -0
- package/package.json +1 -1
- package/dist/index-40023d52.js +0 -5322
- package/dist/index.module-86edc823.js +0 -15
package/dist/Checkbox.es.js
CHANGED
|
@@ -12,7 +12,7 @@ import "./Dialog.es.js";
|
|
|
12
12
|
import "react-dom";
|
|
13
13
|
import "./enum-0398044b.js";
|
|
14
14
|
import "./Popover.es.js";
|
|
15
|
-
import "./index.module-
|
|
15
|
+
import "./index.module-4db476ff.js";
|
|
16
16
|
import "./LabelTextField.es.js";
|
|
17
17
|
import "./index-9349bf2d.js";
|
|
18
18
|
import "./RadioButton.es.js";
|
|
@@ -26,7 +26,7 @@ import "./TextField.es.js";
|
|
|
26
26
|
import "./Textarea.es.js";
|
|
27
27
|
import "./sortable.esm-8d31c120.js";
|
|
28
28
|
import "./MultiSelect.es.js";
|
|
29
|
-
import "./index-
|
|
29
|
+
import "./index-54c64fd8.js";
|
|
30
30
|
import "./sortable.esm-1c13d908.js";
|
|
31
31
|
import { c as s } from "./index-c57db938.js";
|
|
32
32
|
import "./clsx.m-e965ef18.js";
|
|
@@ -44,6 +44,7 @@ import "./helper-221987f8.js";
|
|
|
44
44
|
import "./close-bg-6d2211ef.js";
|
|
45
45
|
import "./Empty.es.js";
|
|
46
46
|
import "./arrow-down-l-line-97e4fe24.js";
|
|
47
|
+
import "./proxy-50241ce1.js";
|
|
47
48
|
const H = "_container_g0kof_1", R = "_checkmark_g0kof_22", M = "_unchecked_g0kof_28", m = {
|
|
48
49
|
container: H,
|
|
49
50
|
checkmark: R,
|
|
@@ -76,7 +77,7 @@ const H = "_container_g0kof_1", R = "_checkmark_g0kof_22", M = "_unchecked_g0kof
|
|
|
76
77
|
medium: ["bu-h-[18px] bu-w-[18px]"]
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
}),
|
|
80
|
+
}), L1 = k((g, w) => {
|
|
80
81
|
const {
|
|
81
82
|
label: p,
|
|
82
83
|
theme: h,
|
|
@@ -134,5 +135,5 @@ const H = "_container_g0kof_1", R = "_checkmark_g0kof_22", M = "_unchecked_g0kof
|
|
|
134
135
|
] });
|
|
135
136
|
});
|
|
136
137
|
export {
|
|
137
|
-
|
|
138
|
+
L1 as Checkbox
|
|
138
139
|
};
|
package/dist/Drawer.es.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { c } from "./
|
|
8
|
-
import "
|
|
2
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as m, useMemo as u, useEffect as N } from "react";
|
|
4
|
+
import { createPortal as D } from "react-dom";
|
|
5
|
+
import { S as E } from "./close-0df24351.js";
|
|
6
|
+
import { u as O } from "./useTheme-0688f238.js";
|
|
7
|
+
import { c as P } from "./utils-071abd68.js";
|
|
8
|
+
import { s as i } from "./index.module-4db476ff.js";
|
|
9
|
+
import { c as f } from "./index-c57db938.js";
|
|
10
|
+
import { A as S, m as x } from "./proxy-50241ce1.js";
|
|
9
11
|
import "./clsx.m-e965ef18.js";
|
|
10
|
-
const
|
|
12
|
+
const T = f(
|
|
11
13
|
"bu-absolute bu-flex bu-flex-col bu-pb-[32px] bu-pt-[24px]",
|
|
12
14
|
{
|
|
13
15
|
variants: {
|
|
@@ -17,7 +19,7 @@ const w = c(
|
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
|
-
),
|
|
22
|
+
), V = f(
|
|
21
23
|
"bu-absolute bu-right-[20px] bu-h-[24px] bu-w-[24px] bu-cursor-pointer",
|
|
22
24
|
{
|
|
23
25
|
variants: {
|
|
@@ -27,58 +29,111 @@ const w = c(
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
|
-
),
|
|
32
|
+
), j = {
|
|
33
|
+
hidden: {
|
|
34
|
+
opacity: 0
|
|
35
|
+
},
|
|
36
|
+
visible: {
|
|
37
|
+
opacity: 1
|
|
38
|
+
},
|
|
39
|
+
exit: {
|
|
40
|
+
opacity: 0
|
|
41
|
+
}
|
|
42
|
+
}, A = {
|
|
43
|
+
right: {
|
|
44
|
+
hidden: { x: "100%" },
|
|
45
|
+
visible: { x: 0 },
|
|
46
|
+
exit: { x: "100%" }
|
|
47
|
+
},
|
|
48
|
+
left: {
|
|
49
|
+
hidden: { x: "-100%" },
|
|
50
|
+
visible: { x: 0 },
|
|
51
|
+
exit: { x: "-100%" }
|
|
52
|
+
}
|
|
53
|
+
}, v = {
|
|
54
|
+
type: "tween",
|
|
55
|
+
duration: 0.3,
|
|
56
|
+
ease: "easeInOut"
|
|
57
|
+
}, I = (a) => {
|
|
58
|
+
const t = m(() => {
|
|
59
|
+
a == null || a();
|
|
60
|
+
}, [a]), s = m((e) => {
|
|
61
|
+
e.target === e.currentTarget && (e.stopPropagation(), t());
|
|
62
|
+
}, [t]), o = m((e) => {
|
|
63
|
+
e.key === "Escape" && t();
|
|
64
|
+
}, [t]);
|
|
65
|
+
return {
|
|
66
|
+
handleCancel: t,
|
|
67
|
+
handleOverlayClick: s,
|
|
68
|
+
handleKeyDown: o
|
|
69
|
+
};
|
|
70
|
+
}, J = (a) => {
|
|
31
71
|
const {
|
|
32
|
-
title:
|
|
33
|
-
content:
|
|
34
|
-
cancel:
|
|
35
|
-
theme:
|
|
36
|
-
hideIcon:
|
|
37
|
-
open:
|
|
38
|
-
placement:
|
|
72
|
+
title: t,
|
|
73
|
+
content: s,
|
|
74
|
+
cancel: o,
|
|
75
|
+
theme: e,
|
|
76
|
+
hideIcon: w = !1,
|
|
77
|
+
open: l,
|
|
78
|
+
placement: c = "right",
|
|
39
79
|
drawerContentClass: h = "bu-w-[300px]"
|
|
40
|
-
} =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
"
|
|
80
|
+
} = a, { theme: b } = O(), { handleCancel: y, handleOverlayClick: k, handleKeyDown: d } = I(o), n = u(() => e ?? b, [e, b]), g = u(
|
|
81
|
+
() => P(
|
|
82
|
+
i.drawerContent,
|
|
83
|
+
T({ theme: n }),
|
|
84
|
+
i[c],
|
|
85
|
+
h
|
|
86
|
+
),
|
|
87
|
+
[n, c, h]
|
|
88
|
+
), C = u(
|
|
89
|
+
() => V({ theme: n }),
|
|
90
|
+
[n]
|
|
91
|
+
);
|
|
92
|
+
return N(() => {
|
|
93
|
+
if (l)
|
|
94
|
+
return document.addEventListener("keydown", d), () => {
|
|
95
|
+
document.removeEventListener("keydown", d);
|
|
96
|
+
};
|
|
97
|
+
}, [l, d]), D(
|
|
98
|
+
/* @__PURE__ */ r(S, { mode: "wait", children: l && /* @__PURE__ */ r(
|
|
99
|
+
x.div,
|
|
55
100
|
{
|
|
56
|
-
className:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
101
|
+
className: i.mock,
|
|
102
|
+
variants: j,
|
|
103
|
+
initial: "hidden",
|
|
104
|
+
animate: "visible",
|
|
105
|
+
exit: "exit",
|
|
106
|
+
transition: v,
|
|
107
|
+
onClick: k,
|
|
108
|
+
children: /* @__PURE__ */ p(
|
|
109
|
+
x.div,
|
|
110
|
+
{
|
|
111
|
+
className: g,
|
|
112
|
+
variants: A[c],
|
|
113
|
+
initial: "hidden",
|
|
114
|
+
animate: "visible",
|
|
115
|
+
exit: "exit",
|
|
116
|
+
transition: v,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ p("div", { className: i.drawerHeader, children: [
|
|
119
|
+
/* @__PURE__ */ r("div", { className: i.title, children: t }),
|
|
120
|
+
!w && /* @__PURE__ */ r(
|
|
121
|
+
E,
|
|
122
|
+
{
|
|
123
|
+
className: C,
|
|
124
|
+
onClick: y
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ r("div", { className: i.content, children: s })
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
)
|
|
77
132
|
}
|
|
78
133
|
) }),
|
|
79
134
|
document.body
|
|
80
|
-
)
|
|
135
|
+
);
|
|
81
136
|
};
|
|
82
137
|
export {
|
|
83
|
-
|
|
138
|
+
J as Drawer
|
|
84
139
|
};
|
package/dist/Notification.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { b as
|
|
2
|
+
import { b as n } from "./index-54c64fd8.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
@@ -7,6 +7,7 @@ import "./index-c57db938.js";
|
|
|
7
7
|
import "./clsx.m-e965ef18.js";
|
|
8
8
|
import "./useTheme-0688f238.js";
|
|
9
9
|
import "./close-0df24351.js";
|
|
10
|
+
import "./proxy-50241ce1.js";
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
n as Notification
|
|
12
13
|
};
|
package/dist/Sort.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i, jsxs as x } from "react/jsx-runtime";
|
|
3
3
|
import { S as B } from "./arrow-down-011b02c7.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as l from "react";
|
|
5
5
|
import { createContext as I } from "react";
|
|
6
6
|
import { k as M } from "./helper-221987f8.js";
|
|
7
7
|
import { u as N } from "./useTheme-0688f238.js";
|
|
8
8
|
import { c as R } from "./clsx.m-e965ef18.js";
|
|
9
|
-
const H = (s) => /* @__PURE__ */
|
|
9
|
+
const H = (s) => /* @__PURE__ */ l.createElement("svg", { width: 11, height: 6, viewBox: "0 0 11 6", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...s }, /* @__PURE__ */ l.createElement("path", { d: "M9.5 4.19995V5.79995H1.5V4.19995L5.5 0.199951L9.5 4.19995Z", fill: "currentColor", fillOpacity: 1 }));
|
|
10
10
|
var t = /* @__PURE__ */ ((s) => (s.default = "default", s.desc = "desc", s.asc = "asc", s))(t || {});
|
|
11
11
|
const k = {
|
|
12
12
|
type: "single",
|
|
@@ -56,10 +56,10 @@ const k = {
|
|
|
56
56
|
textAlign: c = "center",
|
|
57
57
|
width: f = "100%",
|
|
58
58
|
iconStyle: y,
|
|
59
|
-
theme:
|
|
59
|
+
theme: C
|
|
60
60
|
}) => {
|
|
61
61
|
var T, _;
|
|
62
|
-
const { theme:
|
|
62
|
+
const { theme: z } = N(), $ = C || z, { state: j, dispatch: h } = l.useContext(S), { sorts: d, type: v } = j, w = l.useMemo(() => d.length > 0 ? d.map((u) => u.sort) : [], [d]), m = l.useMemo(() => M(d, "sort"), [d]);
|
|
63
63
|
return /* @__PURE__ */ i("div", { style: { justifyContent: c, width: f }, children: /* @__PURE__ */ x(
|
|
64
64
|
"div",
|
|
65
65
|
{
|
|
@@ -68,10 +68,10 @@ const k = {
|
|
|
68
68
|
return;
|
|
69
69
|
const u = m[o];
|
|
70
70
|
if (u) {
|
|
71
|
-
let
|
|
72
|
-
u.sortType === t.desc ?
|
|
71
|
+
let a = t.default;
|
|
72
|
+
u.sortType === t.desc ? a = t.asc : u.sortType === t.asc ? a = t.default : a = t.desc, h({
|
|
73
73
|
type: "changeSort",
|
|
74
|
-
payload: { sort: o, sortType:
|
|
74
|
+
payload: { sort: o, sortType: a },
|
|
75
75
|
success: (n) => {
|
|
76
76
|
e(v === "single" ? {
|
|
77
77
|
sortKey: n[0].sort,
|
|
@@ -86,11 +86,11 @@ const k = {
|
|
|
86
86
|
h({
|
|
87
87
|
type: "changeSort",
|
|
88
88
|
payload: { sort: o, sortType: t.desc },
|
|
89
|
-
success: (
|
|
89
|
+
success: (a) => {
|
|
90
90
|
e(v === "single" ? {
|
|
91
|
-
sortKey:
|
|
92
|
-
sort:
|
|
93
|
-
} :
|
|
91
|
+
sortKey: a[0].sort,
|
|
92
|
+
sort: a[0].sortType
|
|
93
|
+
} : a.map((n) => ({
|
|
94
94
|
sortKey: n.sort,
|
|
95
95
|
sort: n.sortType
|
|
96
96
|
})));
|
|
@@ -124,9 +124,9 @@ const k = {
|
|
|
124
124
|
]
|
|
125
125
|
}
|
|
126
126
|
) });
|
|
127
|
-
}, q =
|
|
127
|
+
}, q = l.forwardRef(
|
|
128
128
|
({ children: s, type: e = "single" }, o) => {
|
|
129
|
-
const [r, c] =
|
|
129
|
+
const [r, c] = l.useReducer(L, { ...k, type: e }), f = (y) => {
|
|
130
130
|
c({
|
|
131
131
|
type: "restSort",
|
|
132
132
|
payload: { sort: "", sortType: t.default },
|
|
@@ -135,12 +135,13 @@ const k = {
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
|
-
return
|
|
138
|
+
return l.useImperativeHandle(o, () => ({
|
|
139
139
|
restSort: f
|
|
140
140
|
})), /* @__PURE__ */ i(S.Provider, { value: { state: r, dispatch: c }, children: s });
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
143
|
export {
|
|
144
144
|
b as SortButton,
|
|
145
|
+
S as SortContext,
|
|
145
146
|
q as SortGroup
|
|
146
147
|
};
|
package/dist/Toast.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { T } from "./index-
|
|
2
|
+
import { T as c } from "./index-54c64fd8.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
@@ -7,6 +7,7 @@ import "./index-c57db938.js";
|
|
|
7
7
|
import "./clsx.m-e965ef18.js";
|
|
8
8
|
import "./useTheme-0688f238.js";
|
|
9
9
|
import "./close-0df24351.js";
|
|
10
|
+
import "./proxy-50241ce1.js";
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
c as Toast
|
|
12
13
|
};
|