@companix/uikit 0.0.54 → 0.0.55

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 (55) hide show
  1. package/dist/Skeleton/Skeleton.scss +29 -0
  2. package/dist/Skeleton/index.d.ts +3 -0
  3. package/dist/__hooks/use-boolean-state.d.ts +5 -0
  4. package/dist/bundle.es.js +27 -23
  5. package/dist/bundle.es12.js +5 -5
  6. package/dist/bundle.es13.js +2 -2
  7. package/dist/bundle.es15.js +1 -1
  8. package/dist/bundle.es2.js +1 -1
  9. package/dist/bundle.es21.js +1 -1
  10. package/dist/bundle.es22.js +1 -1
  11. package/dist/bundle.es23.js +1 -1
  12. package/dist/bundle.es24.js +1 -1
  13. package/dist/bundle.es26.js +1 -1
  14. package/dist/bundle.es27.js +3 -3
  15. package/dist/bundle.es28.js +4 -4
  16. package/dist/bundle.es29.js +2 -2
  17. package/dist/bundle.es32.js +2 -2
  18. package/dist/bundle.es35.js +3 -35
  19. package/dist/bundle.es36.js +33 -20
  20. package/dist/bundle.es37.js +21 -10
  21. package/dist/bundle.es38.js +10 -26
  22. package/dist/bundle.es39.js +11 -38
  23. package/dist/bundle.es40.js +24 -48
  24. package/dist/bundle.es41.js +36 -40
  25. package/dist/bundle.es42.js +50 -8
  26. package/dist/bundle.es43.js +42 -24
  27. package/dist/bundle.es44.js +9 -23
  28. package/dist/bundle.es45.js +24 -23
  29. package/dist/bundle.es46.js +22 -86
  30. package/dist/bundle.es47.js +23 -17
  31. package/dist/bundle.es48.js +85 -42
  32. package/dist/bundle.es49.js +18 -4
  33. package/dist/bundle.es50.js +42 -22
  34. package/dist/bundle.es51.js +4 -39
  35. package/dist/bundle.es52.js +24 -5
  36. package/dist/bundle.es53.js +39 -14
  37. package/dist/bundle.es54.js +5 -14
  38. package/dist/bundle.es55.js +13 -69
  39. package/dist/bundle.es56.js +13 -67
  40. package/dist/bundle.es57.js +69 -69
  41. package/dist/bundle.es58.js +67 -10
  42. package/dist/bundle.es59.js +69 -42
  43. package/dist/bundle.es60.js +10 -14
  44. package/dist/bundle.es61.js +43 -32
  45. package/dist/bundle.es62.js +15 -70
  46. package/dist/bundle.es63.js +32 -14
  47. package/dist/bundle.es64.js +70 -75
  48. package/dist/bundle.es65.js +13 -48
  49. package/dist/bundle.es66.js +74 -13
  50. package/dist/bundle.es67.js +51 -0
  51. package/dist/bundle.es68.js +16 -0
  52. package/dist/bundle.es9.js +1 -1
  53. package/dist/index.d.ts +3 -0
  54. package/dist/index.scss +1 -0
  55. package/package.json +1 -1
