@konstructio/ui 0.1.0-alpha.9 → 0.1.1-alpha.2

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 (167) hide show
  1. package/dist/DatePicker.css +1 -1
  2. package/dist/{Modal-CrG0m703.js → Modal-0oht63vU.js} +32 -32
  3. package/dist/assets/icons/components/Search.js +26 -0
  4. package/dist/assets/icons/components/Warning.js +22 -0
  5. package/dist/assets/icons/components/index.js +6 -0
  6. package/dist/{chevron-down-UW8ts6wI.js → chevron-down-CVce9Mvh.js} +2 -2
  7. package/dist/components/Alert/Alert.js +23 -25
  8. package/dist/components/Alert/Alert.variants.js +1 -1
  9. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  10. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  11. package/dist/components/AlertDialog/components/index.js +1 -1
  12. package/dist/components/AlertDialog/hooks/useAlertDialog.js +7 -7
  13. package/dist/components/Autocomplete/Autocomplete.variants.js +3 -4
  14. package/dist/components/Autocomplete/components/List/List.variants.js +3 -7
  15. package/dist/components/Autocomplete/hooks/useAutocomplete.js +38 -43
  16. package/dist/components/Autocomplete/hooks/useNavigationList.js +29 -37
  17. package/dist/components/Badge/Badge.js +40 -42
  18. package/dist/components/Badge/Badge.variants.js +1 -1
  19. package/dist/components/Breadcrumb/Breadcrumb.variants.js +1 -1
  20. package/dist/components/Breadcrumb/components/Item/Item.js +22 -21
  21. package/dist/components/Breadcrumb/components/Item/Item.variants.js +1 -1
  22. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  23. package/dist/components/Button/Button.js +15 -15
  24. package/dist/components/Button/Button.variants.js +10 -77
  25. package/dist/components/Card/Card.variants.js +3 -5
  26. package/dist/components/Checkbox/Checkbox.js +48 -47
  27. package/dist/components/Checkbox/Checkbox.variants.js +3 -4
  28. package/dist/components/Command/Command.js +2 -2
  29. package/dist/components/Command/Command.variants.js +1 -1
  30. package/dist/components/Command/components/Command.js +1 -1
  31. package/dist/components/Command/components/CommandEmpty.js +1 -1
  32. package/dist/components/Command/components/CommandGroup.js +1 -1
  33. package/dist/components/Command/components/CommandInput.js +1 -1
  34. package/dist/components/Command/components/CommandItem.js +13 -13
  35. package/dist/components/Command/components/CommandList.js +1 -1
  36. package/dist/components/Command/components/CommandSeparator.js +1 -1
  37. package/dist/components/Command/components/DialogContent.js +1 -1
  38. package/dist/components/Command/components/DialogOverlay.js +1 -1
  39. package/dist/components/Datepicker/DatePicker.js +1496 -1577
  40. package/dist/components/Datepicker/DatePicker.variants.js +1 -1
  41. package/dist/components/Divider/Divider.variants.js +1 -1
  42. package/dist/components/Dropdown/Dropdown.js +28 -6
  43. package/dist/components/Dropdown/Dropdown.variants.js +43 -26
  44. package/dist/components/Dropdown/components/List/List.variants.js +1 -1
  45. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +5 -5
  46. package/dist/components/Dropdown/components/Wrapper.js +96 -86
  47. package/dist/components/Dropdown/contexts/dropdown.provider.js +12 -12
  48. package/dist/components/Dropdown/hooks/useDropdown.js +26 -30
  49. package/dist/components/Dropdown/hooks/useNavigationList.js +25 -31
  50. package/dist/components/DropdownButton/DropdownButton.js +135 -0
  51. package/dist/components/Filter/Filter.variants.js +1 -1
  52. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +47 -49
  53. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  54. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +41 -42
  55. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +30 -30
  56. package/dist/components/Filter/components/ResetButton/ResetButton.js +22 -16
  57. package/dist/components/Input/Input.js +116 -109
  58. package/dist/components/Input/Input.variants.js +18 -5
  59. package/dist/components/Loading/Loading.js +2 -2
  60. package/dist/components/Loading/Loading.variants.js +1 -2
  61. package/dist/components/Modal/Modal.js +2 -2
  62. package/dist/components/Modal/components/Body/Body.js +1 -1
  63. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  64. package/dist/components/Modal/components/Header/Header.js +1 -1
  65. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  66. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +7 -9
  67. package/dist/components/Modal/components/index.js +1 -1
  68. package/dist/components/Modal/hooks/useModal.js +16 -17
  69. package/dist/components/NumberInput/NumberInput.js +91 -91
  70. package/dist/components/NumberInput/NumberInput.variants.js +1 -1
  71. package/dist/components/PieChart/PieChart.js +5138 -0
  72. package/dist/components/ProgressBar/ProgressBar.js +58 -26
  73. package/dist/components/ProgressBar/ProgressBar.variants.js +1 -1
  74. package/dist/components/Radio/Radio.js +64 -48
  75. package/dist/components/Radio/Radio.variants.js +3 -3
  76. package/dist/components/RadioCard/RadioCard.js +26 -23
  77. package/dist/components/RadioCard/RadioCard.variants.js +1 -1
  78. package/dist/components/RadioCardGroup/RadioCardGroup.js +28 -28
  79. package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +1 -1
  80. package/dist/components/RadioGroup/RadioGroup.js +37 -37
  81. package/dist/components/RadioGroup/RadioGroup.variants.js +1 -1
  82. package/dist/components/Range/Range.js +1 -1
  83. package/dist/components/Range/Range.variants.js +2 -3
  84. package/dist/components/Sidebar/Sidebar.js +4 -3
  85. package/dist/components/Sidebar/Sidebar.variants.js +1 -1
  86. package/dist/components/Sidebar/components/Footer/Footer.js +5 -4
  87. package/dist/components/Sidebar/components/Footer/Footer.variants.js +1 -1
  88. package/dist/components/Sidebar/components/Logo/Logo.js +6 -5
  89. package/dist/components/Sidebar/components/Logo/Logo.variants.js +1 -1
  90. package/dist/components/Sidebar/components/Navigation/Navigation.js +5 -4
  91. package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +1 -1
  92. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -13
  93. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +1 -1
  94. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +13 -12
  95. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -1
  96. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +5 -6
  97. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +1 -1
  98. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -8
  99. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +1 -1
  100. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +15 -14
  101. package/dist/components/Slider/Slider.js +1 -1
  102. package/dist/components/Slider/Slider.variants.js +2 -8
  103. package/dist/components/Switch/Switch.js +54 -54
  104. package/dist/components/Switch/Switch.variants.js +2 -3
  105. package/dist/components/Table/Table.variants.js +1 -1
  106. package/dist/components/Tabs/Tabs.js +20 -16
  107. package/dist/components/Tabs/Tabs.variants.js +3 -5
  108. package/dist/components/Tabs/components/Content.js +10 -13
  109. package/dist/components/Tabs/components/List.js +9 -8
  110. package/dist/components/Tabs/components/Trigger.js +12 -16
  111. package/dist/components/Tabs/components/index.js +8 -0
  112. package/dist/components/Tag/Tag.js +1 -1
  113. package/dist/components/Tag/Tag.variants.js +1 -1
  114. package/dist/components/TagSelect/TagSelect.variants.js +1 -1
  115. package/dist/components/TagSelect/components/Item/Item.variants.js +1 -1
  116. package/dist/components/TagSelect/components/List/List.variants.js +1 -1
  117. package/dist/components/TagSelect/hooks/useTagSelect.js +14 -16
  118. package/dist/components/TextArea/TextArea.variants.js +4 -5
  119. package/dist/components/TimePicker/TimePicker.variants.js +6 -7
  120. package/dist/components/TimePicker/components/HoursList/HoursList.js +21 -26
  121. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +19 -20
  122. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +24 -25
  123. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +33 -34
  124. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +1 -1
  125. package/dist/components/Toast/Toast.js +223 -232
  126. package/dist/components/Toast/Toast.variants.js +8 -11
  127. package/dist/components/Tooltip/Tooltip.js +1 -1
  128. package/dist/components/Tooltip/Tooltip.variants.js +7 -14
  129. package/dist/components/Tooltip/hooks/useTooltip.js +8 -9
  130. package/dist/components/Typography/Typography.js +26 -31
  131. package/dist/components/Typography/Typography.variants.js +1 -1
  132. package/dist/components/index.js +78 -66
  133. package/dist/contexts/theme.provider.js +28 -29
  134. package/dist/{createLucideIcon-ByJ0JZvK.js → createLucideIcon-BpsAkT97.js} +4 -4
  135. package/dist/index-0ioNhtNM.js +10 -0
  136. package/dist/{index-CvfCCTEO.js → index-BAraV3ai.js} +7 -7
  137. package/dist/index-BXuxPoz7.js +435 -0
  138. package/dist/index-BfXxHr_2.js +125 -0
  139. package/dist/index-C1g_chDT.js +70 -0
  140. package/dist/{index-BCGvACM9.js → index-C9T9HQaa.js} +1 -1
  141. package/dist/{index-Bc1LNrRD.js → index-CZnD2QxM.js} +1 -1
  142. package/dist/index-CrBonFvu.js +144 -0
  143. package/dist/{index-rUBNhTeF.js → index-Cvx4lqTq.js} +2 -2
  144. package/dist/{index-BNmRGtA6.js → index-D29mdTf5.js} +3 -3
  145. package/dist/{index-Dkt8F6CZ.js → index-D3xzCzcO.js} +12 -12
  146. package/dist/index-DB2XhXHn.js +431 -0
  147. package/dist/{index-B5MIi2tR.js → index-DQH6odE9.js} +2 -3
  148. package/dist/index-Oq5GlCHP.js +131 -0
  149. package/dist/{index-Cs8Lv8Wj.js → index-bwWKd82e.js} +1 -1
  150. package/dist/{index--EmNlyHx.js → index-iXyXtdgP.js} +1 -1
  151. package/dist/index.d.ts +157 -9
  152. package/dist/index.js +88 -76
  153. package/dist/package.json +41 -37
  154. package/dist/styles.css +1 -1
  155. package/dist/ui/civo-theme.css +261 -241
  156. package/dist/ui/kubefirst-theme.css +4 -4
  157. package/dist/ui/theme.css +0 -2
  158. package/dist/{useBreadcrumb-DMERrNkJ.js → useBreadcrumb-B8DnuqkR.js} +254 -261
  159. package/dist/utils/index.js +25 -26
  160. package/package.json +41 -37
  161. package/dist/index-BNU3RH-3.js +0 -133
  162. package/dist/index-BvCZBMfr.js +0 -432
  163. package/dist/index-Cq1I1cG9.js +0 -129
  164. package/dist/index-DLYwlPRZ.js +0 -440
  165. package/dist/index-DNRcvRTB.js +0 -145
  166. package/dist/index-Dm-ooN_M.js +0 -71
  167. package/dist/index-DwYXX2sM.js +0 -13
