sigpro-ui 1.0.6

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.
Files changed (43) hide show
  1. package/Readme.md +146 -0
  2. package/dist/sigpro-ui.cjs +1677 -0
  3. package/dist/sigpro-ui.esm.js +1621 -0
  4. package/dist/sigpro-ui.umd.js +1680 -0
  5. package/dist/sigpro-ui.umd.min.js +1 -0
  6. package/index.js +40 -0
  7. package/package.json +52 -0
  8. package/src/components/Accordion.js +24 -0
  9. package/src/components/Alert.js +50 -0
  10. package/src/components/Autocomplete.js +95 -0
  11. package/src/components/Badge.js +6 -0
  12. package/src/components/Button.js +39 -0
  13. package/src/components/Checkbox.js +21 -0
  14. package/src/components/Colorpicker.js +81 -0
  15. package/src/components/Datepicker.js +252 -0
  16. package/src/components/Drawer.js +18 -0
  17. package/src/components/Dropdown.js +37 -0
  18. package/src/components/Fab.js +51 -0
  19. package/src/components/Fieldset.js +19 -0
  20. package/src/components/Fileinput.js +113 -0
  21. package/src/components/Indicator.js +9 -0
  22. package/src/components/Input.js +77 -0
  23. package/src/components/List.js +18 -0
  24. package/src/components/Loading.js +13 -0
  25. package/src/components/Menu.js +25 -0
  26. package/src/components/Modal.js +31 -0
  27. package/src/components/Navbar.js +6 -0
  28. package/src/components/Radio.js +25 -0
  29. package/src/components/Range.js +24 -0
  30. package/src/components/Rating.js +34 -0
  31. package/src/components/Select.js +36 -0
  32. package/src/components/Stack.js +6 -0
  33. package/src/components/Stat.js +11 -0
  34. package/src/components/Swap.js +13 -0
  35. package/src/components/Table.js +60 -0
  36. package/src/components/Tabs.js +46 -0
  37. package/src/components/Timeline.js +52 -0
  38. package/src/components/Toast.js +63 -0
  39. package/src/components/Tooltip.js +6 -0
  40. package/src/components/index.js +110 -0
  41. package/src/core/i18n.js +26 -0
  42. package/src/core/icons.js +17 -0
  43. package/src/core/utils.js +5 -0
