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.
@@ -1 +1 @@
1
- "use strict";const x=require("../../node_modules/react/jsx-runtime.cjs.js"),n=require("react"),zt=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),r=require("../../helpers/cn.cjs.js"),Mt=require("../../hooks/useClasses.cjs.js"),Rt=require("../../hooks/useCreateRipple.cjs.js");require("../Form/index.cjs.js");const Et=require("../ButtonGroup/index.cjs.js"),Nt=require("../Drawer/index.cjs.js"),Bt=require("../Modal/index.cjs.js");function Dt({as:bt,variant:xt,color:p,size:pt,loading:lt,stopPropagation:gt=!1,closeModal:ct=!1,closeDrawer:mt=!1,className:ft,onClick:l,children:wt,...m}){const t=Mt(e=>e.button),i=n.useContext(Et.ButtonGroupContext),ht=n.useContext(Bt.ModalContext),yt=n.useContext(Nt.DrawerContext),Ct=Rt(),kt=bt||"button",f=xt??i.variant??"solid",g=n.useMemo(()=>p!==void 0?p:i.color!==void 0?i.color:"primary",[p,i.color]),c=pt??i.size??"md",b=lt??i.loading??!1,d=n.useMemo(()=>{var o,a,u,w,h,y,C,k,v,j,q,s,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,_,tt,rt,et,ot,nt,it,dt,at,ut;if(!g)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",(w=(u=t==null?void 0:t.color)==null?void 0:u.primary)==null?void 0:w.outline),text:r("bg-transparent text-primary border-transparent",(y=(h=t==null?void 0:t.color)==null?void 0:h.primary)==null?void 0:y.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",(j=(v=t==null?void 0:t.color)==null?void 0:v.secondary)==null?void 0:j.outline),text:r("bg-transparent text-secondary border-transparent",(s=(q=t==null?void 0:t.color)==null?void 0:q.secondary)==null?void 0:s.text)},success:{solid:r("bg-success text-white border-success",(M=(z=t==null?void 0:t.color)==null?void 0:z.success)==null?void 0:M.solid),outline:r("bg-transparent text-success border-success",(E=(R=t==null?void 0:t.color)==null?void 0:R.success)==null?void 0:E.outline),text:r("bg-transparent text-success border-transparent",(B=(N=t==null?void 0:t.color)==null?void 0:N.success)==null?void 0:B.text)},info:{solid:r("bg-info text-white border-info",(G=(D=t==null?void 0:t.color)==null?void 0:D.info)==null?void 0:G.solid),outline:r("bg-transparent text-info border-info",(P=($=t==null?void 0:t.color)==null?void 0:$.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[g])==null?void 0:ut[f])??null},[g,f,t==null?void 0:t.color]),vt=n.useMemo(()=>d==null?void 0:d.split(" ").find(e=>e.startsWith("text-")),[d]),jt=n.useMemo(()=>{var o,a,u;if(!c)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-5",(u=t==null?void 0:t.size)==null?void 0:u.lg)};return e==null?void 0:e[c]},[c,t==null?void 0:t.size]),qt=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 active:shadow-lg",(o=t==null?void 0:t.loading)==null?void 0:o.active)},[b,t==null?void 0:t.loading]),st=e=>{Ct(e),ct&&ht.onClose(),mt&&yt.onClose(),gt&&e.stopPropagation(),l==null||l(e)};return x.jsxRuntimeExports.jsxs(kt,{className:zt.twMerge("relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] shadow cursor-pointer hover:shadow-md transition-[box-shadow,opacity,color,background-color,border-color]",t==null?void 0:t.base,d,jt,qt,i.buttonClasses,ft),onClick:st,disabled:m.disabled||b,...m,children:[wt,b&&x.jsxRuntimeExports.jsx("span",{className:"absolute inset-0 size-full flex items-center justify-center bg-transparent p-2",children:x.jsxRuntimeExports.jsx("span",{className:r("h-full aspect-square rounded-full border-4 border-current border-l-transparent animate-spin",vt)})}),x.jsxRuntimeExports.jsx("span",{className:"ripple-group absolute size-full inset-0 overflow-hidden rounded-[inherit] pointer-events-none"})]})}module.exports=Dt;
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 u } 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";
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 Gr } from "../ButtonGroup/index.es.js";
9
- import { DrawerContext as qr } from "../Drawer/index.es.js";
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: ur,
13
- variant: lr,
14
- color: l,
15
- size: gr,
16
- loading: xr,
17
- stopPropagation: mr = !1,
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: cr = !1,
20
+ closeDrawer: xr = !1,
20
21
  className: wr,
21
- onClick: g,
22
+ onClick: p,
22
23
  children: hr,
