@konstructio/ui 0.0.12-alpha.2 → 0.0.12-alpha.20

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 (93) hide show
  1. package/dist/{Modal-DZUwNzSW.js → Modal-B-E9uaA6.js} +354 -346
  2. package/dist/components/Alert/Alert.js +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  4. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  5. package/dist/components/AlertDialog/components/index.js +1 -1
  6. package/dist/components/Autocomplete/Autocomplete.variants.js +0 -1
  7. package/dist/components/Breadcrumb/Breadcrumb.variants.js +18 -15
  8. package/dist/components/Checkbox/Checkbox.js +1 -1
  9. package/dist/components/Command/Command.js +32 -0
  10. package/dist/components/Command/Command.variants.js +97 -0
  11. package/dist/components/Command/components/Command.js +8 -0
  12. package/dist/components/Command/components/CommandEmpty.js +15 -0
  13. package/dist/components/Command/components/CommandGroup.js +19 -0
  14. package/dist/components/Command/components/CommandInput.js +84 -0
  15. package/dist/components/Command/components/CommandItem.js +29 -0
  16. package/dist/components/Command/components/CommandList.js +16 -0
  17. package/dist/components/Command/components/CommandSeparator.js +16 -0
  18. package/dist/components/Command/components/CommandShortcut.js +19 -0
  19. package/dist/components/Command/components/DialogContent.js +31 -0
  20. package/dist/components/Command/components/DialogOverlay.js +19 -0
  21. package/dist/components/Command/components/index.js +20 -0
  22. package/dist/components/Command/contexts/Command.context.js +13 -0
  23. package/dist/components/Command/contexts/Command.provider.js +24 -0
  24. package/dist/components/Command/contexts/index.js +6 -0
  25. package/dist/components/Dropdown/Dropdown.js +6 -6
  26. package/dist/components/Dropdown/Dropdown.variants.js +22 -3
  27. package/dist/components/Dropdown/components/List/List.js +42 -16
  28. package/dist/components/Dropdown/components/List/List.variants.js +7 -5
  29. package/dist/components/Dropdown/components/ListItem/ListItem.js +26 -21
  30. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +6 -4
  31. package/dist/components/Dropdown/components/Wrapper.js +97 -63
  32. package/dist/components/Dropdown/contexts/dropdown.context.js +1 -1
  33. package/dist/components/Dropdown/contexts/dropdown.provider.js +9 -9
  34. package/dist/components/Input/Input.js +112 -67
  35. package/dist/components/Input/Input.variants.js +5 -6
  36. package/dist/components/Loading/Loading.js +102 -21
  37. package/dist/components/Loading/Loading.variants.js +13 -14
  38. package/dist/components/Modal/Modal.js +3 -3
  39. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
  40. package/dist/components/Modal/components/index.js +1 -1
  41. package/dist/components/NumberInput/NumberInput.js +88 -88
  42. package/dist/components/NumberInput/NumberInput.variants.js +23 -19
  43. package/dist/components/Range/Range.js +1 -1
  44. package/dist/components/Sidebar/Sidebar.variants.js +2 -1
  45. package/dist/components/Sidebar/components/Logo/Logo.variants.js +9 -17
  46. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +2 -2
  47. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +6 -5
  48. package/dist/components/Slider/Slider.js +1 -1
  49. package/dist/components/Switch/Switch.js +1 -1
  50. package/dist/components/Switch/Switch.variants.js +4 -4
  51. package/dist/components/Table/Table.js +31 -0
  52. package/dist/components/Table/Table.variants.js +78 -0
  53. package/dist/components/Table/components/Body.js +28 -0
  54. package/dist/components/Table/components/Filter.js +9 -0
  55. package/dist/components/Table/components/Head.js +28 -0
  56. package/dist/components/Table/components/Row.js +34 -0
  57. package/dist/components/Tag/Tag.js +17 -5
  58. package/dist/components/Tag/Tag.variants.js +11 -1
  59. package/dist/components/TagSelect/TagSelect.js +6 -71
  60. package/dist/components/TagSelect/TagSelect.variants.js +29 -50
  61. package/dist/components/TagSelect/components/Item/Item.js +23 -0
  62. package/dist/components/TagSelect/components/Item/Item.variants.js +31 -0
  63. package/dist/components/TagSelect/components/List/List.js +13 -0
  64. package/dist/components/TagSelect/components/List/List.variants.js +37 -0
  65. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +88 -0
  66. package/dist/components/TagSelect/components/index.js +8 -0
  67. package/dist/components/TagSelect/contexts/TagSelect.context.js +19 -0
  68. package/dist/components/TagSelect/contexts/TagSelect.hook.js +11 -0
  69. package/dist/components/TagSelect/contexts/TagSelect.provider.js +69 -0
  70. package/dist/components/TagSelect/contexts/index.js +6 -0
  71. package/dist/components/TagSelect/hooks/useTagSelect.js +22 -27
  72. package/dist/components/TextArea/TextArea.js +28 -22
  73. package/dist/components/TextArea/TextArea.variants.js +0 -1
  74. package/dist/components/Toast/Toast.js +141 -128
  75. package/dist/components/Toast/Toast.variants.js +2 -3
  76. package/dist/components/Typography/Typography.js +23 -22
  77. package/dist/components/Typography/Typography.variants.js +49 -22
  78. package/dist/components/index.js +22 -20
  79. package/dist/{index-C6WtlN_F.js → index-BzaHYXkt.js} +1 -1
  80. package/dist/{index-Z1voPZOH.js → index-CbTU3cnP.js} +1 -1
  81. package/dist/index-CzSBQN5S.js +432 -0
  82. package/dist/index-D7QNmo_D.js +422 -0
  83. package/dist/index-DUA6Y_AE.js +126 -0
  84. package/dist/{index-B33at13_.js → index-D_76wh4w.js} +1 -1
  85. package/dist/index-DyKo5ZJT.js +446 -0
  86. package/dist/index.d.ts +82 -16
  87. package/dist/index.js +18 -16
  88. package/dist/package.json +26 -24
  89. package/dist/styles.css +1 -1
  90. package/dist/utils/index.js +320 -322
  91. package/package.json +26 -24
  92. package/dist/index-3jTPaVvh.js +0 -551
  93. package/dist/index-BTeAm7mx.js +0 -19133
