@konstructio/ui 0.1.2-alpha.119 → 0.1.2-alpha.120

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 (135) hide show
  1. package/dist/Breadcrumb-DDRmDlWK.js +93 -0
  2. package/dist/{Checkbox-DRdyrKjk.js → Checkbox-DrounE52.js} +2 -2
  3. package/dist/{CollapsedSteps-CR7oCTRC.js → CollapsedSteps-DvBeYShi.js} +3 -3
  4. package/dist/{CommandInput-Du2o616y.js → CommandInput-_vujzQ6B.js} +2 -2
  5. package/dist/{Counter-DMkXIsOO.js → Counter-LQ5_uh06.js} +2 -2
  6. package/dist/{DayPicker-BtpJg2q3.js → DayPicker-D7KFB2bI.js} +383 -383
  7. package/dist/DropdownButton-BWfWN4fg.js +121 -0
  8. package/dist/{HamburgerTrigger-BgeS_nBA.js → HamburgerTrigger-CfrAnhmG.js} +10 -10
  9. package/dist/{Input-2M2I_H60.js → Input-O2bqyJKW.js} +2 -2
  10. package/dist/Modal-B-l4ii6w.js +84 -0
  11. package/dist/{Wrapper-JmStmade.js → Wrapper-B5PmrW4J.js} +3 -3
  12. package/dist/{Wrapper-ThpRi_Gg.js → Wrapper-CZCSSCLm.js} +2 -2
  13. package/dist/components/Alert/Alert.js +1 -1
  14. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  15. package/dist/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.js +1 -1
  16. package/dist/components/Breadcrumb/components/index.js +1 -1
  17. package/dist/components/Button/Button.variants.js +1 -0
  18. package/dist/components/Checkbox/Checkbox.js +1 -1
  19. package/dist/components/CheckboxCard/CheckboxCard.js +1 -1
  20. package/dist/components/Command/components/CommandInput.js +1 -1
  21. package/dist/components/Command/components/DialogContent.js +1 -1
  22. package/dist/components/Command/components/index.js +1 -1
  23. package/dist/components/ConfirmDialog/ConfirmDialog.js +7 -5
  24. package/dist/components/CopyButton/CopyButton.variants.js +3 -1
  25. package/dist/components/Counter/Counter.js +1 -1
  26. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +1 -1
  27. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
  28. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
  29. package/dist/components/Datepicker/components/DatePickerContent/DatePickerContent.js +1 -1
  30. package/dist/components/Drawer/Drawer.js +78 -58
  31. package/dist/components/Drawer/Drawer.variants.js +40 -22
  32. package/dist/components/Drawer/components/Footer/Footer.js +5 -5
  33. package/dist/components/Drawer/constants/index.js +5 -4
  34. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  35. package/dist/components/DropdownButton/components/ActionSheet/ActionSheet.js +34 -0
  36. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  37. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
  38. package/dist/components/Filter/utils/index.js +2 -2
  39. package/dist/components/Input/Input.js +1 -1
  40. package/dist/components/Input/Input.variants.js +1 -0
  41. package/dist/components/LineChart/components/LineChartContent/LineChartContent.js +1 -1
  42. package/dist/components/Modal/Modal.js +1 -1
  43. package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
  44. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +12 -6
  45. package/dist/components/Modal/components/index.js +1 -1
  46. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
  47. package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
  48. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
  49. package/dist/components/MultiSelectDropdown/components/index.js +1 -1
  50. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +1 -1
  51. package/dist/components/PhoneNumberInput/components/PhoneNumberInputContent.js +2 -2
  52. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +2 -2
  53. package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
  54. package/dist/components/PhoneNumberInput/components/index.js +1 -1
  55. package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
  56. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
  57. package/dist/components/PhoneNumberInput/utils/index.js +1 -1
  58. package/dist/components/PieChart/components/PieChartContent/PieChartContent.js +1 -1
  59. package/dist/components/Select/Select.variants.js +2 -0
  60. package/dist/components/Select/components/List/List.js +2 -2
  61. package/dist/components/Sheet/Sheet.js +130 -0
  62. package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
  63. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +103 -86
  64. package/dist/components/Sidebar/components/index.js +1 -1
  65. package/dist/components/Table/components/Filter.js +1 -1
  66. package/dist/components/Tabs/components/Trigger.js +13 -13
  67. package/dist/components/TagSelect/TagSelect.js +1 -1
  68. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
  69. package/dist/components/TagSelect/components/index.js +1 -1
  70. package/dist/components/TextArea/TextArea.variants.js +1 -0
  71. package/dist/components/VirtualizedTable/components/Actions/components/ActionsTrigger/ActionsTrigger.js +7 -7
  72. package/dist/components/VirtualizedTable/components/Body/Body.js +47 -44
  73. package/dist/components/VirtualizedTable/components/Filter/Filter.js +68 -68
  74. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
  75. package/dist/components/VirtualizedTable/components/Header/Header.js +38 -31
  76. package/dist/components/VirtualizedTable/components/ScrollContainer/ScrollContainer.js +75 -0
  77. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +42 -35
  78. package/dist/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.js +72 -72
  79. package/dist/components/VirtualizedTable/components/index.js +14 -12
  80. package/dist/components/VirtualizedTable/constants/index.js +5 -3
  81. package/dist/components/VirtualizedTable/constants/responsive.js +10 -0
  82. package/dist/components/VirtualizedTable/contexts/index.js +1 -1
  83. package/dist/components/VirtualizedTable/contexts/table.context.js +4 -0
  84. package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
  85. package/dist/components/VirtualizedTable/utils/index.js +8 -4
  86. package/dist/components/VirtualizedTable/utils/pinned-columns/index.js +6 -0
  87. package/dist/components/VirtualizedTable/utils/pinned-columns/pinned-columns.js +32 -0
  88. package/dist/components/index.js +147 -145
  89. package/dist/{components-B_SWqhCL.js → components-Bq71eyUH.js} +1 -1
  90. package/dist/{country-locale-map-DbrJ3bEE.js → country-locale-map-BQYYErun.js} +1407 -1407
  91. package/dist/{debounce-dMRJxNsT.js → debounce-DhCY9mXz.js} +2 -2
  92. package/dist/{dist-Dg3vyTx9.js → dist-BCqfbYE9.js} +1356 -1317
  93. package/dist/dist-CMqY_9n-.js +445 -0
  94. package/dist/{es2015-B_07N-UL.js → es2015-BvX7Yq5Q.js} +2 -2
  95. package/dist/index.js +158 -156
  96. package/dist/{isSymbol-BG9higgO.js → isSymbol-CcfkyZfq.js} +1 -1
  97. package/dist/lib/components/Drawer/Drawer.types.d.ts +10 -0
  98. package/dist/lib/components/Drawer/Drawer.variants.d.ts +1 -0
  99. package/dist/lib/components/Drawer/constants/index.d.ts +1 -0
  100. package/dist/lib/components/DropdownButton/DropdownButton.d.ts +2 -1
  101. package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +25 -0
  102. package/dist/lib/components/DropdownButton/components/ActionSheet/ActionSheet.d.ts +7 -0
  103. package/dist/lib/components/DropdownButton/components/ActionSheet/ActionSheet.types.d.ts +12 -0
  104. package/dist/lib/components/Modal/Modal.types.d.ts +2 -0
  105. package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +1 -0
  106. package/dist/lib/components/Sheet/Sheet.d.ts +21 -0
  107. package/dist/lib/components/Sheet/Sheet.types.d.ts +39 -0
  108. package/dist/lib/components/Sidebar/Sidebar.types.d.ts +9 -0
  109. package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +11 -2
  110. package/dist/lib/components/VirtualizedTable/components/ScrollContainer/ScrollContainer.d.ts +10 -0
  111. package/dist/lib/components/VirtualizedTable/components/ScrollContainer/ScrollContainer.types.d.ts +6 -0
  112. package/dist/lib/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.d.ts +1 -1
  113. package/dist/lib/components/VirtualizedTable/components/index.d.ts +1 -0
  114. package/dist/lib/components/VirtualizedTable/constants/index.d.ts +1 -0
  115. package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +2 -0
  116. package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +4 -0
  117. package/dist/lib/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
  118. package/dist/lib/components/VirtualizedTable/contexts/table.types.d.ts +2 -1
  119. package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
  120. package/dist/lib/components/VirtualizedTable/utils/pinned-columns/index.d.ts +1 -0
  121. package/dist/lib/components/VirtualizedTable/utils/pinned-columns/pinned-columns.d.ts +23 -0
  122. package/dist/lib/components/index.d.ts +3 -1
  123. package/dist/{libphonenumber-DtibHRPP.js → libphonenumber-BIeQOhzl.js} +196 -164
  124. package/dist/package.json +18 -18
  125. package/dist/{phone-number.provider-DnuL-yYF.js → phone-number.provider-CJeivoDY.js} +2 -2
  126. package/dist/{prop-types-BCUW56rg.js → prop-types-qsAjMBb1.js} +1 -1
  127. package/dist/{rolldown-runtime-Dw9YIBcH.js → rolldown-runtime-B28h4lGi.js} +6 -6
  128. package/dist/styles.css +1 -1
  129. package/dist/{table.provider-CzfMGbe4.js → table.provider-QUo2buYX.js} +561 -523
  130. package/dist/{x-Vur_9PXW.js → x-BmNOD9Gr.js} +2 -2
  131. package/package.json +18 -18
  132. package/dist/Breadcrumb-CpXRb08J.js +0 -93
  133. package/dist/DropdownButton-JilCRLJY.js +0 -92
  134. package/dist/Modal-0Wp5szX4.js +0 -84
  135. package/dist/dist-BCoDIdCt.js +0 -429
