@konstructio/ui 0.1.2-alpha.21 → 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.
Files changed (104) hide show
  1. package/dist/{Modal-B8jrP02v.js → Modal-Dpk-1N9W.js} +2 -2
  2. package/dist/chevron-down-DgT-uSF9.js +5 -0
  3. package/dist/chevron-right-DYvXLeql.js +7 -0
  4. package/dist/components/Alert/Alert.js +2 -2
  5. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  6. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  7. package/dist/components/AlertDialog/components/index.js +1 -1
  8. package/dist/components/Badge/Badge.js +2 -8
  9. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  10. package/dist/components/Breadcrumb/components/Item/Item.js +1 -1
  11. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  12. package/dist/components/Button/Button.js +1 -1
  13. package/dist/components/Checkbox/Checkbox.js +6 -7
  14. package/dist/components/Command/Command.js +2 -2
  15. package/dist/components/Command/components/Command.js +1 -1
  16. package/dist/components/Command/components/CommandEmpty.js +1 -1
  17. package/dist/components/Command/components/CommandGroup.js +1 -1
  18. package/dist/components/Command/components/CommandInput.js +2 -2
  19. package/dist/components/Command/components/CommandItem.js +1 -1
  20. package/dist/components/Command/components/CommandList.js +1 -1
  21. package/dist/components/Command/components/CommandSeparator.js +1 -1
  22. package/dist/components/Command/components/DialogContent.js +2 -2
  23. package/dist/components/Command/components/DialogOverlay.js +1 -1
  24. package/dist/components/Datepicker/DatePicker.js +1 -1
  25. package/dist/components/Dropdown/components/List/List.js +1 -1
  26. package/dist/components/Dropdown/components/Wrapper.js +1 -13
  27. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  28. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  29. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  30. package/dist/components/Input/Input.js +1 -1
  31. package/dist/components/Loading/Loading.js +1 -7
  32. package/dist/components/Modal/Modal.js +1 -1
  33. package/dist/components/Modal/components/Body/Body.js +1 -1
  34. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  35. package/dist/components/Modal/components/Header/Header.js +1 -1
  36. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  37. package/dist/components/Modal/components/index.js +1 -1
  38. package/dist/components/NumberInput/NumberInput.js +2 -2
  39. package/dist/components/PieChart/PieChart.js +0 -18
  40. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  41. package/dist/components/Range/Range.js +1 -1
  42. package/dist/components/Slider/Slider.js +1 -1
  43. package/dist/components/Switch/Switch.js +10 -11
  44. package/dist/components/Tabs/Tabs.js +1 -1
  45. package/dist/components/Tabs/components/Content.js +1 -1
  46. package/dist/components/Tabs/components/List.js +1 -1
  47. package/dist/components/Tabs/components/Trigger.js +1 -1
  48. package/dist/components/Tag/Tag.js +1 -1
  49. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
  50. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
  51. package/dist/components/Toast/Toast.js +233 -210
  52. package/dist/components/Tooltip/Tooltip.js +1 -1
  53. package/dist/components/VirtualizedTable/VirtualizedTable.js +70 -72
  54. package/dist/components/VirtualizedTable/components/Actions/Actions.js +2 -2
  55. package/dist/components/VirtualizedTable/components/Body/Body.js +45 -23
  56. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
  57. package/dist/components/VirtualizedTable/components/Header/Header.js +40 -38
  58. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +25 -17
  59. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
  60. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +263 -236
  61. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  62. package/dist/components/VirtualizedTable/components/index.js +8 -6
  63. package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
  64. package/dist/components/VirtualizedTable/contexts/table.provider.js +43 -42
  65. package/dist/components/index.js +1 -1
  66. package/dist/contexts/theme.provider.js +0 -1
  67. package/dist/{createLucideIcon-DGhJ8Z4k.js → createLucideIcon-D4r5Phnh.js} +0 -24
  68. package/dist/{ellipsis-vertical-DpnVYRxI.js → ellipsis-vertical-BVPtjl5f.js} +1 -7
  69. package/dist/{index-N2OStZoU.js → index--V_ZsiQe.js} +0 -21
  70. package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
  71. package/dist/index-BtQfgaSF.js +60 -0
  72. package/dist/index-CIAmiWcw.js +200 -0
  73. package/dist/index-CSFe9uC5.js +14 -0
  74. package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
  75. package/dist/index-CigKKiZS.js +91 -0
  76. package/dist/index-DDByhzds.js +137 -0
  77. package/dist/{index-DQJhMz8c.js → index-DH2Fnov1.js} +11 -12
  78. package/dist/index-DLcqcWxM.js +29 -0
  79. package/dist/{index-CffpTFMi.js → index-Dbt2vBmS.js} +5 -6
  80. package/dist/{index-l3NwplN0.js → index-DpW9ExsS.js} +10 -11
  81. package/dist/index-DrWQH0QF.js +55 -0
  82. package/dist/{index-0XtjXVpJ.js → index-X4k_cU8k.js} +4 -4
  83. package/dist/index-kyuBfLcN.js +479 -0
  84. package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
  85. package/dist/{index-BAEWsOG1.js → index-ohdbKsws.js} +1 -1
  86. package/dist/index.d.ts +9 -0
  87. package/dist/index.js +1 -1
  88. package/dist/package.json +18 -18
  89. package/dist/styles.css +1 -1
  90. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  91. package/dist/utils/index.js +534 -501
  92. package/dist/{x-4F_5p77m.js → x-DPU9OdYH.js} +1 -1
  93. package/package.json +18 -18
  94. package/dist/chevron-down-J5nS1Tu0.js +0 -11
  95. package/dist/chevron-right-DeMVrnIg.js +0 -19
  96. package/dist/components/Skeleton/Skeleton.js +0 -42
  97. package/dist/index-BVRIAMfe.js +0 -36
  98. package/dist/index-BfXxHr_2.js +0 -125
  99. package/dist/index-Bn4c-gww.js +0 -131
  100. package/dist/index-Cvx4lqTq.js +0 -47
  101. package/dist/index-DQH6odE9.js +0 -82
  102. package/dist/index-DdXGVVBv.js +0 -15
  103. package/dist/index-amYX3uxF.js +0 -436
  104. package/dist/index-sp5ZfG6g.js +0 -31
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { S as i } from "../../index-DQH6odE9.js";
2
+ import { S as i } from "../../index-BtQfgaSF.js";
3
3
  import { forwardRef as v, useRef as N, useImperativeHandle as w, useMemo as h, isValidElement as x } from "react";
