@companix/uikit 0.1.25 → 0.1.27

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 (56) hide show
  1. package/dist/__hooks/use-rerender.d.ts +1 -0
  2. package/dist/__hooks/use-sync-submit.d.ts +1 -0
  3. package/dist/bundle.es.js +45 -43
  4. package/dist/bundle.es10.js +1 -1
  5. package/dist/bundle.es13.js +4 -4
  6. package/dist/bundle.es14.js +3 -3
  7. package/dist/bundle.es15.js +2 -2
  8. package/dist/bundle.es17.js +1 -1
  9. package/dist/bundle.es23.js +5 -5
  10. package/dist/bundle.es25.js +1 -1
  11. package/dist/bundle.es26.js +1 -1
  12. package/dist/bundle.es28.js +1 -1
  13. package/dist/bundle.es29.js +12 -11
  14. package/dist/bundle.es31.js +4 -4
  15. package/dist/bundle.es32.js +2 -2
  16. package/dist/bundle.es35.js +2 -2
  17. package/dist/bundle.es41.js +1 -1
  18. package/dist/bundle.es42.js +2 -2
  19. package/dist/bundle.es45.js +1 -1
  20. package/dist/bundle.es52.js +10 -25
  21. package/dist/bundle.es53.js +17 -29
  22. package/dist/bundle.es54.js +36 -48
  23. package/dist/bundle.es55.js +49 -55
  24. package/dist/bundle.es56.js +56 -8
  25. package/dist/bundle.es57.js +8 -26
  26. package/dist/bundle.es58.js +27 -5
  27. package/dist/bundle.es59.js +5 -66
  28. package/dist/bundle.es60.js +66 -23
  29. package/dist/bundle.es61.js +22 -23
  30. package/dist/bundle.es62.js +24 -90
  31. package/dist/bundle.es63.js +90 -18
  32. package/dist/bundle.es64.js +17 -93
  33. package/dist/bundle.es65.js +93 -73
  34. package/dist/bundle.es66.js +73 -23
  35. package/dist/bundle.es67.js +20 -35
  36. package/dist/bundle.es68.js +39 -24
  37. package/dist/bundle.es69.js +24 -79
  38. package/dist/bundle.es70.js +71 -85
  39. package/dist/bundle.es71.js +93 -10
  40. package/dist/bundle.es72.js +10 -70
  41. package/dist/bundle.es73.js +5 -11
  42. package/dist/bundle.es74.js +68 -41
  43. package/dist/bundle.es75.js +10 -31
  44. package/dist/bundle.es76.js +41 -64
  45. package/dist/bundle.es77.js +33 -41
  46. package/dist/bundle.es78.js +62 -11
  47. package/dist/bundle.es79.js +40 -31
  48. package/dist/bundle.es80.js +15 -70
  49. package/dist/bundle.es81.js +32 -14
  50. package/dist/bundle.es82.js +70 -75
  51. package/dist/bundle.es83.js +13 -48
  52. package/dist/bundle.es84.js +74 -13
  53. package/dist/bundle.es85.js +51 -0
  54. package/dist/bundle.es86.js +16 -0
  55. package/dist/index.d.ts +1 -0
  56. package/package.json +1 -1
@@ -1,59 +1,53 @@
1
- import { jsx as r, Fragment as h } from "react/jsx-runtime";
2
- import { useContext as C, createContext as x, useState as w, useEffect as D, useCallback as u, memo as P } from "react";
3
- import { hash as S } from "@companix/utils-js";
4
- import { Dialog as g } from "./bundle.es24.js";
5
- import { Drawer as v } from "./bundle.es22.js";
6
- import { MobileDrawer as b } from "./bundle.es23.js";
7
- const R = (o) => {
8
- const t = {}, e = {}, l = [], c = S();
9
- for (const n in o)
10
- t[n] = () => {
11
- }, e[n] = () => {
12
- }, l.push(() => /* @__PURE__ */ r(O, { Open: t, Close: e, name: n, Content: o[n] }));
13
- return {
14
- Open: t,
15
- Close: e,
16
- Overlay: () => /* @__PURE__ */ r(h, { children: l.map((n, s) => /* @__PURE__ */ r(n, {}, `popup-${c}-${s}`)) })
17
- };
18
- }, O = ({ name: o, Open: t, Close: e, Content: l }) => {
19
- const [{ data: c, open: n }, s] = w({
20
- data: null,
21
- open: !1
22
- });
23
- D(() => {
24
- t[o] = (a) => {
25
- s({ data: a, open: !0 });
26
- }, e[o] = () => {
27
- n && p();
28
- };
29
- }, []);
30
- const p = u(() => {
31
- s(({ data: a }) => ({ data: a, open: !1 }));
32
- }, []), m = u(() => {
33
- s({ data: null, open: !1 });
34
- }, []), d = u((a) => {
35
- a || p();
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.es59.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);
36
23
  }, []);
