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

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 (103) hide show
  1. package/dist/{Modal-V67Uz78z.js → Modal-D-NOEWMX.js} +3 -3
  2. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  3. package/dist/{chevron-down-BLZPftpV.js → chevron-down-MZvQoT2F.js} +2 -2
  4. package/dist/chevron-right-VYBOBhRt.js +19 -0
  5. package/dist/components/Alert/Alert.js +2 -2
  6. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  7. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  8. package/dist/components/AlertDialog/components/index.js +1 -1
  9. package/dist/components/Badge/Badge.js +2 -2
  10. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  11. package/dist/components/Breadcrumb/components/Item/Item.js +16 -15
  12. package/dist/components/Checkbox/Checkbox.js +5 -4
  13. package/dist/components/Command/Command.js +2 -2
  14. package/dist/components/Command/components/Command.js +1 -1
  15. package/dist/components/Command/components/CommandEmpty.js +1 -1
  16. package/dist/components/Command/components/CommandGroup.js +1 -1
  17. package/dist/components/Command/components/CommandInput.js +2 -2
  18. package/dist/components/Command/components/CommandItem.js +1 -1
  19. package/dist/components/Command/components/CommandList.js +1 -1
  20. package/dist/components/Command/components/CommandSeparator.js +1 -1
  21. package/dist/components/Command/components/DialogContent.js +2 -2
  22. package/dist/components/Command/components/DialogOverlay.js +1 -1
  23. package/dist/components/Datepicker/DatePicker.js +545 -543
  24. package/dist/components/Dropdown/Dropdown.js +36 -24
  25. package/dist/components/Dropdown/Dropdown.variants.js +25 -7
  26. package/dist/components/Dropdown/components/List/List.js +59 -44
  27. package/dist/components/Dropdown/components/List/List.variants.js +9 -7
  28. package/dist/components/Dropdown/components/ListItem/ListItem.js +48 -24
  29. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
  30. package/dist/components/Dropdown/components/Wrapper.js +141 -106
  31. package/dist/components/Dropdown/contexts/dropdown.context.js +9 -8
  32. package/dist/components/Dropdown/contexts/dropdown.provider.js +20 -19
  33. package/dist/components/Dropdown/hooks/useDropdown.js +26 -27
  34. package/dist/components/Dropdown/hooks/useNavigationList.js +32 -28
  35. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  36. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  37. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  38. package/dist/components/Input/Input.js +1 -1
  39. package/dist/components/Loading/Loading.js +2 -2
  40. package/dist/components/Modal/Modal.js +2 -2
  41. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  42. package/dist/components/Modal/components/index.js +1 -1
  43. package/dist/components/NumberInput/NumberInput.js +2 -2
  44. package/dist/components/PieChart/PieChart.js +217 -215
  45. package/dist/components/Range/Range.js +1 -1
  46. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  47. package/dist/components/Slider/Slider.js +1 -1
  48. package/dist/components/Switch/Switch.js +6 -5
  49. package/dist/components/Tabs/Tabs.js +1 -1
  50. package/dist/components/Tabs/Tabs.variants.js +45 -24
  51. package/dist/components/Tabs/components/Content.js +1 -1
  52. package/dist/components/Tabs/components/List.js +1 -1
  53. package/dist/components/Tabs/components/Trigger.js +9 -8
  54. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
  55. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
  56. package/dist/components/Toast/Toast.js +8 -7
  57. package/dist/components/VirtualizedTable/VirtualizedTable.js +99 -0
  58. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  59. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  60. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  61. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  62. package/dist/components/VirtualizedTable/components/Actions/Actions.js +46 -0
  63. package/dist/components/VirtualizedTable/components/Body/Body.js +25 -0
  64. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  65. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  66. package/dist/components/VirtualizedTable/components/Filter/Filter.js +73 -0
  67. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  68. package/dist/components/VirtualizedTable/components/Header/Header.js +82 -0
  69. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +45 -0
  70. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1870 -0
  71. package/dist/components/VirtualizedTable/components/index.js +14 -0
  72. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  73. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  74. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  75. package/dist/components/VirtualizedTable/contexts/table.context.js +31 -0
  76. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  77. package/dist/components/VirtualizedTable/contexts/table.provider.js +778 -0
  78. package/dist/components/index.js +44 -40
  79. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D2CN7Ma9.js} +4 -4
  80. package/dist/debounce-BFejQm9P.js +200 -0
  81. package/dist/{index-D3xzCzcO.js → index-B7t8D14s.js} +2 -2
  82. package/dist/index-BAEWsOG1.js +27 -0
  83. package/dist/{index-C9T9HQaa.js → index-BITvcJAz.js} +1 -1
  84. package/dist/index-BZPx6jYI.js +8 -0
  85. package/dist/{index-BAraV3ai.js → index-Bnb0ezr3.js} +1 -1
  86. package/dist/{index-DB2XhXHn.js → index-C84F4YyO.js} +11 -10
  87. package/dist/index-Cd2vhaop.js +137 -0
  88. package/dist/{index-iXyXtdgP.js → index-DBbEcSUG.js} +1 -1
  89. package/dist/index-Dx2grAuN.js +1742 -0
  90. package/dist/{index-BXuxPoz7.js → index-DzIBBMjs.js} +18 -17
  91. package/dist/{index-h-Ul0anl.js → index-N2OStZoU.js} +1 -1
  92. package/dist/{index-Oq5GlCHP.js → index-os7vysFS.js} +1 -1
  93. package/dist/index-ti1b9kqV.js +14 -0
  94. package/dist/index.d.ts +94 -5
  95. package/dist/index.js +41 -37
  96. package/dist/package.json +26 -22
  97. package/dist/styles.css +1 -1
  98. package/dist/{x-BPcqkRZd.js → x-4F_5p77m.js} +1 -1
  99. package/package.json +26 -22
  100. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  101. package/dist/chevron-up-RLP4nX7V.js +0 -54
  102. package/dist/index-CZnD2QxM.js +0 -32
  103. package/dist/index-CrBonFvu.js +0 -144
