@bbki.ng/components 2.1.40 → 2.1.42
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 +64 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +32 -22
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +64 -44
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -144,13 +144,32 @@ var Logo = React3.memo(
|
|
|
144
144
|
var import_react6 = __toESM(require("react"), 1);
|
|
145
145
|
|
|
146
146
|
// lib/breadcrumb/Breadcrumb.tsx
|
|
147
|
-
var
|
|
148
|
-
var
|
|
147
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
148
|
+
var import_classnames4 = __toESM(require("classnames"), 1);
|
|
149
149
|
|
|
150
150
|
// lib/link/Link.tsx
|
|
151
|
-
var
|
|
151
|
+
var import_classnames3 = __toESM(require("classnames"), 1);
|
|
152
152
|
var import_react_router_dom = require("react-router-dom");
|
|
153
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
154
|
+
|
|
155
|
+
// lib/blink-dot/BlinkDot.tsx
|
|
156
|
+
var import_classnames2 = __toESM(require("classnames"), 1);
|
|
153
157
|
var import_react3 = __toESM(require("react"), 1);
|
|
158
|
+
var BlinkDot = (props) => {
|
|
159
|
+
const { className } = props;
|
|
160
|
+
const status = props.status || "hidden";
|
|
161
|
+
const statusCls = (0, import_classnames2.default)({
|
|
162
|
+
"animate-ping-fast": status === "blink",
|
|
163
|
+
hidden: status === "hidden"
|
|
164
|
+
});
|
|
165
|
+
return /* @__PURE__ */ import_react3.default.createElement("span", {
|
|
166
|
+
className: (0, import_classnames2.default)("inline-flex justify-center items-center relative")
|
|
167
|
+
}, /* @__PURE__ */ import_react3.default.createElement("span", {
|
|
168
|
+
className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls}`
|
|
169
|
+
}, "."));
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// lib/link/Link.tsx
|
|
154
173
|
var LinkColor = /* @__PURE__ */ ((LinkColor2) => {
|
|
155
174
|
LinkColor2["BLUE"] = "blue";
|
|
156
175
|
LinkColor2["RED"] = "red";
|
|
@@ -178,9 +197,11 @@ var Link = (props) => {
|
|
|
178
197
|
external,
|
|
179
198
|
className,
|
|
180
199
|
children,
|
|
200
|
+
status,
|
|
201
|
+
readonly,
|
|
181
202
|
...rest
|
|
182
203
|
} = props;
|
|
183
|
-
const linkCls = (0,
|
|
204
|
+
const linkCls = (0, import_classnames3.default)(
|
|
184
205
|
className,
|
|
185
206
|
"rounded",
|
|
186
207
|
"!no-underline",
|
|
@@ -191,60 +212,59 @@ var Link = (props) => {
|
|
|
191
212
|
FOCUS_BG_COLOR_MAPPING[color]
|
|
192
213
|
);
|
|
193
214
|
if (external) {
|
|
194
|
-
return /* @__PURE__ */
|
|
215
|
+
return /* @__PURE__ */ import_react4.default.createElement("a", {
|
|
195
216
|
href: props.to,
|
|
196
217
|
className: linkCls,
|
|
197
218
|
target: "_blank",
|
|
198
|
-
rel: "noreferrer"
|
|
219
|
+
rel: "noreferrer",
|
|
220
|
+
style: { padding: 4 }
|
|
199
221
|
}, children);
|
|
200
222
|
}
|
|
201
|
-
|
|
223
|
+
if (readonly) {
|
|
224
|
+
const isNonEnName = !/^[a-zA-Z~]+$/.test(children);
|
|
225
|
+
const offsetCls = (0, import_classnames3.default)({ "relative top-[2px]": isNonEnName });
|
|
226
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
227
|
+
className: (0, import_classnames3.default)("text-gray-400", offsetCls),
|
|
228
|
+
style: { padding: 4 }
|
|
229
|
+
}, children), /* @__PURE__ */ import_react4.default.createElement(BlinkDot, {
|
|
230
|
+
status
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(import_react_router_dom.Link, {
|
|
202
234
|
...rest,
|
|
203
|
-
className: linkCls
|
|
204
|
-
|
|
235
|
+
className: linkCls,
|
|
236
|
+
style: { padding: 4 }
|
|
237
|
+
}, children), /* @__PURE__ */ import_react4.default.createElement(BlinkDot, {
|
|
238
|
+
className: "-top-3 left-1",
|
|
239
|
+
status
|
|
240
|
+
}));
|
|
205
241
|
};
|
|
206
242
|
|
|
207
243
|
// lib/breadcrumb/Breadcrumb.tsx
|
|
208
244
|
var Breadcrumb = (props) => {
|
|
209
|
-
const { paths } = props;
|
|
245
|
+
const { paths, loading } = props;
|
|
210
246
|
const PathElements = paths.map(({ path, name }, index) => {
|
|
211
|
-
const slash = index === 0 ? null : /* @__PURE__ */
|
|
247
|
+
const slash = index === 0 ? null : /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
212
248
|
className: "text-gray-400"
|
|
213
249
|
}, "/");
|
|
214
250
|
const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
|
|
215
|
-
const offsetCls = (0,
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
style: { padding: 4 }
|
|
220
|
-
}, name) : /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
221
|
-
className: (0, import_classnames3.default)("text-gray-400", offsetCls),
|
|
222
|
-
style: { padding: 4 }
|
|
223
|
-
}, name);
|
|
224
|
-
return /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
251
|
+
const offsetCls = (0, import_classnames4.default)({ "relative top-[2px]": isNonEnName });
|
|
252
|
+
const isLast = index === paths.length - 1;
|
|
253
|
+
const status = loading && isLast ? "blink" : "hidden";
|
|
254
|
+
return /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
225
255
|
key: path || name
|
|
226
|
-
}, slash,
|
|
256
|
+
}, slash, /* @__PURE__ */ import_react5.default.createElement(Link, {
|
|
257
|
+
to: path ?? "",
|
|
258
|
+
className: offsetCls,
|
|
259
|
+
readonly: !path,
|
|
260
|
+
status
|
|
261
|
+
}, name));
|
|
227
262
|
});
|
|
228
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
229
264
|
className: "breadcrumb"
|
|
230
265
|
}, PathElements);
|
|
231
266
|
};
|
|
232
267
|
|
|
233
|
-
// lib/blink-dot/BlinkDot.tsx
|
|
234
|
-
var import_classnames4 = __toESM(require("classnames"), 1);
|
|
235
|
-
var import_react5 = __toESM(require("react"), 1);
|
|
236
|
-
var BlinkDot = (props) => {
|
|
237
|
-
const { className } = props;
|
|
238
|
-
return /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
239
|
-
className: (0, import_classnames4.default)(
|
|
240
|
-
"inline-flex h-1 w-1 justify-center items-center relative",
|
|
241
|
-
className
|
|
242
|
-
)
|
|
243
|
-
}, /* @__PURE__ */ import_react5.default.createElement("span", {
|
|
244
|
-
className: "animate-ping-fast absolute inline-flex h-full w-full rounded-full bg-red-600"
|
|
245
|
-
}));
|
|
246
|
-
};
|
|
247
|
-
|
|
248
268
|
// lib/nav/Nav.tsx
|
|
249
269
|
var import_react_router_dom2 = require("react-router-dom");
|
|
250
270
|
var Nav = (props) => {
|
|
@@ -264,9 +284,8 @@ var Nav = (props) => {
|
|
|
264
284
|
nav("/");
|
|
265
285
|
}
|
|
266
286
|
}), /* @__PURE__ */ import_react6.default.createElement(Breadcrumb, {
|
|
267
|
-
paths: props.paths
|
|
268
|
-
|
|
269
|
-
className: "-top-2 left-1"
|
|
287
|
+
paths: props.paths,
|
|
288
|
+
loading: props.loading
|
|
270
289
|
}));
|
|
271
290
|
};
|
|
272
291
|
|
|
@@ -456,7 +475,7 @@ var import_classnames6 = __toESM(require("classnames"), 1);
|
|
|
456
475
|
var import_react13 = __toESM(require("react"), 1);
|
|
457
476
|
var List = (props) => {
|
|
458
477
|
const { items, itemRenderer, className, horizontal, compact } = props;
|
|
459
|
-
const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-
|
|
478
|
+
const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-16";
|
|
460
479
|
return /* @__PURE__ */ import_react13.default.createElement("ul", {
|
|
461
480
|
className: (0, import_classnames6.default)(className, "list-style-none", {
|
|
462
481
|
flex: horizontal,
|
|
@@ -486,11 +505,12 @@ var TitledList = (props) => {
|
|
|
486
505
|
};
|
|
487
506
|
var LinkList = (props) => {
|
|
488
507
|
const { title, description, links, ...rest } = props;
|
|
489
|
-
const renderLink = ({ name, to, external }) => {
|
|
508
|
+
const renderLink = ({ name, to, external, ...rest2 }) => {
|
|
490
509
|
return /* @__PURE__ */ import_react13.default.createElement(Link, {
|
|
491
510
|
to,
|
|
492
511
|
key: name,
|
|
493
|
-
external
|
|
512
|
+
external,
|
|
513
|
+
...rest2
|
|
494
514
|
}, name);
|
|
495
515
|
};
|
|
496
516
|
return /* @__PURE__ */ import_react13.default.createElement(TitledList, {
|