reaxify 0.0.58 → 0.0.60

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";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
+ };
@@ -1,4 +1,4 @@
1
1
  import { Dispatch, RefObject } from 'react';
2
- type Ref = RefObject<HTMLElement> | HTMLElement | null;
2
+ type Ref = RefObject<HTMLElement | null> | HTMLElement | null;
3
3
  export default function useOutsideClick(ref: Ref, callback: Dispatch<MouseEvent>): void;
4
4
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaxify",
3
3
  "private": false,
4
- "version": "0.0.58",
4
+ "version": "0.0.60",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "files": [