@ekoru/ui 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var e=require('react'),classVarianceAuthority=require('class-variance-authority'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),react=require('motion/react'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);function i(...o){return tailwindMerge.twMerge(clsx.clsx(o))}var m=classVarianceAuthority.cva("inline-flex items-center justify-center rounded-lg font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{primary:"border-2 border-primary bg-primary text-white hover:bg-primary/90 active:bg-primary/80 shadow-md",secondary:"border-2 border-secondary bg-secondary text-white hover:bg-secondary/90 active:bg-secondary/80",outline:"border-2 border-primary text-primary hover:bg-primary/5 hover:text-accent-foreground active:bg-primary/10",ghost:"hover:bg-muted active:bg-muted/80 text-foreground",success:"border-2 border-success bg-success text-white hover:bg-success/90 active:bg-success/80 shadow-md",warning:"border-2 border-warning bg-warning text-white hover:bg-warning/90 active:bg-warning/80 shadow-md",error:"border-2 border-error bg-error text-white hover:bg-error/90 active:bg-error/80 shadow-md"},size:{sm:"min-h-9 px-3 py-2 text-sm",md:"min-h-11 px-6 py-2.5 text-base",lg:"min-h-14 px-8 py-3 text-lg"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md"}}),l=e__namespace.forwardRef(({className:o,variant:p,size:d,fullWidth:u,isLoading:t,leftIcon:r,rightIcon:a,children:b,disabled:y,...f},g)=>{let x=react.motion.button;return jsxRuntime.jsxs(x,{className:i(m({variant:p,size:d,fullWidth:u,className:o})),ref:g,disabled:y||t,whileHover:{scale:1.02,y:-2},whileTap:{scale:.96,y:0},transition:{type:"spring",stiffness:400,damping:17},...f,children:[jsxRuntime.jsxs(react.AnimatePresence,{mode:"wait",children:[t&&jsxRuntime.jsxs(react.motion.svg,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"mr-2 h-4 w-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.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"})]},"spinner"),!t&&r&&jsxRuntime.jsx(react.motion.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"mr-2 inline-flex items-center justify-center flex-shrink-0",children:e__namespace.isValidElement(r)?r:e__namespace.createElement(r,{size:18,className:"flex-shrink-0"})},"leftIcon")]}),b,!t&&a&&jsxRuntime.jsx("span",{className:"ml-2 inline-flex items-center justify-center flex-shrink-0",children:e__namespace.isValidElement(a)?a:e__namespace.createElement(a,{size:18,className:"flex-shrink-0"})})]})});l.displayName="Button";
2
- exports.Button=l;exports.buttonVariants=m;exports.cn=i;//# sourceMappingURL=index.js.map
1
+ 'use strict';var M=require('react'),classVarianceAuthority=require('class-variance-authority'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),react=require('motion/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactDom=require('react-dom');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var M__namespace=/*#__PURE__*/_interopNamespace(M);function e(...r){return tailwindMerge.twMerge(clsx.clsx(r))}var Rt=classVarianceAuthority.cva("w-full border-t border-b overflow-hidden rounded-none",{variants:{variant:{primary:"bg-gradient-to-r from-primary-dark via-primary to-primary-dark text-white",secondary:"bg-gradient-to-r from-secondary-dark via-secondary to-secondary-dark text-white",outlined:"bg-background border border-primary text-foreground",ghost:"bg-white/50 text-foreground"},animated:{true:"",false:""}},defaultVariants:{variant:"primary",animated:true}}),Oe=M__namespace.forwardRef(({icon:r,title:o,description:i,cta:n,variant:t,animated:a,className:s,...l},g)=>{let u=react.motion.div,m=r;return jsxRuntime.jsx(u,{ref:g,initial:{opacity:0,y:-8},whileInView:{opacity:1,y:0},viewport:{once:true},transition:{duration:.45},className:e(Rt({variant:t,animated:a}),"p-4 md:p-5",s),...l,children:jsxRuntime.jsxs(react.motion.div,{className:e("flex flex-col sm:flex-row","items-center","gap-4 py-2 px-2","justify-between"),children:[jsxRuntime.jsxs(react.motion.div,{className:e("flex flex-col","items-center sm:items-start","justify-center"),children:[m&&jsxRuntime.jsx(react.motion.div,{className:e("w-20 h-20","flex items-center justify-center","rounded-lg","mb-2",{"bg-white/10":t==="primary"||t==="secondary","bg-primary/10":t==="outlined"||t==="ghost"}),children:jsxRuntime.jsx(m,{className:e("w-10 h-10",{"text-white":t==="primary"||t==="secondary","text-primary":t==="outlined"||t==="ghost"})})}),o&&jsxRuntime.jsx(react.motion.h3,{className:e("text-lg font-bold","text-center sm:text-left","mb-1"),children:o}),i&&jsxRuntime.jsx(react.motion.p,{className:e("text-sm text-center sm:text-left","text-muted","mb-0"),children:i})]}),jsxRuntime.jsx(react.motion.div,{className:e("flex items-center justify-center"),children:n})]})})});Oe.displayName="AdBanner";var St=Oe;var Ke=classVarianceAuthority.cva("p-4 md:p-5 rounded-xl w-[95%] mx-auto overflow-hidden relative",{variants:{variant:{primary:"border-2 border-transparent bg-gradient-to-r from-primary-dark via-primary to-primary-dark text-white shadow-lg",secondary:"border-2 border-transparent bg-gradient-to-r from-secondary-dark via-secondary to-secondary-dark text-white shadow-lg",outlined:"border-2 border-primary shadow-lg bg-background backdrop-blur",ghost:"border-2 border-transparent bg-white/50 backdrop-blur"},animated:{true:"",false:""}},defaultVariants:{variant:"primary",animated:true}}),He=classVarianceAuthority.cva("w-3 h-3 rounded-full inline-block",{variants:{variant:{primary:"bg-white shadow-lg shadow-white/50",secondary:"bg-white",outlined:"bg-primary",ghost:"bg-gray-600"}},defaultVariants:{variant:"primary"}}),Ge=M__namespace.forwardRef(({className:r,variant:o,animated:i,title:n,description:t,showDots:a=true,...s},l)=>{let g=react.motion.div;return jsxRuntime.jsxs(g,{ref:l,initial:{opacity:0,y:-20},whileInView:{opacity:1,y:0},viewport:{once:true},transition:{duration:.6},className:e(Ke({variant:o,animated:i,className:r})),...s,children:[i&&o==="primary"&&jsxRuntime.jsx(react.motion.div,{animate:{x:["-100%","100%"]},transition:{duration:15,repeat:1/0,ease:"linear"},className:e("absolute inset-0","bg-gradient-to-r from-transparent via-white/10 to-transparent")}),jsxRuntime.jsxs(react.motion.div,{className:"relative z-10",children:[jsxRuntime.jsxs(react.motion.div,{className:e("flex flex-1 justify-center items-center","gap-2 md:gap-3","mb-3"),children:[a&&jsxRuntime.jsx(react.motion.span,{initial:{scale:0},whileInView:{scale:1},viewport:{once:true},transition:{delay:.2,type:"spring"},className:e(He({variant:o}))}),jsxRuntime.jsx(react.motion.h2,{initial:{opacity:0},whileInView:{opacity:1},viewport:{once:true},transition:{delay:.3},className:e("text-base sm:text-lg md:text-2xl","font-bold","text-center","tracking-tight"),children:n}),a&&jsxRuntime.jsx(react.motion.span,{initial:{scale:0},whileInView:{scale:1},viewport:{once:true},transition:{delay:.4,type:"spring"},className:e(He({variant:o}))})]}),jsxRuntime.jsx(react.motion.p,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:true},transition:{delay:.5},className:e("text-sm sm:text-base md:text-lg","text-center","leading-snug md:leading-normal","font-light"),children:t})]})]})});Ge.displayName="Banner";var We=classVarianceAuthority.cva("btn disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{primary:"border-2 border-primary bg-primary text-white hover:bg-primary/90 active:bg-primary/80 shadow-md",secondary:"border-2 border-secondary bg-secondary text-white hover:bg-secondary/90 active:bg-secondary/80",secondary_outline:"border-2 border-secondary bg-white text-secondary hover:bg-white/90 active:bg-white/80",outline:"border-2 border-primary text-primary hover:bg-primary/5 hover:text-accent-foreground active:bg-primary/10",ghost:"hover:bg-muted active:bg-muted/80 text-foreground",success:"border-2 border-success bg-success text-white hover:bg-success/90 active:bg-success/80 shadow-md",warning:"border-2 border-warning bg-warning text-white hover:bg-warning/90 active:bg-warning/80 shadow-md",error:"border-2 border-error bg-error text-white hover:bg-error/90 active:bg-error/80 shadow-md"},size:{sm:"min-h-[36px] px-2 py-2 text-sm",md:"min-h-[44px] px-6 py-2.5 text-base",lg:"min-h-[56px] px-8 py-3 text-lg"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md"}}),re=M__namespace.forwardRef(({className:r,variant:o,size:i,fullWidth:n,isLoading:t,leftIcon:a,rightIcon:s,children:l,disabled:g,loadingText:u="Loading...",...m},p)=>{let y=react.motion.button;return jsxRuntime.jsxs(y,{className:e(We({variant:o,size:i,fullWidth:n,className:r})),ref:p,disabled:g||t,whileHover:{scale:1.02,y:-2},whileTap:{scale:.96,y:0},transition:{type:"spring",stiffness:400,damping:17},...m,children:[jsxRuntime.jsxs(react.AnimatePresence,{mode:"wait",children:[t&&jsxRuntime.jsx(react.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"flex items-center space-x-2",children:jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin mr-2"})},"loading"),!t&&a&&jsxRuntime.jsx(react.motion.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"mr-2 inline-flex items-center justify-center flex-shrink-0",children:M__namespace.isValidElement(a)?a:M__namespace.createElement(a,{size:18,className:"flex-shrink-0"})},"leftIcon")]}),t?u:l,!t&&s&&jsxRuntime.jsx("span",{className:"ml-2 inline-flex items-center justify-center flex-shrink-0",children:M__namespace.isValidElement(s)?s:M__namespace.createElement(s,{size:18,className:"flex-shrink-0"})})]})});re.displayName="Button";function je({image:r,title:o,description:i,cta:n,hasBadge:t,badgeText:a,badgeColor:s="bg-primary",textColor:l="text-white"}){return jsxRuntime.jsxs(react.motion.article,{className:e("w-64","bg-white","rounded-lg","overflow-hidden","shadow-md","relative"),children:[jsxRuntime.jsx(react.motion.div,{className:"h-40 w-full overflow-hidden",children:r||jsxRuntime.jsx(react.motion.div,{className:e("h-40 w-full","bg-gray-200","flex items-center justify-center"),children:jsxRuntime.jsx(react.motion.span,{className:"text-gray-500",children:jsxRuntime.jsx(lucideReact.Image,{})})})}),t&&a&&jsxRuntime.jsx(react.motion.div,{className:e("absolute top-2 left-2","text-xs","font-semibold","px-4 py-1","rounded-lg","shadow-md",s,l),children:a}),jsxRuntime.jsxs(react.motion.div,{className:"p-4",children:[jsxRuntime.jsx(react.motion.h3,{className:e("text-lg","font-semibold","text-gray-900","dark:text-stone-100"),children:o}),i&&jsxRuntime.jsx(react.motion.p,{className:e("text-sm","text-gray-600","dark:text-stone-400","mt-2"),children:i}),n&&jsxRuntime.jsx(react.motion.div,{className:"mt-2",children:n})]})]})}var At=classVarianceAuthority.cva("relative rounded-md border-2 flex items-center justify-center transition-all duration-200 cursor-pointer",{variants:{variant:{default:"border-input-border hover:border-primary/50",filled:"border-transparent bg-background-secondary",outline:"border-primary bg-transparent"},size:{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},checked:{true:"bg-primary border-primary",false:""},disabled:{true:"opacity-50 cursor-not-allowed",false:""}},defaultVariants:{variant:"default",size:"md",checked:false,disabled:false}}),Bt=M__namespace.forwardRef(({className:r,variant:o,size:i="md",label:n,description:t,errorMessage:a,checked:s=false,disabled:l=false,onCheckedChange:g,onChange:u,id:m,name:p,...y},P)=>{let b={sm:12,md:16,lg:20},c=I=>{let w=I.target.checked;g?.(w),u?.(I);},f=M__namespace.useId(),h=m||p||`checkbox-${f}`;return jsxRuntime.jsxs(react.motion.div,{className:"space-y-1",children:[jsxRuntime.jsxs(react.motion.div,{className:"flex items-start space-x-3",children:[jsxRuntime.jsxs(react.motion.div,{className:"relative",children:[jsxRuntime.jsx(react.motion.button,{type:"button",onClick:()=>!l&&g?.(!s),disabled:l,className:e(At({variant:o,size:i,checked:s,disabled:l,className:r})),whileTap:l?{}:{scale:.95},children:jsxRuntime.jsx(react.motion.div,{initial:{opacity:0,scale:.5},animate:{opacity:s?1:0,scale:s?1:.5},transition:{duration:.2},children:jsxRuntime.jsx(lucideReact.Check,{size:b[i||"md"],className:"text-white"})})}),jsxRuntime.jsx("input",{ref:P,id:h,name:p,type:"checkbox",checked:s,onChange:c,disabled:l,className:"sr-only",...y})]}),n&&jsxRuntime.jsxs(react.motion.div,{className:"flex-1",children:[jsxRuntime.jsx(react.motion.label,{htmlFor:h,className:e("text-sm font-medium cursor-pointer",l?"text-foreground-tertiary cursor-not-allowed":"text-foreground",a&&"text-error"),children:n}),t&&jsxRuntime.jsx(react.motion.p,{className:"text-sm text-foreground-tertiary mt-1",children:t})]})]}),a&&jsxRuntime.jsx(react.motion.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{duration:.2},className:"text-xs text-error ml-8",children:a})]})});Bt.displayName="Checkbox";var Kt=classVarianceAuthority.cva("relative w-full max-h-[90vh] rounded-lg shadow-2xl overflow-hidden z-10",{variants:{size:{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-7xl"}},defaultVariants:{size:"md"}});function fe({isOpen:r,onClose:o,children:i,title:n,size:t="md",showCloseButton:a=true,closeOnOverlayClick:s=true,closeOnEscape:l=true,className:g}){return M.useEffect(()=>{let u=m=>{m.key==="Escape"&&l&&o?.();};if(r){document.addEventListener("keydown",u);let m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",u),document.body.style.overflow=m||"unset";}}return ()=>{document.removeEventListener("keydown",u);}},[r,o,l]),r?reactDom.createPortal(jsxRuntime.jsx(react.AnimatePresence,{mode:"wait",initial:false,children:r&&jsxRuntime.jsxs(react.motion.div,{transition:{duration:.2},className:e("fixed inset-0 z-[9999]","flex items-center justify-center","p-4"),role:"dialog","aria-modal":"true","aria-labelledby":n?"modal-title":void 0,children:[jsxRuntime.jsx(react.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:e("absolute inset-0","bg-black/60","backdrop-blur-sm"),onClick:s?o:void 0,"aria-label":"Close modal"}),jsxRuntime.jsxs(react.motion.div,{initial:{scale:.9,opacity:0,y:30},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:30},transition:{type:"spring",damping:25,stiffness:300},onClick:u=>u.stopPropagation(),className:e(Kt({size:t}),"bg-surface border border-border",g),children:[(n||a)&&jsxRuntime.jsxs("div",{className:e("flex items-center justify-between","p-6","border-b border-border"),children:[n&&jsxRuntime.jsx("h3",{id:"modal-title",className:"font-semibold text-lg text-foreground",children:n}),a&&jsxRuntime.jsx("button",{onClick:o,className:e("p-1 rounded-lg text-foreground-secondary","hover:text-foreground hover:bg-background-secondary","transition-colors"),"aria-label":"Close modal",children:jsxRuntime.jsx(lucideReact.X,{className:"h-5 w-5"})})]}),jsxRuntime.jsx("div",{className:e("p-6","overflow-y-auto","max-h-[calc(90vh-8rem)]","scrollbar-hide","text-foreground"),children:i})]})]},"modal")}),document.body):null}function ge({isOpen:r,onClose:o,environmentalImpact:i,co2SavingsTitle:n="CO\u2082 Savings",waterSavingsTitle:t="Water Savings",weightLabel:a="Weight",co2SavingsLabel:s="CO\u2082 Saved",waterSavingsLabel:l="Water Saved",materialBreakdownLabel:g="Material Breakdown",carDistanceLabel:u=" by car",showerCountLabel:m=" showers",co2EquivalenceLabel:p="Equivalent to",waterEquivalenceLabel:y="Equivalent to",infoText:P="These values are estimates based on the savings generated by reusing products instead of manufacturing new ones. The calculations consider the average impact of producing each material."}){let b=c=>new Intl.NumberFormat("es-CL",{minimumFractionDigits:1,maximumFractionDigits:1}).format(c);return jsxRuntime.jsx(fe,{isOpen:r,onClose:o,title:"Impacto Ambiental Detallado",size:"md",children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:e("flex flex-col md:flex-row","gap-4 md:gap-6"),children:[jsxRuntime.jsxs("div",{className:e("bg-success/10 dark:bg-success/20","rounded-lg","p-4","flex-1"),children:[jsxRuntime.jsxs("div",{className:e("flex items-center","gap-2","mb-2"),children:[jsxRuntime.jsx(lucideReact.Leaf,{className:"w-5 h-5 text-success"}),jsxRuntime.jsx("span",{className:e("text-sm font-medium text-text-muted","dark:text-stone-400"),children:n})]}),jsxRuntime.jsxs("p",{className:e("text-2xl font-bold text-success"),children:[b(i.totalCo2SavingsKG)," kg"]}),jsxRuntime.jsxs("p",{className:e("text-xs text-text-muted","dark:text-stone-400","mt-1"),children:[p," ",b(i.totalCo2SavingsKG*4.5)," km",u]})]}),jsxRuntime.jsxs("div",{className:e("bg-info/10","dark:bg-info/20","rounded-lg","p-4","flex-1"),children:[jsxRuntime.jsxs("div",{className:e("flex","items-center","gap-2","mb-2"),children:[jsxRuntime.jsx(lucideReact.Droplets,{className:"w-5 h-5 text-info"}),jsxRuntime.jsx("span",{className:e("text-sm","font-medium","text-text-muted","dark:text-stone-400"),children:t})]}),jsxRuntime.jsxs("p",{className:e("text-2xl","font-bold","text-info"),children:[b(i.totalWaterSavingsLT)," L"]}),jsxRuntime.jsxs("p",{className:e("text-xs","text-text-muted","dark:text-stone-400","mt-1"),children:[y," ",b(i.totalWaterSavingsLT/8)," ",m]})]})]}),i.materialBreakdown.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:e("text-lg","font-bold","text-text-primary","dark:text-stone-100","mb-4","flex","items-center","gap-2"),children:[jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"}),g]}),jsxRuntime.jsx("div",{className:e("space-y-3"),children:i.materialBreakdown.map((c,f)=>jsxRuntime.jsxs("div",{className:e("border","border-neutral/20","dark:border-stone-700","rounded-lg","p-4","hover:bg-neutral/5","dark:hover:bg-stone-800/50","transition-colors"),children:[jsxRuntime.jsxs("div",{className:e("flex","items-center","justify-between","mb-3"),children:[jsxRuntime.jsx("h4",{className:e("font-semibold","text-text-primary","dark:text-stone-100"),children:c.materialType}),jsxRuntime.jsxs("span",{className:e("text-lg","font-bold","text-primary"),children:[c.percentage.toFixed(1),"%"]})]}),jsxRuntime.jsxs("div",{className:e("grid","grid-cols-3","gap-3","text-sm"),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:e("text-xs","text-text-muted","dark:text-stone-400","mb-1"),children:a}),jsxRuntime.jsxs("p",{className:e("font-semibold","text-text-secondary","dark:text-stone-300"),children:[b(c.weightKG)," kg"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:e("text-xs","text-text-muted","dark:text-stone-400","mb-1"),children:s}),jsxRuntime.jsxs("p",{className:e("font-semibold","text-success"),children:[b(c.co2SavingsKG)," kg"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:e("text-xs","text-text-muted","dark:text-stone-400","mb-1"),children:l}),jsxRuntime.jsxs("p",{className:e("font-semibold","text-info"),children:[b(c.waterSavingsLT)," L"]})]})]}),jsxRuntime.jsx("div",{className:e("mt-3","h-2","bg-neutral/10","dark:bg-stone-700","rounded-full","overflow-hidden"),children:jsxRuntime.jsx("div",{className:"h-full bg-primary rounded-full transition-all duration-500",style:{width:`${c.percentage}%`}})})]},f))})]}),jsxRuntime.jsx("div",{className:e("bg-primary/5","dark:bg-primary/10","rounded-lg","p-4","text-sm","text-text-secondary","dark:text-stone-300"),children:jsxRuntime.jsxs("p",{className:e("flex","items-start","gap-2"),children:[jsxRuntime.jsx(lucideReact.Info,{className:e("w-4","h-4","mt-0.5","text-primary","flex-shrink-0")}),jsxRuntime.jsx("span",{children:P})]})})]})})}function _e({brand:r,socialLinks:o,description:i,exploreItems:n,exploreLabel:t="Explore",communityItems:a,communityLabel:s="Community",legalItems:l,legalLabel:g="Legal",copyRightText:u="All rights reserved."}){return jsxRuntime.jsx(react.motion.footer,{className:e("bg-gradient-to-r from-primary-dark via-primary to-primary-dark"),children:jsxRuntime.jsxs(react.motion.div,{className:"max-w-7xl mx-auto px-6 py-12",children:[jsxRuntime.jsxs(react.motion.div,{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[jsxRuntime.jsxs(react.motion.div,{className:"space-y-4 flex flex-col",children:[r,jsxRuntime.jsx(react.motion.p,{className:"text-sm text-white leading-relaxed",children:i}),o&&jsxRuntime.jsx(react.motion.div,{className:e("flex items-center gap-3"),children:o})]}),n&&jsxRuntime.jsxs(react.motion.div,{children:[jsxRuntime.jsx(react.motion.h3,{className:"font-semibold text-white mb-4",children:t}),jsxRuntime.jsx(react.motion.ul,{className:"space-y-3",children:n&&n.map((m,p)=>jsxRuntime.jsx(react.motion.li,{children:m},p))})]}),a&&jsxRuntime.jsxs(react.motion.div,{children:[jsxRuntime.jsx(react.motion.h3,{className:"font-semibold text-white mb-4",children:s}),jsxRuntime.jsx(react.motion.ul,{className:"space-y-3",children:a&&a.map((m,p)=>jsxRuntime.jsx(react.motion.li,{children:m},p))})]}),l&&jsxRuntime.jsxs(react.motion.div,{children:[jsxRuntime.jsx(react.motion.h3,{className:"font-semibold text-white mb-4",children:g}),jsxRuntime.jsx(react.motion.ul,{className:"space-y-3",children:l&&l.map((m,p)=>jsxRuntime.jsx(react.motion.li,{children:m},p))})]})]}),jsxRuntime.jsx(react.motion.div,{className:"mt-12 pt-8 border-t border-gray-200 dark:border-stone-800",children:jsxRuntime.jsxs(react.motion.p,{className:"text-sm text-center text-white",children:["\xA9 ",new Date().getFullYear()," EKORU. ",u]})})]})})}function Je({navigationIcons:r,navigationLinks:o,brand:i,searchPlaceholder:n="Search...",onSearch:t,mobileMenuContent:a,className:s="",searchEnabled:l=true,sideMenuTitle:g="Menu",navbarAriaLabel:u="Main navigation",userActionsAriaLabel:m="User actions",toggleMobileMenuAriaLabel:p="Toggle mobile menu",closeMobileMenuAriaLabel:y="Close mobile menu",mobileMenuTitleAriaLabel:P="Mobile menu"}){let[b,c]=M.useState(false),[f,h]=M.useState(""),I=()=>c(false),w=N=>{h(N.target.value);},x=N=>{N.preventDefault(),t?.(f);},L=N=>{N.key==="Escape"&&b&&c(false);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("header",{className:`navbar-container ${s}`,onKeyDown:L,children:jsxRuntime.jsxs("nav",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",role:"navigation","aria-label":u,children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center h-16",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0",children:i||jsxRuntime.jsx("span",{className:"text-xl font-bold text-white",children:"EKORU"})}),l&&jsxRuntime.jsx("div",{className:"hidden md:flex flex-1 max-w-2xl mx-8",role:"search",children:jsxRuntime.jsxs("form",{onSubmit:x,className:"w-full flex items-center relative",children:[jsxRuntime.jsx("input",{id:"search-desktop",name:"search-desktop",type:"search",value:f,onChange:w,placeholder:n,className:e("w-full px-4 py-2","rounded-lg","border border-input-border","bg-input-bg","text-foreground","placeholder:text-foreground-tertiary","focus:outline-none","focus:ring-2","focus:ring-primary","focus:border-transparent")}),jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5 text-primary absolute right-4"})]})}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",role:"toolbar","aria-label":m,children:[r,jsxRuntime.jsx("div",{className:"hidden lg:flex items-center space-x-2",children:o}),jsxRuntime.jsx("button",{onClick:()=>c(!b),className:e("p-2","rounded-lg","text-white","hover:bg-primary/30","transition-colors","lg:hidden"),"aria-label":p,"aria-expanded":b,children:jsxRuntime.jsx(lucideReact.Menu,{className:"h-6 w-6"})})]})]}),l&&jsxRuntime.jsx("div",{className:"md:hidden pb-4",role:"search",children:jsxRuntime.jsxs("form",{onSubmit:x,className:"w-full flex items-center relative",children:[jsxRuntime.jsx("input",{id:"search-mobile",name:"search-mobile",type:"search",value:f,onChange:w,placeholder:n,className:e("w-full","px-4 py-2","rounded-lg","border border-input-border","bg-input-bg","text-foreground","placeholder:text-foreground-tertiary","focus:outline-none","focus:ring-2","focus:ring-primary","focus:border-transparent")}),jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5 text-primary absolute right-4"})]})})]})}),jsxRuntime.jsx(react.AnimatePresence,{children:b&&jsxRuntime.jsxs("div",{className:"lg:hidden fixed inset-0 z-50 flex justify-end",role:"dialog","aria-modal":"true","aria-labelledby":P,children:[jsxRuntime.jsx(react.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>c(false),"aria-label":y}),jsxRuntime.jsx(react.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.3},className:e("relative","w-full","max-w-sm","bg-background","shadow-xl","h-full","overflow-y-auto"),children:jsxRuntime.jsxs("div",{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-6",children:[jsxRuntime.jsx("h2",{id:"mobile-menu-title",className:"text-xl font-semibold text-foreground",children:g}),jsxRuntime.jsx("button",{onClick:I,className:e("p-2","rounded-lg","text-foreground","hover:bg-background-secondary","transition-colors"),"aria-label":"Close mobile menu",children:jsxRuntime.jsx(lucideReact.X,{className:"h-6 w-6"})})]}),jsxRuntime.jsx("nav",{className:"space-y-2",children:o}),a&&jsxRuntime.jsx("div",{className:"mt-6 pt-6 border-t border-surface-active",children:a})]})})]})})]})}var Ze=classVarianceAuthority.cva("w-full rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 placeholder:text-input-placeholder text-left",{variants:{variant:{default:"bg-input-bg border-2 border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:ring-primary/20",filled:"bg-background border-2 border-transparent hover:bg-background focus:bg-input-bg focus:border-input-border-focus focus:ring-primary/20",outline:"bg-transparent border-2 border-primary text-foreground hover:bg-primary/5 focus:bg-primary/5 focus:border-primary-active focus:ring-primary/20"},size:{sm:"h-9 text-sm",md:"h-11 text-base",lg:"h-14 text-lg"},hasError:{true:"border-error focus:border-error focus:ring-error/20"}},defaultVariants:{variant:"default",size:"md",hasError:false}}),be=M__namespace.forwardRef(({className:r,variant:o,size:i,label:n,leftIcon:t,errorMessage:a,value:s,onChange:l,options:g=[],width:u="full",disabled:m=false,readOnly:p=false,showColorIcon:y=false,renderOption:P,searchEnabled:b=true,dropdownDirection:c="down",placeholder:f="Select...",name:h,noResultsText:I="No results found"},w)=>{let[x,L]=M__namespace.useState(false),[N,T]=M__namespace.useState(false),[D,O]=M__namespace.useState(""),[C,B]=M__namespace.useState(-1),[ce,ft]=M__namespace.useState({top:0,left:0,width:0}),[gt,bt]=M__namespace.useState(false),Ne=M__namespace.useRef(null),ke=M__namespace.useRef(null),Pe=M__namespace.useRef(null),Ve=`${h}-listbox`,xt=g.find(d=>d.value===s),X=g.filter(d=>d.label.toLowerCase().includes(D.toLowerCase())),vt={sm:"w-1/3",md:"w-1/2",lg:"w-2/3",full:"w-full"}[u],Ce=!!a;M__namespace.useEffect(()=>{bt(true);},[]);let ee=M__namespace.useCallback(()=>{if(ke.current){let d=ke.current.getBoundingClientRect();ft({top:c==="down"?d.bottom+4:d.top-4,left:d.left,width:d.width});}},[c]);M__namespace.useEffect(()=>(N&&(ee(),window.addEventListener("scroll",ee,true),window.addEventListener("resize",ee)),()=>{window.removeEventListener("scroll",ee,true),window.removeEventListener("resize",ee);}),[N,ee]),M__namespace.useEffect(()=>{let d=K=>{Ne.current&&!Ne.current.contains(K.target)&&Pe.current&&!Pe.current.contains(K.target)&&(T(false),O(""));};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),M__namespace.useEffect(()=>{N&&B(0);},[N,D]);let yt=()=>{L(true);},ht=()=>{L(false);},Ae=d=>jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[y&&d?.iconColor&&jsxRuntime.jsx(lucideReact.Circle,{size:18,style:{color:d.iconColor,fill:d.iconColor},className:e("rounded-full",{"border border-gray-400":d.iconColor==="#FFFFFF"})}),d?.label||f]}),wt=d=>{if(!N){(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(T(true),d.preventDefault());return}d.key==="ArrowDown"?(B(K=>Math.min(K+1,X.length-1)),d.preventDefault()):d.key==="ArrowUp"?(B(K=>Math.max(K-1,0)),d.preventDefault()):d.key==="Enter"?(X[C]&&(l?.(X[C].value),T(false),O("")),d.preventDefault()):d.key==="Escape"&&(T(false),O(""),d.preventDefault());},Nt=jsxRuntime.jsx(react.AnimatePresence,{children:N&&jsxRuntime.jsxs(react.motion.div,{ref:Pe,initial:{opacity:0,y:c==="down"?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:c==="down"?-10:10},transition:{duration:.15,ease:"easeOut"},id:Ve,role:"listbox","aria-activedescendant":C>=0&&X[C]?`${h}-option-${X[C].value}`:void 0,tabIndex:-1,style:{position:"fixed",top:c==="down"?`${ce.top}px`:"auto",bottom:c==="up"?`${window.innerHeight-ce.top}px`:"auto",left:`${ce.left}px`,width:`${ce.width}px`,zIndex:9999},className:e("bg-surface-elevated","border-2 border-primary rounded-lg shadow-2xl overflow-hidden"),children:[b&&jsxRuntime.jsx("input",{type:"text",placeholder:"Search...",className:"w-full px-4 py-2 border-b border-input-border outline-none bg-surface-elevated text-foreground",value:D,onChange:d=>O(d.target.value),"aria-label":"Search options",onClick:d=>d.stopPropagation()}),jsxRuntime.jsx("ul",{className:"max-h-60 overflow-y-auto w-full bg-surface-elevated",children:X.length>0?X.map((d,K)=>jsxRuntime.jsx("li",{id:`${h}-option-${d.value}`,role:"option","aria-selected":d.value===s,tabIndex:0,onClick:()=>{l?.(d.value),T(false),O("");},onMouseEnter:()=>B(K),className:e("px-4 py-2 w-full cursor-pointer hover:bg-primary/10 flex items-center gap-2 transition-colors",d.value===s&&"bg-primary/10 font-semibold",C===K&&"bg-primary/20"),children:P?P(d,d.value===s):Ae(d)},d.value)):jsxRuntime.jsx("li",{className:"px-4 py-2 text-sm text-foreground-tertiary italic",children:I})})]},"dropdown")});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:e("space-y-2",vt),ref:Ne,children:[n&&jsxRuntime.jsx("label",{htmlFor:h,className:"block text-sm font-medium text-foreground",children:n}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs(react.motion.div,{initial:false,animate:{scale:x?1.002:1},transition:{type:"spring",stiffness:400,damping:17},className:"relative",children:[t&&jsxRuntime.jsx(t,{className:e("absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 transition-colors duration-200 pointer-events-none",x?"text-primary":"text-foreground-tertiary",Ce&&"text-error")}),jsxRuntime.jsxs("button",{type:"button",ref:d=>{ke.current=d,typeof w=="function"?w(d):w&&(w.current=d);},id:h,name:h,disabled:m||p,"aria-haspopup":"listbox","aria-expanded":N,"aria-controls":Ve,onClick:()=>!p&&T(!N),onFocus:yt,onBlur:ht,onKeyDown:wt,className:e(Ze({variant:o,size:i,hasError:Ce,className:r}),{"pl-3":!t,"pl-10":t,"pr-10":true}),children:[Ae(xt),jsxRuntime.jsx(lucideReact.ChevronDown,{size:18,className:e("absolute right-3 top-1/2 transform -translate-y-1/2 transition-all duration-200 pointer-events-none",N&&"rotate-180",x?"text-primary":"text-foreground-tertiary",Ce&&"text-error")})]})]}),a&&jsxRuntime.jsx(react.motion.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{duration:.2},className:"mt-1 text-xs text-error",children:a})]})]}),gt&&reactDom.createPortal(Nt,document.body)]})});be.displayName="Select";var et=classVarianceAuthority.cva("flex items-center justify-center min-w-[120px] rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-background-secondary text-foreground hover:bg-background border-2 border-transparent focus:border-primary focus:ring-primary/20",primary:"bg-primary text-white hover:bg-primary-hover focus:ring-primary/20",outline:"bg-transparent border-2 border-primary text-foreground hover:bg-primary/5 focus:ring-primary/20"},size:{sm:"h-8 px-2 text-sm gap-1",md:"h-10 px-2.5 text-base gap-2",lg:"h-12 px-3 text-lg gap-2"}},defaultVariants:{variant:"default",size:"md"}}),ar=M__namespace.forwardRef(({currentPage:r,totalPages:o,onPageChange:i,itemsPerPage:n=10,onItemsPerPageChange:t,previousLabel:a="Previous",nextLabel:s="Next",rowsLabel:l="Rows:",previousAriaLabel:g="Go to previous page",nextAriaLabel:u="Go to next page",showItemsPerPage:m=true,itemsPerPageOptions:p=[10,25,50,100],showPageInfo:y=true,pageInfoTemplate:P="Page {current} of {total}",showIcons:b=true,variant:c,size:f,className:h},I)=>{let w=p.map(T=>({label:T.toString(),value:T})),x=P.replace("{current}",r.toString()).replace("{total}",o.toString()),L=()=>{r>1&&i(r-1);},N=()=>{r<o&&i(r+1);};return jsxRuntime.jsxs("div",{ref:I,className:e("flex flex-col items-center justify-between gap-4 md:flex-row",h),children:[y&&jsxRuntime.jsx("span",{className:"text-sm font-medium text-foreground",children:x}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[m&&t&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-foreground",children:l}),jsxRuntime.jsx(be,{value:n,onChange:T=>t(T),options:w,size:f,variant:c==="primary"||c===null?"default":c,dropdownDirection:"up",searchEnabled:false,width:"lg"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("button",{onClick:L,disabled:r===1,className:e(et({variant:c,size:f})),"aria-label":g,children:[b&&jsxRuntime.jsx(lucideReact.ChevronLeft,{size:16}),a]}),jsxRuntime.jsxs("button",{onClick:N,disabled:r===o,className:e(et({variant:c,size:f})),"aria-label":u,children:[s,b&&jsxRuntime.jsx(lucideReact.ChevronRight,{size:16})]})]})]})]})});ar.displayName="Pagination";function xe({isFlipped:r,setIsFlipped:o,onCardClick:i,productImage:n,fallbackImage:t,productCondition:a,brand:s,name:l,description:g,price:u,color:m,isExchangeable:p,isStoreProduct:y,hasOffer:P,offerPrice:b,onAddToCart:c,onExchange:f,addToCartAriaLabel:h="Add to cart",exchangeAriaLabel:I="Exchange product",offerLabel:w="Price Drop",localeString:x="es-CL",addToCartLabel:L="Agregar al carrito",exchangeLabel:N="Intercambiar",interests:T=["exchange interest1","exchange interest2","exchange interest3"]}){let D={NEW:"bg-green-500 text-white",OPEN_BOX:"bg-blue-400 text-white",LIKE_NEW:"bg-emerald-400 text-white",FAIR:"bg-yellow-400 text-gray-900",POOR:"bg-red-500 text-white",FOR_PARTS:"bg-gray-500 text-white",REFURBISHED:"bg-purple-500 text-white"},O=C=>C&&D[C]||"bg-gray-300 text-gray-700";return jsxRuntime.jsxs("div",{className:e("card-flip-front","bg-white dark:bg-stone-800","rounded-xl shadow-md","border border-gray-200/60 dark:border-stone-700/60","overflow-hidden","hover:shadow-xl","hover:border-primary/40","dark:hover:border-primary/50","transition-all duration-300","group"),children:[jsxRuntime.jsxs("figure",{className:e("relative","aspect-[4/3]","bg-gradient-to-br from-gray-100 to-gray-50","dark:from-stone-700 dark:to-stone-800","overflow-hidden"),children:[jsxRuntime.jsx("div",{className:e("absolute inset-0","opacity-0","group-hover:opacity-100","bg-gradient-to-t from-black/20 to-transparent","transition-opacity","duration-300","pointer-events-none","z-[1]")}),jsxRuntime.jsx("div",{className:e("relative","w-full","h-full","group-hover:scale-105","transition-transform","duration-500"),children:n||t}),y?P?jsxRuntime.jsx("span",{className:e("absolute","bottom-2","left-2","bg-red-500","text-white","backdrop-blur-md","text-[10px]","font-semibold","px-2.5","py-1","rounded-lg","shadow-md","border","border-white/50","dark:border-stone-700/50"),children:w}):null:jsxRuntime.jsx("span",{className:e("absolute","bottom-2","left-2",O(a),"backdrop-blur-md","text-[10px]","font-semibold","px-2.5","py-1","rounded-lg","capitalize","shadow-md","border","border-white/50","dark:border-stone-700/50"),children:a}),jsxRuntime.jsx("button",{onClick:C=>{C.stopPropagation(),o(!r);},className:e("absolute","top-2","right-2","bg-white/90","dark:bg-stone-800/90","hover:bg-primary","dark:hover:bg-primary","text-gray-700","dark:text-stone-200","hover:text-white","p-1.5","rounded-lg","shadow-lg","transition-all","duration-200","hover:scale-110","backdrop-blur-sm","border","border-gray-200/50","dark:border-stone-600/50","z-[2]"),"aria-label":"Ver impacto ambiental",children:jsxRuntime.jsx(lucideReact.RotateCcw,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsxs("div",{className:"p-3.5",onClick:i,children:[jsxRuntime.jsxs("header",{className:e("flex","items-center","justify-between","gap-2","mb-2"),children:[jsxRuntime.jsx("span",{className:e("text-gray-500","dark:text-stone-400","text-[10px]","font-medium","uppercase","tracking-wide","truncate"),children:s}),m&&jsxRuntime.jsx("span",{className:e("text-gray-400","dark:text-stone-500","text-[10px]","font-medium","truncate","max-w-[60px]"),children:m})]}),jsxRuntime.jsx("h3",{className:e("font-semibold","text-sm","text-gray-900","dark:text-stone-50","line-clamp-1","mb-1.5","group-hover:text-primary","dark:group-hover:text-primary-hover","transition-colors","duration-200"),children:l}),jsxRuntime.jsx("p",{className:e("text-gray-600","dark:text-stone-400","text-xs","line-clamp-1","mb-3","leading-relaxed"),children:g}),jsxRuntime.jsxs("footer",{className:e("flex","flex-col","items-start","justify-between","gap-2"),children:[y&&P&&!p&&jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-1",children:[jsxRuntime.jsxs("span",{className:"text-primary dark:text-primary-hover font-bold text-xl",children:["$",b?.toLocaleString(x)]}),jsxRuntime.jsxs("span",{className:"text-sm text-gray-500 line-through",children:["$",u?.toLocaleString(x)]})]})," ",(!y||!P)&&!p&&jsxRuntime.jsxs("p",{className:"text-primary dark:text-primary-hover font-bold text-xl",children:["$",u?.toLocaleString(x)]}),p&&T&&jsxRuntime.jsx("div",{className:e("flex","items-center","gap-2","mb-2","overflow-x-auto","scroll-smooth","snap-x","snap-mandatory","px-3","flex-nowrap","w-full","scrollbar-hide"),style:{WebkitOverflowScrolling:"touch"},tabIndex:0,role:"list","aria-label":"Interests",children:T.map((C,B)=>jsxRuntime.jsx("span",{role:"listitem",className:e("inline-flex","items-center","flex-shrink-0","snap-start","text-[10px]","whitespace-nowrap","px-2","py-1","rounded-full","bg-gray-100","dark:bg-stone-700","text-gray-800","dark:text-stone-100","font-medium"),children:C},B))}),y&&!p&&jsxRuntime.jsx(re,{variant:"primary",size:"sm",fullWidth:true,"aria-label":h,rightIcon:lucideReact.ShoppingCart,onClick:C=>{C.stopPropagation(),c?.();},children:L}),p&&jsxRuntime.jsx(re,{variant:"primary",size:"sm",fullWidth:true,"aria-label":I,rightIcon:lucideReact.IterationCw,onClick:C=>{C.stopPropagation(),f?.();},children:N})," ",!p&&!y&&jsxRuntime.jsx(re,{variant:"primary",size:"sm",fullWidth:true,"aria-label":h,rightIcon:lucideReact.ShoppingCart,onClick:C=>{C.stopPropagation(),c?.();},children:L})]})]})]})}function ve({isFlipped:r,setIsFlipped:o,setShowImpactModal:i,environmentalImpact:n,sellerName:t,sellerPhone:a,sellerAddress:s,impactLabel:l="Environmental Impact",materialsLabel:g="Materials:",viewMoreLabel:u="View Full Impact",sellerLabel:m="Seller Information",co2Label:p="CO\u2082 Saved",waterLabel:y="Water Saved"}){let P=f=>f>50?{level:"High",color:"success",width:"100%"}:f>20?{level:"Medium",color:"warning",width:"66%"}:{level:"Low",color:"info",width:"33%"},b=(()=>{if(n){if(Array.isArray(n)){let f=n.map(w=>{let x=w,L=x.material?.materialType??x.materialType??"Material",N=x.material?.percentage??x.percentage??0,T=x.quantity??x.weightKG??0,D=x.material?.estimatedCo2SavingsKG??x.co2SavingsKG??0,O=x.material?.estimatedWaterSavingsLT??x.waterSavingsLT??0;return {materialType:L,percentage:N,weightKG:T,co2SavingsKG:D,waterSavingsLT:O}}),h=f.reduce((w,x)=>w+(x.co2SavingsKG||0),0),I=f.reduce((w,x)=>w+(x.waterSavingsLT||0),0);return {totalCo2SavingsKG:h,totalWaterSavingsLT:I,materialBreakdown:f}}return n}})(),c=b?P(b.totalCo2SavingsKG):null;return jsxRuntime.jsx("div",{className:e("card-flip-back","bg-gradient-to-br from-white via-emerald-50/20 to-white","dark:from-stone-800 dark:via-stone-850 dark:to-stone-900","border-2 border-gray-200/60","dark:border-stone-700/50"),children:jsxRuntime.jsxs("div",{className:e("py-4","px-4","w-full","h-full","flex","flex-col","overflow-y-auto","scrollbar-hide","relative"),children:[jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),o(!r);},className:e("absolute top-2 right-2","bg-white/90","dark:bg-stone-800/90","hover:bg-primary","dark:hover:bg-primary","backdrop-blur-md","text-gray-700","dark:text-stone-200","hover:text-white","p-1.5","rounded-lg","shadow-lg","transition-all","duration-200","hover:scale-110","z-10","border","border-gray-200/50","dark:border-stone-600/50"),"aria-label":"Ver producto",children:jsxRuntime.jsx(lucideReact.RotateCcw,{className:"w-3.5 h-3.5"})}),n&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between mb-0.5",children:jsxRuntime.jsxs("h4",{className:e("font-bold","text-gray-900","dark:text-stone-100","text-xs","flex","items-center","gap-1.5"),children:[jsxRuntime.jsx(lucideReact.Leaf,{className:"w-3.5 h-3.5 text-success"}),l]})}),jsxRuntime.jsx("div",{className:"mb-3",children:c&&jsxRuntime.jsx("span",{className:e("text-[9px]","font-semibold","px-2","py-0.5","rounded-full",`bg-${c.color}/15`,`text-${c.color}`,"border",`border-${c.color}/30`),children:c.level})}),jsxRuntime.jsx("div",{className:e("mb-2.5","bg-gray-200/60","dark:bg-stone-700/50","rounded-full","h-1","overflow-hidden"),children:jsxRuntime.jsx("div",{className:e("h-full","bg-gradient-to-r from-success to-success/70","rounded-full","transition-all","duration-1000"),style:{width:c?.width||"0%"}})}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-2.5",children:[jsxRuntime.jsxs("div",{className:e("bg-gradient-to-br from-success/8 to-transparent","dark:from-success/15 dark:to-transparent","rounded-lg","p-1.5","border","border-success/20","dark:border-success/30"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mb-0.5",children:[jsxRuntime.jsx(lucideReact.Leaf,{className:"w-3 h-3 text-success"}),jsxRuntime.jsx("span",{className:"text-[9px] text-gray-600 dark:text-stone-400 font-medium",children:p})]}),jsxRuntime.jsxs("p",{className:"text-sm font-bold text-success",children:[b?.totalCo2SavingsKG," kg"]})]}),jsxRuntime.jsxs("div",{className:e("bg-gradient-to-br from-info/8 to-transparent","dark:from-info/15 dark:to-transparent","rounded-lg","p-1.5","border","border-info/20","dark:border-info/30"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mb-0.5",children:[jsxRuntime.jsx(lucideReact.Droplets,{className:"w-3 h-3 text-info"}),jsxRuntime.jsx("span",{className:"text-[9px] text-gray-600 dark:text-stone-400 font-medium",children:y})]}),jsxRuntime.jsxs("p",{className:"text-sm font-bold text-info",children:[b?.totalWaterSavingsLT," L"]})]})]}),b&&b.materialBreakdown.length>0&&jsxRuntime.jsxs("div",{className:e("bg-gray-50/80","dark:bg-stone-800/50","rounded-lg","p-2.5","border","border-gray-200/50","dark:border-stone-700/50"),children:[jsxRuntime.jsx("p",{className:"text-[9px] font-semibold text-gray-700 dark:text-stone-300 mb-2",children:g}),jsxRuntime.jsx("div",{className:"space-y-2",children:b.materialBreakdown.slice(0,2).map((f,h)=>jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-[9px]",children:[jsxRuntime.jsx("span",{className:"text-gray-700 dark:text-stone-300 font-medium truncate",children:f.materialType}),jsxRuntime.jsxs("span",{className:"font-bold text-primary dark:text-primary ml-1",children:[f.percentage.toFixed(1),"%"]})]}),jsxRuntime.jsx("div",{className:"bg-gray-200 dark:bg-stone-700 rounded-full h-1 overflow-hidden",children:jsxRuntime.jsx("div",{className:e("h-full","bg-gradient-to-r from-primary to-primary-hover","rounded-full","transition-all","duration-500"),style:{width:`${f.percentage}%`}})})]},h))}),jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),i(true);},className:e("w-full","mt-2.5","py-1.5","px-3","bg-primary/5","hover:bg-primary/10","dark:bg-primary/10","dark:hover:bg-primary/15","text-primary","dark:text-primary-hover","rounded-lg","text-[9px]","font-semibold","transition-all","duration-200","flex","items-center","justify-center","gap-1","border","border-primary/20","hover:border-primary/30","group/viewmore"),children:[u,jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3 h-3 group-hover/viewmore:translate-x-0.5 transition-transform duration-200"})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-auto pt-3 border-t border-gray-200/60 dark:border-stone-700/50",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[jsxRuntime.jsx(lucideReact.UserRound,{className:"w-3.5 h-3.5 text-primary"}),jsxRuntime.jsx("h4",{className:"font-bold text-gray-900 dark:text-stone-100 text-xs",children:m})]}),jsxRuntime.jsxs("div",{className:e("space-y-1.5","bg-gray-50/80","dark:bg-stone-800/50","rounded-lg","p-2.5","border","border-gray-200/50","dark:border-stone-700/50"),children:[t&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-gray-700 dark:text-stone-300 text-[9px] font-medium",children:[jsxRuntime.jsx(lucideReact.UserRound,{className:"w-3 h-3 flex-shrink-0 text-gray-400 dark:text-stone-500"}),jsxRuntime.jsx("span",{className:"truncate",children:t})]}),a&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-gray-700 dark:text-stone-300 text-[9px] font-medium",children:[jsxRuntime.jsx(lucideReact.Phone,{className:"w-3 h-3 flex-shrink-0 text-gray-400 dark:text-stone-500"}),jsxRuntime.jsx("span",{className:"truncate",children:a})]}),s&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-gray-700 dark:text-stone-300 text-[9px] font-medium",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"w-3 h-3 flex-shrink-0 text-gray-400 dark:text-stone-500"}),jsxRuntime.jsx("span",{className:"truncate",children:s})]})]})]})]})})}function st({product:r}){let[o,i]=M.useState(false),[n,t]=M.useState(false),{images:a,price:s,name:l,brand:g,color:u,description:m,seller:p}=r,y="hasOffer"in r,P=!!r.hasOffer,b=r.offerPrice,c=r.environmentalImpact,f=r.productCategory?.materials;return jsxRuntime.jsxs("article",{className:e("flex-shrink-0","w-[220px]","h-[350px]","card-flip-perspective"),children:[jsxRuntime.jsxs("div",{className:e("card-flip-inner",o?"card-flip-flipped":""),children:[jsxRuntime.jsx(xe,{isFlipped:o,setIsFlipped:i,productImage:a&&a.length>0?jsxRuntime.jsx("img",{src:a[0],alt:l}):null,price:s,name:l,brand:g,productCondition:r.condition,color:u,description:m,isExchangeable:!y&&r.isExchangeable,isStoreProduct:y,hasOffer:P,offerPrice:b,fallbackImage:"https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?w=800&q=60&auto=format&fit=crop",onCardClick:()=>{},onAddToCart:()=>{},onExchange:()=>{}}),jsxRuntime.jsx(ve,{isFlipped:o,setIsFlipped:i,setShowImpactModal:t,environmentalImpact:c??f,sellerName:p?.profile?.firstName,sellerPhone:p?.phone,sellerAddress:p?.address})]}),c&&jsxRuntime.jsx(ge,{isOpen:n,onClose:()=>t(false),environmentalImpact:c})]})}function lt({icon:r,mainText:o,description:i}){return jsxRuntime.jsx("article",{className:"inline-flex p-4 shadow-md flex-col items-center justify-center min-w-40 rounded-lg bg-white dark:bg-stone-900",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg bg-primary/10 text-primary mb-4",children:jsxRuntime.jsx(r,{className:"w-5 h-5"})}),jsxRuntime.jsx("h3",{className:"text-2xl font-bold text-gray-900 dark:text-stone-100 mb-1",children:o}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-stone-400 text-center",children:i})]})})}var ur=classVarianceAuthority.cva("transition-colors",{variants:{variant:{p:"block",span:"inline",label:"block font-medium cursor-pointer",blockquote:"block border-l-4 border-primary pl-4 italic",small:"block text-sm",code:"inline-block font-mono bg-background-secondary px-1.5 py-0.5 rounded text-sm"},size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},color:{default:"text-foreground",primary:"text-primary",secondary:"text-foreground-secondary",tertiary:"text-foreground-tertiary",error:"text-error",success:"text-success",warning:"text-warning",muted:"text-muted"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"p",size:"base",weight:"normal",color:"default",align:"left"}}),fr=M__namespace.forwardRef(({className:r,variant:o="p",size:i,weight:n,color:t,align:a,as:s,htmlFor:l,children:g,...u},m)=>jsxRuntime.jsx(s||o,{ref:m,htmlFor:o==="label"||s==="label"?l:void 0,className:e(ur({variant:o,size:i,weight:n,color:t,align:a,className:r})),...u,children:g}));fr.displayName="Text";var xr=classVarianceAuthority.cva("w-full rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 placeholder:text-input-placeholder resize-none",{variants:{variant:{default:"bg-input-bg border-2 border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:ring-primary/20",filled:"bg-background-secondary border-2 border-transparent hover:bg-background focus:bg-input-bg focus:border-input-border-focus focus:ring-primary/20",outline:"bg-transparent border-2 border-primary text-foreground hover:bg-primary/5 focus:bg-primary/5 focus:border-primary-active focus:ring-primary/20"},textSize:{sm:"text-sm py-2 px-3 min-h-[80px]",md:"text-base py-3 px-3 min-h-[120px]",lg:"text-lg py-4 px-4 min-h-[160px]"},hasError:{true:"border-error focus:border-error focus:ring-error/20"}},defaultVariants:{variant:"default",textSize:"md",hasError:false}}),vr=M__namespace.forwardRef(({className:r,variant:o,textSize:i,label:n,errorMessage:t,showCharCount:a=false,width:s="full",disabled:l=false,readOnly:g=false,maxLength:u,value:m="",name:p,id:y,...P},b)=>{let[c,f]=M__namespace.useState(false),h=!!t,I=String(m).length,w={sm:"w-1/3",md:"w-1/2",lg:"w-2/3",full:"w-full"}[s],x=M__namespace.useId(),L=y||p||`textarea-${x}`;return jsxRuntime.jsxs("div",{className:e("space-y-2",w),children:[n&&jsxRuntime.jsx("label",{htmlFor:L,className:"block text-sm font-medium text-foreground",children:n}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(react.motion.div,{initial:false,animate:{scale:c?1.002:1},transition:{type:"spring",stiffness:400,damping:17},className:"relative",children:jsxRuntime.jsx("textarea",{ref:b,id:L,name:p,value:m,disabled:l,readOnly:g,maxLength:u,onFocus:()=>f(true),onBlur:()=>f(false),className:e(xr({variant:o,textSize:i,hasError:h,className:r})),...P})}),a&&u&&jsxRuntime.jsxs("div",{className:"mt-1 text-xs text-foreground-tertiary text-right",children:[I," / ",u]})]}),t&&jsxRuntime.jsx(react.motion.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{duration:.2},className:"text-xs text-error",children:t})]})});vr.displayName="Textarea";var mt=classVarianceAuthority.cva("w-full rounded-lg font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 placeholder:text-input-placeholder",{variants:{variant:{default:"bg-input-bg border-2 border-input-border hover:border-input-border-hover focus:border-input-border-focus focus:ring-primary/20",filled:"bg-background-secondary border-2 border-transparent hover:bg-background-tertiary focus:bg-input-bg focus:border-input-border-focus focus:ring-primary/20",outline:"bg-transparent border-2 border-primary text-foreground hover:bg-primary/5 focus:bg-primary/5 focus:border-primary-active focus:ring-primary/20"},size:{sm:"h-9 text-sm",md:"h-11 text-base",lg:"h-14 text-lg"},hasError:{true:"border-error focus:border-error focus:ring-error/20"}},defaultVariants:{variant:"default",size:"md",hasError:false}}),pt=M__namespace.forwardRef(({className:r,variant:o,size:i,hasError:n,label:t,leftIcon:a,errorMessage:s,type:l="text",width:g="full",id:u,name:m,disabled:p,onFocus:y,onBlur:P,...b},c)=>{let[f,h]=M__namespace.useState(false),[I,w]=M__namespace.useState(false),x={sm:"w-1/3",md:"w-1/2",lg:"w-2/3",full:"w-full"}[g],L=l==="password",N=L&&I?"text":l,T=n||!!s,D=B=>{h(true),y?.(B);},O=B=>{h(false),P?.(B);},C=()=>{w(B=>!B);};return jsxRuntime.jsxs("div",{className:e("space-y-2",x),children:[t&&jsxRuntime.jsx("label",{htmlFor:u||m,className:"block text-sm font-medium text-foreground",children:t}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs(react.motion.div,{initial:false,animate:{scale:f?1.002:1},transition:{type:"spring",stiffness:400,damping:17},className:"relative",children:[a&&jsxRuntime.jsx(a,{className:e("absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 transition-colors duration-200",f?"text-primary":"text-foreground-tertiary",T&&"text-error")}),jsxRuntime.jsx("input",{ref:c,id:u||m,name:m,type:N,disabled:p,onFocus:D,onBlur:O,className:e(mt({variant:o,size:i,hasError:T,className:r}),{"pl-3":!a,"pl-10":a,"pr-10":L,"pr-3":!L}),...b}),L&&jsxRuntime.jsx("button",{type:"button",onClick:C,disabled:p,className:e("absolute right-3 top-1/2","transform","-translate-y-1/2","text-foreground-tertiary","hover:text-foreground-secondary","transition-colors","duration-200","disabled:opacity-50","disabled:cursor-not-allowed"),tabIndex:-1,children:jsxRuntime.jsx(react.AnimatePresence,{mode:"wait",children:I?jsxRuntime.jsx(react.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-5 h-5"})},"eye-off"):jsxRuntime.jsx(react.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},children:jsxRuntime.jsx(lucideReact.Eye,{className:"w-5 h-5"})},"eye")})})]}),s&&jsxRuntime.jsx(react.motion.p,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{duration:.2},className:"mt-1 text-xs text-error",children:s})]})]})});pt.displayName="TextInput";var Pr=classVarianceAuthority.cva("font-bold tracking-tight transition-colors",{variants:{level:{h1:"text-5xl md:text-6xl lg:text-7xl",h2:"text-4xl md:text-5xl lg:text-6xl",h3:"text-3xl md:text-4xl lg:text-5xl",h4:"text-2xl md:text-3xl lg:text-4xl",h5:"text-xl md:text-2xl lg:text-3xl",h6:"text-lg md:text-xl lg:text-2xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold",extrabold:"font-extrabold"},color:{default:"text-foreground",primary:"text-primary",secondary:"text-foreground-secondary",tertiary:"text-foreground-tertiary",error:"text-error",success:"text-success",warning:"text-warning"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{level:"h1",weight:"bold",color:"default",align:"left"}}),Cr=M__namespace.forwardRef(({className:r,level:o="h1",weight:i,color:n,align:t,as:a,children:s,...l},g)=>jsxRuntime.jsx(a||o,{ref:g,className:e(Pr({level:o,weight:i,color:n,align:t,className:r})),...l,children:s}));Cr.displayName="Title";
2
+ exports.AdBanner=St;exports.Banner=Ge;exports.Button=re;exports.Card=je;exports.CardBackSide=ve;exports.CardFrontSide=xe;exports.Checkbox=Bt;exports.EnvironmentalImpactModal=ge;exports.Footer=_e;exports.Modal=fe;exports.Navbar=Je;exports.Pagination=ar;exports.ProductCard=st;exports.Select=be;exports.StatsCard=lt;exports.Text=fr;exports.TextInput=pt;exports.Textarea=vr;exports.Title=Cr;exports.bannerVariants=Ke;exports.buttonVariants=We;exports.checkboxVariants=At;exports.cn=e;exports.inputVariants=mt;exports.paginationButtonVariants=et;exports.selectVariants=Ze;exports.textVariants=ur;exports.textareaVariants=xr;exports.titleVariants=Pr;//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map