reaxify 0.0.85 → 0.0.87
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/Alert/index.cjs.js +1 -0
- package/dist/components/Alert/index.es.js +8 -0
- package/dist/components/Badge/index.cjs.js +1 -1
- package/dist/components/Badge/index.es.js +36 -36
- package/dist/components/Button/index.cjs.js +1 -1
- package/dist/components/Button/index.es.js +75 -57
- package/dist/components/Drawer/index.cjs.js +1 -1
- package/dist/components/Drawer/index.es.js +73 -64
- package/dist/components/Menu/index.cjs.js +1 -1
- package/dist/components/Menu/index.es.js +82 -73
- package/dist/components/Modal/index.cjs.js +1 -1
- package/dist/components/Modal/index.es.js +65 -53
- package/dist/components/Progress/index.cjs.js +1 -1
- package/dist/components/Progress/index.es.js +21 -21
- package/dist/components/Spacer/index.cjs.js +1 -1
- package/dist/components/Spacer/index.es.js +13 -7
- package/dist/components/Stack/index.cjs.js +1 -1
- package/dist/components/Stack/index.es.js +28 -28
- package/dist/components/Switch/index.cjs.js +1 -1
- package/dist/components/Switch/index.es.js +1 -1
- package/dist/components/Tabs/index.cjs.js +1 -1
- package/dist/components/Tabs/index.es.js +9 -9
- package/dist/node_modules/@tanstack/hotkeys/dist/match.es.js +4 -4
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.cjs.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.es.js +2 -2
- package/dist/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
- package/dist/node_modules/react-transition-group/esm/Transition.es.js +2 -2
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.es.js +745 -553
- package/dist/reaxify.css +1 -1
- package/dist/{axios → src/axios}/AxiosProvider.d.ts +1 -1
- package/dist/{components → src/components}/Accordion/index.d.ts +1 -1
- package/dist/src/components/Alert/index.d.ts +26 -0
- package/dist/src/components/Avatar/index.d.ts +21 -0
- package/dist/{components → src/components}/Badge/index.d.ts +1 -1
- package/dist/{components → src/components}/Button/index.d.ts +3 -3
- package/dist/{components → src/components}/ButtonGroup/index.d.ts +1 -1
- package/dist/{components → src/components}/Card/index.d.ts +1 -1
- package/dist/{components → src/components}/Drawer/index.d.ts +4 -2
- package/dist/src/components/Fill/index.d.ts +3 -0
- package/dist/{components → src/components}/InputGroup/index.d.ts +1 -1
- package/dist/{components → src/components}/Menu/index.d.ts +3 -2
- package/dist/{components → src/components}/Modal/index.d.ts +3 -2
- package/dist/{components → src/components}/Portal/index.d.ts +1 -1
- package/dist/{components → src/components}/Progress/index.d.ts +1 -1
- package/dist/src/components/Spacer/index.d.ts +6 -0
- package/dist/{components → src/components}/Spinner/index.d.ts +1 -1
- package/dist/src/components/Stack/index.d.ts +10 -0
- package/dist/{components → src/components}/Switch/index.d.ts +1 -1
- package/dist/{components → src/components}/Tabs/index.d.ts +1 -1
- package/dist/{components → src/components}/Tooltip/index.d.ts +2 -2
- package/dist/{components → src/components}/Typography/index.d.ts +1 -1
- package/dist/{hooks → src/hooks}/useClasses.d.ts +2 -2
- package/dist/{providers → src/providers}/ThemeProvider.d.ts +49 -5
- package/dist/{types → src/types}/index.d.ts +6 -1
- package/package.json +17 -17
- package/dist/components/Spacer/index.d.ts +0 -6
- package/dist/components/Stack/index.d.ts +0 -10
- /package/dist/{axios → src/axios}/index.d.ts +0 -0
- /package/dist/{axios → src/axios}/types.d.ts +0 -0
- /package/dist/{axios → src/axios}/useAxios.d.ts +0 -0
- /package/dist/{components → src/components}/Skeleton/index.d.ts +0 -0
- /package/dist/{components → src/components}/Table/index.d.ts +0 -0
- /package/dist/{components → src/components}/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/cn.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/copy.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/isEmpty.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/isServer.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/randomID.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/replaceNonDigits.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/replacePersianNumbers.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/scrollIntoView.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/twoDigitNumber.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/wait.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/index.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useCreateRipple.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useDebounce.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useDocumentVisible.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useIsOffline.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/usePersistedState.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useToggle.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{providers → src/providers}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const r=require("react/jsx-runtime"),I=require("../../helpers/cn.cjs.js"),z=require("../../hooks/useClasses.cjs.js"),n=require("react"),S=require("../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js"),j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),$=require("../Portal/index.cjs.js"),B=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),y=n.createContext({open:!1,onClose:()=>{},transitionState:"unmounted",closeOnClick:!1,preventClose:!1});function E({as:c,ref:a,open:i,onClose:o,closeOnClick:d=!1,preventClose:f=!1,anchorEl:l=null,className:b,children:h,...C}){const p=z(e=>e.menu.base),M=c||"div",s=16,t=n.useRef(null),O=n.useRef({left:s,right:s,top:s}),L={entering:"scale-100 opacity-100",entered:"scale-100 opacity-100",exiting:"scale-90 opacity-0",exited:"scale-90 opacity-0",unmounted:""},R=n.useCallback(e=>{O.current=e},[]),q=n.useCallback(e=>{var u,g,x;(u=t.current)==null||u.style.setProperty("--left",`${e.left}px`),(g=t.current)==null||g.style.setProperty("--right",`${e.right}px`),(x=t.current)==null||x.style.setProperty("--top",`${e.top}px`)},[]),m=n.useCallback(()=>{var H,P;if(!i||!l)return;const e=l.getBoundingClientRect(),u=window.innerWidth,g=window.innerHeight,x=((H=t.current)==null?void 0:H.offsetWidth)||150,W=((P=t.current)==null?void 0:P.offsetHeight)||200;let w=e.left,k=e.right,v=e.bottom;w=Math.min(Math.max(w,s),u-x-s),k=Math.min(Math.max(u-e.right,s),u-x-s),v=Math.min(Math.max(v,s),g-W-s),R({left:w,right:k,top:v}),q({left:w,right:k,top:v})},[i,l,R,q]),N=()=>{f||o==null||o()};return n.useEffect(()=>{m()},[m,h]),n.useEffect(()=>{const e=()=>{m()};return window.addEventListener("scroll",e),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[m]),n.useImperativeHandle(a,()=>t.current),S.useHotkey("Escape",()=>o==null?void 0:o(),{enabled:i&&!f}),r.jsx($,{children:r.jsx(B.default,{nodeRef:t,in:i,timeout:300,unmountOnExit:!0,children:e=>r.jsx(y.Provider,{value:{open:i,onClose:N,transitionState:e,closeOnClick:d,preventClose:f},children:r.jsxs(T,{children:[r.jsx(A,{}),r.jsx(M,{ref:t,"data-open":i,className:j.twMerge("w-fit min-w-52 bg-white shadow rounded p-2 transition-[scale,opacity] absolute top-(--top) left-(--left) right-auto origin-top-left rtl:left-auto rtl:right-(--right) rtl:origin-top-right",p,L[e],b),...C,children:h})]})})})})}function T({children:c}){const{transitionState:a}=n.useContext(y),i={entering:"active pointer-events-auto",entered:"active pointer-events-auto",exiting:"pointer-events-none",exited:"pointer-events-none",unmounted:""};return r.jsx("div",{className:j.twMerge("fixed inset-0 size-full flex flex-col bg-transparent transition-opacity overflow-hidden z-10",i[a]),children:c})}function A(){const{onClose:c,preventClose:a}=n.useContext(y);return r.jsx("button",{type:"button",className:I("w-full flex-1 opacity-0 cursor-default lg:absolute lg:size-full lg:inset-0",a&&"[&:active~*]:scale-95"),onClick:c})}function D({as:c,closeOnClick:a,className:i,children:o,onClick:d,...f}){const l=c||"button",b=l==="button"?"button":void 0,h=z(t=>t.menu.item.base),{closeOnClick:C,onClose:p}=n.useContext(y),M=a??C,s=t=>{M&&(p==null||p()),d==null||d(t)};return r.jsx(l,{type:b,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",h,i),onClick:s,...f,children:o})}E.Item=D;module.exports=E;
|
|
@@ -1,95 +1,101 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
2
|
+
import { jsx as r, jsxs as B } from "react/jsx-runtime";
|
|
3
|
+
import T from "../../helpers/cn.es.js";
|
|
3
4
|
import W from "../../hooks/useClasses.es.js";
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { useHotkey as
|
|
5
|
+
import { createContext as q, useRef as L, useCallback as C, useEffect as N, useImperativeHandle as A, useContext as P } from "react";
|
|
6
|
+
import { useHotkey as D } from "../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js";
|
|
6
7
|
import { twMerge as H } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
8
|
+
import F from "../Portal/index.es.js";
|
|
9
|
+
import G from "../../node_modules/react-transition-group/esm/Transition.es.js";
|
|
10
|
+
const w = q({
|
|
10
11
|
open: !1,
|
|
11
12
|
onClose: () => {
|
|
12
13
|
},
|
|
13
14
|
transitionState: "unmounted",
|
|
14
|
-
closeOnClick: !1
|
|
15
|
+
closeOnClick: !1,
|
|
16
|
+
preventClose: !1
|
|
15
17
|
});
|
|
16
|
-
function
|
|
17
|
-
as:
|
|
18
|
-
ref:
|
|
18
|
+
function J({
|
|
19
|
+
as: s,
|
|
20
|
+
ref: a,
|
|
19
21
|
open: o,
|
|
20
|
-
onClose:
|
|
21
|
-
closeOnClick:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
onClose: i,
|
|
23
|
+
closeOnClick: u = !1,
|
|
24
|
+
preventClose: f = !1,
|
|
25
|
+
anchorEl: c = null,
|
|
26
|
+
className: y,
|
|
27
|
+
children: p,
|
|
25
28
|
...b
|
|
26
29
|
}) {
|
|
27
|
-
const
|
|
28
|
-
left:
|
|
29
|
-
right:
|
|
30
|
-
top:
|
|
31
|
-
}),
|
|
30
|
+
const d = W((t) => t.menu.base), M = s || "div", n = 16, e = L(null), I = L({
|
|
31
|
+
left: n,
|
|
32
|
+
right: n,
|
|
33
|
+
top: n
|
|
34
|
+
}), S = {
|
|
32
35
|
entering: "scale-100 opacity-100",
|
|
33
36
|
entered: "scale-100 opacity-100",
|
|
34
37
|
exiting: "scale-90 opacity-0",
|
|
35
38
|
exited: "scale-90 opacity-0",
|
|
36
39
|
unmounted: ""
|
|
37
|
-
}, z =
|
|
38
|
-
|
|
39
|
-
}, []), O =
|
|
40
|
-
var
|
|
41
|
-
(
|
|
42
|
-
}, []),
|
|
40
|
+
}, z = C((t) => {
|
|
41
|
+
I.current = t;
|
|
42
|
+
}, []), O = C((t) => {
|
|
43
|
+
var l, g, m;
|
|
44
|
+
(l = e.current) == null || l.style.setProperty("--left", `${t.left}px`), (g = e.current) == null || g.style.setProperty("--right", `${t.right}px`), (m = e.current) == null || m.style.setProperty("--top", `${t.top}px`);
|
|
45
|
+
}, []), h = C(() => {
|
|
43
46
|
var R, E;
|
|
44
|
-
if (!o || !
|
|
45
|
-
const t =
|
|
46
|
-
let x = t.left,
|
|
47
|
-
x = Math.min(Math.max(x,
|
|
48
|
-
Math.max(
|
|
49
|
-
|
|
50
|
-
),
|
|
51
|
-
}, [o,
|
|
47
|
+
if (!o || !c) return;
|
|
48
|
+
const t = c.getBoundingClientRect(), l = window.innerWidth, g = window.innerHeight, m = ((R = e.current) == null ? void 0 : R.offsetWidth) || 150, j = ((E = e.current) == null ? void 0 : E.offsetHeight) || 200;
|
|
49
|
+
let x = t.left, k = t.right, v = t.bottom;
|
|
50
|
+
x = Math.min(Math.max(x, n), l - m - n), k = Math.min(
|
|
51
|
+
Math.max(l - t.right, n),
|
|
52
|
+
l - m - n
|
|
53
|
+
), v = Math.min(Math.max(v, n), g - j - n), z({ left: x, right: k, top: v }), O({ left: x, right: k, top: v });
|
|
54
|
+
}, [o, c, z, O]), $ = () => {
|
|
55
|
+
f || i == null || i();
|
|
56
|
+
};
|
|
52
57
|
return N(() => {
|
|
53
|
-
|
|
54
|
-
}, [
|
|
58
|
+
h();
|
|
59
|
+
}, [h, p]), N(() => {
|
|
55
60
|
const t = () => {
|
|
56
|
-
|
|
61
|
+
h();
|
|
57
62
|
};
|
|
58
63
|
return window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
|
|
59
64
|
window.removeEventListener("scroll", t), window.removeEventListener("resize", t);
|
|
60
65
|
};
|
|
61
|
-
}, [
|
|
62
|
-
|
|
66
|
+
}, [h]), A(a, () => e.current), D("Escape", () => i == null ? void 0 : i(), { enabled: o && !f }), /* @__PURE__ */ r(F, { children: /* @__PURE__ */ r(G, { nodeRef: e, in: o, timeout: 300, unmountOnExit: !0, children: (t) => /* @__PURE__ */ r(
|
|
67
|
+
w.Provider,
|
|
63
68
|
{
|
|
64
69
|
value: {
|
|
65
70
|
open: o,
|
|
66
|
-
onClose:
|
|
71
|
+
onClose: $,
|
|
67
72
|
transitionState: t,
|
|
68
|
-
closeOnClick:
|
|
73
|
+
closeOnClick: u,
|
|
74
|
+
preventClose: f
|
|
69
75
|
},
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */ r(
|
|
76
|
+
children: /* @__PURE__ */ B(K, { children: [
|
|
77
|
+
/* @__PURE__ */ r(Q, {}),
|
|
72
78
|
/* @__PURE__ */ r(
|
|
73
|
-
|
|
79
|
+
M,
|
|
74
80
|
{
|
|
75
|
-
ref:
|
|
81
|
+
ref: e,
|
|
76
82
|
"data-open": o,
|
|
77
83
|
className: H(
|
|
78
|
-
"w-fit min-w-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
"w-fit min-w-52 bg-white shadow rounded p-2 transition-[scale,opacity] absolute top-(--top) left-(--left) right-auto origin-top-left rtl:left-auto rtl:right-(--right) rtl:origin-top-right",
|
|
85
|
+
d,
|
|
86
|
+
S[t],
|
|
87
|
+
y
|
|
82
88
|
),
|
|
83
89
|
...b,
|
|
84
|
-
children:
|
|
90
|
+
children: p
|
|
85
91
|
}
|
|
86
92
|
)
|
|
87
93
|
] })
|
|
88
94
|
}
|
|
89
95
|
) }) });
|
|
90
96
|
}
|
|
91
|
-
function
|
|
92
|
-
const { transitionState:
|
|
97
|
+
function K({ children: s }) {
|
|
98
|
+
const { transitionState: a } = P(w);
|
|
93
99
|
return /* @__PURE__ */ r(
|
|
94
100
|
"div",
|
|
95
101
|
{
|
|
@@ -101,50 +107,53 @@ function F({ children: i }) {
|
|
|
101
107
|
exiting: "pointer-events-none",
|
|
102
108
|
exited: "pointer-events-none",
|
|
103
109
|
unmounted: ""
|
|
104
|
-
}[
|
|
110
|
+
}[a]
|
|
105
111
|
),
|
|
106
|
-
children:
|
|
112
|
+
children: s
|
|
107
113
|
}
|
|
108
114
|
);
|
|
109
115
|
}
|
|
110
|
-
function
|
|
111
|
-
const { onClose:
|
|
116
|
+
function Q() {
|
|
117
|
+
const { onClose: s, preventClose: a } = P(w);
|
|
112
118
|
return /* @__PURE__ */ r(
|
|
113
119
|
"button",
|
|
114
120
|
{
|
|
115
121
|
type: "button",
|
|
116
|
-
className:
|
|
117
|
-
|
|
122
|
+
className: T(
|
|
123
|
+
"w-full flex-1 opacity-0 cursor-default lg:absolute lg:size-full lg:inset-0",
|
|
124
|
+
a && "[&:active~*]:scale-95"
|
|
125
|
+
),
|
|
126
|
+
onClick: s
|
|
118
127
|
}
|
|
119
128
|
);
|
|
120
129
|
}
|
|
121
|
-
function
|
|
122
|
-
as:
|
|
123
|
-
closeOnClick:
|
|
130
|
+
function U({
|
|
131
|
+
as: s,
|
|
132
|
+
closeOnClick: a,
|
|
124
133
|
className: o,
|
|
125
|
-
children:
|
|
126
|
-
onClick:
|
|
127
|
-
...
|
|
134
|
+
children: i,
|
|
135
|
+
onClick: u,
|
|
136
|
+
...f
|
|
128
137
|
}) {
|
|
129
|
-
const
|
|
130
|
-
|
|
138
|
+
const c = s || "button", y = c === "button" ? "button" : void 0, p = W((e) => e.menu.item.base), { closeOnClick: b, onClose: d } = P(w), M = a ?? b, n = (e) => {
|
|
139
|
+
M && (d == null || d()), u == null || u(e);
|
|
131
140
|
};
|
|
132
141
|
return /* @__PURE__ */ r(
|
|
133
|
-
|
|
142
|
+
c,
|
|
134
143
|
{
|
|
135
|
-
type:
|
|
144
|
+
type: y,
|
|
136
145
|
className: H(
|
|
137
146
|
"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",
|
|
138
|
-
|
|
147
|
+
p,
|
|
139
148
|
o
|
|
140
149
|
),
|
|
141
150
|
onClick: n,
|
|
142
|
-
...
|
|
143
|
-
children:
|
|
151
|
+
...f,
|
|
152
|
+
children: i
|
|
144
153
|
}
|
|
145
154
|
);
|
|
146
155
|
}
|
|
147
|
-
|
|
156
|
+
J.Item = U;
|
|
148
157
|
export {
|
|
149
|
-
|
|
158
|
+
J as default
|
|
150
159
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),f=require("../../helpers/cn.cjs.js"),u=require("../../hooks/useClasses.cjs.js"),l=require("react"),C=require("../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js"),j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),p=require("../Card/index.cjs.js"),h=require("../Portal/index.cjs.js"),w=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),v=l.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:i=300,preventClose:r=!1,className:b,children:y,...d}){const m=u(x=>x.modal.base),g=l.useRef(null),q=t||"div",z={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:""},M=()=>{r||a()};return l.useImperativeHandle(n,()=>g.current),C.useHotkey("Escape",()=>a(),{enabled:e&&!r}),s.jsx(h,{children:s.jsx(w.default,{nodeRef:g,in:e,timeout:i,unmountOnExit:!0,children:x=>s.jsxs(q,{ref:g,"data-open":e,style:{transitionDuration:`${i}ms`},className:j.twMerge("modal fixed size-full inset-0 flex flex-col z-10 bg-black/20 transition-opacity backdrop-blur p-4",m,z[x],b),...d,children:[s.jsx("button",{type:"button",onClick:M,className:f("absolute inset-0 cursor-default opacity-0",r&&"[&:active~*]:scale-95")}),s.jsx(v.Provider,{value:{size:o,open:e,onClose:M,transitionState:x,duration:i},children:y})]})})})}function H({className:t,children:n,...o}){const e=u(d=>d.modal.dialog),{size:a,transitionState:i,duration:r}=l.useContext(v),b={entering:"scale-100",entered:"scale-100",exiting:"scale-75",exited:"scale-75",unmounted:""},y=l.useMemo(()=>{var m;return[{sm:"min-[576px]:w-[300px]",md:"min-[576px]:w-[500px]",lg:"min-[992px]:w-[800px]"}[a],(m=e==null?void 0:e.size)==null?void 0:m[a]]},[a,e==null?void 0:e.size]);return s.jsx(p,{as:"div",style:{transitionDuration:`${r}ms`},className:j.twMerge("max-w-full max-h-full m-auto transition-transform",e==null?void 0:e.base,y,b[i],t),...o,children:n})}function N({className:t,...n}){const o=u(e=>e.modal.header.base);return s.jsx(p.Header,{className:f(o,t),...n})}function S({className:t,...n}){const o=u(e=>e.modal.body.base);return s.jsx(p.Body,{className:f(o,t),...n})}function k({className:t,...n}){const o=u(e=>e.modal.footer.base);return s.jsx(p.Footer,{className:f(o,t),...n})}c.Dialog=H;c.Header=N;c.Body=S;c.Footer=k;exports.ModalContext=v;exports.default=c;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import u from "../../helpers/cn.es.js";
|
|
4
4
|
import l from "../../hooks/useClasses.es.js";
|
|
5
|
-
import { createContext as
|
|
6
|
-
import { useHotkey as
|
|
7
|
-
import { twMerge as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
5
|
+
import { createContext as N, useRef as w, useImperativeHandle as H, useContext as k, useMemo as D } from "react";
|
|
6
|
+
import { useHotkey as S } from "../../node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js";
|
|
7
|
+
import { twMerge as g } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
8
|
+
import f from "../Card/index.es.js";
|
|
9
|
+
import B from "../Portal/index.es.js";
|
|
10
|
+
import F from "../../node_modules/react-transition-group/esm/Transition.es.js";
|
|
11
|
+
const z = N({
|
|
12
12
|
size: "md",
|
|
13
13
|
open: !1,
|
|
14
14
|
onClose: () => {
|
|
@@ -16,83 +16,95 @@ const v = M({
|
|
|
16
16
|
transitionState: "unmounted",
|
|
17
17
|
duration: 300
|
|
18
18
|
});
|
|
19
|
-
function
|
|
19
|
+
function p({
|
|
20
20
|
as: t,
|
|
21
21
|
ref: o,
|
|
22
22
|
size: n = "md",
|
|
23
23
|
open: e = !1,
|
|
24
|
-
onClose:
|
|
24
|
+
onClose: s = () => {
|
|
25
25
|
},
|
|
26
|
-
duration:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
duration: i = 300,
|
|
27
|
+
preventClose: r = !1,
|
|
28
|
+
className: x,
|
|
29
|
+
children: b,
|
|
30
|
+
...m
|
|
30
31
|
}) {
|
|
31
|
-
const
|
|
32
|
+
const c = l((d) => d.modal.base), y = w(null), C = t || "div", M = {
|
|
32
33
|
entering: "active opacity-100 pointer-events-auto",
|
|
33
34
|
entered: "active opacity-100 pointer-events-auto",
|
|
34
35
|
exiting: "opacity-0 pointer-events-none",
|
|
35
36
|
exited: "opacity-0 pointer-events-none",
|
|
36
37
|
unmounted: ""
|
|
38
|
+
}, v = () => {
|
|
39
|
+
r || s();
|
|
37
40
|
};
|
|
38
|
-
return
|
|
39
|
-
|
|
41
|
+
return H(o, () => y.current), S("Escape", () => s(), { enabled: e && !r }), /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(F, { nodeRef: y, in: e, timeout: i, unmountOnExit: !0, children: (d) => /* @__PURE__ */ h(
|
|
42
|
+
C,
|
|
40
43
|
{
|
|
41
|
-
ref:
|
|
44
|
+
ref: y,
|
|
42
45
|
"data-open": e,
|
|
43
|
-
style: { transitionDuration: `${
|
|
44
|
-
className:
|
|
46
|
+
style: { transitionDuration: `${i}ms` },
|
|
47
|
+
className: g(
|
|
45
48
|
"modal fixed size-full inset-0 flex flex-col z-10 bg-black/20 transition-opacity backdrop-blur p-4",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
c,
|
|
50
|
+
M[d],
|
|
51
|
+
x
|
|
49
52
|
),
|
|
50
|
-
...
|
|
53
|
+
...m,
|
|
51
54
|
children: [
|
|
52
55
|
/* @__PURE__ */ a(
|
|
53
56
|
"button",
|
|
54
57
|
{
|
|
55
58
|
type: "button",
|
|
56
|
-
onClick:
|
|
57
|
-
className:
|
|
59
|
+
onClick: v,
|
|
60
|
+
className: u(
|
|
61
|
+
"absolute inset-0 cursor-default opacity-0",
|
|
62
|
+
r && "[&:active~*]:scale-95"
|
|
63
|
+
)
|
|
58
64
|
}
|
|
59
65
|
),
|
|
60
66
|
/* @__PURE__ */ a(
|
|
61
|
-
|
|
67
|
+
z.Provider,
|
|
62
68
|
{
|
|
63
|
-
value: {
|
|
64
|
-
|
|
69
|
+
value: {
|
|
70
|
+
size: n,
|
|
71
|
+
open: e,
|
|
72
|
+
onClose: v,
|
|
73
|
+
transitionState: d,
|
|
74
|
+
duration: i
|
|
75
|
+
},
|
|
76
|
+
children: b
|
|
65
77
|
}
|
|
66
78
|
)
|
|
67
79
|
]
|
|
68
80
|
}
|
|
69
81
|
) }) });
|
|
70
82
|
}
|
|
71
|
-
function
|
|
72
|
-
const e = l((m) => m.modal.dialog), { size:
|
|
83
|
+
function R({ className: t, children: o, ...n }) {
|
|
84
|
+
const e = l((m) => m.modal.dialog), { size: s, transitionState: i, duration: r } = k(z), x = {
|
|
73
85
|
entering: "scale-100",
|
|
74
86
|
entered: "scale-100",
|
|
75
87
|
exiting: "scale-75",
|
|
76
88
|
exited: "scale-75",
|
|
77
89
|
unmounted: ""
|
|
78
|
-
},
|
|
79
|
-
var
|
|
90
|
+
}, b = D(() => {
|
|
91
|
+
var c;
|
|
80
92
|
return [{
|
|
81
93
|
sm: "min-[576px]:w-[300px]",
|
|
82
94
|
md: "min-[576px]:w-[500px]",
|
|
83
95
|
lg: "min-[992px]:w-[800px]"
|
|
84
|
-
}[
|
|
85
|
-
}, [
|
|
96
|
+
}[s], (c = e == null ? void 0 : e.size) == null ? void 0 : c[s]];
|
|
97
|
+
}, [s, e == null ? void 0 : e.size]);
|
|
86
98
|
return /* @__PURE__ */ a(
|
|
87
|
-
|
|
99
|
+
f,
|
|
88
100
|
{
|
|
89
101
|
as: "div",
|
|
90
|
-
style: { transitionDuration: `${
|
|
91
|
-
className:
|
|
102
|
+
style: { transitionDuration: `${r}ms` },
|
|
103
|
+
className: g(
|
|
92
104
|
"max-w-full max-h-full m-auto transition-transform",
|
|
93
105
|
e == null ? void 0 : e.base,
|
|
94
|
-
|
|
95
|
-
|
|
106
|
+
b,
|
|
107
|
+
x[i],
|
|
96
108
|
t
|
|
97
109
|
),
|
|
98
110
|
...n,
|
|
@@ -100,23 +112,23 @@ function B({ className: t, children: o, ...n }) {
|
|
|
100
112
|
}
|
|
101
113
|
);
|
|
102
114
|
}
|
|
103
|
-
function
|
|
115
|
+
function j({ className: t, ...o }) {
|
|
104
116
|
const n = l((e) => e.modal.header.base);
|
|
105
|
-
return /* @__PURE__ */ a(
|
|
117
|
+
return /* @__PURE__ */ a(f.Header, { className: u(n, t), ...o });
|
|
106
118
|
}
|
|
107
|
-
function
|
|
119
|
+
function E({ className: t, ...o }) {
|
|
108
120
|
const n = l((e) => e.modal.body.base);
|
|
109
|
-
return /* @__PURE__ */ a(
|
|
121
|
+
return /* @__PURE__ */ a(f.Body, { className: u(n, t), ...o });
|
|
110
122
|
}
|
|
111
|
-
function
|
|
123
|
+
function P({ className: t, ...o }) {
|
|
112
124
|
const n = l((e) => e.modal.footer.base);
|
|
113
|
-
return /* @__PURE__ */ a(
|
|
125
|
+
return /* @__PURE__ */ a(f.Footer, { className: u(n, t), ...o });
|
|
114
126
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
127
|
+
p.Dialog = R;
|
|
128
|
+
p.Header = j;
|
|
129
|
+
p.Body = E;
|
|
130
|
+
p.Footer = P;
|
|
119
131
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
132
|
+
z as ModalContext,
|
|
133
|
+
p as default
|
|
122
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const n=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const n=require("react/jsx-runtime"),h=require("../../helpers/cn.cjs.js"),b=require("../../hooks/useClasses.cjs.js"),a=require("react"),x=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function f({color:r="primary",value:i=0,animate:s=!1,className:u,...l}){const t=b(e=>e.progress),g=a.useMemo(()=>{var o;if(!r)return"border-transparent";const e={primary:"bg-light-primary text-primary",secondary:"bg-light-secondary text-secondary",success:"bg-light-success text-success",info:"bg-light-info text-info",warning:"bg-light-warning text-warning",danger:"bg-light-danger text-danger",dark:"bg-dark/10 text-dark",light:"bg-light/10 text-light"},d=(o=t==null?void 0:t.color)==null?void 0:o[r];return[e==null?void 0:e[r],d]},[r,t==null?void 0:t.color]),c=a.useMemo(()=>{if(!s)return`${Math.max(i,0)}%`},[i,s]);return n.jsxs("div",{className:x.twMerge("relative block w-full h-1.5 rounded-full overflow-hidden",t==null?void 0:t.base,g,u),...l,children:[n.jsx("span",{style:{width:c},className:h("absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",s?"animate-linear-progress-1":"transition-[width]")}),s&&n.jsx("span",{className:"absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0 animate-linear-progress-2"})]})}module.exports=f;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as f, jsx as
|
|
2
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import c from "../../helpers/cn.es.js";
|
|
4
|
-
import
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { twMerge as
|
|
4
|
+
import h from "../../hooks/useClasses.es.js";
|
|
5
|
+
import { useMemo as a } from "react";
|
|
6
|
+
import { twMerge as p } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
7
|
function v({
|
|
8
8
|
color: e = "primary",
|
|
9
9
|
value: o = 0,
|
|
10
10
|
animate: n = !1,
|
|
11
11
|
className: l,
|
|
12
|
-
...
|
|
12
|
+
...g
|
|
13
13
|
}) {
|
|
14
|
-
const r =
|
|
14
|
+
const r = h((t) => t.progress), u = a(() => {
|
|
15
15
|
var s;
|
|
16
16
|
if (!e) return "border-transparent";
|
|
17
17
|
const t = {
|
|
18
|
-
primary: "bg-primary
|
|
19
|
-
secondary: "bg-secondary
|
|
20
|
-
success: "bg-success
|
|
21
|
-
info: "bg-info
|
|
22
|
-
warning: "bg-warning
|
|
23
|
-
danger: "bg-danger
|
|
24
|
-
dark: "bg-dark/
|
|
25
|
-
light: "bg-light/
|
|
18
|
+
primary: "bg-light-primary text-primary",
|
|
19
|
+
secondary: "bg-light-secondary text-secondary",
|
|
20
|
+
success: "bg-light-success text-success",
|
|
21
|
+
info: "bg-light-info text-info",
|
|
22
|
+
warning: "bg-light-warning text-warning",
|
|
23
|
+
danger: "bg-light-danger text-danger",
|
|
24
|
+
dark: "bg-dark/10 text-dark",
|
|
25
|
+
light: "bg-light/10 text-light"
|
|
26
26
|
}, m = (s = r == null ? void 0 : r.color) == null ? void 0 : s[e];
|
|
27
27
|
return [t == null ? void 0 : t[e], m];
|
|
28
|
-
}, [e, r == null ? void 0 : r.color]),
|
|
28
|
+
}, [e, r == null ? void 0 : r.color]), d = a(() => {
|
|
29
29
|
if (!n)
|
|
30
30
|
return `${Math.max(o, 0)}%`;
|
|
31
31
|
}, [o, n]);
|
|
32
32
|
return /* @__PURE__ */ f(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: p(
|
|
36
36
|
"relative block w-full h-1.5 rounded-full overflow-hidden",
|
|
37
37
|
r == null ? void 0 : r.base,
|
|
38
|
-
|
|
38
|
+
u,
|
|
39
39
|
l
|
|
40
40
|
),
|
|
41
|
-
...
|
|
41
|
+
...g,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ i(
|
|
44
44
|
"span",
|
|
45
45
|
{
|
|
46
|
-
style: { width:
|
|
46
|
+
style: { width: d },
|
|
47
47
|
className: c(
|
|
48
48
|
"absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",
|
|
49
49
|
n ? "animate-linear-progress-1" : "transition-[width]"
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
n && /* @__PURE__ */
|
|
53
|
+
n && /* @__PURE__ */ i("span", { className: "absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0 animate-linear-progress-2" })
|
|
54
54
|
]
|
|
55
55
|
}
|
|
56
56
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),u=require("../../hooks/useClasses.cjs.js");require("react");const n=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function i({className:e,...s}){const r=u(c=>c.spacer.base);return t.jsx("div",{className:n.twMerge("block flex-1",r,e),...s})}module.exports=i;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import a from "../../hooks/useClasses.es.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { twMerge as
|
|
6
|
-
function
|
|
7
|
-
const r =
|
|
8
|
-
return /* @__PURE__ */
|
|
5
|
+
import { twMerge as c } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
6
|
+
function f({ className: e, ...s }) {
|
|
7
|
+
const r = a((o) => o.spacer.base);
|
|
8
|
+
return /* @__PURE__ */ t(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: c("block flex-1", r, e),
|
|
12
|
+
...s
|
|
13
|
+
}
|
|
14
|
+
);
|
|
9
15
|
}
|
|
10
16
|
export {
|
|
11
|
-
|
|
17
|
+
f as default
|
|
12
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const q=require("react/jsx-runtime"),u=require("../../helpers/cn.cjs.js"),C=require("../../hooks/useClasses.cjs.js"),c=require("react"),M=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function j({as:l,direction:t="row",wrap:r=!1,reverse:n=!1,className:f,children:x,...m}){const e=C(o=>o.stack),w=l||"div",d=c.useMemo(()=>{var i,s;return{row:u("*:min-w-0",n?"flex-row-reverse":"flex-row",(i=e==null?void 0:e.directions)==null?void 0:i.row),column:u("*:min-h-0",n?"flex-col-reverse":"flex-col",(s=e==null?void 0:e.directions)==null?void 0:s.column)}[t]},[t,n,e==null?void 0:e.directions]),a=c.useMemo(()=>r==="reverse"?"flex-wrap-reverse":r?"flex-wrap":null,[r]);return q.jsx(w,{className:M.twMerge("flex",e==null?void 0:e.base,d,a,f),...m,children:x})}module.exports=j;
|