@yuno-payments/dashboard-design-system 0.0.55 → 0.0.56
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DotsMenuProps } from './dots-menu.types';
|
|
2
2
|
export declare const DotsMenu: {
|
|
3
|
-
({ column, icon, className, disabled,
|
|
3
|
+
({ column, icon, className, disabled, marginBottom, }: DotsMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1,89 +1,84 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as u from "react";
|
|
3
3
|
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
-
import { DropdownMenu as
|
|
5
|
-
import { Button as
|
|
4
|
+
import { DropdownMenu as x, DropdownMenuTrigger as f, DropdownMenuContent as j, DropdownMenuItem as w } from "../dropdown-menu/dropdown-menu.js";
|
|
5
|
+
import { Button as g } from "../button/button.js";
|
|
6
6
|
import { Icon as d } from "../icon/icon.js";
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
const
|
|
7
|
+
import { Tooltip as C } from "../tooltip/tooltip.js";
|
|
8
|
+
const k = ({
|
|
9
9
|
allowed: r,
|
|
10
10
|
children: n,
|
|
11
11
|
message: t = "You don't have permission to perform this action"
|
|
12
|
-
}) => r ? /* @__PURE__ */ e.jsx(e.Fragment, { children: n }) : /* @__PURE__ */ e.jsx(
|
|
13
|
-
|
|
12
|
+
}) => r ? /* @__PURE__ */ e.jsx(e.Fragment, { children: n }) : /* @__PURE__ */ e.jsx(C, { content: t, show: !r, children: /* @__PURE__ */ e.jsx("span", { className: "block w-full", children: n }) }), N = ({
|
|
13
|
+
column: r,
|
|
14
|
+
icon: n = null,
|
|
15
|
+
className: t,
|
|
16
|
+
disabled: i = !1,
|
|
17
|
+
marginBottom: l
|
|
18
|
+
}) => {
|
|
19
|
+
const [o, m] = u.useState(!1), c = (s) => {
|
|
14
20
|
m(s);
|
|
15
|
-
},
|
|
21
|
+
}, h = (s) => {
|
|
16
22
|
s.allowed && s.handleClick && s.handleClick(r), m(!1);
|
|
17
23
|
};
|
|
18
24
|
if (!r.actions || r.actions.length === 0)
|
|
19
25
|
return null;
|
|
20
26
|
const p = {};
|
|
21
|
-
return l !== void 0 && (p.marginBottom = `${l}px`), /* @__PURE__ */ e.jsx(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
return l !== void 0 && (p.marginBottom = `${l}px`), /* @__PURE__ */ e.jsx("div", { className: a("inline-flex relative", t), style: p, children: /* @__PURE__ */ e.jsxs(x, { open: o, onOpenChange: c, children: [
|
|
28
|
+
/* @__PURE__ */ e.jsx(f, { asChild: !0, disabled: i, children: /* @__PURE__ */ e.jsx(
|
|
29
|
+
g,
|
|
30
|
+
{
|
|
31
|
+
disabled: i,
|
|
32
|
+
variant: "ghost",
|
|
33
|
+
size: "icon",
|
|
34
|
+
className: "h-8 w-8 p-1",
|
|
35
|
+
"aria-label": "more",
|
|
36
|
+
"aria-controls": o ? "dots-menu" : void 0,
|
|
37
|
+
"aria-expanded": o,
|
|
38
|
+
"aria-haspopup": "true",
|
|
39
|
+
children: /* @__PURE__ */ e.jsx(
|
|
40
|
+
d,
|
|
33
41
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"aria-controls": o ? "dots-menu" : void 0,
|
|
40
|
-
"aria-expanded": o,
|
|
41
|
-
"aria-haspopup": "true",
|
|
42
|
-
children: /* @__PURE__ */ e.jsx(
|
|
43
|
-
d,
|
|
44
|
-
{
|
|
45
|
-
name: n || "DotsThreeCircleVertical",
|
|
46
|
-
size: "sm",
|
|
47
|
-
className: a(
|
|
48
|
-
"transition-colors",
|
|
49
|
-
o ? "text-primary" : "text-muted-foreground"
|
|
50
|
-
)
|
|
51
|
-
}
|
|
42
|
+
name: n || "DotsThreeCircleVertical",
|
|
43
|
+
size: "sm",
|
|
44
|
+
className: a(
|
|
45
|
+
"transition-colors",
|
|
46
|
+
o ? "text-primary" : "text-muted-foreground"
|
|
52
47
|
)
|
|
53
48
|
}
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
) }),
|
|
52
|
+
/* @__PURE__ */ e.jsx(
|
|
53
|
+
j,
|
|
54
|
+
{
|
|
55
|
+
id: "dots-menu",
|
|
56
|
+
align: "end",
|
|
57
|
+
className: a("max-h-[216px] overflow-y-auto"),
|
|
58
|
+
children: r.actions.map((s) => /* @__PURE__ */ e.jsx(
|
|
59
|
+
k,
|
|
57
60
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
children: r.actions.map((s) => /* @__PURE__ */ e.jsx(
|
|
62
|
-
N,
|
|
61
|
+
allowed: s.allowed ?? !0,
|
|
62
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
63
|
+
w,
|
|
63
64
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
))
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
] })
|
|
83
|
-
}
|
|
84
|
-
);
|
|
65
|
+
onClick: () => h(s),
|
|
66
|
+
disabled: !s.allowed,
|
|
67
|
+
className: "flex items-center gap-3.5 cursor-pointer",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ e.jsx(d, { name: s.icon, size: "sm", className: "shrink-0" }),
|
|
70
|
+
/* @__PURE__ */ e.jsx("span", { children: s.name || String(s.key) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
},
|
|
75
|
+
s.key
|
|
76
|
+
))
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] }) });
|
|
85
80
|
};
|
|
86
|
-
|
|
81
|
+
N.displayName = "DotsMenu";
|
|
87
82
|
export {
|
|
88
|
-
|
|
83
|
+
N as DotsMenu
|
|
89
84
|
};
|