@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.31

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 (163) hide show
  1. package/dist/DatePicker.css +1 -1
  2. package/dist/Modal-5xSxFoaD.js +99 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  4. package/dist/chevron-down-DgT-uSF9.js +5 -0
  5. package/dist/chevron-right-DYvXLeql.js +7 -0
  6. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  7. package/dist/components/Alert/Alert.js +2 -2
  8. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  9. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  10. package/dist/components/AlertDialog/components/index.js +1 -1
  11. package/dist/components/Badge/Badge.js +30 -33
  12. package/dist/components/Badge/Badge.variants.js +8 -6
  13. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  14. package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
  15. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  16. package/dist/components/Button/Button.js +1 -1
  17. package/dist/components/Button/Button.variants.js +1 -1
  18. package/dist/components/Card/Card.variants.js +5 -9
  19. package/dist/components/Checkbox/Checkbox.js +6 -6
  20. package/dist/components/Command/Command.js +2 -2
  21. package/dist/components/Command/components/Command.js +1 -1
  22. package/dist/components/Command/components/CommandEmpty.js +1 -1
  23. package/dist/components/Command/components/CommandGroup.js +1 -1
  24. package/dist/components/Command/components/CommandInput.js +2 -2
  25. package/dist/components/Command/components/CommandItem.js +1 -1
  26. package/dist/components/Command/components/CommandList.js +1 -1
  27. package/dist/components/Command/components/CommandSeparator.js +1 -1
  28. package/dist/components/Command/components/DialogContent.js +2 -2
  29. package/dist/components/Command/components/DialogOverlay.js +1 -1
  30. package/dist/components/Datepicker/DatePicker.js +1209 -1147
  31. package/dist/components/Divider/Divider.variants.js +1 -1
  32. package/dist/components/Dropdown/Dropdown.js +46 -28
  33. package/dist/components/Dropdown/Dropdown.variants.js +32 -9
  34. package/dist/components/Dropdown/components/List/List.js +133 -54
  35. package/dist/components/Dropdown/components/List/List.variants.js +9 -7
  36. package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
  37. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
  38. package/dist/components/Dropdown/components/Wrapper.js +144 -109
  39. package/dist/components/Dropdown/constants/index.js +4 -0
  40. package/dist/components/Dropdown/constants/pagination.js +4 -0
  41. package/dist/components/Dropdown/contexts/dropdown.context.js +26 -8
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
  43. package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
  44. package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
  45. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  46. package/dist/components/Filter/Filter.variants.js +2 -2
  47. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  48. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  49. package/dist/components/Input/Input.js +1 -1
  50. package/dist/components/Input/Input.variants.js +1 -1
  51. package/dist/components/Loading/Loading.js +1 -7
  52. package/dist/components/Modal/Modal.js +2 -2
  53. package/dist/components/Modal/components/Body/Body.js +1 -1
  54. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  55. package/dist/components/Modal/components/Header/Header.js +1 -1
  56. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/NumberInput/NumberInput.js +2 -2
  59. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  60. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -0
  61. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
  62. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
  63. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
  64. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  65. package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
  66. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  67. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  68. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  69. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  70. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6139 -0
  71. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  72. package/dist/components/PieChart/PieChart.js +647 -664
  73. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  74. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  75. package/dist/components/Range/Range.js +1 -1
  76. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  77. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  78. package/dist/components/Slider/Slider.js +1 -1
  79. package/dist/components/Switch/Switch.js +8 -8
  80. package/dist/components/Switch/Switch.variants.js +4 -4
  81. package/dist/components/Tabs/Tabs.js +1 -1
  82. package/dist/components/Tabs/Tabs.variants.js +45 -24
  83. package/dist/components/Tabs/components/Content.js +1 -1
  84. package/dist/components/Tabs/components/List.js +1 -1
  85. package/dist/components/Tabs/components/Trigger.js +9 -8
  86. package/dist/components/Tag/Tag.js +1 -1
  87. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
  88. package/dist/components/TimePicker/TimePicker.variants.js +2 -2
  89. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
  90. package/dist/components/Toast/Toast.js +206 -181
  91. package/dist/components/Tooltip/Tooltip.js +1 -1
  92. package/dist/components/Typography/Typography.variants.js +18 -23
  93. package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -0
  94. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  95. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  96. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  97. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  98. package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
  99. package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
  100. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  101. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  102. package/dist/components/VirtualizedTable/components/Filter/Filter.js +88 -0
  103. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  104. package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
  105. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
  106. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
  107. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
  108. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  109. package/dist/components/VirtualizedTable/components/index.js +16 -0
  110. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  111. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  112. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  113. package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
  114. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  115. package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
  116. package/dist/components/index.js +79 -73
  117. package/dist/contexts/theme.provider.js +0 -1
  118. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
  119. package/dist/debounce-BFejQm9P.js +200 -0
  120. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  121. package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
  122. package/dist/index-2hB40Iuc.js +1873 -0
  123. package/dist/index-BZPx6jYI.js +8 -0
  124. package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
  125. package/dist/index-BtQfgaSF.js +60 -0
  126. package/dist/index-C3tHPg8y.js +662 -0
  127. package/dist/index-CIAmiWcw.js +200 -0
  128. package/dist/index-CSFe9uC5.js +14 -0
  129. package/dist/index-CSWGJT-v.js +1722 -0
  130. package/dist/index-CigKKiZS.js +91 -0
  131. package/dist/index-DDByhzds.js +137 -0
  132. package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
  133. package/dist/index-DLcqcWxM.js +29 -0
  134. package/dist/index-Dbt2vBmS.js +136 -0
  135. package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
  136. package/dist/index-DrWQH0QF.js +55 -0
  137. package/dist/{index-D3xzCzcO.js → index-X4k_cU8k.js} +4 -4
  138. package/dist/index-kyuBfLcN.js +479 -0
  139. package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
  140. package/dist/index-ohdbKsws.js +27 -0
  141. package/dist/index.d.ts +184 -18
  142. package/dist/index.js +106 -98
  143. package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
  144. package/dist/package.json +46 -32
  145. package/dist/styles.css +1 -1
  146. package/dist/ui/civo-theme.css +191 -167
  147. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  148. package/dist/utils/index.js +534 -501
  149. package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
  150. package/package.json +46 -32
  151. package/dist/Modal-V67Uz78z.js +0 -98
  152. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  153. package/dist/chevron-down-BLZPftpV.js +0 -11
  154. package/dist/chevron-up-RLP4nX7V.js +0 -54
  155. package/dist/index-BXuxPoz7.js +0 -435
  156. package/dist/index-BfXxHr_2.js +0 -125
  157. package/dist/index-C9T9HQaa.js +0 -423
  158. package/dist/index-CZnD2QxM.js +0 -32
  159. package/dist/index-CrBonFvu.js +0 -144
  160. package/dist/index-Cvx4lqTq.js +0 -47
  161. package/dist/index-DQH6odE9.js +0 -82
  162. package/dist/index-Oq5GlCHP.js +0 -131
  163. package/dist/index-iXyXtdgP.js +0 -31
