@yuno-payments/dashboard-design-system 0.0.135 → 0.0.137

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 (29) hide show
  1. package/dist/components/atoms/filter/filter-date-range.js +136 -87
  2. package/dist/components/atoms/filter/filter.js +9 -9
  3. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +84 -87
  4. package/dist/components/atoms/icon/icon-list.d.ts +0 -3
  5. package/dist/components/atoms/icon/icon-list.js +392 -398
  6. package/dist/components/atoms/multi-values-field/multi-values-field.js +28 -28
  7. package/dist/components/atoms/radio-group/radio-group-option.js +7 -7
  8. package/dist/components/atoms/search-field/search-field.js +9 -9
  9. package/dist/components/atoms/switch/switch.js +13 -13
  10. package/dist/components/molecules/empty/empty-icon.js +6 -6
  11. package/dist/components/organisms/data-table/data-table.d.ts +1 -19
  12. package/dist/components/organisms/data-table/data-table.js +88 -98
  13. package/dist/components/organisms/data-table/data-table.types.d.ts +0 -19
  14. package/dist/components/organisms/data-table/hooks/use-data-table-state.d.ts +2 -7
  15. package/dist/components/organisms/data-table/hooks/use-data-table-state.js +46 -80
  16. package/dist/components/organisms/data-table/utils/data-table-constants.d.ts +2 -2
  17. package/dist/components/organisms/data-table/utils/data-table-constants.js +11 -11
  18. package/dist/index.css +1 -1
  19. package/dist/vendor/shadcn/badge.js +17 -17
  20. package/dist/vendor/shadcn/card.js +7 -7
  21. package/dist/vendor/shadcn/input.js +7 -7
  22. package/dist/vendor/shadcn/table.js +18 -18
  23. package/package.json +1 -1
  24. package/dist/components/atoms/icon/aida-logo.d.ts +0 -3
  25. package/dist/components/atoms/icon/aida-logo.js +0 -64
  26. package/dist/node_modules/@phosphor-icons/react/dist/csr/File.es.js +0 -8
  27. package/dist/node_modules/@phosphor-icons/react/dist/csr/Table.es.js +0 -8
  28. package/dist/node_modules/@phosphor-icons/react/dist/defs/File.es.js +0 -30
  29. package/dist/node_modules/@phosphor-icons/react/dist/defs/Table.es.js +0 -30
@@ -1,15 +1,15 @@
1
- import { j as n } from "../../../_virtual/jsx-runtime.js";
1
+ import { j as o } from "../../../_virtual/jsx-runtime.js";
2
2
  import { forwardRef as q, useId as z, useState as g } from "react";
3
3
  import { cn as b } from "../../../lib/utils.js";
4
4
  import { Field as G, FieldLabel as H, FieldDescription as J, FieldError as K } from "../../../vendor/shadcn/field.js";
5
5
  import { Badge as O } from "../badge/badge.js";
