@konstructio/ui 0.1.2-alpha.22 → 0.1.2-alpha.23

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.
@@ -4,12 +4,12 @@ import { cn as c } from "../../utils/index.js";
4
4
  import { TableProvider as K } from "./contexts/table.provider.js";
5
5
  import { Filter as M } from "./components/Filter/Filter.js";
6
6
  import { WrapperBody as W } from "./components/WrapperBody/WrapperBody.js";
7
- import { Header as g } from "./components/Header/Header.js";
8
- import { Body as k } from "./components/Body/Body.js";
9
- import { Pagination as q } from "./components/Pagination/Pagination.js";
10
- import { TruncateText as C } from "./components/TruncateText/TruncateText.js";
11
- import { Actions as F } from "./components/Actions/Actions.js";
12
- const G = ({
7
+ import { Header as k } from "./components/Header/Header.js";
8
+ import { Body as q } from "./components/Body/Body.js";
9
+ import { Pagination as C } from "./components/Pagination/Pagination.js";
10
+ import { TruncateText as F } from "./components/TruncateText/TruncateText.js";
11
+ import { Actions as G } from "./components/Actions/Actions.js";
12
+ const J = ({
13
13
  id: n,
14
14
  ariaLabel: f,
15
15
  columns: p,
@@ -26,8 +26,8 @@ const G = ({
26
26
  queryOptions: z,
27
27
  // Pagination
28
28
  showPagination: B,
29
- showTotalItems: a,
30
- showDropdownPagination: t,
29
+ showTotalItems: t,
30
+ showDropdownPagination: a,
31
31
  showDotPagination: l,
32
32
  showFormPagination: m,
33
33
  pageSizes: V,
@@ -41,8 +41,8 @@ const G = ({
41
41
  }) => {
42
42
  const e = I(
43
43
  () => B || [
44
- a,
45
44
  t,
45
+ a,
46
46
  l,
47
47
  m
48
48
  ].some(Boolean),
@@ -82,37 +82,38 @@ const G = ({
82
82
  "aria-label": f,
83
83
  children: [
84
84
  /* @__PURE__ */ r(
85
- g,
85
+ k,
86
86
  {
87
87
  className: N,
88
88
  classNameArrows: x,
89
89
  classNameActiveArrows: T
90
90
  }
91
91
  ),
92
- /* @__PURE__ */ r(k, { isLoading: o })
92
+ /* @__PURE__ */ r(q, { isLoading: o, showPagination: e })
93
93
  ]
94
94
  }
95
95
  )
96
96
  }
97
97
  ),
98
98
  e && /* @__PURE__ */ r(
99
- q,
99
+ C,
100
100
  {
101
- showTotalItems: a,
102
- showDropdownPagination: t,
101
+ showTotalItems: t,
102
+ showDropdownPagination: a,
103
103
  showDotPagination: l,
104
104
  showFormPagination: m,
105
- pageSizes: V
105
+ pageSizes: V,
106
+ isLoading: o
106
107
  }
107
108
  )
108
109
  ] })
109
110
  }
110
111
  );
111
- }, i = G;
112
+ }, i = J;
112
113
  i.displayName = "KonstructVirtualizedTable";
113
- i.TruncateText = C;
114
- i.Actions = F;
114
+ i.TruncateText = F;
115
+ i.Actions = G;
115
116
  export {
116
- C as TruncateText,
117
+ F as TruncateText,
117
118
  i as VirtualizedTable
118
119
  };