@@ -1,51 +1,46 @@
1
1
  import { c as t } from "../../index-D29mdTf5.js";
2
- const e = t([], {
2
+ const a = t([], {
3
3
  variants: {
4
4
  variant: {
5
- h1: ["text-[57px]", "leading-[64px]"],
5
+ h1: ["text-[57px]", "leading-16"],
6
6
  h2: ["text-[45px]", "leading-[52px]"],
7
- h3: ["text-[36px]", "leading-[44px]"],
8
- h4: ["text-[32px]", "leading-[40px]"],
9
- h5: ["text-[28px]", "leading-[36px]"],
10
- h6: ["text-[24px]", "font-medium", "leading-[32px]", "tracking-[0.15px]"],
11
- subtitle1: ["text-[22px]", "leading-[28px]"],
12
- subtitle2: [
13
- "text-[16px]",
14
- "font-medium",
15
- "leading-[24px]",
16
- "tracking-[0.15px]"
17
- ],
7
+ h3: ["text-4xl", "leading-11"],
8
+ h4: ["text-[32px]", "leading-10"],
9
+ h5: ["text-[28px]", "leading-9"],
10
+ h6: ["text-2xl", "font-medium", "leading-8", "tracking-[0.15px]"],
11
+ subtitle1: ["text-[22px]", "leading-7"],
12
+ subtitle2: ["text-sm", "font-medium", "leading-6", "tracking-[0.15px]"],
18
13
  subtitle3: [
19
14
  "text-[14px]",
20
15
  "font-medium",
21
- "leading-[20px]",
16
+ "leading-5",
22
17
  "tracking-[0.1px]"
23
18
  ],
24
- labelLarge: ["text-[14px]", "leading-[20px]", "tracking-[0.1px]"],
19
+ labelLarge: ["text-sm", "leading-5", "tracking-[0.1px]"],
25
20
  labelMedium: [
26
21
  "text-[12px]",
27
22
  "font-medium",
28
- "leading-[16px]",
23
+ "leading-4",
29
24
  "tracking-[0.5px]",
30
25
  "uppercase"
31
26
  ],
32
27
  labelSmall: [
33
28
  "text-[11px]",
34
29
  "font-medium",
35
- "leading-[16px]",
30
+ "leading-4",
36
31
  "tracking-[0.5px]",
37
32
  "uppercase"
38
33
  ],
39
34
  buttonSmall: [
40
35
  "text-[14px]",
41
36
  "font-semibold",
42
- "leading-[20px]",
37
+ "leading-5",
43
38
  "tracking-[0.25px]"
44
39
  ],
45
- body1: ["text-[16px]", "leading-[24px]", "tracking-[0.5px]"],
46
- body2: ["text-[14px]", "leading-[20px]", "tracking-[0.25px]"],
47
- body3: ["text-[12px]", "leading-[16px]", "tracking-[0.4px]"],
48
- tooltip: ["text-[14px]", "leading-[22px]"]
40
+ body1: ["text-base", "leading-6", "tracking-[0.5px]"],
41
+ body2: ["text-sm", "leading-5", "tracking-[0.25px]"],
42
+ body3: ["text-xs", "leading-4", "tracking-[0.4px]"],
43
+ tooltip: ["text-sm", "leading-[22px]"]
49
44
  }
50
45
  },
51
46
  defaultVariants: {
@@ -53,5 +48,5 @@ const e = t([], {
53
48
  }
54
49
  });
55
50
  export {
56
- e as typographyVariants
51
+ a as typographyVariants
57
52
  };
@@ -0,0 +1,119 @@
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
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 = ({
13
+ id: n,
14
+ ariaLabel: f,
15
+ columns: p,
16
+ data: d,
17
+ totalItems: u = -1 / 0,
18
+ className: b,
19
+ classNameHeaderActiveArrows: T,
20
+ classNameHeaderArrows: x,
21
+ classNameHeaderTable: N,
22
+ classNameTable: A,
23
+ classNameWrapperTable: y,
24
+ isLoading: o,
25
+ fetchData: h,
26
+ queryOptions: z,
27
+ // Pagination
28
+ showPagination: B,
29
+ showTotalItems: t,
30
+ showDropdownPagination: a,
31
+ showDotPagination: l,
32
+ showFormPagination: m,
33
+ pageSizes: V,
34
+ // Filter
35
+ showFilter: j = !1,
36
+ showFilterInput: v,
37
+ filterSearchPlaceholder: w = "",
38
+ multiSelectFilter: P,
39
+ filterActions: E,
40
+ showResetButton: H = !0
41
+ }) => {
42
+ const e = I(
43
+ () => B || [
44
+ t,
45
+ a,
46
+ l,
47
+ m
48
+ ].some(Boolean),
49
+ []
50
+ );
51
+ return /* @__PURE__ */ r(
52
+ K,
53
+ {
54
+ id: n,
55
+ columns: p,
56
+ data: d,
57
+ fetchData: h,
58
+ totalItems: u,
59
+ queryOptions: z,
60
+ isPaginationEnabled: e,
61
+ children: /* @__PURE__ */ s("section", { className: c("w-full min-w-fit", b), children: [
62
+ j && /* @__PURE__ */ r(
63
+ M,
64
+ {
65
+ actions: E,
66
+ multiSelectFilter: P,
67
+ placeholder: w,
68
+ showFilterInput: v,
69
+ showResetButton: H
70
+ }
71
+ ),
72
+ /* @__PURE__ */ r(
73
+ W,
74
+ {
75
+ showPagination: e,
76
+ classNameWrapperTable: y,
77
+ isLoading: o,
78
+ children: /* @__PURE__ */ s(
79
+ "table",
80
+ {
81
+ className: c("w-full border-collapse table-fixed", A),
82
+ "aria-label": f,
83
+ children: [
84
+ /* @__PURE__ */ r(
85
+ k,
86
+ {
87
+ className: N,
88
+ classNameArrows: x,
89
+ classNameActiveArrows: T
90
+ }
91
+ ),
92
+ /* @__PURE__ */ r(q, { isLoading: o, showPagination: e })
93
+ ]
94
+ }
95
+ )
96
+ }
97
+ ),
98
+ e && /* @__PURE__ */ r(
99
+ C,
100
+ {
101
+ showTotalItems: t,
102
+ showDropdownPagination: a,
103
+ showDotPagination: l,
104
+ showFormPagination: m,
105
+ pageSizes: V,
106
+ isLoading: o
107
+ }
108
+ )
109
+ ] })
110
+ }
111
+ );
112
+ }, i = J;
113
+ i.displayName = "KonstructVirtualizedTable";
114
+ i.TruncateText = F;
115
+ i.Actions = G;
116
+ export {
117
+ F as TruncateText,
118
+ i as VirtualizedTable
119
+ };
@@ -0,0 +1,5 @@
1
+ import { c as a } from "../../index-D29mdTf5.js";
2
+ const t = a([]);
3
+ export {
4
+ t as virtualizeTableVariants
5
+ };
@@ -0,0 +1,25 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const l = ({
3
+ className: t,
4
+ onClick: e
5
+ }) => /* @__PURE__ */ o(
6
+ "svg",
7
+ {
8
+ width: "7",
9
+ height: "5",
10
+ viewBox: "0 0 7 5",
11
+ fill: "none",
12
+ className: t,
13
+ onClick: e,
14
+ children: /* @__PURE__ */ o(
15
+ "path",
16
+ {
17
+ d: "M0.8225 0L3.5 2.67167L6.1775 0L7 0.8225L3.5 4.3225L0 0.8225L0.8225 0Z",
18
+ fill: "currentColor"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ export {
24
+ l as default
25
+ };
@@ -0,0 +1,25 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ const l = ({
3
+ className: r,
4
+ onClick: t
5
+ }) => /* @__PURE__ */ o(
6
+ "svg",
7
+ {
8
+ width: "7",
9
+ height: "5",
10
+ viewBox: "0 0 7 5",
11
+ fill: "currentColor",
12
+ className: r,
13
+ onClick: t,
14
+ children: /* @__PURE__ */ o(
15
+ "path",
16
+ {
17
+ d: "M0.8225 4.99999L3.5 2.32832L6.1775 4.99999L7 4.17749L3.5 0.67749L0 4.17749L0.8225 4.99999Z",
18
+ fill: "currentColor"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ export {
24
+ l as default
25
+ };
@@ -0,0 +1,6 @@
1
+ import { default as r } from "./chevron-up.js";
2
+ import { default as f } from "./chevron-down.js";
3
+ export {
4
+ f as ChevronDown,
5
+ r as ChevronUp
6
+ };
@@ -0,0 +1,72 @@
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,
16
+ {
17
+ variant: "text",
18
+ shape: "circle",
19
+ size: "large",
20
+ className: r(
21
+ "text-slate-400 group-hover:text-slate-800 group-hover:bg-aurora-50",
22
+ s
23
+ ),
24
+ role: "presentation",
25
+ children: [
26
+ /* @__PURE__ */ e(
27
+ u,
28
+ {
29
+ "aria-hidden": "true",
30
+ className: r("w-7 h-7", n)
31
+ }
32
+ ),
33
+ /* @__PURE__ */ e("span", { className: "sr-only", children: "Show Actions" })
34
+ ]
35
+ }
36
+ ),
37
+ /* @__PURE__ */ e(
38
+ "div",
39
+ {
40
+ className: r(
41
+ "absolute top-full right-0 w-[215px] hidden group-hover:block z-10",
42
+ c
43
+ ),
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
+ )
69
+ ] }) : null;
70
+ export {
71
+ w as Actions
72
+ };
@@ -0,0 +1,51 @@
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
+ import { cn as b } from "../../../../utils/index.js";
5
+ import { useTableContext as D } from "../../contexts/table.hook.js";
6
+ const _ = ({
7
+ isLoading: d,
8
+ showPagination: a
9
+ }) => {
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
+ "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": o,
24
+ ...n.attributes ?? {},
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
+ })
44
+ },
45
+ o
46
+ );
47
+ }) });
48
+ };
49
+ export {
50
+ _ as Body
51
+ };
@@ -0,0 +1,165 @@
1
+ import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
+ import { memo as u } from "react";
3
+ import { cn as p } from "../../../../utils/index.js";
4
+ import { C as g, a as d } from "../../../../chevron-right-DYvXLeql.js";
5
+ import { useTableContext as f } from "../../contexts/table.hook.js";
6
+ const r = u(
7
+ ({
8
+ index: e,
9
+ currentPage: t,
10
+ handlePage: l
11
+ }) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
12
+ "button",
13
+ {
14
+ type: "button",
15
+ onClick: () => l(e),
16
+ className: p("px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer", {
17
+ "bg-blue-600 text-white": e === t
18
+ }),
19
+ children: e + 1
20
+ }
21
+ ) }, e)
22
+ );
23
+ r.displayName = "PageButton";
24
+ const o = u(({ keyValue: e }) => /* @__PURE__ */ i("li", { className: "px-2", children: /* @__PURE__ */ i("span", { className: "text-blue-600 select-none", children: "..." }) }, e));
25
+ o.displayName = "Ellipsis";
26
+ const a = u(
27
+ ({
28
+ direction: e,
29
+ onClick: t,
30
+ disabled: l
31
+ }) => /* @__PURE__ */ i("li", { className: "flex items-center justify-center", children: /* @__PURE__ */ i("button", { onClick: t, disabled: l, children: /* @__PURE__ */ i(
32
+ e === "left" ? g : d,
33
+ {
34
+ className: p("h-6 w-6 cursor-pointer", {
35
+ "text-blue-600": !l,
36
+ "text-slate-400 cursor-not-allowed": l
37
+ })
38
+ }
39
+ ) }) })
40
+ );
41
+ a.displayName = "NavigationButton";
42
+ const k = () => {
43
+ const { totalPages: e, page: t, handlePage: l } = f();
44
+ return /* @__PURE__ */ m("ul", { className: "flex items-center gap-2", children: [
45
+ /* @__PURE__ */ i(
46
+ a,
47
+ {
48
+ direction: "left",
49
+ onClick: () => l(t - 1),
50
+ disabled: t === 0
51
+ }
52
+ ),
53
+ (() => {
54
+ if (e <= 5)
55
+ return Array.from({ length: e }, (s, c) => /* @__PURE__ */ i(
56
+ r,
57
+ {
58
+ index: c,
59
+ currentPage: t,
60
+ handlePage: l
61
+ },
62
+ c
63
+ ));
64
+ const n = [];
65
+ if (t < 3) {
66
+ for (let s = 0; s < 3; s++)
67
+ n.push(
68
+ /* @__PURE__ */ i(
69
+ r,
70
+ {
71
+ index: s,
72
+ currentPage: t,
73
+ handlePage: l
74
+ },
75
+ s
76
+ )
77
+ );
78
+ n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis" }, "ellipsis"));
79
+ for (let s = e - 2; s < e; s++)
80
+ n.push(
81
+ /* @__PURE__ */ i(
82
+ r,
83
+ {
84
+ index: s,
85
+ currentPage: t,
86
+ handlePage: l
87
+ },
88
+ s
89
+ )
90
+ );
91
+ } else if (t >= e - 5) {
92
+ n.push(
93
+ /* @__PURE__ */ i(
94
+ r,
95
+ {
96
+ index: 0,
97
+ currentPage: t,
98
+ handlePage: l
99
+ },
100
+ 0
101
+ )
102
+ ), e > 6 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis" }, "ellipsis"));
103
+ for (let s = Math.max(1, e - 5); s < e; s++)
104
+ n.push(
105
+ /* @__PURE__ */ i(
106
+ r,
107
+ {
108
+ index: s,
109
+ currentPage: t,
110
+ handlePage: l
111
+ },
112
+ s
113
+ )
114
+ );
115
+ } else {
116
+ n.push(
117
+ /* @__PURE__ */ i(
118
+ r,
119
+ {
120
+ index: 0,
121
+ currentPage: t,
122
+ handlePage: l
123
+ },
124
+ 0
125
+ )
126
+ ), t > 3 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis1" }, "ellipsis1"));
127
+ for (let s = t - 1; s <= t + 1; s++)
128
+ s > 0 && s < e - 1 && n.push(
129
+ /* @__PURE__ */ i(
130
+ r,
131
+ {
132
+ index: s,
133
+ currentPage: t,
134
+ handlePage: l
135
+ },
136
+ s
137
+ )
138
+ );
139
+ t < e - 4 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis2" }, "ellipsis2")), n.push(
140
+ /* @__PURE__ */ i(
141
+ r,
142
+ {
143
+ index: e - 1,
144
+ currentPage: t,
145
+ handlePage: l
146
+ },
147
+ e - 1
148
+ )
149
+ );
150
+ }
151
+ return n;
152
+ })(),
153
+ /* @__PURE__ */ i(
154
+ a,
155
+ {
156
+ direction: "right",
157
+ onClick: () => l(t + 1),
158
+ disabled: t >= e - 1
159
+ }
160
+ )
161
+ ] });
162
+ };
163
+ export {
164
+ k as DotPaginate
165
+ };
@@ -0,0 +1,34 @@
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { useMemo as p, useCallback as l } from "react";
3
+ import { Dropdown as c } from "../../../Dropdown/Dropdown.js";
4
+ import { DEFAULT_PAGE_SIZES as g } from "../../constants/pagination.js";
5
+ import { useTableContext as x } from "../../contexts/table.hook.js";
6
+ const b = ({
7
+ pageSizes: n = g
8
+ }) => {
9
+ const { pageSize: s, onPageSize: o, handlePage: t } = x(), r = p(
10
+ () => n.map(String).map((e) => ({ label: e, value: e })),
11
+ []
12
+ ), m = l(
13
+ (e) => {
14
+ o(Number(e)), t(0);
15
+ },
16
+ [t, o]
17
+ );
18
+ return /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
19
+ /* @__PURE__ */ a("span", { children: "Show" }),
20
+ /* @__PURE__ */ a(
21
+ c,
22
+ {
23
+ className: "w-22 [&>div>p]:text-xs bg-white",
24
+ listItemClassName: "[&>p]:text-xs",
25
+ options: r,
26
+ value: s.toString(),
27
+ onChange: ({ target: e }) => m(e.value)
28
+ }
29
+ )
30
+ ] });
31
+ };
32
+ export {
33
+ b as DropdownPaginate
34
+ };
@@ -0,0 +1,88 @@
1
+ import { jsxs as m, jsx as l } from "react/jsx-runtime";
2
+ import { d as v } from "../../../../debounce-BFejQm9P.js";
3
+ import { useRef as O, useCallback as u, useMemo as p } from "react";
4
+ import { Filter as n } from "../../../Filter/Filter.js";
5
+ import { Input as R } from "../../../Input/Input.js";
6
+ import { Button as y } from "../../../Button/Button.js";
7
+ import { useTableContext as B } from "../../contexts/table.hook.js";
8
+ const $ = ({
9
+ actions: d,
10
+ multiSelectFilter: f,
11
+ placeholder: h,
12
+ showFilterInput: g = !0,
13
+ showResetButton: x = !0
14
+ }) => {
15
+ const s = O(null), {
16
+ termOfSearch: o,
17
+ multiselectSelected: c,
18
+ onChangeTermOfSearch: a,
19
+ onSelectMultiselect: i
20
+ } = B(), C = u(
21
+ (e, t) => i(
22
+ e,
23
+ t.map((r) => r.id)
24
+ ),
25
+ [i]
26
+ ), S = u(() => {
27
+ a(""), s.current && (s.current.value = "");
28
+ }, [a]), b = p(
29
+ () => v((e) => {
30
+ a(e.target.value);
31
+ }, 500),
32
+ [a]
33
+ ), F = p(
34
+ () => !!o || Object.entries(c ?? {}).map(([, e]) => e).flat().length > 0,
35
+ [o, c]
36
+ );
37
+ return /* @__PURE__ */ m("div", { className: "w-full flex items-center justify-end pb-6", children: [
38
+ g && /* @__PURE__ */ l(
39
+ R,
40
+ {
41
+ ref: s,
42
+ placeholder: h,
43
+ isSearch: !0,
44
+ autoComplete: "false",
45
+ className: "w-72",
46
+ inputMode: "search",
47
+ onChange: b
48
+ }
49
+ ),
50
+ /* @__PURE__ */ m(n, { children: [
51
+ f?.map(
52
+ ({ key: e, label: t, position: r = "right", options: M }) => /* @__PURE__ */ l(
53
+ n.BadgeMultiSelect,
54
+ {
55
+ label: t,
56
+ position: r,
57
+ options: M,
58
+ onApply: (j) => {
59
+ C(e, j);
60
+ }
61
+ },
62
+ t
63
+ )
64
+ ),
65
+ d?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */ l(
66
+ y,
67
+ {
68
+ variant: r,
69
+ appearance: "compact",
70
+ onClick: t,
71
+ children: e
72
+ },
73
+ e
74
+ )),
75
+ x && /* @__PURE__ */ l(
76
+ n.ResetButton,
77
+ {
78
+ className: "text-slate-700 hover:text-slate-700 disabled:text-slate-700/45 select-none",
79
+ disabled: !F,
80
+ onClick: S
81
+ }
82
+ )
83
+ ] })
84
+ ] });
85
+ };
86
+ export {
87
+ $ as Filter
88
+ };