@@ -1,30 +1,42 @@
1
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import { DropdownProvider as n } from "./contexts/dropdown.provider.js";
4
- import { Wrapper as c } from "./components/Wrapper.js";
5
- const v = p(({ onChange: r, onBlur: l, value: a, error: s, helperText: e, name: o, ...i }, d) => /* @__PURE__ */ t(
6
- n,
7
- {
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import { DropdownProvider as c } from "./contexts/dropdown.provider.js";
4
+ import { Wrapper as x } from "./components/Wrapper.js";
5
+ const N = n(
6
+ ({
8
7
  onChange: r,
9
8
  onBlur: l,
10
9
  value: a,
10
+ error: s,
11
+ helperText: e,
11
12
  name: o,
12
- children: /* @__PURE__ */ m("div", { className: "relative w-full", children: [
13
- /* @__PURE__ */ t(
14
- c,
15
- {
16
- name: o,
17
- error: s,
18
- ref: d,
19
- onBlur: l,
20
- ...i
21
- }
22
- ),
23
- s ? /* @__PURE__ */ t("span", { className: "text-xs text-red-700", children: s }) : null,
24
- !s && e ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: e }) : null
25
- ] })
26
- }
27
- ));
13
+ highlightSearch: i,
14
+ ...d
15
+ }, m) => /* @__PURE__ */ t(
16
+ c,
17
+ {
18
+ highlightSearch: i,
19
+ name: o,
20
+ value: a,
21
+ onBlur: l,
22
+ onChange: r,
23
+ children: /* @__PURE__ */ p("div", { className: "relative w-full", children: [
24
+ /* @__PURE__ */ t(
25
+ x,
26
+ {
27
+ name: o,
28
+ error: s,
29
+ ref: m,
30
+ onBlur: l,
31
+ ...d
32
+ }
33
+ ),
34
+ s ? /* @__PURE__ */ t("span", { className: "text-xs text-red-700", children: s }) : null,
35
+ !s && e ? /* @__PURE__ */ t("span", { className: "text-xs text-slate-600", children: e }) : null
36
+ ] })
37
+ }
38
+ )
39
+ );
28
40
  export {
29
- v as Dropdown
41
+ N as Dropdown
30
42
  };
