@konstructio/ui 0.1.2-alpha.14 → 0.1.2-alpha.16

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.
@@ -3,7 +3,7 @@ import { useId as N, useState as y, useRef as E, useCallback as O, useEffect as
3
3
  import { cn as m } from "../../../../utils/index.js";
4
4
  import { timePickerVariants as L } from "../../TimePicker.variants.js";
5
5
  import { WrapperList as j } from "../WrapperList/WrapperList.js";
6
- import { C as P } from "../../../../chevron-down-Cx07rtLP.js";
6
+ import { C as P } from "../../../../chevron-down-J5nS1Tu0.js";
7
7
  import { useTimePickerContext as R } from "../../contexts/time-picker.hook.js";
8
8
  const V = ({
9
9
  name: d,
@@ -1,14 +1,14 @@
1
1
  import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { useMemo as H } from "react";
2
+ import { useMemo as I } from "react";
3
3
  import { cn as s } from "../../utils/index.js";
4
- import { TableProvider as I } from "./contexts/table.provider.js";
5
- import { Filter as K } from "./components/Filter/Filter.js";
6
- import { Header as M } from "./components/Header/Header.js";
7
- import { Body as P } from "./components/Body/Body.js";
8
- import { Pagination as k } from "./components/Pagination/Pagination.js";
9
- import { TruncateText as q } from "./components/TruncateText/TruncateText.js";
10
- import { Actions as C } from "./components/Actions/Actions.js";
11
- const E = ({
4
+ import { TableProvider as K } from "./contexts/table.provider.js";
5
+ import { Filter as M } from "./components/Filter/Filter.js";
6
+ import { Header as P } from "./components/Header/Header.js";
7
+ import { Body as k } from "./components/Body/Body.js";
8
+ import { Pagination as q } from "./components/Pagination/Pagination.js";
9
+ import { TruncateText as C } from "./components/TruncateText/TruncateText.js";
10
+ import { Actions as E } from "./components/Actions/Actions.js";
11
+ const F = ({
12
12
  id: c,
13
13
  ariaLabel: n,
14
14
  columns: d,
@@ -21,23 +21,24 @@ const E = ({
21
21
  classNameTable: h,
22
22
  classNameWrapperTable: x,
23
23
  fetchData: A,
24
+ queryOptions: v,
24
25
  // Pagination
25
- showPagination: v,
26
+ showPagination: y,
26
27
  showTotalItems: o,
27
28
  showDropdownPagination: i,
28
29
  showDotPagination: a,
29
30
  showFormPagination: l,
30
- pageSizes: y,
31
+ pageSizes: z,
31
32
  // Filter
32
- showFilter: z = !1,
33
- showFilterInput: V,
34
- filterSearchPlaceholder: g = "",
35
- multiSelectFilter: j,
36
- filterActions: w,
37
- showResetButton: B = !0
33
+ showFilter: V = !1,
34
+ showFilterInput: g,
35
+ filterSearchPlaceholder: j = "",
36
+ multiSelectFilter: w,
37
+ filterActions: B,
38
+ showResetButton: H = !0
38
39
  }) => {
39
- const t = H(
40
- () => v || [
40
+ const t = I(
41
+ () => y || [
41
42
  o,
42
43
  i,
43
44
  a,
@@ -46,22 +47,23 @@ const E = ({
46
47
  []
47
48
  );
48
49
  return /* @__PURE__ */ r(
49
- I,
50
+ K,
50
51
  {
51
52
  id: c,
52
53
  columns: d,
53
54
  data: f,
54
55
  fetchData: A,
55
56
  totalItems: p,
57
+ queryOptions: v,
56
58
  children: /* @__PURE__ */ m("section", { className: u, children: [
57
- z && /* @__PURE__ */ r(
58
- K,
59
+ V && /* @__PURE__ */ r(
60
+ M,
59
61
  {
60
- actions: w,
61
- multiSelectFilter: j,
62
- placeholder: g,
63
- showFilterInput: V,
64
- showResetButton: B
62
+ actions: B,
63
+ multiSelectFilter: w,
64
+ placeholder: j,
65
+ showFilterInput: g,
66
+ showResetButton: H
65
67
  }
66
68
  ),
67
69
  /* @__PURE__ */ r(
@@ -81,37 +83,37 @@ const E = ({
81
83
  "aria-label": n,
82
84
  children: [
83
85
  /* @__PURE__ */ r(
84
- M,
86
+ P,
85
87
  {
86
88
  className: N,
87
89
  classNameArrows: T,
88
90
  classNameActiveArrows: b
89
91
  }
90
92
  ),
91
- /* @__PURE__ */ r(P, {})
93
+ /* @__PURE__ */ r(k, {})
92
94
  ]
93
95
  }
94
96
  )
95
97
  }
96
98
  ),
97
99
  t && /* @__PURE__ */ r(
98
- k,
100
+ q,
99
101
  {
100
102
  showTotalItems: o,
101
103
  showDropdownPagination: i,
102
104
  showDotPagination: a,
103
105
  showFormPagination: l,
104
- pageSizes: y
106
+ pageSizes: z
105
107
  }
106
108
  )
107
109
  ] })
108
110
  }
109
111
  );
110
- }, e = E;
112
+ }, e = F;
111
113
  e.displayName = "KonstructVirtualizedTable";
112
- e.TruncateText = q;
113
- e.Actions = C;
114
+ e.TruncateText = C;
115
+ e.Actions = E;
114
116
  export {
115
- q as TruncateText,
117
+ C as TruncateText,
116
118
  e as VirtualizedTable
117
119
  };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import { Button as r } from "../../../Button/Button.js";
3
3
  import { cn as s } from "../../../../utils/index.js";
4
- import { c as n } from "../../../../createLucideIcon-DnY-81vT.js";
4
+ import { c as n } from "../../../../createLucideIcon-DGhJ8Z4k.js";
5
5
  /**
6
- * @license lucide-react v0.546.0 - ISC
6
+ * @license lucide-react v0.548.0 - ISC
7
7
  *
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
@@ -1,7 +1,7 @@
1
1
  import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
2
  import { memo as u } from "react";
3
3
  import { cn as p } from "../../../../utils/index.js";
4
- import { C as g, a as d } from "../../../../chevron-right-DCDOrc04.js";
4
+ import { C as g, a as d } from "../../../../chevron-right-DeMVrnIg.js";
5
5
  import { useTableContext as f } from "../../contexts/table.hook.js";
6
6
  const r = u(
7
7
  ({
@@ -1,82 +1,84 @@
1
- import { jsx as z } from "react/jsx-runtime";
2
- import { useQuery as E } from "@tanstack/react-query";
3
- import { u as _, g as j, a as k } from "../../../index-Dx2grAuN.js";
4
- import { useState as t, useMemo as q, useCallback as n } from "react";
5
- import { TableContext as A } from "./table.context.js";
6
- import { DEFAULT_PAGE_SIZE as K } from "../constants/pagination.js";
7
- const Z = ({
8
- children: d,
9
- id: u,
10
- data: S = [],
11
- columns: f = [],
12
- totalItems: h,
13
- fetchData: p
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import { useQuery as _ } from "@tanstack/react-query";
3
+ import { u as j, g as k, a as q } from "../../../index-Dx2grAuN.js";
4
+ import { useState as t, useMemo as A, useCallback as n } from "react";
5
+ import { TableContext as K } from "./table.context.js";
6
+ import { DEFAULT_PAGE_SIZE as G } from "../constants/pagination.js";
7
+ const B = ({
8
+ children: S,
9
+ id: r,
10
+ data: f = [],
11
+ columns: h = [],
12
+ totalItems: p,
13
+ fetchData: g,
14
+ queryOptions: M = {}
14
15
  }) => {
15
- const [i, g] = t([]), [r, m] = t(0), [c, M] = t(), [o, C] = t(K), [l, b] = t(h), P = q(
16
- () => Math.ceil(l / o),
17
- [l, o]
18
- ), [a, w] = t({}), { data: y, isLoading: O, isFetching: T } = E({
16
+ const [m, u] = t([]), [c, d] = t(0), [l, C] = t(), [o, b] = t(G), [i, y] = t(p), P = A(
17
+ () => Math.ceil(i / o),
18
+ [i, o]
19
+ ), [a, w] = t({}), { data: O, isLoading: T, isFetching: F } = _({
19
20
  queryKey: [
20
- u,
21
- r,
22
- o,
21
+ ...typeof r == "string" ? [r] : r,
23
22
  c,
23
+ o,
24
+ l,
24
25
  JSON.stringify(a)
25
26
  ],
26
27
  refetchOnMount: !1,
27
28
  refetchOnWindowFocus: !1,
28
- initialData: S,
29
- queryFn: () => p({
30
- page: Math.max(r + 1, 1),
29
+ initialData: f,
30
+ queryFn: g ? () => g({
31
+ page: Math.max(c + 1, 1),
31
32
  pageSize: o,
32
- termOfSearch: c,
33
+ termOfSearch: l,
33
34
  ...Object.keys(a).length > 0 ? a : {}
34
- }).then(({ data: e, totalItemsCount: s }) => (s && b(s), e))
35
- }), F = n((e) => {
36
- M(e), m(0);
37
- }, []), R = n((e, s) => {
38
- const L = e.toLowerCase().replace(/\s+/g, "_");
39
- w((v) => ({
40
- ...v,
41
- [L]: s
35
+ }).then(({ data: e, totalItemsCount: s }) => (s && y(s), e)) : void 0,
36
+ ...M
37
+ }), R = n((e) => {
38
+ C(e), d(0);
39
+ }, []), v = n((e, s) => {
40
+ const z = e.toLowerCase().replace(/\s+/g, "_");
41
+ w((D) => ({
42
+ ...D,
43
+ [z]: s
42
44
  }));
43
- }, []), x = n((e) => m(e), []), D = n(
44
- (e) => C(e),
45
+ }, []), x = n((e) => d(e), []), I = n(
46
+ (e) => b(e),
45
47
  []
46
- ), I = _({
47
- data: y,
48
- columns: f,
48
+ ), L = j({
49
+ data: O,
50
+ columns: h,
49
51
  state: {
50
- sorting: i
52
+ sorting: m
51
53
  },
52
- onSortingChange: g,
53
- getCoreRowModel: k(),
54
- getSortedRowModel: j()
54
+ onSortingChange: u,
55
+ getCoreRowModel: q(),
56
+ getSortedRowModel: k()
55
57
  });
56
- return /* @__PURE__ */ z(
57
- A.Provider,
58
+ return /* @__PURE__ */ E(
59
+ K.Provider,
58
60
  {
59
61
  value: {
60
- sortedData: i,
61
- table: I,
62
- tableFetching: T,
63
- tableLoading: O,
64
- totalItems: l,
65
- termOfSearch: c,
66
- page: r,
62
+ sortedData: m,
63
+ table: L,
64
+ tableFetching: F,
65
+ tableLoading: T,
66
+ totalItems: i,
67
+ termOfSearch: l,
68
+ page: c,
67
69
  multiselectSelected: a,
68
70
  pageSize: o,
69
71
  totalPages: P,
70
72
  handlePage: x,
71
- onPageSize: D,
72
- onChangeTermOfSearch: F,
73
- onSorting: g,
74
- onSelectMultiselect: R
73
+ onPageSize: I,
74
+ onChangeTermOfSearch: R,
75
+ onSorting: u,
76
+ onSelectMultiselect: v
75
77
  },
76
- children: d
78
+ children: S
77
79
  }
78
80
  );
79
81
  };
80
82
  export {
81
- Z as TableProvider
83
+ B as TableProvider
82
84
  };
@@ -1,6 +1,6 @@
1
1
  import { forwardRef as l, createElement as n } from "react";
2
2
  /**
3
- * @license lucide-react v0.546.0 - ISC
3
+ * @license lucide-react v0.548.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
@@ -17,7 +17,7 @@ const w = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (t)
17
17
  return !0;
18
18
  };
19
19
  /**
20
- * @license lucide-react v0.546.0 - ISC
20
+ * @license lucide-react v0.548.0 - ISC
21
21
  *
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
@@ -34,7 +34,7 @@ var g = {
34
34
  strokeLinejoin: "round"
35
35
  };
36
36
  /**
37
- * @license lucide-react v0.546.0 - ISC
37
+ * @license lucide-react v0.548.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
@@ -69,7 +69,7 @@ const A = l(
69
69
  )
70
70
  );
71
71
  /**
72
- * @license lucide-react v0.546.0 - ISC
72
+ * @license lucide-react v0.548.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ import { RefAttributes } from 'react';
23
23
  import { RowData as RowData_2 } from '@tanstack/react-table';
24
24
  import { SliderProps } from '@radix-ui/react-slider';
25
25
  import { TabsContentProps } from '@radix-ui/react-tabs';
26
+ import { UseQueryOptions } from '@tanstack/react-query';
26
27
  import { VariantProps } from 'class-variance-authority';
27
28
 
28
29
  declare type Action<TData> = {
@@ -229,6 +230,7 @@ declare type DropdownProps = VariantProps<typeof dropdownVariants> & Omit<InputH
229
230
  labelClassName?: string;
230
231
  listClassName?: string;
231
232
  listItemClassName?: string;
233
+ listItemSecondRowClassName?: string;
232
234
  options: Option_3[];
233
235
  searchable?: boolean;
234
236
  showSearchIcon?: boolean;
@@ -449,6 +451,7 @@ declare type Option_2 = {
449
451
 
450
452
  declare type Option_3 = {
451
453
  label: string | ReactNode;
454
+ subLabel?: string | ReactNode;
452
455
  leftIcon?: ReactNode | string;
453
456
  value: string;
454
457
  };
@@ -575,7 +578,7 @@ declare type Props_3<TData extends RowData> = CellContext<TData, string> & {
575
578
  };
576
579
 
577
580
  declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTableVariants> & {
578
- id: string;
581
+ id: string | string[];
579
582
  ariaLabel?: string;
580
583
  columns: ColumnDef_2<TData, string>[];
581
584
  data: TData[];
@@ -585,7 +588,8 @@ declare type Props_4<TData extends RowData_2> = VariantProps<typeof virtualizeTa
585
588
  classNameHeaderTable?: string;
586
589
  classNameTable?: string;
587
590
  classNameWrapperTable?: string;
588
- fetchData: (params: Record<string, string | number | string[] | number[] | undefined>) => Promise<{
591
+ queryOptions?: Omit<UseQueryOptions<any, any, any, any>, 'queryKey' | 'queryFn'>;
592
+ fetchData?: (params: Record<string, string | number | string[] | number[] | undefined>) => Promise<{
589
593
  data: TData[];
590
594
  totalItemsCount?: number;
591
595
  }>;
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.13",
5
+ "version": "0.1.2-alpha.15",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -72,8 +72,8 @@
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.546.0",
76
- "react-chartjs-2": "^5.3.0",
75
+ "lucide-react": "^0.548.0",
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",
@@ -114,10 +114,10 @@
114
114
  },
115
115
  "devDependencies": {
116
116
  "@faker-js/faker": "^10.1.0",
117
- "@rollup/plugin-alias": "^5.1.1",
118
- "@storybook/addon-docs": "^9.1.13",
119
- "@storybook/addon-links": "^9.1.13",
120
- "@storybook/react-vite": "^9.1.13",
117
+ "@rollup/plugin-alias": "^6.0.0",
118
+ "@storybook/addon-docs": "^10.0.0",
119
+ "@storybook/addon-links": "^10.0.0",
120
+ "@storybook/react-vite": "^10.0.0",
121
121
  "@tailwindcss/vite": "^4.1.16",
122
122
  "@tanstack/react-query": "^5.90.5",
123
123
  "@testing-library/jest-dom": "^6.9.1",
@@ -130,7 +130,7 @@
130
130
  "@types/react-dom": "^19.2.2",
131
131
  "@typescript-eslint/eslint-plugin": "^8.46.2",
132
132
  "@typescript-eslint/parser": "^8.46.2",
133
- "@vitejs/plugin-react": "^5.0.4",
133
+ "@vitejs/plugin-react": "^5.1.0",
134
134
  "@vitest/coverage-v8": "^3.2.4",
135
135
  "autoprefixer": "^10.4.21",
136
136
  "eslint": "^9.38.0",
@@ -147,7 +147,7 @@
147
147
  "postcss": "^8.5.6",
148
148
  "prettier": "^3.6.2",
149
149
  "rimraf": "^6.0.1",
150
- "storybook": "^9.1.13",
150
+ "storybook": "^10.0.0",
151
151
  "tailwindcss": "^4.1.16",
152
152
  "ts-node": "^10.9.2",
153
153
  "typescript": "^5.9.3",