@blofin/blofin-ui 0.6.87
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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/Badge.d.ts +1 -0
- package/dist/Badge.es.js +56 -0
- package/dist/Button.d.ts +1 -0
- package/dist/Button.es.js +377 -0
- package/dist/Dialog.d.ts +1 -0
- package/dist/Dialog.es.js +159 -0
- package/dist/Divider.d.ts +1 -0
- package/dist/Divider.es.js +25 -0
- package/dist/Drawer.d.ts +1 -0
- package/dist/Drawer.es.js +90 -0
- package/dist/Form.d.ts +1 -0
- package/dist/Form.es.js +752 -0
- package/dist/Slider.d.ts +1 -0
- package/dist/Slider.es.js +242 -0
- package/dist/blofin.css +1 -0
- package/dist/close-c67ec245.js +5 -0
- package/dist/components/Alert/Alert.d.ts +12 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Alert/styles.d.ts +7 -0
- package/dist/components/Badge/Badge.d.ts +21 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/styles.d.ts +7 -0
- package/dist/components/Button/Button.d.ts +35 -0
- package/dist/components/Button/Loading/index.d.ts +8 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/styles.d.ts +13 -0
- package/dist/components/Button/types.d.ts +5 -0
- package/dist/components/Calendar/Calendar.d.ts +12 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/styles.d.ts +39 -0
- package/dist/components/Checkbox/Checkbox.d.ts +8 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/styles.d.ts +22 -0
- package/dist/components/CssDropdown/CssDropdown.d.ts +18 -0
- package/dist/components/CssDropdown/styles.d.ts +7 -0
- package/dist/components/DatePickerRange/DatePickerRange.d.ts +32 -0
- package/dist/components/DatePickerRange/styles.d.ts +6 -0
- package/dist/components/DateTimePicker/Calendar.d.ts +10 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +18 -0
- package/dist/components/DateTimePicker/ScrollableList.d.ts +12 -0
- package/dist/components/DateTimePicker/hooks/useDateTimePicker.d.ts +35 -0
- package/dist/components/DateTimePicker/styles.d.ts +48 -0
- package/dist/components/Dialog/Dialog.d.ts +30 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/Dialog/styles.d.ts +13 -0
- package/dist/components/Divider/Divider.d.ts +8 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/styles.d.ts +7 -0
- package/dist/components/Drawer/Drawer.d.ts +13 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/styles.d.ts +6 -0
- package/dist/components/Dropdown/Dropdown.d.ts +14 -0
- package/dist/components/Dropdown/style.d.ts +9 -0
- package/dist/components/Empty/index.d.ts +5 -0
- package/dist/components/Form/Control.d.ts +13 -0
- package/dist/components/Form/Form.d.ts +3 -0
- package/dist/components/Form/FormItem.d.ts +4 -0
- package/dist/components/Form/FormLabel.d.ts +4 -0
- package/dist/components/Form/context.d.ts +5 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/interface.d.ts +48 -0
- package/dist/components/Form/store.d.ts +16 -0
- package/dist/components/Form/styles/item.d.ts +5 -0
- package/dist/components/Form/useForm.d.ts +3 -0
- package/dist/components/LabelTextField/LabelTextField.d.ts +17 -0
- package/dist/components/LabelTextField/index.d.ts +2 -0
- package/dist/components/LabelTextField/styles.d.ts +34 -0
- package/dist/components/MonthPicker/index.d.ts +17 -0
- package/dist/components/Notification/Notification.d.ts +2 -0
- package/dist/components/Notification/style.d.ts +15 -0
- package/dist/components/Pagination/PageOptions.d.ts +12 -0
- package/dist/components/Pagination/Pagination.d.ts +34 -0
- package/dist/components/Pagination/styles.d.ts +6 -0
- package/dist/components/Picker/hooks/usePickerMethod.d.ts +9 -0
- package/dist/components/Picker/index.d.ts +10 -0
- package/dist/components/Picker/styles.d.ts +4 -0
- package/dist/components/Popover/Popover.d.ts +17 -0
- package/dist/components/Popup/index.d.ts +15 -0
- package/dist/components/Popup/styles.d.ts +3 -0
- package/dist/components/RadioButton/RadioButton.d.ts +10 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/RadioButton/styles.d.ts +12 -0
- package/dist/components/Select/Select.d.ts +38 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/styles.d.ts +24 -0
- package/dist/components/Slider/Slider.d.ts +20 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/styles.d.ts +31 -0
- package/dist/components/Sort/SortButton.d.ts +14 -0
- package/dist/components/Sort/SortGroup.d.ts +8 -0
- package/dist/components/Sort/reducer.d.ts +36 -0
- package/dist/components/Sortable/SortItem.d.ts +6 -0
- package/dist/components/Sortable/index.d.ts +10 -0
- package/dist/components/Switch/Switch.d.ts +9 -0
- package/dist/components/Switch/styles.d.ts +12 -0
- package/dist/components/Tab/Tab.d.ts +21 -0
- package/dist/components/Tab/styles.d.ts +20 -0
- package/dist/components/Table/Pagination/index.d.ts +8 -0
- package/dist/components/Table/Table.d.ts +5 -0
- package/dist/components/Table/Tbody/index.d.ts +14 -0
- package/dist/components/Table/Thead/index.d.ts +17 -0
- package/dist/components/Table/context.d.ts +17 -0
- package/dist/components/Table/css.d.ts +12 -0
- package/dist/components/Table/hooks/useStickyClassName.d.ts +3 -0
- package/dist/components/Table/hooks/useStickyOffset.d.ts +15 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/interface.d.ts +48 -0
- package/dist/components/TextField/TextField.d.ts +15 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TextSelect/TextSelect.d.ts +50 -0
- package/dist/components/TextSelect/styles.d.ts +27 -0
- package/dist/components/Textarea/index.d.ts +15 -0
- package/dist/components/Textarea/style.d.ts +13 -0
- package/dist/components/Toast/Toast.d.ts +2 -0
- package/dist/components/Toast/styles.d.ts +13 -0
- package/dist/components/Tooltip/Tooltip.d.ts +22 -0
- package/dist/components/Tooltip/enum.d.ts +21 -0
- package/dist/components/Tooltip/styles.d.ts +10 -0
- package/dist/components/Tooltip/type.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +35 -0
- package/dist/components/Typography/styles.d.ts +10 -0
- package/dist/config/tailwind.js +9 -0
- package/dist/config/theme.js +318 -0
- package/dist/hooks/useAlign.d.ts +20 -0
- package/dist/hooks/useClient.d.ts +4 -0
- package/dist/hooks/useDelayEvent.d.ts +2 -0
- package/dist/hooks/useLatest.d.ts +1 -0
- package/dist/hooks/useNotification.d.ts +10 -0
- package/dist/hooks/useOutsideClick.d.ts +2 -0
- package/dist/hooks/useToast.d.ts +9 -0
- package/dist/index-0055aace.js +338 -0
- package/dist/index-0171eaca.js +436 -0
- package/dist/index-03ecf4ec.js +400 -0
- package/dist/index-04d10294.js +298 -0
- package/dist/index-0a1520d4.js +287 -0
- package/dist/index-0f855a91.js +14 -0
- package/dist/index-114820db.js +354 -0
- package/dist/index-1388dfff.js +336 -0
- package/dist/index-15b50a21.js +298 -0
- package/dist/index-17308ac1.js +298 -0
- package/dist/index-17afe366.js +298 -0
- package/dist/index-1d78221c.js +339 -0
- package/dist/index-1dc85776.js +437 -0
- package/dist/index-20e881af.js +354 -0
- package/dist/index-20f2adc4.js +398 -0
- package/dist/index-21539629.js +478 -0
- package/dist/index-21f85e78.js +377 -0
- package/dist/index-236e0579.js +71 -0
- package/dist/index-250f50e2.js +502 -0
- package/dist/index-356291b2.js +450 -0
- package/dist/index-38216e9e.js +340 -0
- package/dist/index-3c058c26.js +606 -0
- package/dist/index-3c3ba437.js +341 -0
- package/dist/index-3cd72a27.js +61 -0
- package/dist/index-3dcefa10.js +328 -0
- package/dist/index-3f70b1d4.js +331 -0
- package/dist/index-40ad0dd1.js +287 -0
- package/dist/index-42fb4fd5.js +334 -0
- package/dist/index-45696efa.js +438 -0
- package/dist/index-4b6824f2.js +61 -0
- package/dist/index-4b7924c1.js +354 -0
- package/dist/index-4c8ef561.js +337 -0
- package/dist/index-4ced47cd.js +359 -0
- package/dist/index-4eb29fd9.js +313 -0
- package/dist/index-4f2d4e0d.js +342 -0
- package/dist/index-51847d07.js +363 -0
- package/dist/index-51c1e00d.js +9 -0
- package/dist/index-51cf15b2.js +11054 -0
- package/dist/index-5357c173.js +336 -0
- package/dist/index-572ed179.js +353 -0
- package/dist/index-580c6bf2.js +362 -0
- package/dist/index-6817d9c1.js +363 -0
- package/dist/index-682656f7.js +62 -0
- package/dist/index-6834d6cf.js +330 -0
- package/dist/index-6a5829bd.js +387 -0
- package/dist/index-739cb389.js +332 -0
- package/dist/index-7601ed24.js +332 -0
- package/dist/index-76c2d21a.js +362 -0
- package/dist/index-7871c2fa.js +397 -0
- package/dist/index-7a871a23.js +362 -0
- package/dist/index-7aae1d07.js +298 -0
- package/dist/index-80121226.js +443 -0
- package/dist/index-872a50e8.js +353 -0
- package/dist/index-88fdaa89.js +437 -0
- package/dist/index-8a4c6daa.js +302 -0
- package/dist/index-8fb7d88b.js +360 -0
- package/dist/index-9412ffa1.js +346 -0
- package/dist/index-95d62350.js +427 -0
- package/dist/index-96a8d125.js +65 -0
- package/dist/index-9d0a665d.js +298 -0
- package/dist/index-a8c0dd3b.js +500 -0
- package/dist/index-aa90be0a.js +146 -0
- package/dist/index-aac5376e.js +331 -0
- package/dist/index-ac48594f.js +364 -0
- package/dist/index-acc7a626.js +146 -0
- package/dist/index-af6965cc.js +332 -0
- package/dist/index-b523f554.js +61 -0
- package/dist/index-b5aa671f.js +463 -0
- package/dist/index-b7612310.js +333 -0
- package/dist/index-babf632c.js +332 -0
- package/dist/index-baf0849c.js +346 -0
- package/dist/index-bb65c72e.js +514 -0
- package/dist/index-bb84ad8c.js +514 -0
- package/dist/index-c1e6e7ba.js +340 -0
- package/dist/index-cb4b8e2c.js +341 -0
- package/dist/index-d9848a76.js +545 -0
- package/dist/index-dc4bbb59.js +332 -0
- package/dist/index-dfc0fb0e.js +364 -0
- package/dist/index-e27e30cc.js +345 -0
- package/dist/index-e8380fcb.js +335 -0
- package/dist/index-ea4a8872.js +311 -0
- package/dist/index-eb696d64.js +436 -0
- package/dist/index-ebd469fd.js +297 -0
- package/dist/index-ed48cf75.js +383 -0
- package/dist/index-f3092738.js +308 -0
- package/dist/index-f41bdf2a.js +238 -0
- package/dist/index-f5c25d06.js +458 -0
- package/dist/index-f7e0a67b.js +511 -0
- package/dist/index-fafae16f.js +337 -0
- package/dist/index-ffe656da.js +332 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.es.js +51 -0
- package/dist/isObjectLike-1b8bbac2.js +44 -0
- package/dist/jsx-runtime-944c88e2.js +631 -0
- package/dist/provider/NoticeProvider.d.ts +41 -0
- package/dist/provider/ThemeProvider.d.ts +7 -0
- package/dist/provider/useTheme.d.ts +4 -0
- package/dist/types/component.d.ts +16 -0
- package/dist/types/svg.d.ts +4 -0
- package/dist/utils/format.d.ts +7 -0
- package/dist/utils/helper.d.ts +7 -0
- package/dist/utils/locales.d.ts +1 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils-7e50508b.js +2304 -0
- package/dist/vite.svg +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { useState as R, useEffect as D } from "react";
|
|
3
|
+
import d from "react-dom";
|
|
4
|
+
import { S as I } from "./close-c67ec245.js";
|
|
5
|
+
import { Button as k } from "./Button.es.js";
|
|
6
|
+
import { a as s, u as L } from "./index-96a8d125.js";
|
|
7
|
+
import "./utils-7e50508b.js";
|
|
8
|
+
const M = s(
|
|
9
|
+
"bu-absolute bu-left-[50%] bu-top-[50%] bu-flex bu-translate-x-[-50%] bu-translate-y-[-50%] bu-flex-col bu-justify-between bu-rounded-[10px] bu-pb-[32px] bu-pt-[24px]",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
large: "max-[600px]:bu-w-[80%] min-[600px]:bu-min-h-[234px] min-[600px]:bu-w-[800px]",
|
|
14
|
+
medium: "max-[600px]:bu-w-[80%] min-[600px]:bu-min-h-[226px] min-[600px]:bu-w-[600px]",
|
|
15
|
+
small: "max-[600px]:bu-w-[80%] min-[600px]:bu-min-h-[210px] min-[600px]:bu-w-[520px]"
|
|
16
|
+
},
|
|
17
|
+
theme: {
|
|
18
|
+
dark: "bu-bg-dark-hover-fill-primary",
|
|
19
|
+
light: "bu-bg-light-background"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
), A = s("", {
|
|
24
|
+
variants: {
|
|
25
|
+
theme: {
|
|
26
|
+
dark: "bu-text-dark-label",
|
|
27
|
+
light: "bu-text-light-label"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}), B = s(
|
|
31
|
+
"bu-absolute bu-right-[20px] bu-h-[24px] bu-w-[24px] bu-cursor-pointer",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
theme: {
|
|
35
|
+
dark: "bu-text-dark-label",
|
|
36
|
+
light: "bu-text-light-label-40"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
), F = s("bu-flex bu-px-[24px]", {
|
|
41
|
+
variants: {
|
|
42
|
+
footerLayout: {
|
|
43
|
+
right: "bu-justify-end",
|
|
44
|
+
left: "bu-justify-start",
|
|
45
|
+
center: "bu-justify-center"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}), P = "_mock_13kkq_1", V = "_dialog_13kkq_5", G = "_title_13kkq_9", H = "_content_13kkq_13", a = {
|
|
49
|
+
mock: P,
|
|
50
|
+
dialog: V,
|
|
51
|
+
title: G,
|
|
52
|
+
content: H
|
|
53
|
+
}, g = (t) => {
|
|
54
|
+
const {
|
|
55
|
+
size: n,
|
|
56
|
+
title: o,
|
|
57
|
+
content: i,
|
|
58
|
+
maskClosable: c = !1,
|
|
59
|
+
cancelText: y = "",
|
|
60
|
+
confirmText: v = "",
|
|
61
|
+
footer: r,
|
|
62
|
+
cancel: b,
|
|
63
|
+
confirm: x,
|
|
64
|
+
theme: f,
|
|
65
|
+
footerLayout: j,
|
|
66
|
+
footerSize: h = "small",
|
|
67
|
+
hideCancel: p = !1,
|
|
68
|
+
hideConfirm: C = !1,
|
|
69
|
+
hideIcon: _ = !1,
|
|
70
|
+
className: w,
|
|
71
|
+
contentClassName: N,
|
|
72
|
+
open: m,
|
|
73
|
+
loading: S = !1,
|
|
74
|
+
containerRef: $
|
|
75
|
+
} = t, { theme: z } = L(), [q, T] = R(!1), l = () => f || z, u = () => {
|
|
76
|
+
b && b();
|
|
77
|
+
}, E = () => {
|
|
78
|
+
c && u();
|
|
79
|
+
}, O = () => {
|
|
80
|
+
x && x();
|
|
81
|
+
};
|
|
82
|
+
return D(() => (document.body.style.overflow = m ? "hidden" : "", T(m), () => {
|
|
83
|
+
document.body.style.overflow = "";
|
|
84
|
+
}), [m]), q ? d.createPortal(
|
|
85
|
+
/* @__PURE__ */ e.jsx("div", { className: a.mock, onClick: E, children: /* @__PURE__ */ e.jsxs(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: `${a.dialog} ${M({
|
|
89
|
+
size: n,
|
|
90
|
+
theme: l()
|
|
91
|
+
})} ${w}`,
|
|
92
|
+
children: [
|
|
93
|
+
!_ && /* @__PURE__ */ e.jsx(
|
|
94
|
+
I,
|
|
95
|
+
{
|
|
96
|
+
className: `${B({
|
|
97
|
+
theme: l()
|
|
98
|
+
})}`,
|
|
99
|
+
onClick: u
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ e.jsx("div", { className: A({ theme: l() }), children: o !== null && /* @__PURE__ */ e.jsx("div", { className: a.title, children: o }) }),
|
|
103
|
+
/* @__PURE__ */ e.jsx("div", { ref: $, className: `${a.content} ${N}`, children: i }),
|
|
104
|
+
/* @__PURE__ */ e.jsx("div", { className: F({ footerLayout: j }), children: r === null ? null : r || /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
105
|
+
!p && /* @__PURE__ */ e.jsx(
|
|
106
|
+
k,
|
|
107
|
+
{
|
|
108
|
+
size: h,
|
|
109
|
+
variant: "ghost",
|
|
110
|
+
theme: l(),
|
|
111
|
+
onClick: u,
|
|
112
|
+
children: y
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
!C && /* @__PURE__ */ e.jsx(
|
|
116
|
+
k,
|
|
117
|
+
{
|
|
118
|
+
className: p ? "" : "bu-ml-[16px]",
|
|
119
|
+
size: h,
|
|
120
|
+
variant: "primary",
|
|
121
|
+
loading: S,
|
|
122
|
+
theme: l(),
|
|
123
|
+
onClick: O,
|
|
124
|
+
children: v
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }) })
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
) }),
|
|
131
|
+
document.body
|
|
132
|
+
) : null;
|
|
133
|
+
};
|
|
134
|
+
g.show = (t) => {
|
|
135
|
+
const n = document.createElement("div");
|
|
136
|
+
document.body.appendChild(n);
|
|
137
|
+
const o = () => {
|
|
138
|
+
d.unmountComponentAtNode(n), document.body.removeChild(n);
|
|
139
|
+
}, i = () => {
|
|
140
|
+
t.cancel && t.cancel(), o();
|
|
141
|
+
}, c = () => {
|
|
142
|
+
t.confirm && t.confirm(), o();
|
|
143
|
+
};
|
|
144
|
+
return d.render(
|
|
145
|
+
/* @__PURE__ */ e.jsx(
|
|
146
|
+
g,
|
|
147
|
+
{
|
|
148
|
+
...t,
|
|
149
|
+
open: !0,
|
|
150
|
+
cancel: i,
|
|
151
|
+
confirm: c
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
n
|
|
155
|
+
), o;
|
|
156
|
+
};
|
|
157
|
+
export {
|
|
158
|
+
g as Dialog
|
|
159
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/Divider/index'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import { a as i, u as b } from "./index-96a8d125.js";
|
|
3
|
+
import { c as a } from "./utils-7e50508b.js";
|
|
4
|
+
import "react";
|
|
5
|
+
const m = i("", {
|
|
6
|
+
variants: {
|
|
7
|
+
theme: {
|
|
8
|
+
light: "bu-my-1 bu-h-px bu-border-0 bu-bg-light-line-primary",
|
|
9
|
+
dark: "bu-my-1 bu-h-px bu-border-0 bu-bg-dark-line-primary"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}), l = i("bu-h-full bu-w-px", {
|
|
13
|
+
variants: {
|
|
14
|
+
theme: {
|
|
15
|
+
light: "bu-bg-light-label-20",
|
|
16
|
+
dark: "bu-bg-dark-label-20"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}), p = ({ direction: s = "horizontal", theme: e }) => {
|
|
20
|
+
const { theme: r } = b();
|
|
21
|
+
return s === "horizontal" ? /* @__PURE__ */ t.jsx("hr", { className: `${a(m({ theme: r || e }))}` }) : /* @__PURE__ */ t.jsx("div", { className: `${a(l({ theme: r || e }))}` });
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
p as Divider
|
|
25
|
+
};
|
package/dist/Drawer.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/Drawer/index'
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
|
+
import x from "react-dom";
|
|
3
|
+
import { S as f } from "./close-c67ec245.js";
|
|
4
|
+
import { a as c, u as g } from "./index-96a8d125.js";
|
|
5
|
+
import "react";
|
|
6
|
+
const k = "_drawerOverlay_w8q99_2", v = "_drawerContent_w8q99_14", y = "_left_w8q99_19", C = "_right_w8q99_23", q = "_drawerHeader_w8q99_27", j = "_title_w8q99_42", N = "_mock_w8q99_47", O = "_content_w8q99_51", t = {
|
|
7
|
+
drawerOverlay: k,
|
|
8
|
+
drawerContent: v,
|
|
9
|
+
left: y,
|
|
10
|
+
right: C,
|
|
11
|
+
drawerHeader: q,
|
|
12
|
+
"drawer-close-button": "_drawer-close-button_w8q99_34",
|
|
13
|
+
title: j,
|
|
14
|
+
mock: N,
|
|
15
|
+
content: O
|
|
16
|
+
}, $ = c(
|
|
17
|
+
"bu-absolute bu-flex bu-flex-col bu-pb-[32px] bu-pt-[24px]",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
theme: {
|
|
21
|
+
dark: "bu-bg-dark-hover-fill-primary",
|
|
22
|
+
light: "bu-bg-light-background"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
), H = c(
|
|
27
|
+
"bu-absolute bu-right-[20px] bu-h-[24px] bu-w-[24px] bu-cursor-pointer",
|
|
28
|
+
{
|
|
29
|
+
variants: {
|
|
30
|
+
theme: {
|
|
31
|
+
dark: "bu-text-dark-label",
|
|
32
|
+
light: "bu-text-light-label-40"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
), X = (i) => {
|
|
37
|
+
const {
|
|
38
|
+
title: d,
|
|
39
|
+
content: m,
|
|
40
|
+
cancel: n,
|
|
41
|
+
theme: o,
|
|
42
|
+
hideIcon: u = !1,
|
|
43
|
+
open: r,
|
|
44
|
+
placement: _ = "right",
|
|
45
|
+
drawerContentClass: w = "bu-w-[300px]"
|
|
46
|
+
} = i, { theme: h } = g(), s = () => o || h;
|
|
47
|
+
if (!r)
|
|
48
|
+
return null;
|
|
49
|
+
const l = () => {
|
|
50
|
+
n && n();
|
|
51
|
+
}, b = (a) => {
|
|
52
|
+
a.target === a.currentTarget && (a.stopPropagation(), l());
|
|
53
|
+
}, p = {
|
|
54
|
+
transition: r ? "transform .3s ease-in-out" : "transform .3s ease-in-out, opacity 0.3s ease",
|
|
55
|
+
transform: r ? "translateX(0)" : "translateX(100%)",
|
|
56
|
+
opacity: r ? 1 : 0
|
|
57
|
+
};
|
|
58
|
+
return r ? x.createPortal(
|
|
59
|
+
/* @__PURE__ */ e.jsx("div", { className: t.mock, onClick: b, children: /* @__PURE__ */ e.jsxs(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: `${t.drawerContent}
|
|
63
|
+
${$({
|
|
64
|
+
theme: s()
|
|
65
|
+
})}
|
|
66
|
+
${t[_]} ${w}`,
|
|
67
|
+
style: p,
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ e.jsxs("div", { className: t.drawerHeader, children: [
|
|
70
|
+
/* @__PURE__ */ e.jsx("div", { className: t.title, children: d }),
|
|
71
|
+
!u && /* @__PURE__ */ e.jsx(
|
|
72
|
+
f,
|
|
73
|
+
{
|
|
74
|
+
className: `${H({
|
|
75
|
+
theme: s()
|
|
76
|
+
})}`,
|
|
77
|
+
onClick: l
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ e.jsx("div", { className: t.content, children: m })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
) }),
|
|
85
|
+
document.body
|
|
86
|
+
) : null;
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
X as Drawer
|
|
90
|
+
};
|
package/dist/Form.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/Form/index'
|