23
- ...c
24
+ ...w
24
25
  }) {
25
- const r = Br((o) => o.button), e = f(Gr), yr = f(Er), kr = f(qr), vr = Dr(), Cr = ur || "button", w = lr ?? e.variant ?? "solid", x = p(() => l !== void 0 ? l : e.color !== void 0 ? e.color : "primary", [l, e.color]), m = gr ?? e.size ?? "md", b = xr ?? e.loading ?? !1, i = p(() => {
26
- var n, d, a, h, y, k, v, C, z, j, N, M, R, B, D, G, q, E, P, W, A, F, H, I, J, K, L, O, Q, S, T, U, V, X, Y, Z, _, $, s, rr, tr, or, nr, er, ir, dr, ar, pr, br;
27
- if (!x) return "border-transparent";
28
- const o = {
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: t(
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: t(
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: t(
39
- "bg-transparent text-primary border-transparent",
40
- (k = (y = r == null ? void 0 : r.color) == null ? void 0 : y.primary) == null ? void 0 : k.text
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: t(
45
- "bg-secondary text-white border-secondary",
46
- (C = (v = r == null ? void 0 : r.color) == null ? void 0 : v.secondary) == null ? void 0 : C.solid
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: t(
49
- "bg-transparent text-secondary border-secondary",
50
- (j = (z = r == null ? void 0 : r.color) == null ? void 0 : z.secondary) == null ? void 0 : j.outline
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: t(
53
- "bg-transparent text-secondary border-transparent",
54
- (M = (N = r == null ? void 0 : r.color) == null ? void 0 : N.secondary) == null ? void 0 : M.text
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: t(
59
- "bg-success text-white border-success",
60
- (B = (R = r == null ? void 0 : r.color) == null ? void 0 : R.success) == null ? void 0 : B.solid
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: t(
63
- "bg-transparent text-success border-success",
64
- (G = (D = r == null ? void 0 : r.color) == null ? void 0 : D.success) == null ? void 0 : G.outline
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: t(
67
- "bg-transparent text-success border-transparent",
68
- (E = (q = r == null ? void 0 : r.color) == null ? void 0 : q.success) == null ? void 0 : E.text
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: t(
73
- "bg-info text-white border-info",
74
- (W = (P = r == null ? void 0 : r.color) == null ? void 0 : P.info) == null ? void 0 : W.solid
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: t(
77
- "bg-transparent text-info border-info",
78
- (F = (A = r == null ? void 0 : r.color) == null ? void 0 : A.info) == null ? void 0 : F.outline
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: t(
81
- "bg-transparent text-info border-transparent",
82
- (I = (H = r == null ? void 0 : r.color) == null ? void 0 : H.info) == null ? void 0 : I.text
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: t(
87
- "bg-warning text-white border-warning",
88
- (K = (J = r == null ? void 0 : r.color) == null ? void 0 : J.warning) == null ? void 0 : K.solid
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: t(
91
- "bg-transparent text-warning border-warning",
92
- (O = (L = r == null ? void 0 : r.color) == null ? void 0 : L.warning) == null ? void 0 : O.outline
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: t(
95
- "bg-transparent text-warning border-transparent",
96
- (S = (Q = r == null ? void 0 : r.color) == null ? void 0 : Q.warning) == null ? void 0 : S.text
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: t(
101
- "bg-danger text-white border-danger",
102
- (U = (T = r == null ? void 0 : r.color) == null ? void 0 : T.danger) == null ? void 0 : U.solid
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: t(
105
- "bg-transparent text-danger border-danger",
106
- (X = (V = r == null ? void 0 : r.color) == null ? void 0 : V.danger) == null ? void 0 : X.outline
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: t(
109
- "bg-transparent text-danger border-transparent",
110
- (Z = (Y = r == null ? void 0 : r.color) == null ? void 0 : Y.danger) == null ? void 0 : Z.text
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: t(
115
- "bg-dark text-white border-dark",
116
- ($ = (_ = r == null ? void 0 : r.color) == null ? void 0 : _.dark) == null ? void 0 : $.solid
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: t(
119
- "bg-transparent text-dark border-dark",
120
- (rr = (s = r == null ? void 0 : r.color) == null ? void 0 : s.dark) == null ? void 0 : rr.outline
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: t(
123
- "bg-transparent text-dark border-transparent",
124
- (or = (tr = r == null ? void 0 : r.color) == null ? void 0 : tr.dark) == null ? void 0 : or.text
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: t(
129
- "bg-light text-dark border-light",
130
- (er = (nr = r == null ? void 0 : r.color) == null ? void 0 : nr.light) == null ? void 0 : er.solid
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: t(
133
- "bg-transparent text-dark border-light",
134
- (dr = (ir = r == null ? void 0 : r.color) == null ? void 0 : ir.light) == null ? void 0 : dr.outline
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: t(
137
- "bg-transparent text-dark border-transparent",
138
- (pr = (ar = r == null ? void 0 : r.color) == null ? void 0 : ar.light) == null ? void 0 : pr.text
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 ((br = o == null ? void 0 : o[x]) == null ? void 0 : br[w]) ?? null;
143
- }, [x, w, r == null ? void 0 : r.color]), zr = p(() => i == null ? void 0 : i.split(" ").find((o) => o.startsWith("text-")), [i]), jr = p(() => {
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 (!m) return null;
146
- const o = {
147
- sm: t("text-base py-1 px-3.5", (n = r == null ? void 0 : r.size) == null ? void 0 : n.sm),
148
- md: t("text-base py-1.5 px-4", (d = r == null ? void 0 : r.size) == null ? void 0 : d.md),
149
- lg: t("text-lg py-2 px-5", (a = r == null ? void 0 : r.size) == null ? void 0 : a.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 o == null ? void 0 : o[m];
152
- }, [m, r == null ? void 0 : r.size]), Nr = p(() => {
153
- var o, n;
154
- return b ? t(
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
- (o = r == null ? void 0 : r.loading) == null ? void 0 : o.active
157
- ) : t(
158
- "disabled:opacity-75 disabled:cursor-not-allowed active:shadow-lg",
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
- }, [b, r == null ? void 0 : r.loading]), Mr = (o) => {
162
- vr(o), fr && yr.onClose(), cr && kr.onClose(), mr && o.stopPropagation(), g == null || g(o);
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__ */ u.jsxs(
165
- Cr,
165
+ return /* @__PURE__ */ b.jsxs(
166
+ kr,
166
167
  {
167
- className: Rr(
168
- "relative inline-block no-underline whitespace-nowrap font-medium text-center rounded border border-[#e8eaee] shadow cursor-pointer hover:shadow-md transition-[box-shadow,opacity,color,background-color,border-color]",
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
- i,
175
+ e,
176
+ zr,
171
177
  jr,
172
- Nr,
173
- e.buttonClasses,
178
+ i.buttonClasses,
174
179
  wr
175
180
  ),
176
- onClick: Mr,
177
- disabled: c.disabled || b,
178
- ...c,
181
+ onClick: Nr,
182
+ disabled: w.disabled || l,
183
+ ...w,
179
184
  children: [
180
185
  hr,
181
- b && /* @__PURE__ */ u.jsx("span", { className: "absolute inset-0 size-full flex items-center justify-center bg-transparent p-2", children: /* @__PURE__ */ u.jsx(
182
- "span",
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-[30rem] h-full max-w-[97.5%] rounded-e",(m=e==null?void 0:e.anchor)==null?void 0:m.start),end:n("w-[30rem] 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-[30rem] max-h-[97.5%] rounded-b",(w=e==null?void 0:e.anchor)==null?void 0:w.top),bottom:n("w-full h-[30rem] 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;
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-[30rem] h-full max-w-[97.5%] rounded-e",
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("w-[30rem] h-full max-w-[97.5%] rounded-s", (c = t == null ? void 0 : t.anchor) == null ? void 0 : c.end),
93
- top: n("w-full h-[30rem] max-h-[97.5%] rounded-b", (x = t == null ? void 0 : t.anchor) == null ? void 0 : x.top),
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-[30rem] max-h-[97.5%] rounded-t",
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"),p=require("./Tabs/index.cjs.js"),g=require("./Tooltip/index.cjs.js"),b=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.Stack=l;exports.Table=f;exports.Tabs=p.default;exports.Tooltip=g;exports.Typography=b;
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 T } from "./Drawer/index.es.js";
8
- import { default as g } from "./Form/index.es.js";
9
- import { default as b } from "./InputGroup/index.es.js";
10
- import { default as y } from "./Menu/index.es.js";
11
- import { default as M } from "./Modal/index.es.js";
12
- import { default as S } from "./Portal/index.es.js";
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 "./Stack/index.es.js";
16
- import { default as j } from "./Table/index.es.js";
17
- import { default as v } from "./Tabs/index.es.js";
18
- import { default as E } from "./Tooltip/index.es.js";
19
- import { default as J } from "./Typography/index.es.js";
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
- T as Drawer,
29
- g as Form,
30
- b as InputGroup,
31
- y as Menu,
32
- M as Modal,
33
- S as Portal,
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 Stack,
37
- j as Table,
38
- v as Tabs,
39
- E as Tooltip,
40
- J as Typography
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
- primary: {
24
- solid: string;
25
- outline: string;
26
- soft: string;
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
- primary: {
77
- solid: string;
78
- outline: string;
79
- text: string;
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.21",
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"