dst-rg 1.0.4 → 1.0.5
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.
|
@@ -191,7 +191,7 @@ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}
|
|
|
191
191
|
|
|
192
192
|
Defaulting to \`null\`.`}var P4=wb,eC=Eb;const uy={xxs:"w-[64px] h-[64px]",xs:"w-[160px] h-[160px]",sm:"w-[200px] h-[200px]",md:"w-[240px] h-[240px]",lg:"w-[280px] h-[280px]"},tC={xxs:64,xs:160,sm:200,md:240,lg:280},tc=x.forwardRef(({type:n="line",value:r=0,label:i,labelClassName:o,backgroundVariant:s,indicatorVariant:u,className:m,size:h="md",strokeWidth:p=16,svgClassName:g,...v},y)=>{const S=Math.min(Math.max(r??0,0),100),w=tC[h]||240,j=(w-p)/2;if(n==="half-circle"){const R=Math.PI*j,C=R-S/100*R;return f.jsxs("div",{className:ie("relative flex items-center justify-center",uy[h],m),ref:y,...v,children:[f.jsxs("svg",{width:w,height:w/2,className:ie("rotate-[-90deg]",g),children:[f.jsx("circle",{stroke:"#e5e7eb",fill:"transparent",strokeWidth:p,r:j,cx:w/2,cy:w/2}),f.jsx("circle",{fill:"transparent",strokeWidth:p,strokeLinecap:"round",strokeDasharray:R,strokeDashoffset:R-C,r:j,cx:w/2,cy:w/2,style:{transition:"stroke-dashoffset 0.5s ease"},className:u})]}),i!==void 0&&f.jsxs("span",{className:ie("absolute text-sm font-semibold text-muted-foreground",o),children:[i,"%"]})]})}if(n==="circle"){const R=2*Math.PI*j,C=R-S/100*R;return f.jsxs("div",{className:ie("relative flex items-center justify-center",uy[h],m),ref:y,...v,children:[f.jsxs("svg",{width:w,height:w,className:ie("rotate-[-90deg]",g),children:[f.jsx("circle",{stroke:"#e5e7eb",fill:"transparent",strokeWidth:p,r:j,cx:w/2,cy:w/2}),f.jsx("circle",{fill:"transparent",strokeWidth:p,strokeLinecap:"round",strokeDasharray:R,strokeDashoffset:C,r:j,cx:w/2,cy:w/2,style:{transition:"stroke-dashoffset 0.5s ease"},className:u})]}),i!==void 0&&f.jsxs("span",{className:ie("absolute text-sm font-semibold text-muted-foreground",o),children:[i,"%"]})]})}return f.jsxs("div",{className:"flex items-center gap-4 w-full",children:[f.jsx(P4,{ref:y,className:ie("relative h-4 w-full overflow-hidden rounded-full bg-muted",s,m),...v,children:f.jsx(eC,{className:ie("h-full transition-transform duration-300",u),style:{transform:`translateX(-${100-r}%)`}})}),typeof i=="number"&&f.jsxs("span",{className:ie("text-sm text-muted-foreground min-w-[40px] text-right",o),children:[i,"%"]})]})});tc.displayName="Progress";const Cb=({width:n=40,height:r=40})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:"0 0 20 20",fill:"none",children:f.jsx("path",{d:"M11.6667 1.89118V5.33329C11.6667 5.8 11.6667 6.03336 11.7575 6.21162C11.8374 6.36842 11.9649 6.4959 12.1217 6.5758C12.3 6.66663 12.5333 6.66663 13 6.66663H16.4422M16.6667 8.32348V14.3333C16.6667 15.7334 16.6667 16.4335 16.3942 16.9683C16.1545 17.4387 15.7721 17.8211 15.3017 18.0608C14.7669 18.3333 14.0668 18.3333 12.6667 18.3333H7.33337C5.93324 18.3333 5.23318 18.3333 4.6984 18.0608C4.22799 17.8211 3.84554 17.4387 3.60586 16.9683C3.33337 16.4335 3.33337 15.7334 3.33337 14.3333V5.66663C3.33337 4.26649 3.33337 3.56643 3.60586 3.03165C3.84554 2.56124 4.22799 2.17879 4.6984 1.93911C5.23318 1.66663 5.93324 1.66663 7.33337 1.66663H10.0099C10.6213 1.66663 10.9271 1.66663 11.2148 1.7357C11.4699 1.79694 11.7137 1.89795 11.9374 2.03503C12.1897 2.18963 12.4059 2.40582 12.8383 2.8382L15.4951 5.49505C15.9275 5.92743 16.1437 6.14362 16.2983 6.39591C16.4354 6.61959 16.5364 6.86346 16.5976 7.11855C16.6667 7.40627 16.6667 7.712 16.6667 8.32348Z",stroke:"#98A2B3",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),nC=({item:n,loadType:r,onDelete:i})=>f.jsxs("div",{className:ie("p-4 flex gap-3 w-full rounded-xl border border-rborder-secondary bg-rbg-primary",(n==null?void 0:n.status)=="failed"&&"border-rborder-error"),children:[f.jsx("div",{className:" flex justify-start items-start w-10 h-10",children:(n==null?void 0:n.icon)??f.jsx(Cb,{width:20,height:20,"data-testid":"fallback-icon"})}),f.jsxs("div",{className:"flex flex-col gap-1 w-full",children:[f.jsxs("div",{className:"flex justify-between",children:[f.jsxs("div",{className:"flex flex-col w-1/2",children:[f.jsx("span",{className:"font-medium text-rtext-secondary-700 overflow-hidden text-ellipsis text-sm",children:n==null?void 0:n.title}),f.jsx("span",{className:"text-rtext-tertiary-600 font-normal text-sm overflow-hidden text-ellipsis",children:n==null?void 0:n.size})]}),f.jsx(ea,{className:ie("self-centertext-rbutton-tertiary-fg",(n==null?void 0:n.status)=="failed"&&"text-rbutton-secondary-error-fg"),onClick:()=>{i(n==null?void 0:n.id)},variant:"linkGray",children:f.jsx(c6,{width:20,height:20})})]}),r=="progressBar"&&f.jsx(tc,{type:"line",value:n==null?void 0:n.progressValue,label:n==null?void 0:n.percentage,size:"lg",indicatorVariant:"bg-rfg-brand-primary-600",backgroundVariant:"bg-rbg-quaternary",dir:"rtl",className:"h-2",labelClassName:"text-end"})]})]}),aC=({icon:n,mainText:r,subText:i,formatText:o,acceptableFormats:s="",disable:u=!1,items:m,loadType:h="progressBar",multiItem:p=!1,onChange:g,onDelete:v})=>f.jsxs("div",{className:"w-full flex flex-col gap-4",children:[f.jsx(Q4,{icon:n,mainText:r,subText:i,formatText:o,acceptableFormats:s,disable:u,multiItem:p,onChange:g}),m&&m.length>0&&f.jsx("div",{className:"flex flex-col gap-3",children:m.map(y=>f.jsx(nC,{item:y,loadType:h,onDelete:v},y==null?void 0:y.title))})]}),ks=(n,r,i)=>Math.min(Math.max(n,r),i),Fd={x:0,y:0};function lC({src:n,alt:r="",zoom:i=2,lensSize:o=140,className:s="",lensVisibleClassName:u="hidden md:block",zoomPaneVisibleClassName:m="hidden md:block",touchToggle:h=!0,zoomPaneSize:p,zoomPanePosition:g="right",zoomMode:v="pane"}){var xe;const y=x.useRef(null),S=x.useRef(null),[w,j]=x.useState(!1),[R,C]=x.useState(Fd),[N,_]=x.useState({w:0,h:0}),[L,U]=x.useState(!1);x.useEffect(()=>{const se=()=>{const Ae=S.current;Ae&&_({w:Ae.width,h:Ae.height})},Le=S.current;if(Le)return Le.complete&&se(),Le.addEventListener("load",se),window.addEventListener("resize",se),()=>{Le.removeEventListener("load",se),window.removeEventListener("resize",se)}},[n]);const X=(se,Le)=>{const Ae=S.current;if(!Ae)return Fd;const st=Ae.getBoundingClientRect();if(st.width===0||st.height===0)return Fd;const qt=ks(se-st.left,0,st.width),Gt=ks(Le-st.top,0,st.height);return{x:qt,y:Gt}},J=se=>{var Ae;const Le="nativeEvent"in se?se.nativeEvent:se;if("touches"in Le&&((Ae=Le.touches)==null?void 0:Ae.length)>0){const st=Le.touches[0];C(X(st.clientX,st.clientY));return}typeof Le.clientX=="number"&&C(X(Le.clientX,Le.clientY))},Z=se=>{J(se)},T=()=>{j(!0)},ae=()=>{j(!1),L&&U(!1)},I=se=>{h&&(se.preventDefault(),L?(U(!1),j(!1)):(U(!0),j(!0),J(se)))},ce=se=>{L&&(se.preventDefault(),J(se))},re=(xe=S.current)==null?void 0:xe.getBoundingClientRect(),pe=(re==null?void 0:re.width)??N.w,fe=(re==null?void 0:re.height)??N.h,me=pe||1,k=fe||1,V=`${me*i}px ${k*i}px`,H=`${R.x/me*100}% ${R.y/k*100}%`,oe=p??me,we=p??k,M={width:o,height:o,left:ks(R.x-o/2,0,Math.max(me-o,0)),top:ks(R.y-o/2,0,Math.max(k-o,0)),backgroundImage:v==="inline"?`url(${n})`:"none",backgroundRepeat:"no-repeat",backgroundSize:v==="inline"?V:void 0,backgroundPosition:v==="inline"?H:void 0},K={width:oe,height:we,backgroundImage:`url(${n})`,backgroundRepeat:"no-repeat",backgroundSize:V,backgroundPosition:H},te=g==="left",le=w?u:"hidden",be=v==="pane"&&w?m:"hidden";return f.jsxs("div",{className:`relative w-fit inline-block align-top ${s}`,children:[f.jsxs("div",{ref:y,className:"relative select-none touch-none",onMouseMove:Z,onMouseEnter:T,onMouseLeave:ae,onTouchStart:I,onTouchMove:ce,onTouchEnd:ae,children:[f.jsx("img",{ref:S,src:n,alt:r,className:"block max-w-full h-auto select-none",draggable:!1,onDragStart:se=>se.preventDefault()}),f.jsx("div",{className:`pointer-events-none absolute rounded-full border-2 border-white shadow-lg ${le} ${v==="inline"?"bg-white/10 backdrop-blur":"bg-transparent"}`,style:M})]}),f.jsx("div",{className:`${be} absolute top-1/2 -translate-y-1/2 overflow-hidden rounded-lg border border-slate-200 shadow-sm
|
|
193
193
|
${te?"right-full mr-3":"left-full ml-3"}
|
|
194
|
-
`,style:K})]})}const rC="rounded-md px-2 shadow-xs
|
|
194
|
+
`,style:K})]})}const rC="w-full rounded-md px-2 shadow-xs bg-white border border-rborder-primary focus:outline-2 focus:outline-rborder-brand disabled:bg-rbg-disabled-subtle disabled:border-rborder-disabled",iC="h-full absolute text-sm text-rfg-tertiary-600 ltr:left-3 rtl:right-3 top-1/2 -translate-y-1/2 border-e pe-2 w-15 truncate text-center",oC="flex items-center gap-1 h-full absolute text-sm text-rbutton-secondary-fg cursor-pointer ltr:right-3 rtl:left-3 top-1/2 -translate-y-1/2 border-s ps-2",sC="flex items-center h-full absolute text-rfg-tertiary-600 ltr:right-0 rtl:left-0 top-1/2 -translate-y-1/2 border-s",cC={sm:"text-xs ps-2 pe-2",md:"text-sm ps-5 pe-5",lg:"text-base ps-8 pe-8",xl:"text-base ps-11 pe-11"},uC={sm:"h-9.5 py-2.5",md:"h-10.5 pt-3 pb-3"},dC="!border-2 !border-rborder-error focus:!outline-0",fC="bg-rbg-disabled-subtle border-rborder-disabled",mC="ltr:right-2 rtl:left-2",hC="ltr:right-20 rtl:left-20",pC="ltr:right-20 rtl:left-20",gC="ltr:right-12 rtl:left-12",vC={default:"pe-8",iconLeading:"ps-10",leadingDropdown:"pe-8",trailingDropdown:"pe-8 ps-6",leadingText:"pe-8 ps-20",trailingButton:"pe-8",shaba:"pe-12"},yC=hn(rC,{variants:{size:uC,inputType:vC},defaultVariants:{size:"sm",inputType:"default"}}),bc=({id:n,label:r,required:i,labelClass:o,labelStarClass:s})=>f.jsxs("label",{htmlFor:n,className:tn("text-sm font-medium text-rtext-secondary-700",o),children:[r,i&&f.jsx("span",{className:tn("dv-required-label text-rtext-brand-tertiary-600 mx-1",s),children:"*"})]}),bC=({stroke:n="#98A2B3",fill:r="none",width:i="16",height:o="16"})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:i,height:o,viewBox:"0 0 16 16",fill:r,children:f.jsx("path",{d:"M6.05998 5.99998C6.21672 5.55442 6.52608 5.17872 6.93328 4.9394C7.34048 4.70009 7.81924 4.61261 8.28476 4.69245C8.75028 4.7723 9.17252 5.01433 9.4767 5.37567C9.78087 5.737 9.94735 6.19433 9.94665 6.66665C9.94665 7.99998 7.94665 8.66665 7.94665 8.66665M7.99998 11.3333H8.00665M14.6666 7.99998C14.6666 11.6819 11.6819 14.6666 7.99998 14.6666C4.31808 14.6666 1.33331 11.6819 1.33331 7.99998C1.33331 4.31808 4.31808 1.33331 7.99998 1.33331C11.6819 1.33331 14.6666 4.31808 14.6666 7.99998Z",stroke:n,strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),tm=x.memo(bC),dy=(n,r)=>{x.useEffect(()=>{const i=o=>{!n.current||n.current.contains(o.target)||r()};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}},[n,r])},xC="absolute left-1/2 z-10 max-h-[200px] w-72 -translate-x-1/2 -translate-y-11 transform overflow-auto rounded bg-gray-500 p-3 text-start text-xs text-white shadow-md transition-all duration-200",wC="flex items-center justify-between w-full bg-white border border-rborder-primary rounded-md px-2 shadow-xs text-sm text-dark/80 focus:outline-2 focus:outline-rborder-brand disabled:bg-rbg-disabled-subtle disabled:border-rborder-disabled disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-500 px-4 py-2 text-left",SC="absolute left-0 mt-1 w-full rounded-md bg-gray-50 shadow-lg border border-rborder-primary z-50",Rb=({config:n,isLoading:r=!1,disabled:i=!1,className:o,tooltipClass:s,tooltipTitle:u,selectedValueLabel:m,onChange:h,options:p,buttonClass:g,contentClass:v,labelClass:y,labelStarClass:S})=>{var k;const{label:w,name:j,error:R,hintText:C,isRequiredInput:N=!1,canSelectZero:_=!1}=n||{},[L,U]=x.useState(!1),[X,J]=x.useState(-50),[Z,T]=x.useState(!1),[ae,I]=x.useState(5),ce=x.useRef(null);dy(ce,()=>T(!1));const re=V=>{const{scrollTop:H,scrollHeight:oe,clientHeight:we}=V.currentTarget;H+we>=oe-10&&I(M=>Math.min(M+5,p==null?void 0:p.length))},pe=V=>{h({name:j,value:V}),T(!1)},fe=x.useRef(null),me=()=>{if(fe.current){const V=fe.current.offsetHeight;J(-V+window.scrollY+40)}};return x.useEffect(()=>{L&&me()},[L]),dy(fe,()=>U(!1)),f.jsxs("div",{className:tn("relative flex w-full flex-col gap-1",o),children:[w&&f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(bc,{labelClass:y,labelStarClass:S,id:j,label:w,required:N}),u&&f.jsx("button",{type:"button",onClick:u?()=>U(V=>!V):()=>{},className:"flex-center h-4 w-4 rounded-full bg-blue-400 text-xs text-white",children:"i"})]}),f.jsxs("div",{className:"relative",children:[f.jsxs("button",{type:"button",className:tn(wC,g),onClick:()=>T(V=>!V),disabled:r||i,children:[m,Z?f.jsx(E0,{className:"h-4 w-4 opacity-50"}):f.jsx(S0,{className:"h-4 w-4 opacity-50"})]}),Z&&f.jsx("div",{ref:ce,className:tn(SC,v),children:f.jsxs("ul",{className:"max-h-48 overflow-auto p-2 text-sm text-start",onScroll:re,style:{maxHeight:"150px"},children:[!_&&f.jsx("li",{children:f.jsx("button",{type:"button",className:"w-full p-2 text-start text-gray-500 cursor-not-allowed",onClick:()=>T(!1),children:"-"})}),(k=p==null?void 0:p.slice(0,ae))==null?void 0:k.map(V=>f.jsx("li",{children:f.jsx("button",{type:"button",className:"w-full p-2 text-start cursor-pointer hover:bg-gray-100",onClick:()=>pe(V.value),children:V.title})},V.value))]})})]}),u&&L&&f.jsx("div",{ref:fe,className:tn(xC,s),style:{top:`${X}px`},dangerouslySetInnerHTML:{__html:u}}),!R&&C&&f.jsx("p",{className:"text-sm text-rtext-tertiary-600",children:C}),R&&f.jsx("p",{className:"text-sm text-rtext-error-primary-600",children:R})]})},Us=({size:n="sm",type:r="text",inputType:i="default",disabled:o=!1,id:s,label:u,required:m=!1,error:h,hintText:p,placeholder:g,helpIcon:v=!1,icon:y,leadingTextValue:S,className:w,trailingDropdownOptions:j,trailingDropdownDefault:R,onChange:C,value:N,tooltipProps:_,trailingButtonText:L,name:U,labelClass:X,labelStarClass:J,shabaLabelSize:Z="lg",autoFocus:T=!1,...ae})=>{const I=y,[ce,re]=x.useState(),[pe,fe]=x.useState(!1),me=V=>{const H=j==null?void 0:j.find(oe=>(oe==null?void 0:oe.value)===(V==null?void 0:V.value));re(H??V)},k=V=>{navigator.clipboard.writeText(V)};return f.jsxs("div",{className:"flex flex-col gap-1 items-start",children:[f.jsx(bc,{id:s,label:u,required:m,labelClass:X,labelStarClass:J}),f.jsxs("div",{className:"relative w-full",children:[I&&i=="iconLeading"&&f.jsx("div",{"aria-label":"iconLeading",className:"absolute ltr:left-3 rtl:right-3 top-1/2 -translate-y-1/2",children:f.jsx(I,{})}),S&&i=="leadingText"&&f.jsx("div",{"aria-label":"leadingText",className:`${iC} ${n==="sm"?"pt-2":"pt-2.5"}
|
|
195
195
|
${h?"border-rborder-error":"border-rborder-primary"}`,children:S}),i=="trailingDropdown"&&f.jsx("p",{className:"absolute ltr:left-2 rtl:right-2 top-1/2 -translate-y-1/2",children:ce?ce==null?void 0:ce.icon:R==null?void 0:R.icon}),f.jsx("input",{value:N,name:U,onChange:C,placeholder:g,autoFocus:T,className:ie(yC({size:n,inputType:i}),w,!!h&&"bg-rbg-disabled-subtle",!!h&&dC,o&&fC),type:r==="password"&&pe?"text":r,id:s,disabled:o,...ae}),r==="password"&&f.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 ltr:right-2 rtl:left-2 w-fit h-5 flex items-center justify-center",children:f.jsx(ea,{type:"button",variant:"linkGray",onClick:()=>fe(!pe),children:pe?f.jsx(a6,{size:18,className:"text-rbutton-tertiary-fg"}):f.jsx(r6,{size:18,className:"text-rbutton-tertiary-fg"})})}),v&&_&&!h&&f.jsx(co,{content:_==null?void 0:_.text,description:_==null?void 0:_.description,position:_==null?void 0:_.position,dir:_==null?void 0:_.dir,descriptionClassName:_==null?void 0:_.descriptionClassName,children:f.jsx("div",{"data-testid":"tooltip-button",className:`w-fit absolute top-1/2 -translate-y-1/2
|
|
196
196
|
${i=="trailingButton"?hC:i=="trailingDropdown"?pC:i=="shaba"?gC:mC}`,children:f.jsx(tm,{})})}),i=="trailingButton"&&f.jsxs("button",{"aria-label":"copyButton",onClick:()=>k(String(N)),className:`${oC} ${h?"border-rborder-error":"border-rborder-primary"}`,children:[f.jsx(t6,{size:20})," ",L]}),i=="trailingDropdown"&&f.jsx(Rb,{onChange:me,options:j??[],selectedValueLabel:(R==null?void 0:R.title)??"-",config:{canSelectZero:!0,name:"trailingDropdown"},className:tn("w-fit absolute rtl:left-0 ltr:right-0 top-0",!!h&&"border-2 border-error-500 rounded-xl")}),i=="shaba"&&f.jsx("div",{"aria-label":"shabaLabel",className:ie(sC,cC[Z],h?"border-rborder-error":"border-rborder-primary"),children:"IR"})]}),!h&&p&&f.jsx("p",{className:"text-sm text-rtext-tertiary-600",children:p}),!!h&&f.jsx("p",{className:"text-sm text-rtext-error-primary-600",children:h})]})},EC="w-full flex flex-col py-2.5 px-3.5 gap-2",jC={primary:"bg-rbg-brand-solid text-rtext-white text-md font-normal",gray:"bg-rbg-secondary border border-rborder-secondary text-rtext-primary-900 text-md font-normal",white:"bg-rbg-primary border border-rborder-secondary"},CC=hn(EC,{variants:{sender:{admin:"",user:""},variant:jC,direction:{ltr:"",rtl:""}},compoundVariants:[{sender:"admin",direction:"ltr",class:"rounded-tl-md rounded-tr-none rounded-br-md rounded-bl-md "},{sender:"user",direction:"ltr",class:"rounded-tl-none rounded-tr-md rounded-br-md rounded-bl-md"},{sender:"admin",direction:"rtl",class:" rounded-tl-md rounded-tr-none rounded-br-md rounded-bl-md"},{sender:"user",direction:"rtl",class:"rounded-tl-none rounded-tr-md rounded-br-md rounded-bl-md"}],defaultVariants:{variant:"primary",direction:"rtl"}}),Jd=hn("",{variants:{direction:{ltr:"",rtl:""},sender:{admin:"",user:""}},compoundVariants:[{sender:"admin",direction:"ltr",class:"flex-row-reverse"},{sender:"admin",direction:"rtl",class:"flex-row"},{sender:"user",direction:"ltr",class:"flex-row"},{sender:"user",direction:"rtl",class:"flex-row-reverse"}],defaultVariants:{direction:"ltr",sender:"user"}}),fy=({variant:n,sender:r,senderName:i,message:o,children:s,avatar:u,date:m,className:h,dir:p})=>{var v;const g=p??(((v=document==null?void 0:document.body)==null?void 0:v.getAttribute("dir"))==="rtl"?"rtl":"ltr");return f.jsx("div",{className:ie("w-full flex ",Jd({sender:r,direction:g})),"data-testid":"messageWrapper",children:f.jsxs("div",{className:ie("w-fit max-w-4/5 flex gap-3",Jd({sender:r,direction:g}),h),"data-testid":"messageComp",children:[u??null,f.jsxs("div",{className:"w-full flex flex-col gap-1.5",children:[f.jsxs("div",{className:ie("w-full flex justify-between items-center",Jd({sender:r,direction:g})),children:[f.jsx("span",{className:"text-rtext-secondary-700 text-sm font-medium",children:i}),f.jsx("span",{className:"text-rtext-tertiary-600 text-xs font-normal",children:m})]}),f.jsxs("div",{className:ie(CC({variant:n,sender:r,direction:g})),children:[o&&f.jsx("span",{className:"",children:o}),s??null]})]})]})})};function RC({className:n,...r}){return f.jsx("div",{"data-slot":"card",className:ie("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...r})}function TC({className:n,...r}){return f.jsx("div",{"data-slot":"card-header",className:ie("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...r})}function NC({className:n,...r}){return f.jsx("div",{"data-slot":"card-action",className:ie("col-start-2 row-span-2 row-start-1 self-start justify-self-end",n),...r})}const AC="flex flex-col h-full items-end gap-2 w-full",my={success:"w-12 h-12 flex items-center justify-center rounded-full bg-rbg-success-secondary",notification:"w-12 h-12 flex items-center justify-center rounded-full bg-rbg-brand-secondary",secondary:"w-12 h-12 flex items-center justify-center rounded-lg bg-rbg-primary border border-gray-light-200 shadow-xs-skeuomorphic"},hy={normal:"font-medium text-sm text-rtext-tertiary-600",bold:"text-rtext-primary-900 font-normal text-md"},MC=({title:n,value:r,description:i,icon:o,iconType:s="secondary",statistic:u,chartImg:m,chartPosition:h,actionBtns:p,toggleBtn:g,iconPosition:v="hidden",statisticPosition:y,titleType:S="normal"})=>f.jsxs(RC,{className:"flex flex-col gap-0 rounded-xl border border-rborder-secondary bg-rbg-primary shadow-xs w-full sm:max-w-[380px] max-w-[311px] h-fit justify-start p-0",children:[f.jsxs("div",{className:"flex gap-5 w-full py-5 px-4 sm:p-6",children:[v=="iconSide"&&f.jsx("div",{className:ie("self-center",my[s]),children:o}),f.jsxs("div",{className:ie(AC,`${(v=="topWithTitle"||v=="topAlone")&&"gap-5 md:gap-6"}`),children:[f.jsxs(TC,{className:"flex justify-between w-full px-0",children:[f.jsxs("div",{className:"flex items-center gap-3 ",children:[(v=="topWithTitle"||v=="topAlone")&&f.jsx("div",{className:my[s],children:o}),v!="topAlone"&&f.jsx("span",{className:hy[S],children:n})]}),g]}),f.jsxs("div",{className:"flex flex-col w-full gap-2",children:[v=="topAlone"&&f.jsx("span",{className:hy[S],children:n}),f.jsxs("div",{className:"w-full flex justify-between gap-4",children:[f.jsxs("div",{className:ie("flex justify-between items-center w-full h-fit px-0",`${y=="row-below"&&"flex-col just-start items-start gap-4"}`,`${y=="row-next"&&"flex justify-start items-start gap-2"}`),children:[f.jsx("span",{className:"text-display-md font-normal text-rtext-primary-900",children:r}),f.jsxs("div",{className:"flex gap-2 items-center",children:[u,i&&f.jsx("span",{className:"font-medium text-sm text-rtext-tertiary-600",children:i})]})]}),h=="side"&&f.jsx("div",{className:"w-full",children:m})]})]}),h=="bottom"&&f.jsx("div",{className:"w-full",children:m})]})]}),p&&f.jsx(NC,{className:"flex flex-row-reverse items-center justify-between py-4 px-6 border-t border-rborder-secondary gap-1.5 w-full",children:p==null?void 0:p.map((w,j)=>f.jsx(Qe.Fragment,{children:w},j))})]}),zC="modal-container fixed left-1/2 right-auto flex max-h-[80dvh] w-4/5 cursor-default flex-col rounded bg-white text-center",_C={sm:"max-w-rsm",md:"max-w-rmd",lg:"max-w-rlg"},DC=hn(zC,{variants:{size:_C,overflow:{hidden:"overflow-hidden",auto:"overflow-auto"},position:{center:"top-1/2 -translate-y-1/2 animate-slide-in-center",bottom:"bottom-0 animate-slide-in-bottom"}},defaultVariants:{size:"md"}});let py=0;const OC=({children:n,closeHandler:r,size:i="md",modalTitle:o,overflow:s,closeIconStroke:u="#000",position:m="center",icon:h,headerIconDir:p="flex-col",showModal:g=!1,modalContentStyle:v,showCloseIcon:y=!0})=>{const S=x.useRef(++py);return x.useEffect(()=>(g&&(document.body.style.overflow="hidden"),()=>{py--,document.body.style.overflow=""}),[g]),g?ZS.createPortal(f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"fixed left-0 top-0 h-full min-h-screen w-full cursor-default overflow-hidden bg-black/60 duration-0",style:{zIndex:xb(S.current)},onClick:r}),f.jsxs("dialog",{open:!0,"aria-label":"modal-container",className:tn(DC({size:i,overflow:s,position:m}),v),style:{zIndex:$4(S.current)},children:[f.jsxs("div",{className:`${p=="flex-col"?"items-start":"items-center"}
|
|
197
197
|
sticky top-0 z-10 flex justify-between gap-6 bg-white py-4`,children:[f.jsxs("div",{className:`flex gap-4 justify-start items-start ${p}`,children:[h&&h,o&&f.jsx("h2",{id:"modal-title",className:"text-lg font-semibold",children:o})]}),y&&f.jsx(ea,{variant:"tertiaryGray",size:"sm",className:"!p-0",onClick:r,children:f.jsx(If,{width:"16",height:"16",stroke:u})})]}),f.jsx("div",{className:"overflow-y-auto",children:n})]})]}),document.body):null},LC=()=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:f.jsx("path",{d:"M15.8334 9.99996H4.16675M4.16675 9.99996L10.0001 15.8333M4.16675 9.99996L10.0001 4.16663",stroke:"#344054",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),gy=x.memo(LC),kC=()=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:f.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"#344054",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),vy=x.memo(kC),Xr=Qe.forwardRef(({className:n,...r},i)=>f.jsx("ul",{ref:i,className:ie("flex flex-row items-center cursor-pointer",n),...r}));Xr.displayName="PaginationContent";const Vt=Qe.forwardRef(({className:n,...r},i)=>f.jsx("li",{ref:i,className:ie("flex items-center ",n),...r}));Vt.displayName="PaginationItem";const Nt=({className:n,isActive:r,activeClassName:i,disabled:o,...s})=>{const u="rounded-md border bg-[#F9FAFB] text-[#182230] border-[#F9FAFB]",m="cursor-pointer inline-flex items-center gap-1.5 px-4 py-1.5 justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",h=r?i||u:"",p=o?"pointer-events-none opacity-50":"";return f.jsx("a",{"aria-current":r?"page":void 0,className:ie(m,r?"border border-primary text-primary":"hover:bg-accent hover:text-accent-foreground",h,p,n),...s,"aria-disabled":o,onClick:g=>{var v;o?g.preventDefault():(v=s.onClick)==null||v.call(s,g)}})},UC=({currentPage:n,totalPages:r,onPageChange:i,dir:o="rtl",labels:s,previousClassName:u,nextClassName:m,className:h,prevIcon:p,nextIcon:g,...v})=>{const y=o==="rtl";return f.jsx("nav",{role:"navigation","aria-label":"pagination",className:ie("",h),...v,children:f.jsxs(Xr,{className:"flex justify-between items-center",children:[f.jsxs("div",{className:"flex",children:[f.jsx(Vt,{className:"md:block hidden",children:f.jsx(Nt,{size:"default","aria-label":"Go to first page",disabled:n===1,onClick:()=>i==null?void 0:i(1),children:s==null?void 0:s.first})}),f.jsx(Vt,{children:f.jsxs(Nt,{"aria-label":"Go to previous page",size:"default",className:ie("gap-1",u),onClick:()=>i==null?void 0:i(n-1),disabled:n===1,children:[f.jsx("div",{className:"md:block hidden",children:(s==null?void 0:s.prev)||"قبلی"}),f.jsx("div",{className:"md:hidden block",children:y?p||f.jsx(vy,{}):g||f.jsx(gy,{})})]})})]}),f.jsxs("span",{className:"text-sm font-medium",children:[s==null?void 0:s.page," ",n," ",s==null?void 0:s.of," ",r]}),f.jsxs("div",{className:"flex",children:[f.jsx(Vt,{children:f.jsxs(Nt,{"aria-label":"Go to next page",size:"default",className:ie("gap-1",m),onClick:()=>i==null?void 0:i(n+1),disabled:n===r,children:[f.jsx("span",{className:"md:block hidden",children:(s==null?void 0:s.next)||"بعدی"}),f.jsx("div",{className:"md:hidden block",children:y?p||f.jsx(gy,{}):g||f.jsx(vy,{})})]})}),f.jsx(Vt,{className:"md:block hidden",children:f.jsx(Nt,{size:"default","aria-label":"Go to last page",disabled:n===r,onClick:()=>i==null?void 0:i(r),children:s==null?void 0:s.last})})]})]})})},BC=({currentPage:n,totalPages:r,onPageChange:i,dir:o="rtl",labels:s,previousClassName:u,nextClassName:m,className:h,...p})=>{const g=o==="rtl";return f.jsxs("nav",{role:"navigation","aria-label":"pagination",className:ie("flex w-full items-center justify-between text-sm text-muted-foreground",h),...p,children:[f.jsxs("span",{children:[s==null?void 0:s.page," ",n," ",s==null?void 0:s.of," ",r]}),f.jsxs(Xr,{className:"flex items-center gap-2",children:[f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to first page",size:"default",className:"gap-1 px-2.5",onClick:()=>i==null?void 0:i(1),disabled:n===1||r<2,children:f.jsx("span",{children:s==null?void 0:s.first})})}),f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to previous page",size:"default",className:ie("gap-1",u),onClick:()=>i==null?void 0:i(g?n+1:n-1),disabled:g?n===r:n===1,children:f.jsx("span",{children:g?s==null?void 0:s.next:s==null?void 0:s.prev})})}),f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to next page",size:"default",className:ie("gap-1",m),onClick:()=>i==null?void 0:i(g?n-1:n+1),disabled:g?n===1:n===r,children:f.jsx("span",{children:g?s==null?void 0:s.prev:s==null?void 0:s.next})})}),f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to last page",size:"default",className:"gap-1 px-2.5",onClick:()=>i==null?void 0:i(r),disabled:n===r,children:f.jsx("span",{children:s==null?void 0:s.last})})})]})]})},HC=(n,r,i)=>{const o=[],s=i==="rtl";if(r<=6)for(let u=1;u<=r;u++)o.push(u);else{const u=n>3,m=n<r-2;if(u)if(m)o.push(1,"...",n-1,n,n+1,"...",r);else{o.push(1,2,3,"...");for(let h=r-2;h<=r;h++)o.push(h)}else{for(let h=1;h<=3;h++)o.push(h);o.push("...",r-2,r-1,r)}}return s?[...o].reverse():o},VC=({currentPage:n,totalPages:r,onPageChange:i,labels:o,previousClassName:s,className:u,activeClassName:m,nextClassName:h,dir:p="rtl",prevIcon:g,nextIcon:v,firstIcon:y,lastIcon:S,showFirstLast:w=!0,hasText:j=!0})=>{const R=HC(n,r,p),C=p==="rtl",N=C?[...R].reverse():R;return f.jsxs("nav",{role:"navigation","aria-label":"pagination",className:ie("mx-auto flex w-full justify-center",p==="rtl"?"rtl":"ltr",u),children:[f.jsxs("div",{className:ie("flex gap-2",C?"ml-auto":"mr-auto"),children:[w&&f.jsxs(Nt,{"aria-label":"Go to first page",size:"default",className:"gap-1 px-2.5",onClick:()=>i==null?void 0:i(1),disabled:n===1,children:[C?y||f.jsx(Dv,{}):S||f.jsx(_v,{}),j&&f.jsx("span",{children:o==null?void 0:o.first})]}),f.jsxs(Nt,{"aria-label":"Go to previous page",size:"default",className:ie("flex items-center",s),onClick:()=>i==null?void 0:i(n-1),disabled:n===1,children:[C?v||f.jsx(Ks,{}):g||f.jsx(Zs,{}),j&&f.jsx("span",{children:o==null?void 0:o.prev})]})]}),f.jsx(Xr,{children:N.map((_,L)=>f.jsx(Vt,{children:_==="..."?f.jsx("span",{className:"px-2",children:"..."}):f.jsx(Nt,{isActive:_===n,onClick:()=>i==null?void 0:i(Number(_)),activeClassName:tn(m,"rounded-md"),children:_})},L))}),f.jsxs("div",{className:ie("flex gap-2",C?"mr-auto":"ml-auto"),children:[f.jsxs(Nt,{"aria-label":"Go to next page",size:"default",className:ie("flex items-center",h),onClick:()=>i==null?void 0:i(n+1),disabled:n===r,children:[j&&f.jsx("span",{children:o==null?void 0:o.next}),C?g||f.jsx(Zs,{}):v||f.jsx(Ks,{})]}),w&&f.jsxs(Nt,{"aria-label":"Go to last page",size:"default",className:"gap-1 px-2.5",onClick:()=>i==null?void 0:i(r),disabled:n===r,children:[j&&f.jsx("span",{children:o==null?void 0:o.last}),C?S||f.jsx(_v,{}):y||f.jsx(Dv,{})]})]})]})},Wd=({currentPage:n,totalPages:r,onPageChange:i,dir:o="rtl",labels:s,renderPageNumbers:u,justifyClassName:m,prevIcon:h,nextIcon:p,hasText:g})=>{const v=o==="rtl";return f.jsx("nav",{role:"navigation","aria-label":"pagination",className:ie("w-full flex",m),children:f.jsxs(Xr,{className:"border border-gray-200 rounded-md",children:[f.jsx(Vt,{children:f.jsx(Nt,{size:"default",className:"px-3 py-1 text-sm disabled:opacity-50 flex items-center",onClick:()=>i==null?void 0:i(n-1),disabled:n===1,children:f.jsx("div",{className:"flex items-center gap-1",children:v?f.jsxs(f.Fragment,{children:[h||f.jsx(Ks,{size:16}),g&&f.jsx("span",{className:"hidden md:block",children:s==null?void 0:s.prev})]}):f.jsxs(f.Fragment,{children:[p||f.jsx(Zs,{size:16}),g&&f.jsx("span",{className:"hidden md:block",children:s==null?void 0:s.prev})]})})})}),u(),f.jsx(Vt,{children:f.jsx(Nt,{size:"default",className:"px-3 py-1 text-sm disabled:opacity-50 flex items-center",onClick:()=>i==null?void 0:i(n+1),disabled:n===r,children:f.jsx("div",{className:"flex items-center gap-1",children:v?f.jsxs(f.Fragment,{children:[g&&f.jsx("span",{className:"hidden md:block",children:s==null?void 0:s.next}),p||f.jsx(Zs,{size:16})]}):f.jsxs(f.Fragment,{children:[g&&f.jsx("span",{className:"hidden md:block",children:s==null?void 0:s.next}),h||f.jsx(Ks,{size:16})]})})})})]})})},qC=({currentPage:n,totalPages:r,onPageChange:i,dir:o="rtl",labels:s,previousClassName:u,nextClassName:m,className:h,...p})=>{const g=o==="rtl";return f.jsxs("nav",{role:"navigation","aria-label":"pagination",className:ie("flex w-full items-center justify-between text-sm text-muted-foreground",h),...p,children:[f.jsxs(Xr,{className:"flex gap-2 items-center",children:[f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to first page",size:"default",className:"gap-1 px-2.5",onClick:()=>i==null?void 0:i(1),disabled:n===1,children:f.jsx("span",{children:s==null?void 0:s.first})})}),f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to previous page",size:"default",className:ie("gap-1",u),onClick:()=>i==null?void 0:i(g?n+1:n-1),disabled:g?n===r:n===1,children:f.jsx("span",{children:g?s==null?void 0:s.next:s==null?void 0:s.prev})})}),f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to next page",size:"default",className:ie("gap-1",m),onClick:()=>i==null?void 0:i(g?n-1:n+1),disabled:g?n===1:n===r,children:f.jsx("span",{children:g?s==null?void 0:s.prev:s==null?void 0:s.next})})}),f.jsx(Vt,{children:f.jsx(Nt,{"aria-label":"Go to last page",size:"default",className:"gap-1 px-2.5",onClick:()=>i==null?void 0:i(r),disabled:n===r,children:f.jsx("span",{children:s==null?void 0:s.last})})})]}),f.jsxs("span",{children:[s==null?void 0:s.page," ",n," ",s==null?void 0:s.of," ",r]})]})},GC=({currentPage:n,totalPages:r,onPageChange:i,type:o="default",dir:s="rtl",className:u,activeClassName:m,previousClassName:h,nextClassName:p,prevIcon:g,nextIcon:v,firstIcon:y,lastIcon:S,showFirstLast:w=!0,labels:j,hasText:R=!0,...C})=>{const N=s==="rtl",L={...{next:N?"بعدی":"Next",prev:N?"قبلی":"Previous",first:N?"اولین":"First",last:N?"آخرین":"Last",page:N?"صفحه":"page",of:N?"از":"of"},...j};if(r<=1)return null;const U=()=>{const X=typeof window<"u"&&window.innerWidth<768,J=[];if(X){const T=new Set;T.add(1),T.add(2),T.add(r-1),T.add(r),n!==1&&n!==2&&n!==r-1&&n!==r&&T.add(n);const ae=Array.from(T).sort((I,ce)=>I-ce);for(let I=0;I<ae.length;I++)J.push(ae[I]),I<ae.length-1&&ae[I+1]!==ae[I]+1&&J.push("...")}else if(r<=6)for(let T=1;T<=r;T++)J.push(T);else{const T=n>3,ae=n<r-2;if(T)if(ae)J.push(1,"...",n-1,n,n+1,"...",r);else{J.push(1,2,3,"...");for(let I=r-2;I<=r;I++)J.push(I)}else{for(let I=1;I<=3;I++)J.push(I);J.push("...",r-2,r-1,r)}}const Z=N?[...J].reverse():J;return f.jsx("div",{className:ie("flex h-full",N&&"flex-row-reverse"),children:Z.map((T,ae)=>T==="..."?f.jsx("span",{className:"md:px-3 md:py-1 p-2 text-gray-400 text-sm",children:"..."},`dots-${ae}`):f.jsx("button",{onClick:()=>i==null?void 0:i(T),className:ie("px-3 py-1 text-sm border border-gray-200",n===T?m:u),children:T},T))})};return o==="card-minimal-right-aligned"?f.jsx(BC,{currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,previousClassName:h,nextClassName:p,className:u,...C}):o==="card-minimal-left-aligned"?f.jsx(qC,{currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,previousClassName:h,nextClassName:p,className:u,...C}):o==="card-minimal-center-aligned"?f.jsx(UC,{currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,previousClassName:h,nextClassName:p,className:u,prevIcon:g,nextIcon:v,...C}):o==="card-button-group-right-aligned"?f.jsx(Wd,{currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,renderPageNumbers:U,previousClassName:h,nextClassName:p,justifyClassName:tn(u,"justify-end"),prevIcon:g,nextIcon:v,hasText:R,...C}):o==="card-button-group-left-aligned"?f.jsx(Wd,{currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,renderPageNumbers:U,previousClassName:h,nextClassName:p,justifyClassName:tn(u,"justify-start"),prevIcon:g,nextIcon:v,hasText:R,...C}):o==="card-button-group-center-aligned"?f.jsx(Wd,{currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,renderPageNumbers:U,previousClassName:h,nextClassName:p,justifyClassName:tn(u,"justify-center"),prevIcon:g,nextIcon:v,hasText:R,...C}):f.jsx(VC,{activeClassName:m,currentPage:n,totalPages:r,onPageChange:i,dir:s,labels:L,previousClassName:h,nextClassName:p,className:u,prevIcon:g,nextIcon:v,firstIcon:y,lastIcon:S,showFirstLast:w,hasText:R})};function Tb(n,[r,i]){return Math.min(i,Math.max(r,n))}function Nb(n){const r=x.useRef({value:n,previous:n});return x.useMemo(()=>(r.current.value!==n&&(r.current.previous=r.current.value,r.current.value=n),r.current.previous),[n])}var Ab=["PageUp","PageDown"],Mb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zb={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Qr="Slider",[mf,YC,$C]=Of(Qr),[_b]=la(Qr,[$C]),[XC,xc]=_b(Qr),Db=x.forwardRef((n,r)=>{const{name:i,min:o=0,max:s=100,step:u=1,orientation:m="horizontal",disabled:h=!1,minStepsBetweenThumbs:p=0,defaultValue:g=[o],value:v,onValueChange:y=()=>{},onValueCommit:S=()=>{},inverted:w=!1,form:j,...R}=n,C=x.useRef(new Set),N=x.useRef(0),L=m==="horizontal"?QC:ZC,[U=[],X]=vl({prop:v,defaultProp:g,onChange:ce=>{var pe;(pe=[...C.current][N.current])==null||pe.focus(),y(ce)}}),J=x.useRef(U);function Z(ce){const re=IC(U,ce);I(ce,re)}function T(ce){I(ce,N.current)}function ae(){const ce=J.current[N.current];U[N.current]!==ce&&S(U)}function I(ce,re,{commit:pe}={commit:!1}){const fe=nR(u),me=aR(Math.round((ce-o)/u)*u+o,fe),k=Tb(me,[o,s]);X((V=[])=>{const H=JC(V,k,re);if(tR(H,p*u)){N.current=H.indexOf(k);const oe=String(H)!==String(V);return oe&&pe&&S(H),oe?H:V}else return V})}return f.jsx(XC,{scope:n.__scopeSlider,name:i,disabled:h,min:o,max:s,valueIndexToChangeRef:N,thumbs:C.current,values:U,orientation:m,form:j,children:f.jsx(mf.Provider,{scope:n.__scopeSlider,children:f.jsx(mf.Slot,{scope:n.__scopeSlider,children:f.jsx(L,{"aria-disabled":h,"data-disabled":h?"":void 0,...R,ref:r,onPointerDown:it(R.onPointerDown,()=>{h||(J.current=U)}),min:o,max:s,inverted:w,onSlideStart:h?void 0:Z,onSlideMove:h?void 0:T,onSlideEnd:h?void 0:ae,onHomeKeyDown:()=>!h&&I(o,0,{commit:!0}),onEndKeyDown:()=>!h&&I(s,U.length-1,{commit:!0}),onStepKeyDown:({event:ce,direction:re})=>{if(!h){const me=Ab.includes(ce.key)||ce.shiftKey&&Mb.includes(ce.key)?10:1,k=N.current,V=U[k],H=u*me*re;I(V+H,k,{commit:!0})}}})})})})});Db.displayName=Qr;var[Ob,Lb]=_b(Qr,{startEdge:"left",endEdge:"right",size:"width",direction:1}),QC=x.forwardRef((n,r)=>{const{min:i,max:o,dir:s,inverted:u,onSlideStart:m,onSlideMove:h,onSlideEnd:p,onStepKeyDown:g,...v}=n,[y,S]=x.useState(null),w=jt(r,L=>S(L)),j=x.useRef(void 0),R=sc(s),C=R==="ltr",N=C&&!u||!C&&u;function _(L){const U=j.current||y.getBoundingClientRect(),X=[0,U.width],Z=nm(X,N?[i,o]:[o,i]);return j.current=U,Z(L-U.left)}return f.jsx(Ob,{scope:n.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:f.jsx(kb,{dir:R,"data-orientation":"horizontal",...v,ref:w,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:L=>{const U=_(L.clientX);m==null||m(U)},onSlideMove:L=>{const U=_(L.clientX);h==null||h(U)},onSlideEnd:()=>{j.current=void 0,p==null||p()},onStepKeyDown:L=>{const X=zb[N?"from-left":"from-right"].includes(L.key);g==null||g({event:L,direction:X?-1:1})}})})}),ZC=x.forwardRef((n,r)=>{const{min:i,max:o,inverted:s,onSlideStart:u,onSlideMove:m,onSlideEnd:h,onStepKeyDown:p,...g}=n,v=x.useRef(null),y=jt(r,v),S=x.useRef(void 0),w=!s;function j(R){const C=S.current||v.current.getBoundingClientRect(),N=[0,C.height],L=nm(N,w?[o,i]:[i,o]);return S.current=C,L(R-C.top)}return f.jsx(Ob,{scope:n.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:f.jsx(kb,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:R=>{const C=j(R.clientY);u==null||u(C)},onSlideMove:R=>{const C=j(R.clientY);m==null||m(C)},onSlideEnd:()=>{S.current=void 0,h==null||h()},onStepKeyDown:R=>{const N=zb[w?"from-bottom":"from-top"].includes(R.key);p==null||p({event:R,direction:N?-1:1})}})})}),kb=x.forwardRef((n,r)=>{const{__scopeSlider:i,onSlideStart:o,onSlideMove:s,onSlideEnd:u,onHomeKeyDown:m,onEndKeyDown:h,onStepKeyDown:p,...g}=n,v=xc(Qr,i);return f.jsx(ot.span,{...g,ref:r,onKeyDown:it(n.onKeyDown,y=>{y.key==="Home"?(m(y),y.preventDefault()):y.key==="End"?(h(y),y.preventDefault()):Ab.concat(Mb).includes(y.key)&&(p(y),y.preventDefault())}),onPointerDown:it(n.onPointerDown,y=>{const S=y.target;S.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(S)?S.focus():o(y)}),onPointerMove:it(n.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&s(y)}),onPointerUp:it(n.onPointerUp,y=>{const S=y.target;S.hasPointerCapture(y.pointerId)&&(S.releasePointerCapture(y.pointerId),u(y))})})}),Ub="SliderTrack",Bb=x.forwardRef((n,r)=>{const{__scopeSlider:i,...o}=n,s=xc(Ub,i);return f.jsx(ot.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...o,ref:r})});Bb.displayName=Ub;var hf="SliderRange",Hb=x.forwardRef((n,r)=>{const{__scopeSlider:i,...o}=n,s=xc(hf,i),u=Lb(hf,i),m=x.useRef(null),h=jt(r,m),p=s.values.length,g=s.values.map(S=>Gb(S,s.min,s.max)),v=p>1?Math.min(...g):0,y=100-Math.max(...g);return f.jsx(ot.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...o,ref:h,style:{...n.style,[u.startEdge]:v+"%",[u.endEdge]:y+"%"}})});Hb.displayName=hf;var pf="SliderThumb",Vb=x.forwardRef((n,r)=>{const i=YC(n.__scopeSlider),[o,s]=x.useState(null),u=jt(r,h=>s(h)),m=x.useMemo(()=>o?i().findIndex(h=>h.ref.current===o):-1,[i,o]);return f.jsx(KC,{...n,ref:u,index:m})}),KC=x.forwardRef((n,r)=>{const{__scopeSlider:i,index:o,name:s,...u}=n,m=xc(pf,i),h=Lb(pf,i),[p,g]=x.useState(null),v=jt(r,_=>g(_)),y=p?m.form||!!p.closest("form"):!0,S=Kf(p),w=m.values[o],j=w===void 0?0:Gb(w,m.min,m.max),R=WC(o,m.values.length),C=S==null?void 0:S[h.size],N=C?PC(C,j,h.direction):0;return x.useEffect(()=>{if(p)return m.thumbs.add(p),()=>{m.thumbs.delete(p)}},[p,m.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[h.startEdge]:`calc(${j}% + ${N}px)`},children:[f.jsx(mf.ItemSlot,{scope:n.__scopeSlider,children:f.jsx(ot.span,{role:"slider","aria-label":n["aria-label"]||R,"aria-valuemin":m.min,"aria-valuenow":w,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...u,ref:v,style:w===void 0?{display:"none"}:n.style,onFocus:it(n.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),y&&f.jsx(qb,{name:s??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:w},o)]})});Vb.displayName=pf;var FC="RadioBubbleInput",qb=x.forwardRef(({__scopeSlider:n,value:r,...i},o)=>{const s=x.useRef(null),u=jt(s,o),m=Nb(r);return x.useEffect(()=>{const h=s.current;if(!h)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==r&&v){const y=new Event("input",{bubbles:!0});v.call(h,r),h.dispatchEvent(y)}},[m,r]),f.jsx(ot.input,{style:{display:"none"},...i,ref:u,defaultValue:r})});qb.displayName=FC;function JC(n=[],r,i){const o=[...n];return o[i]=r,o.sort((s,u)=>s-u)}function Gb(n,r,i){const u=100/(i-r)*(n-r);return Tb(u,[0,100])}function WC(n,r){return r>2?`Value ${n+1} of ${r}`:r===2?["Minimum","Maximum"][n]:void 0}function IC(n,r){if(n.length===1)return 0;const i=n.map(s=>Math.abs(s-r)),o=Math.min(...i);return i.indexOf(o)}function PC(n,r,i){const o=n/2,u=nm([0,50],[0,o]);return(o-u(r)*i)*i}function eR(n){return n.slice(0,-1).map((r,i)=>n[i+1]-r)}function tR(n,r){if(r>0){const i=eR(n);return Math.min(...i)>=r}return!0}function nm(n,r){return i=>{if(n[0]===n[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(n[1]-n[0]);return r[0]+o*(i-n[0])}}function nR(n){return(String(n).split(".")[1]||"").length}function aR(n,r){const i=Math.pow(10,r);return Math.round(n*i)/i}var lR=Db,rR=Bb,iR=Hb,oR=Vb;function sR({defaultValue:n=[0,1e3],min:r=0,max:i=1e3,step:o=1,className:s="",trackClassName:u="",rangeClassName:m="",thumbClassName:h="",showValue:p=!1,valueClassName:g="",isPercentage:v=!1,valuePosition:y="bottom",dir:S="ltr",onValueChange:w,...j}){const[R,C]=x.useState(n),N=_=>{const[L,U]=_,X=Math.max(r,Math.min(L,i)),J=Math.min(i,Math.max(U,r)),Z=[X,J];C(Z),w==null||w(Z)};return f.jsxs(lR,{value:R,onValueChange:N,min:r,max:i,step:o,dir:S,className:ie("relative flex w-full touch-none select-none items-center",s),...j,children:[f.jsx(rR,{className:ie("relative h-2 w-full grow overflow-hidden rounded-full bg-gray-light-200",u),children:f.jsx(iR,{className:ie("absolute h-full bg-rfg-brand-primary-600",m)})}),R.map((_,L)=>f.jsx(oR,{className:ie("relative block h-5 w-5 rounded-full border-2 border-rfg-brand-primary-600 bg-white focus:outline-none focus:ring-2 focus:ring-rfg-brand-primary-300",h),children:p&&f.jsx("span",{className:ie("absolute left-1/2 -translate-x-1/2 whitespace-nowrap text-xs text-gray-700",y==="top"?"bottom-7":"top-7",g),children:v?`٪${_}`:_.toLocaleString()})},L))]})}var wc="Switch",[cR]=la(wc),[uR,dR]=cR(wc),Yb=x.forwardRef((n,r)=>{const{__scopeSwitch:i,name:o,checked:s,defaultChecked:u,required:m,disabled:h,value:p="on",onCheckedChange:g,form:v,...y}=n,[S,w]=x.useState(null),j=jt(r,L=>w(L)),R=x.useRef(!1),C=S?v||!!S.closest("form"):!0,[N,_]=vl({prop:s,defaultProp:u??!1,onChange:g,caller:wc});return f.jsxs(uR,{scope:i,checked:N,disabled:h,children:[f.jsx(ot.button,{type:"button",role:"switch","aria-checked":N,"aria-required":m,"data-state":Zb(N),"data-disabled":h?"":void 0,disabled:h,value:p,...y,ref:j,onClick:it(n.onClick,L=>{_(U=>!U),C&&(R.current=L.isPropagationStopped(),R.current||L.stopPropagation())})}),C&&f.jsx(Qb,{control:S,bubbles:!R.current,name:o,value:p,checked:N,required:m,disabled:h,form:v,style:{transform:"translateX(-100%)"}})]})});Yb.displayName=wc;var $b="SwitchThumb",Xb=x.forwardRef((n,r)=>{const{__scopeSwitch:i,...o}=n,s=dR($b,i);return f.jsx(ot.span,{"data-state":Zb(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})});Xb.displayName=$b;var fR="SwitchBubbleInput",Qb=x.forwardRef(({__scopeSwitch:n,control:r,checked:i,bubbles:o=!0,...s},u)=>{const m=x.useRef(null),h=jt(m,u),p=Nb(i),g=Kf(r);return x.useEffect(()=>{const v=m.current;if(!v)return;const y=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(y,"checked").set;if(p!==i&&w){const j=new Event("click",{bubbles:o});w.call(v,i),v.dispatchEvent(j)}},[p,i,o]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...s,tabIndex:-1,ref:h,style:{...s.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Qb.displayName=fR;function Zb(n){return n?"checked":"unchecked"}var mR=Yb,hR=Xb;function pR({label:n,labelClassName:r,handleClick:i,description:o,descriptionClassName:s}){return f.jsxs("div",{className:"flex flex-col gap-1",children:[n&&f.jsx(ea,{type:"button",variant:"linkGray",className:ie("text-sm",r),onClick:i,children:n}),o&&f.jsx("span",{className:ie("text-xs text-gray-500",s),children:o})]})}const am=x.forwardRef(({className:n,thumbClassName:r,label:i,labelClassName:o,descriptionClassName:s,description:u,onToggle:m,...h},p)=>{const[g,v]=x.useState(!1),y=()=>{v(S=>!S),m()};return f.jsxs("div",{className:ie("flex gap-1",u?"items-start":"items-center"),children:[f.jsx(mR,{ref:p,className:ie("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-start rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-brand-600 data-[state=unchecked]:bg-gray-light-100",n,u?"mt-0.5":"mt-0"),onCheckedChange:y,checked:g,...h,children:f.jsx(hR,{className:ie("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:-translate-x-5 data-[state=checked]:ltr:translate-x-5 data-[state=unchecked]:-translate-x-0",r)})}),f.jsx(pR,{label:i,labelClassName:o,handleClick:y,description:u,descriptionClassName:s})]})});am.displayName="Switch";var Id="rovingFocusGroup.onEntryFocus",gR={bubbles:!1,cancelable:!0},fo="RovingFocusGroup",[gf,Kb,vR]=Of(fo),[yR,Fb]=la(fo,[vR]),[bR,xR]=yR(fo),Jb=x.forwardRef((n,r)=>f.jsx(gf.Provider,{scope:n.__scopeRovingFocusGroup,children:f.jsx(gf.Slot,{scope:n.__scopeRovingFocusGroup,children:f.jsx(wR,{...n,ref:r})})}));Jb.displayName=fo;var wR=x.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:i,orientation:o,loop:s=!1,dir:u,currentTabStopId:m,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:p,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=n,S=x.useRef(null),w=jt(r,S),j=sc(u),[R,C]=vl({prop:m,defaultProp:h??null,onChange:p,caller:fo}),[N,_]=x.useState(!1),L=oo(g),U=Kb(i),X=x.useRef(!1),[J,Z]=x.useState(0);return x.useEffect(()=>{const T=S.current;if(T)return T.addEventListener(Id,L),()=>T.removeEventListener(Id,L)},[L]),f.jsx(bR,{scope:i,orientation:o,dir:j,loop:s,currentTabStopId:R,onItemFocus:x.useCallback(T=>C(T),[C]),onItemShiftTab:x.useCallback(()=>_(!0),[]),onFocusableItemAdd:x.useCallback(()=>Z(T=>T+1),[]),onFocusableItemRemove:x.useCallback(()=>Z(T=>T-1),[]),children:f.jsx(ot.div,{tabIndex:N||J===0?-1:0,"data-orientation":o,...y,ref:w,style:{outline:"none",...n.style},onMouseDown:it(n.onMouseDown,()=>{X.current=!0}),onFocus:it(n.onFocus,T=>{const ae=!X.current;if(T.target===T.currentTarget&&ae&&!N){const I=new CustomEvent(Id,gR);if(T.currentTarget.dispatchEvent(I),!I.defaultPrevented){const ce=U().filter(k=>k.focusable),re=ce.find(k=>k.active),pe=ce.find(k=>k.id===R),me=[re,pe,...ce].filter(Boolean).map(k=>k.ref.current);Pb(me,v)}}X.current=!1}),onBlur:it(n.onBlur,()=>_(!1))})})}),Wb="RovingFocusGroupItem",Ib=x.forwardRef((n,r)=>{const{__scopeRovingFocusGroup:i,focusable:o=!0,active:s=!1,tabStopId:u,children:m,...h}=n,p=io(),g=u||p,v=xR(Wb,i),y=v.currentTabStopId===g,S=Kb(i),{onFocusableItemAdd:w,onFocusableItemRemove:j,currentTabStopId:R}=v;return x.useEffect(()=>{if(o)return w(),()=>j()},[o,w,j]),f.jsx(gf.ItemSlot,{scope:i,id:g,focusable:o,active:s,children:f.jsx(ot.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...h,ref:r,onMouseDown:it(n.onMouseDown,C=>{o?v.onItemFocus(g):C.preventDefault()}),onFocus:it(n.onFocus,()=>v.onItemFocus(g)),onKeyDown:it(n.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){v.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=jR(C,v.orientation,v.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let L=S().filter(U=>U.focusable).map(U=>U.ref.current);if(N==="last")L.reverse();else if(N==="prev"||N==="next"){N==="prev"&&L.reverse();const U=L.indexOf(C.currentTarget);L=v.loop?CR(L,U+1):L.slice(U+1)}setTimeout(()=>Pb(L))}}),children:typeof m=="function"?m({isCurrentTabStop:y,hasTabStop:R!=null}):m})})});Ib.displayName=Wb;var SR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ER(n,r){return r!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function jR(n,r,i){const o=ER(n.key,i);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return SR[o]}function Pb(n,r=!1){const i=document.activeElement;for(const o of n)if(o===i||(o.focus({preventScroll:r}),document.activeElement!==i))return}function CR(n,r){return n.map((i,o)=>n[(r+o)%n.length])}var RR=Jb,TR=Ib,Sc="Tabs",[NR]=la(Sc,[Fb]),ex=Fb(),[AR,lm]=NR(Sc),tx=x.forwardRef((n,r)=>{const{__scopeTabs:i,value:o,onValueChange:s,defaultValue:u,orientation:m="horizontal",dir:h,activationMode:p="automatic",...g}=n,v=sc(h),[y,S]=vl({prop:o,onChange:s,defaultProp:u??"",caller:Sc});return f.jsx(AR,{scope:i,baseId:io(),value:y,onValueChange:S,orientation:m,dir:v,activationMode:p,children:f.jsx(ot.div,{dir:v,"data-orientation":m,...g,ref:r})})});tx.displayName=Sc;var nx="TabsList",ax=x.forwardRef((n,r)=>{const{__scopeTabs:i,loop:o=!0,...s}=n,u=lm(nx,i),m=ex(i);return f.jsx(RR,{asChild:!0,...m,orientation:u.orientation,dir:u.dir,loop:o,children:f.jsx(ot.div,{role:"tablist","aria-orientation":u.orientation,...s,ref:r})})});ax.displayName=nx;var lx="TabsTrigger",rx=x.forwardRef((n,r)=>{const{__scopeTabs:i,value:o,disabled:s=!1,...u}=n,m=lm(lx,i),h=ex(i),p=sx(m.baseId,o),g=cx(m.baseId,o),v=o===m.value;return f.jsx(TR,{asChild:!0,...h,focusable:!s,active:v,children:f.jsx(ot.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:p,...u,ref:r,onMouseDown:it(n.onMouseDown,y=>{!s&&y.button===0&&y.ctrlKey===!1?m.onValueChange(o):y.preventDefault()}),onKeyDown:it(n.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&m.onValueChange(o)}),onFocus:it(n.onFocus,()=>{const y=m.activationMode!=="manual";!v&&!s&&y&&m.onValueChange(o)})})})});rx.displayName=lx;var ix="TabsContent",ox=x.forwardRef((n,r)=>{const{__scopeTabs:i,value:o,forceMount:s,children:u,...m}=n,h=lm(ix,i),p=sx(h.baseId,o),g=cx(h.baseId,o),v=o===h.value,y=x.useRef(v);return x.useEffect(()=>{const S=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(S)},[]),f.jsx(ic,{present:s||v,children:({present:S})=>f.jsx(ot.div,{"data-state":v?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":p,hidden:!S,id:g,tabIndex:0,...m,ref:r,style:{...n.style,animationDuration:y.current?"0s":void 0},children:S&&u})})});ox.displayName=ix;function sx(n,r){return`${n}-trigger-${r}`}function cx(n,r){return`${n}-content-${r}`}var MR=tx,zR=ax,_R=rx,DR=ox;function OR({className:n,...r}){return f.jsx(DR,{"data-slot":"tabs-content",className:ie("flex-1 outline-none",n),...r})}const LR=" text-muted-foreground inline-flex flex-row h-9 items-center",kR={brand:"",gray:"",outlined:"border-b border-rborder-secondary gap-2",bordered:"rounded-lg border border-rborder-secondary bg-rbg-secondary-alt p-1",minimal:" rounded-md border border-rborder-secondary bg-rbg-secondary-alt !gap-0.5"},UR=hn(LR,{variants:{listVariant:kR,fullWidth:{true:"justify-between",false:"justify-start gap-1"},direction:{vertical:"flex-col min-h-fit max-w-fit ",horizontal:"flex-row w-full"}},defaultVariants:{listVariant:"brand",fullWidth:!0,direction:"horizontal"}}),BR=" h-full py-2 px-3 cursor-pointer inline-flex items-center justify-center gap-2 text-sm font-normal whitespace-nowrap transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",HR={brand:"text-rtext-quaternary-500 data-[state=active]:rounded-sm data-[state=active]:bg-rbg-brand-primary-alt data-[state=active]:text-rtext-brand-secondary-700 ",gray:"text-rtext-quaternary-500 data-[state=active]:rounded-sm data-[state=active]:bg-rbg-active data-[state=active]:text-rtext-secondary-700 ",outlined:"text-rtext-quaternary-500 data-[state=active]:text-rtext-brand-secondary-700 pb-2.5 data-[state=active]:pb-2 data-[state=active]:border-b-2 data-[state=active]:border-rgf-brand-primary-alt",bordered:"text-rtext-quaternary-500 data-[state=active]:rounded-sm data-[state=active]:text-rtext-secondary-700 data-[state=active]:bg-rbg-primary-alt data-[state=active]:shadow-sm",minimal:"text-rtext-quaternary-500 data-[state=active]:rounded-md data-[state=active]:text-rtext-secondary-700 data-[state=active]:bg-rbg-primary-alt data-[state=active]:border data-[state=active]:border-rborder-primary data-[state=active]:shadow-xs"},VR=hn(BR,{variants:{triggerVariant:HR,fullWidth:{true:"w-full",false:"w-fit justify-start gap-1 items-center"}},defaultVariants:{triggerVariant:"gray",fullWidth:!0}});function qR({className:n,listVariant:r,direction:i="horizontal",fullWidth:o=!1,...s}){return f.jsx(zR,{"data-slot":"tabs-list",className:ie(UR({fullWidth:o,listVariant:r,direction:i}),n),...s})}function GR({className:n,triggerVariant:r,fullWidth:i,...o}){return f.jsx(_R,{"data-slot":"tabs-trigger",className:ie(VR({triggerVariant:r,fullWidth:i}),n),...o})}const YR=({className:n,direction:r="horizontal",dir:i="rtl",...o})=>f.jsx(MR,{"data-slot":"tabs",dir:i,className:ie("flex gap-2",r=="horizontal"?"flex-col":"flex-row",n),...o}),zt=Object.assign(YR,{List:qR,Trigger:GR,Content:OR}),$R="rounded-md p-2 shadow-xs w-fit bg-white border border-rborder-primary focus:outline-2 focus:outline-rborder-brand disabled:bg-rbg-disabled-subtle disabled:border-rborder-disabled w-full",XR="!border-2 !border-rborder-error focus:!outline-0",QR=hn($R),ZR=({row:n=5,label:r,required:i=!1,disabled:o=!1,error:s,hintText:u,placeholder:m,helpIcon:h=!1,onChange:p,id:g,tooltipProps:v,className:y,value:S,name:w,labelClass:j,labelStarClass:R,autoFocus:C=!1,...N})=>f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsxs("div",{className:"flex items-center",children:[f.jsx(bc,{id:g,label:r,required:i,labelClass:j,labelStarClass:R}),h&&v&&f.jsx(co,{content:v==null?void 0:v.text,description:v==null?void 0:v.description,position:v==null?void 0:v.position,dir:v==null?void 0:v.dir,descriptionClassName:v==null?void 0:v.descriptionClassName,children:f.jsx("div",{children:f.jsx(tm,{})})})]}),f.jsx("textarea",{value:S,name:w,disabled:o,rows:n,placeholder:m,id:g,onChange:p,className:ie(QR(),y,!!s&&XR,!!s&&"bg-rbg-disabled-subtle border-rborder-disabled"),autoFocus:C,...N}),!s&&u&&f.jsx("p",{className:"text-sm text-rtext-tertiary-600",children:u}),!!s&&f.jsx("p",{className:"text-sm text-rtext-error-primary-600",children:s})]}),KR={success:f.jsx(K3,{className:"text-green-100",size:20}),error:f.jsx(J3,{className:"text-red-100",size:20}),info:f.jsx(o6,{className:"text-blue-100",size:20}),warning:f.jsx(d6,{className:"text-yellow-100",size:20})},FR={success:"bg-green-500",error:"bg-red-500",info:"bg-blue-500",warning:"bg-yellow-500 text-black"},JR={fade:"transition-all duration-300",slide:"transition-all duration-300 transform translate-x-0",scale:"transition-all duration-300 transform scale-100"},WR={fade:"opacity-0",slide:"translate-x-10 opacity-0",scale:"scale-0 opacity-0"};function IR(n){switch(n){case"top-left":return"top-4 left-4";case"top-center":return"top-4 left-1/2 -translate-x-1/2";case"top-right":return"top-4 right-4";case"middle-center":return"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2";case"bottom-left":return"bottom-4 left-4";case"bottom-center":return"bottom-4 left-1/2 -translate-x-1/2";case"bottom-right":return"bottom-4 right-4";default:return"top-4 right-4"}}const yy=3,PR=["top-left","top-center","top-right","middle-center","bottom-left","bottom-center","bottom-right"],ux=({type:n="info",position:r="top-right",duration:i=3e3,animation:o="fade",showProgress:s=!0})=>{const[u,m]=x.useState([]),h=x.useRef({});x.useEffect(()=>{e5({type:n,duration:i,animation:o,position:r,showProgress:s})},[]),x.useEffect(()=>{const y=S=>{const w=Date.now(),j=S.detail.duration??3e3,R={...S.detail,id:w,visible:!0,progressVisible:!1,duration:j,position:S.detail.position??"top-right",animation:S.detail.animation??"fade",showProgress:S.detail.showProgress??!1};m(C=>{if(C.length>=yy)return C;const N=Date.now();return h.current[w]={timeoutId:setTimeout(()=>p(w),j),start:N,remaining:j},[...C,R]}),requestAnimationFrame(()=>{m(C=>C.map(N=>N.id===w?{...N,progressVisible:!0}:N))})};return window.addEventListener("custom-toast",y),()=>window.removeEventListener("custom-toast",y)},[]);const p=y=>{m(S=>S.map(w=>w.id===y?{...w,visible:!1}:w)),setTimeout(()=>{m(S=>S.filter(w=>w.id!==y)),delete h.current[y]},300)},g=y=>{const S=h.current[y];if(!S)return;const j=Date.now()-S.start;S.remaining=Math.max(0,S.remaining-j),clearTimeout(S.timeoutId)},v=y=>{const S=h.current[y];!S||S.remaining<=0||(S.start=Date.now(),S.timeoutId=setTimeout(()=>p(y),S.remaining))};return f.jsx(f.Fragment,{children:PR.map(y=>{const S=u.filter(w=>w.position===y).slice(-yy);return S.length===0?null:f.jsx("div",{className:`fixed z-50 space-y-2 w-full sm:w-[320px] px-4 ${IR(y)}`,children:S.map(w=>(console.log("toast : ",w),f.jsxs("div",{onMouseEnter:()=>g(w.id),onMouseLeave:()=>v(w.id),className:tn("relative px-4 py-3 pr-10 rounded shadow text-white flex items-start gap-3",FR[w.type??"info"],JR[w.animation??"fade"],w.visible?"":WR[w.animation??"fade"]),children:[f.jsx("span",{children:KR[w.type??"info"]}),f.jsx("div",{className:"flex-1 break-words text-sm",dangerouslySetInnerHTML:{__html:w.message}}),f.jsx("button",{className:"absolute top-2 right-2 text-white hover:opacity-80",onClick:()=>p(w.id),children:f.jsx(m6,{size:16})}),w.showProgress&&f.jsx("div",{className:"absolute bottom-0 left-0 h-1 bg-white/50",style:{width:w.progressVisible?"100%":"0%",transition:`width ${w.duration}ms linear`}})]},w.id)))},y)})})};let Wn={};function e5(n){Wn=n}function _a(n){const r=typeof n=="string"?{...Wn,message:n,type:(Wn==null?void 0:Wn.type)??"info"}:{...Wn,...n},i=new CustomEvent("custom-toast",{detail:r});window.dispatchEvent(i)}_a.success=(n,r)=>_a({...Wn,...r,message:n,type:"success"});_a.error=(n,r)=>_a({...Wn,...r,message:n,type:"error"});_a.info=(n,r)=>_a({...Wn,...r,message:n,type:"info"});_a.warning=(n,r)=>_a({...Wn,...r,message:n,type:"warning"});const t5="rounded-md px-2 shadow-xs bg-white border border-rborder-primary disabled:border-rborder-disabled flex flex-wrap focus:outline-2 focus:outline-rborder-brand disabled:bg-rbg-disabled-subtle relative min-h-[36px] h-fit w-full gap-2",n5={sm:"h-9 py-2",md:"h-10 pt-2 pb-2.5"},a5="!border-2 !border-rborder-error focus:!outline-0",l5="bg-rbg-disabled-subtle border-rborder-disabled",r5=hn(t5,{variants:{size:n5},defaultVariants:{size:"sm"}}),i5=({stroke:n="#F04438",fill:r="none",width:i="16",height:o="16"})=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:i,height:o,viewBox:"0 0 16 16",fill:r,children:[f.jsx("g",{clipPath:"url(#clip0_3531_403167)",children:f.jsx("path",{d:"M7.99998 5.33337V8.00004M7.99998 10.6667H8.00665M14.6666 8.00004C14.6666 11.6819 11.6819 14.6667 7.99998 14.6667C4.31808 14.6667 1.33331 11.6819 1.33331 8.00004C1.33331 4.31814 4.31808 1.33337 7.99998 1.33337C11.6819 1.33337 14.6666 4.31814 14.6666 8.00004Z",stroke:n,strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_3531_403167",children:f.jsx("rect",{width:i,height:o,fill:"white"})})})]}),o5=x.memo(i5),s5=({stroke:n="#98A2B3",fill:r="none",width:i="14",height:o="14"})=>f.jsx("svg",{width:i,className:"remove",height:o,viewBox:"0 0 14 14",fill:r,xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{d:"M9.5 4.5L4.5 9.5M4.5 4.5L9.5 9.5",stroke:n,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),c5=x.memo(s5),u5=({size:n="sm",disabled:r=!1,id:i,label:o,required:s=!1,error:u,hintText:m,placeholder:h,helpIcon:p=!1,className:g,onChange:v,tooltipProps:y,name:S})=>{const[w,j]=x.useState([]),[R,C]=x.useState(""),N=x.useCallback(()=>{const U=R.trim();if(U&&!w.includes(U)){const X=[...w,U];j(X),v==null||v(X)}C("")},[R,w,j,C,v]),_=x.useCallback(U=>{const X=w.filter((J,Z)=>Z!==U);j(X),v==null||v(X)},[w,j,v]),L=x.useCallback(U=>{U.key==="Enter"?(U.preventDefault(),N()):U.key==="Backspace"&&R===""&&_((w==null?void 0:w.length)-1)},[N,R,w,_]);return f.jsxs("div",{className:"flex flex-col gap-1",children:[f.jsx(bc,{id:i,label:o,required:s}),f.jsx("div",{className:"group relative w-full",children:f.jsxs("div",{className:ie(r5({size:n}),g,!!u&&a5,r&&l5,"group-focus-within:outline-2 group-focus-within:outline-rborder-brand",!!u&&"bg-rbg-disabled-subtle border-rborder-disabled"),children:[w==null?void 0:w.map((U,X)=>f.jsxs("span",{className:`flex items-center text-xs text-rtext-secondary-700 px-1 bg-white
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Design System | Rahkargostaran</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DVdz6C5h.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-CFvpPuYw.css">
|
|
10
10
|
</head>
|
|
11
11
|
|