@companix/uikit 0.1.9 → 0.1.11

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 (61) hide show
  1. package/dist/WriteBar/Editor.d.ts +33 -0
  2. package/dist/WriteBar/Input.d.ts +14 -0
  3. package/dist/WriteBar/WireBar.scss +44 -46
  4. package/dist/WriteBar/index.d.ts +6 -6
  5. package/dist/WriteBar/utils.d.ts +14 -0
  6. package/dist/bundle.es.js +59 -57
  7. package/dist/bundle.es10.js +1 -1
  8. package/dist/bundle.es13.js +4 -4
  9. package/dist/bundle.es14.js +3 -3
  10. package/dist/bundle.es15.js +2 -2
  11. package/dist/bundle.es17.js +1 -1
  12. package/dist/bundle.es24.js +1 -1
  13. package/dist/bundle.es25.js +1 -1
  14. package/dist/bundle.es26.js +1 -1
  15. package/dist/bundle.es27.js +1 -1
  16. package/dist/bundle.es29.js +1 -1
  17. package/dist/bundle.es30.js +4 -4
  18. package/dist/bundle.es31.js +2 -2
  19. package/dist/bundle.es32.js +34 -23
  20. package/dist/bundle.es34.js +2 -2
  21. package/dist/bundle.es40.js +48 -92
  22. package/dist/bundle.es41.js +154 -79
  23. package/dist/bundle.es42.js +81 -7
  24. package/dist/bundle.es43.js +7 -35
  25. package/dist/bundle.es44.js +33 -20
  26. package/dist/bundle.es45.js +21 -10
  27. package/dist/bundle.es46.js +10 -11
  28. package/dist/bundle.es47.js +11 -13
  29. package/dist/bundle.es48.js +13 -13
  30. package/dist/bundle.es49.js +13 -30
  31. package/dist/bundle.es50.js +29 -25
  32. package/dist/bundle.es51.js +17 -29
  33. package/dist/bundle.es52.js +36 -48
  34. package/dist/bundle.es53.js +49 -50
  35. package/dist/bundle.es54.js +51 -8
  36. package/dist/bundle.es55.js +8 -26
  37. package/dist/bundle.es56.js +27 -5
  38. package/dist/bundle.es57.js +5 -66
  39. package/dist/bundle.es58.js +66 -23
  40. package/dist/bundle.es59.js +22 -23
  41. package/dist/bundle.es60.js +24 -88
  42. package/dist/bundle.es61.js +88 -18
  43. package/dist/bundle.es62.js +17 -92
  44. package/dist/bundle.es63.js +92 -73
  45. package/dist/bundle.es64.js +73 -23
  46. package/dist/bundle.es65.js +20 -35
  47. package/dist/bundle.es66.js +37 -68
  48. package/dist/bundle.es67.js +68 -9
  49. package/dist/bundle.es68.js +10 -42
  50. package/dist/bundle.es69.js +42 -14
  51. package/dist/bundle.es70.js +32 -31
  52. package/dist/bundle.es71.js +41 -69
  53. package/dist/bundle.es72.js +14 -74
  54. package/dist/bundle.es73.js +30 -47
  55. package/dist/bundle.es74.js +69 -13
  56. package/dist/bundle.es75.js +74 -13
  57. package/dist/bundle.es76.js +51 -0
  58. package/dist/bundle.es77.js +16 -0
  59. package/dist/bundle.es78.js +16 -0
  60. package/dist/index.d.ts +1 -0
  61. package/package.json +1 -1
@@ -1,16 +1,14 @@
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 r, useCallback as t } from "react";
2
+ const f = (s = !1) => {
3
+ const [o, e] = r(s), a = t(() => {
4
+ e(!0);
5
+ }, []), l = t(() => {
6
+ e(!1);
7
+ }, []), u = t(() => {
8
+ e((n) => !n);
9
+ }, []);
10
+ return [o, a, l, u];
13
11
  };
14
12
  export {
15
- f as useResizeTextarea
13
+ f as useBooleanState
16
14
  };
@@ -1,16 +1,16 @@
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
- } };
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
13
  };
14
14
  export {
15
- d as useLoading
15
+ f as useResizeTextarea
16
16
  };
@@ -1,33 +1,16 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useState as w, useEffect as i, useRef as d, useCallback as f, createContext as C, useContext as b } from "react";
3
- const k = 6e4, a = C(null), g = ({ children: t }) => {
4
- const r = d(/* @__PURE__ */ new Map()), s = f(
5
- (e, c) => {
6
- let n = r.current.get(e);
7
- return n || (n = {
8
- intervalId: window.setInterval(() => {
9
- const o = Date.now();
10
- n?.callbacks.forEach((l) => l(o));
11
- }, e),
12
- callbacks: /* @__PURE__ */ new Set()
13
- }, r.current.set(e, n)), n.callbacks.add(c), () => {
14
- const o = r.current.get(e);
15
- o && (o.callbacks.delete(c), o.callbacks.size === 0 && (window.clearInterval(o.intervalId), r.current.delete(e)));
16
- };
17
- },
18
- []
19
- );
20
- return /* @__PURE__ */ u(a.Provider, { value: s, children: t });
21
- }, x = () => {
22
- const t = b(a);
23
- if (t === null)
24
- throw new Error("NowContextProvider is not provided");
25
- return t;
26
- }, p = (t = k) => {
27
- const [r, s] = w(() => Date.now()), e = x();
28
- return i(() => e(t, s), [t, e]), r;
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
+ } };
29
13
  };
