reaxify 0.0.84 → 0.0.85

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 (44) hide show
  1. package/dist/components/Drawer/index.cjs.js +1 -1
  2. package/dist/components/Drawer/index.d.ts +2 -4
  3. package/dist/components/Drawer/index.es.js +16 -21
  4. package/dist/components/Menu/index.cjs.js +1 -1
  5. package/dist/components/Menu/index.d.ts +3 -3
  6. package/dist/components/Menu/index.es.js +71 -77
  7. package/dist/components/Modal/index.cjs.js +1 -1
  8. package/dist/components/Modal/index.d.ts +2 -4
  9. package/dist/components/Modal/index.es.js +36 -41
  10. package/dist/helpers/scrollIntoView.cjs.js +1 -1
  11. package/dist/helpers/scrollIntoView.d.ts +1 -1
  12. package/dist/helpers/scrollIntoView.es.js +4 -3
  13. package/dist/hooks/index.cjs.js +1 -1
  14. package/dist/hooks/index.d.ts +0 -1
  15. package/dist/hooks/index.es.js +6 -8
  16. package/dist/node_modules/@tanstack/hotkeys/dist/constants.cjs.js +1 -0
  17. package/dist/node_modules/@tanstack/hotkeys/dist/constants.es.js +206 -0
  18. package/dist/node_modules/@tanstack/hotkeys/dist/format.cjs.js +1 -0
  19. package/dist/node_modules/@tanstack/hotkeys/dist/format.es.js +10 -0
  20. package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.cjs.js +1 -0
  21. package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.es.js +276 -0
  22. package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.cjs.js +1 -0
  23. package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.es.js +48 -0
  24. package/dist/node_modules/@tanstack/hotkeys/dist/match.cjs.js +1 -0
  25. package/dist/node_modules/@tanstack/hotkeys/dist/match.es.js +27 -0
  26. package/dist/node_modules/@tanstack/hotkeys/dist/parse.cjs.js +1 -0
  27. package/dist/node_modules/@tanstack/hotkeys/dist/parse.es.js +72 -0
  28. package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.cjs.js +1 -0
  29. package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.es.js +10 -0
  30. package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js +1 -0
  31. package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js +35 -0
  32. package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.cjs.js +1 -0
  33. package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.es.js +7 -0
  34. package/dist/node_modules/@tanstack/store/dist/esm/alien.cjs.js +1 -0
  35. package/dist/node_modules/@tanstack/store/dist/esm/alien.es.js +129 -0
  36. package/dist/node_modules/@tanstack/store/dist/esm/atom.cjs.js +1 -0
  37. package/dist/node_modules/@tanstack/store/dist/esm/atom.es.js +124 -0
  38. package/dist/node_modules/@tanstack/store/dist/esm/store.cjs.js +1 -0
  39. package/dist/node_modules/@tanstack/store/dist/esm/store.es.js +24 -0
  40. package/dist/types/index.d.ts +2 -2
  41. package/package.json +4 -3
  42. package/dist/hooks/useKeyDown.cjs.js +0 -1
  43. package/dist/hooks/useKeyDown.d.ts +0 -6
  44. package/dist/hooks/useKeyDown.es.js +0 -17
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),d=require("../../hooks/useClasses.cjs.js"),i=require("react"),q=require("../../hooks/useKeyDown.cjs.js"),g=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),b=require("../../helpers/cn.cjs.js"),f=require("../Card/index.cjs.js"),R=require("../Portal/index.cjs.js"),C=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),p=i.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function x({as:n,ref:a,open:r=!1,onClose:e=()=>{},duration:o=300,anchor:u="end",className:w="",children:y,...v}){const t=d(l=>l.drawer),c=i.useRef(null),m=n||"div",j={entering:"active opacity-100 pointer-events-auto",entered:"active opacity-100 pointer-events-auto",exiting:"opacity-0 pointer-events-none",exited:"opacity-0 pointer-events-none",unmounted:""},D=i.useMemo(()=>{var h;const l={start:"flex-row-reverse",end:"flex-row",top:"flex-col-reverse",bottom:"flex-col"},M=(h=t==null?void 0:t.anchor)==null?void 0:h[u];return[l[u],M]},[u,t==null?void 0:t.anchor]);return i.useImperativeHandle(a,()=>c.current),q(()=>{e==null||e()},{skip:!r,targetKey:"Escape"}),s.jsx(R,{children:s.jsx(C.default,{nodeRef:c,in:r,timeout:o,unmountOnExit:!0,children:l=>s.jsxs(m,{ref:c,style:{transitionDuration:`${o}ms`},"data-open":r,className:g.twMerge("fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",t==null?void 0:t.base,j[l],D,w),...v,children:[s.jsx("button",{type:"button",onClick:()=>e(),className:"absolute inset-0 size-full cursor-default opacity-0"}),s.jsx(p.Provider,{value:{open:r,onClose:e,transitionState:l,duration:o,anchor:u},children:y})]})})})}function N({children:n,className:a="",...r}){const e=d(t=>t.drawer.menu),{anchor:o,duration:u,transitionState:w}=i.useContext(p),y=i.useMemo(()=>{var m;const t={start:"w-[31.875rem] h-full max-w-[92.5%] rounded-e me-auto",end:"w-[31.875rem] h-full max-w-[92.5%] rounded-s ms-auto",top:"w-full h-[31.875rem] max-h-[92.5%] rounded-b mb-auto",bottom:"w-full h-[31.875rem] max-h-[92.5%] rounded-t mt-auto"},c=(m=e==null?void 0:e.anchor)==null?void 0:m[o];return[t[o],c]},[o,e==null?void 0:e.anchor]),v=i.useMemo(()=>({start:{entering:"translate-x-0",entered:"translate-x-0",exiting:"-translate-x-[calc(100%*var(--drawer-ratio))]",exited:"-translate-x-[calc(100%*var(--drawer-ratio))]",unmounted:""},end:{entering:"translate-x-0",entered:"translate-x-0",exiting:"translate-x-[calc(100%*var(--drawer-ratio))]",exited:"translate-x-[calc(100%*var(--drawer-ratio))]",unmounted:""},top:{entering:"translate-y-0",entered:"translate-y-0",exiting:"-translate-y-full",exited:"-translate-y-full",unmounted:""},bottom:{entering:"translate-y-0",entered:"translate-y-0",exiting:"translate-y-full",exited:"translate-y-full",unmounted:""}})[o],[o]);return s.jsx(f,{as:"div",style:{transitionDuration:`${u}ms`},className:g.twMerge("relative flex flex-col transition-[translate,width] rounded-none",e==null?void 0:e.base,v[w],y,a),...r,children:n})}function S({className:n,...a}){const r=d(e=>e.drawer.header.base);return s.jsx(f.Header,{className:b(r,n),...a})}function k({className:n,...a}){const r=d(e=>e.drawer.body.base);return s.jsx(f.Body,{className:b("flex-1 overflow-auto",r,n),...a})}function H({className:n,...a}){const r=d(e=>e.drawer.footer.base);return s.jsx(f.Footer,{className:b(r,n),...a})}x.Menu=N;x.Header=S;x.Body=k;x.Footer=H;exports.DrawerContext=p;exports.default=x;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),d=require("../../hooks/useClasses.cjs.js"),u=require("react"),q=require("../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js"),g=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),v=require("../../helpers/cn.cjs.js"),f=require("../Card/index.cjs.js"),D=require("../Portal/index.cjs.js"),R=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),p=u.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function x({as:n,ref:a,open:r=!1,onClose:e=()=>{},duration:o=300,anchor:i="end",className:w="",children:y,...b}){const t=d(l=>l.drawer),c=u.useRef(null),m=n||"div",j={entering:"active opacity-100 pointer-events-auto",entered:"active opacity-100 pointer-events-auto",exiting:"opacity-0 pointer-events-none",exited:"opacity-0 pointer-events-none",unmounted:""},C=u.useMemo(()=>{var h;const l={start:"flex-row-reverse",end:"flex-row",top:"flex-col-reverse",bottom:"flex-col"},M=(h=t==null?void 0:t.anchor)==null?void 0:h[i];return[l[i],M]},[i,t==null?void 0:t.anchor]);return u.useImperativeHandle(a,()=>c.current),q.useHotkey("Escape",()=>e(),{enabled:r}),s.jsx(D,{children:s.jsx(R.default,{nodeRef:c,in:r,timeout:o,unmountOnExit:!0,children:l=>s.jsxs(m,{ref:c,style:{transitionDuration:`${o}ms`},"data-open":r,className:g.twMerge("fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",t==null?void 0:t.base,j[l],C,w),...b,children:[s.jsx("button",{type:"button",onClick:()=>e(),className:"absolute inset-0 size-full cursor-default opacity-0"}),s.jsx(p.Provider,{value:{open:r,onClose:e,transitionState:l,duration:o,anchor:i},children:y})]})})})}function H({children:n,className:a="",...r}){const e=d(t=>t.drawer.menu),{anchor:o,duration:i,transitionState:w}=u.useContext(p),y=u.useMemo(()=>{var m;const t={start:"w-[31.875rem] h-full max-w-[92.5%] rounded-e me-auto",end:"w-[31.875rem] h-full max-w-[92.5%] rounded-s ms-auto",top:"w-full max-h-[92.5%] rounded-b mb-auto",bottom:"w-full max-h-[92.5%] rounded-t mt-auto"},c=(m=e==null?void 0:e.anchor)==null?void 0:m[o];return[t[o],c]},[o,e==null?void 0:e.anchor]),b=u.useMemo(()=>({start:{entering:"translate-x-0",entered:"translate-x-0",exiting:"-translate-x-[calc(100%*var(--drawer-ratio))]",exited:"-translate-x-[calc(100%*var(--drawer-ratio))]",unmounted:""},end:{entering:"translate-x-0",entered:"translate-x-0",exiting:"translate-x-[calc(100%*var(--drawer-ratio))]",exited:"translate-x-[calc(100%*var(--drawer-ratio))]",unmounted:""},top:{entering:"translate-y-0",entered:"translate-y-0",exiting:"-translate-y-full",exited:"-translate-y-full",unmounted:""},bottom:{entering:"translate-y-0",entered:"translate-y-0",exiting:"translate-y-full",exited:"translate-y-full",unmounted:""}})[o],[o]);return s.jsx(f,{as:"div",style:{transitionDuration:`${i}ms`},className:g.twMerge("relative flex flex-col transition-[translate,width] rounded-none",e==null?void 0:e.base,b[w],y,a),...r,children:n})}function N({className:n,...a}){const r=d(e=>e.drawer.header.base);return s.jsx(f.Header,{className:v(r,n),...a})}function k({className:n,...a}){const r=d(e=>e.drawer.body.base);return s.jsx(f.Body,{className:v("flex-1 overflow-auto",r,n),...a})}function S({className:n,...a}){const r=d(e=>e.drawer.footer.base);return s.jsx(f.Footer,{className:v(r,n),...a})}x.Menu=H;x.Header=N;x.Body=k;x.Footer=S;exports.DrawerContext=p;exports.default=x;
@@ -3,16 +3,14 @@ import { ComponentProps, ElementType } from 'react';
3
3
  import { TransitionStatus } from 'react-transition-group';