37
- return c ? /* @__PURE__ */ r(f.Provider, { value: { open: n, onOpenChange: d, onClosed: m }, children: /* @__PURE__ */ r(y, { data: c, close: p, Content: l }) }) : null;
38
- }, y = P(({ data: o, close: t, Content: e }) => /* @__PURE__ */ r(e, { data: o, close: t })), f = x(null), i = () => {
39
- const o = C(f);
40
- if (!o)
41
- throw new Error("Popup context not provided");
42
- return o;
43
- }, W = ({ children: o, ...t }) => {
44
- const e = i();
45
- return /* @__PURE__ */ r(g, { ...e, ...t, children: o });
46
- }, q = ({ children: o, ...t }) => {
47
- const e = i();
48
- return /* @__PURE__ */ r(v, { ...e, ...t, children: o });
49
- }, z = ({ children: o, ...t }) => {
50
- const e = i();
51
- return /* @__PURE__ */ r(b, { ...e, ...t, children: o });
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
+ );
52
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" }) }) });
53
51
  export {
54
- W as DialogShell,
55
- q as DrawerShell,
56
- z as MobileDrawerShell,
57
- R as createPopupRegistry,
58
- i as usePopup
52
+ m as Toast
59
53
  };
@@ -1,11 +1,59 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { Popover as m } from "./bundle.es11.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 { jsx as r, Fragment as h } from "react/jsx-runtime";
2
+ import { useContext as C, createContext as x, useState as w, useEffect as D, useCallback as u, memo as P } from "react";
3
+ import { hash as S } from "@companix/utils-js";
4
+ import { Dialog as g } from "./bundle.es24.js";
5
+ import { Drawer as v } from "./bundle.es22.js";
6
+ import { MobileDrawer as b } from "./bundle.es23.js";
7
+ const R = (o) => {
8
+ const t = {}, e = {}, l = [], c = S();
9
+ for (const n in o)
10
+ t[n] = () => {
11
+ }, e[n] = () => {
12
+ }, l.push(() => /* @__PURE__ */ r(O, { Open: t, Close: e, name: n, Content: o[n] }));
13
+ return {
14
+ Open: t,
15
+ Close: e,
16
+ Overlay: () => /* @__PURE__ */ r(h, { children: l.map((n, s) => /* @__PURE__ */ r(n, {}, `popup-${c}-${s}`)) })
17
+ };
18
+ }, O = ({ name: o, Open: t, Close: e, Content: l }) => {
19
+ const [{ data: c, open: n }, s] = w({
20
+ data: null,
21
+ open: !1
22
+ });
23
+ D(() => {
24
+ t[o] = (a) => {
25
+ s({ data: a, open: !0 });
26
+ }, e[o] = () => {
27
+ n && p();
28
+ };
29
+ }, []);
30
+ const p = u(() => {
31
+ s(({ data: a }) => ({ data: a, open: !1 }));
32
+ }, []), m = u(() => {
33
+ s({ data: null, open: !1 });
34
+ }, []), d = u((a) => {
35
+ a || p();
36
+ }, []);
37
+ return c ? /* @__PURE__ */ r(f.Provider, { value: { open: n, onOpenChange: d, onClosed: m }, children: /* @__PURE__ */ r(y, { data: c, close: p, Content: l }) }) : null;
38
+ }, y = P(({ data: o, close: t, Content: e }) => /* @__PURE__ */ r(e, { data: o, close: t })), f = x(null), i = () => {
39
+ const o = C(f);
40
+ if (!o)
41
+ throw new Error("Popup context not provided");
42
+ return o;
43
+ }, W = ({ children: o, ...t }) => {
44
+ const e = i();
45
+ return /* @__PURE__ */ r(g, { ...e, ...t, children: o });
46
+ }, q = ({ children: o, ...t }) => {
47
+ const e = i();
48
+ return /* @__PURE__ */ r(v, { ...e, ...t, children: o });
49
+ }, z = ({ children: o, ...t }) => {
50
+ const e = i();
51
+ return /* @__PURE__ */ r(b, { ...e, ...t, children: o });
8
52
  };