6
6
  const Q = q(
7
7
  ({
8
- value: t = [],
8
+ value: n = [],
9
9
  onChange: d,
10
- label: w,
10
+ label: y,
11
11
  description: c,
12
- error: y,
12
+ error: w,
13
13
  placeholder: j = "Type and press Enter...",
14
14
  disabled: u = !1,
15
15
  id: v,
@@ -23,14 +23,14 @@ const Q = q(
23
23
  orientation: N = "vertical",
24
24
  className: $
25
25
  }, C) => {
26
- const T = z(), o = v || T, m = !!y, [h, E] = g(""), [R, F] = g(!1), [x, i] = g(""), s = (e) => {
26
+ const T = z(), t = v || T, m = !!w, [x, E] = g(""), [R, F] = g(!1), [h, i] = g(""), s = (e) => {
27
27
  const r = e.trim();
28
28
  if (r !== "") {
29
- if (f && t.length >= f) {
29
+ if (f && n.length >= f) {
30
30
  i(`Maximum ${f} items allowed`);
31
31
  return;
32
32
  }
33
- if (!D && t.includes(r)) {
33
+ if (!D && n.includes(r)) {
34
34
  i("Duplicate values are not allowed");
35
35
  return;
36
36
  }
@@ -43,46 +43,46 @@ const Q = q(
43
43
  return;
44
44
  }
45
45
  }
46
- i(""), d([...t, r]), E("");
46
+ i(""), d([...n, r]), E("");
47
47
  }
48
48
  }, M = (e) => {
49
- d(t.filter((r) => r !== e)), i("");
49
+ d(n.filter((r) => r !== e)), i("");
50
50
  }, P = (e) => {
51
51
  const r = e.currentTarget.value;
52
- e.key === "Enter" && p.includes("Enter") ? (e.preventDefault(), s(r)) : e.key === "Tab" && p.includes("Tab") ? r.trim() !== "" && (e.preventDefault(), s(r)) : (e.key === "," || e.key === ",") && p.includes("Comma") ? (e.preventDefault(), s(r)) : e.key === "Backspace" && r === "" && t.length > 0 && d(t.slice(0, -1));
52
+ e.key === "Enter" && p.includes("Enter") ? (e.preventDefault(), s(r)) : e.key === "Tab" && p.includes("Tab") ? r.trim() !== "" && (e.preventDefault(), s(r)) : (e.key === "," || e.key === ",") && p.includes("Comma") ? (e.preventDefault(), s(r)) : e.key === "Backspace" && r === "" && n.length > 0 && d(n.slice(0, -1));
53
53
  }, A = (e) => {
54
54
  E(e.target.value), i("");
55
55
  }, L = () => {
56
56
  F(!0);
57
57
  }, S = () => {
58
- F(!1), B && h.trim() !== "" && s(h);
58
+ F(!1), B && x.trim() !== "" && s(x);
59
59
  }, X = (e, r) => {
60
60
  e.preventDefault(), e.stopPropagation(), M(r);
61
- }, a = y || x;
62
- return /* @__PURE__ */ n.jsxs(
61
+ }, a = w || h;
62
+ return /* @__PURE__ */ o.jsxs(
63
63
  G,
64
64
  {
65
65
  orientation: N,
66
66
  "data-invalid": m,
67
67
  className: b("w-full", $),
68
68
  children: [
69
- w && /* @__PURE__ */ n.jsx(H, { htmlFor: o, children: w }),
70
- /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
71
- /* @__PURE__ */ n.jsxs(
69
+ y && /* @__PURE__ */ o.jsx(H, { htmlFor: t, children: y }),
70
+ /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
71
+ /* @__PURE__ */ o.jsxs(
72
72
  "div",
73
73
  {
74
74
  className: b(
75
- "font-normal file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex min-h-9 w-full min-w-0 rounded-md border bg-white px-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 text-sm",
75
+ "font-normal file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex min-h-9 w-full min-w-0 rounded-md border bg-background px-3 py-1.5 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 text-sm",
76
76
  "flex-wrap gap-1.5 items-center",
77
77
  R && "border-ring ring-ring/50 ring-[3px]",
78
- (m || x) && "border-destructive ring-destructive/20 dark:ring-destructive/40",
78
+ (m || h) && "border-destructive ring-destructive/20 dark:ring-destructive/40",
79
79
  u && "opacity-50 cursor-not-allowed"
80
80
  ),
81
81
  onClick: () => {
82
- u || document.getElementById(o)?.focus();
82
+ u || document.getElementById(t)?.focus();
83
83
  },
84
84
  children: [
85
- t.map((e, r) => /* @__PURE__ */ n.jsx(
85
+ n.map((e, r) => /* @__PURE__ */ o.jsx(
86
86
  O,
87
87
  {
88
88
  variant: I,
@@ -96,34 +96,34 @@ const Q = q(
96
96
  },
97
97
  `${e}-${r}`
98
98
  )),
99
- /* @__PURE__ */ n.jsx(
99
+ /* @__PURE__ */ o.jsx(
100
100
  "input",
101
101
  {
102
102
  ref: C,
103
- id: o,
103
+ id: t,
104
104
  name: V,
105
105
  type: "text",
106
- value: h,
106
+ value: x,
107
107
  onChange: A,
108
108
  onKeyDown: P,
109
109
  onFocus: L,
110
110
  onBlur: S,
111
- placeholder: t.length === 0 ? j : "",
111
+ placeholder: n.length === 0 ? j : "",
112
112
  disabled: u,
113
113
  className: b(
114
114
  "flex-1 min-w-[120px] outline-none bg-transparent border-none shadow-none p-0 h-6",
115
115
  "placeholder:text-muted-foreground",
116
116
  "disabled:cursor-not-allowed"
117
117
  ),
118
- "aria-invalid": m || !!x,
119
- "aria-describedby": c || a ? `${o}-description` : void 0
118
+ "aria-invalid": m || !!h,
119
+ "aria-describedby": c || a ? `${t}-description` : void 0
120
120
  }
121
121
  )
122
122
  ]
123
123
  }
124
124
  ),
125
- c && !a && /* @__PURE__ */ n.jsx(J, { id: `${o}-description`, children: c }),
126
- a && /* @__PURE__ */ n.jsx(K, { id: `${o}-description`, children: a })
125
+ c && !a && /* @__PURE__ */ o.jsx(J, { id: `${t}-description`, children: c }),
126
+ a && /* @__PURE__ */ o.jsx(K, { id: `${t}-description`, children: a })
127
127
  ] })
128
128
  ]
129
129
  }
@@ -1,7 +1,7 @@
1
1
  import { j as r } from "../../../_virtual/jsx-runtime.js";
2
2
  import { RadioGroupItem as d } from "../../../vendor/shadcn/radio-group.js";
3
- import { cn as l } from "../../../lib/utils.js";
4
- import { Label as a } from "../../../vendor/shadcn/label.js";
3
+ import { cn as a } from "../../../lib/utils.js";
4
+ import { Label as l } from "../../../vendor/shadcn/label.js";
5
5
  const o = ({
6
6
  option: e,
7
7
  radioId: s,
@@ -17,15 +17,15 @@ const o = ({
17
17
  value: e.value,
18
18
  id: s,
19
19
  disabled: e.disabled,
20
- className: "size-3.5 data-[state=unchecked]:bg-white border-border cursor-pointer"
20
+ className: "size-3.5 data-[state=unchecked]:bg-background border-border cursor-pointer"
21
21
  }
22
22
  ),
23
23
  t ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
24
24
  /* @__PURE__ */ r.jsx(
25
- a,
25
+ l,
26
26
  {
27
27
  htmlFor: s,
28
- className: l(
28
+ className: a(
29
29
  "cursor-pointer",
30
30
  e.disabled && "text-muted-foreground"
31
31
  ),
@@ -35,10 +35,10 @@ const o = ({
35
35
  e.description && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-muted-foreground ml-auto", children: e.description })
36
36
  ] }) : /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col gap-1.5 flex-1", children: [
37
37
  /* @__PURE__ */ r.jsx(
38
- a,
38
+ l,
39
39
  {
40
40
  htmlFor: s,
41
- className: l(
41
+ className: a(
42
42
  "cursor-pointer",
43
43
  e.disabled && "text-muted-foreground"
44
44
  ),
@@ -1,5 +1,5 @@
1
1
  import { j as t } from "../../../_virtual/jsx-runtime.js";
2
- import { forwardRef as U, useId as Y, useState as l, useRef as V, useEffect as z } from "react";
2
+ import { forwardRef as U, useId as Y, useState as n, useRef as V, useEffect as z } from "react";
3
3
  import { cn as r } from "../../../lib/utils.js";
4
4
  import { Input as Z } from "../../../vendor/shadcn/input.js";
5
5
  import { Icon as w } from "../icon/icon.js";
@@ -28,7 +28,7 @@ const P = D("flex gap-2 w-full", {
28
28
  }), te = U(
29
29
  ({
30
30
  placeholder: F = "Search...",
31
- onSearch: n,
31
+ onSearch: l,
32
32
  limitSearch: y = 10,
33
33
  persistKey: c = "",
34
34
  value: m = "",
@@ -43,15 +43,15 @@ const P = D("flex gap-2 w-full", {
43
43
  inputProps: h,
44
44
  ...E
45
45
  }, i) => {
46
- const M = Y(), u = O || h?.id || M, b = !!a, [o, d] = l(m), [f, R] = l(() => {
46
+ const M = Y(), u = O || h?.id || M, b = !!a, [o, d] = n(m), [f, R] = n(() => {
47
47
  if (c) {
48
48
  const e = localStorage.getItem(`${c}_searchfield`);
49
49
  return e ? JSON.parse(e) : [];
50
50
  }
51
51
  return [];
52
- }), [C, L] = l([]), [B, v] = l(!1), [J, I] = l(!1), g = V(null), _ = V(null), G = (e) => {
52
+ }), [C, L] = n([]), [B, v] = n(!1), [J, I] = n(!1), g = V(null), _ = V(null), G = (e) => {
53
53
  const s = e.target.value;
54
- d(s), (s === "" || H) && n(s);
54
+ d(s), (s === "" || H) && l(s);
55
55
  }, W = (e) => {
56
56
  e.key === "Enter" && o !== "" && S();
57
57
  }, S = () => {
@@ -65,11 +65,11 @@ const P = D("flex gap-2 w-full", {
65
65
  R(k), c && localStorage.setItem(
66
66
  `${c}_searchfield`,
67
67
  JSON.stringify(k)
68
- ), n(o);
68
+ ), l(o);
69
69
  }, X = () => {
70
- d(""), n(""), g.current?.focus();
70
+ d(""), l(""), g.current?.focus();
71
71
  }, q = (e) => {
72
- d(e), n(e), v(!1), g.current?.focus();
72
+ d(e), l(e), v(!1), g.current?.focus();
73
73
  }, A = () => {
74
74
  v(!0);
75
75
  }, Q = () => {
@@ -124,7 +124,7 @@ const P = D("flex gap-2 w-full", {
124
124
  size: "sm",
125
125
  onClick: S,
126
126
  className: r(
127
- "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",
127
+ "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground dark:text-foreground",
128
128
  !x && "cursor-pointer hover:text-foreground transition-colors"
129
129
  )
130
130
  }
@@ -5,18 +5,18 @@ import { cn as n } from "../../../lib/utils.js";
5
5
  import { Label as y } from "../../../vendor/shadcn/label.js";
6
6
  const N = j(
7
7
  ({
8
- label: i,
8
+ label: c,
9
9
  description: o,
10
- side: c = "left",
10
+ side: i = "left",
11
11
  variant: l = "default",
12
- id: f,
12
+ id: d,
13
13
  name: t,
14
14
  onChange: a,
15
- className: m,
16
- switchClassName: x,
17
- ...d
15
+ className: f,
16
+ switchClassName: m,
17
+ ...x
18
18
  }, p) => {
19
- const h = v(), r = f || t || h, u = (s) => {
19
+ const h = v(), r = d || t || h, u = (s) => {
20
20
  if (!a) return;
21
21
  a({
22
22
  target: {
@@ -42,17 +42,17 @@ const N = j(
42
42
  ref: p,
43
43
  id: r,
44
44
  name: t,
45
- className: n("cursor-pointer", x),
45
+ className: n("cursor-pointer", m),
46
46
  onCheckedChange: u,
47
- ...d
47
+ ...x
48
48
  }
49
49
  ), w = n(
50
50
  "flex gap-3 items-start",
51
51
  {
52
- "flex-row-reverse": c === "right",
53
- "bg-white box-border justify-start p-4 rounded-lg border shadow-xs": l === "box"
52
+ "flex-row-reverse": i === "right",
53
+ "bg-background box-border justify-start p-4 rounded-lg border shadow-xs": l === "box"
54
54
  },
55
- m
55
+ f
56
56
  );
57
57
  return /* @__PURE__ */ e.jsxs("div", { className: w, children: [
58
58
  g,
@@ -62,7 +62,7 @@ const N = j(
62
62
  {
63
63
  htmlFor: r,
64
64
  className: "text-sm leading-[18.39px] cursor-pointer",
65
- children: i
65
+ children: c
66
66
  }
67
67
  ),
68
68
  o && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: o })
@@ -1,14 +1,14 @@
1
1
  import { j as o } from "../../../_virtual/jsx-runtime.js";
2
2
  import "react";
3
- import { Icon as i } from "../../atoms/icon/icon.js";
4
- function x({
3
+ import { Icon as t } from "../../atoms/icon/icon.js";
4
+ function d({
5
5
  name: r,
6
- size: t = "xl",
7
- className: m,
6
+ size: m = "xl",
7
+ className: n,
8
8
  children: s
9
9
  }) {
10
- return /* @__PURE__ */ o.jsx("div", { className: "p-4 bg-white rounded-lg shadow-sm", children: s || /* @__PURE__ */ o.jsx(i, { name: r, size: t, className: m }) });
10
+ return /* @__PURE__ */ o.jsx("div", { className: "p-4 bg-background rounded-lg shadow-sm", children: s || /* @__PURE__ */ o.jsx(t, { name: r, size: m, className: n }) });
11
11
  }
12
12
  export {
13
- x as EmptyIcon
13
+ d as EmptyIcon
14
14
  };
@@ -41,15 +41,6 @@ export interface DataTableProps<TData, TValue> {
41
41
  * @default false
42
42
  */
43
43
  manualSorting?: boolean;
44
- /**
45
- * Controlled sorting state (optional)
46
- * If provided, component operates in controlled mode
47
- */
48
- sorting?: import('@tanstack/react-table').SortingState;
49
- /**
50
- * Callback when sorting changes (required for controlled mode)
51
- */
52
- onSortingChange?: (sorting: import('@tanstack/react-table').SortingState) => void;
53
44
  /**
54
45
  * Whether to enable column filtering
55
46
  * @default false
@@ -90,15 +81,6 @@ export interface DataTableProps<TData, TValue> {
90
81
  * Unique key for persisting table state in localStorage
91
82
  */
92
83
  persistKey?: string;
93
- /**
94
- * Initial settings to load (from backend/profile)
95
- * Takes precedence over localStorage
96
- */
97
- initialSettings?: import('./data-table.types').DataTableSettings;
98
- /**
99
- * Callback when table settings change (for syncing to backend)
100
- */
101
- onUpdate?: (settings: import('./data-table.types').DataTableSettings) => void;
102
84
  }
103
85
  /**
104
86
  * Advanced data table component built on TanStack Table.
@@ -121,4 +103,4 @@ export interface DataTableProps<TData, TValue> {
121
103
  * />
122
104
  * ```
123
105
  */
124
- export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
106
+ export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, onRowSelectionChange, enableSorting, manualSorting, enableColumnFilters, enableColumnResizing, columnResizeMode, onRowClick, actions, height, rowHeight, className, persistKey, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
@@ -1,150 +1,140 @@
1
- import { j as o } from "../../../_virtual/jsx-runtime.js";
2
- import * as I from "react";
3
- import { useReactTable as U } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { Table as V } from "../../../vendor/shadcn/table.js";
1
+ import { j as e } from "../../../_virtual/jsx-runtime.js";
2
+ import * as L from "react";
3
+ import { useReactTable as W } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { Table as _ } from "../../../vendor/shadcn/table.js";
5
5
  import { cn as u } from "../../../lib/utils.js";
6
- import { DataTableLoading as q } from "./components/states/data-table-loading.js";
7
- import { DataTableHeader as J } from "./components/data-table-header.js";
8
- import { DataTableBody as K } from "./components/data-table-body.js";
9
- import { useDataTableColumns as Q } from "./hooks/use-data-table-columns.js";
10
- import { useDataTableState as X } from "./hooks/use-data-table-state.js";
11
- import { ROW_HEIGHT_DEFAULT as Y } from "./utils/data-table-constants.js";
12
- import { getFilteredRowModel as Z, getSortedRowModel as $, getCoreRowModel as k } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
13
- import { Empty as z } from "../../molecules/empty/empty.js";
14
- function fe({
6
+ import { DataTableLoading as B } from "./components/states/data-table-loading.js";
7
+ import { DataTableHeader as G } from "./components/data-table-header.js";
8
+ import { DataTableBody as I } from "./components/data-table-body.js";
9
+ import { useDataTableColumns as O } from "./hooks/use-data-table-columns.js";
10
+ import { useDataTableState as U } from "./hooks/use-data-table-state.js";
11
+ import { ROW_HEIGHT_DEFAULT as q } from "./utils/data-table-constants.js";
12
+ import { getFilteredRowModel as J, getSortedRowModel as K, getCoreRowModel as Q } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
13
+ import { Empty as X } from "../../molecules/empty/empty.js";
14
+ function ae({
15
15
  columns: a,
16
16
  data: s,
17
- isLoading: p = !1,
18
- empty: C,
17
+ isLoading: c = !1,
18
+ empty: g,
19
19
  checkboxSelection: m = !1,
20
- onRowSelectionChange: n,
21
- enableSorting: b = !0,
22
- manualSorting: h = !1,
23
- sorting: x,
24
- onSortingChange: w,
25
- enableColumnFilters: y = !1,
20
+ onRowSelectionChange: o,
21
+ enableSorting: p = !0,
22
+ manualSorting: C = !1,
23
+ enableColumnFilters: b = !1,
26
24
  enableColumnResizing: i = !0,
27
- columnResizeMode: S = "onChange",
28
- onRowClick: T,
29
- actions: r,
30
- height: j,
31
- rowHeight: d = Y,
32
- className: R,
33
- persistKey: D,
34
- initialSettings: F,
35
- onUpdate: M
25
+ columnResizeMode: h = "onChange",
26
+ onRowClick: x,
27
+ actions: n,
28
+ height: w,
29
+ rowHeight: d = q,
30
+ className: T,
31
+ persistKey: j
36
32
  }) {
37
- const E = Q({
33
+ const y = O({
38
34
  columns: a,
39
35
  checkboxSelection: m,
40
- actions: r
36
+ actions: n
41
37
  }), {
42
- sorting: f,
43
- setSorting: g,
44
- columnFilters: N,
45
- setColumnFilters: v,
46
- columnVisibility: P,
47
- setColumnVisibility: A,
48
- rowSelection: c,
49
- setRowSelection: H,
50
- columnPinning: L,
51
- handleColumnPinningChange: W
52
- } = X({
53
- persistKey: D,
54
- hasActions: !!r,
55
- externalSorting: x,
56
- onExternalSortingChange: w,
57
- initialSettings: F,
58
- onUpdate: M
59
- }), t = U({
38
+ sorting: R,
39
+ setSorting: S,
40
+ columnFilters: D,
41
+ setColumnFilters: F,
42
+ columnVisibility: M,
43
+ setColumnVisibility: E,
44
+ rowSelection: f,
45
+ setRowSelection: N,
46
+ columnPinning: v,
47
+ handleColumnPinningChange: P
48
+ } = U({
49
+ persistKey: j,
50
+ hasActions: !!n
51
+ }), t = W({
60
52
  data: s,
61
- columns: E,
62
- getCoreRowModel: k(),
53
+ columns: y,
54
+ getCoreRowModel: Q(),
63
55
  enableColumnResizing: i,
64
- columnResizeMode: S,
56
+ columnResizeMode: h,
65
57
  enableColumnPinning: !0,
66
58
  defaultColumn: {
67
59
  enableSorting: !1,
68
60
  minSize: 50
69
61
  },
70
- ...b && {
71
- onSortingChange: (e) => {
72
- g(typeof e == "function" ? e(f) : e);
73
- },
74
- getSortedRowModel: $(),
75
- manualSorting: h
62
+ ...p && {
63
+ onSortingChange: S,
64
+ getSortedRowModel: K(),
65
+ manualSorting: C
76
66
  },
77
- ...y && {
78
- onColumnFiltersChange: v,
79
- getFilteredRowModel: Z()
67
+ ...b && {
68
+ onColumnFiltersChange: F,
69
+ getFilteredRowModel: J()
80
70
  },
81
- onColumnVisibilityChange: A,
82
- onRowSelectionChange: H,
83
- onColumnPinningChange: W,
71
+ onColumnVisibilityChange: E,
72
+ onRowSelectionChange: N,
73
+ onColumnPinningChange: P,
84
74
  state: {
85
- sorting: f,
86
- columnFilters: N,
87
- columnVisibility: P,
88
- rowSelection: c,
89
- columnPinning: L
75
+ sorting: R,
76
+ columnFilters: D,
77
+ columnVisibility: M,
78
+ rowSelection: f,
79
+ columnPinning: v
90
80
  }
91
81
  });
92
- if (I.useEffect(() => {
93
- if (n) {
94
- const e = t.getFilteredSelectedRowModel().rows.map((l) => l.original);
95
- n(e);
82
+ if (L.useEffect(() => {
83
+ if (o) {
84
+ const r = t.getFilteredSelectedRowModel().rows.map((l) => l.original);
85
+ o(r);
96
86
  }
97
- }, [c, n, t]), p)
98
- return /* @__PURE__ */ o.jsx(
99
- q,
87
+ }, [f, o, t]), c)
88
+ return /* @__PURE__ */ e.jsx(
89
+ B,
100
90
  {
101
91
  columns: a,
102
92
  checkboxSelection: m,
103
- actions: r,
93
+ actions: n,
104
94
  rowHeight: d
105
95
  }
106
96
  );
107
97
  if (s.length === 0) {
108
- const e = C || {}, {
98
+ const r = g || {}, {
109
99
  title: l = "No results",
110
- description: _ = "No data available",
111
- media: B,
112
- actions: G
113
- } = e;
114
- return /* @__PURE__ */ o.jsx(
115
- z,
100
+ description: V = "No data available",
101
+ media: A,
102
+ actions: H
103
+ } = r;
104
+ return /* @__PURE__ */ e.jsx(
105
+ X,
116
106
  {
117
- media: B,
107
+ media: A,
118
108
  title: l,
119
- description: _,
120
- actions: G
109
+ description: V,
110
+ actions: H
121
111
  }
122
112
  );
123
113
  }
124
- return /* @__PURE__ */ o.jsx("div", { className: u("space-y-4", R), children: /* @__PURE__ */ o.jsx(
114
+ return /* @__PURE__ */ e.jsx("div", { className: u("space-y-4", T), children: /* @__PURE__ */ e.jsx(
125
115
  "div",
126
116
  {
127
117
  className: "rounded-md border overflow-x-auto",
128
- style: { height: j || "auto" },
129
- children: /* @__PURE__ */ o.jsxs(
130
- V,
118
+ style: { height: w || "auto" },
119
+ children: /* @__PURE__ */ e.jsxs(
120
+ _,
131
121
  {
132
122
  className: u("table-fixed"),
133
123
  style: { width: "max-content", minWidth: "100%" },
134
124
  children: [
135
- /* @__PURE__ */ o.jsx(
136
- J,
125
+ /* @__PURE__ */ e.jsx(
126
+ G,
137
127
  {
138
128
  table: t,
139
129
  enableColumnResizing: i
140
130
  }
141
131
  ),
142
- /* @__PURE__ */ o.jsx(
143
- K,
132
+ /* @__PURE__ */ e.jsx(
133
+ I,
144
134
  {
145
135
  table: t,
146
136
  enableColumnResizing: i,
147
- onRowClick: T,
137
+ onRowClick: x,
148
138
  rowHeight: d
149
139
  }
150
140
  )
@@ -155,5 +145,5 @@ function fe({
155
145
  ) });
156
146
  }
157
147
  export {
158
- fe as DataTable
148
+ ae as DataTable
159
149
  };
@@ -77,23 +77,6 @@ export type DataTableColumn<TData> = ColumnDef<TData> & {
77
77
  enableSorting?: boolean;
78
78
  enableHiding?: boolean;
79
79
  };
80
- /**
81
- * Settings structure compatible with TableV2 format
82
- * Used for initialSettings and onUpdate callback
83
- */
84
- export interface DataTableSettings {
85
- hide?: string[];
86
- show?: string[];
87
- width?: {
88
- [key: string]: number;
89
- };
90
- pinnedColumns?: {
91
- right: string[];
92
- left: string[];
93
- };
94
- order?: string[];
95
- sorting?: SortingState;
96
- }
97
80
  export interface DataTableProps<TData> {
98
81
  columns: DataTableColumn<TData>[];
99
82
  data: TData[];
@@ -120,8 +103,6 @@ export interface DataTableProps<TData> {
120
103
  height?: string | number;
121
104
  rowHeight?: number;
122
105
  persistKey?: string;
123
- initialSettings?: DataTableSettings;
124
- onUpdate?: (settings: DataTableSettings) => void;
125
106
  renderToolbar?: () => React.ReactNode;
126
107
  renderActions?: () => React.ReactNode;
127
108
  className?: string;
@@ -1,17 +1,12 @@
1
1
  import { ColumnFiltersState, SortingState, VisibilityState, RowSelectionState, ColumnPinningState } from '@tanstack/react-table';
2
- import { DataTableSettings } from '../data-table.types';
3
2
  import * as React from "react";
4
3
  interface UseDataTableStateProps {
5
4
  persistKey?: string;
6
5
  hasActions?: boolean;
7
- externalSorting?: SortingState;
8
- onExternalSortingChange?: (sorting: SortingState) => void;
9
- initialSettings?: DataTableSettings;
10
- onUpdate?: (settings: DataTableSettings) => void;
11
6
  }
12
- export declare function useDataTableState({ persistKey, hasActions, externalSorting, onExternalSortingChange, initialSettings, onUpdate, }: UseDataTableStateProps): {
7
+ export declare function useDataTableState({ persistKey, hasActions, }: UseDataTableStateProps): {
13
8
  sorting: SortingState;
14
- setSorting: (sorting: SortingState) => void;
9
+ setSorting: React.Dispatch<React.SetStateAction<SortingState>>;
15
10
  columnFilters: ColumnFiltersState;
16
11
  setColumnFilters: React.Dispatch<React.SetStateAction<ColumnFiltersState>>;
17
12
  columnVisibility: VisibilityState;