@@ -0,0 +1,144 @@
1
+ import * as r from "react";
2
+ import { b as p, u as U } from "./index-BfXxHr_2.js";
3
+ import { P as m, d as z, R as H } from "./index-C9T9HQaa.js";
4
+ import { u as T } from "./index-DQH6odE9.js";
5
+ import { u as b } from "./index-0ioNhtNM.js";
6
+ import { jsx as P } from "react/jsx-runtime";
7
+ function K(n, e = globalThis?.document) {
8
+ const t = b(n);
9
+ r.useEffect(() => {
10
+ const o = (s) => {
11
+ s.key === "Escape" && t(s);
12
+ };
13
+ return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
14
+ }, [t, e]);
15
+ }
16
+ var j = "DismissableLayer", h = "dismissableLayer.update", X = "dismissableLayer.pointerDownOutside", Y = "dismissableLayer.focusOutside", w, B = r.createContext({
17
+ layers: /* @__PURE__ */ new Set(),
18
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
19
+ branches: /* @__PURE__ */ new Set()
20
+ }), x = r.forwardRef(
21
+ (n, e) => {
22
+ const {
23
+ disableOutsidePointerEvents: t = !1,
24
+ onEscapeKeyDown: o,
25
+ onPointerDownOutside: s,
26
+ onFocusOutside: a,
27
+ onInteractOutside: d,
28
+ onDismiss: l,
29
+ ...E
30
+ } = n, c = r.useContext(B), [u, S] = r.useState(null), f = u?.ownerDocument ?? globalThis?.document, [, A] = r.useState({}), N = T(e, (i) => S(i)), D = Array.from(c.layers), [W] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), k = D.indexOf(W), O = u ? D.indexOf(u) : -1, _ = c.layersWithOutsidePointerEventsDisabled.size > 0, L = O >= k, M = G((i) => {
31
+ const v = i.target, R = [...c.branches].some((y) => y.contains(v));
32
+ !L || R || (s?.(i), d?.(i), i.defaultPrevented || l?.());
33
+ }, f), C = J((i) => {
34
+ const v = i.target;
35
+ [...c.branches].some((y) => y.contains(v)) || (a?.(i), d?.(i), i.defaultPrevented || l?.());
36
+ }, f);
37
+ return K((i) => {
38
+ O === c.layers.size - 1 && (o?.(i), !i.defaultPrevented && l && (i.preventDefault(), l()));
39
+ }, f), r.useEffect(() => {
40
+ if (u)
41
+ return t && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (w = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), g(), () => {
42
+ t && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = w);
43
+ };
44
+ }, [u, f, t, c]), r.useEffect(() => () => {
45
+ u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), g());
46
+ }, [u, c]), r.useEffect(() => {
47
+ const i = () => A({});
48
+ return document.addEventListener(h, i), () => document.removeEventListener(h, i);
49
+ }, []), /* @__PURE__ */ P(
50
+ m.div,
51
+ {
52
+ ...E,
53
+ ref: N,
54
+ style: {
55
+ pointerEvents: _ ? L ? "auto" : "none" : void 0,
56
+ ...n.style
57
+ },
58
+ onFocusCapture: p(n.onFocusCapture, C.onFocusCapture),
59
+ onBlurCapture: p(n.onBlurCapture, C.onBlurCapture),
60
+ onPointerDownCapture: p(
61
+ n.onPointerDownCapture,
62
+ M.onPointerDownCapture
63
+ )
64
+ }
65
+ );
66
+ }
67
+ );
68
+ x.displayName = j;
69
+ var q = "DismissableLayerBranch", F = r.forwardRef((n, e) => {
70
+ const t = r.useContext(B), o = r.useRef(null), s = T(e, o);
71
+ return r.useEffect(() => {
72
+ const a = o.current;
73
+ if (a)
74
+ return t.branches.add(a), () => {
75
+ t.branches.delete(a);
76
+ };
77
+ }, [t.branches]), /* @__PURE__ */ P(m.div, { ...n, ref: s });
78
+ });
79
+ F.displayName = q;
80
+ function G(n, e = globalThis?.document) {
81
+ const t = b(n), o = r.useRef(!1), s = r.useRef(() => {
82
+ });
83
+ return r.useEffect(() => {
84
+ const a = (l) => {
85
+ if (l.target && !o.current) {
86
+ let E = function() {
87
+ I(
88
+ X,
89
+ t,
90
+ c,
91
+ { discrete: !0 }
92
+ );
93
+ };
94
+ const c = { originalEvent: l };
95
+ l.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = E, e.addEventListener("click", s.current, { once: !0 })) : E();
96
+ } else
97
+ e.removeEventListener("click", s.current);
98
+ o.current = !1;
99
+ }, d = window.setTimeout(() => {
100
+ e.addEventListener("pointerdown", a);
101
+ }, 0);
102
+ return () => {
103
+ window.clearTimeout(d), e.removeEventListener("pointerdown", a), e.removeEventListener("click", s.current);
104
+ };
105
+ }, [e, t]), {
106
+ // ensures we check React component tree (not just DOM tree)
107
+ onPointerDownCapture: () => o.current = !0
108
+ };
109
+ }
110
+ function J(n, e = globalThis?.document) {
111
+ const t = b(n), o = r.useRef(!1);
112
+ return r.useEffect(() => {
113
+ const s = (a) => {
114
+ a.target && !o.current && I(Y, t, { originalEvent: a }, {
115
+ discrete: !1
116
+ });
117
+ };
118
+ return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
119
+ }, [e, t]), {
120
+ onFocusCapture: () => o.current = !0,
121
+ onBlurCapture: () => o.current = !1
122
+ };
123
+ }
124
+ function g() {
125
+ const n = new CustomEvent(h);
126
+ document.dispatchEvent(n);
127
+ }
128
+ function I(n, e, t, { discrete: o }) {
129
+ const s = t.originalEvent.target, a = new CustomEvent(n, { bubbles: !1, cancelable: !0, detail: t });
130
+ e && s.addEventListener(n, e, { once: !0 }), o ? z(s, a) : s.dispatchEvent(a);
131
+ }
132
+ var ne = x, re = F, Q = "Portal", V = r.forwardRef((n, e) => {
133
+ const { container: t, ...o } = n, [s, a] = r.useState(!1);
134
+ U(() => a(!0), []);
135
+ const d = t || s && globalThis?.document?.body;
136
+ return d ? H.createPortal(/* @__PURE__ */ P(m.div, { ...o, ref: e }), d) : null;
137
+ });
138
+ V.displayName = Q;
139
+ export {
140
+ re as B,
141
+ x as D,
142
+ V as P,
143
+ ne as R
144
+ };
@@ -1,6 +1,6 @@
1
1
  import r from "react";
