@bbki.ng/components 5.0.3 → 5.1.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/link/Link.mjs +40 -37
- package/dist/list/list.d.ts +1 -0
- package/dist/list/list.mjs +51 -49
- package/package.json +2 -2
package/dist/link/Link.mjs
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Link as
|
|
1
|
+
import n from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
2
|
+
import { Link as p } from "react-router-dom";
|
|
3
3
|
import { BlinkDot as l } from "../blink-dot/BlinkDot.mjs";
|
|
4
|
-
import { jsx as
|
|
4
|
+
import { jsx as r, jsxs as c, Fragment as i } from "../_virtual/jsx-runtime.mjs";
|
|
5
5
|
var x = /* @__PURE__ */ ((e) => (e.BLUE = "blue", e.RED = "red", e.GRAY = "gray", e))(x || {});
|
|
6
6
|
const h = {
|
|
7
7
|
blue: "text-blue-600",
|
|
8
|
-
red: "text-
|
|
8
|
+
red: "text-yy-pink-150",
|
|
9
9
|
gray: "text-gray-400"
|
|
10
|
-
},
|
|
10
|
+
}, N = {
|
|
11
11
|
blue: "md:not-focus:hover:bg-blue-100 md:not-focus:hover:text-blue-600",
|
|
12
|
-
red: "md:not-focus:hover:bg-
|
|
12
|
+
red: "md:not-focus:hover:bg-yy-pink-50 md:not-focus:hover:text-yy-pink-150",
|
|
13
13
|
gray: "md:not-focus:hover:bg-gray-100 md:not-focus:hover:text-gray-400"
|
|
14
|
-
},
|
|
14
|
+
}, k = {
|
|
15
15
|
blue: "focus:bg-blue-100",
|
|
16
|
-
red: "focus:bg-
|
|
16
|
+
red: "focus:bg-yy-pink-50",
|
|
17
17
|
gray: "focus:bg-gray-100"
|
|
18
18
|
}, R = (e) => {
|
|
19
19
|
const {
|
|
20
|
-
color:
|
|
21
|
-
external:
|
|
22
|
-
className:
|
|
23
|
-
children:
|
|
24
|
-
status:
|
|
25
|
-
readonly:
|
|
26
|
-
...
|
|
27
|
-
} = e
|
|
28
|
-
|
|
20
|
+
color: u = "blue",
|
|
21
|
+
external: d,
|
|
22
|
+
className: f,
|
|
23
|
+
children: t,
|
|
24
|
+
status: s,
|
|
25
|
+
readonly: g,
|
|
26
|
+
...m
|
|
27
|
+
} = e;
|
|
28
|
+
let o = u;
|
|
29
|
+
typeof t == "string" && t.includes("小乌鸦") && (o = "red");
|
|
30
|
+
const a = n(
|
|
31
|
+
f,
|
|
29
32
|
"rounded-sm",
|
|
30
33
|
"no-underline!",
|
|
31
34
|
"inline-block",
|
|
@@ -33,11 +36,11 @@ const h = {
|
|
|
33
36
|
"active:scale-[0.97]",
|
|
34
37
|
// "focus:text-white",
|
|
35
38
|
h[o],
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
N[o],
|
|
40
|
+
k[o]
|
|
38
41
|
);
|
|
39
|
-
if (
|
|
40
|
-
return /* @__PURE__ */
|
|
42
|
+
if (d)
|
|
43
|
+
return /* @__PURE__ */ r("a", {
|
|
41
44
|
href: e.to,
|
|
42
45
|
className: a,
|
|
43
46
|
target: "_blank",
|
|
@@ -45,35 +48,35 @@ const h = {
|
|
|
45
48
|
style: {
|
|
46
49
|
padding: 4
|
|
47
50
|
},
|
|
48
|
-
children:
|
|
51
|
+
children: t
|
|
49
52
|
});
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
"relative top-[2px]":
|
|
53
|
+
if (g) {
|
|
54
|
+
const y = !/^[a-zA-Z~]+$/.test(t), b = n({
|
|
55
|
+
"relative top-[2px]": y
|
|
53
56
|
});
|
|
54
|
-
return /* @__PURE__ */ c(
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
-
className:
|
|
57
|
+
return /* @__PURE__ */ c(i, {
|
|
58
|
+
children: [/* @__PURE__ */ r("span", {
|
|
59
|
+
className: n("text-gray-400", b),
|
|
57
60
|
style: {
|
|
58
61
|
padding: 4
|
|
59
62
|
},
|
|
60
|
-
children:
|
|
61
|
-
}), /* @__PURE__ */
|
|
62
|
-
status:
|
|
63
|
+
children: t
|
|
64
|
+
}), /* @__PURE__ */ r(l, {
|
|
65
|
+
status: s
|
|
63
66
|
})]
|
|
64
67
|
});
|
|
65
68
|
}
|
|
66
|
-
return /* @__PURE__ */ c(
|
|
67
|
-
children: [/* @__PURE__ */
|
|
68
|
-
...
|
|
69
|
+
return /* @__PURE__ */ c(i, {
|
|
70
|
+
children: [/* @__PURE__ */ r(p, {
|
|
71
|
+
...m,
|
|
69
72
|
className: a,
|
|
70
73
|
style: {
|
|
71
74
|
padding: 4
|
|
72
75
|
},
|
|
73
|
-
children:
|
|
74
|
-
}), /* @__PURE__ */
|
|
76
|
+
children: t
|
|
77
|
+
}), /* @__PURE__ */ r(l, {
|
|
75
78
|
className: "-top-3 left-1",
|
|
76
|
-
status:
|
|
79
|
+
status: s
|
|
77
80
|
})]
|
|
78
81
|
});
|
|
79
82
|
};
|
package/dist/list/list.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface listProps {
|
|
|
7
7
|
itemRenderer: (itemProps: any, index: number) => ReactElement;
|
|
8
8
|
horizontal?: boolean;
|
|
9
9
|
footer?: ReactNode;
|
|
10
|
+
spaceBetween?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare const List: FunctionComponent<listProps>;
|
|
12
13
|
export interface TitledListProps extends listProps {
|
package/dist/list/list.mjs
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
1
|
import a from "../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs";
|
|
2
|
-
import { Link as
|
|
3
|
-
import { Article as
|
|
4
|
-
import { jsxs as k, jsx as
|
|
5
|
-
const p = (
|
|
2
|
+
import { Link as h } from "../link/Link.mjs";
|
|
3
|
+
import { Article as u } from "../article/Article.mjs";
|
|
4
|
+
import { jsxs as k, jsx as t } from "../_virtual/jsx-runtime.mjs";
|
|
5
|
+
const p = (n) => {
|
|
6
6
|
const {
|
|
7
|
-
items:
|
|
8
|
-
itemRenderer:
|
|
7
|
+
items: r,
|
|
8
|
+
itemRenderer: c,
|
|
9
9
|
className: s,
|
|
10
|
-
horizontal:
|
|
10
|
+
horizontal: e,
|
|
11
11
|
compact: d,
|
|
12
|
-
footer:
|
|
13
|
-
|
|
12
|
+
footer: i,
|
|
13
|
+
spaceBetween: l
|
|
14
|
+
} = n, m = d ? "" : e ? "mr-3" : "mb-16";
|
|
14
15
|
return /* @__PURE__ */ k("ul", {
|
|
15
16
|
className: a(s, "list-style-none", {
|
|
16
|
-
flex:
|
|
17
|
-
"items-center":
|
|
17
|
+
flex: e,
|
|
18
|
+
"items-center": e,
|
|
19
|
+
"flex flex-col justify-between": !e && i && l
|
|
18
20
|
}),
|
|
19
|
-
children: [
|
|
20
|
-
className: a(
|
|
21
|
-
"my-0!":
|
|
21
|
+
children: [r.map((o, f) => /* @__PURE__ */ t("li", {
|
|
22
|
+
className: a(m, "shrink-0", {
|
|
23
|
+
"my-0!": e
|
|
22
24
|
}),
|
|
23
|
-
children:
|
|
24
|
-
},
|
|
25
|
-
className: a(
|
|
26
|
-
"my-0!":
|
|
25
|
+
children: c(o, f)
|
|
26
|
+
}, o.id || f)), i && /* @__PURE__ */ t("li", {
|
|
27
|
+
className: a("shrink-0", {
|
|
28
|
+
"my-0!": e
|
|
27
29
|
}),
|
|
28
|
-
children:
|
|
30
|
+
children: i
|
|
29
31
|
}, "footer")]
|
|
30
32
|
});
|
|
31
|
-
},
|
|
33
|
+
}, L = (n) => {
|
|
32
34
|
const {
|
|
33
|
-
title:
|
|
34
|
-
description:
|
|
35
|
+
title: r,
|
|
36
|
+
description: c,
|
|
35
37
|
...s
|
|
36
|
-
} =
|
|
37
|
-
return
|
|
38
|
-
title:
|
|
39
|
-
description:
|
|
38
|
+
} = n;
|
|
39
|
+
return r ? /* @__PURE__ */ t(u, {
|
|
40
|
+
title: r,
|
|
41
|
+
description: c,
|
|
40
42
|
className: "w-fit",
|
|
41
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ t(p, {
|
|
42
44
|
...s
|
|
43
45
|
})
|
|
44
|
-
}) : /* @__PURE__ */
|
|
46
|
+
}) : /* @__PURE__ */ t(p, {
|
|
45
47
|
...s
|
|
46
48
|
});
|
|
47
|
-
},
|
|
49
|
+
}, w = (n) => {
|
|
48
50
|
const {
|
|
49
|
-
title:
|
|
50
|
-
description:
|
|
51
|
+
title: r,
|
|
52
|
+
description: c,
|
|
51
53
|
links: s,
|
|
52
|
-
...
|
|
53
|
-
} =
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
54
|
+
...e
|
|
55
|
+
} = n;
|
|
56
|
+
return /* @__PURE__ */ t(L, {
|
|
57
|
+
title: r,
|
|
58
|
+
description: c,
|
|
57
59
|
items: s,
|
|
58
60
|
itemRenderer: ({
|
|
59
|
-
name:
|
|
60
|
-
to:
|
|
61
|
-
external:
|
|
62
|
-
...
|
|
63
|
-
}) => /* @__PURE__ */
|
|
64
|
-
to:
|
|
65
|
-
external:
|
|
66
|
-
...
|
|
67
|
-
children:
|
|
68
|
-
},
|
|
69
|
-
...
|
|
61
|
+
name: i,
|
|
62
|
+
to: l,
|
|
63
|
+
external: m,
|
|
64
|
+
...o
|
|
65
|
+
}) => /* @__PURE__ */ t(h, {
|
|
66
|
+
to: l,
|
|
67
|
+
external: m,
|
|
68
|
+
...o,
|
|
69
|
+
children: i
|
|
70
|
+
}, i),
|
|
71
|
+
...e
|
|
70
72
|
});
|
|
71
73
|
};
|
|
72
74
|
export {
|
|
73
|
-
|
|
75
|
+
w as LinkList,
|
|
74
76
|
p as List,
|
|
75
|
-
|
|
77
|
+
L as TitledList
|
|
76
78
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"classnames": "2.3.1",
|
|
36
36
|
"phenomenon": "^1.6.0",
|
|
37
37
|
"react-hook-form": "7.54.2",
|
|
38
|
-
"@bbki.ng/stylebase": "3.0.
|
|
38
|
+
"@bbki.ng/stylebase": "3.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/core": "^7.18.9",
|