@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.50

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 (203) hide show
  1. package/dist/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
  2. package/dist/DatePicker.css +1 -1
  3. package/dist/Modal-CjC-CIJ8.js +99 -0
  4. package/dist/assets/icons/index.js +7 -0
  5. package/dist/chevron-down-DgT-uSF9.js +5 -0
  6. package/dist/chevron-right-DYvXLeql.js +7 -0
  7. package/dist/chevron-up-DEfvgPCw.js +54 -0
  8. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  9. package/dist/components/Alert/Alert.js +2 -2
  10. package/dist/components/AlertDialog/AlertDialog.js +81 -53
  11. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
  12. package/dist/components/AlertDialog/components/index.js +1 -1
  13. package/dist/components/Badge/Badge.js +41 -44
  14. package/dist/components/Badge/Badge.variants.js +52 -13
  15. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  16. package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
  17. package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
  18. package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
  19. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  20. package/dist/components/Button/Button.js +1 -1
  21. package/dist/components/Button/Button.variants.js +108 -98
  22. package/dist/components/Card/Card.variants.js +7 -12
  23. package/dist/components/Checkbox/Checkbox.js +108 -105
  24. package/dist/components/Checkbox/Checkbox.variants.js +34 -7
  25. package/dist/components/Command/Command.js +2 -2
  26. package/dist/components/Command/components/Command.js +1 -1
  27. package/dist/components/Command/components/CommandEmpty.js +1 -1
  28. package/dist/components/Command/components/CommandGroup.js +1 -1
  29. package/dist/components/Command/components/CommandInput.js +2 -2
  30. package/dist/components/Command/components/CommandItem.js +1 -1
  31. package/dist/components/Command/components/CommandList.js +1 -1
  32. package/dist/components/Command/components/CommandSeparator.js +1 -1
  33. package/dist/components/Command/components/DialogContent.js +2 -2
  34. package/dist/components/Command/components/DialogOverlay.js +1 -1
  35. package/dist/components/Counter/Counter.js +210 -0
  36. package/dist/components/Counter/Counter.variants.js +70 -0
  37. package/dist/components/Datepicker/DatePicker.js +1587 -1353
  38. package/dist/components/Divider/Divider.variants.js +1 -1
  39. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  40. package/dist/components/Filter/Filter.js +1 -1
  41. package/dist/components/Filter/Filter.variants.js +8 -7
  42. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
  43. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
  44. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
  45. package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
  46. package/dist/components/Filter/events/index.js +3 -3
  47. package/dist/components/ImageUpload/ImageUpload.js +221 -0
  48. package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
  49. package/dist/components/Input/Input.js +185 -118
  50. package/dist/components/Input/Input.variants.js +24 -19
  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 +4 -4
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
  59. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
  60. package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
  61. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
  62. package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
  63. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
  64. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
  65. package/dist/components/MultiSelectDropdown/components/index.js +8 -0
  66. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
  67. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
  68. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
  69. package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
  70. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
  71. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  72. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
  73. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
  74. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
  75. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
  76. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  77. package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
  78. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  79. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  80. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  81. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  82. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
  83. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  84. package/dist/components/PieChart/PieChart.js +463 -482
  85. package/dist/components/Radio/Radio.js +47 -44
  86. package/dist/components/Radio/Radio.variants.js +12 -8
  87. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  88. package/dist/components/RadioGroup/RadioGroup.js +10 -10
  89. package/dist/components/Range/Range.js +1 -1
  90. package/dist/components/Select/Select.js +48 -0
  91. package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
  92. package/dist/components/Select/components/List/List.js +172 -0
  93. package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
  94. package/dist/components/Select/components/ListItem/ListItem.js +117 -0
  95. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
  96. package/dist/components/Select/components/Wrapper.js +226 -0
  97. package/dist/components/Select/constants/index.js +4 -0
  98. package/dist/components/Select/constants/pagination.js +4 -0
  99. package/dist/components/Select/contexts/index.js +6 -0
  100. package/dist/components/Select/contexts/select.context.js +36 -0
  101. package/dist/components/Select/contexts/select.hook.js +11 -0
  102. package/dist/components/Select/contexts/select.provider.js +58 -0
  103. package/dist/components/Select/hooks/useNavigationList.js +50 -0
  104. package/dist/components/Select/hooks/useSelect.js +103 -0
  105. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  106. package/dist/components/Slider/Slider.js +1 -1
  107. package/dist/components/Switch/Switch.js +156 -129
  108. package/dist/components/Switch/Switch.variants.js +19 -10
  109. package/dist/components/Tabs/Tabs.js +1 -1
  110. package/dist/components/Tabs/Tabs.variants.js +4 -3
  111. package/dist/components/Tabs/components/Content.js +1 -1
  112. package/dist/components/Tabs/components/List.js +1 -1
  113. package/dist/components/Tabs/components/Trigger.js +1 -1
  114. package/dist/components/Tag/Tag.js +1 -1
  115. package/dist/components/Tag/Tag.variants.js +1 -0
  116. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
  117. package/dist/components/TimePicker/TimePicker.js +1 -1
  118. package/dist/components/TimePicker/TimePicker.variants.js +26 -14
  119. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
  120. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
  121. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
  122. package/dist/components/Toast/Toast.js +283 -256
  123. package/dist/components/Toast/Toast.variants.js +37 -24
  124. package/dist/components/Tooltip/Tooltip.js +15 -14
  125. package/dist/components/Tooltip/Tooltip.variants.js +5 -4
  126. package/dist/components/Typography/Typography.js +23 -25
  127. package/dist/components/Typography/Typography.variants.js +55 -52
  128. package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
  129. package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
  130. package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
  131. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
  132. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
  133. package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
  134. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
  135. package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
  136. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
  137. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
  138. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
  139. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  140. package/dist/components/VirtualizedTable/components/index.js +8 -6
  141. package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
  142. package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
  143. package/dist/components/index.js +94 -86
  144. package/dist/contexts/theme.provider.js +0 -1
  145. package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
  146. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  147. package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
  148. package/dist/index-BG8O18ZY.js +93 -0
  149. package/dist/index-BKjcReYh.js +55 -0
  150. package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
  151. package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
  152. package/dist/index-BmVmDQGH.js +662 -0
  153. package/dist/index-BvoZGpli.js +60 -0
  154. package/dist/index-Byr10W8m.js +1873 -0
  155. package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
  156. package/dist/index-CeZcoQDw.js +479 -0
  157. package/dist/index-D6KzX_ef.js +135 -0
  158. package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
  159. package/dist/index-DKfEnhKr.js +200 -0
  160. package/dist/index-DLcqcWxM.js +29 -0
  161. package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
  162. package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
  163. package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
  164. package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
  165. package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
  166. package/dist/index.d.ts +2142 -99
  167. package/dist/index.js +116 -106
  168. package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
  169. package/dist/loader-juvMSJ9L.js +5 -0
  170. package/dist/package.json +43 -33
  171. package/dist/styles.css +1 -1
  172. package/dist/ui/civo-theme.css +194 -168
  173. package/dist/ui/theme.css +27 -0
  174. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  175. package/dist/utils/index.js +534 -501
  176. package/dist/x-BXShoIAM.js +8 -0
  177. package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
  178. package/package.json +43 -33
  179. package/dist/Modal-D-NOEWMX.js +0 -98
  180. package/dist/chevron-down-MZvQoT2F.js +0 -11
  181. package/dist/chevron-right-VYBOBhRt.js +0 -19
  182. package/dist/components/Dropdown/Dropdown.js +0 -42
  183. package/dist/components/Dropdown/components/List/List.js +0 -79
  184. package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
  185. package/dist/components/Dropdown/components/Wrapper.js +0 -205
  186. package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
  187. package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
  188. package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
  189. package/dist/components/Dropdown/contexts/index.js +0 -6
  190. package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
  191. package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
  192. package/dist/components/NumberInput/NumberInput.js +0 -179
  193. package/dist/components/NumberInput/NumberInput.variants.js +0 -50
  194. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
  195. package/dist/index-BITvcJAz.js +0 -423
  196. package/dist/index-BfXxHr_2.js +0 -125
  197. package/dist/index-Cvx4lqTq.js +0 -47
  198. package/dist/index-DBbEcSUG.js +0 -31
  199. package/dist/index-DQH6odE9.js +0 -82
  200. package/dist/index-DzIBBMjs.js +0 -436
  201. package/dist/index-os7vysFS.js +0 -131
  202. /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
  203. /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