2
- import { c as y } from "./index-Cq1I1cG9.js";
3
- import { u as M, c as x } from "./index-B5MIi2tR.js";
2
+ import { c as y } from "./index-BfXxHr_2.js";
3
+ import { u as M, c as x } from "./index-DQH6odE9.js";
4
4
  import { jsx as d } from "react/jsx-runtime";
5
5
  function D(s) {
6
6
  const f = s + "CollectionProvider", [A, N] = y(f), [_, m] = A(
@@ -1,9 +1,9 @@
1
1
  import { c as O } from "./clsx-OuTLNxxd.js";
2
2
  const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
3
3
  var u;
4
- if ((l == null ? void 0 : l.variants) == null) return y(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
4
+ if (l?.variants == null) return y(e, n?.class, n?.className);
5
5
  const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
6
- const a = n == null ? void 0 : n[t], s = d == null ? void 0 : d[t];
6
+ const a = n?.[t], s = d?.[t];
7
7
  if (a === null) return null;
8
8
  const i = m(a) || m(s);
9
9
  return r[t][i];
@@ -27,7 +27,7 @@ const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j =
27
27
  i
28
28
  ] : t;
29
29
  }, []);
30
- return y(e, V, N, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
30
+ return y(e, V, N, n?.class, n?.className);
31
31
  };
