text
stringlengths
21
253k
id
stringlengths
25
123
metadata
dict
__index_level_0__
int64
0
181
"use client" import { zodResolver } from "@hookform/resolvers/zod" import { ChevronDownIcon } from "@radix-ui/react-icons" import { useForm } from "react-hook-form" import { z } from "zod" import { cn } from "@/lib/utils" import { toast } from "@/registry/new-york/hooks/use-toast" import { Button, buttonVariants } from "@/registry/new-york/ui/button" import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from "@/registry/new-york/ui/form" import { RadioGroup, RadioGroupItem } from "@/registry/new-york/ui/radio-group" const appearanceFormSchema = z.object({ theme: z.enum(["light", "dark"], { required_error: "Please select a theme.", }), font: z.enum(["inter", "manrope", "system"], { invalid_type_error: "Select a font", required_error: "Please select a font.", }), }) type AppearanceFormValues = z.infer<typeof appearanceFormSchema> // This can come from your database or API. const defaultValues: Partial<AppearanceFormValues> = { theme: "light", } export function AppearanceForm() { const form = useForm<AppearanceFormValues>({ resolver: zodResolver(appearanceFormSchema), defaultValues, }) function onSubmit(data: AppearanceFormValues) { toast({ title: "You submitted the following values:", description: ( <pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4"> <code className="text-white">{JSON.stringify(data, null, 2)}</code> </pre> ), }) } return ( <Form {...form}> <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8"> <FormField control={form.control} name="font" render={({ field }) => ( <FormItem> <FormLabel>Font</FormLabel> <div className="relative w-max"> <FormControl> <select className={cn( buttonVariants({ variant: "outline" }), "w-[200px] appearance-none font-normal" )} {...field} > <option value="inter">Inter</option> <option value="manrope">Manrope</option> <option value="system">System</option> </select> </FormControl> <ChevronDownIcon className="absolute right-3 top-2.5 h-4 w-4 opacity-50" /> </div> <FormDescription> Set the font you want to use in the dashboard. </FormDescription> <FormMessage /> </FormItem> )} /> <FormField control={form.control} name="theme" render={({ field }) => ( <FormItem className="space-y-1"> <FormLabel>Theme</FormLabel> <FormDescription> Select the theme for the dashboard. </FormDescription> <FormMessage /> <RadioGroup onValueChange={field.onChange} defaultValue={field.value} className="grid max-w-md grid-cols-2 gap-8 pt-2" > <FormItem> <FormLabel className="[&:has([data-state=checked])>div]:border-primary"> <FormControl> <RadioGroupItem value="light" className="sr-only" /> </FormControl> <div className="items-center rounded-md border-2 border-muted p-1 hover:border-accent"> <div className="space-y-2 rounded-sm bg-[#ecedef] p-2"> <div className="space-y-2 rounded-md bg-white p-2 shadow-sm"> <div className="h-2 w-[80px] rounded-lg bg-[#ecedef]" /> <div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" /> </div> <div className="flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm"> <div className="h-4 w-4 rounded-full bg-[#ecedef]" /> <div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" /> </div> <div className="flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm"> <div className="h-4 w-4 rounded-full bg-[#ecedef]" /> <div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" /> </div> </div> </div> <span className="block w-full p-2 text-center font-normal"> Light </span> </FormLabel> </FormItem> <FormItem> <FormLabel className="[&:has([data-state=checked])>div]:border-primary"> <FormControl> <RadioGroupItem value="dark" className="sr-only" /> </FormControl> <div className="items-center rounded-md border-2 border-muted bg-popover p-1 hover:bg-accent hover:text-accent-foreground"> <div className="space-y-2 rounded-sm bg-slate-950 p-2"> <div className="space-y-2 rounded-md bg-slate-800 p-2 shadow-sm"> <div className="h-2 w-[80px] rounded-lg bg-slate-400" /> <div className="h-2 w-[100px] rounded-lg bg-slate-400" /> </div> <div className="flex items-center space-x-2 rounded-md bg-slate-800 p-2 shadow-sm"> <div className="h-4 w-4 rounded-full bg-slate-400" /> <div className="h-2 w-[100px] rounded-lg bg-slate-400" /> </div> <div className="flex items-center space-x-2 rounded-md bg-slate-800 p-2 shadow-sm"> <div className="h-4 w-4 rounded-full bg-slate-400" /> <div className="h-2 w-[100px] rounded-lg bg-slate-400" /> </div> </div> </div> <span className="block w-full p-2 text-center font-normal"> Dark </span> </FormLabel> </FormItem> </RadioGroup> </FormItem> )} /> <Button type="submit">Update preferences</Button> </form> </Form> ) }
shadcn-ui/ui/apps/www/app/(app)/examples/forms/appearance/appearance-form.tsx
{ "file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/forms/appearance/appearance-form.tsx", "repo_id": "shadcn-ui/ui", "token_count": 3561 }
60
export const mails = [ { id: "6c84fb90-12c4-11e1-840d-7b25c5ee775a", name: "William Smith", email: "[email protected]", subject: "Meeting Tomorrow", text: "Hi, let's have a meeting tomorrow to discuss the project. I've been reviewing the project details and have some ideas I'd like to share. It's crucial that we align on our next steps to ensure the project's success.\n\nPlease come prepared with any questions or insights you may have. Looking forward to our meeting!\n\nBest regards, William", date: "2023-10-22T09:00:00", read: true, labels: ["meeting", "work", "important"], }, { id: "110e8400-e29b-11d4-a716-446655440000", name: "Alice Smith", email: "[email protected]", subject: "Re: Project Update", text: "Thank you for the project update. It looks great! I've gone through the report, and the progress is impressive. The team has done a fantastic job, and I appreciate the hard work everyone has put in.\n\nI have a few minor suggestions that I'll include in the attached document.\n\nLet's discuss these during our next meeting. Keep up the excellent work!\n\nBest regards, Alice", date: "2023-10-22T10:30:00", read: true, labels: ["work", "important"], }, { id: "3e7c3f6d-bdf5-46ae-8d90-171300f27ae2", name: "Bob Johnson", email: "[email protected]", subject: "Weekend Plans", text: "Any plans for the weekend? I was thinking of going hiking in the nearby mountains. It's been a while since we had some outdoor fun.\n\nIf you're interested, let me know, and we can plan the details. It'll be a great way to unwind and enjoy nature.\n\nLooking forward to your response!\n\nBest, Bob", date: "2023-04-10T11:45:00", read: true, labels: ["personal"], }, { id: "61c35085-72d7-42b4-8d62-738f700d4b92", name: "Emily Davis", email: "[email protected]", subject: "Re: Question about Budget", text: "I have a question about the budget for the upcoming project. It seems like there's a discrepancy in the allocation of resources.\n\nI've reviewed the budget report and identified a few areas where we might be able to optimize our spending without compromising the project's quality.\n\nI've attached a detailed analysis for your reference. Let's discuss this further in our next meeting.\n\nThanks, Emily", date: "2023-03-25T13:15:00", read: false, labels: ["work", "budget"], }, { id: "8f7b5db9-d935-4e42-8e05-1f1d0a3dfb97", name: "Michael Wilson", email: "[email protected]", subject: "Important Announcement", text: "I have an important announcement to make during our team meeting. It pertains to a strategic shift in our approach to the upcoming product launch. We've received valuable feedback from our beta testers, and I believe it's time to make some adjustments to better meet our customers' needs.\n\nThis change is crucial to our success, and I look forward to discussing it with the team. Please be prepared to share your insights during the meeting.\n\nRegards, Michael", date: "2023-03-10T15:00:00", read: false, labels: ["meeting", "work", "important"], }, { id: "1f0f2c02-e299-40de-9b1d-86ef9e42126b", name: "Sarah Brown", email: "[email protected]", subject: "Re: Feedback on Proposal", text: "Thank you for your feedback on the proposal. It looks great! I'm pleased to hear that you found it promising. The team worked diligently to address all the key points you raised, and I believe we now have a strong foundation for the project.\n\nI've attached the revised proposal for your review.\n\nPlease let me know if you have any further comments or suggestions. Looking forward to your response.\n\nBest regards, Sarah", date: "2023-02-15T16:30:00", read: true, labels: ["work"], }, { id: "17c0a96d-4415-42b1-8b4f-764efab57f66", name: "David Lee", email: "[email protected]", subject: "New Project Idea", text: "I have an exciting new project idea to discuss with you. It involves expanding our services to target a niche market that has shown considerable growth in recent months.\n\nI've prepared a detailed proposal outlining the potential benefits and the strategy for execution.\n\nThis project has the potential to significantly impact our business positively. Let's set up a meeting to dive into the details and determine if it aligns with our current goals.\n\nBest regards, David", date: "2023-01-28T17:45:00", read: false, labels: ["meeting", "work", "important"], }, { id: "2f0130cb-39fc-44c4-bb3c-0a4337edaaab", name: "Olivia Wilson", email: "[email protected]", subject: "Vacation Plans", text: "Let's plan our vacation for next month. What do you think? I've been thinking of visiting a tropical paradise, and I've put together some destination options.\n\nI believe it's time for us to unwind and recharge. Please take a look at the options and let me know your preferences.\n\nWe can start making arrangements to ensure a smooth and enjoyable trip.\n\nExcited to hear your thoughts! Olivia", date: "2022-12-20T18:30:00", read: true, labels: ["personal"], }, { id: "de305d54-75b4-431b-adb2-eb6b9e546014", name: "James Martin", email: "[email protected]", subject: "Re: Conference Registration", text: "I've completed the registration for the conference next month. The event promises to be a great networking opportunity, and I'm looking forward to attending the various sessions and connecting with industry experts.\n\nI've also attached the conference schedule for your reference.\n\nIf there are any specific topics or sessions you'd like me to explore, please let me know. It's an exciting event, and I'll make the most of it.\n\nBest regards, James", date: "2022-11-30T19:15:00", read: true, labels: ["work", "conference"], }, { id: "7dd90c63-00f6-40f3-bd87-5060a24e8ee7", name: "Sophia White", email: "[email protected]", subject: "Team Dinner", text: "Let's have a team dinner next week to celebrate our success. We've achieved some significant milestones, and it's time to acknowledge our hard work and dedication.\n\nI've made reservations at a lovely restaurant, and I'm sure it'll be an enjoyable evening.\n\nPlease confirm your availability and any dietary preferences. Looking forward to a fun and memorable dinner with the team!\n\nBest, Sophia", date: "2022-11-05T20:30:00", read: false, labels: ["meeting", "work"], }, { id: "99a88f78-3eb4-4d87-87b7-7b15a49a0a05", name: "Daniel Johnson", email: "[email protected]", subject: "Feedback Request", text: "I'd like your feedback on the latest project deliverables. We've made significant progress, and I value your input to ensure we're on the right track.\n\nI've attached the deliverables for your review, and I'm particularly interested in any areas where you think we can further enhance the quality or efficiency.\n\nYour feedback is invaluable, and I appreciate your time and expertise. Let's work together to make this project a success.\n\nRegards, Daniel", date: "2022-10-22T09:30:00", read: false, labels: ["work"], }, { id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Ava Taylor", email: "[email protected]", subject: "Re: Meeting Agenda", text: "Here's the agenda for our meeting next week. I've included all the topics we need to cover, as well as time allocations for each.\n\nIf you have any additional items to discuss or any specific points to address, please let me know, and we can integrate them into the agenda.\n\nIt's essential that our meeting is productive and addresses all relevant matters.\n\nLooking forward to our meeting! Ava", date: "2022-10-10T10:45:00", read: true, labels: ["meeting", "work"], }, { id: "c1a0ecb4-2540-49c5-86f8-21e5ce79e4e6", name: "William Anderson", email: "[email protected]", subject: "Product Launch Update", text: "The product launch is on track. I'll provide an update during our call. We've made substantial progress in the development and marketing of our new product.\n\nI'm excited to share the latest updates with you during our upcoming call. It's crucial that we coordinate our efforts to ensure a successful launch. Please come prepared with any questions or insights you may have.\n\nLet's make this product launch a resounding success!\n\nBest regards, William", date: "2022-09-20T12:00:00", read: false, labels: ["meeting", "work", "important"], }, { id: "ba54eefd-4097-4949-99f2-2a9ae4d1a836", name: "Mia Harris", email: "[email protected]", subject: "Re: Travel Itinerary", text: "I've received the travel itinerary. It looks great! Thank you for your prompt assistance in arranging the details. I've reviewed the schedule and the accommodations, and everything seems to be in order. I'm looking forward to the trip, and I'm confident it'll be a smooth and enjoyable experience.\n\nIf there are any specific activities or attractions you recommend at our destination, please feel free to share your suggestions.\n\nExcited for the trip! Mia", date: "2022-09-10T13:15:00", read: true, labels: ["personal", "travel"], }, { id: "df09b6ed-28bd-4e0c-85a9-9320ec5179aa", name: "Ethan Clark", email: "[email protected]", subject: "Team Building Event", text: "Let's plan a team-building event for our department. Team cohesion and morale are vital to our success, and I believe a well-organized team-building event can be incredibly beneficial. I've done some research and have a few ideas for fun and engaging activities.\n\nPlease let me know your thoughts and availability. We want this event to be both enjoyable and productive.\n\nTogether, we'll strengthen our team and boost our performance.\n\nRegards, Ethan", date: "2022-08-25T15:30:00", read: false, labels: ["meeting", "work"], }, { id: "d67c1842-7f8b-4b4b-9be1-1b3b1ab4611d", name: "Chloe Hall", email: "[email protected]", subject: "Re: Budget Approval", text: "The budget has been approved. We can proceed with the project. I'm delighted to inform you that our budget proposal has received the green light from the finance department. This is a significant milestone, and it means we can move forward with the project as planned.\n\nI've attached the finalized budget for your reference. Let's ensure that we stay on track and deliver the project on time and within budget.\n\nIt's an exciting time for us! Chloe", date: "2022-08-10T16:45:00", read: true, labels: ["work", "budget"], }, { id: "6c9a7f94-8329-4d70-95d3-51f68c186ae1", name: "Samuel Turner", email: "[email protected]", subject: "Weekend Hike", text: "Who's up for a weekend hike in the mountains? I've been craving some outdoor adventure, and a hike in the mountains sounds like the perfect escape. If you're up for the challenge, we can explore some scenic trails and enjoy the beauty of nature.\n\nI've done some research and have a few routes in mind.\n\nLet me know if you're interested, and we can plan the details.\n\nIt's sure to be a memorable experience! Samuel", date: "2022-07-28T17:30:00", read: false, labels: ["personal"], }, ] export type Mail = (typeof mails)[number] export const accounts = [ { label: "Alicia Koch", email: "[email protected]", icon: ( <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <title>Vercel</title> <path d="M24 22.525H0l12-21.05 12 21.05z" fill="currentColor" /> </svg> ), }, { label: "Alicia Koch", email: "[email protected]", icon: ( <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <title>Gmail</title> <path d="M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z" fill="currentColor" /> </svg> ), }, { label: "Alicia Koch", email: "[email protected]", icon: ( <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <title>iCloud</title> <path d="M13.762 4.29a6.51 6.51 0 0 0-5.669 3.332 3.571 3.571 0 0 0-1.558-.36 3.571 3.571 0 0 0-3.516 3A4.918 4.918 0 0 0 0 14.796a4.918 4.918 0 0 0 4.92 4.914 4.93 4.93 0 0 0 .617-.045h14.42c2.305-.272 4.041-2.258 4.043-4.589v-.009a4.594 4.594 0 0 0-3.727-4.508 6.51 6.51 0 0 0-6.511-6.27z" fill="currentColor" /> </svg> ), }, ] export type Account = (typeof accounts)[number] export const contacts = [ { name: "Emma Johnson", email: "[email protected]", }, { name: "Liam Wilson", email: "[email protected]", }, { name: "Olivia Davis", email: "[email protected]", }, { name: "Noah Martinez", email: "[email protected]", }, { name: "Ava Taylor", email: "[email protected]", }, { name: "Lucas Brown", email: "[email protected]", }, { name: "Sophia Smith", email: "[email protected]", }, { name: "Ethan Wilson", email: "[email protected]", }, { name: "Isabella Jackson", email: "[email protected]", }, { name: "Mia Clark", email: "[email protected]", }, { name: "Mason Lee", email: "[email protected]", }, { name: "Layla Harris", email: "[email protected]", }, { name: "William Anderson", email: "[email protected]", }, { name: "Ella White", email: "[email protected]", }, { name: "James Thomas", email: "[email protected]", }, { name: "Harper Lewis", email: "[email protected]", }, { name: "Benjamin Moore", email: "[email protected]", }, { name: "Aria Hall", email: "[email protected]", }, { name: "Henry Turner", email: "[email protected]", }, { name: "Scarlett Adams", email: "[email protected]", }, ] export type Contact = (typeof contacts)[number]
shadcn-ui/ui/apps/www/app/(app)/examples/mail/data.tsx
{ "file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/mail/data.tsx", "repo_id": "shadcn-ui/ui", "token_count": 5245 }
61
import { CopyIcon } from "@radix-ui/react-icons" import { Button } from "@/registry/new-york/ui/button" import { Input } from "@/registry/new-york/ui/input" import { Label } from "@/registry/new-york/ui/label" import { Popover, PopoverContent, PopoverTrigger, } from "@/registry/new-york/ui/popover" export function PresetShare() { return ( <Popover> <PopoverTrigger asChild> <Button variant="secondary">Share</Button> </PopoverTrigger> <PopoverContent align="end" className="w-[520px]"> <div className="flex flex-col space-y-2 text-center sm:text-left"> <h3 className="text-lg font-semibold">Share preset</h3> <p className="text-sm text-muted-foreground"> Anyone who has this link and an OpenAI account will be able to view this. </p> </div> <div className="flex items-center space-x-2 pt-4"> <div className="grid flex-1 gap-2"> <Label htmlFor="link" className="sr-only"> Link </Label> <Input id="link" defaultValue="https://platform.openai.com/playground/p/7bbKYQvsVkNmVb8NGcdUOLae?model=text-davinci-003" readOnly className="h-9" /> </div> <Button type="submit" size="sm" className="px-3"> <span className="sr-only">Copy</span> <CopyIcon className="h-4 w-4" /> </Button> </div> </PopoverContent> </Popover> ) }
shadcn-ui/ui/apps/www/app/(app)/examples/playground/components/preset-share.tsx
{ "file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/playground/components/preset-share.tsx", "repo_id": "shadcn-ui/ui", "token_count": 741 }
62
import { z } from "zod" // We're keeping a simple non-relational schema here. // IRL, you will have a schema for your data models. export const taskSchema = z.object({ id: z.string(), title: z.string(), status: z.string(), label: z.string(), priority: z.string(), }) export type Task = z.infer<typeof taskSchema>
shadcn-ui/ui/apps/www/app/(app)/examples/tasks/data/schema.ts
{ "file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/tasks/data/schema.ts", "repo_id": "shadcn-ui/ui", "token_count": 110 }
63
import Link from "next/link" import { ArrowRightIcon } from "@radix-ui/react-icons" import { Blocks, PieChart } from "lucide-react" import { Separator } from "@/registry/new-york/ui/separator" export function Announcement() { return ( <Link href="/docs/changelog" className="group inline-flex items-center px-0.5 text-sm font-medium" > <PieChart className="h-4 w-4" />{" "} <Separator className="mx-2 h-4" orientation="vertical" />{" "} <span className="underline-offset-4 group-hover:underline"> npx shadcn init </span> <ArrowRightIcon className="ml-1 h-4 w-4" /> </Link> ) }
shadcn-ui/ui/apps/www/components/announcement.tsx
{ "file_path": "shadcn-ui/ui/apps/www/components/announcement.tsx", "repo_id": "shadcn-ui/ui", "token_count": 269 }
64
"use client" import * as React from "react" import { useRouter } from "next/navigation" import { type DialogProps } from "@radix-ui/react-dialog" import { CircleIcon, FileIcon, LaptopIcon, MoonIcon, SunIcon, } from "@radix-ui/react-icons" import { useTheme } from "next-themes" import { docsConfig } from "@/config/docs" import { cn } from "@/lib/utils" import { Button } from "@/registry/new-york/ui/button" import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from "@/registry/new-york/ui/command" export function CommandMenu({ ...props }: DialogProps) { const router = useRouter() const [open, setOpen] = React.useState(false) const { setTheme } = useTheme() React.useEffect(() => { const down = (e: KeyboardEvent) => { if ((e.key === "k" && (e.metaKey || e.ctrlKey)) || e.key === "/") { if ( (e.target instanceof HTMLElement && e.target.isContentEditable) || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement ) { return } e.preventDefault() setOpen((open) => !open) } } document.addEventListener("keydown", down) return () => document.removeEventListener("keydown", down) }, []) const runCommand = React.useCallback((command: () => unknown) => { setOpen(false) command() }, []) return ( <> <Button variant="outline" className={cn( "relative h-8 w-full justify-start rounded-[0.5rem] bg-muted/50 text-sm font-normal text-muted-foreground shadow-none sm:pr-12 md:w-40 lg:w-64" )} onClick={() => setOpen(true)} {...props} > <span className="hidden lg:inline-flex">Search documentation...</span> <span className="inline-flex lg:hidden">Search...</span> <kbd className="pointer-events-none absolute right-[0.3rem] top-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex"> <span className="text-xs"></span>K </kbd> </Button> <CommandDialog open={open} onOpenChange={setOpen}> <CommandInput placeholder="Type a command or search..." /> <CommandList> <CommandEmpty>No results found.</CommandEmpty> <CommandGroup heading="Links"> {docsConfig.mainNav .filter((navitem) => !navitem.external) .map((navItem) => ( <CommandItem key={navItem.href} value={navItem.title} onSelect={() => { runCommand(() => router.push(navItem.href as string)) }} > <FileIcon className="mr-2 h-4 w-4" /> {navItem.title} </CommandItem> ))} </CommandGroup> {docsConfig.sidebarNav.map((group) => ( <CommandGroup key={group.title} heading={group.title}> {group.items.map((navItem) => ( <CommandItem key={navItem.href} value={navItem.title} onSelect={() => { runCommand(() => router.push(navItem.href as string)) }} > <div className="mr-2 flex h-4 w-4 items-center justify-center"> <CircleIcon className="h-3 w-3" /> </div> {navItem.title} </CommandItem> ))} </CommandGroup> ))} <CommandSeparator /> <CommandGroup heading="Theme"> <CommandItem onSelect={() => runCommand(() => setTheme("light"))}> <SunIcon className="mr-2 h-4 w-4" /> Light </CommandItem> <CommandItem onSelect={() => runCommand(() => setTheme("dark"))}> <MoonIcon className="mr-2 h-4 w-4" /> Dark </CommandItem> <CommandItem onSelect={() => runCommand(() => setTheme("system"))}> <LaptopIcon className="mr-2 h-4 w-4" /> System </CommandItem> </CommandGroup> </CommandList> </CommandDialog> </> ) }
shadcn-ui/ui/apps/www/components/command-menu.tsx
{ "file_path": "shadcn-ui/ui/apps/www/components/command-menu.tsx", "repo_id": "shadcn-ui/ui", "token_count": 2129 }
65
import Link from "next/link" import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons" import { Doc } from "contentlayer/generated" import { NavItem, NavItemWithChildren } from "types/nav" import { docsConfig } from "@/config/docs" import { cn } from "@/lib/utils" import { buttonVariants } from "@/registry/new-york/ui/button" interface DocsPagerProps { doc: Doc } export function DocsPager({ doc }: DocsPagerProps) { const pager = getPagerForDoc(doc) if (!pager) { return null } return ( <div className="flex flex-row items-center justify-between"> {pager?.prev?.href && ( <Link href={pager.prev.href} className={buttonVariants({ variant: "outline" })} > <ChevronLeftIcon className="mr-2 h-4 w-4" /> {pager.prev.title} </Link> )} {pager?.next?.href && ( <Link href={pager.next.href} className={cn(buttonVariants({ variant: "outline" }), "ml-auto")} > {pager.next.title} <ChevronRightIcon className="ml-2 h-4 w-4" /> </Link> )} </div> ) } export function getPagerForDoc(doc: Doc) { const nav = doc.slug.startsWith("/docs/charts") ? docsConfig.chartsNav : docsConfig.sidebarNav const flattenedLinks = [null, ...flatten(nav), null] const activeIndex = flattenedLinks.findIndex( (link) => doc.slug === link?.href ) const prev = activeIndex !== 0 ? flattenedLinks[activeIndex - 1] : null const next = activeIndex !== flattenedLinks.length - 1 ? flattenedLinks[activeIndex + 1] : null return { prev, next, } } export function flatten(links: NavItemWithChildren[]): NavItem[] { return links .reduce<NavItem[]>((flat, link) => { return flat.concat(link.items?.length ? flatten(link.items) : link) }, []) .filter((link) => !link?.disabled) }
shadcn-ui/ui/apps/www/components/pager.tsx
{ "file_path": "shadcn-ui/ui/apps/www/components/pager.tsx", "repo_id": "shadcn-ui/ui", "token_count": 801 }
66
"use client" import * as React from "react" import { editInV0 } from "@/actions/edit-in-v0" import { Loader2 } from "lucide-react" import { useFormStatus } from "react-dom" import { toast } from "sonner" import { cn } from "@/lib/utils" import { Button, ButtonProps } from "@/registry/new-york/ui/button" import { Tooltip, TooltipContent, TooltipTrigger, } from "@/registry/new-york/ui/tooltip" import { Style } from "@/registry/registry-styles" import { Block } from "@/registry/schema" type Size = "default" | "icon" function V0Tooltip({ size, style = "default", children, }: React.PropsWithChildren<{ size: Size; style?: Style["name"] }>) { if (size === "default") { return <>{children}</> } return ( <Tooltip> <TooltipTrigger asChild> {style === "new-york" ? ( <span tabIndex={-1}>{children}</span> ) : ( <>{children}</> )} </TooltipTrigger> <TooltipContent> {style === "new-york" ? ( <>Not available in New York</> ) : ( <>Open in v0</> )} </TooltipContent> </Tooltip> ) } export function V0Button({ block, size = "default", disabled, className, ...props }: { block: Pick<Block, "name" | "description" | "code" | "style"> size?: Size } & ButtonProps) { const [url, setUrl] = React.useState("https://ui.shadcn.com") React.useEffect(() => { setUrl(window.location.href) }, []) if (block.style === "new-york") { return ( <V0Tooltip size={size} style={block.style}> <Button aria-label="Open in v0" className={cn( "z-50 h-[calc(theme(spacing.7)_-_1px)] gap-1 rounded-[6px] bg-black px-3 text-xs text-white hover:bg-black hover:text-white dark:bg-white dark:text-black", size === "icon" && "h-7 w-7 p-0", className )} onClick={() => { toast("New York not available.", { description: ( <div className="flex items-center"> Only the Default style is available in{" "} <V0Logo className="ml-1 text-foreground" aria-label="v0" />. </div> ), }) }} disabled={ block.style === "new-york" && size === "icon" ? true : disabled } {...props} > {size === "icon" ? ( <V0Logo className="h-4 w-4" /> ) : ( <> Open in <V0Logo /> </> )} </Button> </V0Tooltip> ) } return ( <form action={async () => { try { const result = await editInV0({ name: block.name, description: block.description || "", code: block.code, style: block.style, url, }) if (result?.error) { throw new Error(result.error) } if (result?.url) { const popupOpened = window.open(result.url, "_blank") if (!popupOpened) { toast.warning("Pop-up window blocked.", { description: "Click the pop-up button in your browser to continue.", duration: 5000, }) } } } catch (error) { if (error instanceof Error) { toast.error(error.message) } } }} > <Form size={size} className={className} disabled={disabled} {...props} /> </form> ) } function Form({ disabled, size = "default", className, ...props }: Omit<React.ComponentProps<typeof V0Button>, "block">) { const { pending } = useFormStatus() return ( <V0Tooltip size={size}> <Button aria-label="Open in v0" className={cn( "z-50 h-[calc(theme(spacing.7)_-_1px)] gap-1 rounded-[6px] bg-black px-3 text-xs text-white hover:bg-black hover:text-white dark:bg-white dark:text-black", size === "icon" && "h-7 w-7 p-0", className )} disabled={disabled || pending} {...props} > {size === "icon" ? ( <> {pending ? ( <Loader2 className="h-3.5 w-3.5 animate-spin" /> ) : ( <V0Logo className="h-4 w-4" /> )} </> ) : ( <> {pending && <Loader2 className="h-3.5 w-3.5 animate-spin" />} Open in <V0Logo /> </> )} </Button> </V0Tooltip> ) } export function V0Logo({ className, ...props }: React.ComponentProps<"svg">) { return ( <svg viewBox="0 0 40 20" fill="none" xmlns="http://www.w3.org/2000/svg" className={cn("h-5 w-5 text-current", className)} {...props} > <path d="M23.3919 0H32.9188C36.7819 0 39.9136 3.13165 39.9136 6.99475V16.0805H36.0006V6.99475C36.0006 6.90167 35.9969 6.80925 35.9898 6.71766L26.4628 16.079C26.4949 16.08 26.5272 16.0805 26.5595 16.0805H36.0006V19.7762H26.5595C22.6964 19.7762 19.4788 16.6139 19.4788 12.7508V3.68923H23.3919V12.7508C23.3919 12.9253 23.4054 13.0977 23.4316 13.2668L33.1682 3.6995C33.0861 3.6927 33.003 3.68923 32.9188 3.68923H23.3919V0Z" fill="currentColor" ></path> <path d="M13.7688 19.0956L0 3.68759H5.53933L13.6231 12.7337V3.68759H17.7535V17.5746C17.7535 19.6705 15.1654 20.6584 13.7688 19.0956Z" fill="currentColor" ></path> </svg> ) }
shadcn-ui/ui/apps/www/components/v0-button.tsx
{ "file_path": "shadcn-ui/ui/apps/www/components/v0-button.tsx", "repo_id": "shadcn-ui/ui", "token_count": 2872 }
67
import * as React from "react" export function useMediaQuery(query: string) { const [value, setValue] = React.useState(false) React.useEffect(() => { function onChange(event: MediaQueryListEvent) { setValue(event.matches) } const result = matchMedia(query) result.addEventListener("change", onChange) setValue(result.matches) return () => result.removeEventListener("change", onChange) }, [query]) return value }
shadcn-ui/ui/apps/www/hooks/use-media-query.tsx
{ "file_path": "shadcn-ui/ui/apps/www/hooks/use-media-query.tsx", "repo_id": "shadcn-ui/ui", "token_count": 153 }
68
import { z } from "zod" export const logSchema = z.object({ event: z.enum(["copy_primitive"]), data: z.record(z.string()), })
shadcn-ui/ui/apps/www/lib/validations/log.ts
{ "file_path": "shadcn-ui/ui/apps/www/lib/validations/log.ts", "repo_id": "shadcn-ui/ui", "token_count": 52 }
69
import { Slash } from "lucide-react" import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/registry/default/ui/breadcrumb" export default function BreadcrumbWithCustomSeparator() { return ( <Breadcrumb> <BreadcrumbList> <BreadcrumbItem> <BreadcrumbLink href="/">Home</BreadcrumbLink> </BreadcrumbItem> <BreadcrumbSeparator> <Slash /> </BreadcrumbSeparator> <BreadcrumbItem> <BreadcrumbLink href="/components">Components</BreadcrumbLink> </BreadcrumbItem> <BreadcrumbSeparator> <Slash /> </BreadcrumbSeparator> <BreadcrumbItem> <BreadcrumbPage>Breadcrumb</BreadcrumbPage> </BreadcrumbItem> </BreadcrumbList> </Breadcrumb> ) }
shadcn-ui/ui/apps/www/registry/default/example/breadcrumb-separator.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/default/example/breadcrumb-separator.tsx", "repo_id": "shadcn-ui/ui", "token_count": 417 }
70
"use client" import * as React from "react" import { Minus, Plus } from "lucide-react" import { useTheme } from "next-themes" import { Bar, BarChart, ResponsiveContainer } from "recharts" import { useConfig } from "@/hooks/use-config" import { Button } from "@/registry/default/ui/button" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/registry/default/ui/card" import { baseColors } from "@/registry/registry-base-colors" const data = [ { goal: 400, }, { goal: 300, }, { goal: 200, }, { goal: 300, }, { goal: 200, }, { goal: 278, }, { goal: 189, }, { goal: 239, }, { goal: 300, }, { goal: 200, }, { goal: 278, }, { goal: 189, }, { goal: 349, }, ] export function CardsActivityGoal() { const { theme: mode } = useTheme() const [config] = useConfig() const baseColor = baseColors.find( (baseColor) => baseColor.name === config.theme ) const [goal, setGoal] = React.useState(350) function onClick(adjustment: number) { setGoal(Math.max(200, Math.min(400, goal + adjustment))) } return ( <Card> <CardHeader className="pb-4"> <CardTitle className="text-base">Move Goal</CardTitle> <CardDescription>Set your daily activity goal.</CardDescription> </CardHeader> <CardContent className="pb-2"> <div className="flex items-center justify-center space-x-2"> <Button variant="outline" size="icon" className="h-8 w-8 shrink-0 rounded-full" onClick={() => onClick(-10)} disabled={goal <= 200} > <Minus className="h-4 w-4" /> <span className="sr-only">Decrease</span> </Button> <div className="flex-1 text-center"> <div className="text-5xl font-bold tracking-tighter">{goal}</div> <div className="text-[0.70rem] uppercase text-muted-foreground"> Calories/day </div> </div> <Button variant="outline" size="icon" className="h-8 w-8 shrink-0 rounded-full" onClick={() => onClick(10)} disabled={goal >= 400} > <Plus className="h-4 w-4" /> <span className="sr-only">Increase</span> </Button> </div> <div className="my-3 h-[60px]"> <ResponsiveContainer width="100%" height="100%"> <BarChart data={data}> <Bar dataKey="goal" style={ { fill: "var(--theme-primary)", opacity: 0.2, "--theme-primary": `hsl(${ baseColor?.cssVars[mode === "dark" ? "dark" : "light"] .primary })`, } as React.CSSProperties } /> </BarChart> </ResponsiveContainer> </div> </CardContent> <CardFooter> <Button className="w-full">Set Goal</Button> </CardFooter> </Card> ) }
shadcn-ui/ui/apps/www/registry/default/example/cards/activity-goal.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/default/example/cards/activity-goal.tsx", "repo_id": "shadcn-ui/ui", "token_count": 1605 }
71
"use client" import * as React from "react" import { Calendar, MoreHorizontal, Tags, Trash, User } from "lucide-react" import { Button } from "@/registry/default/ui/button" import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@/registry/default/ui/command" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/registry/default/ui/dropdown-menu" const labels = [ "feature", "bug", "enhancement", "documentation", "design", "question", "maintenance", ] export default function ComboboxDropdownMenu() { const [label, setLabel] = React.useState("feature") const [open, setOpen] = React.useState(false) return ( <div className="flex w-full flex-col items-start justify-between rounded-md border px-4 py-3 sm:flex-row sm:items-center"> <p className="text-sm font-medium leading-none"> <span className="mr-2 rounded-lg bg-primary px-2 py-1 text-xs text-primary-foreground"> {label} </span> <span className="text-muted-foreground">Create a new project</span> </p> <DropdownMenu open={open} onOpenChange={setOpen}> <DropdownMenuTrigger asChild> <Button variant="ghost" size="sm"> <MoreHorizontal /> </Button> </DropdownMenuTrigger> <DropdownMenuContent align="end" className="w-[200px]"> <DropdownMenuLabel>Actions</DropdownMenuLabel> <DropdownMenuGroup> <DropdownMenuItem> <User className="mr-2 h-4 w-4" /> Assign to... </DropdownMenuItem> <DropdownMenuItem> <Calendar className="mr-2 h-4 w-4" /> Set due date... </DropdownMenuItem> <DropdownMenuSeparator /> <DropdownMenuSub> <DropdownMenuSubTrigger> <Tags className="mr-2 h-4 w-4" /> Apply label </DropdownMenuSubTrigger> <DropdownMenuSubContent className="p-0"> <Command> <CommandInput placeholder="Filter label..." autoFocus={true} /> <CommandList> <CommandEmpty>No label found.</CommandEmpty> <CommandGroup> {labels.map((label) => ( <CommandItem key={label} value={label} onSelect={(value) => { setLabel(value) setOpen(false) }} > {label} </CommandItem> ))} </CommandGroup> </CommandList> </Command> </DropdownMenuSubContent> </DropdownMenuSub> <DropdownMenuSeparator /> <DropdownMenuItem className="text-red-600"> <Trash className="mr-2 h-4 w-4" /> Delete <DropdownMenuShortcut></DropdownMenuShortcut> </DropdownMenuItem> </DropdownMenuGroup> </DropdownMenuContent> </DropdownMenu> </div> ) }
shadcn-ui/ui/apps/www/registry/default/example/combobox-dropdown-menu.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/default/example/combobox-dropdown-menu.tsx", "repo_id": "shadcn-ui/ui", "token_count": 1794 }
72
import { Checkbox } from "@/registry/default/ui/checkbox" import { Label } from "@/registry/default/ui/label" export default function LabelDemo() { return ( <div> <div className="flex items-center space-x-2"> <Checkbox id="terms" /> <Label htmlFor="terms">Accept terms and conditions</Label> </div> </div> ) }
shadcn-ui/ui/apps/www/registry/default/example/label-demo.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/default/example/label-demo.tsx", "repo_id": "shadcn-ui/ui", "token_count": 137 }
73
import { Button } from "@/registry/default/ui/button" import { Textarea } from "@/registry/default/ui/textarea" export default function TextareaWithButton() { return ( <div className="grid w-full gap-2"> <Textarea placeholder="Type your message here." /> <Button>Send message</Button> </div> ) }
shadcn-ui/ui/apps/www/registry/default/example/textarea-with-button.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/default/example/textarea-with-button.tsx", "repo_id": "shadcn-ui/ui", "token_count": 111 }
74
import { Italic } from "lucide-react" import { Toggle } from "@/registry/default/ui/toggle" export default function ToggleLg() { return ( <Toggle size="lg" aria-label="Toggle italic"> <Italic className="h-4 w-4" /> </Toggle> ) }
shadcn-ui/ui/apps/www/registry/default/example/toggle-lg.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/default/example/toggle-lg.tsx", "repo_id": "shadcn-ui/ui", "token_count": 102 }
75
import { Badge } from "@/registry/new-york/ui/badge" export default function BadgeSecondary() { return <Badge variant="secondary">Secondary</Badge> }
shadcn-ui/ui/apps/www/registry/new-york/example/badge-secondary.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/new-york/example/badge-secondary.tsx", "repo_id": "shadcn-ui/ui", "token_count": 49 }
76
import { EnvelopeOpenIcon } from "@radix-ui/react-icons" import { Button } from "@/registry/new-york/ui/button" export default function ButtonWithIcon() { return ( <Button> <EnvelopeOpenIcon className="mr-2 h-4 w-4" /> Login with Email </Button> ) }
shadcn-ui/ui/apps/www/registry/new-york/example/button-with-icon.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/new-york/example/button-with-icon.tsx", "repo_id": "shadcn-ui/ui", "token_count": 103 }
77
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp" import { InputOTP, InputOTPGroup, InputOTPSlot, } from "@/registry/new-york/ui/input-otp" export default function InputOTPPattern() { return ( <InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS_AND_CHARS}> <InputOTPGroup> <InputOTPSlot index={0} /> <InputOTPSlot index={1} /> <InputOTPSlot index={2} /> <InputOTPSlot index={3} /> <InputOTPSlot index={4} /> <InputOTPSlot index={5} /> </InputOTPGroup> </InputOTP> ) }
shadcn-ui/ui/apps/www/registry/new-york/example/input-otp-pattern.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/new-york/example/input-otp-pattern.tsx", "repo_id": "shadcn-ui/ui", "token_count": 262 }
78
import * as React from "react" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const badgeVariants = cva( "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", { variants: { variant: { default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80", secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80", outline: "text-foreground", }, }, defaultVariants: { variant: "default", }, } ) export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {} function Badge({ className, variant, ...props }: BadgeProps) { return ( <div className={cn(badgeVariants({ variant }), className)} {...props} /> ) } export { Badge, badgeVariants }
shadcn-ui/ui/apps/www/registry/new-york/ui/badge.tsx
{ "file_path": "shadcn-ui/ui/apps/www/registry/new-york/ui/badge.tsx", "repo_id": "shadcn-ui/ui", "token_count": 426 }
79
import { Registry } from "@/registry/schema" export const lib: Registry = [ { name: "utils", type: "registry:lib", dependencies: ["clsx", "tailwind-merge"], files: [ { path: "lib/utils.ts", type: "registry:lib", }, ], }, ]
shadcn-ui/ui/apps/www/registry/registry-lib.ts
{ "file_path": "shadcn-ui/ui/apps/www/registry/registry-lib.ts", "repo_id": "shadcn-ui/ui", "token_count": 129 }
80
import { createMatchPath, type ConfigLoaderSuccessResult } from "tsconfig-paths" export async function resolveImport( importPath: string, config: Pick<ConfigLoaderSuccessResult, "absoluteBaseUrl" | "paths"> ) { return createMatchPath(config.absoluteBaseUrl, config.paths)( importPath, undefined, () => true, [".ts", ".tsx"] ) }
shadcn-ui/ui/packages/cli/src/utils/resolve-import.ts
{ "file_path": "shadcn-ui/ui/packages/cli/src/utils/resolve-import.ts", "repo_id": "shadcn-ui/ui", "token_count": 116 }
81
body { background-color: red; }
shadcn-ui/ui/packages/cli/test/fixtures/next-app-src/src/other.css
{ "file_path": "shadcn-ui/ui/packages/cli/test/fixtures/next-app-src/src/other.css", "repo_id": "shadcn-ui/ui", "token_count": 13 }
82
import { expect, test } from "vitest" import { resolveTree } from "../../src/utils/registry" test("resolve tree", async () => { const index = [ { name: "button", dependencies: ["@radix-ui/react-slot"], type: "components:ui", files: ["button.tsx"], }, { name: "dialog", dependencies: ["@radix-ui/react-dialog"], registryDependencies: ["button"], type: "components:ui", files: ["dialog.tsx"], }, { name: "input", registryDependencies: ["button"], type: "components:ui", files: ["input.tsx"], }, { name: "alert-dialog", dependencies: ["@radix-ui/react-alert-dialog"], registryDependencies: ["button", "dialog"], type: "components:ui", files: ["alert-dialog.tsx"], }, { name: "example-card", type: "components:component", files: ["example-card.tsx"], registryDependencies: ["button", "dialog", "input"], }, ] expect( (await resolveTree(index, ["button"])).map((entry) => entry.name).sort() ).toEqual(["button"]) expect( (await resolveTree(index, ["dialog"])).map((entry) => entry.name).sort() ).toEqual(["button", "dialog"]) expect( (await resolveTree(index, ["alert-dialog", "dialog"])) .map((entry) => entry.name) .sort() ).toEqual(["alert-dialog", "button", "dialog"]) expect( (await resolveTree(index, ["example-card"])) .map((entry) => entry.name) .sort() ).toEqual(["button", "dialog", "example-card", "input"]) expect( (await resolveTree(index, ["foo"])).map((entry) => entry.name).sort() ).toEqual([]) expect( (await resolveTree(index, ["button", "foo"])) .map((entry) => entry.name) .sort() ).toEqual(["button"]) })
shadcn-ui/ui/packages/cli/test/utils/registry.test.ts
{ "file_path": "shadcn-ui/ui/packages/cli/test/utils/registry.test.ts", "repo_id": "shadcn-ui/ui", "token_count": 769 }
83
#!/usr/bin/env node import { add } from "@/src/commands/add" import { diff } from "@/src/commands/diff" import { init } from "@/src/commands/init" import { Command } from "commander" import packageJson from "../package.json" process.on("SIGINT", () => process.exit(0)) process.on("SIGTERM", () => process.exit(0)) async function main() { const program = new Command() .name("shadcn") .description("add components and dependencies to your project") .version( packageJson.version || "1.0.0", "-v, --version", "display the version number" ) program.addCommand(init).addCommand(add).addCommand(diff) program.parse() } main()
shadcn-ui/ui/packages/shadcn/src/index.ts
{ "file_path": "shadcn-ui/ui/packages/shadcn/src/index.ts", "repo_id": "shadcn-ui/ui", "token_count": 241 }
84
body { background-color: red; }
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/next-app-src/src/other.css
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/next-app-src/src/other.css", "repo_id": "shadcn-ui/ui", "token_count": 13 }
85
body { background-color: red; }
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/next-pages-src/other.css
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/next-pages-src/other.css", "repo_id": "shadcn-ui/ui", "token_count": 13 }
86
import type { Password, User } from "@prisma/client"; import bcrypt from "bcryptjs"; import { prisma } from "~/db.server"; export type { User } from "@prisma/client"; export async function getUserById(id: User["id"]) { return prisma.user.findUnique({ where: { id } }); } export async function getUserByEmail(email: User["email"]) { return prisma.user.findUnique({ where: { email } }); } export async function createUser(email: User["email"], password: string) { const hashedPassword = await bcrypt.hash(password, 10); return prisma.user.create({ data: { email, password: { create: { hash: hashedPassword, }, }, }, }); } export async function deleteUserByEmail(email: User["email"]) { return prisma.user.delete({ where: { email } }); } export async function verifyLogin( email: User["email"], password: Password["hash"], ) { const userWithPassword = await prisma.user.findUnique({ where: { email }, include: { password: true, }, }); if (!userWithPassword || !userWithPassword.password) { return null; } const isValid = await bcrypt.compare( password, userWithPassword.password.hash, ); if (!isValid) { return null; } // eslint-disable-next-line @typescript-eslint/no-unused-vars const { password: _password, ...userWithoutPassword } = userWithPassword; return userWithoutPassword; }
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/user.server.ts
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/user.server.ts", "repo_id": "shadcn-ui/ui", "token_count": 497 }
87
import { defineConfig } from "cypress"; export default defineConfig({ e2e: { setupNodeEvents: (on, config) => { const isDev = config.watchForFileChanges; const port = process.env.PORT ?? (isDev ? "3000" : "8811"); const configOverrides: Partial<Cypress.PluginConfigOptions> = { baseUrl: `http://localhost:${port}`, screenshotOnRunFailure: !process.env.CI, }; // To use this: // cy.task('log', whateverYouWantInTheTerminal) on("task", { log: (message) => { console.log(message); return null; }, }); return { ...config, ...configOverrides }; }, }, });
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress.config.ts
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress.config.ts", "repo_id": "shadcn-ui/ui", "token_count": 285 }
88
import { Links, Meta, Outlet, Scripts, ScrollRestoration, } from "@remix-run/react"; import "./tailwind.css"; export function Layout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <head> <meta charSet="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <Meta /> <Links /> </head> <body> {children} <ScrollRestoration /> <Scripts /> </body> </html> ); } export default function App() { return <Outlet />; }
shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix/app/root.tsx
{ "file_path": "shadcn-ui/ui/packages/shadcn/test/fixtures/frameworks/remix/app/root.tsx", "repo_id": "shadcn-ui/ui", "token_count": 252 }
89
import Link from "next/link" import { siteConfig } from "@/config/site" import { buttonVariants } from "@/components/ui/button" export default function IndexPage() { return ( <section className="container grid items-center gap-6 pb-8 pt-6 md:py-10"> <div className="flex max-w-[980px] flex-col items-start gap-2"> <h1 className="text-3xl font-extrabold leading-tight tracking-tighter md:text-4xl"> Beautifully designed components <br className="hidden sm:inline" /> built with Radix UI and Tailwind CSS. </h1> <p className="max-w-[700px] text-lg text-muted-foreground"> Accessible and customizable components that you can copy and paste into your apps. Free. Open Source. And Next.js 13 Ready. </p> </div> <div className="flex gap-4"> <Link href={siteConfig.links.docs} target="_blank" rel="noreferrer" className={buttonVariants()} > Documentation </Link> <Link target="_blank" rel="noreferrer" href={siteConfig.links.github} className={buttonVariants({ variant: "outline" })} > GitHub </Link> </div> </section> ) }
shadcn-ui/ui/templates/next-template/app/page.tsx
{ "file_path": "shadcn-ui/ui/templates/next-template/app/page.tsx", "repo_id": "shadcn-ui/ui", "token_count": 571 }
90
"use client" import Image from "next/image" import Link from "next/link" import { motion } from "framer-motion" import { ChevronRight } from "lucide-react" import { Footer } from "react-day-picker" import { siteConfig } from "@/config/site" import { cn } from "@/lib/utils" import { buttonVariants } from "@/components/ui/button" import { Announcement } from "@/components/announcement" import CTASection from "@/components/cta-section" import { Icons } from "@/components/icons" import AvatarCircles from "@/components/magicui/avatar-circles" import FaqPage from "./faqs/page" import Features from "./features/page" import OrbitingCirclesDemo from "./integrations/page" import PricingPage from "./pricing/page" import MarqueeDemo from "./testimonials/page" import Showcase from "@/components/showcase" import EasyHero from "@/components/easy-hero" // Corrected the path for FAQPage import export default function IndexPage() { const avatarUrls = [ "https://avatars.githubusercontent.com/u/16860528", "https://avatars.githubusercontent.com/u/20110627", "https://avatars.githubusercontent.com/u/106103625", "https://avatars.githubusercontent.com/u/59228569", ] return ( <section id="hero"> <div className="mx-auto mt-0 flex flex-col items-start gap-0 px-0 pb-0 text-center sm:pb-0 md:mt-10 md:items-center md:pb-14 lg:mt-20 lg:pb-14"> <Announcement /> {/* <div className="relative flex flex-col gap-4 md:items-center lg:flex-row"> <h1 className="relative mx-0 max-w-[54.8rem] text-balance bg-gradient-to-br from-black from-50% to-neutral-200/60 bg-clip-text pt-5 text-left text-5xl font-semibold tracking-tighter text-transparent sm:text-7xl md:mx-auto md:px-4 md:py-2 md:text-center md:text-7xl lg:text-7xl dark:bg-gradient-to-br dark:from-white dark:to-neutral-200/60 dark:bg-clip-text dark:text-transparent"> Collection of Premium {" "} <br/>Web Templates </h1> */} {/* <span className="text-neutral-90 absolute -top-3.5 left-0 z-10 rotate-3 whitespace-nowrap rounded-full bg-neutral-800 px-2.5 py-1 text-[12px] font-semibold uppercase leading-5 tracking-wide text-white md:top-10 md:-rotate-12"> 100% High Quality </span> */} {/* </div> */} {/* <p className="max-w-xl text-balance text-left text-base tracking-tight text-black md:text-center md:text-lg dark:font-medium dark:text-white"> 50+ <b>High Quality</b> templates built with{" "} <span className="font-bold text-black dark:text-white">Next.js, React</span>,{" "} <span className="font-bold text-black dark:text-white"> Typescript </span> ,{" "} <span className="font-bold text-black dark:text-white"> Tailwind CSS </span> , and{" "} <span className="font-bold text-black dark:text-white"> Framer Motion </span> . <br /> </p> */} <EasyHero title="Starting your Next project ? Don't start from scratch" subtext='50+ High Quality templates built with Next.js, React, Typescript, Tailwind CSS, and Framer Motion.' /> <div className="mx-0 flex w-full max-w-full flex-col gap-4 py-5 sm:max-w-lg sm:flex-row md:mx-auto px-8"> <div className="flex w-full flex-col gap-2 sm:flex-row sm:gap-4"> <Link href="/templates" // eslint-disable-next-line tailwindcss/no-contradicting-classname className={cn( buttonVariants({ variant: "default", size: "lg", }), "gap-2 whitespace-pre md:flex", "group relative w-full gap-1 rounded-full text-sm font-semibold tracking-tighter ring-offset-inherit transition-all duration-150 ease-in-out hover:ring-2 hover:ring-black hover:ring-offset-2 hover:ring-offset-current dark:hover:ring-neutral-50" )} > Browse Templates <ChevronRight className="ml-1 size-4 shrink-0 transition-all duration-300 ease-out group-hover:translate-x-1" /> </Link> <Link href="https://premium.easyui.pro/pricing-section" className={cn( buttonVariants({ size: "lg", variant: "outline", }), "gap-2 whitespace-pre md:flex", "group relative w-full overflow-hidden rounded-full text-sm font-semibold tracking-tighter transition-all duration-150 ease-in-out hover:ring-2 hover:ring-neutral-300 hover:ring-offset-2 hover:ring-offset-inherit dark:hover:ring-black dark:hover:ring-offset-black " )} > Get Easy UI Premium <ChevronRight className="ml-1 size-4 shrink-0 transition-all duration-300 ease-out group-hover:translate-x-1" /> </Link> </div> </div> {/* <div className="flex max-w-xl flex-row items-center justify-between text-balance p-5 text-left text-base tracking-tight text-black md:text-center md:text-base dark:font-medium dark:text-white"> <span className="mr-2 font-300 text-gray-600 dark:text-gray-400 text-md"> Trusted by </span> <AvatarCircles numPeople={99} avatarUrls={avatarUrls} /> </div> */} <motion.div className="mx-auto my-10 flex flex-col items-center justify-center gap-4 md:mb-0 lg:mb-0 px-8" initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5 }} > <span className="animate-pulse text-lg font-semibold">Featured on</span> <div className="z-50 flex items-center justify-center gap-4"> <a href="https://sourceforge.net/p/easy-ui/" className="dark:hidden"> <motion.img alt="Download Easy UI" src="https://sourceforge.net/sflogo.php?type=17&amp;group_id=3785509" width="200" whileHover={{ scale: 1.05 }} transition={{ type: "spring", stiffness: 400, damping: 10 }} /> </a> <a href="https://sourceforge.net/p/easy-ui/" className="hidden dark:block"> <motion.img alt="Download Easy UI" src="https://sourceforge.net/sflogo.php?type=18&amp;group_id=3785509" width="200" whileHover={{ scale: 1.05 }} transition={{ type: "spring", stiffness: 400, damping: 10 }} /> </a> <a href='https://www.saashub.com/easy-ui-pro?utm_source=badge&utm_campaign=badge&utm_content=easy-ui-pro&badge_variant=color&badge_kind=approved' target='_blank' rel="noreferrer"> <img src="https://cdn-b.saashub.com/img/badges/approved-color.png?v=1" alt="Easy UI Pro badge" style={{ maxWidth: "130px" }} className="ml-5"/> </a> </div> </motion.div> <Showcase /> <MarqueeDemo /> </div> <div className="lg:pt-25 mx-auto flex max-w-[58rem] flex-col items-center space-y-4 pt-12 text-center sm:pt-8"> <h2 className="font-heading text-3xl font-bold leading-[1.1] sm:text-3xl md:text-3xl"> Frequently asked questions </h2> <p className="max-w-[85%] pb-1 leading-normal text-muted-foreground sm:pb-1 sm:text-lg sm:leading-7 lg:pb-10"> Get detailed answers to common inquiries. </p> </div> <div className="container my-10 flex max-w-[58rem] flex-col items-center justify-between gap-4 py-0 sm:my-0 md:my-0 lg:my-0"> <FaqPage /> </div> <CTASection /> {/* <SiteFooter className="border-t" /> */} </section> ) }
DarkInventor/easy-ui/app/page.tsx
{ "file_path": "DarkInventor/easy-ui/app/page.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 3690 }
0
import { cn } from "@/lib/utils" interface CalloutProps { icon?: string children?: React.ReactNode type?: "default" | "warning" | "danger" } export function Callout({ children, icon, type = "default", ...props }: CalloutProps) { return ( <div className={cn("my-6 flex items-start rounded-md border border-l-4 p-4", { "border-red-900 bg-red-50": type === "danger", "border-yellow-900 bg-yellow-50": type === "warning", })} {...props} > {icon && <span className="mr-4 text-2xl">{icon}</span>} <div>{children}</div> </div> ) }
DarkInventor/easy-ui/components/callout.tsx
{ "file_path": "DarkInventor/easy-ui/components/callout.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 261 }
1
import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { ArrowRightIcon } from "@radix-ui/react-icons"; import { ReactNode } from "react"; const BentoGrid = ({ children, className, }: { children: ReactNode; className?: string; }) => { return ( <div className={cn( "grid w-full auto-rows-[22rem] grid-cols-3 gap-4", className, )} > {children} </div> ); }; const BentoCard = ({ name, className, background, Icon, description, href, cta, }: { name: string; className: string; background: ReactNode; Icon: any; description: string; href: string; cta: string; }) => ( <div key={name} className={cn( "group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl", // light styles "bg-white [box-shadow:0_0_0_1px_rgba(0,0,0,.03),0_2px_4px_rgba(0,0,0,.05),0_12px_24px_rgba(0,0,0,.05)]", // dark styles "transform-gpu dark:bg-black dark:[border:1px_solid_rgba(255,255,255,.1)] dark:[box-shadow:0_-20px_80px_-20px_#ffffff1f_inset]", className, )} > <div>{background}</div> <div className="pointer-events-none z-10 flex transform-gpu flex-col gap-1 p-6 transition-all duration-300 group-hover:-translate-y-10"> <Icon className="h-12 w-12 origin-left transform-gpu text-neutral-700 transition-all duration-300 ease-in-out group-hover:scale-75" /> <h3 className="text-xl font-semibold text-neutral-700 dark:text-neutral-300"> {name} </h3> <p className="max-w-lg text-neutral-400">{description}</p> </div> <div className={cn( "pointer-events-none absolute bottom-0 flex w-full translate-y-10 transform-gpu flex-row items-center p-4 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100", )} > <Button variant="ghost" asChild size="sm" className="pointer-events-auto"> <a href={href}> {cta} <ArrowRightIcon className="ml-2 h-4 w-4" /> </a> </Button> </div> <div className="pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[.03] group-hover:dark:bg-neutral-800/10" /> </div> ); export { BentoCard, BentoGrid };
DarkInventor/easy-ui/components/magicui/bento-grid.tsx
{ "file_path": "DarkInventor/easy-ui/components/magicui/bento-grid.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 984 }
2
"use client"; import * as React from "react"; import { useTheme } from "next-themes"; import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; interface ThemeToggleProps { button: React.ReactNode; } export function ThemeToggle({ button }: ThemeToggleProps) { const { setTheme, theme, themes } = useTheme(); return ( <DropdownMenu> <DropdownMenuTrigger asChild>{button}</DropdownMenuTrigger> <DropdownMenuContent align="end"> {themes.map((t) => ( <DropdownMenuCheckboxItem key={t} checked={theme === t} onClick={() => setTheme(t)} className="text-sm capitalize" > {t} </DropdownMenuCheckboxItem> ))} </DropdownMenuContent> </DropdownMenu> ); }
alifarooq9/rapidlaunch/apps/www/src/components/theme-toggle.tsx
{ "file_path": "alifarooq9/rapidlaunch/apps/www/src/components/theme-toggle.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 520 }
3
import { AppPageLoading } from "@/app/(app)/_components/page-loading"; import { Skeleton } from "@/components/ui/skeleton"; import { orgBillingPageConfig } from "@/app/(app)/(user)/org/billing/_constants/page-config"; export default function OrgBillingLoading() { return ( <AppPageLoading title={orgBillingPageConfig.title} description={orgBillingPageConfig.description} > <div className="grid gap-5"> <Skeleton className="h-48 w-full" /> <Skeleton className="h-96 w-full" /> </div> </AppPageLoading> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/billing/loading.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/billing/loading.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 270 }
4
"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 { 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 { toast } from "sonner"; import { useAwaitableTransition } from "@/hooks/use-awaitable-transition"; import { useRouter } from "next/navigation"; import { updateOrgImageMutation } from "@/server/actions/organization/mutations"; import type { organizations } from "@/server/db/schema"; type OrgImageFormProps = { currentOrg: typeof organizations.$inferSelect; }; const PROFILE_MAX_SIZE = 4; export function OrgImageForm({ currentOrg }: OrgImageFormProps) { 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( "orgProfilePicture", { 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 }) => updateOrgImageMutation({ 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("Image could not be uploaded", { description: "Please check your premissions", }); } }; return ( <Dialog onOpenChange={(o) => { if (isUploading) return; setModalOpen(o); setFiles([]); }} open={modalOpen} > <Card> <CardHeader> <CardTitle>Org Image</CardTitle> <CardDescription> Upload a new profile image here </CardDescription> </CardHeader> <CardContent className="flex items-center gap-4"> <Avatar className="h-16 w-16"> <AvatarImage src={currentOrg.image ? currentOrg.image : ""} /> <AvatarFallback className="text-3xl"> {currentOrg.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 your org&apos;s profile image here </DialogTitle> <DialogDescription> Please upload a profile image for your organization. This will be used to identify your organization. </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)/org/settings/_components/org-image-form.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/settings/_components/org-image-form.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 4853 }
5
import { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon, } from "@radix-ui/react-icons"; import { type Table } from "@tanstack/react-table"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; interface DataTablePaginationProps<TData> { table: Table<TData>; pageSizeOptions?: number[]; totalRows: number; } export function DataTablePagination<TData>({ table, pageSizeOptions = [10, 20, 30, 40, 50], totalRows, }: DataTablePaginationProps<TData>) { return ( <div className="flex w-full flex-col items-center justify-between gap-4 overflow-auto px-2 py-1 sm:flex-row sm:gap-8"> <p className="flex-1 text-sm text-muted-foreground"> {totalRows} <span className="inline">&nbsp;result(s) found</span> </p> <div className="flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8"> <div className="flex items-center space-x-2"> <p className="whitespace-nowrap text-sm font-medium"> Rows per page </p> <Select value={`${table.getState().pagination.pageSize}`} onValueChange={(value) => { table.setPageSize(Number(value)); }} > <SelectTrigger className="h-8 w-[70px]"> <SelectValue placeholder={ table.getState().pagination.pageSize } /> </SelectTrigger> <SelectContent side="top"> {pageSizeOptions.map((pageSize) => ( <SelectItem key={pageSize} value={`${pageSize}`} > {pageSize} </SelectItem> ))} </SelectContent> </Select> </div> <div className="flex w-[100px] items-center justify-center text-sm font-medium"> Page {table.getState().pagination.pageIndex + 1} of{" "} {table.getPageCount()} </div> <div className="flex items-center space-x-2"> <Button aria-label="Go to first page" variant="outline" className="hidden size-8 p-0 lg:flex" onClick={() => table.setPageIndex(0)} disabled={!table.getCanPreviousPage()} > <DoubleArrowLeftIcon className="size-4" aria-hidden="true" /> </Button> <Button aria-label="Go to previous page" variant="outline" className="size-8 p-0" onClick={() => table.previousPage()} disabled={!table.getCanPreviousPage()} > <ChevronLeftIcon className="size-4" aria-hidden="true" /> </Button> <Button aria-label="Go to next page" variant="outline" className="size-8 p-0" onClick={() => table.nextPage()} disabled={!table.getCanNextPage()} > <ChevronRightIcon className="size-4" aria-hidden="true" /> </Button> <Button aria-label="Go to last page" variant="outline" className="hidden size-8 p-0 lg:flex" onClick={() => table.setPageIndex(table.getPageCount() - 1) } disabled={!table.getCanNextPage()} > <DoubleArrowRightIcon className="size-4" aria-hidden="true" /> </Button> </div> </div> </div> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/_components/data-table-pagination.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/_components/data-table-pagination.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 3105 }
6
"use client"; import { LineChart } from "@/components/charts"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { thousandToK } from "@/lib/utils"; type RevenueChartProps = { data: { Date: string; RevenueCount: number; }[]; }; export function RevenueChart({ data }: RevenueChartProps) { return ( <Card> <CardHeader> <CardTitle>Revenue Analytics</CardTitle> <CardDescription> Count of revenue each month for last 6 months </CardDescription> </CardHeader> <CardContent> <LineChart data={data} xAxisDataKey="Date" yAxisDataKey="RevenueCount" lineDataKeys={["RevenueCount"]} lineProps={[{ stroke: "hsl(var(--primary))" }]} yAxisProps={{ tickFormatter: (value) => { if (value >= 10000) { return `${thousandToK(Number(value)).toFixed(1)}k`; } else { return `${value}`; } }, }} /> </CardContent> </Card> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/dashboard/_components/revenue-chart.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/dashboard/_components/revenue-chart.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 825 }
7
/* eslint-disable @typescript-eslint/no-unsafe-call */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ "use client"; import { type ColumnDef } from "@tanstack/react-table"; import { format } from "date-fns"; import { type membersToOrganizations } from "@/server/db/schema"; import { ColumnDropdown } from "./column-dropdown"; import { Badge } from "@/components/ui/badge"; import { OrgDetails } from "@/app/(app)/admin/organizations/_components/org-details"; // This type is used to define the shape of our data. // You can use a Zod schema here if you want. export type OrganizationsData = { id: string; name: string | null; email: string; image: string | null; owner: { id: string; name: string | null; email: string; image: string | null; }; subscribed: boolean; members: { id: string; name: string | null; email: string; image: string | null; role: typeof membersToOrganizations.$inferSelect.role; }[]; createdAt: Date; }; export function getColumns(): ColumnDef<OrganizationsData>[] { return columns; } export const columns: ColumnDef<OrganizationsData>[] = [ { accessorKey: "name", header: () => <span className="pl-2">Name</span>, cell: ({ row }) => <OrgDetails {...row.original} />, }, { accessorKey: "email", header: "Email", }, { accessorKey: "owner.email", header: "Owner Email", }, { accessorKey: "subscribed", header: "Subscribed", cell: ({ row }) => ( <Badge variant={row.original.subscribed ? "success" : "info"}> {row.original.subscribed ? "Yes" : "No"} </Badge> ), }, { accessorKey: "createdAt", header: "Created At", cell: ({ row }) => ( <span className="text-muted-foreground"> {format(new Date(row.original.createdAt), "PP")} </span> ), }, { id: "actions", cell: ({ row }) => <ColumnDropdown {...row.original} />, }, ];
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/organizations/_components/columns.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/organizations/_components/columns.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 929 }
8
/** * This file contains the page configuration for the users page. * This is used to generate the page title and description. */ export const waitlistPageConfig = { title: "Waitlist", description: "A list of users who are waiting to be approved for the service.", } as const;
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/waitlist/_constants/page-config.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/waitlist/_constants/page-config.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 84 }
9
import { WebPageHeader, WebPageWrapper, } from "@/app/(web)/_components/general-components"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { format } from "date-fns"; import Image from "next/image"; import Link from "next/link"; import { type Metadata } from "next"; import { blogPageConfig } from "@/app/(web)/blogs/_constants/page-config"; import { blogs } from "@/app/source"; export const metadata: Metadata = { title: blogPageConfig.title, }; export const dynamic = "force-static"; export default async function BlogsPage() { return ( <WebPageWrapper> <WebPageHeader title="Blog"> <p className="text-center text-base"> <span>Get the latest news and updates</span> </p> </WebPageHeader> <Card className="w-full"> <CardHeader> <CardTitle> All the latest news and updates from our blog </CardTitle> </CardHeader> <CardContent className="grid grid-cols-1 gap-8 lg:grid-cols-2"> {blogs.getPages()?.map((blog) => ( <Link href={blog.url} key={blog.url} className="space-y-4" > <div className="relative h-screen max-h-[350px] w-full overflow-hidden rounded-md bg-muted/60"> <Image src={blog.data.thumbnail} alt={blog.data.title} fill className="object-cover" /> </div> <h2 className="font-heading text-2xl font-semibold"> {blog.data.title} </h2> <p>{blog.data.description}</p> <div className="grid gap-0.5 font-light"> <p className="text-sm text-muted-foreground"> {format( new Date(blog.data.publishedAt), "PPP", )}{" "} {blog.data.readTime} read </p> {blog.data.exports.lastModified && ( <p className="text-sm text-muted-foreground"> Last updated at{" "} {format( new Date( blog.data.exports.lastModified, ), "PPP", )} </p> )} </div> </Link> ))} </CardContent> </Card> </WebPageWrapper> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/blogs/page.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/blogs/page.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 2164 }
10
import { Icons } from "@/components/ui/icons"; import { siteUrls } from "@/config/urls"; import Link from "next/link"; type AuthLayoutProps = { children: React.ReactNode; }; export default function AuthLayout({ children }: AuthLayoutProps) { return ( <div className="grid min-h-screen w-screen grid-cols-1 px-4 lg:grid-cols-3"> <main className="col-span-2 flex items-center justify-center"> {children} </main> <section className="col-span-1 hidden flex-col items-start justify-center gap-6 border-l border-border bg-muted/30 p-10 lg:flex"> <Icons.logo as="h3" /> <h2 className="text-3xl font-medium"> Build and launch your SaaS this weekend </h2> <p className="font-light text-muted-foreground"> Say goodbye to long development cycles. Build and launch your SaaS faster with our elite boilerplate. Start today!{" "} <Link href={siteUrls.rapidlaunch} className="font-medium text-foreground underline underline-offset-4" > Rapidlaunch.xyz </Link> </p> </section> </div> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/auth/layout.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/auth/layout.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 679 }
11
import { blogs, docs } from "@/app/source"; import { publicRoutes, siteUrls } from "@/config/urls"; import type { MetadataRoute } from "next"; const addPathToBaseURL = (path: string) => `${siteUrls.publicUrl}${path}`; export default async function sitemap(): Promise<MetadataRoute.Sitemap> { const blogsSitemap = blogs.getPages().map((blog) => ({ url: addPathToBaseURL(blog.url), lastModified: blog.data.exports.lastModified ? new Date(blog.data.exports.lastModified) : new Date(blog.data.publishedAt), })); const docsSitemap = docs.getPages().map((doc) => ({ url: addPathToBaseURL(doc.url), lastModified: doc.data.exports.lastModified ? new Date(doc.data.exports.lastModified) : undefined, })); const publicRoutesWithoutPublicUrl = publicRoutes.filter( (route) => route !== siteUrls.publicUrl && route !== siteUrls.rapidlaunch, ); const routes = publicRoutesWithoutPublicUrl.map((route) => ({ url: addPathToBaseURL(route), lastModified: new Date(), })); return [...routes, ...blogsSitemap, ...docsSitemap]; }
alifarooq9/rapidlaunch/starterkits/saas/src/app/sitemap.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/sitemap.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 481 }
12
import { LayoutDashboardIcon, Settings2Icon } from "lucide-react"; import { siteUrls } from "@/config/urls"; type IconProps = React.HTMLAttributes<SVGElement>; type NavItem = { label: string; icon: React.ComponentType<IconProps>; href: string; disabled?: boolean; }; export type UserDropdownNavItems = { id: string; label: string; items: NavItem[]; }; const navIds = { profile: "profile", admin: "admin", }; /** * @purpose Contains the navigation items for the user dropdown. * The userDropdownConfig object contains the navigation items for the user dropdown. * The navigation array contains the navigation items for the user dropdown. * The navIds object contains the unique string identifiers for the navigation items. * * To Add a new navigation item: * 1. Add a new object to the navigation array with the following properties: * - id: A unique string identifier for the navigation item, use the navIds object to add the id. * - label: The label for the navigation item. * - items: An array of navigation items. */ const navigation: UserDropdownNavItems[] = [ { id: navIds.profile, label: "Profile", items: [ { label: "Dashboard", icon: LayoutDashboardIcon, href: siteUrls.dashboard.home, }, { label: "Settings", icon: Settings2Icon, href: siteUrls.profile.settings, }, ], }, { id: navIds.admin, label: "Admin", items: [ { label: "Admin Panel", icon: LayoutDashboardIcon, href: siteUrls.admin.dashboard, }, ], }, ]; type FilterNavItemsProps = { removeIds?: string[]; includedIds?: string[]; }; /** * @purpose Filters the navigation items for the user dropdown. * The filterNavItems function filters the navigation items for the user dropdown. * @param removeIds An array of string identifiers to remove from the navigation items. * @param includeIds An array of string identifiers to include in the navigation items. * * @returns The filtered navigation items for the user dropdown. * */ export function filterNavItems({ removeIds = [], includedIds = [], }: FilterNavItemsProps = {}) { let includedItems = userDropdownConfig.navigation; if (includedIds.length) { includedItems = includedItems.filter((item) => includedIds.includes(item.id), ); } if (removeIds.length) { includedItems = includedItems.filter( (item) => !removeIds.includes(item.id), ); } return includedItems; } export const userDropdownConfig = { navigation, navIds, filterNavItems, };
alifarooq9/rapidlaunch/starterkits/saas/src/config/user-dropdown.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/config/user-dropdown.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1103 }
13
"use server"; import { db } from "@/server/db"; import { accounts, userInsertSchema, users } from "@/server/db/schema"; import { protectedProcedure, superAdminProcedure } from "@/server/procedures"; import { eq } from "drizzle-orm"; import type { z } from "zod"; /** * Update the name of the user * @param name The new name */ const updateNameSchema = userInsertSchema.pick({ name: true }); type UpdateNameProps = z.infer<typeof updateNameSchema>; export async function updateNameMutation({ name }: UpdateNameProps) { const { user } = await protectedProcedure(); const updateNameParse = await updateNameSchema.safeParseAsync({ name }); if (!updateNameParse.success) { throw new Error("Invalid name", { cause: updateNameParse.error.errors, }); } return await db .update(users) .set({ name: updateNameParse.data.name }) .where(eq(users.id, user.id)) .execute(); } /** * Update the image of the user * @param image The new image */ const updateImageSchema = userInsertSchema.pick({ image: true }); type UpdateImageProps = z.infer<typeof updateImageSchema>; export async function updateImageMutation({ image }: UpdateImageProps) { const { user } = await protectedProcedure(); const updateImageParse = await updateImageSchema.safeParseAsync({ image }); if (!updateImageParse.success) { throw new Error("Invalid image", { cause: updateImageParse.error.errors, }); } return await db .update(users) .set({ image: updateImageParse.data.image }) .where(eq(users.email, user.email!)) .execute(); } /** * Update the role of a user (super admin only) * @param id The user id * @param role The new role */ const updateRoleSchema = userInsertSchema.pick({ role: true, id: true, }); type UpdateRoleProps = z.infer<typeof updateRoleSchema>; export async function updateRoleMutation({ role, id }: UpdateRoleProps) { await superAdminProcedure(); const updateRoleParse = await updateRoleSchema.safeParseAsync({ role, id }); if (!updateRoleParse.success) { throw new Error("Invalid role data", { cause: updateRoleParse.error.errors, }); } return await db .update(users) .set({ role: updateRoleParse.data.role }) .where(eq(users.id, updateRoleParse.data.id)) .execute(); } /** * Delete a user (super admin only) * @param id The user id */ const deleteUserSchema = userInsertSchema.pick({ id: true }); type DeleteUserProps = z.infer<typeof deleteUserSchema>; export async function deleteUserMutation({ id }: DeleteUserProps) { await superAdminProcedure(); const deleteUserParse = await deleteUserSchema.safeParseAsync({ id }); if (!deleteUserParse.success) { throw new Error("Invalid user id", { cause: deleteUserParse.error.errors, }); } await db .delete(accounts) .where(eq(accounts.userId, deleteUserParse.data.id)) .execute(); return await db .delete(users) .where(eq(users.id, deleteUserParse.data.id)) .execute(); } /** * complete new user setup * @returns */ export async function completeNewUserSetupMutation() { const { user } = await protectedProcedure(); return await db .update(users) .set({ isNewUser: false }) .where(eq(users.id, user.id)) .execute(); }
alifarooq9/rapidlaunch/starterkits/saas/src/server/actions/user/mutations.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/server/actions/user/mutations.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1320 }
14
import type { Config } from "tailwindcss"; import { fontFamily } from "tailwindcss/defaultTheme"; import { createPreset } from "fumadocs-ui/tailwind-plugin"; const config = { darkMode: ["class"], content: [ "./src/**/*.{ts,tsx}", "./node_modules/fumadocs-ui/dist/**/*.js", "./mdx-components.tsx", ], presets: [createPreset()], prefix: "", safelist: ["dark"], theme: { container: { center: true, padding: "1rem", screens: { "2xl": "1400px", }, }, extend: { fontFamily: { sans: ["var(--font-sans)", ...fontFamily.sans], heading: ["var(--font-heading)", ...fontFamily.sans], }, transitionDuration: { 400: "400ms", }, colors: { border: "hsl(var(--border))", input: "hsl(var(--input))", ring: "hsl(var(--ring))", background: "hsl(var(--background))", foreground: "hsl(var(--foreground))", primary: { DEFAULT: "hsl(var(--primary))", foreground: "hsl(var(--primary-foreground))", }, secondary: { DEFAULT: "hsl(var(--secondary))", foreground: "hsl(var(--secondary-foreground))", }, destructive: { DEFAULT: "hsl(var(--destructive))", foreground: "hsl(var(--destructive-foreground))", }, muted: { DEFAULT: "hsl(var(--muted))", foreground: "hsl(var(--muted-foreground))", }, accent: { DEFAULT: "hsl(var(--accent))", foreground: "hsl(var(--accent-foreground))", }, popover: { DEFAULT: "hsl(var(--popover))", foreground: "hsl(var(--popover-foreground))", }, card: { DEFAULT: "hsl(var(--card))", foreground: "hsl(var(--card-foreground))", }, }, borderRadius: { xl: "calc(var(--radius) + 2px)", lg: "var(--radius)", md: "calc(var(--radius) - 2px)", sm: "calc(var(--radius) - 4px)", }, keyframes: { "accordion-down": { from: { height: "0" }, to: { height: "var(--radix-accordion-content-height)" }, }, "accordion-up": { from: { height: "var(--radix-accordion-content-height)" }, to: { height: "0" }, }, }, animation: { "accordion-down": "accordion-down 0.2s ease-out", "accordion-up": "accordion-up 0.2s ease-out", }, }, }, plugins: [ require("tailwindcss-animate"), require("@tailwindcss/typography"), ], } satisfies Config; export default config;
alifarooq9/rapidlaunch/starterkits/saas/tailwind.config.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/tailwind.config.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1927 }
15
import Settings from '@/components/dashboard/settings'; import { redirect } from 'next/navigation'; import { createClient } from '@/utils/supabase/server'; import { getUserDetails, getUser } from '@/utils/supabase/queries'; export default async function SettingsPage() { const supabase = createClient(); const [user, userDetails] = await Promise.all([ getUser(supabase), getUserDetails(supabase) ]); if (!user) { return redirect('/dashboard/signin'); } return <Settings userDetails={userDetails} user={user} />; }
horizon-ui/shadcn-nextjs-boilerplate/app/dashboard/settings/page.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/app/dashboard/settings/page.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 168 }
16
export default function Separator(props: { text?: string }) { const { text } = props; return ( <div className="relative my-4"> <div className="relative flex items-center py-1"> <div className="grow border-t border-zinc-200 dark:border-zinc-700"></div> {text && ( <span className="mx-3 shrink text-sm leading-8 text-zinc-500"> {text} </span> )} <div className="grow border-t border-zinc-200 dark:border-zinc-700"></div> </div> </div> ); }
horizon-ui/shadcn-nextjs-boilerplate/components/auth-ui/Separator.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/auth-ui/Separator.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 235 }
17
import Footer from '@/components/footer/FooterAdmin'; import Navbar from '@/components/navbar/NavbarAdmin'; import { routes } from '@/components/routes'; import Sidebar from '@/components/sidebar/Sidebar'; import { Toaster } from '@/components/ui/toaster'; import { getActiveRoute } from '@/utils/navigation'; import { User } from '@supabase/supabase-js'; import { usePathname } from 'next/navigation'; import { OpenContext, UserContext, UserDetailsContext } from '@/contexts/layout'; import React from 'react'; interface Props { children: React.ReactNode; title: string; description: string; user: User | null | undefined; userDetails: User | null | undefined | any; } const DashboardLayout: React.FC<Props> = (props: Props) => { const pathname = usePathname(); const [open, setOpen] = React.useState(false); return ( <UserContext.Provider value={props.user}> <UserDetailsContext.Provider value={props.userDetails}> <OpenContext.Provider value={{ open, setOpen }}> <div className="dark:bg-background-900 flex h-full w-full bg-white"> <Toaster /> <Sidebar routes={routes} setOpen={setOpen} /> <div className="h-full w-full dark:bg-zinc-950"> <main className={`mx-2.5 flex-none transition-all dark:bg-zinc-950 md:pr-2 xl:ml-[328px]`} > <div className="mx-auto min-h-screen p-2 !pt-[90px] md:p-2 md:!pt-[118px]"> {props.children} </div> <Navbar brandText={getActiveRoute(routes, pathname)} /> <div className="p-3"> <Footer /> </div> </main> </div> </div> </OpenContext.Provider> </UserDetailsContext.Provider> </UserContext.Provider> ); }; export default DashboardLayout;
horizon-ui/shadcn-nextjs-boilerplate/components/layout/index.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/layout/index.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 822 }
18
import type { Config } from "tailwindcss" const config = { darkMode: ["class"], content: [ './app/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}', // Or if using `src` directory: './src/**/*.{js,ts,jsx,tsx,mdx}', ], prefix: "", theme: { container: { center: 'true', padding: '2rem', screens: { sm: '576px', 'sm-max': { max: '576px' }, md: '768px', 'md-max': { max: '768px' }, lg: '992px', 'lg-max': { max: '992px' }, xl: '1200px', 'xl-max': { max: '1200px' }, '2xl': '1320px', '2xl-max': { max: '1320px' }, '3xl': '1600px', '3xl-max': { max: '1600px' }, '4xl': '1850px', '4xl-max': { max: '1850px' } } }, extend: { fontFamily: { jakarta: ['Inter', 'sans-serif'], poppins: ['Poppins', 'sans-serif'] }, height: { '300px': '300px', '500px': '500px', sidebar: 'calc(100vh - 32px)' }, colors: { border: 'hsl(var(--border))', input: 'hsl(var(--input))', ring: 'hsl(var(--ring))', background: 'hsl(var(--background))', foreground: 'hsl(var(--foreground))', primary: { DEFAULT: 'hsl(var(--primary))', foreground: 'hsl(var(--primary-foreground))' }, secondary: { DEFAULT: 'hsl(var(--secondary))', foreground: 'hsl(var(--secondary-foreground))' }, destructive: { DEFAULT: 'hsl(var(--destructive))', foreground: 'hsl(var(--destructive-foreground))' }, muted: { DEFAULT: 'hsl(var(--muted))', foreground: 'hsl(var(--muted-foreground))' }, accent: { DEFAULT: 'hsl(var(--accent))', foreground: 'hsl(var(--accent-foreground))' }, popover: { DEFAULT: 'hsl(var(--popover))', foreground: 'hsl(var(--popover-foreground))' }, card: { DEFAULT: 'hsl(var(--card))', foreground: 'hsl(var(--card-foreground))', border: 'hsl(var(--border))' } }, borderRadius: { lg: 'var(--radius)', md: 'calc(var(--radius) - 2px)', sm: 'calc(var(--radius) - 4px)' }, keyframes: { 'accordion-down': { from: { height: '0' }, to: { height: 'var(--radix-accordion-content-height)' } }, 'accordion-up': { from: { height: 'var(--radix-accordion-content-height)' }, to: { height: '0' } }, 'accordion-down': { from: { height: '0' }, to: { height: 'var(--radix-accordion-content-height)' } }, 'accordion-up': { from: { height: 'var(--radix-accordion-content-height)' }, to: { height: '0' } } }, animation: { 'accordion-down': 'accordion-down 0.2s ease-out', 'accordion-up': 'accordion-up 0.2s ease-out', 'accordion-down': 'accordion-down 0.2s ease-out', 'accordion-up': 'accordion-up 0.2s ease-out' } } }, plugins: [require('tailwindcss-rtl'), require('tailwindcss-animate')], } satisfies Config export default config
horizon-ui/shadcn-nextjs-boilerplate/tailwind.config.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/tailwind.config.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 1826 }
19
import Stripe from 'stripe'; export const stripe = new Stripe( process.env.STRIPE_SECRET_KEY_LIVE ?? process.env.STRIPE_SECRET_KEY ?? '', { // https://github.com/stripe/stripe-node#configuration // https://stripe.com/docs/api/versioning // @ts-ignore apiVersion: null, // Register this as an official Stripe plugin. // https://stripe.com/docs/building-plugins#setappinfo appInfo: { name: 'Horizon AI Boilerplate', version: '1.1.0', url: 'https://github.com/horizon-ui/shadcn-nextjs-boilerplate' } } );
horizon-ui/shadcn-nextjs-boilerplate/utils/stripe/config.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/utils/stripe/config.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 227 }
20
import '../src/styles/global.css'; import type { Preview } from '@storybook/react'; const preview: Preview = { parameters: { controls: { matchers: { color: /(background|color)$/i, date: /Date$/i, }, }, nextjs: { appDirectory: true, }, }, }; export default preview;
ixartz/SaaS-Boilerplate/.storybook/preview.ts
{ "file_path": "ixartz/SaaS-Boilerplate/.storybook/preview.ts", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 140 }
21
'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { cn } from '@/utils/Helpers'; export const ActiveLink = (props: { href: string; children: React.ReactNode }) => { const pathname = usePathname(); return ( <Link href={props.href} className={cn( 'px-3 py-2', pathname.endsWith(props.href) && 'rounded-md bg-primary text-primary-foreground', )} > {props.children} </Link> ); };
ixartz/SaaS-Boilerplate/src/components/ActiveLink.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/components/ActiveLink.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 211 }
22
'use client'; import * as LabelPrimitive from '@radix-ui/react-label'; import { cva, type VariantProps } from 'class-variance-authority'; import * as React from 'react'; import { cn } from '@/utils/Helpers'; 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 };
ixartz/SaaS-Boilerplate/src/components/ui/label.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/components/ui/label.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 251 }
23
'use client'; import Link from 'next/link'; import { ToggleMenuButton } from '@/components/ToggleMenuButton'; import { useMenu } from '@/hooks/UseMenu'; import { cn } from '@/utils/Helpers'; export const CenteredMenu = (props: { logo: React.ReactNode; children: React.ReactNode; rightMenu: React.ReactNode; }) => { const { showMenu, handleToggleMenu } = useMenu(); const navClass = cn('max-lg:w-full max-lg:bg-secondary max-lg:p-5', { 'max-lg:hidden': !showMenu, }); return ( <div className="flex flex-wrap items-center justify-between"> <Link href="/">{props.logo}</Link> <div className="lg:hidden [&_button:hover]:opacity-100 [&_button]:opacity-60"> <ToggleMenuButton onClick={handleToggleMenu} /> </div> <nav className={cn('rounded-t max-lg:mt-2', navClass)}> <ul className="flex gap-x-6 gap-y-1 text-lg font-medium max-lg:flex-col [&_a:hover]:opacity-100 [&_a]:opacity-60 max-lg:[&_a]:inline-block max-lg:[&_a]:w-full"> {props.children} </ul> </nav> <div className={cn( 'rounded-b max-lg:border-t max-lg:border-border', navClass, )} > <ul className="flex flex-row items-center gap-x-4 text-lg font-medium [&_li:not(:last-child):hover]:opacity-100 [&_li:not(:last-child)]:opacity-60"> {props.rightMenu} </ul> </div> </div> ); };
ixartz/SaaS-Boilerplate/src/features/landing/CenteredMenu.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/features/landing/CenteredMenu.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 638 }
24
import { bigint, pgTable, serial, text, timestamp, uniqueIndex, } from 'drizzle-orm/pg-core'; // This file defines the structure of your database tables using the Drizzle ORM. // To modify the database schema: // 1. Update this file with your desired changes. // 2. Generate a new migration by running: `npm run db:generate` // The generated migration file will reflect your schema changes. // The migration is automatically applied during the next database interaction, // so there's no need to run it manually or restart the Next.js server. export const organizationSchema = pgTable( 'organization', { id: text('id').primaryKey(), stripeCustomerId: text('stripe_customer_id'), stripeSubscriptionId: text('stripe_subscription_id'), stripeSubscriptionPriceId: text('stripe_subscription_price_id'), stripeSubscriptionStatus: text('stripe_subscription_status'), stripeSubscriptionCurrentPeriodEnd: bigint( 'stripe_subscription_current_period_end', { mode: 'number' }, ), updatedAt: timestamp('updated_at', { mode: 'date' }) .defaultNow() .$onUpdate(() => new Date()) .notNull(), createdAt: timestamp('created_at', { mode: 'date' }).defaultNow().notNull(), }, (table) => { return { stripeCustomerIdIdx: uniqueIndex('stripe_customer_id_idx').on( table.stripeCustomerId, ), }; }, ); export const todoSchema = pgTable('todo', { id: serial('id').primaryKey(), ownerId: text('owner_id').notNull(), title: text('title').notNull(), message: text('message').notNull(), updatedAt: timestamp('updated_at', { mode: 'date' }) .defaultNow() .$onUpdate(() => new Date()) .notNull(), createdAt: timestamp('created_at', { mode: 'date' }).defaultNow().notNull(), });
ixartz/SaaS-Boilerplate/src/models/Schema.ts
{ "file_path": "ixartz/SaaS-Boilerplate/src/models/Schema.ts", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 609 }
25
import type { LocalePrefix } from 'node_modules/next-intl/dist/types/src/routing/types'; import { BILLING_INTERVAL, type PricingPlan } from '@/types/Subscription'; const localePrefix: LocalePrefix = 'as-needed'; // FIXME: Update this configuration file based on your project information export const AppConfig = { name: 'SaaS Template', locales: [ { id: 'en', name: 'English', }, { id: 'fr', name: 'Francais' }, ], defaultLocale: 'en', localePrefix, }; export const AllLocales = AppConfig.locales.map(locale => locale.id); export const PLAN_ID = { FREE: 'free', PREMIUM: 'premium', ENTERPRISE: 'enterprise', } as const; export const PricingPlanList: Array<PricingPlan> = [ { id: PLAN_ID.FREE, price: 0, interval: BILLING_INTERVAL.MONTH, testPriceId: '', devPriceId: '', prodPriceId: '', features: { teamMember: 2, website: 2, storage: 2, transfer: 2, }, }, { id: PLAN_ID.PREMIUM, price: 79, interval: BILLING_INTERVAL.MONTH, testPriceId: 'price_premium_test', // Use for testing // FIXME: Update the price ID, you can create it after running `npm run stripe:setup-price` devPriceId: 'price_1PNksvKOp3DEwzQlGOXO7YBK', prodPriceId: '', features: { teamMember: 5, website: 5, storage: 5, transfer: 5, }, }, { id: PLAN_ID.ENTERPRISE, price: 199, interval: BILLING_INTERVAL.MONTH, testPriceId: 'price_enterprise_test', // Use for testing // FIXME: Update the price ID, you can create it after running `npm run stripe:setup-price` devPriceId: 'price_1PNksvKOp3DEwzQli9IvXzgb', prodPriceId: 'price_123', features: { teamMember: 100, website: 100, storage: 100, transfer: 100, }, }, ];
ixartz/SaaS-Boilerplate/src/utils/AppConfig.ts
{ "file_path": "ixartz/SaaS-Boilerplate/src/utils/AppConfig.ts", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 763 }
26
/** * djb2 hashing function * * @param {string} string * @param {number} seed * @returns {string} A hashed string of 6 characters */ export const hash = (string: string, seed = 5381) => { let i = string.length; while (i) { // eslint-disable-next-line no-bitwise, no-plusplus seed = (seed * 33) ^ string.charCodeAt(--i); } // eslint-disable-next-line no-bitwise return (seed >>> 0).toString(36).substr(0, 6); }; /** * Generate Hashed string based on name and attributes * * @param {object} seed * @param {string} seed.name A name, for example an icon name * @param {object} seed.attributes An object of SVGElement Attrbutes * @returns {string} A hashed string of 6 characters */ export const generateHashedKey = ({ name, attributes }) => hash(JSON.stringify([name, attributes]));
lucide-icons/lucide/docs/.vitepress/lib/helpers.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/lib/helpers.ts", "repo_id": "lucide-icons/lucide", "token_count": 268 }
27
import packageData from '../../../data/packageData.json'; import thirdPartyPackages from '../../../data/packageData.thirdParty.json'; import fetchPackages from '../../../lib/fetchPackages'; export default { async load() { const packages = await fetchPackages(); return { packages: packages .filter((p) => p?.name != null && p.name in packageData) .map((pData) => ({ ...pData, ...packageData[pData.name], documentation: `/guide/packages/${pData.name}`, source: `https://github.com/lucide-icons/lucide/tree/main/packages/${pData.name}`, icon: `/framework-logos/${packageData[pData.name].icon}.svg`, })) .sort((a, b) => a.order - b.order), thirdPartyPackages, }; }, };
lucide-icons/lucide/docs/.vitepress/theme/components/packages/PackageList.data.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/theme/components/packages/PackageList.data.ts", "repo_id": "lucide-icons/lucide", "token_count": 324 }
28
import { h } from 'vue'; import DefaultTheme from 'vitepress/theme'; import './style.css'; import { Theme } from 'vitepress'; import IconsSidebarNavAfter from './layouts/IconsSidebarNavAfter.vue'; import HomeHeroIconsCard from './components/home/HomeHeroIconsCard.vue'; import HomeHeroBefore from './components/home/HomeHeroBefore.vue'; import { ICON_STYLE_CONTEXT, iconStyleContext } from './composables/useIconStyle'; import { CATEGORY_VIEW_CONTEXT, categoryViewContext } from './composables/useCategoryView'; import { EXTERNAL_LIBS_CONTEXT, externalLibContext } from './composables/useExternalLibs'; const theme: Partial<Theme> = { extends: DefaultTheme, Layout() { return h(DefaultTheme.Layout, null, { 'home-hero-before': () => h(HomeHeroBefore), 'sidebar-nav-after': () => h(IconsSidebarNavAfter), 'home-hero-image': () => h(HomeHeroIconsCard), }); }, enhanceApp({ app }) { app.provide(ICON_STYLE_CONTEXT, iconStyleContext); app.provide(CATEGORY_VIEW_CONTEXT, categoryViewContext); app.provide(EXTERNAL_LIBS_CONTEXT, externalLibContext); }, }; export default theme;
lucide-icons/lucide/docs/.vitepress/theme/index.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/theme/index.ts", "repo_id": "lucide-icons/lucide", "token_count": 399 }
29
import { TentTree, Caravan, FlameKindling, MountainSnow, Trees, Axe, Map, CloudMoon, Sparkles, } from "lucide-react"; import "./icon.css"; function App() { return ( <div className="app"> <TentTree /> <Caravan /> <FlameKindling /> <MountainSnow /> <Trees /> <Axe /> <Map /> <CloudMoon /> <Sparkles /> </div> ); } export default App;
lucide-icons/lucide/docs/guide/advanced/examples/global-styling-absolute-strokewidth-example/App.js
{ "file_path": "lucide-icons/lucide/docs/guide/advanced/examples/global-styling-absolute-strokewidth-example/App.js", "repo_id": "lucide-icons/lucide", "token_count": 197 }
30
import { Beer } from "lucide-react"; import "./icon.css"; function App() { return ( <div className="app"> <Beer className="my-beer-icon" /> </div> ); } export default App;
lucide-icons/lucide/docs/guide/basics/examples/size-icon-css-example/App.js
{ "file_path": "lucide-icons/lucide/docs/guide/basics/examples/size-icon-css-example/App.js", "repo_id": "lucide-icons/lucide", "token_count": 78 }
31
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 223 236" width="32"> <path fill="url(#b)" d="m222.08 39.2-8.02 125.91L137.39 0l84.69 39.2Zm-53.1 162.82-57.94 33.05-57.93-33.05 11.78-28.56h92.3l11.78 28.56ZM111.03 62.68l30.36 73.8H80.68l30.36-73.8ZM7.94 165.12 0 39.19 84.69 0 7.94 165.12Z"/> <path fill="url(#c)" d="m222.08 39.2-8.02 125.91L137.39 0l84.69 39.2Zm-53.1 162.82-57.94 33.05-57.93-33.05 11.78-28.56h92.3l11.78 28.56ZM111.03 62.68l30.36 73.8H80.68l30.36-73.8ZM7.94 165.12 0 39.19 84.69 0 7.94 165.12Z"/> <defs> <linearGradient id="b" x1="49.01" x2="225.83" y1="213.75" y2="129.72" gradientUnits="userSpaceOnUse"> <stop stop-color="#E40035"/> <stop offset=".24" stop-color="#F60A48"/> <stop offset=".35" stop-color="#F20755"/> <stop offset=".49" stop-color="#DC087D"/> <stop offset=".74" stop-color="#9717E7"/> <stop offset="1" stop-color="#6C00F5"/> </linearGradient> <linearGradient id="c" x1="41.02" x2="156.74" y1="28.34" y2="160.34" gradientUnits="userSpaceOnUse"> <stop stop-color="#FF31D9"/> <stop offset="1" stop-color="#FF5BE1" stop-opacity="0"/> </linearGradient> </defs> </svg>
lucide-icons/lucide/docs/public/framework-logos/angular.svg
{ "file_path": "lucide-icons/lucide/docs/public/framework-logos/angular.svg", "repo_id": "lucide-icons/lucide", "token_count": 604 }
32
<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="M9 6 6.5 3.5a1.5 1.5 0 0 0-1-.5C4.683 3 4 3.683 4 4.5V17a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5" /> <line x1="10" x2="8" y1="5" y2="7" /> <line x1="2" x2="22" y1="12" y2="12" /> <line x1="7" x2="7" y1="19" y2="21" /> <line x1="17" x2="17" y1="19" y2="21" /> </svg>
lucide-icons/lucide/icons/bath.svg
{ "file_path": "lucide-icons/lucide/icons/bath.svg", "repo_id": "lucide-icons/lucide", "token_count": 259 }
33
<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="M9 9c-.64.64-1.521.954-2.402 1.165A6 6 0 0 0 8 22a13.96 13.96 0 0 0 9.9-4.1" /> <path d="M10.75 5.093A6 6 0 0 1 22 8c0 2.411-.61 4.68-1.683 6.66" /> <path d="M5.341 10.62a4 4 0 0 0 6.487 1.208M10.62 5.341a4.015 4.015 0 0 1 2.039 2.04" /> <line x1="2" x2="22" y1="2" y2="22" /> </svg>
lucide-icons/lucide/icons/bean-off.svg
{ "file_path": "lucide-icons/lucide/icons/bean-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 263 }
34
<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 7h.01" /> <path d="M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20" /> <path d="m20 7 2 .5-2 .5" /> <path d="M10 18v3" /> <path d="M14 17.75V21" /> <path d="M7 18a6 6 0 0 0 3.84-10.61" /> </svg>
lucide-icons/lucide/icons/bird.svg
{ "file_path": "lucide-icons/lucide/icons/bird.svg", "repo_id": "lucide-icons/lucide", "token_count": 218 }
35
<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 10h18V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7" /> <path d="M8 2v4" /> <path d="M16 2v4" /> <path d="M21.29 14.7a2.43 2.43 0 0 0-2.65-.52c-.3.12-.57.3-.8.53l-.34.34-.35-.34a2.43 2.43 0 0 0-2.65-.53c-.3.12-.56.3-.79.53-.95.94-1 2.53.2 3.74L17.5 22l3.6-3.55c1.2-1.21 1.14-2.8.19-3.74Z" /> </svg>
lucide-icons/lucide/icons/calendar-heart.svg
{ "file_path": "lucide-icons/lucide/icons/calendar-heart.svg", "repo_id": "lucide-icons/lucide", "token_count": 296 }
36
<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 12h20" /> <path d="M20 12v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8" /> <path d="m4 8 16-4" /> <path d="m8.86 6.78-.45-1.81a2 2 0 0 1 1.45-2.43l1.94-.48a2 2 0 0 1 2.43 1.46l.45 1.8" /> </svg>
lucide-icons/lucide/icons/cooking-pot.svg
{ "file_path": "lucide-icons/lucide/icons/cooking-pot.svg", "repo_id": "lucide-icons/lucide", "token_count": 213 }
37
<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" > <ellipse cx="12" cy="5" rx="9" ry="3" /> <path d="M3 5V19A9 3 0 0 0 21 19V5" /> <path d="M3 12A9 3 0 0 0 21 12" /> </svg>
lucide-icons/lucide/icons/database.svg
{ "file_path": "lucide-icons/lucide/icons/database.svg", "repo_id": "lucide-icons/lucide", "token_count": 158 }
38
<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.25 16.25h1.5L12 17z" /> <path d="M16 14v.5" /> <path d="M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309" /> <path d="M8 14v.5" /> <path d="M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5" /> </svg>
lucide-icons/lucide/icons/dog.svg
{ "file_path": "lucide-icons/lucide/icons/dog.svg", "repo_id": "lucide-icons/lucide", "token_count": 384 }
39
<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 11h.01" /> <path d="M14 6h.01" /> <path d="M18 6h.01" /> <path d="M6.5 13.1h.01" /> <path d="M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3" /> <path d="M17.4 9.9c-.8.8-2 .8-2.8 0" /> <path d="M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7" /> <path d="M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4" /> </svg>
lucide-icons/lucide/icons/drama.svg
{ "file_path": "lucide-icons/lucide/icons/drama.svg", "repo_id": "lucide-icons/lucide", "token_count": 346 }
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 3h6v6" /> <path d="M10 14 21 3" /> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" /> </svg>
lucide-icons/lucide/icons/external-link.svg
{ "file_path": "lucide-icons/lucide/icons/external-link.svg", "repo_id": "lucide-icons/lucide", "token_count": 166 }
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="M4 3 2 5v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z" /> <path d="M6 8h4" /> <path d="M6 18h4" /> <path d="m12 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z" /> <path d="M14 8h4" /> <path d="M14 18h4" /> <path d="m20 3-2 2v15c0 .6.4 1 1 1h2c.6 0 1-.4 1-1V5Z" /> </svg>
lucide-icons/lucide/icons/fence.svg
{ "file_path": "lucide-icons/lucide/icons/fence.svg", "repo_id": "lucide-icons/lucide", "token_count": 262 }
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="12" cy="12" r="3" /> <path d="M3 7V5a2 2 0 0 1 2-2h2" /> <path d="M17 3h2a2 2 0 0 1 2 2v2" /> <path d="M21 17v2a2 2 0 0 1-2 2h-2" /> <path d="M7 21H5a2 2 0 0 1-2-2v-2" /> </svg>
lucide-icons/lucide/icons/focus.svg
{ "file_path": "lucide-icons/lucide/icons/focus.svg", "repo_id": "lucide-icons/lucide", "token_count": 206 }
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" > <line x1="3" x2="15" y1="22" y2="22" /> <line x1="4" x2="14" y1="9" y2="9" /> <path d="M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18" /> <path d="M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2a2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5" /> </svg>
lucide-icons/lucide/icons/fuel.svg
{ "file_path": "lucide-icons/lucide/icons/fuel.svg", "repo_id": "lucide-icons/lucide", "token_count": 236 }
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" > <circle cx="6" cy="6" r="3" /> <path d="M6 9v12" /> <path d="m21 3-6 6" /> <path d="m21 9-6-6" /> <path d="M18 11.5V15" /> <circle cx="18" cy="18" r="3" /> </svg>
lucide-icons/lucide/icons/git-pull-request-closed.svg
{ "file_path": "lucide-icons/lucide/icons/git-pull-request-closed.svg", "repo_id": "lucide-icons/lucide", "token_count": 182 }
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 14h-1.343" /> <path d="M9.128 3.47A9 9 0 0 1 21 12v3.343" /> <path d="m2 2 20 20" /> <path d="M20.414 20.414A2 2 0 0 1 19 21h-1a2 2 0 0 1-2-2v-3" /> <path d="M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 2.636-6.364" /> </svg>
lucide-icons/lucide/icons/headphone-off.svg
{ "file_path": "lucide-icons/lucide/icons/headphone-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 247 }
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" > <path d="M11 8c2-3-2-3 0-6" /> <path d="M15.5 8c2-3-2-3 0-6" /> <path d="M6 10h.01" /> <path d="M6 14h.01" /> <path d="M10 16v-4" /> <path d="M14 16v-4" /> <path d="M18 16v-4" /> <path d="M20 6a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3" /> <path d="M5 20v2" /> <path d="M19 20v2" /> </svg>
lucide-icons/lucide/icons/heater.svg
{ "file_path": "lucide-icons/lucide/icons/heater.svg", "repo_id": "lucide-icons/lucide", "token_count": 288 }
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="M5 22h14" /> <path d="M5 2h14" /> <path d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22" /> <path d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2" /> </svg>
lucide-icons/lucide/icons/hourglass.svg
{ "file_path": "lucide-icons/lucide/icons/hourglass.svg", "repo_id": "lucide-icons/lucide", "token_count": 218 }
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="M21 9v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7" /> <line x1="16" x2="22" y1="5" y2="5" /> <circle cx="9" cy="9" r="2" /> <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" /> </svg>
lucide-icons/lucide/icons/image-minus.svg
{ "file_path": "lucide-icons/lucide/icons/image-minus.svg", "repo_id": "lucide-icons/lucide", "token_count": 216 }
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" > <polyline points="22 12 16 12 14 15 10 15 8 12 2 12" /> <path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" /> </svg>
lucide-icons/lucide/icons/inbox.svg
{ "file_path": "lucide-icons/lucide/icons/inbox.svg", "repo_id": "lucide-icons/lucide", "token_count": 190 }
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="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z" /> <rect width="4" height="12" x="2" y="9" /> <circle cx="4" cy="4" r="2" /> </svg>
lucide-icons/lucide/icons/linkedin.svg
{ "file_path": "lucide-icons/lucide/icons/linkedin.svg", "repo_id": "lucide-icons/lucide", "token_count": 192 }
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" > <line x1="10" x2="21" y1="6" y2="6" /> <line x1="10" x2="21" y1="12" y2="12" /> <line x1="10" x2="21" y1="18" y2="18" /> <path d="M4 6h1v4" /> <path d="M4 10h2" /> <path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1" /> </svg>
lucide-icons/lucide/icons/list-ordered.svg
{ "file_path": "lucide-icons/lucide/icons/list-ordered.svg", "repo_id": "lucide-icons/lucide", "token_count": 228 }
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" > <circle cx="12" cy="16" r="1" /> <rect x="3" y="10" width="18" height="12" rx="2" /> <path d="M7 10V7a5 5 0 0 1 10 0v3" /> </svg>
lucide-icons/lucide/icons/lock-keyhole.svg
{ "file_path": "lucide-icons/lucide/icons/lock-keyhole.svg", "repo_id": "lucide-icons/lucide", "token_count": 157 }
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="m6 15-4-4 6.75-6.77a7.79 7.79 0 0 1 11 11L13 22l-4-4 6.39-6.36a2.14 2.14 0 0 0-3-3L6 15" /> <path d="m5 8 4 4" /> <path d="m12 15 4 4" /> </svg>
lucide-icons/lucide/icons/magnet.svg
{ "file_path": "lucide-icons/lucide/icons/magnet.svg", "repo_id": "lucide-icons/lucide", "token_count": 183 }
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="M12.586 12.586 19 19" /> <path d="M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z" /> </svg>
lucide-icons/lucide/icons/mouse-pointer.svg
{ "file_path": "lucide-icons/lucide/icons/mouse-pointer.svg", "repo_id": "lucide-icons/lucide", "token_count": 202 }
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" > <circle cx="13.5" cy="6.5" r=".5" fill="currentColor" /> <circle cx="17.5" cy="10.5" r=".5" fill="currentColor" /> <circle cx="8.5" cy="7.5" r=".5" fill="currentColor" /> <circle cx="6.5" cy="12.5" r=".5" fill="currentColor" /> <path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" /> </svg>
lucide-icons/lucide/icons/palette.svg
{ "file_path": "lucide-icons/lucide/icons/palette.svg", "repo_id": "lucide-icons/lucide", "token_count": 330 }
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="M7 19H4.815a1.83 1.83 0 0 1-1.57-.881 1.785 1.785 0 0 1-.004-1.784L7.196 9.5" /> <path d="M11 19h8.203a1.83 1.83 0 0 0 1.556-.89 1.784 1.784 0 0 0 0-1.775l-1.226-2.12" /> <path d="m14 16-3 3 3 3" /> <path d="M8.293 13.596 7.196 9.5 3.1 10.598" /> <path d="m9.344 5.811 1.093-1.892A1.83 1.83 0 0 1 11.985 3a1.784 1.784 0 0 1 1.546.888l3.943 6.843" /> <path d="m13.378 9.633 4.096 1.098 1.097-4.096" /> </svg>
lucide-icons/lucide/icons/recycle.svg
{ "file_path": "lucide-icons/lucide/icons/recycle.svg", "repo_id": "lucide-icons/lucide", "token_count": 337 }
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" > <path d="M14 22v-4a2 2 0 1 0-4 0v4" /> <path d="m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2" /> <path d="M18 5v17" /> <path d="m4 6 8-4 8 4" /> <path d="M6 5v17" /> <circle cx="12" cy="9" r="2" /> </svg>
lucide-icons/lucide/icons/school.svg
{ "file_path": "lucide-icons/lucide/icons/school.svg", "repo_id": "lucide-icons/lucide", "token_count": 218 }
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="m13 13.5 2-2.5-2-2.5" /> <path d="m21 21-4.3-4.3" /> <path d="M9 8.5 7 11l2 2.5" /> <circle cx="11" cy="11" r="8" /> </svg>
lucide-icons/lucide/icons/search-code.svg
{ "file_path": "lucide-icons/lucide/icons/search-code.svg", "repo_id": "lucide-icons/lucide", "token_count": 171 }
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="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z" /> <rect x="3" y="14" width="7" height="7" rx="1" /> <circle cx="17.5" cy="17.5" r="3.5" /> </svg>
lucide-icons/lucide/icons/shapes.svg
{ "file_path": "lucide-icons/lucide/icons/shapes.svg", "repo_id": "lucide-icons/lucide", "token_count": 207 }
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="m15 15 6 6m-6-6v4.8m0-4.8h4.8" /> <path d="M9 19.8V15m0 0H4.2M9 15l-6 6" /> <path d="M15 4.2V9m0 0h4.8M15 9l6-6" /> <path d="M9 4.2V9m0 0H4.2M9 9 3 3" /> </svg>
lucide-icons/lucide/icons/shrink.svg
{ "file_path": "lucide-icons/lucide/icons/shrink.svg", "repo_id": "lucide-icons/lucide", "token_count": 208 }
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="M22 11v1a10 10 0 1 1-9-10" /> <path d="M8 14s1.5 2 4 2 4-2 4-2" /> <line x1="9" x2="9.01" y1="9" y2="9" /> <line x1="15" x2="15.01" y1="9" y2="9" /> <path d="M16 5h6" /> <path d="M19 2v6" /> </svg>
lucide-icons/lucide/icons/smile-plus.svg
{ "file_path": "lucide-icons/lucide/icons/smile-plus.svg", "repo_id": "lucide-icons/lucide", "token_count": 218 }
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="M3 3h.01" /> <path d="M7 5h.01" /> <path d="M11 7h.01" /> <path d="M3 7h.01" /> <path d="M7 9h.01" /> <path d="M3 11h.01" /> <rect width="4" height="4" x="15" y="5" /> <path d="m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2" /> <path d="m13 14 8-2" /> <path d="m13 19 8-2" /> </svg>
lucide-icons/lucide/icons/spray-can.svg
{ "file_path": "lucide-icons/lucide/icons/spray-can.svg", "repo_id": "lucide-icons/lucide", "token_count": 270 }
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" > <path d="M10 9.5 8 12l2 2.5" /> <path d="m14 9.5 2 2.5-2 2.5" /> <rect width="18" height="18" x="3" y="3" rx="2" /> </svg>
lucide-icons/lucide/icons/square-code.svg
{ "file_path": "lucide-icons/lucide/icons/square-code.svg", "repo_id": "lucide-icons/lucide", "token_count": 159 }
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="M4 10c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h4c1.1 0 2 .9 2 2" /> <path d="M10 16c-1.1 0-2-.9-2-2v-4c0-1.1.9-2 2-2h4c1.1 0 2 .9 2 2" /> <rect width="8" height="8" x="14" y="14" rx="2" /> </svg>
lucide-icons/lucide/icons/square-stack.svg
{ "file_path": "lucide-icons/lucide/icons/square-stack.svg", "repo_id": "lucide-icons/lucide", "token_count": 222 }
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="M5 22h14" /> <path d="M19.27 13.73A2.5 2.5 0 0 0 17.5 13h-11A2.5 2.5 0 0 0 4 15.5V17a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-1.5c0-.66-.26-1.3-.73-1.77Z" /> <path d="M14 13V8.5C14 7 15 7 15 5a3 3 0 0 0-3-3c-1.66 0-3 1-3 3s1 2 1 3.5V13" /> </svg>
lucide-icons/lucide/icons/stamp.svg
{ "file_path": "lucide-icons/lucide/icons/stamp.svg", "repo_id": "lucide-icons/lucide", "token_count": 246 }
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="m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44" /> <path d="m13.56 11.747 4.332-.924" /> <path d="m16 21-3.105-6.21" /> <path d="M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z" /> <path d="m6.158 8.633 1.114 4.456" /> <path d="m8 21 3.105-6.21" /> <circle cx="12" cy="13" r="2" /> </svg>
lucide-icons/lucide/icons/telescope.svg
{ "file_path": "lucide-icons/lucide/icons/telescope.svg", "repo_id": "lucide-icons/lucide", "token_count": 343 }
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="M9.3 6.2a4.55 4.55 0 0 0 5.4 0" /> <path d="M7.9 10.7c.9.8 2.4 1.3 4.1 1.3s3.2-.5 4.1-1.3" /> <path d="M13.9 3.5a1.93 1.93 0 0 0-3.8-.1l-3 10c-.1.2-.1.4-.1.6 0 1.7 2.2 3 5 3s5-1.3 5-3c0-.2 0-.4-.1-.5Z" /> <path d="m7.5 12.2-4.7 2.7c-.5.3-.8.7-.8 1.1s.3.8.8 1.1l7.6 4.5c.9.5 2.1.5 3 0l7.6-4.5c.7-.3 1-.7 1-1.1s-.3-.8-.8-1.1l-4.7-2.8" /> </svg>
lucide-icons/lucide/icons/traffic-cone.svg
{ "file_path": "lucide-icons/lucide/icons/traffic-cone.svg", "repo_id": "lucide-icons/lucide", "token_count": 350 }
68