@bbki.ng/components 1.5.11 → 1.5.12
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.d.ts +1 -1
- package/dist/index.js +82 -73
- package/dist/index.mjs +68 -59
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare type PageProps = {
|
|
|
86
86
|
declare const Page: (props: PageProps) => JSX.Element;
|
|
87
87
|
|
|
88
88
|
declare type PopConfirmProps = {
|
|
89
|
-
onOk?: EventHandler<React.MouseEvent<HTMLButtonElement
|
|
89
|
+
onOk?: EventHandler<React.MouseEvent<HTMLButtonElement>> | (() => Promise<void>);
|
|
90
90
|
onCancel?: EventHandler<React.MouseEvent<HTMLButtonElement>>;
|
|
91
91
|
className?: string;
|
|
92
92
|
content?: any;
|
package/dist/index.js
CHANGED
|
@@ -301,83 +301,104 @@ var Page = (props) => {
|
|
|
301
301
|
};
|
|
302
302
|
|
|
303
303
|
// src/pop-confirm/PopConfirm.tsx
|
|
304
|
+
var import_react10 = __toESM(require("react"));
|
|
305
|
+
|
|
306
|
+
// src/blink-dot/BlinkDot.tsx
|
|
307
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
304
308
|
var import_react9 = __toESM(require("react"));
|
|
309
|
+
var BlinkDot = (props) => {
|
|
310
|
+
const { className } = props;
|
|
311
|
+
return /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
312
|
+
className: (0, import_classnames5.default)("inline-flex h-1 w-1 justify-center items-center relative", className)
|
|
313
|
+
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
314
|
+
className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
|
|
315
|
+
}));
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// src/pop-confirm/PopConfirm.tsx
|
|
305
319
|
var PopConfirm = (props) => {
|
|
320
|
+
const [loading, setLoading] = (0, import_react10.useState)(false);
|
|
306
321
|
const { onOk, onCancel, children, content, className } = props;
|
|
307
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ import_react10.default.createElement(Panel, {
|
|
308
323
|
className
|
|
309
|
-
}, /* @__PURE__ */
|
|
324
|
+
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
310
325
|
className: "mb-32"
|
|
311
|
-
}, children || content), /* @__PURE__ */
|
|
326
|
+
}, children || content), /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
312
327
|
className: "flex justify-end"
|
|
313
|
-
}, onCancel && /* @__PURE__ */
|
|
328
|
+
}, onCancel && /* @__PURE__ */ import_react10.default.createElement(Button, {
|
|
314
329
|
onClick: onCancel,
|
|
315
330
|
type: "normal" /* NORMAL */
|
|
316
|
-
}, "Cancel"), onOk && /* @__PURE__ */
|
|
317
|
-
onClick:
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
331
|
+
}, "Cancel"), onOk && /* @__PURE__ */ import_react10.default.createElement(Button, {
|
|
332
|
+
onClick: async (e) => {
|
|
333
|
+
setLoading(true);
|
|
334
|
+
await onOk(e);
|
|
335
|
+
setLoading(false);
|
|
336
|
+
},
|
|
337
|
+
className: "ml-16 relative",
|
|
338
|
+
type: loading ? "disabled" /* DISABLED */ : "primary" /* PRIMARY */
|
|
339
|
+
}, "OK", loading && /* @__PURE__ */ import_react10.default.createElement(BlinkDot, {
|
|
340
|
+
className: "!absolute top-2 right-2"
|
|
341
|
+
}))));
|
|
321
342
|
};
|
|
322
343
|
|
|
323
344
|
// src/table/Table.tsx
|
|
324
|
-
var
|
|
345
|
+
var import_react11 = __toESM(require("react"));
|
|
325
346
|
var Table = (props) => {
|
|
326
347
|
const { rowCount, rowRenderer, headerRenderer, className } = props;
|
|
327
348
|
const rows = [];
|
|
328
349
|
for (let i = 0; i < rowCount; i++) {
|
|
329
|
-
rows.push(/* @__PURE__ */
|
|
350
|
+
rows.push(/* @__PURE__ */ import_react11.default.createElement("tr", {
|
|
330
351
|
key: i
|
|
331
352
|
}, rowRenderer(i)));
|
|
332
353
|
}
|
|
333
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ import_react11.default.createElement("table", {
|
|
334
355
|
className
|
|
335
|
-
}, headerRenderer && /* @__PURE__ */
|
|
356
|
+
}, headerRenderer && /* @__PURE__ */ import_react11.default.createElement("thead", null, /* @__PURE__ */ import_react11.default.createElement("tr", null, headerRenderer())), /* @__PURE__ */ import_react11.default.createElement("tbody", null, rows));
|
|
336
357
|
};
|
|
337
|
-
Table.HCell = (props) => /* @__PURE__ */
|
|
338
|
-
Table.Cell = (props) => /* @__PURE__ */
|
|
358
|
+
Table.HCell = (props) => /* @__PURE__ */ import_react11.default.createElement("th", __spreadValues({}, props), props.children);
|
|
359
|
+
Table.Cell = (props) => /* @__PURE__ */ import_react11.default.createElement("td", __spreadValues({}, props), props.children);
|
|
339
360
|
|
|
340
361
|
// src/skeleton/Seleton.tsx
|
|
341
|
-
var
|
|
342
|
-
var
|
|
362
|
+
var import_classnames7 = __toESM(require("classnames"));
|
|
363
|
+
var import_react13 = __toESM(require("react"));
|
|
343
364
|
|
|
344
365
|
// src/list/list.tsx
|
|
345
|
-
var
|
|
346
|
-
var
|
|
366
|
+
var import_classnames6 = __toESM(require("classnames"));
|
|
367
|
+
var import_react12 = __toESM(require("react"));
|
|
347
368
|
var List = (props) => {
|
|
348
369
|
const { items, itemRenderer, className, horizontal, compact } = props;
|
|
349
370
|
const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-4";
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
className: (0,
|
|
371
|
+
return /* @__PURE__ */ import_react12.default.createElement("ul", {
|
|
372
|
+
className: (0, import_classnames6.default)(className, "list-style-none", {
|
|
352
373
|
flex: horizontal,
|
|
353
374
|
"align-center": horizontal
|
|
354
375
|
})
|
|
355
376
|
}, items.map((item, index) => {
|
|
356
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ import_react12.default.createElement("li", {
|
|
357
378
|
key: item.id || index,
|
|
358
|
-
className: (0,
|
|
379
|
+
className: (0, import_classnames6.default)(spaceCls, "flex-shrink-0")
|
|
359
380
|
}, itemRenderer(item, index));
|
|
360
381
|
}));
|
|
361
382
|
};
|
|
362
383
|
var TitledList = (props) => {
|
|
363
384
|
const _a = props, { title, description } = _a, rest = __objRest(_a, ["title", "description"]);
|
|
364
385
|
if (!title) {
|
|
365
|
-
return /* @__PURE__ */
|
|
386
|
+
return /* @__PURE__ */ import_react12.default.createElement(List, __spreadValues({}, rest));
|
|
366
387
|
}
|
|
367
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ import_react12.default.createElement(Article, {
|
|
368
389
|
title,
|
|
369
390
|
description
|
|
370
|
-
}, /* @__PURE__ */
|
|
391
|
+
}, /* @__PURE__ */ import_react12.default.createElement(List, __spreadValues({}, rest)));
|
|
371
392
|
};
|
|
372
393
|
var LinkList = (props) => {
|
|
373
394
|
const _a = props, { title, description, links } = _a, rest = __objRest(_a, ["title", "description", "links"]);
|
|
374
395
|
const renderLink = ({ name, to }) => {
|
|
375
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ import_react12.default.createElement(Link, {
|
|
376
397
|
to,
|
|
377
398
|
key: name
|
|
378
399
|
}, name);
|
|
379
400
|
};
|
|
380
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ import_react12.default.createElement(TitledList, __spreadValues({
|
|
381
402
|
title,
|
|
382
403
|
description,
|
|
383
404
|
items: links,
|
|
@@ -401,20 +422,20 @@ var COLOR_MAPPING2 = {
|
|
|
401
422
|
};
|
|
402
423
|
var Skeleton = (props) => {
|
|
403
424
|
const { bgColor = "gray" /* GRAY */, width = 26, height = 24 } = props;
|
|
404
|
-
return /* @__PURE__ */
|
|
405
|
-
className: (0,
|
|
425
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
426
|
+
className: (0, import_classnames7.default)(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded"),
|
|
406
427
|
style: { width, height }
|
|
407
428
|
});
|
|
408
429
|
};
|
|
409
430
|
var ArticleSkeleton = (props) => {
|
|
410
431
|
const { children, titleLength, descriptionLength } = props;
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
title: /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ import_react13.default.createElement(Article, {
|
|
433
|
+
title: /* @__PURE__ */ import_react13.default.createElement(Skeleton, {
|
|
413
434
|
width: 36 * titleLength,
|
|
414
435
|
height: 36,
|
|
415
436
|
bgColor: "black" /* BLACK */
|
|
416
437
|
}),
|
|
417
|
-
description: descriptionLength && /* @__PURE__ */
|
|
438
|
+
description: descriptionLength && /* @__PURE__ */ import_react13.default.createElement(Skeleton, {
|
|
418
439
|
width: 16 * descriptionLength
|
|
419
440
|
})
|
|
420
441
|
}, children);
|
|
@@ -422,21 +443,21 @@ var ArticleSkeleton = (props) => {
|
|
|
422
443
|
var LinkListSkeleton = (props) => {
|
|
423
444
|
const _a = props, { linksLength } = _a, rest = __objRest(_a, ["linksLength"]);
|
|
424
445
|
const renderSkeleton = (length) => {
|
|
425
|
-
return /* @__PURE__ */
|
|
446
|
+
return /* @__PURE__ */ import_react13.default.createElement(Skeleton, {
|
|
426
447
|
width: length * 16,
|
|
427
448
|
bgColor: "blue" /* BLUE */
|
|
428
449
|
});
|
|
429
450
|
};
|
|
430
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ import_react13.default.createElement(ArticleSkeleton, __spreadValues({}, rest), /* @__PURE__ */ import_react13.default.createElement(List, {
|
|
431
452
|
items: linksLength,
|
|
432
453
|
itemRenderer: renderSkeleton
|
|
433
454
|
}));
|
|
434
455
|
};
|
|
435
456
|
|
|
436
457
|
// src/drop-image/DropImage.tsx
|
|
437
|
-
var
|
|
438
|
-
var
|
|
439
|
-
var
|
|
458
|
+
var import_classnames8 = __toESM(require("classnames"));
|
|
459
|
+
var import_react15 = __toESM(require("react"));
|
|
460
|
+
var import_react16 = require("react");
|
|
440
461
|
|
|
441
462
|
// src/drop-image/utils.ts
|
|
442
463
|
var wait = (d) => new Promise((r) => setTimeout(r, d));
|
|
@@ -444,12 +465,12 @@ var noop = () => {
|
|
|
444
465
|
};
|
|
445
466
|
|
|
446
467
|
// src/drop-image/useDropImage.ts
|
|
447
|
-
var
|
|
468
|
+
var import_react14 = require("react");
|
|
448
469
|
var useDropImage = (params) => {
|
|
449
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
450
|
-
const [imageSrc, setImageSrc] = (0,
|
|
451
|
-
const [imageSize, setImageSize] = (0,
|
|
452
|
-
const imageFile = (0,
|
|
470
|
+
const [isDragOver, setIsDragOver] = (0, import_react14.useState)(false);
|
|
471
|
+
const [imageSrc, setImageSrc] = (0, import_react14.useState)("");
|
|
472
|
+
const [imageSize, setImageSize] = (0, import_react14.useState)({ width: 0, height: 0 });
|
|
473
|
+
const imageFile = (0, import_react14.useRef)(null);
|
|
453
474
|
const {
|
|
454
475
|
portraitImageWidth = 384,
|
|
455
476
|
landscapeImageWidth = 500,
|
|
@@ -481,15 +502,15 @@ var useDropImage = (params) => {
|
|
|
481
502
|
setImageSrc("");
|
|
482
503
|
}
|
|
483
504
|
};
|
|
484
|
-
const handleDragOver = (0,
|
|
505
|
+
const handleDragOver = (0, import_react14.useCallback)((ev) => {
|
|
485
506
|
ev.preventDefault();
|
|
486
507
|
setIsDragOver(true);
|
|
487
508
|
ev.dataTransfer.dropEffect = "move";
|
|
488
509
|
}, []);
|
|
489
|
-
const handleDragLeave = (0,
|
|
510
|
+
const handleDragLeave = (0, import_react14.useCallback)(() => {
|
|
490
511
|
setIsDragOver(false);
|
|
491
512
|
}, []);
|
|
492
|
-
const handleDrop = (0,
|
|
513
|
+
const handleDrop = (0, import_react14.useCallback)((ev) => {
|
|
493
514
|
ev.preventDefault();
|
|
494
515
|
setIsDragOver(false);
|
|
495
516
|
const file = ev.dataTransfer.files[0];
|
|
@@ -522,7 +543,7 @@ var useDropImage = (params) => {
|
|
|
522
543
|
}
|
|
523
544
|
img.onload = updateFunc;
|
|
524
545
|
};
|
|
525
|
-
const imageRef = (0,
|
|
546
|
+
const imageRef = (0, import_react14.useCallback)((input) => {
|
|
526
547
|
if (!input) {
|
|
527
548
|
return;
|
|
528
549
|
}
|
|
@@ -549,8 +570,8 @@ var ImagePreviewer = (props) => {
|
|
|
549
570
|
imageSrc,
|
|
550
571
|
className
|
|
551
572
|
} = props;
|
|
552
|
-
return /* @__PURE__ */
|
|
553
|
-
className: (0,
|
|
573
|
+
return /* @__PURE__ */ import_react15.default.createElement("img", {
|
|
574
|
+
className: (0, import_classnames8.default)(className, "max-w-[100%]", "h-[auto]", "duration-300", "transition-opacity", "opacity-100", {
|
|
554
575
|
"opacity-0": !showImagePreviewer,
|
|
555
576
|
"!m-0": !showImagePreviewer,
|
|
556
577
|
"!p-0": !showImagePreviewer
|
|
@@ -571,9 +592,9 @@ var GhostDropImage = (props) => {
|
|
|
571
592
|
children,
|
|
572
593
|
placeholder
|
|
573
594
|
} = props;
|
|
574
|
-
const [coverVisible, setCoverVisible] = (0,
|
|
575
|
-
const [imageVisible, setImageVisible] = (0,
|
|
576
|
-
const handleDocDragEnter = (0,
|
|
595
|
+
const [coverVisible, setCoverVisible] = (0, import_react16.useState)(false);
|
|
596
|
+
const [imageVisible, setImageVisible] = (0, import_react16.useState)(false);
|
|
597
|
+
const handleDocDragEnter = (0, import_react15.useCallback)(() => {
|
|
577
598
|
setCoverVisible(true);
|
|
578
599
|
}, []);
|
|
579
600
|
const {
|
|
@@ -598,19 +619,19 @@ var GhostDropImage = (props) => {
|
|
|
598
619
|
reset();
|
|
599
620
|
}
|
|
600
621
|
});
|
|
601
|
-
(0,
|
|
622
|
+
(0, import_react15.useEffect)(() => {
|
|
602
623
|
document.addEventListener("dragenter", handleDocDragEnter);
|
|
603
624
|
return () => {
|
|
604
625
|
document.removeEventListener("dragenter", handleDocDragEnter);
|
|
605
626
|
};
|
|
606
627
|
}, []);
|
|
607
|
-
const coverCls = (0,
|
|
628
|
+
const coverCls = (0, import_classnames8.default)("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
608
629
|
"lqip-blur": coverVisible,
|
|
609
630
|
"z-[999]": coverVisible,
|
|
610
631
|
block: coverVisible,
|
|
611
632
|
hidden: !coverVisible
|
|
612
633
|
});
|
|
613
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("div", {
|
|
614
635
|
className: coverCls,
|
|
615
636
|
onDragLeave: () => {
|
|
616
637
|
handleDragLeave();
|
|
@@ -623,7 +644,7 @@ var GhostDropImage = (props) => {
|
|
|
623
644
|
imageRef,
|
|
624
645
|
imageSize,
|
|
625
646
|
imageSrc
|
|
626
|
-
}) : /* @__PURE__ */
|
|
647
|
+
}) : /* @__PURE__ */ import_react15.default.createElement(ImagePreviewer, {
|
|
627
648
|
className,
|
|
628
649
|
visible: imageVisible,
|
|
629
650
|
imageRef,
|
|
@@ -649,9 +670,9 @@ var DropImage = (props) => {
|
|
|
649
670
|
}
|
|
650
671
|
} = props;
|
|
651
672
|
if (ghost) {
|
|
652
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ import_react15.default.createElement(GhostDropImage, __spreadValues({}, props));
|
|
653
674
|
}
|
|
654
|
-
const [showImagePreviewer, setShowImagePreviewer] = (0,
|
|
675
|
+
const [showImagePreviewer, setShowImagePreviewer] = (0, import_react16.useState)(false);
|
|
655
676
|
const {
|
|
656
677
|
handleDragLeave,
|
|
657
678
|
handleDragOver,
|
|
@@ -680,8 +701,8 @@ var DropImage = (props) => {
|
|
|
680
701
|
height: imageSize.height || dropAreaStyle.height
|
|
681
702
|
});
|
|
682
703
|
};
|
|
683
|
-
return /* @__PURE__ */
|
|
684
|
-
className: (0,
|
|
704
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", {
|
|
705
|
+
className: (0, import_classnames8.default)(className, "transition-all items-center justify-center flex duration-200 ease-in-out", {
|
|
685
706
|
"shadow-input": !imageSrc,
|
|
686
707
|
"shadow-empty": imageSrc
|
|
687
708
|
}),
|
|
@@ -694,7 +715,7 @@ var DropImage = (props) => {
|
|
|
694
715
|
imageRef,
|
|
695
716
|
imageSize,
|
|
696
717
|
imageSrc
|
|
697
|
-
}) : /* @__PURE__ */
|
|
718
|
+
}) : /* @__PURE__ */ import_react15.default.createElement(ImagePreviewer, {
|
|
698
719
|
visible: showImagePreviewer,
|
|
699
720
|
imageRef,
|
|
700
721
|
imageSrc,
|
|
@@ -702,18 +723,6 @@ var DropImage = (props) => {
|
|
|
702
723
|
}), !imageSrc && placeholder);
|
|
703
724
|
};
|
|
704
725
|
|
|
705
|
-
// src/blink-dot/BlinkDot.tsx
|
|
706
|
-
var import_classnames8 = __toESM(require("classnames"));
|
|
707
|
-
var import_react16 = __toESM(require("react"));
|
|
708
|
-
var BlinkDot = (props) => {
|
|
709
|
-
const { className } = props;
|
|
710
|
-
return /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
711
|
-
className: (0, import_classnames8.default)("inline-flex h-1 w-1 justify-center items-center relative", className)
|
|
712
|
-
}, /* @__PURE__ */ import_react16.default.createElement("span", {
|
|
713
|
-
className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
|
|
714
|
-
}));
|
|
715
|
-
};
|
|
716
|
-
|
|
717
726
|
// src/layout/layout.tsx
|
|
718
727
|
var import_classnames9 = __toESM(require("classnames"));
|
|
719
728
|
var import_react17 = __toESM(require("react"));
|
package/dist/index.mjs
CHANGED
|
@@ -247,59 +247,80 @@ var Page = (props) => {
|
|
|
247
247
|
};
|
|
248
248
|
|
|
249
249
|
// src/pop-confirm/PopConfirm.tsx
|
|
250
|
+
import React11, { useState as useState2 } from "react";
|
|
251
|
+
|
|
252
|
+
// src/blink-dot/BlinkDot.tsx
|
|
253
|
+
import classNames5 from "classnames";
|
|
250
254
|
import React10 from "react";
|
|
255
|
+
var BlinkDot = (props) => {
|
|
256
|
+
const { className } = props;
|
|
257
|
+
return /* @__PURE__ */ React10.createElement("span", {
|
|
258
|
+
className: classNames5("inline-flex h-1 w-1 justify-center items-center relative", className)
|
|
259
|
+
}, /* @__PURE__ */ React10.createElement("span", {
|
|
260
|
+
className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
|
|
261
|
+
}));
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
// src/pop-confirm/PopConfirm.tsx
|
|
251
265
|
var PopConfirm = (props) => {
|
|
266
|
+
const [loading, setLoading] = useState2(false);
|
|
252
267
|
const { onOk, onCancel, children, content, className } = props;
|
|
253
|
-
return /* @__PURE__ */
|
|
268
|
+
return /* @__PURE__ */ React11.createElement(Panel, {
|
|
254
269
|
className
|
|
255
|
-
}, /* @__PURE__ */
|
|
270
|
+
}, /* @__PURE__ */ React11.createElement("div", {
|
|
256
271
|
className: "mb-32"
|
|
257
|
-
}, children || content), /* @__PURE__ */
|
|
272
|
+
}, children || content), /* @__PURE__ */ React11.createElement("div", {
|
|
258
273
|
className: "flex justify-end"
|
|
259
|
-
}, onCancel && /* @__PURE__ */
|
|
274
|
+
}, onCancel && /* @__PURE__ */ React11.createElement(Button, {
|
|
260
275
|
onClick: onCancel,
|
|
261
276
|
type: "normal" /* NORMAL */
|
|
262
|
-
}, "Cancel"), onOk && /* @__PURE__ */
|
|
263
|
-
onClick:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
277
|
+
}, "Cancel"), onOk && /* @__PURE__ */ React11.createElement(Button, {
|
|
278
|
+
onClick: async (e) => {
|
|
279
|
+
setLoading(true);
|
|
280
|
+
await onOk(e);
|
|
281
|
+
setLoading(false);
|
|
282
|
+
},
|
|
283
|
+
className: "ml-16 relative",
|
|
284
|
+
type: loading ? "disabled" /* DISABLED */ : "primary" /* PRIMARY */
|
|
285
|
+
}, "OK", loading && /* @__PURE__ */ React11.createElement(BlinkDot, {
|
|
286
|
+
className: "!absolute top-2 right-2"
|
|
287
|
+
}))));
|
|
267
288
|
};
|
|
268
289
|
|
|
269
290
|
// src/table/Table.tsx
|
|
270
|
-
import
|
|
291
|
+
import React12 from "react";
|
|
271
292
|
var Table = (props) => {
|
|
272
293
|
const { rowCount, rowRenderer, headerRenderer, className } = props;
|
|
273
294
|
const rows = [];
|
|
274
295
|
for (let i = 0; i < rowCount; i++) {
|
|
275
|
-
rows.push(/* @__PURE__ */
|
|
296
|
+
rows.push(/* @__PURE__ */ React12.createElement("tr", {
|
|
276
297
|
key: i
|
|
277
298
|
}, rowRenderer(i)));
|
|
278
299
|
}
|
|
279
|
-
return /* @__PURE__ */
|
|
300
|
+
return /* @__PURE__ */ React12.createElement("table", {
|
|
280
301
|
className
|
|
281
|
-
}, headerRenderer && /* @__PURE__ */
|
|
302
|
+
}, headerRenderer && /* @__PURE__ */ React12.createElement("thead", null, /* @__PURE__ */ React12.createElement("tr", null, headerRenderer())), /* @__PURE__ */ React12.createElement("tbody", null, rows));
|
|
282
303
|
};
|
|
283
|
-
Table.HCell = (props) => /* @__PURE__ */
|
|
284
|
-
Table.Cell = (props) => /* @__PURE__ */
|
|
304
|
+
Table.HCell = (props) => /* @__PURE__ */ React12.createElement("th", __spreadValues({}, props), props.children);
|
|
305
|
+
Table.Cell = (props) => /* @__PURE__ */ React12.createElement("td", __spreadValues({}, props), props.children);
|
|
285
306
|
|
|
286
307
|
// src/skeleton/Seleton.tsx
|
|
287
|
-
import
|
|
288
|
-
import
|
|
308
|
+
import classNames6 from "classnames";
|
|
309
|
+
import React14 from "react";
|
|
289
310
|
|
|
290
311
|
// src/list/list.tsx
|
|
291
312
|
import cls from "classnames";
|
|
292
|
-
import
|
|
313
|
+
import React13 from "react";
|
|
293
314
|
var List = (props) => {
|
|
294
315
|
const { items, itemRenderer, className, horizontal, compact } = props;
|
|
295
316
|
const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-4";
|
|
296
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ React13.createElement("ul", {
|
|
297
318
|
className: cls(className, "list-style-none", {
|
|
298
319
|
flex: horizontal,
|
|
299
320
|
"align-center": horizontal
|
|
300
321
|
})
|
|
301
322
|
}, items.map((item, index) => {
|
|
302
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ React13.createElement("li", {
|
|
303
324
|
key: item.id || index,
|
|
304
325
|
className: cls(spaceCls, "flex-shrink-0")
|
|
305
326
|
}, itemRenderer(item, index));
|
|
@@ -308,22 +329,22 @@ var List = (props) => {
|
|
|
308
329
|
var TitledList = (props) => {
|
|
309
330
|
const _a = props, { title, description } = _a, rest = __objRest(_a, ["title", "description"]);
|
|
310
331
|
if (!title) {
|
|
311
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ React13.createElement(List, __spreadValues({}, rest));
|
|
312
333
|
}
|
|
313
|
-
return /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ React13.createElement(Article, {
|
|
314
335
|
title,
|
|
315
336
|
description
|
|
316
|
-
}, /* @__PURE__ */
|
|
337
|
+
}, /* @__PURE__ */ React13.createElement(List, __spreadValues({}, rest)));
|
|
317
338
|
};
|
|
318
339
|
var LinkList = (props) => {
|
|
319
340
|
const _a = props, { title, description, links } = _a, rest = __objRest(_a, ["title", "description", "links"]);
|
|
320
341
|
const renderLink = ({ name, to }) => {
|
|
321
|
-
return /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ React13.createElement(Link, {
|
|
322
343
|
to,
|
|
323
344
|
key: name
|
|
324
345
|
}, name);
|
|
325
346
|
};
|
|
326
|
-
return /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ React13.createElement(TitledList, __spreadValues({
|
|
327
348
|
title,
|
|
328
349
|
description,
|
|
329
350
|
items: links,
|
|
@@ -347,20 +368,20 @@ var COLOR_MAPPING2 = {
|
|
|
347
368
|
};
|
|
348
369
|
var Skeleton = (props) => {
|
|
349
370
|
const { bgColor = "gray" /* GRAY */, width = 26, height = 24 } = props;
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
className:
|
|
371
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
372
|
+
className: classNames6(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded"),
|
|
352
373
|
style: { width, height }
|
|
353
374
|
});
|
|
354
375
|
};
|
|
355
376
|
var ArticleSkeleton = (props) => {
|
|
356
377
|
const { children, titleLength, descriptionLength } = props;
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
-
title: /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ React14.createElement(Article, {
|
|
379
|
+
title: /* @__PURE__ */ React14.createElement(Skeleton, {
|
|
359
380
|
width: 36 * titleLength,
|
|
360
381
|
height: 36,
|
|
361
382
|
bgColor: "black" /* BLACK */
|
|
362
383
|
}),
|
|
363
|
-
description: descriptionLength && /* @__PURE__ */
|
|
384
|
+
description: descriptionLength && /* @__PURE__ */ React14.createElement(Skeleton, {
|
|
364
385
|
width: 16 * descriptionLength
|
|
365
386
|
})
|
|
366
387
|
}, children);
|
|
@@ -368,12 +389,12 @@ var ArticleSkeleton = (props) => {
|
|
|
368
389
|
var LinkListSkeleton = (props) => {
|
|
369
390
|
const _a = props, { linksLength } = _a, rest = __objRest(_a, ["linksLength"]);
|
|
370
391
|
const renderSkeleton = (length) => {
|
|
371
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */ React14.createElement(Skeleton, {
|
|
372
393
|
width: length * 16,
|
|
373
394
|
bgColor: "blue" /* BLUE */
|
|
374
395
|
});
|
|
375
396
|
};
|
|
376
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ React14.createElement(ArticleSkeleton, __spreadValues({}, rest), /* @__PURE__ */ React14.createElement(List, {
|
|
377
398
|
items: linksLength,
|
|
378
399
|
itemRenderer: renderSkeleton
|
|
379
400
|
}));
|
|
@@ -381,11 +402,11 @@ var LinkListSkeleton = (props) => {
|
|
|
381
402
|
|
|
382
403
|
// src/drop-image/DropImage.tsx
|
|
383
404
|
import cls2 from "classnames";
|
|
384
|
-
import
|
|
405
|
+
import React15, {
|
|
385
406
|
useEffect as useEffect2,
|
|
386
407
|
useCallback as useCallback2
|
|
387
408
|
} from "react";
|
|
388
|
-
import { useState as
|
|
409
|
+
import { useState as useState4 } from "react";
|
|
389
410
|
|
|
390
411
|
// src/drop-image/utils.ts
|
|
391
412
|
var wait = (d) => new Promise((r) => setTimeout(r, d));
|
|
@@ -393,11 +414,11 @@ var noop = () => {
|
|
|
393
414
|
};
|
|
394
415
|
|
|
395
416
|
// src/drop-image/useDropImage.ts
|
|
396
|
-
import { useState as
|
|
417
|
+
import { useState as useState3, useCallback, useRef } from "react";
|
|
397
418
|
var useDropImage = (params) => {
|
|
398
|
-
const [isDragOver, setIsDragOver] =
|
|
399
|
-
const [imageSrc, setImageSrc] =
|
|
400
|
-
const [imageSize, setImageSize] =
|
|
419
|
+
const [isDragOver, setIsDragOver] = useState3(false);
|
|
420
|
+
const [imageSrc, setImageSrc] = useState3("");
|
|
421
|
+
const [imageSize, setImageSize] = useState3({ width: 0, height: 0 });
|
|
401
422
|
const imageFile = useRef(null);
|
|
402
423
|
const {
|
|
403
424
|
portraitImageWidth = 384,
|
|
@@ -498,7 +519,7 @@ var ImagePreviewer = (props) => {
|
|
|
498
519
|
imageSrc,
|
|
499
520
|
className
|
|
500
521
|
} = props;
|
|
501
|
-
return /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ React15.createElement("img", {
|
|
502
523
|
className: cls2(className, "max-w-[100%]", "h-[auto]", "duration-300", "transition-opacity", "opacity-100", {
|
|
503
524
|
"opacity-0": !showImagePreviewer,
|
|
504
525
|
"!m-0": !showImagePreviewer,
|
|
@@ -520,8 +541,8 @@ var GhostDropImage = (props) => {
|
|
|
520
541
|
children,
|
|
521
542
|
placeholder
|
|
522
543
|
} = props;
|
|
523
|
-
const [coverVisible, setCoverVisible] =
|
|
524
|
-
const [imageVisible, setImageVisible] =
|
|
544
|
+
const [coverVisible, setCoverVisible] = useState4(false);
|
|
545
|
+
const [imageVisible, setImageVisible] = useState4(false);
|
|
525
546
|
const handleDocDragEnter = useCallback2(() => {
|
|
526
547
|
setCoverVisible(true);
|
|
527
548
|
}, []);
|
|
@@ -559,7 +580,7 @@ var GhostDropImage = (props) => {
|
|
|
559
580
|
block: coverVisible,
|
|
560
581
|
hidden: !coverVisible
|
|
561
582
|
});
|
|
562
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("div", {
|
|
563
584
|
className: coverCls,
|
|
564
585
|
onDragLeave: () => {
|
|
565
586
|
handleDragLeave();
|
|
@@ -572,7 +593,7 @@ var GhostDropImage = (props) => {
|
|
|
572
593
|
imageRef,
|
|
573
594
|
imageSize,
|
|
574
595
|
imageSrc
|
|
575
|
-
}) : /* @__PURE__ */
|
|
596
|
+
}) : /* @__PURE__ */ React15.createElement(ImagePreviewer, {
|
|
576
597
|
className,
|
|
577
598
|
visible: imageVisible,
|
|
578
599
|
imageRef,
|
|
@@ -598,9 +619,9 @@ var DropImage = (props) => {
|
|
|
598
619
|
}
|
|
599
620
|
} = props;
|
|
600
621
|
if (ghost) {
|
|
601
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ React15.createElement(GhostDropImage, __spreadValues({}, props));
|
|
602
623
|
}
|
|
603
|
-
const [showImagePreviewer, setShowImagePreviewer] =
|
|
624
|
+
const [showImagePreviewer, setShowImagePreviewer] = useState4(false);
|
|
604
625
|
const {
|
|
605
626
|
handleDragLeave,
|
|
606
627
|
handleDragOver,
|
|
@@ -629,7 +650,7 @@ var DropImage = (props) => {
|
|
|
629
650
|
height: imageSize.height || dropAreaStyle.height
|
|
630
651
|
});
|
|
631
652
|
};
|
|
632
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
633
654
|
className: cls2(className, "transition-all items-center justify-center flex duration-200 ease-in-out", {
|
|
634
655
|
"shadow-input": !imageSrc,
|
|
635
656
|
"shadow-empty": imageSrc
|
|
@@ -643,7 +664,7 @@ var DropImage = (props) => {
|
|
|
643
664
|
imageRef,
|
|
644
665
|
imageSize,
|
|
645
666
|
imageSrc
|
|
646
|
-
}) : /* @__PURE__ */
|
|
667
|
+
}) : /* @__PURE__ */ React15.createElement(ImagePreviewer, {
|
|
647
668
|
visible: showImagePreviewer,
|
|
648
669
|
imageRef,
|
|
649
670
|
imageSrc,
|
|
@@ -651,18 +672,6 @@ var DropImage = (props) => {
|
|
|
651
672
|
}), !imageSrc && placeholder);
|
|
652
673
|
};
|
|
653
674
|
|
|
654
|
-
// src/blink-dot/BlinkDot.tsx
|
|
655
|
-
import classNames6 from "classnames";
|
|
656
|
-
import React15 from "react";
|
|
657
|
-
var BlinkDot = (props) => {
|
|
658
|
-
const { className } = props;
|
|
659
|
-
return /* @__PURE__ */ React15.createElement("span", {
|
|
660
|
-
className: classNames6("inline-flex h-1 w-1 justify-center items-center relative", className)
|
|
661
|
-
}, /* @__PURE__ */ React15.createElement("span", {
|
|
662
|
-
className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
|
|
663
|
-
}));
|
|
664
|
-
};
|
|
665
|
-
|
|
666
675
|
// src/layout/layout.tsx
|
|
667
676
|
import cls3 from "classnames";
|
|
668
677
|
import React16 from "react";
|