@@ -1,45 +1,41 @@
1
- import { jsx as r, Fragment as m } from "react/jsx-runtime";
2
- import { useContext as C, createContext as g, useState as h, useEffect as x, useCallback as u } from "react";
3
- import { Dialog as D } from "./bundle.es21.js";
4
- import { hash as v } from "@companix/utils-js";
5
- const $ = (t) => {
6
- const e = {}, n = {}, l = [], c = v();
7
- for (const o in t)
8
- e[o] = () => {
9
- }, n[o] = () => {
10
- }, l.push(() => /* @__PURE__ */ r(O, { Open: e, Close: n, name: o, Content: t[o] }));
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { hash as r } from "@companix/utils-js";
3
+ import { Viewport as a } from "./bundle.es64.js";
4
+ import { useRef as c, useMemo as h } from "react";
5
+ const m = (i = {}) => {
6
+ const o = {
7
+ showToast: (e) => {
8
+ console.error("uninitialized", e);
9
+ }
10
+ };
11
11
  return {
12
- Open: e,
13
- Close: n,
14
- Overlay: () => /* @__PURE__ */ r(m, { children: l.map((o, s) => /* @__PURE__ */ r(o, {}, `popup-${c}-${s}`)) })
12
+ api: {
13
+ show: (e) => {
14
+ const n = e.id ?? r();
15
+ return o.showToast({ ...e, id: n }), n;
16
+ }
17
+ },
18
+ Viewport: (e = {}) => {
19
+ const n = c(null);
20
+ return h(() => {
21
+ o.showToast = (s) => {
22
+ n.current && n.current.showToast(s);
23
+ };
24
+ }, []), /* @__PURE__ */ t(
25
+ a,
26
+ {
27
+ ref: n,
28
+ align: e.align ?? i.align,
29
+ closeIcon: e.closeIcon ?? i.closeIcon,
30
+ duration: e.duration ?? i.duration,
31
+ gap: e.gap ?? i.gap,
32
+ side: e.side ?? i.side,
33
+ swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
34
+ }
35
+ );
36
+ }
15
37
  };
16
- }, O = ({ name: t, Open: e, Close: n, Content: l }) => {
17
- const [{ data: c, open: o }, s] = h({ data: null, open: !1 });
18
- x(() => {
19
- e[t] = (a) => {
20
- s({ data: a, open: !0 });
21
- }, n[t] = () => {
22
- o && p();
23
- };
24
- }, []);
25
- const p = u(() => {
26
- s(({ data: a }) => ({ data: a, open: !1 }));
27
- }, []), f = u(() => {
28
- s({ data: null, open: !1 });
29
- }, []), d = u((a) => {
30
- a || p();
31
- }, []);
32
- return c ? /* @__PURE__ */ r(i.Provider, { value: { open: o, onOpenChange: d, onClosed: f }, children: /* @__PURE__ */ r(l, { data: c, close: p }) }) : null;
33
- }, i = g(null), S = () => {
34
- const t = C(i);
35
- if (!t)
36
- throw new Error("Dialog context not provided");
37
- return t;
38
- }, b = ({ children: t, ...e }) => {
39
- const n = S();
40
- return /* @__PURE__ */ r(D, { ...n, ...e, children: t });
41
38
  };
42
39
  export {
43
- b as DialogShell,
44
- $ as createDialogsRegistry
40
+ m as createToaster
45
41
  };
@@ -1,11 +1,53 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { Popover as m } from "./bundle.es10.js";
3
- const i = (o) => {
4
- const r = {};
5
- for (const t in o)
6
- r[t] = ({ data: e, ...n }) => /* @__PURE__ */ c(m, { content: ({ close: s }) => o[t]({ data: e, close: s }), ...n });
7
- return r;
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-toast";
3
+ import { attr as T } from "@companix/utils-browser";
4
+ import { useState as d, useRef as b, useEffect as j, useLayoutEffect as E } from "react";
5
+ import { RemoveListener as I } from "./bundle.es54.js";
6
+ const m = (o) => {
7
+ const [r, u] = d(!0), [p, f] = d(!1), s = b(null), {
8
+ appearance: C = "neutral",
9
+ icon: a,
10
+ title: n,
11
+ description: c,
12
+ duration: L,
13
+ closeIcon: h,
14
+ onClosing: v,
15
+ onClosed: N,
16
+ closable: x = !0,
17
+ onInitialized: g
18
+ } = o;
19
+ j(() => {
20
+ f(!0);
21
+ }, []), E(() => {
22
+ s.current && g(s.current);
23
+ }, []);
24
+ const R = (i) => {
25
+ i || v(), u(i);
26
+ };
27
+ return /* @__PURE__ */ l(
28
+ t.Root,
29
+ {
30
+ ref: s,
31
+ "data-expanded": !0,
32
+ "data-appearance": C,
33
+ "data-mounted": T(p),
34
+ className: "toaster",
35
+ open: r,
36
+ onOpenChange: R,
37
+ duration: L,
38
+ children: [
39
+ /* @__PURE__ */ e(I, { callback: N }),
40
+ a && /* @__PURE__ */ e("div", { className: "toaster-icon", children: a }),
41
+ /* @__PURE__ */ l("div", { className: "toaster-content", children: [
42
+ n && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: n }),
43
+ c && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: c })
44
+ ] }),
45
+ x && /* @__PURE__ */ e(m.Close, { className: "toaster-close toaster-close-placement", closeIcon: h })
46
+ ]
47
+ }
48
+ );
8
49
  };
50
+ m.Close = ({ closeIcon: o, className: r } = {}) => /* @__PURE__ */ e(t.Close, { className: r, children: o ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) });
9
51
  export {
10
- i as createPopoversRegistry
52
+ m as Toast
11
53
  };