@@ -1,40 +1,48 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { f } from "../../../../index-CSWGJT-v.js";
3
- import { Skeleton as p } from "../Skeleton/Skeleton.js";
4
- import { cn as m } from "../../../../utils/index.js";
5
- import { useTableContext as u } from "../../contexts/table.hook.js";
6
- const y = ({
7
- isLoading: s
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";
4
+ import { cn as b } from "../../../../utils/index.js";
5
+ import { useTableContext as N } from "../../contexts/table.hook.js";
6
+ const j = ({
7
+ isLoading: d,
8
+ showPagination: a
8
9
  }) => {
9
- const { table: r, pageSize: l, tableFetching: n } = u();
10
- return s || n ? /* @__PURE__ */ e(p, { numberOfRows: l, table: r }) : /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: r.getRowModel().rows.map(({ id: a, original: i, getVisibleCells: c }) => {
11
- const { meta: o = {} } = i;
12
- return /* @__PURE__ */ e(
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(
13
17
  "tr",
14
18
  {
15
- className: m(
16
- "border-b border-b-gray-200 bg-white last:border-b-transparent",
17
- o.className
19
+ className: b(
20
+ "border-b border-b-gray-200 last:border-b-transparent bg-transparent",
21
+ n.className
18
22
  ),
19
- "data-row-id": a,
20
- ...o.attributes ?? {},
21
- children: c().map(({ id: b, column: t, getContext: d }) => /* @__PURE__ */ e(
23
+ "data-row-id": s,
24
+ ...n.attributes ?? {},
25
+ children: m.map(({ id: g, column: r, getContext: h }, c) => /* @__PURE__ */ t(
22
26
  "td",
23
27
  {
24
- className: m(
25
- "px-4 py-1 text-sm",
26
- t.columnDef.meta?.className
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
+ }
27
35
  ),
28
- ...t.columnDef.meta?.attributes ?? {},
29
- children: f(t.columnDef.cell, d())
36
+ ...r.columnDef.meta?.attributes ?? {},
37
+ children: x(r.columnDef.cell, h())
30
38
  },
31
- b
39
+ g
32
40
  ))
33
41
  },
34
- a
42
+ s
35
43
  );
36
44
  }) });
37
45
  };
38
46
  export {
39
- y as Body
47
+ j as Body
40
48
  };
@@ -1,32 +1,33 @@
1
- import { jsxs as t, Fragment as d, jsx as e } from "react/jsx-runtime";
2
- import { DotPaginate as p } from "../DotPaginate/DotPaginate.js";
3
- import { DropdownPaginate as f } from "../DropdownPaginate/DropdownPaginate.js";
4
- import { FormPaginate as x } from "../FormPaginate/FormPaginate.js";
5
- import { cn as u } from "../../../../utils/index.js";
6
- import { useTableContext as g } from "../../contexts/table.hook.js";
7
- import { DEFAULT_PAGE_SIZE as h } from "../../constants/pagination.js";
8
- const j = ({
1
+ import { jsxs as t, Fragment as p, jsx as e } from "react/jsx-runtime";
2
+ import { DotPaginate as f } from "../DotPaginate/DotPaginate.js";
3
+ import { DropdownPaginate as x } from "../DropdownPaginate/DropdownPaginate.js";
4
+ import { FormPaginate as u } from "../FormPaginate/FormPaginate.js";
5
+ import { cn as g } from "../../../../utils/index.js";
6
+ import { useTableContext as h } from "../../contexts/table.hook.js";
7
+ import { DEFAULT_PAGE_SIZE as b } from "../../constants/pagination.js";
8
+ const D = ({
9
9
  showTotalItems: a = !0,
10
10
  showDropdownPagination: i = !0,
11
11
  showDotPagination: n = !0,
12
12
  showFormPagination: s = !0,
13
13
  pageSizes: l,
14
- classNamePagination: o
14
+ classNamePagination: o,
15
+ isLoading: m
15
16
  }) => {
16
17
  const {
17
18
  totalItems: r = -1 / 0,
18
- tableFetching: m,
19
- isFirstLoad: c
20
- } = g();
21
- return r <= h || m ? null : /* @__PURE__ */ t(d, { children: [
19
+ tableFetching: c,
20
+ isFirstLoad: d
21
+ } = h();
22
+ return r <= b || c || m ? null : /* @__PURE__ */ t(p, { children: [
22
23
  /* @__PURE__ */ e(
23
24
  "div",
24
25
  {
25
- className: u(
26
+ className: g(
26
27
  "bg-slate-50 border border-y-transparent border-x-slate-100 text-slate-500 text-xs not-italic py-2 px-6 rounded-b-lg shadow",
27
28
  o,
28
29
  {
29
- "animate-in fade-in-10": !c
30
+ "animate-in fade-in-10": !d
30
31
  }
31
32
  ),
32
33
  children: /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
@@ -35,11 +36,11 @@ const j = ({
35
36
  r,
36
37
  " Results"
37
38
  ] }) : null,
38
- i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(f, { pageSizes: l }) })
39
+ i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(x, { pageSizes: l }) })
39
40
  ] }),
40
41
  /* @__PURE__ */ t("div", { className: "flex items-center gap-8", children: [
41
- n && /* @__PURE__ */ e(p, {}),
42
- s && /* @__PURE__ */ e(x, {})
42
+ n && /* @__PURE__ */ e(f, {}),
43
+ s && /* @__PURE__ */ e(u, {})
43
44
  ] })
44
45
  ] })
45
46
  }
@@ -48,5 +49,5 @@ const j = ({
48
49
  ] });
49
50
  };
