reaxify 0.0.57 → 0.0.59

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.
@@ -1 +1 @@
1
- "use client";"use strict";const I=require("../helpers/wait.cjs.js"),L=require("axios"),r=require("react"),J=require("./AxiosProvider.cjs.js");function K(e=null){const w="Canceled.",u=r.useContext(J.AxiosContext),k=r.useRef([]),h=r.useRef(new Map),E=r.useRef(0),[T,N]=r.useTransition(),d=r.useMemo(()=>{const t={...u.config,...e==null?void 0:e.config};return L.create(t)},[u.config,e==null?void 0:e.config]),y=r.useMemo(()=>typeof(e==null?void 0:e.cancelDuplicatedRequests)=="boolean"?e.cancelDuplicatedRequests:u.cancelDuplicatedRequests??!1,[u.cancelDuplicatedRequests,e==null?void 0:e.cancelDuplicatedRequests]),R=r.useMemo(()=>typeof(e==null?void 0:e.cancelOnUnmount)=="boolean"?e.cancelOnUnmount:u.cancelOnUnmount??!1,[e==null?void 0:e.cancelOnUnmount,u.cancelOnUnmount]),a=r.useMemo(()=>!(u!=null&&u.retry)&&!(e!=null&&e.retry)?null:{count:0,delay:0,statuses:[],...u.retry,...e==null?void 0:e.retry},[e==null?void 0:e.retry,u.retry]),[_,z]=r.useState([]),[F,v]=r.useState(null),D=r.useCallback(t=>{var s;if(!y&&!R)return t;const c=`${t.method}-${t.url}`,n=new AbortController;return y&&h.current.has(c)&&((s=h.current.get(c))==null||s.abort(w)),(y||R)&&(t.signal=n.signal),y&&h.current.set(c,n),R&&k.current.push(n),t},[y,R]),m=r.useCallback(t=>{if(!t)return;const c=`${t.method}-${t.url}`;h.current.delete(c)},[]),p=r.useCallback(t=>{N(()=>{z(c=>{const n=[...c];return t?n.push(""):n.pop(),n})})},[]),P=r.useCallback(t=>{const c=[...u.beforeRequest,...(e==null?void 0:e.beforeRequest)??[]];return c.length?c.reduce(async(n,s)=>{const l=await n;return await s(l)??l},Promise.resolve(t)):t},[u.beforeRequest,e==null?void 0:e.beforeRequest]),H=r.useCallback(t=>{const c=[...u.afterResponse,...(e==null?void 0:e.afterResponse)??[]];return c.length?c.reduce(async(n,s)=>{const l=await n;return await s(l)??l},Promise.resolve(t)):t},[u.afterResponse,e==null?void 0:e.afterResponse]),A=r.useCallback(t=>{const c=[...u.afterError,...(e==null?void 0:e.afterError)??[]];return c.length?c.reduce(async(n,s)=>{const l=await n;return await s(l)??l},Promise.resolve(t)):t},[u.afterError,e==null?void 0:e.afterError]),M=r.useCallback(t=>{const c=[...u.beforeRetry,...(e==null?void 0:e.beforeRetry)??[]];return c.length?c.reduce(async(n,s)=>{const l=await n;return await s(l)??l},Promise.resolve(t)):t},[u.beforeRetry,e==null?void 0:e.beforeRetry]),O=r.useCallback(t=>{if(!a)return!1;const c=a.count??0,n=a.statuses??[];return!(E.current>=c||!n.includes(t))},[a]),U=r.useCallback(()=>{E.current++},[]),q=r.useCallback(()=>{E.current=0},[]),j=r.useCallback(async t=>{p(!0),v(null);const c=D(t);return await P(c)},[D,p,P]),$=r.useCallback(async t=>{m(t.config);const c=await H(t);return p(!1),v(null),q(),c},[p,H,m,q]),S=r.useCallback(async t=>{var l,b,B;const c=[(t==null?void 0:t.code)==="ERR_CANCELED",((b=(l=t==null?void 0:t.config)==null?void 0:l.signal)==null?void 0:b.reason)===w].some(Boolean),n=((B=t==null?void 0:t.response)==null?void 0:B.status)??0;if(!c&&O(n)){a!=null&&a.delay&&await I(a.delay);const G=await M(t==null?void 0:t.config);return U(),L.request(G).then(Promise.resolve).catch(Promise.reject).finally(()=>{p(!1)})}!c&&m(t==null?void 0:t.config);const s=await A(t);return p(!1),q(),!c&&v(s),Promise.reject(s)},[p,A,m,M,O,q,U,a==null?void 0:a.delay]);return r.useEffect(()=>{const t=d.interceptors.request.use(j),c=d.interceptors.response.use($,S);return()=>{d.interceptors.request.eject(t),d.interceptors.response.eject(c)}},[d.interceptors.request,d.interceptors.response,j,$,S]),r.useEffect(()=>()=>{R&&(k.current.forEach(t=>{t.abort(w)}),k.current=[])},[R]),[d,!!_.length||T,F]}module.exports=K;
1
+ "use client";"use strict";const G=require("../helpers/wait.cjs.js"),I=require("axios"),r=require("react"),J=require("./AxiosProvider.cjs.js");function K(e=null){const w="Canceled.",n=r.useContext(J.AxiosContext),k=r.useRef([]),h=r.useRef(new Map),E=r.useRef(0),[L,T]=r.useTransition(),d=r.useMemo(()=>{const t={...n.config,...e==null?void 0:e.config};return I.create(t)},[n.config,e==null?void 0:e.config]),y=r.useMemo(()=>typeof(e==null?void 0:e.cancelDuplicatedRequests)=="boolean"?e.cancelDuplicatedRequests:n.cancelDuplicatedRequests??!1,[n.cancelDuplicatedRequests,e==null?void 0:e.cancelDuplicatedRequests]),R=r.useMemo(()=>typeof(e==null?void 0:e.cancelOnUnmount)=="boolean"?e.cancelOnUnmount:n.cancelOnUnmount??!1,[e==null?void 0:e.cancelOnUnmount,n.cancelOnUnmount]),a=r.useMemo(()=>!(n!=null&&n.retry)&&!(e!=null&&e.retry)?null:{count:0,delay:0,statuses:[],...n.retry,...e==null?void 0:e.retry},[e==null?void 0:e.retry,n.retry]),[N,_]=r.useState([]),[z,D]=r.useState(null),v=r.useCallback(t=>{var s;if(!y&&!R)return t;const c=`${t.method}-${t.url}`,u=new AbortController;return y&&h.current.has(c)&&((s=h.current.get(c))==null||s.abort(w)),(y||R)&&(t.signal=u.signal),y&&h.current.set(c,u),R&&k.current.push(u),t},[y,R]),m=r.useCallback(t=>{if(!t)return;const c=`${t.method}-${t.url}`;h.current.delete(c)},[]),p=r.useCallback(t=>{T(()=>{_(c=>{const u=[...c];return t?u.push(""):u.pop(),u})})},[]),H=r.useCallback(t=>{const c=[...n.beforeRequest,...(e==null?void 0:e.beforeRequest)??[]];return c.length?c.reduce(async(u,s)=>{const l=await u;return await s(l)??l},Promise.resolve(t)):t},[n.beforeRequest,e==null?void 0:e.beforeRequest]),P=r.useCallback(t=>{const c=[...n.afterResponse,...(e==null?void 0:e.afterResponse)??[]];return c.length?c.reduce(async(u,s)=>{const l=await u;return await s(l)??l},Promise.resolve(t)):t},[n.afterResponse,e==null?void 0:e.afterResponse]),A=r.useCallback(t=>{const c=[...n.afterError,...(e==null?void 0:e.afterError)??[]];return c.length?c.reduce(async(u,s)=>{const l=await u;return await s(l)??l},Promise.resolve(t)):t},[n.afterError,e==null?void 0:e.afterError]),M=r.useCallback(t=>{const c=[...n.beforeRetry,...(e==null?void 0:e.beforeRetry)??[]];return c.length?c.reduce(async(u,s)=>{const l=await u;return await s(l)??l},Promise.resolve(t)):t},[n.beforeRetry,e==null?void 0:e.beforeRetry]),O=r.useCallback(t=>{if(!a)return!1;const c=a.count??0,u=a.statuses??[];return!(E.current>=c||!u.includes(t))},[a]),U=r.useCallback(()=>{E.current++},[]),q=r.useCallback(()=>{E.current=0},[]),$=r.useCallback(async t=>{p(!0),D(null);const c=v(t);return await H(c)},[v,p,H]),j=r.useCallback(async t=>{m(t.config);const c=await P(t);return p(!1),D(null),q(),c},[p,P,m,q]),S=r.useCallback(async t=>{var l,b,B;const c=[(t==null?void 0:t.code)==="ERR_CANCELED",((b=(l=t==null?void 0:t.config)==null?void 0:l.signal)==null?void 0:b.reason)===w].some(Boolean),u=((B=t==null?void 0:t.response)==null?void 0:B.status)??0;if(!c&&O(u)){a!=null&&a.delay&&await G(a.delay);const F=await M(t==null?void 0:t.config);return U(),d.request(F).finally(()=>p(!1))}!c&&m(t==null?void 0:t.config);const s=await A(t);return p(!1),q(),!c&&D(s),Promise.reject(s)},[p,A,m,M,O,q,U,a==null?void 0:a.delay]);return r.useEffect(()=>{const t=d.interceptors.request.use($),c=d.interceptors.response.use(j,S);return()=>{d.interceptors.request.eject(t),d.interceptors.response.eject(c)}},[d.interceptors.request,d.interceptors.response,$,j,S]),r.useEffect(()=>()=>{R&&(k.current.forEach(t=>{t.abort(w)}),k.current=[])},[R]),[d,!!N.length||L,z]}module.exports=K;
@@ -1,22 +1,22 @@
1
1
  "use client";
