@mahatisystems/mahati-ui-components 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -11,19 +11,13 @@ interface TooltipProps {
11
11
  }
12
12
  declare const Tooltip: react__default.FC<TooltipProps>;
13
13
 
14
- interface VariantStyle {
15
- color: string;
16
- textColor: string;
17
- border: string;
18
- }
19
- declare const variants: Record<string, VariantStyle>;
20
14
  interface ButtonProps {
21
15
  color?: string;
22
16
  textColor?: string;
23
17
  size?: "small" | "medium" | "large";
24
18
  isLoading?: boolean;
25
19
  danger?: boolean;
26
- variant?: keyof typeof variants;
20
+ variant?: "primary" | "success" | "danger";
27
21
  type?: "button" | "submit" | "reset";
28
22
  radius?: string | number;
29
23
  }
package/dist/index.d.ts CHANGED
@@ -11,19 +11,13 @@ interface TooltipProps {
11
11
  }
12
12
  declare const Tooltip: react__default.FC<TooltipProps>;
13
13
 
14
- interface VariantStyle {
15
- color: string;
16
- textColor: string;
17
- border: string;
18
- }
19
- declare const variants: Record<string, VariantStyle>;
20
14
  interface ButtonProps {
21
15
  color?: string;
22
16
  textColor?: string;
23
17
  size?: "small" | "medium" | "large";
24
18
  isLoading?: boolean;
25
19
  danger?: boolean;
26
- variant?: keyof typeof variants;
20
+ variant?: "primary" | "success" | "danger";
27
21
  type?: "button" | "submit" | "reset";
28
22
  radius?: string | number;
29
23
  }
