text
stringlengths
21
253k
id
stringlengths
25
123
metadata
dict
__index_level_0__
int64
0
181
body { background-color: red; }
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/next-pages/styles/other.css
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/next-pages/styles/other.css", "repo_id": "shadcn-ui/ui", "token_count": 13 }
111
import type { ActionFunctionArgs } from "@remix-run/node"; import { redirect } from "@remix-run/node"; import { logout } from "~/session.server"; export const action = async ({ request }: ActionFunctionArgs) => logout(request); export const loader = async () => redirect("/");
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/logout.tsx
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/logout.tsx", "repo_id": "shadcn-ui/ui", "token_count": 82 }
112
// Use this to delete a user by their email // Simply call this with: // npx ts-node -r tsconfig-paths/register ./cypress/support/delete-user.ts [email protected], // and that user will get deleted import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library"; import { installGlobals } from "@remix-run/node"; import { prisma } from "~/db.server"; installGlobals(); async function deleteUser(email: string) { if (!email) { throw new Error("email required for login"); } if (!email.endsWith("@example.com")) { throw new Error("All test emails must end in @example.com"); } try { await prisma.user.delete({ where: { email } }); } catch (error) { if ( error instanceof PrismaClientKnownRequestError && error.code === "P2025" ) { console.log("User not found, so no need to delete"); } else { throw error; } } finally { await prisma.$disconnect(); } } deleteUser(process.argv[2]);
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/delete-user.ts
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/delete-user.ts", "repo_id": "shadcn-ui/ui", "token_count": 340 }
113
import type { Config } from "tailwindcss"; export default { content: ["./app/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}"], theme: { extend: {}, }, plugins: [], } satisfies Config;
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix/tailwind.config.ts
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix/tailwind.config.ts", "repo_id": "shadcn-ui/ui", "token_count": 76 }
114
#!/bin/bash set -e # bail on errors GLOB=$1 IS_CI="${CI:-false}" BASE=$(pwd) COMMIT_MESSAGE=$(git log -1 --pretty=%B) for folder in $GLOB; do [ -d "$folder" ] || continue cd $BASE if [ -n "$(git status --porcelain)" ]; then git add . git commit -m "chore: update template" git push origin main fi NAME=${folder##*/} CLONE_DIR="__${NAME}__clone__" # sync to read-only clones # clone, delete files in the clone, and copy (new) files over # this handles file deletions, additions, and changes seamlessly # note: redirect output to dev/null to avoid any possibility of leaking token git clone --quiet --depth 1 [email protected]:shadcn/${NAME}.git $CLONE_DIR > /dev/null cd $CLONE_DIR find . | grep -v ".git" | grep -v "^\.*$" | xargs rm -rf # delete all files (to handle deletions in monorepo) cp -r $BASE/$folder/. . if [ -n "$(git status --porcelain)" ]; then git add . git commit -m "$COMMIT_MESSAGE" git push origin main fi cd $BASE rm -rf $CLONE_DIR done
shadcn-ui/ui/scripts/sync-templates.sh
{ "file_path": "shadcn-ui/ui/scripts/sync-templates.sh", "repo_id": "shadcn-ui/ui", "token_count": 382 }
115
interface AuthLayoutProps { children: React.ReactNode } export default function AuthLayout({ children }: AuthLayoutProps) { return <div className="min-h-screen">{children}</div> }
DarkInventor/easy-ui/app/(auth)/layout.tsx
{ "file_path": "DarkInventor/easy-ui/app/(auth)/layout.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 65 }
0
// import { format, parseISO } from 'date-fns' // import { allPosts } from 'contentlayer/generated' // import { getMDXComponent } from 'next-contentlayer/hooks' // export const generateStaticParams = async () => allPosts.map((post) => ({ slug: post._raw.flattenedPath })) // export const generateMetadata = ({ params }) => { // const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) // return { title: post.title } // } // const PostLayout = ({ params }: { params: { slug: string } }) => { // const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) // const Content = getMDXComponent(post.body.code) // return ( // <article className="py-8 mx-auto max-w-xl"> // <div className="mb-8 text-center"> // <time dateTime={post.date} className="mb-1 text-xs text-gray-600"> // {format(parseISO(post.date), 'LLLL d, yyyy')} // </time> // <h1>{post.title}</h1> // </div> // <Content /> // </article> // ) // } // export default PostLayout // import { format, parseISO } from 'date-fns' // import { allPosts } from 'contentlayer/generated' // import { getMDXComponent } from 'next-contentlayer/hooks' // import { notFound } from 'next/navigation' // import { estimateReadingTime } from '@/lib/blog-utils' // import PostBody from './PostBody' // import RelatedPosts from './RelatedPosts' // import ShareButtons from '@/components/ShareButtons' // import MDXImage from '@/components/MDXImage' // export const generateStaticParams = async () => // allPosts.map((post) => ({ slug: post._raw.flattenedPath })) // export const generateMetadata = ({ params }) => { // const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) // if (!post) return {} // return { // title: post.title, // description: post.description, // openGraph: { // title: post.title, // description: post.description, // type: 'article', // publishedTime: post.date, // url: `https://easyui.pro/posts/${params.slug}`, // images: [{ url: post.coverImage || '/eztmp1-img.png' }], // }, // twitter: { // card: 'summary_large_image', // title: post.title, // description: post.description, // images: [post.coverImage || '/eztmp1-img.png'], // }, // } // } // export default function PostPage({ params }: { params: { slug: string } }) { // console.log('Params:', params); // console.log('All posts:', allPosts); // const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) // console.log('Found post:', post); // if (!post) { // console.log('Post not found, returning 404'); // notFound() // } // const Content = getMDXComponent(post.body.code) // const components = { // img: MDXImage as any, // // You can add other custom components here // } // return ( // <article className="py-8 mx-auto max-w-xl"> // <div className="mb-8 text-center"> // <time dateTime={post.date} className="mb-1 text-xs text-gray-600"> // {format(parseISO(post.date), 'LLLL d, yyyy')} // </time> // <h1>{post.title}</h1> // <p>Estimated reading time: {estimateReadingTime(post.body.raw)} minutes</p> // </div> // <PostBody> // <Content components={components} /> // </PostBody> // <ShareButtons post={post} /> // <RelatedPosts currentPost={post} /> // </article> // ) // } // import { format, parseISO } from 'date-fns' // import { allPosts } from 'contentlayer/generated' // import { getMDXComponent } from 'next-contentlayer/hooks' // import { notFound } from 'next/navigation' // import { estimateReadingTime } from '@/lib/blog-utils' // import Image from 'next/image' // import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" // import { Badge } from "@/components/ui/badge" // import { Button } from "@/components/ui/button" // import { Card, CardContent } from "@/components/ui/card" // // import { Separator } from "@/components/ui/separator" // import { Clock, Calendar, Share2 } from 'lucide-react' // import ShareButtons from '@/components/ShareButtons' // import { Separator } from '@/components/ui/separator' // export const generateStaticParams = async () => // allPosts.map((post) => ({ slug: post._raw.flattenedPath })) // // @ts-ignore // export const generateMetadata = ({ params }) => { // const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) // if (!post) return {} // return { // title: post.title, // description: post.description, // openGraph: { // title: post.title, // description: post.description, // type: 'article', // publishedTime: post.date, // url: `https://easyui.pro/posts/${params.slug}`, // images: [{ url: post.coverImage || '/eztmp1-img.png' }], // }, // twitter: { // card: 'summary_large_image', // title: post.title, // description: post.description, // images: [post.coverImage || '/eztmp1-img.png'], // }, // } // } // export default function PostPage({ params }: { params: { slug: string } }) { // const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) // if (!post) { // notFound() // } // const Content = getMDXComponent(post.body.code) // const shareUrl = `https://easyui.pro/posts/${post._raw.flattenedPath}` // const components = { // // @ts-ignore // img: (props) => ( // <Image // {...props} // width={700} // height={350} // className="rounded-lg my-8" // alt={props.alt || "Blog post image"} // /> // ), // } // return ( // <div className="min-h-screen bg-gray-100 py-12 px-4 sm:px-6 lg:px-8 dark:bg-gray-950 "> // <article className="max-w-3xl mx-auto bg-white rounded-2xl overflow-hidden dark:text-white dark:bg-black "> // <div className="px-6 py-8 sm:px-8 sm:py-8 "> // <div className="flex flex-col space-y-4 sm:space-y-0 sm:flex-row sm:items-center sm:justify-between mb-8"> // <div className="flex items-center space-x-4"> // <Avatar className="w-12 h-12 sm:w-14 sm:h-14"> // <AvatarImage src="/avatar.png" alt="Author" /> // <AvatarFallback>AU</AvatarFallback> // </Avatar> // <div> // <p className="text-lg font-semibold">John Doe</p> // <p className="text-sm text-gray-500">Author</p> // </div> // </div> // <div className="flex flex-col sm:flex-row sm:items-center sm:space-x-4 text-sm text-gray-500"> // <div className="flex items-center mb-2 sm:mb-0"> // <Calendar className="w-4 h-4 mr-2" /> // <time dateTime={post.date}> // {format(parseISO(post.date), 'LLLL d, yyyy')} // </time> // </div> // <div className="flex items-center"> // <Clock className="w-4 h-4 mr-2" /> // <span>{estimateReadingTime(post.body.raw)} min read</span> // </div> // </div> // </div> // <h1 className="text-4xl font-bold mb-6 py-5">{post.title}</h1> // <div className="flex flex-wrap gap-2 mb-8"> // {post.tags && post.tags.map((tag) => ( // <Badge key={tag} variant="secondary">{tag}</Badge> // ))} // </div> // <Separator className="my-8" /> // <div className="prose prose-lg max-w-none"> // <Content components={components} /> // </div> // <Separator className="my-8" /> // <div className="flex justify-between items-center"> // <ShareButtons title={post.title} url={shareUrl} /> // <div className="flex space-x-4"> // {/* Add your social media share buttons here */} // </div> // </div> // </div> // </article> // <Card className="max-w-3xl mx-auto mt-12"> // <CardContent className="p-6"> // <h2 className="text-2xl font-bold mb-4">Related Posts</h2> // {/* Add your RelatedPosts component here */} // </CardContent> // </Card> // </div> // ) // } import Image from "next/image" import { notFound } from "next/navigation" import { allPosts } from "contentlayer/generated" import { format, parseISO } from "date-fns" import { Calendar, ChevronRight, Clock } from "lucide-react" import { getMDXComponent } from "next-contentlayer/hooks" import { estimateReadingTime } from "@/lib/blog-utils" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import ShareButtons from "@/components/ShareButtons" import { Mdx } from "@/components/mdx-components" import PostBody from "./PostBody" export const generateStaticParams = async () => allPosts.map((post) => ({ slug: post._raw.flattenedPath })) export const generateMetadata = ({ params }: { params: { slug: string } }) => { const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) if (!post) return {} return { title: post.title, description: post.description, openGraph: { title: post.title, description: post.description, type: "article", publishedTime: post.date, url: `https://easyui.pro/posts/${params.slug}`, images: [{ url: post.coverImage || "/eztmp1-img.png" }], }, twitter: { card: "summary_large_image", title: post.title, description: post.description, images: [post.coverImage || "/eztmp1-img.png"], }, } } const components = { img: (props: any) => ( <Image {...props} width={700} height={350} className="rounded-lg my-8" alt={props.alt || "Blog post image"} /> ), } function extractHeadings(content: string) { const headingRegex = /^(#{2,3})\s+(.+)$/gm const headings = [] let match while ((match = headingRegex.exec(content)) !== null) { headings.push({ level: match[1].length, text: match[2], id: match[2].toLowerCase().replace(/\s+/g, "-"), }) } return headings } const TableOfContents = ({ headings, }: { headings: { id: string; text: string; level: number }[] }) => ( <nav className="space-y-2"> {headings.map(({ id, text, level }) => ( <a key={id} href={`#${id}`} className={`block text-sm text-gray-600 hover:text-purple-600 transition-colors duration-200 dark:text-gray-400 dark:hover:text-purple-400 ${ level === 2 ? "font-semibold" : "pl-4" }`} > {text} </a> ))} </nav> ) // @ts-ignore const findNextPost = (currentSlug) => { const currentIndex = allPosts.findIndex( (post) => post._raw.flattenedPath === currentSlug ) return allPosts[currentIndex + 1] || null } export default function PostPage({ params }: { params: { slug: string } }) { const post = allPosts.find((post) => post._raw.flattenedPath === params.slug) if (!post) { notFound() } const Content = getMDXComponent(post.body.code) const shareUrl = `https://easyui.pro/posts/${post._raw.flattenedPath}` const headings = extractHeadings(post.body.raw) const nextPost = findNextPost(params.slug) return ( <div className="min-h-screen bg-white dark:bg-gray-950 w-full"> <div className="w-full px-4 sm:px-6 lg:px-8 py-12"> <div className="flex flex-col md:flex-row"> <main className="w-full md:flex-1"> <article className="bg-white dark:bg-black rounded-2xl overflow-hidden "> <div className="px-6 py-0 sm:px-8 sm:py-0"> <h1 className="text-5xl font-bold mb-6 py-0 dark:text-white tracking-tight lg:text-6xl md:text-4xl" style={{ letterSpacing: "-0.05em" }} > {post.title} </h1> <div className="flex flex-wrap gap-2 mb-8"> {post.tags && post.tags.map((tag) => ( <Badge key={tag} variant="secondary" className="dark:bg-gray-200 text-black" > {tag} </Badge> ))} </div> <Separator className="my-8" /> <PostBody> <Content components={components} /> </PostBody> <Separator className="my-8" /> <div className="flex justify-between items-center"> <ShareButtons title={post.title} url={shareUrl} /> <div className="flex space-x-4"> {/* Add your social media share buttons here */} </div> </div> {nextPost && ( // <div className="mt-12 bg-white dark:bg-black"> // <h2 className="text-xl font-bold text-gray-800 dark:text-white mb-4 bg-white dark:bg-black">Next Article</h2> // <a href={`/posts/${nextPost._raw.flattenedPath}`} className="group"> // <div className="flex items-center justify-between p-4 bg-white dark:bg-black border rounded-lg transition-shadow duration-300"> // <span className="font-semibold group-hover:text-gray-600 dark:group-hover:text-purple-400">{nextPost.title}</span> // <ChevronRight className="transition-transform duration-200 group-hover:translate-x-1" /> // </div> // </a> // </div> <a className="mt-12 bg-white dark:bg-black" href={`/posts/${nextPost._raw.flattenedPath}`} > <h2 className="text-xl font-bold text-gray-800 dark:text-white mb-4 bg-white dark:bg-black py-2 mt-5"> Next Article </h2> <div className="relative cursor-pointer group p-4 bg-white dark:bg-black border-none rounded-lg transition-shadow duration-300"> <div className="absolute inset-0 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-gradient-to-r from-pink-500 via-purple-500 to-pink-500 animate-gradient-x" /> <div className="absolute inset-[2px] rounded-lg bg-white dark:bg-black z-10 border" /> <div className="relative z-20 flex items-center justify-between h-full px-4 rounded-lg transition-all duration-300 "> <span className="font-semibold text-gray-800 dark:text-gray-200 transition-colors duration-300"> {nextPost.title} </span> <ChevronRight className="text-gray-600 dark:text-gray-400 transition-all duration-300 group-hover:translate-x-1 group-hover:text-purple-600 dark:group-hover:text-purple-400" /> </div> </div> {/* </div> */} </a> )} </div> </article> </main> <aside className="w-full md:w-1/4 mt-8 md:mt-0 md:pl-8"> <div className="space-y-8 sticky top-8"> <Card className="bg-gradient-to-br from-purple-600 to-indigo-600 text-white shadow-lg overflow-hidden"> <CardContent className="p-6 flex flex-col items-center text-center"> <h3 className="text-xl font-bold mb-4 tracking-tight"> Want to save time? Get beautifully designed website templates with Easy UI Premium. </h3> <p className="text-md mb-6 opacity-90 font-normal tracking-tight"> 30+ beautiful sections and templates built with React, Typescript, Tailwind CSS, and Framer Motion. </p> <a href="https://premium.easyui.pro/pricing-section" target="_blank" rel="noopener noreferrer" className="inline-block group" > <Button className="bg-white text-purple-600 hover:bg-purple-100 transition-colors duration-200 font-bold py-2 px-6 rounded-full shadow-md hover:shadow-lg tracking-tight"> Get Started{" "} <ChevronRight className="inline ml-2 transition-transform duration-200 group-hover:translate-x-1" /> </Button> </a> </CardContent> </Card> </div> </aside> </div> </div> </div> ) }
DarkInventor/easy-ui/app/posts/[slug]/page.tsx
{ "file_path": "DarkInventor/easy-ui/app/posts/[slug]/page.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 8004 }
1
"use client"; import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Search, ChevronLeft, X } from 'lucide-react'; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; interface Application { id: number; name: string; icon: string; category: string; } interface LaunchPadProps { applications: Application[]; } const LaunchPad: React.FC<LaunchPadProps> = ({ applications }) => { const [isLaunchpadOpen, setIsLaunchpadOpen] = useState(false); const [searchTerm, setSearchTerm] = useState(''); const [filteredApps, setFilteredApps] = useState<Application[]>([]); const [selectedCategory, setSelectedCategory] = useState('All'); const [selectedApp, setSelectedApp] = useState<Application | null>(null); // Categories derived from applications props for dynamic categories handling const categories = Array.from(new Set(applications.map(app => app.category).concat('All'))); useEffect(() => { const filtered = applications.filter(app => app.name.toLowerCase().includes(searchTerm.toLowerCase()) && (selectedCategory === 'All' || app.category === selectedCategory) ) setFilteredApps(filtered) }, [searchTerm, selectedCategory, applications]) const toggleLaunchpad = () => setIsLaunchpadOpen(!isLaunchpadOpen) // @ts-ignore const handleAppClick = (app) => { setSelectedApp(app) } const handleBackClick = () => { setSelectedApp(null) setSearchTerm('') setSelectedCategory('All') } return ( <div className="h-[screen] overflow-hidden absolute bg-white dark:bg-black"> <Button onClick={toggleLaunchpad} className="fixed bottom-20 left-1/2 transform -translate-x-1/2 rounded-xl bg-white dark:bg-black text-black dark:text-white hover:bg-gray-200 md:bottom-20 md:left-1/2 md:transform md:-translate-x-1/2" size="icon" > <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" className="lucide lucide-panel-top-close"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="m9 16 3-3 3 3"/></svg> </Button> <AnimatePresence> {isLaunchpadOpen && ( <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} className="fixed inset-0 bg-transparent flex flex-col items-center pt-20 top-10 backdrop-blur sm:pt-20 sm:top-10" onClick={toggleLaunchpad} > <motion.div initial={{ opacity: 0, y: -20 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 0.1 }} className="w-full max-w-xl px-4 sm:max-w-2xl sm:px-4" onClick={(e) => e.stopPropagation()} > <div className="relative mb-6 flex items-center"> <Button onClick={handleBackClick} variant="ghost" size="icon" className="mr-2" > <ChevronLeft className="h-6 w-6 text-gray-400 dark:text-gray/20" /> </Button> <Input type="text" placeholder="Search applications..." value={searchTerm} onChange={(e) => setSearchTerm(e.target.value)} className="w-full bg-gray-100 dark:bg-gray-800 backdrop-blur-lg border-none text-black dark:text-white" /> <Search className="absolute right-3 top-1/2 transform -translate-y-1/2 text-muted-foreground" /> </div> {!selectedApp && ( <Tabs defaultValue="All" className="w-full mb-6 bg-transparent dark:bg-background/50 border-none dark:text-white text-black border-none rounded-lg"> <TabsList className="flex justify-start overflow-x-auto border-none gap-2 rounded-full bg-transparent"> {categories.map((category) => ( <TabsTrigger key={category} value={category} onClick={() => setSelectedCategory(category)} className={`leading-7 tracking-tight w-auto border-none text-sm ${category === selectedCategory ? 'dark:bg-gray-700' : ''}`} > {category} </TabsTrigger> ))} </TabsList> </Tabs> )} </motion.div> <ScrollArea className="w-full max-w-2xl h-[calc(100vh-200px)]"> <motion.div className="grid grid-cols-4 sm:grid-cols-6 md:grid-cols-8 gap-6 p-4" initial={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} transition={{ delay: 0.2 }} onClick={(e) => e.stopPropagation()} > <AnimatePresence> {selectedApp ? ( <motion.div key="app-details" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} className="col-span-full flex flex-col items-center text-black dark:text-white" > <div className="w-22 h-22 flex items-center justify-center rounded-3xl text-black dark:text-white mb-4"> <img src={selectedApp.icon} alt={selectedApp.name} className="w-24 h-24 " /> </div> <h2 className="text-2xl font-bold mb-2 leading-7 tracking-tigh text-black dark:text-white">{selectedApp.name}</h2> <p className="text-lg mb-4 leading-7 tracking-tight text-black dark:text-white">{selectedApp.category}</p> <Button className="bg-[#0B8CE9] text-white text-sm font-semibold" onClick={() => alert(`Launching ${selectedApp.name}`)}> Open {selectedApp.name} </Button> </motion.div> ) : ( filteredApps.map((app) => ( <motion.div key={app.id} layout initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} exit={{ opacity: 0, scale: 0.8 }} transition={{ duration: 0.2 }} className="flex flex-col items-center" onClick={() => handleAppClick(app)} > <motion.div className="w-20 h-20 flex items-center justify-center border-none rounded-lg cursor-pointer text-black dark:text-white" whileHover={{ scale: 1.1 }} whileTap={{ scale: 0.95 }} > <img src={app.icon} alt={app.name} className="w-30 h-30 border-none rounded-lg text-black dark:text-white" /> </motion.div> <motion.p className="mt-2 text-xs text-center tracking-tight text-gray-700 dark:text-white font-semibold"> {app.name} </motion.p> </motion.div> )) )} </AnimatePresence> </motion.div> </ScrollArea> <Button onClick={toggleLaunchpad} variant="ghost" size="icon" className="relative bottom-20 text-black bg-gray-200 sm:relative sm:bottom-20" > <X className="h-6 w-6" /> </Button> </motion.div> )} </AnimatePresence> </div> ); }; export default LaunchPad;
DarkInventor/easy-ui/components/easyui/launchpad.tsx
{ "file_path": "DarkInventor/easy-ui/components/easyui/launchpad.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 4232 }
2
"use client"; import { cn } from "@/lib/utils"; import { motion } from "framer-motion"; import { CSSProperties, ReactElement, useEffect, useState } from "react"; interface Sparkle { id: string; x: string; y: string; color: string; delay: number; scale: number; lifespan: number; } interface SparklesTextProps { /** * @default <div /> * @type ReactElement * @description * The component to be rendered as the text * */ as?: ReactElement; /** * @default "" * @type string * @description * The className of the text */ className?: string; /** * @required * @type string * @description * The text to be displayed * */ text: string; /** * @default 10 * @type number * @description * The count of sparkles * */ sparklesCount?: number; /** * @default "{first: '#A07CFE', second: '#FE8FB5'}" * @type string * @description * The colors of the sparkles * */ colors?: { first: string; second: string; }; } const SparklesText: React.FC<SparklesTextProps> = ({ text, colors = { first: "#A07CFE", second: "#FE8FB5" }, className, sparklesCount = 10, ...props }) => { const [sparkles, setSparkles] = useState<Sparkle[]>([]); useEffect(() => { const generateStar = (): Sparkle => { const starX = `${Math.random() * 100}%`; const starY = `${Math.random() * 100}%`; const color = Math.random() > 0.5 ? colors.first : colors.second; const delay = Math.random() * 2; const scale = Math.random() * 1 + 0.3; const lifespan = Math.random() * 10 + 5; const id = `${starX}-${starY}-${Date.now()}`; return { id, x: starX, y: starY, color, delay, scale, lifespan }; }; const initializeStars = () => { const newSparkles = Array.from({ length: sparklesCount }, generateStar); setSparkles(newSparkles); }; const updateStars = () => { setSparkles((currentSparkles) => currentSparkles.map((star) => { if (star.lifespan <= 0) { return generateStar(); } else { return { ...star, lifespan: star.lifespan - 0.1 }; } }), ); }; initializeStars(); const interval = setInterval(updateStars, 100); return () => clearInterval(interval); }, [colors.first, colors.second]); return ( <div className={cn("text-md font-bold sm:text-lg lg:text-6xl", className)} {...props} style={ { "--sparkles-first-color": `${colors.first}`, "--sparkles-second-color": `${colors.second}`, } as CSSProperties } > <span className="relative inline-block"> {sparkles.map((sparkle) => ( <Sparkle key={sparkle.id} {...sparkle} /> ))} <strong className="bg-gradient-to-r from-[var(--sparkles-first-color)] to-[var(--sparkles-second-color)] bg-clip-text text-transparent"> {text} </strong> </span> </div> ); }; const Sparkle: React.FC<Sparkle> = ({ id, x, y, color, delay, scale }) => { return ( <motion.svg key={id} className="pointer-events-none absolute z-20" initial={{ opacity: 0, left: x, top: y }} animate={{ opacity: [0, 1, 0], scale: [0, scale, 0], rotate: [75, 120, 150], }} transition={{ duration: 0.8, repeat: Infinity, delay }} width="21" height="21" viewBox="0 0 21 21" > <path d="M9.82531 0.843845C10.0553 0.215178 10.9446 0.215178 11.1746 0.843845L11.8618 2.72026C12.4006 4.19229 12.3916 6.39157 13.5 7.5C14.6084 8.60843 16.8077 8.59935 18.2797 9.13822L20.1561 9.82534C20.7858 10.0553 20.7858 10.9447 20.1561 11.1747L18.2797 11.8618C16.8077 12.4007 14.6084 12.3916 13.5 13.5C12.3916 14.6084 12.4006 16.8077 11.8618 18.2798L11.1746 20.1562C10.9446 20.7858 10.0553 20.7858 9.82531 20.1562L9.13819 18.2798C8.59932 16.8077 8.60843 14.6084 7.5 13.5C6.39157 12.3916 4.19225 12.4007 2.72023 11.8618L0.843814 11.1747C0.215148 10.9447 0.215148 10.0553 0.843814 9.82534L2.72023 9.13822C4.19225 8.59935 6.39157 8.60843 7.5 7.5C8.60843 6.39157 8.59932 4.19229 9.13819 2.72026L9.82531 0.843845Z" fill={color} /> </motion.svg> ); }; export default SparklesText;
DarkInventor/easy-ui/components/magicui/sparkles-text.tsx
{ "file_path": "DarkInventor/easy-ui/components/magicui/sparkles-text.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 1928 }
3
import { JetBrains_Mono as FontMono, Inter as FontSans } from "next/font/google" export const fontSans = FontSans({ subsets: ["latin"], variable: "--font-sans", }) export const fontMono = FontMono({ subsets: ["latin"], variable: "--font-mono", })
DarkInventor/easy-ui/lib/fonts.ts
{ "file_path": "DarkInventor/easy-ui/lib/fonts.ts", "repo_id": "DarkInventor/easy-ui", "token_count": 96 }
4
# Since the ".env" file is gitignored, you can use the ".env.example" file to # build a new ".env" file when you clone the repo. Keep this file up-to-date # when you add new variables to `.env`. # This file will be committed to version control, so make sure not to have any # secrets in it. If you are cloning this repo, create a copy of this file named # ".env" and populate it with your secrets. # When adding additional environment variables, the schema in "/src/env.js" # should be updated accordingly. # Example: # SERVERVAR="foo" # NEXT_PUBLIC_CLIENTVAR="bar"
alifarooq9/rapidlaunch/apps/www/.env.example
{ "file_path": "alifarooq9/rapidlaunch/apps/www/.env.example", "repo_id": "alifarooq9/rapidlaunch", "token_count": 164 }
5
"use client"; import { Icons } from "@/components/icons"; import { Button } from "@/components/ui/button"; import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; import { navConfig } from "@/config/nav"; import { siteUrls } from "@/config/urls"; import { cn } from "@/lib/utils"; import type { LinkProps } from "next/link"; import Link from "next/link"; import { useRouter } from "next/navigation"; import React from "react"; export function MobileNav() { const [isOpen, setIsOpen] = React.useState<boolean>(false); return ( <Sheet open={isOpen} onOpenChange={(o: boolean) => setIsOpen(o)}> <SheetTrigger asChild> <Button variant="outline" size="iconSm" className="flex sm:hidden" > <Icons.hamburger className="h-4 w-4" /> <span className="sr-only">menu</span> </Button> </SheetTrigger> <SheetContent side="left" className="pr-0"> <div className="mb-8"> <Link href={siteUrls.marketing.base} className="left-4 z-10" > <Icons.logo iconProps={{ className: "w-6 h-6 sm:w-5 sm:h-5 fill-foreground", }} /> </Link> </div> <div className="flex flex-col space-y-2"> {navConfig.items.map((item) => ( <MobileLink key={item.label} href={item.href} onOpenChange={setIsOpen} disabled={item.disabled} className={cn( "text-base text-muted-foreground hover:text-foreground/80", { "text-foreground": false, }, )} > {item.label} </MobileLink> ))} </div> </SheetContent> </Sheet> ); } interface MobileLinkProps extends LinkProps { onOpenChange?: (open: boolean) => void; children: React.ReactNode; className?: string; disabled?: boolean; } function MobileLink({ href, onOpenChange, className, children, disabled, ...props }: MobileLinkProps) { const router = useRouter(); return ( <Link href={href} onClick={() => { void router.push(String(href)); onOpenChange?.(false); }} className={cn( disabled && "pointer-events-none opacity-60", className, )} {...props} > {children} </Link> ); }
alifarooq9/rapidlaunch/apps/www/src/app/(app)/_components/mobile-nav.tsx
{ "file_path": "alifarooq9/rapidlaunch/apps/www/src/app/(app)/_components/mobile-nav.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1855 }
6
"use client"; import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { cva } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; const labelVariants = cva( "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", ); const Label = React.forwardRef< React.ElementRef<typeof LabelPrimitive.Root>, React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants> >(({ className, ...props }, ref) => ( <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} /> )); Label.displayName = LabelPrimitive.Root.displayName; export { Label };
alifarooq9/rapidlaunch/apps/www/src/components/ui/label.tsx
{ "file_path": "alifarooq9/rapidlaunch/apps/www/src/components/ui/label.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 289 }
7
export const userFeedbackPageConfig = { title: "Feedbacks", description: "Manage your feedbacks and suggestions, create new ones, and more.", } as const;
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/feedback/_constants/page-config.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/feedback/_constants/page-config.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 55 }
8
export const orgMembersPageConfig = { title: "Organization Members", description: "Manage your organization members here, such as adding, removing, and more!", } as const;
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/members/_constants/page-config.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/members/_constants/page-config.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 48 }
9
"use client"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import type { User } from "next-auth"; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; import { generateReactHelpers, useDropzone } from "@uploadthing/react"; import { cn } from "@/lib/utils"; import { useCallback, useState } from "react"; import { Trash2Icon } from "lucide-react"; import type { OurFileRouter } from "@/server/uploadthing/core"; import { generateClientDropzoneAccept } from "uploadthing/client"; import { Icons } from "@/components/ui/icons"; import { useMutation } from "@tanstack/react-query"; import { updateImageMutation } from "@/server/actions/user/mutations"; import { toast } from "sonner"; import { useAwaitableTransition } from "@/hooks/use-awaitable-transition"; import { useRouter } from "next/navigation"; type UserImageFormProps = { user: User; }; const PROFILE_MAX_SIZE = 4; export function UserImageForm({ user }: UserImageFormProps) { const router = useRouter(); const [modalOpen, setModalOpen] = useState<boolean>(false); const [uploadProgress, setUploadProgress] = useState<number>(0); const { useUploadThing } = generateReactHelpers<OurFileRouter>(); const [files, setFiles] = useState<File[]>([]); const onDrop = useCallback((acceptedFiles: File[]) => { setFiles(acceptedFiles); }, []); const { startUpload, permittedFileInfo, isUploading } = useUploadThing( "profilePicture", { onUploadProgress: (progress) => { setUploadProgress(progress); }, }, ); const fileTypes = permittedFileInfo?.config ? Object.keys(permittedFileInfo?.config) : []; const { isDragActive, isDragAccept, getRootProps, getInputProps } = useDropzone({ onDrop, accept: fileTypes ? generateClientDropzoneAccept(fileTypes) : undefined, maxFiles: 1, maxSize: PROFILE_MAX_SIZE * 1024 * 1024, }); const [isPending, awaitableTransition] = useAwaitableTransition(); const { isPending: isMutatePending, mutateAsync } = useMutation({ mutationFn: ({ imageUrl }: { imageUrl: string }) => updateImageMutation({ image: imageUrl }), }); const handleUpdateImage = async () => { try { const images = await startUpload(files); await mutateAsync({ imageUrl: images![0]!.url }); await awaitableTransition(() => { router.refresh(); }); setFiles([]); setModalOpen(false); toast.success("Image uploaded successfully"); } catch (error) { toast.error( (error as { message?: string })?.message ?? "Image could not be uploaded", ); } }; return ( <Dialog onOpenChange={(o) => { if (isUploading) return; setModalOpen(o); setFiles([]); }} open={modalOpen} > <Card> <CardHeader> <CardTitle>Profile Image</CardTitle> <CardDescription> Add a profile image to make your account more personal. </CardDescription> </CardHeader> <CardContent className="flex items-center gap-4"> <Avatar className="h-16 w-16"> <AvatarImage src={user.image ? user.image : ""} /> <AvatarFallback className="text-3xl"> {user.name![0]} </AvatarFallback> </Avatar> <div> <p className="text-sm font-light text-muted-foreground"> Max file size: {PROFILE_MAX_SIZE}MB </p> <p className="text-sm font-light text-muted-foreground"> Recommended size: 600x600 </p> </div> </CardContent> <CardFooter> <DialogTrigger asChild> <Button type="button">Upload Image</Button> </DialogTrigger> </CardFooter> </Card> <DialogContent> <DialogHeader> <DialogTitle>Upload a new profile image here</DialogTitle> <DialogDescription> Drag and drop the image here, or click to select a file </DialogDescription> </DialogHeader> {files.length > 0 ? ( <div className="flex items-center gap-4"> {/* eslint-disable-next-line @next/next/no-img-element */} <img src={files[0] ? URL.createObjectURL(files[0]) : ""} alt="preview" className="h-36 w-36 rounded-full object-cover" /> <Button onClick={() => setFiles([])} type="button" variant="destructive" size="icon" > <Trash2Icon className="h-4 w-4" /> </Button> </div> ) : ( <div {...getRootProps()} className={cn( "flex h-36 cursor-pointer flex-col items-center justify-center rounded-md border-2 border-dashed border-border transition-[border] hover:border-primary", isDragActive && "border-primary", )} > <input {...getInputProps()} /> <p className="p-8 text-center text-sm text-muted-foreground"> {isDragActive ? isDragAccept ? "Drop the image here" : "This file type is not supported" : "Drag and drop the image here, or click to select a file not more than 4MB in size."} </p> </div> )} <DialogFooter> <DialogClose asChild> <Button disabled={ isUploading || isPending || isMutatePending } type="button" variant="outline" > Cancel </Button> </DialogClose> <Button onClick={handleUpdateImage} disabled={ isUploading || isPending || isMutatePending || files.length === 0 } type="button" className="gap-2" > {isUploading || isPending || isMutatePending ? ( <Icons.loader className="h-4 w-4" /> ) : null} <span> {isUploading && `Uploading (${uploadProgress})`} {isPending || isMutatePending ? "Setting up..." : null} {!isUploading && !isPending && !isMutatePending ? "Upload" : null} </span> </Button> </DialogFooter> </DialogContent> </Dialog> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/profile/settings/_components/user-image-form.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/profile/settings/_components/user-image-form.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 4794 }
10
"use client"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; import { Icons } from "@/components/ui/icons"; import { Input } from "@/components/ui/input"; import { new_user_setup_step_cookie } from "@/config/cookie-keys"; import { useAwaitableTransition } from "@/hooks/use-awaitable-transition"; import { createOrgMutation } from "@/server/actions/organization/mutations"; import { completeNewUserSetupMutation } from "@/server/actions/user/mutations"; import { zodResolver } from "@hookform/resolvers/zod"; import { useMutation } from "@tanstack/react-query"; import { useRouter } from "next/navigation"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; const createOrgFormSchema = z.object({ name: z .string() .trim() .min(3, "Name must be at least 3 characters long") .max(50, "Name must be at most 50 characters long"), email: z.string().email("Invalid email address"), }); type CreateOrgFormSchema = z.infer<typeof createOrgFormSchema>; type NewUserOrgFormProps = { currentStep?: number; userId: string; prevBtn?: boolean; }; export function NewUserOrgForm({ currentStep, userId, prevBtn = true, }: NewUserOrgFormProps) { const router = useRouter(); const [isPrevPending, startPrevTransition] = useAwaitableTransition(); const handlePrev = async () => { await startPrevTransition(() => { if (currentStep) { document.cookie = `${new_user_setup_step_cookie}${userId}=${currentStep - 1}; path=/`; } router.refresh(); }); }; const { mutateAsync: completeNewUserMutate, isPending: isCompleteNewUserPending, } = useMutation({ mutationFn: () => completeNewUserSetupMutation(), }); const form = useForm<CreateOrgFormSchema>({ resolver: zodResolver(createOrgFormSchema), defaultValues: { name: "", email: "", }, }); const { mutateAsync, isPending: isMutatePending } = useMutation({ mutationFn: ({ name, email }: { name: string; email: string }) => createOrgMutation({ name, email }), }); const [isPending, startAwaitableTransition] = useAwaitableTransition(); const onSubmit = async (values: CreateOrgFormSchema) => { try { await mutateAsync(values); await completeNewUserMutate(); await startAwaitableTransition(() => { router.refresh(); }); form.reset(); toast.success("Organization created successfully"); } catch (error) { toast.error( (error as { message?: string })?.message ?? "Organization could not be created", ); } }; return ( <Form {...form}> <form onSubmit={form.handleSubmit(onSubmit)}> <Card> <CardHeader> <CardTitle className="text-2xl"> Setup your organization </CardTitle> <CardDescription> Create an organization to get started </CardDescription> </CardHeader> <CardContent className="grid gap-3"> <FormField control={form.control} name="email" render={({ field }) => ( <FormItem> <FormLabel>Org Email</FormLabel> <FormControl> <Input placeholder="[email protected]" {...field} /> </FormControl> <FormDescription> Enter the email of your organization. This could be your personal email or a shared email. </FormDescription> <FormMessage /> </FormItem> )} /> <FormField control={form.control} name="name" render={({ field }) => ( <FormItem> <FormLabel>Org Name</FormLabel> <FormControl> <Input placeholder="Ali's Org" {...field} /> </FormControl> <FormDescription> Enter the name of your organization. </FormDescription> <FormMessage /> </FormItem> )} /> </CardContent> <CardFooter className="flex items-center justify-end gap-2"> {prevBtn ? ( <Button disabled={isPrevPending} onClick={handlePrev} className="gap-2" variant="outline" type="button" > {isPrevPending ? ( <Icons.loader className="h-4 w-4" /> ) : null} <span>Previous</span> </Button> ) : null} <Button disabled={ isPending || isMutatePending || isCompleteNewUserPending } type="submit" className="gap-2" > {isPending || isMutatePending || isCompleteNewUserPending ? ( <Icons.loader className="h-4 w-4" /> ) : null} <span>Continue</span> </Button> </CardFooter> </Card> </form> </Form> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/_components/new-user-org-form.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/_components/new-user-org-form.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 4347 }
11
import { AppPageShell } from "@/app/(app)/_components/page-shell"; import { RevenueChart } from "@/app/(app)/admin/dashboard/_components/revenue-chart"; import { StatsCard } from "@/app/(app)/admin/dashboard/_components/stats-card"; import { SubsChart } from "@/app/(app)/admin/dashboard/_components/subs-chart"; import { UsersChart } from "@/app/(app)/admin/dashboard/_components/users-chart"; import { adminDashConfig } from "@/app/(app)/admin/dashboard/_constants/page-config"; import { buttonVariants } from "@/components/ui/button"; import { siteUrls } from "@/config/urls"; import { cn } from "@/lib/utils"; import { getRevenueCount, getSubscriptionsCount, } from "@/server/actions/subscription/query"; import { getUsersCount } from "@/server/actions/user/queries"; import { DollarSignIcon, UserRoundCheckIcon, UserRoundPlusIcon, Users2Icon, } from "lucide-react"; import Link from "next/link"; export default async function AdminDashPage() { const usersCountData = await getUsersCount(); const usersChartData = usersCountData.usersCountByMonth; const subscriptionsCountData = await getSubscriptionsCount({}); const activeSubscriptionsCountData = await getSubscriptionsCount({ status: "active", }); const subsChartData = subscriptionsCountData.subscriptionsCountByMonth; const revenueCountData = await getRevenueCount(); const revenueChartData = revenueCountData.revenueCountByMonth; return ( <AppPageShell title={adminDashConfig.title} description={adminDashConfig.description} > <div className="grid w-full gap-8"> <p className="text-sm"> This a simple dashboard with Analytics, to see detailed Analytics go to{" "} <Link href={siteUrls.admin.analytics} className={cn( buttonVariants({ variant: "link", size: "default", className: "px-0 underline", }), )} > PostHog Dashboard </Link> </p> <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4"> <StatsCard title="Users" value={String(usersCountData.totalCount)} Icon={Users2Icon} subText="Total users joined" /> <StatsCard title="Revenue" value={revenueCountData.totalRevenue} Icon={DollarSignIcon} subText="Total revenue generated" /> <StatsCard title="Subscriptions" value={String(subscriptionsCountData.totalCount)} Icon={UserRoundPlusIcon} subText="Total subscriptions made" /> <StatsCard title="Active Subscriptions" value={String(activeSubscriptionsCountData.totalCount)} Icon={UserRoundCheckIcon} subText="Current active subscriptions" /> </div> <div className="grid grid-cols-1 gap-4 md:grid-cols-2"> <UsersChart data={usersChartData} /> <SubsChart data={subsChartData} /> <RevenueChart data={revenueChartData} /> </div> </div> </AppPageShell> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/dashboard/page.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/dashboard/page.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1955 }
12
"use client"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Button } from "@/components/ui/button"; import { MoreHorizontalIcon } from "lucide-react"; import { usersRoleEnum } from "@/server/db/schema"; import { toast } from "sonner"; import { type UsersData } from "@/app/(app)/admin/users/_components/columns"; import { useMutation } from "@tanstack/react-query"; import { updateRoleMutation, deleteUserMutation, } from "@/server/actions/user/mutations"; import { useRouter } from "next/navigation"; import { signIn } from "next-auth/react"; import { siteUrls } from "@/config/urls"; type Role = (typeof usersRoleEnum.enumValues)[number]; export function ColumnDropdown({ email, id, role }: UsersData) { const router = useRouter(); const { mutateAsync: changeRoleMutate, isPending: changeRoleIsPending } = useMutation({ mutationFn: ({ role }: { role: Role }) => updateRoleMutation({ id, role }), onSettled: () => { router.refresh(); }, }); const onRoleChange = (role: Role) => { toast.promise(async () => await changeRoleMutate({ role }), { loading: "Updating user role...", success: "User role updated!", error: "Failed to update user role, Check your permissions.", }); }; const sendLoginLink = () => { toast.promise( async () => { await signIn("email", { email, callbackUrl: siteUrls.dashboard.home, redirect: false, test: "Testing data", }); }, { loading: "Sending verification link...", success: "Verification link sent to user's email!", error: "Failed to send verification link.", }, ); }; const { mutateAsync: deleteUserMutate, isPending: deleteUserIsPending } = useMutation({ mutationFn: () => deleteUserMutation({ id }), onSettled: () => { router.refresh(); }, }); const deleteUser = () => { toast.promise(async () => await deleteUserMutate(), { loading: "Deleting user...", success: "User deleted!", error: (e) => { console.log(e); return "Failed to delete user."; }, }); }; return ( <DropdownMenu modal={false}> <DropdownMenuTrigger asChild> <Button variant="ghost" className="h-8 w-8 p-0"> <span className="sr-only">Open menu</span> <MoreHorizontalIcon className="h-4 w-4" /> </Button> </DropdownMenuTrigger> <DropdownMenuContent align="end" className="w-screen max-w-[12rem]"> <DropdownMenuLabel>Actions</DropdownMenuLabel> <DropdownMenuSeparator /> <DropdownMenuItem onClick={async () => { await navigator.clipboard.writeText(id); toast("User ID copied to clipboard"); }} > Copy user ID </DropdownMenuItem> <DropdownMenuItem onClick={sendLoginLink}> Send verification link </DropdownMenuItem> <DropdownMenuSub> <DropdownMenuSubTrigger>Edit role</DropdownMenuSubTrigger> <DropdownMenuSubContent> <DropdownMenuRadioGroup value={role} onValueChange={(r) => onRoleChange(r as Role)} > {usersRoleEnum.enumValues.map((currentRole) => ( <DropdownMenuRadioItem key={currentRole} value={currentRole} disabled={changeRoleIsPending} > {currentRole} </DropdownMenuRadioItem> ))} </DropdownMenuRadioGroup> </DropdownMenuSubContent> </DropdownMenuSub> <DropdownMenuSeparator /> <DropdownMenuItem disabled={deleteUserIsPending} onClick={deleteUser} className="text-red-600" > Delete </DropdownMenuItem> </DropdownMenuContent> </DropdownMenu> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/users/_components/column-dropdown.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/users/_components/column-dropdown.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 2661 }
13
import { ThemeToggle } from "@/components/theme-toggle"; import { buttonVariants } from "@/components/ui/button"; import { Icons } from "@/components/ui/icons"; import { navigation } from "@/config/header"; import { siteConfig } from "@/config/site"; import { siteUrls } from "@/config/urls"; import { cn } from "@/lib/utils"; import { ArrowUpRightIcon, BookOpenIcon } from "lucide-react"; import Link from "next/link"; import Balancer from "react-wrap-balancer"; export function WebFooter() { return ( <div className="pb-0 sm:px-4 sm:py-8"> <footer className="container grid grid-cols-1 gap-8 border border-border bg-background p-8 sm:grid-cols-2 sm:rounded-lg"> <div className="grid place-content-between gap-2"> <div className="grid gap-2"> <Link href={siteUrls.dashboard.home} className={cn("z-10")} > <Icons.logo className="text-xl" iconProps={{ className: "w-6 h-6 fill-primary", }} /> <span className="sr-only">Rapidlaunch logo</span> </Link> <Balancer as="p" className="text-muted-foreground"> {siteConfig.description} </Balancer> </div> <div className="flex items-center gap-2"> <Link href={siteUrls.docs} className={buttonVariants({ variant: "outline", size: "icon", })} > <BookOpenIcon className="h-4 w-4" /> <span className="sr-only">Docs</span> </Link> <Link href={siteUrls.github} className={buttonVariants({ variant: "outline", size: "icon", })} target="_blank" rel="noreferrer" > <Icons.gitHub className="h-4 w-4" /> <span className="sr-only">Rapidlaunch github</span> </Link> <ThemeToggle /> </div> </div> <div className="grid grid-cols-2 gap-4 sm:grid-cols-3"> <div className="flex flex-col gap-2"> <h3 className="text-sm font-semibold">Resources</h3> {navigation.map((item) => ( <FooterLink key={item.label} href={item.href} label={item.label} external={item.external} /> ))} <FooterLink href={siteUrls.github} label="Github" external /> </div> <div className="flex flex-col gap-2"> <h3 className="text-sm font-semibold">Usefull links</h3> {navigation.map((item) => ( <FooterLink key={item.label} href={item.href} label={item.label} external={item.external} /> ))} </div> <div className="flex flex-col gap-2"> <h3 className="text-sm font-semibold">More</h3> {navigation.map((item) => ( <FooterLink key={item.label} href={item.href} label={item.label} external={item.external} /> ))} </div> </div> </footer> </div> ); } interface FooterLinkProps { href: string; label: string; external?: boolean; } function FooterLink({ href, label, external = false }: FooterLinkProps) { const isExternal = external || href.startsWith("http"); const externalProps = isExternal ? { target: "_blank", rel: "noreferrer", } : {}; return ( <Link className="inline-flex items-center text-sm text-muted-foreground underline underline-offset-4 hover:text-foreground hover:no-underline" href={href} {...externalProps} > {label} {isExternal ? ( <ArrowUpRightIcon className="ml-1 h-4 w-4 flex-shrink-0" /> ) : null} </Link> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/_components/footer.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/_components/footer.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 3450 }
14
export const pricingPageConfig = { title: "Pricing", } as const;
alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/pricing/_constants/page-config.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/pricing/_constants/page-config.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 24 }
15
import { DocsLayout } from "fumadocs-ui/layout"; import { docs } from "@/app/source"; import type { ReactNode } from "react"; import { Icons } from "@/components/ui/icons"; import { WebHeaderNav } from "@/app/(web)/_components/header-nav"; type RootDocsLayoutProps = { children: ReactNode; }; export default function RootDocsLayout({ children }: RootDocsLayoutProps) { return ( <DocsLayout tree={docs.pageTree} nav={{ title: <Icons.logo />, children: ( <div className="hidden lg:block"> <WebHeaderNav /> </div> ), }} > {children} </DocsLayout> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/docs/layout.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/docs/layout.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 377 }
16
"use client"; import { env } from "@/env"; import { useSession } from "next-auth/react"; import { usePathname } from "next/navigation"; import posthog from "posthog-js"; import { PostHogProvider as CSPostHogProvider } from "posthog-js/react"; import { useEffect } from "react"; if (typeof window !== "undefined") { posthog.init(env.NEXT_PUBLIC_POSTHOG_KEY, { api_host: "/ingest", rate_limiting: { events_burst_limit: 10, events_per_second: 5, }, loaded: (posthog) => { if (env.NODE_ENV === "development") posthog.debug(); }, }); } type PostHogProviderProps = { children: React.ReactNode; }; export function PosthogProvider({ children }: PostHogProviderProps) { return ( <> <CapturePageviewClient captureOnPathChange={true} /> <CSPostHogProvider client={posthog}> <PosthogAuthWrapper>{children}</PosthogAuthWrapper> </CSPostHogProvider> </> ); } function PosthogAuthWrapper({ children }: PostHogProviderProps) { const { data: session, status } = useSession(); useEffect(() => { if (status === "authenticated") { posthog.identify(session.user.id, { email: session.user.email, name: session.user.name, }); } else if (status === "unauthenticated") { posthog.reset(); } }, [session, status]); return children; } type CapturePageviewClientProps = { captureOnPathChange?: boolean; }; export function CapturePageviewClient({ captureOnPathChange = false, }: CapturePageviewClientProps) { const pathname = usePathname(); useEffect(() => { const handleCapturePageview = () => posthog.capture("$pageview"); handleCapturePageview(); // eslint-disable-next-line react-hooks/exhaustive-deps }, [captureOnPathChange ? pathname : undefined]); return null; }
alifarooq9/rapidlaunch/starterkits/saas/src/components/posthog-provider.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/components/posthog-provider.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 832 }
17
export const new_user_setup_step_cookie = "rapidlaunch:new_user_setup_step";
alifarooq9/rapidlaunch/starterkits/saas/src/config/cookie-keys.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/config/cookie-keys.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 25 }
18
import { orgConfig } from "@/config/organization"; import { env } from "@/env"; import { type ClassValue, clsx } from "clsx"; import { format } from "date-fns"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } // it tells you if the current link is active or not based on the pathname export function isLinkActive(href: string, pathname: string | null) { return pathname === href; } export function setOrgCookie(orgId: string) { document.cookie = `${orgConfig.cookieName}=${orgId}; path=/; max-age=31536000;`; } export function getAbsoluteUrl(path: string) { return `${env.NEXTAUTH_URL}${path}`; } export function thousandToK(value: number) { return value / 1000; } export function formatDate(date: string | number | Date) { return format(new Date(date), "PP"); }
alifarooq9/rapidlaunch/starterkits/saas/src/lib/utils.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/lib/utils.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 297 }
19
import { relations, sql } from "drizzle-orm"; import { boolean, index, integer, jsonb, pgEnum, pgTableCreator, primaryKey, text, timestamp, varchar, } from "drizzle-orm/pg-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { type AdapterAccount } from "next-auth/adapters"; import { z } from "zod"; /** * This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same * database instance for multiple projects. * * @see https://orm.drizzle.team/docs/goodies#multi-project-schema */ export const createTable = pgTableCreator( (name) => `rapidlaunch-saas-starterkit_${name}`, ); export const usersRoleEnum = pgEnum("role", ["User", "Admin", "Super Admin"]); export const users = createTable("user", { id: varchar("id", { length: 255 }).notNull().primaryKey(), name: varchar("name", { length: 255 }), email: varchar("email", { length: 255 }).notNull(), emailVerified: timestamp("emailVerified", { mode: "date", }).default(sql`CURRENT_TIMESTAMP`), image: varchar("image", { length: 255 }), role: usersRoleEnum("role").default("User").notNull(), isNewUser: boolean("isNewUser").default(true).notNull(), createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(), }); export const usersRelations = relations(users, ({ many }) => ({ accounts: many(accounts), membersToOrganizations: many(membersToOrganizations), feedback: many(feedback), })); export const userInsertSchema = createInsertSchema(users, { name: z .string() .trim() .min(3, "Name must be at least 3 characters long") .max(50, "Name must be at most 50 characters long"), email: z.string().email(), image: z.string().url(), }); export const accounts = createTable( "account", { userId: varchar("userId", { length: 255 }) .notNull() .references(() => users.id), type: varchar("type", { length: 255 }) .$type<AdapterAccount["type"]>() .notNull(), provider: varchar("provider", { length: 255 }).notNull(), providerAccountId: varchar("providerAccountId", { length: 255, }).notNull(), refresh_token: text("refresh_token"), access_token: text("access_token"), expires_at: integer("expires_at"), token_type: varchar("token_type", { length: 255 }), scope: varchar("scope", { length: 255 }), id_token: text("id_token"), session_state: varchar("session_state", { length: 255 }), }, (account) => ({ compoundKey: primaryKey({ columns: [account.provider, account.providerAccountId], }), userIdIdx: index("account_userId_idx").on(account.userId), }), ); export const accountsRelations = relations(accounts, ({ one }) => ({ user: one(users, { fields: [accounts.userId], references: [users.id] }), })); export const sessions = createTable( "session", { sessionToken: varchar("sessionToken", { length: 255 }) .notNull() .primaryKey(), userId: varchar("userId", { length: 255 }) .notNull() .references(() => users.id), expires: timestamp("expires", { mode: "date" }).notNull(), }, (session) => ({ userIdIdx: index("session_userId_idx").on(session.userId), }), ); export const sessionsRelations = relations(sessions, ({ one }) => ({ user: one(users, { fields: [sessions.userId], references: [users.id] }), })); export const verificationTokens = createTable( "verificationToken", { identifier: varchar("identifier", { length: 255 }).notNull(), token: varchar("token", { length: 255 }).notNull(), expires: timestamp("expires", { mode: "date" }).notNull(), }, (vt) => ({ compoundKey: primaryKey({ columns: [vt.identifier, vt.token] }), }), ); export const organizations = createTable("organization", { id: varchar("id", { length: 255 }) .notNull() .primaryKey() .default(sql`gen_random_uuid()`), name: varchar("name", { length: 255 }).notNull(), email: varchar("email", { length: 255 }).notNull(), image: varchar("image", { length: 255 }), createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(), ownerId: varchar("ownerId", { length: 255 }) .notNull() .references(() => users.id, { onDelete: "cascade" }), }); export const createOrgInsertSchema = createInsertSchema(organizations, { name: z .string() .min(3, "Name must be at least 3 characters long") .max(50, "Name must be at most 50 characters long"), image: z.string().url({ message: "Invalid image URL" }), }); export const organizationsRelations = relations( organizations, ({ one, many }) => ({ owner: one(users, { fields: [organizations.ownerId], references: [users.id], }), membersToOrganizations: many(membersToOrganizations), subscriptions: one(subscriptions, { fields: [organizations.id], references: [subscriptions.orgId], }), }), ); export const membersToOrganizationsRoleEnum = pgEnum("org-member-role", [ "Viewer", "Developer", "Billing", "Admin", ]); export const membersToOrganizations = createTable( "membersToOrganizations", { id: varchar("id", { length: 255 }).default(sql`gen_random_uuid()`), memberId: varchar("memberId", { length: 255 }) .notNull() .references(() => users.id, { onDelete: "cascade" }), memberEmail: varchar("memberEmail", { length: 255 }).notNull(), organizationId: varchar("organizationId", { length: 255 }) .notNull() .references(() => organizations.id, { onDelete: "cascade" }), role: membersToOrganizationsRoleEnum("role") .default("Viewer") .notNull(), createdAt: timestamp("createdAt", { mode: "date" }) .notNull() .defaultNow(), }, (mto) => ({ compoundKey: primaryKey({ columns: [mto.id, mto.memberId, mto.organizationId], }), }), ); export const membersToOrganizationsRelations = relations( membersToOrganizations, ({ one }) => ({ member: one(users, { fields: [membersToOrganizations.memberId], references: [users.id], }), organization: one(organizations, { fields: [membersToOrganizations.organizationId], references: [organizations.id], }), }), ); export const membersToOrganizationsInsertSchema = createInsertSchema( membersToOrganizations, ); export const orgRequests = createTable( "orgRequest", { id: varchar("id", { length: 255 }) .notNull() .primaryKey() .default(sql`gen_random_uuid()`), userId: varchar("userId", { length: 255 }) .notNull() .references(() => users.id, { onDelete: "cascade" }), organizationId: varchar("organizationId", { length: 255, }) .notNull() .references(() => organizations.id, { onDelete: "cascade" }), createdAt: timestamp("createdAt", { mode: "date" }) .notNull() .defaultNow(), }, (or) => ({ orgIdIdx: index("orgRequest_organizationId_idx").on(or.organizationId), }), ); export const orgRequestsRelations = relations(orgRequests, ({ one }) => ({ user: one(users, { fields: [orgRequests.userId], references: [users.id] }), organization: one(organizations, { fields: [orgRequests.organizationId], references: [organizations.id], }), })); export const orgRequestInsertSchema = createInsertSchema(orgRequests); // Feedback schema export const feedbackLabelEnum = pgEnum("feedback-label", [ "Issue", "Idea", "Question", "Complaint", "Feature Request", "Other", ]); export const feedbackStatusEnum = pgEnum("feedback-status", [ "Open", "In Progress", "Closed", ]); export const feedback = createTable("feedback", { id: varchar("id", { length: 255 }) .notNull() .primaryKey() .default(sql`gen_random_uuid()`), userId: varchar("userId", { length: 255 }) .notNull() .references(() => users.id, { onDelete: "cascade" }), title: varchar("title", { length: 255 }), message: text("message").notNull(), label: feedbackLabelEnum("label").notNull(), status: feedbackStatusEnum("status").default("Open").notNull(), createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(), }); export const feedbackRelations = relations(feedback, ({ one }) => ({ user: one(users, { fields: [feedback.userId], references: [users.id] }), })); export const feedbackInsertSchema = createInsertSchema(feedback, { title: z .string() .min(3, "Title is too short") .max(255, "Title is too long"), message: z .string() .min(10, "Message is too short") .max(1000, "Message is too long"), }); export const feedbackSelectSchema = createSelectSchema(feedback, { title: z .string() .min(3, "Title is too short") .max(255, "Title is too long"), message: z .string() .min(10, "Message is too short") .max(1000, "Message is too long"), }); export const webhookEvents = createTable("webhookEvent", { id: varchar("id", { length: 255 }) .notNull() .primaryKey() .default(sql`gen_random_uuid()`), createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(), eventName: text("eventName").notNull(), processed: boolean("processed").default(false), body: jsonb("body").notNull(), processingError: text("processingError"), }); export const subscriptions = createTable("subscription", { id: varchar("id", { length: 255 }) .notNull() .primaryKey() .default(sql`gen_random_uuid()`), lemonSqueezyId: text("lemonSqueezyId").unique().notNull(), orderId: integer("orderId").notNull(), orgId: text("orgId") .notNull() .references(() => organizations.id, { onDelete: "cascade" }), variantId: integer("variantId").notNull(), }); export const subscriptionsRelations = relations(subscriptions, ({ one }) => ({ organization: one(organizations, { fields: [subscriptions.orgId], references: [organizations.id], }), })); export const waitlistUsers = createTable("waitlistUser", { id: varchar("id", { length: 255 }) .notNull() .primaryKey() .default(sql`gen_random_uuid()`), email: varchar("email", { length: 255 }).notNull().unique(), name: varchar("name", { length: 255 }).notNull(), createdAt: timestamp("createdAt", { mode: "date" }).notNull().defaultNow(), }); export const waitlistUsersSchema = createInsertSchema(waitlistUsers, { email: z.string().email("Email must be a valid email address"), name: z.string().min(3, "Name must be at least 3 characters long"), });
alifarooq9/rapidlaunch/starterkits/saas/src/server/db/schema.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/server/db/schema.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 4586 }
20
import { ChatBody } from '@/types/types'; import { OpenAIStream } from '@/utils/streams/chatStream'; export const runtime = 'edge'; export async function GET(req: Request): Promise<Response> { try { const { inputMessage, model, apiKey } = (await req.json()) as ChatBody; let apiKeyFinal; if (apiKey) { apiKeyFinal = apiKey; } else { apiKeyFinal = process.env.NEXT_PUBLIC_OPENAI_API_KEY; } const stream = await OpenAIStream(inputMessage, model, apiKeyFinal); return new Response(stream); } catch (error) { console.error(error); return new Response('Error', { status: 500 }); } } export async function POST(req: Request): Promise<Response> { try { const { inputMessage, model, apiKey } = (await req.json()) as ChatBody; let apiKeyFinal; if (apiKey) { apiKeyFinal = apiKey; } else { apiKeyFinal = process.env.NEXT_PUBLIC_OPENAI_API_KEY; } const stream = await OpenAIStream(inputMessage, model, apiKeyFinal); return new Response(stream); } catch (error) { console.error(error); return new Response('Error', { status: 500 }); } }
horizon-ui/shadcn-nextjs-boilerplate/app/api/chatAPI/route.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/app/api/chatAPI/route.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 415 }
21
import { Database } from '@/types/types_db'; import { createServerComponentClient } from '@supabase/auth-helpers-nextjs'; import { cookies } from 'next/headers'; import { cache } from 'react'; export const createServerSupabaseClient = cache(() => createServerComponentClient<Database>({ cookies }) );
horizon-ui/shadcn-nextjs-boilerplate/app/supabase-server.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/app/supabase-server.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 85 }
22
'use client'; // if you use app dir, don't forget this line import dynamic from 'next/dynamic'; const ApexChart = dynamic(() => import('react-apexcharts'), { ssr: false }); export default function ExampleChart(props: any) { const { chartData, chartOptions } = props; return ( <ApexChart type="line" options={chartOptions} series={chartData} height="100%" width="100%" /> ); }
horizon-ui/shadcn-nextjs-boilerplate/components/charts/LineChart/index.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/charts/LineChart/index.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 154 }
23
// Auth Imports import { IRoute } from '@/types/types'; import { HiOutlineHome, HiOutlineCpuChip, HiOutlineUsers, HiOutlineUser, HiOutlineCog8Tooth, HiOutlineCreditCard, HiOutlineDocumentText, HiOutlineCurrencyDollar } from 'react-icons/hi2'; export const routes: IRoute[] = [ { name: 'Main Dashboard', path: '/dashboard/main', icon: <HiOutlineHome className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" />, collapse: false }, { name: 'AI Chat', path: '/dashboard/ai-chat', icon: ( <HiOutlineCpuChip className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false }, { name: 'Profile Settings', path: '/dashboard/settings', icon: ( <HiOutlineCog8Tooth className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false }, { name: 'AI Generator', path: '/dashboard/ai-generator', icon: ( <HiOutlineDocumentText className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false, disabled: true }, { name: 'AI Assistant', path: '/dashboard/ai-assistant', icon: <HiOutlineUser className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" />, collapse: false, disabled: true }, { name: 'Users List', path: '/dashboard/users-list', icon: ( <HiOutlineUsers className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false, disabled: true }, { name: 'Subscription', path: '/dashboard/subscription', icon: ( <HiOutlineCreditCard className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false, disabled: true }, { name: 'Landing Page', path: '/home', icon: ( <HiOutlineDocumentText className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false, disabled: true }, { name: 'Pricing Page', path: '/pricing', icon: ( <HiOutlineCurrencyDollar className="-mt-[7px] h-4 w-4 stroke-2 text-inherit" /> ), collapse: false, disabled: true } ];
horizon-ui/shadcn-nextjs-boilerplate/components/routes.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/routes.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 907 }
24
'use server'; import { createClient } from '@/utils/supabase/server'; import { cookies } from 'next/headers'; import { redirect } from 'next/navigation'; import { getURL, getErrorRedirect, getStatusRedirect } from '@/utils/helpers'; import { getAuthTypes } from '@/utils/auth-helpers/settings'; function isValidEmail(email: string) { var regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/; return regex.test(email); } export async function redirectToPath(path: string) { return redirect(path); } export async function SignOut(formData: FormData) { const pathName = String(formData.get('pathName')).trim(); const supabase = createClient(); const { error } = await supabase.auth.signOut(); if (error) { return getErrorRedirect( 'https://horizon-ui.com/dashboard/settings', 'Hmm... Something went wrong.', 'You could not be signed out.' ); } return '/dashboard/signin'; } export async function signInWithEmail(formData: FormData) { const cookieStore = cookies(); const callbackURL = getURL('/auth/callback'); const email = String(formData.get('email')).trim(); let redirectPath: string; if (!isValidEmail(email)) { redirectPath = getErrorRedirect( '/dashboard/signin/email_signin', 'Invalid email address.', 'Please try again.' ); } const supabase = createClient(); let options = { emailRedirectTo: callbackURL, shouldCreateUser: true }; // If allowPassword is false, do not create a new user const { allowPassword } = getAuthTypes(); if (allowPassword) options.shouldCreateUser = false; const { data, error } = await supabase.auth.signInWithOtp({ email, options: options }); if (error) { redirectPath = getErrorRedirect( '/dashboard/signin/email_signin', 'You could not be signed in.', error.message ); } else if (data) { cookieStore.set('preferredSignInView', 'email_signin', { path: '/' }); redirectPath = getStatusRedirect( '/dashboard/signin/email_signin', 'Success!', 'Please check your email for a magic link. You may now close this tab.', true ); } else { redirectPath = getErrorRedirect( '/dashboard/signin/email_signin', 'Hmm... Something went wrong.', 'You could not be signed in.' ); } return redirectPath; } export async function requestPasswordUpdate(formData: FormData) { const callbackURL = getURL('/auth/reset_password'); // Get form data const email = String(formData.get('email')).trim(); let redirectPath: string; if (!isValidEmail(email)) { redirectPath = getErrorRedirect( '/dashboard/signin/forgot_password', 'Invalid email address.', 'Please try again.' ); } const supabase = createClient(); const { data, error } = await supabase.auth.resetPasswordForEmail(email, { redirectTo: callbackURL }); if (error) { redirectPath = getErrorRedirect( '/dashboard/signin/forgot_password', error.message, 'Please try again.' ); } else if (data) { redirectPath = getStatusRedirect( '/dashboard/signin/forgot_password', 'Success!', 'Please check your email for a password reset link. You may now close this tab.', true ); } else { redirectPath = getErrorRedirect( '/dashboard/signin/forgot_password', 'Hmm... Something went wrong.', 'Password reset email could not be sent.' ); } return redirectPath; } export async function signInWithPassword(formData: FormData) { const cookieStore = cookies(); const email = String(formData.get('email')).trim(); const password = String(formData.get('password')).trim(); let redirectPath: string; const supabase = createClient(); const { error, data } = await supabase.auth.signInWithPassword({ email, password }); if (error) { redirectPath = getErrorRedirect( '/dashboard/signin/password_signin', 'Sign in failed.', error.message ); } else if (data.user) { cookieStore.set('preferredSignInView', 'password_signin', { path: '/' }); redirectPath = getStatusRedirect('/', 'Success!', 'You are now signed in.'); } else { redirectPath = getErrorRedirect( '/dashboard/signin/password_signin', 'Hmm... Something went wrong.', 'You could not be signed in.' ); } return redirectPath; } export async function signUp(formData: FormData) { const callbackURL = getURL('/auth/callback'); const email = String(formData.get('email')).trim(); const password = String(formData.get('password')).trim(); let redirectPath: string; if (!isValidEmail(email)) { redirectPath = getErrorRedirect( '/dashboard/signin/signup', 'Invalid email address.', 'Please try again.' ); } const supabase = createClient(); const { error, data } = await supabase.auth.signUp({ email, password, options: { emailRedirectTo: callbackURL } }); if (error) { redirectPath = getErrorRedirect( '/dashboard/signin/signup', 'Sign up failed.', error.message ); } else if (data.session) { redirectPath = getStatusRedirect('/', 'Success!', 'You are now signed in.'); } else if ( data.user && data.user.identities && data.user.identities.length == 0 ) { redirectPath = getErrorRedirect( '/dashboard/signin/signup', 'Sign up failed.', 'There is already an account associated with this email address. Try resetting your password.' ); } else if (data.user) { redirectPath = getStatusRedirect( '/', 'Success!', 'Please check your email for a confirmation link. You may now close this tab.' ); } else { redirectPath = getErrorRedirect( '/dashboard/signin/signup', 'Hmm... Something went wrong.', 'You could not be signed up.' ); } return redirectPath; } export async function updatePassword(formData: FormData) { const password = String(formData.get('password')).trim(); const passwordConfirm = String(formData.get('passwordConfirm')).trim(); let redirectPath: string; // Check that the password and confirmation match if (password !== passwordConfirm) { redirectPath = getErrorRedirect( '/dashboard/signin/update_password', 'Your password could not be updated.', 'Passwords do not match.' ); } const supabase = createClient(); const { error, data } = await supabase.auth.updateUser({ password }); if (error) { redirectPath = getErrorRedirect( '/dashboard/signin/update_password', 'Your password could not be updated.', error.message ); } else if (data.user) { redirectPath = getStatusRedirect( '/', 'Success!', 'Your password has been updated.' ); } else { redirectPath = getErrorRedirect( '/dashboard/signin/update_password', 'Hmm... Something went wrong.', 'Your password could not be updated.' ); } return redirectPath; } export async function updateEmail(formData: FormData) { // Get form data const newEmail = String(formData.get('newEmail')).trim(); // Check that the email is valid if (!isValidEmail(newEmail)) { return getErrorRedirect( '/dashboard/settings', 'Your email could not be updated.', 'Invalid email address.' ); } const supabase = createClient(); const callbackUrl = getURL( getStatusRedirect( '/dashboard/settings', 'Success!', `Your email has been updated.` ) ); const { error } = await supabase.auth.updateUser( { email: newEmail }, { emailRedirectTo: callbackUrl } ); if (error) { return getErrorRedirect( '/dashboard/settings', 'Your email could not be updated.', error.message ); } else { return getStatusRedirect( '/dashboard/settings', 'Confirmation emails sent.', `You will need to confirm the update by clicking the links sent to both the old and new email addresses.` ); } } export async function updateName(formData: FormData) { // Get form data const fullName = String(formData.get('fullName')).trim(); const supabase = createClient(); const { error, data } = await supabase.auth.updateUser({ data: { full_name: fullName } }); if (error) { return getErrorRedirect( '/dashboard/settings', 'Your name could not be updated.', error.message ); } else if (data.user) { return getStatusRedirect( '/dashboard/settings', 'Success!', 'Your name has been updated.' ); } else { return getErrorRedirect( '/dashboard/settings', 'Hmm... Something went wrong.', 'Your name could not be updated.' ); } }
horizon-ui/shadcn-nextjs-boilerplate/utils/auth-helpers/server.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/utils/auth-helpers/server.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 3172 }
25
import { createServerClient } from '@supabase/ssr'; import { cookies } from 'next/headers'; export const createClient = () => { const cookieStore = cookies(); return createServerClient( process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, { cookies: { getAll() { return cookieStore.getAll(); }, setAll(cookiesToSet) { try { cookiesToSet.forEach(({ name, value, options }) => { cookieStore.set(name, value, options); }); } catch (error) { // The `set` method was called from a Server Component. // This can be ignored if you have middleware refreshing // user sessions. } } } } ); };
horizon-ui/shadcn-nextjs-boilerplate/utils/supabase/server.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/utils/supabase/server.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 361 }
26
import { OrganizationProfile } from '@clerk/nextjs'; import { useTranslations } from 'next-intl'; import { TitleBar } from '@/features/dashboard/TitleBar'; import { getI18nPath } from '@/utils/Helpers'; const OrganizationProfilePage = (props: { params: { locale: string } }) => { const t = useTranslations('OrganizationProfile'); return ( <> <TitleBar title={t('title_bar')} description={t('title_bar_description')} /> <OrganizationProfile routing="path" path={getI18nPath( '/dashboard/organization-profile', props.params.locale, )} afterLeaveOrganizationUrl="/onboarding/organization-selection" appearance={{ elements: { rootBox: 'w-full', cardBox: 'w-full flex', }, }} /> </> ); }; export default OrganizationProfilePage;
ixartz/SaaS-Boilerplate/src/app/[locale]/(auth)/dashboard/organization-profile/[[...organization-profile]]/page.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/app/[locale]/(auth)/dashboard/organization-profile/[[...organization-profile]]/page.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 380 }
27
import { type ForwardedRef, forwardRef } from 'react'; import { Button } from '@/components/ui/button'; type IToggleMenuButtonProps = { onClick?: () => void; }; /** * A toggle button to show/hide component in small screen. * @component * @params props - Component props. * @params props.onClick - Function to run when the button is clicked. */ const ToggleMenuButtonInternal = ( props: IToggleMenuButtonProps, ref?: ForwardedRef<HTMLButtonElement>, ) => ( <Button className="p-2 focus-visible:ring-offset-0" variant="ghost" ref={ref} {...props} > <svg className="size-6 stroke-current" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" strokeWidth="1.5" fill="none" strokeLinecap="round" strokeLinejoin="round" > <path d="M0 0h24v24H0z" stroke="none" /> <path d="M4 6h16M4 12h16M4 18h16" /> </svg> </Button> ); const ToggleMenuButton = forwardRef(ToggleMenuButtonInternal); export { ToggleMenuButton };
ixartz/SaaS-Boilerplate/src/components/ToggleMenuButton.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/components/ToggleMenuButton.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 395 }
28
export const PricingFeature = (props: { children: React.ReactNode }) => ( <li className="flex items-center text-muted-foreground"> <svg className="mr-1 size-6 stroke-current stroke-2 text-purple-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" strokeLinecap="round" strokeLinejoin="round" > <path d="M0 0h24v24H0z" stroke="none" /> <path d="M5 12l5 5L20 7" /> </svg> {props.children} </li> );
ixartz/SaaS-Boilerplate/src/features/billing/PricingFeature.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/features/billing/PricingFeature.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 223 }
29
import { useState } from 'react'; /** * React Hook to toggle element. Mostly used for responsive menu. * @hook */ export const useMenu = () => { const [showMenu, setShowMenu] = useState(false); const handleToggleMenu = () => { setShowMenu(prevState => !prevState); }; const handleClose = () => { setShowMenu(false); }; return { showMenu, handleToggleMenu, handleClose }; };
ixartz/SaaS-Boilerplate/src/hooks/UseMenu.ts
{ "file_path": "ixartz/SaaS-Boilerplate/src/hooks/UseMenu.ts", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 127 }
30
import Link from 'next/link'; import { useTranslations } from 'next-intl'; import { CenteredFooter } from '@/features/landing/CenteredFooter'; import { Section } from '@/features/landing/Section'; import { AppConfig } from '@/utils/AppConfig'; import { Logo } from './Logo'; export const Footer = () => { const t = useTranslations('Footer'); return ( <Section className="pb-16 pt-0"> <CenteredFooter logo={<Logo />} name={AppConfig.name} iconList={( <> <li> <Link href="/"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" /> </svg> </Link> </li> <li> <Link href="/"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M23.998 12c0-6.628-5.372-12-11.999-12C5.372 0 0 5.372 0 12c0 5.988 4.388 10.952 10.124 11.852v-8.384H7.078v-3.469h3.046V9.356c0-3.008 1.792-4.669 4.532-4.669 1.313 0 2.686.234 2.686.234v2.953H15.83c-1.49 0-1.955.925-1.955 1.874V12h3.328l-.532 3.469h-2.796v8.384c5.736-.9 10.124-5.864 10.124-11.853z" /> </svg> </Link> </li> <li> <Link href="/"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M23.954 4.569a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.691 8.094 4.066 6.13 1.64 3.161a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.061a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.937 4.937 0 004.604 3.417 9.868 9.868 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63a9.936 9.936 0 002.46-2.548l-.047-.02z" /> </svg> </Link> </li> <li> <Link href="/"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <path d="M23.495 6.205a3.007 3.007 0 00-2.088-2.088c-1.87-.501-9.396-.501-9.396-.501s-7.507-.01-9.396.501A3.007 3.007 0 00.527 6.205a31.247 31.247 0 00-.522 5.805 31.247 31.247 0 00.522 5.783 3.007 3.007 0 002.088 2.088c1.868.502 9.396.502 9.396.502s7.506 0 9.396-.502a3.007 3.007 0 002.088-2.088 31.247 31.247 0 00.5-5.783 31.247 31.247 0 00-.5-5.805zM9.609 15.601V8.408l6.264 3.602z" /> </svg> </Link> </li> <li> <Link href="/"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" /> </svg> </Link> </li> <li> <Link href="/"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M11.585 5.267c1.834 0 3.558.811 4.824 2.08v.004c0-.609.41-1.068.979-1.068h.145c.891 0 1.073.842 1.073 1.109l.005 9.475c-.063.621.64.941 1.029.543 1.521-1.564 3.342-8.038-.946-11.79-3.996-3.497-9.357-2.921-12.209-.955-3.031 2.091-4.971 6.718-3.086 11.064 2.054 4.74 7.931 6.152 11.424 4.744 1.769-.715 2.586 1.676.749 2.457-2.776 1.184-10.502 1.064-14.11-5.188C-.977 13.521-.847 6.093 5.62 2.245 10.567-.698 17.09.117 21.022 4.224c4.111 4.294 3.872 12.334-.139 15.461-1.816 1.42-4.516.037-4.498-2.031l-.019-.678c-1.265 1.256-2.948 1.988-4.782 1.988-3.625 0-6.813-3.189-6.813-6.812 0-3.659 3.189-6.885 6.814-6.885zm4.561 6.623c-.137-2.653-2.106-4.249-4.484-4.249h-.09c-2.745 0-4.268 2.159-4.268 4.61 0 2.747 1.842 4.481 4.256 4.481 2.693 0 4.464-1.973 4.592-4.306l-.006-.536z" /> </svg> </Link> </li> <li> <Link href="/"> <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M19.199 24C19.199 13.467 10.533 4.8 0 4.8V0c13.165 0 24 10.835 24 24h-4.801zM3.291 17.415a3.3 3.3 0 013.293 3.295A3.303 3.303 0 013.283 24C1.47 24 0 22.526 0 20.71s1.475-3.294 3.291-3.295zM15.909 24h-4.665c0-6.169-5.075-11.245-11.244-11.245V8.09c8.727 0 15.909 7.184 15.909 15.91z" /> </svg> </Link> </li> </> )} legalLinks={( <> <li> <Link href="/sign-up">{t('terms_of_service')}</Link> </li> <li> <Link href="/sign-up">{t('privacy_policy')}</Link> </li> </> )} > <li> <Link href="/sign-up">{t('product')}</Link> </li> <li> <Link href="/sign-up">{t('docs')}</Link> </li> <li> <Link href="/sign-up">{t('blog')}</Link> </li> <li> <Link href="/sign-up">{t('community')}</Link> </li> <li> <Link href="/sign-up">{t('company')}</Link> </li> </CenteredFooter> </Section> ); };
ixartz/SaaS-Boilerplate/src/templates/Footer.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/templates/Footer.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 3757 }
31
import percySnapshot from '@percy/playwright'; import { expect, test } from '@playwright/test'; test.describe('Visual testing', () => { test.describe('Static pages', () => { test('should take screenshot of the homepage', async ({ page }) => { await page.goto('/'); await expect(page.getByText('The perfect SaaS template to build')).toBeVisible(); await percySnapshot(page, 'Homepage'); }); test('should take screenshot of the French homepage', async ({ page }) => { await page.goto('/fr'); await expect(page.getByText('Le parfait SaaS template pour construire')).toBeVisible(); await percySnapshot(page, 'Homepage - French'); }); }); });
ixartz/SaaS-Boilerplate/tests/e2e/Visual.e2e.ts
{ "file_path": "ixartz/SaaS-Boilerplate/tests/e2e/Visual.e2e.ts", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 241 }
32
#!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" pnpm lint-staged pnpm checkIcons
lucide-icons/lucide/.husky/pre-commit
{ "file_path": "lucide-icons/lucide/.husky/pre-commit", "repo_id": "lucide-icons/lucide", "token_count": 41 }
33
import fs from 'fs'; import module from 'node:module'; /* WASM_IMPORT */ let wasm; if (process.env.NODE_ENV === 'development') { const require = module.createRequire(import.meta.url); wasm = fs.readFileSync(require.resolve('@resvg/resvg-wasm/index_bg.wasm')); } else { wasm = resvg_wasm; } export default wasm;
lucide-icons/lucide/docs/.vitepress/api/gh-icon/dpi/loadWasm.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/api/gh-icon/dpi/loadWasm.ts", "repo_id": "lucide-icons/lucide", "token_count": 123 }
34
import { SVGProps } from 'react'; import { getCommands } from './utils'; export type Point = { x: number; y: number }; export type Path = { d: string; prev: Point; next: Point; isStart: boolean; circle?: { x: number; y: number; r: number }; cp1?: Point; cp2?: Point; c: ReturnType<typeof getCommands>[number]; }; export type PathProps< RequiredProps extends keyof SVGProps<SVGPathElement | SVGRectElement | SVGCircleElement>, NeverProps extends keyof SVGProps<SVGPathElement | SVGRectElement | SVGCircleElement>, > = Required<Pick<React.SVGProps<SVGElement & SVGRectElement & SVGCircleElement>, RequiredProps>> & Omit< React.SVGProps<SVGPathElement & SVGRectElement & SVGCircleElement>, RequiredProps & NeverProps >;
lucide-icons/lucide/docs/.vitepress/lib/SvgPreview/types.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/lib/SvgPreview/types.ts", "repo_id": "lucide-icons/lucide", "token_count": 265 }
35
import { getAllData } from '../../../lib/icons'; import { getAllCategoryFiles, mapCategoryIconCount } from '../../../lib/categories'; import iconsMetaData from '../../../data/iconMetaData'; export default { async load() { let categories = getAllCategoryFiles(); categories = mapCategoryIconCount(categories, Object.values(iconsMetaData)); return { categories, }; }, };
lucide-icons/lucide/docs/.vitepress/theme/components/icons/CategoryList.data.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/theme/components/icons/CategoryList.data.ts", "repo_id": "lucide-icons/lucide", "token_count": 124 }
36
import { useRoute } from 'vitepress'; import { ref, inject, Ref, onMounted, watch } from 'vue'; export const CATEGORY_VIEW_CONTEXT = Symbol('categoryView'); interface CategoryViewContext { selectedCategory: Ref<string>; categoryCounts: Ref<Record<string, number>>; } export const categoryViewContext = { selectedCategory: ref(), categoryCounts: ref({}), }; export function useCategoryView(): CategoryViewContext { const context = inject<CategoryViewContext>(CATEGORY_VIEW_CONTEXT); const route = useRoute(); if (!context) { throw new Error('useCategoryView must be used with categoryView context'); } onMounted(() => { if (window.location.hash) { context.selectedCategory.value = decodeURIComponent(window.location.hash.slice(1)); } }); watch(route, (currentRoute) => { if (currentRoute.path !== '/icons/categories') { context.selectedCategory.value = ''; context.categoryCounts.value = {}; } }); return context; }
lucide-icons/lucide/docs/.vitepress/theme/composables/useCategoryView.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/theme/composables/useCategoryView.ts", "repo_id": "lucide-icons/lucide", "token_count": 320 }
37
export default function downloadData(filename: string, data: string) { const link = document.createElement('a'); link.download = filename; link.href = data; link.click(); }
lucide-icons/lucide/docs/.vitepress/theme/utils/downloadData.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/theme/utils/downloadData.ts", "repo_id": "lucide-icons/lucide", "token_count": 52 }
38
import App from './App.js?raw' import styles from '../styles.css?raw' import IconCss from './icon.css?raw' const files = { 'icon.css': { code: IconCss, readOnly: false, active: true, }, 'App.js': { code: App, }, 'styles.css': { code: styles, hidden: true }, } export default files
lucide-icons/lucide/docs/guide/basics/examples/size-icon-font-example/files.ts
{ "file_path": "lucide-icons/lucide/docs/guide/basics/examples/size-icon-font-example/files.ts", "repo_id": "lucide-icons/lucide", "token_count": 135 }
39
import createCodeExamples from '../.vitepress/lib/codeExamples/createCodeExamples'; export default { async load() { const codeExamples = await createCodeExamples(); return { codeExamples, }; }, };
lucide-icons/lucide/docs/icons/codeExamples.data.ts
{ "file_path": "lucide-icons/lucide/docs/icons/codeExamples.data.ts", "repo_id": "lucide-icons/lucide", "token_count": 72 }
40
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526" /> <circle cx="12" cy="8" r="6" /> </svg>
lucide-icons/lucide/icons/award.svg
{ "file_path": "lucide-icons/lucide/icons/award.svg", "repo_id": "lucide-icons/lucide", "token_count": 189 }
41
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M3 3h18" /> <path d="M20 7H8" /> <path d="M20 11H8" /> <path d="M10 19h10" /> <path d="M8 15h12" /> <path d="M4 3v14" /> <circle cx="4" cy="19" r="2" /> </svg>
lucide-icons/lucide/icons/blinds.svg
{ "file_path": "lucide-icons/lucide/icons/blinds.svg", "repo_id": "lucide-icons/lucide", "token_count": 186 }
42
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <circle cx="11" cy="13" r="9" /> <path d="M14.35 4.65 16.3 2.7a2.41 2.41 0 0 1 3.4 0l1.6 1.6a2.4 2.4 0 0 1 0 3.4l-1.95 1.95" /> <path d="m22 2-1.5 1.5" /> </svg>
lucide-icons/lucide/icons/bomb.svg
{ "file_path": "lucide-icons/lucide/icons/bomb.svg", "repo_id": "lucide-icons/lucide", "token_count": 190 }
43
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588 4 4 0 0 0 7.636 2.106 3.2 3.2 0 0 0 .164-.546c.028-.13.306-.13.335 0a3.2 3.2 0 0 0 .163.546 4 4 0 0 0 7.636-2.106 4 4 0 0 0 .556-6.588 4 4 0 0 0-2.526-5.77A3 3 0 1 0 12 5" /> <path d="M17.599 6.5a3 3 0 0 0 .399-1.375" /> <path d="M6.003 5.125A3 3 0 0 0 6.401 6.5" /> <path d="M3.477 10.896a4 4 0 0 1 .585-.396" /> <path d="M19.938 10.5a4 4 0 0 1 .585.396" /> <path d="M6 18a4 4 0 0 1-1.967-.516" /> <path d="M19.967 17.484A4 4 0 0 1 18 18" /> <circle cx="12" cy="12" r="3" /> <path d="m15.7 10.4-.9.4" /> <path d="m9.2 13.2-.9.4" /> <path d="m13.6 15.7-.4-.9" /> <path d="m10.8 9.2-.4-.9" /> <path d="m15.7 13.5-.9-.4" /> <path d="m9.2 10.9-.9-.4" /> <path d="m10.5 15.7.4-.9" /> <path d="m13.1 9.2.4-.9" /> </svg>
lucide-icons/lucide/icons/brain-cog.svg
{ "file_path": "lucide-icons/lucide/icons/brain-cog.svg", "repo_id": "lucide-icons/lucide", "token_count": 554 }
44
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <line x1="2" x2="22" y1="2" y2="22" /> <path d="M7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16" /> <path d="M9.5 4h5L17 7h3a2 2 0 0 1 2 2v7.5" /> <path d="M14.121 15.121A3 3 0 1 1 9.88 10.88" /> </svg>
lucide-icons/lucide/icons/camera-off.svg
{ "file_path": "lucide-icons/lucide/icons/camera-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 209 }
45
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8" /> <path d="M7 14h.01" /> <path d="M17 14h.01" /> <rect width="18" height="8" x="3" y="10" rx="2" /> <path d="M5 18v2" /> <path d="M19 18v2" /> </svg>
lucide-icons/lucide/icons/car-front.svg
{ "file_path": "lucide-icons/lucide/icons/car-front.svg", "repo_id": "lucide-icons/lucide", "token_count": 226 }
46
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <rect width="20" height="16" x="2" y="4" rx="2" /> <circle cx="8" cy="10" r="2" /> <path d="M8 12h8" /> <circle cx="16" cy="10" r="2" /> <path d="m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3" /> </svg>
lucide-icons/lucide/icons/cassette-tape.svg
{ "file_path": "lucide-icons/lucide/icons/cassette-tape.svg", "repo_id": "lucide-icons/lucide", "token_count": 217 }
47
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M3 3v16a2 2 0 0 0 2 2h16" /> <path d="M18 17V9" /> <path d="M13 17V5" /> <path d="M8 17v-3" /> </svg>
lucide-icons/lucide/icons/chart-column.svg
{ "file_path": "lucide-icons/lucide/icons/chart-column.svg", "repo_id": "lucide-icons/lucide", "token_count": 154 }
48
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M10 9h4" /> <path d="M12 7v5" /> <path d="M14 22v-4a2 2 0 0 0-4 0v4" /> <path d="M18 22V5.618a1 1 0 0 0-.553-.894l-4.553-2.277a2 2 0 0 0-1.788 0L6.553 4.724A1 1 0 0 0 6 5.618V22" /> <path d="m18 7 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.618a1 1 0 0 1 .553-.894L6 7" /> </svg>
lucide-icons/lucide/icons/church.svg
{ "file_path": "lucide-icons/lucide/icons/church.svg", "repo_id": "lucide-icons/lucide", "token_count": 279 }
49
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <circle cx="12" cy="12" r="10" /> <rect x="9" y="9" width="6" height="6" rx="1" /> </svg>
lucide-icons/lucide/icons/circle-stop.svg
{ "file_path": "lucide-icons/lucide/icons/circle-stop.svg", "repo_id": "lucide-icons/lucide", "token_count": 134 }
50
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M10 18H5a3 3 0 0 1-3-3v-1" /> <path d="M14 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2" /> <path d="M20 2a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2" /> <path d="m7 21 3-3-3-3" /> <rect x="14" y="14" width="8" height="8" rx="2" /> <rect x="2" y="2" width="8" height="8" rx="2" /> </svg>
lucide-icons/lucide/icons/combine.svg
{ "file_path": "lucide-icons/lucide/icons/combine.svg", "repo_id": "lucide-icons/lucide", "token_count": 247 }
51
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <polyline points="14 15 9 20 4 15" /> <path d="M20 4h-7a4 4 0 0 0-4 4v12" /> </svg>
lucide-icons/lucide/icons/corner-left-down.svg
{ "file_path": "lucide-icons/lucide/icons/corner-left-down.svg", "repo_id": "lucide-icons/lucide", "token_count": 131 }
52
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M21.54 15H17a2 2 0 0 0-2 2v4.54" /> <path d="M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17" /> <path d="M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05" /> <circle cx="12" cy="12" r="10" /> </svg>
lucide-icons/lucide/icons/earth.svg
{ "file_path": "lucide-icons/lucide/icons/earth.svg", "repo_id": "lucide-icons/lucide", "token_count": 255 }
53
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z" /> </svg>
lucide-icons/lucide/icons/facebook.svg
{ "file_path": "lucide-icons/lucide/icons/facebook.svg", "repo_id": "lucide-icons/lucide", "token_count": 152 }
54
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M14 2v4a2 2 0 0 0 2 2h4" /> <path d="m3.2 12.9-.9-.4" /> <path d="m3.2 15.1-.9.4" /> <path d="M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5" /> <path d="m4.9 11.2-.4-.9" /> <path d="m4.9 16.8-.4.9" /> <path d="m7.5 10.3-.4.9" /> <path d="m7.5 17.7-.4-.9" /> <path d="m9.7 12.5-.9.4" /> <path d="m9.7 15.5-.9-.4" /> <circle cx="6" cy="14" r="3" /> </svg>
lucide-icons/lucide/icons/file-cog.svg
{ "file_path": "lucide-icons/lucide/icons/file-cog.svg", "repo_id": "lucide-icons/lucide", "token_count": 342 }
55
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m6 14 1.45-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2" /> <circle cx="14" cy="15" r="1" /> </svg>
lucide-icons/lucide/icons/folder-open-dot.svg
{ "file_path": "lucide-icons/lucide/icons/folder-open-dot.svg", "repo_id": "lucide-icons/lucide", "token_count": 240 }
56
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M12 12H5a2 2 0 0 0-2 2v5" /> <circle cx="13" cy="19" r="2" /> <circle cx="5" cy="19" r="2" /> <path d="M8 19h3m5-17v17h6M6 12V7c0-1.1.9-2 2-2h3l5 5" /> </svg>
lucide-icons/lucide/icons/forklift.svg
{ "file_path": "lucide-icons/lucide/icons/forklift.svg", "repo_id": "lucide-icons/lucide", "token_count": 193 }
57
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <circle cx="18" cy="18" r="3" /> <circle cx="6" cy="6" r="3" /> <path d="M18 6V5" /> <path d="M18 11v-1" /> <line x1="6" x2="6" y1="9" y2="21" /> </svg>
lucide-icons/lucide/icons/git-pull-request-draft.svg
{ "file_path": "lucide-icons/lucide/icons/git-pull-request-draft.svg", "repo_id": "lucide-icons/lucide", "token_count": 177 }
58
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17" /> <path d="m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9" /> <path d="m2 16 6 6" /> <circle cx="16" cy="9" r="2.9" /> <circle cx="6" cy="5" r="3" /> </svg>
lucide-icons/lucide/icons/hand-coins.svg
{ "file_path": "lucide-icons/lucide/icons/hand-coins.svg", "repo_id": "lucide-icons/lucide", "token_count": 265 }
59
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M4 12h8" /> <path d="M4 18V6" /> <path d="M12 18V6" /> <path d="M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" /> <path d="M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" /> </svg>
lucide-icons/lucide/icons/heading-3.svg
{ "file_path": "lucide-icons/lucide/icons/heading-3.svg", "repo_id": "lucide-icons/lucide", "token_count": 206 }
60
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z" /> <path d="m12 13-1-1 2-2-3-3 2-2" /> </svg>
lucide-icons/lucide/icons/heart-crack.svg
{ "file_path": "lucide-icons/lucide/icons/heart-crack.svg", "repo_id": "lucide-icons/lucide", "token_count": 227 }
61
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M16 5h6" /> <path d="M19 2v6" /> <path d="M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5" /> <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" /> <circle cx="9" cy="9" r="2" /> </svg>
lucide-icons/lucide/icons/image-plus.svg
{ "file_path": "lucide-icons/lucide/icons/image-plus.svg", "repo_id": "lucide-icons/lucide", "token_count": 221 }
62
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M12 9.5V21m0-11.5L6 3m6 6.5L18 3" /> <path d="M6 15h12" /> <path d="M6 11h12" /> </svg>
lucide-icons/lucide/icons/japanese-yen.svg
{ "file_path": "lucide-icons/lucide/icons/japanese-yen.svg", "repo_id": "lucide-icons/lucide", "token_count": 149 }
63
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <line x1="3" x2="21" y1="22" y2="22" /> <line x1="6" x2="6" y1="18" y2="11" /> <line x1="10" x2="10" y1="18" y2="11" /> <line x1="14" x2="14" y1="18" y2="11" /> <line x1="18" x2="18" y1="18" y2="11" /> <polygon points="12 2 20 7 4 7" /> </svg>
lucide-icons/lucide/icons/landmark.svg
{ "file_path": "lucide-icons/lucide/icons/landmark.svg", "repo_id": "lucide-icons/lucide", "token_count": 231 }
64
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z" /> <path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12" /> </svg>
lucide-icons/lucide/icons/leaf.svg
{ "file_path": "lucide-icons/lucide/icons/leaf.svg", "repo_id": "lucide-icons/lucide", "token_count": 185 }
65
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5" /> <path d="m2 2 20 20" /> <path d="M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5" /> <path d="M9 18h6" /> <path d="M10 22h4" /> </svg>
lucide-icons/lucide/icons/lightbulb-off.svg
{ "file_path": "lucide-icons/lucide/icons/lightbulb-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 222 }
66
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m3 10 2.5-2.5L3 5" /> <path d="m3 19 2.5-2.5L3 14" /> <path d="M10 6h11" /> <path d="M10 12h11" /> <path d="M10 18h11" /> </svg>
lucide-icons/lucide/icons/list-collapse.svg
{ "file_path": "lucide-icons/lucide/icons/list-collapse.svg", "repo_id": "lucide-icons/lucide", "token_count": 172 }
67
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" /> <polyline points="10 17 15 12 10 7" /> <line x1="15" x2="3" y1="12" y2="12" /> </svg>
lucide-icons/lucide/icons/log-in.svg
{ "file_path": "lucide-icons/lucide/icons/log-in.svg", "repo_id": "lucide-icons/lucide", "token_count": 166 }
68
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z" /> <path d="m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10" /> </svg>
lucide-icons/lucide/icons/mail-open.svg
{ "file_path": "lucide-icons/lucide/icons/mail-open.svg", "repo_id": "lucide-icons/lucide", "token_count": 211 }
69
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M6 18h8" /> <path d="M3 22h18" /> <path d="M14 22a7 7 0 1 0 0-14h-1" /> <path d="M9 14h2" /> <path d="M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z" /> <path d="M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3" /> </svg>
lucide-icons/lucide/icons/microscope.svg
{ "file_path": "lucide-icons/lucide/icons/microscope.svg", "repo_id": "lucide-icons/lucide", "token_count": 226 }
70
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M5.5 20H8" /> <path d="M17 9h.01" /> <rect width="10" height="16" x="12" y="4" rx="2" /> <path d="M8 6H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h4" /> <circle cx="17" cy="15" r="1" /> </svg>
lucide-icons/lucide/icons/monitor-speaker.svg
{ "file_path": "lucide-icons/lucide/icons/monitor-speaker.svg", "repo_id": "lucide-icons/lucide", "token_count": 197 }
71
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2V5z" /> <path d="M2 9v1c0 1.1.9 2 2 2h1" /> <path d="M16 11h.01" /> </svg>
lucide-icons/lucide/icons/piggy-bank.svg
{ "file_path": "lucide-icons/lucide/icons/piggy-bank.svg", "repo_id": "lucide-icons/lucide", "token_count": 235 }
72
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m2 22 1-1h3l9-9" /> <path d="M3 21v-3l9-9" /> <path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" /> </svg>
lucide-icons/lucide/icons/pipette.svg
{ "file_path": "lucide-icons/lucide/icons/pipette.svg", "repo_id": "lucide-icons/lucide", "token_count": 208 }
73
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M18.6 14.4c.8-.8.8-2 0-2.8l-8.1-8.1a4.95 4.95 0 1 0-7.1 7.1l8.1 8.1c.9.7 2.1.7 2.9-.1Z" /> <path d="m22 22-5.5-5.5" /> </svg>
lucide-icons/lucide/icons/popsicle.svg
{ "file_path": "lucide-icons/lucide/icons/popsicle.svg", "repo_id": "lucide-icons/lucide", "token_count": 188 }
74
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M13 13H8a1 1 0 0 0-1 1v7" /> <path d="M14 8h1" /> <path d="M17 21v-4" /> <path d="m2 2 20 20" /> <path d="M20.41 20.41A2 2 0 0 1 19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 .59-1.41" /> <path d="M29.5 11.5s5 5 4 5" /> <path d="M9 3h6.2a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V15" /> </svg>
lucide-icons/lucide/icons/save-off.svg
{ "file_path": "lucide-icons/lucide/icons/save-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 270 }
75
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z" /> <path d="M3 6h18" /> <path d="M16 10a4 4 0 0 1-8 0" /> </svg>
lucide-icons/lucide/icons/shopping-bag.svg
{ "file_path": "lucide-icons/lucide/icons/shopping-bag.svg", "repo_id": "lucide-icons/lucide", "token_count": 166 }
76
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2" /> </svg>
lucide-icons/lucide/icons/sigma.svg
{ "file_path": "lucide-icons/lucide/icons/sigma.svg", "repo_id": "lucide-icons/lucide", "token_count": 177 }
77
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <line x1="2" x2="22" y1="12" y2="12" /> <line x1="12" x2="12" y1="2" y2="22" /> <path d="m20 16-4-4 4-4" /> <path d="m4 8 4 4-4 4" /> <path d="m16 4-4 4-4-4" /> <path d="m8 20 4-4 4 4" /> </svg>
lucide-icons/lucide/icons/snowflake.svg
{ "file_path": "lucide-icons/lucide/icons/snowflake.svg", "repo_id": "lucide-icons/lucide", "token_count": 209 }
78
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20" /> <path d="M19.8 17.8a7.5 7.5 0 0 0 .003-10.603" /> <path d="M17 15a3.5 3.5 0 0 0-.025-4.975" /> </svg>
lucide-icons/lucide/icons/speech.svg
{ "file_path": "lucide-icons/lucide/icons/speech.svg", "repo_id": "lucide-icons/lucide", "token_count": 241 }
79
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m4.5 8 10.58-5.06a1 1 0 0 1 1.342.488L18.5 8" /> <path d="M6 10V8" /> <path d="M6 14v1" /> <path d="M6 19v2" /> <rect x="2" y="8" width="20" height="13" rx="2" /> </svg>
lucide-icons/lucide/icons/tickets.svg
{ "file_path": "lucide-icons/lucide/icons/tickets.svg", "repo_id": "lucide-icons/lucide", "token_count": 192 }
80
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M4 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16" /> <path d="M2 14h12" /> <path d="M22 14h-2" /> <path d="M12 20v-6" /> <path d="m2 2 20 20" /> <path d="M22 16V6a2 2 0 0 0-2-2H10" /> </svg>
lucide-icons/lucide/icons/touchpad-off.svg
{ "file_path": "lucide-icons/lucide/icons/touchpad-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 202 }
81
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <rect width="18" height="18" x="3" y="3" rx="2" ry="2" /> <rect width="3" height="9" x="7" y="7" /> <rect width="3" height="5" x="14" y="7" /> </svg>
lucide-icons/lucide/icons/trello.svg
{ "file_path": "lucide-icons/lucide/icons/trello.svg", "repo_id": "lucide-icons/lucide", "token_count": 164 }
82
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M2 12a5 5 0 0 0 5 5 8 8 0 0 1 5 2 8 8 0 0 1 5-2 5 5 0 0 0 5-5V7h-5a8 8 0 0 0-5 2 8 8 0 0 0-5-2H2Z" /> <path d="M6 11c1.5 0 3 .5 3 2-2 0-3 0-3-2Z" /> <path d="M18 11c-1.5 0-3 .5-3 2 2 0 3 0 3-2Z" /> </svg>
lucide-icons/lucide/icons/venetian-mask.svg
{ "file_path": "lucide-icons/lucide/icons/venetian-mask.svg", "repo_id": "lucide-icons/lucide", "token_count": 223 }
83
/** @deprecated Use the injection token LUCIDE_ICONS instead. Will be removed in v1.0. */ export class Icons { constructor(private icons: object) {} }
lucide-icons/lucide/packages/lucide-angular/src/lib/icons.provider.ts
{ "file_path": "lucide-icons/lucide/packages/lucide-angular/src/lib/icons.provider.ts", "repo_id": "lucide-icons/lucide", "token_count": 45 }
84
import { h, toChildArray } from 'preact'; import defaultAttributes from './defaultAttributes'; import type { IconNode, LucideProps } from './types'; interface IconComponentProps extends LucideProps { iconNode: IconNode; } /** * Lucide icon component * * @component Icon * @param {object} props * @param {string} props.color - The color of the icon * @param {number} props.size - The size of the icon * @param {number} props.strokeWidth - The stroke width of the icon * @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width * @param {string} props.class - The class name of the icon * @param {IconNode} props.children - The children of the icon * @param {IconNode} props.iconNode - The icon node of the icon * * @returns {ForwardRefExoticComponent} LucideIcon */ const Icon = ({ color = 'currentColor', size = 24, strokeWidth = 2, absoluteStrokeWidth, children, iconNode, class: classes = '', ...rest }: IconComponentProps) => h( 'svg', { ...defaultAttributes, width: String(size), height: size, stroke: color, ['stroke-width' as 'strokeWidth']: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth, class: ['lucide', classes].join(' '), ...rest, }, [...iconNode.map(([tag, attrs]) => h(tag, attrs)), ...toChildArray(children)], ); export default Icon;
lucide-icons/lucide/packages/lucide-preact/src/Icon.ts
{ "file_path": "lucide-icons/lucide/packages/lucide-preact/src/Icon.ts", "repo_id": "lucide-icons/lucide", "token_count": 486 }
85
import '@testing-library/jest-dom'; import { expect, afterEach } from 'vitest'; import { cleanup } from '@testing-library/react'; import '@testing-library/jest-dom/vitest'; import htmlSerializer from 'jest-serializer-html'; expect.addSnapshotSerializer(htmlSerializer); afterEach(() => { cleanup(); });
lucide-icons/lucide/packages/lucide-react-native/tests/setupVitest.js
{ "file_path": "lucide-icons/lucide/packages/lucide-react-native/tests/setupVitest.js", "repo_id": "lucide-icons/lucide", "token_count": 102 }
86
import { JSX } from 'solid-js/jsx-runtime'; import { SVGAttributes } from './types'; const defaultAttributes: SVGAttributes = { xmlns: 'http://www.w3.org/2000/svg', width: 24, height: 24, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'stroke-width': 2, 'stroke-linecap': 'round', 'stroke-linejoin': 'round', }; export default defaultAttributes;
lucide-icons/lucide/packages/lucide-solid/src/defaultAttributes.ts
{ "file_path": "lucide-icons/lucide/packages/lucide-solid/src/defaultAttributes.ts", "repo_id": "lucide-icons/lucide", "token_count": 136 }
87
import plugins from '@lucide/rollup-plugins'; import dts from 'rollup-plugin-dts'; import pkg from './package.json' assert { type: 'json' }; const outputFileName = pkg.name; const outputDir = 'dist'; const inputs = ['src/lucide-static.ts']; const bundles = [ { format: 'cjs', inputs, outputDir, }, { format: 'esm', inputs, outputDir, preserveModules: true, }, ]; const configs = bundles .map(({ inputs, outputDir, format, minify, preserveModules }) => inputs.map((input) => ({ input, plugins: plugins({ pkg, minify }), output: { name: outputFileName, ...(preserveModules ? { dir: `${outputDir}/${format}`, } : { file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`, }), format, sourcemap: true, preserveModules, }, })), ) .flat(); const typesFileConfig = { input: inputs[0], output: [ { file: `${outputDir}/${outputFileName}.d.ts`, format: 'esm', }, ], plugins: [ dts({ include: ['src'], }), ], }; export default [...configs, typesFileConfig];
lucide-icons/lucide/packages/lucide-static/rollup.config.mjs
{ "file_path": "lucide-icons/lucide/packages/lucide-static/rollup.config.mjs", "repo_id": "lucide-icons/lucide", "token_count": 552 }
88
import type { Attrs } from './types.js'; const defaultAttributes: Attrs = { xmlns: 'http://www.w3.org/2000/svg', width: 24, height: 24, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', 'stroke-width': 2, 'stroke-linecap': 'round', 'stroke-linejoin': 'round', }; export default defaultAttributes;
lucide-icons/lucide/packages/lucide-svelte/src/defaultAttributes.ts
{ "file_path": "lucide-icons/lucide/packages/lucide-svelte/src/defaultAttributes.ts", "repo_id": "lucide-icons/lucide", "token_count": 122 }
89
import plugins, { replace } from '@lucide/rollup-plugins'; import pkg from './package.json' assert { type: 'json' }; import dts from 'rollup-plugin-dts'; const packageName = 'LucideVueNext'; const outputFileName = 'lucide-vue-next'; const outputDir = 'dist'; const inputs = ['src/lucide-vue-next.ts']; const bundles = [ { format: 'umd', inputs, outputDir, minify: true, }, { format: 'umd', inputs, outputDir, }, { format: 'cjs', inputs, outputDir, }, { format: 'esm', inputs, outputDir, preserveModules: true, }, ]; const configs = bundles .map(({ inputs, outputDir, format, minify, preserveModules }) => inputs.map((input) => ({ input, plugins: plugins({ pkg, minify }), external: ['vue'], output: { name: packageName, ...(preserveModules ? { dir: `${outputDir}/${format}`, } : { file: `${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`, }), format, preserveModules, preserveModulesRoot: 'src', sourcemap: true, globals: { vue: 'vue', }, }, })), ) .flat(); export default [ { input: inputs[0], output: [ { file: `dist/${outputFileName}.d.ts`, format: 'es', }, ], plugins: [ dts({ compilerOptions: { preserveSymlinks: false, }, }), ], }, ...configs, ];
lucide-icons/lucide/packages/lucide-vue-next/rollup.config.mjs
{ "file_path": "lucide-icons/lucide/packages/lucide-vue-next/rollup.config.mjs", "repo_id": "lucide-icons/lucide", "token_count": 749 }
90
import { expect } from 'vitest'; import '@testing-library/jest-dom/vitest'; import htmlSerializer from 'jest-serializer-html'; expect.addSnapshotSerializer(htmlSerializer);
lucide-icons/lucide/packages/lucide/tests/setupVitest.js
{ "file_path": "lucide-icons/lucide/packages/lucide/tests/setupVitest.js", "repo_id": "lucide-icons/lucide", "token_count": 58 }
91
import path from 'path'; import { promises as fs } from 'fs'; import { getCurrentDirPath, readSvgDirectory } from '../tools/build-helpers/helpers.mjs'; // This is a special case convertion NextJS uses for their modularize imports. We try to follow the same convention, to generate the same imports. function pascalToKebabNextJSFlavour(str) { return str .replace(/([a-z])([A-Z])/g, '$1-$2') .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2') .replace(/([a-z])-?([0-9]+|[A-Z])/g, '$1-$2') .replace(/([0-9]+)-?([a-zA-Z])/g, '$1-$2') .replace(/([0-9])-([0-9])/g, '$1$2') .split('-') .map((word) => word.toLowerCase()) .join('-'); } const currentDir = getCurrentDirPath(import.meta.url); const ICONS_DIR = path.resolve(currentDir, '../icons'); const svgFiles = readSvgDirectory(ICONS_DIR); const iconNames = svgFiles.map((icon) => icon.split('.')[0]).reverse(); console.log('Creating aliases for NextJS imports: '); Promise.all( iconNames.map(async (iconName) => { const pascalCaseName = iconName.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); const iconNameKebabCaseNextjsFlavour = pascalToKebabNextJSFlavour(pascalCaseName); if (iconName !== iconNameKebabCaseNextjsFlavour) { console.log(iconName, '', iconNameKebabCaseNextjsFlavour); const metaJson = await fs.readFile(path.resolve(ICONS_DIR, `${iconName}.json`), 'utf-8'); const iconMetaData = JSON.parse(metaJson); const aliases = iconMetaData.aliases ?? []; if (!aliases.includes(iconNameKebabCaseNextjsFlavour)) { aliases.push(iconNameKebabCaseNextjsFlavour); } const output = JSON.stringify({ ...iconMetaData, aliases }, null, 2); fs.writeFile(path.resolve(ICONS_DIR, `${iconName}.json`), output, 'utf-8'); } }), );
lucide-icons/lucide/scripts/generateNextJSAliases.mjs
{ "file_path": "lucide-icons/lucide/scripts/generateNextJSAliases.mjs", "repo_id": "lucide-icons/lucide", "token_count": 727 }
92
/* eslint-disable import/prefer-default-export */ import fs from 'fs'; import path from 'path'; /** * Resets the file contents. * * @param {string} fileName * @param {string} outputDirectory */ export const resetFile = (fileName, outputDirectory) => fs.writeFileSync(path.join(outputDirectory, fileName), '', 'utf-8');
lucide-icons/lucide/tools/build-helpers/src/resetFile.mjs
{ "file_path": "lucide-icons/lucide/tools/build-helpers/src/resetFile.mjs", "repo_id": "lucide-icons/lucide", "token_count": 102 }
93
import { getProjectById } from "../action"; import TabSections from "./tab-sections"; export default async function SingleProject({ params, }: { params: { projectId: string }; }) { const { projectId } = params; const project = await getProjectById(projectId); return <TabSections project={project} />; }
moinulmoin/chadnext/src/app/[locale]/dashboard/projects/[projectId]/page.tsx
{ "file_path": "moinulmoin/chadnext/src/app/[locale]/dashboard/projects/[projectId]/page.tsx", "repo_id": "moinulmoin/chadnext", "token_count": 93 }
94