@konstructio/ui 0.1.3 → 0.1.4

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 (95) hide show
  1. package/dist/{Breadcrumb-DzavonoC.js → Breadcrumb-BiiOnn0p.js} +1 -1
  2. package/dist/{CollapsedSteps-CkMuzOHx.js → CollapsedSteps-Dy2I7XDd.js} +35 -35
  3. package/dist/{Input-C1Js3pbF.js → Input-CE6J6HIW.js} +6 -6
  4. package/dist/components/Alert/Alert.js +19 -18
  5. package/dist/components/Alert/Alert.variants.js +11 -4
  6. package/dist/components/Autocomplete/Autocomplete.variants.js +6 -5
  7. package/dist/components/Badge/Badge.js +20 -20
  8. package/dist/components/Badge/Badge.variants.js +5 -0
  9. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  10. package/dist/components/Breadcrumb/components/BackButton/BackButton.variants.js +1 -1
  11. package/dist/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.js +1 -1
  12. package/dist/components/Breadcrumb/components/Item/Item.variants.js +2 -2
  13. package/dist/components/Breadcrumb/components/index.js +1 -1
  14. package/dist/components/Button/Button.variants.js +2 -1
  15. package/dist/components/ButtonGroup/ButtonGroup.js +67 -63
  16. package/dist/components/ButtonGroup/ButtonGroup.variants.js +18 -5
  17. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +51 -32
  18. package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +56 -8
  19. package/dist/components/Checkbox/Checkbox.variants.js +8 -4
  20. package/dist/components/Command/components/DialogContent.js +5 -5
  21. package/dist/components/ConfirmDialog/ConfirmDialog.js +1 -1
  22. package/dist/components/CopyButton/CopyButton.variants.js +4 -3
  23. package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +1 -1
  24. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
  25. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +1 -1
  26. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
  27. package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
  28. package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
  29. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
  30. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
  31. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +1 -1
  32. package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
  33. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
  34. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
  35. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +15 -14
  36. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +22 -22
  37. package/dist/components/Input/Input.js +1 -1
  38. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +6 -2
  39. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +5 -5
  40. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +1 -1
  41. package/dist/components/Range/Range.variants.js +9 -4
  42. package/dist/components/Select/Select.js +21 -20
  43. package/dist/components/Select/components/ListItem/ListItem.js +47 -37
  44. package/dist/components/Select/contexts/select.context.js +1 -0
  45. package/dist/components/Select/contexts/select.provider.js +28 -27
  46. package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +3 -1
  47. package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.variants.js +6 -3
  48. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -0
  49. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +4 -2
  50. package/dist/components/Slider/Slider.variants.js +9 -4
  51. package/dist/components/Switch/Switch.variants.js +8 -4
  52. package/dist/components/Table/components/Filter.js +1 -1
  53. package/dist/components/Toast/Toast.variants.js +7 -3
  54. package/dist/components/VirtualizedTable/assets/chevron-down.js +6 -6
  55. package/dist/components/VirtualizedTable/assets/chevron-up.js +4 -4
  56. package/dist/components/VirtualizedTable/components/Body/Body.js +59 -56
  57. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +42 -40
  58. package/dist/components/VirtualizedTable/components/Filter/Filter.js +85 -68
  59. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
  60. package/dist/components/VirtualizedTable/components/Header/Header.js +51 -49
  61. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +34 -33
  62. package/dist/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.js +11 -11
  63. package/dist/components/VirtualizedTable/constants/index.js +10 -5
  64. package/dist/components/VirtualizedTable/constants/responsive.js +70 -1
  65. package/dist/components/VirtualizedTable/hooks/index.js +6 -2
  66. package/dist/components/VirtualizedTable/hooks/useDisplayedColumnCount/index.js +4 -0
  67. package/dist/components/VirtualizedTable/hooks/useDisplayedColumnCount/useDisplayedColumnCount.js +20 -0
  68. package/dist/components/VirtualizedTable/hooks/useIsFlexWrapped/index.js +4 -0
  69. package/dist/components/VirtualizedTable/hooks/useIsFlexWrapped/useIsFlexWrapped.js +18 -0
  70. package/dist/components/VirtualizedTable/utils/index.js +10 -8
  71. package/dist/components/VirtualizedTable/utils/responsive-edges/responsive-edges.js +8 -0
  72. package/dist/components/index.js +77 -73
  73. package/dist/{constants-q2QnJrOb.js → constants-YCGllWdf.js} +1 -1
  74. package/dist/index.js +77 -73
  75. package/dist/lib/components/ButtonGroup/ButtonGroup.types.d.ts +2 -0
  76. package/dist/lib/components/ButtonGroup/ButtonGroup.variants.d.ts +1 -0
  77. package/dist/lib/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.types.d.ts +2 -1
  78. package/dist/lib/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.d.ts +9 -0
  79. package/dist/lib/components/Select/Select.types.d.ts +2 -0
  80. package/dist/lib/components/Select/contexts/select.context.d.ts +1 -0
  81. package/dist/lib/components/Select/contexts/select.provider.d.ts +1 -0
  82. package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +5 -0
  83. package/dist/lib/components/VirtualizedTable/assets/chevron-down.d.ts +1 -2
  84. package/dist/lib/components/VirtualizedTable/assets/chevron-up.d.ts +1 -2
  85. package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +10 -0
  86. package/dist/lib/components/VirtualizedTable/hooks/index.d.ts +2 -0
  87. package/dist/lib/components/VirtualizedTable/hooks/useDisplayedColumnCount/index.d.ts +1 -0
  88. package/dist/lib/components/VirtualizedTable/hooks/useDisplayedColumnCount/useDisplayedColumnCount.d.ts +1 -0
  89. package/dist/lib/components/VirtualizedTable/hooks/useIsFlexWrapped/index.d.ts +1 -0
  90. package/dist/lib/components/VirtualizedTable/hooks/useIsFlexWrapped/useIsFlexWrapped.d.ts +2 -0
  91. package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
  92. package/dist/lib/components/VirtualizedTable/utils/responsive-edges/responsive-edges.d.ts +6 -0
  93. package/dist/package.json +8 -8
  94. package/dist/styles.css +1 -1
  95. package/package.json +8 -8
