@bbki.ng/components 1.4.8 → 1.5.2
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 +32 -2
- package/dist/index.js +46 -1
- package/dist/index.mjs +43 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { EventHandler, ReactElement } from 'react';
|
|
1
|
+
import React, { EventHandler, ReactElement, CSSProperties } from 'react';
|
|
2
2
|
import { LinkProps as LinkProps$1 } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
declare type ArticleProps = {
|
|
@@ -93,4 +93,34 @@ declare type PopConfirmProps = {
|
|
|
93
93
|
};
|
|
94
94
|
declare const PopConfirm: (props: PopConfirmProps) => JSX.Element;
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
declare type TableProps = {
|
|
97
|
+
rowCount: number;
|
|
98
|
+
rowRenderer: (index: number) => any;
|
|
99
|
+
headerRenderer?: () => any;
|
|
100
|
+
className?: string;
|
|
101
|
+
};
|
|
102
|
+
declare const Table: {
|
|
103
|
+
(props: TableProps): JSX.Element;
|
|
104
|
+
HCell(props: {
|
|
105
|
+
children: any;
|
|
106
|
+
style?: CSSProperties;
|
|
107
|
+
}): JSX.Element;
|
|
108
|
+
Cell(props: {
|
|
109
|
+
children: any;
|
|
110
|
+
style?: CSSProperties;
|
|
111
|
+
}): JSX.Element;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
declare enum SkeletonColor {
|
|
115
|
+
BLUE = "blue",
|
|
116
|
+
RED = "red",
|
|
117
|
+
GRAY = "gray"
|
|
118
|
+
}
|
|
119
|
+
declare type SkeletonProps = {
|
|
120
|
+
width?: number;
|
|
121
|
+
height?: number;
|
|
122
|
+
bgColor?: SkeletonColor;
|
|
123
|
+
};
|
|
124
|
+
declare const Skeleton: (props: SkeletonProps) => JSX.Element;
|
|
125
|
+
|
|
126
|
+
export { Article, ArticleProps, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, Link, LinkColor, LinkProps, Logo, LogoProps, Nav, NavProps, Page, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags };
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,9 @@ __export(src_exports, {
|
|
|
69
69
|
Page: () => Page,
|
|
70
70
|
Panel: () => Panel,
|
|
71
71
|
PopConfirm: () => PopConfirm,
|
|
72
|
+
Skeleton: () => Skeleton,
|
|
73
|
+
SkeletonColor: () => SkeletonColor,
|
|
74
|
+
Table: () => Table,
|
|
72
75
|
Tag: () => Tag,
|
|
73
76
|
Tags: () => Tags
|
|
74
77
|
});
|
|
@@ -81,7 +84,7 @@ var Article = (props) => {
|
|
|
81
84
|
return /* @__PURE__ */ import_react.default.createElement("div", {
|
|
82
85
|
className: (0, import_classnames.default)("article", className)
|
|
83
86
|
}, /* @__PURE__ */ import_react.default.createElement("div", {
|
|
84
|
-
className: "text-[2.25rem]"
|
|
87
|
+
className: "text-[2.25rem] leading-none"
|
|
85
88
|
}, title), /* @__PURE__ */ import_react.default.createElement("hr", {
|
|
86
89
|
className: "my-64 border-gray-200"
|
|
87
90
|
}), /* @__PURE__ */ import_react.default.createElement("div", {
|
|
@@ -306,6 +309,45 @@ var PopConfirm = (props) => {
|
|
|
306
309
|
type: "primary" /* PRIMARY */
|
|
307
310
|
}, "OK")));
|
|
308
311
|
};
|
|
312
|
+
|
|
313
|
+
// src/table/Table.tsx
|
|
314
|
+
var import_react10 = __toESM(require("react"));
|
|
315
|
+
var Table = (props) => {
|
|
316
|
+
const { rowCount, rowRenderer, headerRenderer, className } = props;
|
|
317
|
+
const rows = [];
|
|
318
|
+
for (let i = 0; i < rowCount; i++) {
|
|
319
|
+
rows.push(/* @__PURE__ */ import_react10.default.createElement("tr", {
|
|
320
|
+
key: i
|
|
321
|
+
}, rowRenderer(i)));
|
|
322
|
+
}
|
|
323
|
+
return /* @__PURE__ */ import_react10.default.createElement("table", {
|
|
324
|
+
className
|
|
325
|
+
}, headerRenderer && /* @__PURE__ */ import_react10.default.createElement("thead", null, /* @__PURE__ */ import_react10.default.createElement("tr", null, headerRenderer())), /* @__PURE__ */ import_react10.default.createElement("tbody", null, rows));
|
|
326
|
+
};
|
|
327
|
+
Table.HCell = (props) => /* @__PURE__ */ import_react10.default.createElement("th", __spreadValues({}, props), props.children);
|
|
328
|
+
Table.Cell = (props) => /* @__PURE__ */ import_react10.default.createElement("td", __spreadValues({}, props), props.children);
|
|
329
|
+
|
|
330
|
+
// src/skeleton/Seleton.tsx
|
|
331
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
332
|
+
var import_react11 = __toESM(require("react"));
|
|
333
|
+
var SkeletonColor = /* @__PURE__ */ ((SkeletonColor2) => {
|
|
334
|
+
SkeletonColor2["BLUE"] = "blue";
|
|
335
|
+
SkeletonColor2["RED"] = "red";
|
|
336
|
+
SkeletonColor2["GRAY"] = "gray";
|
|
337
|
+
return SkeletonColor2;
|
|
338
|
+
})(SkeletonColor || {});
|
|
339
|
+
var COLOR_MAPPING2 = {
|
|
340
|
+
["blue" /* BLUE */]: "bg-blue-100",
|
|
341
|
+
["red" /* RED */]: "bg-red-100",
|
|
342
|
+
["gray" /* GRAY */]: "bg-gray-100"
|
|
343
|
+
};
|
|
344
|
+
var Skeleton = (props) => {
|
|
345
|
+
const { bgColor = "gray" /* GRAY */, width = 26, height = 24 } = props;
|
|
346
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
347
|
+
className: (0, import_classnames5.default)(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded"),
|
|
348
|
+
style: { width, height }
|
|
349
|
+
});
|
|
350
|
+
};
|
|
309
351
|
module.exports = __toCommonJS(src_exports);
|
|
310
352
|
// Annotate the CommonJS export names for ESM import in node:
|
|
311
353
|
0 && (module.exports = {
|
|
@@ -320,6 +362,9 @@ module.exports = __toCommonJS(src_exports);
|
|
|
320
362
|
Page,
|
|
321
363
|
Panel,
|
|
322
364
|
PopConfirm,
|
|
365
|
+
Skeleton,
|
|
366
|
+
SkeletonColor,
|
|
367
|
+
Table,
|
|
323
368
|
Tag,
|
|
324
369
|
Tags
|
|
325
370
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ var Article = (props) => {
|
|
|
38
38
|
return /* @__PURE__ */ React.createElement("div", {
|
|
39
39
|
className: classNames("article", className)
|
|
40
40
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
41
|
-
className: "text-[2.25rem]"
|
|
41
|
+
className: "text-[2.25rem] leading-none"
|
|
42
42
|
}, title), /* @__PURE__ */ React.createElement("hr", {
|
|
43
43
|
className: "my-64 border-gray-200"
|
|
44
44
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
@@ -263,6 +263,45 @@ var PopConfirm = (props) => {
|
|
|
263
263
|
type: "primary" /* PRIMARY */
|
|
264
264
|
}, "OK")));
|
|
265
265
|
};
|
|
266
|
+
|
|
267
|
+
// src/table/Table.tsx
|
|
268
|
+
import React11 from "react";
|
|
269
|
+
var Table = (props) => {
|
|
270
|
+
const { rowCount, rowRenderer, headerRenderer, className } = props;
|
|
271
|
+
const rows = [];
|
|
272
|
+
for (let i = 0; i < rowCount; i++) {
|
|
273
|
+
rows.push(/* @__PURE__ */ React11.createElement("tr", {
|
|
274
|
+
key: i
|
|
275
|
+
}, rowRenderer(i)));
|
|
276
|
+
}
|
|
277
|
+
return /* @__PURE__ */ React11.createElement("table", {
|
|
278
|
+
className
|
|
279
|
+
}, headerRenderer && /* @__PURE__ */ React11.createElement("thead", null, /* @__PURE__ */ React11.createElement("tr", null, headerRenderer())), /* @__PURE__ */ React11.createElement("tbody", null, rows));
|
|
280
|
+
};
|
|
281
|
+
Table.HCell = (props) => /* @__PURE__ */ React11.createElement("th", __spreadValues({}, props), props.children);
|
|
282
|
+
Table.Cell = (props) => /* @__PURE__ */ React11.createElement("td", __spreadValues({}, props), props.children);
|
|
283
|
+
|
|
284
|
+
// src/skeleton/Seleton.tsx
|
|
285
|
+
import classNames5 from "classnames";
|
|
286
|
+
import React12 from "react";
|
|
287
|
+
var SkeletonColor = /* @__PURE__ */ ((SkeletonColor2) => {
|
|
288
|
+
SkeletonColor2["BLUE"] = "blue";
|
|
289
|
+
SkeletonColor2["RED"] = "red";
|
|
290
|
+
SkeletonColor2["GRAY"] = "gray";
|
|
291
|
+
return SkeletonColor2;
|
|
292
|
+
})(SkeletonColor || {});
|
|
293
|
+
var COLOR_MAPPING2 = {
|
|
294
|
+
["blue" /* BLUE */]: "bg-blue-100",
|
|
295
|
+
["red" /* RED */]: "bg-red-100",
|
|
296
|
+
["gray" /* GRAY */]: "bg-gray-100"
|
|
297
|
+
};
|
|
298
|
+
var Skeleton = (props) => {
|
|
299
|
+
const { bgColor = "gray" /* GRAY */, width = 26, height = 24 } = props;
|
|
300
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
301
|
+
className: classNames5(COLOR_MAPPING2[bgColor], "animate-pulse", "rounded"),
|
|
302
|
+
style: { width, height }
|
|
303
|
+
});
|
|
304
|
+
};
|
|
266
305
|
export {
|
|
267
306
|
Article,
|
|
268
307
|
Breadcrumb,
|
|
@@ -275,6 +314,9 @@ export {
|
|
|
275
314
|
Page,
|
|
276
315
|
Panel,
|
|
277
316
|
PopConfirm,
|
|
317
|
+
Skeleton,
|
|
318
|
+
SkeletonColor,
|
|
319
|
+
Table,
|
|
278
320
|
Tag,
|
|
279
321
|
Tags
|
|
280
322
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"classnames": "^2.3.1",
|
|
37
|
-
"react-router-dom": "5.3.0"
|
|
37
|
+
"react-router-dom": "5.3.0",
|
|
38
|
+
"@tailwindcss/typography": "^0.5.0"
|
|
38
39
|
}
|
|
39
40
|
}
|