@bbki.ng/components 1.5.15 → 1.5.18
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 +2 -1
- package/dist/index.js +17 -4
- package/dist/index.mjs +17 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -141,12 +141,13 @@ declare enum SkeletonColor {
|
|
|
141
141
|
BLACK = "black"
|
|
142
142
|
}
|
|
143
143
|
interface SkeletonProps {
|
|
144
|
+
className?: string;
|
|
144
145
|
width?: number;
|
|
145
146
|
height?: number;
|
|
146
147
|
bgColor?: SkeletonColor;
|
|
147
148
|
}
|
|
148
149
|
interface ArticleSkeletonProps extends SkeletonProps {
|
|
149
|
-
titleLength
|
|
150
|
+
titleLength?: number;
|
|
150
151
|
descriptionLength?: number;
|
|
151
152
|
children?: any;
|
|
152
153
|
}
|
package/dist/index.js
CHANGED
|
@@ -231,7 +231,8 @@ var Breadcrumb = (props) => {
|
|
|
231
231
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
|
|
232
232
|
const offsetCls = (0, import_classnames3.default)({ "relative top-[2px]": isNonEnName });
|
|
233
233
|
const link = path ? /* @__PURE__ */ import_react4.default.createElement(Link, {
|
|
234
|
-
to: path
|
|
234
|
+
to: path,
|
|
235
|
+
className: offsetCls
|
|
235
236
|
}, name) : /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
236
237
|
className: (0, import_classnames3.default)("text-gray-400", offsetCls)
|
|
237
238
|
}, name);
|
|
@@ -499,14 +500,19 @@ var COLOR_MAPPING2 = {
|
|
|
499
500
|
["black" /* BLACK */]: "bg-gray-200"
|
|
500
501
|
};
|
|
501
502
|
var Skeleton = (props) => {
|
|
502
|
-
const {
|
|
503
|
+
const {
|
|
504
|
+
bgColor = "gray" /* GRAY */,
|
|
505
|
+
width = 26,
|
|
506
|
+
height = 24,
|
|
507
|
+
className
|
|
508
|
+
} = props;
|
|
503
509
|
return /* @__PURE__ */ import_react14.default.createElement("div", {
|
|
504
|
-
className: (0, import_classnames7.default)(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded"),
|
|
510
|
+
className: (0, import_classnames7.default)(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded", className),
|
|
505
511
|
style: { width, height }
|
|
506
512
|
});
|
|
507
513
|
};
|
|
508
514
|
var ArticleSkeleton = (props) => {
|
|
509
|
-
const { children, titleLength, descriptionLength } = props;
|
|
515
|
+
const { children, titleLength = 0, descriptionLength } = props;
|
|
510
516
|
return /* @__PURE__ */ import_react14.default.createElement(Article, {
|
|
511
517
|
title: /* @__PURE__ */ import_react14.default.createElement(Skeleton, {
|
|
512
518
|
width: 36 * titleLength,
|
|
@@ -522,10 +528,17 @@ var LinkListSkeleton = (props) => {
|
|
|
522
528
|
const _a = props, { linksLength } = _a, rest = __objRest(_a, ["linksLength"]);
|
|
523
529
|
const renderSkeleton = (length) => {
|
|
524
530
|
return /* @__PURE__ */ import_react14.default.createElement(Skeleton, {
|
|
531
|
+
className: "inline-block align-middle",
|
|
525
532
|
width: length * 16,
|
|
526
533
|
bgColor: "blue" /* BLUE */
|
|
527
534
|
});
|
|
528
535
|
};
|
|
536
|
+
if (!rest.titleLength) {
|
|
537
|
+
return /* @__PURE__ */ import_react14.default.createElement(List, {
|
|
538
|
+
items: linksLength,
|
|
539
|
+
itemRenderer: renderSkeleton
|
|
540
|
+
});
|
|
541
|
+
}
|
|
529
542
|
return /* @__PURE__ */ import_react14.default.createElement(ArticleSkeleton, __spreadValues({}, rest), /* @__PURE__ */ import_react14.default.createElement(List, {
|
|
530
543
|
items: linksLength,
|
|
531
544
|
itemRenderer: renderSkeleton
|
package/dist/index.mjs
CHANGED
|
@@ -173,7 +173,8 @@ var Breadcrumb = (props) => {
|
|
|
173
173
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
|
|
174
174
|
const offsetCls = classNames3({ "relative top-[2px]": isNonEnName });
|
|
175
175
|
const link = path ? /* @__PURE__ */ React5.createElement(Link, {
|
|
176
|
-
to: path
|
|
176
|
+
to: path,
|
|
177
|
+
className: offsetCls
|
|
177
178
|
}, name) : /* @__PURE__ */ React5.createElement("span", {
|
|
178
179
|
className: classNames3("text-gray-400", offsetCls)
|
|
179
180
|
}, name);
|
|
@@ -441,14 +442,19 @@ var COLOR_MAPPING2 = {
|
|
|
441
442
|
["black" /* BLACK */]: "bg-gray-200"
|
|
442
443
|
};
|
|
443
444
|
var Skeleton = (props) => {
|
|
444
|
-
const {
|
|
445
|
+
const {
|
|
446
|
+
bgColor = "gray" /* GRAY */,
|
|
447
|
+
width = 26,
|
|
448
|
+
height = 24,
|
|
449
|
+
className
|
|
450
|
+
} = props;
|
|
445
451
|
return /* @__PURE__ */ React15.createElement("div", {
|
|
446
|
-
className: classNames6(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded"),
|
|
452
|
+
className: classNames6(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded", className),
|
|
447
453
|
style: { width, height }
|
|
448
454
|
});
|
|
449
455
|
};
|
|
450
456
|
var ArticleSkeleton = (props) => {
|
|
451
|
-
const { children, titleLength, descriptionLength } = props;
|
|
457
|
+
const { children, titleLength = 0, descriptionLength } = props;
|
|
452
458
|
return /* @__PURE__ */ React15.createElement(Article, {
|
|
453
459
|
title: /* @__PURE__ */ React15.createElement(Skeleton, {
|
|
454
460
|
width: 36 * titleLength,
|
|
@@ -464,10 +470,17 @@ var LinkListSkeleton = (props) => {
|
|
|
464
470
|
const _a = props, { linksLength } = _a, rest = __objRest(_a, ["linksLength"]);
|
|
465
471
|
const renderSkeleton = (length) => {
|
|
466
472
|
return /* @__PURE__ */ React15.createElement(Skeleton, {
|
|
473
|
+
className: "inline-block align-middle",
|
|
467
474
|
width: length * 16,
|
|
468
475
|
bgColor: "blue" /* BLUE */
|
|
469
476
|
});
|
|
470
477
|
};
|
|
478
|
+
if (!rest.titleLength) {
|
|
479
|
+
return /* @__PURE__ */ React15.createElement(List, {
|
|
480
|
+
items: linksLength,
|
|
481
|
+
itemRenderer: renderSkeleton
|
|
482
|
+
});
|
|
483
|
+
}
|
|
471
484
|
return /* @__PURE__ */ React15.createElement(ArticleSkeleton, __spreadValues({}, rest), /* @__PURE__ */ React15.createElement(List, {
|
|
472
485
|
items: linksLength,
|
|
473
486
|
itemRenderer: renderSkeleton
|