4
4
  type Anchor = "start" | "end" | "top" | "bottom";
5
5
  type Context = {
6
- open: boolean;
7
- onClose: VoidFunction;
8
6
  duration: number;
9
7
  anchor: Anchor;
10
8
  transitionState: TransitionStatus;
11
- };
9
+ } & ToggleProps;
12
10
  type DrawerBaseProps = {
13
11
  anchor?: Anchor;
14
12
  duration?: number;
15
- } & ToggleProps;
13
+ } & Partial<ToggleProps>;
16
14
  type DrawerProps<E extends ElementType> = ComponentPropsWithAs<E, DrawerBaseProps>;
17
15
  type DrawerMenuProps = Omit<ComponentProps<"div">, "as" | "ref">;
18
16
  type DrawerHeaderProps = ComponentProps<"div">;
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { jsx as s, jsxs as N } from "react/jsx-runtime";
3
3
  import d from "../../hooks/useClasses.es.js";
4
- import { createContext as k, useRef as H, useMemo as y, useImperativeHandle as M, useContext as z } from "react";
5
- import B from "../../hooks/useKeyDown.es.js";
4
+ import { createContext as H, useRef as k, useMemo as y, useImperativeHandle as M, useContext as z } from "react";
5
+ import { useHotkey as B } from "../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js";
6
6
  import { twMerge as h } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
7
7
  import v from "../../helpers/cn.es.js";
8
8
  import m from "../Card/index.es.js";
9
9
  import F from "../Portal/index.es.js";
10
10
  import S from "../../node_modules/react-transition-group/esm/Transition.es.js";