32
32
  export {
33
33
  j as c
@@ -1,8 +1,8 @@
1
- import { R as Ee, P as ke, O as Se, C as Ie } from "./index-DLYwlPRZ.js";
1
+ import { R as Ee, P as ke, O as Se, C as Ie } from "./index-BXuxPoz7.js";
2
2
  import * as n from "react";
3
- import { P as C } from "./index-BCGvACM9.js";
4
- import { u as P } from "./index-Cs8Lv8Wj.js";
5
- import { a as j } from "./index-B5MIi2tR.js";
3
+ import { P as C } from "./index-C9T9HQaa.js";
4
+ import { u as P } from "./index-bwWKd82e.js";
5
+ import { a as j } from "./index-DQH6odE9.js";
6
6
  var de = 1, xe = 0.9, Re = 0.8, Ce = 0.17, Q = 0.1, Z = 0.999, Ae = 0.9999, Me = 0.99, $e = /[\\\/_+.#"@\[\(\{&]/, De = /[\\\/_+.#"@\[\(\{&]/g, Fe = /[\s-]/, me = /[\s-]/g;
7
7
  function ee(t, l, r, f, u, c, d) {
8
8
  if (c === l.length) return u === t.length ? de : Me;
@@ -63,7 +63,7 @@ var V = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Pe = '[cmdk-group-headin
63
63
  c.current.delete(e), f.current.delete(e), r.current.filtered.items.delete(e);
64
64
  let s = D();
65
65
  w(4, () => {
66
- J(), (s == null ? void 0 : s.getAttribute("id")) === e && G(), k.emit();
66
+ J(), s?.getAttribute("id") === e && G(), k.emit();
67
67
  });
68
68
  }), group: (e) => (u.current.has(e) || u.current.set(e, /* @__PURE__ */ new Set()), () => {
69
69
  c.current.delete(e), u.current.delete(e);
@@ -94,11 +94,11 @@ var V = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Pe = '[cmdk-group-headin
94
94
  }), o.sort((a, v) => v[1] - a[1]).forEach((a) => {
95
95
  var v;
96
96
  let g = (v = M.current) == null ? void 0 : v.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);
97
- g == null || g.parentElement.appendChild(g);
97
+ g?.parentElement.appendChild(g);
98
98
  });