@@ -1,66 +1,66 @@
1
- import { o as V } from "../../../../rolldown-runtime-Dw9YIBcH.js";
2
- import { t as $ } from "../../../../Input-2M2I_H60.js";
3
- import { t as G } from "../../../../utils-DnIJruo0.js";
4
- import { Button as H } from "../../../Button/Button.js";
5
- import { resetEvent as J } from "../../../Filter/events/index.js";
6
- import { Filter as a } from "../../../Filter/Filter.js";
7
- import { t as K } from "../../../../debounce-dMRJxNsT.js";
8
- import { useTableContext as Q } from "../../contexts/table.hook.js";
9
- import { t as U } from "../../../../events.types-BG1Uh8i6.js";
10
- import { getTableId as W } from "../../utils/get-table-id.js";
11
- import { useEffect as X, useMemo as Y, useRef as Z } from "react";
12
- import { jsx as n, jsxs as i } from "react/jsx-runtime";
13
- var f = /* @__PURE__ */ V(K(), 1), ie = ({ id: F, actions: b, filters: v, multiSelectFilter: S, placeholder: R, showFilterInput: D = !0, showResetButton: w = !0, resetButtonClassName: T, closeOnApply: k = !0 }) => {
14
- const l = Z(null), m = W(F), { termOfSearch: x, multiselectSelected: M, dateFilters: E, dateRangeFilters: _, timeFilters: j, onChangeTermOfSearch: c, onSelectMultiselect: A, onSelectDateFilter: I, onSelectDateRangeFilter: d, onSelectTimeFilter: O } = Q(), B = [...v ?? S?.map((e) => ({
1
+ import { o as z } from "../../../../rolldown-runtime-B28h4lGi.js";
2
+ import { t as V } from "../../../../Input-O2bqyJKW.js";
3
+ import { t as $ } from "../../../../utils-DnIJruo0.js";
4
+ import { Button as G } from "../../../Button/Button.js";
5
+ import { resetEvent as H } from "../../../Filter/events/index.js";
6
+ import { Filter as o } from "../../../Filter/Filter.js";
7
+ import { t as J } from "../../../../debounce-DhCY9mXz.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(J(), 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) => ({
15
15
  ...e,
16
16
  type: "badgeMultiSelect"
17
17
  })) ?? [], ...b ?? []], h = (e, t) => {
18
- A(e, t.map((o) => o.id));
18
+ A(e, t.map((r) => r.id));
19
19
  }, P = () => {
20
- c(""), l.current && (l.current.value = "");
20
+ m(""), l.current && (l.current.value = "");
21
21
  };
22
- X(() => {
22
+ W(() => {
23
23
  const e = new AbortController();
24
- return document.addEventListener(U.RESET_FILTERS, (t) => {
25
- const { detail: o } = t;
26
- o.tableId === m && (c(""), l.current && (l.current.value = ""), J(m));
24
+ return document.addEventListener(Q.RESET_FILTERS, (t) => {
25
+ const { detail: r } = t;
26
+ r.tableId === c && (m(""), l.current && (l.current.value = ""), H(c));
27
27
  }, { signal: e.signal }), () => e.abort();
28
- }, [m, c]);
29
- const N = Y(() => (0, f.default)((e) => {
30
- c(e.target.value);
31
- }, 500), [c]), g = !!x || Object.values(M ?? {}).flat().length > 0 || Object.values(E ?? {}).some(Boolean) || Object.values(_ ?? {}).some(Boolean) || Object.values(j ?? {}).some(Boolean), L = (e) => {
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) => {
32
32
  if (e.type === "action") {
33
- const { label: r, appearance: y = "compact", variant: p = "secondary", leftIcon: u, rightIcon: q, type: C, ...z } = e;
34
- return /* @__PURE__ */ i(H, {
33
+ const { label: a, appearance: y = "compact", variant: p = "secondary", leftIcon: u, rightIcon: L, type: C, ...q } = e;
34
+ return /* @__PURE__ */ d(G, {
35
35
  appearance: y,
36
36
  variant: p,
37
- ...z,
37
+ ...q,
38
38
  children: [
39
39
  u,
40
- r,
41
- q
40
+ a,
41
+ L
42
42
  ]
43
- }, r);
43
+ }, a);
44
44
  }
45
- const { key: t, label: o, position: s = "right" } = e;
46
- if (e.type === "textMultiSelect") return /* @__PURE__ */ n(a.TextMultiSelect, {
47
- label: o,
45
+ const { key: t, label: r, position: s = "right" } = e;
46
+ if (e.type === "textMultiSelect") return /* @__PURE__ */ n(o.TextMultiSelect, {
47
+ label: r,
48
48
  position: s,
49
49
  options: e.options,
50
- onApply: (r) => {
51
- h(t, r);
50
+ onApply: (a) => {
51
+ h(t, a);
52
52
  }
53
53
  }, t);
54
- if (e.type === "date") return /* @__PURE__ */ n(a.DateFilterDropdown, {
55
- label: o,
54
+ if (e.type === "date") return /* @__PURE__ */ n(o.DateFilterDropdown, {
55
+ label: r,
56
56
  position: s,
57
57
  countryCode: e.countryCode,
58
- onApply: (r) => {
59
- I(t, r);
58
+ onApply: (a) => {
59
+ I(t, a);
60
60
  }
61
61
  }, t);
62
- if (e.type === "dateRange") return /* @__PURE__ */ n(a.DateRangeFilterDropdown, {
63
- label: o,
62
+ if (e.type === "dateRange") return /* @__PURE__ */ n(o.DateRangeFilterDropdown, {
63
+ label: r,
64
64
  position: s,
65
65
  showTime: e.showTime,
66
66
  timeFormat: e.timeFormat,
@@ -69,61 +69,61 @@ var f = /* @__PURE__ */ V(K(), 1), ie = ({ id: F, actions: b, filters: v, multiS
69
69
  minDate: e.minDate,
70
70
  maxDate: e.maxDate,
71
71
  countryCode: e.countryCode,
72
- onApply: (r) => {
73
- d(t, r);
72
+ onApply: (a) => {
73
+ i(t, a);
74
74
  },
75
75
  onRangeChange: e.onRangeChange
76
76
  }, t);
77
77
  if (e.type === "customDateRange") {
78
- const { key: r, type: y, ...p } = e;
79
- return /* @__PURE__ */ n(a.CustomDateRangeFilterDropdown, {
78
+ const { key: a, type: y, ...p } = e;
79
+ return /* @__PURE__ */ n(o.CustomDateRangeFilterDropdown, {
80
80
  ...p,
81
81
  position: s,
82
82
  onApply: (u) => {
83
- d(t, u);
83
+ i(t, u);
84
84
  }
85
85
  }, t);
86
86
  }
87
- return e.type === "time" ? /* @__PURE__ */ n(a.TimeFilterDropdown, {
88
- label: o,
87
+ return e.type === "time" ? /* @__PURE__ */ n(o.TimeFilterDropdown, {
88
+ label: r,
89
89
  position: s,
90
90
  format: e.format,
91
91
  presets: e.presets,
92
92
  showTimePicker: e.showTimePicker,
93
- onApply: (r) => {
94
- O(t, r);
93
+ onApply: (a) => {
94
+ O(t, a);
95
95
  }
96
- }, t) : /* @__PURE__ */ n(a.BadgeMultiSelect, {
97
- label: o,
96
+ }, t) : /* @__PURE__ */ n(o.BadgeMultiSelect, {
97
+ label: r,
98
98
  position: s,
99
99
  options: e.options,
100
- onApply: (r) => {
101
- h(t, r);
100
+ onApply: (a) => {
101
+ h(t, a);
102
102
  }
103
103
  }, t);
104
104
  };
105
- return /* @__PURE__ */ i("div", {
106
- className: "kvt-filter w-full flex items-center justify-end pb-6",
107
- children: [D && /* @__PURE__ */ n($, {
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(V, {
108
108
  ref: l,
109
- placeholder: R,
109
+ placeholder: S,
110
110
  isSearch: !0,
111
111
  autoComplete: "false",
112
- className: "kvt-search w-72",
112
+ className: "kvt-search w-72 max-md:w-full",
113
113
  inputMode: "search",
114
- onChange: N
115
- }), /* @__PURE__ */ i(a, {
116
- className: "kvt-filter-actions",
117
- closeOnApply: k,
118
- resetScope: m,
119
- children: [B.map(L), w && /* @__PURE__ */ n(a.ResetButton, {
120
- className: G("select-none", T),
121
- disabled: !g,
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: $("select-none max-md:ml-auto", D),
121
+ disabled: !N,
122
122
  onClick: P
123
123
  })]
124
124
  })]
125
125
  });
126
126
  };
127
127
  export {
128
- ie as Filter
128
+ de as Filter
129
129
  };
@@ -1,4 +1,4 @@
1
- import { t as s } from "../../../../Input-2M2I_H60.js";
1
+ import { t as s } from "../../../../Input-O2bqyJKW.js";
2
2
  import { Button as i } from "../../../Button/Button.js";
3
3
  import { Typography as p } from "../../../Typography/Typography.js";
4
4
  import { useTableContext as u } from "../../contexts/table.hook.js";
@@ -1,53 +1,60 @@
1
1
  import { t } from "../../../../utils-DnIJruo0.js";
2
- import { useTableContext as g } from "../../contexts/table.hook.js";
3
- import { n as k } from "../../../../table.provider-CzfMGbe4.js";
4
- import u from "../../assets/chevron-up.js";
5
- import C from "../../assets/chevron-down.js";
6
- import { jsx as r, jsxs as o } from "react/jsx-runtime";
7
- var D = ({ className: c, classNameArrows: i, classNameActiveArrows: l, classNameHeaderContent: m }) => {
8
- const { table: s, headerContent: d, onSorting: n } = g(), p = (a) => {
2
+ import { HIDE_BELOW_CLASS as N } from "../../constants/responsive.js";
3
+ import { useTableContext as w } from "../../contexts/table.hook.js";
4
+ import { getPinnedCellProps as y } from "../../utils/pinned-columns/pinned-columns.js";
5
+ import { n as P } from "../../../../table.provider-QUo2buYX.js";
6
+ import D from "../../assets/chevron-up.js";
7
+ import H from "../../assets/chevron-down.js";
8
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
9
+ var G = ({ className: p, classNameArrows: f, classNameActiveArrows: l, classNameHeaderContent: h }) => {
10
+ const { table: o, headerContent: d, onSorting: n, pinnedWidths: x, getPinnedHeaderRef: b } = w(), g = (a) => {
9
11
  n([{
10
12
  id: a.id,
11
13
  desc: !1
12
14
  }]);
13
- }, x = (a) => {
15
+ }, k = (a) => {
14
16
  n([{
15
17
  id: a.id,
16
18
  desc: !0
17
19
  }]);
18
20
  };
19
- return /* @__PURE__ */ o("thead", {
20
- className: t("kvt-header", "font-semibold", "uppercase", "text-slate-500", "text-xs", "not-italic", "bg-slate-100", "overflow-hidden", "dark:text-slate-300", "dark:bg-metal-800", c),
21
+ return /* @__PURE__ */ s("thead", {
22
+ className: t("kvt-header", "font-semibold", "uppercase", "text-slate-500", "text-xs", "not-italic", "bg-slate-100", "overflow-hidden", "dark:text-slate-300", "dark:bg-metal-800", p),
21
23
  children: [d && /* @__PURE__ */ r("tr", {
22
24
  "data-header-content": !0,
23
25
  children: /* @__PURE__ */ r("th", {
24
- colSpan: s.getVisibleLeafColumns().length,
25
- className: t("kvt-header-content", "px-6", "py-4", "text-left", "text-sm", "font-normal", "normal-case", "text-slate-800", "bg-white", "rounded-tl-lg", "rounded-tr-lg", "border-b", "border-b-gray-200", "dark:border-b-0", "dark:text-metal-50", "dark:bg-metal-900", "dark:border-t", "dark:border-x", "dark:border-metal-700", m),
26
+ colSpan: o.getVisibleLeafColumns().length,
27
+ className: t("kvt-header-content", "px-6", "py-4", "text-left", "text-sm", "font-normal", "normal-case", "text-slate-800", "bg-white", "rounded-tl-lg", "rounded-tr-lg", "border-b", "border-b-gray-200", "dark:border-b-0", "dark:text-metal-50", "dark:bg-metal-900", "dark:border-t", "dark:border-x", "dark:border-metal-700", h),
26
28
  children: d
27
29
  })
28
- }), s.getHeaderGroups().map(({ id: a, headers: h }) => /* @__PURE__ */ r("tr", {
30
+ }), o.getHeaderGroups().map(({ id: a, headers: u }) => /* @__PURE__ */ r("tr", {
29
31
  className: "kvt-header-row",
30
- children: h.map(({ id: b, column: e, getContext: f }) => /* @__PURE__ */ r("th", {
31
- scope: "col",
32
- className: t("kvt-header-cell", "px-4", "py-3", "text-left", "text-xs", !d && "first:rounded-tl-lg", !d && "last:rounded-tr-lg", "border-transparent", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", e.columnDef.meta?.headerClassName),
33
- children: /* @__PURE__ */ o("span", {
34
- className: "flex items-center gap-2 w-full",
35
- children: [k(e.columnDef.header, f()), e.getCanSort() && /* @__PURE__ */ o("div", {
36
- className: t("flex flex-col text-slate-400 justify-center items-center gap-1", i),
37
- role: "presentation",
38
- children: [/* @__PURE__ */ r(u, {
39
- className: t("w-2 h-2 cursor-pointer", { "text-blue-600 dark:text-aurora-500": e.getIsSorted() === "asc" }, l),
40
- onClick: () => p(e)
41
- }), /* @__PURE__ */ r(C, {
42
- className: t("w-2 h-2 cursor-pointer", { "text-blue-600 dark:text-aurora-500": e.getIsSorted() === "desc" }, l),
43
- onClick: () => x(e)
32
+ children: u.map(({ id: C, column: e, getContext: S }) => {
33
+ const { hideBelow: i, headerClassName: v } = e.columnDef.meta ?? {}, c = !!e.getIsPinned(), m = y(o, e, x);
34
+ return /* @__PURE__ */ r("th", {
35
+ scope: "col",
36
+ ref: c ? b(e.id) : void 0,
37
+ className: t("kvt-header-cell", "px-4", "py-3", "text-left", "text-xs", !d && "first:rounded-tl-lg", !d && "last:rounded-tr-lg", "border-transparent", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", c && "bg-slate-100 dark:bg-metal-800", m.className, i && N[i], v),
38
+ style: m.style,
39
+ children: /* @__PURE__ */ s("span", {
40
+ className: "flex items-center gap-2 w-full",
41
+ children: [P(e.columnDef.header, S()), e.getCanSort() && /* @__PURE__ */ s("div", {
42
+ className: t("flex flex-col text-slate-400 justify-center items-center gap-1", f),
43
+ role: "presentation",
44
+ children: [/* @__PURE__ */ r(D, {
45
+ className: t("w-2 h-2 cursor-pointer", { "text-blue-600 dark:text-aurora-500": e.getIsSorted() === "asc" }, l),
46
+ onClick: () => g(e)
47
+ }), /* @__PURE__ */ r(H, {
48
+ className: t("w-2 h-2 cursor-pointer", { "text-blue-600 dark:text-aurora-500": e.getIsSorted() === "desc" }, l),
49
+ onClick: () => k(e)
50
+ })]
44
51
  })]
45
- })]
46
- })
47
- }, b))
52
+ })
53
+ }, C);
54
+ })
48
55
  }, a))]
49
56
  });
50
57
  };
51
58
  export {
52
- D as Header
59
+ G as Header
53
60
  };
@@ -0,0 +1,75 @@
1
+ import { t as c } from "../../../../utils-DnIJruo0.js";
2
+ import { useTableContext as N } from "../../contexts/table.hook.js";
3
+ import { useLayoutEffect as M, useRef as u, useState as S } from "react";
4
+ import { Fragment as C, jsx as n, jsxs as k } from "react/jsx-runtime";
5
+ var y = (r, e) => {
6
+ e && e.scrollLeft !== r.scrollLeft && (e.scrollLeft = r.scrollLeft);
7
+ }, O = ({ scrollWidth: r, clientWidth: e, scrollLeft: a }) => ({
8
+ scrollWidth: r,
9
+ clientWidth: e,
10
+ scrollLeft: a
11
+ }), j = (r, e) => r.scrollWidth === e.scrollWidth && r.clientWidth === e.clientWidth && r.scrollLeft === e.scrollLeft, T = ({ className: r, hasPinnedColumns: e = !1, children: a }) => {
12
+ const { table: m, pinnedWidths: W } = N(), i = u(null), b = u(null), v = u(null), [o, g] = S({
13
+ scrollWidth: 0,
14
+ clientWidth: 0,
15
+ scrollLeft: 0
16
+ }), d = () => {
17
+ const t = i.current;
18
+ t && g((s) => {
19
+ const l = O(t);
20
+ return j(s, l) ? s : l;
21
+ });
22
+ };
23
+ M(() => {
24
+ const t = i.current, s = b.current;
25
+ if (!t || !s || (d(), typeof ResizeObserver > "u")) return;
26
+ const l = new ResizeObserver(d);
27
+ return l.observe(t), l.observe(s), () => l.disconnect();
28
+ }, []);
29
+ const p = o.scrollWidth > o.clientWidth, w = (t) => t.reduce((s, l) => s + (W[l] ?? 0), 0), f = w(m.getLeftLeafColumns().map(({ id: t }) => t)), h = w(m.getRightLeafColumns().map(({ id: t }) => t)), L = e && p, x = o.scrollLeft > 0, R = o.scrollLeft < o.scrollWidth - o.clientWidth - 1;
30
+ return /* @__PURE__ */ k("div", {
31
+ className: "kvt-scroll-area relative w-full",
32
+ children: [/* @__PURE__ */ n("div", {
33
+ ref: i,
34
+ "data-kvt-overflow": p ? "" : void 0,
35
+ className: c("kvt-scroll", "w-full", e && "[&::-webkit-scrollbar]:hidden", r),
36
+ style: e ? { scrollbarWidth: "none" } : void 0,
37
+ onScroll: ({ currentTarget: t }) => {
38
+ y(t, v.current), d();
39
+ },
40
+ children: /* @__PURE__ */ n("div", {
41
+ ref: b,
42
+ className: "kvt-scroll-content w-full min-w-fit",
43
+ children: a
44
+ })
45
+ }), L && /* @__PURE__ */ k(C, { children: [
46
+ /* @__PURE__ */ n("div", {
47
+ "aria-hidden": "true",
48
+ className: c("kvt-scroll-fade pointer-events-none absolute inset-y-0 w-8", "bg-gradient-to-r from-white to-transparent dark:from-metal-900", "transition-opacity duration-200", x ? "opacity-100" : "opacity-0"),
49
+ style: { left: f }
50
+ }),
51
+ /* @__PURE__ */ n("div", {
52
+ "aria-hidden": "true",
53
+ className: c("kvt-scroll-fade pointer-events-none absolute inset-y-0 w-8", "bg-gradient-to-l from-white to-transparent dark:from-metal-900", "transition-opacity duration-200", R ? "opacity-100" : "opacity-0"),
54
+ style: { right: h }
55
+ }),
56
+ /* @__PURE__ */ n("div", {
57
+ ref: v,
58
+ "aria-hidden": "true",
59
+ className: c("kvt-scrollbar absolute bottom-0 overflow-x-auto overflow-y-hidden", "[scrollbar-width:thin] [scrollbar-color:var(--color-slate-300)_transparent]", "dark:[scrollbar-color:var(--color-metal-600)_transparent]", "[&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-slate-300", "dark:[&::-webkit-scrollbar-thumb]:bg-metal-600"),
60
+ style: {
61
+ left: f,
62
+ right: h
63
+ },
64
+ onScroll: ({ currentTarget: t }) => y(t, i.current),
65
+ children: /* @__PURE__ */ n("div", {
66
+ className: "h-px",
67
+ style: { width: o.scrollWidth - f - h }
68
+ })
69
+ })
70
+ ] })]
71
+ });
72
+ };
73
+ export {
74
+ T as ScrollContainer
75
+ };
@@ -1,43 +1,50 @@
1
1
  import { t as l } from "../../../../utils-DnIJruo0.js";
2
- import { Button as b } from "../../../Button/Button.js";
3
- import { t as m } from "../../../../ellipsis-vertical-C_yX7aQe.js";
4
- import { useTableContext as c } from "../../contexts/table.hook.js";
5
- import { jsx as r } from "react/jsx-runtime";
6
- var y = ({ numberOfRows: i, table: o }) => {
7
- const { tableLoading: n } = c(), t = Array.from({ length: i });
8
- return /* @__PURE__ */ r("tbody", {
2
+ import { Button as p } from "../../../Button/Button.js";
3
+ import { t as g } from "../../../../ellipsis-vertical-C_yX7aQe.js";
4
+ import { HIDE_BELOW_CLASS as m } from "../../constants/responsive.js";
5
+ import { useTableContext as f } from "../../contexts/table.hook.js";
6
+ import { getPinnedCellProps as k } from "../../utils/pinned-columns/pinned-columns.js";
7
+ import { jsx as e } from "react/jsx-runtime";
8
+ var w = ({ numberOfRows: b, table: n }) => {
9
+ const { tableLoading: c, pinnedWidths: h } = f(), r = Array.from({ length: b });
10
+ return /* @__PURE__ */ e("tbody", {
9
11
  className: "kvt-skeleton text-slate-800 text-sm font-normal relative",
10
- children: t.map((h, e) => {
11
- const d = o.getAllColumns();
12
- return /* @__PURE__ */ r("tr", {
12
+ children: r.map((y, a) => {
13
+ const o = n.getVisibleLeafColumns();
14
+ return /* @__PURE__ */ e("tr", {
13
15
  className: l("border-b", "border-b-gray-200", "bg-transparent", "last:border-b-transparent"),
14
- children: d.map((a, s) => a.id !== "actions" ? /* @__PURE__ */ r("td", {
15
- className: l("px-4", "py-1", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "dark:[tr:last-child_&]:border-b", a.columnDef.meta?.className, {
16
- "[tr:last-child_&:first-of-type]:rounded-bl-lg": e === t.length - 1 && s === 0,
17
- "[tr:last-child_&:last-of-type]:rounded-br-lg": e === t.length - 1 && s === d.length - 1
18
- }),
19
- children: /* @__PURE__ */ r("div", {
20
- className: "animate-in fade-in-0",
21
- children: /* @__PURE__ */ r("div", { className: l("bg-gray-200", "dark:bg-metal-700", "animate-pulse", "rounded", "h-5", "w-full") })
22
- })
23
- }, `skeleton-${a.id}`) : /* @__PURE__ */ r("td", {
24
- className: l("px-4", "py-1", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "dark:[tr:last-child_&]:border-b", a.columnDef.meta?.className, {
25
- "[tr:last-child_&:first-of-type]:rounded-bl-lg": e === t.length - 1 && s === 0,
26
- "[tr:last-child_&:last-of-type]:rounded-br-lg": e === t.length - 1 && s === d.length - 1
27
- }),
28
- children: /* @__PURE__ */ r(b, {
29
- variant: "link",
30
- shape: "circle",
31
- size: "large",
32
- disabled: !0,
33
- "aria-hidden": "true",
34
- children: /* @__PURE__ */ r(m, { className: l("w-5", "h-5", "text-slate-400", "dark:text-metal-700", { "text-gray-300 animate-pulse": n }) })
35
- })
36
- }, `skeleton-${a.id}`))
37
- }, `skeleton-row-${e}`);
16
+ children: o.map((t, s) => {
17
+ const { hideBelow: d } = t.columnDef.meta ?? {}, i = k(n, t, h);
18
+ return t.id !== "actions" ? /* @__PURE__ */ e("td", {
19
+ style: i.style,
20
+ className: l("px-4", "py-1", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "dark:[tr:last-child_&]:border-b", i.className, d && m[d], t.columnDef.meta?.className, {
21
+ "[tr:last-child_&:first-of-type]:rounded-bl-lg": a === r.length - 1 && s === 0,
22
+ "[tr:last-child_&:last-of-type]:rounded-br-lg": a === r.length - 1 && s === o.length - 1
23
+ }),
24
+ children: /* @__PURE__ */ e("div", {
25
+ className: "animate-in fade-in-0",
26
+ children: /* @__PURE__ */ e("div", { className: l("bg-gray-200", "dark:bg-metal-700", "animate-pulse", "rounded", "h-5", "w-full") })
27
+ })
28
+ }, `skeleton-${t.id}`) : /* @__PURE__ */ e("td", {
29
+ style: i.style,
30
+ className: l("px-4", "py-1", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "dark:[tr:last-child_&]:border-b", i.className, d && m[d], t.columnDef.meta?.className, {
31
+ "[tr:last-child_&:first-of-type]:rounded-bl-lg": a === r.length - 1 && s === 0,
32
+ "[tr:last-child_&:last-of-type]:rounded-br-lg": a === r.length - 1 && s === o.length - 1
33
+ }),
34
+ children: /* @__PURE__ */ e(p, {
35
+ variant: "link",
36
+ shape: "circle",
37
+ size: "large",
38
+ disabled: !0,
39
+ "aria-hidden": "true",
40
+ children: /* @__PURE__ */ e(g, { className: l("w-5", "h-5", "text-slate-400", "dark:text-metal-700", { "text-gray-300 animate-pulse": c }) })
41
+ })
42
+ }, `skeleton-${t.id}`);
43
+ })
44
+ }, `skeleton-row-${a}`);
38
45
  })
39
46
  });
40
47
  };
41
48
  export {
42
- y as Skeleton
49
+ w as Skeleton
43
50
  };