@konstructio/ui 0.1.2-alpha.108 → 0.1.2-alpha.109

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 (27) hide show
  1. package/dist/Wrapper-Bbaaa7YA.js +218 -0
  2. package/dist/components/DateRangePicker/DateRangePicker.js +33 -32
  3. package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +49 -47
  4. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +27 -26
  5. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +27 -26
  6. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +3 -3
  7. package/dist/components/Select/Select.js +17 -16
  8. package/dist/components/Select/components/Wrapper.js +1 -1
  9. package/dist/components/Select/components/index.js +1 -1
  10. package/dist/components/Select/contexts/select.provider.js +34 -33
  11. package/dist/components/Select/hooks/useSelect.js +35 -34
  12. package/dist/components/VirtualizedTable/components/Actions/components/PortalActions/hooks/use-menu-interactions/use-menu-interactions.js +9 -9
  13. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +16 -16
  14. package/dist/dist-ByCJijZd.js +174 -0
  15. package/dist/hooks/useClickOutside.js +8 -8
  16. package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +7 -1
  17. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.types.d.ts +3 -0
  18. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.types.d.ts +3 -1
  19. package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.types.d.ts +3 -1
  20. package/dist/lib/components/Select/Select.types.d.ts +3 -0
  21. package/dist/lib/components/Select/contexts/select.provider.d.ts +1 -0
  22. package/dist/lib/components/Select/hooks/useSelect.d.ts +3 -1
  23. package/dist/lib/hooks/useClickOutside.d.ts +3 -1
  24. package/dist/package.json +1 -1
  25. package/package.json +1 -1
  26. package/dist/Wrapper-2AUlYAHQ.js +0 -195
  27. package/dist/dist-BnCbAI-c.js +0 -166
