siesa-ui-kit 1.0.10 → 1.0.11
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkaxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Select/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Select/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAgB9D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAgBtD,CAAC"}
|
package/dist/siesa-ui-kit.cjs
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
disabled:opacity-50
|
|
67
67
|
disabled:cursor-not-allowed
|
|
68
68
|
disabled:pointer-events-none
|
|
69
|
-
`,w=i?"w-full":"",N=[y,g[s],C[t],w,c].join(" ").replace(/\s+/g," ").trim(),B=
|
|
69
|
+
`,w=i?"w-full":"",N=[y,g[s],C[t],w,c].join(" ").replace(/\s+/g," ").trim(),B=R=>R?e.jsx("span",{className:`inline-flex items-center justify-center ${f[s]}`,children:R}):null,k=()=>n?B(r):e.jsxs(e.Fragment,{children:[r&&B(r),o&&e.jsx("span",{className:j[s],children:o}),a&&B(a)]}),$={zinc:{bg:"bg-zinc-600",text:"text-white"},red:{bg:"bg-red-700",text:"text-white"},orange:{bg:"bg-orange-700",text:"text-white"},amber:{bg:"bg-amber-700",text:"text-white"},yellow:{bg:"bg-yellow-700",text:"text-white"},lime:{bg:"bg-lime-700",text:"text-white"},green:{bg:"bg-green-700",text:"text-white"},emerald:{bg:"bg-emerald-700",text:"text-white"},teal:{bg:"bg-teal-700",text:"text-white"},cyan:{bg:"bg-cyan-700",text:"text-white"},sky:{bg:"bg-sky-700",text:"text-white"},blue:{bg:"bg-blue-700",text:"text-white"},indigo:{bg:"bg-indigo-700",text:"text-white"},violet:{bg:"bg-violet-700",text:"text-white"},purple:{bg:"bg-purple-700",text:"text-white"},fuchsia:{bg:"bg-fuchsia-700",text:"text-white"},pink:{bg:"bg-pink-700",text:"text-white"},rose:{bg:"bg-rose-700",text:"text-white"},primary:{bg:"bg-primary-custom-600",text:"text-white"},secondary:{bg:"bg-zinc-600",text:"text-white"},tertiary:{bg:"bg-zinc-600",text:"text-white"}},I=$[p]||$.red,D=()=>!b&&u===void 0?null:u!==void 0?e.jsx("span",{className:`
|
|
70
70
|
absolute
|
|
71
71
|
-top-1
|
|
72
72
|
-right-1
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
rounded-xs
|
|
382
382
|
min-w-[12px]
|
|
383
383
|
${d.notificationBg}
|
|
384
|
-
`.trim().replace(/\s+/g," "),children:e.jsx("span",{className:`font-sans text-xs leading-4 ${d.notificationText}`,children:r})})]})});P.displayName="Badge";const G=v.forwardRef(({value:t,defaultValue:s=0,onChange:n,min:r=0,max:a,label:o,linkText:l,onLinkClick:c,helperText:d,error:m=!1,disabled:i=!1,className:x="",...b},u)=>{const[p,h]=v.useState(s),g=t!==void 0,f=g?t:p;v.useEffect(()=>{g||h(s)},[s,g]);const j=
|
|
384
|
+
`.trim().replace(/\s+/g," "),children:e.jsx("span",{className:`font-sans text-xs leading-4 ${d.notificationText}`,children:r})})]})});P.displayName="Badge";const G=v.forwardRef(({value:t,defaultValue:s=0,onChange:n,min:r=0,max:a,label:o,linkText:l,onLinkClick:c,helperText:d,error:m=!1,disabled:i=!1,className:x="",...b},u)=>{const[p,h]=v.useState(s),g=t!==void 0,f=g?t:p;v.useEffect(()=>{g||h(s)},[s,g]);const j=R=>{let T=R;r!==void 0&&T<r&&(T=r),a!==void 0&&T>a&&(T=a),g||h(T),n?.(T)},C=()=>{i||j(f-1)},y=()=>{i||j(f+1)},w=i||r!==void 0&&f<=r,N=i||a!==void 0&&f>=a,B=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),k=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8 3V13M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),$=m?"border-error-border dark:border-error-border":"border-border-primary dark:border-dark-border-primary",I=!i&&!m?"hover:border-[#f9f9f9] dark:hover:border-[#f9f9f9]":"",D=!i&&!m?"focus-within:border-2 focus-within:border-[#329cff] dark:focus-within:border-[#329cff]":"";return e.jsxs("div",{ref:u,className:`flex flex-col gap-2 ${x}`.trim(),...b,children:[o&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm leading-5 font-bold text-content-primary dark:text-dark-content-primary",children:o}),l&&e.jsx("button",{type:"button",onClick:c,disabled:i,className:`
|
|
385
385
|
text-xs leading-4
|
|
386
386
|
text-primary-custom-600
|
|
387
387
|
hover:underline
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
`.trim().replace(/\s+/g," "),"aria-label":"Incrementar",children:e.jsx(k,{})})]}),d&&e.jsx("p",{className:`
|
|
430
430
|
text-sm leading-5
|
|
431
431
|
${m?"text-error-content dark:text-error-content":"text-content-tertiary dark:text-content-tertiary"}
|
|
432
|
-
`.trim().replace(/\s+/g," "),children:d})]})});G.displayName="Quantity";const he=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"w-4 h-4",children:e.jsx("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),ke=({variant:t="default",children:s,items:n,open:r,onOpenChange:a,disabled:o=!1,className:l="",menuClassName:c="",ariaLabel:d,placeholder:m="Options"})=>{const[i,x]=v.useState(!1),[b,u]=v.useState("bottom-left"),p=v.useRef(null),h=v.useRef(null),g=r!==void 0,f=g?r:i,j=v.useCallback(()=>{if(!p.current)return;const k=p.current.getBoundingClientRect(),$=window.innerWidth,I=window.innerHeight,D=200,
|
|
432
|
+
`.trim().replace(/\s+/g," "),children:d})]})});G.displayName="Quantity";const he=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"w-4 h-4",children:e.jsx("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),ke=({variant:t="default",children:s,items:n,open:r,onOpenChange:a,disabled:o=!1,className:l="",menuClassName:c="",ariaLabel:d,placeholder:m="Options"})=>{const[i,x]=v.useState(!1),[b,u]=v.useState("bottom-left"),p=v.useRef(null),h=v.useRef(null),g=r!==void 0,f=g?r:i,j=v.useCallback(()=>{if(!p.current)return;const k=p.current.getBoundingClientRect(),$=window.innerWidth,I=window.innerHeight,D=200,R=250,T=I-k.bottom,E=k.top,L=$-k.left,M=k.right,A=T<R&&E>T,F=L<D&&M>L;u(A&&F?"top-right":A?"top-left":F?"bottom-right":"bottom-left")},[]),C=()=>{if(o)return;const k=!f;k&&j(),g||x(k),a?.(k)};v.useEffect(()=>{const k=$=>{p.current&&!p.current.contains($.target)&&(g||x(!1),a?.(!1))};if(f)return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[f,g,a]),v.useEffect(()=>{const k=$=>{$.key==="Escape"&&f&&(g||x(!1),a?.(!1))};if(f)return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[f,g,a]);const y=k=>{k.disabled||k.isDivider||k.isHeading||(k.onClick&&k.onClick({}),g||x(!1),a?.(!1))},w=["inline-flex","items-center","justify-center","rounded-lg","font-bold","text-sm","whitespace-nowrap","transition-all","duration-150",t==="icon-only"?"w-9 h-9":"gap-3 px-3 py-2","bg-bg-primary","text-content-secondary","border","border-border-primary","hover:bg-background-secondary","active:scale-95","dark:bg-dark-bg-primary","dark:text-dark-content-primary","dark:border-dark-border-primary","dark:hover:bg-dark-bg-secondary","focus:outline-hidden","focus:ring-2","focus:ring-primary-custom-400","focus:ring-offset-2","dark:focus:ring-dark-border-custom","dark:focus:ring-offset-dark-bg-primary",o&&"opacity-50",o&&"cursor-not-allowed",o&&"pointer-events-none",l].filter(Boolean).join(" ").replace(/\s+/g," ").trim(),B=["absolute",{"bottom-left":"top-full left-0 mt-2","bottom-right":"top-full right-0 mt-2","top-left":"bottom-full left-0 mb-2","top-right":"bottom-full right-0 mb-2"}[b],"min-w-[182px]","rounded-xl","p-1","border","z-50","bg-background-secondary","border-border-primary","dark:bg-dark-bg-primary","dark:border-dark-border-primary","shadow-menu",c].filter(Boolean).join(" ").replace(/\s+/g," ").trim();return e.jsxs("div",{ref:p,className:"relative inline-block",children:[e.jsxs("button",{type:"button",className:w,onClick:C,disabled:o,"aria-label":d||(t==="icon-only"?"Abrir menú":void 0),"aria-haspopup":"true","aria-expanded":f,children:[t==="default"&&e.jsx("span",{children:s||m}),e.jsx(he,{})]}),f&&e.jsx("div",{ref:h,className:B,children:n.map((k,$)=>k.isDivider?e.jsx(we,{className:k.className},$):k.isHeading?e.jsx(ye,{className:k.className,children:k.children},$):e.jsx(ve,{...k,onClick:()=>y(k)},$))})]})},ve=({children:t,icon:s,description:n,shortcut:r,disabled:a=!1,selected:o=!1,onClick:l,className:c=""})=>{const d=["flex","items-center","gap-3","px-4","py-2","rounded-lg","text-sm","w-full","text-left","transition-colors","duration-150","text-content-primary",!a&&"hover:bg-bg-primary",o&&"bg-bg-primary","dark:text-dark-content-primary",!a&&"dark:hover:bg-dark-bg-secondary",o&&"dark:bg-dark-bg-secondary",a&&"opacity-50",a&&"cursor-not-allowed",!a&&"cursor-pointer",c].filter(Boolean).join(" ").replace(/\s+/g," ").trim();return e.jsxs("button",{type:"button",className:d,onClick:l,disabled:a,children:[s&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 text-content-secondary dark:text-dark-content-secondary",children:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-content-primary dark:text-dark-content-primary",children:t}),n&&e.jsx("div",{className:"text-xs text-content-secondary dark:text-dark-content-secondary mt-0.5",children:n})]}),r&&e.jsx("span",{className:"text-xs text-content-secondary dark:text-dark-content-secondary ml-auto whitespace-nowrap",children:r})]})},ye=({children:t,className:s=""})=>{const n=["px-4","py-1","text-xs","font-normal","text-content-tertiary","dark:text-dark-content-tertiary",s].filter(Boolean).join(" ").replace(/\s+/g," ").trim();return e.jsx("div",{className:n,children:t})},we=({className:t=""})=>{const s=["px-4","py-1",t].filter(Boolean).join(" ").replace(/\s+/g," ").trim();return e.jsx("div",{className:s,children:e.jsx("div",{className:"h-px bg-border-primary dark:bg-dark-border-primary"})})},je=({count:t,color:s="red",className:n="",ariaLabel:r})=>{const a={zinc:{bg:"bg-zinc-600",text:"text-white"},red:{bg:"bg-content-extensions-red",text:"text-white"},orange:{bg:"bg-orange-700",text:"text-white"},amber:{bg:"bg-amber-700",text:"text-white"},yellow:{bg:"bg-yellow-700",text:"text-white"},lime:{bg:"bg-lime-700",text:"text-white"},green:{bg:"bg-green-700",text:"text-white"},emerald:{bg:"bg-emerald-700",text:"text-white"},teal:{bg:"bg-teal-700",text:"text-white"},cyan:{bg:"bg-cyan-700",text:"text-white"},sky:{bg:"bg-sky-700",text:"text-white"},blue:{bg:"bg-blue-700",text:"text-white"},indigo:{bg:"bg-indigo-700",text:"text-white"},violet:{bg:"bg-violet-700",text:"text-white"},purple:{bg:"bg-purple-700",text:"text-white"},fuchsia:{bg:"bg-fuchsia-700",text:"text-white"},pink:{bg:"bg-pink-700",text:"text-white"},rose:{bg:"bg-rose-700",text:"text-white"},primary:{bg:"bg-primary-custom-600",text:"text-white"},secondary:{bg:"bg-zinc-600",text:"text-white"},tertiary:{bg:"bg-zinc-600",text:"text-white"}},o=a[s]||a.red,l=r||(t!==void 0&&t>0?`${t} notificaci${t===1?"ón":"ones"}`:"Notificación pendiente");if(t!==void 0&&t>0){const c=t>99?"99+":t.toString();return e.jsx("span",{className:`
|
|
433
433
|
inline-flex
|
|
434
434
|
items-center
|
|
435
435
|
justify-center
|
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
transition-all
|
|
534
534
|
duration-150
|
|
535
535
|
${t===s?"opacity-50 cursor-not-allowed pointer-events-none":""}
|
|
536
|
-
`.replace(/\s+/g," ").trim(),onClick:()=>x(t+1),disabled:t===s,"aria-label":`${a} page`,children:[a,e.jsx(Ne,{className:"w-4 h-4"})]})]})},Be=({className:t=""})=>e.
|
|
536
|
+
`.replace(/\s+/g," ").trim(),onClick:()=>x(t+1),disabled:t===s,"aria-label":`${a} page`,children:[a,e.jsx(Ne,{className:"w-4 h-4"})]})]})},Be=({className:t=""})=>e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.22 10.22a.75.75 0 0 1 1.06 0L8 11.94l1.72-1.72a.75.75 0 1 1 1.06 1.06l-2.25 2.25a.75.75 0 0 1-1.06 0l-2.25-2.25a.75.75 0 0 1 0-1.06ZM10.78 5.78a.75.75 0 0 1-1.06 0L8 4.06 6.28 5.78a.75.75 0 0 1-1.06-1.06l2.25-2.25a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1 0 1.06Z",clipRule:"evenodd"})}),Se=({className:t=""})=>e.jsx("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"})}),Le=({options:t=[],value:s,defaultValue:n,placeholder:r="Seleccionar...",disabled:a=!1,error:o=!1,label:l,description:c,showLabel:d=!0,showDescription:m=!0,menuHeader:i,onChange:x,className:b="",triggerClassName:u="",menuClassName:p="",ariaLabel:h,id:g,name:f,required:j=!1,menuPosition:C="bottom",fullWidth:y=!1})=>{const[w,N]=v.useState(!1),[B,k]=v.useState(s!==void 0?s:n),[$,I]=v.useState(-1),D=v.useRef(null),R=v.useRef(null),T=v.useRef(null);v.useEffect(()=>{s!==void 0&&k(s)},[s]),v.useEffect(()=>{const _=z=>{D.current&&!D.current.contains(z.target)&&N(!1)};if(w)return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[w]),v.useEffect(()=>{const _=z=>{if(w)switch(z.key){case"Escape":N(!1),R.current?.focus();break;case"ArrowDown":z.preventDefault(),I(V=>V<t.length-1?V+1:0);break;case"ArrowUp":z.preventDefault(),I(V=>V>0?V-1:t.length-1);break;case"Enter":z.preventDefault(),$>=0&&$<t.length&&M(t[$]);break}};if(w)return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[w,$,t]);const E=t.find(_=>_.value===B),L=()=>{a||(N(!w),I(-1))},M=_=>{_.disabled||(k(_.value),N(!1),x?.(_.value),setTimeout(()=>{R.current?.focus()},0))},Z=[`
|
|
537
537
|
inline-flex
|
|
538
538
|
items-center
|
|
539
539
|
justify-between
|
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
text-[10px]
|
|
607
607
|
leading-[12px]
|
|
608
608
|
font-bold
|
|
609
|
-
`,be=(_,z)=>{const V=_.value===B,K=z===$,ge=V&&!K?"text-content-primary dark:text-dark-content-primary":K||V&&K?"bg-primary-custom-600 text-primary-inverse-content dark:bg-primary-custom-600 dark:text-primary-inverse-content":"text-content-primary dark:text-dark-content-primary",ue=_.disabled?"":"hover:bg-primary-custom-600 hover:text-primary-inverse-content dark:hover:bg-primary-custom-600 dark:hover:text-primary-inverse-content",fe=_.disabled?"opacity-50 cursor-not-allowed":"";return[xe,ge,ue,fe].join(" ").replace(/\s+/g," ").trim()},me=["shrink-0","transition-transform","duration-150",w&&"rotate-180",a?"text-content-tertiary dark:text-content-tertiary":"text-content-secondary dark:text-content-secondary"].filter(Boolean).join(" ").replace(/\s+/g," ").trim(),pe="shrink-0 w-4 h-4";return e.jsxs("div",{className:`relative ${y?"w-full":""} ${b}`,ref:D,children:[d&&l||m&&c?e.jsxs("div",{className:"flex flex-col gap-1 mb-1 w-full",children:[d&&l&&e.jsxs("label",{htmlFor:g,className:"text-sm font-bold leading-5 text-content-primary dark:text-dark-content-primary",children:[l,j&&e.jsx("span",{className:"ml-1 text-error-content",children:"*"})]}),m&&c&&e.jsx("p",{className:"text-sm font-normal leading-5 text-content-tertiary dark:text-content-tertiary",children:c})]}):null,e.jsxs("button",{ref:
|
|
609
|
+
`,be=(_,z)=>{const V=_.value===B,K=z===$,ge=V&&!K?"text-content-primary dark:text-dark-content-primary":K||V&&K?"bg-primary-custom-600 text-primary-inverse-content dark:bg-primary-custom-600 dark:text-primary-inverse-content":"text-content-primary dark:text-dark-content-primary",ue=_.disabled?"":"hover:bg-primary-custom-600 hover:text-primary-inverse-content dark:hover:bg-primary-custom-600 dark:hover:text-primary-inverse-content",fe=_.disabled?"opacity-50 cursor-not-allowed":"";return[xe,ge,ue,fe].join(" ").replace(/\s+/g," ").trim()},me=["shrink-0","w-4","h-4","transition-transform","duration-150",w&&"rotate-180",a?"text-content-tertiary dark:text-content-tertiary":"text-content-secondary dark:text-content-secondary"].filter(Boolean).join(" ").replace(/\s+/g," ").trim(),pe="shrink-0 w-4 h-4";return e.jsxs("div",{className:`relative ${y?"w-full":""} ${b}`,ref:D,children:[d&&l||m&&c?e.jsxs("div",{className:"flex flex-col gap-1 mb-1 w-full",children:[d&&l&&e.jsxs("label",{htmlFor:g,className:"text-sm font-bold leading-5 text-content-primary dark:text-dark-content-primary",children:[l,j&&e.jsx("span",{className:"ml-1 text-error-content",children:"*"})]}),m&&c&&e.jsx("p",{className:"text-sm font-normal leading-5 text-content-tertiary dark:text-content-tertiary",children:c})]}):null,e.jsxs("button",{ref:R,type:"button",className:Z,onClick:L,disabled:a,"aria-label":h||l,"aria-haspopup":"listbox","aria-expanded":w,id:g,children:[e.jsx("span",{className:E?"":"text-content-secondary dark:text-content-secondary",children:E?E.label:r}),e.jsx(Be,{className:me})]}),f&&e.jsx("input",{type:"hidden",name:f,value:B!==void 0?String(B):""}),w&&e.jsxs("div",{ref:T,className:de,role:"listbox",children:[i&&e.jsx("div",{className:"flex items-center gap-0.5 px-6 py-0.5 rounded-[5px]",children:e.jsx("span",{className:"text-[10px] font-bold leading-[12px] text-content-tertiary dark:text-content-tertiary",children:i})}),t.length===0&&e.jsx("div",{className:"px-2 py-1.5 text-[10px] leading-[12px] text-content-secondary dark:text-content-secondary",children:"No hay opciones disponibles"}),t.map((_,z)=>e.jsxs("div",{className:be(_,z),onClick:()=>M(_),onMouseEnter:()=>I(z),role:"option","aria-selected":_.value===B,"aria-disabled":_.disabled,children:[e.jsx("div",{className:"w-4 flex items-center justify-center",children:_.value===B&&e.jsx(Se,{className:pe})}),_.icon&&e.jsx("span",{className:"shrink-0 w-4 h-4",children:_.icon}),e.jsx("span",{className:"flex-1 text-left",children:_.label})]},_.value))]})]})},_e=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"transition-transform",children:e.jsx("path",{d:"M12 10L8 6L4 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Me=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"transition-transform",children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),Re=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14 8H2M2 8L6.5 3.5M2 8L6.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ie=()=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M2 8H14M14 8L9.5 3.5M14 8L9.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Te=({column:t,sortable:s,sorted:n,sortDirection:r,onSort:a})=>{const d=[`
|
|
610
610
|
flex
|
|
611
611
|
items-center
|
|
612
612
|
gap-3
|
|
@@ -631,7 +631,7 @@
|
|
|
631
631
|
text-ellipsis
|
|
632
632
|
overflow-hidden
|
|
633
633
|
whitespace-nowrap
|
|
634
|
-
`,children:t.header}),s&&e.jsxs("span",{className:"shrink-0 text-content-secondary dark:text-content-secondary",children:[n&&r==="asc"&&e.jsx(_e,{}),n&&r==="desc"&&e.jsx(
|
|
634
|
+
`,children:t.header}),s&&e.jsxs("span",{className:"shrink-0 text-content-secondary dark:text-content-secondary",children:[n&&r==="asc"&&e.jsx(_e,{}),n&&r==="desc"&&e.jsx(Me,{}),!n&&e.jsx("div",{className:"w-4 h-4"})]})]})},Q=({children:t,align:s="left",width:n,isStriped:r=!1,rowIndex:a=0})=>{const o={left:"justify-start text-left",center:"justify-center text-center",right:"justify-end text-right"},l=r&&a%2===1?"bg-background-secondary dark:bg-dark-bg-primary/30":"";return e.jsx("div",{className:`
|
|
635
635
|
flex
|
|
636
636
|
flex-col
|
|
637
637
|
${o[s]}
|
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
disabled:cursor-not-allowed
|
|
667
667
|
transition-colors
|
|
668
668
|
duration-150
|
|
669
|
-
`,children:[e.jsx(
|
|
669
|
+
`,children:[e.jsx(Re,{}),e.jsx("span",{children:r})]}),e.jsx("div",{className:"flex items-center gap-0",children:l.map((c,d)=>{if(c==="...")return e.jsx("div",{className:`
|
|
670
670
|
flex
|
|
671
671
|
items-center
|
|
672
672
|
justify-center
|
|
@@ -707,7 +707,7 @@
|
|
|
707
707
|
disabled:cursor-not-allowed
|
|
708
708
|
transition-colors
|
|
709
709
|
duration-150
|
|
710
|
-
`,children:[e.jsx("span",{children:a}),e.jsx(Ie,{})]})]})},ze=({title:t,columns:s,data:n,variant:r="basic",showBorder:a=!0,showShadow:o=!0,onSort:l,sortColumn:c,sortDirection:d,fullWidth:m=!1,emptyMessage:i="No hay datos disponibles",loading:x=!1,loadingRows:b=5,pagination:u,className:p="",id:h})=>{const[g,f]=v.useState(null),[j,C]=v.useState(null),y=c!==void 0?c:g,w=d!==void 0?d:j,N=
|
|
710
|
+
`,children:[e.jsx("span",{children:a}),e.jsx(Ie,{})]})]})},ze=({title:t,columns:s,data:n,variant:r="basic",showBorder:a=!0,showShadow:o=!0,onSort:l,sortColumn:c,sortDirection:d,fullWidth:m=!1,emptyMessage:i="No hay datos disponibles",loading:x=!1,loadingRows:b=5,pagination:u,className:p="",id:h})=>{const[g,f]=v.useState(null),[j,C]=v.useState(null),y=c!==void 0?c:g,w=d!==void 0?d:j,N=L=>{let M="asc";y===L&&(w==="asc"?M="desc":w==="desc"&&(M=null)),l?l(L,M):(f(M?L:null),C(M))},B=(L,M)=>typeof M=="function"?M(L):L[M],T=[`
|
|
711
711
|
flex
|
|
712
712
|
flex-col
|
|
713
713
|
gap-4
|
|
@@ -730,13 +730,13 @@
|
|
|
730
730
|
text-ellipsis
|
|
731
731
|
overflow-hidden
|
|
732
732
|
whitespace-nowrap
|
|
733
|
-
`,children:t})}),e.jsx("div",{className:`flex w-full overflow-x-auto ${E}`,children:s.map((
|
|
733
|
+
`,children:t})}),e.jsx("div",{className:`flex w-full overflow-x-auto ${E}`,children:s.map((L,M)=>{const A=typeof L.accessor=="function"?`column_${M}`:String(L.accessor);return e.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[e.jsx(Te,{column:L,sortable:L.sortable||!1,sorted:y===A,sortDirection:y===A?w:null,onSort:()=>N(A)}),x&&e.jsx(e.Fragment,{children:Array.from({length:b}).map((F,H)=>e.jsx(Q,{align:L.align,width:L.width,isStriped:r==="striped",rowIndex:H,children:e.jsx("div",{className:`
|
|
734
734
|
h-4
|
|
735
735
|
bg-background-secondary
|
|
736
736
|
dark:bg-dark-border-primary
|
|
737
737
|
rounded
|
|
738
738
|
animate-pulse
|
|
739
|
-
`})},`loading-${H}`))}),!x&&n.length>0&&e.jsx(e.Fragment,{children:n.map((F,H)=>{const O=B(F,
|
|
739
|
+
`})},`loading-${H}`))}),!x&&n.length>0&&e.jsx(e.Fragment,{children:n.map((F,H)=>{const O=B(F,L.accessor),W=L.render?L.render(O,F,H):O;return e.jsx(Q,{align:L.align,width:L.width,isStriped:r==="striped",rowIndex:H,children:W},H)})}),!x&&n.length===0&&M===0&&e.jsx("div",{className:`
|
|
740
740
|
flex
|
|
741
741
|
items-center
|
|
742
742
|
justify-center
|
|
@@ -882,7 +882,7 @@
|
|
|
882
882
|
shrink-0
|
|
883
883
|
transition-all
|
|
884
884
|
duration-150
|
|
885
|
-
`,y=c==="mobile",w=c==="desktop",N=c==="tablet",B=c==="responsive",k=()=>{if(y)return null;const
|
|
885
|
+
`,y=c==="mobile",w=c==="desktop",N=c==="tablet",B=c==="responsive",k=()=>{if(y)return null;const S=e.jsx("div",{className:"overflow-hidden relative shrink-0 w-4 h-4",children:e.jsx(He,{})});return w||N?e.jsx("button",{className:C,"aria-label":"Volver",onClick:p,children:S}):e.jsx("button",{className:`hidden md:flex ${C}`,"aria-label":"Volver",onClick:p,children:S})},$=()=>{if(y||!x)return null;const S=e.jsx("img",{src:"/,Business Logo.png",alt:"Business Logo",className:"w-full h-full object-contain"});return w?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[168px] h-[30px]",children:S}):N?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[140px] h-[25px]",children:S}):e.jsx("div",{className:"hidden md:block overflow-hidden relative shrink-0 w-[140px] lg:w-[168px] h-[25px] lg:h-[30px]",children:S})},I=()=>{const S=e.jsx("img",{src:"/.Siesa Logo.png",alt:"Siesa",className:"w-full h-full object-contain"}),Z=e.jsx("img",{src:"/siesa_logo_mobile.png",alt:"Siesa",className:"w-full h-full object-contain"});return y?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[30px] h-[30px]",children:Z}):b?w?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[120px] h-[30px]",children:S}):N?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[100px] h-[25px]",children:S}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden overflow-hidden relative shrink-0 w-[30px] h-[30px]",children:Z}),b&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block lg:hidden overflow-hidden relative shrink-0 w-[100px] h-[25px]",children:S}),e.jsx("div",{className:"hidden lg:block overflow-hidden relative shrink-0 w-[120px] h-[30px]",children:S})]})]}):null},D=()=>{if(!u||y)return null;const S=e.jsx("img",{src:"/.Siesa Logo.png",alt:"Siesa",className:"w-full h-full object-contain"});return w?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[120px] h-[30px]",children:S}):N?e.jsx("div",{className:"overflow-hidden relative shrink-0 w-[100px] h-[25px]",children:S}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block lg:hidden overflow-hidden relative shrink-0 w-[100px] h-[25px]",children:S}),e.jsx("div",{className:"hidden lg:block overflow-hidden relative shrink-0 w-[120px] h-[30px]",children:S})]})},R=({responsive:S=!0})=>{const Z=e.jsx("div",{className:"grow shrink-0 w-px min-h-px bg-border-primary dark:bg-dark-border-primary"});return y?null:w||N?e.jsx("div",{className:"flex flex-col gap-2 h-8 items-start px-0 py-1 relative shrink-0",children:Z}):S?e.jsx("div",{className:"hidden md:flex flex-col gap-2 h-8 items-start px-0 py-1 relative shrink-0",children:Z}):null},T=()=>{if(y||!s)return null;const S=e.jsx("p",{className:"font-bold leading-7 text-xl text-content-primary dark:text-dark-content-primary tracking-[-0.5px] whitespace-nowrap",children:s});return w||N?S:e.jsx("p",{className:"hidden md:block font-bold leading-7 text-xl text-content-primary dark:text-dark-content-primary tracking-[-0.5px] whitespace-nowrap",children:s})},E=()=>n?y?e.jsx(P,{color:"yellow",leftIcon:e.jsx(U,{}),label:"Pruebas"}):w||N?e.jsx(P,{color:"yellow",leftIcon:e.jsx(U,{}),label:n}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden",children:e.jsx(P,{color:"yellow",leftIcon:e.jsx(U,{}),label:"Pruebas"})}),e.jsx("div",{className:"hidden md:block",children:e.jsx(P,{color:"yellow",leftIcon:e.jsx(U,{}),label:n})})]}):null,L=()=>d?null:y?e.jsx("button",{className:j,"aria-label":"Buscar",onClick:h,children:e.jsx("div",{className:"overflow-hidden relative shrink-0 w-4 h-4",children:e.jsx(X,{})})}):B?e.jsx("button",{className:`md:hidden ${j}`,"aria-label":"Buscar",onClick:h,children:e.jsx("div",{className:"overflow-hidden relative shrink-0 w-4 h-4",children:e.jsx(X,{})})}):null,M=()=>d?null:e.jsxs("div",{className:"relative",children:[e.jsx("button",{className:j,"aria-label":"Carrito de compras",onClick:g,children:e.jsx("div",{className:"overflow-hidden relative shrink-0 w-4 h-4",children:e.jsx(Fe,{})})}),o?.cart!==void 0&&o.cart>0&&e.jsx("div",{className:"absolute bg-error-content dark:bg-error-content flex flex-col gap-2.5 h-4 items-center justify-center left-[calc(50%+8px)] px-1 py-0 rounded-full top-[calc(50%-8px)] -translate-x-1/2 -translate-y-1/2 pointer-events-none min-w-[16px]",children:e.jsx("p",{className:"font-bold leading-3 text-[10px] text-white text-center whitespace-nowrap",children:o.cart>99?"+99":o.cart})})]}),A=()=>d?null:e.jsxs("div",{className:"relative",children:[e.jsx("button",{className:j,"aria-label":"Notificaciones",onClick:f,children:e.jsx("div",{className:"overflow-hidden relative shrink-0 w-4 h-4",children:e.jsx(Ze,{})})}),o?.bell&&e.jsx("div",{className:"absolute w-2 h-2 bg-error-content dark:bg-error-content rounded-full left-[calc(50%+4px)] top-[calc(50%-8px)] -translate-x-1/2 pointer-events-none"})]}),F=()=>{if(!r)return null;const S=`
|
|
886
886
|
box-border
|
|
887
887
|
flex
|
|
888
888
|
items-center
|
|
@@ -904,7 +904,7 @@
|
|
|
904
904
|
rounded-lg
|
|
905
905
|
transition-all
|
|
906
906
|
duration-150
|
|
907
|
-
`;if(y)return e.jsx("button",{className:
|
|
907
|
+
`;if(y)return e.jsx("button",{className:S,onClick:r.onMenuClick,"aria-label":"Menú de usuario",children:e.jsx("div",{className:"relative rounded-full shrink-0 w-8 h-8",children:e.jsx("img",{alt:r.name,className:"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-full w-full h-full",src:r.avatar})})});const Z=()=>e.jsx("button",{className:S,onClick:r.onMenuClick,"aria-label":"Menú de usuario",children:e.jsxs("div",{className:"box-border flex gap-3 items-center justify-center overflow-hidden px-3 py-2 relative rounded-lg shrink-0",children:[e.jsxs("div",{className:"flex gap-3 items-center justify-center relative shrink-0",children:[e.jsx("div",{className:"flex items-center justify-center relative shrink-0",children:e.jsx("div",{className:"relative rounded-md shrink-0 w-10 h-10",children:e.jsx("img",{alt:r.name,className:"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-md w-full h-full",src:r.avatar})})}),e.jsxs("div",{className:"flex flex-col gap-0.5 items-start justify-center relative shrink-0 w-[123px]",children:[e.jsx("p",{className:"leading-5 relative shrink-0 text-sm text-content-primary dark:text-dark-content-primary whitespace-nowrap font-normal",children:r.name}),(r.email||r.role)&&e.jsx("p",{className:"leading-4 min-w-full relative shrink-0 text-xs text-content-secondary dark:text-content-secondary w-min whitespace-nowrap overflow-hidden text-ellipsis",children:r.email||r.role})]})]}),e.jsx("div",{className:"overflow-hidden relative shrink-0 w-5 h-5 text-content-secondary dark:text-content-secondary",children:e.jsx(J,{})})]})});return w||N?Z():e.jsxs(e.Fragment,{children:[e.jsx("button",{className:`md:hidden ${S}`,onClick:r.onMenuClick,"aria-label":"Menú de usuario",children:e.jsx("div",{className:"relative rounded-full shrink-0 w-8 h-8",children:e.jsx("img",{alt:r.name,className:"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-full w-full h-full",src:r.avatar})})}),e.jsx("button",{className:`hidden md:flex ${S}`,onClick:r.onMenuClick,"aria-label":"Menú de usuario",children:e.jsxs("div",{className:"box-border flex gap-3 items-center justify-center overflow-hidden px-3 py-2 relative rounded-lg shrink-0",children:[e.jsxs("div",{className:"flex gap-3 items-center justify-center relative shrink-0",children:[e.jsx("div",{className:"flex items-center justify-center relative shrink-0",children:e.jsx("div",{className:"relative rounded-md shrink-0 w-10 h-10",children:e.jsx("img",{alt:r.name,className:"absolute inset-0 max-w-none object-center object-cover pointer-events-none rounded-md w-full h-full",src:r.avatar})})}),e.jsxs("div",{className:"flex flex-col gap-0.5 items-start justify-center relative shrink-0 w-[123px]",children:[e.jsx("p",{className:"leading-5 relative shrink-0 text-sm text-content-primary dark:text-dark-content-primary whitespace-nowrap font-normal",children:r.name}),(r.email||r.role)&&e.jsx("p",{className:"leading-4 min-w-full relative shrink-0 text-xs text-content-secondary dark:text-content-secondary w-min whitespace-nowrap overflow-hidden text-ellipsis",children:r.email||r.role})]})]}),e.jsx("div",{className:"overflow-hidden relative shrink-0 w-5 h-5 text-content-secondary dark:text-content-secondary",children:e.jsx(J,{})})]})})]})},W=[`
|
|
908
908
|
box-border
|
|
909
909
|
flex
|
|
910
910
|
gap-8
|
|
@@ -915,7 +915,7 @@
|
|
|
915
915
|
w-full
|
|
916
916
|
bg-background-primary
|
|
917
917
|
dark:bg-dark-bg-primary
|
|
918
|
-
`,{responsive:"h-[40px] md:h-16",desktop:"h-16",tablet:"h-16",mobile:"h-[40px]"}[c],l].join(" ").replace(/\s+/g," ").trim();return e.jsxs("nav",{className:W,children:[e.jsxs("div",{className:"flex gap-4 items-center relative shrink-0",children:[!y&&(m||e.jsx(k,{})),t||e.jsx($,{}),x&&b&&!y&&e.jsx(
|
|
918
|
+
`,{responsive:"h-[40px] md:h-16",desktop:"h-16",tablet:"h-16",mobile:"h-[40px]"}[c],l].join(" ").replace(/\s+/g," ").trim();return e.jsxs("nav",{className:W,children:[e.jsxs("div",{className:"flex gap-4 items-center relative shrink-0",children:[!y&&(m||e.jsx(k,{})),t||e.jsx($,{}),x&&b&&!y&&e.jsx(R,{}),i||e.jsx(I,{}),s&&b&&!y&&e.jsx(R,{}),e.jsx(T,{})]}),e.jsxs("div",{className:"flex gap-4 items-center justify-end grow min-h-px min-w-px relative shrink-0",children:[e.jsx(E,{}),e.jsx(L,{}),e.jsx(M,{}),e.jsx(A,{}),r&&!d&&e.jsx(R,{}),e.jsx(F,{}),u&&r&&!y&&e.jsx(R,{}),e.jsx(D,{}),a&&e.jsx("div",{className:"flex gap-2 items-center",children:a})]})]})},Pe=({items:t,activeItemId:s,onItemClick:n,className:r="",ariaLabel:a="Navegación Principal"})=>{t.length>5&&console.warn("NavigationBar: Se recomienda un máximo de 5 ítems para mejor UX");const o=i=>{i.disabled||(i.onClick&&i.onClick(i.id),n&&n(i.id))},l=i=>{const x=i.active||i.id===s,b=`
|
|
919
919
|
flex-1
|
|
920
920
|
flex
|
|
921
921
|
flex-col
|
|
@@ -1269,5 +1269,5 @@
|
|
|
1269
1269
|
font-normal
|
|
1270
1270
|
${i[s].text}
|
|
1271
1271
|
${i[s].textDark}
|
|
1272
|
-
`,children:[e.jsxs("p",{className:"leading-[12px] text-ellipsis overflow-hidden",children:["Mesa ",t]}),m]})]})},ce=v.createContext(void 0),ar=({children:t,defaultTheme:s="light"})=>{const[n,r]=v.useState(()=>typeof window<"u"&&localStorage.getItem("siesa-ui-theme")||s);v.useEffect(()=>{const l=window.document.documentElement;n==="dark"?l.classList.add("dark"):l.classList.remove("dark"),localStorage.setItem("siesa-ui-theme",n)},[n]);const a=()=>{r(l=>l==="light"?"dark":"light")},o=l=>{r(l)};return e.jsx(ce.Provider,{value:{theme:n,toggleTheme:a,setTheme:o},children:t})},nr=()=>{const t=v.useContext(ce);if(t===void 0)throw new Error("useTheme debe ser usado dentro de un ThemeProvider");return t};exports.Alert=ie;exports.Avatar=ae;exports.Badge=P;exports.Button=q;exports.Checkbox=re;exports.DescriptionList=oe;exports.Divider=ne;exports.Dropdown=ke;exports.Input=Y;exports.Navbar=Ve;exports.NavigationBar=Pe;exports.Notification=je;exports.POSConvention=We;exports.POSLocationButton=Xe;exports.POSNumberButton=Je;exports.POSProductButton=Ye;exports.POSProductCard=rr;exports.POSProductSidebarItems=le;exports.POSTable=sr;exports.Pagination=$e;exports.Quantity=G;exports.Radio=te;exports.Select=
|
|
1272
|
+
`,children:[e.jsxs("p",{className:"leading-[12px] text-ellipsis overflow-hidden",children:["Mesa ",t]}),m]})]})},ce=v.createContext(void 0),ar=({children:t,defaultTheme:s="light"})=>{const[n,r]=v.useState(()=>typeof window<"u"&&localStorage.getItem("siesa-ui-theme")||s);v.useEffect(()=>{const l=window.document.documentElement;n==="dark"?l.classList.add("dark"):l.classList.remove("dark"),localStorage.setItem("siesa-ui-theme",n)},[n]);const a=()=>{r(l=>l==="light"?"dark":"light")},o=l=>{r(l)};return e.jsx(ce.Provider,{value:{theme:n,toggleTheme:a,setTheme:o},children:t})},nr=()=>{const t=v.useContext(ce);if(t===void 0)throw new Error("useTheme debe ser usado dentro de un ThemeProvider");return t};exports.Alert=ie;exports.Avatar=ae;exports.Badge=P;exports.Button=q;exports.Checkbox=re;exports.DescriptionList=oe;exports.Divider=ne;exports.Dropdown=ke;exports.Input=Y;exports.Navbar=Ve;exports.NavigationBar=Pe;exports.Notification=je;exports.POSConvention=We;exports.POSLocationButton=Xe;exports.POSNumberButton=Je;exports.POSProductButton=Ye;exports.POSProductCard=rr;exports.POSProductSidebarItems=le;exports.POSTable=sr;exports.Pagination=$e;exports.Quantity=G;exports.Radio=te;exports.Select=Le;exports.Switch=se;exports.Table=ze;exports.Tabs=Ee;exports.Textarea=ee;exports.ThemeProvider=ar;exports.useTheme=nr;
|
|
1273
1273
|
//# sourceMappingURL=siesa-ui-kit.cjs.map
|