9
53
  export {
10
- i as createPopoversRegistry
54
+ W as DialogShell,
55
+ q as DrawerShell,
56
+ z as MobileDrawerShell,
57
+ R as createPopupRegistry,
58
+ i as usePopup
11
59
  };
@@ -1,29 +1,11 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { createContext as a, useContext as l, useState as i, useMemo as p } from "react";
3
- const V = (o) => {
4
- const e = a({
5
- value: o,
6
- setValue: () => {
7
- }
8
- }), r = { setValue: () => {
9
- } };
10
- return [({ initialValue: t, children: s }) => {
11
- const [v, n] = i(t ?? o);
12
- return p(() => {
13
- r.setValue = n;
14
- }, []), /* @__PURE__ */ u(e.Provider, { value: { value: v, setValue: n }, children: s });
15
- }, () => {
16
- const { value: t, setValue: s } = l(e);
17
- return [t, s];
18
- }, (t) => r.setValue(t)];
19
- }, P = (o) => {
20
- const e = a(o);
21
- return [
22
- ({ value: r, children: c }) => /* @__PURE__ */ u(e.Provider, { value: r, children: c }),
23
- () => l(e)
24
- ];
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { Popover as m } from "./bundle.es11.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;
25
8
  };
26
9
  export {
27
- V as createScope,
28
- P as createStaticScope
10
+ i as createPopoversRegistry
29
11
  };
@@ -1,7 +1,29 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { createContext as a, useContext as l, useState as i, useMemo as p } from "react";
3
+ const V = (o) => {
4
+ const e = a({
5
+ value: o,
6
+ setValue: () => {
7
+ }
8
+ }), r = { setValue: () => {
9
+ } };
10
+ return [({ initialValue: t, children: s }) => {
11
+ const [v, n] = i(t ?? o);
12
+ return p(() => {
13
+ r.setValue = n;
14
+ }, []), /* @__PURE__ */ u(e.Provider, { value: { value: v, setValue: n }, children: s });
15
+ }, () => {
16
+ const { value: t, setValue: s } = l(e);
17
+ return [t, s];
18
+ }, (t) => r.setValue(t)];
19
+ }, P = (o) => {
20
+ const e = a(o);
21
+ return [
22
+ ({ value: r, children: c }) => /* @__PURE__ */ u(e.Provider, { value: r, children: c }),
23
+ () => l(e)
24
+ ];
25
+ };
5
26
  export {
6
- n as RemoveListener
27
+ V as createScope,
28
+ P as createStaticScope
7
29
  };
@@ -1,68 +1,7 @@
1
- import { useMemo as i, useCallback as f } from "react";
2
- const D = (e, t) => e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear(), l = 1, y = (e, { weekStartsOn: t = l }) => {
3
- const n = new Date(e), s = n.getDay(), r = (s < t ? 7 : 0) + s - t;
4
- return n.setDate(n.getDate() - r), n.setHours(0, 0, 0, 0), n;
5
- }, F = (e, { weekStartsOn: t = l }) => {
6
- const n = new Date(e), s = n.getDay(), r = (s < t ? -7 : 0) + 6 - (s - t);
7
- return n.setDate(n.getDate() + r), n.setHours(23, 59, 59, 999), n;
8
- }, h = (e) => {
9
- const t = new Date(e);
10
- return t.setHours(0, 0, 0, 0), t;
11
- }, M = (e) => {
12
- const t = new Date(e);
13
- return t.setHours(23, 59, 59, 999), t;
14
- };
15
- function g(e, t = {}) {
16
- const { min: n, max: s, withTime: r = !1 } = t;
17
- return !r && (n && D(e, n) || s && D(e, s)) ? !1 : !!(n && e < n || s && e > s);
18
- }
19
- const m = (e, t) => {
20
- const n = new Date(e);
21
- if (!t)
22
- return n;
23
- const s = n.getDate(), r = new Date(e);
24
- r.setMonth(n.getMonth() + t + 1, 0);
25
- const a = r.getDate();
26
- return s >= a ? r : (n.setFullYear(r.getFullYear(), r.getMonth(), s), n);
27
- }, Y = (e, t) => m(e, -t), w = (e) => {
28
- const t = new Date(e), n = new Date(t);
29
- return n.setFullYear(t.getFullYear(), t.getMonth() + 1, 0), n.setHours(0, 0, 0, 0), n.getDate();
30
- }, x = (e, t) => {
31
- const n = new Date(e);
32
- return n.setFullYear(t), n;
33
- }, H = (e, t) => {
34
- const n = new Date(e), s = n.getFullYear(), r = n.getDate(), a = new Date(e);
35
- a.setFullYear(s, t, 15), a.setHours(0, 0, 0, 0);
36
- const o = w(a);
37
- return n.setMonth(t, Math.min(r, o)), n;
38
- }, b = (e) => {
39
- const { disableFuture: t, disablePast: n, maxDateTime: s, minDateTime: r, shouldDisableDate: a } = e;
40
- return (o, c) => {
41
- const u = /* @__PURE__ */ new Date();
42
- return a ? a(o) : t ? h(o) > u : n ? M(o) < u : r || s ? g(o, { min: r, max: s, withTime: c }) : !1;
43
- };
44
- }, O = (e) => {
45
- const t = i(() => b(e), [
46
- e.disableFuture,
47
- e.disablePast,
48
- e.shouldDisableDate,
49
- e.minDateTime,
50
- e.maxDateTime
51
- ]);
52
- return f(t, [t]);
53
- };
1
+ import { useEffect as r } from "react";
2
+ const n = ({ callback: e }) => (r(() => () => {
3
+ e?.();
4
+ }, []), null);
54
5
  export {
55
- l as MONDAY,
56
- m as addMonths,
57
- b as createDayDisableChecker,
58
- M as endOfDay,
59
- F as endOfWeek,
60
- g as isDayMinMaxRestricted,
61
- D as isSameDate,
62
- H as setMonth,
63
- x as setYear,
64
- h as startOfDay,
65
- y as startOfWeek,
66
- Y as subMonths,
67
- O as useDayDisableCheker
6
+ n as RemoveListener
68
7
  };
