@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.cjs
CHANGED
|
@@ -92,23 +92,76 @@ __export(lib_exports, {
|
|
|
92
92
|
module.exports = __toCommonJS(lib_exports);
|
|
93
93
|
|
|
94
94
|
// lib/article/Article.tsx
|
|
95
|
+
var import_classnames3 = __toESM(require("classnames"), 1);
|
|
96
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
97
|
+
|
|
98
|
+
// lib/blink-dot/BlinkDot.tsx
|
|
95
99
|
var import_classnames = __toESM(require("classnames"), 1);
|
|
96
100
|
var import_react = __toESM(require("react"), 1);
|
|
101
|
+
var BlinkDot = (props) => {
|
|
102
|
+
const { className } = props;
|
|
103
|
+
const status = props.status || "hidden";
|
|
104
|
+
const statusCls = (0, import_classnames.default)({
|
|
105
|
+
"animate-ping-fast": status === "blink",
|
|
106
|
+
hidden: status === "hidden"
|
|
107
|
+
});
|
|
108
|
+
return /* @__PURE__ */ import_react.default.createElement("span", {
|
|
109
|
+
className: (0, import_classnames.default)("inline-flex justify-center items-center relative")
|
|
110
|
+
}, /* @__PURE__ */ import_react.default.createElement("span", {
|
|
111
|
+
className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls} ${className}`
|
|
112
|
+
}, "."));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
// lib/blur-cover/BlurCover.tsx
|
|
116
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
117
|
+
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
118
|
+
var BlurCover = (props) => {
|
|
119
|
+
const { status } = props;
|
|
120
|
+
const coverCls = (0, import_classnames2.default)(
|
|
121
|
+
"absolute",
|
|
122
|
+
"block",
|
|
123
|
+
"text-blur",
|
|
124
|
+
"transition-all",
|
|
125
|
+
"top-0",
|
|
126
|
+
"left-0",
|
|
127
|
+
"h-full",
|
|
128
|
+
"w-full",
|
|
129
|
+
{
|
|
130
|
+
"z-[999]": status === "show",
|
|
131
|
+
"opacity-0": status === "silent",
|
|
132
|
+
"opacity-100": status === "show",
|
|
133
|
+
"pointer-events-none": status === "silent"
|
|
134
|
+
},
|
|
135
|
+
props.className
|
|
136
|
+
);
|
|
137
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
138
|
+
className: coverCls
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// lib/article/Article.tsx
|
|
97
143
|
var Article = (props) => {
|
|
98
144
|
const { title, content, children, className, description } = props;
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
className: (0,
|
|
101
|
-
}, /* @__PURE__ */
|
|
102
|
-
className: "
|
|
103
|
-
},
|
|
145
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
146
|
+
className: (0, import_classnames3.default)("article", className)
|
|
147
|
+
}, /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
148
|
+
className: "mb-128 leading-none"
|
|
149
|
+
}, /* @__PURE__ */ import_react3.default.createElement("span", {
|
|
150
|
+
className: "text-[2.25rem] p-16"
|
|
151
|
+
}, title), props.loading && /* @__PURE__ */ import_react3.default.createElement(BlinkDot, {
|
|
152
|
+
status: "blink",
|
|
153
|
+
className: "!-top-[42px] !-left-16"
|
|
154
|
+
})), description && /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
104
155
|
className: "mb-128"
|
|
105
|
-
}, description), /* @__PURE__ */
|
|
106
|
-
className: "text-black"
|
|
107
|
-
}, children || content
|
|
156
|
+
}, description), /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
157
|
+
className: "text-black relative p-16"
|
|
158
|
+
}, children || content, /* @__PURE__ */ import_react3.default.createElement(BlurCover, {
|
|
159
|
+
status: props.loading ? "show" : "silent"
|
|
160
|
+
})));
|
|
108
161
|
};
|
|
109
162
|
|
|
110
163
|
// lib/button/Button.tsx
|
|
111
|
-
var
|
|
164
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
112
165
|
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
113
166
|
ButtonType2["DANGER"] = "danger";
|
|
114
167
|
ButtonType2["PRIMARY"] = "primary";
|
|
@@ -125,7 +178,7 @@ function Button(props) {
|
|
|
125
178
|
};
|
|
126
179
|
const { type = "normal" /* NORMAL */, className = "", onClick, btnType } = props;
|
|
127
180
|
const shadowTransCls = type === "disabled" /* DISABLED */ ? "" : "transition-all duration-200 ease-in-out shadow-button hover:shadow-button-hover active:shadow-empty";
|
|
128
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ import_react4.default.createElement("button", {
|
|
129
182
|
className: `${typeClsMap[type]} ${className} ${shadowTransCls} py-8 px-16 transition-all duration-200 ease-in-out`,
|
|
130
183
|
onClick,
|
|
131
184
|
type: btnType
|
|
@@ -134,9 +187,9 @@ function Button(props) {
|
|
|
134
187
|
Button.displayName = "Button";
|
|
135
188
|
|
|
136
189
|
// lib/logo/Logo.tsx
|
|
137
|
-
var
|
|
138
|
-
var Logo =
|
|
139
|
-
(props) => /* @__PURE__ */
|
|
190
|
+
var React5 = __toESM(require("react"), 1);
|
|
191
|
+
var Logo = React5.memo(
|
|
192
|
+
(props) => /* @__PURE__ */ React5.createElement("svg", {
|
|
140
193
|
xmlns: "http://www.w3.org/2000/svg",
|
|
141
194
|
width: "48",
|
|
142
195
|
height: "48",
|
|
@@ -144,25 +197,25 @@ var Logo = React3.memo(
|
|
|
144
197
|
fill: "none",
|
|
145
198
|
onClick: props.onClick,
|
|
146
199
|
className: props.className
|
|
147
|
-
}, /* @__PURE__ */
|
|
200
|
+
}, /* @__PURE__ */ React5.createElement("path", {
|
|
148
201
|
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",
|
|
149
202
|
fill: "#9CA3AF"
|
|
150
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
151
204
|
d: "M23.7823 15.9373L23.7823 15.9489C23.7823 15.9451 23.7823 15.9412 23.7823 15.9373Z",
|
|
152
205
|
fill: "#9CA3AF"
|
|
153
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
154
207
|
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",
|
|
155
208
|
fill: "#9CA3AF"
|
|
156
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
157
210
|
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",
|
|
158
211
|
fill: "#9CA3AF"
|
|
159
|
-
}), /* @__PURE__ */
|
|
212
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
160
213
|
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",
|
|
161
214
|
fill: "#9CA3AF"
|
|
162
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
163
216
|
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",
|
|
164
217
|
fill: "#9CA3AF"
|
|
165
|
-
}), /* @__PURE__ */
|
|
218
|
+
}), /* @__PURE__ */ React5.createElement("path", {
|
|
166
219
|
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",
|
|
167
220
|
fill: "#9CA3AF"
|
|
168
221
|
})),
|
|
@@ -172,35 +225,16 @@ var Logo = React3.memo(
|
|
|
172
225
|
);
|
|
173
226
|
|
|
174
227
|
// lib/nav/Nav.tsx
|
|
175
|
-
var
|
|
228
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
176
229
|
|
|
177
230
|
// lib/breadcrumb/Breadcrumb.tsx
|
|
178
|
-
var
|
|
179
|
-
var
|
|
231
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
232
|
+
var import_classnames5 = __toESM(require("classnames"), 1);
|
|
180
233
|
|
|
181
234
|
// lib/link/Link.tsx
|
|
182
|
-
var
|
|
235
|
+
var import_classnames4 = __toESM(require("classnames"), 1);
|
|
183
236
|
var import_react_router_dom = require("react-router-dom");
|
|
184
|
-
var
|
|
185
|
-
|
|
186
|
-
// lib/blink-dot/BlinkDot.tsx
|
|
187
|
-
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
188
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
189
|
-
var BlinkDot = (props) => {
|
|
190
|
-
const { className } = props;
|
|
191
|
-
const status = props.status || "hidden";
|
|
192
|
-
const statusCls = (0, import_classnames2.default)({
|
|
193
|
-
"animate-ping-fast": status === "blink",
|
|
194
|
-
hidden: status === "hidden"
|
|
195
|
-
});
|
|
196
|
-
return /* @__PURE__ */ import_react3.default.createElement("span", {
|
|
197
|
-
className: (0, import_classnames2.default)("inline-flex justify-center items-center relative")
|
|
198
|
-
}, /* @__PURE__ */ import_react3.default.createElement("span", {
|
|
199
|
-
className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls}`
|
|
200
|
-
}, "."));
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
// lib/link/Link.tsx
|
|
237
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
204
238
|
var LinkColor = /* @__PURE__ */ ((LinkColor2) => {
|
|
205
239
|
LinkColor2["BLUE"] = "blue";
|
|
206
240
|
LinkColor2["RED"] = "red";
|
|
@@ -232,7 +266,7 @@ var Link = (props) => {
|
|
|
232
266
|
readonly,
|
|
233
267
|
...rest
|
|
234
268
|
} = props;
|
|
235
|
-
const linkCls = (0,
|
|
269
|
+
const linkCls = (0, import_classnames4.default)(
|
|
236
270
|
className,
|
|
237
271
|
"rounded",
|
|
238
272
|
"!no-underline",
|
|
@@ -243,7 +277,7 @@ var Link = (props) => {
|
|
|
243
277
|
FOCUS_BG_COLOR_MAPPING[color]
|
|
244
278
|
);
|
|
245
279
|
if (external) {
|
|
246
|
-
return /* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ import_react5.default.createElement("a", {
|
|
247
281
|
href: props.to,
|
|
248
282
|
className: linkCls,
|
|
249
283
|
target: "_blank",
|
|
@@ -253,19 +287,19 @@ var Link = (props) => {
|
|
|
253
287
|
}
|
|
254
288
|
if (readonly) {
|
|
255
289
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(children);
|
|
256
|
-
const offsetCls = (0,
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
className: (0,
|
|
290
|
+
const offsetCls = (0, import_classnames4.default)({ "relative top-[2px]": isNonEnName });
|
|
291
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
292
|
+
className: (0, import_classnames4.default)("text-gray-400", offsetCls),
|
|
259
293
|
style: { padding: 4 }
|
|
260
|
-
}, children), /* @__PURE__ */
|
|
294
|
+
}, children), /* @__PURE__ */ import_react5.default.createElement(BlinkDot, {
|
|
261
295
|
status
|
|
262
296
|
}));
|
|
263
297
|
}
|
|
264
|
-
return /* @__PURE__ */
|
|
298
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement(import_react_router_dom.Link, {
|
|
265
299
|
...rest,
|
|
266
300
|
className: linkCls,
|
|
267
301
|
style: { padding: 4 }
|
|
268
|
-
}, children), /* @__PURE__ */
|
|
302
|
+
}, children), /* @__PURE__ */ import_react5.default.createElement(BlinkDot, {
|
|
269
303
|
className: "-top-3 left-1",
|
|
270
304
|
status
|
|
271
305
|
}));
|
|
@@ -275,23 +309,23 @@ var Link = (props) => {
|
|
|
275
309
|
var Breadcrumb = (props) => {
|
|
276
310
|
const { paths, loading } = props;
|
|
277
311
|
const PathElements = paths.map(({ path, name }, index) => {
|
|
278
|
-
const slash = index === 0 ? null : /* @__PURE__ */
|
|
312
|
+
const slash = index === 0 ? null : /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
279
313
|
className: "text-gray-400"
|
|
280
314
|
}, "/");
|
|
281
315
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
|
|
282
|
-
const offsetCls = (0,
|
|
316
|
+
const offsetCls = (0, import_classnames5.default)({ "relative top-[2px]": isNonEnName });
|
|
283
317
|
const isLast = index === paths.length - 1;
|
|
284
318
|
const status = loading && isLast ? "blink" : "hidden";
|
|
285
|
-
return /* @__PURE__ */
|
|
319
|
+
return /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
286
320
|
key: path || name
|
|
287
|
-
}, slash, /* @__PURE__ */
|
|
321
|
+
}, slash, /* @__PURE__ */ import_react6.default.createElement(Link, {
|
|
288
322
|
to: path ?? "",
|
|
289
323
|
className: offsetCls,
|
|
290
324
|
readonly: !path,
|
|
291
325
|
status
|
|
292
326
|
}, name));
|
|
293
327
|
});
|
|
294
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
295
329
|
className: "breadcrumb"
|
|
296
330
|
}, PathElements);
|
|
297
331
|
};
|
|
@@ -300,88 +334,88 @@ var Breadcrumb = (props) => {
|
|
|
300
334
|
var import_react_router_dom2 = require("react-router-dom");
|
|
301
335
|
var Nav = (props) => {
|
|
302
336
|
if (props.mini) {
|
|
303
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
304
338
|
className: `p-8 w-full flex items-center ${props.className}`
|
|
305
|
-
}, /* @__PURE__ */
|
|
339
|
+
}, /* @__PURE__ */ import_react7.default.createElement(Breadcrumb, {
|
|
306
340
|
paths: props.paths
|
|
307
341
|
}));
|
|
308
342
|
}
|
|
309
343
|
const nav = (0, import_react_router_dom2.useNavigate)();
|
|
310
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", {
|
|
311
345
|
className: `p-8 w-full flex items-center ${props.className}`
|
|
312
|
-
}, props.customLogo || /* @__PURE__ */
|
|
346
|
+
}, props.customLogo || /* @__PURE__ */ import_react7.default.createElement(Logo, {
|
|
313
347
|
className: "mr-8",
|
|
314
348
|
onClick: () => {
|
|
315
349
|
nav("/");
|
|
316
350
|
}
|
|
317
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ import_react7.default.createElement(Breadcrumb, {
|
|
318
352
|
paths: props.paths,
|
|
319
353
|
loading: props.loading
|
|
320
354
|
}));
|
|
321
355
|
};
|
|
322
356
|
|
|
323
357
|
// lib/tag/Tag.tsx
|
|
324
|
-
var
|
|
325
|
-
var
|
|
358
|
+
var import_classnames6 = __toESM(require("classnames"), 1);
|
|
359
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
326
360
|
var Tag = (props) => {
|
|
327
|
-
return /* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ import_react8.default.createElement(Link, {
|
|
328
362
|
...props,
|
|
329
363
|
color: "gray" /* GRAY */
|
|
330
|
-
}, /* @__PURE__ */
|
|
364
|
+
}, /* @__PURE__ */ import_react8.default.createElement("small", null, props.prefix || "#", props.children));
|
|
331
365
|
};
|
|
332
366
|
var Tags = (props) => {
|
|
333
367
|
const { tags, className } = props;
|
|
334
|
-
return /* @__PURE__ */
|
|
335
|
-
className: (0,
|
|
368
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
369
|
+
className: (0, import_classnames6.default)(className, "inline-block")
|
|
336
370
|
}, tags.map((tag, index) => {
|
|
337
371
|
const isLast = index === tags.length - 1;
|
|
338
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ import_react8.default.createElement(Tag, {
|
|
339
373
|
...tag,
|
|
340
374
|
key: tag.to,
|
|
341
|
-
className: (0,
|
|
375
|
+
className: (0, import_classnames6.default)({ "mr-8": !isLast })
|
|
342
376
|
});
|
|
343
377
|
}));
|
|
344
378
|
};
|
|
345
379
|
|
|
346
380
|
// lib/panel/Panel.tsx
|
|
347
|
-
var
|
|
381
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
348
382
|
var Panel = (props) => {
|
|
349
383
|
const { className = "", children } = props;
|
|
350
|
-
const [show, setShow] = (0,
|
|
351
|
-
(0,
|
|
384
|
+
const [show, setShow] = (0, import_react9.useState)(false);
|
|
385
|
+
(0, import_react9.useEffect)(() => {
|
|
352
386
|
setShow(true);
|
|
353
387
|
}, []);
|
|
354
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
355
389
|
className: `transition-all ease-in-out duration-900 ${className} ${show ? "shadow-panel" : "shadow-empty"} p-32`
|
|
356
390
|
}, children);
|
|
357
391
|
};
|
|
358
392
|
|
|
359
393
|
// lib/page/Page.tsx
|
|
360
|
-
var
|
|
394
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
361
395
|
var Page = (props) => {
|
|
362
396
|
const { nav, main } = props;
|
|
363
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ import_react10.default.createElement("main", {
|
|
364
398
|
className: "flex flex-col h-full"
|
|
365
|
-
}, /* @__PURE__ */
|
|
399
|
+
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
366
400
|
className: `flx-grow-0 w-full fixed top-0 z-50`
|
|
367
|
-
}, nav), /* @__PURE__ */
|
|
401
|
+
}, nav), /* @__PURE__ */ import_react10.default.createElement("section", {
|
|
368
402
|
className: "flex-grow flex-shrink-0 px-6"
|
|
369
403
|
}, main));
|
|
370
404
|
};
|
|
371
405
|
var NotFound = (props) => {
|
|
372
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ import_react10.default.createElement(Error2, {
|
|
373
407
|
error: { name: "404", message: "Not Found" }
|
|
374
408
|
});
|
|
375
409
|
};
|
|
376
410
|
var Error2 = (props) => {
|
|
377
411
|
const { error } = props;
|
|
378
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
379
413
|
className: "prose"
|
|
380
|
-
}, /* @__PURE__ */
|
|
414
|
+
}, /* @__PURE__ */ import_react10.default.createElement("pre", null, /* @__PURE__ */ import_react10.default.createElement("code", {
|
|
381
415
|
className: "javascript language-javascript"
|
|
382
416
|
}, error.name, ":", error.message)));
|
|
383
417
|
};
|
|
384
|
-
var ErrorBoundary = class extends
|
|
418
|
+
var ErrorBoundary = class extends import_react10.default.Component {
|
|
385
419
|
constructor(props) {
|
|
386
420
|
super(props);
|
|
387
421
|
this.state = { hasError: false };
|
|
@@ -391,11 +425,11 @@ var ErrorBoundary = class extends import_react9.default.Component {
|
|
|
391
425
|
}
|
|
392
426
|
render() {
|
|
393
427
|
if (this.state.error && this.state.hasError) {
|
|
394
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ import_react10.default.createElement(Article, {
|
|
395
429
|
title: "\u51FA\u9519"
|
|
396
|
-
}, /* @__PURE__ */
|
|
430
|
+
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
397
431
|
className: "relative h-256"
|
|
398
|
-
}, /* @__PURE__ */
|
|
432
|
+
}, /* @__PURE__ */ import_react10.default.createElement(Error2, {
|
|
399
433
|
error: this.state.error
|
|
400
434
|
})));
|
|
401
435
|
}
|
|
@@ -404,20 +438,20 @@ var ErrorBoundary = class extends import_react9.default.Component {
|
|
|
404
438
|
};
|
|
405
439
|
|
|
406
440
|
// lib/pop-confirm/PopConfirm.tsx
|
|
407
|
-
var
|
|
441
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
408
442
|
var PopConfirm = (props) => {
|
|
409
|
-
const [loading, setLoading] = (0,
|
|
443
|
+
const [loading, setLoading] = (0, import_react11.useState)(false);
|
|
410
444
|
const { onOk, onCancel, children, content, className } = props;
|
|
411
|
-
return /* @__PURE__ */
|
|
445
|
+
return /* @__PURE__ */ import_react11.default.createElement(Panel, {
|
|
412
446
|
className
|
|
413
|
-
}, /* @__PURE__ */
|
|
447
|
+
}, /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
414
448
|
className: "mb-32"
|
|
415
|
-
}, children || content), /* @__PURE__ */
|
|
449
|
+
}, children || content), /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
416
450
|
className: "flex justify-end"
|
|
417
|
-
}, onCancel && /* @__PURE__ */
|
|
451
|
+
}, onCancel && /* @__PURE__ */ import_react11.default.createElement(Button, {
|
|
418
452
|
onClick: onCancel,
|
|
419
453
|
type: "normal" /* NORMAL */
|
|
420
|
-
}, "Cancel"), onOk && /* @__PURE__ */
|
|
454
|
+
}, "Cancel"), onOk && /* @__PURE__ */ import_react11.default.createElement(Button, {
|
|
421
455
|
onClick: async (e) => {
|
|
422
456
|
setLoading(true);
|
|
423
457
|
await onOk(e);
|
|
@@ -425,80 +459,80 @@ var PopConfirm = (props) => {
|
|
|
425
459
|
},
|
|
426
460
|
className: "ml-16 relative",
|
|
427
461
|
type: loading ? "disabled" /* DISABLED */ : "primary" /* PRIMARY */
|
|
428
|
-
}, "OK", loading && /* @__PURE__ */
|
|
462
|
+
}, "OK", loading && /* @__PURE__ */ import_react11.default.createElement(BlinkDot, {
|
|
429
463
|
className: "!absolute top-2 right-2"
|
|
430
464
|
}))));
|
|
431
465
|
};
|
|
432
466
|
|
|
433
467
|
// lib/table/Table.tsx
|
|
434
|
-
var
|
|
468
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
435
469
|
var Table = (props) => {
|
|
436
470
|
const { rowCount, rowRenderer, headerRenderer, className } = props;
|
|
437
471
|
const rows = [];
|
|
438
472
|
for (let i = 0; i < rowCount; i++) {
|
|
439
|
-
rows.push(/* @__PURE__ */
|
|
473
|
+
rows.push(/* @__PURE__ */ import_react12.default.createElement("tr", {
|
|
440
474
|
key: i
|
|
441
475
|
}, rowRenderer(i)));
|
|
442
476
|
}
|
|
443
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ import_react12.default.createElement("table", {
|
|
444
478
|
className
|
|
445
|
-
}, headerRenderer && /* @__PURE__ */
|
|
479
|
+
}, headerRenderer && /* @__PURE__ */ import_react12.default.createElement("thead", null, /* @__PURE__ */ import_react12.default.createElement("tr", null, headerRenderer())), /* @__PURE__ */ import_react12.default.createElement("tbody", null, rows));
|
|
446
480
|
};
|
|
447
|
-
Table.HCell = (props) => /* @__PURE__ */
|
|
481
|
+
Table.HCell = (props) => /* @__PURE__ */ import_react12.default.createElement("th", {
|
|
448
482
|
...props
|
|
449
483
|
}, props.children);
|
|
450
|
-
Table.Cell = (props) => /* @__PURE__ */
|
|
484
|
+
Table.Cell = (props) => /* @__PURE__ */ import_react12.default.createElement("td", {
|
|
451
485
|
...props
|
|
452
486
|
}, props.children);
|
|
453
487
|
|
|
454
488
|
// lib/skeleton/Seleton.tsx
|
|
455
|
-
var
|
|
456
|
-
var
|
|
489
|
+
var import_classnames8 = __toESM(require("classnames"), 1);
|
|
490
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
457
491
|
|
|
458
492
|
// lib/list/list.tsx
|
|
459
|
-
var
|
|
460
|
-
var
|
|
493
|
+
var import_classnames7 = __toESM(require("classnames"), 1);
|
|
494
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
461
495
|
var List = (props) => {
|
|
462
496
|
const { items, itemRenderer, className, horizontal, compact } = props;
|
|
463
497
|
const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-16";
|
|
464
|
-
return /* @__PURE__ */
|
|
465
|
-
className: (0,
|
|
498
|
+
return /* @__PURE__ */ import_react13.default.createElement("ul", {
|
|
499
|
+
className: (0, import_classnames7.default)(className, "list-style-none", {
|
|
466
500
|
flex: horizontal,
|
|
467
501
|
"items-center": horizontal
|
|
468
502
|
})
|
|
469
503
|
}, items.map((item, index) => {
|
|
470
|
-
return /* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ import_react13.default.createElement("li", {
|
|
471
505
|
key: item.id || index,
|
|
472
|
-
className: (0,
|
|
506
|
+
className: (0, import_classnames7.default)(spaceCls, "flex-shrink-0", { "!my-0": horizontal })
|
|
473
507
|
}, itemRenderer(item, index));
|
|
474
508
|
}));
|
|
475
509
|
};
|
|
476
510
|
var TitledList = (props) => {
|
|
477
511
|
const { title, description, ...rest } = props;
|
|
478
512
|
if (!title) {
|
|
479
|
-
return /* @__PURE__ */
|
|
513
|
+
return /* @__PURE__ */ import_react13.default.createElement(List, {
|
|
480
514
|
...rest
|
|
481
515
|
});
|
|
482
516
|
}
|
|
483
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ import_react13.default.createElement(Article, {
|
|
484
518
|
title,
|
|
485
519
|
description,
|
|
486
520
|
className: "w-fit"
|
|
487
|
-
}, /* @__PURE__ */
|
|
521
|
+
}, /* @__PURE__ */ import_react13.default.createElement(List, {
|
|
488
522
|
...rest
|
|
489
523
|
}));
|
|
490
524
|
};
|
|
491
525
|
var LinkList = (props) => {
|
|
492
526
|
const { title, description, links, ...rest } = props;
|
|
493
527
|
const renderLink = ({ name, to, external, ...rest2 }) => {
|
|
494
|
-
return /* @__PURE__ */
|
|
528
|
+
return /* @__PURE__ */ import_react13.default.createElement(Link, {
|
|
495
529
|
to,
|
|
496
530
|
key: name,
|
|
497
531
|
external,
|
|
498
532
|
...rest2
|
|
499
533
|
}, name);
|
|
500
534
|
};
|
|
501
|
-
return /* @__PURE__ */
|
|
535
|
+
return /* @__PURE__ */ import_react13.default.createElement(TitledList, {
|
|
502
536
|
title,
|
|
503
537
|
description,
|
|
504
538
|
items: links,
|
|
@@ -528,8 +562,8 @@ var Skeleton = (props) => {
|
|
|
528
562
|
height = 24,
|
|
529
563
|
className
|
|
530
564
|
} = props;
|
|
531
|
-
return /* @__PURE__ */
|
|
532
|
-
className: (0,
|
|
565
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
566
|
+
className: (0, import_classnames8.default)(
|
|
533
567
|
COLOR_MAPPING2[bgColor],
|
|
534
568
|
"animate-pulse",
|
|
535
569
|
"rounded",
|
|
@@ -540,13 +574,13 @@ var Skeleton = (props) => {
|
|
|
540
574
|
};
|
|
541
575
|
var ArticleSkeleton = (props) => {
|
|
542
576
|
const { children, titleLength = 0, descriptionLength } = props;
|
|
543
|
-
return /* @__PURE__ */
|
|
544
|
-
title: /* @__PURE__ */
|
|
577
|
+
return /* @__PURE__ */ import_react14.default.createElement(Article, {
|
|
578
|
+
title: /* @__PURE__ */ import_react14.default.createElement(Skeleton, {
|
|
545
579
|
width: 36 * titleLength,
|
|
546
580
|
height: 36,
|
|
547
581
|
bgColor: "black" /* BLACK */
|
|
548
582
|
}),
|
|
549
|
-
description: descriptionLength && /* @__PURE__ */
|
|
583
|
+
description: descriptionLength && /* @__PURE__ */ import_react14.default.createElement(Skeleton, {
|
|
550
584
|
width: 16 * descriptionLength
|
|
551
585
|
})
|
|
552
586
|
}, children);
|
|
@@ -554,41 +588,41 @@ var ArticleSkeleton = (props) => {
|
|
|
554
588
|
var LinkListSkeleton = (props) => {
|
|
555
589
|
const { linksLength, ...rest } = props;
|
|
556
590
|
const renderSkeleton = (length) => {
|
|
557
|
-
return /* @__PURE__ */
|
|
591
|
+
return /* @__PURE__ */ import_react14.default.createElement(Skeleton, {
|
|
558
592
|
className: "inline-block align-middle",
|
|
559
593
|
width: length * 16,
|
|
560
594
|
bgColor: "blue" /* BLUE */
|
|
561
595
|
});
|
|
562
596
|
};
|
|
563
597
|
if (!rest.titleLength) {
|
|
564
|
-
return /* @__PURE__ */
|
|
598
|
+
return /* @__PURE__ */ import_react14.default.createElement(List, {
|
|
565
599
|
items: linksLength,
|
|
566
600
|
itemRenderer: renderSkeleton
|
|
567
601
|
});
|
|
568
602
|
}
|
|
569
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ import_react14.default.createElement(ArticleSkeleton, {
|
|
570
604
|
...rest
|
|
571
|
-
}, /* @__PURE__ */
|
|
605
|
+
}, /* @__PURE__ */ import_react14.default.createElement(List, {
|
|
572
606
|
items: linksLength,
|
|
573
607
|
itemRenderer: renderSkeleton
|
|
574
608
|
}));
|
|
575
609
|
};
|
|
576
610
|
|
|
577
611
|
// lib/drop-image/DropImage.tsx
|
|
578
|
-
var
|
|
579
|
-
var
|
|
580
|
-
var
|
|
612
|
+
var import_classnames9 = __toESM(require("classnames"), 1);
|
|
613
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
614
|
+
var import_react17 = require("react");
|
|
581
615
|
|
|
582
616
|
// lib/drop-image/utils.ts
|
|
583
617
|
var wait = (d) => new Promise((r) => setTimeout(r, d));
|
|
584
618
|
|
|
585
619
|
// lib/drop-image/useDropImage.ts
|
|
586
|
-
var
|
|
620
|
+
var import_react15 = require("react");
|
|
587
621
|
var useDropImage = (params) => {
|
|
588
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
589
|
-
const [imageSrc, setImageSrc] = (0,
|
|
590
|
-
const [imageSize, setImageSize] = (0,
|
|
591
|
-
const imageFile = (0,
|
|
622
|
+
const [isDragOver, setIsDragOver] = (0, import_react15.useState)(false);
|
|
623
|
+
const [imageSrc, setImageSrc] = (0, import_react15.useState)("");
|
|
624
|
+
const [imageSize, setImageSize] = (0, import_react15.useState)({ width: 0, height: 0 });
|
|
625
|
+
const imageFile = (0, import_react15.useRef)();
|
|
592
626
|
const {
|
|
593
627
|
portraitImageWidth = 384,
|
|
594
628
|
landscapeImageWidth = 500,
|
|
@@ -620,7 +654,7 @@ var useDropImage = (params) => {
|
|
|
620
654
|
setImageSrc("");
|
|
621
655
|
}
|
|
622
656
|
};
|
|
623
|
-
const handleDragOver = (0,
|
|
657
|
+
const handleDragOver = (0, import_react15.useCallback)((ev) => {
|
|
624
658
|
ev.preventDefault();
|
|
625
659
|
setIsDragOver(true);
|
|
626
660
|
if (!ev.dataTransfer) {
|
|
@@ -628,10 +662,10 @@ var useDropImage = (params) => {
|
|
|
628
662
|
}
|
|
629
663
|
ev.dataTransfer.dropEffect = "move";
|
|
630
664
|
}, []);
|
|
631
|
-
const handleDragLeave = (0,
|
|
665
|
+
const handleDragLeave = (0, import_react15.useCallback)(() => {
|
|
632
666
|
setIsDragOver(false);
|
|
633
667
|
}, []);
|
|
634
|
-
const handleDrop = (0,
|
|
668
|
+
const handleDrop = (0, import_react15.useCallback)((ev) => {
|
|
635
669
|
ev.preventDefault();
|
|
636
670
|
setIsDragOver(false);
|
|
637
671
|
const file = ev.dataTransfer ? ev.dataTransfer.files[0] : void 0;
|
|
@@ -666,7 +700,7 @@ var useDropImage = (params) => {
|
|
|
666
700
|
}
|
|
667
701
|
img.onload = updateFunc;
|
|
668
702
|
};
|
|
669
|
-
const imageRef = (0,
|
|
703
|
+
const imageRef = (0, import_react15.useCallback)((input) => {
|
|
670
704
|
if (!input) {
|
|
671
705
|
return;
|
|
672
706
|
}
|
|
@@ -693,8 +727,8 @@ var ImagePreviewer = (props) => {
|
|
|
693
727
|
imageSrc,
|
|
694
728
|
className
|
|
695
729
|
} = props;
|
|
696
|
-
return /* @__PURE__ */
|
|
697
|
-
className: (0,
|
|
730
|
+
return /* @__PURE__ */ import_react16.default.createElement("img", {
|
|
731
|
+
className: (0, import_classnames9.default)(
|
|
698
732
|
className,
|
|
699
733
|
"max-w-[100%]",
|
|
700
734
|
"h-[auto]",
|
|
@@ -725,9 +759,9 @@ var GhostDropImage = (props) => {
|
|
|
725
759
|
children,
|
|
726
760
|
placeholder
|
|
727
761
|
} = props;
|
|
728
|
-
const [coverVisible, setCoverVisible] = (0,
|
|
729
|
-
const [imageVisible, setImageVisible] = (0,
|
|
730
|
-
const handleDocDragEnter = (0,
|
|
762
|
+
const [coverVisible, setCoverVisible] = (0, import_react17.useState)(false);
|
|
763
|
+
const [imageVisible, setImageVisible] = (0, import_react17.useState)(false);
|
|
764
|
+
const handleDocDragEnter = (0, import_react16.useCallback)(() => {
|
|
731
765
|
setCoverVisible(true);
|
|
732
766
|
}, []);
|
|
733
767
|
const {
|
|
@@ -752,19 +786,19 @@ var GhostDropImage = (props) => {
|
|
|
752
786
|
reset();
|
|
753
787
|
}
|
|
754
788
|
});
|
|
755
|
-
(0,
|
|
789
|
+
(0, import_react16.useEffect)(() => {
|
|
756
790
|
document.addEventListener("dragenter", handleDocDragEnter);
|
|
757
791
|
return () => {
|
|
758
792
|
document.removeEventListener("dragenter", handleDocDragEnter);
|
|
759
793
|
};
|
|
760
794
|
}, []);
|
|
761
|
-
const coverCls = (0,
|
|
795
|
+
const coverCls = (0, import_classnames9.default)("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
762
796
|
"lqip-blur": coverVisible,
|
|
763
797
|
"z-[999]": coverVisible,
|
|
764
798
|
block: coverVisible,
|
|
765
799
|
hidden: !coverVisible
|
|
766
800
|
});
|
|
767
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
768
802
|
className: coverCls,
|
|
769
803
|
onDragLeave: () => {
|
|
770
804
|
handleDragLeave();
|
|
@@ -777,7 +811,7 @@ var GhostDropImage = (props) => {
|
|
|
777
811
|
imageRef,
|
|
778
812
|
imageSize,
|
|
779
813
|
imageSrc
|
|
780
|
-
}) : /* @__PURE__ */
|
|
814
|
+
}) : /* @__PURE__ */ import_react16.default.createElement(ImagePreviewer, {
|
|
781
815
|
className,
|
|
782
816
|
visible: imageVisible,
|
|
783
817
|
imageRef,
|
|
@@ -804,11 +838,11 @@ var DropImage = (props) => {
|
|
|
804
838
|
}
|
|
805
839
|
} = props;
|
|
806
840
|
if (ghost) {
|
|
807
|
-
return /* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ import_react16.default.createElement(GhostDropImage, {
|
|
808
842
|
...props
|
|
809
843
|
});
|
|
810
844
|
}
|
|
811
|
-
const [showImagePreviewer, setShowImagePreviewer] = (0,
|
|
845
|
+
const [showImagePreviewer, setShowImagePreviewer] = (0, import_react17.useState)(false);
|
|
812
846
|
const {
|
|
813
847
|
handleDragLeave,
|
|
814
848
|
handleDragOver,
|
|
@@ -837,8 +871,8 @@ var DropImage = (props) => {
|
|
|
837
871
|
height: imageSize.height || dropAreaStyle.height
|
|
838
872
|
});
|
|
839
873
|
};
|
|
840
|
-
return /* @__PURE__ */
|
|
841
|
-
className: (0,
|
|
874
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", {
|
|
875
|
+
className: (0, import_classnames9.default)(
|
|
842
876
|
className,
|
|
843
877
|
"transition-all items-center justify-center flex duration-200 ease-in-out",
|
|
844
878
|
{
|
|
@@ -855,7 +889,7 @@ var DropImage = (props) => {
|
|
|
855
889
|
imageRef,
|
|
856
890
|
imageSize,
|
|
857
891
|
imageSrc
|
|
858
|
-
}) : /* @__PURE__ */
|
|
892
|
+
}) : /* @__PURE__ */ import_react16.default.createElement(ImagePreviewer, {
|
|
859
893
|
visible: showImagePreviewer,
|
|
860
894
|
imageRef,
|
|
861
895
|
imageSrc,
|
|
@@ -864,27 +898,27 @@ var DropImage = (props) => {
|
|
|
864
898
|
};
|
|
865
899
|
|
|
866
900
|
// lib/layout/layout.tsx
|
|
867
|
-
var
|
|
868
|
-
var
|
|
901
|
+
var import_classnames10 = __toESM(require("classnames"), 1);
|
|
902
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
869
903
|
var ThreeColLayout = (props) => {
|
|
870
904
|
const { leftRenderer, middleRenderer, rightRenderer } = props;
|
|
871
|
-
const colCls = (0,
|
|
872
|
-
return /* @__PURE__ */
|
|
905
|
+
const colCls = (0, import_classnames10.default)("max-h-full overflow-auto xl:!block py-128");
|
|
906
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
873
907
|
className: "grid grid-cols-1 xl:grid-cols-3 gap-4 h-full w-full"
|
|
874
|
-
}, /* @__PURE__ */
|
|
875
|
-
className: (0,
|
|
876
|
-
}, leftRenderer && leftRenderer()), /* @__PURE__ */
|
|
877
|
-
className: (0,
|
|
908
|
+
}, /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
909
|
+
className: (0, import_classnames10.default)("hidden", colCls)
|
|
910
|
+
}, leftRenderer && leftRenderer()), /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
911
|
+
className: (0, import_classnames10.default)(colCls, "sm:px-128 xl:px-0 no-scrollbar", "relative", {
|
|
878
912
|
hidden: !middleRenderer
|
|
879
913
|
})
|
|
880
|
-
}, middleRenderer && middleRenderer()), /* @__PURE__ */
|
|
881
|
-
className: (0,
|
|
914
|
+
}, middleRenderer && middleRenderer()), /* @__PURE__ */ import_react18.default.createElement("div", {
|
|
915
|
+
className: (0, import_classnames10.default)("hidden", colCls)
|
|
882
916
|
}, rightRenderer && rightRenderer()));
|
|
883
917
|
};
|
|
884
918
|
|
|
885
919
|
// lib/img/Img.tsx
|
|
886
|
-
var
|
|
887
|
-
var
|
|
920
|
+
var import_classnames11 = __toESM(require("classnames"), 1);
|
|
921
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
888
922
|
|
|
889
923
|
// lib/img/types.ts
|
|
890
924
|
var ossProcessType = /* @__PURE__ */ ((ossProcessType2) => {
|
|
@@ -936,8 +970,8 @@ var Img = (props) => {
|
|
|
936
970
|
renderedWidth,
|
|
937
971
|
size === "normal" ? 0.6 : 1
|
|
938
972
|
);
|
|
939
|
-
const [loaded, setLoaded] = (0,
|
|
940
|
-
const [decoded, setDecoded] = (0,
|
|
973
|
+
const [loaded, setLoaded] = (0, import_react19.useState)(false);
|
|
974
|
+
const [decoded, setDecoded] = (0, import_react19.useState)(false);
|
|
941
975
|
const baseWrapperStyle = {
|
|
942
976
|
width: "initial",
|
|
943
977
|
height: "initial",
|
|
@@ -963,8 +997,8 @@ var Img = (props) => {
|
|
|
963
997
|
}
|
|
964
998
|
img.onload = updateFunc;
|
|
965
999
|
};
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
className: (0,
|
|
1000
|
+
return /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1001
|
+
className: (0, import_classnames11.default)(
|
|
968
1002
|
className,
|
|
969
1003
|
"inline-block",
|
|
970
1004
|
"relative",
|
|
@@ -976,23 +1010,23 @@ var Img = (props) => {
|
|
|
976
1010
|
),
|
|
977
1011
|
draggable: false,
|
|
978
1012
|
style: Object.assign({}, baseWrapperStyle, dynamicWrapperStyle)
|
|
979
|
-
}, /* @__PURE__ */
|
|
1013
|
+
}, /* @__PURE__ */ import_react19.default.createElement("img", {
|
|
980
1014
|
ref: (input) => {
|
|
981
1015
|
if (!input) {
|
|
982
1016
|
return;
|
|
983
1017
|
}
|
|
984
1018
|
handleImgLoad(input);
|
|
985
1019
|
},
|
|
986
|
-
crossOrigin: "anonymous",
|
|
987
1020
|
width,
|
|
988
1021
|
height,
|
|
989
1022
|
src: addOssWebpProcessStyle(src, processType || "webp" /* WEBP */),
|
|
990
1023
|
decoding: "async",
|
|
991
1024
|
loading: "lazy",
|
|
1025
|
+
crossOrigin: "anonymous",
|
|
992
1026
|
style: {
|
|
993
1027
|
contentVisibility: "auto"
|
|
994
1028
|
},
|
|
995
|
-
className: (0,
|
|
1029
|
+
className: (0, import_classnames11.default)(
|
|
996
1030
|
"transition-opacity",
|
|
997
1031
|
"opacity-100",
|
|
998
1032
|
"duration-500",
|
|
@@ -1000,9 +1034,9 @@ var Img = (props) => {
|
|
|
1000
1034
|
"opacity-0": !decoded
|
|
1001
1035
|
}
|
|
1002
1036
|
)
|
|
1003
|
-
}), /* @__PURE__ */
|
|
1037
|
+
}), /* @__PURE__ */ import_react19.default.createElement("img", {
|
|
1004
1038
|
src: emptyDataURL,
|
|
1005
|
-
className: (0,
|
|
1039
|
+
className: (0, import_classnames11.default)(
|
|
1006
1040
|
"lqip-blur",
|
|
1007
1041
|
"absolute",
|
|
1008
1042
|
"h-full",
|
|
@@ -1020,12 +1054,12 @@ var Img = (props) => {
|
|
|
1020
1054
|
};
|
|
1021
1055
|
|
|
1022
1056
|
// lib/img/Gallery.tsx
|
|
1023
|
-
var
|
|
1024
|
-
var
|
|
1057
|
+
var import_classnames13 = __toESM(require("classnames"), 1);
|
|
1058
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
1025
1059
|
|
|
1026
1060
|
// lib/img/RandomRowsLayout.tsx
|
|
1027
|
-
var
|
|
1028
|
-
var
|
|
1061
|
+
var import_classnames12 = __toESM(require("classnames"), 1);
|
|
1062
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
1029
1063
|
var last = (arr) => {
|
|
1030
1064
|
if (arr.length < 2) {
|
|
1031
1065
|
return arr[0];
|
|
@@ -1060,7 +1094,7 @@ var sumColNumByIdx = (colNums, idx) => {
|
|
|
1060
1094
|
}
|
|
1061
1095
|
return sum;
|
|
1062
1096
|
};
|
|
1063
|
-
var RandomRowsLayout =
|
|
1097
|
+
var RandomRowsLayout = import_react20.default.memo(
|
|
1064
1098
|
(props) => {
|
|
1065
1099
|
const {
|
|
1066
1100
|
cellsCount,
|
|
@@ -1069,14 +1103,14 @@ var RandomRowsLayout = import_react19.default.memo(
|
|
|
1069
1103
|
cellWrapperClsGenerator = defaultCellClsGenerator
|
|
1070
1104
|
} = props;
|
|
1071
1105
|
const colNums = generateRandomColNum(cellsCount);
|
|
1072
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
1073
1107
|
className: classNames8
|
|
1074
1108
|
}, colNums.map((colNum, row) => {
|
|
1075
1109
|
const randBool = generateRandomBoolean(
|
|
1076
1110
|
colNum < 2 ? 0.6 : 0.5
|
|
1077
1111
|
);
|
|
1078
1112
|
const randBoolArr = [randBool, !randBool];
|
|
1079
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
1080
1114
|
className: "flex items-center flex-wrap",
|
|
1081
1115
|
key: row
|
|
1082
1116
|
}, new Array(colNum).fill(null).map((_, col) => {
|
|
@@ -1085,12 +1119,12 @@ var RandomRowsLayout = import_react19.default.memo(
|
|
|
1085
1119
|
generateRandomBoolean()
|
|
1086
1120
|
);
|
|
1087
1121
|
const currentIdx = sumColNumByIdx(colNums, row) + col;
|
|
1088
|
-
const cls6 = (0,
|
|
1122
|
+
const cls6 = (0, import_classnames12.default)(
|
|
1089
1123
|
"flex items-center justify-center flex-shrink-0 flex-grow-0",
|
|
1090
1124
|
"basis-full",
|
|
1091
1125
|
generatedCls
|
|
1092
1126
|
);
|
|
1093
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
1094
1128
|
className: cls6,
|
|
1095
1129
|
key: col
|
|
1096
1130
|
}, cellRenderer(currentIdx, randBoolArr[col], col));
|
|
@@ -1104,8 +1138,8 @@ var RandomRowsLayout = import_react19.default.memo(
|
|
|
1104
1138
|
|
|
1105
1139
|
// lib/img/Gallery.tsx
|
|
1106
1140
|
var defaultImageRenderer = (img, index, col) => {
|
|
1107
|
-
return /* @__PURE__ */
|
|
1108
|
-
className: (0,
|
|
1141
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1142
|
+
className: (0, import_classnames13.default)("mb-128", {
|
|
1109
1143
|
"md:mr-64": col === 0,
|
|
1110
1144
|
"md:ml-64": col !== 0
|
|
1111
1145
|
})
|
|
@@ -1125,7 +1159,7 @@ var Gallery = (props) => {
|
|
|
1125
1159
|
return null;
|
|
1126
1160
|
}
|
|
1127
1161
|
return imageRenderer(
|
|
1128
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ import_react21.default.createElement(Img, {
|
|
1129
1163
|
...image,
|
|
1130
1164
|
size: isLargeImage ? "large" : "normal"
|
|
1131
1165
|
}),
|
|
@@ -1134,9 +1168,9 @@ var Gallery = (props) => {
|
|
|
1134
1168
|
isLargeImage
|
|
1135
1169
|
);
|
|
1136
1170
|
};
|
|
1137
|
-
return /* @__PURE__ */
|
|
1138
|
-
className: (0,
|
|
1139
|
-
}, /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", {
|
|
1172
|
+
className: (0, import_classnames13.default)("w-full flex justify-center", className)
|
|
1173
|
+
}, /* @__PURE__ */ import_react21.default.createElement(RandomRowsLayout, {
|
|
1140
1174
|
classNames: "mx-32 mt-128 max-w-screen-xl",
|
|
1141
1175
|
cellsCount: images.length,
|
|
1142
1176
|
cellRenderer: renderImage,
|
|
@@ -1146,8 +1180,8 @@ var Gallery = (props) => {
|
|
|
1146
1180
|
|
|
1147
1181
|
// lib/loading-spiral/LoadingSpiral.tsx
|
|
1148
1182
|
var import_phenomenon = __toESM(require("phenomenon"), 1);
|
|
1149
|
-
var
|
|
1150
|
-
var
|
|
1183
|
+
var import_classnames14 = __toESM(require("classnames"), 1);
|
|
1184
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
1151
1185
|
|
|
1152
1186
|
// lib/loading-spiral/createSettings.ts
|
|
1153
1187
|
var createSettings = (settings) => {
|
|
@@ -1260,8 +1294,8 @@ var createOptions = () => {
|
|
|
1260
1294
|
// lib/loading-spiral/LoadingSpiral.tsx
|
|
1261
1295
|
var LoadingSpiral = (props) => {
|
|
1262
1296
|
const { className, step } = props || {};
|
|
1263
|
-
const canvasRef = (0,
|
|
1264
|
-
(0,
|
|
1297
|
+
const canvasRef = (0, import_react22.useRef)(null);
|
|
1298
|
+
(0, import_react22.useEffect)(() => {
|
|
1265
1299
|
if (!canvasRef.current) {
|
|
1266
1300
|
return;
|
|
1267
1301
|
}
|
|
@@ -1277,14 +1311,14 @@ var LoadingSpiral = (props) => {
|
|
|
1277
1311
|
createOptions()
|
|
1278
1312
|
);
|
|
1279
1313
|
}, []);
|
|
1280
|
-
return /* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ import_react22.default.createElement("canvas", {
|
|
1281
1315
|
style: {
|
|
1282
1316
|
maxWidth: 500,
|
|
1283
1317
|
maxHeight: 500,
|
|
1284
1318
|
imageRendering: "pixelated"
|
|
1285
1319
|
},
|
|
1286
1320
|
ref: canvasRef,
|
|
1287
|
-
className: (0,
|
|
1321
|
+
className: (0, import_classnames14.default)(
|
|
1288
1322
|
"h-full w-full overflow-hidden flex justify-center items-center aspect-1",
|
|
1289
1323
|
className
|
|
1290
1324
|
)
|
|
@@ -1292,41 +1326,41 @@ var LoadingSpiral = (props) => {
|
|
|
1292
1326
|
};
|
|
1293
1327
|
|
|
1294
1328
|
// lib/drop-zone/DropZone.tsx
|
|
1295
|
-
var
|
|
1296
|
-
var
|
|
1329
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
1330
|
+
var import_classnames15 = __toESM(require("classnames"), 1);
|
|
1297
1331
|
var DropZone = (props) => {
|
|
1298
1332
|
const { onDrop, children, className, style } = props;
|
|
1299
|
-
const [coverVisible, setCoverVisible] = (0,
|
|
1333
|
+
const [coverVisible, setCoverVisible] = (0, import_react23.useState)(false);
|
|
1300
1334
|
const handleDrop = (e) => {
|
|
1301
1335
|
e.preventDefault();
|
|
1302
1336
|
setCoverVisible(false);
|
|
1303
1337
|
const file = e.dataTransfer.files[0];
|
|
1304
1338
|
onDrop(file);
|
|
1305
1339
|
};
|
|
1306
|
-
const handleDocDragEnter = (0,
|
|
1340
|
+
const handleDocDragEnter = (0, import_react23.useCallback)((e) => {
|
|
1307
1341
|
e.preventDefault();
|
|
1308
1342
|
setCoverVisible(true);
|
|
1309
1343
|
}, []);
|
|
1310
|
-
(0,
|
|
1344
|
+
(0, import_react23.useEffect)(() => {
|
|
1311
1345
|
document.addEventListener("dragenter", handleDocDragEnter);
|
|
1312
1346
|
return () => {
|
|
1313
1347
|
document.removeEventListener("dragenter", handleDocDragEnter);
|
|
1314
1348
|
};
|
|
1315
1349
|
}, []);
|
|
1316
1350
|
if (props.disabled) {
|
|
1317
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, children);
|
|
1318
1352
|
}
|
|
1319
1353
|
const handleDragOver = (e) => {
|
|
1320
1354
|
e.preventDefault();
|
|
1321
1355
|
setCoverVisible(true);
|
|
1322
1356
|
};
|
|
1323
|
-
const coverCls = (0,
|
|
1357
|
+
const coverCls = (0, import_classnames15.default)("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
1324
1358
|
"text-blur": coverVisible,
|
|
1325
1359
|
"z-[999]": coverVisible,
|
|
1326
1360
|
block: coverVisible,
|
|
1327
1361
|
hidden: !coverVisible
|
|
1328
1362
|
});
|
|
1329
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1330
1364
|
className: coverCls,
|
|
1331
1365
|
onDragLeave: () => {
|
|
1332
1366
|
setCoverVisible(false);
|
|
@@ -1337,10 +1371,10 @@ var DropZone = (props) => {
|
|
|
1337
1371
|
};
|
|
1338
1372
|
|
|
1339
1373
|
// lib/context-menu/index.tsx
|
|
1340
|
-
var
|
|
1374
|
+
var React23 = __toESM(require("react"), 1);
|
|
1341
1375
|
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"), 1);
|
|
1342
1376
|
var import_react_icons = require("@radix-ui/react-icons");
|
|
1343
|
-
var
|
|
1377
|
+
var import_classnames16 = __toESM(require("classnames"), 1);
|
|
1344
1378
|
"use client";
|
|
1345
1379
|
var ContextMenu = ContextMenuPrimitive.Root;
|
|
1346
1380
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
@@ -1348,39 +1382,39 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
|
1348
1382
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1349
1383
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
1350
1384
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
1351
|
-
var ContextMenuSubTrigger =
|
|
1385
|
+
var ContextMenuSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubTrigger, {
|
|
1352
1386
|
ref,
|
|
1353
|
-
className: (0,
|
|
1387
|
+
className: (0, import_classnames16.default)(
|
|
1354
1388
|
"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",
|
|
1355
1389
|
inset && "pl-32",
|
|
1356
1390
|
className
|
|
1357
1391
|
),
|
|
1358
1392
|
...props
|
|
1359
|
-
}, children, /* @__PURE__ */
|
|
1393
|
+
}, children, /* @__PURE__ */ React23.createElement(import_react_icons.ChevronRightIcon, {
|
|
1360
1394
|
className: "ml-auto"
|
|
1361
1395
|
})));
|
|
1362
1396
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1363
|
-
var ContextMenuSubContent =
|
|
1397
|
+
var ContextMenuSubContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubContent, {
|
|
1364
1398
|
ref,
|
|
1365
|
-
className: (0,
|
|
1399
|
+
className: (0, import_classnames16.default)(
|
|
1366
1400
|
"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",
|
|
1367
1401
|
className
|
|
1368
1402
|
),
|
|
1369
1403
|
...props
|
|
1370
1404
|
}));
|
|
1371
1405
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
1372
|
-
var ContextMenuContent =
|
|
1406
|
+
var ContextMenuContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Content, {
|
|
1373
1407
|
ref,
|
|
1374
|
-
className: (0,
|
|
1408
|
+
className: (0, import_classnames16.default)(
|
|
1375
1409
|
"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",
|
|
1376
1410
|
className
|
|
1377
1411
|
),
|
|
1378
1412
|
...props
|
|
1379
1413
|
})));
|
|
1380
1414
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
1381
|
-
var ContextMenuItem =
|
|
1415
|
+
var ContextMenuItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Item, {
|
|
1382
1416
|
ref,
|
|
1383
|
-
className: (0,
|
|
1417
|
+
className: (0, import_classnames16.default)(
|
|
1384
1418
|
"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",
|
|
1385
1419
|
inset && "pl-32",
|
|
1386
1420
|
className
|
|
@@ -1388,36 +1422,36 @@ var ContextMenuItem = React22.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
1388
1422
|
...props
|
|
1389
1423
|
}));
|
|
1390
1424
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
1391
|
-
var ContextMenuCheckboxItem =
|
|
1425
|
+
var ContextMenuCheckboxItem = React23.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
1392
1426
|
ref,
|
|
1393
|
-
className: (0,
|
|
1427
|
+
className: (0, import_classnames16.default)(
|
|
1394
1428
|
"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",
|
|
1395
1429
|
className
|
|
1396
1430
|
),
|
|
1397
1431
|
checked,
|
|
1398
1432
|
...props
|
|
1399
|
-
}, /* @__PURE__ */
|
|
1433
|
+
}, /* @__PURE__ */ React23.createElement("span", {
|
|
1400
1434
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
1401
|
-
}, /* @__PURE__ */
|
|
1435
|
+
}, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(import_react_icons.CheckIcon, {
|
|
1402
1436
|
className: "h-4 w-4"
|
|
1403
1437
|
}))), children));
|
|
1404
1438
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
1405
|
-
var ContextMenuRadioItem =
|
|
1439
|
+
var ContextMenuRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.RadioItem, {
|
|
1406
1440
|
ref,
|
|
1407
|
-
className: (0,
|
|
1441
|
+
className: (0, import_classnames16.default)(
|
|
1408
1442
|
"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",
|
|
1409
1443
|
className
|
|
1410
1444
|
),
|
|
1411
1445
|
...props
|
|
1412
|
-
}, /* @__PURE__ */
|
|
1446
|
+
}, /* @__PURE__ */ React23.createElement("span", {
|
|
1413
1447
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
|
|
1414
|
-
}, /* @__PURE__ */
|
|
1448
|
+
}, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(import_react_icons.DotFilledIcon, {
|
|
1415
1449
|
className: "h-4 w-4 fill-current"
|
|
1416
1450
|
}))), children));
|
|
1417
1451
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1418
|
-
var ContextMenuLabel =
|
|
1452
|
+
var ContextMenuLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Label, {
|
|
1419
1453
|
ref,
|
|
1420
|
-
className: (0,
|
|
1454
|
+
className: (0, import_classnames16.default)(
|
|
1421
1455
|
"px-2 py-1.5 text-sm font-semibold text-foreground",
|
|
1422
1456
|
inset && "pl-32",
|
|
1423
1457
|
className
|
|
@@ -1425,9 +1459,9 @@ var ContextMenuLabel = React22.forwardRef(({ className, inset, ...props }, ref)
|
|
|
1425
1459
|
...props
|
|
1426
1460
|
}));
|
|
1427
1461
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
1428
|
-
var ContextMenuSeparator =
|
|
1462
|
+
var ContextMenuSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Separator, {
|
|
1429
1463
|
ref,
|
|
1430
|
-
className: (0,
|
|
1464
|
+
className: (0, import_classnames16.default)("-mx-1 my-1 h-px bg-border", className),
|
|
1431
1465
|
...props
|
|
1432
1466
|
}));
|
|
1433
1467
|
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
@@ -1435,8 +1469,8 @@ var ContextMenuShortcut = ({
|
|
|
1435
1469
|
className,
|
|
1436
1470
|
...props
|
|
1437
1471
|
}) => {
|
|
1438
|
-
return /* @__PURE__ */
|
|
1439
|
-
className: (0,
|
|
1472
|
+
return /* @__PURE__ */ React23.createElement("span", {
|
|
1473
|
+
className: (0, import_classnames16.default)(
|
|
1440
1474
|
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
1441
1475
|
className
|
|
1442
1476
|
),
|
|
@@ -1446,25 +1480,25 @@ var ContextMenuShortcut = ({
|
|
|
1446
1480
|
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1447
1481
|
|
|
1448
1482
|
// lib/form/index.tsx
|
|
1449
|
-
var
|
|
1483
|
+
var React25 = __toESM(require("react"), 1);
|
|
1450
1484
|
var import_zod = require("zod");
|
|
1451
1485
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
1452
1486
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
1453
1487
|
var import_react_hook_form = require("react-hook-form");
|
|
1454
|
-
var
|
|
1488
|
+
var import_classnames18 = __toESM(require("classnames"), 1);
|
|
1455
1489
|
|
|
1456
1490
|
// lib/label/index.tsx
|
|
1457
|
-
var
|
|
1491
|
+
var React24 = __toESM(require("react"), 1);
|
|
1458
1492
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
|
|
1459
1493
|
var import_class_variance_authority = require("class-variance-authority");
|
|
1460
|
-
var
|
|
1494
|
+
var import_classnames17 = __toESM(require("classnames"), 1);
|
|
1461
1495
|
"use client";
|
|
1462
1496
|
var labelVariants = (0, import_class_variance_authority.cva)(
|
|
1463
1497
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1464
1498
|
);
|
|
1465
|
-
var Label2 =
|
|
1499
|
+
var Label2 = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React24.createElement(LabelPrimitive.Root, {
|
|
1466
1500
|
ref,
|
|
1467
|
-
className: (0,
|
|
1501
|
+
className: (0, import_classnames17.default)(labelVariants(), className),
|
|
1468
1502
|
...props
|
|
1469
1503
|
}));
|
|
1470
1504
|
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
@@ -1472,21 +1506,21 @@ Label2.displayName = LabelPrimitive.Root.displayName;
|
|
|
1472
1506
|
// lib/form/index.tsx
|
|
1473
1507
|
"use client";
|
|
1474
1508
|
var Form = import_react_hook_form.FormProvider;
|
|
1475
|
-
var FormFieldContext =
|
|
1509
|
+
var FormFieldContext = React25.createContext(
|
|
1476
1510
|
{}
|
|
1477
1511
|
);
|
|
1478
1512
|
var FormField = ({
|
|
1479
1513
|
...props
|
|
1480
1514
|
}) => {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ React25.createElement(FormFieldContext.Provider, {
|
|
1482
1516
|
value: { name: props.name }
|
|
1483
|
-
}, /* @__PURE__ */
|
|
1517
|
+
}, /* @__PURE__ */ React25.createElement(import_react_hook_form.Controller, {
|
|
1484
1518
|
...props
|
|
1485
1519
|
}));
|
|
1486
1520
|
};
|
|
1487
1521
|
var useFormField = () => {
|
|
1488
|
-
const fieldContext =
|
|
1489
|
-
const itemContext =
|
|
1522
|
+
const fieldContext = React25.useContext(FormFieldContext);
|
|
1523
|
+
const itemContext = React25.useContext(FormItemContext);
|
|
1490
1524
|
const { getFieldState, formState } = (0, import_react_hook_form.useFormContext)();
|
|
1491
1525
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
1492
1526
|
if (!fieldContext) {
|
|
@@ -1502,33 +1536,33 @@ var useFormField = () => {
|
|
|
1502
1536
|
...fieldState
|
|
1503
1537
|
};
|
|
1504
1538
|
};
|
|
1505
|
-
var FormItemContext =
|
|
1539
|
+
var FormItemContext = React25.createContext(
|
|
1506
1540
|
{}
|
|
1507
1541
|
);
|
|
1508
|
-
var FormItem =
|
|
1509
|
-
const id =
|
|
1510
|
-
return /* @__PURE__ */
|
|
1542
|
+
var FormItem = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1543
|
+
const id = React25.useId();
|
|
1544
|
+
return /* @__PURE__ */ React25.createElement(FormItemContext.Provider, {
|
|
1511
1545
|
value: { id }
|
|
1512
|
-
}, /* @__PURE__ */
|
|
1546
|
+
}, /* @__PURE__ */ React25.createElement("div", {
|
|
1513
1547
|
ref,
|
|
1514
|
-
className: (0,
|
|
1548
|
+
className: (0, import_classnames18.default)("space-y-2", className),
|
|
1515
1549
|
...props
|
|
1516
1550
|
}));
|
|
1517
1551
|
});
|
|
1518
1552
|
FormItem.displayName = "FormItem";
|
|
1519
|
-
var FormLabel =
|
|
1553
|
+
var FormLabel = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1520
1554
|
const { error, formItemId } = useFormField();
|
|
1521
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ React25.createElement(Label2, {
|
|
1522
1556
|
ref,
|
|
1523
|
-
className: (0,
|
|
1557
|
+
className: (0, import_classnames18.default)(error && "text-destructive", className),
|
|
1524
1558
|
htmlFor: formItemId,
|
|
1525
1559
|
...props
|
|
1526
1560
|
});
|
|
1527
1561
|
});
|
|
1528
1562
|
FormLabel.displayName = "FormLabel";
|
|
1529
|
-
var FormControl =
|
|
1563
|
+
var FormControl = React25.forwardRef(({ ...props }, ref) => {
|
|
1530
1564
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1531
|
-
return /* @__PURE__ */
|
|
1565
|
+
return /* @__PURE__ */ React25.createElement(import_react_slot.Slot, {
|
|
1532
1566
|
ref,
|
|
1533
1567
|
id: formItemId,
|
|
1534
1568
|
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
@@ -1537,39 +1571,39 @@ var FormControl = React24.forwardRef(({ ...props }, ref) => {
|
|
|
1537
1571
|
});
|
|
1538
1572
|
});
|
|
1539
1573
|
FormControl.displayName = "FormControl";
|
|
1540
|
-
var FormDescription =
|
|
1574
|
+
var FormDescription = React25.forwardRef(({ className, ...props }, ref) => {
|
|
1541
1575
|
const { formDescriptionId } = useFormField();
|
|
1542
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ React25.createElement("p", {
|
|
1543
1577
|
ref,
|
|
1544
1578
|
id: formDescriptionId,
|
|
1545
|
-
className: (0,
|
|
1579
|
+
className: (0, import_classnames18.default)("text-sm text-muted-foreground", className),
|
|
1546
1580
|
...props
|
|
1547
1581
|
});
|
|
1548
1582
|
});
|
|
1549
1583
|
FormDescription.displayName = "FormDescription";
|
|
1550
|
-
var FormMessage =
|
|
1584
|
+
var FormMessage = React25.forwardRef(({ className, children, ...props }, ref) => {
|
|
1551
1585
|
const { error, formMessageId } = useFormField();
|
|
1552
1586
|
const body = error ? String(error == null ? void 0 : error.message) : children;
|
|
1553
1587
|
if (!body) {
|
|
1554
1588
|
return null;
|
|
1555
1589
|
}
|
|
1556
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ React25.createElement("p", {
|
|
1557
1591
|
ref,
|
|
1558
1592
|
id: formMessageId,
|
|
1559
|
-
className: (0,
|
|
1593
|
+
className: (0, import_classnames18.default)("text-sm font-medium text-destructive", className),
|
|
1560
1594
|
...props
|
|
1561
1595
|
}, body);
|
|
1562
1596
|
});
|
|
1563
1597
|
FormMessage.displayName = "FormMessage";
|
|
1564
1598
|
|
|
1565
1599
|
// lib/input/index.tsx
|
|
1566
|
-
var
|
|
1567
|
-
var
|
|
1568
|
-
var Input =
|
|
1600
|
+
var React26 = __toESM(require("react"), 1);
|
|
1601
|
+
var import_classnames19 = __toESM(require("classnames"), 1);
|
|
1602
|
+
var Input = React26.forwardRef(
|
|
1569
1603
|
({ className, type, ...props }, ref) => {
|
|
1570
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ React26.createElement("input", {
|
|
1571
1605
|
type,
|
|
1572
|
-
className: (0,
|
|
1606
|
+
className: (0, import_classnames19.default)(
|
|
1573
1607
|
"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",
|
|
1574
1608
|
className
|
|
1575
1609
|
),
|
|
@@ -1580,33 +1614,6 @@ var Input = React25.forwardRef(
|
|
|
1580
1614
|
);
|
|
1581
1615
|
Input.displayName = "Input";
|
|
1582
1616
|
|
|
1583
|
-
// lib/blur-cover/BlurCover.tsx
|
|
1584
|
-
var import_react23 = __toESM(require("react"), 1);
|
|
1585
|
-
var import_classnames19 = __toESM(require("classnames"), 1);
|
|
1586
|
-
var BlurCover = (props) => {
|
|
1587
|
-
const { status } = props;
|
|
1588
|
-
const coverCls = (0, import_classnames19.default)(
|
|
1589
|
-
"fixed",
|
|
1590
|
-
"block",
|
|
1591
|
-
"text-blur",
|
|
1592
|
-
"transition-all",
|
|
1593
|
-
"top-0",
|
|
1594
|
-
"left-0",
|
|
1595
|
-
"h-full",
|
|
1596
|
-
"w-full",
|
|
1597
|
-
{
|
|
1598
|
-
"z-[999]": status === "show",
|
|
1599
|
-
"opacity-0": status === "silent",
|
|
1600
|
-
"opacity-100": status === "show",
|
|
1601
|
-
"pointer-events-none": status === "silent"
|
|
1602
|
-
},
|
|
1603
|
-
props.className
|
|
1604
|
-
);
|
|
1605
|
-
return /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1606
|
-
className: coverCls
|
|
1607
|
-
});
|
|
1608
|
-
};
|
|
1609
|
-
|
|
1610
1617
|
// lib/canvas/Canvas.tsx
|
|
1611
1618
|
var import_react25 = __toESM(require("react"), 1);
|
|
1612
1619
|
|