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.
- package/dist/components/Drawer/index.cjs.js +1 -1
- package/dist/components/Drawer/index.es.js +22 -22
- package/dist/helpers/index.cjs.js +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.es.js +13 -11
- package/dist/helpers/scrollIntoView.cjs.js +1 -0
- package/dist/helpers/scrollIntoView.d.ts +1 -0
- package/dist/helpers/scrollIntoView.es.js +11 -0
- package/dist/hooks/useOutsideClick.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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"),
|
|
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
|
|
6
|
-
import
|
|
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
|
|
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 = (
|
|
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:
|
|
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: "
|
|
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
|
|
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:
|
|
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
|
|
142
|
+
function B({ className: o, ...e }) {
|
|
143
143
|
const n = u((t) => t.drawer.header.base);
|
|
144
|
-
return /* @__PURE__ */ s.jsx(c.Header, { className:
|
|
144
|
+
return /* @__PURE__ */ s.jsx(c.Header, { className: v(n, o), ...e });
|
|
145
145
|
}
|
|
146
|
-
function
|
|
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:
|
|
151
|
+
className: v("flex-1 overflow-auto", n, o),
|
|
152
152
|
...e
|
|
153
153
|
}
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function H({ className: o, ...e }) {
|
|
157
157
|
const n = u((t) => t.drawer.footer.base);
|
|
158
|
-
return /* @__PURE__ */ s.jsx(c.Footer, { className:
|
|
158
|
+
return /* @__PURE__ */ s.jsx(c.Footer, { className: v(n, o), ...e });
|
|
159
159
|
}
|
|
160
|
-
m.Menu =
|
|
161
|
-
m.Header =
|
|
162
|
-
m.Body =
|
|
163
|
-
m.Footer =
|
|
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"),
|
|
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;
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/helpers/index.es.js
CHANGED
|
@@ -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
|
|
5
|
-
import { isEmpty as p, isEmptyArray as
|
|
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
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
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
|
-
|
|
17
|
+
s as getByPath,
|
|
17
18
|
p as isEmpty,
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|