@@ -1,30 +1,31 @@
1
- import { n as w, t as d } from "../../utils-B-6R7kNE.js";
2
- import { t as y } from "../../Wrapper-2AUlYAHQ.js";
3
- import { SelectProvider as M } from "./contexts/select.provider.js";
4
- import { n as S } from "../../AdditionalOptions-Crcnz0_g.js";
5
- import { forwardRef as b, useId as E, useMemo as G } from "react";
6
- import { jsx as s, jsxs as H } from "react/jsx-runtime";
7
- var A = b(({ error: e, errorClassName: m, helperText: l, helperTextClassName: x, highlightSearch: h, id: u, mainWrapperClassName: I, name: r, value: g, options: t, onChange: v, onBlur: n, ...$ }, N) => {
8
- const c = E(), o = u ?? (r ? `${c}-${r}` : c), i = `${o}-error`, p = `${o}-helper-text`, a = typeof e == "string" && e.length > 0, f = !a && !!l, O = w(a && i, f && p), j = G(() => t.length ? S(t.at(0)) ? t.flatMap((k) => k.options) : t : [], [t]);
9
- return /* @__PURE__ */ s(M, {
1
+ import { n as y, t as d } from "../../utils-B-6R7kNE.js";
2
+ import { t as M } from "../../Wrapper-Bbaaa7YA.js";
3
+ import { SelectProvider as S } from "./contexts/select.provider.js";
4
+ import { n as b } from "../../AdditionalOptions-Crcnz0_g.js";
5
+ import { forwardRef as E, useId as G, useMemo as H } from "react";
6
+ import { jsx as s, jsxs as P } from "react/jsx-runtime";
7
+ var B = E(({ error: e, errorClassName: m, helperText: l, helperTextClassName: x, highlightSearch: h, id: u, mainWrapperClassName: I, name: r, value: g, options: t, onChange: v, onBlur: n, onValueChange: $, ...N }, O) => {
8
+ const c = G(), o = u ?? (r ? `${c}-${r}` : c), i = `${o}-error`, p = `${o}-helper-text`, a = typeof e == "string" && e.length > 0, f = !a && !!l, j = y(a && i, f && p), k = H(() => t.length ? b(t.at(0)) ? t.flatMap((w) => w.options) : t : [], [t]);
9
+ return /* @__PURE__ */ s(S, {
10
10
  highlightSearch: h,
11
11
  name: r,
12
12
  value: g,
13
- options: j,
13
+ options: k,
14
14
  onBlur: n,
15
15
  onChange: v,
16
- children: /* @__PURE__ */ H("div", {
16
+ onValueChange: $,
17
+ children: /* @__PURE__ */ P("div", {
17
18
  className: d("relative w-full", I),
18
19
  children: [
19
- /* @__PURE__ */ s(y, {
20
- describedBy: O,
20
+ /* @__PURE__ */ s(M, {
21
+ describedBy: j,
21
22
  error: e,
22
23
  fieldId: o,
23
24
  name: r,
24
- ref: N,
25
+ ref: O,
25
26
  onBlur: n,
26
27
  groupedOptions: t,
27
- ...$
28
+ ...N
28
29
  }),
29
30
  a ? /* @__PURE__ */ s("span", {
30
31
  id: i,
@@ -41,5 +42,5 @@ var A = b(({ error: e, errorClassName: m, helperText: l, helperTextClassName: x,
41
42
  });
42
43
  });
43
44
  export {
44
- A as Select
45
+ B as Select
45
46
  };
@@ -1,4 +1,4 @@
1
- import { t as p } from "../../../Wrapper-2AUlYAHQ.js";
1
+ import { t as p } from "../../../Wrapper-Bbaaa7YA.js";
2
2
  export {
3
3
  p as Wrapper
4
4
  };
@@ -1,4 +1,4 @@
1
- import { t as o } from "../../../Wrapper-2AUlYAHQ.js";
1
+ import { t as o } from "../../../Wrapper-Bbaaa7YA.js";
2
2
  import { t as i } from "../../../AdditionalOptions-Crcnz0_g.js";
3
3
  import { EmptyList as p } from "./EmptyList.js";
4
4
  import { List as a } from "./List/List.js";
@@ -1,48 +1,49 @@
1
- import { useToggle as L } from "../../../hooks/useToggle.js";
2
- import { SelectContext as N } from "./select.context.js";
3
- import { useCallback as f, useEffect as T, useRef as p, useState as e } from "react";
4
- import { jsx as O } from "react/jsx-runtime";
5
- var c = 1, R = 300, V = ({ children: v, value: C, name: i, highlightSearch: E = !1, options: n, onChange: a, onBlur: u }) => {
6
- const [S, l] = e(n), d = p(E), [F, g] = L(!1), [P, I] = e(""), [b, x] = e(!0), [A, o] = e(!0), [_, s] = e(c), [y, h] = e(!1), t = p(void 0), D = f((r, m) => {
7
- m?.current && (m.current.value = r), t.current && clearTimeout(t.current), h(!0), o(!0), s(c), a?.({ target: {
1
+ import { useToggle as N } from "../../../hooks/useToggle.js";
2
+ import { SelectContext as O } from "./select.context.js";
3
+ import { useCallback as T, useEffect as p, useRef as v, useState as e } from "react";
4
+ import { jsx as R } from "react/jsx-runtime";
5
+ var c = 1, Y = 300, w = ({ children: E, value: S, name: i, highlightSearch: d = !1, options: n, onChange: a, onBlur: u, onValueChange: l }) => {
6
+ const [C, g] = e(n), F = v(d), [P, h] = N(!1), [I, b] = e(""), [x, A] = e(!0), [_, o] = e(!0), [y, s] = e(c), [D, m] = e(!1), t = v(void 0), G = T((r, f) => {
7
+ f?.current && (f.current.value = r), t.current && clearTimeout(t.current), m(!0), o(!0), s(c), a?.({ target: {
8
8
  value: r,
9
9
  name: i ?? ""
10
- } }), u?.(), t.current = setTimeout(() => {
11
- h(!1);
12
- }, R);
10
+ } }), l?.(r), u?.(), t.current = setTimeout(() => {
11
+ m(!1);
12
+ }, Y);
13
13
  }, [
14
14
  a,
15
+ l,
15
16
  i,
16
17
  u
17
- ]), G = f((r) => {
18
- g(r), o(!0), s(c);
19
- }, [g]);
20
- return T(() => {
21
- l(n);
22
- }, [n.length]), T(() => () => {
18
+ ]), L = T((r) => {
19
+ h(r), o(!0), s(c);
20
+ }, [h]);
21
+ return p(() => {
22
+ g(n);
23
+ }, [n.length]), p(() => () => {
23
24
  t.current && clearTimeout(t.current);
24
- }, []), /* @__PURE__ */ O(N.Provider, {
25
+ }, []), /* @__PURE__ */ R(O.Provider, {
25
26
  value: {
26
- highlightSearchEnabled: d.current,
27
- isOpen: F,
28
- searchTerm: P,
29
- value: C,
30
- canFilter: b,
31
- canContinueFetching: A,
32
- page: _,
33
- options: S,
34
- isTyping: y,
35
- setOptions: l,
27
+ highlightSearchEnabled: F.current,
28
+ isOpen: P,
29
+ searchTerm: I,
30
+ value: S,
31
+ canFilter: x,
32
+ canContinueFetching: _,
33
+ page: y,
34
+ options: C,
35
+ isTyping: D,
36
+ setOptions: g,
36
37
  setPage: s,
37
38
  setCanContinueFetching: o,
38
- setCanFilter: x,
39
- setSearchTerm: I,
40
- setValue: D,
41
- toggleOpen: G
39
+ setCanFilter: A,
40
+ setSearchTerm: b,
41
+ setValue: G,
42
+ toggleOpen: L
42
43
  },
43
- children: v
44
+ children: E
44
45
  });
45
46
  };
46
47
  export {
47
- V as SelectProvider
48
+ w as SelectProvider
48
49
  };
@@ -1,56 +1,57 @@
1
- import { useClickOutside as E } from "../../../hooks/useClickOutside.js";
2
- import { useSelectContext as b } from "../contexts/select.hook.js";
3
- import { useCallback as p, useEffect as l, useRef as g } from "react";
4
- var k = ({ inputRef: r, searchInputRef: v, internalValue: c, onBlur: i }) => {
5
- const t = g(null), d = g(null), { value: o, setSearchTerm: f, setCanFilter: u, toggleOpen: n } = b(), m = p(() => {
6
- n(!1);
7
- }, [n]);
8
- return E(t, m), l(() => {
9
- const e = new AbortController(), s = (a) => {
10
- a.key === "Escape" && n(!1);
1
+ import { useClickOutside as h } from "../../../hooks/useClickOutside.js";
2
+ import { useSelectContext as w } from "../contexts/select.hook.js";
3
+ import { useCallback as E, useEffect as a, useMemo as L, useRef as b } from "react";
4
+ var F = ({ inputRef: s, searchInputRef: p, internalValue: l, listRef: f, onBlur: g }) => {
5
+ const n = b(null), m = b(null), { value: o, setSearchTerm: v, setCanFilter: c, toggleOpen: t } = w(), u = L(() => [n, f], [f]), i = E((e) => e ? u.some((r) => r?.current?.contains(e)) : !1, [u]), C = E(() => {
6
+ t(!1);
7
+ }, [t]);
8
+ return h(u, C), a(() => {
9
+ const e = new AbortController(), r = (d) => {
10
+ d.key === "Escape" && t(!1);
11
11
  };
12
- return document.addEventListener("keydown", s, { signal: e.signal }), document.addEventListener("visibilitychange", () => {
13
- document.hidden && n(!1);
12
+ return document.addEventListener("keydown", r, { signal: e.signal }), document.addEventListener("visibilitychange", () => {
13
+ document.hidden && t(!1);
14
14
  }, { signal: e.signal }), () => {
15
15
  e.abort();
16
16
  };
17
- }, [n, t]), l(() => {
17
+ }, [t, n]), a(() => {
18
18
  const e = new AbortController();
19
- return r?.current?.addEventListener("focusin", () => {
20
- f(c?.value ?? ""), u(!1);
21
- }, { signal: e.signal }), r?.current?.addEventListener("focusout", () => {
22
- u(!0);
23
- }, { signal: e.signal }), d.current?.addEventListener("focus", () => {
24
- u(!1);
25
- }, { signal: e.signal }), t.current?.addEventListener("focusout", (s) => {
26
- t.current?.contains(s.relatedTarget) || n(!1);
19
+ return s?.current?.addEventListener("focusin", () => {
20
+ v(l?.value ?? ""), c(!1);
21
+ }, { signal: e.signal }), s?.current?.addEventListener("focusout", () => {
22
+ c(!0);
23
+ }, { signal: e.signal }), m.current?.addEventListener("focus", () => {
24
+ c(!1);
25
+ }, { signal: e.signal }), n.current?.addEventListener("focusout", (r) => {
26
+ i(r.relatedTarget) || t(!1);
27
27
  }, { signal: e.signal }), () => {
28
28
  e.abort();
29
29
  };
30
- }, [o]), l(() => {
31
- r?.current && (r.current.value = o && c?.value || "");
32
- }, [c, o]), l(() => {
30
+ }, [o]), a(() => {
31
+ s?.current && (s.current.value = o && l?.value || "");
32
+ }, [l, o]), a(() => {
33
33
  const e = new AbortController();
34
- return t.current?.addEventListener("focusout", (s) => {
35
- const a = s.relatedTarget;
36
- (!a || !t.current?.contains(a)) && (r?.current?.value || i?.());
34
+ return n.current?.addEventListener("focusout", (r) => {
35
+ const d = r.relatedTarget;
36
+ i(d) || s?.current?.value || g?.();
37
37
  }), () => {
38
38
  e.abort();
39
39
  };
40
40
  }, [
41
- n,
42
41
  t,
43
- f,
44
- i,
42
+ n,
43
+ v,
44
+ g,
45
45
  o
46
46
  ]), {
47
- wrapperRef: t,
48
- wrapperInputRef: d,
47
+ isInside: i,
48
+ wrapperRef: n,
49
+ wrapperInputRef: m,
49
50
  handleOpen: () => {
50
- n(!0), requestAnimationFrame(() => v?.current?.focus());
51
+ t(!0), requestAnimationFrame(() => p?.current?.focus());
51
52
  }
52
53
  };
53
54
  };
54
55
  export {
55
- k as useSelect
56
+ F as useSelect
56
57
  };
@@ -1,19 +1,19 @@
1
1
  import "../../constants/index.js";
2
- import { useCallback as r, useEffect as T, useLayoutEffect as L, useRef as p } from "react";
2
+ import { useCallback as r, useEffect as T, useLayoutEffect as M, useRef as p } from "react";
3
3
  var x = ({ isOpen: l, menuRef: s, triggerRef: d, setIsOpen: n }) => {
4
- const o = p(void 0), f = p(null), g = r(() => {
4
+ const o = p(void 0), f = p(null), h = r(() => {
5
5
  clearTimeout(o.current), n(!0);
6
6
  }, [n]), i = r(() => {
7
7
  clearTimeout(o.current), n(!1);
8
- }, [n]), h = r(() => {
8
+ }, [n]), g = r(() => {
9
9
  clearTimeout(o.current), o.current = setTimeout(() => {
10
10
  n(!1);
11
11
  }, 100);
12
12
  }, [n]), w = r((t) => {
13
- t.pointerType !== "touch" && g();
14
- }, [g]), E = r((t) => {
15
13
  t.pointerType !== "touch" && h();
16
- }, [h]), y = r((t) => {
14
+ }, [h]), E = r((t) => {
15
+ t.pointerType !== "touch" && g();
16
+ }, [g]), y = r((t) => {
17
17
  f.current = t.pointerType;
18
18
  }, []), v = r(() => {
19
19
  const t = f.current;
@@ -30,9 +30,9 @@ var x = ({ isOpen: l, menuRef: s, triggerRef: d, setIsOpen: n }) => {
30
30
  const t = d.current, e = s.current;
31
31
  if (!t || !e) return;
32
32
  const c = t.getBoundingClientRect(), a = c.bottom + 4 + e.offsetHeight <= window.innerHeight ? c.bottom + 4 : c.top - 4 - e.offsetHeight;
33
- e.style.top = `${Math.max(a, 4)}px`, e.style.left = `${Math.max(c.right - e.offsetWidth, 4)}px`;
33
+ e.style.top = `${Math.round(Math.max(a, 4))}px`, e.style.left = `${Math.round(Math.max(c.right - e.offsetWidth, 4))}px`;
34
34
  }, [s, d]);
35
- return L(() => {
35
+ return M(() => {
36
36
  l && u();
37
37
  }, [l, u]), T(() => {
38
38
  if (!l) return;
@@ -64,7 +64,7 @@ var x = ({ isOpen: l, menuRef: s, triggerRef: d, setIsOpen: n }) => {
64
64
  handlePointerLeave: E,
65
65
  handleTriggerClick: v,
66
66
  handleTriggerPointerDown: y,
67
- openMenu: g
67
+ openMenu: h
68
68
  };
69
69
  };
70
70
  export {
@@ -1,33 +1,33 @@
1
1
  import { t as o } from "../../../../utils-B-6R7kNE.js";
2
2
  import { t as u } from "../../../../chevron-up-Bjpvg6ui.js";
3
3
  import { Typography as c } from "../../../Typography/Typography.js";
4
- import { i as b, n as v, r as w, t as S } from "../../../../dist-BnCbAI-c.js";
4
+ import { a as b, i as v, n as w, r as S } from "../../../../dist-ByCJijZd.js";
5
5
  import { listVariants as k } from "../../../Select/components/List/List.variants.js";
6
6
  import { listItemVariants as N } from "../../../Select/components/ListItem/ListItem.variants.js";
7
7
  import { selectVariants as C } from "../../../Select/Select.variants.js";
8
8
  import { DEFAULT_PAGE_SIZES as y } from "../../constants/pagination.js";
9
9
  import { useTableContext as z } from "../../contexts/table.hook.js";
10
10
  import { useState as O } from "react";
11
- import { jsx as t, jsxs as r } from "react/jsx-runtime";
11
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
12
12
  var _ = ({ pageSizes: d = y, isListPortal: f = !1, direction: s = "auto" }) => {
13
- const { pageSize: i, onPageSize: g, handlePage: h } = z(), [n, l] = O(!1), m = (e) => {
14
- g(Number(e)), h(0), l(!1);
15
- }, p = /* @__PURE__ */ t(S, {
13
+ const { pageSize: i, onPageSize: g, handlePage: h } = z(), [n, l] = O(!1), m = (t) => {
14
+ g(Number(t)), h(0), l(!1);
15
+ }, p = /* @__PURE__ */ e(w, {
16
16
  asChild: !0,
17
17
  side: s === "up" ? "top" : "bottom",
18
18
  avoidCollisions: s === "auto",
19
19
  align: "start",
20
20
  sideOffset: 4,
21
- onOpenAutoFocus: (e) => {
22
- e.preventDefault();
21
+ onOpenAutoFocus: (t) => {
22
+ t.preventDefault();
23
23
  },
24
- children: /* @__PURE__ */ t("ul", {
24
+ children: /* @__PURE__ */ e("ul", {
25
25
  role: "listbox",
26
26
  "aria-label": "Rows per page",
27
27
  className: o(k(), "kvt-page-size-list", "static top-auto mt-0 z-50 w-(--radix-popover-trigger-width)"),
28
- children: d.map((e) => {
29
- const a = String(e);
30
- return /* @__PURE__ */ t("li", {
28
+ children: d.map((t) => {
29
+ const a = String(t);
30
+ return /* @__PURE__ */ e("li", {
31
31
  role: "option",
32
32
  "aria-selected": a === String(i),
33
33
  tabIndex: 0,
@@ -38,7 +38,7 @@ var _ = ({ pageSizes: d = y, isListPortal: f = !1, direction: s = "auto" }) => {
38
38
  onKeyDown: (x) => {
39
39
  x.key === "Enter" && m(a);
40
40
  },
41
- children: /* @__PURE__ */ t(c, {
41
+ children: /* @__PURE__ */ e(c, {
42
42
  variant: "body2",
43
43
  className: "text-sm dark:text-metal-50",
44
44
  children: a
@@ -49,21 +49,21 @@ var _ = ({ pageSizes: d = y, isListPortal: f = !1, direction: s = "auto" }) => {
49
49
  });
50
50
  return /* @__PURE__ */ r("div", {
51
51
  className: "kvt-page-size flex items-center gap-2 dark:text-metal-300",
52
- children: [/* @__PURE__ */ t("span", { children: "Show" }), /* @__PURE__ */ r(w, {
52
+ children: [/* @__PURE__ */ e("span", { children: "Show" }), /* @__PURE__ */ r(v, {
53
53
  open: n,
54
54
  onOpenChange: l,
55
55
  children: [/* @__PURE__ */ r(b, {
56
56
  "aria-label": "Rows per page",
57
57
  className: o(C(), "w-22 bg-white"),
58
- children: [/* @__PURE__ */ t(c, {
58
+ children: [/* @__PURE__ */ e(c, {
59
59
  variant: "body2",
60
60
  className: "flex-1 text-left text-sm text-metal-800 dark:text-metal-50",
61
61
  children: i
62
- }), /* @__PURE__ */ t(u, {
62
+ }), /* @__PURE__ */ e(u, {
63
63
  "data-state": n ? "open" : "closed",
64
64
  className: "w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none"
65
65
  })]
66
- }), f ? /* @__PURE__ */ t(v, { children: p }) : p]
66
+ }), f ? /* @__PURE__ */ e(S, { children: p }) : p]
67
67
  })]
68
68
  });
69
69
  };
@@ -0,0 +1,174 @@
1
+ import { a as _, n as D } from "./dist-xCbHbMLA.js";
2
+ import { t as I } from "./dist-CCdbu9GU.js";
3
+ import { i as T, r as m, t as N } from "./dist-D-yS0HN8.js";
4
+ import { t as k } from "./dist-DYIabsrY.js";
5
+ import { n as y } from "./dist-DKryKPmP.js";
6
+ import { n as $, r as G, t as H } from "./es2015-CoHq2g4y.js";
7
+ import { t as L } from "./dist-C4j75TwZ.js";
8
+ import { t as x } from "./dist-BUocnzkM.js";
9
+ import { t as j } from "./Combination-CnMM05mt.js";
10
+ import { a as E, i as K, r as U, t as b } from "./dist-9WbMf_jT.js";
11
+ import * as c from "react";
12
+ import { jsx as i } from "react/jsx-runtime";
13
+ var V = Object.defineProperty, l = (p, o) => V(p, "name", {
14
+ value: o,
15
+ configurable: !0
16
+ }), O = "Popover", [F, ho] = T(O, [E]), C = E(), [Z, f] = F(O), q = /* @__PURE__ */ l((p) => {
17
+ const { __scopePopover: o, children: s, open: r, defaultOpen: a, onOpenChange: t, modal: e = !1 } = p, n = C(o), u = c.useRef(null), [P, d] = c.useState(!1), [R, v] = N({
18
+ prop: r,
19
+ defaultProp: a ?? !1,
20
+ onChange: t,
21
+ caller: O
22
+ });
23
+ return /* @__PURE__ */ i(K, {
24
+ ...n,
25
+ children: /* @__PURE__ */ i(Z, {
26
+ scope: o,
27
+ contentId: k(),
28
+ triggerRef: u,
29
+ open: R,
30
+ onOpenChange: v,
31
+ onOpenToggle: c.useCallback(() => v((h) => !h), [v]),
32
+ hasCustomAnchor: P,
33
+ onCustomAnchorAdd: c.useCallback(() => d(!0), []),
34
+ onCustomAnchorRemove: c.useCallback(() => d(!1), []),
35
+ modal: e,
36
+ children: s
37
+ })
38
+ });
39
+ }, "Popover"), z = "PopoverAnchor", B = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ l(function(o, s) {
40
+ const { __scopePopover: r, ...a } = o, t = f(z, r), e = C(r), { onCustomAnchorAdd: n, onCustomAnchorRemove: u } = t;
41
+ return c.useEffect(() => (n(), () => u()), [n, u]), /* @__PURE__ */ i(b, {
42
+ ...e,
43
+ ...a,
44
+ ref: s
45
+ });
46
+ }, "PopoverAnchor")), J = "PopoverTrigger", Q = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ l(function(o, s) {
47
+ const { __scopePopover: r, ...a } = o, t = f(J, r), e = C(r), n = _(s, t.triggerRef), u = /* @__PURE__ */ i(I.button, {
48
+ type: "button",
49
+ "aria-haspopup": "dialog",
50
+ "aria-expanded": t.open,
51
+ "aria-controls": t.open ? t.contentId : void 0,
52
+ "data-state": A(t.open),
53
+ ...a,
54
+ ref: n,
55
+ onClick: m(o.onClick, t.onOpenToggle)
56
+ });
57
+ return t.hasCustomAnchor ? u : /* @__PURE__ */ i(b, {
58
+ asChild: !0,
59
+ ...e,
60
+ children: u
61
+ });
62
+ }, "PopoverTrigger")), w = "PopoverPortal", [W, X] = F(w, { forceMount: void 0 }), Y = /* @__PURE__ */ l((p) => {
63
+ const { __scopePopover: o, forceMount: s, children: r, container: a } = p, t = f(w, o);
64
+ return /* @__PURE__ */ i(W, {
65
+ scope: o,
66
+ forceMount: s,
67
+ children: /* @__PURE__ */ i(x, {
68
+ present: s || t.open,
69
+ children: /* @__PURE__ */ i(L, {
70
+ asChild: !0,
71
+ container: a,
72
+ children: r
73
+ })
74
+ })
75
+ });
76
+ }, "PopoverPortal"), g = "PopoverContent", oo = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ l(function(o, s) {
77
+ const r = X(g, o.__scopePopover), { forceMount: a = r.forceMount, ...t } = o, e = f(g, o.__scopePopover);
78
+ return /* @__PURE__ */ i(x, {
79
+ present: a || e.open,
80
+ children: e.modal ? /* @__PURE__ */ i(to, {
81
+ ...t,
82
+ ref: s
83
+ }) : /* @__PURE__ */ i(ro, {
84
+ ...t,
85
+ ref: s
86
+ })
87
+ });
88
+ }, "PopoverContent")), eo = D("PopoverContent.RemoveScroll"), to = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ l(function(o, s) {
89
+ const r = f(g, o.__scopePopover), a = c.useRef(null), t = _(s, a), e = c.useRef(!1);
90
+ return c.useEffect(() => {
91
+ const n = a.current;
92
+ if (n) return H(n);
93
+ }, []), /* @__PURE__ */ i(j, {
94
+ as: eo,
95
+ allowPinchZoom: !0,
96
+ children: /* @__PURE__ */ i(S, {
97
+ ...o,
98
+ ref: t,
99
+ trapFocus: r.open,
100
+ disableOutsidePointerEvents: !0,
101
+ onCloseAutoFocus: m(o.onCloseAutoFocus, (n) => {
102
+ n.preventDefault(), e.current || r.triggerRef.current?.focus();
103
+ }),
104
+ onPointerDownOutside: m(o.onPointerDownOutside, (n) => {
105
+ const u = n.detail.originalEvent, P = u.button === 0 && u.ctrlKey === !0, d = u.button === 2 || P;
106
+ e.current = d;
107
+ }, { checkForDefaultPrevented: !1 }),
108
+ onFocusOutside: m(o.onFocusOutside, (n) => n.preventDefault(), { checkForDefaultPrevented: !1 })
109
+ })
110
+ });
111
+ }, "PopoverContentModal")), ro = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ l(function(o, s) {
112
+ const r = f(g, o.__scopePopover), a = c.useRef(!1), t = c.useRef(!1);
113
+ return /* @__PURE__ */ i(S, {
114
+ ...o,
115
+ ref: s,
116
+ trapFocus: !1,
117
+ disableOutsidePointerEvents: !1,
118
+ onCloseAutoFocus: (e) => {
119
+ o.onCloseAutoFocus?.(e), e.defaultPrevented || (a.current || r.triggerRef.current?.focus(), e.preventDefault()), a.current = !1, t.current = !1;
120
+ },
121
+ onInteractOutside: (e) => {
122
+ o.onInteractOutside?.(e), e.defaultPrevented || (a.current = !0, e.detail.originalEvent.type === "pointerdown" && (t.current = !0));
123
+ const n = e.target;
124
+ r.triggerRef.current?.contains(n) && e.preventDefault(), e.detail.originalEvent.type === "focusin" && t.current && e.preventDefault();
125
+ }
126
+ });
127
+ }, "PopoverContentNonModal")), S = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ l(function(o, s) {
128
+ const { __scopePopover: r, trapFocus: a, onOpenAutoFocus: t, onCloseAutoFocus: e, disableOutsidePointerEvents: n, onEscapeKeyDown: u, onPointerDownOutside: P, onFocusOutside: d, onInteractOutside: R, ...v } = o, h = f(g, r), M = C(r);
129
+ return $(), /* @__PURE__ */ i(G, {
130
+ asChild: !0,
131
+ loop: !0,
132
+ trapped: a,
133
+ onMountAutoFocus: t,
134
+ onUnmountAutoFocus: e,
135
+ children: /* @__PURE__ */ i(y, {
136
+ asChild: !0,
137
+ disableOutsidePointerEvents: n,
138
+ onInteractOutside: R,
139
+ onEscapeKeyDown: u,
140
+ onPointerDownOutside: P,
141
+ onFocusOutside: d,
142
+ onDismiss: () => h.onOpenChange(!1),
143
+ deferPointerDownOutside: !0,
144
+ children: /* @__PURE__ */ i(U, {
145
+ "data-state": A(h.open),
146
+ role: "dialog",
147
+ id: h.contentId,
148
+ ...M,
149
+ ...v,
150
+ ref: s,
151
+ style: {
152
+ ...v.style,
153
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
154
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
155
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
156
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
157
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
158
+ }
159
+ })
160
+ })
161
+ });
162
+ }, "PopoverContentImpl"));
163
+ function A(p) {
164
+ return p ? "open" : "closed";
165
+ }
166
+ l(A, "getState");
167
+ var go = q, mo = B, Co = Q, Ro = Y, Oo = oo;
168
+ export {
169
+ Co as a,
170
+ go as i,
171
+ Oo as n,
172
+ Ro as r,
173
+ mo as t
174
+ };
@@ -1,14 +1,14 @@
1
- import { useEffect as o } from "react";
2
- var a = (t, r) => {
3
- o(() => {
4
- const e = new AbortController();
5
- return document.addEventListener("mousedown", (n) => {
6
- t.current?.contains(n.target) || r();
1
+ import { useEffect as s } from "react";
2
+ var i = (r, t) => {
3
+ s(() => {
4
+ const e = new AbortController(), n = Array.isArray(r) ? r : [r];
5
+ return document.addEventListener("mousedown", (o) => {
6
+ n.some((a) => a?.current?.contains(o.target)) || t();
7
7
  }, { signal: e.signal }), () => {
8
8
  e.abort();
9
9
  };
10
- }, [t, r]);
10
+ }, [r, t]);
11
11
  };
12
12
  export {
13
- a as useClickOutside
13
+ i as useClickOutside
14
14
  };
@@ -1,5 +1,5 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import { ReactNode } from 'react';
2
+ import { InputHTMLAttributes, ReactNode } from 'react';
3
3
  import { Theme } from '../../domain/theme';
4
4
  import { CalendarPanelClassNames, DayPickerClassNames } from './components/CalendarPanel/CalendarPanel.types';
5
5
  import { DateTimeInputsClassNames } from './components/DateTimeInputs/DateTimeInputs.types';
@@ -20,6 +20,12 @@ export type { CalendarPanelClassNames, DateTimeInputsClassNames, DayPickerClassN
20
20
  * ```
21
21
  */
22
22
  export type Props = VariantProps<typeof dateRangePickerVariants> & {
23
+ /**
24
+ * Browser autofill for the From/To date fields (default: 'off'). The default
25
+ * keeps the browser's saved-value dropdown from covering the calendar; set it
26
+ * when the picker sits in a form where autofill is wanted.
27
+ */
28
+ autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
23
29
  /** Initial date range */
24
30
  defaultRange?: DateRange;
25
31
  /** Initial time range */
@@ -1,3 +1,4 @@
1
+ import { InputHTMLAttributes } from 'react';
1
2
  export type DateTimeInputsClassNames = {
2
3
  /** Root container */
3
4
  root?: string;
@@ -13,6 +14,8 @@ export type DateTimeInputsClassNames = {
13
14
  input?: string;
14
15
  };
15
16
  export type DateTimeInputsProps = {
17
+ /** Browser autofill for both date fields (default: 'off') */
18
+ autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
16
19
  className?: string;
17
20
  /** Label for start date input (default: 'Start date') */
18
21
  labelStartDate?: string;
@@ -1,5 +1,7 @@
1
- import { ChangeEvent, FocusEvent } from 'react';
1
+ import { ChangeEvent, FocusEvent, InputHTMLAttributes } from 'react';
2
2
  export type Props = {
3
+ /** Browser autofill for the end date field (default: 'off') */
4
+ autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
3
5
  dateValue: string;
4
6
  timeValue?: Date;
5
7
  error?: string;
@@ -1,5 +1,7 @@
1
- import { ChangeEvent, FocusEvent } from 'react';
1
+ import { ChangeEvent, FocusEvent, InputHTMLAttributes } from 'react';
2
2
  export type Props = {
3
+ /** Browser autofill for the start date field (default: 'off') */
4
+ autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete'];
3
5
  dateValue: string;
4
6
  timeValue?: Date;
5
7
  error?: string;
@@ -101,6 +101,7 @@ export type Props = VariantProps<typeof selectVariants> & Omit<InputHTMLAttribut
101
101
  iconClassName?: string;
102
102
  inputClassName?: string;
103
103
  isLoading?: boolean;
104
+ isPortal?: boolean;
104
105
  isRequired?: boolean;
105
106
  label?: string;
106
107
  labelAction?: ReactNode;
@@ -115,6 +116,7 @@ export type Props = VariantProps<typeof selectVariants> & Omit<InputHTMLAttribut
115
116
  loadingText?: string;
116
117
  visibleItems?: number;
117
118
  options: Option[] | OptionGroup[];
119
+ portalClassName?: string;
118
120
  searchable?: boolean;
119
121
  showSearchIcon?: boolean;
120
122
  theme?: Theme;
@@ -123,6 +125,7 @@ export type Props = VariantProps<typeof selectVariants> & Omit<InputHTMLAttribut
123
125
  onBlur?: VoidFunction;
124
126
  onChange?: OnChangeFn;
125
127
  onSearchChange?: (searchTerm: string) => void;
128
+ onValueChange?: (value: string) => void;
126
129
  } & ({
127
130
  isInfiniteScrollEnabled: true;
128
131
  onFetchMoreOptions: (params: {