reaxify 0.0.21 → 0.0.23
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/Button/index.cjs.js +1 -1
- package/dist/components/Button/index.es.js +124 -127
- package/dist/components/Drawer/index.cjs.js +1 -1
- package/dist/components/Drawer/index.es.js +10 -4
- package/dist/components/Spinner/index.cjs.js +1 -0
- package/dist/components/Spinner/index.d.ts +8 -0
- package/dist/components/Spinner/index.es.js +53 -0
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.es.js +24 -22
- package/dist/providers/ThemeProvider.d.ts +26 -115
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const b=require("../../node_modules/react/jsx-runtime.cjs.js"),n=require("react"),zr=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),o=require("../../helpers/cn.cjs.js"),Mr=require("../../hooks/useClasses.cjs.js"),Rr=require("../../hooks/useCreateRipple.cjs.js");require("../Form/index.cjs.js");const Er=require("../ButtonGroup/index.cjs.js"),Nr=require("../Drawer/index.cjs.js"),$r=require("../Modal/index.cjs.js"),Br=require("../Spinner/index.cjs.js");function Dr({as:sr,variant:gr,color:l,size:br,loading:lr,stopPropagation:cr=!1,closeModal:xr=!1,closeDrawer:pr=!1,className:fr,onClick:c,children:wr,...f}){const r=Mr(t=>t.button),i=n.useContext(Er.ButtonGroupContext),hr=n.useContext($r.ModalContext),mr=n.useContext(Nr.DrawerContext),vr=Rr(),yr=sr||"button",x=gr??i.variant??"solid",p=n.useMemo(()=>l!==void 0?l:i.color!==void 0?i.color:"primary",[l,i.color]),s=br??i.size??"md",g=lr??i.loading??!1,d=n.useMemo(()=>{var e,a,u,w,h,m,v,y,k,C,j,q,z,M,R,E,N,$,B,D,G,P,W,A,F,H,I,J,K,L,O,Q,S,T,U,V,X,Y,Z,_,rr,or,tr,er,nr,ir,dr,ar,ur;if(!p)return"border-transparent";const t={primary:{solid:o("bg-primary text-white border-primary shadow-primary focus-visible:ring-primary",(a=(e=r==null?void 0:r.color)==null?void 0:e.primary)==null?void 0:a.solid),outline:o("bg-transparent text-primary border-primary shadow-primary focus-visible:ring-primary",(w=(u=r==null?void 0:r.color)==null?void 0:u.primary)==null?void 0:w.outline),text:o("bg-transparent text-primary border-transparent shadow-primary focus-visible:ring-primary",(m=(h=r==null?void 0:r.color)==null?void 0:h.primary)==null?void 0:m.text)},secondary:{solid:o("bg-secondary text-white border-secondary shadow-secondary focus-visible:ring-secondary",(y=(v=r==null?void 0:r.color)==null?void 0:v.secondary)==null?void 0:y.solid),outline:o("bg-transparent text-secondary border-secondary shadow-secondary focus-visible:ring-secondary",(C=(k=r==null?void 0:r.color)==null?void 0:k.secondary)==null?void 0:C.outline),text:o("bg-transparent text-secondary border-transparent shadow-secondary focus-visible:ring-secondary",(q=(j=r==null?void 0:r.color)==null?void 0:j.secondary)==null?void 0:q.text)},success:{solid:o("bg-success text-white border-success shadow-success focus-visible:ring-success",(M=(z=r==null?void 0:r.color)==null?void 0:z.success)==null?void 0:M.solid),outline:o("bg-transparent text-success border-success shadow-success focus-visible:ring-success",(E=(R=r==null?void 0:r.color)==null?void 0:R.success)==null?void 0:E.outline),text:o("bg-transparent text-success border-transparent shadow-success focus-visible:ring-success",($=(N=r==null?void 0:r.color)==null?void 0:N.success)==null?void 0:$.text)},info:{solid:o("bg-info text-white border-info shadow-info focus-visible:ring-info",(D=(B=r==null?void 0:r.color)==null?void 0:B.info)==null?void 0:D.solid),outline:o("bg-transparent text-info border-info shadow-info focus-visible:ring-info",(P=(G=r==null?void 0:r.color)==null?void 0:G.info)==null?void 0:P.outline),text:o("bg-transparent text-info border-transparent shadow-info focus-visible:ring-info",(A=(W=r==null?void 0:r.color)==null?void 0:W.info)==null?void 0:A.text)},warning:{solid:o("bg-warning text-white border-warning shadow-warning focus-visible:ring-warning",(H=(F=r==null?void 0:r.color)==null?void 0:F.warning)==null?void 0:H.solid),outline:o("bg-transparent text-warning border-warning shadow-warning focus-visible:ring-warning",(J=(I=r==null?void 0:r.color)==null?void 0:I.warning)==null?void 0:J.outline),text:o("bg-transparent text-warning border-transparent shadow-warning focus-visible:ring-warning",(L=(K=r==null?void 0:r.color)==null?void 0:K.warning)==null?void 0:L.text)},danger:{solid:o("bg-danger text-white border-danger shadow-danger focus-visible:ring-danger",(Q=(O=r==null?void 0:r.color)==null?void 0:O.danger)==null?void 0:Q.solid),outline:o("bg-transparent text-danger border-danger shadow-danger focus-visible:ring-danger",(T=(S=r==null?void 0:r.color)==null?void 0:S.danger)==null?void 0:T.outline),text:o("bg-transparent text-danger border-transparent shadow-danger focus-visible:ring-danger",(V=(U=r==null?void 0:r.color)==null?void 0:U.danger)==null?void 0:V.text)},dark:{solid:o("bg-dark text-white border-dark shadow-dark focus-visible:ring-dark",(Y=(X=r==null?void 0:r.color)==null?void 0:X.dark)==null?void 0:Y.solid),outline:o("bg-transparent text-dark border-dark shadow-dark focus-visible:ring-dark",(_=(Z=r==null?void 0:r.color)==null?void 0:Z.dark)==null?void 0:_.outline),text:o("bg-transparent text-dark border-transparent shadow-dark focus-visible:ring-dark",(or=(rr=r==null?void 0:r.color)==null?void 0:rr.dark)==null?void 0:or.text)},light:{solid:o("bg-light text-dark border-light shadow-light focus-visible:ring-light",(er=(tr=r==null?void 0:r.color)==null?void 0:tr.light)==null?void 0:er.solid),outline:o("bg-transparent text-dark border-light shadow-light focus-visible:ring-light",(ir=(nr=r==null?void 0:r.color)==null?void 0:nr.light)==null?void 0:ir.outline),text:o("bg-transparent text-dark border-transparent shadow-light focus-visible:ring-light",(ar=(dr=r==null?void 0:r.color)==null?void 0:dr.light)==null?void 0:ar.text)}};return((ur=t==null?void 0:t[p])==null?void 0:ur[x])??null},[p,x,r==null?void 0:r.color]),kr=n.useMemo(()=>d==null?void 0:d.split(" ").find(t=>t.startsWith("text-")),[d]),Cr=n.useMemo(()=>{var e,a,u;if(!s)return null;const t={sm:o("text-base py-1 px-3.5",(e=r==null?void 0:r.size)==null?void 0:e.sm),md:o("text-base py-1.5 px-4",(a=r==null?void 0:r.size)==null?void 0:a.md),lg:o("text-lg py-2 px-6",(u=r==null?void 0:r.size)==null?void 0:u.lg)};return t==null?void 0:t[s]},[s,r==null?void 0:r.size]),jr=n.useMemo(()=>{var t,e;return g?o("disabled:opacity-100 disabled:cursor-wait disabled:text-transparent",(t=r==null?void 0:r.loading)==null?void 0:t.active):o("disabled:opacity-75 disabled:cursor-not-allowed",(e=r==null?void 0:r.loading)==null?void 0:e.active)},[g,r==null?void 0:r.loading]),qr=t=>{vr(t),xr&&hr.onClose(),pr&&mr.onClose(),cr&&t.stopPropagation(),c==null||c(t)};return b.jsxRuntimeExports.jsxs(yr,{className:zr.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]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","hover:shadow-sm active:shadow-md",x==="solid"?"shadow-xs":"shadow-none",r==null?void 0:r.base,d,Cr,jr,i.buttonClasses,fr),onClick:qr,disabled:f.disabled||g,...f,children:[wr,g&&b.jsxRuntimeExports.jsx("span",{className:"absolute inset-0 size-full flex items-center justify-center bg-transparent p-2",children:b.jsxRuntimeExports.jsx(Br,{size:s,color:null,className:kr})}),b.jsxRuntimeExports.jsx("span",{className:"ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none"})]})}module.exports=Dr;
|
|
@@ -1,193 +1,190 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { twMerge as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { j as b } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useContext as x, useMemo as g } from "react";
|
|
3
|
+
import { twMerge as Mr } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
4
|
+
import o from "../../helpers/cn.es.js";
|
|
5
|
+
import Rr from "../../hooks/useClasses.es.js";
|
|
6
|
+
import Br from "../../hooks/useCreateRipple.es.js";
|
|
7
7
|
import "../Form/index.es.js";
|
|
8
|
-
import { ButtonGroupContext as
|
|
9
|
-
import { DrawerContext as
|
|
8
|
+
import { ButtonGroupContext as Dr } from "../ButtonGroup/index.es.js";
|
|
9
|
+
import { DrawerContext as Gr } from "../Drawer/index.es.js";
|
|
10
10
|
import { ModalContext as Er } from "../Modal/index.es.js";
|
|
11
|
+
import Pr from "../Spinner/index.es.js";
|
|
11
12
|
function Qr({
|
|
12
|
-
as:
|
|
13
|
-
variant:
|
|
14
|
-
color:
|
|
15
|
-
size:
|
|
16
|
-
loading:
|
|
17
|
-
stopPropagation:
|
|
13
|
+
as: lr,
|
|
14
|
+
variant: br,
|
|
15
|
+
color: s,
|
|
16
|
+
size: sr,
|
|
17
|
+
loading: pr,
|
|
18
|
+
stopPropagation: cr = !1,
|
|
18
19
|
closeModal: fr = !1,
|
|
19
|
-
closeDrawer:
|
|
20
|
+
closeDrawer: xr = !1,
|
|
20
21
|
className: wr,
|
|
21
|
-
onClick:
|
|
22
|
+
onClick: p,
|
|
22
23
|
children: hr,
|
|
23
|
-
...
|
|
24
|
+
...w
|
|
24
25
|
}) {
|
|
25
|
-
const r =
|
|
26
|
-
var n, d, a, h, y, k,
|
|
27
|
-
if (!
|
|
28
|
-
const
|
|
26
|
+
const r = Rr((t) => t.button), i = x(Dr), mr = x(Er), vr = x(Gr), yr = Br(), kr = lr || "button", c = br ?? i.variant ?? "solid", f = g(() => s !== void 0 ? s : i.color !== void 0 ? i.color : "primary", [s, i.color]), u = sr ?? i.size ?? "md", l = pr ?? i.loading ?? !1, e = g(() => {
|
|
27
|
+
var n, d, a, h, m, v, y, k, C, 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, _, $, rr, or, tr, nr, ir, er, dr, ar, gr, ur;
|
|
28
|
+
if (!f) return "border-transparent";
|
|
29
|
+
const t = {
|
|
29
30
|
primary: {
|
|
30
|
-
solid:
|
|
31
|
-
"bg-primary text-white border-primary",
|
|
31
|
+
solid: o(
|
|
32
|
+
"bg-primary text-white border-primary shadow-primary focus-visible:ring-primary",
|
|
32
33
|
(d = (n = r == null ? void 0 : r.color) == null ? void 0 : n.primary) == null ? void 0 : d.solid
|
|
33
34
|
),
|
|
34
|
-
outline:
|
|
35
|
-
"bg-transparent text-primary border-primary",
|
|
35
|
+
outline: o(
|
|
36
|
+
"bg-transparent text-primary border-primary shadow-primary focus-visible:ring-primary",
|
|
36
37
|
(h = (a = r == null ? void 0 : r.color) == null ? void 0 : a.primary) == null ? void 0 : h.outline
|
|
37
38
|
),
|
|
38
|
-
text:
|
|
39
|
-
"bg-transparent text-primary border-transparent",
|
|
40
|
-
(
|
|
39
|
+
text: o(
|
|
40
|
+
"bg-transparent text-primary border-transparent shadow-primary focus-visible:ring-primary",
|
|
41
|
+
(v = (m = r == null ? void 0 : r.color) == null ? void 0 : m.primary) == null ? void 0 : v.text
|
|
41
42
|
)
|
|
42
43
|
},
|
|
43
44
|
secondary: {
|
|
44
|
-
solid:
|
|
45
|
-
"bg-secondary text-white border-secondary",
|
|
46
|
-
(
|
|
45
|
+
solid: o(
|
|
46
|
+
"bg-secondary text-white border-secondary shadow-secondary focus-visible:ring-secondary",
|
|
47
|
+
(k = (y = r == null ? void 0 : r.color) == null ? void 0 : y.secondary) == null ? void 0 : k.solid
|
|
47
48
|
),
|
|
48
|
-
outline:
|
|
49
|
-
"bg-transparent text-secondary border-secondary",
|
|
50
|
-
(
|
|
49
|
+
outline: o(
|
|
50
|
+
"bg-transparent text-secondary border-secondary shadow-secondary focus-visible:ring-secondary",
|
|
51
|
+
(z = (C = r == null ? void 0 : r.color) == null ? void 0 : C.secondary) == null ? void 0 : z.outline
|
|
51
52
|
),
|
|
52
|
-
text:
|
|
53
|
-
"bg-transparent text-secondary border-transparent",
|
|
54
|
-
(
|
|
53
|
+
text: o(
|
|
54
|
+
"bg-transparent text-secondary border-transparent shadow-secondary focus-visible:ring-secondary",
|
|
55
|
+
(N = (j = r == null ? void 0 : r.color) == null ? void 0 : j.secondary) == null ? void 0 : N.text
|
|
55
56
|
)
|
|
56
57
|
},
|
|
57
58
|
success: {
|
|
58
|
-
solid:
|
|
59
|
-
"bg-success text-white border-success",
|
|
60
|
-
(
|
|
59
|
+
solid: o(
|
|
60
|
+
"bg-success text-white border-success shadow-success focus-visible:ring-success",
|
|
61
|
+
(R = (M = r == null ? void 0 : r.color) == null ? void 0 : M.success) == null ? void 0 : R.solid
|
|
61
62
|
),
|
|
62
|
-
outline:
|
|
63
|
-
"bg-transparent text-success border-success",
|
|
64
|
-
(
|
|
63
|
+
outline: o(
|
|
64
|
+
"bg-transparent text-success border-success shadow-success focus-visible:ring-success",
|
|
65
|
+
(D = (B = r == null ? void 0 : r.color) == null ? void 0 : B.success) == null ? void 0 : D.outline
|
|
65
66
|
),
|
|
66
|
-
text:
|
|
67
|
-
"bg-transparent text-success border-transparent",
|
|
68
|
-
(E = (
|
|
67
|
+
text: o(
|
|
68
|
+
"bg-transparent text-success border-transparent shadow-success focus-visible:ring-success",
|
|
69
|
+
(E = (G = r == null ? void 0 : r.color) == null ? void 0 : G.success) == null ? void 0 : E.text
|
|
69
70
|
)
|
|
70
71
|
},
|
|
71
72
|
info: {
|
|
72
|
-
solid:
|
|
73
|
-
"bg-info text-white border-info",
|
|
74
|
-
(
|
|
73
|
+
solid: o(
|
|
74
|
+
"bg-info text-white border-info shadow-info focus-visible:ring-info",
|
|
75
|
+
(S = (P = r == null ? void 0 : r.color) == null ? void 0 : P.info) == null ? void 0 : S.solid
|
|
75
76
|
),
|
|
76
|
-
outline:
|
|
77
|
-
"bg-transparent text-info border-info",
|
|
78
|
-
(
|
|
77
|
+
outline: o(
|
|
78
|
+
"bg-transparent text-info border-info shadow-info focus-visible:ring-info",
|
|
79
|
+
(q = (W = r == null ? void 0 : r.color) == null ? void 0 : W.info) == null ? void 0 : q.outline
|
|
79
80
|
),
|
|
80
|
-
text:
|
|
81
|
-
"bg-transparent text-info border-transparent",
|
|
82
|
-
(
|
|
81
|
+
text: o(
|
|
82
|
+
"bg-transparent text-info border-transparent shadow-info focus-visible:ring-info",
|
|
83
|
+
(F = (A = r == null ? void 0 : r.color) == null ? void 0 : A.info) == null ? void 0 : F.text
|
|
83
84
|
)
|
|
84
85
|
},
|
|
85
86
|
warning: {
|
|
86
|
-
solid:
|
|
87
|
-
"bg-warning text-white border-warning",
|
|
88
|
-
(
|
|
87
|
+
solid: o(
|
|
88
|
+
"bg-warning text-white border-warning shadow-warning focus-visible:ring-warning",
|
|
89
|
+
(I = (H = r == null ? void 0 : r.color) == null ? void 0 : H.warning) == null ? void 0 : I.solid
|
|
89
90
|
),
|
|
90
|
-
outline:
|
|
91
|
-
"bg-transparent text-warning border-warning",
|
|
92
|
-
(
|
|
91
|
+
outline: o(
|
|
92
|
+
"bg-transparent text-warning border-warning shadow-warning focus-visible:ring-warning",
|
|
93
|
+
(K = (J = r == null ? void 0 : r.color) == null ? void 0 : J.warning) == null ? void 0 : K.outline
|
|
93
94
|
),
|
|
94
|
-
text:
|
|
95
|
-
"bg-transparent text-warning border-transparent",
|
|
96
|
-
(
|
|
95
|
+
text: o(
|
|
96
|
+
"bg-transparent text-warning border-transparent shadow-warning focus-visible:ring-warning",
|
|
97
|
+
(O = (L = r == null ? void 0 : r.color) == null ? void 0 : L.warning) == null ? void 0 : O.text
|
|
97
98
|
)
|
|
98
99
|
},
|
|
99
100
|
danger: {
|
|
100
|
-
solid:
|
|
101
|
-
"bg-danger text-white border-danger",
|
|
102
|
-
(
|
|
101
|
+
solid: o(
|
|
102
|
+
"bg-danger text-white border-danger shadow-danger focus-visible:ring-danger",
|
|
103
|
+
(T = (Q = r == null ? void 0 : r.color) == null ? void 0 : Q.danger) == null ? void 0 : T.solid
|
|
103
104
|
),
|
|
104
|
-
outline:
|
|
105
|
-
"bg-transparent text-danger border-danger",
|
|
106
|
-
(
|
|
105
|
+
outline: o(
|
|
106
|
+
"bg-transparent text-danger border-danger shadow-danger focus-visible:ring-danger",
|
|
107
|
+
(V = (U = r == null ? void 0 : r.color) == null ? void 0 : U.danger) == null ? void 0 : V.outline
|
|
107
108
|
),
|
|
108
|
-
text:
|
|
109
|
-
"bg-transparent text-danger border-transparent",
|
|
110
|
-
(
|
|
109
|
+
text: o(
|
|
110
|
+
"bg-transparent text-danger border-transparent shadow-danger focus-visible:ring-danger",
|
|
111
|
+
(Y = (X = r == null ? void 0 : r.color) == null ? void 0 : X.danger) == null ? void 0 : Y.text
|
|
111
112
|
)
|
|
112
113
|
},
|
|
113
114
|
dark: {
|
|
114
|
-
solid:
|
|
115
|
-
"bg-dark text-white border-dark",
|
|
116
|
-
(
|
|
115
|
+
solid: o(
|
|
116
|
+
"bg-dark text-white border-dark shadow-dark focus-visible:ring-dark",
|
|
117
|
+
(_ = (Z = r == null ? void 0 : r.color) == null ? void 0 : Z.dark) == null ? void 0 : _.solid
|
|
117
118
|
),
|
|
118
|
-
outline:
|
|
119
|
-
"bg-transparent text-dark border-dark",
|
|
120
|
-
(rr = (
|
|
119
|
+
outline: o(
|
|
120
|
+
"bg-transparent text-dark border-dark shadow-dark focus-visible:ring-dark",
|
|
121
|
+
(rr = ($ = r == null ? void 0 : r.color) == null ? void 0 : $.dark) == null ? void 0 : rr.outline
|
|
121
122
|
),
|
|
122
|
-
text:
|
|
123
|
-
"bg-transparent text-dark border-transparent",
|
|
124
|
-
(
|
|
123
|
+
text: o(
|
|
124
|
+
"bg-transparent text-dark border-transparent shadow-dark focus-visible:ring-dark",
|
|
125
|
+
(tr = (or = r == null ? void 0 : r.color) == null ? void 0 : or.dark) == null ? void 0 : tr.text
|
|
125
126
|
)
|
|
126
127
|
},
|
|
127
128
|
light: {
|
|
128
|
-
solid:
|
|
129
|
-
"bg-light text-dark border-light",
|
|
130
|
-
(
|
|
129
|
+
solid: o(
|
|
130
|
+
"bg-light text-dark border-light shadow-light focus-visible:ring-light",
|
|
131
|
+
(ir = (nr = r == null ? void 0 : r.color) == null ? void 0 : nr.light) == null ? void 0 : ir.solid
|
|
131
132
|
),
|
|
132
|
-
outline:
|
|
133
|
-
"bg-transparent text-dark border-light",
|
|
134
|
-
(dr = (
|
|
133
|
+
outline: o(
|
|
134
|
+
"bg-transparent text-dark border-light shadow-light focus-visible:ring-light",
|
|
135
|
+
(dr = (er = r == null ? void 0 : r.color) == null ? void 0 : er.light) == null ? void 0 : dr.outline
|
|
135
136
|
),
|
|
136
|
-
text:
|
|
137
|
-
"bg-transparent text-dark border-transparent",
|
|
138
|
-
(
|
|
137
|
+
text: o(
|
|
138
|
+
"bg-transparent text-dark border-transparent shadow-light focus-visible:ring-light",
|
|
139
|
+
(gr = (ar = r == null ? void 0 : r.color) == null ? void 0 : ar.light) == null ? void 0 : gr.text
|
|
139
140
|
)
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
|
-
return ((
|
|
143
|
-
}, [
|
|
143
|
+
return ((ur = t == null ? void 0 : t[f]) == null ? void 0 : ur[c]) ?? null;
|
|
144
|
+
}, [f, c, r == null ? void 0 : r.color]), Cr = g(() => e == null ? void 0 : e.split(" ").find((t) => t.startsWith("text-")), [e]), zr = g(() => {
|
|
144
145
|
var n, d, a;
|
|
145
|
-
if (!
|
|
146
|
-
const
|
|
147
|
-
sm:
|
|
148
|
-
md:
|
|
149
|
-
lg:
|
|
146
|
+
if (!u) return null;
|
|
147
|
+
const t = {
|
|
148
|
+
sm: o("text-base py-1 px-3.5", (n = r == null ? void 0 : r.size) == null ? void 0 : n.sm),
|
|
149
|
+
md: o("text-base py-1.5 px-4", (d = r == null ? void 0 : r.size) == null ? void 0 : d.md),
|
|
150
|
+
lg: o("text-lg py-2 px-6", (a = r == null ? void 0 : r.size) == null ? void 0 : a.lg)
|
|
150
151
|
};
|
|
151
|
-
return
|
|
152
|
-
}, [
|
|
153
|
-
var
|
|
154
|
-
return
|
|
152
|
+
return t == null ? void 0 : t[u];
|
|
153
|
+
}, [u, r == null ? void 0 : r.size]), jr = g(() => {
|
|
154
|
+
var t, n;
|
|
155
|
+
return l ? o(
|
|
155
156
|
"disabled:opacity-100 disabled:cursor-wait disabled:text-transparent",
|
|
156
|
-
(
|
|
157
|
-
) :
|
|
158
|
-
"disabled:opacity-75 disabled:cursor-not-allowed
|
|
157
|
+
(t = r == null ? void 0 : r.loading) == null ? void 0 : t.active
|
|
158
|
+
) : o(
|
|
159
|
+
"disabled:opacity-75 disabled:cursor-not-allowed",
|
|
159
160
|
(n = r == null ? void 0 : r.loading) == null ? void 0 : n.active
|
|
160
161
|
);
|
|
161
|
-
}, [
|
|
162
|
-
|
|
162
|
+
}, [l, r == null ? void 0 : r.loading]), Nr = (t) => {
|
|
163
|
+
yr(t), fr && mr.onClose(), xr && vr.onClose(), cr && t.stopPropagation(), p == null || p(t);
|
|
163
164
|
};
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
|
|
165
|
+
return /* @__PURE__ */ b.jsxs(
|
|
166
|
+
kr,
|
|
166
167
|
{
|
|
167
|
-
className:
|
|
168
|
-
"relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee]
|
|
168
|
+
className: Mr(
|
|
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-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
171
|
+
"hover:shadow-sm active:shadow-md",
|
|
172
|
+
c === "solid" ? "shadow-xs" : "shadow-none",
|
|
173
|
+
// color ? "ring-2 ring-offset-2 ring-transparent" : null,
|
|
169
174
|
r == null ? void 0 : r.base,
|
|
170
|
-
|
|
175
|
+
e,
|
|
176
|
+
zr,
|
|
171
177
|
jr,
|
|
172
|
-
|
|
173
|
-
e.buttonClasses,
|
|
178
|
+
i.buttonClasses,
|
|
174
179
|
wr
|
|
175
180
|
),
|
|
176
|
-
onClick:
|
|
177
|
-
disabled:
|
|
178
|
-
...
|
|
181
|
+
onClick: Nr,
|
|
182
|
+
disabled: w.disabled || l,
|
|
183
|
+
...w,
|
|
179
184
|
children: [
|
|
180
185
|
hr,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
{
|
|
184
|
-
className: t(
|
|
185
|
-
"h-full aspect-square rounded-full border-4 border-current border-l-transparent animate-spin",
|
|
186
|
-
zr
|
|
187
|
-
)
|
|
188
|
-
}
|
|
189
|
-
) }),
|
|
190
|
-
/* @__PURE__ */ u.jsx("span", { className: "ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none" })
|
|
186
|
+
l && /* @__PURE__ */ b.jsx("span", { className: "absolute inset-0 size-full flex items-center justify-center bg-transparent p-2", children: /* @__PURE__ */ b.jsx(Pr, { size: u, color: null, className: Cr }) }),
|
|
187
|
+
/* @__PURE__ */ b.jsx("span", { className: "ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none" })
|
|
191
188
|
]
|
|
192
189
|
}
|
|
193
190
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../node_modules/react/jsx-runtime.cjs.js"),d=require("react"),x=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const n=require("../../helpers/cn.cjs.js"),E=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),p=require("../Card/index.cjs.js"),M=require("../Portal/index.cjs.js"),q=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),j=d.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function c({as:a,open:r=!1,onClose:o=()=>{},duration:e=300,anchor:u="end",className:h="",children:y,...b}){const t=x(s=>s.drawer),l=d.useRef(null),m=a||"div",f={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:""},w=d.useMemo(()=>{var v,g,R,C;return{start:n("flex-row-reverse",(v=t==null?void 0:t.anchor)==null?void 0:v.start),end:n("flex-row",(g=t==null?void 0:t.anchor)==null?void 0:g.end),top:n("flex-col-reverse",(R=t==null?void 0:t.anchor)==null?void 0:R.top),bottom:n("flex-col",(C=t==null?void 0:t.anchor)==null?void 0:C.bottom)}[u]},[u,t==null?void 0:t.anchor]);return i.jsxRuntimeExports.jsx(M,{children:i.jsxRuntimeExports.jsx(q.default,{nodeRef:l,in:r,timeout:e,unmountOnExit:!0,children:s=>i.jsxRuntimeExports.jsxs(m,{ref:l,style:{transitionDuration:`${e}ms`},"data-open":r,className:E.twMerge("fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",t==null?void 0:t.base,f[s],w,h),...b,children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>o(),className:"h-full flex-1 opacity-0 cursor-default min-w-[5%]"}),i.jsxRuntimeExports.jsx(j.Provider,{value:{open:r,onClose:o,transitionState:s,duration:e,anchor:u},children:y})]})})})}function D({children:a,className:r="",...o}){const e=x(l=>l.drawer.menu),{anchor:u,duration:h,transitionState:y}=d.useContext(j),b=d.useMemo(()=>{var m,f,w,s;return{start:n("w-[
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../node_modules/react/jsx-runtime.cjs.js"),d=require("react"),x=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const n=require("../../helpers/cn.cjs.js"),E=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),p=require("../Card/index.cjs.js"),M=require("../Portal/index.cjs.js"),q=require("../../node_modules/react-transition-group/esm/Transition.cjs.js"),j=d.createContext({open:!1,onClose:()=>{},duration:300,anchor:"start",transitionState:"unmounted"});function c({as:a,open:r=!1,onClose:o=()=>{},duration:e=300,anchor:u="end",className:h="",children:y,...b}){const t=x(s=>s.drawer),l=d.useRef(null),m=a||"div",f={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:""},w=d.useMemo(()=>{var v,g,R,C;return{start:n("flex-row-reverse",(v=t==null?void 0:t.anchor)==null?void 0:v.start),end:n("flex-row",(g=t==null?void 0:t.anchor)==null?void 0:g.end),top:n("flex-col-reverse",(R=t==null?void 0:t.anchor)==null?void 0:R.top),bottom:n("flex-col",(C=t==null?void 0:t.anchor)==null?void 0:C.bottom)}[u]},[u,t==null?void 0:t.anchor]);return i.jsxRuntimeExports.jsx(M,{children:i.jsxRuntimeExports.jsx(q.default,{nodeRef:l,in:r,timeout:e,unmountOnExit:!0,children:s=>i.jsxRuntimeExports.jsxs(m,{ref:l,style:{transitionDuration:`${e}ms`},"data-open":r,className:E.twMerge("fixed size-full inset-0 flex z-10 bg-black/20 backdrop-blur transition-opacity [--drawer-ratio:1] rtl:[--drawer-ratio:-1]",t==null?void 0:t.base,f[s],w,h),...b,children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>o(),className:"h-full flex-1 opacity-0 cursor-default min-w-[5%]"}),i.jsxRuntimeExports.jsx(j.Provider,{value:{open:r,onClose:o,transitionState:s,duration:e,anchor:u},children:y})]})})})}function D({children:a,className:r="",...o}){const e=x(l=>l.drawer.menu),{anchor:u,duration:h,transitionState:y}=d.useContext(j),b=d.useMemo(()=>{var m,f,w,s;return{start:n("w-[31.875rem] h-full max-w-[97.5%] rounded-e",(m=e==null?void 0:e.anchor)==null?void 0:m.start),end:n("w-[31.875rem] h-full max-w-[97.5%] rounded-s",(f=e==null?void 0:e.anchor)==null?void 0:f.end),top:n("w-full h-[31.875rem] max-h-[97.5%] rounded-b",(w=e==null?void 0:e.anchor)==null?void 0:w.top),bottom:n("w-full h-[31.875rem] max-h-[97.5%] rounded-t",(s=e==null?void 0:e.anchor)==null?void 0:s.bottom)}[u]},[u,e==null?void 0:e.anchor]),t=d.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:""}})[u],[u]);return i.jsxRuntimeExports.jsx(p,{as:"div",style:{transitionDuration:`${h}ms`},className:E.twMerge("relative flex flex-col transition-[translate,width] rounded-none",e==null?void 0:e.base,t[y],b,r),...o,children:a})}function N({className:a,...r}){const o=x(e=>e.drawer.header.base);return i.jsxRuntimeExports.jsx(p.Header,{className:n(o,a),...r})}function S({className:a,...r}){const o=x(e=>e.drawer.body.base);return i.jsxRuntimeExports.jsx(p.Body,{className:n("flex-1 overflow-auto",o,a),...r})}function k({className:a,...r}){const o=x(e=>e.drawer.footer.base);return i.jsxRuntimeExports.jsx(p.Footer,{className:n(o,a),...r})}c.Menu=D;c.Header=N;c.Body=S;c.Footer=k;exports.DrawerContext=j;exports.default=c;
|
|
@@ -86,13 +86,19 @@ function H({ children: a, className: r = "", ...o }) {
|
|
|
86
86
|
var m, c, x, l;
|
|
87
87
|
return {
|
|
88
88
|
start: n(
|
|
89
|
-
"w-[
|
|
89
|
+
"w-[31.875rem] h-full max-w-[97.5%] rounded-e",
|
|
90
90
|
(m = t == null ? void 0 : t.anchor) == null ? void 0 : m.start
|
|
91
91
|
),
|
|
92
|
-
end: n(
|
|
93
|
-
|
|
92
|
+
end: n(
|
|
93
|
+
"w-[31.875rem] h-full max-w-[97.5%] rounded-s",
|
|
94
|
+
(c = t == null ? void 0 : t.anchor) == null ? void 0 : c.end
|
|
95
|
+
),
|
|
96
|
+
top: n(
|
|
97
|
+
"w-full h-[31.875rem] max-h-[97.5%] rounded-b",
|
|
98
|
+
(x = t == null ? void 0 : t.anchor) == null ? void 0 : x.top
|
|
99
|
+
),
|
|
94
100
|
bottom: n(
|
|
95
|
-
"w-full h-[
|
|
101
|
+
"w-full h-[31.875rem] max-h-[97.5%] rounded-t",
|
|
96
102
|
(l = t == null ? void 0 : t.anchor) == null ? void 0 : l.bottom
|
|
97
103
|
)
|
|
98
104
|
}[u];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const j=require("../../node_modules/react/jsx-runtime.cjs.js"),n=require("../../helpers/cn.cjs.js"),c=require("react"),k=require("../../hooks/useClasses.cjs.js");require("../Form/index.cjs.js");const w=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function M({color:t="primary",size:u="md",className:f,...q}){const r=k(o=>o.spinner),z=c.useMemo(()=>{var e,i,d,b,m,g,p,y;if(!t)return"border-current";const o={primary:n("border-primary",(e=r==null?void 0:r.color)==null?void 0:e.primary),secondary:n("border-secondary",(i=r==null?void 0:r.color)==null?void 0:i.secondary),success:n("border-success",(d=r==null?void 0:r.color)==null?void 0:d.success),info:n("border-info",(b=r==null?void 0:r.color)==null?void 0:b.info),warning:n("border-warning",(m=r==null?void 0:r.color)==null?void 0:m.warning),danger:n("border-danger",(g=r==null?void 0:r.color)==null?void 0:g.danger),dark:n("border-dark",(p=r==null?void 0:r.color)==null?void 0:p.dark),light:n("border-light",(y=r==null?void 0:r.color)==null?void 0:y.light)};return(o==null?void 0:o[t])??null},[t,r==null?void 0:r.color]),x=c.useMemo(()=>{var e,i,d;const o={sm:n("border-2 size-4",(e=r==null?void 0:r.size)==null?void 0:e.sm),md:n("border-3 size-6",(i=r==null?void 0:r.size)==null?void 0:i.md),lg:n("border-4 size-8",(d=r==null?void 0:r.size)==null?void 0:d.lg)};return o==null?void 0:o[u]},[u,r==null?void 0:r.size]);return j.jsxRuntimeExports.jsx("span",{className:w.twMerge("inline-block align-middle rounded-full animate-spin",r==null?void 0:r.base,z,"border-l-transparent",x,f),...q})}module.exports=M;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Color, ComponentPropsWithoutAs, Size } from '../../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
color?: Color | null;
|
|
4
|
+
size?: Size;
|
|
5
|
+
children?: never;
|
|
6
|
+
};
|
|
7
|
+
export default function Spinner({ color, size, className, ...props }: ComponentPropsWithoutAs<"span", Props>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { j as x } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import o from "../../helpers/cn.es.js";
|
|
3
|
+
import { useMemo as y } from "react";
|
|
4
|
+
import h from "../../hooks/useClasses.es.js";
|
|
5
|
+
import "../Form/index.es.js";
|
|
6
|
+
import { twMerge as j } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
+
function q({
|
|
8
|
+
color: e = "primary",
|
|
9
|
+
size: m = "md",
|
|
10
|
+
className: z,
|
|
11
|
+
...a
|
|
12
|
+
}) {
|
|
13
|
+
const r = h((n) => n.spinner), k = y(() => {
|
|
14
|
+
var i, d, t, p, u, b, g, f;
|
|
15
|
+
if (!e) return "border-current";
|
|
16
|
+
const n = {
|
|
17
|
+
primary: o("border-primary", (i = r == null ? void 0 : r.color) == null ? void 0 : i.primary),
|
|
18
|
+
secondary: o("border-secondary", (d = r == null ? void 0 : r.color) == null ? void 0 : d.secondary),
|
|
19
|
+
success: o("border-success", (t = r == null ? void 0 : r.color) == null ? void 0 : t.success),
|
|
20
|
+
info: o("border-info", (p = r == null ? void 0 : r.color) == null ? void 0 : p.info),
|
|
21
|
+
warning: o("border-warning", (u = r == null ? void 0 : r.color) == null ? void 0 : u.warning),
|
|
22
|
+
danger: o("border-danger", (b = r == null ? void 0 : r.color) == null ? void 0 : b.danger),
|
|
23
|
+
dark: o("border-dark", (g = r == null ? void 0 : r.color) == null ? void 0 : g.dark),
|
|
24
|
+
light: o("border-light", (f = r == null ? void 0 : r.color) == null ? void 0 : f.light)
|
|
25
|
+
};
|
|
26
|
+
return (n == null ? void 0 : n[e]) ?? null;
|
|
27
|
+
}, [e, r == null ? void 0 : r.color]), w = y(() => {
|
|
28
|
+
var i, d, t;
|
|
29
|
+
const n = {
|
|
30
|
+
sm: o("border-2 size-4", (i = r == null ? void 0 : r.size) == null ? void 0 : i.sm),
|
|
31
|
+
md: o("border-3 size-6", (d = r == null ? void 0 : r.size) == null ? void 0 : d.md),
|
|
32
|
+
lg: o("border-4 size-8", (t = r == null ? void 0 : r.size) == null ? void 0 : t.lg)
|
|
33
|
+
};
|
|
34
|
+
return n == null ? void 0 : n[m];
|
|
35
|
+
}, [m, r == null ? void 0 : r.size]);
|
|
36
|
+
return /* @__PURE__ */ x.jsx(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
className: j(
|
|
40
|
+
"inline-block align-middle rounded-full animate-spin",
|
|
41
|
+
r == null ? void 0 : r.base,
|
|
42
|
+
k,
|
|
43
|
+
"border-l-transparent",
|
|
44
|
+
w,
|
|
45
|
+
z
|
|
46
|
+
),
|
|
47
|
+
...a
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
q as default
|
|
53
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Accordion/index.cjs.js"),r=require("./Badge/index.cjs.js"),n=require("./Box/index.cjs.js"),i=require("./Button/index.cjs.js"),t=require("./ButtonGroup/index.cjs.js"),o=require("./Card/index.cjs.js"),u=require("./Drawer/index.cjs.js"),d=require("./Form/index.cjs.js"),c=require("./InputGroup/index.cjs.js"),s=require("./Menu/index.cjs.js"),q=require("./Modal/index.cjs.js"),x=require("./Portal/index.cjs.js"),$=require("./Progress/index.cjs.js"),a=require("./Skeleton/index.cjs.js"),l=require("./Stack/index.cjs.js"),f=require("./Table/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Accordion/index.cjs.js"),r=require("./Badge/index.cjs.js"),n=require("./Box/index.cjs.js"),i=require("./Button/index.cjs.js"),t=require("./ButtonGroup/index.cjs.js"),o=require("./Card/index.cjs.js"),u=require("./Drawer/index.cjs.js"),d=require("./Form/index.cjs.js"),c=require("./InputGroup/index.cjs.js"),s=require("./Menu/index.cjs.js"),q=require("./Modal/index.cjs.js"),x=require("./Portal/index.cjs.js"),$=require("./Progress/index.cjs.js"),a=require("./Skeleton/index.cjs.js"),l=require("./Spinner/index.cjs.js"),p=require("./Stack/index.cjs.js"),f=require("./Table/index.cjs.js"),g=require("./Tabs/index.cjs.js"),b=require("./Tooltip/index.cjs.js"),S=require("./Typography/index.cjs.js");;/* empty css */exports.Accordion=e;exports.Badge=r;exports.Box=n;exports.Button=i;exports.ButtonGroup=t.default;exports.Card=o;exports.Drawer=u.default;exports.Form=d.default;exports.InputGroup=c;exports.Menu=s;exports.Modal=q.default;exports.Portal=x;exports.Progress=$;exports.Skeleton=a;exports.Spinner=l;exports.Stack=p;exports.Table=f;exports.Tabs=g.default;exports.Tooltip=b;exports.Typography=S;
|
|
@@ -12,6 +12,7 @@ export { default as Modal } from './Modal';
|
|
|
12
12
|
export { default as Portal } from './Portal';
|
|
13
13
|
export { default as Progress } from './Progress';
|
|
14
14
|
export { default as Skeleton } from './Skeleton';
|
|
15
|
+
export { default as Spinner } from './Spinner';
|
|
15
16
|
export { default as Stack } from './Stack';
|
|
16
17
|
export { default as Table } from './Table';
|
|
17
18
|
export { default as Tabs } from './Tabs';
|
|
@@ -4,19 +4,20 @@ import { default as u } from "./Box/index.es.js";
|
|
|
4
4
|
import { default as d } from "./Button/index.es.js";
|
|
5
5
|
import { default as m } from "./ButtonGroup/index.es.js";
|
|
6
6
|
import { default as n } from "./Card/index.es.js";
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
7
|
+
import { default as B } from "./Drawer/index.es.js";
|
|
8
|
+
import { default as c } from "./Form/index.es.js";
|
|
9
|
+
import { default as S } from "./InputGroup/index.es.js";
|
|
10
|
+
import { default as k } from "./Menu/index.es.js";
|
|
11
|
+
import { default as G } from "./Modal/index.es.js";
|
|
12
|
+
import { default as P } from "./Portal/index.es.js";
|
|
13
13
|
import { default as w } from "./Progress/index.es.js";
|
|
14
14
|
import { default as C } from "./Skeleton/index.es.js";
|
|
15
|
-
import { default as F } from "./
|
|
16
|
-
import { default as j } from "./
|
|
17
|
-
import { default as v } from "./
|
|
18
|
-
import { default as E } from "./
|
|
19
|
-
import { default as J } from "./
|
|
15
|
+
import { default as F } from "./Spinner/index.es.js";
|
|
16
|
+
import { default as j } from "./Stack/index.es.js";
|
|
17
|
+
import { default as v } from "./Table/index.es.js";
|
|
18
|
+
import { default as E } from "./Tabs/index.es.js";
|
|
19
|
+
import { default as J } from "./Tooltip/index.es.js";
|
|
20
|
+
import { default as L } from "./Typography/index.es.js";
|
|
20
21
|
/* empty css */
|
|
21
22
|
export {
|
|
22
23
|
a as Accordion,
|
|
@@ -25,17 +26,18 @@ export {
|
|
|
25
26
|
d as Button,
|
|
26
27
|
m as ButtonGroup,
|
|
27
28
|
n as Card,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
B as Drawer,
|
|
30
|
+
c as Form,
|
|
31
|
+
S as InputGroup,
|
|
32
|
+
k as Menu,
|
|
33
|
+
G as Modal,
|
|
34
|
+
P as Portal,
|
|
34
35
|
w as Progress,
|
|
35
36
|
C as Skeleton,
|
|
36
|
-
F as
|
|
37
|
-
j as
|
|
38
|
-
v as
|
|
39
|
-
E as
|
|
40
|
-
J as
|
|
37
|
+
F as Spinner,
|
|
38
|
+
j as Stack,
|
|
39
|
+
v as Table,
|
|
40
|
+
E as Tabs,
|
|
41
|
+
J as Tooltip,
|
|
42
|
+
L as Typography
|
|
41
43
|
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { ChildrenProps, DeepPartial } from '../types';
|
|
1
|
+
import { ChildrenProps, Color, DeepPartial, Size } from '../types';
|
|
2
|
+
type ColorClasses<T> = {
|
|
3
|
+
[key in Color]: T;
|
|
4
|
+
};
|
|
5
|
+
type SizeClasses = {
|
|
6
|
+
[key in Size]: string;
|
|
7
|
+
};
|
|
2
8
|
export type ThemeProviderContextType = {
|
|
3
9
|
classes: {
|
|
4
10
|
accordion: {
|
|
@@ -19,106 +25,24 @@ export type ThemeProviderContextType = {
|
|
|
19
25
|
};
|
|
20
26
|
badge: {
|
|
21
27
|
base: string;
|
|
22
|
-
color: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
secondary: {
|
|
29
|
-
solid: string;
|
|
30
|
-
outline: string;
|
|
31
|
-
soft: string;
|
|
32
|
-
};
|
|
33
|
-
success: {
|
|
34
|
-
solid: string;
|
|
35
|
-
outline: string;
|
|
36
|
-
soft: string;
|
|
37
|
-
};
|
|
38
|
-
info: {
|
|
39
|
-
solid: string;
|
|
40
|
-
outline: string;
|
|
41
|
-
soft: string;
|
|
42
|
-
};
|
|
43
|
-
warning: {
|
|
44
|
-
solid: string;
|
|
45
|
-
outline: string;
|
|
46
|
-
soft: string;
|
|
47
|
-
};
|
|
48
|
-
danger: {
|
|
49
|
-
solid: string;
|
|
50
|
-
outline: string;
|
|
51
|
-
soft: string;
|
|
52
|
-
};
|
|
53
|
-
dark: {
|
|
54
|
-
solid: string;
|
|
55
|
-
outline: string;
|
|
56
|
-
soft: string;
|
|
57
|
-
};
|
|
58
|
-
light: {
|
|
59
|
-
solid: string;
|
|
60
|
-
outline: string;
|
|
61
|
-
soft: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
size: {
|
|
65
|
-
sm: string;
|
|
66
|
-
md: string;
|
|
67
|
-
lg: string;
|
|
68
|
-
};
|
|
28
|
+
color: ColorClasses<{
|
|
29
|
+
solid: string;
|
|
30
|
+
outline: string;
|
|
31
|
+
soft: string;
|
|
32
|
+
}>;
|
|
33
|
+
size: SizeClasses;
|
|
69
34
|
};
|
|
70
35
|
box: {
|
|
71
36
|
base: string;
|
|
72
37
|
};
|
|
73
38
|
button: {
|
|
74
39
|
base: string;
|
|
75
|
-
color: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
secondary: {
|
|
82
|
-
solid: string;
|
|
83
|
-
outline: string;
|
|
84
|
-
text: string;
|
|
85
|
-
};
|
|
86
|
-
success: {
|
|
87
|
-
solid: string;
|
|
88
|
-
outline: string;
|
|
89
|
-
text: string;
|
|
90
|
-
};
|
|
91
|
-
info: {
|
|
92
|
-
solid: string;
|
|
93
|
-
outline: string;
|
|
94
|
-
text: string;
|
|
95
|
-
};
|
|
96
|
-
warning: {
|
|
97
|
-
solid: string;
|
|
98
|
-
outline: string;
|
|
99
|
-
text: string;
|
|
100
|
-
};
|
|
101
|
-
danger: {
|
|
102
|
-
solid: string;
|
|
103
|
-
outline: string;
|
|
104
|
-
text: string;
|
|
105
|
-
};
|
|
106
|
-
dark: {
|
|
107
|
-
solid: string;
|
|
108
|
-
outline: string;
|
|
109
|
-
text: string;
|
|
110
|
-
};
|
|
111
|
-
light: {
|
|
112
|
-
solid: string;
|
|
113
|
-
outline: string;
|
|
114
|
-
text: string;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
size: {
|
|
118
|
-
sm: string;
|
|
119
|
-
md: string;
|
|
120
|
-
lg: string;
|
|
121
|
-
};
|
|
40
|
+
color: ColorClasses<{
|
|
41
|
+
solid: string;
|
|
42
|
+
outline: string;
|
|
43
|
+
text: string;
|
|
44
|
+
}>;
|
|
45
|
+
size: SizeClasses;
|
|
122
46
|
loading: {
|
|
123
47
|
active: string;
|
|
124
48
|
inactive: string;
|
|
@@ -222,16 +146,7 @@ export type ThemeProviderContextType = {
|
|
|
222
146
|
};
|
|
223
147
|
progress: {
|
|
224
148
|
base: string;
|
|
225
|
-
color:
|
|
226
|
-
primary: string;
|
|
227
|
-
secondary: string;
|
|
228
|
-
success: string;
|
|
229
|
-
info: string;
|
|
230
|
-
warning: string;
|
|
231
|
-
danger: string;
|
|
232
|
-
dark: string;
|
|
233
|
-
light: string;
|
|
234
|
-
};
|
|
149
|
+
color: ColorClasses<string>;
|
|
235
150
|
};
|
|
236
151
|
skeleton: {
|
|
237
152
|
base: string;
|
|
@@ -294,16 +209,7 @@ export type ThemeProviderContextType = {
|
|
|
294
209
|
};
|
|
295
210
|
tooltip: {
|
|
296
211
|
base: string;
|
|
297
|
-
color:
|
|
298
|
-
primary: string;
|
|
299
|
-
secondary: string;
|
|
300
|
-
success: string;
|
|
301
|
-
info: string;
|
|
302
|
-
warning: string;
|
|
303
|
-
danger: string;
|
|
304
|
-
dark: string;
|
|
305
|
-
light: string;
|
|
306
|
-
};
|
|
212
|
+
color: ColorClasses<string>;
|
|
307
213
|
placement: {
|
|
308
214
|
top: string;
|
|
309
215
|
end: string;
|
|
@@ -311,6 +217,11 @@ export type ThemeProviderContextType = {
|
|
|
311
217
|
start: string;
|
|
312
218
|
};
|
|
313
219
|
};
|
|
220
|
+
spinner: {
|
|
221
|
+
base: string;
|
|
222
|
+
color: ColorClasses<string>;
|
|
223
|
+
size: SizeClasses;
|
|
224
|
+
};
|
|
314
225
|
};
|
|
315
226
|
};
|
|
316
227
|
type Props = ChildrenProps & DeepPartial<ThemeProviderContextType>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reaxify",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.23",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
"require": "./dist/providers/index.cjs.js",
|
|
37
37
|
"types": "./dist/providers/index.d.ts"
|
|
38
38
|
},
|
|
39
|
+
"./types": {
|
|
40
|
+
"types": "./dist/types/index.d.ts"
|
|
41
|
+
},
|
|
39
42
|
"./style.css": {
|
|
40
43
|
"require": "./dist/style.css",
|
|
41
44
|
"default": "./dist/style.css"
|