50
51
  export {
51
- j as Pagination
52
+ D as Pagination
52
53
  };
@@ -1,52 +1,67 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Button as o } from "../../../Button/Button.js";
3
- import { cn as t } from "../../../../utils/index.js";
4
- import { useTableContext as m } from "../../contexts/table.hook.js";
5
- import { E as d } from "../../../../ellipsis-vertical-BVPtjl5f.js";
6
- const x = ({ numberOfRows: r, table: s }) => {
7
- const { tableFetching: l, tableLoading: i } = m();
8
- return /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: Array.from({ length: r }).map((c, n) => /* @__PURE__ */ e(
9
- "tr",
10
- {
11
- className: "border-b border-b-gray-200 bg-white last:border-b-transparent",
12
- children: s.getAllColumns().map(
13
- (a) => a.id !== "actions" ? /* @__PURE__ */ e(
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { Button as c } from "../../../Button/Button.js";
3
+ import { cn as i } from "../../../../utils/index.js";
4
+ import { useTableContext as h } from "../../contexts/table.hook.js";
5
+ import { E as g } from "../../../../ellipsis-vertical-BVPtjl5f.js";
6
+ const _ = ({ numberOfRows: n, table: o }) => {
7
+ const { tableFetching: d, tableLoading: m } = h(), e = Array.from({ length: n });
8
+ return /* @__PURE__ */ t("tbody", { className: "text-slate-800 text-sm font-normal relative", children: e.map((p, a) => {
9
+ const s = o.getAllColumns();
10
+ return /* @__PURE__ */ t(
11
+ "tr",
12
+ {
13
+ className: "border-b border-b-gray-200 bg-transparent last:border-b-transparent",
14
+ children: s.map((r, l) => r.id !== "actions" ? /* @__PURE__ */ t(
14
15
  "td",
15
16
  {
16
- className: t("px-4 py-1", a.columnDef.meta?.className),
17
- children: /* @__PURE__ */ e("div", { className: "animate-in fade-in-0", children: /* @__PURE__ */ e("div", { className: "bg-gray-200 animate-pulse rounded h-5 w-full" }) })
17
+ className: i(
18
+ "px-4 py-1 bg-white",
19
+ r.columnDef.meta?.className,
20
+ {
21
+ "[tr:last-child_&:first-of-type]:rounded-bl-lg": a === e.length - 1 && l === 0,
22
+ "[tr:last-child_&:last-of-type]:rounded-br-lg": a === e.length - 1 && l === s.length - 1
23
+ }
24
+ ),
25
+ children: /* @__PURE__ */ t("div", { className: "animate-in fade-in-0", children: /* @__PURE__ */ t("div", { className: "bg-gray-200 animate-pulse rounded h-5 w-full" }) })
18
26
  },
19
- `skeleton-${a.id}`
20
- ) : /* @__PURE__ */ e(
27
+ `skeleton-${r.id}`
28
+ ) : /* @__PURE__ */ t(
21
29
  "td",
22
30
  {
23
- className: t("px-4 py-1", a.columnDef.meta?.className),
24
- children: /* @__PURE__ */ e(
25
- o,
31
+ className: i(
32
+ "px-4 py-1 bg-white",
33
+ r.columnDef.meta?.className,
34
+ {
35
+ "[tr:last-child_&:first-of-type]:rounded-bl-lg": a === e.length - 1 && l === 0,
36
+ "[tr:last-child_&:last-of-type]:rounded-br-lg": a === e.length - 1 && l === s.length - 1
37
+ }
38
+ ),
39
+ children: /* @__PURE__ */ t(
40
+ c,
26
41
  {
27
42
  variant: "text",
28
43
  shape: "circle",
29
44
  size: "large",
30
45
  disabled: !0,
31
46
  "aria-hidden": "true",
32
- children: /* @__PURE__ */ e(
33
- d,
47
+ children: /* @__PURE__ */ t(
48
+ g,
34
49
  {
35
- className: t("w-5 h-5 text-slate-400", {
36
- "text-gray-300 animate-pulse": l || i
50
+ className: i("w-5 h-5 text-slate-400", {
51
+ "text-gray-300 animate-pulse": d || m
37
52
  })
38
53
  }
39
54
  )
40
55
  }
41
56
  )
42
57
  },
43
- `skeleton-${a.id}`
44
- )
45
- )
46
- },
47
- `skeleton-row-${n}`
48
- )) });
58
+ `skeleton-${r.id}`
59
+ ))
60
+ },
61
+ `skeleton-row-${a}`
62
+ );
63
+ }) });
49
64
  };
50
65
  export {
51
- x as Skeleton
66
+ _ as Skeleton
52
67
  };
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.21",
5
+ "version": "0.1.2-alpha.22",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -72,13 +72,13 @@
72
72
  "cmdk": "^1.1.1",
73
73
  "countries-and-timezones": "^3.8.0",
74
74
  "js-cookie": "^3.0.5",
75
- "lucide-react": "^0.552.0",
75
+ "lucide-react": "^0.553.0",
76
76
  "react-chartjs-2": "^5.3.1",
77
77
  "react-day-picker": "^9.11.1",
78
78
  "react-feather": "^2.0.10",
79
79
  "react-focus-lock": "^2.13.6",
80
80
  "react-remove-scroll": "^2.7.1",
81
- "tailwind-merge": "^3.3.1"
81
+ "tailwind-merge": "^3.4.0"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "@tanstack/react-query": "^5.90",
@@ -115,9 +115,9 @@
115
115
  "devDependencies": {
116
116
  "@faker-js/faker": "^10.1.0",
117
117
  "@rollup/plugin-alias": "^6.0.0",
118
- "@storybook/addon-docs": "^10.0.5",
119
- "@storybook/addon-links": "^10.0.5",
120
- "@storybook/react-vite": "^10.0.5",
118
+ "@storybook/addon-docs": "^10.0.6",
119
+ "@storybook/addon-links": "^10.0.6",
120
+ "@storybook/react-vite": "^10.0.6",
121
121
  "@tailwindcss/vite": "^4.1.17",
122
122
  "@tanstack/react-query": "^5.90.7",
123
123
  "@testing-library/jest-dom": "^6.9.1",
@@ -128,8 +128,8 @@
128
128
  "@types/lodash": "^4.17.20",
129
129
  "@types/react": "^19.2.2",
130
130
  "@types/react-dom": "^19.2.2",
131
- "@typescript-eslint/eslint-plugin": "^8.46.3",
132
- "@typescript-eslint/parser": "^8.46.3",
131
+ "@typescript-eslint/eslint-plugin": "^8.46.4",
132
+ "@typescript-eslint/parser": "^8.46.4",
133
133
  "@vitejs/plugin-react": "^5.1.0",
134
134
  "@vitest/coverage-v8": "^3.2.4",
135
135
  "autoprefixer": "^10.4.21",
@@ -147,11 +147,11 @@
147
147
  "postcss": "^8.5.6",
148
148
  "prettier": "^3.6.2",
149
149
  "rimraf": "^6.1.0",
150
- "storybook": "^10.0.5",
150
+ "storybook": "^10.0.6",
151
151
  "tailwindcss": "^4.1.17",
152
152
  "ts-node": "^10.9.2",
153
153
  "typescript": "^5.9.3",
154
- "vite": "^7.2.1",
154
+ "vite": "^7.2.2",
155
155
  "vite-plugin-dts": "^4.5.4",
156
156
  "vite-plugin-lib-inject-css": "^2.2.2",
157
157
  "vite-plugin-svgr": "^4.5.0",