@@ -1,27 +1,45 @@
1
- const _ = (e) => {
2
- if (e <= 16)
3
- return 5;
4
- if (e <= 24)
5
- return 8;
6
- if (e <= 32)
7
- return 10;
8
- if (e <= 36)
9
- return 13;
10
- if (e <= 44)
11
- return 14;
12
- if (e <= 48)
13
- return 17;
14
- if (e < 56)
15
- return 18;
16
- if (e <= 64)
17
- return 21;
18
- if (e <= 88)
19
- return 26;
20
- if (e <= 96)
21
- return 30;
22
- const n = Math.ceil(e * 0.3125), E = n % 2;
23
- return n + E;
1
+ import { jsx as r, Fragment as m } from "react/jsx-runtime";
2
+ import { useContext as C, createContext as g, useState as h, useEffect as x, useCallback as u } from "react";
3
+ import { Dialog as D } from "./bundle.es21.js";
4
+ import { hash as v } from "@companix/utils-js";
5
+ const $ = (t) => {
6
+ const e = {}, n = {}, l = [], c = v();
7
+ for (const o in t)
8
+ e[o] = () => {
9
+ }, n[o] = () => {
10
+ }, l.push(() => /* @__PURE__ */ r(O, { Open: e, Close: n, name: o, Content: t[o] }));
11
+ return {
12
+ Open: e,
13
+ Close: n,
14
+ Overlay: () => /* @__PURE__ */ r(m, { children: l.map((o, s) => /* @__PURE__ */ r(o, {}, `popup-${c}-${s}`)) })
15
+ };
16
+ }, O = ({ name: t, Open: e, Close: n, Content: l }) => {
17
+ const [{ data: c, open: o }, s] = h({ data: null, open: !1 });
18
+ x(() => {
19
+ e[t] = (a) => {
20
+ s({ data: a, open: !0 });
21
+ }, n[t] = () => {
22
+ o && p();
23
+ };
24
+ }, []);
25
+ const p = u(() => {
26
+ s(({ data: a }) => ({ data: a, open: !1 }));
27
+ }, []), f = u(() => {
28
+ s({ data: null, open: !1 });
29
+ }, []), d = u((a) => {
30
+ a || p();
31
+ }, []);
32
+ return c ? /* @__PURE__ */ r(i.Provider, { value: { open: o, onOpenChange: d, onClosed: f }, children: /* @__PURE__ */ r(l, { data: c, close: p }) }) : null;
33
+ }, i = g(null), S = () => {
34
+ const t = C(i);
35
+ if (!t)
36
+ throw new Error("Dialog context not provided");
37
+ return t;
38
+ }, b = ({ children: t, ...e }) => {
39
+ const n = S();
40
+ return /* @__PURE__ */ r(D, { ...n, ...e, children: t });
24
41
  };
25
42
  export {
26
- _ as getInitialsFontSize
43
+ b as DialogShell,
44
+ $ as createDialogsRegistry
27
45
  };
@@ -1,25 +1,11 @@
1
- import { useState as u, useEffect as d } from "react";
2
- const v = ({ baseId: r, value: e, containerRef: o }) => {
3
- const [l, n] = u({});
4
- return d(() => {
5
- const t = { observer: null };
6
- if (o.current) {
7
- const c = `#${h(r, e)}`, s = o.current.querySelector(c);
8
- s != null ? (t.observer = new ResizeObserver(() => {
9
- const { clientHeight: i, clientWidth: a, offsetLeft: f, offsetTop: b } = s;
10
- n({
11
- width: a,
12
- height: i,
13
- transform: `translateX(${Math.floor(f)}px) translateY(${Math.floor(b)}px)`
14
- });
15
- }), t.observer.observe(s)) : n({ display: "none" });
16
- }
17
- return () => {
18
- t.observer && t.observer.disconnect();
19
- };
20
- }, [e]), l;
21
- }, h = (r, e) => `uikit-tab-${r}-trigger-${e}`;
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { Popover as m } from "./bundle.es10.js";
3
+ const i = (o) => {
4
+ const r = {};
5
+ for (const t in o)
6
+ r[t] = ({ data: e, ...n }) => /* @__PURE__ */ c(m, { content: ({ close: s }) => o[t]({ data: e, close: s }), ...n });
7
+ return r;
8
+ };
22
9
  export {
23
- h as makeTabId,
24
- v as useTabSlider
10
+ i as createPopoversRegistry
25
11
  };
@@ -1,26 +1,27 @@
1
- import { useRef as s, useCallback as c } from "react";
2
- const p = () => {
3
- const t = s(null), r = s({ cb: null }), i = c(() => {
4
- if (t.current && t.current.parentElement) {
5
- const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
6
- e.style.transform !== n && e.style.setProperty("transform", n);
7
- });
8
- o.observe(e, {
9
- attributes: !0,
10
- attributeFilter: ["style"]
11
- }), r.current.cb = () => {
12
- o.disconnect();
13
- }, t.current.style.setProperty("--radix-popover-trigger-width", u);
14
- }
15
- }, []), l = c(() => {
16
- r.current.cb && (r.current.cb(), r.current.cb = null);
17
- }, []);
18
- return {
19
- popoverRef: t,
20
- handleAnimationEnd: l,
21
- froozePopoverPosition: i
22
- };
1
+ const _ = (e) => {
2
+ if (e <= 16)
3
+ return 5;
4
+ if (e <= 24)
5
+ return 8;
6
+ if (e <= 32)
7
+ return 10;
8
+ if (e <= 36)
9
+ return 13;
10
+ if (e <= 44)
11
+ return 14;
12
+ if (e <= 48)
13
+ return 17;
14
+ if (e < 56)
15
+ return 18;
16
+ if (e <= 64)
17
+ return 21;
18
+ if (e <= 88)
19
+ return 26;
20
+ if (e <= 96)
21
+ return 30;
22
+ const n = Math.ceil(e * 0.3125), E = n % 2;
23
+ return n + E;
23
24
  };