99
99
  }
100
100
  function G() {
101
- let e = q().find((s) => s.getAttribute("aria-disabled") !== "true"), o = e == null ? void 0 : e.getAttribute(F);
101
+ let e = q().find((s) => s.getAttribute("aria-disabled") !== "true"), o = e?.getAttribute(F);
102
102
  k.setState("value", o || void 0);
103
103
  }
104
104
  function J() {
@@ -142,8 +142,8 @@ var V = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Pe = '[cmdk-group-headin
142
142
  (o = m.current) != null && o.loop && (g = v + e < 0 ? a[a.length - 1] : v + e === a.length ? a[0] : a[v + e]), g && k.setState("value", g.getAttribute(F));
143
143
  }
144
144
  function ue(e) {
145
- let o = D(), s = o == null ? void 0 : o.closest(V), a;
146
- for (; s && !a; ) s = e > 0 ? Ne(s, V) : Te(s, V), a = s == null ? void 0 : s.querySelector(fe);
145
+ let o = D(), s = o?.closest(V), a;
146
+ for (; s && !a; ) s = e > 0 ? Ne(s, V) : Te(s, V), a = s?.querySelector(fe);
147
147
  a ? k.setState("value", a.getAttribute(F)) : Y(e);
148
148
  }
149
149
  let ie = () => X(q().length - 1), oe = (e) => {
@@ -194,9 +194,9 @@ var V = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Pe = '[cmdk-group-headin
194
194
  } }, n.createElement("label", { "cmdk-label": "", htmlFor: T.inputId, id: T.labelId, style: Je }, b), z(t, (e) => n.createElement(he.Provider, { value: k }, n.createElement(pe.Provider, { value: T }, e))));
