@konstructio/ui 0.1.2-alpha.25 → 0.1.2-alpha.26

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,40 +1,72 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { Button as r } from "../../../Button/Button.js";
3
- import { cn as n } from "../../../../utils/index.js";
4
- import { E as c } from "../../../../ellipsis-vertical-BVPtjl5f.js";
5
- const u = ({
6
- actions: t,
7
- ...i
8
- }) => t ? /* @__PURE__ */ o("div", { className: "relative group", children: [
9
- /* @__PURE__ */ o(
10
- r,
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { Button as t } from "../../../Button/Button.js";
3
+ import { cn as r } from "../../../../utils/index.js";
4
+ import { E as u } from "../../../../ellipsis-vertical-BVPtjl5f.js";
5
+ const w = ({
6
+ actions: a,
7
+ wrapperClassName: l,
8
+ triggerButtonClassName: s,
9
+ iconTriggerButtonClassName: n,
10
+ wrapperActionsClassName: c,
11
+ wrapperContentActionsClassName: d,
12
+ ...h
13
+ }) => a ? /* @__PURE__ */ i("div", { className: r("relative group", l), children: [
14
+ /* @__PURE__ */ i(
15
+ t,
11
16
  {
12
17
  variant: "text",
13
18
  shape: "circle",
14
19
  size: "large",
15
- className: "text-slate-400 group-hover:text-slate-800 group-hover:bg-aurora-50",
20
+ className: r(
21
+ "text-slate-400 group-hover:text-slate-800 group-hover:bg-aurora-50",
22
+ s
23
+ ),
16
24
  role: "presentation",
17
25
  children: [
18
- /* @__PURE__ */ e(c, { "aria-hidden": "true", className: "w-7 h-7" }),
26
+ /* @__PURE__ */ e(
27
+ u,
28
+ {
29
+ "aria-hidden": "true",
30
+ className: r("w-7 h-7", n)
31
+ }
32
+ ),
19
33
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Show Actions" })
20
34
  ]
21
35
  }
22
36
  ),
23
- /* @__PURE__ */ e("div", { className: "absolute top-full right-0 w-[215px] hidden group-hover:block z-10", children: /* @__PURE__ */ e("div", { className: "bg-white mt-0.5 py-2 rounded-lg shadow-lg border border-zinc-100 animate-in fade-in-0", children: t.map(({ label: a, onClick: l, className: s }) => /* @__PURE__ */ e(
24
- r,
37
+ /* @__PURE__ */ e(
38
+ "div",
25
39
  {
26
- className: n(
27
- "w-full text-slate-800 cursor-pointer p-0 h-9 flex gap-2 text-sm font-normal justify-start hover:bg-gray-50 hover:text-slate-800 rounded-none px-6",
28
- s
40
+ className: r(
41
+ "absolute top-full right-0 w-[215px] hidden group-hover:block z-10",
42
+ c
29
43
  ),
30
- variant: "text",
31
- asChild: !0,
32
- role: "presentation",
33
- children: /* @__PURE__ */ e(r, { onClick: () => l(i.row.original), children: a })
34
- },
35
- a
36
- )) }) })
44
+ children: /* @__PURE__ */ e(
45
+ "div",
46
+ {
47
+ className: r(
48
+ "bg-white mt-0.5 py-2 rounded-lg shadow-lg border border-zinc-100 animate-in fade-in-0",
49
+ d
50
+ ),
51
+ children: a.map(({ label: o, className: p, onClick: m }) => /* @__PURE__ */ e(
52
+ t,
53
+ {
54
+ className: r(
55
+ "w-full text-slate-800 cursor-pointer p-0 h-9 flex gap-2 text-sm font-normal justify-start hover:bg-gray-50 hover:text-slate-800 rounded-none px-6",
56
+ p
57
+ ),
58
+ variant: "text",
59
+ asChild: !0,
60
+ role: "presentation",
61
+ children: /* @__PURE__ */ e(t, { onClick: () => m(h.row.original), children: o })
62
+ },
63
+ o
64
+ ))
65
+ }
66
+ )
67
+ }
68
+ )
37
69
  ] }) : null;
38
70
  export {
39
- u as Actions
71
+ w as Actions
40
72
  };
@@ -1,48 +1,51 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { f as x } from "../../../../index-CSWGJT-v.js";
3
- import { Skeleton as y } from "../Skeleton/Skeleton.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { f as y } from "../../../../index-CSWGJT-v.js";
3
+ import { Skeleton as x } from "../Skeleton/Skeleton.js";
4
4
  import { cn as b } from "../../../../utils/index.js";
5
- import { useTableContext as N } from "../../contexts/table.hook.js";
6
- const j = ({
5
+ import { useTableContext as D } from "../../contexts/table.hook.js";
6
+ const _ = ({
7
7
  isLoading: d,
8
8
  showPagination: a
9
9
  }) => {
10
- const { table: o, pageSize: i, tableFetching: f } = N();
11
- if (d || f)
12
- return /* @__PURE__ */ t(y, { numberOfRows: i, table: o });
13
- const e = o.getRowModel().rows ?? [];
14
- return /* @__PURE__ */ t("tbody", { className: "text-slate-800 text-sm font-normal relative", children: e.map(({ id: s, original: p, getVisibleCells: u }, l) => {
15
- const { meta: n = {} } = p, m = u();
16
- return /* @__PURE__ */ t(
10
+ const { table: s, pageSize: i, tableFetching: p } = D();
11
+ if (d || p)
12
+ return /* @__PURE__ */ e(x, { numberOfRows: i, table: s });
13
+ const r = s.getRowModel().rows ?? [];
14
+ return /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: r.map(({ id: o, original: l, getVisibleCells: u }, m) => {
15
+ const { meta: n = {} } = l, c = u();
16
+ return /* @__PURE__ */ e(
17
17
  "tr",
18
18
  {
19
19
  className: b(
20
20
  "border-b border-b-gray-200 last:border-b-transparent bg-transparent",
21
21
  n.className
22
22
  ),
23
- "data-row-id": s,
23
+ "data-row-id": o,
24
24
  ...n.attributes ?? {},
25
- children: m.map(({ id: g, column: r, getContext: h }, c) => /* @__PURE__ */ t(
26
- "td",
27
- {
28
- className: b(
29
- "px-4 py-1 text-sm bg-white",
30
- r.columnDef.meta?.className,
31
- {
32
- "[tr:last-child_&:first-of-type]:rounded-bl-lg": l === e.length - 1 && c === 0 || !a,
33
- "[tr:last-child_&:last-of-type]:rounded-br-lg": l === e.length - 1 && c === m.length - 1 || !a
34
- }
35
- ),
36
- ...r.columnDef.meta?.attributes ?? {},
37
- children: x(r.columnDef.cell, h())
38
- },
39
- g
40
- ))
25
+ children: c.map(({ id: g, column: t, getContext: h }, f) => {
26
+ const N = typeof t.columnDef.meta?.className == "function" ? t.columnDef.meta?.className(l) : t.columnDef.meta?.className;
27
+ return /* @__PURE__ */ e(
28
+ "td",
29
+ {
30
+ className: b(
31
+ "px-4 py-1 text-sm bg-white",
32
+ N,
33
+ {
34
+ "[tr:last-child_&:first-of-type]:rounded-bl-lg": m === r.length - 1 && f === 0 || !a,
35
+ "[tr:last-child_&:last-of-type]:rounded-br-lg": m === r.length - 1 && f === c.length - 1 || !a
36
+ }
37
+ ),
38
+ ...t.columnDef.meta?.attributes ?? {},
39
+ children: y(t.columnDef.cell, h())
40
+ },
41
+ g
42
+ );
43
+ })
41
44
  },
42
- s
45
+ o
43
46
  );
44
47
  }) });
45
48
  };
46
49
  export {
47
- j as Body
50
+ _ as Body
48
51
  };
package/dist/index.d.ts CHANGED
@@ -645,6 +645,11 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
645
645
 
646
646
  declare type Props_5<TData extends RowData> = CellContext<TData, unknown> & {
647
647
  actions: Action<TData>[];
648
+ iconTriggerButtonClassName?: string;
649
+ triggerButtonClassName?: string;
650
+ wrapperActionsClassName?: string;
651
+ wrapperClassName?: string;
652
+ wrapperContentActionsClassName?: string;
648
653
  };
649
654
 
650
655
  export declare const Radio: FC<RadioProps>;
@@ -980,7 +985,7 @@ export { }
980
985
 
981
986
  declare module '@tanstack/react-table' {
982
987
  interface ColumnMeta<TData extends RowData, TValue> {
983
- className?: string;
988
+ className?: string | ((row: TData) => string);
984
989
  attributes?: Record<string, string | number | boolean>;
985
990
  headerClassName?: string;
986
991
  }
package/dist/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.2-alpha.24",
5
+ "version": "0.1.2-alpha.25",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@konstructio/ui",
3
3
  "description": "A set of reusable and customizable React components built for konstruct.io",
4
4
  "private": false,
5
- "version": "0.1.2-alpha.25",
5
+ "version": "0.1.2-alpha.26",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",