package/dist/index.js CHANGED
@@ -1,139 +1,63 @@
1
- "use strict";var nn=Object.create;var Ae=Object.defineProperty;var on=Object.getOwnPropertyDescriptor;var an=Object.getOwnPropertyNames;var sn=Object.getPrototypeOf,cn=Object.prototype.hasOwnProperty;var ln=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pn=(e,t)=>{for(var r in t)Ae(e,r,{get:t[r],enumerable:!0})},Et=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of an(t))!cn.call(e,o)&&o!==r&&Ae(e,o,{get:()=>t[o],enumerable:!(n=on(t,o))||n.enumerable});return e};var rt=(e,t,r)=>(r=e!=null?nn(sn(e)):{},Et(t||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e)),dn=e=>Et(Ae({},"__esModule",{value:!0}),e);var At=ln((Qo,Rt)=>{"use strict";Rt.exports=function(t,r,n,o){var i=n?n.call(o,t,r):void 0;if(i!==void 0)return!!i;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),c=Object.keys(r);if(a.length!==c.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(r),u=0;u<a.length;u++){var h=a[u];if(!s(h))return!1;var l=t[h],g=r[h];if(i=n?n.call(o,l,g,h):void 0,i===!1||i===void 0&&l!==g)return!1}return!0}});var Lo={};pn(Lo,{MahatiButton:()=>Rr,MahatiCard:()=>Ar,MahatiDropdown:()=>Nr,MahatiFormContainer:()=>Ir,MahatiInput:()=>zr,MahatiKeyValueDisplay:()=>Dr,MahatiLabel:()=>Mr,MahatiMain:()=>jr,MahatiParagraph:()=>Hr,MahatiRow:()=>Yr,MahatiSection:()=>Ur,MahatiSpinner:()=>Br,MahatiTabbedInterface:()=>Vr,MahatiTable:()=>Lr,MahatiTooltip:()=>Pt,isValidPassword:()=>Xr,isValidUsername:()=>Kr,maxLength:()=>Wr,minLength:()=>qr,required:()=>Gr});module.exports=dn(Lo);var _t=require("react");var Ne=require("react/jsx-runtime"),un=({text:e,position:t,children:r})=>{let[n,o]=(0,_t.useState)(!1);return(0,Ne.jsxs)("div",{className:"tooltipContainer",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[r,n&&(0,Ne.jsx)("div",{className:`tooltip ${n?"tooltipVisible":""}`,children:e})]})},Pt=un;var N=function(){return N=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},N.apply(this,arguments)};function K(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function Tt(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var fn=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Ot=Tt(function(e){return fn.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});var k=rt(require("react")),ur=rt(At());var S="-ms-",X="-moz-",w="-webkit-",Ie="comm",H="rule",ne="decl";var Nt="@import";var ze="@keyframes";var It="@layer";var nt=Math.abs,ve=String.fromCharCode,xe=Object.assign;function zt(e,t){return T(e,0)^45?(((t<<2^T(e,0))<<2^T(e,1))<<2^T(e,2))<<2^T(e,3):0}function De(e){return e.trim()}function j(e,t){return(e=t.exec(e))?e[0]:e}function f(e,t,r){return e.replace(t,r)}function oe(e,t,r){return e.indexOf(t,r)}function T(e,t){return e.charCodeAt(t)|0}function F(e,t,r){return e.slice(t,r)}function I(e){return e.length}function Me(e){return e.length}function Z(e,t){return t.push(e),e}function Dt(e,t){return e.map(t).join("")}function ot(e,t){return e.filter(function(r){return!j(r,t)})}var je=1,ie=1,Mt=0,D=0,A=0,ae="";function Se(e,t,r,n,o,i,a,c){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:je,column:ie,length:a,return:"",siblings:c}}function V(e,t){return xe(Se("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function J(e){for(;e.root;)e=V(e.root,{children:[e]});Z(e,e.siblings)}function jt(){return A}function $t(){return A=D>0?T(ae,--D):0,ie--,A===10&&(ie=1,je--),A}function M(){return A=D<Mt?T(ae,D++):0,ie++,A===10&&(ie=1,je++),A}function G(){return T(ae,D)}function ke(){return D}function $e(e,t){return F(ae,e,t)}function it(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ft(e){return je=ie=1,Mt=I(ae=e),D=0,[]}function Lt(e){return ae="",e}function Fe(e){return De($e(D-1,at(e===91?e+2:e===40?e+1:e)))}function Vt(e){for(;(A=G())&&A<33;)M();return it(e)>2||it(A)>3?"":" "}function Bt(e,t){for(;--t&&M()&&!(A<48||A>102||A>57&&A<65||A>70&&A<97););return $e(e,ke()+(t<6&&G()==32&&M()==32))}function at(e){for(;M();)switch(A){case e:return D;case 34:case 39:e!==34&&e!==39&&at(A);break;case 40:e===41&&at(e);break;case 92:M();break}return D}function Ut(e,t){for(;M()&&e+A!==57;)if(e+A===84&&G()===47)break;return"/*"+$e(t,D-1)+"*"+ve(e===47?e:M())}function Yt(e){for(;!it(G());)M();return $e(e,D)}function Wt(e){return Lt(Le("",null,null,null,[""],e=Ft(e),0,[0],e))}function Le(e,t,r,n,o,i,a,c,s){for(var u=0,h=0,l=a,g=0,m=0,x=0,d=1,O=1,R=1,_=0,C="",E=o,P=i,b=n,y=C;O;)switch(x=_,_=M()){case 40:if(x!=108&&T(y,l-1)==58){oe(y+=f(Fe(_),"&","&\f"),"&\f",nt(u?c[u-1]:0))!=-1&&(R=-1);break}case 34:case 39:case 91:y+=Fe(_);break;case 9:case 10:case 13:case 32:y+=Vt(x);break;case 92:y+=Bt(ke()-1,7);continue;case 47:switch(G()){case 42:case 47:Z(hn(Ut(M(),ke()),t,r,s),s);break;default:y+="/"}break;case 123*d:c[u++]=I(y)*R;case 125*d:case 59:case 0:switch(_){case 0:case 125:O=0;case 59+h:R==-1&&(y=f(y,/\f/g,"")),m>0&&I(y)-l&&Z(m>32?Gt(y+";",n,r,l-1,s):Gt(f(y," ","")+";",n,r,l-2,s),s);break;case 59:y+=";";default:if(Z(b=Ht(y,t,r,u,h,o,c,C,E=[],P=[],l,i),i),_===123)if(h===0)Le(y,t,b,b,E,i,l,c,P);else switch(g===99&&T(y,3)===110?100:g){case 100:case 108:case 109:case 115:Le(e,b,b,n&&Z(Ht(e,b,b,0,0,o,c,C,o,E=[],l,P),P),o,P,l,c,n?E:P);break;default:Le(y,b,b,b,[""],P,0,c,P)}}u=h=m=0,d=R=1,C=y="",l=a;break;case 58:l=1+I(y),m=x;default:if(d<1){if(_==123)--d;else if(_==125&&d++==0&&$t()==125)continue}switch(y+=ve(_),_*d){case 38:R=h>0?1:(y+="\f",-1);break;case 44:c[u++]=(I(y)-1)*R,R=1;break;case 64:G()===45&&(y+=Fe(M())),g=G(),h=l=I(C=y+=Yt(ke())),_++;break;case 45:x===45&&I(y)==2&&(d=0)}}return i}function Ht(e,t,r,n,o,i,a,c,s,u,h,l){for(var g=o-1,m=o===0?i:[""],x=Me(m),d=0,O=0,R=0;d<n;++d)for(var _=0,C=F(e,g+1,g=nt(O=a[d])),E=e;_<x;++_)(E=De(O>0?m[_]+" "+C:f(C,/&\f/g,m[_])))&&(s[R++]=E);return Se(e,t,r,o===0?H:c,s,u,h,l)}function hn(e,t,r,n){return Se(e,t,r,Ie,ve(jt()),F(e,2,-2),0,n)}function Gt(e,t,r,n,o){return Se(e,t,r,ne,F(e,0,n),F(e,n+1,-1),n,o)}function st(e,t,r){switch(zt(e,t)){case 5103:return w+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return w+e+e;case 4789:return X+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return w+e+X+e+S+e+e;case 5936:switch(T(e,t+11)){case 114:return w+e+S+f(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return w+e+S+f(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return w+e+S+f(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return w+e+S+e+e;case 6165:return w+e+S+"flex-"+e+e;case 5187:return w+e+f(e,/(\w+).+(:[^]+)/,w+"box-$1$2"+S+"flex-$1$2")+e;case 5443:return w+e+S+"flex-item-"+f(e,/flex-|-self/g,"")+(j(e,/flex-|baseline/)?"":S+"grid-row-"+f(e,/flex-|-self/g,""))+e;case 4675:return w+e+S+"flex-line-pack"+f(e,/align-content|flex-|-self/g,"")+e;case 5548:return w+e+S+f(e,"shrink","negative")+e;case 5292:return w+e+S+f(e,"basis","preferred-size")+e;case 6060:return w+"box-"+f(e,"-grow","")+w+e+S+f(e,"grow","positive")+e;case 4554:return w+f(e,/([^-])(transform)/g,"$1"+w+"$2")+e;case 6187:return f(f(f(e,/(zoom-|grab)/,w+"$1"),/(image-set)/,w+"$1"),e,"")+e;case 5495:case 3959:return f(e,/(image-set\([^]*)/,w+"$1$`$1");case 4968:return f(f(e,/(.+:)(flex-)?(.*)/,w+"box-pack:$3"+S+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+w+e+e;case 4200:if(!j(e,/flex-|baseline/))return S+"grid-column-align"+F(e,t)+e;break;case 2592:case 3360:return S+f(e,"template-","")+e;case 4384:case 3616:return r&&r.some(function(n,o){return t=o,j(n.props,/grid-\w+-end/)})?~oe(e+(r=r[t].value),"span",0)?e:S+f(e,"-start","")+e+S+"grid-row-span:"+(~oe(r,"span",0)?j(r,/\d+/):+j(r,/\d+/)-+j(e,/\d+/))+";":S+f(e,"-start","")+e;case 4896:case 4128:return r&&r.some(function(n){return j(n.props,/grid-\w+-start/)})?e:S+f(f(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return f(e,/(.+)-inline(.+)/,w+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(I(e)-1-t>6)switch(T(e,t+1)){case 109:if(T(e,t+4)!==45)break;case 102:return f(e,/(.+:)(.+)-([^]+)/,"$1"+w+"$2-$3$1"+X+(T(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~oe(e,"stretch",0)?st(f(e,"stretch","fill-available"),t,r)+e:e}break;case 5152:case 5920:return f(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,o,i,a,c,s,u){return S+o+":"+i+u+(a?S+o+"-span:"+(c?s:+s-+i)+u:"")+e});case 4949:if(T(e,t+6)===121)return f(e,":",":"+w)+e;break;case 6444:switch(T(e,T(e,14)===45?18:11)){case 120:return f(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+w+(T(e,14)===45?"inline-":"")+"box$3$1"+w+"$2$3$1"+S+"$2box$3")+e;case 100:return f(e,":",":"+S)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return f(e,"scroll-","scroll-snap-")+e}return e}function se(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function qt(e,t,r,n){switch(e.type){case It:if(e.children.length)break;case Nt:case ne:return e.return=e.return||e.value;case Ie:return"";case ze:return e.return=e.value+"{"+se(e.children,n)+"}";case H:if(!I(e.value=e.props.join(",")))return""}return I(r=se(e.children,n))?e.return=e.value+"{"+r+"}":""}function Kt(e){var t=Me(e);return function(r,n,o,i){for(var a="",c=0;c<t;c++)a+=e[c](r,n,o,i)||"";return a}}function Xt(e){return function(t){t.root||(t=t.return)&&e(t)}}function Zt(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case ne:e.return=st(e.value,e.length,r);return;case ze:return se([V(e,{value:f(e.value,"@","@"+w)})],n);case H:if(e.length)return Dt(r=e.props,function(o){switch(j(o,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":J(V(e,{props:[f(o,/:(read-\w+)/,":"+X+"$1")]})),J(V(e,{props:[o]})),xe(e,{props:ot(r,n)});break;case"::placeholder":J(V(e,{props:[f(o,/:(plac\w+)/,":"+w+"input-$1")]})),J(V(e,{props:[f(o,/:(plac\w+)/,":"+X+"$1")]})),J(V(e,{props:[f(o,/:(plac\w+)/,S+"input-$1")]})),J(V(e,{props:[o]})),xe(e,{props:ot(r,n)});break}return""})}}var Jt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var B=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",fr="active",We="data-styled-version",ce="6.1.19",bt=`/*!sc*/
2
- `,Ce=typeof window<"u"&&typeof document<"u",mn=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production");var Qt=/invalid hook call/i,Ve=new Set,gn=function(e,t){if(process.env.NODE_ENV!=="production"){var r=t?' with the id of "'.concat(t,'"'):"",n="The component ".concat(e).concat(r,` has been created dynamically.
3
- `)+`You may see this warning because you've called styled inside another component.
4
- To resolve this only create new StyledComponents outside of any render method and function component.
5
- See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
6
- `,o=console.error;try{var i=!0;console.error=function(a){for(var c=[],s=1;s<arguments.length;s++)c[s-1]=arguments[s];Qt.test(a)?(i=!1,Ve.delete(n)):o.apply(void 0,K([a],c,!1))},(0,k.useRef)(),i&&!Ve.has(n)&&(console.warn(n),Ve.add(n))}catch(a){Qt.test(a.message)&&Ve.delete(n)}finally{console.error=o}}},Xe=Object.freeze([]),le=Object.freeze({});function yn(e,t,r){return r===void 0&&(r=le),e.theme!==r.theme&&e.theme||t||r.theme}var dt=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),bn=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,wn=/(^-|-$)/g;function er(e){return e.replace(bn,"-").replace(wn,"")}var vn=/(a)(d)/gi,Be=52,tr=function(e){return String.fromCharCode(e+(e>25?39:97))};function ut(e){var t,r="";for(t=Math.abs(e);t>Be;t=t/Be|0)r=tr(t%Be)+r;return(tr(t%Be)+r).replace(vn,"$1-$2")}var ct,hr=5381,Q=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},mr=function(e){return Q(hr,e)};function xn(e){return ut(mr(e)>>>0)}function gr(e){return process.env.NODE_ENV!=="production"&&typeof e=="string"&&e||e.displayName||e.name||"Component"}function lt(e){return typeof e=="string"&&(process.env.NODE_ENV==="production"||e.charAt(0)===e.charAt(0).toLowerCase())}var yr=typeof Symbol=="function"&&Symbol.for,br=yr?Symbol.for("react.memo"):60115,Sn=yr?Symbol.for("react.forward_ref"):60112,kn={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Cn={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wr={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},En=((ct={})[Sn]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ct[br]=wr,ct);function rr(e){return("type"in(t=e)&&t.type.$$typeof)===br?wr:"$$typeof"in e?En[e.$$typeof]:kn;var t}var _n=Object.defineProperty,Pn=Object.getOwnPropertyNames,nr=Object.getOwnPropertySymbols,Tn=Object.getOwnPropertyDescriptor,On=Object.getPrototypeOf,or=Object.prototype;function vr(e,t,r){if(typeof t!="string"){if(or){var n=On(t);n&&n!==or&&vr(e,n,r)}var o=Pn(t);nr&&(o=o.concat(nr(t)));for(var i=rr(e),a=rr(t),c=0;c<o.length;++c){var s=o[c];if(!(s in Cn||r&&r[s]||a&&s in a||i&&s in i)){var u=Tn(t,s);try{_n(e,s,u)}catch{}}}}return e}function pe(e){return typeof e=="function"}function wt(e){return typeof e=="object"&&"styledComponentId"in e}function ee(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function qe(e,t){if(e.length===0)return"";for(var r=e[0],n=1;n<e.length;n++)r+=t?t+e[n]:e[n];return r}function de(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ft(e,t,r){if(r===void 0&&(r=!1),!r&&!de(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var n=0;n<t.length;n++)e[n]=ft(e[n],t[n]);else if(de(t))for(var n in t)e[n]=ft(e[n],t[n]);return e}function vt(e,t){Object.defineProperty(e,"toString",{value:t})}var Rn=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
7
-
8
- `,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
9
-
10
- - Are you trying to reuse it across renders?
11
- - Are you accidentally calling collectStyles twice?
12
-
13
- `,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
14
-
15
- `,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
16
-
17
- - Does this error occur on the client and is your target falsy?
18
- - Does this error occur on the server and is the sheet falsy?
19
-
20
- `,5:`The clone method cannot be used on the client!
21
-
22
- - Are you running in a client-like environment on the server?
23
- - Are you trying to run SSR on the client?
24
-
25
- `,6:`Trying to insert a new style tag, but the given Node is unmounted!
26
-
27
- - Are you using a custom target that isn't mounted?
28
- - Does your document not have a valid head element?
29
- - Have you accidentally removed a style tag manually?
30
-
31
- `,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
32
-
33
- `,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
34
-
35
- `,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
36
-
37
- `,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
38
-
39
- `,14:`ThemeProvider: "theme" prop is required.
40
-
41
- `,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
42
- You may only create up to 1,073,741,824 components. If you're creating components dynamically,
43
- as for instance in your render method then you may be running into this limitation.
44
-
45
- `,17:`CSSStyleSheet could not be found on HTMLStyleElement.
46
- Has styled-components' style tag been unmounted or altered by another script?
47
- `,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function An(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e[0],n=[],o=1,i=e.length;o<i;o+=1)n.push(e[o]);return n.forEach(function(a){r=r.replace(/%[a-z]/,a)}),r}function $(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(An.apply(void 0,K([Rn[e]],t,!1)).trim())}var Nn=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var r=0,n=0;n<t;n++)r+=this.groupSizes[n];return r},e.prototype.insertRules=function(t,r){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw $(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var a=o;a<i;a++)this.groupSizes[a]=0}for(var c=this.indexOfGroup(t+1),s=(a=0,r.length);a<s;a++)this.tag.insertRule(c,r[a])&&(this.groupSizes[t]++,c++)},e.prototype.clearGroup=function(t){if(t<this.length){var r=this.groupSizes[t],n=this.indexOfGroup(t),o=n+r;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(t){var r="";if(t>=this.length||this.groupSizes[t]===0)return r;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,a=o;a<i;a++)r+="".concat(this.tag.getRule(a)).concat(bt);return r},e}(),In=1<<30,He=new Map,Ke=new Map,Ge=1,Ue=function(e){if(He.has(e))return He.get(e);for(;Ke.has(Ge);)Ge++;var t=Ge++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>In))throw $(16,"".concat(t));return He.set(e,t),Ke.set(t,e),t},zn=function(e,t){Ge=t+1,He.set(e,t),Ke.set(t,e)},Dn="style[".concat(B,"][").concat(We,'="').concat(ce,'"]'),Mn=new RegExp("^".concat(B,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),jn=function(e,t,r){for(var n,o=r.split(","),i=0,a=o.length;i<a;i++)(n=o[i])&&e.registerName(t,n)},$n=function(e,t){for(var r,n=((r=t.textContent)!==null&&r!==void 0?r:"").split(bt),o=[],i=0,a=n.length;i<a;i++){var c=n[i].trim();if(c){var s=c.match(Mn);if(s){var u=0|parseInt(s[1],10),h=s[2];u!==0&&(zn(h,u),jn(e,h,s[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(c)}}},ir=function(e){for(var t=document.querySelectorAll(Dn),r=0,n=t.length;r<n;r++){var o=t[r];o&&o.getAttribute(B)!==fr&&($n(e,o),o.parentNode&&o.parentNode.removeChild(o))}};function ht(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var xr=function(e){var t=document.head,r=e||t,n=document.createElement("style"),o=function(c){var s=Array.from(c.querySelectorAll("style[".concat(B,"]")));return s[s.length-1]}(r),i=o!==void 0?o.nextSibling:null;n.setAttribute(B,fr),n.setAttribute(We,ce);var a=ht();return a&&n.setAttribute("nonce",a),r.insertBefore(n,i),n},Fn=function(){function e(t){this.element=xr(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(r){if(r.sheet)return r.sheet;for(var n=document.styleSheets,o=0,i=n.length;o<i;o++){var a=n[o];if(a.ownerNode===r)return a}throw $(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,r){try{return this.sheet.insertRule(r,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var r=this.sheet.cssRules[t];return r&&r.cssText?r.cssText:""},e}(),Ln=function(){function e(t){this.element=xr(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,r){if(t<=this.length&&t>=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),Vn=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,r){return t<=this.length&&(this.rules.splice(t,0,r),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),ar=Ce,Bn={isServer:!Ce,useCSSOMInjection:!mn},Ee=function(){function e(t,r,n){t===void 0&&(t=le),r===void 0&&(r={});var o=this;this.options=N(N({},Bn),t),this.gs=r,this.names=new Map(n),this.server=!!t.isServer,!this.server&&Ce&&ar&&(ar=!1,ir(this)),vt(this,function(){return function(i){for(var a=i.getTag(),c=a.length,s="",u=function(l){var g=function(R){return Ke.get(R)}(l);if(g===void 0)return"continue";var m=i.names.get(g),x=a.getGroup(l);if(m===void 0||!m.size||x.length===0)return"continue";var d="".concat(B,".g").concat(l,'[id="').concat(g,'"]'),O="";m!==void 0&&m.forEach(function(R){R.length>0&&(O+="".concat(R,","))}),s+="".concat(x).concat(d,'{content:"').concat(O,'"}').concat(bt)},h=0;h<c;h++)u(h);return s}(o)})}return e.registerId=function(t){return Ue(t)},e.prototype.rehydrate=function(){!this.server&&Ce&&ir(this)},e.prototype.reconstructWithOptions=function(t,r){return r===void 0&&(r=!0),new e(N(N({},this.options),t),this.gs,r&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(r){var n=r.useCSSOMInjection,o=r.target;return r.isServer?new Vn(o):n?new Fn(o):new Ln(o)}(this.options),new Nn(t)));var t},e.prototype.hasNameForId=function(t,r){return this.names.has(t)&&this.names.get(t).has(r)},e.prototype.registerName=function(t,r){if(Ue(t),this.names.has(t))this.names.get(t).add(r);else{var n=new Set;n.add(r),this.names.set(t,n)}},e.prototype.insertRules=function(t,r,n){this.registerName(t,r),this.getTag().insertRules(Ue(t),n)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Ue(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Un=/&/g,Yn=/^\s*\/\/.*$/gm;function Sr(e,t){return e.map(function(r){return r.type==="rule"&&(r.value="".concat(t," ").concat(r.value),r.value=r.value.replaceAll(",",",".concat(t," ")),r.props=r.props.map(function(n){return"".concat(t," ").concat(n)})),Array.isArray(r.children)&&r.type!=="@keyframes"&&(r.children=Sr(r.children,t)),r})}function kr(e){var t,r,n,o=e===void 0?le:e,i=o.options,a=i===void 0?le:i,c=o.plugins,s=c===void 0?Xe:c,u=function(g,m,x){return x.startsWith(r)&&x.endsWith(r)&&x.replaceAll(r,"").length>0?".".concat(t):g},h=s.slice();h.push(function(g){g.type===H&&g.value.includes("&")&&(g.props[0]=g.props[0].replace(Un,r).replace(n,u))}),a.prefix&&h.push(Zt),h.push(qt);var l=function(g,m,x,d){m===void 0&&(m=""),x===void 0&&(x=""),d===void 0&&(d="&"),t=d,r=m,n=new RegExp("\\".concat(r,"\\b"),"g");var O=g.replace(Yn,""),R=Wt(x||m?"".concat(x," ").concat(m," { ").concat(O," }"):O);a.namespace&&(R=Sr(R,a.namespace));var _=[];return se(R,Kt(h.concat(Xt(function(C){return _.push(C)})))),_};return l.hash=s.length?s.reduce(function(g,m){return m.name||$(15),Q(g,m.name)},hr).toString():"",l}var Hn=new Ee,mt=kr(),xt=k.default.createContext({shouldForwardProp:void 0,styleSheet:Hn,stylis:mt}),_i=xt.Consumer,Gn=k.default.createContext(void 0);function gt(){return(0,k.useContext)(xt)}function Wn(e){var t=(0,k.useState)(e.stylisPlugins),r=t[0],n=t[1],o=gt().styleSheet,i=(0,k.useMemo)(function(){var s=o;return e.sheet?s=e.sheet:e.target&&(s=s.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(s=s.reconstructWithOptions({useCSSOMInjection:!1})),s},[e.disableCSSOMInjection,e.sheet,e.target,o]),a=(0,k.useMemo)(function(){return kr({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:r})},[e.enableVendorPrefixes,e.namespace,r]);(0,k.useEffect)(function(){(0,ur.default)(r,e.stylisPlugins)||n(e.stylisPlugins)},[e.stylisPlugins]);var c=(0,k.useMemo)(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:i,stylis:a}},[e.shouldForwardProp,i,a]);return k.default.createElement(xt.Provider,{value:c},k.default.createElement(Gn.Provider,{value:a},e.children))}var sr=function(){function e(t,r){var n=this;this.inject=function(o,i){i===void 0&&(i=mt);var a=n.name+i.hash;o.hasNameForId(n.id,a)||o.insertRules(n.id,a,i(n.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=r,vt(this,function(){throw $(12,String(n.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=mt),this.name+t.hash},e}(),qn=function(e){return e>="A"&&e<="Z"};function cr(e){for(var t="",r=0;r<e.length;r++){var n=e[r];if(r===1&&n==="-"&&e[0]==="-")return e;qn(n)?t+="-"+n.toLowerCase():t+=n}return t.startsWith("ms-")?"-"+t:t}var Cr=function(e){return e==null||e===!1||e===""},Er=function(e){var t,r,n=[];for(var o in e){var i=e[o];e.hasOwnProperty(o)&&!Cr(i)&&(Array.isArray(i)&&i.isCss||pe(i)?n.push("".concat(cr(o),":"),i,";"):de(i)?n.push.apply(n,K(K(["".concat(o," {")],Er(i),!1),["}"],!1)):n.push("".concat(cr(o),": ").concat((t=o,(r=i)==null||typeof r=="boolean"||r===""?"":typeof r!="number"||r===0||t in Jt||t.startsWith("--")?String(r).trim():"".concat(r,"px")),";")))}return n};function W(e,t,r,n){if(Cr(e))return[];if(wt(e))return[".".concat(e.styledComponentId)];if(pe(e)){if(!pe(i=e)||i.prototype&&i.prototype.isReactComponent||!t)return[e];var o=e(t);return process.env.NODE_ENV==="production"||typeof o!="object"||Array.isArray(o)||o instanceof sr||de(o)||o===null||console.error("".concat(gr(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),W(o,t,r,n)}var i;return e instanceof sr?r?(e.inject(r,n),[e.getName(n)]):[e]:de(e)?Er(e):Array.isArray(e)?Array.prototype.concat.apply(Xe,e.map(function(a){return W(a,t,r,n)})):[e.toString()]}function _r(e){for(var t=0;t<e.length;t+=1){var r=e[t];if(pe(r)&&!wt(r))return!1}return!0}var Kn=mr(ce),Xn=function(){function e(t,r,n){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(n===void 0||n.isStatic)&&_r(t),this.componentId=r,this.baseHash=Q(Kn,r),this.baseStyle=n,Ee.registerId(r)}return e.prototype.generateAndInjectStyles=function(t,r,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,r,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&r.hasNameForId(this.componentId,this.staticRulesId))o=ee(o,this.staticRulesId);else{var i=qe(W(this.rules,t,r,n)),a=ut(Q(this.baseHash,i)>>>0);if(!r.hasNameForId(this.componentId,a)){var c=n(i,".".concat(a),void 0,this.componentId);r.insertRules(this.componentId,a,c)}o=ee(o,a),this.staticRulesId=a}else{for(var s=Q(this.baseHash,n.hash),u="",h=0;h<this.rules.length;h++){var l=this.rules[h];if(typeof l=="string")u+=l,process.env.NODE_ENV!=="production"&&(s=Q(s,l));else if(l){var g=qe(W(l,t,r,n));s=Q(s,g+h),u+=g}}if(u){var m=ut(s>>>0);r.hasNameForId(this.componentId,m)||r.insertRules(this.componentId,m,n(u,".".concat(m),void 0,this.componentId)),o=ee(o,m)}}return o},e}(),Pr=k.default.createContext(void 0),Pi=Pr.Consumer;var pt={},lr=new Set;function Zn(e,t,r){var n=wt(e),o=e,i=!lt(e),a=t.attrs,c=a===void 0?Xe:a,s=t.componentId,u=s===void 0?function(E,P){var b=typeof E!="string"?"sc":er(E);pt[b]=(pt[b]||0)+1;var y="".concat(b,"-").concat(xn(ce+b+pt[b]));return P?"".concat(P,"-").concat(y):y}(t.displayName,t.parentComponentId):s,h=t.displayName,l=h===void 0?function(E){return lt(E)?"styled.".concat(E):"Styled(".concat(gr(E),")")}(e):h,g=t.displayName&&t.componentId?"".concat(er(t.displayName),"-").concat(t.componentId):t.componentId||u,m=n&&o.attrs?o.attrs.concat(c).filter(Boolean):c,x=t.shouldForwardProp;if(n&&o.shouldForwardProp){var d=o.shouldForwardProp;if(t.shouldForwardProp){var O=t.shouldForwardProp;x=function(E,P){return d(E,P)&&O(E,P)}}else x=d}var R=new Xn(r,g,n?o.componentStyle:void 0);function _(E,P){return function(b,y,U){var te=b.attrs,Zr=b.componentStyle,Jr=b.defaultProps,Qr=b.foldedComponentIds,kt=b.styledComponentId,en=b.target,tn=k.default.useContext(Pr),rn=gt(),Je=b.shouldForwardProp||rn.shouldForwardProp;process.env.NODE_ENV!=="production"&&(0,k.useDebugValue)(kt);var Ct=yn(y,tn,Jr)||le,L=function(Te,we,Oe){for(var re,q=N(N({},we),{className:void 0,theme:Oe}),tt=0;tt<Te.length;tt+=1){var Re=pe(re=Te[tt])?re(q):re;for(var Y in Re)q[Y]=Y==="className"?ee(q[Y],Re[Y]):Y==="style"?N(N({},q[Y]),Re[Y]):Re[Y]}return we.className&&(q.className=ee(q.className,we.className)),q}(te,y,Ct),ye=L.as||en,be={};for(var z in L)L[z]===void 0||z[0]==="$"||z==="as"||z==="theme"&&L.theme===Ct||(z==="forwardedAs"?be.as=L.forwardedAs:Je&&!Je(z,ye)||(be[z]=L[z],Je||process.env.NODE_ENV!=="development"||Ot(z)||lr.has(z)||!dt.has(ye)||(lr.add(z),console.warn('styled-components: it looks like an unknown prop "'.concat(z,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var Qe=function(Te,we){var Oe=gt(),re=Te.generateAndInjectStyles(we,Oe.styleSheet,Oe.stylis);return process.env.NODE_ENV!=="production"&&(0,k.useDebugValue)(re),re}(Zr,L);process.env.NODE_ENV!=="production"&&b.warnTooManyClasses&&b.warnTooManyClasses(Qe);var et=ee(Qr,kt);return Qe&&(et+=" "+Qe),L.className&&(et+=" "+L.className),be[lt(ye)&&!dt.has(ye)?"class":"className"]=et,U&&(be.ref=U),(0,k.createElement)(ye,be)}(C,E,P)}_.displayName=l;var C=k.default.forwardRef(_);return C.attrs=m,C.componentStyle=R,C.displayName=l,C.shouldForwardProp=x,C.foldedComponentIds=n?ee(o.foldedComponentIds,o.styledComponentId):"",C.styledComponentId=g,C.target=n?o.target:e,Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(E){this._foldedDefaultProps=n?function(P){for(var b=[],y=1;y<arguments.length;y++)b[y-1]=arguments[y];for(var U=0,te=b;U<te.length;U++)ft(P,te[U],!0);return P}({},o.defaultProps,E):E}}),process.env.NODE_ENV!=="production"&&(gn(l,g),C.warnTooManyClasses=function(E,P){var b={},y=!1;return function(U){if(!y&&(b[U]=!0,Object.keys(b).length>=200)){var te=P?' with the id of "'.concat(P,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(E).concat(te,`.
48
- `)+`Consider using the attrs method, together with a style object for frequently changed styles.
49
- Example:
50
- const Component = styled.div.attrs(props => ({
51
- style: {
52
- background: props.background,
53
- },
54
- }))\`width: 100%;\`
55
-
56
- <Component />`),y=!0,b={}}}}(l,g)),vt(C,function(){return".".concat(C.styledComponentId)}),i&&vr(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),C}function pr(e,t){for(var r=[e[0]],n=0,o=t.length;n<o;n+=1)r.push(t[n],e[n+1]);return r}var dr=function(e){return Object.assign(e,{isCss:!0})};function ue(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(pe(e)||de(e))return dr(W(pr(Xe,K([e],t,!0))));var n=e;return t.length===0&&n.length===1&&typeof n[0]=="string"?W(n):dr(W(pr(n,t)))}function yt(e,t,r){if(r===void 0&&(r=le),!t)throw $(1,t);var n=function(o){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return e(t,r,ue.apply(void 0,K([o],i,!1)))};return n.attrs=function(o){return yt(e,t,N(N({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},n.withConfig=function(o){return yt(e,t,N(N({},r),o))},n}var Tr=function(e){return yt(Zn,e)},p=Tr;dt.forEach(function(e){p[e]=Tr(e)});var Ti=function(){function e(t,r){this.rules=t,this.componentId=r,this.isStatic=_r(t),Ee.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,r,n,o){var i=o(qe(W(this.rules,r,n,o)),""),a=this.componentId+t;n.insertRules(a,a,i)},e.prototype.removeStyles=function(t,r){r.clearRules(this.componentId+t)},e.prototype.renderStyles=function(t,r,n,o){t>2&&Ee.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,r,n,o)},e}();var Jn=/^\s*<\/[a-z]/i,Oi=function(){function e(){var t=this;this._emitSheetCSS=function(){var r=t.instance.toString();if(!r)return"";var n=ht(),o=qe([n&&'nonce="'.concat(n,'"'),"".concat(B,'="true"'),"".concat(We,'="').concat(ce,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(r,"</style>")},this.getStyleTags=function(){if(t.sealed)throw $(2);return t._emitSheetCSS()},this.getStyleElement=function(){var r;if(t.sealed)throw $(2);var n=t.instance.toString();if(!n)return[];var o=((r={})[B]="",r[We]=ce,r.dangerouslySetInnerHTML={__html:n},r),i=ht();return i&&(o.nonce=i),[k.default.createElement("style",N({},o,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new Ee({isServer:!0}),this.sealed=!1}return e.prototype.collectStyles=function(t){if(this.sealed)throw $(2);return k.default.createElement(Wn,{sheet:this.instance},t)},e.prototype.interleaveWithNodeStream=function(t){if(Ce)throw $(3);if(this.sealed)throw $(2);this.seal();var r=require("stream").Transform,n=t,o=this.instance,i=this._emitSheetCSS,a=new r({transform:function(c,s,u){var h=c.toString(),l=i();if(o.clearTag(),Jn.test(h)){var g=h.indexOf(">")+1,m=h.slice(0,g),x=h.slice(g);this.push(m+l+x)}else this.push(l+h);u()}});return n.on("error",function(c){a.emit("error",c)}),n.pipe(a)},e}();process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
57
- Perhaps you're looking to import 'styled-components/native'?
58
- Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Ye="__sc-".concat(B,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Ye]||(window[Ye]=0),window[Ye]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
59
-
60
- See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{color:"#1e73be",textColor:"#ffffff",border:"none"},success:{color:"#28a97d",textColor:"#ffffff",border:"none"},danger:{color:"#e53e3e",textColor:"#ffffff",border:"none"},destructive:{color:"#dc2626",textColor:"#ffffff",border:"none"},ghost:{color:"transparent",textColor:"#374151",border:"1px solid #d1d5db"},outline:{color:"transparent",textColor:"#1e73be",border:"1px solid #1e73be"},secondary:{color:"#6b7280",textColor:"#ffffff",border:"none"}},Qn=p.button.attrs(e=>({type:e.type||"button"}))`
61
- padding: ${e=>e.size==="large"?"12px 20px":e.size==="small"?"6px 12px":"10px 16px"};
1
+ "use strict";var bt=Object.create;var P=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var xt=(t,e)=>{for(var o in e)P(t,o,{get:e[o],enumerable:!0})},N=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ht(e))!wt.call(t,a)&&a!==o&&P(t,a,{get:()=>e[a],enumerable:!(i=mt(e,a))||i.enumerable});return t};var l=(t,e,o)=>(o=t!=null?bt(gt(t)):{},N(e||!t||!t.__esModule?P(o,"default",{value:t,enumerable:!0}):o,t)),yt=t=>N(P({},"__esModule",{value:!0}),t);var le={};xt(le,{MahatiButton:()=>L,MahatiCard:()=>V,MahatiDropdown:()=>U,MahatiFormContainer:()=>j,MahatiInput:()=>H,MahatiKeyValueDisplay:()=>K,MahatiLabel:()=>_,MahatiMain:()=>X,MahatiParagraph:()=>at,MahatiRow:()=>it,MahatiSection:()=>ot,MahatiSpinner:()=>tt,MahatiTabbedInterface:()=>G,MahatiTable:()=>J,MahatiTooltip:()=>D,isValidPassword:()=>pt,isValidUsername:()=>ct,maxLength:()=>lt,minLength:()=>dt,required:()=>st});module.exports=yt(le);var A=require("react");var M=require("react/jsx-runtime"),vt=({text:t,position:e,children:o})=>{let[i,a]=(0,A.useState)(!1);return(0,M.jsxs)("div",{className:"tooltipContainer",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[o,i&&(0,M.jsx)("div",{className:`tooltip ${i?"tooltipVisible":""}`,children:t})]})},D=vt;var b=l(require("styled-components")),F={primary:{color:"#1e73be",textColor:"#ffffff"},success:{color:"#28a97d",textColor:"#ffffff"},danger:{color:"#e53e3e",textColor:"#ffffff"}},kt=b.default.button.attrs(t=>({type:t.type||"button"}))`
2
+ padding: ${t=>t.size==="large"?"12px 20px":t.size==="small"?"6px 12px":"10px 16px"};
62
3
  margin-top: 10px;
63
- color: ${e=>e.textColor||"#ffffff"};
64
- border-radius: ${e=>typeof e.radius=="number"?`${e.radius}px`:e.radius||"6px"};
4
+ color: ${t=>t.textColor||"#ffffff"};
5
+ border: none;
6
+ border-radius: ${t=>typeof t.radius=="number"?`${t.radius}px`:t.radius||"6px"};
65
7
  cursor: pointer;
66
8
 
67
9
  display: inline-flex;
68
10
  align-items: center;
69
11
  justify-content: center;
70
- gap: 8px;
12
+ gap: 8px; /* 👈 space between icon & text */
71
13
 
72
14
  font-weight: 600;
73
15
  font-size: 14px;
74
-
75
- transition: all 0.2s ease-in-out;
76
16
 
77
17
  /* --- VARIANT STYLES --- */
78
- ${({variant:e,color:t,textColor:r,danger:n})=>{let o=n?"danger":e;if(t)return ue`
79
- background-color: ${t};
80
- color: ${r||"#ffffff"};
81
- border: none;
82
- `;if(o&&Or[o]){let i=Or[o];return ue`
83
- background-color: ${i.color};
84
- color: ${i.textColor};
85
- border: ${i.border};
86
- `}return ue`
18
+ ${({variant:t,color:e,danger:o})=>{let i=o?"danger":t;return e?b.css`
19
+ background-color: ${e};
20
+ `:i&&F[i]?b.css`
21
+ background-color: ${F[i].color};
22
+ color: ${F[i].textColor};
23
+ `:b.css`
87
24
  background-color: #55b382;
88
- border: none;
89
25
  `}}
90
26
 
91
- /* Hover effects */
92
- &:hover:not(:disabled) {
93
- opacity: 0.9;
94
- transform: translateY(-1px);
95
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
96
- }
97
-
98
- &:active:not(:disabled) {
99
- transform: translateY(0);
100
- }
101
-
102
27
  &:disabled {
103
28
  background-color: #ccc;
104
29
  cursor: not-allowed;
105
- opacity: 0.6;
106
30
  }
107
31
 
108
- ${({isLoading:e})=>e&&ue`
32
+ ${({isLoading:t})=>t&&b.css`
109
33
  pointer-events: none;
110
34
  opacity: 0.8;
111
35
  `}
112
- `,Rr=Qn;var fe=require("react/jsx-runtime"),eo=p.div`
36
+ `,L=kt;var k=l(require("styled-components")),g=require("react/jsx-runtime"),Ct=k.default.div`
113
37
  background: #fff;
114
38
  border-radius: 8px;
115
39
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
116
40
  margin-top: 20px;
117
41
  display: flex;
118
42
  flex-direction: column;
119
- `,to=p.div`
43
+ `,zt=k.default.div`
120
44
  padding: 16px 20px;
121
45
  border-bottom: 1px solid #e2e8f0;
122
46
  font-size: 1.25rem;
123
47
  font-weight: 600;
124
- `,ro=p.div`
48
+ `,St=k.default.div`
125
49
  padding: 20px;
126
50
  flex: 1; /* Allows the body to grow */
127
- `,no=p.div`
51
+ `,Rt=k.default.div`
128
52
  padding: 16px 20px;
129
53
  border-top: 1px solid #e2e8f0;
130
54
  background: #f7fafc;
131
- `,oo=({header:e,footer:t,children:r})=>(0,fe.jsxs)(eo,{children:[e&&(0,fe.jsx)(to,{children:e}),(0,fe.jsx)(ro,{children:r}),t&&(0,fe.jsx)(no,{children:t})]}),Ar=oo;var St=require("react");var he=require("react/jsx-runtime"),io=p.div`
55
+ `,Tt=({header:t,footer:e,children:o})=>(0,g.jsxs)(Ct,{children:[t&&(0,g.jsx)(zt,{children:t}),(0,g.jsx)(St,{children:o}),e&&(0,g.jsx)(Rt,{children:e})]}),V=Tt;var B=require("react"),C=l(require("styled-components")),w=require("react/jsx-runtime"),Pt=C.default.div`
132
56
  position: relative;
133
57
  display: inline-block;
134
58
  width: 200px;
135
59
  margin: 10px 0;
136
- `,ao=p.button`
60
+ `,Mt=C.default.button`
137
61
  width: 100%;
138
62
  padding: 10px;
139
63
  background-color: #007bff;
@@ -146,15 +70,15 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
146
70
  &:hover {
147
71
  background-color: #0056b3;
148
72
  }
149
- `,so=p.div`
150
- display: ${({open:e})=>e?"block":"none"};
73
+ `,Et=C.default.div`
74
+ display: ${({open:t})=>t?"block":"none"};
151
75
  position: absolute;
152
76
  background-color: white;
153
77
  min-width: 100%;
154
78
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
155
79
  z-index: 1;
156
80
  border-radius: 4px;
157
- `,co=p.div`
81
+ `,It=C.default.div`
158
82
  padding: 10px;
159
83
  cursor: pointer;
160
84
  color: #333;
@@ -162,7 +86,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
162
86
  &:hover {
163
87
  background-color: #f1f1f1;
164
88
  }
165
- `,lo=({options:e,onSelect:t})=>{let[r,n]=(0,St.useState)(!1),[o,i]=(0,St.useState)(null),a=c=>{i(c),t(c),n(!1)};return(0,he.jsxs)(io,{children:[(0,he.jsx)(ao,{onClick:()=>n(!r),children:o||"Select an option"}),(0,he.jsx)(so,{open:r,children:e.map((c,s)=>(0,he.jsx)(co,{onClick:()=>a(c),children:c},s))})]})},Nr=lo;var po=p.form`
89
+ `,$t=({options:t,onSelect:e})=>{let[o,i]=(0,B.useState)(!1),[a,v]=(0,B.useState)(null),f=u=>{v(u),e(u),i(!1)};return(0,w.jsxs)(Pt,{children:[(0,w.jsx)(Mt,{onClick:()=>i(!o),children:a||"Select an option"}),(0,w.jsx)(Et,{open:o,children:t.map((u,m)=>(0,w.jsx)(It,{onClick:()=>f(u),children:u},m))})]})},U=$t;var O=l(require("styled-components")),Ft=O.default.form`
166
90
  display: flex;
167
91
  flex-direction: column;
168
92
  align-items: center;
@@ -175,28 +99,28 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
175
99
  background-color: white;
176
100
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: Add a shadow for design */
177
101
  border-radius: 8px;
178
- `,Ir=po;var _e=require("react/jsx-runtime"),uo=p.div`
102
+ `,j=Ft;var E=l(require("styled-components")),z=require("react/jsx-runtime"),Bt=E.default.div`
179
103
  margin-bottom: 1rem;
180
- `,fo=p.input`
104
+ `,Nt=E.default.input`
181
105
  width: 300px; /* Set a fixed width to prevent expansion */
182
106
  max-width: 100%; /* Optional: Ensure it doesn't exceed the container width */
183
107
  padding: 0.75rem;
184
108
  border: 1px solid black;
185
109
  border-radius: 4px;
186
- background-color: ${e=>e.hasError?"#fff5f5":"#fff"};
110
+ background-color: ${t=>t.hasError?"#fff5f5":"#fff"};
187
111
  font-size: 1rem;
188
112
  transition: all 0.2s ease-in-out;
189
113
 
190
114
  &:focus {
191
115
  outline: none;
192
- border-color: ${e=>e.hasError?"red":"#0070f3"};
116
+ border-color: ${t=>t.hasError?"red":"#0070f3"};
193
117
  }
194
- `,ho=p.span`
118
+ `,At=E.default.span`
195
119
  color: red;
196
120
  font-size: 0.875rem;
197
121
  height: 0.8rem; /* Fixed height for error text to avoid layout shift */
198
122
  display: block;
199
- `,mo=({type:e="text",name:t,placeholder:r,onChange:n,hasError:o=!1,errorMessage:i="",value:a})=>(0,_e.jsxs)(uo,{children:[(0,_e.jsx)(fo,{type:e,name:t,placeholder:r,value:a,onChange:n,hasError:o}),(0,_e.jsx)(ho,{children:i})]}),zr=mo;var me=require("react/jsx-runtime"),go=p.div`
123
+ `,Dt=({type:t="text",name:e,placeholder:o,onChange:i,hasError:a=!1,errorMessage:v="",value:f})=>(0,z.jsxs)(Bt,{children:[(0,z.jsx)(Nt,{type:t,name:e,placeholder:o,value:f,onChange:i,hasError:a}),(0,z.jsx)(At,{children:v})]}),H=Dt;var S=l(require("styled-components")),x=require("react/jsx-runtime"),Lt=S.default.div`
200
124
  display: flex;
201
125
  flex-direction: column;
202
126
  gap: 0.75rem;
@@ -206,7 +130,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
206
130
  @media (max-width: 600px) {
207
131
  padding: 0rem;
208
132
  }
209
- `,yo=p.div`
133
+ `,Vt=S.default.div`
210
134
  display: flex;
211
135
  align-items: center;
212
136
  justify-content: space-between;
@@ -221,7 +145,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
221
145
  &:hover {
222
146
  background-color: #55b382;
223
147
  }
224
- `,bo=p.div`
148
+ `,Ut=S.default.div`
225
149
  font-weight: 600;
226
150
  font-size: 0.95rem;
227
151
  color: #333;
@@ -231,20 +155,20 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
231
155
  @media (max-width: 600px) {
232
156
  font-size: 0.85rem;
233
157
  }
234
- `,wo=p.div`
158
+ `,Ot=S.default.div`
235
159
  font-size: 1.2rem;
236
160
  color: #555;
237
161
  text-align: left;
238
162
  word-wrap: break-word;
239
- font-weight: ${e=>e.isBold?"bold":"normal"};
163
+ font-weight: ${t=>t.isBold?"bold":"normal"};
240
164
  @media (max-width: 600px) {
241
165
  font-size: 0.85rem;
242
166
  }
243
- `,vo=({data:e})=>(0,me.jsx)(go,{children:Object.entries(e).map(([t,r])=>(0,me.jsxs)(yo,{children:[(0,me.jsx)(bo,{children:t}),(0,me.jsx)(wo,{isBold:t==="SegmentName",children:r||"N/A"})]},t))}),Dr=vo;var xo=p.label`
167
+ `,jt=({data:t})=>(0,x.jsx)(Lt,{children:Object.entries(t).map(([e,o])=>(0,x.jsxs)(Vt,{children:[(0,x.jsx)(Ut,{children:e}),(0,x.jsx)(Ot,{isBold:e==="SegmentName",children:o||"N/A"})]},e))}),K=jt;var Y=l(require("styled-components")),Ht=Y.default.label`
244
168
  display: block;
245
169
  margin-bottom: 5px;
246
170
  font-weight: bold;
247
- `,Mr=xo;var So=p.main`
171
+ `,_=Ht;var q=l(require("styled-components")),Kt=q.default.main`
248
172
  display: flex;
249
173
  flex-direction: column;
250
174
  align-items: center;
@@ -252,7 +176,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Ye]+=1);var Or={primary:{colo
252
176
  min-height: 100vh;
253
177
  padding: 20px;
254
178
  background-color: #f9f9f9;
255
- `,jr=So;var Ze=rt(require("react"));var v=require("react/jsx-runtime"),ko=p.div`margin-top: 10px;`,Co=p.table`width: 100%; border-collapse: collapse;`,$r=p.th`padding: 12px; `,Eo=p.tr`&:nth-child(even) { background-color: #f9f9f9; } &:hover { background-color: #f1f1f1; }`,Fr=p.td`padding: 10px; border-bottom: 1px solid #ccc;`,_o=p.td`text-align: center; padding: 20px; color: #999;`,Po=p.div`margin-top: 15px; display: flex; flex-direction: column; align-items: center;`,To=p.div`display: flex; gap: 6px; align-items: center; flex-wrap: wrap;`,Pe=p.button`
179
+ `,X=Kt;var I=l(require("react")),d=l(require("styled-components")),r=require("react/jsx-runtime"),Yt=d.default.div`margin-top: 10px;`,_t=d.default.table`width: 100%; border-collapse: collapse;`,W=d.default.th`padding: 12px; `,qt=d.default.tr`&:nth-child(even) { background-color: #f9f9f9; } &:hover { background-color: #f1f1f1; }`,Z=d.default.td`padding: 10px; border-bottom: 1px solid #ccc;`,Xt=d.default.td`text-align: center; padding: 20px; color: #999;`,Wt=d.default.div`margin-top: 15px; display: flex; flex-direction: column; align-items: center;`,Zt=d.default.div`display: flex; gap: 6px; align-items: center; flex-wrap: wrap;`,R=d.default.button`
256
180
  padding: 6px 12px;
257
181
  background: linear-gradient(to right, #1e73be, #28a97d);
258
182
  color: white;
@@ -264,34 +188,34 @@ background: linear-gradient(to right, #1e73be, #28a97d);
264
188
  background: #ccc;
265
189
  cursor: not-allowed;
266
190
  }
267
- `,Oo=p.select`
191
+ `,Jt=d.default.select`
268
192
  margin-left: 10px;
269
193
  padding: 6px;
270
194
  border-radius: 4px;
271
195
  border: 1px solid #aaa;
272
- `,Ro=p.div`margin-top: 8px; font-size: 13px;`,Ao=({headers:e,data:t,page:r=0,setPage:n,limit:o=0,setLimit:i,totalCount:a=0,highlightRowColor:c,actions:s})=>{let u=Math.ceil(a/o)||0,h=()=>{let l=[];if(u<=1)return null;l.push((0,v.jsx)(Pe,{onClick:()=>n?.(1),disabled:r===1,children:"1"},1)),r>3&&l.push((0,v.jsx)("span",{children:"..."},"start-ellipsis"));for(let m=Math.max(2,r-1);m<=Math.min(u-1,r+1);m++)l.push((0,v.jsx)(Pe,{onClick:()=>n?.(m),disabled:r===m,children:m},m));return r<u-1-1&&l.push((0,v.jsx)("span",{children:"..."},"end-ellipsis")),u>1&&l.push((0,v.jsx)(Pe,{onClick:()=>n?.(1),disabled:r===1,children:u+1},1)),l};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(ko,{children:(0,v.jsxs)(Co,{children:[(0,v.jsx)("thead",{children:(0,v.jsxs)("tr",{style:{background:"linear-gradient(to right, #1e73be, #28a97d)"},children:[e.map((l,g)=>(0,v.jsx)($r,{children:l.label},g)),s&&(0,v.jsx)($r,{children:"Actions"})]})}),(0,v.jsx)("tbody",{children:t.length>0?t.map((l,g)=>(0,v.jsxs)(Eo,{className:c,children:[e.map((m,x)=>(0,v.jsx)(Fr,{children:(()=>{let d=l[m.key];if(Ze.default.isValidElement(d))return d;if(typeof d=="function")try{let O=d();if(Ze.default.isValidElement(O))return O}catch(O){console.warn("Error executing function in table cell:",O)}return typeof d=="string"&&d.trim().startsWith("<")&&d.trim().endsWith(">")?(0,v.jsx)("div",{dangerouslySetInnerHTML:{__html:d}}):Array.isArray(d)?d.some(O=>Ze.default.isValidElement(O))?(0,v.jsx)(v.Fragment,{children:d}):d.join(", "):d instanceof Date?d.toLocaleString():typeof d=="boolean"?d?"Yes":"No":d==null?"-":typeof d=="number"?d.toString():typeof d=="object"?JSON.stringify(d):String(d)})()},x)),s&&(0,v.jsx)(Fr,{children:s(l)})]},g)):(0,v.jsx)("tr",{children:(0,v.jsx)(_o,{colSpan:e.length+(s?1:0),children:"No data available"})})})]})}),(u>1||a<=o)&&(0,v.jsxs)(Po,{children:[(0,v.jsxs)(To,{children:[(0,v.jsx)(Pe,{onClick:()=>n?.(r-1),disabled:r===1,children:"Previous"}),h(),(0,v.jsx)(Pe,{onClick:()=>n?.(r+1),disabled:r===u,children:"Next"}),(0,v.jsx)(Oo,{value:o,onChange:l=>{n?.(1),i?.(Number(l.target.value))},children:[5,10,15].map(l=>(0,v.jsxs)("option",{value:l,children:[l," per page"]},l))})]}),(0,v.jsxs)(Ro,{children:["Page ",r+1," of ",u+1," (Total: ",a," items)"]})]})]})},Lr=Ao;var ge=require("react/jsx-runtime"),No=p.div`
196
+ `,Gt=d.default.div`margin-top: 8px; font-size: 13px;`,Qt=({headers:t,data:e,page:o=0,setPage:i,limit:a=0,setLimit:v,totalCount:f=0,highlightRowColor:u,actions:m})=>{let c=Math.ceil(f/a)||0,ft=()=>{let s=[];if(c<=1)return null;s.push((0,r.jsx)(R,{onClick:()=>i?.(1),disabled:o===1,children:"1"},1)),o>3&&s.push((0,r.jsx)("span",{children:"..."},"start-ellipsis"));for(let p=Math.max(2,o-1);p<=Math.min(c-1,o+1);p++)s.push((0,r.jsx)(R,{onClick:()=>i?.(p),disabled:o===p,children:p},p));return o<c-1-1&&s.push((0,r.jsx)("span",{children:"..."},"end-ellipsis")),c>1&&s.push((0,r.jsx)(R,{onClick:()=>i?.(1),disabled:o===1,children:c+1},1)),s};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Yt,{children:(0,r.jsxs)(_t,{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{style:{background:"linear-gradient(to right, #1e73be, #28a97d)"},children:[t.map((s,T)=>(0,r.jsx)(W,{children:s.label},T)),m&&(0,r.jsx)(W,{children:"Actions"})]})}),(0,r.jsx)("tbody",{children:e.length>0?e.map((s,T)=>(0,r.jsxs)(qt,{className:u,children:[t.map((p,ut)=>(0,r.jsx)(Z,{children:(()=>{let n=s[p.key];if(I.default.isValidElement(n))return n;if(typeof n=="function")try{let h=n();if(I.default.isValidElement(h))return h}catch(h){console.warn("Error executing function in table cell:",h)}return typeof n=="string"&&n.trim().startsWith("<")&&n.trim().endsWith(">")?(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:n}}):Array.isArray(n)?n.some(h=>I.default.isValidElement(h))?(0,r.jsx)(r.Fragment,{children:n}):n.join(", "):n instanceof Date?n.toLocaleString():typeof n=="boolean"?n?"Yes":"No":n==null?"-":typeof n=="number"?n.toString():typeof n=="object"?JSON.stringify(n):String(n)})()},ut)),m&&(0,r.jsx)(Z,{children:m(s)})]},T)):(0,r.jsx)("tr",{children:(0,r.jsx)(Xt,{colSpan:t.length+(m?1:0),children:"No data available"})})})]})}),(c>1||f<=a)&&(0,r.jsxs)(Wt,{children:[(0,r.jsxs)(Zt,{children:[(0,r.jsx)(R,{onClick:()=>i?.(o-1),disabled:o===1,children:"Previous"}),ft(),(0,r.jsx)(R,{onClick:()=>i?.(o+1),disabled:o===c,children:"Next"}),(0,r.jsx)(Jt,{value:a,onChange:s=>{i?.(1),v?.(Number(s.target.value))},children:[5,10,15].map(s=>(0,r.jsxs)("option",{value:s,children:[s," per page"]},s))})]}),(0,r.jsxs)(Gt,{children:["Page ",o+1," of ",c+1," (Total: ",f," items)"]})]})]})},J=Qt;var $=l(require("styled-components")),y=require("react/jsx-runtime"),te=$.default.div`
273
197
  display: flex;
274
198
  background: #135f9b;
275
199
  color: #fff;
276
- `,Io=p.div`
200
+ `,ee=$.default.div`
277
201
  padding: 12px 20px;
278
202
  font-size: 16px;
279
203
  font-weight: 600;
280
204
  cursor: pointer;
281
- border-bottom: ${({$active:e})=>e?"6px solid red":"none"};
282
- color: ${({$active:e})=>e?"#dcffed":"#fff"};
205
+ border-bottom: ${({$active:t})=>t?"6px solid red":"none"};
206
+ color: ${({$active:t})=>t?"#dcffed":"#fff"};
283
207
  transition: color 0.3s, border-bottom 0.3s;
284
208
 
285
209
  &:hover {
286
210
  color: #dcffed;
287
211
  }
288
- `,zo=p.div`
212
+ `,oe=$.default.div`
289
213
  padding: 20px;
290
214
  background: #f9f9f9;
291
215
  border-radius: 10px;
292
216
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
293
217
  max-width: 1300px;
294
- `,Do=({tabs:e,activeTabId:t,onTabClick:r,content:n})=>(0,ge.jsxs)("div",{children:[(0,ge.jsx)(No,{children:e.map(o=>(0,ge.jsx)(Io,{$active:o.id===t,onClick:()=>r(o.id),children:o.label},o.id))}),(0,ge.jsx)(zo,{children:n})]}),Vr=Do;var Mo=p.div`
218
+ `,re=({tabs:t,activeTabId:e,onTabClick:o,content:i})=>(0,y.jsxs)("div",{children:[(0,y.jsx)(te,{children:t.map(a=>(0,y.jsx)(ee,{$active:a.id===e,onClick:()=>o(a.id),children:a.label},a.id))}),(0,y.jsx)(oe,{children:i})]}),G=re;var Q=l(require("styled-components")),ie=Q.default.div`
295
219
  border: 4px solid rgba(0, 123, 255, 0.2);
296
220
  border-radius: 10%;
297
221
  border-top: 4px solid #007bff;
@@ -307,14 +231,14 @@ background: linear-gradient(to right, #1e73be, #28a97d);
307
231
  transform: rotate(360deg);
308
232
  }
309
233
  }
310
- `,Br=Mo;var jo=p.section`
234
+ `,tt=ie;var et=l(require("styled-components")),ne=et.default.section`
311
235
  text-align: center;
312
- `,Ur=jo;var $o=p.div`
236
+ `,ot=ne;var rt=l(require("styled-components")),ae=rt.default.div`
313
237
  display: flex;
314
238
  justify-content: space-around;
315
239
  margin-top: 20px;
316
- `,Yr=$o;var Fo=p.p`
240
+ `,it=ae;var nt=l(require("styled-components")),se=nt.default.p`
317
241
  font-size: 20px;
318
242
  margin: 0;
319
- `,Hr=Fo;var Gr=e=>e?"":"This field is required.",Wr=e=>t=>t.length<=e?"":`This field must be at most ${e} characters.`,qr=e=>t=>t.length>=e?"":`This field must be at least ${e} characters.`,Kr=e=>/^[a-zA-Z0-9_]+$/.test(e)?"":"Username can only contain alphanumeric characters and underscores.",Xr=e=>/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/.test(e)?"":"Password must be 6-20 characters long, include uppercase, lowercase, and a number.";0&&(module.exports={MahatiButton,MahatiCard,MahatiDropdown,MahatiFormContainer,MahatiInput,MahatiKeyValueDisplay,MahatiLabel,MahatiMain,MahatiParagraph,MahatiRow,MahatiSection,MahatiSpinner,MahatiTabbedInterface,MahatiTable,MahatiTooltip,isValidPassword,isValidUsername,maxLength,minLength,required});
243
+ `,at=se;var st=t=>t?"":"This field is required.",lt=t=>e=>e.length<=t?"":`This field must be at most ${t} characters.`,dt=t=>e=>e.length>=t?"":`This field must be at least ${t} characters.`,ct=t=>/^[a-zA-Z0-9_]+$/.test(t)?"":"Username can only contain alphanumeric characters and underscores.",pt=t=>/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/.test(t)?"":"Password must be 6-20 characters long, include uppercase, lowercase, and a number.";0&&(module.exports={MahatiButton,MahatiCard,MahatiDropdown,MahatiFormContainer,MahatiInput,MahatiKeyValueDisplay,MahatiLabel,MahatiMain,MahatiParagraph,MahatiRow,MahatiSection,MahatiSpinner,MahatiTabbedInterface,MahatiTable,MahatiTooltip,isValidPassword,isValidUsername,maxLength,minLength,required});
320
244
  //# sourceMappingURL=index.js.map