195
195
  }), Ve = n.forwardRef((t, l) => {
196
196
  var r, f;
197
- let u = P(), c = n.useRef(null), d = n.useContext(ge), m = L(), b = we(t), i = (f = (r = b.current) == null ? void 0 : r.forceMount) != null ? f : d == null ? void 0 : d.forceMount;
197
+ let u = P(), c = n.useRef(null), d = n.useContext(ge), m = L(), b = we(t), i = (f = (r = b.current) == null ? void 0 : r.forceMount) != null ? f : d?.forceMount;
198
198
  $(() => {
199
- if (!i) return m.item(u, d == null ? void 0 : d.id);
199
+ if (!i) return m.item(u, d?.id);
200
200
  }, [i]);
201
201
  let p = ye(u, c, [t.value, t.children, c], t.keywords), h = re(), I = R((w) => w.value && w.value === p.current), E = R((w) => i || m.filter() === !1 ? !0 : w.search ? w.filtered.items.get(u) > 0 : !0);
202
202
  n.useEffect(() => {
@@ -226,7 +226,7 @@ var V = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Pe = '[cmdk-group-headin
226
226
  return n.useEffect(() => {
227
227
  t.value != null && c.setState("search", t.value);
228
228
  }, [t.value]), n.createElement(C.input, { ref: l, ...f, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": m, id: b.inputId, type: "text", value: u ? t.value : d, onChange: (i) => {
229
- u || c.setState("search", i.target.value), r == null || r(i.target.value);
229
+ u || c.setState("search", i.target.value), r?.(i.target.value);
230
230
  } });
231
231
  }), Be = n.forwardRef((t, l) => {
232
232
  let { children: r, label: f = "Suggestions", ...u } = t, c = n.useRef(null), d = n.useRef(null), m = R((i) => i.selectedItemId), b = L();
@@ -0,0 +1,431 @@
1
+ import * as l from "react";
2
+ import { a as ce, c as le, b as _ } from "./index-BfXxHr_2.js";
3
+ import { u as M } from "./index-DQH6odE9.js";
4
+ import { u as de } from "./index-BdMNhZnh.js";
5
+ import { a as ue, u as fe } from "./index-CZnD2QxM.js";
6
+ import { P as T } from "./index-C9T9HQaa.js";
7
+ import { c as me } from "./index-Cvx4lqTq.js";
8
+ import { jsx as g, jsxs as Se } from "react/jsx-runtime";
9
+ function $(e, [t, n]) {
10
+ return Math.min(n, Math.max(t, e));
11
+ }
12
+ var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
13
+ "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
14
+ "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
15
+ "from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
16
+ "from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
17
+ }, C = "Slider", [N, pe, he] = me(C), [W, ze] = le(C, [
18
+ he
19
+ ]), [ge, V] = W(C), q = l.forwardRef(
20
+ (e, t) => {
21
+ const {
22
+ name: n,
23
+ min: o = 0,
24
+ max: s = 100,
25
+ step: c = 1,
26
+ orientation: r = "horizontal",
27
+ disabled: a = !1,
28
+ minStepsBetweenThumbs: u = 0,
29
+ defaultValue: w = [o],
30
+ value: p,
31
+ onValueChange: i = () => {
32
+ },
33
+ onValueCommit: d = () => {
34
+ },
35
+ inverted: v = !1,
36
+ form: y,
37
+ ...h
38
+ } = e, m = l.useRef(/* @__PURE__ */ new Set()), f = l.useRef(0), b = r === "horizontal" ? ve : we, [S = [], K] = ce({
39
+ prop: p,
40
+ defaultProp: w,
41
+ onChange: (R) => {
42
+ [...m.current][f.current]?.focus(), i(R);
43
+ }
44
+ }), B = l.useRef(S);
45
+ function k(R) {
46
+ const P = xe(S, R);
47
+ I(R, P);
48
+ }
49
+ function se(R) {
50
+ I(R, f.current);
51
+ }
52
+ function ae() {
53
+ const R = B.current[f.current];
54
+ S[f.current] !== R && d(S);
55
+ }
56
+ function I(R, P, { commit: z } = { commit: !1 }) {
57
+ const F = Me(c), H = Ce(Math.round((R - o) / c) * c + o, F), A = $(H, [o, s]);
58
+ K((E = []) => {
59
+ const x = ye(E, A, P);
60
+ if (_e(x, u * c)) {
61
+ f.current = x.indexOf(A);
62
+ const Y = String(x) !== String(E);
63
+ return Y && z && d(x), Y ? x : E;
64
+ } else
65
+ return E;
66
+ });
67
+ }
68
+ return /* @__PURE__ */ g(
69
+ ge,
70
+ {
71
+ scope: e.__scopeSlider,
72
+ name: n,
73
+ disabled: a,
74
+ min: o,
75
+ max: s,
76
+ valueIndexToChangeRef: f,
77
+ thumbs: m.current,
78
+ values: S,
79
+ orientation: r,
80
+ form: y,
81
+ children: /* @__PURE__ */ g(N.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(N.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(
82
+ b,
83
+ {
84
+ "aria-disabled": a,
85
+ "data-disabled": a ? "" : void 0,
86
+ ...h,
87
+ ref: t,
88
+ onPointerDown: _(h.onPointerDown, () => {
89
+ a || (B.current = S);
90
+ }),
91
+ min: o,
92
+ max: s,
93
+ inverted: v,
94
+ onSlideStart: a ? void 0 : k,
95
+ onSlideMove: a ? void 0 : se,
96
+ onSlideEnd: a ? void 0 : ae,
97
+ onHomeKeyDown: () => !a && I(o, 0, { commit: !0 }),
98
+ onEndKeyDown: () => !a && I(s, S.length - 1, { commit: !0 }),
99
+ onStepKeyDown: ({ event: R, direction: P }) => {
100
+ if (!a) {
101
+ const H = j.includes(R.key) || R.shiftKey && X.includes(R.key) ? 10 : 1, A = f.current, E = S[A], x = c * H * P;
102
+ I(E + x, A, { commit: !0 });
103
+ }
104
+ }
105
+ }
106
+ ) }) })
107
+ }
108
+ );
109
+ }
110
+ );
111
+ q.displayName = C;
112
+ var [J, Q] = W(C, {
113
+ startEdge: "left",
114
+ endEdge: "right",
115
+ size: "width",
116
+ direction: 1
117
+ }), ve = l.forwardRef(
118
+ (e, t) => {
119
+ const {
120
+ min: n,
121
+ max: o,
122
+ dir: s,
123
+ inverted: c,
124
+ onSlideStart: r,
125
+ onSlideMove: a,
126
+ onSlideEnd: u,
127
+ onStepKeyDown: w,
128
+ ...p
129
+ } = e, [i, d] = l.useState(null), v = M(t, (b) => d(b)), y = l.useRef(void 0), h = de(s), m = h === "ltr", f = m && !c || !m && c;
130
+ function D(b) {
131
+ const S = y.current || i.getBoundingClientRect(), K = [0, S.width], k = U(K, f ? [n, o] : [o, n]);
132
+ return y.current = S, k(b - S.left);
133
+ }
134
+ return /* @__PURE__ */ g(
135
+ J,
136
+ {
137
+ scope: e.__scopeSlider,
138
+ startEdge: f ? "left" : "right",
139
+ endEdge: f ? "right" : "left",
140
+ direction: f ? 1 : -1,
141
+ size: "width",
142
+ children: /* @__PURE__ */ g(
143
+ Z,
144
+ {
145
+ dir: h,
146
+ "data-orientation": "horizontal",
147
+ ...p,
148
+ ref: v,
149
+ style: {
150
+ ...p.style,
151
+ "--radix-slider-thumb-transform": "translateX(-50%)"
152
+ },
153
+ onSlideStart: (b) => {
154
+ const S = D(b.clientX);
155
+ r?.(S);
156
+ },
157
+ onSlideMove: (b) => {
158
+ const S = D(b.clientX);
159
+ a?.(S);
160
+ },
161
+ onSlideEnd: () => {
162
+ y.current = void 0, u?.();
163
+ },
164
+ onStepKeyDown: (b) => {
165
+ const K = G[f ? "from-left" : "from-right"].includes(b.key);
166
+ w?.({ event: b, direction: K ? -1 : 1 });
167
+ }
168
+ }
169
+ )
170
+ }
171
+ );
172
+ }
173
+ ), we = l.forwardRef(
174
+ (e, t) => {
175
+ const {
176
+ min: n,
177
+ max: o,
178
+ inverted: s,
179
+ onSlideStart: c,
180
+ onSlideMove: r,
181
+ onSlideEnd: a,
182
+ onStepKeyDown: u,
183
+ ...w
184
+ } = e, p = l.useRef(null), i = M(t, p), d = l.useRef(void 0), v = !s;
185
+ function y(h) {
186
+ const m = d.current || p.current.getBoundingClientRect(), f = [0, m.height], b = U(f, v ? [o, n] : [n, o]);
187
+ return d.current = m, b(h - m.top);
188
+ }
189
+ return /* @__PURE__ */ g(
190
+ J,
191
+ {
192
+ scope: e.__scopeSlider,
193
+ startEdge: v ? "bottom" : "top",
194
+ endEdge: v ? "top" : "bottom",
195
+ size: "height",
196
+ direction: v ? 1 : -1,
197
+ children: /* @__PURE__ */ g(
198
+ Z,
199
+ {
200
+ "data-orientation": "vertical",
201
+ ...w,
202
+ ref: i,
203
+ style: {
204
+ ...w.style,
205
+ "--radix-slider-thumb-transform": "translateY(50%)"
206
+ },
207
+ onSlideStart: (h) => {
208
+ const m = y(h.clientY);
209
+ c?.(m);
210
+ },
211
+ onSlideMove: (h) => {
212
+ const m = y(h.clientY);
213
+ r?.(m);
214
+ },
215
+ onSlideEnd: () => {
216
+ d.current = void 0, a?.();
217
+ },
218
+ onStepKeyDown: (h) => {
219
+ const f = G[v ? "from-bottom" : "from-top"].includes(h.key);
220
+ u?.({ event: h, direction: f ? -1 : 1 });
221
+ }
222
+ }
223
+ )
224
+ }
225
+ );
226
+ }
227
+ ), Z = l.forwardRef(
228
+ (e, t) => {
229
+ const {
230
+ __scopeSlider: n,
231
+ onSlideStart: o,
232
+ onSlideMove: s,
233
+ onSlideEnd: c,
234
+ onHomeKeyDown: r,
235
+ onEndKeyDown: a,
236
+ onStepKeyDown: u,
237
+ ...w
238
+ } = e, p = V(C, n);
239
+ return /* @__PURE__ */ g(
240
+ T.span,
241
+ {
242
+ ...w,
243
+ ref: t,
244
+ onKeyDown: _(e.onKeyDown, (i) => {
245
+ i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (a(i), i.preventDefault()) : j.concat(X).includes(i.key) && (u(i), i.preventDefault());
246
+ }),
247
+ onPointerDown: _(e.onPointerDown, (i) => {
248
+ const d = i.target;
249
+ d.setPointerCapture(i.pointerId), i.preventDefault(), p.thumbs.has(d) ? d.focus() : o(i);
250
+ }),
251
+ onPointerMove: _(e.onPointerMove, (i) => {
252
+ i.target.hasPointerCapture(i.pointerId) && s(i);
253
+ }),
254
+ onPointerUp: _(e.onPointerUp, (i) => {
255
+ const d = i.target;
256
+ d.hasPointerCapture(i.pointerId) && (d.releasePointerCapture(i.pointerId), c(i));
257
+ })
258
+ }
259
+ );
260
+ }
261
+ ), ee = "SliderTrack", te = l.forwardRef(
262
+ (e, t) => {
263
+ const { __scopeSlider: n, ...o } = e, s = V(ee, n);
264
+ return /* @__PURE__ */ g(
265
+ T.span,
266
+ {
267
+ "data-disabled": s.disabled ? "" : void 0,
268
+ "data-orientation": s.orientation,
269
+ ...o,
270
+ ref: t
271
+ }
272
+ );
273
+ }
274
+ );
275
+ te.displayName = ee;
276
+ var L = "SliderRange", ne = l.forwardRef(
277
+ (e, t) => {
278
+ const { __scopeSlider: n, ...o } = e, s = V(L, n), c = Q(L, n), r = l.useRef(null), a = M(t, r), u = s.values.length, w = s.values.map(
279
+ (d) => ie(d, s.min, s.max)
280
+ ), p = u > 1 ? Math.min(...w) : 0, i = 100 - Math.max(...w);
281
+ return /* @__PURE__ */ g(
282
+ T.span,
283
+ {
284
+ "data-orientation": s.orientation,
285
+ "data-disabled": s.disabled ? "" : void 0,
286
+ ...o,
287
+ ref: a,
288
+ style: {
289
+ ...e.style,
290
+ [c.startEdge]: p + "%",
291
+ [c.endEdge]: i + "%"
292
+ }
293
+ }
294
+ );
295
+ }
296
+ );
297
+ ne.displayName = L;
298
+ var O = "SliderThumb", oe = l.forwardRef(
299
+ (e, t) => {
300
+ const n = pe(e.__scopeSlider), [o, s] = l.useState(null), c = M(t, (a) => s(a)), r = l.useMemo(
301
+ () => o ? n().findIndex((a) => a.ref.current === o) : -1,
302
+ [n, o]
303
+ );
304
+ return /* @__PURE__ */ g(be, { ...e, ref: c, index: r });
305
+ }
306
+ ), be = l.forwardRef(
307
+ (e, t) => {
308
+ const { __scopeSlider: n, index: o, name: s, ...c } = e, r = V(O, n), a = Q(O, n), [u, w] = l.useState(null), p = M(t, (D) => w(D)), i = u ? r.form || !!u.closest("form") : !0, d = ue(u), v = r.values[o], y = v === void 0 ? 0 : ie(v, r.min, r.max), h = Pe(o, r.values.length), m = d?.[a.size], f = m ? De(m, y, a.direction) : 0;
309
+ return l.useEffect(() => {
310
+ if (u)
311
+ return r.thumbs.add(u), () => {
312
+ r.thumbs.delete(u);
313
+ };
314
+ }, [u, r.thumbs]), /* @__PURE__ */ Se(
315
+ "span",
316
+ {
317
+ style: {
318
+ transform: "var(--radix-slider-thumb-transform)",
319
+ position: "absolute",
320
+ [a.startEdge]: `calc(${y}% + ${f}px)`
321
+ },
322
+ children: [
323
+ /* @__PURE__ */ g(N.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ g(
324
+ T.span,
325
+ {
326
+ role: "slider",
327
+ "aria-label": e["aria-label"] || h,
328
+ "aria-valuemin": r.min,
329
+ "aria-valuenow": v,
330
+ "aria-valuemax": r.max,
331
+ "aria-orientation": r.orientation,
332
+ "data-orientation": r.orientation,
333
+ "data-disabled": r.disabled ? "" : void 0,
334
+ tabIndex: r.disabled ? void 0 : 0,
335
+ ...c,
336
+ ref: p,
337
+ style: v === void 0 ? { display: "none" } : e.style,
338
+ onFocus: _(e.onFocus, () => {
339
+ r.valueIndexToChangeRef.current = o;
340
+ })
341
+ }
342
+ ) }),
343
+ i && /* @__PURE__ */ g(
344
+ re,
345
+ {
346
+ name: s ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
347
+ form: r.form,
348
+ value: v
349
+ },
350
+ o
351
+ )
352
+ ]
353
+ }
354
+ );
355
+ }
356
+ );
357
+ oe.displayName = O;
358
+ var Re = "RadioBubbleInput", re = l.forwardRef(
359
+ ({ __scopeSlider: e, value: t, ...n }, o) => {
360
+ const s = l.useRef(null), c = M(s, o), r = fe(t);
361
+ return l.useEffect(() => {
362
+ const a = s.current;
363
+ if (!a) return;
364
+ const u = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(u, "value").set;
365
+ if (r !== t && p) {
366
+ const i = new Event("input", { bubbles: !0 });
367
+ p.call(a, t), a.dispatchEvent(i);
368
+ }
369
+ }, [r, t]), /* @__PURE__ */ g(
370
+ T.input,
371
+ {
372
+ style: { display: "none" },
373
+ ...n,
374
+ ref: c,
375
+ defaultValue: t
376
+ }
377
+ );
378
+ }
379
+ );
380
+ re.displayName = Re;
381
+ function ye(e = [], t, n) {
382
+ const o = [...e];
383
+ return o[n] = t, o.sort((s, c) => s - c);
384
+ }
385
+ function ie(e, t, n) {
386
+ const c = 100 / (n - t) * (e - t);
387
+ return $(c, [0, 100]);
388
+ }
389
+ function Pe(e, t) {
390
+ return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
391
+ }
392
+ function xe(e, t) {
393
+ if (e.length === 1) return 0;
394
+ const n = e.map((s) => Math.abs(s - t)), o = Math.min(...n);
395
+ return n.indexOf(o);
396
+ }
397
+ function De(e, t, n) {
398
+ const o = e / 2, c = U([0, 50], [0, o]);
399
+ return (o - c(t) * n) * n;
400
+ }
401
+ function Ee(e) {
402
+ return e.slice(0, -1).map((t, n) => e[n + 1] - t);
403
+ }
404
+ function _e(e, t) {
405
+ if (t > 0) {
406
+ const n = Ee(e);
407
+ return Math.min(...n) >= t;
408
+ }
409
+ return !0;
410
+ }
411
+ function U(e, t) {
412
+ return (n) => {
413
+ if (e[0] === e[1] || t[0] === t[1]) return t[0];
414
+ const o = (t[1] - t[0]) / (e[1] - e[0]);
415
+ return t[0] + o * (n - e[0]);
416
+ };
417
+ }
418
+ function Me(e) {
419
+ return (String(e).split(".")[1] || "").length;
420
+ }
421
+ function Ce(e, t) {
422
+ const n = Math.pow(10, t);
423
+ return Math.round(e * n) / n;
424
+ }
425
+ var He = q, Ne = te, Le = ne, Oe = oe;
426
+ export {
427
+ He as R,
428
+ Ne as T,
429
+ Le as a,
430
+ Oe as b
431
+ };
@@ -70,9 +70,8 @@ function R(e, n) {
70
70
  return { ...e, ...r };
71
71
  }
72
72
  function h(e) {
73
- var o, t;
74
- let n = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning;
75
- return r ? e.ref : (n = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
73
+ let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning;
74
+ return r ? e.ref : (n = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
76
75
  }
77
76
  export {
78
77
  I as S,