@@ -1,25 +1,77 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { f as d } from "../../../../index-Dx2grAuN.js";
3
- import { useTableContext as m } from "../../contexts/table.hook.js";
4
- const p = () => {
5
- const { table: r } = m();
6
- return /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: r.getRowModel().rows.map(({ id: a, getVisibleCells: o }) => /* @__PURE__ */ e(
7
- "tr",
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { f as N } from "../../../../index-CSWGJT-v.js";
3
+ import { Skeleton as h } from "../Skeleton/Skeleton.js";
4
+ import { cn as s } from "../../../../utils/index.js";
5
+ import { useTableContext as y } from "../../contexts/table.hook.js";
6
+ const S = ({
7
+ isLoading: f,
8
+ showPagination: t
9
+ }) => {
10
+ const { table: o, pageSize: i, tableFetching: p } = y();
11
+ if (f || p)
12
+ return /* @__PURE__ */ r(h, { numberOfRows: i, table: o });
13
+ const a = o.getRowModel().rows ?? [];
14
+ return /* @__PURE__ */ r(
15
+ "tbody",
8
16
  {
9
- className: "border border-x-transparent border-t-gray-200 border-b-transparent table w-full table-fixed",
10
- children: o().map(({ id: l, column: t, getContext: s }) => /* @__PURE__ */ e(
11
- "td",
12
- {
13
- className: "px-4 py-1 text-sm",
14
- style: { width: t.getSize() },
15
- children: d(t.columnDef.cell, s())
16
- },
17
- l
18
- ))
19
- },
20
- a
21
- )) });
17
+ className: s(
18
+ "text-slate-800",
19
+ "text-sm",
20
+ "font-normal",
21
+ "relative",
22
+ "dark:border-x"
23
+ ),
24
+ children: a.map(({ id: l, original: m, getVisibleCells: u }, d) => {
25
+ const { meta: b = {} } = m, n = u();
26
+ return /* @__PURE__ */ r(
27
+ "tr",
28
+ {
29
+ className: s(
30
+ "border-b",
31
+ "border-b-gray-200",
32
+ "dark:text-metal-50",
33
+ "dark:border-b-metal-700",
34
+ "last:border-b-transparent",
35
+ "bg-transparent",
36
+ b.className
37
+ ),
38
+ "data-row-id": l,
39
+ ...b.attributes ?? {},
40
+ children: n.map(({ id: k, column: e, getContext: g }, c) => {
41
+ const x = typeof e.columnDef.meta?.className == "function" ? e.columnDef.meta?.className(m) : e.columnDef.meta?.className;
42
+ return /* @__PURE__ */ r(
43
+ "td",
44
+ {
45
+ className: s(
46
+ "px-4",
47
+ "py-1",
48
+ "text-sm",
49
+ "bg-white",
50
+ "dark:bg-metal-900",
51
+ "dark:border-t",
52
+ "dark:border-metal-700",
53
+ "dark:first:border-l",
54
+ "dark:last:border-r",
55
+ x,
56
+ {
57
+ "first:rounded-bl-lg": d === a.length - 1 && c === 0 && !t,
58
+ "last:rounded-br-lg": d === a.length - 1 && c === n.length - 1 && !t,
59
+ "dark:[tr:last-child_&]:border-b": !t
60
+ }
61
+ ),
62
+ ...e.columnDef.meta?.attributes ?? {},
63
+ children: N(e.columnDef.cell, g())
64
+ },
65
+ k
66
+ );
67
+ })
68
+ },
69
+ l
70
+ );
71
+ })
72
+ }
73
+ );
22
74
  };
