text
stringlengths
21
253k
id
stringlengths
25
123
metadata
dict
__index_level_0__
int64
0
181
"use client" import React from "react" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardDescription, CardTitle } from "@/components/ui/card" import { Icons } from "@/components/icons" import AdBanner from "@/components/ad-banner" function EzWaitlist() { return ( <div className="flex flex-wrap justify-start gap-4 pb-10 max-w-full min-w-full px-0 lg:px-20"> <div className="w-full sm:w-1/2 p-2 mt-3 space-y-4 lg:mt-5 md:lg-5"> <CardTitle className="text-3xl tracking-tight leading-7">Easy Waitlist</CardTitle> <CardDescription className="text-balance text-lg text-muted-foreground"> Ready-to-use Waitlist Page. </CardDescription> <Badge className="hidden sm:inline-block" variant="default"> Recommended for people willing to pre-launch the product for finding PMF </Badge> </div> <div className="lg:min-w-[900px] px-1 lg:px-2 sm:w-1/2 p-1 lg:p-2 "> <video muted loop className="w-full h-auto border lg:border-none rounded-lg lg:rounded-xl shadow-2xl" autoPlay> <source src="https://pub-0cd6f9d4131f4f79ac40219248ae64db.r2.dev/easy-waitlist.mp4" type="video/mp4" /> </video> </div> <div className="sm:w-1/2 p-1 flex-col flex lg:min-w-[900px]"> <div className="flex justify-between"> <Button className="w-1/2 px-0 py-4 mr-2 group" type="submit" onClick={() => { const link = document.createElement("a") link.href = "https://github.com/DarkInventor/easy-waitlist/archive/refs/heads/main.zip" document.body.appendChild(link) link.click() document.body.removeChild(link) }} > Download Template <Icons.externalLink className="ml-1 p-1" /> </Button> <Button className="w-1/2 px-0 py-4 border shadow-sm ml-2 hover:bg-accent hover:text-accent-foreground" variant="outline" type="submit" onClick={() => window.open("https://easy-waitlist.vercel.app/", "_blank") } > Live Preview <Icons.externalLink className="ml-1 p-1" />{" "} </Button> </div> <div className="space-y-4 lg:min-w-full max-w-full flex-col"> <h2 className="text-2xl font-bold pt-10 min-w-full max-w-full flex leading-7"> Why Should I Use This Template? </h2> <p className="min-w-full max-w-full flex text-md tracking-tight font-[500] leading-7"> This template is built specially for Indiehackers, Software Devs, and Software Entrepreneurs. Heres why this template is perfect for you: </p> <ul className="list-disc pl-5 space-y-2 text-md tracking-tight font-[500] mb-0 lg:pb-2 leading-7"> <li> Save your time</li> <li> No need to learn advanced animations</li> <li> Easy to configure and change</li> <li> 1-click download and setup</li> <li> 5 minutes to update the text and images</li> <li> Deploy live to Vercel</li> </ul> <h3 className="text-2xl font-semibold leading-7">Features</h3> <ul className="list-disc pl-5 space-y-2 text-md tracking-tight font-[500] leading-7"> <li>Header Section</li> <li>Hero Section</li> <li>Social Media Section</li> <li>Call To Action Section</li> <li>Mobile Responsive</li> </ul> <h3 className="text-2xl font-semibold leading-7">Tech Stack</h3> <div className="flex flex-wrap justify-start -m-2 dark:text-white leading-7"> <div className="p-2"><Badge className="bg-gradient-to-r from-blue-500 to-purple-600 text-white text-base py-0 px-4">React</Badge></div> <div className="p-2"><Badge className="bg-gradient-to-r from-green-500 to-blue-600 text-white text-base py-0 px-4">Next.js</Badge></div> <div className="p-2"><Badge className="bg-gradient-to-r from-yellow-400 to-orange-400 text-white text-base py-0 px-4">Tailwind CSS</Badge></div> <div className="p-2"><Badge className="bg-gradient-to-r from-pink-500 to-orange-500 text-white text-base py-0 px-4">Magic UI</Badge></div> <div className="p-2"><Badge className="bg-gradient-to-r from-gray-500 to-gray-700 text-white text-base py-0 px-4">Shadcn UI</Badge></div> <div className="p-2"><Badge className="bg-gradient-to-r from-purple-500 to-pink-600 text-white text-base py-0 px-4">Vercel</Badge></div> </div> <h3 className="text-2xl font-semibold leading-7">Quick Setup</h3> <ul className="list-disc pl-5 space-y-2 text-md tracking-tight font-[500] leading-7"> <li> 1-Click Download and Setup: Get started instantly with our easy setup process. </li> <li> 5 Minutes to Update: Quickly update text and images to match your brand. </li> <li> Deploy to Vercel: Easily deploy your site live with Vercels seamless integration. </li> </ul> <p className="leading-7 tracking-tight pt-0 lg:pt-5"> Get started today and bring your website to life with minimal effort and maximum impact! </p> </div> </div> </div> ) } export default EzWaitlist
DarkInventor/easy-ui/app/(docs)/ez-waitlist/page.tsx
{ "file_path": "DarkInventor/easy-ui/app/(docs)/ez-waitlist/page.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 2719 }
0
// @ts-ignore export default function PostBody({ children }) { return ( <div className="prose prose-lg prose-blue mx-auto whitespace-pre-line"> {children} </div> ) }
DarkInventor/easy-ui/app/posts/[slug]/PostBody.tsx
{ "file_path": "DarkInventor/easy-ui/app/posts/[slug]/PostBody.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 80 }
1
import { CSSProperties } from "react"; type Direction = | "top" | "bottom" | "left" | "right" | "top left" | "top right" | "bottom left" | "bottom right"; interface LinearGradientProps { /** * The color to transition from * @default #00000000 * @type string * */ from?: string; /** * The color to transition to * @default #290A5C * @type string * */ to?: string; /** * The width of the gradient * @default 100% * @type string * */ width?: string; /** * The height of the gradient * @default 100% * @type string * */ height?: string; /** * The direction of the gradient * @default bottom * @type string * */ direction?: Direction; /** * The point at which the transition occurs * @default 50% * @type string * */ transitionPoint?: string; /** * The class name to apply to the gradient * @default "" * @type string * */ className?: string; } const LinearGradient = ({ from = "#00000000", to = "rgba(120,119,198,0.3)", width = "100%", height = "100%", transitionPoint = "50%", direction = "bottom", className, }: LinearGradientProps) => { const styles: CSSProperties = { position: "absolute", pointerEvents: "none", inset: 0, width: width, height: height, background: `linear-gradient(to ${direction}, ${from}, ${transitionPoint}, ${to})`, }; return <div className={className} style={styles} />; }; export default LinearGradient;
DarkInventor/easy-ui/components/magicui/linear-gradient.tsx
{ "file_path": "DarkInventor/easy-ui/components/magicui/linear-gradient.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 544 }
2
import * as React from "react" import * as AccordionPrimitive from "@radix-ui/react-accordion" import { ChevronDown } from "lucide-react" import { cn } from "@/lib/utils" const Accordion = AccordionPrimitive.Root const AccordionItem = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Item>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> >(({ className, ...props }, ref) => ( <AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} /> )) AccordionItem.displayName = "AccordionItem" const AccordionTrigger = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Trigger>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> >(({ className, children, ...props }, ref) => ( <AccordionPrimitive.Header className="flex"> <AccordionPrimitive.Trigger ref={ref} className={cn( "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className )} {...props} > {children} <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" /> </AccordionPrimitive.Trigger> </AccordionPrimitive.Header> )) AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName const AccordionContent = React.forwardRef< React.ElementRef<typeof AccordionPrimitive.Content>, React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> >(({ className, children, ...props }, ref) => ( <AccordionPrimitive.Content ref={ref} className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down" {...props} > <div className={cn("pb-4 pt-0", className)}>{children}</div> </AccordionPrimitive.Content> )) AccordionContent.displayName = AccordionPrimitive.Content.displayName export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
DarkInventor/easy-ui/components/ui/accordion.tsx
{ "file_path": "DarkInventor/easy-ui/components/ui/accordion.tsx", "repo_id": "DarkInventor/easy-ui", "token_count": 688 }
3
// Inspired by react-hot-toast library import * as React from "react" import type { ToastActionElement, ToastProps, } from "@/components/ui/toast" const TOAST_LIMIT = 1 const TOAST_REMOVE_DELAY = 1000000 type ToasterToast = ToastProps & { id: string title?: React.ReactNode description?: React.ReactNode action?: ToastActionElement } const actionTypes = { ADD_TOAST: "ADD_TOAST", UPDATE_TOAST: "UPDATE_TOAST", DISMISS_TOAST: "DISMISS_TOAST", REMOVE_TOAST: "REMOVE_TOAST", } as const let count = 0 function genId() { count = (count + 1) % Number.MAX_SAFE_INTEGER return count.toString() } type ActionType = typeof actionTypes type Action = | { type: ActionType["ADD_TOAST"] toast: ToasterToast } | { type: ActionType["UPDATE_TOAST"] toast: Partial<ToasterToast> } | { type: ActionType["DISMISS_TOAST"] toastId?: ToasterToast["id"] } | { type: ActionType["REMOVE_TOAST"] toastId?: ToasterToast["id"] } interface State { toasts: ToasterToast[] } const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>() const addToRemoveQueue = (toastId: string) => { if (toastTimeouts.has(toastId)) { return } const timeout = setTimeout(() => { toastTimeouts.delete(toastId) dispatch({ type: "REMOVE_TOAST", toastId: toastId, }) }, TOAST_REMOVE_DELAY) toastTimeouts.set(toastId, timeout) } export const reducer = (state: State, action: Action): State => { switch (action.type) { case "ADD_TOAST": return { ...state, toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT), } case "UPDATE_TOAST": return { ...state, toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t ), } case "DISMISS_TOAST": { const { toastId } = action // ! Side effects ! - This could be extracted into a dismissToast() action, // but I'll keep it here for simplicity if (toastId) { addToRemoveQueue(toastId) } else { state.toasts.forEach((toast) => { addToRemoveQueue(toast.id) }) } return { ...state, toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined ? { ...t, open: false, } : t ), } } case "REMOVE_TOAST": if (action.toastId === undefined) { return { ...state, toasts: [], } } return { ...state, toasts: state.toasts.filter((t) => t.id !== action.toastId), } } } const listeners: Array<(state: State) => void> = [] let memoryState: State = { toasts: [] } function dispatch(action: Action) { memoryState = reducer(memoryState, action) listeners.forEach((listener) => { listener(memoryState) }) } type Toast = Omit<ToasterToast, "id"> function toast({ ...props }: Toast) { const id = genId() const update = (props: ToasterToast) => dispatch({ type: "UPDATE_TOAST", toast: { ...props, id }, }) const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id }) dispatch({ type: "ADD_TOAST", toast: { ...props, id, open: true, onOpenChange: (open) => { if (!open) dismiss() }, }, }) return { id: id, dismiss, update, } } function useToast() { const [state, setState] = React.useState<State>(memoryState) React.useEffect(() => { listeners.push(setState) return () => { const index = listeners.indexOf(setState) if (index > -1) { listeners.splice(index, 1) } } }, [state]) return { ...state, toast, dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }), } } export { useToast, toast }
DarkInventor/easy-ui/components/ui/use-toast.ts
{ "file_path": "DarkInventor/easy-ui/components/ui/use-toast.ts", "repo_id": "DarkInventor/easy-ui", "token_count": 1763 }
4
import Balance from "react-wrap-balancer"; import { ExternalLinkIcon } from "lucide-react"; import Link from "next/link"; import { siteUrls } from "@/config/urls"; import { buttonVariants } from "@/components/ui/button"; import { Icons } from "@/components/icons"; import { HighlightTabs } from "@/app/(app)/_components/highlight-tabs"; import { EarlyAccessForm } from "@/app/(app)/_components/early-access-form"; import Balancer from "react-wrap-balancer"; import { Background } from "@/components/background"; export default async function HomePage() { 8; const repoStars = await getRepoStars(); return ( <> <section className="container flex flex-col items-center justify-center gap-4 py-20"> <Link href={siteUrls.socials.twitter} className="flex items-center space-x-2 rounded-md bg-secondary px-3 py-2 text-sm hover:bg-secondary/80" > <span></span> <span className="font-medium"> RapidLaunch is in development. Follow our progress on X (formally Twitter) </span> <ExternalLinkIcon className="h-4 w-4 flex-shrink-0" /> </Link> <Balance as="h1" className="text-center font-heading text-3xl font-bold sm:text-4xl sm:leading-tight md:text-5xl md:leading-tight" > Rapidly launch your MVP with Beautiful Starterkits, Blocks, and more. </Balance> <Balance as="p" className="text-center text-muted-foreground sm:text-xl" > Elevate your development game with Rapidlaunch! Launch your apps faster with our SaaS starterkits, components, building guides, and more. Customizable. Open Source. </Balance> <div className="flex items-center gap-4"> <Link href={siteUrls.marketing.earlyAccess} className={buttonVariants({ className: "flex items-center gap-2", })} > Early Access </Link> <Link href={siteUrls.socials.github} className={buttonVariants({ className: "flex items-center", variant: "outline", })} > <Icons.gitHub className="mr-2 h-4 w-4" /> Github - <span className="ml-1 flex items-center font-normal text-muted-foreground"> {repoStars} </span> </Link> </div> <HighlightTabs className="mt-36" /> </section> <section id="early-access" className="relative border-y border-border bg-muted/30 py-36" > <Background> <div className="container flex max-w-xl flex-col items-center space-y-8"> <Balancer as="h2" className="w-full text-center font-heading text-4xl font-bold" > Join the Early Access List and get notified when we launch! </Balancer> <EarlyAccessForm /> </div> </Background> </section> </> ); } async function getRepoStars() { const response = await fetch( "https://api.github.com/repos/alifarooq9/rapidlaunch", { next: { // run every 15 minutes revalidate: 900, }, }, ); const data: unknown = await response.json(); const stars: number = (data as { stargazers_count?: string }) ?.stargazers_count ? Number((data as { stargazers_count?: string }).stargazers_count) : 0; return stars; }
alifarooq9/rapidlaunch/apps/www/src/app/(app)/(marketing)/page.tsx
{ "file_path": "alifarooq9/rapidlaunch/apps/www/src/app/(app)/(marketing)/page.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 2427 }
5
import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { cva } from "class-variance-authority"; import type { VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, size: { default: "h-10 px-4 py-2", sm: "h-9 rounded-md px-3", lg: "h-11 rounded-md px-8", icon: "h-10 w-10", iconSm: "h-9 w-9", }, }, defaultVariants: { variant: "default", size: "default", }, }, ); export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> { asChild?: boolean; } const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( ({ className, variant, size, asChild = false, ...props }, ref) => { const Comp = asChild ? Slot : "button"; return ( <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} /> ); }, ); Button.displayName = "Button"; export { Button, buttonVariants };
alifarooq9/rapidlaunch/apps/www/src/components/ui/button.tsx
{ "file_path": "alifarooq9/rapidlaunch/apps/www/src/components/ui/button.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1016 }
6
import { AppPageLoading } from "@/app/(app)/_components/page-loading"; import { dashboardPageConfig } from "@/app/(app)/(user)/dashboard/_constants/page-config"; import { Skeleton } from "@/components/ui/skeleton"; export default function DashboardLoading() { return ( <AppPageLoading title={dashboardPageConfig.title} description={dashboardPageConfig.description} > <Skeleton className="h-96 w-full" /> </AppPageLoading> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/dashboard/loading.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/dashboard/loading.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 191 }
7
import { siteUrls } from "@/config/urls"; import { getOrganizations } from "@/server/actions/organization/queries"; import { redirect } from "next/navigation"; import { Fragment, type ReactNode } from "react"; type OrgLayoutProps = { children: ReactNode; }; export default async function OrgLayout({ children }: OrgLayoutProps) { const { userOrgs } = await getOrganizations(); if (userOrgs.length === 0) { redirect(siteUrls.dashboard.home); } return <Fragment>{children}</Fragment>; }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/layout.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/layout.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 176 }
8
export const orgSettingsPageConfig = { title: "Organization Settings", description: "Manage your organization settings here, such as organization name, logo, and more!", } as const;
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/settings/_constants/page-config.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/(user)/org/settings/_constants/page-config.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 57 }
9
"use client"; import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu"; import { MixerHorizontalIcon } from "@radix-ui/react-icons"; import { type Table } from "@tanstack/react-table"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, } from "@/components/ui/dropdown-menu"; interface DataTableViewOptionsProps<TData> { table: Table<TData>; } export function DataTableViewOptions<TData>({ table, }: DataTableViewOptionsProps<TData>) { return ( <DropdownMenu> <DropdownMenuTrigger asChild> <Button variant="outline" size="sm" className="ml-auto hidden h-8 lg:flex" > <MixerHorizontalIcon className="mr-2 h-4 w-4" /> View </Button> </DropdownMenuTrigger> <DropdownMenuContent align="end" className="w-[150px]"> <DropdownMenuLabel>Toggle columns</DropdownMenuLabel> <DropdownMenuSeparator /> {table .getAllColumns() .filter( (column) => typeof column.accessorFn !== "undefined" && column.getCanHide(), ) .map((column) => { return ( <DropdownMenuCheckboxItem key={column.id} className="capitalize" checked={column.getIsVisible()} onCheckedChange={(value: unknown) => column.toggleVisibility(!!value) } > {column.id} </DropdownMenuCheckboxItem> ); })} </DropdownMenuContent> </DropdownMenu> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/_components/data-table-view-options.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/_components/data-table-view-options.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1252 }
10
"use client"; import { LineChart } from "@/components/charts"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { thousandToK } from "@/lib/utils"; type SubsChartProps = { data: { Date: string; SubsCount: number; }[]; }; export function SubsChart({ data }: SubsChartProps) { return ( <Card> <CardHeader> <CardTitle>Subscription Analytics</CardTitle> <CardDescription> Count of subscriptions each month for last 6 months </CardDescription> </CardHeader> <CardContent> <LineChart data={data} xAxisDataKey="Date" yAxisDataKey="SubsCount" lineDataKeys={["SubsCount"]} lineProps={[{ stroke: "hsl(var(--primary))" }]} yAxisProps={{ tickFormatter: (value) => { if (value >= 10000) { return `${thousandToK(Number(value)).toFixed(1)}k`; } else { return value as string; } }, }} /> </CardContent> </Card> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/dashboard/_components/subs-chart.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/dashboard/_components/subs-chart.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 827 }
11
"use client"; import { DataTable } from "@/app/(app)/_components/data-table"; import { type ColumnDef } from "@tanstack/react-table"; import React, { useMemo } from "react"; import { getColumns, type OrganizationsData } from "./columns"; import { useDataTable } from "@/hooks/use-data-table"; import type { DataTableSearchableColumn } from "@/types/data-table"; import { type getPaginatedOrgsQuery } from "@/server/actions/organization/queries"; /** @learn more about data-table at shadcn ui website @see https://ui.shadcn.com/docs/components/data-table */ type OrgsTableProps = { orgsPromise: ReturnType<typeof getPaginatedOrgsQuery>; }; const searchableColumns: DataTableSearchableColumn<OrganizationsData>[] = [ { id: "email", placeholder: "Search email..." }, ]; export function OrgsTable({ orgsPromise }: OrgsTableProps) { const { data, pageCount, total } = React.use(orgsPromise); const columns = useMemo<ColumnDef<OrganizationsData, unknown>[]>( () => getColumns(), [], ); const organizationsData: OrganizationsData[] = data.map((org) => { const members = org.members.map((mto) => { return { id: mto.id, name: mto.name, email: mto.email, image: mto.image, role: mto.role, }; }); return { id: org.id, name: org.name, email: org.email, createdAt: org.createdAt, image: org.image, members: members, owner: { id: org.ownerId, name: org.owner.name, email: org.owner.email, image: org.owner.image, }, subscribed: org.subscriptions?.id ? true : false, }; }); const { table } = useDataTable({ data: organizationsData, columns, pageCount, searchableColumns, }); return ( <DataTable table={table} columns={columns} searchableColumns={searchableColumns} totalRows={total} /> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/organizations/_components/orgs-table.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/organizations/_components/orgs-table.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 990 }
12
import { AppPageShell } from "@/app/(app)/_components/page-shell"; import { WaitlistTable } from "@/app/(app)/admin/waitlist/_components/waitlist-table"; import { waitlistPageConfig } from "@/app/(app)/admin/waitlist/_constants/page-config"; import { getAllWaitlistUsersQuery, getPaginatedWaitlistQuery, } from "@/server/actions/waitlist/query"; import type { SearchParams } from "@/types/data-table"; import { z } from "zod"; import json2csv from "json2csv"; import { DownloadCsvBtn } from "@/app/(app)/admin/waitlist/_components/download-csv-btn"; type WaitlistProps = { searchParams: SearchParams; }; const searchParamsSchema = z.object({ page: z.coerce.number().default(1), per_page: z.coerce.number().default(10), sort: z.string().optional(), email: z.string().optional(), operator: z.string().optional(), }); export default async function Waitlist({ searchParams }: WaitlistProps) { const search = searchParamsSchema.parse(searchParams); const waitlistPromise = getPaginatedWaitlistQuery(search); const waitlistData = await getAllWaitlistUsersQuery(); const csvData = await json2csv.parseAsync(waitlistData); return ( <AppPageShell title={waitlistPageConfig.title} description={waitlistPageConfig.description} > <div className="w-full space-y-6"> <div className="flex items-center justify-end"> <DownloadCsvBtn data={csvData} /> </div> <WaitlistTable waitlistPromise={waitlistPromise} /> </div> </AppPageShell> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/waitlist/page.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/waitlist/page.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 634 }
13
import { WebPageHeader, WebPageWrapper, } from "@/app/(web)/_components/general-components"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { siteConfig } from "@/config/site"; import { format } from "date-fns"; import Image from "next/image"; import type { Metadata } from "next"; import { changelogPageConfig } from "@/app/(web)/changelogs/_constants/page-config"; import { changelogs } from "@/app/source"; import { type InferPageType } from "fumadocs-core/source"; import { useMDXComponents } from "mdx-components"; import { DocsBody } from "fumadocs-ui/page"; export const metadata: Metadata = { title: changelogPageConfig.title, }; export const dynamic = "force-static"; export default async function ChangeLogPage() { //filter changelogs by publishedAt const sortedChangelogs = changelogs .getPages() .sort( (a, b) => Number(new Date(b.data.publishedAt)) - Number(new Date(a.data.publishedAt)), ); return ( <WebPageWrapper> <WebPageHeader title="Change Log"> <p className="text-center text-base"> <span> All the latest features, fixes and work to{" "} {siteConfig.name}. </span> </p> </WebPageHeader> <div className="grid w-full max-w-4xl gap-8"> {sortedChangelogs.map((changelog, index) => ( <ChangeLogCard key={index} {...changelog} /> ))} </div> </WebPageWrapper> ); } type ChangeLogCardProps = InferPageType<typeof changelogs>; function ChangeLogCard({ data }: ChangeLogCardProps) { const MDX = data.exports.default; const components = useMDXComponents(); return ( <Card className="overflow-hidden"> {data?.thumbnail && ( <div className="relative h-[400px] w-full"> <Image src={data.thumbnail} alt={data.title} fill className="object-cover" /> </div> )} <CardHeader> <CardTitle className="text-3xl">v{data.version}</CardTitle> <CardTitle className="text-xl">{data.title}</CardTitle> <CardDescription>{data.description}</CardDescription> <p className="text-sm text-muted-foreground"> Published on {format(new Date(data.publishedAt), "PPP")} </p> </CardHeader> <CardContent> <DocsBody> <MDX components={components} /> </DocsBody> </CardContent> </Card> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/changelogs/page.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/changelogs/page.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1460 }
14
import { AuthForm } from "@/app/auth/_components/auth-form"; import { loginPageConfig } from "@/app/auth/login/_constants/page-config"; import { type Metadata } from "next"; export const metadata: Metadata = { title: loginPageConfig.title, description: loginPageConfig.description, }; export default function Login() { return <AuthForm type="login" />; }
alifarooq9/rapidlaunch/starterkits/saas/src/app/auth/login/page.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/auth/login/page.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 114 }
15
"use client"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { type z } from "zod"; import { FormField, FormItem, FormMessage, FormControl, Form, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { waitlistUsersSchema } from "@/server/db/schema"; import { useMutation } from "@tanstack/react-query"; import { addUserToWaitlistMutation } from "@/server/actions/waitlist/mutations"; import { toast } from "sonner"; import { Icons } from "@/components/ui/icons"; const waitformSchema = waitlistUsersSchema.pick({ name: true, email: true, }); type waitformSchemaType = z.infer<typeof waitformSchema>; export function WaitlistForm() { const form = useForm<waitformSchemaType>({ resolver: zodResolver(waitformSchema), defaultValues: { name: "", email: "", }, }); const { mutate, isPending } = useMutation({ mutationFn: () => addUserToWaitlistMutation(form.getValues()), onSuccess: () => { toast("You have been added to waitlist", { description: "You will be notified when the waitlist opens", }); }, onError: () => { toast.error("Something went wrong", { description: "Please try again later", }); }, }); const onSubmit = async () => { mutate(); }; return ( <Form {...form}> <form onSubmit={form.handleSubmit(onSubmit)} className="grid w-full max-w-md gap-4" > <div className="grid w-full grid-cols-2 gap-2"> <FormField control={form.control} name="name" render={({ field }) => ( <FormItem> <FormControl> <Input className="h-10 w-full bg-background" placeholder="Name" {...field} /> </FormControl> <FormMessage /> </FormItem> )} /> <FormField control={form.control} name="email" render={({ field }) => ( <FormItem> <FormControl> <Input className="h-10 w-full bg-background" placeholder="Email" {...field} /> </FormControl> <FormMessage /> </FormItem> )} /> </div> <Button disabled={isPending} type="submit" className="w-full gap-2" > {isPending ? <Icons.loader className="h-4 w-4" /> : null} <span>Join the waitlist</span> </Button> </form> </Form> ); }
alifarooq9/rapidlaunch/starterkits/saas/src/app/waitlist/_components/waitlist-form.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/waitlist/_components/waitlist-form.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 2122 }
16
"use client"; import * as React from "react"; import { type DialogProps } from "@radix-ui/react-dialog"; import { MagnifyingGlassIcon } from "@radix-ui/react-icons"; import { Command as CommandPrimitive } from "cmdk"; import { cn } from "@/lib/utils"; import { Dialog, DialogContent } from "@/components/ui/dialog"; const Command = React.forwardRef< React.ElementRef<typeof CommandPrimitive>, React.ComponentPropsWithoutRef<typeof CommandPrimitive> >(({ className, ...props }, ref) => ( <CommandPrimitive ref={ref} className={cn( "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className, )} {...props} /> )); Command.displayName = CommandPrimitive.displayName; type CommandDialogProps = DialogProps; const CommandDialog = ({ children, ...props }: CommandDialogProps) => { return ( <Dialog {...props}> <DialogContent className="overflow-hidden p-0"> <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5"> {children} </Command> </DialogContent> </Dialog> ); }; const CommandInput = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Input>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input> >(({ className, ...props }, ref) => ( <div className="flex items-center border-b px-3" cmdk-input-wrapper=""> <MagnifyingGlassIcon className="mr-2 h-4 w-4 shrink-0 opacity-50" /> <CommandPrimitive.Input ref={ref} className={cn( "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className, )} {...props} /> </div> )); CommandInput.displayName = CommandPrimitive.Input.displayName; const CommandList = React.forwardRef< React.ElementRef<typeof CommandPrimitive.List>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> >(({ className, ...props }, ref) => ( <CommandPrimitive.List ref={ref} className={cn( "max-h-[300px] overflow-y-auto overflow-x-hidden", className, )} {...props} /> )); CommandList.displayName = CommandPrimitive.List.displayName; const CommandEmpty = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Empty>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> >((props, ref) => ( <CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} /> )); CommandEmpty.displayName = CommandPrimitive.Empty.displayName; const CommandGroup = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Group>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> >(({ className, ...props }, ref) => ( <CommandPrimitive.Group ref={ref} className={cn( "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className, )} {...props} /> )); CommandGroup.displayName = CommandPrimitive.Group.displayName; const CommandSeparator = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Separator>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> >(({ className, ...props }, ref) => ( <CommandPrimitive.Separator ref={ref} className={cn("-mx-1 h-px bg-border", className)} {...props} /> )); CommandSeparator.displayName = CommandPrimitive.Separator.displayName; const CommandItem = React.forwardRef< React.ElementRef<typeof CommandPrimitive.Item>, React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item> >(({ className, ...props }, ref) => ( <CommandPrimitive.Item ref={ref} className={cn( "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className, )} {...props} /> )); CommandItem.displayName = CommandPrimitive.Item.displayName; const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => { return ( <span className={cn( "ml-auto text-xs tracking-widest text-muted-foreground", className, )} {...props} /> ); }; CommandShortcut.displayName = "CommandShortcut"; export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
alifarooq9/rapidlaunch/starterkits/saas/src/components/ui/command.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/components/ui/command.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 2220 }
17
import * as React from "react"; import { cn } from "@/lib/utils"; const Table = React.forwardRef< HTMLTableElement, React.HTMLAttributes<HTMLTableElement> >(({ className, ...props }, ref) => ( <div className="relative w-full overflow-auto"> <table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props} /> </div> )); Table.displayName = "Table"; const TableHeader = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement> >(({ className, ...props }, ref) => ( <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} /> )); TableHeader.displayName = "TableHeader"; const TableBody = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement> >(({ className, ...props }, ref) => ( <tbody ref={ref} className={cn("[&_tr:last-child]:border-0", className)} {...props} /> )); TableBody.displayName = "TableBody"; const TableFooter = React.forwardRef< HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement> >(({ className, ...props }, ref) => ( <tfoot ref={ref} className={cn( "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className, )} {...props} /> )); TableFooter.displayName = "TableFooter"; const TableRow = React.forwardRef< HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement> >(({ className, ...props }, ref) => ( <tr ref={ref} className={cn( "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className, )} {...props} /> )); TableRow.displayName = "TableRow"; const TableHead = React.forwardRef< HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement> >(({ className, ...props }, ref) => ( <th ref={ref} className={cn( "h-10 text-nowrap px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className, )} {...props} /> )); TableHead.displayName = "TableHead"; const TableCell = React.forwardRef< HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement> >(({ className, ...props }, ref) => ( <td ref={ref} className={cn( "text-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className, )} {...props} /> )); TableCell.displayName = "TableCell"; const TableCaption = React.forwardRef< HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement> >(({ className, ...props }, ref) => ( <caption ref={ref} className={cn("mt-4 text-sm text-muted-foreground", className)} {...props} /> )); TableCaption.displayName = "TableCaption"; export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
alifarooq9/rapidlaunch/starterkits/saas/src/components/ui/table.tsx
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/components/ui/table.tsx", "repo_id": "alifarooq9/rapidlaunch", "token_count": 1350 }
18
"use client"; import { type TransitionFunction, useCallback, useEffect, useRef, useTransition, } from "react"; export function useAwaitableTransition(): [ boolean, (callback: TransitionFunction) => Promise<unknown>, ] { const [isPending, startTransition] = useTransition(); const resolveRef = useRef<(value?: unknown) => void>(); const rejectRef = useRef<(reason?: unknown) => void>(); const wrappedStartTransition = useCallback( (callback: TransitionFunction) => { return new Promise((resolve, reject) => { rejectRef.current?.(); resolveRef.current = resolve; rejectRef.current = reject; startTransition(() => { callback(); }); }); }, [startTransition, rejectRef], ); useEffect(() => { if (!isPending) { resolveRef.current?.(); resolveRef.current = undefined; rejectRef.current = undefined; } }, [isPending]); return [isPending, wrappedStartTransition]; }
alifarooq9/rapidlaunch/starterkits/saas/src/hooks/use-awaitable-transition.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/hooks/use-awaitable-transition.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 491 }
19
"use server"; import { waitlistUsers, waitlistUsersSchema } from "@/server/db/schema"; import { type z } from "zod"; import { db } from "@/server/db"; import { eq } from "drizzle-orm"; type AddUserToWaitlistMutationProps = z.infer<typeof waitlistUsersSchema>; export async function addUserToWaitlistMutation({ name, email, }: AddUserToWaitlistMutationProps) { const parseData = await waitlistUsersSchema.safeParseAsync({ name, email, }); if (!parseData.success) { return { success: false, error: parseData.error.message, }; } const { data } = parseData; try { await db .insert(waitlistUsers) .values(data) .onConflictDoUpdate({ target: waitlistUsers.email, set: { name: data.name }, }) .execute(); return { success: true, }; } catch (error) { return { success: false, error: "Something went wrong, please try again later", }; } } export async function deleteWaitlistUserMutation({ id }: { id: string }) { try { await db .delete(waitlistUsers) .where(eq(waitlistUsers.id, id)) .execute(); return { success: true, }; } catch (error) { return { success: false, error: "Something went wrong, please try again later", }; } }
alifarooq9/rapidlaunch/starterkits/saas/src/server/actions/waitlist/mutations.ts
{ "file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/server/actions/waitlist/mutations.ts", "repo_id": "alifarooq9/rapidlaunch", "token_count": 724 }
20
import { redirect } from 'next/navigation'; import { getDefaultSignInView } from '@/utils/auth-helpers/settings'; import { cookies } from 'next/headers'; export default function SignIn() { const preferredSignInView = cookies().get('preferredSignInView')?.value || null; const defaultView = getDefaultSignInView(preferredSignInView); return redirect(`/dashboard/signin/${defaultView}`); }
horizon-ui/shadcn-nextjs-boilerplate/app/dashboard/signin/page.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/app/dashboard/signin/page.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 121 }
21
'use client'; import { Button } from '@/components/ui/button'; import { updatePassword } from '@/utils/auth-helpers/server'; import { handleRequest } from '@/utils/auth-helpers/client'; import { useRouter } from 'next/navigation'; import React, { useState } from 'react'; import { Input } from '../ui/input'; interface UpdatePasswordProps { redirectMethod: string; } export default function UpdatePassword({ redirectMethod }: UpdatePasswordProps) { const router = redirectMethod === 'client' ? useRouter() : null; const [isSubmitting, setIsSubmitting] = useState(false); const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => { setIsSubmitting(true); // Disable the button while the request is being handled await handleRequest(e, updatePassword, router); setIsSubmitting(false); }; return ( <div className="my-8"> <form noValidate={true} className="mb-4" onSubmit={(e) => handleSubmit(e)} > <div className="grid gap-2"> <div className="grid gap-1"> <label className="text-zinc-950 dark:text-white" htmlFor="password"> New Password </label> <Input className="mr-2.5 mb-2 h-full min-h-[44px] w-full px-4 py-3 focus:outline-0 dark:placeholder:text-zinc-400" id="password" placeholder="Password" type="password" name="password" autoComplete="current-password" /> <label className="text-zinc-950 dark:text-white" htmlFor="passwordConfirm" > Confirm New Password </label> <Input className="mr-2.5 mb-2 h-full min-h-[44px] w-full px-4 py-3 focus:outline-0 dark:placeholder:text-zinc-400" id="passwordConfirm" placeholder="Password" type="password" name="passwordConfirm" autoComplete="current-password" /> </div> <Button type="submit" className="mt-2 flex h-[unset] w-full items-center justify-center rounded-lg px-4 py-4 text-sm font-medium" > {isSubmitting ? ( <svg aria-hidden="true" role="status" className="mr-2 inline h-4 w-4 animate-spin text-zinc-200 duration-500 dark:text-zinc-950" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor" ></path> <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="white" ></path> </svg> ) : ( 'Update Password' )} </Button> </div> </form> </div> ); }
horizon-ui/shadcn-nextjs-boilerplate/components/auth-ui/UpdatePassword.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/auth-ui/UpdatePassword.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 2002 }
22
'use client'; import NextLink, { LinkProps as NextLinkProps } from 'next/link'; import { CSSProperties, PropsWithChildren, useMemo } from 'react'; export type NavLinkProps = NextLinkProps & PropsWithChildren & { styles?: CSSProperties; borderRadius?: string; }; function NavLink({ className, children, styles, borderRadius, ...props }: any) { const memoizedStyles = useMemo( () => ({ borderRadius: borderRadius || 0, ...styles }), [borderRadius, styles] ); return ( <NextLink className={`${className}`} style={memoizedStyles} {...props}> {children} </NextLink> ); } export default NavLink;
horizon-ui/shadcn-nextjs-boilerplate/components/link/NavLink.tsx
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/link/NavLink.tsx", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 244 }
23
export type Json = | string | number | boolean | null | { [key: string]: Json | undefined } | Json[] export interface Database { public: { Tables: { paddle_subscriptions: { Row: { passthrough: string | null status: string | null subscription_cancel_url: string | null subscription_end_date: string | null subscription_id: string subscription_plan_id: string | null subscription_update_url: string | null } Insert: { passthrough?: string | null status?: string | null subscription_cancel_url?: string | null subscription_end_date?: string | null subscription_id: string subscription_plan_id?: string | null subscription_update_url?: string | null } Update: { passthrough?: string | null status?: string | null subscription_cancel_url?: string | null subscription_end_date?: string | null subscription_id?: string subscription_plan_id?: string | null subscription_update_url?: string | null } Relationships: [] } } Views: { [_ in never]: never } Functions: { [_ in never]: never } Enums: { [_ in never]: never } CompositeTypes: { [_ in never]: never } } }
horizon-ui/shadcn-nextjs-boilerplate/types/supabase.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/types/supabase.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 633 }
24
import { toDateTime } from '@/utils/helpers'; import { stripe } from '@/utils/stripe/config'; import { createClient } from '@supabase/supabase-js'; import Stripe from 'stripe'; import type { Database, Tables, TablesInsert } from '@/types/types_db'; type Product = Tables<'products'>; type Price = Tables<'prices'>; // Change to control trial period length const TRIAL_PERIOD_DAYS = 0; // Note: supabaseAdmin uses the SERVICE_ROLE_KEY which you must only use in a secure server-side context // as it has admin privileges and overwrites RLS policies! const supabaseAdmin = createClient<Database>( process.env.NEXT_PUBLIC_SUPABASE_URL || '', process.env.SUPABASE_SERVICE_ROLE_KEY || '' ); const upsertProductRecord = async (product: Stripe.Product) => { const productData: Product = { id: product.id, active: product.active, name: product.name, description: product.description ?? null, image: product.images?.[0] ?? null, metadata: product.metadata }; const { error: upsertError } = await supabaseAdmin .from('products') .upsert([productData]); if (upsertError) throw new Error(`Product insert/update failed: ${upsertError.message}`); console.log(`Product inserted/updated: ${product.id}`); }; const upsertPriceRecord = async ( price: Stripe.Price, retryCount = 0, maxRetries = 3 ) => { const priceData: Price = { id: price.id, description: '', metadata: { shit: true }, product_id: typeof price.product === 'string' ? price.product : '', active: price.active, currency: price.currency, type: price.type, unit_amount: price.unit_amount ?? null, interval: price.recurring?.interval ?? null, interval_count: price.recurring?.interval_count ?? null, trial_period_days: price.recurring?.trial_period_days ?? TRIAL_PERIOD_DAYS }; const { error: upsertError } = await supabaseAdmin .from('prices') .upsert([priceData]); if (upsertError?.message.includes('foreign key constraint')) { if (retryCount < maxRetries) { console.log(`Retry attempt ${retryCount + 1} for price ID: ${price.id}`); await new Promise((resolve) => setTimeout(resolve, 2000)); await upsertPriceRecord(price, retryCount + 1, maxRetries); } else { throw new Error( `Price insert/update failed after ${maxRetries} retries: ${upsertError.message}` ); } } else if (upsertError) { throw new Error(`Price insert/update failed: ${upsertError.message}`); } else { console.log(`Price inserted/updated: ${price.id}`); } }; const deleteProductRecord = async (product: Stripe.Product) => { const { error: deletionError } = await supabaseAdmin .from('products') .delete() .eq('id', product.id); if (deletionError) throw new Error(`Product deletion failed: ${deletionError.message}`); console.log(`Product deleted: ${product.id}`); }; const deletePriceRecord = async (price: Stripe.Price) => { const { error: deletionError } = await supabaseAdmin .from('prices') .delete() .eq('id', price.id); if (deletionError) throw new Error(`Price deletion failed: ${deletionError.message}`); console.log(`Price deleted: ${price.id}`); }; const upsertCustomerToSupabase = async (uuid: string, customerId: string) => { const { error: upsertError } = await supabaseAdmin .from('customers') .upsert([{ id: uuid, stripe_customer_id: customerId }]); if (upsertError) throw new Error( `Supabase customer record creation failed: ${upsertError.message}` ); return customerId; }; const createCustomerInStripe = async (uuid: string, email: string) => { const customerData = { metadata: { supabaseUUID: uuid }, email: email }; const newCustomer = await stripe.customers.create(customerData); if (!newCustomer) throw new Error('Stripe customer creation failed.'); return newCustomer.id; }; const createOrRetrieveCustomer = async ({ email, uuid }: { email: string; uuid: string; }) => { // Check if the customer already exists in Supabase const { data: existingSupabaseCustomer, error: queryError } = await supabaseAdmin .from('customers') .select('*') .eq('id', uuid) .maybeSingle(); if (queryError) { throw new Error(`Supabase customer lookup failed: ${queryError.message}`); } // Retrieve the Stripe customer ID using the Supabase customer ID, with email fallback let stripeCustomerId: string | undefined; if (existingSupabaseCustomer?.stripe_customer_id) { const existingStripeCustomer = await stripe.customers.retrieve( existingSupabaseCustomer.stripe_customer_id ); stripeCustomerId = existingStripeCustomer.id; } else { // If Stripe ID is missing from Supabase, try to retrieve Stripe customer ID by email const stripeCustomers = await stripe.customers.list({ email: email }); stripeCustomerId = stripeCustomers.data.length > 0 ? stripeCustomers.data[0].id : undefined; } // If still no stripeCustomerId, create a new customer in Stripe const stripeIdToInsert = stripeCustomerId ? stripeCustomerId : await createCustomerInStripe(uuid, email); if (!stripeIdToInsert) throw new Error('Stripe customer creation failed.'); if (existingSupabaseCustomer && stripeCustomerId) { // If Supabase has a record but doesn't match Stripe, update Supabase record if (existingSupabaseCustomer.stripe_customer_id !== stripeCustomerId) { const { error: updateError } = await supabaseAdmin .from('customers') .update({ stripe_customer_id: stripeCustomerId }) .eq('id', uuid); if (updateError) throw new Error( `Supabase customer record update failed: ${updateError.message}` ); console.warn( `Supabase customer record mismatched Stripe ID. Supabase record updated.` ); } // If Supabase has a record and matches Stripe, return Stripe customer ID return stripeCustomerId; } else { console.warn( `Supabase customer record was missing. A new record was created.` ); // If Supabase has no record, create a new record and return Stripe customer ID const upsertedStripeCustomer = await upsertCustomerToSupabase( uuid, stripeIdToInsert ); if (!upsertedStripeCustomer) throw new Error('Supabase customer record creation failed.'); return upsertedStripeCustomer; } }; /** * Copies the billing details from the payment method to the customer object. */ const copyBillingDetailsToCustomer = async ( uuid: string, payment_method: Stripe.PaymentMethod ) => { //Todo: check this assertion const customer = payment_method.customer as string; const { name, phone, address } = payment_method.billing_details; if (!name || !phone || !address) return; //@ts-ignore await stripe.customers.update(customer, { name, phone, address }); const { error: updateError } = await supabaseAdmin .from('users') .update({ billing_address: { ...address }, payment_method: { ...payment_method[payment_method.type] } }) .eq('id', uuid); if (updateError) throw new Error(`Customer update failed: ${updateError.message}`); }; const manageSubscriptionStatusChange = async ( subscriptionId: string, customerId: string, createAction = false ) => { // Get customer's UUID from mapping table. const { data: customerData, error: noCustomerError } = await supabaseAdmin .from('customers') .select('id') .eq('stripe_customer_id', customerId) .single(); if (noCustomerError) throw new Error(`Customer lookup failed: ${noCustomerError.message}`); const { id: uuid } = customerData!; const subscription = await stripe.subscriptions.retrieve(subscriptionId, { expand: ['default_payment_method'] }); // Upsert the latest status of the subscription object. const subscriptionData: TablesInsert<'subscriptions'> = { id: subscription.id, user_id: uuid, metadata: subscription.metadata, status: subscription.status, price_id: subscription.items.data[0].price.id, //TODO check quantity on subscription // @ts-ignore quantity: subscription.quantity, cancel_at_period_end: subscription.cancel_at_period_end, cancel_at: subscription.cancel_at ? toDateTime(subscription.cancel_at).toISOString() : null, canceled_at: subscription.canceled_at ? toDateTime(subscription.canceled_at).toISOString() : null, current_period_start: toDateTime( subscription.current_period_start ).toISOString(), current_period_end: toDateTime( subscription.current_period_end ).toISOString(), created: toDateTime(subscription.created).toISOString(), ended_at: subscription.ended_at ? toDateTime(subscription.ended_at).toISOString() : null, trial_start: subscription.trial_start ? toDateTime(subscription.trial_start).toISOString() : null, trial_end: subscription.trial_end ? toDateTime(subscription.trial_end).toISOString() : null }; const { error: upsertError } = await supabaseAdmin .from('subscriptions') .upsert([subscriptionData]); if (upsertError) throw new Error( `Subscription insert/update failed: ${upsertError.message}` ); console.log( `Inserted/updated subscription [${subscription.id}] for user [${uuid}]` ); // For a new subscription copy the billing details to the customer object. // NOTE: This is a costly operation and should happen at the very end. if (createAction && subscription.default_payment_method && uuid) //@ts-ignore await copyBillingDetailsToCustomer( uuid, subscription.default_payment_method as Stripe.PaymentMethod ); }; export { upsertProductRecord, upsertPriceRecord, deleteProductRecord, deletePriceRecord, createOrRetrieveCustomer, manageSubscriptionStatusChange };
horizon-ui/shadcn-nextjs-boilerplate/utils/supabase/admin.ts
{ "file_path": "horizon-ui/shadcn-nextjs-boilerplate/utils/supabase/admin.ts", "repo_id": "horizon-ui/shadcn-nextjs-boilerplate", "token_count": 3382 }
25
import { auth } from '@clerk/nextjs/server'; import { redirect } from 'next/navigation'; export default function CenteredLayout(props: { children: React.ReactNode }) { const { userId } = auth(); if (userId) { redirect('/dashboard'); } return ( <div className="flex min-h-screen items-center justify-center"> {props.children} </div> ); }
ixartz/SaaS-Boilerplate/src/app/[locale]/(auth)/(center)/layout.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/app/[locale]/(auth)/(center)/layout.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 131 }
26
import { cn } from '@/utils/Helpers'; export const Background = (props: { children: React.ReactNode; className?: string; }) => ( <div className={cn('w-full bg-secondary', props.className)}> {props.children} </div> );
ixartz/SaaS-Boilerplate/src/components/Background.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/components/Background.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 87 }
27
'use client'; import * as TooltipPrimitive from '@radix-ui/react-tooltip'; import * as React from 'react'; import { cn } from '@/utils/Helpers'; const TooltipProvider = TooltipPrimitive.Provider; const Tooltip = TooltipPrimitive.Root; const TooltipTrigger = TooltipPrimitive.Trigger; const TooltipContent = React.forwardRef< React.ElementRef<typeof TooltipPrimitive.Content>, React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> >(({ className, sideOffset = 4, ...props }, ref) => ( <TooltipPrimitive.Content ref={ref} sideOffset={sideOffset} className={cn( 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className, )} {...props} /> )); TooltipContent.displayName = TooltipPrimitive.Content.displayName; export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
ixartz/SaaS-Boilerplate/src/components/ui/tooltip.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/components/ui/tooltip.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 416 }
28
export const LogoCloud = (props: { text: string; children: React.ReactNode }) => ( <> <div className="text-center text-xl font-medium text-muted-foreground"> {props.text} </div> <div className="mt-6 grid grid-cols-2 place-items-center gap-x-3 gap-y-6 md:grid-cols-4 [&_a:hover]:opacity-100 [&_a]:opacity-60"> {props.children} </div> </> );
ixartz/SaaS-Boilerplate/src/features/landing/LogoCloud.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/features/landing/LogoCloud.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 161 }
29
import { GitHubLogoIcon } from '@radix-ui/react-icons'; import { useTranslations } from 'next-intl'; import { buttonVariants } from '@/components/ui/buttonVariants'; import { CTABanner } from '@/features/landing/CTABanner'; import { Section } from '@/features/landing/Section'; export const CTA = () => { const t = useTranslations('CTA'); return ( <Section> <CTABanner title={t('title')} description={t('description')} buttons={( <a className={buttonVariants({ variant: 'outline', size: 'lg' })} href="https://github.com/ixartz/SaaS-Boilerplate" > <GitHubLogoIcon className="mr-2 size-5" /> {t('button_text')} </a> )} /> </Section> ); };
ixartz/SaaS-Boilerplate/src/templates/CTA.tsx
{ "file_path": "ixartz/SaaS-Boilerplate/src/templates/CTA.tsx", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 357 }
30
import { type ClassValue, clsx } from 'clsx'; import { twMerge } from 'tailwind-merge'; import { AppConfig } from './AppConfig'; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } export const MILLISECONDS_IN_ONE_DAY = 86_400_000; export const getBaseUrl = () => { if (process.env.NEXT_PUBLIC_APP_URL) { return process.env.NEXT_PUBLIC_APP_URL; } if ( process.env.VERCEL_ENV === 'production' && process.env.VERCEL_PROJECT_PRODUCTION_URL ) { return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`; } if (process.env.VERCEL_URL) { return `https://${process.env.VERCEL_URL}`; } return 'http://localhost:3000'; }; export const getI18nPath = (url: string, locale: string) => { if (locale === AppConfig.defaultLocale) { return url; } return `/${locale}${url}`; };
ixartz/SaaS-Boilerplate/src/utils/Helpers.ts
{ "file_path": "ixartz/SaaS-Boilerplate/src/utils/Helpers.ts", "repo_id": "ixartz/SaaS-Boilerplate", "token_count": 342 }
31
import iconNodes from '../../data/iconNodes/index.ts'; import { IconNodeWithKeys } from '../../theme/types'; import iconMetaData from '../../data/iconMetaData'; import releaseMeta from '../../data/releaseMetaData.json'; import categories from '../../data/categoriesData.json'; const dataResponse = { icons: Object.entries(iconNodes).reduce((acc, [name, iconNode]) => { const newIconNode = (iconNode as IconNodeWithKeys).map(([name, { key, ...attrs }]) => { return [name, attrs]; }); acc[name] = { iconNode: newIconNode, aliases: (iconMetaData[name]?.aliases ?? []).map((alias) => typeof alias === 'string' ? alias : alias.name, ), tags: iconMetaData[name].tags ?? [], categories: iconMetaData[name].categories ?? [], ...releaseMeta[name], }; return acc; }, {}), aliases: Object.entries(iconNodes).reduce((acc, [name]) => { for (const alias of iconMetaData[name]?.aliases ?? []) { acc[typeof alias === 'string' ? alias : alias.name] = name; } return acc; }, {}), categories, }; export default eventHandler((event) => { setResponseHeader(event, 'Cache-Control', 'public, max-age=86400'); setResponseHeader(event, 'Access-Control-Allow-Origin', '*'); return dataResponse; });
lucide-icons/lucide/docs/.vitepress/api/figma/data.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/api/figma/data.ts", "repo_id": "lucide-icons/lucide", "token_count": 466 }
32
import { DefaultTheme, UserConfig } from 'vitepress'; const sidebar: UserConfig<DefaultTheme.Config>['themeConfig']['sidebar'] = { guide: [ { text: 'Introduction', items: [ { text: 'What is lucide?', link: '/guide/' }, { text: 'Installation', link: '/guide/installation' }, { text: 'Comparison', link: '/guide/comparison' }, ], }, { text: 'Basics', items: [ { text: 'Color', link: '/guide/basics/color', }, { text: 'Sizing', link: '/guide/basics/sizing', }, { text: 'Stroke width', link: '/guide/basics/stroke-width', }, ], }, // TODO: Add this section { text: 'Advanced', items: [ { text: 'Accessibility', link: '/guide/advanced/accessibility', }, { text: 'Global styling', link: '/guide/advanced/global-styling', }, // { // text: 'Animations', // }, { text: 'Filled icons', link: '/guide/advanced/filled-icons', }, // { // text: 'Combining icons', // }, // { // text: 'Dynamic imports' // }, // { // text: 'Auto importing' // }, ], }, { text: 'Packages', items: [ { text: 'Lucide', link: '/guide/packages/lucide', }, { text: 'Lucide React', link: '/guide/packages/lucide-react', }, { text: 'Lucide React Native', link: '/guide/packages/lucide-react-native', }, { text: 'Lucide Vue', link: '/guide/packages/lucide-vue-next', }, { text: 'Lucide Svelte', link: '/guide/packages/lucide-svelte', }, { text: 'Lucide Solid', link: '/guide/packages/lucide-solid', }, { text: 'Lucide Preact', link: '/guide/packages/lucide-preact', }, { text: 'Lucide Angular', link: '/guide/packages/lucide-angular', }, { text: 'Lucide Static', link: '/guide/packages/lucide-static', }, ], }, { text: 'Contributing', items: [ { text: 'Icon Design Principles', link: '/guide/design/icon-design-guide', }, { text: 'Designing in Illustrator', link: '/guide/design/illustrator-guide', }, { text: 'Designing in InkScape', link: '/guide/design/inkscape-guide', }, { text: 'Designing in Figma', link: '/guide/design/figma-guide', }, { text: 'Designing in Affinity Designer', link: '/guide/design/affinity-designer-guide', }, ], }, ], // This should be here to keep the sidebar shown on the icons page icons: [{ text: '', link: '/' }], }; export default sidebar;
lucide-icons/lucide/docs/.vitepress/sidebar.ts
{ "file_path": "lucide-icons/lucide/docs/.vitepress/sidebar.ts", "repo_id": "lucide-icons/lucide", "token_count": 1676 }
33
.lucide { width: 48px; height: 48px; stroke-width: 1.5; } .lucide * { vector-effect: non-scaling-stroke; } .app { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; gap: 6px; }
lucide-icons/lucide/docs/guide/advanced/examples/global-styling-absolute-strokewidth-example/icon.css
{ "file_path": "lucide-icons/lucide/docs/guide/advanced/examples/global-styling-absolute-strokewidth-example/icon.css", "repo_id": "lucide-icons/lucide", "token_count": 106 }
34
.my-beer-icon { /* Change this! */ width: 64px; height: 64px; }
lucide-icons/lucide/docs/guide/basics/examples/size-icon-css-example/icon.css
{ "file_path": "lucide-icons/lucide/docs/guide/basics/examples/size-icon-css-example/icon.css", "repo_id": "lucide-icons/lucide", "token_count": 31 }
35
<svg width="373" height="41" viewBox="0 0 373 41" xmlns="http://www.w3.org/2000/svg" > <polygon shapeRendering="crispEdges" fill="#f76808" points="24.3870968 40.1612903 24.3870968 8.67741935 32.2580645 8.67741935 32.2580645 0.806451613 0.774193548 0.806451613 0.774193548 8.67741935 8.64516129 8.67741935 8.64516129 40.1612903" /> <path shapeRendering="crispEdges" fill="#f5d90a" d="M87.3548387,0.806451613 L87.3548387,8.67741935 L95.2258065,8.67741935 L95.2258065,40.1612903 L79.483871,40.1612903 L79.483871,24.4193548 L71.6129032,24.4193548 L71.6129032,40.1612903 L55.8709677,40.1612903 L55.8709677,8.67741935 L63.7419355,8.67741935 L63.7419355,0.806451613 L87.3548387,0.806451613 Z M79.483871,8.67741935 L71.6129032,8.67741935 L71.6129032,16.5483871 L79.483871,16.5483871 L79.483871,8.67741935 Z" fillRule="nonzero" /> <polygon shapeRendering="crispEdges" fill="#30a46c" points="130.645161 40.1612903 130.645161 22.4516129 138.516129 22.4516129 138.516129 40.1612903 154.258065 40.1612903 154.258065 0.806451613 142.451613 0.806451613 142.451613 8.67741935 126.709677 8.67741935 126.709677 0.806451613 114.903226 0.806451613 114.903226 40.1612903" /> <path fill="#0091ff" d="M205.419355,0.806451613 L205.419355,8.67741935 L213.290323,8.67741935 L213.290323,40.1612903 L197.548387,40.1612903 L197.548387,24.4193548 L189.677419,24.4193548 L189.677419,40.1612903 L173.935484,40.1612903 L173.935484,8.67741935 L181.806452,8.67741935 L181.806452,0.806451613 L205.419355,0.806451613 Z M197.548387,8.67741935 L189.677419,8.67741935 L189.677419,16.5483871 L197.548387,16.5483871 L197.548387,8.67741935 Z" fillRule="nonzero" /> <polygon shapeRendering="crispEdges" fill="#8e4ec6" points="264.451613 40.1612903 264.451613 32.2903226 272.322581 32.2903226 272.322581 16.5483871 256.580645 16.5483871 256.580645 32.2903226 248.709677 32.2903226 248.709677 8.67741935 272.322581 8.67741935 272.322581 0.806451613 240.83871 0.806451613 240.83871 8.67741935 232.967742 8.67741935 232.967742 32.2903226 240.83871 32.2903226 240.83871 40.1612903" /> <polygon shapeRendering="crispEdges" fill="#d6409f" points="323.483871 40.1612903 323.483871 32.2903226 331.354839 32.2903226 331.354839 0.806451613 315.612903 0.806451613 315.612903 32.2903226 307.741935 32.2903226 307.741935 0.806451613 292 0.806451613 292 32.2903226 299.870968 32.2903226 299.870968 40.1612903" /> <polygon shapeRendering="crispEdges" fill="#e5484d" points="372.677419 40.1612903 372.677419 0.806451613 356.935484 0.806451613 356.935484 40.1612903" /> </svg>
lucide-icons/lucide/docs/public/library-logos/tamagui.svg
{ "file_path": "lucide-icons/lucide/docs/public/library-logos/tamagui.svg", "repo_id": "lucide-icons/lucide", "token_count": 1318 }
36
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="700.000000pt" height="700.000000pt" viewBox="0 0 700.000000 700.000000" preserveAspectRatio="xMidYMid meet"> <metadata> Created by potrace 1.11, written by Peter Selinger 2001-2013 </metadata> <g transform="translate(0.000000,700.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M5152 6381 c-123 -43 -199 -158 -189 -291 6 -96 34 -139 193 -297 77 -76 165 -167 195 -202 304 -358 520 -760 649 -1206 37 -129 34 -113 59 -240 27 -135 30 -152 37 -215 3 -30 8 -63 9 -72 7 -35 18 -247 19 -343 0 -163 -15 -305 -48 -463 -112 -529 -490 -1043 -971 -1320 -209 -120 -503 -220 -755 -257 -95 -14 -434 -13 -540 2 -371 51 -728 207 -1015 442 -127 104 -227 207 -356 368 -40 51 -140 218 -189 318 -174 352 -252 834 -181 1110 87 332 363 590 692 644 259 43 488 -13 691 -169 150 -115 278 -312 314 -481 18 -89 23 -122 25 -184 4 -123 45 -208 129 -263 60 -40 108 -54 177 -51 127 5 235 93 268 217 15 58 10 207 -10 313 -42 217 -113 397 -222 562 -48 73 -61 89 -123 161 -233 267 -569 443 -930 485 -81 9 -285 7 -365 -4 -142 -19 -317 -75 -458 -146 -250 -126 -488 -355 -620 -599 -69 -128 -139 -322 -153 -430 -3 -19 -9 -57 -14 -85 -11 -62 -10 -370 2 -456 4 -35 11 -82 14 -104 25 -190 86 -416 163 -609 38 -94 137 -294 157 -317 8 -8 14 -19 14 -24 0 -13 75 -128 153 -234 195 -265 452 -500 747 -683 119 -73 272 -149 405 -201 83 -32 266 -92 311 -102 10 -2 53 -11 94 -20 280 -60 629 -76 873 -40 18 3 48 7 67 9 19 2 46 7 60 10 14 3 38 8 54 11 70 11 144 27 181 40 22 7 81 26 130 41 296 90 656 292 905 508 97 85 272 267 340 356 19 25 37 47 40 50 19 19 125 180 180 274 150 261 266 585 310 866 6 41 13 86 16 100 25 156 25 635 -1 769 -1 9 -6 39 -9 66 -11 85 -36 227 -52 300 -9 39 -18 79 -20 90 -8 43 -77 283 -96 335 -33 93 -60 164 -73 195 -7 17 -25 59 -40 95 -187 448 -511 905 -903 1272 -122 114 -216 142 -340 99z"/> <path d="M2827 6125 c-1 -2 -48 -5 -104 -9 -424 -25 -871 -176 -1243 -420 -313 -205 -583 -481 -787 -801 -56 -88 -159 -284 -187 -355 -84 -214 -152 -434 -170 -555 -9 -63 -18 -121 -22 -138 -19 -102 -25 -468 -11 -642 39 -489 174 -973 393 -1408 35 -70 75 -145 89 -167 14 -22 25 -42 25 -45 0 -12 175 -273 247 -367 153 -203 408 -476 533 -572 115 -88 269 -80 378 18 58 53 86 123 86 216 1 108 -18 137 -204 320 -267 264 -444 500 -613 820 -135 257 -250 584 -302 865 -10 50 -19 97 -20 106 -2 9 -6 38 -9 65 -4 27 -9 65 -11 84 -23 182 -24 552 0 640 2 8 6 36 10 63 18 148 101 399 190 577 50 99 171 290 225 354 134 160 252 272 395 376 263 190 558 314 870 364 22 4 56 9 75 13 76 13 435 11 520 -3 47 -7 101 -16 120 -19 19 -3 42 -7 50 -10 8 -2 26 -6 40 -9 115 -22 309 -94 460 -172 612 -313 1029 -926 1098 -1614 9 -91 8 -306 -2 -355 -77 -373 -352 -642 -726 -711 -65 -11 -254 -5 -323 11 -132 30 -233 78 -342 161 -160 121 -283 307 -321 485 -15 74 -23 133 -27 205 -3 61 -11 94 -30 132 -122 243 -482 202 -542 -62 -13 -60 -8 -215 10 -306 2 -8 6 -31 10 -50 23 -129 75 -268 160 -430 20 -38 89 -140 120 -179 247 -304 569 -489 950 -545 84 -12 335 -13 395 -2 14 3 40 8 59 10 133 20 324 90 461 168 384 219 646 592 720 1023 20 118 25 385 10 500 -5 33 -11 85 -15 115 -15 121 -58 307 -105 449 -286 874 -1026 1545 -1920 1742 -126 28 -119 26 -181 34 -30 4 -65 9 -79 11 -90 12 -393 26 -403 19z"/> </g> </svg>
lucide-icons/lucide/docs/public/safari-pinned-tab.svg
{ "file_path": "lucide-icons/lucide/docs/public/safari-pinned-tab.svg", "repo_id": "lucide-icons/lucide", "token_count": 1390 }
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" > <path d="M12 2v20" /> <path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4" /> <path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4" /> <path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1" /> <path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1" /> </svg>
lucide-icons/lucide/icons/align-center-vertical.svg
{ "file_path": "lucide-icons/lucide/icons/align-center-vertical.svg", "repo_id": "lucide-icons/lucide", "token_count": 257 }
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="M18.8 4A6.3 8.7 0 0 1 20 9" /> <path d="M9 9h.01" /> <circle cx="9" cy="9" r="7" /> <rect width="10" height="6" x="4" y="16" rx="2" /> <path d="M14 19c3 0 4.6-1.6 4.6-1.6" /> <circle cx="20" cy="16" r="2" /> </svg>
lucide-icons/lucide/icons/bell-electric.svg
{ "file_path": "lucide-icons/lucide/icons/bell-electric.svg", "repo_id": "lucide-icons/lucide", "token_count": 218 }
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="M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727" /> </svg>
lucide-icons/lucide/icons/bitcoin.svg
{ "file_path": "lucide-icons/lucide/icons/bitcoin.svg", "repo_id": "lucide-icons/lucide", "token_count": 248 }
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="M12 17h2" /> <path d="M12 22h2" /> <path d="M12 2h2" /> <path d="M18 22h1a1 1 0 0 0 1-1" /> <path d="M18 2h1a1 1 0 0 1 1 1v1" /> <path d="M20 15v2h-2" /> <path d="M20 8v3" /> <path d="M4 11V9" /> <path d="M4 19.5V15" /> <path d="M4 5v-.5A2.5 2.5 0 0 1 6.5 2H8" /> <path d="M8 22H6.5a1 1 0 0 1 0-5H8" /> </svg>
lucide-icons/lucide/icons/book-dashed.svg
{ "file_path": "lucide-icons/lucide/icons/book-dashed.svg", "repo_id": "lucide-icons/lucide", "token_count": 288 }
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="M16 3h3v18h-3" /> <path d="M8 21H5V3h3" /> </svg>
lucide-icons/lucide/icons/brackets.svg
{ "file_path": "lucide-icons/lucide/icons/brackets.svg", "repo_id": "lucide-icons/lucide", "token_count": 126 }
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" > <path d="M4 6 2 7" /> <path d="M10 6h4" /> <path d="m22 7-2-1" /> <rect width="16" height="16" x="4" y="3" rx="2" /> <path d="M4 11h16" /> <path d="M8 15h.01" /> <path d="M16 15h.01" /> <path d="M6 19v2" /> <path d="M18 21v-2" /> </svg>
lucide-icons/lucide/icons/bus-front.svg
{ "file_path": "lucide-icons/lucide/icons/bus-front.svg", "repo_id": "lucide-icons/lucide", "token_count": 226 }
43
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z" /> <path d="M6 17h12" /> </svg>
lucide-icons/lucide/icons/chef-hat.svg
{ "file_path": "lucide-icons/lucide/icons/chef-hat.svg", "repo_id": "lucide-icons/lucide", "token_count": 205 }
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" > <rect width="8" height="4" x="8" y="2" rx="1" /> <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5.5" /> <path d="M4 13.5V6a2 2 0 0 1 2-2h2" /> <path d="M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" /> </svg>
lucide-icons/lucide/icons/clipboard-pen.svg
{ "file_path": "lucide-icons/lucide/icons/clipboard-pen.svg", "repo_id": "lucide-icons/lucide", "token_count": 266 }
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" > <circle cx="12" cy="12" r="10" /> <polyline points="12 6 12 12" /> </svg>
lucide-icons/lucide/icons/clock-12.svg
{ "file_path": "lucide-icons/lucide/icons/clock-12.svg", "repo_id": "lucide-icons/lucide", "token_count": 121 }
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="m20.9 18.55-8-15.98a1 1 0 0 0-1.8 0l-8 15.98" /> <ellipse cx="12" cy="19" rx="9" ry="3" /> </svg>
lucide-icons/lucide/icons/cone.svg
{ "file_path": "lucide-icons/lucide/icons/cone.svg", "repo_id": "lucide-icons/lucide", "token_count": 154 }
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="m12 15 2 2 4-4" /> <rect width="14" height="14" x="8" y="8" rx="2" ry="2" /> <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /> </svg>
lucide-icons/lucide/icons/copy-check.svg
{ "file_path": "lucide-icons/lucide/icons/copy-check.svg", "repo_id": "lucide-icons/lucide", "token_count": 190 }
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" > <polyline points="9 10 4 15 9 20" /> <path d="M20 4v7a4 4 0 0 1-4 4H4" /> </svg>
lucide-icons/lucide/icons/corner-down-left.svg
{ "file_path": "lucide-icons/lucide/icons/corner-down-left.svg", "repo_id": "lucide-icons/lucide", "token_count": 130 }
49
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <circle cx="12" cy="12" r="10" /> <path d="M6 12c0-1.7.7-3.2 1.8-4.2" /> <circle cx="12" cy="12" r="2" /> <path d="M18 12c0 1.7-.7 3.2-1.8 4.2" /> </svg>
lucide-icons/lucide/icons/disc-3.svg
{ "file_path": "lucide-icons/lucide/icons/disc-3.svg", "repo_id": "lucide-icons/lucide", "token_count": 183 }
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" > <circle cx="12" cy="12" r="10" /> <path d="M19.13 5.09C15.22 9.14 10 10.44 2.25 10.94" /> <path d="M21.75 12.84c-6.62-1.41-12.14 1-16.38 6.32" /> <path d="M8.56 2.75c4.37 6 6 9.42 8 17.72" /> </svg>
lucide-icons/lucide/icons/dribbble.svg
{ "file_path": "lucide-icons/lucide/icons/dribbble.svg", "repo_id": "lucide-icons/lucide", "token_count": 204 }
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" > <path d="M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0" /> <path d="M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4" /> </svg>
lucide-icons/lucide/icons/ear.svg
{ "file_path": "lucide-icons/lucide/icons/ear.svg", "repo_id": "lucide-icons/lucide", "token_count": 174 }
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="12" r="2" /> <path d="M12 2v4" /> <path d="m6.8 15-3.5 2" /> <path d="m20.7 7-3.5 2" /> <path d="M6.8 9 3.3 7" /> <path d="m20.7 17-3.5-2" /> <path d="m9 22 3-8 3 8" /> <path d="M8 22h8" /> <path d="M18 18.7a9 9 0 1 0-12 0" /> </svg>
lucide-icons/lucide/icons/ferris-wheel.svg
{ "file_path": "lucide-icons/lucide/icons/ferris-wheel.svg", "repo_id": "lucide-icons/lucide", "token_count": 244 }
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="M11 11a5 5 0 0 1 0 6" /> <path d="M14 2v4a2 2 0 0 0 2 2h4" /> <path d="M4 6.765V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-.93-.23" /> <path d="M7 10.51a.5.5 0 0 0-.826-.38l-1.893 1.628A1 1 0 0 1 3.63 12H2.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h1.129a1 1 0 0 1 .652.242l1.893 1.63a.5.5 0 0 0 .826-.38z" /> </svg>
lucide-icons/lucide/icons/file-volume.svg
{ "file_path": "lucide-icons/lucide/icons/file-volume.svg", "repo_id": "lucide-icons/lucide", "token_count": 294 }
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" > <polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" /> </svg>
lucide-icons/lucide/icons/filter.svg
{ "file_path": "lucide-icons/lucide/icons/filter.svg", "repo_id": "lucide-icons/lucide", "token_count": 118 }
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="11.5" cy="12.5" r="2.5" /> <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" /> <path d="M13.3 14.3 15 16" /> </svg>
lucide-icons/lucide/icons/folder-search-2.svg
{ "file_path": "lucide-icons/lucide/icons/folder-search-2.svg", "repo_id": "lucide-icons/lucide", "token_count": 219 }
56
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M12 3v6" /> <circle cx="12" cy="12" r="3" /> <path d="M12 15v6" /> </svg>
lucide-icons/lucide/icons/git-commit-vertical.svg
{ "file_path": "lucide-icons/lucide/icons/git-commit-vertical.svg", "repo_id": "lucide-icons/lucide", "token_count": 134 }
57
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <circle cx="5" cy="6" r="3" /> <path d="M5 9v12" /> <path d="m15 9-3-3 3-3" /> <path d="M12 6h5a2 2 0 0 1 2 2v3" /> <path d="M19 15v6" /> <path d="M22 18h-6" /> </svg>
lucide-icons/lucide/icons/git-pull-request-create-arrow.svg
{ "file_path": "lucide-icons/lucide/icons/git-pull-request-create-arrow.svg", "repo_id": "lucide-icons/lucide", "token_count": 189 }
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="M15.686 15A14.5 14.5 0 0 1 12 22a14.5 14.5 0 0 1 0-20 10 10 0 1 0 9.542 13" /> <path d="M2 12h8.5" /> <path d="M20 6V4a2 2 0 1 0-4 0v2" /> <rect width="8" height="5" x="14" y="6" rx="1" /> </svg>
lucide-icons/lucide/icons/globe-lock.svg
{ "file_path": "lucide-icons/lucide/icons/globe-lock.svg", "repo_id": "lucide-icons/lucide", "token_count": 204 }
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" > <line x1="2" x2="22" y1="2" y2="22" /> <path d="M10.41 10.41a2 2 0 1 1-2.83-2.83" /> <line x1="13.5" x2="6" y1="13.5" y2="21" /> <line x1="18" x2="21" y1="12" y2="15" /> <path d="M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59" /> <path d="M21 15V5a2 2 0 0 0-2-2H9" /> </svg>
lucide-icons/lucide/icons/image-off.svg
{ "file_path": "lucide-icons/lucide/icons/image-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 277 }
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="M20 10c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8h8" /> <polyline points="16 14 20 18 16 22" /> </svg>
lucide-icons/lucide/icons/iteration-ccw.svg
{ "file_path": "lucide-icons/lucide/icons/iteration-ccw.svg", "repo_id": "lucide-icons/lucide", "token_count": 150 }
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="M8 2h8l4 10H4L8 2Z" /> <path d="M12 12v6" /> <path d="M8 22v-2c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v2H8Z" /> </svg>
lucide-icons/lucide/icons/lamp.svg
{ "file_path": "lucide-icons/lucide/icons/lamp.svg", "repo_id": "lucide-icons/lucide", "token_count": 168 }
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" > <circle cx="12" cy="12" r="10" /> <path d="M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z" /> <line x1="9" x2="9.01" y1="9" y2="9" /> <line x1="15" x2="15.01" y1="9" y2="9" /> </svg>
lucide-icons/lucide/icons/laugh.svg
{ "file_path": "lucide-icons/lucide/icons/laugh.svg", "repo_id": "lucide-icons/lucide", "token_count": 194 }
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" > <circle cx="12" cy="12" r="10" /> <path d="m4.93 4.93 4.24 4.24" /> <path d="m14.83 9.17 4.24-4.24" /> <path d="m14.83 14.83 4.24 4.24" /> <path d="m9.17 14.83-4.24 4.24" /> <circle cx="12" cy="12" r="4" /> </svg>
lucide-icons/lucide/icons/life-buoy.svg
{ "file_path": "lucide-icons/lucide/icons/life-buoy.svg", "repo_id": "lucide-icons/lucide", "token_count": 211 }
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" > <rect width="20" height="16" x="2" y="4" rx="2" /> <path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" /> </svg>
lucide-icons/lucide/icons/mail.svg
{ "file_path": "lucide-icons/lucide/icons/mail.svg", "repo_id": "lucide-icons/lucide", "token_count": 153 }
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="M11.7 3H5a2 2 0 0 0-2 2v16l4-4h12a2 2 0 0 0 2-2v-2.7" /> <circle cx="18" cy="6" r="3" /> </svg>
lucide-icons/lucide/icons/message-square-dot.svg
{ "file_path": "lucide-icons/lucide/icons/message-square-dot.svg", "repo_id": "lucide-icons/lucide", "token_count": 154 }
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="M21 12v3a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h7" /> <path d="M16 3h5v5" /> <path d="m16 8 5-5" /> </svg>
lucide-icons/lucide/icons/message-square-share.svg
{ "file_path": "lucide-icons/lucide/icons/message-square-share.svg", "repo_id": "lucide-icons/lucide", "token_count": 161 }
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="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z" /> <path d="M19 10v2a7 7 0 0 1-14 0v-2" /> <line x1="12" x2="12" y1="19" y2="22" /> </svg>
lucide-icons/lucide/icons/mic.svg
{ "file_path": "lucide-icons/lucide/icons/mic.svg", "repo_id": "lucide-icons/lucide", "token_count": 184 }
68
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <rect x="5" y="2" width="14" height="20" rx="7" /> <path d="M12 6v4" /> </svg>
lucide-icons/lucide/icons/mouse.svg
{ "file_path": "lucide-icons/lucide/icons/mouse.svg", "repo_id": "lucide-icons/lucide", "token_count": 130 }
69
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M6 8L2 12L6 16" /> <path d="M2 12H22" /> </svg>
lucide-icons/lucide/icons/move-left.svg
{ "file_path": "lucide-icons/lucide/icons/move-left.svg", "repo_id": "lucide-icons/lucide", "token_count": 121 }
70
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2" /> <path d="M18 14h-8" /> <path d="M15 18h-5" /> <path d="M10 6h8v4h-8V6Z" /> </svg>
lucide-icons/lucide/icons/newspaper.svg
{ "file_path": "lucide-icons/lucide/icons/newspaper.svg", "repo_id": "lucide-icons/lucide", "token_count": 228 }
71
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M12 4V2" /> <path d="M5 10v4a7.004 7.004 0 0 0 5.277 6.787c.412.104.802.292 1.102.592L12 22l.621-.621c.3-.3.69-.488 1.102-.592a7.01 7.01 0 0 0 4.125-2.939" /> <path d="M19 10v3.343" /> <path d="M12 12c-1.349-.573-1.905-1.005-2.5-2-.546.902-1.048 1.353-2.5 2-1.018-.644-1.46-1.08-2-2-1.028.71-1.69.918-3 1 1.081-1.048 1.757-2.03 2-3 .194-.776.84-1.551 1.79-2.21m11.654 5.997c.887-.457 1.28-.891 1.556-1.787 1.032.916 1.683 1.157 3 1-1.297-1.036-1.758-2.03-2-3-.5-2-4-4-8-4-.74 0-1.461.068-2.15.192" /> <line x1="2" x2="22" y1="2" y2="22" /> </svg>
lucide-icons/lucide/icons/nut-off.svg
{ "file_path": "lucide-icons/lucide/icons/nut-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 433 }
72
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M3 3h6l6 18h6" /> <path d="M14 3h7" /> </svg>
lucide-icons/lucide/icons/option.svg
{ "file_path": "lucide-icons/lucide/icons/option.svg", "repo_id": "lucide-icons/lucide", "token_count": 122 }
73
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <polyline points="16 2 16 8 22 8" /> <line x1="22" x2="16" y1="2" y2="8" /> <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z" /> </svg>
lucide-icons/lucide/icons/phone-incoming.svg
{ "file_path": "lucide-icons/lucide/icons/phone-incoming.svg", "repo_id": "lucide-icons/lucide", "token_count": 309 }
74
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" /> <rect width="10" height="7" x="12" y="13" rx="2" /> </svg>
lucide-icons/lucide/icons/picture-in-picture-2.svg
{ "file_path": "lucide-icons/lucide/icons/picture-in-picture-2.svg", "repo_id": "lucide-icons/lucide", "token_count": 165 }
75
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M22 14a8 8 0 0 1-8 8" /> <path d="M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2" /> <path d="M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1" /> <path d="M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10" /> <path d="M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" /> </svg>
lucide-icons/lucide/icons/pointer.svg
{ "file_path": "lucide-icons/lucide/icons/pointer.svg", "repo_id": "lucide-icons/lucide", "token_count": 292 }
76
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <line x1="12" x2="12" y1="3" y2="21" /> <polyline points="8 8 4 12 8 16" /> <polyline points="16 16 20 12 16 8" /> </svg>
lucide-icons/lucide/icons/separator-vertical.svg
{ "file_path": "lucide-icons/lucide/icons/separator-vertical.svg", "repo_id": "lucide-icons/lucide", "token_count": 146 }
77
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1 .6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1" /> <path d="M19.38 20A11.6 11.6 0 0 0 21 14l-9-4-9 4c0 2.9.94 5.34 2.81 7.76" /> <path d="M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6" /> <path d="M12 10v4" /> <path d="M12 2v3" /> </svg>
lucide-icons/lucide/icons/ship.svg
{ "file_path": "lucide-icons/lucide/icons/ship.svg", "repo_id": "lucide-icons/lucide", "token_count": 288 }
78
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <circle cx="12" cy="12" r="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" /> </svg>
lucide-icons/lucide/icons/smile.svg
{ "file_path": "lucide-icons/lucide/icons/smile.svg", "repo_id": "lucide-icons/lucide", "token_count": 186 }
79
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <rect width="18" height="18" x="3" y="3" rx="2" ry="2" /> <path d="M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3" /> <path d="M9 11.2h5.7" /> </svg>
lucide-icons/lucide/icons/square-function.svg
{ "file_path": "lucide-icons/lucide/icons/square-function.svg", "repo_id": "lucide-icons/lucide", "token_count": 181 }
80
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="M7 12h2l2 5 2-10h4" /> <rect x="3" y="3" width="18" height="18" rx="2" /> </svg>
lucide-icons/lucide/icons/square-radical.svg
{ "file_path": "lucide-icons/lucide/icons/square-radical.svg", "repo_id": "lucide-icons/lucide", "token_count": 138 }
81
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7" /> <path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8" /> <path d="M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4" /> <path d="M2 7h20" /> <path d="M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7" /> </svg>
lucide-icons/lucide/icons/store.svg
{ "file_path": "lucide-icons/lucide/icons/store.svg", "repo_id": "lucide-icons/lucide", "token_count": 409 }
82
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <path d="m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z" /> <path d="M12 22v-3" /> </svg>
lucide-icons/lucide/icons/tree-pine.svg
{ "file_path": "lucide-icons/lucide/icons/tree-pine.svg", "repo_id": "lucide-icons/lucide", "token_count": 221 }
83
<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 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" /> </svg>
lucide-icons/lucide/icons/twitter.svg
{ "file_path": "lucide-icons/lucide/icons/twitter.svg", "repo_id": "lucide-icons/lucide", "token_count": 201 }
84
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" > <rect width="18" height="18" x="3" y="3" rx="2" /> <path d="M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2" /> <path d="M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21" /> </svg>
lucide-icons/lucide/icons/wallet-cards.svg
{ "file_path": "lucide-icons/lucide/icons/wallet-cards.svg", "repo_id": "lucide-icons/lucide", "token_count": 220 }
85
<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="6" /> <polyline points="12 10 12 12 13 13" /> <path d="m16.13 7.66-.81-4.05a2 2 0 0 0-2-1.61h-2.68a2 2 0 0 0-2 1.61l-.78 4.05" /> <path d="m7.88 16.36.8 4a2 2 0 0 0 2 1.61h2.72a2 2 0 0 0 2-1.61l.81-4.05" /> </svg>
lucide-icons/lucide/icons/watch.svg
{ "file_path": "lucide-icons/lucide/icons/watch.svg", "repo_id": "lucide-icons/lucide", "token_count": 228 }
86
<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 22h8" /> <path d="M7 10h3m7 0h-1.343" /> <path d="M12 15v7" /> <path d="M7.307 7.307A12.33 12.33 0 0 0 7 10a5 5 0 0 0 7.391 4.391M8.638 2.981C8.75 2.668 8.872 2.34 9 2h6c1.5 4 2 6 2 8 0 .407-.05.809-.145 1.198" /> <line x1="2" x2="22" y1="2" y2="22" /> </svg>
lucide-icons/lucide/icons/wine-off.svg
{ "file_path": "lucide-icons/lucide/icons/wine-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 250 }
87
<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.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317" /> <path d="M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773" /> <path d="M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643" /> <path d="m2 2 20 20" /> </svg>
lucide-icons/lucide/icons/zap-off.svg
{ "file_path": "lucide-icons/lucide/icons/zap-off.svg", "repo_id": "lucide-icons/lucide", "token_count": 251 }
88
/* eslint-disable import/no-extraneous-dependencies */ import base64SVG from '@lucide/build-icons/utils/base64SVG.mjs'; export default ({ componentName, iconName, children, getSvg, deprecated, deprecationReason }) => { const svgContents = getSvg(); const svgBase64 = base64SVG(svgContents); return `\ import { LucideIconData } from './types'; /** * @component @name ${componentName} * @description Lucide SVG icon component, renders SVG Element with children. * * @preview ![img](data:image/svg+xml;base64,${svgBase64}) - https://lucide.dev/icons/${iconName} * @see https://lucide.dev/guide/packages/lucide-vue-next - Documentation * * @param {Object} props - Lucide icons props and any valid SVG attribute * @returns {FunctionalComponent} Vue component * ${deprecated ? `@deprecated ${deprecationReason}` : ''} */ const ${componentName}: LucideIconData = ${JSON.stringify(children)}; //eslint-disable-line no-shadow-restricted-names export default ${componentName}; `; };
lucide-icons/lucide/packages/lucide-angular/scripts/exportTemplate.mjs
{ "file_path": "lucide-icons/lucide/packages/lucide-angular/scripts/exportTemplate.mjs", "repo_id": "lucide-icons/lucide", "token_count": 319 }
89
import { expect, afterEach } from 'vitest'; import { cleanup } from '@testing-library/preact'; import '@testing-library/jest-dom/vitest'; import htmlSerializer from 'jest-serializer-html'; expect.addSnapshotSerializer(htmlSerializer); afterEach(() => { cleanup(); });
lucide-icons/lucide/packages/lucide-preact/tests/setupVitest.js
{ "file_path": "lucide-icons/lucide/packages/lucide-preact/tests/setupVitest.js", "repo_id": "lucide-icons/lucide", "token_count": 90 }
90
import { describe, it, expect, vi } from 'vitest'; import { render } from '@testing-library/react'; import { airVent } from './testIconNodes'; import { Icon } from '../src/lucide-react-native'; vi.mock('react-native-svg'); describe('Using Icon Component', () => { it('should render icon based on a iconNode', async () => { const { container } = render( <Icon iconNode={airVent} size={48} stroke="red" absoluteStrokeWidth />, ); expect(container.firstChild).toBeDefined(); }); it('should render icon and match snapshot', async () => { const { container } = render( <Icon iconNode={airVent} size={48} stroke="red" absoluteStrokeWidth />, ); expect(container.firstChild).toMatchSnapshot(); }); });
lucide-icons/lucide/packages/lucide-react-native/tests/Icon.spec.tsx
{ "file_path": "lucide-icons/lucide/packages/lucide-react-native/tests/Icon.spec.tsx", "repo_id": "lucide-icons/lucide", "token_count": 331 }
91
import { lstatSync } from 'fs'; import { readdir, readFile, writeFile } from 'fs/promises'; import path from 'path'; import { getCurrentDirPath } from '@lucide/helpers'; import { getJSBanner } from './license.mjs'; const currentDir = getCurrentDirPath(import.meta.url); const targetDirectory = path.join(currentDir, '../dist'); const files = await readdir(targetDirectory, { recursive: true, encoding: 'utf-8', }); // eslint-disable-next-line no-restricted-syntax for (const file of files) { const filepath = path.join(targetDirectory, file); const filestat = lstatSync(filepath); // eslint-disable-next-line no-continue if (filestat.isFile() === false || filestat.isDirectory()) continue; // eslint-disable-next-line no-await-in-loop const contents = await readFile(filepath, { encoding: 'utf-8' }); let newContents = contents; const ext = path.extname(filepath); let license; if (/\.(js|mjs|cjs|ts)/.test(ext)) { license = getJSBanner(); } if (license) { newContents = license + contents; } // Places icon block comment at the top of the Svelte component class if (/icons\/(.*?)\.svelte\.d\.ts/.test(filepath)) { const svelteFilepath = filepath.replace('.d.ts', ''); // eslint-disable-next-line no-await-in-loop const svelteFileContents = await readFile(svelteFilepath, { encoding: 'utf-8' }); const blockCommentRegex = /\/\*\*\n\s\*\s(@component\s@name)[\s\S]*?\*\//; const blockCommentMatch = blockCommentRegex.exec(svelteFileContents); if (blockCommentMatch !== null) { const blockComment = blockCommentMatch[0]; const exportClassRegex = /export default class (\w+) extends SvelteComponentTyped<(.*?)> {/; if (exportClassRegex.test(newContents)) { newContents = newContents.replace( exportClassRegex, `${blockComment}\nexport default class $1 extends SvelteComponentTyped<$2> {`, ); } } } if (newContents !== contents) { // eslint-disable-next-line no-await-in-loop await writeFile(filepath, newContents, { encoding: 'utf-8' }); } }
lucide-icons/lucide/packages/lucide-svelte/scripts/appendBlockComments.mjs
{ "file_path": "lucide-icons/lucide/packages/lucide-svelte/scripts/appendBlockComments.mjs", "repo_id": "lucide-icons/lucide", "token_count": 770 }
92
import '@testing-library/jest-dom/vitest';
lucide-icons/lucide/packages/lucide-vue-next/tests/setupVitest.js
{ "file_path": "lucide-icons/lucide/packages/lucide-vue-next/tests/setupVitest.js", "repo_id": "lucide-icons/lucide", "token_count": 17 }
93
import path from 'path'; import { readSvgDirectory, getCurrentDirPath, readAllMetadata, } from '../tools/build-helpers/helpers.mjs'; const currentDir = getCurrentDirPath(import.meta.url); const ICONS_DIR = path.resolve(currentDir, '../icons'); const icons = readAllMetadata(ICONS_DIR); const CATEGORIES_DIR = path.resolve(currentDir, '../categories'); const categories = readAllMetadata(CATEGORIES_DIR); console.log('Reading all icons'); const svgFiles = readSvgDirectory(ICONS_DIR); const iconNames = svgFiles.map((icon) => icon.split('.')[0]); let error = false; iconNames.forEach((iconName) => { if (typeof icons[iconName] === 'undefined') { console.error(`'${iconName}.svg' does not have a matching JSON file.`); error = true; } }); Object.keys(icons).forEach((iconName) => { const icon = icons[iconName]; if (iconNames.indexOf(iconName) === -1) { console.error(`'${iconName}.svg' does not exist.`); error = true; } icon.categories.forEach((categoryName) => { if (typeof categories[categoryName] === 'undefined') { console.error(`Icon '${iconName}' refers to the non-existing category '${categoryName}'.`); error = true; } }); }); Object.keys(categories).forEach((categoryName) => { const category = categories[categoryName]; if (!category.icon) { console.error(`Category '${categoryName}' does not use an icon '${category.icon}'.`); error = true; } else if (typeof icons[category.icon] === 'undefined') { console.error(`Category '${categoryName}' uses the non-existing icon '${category.icon}'.`); error = true; } }); if (error) { console.error('At least one error in icon JSONs prevents from committing changes.'); process.exit(1); }
lucide-icons/lucide/scripts/checkIconsAndCategories.mjs
{ "file_path": "lucide-icons/lucide/scripts/checkIconsAndCategories.mjs", "repo_id": "lucide-icons/lucide", "token_count": 606 }
94
import { optimize } from 'svgo'; import * as prettier from 'prettier'; import { parseSync, stringify } from 'svgson'; import DEFAULT_ATTRS from '../../tools/build-icons/render/default-attrs.json' assert { type: 'json' }; /** * Optimize SVG with `svgo`. * @param {string} svg - An SVG string. * @returns {Promise<string>} An optimized svg */ async function optimizeSvg(svg, path) { const result = optimize(svg, { path, plugins: [ { name: 'preset-default', params: { overrides: { convertShapeToPath: false, mergePaths: false, }, }, }, { name: 'removeAttrs', params: { attrs: '(fill|stroke.*)', }, }, ], }); return result.data; } /** * Set default attibutes on SVG. * @param {string} svg - An SVG string. * @returns {string} An SVG string, included with the default attributes. */ function setAttrs(svg) { const contents = parseSync(svg); contents.attributes = DEFAULT_ATTRS; return stringify(contents); } /** * Process SVG string. * @param {string} svg An SVG string. * @returns {Promise<string>} An optimized svg */ function processSvg(svg, path) { return ( optimizeSvg(svg, path) .then(setAttrs) .then((optimizedSvg) => prettier.format(optimizedSvg, { parser: 'babel' })) // remove semicolon inserted by prettier // because prettier thinks it's formatting JSX not HTML .then((svg) => svg.replace(/;/g, '')) ); } export default processSvg;
lucide-icons/lucide/scripts/render/processSvg.mjs
{ "file_path": "lucide-icons/lucide/scripts/render/processSvg.mjs", "repo_id": "lucide-icons/lucide", "token_count": 633 }
95
/* eslint-disable import/prefer-default-export */ import fs from 'fs'; import path from 'path'; /** * Reads the file contents. * * @param {string} path * @returns {string} The contents of a file */ export const readFile = (path) => fs.readFileSync(path.resolve(__dirname, '../', path), 'utf-8');
lucide-icons/lucide/tools/build-helpers/src/readFile.mjs
{ "file_path": "lucide-icons/lucide/tools/build-helpers/src/readFile.mjs", "repo_id": "lucide-icons/lucide", "token_count": 101 }
96
import fs from 'fs'; import path from 'path'; import prettier from 'prettier'; import { readSvg, toPascalCase } from '@lucide/helpers'; import { deprecationReasonTemplate } from '../utils/deprecationReasonTemplate.mjs'; export default ({ iconNodes, outputDirectory, template, showLog = true, iconFileExtension = '.js', pretty = true, iconsDir, iconMetaData, }) => { const icons = Object.keys(iconNodes); const iconsDistDirectory = path.join(outputDirectory, `icons`); if (!fs.existsSync(iconsDistDirectory)) { fs.mkdirSync(iconsDistDirectory); } const writeIconFiles = icons.map(async (iconName) => { const location = path.join(iconsDistDirectory, `${iconName}${iconFileExtension}`); const componentName = toPascalCase(iconName); let { children } = iconNodes[iconName]; children = children.map(({ name, attributes }) => [name, attributes]); const getSvg = () => readSvg(`${iconName}.svg`, iconsDir); const { deprecated = false, toBeRemovedInVersion = null } = iconMetaData[iconName]; const deprecationReason = deprecated ? deprecationReasonTemplate(iconMetaData[iconName].deprecationReason, { componentName, iconName, toBeRemovedInVersion, }) : ''; const elementTemplate = template({ componentName, iconName, children, getSvg, deprecated, deprecationReason, }); const output = pretty ? prettier.format(elementTemplate, { singleQuote: true, trailingComma: 'all', printWidth: 100, parser: 'babel', }) : elementTemplate; await fs.promises.writeFile(location, output, 'utf-8'); }); Promise.all(writeIconFiles) .then(() => { if (showLog) { console.log('Successfully built', icons.length, 'icons.'); } }) .catch((error) => { throw new Error(`Something went wrong generating icon files,\n ${error}`); }); };
lucide-icons/lucide/tools/build-icons/building/generateIconFiles.mjs
{ "file_path": "lucide-icons/lucide/tools/build-icons/building/generateIconFiles.mjs", "repo_id": "lucide-icons/lucide", "token_count": 751 }
97
import { redirect } from "next/navigation"; import { validateRequest } from "~/actions/auth"; import SidebarNav from "~/components/layout/sidebar-nav"; interface DashboardLayoutProps { children: React.ReactNode; } export default async function DashboardLayout({ children, }: DashboardLayoutProps) { // move to middleware and check stripe payment const { session } = await validateRequest(); if (!session) redirect("/login"); return ( <div className="container"> <div className="flex min-h-[calc(100vh-140px)] flex-col gap-8 rounded-md py-8 md:min-h-[calc(100vh-160px)] lg:flex-row 2xl:gap-12"> <aside className="lg:w-1/5"> <SidebarNav /> </aside> <div className="w-full">{children}</div> </div> </div> ); }
moinulmoin/chadnext/src/app/[locale]/dashboard/layout.tsx
{ "file_path": "moinulmoin/chadnext/src/app/[locale]/dashboard/layout.tsx", "repo_id": "moinulmoin/chadnext", "token_count": 299 }
98
import { redirect } from "next/navigation"; import { validateRequest } from "~/actions/auth"; import AuthForm from "~/components/layout/auth-form"; import { Card } from "~/components/ui/card"; export default async function Login() { const { session } = await validateRequest(); if (session) redirect("/"); return ( <section> <div className="container"> <div className="flex min-h-[calc(100vh-184px)] items-center justify-center md:min-h-[calc(100vh-160px)]"> <Card className="w-full max-w-[450px] p-6 shadow-md"> <h2 className="pb-2 text-center text-3xl font-semibold tracking-tight transition-colors"> Login </h2> <AuthForm /> </Card> </div> </div> </section> ); }
moinulmoin/chadnext/src/app/[locale]/login/page.tsx
{ "file_path": "moinulmoin/chadnext/src/app/[locale]/login/page.tsx", "repo_id": "moinulmoin/chadnext", "token_count": 330 }
99