24
25
  export {
25
- p as useFroozeClosing
26
+ _ as getInitialsFontSize
26
27
  };
@@ -1,89 +1,25 @@
1
- import { jsxs as o, jsx as c } from "react/jsx-runtime";
2
- import A from "classnames";
3
- import { attr as l } from "@companix/utils-browser";
4
- import { forwardRef as y, useRef as S, useCallback as T } from "react";
5
- import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
6
- import { mergeRefs as w } from "react-merge-refs";
7
- import { SelectRightElements as z } from "./bundle.es58.js";
8
- const V = y(
9
- ({
10
- required: a,
11
- size: u,
12
- fill: d,
13
- leftElement: s,
14
- className: m,
15
- value: n,
16
- clearButton: f,
17
- placeholder: p,
18
- clearButtonIcon: h,
19
- disabled: r,
20
- onClear: C,
21
- inputRef: I,
22
- ...i
23
- }, k) => {
24
- const e = S(null), N = T(
25
- (t) => {
26
- if (!e.current || !document)
27
- return;
28
- t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
29
- },
30
- [e]
31
- ), v = (t) => {
32
- document && document.activeElement === e.current && t.preventDefault();
33
- }, F = (t) => {
34
- r || N(t);
35
- }, g = (t) => {
36
- v(t);
37
- }, R = (t) => {
38
- e.current && e.current.focus(), C?.(t);
1
+ import { useState as u, useEffect as d } from "react";
2
+ const v = ({ baseId: r, value: e, containerRef: o }) => {
3
+ const [l, n] = u({});
4
+ return d(() => {
5
+ const t = { observer: null };
6
+ if (o.current) {
7
+ const c = `#${h(r, e)}`, s = o.current.querySelector(c);
8
+ s != null ? (t.observer = new ResizeObserver(() => {
9
+ const { clientHeight: i, clientWidth: a, offsetLeft: f, offsetTop: b } = s;
10
+ n({
11
+ width: a,
12
+ height: i,
13
+ transform: `translateX(${Math.floor(f)}px) translateY(${Math.floor(b)}px)`
14
+ });
15
+ }), t.observer.observe(s)) : n({ display: "none" });
16
+ }
17
+ return () => {
18
+ t.observer && t.observer.disconnect();
39
19
  };
40
- return /* @__PURE__ */ o(
41
- "div",
42
- {
43
- ref: k,
44
- className: A("form select", m),
45
- "data-size": u ?? "md",
46
- "data-fill": l(d),
47
- "data-required": l(a),
48
- "data-disabled": l(r),
49
- onMouseDown: g,
50
- ...i,
51
- onClick: F,
52
- children: [
53
- /* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
54
- s && /* @__PURE__ */ c("div", { className: "select-element", children: s }),
55
- /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ o("div", { className: "select-content-text", "aria-disabled": r, children: [
56
- !n && /* @__PURE__ */ c("span", { className: "select-placeholder", children: p }),
57
- n
58
- ] }) }),
59
- /* @__PURE__ */ c("div", { className: "select-element", children: /* @__PURE__ */ c(
60
- z,
61
- {
62
- clearButton: f,
63
- value: !!n,
64
- clearButtonIcon: h,
65
- onClear: R
66
- }
67
- ) })
68
- ] }),
69
- /* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
70
- "input",
71
- {
72
- ref: w([I, e]),
73
- autoComplete: "off",
74
- autoCapitalize: "none",
75
- autoCorrect: "off",
76
- spellCheck: "false",
77
- "aria-autocomplete": "none",
78
- onClick: i.onClick,
79
- readOnly: !0
80
- }
81
- ) })
82
- ]
83
- }
84
- );
85
- }
86
- );
20
+ }, [e]), l;
21
+ }, h = (r, e) => `uikit-tab-${r}-trigger-${e}`;
87
22
  export {
88
- V as SelectInput
23
+ h as makeTabId,
24
+ v as useTabSlider
89
25
  };
@@ -1,20 +1,26 @@
1
- import { useRef as u, useCallback as T } from "react";
2
- const g = () => {
3
- const l = u(null), t = u(null);
4
- return { scrollToElement: T(
5
- (r, f) => {
6
- const o = l.current, s = t.current;
7
- if (!o || !s || r < 0 || r > s.children.length)
8
- return;
9
- const c = s.children[r];
10
- if (!c)
11
- return;
12
- const n = o.offsetHeight, i = o.scrollTop, e = c.offsetTop, p = c.offsetHeight;
13
- f === "center" ? o.scrollTop = e - n / 2 + p / 2 : f === "top" ? o.scrollTop = e : e + p > n + i ? o.scrollTop = e - n + p : e < i && (o.scrollTop = e);
14
- },
15
- [t, l]
16
- ), scrollBoxRef: l, optionsWrapperRef: t };
1
+ import { useRef as s, useCallback as c } from "react";
2
+ const p = () => {
3
+ const t = s(null), r = s({ cb: null }), i = c(() => {
4
+ if (t.current && t.current.parentElement) {
5
+ const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
6
+ e.style.transform !== n && e.style.setProperty("transform", n);
7
+ });
8
+ o.observe(e, {
9
+ attributes: !0,
10
+ attributeFilter: ["style"]
11
+ }), r.current.cb = () => {
12
+ o.disconnect();
13
+ }, t.current.style.setProperty("--radix-popover-trigger-width", u);
14
+ }
15
+ }, []), l = c(() => {
16
+ r.current.cb && (r.current.cb(), r.current.cb = null);
17
+ }, []);
18
+ return {
19
+ popoverRef: t,
20
+ handleAnimationEnd: l,
21
+ froozePopoverPosition: i
22
+ };
17
23
  };
18
24
  export {
19
- g as useScrollListController
25
+ p as useFroozeClosing
20
26
  };
@@ -1,46 +1,89 @@
1
- import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
- import { useEffect as O } from "react";
3
- import { OptionItem as n } from "./bundle.es14.js";
4
- import { OptionsList as u } from "./bundle.es16.js";
5
- import { Icon as v } from "./bundle.es33.js";
6
- import { faPlus as h } from "@companix/icons-solid";
7
- const L = (s) => {
8
- const {
9
- isActive: m,
10
- onOpened: c,
11
- addOption: t,
12
- scrollboxRef: l,
13
- optionsWrapperRef: p,
14
- options: i,
15
- onSelect: r,
16
- minimalOptions: a,
17
- emptyText: f = "Ничего не найдено"
18
- } = s;
19
- return O(() => {
20
- c?.();
21
- }, []), /* @__PURE__ */ x(u, { scrollboxRef: l, optionsWrapperRef: p, maxHeight: 300, children: [
22
- t && /* @__PURE__ */ e(
23
- n,
1
+ import { jsxs as o, jsx as c } from "react/jsx-runtime";
2
+ import A from "classnames";
3
+ import { attr as l } from "@companix/utils-browser";
4
+ import { forwardRef as y, useRef as S, useCallback as T } from "react";
5
+ import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
6
+ import { mergeRefs as w } from "react-merge-refs";
7
+ import { SelectRightElements as z } from "./bundle.es60.js";
8
+ const V = y(
9
+ ({
10
+ required: a,
11
+ size: u,
12
+ fill: d,
13
+ leftElement: s,
14
+ className: m,
15
+ value: n,
16
+ clearButton: f,
17
+ placeholder: p,
18
+ clearButtonIcon: h,
19
+ disabled: r,
20
+ onClear: C,
21
+ inputRef: I,
22
+ ...i
23
+ }, k) => {
24
+ const e = S(null), N = T(
25
+ (t) => {
26
+ if (!e.current || !document)
27
+ return;
28
+ t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
29
+ },
30
+ [e]
31
+ ), v = (t) => {
32
+ document && document.activeElement === e.current && t.preventDefault();
33
+ }, F = (t) => {
34
+ r || N(t);
35
+ }, g = (t) => {
36
+ v(t);
37
+ }, R = (t) => {
38
+ e.current && e.current.focus(), C?.(t);
39
+ };
40
+ return /* @__PURE__ */ o(
41
+ "div",
24
42
  {
25
- className: "select-add-option",
26
- icon: /* @__PURE__ */ e(v, { icon: h }),
27
- title: t.text,
28
- onClick: t.onClick
43
+ ref: k,
44
+ className: A("form select", m),
45
+ "data-size": u ?? "md",
46
+ "data-fill": l(d),
47
+ "data-required": l(a),
48
+ "data-disabled": l(r),
49
+ onMouseDown: g,
50
+ ...i,
51
+ onClick: F,
52
+ children: [
53
+ /* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
54
+ s && /* @__PURE__ */ c("div", { className: "select-element", children: s }),
55
+ /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ o("div", { className: "select-content-text", "aria-disabled": r, children: [
56
+ !n && /* @__PURE__ */ c("span", { className: "select-placeholder", children: p }),
57
+ n
58
+ ] }) }),
59
+ /* @__PURE__ */ c("div", { className: "select-element", children: /* @__PURE__ */ c(
60
+ z,
61
+ {
62
+ clearButton: f,
63
+ value: !!n,
64
+ clearButtonIcon: h,
65
+ onClear: R
66
+ }
67
+ ) })
68
+ ] }),
69
+ /* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
70
+ "input",
71
+ {
72
+ ref: w([I, e]),
73
+ autoComplete: "off",
74
+ autoCapitalize: "none",
75
+ autoCorrect: "off",
76
+ spellCheck: "false",
77
+ "aria-autocomplete": "none",
78
+ onClick: i.onClick,
79
+ readOnly: !0
80
+ }
81
+ ) })
82
+ ]
29
83
  }
30
- ),
31
- i.length === 0 && !t && /* @__PURE__ */ e("div", { className: "select-tags-empty", children: f }),
32
- i.map((o, d) => /* @__PURE__ */ e(
33
- n,
34
- {
35
- active: m(o.value),
36
- onClick: () => r?.(o.value),
37
- minimal: a,
38
- ...o
39
- },
40
- `select-option-${d}`
41
- ))
42
- ] });
43
- };
84
+ );
85
+ }
86
+ );
44
87
  export {
45
- L as SelectOptionsList
88
+ V as SelectInput
46
89
  };
@@ -1,6 +1,20 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Spinner as r } from "./bundle.es6.js";
3
- const t = () => /* @__PURE__ */ e("div", { className: "select-popover-loading", children: /* @__PURE__ */ e(r, { size: 24 }) });
1
+ import { useRef as u, useCallback as T } from "react";
2
+ const g = () => {
3
+ const l = u(null), t = u(null);
4
+ return { scrollToElement: T(
5
+ (r, f) => {
6
+ const o = l.current, s = t.current;
7
+ if (!o || !s || r < 0 || r > s.children.length)
8
+ return;
9
+ const c = s.children[r];
10
+ if (!c)
11
+ return;
12
+ const n = o.offsetHeight, i = o.scrollTop, e = c.offsetTop, p = c.offsetHeight;
13
+ f === "center" ? o.scrollTop = e - n / 2 + p / 2 : f === "top" ? o.scrollTop = e : e + p > n + i ? o.scrollTop = e - n + p : e < i && (o.scrollTop = e);
14
+ },
15
+ [t, l]
16
+ ), scrollBoxRef: l, optionsWrapperRef: t };
17
+ };
4
18
  export {
5
- t as SelectLoader
19
+ g as useScrollListController
6
20
  };