23
75
  export {
24
- p as Body
76
+ S as Body
25
77
  };
@@ -1,165 +1,168 @@
1
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as h } 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-VYBOBhRt.js";
4
+ import { C as m, a as g } from "../../../../chevron-right-DYvXLeql.js";
5
5
  import { useTableContext as f } from "../../contexts/table.hook.js";
6
- const r = u(
6
+ const l = u(
7
7
  ({
8
- index: e,
9
- currentPage: t,
10
- handlePage: l
11
- }) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
8
+ index: t,
9
+ currentPage: e,
10
+ handlePage: i
11
+ }) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
12
12
  "button",
13
13
  {
14
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
15
+ onClick: () => i(t),
16
+ className: p(
17
+ "px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer dark:text-aurora-500",
18
+ {
19
+ "bg-blue-600 text-white font-semibold dark:bg-aurora-500 dark:text-metal-800": t === e
20
+ }
21
+ ),
22
+ children: t + 1
20
23
  }
21
- ) }, e)
24
+ ) }, t)
22
25
  );
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(
26
+ l.displayName = "KonstructPageButton";
27
+ const a = u(({ keyValue: t }) => /* @__PURE__ */ s("li", { className: "px-2", children: /* @__PURE__ */ s("span", { className: "text-blue-600 select-none dark:text-aurora-500", children: "..." }) }, t));
28
+ a.displayName = "KonstructEllipsis";
29
+ const o = u(
27
30
  ({
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,
31
+ direction: t,
32
+ disabled: e,
33
+ onClick: i
34
+ }) => /* @__PURE__ */ s("li", { className: "flex items-center justify-center", children: /* @__PURE__ */ s("button", { onClick: i, disabled: e, children: /* @__PURE__ */ s(
35
+ t === "left" ? m : g,
33
36
  {
34
37
  className: p("h-6 w-6 cursor-pointer", {
35
- "text-blue-600": !l,
36
- "text-slate-400 cursor-not-allowed": l
38
+ "text-blue-600 dark:text-aurora-500": !e,
39
+ "text-slate-400 cursor-not-allowed": e
37
40
  })
38
41
  }
39
42
  ) }) })
40
43
  );
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,
44
+ o.displayName = "KonstructNavigationButton";
45
+ const N = () => {
46
+ const { totalPages: t, page: e, handlePage: i } = f();
47
+ return /* @__PURE__ */ h("ul", { className: "flex items-center gap-2", children: [
48
+ /* @__PURE__ */ s(
49
+ o,
47
50
  {
48
51
  direction: "left",
49
- onClick: () => l(t - 1),
50
- disabled: t === 0
52
+ onClick: () => i(e - 1),
53
+ disabled: e === 0
51
54
  }
52
55
  ),
53
56
  (() => {
54
- if (e <= 5)
55
- return Array.from({ length: e }, (s, c) => /* @__PURE__ */ i(
56
- r,
57
+ if (t <= 5)
58
+ return Array.from({ length: t }, (r, c) => /* @__PURE__ */ s(
59
+ l,
57
60
  {
58
61
  index: c,
59
- currentPage: t,
60
- handlePage: l
62
+ currentPage: e,
63
+ handlePage: i
61
64
  },
62
65
  c
63
66
  ));
64
67
  const n = [];
65
- if (t < 3) {
66
- for (let s = 0; s < 3; s++)
68
+ if (e < 3) {
69
+ for (let r = 0; r < 3; r++)
67
70
  n.push(
68
- /* @__PURE__ */ i(
69
- r,
71
+ /* @__PURE__ */ s(
72
+ l,
70
73
  {
71
- index: s,
72
- currentPage: t,
73
- handlePage: l
74
+ index: r,
75
+ currentPage: e,
76
+ handlePage: i
74
77
  },
75
- s
78
+ r
76
79
  )
77
80
  );
78
- n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis" }, "ellipsis"));
79
- for (let s = e - 2; s < e; s++)
81
+ n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis" }, "ellipsis"));
82
+ for (let r = t - 2; r < t; r++)
80
83
  n.push(
81
- /* @__PURE__ */ i(
82
- r,
84
+ /* @__PURE__ */ s(
85
+ l,
83
86
  {
84
- index: s,
85
- currentPage: t,
86
- handlePage: l
87
+ index: r,
88
+ currentPage: e,
89
+ handlePage: i
87
90
  },
88
- s
91
+ r
89
92
  )
90
93
  );
91
- } else if (t >= e - 5) {
94
+ } else if (e >= t - 5) {
92
95
  n.push(
93
- /* @__PURE__ */ i(
94
- r,
96
+ /* @__PURE__ */ s(
97
+ l,
95
98
  {
96
99
  index: 0,
97
- currentPage: t,
98
- handlePage: l
100
+ currentPage: e,
101
+ handlePage: i
99
102
  },
100
103
  0
101
104
  )
102
- ), e > 6 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis" }, "ellipsis"));
103
- for (let s = Math.max(1, e - 5); s < e; s++)
105
+ ), t > 6 && n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis" }, "ellipsis"));
106
+ for (let r = Math.max(1, t - 5); r < t; r++)
104
107
  n.push(
105
- /* @__PURE__ */ i(
106
- r,
108
+ /* @__PURE__ */ s(
109
+ l,
107
110
  {
108
- index: s,
109
- currentPage: t,
110
- handlePage: l
111
+ index: r,
112
+ currentPage: e,
113
+ handlePage: i
111
114
  },
112
- s
115
+ r
113
116
  )
114
117
  );
115
118
  } else {
116
119
  n.push(
117
- /* @__PURE__ */ i(
118
- r,
120
+ /* @__PURE__ */ s(
121
+ l,
119
122
  {
120
123
  index: 0,
121
- currentPage: t,
122
- handlePage: l
124
+ currentPage: e,
125
+ handlePage: i
123
126
  },
124
127
  0
125
128
  )
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,
129
+ ), e > 3 && n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis1" }, "ellipsis1"));
130
+ for (let r = e - 1; r <= e + 1; r++)
131
+ r > 0 && r < t - 1 && n.push(
132
+ /* @__PURE__ */ s(
133
+ l,
131
134
  {
132
- index: s,
133
- currentPage: t,
134
- handlePage: l
135
+ index: r,
136
+ currentPage: e,
137
+ handlePage: i
135
138
  },
136
- s
139
+ r
137
140
  )
138
141
  );
139
- t < e - 4 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis2" }, "ellipsis2")), n.push(
140
- /* @__PURE__ */ i(
141
- r,
142
+ e < t - 4 && n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis2" }, "ellipsis2")), n.push(
143
+ /* @__PURE__ */ s(
144
+ l,
142
145
  {
143
- index: e - 1,
144
- currentPage: t,
145
- handlePage: l
146
+ index: t - 1,
147
+ currentPage: e,
148
+ handlePage: i
146
149
  },
147
- e - 1
150
+ t - 1
148
151
  )
149
152
  );
150
153
  }
151
154
  return n;
152
155
  })(),
153
- /* @__PURE__ */ i(
154
- a,
156
+ /* @__PURE__ */ s(
157
+ o,
155
158
  {
156
159
  direction: "right",
157
- onClick: () => l(t + 1),
158
- disabled: t >= e - 1
160
+ onClick: () => i(e + 1),
161
+ disabled: e >= t - 1
159
162
  }
160
163
  )
161
164
  ] });
162
165
  };
163
166
  export {
164
- k as DotPaginate
167
+ N as DotPaginate
165
168
  };
@@ -1,34 +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";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { useMemo as l, useCallback as p } from "react";
3
+ import { Select as c } from "../../../Select/Select.js";
4
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
5
+ import { useTableContext as d } from "../../contexts/table.hook.js";
6
+ const u = ({
7
+ pageSizes: m = g
8
8
  }) => {
9
- const { pageSize: s, onPageSize: o, handlePage: t } = x(), r = p(
10
- () => n.map(String).map((e) => ({ label: e, value: e })),
9
+ const { pageSize: r, onPageSize: t, handlePage: a } = d(), s = l(
10
+ () => m.map(String).map((e) => ({ label: e, value: e })),
11
11
  []
12
- ), m = l(
12
+ ), n = p(
13
13
  (e) => {
14
- o(Number(e)), t(0);
14
+ t(Number(e)), a(0);
15
15
  },
16
- [t, o]
16
+ [a, t]
17
17
  );
18
- return /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
19
- /* @__PURE__ */ a("span", { children: "Show" }),
20
- /* @__PURE__ */ a(
18
+ return /* @__PURE__ */ i("div", { className: "flex items-center gap-2 dark:text-metal-300", children: [
19
+ /* @__PURE__ */ o("span", { children: "Show" }),
20
+ /* @__PURE__ */ o(
21
21
  c,
22
22
  {
23
- className: "w-[88px] [&>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)
23
+ className: "w-22 [&>div>p]:text-sm bg-white",
24
+ listItemClassName: "[&>p]:text-sm dark:bg-metal-800",
25
+ options: s,
26
+ value: r.toString(),
27
+ onChange: ({ target: e }) => n(e.value)
28
28
  }
29
29
  )
30
30
  ] });
31
31
  };
32
32
  export {
33
- b as DropdownPaginate
33
+ u as DropdownPaginate
34
34
  };
@@ -1,73 +1,90 @@
1
1
  import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import { d as M } from "../../../../debounce-BFejQm9P.js";
3
- import { useRef as j, useCallback as u, useMemo as f } from "react";
4
- import { Filter as n } from "../../../Filter/Filter.js";
5
- import { Input as v } from "../../../Input/Input.js";
6
- import { useTableContext as O } from "../../contexts/table.hook.js";
7
- const B = ({
8
- placeholder: h,
9
- multiSelectFilter: d,
10
- showFilterInput: p = !0
2
+ import { d as R } from "../../../../debounce-BFejQm9P.js";
3
+ import { useRef as v, useCallback as u, useMemo as p } from "react";
4
+ import { Button as y } from "../../../Button/Button.js";
5
+ import { Filter as l } from "../../../Filter/Filter.js";
6
+ import { Input as B } from "../../../Input/Input.js";
7
+ import { cn as N } from "../../../../utils/index.js";
8
+ import { useTableContext as T } from "../../contexts/table.hook.js";
9
+ const E = ({
10
+ actions: f,
11
+ multiSelectFilter: h,
12
+ placeholder: d,
13
+ showFilterInput: g = !0,
14
+ showResetButton: C = !0,
15
+ resetButtonClassName: S
11
16
  }) => {
12
- const r = j(null), {
13
- termOfSearch: o,
17
+ const o = v(null), {
18
+ termOfSearch: s,
14
19
  multiselectSelected: c,
15
- onChangeTermOfSearch: t,
20
+ onChangeTermOfSearch: n,
16
21
  onSelectMultiselect: i
17
- } = O(), g = u(
18
- (e, l) => i(
22
+ } = T(), x = u(
23
+ (e, t) => i(
19
24
  e,
20
- l.map((s) => s.id)
25
+ t.map((r) => r.id)
21
26
  ),
22
27
  [i]
23
- ), x = u(() => {
24
- t(""), r.current && (r.current.value = "");
25
- }, [t]), C = f(
26
- () => M((e) => {
27
- t(e.target.value);
28
+ ), F = u(() => {
29
+ n(""), o.current && (o.current.value = "");
30
+ }, [n]), M = p(
31
+ () => R((e) => {
32
+ n(e.target.value);
28
33
  }, 500),
29
- [t]
30
- ), S = f(
31
- () => !!o || Object.entries(c ?? {}).map(([, e]) => e).flat().length > 0,
32
- [o, c]
34
+ [n]
35
+ ), b = p(
36
+ () => !!s || Object.entries(c ?? {}).map(([, e]) => e).flat().length > 0,
37
+ [s, c]
33
38
  );
34
39
  return /* @__PURE__ */ m("div", { className: "w-full flex items-center justify-end pb-6", children: [
35
- p && /* @__PURE__ */ a(
36
- v,
40
+ g && /* @__PURE__ */ a(
41
+ B,
37
42
  {
38
- ref: r,
39
- placeholder: h,
43
+ ref: o,
44
+ placeholder: d,
40
45
  isSearch: !0,
41
46
  autoComplete: "false",
42
47
  className: "w-72",
43
48
  inputMode: "search",
44
- onChange: C
49
+ onChange: M
45
50
  }
46
51
  ),
47
- /* @__PURE__ */ m(n, { children: [
48
- d?.map(
49
- ({ key: e, label: l, position: s = "right", options: b }) => /* @__PURE__ */ a(
50
- n.BadgeMultiSelect,
52
+ /* @__PURE__ */ m(l, { children: [
53
+ h?.map(
54
+ ({ key: e, label: t, position: r = "right", options: j }) => /* @__PURE__ */ a(
55
+ l.BadgeMultiSelect,
51
56
  {
52
- label: l,
53
- position: s,
54
- options: b,
55
- onApply: (F) => g(e, F)
57
+ label: t,
58
+ position: r,
59
+ options: j,
60
+ onApply: (O) => {
61
+ x(e, O);
62
+ }
56
63
  },
57
- l
64
+ t
58
65
  )
59
66
  ),
60
- /* @__PURE__ */ a(
61
- n.ResetButton,
67
+ f?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */ a(
68
+ y,
62
69
  {
63
- className: "text-slate-700 hover:text-slate-700 disabled:text-slate-700/45 select-none",
64
- disabled: !S,
65
- onClick: x
70
+ variant: r,
71
+ appearance: "compact",
72
+ onClick: t,
73
+ children: e
74
+ },
75
+ e
76
+ )),
77
+ C && /* @__PURE__ */ a(
78
+ l.ResetButton,
79
+ {
80
+ className: N("select-none", S),
81
+ disabled: !b,
82
+ onClick: F
66
83
  }
67
84
  )
68
85
  ] })
69
86
  ] });
70
87
  };
71
88
  export {
72
- B as Filter
89
+ E as Filter
73
90
  };
@@ -1,41 +1,53 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { useRef as l, useCallback as p } from "react";
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { useRef as u, useCallback as l } from "react";
3
3
  import { Input as c } from "../../../Input/Input.js";
4
- import { useTableContext as f } from "../../contexts/table.hook.js";
5
- const h = () => {
6
- const r = l(null), { totalPages: e, handlePage: o } = f(), m = p(
7
- (n) => {
8
- n.preventDefault();
9
- const s = new FormData(n.currentTarget), a = Number(s.get("jump-to")), u = (a < e ? a : e) || 1;
10
- o(u - 1), r.current?.reset();
4
+ import { Typography as f } from "../../../Typography/Typography.js";
5
+ import { Button as g } from "../../../Button/Button.js";
6
+ import { useTableContext as x } from "../../contexts/table.hook.js";
7
+ const y = () => {
8
+ const o = u(null), { totalPages: t, handlePage: r } = x(), m = l(
9
+ (a) => {
10
+ a.preventDefault();
11
+ const s = new FormData(a.currentTarget), n = Number(s.get("jump-to")), i = (n < t ? n : t) || 1;
12
+ r(i - 1), o.current?.reset();
11
13
  },
12
- [o, e]
14
+ [r, t]
13
15
  );
14
- return /* @__PURE__ */ i(
16
+ return /* @__PURE__ */ p(
15
17
  "form",
16
18
  {
17
19
  "aria-label": "footer-pagination",
18
- ref: r,
20
+ ref: o,
19
21
  onSubmit: m,
20
22
  className: "flex items-center gap-2",
23
+ noValidate: !0,
21
24
  children: [
22
- /* @__PURE__ */ t("span", { className: "min-w-fit", children: "Jump to" }),
23
- /* @__PURE__ */ t(
25
+ /* @__PURE__ */ e(
26
+ f,
27
+ {
28
+ component: "span",
29
+ className: "text-sm min-w-fit tracking-normal",
30
+ children: "Jump to"
31
+ }
32
+ ),
33
+ /* @__PURE__ */ e(
24
34
  c,
25
35
  {
26
36
  type: "number",
27
- className: "w-[72px] text-xs no-spinner",
37
+ className: "w-18 text-sm no-spinner",
28
38
  name: "jump-to",
29
39
  min: 1,
30
- max: e,
31
- required: !0
40
+ max: t,
41
+ required: !0,
42
+ autoComplete: "off"
32
43
  }
33
44
  ),
34
- /* @__PURE__ */ t(
35
- "button",
45
+ /* @__PURE__ */ e(
46
+ g,
36
47
  {
48
+ variant: "link",
37
49
  type: "submit",
38
- className: "text-xs text-blue-600 p-2 cursor-pointer",
50
+ className: "text-xs p-2 cursor-pointer",
39
51
  children: "Go"
40
52
  }
41
53
  )
@@ -44,5 +56,5 @@ const h = () => {
44
56
  );
45
57
  };
46
58
  export {
47
- h as FormPaginate
59
+ y as FormPaginate
48
60
  };