@@ -1,6 +1,7 @@
1
- import { c as r } from "../../index-D29mdTf5.js";
2
- const a = r(
1
+ import { c as e } from "../../index-D29mdTf5.js";
2
+ const a = e(
3
3
  [
4
+ "group",
4
5
  "border",
5
6
  "cursor-pointer",
6
7
  "ease-in-out",
@@ -20,7 +21,9 @@ const a = r(
20
21
  "aria-expanded:border-aurora-500",
21
22
  "aria-expanded:text-aurora-500",
22
23
  "kubefirst:aria-expanded:border-kubefirst-primary",
23
- "kubefirst:aria-expanded:text-kubefirst-secondary"
24
+ "kubefirst:aria-expanded:text-kubefirst-secondary",
25
+ "dark:border-slate-600",
26
+ "dark:focus-visible:bg-slate-800"
24
27
  ],
25
28
  {
26
29
  variants: {
@@ -38,14 +41,29 @@ const a = r(
38
41
  hasError: !1
39
42
  }
40
43
  }
41
- ), t = r([
44
+ ), t = e([
45
+ "flex-1",
46
+ "bg-transparent",
47
+ "border-none",
48
+ "outline-none",
49
+ "text-zinc-700",
50
+ "text-sm",
51
+ "capitalize",
52
+ "placeholder:text-sm",
53
+ "placeholder:normal-case",
54
+ "placeholder:select-none",
55
+ "dark:placeholder:text-slate-400",
56
+ "dark:text-slate-50"
57
+ ]), n = e([
42
58
  "mb-1",
43
59
  "cursor-pointer",
44
- "text-[14px]",
60
+ "text-sm",
45
61
  "leading-[20px]",
46
- "tracking-[0.1px]"
62
+ "tracking-[0.1px]",
63
+ "dark:text-slate-50"
47
64
  ]);
48
65
  export {
49
66
  a as dropdownVariants,
50
- t as labelVariants
67
+ t as inputVariants,
68
+ n as labelVariants
51
69
  };
@@ -1,64 +1,79 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as v, useRef as w, useImperativeHandle as N } from "react";
3
- import { cn as h } from "../../../../utils/index.js";
4
- import { useNavigationUlList as x } from "../../hooks/useNavigationList.js";
5
- import { ListItem as s } from "../ListItem/ListItem.js";
6
- import { listVariants as C } from "./List.variants.js";
7
- import { useDropdownContext as k } from "../../contexts/dropdown.hook.js";
8
- const T = v(
1
+ import { jsx as l, jsxs as x, Fragment as N } from "react/jsx-runtime";
2
+ import { forwardRef as k, useRef as C, useImperativeHandle as y } from "react";
3
+ import { cn as t } from "../../../../utils/index.js";
4
+ import { useNavigationUlList as j } from "../../hooks/useNavigationList.js";
5
+ import { ListItem as n } from "../ListItem/ListItem.js";
6
+ import { listVariants as I } from "./List.variants.js";
7
+ import { S as O } from "../../../../index-DQH6odE9.js";
8
+ import { useDropdownContext as S } from "../../contexts/dropdown.hook.js";
9
+ const A = k(
9
10
  ({
10
- className: i,
11
- isLoading: n,
12
- itemClassName: o,
13
- name: c,
14
- options: r,
15
- searchable: m = !1,
16
- wrapperInputRef: f,
17
- wrapperRef: p
18
- }, u) => {
19
- const l = w(null), { isOpen: b, searchTerm: d } = k();
20
- N(u, () => l.current, [l]), x({ ulRef: l, wrapperRef: p, wrapperInputRef: f });
21
- const a = m ? r.filter((e) => {
22
- const g = d.toLowerCase();
23
- return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(g);
24
- }) : r, L = a.length === 0;
25
- return /* @__PURE__ */ t(
11
+ additionalOptions: f,
12
+ className: p,
13
+ inputRef: o,
14
+ isLoading: u,
15
+ itemClassName: r,
16
+ name: d,
17
+ options: i,
18
+ searchable: c = !1,
19
+ wrapperInputRef: g,
20
+ wrapperRef: b
21
+ }, h) => {
22
+ const s = C(null), { isOpen: v, searchTerm: L } = S();
23
+ y(h, () => s.current, [s]), j({
24
+ ulRef: s,
25
+ wrapperRef: b,
26
+ wrapperInputRef: g,
27
+ inputRef: o,
28
+ searchable: c
29
+ });
30
+ const m = c ? i.filter((e) => {
31
+ const a = L.toLowerCase();
32
+ return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(a);
33
+ }) : i, w = m.length === 0;
34
+ return /* @__PURE__ */ l(
26
35
  "ul",
27
36
  {
28
- ref: l,
29
- title: c,
37
+ ref: s,
38
+ title: d,
30
39
  role: "listbox",
31
- className: h(C({ className: i })),
32
- "data-state": b ? "open" : "closed",
33
- children: n ? /* @__PURE__ */ t(
34
- s,
40
+ className: t(I({ className: p })),
41
+ "data-state": v ? "open" : "closed",
42
+ children: u ? /* @__PURE__ */ l(
43
+ n,
35
44
  {
36
- className: o,
45
+ className: t("select-none", r),
37
46
  isClickable: !1,
47
+ inputRef: o,
38
48
  value: "Loading...",
39
49
  label: "Loading..."
40
50
  }
41
- ) : L ? /* @__PURE__ */ t(
42
- s,
51
+ ) : w ? /* @__PURE__ */ l(
52
+ n,
43
53
  {
44
- className: o,
54
+ className: t("select-none", r),
45
55
  isClickable: !1,
56
+ inputRef: o,
46
57
  value: "No options",
47
58
  label: "No options"
48
59
  }
49
- ) : a.map((e) => /* @__PURE__ */ t(
50
- s,
51
- {
52
- className: o,
53
- isClickable: !0,
54
- ...e
55
- },
56
- e.value
57
- ))
60
+ ) : /* @__PURE__ */ x(N, { children: [
61
+ m.map((e) => /* @__PURE__ */ l(
62
+ n,
63
+ {
64
+ className: t("select-none", r),
65
+ isClickable: !0,
66
+ inputRef: o,
67
+ ...e
68
+ },
69
+ e.value
70
+ )),
71
+ f?.map((e, a) => /* @__PURE__ */ l("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ l(O, { className: "flex p-2 w-full h-full gap-1 items-center text-sm [&>svg]:w-3.5 [&>svg]:h-3.5 [&>svg]:shrink-0 cursor-pointer select-none hover:bg-gray-50 hover:dark:bg-slate-700 focus:outline-0", children: e }) }, a))
72
+ ] })
58
73
  }
59
74
  );
60
75
  }
61
76
  );
62
77
  export {
63
- T as List
78
+ A as List
64
79
  };
@@ -1,26 +1,28 @@
1
1
  import { c as o } from "../../../../index-D29mdTf5.js";
2
- const a = o([
2
+ const t = o([
3
3
  "absolute",
4
4
  "bg-white",
5
5
  "border",
6
- "duration-100",
7
- "ease-in-out",
8
6
  "flex-col",
9
7
  "mt-1",
10
8
  "overflow-hidden",
11
9
  "rounded-md",
12
10
  "shadow-2xs",
13
11
  "top-full",
14
- "transition-all",
15
12
  "w-full",
16
13
  "z-10",
17
14
  "max-h-[185px]",
18
15
  "overflow-y-auto",
19
16
  "border-gray-200",
20
17
  "text-zinc-700",
21
- "data-[state=open]:block",
22
- "data-[state=closed]:hidden"
18
+ "animate-in",
19
+ "fade-in-50",
20
+ "zoom-in-95",
21
+ "duration-[200ms]",
22
+ "dark:bg-slate-800",
23
+ "dark:border-slate-700",
24
+ "dark:text-slate-50"
23
25
  ]);
24
26
  export {
25
- a as listVariants
27
+ t as listVariants
26
28
  };
@@ -1,43 +1,67 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import { useRef as u, useCallback as s } from "react";
3
- import { Typography as d } from "../../../Typography/Typography.js";
4
- import { cn as h } from "../../../../utils/index.js";
5
- import { listItemVariants as x } from "./ListItem.variants.js";
6
- import { useDropdownContext as y } from "../../contexts/dropdown.hook.js";
7
- const j = ({
8
- isClickable: a,
9
- className: i,
1
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
2
+ import { useRef as b, useCallback as l } from "react";
3
+ import { Typography as w } from "../../../Typography/Typography.js";
4
+ import { cn as y } from "../../../../utils/index.js";
5
+ import { listItemVariants as k } from "./ListItem.variants.js";
6
+ import { useDropdownContext as C } from "../../contexts/dropdown.hook.js";
7
+ const E = ({
8
+ isClickable: f,
9
+ className: p,
10
+ inputRef: d,
10
11
  ...t
11
12
  }) => {
12
- const { setValue: l, toggleOpen: n } = y(), c = u(null), o = s(
13
+ const { searchTerm: r, highlightSearchEnabled: i, setValue: c, toggleOpen: m } = C(), h = b(null), a = l(
13
14
  (e) => {
14
- l(e.value), n(!1);
15
+ c(e.value, d), m(!1);
15
16
  },
16
- [l, n]
17
- ), m = s(
18
- (e, f) => {
19
- e.key === "Enter" && (e.stopPropagation(), o(f));
17
+ [c, m]
18
+ ), g = l(
19
+ (e, s) => {
20
+ e.key === "Enter" && (e.stopPropagation(), a(s));
20
21
  },
21
- [o]
22
+ [a]
23
+ ), x = l(
24
+ (e) => {
25
+ if (typeof e != "string")
26
+ return e;
27
+ const s = i && r.length > 0 ? e.split(new RegExp(`(${r})`, "gi")).map((n) => n.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ o(
28
+ "mark",
29
+ {
30
+ className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
31
+ children: n
32
+ },
33
+ n
34
+ ) : n) : [e];
35
+ return /* @__PURE__ */ o(
36
+ w,
37
+ {
38
+ variant: "body2",
39
+ className: "text-zinc-700 dark:text-slate-50",
40
+ children: s
41
+ }
42
+ );
43
+ },
44
+ [i, r]
22
45
  );
23
- return /* @__PURE__ */ p(
46
+ return /* @__PURE__ */ u(
24
47
  "li",
25
48
  {
26
- ref: c,
49
+ ref: h,
27
50
  role: "option",
28
- className: h(x({ className: i })),
51
+ "data-action": "false",
52
+ className: y(k({ className: p })),
29
53
  tabIndex: 0,
30
54
  onClick: (e) => {
31
- a && (o(t), e.stopPropagation());
55
+ f && (a(t), e.stopPropagation());
32
56
  },
33
- onKeyDown: (e) => m(e, t),
57
+ onKeyDown: (e) => g(e, t),
34
58
  children: [
35
- t.leftIcon ? /* @__PURE__ */ r("span", { className: "w-4 h-4 flex justify-center items-center", children: t.leftIcon }) : null,
36
- /* @__PURE__ */ r(d, { variant: "body2", className: "text-zinc-700", children: t.label })
59
+ t.leftIcon ? /* @__PURE__ */ o("span", { className: "w-4 h-4 flex justify-center items-center", children: t.leftIcon }) : null,
60
+ x(t.label)
37
61
  ]
38
62
  }
39
63
  );
40
64
  };
41
65
  export {
42
- j as ListItem
66
+ E as ListItem
43
67
  };
@@ -1,5 +1,5 @@
1
- import { c as o } from "../../../../index-D29mdTf5.js";
2
- const i = o([
1
+ import { c as r } from "../../../../index-D29mdTf5.js";
2
+ const t = r([
3
3
  "cursor-pointer",
4
4
  "py-2",
5
5
  "px-2",
@@ -10,11 +10,13 @@ const i = o([
10
10
  "flex",
11
11
  "items-center",
12
12
  "gap-3",
13
- "hover:bg-slate-50",
14
- "focus:bg-slate-50",
15
- "civo:focus:bg-civo-primary/5",
16
- "civo:hover:bg-civo-primary/5"
13
+ "transition-bg",
14
+ "duration-250",
15
+ "hover:bg-gray-50",
16
+ "focus:bg-gray-50",
17
+ "dark:hover:bg-slate-700",
18
+ "dark:focus:bg-slate-700"
17
19
  ]);
18
20
  export {
19
- i as listItemVariants
21
+ t as listItemVariants
20
22
  };