@konstructio/ui 0.1.2-alpha.13 → 0.1.2-alpha.15

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.
@@ -1,6 +1,6 @@
1
- import { c as o } from "./createLucideIcon-DnY-81vT.js";
1
+ import { c as o } from "./createLucideIcon-DGhJ8Z4k.js";
2
2
  /**
3
- * @license lucide-react v0.546.0 - ISC
3
+ * @license lucide-react v0.548.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
@@ -1,13 +1,13 @@
1
- import { c as o } from "./createLucideIcon-DnY-81vT.js";
1
+ import { c as o } from "./createLucideIcon-DGhJ8Z4k.js";
2
2
  /**
3
- * @license lucide-react v0.546.0 - ISC
3
+ * @license lucide-react v0.548.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  const e = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], n = o("chevron-left", e);
9
9
  /**
10
- * @license lucide-react v0.546.0 - ISC
10
+ * @license lucide-react v0.548.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
@@ -3,9 +3,9 @@ import { useRef as h, useState as g, useCallback as v, useEffect as w } from "re
3
3
  import { cn as m } from "../../utils/index.js";
4
4
  import { buttonDismissVariants as x, badgeVariants as y } from "./Badge.variants.js";
5
5
  import { S as M } from "../../index-DQH6odE9.js";
6
- import { c as N } from "../../createLucideIcon-DnY-81vT.js";
6
+ import { c as N } from "../../createLucideIcon-DGhJ8Z4k.js";
7
7
  /**
8
- * @license lucide-react v0.546.0 - ISC
8
+ * @license lucide-react v0.548.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
@@ -66,7 +66,7 @@ const t = r(
66
66
  "py-1",
67
67
  "h-auto",
68
68
  "text-[0.8125rem]",
69
- "leading-[1.375rem]",
69
+ "leading-5.5",
70
70
  "h-[30px]"
71
71
  ]
72
72
  }
@@ -2,7 +2,7 @@ import { jsx as Ee } from "react/jsx-runtime";
2
2
  import d, { createContext as sn, useContext as an, useCallback as j, useRef as ke, useLayoutEffect as cn, useState as De, useEffect as un, useMemo as Pe } from "react";
3
3
  import { cn as ue } from "../../utils/index.js";
4
4
  import { datePickerVariants as fn } from "./DatePicker.variants.js";
5
- import { C as ln, a as dn } from "../../chevron-right-DCDOrc04.js";
5
+ import { C as ln, a as dn } from "../../chevron-right-DeMVrnIg.js";
6
6
  import '../../DatePicker.css';function hn(e, t, n = "long") {
7
7
  return new Intl.DateTimeFormat("en-US", {
8
8
  // Enforces engine to render the time. Without the option JavaScriptCore omits it.
@@ -35,10 +35,15 @@ const a = e(
35
35
  "kubefirst:text-red-600"
36
36
  ],
37
37
  false: ""
38
+ },
39
+ disabled: {
40
+ true: ["cursor-default", "bg-gray-100", "dark:bg-slate-700/80"],
41
+ false: []
38
42
  }
39
43
  },
40
44
  defaultVariants: {
41
- hasError: !1
45
+ hasError: !1,
46
+ disabled: !1
42
47
  }
43
48
  }
44
49
  ), t = e([
@@ -54,16 +59,16 @@ const a = e(
54
59
  "placeholder:select-none",
55
60
  "dark:placeholder:text-slate-400",
56
61
  "dark:text-slate-50"
57
- ]), n = e([
62
+ ]), d = e([
58
63
  "mb-1",
59
64
  "cursor-pointer",
60
65
  "text-sm",
61
- "leading-[20px]",
66
+ "leading-5",
62
67
  "tracking-[0.1px]",
63
68
  "dark:text-slate-50"
64
69
  ]);
65
70
  export {
66
71
  a as dropdownVariants,
67
72
  t as inputVariants,
68
- n as labelVariants
73
+ d as labelVariants
69
74
  };
@@ -1,79 +1,83 @@
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";
1
+ import { jsx as l, jsxs as w, Fragment as N } from "react/jsx-runtime";
2
+ import { forwardRef as y, useRef as j, useImperativeHandle as C } from "react";
3
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(
4
+ import { useNavigationUlList as O } from "../../hooks/useNavigationList.js";
5
+ import { ListItem as i } from "../ListItem/ListItem.js";
6
+ import { listVariants as D } from "./List.variants.js";
7
+ import { S as E } from "../../../../index-DQH6odE9.js";
8
+ import { useDropdownContext as F } from "../../contexts/dropdown.hook.js";
9
+ const I = y(
10
10
  ({
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
11
+ additionalOptions: p,
12
+ className: u,
13
+ inputRef: r,
14
+ isLoading: d,
15
+ itemClassName: s,
16
+ name: g,
17
+ options: c,
18
+ searchable: m = !1,
19
+ listItemSecondRowClassName: a,
20
+ wrapperInputRef: b,
21
+ wrapperRef: h
22
+ }, v) => {
23
+ const o = j(null), { isOpen: L, searchTerm: x } = F();
24
+ C(v, () => o.current, [o]), O({
25
+ ulRef: o,
26
+ wrapperRef: h,
27
+ wrapperInputRef: b,
28
+ inputRef: r,
29
+ searchable: m
29
30
  });
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;
31
+ const f = m ? c.filter((e) => {
32
+ const n = x.toLowerCase();
33
+ return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(n);
34
+ }) : c, k = f.length === 0;
34
35
  return /* @__PURE__ */ l(
35
36
  "ul",
36
37
  {
37
- ref: s,
38
- title: d,
38
+ ref: o,
39
+ title: g,
39
40
  role: "listbox",
40
- className: t(I({ className: p })),
41
- "data-state": v ? "open" : "closed",
42
- children: u ? /* @__PURE__ */ l(
43
- n,
41
+ className: t(D({ className: u })),
42
+ "data-state": L ? "open" : "closed",
43
+ children: d ? /* @__PURE__ */ l(
44
+ i,
44
45
  {
45
- className: t("select-none", r),
46
+ className: t("select-none", s),
46
47
  isClickable: !1,
47
- inputRef: o,
48
+ inputRef: r,
48
49
  value: "Loading...",
49
- label: "Loading..."
50
+ label: "Loading...",
51
+ listItemSecondRowClassName: a
50
52
  }
51
- ) : w ? /* @__PURE__ */ l(
52
- n,
53
+ ) : k ? /* @__PURE__ */ l(
54
+ i,
53
55
  {
54
- className: t("select-none", r),
56
+ className: t("select-none", s),
55
57
  isClickable: !1,
56
- inputRef: o,
58
+ inputRef: r,
57
59
  value: "No options",
58
- label: "No options"
60
+ label: "No options",
61
+ listItemSecondRowClassName: a
59
62
  }
60
- ) : /* @__PURE__ */ x(N, { children: [
61
- m.map((e) => /* @__PURE__ */ l(
62
- n,
63
+ ) : /* @__PURE__ */ w(N, { children: [
64
+ f.map((e) => /* @__PURE__ */ l(
65
+ i,
63
66
  {
64
- className: t("select-none", r),
67
+ className: t("select-none", s),
65
68
  isClickable: !0,
66
- inputRef: o,
69
+ inputRef: r,
70
+ listItemSecondRowClassName: a,
67
71
  ...e
68
72
  },
69
73
  e.value
70
74
  )),
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))
75
+ p?.map((e, n) => /* @__PURE__ */ l("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ l(E, { 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 }) }, n))
72
76
  ] })
73
77
  }
74
78
  );
75
79
  }
76
80
  );
77
81
  export {
78
- A as List
82
+ I as List
79
83
  };
@@ -1,67 +1,89 @@
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,
1
+ import { jsx as l, jsxs as d } from "react/jsx-runtime";
2
+ import { useRef as w, useCallback as o } from "react";
3
+ import { Typography as C } from "../../../Typography/Typography.js";
4
+ import { cn as i } from "../../../../utils/index.js";
5
+ import { listItemVariants as L } from "./ListItem.variants.js";
6
+ import { useDropdownContext as I } from "../../contexts/dropdown.hook.js";
7
+ const K = ({
8
+ isClickable: p,
9
+ className: h,
10
+ inputRef: b,
11
+ listItemSecondRowClassName: x,
11
12
  ...t
12
13
  }) => {
13
- const { searchTerm: r, highlightSearchEnabled: i, setValue: c, toggleOpen: m } = C(), h = b(null), a = l(
14
+ const { searchTerm: a, highlightSearchEnabled: c, setValue: m, toggleOpen: f } = I(), g = w(null), n = o(
14
15
  (e) => {
15
- c(e.value, d), m(!1);
16
+ m(e.value, b), f(!1);
16
17
  },
17
- [c, m]
18
- ), g = l(
19
- (e, s) => {
20
- e.key === "Enter" && (e.stopPropagation(), a(s));
18
+ [m, f]
19
+ ), u = o(
20
+ (e, r) => {
21
+ e.key === "Enter" && (e.stopPropagation(), n(r));
21
22
  },
22
- [a]
23
- ), x = l(
24
- (e) => {
23
+ [n]
24
+ ), k = o(
25
+ (e, r) => {
25
26
  if (typeof e != "string")
26
27
  return e;
27
- const s = i && r.length > 0 ? e.split(new RegExp(`(${r})`, "gi")).map((n) => n.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ o(
28
+ const y = c && a.length > 0 ? e.split(new RegExp(`(${a})`, "gi")).map((s) => s.toLowerCase() === a.toLowerCase() ? /* @__PURE__ */ l(
28
29
  "mark",
29
30
  {
30
31
  className: "bg-transparent font-semibold text-slate-800 dark:text-slate-50",
31
- children: n
32
+ children: s
32
33
  },
33
- n
34
- ) : n) : [e];
35
- return /* @__PURE__ */ o(
36
- w,
34
+ s
35
+ ) : s) : [e];
36
+ return /* @__PURE__ */ d(
37
+ C,
37
38
  {
38
39
  variant: "body2",
39
- className: "text-zinc-700 dark:text-slate-50",
40
- children: s
40
+ className: "text-zinc-700 dark:text-slate-50 font-medium",
41
+ children: [
42
+ y,
43
+ r ? /* @__PURE__ */ l(
44
+ "span",
45
+ {
46
+ className: i(
47
+ "block font-normal text-sm text-slate-800 dark:text-slate-50",
48
+ x
49
+ ),
50
+ children: r
51
+ }
52
+ ) : null
53
+ ]
41
54
  }
42
55
  );
43
56
  },
44
- [i, r]
57
+ [c, a]
45
58
  );
46
- return /* @__PURE__ */ u(
59
+ return /* @__PURE__ */ d(
47
60
  "li",
48
61
  {
49
- ref: h,
62
+ ref: g,
50
63
  role: "option",
51
64
  "data-action": "false",
52
- className: y(k({ className: p })),
65
+ className: i(L({ className: h })),
53
66
  tabIndex: 0,
54
67
  onClick: (e) => {
55
- f && (a(t), e.stopPropagation());
68
+ p && (n(t), e.stopPropagation());
56
69
  },
57
- onKeyDown: (e) => g(e, t),
70
+ onKeyDown: (e) => u(e, t),
58
71
  children: [
59
- t.leftIcon ? /* @__PURE__ */ o("span", { className: "w-4 h-4 flex justify-center items-center", children: t.leftIcon }) : null,
60
- x(t.label)
72
+ t.leftIcon ? /* @__PURE__ */ l(
73
+ "span",
74
+ {
75
+ className: i("w-4 h-4 flex justify-center", {
76
+ "items-center": !t.subLabel,
77
+ "items-baseline -translate-y-2": !!t.subLabel
78
+ }),
79
+ children: t.leftIcon
80
+ }
81
+ ) : null,
82
+ k(t.label, t.subLabel)
61
83
  ]
62
84
  }
63
85
  );
64
86
  };
65
87
  export {
66
- E as ListItem
88
+ K as ListItem
67
89
  };