@yuno-payments/dashboard-design-system 2.8.8 → 2.8.9
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/components/molecules/data-table-cells/data-table-icon-text-cell.d.ts +4 -1
- package/dist/components/molecules/data-table-cells/data-table-icon-text-cell.js +27 -26
- package/dist/index.esm.min.js +209 -209
- package/dist/index.umd.min.js +7 -7
- package/package.json +1 -1
- package/registry/components-registry.json +7 -7
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { IconName } from '../../atoms/icon';
|
|
2
3
|
export interface DataTableIconTextCellItem {
|
|
3
4
|
/** Item name/label */
|
|
4
5
|
name: string;
|
|
5
6
|
/** URL to the icon image */
|
|
6
|
-
|
|
7
|
+
src?: string;
|
|
8
|
+
/** Phosphor icon name (used when no `src` URL is provided) */
|
|
9
|
+
iconName?: IconName;
|
|
7
10
|
}
|
|
8
11
|
export interface DataTableIconTextCellProps {
|
|
9
12
|
/** Array of items to display (will be deduplicated by name) */
|
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { cn as N } from "../../../lib/utils.js";
|
|
4
|
+
import { Icon as t } from "../../atoms/icon/icon.js";
|
|
5
|
+
import { TooltipProvider as m, Tooltip as x, TooltipTrigger as d, TooltipContent as h } from "../../../vendor/shadcn/tooltip.js";
|
|
6
|
+
import { Badge as g } from "../../atoms/badge/badge.js";
|
|
7
|
+
const T = f(({ items: s, maxVisible: c = 1, emptyState: o = "-", className: p }, j) => {
|
|
8
|
+
if (!s || s.length === 0) return /* @__PURE__ */ e.jsx(e.Fragment, { children: o });
|
|
9
|
+
const i = /* @__PURE__ */ new Set(), n = s.filter((r) => !r.name || i.has(r.name) ? !1 : (i.add(r.name), !0));
|
|
10
|
+
if (n.length === 0) return /* @__PURE__ */ e.jsx(e.Fragment, { children: o });
|
|
11
|
+
const u = n.slice(0, c), a = n.slice(c);
|
|
11
12
|
return /* @__PURE__ */ e.jsxs(
|
|
12
13
|
"div",
|
|
13
14
|
{
|
|
14
|
-
ref:
|
|
15
|
-
className:
|
|
15
|
+
ref: j,
|
|
16
|
+
className: N("flex items-center gap-2", p),
|
|
16
17
|
children: [
|
|
17
|
-
|
|
18
|
-
r.
|
|
18
|
+
u.map((r) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
19
|
+
r.src ? /* @__PURE__ */ e.jsx(
|
|
19
20
|
"img",
|
|
20
21
|
{
|
|
21
|
-
src: r.
|
|
22
|
+
src: r.src,
|
|
22
23
|
alt: r.name,
|
|
23
24
|
className: "h-4 w-4 shrink-0 object-contain",
|
|
24
25
|
onError: (l) => {
|
|
25
26
|
l.currentTarget.style.display = "none";
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
),
|
|
29
|
-
/* @__PURE__ */ e.jsx(
|
|
30
|
-
/* @__PURE__ */ e.jsx(
|
|
31
|
-
/* @__PURE__ */ e.jsx(
|
|
29
|
+
) : r.iconName ? /* @__PURE__ */ e.jsx(t, { name: r.iconName, size: "sm", className: "shrink-0" }) : null,
|
|
30
|
+
/* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsxs(x, { children: [
|
|
31
|
+
/* @__PURE__ */ e.jsx(d, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "truncate text-sm", children: r.name }) }),
|
|
32
|
+
/* @__PURE__ */ e.jsx(h, { children: /* @__PURE__ */ e.jsx("p", { children: r.name }) })
|
|
32
33
|
] }) })
|
|
33
34
|
] }, r.name)),
|
|
34
|
-
a.length > 0 && /* @__PURE__ */ e.jsx(
|
|
35
|
-
/* @__PURE__ */ e.jsx(
|
|
36
|
-
|
|
35
|
+
a.length > 0 && /* @__PURE__ */ e.jsx(m, { delayDuration: 0, children: /* @__PURE__ */ e.jsxs(x, { children: [
|
|
36
|
+
/* @__PURE__ */ e.jsx(d, { className: "shrink-0", children: /* @__PURE__ */ e.jsxs(
|
|
37
|
+
g,
|
|
37
38
|
{
|
|
38
39
|
variant: "outline",
|
|
39
40
|
className: "text-xs cursor-pointer hover:border-primary hover:text-primary",
|
|
@@ -43,22 +44,22 @@ const N = f(({ items: n, maxVisible: c = 1, emptyState: t = "-", className: h },
|
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
) }),
|
|
46
|
-
/* @__PURE__ */ e.jsx(
|
|
47
|
+
/* @__PURE__ */ e.jsx(h, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: a.map((r) => /* @__PURE__ */ e.jsxs(
|
|
47
48
|
"div",
|
|
48
49
|
{
|
|
49
50
|
className: "flex items-center gap-3",
|
|
50
51
|
children: [
|
|
51
|
-
r.
|
|
52
|
+
r.src ? /* @__PURE__ */ e.jsx(
|
|
52
53
|
"img",
|
|
53
54
|
{
|
|
54
|
-
src: r.
|
|
55
|
+
src: r.src,
|
|
55
56
|
alt: r.name,
|
|
56
57
|
className: "h-4 w-4 object-contain",
|
|
57
58
|
onError: (l) => {
|
|
58
59
|
l.currentTarget.style.display = "none";
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
),
|
|
62
|
+
) : r.iconName ? /* @__PURE__ */ e.jsx(t, { name: r.iconName, size: "sm" }) : null,
|
|
62
63
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: r.name })
|
|
63
64
|
]
|
|
64
65
|
},
|
|
@@ -69,7 +70,7 @@ const N = f(({ items: n, maxVisible: c = 1, emptyState: t = "-", className: h },
|
|
|
69
70
|
}
|
|
70
71
|
);
|
|
71
72
|
});
|
|
72
|
-
|
|
73
|
+
T.displayName = "DataTableIconTextCell";
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
T as DataTableIconTextCell
|
|
75
76
|
};
|