30
14
  export {
31
- g as NowContextProvider,
32
- p as useNow
15
+ d as useLoading
33
16
  };
@@ -1,29 +1,33 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { hash as m } from "@companix/utils-js";
3
- import { useRef as n, useMemo as s } from "react";
4
- import { Viewport as p } from "./bundle.es70.js";
5
- const a = (t = {}) => {
6
- const e = {
7
- emit: (r) => {
8
- console.error("uninitialized", r);
9
- }
10
- };
11
- return {
12
- api: {
13
- show: (r) => {
14
- e.emit({ ...r, id: m() });
15
- }
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useState as w, useEffect as i, useRef as d, useCallback as f, createContext as C, useContext as b } from "react";
3
+ const k = 6e4, a = C(null), g = ({ children: t }) => {
4
+ const r = d(/* @__PURE__ */ new Map()), s = f(
5
+ (e, c) => {
6
+ let n = r.current.get(e);
7
+ return n || (n = {
8
+ intervalId: window.setInterval(() => {
9
+ const o = Date.now();
10
+ n?.callbacks.forEach((l) => l(o));
11
+ }, e),
12
+ callbacks: /* @__PURE__ */ new Set()
13
+ }, r.current.set(e, n)), n.callbacks.add(c), () => {
14
+ const o = r.current.get(e);
15
+ o && (o.callbacks.delete(c), o.callbacks.size === 0 && (window.clearInterval(o.intervalId), r.current.delete(e)));
16
+ };
16
17
  },
17
- Viewport: () => {
18
- const r = n(null);
19
- return s(() => {
20
- e.emit = (o) => {
21
- r.current && r.current.showAlert(o);
22
- };
23
- }, []), /* @__PURE__ */ i(p, { ref: r, ...t });
24
- }
25
- };
18
+ []
19
+ );
20
+ return /* @__PURE__ */ u(a.Provider, { value: s, children: t });
21
+ }, x = () => {
22
+ const t = b(a);
23
+ if (t === null)
24
+ throw new Error("NowContextProvider is not provided");
25
+ return t;
26
+ }, p = (t = k) => {
27
+ const [r, s] = w(() => Date.now()), e = x();
28
+ return i(() => e(t, s), [t, e]), r;
26
29
  };
27
30
  export {
28
- a as createAlertAgent
31
+ g as NowContextProvider,
32
+ p as useNow
29
33
  };
@@ -1,41 +1,29 @@
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.es71.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);
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { hash as m } from "@companix/utils-js";
3
+ import { useRef as n, useMemo as s } from "react";
4
+ import { Viewport as p } from "./bundle.es73.js";
5
+ const a = (t = {}) => {
6
+ const e = {
7
+ emit: (r) => {
8
+ console.error("uninitialized", r);
9
9
  }
10
10
  };
11
11
  return {
12
12
  api: {
13
- show: (e) => {
14
- const n = e.id ?? r();
15
- return o.showToast({ ...e, id: n }), n;
13
+ show: (r) => {
14
+ e.emit({ ...r, id: m() });
16
15
  }
17
16
  },
18
- Viewport: (e = {}) => {
19
- const n = c(null);
20
- return h(() => {
21
- o.showToast = (s) => {
22
- n.current && n.current.showToast(s);
17
+ Viewport: () => {
18
+ const r = n(null);
19
+ return s(() => {
20
+ e.emit = (o) => {
21
+ r.current && r.current.showAlert(o);
23
22
  };
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
- );
23
+ }, []), /* @__PURE__ */ i(p, { ref: r, ...t });
36
24
  }
37
25
  };
38
26
  };
39
27
  export {
40
- m as createToaster
28
+ a as createAlertAgent
41
29
  };
@@ -1,53 +1,41 @@
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.es56.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);
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.es74.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
+ }
26
10
  };
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
- ]
11
+ return {
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
+ );
47
36
  }
48
- );
37
+ };
49
38
  };
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" }) }) });
51
39
  export {
52
- m as Toast
40
+ m as createToaster
53
41
  };
