@openway/ui 1.0.1 → 1.0.3

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 MAI ANH HOANG from OpenWay VietNam
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MAI ANH HOANG from OpenWay VietNam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{rankItem as xe,compareItems as ye}from"@tanstack/match-sorter-utils";function p(e,r,o){return e!=null&&Object.prototype.hasOwnProperty.call(r,e)?r[e]:r[o]}function De(e,r,o){let t=r.trim();if(!t||!e.length)return e;let l=o?Array.isArray(o)?o:[o]:[],c=[];if(l.length>0)for(let n of l)typeof n=="function"?c.push(i=>{let a=n(i);return a!=null?String(a):""}):c.push(i=>{let a=i,u=a[n];if(u!=null)return String(u);if(a.data&&typeof a.data=="object"){let d=a.data[n];if(d!=null)return String(d)}return""});else c.push(n=>{if(n&&typeof n=="object"){let i=n;return i.label!=null?String(i.label):i.value!=null?String(i.value):""}return n!=null?String(n):""});let s=[];for(let n of e){let i=xe(n,t,{accessors:c});i.passed&&s.push({item:n,info:i})}return s.sort((n,i)=>ye(n.info,i.info)),s.map(n=>n.item)}import{jsx as U,jsxs as he}from"react/jsx-runtime";function I({width:e=16,height:r=16,className:o="",...t}){return he("svg",{width:e,height:r,className:`animate-[spin_1s_steps(8)_infinite] ${o}`,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[U("path",{d:"M0 0h25v24H0z",fill:"none"}),U("path",{fill:"currentColor",d:"M4.818 6.664h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541h-.029zm-2.97 7.182h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.278.541h-.031h.002zM12 3.692a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zM4.818 21.029h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.276.541h-.031zM19.182 7.125a2.308 2.308 0 1 1 0-4.615a2.308 2.308 0 0 1 0 4.615M12 24a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zm10.154-9.231h-.048c-.75 0-1.428-.309-1.913-.807l-.001-.001c-.499-.503-.808-1.196-.808-1.961s.308-1.458.808-1.962a2.66 2.66 0 0 1 1.914-.808h.05h-.003h.048c.75 0 1.427.309 1.913.807l.001.001c.499.503.808 1.196.808 1.961s-.308 1.458-.808 1.962a2.66 2.66 0 0 1-1.915.809h-.049zm-2.971 7.643h-.05a3.1 3.1 0 0 1-2.236-.951l-.001-.001c-.584-.584-.945-1.391-.945-2.283s.361-1.698.945-2.283a3.1 3.1 0 0 1 2.234-.945h.054h-.003h.042c.877 0 1.67.362 2.237.944l.001.001c.588.582.952 1.39.952 2.283s-.364 1.7-.952 2.282a3.1 3.1 0 0 1-2.24.953h-.04z"})]})}import{jsx as $}from"react/jsx-runtime";function P({width:e=14,height:r=14,className:o="",...t}){return $("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:o,...t,children:$("path",{d:"M18 6 6 18M6 6l12 12"})})}import{jsx as V,jsxs as Te}from"react/jsx-runtime";function S({width:e=20,height:r=20,className:o="",...t}){return Te("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,...t,children:[V("circle",{cx:"12",cy:"12",r:"10"}),V("path",{d:"M12 16v-4"}),V("path",{d:"M12 8h.01"})]})}import{jsx as K,jsxs as we}from"react/jsx-runtime";function z({width:e=20,height:r=20,className:o="",...t}){return we("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,...t,children:[K("circle",{cx:"12",cy:"12",r:"10"}),K("path",{d:"m9 12 2 2 4-4"})]})}import{jsx as L,jsxs as ve}from"react/jsx-runtime";function D({width:e=20,height:r=20,className:o="",...t}){return ve("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,...t,children:[L("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),L("path",{d:"M12 9v4"}),L("path",{d:"M12 17h.01"})]})}import{jsx as B,jsxs as Se}from"react/jsx-runtime";function _({width:e=20,height:r=20,className:o="",...t}){return Se("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:o,...t,children:[B("circle",{cx:"12",cy:"12",r:"10"}),B("path",{d:"M12 8v4"}),B("path",{d:"M12 16h.01"})]})}var W={xs:{container:"p-2 gap-2 text-xs",title:"text-xs font-semibold leading-tight",description:"text-[11px] leading-tight",icon:"size-3.5 mt-0.5",closeButton:"size-4 p-0.5 -mr-0.5",closeIcon:"size-3",action:"gap-1.5 text-xs"},sm:{container:"p-2.5 gap-2.5 text-xs",title:"text-sm font-semibold leading-tight",description:"text-xs leading-normal",icon:"size-4 mt-0.5",closeButton:"size-5 p-0.5 -mr-0.5",closeIcon:"size-3.5",action:"gap-1.5 text-xs"},md:{container:"p-3.5 gap-3 text-sm",title:"text-sm font-semibold leading-tight",description:"text-sm leading-normal",icon:"size-5 mt-0.5",closeButton:"size-6 p-1 -mr-1",closeIcon:"size-4",action:"gap-2 text-sm"},lg:{container:"p-4 gap-3.5 text-base",title:"text-base font-semibold leading-snug",description:"text-sm leading-normal",icon:"size-6 mt-0.5",closeButton:"size-7 p-1.5 -mr-1.5",closeIcon:"size-4.5",action:"gap-2.5 text-sm"},xl:{container:"p-5 gap-4 text-lg",title:"text-lg font-semibold leading-snug",description:"text-base leading-normal",icon:"size-7 mt-0.5",closeButton:"size-8 p-1.5 -mr-1.5",closeIcon:"size-5",action:"gap-3 text-base"}},H={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Z={soft:{primary:"bg-primary-50 text-primary-900 border-2 border-primary-200",secondary:"bg-secondary-50 text-secondary-900 border-2 border-secondary-200",neutral:"bg-neutral-100 text-neutral-900 border-2 border-neutral-200",error:"bg-error-50 text-error-900 border-2 border-error-200",success:"bg-success-50 text-success-900 border-2 border-success-200",warning:"bg-warning-50 text-warning-900 border-2 border-warning-200",info:"bg-info-50 text-info-900 border-2 border-info-200"},filled:{primary:"bg-primary-600 text-white border-2 border-primary-600",secondary:"bg-secondary-600 text-white border-2 border-secondary-600",neutral:"bg-neutral-700 text-white border-2 border-neutral-700",error:"bg-error-600 text-white border-2 border-error-600",success:"bg-success-600 text-white border-2 border-success-600",warning:"bg-warning-500 text-neutral-950 border-2 border-warning-500",info:"bg-info-600 text-white border-2 border-info-600"},outline:{primary:"bg-neutral-white text-primary-700 border-2 border-primary-400",secondary:"bg-neutral-white text-secondary-700 border-2 border-secondary-400",neutral:"bg-neutral-white text-neutral-700 border-2 border-neutral-300",error:"bg-neutral-white text-error-700 border-2 border-error-500",success:"bg-neutral-white text-success-700 border-2 border-success-400",warning:"bg-neutral-white text-warning-800 border-2 border-warning-400",info:"bg-neutral-white text-info-700 border-2 border-info-400"},"accent-left":{primary:"bg-primary-50/70 text-primary-900 border-2 border-primary-200 border-l-4 border-l-primary-500",secondary:"bg-secondary-50/70 text-secondary-900 border-2 border-secondary-200 border-l-4 border-l-secondary-500",neutral:"bg-neutral-50/70 text-neutral-900 border-2 border-neutral-200 border-l-4 border-l-neutral-500",error:"bg-error-50/70 text-error-900 border-2 border-error-200 border-l-4 border-l-error-500",success:"bg-success-50/70 text-success-900 border-2 border-success-200 border-l-4 border-l-success-500",warning:"bg-warning-50/70 text-warning-900 border-2 border-warning-200 border-l-4 border-l-warning-500",info:"bg-info-50/70 text-info-900 border-2 border-info-200 border-l-4 border-l-info-500"},ghost:{primary:"bg-transparent text-primary-800 border-2 border-transparent",secondary:"bg-transparent text-secondary-800 border-2 border-transparent",neutral:"bg-transparent text-neutral-800 border-2 border-transparent",error:"bg-transparent text-error-700 border-2 border-transparent",success:"bg-transparent text-success-700 border-2 border-transparent",warning:"bg-transparent text-warning-800 border-2 border-transparent",info:"bg-transparent text-info-800 border-2 border-transparent"}},Y={soft:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},filled:{primary:"text-white",secondary:"text-white",neutral:"text-white",error:"text-white",success:"text-white",warning:"text-neutral-950",info:"text-white"},outline:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},"accent-left":{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},ghost:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"}},X={primary:S,secondary:S,neutral:S,info:S,success:z,warning:D,error:_};import{jsx as h,jsxs as q}from"react/jsx-runtime";function O({size:e,variant:r,color:o,radius:t,title:l,description:c,icon:s=!0,action:n,closable:i=!0,onClose:a,closeAriaLabel:u="\u0110\xF3ng c\u1EA3nh b\xE1o",banner:d=!1,titleClassName:b="",descriptionClassName:x="",actionClassName:v="",iconClassName:f="",closeButtonClassName:w="",className:A="",children:N,role:E,ref:se,...ie}){let y=p(e,W,"md"),ae=d?"rounded-none border-x-0 w-full":p(t,H,"lg"),le=r==="other"?"":p(o,p(r,Z,"soft"),"info"),ce=r==="other"?"":p(o,p(r,Y,"soft"),"info"),de=i||!!a,ue=k=>{k.stopPropagation(),a?.()},fe=E||(o==="error"||o==="warning"?"alert":"status"),pe=o==="error"||o==="warning"?"assertive":"polite",F=c??N,ge=!!F,me=()=>{if(s===!1)return null;if(s!==!0&&s!==void 0)return h("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon} ${f}`,"aria-hidden":"true",children:s});let k=p(o,X,"info");return h("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon} ${ce} ${f}`,"aria-hidden":"true",children:h(k,{className:"size-full"})})},be=["relative flex w-full",y.container,ae,le,A].filter(Boolean).join(" ");return q("div",{ref:se,role:fe,"aria-live":pe,className:be,...ie,children:[me(),q("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[l&&h("div",{className:`${y.title} ${b}`,children:l}),ge&&h("div",{className:`${y.description} ${l?"mt-0.5":""} ${x}`,children:F})]}),n&&h("div",{className:`inline-flex items-center shrink-0 ${y.action} ${v}`,children:n}),de&&h("button",{type:"button",onClick:ue,"aria-label":u,className:`inline-flex items-center justify-center shrink-0 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-current opacity-70 hover:opacity-100 ${r==="filled"?"hover:bg-white/20 active:bg-white/30":"hover:bg-black/5 active:bg-black/10"} ${y.closeButton} ${w}`,children:h(P,{className:y.closeIcon})})]})}var m=4e3;import{Toaster as Re}from"sonner";import{jsx as Ce}from"react/jsx-runtime";function J({position:e="top-right",visibleToasts:r=3,expand:o=!1,duration:t=4e3,closeButton:l=!1,className:c="",toastOptions:s,...n}){return Ce(Re,{position:e,visibleToasts:r,expand:o,duration:t,closeButton:l,className:`toaster group ${c}`,toastOptions:{unstyled:!0,className:"w-full max-w-md pointer-events-auto",...s},...n})}import{isValidElement as Ae}from"react";import{toast as R}from"sonner";import{jsx as G}from"react/jsx-runtime";function T(e,r="info",o="soft",t,l={},c){let{duration:s,position:n,onDismiss:i,onAutoClose:a,...u}=l;return R.custom(d=>G(O,{color:r,variant:o,title:e,description:t,closable:u.closable??!0,onClose:()=>{u.onClose?.(),R.dismiss(d)},...u}),{id:c,duration:s??4e3,position:n,onDismiss:i,onAutoClose:a})}function Ne(e){return typeof e=="object"&&e!==null&&!Ae(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function j(e,r,o){return Ne(e)?{title:e.title??"",description:e.description,color:e.color??r,variant:e.variant??o}:{title:e,description:void 0,color:r,variant:o}}var g=((e,r,o)=>{let t=o||{};return T(e,t.color||"info",t.variant||"soft",r,t)});g.custom=(e,r={})=>{if(typeof e=="function")return R.custom(n=>e(n),{duration:r.duration??4e3,position:r.position,onDismiss:r.onDismiss,onAutoClose:r.onAutoClose});let{duration:o,position:t,onDismiss:l,onAutoClose:c,...s}=e;return R.custom(n=>G(O,{closable:s.closable??!0,onClose:()=>{s.onClose?.(),R.dismiss(n)},...s}),{duration:o??4e3,position:t,onDismiss:l,onAutoClose:c})};g.success=(e,r,o)=>{let t=o||{};return T(e,t.color||"success",t.variant||"soft",r,t)};g.error=(e,r,o)=>{let t=o||{};return T(e,t.color||"error",t.variant||"soft",r,t)};g.warning=(e,r,o)=>{let t=o||{};return T(e,t.color||"warning",t.variant||"soft",r,t)};g.info=(e,r,o)=>{let t=o||{};return T(e,t.color||"info",t.variant||"soft",r,t)};g.loading=(e,r,o)=>{let t=o||{};return T(e,t.color||"info",t.variant||"soft",r,{...t,icon:t.icon??G(I,{className:"size-full animate-spin"}),duration:t.duration??1/0,closable:t.closable??!1})};g.promise=async(e,r)=>{let o=typeof e=="function"?e():e,{title:t,description:l}=j(r.loading,"info",r.variant||"soft"),c=g.loading(t,l,{size:r.size,variant:r.variant,radius:r.radius});try{let s=await o,n=typeof r.success=="function"?r.success(s):r.success,{title:i,description:a,color:u,variant:d}=j(n,"success",r.variant||"soft");return T(i,u,d,a,{duration:r.duration??4e3,size:r.size,radius:r.radius},c),s}catch(s){let n=typeof r.error=="function"?r.error(s):r.error,{title:i,description:a,color:u,variant:d}=j(n,"error",r.variant||"soft");throw T(i,u,d,a,{duration:r.duration??4e3,size:r.size,radius:r.radius},c),s}finally{r.finally&&await r.finally()}};g.dismiss=e=>R.dismiss(e);var Ee=g;var Oe={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60,SELECT_FILTER:100,MAX:99999};import{useEffect as ke,useState as Ie}from"react";function Or(e,r=300){let[o,t]=Ie(e);return ke(()=>{let l=setTimeout(()=>{t(e)},r);return()=>{clearTimeout(l)}},[e,r]),o}import{useCallback as ee,useEffect as re,useRef as Pe,useState as te}from"react";function Pr({onLoadMore:e,hasMore:r=!0,isLoading:o=!1,disabled:t=!1,rootMargin:l="100px",threshold:c=0,root:s=null}){let[n,i]=te(!1),[a,u]=te(null),d=Pe(!1),b=r&&!o&&!t,x=ee(()=>{if(!(!b||d.current)){d.current=!0;try{let f=e();f&&typeof f.then=="function"?f.finally(()=>{d.current=!1}):d.current=!1}catch{d.current=!1}}},[b,e]),v=ee(f=>{u(f)},[]);return re(()=>{if(!a||t||!r||typeof window>"u"||!("IntersectionObserver"in window))return;let f=s&&typeof s=="object"&&"current"in s?s.current:s,w=new IntersectionObserver(A=>{let[N]=A;if(!N)return;let E=N.isIntersecting;i(E),E&&x()},{root:f,rootMargin:l,threshold:c});return w.observe(a),()=>{w.disconnect(),i(!1)}},[a,s,l,c,t,r,x]),re(()=>{b&&n&&x()},[b,n,x]),{sentinelRef:v,isIntersecting:n}}var oe={pulse:"animate-pulse",wave:"skeleton-wave",none:""},ne={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},zr={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"};var C=e=>e,Dr=e=>e?typeof e=="string"?e:typeof File<"u"&&e instanceof File?`${e.name}-${e.size}-${e.lastModified}`:typeof Blob<"u"&&e instanceof Blob?`${e.size}-${e.type}`:typeof e=="object"&&"src"in e&&typeof e.src=="string"?e.src:e:"";import{jsx as M}from"react/jsx-runtime";function Ve({ref:e,variant:r="pulse",shape:o="rectangle",radius:t="md",width:l,height:c="1rem",lines:s=1,gap:n="0.5rem",className:i="",style:a,...u}){let d=p(r,oe,"pulse"),b=o==="circle"?"rounded-full":p(t,ne,"md"),x={width:C(l),height:C(c),...a},v=["bg-neutral-200",d,b].filter(Boolean).join(" ");return s>1?M("div",{ref:e,role:"status","aria-label":"Loading...",className:["flex flex-col",i].filter(Boolean).join(" "),style:{gap:C(n),...a},...u,children:Array.from({length:s}).map((f,w)=>{let A=w===s-1;return M("div",{className:v,style:{width:A?"60%":C(l)??"100%",height:C(c)}},w)})}):M("div",{ref:e,role:"status","aria-label":"Loading...",className:[v,i].filter(Boolean).join(" "),style:x,...u})}var Ur={sm:{head:"px-3 py-2 text-xs font-semibold",cell:"px-3 py-2 text-xs",text:"text-xs",icon:"w-3.5 h-3.5"},md:{head:"px-4 py-3 text-sm font-semibold",cell:"px-4 py-3 text-sm",text:"text-sm",icon:"w-4 h-4"},lg:{head:"px-5 py-4 text-base font-semibold",cell:"px-5 py-4 text-base",text:"text-base",icon:"w-5 h-5"}},$r={default:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-50/80 border-b border-neutral-200 text-neutral-600",row:"border-b border-neutral-200/80 hover:bg-neutral-50/50 transition-colors",cell:"text-neutral-700"},striped:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-100/80 border-b border-neutral-200 text-neutral-700",row:"border-b border-neutral-200/80 even:bg-neutral-50/60 hover:bg-neutral-100/40 transition-colors",cell:"text-neutral-700"},bordered:{container:"border border-neutral-200 shadow-xs",table:"border-collapse border border-neutral-200",head:"bg-neutral-50 border border-neutral-200 text-neutral-700",row:"border-b border-neutral-200 hover:bg-neutral-50/50 transition-colors",cell:"border border-neutral-200 text-neutral-700"}},Kr={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},Wr=[10,20,50,100],Hr=10;export{p as a,De as b,I as c,P as d,Oe as e,S as f,z as g,D as h,_ as i,O as j,m as k,J as l,Ee as m,Or as n,Pr as o,ne as p,zr as q,Dr as r,Ve as s,Ur as t,$r as u,Kr as v,Wr as w,Hr as x};
3
+ //# sourceMappingURL=chunk-XM7AABEU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/function.ts","../src/components/icons/Spinner.tsx","../src/components/icons/CloseIcon.tsx","../src/components/icons/InfoCircleIcon.tsx","../src/components/icons/CheckCircleIcon.tsx","../src/components/icons/AlertTriangleIcon.tsx","../src/components/icons/AlertCircleIcon.tsx","../src/components/alert/constants.ts","../src/components/alert/Alert.tsx","../src/components/toast/constants.ts","../src/components/toast/Toaster.tsx","../src/components/toast/toast.tsx","../src/constants/constants.ts","../src/hooks/useDebounce.ts","../src/hooks/useInfiniteScroll.ts","../src/components/skeleton/constants.ts","../src/components/skeleton/utils.ts","../src/components/skeleton/Skeleton.tsx","../src/components/table/constants.ts"],"sourcesContent":["import { rankItem, compareItems } from \"@tanstack/match-sorter-utils\";\r\n\r\n/**\r\n * Lấy cấu hình tương ứng theo `key` từ đối tượng `configMap` (sizeConfig, radiusConfig, variantConfig, colorConfig...),\r\n * nếu `key` không hợp lệ hoặc không tồn tại trong `configMap`, sẽ trả về giá trị an toàn của `fallbackKey`.\r\n *\r\n * @param key - Khóa được truyền vào (size, radius, variant... có thể undefined, null hoặc chuỗi bất kỳ)\r\n * @param configMap - Đối tượng ánh xạ cấu hình\r\n * @param fallbackKey - Khóa dự phòng khi không tìm thấy (fallback an toàn)\r\n * @returns Cấu hình tương ứng của khóa đó\r\n */\r\nexport function getSafeConfig<TConfig, TKey extends PropertyKey = string>(\r\n key: TKey | undefined | null,\r\n configMap: Record<TKey, TConfig>,\r\n fallbackKey: TKey\r\n): TConfig {\r\n if (key != null && Object.prototype.hasOwnProperty.call(configMap, key)) {\r\n return configMap[key];\r\n }\r\n return configMap[fallbackKey];\r\n}\r\n\r\n/**\r\n * Lọc và xếp hạng danh sách phần tử theo từ khóa tìm kiếm (Fuzzy Search qua @tanstack/match-sorter-utils).\r\n *\r\n * @param items - Danh sách các phần tử cần lọc\r\n * @param query - Từ khóa tìm kiếm\r\n * @param fields - Một trường hoặc danh sách các trường (hoặc hàm accessor) để so khớp\r\n * @returns Danh sách phần tử khớp, đã được sắp xếp theo độ tương quan cao nhất\r\n */\r\nexport function rankAndFilterItems<T>(\r\n items: T[],\r\n query: string,\r\n fields?: (keyof T | string | ((item: T) => string | undefined | null))[] | (keyof T | string)\r\n): T[] {\r\n const keyword = query.trim();\r\n if (!keyword || !items.length) {\r\n return items;\r\n }\r\n\r\n const fieldsArray = fields ? (Array.isArray(fields) ? fields : [fields]) : [];\r\n const accessors: ((item: T) => string)[] = [];\r\n\r\n if (fieldsArray.length > 0) {\r\n for (const field of fieldsArray) {\r\n if (typeof field === \"function\") {\r\n accessors.push((item: T) => {\r\n const res = field(item);\r\n return res != null ? String(res) : \"\";\r\n });\r\n } else {\r\n accessors.push((item: T) => {\r\n const record = item as Record<string, unknown>;\r\n const val = record[field as string];\r\n if (val != null) return String(val);\r\n if (record.data && typeof record.data === \"object\") {\r\n const dataVal = (record.data as Record<string, unknown>)[field as string];\r\n if (dataVal != null) return String(dataVal);\r\n }\r\n return \"\";\r\n });\r\n }\r\n }\r\n } else {\r\n // Mặc định: kiểm tra trường 'label', 'value' nếu là object, hoặc ép kiểu string\r\n accessors.push((item: T) => {\r\n if (item && typeof item === \"object\") {\r\n const record = item as Record<string, unknown>;\r\n return record.label != null\r\n ? String(record.label)\r\n : record.value != null\r\n ? String(record.value)\r\n : \"\";\r\n }\r\n return item != null ? String(item) : \"\";\r\n });\r\n }\r\n\r\n const ranked: { item: T; info: ReturnType<typeof rankItem> }[] = [];\r\n for (const item of items) {\r\n const info = rankItem(item, keyword, { accessors });\r\n if (info.passed) {\r\n ranked.push({ item, info });\r\n }\r\n }\r\n\r\n ranked.sort((a, b) => compareItems(a.info, b.info));\r\n return ranked.map((r) => r.item);\r\n}\r\n","import type { SVGProps } from \"react\";\r\n\r\nexport default function Spinner({ width = 16, height = 16, className = \"\", ...props }: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg\r\n width={width}\r\n height={height}\r\n className={`animate-[spin_1s_steps(8)_infinite] ${className}`}\r\n viewBox=\"0 0 25 24\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n {...props}\r\n >\r\n <path d=\"M0 0h25v24H0z\" fill=\"none\" />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M4.818 6.664h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541h-.029zm-2.97 7.182h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.278.541h-.031h.002zM12 3.692a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zM4.818 21.029h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.276.541h-.031zM19.182 7.125a2.308 2.308 0 1 1 0-4.615a2.308 2.308 0 0 1 0 4.615M12 24a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zm10.154-9.231h-.048c-.75 0-1.428-.309-1.913-.807l-.001-.001c-.499-.503-.808-1.196-.808-1.961s.308-1.458.808-1.962a2.66 2.66 0 0 1 1.914-.808h.05h-.003h.048c.75 0 1.427.309 1.913.807l.001.001c.499.503.808 1.196.808 1.961s-.308 1.458-.808 1.962a2.66 2.66 0 0 1-1.915.809h-.049zm-2.971 7.643h-.05a3.1 3.1 0 0 1-2.236-.951l-.001-.001c-.584-.584-.945-1.391-.945-2.283s.361-1.698.945-2.283a3.1 3.1 0 0 1 2.234-.945h.054h-.003h.042c.877 0 1.67.362 2.237.944l.001.001c.588.582.952 1.39.952 2.283s-.364 1.7-.952 2.282a3.1 3.1 0 0 1-2.24.953h-.04z\"\r\n />\r\n </svg>\r\n );\r\n}\r\n","import type { SVGProps } from \"react\";\r\n\r\nexport default function CloseIcon({ width = 14, height = 14, className = \"\", ...props }: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg\r\n width={width}\r\n height={height}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2.5\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n {...props}\r\n >\r\n <path d=\"M18 6 6 18M6 6l12 12\" />\r\n </svg>\r\n );\r\n}\r\n","import type { SVGProps } from \"react\";\r\n\r\nexport default function InfoCircleIcon({ width = 20, height = 20, className = \"\", ...props }: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg\r\n width={width}\r\n height={height}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n {...props}\r\n >\r\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\r\n <path d=\"M12 16v-4\" />\r\n <path d=\"M12 8h.01\" />\r\n </svg>\r\n );\r\n}\r\n","import type { SVGProps } from \"react\";\r\n\r\nexport default function CheckCircleIcon({\r\n width = 20,\r\n height = 20,\r\n className = \"\",\r\n ...props\r\n}: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg\r\n width={width}\r\n height={height}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n {...props}\r\n >\r\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\r\n <path d=\"m9 12 2 2 4-4\" />\r\n </svg>\r\n );\r\n}\r\n","import type { SVGProps } from \"react\";\r\n\r\nexport default function AlertTriangleIcon({\r\n width = 20,\r\n height = 20,\r\n className = \"\",\r\n ...props\r\n}: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg\r\n width={width}\r\n height={height}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n {...props}\r\n >\r\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\" />\r\n <path d=\"M12 9v4\" />\r\n <path d=\"M12 17h.01\" />\r\n </svg>\r\n );\r\n}\r\n","import type { SVGProps } from \"react\";\r\n\r\nexport default function AlertCircleIcon({\r\n width = 20,\r\n height = 20,\r\n className = \"\",\r\n ...props\r\n}: SVGProps<SVGSVGElement>) {\r\n return (\r\n <svg\r\n width={width}\r\n height={height}\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n className={className}\r\n {...props}\r\n >\r\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\r\n <path d=\"M12 8v4\" />\r\n <path d=\"M12 16h.01\" />\r\n </svg>\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { AlertColor, AlertRadius, AlertSize, AlertVariant } from \"./types\";\r\nimport InfoCircleIcon from \"../icons/InfoCircleIcon\";\r\nimport CheckCircleIcon from \"../icons/CheckCircleIcon\";\r\nimport AlertTriangleIcon from \"../icons/AlertTriangleIcon\";\r\nimport AlertCircleIcon from \"../icons/AlertCircleIcon\";\r\n\r\n\r\nexport const sizeConfig: Record<\r\n AlertSize,\r\n {\r\n container: string;\r\n title: string;\r\n description: string;\r\n icon: string;\r\n closeButton: string;\r\n closeIcon: string;\r\n action: string;\r\n }\r\n> = {\r\n xs: {\r\n container: \"p-2 gap-2 text-xs\",\r\n title: \"text-xs font-semibold leading-tight\",\r\n description: \"text-[11px] leading-tight\",\r\n icon: \"size-3.5 mt-0.5\",\r\n closeButton: \"size-4 p-0.5 -mr-0.5\",\r\n closeIcon: \"size-3\",\r\n action: \"gap-1.5 text-xs\",\r\n },\r\n sm: {\r\n container: \"p-2.5 gap-2.5 text-xs\",\r\n title: \"text-sm font-semibold leading-tight\",\r\n description: \"text-xs leading-normal\",\r\n icon: \"size-4 mt-0.5\",\r\n closeButton: \"size-5 p-0.5 -mr-0.5\",\r\n closeIcon: \"size-3.5\",\r\n action: \"gap-1.5 text-xs\",\r\n },\r\n md: {\r\n container: \"p-3.5 gap-3 text-sm\",\r\n title: \"text-sm font-semibold leading-tight\",\r\n description: \"text-sm leading-normal\",\r\n icon: \"size-5 mt-0.5\",\r\n closeButton: \"size-6 p-1 -mr-1\",\r\n closeIcon: \"size-4\",\r\n action: \"gap-2 text-sm\",\r\n },\r\n lg: {\r\n container: \"p-4 gap-3.5 text-base\",\r\n title: \"text-base font-semibold leading-snug\",\r\n description: \"text-sm leading-normal\",\r\n icon: \"size-6 mt-0.5\",\r\n closeButton: \"size-7 p-1.5 -mr-1.5\",\r\n closeIcon: \"size-4.5\",\r\n action: \"gap-2.5 text-sm\",\r\n },\r\n xl: {\r\n container: \"p-5 gap-4 text-lg\",\r\n title: \"text-lg font-semibold leading-snug\",\r\n description: \"text-base leading-normal\",\r\n icon: \"size-7 mt-0.5\",\r\n closeButton: \"size-8 p-1.5 -mr-1.5\",\r\n closeIcon: \"size-5\",\r\n action: \"gap-3 text-base\",\r\n },\r\n};\r\n\r\nexport const radiusConfig: Record<AlertRadius, string> = {\r\n none: \"rounded-none\",\r\n sm: \"rounded-sm\",\r\n md: \"rounded-md\",\r\n lg: \"rounded-lg\",\r\n xl: \"rounded-xl\",\r\n full: \"rounded-2xl\",\r\n};\r\n\r\nexport const variantColorConfig: Record<Exclude<AlertVariant, \"other\">, Record<AlertColor, string>> = {\r\n soft: {\r\n primary: \"bg-primary-50 text-primary-900 border-2 border-primary-200\",\r\n secondary: \"bg-secondary-50 text-secondary-900 border-2 border-secondary-200\",\r\n neutral: \"bg-neutral-100 text-neutral-900 border-2 border-neutral-200\",\r\n error: \"bg-error-50 text-error-900 border-2 border-error-200\",\r\n success: \"bg-success-50 text-success-900 border-2 border-success-200\",\r\n warning: \"bg-warning-50 text-warning-900 border-2 border-warning-200\",\r\n info: \"bg-info-50 text-info-900 border-2 border-info-200\",\r\n },\r\n filled: {\r\n primary: \"bg-primary-600 text-white border-2 border-primary-600\",\r\n secondary: \"bg-secondary-600 text-white border-2 border-secondary-600\",\r\n neutral: \"bg-neutral-700 text-white border-2 border-neutral-700\",\r\n error: \"bg-error-600 text-white border-2 border-error-600\",\r\n success: \"bg-success-600 text-white border-2 border-success-600\",\r\n warning: \"bg-warning-500 text-neutral-950 border-2 border-warning-500\",\r\n info: \"bg-info-600 text-white border-2 border-info-600\",\r\n },\r\n outline: {\r\n primary: \"bg-neutral-white text-primary-700 border-2 border-primary-400\",\r\n secondary: \"bg-neutral-white text-secondary-700 border-2 border-secondary-400\",\r\n neutral: \"bg-neutral-white text-neutral-700 border-2 border-neutral-300\",\r\n error: \"bg-neutral-white text-error-700 border-2 border-error-500\",\r\n success: \"bg-neutral-white text-success-700 border-2 border-success-400\",\r\n warning: \"bg-neutral-white text-warning-800 border-2 border-warning-400\",\r\n info: \"bg-neutral-white text-info-700 border-2 border-info-400\",\r\n },\r\n \"accent-left\": {\r\n primary: \"bg-primary-50/70 text-primary-900 border-2 border-primary-200 border-l-4 border-l-primary-500\",\r\n secondary: \"bg-secondary-50/70 text-secondary-900 border-2 border-secondary-200 border-l-4 border-l-secondary-500\",\r\n neutral: \"bg-neutral-50/70 text-neutral-900 border-2 border-neutral-200 border-l-4 border-l-neutral-500\",\r\n error: \"bg-error-50/70 text-error-900 border-2 border-error-200 border-l-4 border-l-error-500\",\r\n success: \"bg-success-50/70 text-success-900 border-2 border-success-200 border-l-4 border-l-success-500\",\r\n warning: \"bg-warning-50/70 text-warning-900 border-2 border-warning-200 border-l-4 border-l-warning-500\",\r\n info: \"bg-info-50/70 text-info-900 border-2 border-info-200 border-l-4 border-l-info-500\",\r\n },\r\n ghost: {\r\n primary: \"bg-transparent text-primary-800 border-2 border-transparent\",\r\n secondary: \"bg-transparent text-secondary-800 border-2 border-transparent\",\r\n neutral: \"bg-transparent text-neutral-800 border-2 border-transparent\",\r\n error: \"bg-transparent text-error-700 border-2 border-transparent\",\r\n success: \"bg-transparent text-success-700 border-2 border-transparent\",\r\n warning: \"bg-transparent text-warning-800 border-2 border-transparent\",\r\n info: \"bg-transparent text-info-800 border-2 border-transparent\",\r\n },\r\n};\r\n\r\nexport const iconColorConfig: Record<Exclude<AlertVariant, \"other\">, Record<AlertColor, string>> = {\r\n soft: {\r\n primary: \"text-primary-600\",\r\n secondary: \"text-secondary-600\",\r\n neutral: \"text-neutral-600\",\r\n error: \"text-error-600\",\r\n success: \"text-success-600\",\r\n warning: \"text-warning-600\",\r\n info: \"text-info-600\",\r\n },\r\n filled: {\r\n primary: \"text-white\",\r\n secondary: \"text-white\",\r\n neutral: \"text-white\",\r\n error: \"text-white\",\r\n success: \"text-white\",\r\n warning: \"text-neutral-950\",\r\n info: \"text-white\",\r\n },\r\n outline: {\r\n primary: \"text-primary-600\",\r\n secondary: \"text-secondary-600\",\r\n neutral: \"text-neutral-600\",\r\n error: \"text-error-600\",\r\n success: \"text-success-600\",\r\n warning: \"text-warning-600\",\r\n info: \"text-info-600\",\r\n },\r\n \"accent-left\": {\r\n primary: \"text-primary-600\",\r\n secondary: \"text-secondary-600\",\r\n neutral: \"text-neutral-600\",\r\n error: \"text-error-600\",\r\n success: \"text-success-600\",\r\n warning: \"text-warning-600\",\r\n info: \"text-info-600\",\r\n },\r\n ghost: {\r\n primary: \"text-primary-600\",\r\n secondary: \"text-secondary-600\",\r\n neutral: \"text-neutral-600\",\r\n error: \"text-error-600\",\r\n success: \"text-success-600\",\r\n warning: \"text-warning-600\",\r\n info: \"text-info-600\",\r\n },\r\n};\r\n\r\nexport const defaultIcons: Record<AlertColor, React.ComponentType<{ className?: string }>> = {\r\n primary: InfoCircleIcon,\r\n secondary: InfoCircleIcon,\r\n neutral: InfoCircleIcon,\r\n info: InfoCircleIcon,\r\n success: CheckCircleIcon,\r\n warning: AlertTriangleIcon,\r\n error: AlertCircleIcon,\r\n};","import { MouseEvent } from \"react\";\r\nimport { AlertProps } from \"./types\";\r\nimport { sizeConfig, radiusConfig, variantColorConfig, iconColorConfig, defaultIcons } from \"./constants\";\r\nimport CloseIcon from \"../icons/CloseIcon\";\r\nimport { getSafeConfig } from \"@/utils/function\";\r\n\r\nexport default function Alert({\r\n size,\r\n variant,\r\n color,\r\n radius,\r\n title,\r\n description,\r\n icon = true,\r\n action,\r\n closable = true,\r\n onClose,\r\n closeAriaLabel = \"Đóng cảnh báo\",\r\n banner = false,\r\n titleClassName = \"\",\r\n descriptionClassName = \"\",\r\n actionClassName = \"\",\r\n iconClassName = \"\",\r\n closeButtonClassName = \"\",\r\n className = \"\",\r\n children,\r\n role,\r\n ref,\r\n ...props\r\n}: AlertProps) {\r\n\r\n const currentSize = getSafeConfig(size, sizeConfig, \"md\");\r\n\r\n const roundedClass = banner ? \"rounded-none border-x-0 w-full\" : getSafeConfig(radius, radiusConfig, \"lg\");\r\n\r\n const variantStyles = variant === \"other\" ? \"\" : getSafeConfig(color, getSafeConfig(variant, variantColorConfig, \"soft\"), \"info\");\r\n\r\n const iconColorStyle = variant === \"other\" ? \"\" : getSafeConfig(color, getSafeConfig(variant, iconColorConfig, \"soft\"), \"info\");\r\n\r\n const isClosable = closable || Boolean(onClose);\r\n\r\n const handleClose = (e: MouseEvent<HTMLButtonElement>) => {\r\n e.stopPropagation();\r\n onClose?.();\r\n };\r\n\r\n const defaultRole = color === \"error\" || color === \"warning\" ? \"alert\" : \"status\";\r\n const activeRole = role || defaultRole;\r\n const ariaLive = color === \"error\" || color === \"warning\" ? \"assertive\" : \"polite\";\r\n\r\n const bodyContent = description ?? children;\r\n const hasBody = Boolean(bodyContent);\r\n\r\n const renderIcon = () => {\r\n if (icon === false) return null;\r\n\r\n if (icon !== true && icon !== undefined) {\r\n return (\r\n <span\r\n className={`inline-flex items-center justify-center shrink-0 leading-none ${currentSize.icon} ${iconClassName}`}\r\n aria-hidden=\"true\"\r\n >\r\n {icon}\r\n </span>\r\n );\r\n }\r\n\r\n const IconComponent = getSafeConfig(color, defaultIcons, \"info\");\r\n return (\r\n <span\r\n className={`inline-flex items-center justify-center shrink-0 leading-none ${currentSize.icon} ${iconColorStyle} ${iconClassName}`}\r\n aria-hidden=\"true\"\r\n >\r\n <IconComponent className=\"size-full\" />\r\n </span>\r\n );\r\n };\r\n\r\n const containerClasses = [\r\n \"relative flex w-full\",\r\n currentSize.container,\r\n roundedClass,\r\n variantStyles,\r\n className,\r\n ]\r\n .filter(Boolean)\r\n .join(\" \");\r\n\r\n return (\r\n <div ref={ref} role={activeRole} aria-live={ariaLive} className={containerClasses} {...props}>\r\n {renderIcon()}\r\n\r\n <div className=\"flex-1 min-w-0 flex flex-col justify-center\">\r\n {title && <div className={`${currentSize.title} ${titleClassName}`}>{title}</div>}\r\n {hasBody && (\r\n <div className={`${currentSize.description} ${title ? \"mt-0.5\" : \"\"} ${descriptionClassName}`}>\r\n {bodyContent}\r\n </div>\r\n )}\r\n </div>\r\n\r\n {action && (\r\n <div className={`inline-flex items-center shrink-0 ${currentSize.action} ${actionClassName}`}>{action}</div>\r\n )}\r\n\r\n {isClosable && (\r\n <button\r\n type=\"button\"\r\n onClick={handleClose}\r\n aria-label={closeAriaLabel}\r\n className={`inline-flex items-center justify-center shrink-0 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-current opacity-70 hover:opacity-100 ${\r\n variant === \"filled\" ? \"hover:bg-white/20 active:bg-white/30\" : \"hover:bg-black/5 active:bg-black/10\"\r\n } ${currentSize.closeButton} ${closeButtonClassName}`}\r\n >\r\n <CloseIcon className={currentSize.closeIcon} />\r\n </button>\r\n )}\r\n </div>\r\n );\r\n}\r\n","/**\r\n * Thời gian hiển thị mặc định của thông báo Toast trước khi tự động đóng (miliseconds).\r\n */\r\nexport const DEFAULT_TOAST_DURATION = 4000;\r\n","import { Toaster as SonnerToaster } from \"sonner\";\r\nimport { ToasterProps } from \"./types\";\r\nimport { DEFAULT_TOAST_DURATION } from \"./constants\";\r\n\r\nexport default function Toaster({\r\n position = \"top-right\",\r\n visibleToasts = 3,\r\n expand = false,\r\n duration = DEFAULT_TOAST_DURATION,\r\n closeButton = false,\r\n className = \"\",\r\n toastOptions,\r\n ...props\r\n}: ToasterProps) {\r\n return (\r\n <SonnerToaster\r\n position={position}\r\n visibleToasts={visibleToasts}\r\n expand={expand}\r\n duration={duration}\r\n closeButton={closeButton}\r\n className={`toaster group ${className}`}\r\n toastOptions={{\r\n unstyled: true,\r\n className: \"w-full max-w-md pointer-events-auto\",\r\n ...toastOptions,\r\n }}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import { isValidElement, ReactElement, ReactNode } from \"react\";\r\nimport { toast as sonnerToast } from \"sonner\";\r\nimport Alert from \"../alert/Alert\";\r\nimport { AlertColor, AlertProps, AlertVariant } from \"../alert/types\";\r\nimport { ToastMessageObject, ToastMessageResult, ToastOptions, ToastPromiseOptions } from \"./types\";\r\nimport { DEFAULT_TOAST_DURATION } from \"./constants\";\r\nimport Spinner from \"../icons/Spinner\";\r\n\r\nfunction showToast(\r\n title: ReactNode,\r\n color: AlertColor = \"info\",\r\n variant: AlertVariant = \"soft\",\r\n description?: ReactNode,\r\n options: ToastOptions = {},\r\n customId?: string | number\r\n): string | number {\r\n const { duration, position, onDismiss, onAutoClose, ...alertProps } = options;\r\n\r\n return sonnerToast.custom(\r\n (id) => (\r\n <Alert\r\n color={color}\r\n variant={variant}\r\n title={title}\r\n description={description}\r\n closable={alertProps.closable ?? true}\r\n onClose={() => {\r\n alertProps.onClose?.();\r\n sonnerToast.dismiss(id);\r\n }}\r\n {...alertProps}\r\n />\r\n ),\r\n {\r\n id: customId,\r\n duration: duration ?? DEFAULT_TOAST_DURATION,\r\n position,\r\n onDismiss,\r\n onAutoClose,\r\n }\r\n );\r\n}\r\n\r\nfunction isToastMessageObject(value: unknown): value is ToastMessageObject {\r\n return (\r\n typeof value === \"object\" &&\r\n value !== null &&\r\n !isValidElement(value) &&\r\n !Array.isArray(value) &&\r\n (\"title\" in value || \"description\" in value || \"color\" in value || \"variant\" in value)\r\n );\r\n}\r\n\r\nfunction extractMessageDetails(\r\n result: ToastMessageResult,\r\n fallbackColor: AlertColor,\r\n fallbackVariant: AlertVariant\r\n): { title: ReactNode; description?: ReactNode; color: AlertColor; variant: AlertVariant } {\r\n if (isToastMessageObject(result)) {\r\n return {\r\n title: result.title ?? \"\",\r\n description: result.description,\r\n color: result.color ?? fallbackColor,\r\n variant: result.variant ?? fallbackVariant,\r\n };\r\n }\r\n\r\n return {\r\n title: result,\r\n description: undefined,\r\n color: fallbackColor,\r\n variant: fallbackVariant,\r\n };\r\n}\r\n\r\n/**\r\n * Interface cho hàm và các phương thức của đối tượng `toast`.\r\n * Cú pháp chuẩn: `toast.success(title, description?, options?)`\r\n */\r\nexport interface ToastFunction {\r\n /**\r\n * Kích hoạt một thông báo Toast mặc định (màu info).\r\n * @param title Tiêu đề của thông báo\r\n * @param description Nội dung mô tả chi tiết (tùy chọn)\r\n * @param options Cấu hình phụ như variant, size, duration,... (tùy chọn)\r\n */\r\n (title: ReactNode, description?: ReactNode, options?: ToastOptions): string | number;\r\n\r\n /**\r\n * Kích hoạt thông báo tùy biến hoàn toàn (dùng hàm render JSX hoặc truyền AlertProps).\r\n */\r\n custom: {\r\n (jsxFn: (id: string | number) => ReactNode, options?: ToastOptions): string | number;\r\n (alertProps: AlertProps & ToastOptions): string | number;\r\n };\r\n\r\n /**\r\n * Kích hoạt thông báo thành công (màu success).\r\n */\r\n success: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;\r\n\r\n /**\r\n * Kích hoạt thông báo lỗi (màu error).\r\n */\r\n error: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;\r\n\r\n /**\r\n * Kích hoạt thông báo cảnh báo (màu warning).\r\n */\r\n warning: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;\r\n\r\n /**\r\n * Kích hoạt thông báo thông tin (màu info).\r\n */\r\n info: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;\r\n\r\n /**\r\n * Kích hoạt thông báo đang tải dữ liệu (Loading spinner, không tự đóng).\r\n */\r\n loading: (title: ReactNode, description?: ReactNode, options?: ToastOptions) => string | number;\r\n\r\n /**\r\n * Tự động theo dõi Promise và chuyển trạng thái Toast từ Loading sang Success hoặc Error.\r\n */\r\n promise: <T>(\r\n promise: Promise<T> | (() => Promise<T>),\r\n options: ToastPromiseOptions<T>\r\n ) => Promise<T>;\r\n\r\n /**\r\n * Đóng một Toast cụ thể bằng ID hoặc đóng tất cả Toasts nếu không truyền ID.\r\n */\r\n dismiss: (id?: string | number) => string | number | undefined;\r\n}\r\n\r\nconst baseToast = ((\r\n title: ReactNode,\r\n description?: ReactNode,\r\n options?: ToastOptions\r\n): string | number => {\r\n const opts = options || {};\r\n return showToast(title, opts.color || \"info\", opts.variant || \"soft\", description, opts);\r\n}) as ToastFunction;\r\n\r\nbaseToast.custom = (\r\n arg: ((id: string | number) => ReactNode) | (AlertProps & ToastOptions),\r\n options: ToastOptions = {}\r\n): string | number => {\r\n if (typeof arg === \"function\") {\r\n return sonnerToast.custom(\r\n (id) => arg(id) as ReactElement,\r\n {\r\n duration: options.duration ?? DEFAULT_TOAST_DURATION,\r\n position: options.position,\r\n onDismiss: options.onDismiss,\r\n onAutoClose: options.onAutoClose,\r\n }\r\n );\r\n }\r\n\r\n const { duration, position, onDismiss, onAutoClose, ...alertProps } = arg;\r\n return sonnerToast.custom(\r\n (id) => (\r\n <Alert\r\n closable={alertProps.closable ?? true}\r\n onClose={() => {\r\n alertProps.onClose?.();\r\n sonnerToast.dismiss(id);\r\n }}\r\n {...alertProps}\r\n />\r\n ),\r\n {\r\n duration: duration ?? DEFAULT_TOAST_DURATION,\r\n position,\r\n onDismiss,\r\n onAutoClose,\r\n }\r\n );\r\n};\r\n\r\nbaseToast.success = (\r\n title: ReactNode,\r\n description?: ReactNode,\r\n options?: ToastOptions\r\n): string | number => {\r\n const opts = options || {};\r\n return showToast(title, opts.color || \"success\", opts.variant || \"soft\", description, opts);\r\n};\r\n\r\nbaseToast.error = (\r\n title: ReactNode,\r\n description?: ReactNode,\r\n options?: ToastOptions\r\n): string | number => {\r\n const opts = options || {};\r\n return showToast(title, opts.color || \"error\", opts.variant || \"soft\", description, opts);\r\n};\r\n\r\nbaseToast.warning = (\r\n title: ReactNode,\r\n description?: ReactNode,\r\n options?: ToastOptions\r\n): string | number => {\r\n const opts = options || {};\r\n return showToast(title, opts.color || \"warning\", opts.variant || \"soft\", description, opts);\r\n};\r\n\r\nbaseToast.info = (\r\n title: ReactNode,\r\n description?: ReactNode,\r\n options?: ToastOptions\r\n): string | number => {\r\n const opts = options || {};\r\n return showToast(title, opts.color || \"info\", opts.variant || \"soft\", description, opts);\r\n};\r\n\r\nbaseToast.loading = (\r\n title: ReactNode,\r\n description?: ReactNode,\r\n options?: ToastOptions\r\n): string | number => {\r\n const opts = options || {};\r\n return showToast(title, opts.color || \"info\", opts.variant || \"soft\", description, {\r\n ...opts,\r\n icon: opts.icon ?? <Spinner className=\"size-full animate-spin\" />,\r\n duration: opts.duration ?? Infinity,\r\n closable: opts.closable ?? false,\r\n });\r\n};\r\n\r\nbaseToast.promise = async <T,>(\r\n promiseInput: Promise<T> | (() => Promise<T>),\r\n options: ToastPromiseOptions<T>\r\n): Promise<T> => {\r\n const promise = typeof promiseInput === \"function\" ? promiseInput() : promiseInput;\r\n\r\n const { title: loadingTitle, description: loadingDesc } = extractMessageDetails(\r\n options.loading,\r\n \"info\",\r\n options.variant || \"soft\"\r\n );\r\n\r\n const toastId = baseToast.loading(loadingTitle, loadingDesc, {\r\n size: options.size,\r\n variant: options.variant,\r\n radius: options.radius,\r\n });\r\n\r\n try {\r\n const data = await promise;\r\n\r\n const rawSuccess = typeof options.success === \"function\" ? options.success(data) : options.success;\r\n const { title: successTitle, description: successDesc, color: successColor, variant: successVariant } =\r\n extractMessageDetails(rawSuccess, \"success\", options.variant || \"soft\");\r\n\r\n showToast(\r\n successTitle,\r\n successColor,\r\n successVariant,\r\n successDesc,\r\n {\r\n duration: options.duration ?? DEFAULT_TOAST_DURATION,\r\n size: options.size,\r\n radius: options.radius,\r\n },\r\n toastId\r\n );\r\n\r\n return data;\r\n } catch (err: unknown) {\r\n const rawError = typeof options.error === \"function\" ? options.error(err) : options.error;\r\n const { title: errorTitle, description: errorDesc, color: errorColor, variant: errorVariant } =\r\n extractMessageDetails(rawError, \"error\", options.variant || \"soft\");\r\n\r\n showToast(\r\n errorTitle,\r\n errorColor,\r\n errorVariant,\r\n errorDesc,\r\n {\r\n duration: options.duration ?? DEFAULT_TOAST_DURATION,\r\n size: options.size,\r\n radius: options.radius,\r\n },\r\n toastId\r\n );\r\n\r\n throw err;\r\n } finally {\r\n if (options.finally) {\r\n await options.finally();\r\n }\r\n }\r\n};\r\n\r\nbaseToast.dismiss = (id?: string | number): string | number | undefined => {\r\n return sonnerToast.dismiss(id);\r\n};\r\n\r\nexport const toast: ToastFunction = baseToast;\r\n","export const DEFAULT_DEBOUNCE_DELAY = 300;\r\n\r\nexport const DEFAULT_Z_INDEX = {\r\n BASE: 0,\r\n STICKY: 10,\r\n DROPDOWN: 50,\r\n POPOVER: 50,\r\n SELECT: 50,\r\n PICKER: 50,\r\n TOOLTIP: 60,\r\n SELECT_FILTER: 100,\r\n MAX: 99999,\r\n} as const;\r\n","import { DEFAULT_DEBOUNCE_DELAY } from \"@/constants\";\r\nimport { useEffect, useState } from \"react\";\r\n\r\n/**\r\n * Custom hook to debounce a value by a given delay in milliseconds.\r\n *\r\n * @param value The value to debounce\r\n * @param delay Delay in milliseconds (default: 300ms)\r\n * @returns The debounced value\r\n */\r\nexport function useDebounce<T>(value: T, delay: number = DEFAULT_DEBOUNCE_DELAY): T {\r\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\r\n\r\n useEffect(() => {\r\n const timer = setTimeout(() => {\r\n setDebouncedValue(value);\r\n }, delay);\r\n\r\n return () => {\r\n clearTimeout(timer);\r\n };\r\n }, [value, delay]);\r\n\r\n return debouncedValue;\r\n}\r\n\r\nexport default useDebounce;\r\n","import { useCallback, useEffect, useRef, useState, type RefObject } from \"react\";\r\n\r\n/**\r\n * Các tùy chọn cấu hình cho hook `useInfiniteScroll`.\r\n */\r\nexport interface UseInfiniteScrollOptions {\r\n /**\r\n * Callback được gọi khi người dùng cuộn đến cuối hoặc phần tử sentinel xuất hiện trong tầm nhìn.\r\n */\r\n onLoadMore: () => void | Promise<void>;\r\n\r\n /**\r\n * Cho biết còn dữ liệu để tải tiếp hay không.\r\n * Nếu là `false`, `onLoadMore` sẽ không được kích hoạt.\r\n * @default true\r\n */\r\n hasMore?: boolean;\r\n\r\n /**\r\n * Trạng thái đang tải dữ liệu của trang hiện tại / tiếp theo.\r\n * Nếu là `true`, `onLoadMore` sẽ tạm hoãn cho đến khi lượt tải trước hoàn tất.\r\n * @default false\r\n */\r\n isLoading?: boolean;\r\n\r\n /**\r\n * Vô hiệu hóa toàn bộ cơ chế theo dõi cuộn vô hạn.\r\n * @default false\r\n */\r\n disabled?: boolean;\r\n\r\n /**\r\n * Khoảng cách biên rootMargin của IntersectionObserver (vd: \"100px\", \"0px 0px 100px 0px\").\r\n * Giúp kích hoạt tải trước khi người dùng chạm tới đáy danh sách để trải nghiệm mượt mà hơn.\r\n * @default \"100px\"\r\n */\r\n rootMargin?: string;\r\n\r\n /**\r\n * Ngưỡng hiển thị threshold của IntersectionObserver (từ 0.0 đến 1.0).\r\n * @default 0\r\n */\r\n threshold?: number | number[];\r\n\r\n /**\r\n * Phần tử gốc hoặc RefObject làm khung cuộn cho IntersectionObserver.\r\n * Nếu là `null` hoặc `undefined`, sẽ dùng viewport của trình duyệt hoặc khung cuộn cha gần nhất.\r\n * @default null\r\n */\r\n root?: Element | null | RefObject<Element | null>;\r\n}\r\n\r\n/**\r\n * Kết quả trả về từ hook `useInfiniteScroll`.\r\n */\r\nexport interface UseInfiniteScrollReturn {\r\n /**\r\n * Ref callback gắn vào phần tử sentinel ở cuối danh sách để theo dõi bằng IntersectionObserver.\r\n */\r\n sentinelRef: (node: HTMLElement | null) => void;\r\n\r\n /**\r\n * Trạng thái phần tử sentinel có đang nằm trong tầm quan sát hay không.\r\n */\r\n isIntersecting: boolean;\r\n}\r\n\r\n/**\r\n * Hook `useInfiniteScroll` độc lập hỗ trợ tải dữ liệu vô tận qua IntersectionObserver.\r\n */\r\nexport function useInfiniteScroll({\r\n onLoadMore,\r\n hasMore = true,\r\n isLoading = false,\r\n disabled = false,\r\n rootMargin = \"100px\",\r\n threshold = 0,\r\n root = null,\r\n}: UseInfiniteScrollOptions): UseInfiniteScrollReturn {\r\n const [isIntersecting, setIsIntersecting] = useState(false);\r\n const [sentinelNode, setSentinelNode] = useState<HTMLElement | null>(null);\r\n\r\n // Chỉ cần 1 ref duy nhất làm mutex lock để tránh kích hoạt 2 lần cùng lúc trong 1 frame\r\n const isTriggeringRef = useRef(false);\r\n\r\n const canTrigger = hasMore && !isLoading && !disabled;\r\n\r\n const triggerLoadMore = useCallback(() => {\r\n if (!canTrigger || isTriggeringRef.current) return;\r\n\r\n isTriggeringRef.current = true;\r\n try {\r\n const result = onLoadMore();\r\n if (result && typeof (result as Promise<void>).then === \"function\") {\r\n (result as Promise<void>).finally(() => {\r\n isTriggeringRef.current = false;\r\n });\r\n } else {\r\n isTriggeringRef.current = false;\r\n }\r\n } catch {\r\n isTriggeringRef.current = false;\r\n }\r\n }, [canTrigger, onLoadMore]);\r\n\r\n // Sentinel ref callback\r\n const sentinelRef = useCallback((node: HTMLElement | null) => {\r\n setSentinelNode(node);\r\n }, []);\r\n\r\n // IntersectionObserver setup\r\n useEffect(() => {\r\n if (!sentinelNode || disabled || !hasMore) {\r\n return;\r\n }\r\n\r\n if (typeof window === \"undefined\" || !(\"IntersectionObserver\" in window)) {\r\n return;\r\n }\r\n\r\n const resolvedRoot =\r\n root && typeof root === \"object\" && \"current\" in root\r\n ? (root as RefObject<Element | null>).current\r\n : (root as Element | null);\r\n\r\n const observer = new IntersectionObserver(\r\n (entries) => {\r\n const [entry] = entries;\r\n if (!entry) return;\r\n\r\n const intersecting = entry.isIntersecting;\r\n setIsIntersecting(intersecting);\r\n\r\n if (intersecting) {\r\n triggerLoadMore();\r\n }\r\n },\r\n {\r\n root: resolvedRoot,\r\n rootMargin,\r\n threshold,\r\n }\r\n );\r\n\r\n observer.observe(sentinelNode);\r\n\r\n return () => {\r\n observer.disconnect();\r\n setIsIntersecting(false);\r\n };\r\n }, [sentinelNode, root, rootMargin, threshold, disabled, hasMore, triggerLoadMore]);\r\n\r\n // Khi tải xong (isLoading = false), nếu sentinel vẫn đang nằm trong tầm nhìn thì kích hoạt tải tiếp\r\n useEffect(() => {\r\n if (canTrigger && isIntersecting) {\r\n triggerLoadMore();\r\n }\r\n }, [canTrigger, isIntersecting, triggerLoadMore]);\r\n\r\n return {\r\n sentinelRef,\r\n isIntersecting,\r\n };\r\n}\r\n\r\nexport default useInfiniteScroll;\r\n","import { SkeletonObjectFit, SkeletonRadius, SkeletonVariant } from \"./types\";\r\n\r\n/**\r\n * Animation class theo variant.\r\n * Variant 'wave' dùng class CSS tùy chỉnh `.skeleton-wave` được định nghĩa trong styles.css.\r\n */\r\nexport const variantConfig: Record<SkeletonVariant, string> = {\r\n pulse: \"animate-pulse\",\r\n wave: \"skeleton-wave\",\r\n none: \"\",\r\n};\r\n\r\n/**\r\n * Bo góc theo radius.\r\n * Chỉ áp dụng khi shape === 'rectangle'.\r\n */\r\nexport const radiusConfig: Record<SkeletonRadius, string> = {\r\n none: \"rounded-none\",\r\n sm: \"rounded-sm\",\r\n md: \"rounded-md\",\r\n lg: \"rounded-lg\",\r\n xl: \"rounded-xl\",\r\n full: \"rounded-full\",\r\n};\r\n\r\n/**\r\n * Kiểu căn chỉnh ảnh (object-fit) cho LoadingImage.\r\n */\r\nexport const objectFitConfig: Record<SkeletonObjectFit, string> = {\r\n cover: \"object-cover\",\r\n contain: \"object-contain\",\r\n fill: \"object-fill\",\r\n none: \"object-none\",\r\n \"scale-down\": \"object-scale-down\",\r\n};\r\n","export const toStyle = (val: string | number | undefined): string | number | undefined =>\r\n typeof val === \"number\" ? val : val;\r\n\r\nexport const getSourceKey = (s: unknown): string | unknown => {\r\n if (!s) return \"\";\r\n if (typeof s === \"string\") return s;\r\n if (typeof File !== \"undefined\" && s instanceof File) {\r\n return `${s.name}-${s.size}-${s.lastModified}`;\r\n }\r\n if (typeof Blob !== \"undefined\" && s instanceof Blob) {\r\n return `${s.size}-${s.type}`;\r\n }\r\n if (typeof s === \"object\" && \"src\" in s && typeof (s as { src: unknown }).src === \"string\") {\r\n return (s as { src: string }).src;\r\n }\r\n return s;\r\n};","import { CSSProperties } from \"react\";\r\nimport { SkeletonProps } from \"./types\";\r\nimport { variantConfig, radiusConfig } from \"./constants\";\r\nimport { getSafeConfig } from \"@/utils/function\";\r\nimport { toStyle } from \"./utils\";\r\n\r\nexport default function Skeleton({\r\n ref,\r\n variant = \"pulse\",\r\n shape = \"rectangle\",\r\n radius = \"md\",\r\n width,\r\n height = \"1rem\",\r\n lines = 1,\r\n gap = \"0.5rem\",\r\n className = \"\",\r\n style,\r\n ...props\r\n}: SkeletonProps) {\r\n const animationClass = getSafeConfig(variant, variantConfig, \"pulse\");\r\n\r\n // Circle: bỏ qua radius prop, luôn full-round\r\n const roundedClass = shape === \"circle\" ? \"rounded-full\" : getSafeConfig(radius, radiusConfig, \"md\");\r\n\r\n const baseStyle: CSSProperties = {\r\n width: toStyle(width),\r\n height: toStyle(height),\r\n ...style,\r\n };\r\n\r\n const itemClass = [\"bg-neutral-200\", animationClass, roundedClass].filter(Boolean).join(\" \");\r\n\r\n if (lines > 1) {\r\n return (\r\n <div\r\n ref={ref}\r\n role=\"status\"\r\n aria-label=\"Loading...\"\r\n className={[\"flex flex-col\", className].filter(Boolean).join(\" \")}\r\n style={{ gap: toStyle(gap), ...style }}\r\n {...props}\r\n >\r\n {Array.from({ length: lines }).map((_, i) => {\r\n const isLast = i === lines - 1;\r\n return (\r\n <div\r\n key={i}\r\n className={itemClass}\r\n style={{\r\n width: isLast ? \"60%\" : (toStyle(width) ?? \"100%\"),\r\n height: toStyle(height),\r\n }}\r\n />\r\n );\r\n })}\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n role=\"status\"\r\n aria-label=\"Loading...\"\r\n className={[itemClass, className].filter(Boolean).join(\" \")}\r\n style={baseStyle}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import type { TableAlign, TableSize, TableVariant } from \"./types\";\r\n\r\nexport const tableSizeConfig: Record<\r\n TableSize,\r\n {\r\n head: string;\r\n cell: string;\r\n text: string;\r\n icon: string;\r\n }\r\n> = {\r\n sm: {\r\n head: \"px-3 py-2 text-xs font-semibold\",\r\n cell: \"px-3 py-2 text-xs\",\r\n text: \"text-xs\",\r\n icon: \"w-3.5 h-3.5\",\r\n },\r\n md: {\r\n head: \"px-4 py-3 text-sm font-semibold\",\r\n cell: \"px-4 py-3 text-sm\",\r\n text: \"text-sm\",\r\n icon: \"w-4 h-4\",\r\n },\r\n lg: {\r\n head: \"px-5 py-4 text-base font-semibold\",\r\n cell: \"px-5 py-4 text-base\",\r\n text: \"text-base\",\r\n icon: \"w-5 h-5\",\r\n },\r\n};\r\n\r\nexport const tableVariantConfig: Record<\r\n TableVariant,\r\n {\r\n container: string;\r\n table: string;\r\n head: string;\r\n row: string;\r\n cell: string;\r\n }\r\n> = {\r\n default: {\r\n container: \"border border-neutral-200 shadow-xs\",\r\n table: \"border-collapse\",\r\n head: \"bg-neutral-50/80 border-b border-neutral-200 text-neutral-600\",\r\n row: \"border-b border-neutral-200/80 hover:bg-neutral-50/50 transition-colors\",\r\n cell: \"text-neutral-700\",\r\n },\r\n striped: {\r\n container: \"border border-neutral-200 shadow-xs\",\r\n table: \"border-collapse\",\r\n head: \"bg-neutral-100/80 border-b border-neutral-200 text-neutral-700\",\r\n row: \"border-b border-neutral-200/80 even:bg-neutral-50/60 hover:bg-neutral-100/40 transition-colors\",\r\n cell: \"text-neutral-700\",\r\n },\r\n bordered: {\r\n container: \"border border-neutral-200 shadow-xs\",\r\n table: \"border-collapse border border-neutral-200\",\r\n head: \"bg-neutral-50 border border-neutral-200 text-neutral-700\",\r\n row: \"border-b border-neutral-200 hover:bg-neutral-50/50 transition-colors\",\r\n cell: \"border border-neutral-200 text-neutral-700\",\r\n },\r\n};\r\n\r\nexport const tableAlignConfig: Record<TableAlign, string> = {\r\n left: \"text-left justify-start\",\r\n center: \"text-center justify-center\",\r\n right: \"text-right justify-end\",\r\n};\r\n\r\nexport const DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50, 100];\r\nexport const DEFAULT_PAGE_SIZE = 10;\r\n"],"mappings":";AAAA,OAAS,YAAAA,GAAU,gBAAAC,OAAoB,+BAWhC,SAASC,EACdC,EACAC,EACAC,EACS,CACT,OAAIF,GAAO,MAAQ,OAAO,UAAU,eAAe,KAAKC,EAAWD,CAAG,EAC7DC,EAAUD,CAAG,EAEfC,EAAUC,CAAW,CAC9B,CAUO,SAASC,GACdC,EACAC,EACAC,EACK,CACL,IAAMC,EAAUF,EAAM,KAAK,EAC3B,GAAI,CAACE,GAAW,CAACH,EAAM,OACrB,OAAOA,EAGT,IAAMI,EAAcF,EAAU,MAAM,QAAQA,CAAM,EAAIA,EAAS,CAACA,CAAM,EAAK,CAAC,EACtEG,EAAqC,CAAC,EAE5C,GAAID,EAAY,OAAS,EACvB,QAAWE,KAASF,EACd,OAAOE,GAAU,WACnBD,EAAU,KAAME,GAAY,CAC1B,IAAMC,EAAMF,EAAMC,CAAI,EACtB,OAAOC,GAAO,KAAO,OAAOA,CAAG,EAAI,EACrC,CAAC,EAEDH,EAAU,KAAME,GAAY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,aACX,UAAW,CAACkB,EAAWV,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAC1D,MAAOQ,EACN,GAAGN,EACN,CAEJ,CCnEO,IAAMY,GAQT,CACF,GAAI,CACF,KAAM,kCACN,KAAM,oBACN,KAAM,UACN,KAAM,aACR,EACA,GAAI,CACF,KAAM,kCACN,KAAM,oBACN,KAAM,UACN,KAAM,SACR,EACA,GAAI,CACF,KAAM,oCACN,KAAM,sBACN,KAAM,YACN,KAAM,SACR,CACF,EAEaC,GAST,CACF,QAAS,CACP,UAAW,sCACX,MAAO,kBACP,KAAM,gEACN,IAAK,0EACL,KAAM,kBACR,EACA,QAAS,CACP,UAAW,sCACX,MAAO,kBACP,KAAM,iEACN,IAAK,iGACL,KAAM,kBACR,EACA,SAAU,CACR,UAAW,sCACX,MAAO,4CACP,KAAM,2DACN,IAAK,uEACL,KAAM,4CACR,CACF,EAEaC,GAA+C,CAC1D,KAAM,0BACN,OAAQ,6BACR,MAAO,wBACT,EAEaC,GAA4B,CAAC,GAAI,GAAI,GAAI,GAAG,EAC5CC,GAAoB","names":["rankItem","compareItems","getSafeConfig","key","configMap","fallbackKey","rankAndFilterItems","items","query","fields","keyword","fieldsArray","accessors","field","item","res","record","val","dataVal","ranked","info","a","b","r","jsx","jsxs","Spinner","width","height","className","props","jsx","CloseIcon","width","height","className","props","jsx","jsxs","InfoCircleIcon","width","height","className","props","jsx","jsxs","CheckCircleIcon","width","height","className","props","jsx","jsxs","AlertTriangleIcon","width","height","className","props","jsx","jsxs","AlertCircleIcon","width","height","className","props","sizeConfig","radiusConfig","variantColorConfig","iconColorConfig","defaultIcons","InfoCircleIcon","CheckCircleIcon","AlertTriangleIcon","AlertCircleIcon","jsx","jsxs","Alert","size","variant","color","radius","title","description","icon","action","closable","onClose","closeAriaLabel","banner","titleClassName","descriptionClassName","actionClassName","iconClassName","closeButtonClassName","className","children","role","ref","props","currentSize","getSafeConfig","sizeConfig","roundedClass","radiusConfig","variantStyles","variantColorConfig","iconColorStyle","iconColorConfig","isClosable","handleClose","e","activeRole","ariaLive","bodyContent","hasBody","renderIcon","IconComponent","defaultIcons","containerClasses","CloseIcon","DEFAULT_TOAST_DURATION","SonnerToaster","jsx","Toaster","position","visibleToasts","expand","duration","closeButton","className","toastOptions","props","SonnerToaster","isValidElement","sonnerToast","jsx","showToast","title","color","variant","description","options","customId","duration","position","onDismiss","onAutoClose","alertProps","sonnerToast","id","Alert","isToastMessageObject","value","isValidElement","extractMessageDetails","result","fallbackColor","fallbackVariant","baseToast","opts","arg","Spinner","promiseInput","promise","loadingTitle","loadingDesc","toastId","data","rawSuccess","successTitle","successDesc","successColor","successVariant","err","rawError","errorTitle","errorDesc","errorColor","errorVariant","toast","DEFAULT_Z_INDEX","useEffect","useState","useDebounce","value","delay","debouncedValue","setDebouncedValue","timer","useCallback","useEffect","useRef","useState","useInfiniteScroll","onLoadMore","hasMore","isLoading","disabled","rootMargin","threshold","root","isIntersecting","setIsIntersecting","sentinelNode","setSentinelNode","isTriggeringRef","canTrigger","triggerLoadMore","result","sentinelRef","node","resolvedRoot","observer","entries","entry","intersecting","variantConfig","radiusConfig","objectFitConfig","toStyle","val","getSourceKey","s","jsx","Skeleton","ref","variant","shape","radius","width","height","lines","gap","className","style","props","animationClass","getSafeConfig","variantConfig","roundedClass","radiusConfig","baseStyle","toStyle","itemClass","_","i","isLast","tableSizeConfig","tableVariantConfig","tableAlignConfig","DEFAULT_PAGE_SIZE_OPTIONS","DEFAULT_PAGE_SIZE"]}