UNPKG

uiinfinity-components

Version:

Beautiful UI components with smooth animations and 3D effects

3 lines (2 loc) 8.07 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),j=require("clsx"),N=require("tailwind-merge"),v=require("react-dom"),m=require("lucide-react"),p=require("sonner");function a(...r){return N.twMerge(j.clsx(r))}const f=n.forwardRef(({className:r,variant:t="primary",size:s="md",children:o,...l},i)=>{const c="inline-flex items-center justify-center font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",u={primary:"bg-primary text-primary-foreground hover:bg-primary/90 focus:ring-primary/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 focus:ring-secondary/50",outline:"border-2 border-border bg-transparent hover:bg-accent hover:text-accent-foreground focus:ring-accent/50",ghost:"bg-transparent hover:bg-accent hover:text-accent-foreground focus:ring-accent/50",danger:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive/50"},h={sm:"h-8 px-3 text-sm rounded-md",md:"h-10 px-4 text-sm rounded-md",lg:"h-12 px-6 text-base rounded-lg"};return e.jsx("button",{ref:i,className:a(c,u[t],h[s],r),...l,children:o})});f.displayName="Button";const g=n.forwardRef(({className:r,children:t,...s},o)=>e.jsx("div",{ref:o,className:a("rounded-xl border bg-card text-card-foreground shadow-sm",r),...s,children:t})),w=n.forwardRef(({className:r,children:t,...s},o)=>e.jsx("div",{ref:o,className:a("flex flex-col space-y-1.5 p-6",r),...s,children:t})),C=n.forwardRef(({className:r,children:t,...s},o)=>e.jsx("h3",{ref:o,className:a("font-semibold leading-none tracking-tight",r),...s,children:t})),k=n.forwardRef(({className:r,children:t,...s},o)=>e.jsx("p",{ref:o,className:a("text-sm text-muted-foreground",r),...s,children:t})),R=n.forwardRef(({className:r,children:t,...s},o)=>e.jsx("div",{ref:o,className:a("p-6 pt-0",r),...s,children:t})),F=n.forwardRef(({className:r,children:t,...s},o)=>e.jsx("div",{ref:o,className:a("flex items-center p-6 pt-0",r),...s,children:t}));g.displayName="Card";w.displayName="CardHeader";C.displayName="CardTitle";k.displayName="CardDescription";R.displayName="CardContent";F.displayName="CardFooter";const b=n.forwardRef(({className:r,label:t,error:s,helperText:o,id:l,...i},c)=>{const u=l||`input-${Math.random().toString(36).substr(2,9)}`;return e.jsxs("div",{className:"w-full space-y-2",children:[t&&e.jsx("label",{htmlFor:u,className:"text-sm font-medium text-foreground block",children:t}),e.jsx("input",{id:u,ref:c,className:a("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive focus:ring-destructive",r),...i}),s&&e.jsx("p",{className:"text-sm text-destructive",children:s}),o&&!s&&e.jsx("p",{className:"text-sm text-muted-foreground",children:o})]})});b.displayName="Input";const q=({isOpen:r,onClose:t,title:s,children:o,className:l,showCloseButton:i=!0})=>{const c=n.useRef(null);if(n.useEffect(()=>{const x=y=>{y.key==="Escape"&&t()};return r&&(document.addEventListener("keydown",x),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",x),document.body.style.overflow="unset"}},[r,t]),n.useEffect(()=>{r&&c.current&&c.current.focus()},[r]),!r)return null;const u=x=>{x.target===x.currentTarget&&t()},h=e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:u,children:[e.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm animate-fade-in"}),e.jsxs("div",{ref:c,tabIndex:-1,className:a("relative bg-background border rounded-lg shadow-xl w-full max-w-md max-h-[90vh] overflow-auto animate-scale-in",l),children:[(s||i)&&e.jsxs("div",{className:"flex items-center justify-between p-6 border-b",children:[s&&e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:s}),i&&e.jsx("button",{onClick:t,className:"p-1 hover:bg-accent rounded-md transition-colors","aria-label":"Close modal",children:e.jsx(m.X,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"p-6",children:o})]})]});return v.createPortal(h,document.body)};function I({code:r,className:t,variant:s="ghost",size:o="sm"}){const[l,i]=n.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(r),i(!0),p.toast.success("Code copied to clipboard!"),setTimeout(()=>i(!1),2e3)}catch{p.toast.error("Failed to copy code")}};return e.jsx(f,{variant:s,size:o,className:t,onClick:c,children:l?e.jsxs(e.Fragment,{children:[e.jsx(m.Check,{className:"w-4 h-4 mr-2"}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx(m.Copy,{className:"w-4 h-4 mr-2"}),"Copy Code"]})})}const T=()=>e.jsx("footer",{className:"py-16 border-t border-gray-800",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative h-8 w-8",children:[e.jsx("div",{className:"absolute inset-0 bg-neon-purple rounded-full opacity-70"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-white font-bold",children:"U"})]}),e.jsx("span",{className:"text-xl font-bold text-white",children:"UIinfinity"})]}),e.jsx("p",{className:"text-gray-400",children:"Beautiful UI components with smooth animations and 3D effects."}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("a",{href:"https://github.com/zakir19",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",children:e.jsx(m.Github,{className:"h-5 w-5"})}),e.jsx("a",{href:"https://twitter.com",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",children:e.jsx(m.Twitter,{className:"h-5 w-5"})}),e.jsx("a",{href:"https://www.linkedin.com/in/zakir-husain-patel/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",children:e.jsx(m.Linkedin,{className:"h-5 w-5"})})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-4",children:"Resources"}),e.jsxs("ul",{className:"space-y-2",children:[e.jsx(d,{href:"#",children:"Documentation"}),e.jsx(d,{href:"#",children:"Components"}),e.jsx(d,{href:"#",children:"Examples"}),e.jsx(d,{href:"#",children:"Playground"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-4",children:"Company"}),e.jsxs("ul",{className:"space-y-2",children:[e.jsx(d,{href:"#",children:"About Us"}),e.jsx(d,{href:"#",children:"Blog"}),e.jsx(d,{href:"#",children:"Careers"}),e.jsx(d,{href:"#",children:"Contact"})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-4",id:"contact",children:"Get in Touch"}),e.jsx("p",{className:"text-gray-400 mb-4",children:"Have questions? Reach out to us."}),e.jsxs("form",{action:"https://formspree.io/f/xkgryprw",method:"POST",className:"flex",children:[e.jsx("input",{type:"email",name:"email",placeholder:"Enter your email",required:!0,className:"bg-gray-800 border border-gray-700 text-white px-3 py-2 rounded-l-md focus:outline-none focus:ring-1 focus:ring-neon-purple"}),e.jsx("button",{type:"submit",className:"bg-neon-purple hover:bg-neon-purple/80 text-white px-4 py-2 rounded-r-md transition-colors",children:"Subscribe"})]})]})]}),e.jsxs("div",{className:"mt-12 pt-6 border-t border-gray-800 text-center text-gray-500 text-sm",children:["© ",new Date().getFullYear()," UIinfinity. All rights reserved. Made with ❤️ by Zakir."]})]})}),d=({href:r,children:t})=>e.jsx("li",{children:e.jsx("a",{href:r,className:"text-gray-400 hover:text-neon-purple transition-colors",children:t})});exports.CopyCodeButton=I;exports.CoreButton=f;exports.CoreCard=g;exports.CoreInput=b;exports.CoreModal=q;exports.Footer=T;exports.cn=a; //# sourceMappingURL=index.js.map