@@ -1,54 +1,53 @@
1
- import { jsx as r, Fragment as C } from "react/jsx-runtime";
2
- import { useContext as h, createContext as x, useState as P, useEffect as g, useCallback as u, memo as v } from "react";
3
- import { hash as w } from "@companix/utils-js";
4
- import { Dialog as D } from "./bundle.es23.js";
5
- import { Drawer as S } from "./bundle.es22.js";
6
- const F = (t) => {
7
- const o = {}, e = {}, p = [], c = w();
8
- for (const n in t)
9
- o[n] = () => {
10
- }, e[n] = () => {
11
- }, p.push(() => /* @__PURE__ */ r(O, { Open: o, Close: e, name: n, Content: t[n] }));
12
- return {
13
- Open: o,
14
- Close: e,
15
- Overlay: () => /* @__PURE__ */ r(C, { children: p.map((n, s) => /* @__PURE__ */ r(n, {}, `popup-${c}-${s}`)) })
16
- };
17
- }, O = ({ name: t, Open: o, Close: e, Content: p }) => {
18
- const [{ data: c, open: n }, s] = P({
19
- data: null,
20
- open: !1
21
- });
22
- g(() => {
23
- o[t] = (a) => {
24
- s({ data: a, open: !0 });
25
- }, e[t] = () => {
26
- n && l();
27
- };
28
- }, []);
29
- const l = u(() => {
30
- s(({ data: a }) => ({ data: a, open: !1 }));
31
- }, []), m = u(() => {
32
- s({ data: null, open: !1 });
33
- }, []), d = u((a) => {
34
- a || l();
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.es57.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);
35
23
  }, []);
36
- return c ? /* @__PURE__ */ r(i.Provider, { value: { open: n, onOpenChange: d, onClosed: m }, children: /* @__PURE__ */ r(y, { data: c, close: l, Content: p }) }) : null;
37
- }, y = v(({ data: t, close: o, Content: e }) => /* @__PURE__ */ r(e, { data: t, close: o })), i = x(null), f = () => {
38
- const t = h(i);
39
- if (!t)
40
- throw new Error("Popup context not provided");
41
- return t;
42
- }, R = ({ children: t, ...o }) => {
43
- const e = f();
44
- return /* @__PURE__ */ r(D, { ...e, ...o, children: t });
45
- }, W = ({ children: t, ...o }) => {
46
- const e = f();
47
- return /* @__PURE__ */ r(S, { ...e, ...o, children: t });
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
+ );
48
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" }) }) });
49
51
  export {
50
- R as DialogShell,
51
- W as DrawerShell,
52
- F as createPopupRegistry,
53
- f as usePopup
52
+ m as Toast
54
53
  };
@@ -1,11 +1,54 @@
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 C } from "react/jsx-runtime";
2
+ import { useContext as h, createContext as x, useState as P, useEffect as g, useCallback as u, memo as v } from "react";
3
+ import { hash as w } from "@companix/utils-js";
4
+ import { Dialog as D } from "./bundle.es23.js";
5
+ import { Drawer as S } from "./bundle.es22.js";
6
+ const F = (t) => {
7
+ const o = {}, e = {}, p = [], c = w();
8
+ for (const n in t)
9
+ o[n] = () => {
10
+ }, e[n] = () => {
11
+ }, p.push(() => /* @__PURE__ */ r(O, { Open: o, Close: e, name: n, Content: t[n] }));
12
+ return {
13
+ Open: o,
14
+ Close: e,
15
+ Overlay: () => /* @__PURE__ */ r(C, { children: p.map((n, s) => /* @__PURE__ */ r(n, {}, `popup-${c}-${s}`)) })
16
+ };
17
+ }, O = ({ name: t, Open: o, Close: e, Content: p }) => {
18
+ const [{ data: c, open: n }, s] = P({
19
+ data: null,
20
+ open: !1
21
+ });
22
+ g(() => {
23
+ o[t] = (a) => {
24
+ s({ data: a, open: !0 });
25
+ }, e[t] = () => {
26
+ n && l();
27
+ };
28
+ }, []);
29
+ const l = u(() => {
30
+ s(({ data: a }) => ({ data: a, open: !1 }));
31
+ }, []), m = u(() => {
32
+ s({ data: null, open: !1 });
33
+ }, []), d = u((a) => {
34
+ a || l();
35
+ }, []);
36
+ return c ? /* @__PURE__ */ r(i.Provider, { value: { open: n, onOpenChange: d, onClosed: m }, children: /* @__PURE__ */ r(y, { data: c, close: l, Content: p }) }) : null;
37
+ }, y = v(({ data: t, close: o, Content: e }) => /* @__PURE__ */ r(e, { data: t, close: o })), i = x(null), f = () => {
38
+ const t = h(i);
39
+ if (!t)
40
+ throw new Error("Popup context not provided");
41
+ return t;
42
+ }, R = ({ children: t, ...o }) => {
43
+ const e = f();
44
+ return /* @__PURE__ */ r(D, { ...e, ...o, children: t });
45
+ }, W = ({ children: t, ...o }) => {
46
+ const e = f();
47
+ return /* @__PURE__ */ r(S, { ...e, ...o, children: t });
8
48
  };
9
49
  export {
10
- i as createPopoversRegistry
50
+ R as DialogShell,
51
+ W as DrawerShell,
52
+ F as createPopupRegistry,
53
+ f as usePopup
11
54
  };
@@ -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
  };