@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, withoutAbsolute, marginBottom }: DotsMenuProps): import("react/jsx-runtime").JSX.Element | null;
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 x from "react";
2
+ import * as u from "react";
3
3
  import { cn as a } from "../../../lib/utils.js";
4
- import { DropdownMenu as f, DropdownMenuTrigger as j, DropdownMenuContent as w, DropdownMenuItem as g } from "../dropdown-menu/dropdown-menu.js";
5
- import { Button as C } from "../button/button.js";
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 k } from "../tooltip/tooltip.js";
8
- const N = ({
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(k, { content: t, show: !r, children: /* @__PURE__ */ e.jsx("span", { className: "block w-full", children: n }) }), v = ({ column: r, icon: n = null, className: t, disabled: i = !1, withoutAbsolute: c = !1, marginBottom: l }) => {
13
- const [o, m] = x.useState(!1), h = (s) => {
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
- }, u = (s) => {
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
- "div",
23
- {
24
- className: a(
25
- "inline-flex",
26
- c ? "relative" : "absolute",
27
- t
28
- ),
29
- style: p,
30
- children: /* @__PURE__ */ e.jsxs(f, { open: o, onOpenChange: h, children: [
31
- /* @__PURE__ */ e.jsx(j, { asChild: !0, disabled: i, children: /* @__PURE__ */ e.jsx(
32
- C,
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
- disabled: i,
35
- variant: "ghost",
36
- size: "icon",
37
- className: "h-8 w-8 p-1",
38
- "aria-label": "more",
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
- /* @__PURE__ */ e.jsx(
56
- w,
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
- id: "dots-menu",
59
- align: "end",
60
- className: a("max-h-[216px] overflow-y-auto"),
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
- allowed: s.allowed ?? !0,
65
- children: /* @__PURE__ */ e.jsxs(
66
- g,
67
- {
68
- onClick: () => u(s),
69
- disabled: !s.allowed,
70
- className: "flex items-center gap-3.5 cursor-pointer",
71
- children: [
72
- /* @__PURE__ */ e.jsx(d, { name: s.icon, size: "sm", className: "shrink-0" }),
73
- /* @__PURE__ */ e.jsx("span", { children: s.name || String(s.key) })
74
- ]
75
- }
76
- )
77
- },
78
- s.key
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
- v.displayName = "DotsMenu";
81
+ N.displayName = "DotsMenu";
87
82
  export {
88
- v as DotsMenu
83
+ N as DotsMenu
89
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/dashboard-design-system",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",