11
- const g = k({
11
+ const g = H({
12
12
  open: !1,
13
13
  onClose: () => {
14
14
  },
@@ -28,28 +28,23 @@ function f({
28
28
  children: w,
29
29
  ...p
30
30
  }) {
31
- const e = d((l) => l.drawer), u = H(null), c = n || "div", D = {
31
+ const e = d((l) => l.drawer), u = k(null), c = n || "div", C = {
32
32
  entering: "active opacity-100 pointer-events-auto",
33
33
  entered: "active opacity-100 pointer-events-auto",
34
34
  exiting: "opacity-0 pointer-events-none",
35
35
  exited: "opacity-0 pointer-events-none",
36
36
  unmounted: ""
37
- }, R = y(() => {
37
+ }, D = y(() => {
38
38
  var b;
39
39
  const l = {
40
40
  start: "flex-row-reverse",
41
41
  end: "flex-row",
42
42
  top: "flex-col-reverse",
43
43
  bottom: "flex-col"
44
- }, C = (b = e == null ? void 0 : e.anchor) == null ? void 0 : b[i];
45
- return [l[i], C];
44
+ }, R = (b = e == null ? void 0 : e.anchor) == null ? void 0 : b[i];
45
+ return [l[i], R];
46
46
  }, [i, e == null ? void 0 : e.anchor]);
47
- return M(a, () => u.current), B(
48
- () => {
49
- t == null || t();
50
- },
51
- { skip: !r, targetKey: "Escape" }
52
- ), /* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(S, { nodeRef: u, in: r, timeout: o, unmountOnExit: !0, children: (l) => /* @__PURE__ */ N(
47
+ return M(a, () => u.current), B("Escape", () => t(), { enabled: r }), /* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(S, { nodeRef: u, in: r, timeout: o, unmountOnExit: !0, children: (l) => /* @__PURE__ */ N(
53
48
  c,
54
49
  {
55
50
  ref: u,
@@ -58,8 +53,8 @@ function f({
58
53
  className: h(
59
54
  "fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",
60
55
  e == null ? void 0 : e.base,
61
- D[l],
62
- R,
56
+ C[l],
57
+ D,
63
58
  x
64
59
  ),
65
60
  ...p,
@@ -95,8 +90,8 @@ function j({ children: n, className: a = "", ...r }) {
95
90
  const e = {
96
91
  start: "w-[31.875rem] h-full max-w-[92.5%] rounded-e me-auto",
97
92
  end: "w-[31.875rem] h-full max-w-[92.5%] rounded-s ms-auto",
98
- top: "w-full h-[31.875rem] max-h-[92.5%] rounded-b mb-auto",
99
- bottom: "w-full h-[31.875rem] max-h-[92.5%] rounded-t mt-auto"
93
+ top: "w-full max-h-[92.5%] rounded-b mb-auto",
94
+ bottom: "w-full max-h-[92.5%] rounded-t mt-auto"
100
95
  }, u = (c = t == null ? void 0 : t.anchor) == null ? void 0 : c[o];
101
96
  return [e[o], u];
102
97
  }, [o, t == null ? void 0 : t.anchor]), p = y(() => ({
@@ -150,7 +145,7 @@ function E({ className: n, ...a }) {
150
145
  const r = d((t) => t.drawer.header.base);
151
146
  return /* @__PURE__ */ s(m.Header, { className: v(r, n), ...a });
152
147
  }
153
- function K({ className: n, ...a }) {
148
+ function P({ className: n, ...a }) {
154
149
  const r = d((t) => t.drawer.body.base);
155
150
  return /* @__PURE__ */ s(
156
151
  m.Body,
@@ -160,14 +155,14 @@ function K({ className: n, ...a }) {
160
155
  }
161
156
  );
162
157
  }
163
- function P({ className: n, ...a }) {
158
+ function $({ className: n, ...a }) {
164
159
  const r = d((t) => t.drawer.footer.base);
165
160
  return /* @__PURE__ */ s(m.Footer, { className: v(r, n), ...a });
166
161
  }
167
162
  f.Menu = j;
168
163
  f.Header = E;
169
- f.Body = K;
170
- f.Footer = P;
164
+ f.Body = P;
165
+ f.Footer = $;
171
166
  export {
172
167
  g as DrawerContext,
173
168
  f as default
@@ -1 +1 @@
1
- "use client";"use strict";const r=require("react/jsx-runtime"),E=require("../../hooks/useClasses.cjs.js"),t=require("react"),N=require("../../hooks/useKeyDown.cjs.js"),k=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),W=require("../Portal/index.cjs.js"),I=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),w=t.createContext({open:!1,onClose:()=>{},transitionState:"unmounted",closeOnClick:!1});function H({as:o,ref:u,open:s,onClose:a,closeOnClick:y=!1,anchorEl:c=null,className:b,children:x,...C}){const M=E(e=>e.menu.base),d=o||"div",n=16,i=t.useRef(null),f=t.useRef({left:n,right:n,top:n}),O={entering:"scale-100 opacity-100",entered:"scale-100 opacity-100",exiting:"scale-90 opacity-0",exited:"scale-90 opacity-0",unmounted:""},R=t.useCallback(e=>{f.current=e},[]),q=t.useCallback(e=>{var l,h,p;(l=i.current)==null||l.style.setProperty("--left",`${e.left}px`),(h=i.current)==null||h.style.setProperty("--right",`${e.right}px`),(p=i.current)==null||p.style.setProperty("--top",`${e.top}px`)},[]),m=t.useCallback(()=>{var P,z;if(!s||!c)return;const e=c.getBoundingClientRect(),l=window.innerWidth,h=window.innerHeight,p=((P=i.current)==null?void 0:P.offsetWidth)||150,L=((z=i.current)==null?void 0:z.offsetHeight)||200;let g=e.left,j=e.right,v=e.bottom;g=Math.min(Math.max(g,n),l-p-n),j=Math.min(Math.max(l-e.right,n),l-p-n),v=Math.min(Math.max(v,n),h-L-n),R({left:g,right:j,top:v}),q({left:g,right:j,top:v})},[s,c,R,q]);return t.useEffect(()=>{m()},[m,x]),t.useEffect(()=>{const e=()=>{m()};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[m]),t.useImperativeHandle(u,()=>i.current),N(()=>{a==null||a()},{skip:!s,targetKey:"Escape"}),r.jsx(W,{children:r.jsx(I.default,{nodeRef:i,in:s,timeout:300,unmountOnExit:!0,children:e=>r.jsx(w.Provider,{value:{open:s,onClose:a,transitionState:e,closeOnClick:y},children:r.jsxs(S,{children:[r.jsx($,{}),r.jsx(d,{ref:i,"data-open":s,className:k.twMerge("w-fit min-w-[12.5rem] bg-white shadow rounded p-2 transition-[scale,opacity] absolute top-[var(--top)] left-[var(--left)] right-auto origin-top-left rtl:left-auto rtl:right-[var(--right)] rtl:origin-top-right",M,O[e],b),...C,children:x})]})})})})}function S({children:o}){const{transitionState:u}=t.useContext(w),s={entering:"active pointer-events-auto",entered:"active pointer-events-auto",exiting:"pointer-events-none",exited:"pointer-events-none",unmounted:""};return r.jsx("div",{className:k.twMerge("fixed inset-0 size-full flex flex-col bg-transparent transition-opacity overflow-hidden z-10",s[u]),children:o})}function $(){const{onClose:o}=t.useContext(w);return r.jsx("button",{type:"button",className:"w-full flex-1 opacity-0 cursor-default lg:absolute lg:size-full lg:inset-0",onClick:o})}function B({as:o,closeOnClick:u,type:s="button",className:a,children:y,onClick:c,...b}){const x=o||"div",C=E(f=>f.menu.item.base),{closeOnClick:M,onClose:d}=t.useContext(w),n=u??M,i=f=>{n&&(d==null||d()),c==null||c(f)};return r.jsx(x,{type:s,className:k.twMerge("flex items-center px-3 py-2 w-full text-dark text-base font-normal rounded transition-colors hover:bg-dark hover:text-white",C,a),onClick:i,...b,children:y})}H.Item=B;module.exports=H;
1
+ "use client";"use strict";const i=require("react/jsx-runtime"),z=require("../../hooks/useClasses.cjs.js"),t=require("react"),N=require("../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js"),j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),W=require("../Portal/index.cjs.js"),I=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),b=t.createContext({open:!1,onClose:()=>{},transitionState:"unmounted",closeOnClick:!1});function E({as:o,ref:l,open:s,onClose:c,closeOnClick:u=!1,anchorEl:d=null,className:m,children:h,...C}){const M=z(e=>e.menu.base),f=o||"div",n=16,r=t.useRef(null),p=t.useRef({left:n,right:n,top:n}),O={entering:"scale-100 opacity-100",entered:"scale-100 opacity-100",exiting:"scale-90 opacity-0",exited:"scale-90 opacity-0",unmounted:""},R=t.useCallback(e=>{p.current=e},[]),H=t.useCallback(e=>{var a,v,x;(a=r.current)==null||a.style.setProperty("--left",`${e.left}px`),(v=r.current)==null||v.style.setProperty("--right",`${e.right}px`),(x=r.current)==null||x.style.setProperty("--top",`${e.top}px`)},[]),g=t.useCallback(()=>{var q,P;if(!s||!d)return;const e=d.getBoundingClientRect(),a=window.innerWidth,v=window.innerHeight,x=((q=r.current)==null?void 0:q.offsetWidth)||150,L=((P=r.current)==null?void 0:P.offsetHeight)||200;let w=e.left,k=e.right,y=e.bottom;w=Math.min(Math.max(w,n),a-x-n),k=Math.min(Math.max(a-e.right,n),a-x-n),y=Math.min(Math.max(y,n),v-L-n),R({left:w,right:k,top:y}),H({left:w,right:k,top:y})},[s,d,R,H]);return t.useEffect(()=>{g()},[g,h]),t.useEffect(()=>{const e=()=>{g()};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[g]),t.useImperativeHandle(l,()=>r.current),N.useHotkey("Escape",()=>c==null?void 0:c(),{enabled:s}),i.jsx(W,{children:i.jsx(I.default,{nodeRef:r,in:s,timeout:300,unmountOnExit:!0,children:e=>i.jsx(b.Provider,{value:{open:s,onClose:c,transitionState:e,closeOnClick:u},children:i.jsxs(S,{children:[i.jsx($,{}),i.jsx(f,{ref:r,"data-open":s,className:j.twMerge("w-fit min-w-[12.5rem] bg-white shadow rounded p-2 transition-[scale,opacity] absolute top-[var(--top)] left-[var(--left)] right-auto origin-top-left rtl:left-auto rtl:right-[var(--right)] rtl:origin-top-right",M,O[e],m),...C,children:h})]})})})})}function S({children:o}){const{transitionState:l}=t.useContext(b),s={entering:"active pointer-events-auto",entered:"active pointer-events-auto",exiting:"pointer-events-none",exited:"pointer-events-none",unmounted:""};return i.jsx("div",{className:j.twMerge("fixed inset-0 size-full flex flex-col bg-transparent transition-opacity overflow-hidden z-10",s[l]),children:o})}function $(){const{onClose:o}=t.useContext(b);return i.jsx("button",{type:"button",className:"w-full flex-1 opacity-0 cursor-default lg:absolute lg:size-full lg:inset-0",onClick:o})}function B({as:o,closeOnClick:l,className:s,children:c,onClick:u,...d}){const m=o||"button",h=m==="button"?"button":void 0,C=z(p=>p.menu.item.base),{closeOnClick:M,onClose:f}=t.useContext(b),n=l??M,r=p=>{n&&(f==null||f()),u==null||u(p)};return i.jsx(m,{type:h,className:j.twMerge("flex items-center px-3 py-2 w-full text-dark text-base font-normal rounded cursor-pointer transition-colors hover:bg-dark hover:text-white",C,s),onClick:r,...d,children:c})}E.Item=B;module.exports=E;
@@ -1,9 +1,9 @@
1
1
  import { ComponentPropsWithAs, ToggleProps } from '../../types';
2
2
  import { ElementType } from 'react';
3
- type MenuProps = ToggleProps & {
3
+ type MenuProps = {
4
4
  anchorEl?: HTMLElement | null;
5
5
  closeOnClick?: boolean;
6
- };
6
+ } & ToggleProps;
7
7
  type MenuItemProps = {
8
8
  closeOnClick?: boolean;
9
9
  };
@@ -11,5 +11,5 @@ declare function Menu<E extends ElementType = "div">({ as, ref, open, onClose, c
11
11
  declare namespace Menu {
12
12
  var Item: typeof MenuItem;
13
13
  }
14
- declare function MenuItem<E extends ElementType = "button">({ as, closeOnClick: itemCloseOnClick, type, className, children, onClick, ...props }: ComponentPropsWithAs<E, MenuItemProps>): import("react/jsx-runtime").JSX.Element;
14
+ declare function MenuItem<E extends ElementType = "button">({ as, closeOnClick: itemCloseOnClick, className, children, onClick, ...props }: ComponentPropsWithAs<E, MenuItemProps>): import("react/jsx-runtime").JSX.Element;
15
15
  export default Menu;
@@ -1,30 +1,30 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as $ } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as $ } from "react/jsx-runtime";
3
3
  import W from "../../hooks/useClasses.es.js";
4
4
  import { createContext as j, useRef as L, useCallback as k, useEffect as N, useImperativeHandle as B, useContext as P } from "react";
5
- import K from "../../hooks/useKeyDown.es.js";
6
- import { twMerge as z } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
7
- import D from "../Portal/index.es.js";
8
- import T from "../../node_modules/react-transition-group/esm/Transition.es.js";
9
- const x = j({
5
+ import { useHotkey as T } from "../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js";
6
+ import { twMerge as H } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
7
+ import q from "../Portal/index.es.js";
8
+ import A from "../../node_modules/react-transition-group/esm/Transition.es.js";
9
+ const y = j({
10
10
  open: !1,
11
11
  onClose: () => {
12
12
  },
13
13
  transitionState: "unmounted",
14
14
  closeOnClick: !1
15
15
  });
16
- function q({
17
- as: r,
18
- ref: c,
16
+ function D({
17
+ as: i,
18
+ ref: l,
19
19
  open: o,
20
- onClose: a,
21
- closeOnClick: w = !1,
22
- anchorEl: s = null,
23
- className: y,
24
- children: m,
20
+ onClose: s,
21
+ closeOnClick: c = !1,
22
+ anchorEl: u = null,
23
+ className: p,
24
+ children: h,
25
25
  ...b
26
26
  }) {
27
- const C = W((t) => t.menu.base), u = r || "div", e = 16, n = L(null), f = L({
27
+ const C = W((t) => t.menu.base), f = i || "div", e = 16, n = L(null), d = L({
28
28
  left: e,
29
29
  right: e,
30
30
  top: e
@@ -34,71 +34,66 @@ function q({
34
34
  exiting: "scale-90 opacity-0",
35
35
  exited: "scale-90 opacity-0",
36
36
  unmounted: ""
37
- }, H = k((t) => {
38
- f.current = t;
37
+ }, z = k((t) => {
38
+ d.current = t;
39
39
  }, []), O = k((t) => {
40
- var l, h, d;
41
- (l = n.current) == null || l.style.setProperty("--left", `${t.left}px`), (h = n.current) == null || h.style.setProperty("--right", `${t.right}px`), (d = n.current) == null || d.style.setProperty("--top", `${t.top}px`);
42
- }, []), p = k(() => {
40
+ var a, v, m;
41
+ (a = n.current) == null || a.style.setProperty("--left", `${t.left}px`), (v = n.current) == null || v.style.setProperty("--right", `${t.right}px`), (m = n.current) == null || m.style.setProperty("--top", `${t.top}px`);
42
+ }, []), g = k(() => {
43
43
  var R, E;
44
- if (!o || !s) return;
45
- const t = s.getBoundingClientRect(), l = window.innerWidth, h = window.innerHeight, d = ((R = n.current) == null ? void 0 : R.offsetWidth) || 150, S = ((E = n.current) == null ? void 0 : E.offsetHeight) || 200;
46
- let g = t.left, M = t.right, v = t.bottom;
47
- g = Math.min(Math.max(g, e), l - d - e), M = Math.min(
48
- Math.max(l - t.right, e),
49
- l - d - e
50
- ), v = Math.min(Math.max(v, e), h - S - e), H({ left: g, right: M, top: v }), O({ left: g, right: M, top: v });
51
- }, [o, s, H, O]);
44
+ if (!o || !u) return;
45
+ const t = u.getBoundingClientRect(), a = window.innerWidth, v = window.innerHeight, m = ((R = n.current) == null ? void 0 : R.offsetWidth) || 150, S = ((E = n.current) == null ? void 0 : E.offsetHeight) || 200;
46
+ let x = t.left, M = t.right, w = t.bottom;
47
+ x = Math.min(Math.max(x, e), a - m - e), M = Math.min(
48
+ Math.max(a - t.right, e),
49
+ a - m - e
50
+ ), w = Math.min(Math.max(w, e), v - S - e), z({ left: x, right: M, top: w }), O({ left: x, right: M, top: w });
51
+ }, [o, u, z, O]);
52
52
  return N(() => {
53
- p();
54
- }, [p, m]), N(() => {
53
+ g();
54
+ }, [g, h]), N(() => {
55
55
  const t = () => {
56
- p();
56
+ g();
57
57
  };
58
58
  return window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
59
59
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t);
60
60
  };
61
- }, [p]), B(c, () => n.current), K(
62
- () => {
63
- a == null || a();
64
- },
65
- { skip: !o, targetKey: "Escape" }
66
- ), /* @__PURE__ */ i(D, { children: /* @__PURE__ */ i(T, { nodeRef: n, in: o, timeout: 300, unmountOnExit: !0, children: (t) => /* @__PURE__ */ i(
67
- x.Provider,
61
+ }, [g]), B(l, () => n.current), T("Escape", () => s == null ? void 0 : s(), { enabled: o }), /* @__PURE__ */ r(q, { children: /* @__PURE__ */ r(A, { nodeRef: n, in: o, timeout: 300, unmountOnExit: !0, children: (t) => /* @__PURE__ */ r(
62
+ y.Provider,
68
63
  {
69
64
  value: {
70
65
  open: o,
71
- onClose: a,
66
+ onClose: s,
72
67
  transitionState: t,
73
- closeOnClick: w
68
+ closeOnClick: c
74
69
  },
75
- children: /* @__PURE__ */ $(A, { children: [
76
- /* @__PURE__ */ i(F, {}),
77
- /* @__PURE__ */ i(
78
- u,
70
+ children: /* @__PURE__ */ $(F, { children: [
71
+ /* @__PURE__ */ r(G, {}),
72
+ /* @__PURE__ */ r(
73
+ f,
79
74
  {
80
75
  ref: n,
81
76
  "data-open": o,
82
- className: z(
77
+ className: H(
83
78
  "w-fit min-w-[12.5rem] bg-white shadow rounded p-2 transition-[scale,opacity] absolute top-[var(--top)] left-[var(--left)] right-auto origin-top-left rtl:left-auto rtl:right-[var(--right)] rtl:origin-top-right",
84
79
  C,
85
80
  I[t],
86
- y
81
+ p
87
82
  ),
88
83
  ...b,
89
- children: m
84
+ children: h
90
85
  }
91
86
  )
92
87
  ] })
93
88
  }
94
89
  ) }) });
95
90
  }
96
- function A({ children: r }) {
97
- const { transitionState: c } = P(x);
98
- return /* @__PURE__ */ i(
91
+ function F({ children: i }) {
92
+ const { transitionState: l } = P(y);
93
+ return /* @__PURE__ */ r(
99
94
  "div",
100
95
  {
101
- className: z(
96
+ className: H(
102
97
  "fixed inset-0 size-full flex flex-col bg-transparent transition-opacity overflow-hidden z-10",
103
98
  {
104
99
  entering: "active pointer-events-auto",
@@ -106,51 +101,50 @@ function A({ children: r }) {
106
101
  exiting: "pointer-events-none",
107
102
  exited: "pointer-events-none",
108
103
  unmounted: ""
109
- }[c]
104
+ }[l]
110
105
  ),
111
- children: r
106
+ children: i
112
107
  }
113
108
  );
114
109
  }
115
- function F() {
116
- const { onClose: r } = P(x);
117
- return /* @__PURE__ */ i(
110
+ function G() {
111
+ const { onClose: i } = P(y);
112
+ return /* @__PURE__ */ r(
118
113
  "button",
119
114
  {
120
115
  type: "button",
121
116
  className: "w-full flex-1 opacity-0 cursor-default lg:absolute lg:size-full lg:inset-0",
122
- onClick: r
117
+ onClick: i
123
118
  }
124
119
  );
125
120
  }
126
- function G({
127
- as: r,
128
- closeOnClick: c,
129
- type: o = "button",
130
- className: a,
131
- children: w,
132
- onClick: s,
133
- ...y
121
+ function J({
122
+ as: i,
123
+ closeOnClick: l,
124
+ className: o,
125
+ children: s,
126
+ onClick: c,
127
+ ...u
134
128
  }) {
135
- const m = r || "div", b = W((f) => f.menu.item.base), { closeOnClick: C, onClose: u } = P(x), e = c ?? C, n = (f) => {
136
- e && (u == null || u()), s == null || s(f);
129
+ const p = i || "button", h = p === "button" ? "button" : void 0, b = W((d) => d.menu.item.base), { closeOnClick: C, onClose: f } = P(y), e = l ?? C, n = (d) => {
130
+ e && (f == null || f()), c == null || c(d);
137
131
  };
138
- return /* @__PURE__ */ i(
139
- m,
132
+ return /* @__PURE__ */ r(
133
+ p,
140
134
  {
141
- type: o,
142
- className: z(
143
- "flex items-center px-3 py-2 w-full text-dark text-base font-normal rounded transition-colors hover:bg-dark hover:text-white",
135
+ type: h,
136
+ className: H(
137
+ "flex items-center px-3 py-2 w-full text-dark text-base font-normal rounded cursor-pointer transition-colors hover:bg-dark hover:text-white",
144
138
  b,
145
- a
139
+ o
146
140
  ),
147
141
  onClick: n,
148
- ...y,
149
- children: w
142
+ ...u,
143
+ children: s
150
144
  }
151
145
  );
152
146
  }
153
- q.Item = G;
147
+ D.Item = J;
154
148
  export {
155
- q as default
149
+ D as default
156
150
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),y=require("../../helpers/cn.cjs.js"),c=require("../../hooks/useClasses.cjs.js"),u=require("react"),q=require("../../hooks/useKeyDown.cjs.js"),v=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),x=require("../Card/index.cjs.js"),z=require("../Portal/index.cjs.js"),w=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),g=u.createContext({size:"md",open:!1,onClose:()=>{},transitionState:"unmounted",duration:300});function l({as:t,ref:n,size:s="md",open:e=!1,onClose:o=()=>{},duration:r=300,className:f,children:p,...b}){const d=c(m=>m.modal.base),a=u.useRef(null),M=t||"div",j={entering:"active opacity-100 pointer-events-auto",entered:"active opacity-100 pointer-events-auto",exiting:"opacity-0 pointer-events-none",exited:"opacity-0 pointer-events-none",unmounted:""};return u.useImperativeHandle(n,()=>a.current),q(()=>{o==null||o()},{skip:!e,targetKey:"Escape"}),i.jsx(z,{children:i.jsx(w.default,{nodeRef:a,in:e,timeout:r,unmountOnExit:!0,children:m=>i.jsxs(M,{ref:a,"data-open":e,style:{transitionDuration:`${r}ms`},className:v.twMerge("modal fixed size-full inset-0 flex flex-col z-10 bg-black/20 transition-opacity backdrop-blur p-4",d,j[m],f),...b,children:[i.jsx("button",{type:"button",onClick:()=>o(),className:"absolute inset-0 cursor-default opacity-0"}),i.jsx(g.Provider,{value:{size:s,open:e,onClose:o,transitionState:m,duration:r},children:p})]})})})}function N({className:t,children:n,...s}){const e=c(d=>d.modal.dialog),{size:o,transitionState:r,duration:f}=u.useContext(g),p={entering:"scale-100",entered:"scale-100",exiting:"scale-75",exited:"scale-75",unmounted:""},b=u.useMemo(()=>{var a;return[{sm:"min-[576px]:w-[300px]",md:"min-[576px]:w-[500px]",lg:"min-[992px]:w-[800px]"}[o],(a=e==null?void 0:e.size)==null?void 0:a[o]]},[o,e==null?void 0:e.size]);return i.jsx(x,{as:"div",style:{transitionDuration:`${f}ms`},className:v.twMerge("max-w-full max-h-full m-auto transition-transform",e==null?void 0:e.base,b,p[r],t),...s,children:n})}function S({className:t,...n}){const s=c(e=>e.modal.header.base);return i.jsx(x.Header,{className:y(s,t),...n})}function h({className:t,...n}){const s=c(e=>e.modal.body.base);return i.jsx(x.Body,{className:y(s,t),...n})}function D({className:t,...n}){const s=c(e=>e.modal.footer.base);return i.jsx(x.Footer,{className:y(s,t),...n})}l.Dialog=N;l.Header=S;l.Body=h;l.Footer=D;exports.ModalContext=g;exports.default=l;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),y=require("../../helpers/cn.cjs.js"),l=require("../../hooks/useClasses.cjs.js"),u=require("react"),q=require("../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js"),g=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),x=require("../Card/index.cjs.js"),z=require("../Portal/index.cjs.js"),C=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),v=u.createContext({size:"md",open:!1,onClose:()=>{},transitionState:"unmounted",duration:300});function c({as:t,ref:n,size:o="md",open:e=!1,onClose:a=()=>{},duration:r=300,className:f,children:p,...b}){const d=l(m=>m.modal.base),i=u.useRef(null),M=t||"div",j={entering:"active opacity-100 pointer-events-auto",entered:"active opacity-100 pointer-events-auto",exiting:"opacity-0 pointer-events-none",exited:"opacity-0 pointer-events-none",unmounted:""};return u.useImperativeHandle(n,()=>i.current),q.useHotkey("Escape",()=>a(),{enabled:e}),s.jsx(z,{children:s.jsx(C.default,{nodeRef:i,in:e,timeout:r,unmountOnExit:!0,children:m=>s.jsxs(M,{ref:i,"data-open":e,style:{transitionDuration:`${r}ms`},className:g.twMerge("modal fixed size-full inset-0 flex flex-col z-10 bg-black/20 transition-opacity backdrop-blur p-4",d,j[m],f),...b,children:[s.jsx("button",{type:"button",onClick:()=>a(),className:"absolute inset-0 cursor-default opacity-0"}),s.jsx(v.Provider,{value:{size:o,open:e,onClose:a,transitionState:m,duration:r},children:p})]})})})}function w({className:t,children:n,...o}){const e=l(d=>d.modal.dialog),{size:a,transitionState:r,duration:f}=u.useContext(v),p={entering:"scale-100",entered:"scale-100",exiting:"scale-75",exited:"scale-75",unmounted:""},b=u.useMemo(()=>{var i;return[{sm:"min-[576px]:w-[300px]",md:"min-[576px]:w-[500px]",lg:"min-[992px]:w-[800px]"}[a],(i=e==null?void 0:e.size)==null?void 0:i[a]]},[a,e==null?void 0:e.size]);return s.jsx(x,{as:"div",style:{transitionDuration:`${f}ms`},className:g.twMerge("max-w-full max-h-full m-auto transition-transform",e==null?void 0:e.base,b,p[r],t),...o,children:n})}function H({className:t,...n}){const o=l(e=>e.modal.header.base);return s.jsx(x.Header,{className:y(o,t),...n})}function N({className:t,...n}){const o=l(e=>e.modal.body.base);return s.jsx(x.Body,{className:y(o,t),...n})}function S({className:t,...n}){const o=l(e=>e.modal.footer.base);return s.jsx(x.Footer,{className:y(o,t),...n})}c.Dialog=w;c.Header=H;c.Body=N;c.Footer=S;exports.ModalContext=v;exports.default=c;
@@ -3,15 +3,13 @@ import { ComponentProps, ElementType } from 'react';
3
3
  import { TransitionStatus } from 'react-transition-group';
4
4
  type Context = {
5
5
  size: Size;
6
- open: boolean;
7
- onClose: VoidFunction;
8
6
  transitionState: TransitionStatus;
9
7
  duration: number;
10
- };
8
+ } & ToggleProps;
11
9
  type ModalProps = {
12
10
  size?: Size;
13
11
  duration?: number;
14
- } & ToggleProps;
12
+ } & Partial<ToggleProps>;
15
13
  type ModalDialogProps = Omit<ComponentProps<"div">, "as" | "ref">;
16
14
  type ModalHeaderProps = ComponentProps<"div">;
17
15
  type ModalBodyProps = ComponentProps<"div">;
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as M } from "react/jsx-runtime";
3
- import y from "../../helpers/cn.es.js";
2
+ import { jsx as a, jsxs as C } from "react/jsx-runtime";
3
+ import b from "../../helpers/cn.es.js";
4
4
  import l from "../../hooks/useClasses.es.js";
5
- import { createContext as w, useRef as N, useImperativeHandle as h, useContext as D, useMemo as k } from "react";
6
- import C from "../../hooks/useKeyDown.es.js";
7
- import { twMerge as b } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
5
+ import { createContext as M, useRef as N, useImperativeHandle as h, useContext as w, useMemo as H } from "react";
6
+ import { useHotkey as k } from "../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js";
7
+ import { twMerge as y } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
8
8
  import d from "../Card/index.es.js";
9
- import H from "../Portal/index.es.js";
9
+ import D from "../Portal/index.es.js";
10
10
  import S from "../../node_modules/react-transition-group/esm/Transition.es.js";
11
- const v = w({
11
+ const v = M({
12
12
  size: "md",
13
13
  open: !1,
14
14
  onClose: () => {
@@ -17,36 +17,31 @@ const v = w({
17
17
  duration: 300
18
18
  });
19
19
  function u({
20
- as: e,
20
+ as: t,
21
21
  ref: o,
22
22
  size: n = "md",
23
- open: t = !1,
24
- onClose: a = () => {
23
+ open: e = !1,
24
+ onClose: i = () => {
25
25
  },
26
26
  duration: r = 300,
27
27
  className: p,
28
28
  children: f,
29
29
  ...x
30
30
  }) {
31
- const m = l((c) => c.modal.base), s = N(null), g = e || "div", z = {
31
+ const m = l((c) => c.modal.base), s = N(null), g = t || "div", z = {
32
32
  entering: "active opacity-100 pointer-events-auto",
33
33
  entered: "active opacity-100 pointer-events-auto",
34
34
  exiting: "opacity-0 pointer-events-none",
35
35
  exited: "opacity-0 pointer-events-none",
36
36
  unmounted: ""
37
37
  };
38
- return h(o, () => s.current), C(
39
- () => {
40
- a == null || a();
41
- },
42
- { skip: !t, targetKey: "Escape" }
43
- ), /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(S, { nodeRef: s, in: t, timeout: r, unmountOnExit: !0, children: (c) => /* @__PURE__ */ M(
38
+ return h(o, () => s.current), k("Escape", () => i(), { enabled: e }), /* @__PURE__ */ a(D, { children: /* @__PURE__ */ a(S, { nodeRef: s, in: e, timeout: r, unmountOnExit: !0, children: (c) => /* @__PURE__ */ C(
44
39
  g,
45
40
  {
46
41
  ref: s,
47
- "data-open": t,
42
+ "data-open": e,
48
43
  style: { transitionDuration: `${r}ms` },
49
- className: b(
44
+ className: y(
50
45
  "modal fixed size-full inset-0 flex flex-col z-10 bg-black/20 transition-opacity backdrop-blur p-4",
51
46
  m,
52
47
  z[c],
@@ -54,18 +49,18 @@ function u({
54
49
  ),
55
50
  ...x,
56
51
  children: [
57
- /* @__PURE__ */ i(
52
+ /* @__PURE__ */ a(
58
53
  "button",
59
54
  {
60
55
  type: "button",
61
- onClick: () => a(),
56
+ onClick: () => i(),
62
57
  className: "absolute inset-0 cursor-default opacity-0"
63
58
  }
64
59
  ),
65
- /* @__PURE__ */ i(
60
+ /* @__PURE__ */ a(
66
61
  v.Provider,
67
62
  {
68
- value: { size: n, open: t, onClose: a, transitionState: c, duration: r },
63
+ value: { size: n, open: e, onClose: i, transitionState: c, duration: r },
69
64
  children: f
70
65
  }
71
66
  )
@@ -73,49 +68,49 @@ function u({
73
68
  }
74
69
  ) }) });
75
70
  }
76
- function B({ className: e, children: o, ...n }) {
77
- const t = l((m) => m.modal.dialog), { size: a, transitionState: r, duration: p } = D(v), f = {
71
+ function B({ className: t, children: o, ...n }) {
72
+ const e = l((m) => m.modal.dialog), { size: i, transitionState: r, duration: p } = w(v), f = {
78
73
  entering: "scale-100",
79
74
  entered: "scale-100",
80
75
  exiting: "scale-75",
81
76
  exited: "scale-75",
82
77
  unmounted: ""
83
- }, x = k(() => {
78
+ }, x = H(() => {
84
79
  var s;
85
80
  return [{
86
81
  sm: "min-[576px]:w-[300px]",
87
82
  md: "min-[576px]:w-[500px]",
88
83
  lg: "min-[992px]:w-[800px]"
89
- }[a], (s = t == null ? void 0 : t.size) == null ? void 0 : s[a]];
90
- }, [a, t == null ? void 0 : t.size]);
91
- return /* @__PURE__ */ i(
84
+ }[i], (s = e == null ? void 0 : e.size) == null ? void 0 : s[i]];
85
+ }, [i, e == null ? void 0 : e.size]);
86
+ return /* @__PURE__ */ a(
92
87
  d,
93
88
  {
94
89
  as: "div",
95
90
  style: { transitionDuration: `${p}ms` },
96
- className: b(
91
+ className: y(
97
92
  "max-w-full max-h-full m-auto transition-transform",
98
- t == null ? void 0 : t.base,
93
+ e == null ? void 0 : e.base,
99
94
  x,
100
95
  f[r],
101
- e
96
+ t
102
97
  ),
103
98
  ...n,
104
99
  children: o
105
100
  }
106
101
  );
107
102
  }
108
- function F({ className: e, ...o }) {
109
- const n = l((t) => t.modal.header.base);
110
- return /* @__PURE__ */ i(d.Header, { className: y(n, e), ...o });
103
+ function F({ className: t, ...o }) {
104
+ const n = l((e) => e.modal.header.base);
105
+ return /* @__PURE__ */ a(d.Header, { className: b(n, t), ...o });
111
106
  }
112
- function R({ className: e, ...o }) {
113
- const n = l((t) => t.modal.body.base);
114
- return /* @__PURE__ */ i(d.Body, { className: y(n, e), ...o });
107
+ function R({ className: t, ...o }) {
108
+ const n = l((e) => e.modal.body.base);
109
+ return /* @__PURE__ */ a(d.Body, { className: b(n, t), ...o });
115
110
  }
116
- function j({ className: e, ...o }) {
117
- const n = l((t) => t.modal.footer.base);
118
- return /* @__PURE__ */ i(d.Footer, { className: y(n, e), ...o });
111
+ function j({ className: t, ...o }) {
112
+ const n = l((e) => e.modal.footer.base);
113
+ return /* @__PURE__ */ a(d.Footer, { className: b(n, t), ...o });
119
114
  }
120
115
  u.Dialog = B;
121
116
  u.Header = F;
@@ -1 +1 @@
1
- "use client";"use strict";function t(e,o={block:"center",inline:"center",behavior:"smooth"}){e.scrollIntoView(o)}module.exports=t;
1
+ "use client";"use strict";function i(t,n={block:"center",inline:"center",behavior:"smooth"}){const o=typeof t=="string"?document.querySelector(t):t;o==null||o.scrollIntoView(n)}module.exports=i;
@@ -1 +1 @@
1
- export default function scrollIntoView(element: HTMLElement, option?: ScrollIntoViewOptions): void;
1
+ export default function scrollIntoView(el: HTMLElement | string, option?: ScrollIntoViewOptions | boolean | undefined): void;
@@ -1,11 +1,12 @@
1
1
  "use client";
2
- function n(e, o = {
2
+ function i(t, n = {
3
3
  block: "center",
4
4
  inline: "center",
5
5
  behavior: "smooth"
6
6
  }) {
7
- e.scrollIntoView(o);
7
+ const o = typeof t == "string" ? document.querySelector(t) : t;
8
+ o == null || o.scrollIntoView(n);
8
9
  }
9
10
  export {
10
- n as default
11
+ i as default
11
12
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useClasses.cjs.js"),s=require("./useCreateRipple.cjs.js"),u=require("./useDebounce.cjs.js"),t=require("./useDocumentVisible.cjs.js"),r=require("./useIsOffline.cjs.js"),i=require("./useKeyDown.cjs.js"),o=require("./usePersistedState.cjs.js"),n=require("./useToggle.cjs.js");exports.useClasses=e;exports.useCreateRipple=s;exports.useDebounce=u;exports.useDocumentVisible=t;exports.useIsOffline=r;exports.useKeyDown=i;exports.usePersistedState=o;exports.useToggle=n;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useClasses.cjs.js"),s=require("./useCreateRipple.cjs.js"),u=require("./useDebounce.cjs.js"),t=require("./useDocumentVisible.cjs.js"),r=require("./useIsOffline.cjs.js"),i=require("./usePersistedState.cjs.js"),o=require("./useToggle.cjs.js");exports.useClasses=e;exports.useCreateRipple=s;exports.useDebounce=u;exports.useDocumentVisible=t;exports.useIsOffline=r;exports.usePersistedState=i;exports.useToggle=o;