reaxify 0.0.26 → 0.0.28
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 strict";const
|
|
1
|
+
"use strict";const p=require("../../node_modules/react/jsx-runtime.cjs.js"),n=require("react"),Mt=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),r=require("../../helpers/cn.cjs.js"),Rt=require("../../hooks/useClasses.cjs.js"),st=require("../../hooks/useCreateRipple.cjs.js");require("../Form/index.cjs.js");const Et=require("../ButtonGroup/index.cjs.js"),Nt=require("../Drawer/index.cjs.js"),$t=require("../Modal/index.cjs.js"),Bt=require("../Spinner/index.cjs.js");function Dt({as:xt,variant:bt,color:l,size:pt,loading:lt,stopPropagation:gt=!1,closeModal:ct=!1,closeDrawer:mt=!1,className:ft,onClick:g,children:yt,...m}){const t=Rt(e=>e.button),i=n.useContext(Et.ButtonGroupContext),wt=n.useContext($t.ModalContext),ht=n.useContext(Nt.DrawerContext),Ct=st(),kt=xt||"button",f=bt??i.variant??"solid",c=n.useMemo(()=>l!==void 0?l:i.color!==void 0?i.color:"primary",[l,i.color]),x=pt??i.size??"md",b=lt??i.loading??!1,d=n.useMemo(()=>{var o,a,u,y,w,h,C,k,j,q,v,z,M,R,s,E,N,$,B,D,G,P,W,A,F,H,I,J,K,L,O,Q,S,T,U,V,X,Y,Z,_,tt,rt,et,ot,nt,it,dt,at,ut;if(!c)return"border-transparent";const e={primary:{solid:r("bg-primary text-white border-primary",(a=(o=t==null?void 0:t.color)==null?void 0:o.primary)==null?void 0:a.solid),outline:r("bg-transparent text-primary border-primary",(y=(u=t==null?void 0:t.color)==null?void 0:u.primary)==null?void 0:y.outline),text:r("bg-transparent text-primary border-transparent",(h=(w=t==null?void 0:t.color)==null?void 0:w.primary)==null?void 0:h.text)},secondary:{solid:r("bg-secondary text-white border-secondary",(k=(C=t==null?void 0:t.color)==null?void 0:C.secondary)==null?void 0:k.solid),outline:r("bg-transparent text-secondary border-secondary",(q=(j=t==null?void 0:t.color)==null?void 0:j.secondary)==null?void 0:q.outline),text:r("bg-transparent text-secondary border-transparent",(z=(v=t==null?void 0:t.color)==null?void 0:v.secondary)==null?void 0:z.text)},success:{solid:r("bg-success text-white border-success",(R=(M=t==null?void 0:t.color)==null?void 0:M.success)==null?void 0:R.solid),outline:r("bg-transparent text-success border-success",(E=(s=t==null?void 0:t.color)==null?void 0:s.success)==null?void 0:E.outline),text:r("bg-transparent text-success border-transparent",($=(N=t==null?void 0:t.color)==null?void 0:N.success)==null?void 0:$.text)},info:{solid:r("bg-info text-white border-info",(D=(B=t==null?void 0:t.color)==null?void 0:B.info)==null?void 0:D.solid),outline:r("bg-transparent text-info border-info",(P=(G=t==null?void 0:t.color)==null?void 0:G.info)==null?void 0:P.outline),text:r("bg-transparent text-info border-transparent",(A=(W=t==null?void 0:t.color)==null?void 0:W.info)==null?void 0:A.text)},warning:{solid:r("bg-warning text-white border-warning",(H=(F=t==null?void 0:t.color)==null?void 0:F.warning)==null?void 0:H.solid),outline:r("bg-transparent text-warning border-warning",(J=(I=t==null?void 0:t.color)==null?void 0:I.warning)==null?void 0:J.outline),text:r("bg-transparent text-warning border-transparent",(L=(K=t==null?void 0:t.color)==null?void 0:K.warning)==null?void 0:L.text)},danger:{solid:r("bg-danger text-white border-danger",(Q=(O=t==null?void 0:t.color)==null?void 0:O.danger)==null?void 0:Q.solid),outline:r("bg-transparent text-danger border-danger",(T=(S=t==null?void 0:t.color)==null?void 0:S.danger)==null?void 0:T.outline),text:r("bg-transparent text-danger border-transparent",(V=(U=t==null?void 0:t.color)==null?void 0:U.danger)==null?void 0:V.text)},dark:{solid:r("bg-dark text-white border-dark",(Y=(X=t==null?void 0:t.color)==null?void 0:X.dark)==null?void 0:Y.solid),outline:r("bg-transparent text-dark border-dark",(_=(Z=t==null?void 0:t.color)==null?void 0:Z.dark)==null?void 0:_.outline),text:r("bg-transparent text-dark border-transparent",(rt=(tt=t==null?void 0:t.color)==null?void 0:tt.dark)==null?void 0:rt.text)},light:{solid:r("bg-light text-dark border-light",(ot=(et=t==null?void 0:t.color)==null?void 0:et.light)==null?void 0:ot.solid),outline:r("bg-transparent text-dark border-light",(it=(nt=t==null?void 0:t.color)==null?void 0:nt.light)==null?void 0:it.outline),text:r("bg-transparent text-dark border-transparent",(at=(dt=t==null?void 0:t.color)==null?void 0:dt.light)==null?void 0:at.text)}};return((ut=e==null?void 0:e[c])==null?void 0:ut[f])??null},[c,f,t==null?void 0:t.color]),jt=n.useMemo(()=>d==null?void 0:d.split(" ").find(e=>e.startsWith("text-")),[d]),qt=n.useMemo(()=>{var o,a,u;if(!x)return null;const e={sm:r("text-base py-1 px-3.5",(o=t==null?void 0:t.size)==null?void 0:o.sm),md:r("text-base py-1.5 px-4",(a=t==null?void 0:t.size)==null?void 0:a.md),lg:r("text-lg py-2 px-6",(u=t==null?void 0:t.size)==null?void 0:u.lg)};return e==null?void 0:e[x]},[x,t==null?void 0:t.size]),vt=n.useMemo(()=>{var e,o;return b?r("disabled:opacity-100 disabled:cursor-wait disabled:text-transparent",(e=t==null?void 0:t.loading)==null?void 0:e.active):r("disabled:opacity-75 disabled:cursor-not-allowed",(o=t==null?void 0:t.loading)==null?void 0:o.active)},[b,t==null?void 0:t.loading]),zt=e=>{Ct(e),ct&&wt.onClose(),mt&&ht.onClose(),gt&&e.stopPropagation(),g==null||g(e)};return p.jsxRuntimeExports.jsxs(kt,{className:Mt.twMerge("relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] cursor-pointer transition-[box-shadow,opacity,color,background-color,border-color]",t==null?void 0:t.base,d,qt,vt,i.buttonClasses,ft),onClick:zt,disabled:m.disabled||b,...m,children:[yt,b&&p.jsxRuntimeExports.jsx("span",{className:"absolute inset-0 size-full flex items-center justify-center bg-transparent p-2",children:p.jsxRuntimeExports.jsx(Bt,{size:x,color:null,className:jt})}),p.jsxRuntimeExports.jsx("span",{className:"ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none"})]})}module.exports=Dt;
|
|
@@ -1,195 +1,195 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { twMerge as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { j as l } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useContext as f, useMemo as p } from "react";
|
|
3
|
+
import { twMerge as Rr } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
4
|
+
import t from "../../helpers/cn.es.js";
|
|
5
|
+
import Br from "../../hooks/useClasses.es.js";
|
|
6
|
+
import Dr from "../../hooks/useCreateRipple.es.js";
|
|
7
7
|
import "../Form/index.es.js";
|
|
8
|
-
import { ButtonGroupContext as
|
|
9
|
-
import { DrawerContext as
|
|
10
|
-
import { ModalContext as
|
|
11
|
-
import
|
|
12
|
-
function
|
|
13
|
-
as:
|
|
14
|
-
variant:
|
|
15
|
-
color:
|
|
16
|
-
size:
|
|
17
|
-
loading:
|
|
18
|
-
stopPropagation:
|
|
19
|
-
closeModal:
|
|
20
|
-
closeDrawer:
|
|
21
|
-
className:
|
|
22
|
-
onClick:
|
|
23
|
-
children:
|
|
24
|
-
...
|
|
8
|
+
import { ButtonGroupContext as Gr } from "../ButtonGroup/index.es.js";
|
|
9
|
+
import { DrawerContext as Er } from "../Drawer/index.es.js";
|
|
10
|
+
import { ModalContext as Pr } from "../Modal/index.es.js";
|
|
11
|
+
import Sr from "../Spinner/index.es.js";
|
|
12
|
+
function Tr({
|
|
13
|
+
as: ur,
|
|
14
|
+
variant: lr,
|
|
15
|
+
color: g,
|
|
16
|
+
size: gr,
|
|
17
|
+
loading: xr,
|
|
18
|
+
stopPropagation: mr = !1,
|
|
19
|
+
closeModal: fr = !1,
|
|
20
|
+
closeDrawer: cr = !1,
|
|
21
|
+
className: yr,
|
|
22
|
+
onClick: x,
|
|
23
|
+
children: wr,
|
|
24
|
+
...c
|
|
25
25
|
}) {
|
|
26
|
-
const r =
|
|
27
|
-
var
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
26
|
+
const r = Br((o) => o.button), e = f(Gr), hr = f(Pr), kr = f(Er), Cr = Dr(), vr = ur || "button", y = lr ?? e.variant ?? "solid", m = p(() => g !== void 0 ? g : e.color !== void 0 ? e.color : "primary", [g, e.color]), b = gr ?? e.size ?? "md", u = xr ?? e.loading ?? !1, i = p(() => {
|
|
27
|
+
var n, d, a, w, h, k, C, v, z, j, N, M, R, B, D, G, E, P, S, W, q, A, F, H, I, J, K, L, O, Q, T, U, V, X, Y, Z, _, $, s, rr, tr, or, nr, er, ir, dr, ar, pr, br;
|
|
28
|
+
if (!m) return "border-transparent";
|
|
29
|
+
const o = {
|
|
30
30
|
primary: {
|
|
31
|
-
solid:
|
|
32
|
-
"bg-primary text-white border-primary
|
|
33
|
-
(
|
|
31
|
+
solid: t(
|
|
32
|
+
"bg-primary text-white border-primary",
|
|
33
|
+
(d = (n = r == null ? void 0 : r.color) == null ? void 0 : n.primary) == null ? void 0 : d.solid
|
|
34
34
|
),
|
|
35
|
-
outline:
|
|
36
|
-
"bg-transparent text-primary border-primary
|
|
37
|
-
(
|
|
35
|
+
outline: t(
|
|
36
|
+
"bg-transparent text-primary border-primary",
|
|
37
|
+
(w = (a = r == null ? void 0 : r.color) == null ? void 0 : a.primary) == null ? void 0 : w.outline
|
|
38
38
|
),
|
|
39
|
-
text:
|
|
40
|
-
"bg-transparent text-primary border-transparent
|
|
41
|
-
(
|
|
39
|
+
text: t(
|
|
40
|
+
"bg-transparent text-primary border-transparent",
|
|
41
|
+
(k = (h = r == null ? void 0 : r.color) == null ? void 0 : h.primary) == null ? void 0 : k.text
|
|
42
42
|
)
|
|
43
43
|
},
|
|
44
44
|
secondary: {
|
|
45
|
-
solid:
|
|
46
|
-
"bg-secondary text-white border-secondary
|
|
47
|
-
(
|
|
45
|
+
solid: t(
|
|
46
|
+
"bg-secondary text-white border-secondary",
|
|
47
|
+
(v = (C = r == null ? void 0 : r.color) == null ? void 0 : C.secondary) == null ? void 0 : v.solid
|
|
48
48
|
),
|
|
49
|
-
outline:
|
|
50
|
-
"bg-transparent text-secondary border-secondary
|
|
51
|
-
(
|
|
49
|
+
outline: t(
|
|
50
|
+
"bg-transparent text-secondary border-secondary",
|
|
51
|
+
(j = (z = r == null ? void 0 : r.color) == null ? void 0 : z.secondary) == null ? void 0 : j.outline
|
|
52
52
|
),
|
|
53
|
-
text:
|
|
54
|
-
"bg-transparent text-secondary border-transparent
|
|
55
|
-
(
|
|
53
|
+
text: t(
|
|
54
|
+
"bg-transparent text-secondary border-transparent",
|
|
55
|
+
(M = (N = r == null ? void 0 : r.color) == null ? void 0 : N.secondary) == null ? void 0 : M.text
|
|
56
56
|
)
|
|
57
57
|
},
|
|
58
58
|
success: {
|
|
59
|
-
solid:
|
|
60
|
-
"bg-success text-white border-success
|
|
61
|
-
(
|
|
59
|
+
solid: t(
|
|
60
|
+
"bg-success text-white border-success",
|
|
61
|
+
(B = (R = r == null ? void 0 : r.color) == null ? void 0 : R.success) == null ? void 0 : B.solid
|
|
62
62
|
),
|
|
63
|
-
outline:
|
|
64
|
-
"bg-transparent text-success border-success
|
|
65
|
-
(
|
|
63
|
+
outline: t(
|
|
64
|
+
"bg-transparent text-success border-success",
|
|
65
|
+
(G = (D = r == null ? void 0 : r.color) == null ? void 0 : D.success) == null ? void 0 : G.outline
|
|
66
66
|
),
|
|
67
|
-
text:
|
|
68
|
-
"bg-transparent text-success border-transparent
|
|
69
|
-
(
|
|
67
|
+
text: t(
|
|
68
|
+
"bg-transparent text-success border-transparent",
|
|
69
|
+
(P = (E = r == null ? void 0 : r.color) == null ? void 0 : E.success) == null ? void 0 : P.text
|
|
70
70
|
)
|
|
71
71
|
},
|
|
72
72
|
info: {
|
|
73
|
-
solid:
|
|
74
|
-
"bg-info text-white border-info
|
|
75
|
-
(
|
|
73
|
+
solid: t(
|
|
74
|
+
"bg-info text-white border-info",
|
|
75
|
+
(W = (S = r == null ? void 0 : r.color) == null ? void 0 : S.info) == null ? void 0 : W.solid
|
|
76
76
|
),
|
|
77
|
-
outline:
|
|
78
|
-
"bg-transparent text-info border-info
|
|
79
|
-
(
|
|
77
|
+
outline: t(
|
|
78
|
+
"bg-transparent text-info border-info",
|
|
79
|
+
(A = (q = r == null ? void 0 : r.color) == null ? void 0 : q.info) == null ? void 0 : A.outline
|
|
80
80
|
),
|
|
81
|
-
text:
|
|
82
|
-
"bg-transparent text-info border-transparent
|
|
83
|
-
(
|
|
81
|
+
text: t(
|
|
82
|
+
"bg-transparent text-info border-transparent",
|
|
83
|
+
(H = (F = r == null ? void 0 : r.color) == null ? void 0 : F.info) == null ? void 0 : H.text
|
|
84
84
|
)
|
|
85
85
|
},
|
|
86
86
|
warning: {
|
|
87
|
-
solid:
|
|
88
|
-
"bg-warning text-white border-warning
|
|
89
|
-
(
|
|
87
|
+
solid: t(
|
|
88
|
+
"bg-warning text-white border-warning",
|
|
89
|
+
(J = (I = r == null ? void 0 : r.color) == null ? void 0 : I.warning) == null ? void 0 : J.solid
|
|
90
90
|
),
|
|
91
|
-
outline:
|
|
92
|
-
"bg-transparent text-warning border-warning
|
|
93
|
-
(
|
|
91
|
+
outline: t(
|
|
92
|
+
"bg-transparent text-warning border-warning",
|
|
93
|
+
(L = (K = r == null ? void 0 : r.color) == null ? void 0 : K.warning) == null ? void 0 : L.outline
|
|
94
94
|
),
|
|
95
|
-
text:
|
|
96
|
-
"bg-transparent text-warning border-transparent
|
|
97
|
-
(
|
|
95
|
+
text: t(
|
|
96
|
+
"bg-transparent text-warning border-transparent",
|
|
97
|
+
(Q = (O = r == null ? void 0 : r.color) == null ? void 0 : O.warning) == null ? void 0 : Q.text
|
|
98
98
|
)
|
|
99
99
|
},
|
|
100
100
|
danger: {
|
|
101
|
-
solid:
|
|
102
|
-
"bg-danger text-white border-danger
|
|
103
|
-
(
|
|
101
|
+
solid: t(
|
|
102
|
+
"bg-danger text-white border-danger",
|
|
103
|
+
(U = (T = r == null ? void 0 : r.color) == null ? void 0 : T.danger) == null ? void 0 : U.solid
|
|
104
104
|
),
|
|
105
|
-
outline:
|
|
106
|
-
"bg-transparent text-danger border-danger
|
|
107
|
-
(
|
|
105
|
+
outline: t(
|
|
106
|
+
"bg-transparent text-danger border-danger",
|
|
107
|
+
(X = (V = r == null ? void 0 : r.color) == null ? void 0 : V.danger) == null ? void 0 : X.outline
|
|
108
108
|
),
|
|
109
|
-
text:
|
|
110
|
-
"bg-transparent text-danger border-transparent
|
|
111
|
-
(
|
|
109
|
+
text: t(
|
|
110
|
+
"bg-transparent text-danger border-transparent",
|
|
111
|
+
(Z = (Y = r == null ? void 0 : r.color) == null ? void 0 : Y.danger) == null ? void 0 : Z.text
|
|
112
112
|
)
|
|
113
113
|
},
|
|
114
114
|
dark: {
|
|
115
|
-
solid:
|
|
116
|
-
"bg-dark text-white border-dark
|
|
117
|
-
(
|
|
115
|
+
solid: t(
|
|
116
|
+
"bg-dark text-white border-dark",
|
|
117
|
+
($ = (_ = r == null ? void 0 : r.color) == null ? void 0 : _.dark) == null ? void 0 : $.solid
|
|
118
118
|
),
|
|
119
|
-
outline:
|
|
120
|
-
"bg-transparent text-dark border-dark
|
|
121
|
-
(rr = (
|
|
119
|
+
outline: t(
|
|
120
|
+
"bg-transparent text-dark border-dark",
|
|
121
|
+
(rr = (s = r == null ? void 0 : r.color) == null ? void 0 : s.dark) == null ? void 0 : rr.outline
|
|
122
122
|
),
|
|
123
|
-
text:
|
|
124
|
-
"bg-transparent text-dark border-transparent
|
|
125
|
-
(
|
|
123
|
+
text: t(
|
|
124
|
+
"bg-transparent text-dark border-transparent",
|
|
125
|
+
(or = (tr = r == null ? void 0 : r.color) == null ? void 0 : tr.dark) == null ? void 0 : or.text
|
|
126
126
|
)
|
|
127
127
|
},
|
|
128
128
|
light: {
|
|
129
|
-
solid:
|
|
130
|
-
"bg-light text-dark border-light
|
|
131
|
-
(
|
|
129
|
+
solid: t(
|
|
130
|
+
"bg-light text-dark border-light",
|
|
131
|
+
(er = (nr = r == null ? void 0 : r.color) == null ? void 0 : nr.light) == null ? void 0 : er.solid
|
|
132
132
|
),
|
|
133
|
-
outline:
|
|
134
|
-
"bg-transparent text-dark border-light
|
|
135
|
-
(
|
|
133
|
+
outline: t(
|
|
134
|
+
"bg-transparent text-dark border-light",
|
|
135
|
+
(dr = (ir = r == null ? void 0 : r.color) == null ? void 0 : ir.light) == null ? void 0 : dr.outline
|
|
136
136
|
),
|
|
137
|
-
text:
|
|
138
|
-
"bg-transparent text-dark border-transparent
|
|
139
|
-
(
|
|
137
|
+
text: t(
|
|
138
|
+
"bg-transparent text-dark border-transparent",
|
|
139
|
+
(pr = (ar = r == null ? void 0 : r.color) == null ? void 0 : ar.light) == null ? void 0 : pr.text
|
|
140
140
|
)
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
return ((
|
|
144
|
-
}, [
|
|
145
|
-
var
|
|
146
|
-
if (!
|
|
147
|
-
const
|
|
148
|
-
sm:
|
|
149
|
-
md:
|
|
150
|
-
lg:
|
|
143
|
+
return ((br = o == null ? void 0 : o[m]) == null ? void 0 : br[y]) ?? null;
|
|
144
|
+
}, [m, y, r == null ? void 0 : r.color]), zr = p(() => i == null ? void 0 : i.split(" ").find((o) => o.startsWith("text-")), [i]), jr = p(() => {
|
|
145
|
+
var n, d, a;
|
|
146
|
+
if (!b) return null;
|
|
147
|
+
const o = {
|
|
148
|
+
sm: t("text-base py-1 px-3.5", (n = r == null ? void 0 : r.size) == null ? void 0 : n.sm),
|
|
149
|
+
md: t("text-base py-1.5 px-4", (d = r == null ? void 0 : r.size) == null ? void 0 : d.md),
|
|
150
|
+
lg: t("text-lg py-2 px-6", (a = r == null ? void 0 : r.size) == null ? void 0 : a.lg)
|
|
151
151
|
};
|
|
152
|
-
return
|
|
153
|
-
}, [
|
|
154
|
-
var
|
|
155
|
-
return
|
|
152
|
+
return o == null ? void 0 : o[b];
|
|
153
|
+
}, [b, r == null ? void 0 : r.size]), Nr = p(() => {
|
|
154
|
+
var o, n;
|
|
155
|
+
return u ? t(
|
|
156
156
|
"disabled:opacity-100 disabled:cursor-wait disabled:text-transparent",
|
|
157
|
-
(
|
|
158
|
-
) :
|
|
157
|
+
(o = r == null ? void 0 : r.loading) == null ? void 0 : o.active
|
|
158
|
+
) : t(
|
|
159
159
|
"disabled:opacity-75 disabled:cursor-not-allowed",
|
|
160
|
-
(
|
|
160
|
+
(n = r == null ? void 0 : r.loading) == null ? void 0 : n.active
|
|
161
161
|
);
|
|
162
|
-
}, [
|
|
163
|
-
|
|
162
|
+
}, [u, r == null ? void 0 : r.loading]), Mr = (o) => {
|
|
163
|
+
Cr(o), fr && hr.onClose(), cr && kr.onClose(), mr && o.stopPropagation(), x == null || x(o);
|
|
164
164
|
};
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
|
|
165
|
+
return /* @__PURE__ */ l.jsxs(
|
|
166
|
+
vr,
|
|
167
167
|
{
|
|
168
|
-
className:
|
|
168
|
+
className: Rr(
|
|
169
169
|
"relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] cursor-pointer transition-[box-shadow,opacity,color,background-color,border-color]",
|
|
170
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
170
|
+
// "focus:outline-none focus:ring-2 focus:ring-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
171
171
|
// variant === "solid"
|
|
172
172
|
// ? "shadow hover:shadow-md active:shadow-lg"
|
|
173
173
|
// : "shadow-none",
|
|
174
174
|
// color ? "ring-2 ring-offset-2 ring-transparent" : null,
|
|
175
175
|
r == null ? void 0 : r.base,
|
|
176
|
-
|
|
177
|
-
zr,
|
|
176
|
+
i,
|
|
178
177
|
jr,
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
Nr,
|
|
179
|
+
e.buttonClasses,
|
|
180
|
+
yr
|
|
181
181
|
),
|
|
182
|
-
onClick:
|
|
183
|
-
disabled:
|
|
184
|
-
...
|
|
182
|
+
onClick: Mr,
|
|
183
|
+
disabled: c.disabled || u,
|
|
184
|
+
...c,
|
|
185
185
|
children: [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
/* @__PURE__ */
|
|
186
|
+
wr,
|
|
187
|
+
u && /* @__PURE__ */ l.jsx("span", { className: "absolute inset-0 size-full flex items-center justify-center bg-transparent p-2", children: /* @__PURE__ */ l.jsx(Sr, { size: b, color: null, className: zr }) }),
|
|
188
|
+
/* @__PURE__ */ l.jsx("span", { className: "ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none" })
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
193
|
export {
|
|
194
|
-
|
|
194
|
+
Tr as default
|
|
195
195
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("../../node_modules/react/jsx-runtime.cjs.js"),t=require("../../helpers/cn.cjs.js"),p=require("react"),y=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function q({color:o="primary",value:u=0,animate:n=!1,className:s,...f}){const r=y(e=>e.progress),h=p.useMemo(()=>{var d,g,a,x,l,c,b,m;if(!o)return"border-transparent";const e={primary:t("bg-primary/15 text-primary",(d=r==null?void 0:r.color)==null?void 0:d.primary),secondary:t("bg-secondary/15 text-secondary",(g=r==null?void 0:r.color)==null?void 0:g.secondary),success:t("bg-success/15 text-success",(a=r==null?void 0:r.color)==null?void 0:a.success),info:t("bg-info/15 text-info",(x=r==null?void 0:r.color)==null?void 0:x.info),warning:t("bg-warning/15 text-warning",(l=r==null?void 0:r.color)==null?void 0:l.warning),danger:t("bg-danger/15 text-danger",(c=r==null?void 0:r.color)==null?void 0:c.danger),dark:t("bg-dark/15 text-dark",(b=r==null?void 0:r.color)==null?void 0:b.dark),light:t("bg-light/15 text-light",(m=r==null?void 0:r.color)==null?void 0:m.light)};return(e==null?void 0:e[o])??null},[o,r==null?void 0:r.color]),w=p.useMemo(()=>{if(!n)return`${Math.max(u,0)}%`},[u,n]);return i.jsxRuntimeExports.jsxs("div",{className:j.twMerge("relative block w-full h-
|
|
1
|
+
"use strict";const i=require("../../node_modules/react/jsx-runtime.cjs.js"),t=require("../../helpers/cn.cjs.js"),p=require("react"),y=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function q({color:o="primary",value:u=0,animate:n=!1,className:s,...f}){const r=y(e=>e.progress),h=p.useMemo(()=>{var d,g,a,x,l,c,b,m;if(!o)return"border-transparent";const e={primary:t("bg-primary/15 text-primary",(d=r==null?void 0:r.color)==null?void 0:d.primary),secondary:t("bg-secondary/15 text-secondary",(g=r==null?void 0:r.color)==null?void 0:g.secondary),success:t("bg-success/15 text-success",(a=r==null?void 0:r.color)==null?void 0:a.success),info:t("bg-info/15 text-info",(x=r==null?void 0:r.color)==null?void 0:x.info),warning:t("bg-warning/15 text-warning",(l=r==null?void 0:r.color)==null?void 0:l.warning),danger:t("bg-danger/15 text-danger",(c=r==null?void 0:r.color)==null?void 0:c.danger),dark:t("bg-dark/15 text-dark",(b=r==null?void 0:r.color)==null?void 0:b.dark),light:t("bg-light/15 text-light",(m=r==null?void 0:r.color)==null?void 0:m.light)};return(e==null?void 0:e[o])??null},[o,r==null?void 0:r.color]),w=p.useMemo(()=>{if(!n)return`${Math.max(u,0)}%`},[u,n]);return i.jsxRuntimeExports.jsxs("div",{className:j.twMerge("relative block w-full h-1.5 rounded-full overflow-hidden",r==null?void 0:r.base,h,s),...f,children:[i.jsxRuntimeExports.jsx("span",{style:{width:w},className:t("absolute h-full max-w-full bg-current rounded-[inherit] top-0 bottom-0 start-0",n?"animate-linear-progress-1":"transition-[width]")}),n&&i.jsxRuntimeExports.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=q;
|
|
@@ -5,6 +5,10 @@ type ColorClasses<T> = {
|
|
|
5
5
|
type SizeClasses = {
|
|
6
6
|
[key in Size]: string;
|
|
7
7
|
};
|
|
8
|
+
type ActiveClasses = {
|
|
9
|
+
active: string;
|
|
10
|
+
inactive: string;
|
|
11
|
+
};
|
|
8
12
|
export type ThemeProviderContextType = {
|
|
9
13
|
classes: {
|
|
10
14
|
accordion: {
|
|
@@ -16,9 +20,7 @@ export type ThemeProviderContextType = {
|
|
|
16
20
|
};
|
|
17
21
|
icon: {
|
|
18
22
|
base: string;
|
|
19
|
-
|
|
20
|
-
inactive: string;
|
|
21
|
-
};
|
|
23
|
+
} & ActiveClasses;
|
|
22
24
|
body: {
|
|
23
25
|
base: string;
|
|
24
26
|
};
|
|
@@ -43,10 +45,7 @@ export type ThemeProviderContextType = {
|
|
|
43
45
|
text: string;
|
|
44
46
|
}>;
|
|
45
47
|
size: SizeClasses;
|
|
46
|
-
loading:
|
|
47
|
-
active: string;
|
|
48
|
-
inactive: string;
|
|
49
|
-
};
|
|
48
|
+
loading: ActiveClasses;
|
|
50
49
|
};
|
|
51
50
|
buttonGroup: {
|
|
52
51
|
base: string;
|