@@ -1,30 +1,31 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useId as h } from "react";
3
- import { typographyVariants as i } from "./Typography.variants.js";
4
- import { useTheme as y } from "../../contexts/theme.hook.js";
5
- const n = ({
6
- className: o,
7
- theme: t,
8
- children: e,
9
- variant: r,
10
- ...m
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { useId as d } from "react";
3
+ import { typographyVariants as f } from "./Typography.variants.js";
4
+ import { useTheme as n } from "../../contexts/theme.hook.js";
5
+ const u = ({
6
+ className: e,
7
+ theme: m,
8
+ children: p,
9
+ variant: o,
10
+ component: s,
11
+ ...t
11
12
  }) => {
12
- const p = h(), { theme: s } = y();
13
- return /* @__PURE__ */ a(
14
- "p",
13
+ const r = d(), { theme: h } = n(), y = s ?? (o != null && o.includes("h") ? o : "p");
14
+ return /* @__PURE__ */ c(
15
+ y,
15
16
  {
16
- id: p,
17
- className: i({
18
- className: o,
19
- theme: t ?? s,
20
- variant: r
17
+ id: r,
18
+ className: f({
19
+ className: e,
20
+ theme: m ?? h,
21
+ variant: o
21
22
  }),
22
- ...m,
23
- children: e
23
+ ...t,
24
+ children: p
24
25
  }
25
26
  );
26
27
  };
27
- n.displayName = "Typography";
28
+ u.displayName = "Typography";
28
29
  export {
29
- n as Typography
30
+ u as Typography
30
31
  };
@@ -1,29 +1,56 @@
1
1
  import { c as t } from "../../index-BNmRGtA6.js";
2
- const x = t([""], {
2
+ const e = t([], {
3
3
  variants: {
4
4
  variant: {
5
- h1: "text-[57px] font-normal leading-[64px]",
6
- h2: "text-[45px] font-normal leading-[52px]",
7
- h3: "text-[36px] font-normal leading-[44px]",
8
- h4: "text-[32px] font-normal leading-[40px]",
9
- h5: "text-[28px] font-normal leading-[36px]",
10
- h6: "text-[24px] font-medium leading-[32px] tracking-[0.15px]",
11
- subtitle1: "text-[22px] font-normal leading-[28px]",
12
- subtitle2: "text-[16px] font-medium leading-[24px] tracking-[0.15px]",
13
- subtitle3: "text-[14px] font-medium leading-[20px] tracking-[0.1px]",
14
- labelLarge: "text-[14px] font-normal leading-[20px] tracking-[0.1px]",
15
- labelMedium: "text-[12px] font-medium leading-[16px] tracking-[0.5px] uppercase",
16
- labelSmall: "text-[11px] font-medium leading-[16px] tracking-[0.5px] uppercase",
17
- buttonSmall: "text-[14px] font-semibold leading-[20px] tracking-[0.25px]",
18
- body1: "text-[16px] font-normal leading-[24px] tracking-[0.5px]",
19
- body2: "text-[14px] font-normal leading-[20px] tracking-[0.25px]",
20
- body3: "text-[12px] font-normal leading-[16px] tracking-[0.4px]",
21
- tooltip: "text-[14px] font-normal leading-[22px]"
5
+ h1: ["text-[57px]", "leading-[64px]"],
6
+ h2: ["text-[45px]", "leading-[52px]"],
7
+ h3: ["text-[36px]", "leading-[44px]"],
8
+ h4: ["text-[32px]", "leading-[40px]"],
9
+ h5: ["text-[28px]", "leading-[36px]"],
10
+ h6: ["text-[24px]", "font-medium", "leading-[32px]", "tracking-[0.15px]"],
11
+ subtitle1: ["text-[22px]", "leading-[28px]"],
12
+ subtitle2: [
13
+ "text-[16px]",
14
+ "font-medium",
15
+ "leading-[24px]",
16
+ "tracking-[0.15px]"
17
+ ],
18
+ subtitle3: [
19
+ "text-[14px]",
20
+ "font-medium",
21
+ "leading-[20px]",
22
+ "tracking-[0.1px]"
23
+ ],
24
+ labelLarge: ["text-[14px]", "leading-[20px]", "tracking-[0.1px]"],
25
+ labelMedium: [
26
+ "text-[12px]",
27
+ "font-medium",
28
+ "leading-[16px]",
29
+ "tracking-[0.5px]",
30
+ "uppercase"
31
+ ],
32
+ labelSmall: [
33
+ "text-[11px]",
34
+ "font-medium",
35
+ "leading-[16px]",
36
+ "tracking-[0.5px]",
37
+ "uppercase"
38
+ ],
39
+ buttonSmall: [
40
+ "text-[14px]",
41
+ "font-semibold",
42
+ "leading-[20px]",
43
+ "tracking-[0.25px]"
44
+ ],
45
+ body1: ["text-[16px]", "leading-[24px]", "tracking-[0.5px]"],
46
+ body2: ["text-[14px]", "leading-[20px]", "tracking-[0.25px]"],
47
+ body3: ["text-[12px]", "leading-[16px]", "tracking-[0.4px]"],
48
+ tooltip: ["text-[14px]", "leading-[22px]"]
22
49
  },
23
50
  theme: {
24
- kubefirst: "text-zinc-700",
25
- colony: "text-zinc-700",
26
- civo: "text-zinc-700"
51
+ kubefirst: "",
52
+ colony: "",
53
+ civo: ""
27
54
  }
28
55
  },
29
56
  defaultVariants: {
@@ -32,5 +59,5 @@ const x = t([""], {
32
59
  }
33
60
  });
34
61
  export {
35
- x as typographyVariants
62
+ e as typographyVariants
36
63
  };
@@ -4,10 +4,10 @@ import { Autocomplete as x } from "./Autocomplete/Autocomplete.js";
4
4
  import { Breadcrumb as a } from "./Breadcrumb/Breadcrumb.js";
5
5
  import { Button as d } from "./Button/Button.js";
6
6
  import { Card as n } from "./Card/Card.js";
7
- import { Checkbox as l } from "./Checkbox/Checkbox.js";
8
- import { Dropdown as c } from "./Dropdown/Dropdown.js";
9
- import { Input as N } from "./Input/Input.js";
10
- import { M as S } from "../Modal-DZUwNzSW.js";
7
+ import { Checkbox as u } from "./Checkbox/Checkbox.js";
8
+ import { Dropdown as b } from "./Dropdown/Dropdown.js";
9
+ import { Input as v } from "./Input/Input.js";
10
+ import { M as R } from "../Modal-B-E9uaA6.js";
11
11
  import { NumberInput as s } from "./NumberInput/NumberInput.js";
12
12
  import { ProgressBar as C } from "./ProgressBar/ProgressBar.js";
13
13
  import { Radio as B } from "./Radio/Radio.js";
@@ -26,12 +26,13 @@ import { Tooltip as Y } from "./Tooltip/Tooltip.js";
26
26
  import { Loading as _ } from "./Loading/Loading.js";
27
27
  import { Typography as oo } from "./Typography/Typography.js";
28
28
  import { Divider as to } from "./Divider/Divider.js";
29
- import { Footer as po } from "./Sidebar/components/Footer/Footer.js";
30
- import { Logo as xo } from "./Sidebar/components/Logo/Logo.js";
31
- import { Navigation as ao } from "./Sidebar/components/Navigation/Navigation.js";
32
- import { NavigationGroup as go } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
33
- import { NavigationOption as uo } from "./Sidebar/components/NavigationOption/NavigationOption.js";
34
- import { NavigationSeparator as To } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
29
+ import { Table as po } from "./Table/Table.js";
30
+ import { Footer as xo } from "./Sidebar/components/Footer/Footer.js";
31
+ import { Logo as ao } from "./Sidebar/components/Logo/Logo.js";
32
+ import { Navigation as go } from "./Sidebar/components/Navigation/Navigation.js";
33
+ import { NavigationGroup as lo } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
34
+ import { NavigationOption as To } from "./Sidebar/components/NavigationOption/NavigationOption.js";
35
+ import { NavigationSeparator as co } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
35
36
  export {
36
37
  t as Alert,
37
38
  p as AlertDialog,
@@ -39,18 +40,18 @@ export {
39
40
  a as Breadcrumb,
40
41
  d as Button,
41
42
  n as Card,
42
- l as Checkbox,
43
+ u as Checkbox,
43
44
  to as Divider,
44
- c as Dropdown,
45
- po as Footer,
46
- N as Input,
45
+ b as Dropdown,
46
+ xo as Footer,
47
+ v as Input,
47
48
  _ as Loading,
48
- xo as Logo,
49
- S as Modal,
50
- ao as Navigation,
51
- go as NavigationGroup,
52
- uo as NavigationOption,
53
- To as NavigationSeparator,
49
+ ao as Logo,
50
+ R as Modal,
51
+ go as Navigation,
52
+ lo as NavigationGroup,
53
+ To as NavigationOption,
54
+ co as NavigationSeparator,
54
55
  s as NumberInput,
55
56
  C as ProgressBar,
56
57
  B as Radio,
@@ -61,6 +62,7 @@ export {
61
62
  O as Sidebar,
62
63
  j as Slider,
63
64
  z as Switch,
65
+ po as Table,
64
66
  H as Tag,
65
67
  K as TagSelect,
66
68
  U as TextArea,
@@ -2,7 +2,7 @@ import * as d from "react";
2
2
  import { a as ae, c as ce, b as _ } from "./index-Cva-e5M4.js";
3
3
  import { u as K } from "./index-B_6_jmOO.js";
4
4
  import { a as le, u as de } from "./index-4ecjw_Aj.js";
5
- import { P as T } from "./index-BTeAm7mx.js";
5
+ import { P as T } from "./index-D7QNmo_D.js";
6
6
  import { c as ue } from "./index-BbsJ0VIJ.js";
7
7
  import { jsx as g, jsxs as fe } from "react/jsx-runtime";
8
8
  function $(e, [t, n]) {
@@ -1,5 +1,5 @@
1
1
  import * as e from "react";
2
- import { P as o } from "./index-BTeAm7mx.js";
2
+ import { P as o } from "./index-D7QNmo_D.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  var d = "VisuallyHidden", a = e.forwardRef(
5
5
  (r, i) => /* @__PURE__ */ t(
@@ -0,0 +1,432 @@
1
+ import { u as T, R as Ce, P as Ae, O as Ie, C as Le } from "./index-DyKo5ZJT.js";
2
+ import * as l from "react";
3
+ import be from "react";
4
+ import { P as C } from "./index-D7QNmo_D.js";
5
+ var pe = 1, De = 0.9, $e = 0.8, Me = 0.17, X = 0.1, Q = 0.999, Ve = 0.9999, Te = 0.99, Ke = /[\\\/_+.#"@\[\(\{&]/, qe = /[\\\/_+.#"@\[\(\{&]/g, Pe = /[\s-]/, ye = /[\s-]/g;
6
+ function re(e, n, r, v, u, i, d) {
7
+ if (i === n.length) return u === e.length ? pe : Te;
8
+ var m = `${u},${i}`;
9
+ if (d[m] !== void 0) return d[m];
10
+ for (var g = v.charAt(i), p = r.indexOf(g, u), c = 0, o, S, f, E; p >= 0; ) o = re(e, n, r, v, p + 1, i + 1, d), o > c && (p === u ? o *= pe : Ke.test(e.charAt(p - 1)) ? (o *= $e, f = e.slice(u, p - 1).match(qe), f && u > 0 && (o *= Math.pow(Q, f.length))) : Pe.test(e.charAt(p - 1)) ? (o *= De, E = e.slice(u, p - 1).match(ye), E && u > 0 && (o *= Math.pow(Q, E.length))) : (o *= Me, u > 0 && (o *= Math.pow(Q, p - u))), e.charAt(p) !== n.charAt(i) && (o *= Ve)), (o < X && r.charAt(p - 1) === v.charAt(i + 1) || v.charAt(i + 1) === v.charAt(i) && r.charAt(p - 1) !== v.charAt(i)) && (S = re(e, n, r, v, p + 1, i + 2, d), S * X > o && (o = S * X)), o > c && (c = o), p = r.indexOf(g, p + 1);
11
+ return d[m] = c, c;
12
+ }
13
+ function me(e) {
14
+ return e.toLowerCase().replace(ye, " ");
15
+ }
16
+ function Ue(e, n, r) {
17
+ return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, re(e, n, me(e), me(n), 0, 0, {});
18
+ }
19
+ var H = { exports: {} }, Z = {};
20
+ /**
21
+ * @license React
22
+ * use-sync-external-store-shim.production.js
23
+ *
24
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
25
+ *
26
+ * This source code is licensed under the MIT license found in the
27
+ * LICENSE file in the root directory of this source tree.
28
+ */
29
+ var he;
30
+ function je() {
31
+ if (he) return Z;
32
+ he = 1;
33
+ var e = be;
34
+ function n(o, S) {
35
+ return o === S && (o !== 0 || 1 / o === 1 / S) || o !== o && S !== S;
36
+ }
37
+ var r = typeof Object.is == "function" ? Object.is : n, v = e.useState, u = e.useEffect, i = e.useLayoutEffect, d = e.useDebugValue;
38
+ function m(o, S) {
39
+ var f = S(), E = v({ inst: { value: f, getSnapshot: S } }), w = E[0].inst, _ = E[1];
40
+ return i(
41
+ function() {
42
+ w.value = f, w.getSnapshot = S, g(w) && _({ inst: w });
43
+ },
44
+ [o, f, S]
45
+ ), u(
46
+ function() {
47
+ return g(w) && _({ inst: w }), o(function() {
48
+ g(w) && _({ inst: w });
49
+ });
50
+ },
51
+ [o]
52
+ ), d(f), f;
53
+ }
54
+ function g(o) {
55
+ var S = o.getSnapshot;
56
+ o = o.value;
57
+ try {
58
+ var f = S();
59
+ return !r(o, f);
60
+ } catch {
61
+ return !0;
62
+ }
63
+ }
64
+ function p(o, S) {
65
+ return S();
66
+ }
67
+ var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? p : m;
68
+ return Z.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : c, Z;
69
+ }
70
+ var ee = {};
71
+ /**
72
+ * @license React
73
+ * use-sync-external-store-shim.development.js
74
+ *
75
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
76
+ *
77
+ * This source code is licensed under the MIT license found in the
78
+ * LICENSE file in the root directory of this source tree.
79
+ */
80
+ var ge;
81
+ function Ge() {
82
+ return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() {
83
+ function e(f, E) {
84
+ return f === E && (f !== 0 || 1 / f === 1 / E) || f !== f && E !== E;
85
+ }
86
+ function n(f, E) {
87
+ c || u.startTransition === void 0 || (c = !0, console.error(
88
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
89
+ ));
90
+ var w = E();
91
+ if (!o) {
92
+ var _ = E();
93
+ i(w, _) || (console.error(
94
+ "The result of getSnapshot should be cached to avoid an infinite loop"
95
+ ), o = !0);
96
+ }
97
+ _ = d({
98
+ inst: { value: w, getSnapshot: E }
99
+ });
100
+ var k = _[0].inst, M = _[1];
101
+ return g(
102
+ function() {
103
+ k.value = w, k.getSnapshot = E, r(k) && M({ inst: k });
104
+ },
105
+ [f, w, E]
106
+ ), m(
107
+ function() {
108
+ return r(k) && M({ inst: k }), f(function() {
109
+ r(k) && M({ inst: k });
110
+ });
111
+ },
112
+ [f]
113
+ ), p(w), w;
114
+ }
115
+ function r(f) {
116
+ var E = f.getSnapshot;
117
+ f = f.value;
118
+ try {
119
+ var w = E();
120
+ return !i(f, w);
121
+ } catch {
122
+ return !0;
123
+ }
124
+ }
125
+ function v(f, E) {
126
+ return E();
127
+ }
128
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
129
+ var u = be, i = typeof Object.is == "function" ? Object.is : e, d = u.useState, m = u.useEffect, g = u.useLayoutEffect, p = u.useDebugValue, c = !1, o = !1, S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : n;
130
+ ee.useSyncExternalStore = u.useSyncExternalStore !== void 0 ? u.useSyncExternalStore : S, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
131
+ }()), ee;
132
+ }
133
+ var Se;
134
+ function He() {
135
+ return Se || (Se = 1, process.env.NODE_ENV === "production" ? H.exports = /* @__PURE__ */ je() : H.exports = /* @__PURE__ */ Ge()), H.exports;
136
+ }
137
+ var Be = /* @__PURE__ */ He(), P = '[cmdk-group=""]', te = '[cmdk-group-items=""]', Fe = '[cmdk-group-heading=""]', le = '[cmdk-item=""]', Ee = `${le}:not([aria-disabled="true"])`, ne = "cmdk-item-select", L = "data-value", Ne = (e, n, r) => Ue(e, n, r), we = l.createContext(void 0), j = () => l.useContext(we), xe = l.createContext(void 0), ue = () => l.useContext(xe), _e = l.createContext(void 0), ke = l.forwardRef((e, n) => {
138
+ let r = V(() => {
139
+ var t, s;
140
+ return { search: "", value: (s = (t = e.value) != null ? t : e.defaultValue) != null ? s : "", filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
141
+ }), v = V(() => /* @__PURE__ */ new Set()), u = V(() => /* @__PURE__ */ new Map()), i = V(() => /* @__PURE__ */ new Map()), d = V(() => /* @__PURE__ */ new Set()), m = Oe(e), { label: g, children: p, value: c, onValueChange: o, filter: S, shouldFilter: f, loop: E, disablePointerSelection: w = !1, vimBindings: _ = !0, ...k } = e, M = T(), ae = T(), oe = T(), A = l.useRef(null), x = nt();
142
+ D(() => {
143
+ if (c !== void 0) {
144
+ let t = c.trim();
145
+ r.current.value = t, O.emit();
146
+ }
147
+ }, [c]), D(() => {
148
+ x(6, ce);
149
+ }, []);
150
+ let O = l.useMemo(() => ({ subscribe: (t) => (d.current.add(t), () => d.current.delete(t)), snapshot: () => r.current, setState: (t, s, h) => {
151
+ var a, b, y;
152
+ if (!Object.is(r.current[t], s)) {
153
+ if (r.current[t] = s, t === "search") z(), N(), x(1, W);
154
+ else if (t === "value" && (h || x(5, ce), ((a = m.current) == null ? void 0 : a.value) !== void 0)) {
155
+ let R = s ?? "";
156
+ (y = (b = m.current).onValueChange) == null || y.call(b, R);
157
+ return;
158
+ }
159
+ O.emit();
160
+ }
161
+ }, emit: () => {
162
+ d.current.forEach((t) => t());
163
+ } }), []), F = l.useMemo(() => ({ value: (t, s, h) => {
164
+ var a;
165
+ s !== ((a = i.current.get(t)) == null ? void 0 : a.value) && (i.current.set(t, { value: s, keywords: h }), r.current.filtered.items.set(t, ie(s, h)), x(2, () => {
166
+ N(), O.emit();
167
+ }));
168
+ }, item: (t, s) => (v.current.add(t), s && (u.current.has(s) ? u.current.get(s).add(t) : u.current.set(s, /* @__PURE__ */ new Set([t]))), x(3, () => {
169
+ z(), N(), r.current.value || W(), O.emit();
170
+ }), () => {
171
+ i.current.delete(t), v.current.delete(t), r.current.filtered.items.delete(t);
172
+ let h = K();
173
+ x(4, () => {
174
+ z(), (h == null ? void 0 : h.getAttribute("id")) === t && W(), O.emit();
175
+ });
176
+ }), group: (t) => (u.current.has(t) || u.current.set(t, /* @__PURE__ */ new Set()), () => {
177
+ i.current.delete(t), u.current.delete(t);
178
+ }), filter: () => m.current.shouldFilter, label: g || e["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: M, inputId: oe, labelId: ae, listInnerRef: A }), []);
179
+ function ie(t, s) {
180
+ var h, a;
181
+ let b = (a = (h = m.current) == null ? void 0 : h.filter) != null ? a : Ne;
182
+ return t ? b(t, r.current.search, s) : 0;
183
+ }
184
+ function N() {
185
+ if (!r.current.search || m.current.shouldFilter === !1) return;
186
+ let t = r.current.filtered.items, s = [];
187
+ r.current.filtered.groups.forEach((a) => {
188
+ let b = u.current.get(a), y = 0;
189
+ b.forEach((R) => {
190
+ let I = t.get(R);
191
+ y = Math.max(I, y);
192
+ }), s.push([a, y]);
193
+ });
194
+ let h = A.current;
195
+ q().sort((a, b) => {
196
+ var y, R;
197
+ let I = a.getAttribute("id"), G = b.getAttribute("id");
198
+ return ((y = t.get(G)) != null ? y : 0) - ((R = t.get(I)) != null ? R : 0);
199
+ }).forEach((a) => {
200
+ let b = a.closest(te);
201
+ b ? b.appendChild(a.parentElement === b ? a : a.closest(`${te} > *`)) : h.appendChild(a.parentElement === h ? a : a.closest(`${te} > *`));
202
+ }), s.sort((a, b) => b[1] - a[1]).forEach((a) => {
203
+ var b;
204
+ let y = (b = A.current) == null ? void 0 : b.querySelector(`${P}[${L}="${encodeURIComponent(a[0])}"]`);
205
+ y == null || y.parentElement.appendChild(y);
206
+ });
207
+ }
208
+ function W() {
209
+ let t = q().find((h) => h.getAttribute("aria-disabled") !== "true"), s = t == null ? void 0 : t.getAttribute(L);
210
+ O.setState("value", s || void 0);
211
+ }
212
+ function z() {
213
+ var t, s, h, a;
214
+ if (!r.current.search || m.current.shouldFilter === !1) {
215
+ r.current.filtered.count = v.current.size;
216
+ return;
217
+ }
218
+ r.current.filtered.groups = /* @__PURE__ */ new Set();
219
+ let b = 0;
220
+ for (let y of v.current) {
221
+ let R = (s = (t = i.current.get(y)) == null ? void 0 : t.value) != null ? s : "", I = (a = (h = i.current.get(y)) == null ? void 0 : h.keywords) != null ? a : [], G = ie(R, I);
222
+ r.current.filtered.items.set(y, G), G > 0 && b++;
223
+ }
224
+ for (let [y, R] of u.current) for (let I of R) if (r.current.filtered.items.get(I) > 0) {
225
+ r.current.filtered.groups.add(y);
226
+ break;
227
+ }
228
+ r.current.filtered.count = b;
229
+ }
230
+ function ce() {
231
+ var t, s, h;
232
+ let a = K();
233
+ a && (((t = a.parentElement) == null ? void 0 : t.firstChild) === a && ((h = (s = a.closest(P)) == null ? void 0 : s.querySelector(Fe)) == null || h.scrollIntoView({ block: "nearest" })), a.scrollIntoView({ block: "nearest" }));
234
+ }
235
+ function K() {
236
+ var t;
237
+ return (t = A.current) == null ? void 0 : t.querySelector(`${le}[aria-selected="true"]`);
238
+ }
239
+ function q() {
240
+ var t;
241
+ return Array.from(((t = A.current) == null ? void 0 : t.querySelectorAll(Ee)) || []);
242
+ }
243
+ function Y(t) {
244
+ let s = q()[t];
245
+ s && O.setState("value", s.getAttribute(L));
246
+ }
247
+ function J(t) {
248
+ var s;
249
+ let h = K(), a = q(), b = a.findIndex((R) => R === h), y = a[b + t];
250
+ (s = m.current) != null && s.loop && (y = b + t < 0 ? a[a.length - 1] : b + t === a.length ? a[0] : a[b + t]), y && O.setState("value", y.getAttribute(L));
251
+ }
252
+ function se(t) {
253
+ let s = K(), h = s == null ? void 0 : s.closest(P), a;
254
+ for (; h && !a; ) h = t > 0 ? tt(h, P) : rt(h, P), a = h == null ? void 0 : h.querySelector(Ee);
255
+ a ? O.setState("value", a.getAttribute(L)) : J(t);
256
+ }
257
+ let de = () => Y(q().length - 1), fe = (t) => {
258
+ t.preventDefault(), t.metaKey ? de() : t.altKey ? se(1) : J(1);
259
+ }, ve = (t) => {
260
+ t.preventDefault(), t.metaKey ? Y(0) : t.altKey ? se(-1) : J(-1);
261
+ };
262
+ return l.createElement(C.div, { ref: n, tabIndex: -1, ...k, "cmdk-root": "", onKeyDown: (t) => {
263
+ var s;
264
+ if ((s = k.onKeyDown) == null || s.call(k, t), !t.defaultPrevented) switch (t.key) {
265
+ case "n":
266
+ case "j": {
267
+ _ && t.ctrlKey && fe(t);
268
+ break;
269
+ }
270
+ case "ArrowDown": {
271
+ fe(t);
272
+ break;
273
+ }
274
+ case "p":
275
+ case "k": {
276
+ _ && t.ctrlKey && ve(t);
277
+ break;
278
+ }
279
+ case "ArrowUp": {
280
+ ve(t);
281
+ break;
282
+ }
283
+ case "Home": {
284
+ t.preventDefault(), Y(0);
285
+ break;
286
+ }
287
+ case "End": {
288
+ t.preventDefault(), de();
289
+ break;
290
+ }
291
+ case "Enter":
292
+ if (!t.nativeEvent.isComposing && t.keyCode !== 229) {
293
+ t.preventDefault();
294
+ let h = K();
295
+ if (h) {
296
+ let a = new Event(ne);
297
+ h.dispatchEvent(a);
298
+ }
299
+ }
300
+ }
301
+ } }, l.createElement("label", { "cmdk-label": "", htmlFor: F.inputId, id: F.labelId, style: ut }, g), B(e, (t) => l.createElement(xe.Provider, { value: O }, l.createElement(we.Provider, { value: F }, t))));
302
+ }), We = l.forwardRef((e, n) => {
303
+ var r, v;
304
+ let u = T(), i = l.useRef(null), d = l.useContext(_e), m = j(), g = Oe(e), p = (v = (r = g.current) == null ? void 0 : r.forceMount) != null ? v : d == null ? void 0 : d.forceMount;
305
+ D(() => {
306
+ if (!p) return m.item(u, d == null ? void 0 : d.id);
307
+ }, [p]);
308
+ let c = Re(u, i, [e.value, e.children, i], e.keywords), o = ue(), S = $((x) => x.value && x.value === c.current), f = $((x) => p || m.filter() === !1 ? !0 : x.search ? x.filtered.items.get(u) > 0 : !0);
309
+ l.useEffect(() => {
310
+ let x = i.current;
311
+ if (!(!x || e.disabled)) return x.addEventListener(ne, E), () => x.removeEventListener(ne, E);
312
+ }, [f, e.onSelect, e.disabled]);
313
+ function E() {
314
+ var x, O;
315
+ w(), (O = (x = g.current).onSelect) == null || O.call(x, c.current);
316
+ }
317
+ function w() {
318
+ o.setState("value", c.current, !0);
319
+ }
320
+ if (!f) return null;
321
+ let { disabled: _, value: k, onSelect: M, forceMount: ae, keywords: oe, ...A } = e;
322
+ return l.createElement(C.div, { ref: U([i, n]), ...A, id: u, "cmdk-item": "", role: "option", "aria-disabled": !!_, "aria-selected": !!S, "data-disabled": !!_, "data-selected": !!S, onPointerMove: _ || m.getDisablePointerSelection() ? void 0 : w, onClick: _ ? void 0 : E }, e.children);
323
+ }), ze = l.forwardRef((e, n) => {
324
+ let { heading: r, children: v, forceMount: u, ...i } = e, d = T(), m = l.useRef(null), g = l.useRef(null), p = T(), c = j(), o = $((f) => u || c.filter() === !1 ? !0 : f.search ? f.filtered.groups.has(d) : !0);
325
+ D(() => c.group(d), []), Re(d, m, [e.value, e.heading, g]);
326
+ let S = l.useMemo(() => ({ id: d, forceMount: u }), [u]);
327
+ return l.createElement(C.div, { ref: U([m, n]), ...i, "cmdk-group": "", role: "presentation", hidden: o ? void 0 : !0 }, r && l.createElement("div", { ref: g, "cmdk-group-heading": "", "aria-hidden": !0, id: p }, r), B(e, (f) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? p : void 0 }, l.createElement(_e.Provider, { value: S }, f))));
328
+ }), Ye = l.forwardRef((e, n) => {
329
+ let { alwaysRender: r, ...v } = e, u = l.useRef(null), i = $((d) => !d.search);
330
+ return !r && !i ? null : l.createElement(C.div, { ref: U([u, n]), ...v, "cmdk-separator": "", role: "separator" });
331
+ }), Je = l.forwardRef((e, n) => {
332
+ let { onValueChange: r, ...v } = e, u = e.value != null, i = ue(), d = $((c) => c.search), m = $((c) => c.value), g = j(), p = l.useMemo(() => {
333
+ var c;
334
+ let o = (c = g.listInnerRef.current) == null ? void 0 : c.querySelector(`${le}[${L}="${encodeURIComponent(m)}"]`);
335
+ return o == null ? void 0 : o.getAttribute("id");
336
+ }, []);
337
+ return l.useEffect(() => {
338
+ e.value != null && i.setState("search", e.value);
339
+ }, [e.value]), l.createElement(C.input, { ref: n, ...v, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": g.listId, "aria-labelledby": g.labelId, "aria-activedescendant": p, id: g.inputId, type: "text", value: u ? e.value : d, onChange: (c) => {
340
+ u || i.setState("search", c.target.value), r == null || r(c.target.value);
341
+ } });
342
+ }), Xe = l.forwardRef((e, n) => {
343
+ let { children: r, label: v = "Suggestions", ...u } = e, i = l.useRef(null), d = l.useRef(null), m = j();
344
+ return l.useEffect(() => {
345
+ if (d.current && i.current) {
346
+ let g = d.current, p = i.current, c, o = new ResizeObserver(() => {
347
+ c = requestAnimationFrame(() => {
348
+ let S = g.offsetHeight;
349
+ p.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
350
+ });
351
+ });
352
+ return o.observe(g), () => {
353
+ cancelAnimationFrame(c), o.unobserve(g);
354
+ };
355
+ }
356
+ }, []), l.createElement(C.div, { ref: U([i, n]), ...u, "cmdk-list": "", role: "listbox", "aria-label": v, id: m.listId }, B(e, (g) => l.createElement("div", { ref: U([d, m.listInnerRef]), "cmdk-list-sizer": "" }, g)));
357
+ }), Qe = l.forwardRef((e, n) => {
358
+ let { open: r, onOpenChange: v, overlayClassName: u, contentClassName: i, container: d, ...m } = e;
359
+ return l.createElement(Ce, { open: r, onOpenChange: v }, l.createElement(Ae, { container: d }, l.createElement(Ie, { "cmdk-overlay": "", className: u }), l.createElement(Le, { "aria-label": e.label, "cmdk-dialog": "", className: i }, l.createElement(ke, { ref: n, ...m }))));
360
+ }), Ze = l.forwardRef((e, n) => $((r) => r.filtered.count === 0) ? l.createElement(C.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), et = l.forwardRef((e, n) => {
361
+ let { progress: r, children: v, label: u = "Loading...", ...i } = e;
362
+ return l.createElement(C.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": u }, B(e, (d) => l.createElement("div", { "aria-hidden": !0 }, d)));
363
+ }), ct = Object.assign(ke, { List: Xe, Item: We, Input: Je, Group: ze, Separator: Ye, Dialog: Qe, Empty: Ze, Loading: et });
364
+ function tt(e, n) {
365
+ let r = e.nextElementSibling;
366
+ for (; r; ) {
367
+ if (r.matches(n)) return r;
368
+ r = r.nextElementSibling;
369
+ }
370
+ }
371
+ function rt(e, n) {
372
+ let r = e.previousElementSibling;
373
+ for (; r; ) {
374
+ if (r.matches(n)) return r;
375
+ r = r.previousElementSibling;
376
+ }
377
+ }
378
+ function Oe(e) {
379
+ let n = l.useRef(e);
380
+ return D(() => {
381
+ n.current = e;
382
+ }), n;
383
+ }
384
+ var D = typeof window > "u" ? l.useEffect : l.useLayoutEffect;
385
+ function V(e) {
386
+ let n = l.useRef();
387
+ return n.current === void 0 && (n.current = e()), n;
388
+ }
389
+ function U(e) {
390
+ return (n) => {
391
+ e.forEach((r) => {
392
+ typeof r == "function" ? r(n) : r != null && (r.current = n);
393
+ });
394
+ };
395
+ }
396
+ function $(e) {
397
+ let n = ue(), r = () => e(n.snapshot());
398
+ return Be.useSyncExternalStore(n.subscribe, r, r);
399
+ }
400
+ function Re(e, n, r, v = []) {
401
+ let u = l.useRef(), i = j();
402
+ return D(() => {
403
+ var d;
404
+ let m = (() => {
405
+ var p;
406
+ for (let c of r) {
407
+ if (typeof c == "string") return c.trim();
408
+ if (typeof c == "object" && "current" in c) return c.current ? (p = c.current.textContent) == null ? void 0 : p.trim() : u.current;
409
+ }
410
+ })(), g = v.map((p) => p.trim());
411
+ i.value(e, m, g), (d = n.current) == null || d.setAttribute(L, m), u.current = m;
412
+ }), u;
413
+ }
414
+ var nt = () => {
415
+ let [e, n] = l.useState(), r = V(() => /* @__PURE__ */ new Map());
416
+ return D(() => {
417
+ r.current.forEach((v) => v()), r.current = /* @__PURE__ */ new Map();
418
+ }, [e]), (v, u) => {
419
+ r.current.set(v, u), n({});
420
+ };
421
+ };
422
+ function lt(e) {
423
+ let n = e.type;
424
+ return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
425
+ }
426
+ function B({ asChild: e, children: n }, r) {
427
+ return e && l.isValidElement(n) ? l.cloneElement(lt(n), { ref: n.ref }, r(n.props.children)) : r(n);
428
+ }
429
+ var ut = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
430
+ export {
431
+ ct as V
432
+ };