4
4
  import { cn as o } from "../../utils/index.js";
5
5
  import { arrowVariants as R, tooltipVariants as V } from "./Tooltip.variants.js";
@@ -1,121 +1,119 @@
1
1
  import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import { useMemo as H } from "react";
3
- import { cn as m } 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 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 F } from "./components/Actions/Actions.js";
11
- const G = ({
2
+ import { useMemo as I } from "react";
3
+ import { cn as c } from "../../utils/index.js";
4
+ import { TableProvider as K } from "./contexts/table.provider.js";
5
+ import { Filter as M } from "./components/Filter/Filter.js";
6
+ import { WrapperBody as W } from "./components/WrapperBody/WrapperBody.js";
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 = ({
12
13
  id: n,
13
- ariaLabel: c,
14
- columns: d,
15
- data: f,
16
- totalItems: p = -1 / 0,
17
- className: u,
18
- classNameHeaderActiveArrows: b,
19
- classNameHeaderArrows: T,
14
+ ariaLabel: f,
15
+ columns: p,
16
+ data: d,
17
+ totalItems: u = -1 / 0,
18
+ className: b,
19
+ classNameHeaderActiveArrows: T,
20
+ classNameHeaderArrows: x,
20
21
  classNameHeaderTable: N,
21
- classNameTable: h,
22
- classNameWrapperTable: x,
23
- isLoading: A,
24
- fetchData: v,
25
- queryOptions: g,
22
+ classNameTable: A,
23
+ classNameWrapperTable: y,
24
+ isLoading: o,
25
+ fetchData: h,
26
+ queryOptions: z,
26
27
  // Pagination
27
- showPagination: y,
28
- showTotalItems: i,
28
+ showPagination: B,
29
+ showTotalItems: t,
29
30
  showDropdownPagination: a,
30
31
  showDotPagination: l,
31
- showFormPagination: t,
32
- pageSizes: z,
32
+ showFormPagination: m,
33
+ pageSizes: V,
33
34
  // Filter
34
- showFilter: V = !1,
35
- showFilterInput: j,
35
+ showFilter: j = !1,
36
+ showFilterInput: v,
36
37
  filterSearchPlaceholder: w = "",
37
- multiSelectFilter: B,
38
- filterActions: P,
39
- showResetButton: E = !0
38
+ multiSelectFilter: P,
39
+ filterActions: E,
40
+ showResetButton: H = !0
40
41
  }) => {
41
- const e = H(
42
- () => y || [
43
- i,
42
+ const e = I(
43
+ () => B || [
44
+ t,
44
45
  a,
45
46
  l,
46
- t
47
+ m
47
48
  ].some(Boolean),
48
49
  []
49
50
  );
50
51
  return /* @__PURE__ */ r(
51
- I,
52
+ K,
52
53
  {
53
54
  id: n,
54
- columns: d,
55
- data: f,
56
- fetchData: v,
57
- totalItems: p,
58
- queryOptions: g,
55
+ columns: p,
56
+ data: d,
57
+ fetchData: h,
58
+ totalItems: u,
59
+ queryOptions: z,
59
60
  isPaginationEnabled: e,
60
- children: /* @__PURE__ */ s("section", { className: u, children: [
61
- V && /* @__PURE__ */ r(
62
- K,
61
+ children: /* @__PURE__ */ s("section", { className: c("w-full min-w-fit", b), children: [
62
+ j && /* @__PURE__ */ r(
63
+ M,
63
64
  {
64
- actions: P,
65
- multiSelectFilter: B,
65
+ actions: E,
66
+ multiSelectFilter: P,
66
67
  placeholder: w,
67
- showFilterInput: j,
68
- showResetButton: E
68
+ showFilterInput: v,
69
+ showResetButton: H
69
70
  }
70
71
  ),
71
72
  /* @__PURE__ */ r(
72
- "div",
73
+ W,
73
74
  {
74
- className: m(
75
- "shadow rounded-t-lg",
76
- {
77
- "overflow-hidden rounded-lg": !e
78
- },
79
- x
80
- ),
75
+ showPagination: e,
76
+ classNameWrapperTable: y,
77
+ isLoading: o,
81
78
  children: /* @__PURE__ */ s(
82
79
  "table",
83
80
  {
84
- className: m("w-full border-collapse", h),
85
- "aria-label": c,
81
+ className: c("w-full border-collapse table-fixed", A),
82
+ "aria-label": f,
86
83
  children: [
87
84
  /* @__PURE__ */ r(
88
- M,
85
+ k,
89
86
  {
90
87
  className: N,
91
- classNameArrows: T,
92
- classNameActiveArrows: b
88
+ classNameArrows: x,
89
+ classNameActiveArrows: T
93
90
  }
94
91
  ),
95
- /* @__PURE__ */ r(k, { isLoading: A })
92
+ /* @__PURE__ */ r(q, { isLoading: o, showPagination: e })
96
93
  ]
97
94
  }
98
95
  )
99
96
  }
100
97
  ),
101
98
  e && /* @__PURE__ */ r(
102
- q,
99
+ C,
103
100
  {
104
- showTotalItems: i,
101
+ showTotalItems: t,
105
102
  showDropdownPagination: a,
106
103
  showDotPagination: l,
107
- showFormPagination: t,
108
- pageSizes: z
104
+ showFormPagination: m,
105
+ pageSizes: V,
106
+ isLoading: o
109
107
  }
110
108
  )
111
109
  ] })
112
110
  }
113
111
  );
114
- }, o = G;
115
- o.displayName = "KonstructVirtualizedTable";
116
- o.TruncateText = C;
117
- o.Actions = F;
112
+ }, i = J;
113
+ i.displayName = "KonstructVirtualizedTable";
114
+ i.TruncateText = F;
115
+ i.Actions = G;
118
116
  export {
119
- C as TruncateText,
120
- o as VirtualizedTable
117
+ F as TruncateText,
118
+ i as VirtualizedTable
121
119
  };
@@ -1,11 +1,11 @@
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 n } from "../../../../utils/index.js";
4
- import { E as c } from "../../../../ellipsis-vertical-DpnVYRxI.js";
4
+ import { E as c } from "../../../../ellipsis-vertical-BVPtjl5f.js";
5
5
  const u = ({
6
6
  actions: t,
7
7
  ...i
8
- }) => t ? /* @__PURE__ */ o("div", { className: "relative group w-fit", children: [
8
+ }) => t ? /* @__PURE__ */ o("div", { className: "relative group", children: [
9
9
  /* @__PURE__ */ o(
10
10
  r,
11
11
  {
@@ -1,26 +1,48 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { f as d } from "../../../../index-Dx2grAuN.js";
3
- import { Skeleton as i } from "../../../Skeleton/Skeleton.js";
4
- import { useTableContext as p } from "../../contexts/table.hook.js";
5
- const w = ({ isLoading: o }) => {
6
- const { table: t, pageSize: a } = p();
7
- return /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: o ? /* @__PURE__ */ e(i, { numberOfRows: a, table: t }) : t.getRowModel().rows.map(({ id: l, getVisibleCells: s }) => /* @__PURE__ */ e(
8
- "tr",
9
- {
10
- className: "border border-x-transparent border-t-gray-200 border-b-transparent table w-full table-fixed",
11
- children: s().map(({ id: m, column: r, getContext: n }) => /* @__PURE__ */ e(
12
- "td",
13
- {
14
- className: "px-4 py-1 text-sm",
15
- style: { width: r.getSize() },
16
- children: d(r.columnDef.cell, n())
17
- },
18
- m
19
- ))
20
- },
21
- l
22
- )) });
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
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(
17
+ "tr",
18
+ {
19
+ className: b(
20
+ "border-b border-b-gray-200 last:border-b-transparent bg-transparent",
21
+ n.className
22
+ ),
23
+ "data-row-id": s,
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
+ ))
41
+ },
42
+ s
43
+ );
44
+ }) });
23
45
  };
24
46
  export {
25
- w as Body
47
+ j as Body
26
48
  };
@@ -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-DeMVrnIg.js";
4
+ import { C as g, a as d } from "../../../../chevron-right-DYvXLeql.js";
5
5
  import { useTableContext as f } from "../../contexts/table.hook.js";
6
6
  const r = u(
7
7
  ({
@@ -1,68 +1,70 @@
1
- import { jsx as s, jsxs as a } from "react/jsx-runtime";
2
- import { f as u } from "../../../../index-Dx2grAuN.js";
3
- import { useCallback as i } from "react";
4
- import { cn as o } from "../../../../utils/index.js";
5
- import b from "../../assets/chevron-up.js";
6
- import g from "../../assets/chevron-down.js";
1
+ import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
+ import { f as g } from "../../../../index-CSWGJT-v.js";
3
+ import { useCallback as p } from "react";
4
+ import { cn as s } from "../../../../utils/index.js";
5
+ import u from "../../assets/chevron-up.js";
6
+ import C from "../../assets/chevron-down.js";
7
7
  import { useTableContext as S } from "../../contexts/table.hook.js";
8
- const y = ({
9
- className: p,
10
- classNameArrows: n,
11
- classNameActiveArrows: l
8
+ const D = ({
9
+ className: n,
10
+ classNameArrows: i,
11
+ classNameActiveArrows: a
12
12
  }) => {
13
- const { table: c, onSorting: r } = S(), d = i(
14
- (t) => r([{ id: t.id, desc: !1 }]),
15
- [r]
16
- ), x = i(
17
- (t) => r([{ id: t.id, desc: !0 }]),
18
- [r]
13
+ const { table: c, onSorting: o } = S(), d = p(
14
+ (t) => o([{ id: t.id, desc: !1 }]),
15
+ [o]
16
+ ), x = p(
17
+ (t) => o([{ id: t.id, desc: !0 }]),
18
+ [o]
19
19
  );
20
- return /* @__PURE__ */ s(
20
+ return /* @__PURE__ */ r(
21
21
  "thead",
22
22
  {
23
- className: o(
24
- "font-semibold uppercase text-slate-500 text-xs not-italic bg-slate-100 w-full relative block overflow-hidden [clip-path:inset(-1px_-1px_0px_-1px_round_8px_8px_0px_0px)]",
25
- p
23
+ className: s(
24
+ "font-semibold uppercase text-slate-500 text-xs not-italic bg-slate-100 overflow-hidden [clip-path:inset(-1px_-1px_0px_-1px_round_8px_8px_0px_0px)]",
25
+ n
26
26
  ),
27
- children: c.getHeaderGroups().map(({ id: t, headers: f }) => /* @__PURE__ */ s("tr", { className: "table w-full table-fixed", children: f.map(({ id: m, column: e, getContext: h }) => /* @__PURE__ */ s(
27
+ children: c.getHeaderGroups().map(({ id: t, headers: m }) => /* @__PURE__ */ r("tr", { children: m.map(({ id: f, column: e, getContext: h }) => /* @__PURE__ */ r(
28
28
  "th",
29
29
  {
30
30
  scope: "col",
31
- className: "px-4 py-3 text-left text-xs",
32
- style: { width: e.columnDef.size },
33
- children: /* @__PURE__ */ a("span", { className: "flex items-center gap-2 w-full", children: [
34
- u(e.columnDef.header, h()),
35
- e.getCanSort() && /* @__PURE__ */ a(
31
+ className: s(
32
+ "px-4 py-3 text-left text-xs",
33
+ e.columnDef.meta?.headerClassName
34
+ ),
35
+ children: /* @__PURE__ */ l("span", { className: "flex items-center gap-2 w-full", children: [
36
+ g(e.columnDef.header, h()),
37
+ e.getCanSort() && /* @__PURE__ */ l(
36
38
  "div",
37
39
  {
38
- className: o(
40
+ className: s(
39
41
  "flex flex-col text-slate-400 justify-center items-center gap-1",
40
- n
42
+ i
41
43
  ),
42
44
  role: "presentation",
43
45
  children: [
44
- /* @__PURE__ */ s(
45
- b,
46
+ /* @__PURE__ */ r(
47
+ u,
46
48
  {
47
- className: o(
49
+ className: s(
48
50
  "w-2 h-2 cursor-pointer",
49
51
  {
50
52
  "text-blue-600": e.getIsSorted() === "asc"
51
53
  },
52
- l
54
+ a
53
55
  ),
54
56
  onClick: () => d(e)
55
57
  }
56
58
  ),
57
- /* @__PURE__ */ s(
58
- g,
59
+ /* @__PURE__ */ r(
60
+ C,
59
61
  {
60
- className: o(
62
+ className: s(
61
63
  "w-2 h-2 cursor-pointer",
62
64
  {
63
65
  "text-blue-600": e.getIsSorted() === "desc"
64
66
  },
65
- l
67
+ a
66
68
  ),
67
69
  onClick: () => x(e)
68
70
  }
@@ -72,11 +74,11 @@ const y = ({
72
74
  )
73
75
  ] })
74
76
  },
75
- m
77
+ f
76
78
  )) }, t))
77
79
  }
78
80
  );
79
81
  };
80
82
  export {
81
- y as Header
83
+ D as Header
82
84
  };
@@ -1,26 +1,34 @@
1
- import { jsxs as t, Fragment as c, jsx as e } from "react/jsx-runtime";
2
- import { DotPaginate as d } from "../DotPaginate/DotPaginate.js";
3
- import { DropdownPaginate as p } from "../DropdownPaginate/DropdownPaginate.js";
4
- import { FormPaginate as f } from "../FormPaginate/FormPaginate.js";
5
- import { cn as x } from "../../../../utils/index.js";
6
- import { useTableContext as u } from "../../contexts/table.hook.js";
7
- import { DEFAULT_PAGE_SIZE as g } from "../../constants/pagination.js";
8
- const F = ({
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
- const { totalItems: r = -1 / 0, tableFetching: m } = u();
17
- return r <= g || m ? null : /* @__PURE__ */ t(c, { children: [
17
+ const {
18
+ totalItems: r = -1 / 0,
19
+ tableFetching: c,
20
+ isFirstLoad: d
21
+ } = h();
22
+ return r <= b || c || m ? null : /* @__PURE__ */ t(p, { children: [
18
23
  /* @__PURE__ */ e(
19
24
  "div",
20
25
  {
21
- className: x(
26
+ className: g(
22
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",
23
- o
28
+ o,
29
+ {
30
+ "animate-in fade-in-10": !d
31
+ }
24
32
  ),
25
33
  children: /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
26
34
  /* @__PURE__ */ t("div", { className: "flex items-center gap-6", children: [
@@ -28,11 +36,11 @@ const F = ({
28
36
  r,
29
37
  " Results"
30
38
  ] }) : null,
31
- i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(p, { pageSizes: l }) })
39
+ i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(x, { pageSizes: l }) })
32
40
  ] }),
33
41
  /* @__PURE__ */ t("div", { className: "flex items-center gap-8", children: [
34
- n && /* @__PURE__ */ e(d, {}),
35
- s && /* @__PURE__ */ e(f, {})
42
+ n && /* @__PURE__ */ e(f, {}),
43
+ s && /* @__PURE__ */ e(u, {})
36
44
  ] })
37
45
  ] })
38
46
  }
@@ -41,5 +49,5 @@ const F = ({
41
49
  ] });
42
50
  };
43
51
  export {
44
- F as Pagination
52
+ D as Pagination
45
53
  };
@@ -0,0 +1,67 @@
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(
15
+ "td",
16
+ {
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" }) })
26
+ },
27
+ `skeleton-${r.id}`
28
+ ) : /* @__PURE__ */ t(
29
+ "td",
30
+ {
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,
41
+ {
42
+ variant: "text",
43
+ shape: "circle",
44
+ size: "large",
45
+ disabled: !0,
46
+ "aria-hidden": "true",
47
+ children: /* @__PURE__ */ t(
48
+ g,
49
+ {
50
+ className: i("w-5 h-5 text-slate-400", {
51
+ "text-gray-300 animate-pulse": d || m
52
+ })
53
+ }
54
+ )
55
+ }
56
+ )
57
+ },
58
+ `skeleton-${r.id}`
59
+ ))
60
+ },
61
+ `skeleton-row-${a}`
62
+ );
63
+ }) });
64
+ };
65
+ export {
66
+ _ as Skeleton
67
+ };