@yuno-payments/dashboard-design-system 2.8.3 → 2.8.5
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-copy-cell.d.ts +1 -1
- package/dist/components/molecules/data-table-cells/data-table-copy-cell.js +26 -26
- package/dist/components/organisms/data-table/components/cells/data-table-list-cell.d.ts +1 -0
- package/dist/components/organisms/data-table/components/cells/data-table-list-cell.js +33 -27
- package/dist/dashboard-design-system.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.esm.min.js +10 -4
- package/dist/index.umd.min.js +2 -2
- package/package.json +1 -1
- package/registry/components-registry.json +3 -3
|
@@ -25,7 +25,7 @@ export interface DataTableCopyCellProps {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* A table cell that displays a text value with a copy-to-clipboard button.
|
|
28
|
-
* The copy button
|
|
28
|
+
* The copy button is always visible. Supports optional navigation links
|
|
29
29
|
* and start icons (e.g., test credential indicators).
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { forwardRef as y } from "react";
|
|
3
3
|
import { cn as g } from "../../../lib/utils.js";
|
|
4
|
-
import { Icon as
|
|
4
|
+
import { Icon as d } from "../../atoms/icon/icon.js";
|
|
5
5
|
import { TooltipProvider as i, Tooltip as o, TooltipTrigger as n, TooltipContent as l } from "../../../vendor/shadcn/tooltip.js";
|
|
6
6
|
import { useCopyToClipboard as N } from "../../../hooks/use-copy-to-clipboard.js";
|
|
7
7
|
const b = y(
|
|
8
8
|
({
|
|
9
|
-
value:
|
|
9
|
+
value: r,
|
|
10
10
|
linkTo: t,
|
|
11
11
|
startIcon: a,
|
|
12
12
|
startIconTooltip: c,
|
|
13
|
-
copyTooltip:
|
|
13
|
+
copyTooltip: p = "Copy",
|
|
14
14
|
onCopySuccess: m,
|
|
15
|
-
onCopyError:
|
|
16
|
-
emptyState:
|
|
15
|
+
onCopyError: x,
|
|
16
|
+
emptyState: h = "-",
|
|
17
17
|
className: j
|
|
18
18
|
}, C) => {
|
|
19
19
|
const { copyToClipboard: f } = N({
|
|
20
20
|
onSuccess: m,
|
|
21
|
-
onError:
|
|
21
|
+
onError: x
|
|
22
22
|
});
|
|
23
|
-
if (!
|
|
23
|
+
if (!r) return /* @__PURE__ */ e.jsx(e.Fragment, { children: h });
|
|
24
24
|
const u = (s) => {
|
|
25
|
-
s.stopPropagation(), f(
|
|
25
|
+
s.stopPropagation(), f(r);
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ e.jsxs(
|
|
28
28
|
"div",
|
|
29
29
|
{
|
|
30
30
|
ref: C,
|
|
31
|
-
className: g("
|
|
31
|
+
className: g("flex items-center gap-2 w-full", j),
|
|
32
32
|
children: [
|
|
33
|
-
a && /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
33
|
+
a && /* @__PURE__ */ e.jsx(i, { children: /* @__PURE__ */ e.jsxs(o, { children: [
|
|
34
|
+
/* @__PURE__ */ e.jsx(n, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "shrink-0 inline-flex", children: /* @__PURE__ */ e.jsx(
|
|
35
|
+
d,
|
|
36
36
|
{
|
|
37
37
|
name: a,
|
|
38
38
|
weight: "fill",
|
|
@@ -40,29 +40,29 @@ const b = y(
|
|
|
40
40
|
className: "text-primary"
|
|
41
41
|
}
|
|
42
42
|
) }) }),
|
|
43
|
-
c && /* @__PURE__ */
|
|
43
|
+
c && /* @__PURE__ */ e.jsx(l, { children: /* @__PURE__ */ e.jsx("p", { children: c }) })
|
|
44
44
|
] }) }),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ e.jsx(i, { children: /* @__PURE__ */ e.jsxs(o, { children: [
|
|
46
|
+
/* @__PURE__ */ e.jsx(n, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "truncate text-sm", children: t ? /* @__PURE__ */ e.jsx(
|
|
47
47
|
"a",
|
|
48
48
|
{
|
|
49
49
|
href: t,
|
|
50
50
|
className: "text-primary hover:underline",
|
|
51
51
|
onClick: (s) => s.stopPropagation(),
|
|
52
|
-
children:
|
|
52
|
+
children: r
|
|
53
53
|
}
|
|
54
|
-
) :
|
|
55
|
-
/* @__PURE__ */
|
|
54
|
+
) : r }) }),
|
|
55
|
+
/* @__PURE__ */ e.jsx(l, { children: /* @__PURE__ */ e.jsx("p", { children: r }) })
|
|
56
56
|
] }) }),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ e.jsx(i, { children: /* @__PURE__ */ e.jsxs(o, { children: [
|
|
58
|
+
/* @__PURE__ */ e.jsx(n, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
61
|
type: "button",
|
|
62
|
-
className: "shrink-0
|
|
62
|
+
className: "shrink-0 p-1 hover:bg-muted rounded",
|
|
63
63
|
onClick: u,
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
|
|
64
|
+
children: /* @__PURE__ */ e.jsx(
|
|
65
|
+
d,
|
|
66
66
|
{
|
|
67
67
|
name: "CopySimple",
|
|
68
68
|
size: "sm",
|
|
@@ -71,7 +71,7 @@ const b = y(
|
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
) }),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ e.jsx(l, { children: /* @__PURE__ */ e.jsx("p", { children: p }) })
|
|
75
75
|
] }) })
|
|
76
76
|
]
|
|
77
77
|
}
|
|
@@ -37,6 +37,7 @@ export interface DataTableListCellProps {
|
|
|
37
37
|
/**
|
|
38
38
|
* Table cell component for displaying a list of items with badges.
|
|
39
39
|
* Shows first item and remaining count with tooltip.
|
|
40
|
+
* Item icons that fail to load are hidden automatically.
|
|
40
41
|
*
|
|
41
42
|
* @example
|
|
42
43
|
* ```tsx
|
|
@@ -1,59 +1,65 @@
|
|
|
1
1
|
import { j as e } from "../../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
3
|
import { cn as f } from "../../../../../lib/utils.js";
|
|
4
4
|
import { TooltipProvider as c, Tooltip as i, TooltipTrigger as o, TooltipContent as m } from "../../../../../vendor/shadcn/tooltip.js";
|
|
5
|
-
import { Badge as
|
|
6
|
-
const
|
|
7
|
-
({ items: n, maxLength: a = 7, showRemainingCount:
|
|
5
|
+
import { Badge as N } from "../../../../atoms/badge/badge.js";
|
|
6
|
+
const T = g(
|
|
7
|
+
({ items: n, maxLength: a = 7, showRemainingCount: d = !0, className: x }, p) => {
|
|
8
8
|
if (!n || n.length === 0) return null;
|
|
9
|
-
const
|
|
9
|
+
const r = n[0], t = n.slice(1), l = r.name.length > a && a > 0, h = l ? `${r.name.slice(0, a)}...` : r.name;
|
|
10
10
|
return /* @__PURE__ */ e.jsxs(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
-
ref:
|
|
14
|
-
className: f("flex items-center gap-2 h-[46px]",
|
|
13
|
+
ref: p,
|
|
14
|
+
className: f("flex items-center gap-2 h-[46px]", x),
|
|
15
15
|
children: [
|
|
16
|
-
|
|
16
|
+
r.icon && /* @__PURE__ */ e.jsx(
|
|
17
17
|
"img",
|
|
18
18
|
{
|
|
19
|
-
src:
|
|
20
|
-
alt:
|
|
21
|
-
className: "h-4 w-4 object-contain"
|
|
19
|
+
src: r.icon,
|
|
20
|
+
alt: r.name,
|
|
21
|
+
className: "h-4 w-4 object-contain",
|
|
22
|
+
onError: (s) => {
|
|
23
|
+
s.currentTarget.style.display = "none";
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
),
|
|
24
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1", children:
|
|
25
|
-
/* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm cursor-help", children:
|
|
26
|
-
/* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx("p", { children:
|
|
27
|
-
] }) }) : /* @__PURE__ */ e.jsx("span", { className: "text-sm", children:
|
|
28
|
-
|
|
27
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1", children: l ? /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsxs(i, { children: [
|
|
28
|
+
/* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "text-sm cursor-help", children: h }) }),
|
|
29
|
+
/* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx("p", { children: r.name }) })
|
|
30
|
+
] }) }) : /* @__PURE__ */ e.jsx("span", { className: "text-sm", children: r.name }) }),
|
|
31
|
+
t.length > 0 && d && /* @__PURE__ */ e.jsx(c, { children: /* @__PURE__ */ e.jsxs(i, { children: [
|
|
29
32
|
/* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
30
|
-
|
|
33
|
+
N,
|
|
31
34
|
{
|
|
32
35
|
variant: "outline",
|
|
33
36
|
className: "h-3 px-1 text-[8px] leading-none cursor-pointer hover:border-primary hover:text-primary",
|
|
34
37
|
children: [
|
|
35
38
|
"+",
|
|
36
|
-
|
|
39
|
+
t.length
|
|
37
40
|
]
|
|
38
41
|
}
|
|
39
42
|
) }),
|
|
40
|
-
/* @__PURE__ */ e.jsx(m, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children:
|
|
43
|
+
/* @__PURE__ */ e.jsx(m, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: t.map((s, j) => /* @__PURE__ */ e.jsxs(
|
|
41
44
|
"div",
|
|
42
45
|
{
|
|
43
46
|
className: "flex items-center gap-3",
|
|
44
47
|
children: [
|
|
45
|
-
|
|
48
|
+
s.icon && /* @__PURE__ */ e.jsx(
|
|
46
49
|
"img",
|
|
47
50
|
{
|
|
48
|
-
src:
|
|
49
|
-
alt:
|
|
50
|
-
className: "h-4 w-4 object-contain"
|
|
51
|
+
src: s.icon,
|
|
52
|
+
alt: s.name,
|
|
53
|
+
className: "h-4 w-4 object-contain",
|
|
54
|
+
onError: (u) => {
|
|
55
|
+
u.currentTarget.style.display = "none";
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
),
|
|
53
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-foreground", children:
|
|
59
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-foreground", children: s.name })
|
|
54
60
|
]
|
|
55
61
|
},
|
|
56
|
-
`${
|
|
62
|
+
`${s.name}-${j}`
|
|
57
63
|
)) }) })
|
|
58
64
|
] }) })
|
|
59
65
|
]
|
|
@@ -61,7 +67,7 @@ const N = u(
|
|
|
61
67
|
);
|
|
62
68
|
}
|
|
63
69
|
);
|
|
64
|
-
|
|
70
|
+
T.displayName = "DataTableListCell";
|
|
65
71
|
export {
|
|
66
|
-
|
|
72
|
+
T as DataTableListCell
|
|
67
73
|
};
|