@@ -1,25 +1,68 @@
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 { useMemo as i, useCallback as f } from "react";
2
+ const D = (e, t) => e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear(), l = 1, y = (e, { weekStartsOn: t = l }) => {
3
+ const n = new Date(e), s = n.getDay(), r = (s < t ? 7 : 0) + s - t;
4
+ return n.setDate(n.getDate() - r), n.setHours(0, 0, 0, 0), n;
5
+ }, F = (e, { weekStartsOn: t = l }) => {
6
+ const n = new Date(e), s = n.getDay(), r = (s < t ? -7 : 0) + 6 - (s - t);
7
+ return n.setDate(n.getDate() + r), n.setHours(23, 59, 59, 999), n;
8
+ }, h = (e) => {
9
+ const t = new Date(e);
10
+ return t.setHours(0, 0, 0, 0), t;
11
+ }, M = (e) => {
12
+ const t = new Date(e);
13
+ return t.setHours(23, 59, 59, 999), t;
14
+ };
15
+ function g(e, t = {}) {
16
+ const { min: n, max: s, withTime: r = !1 } = t;
17
+ return !r && (n && D(e, n) || s && D(e, s)) ? !1 : !!(n && e < n || s && e > s);
18
+ }
19
+ const m = (e, t) => {
20
+ const n = new Date(e);
21
+ if (!t)
22
+ return n;
23
+ const s = n.getDate(), r = new Date(e);
24
+ r.setMonth(n.getMonth() + t + 1, 0);
25
+ const a = r.getDate();
26
+ return s >= a ? r : (n.setFullYear(r.getFullYear(), r.getMonth(), s), n);
27
+ }, Y = (e, t) => m(e, -t), w = (e) => {
28
+ const t = new Date(e), n = new Date(t);
29
+ return n.setFullYear(t.getFullYear(), t.getMonth() + 1, 0), n.setHours(0, 0, 0, 0), n.getDate();
30
+ }, x = (e, t) => {
31
+ const n = new Date(e);
32
+ return n.setFullYear(t), n;
33
+ }, H = (e, t) => {
34
+ const n = new Date(e), s = n.getFullYear(), r = n.getDate(), a = new Date(e);
35
+ a.setFullYear(s, t, 15), a.setHours(0, 0, 0, 0);
36
+ const o = w(a);
37
+ return n.setMonth(t, Math.min(r, o)), n;
38
+ }, b = (e) => {
39
+ const { disableFuture: t, disablePast: n, maxDateTime: s, minDateTime: r, shouldDisableDate: a } = e;
40
+ return (o, c) => {
41
+ const u = /* @__PURE__ */ new Date();
42
+ return a ? a(o) : t ? h(o) > u : n ? M(o) < u : r || s ? g(o, { min: r, max: s, withTime: c }) : !1;
43
+ };
44
+ }, O = (e) => {
45
+ const t = i(() => b(e), [
46
+ e.disableFuture,
47
+ e.disablePast,
48
+ e.shouldDisableDate,
49
+ e.minDateTime,
50
+ e.maxDateTime
51
+ ]);
52
+ return f(t, [t]);
53
+ };
22
54
  export {
23
- h as makeTabId,
24
- v as useTabSlider
55
+ l as MONDAY,
56
+ m as addMonths,
57
+ b as createDayDisableChecker,
58
+ M as endOfDay,
59
+ F as endOfWeek,
60
+ g as isDayMinMaxRestricted,
61
+ D as isSameDate,
62
+ H as setMonth,
63
+ x as setYear,
64
+ h as startOfDay,
65
+ y as startOfWeek,
66
+ Y as subMonths,
67
+ O as useDayDisableCheker
25
68
  };
