shekel-fe-shared-lib 1.0.9 → 1.0.10
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.cjs +13 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +181 -180
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("react"),Q=({variant:s="primary",size:a="md",fullWidth:n=!1,icon:t,iconPosition:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("react"),Q=({variant:s="primary",size:a="md",fullWidth:n=!1,icon:t,iconPosition:d="left",loading:u=!1,hoverColor:$,bgColor:i,textColor:l,borderColor:x,hoverBgColor:p,hoverTextColor:g,rounded:b="lg",style:f,className:r="",children:w,disabled:c,...y})=>{const o="inline-flex items-center justify-center font-normal transition-all duration-300 ease-out focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-95",h={primary:"bg-[#EC615B] hover:bg-[#D4554F] text-white focus:ring-[#EC615B] shadow-sm hover:shadow-md",outlined:"border border-gray-300 bg-white hover:bg-gray-50 text-[#181918] focus:ring-gray-300",ghost:"bg-gray-100 hover:bg-gray-200 text-[#181918] focus:ring-gray-300",text:"text-[#181918] hover:bg-gray-100 focus:ring-gray-300"},j={sm:"px-3 py-1.5 text-sm gap-1.5",md:"px-4 py-2 text-base gap-2",lg:"px-6 py-3 text-lg gap-2.5",responsive:"px-2 py-1 text-xs sm:px-3 sm:py-1.5 sm:text-sm md:px-4 md:py-2 md:text-base lg:px-6 lg:py-3 lg:text-lg gap-1 sm:gap-1.5 md:gap-2 lg:gap-2.5"},m={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},M=n?"w-full":"";let C=h[s];(i||l||x)&&(C="");const F=`${o} ${C} ${j[a]} ${m[b]} ${M} ${r}`,B=()=>u?e.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):t,S={...f};return i&&(S.backgroundColor=i),l&&(S.color=l),x&&(S.borderColor=x),e.jsxs("button",{className:F,disabled:c||u,style:S,onMouseEnter:E=>{!c&&!u&&(p?E.currentTarget.style.backgroundColor=p:$&&(E.currentTarget.style.backgroundColor=$),g&&(E.currentTarget.style.color=g))},onMouseLeave:E=>{!c&&!u&&((i||p||$)&&(E.currentTarget.style.backgroundColor=i||""),(l||g)&&(E.currentTarget.style.color=l||""))},...y,children:[d==="left"&&B(),w,d==="right"&&B()]})},U=({label:s,value:a,selected:n=!1,onClick:t,className:d="",size:u="responsive",rounded:$="md",bgColor:i,borderColor:l,labelColor:x,valueColor:p,selectedBgColor:g,selectedBorderColor:b,selectedLabelColor:f,selectedValueColor:r,style:w})=>{const c=()=>{switch(u){case"sm":return"p-2 sm:p-3";case"md":return"p-3 sm:p-4";case"lg":return"p-4 sm:p-6";case"responsive":return"p-3 sm:p-4 md:p-5 lg:p-6";default:return"p-4"}},y=()=>{switch($){case"none":return"rounded-none";case"sm":return"rounded-sm";case"md":return"rounded-md";case"lg":return"rounded-lg";case"xl":return"rounded-xl";case"full":return"rounded-full";default:return"rounded-md"}},o=()=>{switch(u){case"sm":return"text-xs sm:text-xs";case"md":return"text-sm sm:text-base";case"lg":return"text-base sm:text-lg";case"responsive":return"text-xs sm:text-sm md:text-base lg:text-lg";default:return"text-xs sm:text-sm md:text-base"}},h=()=>{switch(u){case"sm":return"text-lg sm:text-xl";case"md":return"text-2xl sm:text-3xl";case"lg":return"text-4xl sm:text-5xl";case"responsive":return"text-2xl sm:text-3xl md:text-4xl lg:text-5xl";default:return"text-3xl"}},B=`${`stat-card relative flex flex-col ${c()} ${y()} border transition-all duration-500 ease-in-out cursor-pointer overflow-hidden`} ${n?"border-[#181918] bg-[#F4F4F4] shadow-sm scale-[1.02]":`${l?"":"border-gray-200"} ${i?"":"bg-white"} ${!i&&!l?"hover:border-gray-300 hover:shadow-sm":""}`} ${d}`,S={...w};return n&&g?S.backgroundColor=g:!n&&i&&(S.backgroundColor=i),n&&b?S.borderColor=b:!n&&l&&(S.borderColor=l),e.jsxs("div",{className:B,onClick:t,style:S,children:[n&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-[#EC615B]/5 to-transparent animate-slide-in pointer-events-none"}),e.jsxs("div",{className:"relative z-10 transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]",children:[e.jsx("span",{className:`${o()} font-normal mb-2 block transition-colors duration-500 ${n?"text-gray-700":"text-gray-600"}`,style:n&&f?{color:f}:!n&&x?{color:x}:void 0,children:s}),e.jsx("span",{className:`${h()} font-semibold stat-value block transition-all duration-500 ${n?"text-[#181918] scale-105":"text-[#181918]"}`,style:n&&r?{color:r}:!n&&p?{color:p}:void 0,children:a})]})]})},G=({icon:s,iconPosition:a="left",size:n="md",fullWidth:t=!1,className:d="",onIconClick:u,bgColor:$,borderColor:i,focusBorderColor:l,iconColor:x,textColor:p,placeholderColor:g,rounded:b="md",style:f,...r})=>{const w="relative inline-flex items-center",c="border focus:outline-none focus:ring-1 transition-all duration-200 ease-in-out",y={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-5 py-3 text-lg",responsive:"px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"},o={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",responsive:"w-4 sm:w-5 md:w-6 h-4 sm:h-5 md:h-6"},h={none:"rounded-none",sm:"rounded-sm",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"},j=a==="left"?n==="sm"?"pl-9":n==="md"?"pl-10":n==="lg"?"pl-12":"pl-9 sm:pl-10 md:pl-12":n==="sm"?"pr-9":n==="md"?"pr-10":n==="lg"?"pr-12":"pr-9 sm:pr-10 md:pr-12",m=t?"w-full":"",M={backgroundColor:$,borderColor:i||"#D1D5DB",color:p,...f},C=g?"":"placeholder:text-gray-400",F=i?"":"border-gray-300",B=p?"":"text-gray-900",S=l?"":"focus:ring-[#EC615B] focus:border-[#EC615B]",E=`${c} ${!d.includes("px-")&&!d.includes("py-")?y[n]:""} ${s?j:""} ${m} ${d.includes("rounded")?"":h[b]} ${d.includes("border-")?"":F} ${B} ${S} ${C} ${d}`,z=a==="left"?"left-3":"right-3",T=x||"text-gray-400",k=x?"":"hover:text-gray-600",N=e.jsx("svg",{className:`${o[n]} ${T}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})});return e.jsxs("div",{className:`${w} ${m}`,children:[s&&e.jsx("div",{className:`absolute ${z} ${T} ${u?"cursor-pointer":""} ${k}`,onClick:u,children:s===!0?N:s}),e.jsx("input",{type:"text",className:E,style:{...M,...l&&{"--focus-border-color":l},...g&&{"--placeholder-color":g}},...r})]})},J=({padding:s="md",shadow:a="sm",hover:n=!1,bordered:t=!0,rounded:d="lg",className:u="",bgColor:$,borderColor:i,style:l,children:x,...p})=>{const g="card transition-all duration-300 ease-out",b={none:"p-0",sm:"p-3",md:"p-4",lg:"p-6",responsive:"p-2 sm:p-3 md:p-4 lg:p-6"},f={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg"},r={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl"},w=t?`border ${i||"border-gray-200"}`:"",c=n?"cursor-pointer":"",o=`${g} ${$?"":"bg-white"} ${b[s]} ${f[a]} ${r[d]} ${w} ${c} ${u}`,h={...$&&{backgroundColor:$},...l};return e.jsx("div",{className:o,style:h,...p,children:e.jsx("div",{className:n?"transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]":"",children:x})})},X=({items:s,trigger:a="click",placement:n="bottomLeft",children:t,className:d="",overlayClassName:u="",disabled:$=!1,size:i="md",menuBgColor:l,menuItemHoverColor:x,dangerColor:p,borderColor:g,style:b})=>{const[f,r]=P.useState(!1),w=P.useRef(null);P.useEffect(()=>{const L=I=>{w.current&&!w.current.contains(I.target)&&r(!1)};return f&&document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)}},[f]);const c=()=>{!$&&a==="click"&&r(!f)},y=()=>{!$&&a==="hover"&&r(!0)},o=()=>{!$&&a==="hover"&&r(!1)},h=L=>{!L.disabled&&L.onClick&&L.onClick(),r(!1)},j={bottomLeft:"top-full left-0 mt-1",bottomRight:"top-full right-0 mt-1",topLeft:"bottom-full left-0 mb-1",topRight:"bottom-full right-0 mb-1"},m=n.startsWith("bottom")?"dropdown-slide-down":"dropdown-slide-up",M={sm:"min-w-[120px] text-xs",md:"min-w-[160px] text-sm",lg:"min-w-[220px] text-base",responsive:"min-w-[120px] sm:min-w-[160px] md:min-w-[200px] lg:min-w-[240px] text-xs sm:text-sm md:text-base"},C={sm:"px-3 py-1.5 text-xs gap-1.5",md:"px-4 py-2 text-sm gap-2",lg:"px-5 py-3 text-base gap-2.5",responsive:"px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-xs sm:text-sm md:text-base gap-1.5 sm:gap-2 md:gap-2.5"},F="hover:bg-gray-50",B="border-gray-200",S="text-red-600",E=x?{backgroundColor:x}:{},z=x?"":F,T=p?{color:p}:{},k=p?{backgroundColor:p+"15"}:{},N=g||B;return e.jsxs("div",{ref:w,className:`relative inline-block ${d}`,onMouseEnter:y,onMouseLeave:o,style:b,children:[e.jsx("div",{onClick:c,className:`inline-flex ${$?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:t}),f&&!$&&e.jsx("div",{className:`absolute ${j[n]} ${m} z-50 ${M[i]} ${u}`,children:e.jsx("div",{className:`dropdown-menu rounded-lg shadow-lg border py-1 overflow-hidden ${N}`,style:{backgroundColor:l||"#ffffff"},children:s.map(L=>{let I={};return L.disabled||(L.danger?I={...T,...k}:x&&(I=E)),e.jsxs("div",{onClick:()=>h(L),className:`
|
|
2
2
|
dropdown-menu-item
|
|
3
3
|
flex items-center cursor-pointer transition-all duration-200 ease-out
|
|
4
|
-
${C[i]}
|
|
4
|
+
${!u.includes("px-")&&!u.includes("py-")?C[i]:""}
|
|
5
5
|
${L.disabled?"opacity-50 cursor-not-allowed":z}
|
|
6
6
|
${L.danger?p?"":S:"text-gray-700"}
|
|
7
|
-
`,style:I,children:[L.icon&&e.jsx("span",{className:"flex-shrink-0",children:L.icon}),e.jsx("span",{children:L.label})]},L.key)})})})]})},V=({options:s,value:a,defaultValue:n,placeholder:t="Select an option",onChange:
|
|
7
|
+
`,style:I,children:[L.icon&&e.jsx("span",{className:"flex-shrink-0",children:L.icon}),e.jsx("span",{children:L.label})]},L.key)})})})]})},V=({options:s,value:a,defaultValue:n,placeholder:t="Select an option",onChange:d,disabled:u=!1,size:$="md",fullWidth:i=!1,className:l="",allowClear:x=!1,showSearch:p=!1,searchPlaceholder:g="Search...",bgColor:b,borderColor:f,focusBorderColor:r="#EC615B",selectedBgColor:w,selectedTextColor:c,hoverBgColor:y,rounded:o="lg",style:h})=>{const[j,m]=P.useState(!1),[M,C]=P.useState(n),[F,B]=P.useState(""),S=P.useRef(null),E=P.useRef(null),z=a!==void 0?a:M;P.useEffect(()=>{const v=D=>{S.current&&!S.current.contains(D.target)&&(m(!1),B(""))};return j&&(document.addEventListener("mousedown",v),p&&E.current&&E.current.focus()),()=>{document.removeEventListener("mousedown",v)}},[j,p]);const T=v=>{a===void 0&&C(v),d==null||d(v),m(!1),B("")},k=v=>{v.stopPropagation(),a===void 0&&C(void 0),d==null||d("")},N=s.find(v=>v.value===z),L=p?s.filter(v=>v.label.toLowerCase().includes(F.toLowerCase())):s,I={sm:"px-3 py-1.5 text-sm",md:"px-4 py-2 text-base",lg:"px-5 py-3 text-lg",responsive:"px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"},O={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},R=i?"w-full":"min-w-[200px]",W=()=>{const v={};return b&&(v.backgroundColor=b),f&&(v.borderColor=f),v},A=()=>{const v={};return w&&(v.backgroundColor=w),c&&(v.color=c),v},H=e.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ease-out ${j?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),q=e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})});return e.jsxs("div",{ref:S,className:`relative inline-block ${R}`,style:h,children:[e.jsxs("div",{onClick:()=>!u&&m(!j),className:`
|
|
8
8
|
select-trigger
|
|
9
9
|
flex items-center justify-between gap-2
|
|
10
10
|
border transition-all duration-200 ease-out
|
|
11
|
-
${I[$]}
|
|
12
|
-
${O[
|
|
11
|
+
${!l.includes("px-")&&!l.includes("py-")&&!l.includes("h-")?I[$]:""}
|
|
12
|
+
${l.includes("rounded")?"":O[o]}
|
|
13
13
|
${u?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
14
14
|
${j?"ring-2 ring-opacity-20":""}
|
|
15
|
-
|
|
15
|
+
${l}
|
|
16
|
+
`,style:{...W(),backgroundColor:b||W().backgroundColor||"#FFFFFF",borderColor:f||W().borderColor||"#D1D5DB",...j&&{borderColor:r,boxShadow:`0 0 0 2px ${r}20`},...!u&&!j&&y&&{cursor:"pointer"}},onMouseEnter:v=>{!u&&y&&(v.currentTarget.style.backgroundColor=y)},onMouseLeave:v=>{b?v.currentTarget.style.backgroundColor=b:v.currentTarget.style.backgroundColor="#FFFFFF"},children:[e.jsx("span",{className:N?"text-gray-900":"text-gray-400",children:N?N.label:t}),e.jsxs("div",{className:"flex items-center gap-1",children:[x&&z&&!u&&e.jsx("span",{onClick:k,className:"text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",children:q}),e.jsx("span",{className:"text-gray-400",children:H})]})]}),j&&!u&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 z-50 dropdown-slide-down",children:e.jsxs("div",{className:`select-dropdown bg-white shadow-lg border border-gray-200 py-1 max-h-[300px] overflow-auto ${O[o]}`,children:[p&&e.jsx("div",{className:"px-2 py-2 border-b border-gray-200",children:e.jsx("input",{ref:E,type:"text",value:F,onChange:v=>B(v.target.value),placeholder:g,className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 transition-all duration-200 ease-out",style:{borderColor:f,boxShadow:`0 0 0 2px ${r}20`},onClick:v=>v.stopPropagation()})}),L.length===0?e.jsx("div",{className:"px-4 py-3 text-sm text-gray-500 text-center",children:"No results found"}):L.map(v=>e.jsx("div",{onClick:()=>!v.disabled&&T(v.value),className:`
|
|
16
17
|
select-option
|
|
17
18
|
px-4 py-2 text-sm transition-all duration-200 ease-out
|
|
18
19
|
${v.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
19
|
-
`,style:{...v.value===z?A():{},backgroundColor:v.value===z?w||"#FCEAE9":void 0,color:v.value===z?d||"#EC615B":"#181918",fontWeight:v.value===z?"medium":void 0},onMouseEnter:D=>{!v.disabled&&v.value!==z&&(D.currentTarget.style.backgroundColor=y||"#F3F4F6")},onMouseLeave:D=>{v.value!==z&&(D.currentTarget.style.backgroundColor="transparent")},children:v.label},v.value))]})})]})},Y=({columns:s,dataSource:a,rowKey:n="id",pagination:t,loading:c=!1,onRow:u,className:$="",bordered:i=!1,striped:o=!1,size:m="md",headerBgColor:p,headerTextColor:g,rowHoverColor:b,borderColor:f,stripedRowColor:r,rounded:w="md",style:d})=>{const[y,l]=P.useState(t&&typeof t=="object"&&t.current||1),[h,j]=P.useState(t&&typeof t=="object"&&t.pageSize||10),x={sm:{headerPadding:"px-3 py-2",headerFontSize:"text-xs",rowPadding:"px-3 py-2",rowFontSize:"text-xs",containerRounded:"rounded-md"},md:{headerPadding:"px-4 py-3",headerFontSize:"text-xs",rowPadding:"px-4 py-3",rowFontSize:"text-sm",containerRounded:"rounded-lg"},lg:{headerPadding:"px-6 py-4",headerFontSize:"text-sm",rowPadding:"px-6 py-4",rowFontSize:"text-base",containerRounded:"rounded-xl"},responsive:{headerPadding:"px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",headerFontSize:"text-xs sm:text-xs md:text-sm",rowPadding:"px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",rowFontSize:"text-xs sm:text-xs md:text-sm",containerRounded:"rounded-md sm:rounded-lg md:rounded-lg"}},M={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl"},C=x[m],F=M[w],B=(N,k)=>typeof n=="function"?n(N):N[n]||String(k),S=(N,k)=>k?k.split(".").reduce((L,I)=>L==null?void 0:L[I],N):N,E=t===!1?a:a.slice((y-1)*h,y*h),z=N=>{l(N),t&&typeof t=="object"&&t.onChange&&t.onChange(N,h)},T=N=>{j(N),l(1),t&&typeof t=="object"&&t.onChange&&t.onChange(1,N)};return e.jsxs("div",{className:"w-full",style:d,children:[e.jsx("div",{className:`overflow-x-auto ${F||"rounded-2xl"} border`,style:{borderColor:f||"#EEEEEE"},children:e.jsxs("table",{className:`w-full ${i?"border-collapse":""} ${$}`,children:[e.jsx("thead",{style:{backgroundColor:p||"#F5F6F7",color:g||"#333333"},children:e.jsx("tr",{children:s.map((N,k)=>e.jsx("th",{className:`${C.headerPadding} text-left ${C.headerFontSize} font-medium uppercase tracking-wider ${i&&k!==s.length-1?"border-r":""} ${N.align==="center"?"text-center":N.align==="right"?"text-right":""}`,style:{width:N.width,borderColor:f||"#EEEEEE",color:g||"#333333"},children:N.title},N.key))})}),e.jsx("tbody",{className:"bg-white divide-y",style:{borderColor:f||"#e5e5e5"},children:c?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:`${C.rowPadding} py-8 text-center`,style:{color:"#333333"},children:e.jsxs("div",{className:"flex justify-center items-center",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]})})}):E.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:`${C.rowPadding} py-8 text-center`,style:{color:"#333333"},children:"No data"})}):E.map((N,k)=>{const L=u?u(N,k):{},I=o&&k%2===1?r||"#F5F6F7":"transparent",O=b||"#f3f4f6";return e.jsx("tr",{className:"transition-colors duration-200 ease-out",style:{backgroundColor:I},onMouseEnter:R=>{(b||!o||k%2===0)&&(R.currentTarget.style.backgroundColor=O)},onMouseLeave:R=>{R.currentTarget.style.backgroundColor=I},...L,children:s.map((R,W)=>{const A=S(N,R.dataIndex),H=R.render?R.render(A,N,k):A;return e.jsx("td",{className:`${C.rowPadding} ${C.rowFontSize} text-gray-900 ${i&&W!==s.length-1?"border-r":""} ${R.align==="center"?"text-center":R.align==="right"?"text-right":""}`,style:{borderColor:f||"#EEEEEE"},children:H},R.key)})},B(N,k))})})]})}),t!==!1&&e.jsx(Z,{current:y,pageSize:h,total:a.length,onChange:z,onPageSizeChange:T,showSizeChanger:t&&typeof t=="object"?t.showSizeChanger:!0,pageSizeOptions:t&&typeof t=="object"?t.pageSizeOptions:[10,20,50,100],showTotal:t&&typeof t=="object"?t.showTotal:!0,size:t&&typeof t=="object"&&t.size?t.size:m==="responsive"?"md":m})]})},Z=({current:s,pageSize:a,total:n,onChange:t,onPageSizeChange:c,showSizeChanger:u=!0,pageSizeOptions:$=[10,20,50,100],showTotal:i=!0,size:o="md"})=>{const m=Math.ceil(n/a),p=(s-1)*a+1,g=Math.min(s*a,n),b={sm:{button:"px-2.5 py-1 text-xs",icon:"h-3.5 w-3.5",nav:"px-1.5 py-1.5"},md:{button:"px-4 py-2 text-sm",icon:"h-5 w-5",nav:"px-2 py-2"},lg:{button:"px-5 py-2.5 text-base",icon:"h-6 w-6",nav:"px-3 py-3"}},f=()=>{const r=[];if(m<=7)for(let d=1;d<=m;d++)r.push(d);else if(s<=3){for(let d=1;d<=5;d++)r.push(d);r.push("..."),r.push(m)}else if(s>=m-2){r.push(1),r.push("...");for(let d=m-4;d<=m;d++)r.push(d)}else{r.push(1),r.push("...");for(let d=s-1;d<=s+1;d++)r.push(d);r.push("..."),r.push(m)}return r};return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#EEEEEE] sm:px-6 mt-4",children:[i&&e.jsxs("div",{className:"text-sm text-[#181918]",children:[p,"-",g," of ",n," items"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[u&&e.jsx(V,{value:a.toString(),onChange:r=>c(Number(r)),options:$.map(r=>({value:r.toString(),label:`${r} / page`})),size:"sm",className:"w-32"}),e.jsxs("nav",{className:"inline-flex gap-1 items-center","aria-label":"Pagination",children:[e.jsx("button",{onClick:()=>t(s-1),disabled:s===1,className:`relative inline-flex items-center justify-center rounded-md ${b[o].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,children:e.jsx("svg",{className:b[o].icon,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),f().map((r,w)=>r==="..."?e.jsx("span",{className:`relative inline-flex items-center justify-center ${b[o].button} font-normal text-[#181918]`,children:"..."},`ellipsis-${w}`):e.jsx("button",{onClick:()=>t(r),className:`relative inline-flex items-center justify-center rounded-md ${b[o].button} font-medium transition-all duration-300 ease-out focus:z-20 hover:scale-105 active:scale-95 ${s===r?"bg-[#EC615B] text-white shadow-sm":"text-[#181918] hover:bg-gray-100"}`,children:r},r)),e.jsx("button",{onClick:()=>t(s+1),disabled:s===m,className:`relative inline-flex items-center justify-center rounded-md ${b[o].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,children:e.jsx("svg",{className:b[o].icon,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]})]})},_=({title:s,description:a,searchPlaceholder:n="Search...",onSearch:t,actions:c,filters:u,className:$="",size:i="responsive",titleColor:o,descriptionColor:m,searchBgColor:p="white",searchBorderColor:g="#d1d5db",searchFocusBorderColor:b="#3b82f6",rounded:f="md",style:r})=>{const w=x=>{t==null||t(x.target.value)},y={sm:{titleSize:"text-lg",titleWeight:"font-semibold",descriptionSize:"text-xs",searchInputSize:"text-xs",searchInputPy:"py-1.5",searchPaddingLeft:"pl-8",iconSize:"h-4 w-4",spacing:"space-y-2",gap:"gap-2",maxWidth:"max-w-sm",descriptionMargin:"mt-0.5"},md:{titleSize:"text-xl",titleWeight:"font-semibold",descriptionSize:"text-sm",searchInputSize:"text-sm",searchInputPy:"py-2",searchPaddingLeft:"pl-10",iconSize:"h-5 w-5",spacing:"space-y-3",gap:"gap-3",maxWidth:"max-w-md",descriptionMargin:"mt-1"},lg:{titleSize:"text-2xl",titleWeight:"font-bold",descriptionSize:"text-base",searchInputSize:"text-base",searchInputPy:"py-2.5",searchPaddingLeft:"pl-12",iconSize:"h-6 w-6",spacing:"space-y-4",gap:"gap-4",maxWidth:"max-w-lg",descriptionMargin:"mt-2"},responsive:{titleSize:"text-lg sm:text-xl md:text-2xl",titleWeight:"font-semibold md:font-bold",descriptionSize:"text-xs sm:text-sm md:text-base",searchInputSize:"text-xs sm:text-sm md:text-base",searchInputPy:"py-1.5 sm:py-2 md:py-2.5",searchPaddingLeft:"pl-8 sm:pl-10 md:pl-12",iconSize:"h-4 w-4 sm:h-5 sm:w-5 md:h-6 md:w-6",spacing:"space-y-2 sm:space-y-3 md:space-y-4",gap:"gap-2 sm:gap-3 md:gap-4",maxWidth:"max-w-sm md:max-w-md lg:max-w-lg",descriptionMargin:"mt-0.5 sm:mt-1 md:mt-2"}}[i],h={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}[f],j={backgroundColor:p,borderColor:g};return e.jsxs("div",{className:`${y.spacing} mb-4 ${$}`,style:r,children:[(s||a)&&e.jsxs("div",{children:[s&&e.jsx("h2",{className:`${y.titleSize} ${y.titleWeight}`,style:{color:o||"#111827"},children:s}),a&&e.jsx("p",{className:`${y.descriptionSize} ${y.descriptionMargin}`,style:{color:m||"#6b7280"},children:a})]}),e.jsxs("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between ${y.gap}`,children:[t&&e.jsx("div",{className:`flex-1 ${y.maxWidth}`,children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx("svg",{className:`${y.iconSize} text-gray-400`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("input",{type:"text",placeholder:n,onChange:w,className:`block w-full ${y.searchPaddingLeft} pr-3 ${y.searchInputPy} border ${h} focus:outline-none focus:ring-2 focus:ring-opacity-50 ${y.searchInputSize} transition-colors duration-200`,style:j,onFocus:x=>{x.currentTarget.style.borderColor=b,x.currentTarget.style.boxShadow="0 0 0 2px rgba(59, 130, 246, 0.1)"},onBlur:x=>{x.currentTarget.style.borderColor=g,x.currentTarget.style.boxShadow="none"}})]})}),c&&e.jsx("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:c})]}),u&&e.jsx("div",{className:`flex flex-wrap items-center ${y.gap}`,children:u})]})},K={sm:"384px",md:"448px",lg:"512px",xl:"600px",full:"100%",responsive:"90vw"},ee=({open:s,onClose:a,title:n,children:t,footer:c,width:u,size:$="md",closable:i=!0,maskClosable:o=!0,centered:m=!0,className:p="",bgColor:g="#ffffff",headerBgColor:b="#ffffff",overlayColor:f="rgba(0, 0, 0, 0.5)",bodyClassName:r="",headerClassName:w="",maxHeight:d="70vh"})=>{const[y,l]=P.useState(!1),[h,j]=P.useState(!1),x=u||K[$],C={width:typeof x=="number"?`${x}px`:x,maxWidth:"90vw",backgroundColor:g},F={backgroundColor:b},B={backgroundColor:f};if(P.useEffect(()=>{if(s)l(!0),setTimeout(()=>j(!0),10),document.body.style.overflow="hidden";else{j(!1);const z=setTimeout(()=>{l(!1)},200);return document.body.style.overflow="unset",()=>clearTimeout(z)}},[s]),P.useEffect(()=>{const z=T=>{T.key==="Escape"&&i&&s&&a()};return s&&document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[s,a,i]),!y)return null;const S=()=>{o&&a()},E=z=>{z.stopPropagation()};return e.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",onClick:S,children:[e.jsx("div",{className:`fixed inset-0 transition-opacity duration-200 ease-out ${h?"opacity-100":"opacity-0"}`,style:B}),e.jsx("div",{className:`flex min-h-full items-center justify-center p-4 ${m?"items-center":"items-start pt-20"}`,children:e.jsxs("div",{className:`relative rounded-lg shadow-xl transition-all duration-200 ease-out overflow-y-auto ${h?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-4"} ${p}`,style:{...C,maxHeight:typeof d=="number"?`${d}px`:d},onClick:E,children:[(n||i)&&e.jsxs("div",{className:`flex items-center justify-between px-6 py-4 border-b border-gray-200 ${w}`,style:F,children:[n&&e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n}),i&&e.jsx("button",{onClick:a,className:"text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:`px-6 py-4 ${r}`,children:t}),c&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 flex justify-end gap-2",children:c})]})})]})},te=({children:s,variant:a="default",size:n="md",dot:t=!1,icon:c,iconPosition:u="left",className:$="",bgColor:i,textColor:o,borderColor:m,rounded:p="full",style:g})=>{const b={default:"bg-gray-100 text-[#181918]",primary:"bg-[#FCEAE9] text-[#EC615B]",success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",danger:"bg-red-100 text-red-800",info:"bg-cyan-100 text-cyan-800"},f={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base",responsive:"px-1.5 py-0.5 text-[10px] sm:px-2 sm:py-0.5 sm:text-xs md:px-2.5 md:py-1 md:text-sm lg:px-3 lg:py-1.5 lg:text-base"},r={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5",responsive:"w-1 h-1 sm:w-1.5 sm:h-1.5 md:w-2 md:h-2 lg:w-2.5 lg:h-2.5"},w={default:"bg-gray-600",primary:"bg-[#EC615B]",success:"bg-green-600",warning:"bg-yellow-600",danger:"bg-red-600",info:"bg-cyan-600"},d={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4",responsive:"w-2.5 h-2.5 sm:w-3 sm:h-3 md:w-3.5 md:h-3.5 lg:w-4 lg:h-4"},y={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},l={...i&&{backgroundColor:i},...o&&{color:o},...m&&{borderColor:m,borderWidth:"1px",borderStyle:"solid"},...g};return e.jsxs("span",{className:`inline-flex items-center gap-1.5 font-medium transition-all duration-200 ${i?"":b[a]} ${f[n]} ${y[p]} ${$}`,style:l,children:[t&&e.jsx("span",{className:`rounded-full ${r[n]} ${w[a]}`}),c&&u==="left"&&e.jsx("span",{className:`inline-flex items-center ${d[n]}`,children:c}),s,c&&u==="right"&&e.jsx("span",{className:`inline-flex items-center ${d[n]}`,children:c})]})},se=({items:s,current:a=0,direction:n="vertical",size:t="md",variant:c="default",className:u="",style:$,finishColor:i,processColor:o,waitColor:m,errorColor:p,lineColor:g})=>{const b=(l,h)=>h.status?h.status:l<a?"finish":l===a?"process":"wait",f={sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10",responsive:"w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 lg:w-10 lg:h-10"},r={sm:"text-sm",md:"text-base",lg:"text-lg",responsive:"text-xs sm:text-sm md:text-base lg:text-lg"},w={sm:"text-xs",md:"text-sm",lg:"text-base",responsive:"text-xs sm:text-xs md:text-sm lg:text-base"},d=(l,h)=>h||(l==="finish"?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):l==="error"?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}):null),y=l=>{const h=c==="outline";switch(l){case"finish":return{icon:h?`bg-white text-white border ${i?`border-[${i}]`:"border-green-500"}`:`${i?`bg-[${i}]`:"bg-green-500"} text-white ${i?`border-[${i}]`:"border-green-500"}`,title:"text-[#181918]",description:"text-gray-600",line:g?`bg-[${g}]`:"bg-green-500",iconColor:i};case"process":return{icon:h?`bg-white text-white border ${o?`border-[${o}]`:"border-[#EC615B]"}`:`${o?`bg-[${o}]`:"bg-[#EC615B]"} text-white ${o?`border-[${o}]`:"border-[#EC615B]"}`,title:"text-[#181918] font-semibold",description:"text-gray-700",line:g?`bg-[${g}]`:"bg-gray-300",iconColor:o};case"error":return{icon:h?`bg-white text-white border ${p?`border-[${p}]`:"border-red-500"}`:`${p?`bg-[${p}]`:"bg-red-500"} text-white ${p?`border-[${p}]`:"border-red-500"}`,title:"text-red-600",description:"text-red-500",line:g?`bg-[${g}]`:"bg-gray-300",iconColor:p};default:return{icon:"bg-white text-gray-400 border-gray-300",title:"text-gray-500",description:"text-gray-400",line:g?`bg-[${g}]`:"bg-gray-300",iconColor:m}}};return n==="horizontal"?e.jsx("div",{className:`flex items-start ${u}`,style:$,children:s.map((l,h)=>{const j=b(h,l),x=y(j),M=h===s.length-1,C={};return x.iconColor&&(C.color=x.iconColor),e.jsxs("div",{className:"flex flex-1 items-start",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`flex items-center justify-center ${f[t]} rounded-full border transition-all duration-300 ${x.icon}`,style:C,children:d(j,l.icon)}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("div",{className:`${r[t]} ${x.title} transition-colors duration-300`,children:l.title}),l.description&&e.jsx("div",{className:`${w[t]} ${x.description} mt-1 transition-colors duration-300`,children:l.description})]})]}),!M&&e.jsx("div",{className:`flex-1 h-0.5 mt-4 mx-2 ${x.line} transition-colors duration-300`})]},h)})}):e.jsx("div",{className:`flex flex-col ${u}`,style:$,children:s.map((l,h)=>{const j=b(h,l),x=y(j),M=h===s.length-1,C={};return x.iconColor&&(C.color=x.iconColor),e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"flex flex-col items-center mr-4",children:[e.jsx("div",{className:`flex items-center justify-center ${f[t]} rounded-full border transition-all duration-300 ${x.icon}`,style:C,children:d(j,l.icon)}),!M&&e.jsx("div",{className:`w-0.5 flex-1 my-1 ${x.line} transition-colors duration-300`,style:{minHeight:"20px"}})]}),e.jsxs("div",{className:"flex-1 pb-6",children:[e.jsx("div",{className:`${r[t]} ${x.title} transition-colors duration-300`,children:l.title}),l.description&&e.jsx("div",{className:`${w[t]} ${x.description} mt-1 transition-colors duration-300`,children:l.description})]})]},h)})})},re=({percent:s=0,status:a="normal",showInfo:n=!0,strokeColor:t,strokeWidth:c,size:u="md",className:$="",format:i,bgColor:o,successColor:m,exceptionColor:p,trackColor:g,rounded:b="full"})=>{const f=Math.min(100,Math.max(0,s)),r={sm:"h-1.5",md:"h-2",lg:"h-3",responsive:"h-1.5 sm:h-2 md:h-3 lg:h-4"},w={sm:"text-xs",md:"text-sm",lg:"text-base",responsive:"text-xs sm:text-sm md:text-base lg:text-lg"},d={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},y=()=>{if(t)return t;switch(a){case"success":return m||"bg-green-500";case"exception":return p||"bg-red-500";case"active":return o||"bg-[#EC615B]";default:return f===100?m||"bg-green-500":o||"bg-[#EC615B]"}},l=()=>g||"bg-gray-200",h=()=>a==="success"||f===100?e.jsx("svg",{className:"w-4 h-4 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):a==="exception"?e.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}):null,j=()=>i?i(f):`${Math.round(f)}%`,x=c?`${c}px`:void 0;return e.jsxs("div",{className:`flex items-center gap-2 ${$}`,children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:`w-full overflow-hidden ${r[u]} ${d[b]} ${l()}`,style:{height:x},children:e.jsx("div",{className:`${y()} ${r[u]} ${d[b]} transition-all duration-300 ease-out ${a==="active"?"progress-active":""}`,style:{width:`${f}%`,height:x}})})}),n&&e.jsx("div",{className:`flex items-center gap-1 ${w[u]} text-gray-600 font-normal`,children:h()||j()})]})},ne=({checked:s,defaultChecked:a=!1,onChange:n,disabled:t=!1,indeterminate:c=!1,size:u="md",variant:$="filled",className:i="",id:o,name:m,value:p,checkedColor:g="#EC615B",uncheckedColor:b="#ffffff",checkedBorderColor:f="#EC615B",style:r})=>{const[w,d]=P.useState(a),y=s!==void 0,l=y?s:w,h=S=>{if(t)return;const E=S.target.checked;y||d(E),n==null||n(E)},j={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",responsive:"w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6"},x={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4",responsive:"w-2.5 h-2.5 sm:w-3.5 sm:h-3.5 lg:w-4 lg:h-4"},M=$==="filled",C=()=>t?"cursor-not-allowed opacity-50 border-gray-300 bg-gray-100":!l&&!c?"border-gray-300 bg-white hover:border-gray-400":"",F=()=>{if(!t&&!(!l&&!c))return M?{borderColor:f,backgroundColor:g}:{borderColor:f,backgroundColor:b}},B=()=>M&&(l||c)?"text-white":"";return e.jsxs("div",{className:"inline-flex items-center",style:r,children:[e.jsx("input",{type:"checkbox",id:o,name:m,value:p,checked:l,onChange:h,disabled:t,className:"sr-only"}),e.jsxs("label",{htmlFor:o,className:`
|
|
20
|
+
`,style:{...v.value===z?A():{},backgroundColor:v.value===z?w||"#FCEAE9":void 0,color:v.value===z?c||"#EC615B":"#181918",fontWeight:v.value===z?"medium":void 0},onMouseEnter:D=>{!v.disabled&&v.value!==z&&(D.currentTarget.style.backgroundColor=y||"#F3F4F6")},onMouseLeave:D=>{v.value!==z&&(D.currentTarget.style.backgroundColor="transparent")},children:v.label},v.value))]})})]})},Y=({columns:s,dataSource:a,rowKey:n="id",pagination:t,loading:d=!1,onRow:u,className:$="",bordered:i=!1,striped:l=!1,size:x="md",headerBgColor:p,headerTextColor:g,rowHoverColor:b,borderColor:f,stripedRowColor:r,rounded:w="md",style:c})=>{const[y,o]=P.useState(t&&typeof t=="object"&&t.current||1),[h,j]=P.useState(t&&typeof t=="object"&&t.pageSize||10),m={sm:{headerPadding:"px-3 py-2",headerFontSize:"text-xs",rowPadding:"px-3 py-2",rowFontSize:"text-xs",containerRounded:"rounded-md"},md:{headerPadding:"px-4 py-3",headerFontSize:"text-xs",rowPadding:"px-4 py-3",rowFontSize:"text-sm",containerRounded:"rounded-lg"},lg:{headerPadding:"px-6 py-4",headerFontSize:"text-sm",rowPadding:"px-6 py-4",rowFontSize:"text-base",containerRounded:"rounded-xl"},responsive:{headerPadding:"px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",headerFontSize:"text-xs sm:text-xs md:text-sm",rowPadding:"px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",rowFontSize:"text-xs sm:text-xs md:text-sm",containerRounded:"rounded-md sm:rounded-lg md:rounded-lg"}},M={none:"",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl"},C=m[x],F=M[w],B=(k,N)=>typeof n=="function"?n(k):k[n]||String(N),S=(k,N)=>N?N.split(".").reduce((L,I)=>L==null?void 0:L[I],k):k,E=t===!1?a:a.slice((y-1)*h,y*h),z=k=>{o(k),t&&typeof t=="object"&&t.onChange&&t.onChange(k,h)},T=k=>{j(k),o(1),t&&typeof t=="object"&&t.onChange&&t.onChange(1,k)};return e.jsxs("div",{className:"w-full",style:c,children:[e.jsx("div",{className:`overflow-x-auto ${F||"rounded-2xl"} border`,style:{borderColor:f||"#EEEEEE"},children:e.jsxs("table",{className:`w-full ${i?"border-collapse":""} ${$}`,children:[e.jsx("thead",{style:{backgroundColor:p||"#F5F6F7",color:g||"#333333"},children:e.jsx("tr",{children:s.map((k,N)=>e.jsx("th",{className:`${C.headerPadding} text-left ${C.headerFontSize} font-medium uppercase tracking-wider ${i&&N!==s.length-1?"border-r":""} ${k.align==="center"?"text-center":k.align==="right"?"text-right":""}`,style:{width:k.width,borderColor:f||"#EEEEEE",color:g||"#333333"},children:k.title},k.key))})}),e.jsx("tbody",{className:"bg-white divide-y",style:{borderColor:f||"#e5e5e5"},children:d?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:`${C.rowPadding} py-8 text-center`,style:{color:"#333333"},children:e.jsxs("div",{className:"flex justify-center items-center",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]})})}):E.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:`${C.rowPadding} py-8 text-center`,style:{color:"#333333"},children:"No data"})}):E.map((k,N)=>{const L=u?u(k,N):{},I=l&&N%2===1?r||"#F5F6F7":"transparent",O=b||"#f3f4f6";return e.jsx("tr",{className:"transition-colors duration-200 ease-out",style:{backgroundColor:I},onMouseEnter:R=>{(b||!l||N%2===0)&&(R.currentTarget.style.backgroundColor=O)},onMouseLeave:R=>{R.currentTarget.style.backgroundColor=I},...L,children:s.map((R,W)=>{const A=S(k,R.dataIndex),H=R.render?R.render(A,k,N):A;return e.jsx("td",{className:`${C.rowPadding} ${C.rowFontSize} text-gray-900 ${i&&W!==s.length-1?"border-r":""} ${R.align==="center"?"text-center":R.align==="right"?"text-right":""}`,style:{borderColor:f||"#EEEEEE"},children:H},R.key)})},B(k,N))})})]})}),t!==!1&&e.jsx(Z,{current:y,pageSize:h,total:a.length,onChange:z,onPageSizeChange:T,showSizeChanger:t&&typeof t=="object"?t.showSizeChanger:!0,pageSizeOptions:t&&typeof t=="object"?t.pageSizeOptions:[10,20,50,100],showTotal:t&&typeof t=="object"?t.showTotal:!0,size:t&&typeof t=="object"&&t.size?t.size:x==="responsive"?"md":x})]})},Z=({current:s,pageSize:a,total:n,onChange:t,onPageSizeChange:d,showSizeChanger:u=!0,pageSizeOptions:$=[10,20,50,100],showTotal:i=!0,size:l="md"})=>{const x=Math.ceil(n/a),p=(s-1)*a+1,g=Math.min(s*a,n),b={sm:{button:"px-2.5 py-1 text-xs",icon:"h-3.5 w-3.5",nav:"px-1.5 py-1.5"},md:{button:"px-4 py-2 text-sm",icon:"h-5 w-5",nav:"px-2 py-2"},lg:{button:"px-5 py-2.5 text-base",icon:"h-6 w-6",nav:"px-3 py-3"}},f=()=>{const r=[];if(x<=7)for(let c=1;c<=x;c++)r.push(c);else if(s<=3){for(let c=1;c<=5;c++)r.push(c);r.push("..."),r.push(x)}else if(s>=x-2){r.push(1),r.push("...");for(let c=x-4;c<=x;c++)r.push(c)}else{r.push(1),r.push("...");for(let c=s-1;c<=s+1;c++)r.push(c);r.push("..."),r.push(x)}return r};return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#EEEEEE] sm:px-6 mt-4",children:[i&&e.jsxs("div",{className:"text-sm text-[#181918]",children:[p,"-",g," of ",n," items"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[u&&e.jsx(V,{value:a.toString(),onChange:r=>d(Number(r)),options:$.map(r=>({value:r.toString(),label:`${r} / page`})),size:"sm",className:"w-32"}),e.jsxs("nav",{className:"inline-flex gap-1 items-center","aria-label":"Pagination",children:[e.jsx("button",{onClick:()=>t(s-1),disabled:s===1,className:`relative inline-flex items-center justify-center rounded-md ${b[l].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,children:e.jsx("svg",{className:b[l].icon,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),f().map((r,w)=>r==="..."?e.jsx("span",{className:`relative inline-flex items-center justify-center ${b[l].button} font-normal text-[#181918]`,children:"..."},`ellipsis-${w}`):e.jsx("button",{onClick:()=>t(r),className:`relative inline-flex items-center justify-center rounded-md ${b[l].button} font-medium transition-all duration-300 ease-out focus:z-20 hover:scale-105 active:scale-95 ${s===r?"bg-[#EC615B] text-white shadow-sm":"text-[#181918] hover:bg-gray-100"}`,children:r},r)),e.jsx("button",{onClick:()=>t(s+1),disabled:s===x,className:`relative inline-flex items-center justify-center rounded-md ${b[l].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,children:e.jsx("svg",{className:b[l].icon,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]})]})},_=({title:s,description:a,searchPlaceholder:n="Search...",onSearch:t,actions:d,filters:u,className:$="",size:i="responsive",titleColor:l,descriptionColor:x,searchBgColor:p="white",searchBorderColor:g="#d1d5db",searchFocusBorderColor:b="#3b82f6",rounded:f="md",style:r})=>{const w=m=>{t==null||t(m.target.value)},y={sm:{titleSize:"text-lg",titleWeight:"font-semibold",descriptionSize:"text-xs",searchInputSize:"text-xs",searchInputPy:"py-1.5",searchPaddingLeft:"pl-8",iconSize:"h-4 w-4",spacing:"space-y-2",gap:"gap-2",maxWidth:"max-w-sm",descriptionMargin:"mt-0.5"},md:{titleSize:"text-xl",titleWeight:"font-semibold",descriptionSize:"text-sm",searchInputSize:"text-sm",searchInputPy:"py-2",searchPaddingLeft:"pl-10",iconSize:"h-5 w-5",spacing:"space-y-3",gap:"gap-3",maxWidth:"max-w-md",descriptionMargin:"mt-1"},lg:{titleSize:"text-2xl",titleWeight:"font-bold",descriptionSize:"text-base",searchInputSize:"text-base",searchInputPy:"py-2.5",searchPaddingLeft:"pl-12",iconSize:"h-6 w-6",spacing:"space-y-4",gap:"gap-4",maxWidth:"max-w-lg",descriptionMargin:"mt-2"},responsive:{titleSize:"text-lg sm:text-xl md:text-2xl",titleWeight:"font-semibold md:font-bold",descriptionSize:"text-xs sm:text-sm md:text-base",searchInputSize:"text-xs sm:text-sm md:text-base",searchInputPy:"py-1.5 sm:py-2 md:py-2.5",searchPaddingLeft:"pl-8 sm:pl-10 md:pl-12",iconSize:"h-4 w-4 sm:h-5 sm:w-5 md:h-6 md:w-6",spacing:"space-y-2 sm:space-y-3 md:space-y-4",gap:"gap-2 sm:gap-3 md:gap-4",maxWidth:"max-w-sm md:max-w-md lg:max-w-lg",descriptionMargin:"mt-0.5 sm:mt-1 md:mt-2"}}[i],h={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"}[f],j={backgroundColor:p,borderColor:g};return e.jsxs("div",{className:`${y.spacing} mb-4 ${$}`,style:r,children:[(s||a)&&e.jsxs("div",{children:[s&&e.jsx("h2",{className:`${y.titleSize} ${y.titleWeight}`,style:{color:l||"#111827"},children:s}),a&&e.jsx("p",{className:`${y.descriptionSize} ${y.descriptionMargin}`,style:{color:x||"#6b7280"},children:a})]}),e.jsxs("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between ${y.gap}`,children:[t&&e.jsx("div",{className:`flex-1 ${y.maxWidth}`,children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx("svg",{className:`${y.iconSize} text-gray-400`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx("input",{type:"text",placeholder:n,onChange:w,className:`block w-full ${y.searchPaddingLeft} pr-3 ${y.searchInputPy} border ${h} focus:outline-none focus:ring-2 focus:ring-opacity-50 ${y.searchInputSize} transition-colors duration-200`,style:j,onFocus:m=>{m.currentTarget.style.borderColor=b,m.currentTarget.style.boxShadow="0 0 0 2px rgba(59, 130, 246, 0.1)"},onBlur:m=>{m.currentTarget.style.borderColor=g,m.currentTarget.style.boxShadow="none"}})]})}),d&&e.jsx("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:d})]}),u&&e.jsx("div",{className:`flex flex-wrap items-center ${y.gap}`,children:u})]})},K={sm:"384px",md:"448px",lg:"512px",xl:"600px",full:"100%",responsive:"90vw"},ee=({open:s,onClose:a,title:n,children:t,footer:d,width:u,size:$="md",closable:i=!0,maskClosable:l=!0,centered:x=!0,className:p="",bgColor:g="#ffffff",headerBgColor:b="#ffffff",overlayColor:f="rgba(0, 0, 0, 0.5)",bodyClassName:r="",headerClassName:w="",maxHeight:c="70vh"})=>{const[y,o]=P.useState(!1),[h,j]=P.useState(!1),m=u||K[$],C={width:typeof m=="number"?`${m}px`:m,maxWidth:"90vw",backgroundColor:g},F={backgroundColor:b},B={backgroundColor:f};if(P.useEffect(()=>{if(s)o(!0),setTimeout(()=>j(!0),10),document.body.style.overflow="hidden";else{j(!1);const z=setTimeout(()=>{o(!1)},200);return document.body.style.overflow="unset",()=>clearTimeout(z)}},[s]),P.useEffect(()=>{const z=T=>{T.key==="Escape"&&i&&s&&a()};return s&&document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[s,a,i]),!y)return null;const S=()=>{l&&a()},E=z=>{z.stopPropagation()};return e.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",onClick:S,children:[e.jsx("div",{className:`fixed inset-0 transition-opacity duration-200 ease-out ${h?"opacity-100":"opacity-0"}`,style:B}),e.jsx("div",{className:`flex min-h-full items-center justify-center p-4 ${x?"items-center":"items-start pt-20"}`,children:e.jsxs("div",{className:`relative rounded-lg shadow-xl transition-all duration-200 ease-out overflow-y-auto ${h?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 -translate-y-4"} ${p}`,style:{...C,maxHeight:typeof c=="number"?`${c}px`:c},onClick:E,children:[(n||i)&&e.jsxs("div",{className:`flex items-center justify-between px-6 py-4 border-b border-gray-200 ${w}`,style:F,children:[n&&e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n}),i&&e.jsx("button",{onClick:a,className:"text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:`px-6 py-4 ${r}`,children:t}),d&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 flex justify-end gap-2",children:d})]})})]})},te=({children:s,variant:a="default",size:n="md",dot:t=!1,icon:d,iconPosition:u="left",className:$="",bgColor:i,textColor:l,borderColor:x,rounded:p="full",style:g})=>{const b={default:"bg-gray-100 text-[#181918]",primary:"bg-[#FCEAE9] text-[#EC615B]",success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",danger:"bg-red-100 text-red-800",info:"bg-cyan-100 text-cyan-800"},f={sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base",responsive:"px-1.5 py-0.5 text-[10px] sm:px-2 sm:py-0.5 sm:text-xs md:px-2.5 md:py-1 md:text-sm lg:px-3 lg:py-1.5 lg:text-base"},r={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5",responsive:"w-1 h-1 sm:w-1.5 sm:h-1.5 md:w-2 md:h-2 lg:w-2.5 lg:h-2.5"},w={default:"bg-gray-600",primary:"bg-[#EC615B]",success:"bg-green-600",warning:"bg-yellow-600",danger:"bg-red-600",info:"bg-cyan-600"},c={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4",responsive:"w-2.5 h-2.5 sm:w-3 sm:h-3 md:w-3.5 md:h-3.5 lg:w-4 lg:h-4"},y={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},o={...i&&{backgroundColor:i},...l&&{color:l},...x&&{borderColor:x,borderWidth:"1px",borderStyle:"solid"},...g};return e.jsxs("span",{className:`inline-flex items-center gap-1.5 font-medium transition-all duration-200 ${i?"":b[a]} ${f[n]} ${y[p]} ${$}`,style:o,children:[t&&e.jsx("span",{className:`rounded-full ${r[n]} ${w[a]}`}),d&&u==="left"&&e.jsx("span",{className:`inline-flex items-center ${c[n]}`,children:d}),s,d&&u==="right"&&e.jsx("span",{className:`inline-flex items-center ${c[n]}`,children:d})]})},se=({items:s,current:a=0,direction:n="vertical",size:t="md",variant:d="default",className:u="",style:$,finishColor:i,processColor:l,waitColor:x,errorColor:p,lineColor:g})=>{const b=(o,h)=>h.status?h.status:o<a?"finish":o===a?"process":"wait",f={sm:"w-6 h-6",md:"w-8 h-8",lg:"w-10 h-10",responsive:"w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 lg:w-10 lg:h-10"},r={sm:"text-sm",md:"text-base",lg:"text-lg",responsive:"text-xs sm:text-sm md:text-base lg:text-lg"},w={sm:"text-xs",md:"text-sm",lg:"text-base",responsive:"text-xs sm:text-xs md:text-sm lg:text-base"},c=(o,h)=>h||(o==="finish"?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):o==="error"?e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}):null),y=o=>{const h=d==="outline";switch(o){case"finish":return{icon:h?`bg-white text-white border ${i?`border-[${i}]`:"border-green-500"}`:`${i?`bg-[${i}]`:"bg-green-500"} text-white ${i?`border-[${i}]`:"border-green-500"}`,title:"text-[#181918]",description:"text-gray-600",line:g?`bg-[${g}]`:"bg-green-500",iconColor:i};case"process":return{icon:h?`bg-white text-white border ${l?`border-[${l}]`:"border-[#EC615B]"}`:`${l?`bg-[${l}]`:"bg-[#EC615B]"} text-white ${l?`border-[${l}]`:"border-[#EC615B]"}`,title:"text-[#181918] font-semibold",description:"text-gray-700",line:g?`bg-[${g}]`:"bg-gray-300",iconColor:l};case"error":return{icon:h?`bg-white text-white border ${p?`border-[${p}]`:"border-red-500"}`:`${p?`bg-[${p}]`:"bg-red-500"} text-white ${p?`border-[${p}]`:"border-red-500"}`,title:"text-red-600",description:"text-red-500",line:g?`bg-[${g}]`:"bg-gray-300",iconColor:p};default:return{icon:"bg-white text-gray-400 border-gray-300",title:"text-gray-500",description:"text-gray-400",line:g?`bg-[${g}]`:"bg-gray-300",iconColor:x}}};return n==="horizontal"?e.jsx("div",{className:`flex items-start ${u}`,style:$,children:s.map((o,h)=>{const j=b(h,o),m=y(j),M=h===s.length-1,C={};return m.iconColor&&(C.color=m.iconColor),e.jsxs("div",{className:"flex flex-1 items-start",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`flex items-center justify-center ${f[t]} rounded-full border transition-all duration-300 ${m.icon}`,style:C,children:c(j,o.icon)}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("div",{className:`${r[t]} ${m.title} transition-colors duration-300`,children:o.title}),o.description&&e.jsx("div",{className:`${w[t]} ${m.description} mt-1 transition-colors duration-300`,children:o.description})]})]}),!M&&e.jsx("div",{className:`flex-1 h-0.5 mt-4 mx-2 ${m.line} transition-colors duration-300`})]},h)})}):e.jsx("div",{className:`flex flex-col ${u}`,style:$,children:s.map((o,h)=>{const j=b(h,o),m=y(j),M=h===s.length-1,C={};return m.iconColor&&(C.color=m.iconColor),e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"flex flex-col items-center mr-4",children:[e.jsx("div",{className:`flex items-center justify-center ${f[t]} rounded-full border transition-all duration-300 ${m.icon}`,style:C,children:c(j,o.icon)}),!M&&e.jsx("div",{className:`w-0.5 flex-1 my-1 ${m.line} transition-colors duration-300`,style:{minHeight:"20px"}})]}),e.jsxs("div",{className:"flex-1 pb-6",children:[e.jsx("div",{className:`${r[t]} ${m.title} transition-colors duration-300`,children:o.title}),o.description&&e.jsx("div",{className:`${w[t]} ${m.description} mt-1 transition-colors duration-300`,children:o.description})]})]},h)})})},re=({percent:s=0,status:a="normal",showInfo:n=!0,strokeColor:t,strokeWidth:d,size:u="md",className:$="",format:i,bgColor:l,successColor:x,exceptionColor:p,trackColor:g,rounded:b="full"})=>{const f=Math.min(100,Math.max(0,s)),r={sm:"h-1.5",md:"h-2",lg:"h-3",responsive:"h-1.5 sm:h-2 md:h-3 lg:h-4"},w={sm:"text-xs",md:"text-sm",lg:"text-base",responsive:"text-xs sm:text-sm md:text-base lg:text-lg"},c={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},y=()=>{if(t)return t;switch(a){case"success":return x||"bg-green-500";case"exception":return p||"bg-red-500";case"active":return l||"bg-[#EC615B]";default:return f===100?x||"bg-green-500":l||"bg-[#EC615B]"}},o=()=>g||"bg-gray-200",h=()=>a==="success"||f===100?e.jsx("svg",{className:"w-4 h-4 text-green-500",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}):a==="exception"?e.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}):null,j=()=>i?i(f):`${Math.round(f)}%`,m=d?`${d}px`:void 0;return e.jsxs("div",{className:`flex items-center gap-2 ${$}`,children:[e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:`w-full overflow-hidden ${r[u]} ${c[b]} ${o()}`,style:{height:m},children:e.jsx("div",{className:`${y()} ${r[u]} ${c[b]} transition-all duration-300 ease-out ${a==="active"?"progress-active":""}`,style:{width:`${f}%`,height:m}})})}),n&&e.jsx("div",{className:`flex items-center gap-1 ${w[u]} text-gray-600 font-normal`,children:h()||j()})]})},ne=({checked:s,defaultChecked:a=!1,onChange:n,disabled:t=!1,indeterminate:d=!1,size:u="md",variant:$="filled",className:i="",id:l,name:x,value:p,checkedColor:g="#EC615B",uncheckedColor:b="#ffffff",checkedBorderColor:f="#EC615B",style:r})=>{const[w,c]=P.useState(a),y=s!==void 0,o=y?s:w,h=S=>{if(t)return;const E=S.target.checked;y||c(E),n==null||n(E)},j={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",responsive:"w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6"},m={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4",responsive:"w-2.5 h-2.5 sm:w-3.5 sm:h-3.5 lg:w-4 lg:h-4"},M=$==="filled",C=()=>t?"cursor-not-allowed opacity-50 border-gray-300 bg-gray-100":!o&&!d?"border-gray-300 bg-white hover:border-gray-400":"",F=()=>{if(!t&&!(!o&&!d))return M?{borderColor:f,backgroundColor:g}:{borderColor:f,backgroundColor:b}},B=()=>M&&(o||d)?"text-white":"";return e.jsxs("div",{className:"inline-flex items-center",style:r,children:[e.jsx("input",{type:"checkbox",id:l,name:x,value:p,checked:o,onChange:h,disabled:t,className:"sr-only"}),e.jsxs("label",{htmlFor:l,className:`
|
|
20
21
|
relative flex items-center justify-center
|
|
21
22
|
${j[u]}
|
|
22
23
|
${$==="outline"?"border":"border-2"}
|
|
@@ -25,14 +26,14 @@
|
|
|
25
26
|
cursor-pointer
|
|
26
27
|
${C()}
|
|
27
28
|
${i}
|
|
28
|
-
`,style:F(),children:[
|
|
29
|
+
`,style:F(),children:[o&&!d&&e.jsx("svg",{className:`${m[u]} ${B()}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:!M&&(o||d)?{color:g}:void 0,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),d&&e.jsx("svg",{className:`${m[u]} ${B()}`,fill:"currentColor",viewBox:"0 0 24 24",style:!M&&(o||d)?{color:g}:void 0,children:e.jsx("rect",{x:"4",y:"11",width:"16",height:"2",rx:"1"})})]})]})},le=(s="md")=>({sm:{container:"space-y-1",item:"px-2 py-1.5",label:"text-xs",sublabel:"text-[10px]",button:"w-5 h-5",icon:"w-3 h-3"},md:{container:"space-y-2",item:"px-4 py-3",label:"text-sm",sublabel:"text-xs",button:"w-6 h-6",icon:"w-4 h-4"},lg:{container:"space-y-3",item:"px-5 py-4",label:"text-base",sublabel:"text-sm",button:"w-7 h-7",icon:"w-5 h-5"},responsive:{container:"space-y-1 sm:space-y-2 md:space-y-3",item:"px-2 py-1.5 sm:px-3 sm:py-2 md:px-4 md:py-3 lg:px-5 lg:py-4",label:"text-xs sm:text-sm md:text-base",sublabel:"text-[10px] sm:text-xs md:text-sm",button:"w-5 h-5 sm:w-5 sm:h-5 md:w-6 md:h-6 lg:w-7 lg:h-7",icon:"w-3 h-3 sm:w-3 sm:h-3 md:w-4 md:h-4 lg:w-5 lg:h-5"}})[s],oe=(s="md")=>({none:"rounded-none",sm:"rounded-sm",md:"rounded-lg",lg:"rounded-xl",full:"rounded-full"})[s],ae=({items:s,onRemove:a,emptyMessage:n="No items selected",className:t="",itemClassName:d="",maxHeight:u="300px",size:$="md",bgColor:i,hoverBgColor:l,textColor:x,sublabelColor:p,removeButtonColor:g,removeButtonHoverColor:b,rounded:f="md",style:r})=>{const w=le($),c=oe(f),y="#F4F4F4",o="#EBEBEB",h="#181918",j="#999999",m="#9CA3AF",M="#EC615B",C=i||y,F=l||o,B=x||h,S=p||j,E=g||m,z=b||M;return s.length===0?e.jsx("div",{className:`text-center py-8 text-gray-500 text-sm ${t}`,style:{color:S,...r},children:n}):e.jsx("div",{className:`overflow-y-auto ${w.container} ${t}`,style:{maxHeight:u,...r},children:s.map((T,k)=>e.jsxs("div",{className:`
|
|
29
30
|
group flex items-center justify-between
|
|
30
|
-
${
|
|
31
|
+
${c}
|
|
31
32
|
transition-all duration-300 ease-out
|
|
32
33
|
hover:shadow-sm
|
|
33
34
|
animate-slide-in-item
|
|
34
|
-
${
|
|
35
|
-
`,style:{backgroundColor:C,animationDelay:`${
|
|
35
|
+
${d}
|
|
36
|
+
`,style:{backgroundColor:C,animationDelay:`${k*50}ms`},onMouseEnter:N=>{N.currentTarget.style.backgroundColor=F},onMouseLeave:N=>{N.currentTarget.style.backgroundColor=C},children:[e.jsxs("div",{className:`flex-1 min-w-0 ${w.item}`,children:[T.sublabel&&e.jsx("div",{className:`font-normal mb-0.5 ${w.sublabel}`,style:{color:S},children:T.sublabel}),e.jsx("div",{className:`font-medium truncate ${w.label}`,style:{color:B},children:T.label})]}),e.jsx("button",{onClick:()=>a(T.id),className:`
|
|
36
37
|
ml-3 flex-shrink-0 rounded-full
|
|
37
38
|
flex items-center justify-center
|
|
38
39
|
transition-all duration-200 ease-out
|
|
@@ -40,5 +41,5 @@
|
|
|
40
41
|
active:scale-95
|
|
41
42
|
focus:outline-none focus:ring-2 focus:ring-opacity-50
|
|
42
43
|
${w.button}
|
|
43
|
-
`,style:{color:E},onMouseEnter:
|
|
44
|
+
`,style:{color:E},onMouseEnter:N=>{N.currentTarget.style.backgroundColor="white",N.currentTarget.style.color=z},onMouseLeave:N=>{N.currentTarget.style.backgroundColor="transparent",N.currentTarget.style.color=E},"aria-label":`Remove ${T.label}`,children:e.jsx("svg",{className:w.icon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},T.id))})};exports.Badge=te;exports.Button=Q;exports.Card=J;exports.Checkbox=ne;exports.Dropdown=X;exports.Modal=ee;exports.Progress=re;exports.SearchInput=G;exports.Select=V;exports.SelectedItemsList=ae;exports.StatCard=U;exports.Steps=se;exports.Table=Y;exports.TableTop=_;
|
|
44
45
|
//# sourceMappingURL=index.cjs.map
|