reaxify 0.0.63 → 0.0.64
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/axios/useAxios.cjs.js +1 -1
- package/dist/axios/useAxios.es.js +130 -128
- package/dist/components/Accordion/index.cjs.js +1 -1
- package/dist/components/Accordion/index.es.js +48 -48
- package/dist/components/Badge/index.cjs.js +1 -1
- package/dist/components/Badge/index.es.js +39 -33
- package/dist/components/Box/index.cjs.js +1 -1
- package/dist/components/Box/index.es.js +7 -7
- package/dist/components/Button/index.cjs.js +1 -1
- package/dist/components/Button/index.es.js +66 -57
- package/dist/components/ButtonGroup/index.cjs.js +1 -1
- package/dist/components/ButtonGroup/index.es.js +43 -39
- package/dist/components/Drawer/index.cjs.js +1 -1
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Drawer/index.es.js +76 -73
- package/dist/components/Menu/index.cjs.js +1 -1
- package/dist/components/Menu/index.d.ts +1 -1
- package/dist/components/Menu/index.es.js +83 -80
- package/dist/components/Modal/index.cjs.js +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.es.js +70 -66
- package/dist/components/Progress/index.cjs.js +1 -1
- package/dist/components/Progress/index.es.js +30 -29
- package/dist/components/Spinner/index.cjs.js +1 -1
- package/dist/components/Spinner/index.es.js +40 -31
- package/dist/components/Stack/index.cjs.js +1 -1
- package/dist/components/Stack/index.es.js +28 -25
- package/dist/components/Switch/index.cjs.js +1 -1
- package/dist/components/Switch/index.es.js +63 -53
- package/dist/components/Table/index.cjs.js +1 -1
- package/dist/components/Table/index.es.js +65 -65
- package/dist/components/Tabs/index.cjs.js +1 -1
- package/dist/components/Tabs/index.es.js +46 -46
- package/dist/components/Tooltip/index.cjs.js +1 -1
- package/dist/components/Tooltip/index.es.js +75 -63
- package/dist/components/Typography/index.cjs.js +1 -1
- package/dist/components/Typography/index.es.js +28 -25
- package/dist/helpers/copy.cjs.js +1 -1
- package/dist/helpers/copy.es.js +4 -3
- package/dist/hooks/useAutoFill.cjs.js +1 -1
- package/dist/hooks/useAutoFill.es.js +14 -12
- package/dist/hooks/useClasses.cjs.js +1 -1
- package/dist/hooks/useClasses.es.js +5 -5
- package/dist/hooks/useKeyDown.cjs.js +1 -1
- package/dist/hooks/useKeyDown.es.js +9 -9
- package/dist/node_modules/react-animate-height/dist/esm/index.cjs.js +1 -1
- package/dist/node_modules/react-animate-height/dist/esm/index.es.js +8 -8
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.es.js +13 -12
- package/dist/reaxify.css +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
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,163 +1,165 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { AxiosContext as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
}, [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
]),
|
|
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
|
+
import { AxiosContext as Y } from "./AxiosProvider.es.js";
|
|
6
|
+
function C(e = null) {
|
|
7
|
+
const E = "Canceled.", n = W(Y), D = O([]), h = O(/* @__PURE__ */ new Map()), v = O(0), [z, F] = X(), a = q(() => {
|
|
8
|
+
const t = { ...n.config, ...e == null ? void 0 : e.config };
|
|
9
|
+
return V.create(t);
|
|
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
|
+
n.cancelDuplicatedRequests,
|
|
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]), d = q(() => !(n != null && n.retry) && !(e != null && e.retry) ? null : {
|
|
14
14
|
count: 0,
|
|
15
15
|
delay: 0,
|
|
16
16
|
statuses: [],
|
|
17
|
-
...
|
|
18
|
-
...
|
|
19
|
-
}, [
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
...n.retry,
|
|
18
|
+
...e == null ? void 0 : e.retry
|
|
19
|
+
}, [e == null ? void 0 : e.retry, n.retry]), [G, I] = N([]), [J, H] = N(null), P = s(
|
|
20
|
+
(t) => {
|
|
21
|
+
var l;
|
|
22
|
+
if (!m && !R) return t;
|
|
23
|
+
const r = `${t.method}-${t.url}`, c = new AbortController();
|
|
24
|
+
return m && h.current.has(r) && ((l = h.current.get(r)) == null || l.abort(E)), (m || R) && (t.signal = c.signal), m && h.current.set(r, c), R && D.current.push(c), t;
|
|
24
25
|
},
|
|
25
|
-
[
|
|
26
|
-
),
|
|
27
|
-
(
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
|
|
26
|
+
[m, R]
|
|
27
|
+
), b = s(
|
|
28
|
+
(t) => {
|
|
29
|
+
if (!t) return;
|
|
30
|
+
const r = `${t.method}-${t.url}`;
|
|
31
|
+
h.current.delete(r);
|
|
31
32
|
},
|
|
32
33
|
[]
|
|
33
|
-
),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
return
|
|
34
|
+
), p = s((t) => {
|
|
35
|
+
F(() => {
|
|
36
|
+
I((r) => {
|
|
37
|
+
const c = [...r];
|
|
38
|
+
return t ? c.push("") : c.pop(), c;
|
|
38
39
|
});
|
|
39
40
|
});
|
|
40
|
-
}, []),
|
|
41
|
-
(
|
|
42
|
-
const
|
|
43
|
-
...
|
|
44
|
-
...
|
|
41
|
+
}, []), U = s(
|
|
42
|
+
(t) => {
|
|
43
|
+
const r = [
|
|
44
|
+
...n.beforeRequest,
|
|
45
|
+
...(e == null ? void 0 : e.beforeRequest) ?? []
|
|
45
46
|
];
|
|
46
|
-
return
|
|
47
|
-
const
|
|
48
|
-
return await u
|
|
49
|
-
}, Promise.resolve(
|
|
47
|
+
return r.length ? r.reduce(async (c, l) => {
|
|
48
|
+
const u = await c;
|
|
49
|
+
return await l(u) ?? u;
|
|
50
|
+
}, Promise.resolve(t)) : t;
|
|
50
51
|
},
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
(
|
|
54
|
-
const
|
|
55
|
-
...
|
|
56
|
-
...
|
|
52
|
+
[n.beforeRequest, e == null ? void 0 : e.beforeRequest]
|
|
53
|
+
), A = s(
|
|
54
|
+
(t) => {
|
|
55
|
+
const r = [
|
|
56
|
+
...n.afterResponse,
|
|
57
|
+
...(e == null ? void 0 : e.afterResponse) ?? []
|
|
57
58
|
];
|
|
58
|
-
return
|
|
59
|
-
const
|
|
60
|
-
return await u
|
|
61
|
-
}, Promise.resolve(
|
|
59
|
+
return r.length ? r.reduce(async (c, l) => {
|
|
60
|
+
const u = await c;
|
|
61
|
+
return await l(u) ?? u;
|
|
62
|
+
}, Promise.resolve(t)) : t;
|
|
62
63
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
(
|
|
66
|
-
const
|
|
67
|
-
...
|
|
68
|
-
...
|
|
64
|
+
[n.afterResponse, e == null ? void 0 : e.afterResponse]
|
|
65
|
+
), $ = s(
|
|
66
|
+
(t) => {
|
|
67
|
+
const r = [
|
|
68
|
+
...n.afterError,
|
|
69
|
+
...(e == null ? void 0 : e.afterError) ?? []
|
|
69
70
|
];
|
|
70
|
-
return
|
|
71
|
-
const
|
|
72
|
-
return await u
|
|
73
|
-
}, Promise.resolve(
|
|
71
|
+
return r.length ? r.reduce(async (c, l) => {
|
|
72
|
+
const u = await c;
|
|
73
|
+
return await l(u) ?? u;
|
|
74
|
+
}, Promise.resolve(t)) : t;
|
|
74
75
|
},
|
|
75
|
-
[
|
|
76
|
-
),
|
|
77
|
-
(
|
|
78
|
-
const
|
|
79
|
-
...
|
|
80
|
-
...
|
|
76
|
+
[n.afterError, e == null ? void 0 : e.afterError]
|
|
77
|
+
), j = s(
|
|
78
|
+
(t) => {
|
|
79
|
+
const r = [
|
|
80
|
+
...n.beforeRetry,
|
|
81
|
+
...(e == null ? void 0 : e.beforeRetry) ?? []
|
|
81
82
|
];
|
|
82
|
-
return
|
|
83
|
-
const
|
|
84
|
-
return await u
|
|
85
|
-
}, Promise.resolve(
|
|
83
|
+
return r.length ? r.reduce(async (c, l) => {
|
|
84
|
+
const u = await c;
|
|
85
|
+
return await l(u) ?? u;
|
|
86
|
+
}, Promise.resolve(t)) : t;
|
|
86
87
|
},
|
|
87
|
-
[
|
|
88
|
-
),
|
|
89
|
-
(
|
|
90
|
-
if (!
|
|
91
|
-
const
|
|
92
|
-
return !(
|
|
88
|
+
[n.beforeRetry, e == null ? void 0 : e.beforeRetry]
|
|
89
|
+
), k = s(
|
|
90
|
+
(t) => {
|
|
91
|
+
if (!d) return !1;
|
|
92
|
+
const r = d.count ?? 0, c = d.statuses ?? [];
|
|
93
|
+
return !(v.current >= r || !c.includes(t));
|
|
93
94
|
},
|
|
94
|
-
[
|
|
95
|
-
),
|
|
96
|
-
|
|
97
|
-
}, []),
|
|
98
|
-
|
|
99
|
-
}, []),
|
|
100
|
-
async (
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
return await
|
|
95
|
+
[d]
|
|
96
|
+
), M = s(() => {
|
|
97
|
+
v.current++;
|
|
98
|
+
}, []), w = s(() => {
|
|
99
|
+
v.current = 0;
|
|
100
|
+
}, []), B = s(
|
|
101
|
+
async (t) => {
|
|
102
|
+
p(!0), H(null);
|
|
103
|
+
const r = P(t);
|
|
104
|
+
return await U(r);
|
|
104
105
|
},
|
|
105
|
-
[
|
|
106
|
-
),
|
|
107
|
-
async (
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
return
|
|
106
|
+
[P, p, U]
|
|
107
|
+
), L = s(
|
|
108
|
+
async (t) => {
|
|
109
|
+
b(t.config);
|
|
110
|
+
const r = await A(t);
|
|
111
|
+
return p(!1), H(null), w(), r;
|
|
111
112
|
},
|
|
112
113
|
[
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
p,
|
|
115
|
+
A,
|
|
116
|
+
b,
|
|
117
|
+
w
|
|
117
118
|
]
|
|
118
|
-
),
|
|
119
|
-
async (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
), S = s(
|
|
120
|
+
async (t) => {
|
|
121
|
+
var u, y, T;
|
|
122
|
+
const r = [
|
|
123
|
+
(t == null ? void 0 : t.code) === "ERR_CANCELED",
|
|
124
|
+
((y = (u = t == null ? void 0 : t.config) == null ? void 0 : u.signal) == null ? void 0 : y.reason) === E
|
|
125
|
+
].some(Boolean), c = ((T = t == null ? void 0 : t.response) == null ? void 0 : T.status) ?? 0;
|
|
126
|
+
if (!r && k(c)) {
|
|
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));
|
|
128
130
|
}
|
|
129
|
-
!
|
|
130
|
-
const
|
|
131
|
-
return
|
|
131
|
+
!r && b(t == null ? void 0 : t.config);
|
|
132
|
+
const l = await $(t);
|
|
133
|
+
return p(!1), w(), !r && H(l), Promise.reject(l);
|
|
132
134
|
},
|
|
133
135
|
[
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
p,
|
|
137
|
+
$,
|
|
138
|
+
b,
|
|
139
|
+
j,
|
|
140
|
+
k,
|
|
141
|
+
w,
|
|
142
|
+
M,
|
|
143
|
+
d == null ? void 0 : d.delay
|
|
142
144
|
]
|
|
143
145
|
);
|
|
144
|
-
return
|
|
145
|
-
const
|
|
146
|
+
return _(() => {
|
|
147
|
+
const t = a.interceptors.request.use(B), r = a.interceptors.response.use(L, S);
|
|
146
148
|
return () => {
|
|
147
|
-
a.interceptors.request.eject(
|
|
149
|
+
a.interceptors.request.eject(t), a.interceptors.response.eject(r);
|
|
148
150
|
};
|
|
149
151
|
}, [
|
|
150
152
|
a.interceptors.request,
|
|
151
153
|
a.interceptors.response,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
]),
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}),
|
|
159
|
-
}, [
|
|
154
|
+
B,
|
|
155
|
+
L,
|
|
156
|
+
S
|
|
157
|
+
]), _(() => () => {
|
|
158
|
+
R && (D.current.forEach((t) => {
|
|
159
|
+
t.abort(E);
|
|
160
|
+
}), D.current = []);
|
|
161
|
+
}, [R]), [a, !!G.length || z, J];
|
|
160
162
|
}
|
|
161
163
|
export {
|
|
162
|
-
|
|
164
|
+
C as default
|
|
163
165
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const a=require("../../_virtual/jsx-runtime.cjs.js"),
|
|
1
|
+
"use client";"use strict";const a=require("../../_virtual/jsx-runtime.cjs.js"),r=require("react"),l=require("../../hooks/useClasses.cjs.js"),y=require("../../node_modules/react-animate-height/dist/esm/index.cjs.js"),x=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),A=require("../../helpers/randomID.cjs.js"),C=require("../../node_modules/iconsax-react/dist/esm/ArrowDown2.cjs.js"),v=r.createContext({activeKey:null,onChange:()=>{}}),d=r.createContext({active:!1,eventKey:null});function u({activeKey:t=null,onChange:n=()=>{},children:e}){return a.jsxRuntimeExports.jsx(v.Provider,{value:{activeKey:t,onChange:n},children:e})}function b({as:t,eventKey:n=null,className:e,children:o,...i}){const m=l(f=>f.accordion.item.base),{activeKey:c}=r.useContext(v),g=t||"div",p=r.useMemo(()=>A(),[]),s=n||p,j=r.useMemo(()=>Array.isArray(c)?c.includes(s):s===c,[c,s]);return a.jsxRuntimeExports.jsx(g,{className:x.twMerge("block w-full border border-[#e8eaee] rounded",m,e),...i,children:a.jsxRuntimeExports.jsx(d.Provider,{value:{eventKey:s,active:j},children:o})})}function h({type:t,className:n,children:e,onClick:o,...i}){const m=l(s=>s.accordion.toggle.base),{eventKey:c}=r.useContext(d),{onChange:g}=r.useContext(v),p=s=>{c&&g(c),o==null||o(s)};return a.jsxRuntimeExports.jsx("button",{type:t,className:x.twMerge("w-full flex items-center text-start text-base px-5 py-4 rounded-t cursor-pointer",m,n),onClick:p,...i,children:e})}function w({className:t,...n}){const e=l(i=>i.accordion.icon),{active:o}=r.useContext(d);return a.jsxRuntimeExports.jsx(C,{color:"currentColor",className:x.twMerge("size-5 transition-transform",e==null?void 0:e.base,o?"-rotate-180":"rotate-0",o?e==null?void 0:e.active:e==null?void 0:e.inactive,t),...n})}function R({duration:t=300,children:n}){const{active:e}=r.useContext(d);return a.jsxRuntimeExports.jsx(y,{duration:t,height:e?"auto":0,className:"w-full",animationStateClasses:{animating:"",animatingUp:"",animatingDown:"",static:"",animatingToHeightZero:"",animatingToHeightAuto:"",animatingToHeightSpecific:"",staticHeightZero:"",staticHeightAuto:"",staticHeightSpecific:""},children:n})}function q({className:t,children:n,...e}){const o=l(i=>i.accordion.body.base);return a.jsxRuntimeExports.jsx("div",{className:x.twMerge("w-full block px-5 py-4 rounded-b",o,t),...e,children:n})}u.Item=b;u.Toggle=h;u.Icon=w;u.Collapse=R;u.Body=q;module.exports=u;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as
|
|
3
|
-
import { createContext as y, useContext as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { j as a } from "../../_virtual/jsx-runtime.es.js";
|
|
3
|
+
import { createContext as y, useContext as s, useMemo as A } from "react";
|
|
4
|
+
import l from "../../hooks/useClasses.es.js";
|
|
5
|
+
import b from "../../node_modules/react-animate-height/dist/esm/index.es.js";
|
|
6
6
|
import { twMerge as m } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
-
import
|
|
7
|
+
import C from "../../helpers/randomID.es.js";
|
|
8
8
|
import j from "../../node_modules/iconsax-react/dist/esm/ArrowDown2.es.js";
|
|
9
9
|
const x = y({
|
|
10
10
|
activeKey: null,
|
|
@@ -14,23 +14,23 @@ const x = y({
|
|
|
14
14
|
active: !1,
|
|
15
15
|
eventKey: null
|
|
16
16
|
});
|
|
17
|
-
function
|
|
18
|
-
activeKey:
|
|
19
|
-
onChange:
|
|
17
|
+
function u({
|
|
18
|
+
activeKey: o = null,
|
|
19
|
+
onChange: e = () => {
|
|
20
20
|
},
|
|
21
21
|
children: t
|
|
22
22
|
}) {
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ a.jsx(x.Provider, { value: { activeKey: o, onChange: e }, children: t });
|
|
24
24
|
}
|
|
25
25
|
function w({
|
|
26
|
-
as:
|
|
27
|
-
eventKey:
|
|
26
|
+
as: o,
|
|
27
|
+
eventKey: e = null,
|
|
28
28
|
className: t,
|
|
29
29
|
children: n,
|
|
30
30
|
...i
|
|
31
31
|
}) {
|
|
32
|
-
const f =
|
|
33
|
-
return /* @__PURE__ */
|
|
32
|
+
const f = l((v) => v.accordion.item.base), { activeKey: c } = s(x), g = o || "div", p = A(() => C(), []), r = e || p, h = A(() => Array.isArray(c) ? c.includes(r) : r === c, [c, r]);
|
|
33
|
+
return /* @__PURE__ */ a.jsx(
|
|
34
34
|
g,
|
|
35
35
|
{
|
|
36
36
|
className: m(
|
|
@@ -39,28 +39,28 @@ function w({
|
|
|
39
39
|
t
|
|
40
40
|
),
|
|
41
41
|
...i,
|
|
42
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ a.jsx(d.Provider, { value: { eventKey: r, active: h }, children: n })
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
function H({
|
|
47
|
-
type:
|
|
48
|
-
className:
|
|
47
|
+
type: o,
|
|
48
|
+
className: e,
|
|
49
49
|
children: t,
|
|
50
50
|
onClick: n,
|
|
51
51
|
...i
|
|
52
52
|
}) {
|
|
53
|
-
const f =
|
|
54
|
-
|
|
53
|
+
const f = l((r) => r.accordion.toggle.base), { eventKey: c } = s(d), { onChange: g } = s(x), p = (r) => {
|
|
54
|
+
c && g(c), n == null || n(r);
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ a.jsx(
|
|
57
57
|
"button",
|
|
58
58
|
{
|
|
59
|
-
type:
|
|
59
|
+
type: o,
|
|
60
60
|
className: m(
|
|
61
61
|
"w-full flex items-center text-start text-base px-5 py-4 rounded-t cursor-pointer",
|
|
62
62
|
f,
|
|
63
|
-
|
|
63
|
+
e
|
|
64
64
|
),
|
|
65
65
|
onClick: p,
|
|
66
66
|
...i,
|
|
@@ -69,34 +69,34 @@ function H({
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
function I({
|
|
72
|
-
className:
|
|
73
|
-
...
|
|
72
|
+
className: o,
|
|
73
|
+
...e
|
|
74
74
|
}) {
|
|
75
|
-
const t =
|
|
76
|
-
return /* @__PURE__ */
|
|
75
|
+
const t = l((i) => i.accordion.icon), { active: n } = s(d);
|
|
76
|
+
return /* @__PURE__ */ a.jsx(
|
|
77
77
|
j,
|
|
78
78
|
{
|
|
79
79
|
color: "currentColor",
|
|
80
80
|
className: m(
|
|
81
81
|
"size-5 transition-transform",
|
|
82
|
-
t
|
|
82
|
+
t == null ? void 0 : t.base,
|
|
83
83
|
n ? "-rotate-180" : "rotate-0",
|
|
84
|
-
n ? t
|
|
85
|
-
|
|
84
|
+
n ? t == null ? void 0 : t.active : t == null ? void 0 : t.inactive,
|
|
85
|
+
o
|
|
86
86
|
),
|
|
87
|
-
...
|
|
87
|
+
...e
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
function K({
|
|
92
|
-
duration:
|
|
93
|
-
children:
|
|
92
|
+
duration: o = 300,
|
|
93
|
+
children: e
|
|
94
94
|
}) {
|
|
95
|
-
const { active: t } =
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
95
|
+
const { active: t } = s(d);
|
|
96
|
+
return /* @__PURE__ */ a.jsx(
|
|
97
|
+
b,
|
|
98
98
|
{
|
|
99
|
-
duration:
|
|
99
|
+
duration: o,
|
|
100
100
|
height: t ? "auto" : 0,
|
|
101
101
|
className: "w-full",
|
|
102
102
|
animationStateClasses: {
|
|
@@ -111,34 +111,34 @@ function K({
|
|
|
111
111
|
staticHeightAuto: "",
|
|
112
112
|
staticHeightSpecific: ""
|
|
113
113
|
},
|
|
114
|
-
children:
|
|
114
|
+
children: e
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
function N({
|
|
119
|
-
className:
|
|
120
|
-
children:
|
|
119
|
+
className: o,
|
|
120
|
+
children: e,
|
|
121
121
|
...t
|
|
122
122
|
}) {
|
|
123
|
-
const n =
|
|
124
|
-
return /* @__PURE__ */
|
|
123
|
+
const n = l((i) => i.accordion.body.base);
|
|
124
|
+
return /* @__PURE__ */ a.jsx(
|
|
125
125
|
"div",
|
|
126
126
|
{
|
|
127
127
|
className: m(
|
|
128
128
|
"w-full block px-5 py-4 rounded-b",
|
|
129
129
|
n,
|
|
130
|
-
|
|
130
|
+
o
|
|
131
131
|
),
|
|
132
132
|
...t,
|
|
133
|
-
children:
|
|
133
|
+
children: e
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
u.Item = w;
|
|
138
|
+
u.Toggle = H;
|
|
139
|
+
u.Icon = I;
|
|
140
|
+
u.Collapse = K;
|
|
141
|
+
u.Body = N;
|
|
142
142
|
export {
|
|
143
|
-
|
|
143
|
+
u as default
|
|
144
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const w=require("../../_virtual/jsx-runtime.cjs.js"),a=require("../../helpers/cn.cjs.js"),u=require("react"),h=require("../../hooks/useClasses.cjs.js"),k=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function q({as:x,variant:i="solid",color:n=null,size:s="md",className:c,children:l,...p}){const e=h(r=>r.badge),m=x||"span",f=u.useMemo(()=>{var t,b,g;if(!n)return"border-transparent";const r={primary:{solid:"bg-primary text-white border-primary",outline:"bg-transparent text-primary border-primary",soft:"bg-primary/10 text-primary border-primary/10"},secondary:{solid:"bg-secondary text-white border-secondary",outline:"bg-transparent text-secondary border-secondary",soft:"bg-secondary/10 text-secondary border-secondary/10"},success:{solid:"bg-success text-white border-success",outline:"bg-transparent text-success border-success",soft:"bg-success/10 text-success border-success/10"},info:{solid:"bg-info text-white border-info",outline:"bg-transparent text-info border-info",soft:"bg-info/10 text-info border-info/10"},warning:{solid:"bg-warning text-white border-warning",outline:"bg-transparent text-warning border-warning",soft:"bg-warning/10 text-warning border-warning/10"},danger:{solid:"bg-danger text-white border-danger",outline:"bg-transparent text-danger border-danger",soft:"bg-danger/10 text-danger border-danger/10"},dark:{solid:"bg-dark text-white border-dark",outline:"bg-transparent text-dark border-dark",soft:"bg-dark/10 text-dark border-dark/10"},light:{solid:"bg-light text-dark border-light",outline:"bg-transparent text-dark border-light",soft:"bg-light/10 text-dark border-light/10"}},o=(t=r==null?void 0:r[n])==null?void 0:t[i],d=(g=(b=e==null?void 0:e.color)==null?void 0:b[n])==null?void 0:g[i];return[o,d]},[n,i,e==null?void 0:e.color]),y=u.useMemo(()=>{var o,d,t;if(!s)return null;const r={sm:a("text-xs py-0.5 px-1.5",(o=e==null?void 0:e.size)==null?void 0:o.sm),md:a("text-sm py-[0.1875rem] px-2",(d=e==null?void 0:e.size)==null?void 0:d.md),lg:a("text-base py-1 px-3",(t=e==null?void 0:e.size)==null?void 0:t.lg)};return r==null?void 0:r[s]},[s,e==null?void 0:e.size]);return w.jsxRuntimeExports.jsx(m,{className:k.twMerge("inline-flex border border-[#e8eaee] items-center text-center font-medium align-middle whitespace-nowrap rounded",e==null?void 0:e.base,f,y,c),...p,children:l})}module.exports=q;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as
|
|
3
|
-
import
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import
|
|
6
|
-
import { twMerge as
|
|
7
|
-
function
|
|
8
|
-
as:
|
|
9
|
-
variant:
|
|
10
|
-
color:
|
|
11
|
-
size:
|
|
12
|
-
className:
|
|
13
|
-
children:
|
|
14
|
-
...
|
|
2
|
+
import { j as w } from "../../_virtual/jsx-runtime.es.js";
|
|
3
|
+
import s from "../../helpers/cn.es.js";
|
|
4
|
+
import { useMemo as x } from "react";
|
|
5
|
+
import h from "../../hooks/useClasses.es.js";
|
|
6
|
+
import { twMerge as k } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
+
function B({
|
|
8
|
+
as: p,
|
|
9
|
+
variant: i = "solid",
|
|
10
|
+
color: n = null,
|
|
11
|
+
size: a = "md",
|
|
12
|
+
className: m,
|
|
13
|
+
children: u,
|
|
14
|
+
...l
|
|
15
15
|
}) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const r = h((e) => e.badge), c = p || "span", f = x(() => {
|
|
17
|
+
var t, b, g;
|
|
18
|
+
if (!n) return "border-transparent";
|
|
19
|
+
const e = {
|
|
19
20
|
primary: {
|
|
20
21
|
solid: "bg-primary text-white border-primary",
|
|
21
22
|
outline: "bg-transparent text-primary border-primary",
|
|
@@ -56,28 +57,33 @@ function j({
|
|
|
56
57
|
outline: "bg-transparent text-dark border-light",
|
|
57
58
|
soft: "bg-light/10 text-dark border-light/10"
|
|
58
59
|
}
|
|
59
|
-
}
|
|
60
|
-
return [
|
|
61
|
-
}, [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
}, o = (t = e == null ? void 0 : e[n]) == null ? void 0 : t[i], d = (g = (b = r == null ? void 0 : r.color) == null ? void 0 : b[n]) == null ? void 0 : g[i];
|
|
61
|
+
return [o, d];
|
|
62
|
+
}, [n, i, r == null ? void 0 : r.color]), y = x(() => {
|
|
63
|
+
var o, d, t;
|
|
64
|
+
if (!a) return null;
|
|
65
|
+
const e = {
|
|
66
|
+
sm: s("text-xs py-0.5 px-1.5", (o = r == null ? void 0 : r.size) == null ? void 0 : o.sm),
|
|
67
|
+
md: s("text-sm py-[0.1875rem] px-2", (d = r == null ? void 0 : r.size) == null ? void 0 : d.md),
|
|
68
|
+
lg: s("text-base py-1 px-3", (t = r == null ? void 0 : r.size) == null ? void 0 : t.lg)
|
|
69
|
+
};
|
|
70
|
+
return e == null ? void 0 : e[a];
|
|
71
|
+
}, [a, r == null ? void 0 : r.size]);
|
|
72
|
+
return /* @__PURE__ */ w.jsx(
|
|
73
|
+
c,
|
|
68
74
|
{
|
|
69
|
-
className:
|
|
75
|
+
className: k(
|
|
70
76
|
"inline-flex border border-[#e8eaee] items-center text-center font-medium align-middle whitespace-nowrap rounded",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
r == null ? void 0 : r.base,
|
|
78
|
+
f,
|
|
79
|
+
y,
|
|
80
|
+
m
|
|
75
81
|
),
|
|
76
|
-
...
|
|
77
|
-
children:
|
|
82
|
+
...l,
|
|
83
|
+
children: u
|
|
78
84
|
}
|
|
79
85
|
);
|
|
80
86
|
}
|
|
81
87
|
export {
|
|
82
|
-
|
|
88
|
+
B as default
|
|
83
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const
|
|
1
|
+
"use client";"use strict";const u=require("../../_virtual/jsx-runtime.cjs.js"),i=require("../../helpers/cn.cjs.js");require("react");const c=require("../../hooks/useClasses.cjs.js");function x({as:s,className:t,...n}){const e=c(o=>o.box),r=s||"div";return u.jsxRuntimeExports.jsx(r,{className:i(e==null?void 0:e.base,t),...n})}module.exports=x;
|