@@ -1,26 +1,25 @@
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);
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" });
14
16
  }
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
- };
23
- };
17
+ return () => {
18
+ t.observer && t.observer.disconnect();
19
+ };
20
+ }, [e]), l;
21
+ }, h = (r, e) => `uikit-tab-${r}-trigger-${e}`;
24
22
  export {
25
- p as useFroozeClosing
23
+ h as makeTabId,
24
+ v as useTabSlider
26
25
  };
@@ -1,92 +1,26 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import y from "classnames";
3
- import { attr as s } from "@companix/utils-browser";
4
- import { forwardRef as D, useRef as S, useCallback as T } from "react";
5
- import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
6
- import { mergeRefs as z } from "react-merge-refs";
7
- import { SelectRightElements as B } from "./bundle.es73.js";
8
- const G = D(
9
- ({
10
- required: a,
11
- size: i,
12
- fill: u,
13
- leftElement: l,
14
- className: d,
15
- value: c,
16
- clearButton: m,
17
- placeholder: p,
18
- clearButtonIcon: f,
19
- customElement: h,
20
- disabled: r,
21
- onClear: C,
22
- inputRef: I,
23
- onClick: N,
24
- ...k
25
- }, v) => {
26
- const e = S(null), F = T(
27
- (t) => {
28
- if (!e.current || !document)
29
- return;
30
- t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
31
- },
32
- [e]
33
- ), g = (t) => {
34
- document && document.activeElement === e.current && t.preventDefault();
35
- }, R = (t) => {
36
- r || F(t);
37
- }, x = (t) => {
38
- g(t);
39
- }, A = (t) => {
40
- e.current && e.current.focus(), C?.(t);
41
- };
42
- return /* @__PURE__ */ o(
43
- "div",
44
- {
45
- ref: v,
46
- className: y("form select", d),
47
- "data-size": i ?? "md",
48
- "data-fill": s(u),
49
- "data-required": s(a),
50
- "data-disabled": s(r),
51
- onMouseDown: x,
52
- onClick: R,
53
- ...k,
54
- children: [
55
- /* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
56
- l && /* @__PURE__ */ n("div", { className: "select-element", children: l }),
57
- /* @__PURE__ */ n("div", { className: "select-content", children: /* @__PURE__ */ o("div", { className: "select-content-text", "aria-disabled": r, children: [
58
- !c && /* @__PURE__ */ n("span", { className: "select-placeholder", children: p }),
59
- c
60
- ] }) }),
61
- /* @__PURE__ */ n("div", { className: "select-element", children: /* @__PURE__ */ n(
62
- B,
63
- {
64
- customElement: h,
65
- clearButton: m,
66
- value: !!c,
67
- clearButtonIcon: f,
68
- onClear: A
69
- }
70
- ) })
71
- ] }),
72
- /* @__PURE__ */ n(j, { asChild: !0, children: /* @__PURE__ */ n(
73
- "input",
74
- {
75
- ref: z([I, e]),
76
- autoComplete: "off",
77
- autoCapitalize: "none",
78
- autoCorrect: "off",
79
- spellCheck: "false",
80
- "aria-autocomplete": "none",
81
- onClick: N,
82
- readOnly: !0
83
- }
84
- ) })
85
- ]
86
- }
87
- );
88
- }
89
- );
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
+ };
23
+ };
90
24
  export {
91
- G as SelectInput
25
+ p as useFroozeClosing
92
26
  };