@@ -1,16 +1,16 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- var i = ({ className: e, onClick: r }) => /* @__PURE__ */ o("svg", {
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ var o = ({ className: r }) => /* @__PURE__ */ e("svg", {
3
3
  width: "7",
4
4
  height: "5",
5
5
  viewBox: "0 0 7 5",
6
6
  fill: "none",
7
- className: e,
8
- onClick: r,
9
- children: /* @__PURE__ */ o("path", {
7
+ className: r,
8
+ "aria-hidden": !0,
9
+ children: /* @__PURE__ */ e("path", {
10
10
  d: "M0.8225 0L3.5 2.67167L6.1775 0L7 0.8225L3.5 4.3225L0 0.8225L0.8225 0Z",
11
11
  fill: "currentColor"
12
12
  })
13
13
  });
14
14
  export {
15
- i as default
15
+ o as default
16
16
  };
@@ -1,16 +1,16 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- var l = ({ className: o, onClick: t }) => /* @__PURE__ */ r("svg", {
2
+ var t = ({ className: e }) => /* @__PURE__ */ r("svg", {
3
3
  width: "7",
4
4
  height: "5",
5
5
  viewBox: "0 0 7 5",
6
6
  fill: "currentColor",
7
- className: o,
8
- onClick: t,
7
+ className: e,
8
+ "aria-hidden": !0,
9
9
  children: /* @__PURE__ */ r("path", {
10
10
  d: "M0.8225 4.99999L3.5 2.32832L6.1775 4.99999L7 4.17749L3.5 0.67749L0 4.17749L0.8225 4.99999Z",
11
11
  fill: "currentColor"
12
12
  })
13
13
  });
14
14
  export {
15
- l as default
15
+ t as default
16
16
  };
@@ -1,77 +1,80 @@
1
- import { n as T } from "../../../../table.provider-Dhs7WtwK.js";
2
- import { Skeleton as q } from "../Skeleton/Skeleton.js";
3
- import { t as r } from "../../../../utils-DnIJruo0.js";
4
- import { HIDE_BELOW_CLASS as G } from "../../constants/responsive.js";
5
- import { useTableContext as J } from "../../contexts/table.hook.js";
6
- import { getPinnedCellProps as K } from "../../utils/pinned-columns/pinned-columns.js";
7
- import { isPaginationBarVisible as Q } from "../../utils/pagination.js";
8
- import { ExpandableRow as U } from "../ExpandableRow/ExpandableRow.js";
9
- import { Fragment as X } from "react";
10
- import { jsx as e, jsxs as Y } from "react/jsx-runtime";
11
- var se = ({ isLoading: y, showPagination: E, emptyState: C, errorState: n }) => {
12
- const { table: d, pageSize: R, totalItems: D = -1 / 0, tableLoading: _, tableError: c, enableExpandedRow: B, classNameExpandedRow: L, classNameExpandedCell: j, classNameExpandedContent: z, enableHoverRow: f, classNameHoverRow: P, classNameActiveExpandedRow: V, renderExpandedRow: u, isBorderOnAdjacentCell: A, isExpandColumnVisible: H, pinnedWidths: O } = J();
13
- if (y || _) return /* @__PURE__ */ e(q, {
14
- numberOfRows: R,
15
- table: d
1
+ import { n as X } from "../../../../table.provider-Dhs7WtwK.js";
2
+ import { Skeleton as Y } from "../Skeleton/Skeleton.js";
3
+ import { t as a } from "../../../../utils-DnIJruo0.js";
4
+ import { BORDER_EDGE_CLASSES as Z, HIDE_BELOW_CLASS as $, ROUNDED_BOTTOM_EDGE_CLASSES as I } from "../../constants/responsive.js";
5
+ import { useTableContext as ee } from "../../contexts/table.hook.js";
6
+ import { useDisplayedColumnCount as te } from "../../hooks/useDisplayedColumnCount/useDisplayedColumnCount.js";
7
+ import { getPinnedCellProps as re } from "../../utils/pinned-columns/pinned-columns.js";
8
+ import { getResponsiveEdgeClasses as N } from "../../utils/responsive-edges/responsive-edges.js";
9
+ import { isPaginationBarVisible as ae } from "../../utils/pagination.js";
10
+ import { ExpandableRow as oe } from "../ExpandableRow/ExpandableRow.js";
11
+ import { Fragment as ne } from "react";
12
+ import { jsx as e, jsxs as se } from "react/jsx-runtime";
13
+ var Ee = ({ isLoading: D, showPagination: _, emptyState: B, errorState: l }) => {
14
+ const { table: i, pageSize: S, totalItems: L = -1 / 0, tableLoading: O, tableError: g, enableExpandedRow: A, classNameExpandedRow: j, classNameExpandedCell: z, classNameExpandedContent: P, enableHoverRow: E, classNameHoverRow: V, classNameActiveExpandedRow: H, renderExpandedRow: k, isBorderOnAdjacentCell: M, isExpandColumnVisible: T, pinnedWidths: F } = ee(), [G, W] = te();
15
+ if (D || O) return /* @__PURE__ */ e(Y, {
16
+ numberOfRows: S,
17
+ table: i
16
18
  });
17
- const a = d.getRowModel().rows ?? [], l = E && Q(D), x = a.length === 0 && !!c && !!n, h = a.length > 0 ? null : c && n ? typeof n == "function" ? n(c) : n : C ?? null;
18
- if (h) {
19
- const s = d.getVisibleLeafColumns().length;
19
+ const t = i.getRowModel().rows ?? [], d = _ && ae(L), w = t.length === 0 && !!g && !!l, C = t.length > 0 ? null : g && l ? typeof l == "function" ? l(g) : l : B ?? null;
20
+ if (C) {
21
+ const m = W ?? i.getVisibleLeafColumns().length;
20
22
  return /* @__PURE__ */ e("tbody", {
21
- className: r("kvt-body", "text-slate-800", "text-sm", "font-normal", "relative", "dark:border-x"),
23
+ ref: G,
24
+ className: a("kvt-body", "text-slate-800", "text-sm", "font-normal", "relative", "dark:border-x"),
22
25
  children: /* @__PURE__ */ e("tr", {
23
- className: r(x ? "kvt-error-row" : "kvt-empty-row", "border-b", "border-b-gray-200", "dark:border-b-metal-700", "bg-transparent"),
26
+ className: a(w ? "kvt-error-row" : "kvt-empty-row", "border-b", "border-b-gray-200", "dark:border-b-metal-700", "bg-transparent"),
24
27
  "data-empty-row": !0,
25
- "data-error-row": x ? !0 : void 0,
28
+ "data-error-row": w ? !0 : void 0,
26
29
  children: /* @__PURE__ */ e("td", {
27
- colSpan: s,
28
- className: r("p-0", "bg-white", "dark:bg-metal-900", "dark:border", "dark:border-metal-700", "rounded-b-lg"),
30
+ colSpan: m,
31
+ className: a("p-0", "bg-white", "dark:bg-metal-900", "dark:border", "dark:border-metal-700", "rounded-b-lg"),
29
32
  children: /* @__PURE__ */ e("div", {
30
33
  className: "flex items-center justify-center",
31
- children: h
34
+ children: C
32
35
  })
33
36
  })
34
37
  })
35
38
  });
36
39
  }
37
40
  return /* @__PURE__ */ e("tbody", {
38
- className: r("kvt-body", "text-slate-800", "text-sm", "font-normal", "relative", "dark:border-x"),
39
- children: a.map((s, b) => {
40
- const { id: p, original: g, getVisibleCells: F } = s, { meta: i = {} } = g, m = F(), o = B && s.getIsExpanded(), I = !!i.expandedRow || !!u, k = m[0]?.column.id !== "__expand" || H ? 0 : A ? 1 : null;
41
- return /* @__PURE__ */ Y(X, { children: [/* @__PURE__ */ e("tr", {
42
- className: r("kvt-row", { "group/row": f }, "border-b", "border-b-gray-200", "dark:text-metal-50", "dark:border-b-metal-700", "bg-transparent", i.className),
43
- "data-row-id": p,
44
- ...i.attributes ?? {},
45
- children: m.map(({ id: M, column: t, getContext: S }, w) => {
46
- const W = typeof t.columnDef.meta?.className == "function" ? t.columnDef.meta?.className(g) : t.columnDef.meta?.className, { hideBelow: N } = t.columnDef.meta ?? {}, v = K(d, t, O);
41
+ className: a("kvt-body", "text-slate-800", "text-sm", "font-normal", "relative", "dark:border-x"),
42
+ children: t.map((m, c) => {
43
+ const { id: f, original: u, getVisibleCells: U } = m, { meta: p = {} } = u, o = U(), n = A && m.getIsExpanded(), q = !!p.expandedRow || !!k, h = o.map(({ column: x }) => x.columnDef.meta?.hideBelow), s = h.some(Boolean) && o[0]?.column.id !== "__expand", J = c === t.length - 1 && !d && !n, R = o[0]?.column.id !== "__expand" || T ? 0 : M ? 1 : null;
44
+ return /* @__PURE__ */ se(ne, { children: [/* @__PURE__ */ e("tr", {
45
+ className: a("kvt-row", { "group/row": E }, "border-b", "border-b-gray-200", "dark:text-metal-50", "dark:border-b-metal-700", "bg-transparent", p.className),
46
+ "data-row-id": f,
47
+ ...p.attributes ?? {},
48
+ children: o.map(({ id: x, column: r, getContext: K }, b) => {
49
+ const Q = typeof r.columnDef.meta?.className == "function" ? r.columnDef.meta?.className(u) : r.columnDef.meta?.className, { hideBelow: v } = r.columnDef.meta ?? {}, y = re(i, r, F);
47
50
  return /* @__PURE__ */ e("td", {
48
- style: v.style,
49
- className: r("kvt-cell", "px-4", "py-1", "text-sm", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "[tr[data-actions-open]_&]:bg-zinc-100", "dark:[tr[data-actions-open]_&]:bg-metal-800", {
50
- "group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800": f,
51
- [r("bg-zinc-100 dark:bg-metal-800", V)]: !!o
52
- }, P, v.className, N && G[N], W, {
53
- "rounded-bl-lg": b === a.length - 1 && k !== null && w === k && !l && !o,
54
- "rounded-br-lg": b === a.length - 1 && w === m.length - 1 && !l && !o,
55
- "dark:[tr:last-child_&]:border-b": !l
51
+ style: y.style,
52
+ className: a("kvt-cell", "px-4", "py-1", "text-sm", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", !s && "dark:first:border-l", !s && "dark:last:border-r", s && N(h, b, Z), s && J && N(h, b, I), "[tr[data-actions-open]_&]:bg-zinc-100", "dark:[tr[data-actions-open]_&]:bg-metal-800", {
53
+ "group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800": E,
54
+ [a("bg-zinc-100 dark:bg-metal-800", H)]: !!n
55
+ }, V, y.className, v && $[v], Q, {
56
+ "rounded-bl-lg": !s && c === t.length - 1 && R !== null && b === R && !d && !n,
57
+ "rounded-br-lg": !s && c === t.length - 1 && b === o.length - 1 && !d && !n,
58
+ "dark:[tr:last-child_&]:border-b": !d
56
59
  }),
57
- "data-expanded": o ? !0 : void 0,
58
- ...t.columnDef.meta?.attributes ?? {},
59
- children: T(t.columnDef.cell, S())
60
- }, M);
60
+ "data-expanded": n ? !0 : void 0,
61
+ ...r.columnDef.meta?.attributes ?? {},
62
+ children: X(r.columnDef.cell, K())
63
+ }, x);
61
64
  })
62
- }), I && /* @__PURE__ */ e(U, {
63
- classNameExpandedCell: j,
64
- classNameExpandedContent: z,
65
- classNameExpandedRow: L,
66
- colSpan: m.length,
67
- id: p,
68
- isExpanded: !!o,
69
- isLastRow: b === a.length - 1 && !l,
70
- children: i.expandedRow ?? u?.(g)
71
- })] }, p);
65
+ }), q && /* @__PURE__ */ e(oe, {
66
+ classNameExpandedCell: z,
67
+ classNameExpandedContent: P,
68
+ classNameExpandedRow: j,
69
+ colSpan: o.length,
70
+ id: f,
71
+ isExpanded: !!n,
72
+ isLastRow: c === t.length - 1 && !d,
73
+ children: p.expandedRow ?? k?.(u)
74
+ })] }, f);
72
75
  })
73
76
  });
74
77
  };
75
78
  export {
76
- se as Body
79
+ Ee as Body
77
80
  };
@@ -1,103 +1,105 @@
1
- import { t as d } from "../../../../chevron-left-B1zWfqll.js";
2
- import { t as m } from "../../../../chevron-right-D4OkgIIT.js";
1
+ import { t as m } from "../../../../chevron-left-B1zWfqll.js";
2
+ import { t as f } from "../../../../chevron-right-D4OkgIIT.js";
3
3
  import { t as p } from "../../../../utils-DnIJruo0.js";
4
- import { useTableContext as h } from "../../contexts/table.hook.js";
4
+ import { useTableContext as g } from "../../contexts/table.hook.js";
5
5
  import { memo as u } from "react";
6
- import { jsx as i, jsxs as f } from "react/jsx-runtime";
7
- var l = u(({ index: t, currentPage: e, handlePage: s }) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i("button", {
6
+ import { jsx as i, jsxs as d } from "react/jsx-runtime";
7
+ var a = u(({ index: t, currentPage: e, handlePage: n }) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i("button", {
8
8
  type: "button",
9
- onClick: () => s(t),
10
- className: p("px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer dark:text-aurora-500", { "bg-blue-600 text-white font-semibold dark:bg-aurora-500 dark:text-metal-800": t === e }),
9
+ onClick: () => n(t),
10
+ className: p("inline-flex items-center justify-center px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer dark:text-aurora-500 outline-none focus-visible:ring-1 focus-visible:ring-aurora-500", "tap-target pointer-coarse:min-h-11 pointer-coarse:min-w-11 active:bg-blue-50 dark:active:bg-metal-700", { "bg-blue-600 text-white font-semibold dark:bg-aurora-500 dark:text-metal-800": t === e }),
11
11
  children: t + 1
12
12
  }) }, t));
13
- l.displayName = "KonstructPageButton";
14
- var n = u(({ keyValue: t }) => /* @__PURE__ */ i("li", {
13
+ a.displayName = "KonstructPageButton";
14
+ var l = u(({ keyValue: t }) => /* @__PURE__ */ i("li", {
15
15
  className: "px-2",
16
16
  children: /* @__PURE__ */ i("span", {
17
17
  className: "text-blue-600 select-none dark:text-aurora-500",
18
18
  children: "..."
19
19
  })
20
20
  }, t));
21
- n.displayName = "KonstructEllipsis";
22
- var o = u(({ direction: t, disabled: e, onClick: s }) => /* @__PURE__ */ i("li", {
21
+ l.displayName = "KonstructEllipsis";
22
+ var o = u(({ direction: t, disabled: e, onClick: n }) => /* @__PURE__ */ i("li", {
23
23
  className: "flex items-center justify-center",
24
24
  children: /* @__PURE__ */ i("button", {
25
- onClick: s,
25
+ type: "button",
26
+ className: "flex items-center justify-center rounded outline-none focus-visible:ring-1 focus-visible:ring-aurora-500 tap-target pointer-coarse:min-h-11 pointer-coarse:min-w-11",
27
+ onClick: n,
26
28
  disabled: e,
27
- children: /* @__PURE__ */ i(t === "left" ? d : m, { className: p("h-6 w-6 cursor-pointer", {
29
+ children: /* @__PURE__ */ i(t === "left" ? m : f, { className: p("h-6 w-6 cursor-pointer", {
28
30
  "text-blue-600 dark:text-aurora-500": !e,
29
31
  "text-slate-400 cursor-not-allowed": e
30
32
  }) })
31
33
  })
32
34
  }));
33
35
  o.displayName = "KonstructNavigationButton";
34
- var v = () => {
35
- const { totalPages: t, page: e, handlePage: s } = h();
36
- return /* @__PURE__ */ f("ul", {
36
+ var N = () => {
37
+ const { totalPages: t, page: e, handlePage: n } = g();
38
+ return /* @__PURE__ */ d("ul", {
37
39
  className: "flex items-center gap-2",
38
40
  children: [
39
41
  /* @__PURE__ */ i(o, {
40
42
  direction: "left",
41
- onClick: () => s(e - 1),
43
+ onClick: () => n(e - 1),
42
44
  disabled: e === 0
43
45
  }),
44
46
  (() => {
45
- if (t <= 5) return Array.from({ length: t }, (r, c) => /* @__PURE__ */ i(l, {
47
+ if (t <= 5) return Array.from({ length: t }, (r, c) => /* @__PURE__ */ i(a, {
46
48
  index: c,
47
49
  currentPage: e,
48
- handlePage: s
50
+ handlePage: n
49
51
  }, c));
50
- const a = [];
52
+ const s = [];
51
53
  if (e < 3) {
52
- for (let r = 0; r < 3; r++) a.push(/* @__PURE__ */ i(l, {
54
+ for (let r = 0; r < 3; r++) s.push(/* @__PURE__ */ i(a, {
53
55
  index: r,
54
56
  currentPage: e,
55
- handlePage: s
57
+ handlePage: n
56
58
  }, r));
57
- a.push(/* @__PURE__ */ i(n, { keyValue: "ellipsis" }, "ellipsis"));
58
- for (let r = t - 2; r < t; r++) a.push(/* @__PURE__ */ i(l, {
59
+ s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis" }, "ellipsis"));
60
+ for (let r = t - 2; r < t; r++) s.push(/* @__PURE__ */ i(a, {
59
61
  index: r,
60
62
  currentPage: e,
61
- handlePage: s
63
+ handlePage: n
62
64
  }, r));
63
65
  } else if (e >= t - 5) {
64
- a.push(/* @__PURE__ */ i(l, {
66
+ s.push(/* @__PURE__ */ i(a, {
65
67
  index: 0,
66
68
  currentPage: e,
67
- handlePage: s
68
- }, 0)), t > 6 && a.push(/* @__PURE__ */ i(n, { keyValue: "ellipsis" }, "ellipsis"));
69
- for (let r = Math.max(1, t - 5); r < t; r++) a.push(/* @__PURE__ */ i(l, {
69
+ handlePage: n
70
+ }, 0)), t > 6 && s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis" }, "ellipsis"));
71
+ for (let r = Math.max(1, t - 5); r < t; r++) s.push(/* @__PURE__ */ i(a, {
70
72
  index: r,
71
73
  currentPage: e,
72
- handlePage: s
74
+ handlePage: n
73
75
  }, r));
74
76
  } else {
75
- a.push(/* @__PURE__ */ i(l, {
77
+ s.push(/* @__PURE__ */ i(a, {
76
78
  index: 0,
77
79
  currentPage: e,
78
- handlePage: s
79
- }, 0)), e > 3 && a.push(/* @__PURE__ */ i(n, { keyValue: "ellipsis1" }, "ellipsis1"));
80
- for (let r = e - 1; r <= e + 1; r++) r > 0 && r < t - 1 && a.push(/* @__PURE__ */ i(l, {
80
+ handlePage: n
81
+ }, 0)), e > 3 && s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis1" }, "ellipsis1"));
82
+ for (let r = e - 1; r <= e + 1; r++) r > 0 && r < t - 1 && s.push(/* @__PURE__ */ i(a, {
81
83
  index: r,
82
84
  currentPage: e,
83
- handlePage: s
85
+ handlePage: n
84
86
  }, r));
85
- e < t - 4 && a.push(/* @__PURE__ */ i(n, { keyValue: "ellipsis2" }, "ellipsis2")), a.push(/* @__PURE__ */ i(l, {
87
+ e < t - 4 && s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis2" }, "ellipsis2")), s.push(/* @__PURE__ */ i(a, {
86
88
  index: t - 1,
87
89
  currentPage: e,
88
- handlePage: s
90
+ handlePage: n
89
91
  }, t - 1));
90
92
  }
91
- return a;
93
+ return s;
92
94
  })(),
93
95
  /* @__PURE__ */ i(o, {
94
96
  direction: "right",
95
- onClick: () => s(e + 1),
97
+ onClick: () => n(e + 1),
96
98
  disabled: e >= t - 1
97
99
  })
98
100
  ]
99
101
  });
100
102
  };
101
103
  export {
102
- v as DotPaginate
104
+ N as DotPaginate
103
105
  };
@@ -1,65 +1,68 @@
1
- import { o as z } from "../../../../rolldown-runtime-B28h4lGi.js";
2
- import { t as V } from "../../../../debounce-DhCY9mXz.js";
3
- import { Button as $ } from "../../../Button/Button.js";
4
- import { Filter as o } from "../../../Filter/Filter.js";
5
- import { resetEvent as G } from "../../../Filter/events/index.js";
6
- import { t as H } from "../../../../Input-C1Js3pbF.js";
7
- import { t as J } from "../../../../utils-DnIJruo0.js";
8
- import { useTableContext as K } from "../../contexts/table.hook.js";
9
- import { t as Q } from "../../../../events.types-BG1Uh8i6.js";
10
- import { getTableId as U } from "../../utils/get-table-id.js";
11
- import { useEffect as W, useMemo as X, useRef as Y } from "react";
12
- import { jsx as n, jsxs as d } from "react/jsx-runtime";
13
- var Z = /* @__PURE__ */ z(V(), 1), de = ({ id: F, actions: b, filters: v, multiSelectFilter: w, placeholder: S, showFilterInput: x = !0, showResetButton: R = !0, resetButtonClassName: D, closeOnApply: T = !0 }) => {
14
- const l = Y(null), c = U(F), { termOfSearch: k, multiselectSelected: M, dateFilters: E, dateRangeFilters: _, timeFilters: j, onChangeTermOfSearch: m, onSelectMultiselect: A, onSelectDateFilter: I, onSelectDateRangeFilter: i, onSelectTimeFilter: O } = K(), B = [...v ?? w?.map((e) => ({
1
+ import { o as U } from "../../../../rolldown-runtime-B28h4lGi.js";
2
+ import { t as X } from "../../../../debounce-DhCY9mXz.js";
3
+ import { Button as x } from "../../../Button/Button.js";
4
+ import { Filter as n } from "../../../Filter/Filter.js";
5
+ import { resetEvent as Y } from "../../../Filter/events/index.js";
6
+ import { t as Z } from "../../../../Input-CE6J6HIW.js";
7
+ import { t as d } from "../../../../utils-DnIJruo0.js";
8
+ import { HIDE_BELOW_CLASS as C, SHOW_BELOW_CLASS as ee } from "../../constants/responsive.js";
9
+ import { useTableContext as te } from "../../contexts/table.hook.js";
10
+ import { useIsFlexWrapped as ae } from "../../hooks/useIsFlexWrapped/useIsFlexWrapped.js";
11
+ import { t as re } from "../../../../events.types-BG1Uh8i6.js";
12
+ import { getTableId as oe } from "../../utils/get-table-id.js";
13
+ import { useEffect as se, useMemo as ne, useRef as D } from "react";
14
+ import { jsx as o, jsxs as y } from "react/jsx-runtime";
15
+ var le = /* @__PURE__ */ U(X(), 1), De = ({ id: T, actions: _, filters: O, multiSelectFilter: k, placeholder: A, showFilterInput: b = !0, showResetButton: E = !0, resetButtonClassName: B, closeOnApply: I = !0 }) => {
16
+ const l = D(null), v = D(null), M = ae(v), m = oe(T), { termOfSearch: j, multiselectSelected: N, dateFilters: f, dateRangeFilters: g, timeFilters: L, onChangeTermOfSearch: c, onSelectMultiselect: P, onSelectDateFilter: W, onSelectDateRangeFilter: S, onSelectTimeFilter: z } = te(), w = [...O ?? k?.map((e) => ({
15
17
  ...e,
16
18
  type: "badgeMultiSelect"
17
- })) ?? [], ...b ?? []], h = (e, t) => {
18
- A(e, t.map((r) => r.id));
19
- }, P = () => {
20
- m(""), l.current && (l.current.value = "");
19
+ })) ?? [], ..._ ?? []], H = w.filter((e) => e.type === "action" && !!e.iconOnlyBelow), F = (e, t) => {
20
+ P(e, t.map((r) => r.id));
21
+ }, q = () => {
22
+ c(""), l.current && (l.current.value = "");
21
23
  };
22
- W(() => {
24
+ se(() => {
23
25
  const e = new AbortController();
24
- return document.addEventListener(Q.RESET_FILTERS, (t) => {
26
+ return document.addEventListener(re.RESET_FILTERS, (t) => {
25
27
  const { detail: r } = t;
26
- r.tableId === c && (m(""), l.current && (l.current.value = ""), G(c));
28
+ r.tableId === m && (c(""), l.current && (l.current.value = ""), Y(m));
27
29
  }, { signal: e.signal }), () => e.abort();
28
- }, [c, m]);
29
- const g = X(() => (0, Z.default)((e) => {
30
- m(e.target.value);
31
- }, 500), [m]), N = !!k || Object.values(M ?? {}).flat().length > 0 || Object.values(E ?? {}).some(Boolean) || Object.values(_ ?? {}).some(Boolean) || Object.values(j ?? {}).some(Boolean), f = (e) => {
30
+ }, [m, c]);
31
+ const V = ne(() => (0, le.default)((e) => {
32
+ c(e.target.value);
33
+ }, 500), [c]), $ = !!j || Object.values(N ?? {}).flat().length > 0 || Object.values(f ?? {}).some(Boolean) || Object.values(g ?? {}).some(Boolean) || Object.values(L ?? {}).some(Boolean), G = (e) => {
32
34
  if (e.type === "action") {
33
- const { label: a, appearance: y = "compact", variant: p = "secondary", leftIcon: u, rightIcon: L, type: C, ...q } = e;
34
- return /* @__PURE__ */ d($, {
35
- appearance: y,
36
- variant: p,
37
- ...q,
35
+ const { label: a, appearance: p = "compact", variant: i = "secondary", leftIcon: u, rightIcon: h, iconOnlyBelow: R, className: K, type: ce, ...Q } = e;
36
+ return /* @__PURE__ */ y(x, {
37
+ appearance: p,
38
+ variant: i,
39
+ className: d(R && C[R], K),
40
+ ...Q,
38
41
  children: [
39
42
  u,
40
43
  a,
41
- L
44
+ h
42
45
  ]
43
46
  }, a);
44
47
  }
45
- const { key: t, label: r, position: s = "right" } = e;
46
- if (e.type === "textMultiSelect") return /* @__PURE__ */ n(o.TextMultiSelect, {
48
+ const { key: t, label: r, position: s = M ? "left" : "right" } = e;
49
+ if (e.type === "textMultiSelect") return /* @__PURE__ */ o(n.TextMultiSelect, {
47
50
  label: r,
48
51
  position: s,
49
52
  options: e.options,
50
53
  onApply: (a) => {
51
- h(t, a);
54
+ F(t, a);
52
55
  }
53
56
  }, t);
54
- if (e.type === "date") return /* @__PURE__ */ n(o.DateFilterDropdown, {
57
+ if (e.type === "date") return /* @__PURE__ */ o(n.DateFilterDropdown, {
55
58
  label: r,
56
59
  position: s,
57
60
  countryCode: e.countryCode,
58
61
  onApply: (a) => {
59
- I(t, a);
62
+ W(t, a);
60
63
  }
61
64
  }, t);
62
- if (e.type === "dateRange") return /* @__PURE__ */ n(o.DateRangeFilterDropdown, {
65
+ if (e.type === "dateRange") return /* @__PURE__ */ o(n.DateRangeFilterDropdown, {
63
66
  label: r,
64
67
  position: s,
65
68
  showTime: e.showTime,
@@ -70,60 +73,74 @@ var Z = /* @__PURE__ */ z(V(), 1), de = ({ id: F, actions: b, filters: v, multiS
70
73
  maxDate: e.maxDate,
71
74
  countryCode: e.countryCode,
72
75
  onApply: (a) => {
73
- i(t, a);
76
+ S(t, a);
74
77
  },
75
78
  onRangeChange: e.onRangeChange
76
79
  }, t);
77
80
  if (e.type === "customDateRange") {
78
- const { key: a, type: y, ...p } = e;
79
- return /* @__PURE__ */ n(o.CustomDateRangeFilterDropdown, {
80
- ...p,
81
+ const { key: a, type: p, ...i } = e;
82
+ return /* @__PURE__ */ o(n.CustomDateRangeFilterDropdown, {
83
+ ...i,
81
84
  position: s,
82
85
  onApply: (u) => {
83
- i(t, u);
86
+ S(t, u);
84
87
  }
85
88
  }, t);
86
89
  }
87
- return e.type === "time" ? /* @__PURE__ */ n(o.TimeFilterDropdown, {
90
+ return e.type === "time" ? /* @__PURE__ */ o(n.TimeFilterDropdown, {
88
91
  label: r,
89
92
  position: s,
90
93
  format: e.format,
91
94
  presets: e.presets,
92
95
  showTimePicker: e.showTimePicker,
93
96
  onApply: (a) => {
94
- O(t, a);
97
+ z(t, a);
95
98
  }
96
- }, t) : /* @__PURE__ */ n(o.BadgeMultiSelect, {
99
+ }, t) : /* @__PURE__ */ o(n.BadgeMultiSelect, {
97
100
  label: r,
98
101
  position: s,
99
102
  options: e.options,
100
103
  onApply: (a) => {
101
- h(t, a);
104
+ F(t, a);
102
105
  }
103
106
  }, t);
104
- };
105
- return /* @__PURE__ */ d("div", {
106
- className: "kvt-filter w-full flex items-center justify-end gap-y-4 pb-6 max-md:flex-wrap",
107
- children: [x && /* @__PURE__ */ n(H, {
108
- ref: l,
109
- placeholder: S,
110
- isSearch: !0,
111
- autoComplete: "false",
112
- className: "kvt-search w-72 max-md:w-full",
113
- inputMode: "search",
114
- onChange: g
115
- }), /* @__PURE__ */ d(o, {
116
- className: "kvt-filter-actions max-md:w-full max-md:flex-wrap",
117
- closeOnApply: T,
118
- resetScope: c,
119
- children: [B.map(f), R && /* @__PURE__ */ n(o.ResetButton, {
120
- className: J("select-none max-md:ml-auto", D),
121
- disabled: !N,
122
- onClick: P
123
- })]
124
- })]
107
+ }, J = ({ label: e, variant: t = "secondary", leftIcon: r, rightIcon: s, iconOnlyBelow: a, className: p, appearance: i, type: u, ...h }) => /* @__PURE__ */ o(x, {
108
+ variant: t,
109
+ "aria-label": e,
110
+ className: d("relative size-10 shrink-0 p-0 pointer-coarse:min-h-10 touch-hit-area [&>svg]:size-5", a && ee[a], p),
111
+ ...h,
112
+ children: r ?? s
113
+ }, e);
114
+ return /* @__PURE__ */ y("div", {
115
+ ref: v,
116
+ className: d("kvt-filter w-full flex flex-wrap items-center gap-4 pb-6", b ? "justify-between" : "justify-end"),
117
+ children: [
118
+ b && /* @__PURE__ */ o("div", {
119
+ className: "kvt-search-wrapper w-60 min-w-0 max-sm:grow max-sm:basis-0",
120
+ children: /* @__PURE__ */ o(Z, {
121
+ ref: l,
122
+ placeholder: A,
123
+ isSearch: !0,
124
+ autoComplete: "false",
125
+ className: "kvt-search w-full",
126
+ inputMode: "search",
127
+ onChange: V
128
+ })
129
+ }),
130
+ H.map(J),
131
+ /* @__PURE__ */ y(n, {
132
+ className: "kvt-filter-actions flex-wrap gap-4 max-sm:basis-full",
133
+ closeOnApply: I,
134
+ resetScope: m,
135
+ children: [w.map(G), E && /* @__PURE__ */ o(n.ResetButton, {
136
+ className: d("select-none max-md:ml-auto", B),
137
+ disabled: !$,
138
+ onClick: q
139
+ })]
140
+ })
141
+ ]
125
142
  });
126
143
  };
127
144
  export {
128
- de as Filter
145
+ De as Filter
129
146
  };
@@ -1,4 +1,4 @@
1
- import { t as s } from "../../../../Input-C1Js3pbF.js";
1
+ import { t as s } from "../../../../Input-CE6J6HIW.js";
2
2
  import { Typography as i } from "../../../Typography/Typography.js";
3
3
  import { Button as p } from "../../../Button/Button.js";
4
4
  import { useTableContext as u } from "../../contexts/table.hook.js";