@@ -0,0 +1 @@
1
+ var SigProUI=function(t,e){"use strict";const l=t=>"function"==typeof t?t():t,a=(t,e)=>"function"==typeof e?()=>`${t} ${e()||""}`.trim():`${t} ${e||""}`.trim();var o=Object.freeze({__proto__:null,joinClass:a,val:l});const n=(t,l)=>{const{title:o,name:n,open:s,...A}=t;return e.$html("div",{...A,class:a("collapse collapse-arrow bg-base-200 mb-2",t.class)},[e.$html("input",{type:n?"radio":"checkbox",name:n,checked:s}),e.$html("div",{class:"collapse-title text-xl font-medium"},o),e.$html("div",{class:"collapse-content"},l)])};var s=Object.freeze({__proto__:null,Accordion:n});const A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADjSURBVDiN3dJNSgNBEAXgz4DZeAAVJ9tko2St3kaIFxAVt4KZeAD1GKKi7vQSydI/yHgALxAXU02GxniAFBR0v1ev+3V1sZSxjxtM8BM5wTX2/hNu4gFvOMI21iJ3cIwP3GMjF/dQ4RyraOMS34GPAmvjIrBeEnfwjoPGgSM8ooh8QtngB6Ep4BWnmaMqkY1LqqzmDC8tzNDK3/RHzLL9SloUYWfQIMuw3Yl8xrDBH6qbvZWALqbqBqVmlWF7GuKEDwPr5hbXcYdPnKBv/o39wL5wG7ULY1c9NGPzQRrjKrhli1/02zEjWyWMBwAAAABJRU5ErkJggg==",c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEDSURBVDiN1dK/K8VhFAbwD+VLGSxKcu9guSQ/Zils/gNkuaX4BxRZDTdklYU/QAaDlEVGGwu2Kz/uVbKJzWDwfuv1+jHz1Km3c85znuf0Hv4jxnD2W8MItnCJ5xAX2MQcHsO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a5ztafCJMb5hBQQ/MMwXLnnZAAAAAElFTkSuQmCC";var y=Object.freeze({__proto__:null,icon123:u,iconAbc:m,iconCalendar:i,iconClose:r,iconError:b,iconHide:c,iconInfo:h,iconLLeft:B,iconLeft:$,iconLock:d,iconMail:p,iconRRight:w,iconRight:v,iconShow:A,iconSuccess:g,iconUpload:x,iconWarning:f});const S=(t,a)=>{const{type:o="info",soft:n=!0,...s}=t,A={info:h,success:g,warning:f,error:b},c=a||t.message;return e.$html("div",{...s,role:"alert",class:()=>`alert ${(()=>{const t=l(o);return{info:"alert-info",success:"alert-success",warning:"alert-warning",error:"alert-error"}[t]||t})()} ${l(n)?"alert-soft":""} ${t.class||""}`},[e.$html("img",{src:A[l(o)]||A.info,class:"w-4 h-4 object-contain",alt:l(o)}),e.$html("div",{class:"flex-1"},[e.$html("span",{},["function"==typeof c?c():c])]),t.actions?e.$html("div",{class:"flex-none"},["function"==typeof t.actions?t.actions():t.actions]):null])};var C=Object.freeze({__proto__:null,Alert:S});const U={es:{close:"Cerrar",confirm:"Confirmar",cancel:"Cancelar",search:"Buscar...",loading:"Cargando...",nodata:"Sin datos"},en:{close:"Close",confirm:"Confirm",cancel:"Cancel",search:"Search...",loading:"Loading...",nodata:"No data"}},k=e.$("es"),R=t=>()=>U[k()][t]||t,D=t=>{const{label:o,tip:n,value:s,error:r,isSearch:h,icon:g,type:b="text",...f}=t,$="password"===b,v=e.$(!1),B={text:m,password:d,date:i,number:u,email:p},w=e.$html("input",{...f,type:()=>$?v()?"text":"password":b,placeholder:t.placeholder||o||(h?R("search")():" "),class:a("grow order-2 focus:outline-none",t.class),value:s,oninput:e=>t.oninput?.(e),disabled:()=>l(t.disabled)}),x=g||(B[b]?e.$html("img",{src:B[b],class:"opacity-50",alt:b}):null);return e.$html("label",{class:()=>a("input input-bordered floating-label flex items-center gap-2 w-full relative",l(r)?"input-error":"")},[x?e.$html("div",{class:"order-1 shrink-0"},x):null,o?e.$html("span",{class:"text-base-content/60 order-0"},o):null,w,$?e.$html("button",{type:"button",class:"order-3 btn btn-ghost btn-xs btn-circle opacity-50 hover:opacity-100",onclick:t=>{t.preventDefault(),v(!v())}},()=>e.$html("img",{class:"w-5 h-5",src:v()?A:c})):null,n?e.$html("div",{class:"tooltip tooltip-left order-4","data-tip":n},e.$html("span",{class:"badge badge-ghost badge-xs cursor-help"},"?")):null,()=>l(r)?e.$html("span",{class:"text-error text-[10px] absolute -bottom-5 left-2"},l(r)):null])};var j=Object.freeze({__proto__:null,Input:D});const _=t=>{const{options:a=[],value:o,onSelect:n,label:s,placeholder:A,...c}=t,r=e.$(l(o)||""),i=e.$(!1),d=e.$(-1),m=e.$(()=>{const t=r().toLowerCase(),e=l(a)||[];return t?e.filter(e=>("string"==typeof e?e:e.label).toLowerCase().includes(t)):e}),u=t=>{const e="string"==typeof t?t:t.value,l="string"==typeof t?t:t.label;r(l),"function"==typeof o&&o(e),n?.(t),i(!1),d(-1)};return e.$html("div",{class:"relative w-full"},[D({label:s,placeholder:A||R("search")(),value:r,onfocus:()=>i(!0),onblur:()=>setTimeout(()=>i(!1),150),onkeydown:t=>{const e=m();"ArrowDown"===t.key?(t.preventDefault(),i(!0),d(Math.min(d()+1,e.length-1))):"ArrowUp"===t.key?(t.preventDefault(),d(Math.max(d()-1,0))):"Enter"===t.key&&d()>=0?(t.preventDefault(),u(e[d()])):"Escape"===t.key&&i(!1)},oninput:t=>{const e=t.target.value;r(e),"function"==typeof o&&o(e),i(!0),d(-1)},...c}),e.$html("ul",{class:"absolute left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50",style:()=>i()&&m().length?"display:block":"display:none"},[e.$for(m,(t,l)=>e.$html("li",{},[e.$html("a",{class:()=>"block w-full "+(d()===l?"active bg-primary text-primary-content":""),onclick:()=>u(t),onmouseenter:()=>d(l)},"string"==typeof t?t:t.label)]),(t,e)=>("string"==typeof t?t:t.value)+e),()=>m().length?null:e.$html("li",{class:"p-2 text-center opacity-50"},"No results")])])};const z=(t,l)=>e.$html("span",{...t,class:a("badge",t.class)},l);const E=(t,o)=>{const{badge:n,badgeClass:s,tooltip:A,icon:c,loading:r,...i}=t;let d=e.$html("button",{...i,class:a("btn",t.class),disabled:()=>l(r)||l(t.disabled)},[()=>l(r)?e.$html("span",{class:"loading loading-spinner"}):null,c?e.$html("span",{class:"mr-1"},c):null,o]);return n&&(d=e.$html("div",{class:"indicator"},[e.$html("span",{class:a("indicator-item badge",s||"badge-secondary")},n),d])),A?e.$html("div",{class:"tooltip","data-tip":A},d):d};const I=t=>{const{value:a,tooltip:o,toggle:n,label:s,...A}=t,c=e.$html("input",{...A,type:"checkbox",class:()=>l(n)?"toggle":"checkbox",checked:a}),r=e.$html("label",{class:"label cursor-pointer justify-start gap-3"},[c,s?e.$html("span",{class:"label-text"},s):null]);return o?e.$html("div",{class:"tooltip","data-tip":o},r):r};const Y=t=>{const{value:a,label:o,...n}=t,s=e.$(!1),A=["#000","#1A1A1A","#333","#4D4D4D","#666","#808080","#B3B3B3","#FFF","#450a0a","#7f1d1d","#991b1b","#b91c1c","#dc2626","#ef4444","#f87171","#fca5a5","#431407","#7c2d12","#9a3412","#c2410c","#ea580c","#f97316","#fb923c","#ffedd5","#713f12","#a16207","#ca8a04","#eab308","#facc15","#fde047","#fef08a","#fff9c4","#064e3b","#065f46","#059669","#10b981","#34d399","#4ade80","#84cc16","#d9f99d","#082f49","#075985","#0284c7","#0ea5e9","#38bdf8","#7dd3fc","#22d3ee","#cffafe","#1e1b4b","#312e81","#4338ca","#4f46e5","#6366f1","#818cf8","#a5b4fc","#e0e7ff","#2e1065","#4c1d95","#6d28d9","#7c3aed","#8b5cf6","#a855f7","#d946ef","#fae8ff"],c=()=>l(a)||"#000000";return e.$html("div",{class:"relative w-fit"},[e.$html("button",{type:"button",class:"btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case",onclick:t=>{t.stopPropagation(),s(!s())},...n},[e.$html("div",{class:"size-5 rounded-sm shadow-inner border border-black/10 shrink-0",style:()=>`background-color: ${c()}`}),o?e.$html("span",{class:"opacity-80"},o):null]),e.$if(s,()=>e.$html("div",{class:"absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none",onclick:t=>t.stopPropagation()},[e.$html("div",{class:"grid grid-cols-8 gap-1"},A.map(t=>e.$html("button",{type:"button",style:`background-color: ${t}`,class:()=>"size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5 \n "+(c().toLowerCase()===t.toLowerCase()?"ring-2 ring-offset-1 ring-primary z-10 scale-110":""),onclick:()=>{"function"==typeof a&&a(t),s(!1)}})))])),e.$if(s,()=>e.$html("div",{class:"fixed inset-0 z-[100]",onclick:()=>s(!1)}))])};const V=t=>{const{value:a,range:o,label:n,placeholder:s,hour:A=!1,...c}=t,r=e.$(!1),d=e.$(new Date),m=e.$(null),u=e.$(0),p=e.$(0),h=()=>!0===l(o),g=new Date,b=`${g.getFullYear()}-${String(g.getMonth()+1).padStart(2,"0")}-${String(g.getDate()).padStart(2,"0")}`,f=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,x=t=>{const e=f(t),o=l(a);if(h())if(!o?.start||o.start&&o.end)"function"==typeof a&&a({start:e,end:null,...A&&{startHour:u()}});else{const t=o.start;if("function"==typeof a){const l=e<t?{start:e,end:t}:{start:t,end:e};A&&(l.startHour=o.startHour||u(),l.endHour=o.endHour||p()),a(l)}r(!1)}else"function"==typeof a&&a(A?`${e}T${String(u()).padStart(2,"0")}:00:00`:e),r(!1)},y=e.$(()=>{const t=l(a);if(!t)return"";if("string"==typeof t)return A&&t.includes("T")?t.replace("T"," "):t;if(t.start&&t.end){return`${A&&t.startHour?`${t.start} ${String(t.startHour).padStart(2,"0")}:00`:t.start} - ${A&&t.endHour?`${t.end} ${String(t.endHour).padStart(2,"0")}:00`:t.end}`}if(t.start){return`${A&&t.startHour?`${t.start} ${String(t.startHour).padStart(2,"0")}:00`:t.start}...`}return""}),S=t=>{const e=d();d(new Date(e.getFullYear(),e.getMonth()+t,1))},C=t=>{const e=d();d(new Date(e.getFullYear()+t,e.getMonth(),1))},U=({value:t,onChange:a})=>e.$html("div",{class:"flex-1"},[e.$html("div",{class:"flex gap-2 items-center"},[e.$html("input",{type:"range",min:0,max:23,value:t,class:"range range-xs flex-1",oninput:t=>{const e=parseInt(t.target.value);a(e)}}),e.$html("span",{class:"text-sm font-mono min-w-[48px] text-center"},()=>String(l(t)).padStart(2,"0")+":00")])]);return e.$html("div",{class:"relative w-full"},[D({label:n,placeholder:s||(h()?"Seleccionar rango...":"Seleccionar fecha..."),value:y,readonly:!0,icon:e.$html("img",{src:i,class:"opacity-40"}),onclick:t=>{t.stopPropagation(),r(!r())},...c}),e.$if(r,()=>e.$html("div",{class:"absolute left-0 mt-2 p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[100] w-80 select-none",onclick:t=>t.stopPropagation()},[e.$html("div",{class:"flex justify-between items-center mb-4 gap-1"},[e.$html("div",{class:"flex gap-0.5"},[e.$html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>C(-1)},e.$html("img",{src:B,class:"opacity-40"})),e.$html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>S(-1)},e.$html("img",{src:$,class:"opacity-40"}))]),e.$html("span",{class:"font-bold uppercase flex-1 text-center"},[()=>d().toLocaleString("es-ES",{month:"short",year:"numeric"})]),e.$html("div",{class:"flex gap-0.5"},[e.$html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>S(1)},e.$html("img",{src:v,class:"opacity-40"})),e.$html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>C(1)},e.$html("img",{src:w,class:"opacity-40"}))])]),e.$html("div",{class:"grid grid-cols-7 gap-1",onmouseleave:()=>m(null)},[...["L","M","X","J","V","S","D"].map(t=>e.$html("div",{class:"text-[10px] opacity-40 font-bold text-center"},t)),()=>{const t=d(),o=t.getFullYear(),n=t.getMonth(),s=new Date(o,n,1).getDay(),A=0===s?6:s-1,c=new Date(o,n+1,0).getDate(),r=[];for(let t=0;t<A;t++)r.push(e.$html("div"));for(let t=1;t<=c;t++){const s=new Date(o,n,t),A=f(s);r.push(e.$html("button",{type:"button",class:()=>{const t=l(a),e=m(),o="string"==typeof t?t.split("T")[0]===A:t?.start===A,n=t?.end===A;let s=!1;if(h()&&t?.start){const l=t.start;!t.end&&e?s=A>l&&A<=e||A<l&&A>=e:t.end&&(s=A>l&&A<t.end)}return`btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative ${o||n?"btn-primary z-10":s?"bg-primary/20 border-none rounded-none":"btn-ghost"} ${A===b?"ring-1 ring-primary ring-inset font-black text-primary":""}`},onmouseenter:()=>{h()&&m(A)},onclick:()=>x(s)},[t.toString()]))}return r}]),A?e.$html("div",{class:"mt-3 pt-2 border-t border-base-300"},[h()?e.$html("div",{class:"flex gap-4"},[U({value:u,onChange:t=>{u(t);const e=l(a);e?.start&&a({...e,startHour:t})}}),U({value:p,onChange:t=>{p(t);const e=l(a);e?.end&&a({...e,endHour:t})}})]):U({value:u,onChange:t=>{u(t);const e=l(a);e&&"string"==typeof e&&e.includes("-")&&a(e.split("T")[0]+"T"+String(t).padStart(2,"0")+":00:00")}})]):null])),e.$if(r,()=>e.$html("div",{class:"fixed inset-0 z-[90]",onclick:()=>r(!1)}))])};const H=t=>e.$html("div",{class:a("drawer",t.class)},[e.$html("input",{id:t.id,type:"checkbox",class:"drawer-toggle",checked:t.open}),e.$html("div",{class:"drawer-content"},t.content),e.$html("div",{class:"drawer-side"},[e.$html("label",{for:t.id,class:"drawer-overlay",onclick:()=>t.open?.(!1)}),e.$html("div",{class:"min-h-full bg-base-200 w-80"},t.side)])]);const O=(t,a)=>{const{label:o,icon:n,...s}=t;return e.$html("div",{...s,class:()=>`dropdown ${l(t.class)||t.class||""}`},[e.$html("div",{tabindex:0,role:"button",class:"btn m-1 flex items-center gap-2"},[n?"function"==typeof n?n():n:null,o?"function"==typeof o?o():o:null]),e.$html("ul",{tabindex:0,class:"dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300"},["function"==typeof a?a():a])])};const F=t=>{const{icon:a,label:o,actions:n=[],position:s="bottom-6 right-6",...A}=t;return e.$html("div",{...A,class:()=>`fab fixed ${l(s)} flex flex-col-reverse items-end gap-3 z-[100] ${t.class||""}`},[e.$html("div",{tabindex:0,role:"button",class:"btn btn-lg btn-circle btn-primary shadow-2xl"},[a?"function"==typeof a?a():a:null,!a&&o?o:null]),...l(n).map(t=>e.$html("div",{class:"flex items-center gap-3 transition-all duration-300"},[t.label?e.$html("span",{class:"badge badge-ghost shadow-sm whitespace-nowrap"},t.label):null,e.$html("button",{type:"button",class:`btn btn-circle shadow-lg ${t.class||""}`,onclick:e=>{e.stopPropagation(),t.onclick?.(e)}},[t.icon?"function"==typeof t.icon?t.icon():t.icon:t.text||""])]))])};const Q=(t,o)=>e.$html("fieldset",{...t,class:a("fieldset bg-base-200 border border-base-300 p-4 rounded-lg",t.class)},[()=>{const a=l(t.legend);return a?e.$html("legend",{class:"fieldset-legend font-bold"},[a]):null},o]);const N=t=>{const{tooltip:l,max:a=2,accept:o="*",onSelect:n}=t,s=e.$([]),A=e.$(!1),c=e.$(null),i=1024*a*1024,d=t=>{const e=Array.from(t);c(null);e.find(t=>t.size>i)?c(`Máx ${a}MB`):(s([...s(),...e]),n?.(s()))};return e.$html("fieldset",{class:"fieldset w-full p-0"},[e.$html("div",{class:()=>"w-full "+(l?"tooltip tooltip-top before:z-50 after:z-50":""),"data-tip":l},[e.$html("label",{class:()=>`\n relative flex items-center justify-between w-full h-12 px-4\n border-2 border-dashed rounded-lg cursor-pointer\n transition-all duration-200\n ${A()?"border-primary bg-primary/10":"border-base-content/20 bg-base-100 hover:bg-base-200"}\n `,ondragover:t=>{t.preventDefault(),A(!0)},ondragleave:()=>A(!1),ondrop:t=>{t.preventDefault(),A(!1),d(t.dataTransfer.files)}},[e.$html("div",{class:"flex items-center gap-3 w-full"},[e.$html("img",{src:x,class:"w-5 h-5 opacity-50 shrink-0"}),e.$html("span",{class:"text-sm opacity-70 truncate grow text-left"},"Arrastra o selecciona archivos..."),e.$html("span",{class:"text-[10px] opacity-40 shrink-0"},`Máx ${a}MB`)]),e.$html("input",{type:"file",multiple:!0,accept:o,class:"hidden",onchange:t=>d(t.target.files)})])]),()=>c()?e.$html("span",{class:"text-[10px] text-error mt-1 px-1 font-medium"},c()):null,e.$if(()=>s().length>0,()=>e.$html("ul",{class:"mt-2 space-y-1"},[e.$for(s,(t,l)=>e.$html("li",{class:"flex items-center justify-between p-1.5 pl-3 text-xs bg-base-200/50 rounded-md border border-base-300"},[e.$html("div",{class:"flex items-center gap-2 truncate"},[e.$html("span",{class:"opacity-50"},"📄"),e.$html("span",{class:"truncate font-medium max-w-[200px]"},t.name),e.$html("span",{class:"text-[9px] opacity-40"},`(${(t.size/1024).toFixed(0)} KB)`)]),e.$html("button",{type:"button",class:"btn btn-ghost btn-xs btn-circle",onclick:t=>{t.preventDefault(),t.stopPropagation(),(t=>{const e=s().filter((e,l)=>l!==t);s(e),n?.(e)})(l)}},[e.$html("img",{src:r,class:"w-3 h-3 opacity-70"})])]),t=>t.name+t.lastModified)]))])};const L=(t,l)=>e.$html("div",{class:a("indicator",t.class)},[l,e.$html("span",{class:a("indicator-item badge",t.badgeClass)},t.badge)]);const T=t=>{const{items:o,header:n,render:s,keyFn:A,class:c}=t;return e.$html("ul",{class:a("list bg-base-100 rounded-box shadow-md",c)},[e.$if(n,()=>e.$html("li",{class:"p-4 pb-2 text-xs opacity-60 tracking-wide"},[l(n)])),e.$for(o,(t,l)=>e.$html("li",{class:"list-row"},[s(t,l)]),A)])};const G=t=>e.$if(t.$show,()=>e.$html("div",{class:"fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm bg-base-100/30"},[e.$html("span",{class:"loading loading-spinner loading-lg text-primary"})]));const M=t=>{const o=t=>e.$for(()=>t||[],t=>e.$html("li",{},[t.children?e.$html("details",{open:t.open},[e.$html("summary",{},[t.icon&&e.$html("span",{class:"mr-2"},t.icon),t.label]),e.$html("ul",{},o(t.children))]):e.$html("a",{class:()=>l(t.active)?"active":"",onclick:t.onclick},[t.icon&&e.$html("span",{class:"mr-2"},t.icon),t.label])]),(t,e)=>t.label||e);return e.$html("ul",{...t,class:a("menu bg-base-200 rounded-box",t.class)},o(t.items))};const J=(t,l)=>{const{title:a,buttons:o,open:n,...s}=t,A=()=>n(!1);return e.$if(n,()=>e.$html("dialog",{...s,class:"modal modal-open"},[e.$html("div",{class:"modal-box"},[a?e.$html("h3",{class:"text-lg font-bold mb-4"},a):null,"function"==typeof l?l():l,e.$html("div",{class:"modal-action flex gap-2"},[...(Array.isArray(o)?o:[o]).filter(Boolean),E({onclick:A},R("close")())])]),e.$html("form",{method:"dialog",class:"modal-backdrop",onclick:t=>(t.preventDefault(),A())},[e.$html("button",{},"close")])]))};const K=(t,l)=>e.$html("div",{...t,class:a("navbar bg-base-100 shadow-sm px-4",t.class)},l);const P=t=>{const{label:o,tooltip:n,value:s,...A}=t,c=e.$html("input",{...A,type:"radio",class:a("radio",t.class),checked:()=>l(s)===t.value,disabled:()=>l(t.disabled),onclick:()=>"function"==typeof s&&s(t.value)});if(!o&&!n)return c;const r=e.$html("label",{class:"label cursor-pointer justify-start gap-3"},[c,o?e.$html("span",{class:"label-text"},o):null]);return n?e.$html("div",{class:"tooltip","data-tip":n},r):r};const X=t=>{const{label:o,tooltip:n,value:s,...A}=t,c=e.$html("input",{...A,type:"range",class:a("range",t.class),value:s,disabled:()=>l(t.disabled)});if(!o&&!n)return c;const r=e.$html("div",{class:"flex flex-col gap-2"},[o?e.$html("span",{class:"label-text"},o):null,c]);return n?e.$html("div",{class:"tooltip","data-tip":n},r):r};const Z=t=>{const{value:a,count:o=5,mask:n="mask-star",readonly:s=!1,...A}=t,c=`rating-${Math.random().toString(36).slice(2,7)}`;return e.$html("div",{...A,class:()=>`rating ${l(s)?"pointer-events-none":""} ${t.class||""}`},Array.from({length:l(o)},(t,o)=>{const A=o+1;return e.$html("input",{type:"radio",name:c,class:`mask ${n}`,"aria-label":`${A} star`,checked:()=>Math.round(l(a))===A,onchange:()=>{l(s)||"function"!=typeof a||a(A)}})}))};const W=t=>{const{label:o,options:n,value:s,...A}=t,c=e.$html("select",{...A,class:a("select select-bordered w-full",t.class),value:s},e.$for(()=>l(n)||[],t=>e.$html("option",{value:t.value,$selected:()=>String(l(s))===String(t.value)},t.label),t=>t.value));return o?e.$html("label",{class:"fieldset-label flex flex-col gap-1"},[e.$html("span",{},o),c]):c};const q=(t,l)=>e.$html("div",{...t,class:a("stack",t.class)},l);const tt=t=>e.$html("div",{...t,class:a("stat",t.class)},[t.icon&&e.$html("div",{class:"stat-figure text-secondary"},t.icon),t.label&&e.$html("div",{class:"stat-title"},t.label),e.$html("div",{class:"stat-value"},()=>l(t.value)??t.value),t.desc&&e.$html("div",{class:"stat-desc"},t.desc)]);const et=t=>e.$html("label",{class:a("swap",t.class)},[e.$html("input",{type:"checkbox",checked:t.value}),e.$html("div",{class:"swap-on"},t.on),e.$html("div",{class:"swap-off"},t.off)]);const lt=t=>{const{items:o=[],columns:n=[],keyFn:s,zebra:A=!1,pinRows:c=!1,empty:r=R("nodata")(),...i}=t;return e.$html("div",{class:"overflow-x-auto w-full bg-base-100 rounded-box border border-base-300"},[e.$html("table",{...i,class:()=>a("table",`${l(A)?"table-zebra":""} ${l(c)?"table-pin-rows":""} ${t.class||""}`)},[e.$html("thead",{},[e.$html("tr",{},n.map(t=>e.$html("th",{class:t.class||""},t.label)))]),e.$html("tbody",{},[e.$for(o,(t,a)=>e.$html("tr",{class:"hover"},n.map(o=>e.$html("td",{class:o.class||""},[()=>{if(o.render)return o.render(t,a);const e=t[o.key];return l(e)}]))),s||((t,e)=>t.id||e)),e.$if(()=>0===l(o).length,()=>e.$html("tr",{},[e.$html("td",{colspan:n.length,class:"text-center p-10 opacity-50"},[l(r)])]))]),e.$if(()=>n.some(t=>t.footer),()=>e.$html("tfoot",{},[e.$html("tr",{},n.map(t=>e.$html("th",{},t.footer||"")))]))])])};const at=t=>{const{items:o,...n}=t,s="function"==typeof o?o:()=>o||[];return e.$html("div",{...n,class:"flex flex-col gap-4 w-full"},[e.$html("div",{role:"tablist",class:a("tabs tabs-box",t.class)},e.$for(s,t=>e.$html("a",{role:"tab",class:()=>a("tab",l(t.active)&&"tab-active",l(t.disabled),t.tip),"data-tip":t.tip,onclick:e=>!l(t.disabled)&&t.onclick?.(e)},t.label),t=>t.label)),()=>{const t=s().find(t=>l(t.active));if(!t)return null;const a=l(t.content);return e.$html("div",{class:"p-4"},["function"==typeof a?a():a])}])};const ot=t=>{const{items:a=[],vertical:o=!0,compact:n=!1,...s}=t,A={info:h,success:g,warning:f,error:b};return e.$html("ul",{...s,class:()=>`timeline ${l(o)?"timeline-vertical":"timeline-horizontal"} ${l(n)?"timeline-compact":""} ${t.class||""}`},[e.$for(a,(t,o)=>{const n=0===o,s=o===l(a).length-1,c=t.type||"success",r=t=>"function"==typeof t?t():t;return e.$html("li",{class:"flex-1"},[n?null:e.$html("hr",{class:t.completed?"bg-primary":""}),e.$html("div",{class:"timeline-start"},[r(t.title)]),e.$html("div",{class:"timeline-middle"},[e.$html("img",{src:A[c]||t.icon||A.success,class:"w-4 h-4 object-contain mx-1",alt:c})]),e.$html("div",{class:"timeline-end timeline-box shadow-sm"},[r(t.detail)]),s?null:e.$html("hr",{class:t.completed?"bg-primary":""})])},(t,e)=>t.id||e)])};const nt=(t,l="alert-success",a=3500)=>{let o=document.getElementById("sigpro-toast-container");o||(o=e.$html("div",{id:"sigpro-toast-container",class:"fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none"}),document.body.appendChild(o));const n=e.$html("div",{style:"display: contents"});let s;o.appendChild(n);const A=()=>{clearTimeout(s);const t=n.firstElementChild;t&&!t.classList.contains("opacity-0")?(t.classList.add("translate-x-full","opacity-0"),setTimeout(()=>{c.destroy(),n.remove(),o.hasChildNodes()||o.remove()},300)):(c.destroy(),n.remove())},c=e.$mount(()=>{const a=e.$html("div",{class:`alert alert-soft ${l} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`},[e.$html("span",{},["function"==typeof t?t():t]),E({class:"btn-xs btn-circle btn-ghost",onclick:A},"✕")]);return requestAnimationFrame(()=>a.classList.remove("translate-x-10","opacity-0")),a},n);return a>0&&(s=setTimeout(A,a)),A};const st=(t,l)=>e.$html("div",{...t,class:a("tooltip",t.class),"data-tip":t.tip},l);const At={...s,...C,...Object.freeze({__proto__:null,Autocomplete:_}),...Object.freeze({__proto__:null,Badge:z}),...Object.freeze({__proto__:null,Button:E}),...Object.freeze({__proto__:null,Checkbox:I}),...Object.freeze({__proto__:null,Colorpicker:Y}),...Object.freeze({__proto__:null,Datepicker:V}),...Object.freeze({__proto__:null,Drawer:H}),...Object.freeze({__proto__:null,Dropdown:O}),...Object.freeze({__proto__:null,Fab:F}),...Object.freeze({__proto__:null,Fieldset:Q}),...Object.freeze({__proto__:null,Fileinput:N}),...Object.freeze({__proto__:null,Indicator:L}),...j,...Object.freeze({__proto__:null,List:T}),...Object.freeze({__proto__:null,Loading:G}),...Object.freeze({__proto__:null,Menu:M}),...Object.freeze({__proto__:null,Modal:J}),...Object.freeze({__proto__:null,Navbar:K}),...Object.freeze({__proto__:null,Radio:P}),...Object.freeze({__proto__:null,Range:X}),...Object.freeze({__proto__:null,Rating:Z}),...Object.freeze({__proto__:null,Select:W}),...Object.freeze({__proto__:null,Stack:q}),...Object.freeze({__proto__:null,Stat:tt}),...Object.freeze({__proto__:null,Swap:et}),...Object.freeze({__proto__:null,Table:lt}),...Object.freeze({__proto__:null,Tabs:at}),...Object.freeze({__proto__:null,Timeline:ot}),...Object.freeze({__proto__:null,Toast:nt}),...Object.freeze({__proto__:null,Tooltip:st})};var ct={...At,install:(t=window)=>{Object.entries(At).forEach(([e,l])=>{t[e]=l}),console.log("🚀 SigproUI")}},rt=Object.freeze({__proto__:null,Accordion:n,Alert:S,Autocomplete:_,Badge:z,Button:E,Checkbox:I,Colorpicker:Y,Datepicker:V,Drawer:H,Dropdown:O,Fab:F,Fieldset:Q,Fileinput:N,Indicator:L,Input:D,List:T,Loading:G,Menu:M,Modal:J,Navbar:K,Radio:P,Range:X,Rating:Z,Select:W,Stack:q,Stat:tt,Swap:et,Table:lt,Tabs:at,Timeline:ot,Toast:nt,Tooltip:st,default:ct});const it={...rt,Icons:y,Utils:o,tt:R,install:(t=("undefined"!=typeof window?window:{}))=>{Object.entries(rt).forEach(([e,l])=>{t[e]=l}),t.Icons=y,t.Utils=o,t.tt=R,console.log("🌟 SigproUI")}};return"undefined"!=typeof window&&it.install(window),t.Accordion=n,t.Alert=S,t.Autocomplete=_,t.Badge=z,t.Button=E,t.Checkbox=I,t.Colorpicker=Y,t.Datepicker=V,t.Drawer=H,t.Dropdown=O,t.Fab=F,t.Fieldset=Q,t.Fileinput=N,t.Indicator=L,t.Input=D,t.List=T,t.Loading=G,t.Menu=M,t.Modal=J,t.Navbar=K,t.Radio=P,t.Range=X,t.Rating=Z,t.Select=W,t.Stack=q,t.Stat=tt,t.Swap=et,t.Table=lt,t.Tabs=at,t.Timeline=ot,t.Toast=nt,t.Tooltip=st,t.default=it,t.icon123=u,t.iconAbc=m,t.iconCalendar=i,t.iconClose=r,t.iconError=b,t.iconHide=c,t.iconInfo=h,t.iconLLeft=B,t.iconLeft=$,t.iconLock=d,t.iconMail=p,t.iconRRight=w,t.iconRight=v,t.iconShow=A,t.iconSuccess=g,t.iconUpload=x,t.iconWarning=f,t.joinClass=a,t.tt=R,t.val=l,Object.defineProperty(t,"__esModule",{value:!0}),t}({},SigPro);
package/index.js ADDED
@@ -0,0 +1,40 @@
1
+ /**
2
+ * SigproUI - Entry Point
3
+ */
4
+
5
+ import * as Components from './src/components/index.js';
6
+
7
+ import * as Icons from './src/core/icons.js';
8
+ import * as Utils from './src/core/utils.js';
9
+ import { tt } from './src/core/i18n.js';
10
+
11
+
12
+ export * from './src/components/index.js';
13
+ export * from './src/core/icons.js';
14
+ export * from './src/core/utils.js';
15
+ export { tt };
16
+
17
+ const SigproUI = {
18
+ ...Components,
19
+ Icons,
20
+ Utils,
21
+ tt,
22
+
23
+ install: (target = (typeof window !== 'undefined' ? window : {})) => {
24
+ Object.entries(Components).forEach(([name, component]) => {
25
+ target[name] = component;
26
+ });
27
+
28
+ target.Icons = Icons;
29
+ target.Utils = Utils;
30
+ target.tt = tt;
31
+
32
+ console.log("🌟 SigproUI");
33
+ }
34
+ };
35
+
36
+ if (typeof window !== 'undefined') {
37
+ SigproUI.install(window);
38
+ }
39
+
40
+ export default SigproUI;
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "sigpro-ui",
3
+ "version": "1.0.6",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/natxocc/sigpro-ui.git"
7
+ },
8
+ "main": "./dist/sigpro-ui.cjs",
9
+ "module": "./dist/sigpro-ui.esm.js",
10
+ "unpkg": "./dist/sigpro-ui.umd.min.js",
11
+ "jsdelivr": "./dist/sigpro-ui.umd.min.js",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/sigpro-ui.esm.js",
15
+ "require": "./dist/sigpro-ui.cjs"
16
+ }
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/natxocc/sigpro-ui/issues"
20
+ },
21
+ "files": [
22
+ "index.js",
23
+ "src",
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "homepage": "https://natxocc.github.io/sigpro-ui/",
29
+ "keywords": [
30
+ "signals",
31
+ "reactive",
32
+ "sigpro",
33
+ "sigpro components",
34
+ "UI",
35
+ "vanilla-js",
36
+ "reactive-programming"
37
+ ],
38
+ "license": "MIT",
39
+ "scripts": {
40
+ "docs": "bun x serve docs",
41
+ "build": "rollup -c",
42
+ "prepublishOnly": "npm run build"
43
+ },
44
+ "peerDependencies": {
45
+ "sigpro": ">=1.1.16"
46
+ },
47
+ "type": "module",
48
+ "devDependencies": {
49
+ "@rollup/plugin-terser": "^0.4.4",
50
+ "rollup": "^4.34.8"
51
+ }
52
+ }
@@ -0,0 +1,24 @@
1
+ import { $html } from "sigpro";
2
+ import { joinClass } from "../core/utils.js";
3
+
4
+ /** ACCORDION */
5
+ export const Accordion = (props, children) => {
6
+ const { title, name, open, ...rest } = props;
7
+
8
+ return $html(
9
+ "div",
10
+ {
11
+ ...rest,
12
+ class: joinClass("collapse collapse-arrow bg-base-200 mb-2", props.class),
13
+ },
14
+ [
15
+ $html("input", {
16
+ type: name ? "radio" : "checkbox",
17
+ name: name,
18
+ checked: open
19
+ }),
20
+ $html("div", { class: "collapse-title text-xl font-medium" }, title),
21
+ $html("div", { class: "collapse-content" }, children),
22
+ ],
23
+ );
24
+ };
@@ -0,0 +1,50 @@
1
+ import { $html } from "sigpro";
2
+ import { val } from "../core/utils.js";
3
+ import { iconInfo, iconSuccess, iconWarning, iconError } from "../core/icons.js";
4
+
5
+ /** ALERT */
6
+ export const Alert = (props, children) => {
7
+ const { type = "info", soft = true, ...rest } = props;
8
+
9
+ const icons = {
10
+ info: iconInfo,
11
+ success: iconSuccess,
12
+ warning: iconWarning,
13
+ error: iconError,
14
+ };
15
+
16
+ const typeClass = () => {
17
+ const t = val(type);
18
+ const map = {
19
+ info: "alert-info",
20
+ success: "alert-success",
21
+ warning: "alert-warning",
22
+ error: "alert-error",
23
+ };
24
+ return map[t] || t;
25
+ };
26
+
27
+ const content = children || props.message;
28
+
29
+ return $html(
30
+ "div",
31
+ {
32
+ ...rest,
33
+ role: "alert",
34
+ class: () => `alert ${typeClass()} ${val(soft) ? "alert-soft" : ""} ${props.class || ""}`,
35
+ },
36
+ [
37
+ $html("img", {
38
+ src: icons[val(type)] || icons.info,
39
+ class: "w-4 h-4 object-contain",
40
+ alt: val(type),
41
+ }),
42
+ $html("div", { class: "flex-1" }, [
43
+ $html("span", {}, [typeof content === "function" ? content() : content])
44
+ ]),
45
+ props.actions ? $html("div", { class: "flex-none" }, [
46
+ typeof props.actions === "function" ? props.actions() : props.actions
47
+ ]) : null,
48
+ ],
49
+ );
50
+ };
@@ -0,0 +1,95 @@
1
+ import { $, $html, $for } from "sigpro";
2
+ import { val } from "../core/utils.js";
3
+ import { tt } from "../core/i18n.js";
4
+ import { Input } from "./Input.js"; // Importamos el componente hermano
5
+
6
+ /** AUTOCOMPLETE */
7
+ export const Autocomplete = (props) => {
8
+ const { options = [], value, onSelect, label, placeholder, ...rest } = props;
9
+
10
+ const query = $(val(value) || "");
11
+ const isOpen = $(false);
12
+ const cursor = $(-1);
13
+
14
+ const list = $(() => {
15
+ const q = query().toLowerCase();
16
+ const data = val(options) || [];
17
+ return q
18
+ ? data.filter((o) => (typeof o === "string" ? o : o.label).toLowerCase().includes(q))
19
+ : data;
20
+ });
21
+
22
+ const pick = (opt) => {
23
+ const valStr = typeof opt === "string" ? opt : opt.value;
24
+ const labelStr = typeof opt === "string" ? opt : opt.label;
25
+
26
+ query(labelStr);
27
+ if (typeof value === "function") value(valStr);
28
+ onSelect?.(opt);
29
+
30
+ isOpen(false);
31
+ cursor(-1);
32
+ };
33
+
34
+ const nav = (e) => {
35
+ const items = list();
36
+ if (e.key === "ArrowDown") {
37
+ e.preventDefault();
38
+ isOpen(true);
39
+ cursor(Math.min(cursor() + 1, items.length - 1));
40
+ } else if (e.key === "ArrowUp") {
41
+ e.preventDefault();
42
+ cursor(Math.max(cursor() - 1, 0));
43
+ } else if (e.key === "Enter" && cursor() >= 0) {
44
+ e.preventDefault();
45
+ pick(items[cursor()]);
46
+ } else if (e.key === "Escape") {
47
+ isOpen(false);
48
+ }
49
+ };
50
+
51
+ return $html("div", { class: "relative w-full" }, [
52
+ Input({
53
+ label,
54
+ placeholder: placeholder || tt("search")(),
55
+ value: query,
56
+ onfocus: () => isOpen(true),
57
+ onblur: () => setTimeout(() => isOpen(false), 150),
58
+ onkeydown: nav,
59
+ oninput: (e) => {
60
+ const v = e.target.value;
61
+ query(v);
62
+ if (typeof value === "function") value(v);
63
+ isOpen(true);
64
+ cursor(-1);
65
+ },
66
+ ...rest,
67
+ }),
68
+ $html(
69
+ "ul",
70
+ {
71
+ class: "absolute left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50",
72
+ style: () => (isOpen() && list().length ? "display:block" : "display:none"),
73
+ },
74
+ [
75
+ $for(
76
+ list,
77
+ (opt, i) =>
78
+ $html("li", {}, [
79
+ $html(
80
+ "a",
81
+ {
82
+ class: () => `block w-full ${cursor() === i ? "active bg-primary text-primary-content" : ""}`,
83
+ onclick: () => pick(opt),
84
+ onmouseenter: () => cursor(i),
85
+ },
86
+ typeof opt === "string" ? opt : opt.label,
87
+ ),
88
+ ]),
89
+ (opt, i) => (typeof opt === "string" ? opt : opt.value) + i,
90
+ ),
91
+ () => (list().length ? null : $html("li", { class: "p-2 text-center opacity-50" }, "No results")),
92
+ ],
93
+ ),
94
+ ]);
95
+ };
@@ -0,0 +1,6 @@
1
+ import { $html } from "sigpro";
2
+ import { joinClass } from "../core/utils.js";
3
+
4
+ /** BADGE */
5
+ export const Badge = (props, children) =>
6
+ $html("span", { ...props, class: joinClass("badge", props.class) }, children);
@@ -0,0 +1,39 @@
1
+ import { $html } from "sigpro";
2
+ import { val, joinClass } from "../core/utils.js";
3
+
4
+ /** BUTTON */
5
+ export const Button = (props, children) => {
6
+ const { badge, badgeClass, tooltip, icon, loading, ...rest } = props;
7
+
8
+ const btn = $html(
9
+ "button",
10
+ {
11
+ ...rest,
12
+ // Usamos props.class directamente
13
+ class: joinClass("btn", props.class),
14
+ disabled: () => val(loading) || val(props.disabled),
15
+ },
16
+ [
17
+ () => (val(loading) ? $html("span", { class: "loading loading-spinner" }) : null),
18
+ icon ? $html("span", { class: "mr-1" }, icon) : null,
19
+ children,
20
+ ]
21
+ );
22
+
23
+ let out = btn;
24
+
25
+ if (badge) {
26
+ out = $html("div", { class: "indicator" }, [
27
+ $html(
28
+ "span",
29
+ { class: joinClass("indicator-item badge", badgeClass || "badge-secondary") },
30
+ badge
31
+ ),
32
+ out,
33
+ ]);
34
+ }
35
+
36
+ return tooltip
37
+ ? $html("div", { class: "tooltip", "data-tip": tooltip }, out)
38
+ : out;
39
+ };
@@ -0,0 +1,21 @@
1
+ import { $html } from "sigpro";
2
+ import { val } from "../core/utils.js";
3
+
4
+ /** CHECKBOX */
5
+ export const Checkbox = (props) => {
6
+ const { value, tooltip, toggle, label, ...rest } = props;
7
+
8
+ const checkEl = $html("input", {
9
+ ...rest,
10
+ type: "checkbox",
11
+ class: () => (val(toggle) ? "toggle" : "checkbox"),
12
+ checked: value
13
+ });
14
+
15
+ const layout = $html("label", { class: "label cursor-pointer justify-start gap-3" }, [
16
+ checkEl,
17
+ label ? $html("span", { class: "label-text" }, label) : null,
18
+ ]);
19
+
20
+ return tooltip ? $html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout;
21
+ };
@@ -0,0 +1,81 @@
1
+ import { $, $html, $if } from "sigpro";
2
+ import { val } from "../core/utils.js";
3
+
4
+ /** COLORPICKER */
5
+ export const Colorpicker = (props) => {
6
+ const { value, label, ...rest } = props;
7
+ const isOpen = $(false);
8
+
9
+ const palette = [
10
+ ...["#000", "#1A1A1A", "#333", "#4D4D4D", "#666", "#808080", "#B3B3B3", "#FFF"],
11
+ ...["#450a0a", "#7f1d1d", "#991b1b", "#b91c1c", "#dc2626", "#ef4444", "#f87171", "#fca5a5"],
12
+ ...["#431407", "#7c2d12", "#9a3412", "#c2410c", "#ea580c", "#f97316", "#fb923c", "#ffedd5"],
13
+ ...["#713f12", "#a16207", "#ca8a04", "#eab308", "#facc15", "#fde047", "#fef08a", "#fff9c4"],
14
+ ...["#064e3b", "#065f46", "#059669", "#10b981", "#34d399", "#4ade80", "#84cc16", "#d9f99d"],
15
+ ...["#082f49", "#075985", "#0284c7", "#0ea5e9", "#38bdf8", "#7dd3fc", "#22d3ee", "#cffafe"],
16
+ ...["#1e1b4b", "#312e81", "#4338ca", "#4f46e5", "#6366f1", "#818cf8", "#a5b4fc", "#e0e7ff"],
17
+ ...["#2e1065", "#4c1d95", "#6d28d9", "#7c3aed", "#8b5cf6", "#a855f7", "#d946ef", "#fae8ff"],
18
+ ];
19
+
20
+ const getColor = () => val(value) || "#000000";
21
+
22
+ return $html("div", { class: "relative w-fit" }, [
23
+ $html(
24
+ "button",
25
+ {
26
+ type: "button",
27
+ class: "btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case",
28
+ onclick: (e) => {
29
+ e.stopPropagation();
30
+ isOpen(!isOpen());
31
+ },
32
+ ...rest,
33
+ },
34
+ [
35
+ $html("div", {
36
+ class: "size-5 rounded-sm shadow-inner border border-black/10 shrink-0",
37
+ style: () => `background-color: ${getColor()}`,
38
+ }),
39
+ label ? $html("span", { class: "opacity-80" }, label) : null,
40
+ ],
41
+ ),
42
+
43
+ $if(isOpen, () =>
44
+ $html(
45
+ "div",
46
+ {
47
+ class: "absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none",
48
+ onclick: (e) => e.stopPropagation(),
49
+ },
50
+ [
51
+ $html(
52
+ "div",
53
+ { class: "grid grid-cols-8 gap-1" },
54
+ palette.map((c) =>
55
+ $html("button", {
56
+ type: "button",
57
+ style: `background-color: ${c}`,
58
+ class: () => {
59
+ const active = getColor().toLowerCase() === c.toLowerCase();
60
+ return `size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5
61
+ ${active ? "ring-2 ring-offset-1 ring-primary z-10 scale-110" : ""}`;
62
+ },
63
+ onclick: () => {
64
+ if (typeof value === "function") value(c);
65
+ isOpen(false);
66
+ },
67
+ }),
68
+ ),
69
+ ),
70
+ ],
71
+ ),
72
+ ),
73
+
74
+ $if(isOpen, () =>
75
+ $html("div", {
76
+ class: "fixed inset-0 z-[100]",
77
+ onclick: () => isOpen(false),
78
+ }),
79
+ ),
80
+ ]);
81
+ };