@companix/uikit 0.0.32 → 0.0.33

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 (49) hide show
  1. package/dist/ThemeProvider/script.d.ts +1 -0
  2. package/dist/bundle.es.js +30 -27
  3. package/dist/bundle.es10.js +2 -2
  4. package/dist/bundle.es11.js +1 -1
  5. package/dist/bundle.es12.js +1 -1
  6. package/dist/bundle.es14.js +1 -1
  7. package/dist/bundle.es18.js +1 -1
  8. package/dist/bundle.es19.js +1 -1
  9. package/dist/bundle.es20.js +1 -1
  10. package/dist/bundle.es23.js +1 -1
  11. package/dist/bundle.es24.js +3 -3
  12. package/dist/bundle.es25.js +4 -4
  13. package/dist/bundle.es26.js +2 -2
  14. package/dist/bundle.es29.js +2 -2
  15. package/dist/bundle.es32.js +13 -17
  16. package/dist/bundle.es33.js +21 -10
  17. package/dist/bundle.es34.js +10 -24
  18. package/dist/bundle.es35.js +17 -31
  19. package/dist/bundle.es36.js +36 -48
  20. package/dist/bundle.es37.js +49 -41
  21. package/dist/bundle.es38.js +42 -8
  22. package/dist/bundle.es39.js +8 -23
  23. package/dist/bundle.es40.js +24 -87
  24. package/dist/bundle.es41.js +87 -18
  25. package/dist/bundle.es42.js +16 -18
  26. package/dist/bundle.es43.js +20 -24
  27. package/dist/bundle.es44.js +20 -35
  28. package/dist/bundle.es45.js +39 -3
  29. package/dist/bundle.es46.js +3 -5
  30. package/dist/bundle.es47.js +5 -14
  31. package/dist/bundle.es48.js +13 -13
  32. package/dist/bundle.es49.js +14 -3
  33. package/dist/bundle.es50.js +3 -3
  34. package/dist/bundle.es51.js +3 -70
  35. package/dist/bundle.es52.js +68 -66
  36. package/dist/bundle.es53.js +67 -69
  37. package/dist/bundle.es54.js +69 -11
  38. package/dist/bundle.es55.js +11 -42
  39. package/dist/bundle.es56.js +42 -14
  40. package/dist/bundle.es57.js +11 -20
  41. package/dist/bundle.es59.js +1 -1
  42. package/dist/bundle.es60.js +20 -14
  43. package/dist/bundle.es61.js +2 -20
  44. package/dist/bundle.es62.js +14 -2
  45. package/dist/bundle.es68.js +2 -2
  46. package/dist/bundle.es69.js +2 -2
  47. package/dist/bundle.es9.js +4 -4
  48. package/dist/index.d.ts +1 -0
  49. package/package.json +1 -1
@@ -1,11 +1,45 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { Popover as m } from "./bundle.es7.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 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.es18.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 });
8
41
  };
9
42
  export {
10
- i as createPopoversRegistry
43
+ b as DialogShell,
44
+ $ as createDialogsRegistry
11
45
  };
@@ -1,26 +1,11 @@
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
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { Popover as m } from "./bundle.es7.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;
23
8
  };
24
9
  export {
25
- p as useFroozeClosing
10
+ i as createPopoversRegistry
26
11
  };
@@ -1,89 +1,26 @@
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.es54.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",
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
- );
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
+ };
87
24
  export {
88
- V as SelectInput
25
+ p as useFroozeClosing
89
26
  };
@@ -1,20 +1,89 @@
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
- };
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.es55.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",
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
+ );
18
87
  export {
19
- g as useScrollListController
88
+ V as SelectInput
20
89
  };