2
- import V from "../helpers/wait.es.js";
3
- import N from "axios";
4
- import { useContext as W, useRef as P, useTransition as X, useMemo as q, useState as _, useCallback as s, useEffect as z } from "react";
2
+ import Q from "../helpers/wait.es.js";
3
+ import V from "axios";
4
+ import { useContext as W, useRef as O, useTransition as X, useMemo as q, useState as N, useCallback as s, useEffect as _ } from "react";
5
5
  import { AxiosContext as Y } from "./AxiosProvider.es.js";
6
6
  function C(e = null) {
7
- const E = "Canceled.", n = W(Y), D = P([]), h = P(/* @__PURE__ */ new Map()), v = P(0), [F, G] = X(), d = q(() => {
7
+ const E = "Canceled.", n = W(Y), D = O([]), h = O(/* @__PURE__ */ new Map()), v = O(0), [z, F] = X(), a = q(() => {
8
8
  const t = { ...n.config, ...e == null ? void 0 : e.config };
9
- return N.create(t);
9
+ return V.create(t);
10
10
  }, [n.config, e == null ? void 0 : e.config]), m = q(() => typeof (e == null ? void 0 : e.cancelDuplicatedRequests) == "boolean" ? e.cancelDuplicatedRequests : n.cancelDuplicatedRequests ?? !1, [
11
11
  n.cancelDuplicatedRequests,
12
12
  e == null ? void 0 : e.cancelDuplicatedRequests
13
- ]), R = q(() => typeof (e == null ? void 0 : e.cancelOnUnmount) == "boolean" ? e.cancelOnUnmount : n.cancelOnUnmount ?? !1, [e == null ? void 0 : e.cancelOnUnmount, n.cancelOnUnmount]), a = q(() => !(n != null && n.retry) && !(e != null && e.retry) ? null : {
13
+ ]), R = q(() => typeof (e == null ? void 0 : e.cancelOnUnmount) == "boolean" ? e.cancelOnUnmount : n.cancelOnUnmount ?? !1, [e == null ? void 0 : e.cancelOnUnmount, n.cancelOnUnmount]), d = q(() => !(n != null && n.retry) && !(e != null && e.retry) ? null : {
14
14
  count: 0,
15
15
  delay: 0,
16
16
  statuses: [],
17
17
  ...n.retry,
18
18
  ...e == null ? void 0 : e.retry
19
- }, [e == null ? void 0 : e.retry, n.retry]), [I, J] = _([]), [K, H] = _(null), O = s(
19
+ }, [e == null ? void 0 : e.retry, n.retry]), [G, I] = N([]), [J, H] = N(null), P = s(
20
20
  (t) => {
21
21
  var l;
22
22
  if (!m && !R) return t;
@@ -32,8 +32,8 @@ function C(e = null) {
32
32
  },
33
33
  []
34
34
  ), p = s((t) => {
35
- G(() => {
36
- J((r) => {
35
+ F(() => {
36
+ I((r) => {
37
37
  const c = [...r];
38
38
  return t ? c.push("") : c.pop(), c;
39
39
  });
@@ -62,7 +62,7 @@ function C(e = null) {
62
62
  }, Promise.resolve(t)) : t;
63
63
  },
64
64
  [n.afterResponse, e == null ? void 0 : e.afterResponse]
65
- ), j = s(
65
+ ), $ = s(
66
66
  (t) => {
67
67
  const r = [
68
68
  ...n.afterError,
@@ -74,7 +74,7 @@ function C(e = null) {
74
74
  }, Promise.resolve(t)) : t;
75
75
  },
76
76
  [n.afterError, e == null ? void 0 : e.afterError]
77
- ), $ = s(
77
+ ), j = s(
78
78
  (t) => {
79
79
  const r = [
80
80
  ...n.beforeRetry,
@@ -88,11 +88,11 @@ function C(e = null) {
88
88
  [n.beforeRetry, e == null ? void 0 : e.beforeRetry]
89
89
  ), k = s(
90
90
  (t) => {
91
- if (!a) return !1;
92
- const r = a.count ?? 0, c = a.statuses ?? [];
91
+ if (!d) return !1;
92
+ const r = d.count ?? 0, c = d.statuses ?? [];
93
93
  return !(v.current >= r || !c.includes(t));
94
94
  },
95
- [a]
95
+ [d]
96
96
  ), M = s(() => {
97
97
  v.current++;
98
98
  }, []), w = s(() => {
@@ -100,10 +100,10 @@ function C(e = null) {
100
100
  }, []), B = s(
101
101
  async (t) => {
102
102
  p(!0), H(null);
103
- const r = O(t);
103
+ const r = P(t);
104
104
  return await U(r);
105
105
  },
106
- [O, p, U]
106
+ [P, p, U]
107
107
  ), L = s(
108
108
  async (t) => {
109
109
  b(t.config);
@@ -124,43 +124,41 @@ function C(e = null) {
124
124
  ((y = (u = t == null ? void 0 : t.config) == null ? void 0 : u.signal) == null ? void 0 : y.reason) === E
125
125
  ].some(Boolean), c = ((T = t == null ? void 0 : t.response) == null ? void 0 : T.status) ?? 0;
126
126
  if (!r && k(c)) {
127
- a != null && a.delay && await V(a.delay);
128
- const Q = await $(t == null ? void 0 : t.config);
129
- return M(), N.request(Q).then(Promise.resolve).catch(Promise.reject).finally(() => {
130
- p(!1);
131
- });
127
+ d != null && d.delay && await Q(d.delay);
128
+ const K = await j(t == null ? void 0 : t.config);
129
+ return M(), a.request(K).finally(() => p(!1));
132
130
  }
133
131
  !r && b(t == null ? void 0 : t.config);
134
- const l = await j(t);
132
+ const l = await $(t);
135
133
  return p(!1), w(), !r && H(l), Promise.reject(l);
136
134
  },
137
135
  [
138
136
  p,
139
- j,
140
- b,
141
137
  $,
138
+ b,
139
+ j,
142
140
  k,
143
141
  w,
144
142
  M,
145
- a == null ? void 0 : a.delay
143
+ d == null ? void 0 : d.delay
146
144
  ]
147
145
  );
148
- return z(() => {
149
- const t = d.interceptors.request.use(B), r = d.interceptors.response.use(L, S);
146
+ return _(() => {
147
+ const t = a.interceptors.request.use(B), r = a.interceptors.response.use(L, S);
150
148
  return () => {
151
- d.interceptors.request.eject(t), d.interceptors.response.eject(r);
149
+ a.interceptors.request.eject(t), a.interceptors.response.eject(r);
152
150
  };
153
151
  }, [
154
- d.interceptors.request,
155
- d.interceptors.response,
152
+ a.interceptors.request,
153
+ a.interceptors.response,
156
154
  B,
157
155
  L,
158
156
  S
159
- ]), z(() => () => {
157
+ ]), _(() => () => {
160
158
  R && (D.current.forEach((t) => {
161
159
  t.abort(E);
162
160
  }), D.current = []);
163
- }, [R]), [d, !!I.length || F, K];
161
+ }, [R]), [a, !!G.length || z, J];
164
162
  }
165
163
  export {
166
164
  C as default
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../node_modules/react/jsx-runtime.cjs.js"),l=require("react"),c=require("../../hooks/useClasses.cjs.js"),h=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),j=require("../../helpers/cn.cjs.js"),m=require("../Card/index.cjs.js"),C=require("../Portal/index.cjs.js"),E=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),v=l.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function d({as:o,open:t=!1,onClose:n=()=>{},duration:e=300,anchor:a="end",className:f="",children:w,...p}){const r=c(u=>u.drawer),i=l.useRef(null),y=o||"div",x={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:""},R=l.useMemo(()=>{var b;const u={start:"flex-row-reverse",end:"flex-row",top:"flex-col-reverse",bottom:"flex-col"},g=(b=r==null?void 0:r.anchor)==null?void 0:b[a];return[u[a],g]},[a,r==null?void 0:r.anchor]);return s.jsxRuntimeExports.jsx(C,{children:s.jsxRuntimeExports.jsx(E.default,{nodeRef:i,in:t,timeout:e,unmountOnExit:!0,children:u=>s.jsxRuntimeExports.jsxs(y,{ref:i,style:{transitionDuration:`${e}ms`},"data-open":t,className:h.twMerge("fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",r==null?void 0:r.base,x[u],R,f),...p,children:[s.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>n(),className:"h-full flex-1 opacity-0 cursor-default min-w-[5%]"}),s.jsxRuntimeExports.jsx(v.Provider,{value:{open:t,onClose:n,transitionState:u,duration:e,anchor:a},children:w})]})})})}function M({children:o,className:t="",...n}){const e=c(i=>i.drawer.menu),{anchor:a,duration:f,transitionState:w}=l.useContext(v),p=l.useMemo(()=>{var x;const i={start:"w-[31.875rem] h-full max-w-[97.5%] rounded-e",end:"w-[31.875rem] h-full max-w-[97.5%] rounded-s",top:"w-full h-[31.875rem] max-h-[97.5%] rounded-b",bottom:"w-full h-[31.875rem] max-h-[97.5%] rounded-t"},y=(x=e==null?void 0:e.anchor)==null?void 0:x[a];return[i[a],y]},[a,e==null?void 0:e.anchor]),r=l.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:""}})[a],[a]);return s.jsxRuntimeExports.jsx(m,{as:"div",style:{transitionDuration:`${f}ms`},className:h.twMerge("relative flex flex-col transition-[translate,width] rounded-none",e==null?void 0:e.base,r[w],p,t),...n,children:o})}function D({className:o,...t}){const n=c(e=>e.drawer.header.base);return s.jsxRuntimeExports.jsx(m.Header,{className:j(n,o),...t})}function q({className:o,...t}){const n=c(e=>e.drawer.body.base);return s.jsxRuntimeExports.jsx(m.Body,{className:j("flex-1 overflow-auto",n,o),...t})}function N({className:o,...t}){const n=c(e=>e.drawer.footer.base);return s.jsxRuntimeExports.jsx(m.Footer,{className:j(n,o),...t})}d.Menu=M;d.Header=D;d.Body=q;d.Footer=N;exports.DrawerContext=v;exports.default=d;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../../node_modules/react/jsx-runtime.cjs.js"),l=require("react"),c=require("../../hooks/useClasses.cjs.js"),h=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),b=require("../../helpers/cn.cjs.js"),m=require("../Card/index.cjs.js"),C=require("../Portal/index.cjs.js"),E=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),j=l.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function d({as:o,open:t=!1,onClose:n=()=>{},duration:e=300,anchor:a="end",className:f="",children:w,...p}){const r=c(u=>u.drawer),i=l.useRef(null),y=o||"div",x={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:""},R=l.useMemo(()=>{var v;const u={start:"flex-row-reverse",end:"flex-row",top:"flex-col-reverse",bottom:"flex-col"},g=(v=r==null?void 0:r.anchor)==null?void 0:v[a];return[u[a],g]},[a,r==null?void 0:r.anchor]);return s.jsxRuntimeExports.jsx(C,{children:s.jsxRuntimeExports.jsx(E.default,{nodeRef:i,in:t,timeout:e,unmountOnExit:!0,children:u=>s.jsxRuntimeExports.jsxs(y,{ref:i,style:{transitionDuration:`${e}ms`},"data-open":t,className:h.twMerge("fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",r==null?void 0:r.base,x[u],R,f),...p,children:[s.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>n(),className:"absolute inset-0 size-full cursor-default opacity-0"}),s.jsxRuntimeExports.jsx(j.Provider,{value:{open:t,onClose:n,transitionState:u,duration:e,anchor:a},children:w})]})})})}function M({children:o,className:t="",...n}){const e=c(i=>i.drawer.menu),{anchor:a,duration:f,transitionState:w}=l.useContext(j),p=l.useMemo(()=>{var x;const i={start:"w-[31.875rem] h-full max-w-[97.5%] rounded-e me-auto",end:"w-[31.875rem] h-full max-w-[97.5%] rounded-s ms-auto",top:"w-full h-[31.875rem] max-h-[97.5%] rounded-b mb-auto",bottom:"w-full h-[31.875rem] max-h-[97.5%] rounded-t mt-auto"},y=(x=e==null?void 0:e.anchor)==null?void 0:x[a];return[i[a],y]},[a,e==null?void 0:e.anchor]),r=l.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:""}})[a],[a]);return s.jsxRuntimeExports.jsx(m,{as:"div",style:{transitionDuration:`${f}ms`},className:h.twMerge("relative flex flex-col transition-[translate,width] rounded-none",e==null?void 0:e.base,r[w],p,t),...n,children:o})}function D({className:o,...t}){const n=c(e=>e.drawer.header.base);return s.jsxRuntimeExports.jsx(m.Header,{className:b(n,o),...t})}function q({className:o,...t}){const n=c(e=>e.drawer.body.base);return s.jsxRuntimeExports.jsx(m.Body,{className:b("flex-1 overflow-auto",n,o),...t})}function N({className:o,...t}){const n=c(e=>e.drawer.footer.base);return s.jsxRuntimeExports.jsx(m.Footer,{className:b(n,o),...t})}d.Menu=M;d.Header=D;d.Body=q;d.Footer=N;exports.DrawerContext=j;exports.default=d;
@@ -2,8 +2,8 @@
2
2
  import { j as s } from "../../node_modules/react/jsx-runtime.es.js";
3
3
  import { createContext as D, useRef as R, useMemo as y, useContext as N } from "react";
4
4
  import u from "../../hooks/useClasses.es.js";
5
- import { twMerge as b } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
6
- import h from "../../helpers/cn.es.js";
5
+ import { twMerge as h } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
6
+ import v from "../../helpers/cn.es.js";
7
7
  import c from "../Card/index.es.js";
8
8
  import M from "../Portal/index.es.js";
9
9
  import k from "../../node_modules/react-transition-group/esm/Transition.es.js";
@@ -33,13 +33,13 @@ function m({
33
33
  exited: "opacity-0 pointer-events-none",
34
34
  unmounted: ""
35
35
  }, j = y(() => {
36
- var v;
36
+ var b;
37
37
  const l = {
38
38
  start: "flex-row-reverse",
39
39
  end: "flex-row",
40
40
  top: "flex-col-reverse",
41
41
  bottom: "flex-col"
42
- }, C = (v = r == null ? void 0 : r.anchor) == null ? void 0 : v[a];
42
+ }, C = (b = r == null ? void 0 : r.anchor) == null ? void 0 : b[a];
43
43
  return [l[a], C];
44
44
  }, [a, r == null ? void 0 : r.anchor]);
45
45
  return /* @__PURE__ */ s.jsx(M, { children: /* @__PURE__ */ s.jsx(k, { nodeRef: i, in: e, timeout: t, unmountOnExit: !0, children: (l) => /* @__PURE__ */ s.jsxs(
@@ -48,7 +48,7 @@ function m({
48
48
  ref: i,
49
49
  style: { transitionDuration: `${t}ms` },
50
50
  "data-open": e,
51
- className: b(
51
+ className: h(
52
52
  "fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",
53
53
  r == null ? void 0 : r.base,
54
54
  d[l],
@@ -62,7 +62,7 @@ function m({
62
62
  {
63
63
  type: "button",
64
64
  onClick: () => n(),
65
- className: "h-full flex-1 opacity-0 cursor-default min-w-[5%]"
65
+ className: "absolute inset-0 size-full cursor-default opacity-0"
66
66
  }
67
67
  ),
68
68
  /* @__PURE__ */ s.jsx(
@@ -82,14 +82,14 @@ function m({
82
82
  }
83
83
  ) }) });
84
84
  }
85
- function B({ children: o, className: e = "", ...n }) {
85
+ function z({ children: o, className: e = "", ...n }) {
86
86
  const t = u((i) => i.drawer.menu), { anchor: a, duration: x, transitionState: f } = N(g), w = y(() => {
87
87
  var d;
88
88
  const i = {
89
- start: "w-[31.875rem] h-full max-w-[97.5%] rounded-e",
90
- end: "w-[31.875rem] h-full max-w-[97.5%] rounded-s",
91
- top: "w-full h-[31.875rem] max-h-[97.5%] rounded-b",
92
- bottom: "w-full h-[31.875rem] max-h-[97.5%] rounded-t"
89
+ start: "w-[31.875rem] h-full max-w-[97.5%] rounded-e me-auto",
90
+ end: "w-[31.875rem] h-full max-w-[97.5%] rounded-s ms-auto",
91
+ top: "w-full h-[31.875rem] max-h-[97.5%] rounded-b mb-auto",
92
+ bottom: "w-full h-[31.875rem] max-h-[97.5%] rounded-t mt-auto"
93
93
  }, p = (d = t == null ? void 0 : t.anchor) == null ? void 0 : d[a];
94
94
  return [i[a], p];
95
95
  }, [a, t == null ? void 0 : t.anchor]), r = y(() => ({
@@ -127,7 +127,7 @@ function B({ children: o, className: e = "", ...n }) {
127
127
  {
128
128
  as: "div",
129
129
  style: { transitionDuration: `${x}ms` },
130
- className: b(
130
+ className: h(
131
131
  "relative flex flex-col transition-[translate,width] rounded-none",
132
132
  t == null ? void 0 : t.base,
133
133
  r[f],
@@ -139,28 +139,28 @@ function B({ children: o, className: e = "", ...n }) {
139
139
  }
140
140
  );
141
141
  }
142
- function F({ className: o, ...e }) {
142
+ function B({ className: o, ...e }) {
143
143
  const n = u((t) => t.drawer.header.base);
144
- return /* @__PURE__ */ s.jsx(c.Header, { className: h(n, o), ...e });
144
+ return /* @__PURE__ */ s.jsx(c.Header, { className: v(n, o), ...e });
145
145
  }
146
- function H({ className: o, ...e }) {
146
+ function F({ className: o, ...e }) {
147
147
  const n = u((t) => t.drawer.body.base);
148
148
  return /* @__PURE__ */ s.jsx(
149
149
  c.Body,
150
150
  {
151
- className: h("flex-1 overflow-auto", n, o),
151
+ className: v("flex-1 overflow-auto", n, o),
152
152
  ...e
153
153
  }
154
154
  );
155
155
  }
156
- function S({ className: o, ...e }) {
156
+ function H({ className: o, ...e }) {
157
157
  const n = u((t) => t.drawer.footer.base);
158
- return /* @__PURE__ */ s.jsx(c.Footer, { className: h(n, o), ...e });
158
+ return /* @__PURE__ */ s.jsx(c.Footer, { className: v(n, o), ...e });
159
159
  }
160
- m.Menu = B;
161
- m.Header = F;
162
- m.Body = H;
163
- m.Footer = S;
160
+ m.Menu = z;
161
+ m.Header = B;
162
+ m.Body = F;
163
+ m.Footer = H;
164
164
  export {
165
165
  g as DrawerContext,
166
166
  m as default
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./cn.cjs.js"),t=require("./copy.cjs.js"),i=require("./getByPath.cjs.js"),e=require("./isEmpty.cjs.js"),s=require("./isServer.cjs.js"),c=require("./matrixArray.cjs.js"),n=require("./randomID.cjs.js"),o=require("./replaceNonDigits.cjs.js"),a=require("./replacePersianNumbers.cjs.js"),u=require("./twoDigitNumber.cjs.js"),y=require("./wait.cjs.js");exports.cn=r;exports.copy=t;exports.getByPath=i;exports.isEmpty=e.isEmpty;exports.isEmptyArray=e.isEmptyArray;exports.isEmptyObject=e.isEmptyObject;exports.isEmptyString=e.isEmptyString;exports.isEmptyValue=e.isEmptyValue;exports.isServer=s;exports.matrixArray=c;exports.randomID=n;exports.replaceNonDigits=o;exports.replacePersianNumbers=a;exports.twoDigitNumber=u;exports.wait=y;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./cn.cjs.js"),t=require("./copy.cjs.js"),i=require("./getByPath.cjs.js"),e=require("./isEmpty.cjs.js"),s=require("./isServer.cjs.js"),o=require("./matrixArray.cjs.js"),c=require("./randomID.cjs.js"),n=require("./replaceNonDigits.cjs.js"),a=require("./replacePersianNumbers.cjs.js"),u=require("./scrollIntoView.cjs.js"),y=require("./twoDigitNumber.cjs.js"),m=require("./wait.cjs.js");exports.cn=r;exports.copy=t;exports.getByPath=i;exports.isEmpty=e.isEmpty;exports.isEmptyArray=e.isEmptyArray;exports.isEmptyObject=e.isEmptyObject;exports.isEmptyString=e.isEmptyString;exports.isEmptyValue=e.isEmptyValue;exports.isServer=s;exports.matrixArray=o;exports.randomID=c;exports.replaceNonDigits=n;exports.replacePersianNumbers=a;exports.scrollIntoView=u;exports.twoDigitNumber=y;exports.wait=m;
@@ -7,5 +7,6 @@ export { default as matrixArray } from './matrixArray';
7
7
  export { default as randomID } from './randomID';
8
8
  export { default as replaceNonDigits } from './replaceNonDigits';
9
9
  export { default as replacePersianNumbers } from './replacePersianNumbers';
10
+ export { default as scrollIntoView } from './scrollIntoView';
10
11
  export { default as twoDigitNumber } from './twoDigitNumber';
11
12
  export { default as wait } from './wait';
@@ -1,29 +1,31 @@
1
1
  "use client";
2
2
  import { default as e } from "./cn.es.js";
3
3
  import { default as o } from "./copy.es.js";
4
- import { default as m } from "./getByPath.es.js";
5
- import { isEmpty as p, isEmptyArray as i, isEmptyObject as l, isEmptyString as u, isEmptyValue as x } from "./isEmpty.es.js";
4
+ import { default as s } from "./getByPath.es.js";
5
+ import { isEmpty as p, isEmptyArray as l, isEmptyObject as i, isEmptyString as u, isEmptyValue as x } from "./isEmpty.es.js";
6
6
  import { default as y } from "./isServer.es.js";
7
7
  import { default as n } from "./matrixArray.es.js";
8
8
  import { default as g } from "./randomID.es.js";
9
- import { default as D } from "./replaceNonDigits.es.js";
10
- import { default as w } from "./replacePersianNumbers.es.js";
11
- import { default as P } from "./twoDigitNumber.es.js";
9
+ import { default as w } from "./replaceNonDigits.es.js";
10
+ import { default as N } from "./replacePersianNumbers.es.js";
11
+ import { default as I } from "./scrollIntoView.es.js";
12
+ import { default as S } from "./twoDigitNumber.es.js";
12
13
  import { default as h } from "./wait.es.js";
13
14
  export {
14
15
  e as cn,
15
16
  o as copy,
16
- m as getByPath,
17
+ s as getByPath,
17
18
  p as isEmpty,
18
- i as isEmptyArray,
19
- l as isEmptyObject,
19
+ l as isEmptyArray,
20
+ i as isEmptyObject,
20
21
  u as isEmptyString,
21
22
  x as isEmptyValue,
22
23
  y as isServer,
23
24
  n as matrixArray,
24
25
  g as randomID,
25
- D as replaceNonDigits,
26
- w as replacePersianNumbers,
27
- P as twoDigitNumber,
26
+ w as replaceNonDigits,
27
+ N as replacePersianNumbers,
28
+ I as scrollIntoView,
29
+ S as twoDigitNumber,
28
30
  h as wait
29
31
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";function t(e,o={block:"center",inline:"center",behavior:"smooth"}){e.scrollIntoView(o)}module.exports=t;
@@ -0,0 +1 @@
1
+ export default function scrollIntoView(element: HTMLElement, option?: ScrollIntoViewOptions): void;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ function n(e, o = {
3
+ block: "center",
4
+ inline: "center",
5
+ behavior: "smooth"
6
+ }) {
7
+ e.scrollIntoView(o);
8
+ }
9
+ export {
10
+ n as default
11
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaxify",
3
3
  "private": false,
4
- "version": "0.0.57",
4
+ "version": "0.0.59",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "files": [