@zauru-sdk/components 6.18.1 → 6.19.1

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 (47) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/build/assets/Alerts.stories-Dw0Ct9vA.js +1 -0
  3. package/build/assets/Button-YPU2MaHD.js +1 -0
  4. package/build/assets/Button.stories-CP6jmzaX.js +1 -0
  5. package/build/assets/Card.stories-DbFqLafy.js +1 -0
  6. package/build/assets/Container.stories-BhnM3_6Y.js +1 -0
  7. package/build/assets/Form.stories-BNB6SmSx.js +1 -0
  8. package/build/assets/Icons-BxLN_JWC.js +10 -0
  9. package/build/assets/Labels.stories-Fah6wLSi.js +1 -0
  10. package/build/assets/Matrix.stories-Dc3-VDms.js +1 -0
  11. package/build/assets/Modal.stories-D7kIP3bJ.js +1 -0
  12. package/build/assets/NavBar.stories-DuIgKZkc.js +1 -0
  13. package/build/assets/SidePanel.stories-Xsm8Md4K.js +1 -0
  14. package/build/assets/Tab.stories-RKI0m-pt.js +365 -0
  15. package/build/assets/Table.stories-CGj0WWPk.js +416 -0
  16. package/build/assets/Titles.stories-CPIRDaJs.js +1 -0
  17. package/build/assets/Tooltip.stories-D8M6F7St.js +1 -0
  18. package/build/assets/activestorage.esm-ByWQ3T27.js +1 -0
  19. package/build/assets/axe-sLlwVNub.js +30 -0
  20. package/build/assets/components-FzdPzEyL.js +46 -0
  21. package/build/assets/favicon-gjFwcFbF.svg +22 -0
  22. package/build/assets/index-CraKZ-Fr.css +1 -0
  23. package/build/assets/index-DUSjZECW.js +152 -0
  24. package/build/assets/index-DonOhaBM.js +1 -0
  25. package/build/assets/manifest-B-VxemCC.webmanifest +7 -0
  26. package/build/assets/proxy-BETbFm71.js +9 -0
  27. package/build/assets/touch-icon-ByyUZD7t.png +0 -0
  28. package/build/index.html +28 -0
  29. package/build/meta.json +416 -0
  30. package/dist/Matrix/CheckMatrixCards.d.ts +27 -0
  31. package/dist/Matrix/ResponsiveCheckMatrix.d.ts +7 -0
  32. package/dist/Matrix/index.d.ts +2 -0
  33. package/dist/SidePanel/index.d.ts +4 -2
  34. package/dist/esm/Matrix/CheckMatrixCards.js +26 -0
  35. package/dist/esm/Matrix/ResponsiveCheckMatrix.js +11 -0
  36. package/dist/esm/Matrix/index.js +2 -0
  37. package/dist/esm/SidePanel/index.js +53 -10
  38. package/dist/esm/index.js +1 -0
  39. package/dist/index.d.ts +1 -0
  40. package/package.json +9 -9
  41. package/src/Matrix/CheckMatrixCards.tsx +138 -0
  42. package/src/Matrix/ResponsiveCheckMatrix.tsx +32 -0
  43. package/src/Matrix/index.ts +2 -0
  44. package/src/SidePanel/index.tsx +101 -12
  45. package/src/index.ts +1 -0
  46. package/stories/Matrix.stories.tsx +75 -0
  47. package/stories/SidePanel.stories.tsx +21 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.19.1](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.19.0...@zauru-sdk/components@6.19.1) (2026-10-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **components:** conservar estado responsive accesible ([7ba1a9b](https://github.com/intuitiva/zauru-typescript-sdk/commit/7ba1a9be4f6a417e0162dab0999a6f244d965793))
12
+
13
+
14
+
15
+
16
+
17
+ # [6.19.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.18.1...@zauru-sdk/components@6.19.0) (2026-10-31)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **components:** adaptar SidePanel a teléfonos ([fb6efb8](https://github.com/intuitiva/zauru-typescript-sdk/commit/fb6efb833ba4713196d752766eb7b5f8d991006e))
23
+
24
+
25
+ ### Features
26
+
27
+ * **components:** agregar matriz responsive con cards ([42c724c](https://github.com/intuitiva/zauru-typescript-sdk/commit/42c724c00f5bc30de62e9ecaf6acee97b43c3b7b))
28
+
29
+
30
+
31
+
32
+
6
33
  ## [6.18.1](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.18.0...@zauru-sdk/components@6.18.1) (2026-10-30)
7
34
 
8
35
  **Note:** Version bump only for package @zauru-sdk/components
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-DUSjZECW.js";const d=s=>{switch(s){case"info":return{containerClassName:"text-blue-900 bg-blue-100 border border-blue-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",path:e.jsx("path",{d:"M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"})};case"success":return{containerClassName:"text-green-900 bg-green-100 border border-green-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",path:e.jsx("path",{d:"M8.445 12.6675A.9.9 0 0 0 7.1424 13.91l2.5726 2.7448c.3679.3856.9884.3689 1.335-.036l5.591-7.0366a.9.9 0 0 0-1.3674-1.1705l-4.6548 5.9132a.4.4 0 0 1-.607.0252l-1.567-1.6826zM1.9995 12c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z"})};case"warning":return{containerClassName:"text-yellow-900 bg-yellow-100 border border-yellow-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-500",path:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm.93 14.93h-1.86c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h1.86c.41 0 .75.34.75.75s-.34.75-.75.75zm.57-4.42l-.57 2.36h-1.86l-.57-2.36c-.13-.54.21-1.08.76-1.08h1.48c.55 0 .88.54.76 1.08zm0-2.36h-2.58c-.55 0-.88-.54-.76-1.08l.57-2.36h1.86l.57 2.36c.12.54-.21 1.08-.76 1.08z"})};default:return{containerClassName:"text-blue-900 bg-blue-100 border border-blue-200 rounded-md",buttonClassName:"rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",path:e.jsx("path",{d:"M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"})}}},t=s=>{const{className:c,title:l,description:r,onClose:o,type:a="info",loading:i=!1}=s,n=d(a);return e.jsx("div",{className:`${c} ${n.containerClassName} ${i?" hidden":""}`,children:e.jsxs("div",{className:"flex justify-between flex-wrap",children:[e.jsxs("div",{className:"w-0 flex-1 flex",children:[e.jsx("div",{className:"mr-3 pt-1",children:e.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:n.path})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-md leading-6 font-medium",children:l}),e.jsx("div",{className:"text-sm",children:r})]})]}),o&&e.jsx("div",{children:e.jsx("button",{type:"button",className:`${n.buttonClassName}`,onClick:o,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:e.jsx("path",{d:"M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"})})})})]})})},m=()=>e.jsx(t,{title:"Información",description:"Mensaje informativo.",type:"info"}),h=()=>e.jsx(t,{title:"Listo",description:"La operación se completó.",type:"success"}),x=()=>e.jsx(t,{title:"Atención",description:"Hay datos pendientes de revisar.",type:"warning"});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{m as Info,h as Success,x as Warning};
@@ -0,0 +1 @@
1
+ import{r as a,u as O,j as e}from"./index-DUSjZECW.js";const M=150,T=200,R=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=({option:s,onLeafClick:y})=>{var h,v;const r=!!((h=s.children)!=null&&h.length),[b,t]=a.useState(!1),d=a.useRef(null),g=a.useRef(null),f=()=>{d.current!=null&&(window.clearTimeout(d.current),d.current=null),g.current!=null&&(window.clearTimeout(g.current),g.current=null)};a.useEffect(()=>()=>{f()},[]);const i=(n=!1)=>{if(r){if(f(),n||R()){t(!0);return}d.current=window.setTimeout(()=>{t(!0)},M)}},p=(n=!1)=>{if(f(),n||R()){t(!1);return}g.current=window.setTimeout(()=>{t(!1)},T)},N=()=>{var n;if(r){t(c=>!c);return}(n=s.onClick)==null||n.call(s),y()},w=n=>{r&&((n.key==="ArrowRight"||n.key==="Enter")&&(n.preventDefault(),i(!0)),(n.key==="ArrowLeft"||n.key==="Escape")&&(n.preventDefault(),p(!0)))};return e.jsxs("div",{className:"relative",onMouseEnter:()=>i(),onMouseLeave:()=>p(),children:[e.jsxs("button",{type:"button",role:"menuitem","aria-haspopup":r?"menu":void 0,"aria-expanded":r?b:void 0,onClick:N,onKeyDown:w,className:"flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:ring-2 focus:ring-indigo-500 focus:ring-inset motion-reduce:transition-none",children:[e.jsx("span",{children:s.label}),r?e.jsx("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 text-gray-500",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}):null]}),r&&b?e.jsx("div",{role:"menu",className:"absolute right-full top-0 z-20 mr-1 w-56 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:(v=s.children)==null?void 0:v.map(n=>e.jsx($,{option:n,onLeafClick:y},n.value))}):null]})},z=s=>{const{type:y="submit",loading:r=!1,loadingText:b="Guardando...",title:t="Guardar",name:d="save",onClickSave:g,selectedColor:f="indigo",children:i,className:p="",disabled:N=!1,enableFormErrorsValidation:w=!1,enableFormErrorsDescriptions:C=!1,dropdownOptions:h=[],dropdownTitle:v}=s,[n,c]=a.useState(!1),k=a.useRef(null),j=O(),E=j?!j.formState.isValid:!1,D=j?j.formState.errors:{},u={green:{bg900:"bg-green-900",bg700:"bg-green-700",bg600:"bg-green-600",bg500:"bg-green-500",bg200:"bg-green-200",ring600:"ring-green-600",ring500:"ring-green-500"},indigo:{bg900:"bg-indigo-900",bg700:"bg-indigo-700",bg600:"bg-indigo-600",bg500:"bg-indigo-500",bg200:"bg-indigo-200",ring600:"ring-indigo-600",ring500:"ring-indigo-500"},red:{bg900:"bg-red-900",bg700:"bg-red-700",bg600:"bg-red-600",bg500:"bg-red-500",bg200:"bg-red-200",ring600:"ring-red-600",ring500:"ring-red-500"},yellow:{bg900:"bg-yellow-900",bg700:"bg-yellow-700",bg600:"bg-yellow-600",bg500:"bg-yellow-500",bg200:"bg-yellow-200",ring600:"ring-yellow-600",ring500:"ring-yellow-500"},gray:{bg900:"bg-gray-900",bg700:"bg-gray-700",bg600:"bg-gray-600",bg500:"bg-gray-500",bg200:"bg-gray-200",ring600:"ring-gray-600",ring500:"ring-gray-500"}}[f],m=E?Object.values(D).map(o=>{var x;return(x=o==null?void 0:o.message)==null?void 0:x.toString()}).join(", "):"";a.useEffect(()=>{const o=S=>{k.current&&!k.current.contains(S.target)&&c(!1)},x=S=>{S.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",x)}},[]);const l=r||N||w&&E;if(!(h.length>0)){const o=e.jsx("button",{type:y,name:"action",value:d,disabled:l,onClick:g,className:`${l?" bg-opacity-25 ":""} ${r?" cursor-progress":`${l?" cursor-not-allowed":`cursor-pointer hover:${u.bg700}`}`} inline-flex justify-center rounded-md border border-transparent ${u.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${u.ring500} focus:ring-offset-2 ${p}`,children:r?i??b:i??t});return e.jsxs(e.Fragment,{children:[w&&E&&m||C&&m?e.jsx("div",{className:"flex flex-col items-end mb-2",children:e.jsx("div",{className:"p-2 bg-red-100 border border-red-400 text-red-700 rounded-md shadow-sm",children:e.jsx("p",{className:"text-sm",children:m})})}):null,o]})}const L=e.jsxs("div",{className:"relative inline-block text-left",ref:k,children:[e.jsx("div",{children:e.jsxs("button",{type:"button",disabled:l,"aria-haspopup":"menu","aria-expanded":n,onClick:()=>c(!n),className:`${l?" bg-opacity-25 ":""} ${r?" cursor-progress":`${l?" cursor-not-allowed":`cursor-pointer hover:${u.bg700}`}`} inline-flex justify-center items-center rounded-md border border-transparent ${u.bg600} py-2 px-4 text-sm font-medium text-white shadow-sm focus:outline-none focus:ring-2 focus:${u.ring500} focus:ring-offset-2 ${p}`,children:[r?i??b:i??v??t,e.jsx("svg",{className:`ml-2 -mr-1 h-4 w-4 transition-transform motion-reduce:transition-none ${n?"rotate-180":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})]})}),n&&!l?e.jsx("div",{role:"menu",className:"absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsx("div",{className:"py-1",children:h.map(o=>e.jsx($,{option:o,onLeafClick:()=>c(!1)},o.value))})}):null]});return e.jsxs(e.Fragment,{children:[w&&E&&m||C&&m?e.jsx("div",{className:"flex flex-col items-end mb-2",children:e.jsx("div",{className:"p-2 bg-red-100 border border-red-400 text-red-700 rounded-md shadow-sm",children:e.jsx("p",{className:"text-sm",children:m})})}):null,L]})};export{z as B};
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-DUSjZECW.js";import{B as t}from"./Button-YPU2MaHD.js";const d=({items:s,disabled:r=!1,className:n=""})=>e.jsx("div",{className:`flex flex-col gap-1 ${n}`,children:s.map(o=>{const l=!!o.loading,a=r||o.disabled||l;return e.jsxs("button",{type:"button",disabled:a,onClick:o.onClick,className:"flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-1 disabled:cursor-progress disabled:opacity-60",children:[o.badge?e.jsx("span",{className:`inline-flex min-w-[2.25rem] justify-center rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${o.badgeClassName??"bg-gray-100 text-gray-700"}`,children:o.badge}):null,e.jsx("span",{children:l?o.loadingLabel??o.label:o.label})]},o.key)})}),x=()=>e.jsx(t,{title:"Guardar"}),g=()=>e.jsx(t,{title:"Guardar",loading:!0,loadingText:"Guardando..."}),p=()=>e.jsx(t,{title:"Guardar",disabled:!0}),u=()=>e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(t,{title:"Indigo",selectedColor:"indigo"}),e.jsx(t,{title:"Green",selectedColor:"green"}),e.jsx(t,{title:"Red",selectedColor:"red"}),e.jsx(t,{title:"Yellow",selectedColor:"yellow"}),e.jsx(t,{title:"Gray",selectedColor:"gray"})]}),b=()=>e.jsx(t,{title:"Acciones",dropdownTitle:"Acciones",dropdownOptions:[{label:"Exportar",value:"export",onClick:()=>{}},{label:"Imprimir",value:"print",onClick:()=>{}}]}),f=()=>e.jsx(d,{items:[{key:"pdf",badge:"PDF",badgeClassName:"bg-red-50 text-red-700",label:"Imprimir reporte",onClick:()=>{}},{key:"xls",badge:"XLS",badgeClassName:"bg-green-50 text-green-700",label:"Exportar Excel",onClick:()=>{}}]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{f as Actions,u as Colors,x as Default,p as Disabled,b as Dropdown,g as Loading};
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-DUSjZECW.js";const s=d=>{const{children:n,title:t,className:o}=d;return e.jsxs("div",{className:`p-4 space-y-3 shadow sm:overflow-hidden sm:rounded-md ${o}`,children:[t&&e.jsx("label",{className:"inline text-lg font-medium text-gray-700",children:`${t.toUpperCase()}`}),n]})},r=()=>e.jsx(s,{title:"Tarjeta",children:e.jsx("p",{children:"Contenido de la tarjeta."})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{r as Default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-DUSjZECW.js";import{B as p}from"./Button-YPU2MaHD.js";const s=d=>{const{title:t,description:n,children:c,className:i="",rightContent:r,collapsible:m=!1,defaultOpen:x=!0}=d,l=e.jsxs(e.Fragment,{children:[t&&e.jsx("h3",{className:"text-3xl font-bold leading-8 text-gray-900",children:t}),n&&e.jsx("p",{className:"mt-1 text-md text-gray-600",children:n})]}),o=r?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-4",children:[e.jsx("div",{className:"max-w-3xl",children:l}),e.jsx("div",{className:"flex-shrink-0",children:r})]}):l,a=e.jsx("div",{className:"mt-5 space-y-5",children:c});return m?e.jsx("div",{className:`mx-2 ${i}`,children:e.jsxs("details",{className:"group",...x?{open:!0}:{},children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-start gap-3 rounded-md py-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{"aria-hidden":"true",className:"mt-2 inline-block h-0 w-0 shrink-0 border-y-[5px] border-l-[7px] border-y-transparent border-l-gray-700 transition-transform group-open:rotate-90"}),e.jsx("div",{className:"min-w-0 flex-1",children:o})]}),a]})}):e.jsxs("div",{className:`mx-2 ${i}`,children:[o,a]})},f=()=>e.jsx(s,{title:"Contenedor",description:"Descripción de la sección.",children:e.jsx("p",{children:"Contenido de ejemplo."})}),j=()=>e.jsx(s,{title:"Con acciones",description:"El encabezado se adapta en móvil.",rightContent:e.jsx(p,{title:"Nuevo"}),children:e.jsx("p",{children:"Cuerpo."})}),b=()=>e.jsx(s,{title:"Colapsable",collapsible:!0,defaultOpen:!0,children:e.jsx("p",{children:"Se puede contraer con el summary."})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{b as Collapsible,f as Default,j as WithRightContent};
@@ -0,0 +1 @@
1
+ import{r as o,u as Q,j as e,_ as ve}from"./index-DUSjZECW.js";import{C as we,T as ie,S as ye}from"./index-DonOhaBM.js";import{C as Ne,a as Ce,I as ce,D as $e}from"./Icons-BxLN_JWC.js";import{B as O}from"./Button-YPU2MaHD.js";import{F as ke}from"./components-FzdPzEyL.js";const Se=p=>{var S;const{id:j,name:s,title:l,defaultValue:v="",hint:h,helpText:N,onChange:f,tabIndex:C,disabled:T=!1,className:w="",isClearable:r=!1,required:I=!1}=p,[$,V]=o.useState(v),[_,m]=o.useState(!1),{register:R,formState:{errors:y}}=Q()||{formState:{}},n=y?y[p.name??"-1"]:void 0,g=R?R(p.name??"-1",{required:I}):void 0,u=n?"red":"gray",b=T,D=b?"bg-gray-200":`bg-${u}-50`,c=b?"text-gray-500":`text-${u}-500`,k=b?"border-gray-300":`border-${u}-200`;o.useEffect(()=>{V(v)},[v]);const x=()=>{V(""),f&&f("")};return e.jsxs("div",{children:[l&&e.jsxs("label",{htmlFor:n?`${s}-error`:`${s}-success`,className:`block text-sm font-medium ${c} ${w}`,children:[l,I&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"flex relative items-center",children:[e.jsx("div",{className:"absolute left-0 flex items-center pl-3 pointer-events-none",children:e.jsx(Ne,{})}),e.jsx("input",{id:j,tabIndex:C,type:"date",value:$??"",pattern:"\\d{4}-\\d{2}-\\d{2}",className:`${D} ${k} ${c} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5`,...g??{},name:s,onChange:E=>{V(E.target.value),f&&f(E.target.value),g&&g.onChange(E)}}),$&&r&&e.jsx("button",{type:"button",onClick:x,className:"absolute right-0 mr-10",children:e.jsx(Ce,{})}),N&&e.jsx("div",{className:"flex items-center relative ml-3",children:e.jsxs("div",{className:"relative cursor-pointer",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[e.jsx(ce,{}),_&&e.jsx("div",{className:"absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black",children:N})]})})]}),n&&e.jsxs("p",{className:`mt-2 text-sm text-${u}-600 dark:text-${u}-500`,children:[e.jsx("span",{className:"font-medium",children:"Oops!"})," ",(S=n.message)==null?void 0:S.toString()]}),!n&&h&&e.jsx("p",{className:`mt-2 italic text-sm text-${u}-500 dark:text-${u}-400`,children:h})]})},Fe=p=>{var oe;const{id:j,name:s,title:l,helpText:v,hint:h,onChange:N,readOnly:f=!1,fileTypes:C=[],showAvailableTypes:T=!1,className:w,defaultValue:r,download:I=!1,required:$=!1,optimizeImages:V=!0,zauruBaseURL:_="https://zauru.herokuapp.com",setProcessing:m,signature:R=!1,capture:y}=p,{register:n,setValue:g,formState:{errors:u}}=Q()||{formState:{}},b=u?u[s]:void 0,D=n?n(s,{required:$}):void 0,[c,k]=o.useState(!1),[x,S]=o.useState(null),[E,Z]=o.useState(!1),[ee,te]=o.useState(0),[de,H]=o.useState(!1),[se,Ve]=o.useState(!1),[ae,_e]=o.useState(0),A=o.useRef(null),M=o.useRef(null),X=o.useRef(!1),q=o.useRef(0),W=o.useRef(0),me=t=>{t.preventDefault();const a=M.current;if(!a)return;const i=a.getBoundingClientRect();q.current=t.clientX-i.left,W.current=t.clientY-i.top,X.current=!0},ue=t=>{if(t.preventDefault(),!X.current)return;const a=M.current;if(!a)return;const i=a.getContext("2d");if(!i)return;const d=a.getBoundingClientRect(),P=t.clientX-d.left,K=t.clientY-d.top;i.beginPath(),i.moveTo(q.current,W.current),i.lineTo(P,K),i.strokeStyle="black",i.lineWidth=2,i.stroke(),q.current=P,W.current=K},re=t=>{t==null||t.preventDefault(),X.current=!1},xe=()=>{const t=M.current;if(!t)return;const a=t.getContext("2d");a&&a.clearRect(0,0,t.width,t.height)},pe=()=>{const t=M.current;t&&t.toBlob(async a=>{if(a){const i=new File([a],"signature.png",{type:"image/png"}),d=URL.createObjectURL(i);S(d),await le(i),H(!1)}},"image/png")};o.useEffect(()=>()=>{x&&URL.revokeObjectURL(x)},[x]);let Y=h;T&&C.length>0&&(Y=`${h||""} Archivos permitidos: ${C.join(", ")}`);const U=b?"red":"gray",ne=f,he=ne?"bg-gray-100":`bg-${U}-50`,fe=ne?"text-gray-700":`text-${U}-900`,ge=b?"border-red-500":`border-${U}-500`,le=async(t,a)=>{let i=t;if(t&&t.type.startsWith("image/")){const d=URL.createObjectURL(t);S(d)}else S(null);if(a&&a.target){const d=new DataTransfer;d.items.add(i),a.target.files=d.files}ve(async()=>{const{DirectUpload:d}=await import("./activestorage.esm-ByWQ3T27.js");return{DirectUpload:d}},[]).then(({DirectUpload:d})=>{const P=`${_}/api/direct_uploads`;m&&m(!0),Z(!0),te(0),new d(i,P,{directUploadWillStoreFileWithXHR:L=>{L.upload.addEventListener("progress",F=>{if(F.lengthComputable){const z=Math.round(F.loaded/F.total*100);te(z)}})}}).create((L,F)=>{if(Z(!1),m&&m(!1),L)console.error("Error al subir el archivo:",L);else{g(s,F.signed_id),g(`${s}_file_type`,F.content_type);const z=document.createElement("input");z.setAttribute("type","hidden"),z.setAttribute("value",F.signed_id),z.setAttribute("name",s);const B=document.createElement("input");B.setAttribute("type","hidden"),B.setAttribute("value",F.content_type),B.setAttribute("name",`${s}_file_type`);const J=document.querySelector("form");J&&(J.appendChild(z),J.appendChild(B)),A.current&&A.current.removeAttribute("name")}})}).catch(d=>{m&&m(!1),console.error("Error al cargar DirectUpload:",d)})},be=async t=>{t.target.files&&t.target.files.length>0&&await le(t.target.files[0],t),N&&N(t)},je=()=>{S(null),A.current&&(A.current.value=""),g(s,"")};function G(t){return I?e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>window.open(t,"_blank"),onKeyDown:a=>{a.key==="Enter"&&window.open(t,"_blank")},className:"inline-flex items-center cursor-pointer",children:[e.jsx($e,{}),e.jsx("span",{className:"ml-1 text-blue-600 underline",children:"Descargar archivo"})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>window.open(t,"_blank"),onKeyDown:a=>{a.key==="Enter"&&window.open(t,"_blank")},className:"inline-block cursor-pointer",children:e.jsx("img",{src:t,alt:s,className:"h-48 w-48 inline mr-1 pb-1",style:{objectFit:"contain",backgroundColor:"transparent"}})})}return R?f?e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsx("label",{htmlFor:s,className:"block mb-1 text-sm font-medium text-gray-700",children:l}),typeof r=="string"&&r?G(r):e.jsx("div",{className:"text-sm italic text-gray-400",children:"No hay firma disponible"})]}):e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsxs("label",{htmlFor:s,className:`block mb-1 text-sm font-medium text-${U}-700`,children:[l,$&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),x?e.jsxs("div",{children:[G(x),e.jsx("button",{type:"button",onClick:()=>{S(null)},className:"ml-2 text-red-600 underline text-sm",children:"Eliminar firma"})]}):e.jsx("div",{children:e.jsx("button",{type:"button",onClick:()=>H(!0),className:"px-4 py-2 bg-blue-600 text-white rounded",children:"Firmar"})}),de&&e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-white",children:[e.jsx("div",{className:"flex-grow flex items-center justify-center",children:e.jsx("canvas",{ref:M,width:400,height:200,style:{border:"1px solid #ccc",backgroundColor:"transparent",touchAction:"none"},onPointerDown:me,onPointerMove:ue,onPointerUp:re,onPointerLeave:re})}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center space-x-4 space-y-4",children:[e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"indigo",onClickSave:xe,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:[e.jsx("path",{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}),e.jsx("path",{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"})]}),e.jsx("span",{className:"text-5xl",children:"Limpiar"})]}),e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"green",onClickSave:pe,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:e.jsx("path",{d:"M5 21h14a2 2 0 0 0 2-2V8a1 1 0 0 0-.29-.71l-4-4A1 1 0 0 0 16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2zm10-2H9v-5h6zM13 7h-2V5h2zM5 5h2v4h8V5h.59L19 8.41V19h-2v-5a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v5H5z"})}),e.jsx("span",{className:"text-5xl",children:"Confirmar"})]}),e.jsxs(O,{className:"flex items-center space-x-5",type:"button",name:"print",selectedColor:"gray",onClickSave:()=>H(!1),children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",style:{fill:"rgba(0, 0, 0, 1)",transform:"scale(2)",msFilter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"},children:[e.jsx("path",{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}),e.jsx("path",{d:"m11 16 5-4-5-4v3.001H3v2h8z"})]}),e.jsx("span",{className:"text-5xl",children:"Cancelar"})]})]})]})]}):f?e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsx("label",{htmlFor:s,className:"block mb-1 text-sm font-medium text-gray-700",children:l}),typeof r=="string"&&r?G(r):e.jsx("div",{className:"text-sm italic text-gray-400",children:"No hay archivo disponible"})]}):e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${w}`,children:[l&&e.jsxs("label",{htmlFor:s,className:`block mb-1 text-sm font-medium text-${U}-700`,children:[l,$&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.jsxs("div",{className:"mb-2 flex items-center",children:[e.jsx("div",{role:"button",tabIndex:0,onClick:()=>{const t=x||typeof r=="string"&&r;t&&window.open(t,"_blank")},onKeyDown:t=>{const a=x||typeof r=="string"&&r;t.key==="Enter"&&a&&window.open(a,"_blank")},className:"cursor-pointer border border-gray-300 h-48 w-48 flex items-center justify-center",children:x||typeof r=="string"&&r?e.jsx("img",{src:x??(typeof r=="string"&&r?r:void 0),alt:s,className:"h-48 w-48",style:{objectFit:"contain"}}):e.jsx("span",{className:"text-gray-400",children:"No image"})}),(x||typeof r=="string"&&r)&&e.jsx("button",{type:"button",onClick:je,className:"ml-2 text-red-600 underline text-sm",children:"Eliminar archivo"})]}),e.jsxs("div",{className:"flex relative items-center",children:[e.jsx("input",{type:"file",id:j??s,accept:C.map(t=>`.${t}`).join(", "),capture:y,className:`block w-full rounded-md ${he} ${ge} ${fe} shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm`,...D??{},ref:A,name:s,onChange:be}),v&&e.jsx("div",{className:"flex items-center relative ml-3",children:e.jsxs("div",{className:"relative cursor-pointer",onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[e.jsx(ce,{}),c&&e.jsx("div",{className:"absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black z-50",children:v})]})})]}),e.jsx("div",{className:"mt-2 min-h-[60px] flex items-center justify-center border border-dashed border-gray-200 rounded",children:se||E?e.jsxs(e.Fragment,{children:[se&&e.jsxs("div",{className:"w-full",children:[e.jsx("progress",{value:ae,max:"100",className:"w-full"}),e.jsxs("p",{className:"text-sm text-blue-600 mt-1 text-center",children:["Optimizando imagen a webp: ",ae,"%"]})]}),E&&e.jsxs("div",{className:"w-full",children:[e.jsx("progress",{value:ee,max:"100",className:"w-full"}),e.jsxs("p",{className:"text-sm text-blue-600 mt-1 text-center",children:["Subiendo archivo: ",ee,"%"]})]})]}):e.jsx("span",{className:"text-sm text-gray-500",children:"Información de progreso"})}),b&&e.jsxs("p",{className:"mt-2 text-sm text-red-600",children:[e.jsx("span",{className:"font-medium",children:"¡Oops!"})," ",(oe=b.message)==null?void 0:oe.toString()]}),!b&&Y&&e.jsx("p",{className:`mt-2 italic text-sm text-${U}-500`,children:Y})]})},Re=p=>{const{children:j,className:s,whitBg:l=!1}=p;return e.jsx("div",{className:`${l?"bg-gray-50 px-4 py-3 sm:px-6":""} mt-5 flex flex-col md:flex-row md:justify-end md:items-center space-x-0 space-y-4 md:space-y-0 md:space-x-4 ${s}`,children:j})},Te=p=>{const{title:j,children:s,buttons:l,method:v,formId:h}=p;return e.jsxs(ke,{id:h,name:h,method:v??"post",children:[j&&e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:j}),e.jsxs("div",{className:"shadow sm:overflow-hidden sm:rounded-md",children:[e.jsx("div",{className:"space-y-6 bg-white px-4 py-5 sm:p-6",children:s}),l&&e.jsx(Re,{whitBg:!0,children:l})]})]},h)},Ie=p=>{var D;const{id:j,name:s,title:l,options:v,defaultValue:h,disabled:N=!1,required:f=!1,onChange:C,helpText:T,hint:w,className:r="",orientation:I="vertical"}=p,[$,V]=o.useState(h),{register:_,formState:{errors:m},setValue:R}=Q()||{formState:{}},y=m?m[s]:void 0,n=y?"red":"gray",g=_?_(s,{required:f}):void 0,u=c=>{const k=c.target.value;V(k),g&&g.onChange(c),R&&R(s,k),C&&C(k,c)},b=I==="horizontal"?"flex items-center gap-4 flex-wrap":"";return e.jsxs("div",{className:`col-span-6 sm:col-span-3 ${r}`,children:[l&&e.jsxs("label",{htmlFor:j??s,className:`block mb-1 text-sm font-medium text-${n}-700 dark:text-${n}-500`,children:[l,f&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:b,children:v.map(c=>e.jsxs("div",{className:`flex items-center mb-2 ${N?"opacity-50 pointer-events-none":""}`,children:[e.jsx("input",{type:"radio",id:`${s}-${c.value}`,value:c.value,disabled:N,checked:$===c.value,className:`h-4 w-4 text-indigo-600 border-${n}-300 focus:ring-indigo-500`,...g??{},onChange:u}),e.jsx("label",{htmlFor:`${s}-${c.value}`,className:`ml-2 block text-sm font-medium text-${n}-900 dark:text-${n}-500`,children:c.label})]},c.value))}),T&&e.jsx("p",{className:`mt-2 italic text-sm text-${n}-500 dark:text-${n}-400`,children:T}),y&&e.jsxs("p",{className:`mt-2 text-sm text-${n}-600 dark:text-${n}-500`,children:[e.jsx("span",{className:"font-medium",children:"Oops!"})," ",(D=y.message)==null?void 0:D.toString()]}),!y&&w&&e.jsx("p",{className:`mt-2 italic text-sm text-${n}-500 dark:text-${n}-400`,children:w})]})},Me=()=>e.jsx(ie,{name:"nombre",title:"Nombre",hint:"Campo de texto",required:!0}),Pe=()=>e.jsx(ye,{name:"agencia",title:"Agencia",options:[{label:"Central",value:"1"},{label:"Norte",value:"2",disabled:!0,disabledLabel:"cerrada"},{label:"Sur",value:"3"}]}),Le=()=>e.jsx(we,{name:"acepta",label:"Acepto los términos",required:!0}),Be=()=>e.jsx(Se,{name:"fecha",title:"Fecha"}),Oe=()=>e.jsx(Fe,{name:"archivo",title:"Archivo",fileTypes:["pdf","png"]}),He=()=>e.jsx(Te,{formId:"demo-form",title:"Formulario de ejemplo",buttons:e.jsx(O,{title:"Enviar"}),children:e.jsx(ie,{name:"campo",title:"Campo"})}),Xe=()=>e.jsx(Ie,{name:"tipo",title:"Tipo",options:[{label:"Uno",value:"1"},{label:"Dos",value:"2"}],orientation:"horizontal"});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{Le as Checkbox,Be as DatePicker,Oe as FileUpload,He as Layout,Xe as Radios,Pe as Select,Me as Text};
@@ -0,0 +1,10 @@
1
+ import{r as h,a as E,b as Z,N as P,s as b,c as Q,d as q,R as X,i as V,e as T,f as Y,g as B,D as J,h as ee,m as W,j as i}from"./index-DUSjZECW.js";/**
2
+ * React Router DOM v6.26.2
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */function S(){return S=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},S.apply(this,arguments)}function z(e,n){if(e==null)return{};var a={},r=Object.keys(e),t,o;for(o=0;o<r.length;o++)t=r[o],!(n.indexOf(t)>=0)&&(a[t]=e[t]);return a}const k="get",F="application/x-www-form-urlencoded";function _(e){return e!=null&&typeof e.tagName=="string"}function te(e){return _(e)&&e.tagName.toLowerCase()==="button"}function ne(e){return _(e)&&e.tagName.toLowerCase()==="form"}function ae(e){return _(e)&&e.tagName.toLowerCase()==="input"}function re(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oe(e,n){return e.button===0&&(!n||n==="_self")&&!re(e)}function I(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,a)=>{let r=e[a];return n.concat(Array.isArray(r)?r.map(t=>[a,t]):[[a,r]])},[]))}function ie(e,n){let a=I(e);return n&&n.forEach((r,t)=>{a.has(t)||n.getAll(t).forEach(o=>{a.append(t,o)})}),a}let j=null;function le(){if(j===null)try{new FormData(document.createElement("form"),0),j=!1}catch{j=!0}return j}const se=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function U(e){return e!=null&&!se.has(e)?null:e}function ce(e,n){let a,r,t,o,l;if(ne(e)){let s=e.getAttribute("action");r=s?b(s,n):null,a=e.getAttribute("method")||k,t=U(e.getAttribute("enctype"))||F,o=new FormData(e)}else if(te(e)||ae(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||s.getAttribute("action");if(r=u?b(u,n):null,a=e.getAttribute("formmethod")||s.getAttribute("method")||k,t=U(e.getAttribute("formenctype"))||U(s.getAttribute("enctype"))||F,o=new FormData(s,e),!le()){let{name:c,type:p,value:w}=e;if(p==="image"){let v=c?c+".":"";o.append(v+"x","0"),o.append(v+"y","0")}else c&&o.append(c,w)}}else{if(_(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=k,r=null,t=F,l=e}return o&&t==="text/plain"&&(l=o,o=void 0),{action:r,method:a.toLowerCase(),encType:t,formData:o,body:l}}const ue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],he=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],de=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],fe="6";try{window.__reactRouterVersion=fe}catch{}const me=h.createContext({isTransitioning:!1}),pe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ve=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=h.forwardRef(function(n,a){let{onClick:r,relative:t,reloadDocument:o,replace:l,state:s,target:u,to:c,preventScrollReset:p,unstable_viewTransition:w}=n,v=z(n,ue),{basename:y}=h.useContext(P),x,g=!1;if(typeof c=="string"&&ve.test(c)&&(x=c,pe))try{let m=new URL(window.location.href),f=c.startsWith("//")?new URL(m.protocol+c):new URL(c),R=b(f.pathname,y);f.origin===m.origin&&R!=null?c=R+f.search+f.hash:g=!0}catch{}let L=Q(c,{relative:t}),C=xe(c,{replace:l,state:s,target:u,preventScrollReset:p,relative:t,unstable_viewTransition:w});function d(m){r&&r(m),m.defaultPrevented||C(m)}return h.createElement("a",S({},v,{href:x||L,onClick:g||o?r:d,ref:a,target:u}))}),ke=h.forwardRef(function(n,a){let{"aria-current":r="page",caseSensitive:t=!1,className:o="",end:l=!1,style:s,to:u,unstable_viewTransition:c,children:p}=n,w=z(n,he),v=T(u,{relative:w.relative}),y=E(),x=h.useContext(ee),{navigator:g,basename:L}=h.useContext(P),C=x!=null&&ye(v)&&c===!0,d=g.encodeLocation?g.encodeLocation(v).pathname:v.pathname,m=y.pathname,f=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;t||(m=m.toLowerCase(),f=f?f.toLowerCase():null,d=d.toLowerCase()),f&&L&&(f=b(f,L)||f);const R=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let A=m===d||!l&&m.startsWith(d)&&m.charAt(R)==="/",O=f!=null&&(f===d||!l&&f.startsWith(d)&&f.charAt(d.length)==="/"),N={isActive:A,isPending:O,isTransitioning:C},G=A?r:void 0,D;typeof o=="function"?D=o(N):D=[o,A?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let $=typeof s=="function"?s(N):s;return h.createElement(we,S({},w,{"aria-current":G,className:D,ref:a,style:$,to:u,unstable_viewTransition:c}),typeof p=="function"?p(N):p)}),Me=h.forwardRef((e,n)=>{let{fetcherKey:a,navigate:r,reloadDocument:t,replace:o,state:l,method:s=k,action:u,onSubmit:c,relative:p,preventScrollReset:w,unstable_viewTransition:v}=e,y=z(e,de),x=be(),g=Se(u,{relative:p}),L=s.toLowerCase()==="get"?"get":"post",C=d=>{if(c&&c(d),d.defaultPrevented)return;d.preventDefault();let m=d.nativeEvent.submitter,f=(m==null?void 0:m.getAttribute("formmethod"))||s;x(m||d.currentTarget,{fetcherKey:a,method:f,navigate:r,replace:o,state:l,relative:p,preventScrollReset:w,unstable_viewTransition:v})};return h.createElement("form",S({ref:n,method:L,action:g,onSubmit:t?c:C},y))});var M;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(M||(M={}));var H;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(H||(H={}));function K(e){let n=h.useContext(J);return n||V(!1),n}function xe(e,n){let{target:a,replace:r,state:t,preventScrollReset:o,relative:l,unstable_viewTransition:s}=n===void 0?{}:n,u=Z(),c=E(),p=T(e,{relative:l});return h.useCallback(w=>{if(oe(w,a)){w.preventDefault();let v=r!==void 0?r:B(c)===B(p);u(e,{replace:v,state:t,preventScrollReset:o,relative:l,unstable_viewTransition:s})}},[c,u,p,r,t,a,e,o,l,s])}function Ee(e){let n=h.useRef(I(e)),a=h.useRef(!1),r=E(),t=h.useMemo(()=>ie(r.search,a.current?null:n.current),[r.search]),o=Z(),l=h.useCallback((s,u)=>{const c=I(typeof s=="function"?s(t):s);a.current=!0,o("?"+c,u)},[o,t]);return[t,l]}function ge(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let Le=0,Ce=()=>"__"+String(++Le)+"__";function be(){let{router:e}=K(M.UseSubmit),{basename:n}=h.useContext(P),a=q();return h.useCallback(function(r,t){t===void 0&&(t={}),ge();let{action:o,method:l,encType:s,formData:u,body:c}=ce(r,n);if(t.navigate===!1){let p=t.fetcherKey||Ce();e.fetch(p,a,t.action||o,{preventScrollReset:t.preventScrollReset,formData:u,body:c,formMethod:t.method||l,formEncType:t.encType||s,unstable_flushSync:t.unstable_flushSync})}else e.navigate(t.action||o,{preventScrollReset:t.preventScrollReset,formData:u,body:c,formMethod:t.method||l,formEncType:t.encType||s,replace:t.replace,state:t.state,fromRouteId:a,unstable_flushSync:t.unstable_flushSync,unstable_viewTransition:t.unstable_viewTransition})},[e,n,a])}function Se(e,n){let{relative:a}=n===void 0?{}:n,{basename:r}=h.useContext(P),t=h.useContext(X);t||V(!1);let[o]=t.matches.slice(-1),l=S({},T(e||".",{relative:a})),s=E();if(e==null){l.search=s.search;let u=new URLSearchParams(l.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),l.search=u.toString()?"?"+u.toString():"")}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Y([r,l.pathname])),B(l)}function ye(e,n){n===void 0&&(n={});let a=h.useContext(me);a==null&&V(!1);let{basename:r}=K(M.useViewTransitionState),t=T(e,{relative:n.relative});if(!a.isTransitioning)return!1;let o=b(a.currentLocation.pathname,r)||a.currentLocation.pathname,l=b(a.nextLocation.pathname,r)||a.nextLocation.pathname;return W(t.pathname,l)!=null||W(t.pathname,o)!=null}const Re="text-slate-900",Pe=(e={open:!1})=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`transition duration-100 ease h-8 w-8 ${e.open?"transform rotate-90":""}`,viewBox:"0 0 20 20",fill:"white",children:i.jsx("path",{fillRule:"evenodd",d:"M3 7a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 13a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"})}),Te=()=>i.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:i.jsx("path",{d:"M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"})}),_e=({size:e=24,className:n="",color:a="currentColor",...r})=>i.jsxs("svg",{className:`text-blue-900 ${n}`,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"3 6 5 6 21 6"}),i.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),i.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),i.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]}),Ae=()=>i.jsxs("svg",{className:"h-4 w-4 text-blue-900",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[" ",i.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),i.jsx("circle",{cx:"10",cy:"10",r:"7"}),i.jsx("line",{x1:"21",y1:"21",x2:"15",y2:"15"})]}),Ne=()=>i.jsx("svg",{className:"h-6 w-6 text-grey-800",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})}),De=()=>i.jsx("svg",{className:"w-5 h-5 mx-1",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M12 15.713L18.01 9.70299L16.597 8.28799L12 12.888L7.40399 8.28799L5.98999 9.70199L12 15.713Z",fill:"currentColor"})}),Fe=()=>i.jsxs("svg",{className:"h-6 w-6 text-white-500 inline",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),i.jsx("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),i.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Ue=()=>i.jsxs("svg",{className:`h-5 w-5 mr-1 ${Re} inline mr-1`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),i.jsx("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"}),i.jsx("path",{d:"M7 12h14l-3 -3m0 6l3 -3"})]}),Be=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:"32px",height:"32px",children:i.jsx("path",{d:"M 6.8125 2.40625 L 5.40625 3.8125 L 7.5 5.90625 L 8.90625 4.5 Z M 25.1875 2.40625 L 23.09375 4.5 L 24.5 5.90625 L 26.59375 3.8125 Z M 16 3.03125 C 15.671875 3.035156 15.335938 3.054688 15 3.09375 C 14.988281 3.09375 14.980469 3.09375 14.96875 3.09375 C 10.914063 3.558594 7.6875 6.835938 7.125 10.875 C 6.675781 14.125 8.015625 17.070313 10.25 18.96875 C 11.207031 19.789063 11.796875 20.882813 12 22 L 12 28 L 14.28125 28 C 14.628906 28.597656 15.261719 29 16 29 C 16.738281 29 17.371094 28.597656 17.71875 28 L 20 28 L 20 24 L 20.09375 24 L 20.09375 22.8125 C 20.09375 21.347656 20.855469 19.867188 22.09375 18.71875 C 23.75 17.0625 25 14.707031 25 12 C 25 7.058594 20.933594 2.984375 16 3.03125 Z M 16 5.03125 C 19.863281 4.976563 23 8.140625 23 12 C 23 14.09375 22.03125 15.9375 20.6875 17.28125 L 20.71875 17.3125 C 19.375 18.566406 18.515625 20.207031 18.28125 22 L 13.90625 22 C 13.6875 20.285156 12.949219 18.628906 11.5625 17.4375 C 9.796875 15.933594 8.742188 13.675781 9.09375 11.125 C 9.53125 7.972656 12.085938 5.441406 15.21875 5.09375 C 15.480469 5.0625 15.742188 5.035156 16 5.03125 Z M 2 12 L 2 14 L 5 14 L 5 12 Z M 27 12 L 27 14 L 30 14 L 30 12 Z M 7.5 20.09375 L 5.40625 22.1875 L 6.8125 23.59375 L 8.90625 21.5 Z M 24.5 20.09375 L 23.09375 21.5 L 25.1875 23.59375 L 26.59375 22.1875 Z M 14 24 L 18 24 L 18 26 L 14 26 Z"})}),Ie=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:i.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM8.94 6.94a.75.75 0 11-1.06-1.061 3 3 0 112.837 5.063v.127a.75.75 0 01-1.5 0v-.375c0-.662.45-1.039.876-1.288A1.5 1.5 0 108.94 6.94zM10 15a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),Ve=()=>i.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5 text-gray-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})}),ze=()=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"22",id:"download",children:i.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",children:i.jsx("path",{d:"M1 16v3a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-3M6 11l4 4 4-4M10 1v14"})})});export{Ve as C,ze as D,Te as E,Me as F,Be as I,we as L,Pe as M,ke as N,Fe as O,Ie as Q,Ae as S,_e as T,Ne as a,Ue as b,De as c,Ee as u};
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-DUSjZECW.js";const r=t=>{const{description:l,title:a,className:s}=t;return e.jsxs("div",{className:`block ${s}`,children:[e.jsx("label",{className:"inline text-sm font-medium text-gray-700",children:`${a.toUpperCase()} `}),e.jsx("label",{className:"inline text-sm font-medium text-gray-500",children:l})]})},n=({items:t,emptyText:l="Sin filtros registrados",className:a=""})=>t!=null&&t.length?e.jsx("dl",{className:`flex flex-col gap-1 text-xs text-gray-700 ${a}`,children:t.map(s=>e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-1",children:[e.jsxs("dt",{className:"font-semibold text-gray-500",children:[s.label,":"]}),e.jsx("dd",{className:"text-gray-800",children:s.value})]},s.key))}):e.jsx("p",{className:`text-xs text-gray-400 ${a}`,children:l}),i=()=>e.jsx(r,{title:"Agencia",description:"Central"}),d=()=>e.jsx(n,{items:[{key:"dates",label:"Fechas",value:"01/01/2026 – 31/01/2026"},{key:"agency",label:"Agencia",value:"Todas"}]}),o=()=>e.jsx(n,{items:[]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{d as Filters,o as FiltersEmpty,i as Info};
@@ -0,0 +1 @@
1
+ import{r as u,j as e}from"./index-DUSjZECW.js";const R=({rows:n,columns:o,isChecked:d,isPending:a=()=>!1,onToggle:g,disabled:s=!1,renderRowAction:i,checkedLabel:l="Marcado",uncheckedLabel:p="Sin marcar",pendingLabel:c="Guardando…",emptyText:m="No hay filas para mostrar.",pageSize:w=20,showMoreLabel:C="Mostrar más",className:f=""})=>{const x=Math.max(1,w),[k,j]=u.useState(x),$=n.map(t=>t.key).join("\0");if(u.useEffect(()=>{j(x)},[$,x]),n.length===0)return e.jsx("p",{className:`p-4 text-sm text-gray-600 ${f}`,children:m});const S=n.slice(0,k);return e.jsxs("div",{className:`space-y-3 ${f}`,children:[S.map(t=>e.jsxs("fieldset",{className:"min-w-0 rounded-lg border border-gray-200 bg-white p-3 shadow-sm",children:[e.jsxs("div",{className:"mb-3 flex min-w-0 items-start justify-between gap-3",children:[e.jsxs("legend",{className:"min-w-0 flex-1 px-0 text-sm font-semibold text-gray-900",children:[e.jsx("span",{className:"block break-words",children:t.label}),t.description?e.jsx("span",{className:"mt-0.5 block break-words text-xs font-normal text-gray-600",children:t.description}):null]}),i?e.jsx("div",{className:"shrink-0",children:i(t)}):null]}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:o.map(r=>{const h=d(t.key,r.key),b=a(t.key,r.key),v=`check-matrix-${encodeURIComponent(t.key)}-${encodeURIComponent(r.key)}`;return e.jsxs("label",{htmlFor:v,className:`flex min-h-11 cursor-pointer items-center gap-3 rounded-md border px-3 py-2 text-sm focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-1 ${h?"border-indigo-200 bg-indigo-50 text-indigo-950":"border-gray-200 bg-gray-50 text-gray-800"} ${b||s?"cursor-not-allowed opacity-70":"hover:border-indigo-300"}`,children:[e.jsx("input",{id:v,type:"checkbox",checked:h,disabled:s||b,onChange:E=>g(t.key,r.key,E.target.checked),className:"h-5 w-5 shrink-0 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"}),e.jsx("span",{className:"min-w-0 flex-1 break-words font-medium",children:r.label}),e.jsx("span",{className:`shrink-0 text-xs font-medium ${h?"text-indigo-700":"text-gray-600"}`,"aria-live":b?"polite":void 0,children:b?c:h?l:p})]},r.key)})})]},t.key)),k<n.length?e.jsxs("button",{type:"button",onClick:()=>j(t=>t+x),className:"min-h-11 w-full cursor-pointer rounded-md border border-indigo-300 bg-white px-4 py-2 text-sm font-semibold text-indigo-700 hover:bg-indigo-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2",children:[C," (",n.length-k,")"]}):null]})},M={sm:{mobile:"sm:hidden",desktop:"hidden sm:block"},md:{mobile:"md:hidden",desktop:"hidden md:block"},lg:{mobile:"lg:hidden",desktop:"hidden lg:block"}},P=({desktop:n,desktopBreakpoint:o="md",...d})=>{const a=M[o];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.mobile,children:e.jsx(R,{...d})}),e.jsx("div",{className:a.desktop,children:n})]})},N=[{key:"129",label:"129 · Cooperativa El Progreso",description:"San Juan"},{key:"302",label:"302 · Productor con un nombre largo para validar el ajuste de texto"}],y=[{key:"brocoli",label:"Brócoli certificado"},{key:"radicchio",label:"Radicchio"},{key:"elotin",label:"Elotín"}],I=()=>{const[n,o]=u.useState(new Set(["129:radicchio"])),d=(s,i)=>!n.has(`${s}:${i}`),a=(s,i,l)=>{o(p=>{const c=new Set(p),m=`${s}:${i}`;return l?c.delete(m):c.add(m),c})},g=e.jsx("div",{className:"overflow-x-auto rounded-md border border-gray-200",children:e.jsxs("table",{className:"min-w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Proveedor"}),y.map(s=>e.jsx("th",{className:"px-3 py-2 text-center",children:s.label},s.key))]})}),e.jsx("tbody",{children:N.map(s=>e.jsxs("tr",{className:"border-t border-gray-200",children:[e.jsx("th",{className:"px-3 py-2 text-left",children:s.label}),y.map(i=>e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsx("input",{type:"checkbox","aria-label":`${String(s.label)}, ${String(i.label)}`,checked:d(s.key,i.key),onChange:l=>a(s.key,i.key,l.target.checked)})},i.key))]},s.key))})]})});return e.jsx(P,{rows:N,columns:y,desktop:g,isChecked:d,onToggle:a,checkedLabel:"Permitida",uncheckedLabel:"Bloqueada"})};typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{I as Responsive};
@@ -0,0 +1 @@
1
+ import{j as e,r as d}from"./index-DUSjZECW.js";import{A as m,m as i}from"./proxy-BETbFm71.js";import{B as x}from"./Button-YPU2MaHD.js";const h=({isOpen:a,onClose:s,title:o,current:r,total:n,currentItem:l,description:c})=>{const t=n>0?Math.round(r/n*100):0;return e.jsx(m,{children:a&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black bg-opacity-50",onClick:s}),e.jsxs(i.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:20,stiffness:300},className:"relative bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:o}),t===100&&e.jsx("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors",children:e.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"space-y-4",children:[c&&e.jsx("p",{className:"text-sm text-gray-600",children:c}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsxs("span",{className:"text-gray-600",children:[r," de ",n," completado"]}),e.jsxs("span",{className:"font-medium text-blue-600",children:[t,"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-3",children:e.jsx(i.div,{initial:{width:0},animate:{width:`${t}%`},transition:{duration:.3},className:"h-3 bg-blue-600 rounded-full flex items-center justify-end pr-1",children:t>10&&e.jsx("div",{className:"w-2 h-2 bg-white rounded-full"})})})]}),l&&e.jsx("div",{className:"bg-blue-50 border-l-4 border-blue-400 p-3 rounded",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsxs("svg",{className:"w-5 h-5 text-blue-400 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),e.jsx("div",{className:"ml-3",children:e.jsxs("p",{className:"text-sm font-medium text-blue-800",children:["Procesando: ",l]})})]})}),t===100&&e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-green-50 border-l-4 border-green-400 p-3 rounded",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("div",{className:"ml-3",children:e.jsx("p",{className:"text-sm font-medium text-green-800",children:"¡PDF generado exitosamente!"})})]})})]})]})]})})},f=()=>{const[a,s]=d.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsx(x,{type:"button",title:"Abrir progreso",onClickSave:()=>s(!0)}),e.jsx(h,{isOpen:a,onClose:()=>s(!1),title:"Procesando",current:3,total:10,currentItem:"Item 3",description:"Trabajo de ejemplo"})]})};typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{f as Progress};
@@ -0,0 +1 @@
1
+ import{n as b,o as ke,q as Ie,t as Ne,T as Ce,r as l,b as Fe,a as D,j as a}from"./index-DUSjZECW.js";import{b as Ee,M as Pe,E as Le,O as Re,c as Oe}from"./Icons-BxLN_JWC.js";import{L as y}from"./components-FzdPzEyL.js";const K={sky:{bg900:"bg-sky-900",bg700:"bg-sky-700",bg600:"bg-sky-600",bg500:"bg-sky-500",bg200:"bg-sky-200",ring600:"ring-sky-600",ring500:"ring-sky-500"},purple:{bg900:"bg-purple-900",bg700:"bg-purple-700",bg600:"bg-purple-600",bg500:"bg-purple-500",bg200:"bg-purple-200",ring600:"ring-purple-600",ring500:"ring-purple-500"},pink:{bg900:"bg-pink-900",bg700:"bg-pink-700",bg600:"bg-pink-600",bg500:"bg-pink-500",bg200:"bg-pink-200",ring600:"ring-pink-600",ring500:"ring-pink-500"},slate:{bg900:"bg-slate-900",bg700:"bg-slate-700",bg600:"bg-slate-600",bg500:"bg-slate-500",bg200:"bg-slate-200",ring600:"ring-slate-600",ring500:"ring-slate-500"},green:{bg900:"bg-green-900",bg700:"bg-green-700",bg600:"bg-green-600",bg500:"bg-green-500",bg200:"bg-green-200",ring600:"ring-green-600",ring500:"ring-green-500"},yellow:{bg900:"bg-yellow-900",bg700:"bg-yellow-700",bg600:"bg-yellow-600",bg500:"bg-yellow-500",bg200:"bg-yellow-200",ring600:"ring-yellow-600",ring500:"ring-yellow-500"},red:{bg900:"bg-red-900",bg700:"bg-red-700",bg600:"bg-red-600",bg500:"bg-red-500",bg200:"bg-red-200",ring600:"ring-red-600",ring500:"ring-red-500"}},Ae={agencyProfile:{},loadingAgencyProfile:!1},$e=b({name:"agency",initialState:Ae,reducers:{setAgencyProfile:(e,t)=>{e.agencyProfile=t.payload},setLoadingAgencyProfile:(e,t)=>{e.loadingAgencyProfile=t.payload,e.loadingAgencyProfile=!1}}}),{setAgencyProfile:ut,setLoadingAgencyProfile:pt}=$e.actions,Te={purchaseOrderIdNumber:{data:"",loading:!1},dischargeIdNumber:{data:"NCB00000",loading:!1}},Z=b({name:"automaticNumbers",initialState:Te,reducers:{automaticNumberFetchStart:(e,t)=>{e[t.payload].loading=!0},automaticNumberFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{automaticNumberFetchStart:mt,automaticNumberFetchSuccess:gt}=Z.actions,X=Z.reducer,o=e=>({data:e,loading:!1,reFetch:!1}),Me={agencies:o([]),suggestedPrices:o([]),providers:o([]),providerCategories:o([]),receptionTypes:o([]),tiposDeMuestra:o([]),templates:o([]),shipments:o([]),bookings:o([]),programaciones4pinos:o([]),providerReceptionBlockRules:o([]),providerReceptionExceptions:o([]),motivosRechazo:o([]),ccPorcentajesDeRechazo:o([]),solicitudesEliminacionPO:o([]),poDiscountHistory:o([]),authorizationUpdateDiscountPO:o([]),bitacoraRechazoMasivo:o([]),pesoMaximoPorCanasta:o([]),items:o([]),itemsByReception:o([]),payees:o([]),payeesForLab:o([]),itemCategoriesForLab:o([]),payeeCategoriesLabPrices:o([]),payeeCategories:o([]),clientCategories:o([]),itemsByLab:o([]),itemServicesByLab:o([]),bundlesRecipForLab:o([]),bundlesForLab:o([]),currencies:o([]),paymentTerms:o([]),employees:o([]),employeesByLab:o([]),employeesByCurrentAgency:o([]),invoicesByLab:o([]),invoicesByCurrentAgency:o([]),invoiceForms:o([]),caseForms:o([]),allForms:o([]),invoiceFormSubmissions:o([]),cases:o([]),myCaseFormSubmissions:o([]),myAgencyLotStocks:o([]),shipmentsToMyAgency:o([]),paymentMethods:o([]),printTemplates:o([]),invoiceFormSubmissionsByInvoiceId:o([]),invoiceFormSubmissionsByAgencyId:o([]),caseFormSubmissionsByCaseId:o([])},$=(e,t)=>(e[t]||(e[t]={data:[],loading:!1,reFetch:!1}),e[t]),Y=b({name:"catalogs",initialState:Me,reducers:{catalogsSetReFetch:(e,t)=>{$(e,t.payload).reFetch=!0},catalogsFetchStart:(e,t)=>{$(e,t.payload).loading=!0},catalogsFetchSuccess:(e,t)=>{const s=$(e,t.payload.name);s.data=t.payload.data,s.loading=!1,s.reFetch=!1}}}),{catalogsFetchStart:ft,catalogsFetchSuccess:bt,catalogsSetReFetch:ht}=Y.actions,ee=Y.reducer,Be={formValidations:{}},te=b({name:"formValidation",initialState:Be,reducers:{setFieldError:(e,t)=>{e.formValidations[t.payload.formName]||(e.formValidations[t.payload.formName]={}),e.formValidations[t.payload.formName][t.payload.name]=t.payload.error},clearFieldError:(e,t)=>{var s;(s=e.formValidations[t.payload.formName])==null||delete s[t.payload.name]},clearFormErrors:(e,t)=>{delete e.formValidations[t.payload.formName]}}}),{setFieldError:xt,clearFieldError:yt,clearFormErrors:St}=te.actions,ae=te.reducer,De={},oe=b({name:"formSavedData",initialState:De,reducers:{setFormFieldSavedData:(e,t)=>{e[t.payload.formName]||(e[t.payload.formName]={}),e[t.payload.formName][t.payload.name]=t.payload.value}}}),{setFormFieldSavedData:vt}=oe.actions,ne=oe.reducer,Ve={userProfile:{data:{},loading:!1},oauthProfile:{data:{},loading:!1},employeeProfile:{data:{},loading:!1},agencyProfile:{data:{},loading:!1}},se=b({name:"profile",initialState:Ve,reducers:{profileFetchStart:(e,t)=>{e[t.payload].loading=!0},profileFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{profileFetchStart:wt,profileFetchSuccess:jt}=se.actions,re=se.reducer,_e={basketLots:{data:{},loading:!1,reFetch:!1},rejectionInfo:{data:{},loading:!1,reFetch:!1},newPurchaseOrderInfo:{data:{},loading:!1,reFetch:!1},purchaseOrderGeneralInfo:{data:{},loading:!1,reFetch:!1},poReceptions:{data:[],loading:!1,reFetch:!1},queueReceptions:{data:[],loading:!1,reFetch:!1},offlineQueueReceptions:{data:[],loading:!1,reFetch:!1},offlineQueueShipments:{data:[],loading:!1,reFetch:!1}},ie=b({name:"reception",initialState:_e,reducers:{receptionFetchStart:(e,t)=>{e[t.payload].loading=!0},receptionFetchSuccess:(e,t)=>{e[t.payload.name].data?e[t.payload.name].data=t.payload.data:console.error("receptionFetchSuccess not found: ",t.payload.name),e[t.payload.name].loading=!1},receptionConcatToArray:(e,t)=>{e[t.payload.name].data?Array.isArray(e[t.payload.name].data)&&(e[t.payload.name].data=[...e[t.payload.name].data,t.payload.data]):console.error("receptionConcatToArray not found: ",t.payload.name),e[t.payload.name].loading=!1}}}),{receptionFetchStart:kt,receptionFetchSuccess:It,receptionConcatToArray:Nt}=ie.actions,le=ie.reducer,ze={},ce=b({name:"session",initialState:ze,reducers:{setSessionValue:(e,t)=>{e[t.payload.name]=t.payload.data}}}),{setSessionValue:Ct}=ce.actions,de=ce.reducer,Ue={pageTable1:1,pageTable2:1,pageTable3:1},ue=b({name:"table",initialState:Ue,reducers:{tableSetPage:(e,t)=>{e[t.payload.name]=t.payload.data}}}),{tableSetPage:Ft}=ue.actions,pe=ue.reducer,Ge={receptionTemplate:{data:"",loading:!1}},me=b({name:"template",initialState:Ge,reducers:{templateFetchStart:(e,t)=>{e[t.payload].loading=!0},templateFetchSuccess:(e,t)=>{e[t.payload.name].data=t.payload.data,e[t.payload.name].loading=!1}}}),{templateFetchStart:Et,templateFetchSuccess:Pt}=me.actions,ge=me.reducer,Qe={userProfile:{},loadingUserProfile:!1,oauthProfile:{},loadingOauthProfile:!1,employeeProfile:{},loadingEmployeeInfo:!1},qe=b({name:"user",initialState:Qe,reducers:{setUserProfile:(e,t)=>{e.userProfile=t.payload,e.loadingUserProfile=!1},setLoadingUserProfile:(e,t)=>{e.loadingUserProfile=t.payload},setOauthProfile:(e,t)=>{e.oauthProfile=t.payload,e.loadingOauthProfile=!1},setLoadingOauthProfile:(e,t)=>{e.loadingOauthProfile=t.payload},setEmployeeProfile:(e,t)=>{e.employeeProfile=t.payload,e.loadingEmployeeInfo=!1},setLoadingEmployeeProfile:(e,t)=>{e.loadingEmployeeInfo=t.payload}}}),{setUserProfile:Lt,setEmployeeProfile:Rt,setOauthProfile:Ot,setLoadingEmployeeProfile:At,setLoadingOauthProfile:$t,setLoadingUserProfile:Tt}=qe.actions,We={specialItems:[],loadingSpecialItems:!1},fe=b({name:"webappTables",initialState:We,reducers:{setLoadingSpecialItems:(e,t)=>{e.loadingSpecialItems=t.payload},setSpecialItems:(e,t)=>{e.specialItems=t.payload,e.loadingSpecialItems=!1}}}),{setLoadingSpecialItems:Mt,setSpecialItems:Bt}=fe.actions,be=fe.reducer,T="___redux__state__v8.0";function He(e){return e instanceof DOMException&&e.name==="QuotaExceededError"?!0:typeof e=="object"&&e!==null&&"name"in e&&e.name==="QuotaExceededError"}function Je(e){if(!(typeof document>"u"))try{localStorage.setItem(T,JSON.stringify(e))}catch(t){if(He(t)){console.warn("[@zauru-sdk/redux] localStorage quota exceeded; Redux state was not persisted.",{key:T,error:t});return}console.error("[@zauru-sdk/redux] Failed to persist Redux state to localStorage.",t)}}const Ke=e=>t=>s=>{const c=t(s);return Je(e.getState()),c},Ze=()=>({catalogs:ee(void 0,{type:"@@INIT"}),profiles:re(void 0,{type:"@@INIT"}),webappTables:be(void 0,{type:"@@INIT"}),receptions:le(void 0,{type:"@@INIT"}),session:de(void 0,{type:"@@INIT"}),templates:ge(void 0,{type:"@@INIT"}),automaticNumbers:X(void 0,{type:"@@INIT"}),tables:pe(void 0,{type:"@@INIT"}),formSavedData:ne(void 0,{type:"@@INIT"}),formValidation:ae(void 0,{type:"@@INIT"})}),H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Xe=(()=>{try{if(!(typeof document>"u")){const e=localStorage.getItem(T);if(e){const t=JSON.parse(e),s=Ze(),c={};for(const r of Object.keys(s)){const p=s[r],d=t==null?void 0:t[r];H(p)&&H(d)?c[r]={...p,...d}:c[r]=d??p}return c}}}catch{}})(),Ye="zauru/RESET_STORE",et=Ie({catalogs:ee,profiles:re,webappTables:be,receptions:le,session:de,templates:ge,automaticNumbers:X,tables:pe,formSavedData:ne,formValidation:ae}),tt=(e,t)=>t.type===Ye?t.payload:et(e,t);Ne({reducer:tt,preloadedState:Xe,middleware:e=>new Ce(Ke)});const at=ke,he=(e,t)=>e.selectedColor?K[e.selectedColor]:t,V=e=>(e.childrens??[]).filter(t=>t.hide!==!0),P=(e,t)=>t?e===t||e.startsWith(`${t}/`):!1,v="focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-offset-2 focus-visible:ring-offset-transparent",_=(e,t)=>`inline-flex min-h-11 cursor-pointer items-center gap-1 rounded-full px-4 text-xs font-medium uppercase leading-none text-white transition-opacity duration-150 motion-reduce:transition-none ${t?e.bg900:e.bg700} hover:opacity-90 ${v}`,j=e=>`flex min-h-11 w-full cursor-pointer items-center gap-2 rounded-lg px-3 text-left text-sm font-medium text-white transition-colors duration-150 motion-reduce:transition-none hover:bg-white/10 ${v} ${e?"bg-white/15":""}`,M=e=>`flex min-h-11 w-full cursor-pointer items-center gap-2 px-4 text-sm transition-colors duration-150 motion-reduce:transition-none ${e?"text-red-700 hover:bg-red-50":"text-gray-700 hover:bg-gray-100"}`,J=({value:e})=>a.jsx("span",{className:"absolute -top-1.5 -right-1.5 flex h-5 min-w-5 items-center justify-center rounded-full bg-red-500 px-1 text-xs font-bold text-white",children:e}),ot=e=>{const t=at(r=>e.reduxNotificationBadge?e.reduxNotificationBadge(r):void 0),[s,c]=l.useState();return l.useEffect(()=>{c(t)},[t]),s},B=({open:e})=>a.jsx("span",{className:`inline-flex shrink-0 transition-transform duration-150 motion-reduce:transition-none ${e?"rotate-180":""}`,"aria-hidden":"true",children:a.jsx(Oe,{})}),nt=({item:e,color:t,layout:s,onNavigate:c})=>{const r=D(),p=P(r.pathname,e.link),d=ot(e),n=he(e,t);return s==="mobile"?a.jsx("li",{children:a.jsxs(y,{to:e.link,"aria-current":p?"page":void 0,onClick:c,className:`${j(p)} relative`,children:[e.icon,a.jsx("span",{className:"flex-1",children:e.name}),d!==void 0&&a.jsx(J,{value:d})]})}):a.jsx("li",{className:"relative",children:a.jsxs(y,{to:e.link,"aria-current":p?"page":void 0,className:`${_(n,p)} relative`,children:[e.icon,a.jsx("span",{children:e.name}),d!==void 0&&a.jsx(J,{value:d})]})})},st=({item:e,color:t,layout:s,open:c,onToggle:r,onNavigate:p})=>{const d=D(),n=V(e),g=n.some(m=>P(d.pathname,m.link)),u=he(e,t),h=l.useId();return n.length===0?null:s==="mobile"?a.jsxs("li",{children:[a.jsxs("button",{type:"button","aria-expanded":c,"aria-controls":h,onClick:r,className:j(g),children:[e.icon,a.jsx("span",{className:"flex-1",children:e.name}),a.jsx(B,{open:c})]}),a.jsx("ul",{id:h,hidden:!c,className:"mt-1 ml-3 space-y-1 border-l border-white/20 pl-2",children:n.map(m=>{const x=P(d.pathname,m.link);return a.jsx("li",{children:a.jsxs(y,{to:m.link,"aria-current":x?"page":void 0,onClick:p,className:j(x),children:[m.icon,a.jsx("span",{children:m.name})]})},m.link)})})]}):a.jsxs("li",{className:"relative",children:[a.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":c,"aria-controls":h,onClick:r,className:_(u,g),children:[e.icon,a.jsx("span",{children:e.name}),a.jsx(B,{open:c})]}),a.jsx("div",{id:h,role:"menu",hidden:!c,className:"absolute left-0 z-30 mt-2 min-w-[14rem] overflow-hidden rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5",children:n.map(m=>a.jsxs(y,{role:"menuitem",to:m.link,onClick:p,className:M(),children:[m.icon,a.jsx("span",{children:m.name})]},m.link))})]})},rt=({color:e,layout:t,open:s,onToggle:c,onNavigate:r,entries:p})=>{const d=l.useId();return p.length===0?null:t==="mobile"?a.jsxs("div",{className:"mt-4 border-t border-white/20 pt-4",children:[a.jsx("p",{className:"px-3 pb-2 text-xs font-semibold uppercase tracking-wide text-white/70",children:"Cuenta"}),a.jsx("ul",{className:"space-y-1",children:p.map(n=>a.jsx("li",{children:n.to?a.jsxs(y,{to:n.to,onClick:r,className:`${j(!1)} [&_svg]:!text-current ${n.danger?"text-red-100 hover:bg-red-500/20":""}`,children:[n.icon,a.jsx("span",{children:n.label})]}):a.jsxs("button",{type:"button",onClick:()=>{var g;(g=n.onClick)==null||g.call(n),r==null||r()},className:`${j(!1)} [&_svg]:!text-current`,children:[n.icon,a.jsx("span",{children:n.label})]})},n.key))})]}):a.jsxs("div",{className:"relative ml-auto",children:[a.jsxs("button",{type:"button","aria-label":"Menú de usuario","aria-haspopup":"menu","aria-expanded":s,"aria-controls":d,onClick:c,className:`${_(e,s)} p-0 px-3`,children:[a.jsx(Re,{}),a.jsx(B,{open:s})]}),a.jsx("div",{id:d,role:"menu",hidden:!s,className:"absolute right-0 z-30 mt-2 w-56 overflow-hidden rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5",children:p.map(n=>n.to?a.jsxs(y,{role:"menuitem",to:n.to,onClick:r,className:M(n.danger),children:[n.icon,a.jsx("span",{children:n.label})]},n.key):a.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{var g;(g=n.onClick)==null||g.call(n),r==null||r()},className:M(n.danger),children:[n.icon,a.jsx("span",{children:n.label})]},n.key))})]})},it=({items:e,color:t,layout:s,openMenuId:c,setOpenMenuId:r,onNavigate:p})=>a.jsx("ul",{className:s==="mobile"?"flex flex-col gap-1":"flex flex-wrap items-center gap-1",children:e.map((d,n)=>{const g=V(d),u=`${d.name}-${n}`;return g.length>0?a.jsx(st,{item:d,color:t,layout:s,open:c===u,onToggle:()=>r(h=>h===u?null:u),onNavigate:p},u):a.jsx(nt,{item:d,color:t,layout:s,onNavigate:p},u)})}),k=({title:e,loggedIn:t,items:s,selectedColor:c,version:r,reloadCatalogsOption:p,settingsOption:d,showDarkModeToggle:n=!1})=>{const g=K[c],[u,h]=l.useState(!1),[m,x]=l.useState(null),[ye,w]=l.useState(null),[L,Se]=l.useState(r),[N,ve]=l.useState(!1),we=Fe(),R=D(),U=l.useRef(null),O=l.useRef(null),G=l.useRef(!1),Q=l.useId(),C=l.useMemo(()=>s.filter(i=>i.loggedIn===t&&i.hide!==!0),[s,t]);l.useEffect(()=>{document.documentElement.classList.toggle("dark",N)},[N]),l.useEffect(()=>{r!==L&&Se(r)},[r,L]),l.useEffect(()=>{h(!1),x(null),w(null)},[R.pathname]),l.useEffect(()=>{if(!u)return;const i=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=i}},[u]),l.useEffect(()=>{const i=O.current;i&&(u?i.removeAttribute("inert"):i.setAttribute("inert",""))},[u]),l.useEffect(()=>{const i=f=>{f.key==="Escape"&&(h(!1),x(null),w(null))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[]),l.useEffect(()=>{if(!m)return;const i=f=>{var F,E;const S=f.target;(F=O.current)!=null&&F.contains(S)||(E=U.current)!=null&&E.contains(S)||x(null)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[m]);const A=()=>{h(!1),x(null),w(null)},q=()=>{window.setTimeout(A,0)},je=l.useMemo(()=>{if(!t)return[];const i=[];return d&&i.push({key:"configuracion",label:"Configuración",to:"/configuracion",icon:a.jsxs("svg",{className:"h-5 w-5 shrink-0",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[a.jsx("path",{d:"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"}),a.jsx("path",{d:"M19.4 13a7.7 7.7 0 0 0 .06-2l2.1-1.64-2-3.46-2.55 1a7.7 7.7 0 0 0-1.73-1L14.7 2H9.3l-.58 2.9a7.7 7.7 0 0 0-1.73 1l-2.55-1-2 3.46L4.54 11a7.7 7.7 0 0 0 0 2l-2.1 1.64 2 3.46 2.55-1a7.7 7.7 0 0 0 1.73 1L9.3 22h5.4l.58-2.9a7.7 7.7 0 0 0 1.73-1l2.55 1 2-3.46Z"})]})}),p&&i.push({key:"recargar-catalogos",label:"Recargar catálogos",to:"/reload-catalogs",icon:a.jsxs("svg",{className:"h-5 w-5 shrink-0",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[a.jsx("path",{d:"M20.5 8c-1.392-3.179-4.823-5-8.522-5C7.299 3 3.453 6.552 3 11.1"}),a.jsx("path",{d:"M16.489 8.4h3.97A.54.54 0 0 0 21 7.86V3.9M3.5 16c1.392 3.179 4.823 5 8.522 5 4.679 0 8.525-3.552 8.978-8.1"}),a.jsx("path",{d:"M7.511 15.6h-3.97a.54.54 0 0 0-.541.54v3.96"})]})}),n&&i.push({key:"dark-mode-toggle",label:N?"Modo claro":"Modo oscuro",onClick:()=>ve(f=>!f)}),i.push({key:"cerrar-sesion",label:"Cerrar sesión",to:"/logout",icon:a.jsx(Ee,{}),danger:!0}),i},[t,d,p,n,N]);l.useEffect(()=>{const i=u&&!G.current;if(G.current=u,!i)return;const f=C.find(F=>V(F).some(E=>P(R.pathname,E.link)));if(!f)return;const S=C.indexOf(f);w(`${f.name}-${S}`)},[u,C,R.pathname]);const W=i=>{const f=i==="mobile";return a.jsxs(a.Fragment,{children:[a.jsx(it,{items:C,color:g,layout:i,openMenuId:f?ye:m,setOpenMenuId:f?w:x,onNavigate:q}),a.jsx(rt,{color:g,layout:i,open:m==="user",onToggle:()=>x(S=>S==="user"?null:"user"),onNavigate:q,entries:je})]})};return a.jsx("nav",{className:`py-2 ${g.bg600}`,"aria-label":"Principal",children:a.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between gap-2 lg:w-auto lg:flex-none",children:[a.jsxs(y,{className:`inline-flex min-h-11 min-w-0 cursor-pointer items-center gap-2 truncate text-sm font-bold uppercase text-white ${v}`,to:"/home",children:[a.jsx("img",{className:"h-7 w-auto shrink-0",src:"/logo.png",alt:""}),a.jsx("span",{className:"truncate",children:e})]}),r!==L&&a.jsx("button",{type:"button",className:`shrink-0 cursor-pointer rounded-full px-3 py-2 text-xs text-white ${g.bg700} hover:opacity-90 ${v}`,onClick:()=>we(0),children:"Actualizar versión"}),a.jsx("button",{type:"button",className:`inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-md text-white lg:hidden ${v} ${u?"pointer-events-none invisible":""}`,"aria-label":"Abrir menú","aria-expanded":u,"aria-controls":Q,"aria-hidden":u,tabIndex:u?-1:void 0,onClick:()=>h(!0),children:a.jsx(Pe,{open:!1})})]}),u&&a.jsx("button",{type:"button","aria-label":"Cerrar menú",className:"fixed inset-0 z-40 cursor-pointer bg-black/40 lg:hidden",onClick:A}),a.jsxs("div",{ref:O,id:Q,"aria-hidden":!u,className:`fixed inset-y-0 left-0 z-50 flex w-[min(20rem,86vw)] flex-col ${g.bg700} shadow-lg transition-transform duration-200 ease-out motion-reduce:transition-none lg:hidden ${u?"translate-x-0":"pointer-events-none -translate-x-full"}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-white/15 px-4 py-3",children:[a.jsx("p",{className:"truncate text-sm font-bold uppercase text-white",children:e}),a.jsx("button",{type:"button",className:`inline-flex min-h-11 min-w-11 cursor-pointer items-center justify-center rounded-md text-white ${v}`,"aria-label":"Cerrar menú",onClick:A,children:a.jsx(Le,{})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain p-3",children:W("mobile")})]}),a.jsx("div",{ref:U,className:"hidden min-w-0 flex-1 items-center gap-2 lg:flex",children:W("desktop")})]})})},z=[{name:"Nueva contraseña",link:"/receptions/new",loggedIn:!0,selectedColor:"green"},{name:"Cierre de turno",link:"/cierre-turno",loggedIn:!0},{name:"Contraseñas",link:"/receptions",loggedIn:!0},{name:"Procesos",link:"/processes",loggedIn:!0},{name:"Envíos",link:"/shipments",loggedIn:!0,childrens:[{name:"Listado de envíos",link:"/shipments",loggedIn:!0},{name:"Nuevo envío",link:"/shipments/new",loggedIn:!0}]}],xe=[{name:"Configuración",link:"/configuration",loggedIn:!0},{name:"Modificar costos",link:"/prices",loggedIn:!0},{name:"Bitácora",link:"/history",loggedIn:!0}],I=({children:e})=>a.jsx("div",{className:"-m-6 min-h-screen bg-slate-100",children:e}),Dt=()=>a.jsx(I,{children:a.jsx(k,{title:"Recepción de Verduras",items:z,loggedIn:!0,selectedColor:"slate",settingsOption:!0,reloadCatalogsOption:!0})}),Vt=()=>a.jsx(I,{children:a.jsx(k,{title:"Costos de verduras",items:xe,loggedIn:!0,selectedColor:"green",settingsOption:!0})}),_t=()=>a.jsx(I,{children:a.jsx(k,{title:"Control de calidad operativo",items:z.map(e=>({...e,selectedColor:void 0})),loggedIn:!0,selectedColor:"yellow",settingsOption:!0,reloadCatalogsOption:!0})}),zt=()=>a.jsx(I,{children:a.jsx(k,{title:"Agri-Food Safety Lab",items:xe,loggedIn:!0,selectedColor:"sky",settingsOption:!0})}),Ut=()=>a.jsx(I,{children:a.jsx(k,{title:"Envíos",items:z.filter(e=>e.name==="Envíos"),loggedIn:!0,selectedColor:"red",settingsOption:!0,reloadCatalogsOption:!0})});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{_t as CalidadYellow,Vt as CostosGreen,Ut as EnviosRed,zt as LaboratorioSky,Dt as RecepcionesSlate};
@@ -0,0 +1 @@
1
+ import{r as s,j as e}from"./index-DUSjZECW.js";import{h as E,i as M,p as k,m as f,A as z}from"./proxy-BETbFm71.js";function C(){!E.current&&M();const[r]=s.useState(k.current);return r}const g=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"})}),v=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"})}),L=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6","aria-hidden":"true",focusable:"false",children:e.jsx("path",{fillRule:"evenodd",d:"M3 6a1 1 0 011-1h16a1 1 0 110 2H4a1 1 0 01-1-1zm0 6a1 1 0 011-1h10a1 1 0 110 2H4a1 1 0 01-1-1zm0 6a1 1 0 011-1h4a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"})}),I=({children:r,closeOnClickOutside:a=!0,widthPercentage:b=25,buttonIcon:l="chevron",ariaLabel:y="Panel lateral",openButtonLabel:j="Abrir panel",closeButtonLabel:m="Cerrar panel"})=>{const[t,o]=s.useState(!1),d=s.useRef(null),h=s.useRef(null),p=s.useRef(null),c=s.useRef(!1),x=s.useId(),u=C(),w=()=>{o(n=>!n)};s.useEffect(()=>{const n=i=>{t&&a&&d.current&&!d.current.contains(i.target)&&o(!1)};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[a,t]),s.useEffect(()=>{if(!t)return;const n=i=>{i.key==="Escape"&&o(!1)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t]),s.useEffect(()=>{var n,i;if(t){c.current=!0,(n=h.current)==null||n.focus();const N=document.body.style.overflow;return window.matchMedia("(max-width: 767px)").matches&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=N}}c.current&&(c.current=!1,(i=p.current)==null||i.focus())},[t]);const R=()=>{if(typeof l=="string")switch(l){case"chevron":return t?e.jsx(v,{}):e.jsx(g,{});case"filter":return e.jsx(L,{});default:return e.jsx(g,{})}else return l};return e.jsxs(e.Fragment,{children:[e.jsxs(f.div,{id:x,ref:d,role:"dialog","aria-modal":t?"true":void 0,"aria-label":y,"aria-hidden":!t,inert:t?void 0:!0,initial:{x:"100%"},animate:{x:t?0:"100%"},transition:u?{duration:0}:{type:"spring",stiffness:300,damping:30},className:"fixed right-0 top-0 z-[9999] h-full w-[calc(100%-1rem)] overflow-y-auto bg-white shadow-lg sm:w-[min(28rem,calc(100%-2rem))] md:w-[var(--side-panel-width)]",style:{"--side-panel-width":`${b}%`},children:[e.jsx("button",{ref:h,type:"button",onClick:w,"aria-label":m,className:"absolute left-4 top-4 min-h-11 min-w-11 cursor-pointer rounded-full bg-gray-200 p-2 transition-colors hover:bg-gray-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 md:min-h-0 md:min-w-0",children:e.jsx(v,{})}),e.jsx("div",{className:"mt-16 p-4 sm:p-6",children:r})]}),e.jsxs(z,{children:[t&&a?e.jsx(f.button,{type:"button","aria-label":m,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:u?0:.15},onClick:()=>o(!1),className:"fixed inset-0 z-[9998] cursor-default bg-black/30 md:hidden"}):null,!t&&e.jsx(f.button,{ref:p,type:"button","aria-label":j,"aria-expanded":t,"aria-controls":x,initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:u?0:.2},onClick:w,className:"fixed right-0 top-1/2 z-[10000] min-h-11 min-w-11 -translate-y-1/2 cursor-pointer rounded-l-lg bg-indigo-600 p-3 text-white shadow-md transition-colors hover:bg-indigo-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2",children:R()})]})]})},A=()=>e.jsxs("div",{className:"min-h-[36rem] bg-gray-50 p-6",children:[e.jsx("p",{className:"text-sm text-gray-700",children:"Use el botón fijo para abrir los filtros."}),e.jsxs(I,{buttonIcon:"filter",ariaLabel:"Filtros de búsqueda",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Filtros de búsqueda"}),e.jsxs("label",{className:"mt-4 block text-sm font-medium text-gray-700",children:["Proveedor",e.jsx("input",{className:"mt-1 block w-full rounded-md border-gray-300",placeholder:"Nombre o código"})]})]})]});typeof window<"u"&&window.document&&window.document.createElement&&document.documentElement.setAttribute("data-storyloaded","");export{A as Filters};