@yuno-payments/dashboard-design-system 2.8.1 → 2.8.3

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.
Files changed (22) hide show
  1. package/dist/components/molecules/data-table-cells/data-table-amount-cell.d.ts +3 -0
  2. package/dist/components/molecules/data-table-cells/data-table-amount-cell.js +15 -14
  3. package/dist/components/molecules/data-table-cells/data-table-copy-cell.d.ts +3 -0
  4. package/dist/components/molecules/data-table-cells/data-table-copy-cell.js +21 -20
  5. package/dist/components/molecules/data-table-cells/data-table-country-cell.d.ts +3 -0
  6. package/dist/components/molecules/data-table-cells/data-table-country-cell.js +30 -20
  7. package/dist/components/molecules/data-table-cells/data-table-date-cell.d.ts +1 -1
  8. package/dist/components/molecules/data-table-cells/data-table-date-cell.js +5 -5
  9. package/dist/components/molecules/data-table-cells/data-table-icon-text-cell.d.ts +3 -0
  10. package/dist/components/molecules/data-table-cells/data-table-icon-text-cell.js +21 -21
  11. package/dist/components/molecules/data-table-cells/data-table-percentage-cell.d.ts +3 -0
  12. package/dist/components/molecules/data-table-cells/data-table-percentage-cell.js +32 -24
  13. package/dist/components/molecules/data-table-cells/data-table-status-cell.d.ts +3 -0
  14. package/dist/components/molecules/data-table-cells/data-table-status-cell.js +26 -18
  15. package/dist/components/molecules/data-table-cells/data-table-tags-cell.d.ts +3 -0
  16. package/dist/components/molecules/data-table-cells/data-table-tags-cell.js +24 -18
  17. package/dist/components/molecules/data-table-cells/data-table-text-cell.d.ts +1 -2
  18. package/dist/components/molecules/data-table-cells/data-table-text-cell.js +6 -6
  19. package/dist/index.esm.min.js +1756 -1722
  20. package/dist/index.umd.min.js +10 -10
  21. package/package.json +1 -1
  22. package/registry/components-registry.json +53 -4
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  /**
2
3
  * Props for the DataTableAmountCell component
3
4
  */
@@ -12,6 +13,8 @@ export interface DataTableAmountCellProps {
12
13
  size?: "xs" | "sm" | "base";
13
14
  /** Whether to show the currency code @default true */
14
15
  showCurrencyCode?: boolean;
16
+ /** Content to render when value is empty/NaN @default "-" */
17
+ emptyState?: ReactNode;
15
18
  /** Additional CSS classes */
16
19
  className?: string;
17
20
  }
