@bbki.ng/components 2.6.1 → 2.6.3
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/index.cjs +289 -282
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +9 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.js +223 -216
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,74 @@
|
|
|
1
1
|
// lib/article/Article.tsx
|
|
2
|
+
import classNames2 from "classnames";
|
|
3
|
+
import React3 from "react";
|
|
4
|
+
|
|
5
|
+
// lib/blink-dot/BlinkDot.tsx
|
|
2
6
|
import classNames from "classnames";
|
|
3
7
|
import React from "react";
|
|
8
|
+
var BlinkDot = (props) => {
|
|
9
|
+
const { className } = props;
|
|
10
|
+
const status = props.status || "hidden";
|
|
11
|
+
const statusCls = classNames({
|
|
12
|
+
"animate-ping-fast": status === "blink",
|
|
13
|
+
hidden: status === "hidden"
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ React.createElement("span", {
|
|
16
|
+
className: classNames("inline-flex justify-center items-center relative")
|
|
17
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
18
|
+
className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls} ${className}`
|
|
19
|
+
}, "."));
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// lib/blur-cover/BlurCover.tsx
|
|
23
|
+
import React2 from "react";
|
|
24
|
+
import cls from "classnames";
|
|
25
|
+
var BlurCover = (props) => {
|
|
26
|
+
const { status } = props;
|
|
27
|
+
const coverCls = cls(
|
|
28
|
+
"absolute",
|
|
29
|
+
"block",
|
|
30
|
+
"text-blur",
|
|
31
|
+
"transition-all",
|
|
32
|
+
"top-0",
|
|
33
|
+
"left-0",
|
|
34
|
+
"h-full",
|
|
35
|
+
"w-full",
|
|
36
|
+
{
|
|
37
|
+
"z-[999]": status === "show",
|
|
38
|
+
"opacity-0": status === "silent",
|
|
39
|
+
"opacity-100": status === "show",
|
|
40
|
+
"pointer-events-none": status === "silent"
|
|
41
|
+
},
|
|
42
|
+
props.className
|
|
43
|
+
);
|
|
44
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
45
|
+
className: coverCls
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// lib/article/Article.tsx
|
|
4
50
|
var Article = (props) => {
|
|
5
51
|
const { title, content, children, className, description } = props;
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
className:
|
|
8
|
-
}, /* @__PURE__ */
|
|
9
|
-
className: "
|
|
10
|
-
},
|
|
52
|
+
return /* @__PURE__ */ React3.createElement("div", {
|
|
53
|
+
className: classNames2("article", className)
|
|
54
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
55
|
+
className: "mb-128 leading-none"
|
|
56
|
+
}, /* @__PURE__ */ React3.createElement("span", {
|
|
57
|
+
className: "text-[2.25rem] p-16"
|
|
58
|
+
}, title), props.loading && /* @__PURE__ */ React3.createElement(BlinkDot, {
|
|
59
|
+
status: "blink",
|
|
60
|
+
className: "!-top-[42px] !-left-16"
|
|
61
|
+
})), description && /* @__PURE__ */ React3.createElement("div", {
|
|
11
62
|
className: "mb-128"
|
|
12
|
-
}, description), /* @__PURE__ */
|
|
13
|
-
className: "text-black"
|
|
14
|
-
}, children || content
|
|
63
|
+
}, description), /* @__PURE__ */ React3.createElement("div", {
|
|
64
|
+
className: "text-black relative p-16"
|
|
65
|
+
}, children || content, /* @__PURE__ */ React3.createElement(BlurCover, {
|
|
66
|
+
status: props.loading ? "show" : "silent"
|
|
67
|
+
})));
|
|
15
68
|
};
|
|
16
69
|
|
|
17
70
|
// lib/button/Button.tsx
|
|
18
|
-
import
|
|
71
|
+
import React4 from "react";
|
|
19
72
|
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
20
73
|
ButtonType2["DANGER"] = "danger";
|
|
21
74
|
ButtonType2["PRIMARY"] = "primary";
|
|
@@ -32,7 +85,7 @@ function Button(props) {
|
|
|
32
85
|
};
|
|
33
86
|
const { type = "normal" /* NORMAL */, className = "", onClick, btnType } = props;
|
|
34
87
|
const shadowTransCls = type === "disabled" /* DISABLED */ ? "" : "transition-all duration-200 ease-in-out shadow-button hover:shadow-button-hover active:shadow-empty";
|
|
35
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ React4.createElement("button", {
|
|
36
89
|
className: `${typeClsMap[type]} ${className} ${shadowTransCls} py-8 px-16 transition-all duration-200 ease-in-out`,
|
|
37
90
|
onClick,
|
|
38
91
|
type: btnType
|
|
@@ -41,9 +94,9 @@ function Button(props) {
|
|
|
41
94
|
Button.displayName = "Button";
|
|
42
95
|
|
|
43
96
|
// lib/logo/Logo.tsx
|
|
44
|
-
import * as
|
|
45
|
-
var Logo =
|
|
46
|
-
(props) => /* @__PURE__ */
|
|
97
|
+
import * as React5 from "react";
|
|
98
|
+
var Logo = React5.memo(
|
|
99
|
+
(props) => /* @__PURE__ */ React5.createElement("svg", {
|
|
47
100
|
xmlns: "http://www.w3.org/2000/svg",
|
|
48
101
|
width: "48",
|
|
49
102
|
height: "48",
|
|
@@ -51,25 +104,25 @@ var Logo = React3.memo(
|
|
|
51
104
|
fill: "none",
|
|
52
105
|
onClick: props.onClick,
|
|
53
106
|
className: props.className
|
|
54
|
-
}, /* @__PURE__ */
|
|
107
|
+
}, /* @__PURE__ */ React5.createElement("path", {
|
|
55
108
|
d: "M29.1152 21.3106C32.0605 21.3106 34.4481 18.9101 34.4481 15.9489V24.6457C34.4481 25.7585 33.5508 26.6607 32.444 26.6607H15.1207C14.0138 26.6607 13.1166 25.7585 13.1166 24.6457V15.9489C13.1166 18.9101 15.5042 21.3106 18.4494 21.3106C21.3947 21.3106 23.7823 18.9101 23.7823 15.9489C23.7823 18.9101 26.17 21.3106 29.1152 21.3106Z",
|
|
56
109
|
fill: "#9CA3AF"
|
|
57
|
-
}), /* @__PURE__ */
|
|
110
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
58
111
|
d: "M23.7823 15.9373L23.7823 15.9489C23.7823 15.9451 23.7823 15.9412 23.7823 15.9373Z",
|
|
59
112
|
fill: "#9CA3AF"
|
|
60
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
61
114
|
d: "M23.1143 28.004C23.1205 30.9598 25.5057 33.3541 28.4472 33.3541C31.3886 33.3541 33.7738 30.9598 33.7801 28.004H23.1143Z",
|
|
62
115
|
fill: "#9CA3AF"
|
|
63
|
-
}), /* @__PURE__ */
|
|
116
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
64
117
|
d: "M13.7846 28.004C13.7846 28.0079 13.7846 28.0117 13.7846 28.0156C13.7908 30.9714 16.1761 33.3657 19.1175 33.3657C22.0589 33.3657 24.4442 30.9714 24.4504 28.0156H13.7846V28.004Z",
|
|
65
118
|
fill: "#9CA3AF"
|
|
66
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
67
120
|
d: "M14.4527 15.9373C14.4527 16.6792 13.8545 17.2806 13.1166 17.2806C12.3786 17.2806 11.7805 16.6792 11.7805 15.9373C11.7805 15.1954 12.3786 14.594 13.1166 14.594C13.8545 14.594 14.4527 15.1954 14.4527 15.9373Z",
|
|
68
121
|
fill: "#9CA3AF"
|
|
69
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
70
123
|
d: "M25.1184 15.2657C25.1184 16.0076 24.5202 16.609 23.7823 16.609C23.0444 16.609 22.4462 16.0076 22.4462 15.2657C22.4462 14.5238 23.0444 13.9224 23.7823 13.9224C24.5202 13.9224 25.1184 14.5238 25.1184 15.2657Z",
|
|
71
124
|
fill: "#9CA3AF"
|
|
72
|
-
}), /* @__PURE__ */
|
|
125
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
73
126
|
d: "M35.7842 15.9373C35.7842 16.6792 35.186 17.2806 34.4481 17.2806C33.7102 17.2806 33.112 16.6792 33.112 15.9373C33.112 15.1954 33.7102 14.594 34.4481 14.594C35.186 14.594 35.7842 15.1954 35.7842 15.9373Z",
|
|
74
127
|
fill: "#9CA3AF"
|
|
75
128
|
})),
|
|
@@ -79,35 +132,16 @@ var Logo = React3.memo(
|
|
|
79
132
|
);
|
|
80
133
|
|
|
81
134
|
// lib/nav/Nav.tsx
|
|
82
|
-
import
|
|
135
|
+
import React8 from "react";
|
|
83
136
|
|
|
84
137
|
// lib/breadcrumb/Breadcrumb.tsx
|
|
85
|
-
import
|
|
138
|
+
import React7 from "react";
|
|
86
139
|
import classNames4 from "classnames";
|
|
87
140
|
|
|
88
141
|
// lib/link/Link.tsx
|
|
89
142
|
import classNames3 from "classnames";
|
|
90
143
|
import { Link as BaseLink } from "react-router-dom";
|
|
91
|
-
import
|
|
92
|
-
|
|
93
|
-
// lib/blink-dot/BlinkDot.tsx
|
|
94
|
-
import classNames2 from "classnames";
|
|
95
|
-
import React4 from "react";
|
|
96
|
-
var BlinkDot = (props) => {
|
|
97
|
-
const { className } = props;
|
|
98
|
-
const status = props.status || "hidden";
|
|
99
|
-
const statusCls = classNames2({
|
|
100
|
-
"animate-ping-fast": status === "blink",
|
|
101
|
-
hidden: status === "hidden"
|
|
102
|
-
});
|
|
103
|
-
return /* @__PURE__ */ React4.createElement("span", {
|
|
104
|
-
className: classNames2("inline-flex justify-center items-center relative")
|
|
105
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
106
|
-
className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls}`
|
|
107
|
-
}, "."));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// lib/link/Link.tsx
|
|
144
|
+
import React6 from "react";
|
|
111
145
|
var LinkColor = /* @__PURE__ */ ((LinkColor2) => {
|
|
112
146
|
LinkColor2["BLUE"] = "blue";
|
|
113
147
|
LinkColor2["RED"] = "red";
|
|
@@ -150,7 +184,7 @@ var Link = (props) => {
|
|
|
150
184
|
FOCUS_BG_COLOR_MAPPING[color]
|
|
151
185
|
);
|
|
152
186
|
if (external) {
|
|
153
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ React6.createElement("a", {
|
|
154
188
|
href: props.to,
|
|
155
189
|
className: linkCls,
|
|
156
190
|
target: "_blank",
|
|
@@ -161,18 +195,18 @@ var Link = (props) => {
|
|
|
161
195
|
if (readonly) {
|
|
162
196
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(children);
|
|
163
197
|
const offsetCls = classNames3({ "relative top-[2px]": isNonEnName });
|
|
164
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement("span", {
|
|
165
199
|
className: classNames3("text-gray-400", offsetCls),
|
|
166
200
|
style: { padding: 4 }
|
|
167
|
-
}, children), /* @__PURE__ */
|
|
201
|
+
}, children), /* @__PURE__ */ React6.createElement(BlinkDot, {
|
|
168
202
|
status
|
|
169
203
|
}));
|
|
170
204
|
}
|
|
171
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(BaseLink, {
|
|
172
206
|
...rest,
|
|
173
207
|
className: linkCls,
|
|
174
208
|
style: { padding: 4 }
|
|
175
|
-
}, children), /* @__PURE__ */
|
|
209
|
+
}, children), /* @__PURE__ */ React6.createElement(BlinkDot, {
|
|
176
210
|
className: "-top-3 left-1",
|
|
177
211
|
status
|
|
178
212
|
}));
|
|
@@ -182,23 +216,23 @@ var Link = (props) => {
|
|
|
182
216
|
var Breadcrumb = (props) => {
|
|
183
217
|
const { paths, loading } = props;
|
|
184
218
|
const PathElements = paths.map(({ path, name }, index) => {
|
|
185
|
-
const slash = index === 0 ? null : /* @__PURE__ */
|
|
219
|
+
const slash = index === 0 ? null : /* @__PURE__ */ React7.createElement("span", {
|
|
186
220
|
className: "text-gray-400"
|
|
187
221
|
}, "/");
|
|
188
222
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
|
|
189
223
|
const offsetCls = classNames4({ "relative top-[2px]": isNonEnName });
|
|
190
224
|
const isLast = index === paths.length - 1;
|
|
191
225
|
const status = loading && isLast ? "blink" : "hidden";
|
|
192
|
-
return /* @__PURE__ */
|
|
226
|
+
return /* @__PURE__ */ React7.createElement("span", {
|
|
193
227
|
key: path || name
|
|
194
|
-
}, slash, /* @__PURE__ */
|
|
228
|
+
}, slash, /* @__PURE__ */ React7.createElement(Link, {
|
|
195
229
|
to: path ?? "",
|
|
196
230
|
className: offsetCls,
|
|
197
231
|
readonly: !path,
|
|
198
232
|
status
|
|
199
233
|
}, name));
|
|
200
234
|
});
|
|
201
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
202
236
|
className: "breadcrumb"
|
|
203
237
|
}, PathElements);
|
|
204
238
|
};
|
|
@@ -207,21 +241,21 @@ var Breadcrumb = (props) => {
|
|
|
207
241
|
import { useNavigate } from "react-router-dom";
|
|
208
242
|
var Nav = (props) => {
|
|
209
243
|
if (props.mini) {
|
|
210
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
211
245
|
className: `p-8 w-full flex items-center ${props.className}`
|
|
212
|
-
}, /* @__PURE__ */
|
|
246
|
+
}, /* @__PURE__ */ React8.createElement(Breadcrumb, {
|
|
213
247
|
paths: props.paths
|
|
214
248
|
}));
|
|
215
249
|
}
|
|
216
250
|
const nav = useNavigate();
|
|
217
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
218
252
|
className: `p-8 w-full flex items-center ${props.className}`
|
|
219
|
-
}, props.customLogo || /* @__PURE__ */
|
|
253
|
+
}, props.customLogo || /* @__PURE__ */ React8.createElement(Logo, {
|
|
220
254
|
className: "mr-8",
|
|
221
255
|
onClick: () => {
|
|
222
256
|
nav("/");
|
|
223
257
|
}
|
|
224
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ React8.createElement(Breadcrumb, {
|
|
225
259
|
paths: props.paths,
|
|
226
260
|
loading: props.loading
|
|
227
261
|
}));
|
|
@@ -229,20 +263,20 @@ var Nav = (props) => {
|
|
|
229
263
|
|
|
230
264
|
// lib/tag/Tag.tsx
|
|
231
265
|
import classNames5 from "classnames";
|
|
232
|
-
import
|
|
266
|
+
import React9 from "react";
|
|
233
267
|
var Tag = (props) => {
|
|
234
|
-
return /* @__PURE__ */
|
|
268
|
+
return /* @__PURE__ */ React9.createElement(Link, {
|
|
235
269
|
...props,
|
|
236
270
|
color: "gray" /* GRAY */
|
|
237
|
-
}, /* @__PURE__ */
|
|
271
|
+
}, /* @__PURE__ */ React9.createElement("small", null, props.prefix || "#", props.children));
|
|
238
272
|
};
|
|
239
273
|
var Tags = (props) => {
|
|
240
274
|
const { tags, className } = props;
|
|
241
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ React9.createElement("div", {
|
|
242
276
|
className: classNames5(className, "inline-block")
|
|
243
277
|
}, tags.map((tag, index) => {
|
|
244
278
|
const isLast = index === tags.length - 1;
|
|
245
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ React9.createElement(Tag, {
|
|
246
280
|
...tag,
|
|
247
281
|
key: tag.to,
|
|
248
282
|
className: classNames5({ "mr-8": !isLast })
|
|
@@ -251,44 +285,44 @@ var Tags = (props) => {
|
|
|
251
285
|
};
|
|
252
286
|
|
|
253
287
|
// lib/panel/Panel.tsx
|
|
254
|
-
import
|
|
288
|
+
import React10, { useEffect, useState } from "react";
|
|
255
289
|
var Panel = (props) => {
|
|
256
290
|
const { className = "", children } = props;
|
|
257
291
|
const [show, setShow] = useState(false);
|
|
258
292
|
useEffect(() => {
|
|
259
293
|
setShow(true);
|
|
260
294
|
}, []);
|
|
261
|
-
return /* @__PURE__ */
|
|
295
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
|
262
296
|
className: `transition-all ease-in-out duration-900 ${className} ${show ? "shadow-panel" : "shadow-empty"} p-32`
|
|
263
297
|
}, children);
|
|
264
298
|
};
|
|
265
299
|
|
|
266
300
|
// lib/page/Page.tsx
|
|
267
|
-
import
|
|
301
|
+
import React11 from "react";
|
|
268
302
|
var Page = (props) => {
|
|
269
303
|
const { nav, main } = props;
|
|
270
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ React11.createElement("main", {
|
|
271
305
|
className: "flex flex-col h-full"
|
|
272
|
-
}, /* @__PURE__ */
|
|
306
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
273
307
|
className: `flx-grow-0 w-full fixed top-0 z-50`
|
|
274
|
-
}, nav), /* @__PURE__ */
|
|
308
|
+
}, nav), /* @__PURE__ */ React11.createElement("section", {
|
|
275
309
|
className: "flex-grow flex-shrink-0 px-6"
|
|
276
310
|
}, main));
|
|
277
311
|
};
|
|
278
312
|
var NotFound = (props) => {
|
|
279
|
-
return /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ React11.createElement(Error2, {
|
|
280
314
|
error: { name: "404", message: "Not Found" }
|
|
281
315
|
});
|
|
282
316
|
};
|
|
283
317
|
var Error2 = (props) => {
|
|
284
318
|
const { error } = props;
|
|
285
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
286
320
|
className: "prose"
|
|
287
|
-
}, /* @__PURE__ */
|
|
321
|
+
}, /* @__PURE__ */ React11.createElement("pre", null, /* @__PURE__ */ React11.createElement("code", {
|
|
288
322
|
className: "javascript language-javascript"
|
|
289
323
|
}, error.name, ":", error.message)));
|
|
290
324
|
};
|
|
291
|
-
var ErrorBoundary = class extends
|
|
325
|
+
var ErrorBoundary = class extends React11.Component {
|
|
292
326
|
constructor(props) {
|
|
293
327
|
super(props);
|
|
294
328
|
this.state = { hasError: false };
|
|
@@ -298,11 +332,11 @@ var ErrorBoundary = class extends React10.Component {
|
|
|
298
332
|
}
|
|
299
333
|
render() {
|
|
300
334
|
if (this.state.error && this.state.hasError) {
|
|
301
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ React11.createElement(Article, {
|
|
302
336
|
title: "\u51FA\u9519"
|
|
303
|
-
}, /* @__PURE__ */
|
|
337
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
304
338
|
className: "relative h-256"
|
|
305
|
-
}, /* @__PURE__ */
|
|
339
|
+
}, /* @__PURE__ */ React11.createElement(Error2, {
|
|
306
340
|
error: this.state.error
|
|
307
341
|
})));
|
|
308
342
|
}
|
|
@@ -311,20 +345,20 @@ var ErrorBoundary = class extends React10.Component {
|
|
|
311
345
|
};
|
|
312
346
|
|
|
313
347
|
// lib/pop-confirm/PopConfirm.tsx
|
|
314
|
-
import
|
|
348
|
+
import React12, { useState as useState2 } from "react";
|
|
315
349
|
var PopConfirm = (props) => {
|
|
316
350
|
const [loading, setLoading] = useState2(false);
|
|
317
351
|
const { onOk, onCancel, children, content, className } = props;
|
|
318
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ React12.createElement(Panel, {
|
|
319
353
|
className
|
|
320
|
-
}, /* @__PURE__ */
|
|
354
|
+
}, /* @__PURE__ */ React12.createElement("div", {
|
|
321
355
|
className: "mb-32"
|
|
322
|
-
}, children || content), /* @__PURE__ */
|
|
356
|
+
}, children || content), /* @__PURE__ */ React12.createElement("div", {
|
|
323
357
|
className: "flex justify-end"
|
|
324
|
-
}, onCancel && /* @__PURE__ */
|
|
358
|
+
}, onCancel && /* @__PURE__ */ React12.createElement(Button, {
|
|
325
359
|
onClick: onCancel,
|
|
326
360
|
type: "normal" /* NORMAL */
|
|
327
|
-
}, "Cancel"), onOk && /* @__PURE__ */
|
|
361
|
+
}, "Cancel"), onOk && /* @__PURE__ */ React12.createElement(Button, {
|
|
328
362
|
onClick: async (e) => {
|
|
329
363
|
setLoading(true);
|
|
330
364
|
await onOk(e);
|
|
@@ -332,80 +366,80 @@ var PopConfirm = (props) => {
|
|
|
332
366
|
},
|
|
333
367
|
className: "ml-16 relative",
|
|
334
368
|
type: loading ? "disabled" /* DISABLED */ : "primary" /* PRIMARY */
|
|
335
|
-
}, "OK", loading && /* @__PURE__ */
|
|
369
|
+
}, "OK", loading && /* @__PURE__ */ React12.createElement(BlinkDot, {
|
|
336
370
|
className: "!absolute top-2 right-2"
|
|
337
371
|
}))));
|
|
338
372
|
};
|
|
339
373
|
|
|
340
374
|
// lib/table/Table.tsx
|
|
341
|
-
import
|
|
375
|
+
import React13 from "react";
|
|
342
376
|
var Table = (props) => {
|
|
343
377
|
const { rowCount, rowRenderer, headerRenderer, className } = props;
|
|
344
378
|
const rows = [];
|
|
345
379
|
for (let i = 0; i < rowCount; i++) {
|
|
346
|
-
rows.push(/* @__PURE__ */
|
|
380
|
+
rows.push(/* @__PURE__ */ React13.createElement("tr", {
|
|
347
381
|
key: i
|
|
348
382
|
}, rowRenderer(i)));
|
|
349
383
|
}
|
|
350
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ React13.createElement("table", {
|
|
351
385
|
className
|
|
352
|
-
}, headerRenderer && /* @__PURE__ */
|
|
386
|
+
}, headerRenderer && /* @__PURE__ */ React13.createElement("thead", null, /* @__PURE__ */ React13.createElement("tr", null, headerRenderer())), /* @__PURE__ */ React13.createElement("tbody", null, rows));
|
|
353
387
|
};
|
|
354
|
-
Table.HCell = (props) => /* @__PURE__ */
|
|
388
|
+
Table.HCell = (props) => /* @__PURE__ */ React13.createElement("th", {
|
|
355
389
|
...props
|
|
356
390
|
}, props.children);
|
|
357
|
-
Table.Cell = (props) => /* @__PURE__ */
|
|
391
|
+
Table.Cell = (props) => /* @__PURE__ */ React13.createElement("td", {
|
|
358
392
|
...props
|
|
359
393
|
}, props.children);
|
|
360
394
|
|
|
361
395
|
// lib/skeleton/Seleton.tsx
|
|
362
396
|
import classNames6 from "classnames";
|
|
363
|
-
import
|
|
397
|
+
import React15 from "react";
|
|
364
398
|
|
|
365
399
|
// lib/list/list.tsx
|
|
366
|
-
import
|
|
367
|
-
import
|
|
400
|
+
import cls2 from "classnames";
|
|
401
|
+
import React14 from "react";
|
|
368
402
|
var List = (props) => {
|
|
369
403
|
const { items, itemRenderer, className, horizontal, compact } = props;
|
|
370
404
|
const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-16";
|
|
371
|
-
return /* @__PURE__ */
|
|
372
|
-
className:
|
|
405
|
+
return /* @__PURE__ */ React14.createElement("ul", {
|
|
406
|
+
className: cls2(className, "list-style-none", {
|
|
373
407
|
flex: horizontal,
|
|
374
408
|
"items-center": horizontal
|
|
375
409
|
})
|
|
376
410
|
}, items.map((item, index) => {
|
|
377
|
-
return /* @__PURE__ */
|
|
411
|
+
return /* @__PURE__ */ React14.createElement("li", {
|
|
378
412
|
key: item.id || index,
|
|
379
|
-
className:
|
|
413
|
+
className: cls2(spaceCls, "flex-shrink-0", { "!my-0": horizontal })
|
|
380
414
|
}, itemRenderer(item, index));
|
|
381
415
|
}));
|
|
382
416
|
};
|
|
383
417
|
var TitledList = (props) => {
|
|
384
418
|
const { title, description, ...rest } = props;
|
|
385
419
|
if (!title) {
|
|
386
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ React14.createElement(List, {
|
|
387
421
|
...rest
|
|
388
422
|
});
|
|
389
423
|
}
|
|
390
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ React14.createElement(Article, {
|
|
391
425
|
title,
|
|
392
426
|
description,
|
|
393
427
|
className: "w-fit"
|
|
394
|
-
}, /* @__PURE__ */
|
|
428
|
+
}, /* @__PURE__ */ React14.createElement(List, {
|
|
395
429
|
...rest
|
|
396
430
|
}));
|
|
397
431
|
};
|
|
398
432
|
var LinkList = (props) => {
|
|
399
433
|
const { title, description, links, ...rest } = props;
|
|
400
434
|
const renderLink = ({ name, to, external, ...rest2 }) => {
|
|
401
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ React14.createElement(Link, {
|
|
402
436
|
to,
|
|
403
437
|
key: name,
|
|
404
438
|
external,
|
|
405
439
|
...rest2
|
|
406
440
|
}, name);
|
|
407
441
|
};
|
|
408
|
-
return /* @__PURE__ */
|
|
442
|
+
return /* @__PURE__ */ React14.createElement(TitledList, {
|
|
409
443
|
title,
|
|
410
444
|
description,
|
|
411
445
|
items: links,
|
|
@@ -435,7 +469,7 @@ var Skeleton = (props) => {
|
|
|
435
469
|
height = 24,
|
|
436
470
|
className
|
|
437
471
|
} = props;
|
|
438
|
-
return /* @__PURE__ */
|
|
472
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
439
473
|
className: classNames6(
|
|
440
474
|
COLOR_MAPPING2[bgColor],
|
|
441
475
|
"animate-pulse",
|
|
@@ -447,13 +481,13 @@ var Skeleton = (props) => {
|
|
|
447
481
|
};
|
|
448
482
|
var ArticleSkeleton = (props) => {
|
|
449
483
|
const { children, titleLength = 0, descriptionLength } = props;
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
title: /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ React15.createElement(Article, {
|
|
485
|
+
title: /* @__PURE__ */ React15.createElement(Skeleton, {
|
|
452
486
|
width: 36 * titleLength,
|
|
453
487
|
height: 36,
|
|
454
488
|
bgColor: "black" /* BLACK */
|
|
455
489
|
}),
|
|
456
|
-
description: descriptionLength && /* @__PURE__ */
|
|
490
|
+
description: descriptionLength && /* @__PURE__ */ React15.createElement(Skeleton, {
|
|
457
491
|
width: 16 * descriptionLength
|
|
458
492
|
})
|
|
459
493
|
}, children);
|
|
@@ -461,29 +495,29 @@ var ArticleSkeleton = (props) => {
|
|
|
461
495
|
var LinkListSkeleton = (props) => {
|
|
462
496
|
const { linksLength, ...rest } = props;
|
|
463
497
|
const renderSkeleton = (length) => {
|
|
464
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ React15.createElement(Skeleton, {
|
|
465
499
|
className: "inline-block align-middle",
|
|
466
500
|
width: length * 16,
|
|
467
501
|
bgColor: "blue" /* BLUE */
|
|
468
502
|
});
|
|
469
503
|
};
|
|
470
504
|
if (!rest.titleLength) {
|
|
471
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ React15.createElement(List, {
|
|
472
506
|
items: linksLength,
|
|
473
507
|
itemRenderer: renderSkeleton
|
|
474
508
|
});
|
|
475
509
|
}
|
|
476
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ React15.createElement(ArticleSkeleton, {
|
|
477
511
|
...rest
|
|
478
|
-
}, /* @__PURE__ */
|
|
512
|
+
}, /* @__PURE__ */ React15.createElement(List, {
|
|
479
513
|
items: linksLength,
|
|
480
514
|
itemRenderer: renderSkeleton
|
|
481
515
|
}));
|
|
482
516
|
};
|
|
483
517
|
|
|
484
518
|
// lib/drop-image/DropImage.tsx
|
|
485
|
-
import
|
|
486
|
-
import
|
|
519
|
+
import cls3 from "classnames";
|
|
520
|
+
import React16, {
|
|
487
521
|
useEffect as useEffect2,
|
|
488
522
|
useCallback as useCallback2
|
|
489
523
|
} from "react";
|
|
@@ -607,8 +641,8 @@ var ImagePreviewer = (props) => {
|
|
|
607
641
|
imageSrc,
|
|
608
642
|
className
|
|
609
643
|
} = props;
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
className:
|
|
644
|
+
return /* @__PURE__ */ React16.createElement("img", {
|
|
645
|
+
className: cls3(
|
|
612
646
|
className,
|
|
613
647
|
"max-w-[100%]",
|
|
614
648
|
"h-[auto]",
|
|
@@ -672,13 +706,13 @@ var GhostDropImage = (props) => {
|
|
|
672
706
|
document.removeEventListener("dragenter", handleDocDragEnter);
|
|
673
707
|
};
|
|
674
708
|
}, []);
|
|
675
|
-
const coverCls =
|
|
709
|
+
const coverCls = cls3("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
676
710
|
"lqip-blur": coverVisible,
|
|
677
711
|
"z-[999]": coverVisible,
|
|
678
712
|
block: coverVisible,
|
|
679
713
|
hidden: !coverVisible
|
|
680
714
|
});
|
|
681
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", {
|
|
682
716
|
className: coverCls,
|
|
683
717
|
onDragLeave: () => {
|
|
684
718
|
handleDragLeave();
|
|
@@ -691,7 +725,7 @@ var GhostDropImage = (props) => {
|
|
|
691
725
|
imageRef,
|
|
692
726
|
imageSize,
|
|
693
727
|
imageSrc
|
|
694
|
-
}) : /* @__PURE__ */
|
|
728
|
+
}) : /* @__PURE__ */ React16.createElement(ImagePreviewer, {
|
|
695
729
|
className,
|
|
696
730
|
visible: imageVisible,
|
|
697
731
|
imageRef,
|
|
@@ -718,7 +752,7 @@ var DropImage = (props) => {
|
|
|
718
752
|
}
|
|
719
753
|
} = props;
|
|
720
754
|
if (ghost) {
|
|
721
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ React16.createElement(GhostDropImage, {
|
|
722
756
|
...props
|
|
723
757
|
});
|
|
724
758
|
}
|
|
@@ -751,8 +785,8 @@ var DropImage = (props) => {
|
|
|
751
785
|
height: imageSize.height || dropAreaStyle.height
|
|
752
786
|
});
|
|
753
787
|
};
|
|
754
|
-
return /* @__PURE__ */
|
|
755
|
-
className:
|
|
788
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
789
|
+
className: cls3(
|
|
756
790
|
className,
|
|
757
791
|
"transition-all items-center justify-center flex duration-200 ease-in-out",
|
|
758
792
|
{
|
|
@@ -769,7 +803,7 @@ var DropImage = (props) => {
|
|
|
769
803
|
imageRef,
|
|
770
804
|
imageSize,
|
|
771
805
|
imageSrc
|
|
772
|
-
}) : /* @__PURE__ */
|
|
806
|
+
}) : /* @__PURE__ */ React16.createElement(ImagePreviewer, {
|
|
773
807
|
visible: showImagePreviewer,
|
|
774
808
|
imageRef,
|
|
775
809
|
imageSrc,
|
|
@@ -778,27 +812,27 @@ var DropImage = (props) => {
|
|
|
778
812
|
};
|
|
779
813
|
|
|
780
814
|
// lib/layout/layout.tsx
|
|
781
|
-
import
|
|
782
|
-
import
|
|
815
|
+
import cls4 from "classnames";
|
|
816
|
+
import React17 from "react";
|
|
783
817
|
var ThreeColLayout = (props) => {
|
|
784
818
|
const { leftRenderer, middleRenderer, rightRenderer } = props;
|
|
785
|
-
const colCls =
|
|
786
|
-
return /* @__PURE__ */
|
|
819
|
+
const colCls = cls4("max-h-full overflow-auto xl:!block py-128");
|
|
820
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
787
821
|
className: "grid grid-cols-1 xl:grid-cols-3 gap-4 h-full w-full"
|
|
788
|
-
}, /* @__PURE__ */
|
|
789
|
-
className:
|
|
790
|
-
}, leftRenderer && leftRenderer()), /* @__PURE__ */
|
|
791
|
-
className:
|
|
822
|
+
}, /* @__PURE__ */ React17.createElement("div", {
|
|
823
|
+
className: cls4("hidden", colCls)
|
|
824
|
+
}, leftRenderer && leftRenderer()), /* @__PURE__ */ React17.createElement("div", {
|
|
825
|
+
className: cls4(colCls, "sm:px-128 xl:px-0 no-scrollbar", "relative", {
|
|
792
826
|
hidden: !middleRenderer
|
|
793
827
|
})
|
|
794
|
-
}, middleRenderer && middleRenderer()), /* @__PURE__ */
|
|
795
|
-
className:
|
|
828
|
+
}, middleRenderer && middleRenderer()), /* @__PURE__ */ React17.createElement("div", {
|
|
829
|
+
className: cls4("hidden", colCls)
|
|
796
830
|
}, rightRenderer && rightRenderer()));
|
|
797
831
|
};
|
|
798
832
|
|
|
799
833
|
// lib/img/Img.tsx
|
|
800
834
|
import classnames from "classnames";
|
|
801
|
-
import
|
|
835
|
+
import React18, { useState as useState5 } from "react";
|
|
802
836
|
|
|
803
837
|
// lib/img/types.ts
|
|
804
838
|
var ossProcessType = /* @__PURE__ */ ((ossProcessType2) => {
|
|
@@ -877,7 +911,7 @@ var Img = (props) => {
|
|
|
877
911
|
}
|
|
878
912
|
img.onload = updateFunc;
|
|
879
913
|
};
|
|
880
|
-
return /* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ React18.createElement("span", {
|
|
881
915
|
className: classnames(
|
|
882
916
|
className,
|
|
883
917
|
"inline-block",
|
|
@@ -890,19 +924,19 @@ var Img = (props) => {
|
|
|
890
924
|
),
|
|
891
925
|
draggable: false,
|
|
892
926
|
style: Object.assign({}, baseWrapperStyle, dynamicWrapperStyle)
|
|
893
|
-
}, /* @__PURE__ */
|
|
927
|
+
}, /* @__PURE__ */ React18.createElement("img", {
|
|
894
928
|
ref: (input) => {
|
|
895
929
|
if (!input) {
|
|
896
930
|
return;
|
|
897
931
|
}
|
|
898
932
|
handleImgLoad(input);
|
|
899
933
|
},
|
|
900
|
-
crossOrigin: "anonymous",
|
|
901
934
|
width,
|
|
902
935
|
height,
|
|
903
936
|
src: addOssWebpProcessStyle(src, processType || "webp" /* WEBP */),
|
|
904
937
|
decoding: "async",
|
|
905
938
|
loading: "lazy",
|
|
939
|
+
crossOrigin: "anonymous",
|
|
906
940
|
style: {
|
|
907
941
|
contentVisibility: "auto"
|
|
908
942
|
},
|
|
@@ -914,7 +948,7 @@ var Img = (props) => {
|
|
|
914
948
|
"opacity-0": !decoded
|
|
915
949
|
}
|
|
916
950
|
)
|
|
917
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ React18.createElement("img", {
|
|
918
952
|
src: emptyDataURL,
|
|
919
953
|
className: classnames(
|
|
920
954
|
"lqip-blur",
|
|
@@ -935,11 +969,11 @@ var Img = (props) => {
|
|
|
935
969
|
|
|
936
970
|
// lib/img/Gallery.tsx
|
|
937
971
|
import classnames3 from "classnames";
|
|
938
|
-
import
|
|
972
|
+
import React20 from "react";
|
|
939
973
|
|
|
940
974
|
// lib/img/RandomRowsLayout.tsx
|
|
941
975
|
import classnames2 from "classnames";
|
|
942
|
-
import
|
|
976
|
+
import React19 from "react";
|
|
943
977
|
var last = (arr) => {
|
|
944
978
|
if (arr.length < 2) {
|
|
945
979
|
return arr[0];
|
|
@@ -974,7 +1008,7 @@ var sumColNumByIdx = (colNums, idx) => {
|
|
|
974
1008
|
}
|
|
975
1009
|
return sum;
|
|
976
1010
|
};
|
|
977
|
-
var RandomRowsLayout =
|
|
1011
|
+
var RandomRowsLayout = React19.memo(
|
|
978
1012
|
(props) => {
|
|
979
1013
|
const {
|
|
980
1014
|
cellsCount,
|
|
@@ -983,14 +1017,14 @@ var RandomRowsLayout = React18.memo(
|
|
|
983
1017
|
cellWrapperClsGenerator = defaultCellClsGenerator
|
|
984
1018
|
} = props;
|
|
985
1019
|
const colNums = generateRandomColNum(cellsCount);
|
|
986
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
987
1021
|
className: classNames8
|
|
988
1022
|
}, colNums.map((colNum, row) => {
|
|
989
1023
|
const randBool = generateRandomBoolean(
|
|
990
1024
|
colNum < 2 ? 0.6 : 0.5
|
|
991
1025
|
);
|
|
992
1026
|
const randBoolArr = [randBool, !randBool];
|
|
993
|
-
return /* @__PURE__ */
|
|
1027
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
994
1028
|
className: "flex items-center flex-wrap",
|
|
995
1029
|
key: row
|
|
996
1030
|
}, new Array(colNum).fill(null).map((_, col) => {
|
|
@@ -1004,7 +1038,7 @@ var RandomRowsLayout = React18.memo(
|
|
|
1004
1038
|
"basis-full",
|
|
1005
1039
|
generatedCls
|
|
1006
1040
|
);
|
|
1007
|
-
return /* @__PURE__ */
|
|
1041
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1008
1042
|
className: cls6,
|
|
1009
1043
|
key: col
|
|
1010
1044
|
}, cellRenderer(currentIdx, randBoolArr[col], col));
|
|
@@ -1018,7 +1052,7 @@ var RandomRowsLayout = React18.memo(
|
|
|
1018
1052
|
|
|
1019
1053
|
// lib/img/Gallery.tsx
|
|
1020
1054
|
var defaultImageRenderer = (img, index, col) => {
|
|
1021
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1022
1056
|
className: classnames3("mb-128", {
|
|
1023
1057
|
"md:mr-64": col === 0,
|
|
1024
1058
|
"md:ml-64": col !== 0
|
|
@@ -1039,7 +1073,7 @@ var Gallery = (props) => {
|
|
|
1039
1073
|
return null;
|
|
1040
1074
|
}
|
|
1041
1075
|
return imageRenderer(
|
|
1042
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ React20.createElement(Img, {
|
|
1043
1077
|
...image,
|
|
1044
1078
|
size: isLargeImage ? "large" : "normal"
|
|
1045
1079
|
}),
|
|
@@ -1048,9 +1082,9 @@ var Gallery = (props) => {
|
|
|
1048
1082
|
isLargeImage
|
|
1049
1083
|
);
|
|
1050
1084
|
};
|
|
1051
|
-
return /* @__PURE__ */
|
|
1085
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1052
1086
|
className: classnames3("w-full flex justify-center", className)
|
|
1053
|
-
}, /* @__PURE__ */
|
|
1087
|
+
}, /* @__PURE__ */ React20.createElement(RandomRowsLayout, {
|
|
1054
1088
|
classNames: "mx-32 mt-128 max-w-screen-xl",
|
|
1055
1089
|
cellsCount: images.length,
|
|
1056
1090
|
cellRenderer: renderImage,
|
|
@@ -1061,7 +1095,7 @@ var Gallery = (props) => {
|
|
|
1061
1095
|
// lib/loading-spiral/LoadingSpiral.tsx
|
|
1062
1096
|
import Phenomenon from "phenomenon";
|
|
1063
1097
|
import classNames7 from "classnames";
|
|
1064
|
-
import
|
|
1098
|
+
import React21, { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
1065
1099
|
|
|
1066
1100
|
// lib/loading-spiral/createSettings.ts
|
|
1067
1101
|
var createSettings = (settings) => {
|
|
@@ -1191,7 +1225,7 @@ var LoadingSpiral = (props) => {
|
|
|
1191
1225
|
createOptions()
|
|
1192
1226
|
);
|
|
1193
1227
|
}, []);
|
|
1194
|
-
return /* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ React21.createElement("canvas", {
|
|
1195
1229
|
style: {
|
|
1196
1230
|
maxWidth: 500,
|
|
1197
1231
|
maxHeight: 500,
|
|
@@ -1206,8 +1240,8 @@ var LoadingSpiral = (props) => {
|
|
|
1206
1240
|
};
|
|
1207
1241
|
|
|
1208
1242
|
// lib/drop-zone/DropZone.tsx
|
|
1209
|
-
import
|
|
1210
|
-
import
|
|
1243
|
+
import React22, { useCallback as useCallback3, useEffect as useEffect4, useState as useState6 } from "react";
|
|
1244
|
+
import cls5 from "classnames";
|
|
1211
1245
|
var DropZone = (props) => {
|
|
1212
1246
|
const { onDrop, children, className, style } = props;
|
|
1213
1247
|
const [coverVisible, setCoverVisible] = useState6(false);
|
|
@@ -1228,19 +1262,19 @@ var DropZone = (props) => {
|
|
|
1228
1262
|
};
|
|
1229
1263
|
}, []);
|
|
1230
1264
|
if (props.disabled) {
|
|
1231
|
-
return /* @__PURE__ */
|
|
1265
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, children);
|
|
1232
1266
|
}
|
|
1233
1267
|
const handleDragOver = (e) => {
|
|
1234
1268
|
e.preventDefault();
|
|
1235
1269
|
setCoverVisible(true);
|
|
1236
1270
|
};
|
|
1237
|
-
const coverCls =
|
|
1271
|
+
const coverCls = cls5("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
1238
1272
|
"text-blur": coverVisible,
|
|
1239
1273
|
"z-[999]": coverVisible,
|
|
1240
1274
|
block: coverVisible,
|
|
1241
1275
|
hidden: !coverVisible
|
|
1242
1276
|
});
|
|
1243
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", {
|
|
1244
1278
|
className: coverCls,
|
|
1245
1279
|
onDragLeave: () => {
|
|
1246
1280
|
setCoverVisible(false);
|
|
@@ -1251,7 +1285,7 @@ var DropZone = (props) => {
|
|
|
1251
1285
|
};
|
|
1252
1286
|
|
|
1253
1287
|
// lib/context-menu/index.tsx
|
|
1254
|
-
import * as
|
|
1288
|
+
import * as React23 from "react";
|
|
1255
1289
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
1256
1290
|
import {
|
|
1257
1291
|
CheckIcon,
|
|
@@ -1266,7 +1300,7 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
|
1266
1300
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1267
1301
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
1268
1302
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
1269
|
-
var ContextMenuSubTrigger =
|
|
1303
|
+
var ContextMenuSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubTrigger, {
|
|
1270
1304
|
ref,
|
|
1271
1305
|
className: cn(
|
|
1272
1306
|
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
@@ -1274,11 +1308,11 @@ var ContextMenuSubTrigger = React22.forwardRef(({ className, inset, children, ..
|
|
|
1274
1308
|
className
|
|
1275
1309
|
),
|
|
1276
1310
|
...props
|
|
1277
|
-
}, children, /* @__PURE__ */
|
|
1311
|
+
}, children, /* @__PURE__ */ React23.createElement(ChevronRightIcon, {
|
|
1278
1312
|
className: "ml-auto"
|
|
1279
1313
|
})));
|
|
1280
1314
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1281
|
-
var ContextMenuSubContent =
|
|
1315
|
+
var ContextMenuSubContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubContent, {
|
|
1282
1316
|
ref,
|
|
1283
1317
|
className: cn(
|
|
1284
1318
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
@@ -1287,7 +1321,7 @@ var ContextMenuSubContent = React22.forwardRef(({ className, ...props }, ref) =>
|
|
|
1287
1321
|
...props
|
|
1288
1322
|
}));
|
|
1289
1323
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
1290
|
-
var ContextMenuContent =
|
|
1324
|
+
var ContextMenuContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Content, {
|
|
1291
1325
|
ref,
|
|
1292
1326
|
className: cn(
|
|
1293
1327
|
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
@@ -1296,7 +1330,7 @@ var ContextMenuContent = React22.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1296
1330
|
...props
|
|
1297
1331
|
})));
|
|
1298
1332
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
1299
|
-
var ContextMenuItem =
|
|
1333
|
+
var ContextMenuItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Item, {
|
|
1300
1334
|
ref,
|
|
1301
1335
|
className: cn(
|
|
1302
1336
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -1306,7 +1340,7 @@ var ContextMenuItem = React22.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
1306
1340
|
...props
|
|
1307
1341
|
}));
|
|
1308
1342
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
1309
|
-
var ContextMenuCheckboxItem =
|
|
1343
|
+
var ContextMenuCheckboxItem = React23.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
1310
1344
|
ref,
|
|
1311
1345
|
className: cn(
|
|
1312
1346
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-32 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -1314,26 +1348,26 @@ var ContextMenuCheckboxItem = React22.forwardRef(({ className, children, checked
|
|
|
1314
1348
|
),
|
|
1315
1349
|
checked,
|
|
1316
1350
|
...props
|
|
1317
|
-
}, /* @__PURE__ */
|
|
1351
|
+
}, /* @__PURE__ */ React23.createElement("span", {
|
|
1318
1352
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
1319
|
-
}, /* @__PURE__ */
|
|
1353
|
+
}, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(CheckIcon, {
|
|
1320
1354
|
className: "h-4 w-4"
|
|
1321
1355
|
}))), children));
|
|
1322
1356
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
1323
|
-
var ContextMenuRadioItem =
|
|
1357
|
+
var ContextMenuRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.RadioItem, {
|
|
1324
1358
|
ref,
|
|
1325
1359
|
className: cn(
|
|
1326
1360
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-32 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
1327
1361
|
className
|
|
1328
1362
|
),
|
|
1329
1363
|
...props
|
|
1330
|
-
}, /* @__PURE__ */
|
|
1364
|
+
}, /* @__PURE__ */ React23.createElement("span", {
|
|
1331
1365
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
1332
|
-
}, /* @__PURE__ */
|
|
1366
|
+
}, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(DotFilledIcon, {
|
|
1333
1367
|
className: "h-4 w-4 fill-current"
|
|
1334
1368
|
}))), children));
|
|
1335
1369
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1336
|
-
var ContextMenuLabel =
|
|
1370
|
+
var ContextMenuLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Label, {
|
|
1337
1371
|
ref,
|
|
1338
1372
|
className: cn(
|
|
1339
1373
|
"px-2 py-1.5 text-sm font-semibold text-foreground",
|
|
@@ -1343,7 +1377,7 @@ var ContextMenuLabel = React22.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1343
1377
|
...props
|
|
1344
1378
|
}));
|
|
1345
1379
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
1346
|
-
var ContextMenuSeparator =
|
|
1380
|
+
var ContextMenuSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Separator, {
|
|
1347
1381
|
ref,
|
|
1348
1382
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1349
1383
|
...props
|
|
@@ -1353,7 +1387,7 @@ var ContextMenuShortcut = ({
|
|
|
1353
1387
|
className,
|
|
1354
1388
|
...props
|
|
1355
1389
|
}) => {
|
|
1356
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ React23.createElement("span", {
|
|
1357
1391
|
className: cn(
|
|
1358
1392
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
1359
1393
|
className
|
|
@@ -1364,7 +1398,7 @@ var ContextMenuShortcut = ({
|
|
|
1364
1398
|
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1365
1399
|
|
|
1366
1400
|
// lib/form/index.tsx
|
|
1367
|
-
import * as
|
|
1401
|
+
import * as React25 from "react";
|
|
1368
1402
|
import { z } from "zod";
|
|
1369
1403
|
import { Slot } from "@radix-ui/react-slot";
|
|
1370
1404
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
@@ -1377,7 +1411,7 @@ import {
|
|
|
1377
1411
|
import cn3 from "classnames";
|
|
1378
1412
|
|
|
1379
1413
|
// lib/label/index.tsx
|
|
1380
|
-
import * as
|
|
1414
|
+
import * as React24 from "react";
|
|
1381
1415
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
1382
1416
|
import { cva } from "class-variance-authority";
|
|
1383
1417
|
import cn2 from "classnames";
|
|
@@ -1385,7 +1419,7 @@ import cn2 from "classnames";
|
|
|
1385
1419
|
var labelVariants = cva(
|
|
1386
1420
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1387
1421
|
);
|
|
1388
|
-
var Label2 =
|
|
1422
|
+
var Label2 = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React24.createElement(LabelPrimitive.Root, {
|
|
1389
1423
|
ref,
|
|
1390
1424
|
className: cn2(labelVariants(), className),
|
|
1391
1425
|
...props
|
|
@@ -1395,21 +1429,21 @@ Label2.displayName = LabelPrimitive.Root.displayName;
|
|
|
1395
1429
|
// lib/form/index.tsx
|
|
1396
1430
|
"use client";
|
|
1397
1431
|
var Form = FormProvider;
|
|
1398
|
-
var FormFieldContext =
|
|
1432
|
+
var FormFieldContext = React25.createContext(
|
|
1399
1433
|
{}
|
|
1400
1434
|
);
|
|
1401
1435
|
var FormField = ({
|
|
1402
1436
|
...props
|
|
1403
1437
|
}) => {
|
|
1404
|
-
return /* @__PURE__ */
|
|
1438
|
+
return /* @__PURE__ */ React25.createElement(FormFieldContext.Provider, {
|
|
1405
1439
|
value: { name: props.name }
|
|
1406
|
-
}, /* @__PURE__ */
|
|
1440
|
+
}, /* @__PURE__ */ React25.createElement(Controller, {
|
|
1407
1441
|
...props
|
|
1408
1442
|
}));
|
|
1409
1443
|
};
|
|
1410
1444
|
var useFormField = () => {
|
|
1411
|
-
const fieldContext =
|
|
1412
|
-
const itemContext =
|
|
1445
|
+
const fieldContext = React25.useContext(FormFieldContext);
|
|
1446
|
+
const itemContext = React25.useContext(FormItemContext);
|
|
1413
1447
|
const { getFieldState, formState } = useFormContext();
|
|
1414
1448
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
1415
1449
|
if (!fieldContext) {
|
|
@@ -1425,23 +1459,23 @@ var useFormField = () => {
|
|
|
1425
1459
|
...fieldState
|
|
1426
1460
|
};
|
|
1427
1461
|
};
|
|
1428
|
-
var FormItemContext =
|
|
1462
|
+
var FormItemContext = React25.createContext(
|
|
1429
1463
|
{}
|
|
1430
1464
|
);
|
|
1431
|
-
var FormItem =
|
|
1432
|
-
const id =
|
|
1433
|
-
return /* @__PURE__ */
|
|
1465
|
+
var FormItem = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1466
|
+
const id = React25.useId();
|
|
1467
|
+
return /* @__PURE__ */ React25.createElement(FormItemContext.Provider, {
|
|
1434
1468
|
value: { id }
|
|
1435
|
-
}, /* @__PURE__ */
|
|
1469
|
+
}, /* @__PURE__ */ React25.createElement("div", {
|
|
1436
1470
|
ref,
|
|
1437
1471
|
className: cn3("space-y-2", className),
|
|
1438
1472
|
...props
|
|
1439
1473
|
}));
|
|
1440
1474
|
});
|
|
1441
1475
|
FormItem.displayName = "FormItem";
|
|
1442
|
-
var FormLabel =
|
|
1476
|
+
var FormLabel = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1443
1477
|
const { error, formItemId } = useFormField();
|
|
1444
|
-
return /* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ React25.createElement(Label2, {
|
|
1445
1479
|
ref,
|
|
1446
1480
|
className: cn3(error && "text-destructive", className),
|
|
1447
1481
|
htmlFor: formItemId,
|
|
@@ -1449,9 +1483,9 @@ var FormLabel = React24.forwardRef(({ className, ...props }, ref) => {
|
|
|
1449
1483
|
});
|
|
1450
1484
|
});
|
|
1451
1485
|
FormLabel.displayName = "FormLabel";
|
|
1452
|
-
var FormControl =
|
|
1486
|
+
var FormControl = React25.forwardRef(({ ...props }, ref) => {
|
|
1453
1487
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1454
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ React25.createElement(Slot, {
|
|
1455
1489
|
ref,
|
|
1456
1490
|
id: formItemId,
|
|
1457
1491
|
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
@@ -1460,9 +1494,9 @@ var FormControl = React24.forwardRef(({ ...props }, ref) => {
|
|
|
1460
1494
|
});
|
|
1461
1495
|
});
|
|
1462
1496
|
FormControl.displayName = "FormControl";
|
|
1463
|
-
var FormDescription =
|
|
1497
|
+
var FormDescription = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1464
1498
|
const { formDescriptionId } = useFormField();
|
|
1465
|
-
return /* @__PURE__ */
|
|
1499
|
+
return /* @__PURE__ */ React25.createElement("p", {
|
|
1466
1500
|
ref,
|
|
1467
1501
|
id: formDescriptionId,
|
|
1468
1502
|
className: cn3("text-sm text-muted-foreground", className),
|
|
@@ -1470,13 +1504,13 @@ var FormDescription = React24.forwardRef(({ className, ...props }, ref) => {
|
|
|
1470
1504
|
});
|
|
1471
1505
|
});
|
|
1472
1506
|
FormDescription.displayName = "FormDescription";
|
|
1473
|
-
var FormMessage =
|
|
1507
|
+
var FormMessage = React25.forwardRef(({ className, children, ...props }, ref) => {
|
|
1474
1508
|
const { error, formMessageId } = useFormField();
|
|
1475
1509
|
const body = error ? String(error == null ? void 0 : error.message) : children;
|
|
1476
1510
|
if (!body) {
|
|
1477
1511
|
return null;
|
|
1478
1512
|
}
|
|
1479
|
-
return /* @__PURE__ */
|
|
1513
|
+
return /* @__PURE__ */ React25.createElement("p", {
|
|
1480
1514
|
ref,
|
|
1481
1515
|
id: formMessageId,
|
|
1482
1516
|
className: cn3("text-sm font-medium text-destructive", className),
|
|
@@ -1486,11 +1520,11 @@ var FormMessage = React24.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1486
1520
|
FormMessage.displayName = "FormMessage";
|
|
1487
1521
|
|
|
1488
1522
|
// lib/input/index.tsx
|
|
1489
|
-
import * as
|
|
1523
|
+
import * as React26 from "react";
|
|
1490
1524
|
import cn4 from "classnames";
|
|
1491
|
-
var Input =
|
|
1525
|
+
var Input = React26.forwardRef(
|
|
1492
1526
|
({ className, type, ...props }, ref) => {
|
|
1493
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ React26.createElement("input", {
|
|
1494
1528
|
type,
|
|
1495
1529
|
className: cn4(
|
|
1496
1530
|
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
@@ -1503,33 +1537,6 @@ var Input = React25.forwardRef(
|
|
|
1503
1537
|
);
|
|
1504
1538
|
Input.displayName = "Input";
|
|
1505
1539
|
|
|
1506
|
-
// lib/blur-cover/BlurCover.tsx
|
|
1507
|
-
import React26 from "react";
|
|
1508
|
-
import cls5 from "classnames";
|
|
1509
|
-
var BlurCover = (props) => {
|
|
1510
|
-
const { status } = props;
|
|
1511
|
-
const coverCls = cls5(
|
|
1512
|
-
"fixed",
|
|
1513
|
-
"block",
|
|
1514
|
-
"text-blur",
|
|
1515
|
-
"transition-all",
|
|
1516
|
-
"top-0",
|
|
1517
|
-
"left-0",
|
|
1518
|
-
"h-full",
|
|
1519
|
-
"w-full",
|
|
1520
|
-
{
|
|
1521
|
-
"z-[999]": status === "show",
|
|
1522
|
-
"opacity-0": status === "silent",
|
|
1523
|
-
"opacity-100": status === "show",
|
|
1524
|
-
"pointer-events-none": status === "silent"
|
|
1525
|
-
},
|
|
1526
|
-
props.className
|
|
1527
|
-
);
|
|
1528
|
-
return /* @__PURE__ */ React26.createElement("div", {
|
|
1529
|
-
className: coverCls
|
|
1530
|
-
});
|
|
1531
|
-
};
|
|
1532
|
-
|
|
1533
1540
|
// lib/canvas/Canvas.tsx
|
|
1534
1541
|
import React27, { useEffect as useEffect6 } from "react";
|
|
1535
1542
|
|