@@ -1,22 +1,20 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useEffect as a } from "react";
3
- import { OptionItem as f } from "./bundle.es11.js";
4
- import { OptionsList as O } from "./bundle.es13.js";
5
- const h = (t) => {
6
- const { active: i, onOpened: m, scrollboxRef: n, optionsWrapperRef: r, options: p, onSelect: s, minimalOptions: c } = t;
7
- return a(() => {
8
- m?.();
9
- }, []), /* @__PURE__ */ o(O, { scrollboxRef: n, optionsWrapperRef: r, maxHeight: 300, children: p.map((e, l) => /* @__PURE__ */ o(
10
- f,
11
- {
12
- active: i === e.value,
13
- onClick: () => s?.(e.value),
14
- minimal: c,
15
- ...e
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);
16
14
  },
17
- `select-option-${l}`
18
- )) });
15
+ [t, l]
16
+ ), scrollBoxRef: l, optionsWrapperRef: t };
19
17
  };
20
18
  export {
21
- h as SelectOptions
19
+ g as useScrollListController
22
20
  };
@@ -1,26 +1,22 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as m, useCallback as i } from "react";
3
- import c from "react-input-mask";
4
- const I = m(
5
- ({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
6
- const p = i(
7
- (t) => {
8
- n?.(t), o?.(t.target.value, t.target);
9
- },
10
- [n, o]
11
- );
12
- return r ? /* @__PURE__ */ u(
13
- c,
14
- {
15
- inputRef: e,
16
- mask: r,
17
- maskChar: f,
18
- onChange: p,
19
- ...a
20
- }
21
- ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
22
- }
23
- );
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { useEffect as a } from "react";
3
+ import { OptionItem as f } from "./bundle.es11.js";
4
+ import { OptionsList as O } from "./bundle.es13.js";
5
+ const h = (t) => {
6
+ const { active: i, onOpened: m, scrollboxRef: n, optionsWrapperRef: r, options: p, onSelect: s, minimalOptions: c } = t;
7
+ return a(() => {
8
+ m?.();
9
+ }, []), /* @__PURE__ */ o(O, { scrollboxRef: n, optionsWrapperRef: r, maxHeight: 300, children: p.map((e, l) => /* @__PURE__ */ o(
10
+ f,
11
+ {
12
+ active: i === e.value,
13
+ onClick: () => s?.(e.value),
14
+ minimal: c,
15
+ ...e
16
+ },
17
+ `select-option-${l}`
18
+ )) });
19
+ };
24
20
  export {
25
- I as InputElement
21
+ h as SelectOptions
26
22
  };
@@ -1,41 +1,26 @@
1
- import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
- import h from "classnames";
3
- import { attr as e } from "@companix/utils-browser";
4
- import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es60.js";
6
- const v = x(
7
- ({
8
- required: s,
9
- disabled: t,
10
- size: i,
11
- fill: d,
12
- leftElement: r,
13
- rightElement: a,
14
- className: f,
15
- inputRef: m,
16
- children: n,
17
- ...p
18
- }, c) => {
19
- const { leftRef: l, rightRef: u } = N(m, [r, a]);
20
- return /* @__PURE__ */ b(
21
- "div",
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as m, useCallback as i } from "react";
3
+ import c from "react-input-mask";
4
+ const I = m(
5
+ ({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
6
+ const p = i(
7
+ (t) => {
8
+ n?.(t), o?.(t.target.value, t.target);
9
+ },
10
+ [n, o]
11
+ );
12
+ return r ? /* @__PURE__ */ u(
13
+ c,
22
14
  {
23
- ref: c,
24
- className: h("form", f),
25
- "data-size": i ?? "md",
26
- "data-fill": e(d),
27
- "data-required": e(s),
28
- "data-disabled": e(t),
29
- ...p,
30
- children: [
31
- r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
32
- n,
33
- a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
34
- ]
15
+ inputRef: e,
16
+ mask: r,
17
+ maskChar: f,
18
+ onChange: p,
19
+ ...a
35
20
  }
36
- );
21
+ ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
37
22
  }
38
23
  );
39
24
  export {
40
- v as InputContainer
25
+ I as InputElement
41
26
  };
@@ -1,5 +1,41 @@
1
- import { __require as r } from "./bundle.es61.js";
2
- var a = /* @__PURE__ */ r();
1
+ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
+ import h from "classnames";
3
+ import { attr as e } from "@companix/utils-browser";
4
+ import { forwardRef as x } from "react";
5
+ import { useInputPadding as N } from "./bundle.es62.js";
6
+ const v = x(
7
+ ({
8
+ required: s,
9
+ disabled: t,
10
+ size: i,
11
+ fill: d,
12
+ leftElement: r,
13
+ rightElement: a,
14
+ className: f,
15
+ inputRef: m,
16
+ children: n,
17
+ ...p
18
+ }, c) => {
19
+ const { leftRef: l, rightRef: u } = N(m, [r, a]);
20
+ return /* @__PURE__ */ b(
21
+ "div",
22
+ {
23
+ ref: c,
24
+ className: h("form", f),
25
+ "data-size": i ?? "md",
26
+ "data-fill": e(d),
27
+ "data-required": e(s),
28
+ "data-disabled": e(t),
29
+ ...p,
30
+ children: [
31
+ r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
32
+ n,
33
+ a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
34
+ ]
35
+ }
36
+ );
37
+ }
38
+ );
3
39
  export {
4
- a as f
40
+ v as InputContainer
5
41
  };
@@ -1,7 +1,5 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
1
+ import { __require as r } from "./bundle.es60.js";
2
+ var a = /* @__PURE__ */ r();
5
3
  export {
6
- n as RemoveListener
4
+ a as f
7
5
  };
@@ -1,16 +1,7 @@
1
- import { useState as e } from "react";
2
- const d = ({ onClick: t }) => {
3
- const [a, s] = e({ isLoading: !1, isError: !1 });
4
- return { ...a, handleClick: (r) => {
5
- a.isLoading || t(() => {
6
- s({ isLoading: !0, isError: !1 });
7
- }, r).then(() => {
8
- s({ isLoading: !1, isError: !1 });
9
- }).catch(() => {
10
- s({ isLoading: !1, isError: !0 });
11
- });
12
- } };
13
- };
1
+ import { useEffect as r } from "react";
2
+ const n = ({ callback: e }) => (r(() => () => {
3
+ e?.();
4
+ }, []), null);
14
5
  export {
15
- d as useLoading
6
+ n as RemoveListener
16
7
  };
@@ -1,16 +1,16 @@
1
- import { useRef as i, useCallback as o } from "react";
2
- const f = (e, s) => {
3
- const r = i(null), c = i(void 0), n = o(
4
- (t) => {
5
- s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
6
- },
7
- [s, e]
8
- ), l = o(() => {
9
- const t = r.current;
10
- t && n(t);
11
- }, [r, n]);
12
- return [r, l];
1
+ import { useState as e } from "react";
2
+ const d = ({ onClick: t }) => {
3
+ const [a, s] = e({ isLoading: !1, isError: !1 });
4
+ return { ...a, handleClick: (r) => {
5
+ a.isLoading || t(() => {
6
+ s({ isLoading: !0, isError: !1 });
7
+ }, r).then(() => {
8
+ s({ isLoading: !1, isError: !1 });
9
+ }).catch(() => {
10
+ s({ isLoading: !1, isError: !0 });
11
+ });
12
+ } };
13
13
  };
14
14
  export {
15
- f as useResizeTextarea
15
+ d as useLoading
16
16
  };
@@ -1,5 +1,16 @@
1
- import { __require as r } from "./bundle.es63.js";
2
- var e = /* @__PURE__ */ r();
1
+ import { useRef as i, useCallback as o } from "react";
2
+ const f = (e, s) => {
3
+ const r = i(null), c = i(void 0), n = o(
4
+ (t) => {
5
+ s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
6
+ },
7
+ [s, e]
8
+ ), l = o(() => {
9
+ const t = r.current;
10
+ t && n(t);
11
+ }, [r, n]);
12
+ return [r, l];
13
+ };
3
14
  export {
4
- e as f
15
+ f as useResizeTextarea
5
16
  };
@@ -1,5 +1,5 @@
1
- import { __require as r } from "./bundle.es65.js";
2
- var o = /* @__PURE__ */ r();
1
+ import { __require as r } from "./bundle.es63.js";
2
+ var e = /* @__PURE__ */ r();
3
3
  export {
4
- o as f
4
+ e as f
5
5
  };