@@ -1,27 +1,28 @@
1
- import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as n } from "react";
3
- import { cn as s } from "../../../lib/utils.js";
4
- import { CurrencyField as f } from "../../atoms/currency-field/currency-field.js";
5
- const u = n(
1
+ import { j as r } from "../../../_virtual/jsx-runtime.js";
2
+ import { forwardRef as s } from "react";
3
+ import { cn as f } from "../../../lib/utils.js";
4
+ import { CurrencyField as x } from "../../atoms/currency-field/currency-field.js";
5
+ const p = s(
6
6
  ({
7
- value: r,
7
+ value: e,
8
8
  currency: t = "USD",
9
9
  locales: m,
10
10
  size: o = "xs",
11
- showCurrencyCode: l = !0,
12
- className: a
13
- }, i) => r == null || Number.isNaN(r) ? null : /* @__PURE__ */ e.jsx("div", { ref: i, className: s("flex", a), children: /* @__PURE__ */ e.jsx(
14
- f,
11
+ showCurrencyCode: a = !0,
12
+ emptyState: i = "-",
13
+ className: l
14
+ }, n) => e == null || Number.isNaN(e) ? /* @__PURE__ */ r.jsx(r.Fragment, { children: i }) : /* @__PURE__ */ r.jsx("div", { ref: n, className: f("flex", l), children: /* @__PURE__ */ r.jsx(
15
+ x,
15
16
  {
16
- value: r,
17
+ value: e,
17
18
  currency: t,
18
19
  locales: m,
19
20
  size: o,
20
- showCurrencyCode: l
21
+ showCurrencyCode: a
21
22
  }
22
23
  ) })
23
24
  );
24
- u.displayName = "DataTableAmountCell";
25
+ p.displayName = "DataTableAmountCell";
25
26
  export {
26
- u as DataTableAmountCell
27
+ p as DataTableAmountCell
27
28
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { IconName } from '../../atoms/icon';
2
3
  /**
3
4
  * Props for the DataTableCopyCell component
@@ -17,6 +18,8 @@ export interface DataTableCopyCellProps {
17
18
  onCopySuccess?: () => void;
18
19
  /** Custom callback on copy error */
19
20
  onCopyError?: () => void;
21
+ /** Content to render when value is empty @default "-" */
22
+ emptyState?: ReactNode;
20
23
  /** Additional CSS classes */
21
24
  className?: string;
22
25
  }
@@ -1,37 +1,38 @@
1
1
  import { j as r } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as f } from "react";
3
- import { cn as y } from "../../../lib/utils.js";
4
- import { Icon as c } from "../../atoms/icon/icon.js";
2
+ import { forwardRef as y } from "react";
3
+ import { cn as g } from "../../../lib/utils.js";
4
+ import { Icon as p } 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
- import { useCopyToClipboard as g } from "../../../hooks/use-copy-to-clipboard.js";
7
- const N = f(
6
+ import { useCopyToClipboard as N } from "../../../hooks/use-copy-to-clipboard.js";
7
+ const b = y(
8
8
  ({
9
9
  value: e,
10
10
  linkTo: t,
11
11
  startIcon: a,
12
- startIconTooltip: p,
12
+ startIconTooltip: c,
13
13
  copyTooltip: d = "Copy",
14
14
  onCopySuccess: m,
15
15
  onCopyError: h,
16
- className: x
17
- }, j) => {
18
- const { copyToClipboard: u } = g({
16
+ emptyState: x = "-",
17
+ className: j
18
+ }, C) => {
19
+ const { copyToClipboard: f } = N({
19
20
  onSuccess: m,
20
21
  onError: h
21
22
  });
22
- if (!e) return null;
23
- const C = (s) => {
24
- s.stopPropagation(), u(e);
23
+ if (!e) return /* @__PURE__ */ r.jsx(r.Fragment, { children: x });
24
+ const u = (s) => {
25
+ s.stopPropagation(), f(e);
25
26
  };
26
27
  return /* @__PURE__ */ r.jsxs(
27
28
  "div",
28
29
  {
29
- ref: j,
30
- className: y("group flex items-center gap-2 w-full", x),
30
+ ref: C,
31
+ className: g("group flex items-center gap-2 w-full", j),
31
32
  children: [
32
33
  a && /* @__PURE__ */ r.jsx(i, { children: /* @__PURE__ */ r.jsxs(o, { children: [
33
34
  /* @__PURE__ */ r.jsx(n, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "shrink-0 inline-flex", children: /* @__PURE__ */ r.jsx(
34
- c,
35
+ p,
35
36
  {
36
37
  name: a,
37
38
  weight: "fill",
@@ -39,7 +40,7 @@ const N = f(
39
40
  className: "text-primary"
40
41
  }
41
42
  ) }) }),
42
- p && /* @__PURE__ */ r.jsx(l, { children: /* @__PURE__ */ r.jsx("p", { children: p }) })
43
+ c && /* @__PURE__ */ r.jsx(l, { children: /* @__PURE__ */ r.jsx("p", { children: c }) })
43
44
  ] }) }),
44
45
  /* @__PURE__ */ r.jsx(i, { children: /* @__PURE__ */ r.jsxs(o, { children: [
45
46
  /* @__PURE__ */ r.jsx(n, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "truncate text-sm", children: t ? /* @__PURE__ */ r.jsx(
@@ -59,9 +60,9 @@ const N = f(
59
60
  {
60
61
  type: "button",
61
62
  className: "shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-muted rounded",
62
- onClick: C,
63
+ onClick: u,
63
64
  children: /* @__PURE__ */ r.jsx(
64
- c,
65
+ p,
65
66
  {
66
67
  name: "CopySimple",
67
68
  size: "sm",
@@ -77,7 +78,7 @@ const N = f(
77
78
  );
78
79
  }
79
80
  );
80
- N.displayName = "DataTableCopyCell";
81
+ b.displayName = "DataTableCopyCell";
81
82
  export {
82
- N as DataTableCopyCell
83
+ b as DataTableCopyCell
83
84
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface DataTableCountryCellProps {
2
3
  /** ISO 3166-1 alpha-2 country code (e.g., "US", "CO", "BR") */
3
4
  code: string | null | undefined;
@@ -7,6 +8,8 @@ export interface DataTableCountryCellProps {
7
8
  showName?: boolean;
8
9
  /** Custom function to resolve country name from code */
9
10
  getCountryName?: (code: string) => string;
11
+ /** Content to render when code is empty/invalid @default "-" */
12
+ emptyState?: ReactNode;
10
13
  /** Additional CSS classes */
11
14
  className?: string;
12
15
  }
@@ -1,37 +1,47 @@
1
- import { j as r } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as m } from "react";
1
+ import { j as t } from "../../../_virtual/jsx-runtime.js";
2
+ import { forwardRef as x } from "react";
3
3
  import { cn as f } from "../../../lib/utils.js";
4
- import { TooltipProvider as u, Tooltip as x, TooltipTrigger as d, TooltipContent as h } from "../../../vendor/shadcn/tooltip.js";
5
- const j = (t) => !t || typeof t != "string" ? t : typeof String.fromCodePoint < "u" ? t.toUpperCase().replace(
6
- /./g,
7
- (n) => String.fromCodePoint(n.charCodeAt(0) + 127397)
8
- ) : t, T = m(
9
- ({ code: t, showFlag: n = !0, showName: o = !1, getCountryName: s, className: a }, i) => {
10
- if (!t) return null;
11
- const e = n ? j(t) : null, l = s ? s(t) : null, p = o && l ? l : t.toUpperCase(), c = l ?? t.toUpperCase();
12
- return /* @__PURE__ */ r.jsx(u, { children: /* @__PURE__ */ r.jsxs(x, { children: [
13
- /* @__PURE__ */ r.jsx(d, { asChild: !0, children: /* @__PURE__ */ r.jsxs(
4
+ import { TooltipProvider as u, Tooltip as d, TooltipTrigger as h, TooltipContent as j } from "../../../vendor/shadcn/tooltip.js";
5
+ const T = (r) => {
6
+ if (typeof r != "string") return "";
7
+ const e = r.trim().toUpperCase();
8
+ return /^[A-Z]{2}$/.test(e) ? String.fromCodePoint(
9
+ ...[...e].map((s) => s.charCodeAt(0) + 127397)
10
+ ) : "";
11
+ }, C = x(
12
+ ({
13
+ code: r,
14
+ showFlag: e = !0,
15
+ showName: s = !1,
16
+ getCountryName: l,
17
+ emptyState: i = "-",
18
+ className: a
19
+ }, p) => {
20
+ if (!r) return /* @__PURE__ */ t.jsx(t.Fragment, { children: i });
21
+ const n = e ? T(r) : null, o = l ? l(r) : null, c = s && o ? o : r.toUpperCase(), m = o ?? r.toUpperCase();
22
+ return /* @__PURE__ */ t.jsx(u, { children: /* @__PURE__ */ t.jsxs(d, { children: [
23
+ /* @__PURE__ */ t.jsx(h, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
14
24
  "div",
15
25
  {
16
- ref: i,
26
+ ref: p,
17
27
  className: f(
18
28
  "flex items-center gap-1 truncate text-sm",
19
29
  a
20
30
  ),
21
31
  children: [
22
- e && /* @__PURE__ */ r.jsx("span", { className: "shrink-0", children: e }),
23
- /* @__PURE__ */ r.jsx("span", { className: "truncate", children: p })
32
+ n && /* @__PURE__ */ t.jsx("span", { className: "shrink-0", children: n }),
33
+ /* @__PURE__ */ t.jsx("span", { className: "truncate", children: c })
24
34
  ]
25
35
  }
26
36
  ) }),
27
- /* @__PURE__ */ r.jsx(h, { children: /* @__PURE__ */ r.jsxs("p", { children: [
28
- e && `${e} `,
29
- c
37
+ /* @__PURE__ */ t.jsx(j, { children: /* @__PURE__ */ t.jsxs("p", { children: [
38
+ n && `${n} `,
39
+ m
30
40
  ] }) })
31
41
  ] }) });
32
42
  }
33
43
  );
34
- T.displayName = "DataTableCountryCell";
44
+ C.displayName = "DataTableCountryCell";
35
45
  export {
36
- T as DataTableCountryCell
46
+ C as DataTableCountryCell
37
47
  };
@@ -3,7 +3,7 @@ export interface DataTableDateCellProps {
3
3
  value: string | Date | null | undefined;
4
4
  /** Custom date formatter. If not provided, uses Intl.DateTimeFormat with date and time */
5
5
  formatFn?: (date: string | Date) => string;
6
- /** Content to render when value is falsy @default null */
6
+ /** Content to render when value is falsy @default "-" */
7
7
  emptyState?: React.ReactNode;
8
8
  /** Additional CSS classes */
9
9
  className?: string;
@@ -1,7 +1,7 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
2
  import { forwardRef as s } from "react";
3
- import { cn as l } from "../../../lib/utils.js";
4
- import { TooltipProvider as m, Tooltip as c, TooltipTrigger as d, TooltipContent as f } from "../../../vendor/shadcn/tooltip.js";
3
+ import { cn as m } from "../../../lib/utils.js";
4
+ import { TooltipProvider as l, Tooltip as c, TooltipTrigger as d, TooltipContent as f } from "../../../vendor/shadcn/tooltip.js";
5
5
  const h = (r) => {
6
6
  try {
7
7
  const e = typeof r == "string" ? new Date(r) : r;
@@ -19,11 +19,11 @@ const h = (r) => {
19
19
  return String(r);
20
20
  }
21
21
  }, p = s(
22
- ({ value: r, formatFn: e, emptyState: i = null, className: n }, a) => {
22
+ ({ value: r, formatFn: e, emptyState: i = "-", className: n }, a) => {
23
23
  if (!r) return /* @__PURE__ */ t.jsx(t.Fragment, { children: i });
24
24
  const o = (e ?? h)(r);
25
- return /* @__PURE__ */ t.jsx(m, { children: /* @__PURE__ */ t.jsxs(c, { children: [
26
- /* @__PURE__ */ t.jsx(d, { asChild: !0, children: /* @__PURE__ */ t.jsx("div", { ref: a, className: l("truncate text-sm", n), children: o }) }),
25
+ return /* @__PURE__ */ t.jsx(l, { children: /* @__PURE__ */ t.jsxs(c, { children: [
26
+ /* @__PURE__ */ t.jsx(d, { asChild: !0, children: /* @__PURE__ */ t.jsx("div", { ref: a, className: m("truncate text-sm", n), children: o }) }),
27
27
  /* @__PURE__ */ t.jsx(f, { children: /* @__PURE__ */ t.jsx("p", { children: o }) })
28
28
  ] }) });
29
29
  }
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface DataTableIconTextCellItem {
2
3
  /** Item name/label */
3
4
  name: string;
@@ -9,6 +10,8 @@ export interface DataTableIconTextCellProps {
9
10
  items: DataTableIconTextCellItem[];
10
11
  /** Maximum number of visible items @default 1 */
11
12
  maxVisible?: number;
13
+ /** Content to render when items is empty @default "-" */
14
+ emptyState?: ReactNode;
12
15
  /** Additional CSS classes */
13
16
  className?: string;
14
17
  }
@@ -1,20 +1,20 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as j } from "react";
3
- import { cn as u } from "../../../lib/utils.js";
4
- import { TooltipProvider as o, Tooltip as i, TooltipTrigger as d, TooltipContent as m } from "../../../vendor/shadcn/tooltip.js";
5
- import { Badge as f } from "../../atoms/badge/badge.js";
6
- const g = j(({ items: n, maxVisible: c = 1, className: x }, h) => {
7
- if (!n || n.length === 0) return null;
8
- const t = /* @__PURE__ */ new Set(), s = n.filter((r) => !r.name || t.has(r.name) ? !1 : (t.add(r.name), !0));
9
- if (s.length === 0) return null;
10
- const p = s.slice(0, c), a = s.slice(c);
2
+ import { forwardRef as f } from "react";
3
+ import { cn as g } from "../../../lib/utils.js";
4
+ import { TooltipProvider as i, Tooltip as d, TooltipTrigger as m, TooltipContent as x } from "../../../vendor/shadcn/tooltip.js";
5
+ import { Badge as u } from "../../atoms/badge/badge.js";
6
+ const N = f(({ items: n, maxVisible: c = 1, emptyState: t = "-", className: h }, p) => {
7
+ if (!n || n.length === 0) return /* @__PURE__ */ e.jsx(e.Fragment, { children: t });
8
+ const o = /* @__PURE__ */ new Set(), s = n.filter((r) => !r.name || o.has(r.name) ? !1 : (o.add(r.name), !0));
9
+ if (s.length === 0) return /* @__PURE__ */ e.jsx(e.Fragment, { children: t });
10
+ const j = s.slice(0, c), a = s.slice(c);
11
11
  return /* @__PURE__ */ e.jsxs(
12
12
  "div",
13
13
  {
14
- ref: h,
15
- className: u("flex items-center gap-2", x),
14
+ ref: p,
15
+ className: g("flex items-center gap-2", h),
16
16
  children: [
17
- p.map((r) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [
17
+ j.map((r) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [
18
18
  r.icon && /* @__PURE__ */ e.jsx(
19
19
  "img",
20
20
  {
@@ -26,14 +26,14 @@ const g = j(({ items: n, maxVisible: c = 1, className: x }, h) => {
26
26
  }
27
27
  }
28
28
  ),
29
- /* @__PURE__ */ e.jsx(o, { children: /* @__PURE__ */ e.jsxs(i, { children: [
30
- /* @__PURE__ */ e.jsx(d, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "truncate text-sm", children: r.name }) }),
31
- /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx("p", { children: r.name }) })
29
+ /* @__PURE__ */ e.jsx(i, { children: /* @__PURE__ */ e.jsxs(d, { children: [
30
+ /* @__PURE__ */ e.jsx(m, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "truncate text-sm", children: r.name }) }),
31
+ /* @__PURE__ */ e.jsx(x, { children: /* @__PURE__ */ e.jsx("p", { children: r.name }) })
32
32
  ] }) })
33
33
  ] }, r.name)),
34
- a.length > 0 && /* @__PURE__ */ e.jsx(o, { delayDuration: 0, children: /* @__PURE__ */ e.jsxs(i, { children: [
35
- /* @__PURE__ */ e.jsx(d, { className: "shrink-0", children: /* @__PURE__ */ e.jsxs(
36
- f,
34
+ a.length > 0 && /* @__PURE__ */ e.jsx(i, { delayDuration: 0, children: /* @__PURE__ */ e.jsxs(d, { children: [
35
+ /* @__PURE__ */ e.jsx(m, { className: "shrink-0", children: /* @__PURE__ */ e.jsxs(
36
+ u,
37
37
  {
38
38
  variant: "outline",
39
39
  className: "text-xs cursor-pointer hover:border-primary hover:text-primary",
@@ -43,7 +43,7 @@ const g = j(({ items: n, maxVisible: c = 1, className: x }, h) => {
43
43
  ]
44
44
  }
45
45
  ) }),
46
- /* @__PURE__ */ e.jsx(m, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: a.map((r) => /* @__PURE__ */ e.jsxs(
46
+ /* @__PURE__ */ e.jsx(x, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: a.map((r) => /* @__PURE__ */ e.jsxs(
47
47
  "div",
48
48
  {
49
49
  className: "flex items-center gap-3",
@@ -69,7 +69,7 @@ const g = j(({ items: n, maxVisible: c = 1, className: x }, h) => {
69
69
  }
70
70
  );
71
71
  });
72
- g.displayName = "DataTableIconTextCell";
72
+ N.displayName = "DataTableIconTextCell";
73
73
  export {
74
- g as DataTableIconTextCell
74
+ N as DataTableIconTextCell
75
75
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface DataTablePercentageCellProps {
2
3
  /** The decimal value (0-1 range, e.g. 0.85 for 85%) */
3
4
  value: number | null | undefined;
@@ -5,6 +6,8 @@ export interface DataTablePercentageCellProps {
5
6
  decimals?: number;
6
7
  /** Whether to show a progress bar @default false */
7
8
  showProgressBar?: boolean;
9
+ /** Content to render when value is empty @default "-" */
10
+ emptyState?: ReactNode;
8
11
  /** Additional CSS classes */
9
12
  className?: string;
10
13
  }
@@ -1,27 +1,35 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as m } from "react";
3
- import { cn as o } from "../../../lib/utils.js";
4
- const c = m(({ value: t, decimals: r = 2, showProgressBar: l = !1, className: n }, i) => {
5
- if (t == null) return null;
6
- const a = t * 100, s = new Intl.NumberFormat("en-US", {
7
- minimumFractionDigits: 0,
8
- maximumFractionDigits: r
9
- }).format(a);
10
- return /* @__PURE__ */ e.jsxs("div", { ref: i, className: o("flex items-center gap-3", n), children: [
11
- l && /* @__PURE__ */ e.jsx("div", { className: "h-1.5 flex-1 min-w-[50px] rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ e.jsx(
12
- "div",
13
- {
14
- className: "h-full rounded-full bg-primary transition-all",
15
- style: { width: `${Math.min(a, 100)}%` }
16
- }
17
- ) }),
18
- /* @__PURE__ */ e.jsxs("span", { className: "text-sm whitespace-nowrap", children: [
19
- s,
20
- "%"
21
- ] })
22
- ] });
23
- });
24
- c.displayName = "DataTablePercentageCell";
2
+ import { forwardRef as o } from "react";
3
+ import { cn as c } from "../../../lib/utils.js";
4
+ const d = o(
5
+ ({
6
+ value: t,
7
+ decimals: r = 2,
8
+ showProgressBar: n = !1,
9
+ emptyState: i = "-",
10
+ className: s
11
+ }, l) => {
12
+ if (t == null) return /* @__PURE__ */ e.jsx(e.Fragment, { children: i });
13
+ const a = t * 100, m = new Intl.NumberFormat("en-US", {
14
+ minimumFractionDigits: 0,
15
+ maximumFractionDigits: r
16
+ }).format(a);
17
+ return /* @__PURE__ */ e.jsxs("div", { ref: l, className: c("flex items-center gap-3", s), children: [
18
+ n && /* @__PURE__ */ e.jsx("div", { className: "h-1.5 flex-1 min-w-[50px] rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ e.jsx(
19
+ "div",
20
+ {
21
+ className: "h-full rounded-full bg-primary transition-all",
22
+ style: { width: `${Math.min(a, 100)}%` }
23
+ }
24
+ ) }),
25
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm whitespace-nowrap", children: [
26
+ m,
27
+ "%"
28
+ ] })
29
+ ] });
30
+ }
31
+ );
32
+ d.displayName = "DataTablePercentageCell";
25
33
  export {
26
- c as DataTablePercentageCell
34
+ d as DataTablePercentageCell
27
35
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { IconName } from '../../atoms/icon';
2
3
  /**
3
4
  * Configuration entry for mapping a status key to a Badge visual.
@@ -23,6 +24,8 @@ export interface DataTableStatusCellProps {
23
24
  * @default Capitalizes first letter, replaces underscores with spaces
24
25
  */
25
26
  formatLabel?: (status: string) => string;
27
+ /** Content to render when status is empty @default "-" */
28
+ emptyState?: ReactNode;
26
29
  /** Additional CSS classes */
27
30
  className?: string;
28
31
  }
@@ -1,24 +1,32 @@
1
- import { j as n } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as m } from "react";
1
+ import { j as e } from "../../../_virtual/jsx-runtime.js";
2
+ import { forwardRef as d } from "react";
3
3
  import { cn as i } from "../../../lib/utils.js";
4
4
  import { Badge as l } from "../../atoms/badge/badge.js";
5
5
  const p = (r) => {
6
6
  if (!r) return r;
7
- const e = r.replace(/[_.]/g, " ").toLowerCase();
8
- return e.charAt(0).toUpperCase() + e.slice(1);
9
- }, d = m(({ status: r, statusMap: e, formatLabel: c = p, className: o }, t) => {
10
- if (!r) return null;
11
- const a = e?.[r] ?? e?.[r.toUpperCase()];
12
- return a ? /* @__PURE__ */ n.jsx("div", { ref: t, className: i(o), children: /* @__PURE__ */ n.jsx(
13
- l,
14
- {
15
- startIcon: a.icon ?? "Info",
16
- variant: a.variant,
17
- children: a.label
18
- }
19
- ) }) : /* @__PURE__ */ n.jsx("div", { ref: t, className: i(o), children: /* @__PURE__ */ n.jsx(l, { startIcon: "Info", variant: "info", children: c(r) }) });
20
- });
21
- d.displayName = "DataTableStatusCell";
7
+ const a = r.replace(/[_.]/g, " ").toLowerCase();
8
+ return a.charAt(0).toUpperCase() + a.slice(1);
9
+ }, f = d(
10
+ ({
11
+ status: r,
12
+ statusMap: a,
13
+ formatLabel: c = p,
14
+ emptyState: m = "-",
15
+ className: o
16
+ }, t) => {
17
+ if (!r) return /* @__PURE__ */ e.jsx(e.Fragment, { children: m });
18
+ const n = a?.[r] ?? a?.[r.toUpperCase()];
19
+ return n ? /* @__PURE__ */ e.jsx("div", { ref: t, className: i(o), children: /* @__PURE__ */ e.jsx(
20
+ l,
21
+ {
22
+ startIcon: n.icon ?? "Info",
23
+ variant: n.variant,
24
+ children: n.label
25
+ }
26
+ ) }) : /* @__PURE__ */ e.jsx("div", { ref: t, className: i(o), children: /* @__PURE__ */ e.jsx(l, { startIcon: "Info", variant: "info", children: c(r) }) });
27
+ }
28
+ );
29
+ f.displayName = "DataTableStatusCell";
22
30
  export {
23
- d as DataTableStatusCell
31
+ f as DataTableStatusCell
24
32
  };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface DataTableTagsCellProps {
2
3
  /** Array of tag labels to display */
3
4
  tags: string[];
@@ -5,6 +6,8 @@ export interface DataTableTagsCellProps {
5
6
  maxVisible?: number;
6
7
  /** Badge variant for all tags @default "outline" */
7
8
  variant?: "outline" | "secondary" | "info" | "success" | "error" | "warning" | "alert";
9
+ /** Content to render when tags is empty @default "-" */
10
+ emptyState?: ReactNode;
8
11
  /** Additional CSS classes */
9
12
  className?: string;
10
13
  }
@@ -1,39 +1,45 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as m } from "react";
3
- import { cn as p } from "../../../lib/utils.js";
4
- import { TooltipProvider as x, Tooltip as d, TooltipTrigger as h, TooltipContent as f } from "../../../vendor/shadcn/tooltip.js";
5
- import { Badge as i } from "../../atoms/badge/badge.js";
6
- const j = m(
7
- ({ tags: l, maxVisible: o = 2, variant: t = "outline", className: a }, n) => {
8
- if (!l || l.length === 0) return null;
9
- const c = l.slice(0, o), s = l.slice(o);
2
+ import { forwardRef as p } from "react";
3
+ import { cn as x } from "../../../lib/utils.js";
4
+ import { TooltipProvider as d, Tooltip as h, TooltipTrigger as j, TooltipContent as f } from "../../../vendor/shadcn/tooltip.js";
5
+ import { Badge as o } from "../../atoms/badge/badge.js";
6
+ const T = p(
7
+ ({
8
+ tags: s,
9
+ maxVisible: i = 2,
10
+ variant: t = "outline",
11
+ emptyState: a = "-",
12
+ className: n
13
+ }, c) => {
14
+ if (!s || s.length === 0) return /* @__PURE__ */ e.jsx(e.Fragment, { children: a });
15
+ const m = s.slice(0, i), l = s.slice(i);
10
16
  return /* @__PURE__ */ e.jsxs(
11
17
  "div",
12
18
  {
13
- ref: n,
14
- className: p("flex items-center gap-1 flex-wrap", a),
19
+ ref: c,
20
+ className: x("flex items-center gap-1 flex-wrap", n),
15
21
  children: [
16
- c.map((r) => /* @__PURE__ */ e.jsx(i, { variant: t, className: "text-xs", children: r }, r)),
17
- s.length > 0 && /* @__PURE__ */ e.jsx(x, { delayDuration: 0, children: /* @__PURE__ */ e.jsxs(d, { children: [
18
- /* @__PURE__ */ e.jsx(h, { children: /* @__PURE__ */ e.jsxs(
19
- i,
22
+ m.map((r) => /* @__PURE__ */ e.jsx(o, { variant: t, className: "text-xs", children: r }, r)),
23
+ l.length > 0 && /* @__PURE__ */ e.jsx(d, { delayDuration: 0, children: /* @__PURE__ */ e.jsxs(h, { children: [
24
+ /* @__PURE__ */ e.jsx(j, { children: /* @__PURE__ */ e.jsxs(
25
+ o,
20
26
  {
21
27
  variant: "outline",
22
28
  className: "text-xs cursor-pointer hover:border-primary hover:text-primary",
23
29
  children: [
24
30
  "+",
25
- s.length
31
+ l.length
26
32
  ]
27
33
  }
28
34
  ) }),
29
- /* @__PURE__ */ e.jsx(f, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-1", children: s.map((r) => /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: r }, r)) }) })
35
+ /* @__PURE__ */ e.jsx(f, { className: "p-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-1", children: l.map((r) => /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: r }, r)) }) })
30
36
  ] }) })
31
37
  ]
32
38
  }
33
39
  );
34
40
  }
35
41
  );
36
- j.displayName = "DataTableTagsCell";
42
+ T.displayName = "DataTableTagsCell";
37
43
  export {
38
- j as DataTableTagsCell
44
+ T as DataTableTagsCell
39
45
  };
@@ -19,8 +19,7 @@ export interface DataTableTextCellProps {
19
19
  tooltip?: string | false;
20
20
  /**
21
21
  * Content to render when value is falsy.
22
- * Defaults to null (renders nothing).
23
- * @example "-" or "--"
22
+ * @default "-"
24
23
  */
25
24
  emptyState?: ReactNode;
26
25
  /**
@@ -3,13 +3,13 @@ import { forwardRef as c } from "react";
3
3
  import { cn as x } from "../../../lib/utils.js";
4
4
  import { TooltipProvider as d, Tooltip as m, TooltipTrigger as p, TooltipContent as j } from "../../../vendor/shadcn/tooltip.js";
5
5
  const T = c(
6
- ({ value: r, formatFn: i, tooltip: l, emptyState: a = null, className: o }, n) => {
6
+ ({ value: r, formatFn: i, tooltip: o, emptyState: a = "-", className: l }, s) => {
7
7
  if (!r) return /* @__PURE__ */ t.jsx(t.Fragment, { children: a });
8
- const e = i ? i(r) : r, s = l === !1 ? null : l ?? e;
9
- return s ? /* @__PURE__ */ t.jsx(d, { children: /* @__PURE__ */ t.jsxs(m, { children: [
10
- /* @__PURE__ */ t.jsx(p, { asChild: !0, children: /* @__PURE__ */ t.jsx("div", { ref: n, className: x("truncate text-sm", o), children: e }) }),
11
- /* @__PURE__ */ t.jsx(j, { children: /* @__PURE__ */ t.jsx("p", { children: s }) })
12
- ] }) }) : /* @__PURE__ */ t.jsx("div", { ref: n, className: x("truncate text-sm", o), children: e });
8
+ const e = i ? i(r) : r, n = o === !1 ? null : o ?? e;
9
+ return n ? /* @__PURE__ */ t.jsx(d, { children: /* @__PURE__ */ t.jsxs(m, { children: [
10
+ /* @__PURE__ */ t.jsx(p, { asChild: !0, children: /* @__PURE__ */ t.jsx("div", { ref: s, className: x("truncate text-sm", l), children: e }) }),
11
+ /* @__PURE__ */ t.jsx(j, { children: /* @__PURE__ */ t.jsx("p", { children: n }) })
12
+ ] }) }) : /* @__PURE__ */ t.jsx("div", { ref: s, className: x("truncate text-sm", l), children: e });
13
13
  }
14
14
  );
15
15
  T.displayName = "DataTableTextCell";