text
stringlengths 21
253k
| id
stringlengths 25
123
| metadata
dict | __index_level_0__
int64 0
181
|
---|---|---|---|
"use client";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Button } from "@/components/ui/button";
import { MoreHorizontalIcon } from "lucide-react";
import { toast } from "sonner";
import { useRouter } from "next/navigation";
import { type WaitlistData } from "@/app/(app)/admin/waitlist/_components/columns";
import { useMutation } from "@tanstack/react-query";
import { deleteWaitlistUserMutation } from "@/server/actions/waitlist/mutations";
export function ColumnDropdown({ email, id }: WaitlistData) {
const router = useRouter();
const { mutateAsync: deleteUserMutate, isPending: deleteUserIsPending } =
useMutation({
mutationFn: () => deleteWaitlistUserMutation({ id }),
onSettled: () => {
router.refresh();
},
});
const deleteUser = () => {
toast.promise(async () => await deleteUserMutate(), {
loading: "Deleting user...",
success: "User deleted!",
error: (e) => {
console.log(e);
return "Failed to delete user.";
},
});
};
return (
<DropdownMenu modal={false}>
<DropdownMenuTrigger asChild>
<Button variant="ghost" className="h-8 w-8 p-0">
<span className="sr-only">Open menu</span>
<MoreHorizontalIcon className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-screen max-w-[12rem]">
<DropdownMenuLabel>Actions</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={async () => {
await navigator.clipboard.writeText(email);
toast("User email copied to clipboard");
}}
>
Copy email
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
disabled={deleteUserIsPending}
onClick={deleteUser}
className="text-red-600"
>
Delete
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}
| alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/waitlist/_components/column-dropdown.tsx | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(app)/admin/waitlist/_components/column-dropdown.tsx",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 1225
} | 12 |
import Balancer from "react-wrap-balancer";
export function Promotion() {
return (
<section className="flex min-h-96 w-full flex-col items-center justify-center gap-5 rounded-[26px] bg-foreground p-8 py-10 text-background">
<Balancer
as="h2"
className="text-center font-heading text-3xl font-bold md:text-5xl"
>
Launch your SaaS in just a few days
</Balancer>
<Balancer
as="p"
className="text-center text-base leading-relaxed text-background/70 sm:text-xl"
>
Because Rapidlaunch comes with a SaaS starter kit, Blocks and
guides, and more, you can launch your SaaS in just a few days.
Get started with our starter kits, components, building guides,
and more. Customizable.{" "}
<span className="rounded-[5px] bg-background p-1 font-semibold text-foreground">
Open Source.
</span>
</Balancer>
</section>
);
}
| alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/_components/promotion.tsx | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/(web)/_components/promotion.tsx",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 539
} | 13 |
import { env } from "@/env";
import crypto from "node:crypto";
import { webhookHasMeta } from "@/validations/lemonsqueezy";
import {
processWebhookEvent,
storeWebhookEvent,
} from "@/server/actions/subscription/mutations";
export async function POST(request: Request) {
const rawBody = await request.text();
const secret = env.LEMONSQUEEZY_WEBHOOK_SECRET;
const hmac = crypto.createHmac("sha256", secret);
const digest = Buffer.from(hmac.update(rawBody).digest("hex"), "utf8");
const signature = Buffer.from(
request.headers.get("X-Signature") ?? "",
"utf8",
);
if (!crypto.timingSafeEqual(digest, signature)) {
throw new Error("Invalid signature.");
}
const data = JSON.parse(rawBody) as unknown;
if (webhookHasMeta(data)) {
const webhookEventId = await storeWebhookEvent(
data.meta.event_name,
data,
);
// Non-blocking call to process the webhook event.
void processWebhookEvent(webhookEventId!);
return new Response("OK", { status: 200 });
}
return new Response("Data invalid", { status: 400 });
}
| alifarooq9/rapidlaunch/starterkits/saas/src/app/api/lemonsqueezy/webhook/route.ts | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/api/lemonsqueezy/webhook/route.ts",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 441
} | 14 |
export const maintenancePageConfig = {
title: "Maintenance",
description:
"We're currently undergoing maintenance. Please check back later.",
} as const;
| alifarooq9/rapidlaunch/starterkits/saas/src/app/maintenance/_constants/page-config.ts | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/app/maintenance/_constants/page-config.ts",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 53
} | 15 |
/**
* @purpose This file is used to store the site configuration.
*
* Add all the general site-wide configuration here.
*/
export const siteConfig = {
name: "Rapidlaunch",
description:
"Get your startup off the ground quickly with RapidLaunch! This open source Next.js starter kit provides the foundation you need to build your MVP fast pre-built components, optimized performance, and ready-to-go styling",
orgImage:
"https://utfs.io/f/4ae0ddb1-4260-46f5-aa7c-70408cc192b9-aadavt.png",
contactEmail: "[email protected]",
noReplyEmail: "[email protected]",
} as const;
| alifarooq9/rapidlaunch/starterkits/saas/src/config/site.ts | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/config/site.ts",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 215
} | 16 |
"use server";
import { resend } from "@/server/resend";
import { siteConfig } from "@/config/site";
import { siteUrls } from "@/config/urls";
import { z } from "zod";
const sendOrgInviteEmailProps = z.object({
email: z.string().email("Please enter a valid email address"),
orgName: z.string(),
invLink: z.string(),
});
type sendOrgInviteEmailProps = z.infer<typeof sendOrgInviteEmailProps>;
// Send a verification email to the user
export async function sendOrgInviteEmail({
email,
orgName,
invLink,
}: sendOrgInviteEmailProps) {
const { success } = sendOrgInviteEmailProps.safeParse({
email,
orgName,
invLink,
});
if (!success) {
throw new Error("Invalid email");
}
try {
//send email to user via resend
await resend.emails.send({
from: siteConfig.noReplyEmail,
to: email,
subject: `You have been Inited to a Team | ${siteConfig.name}`,
html: `
<div>
<a href="${siteUrls.rapidlaunch}">${siteConfig.name}</a>
<h1> Your Invite to ${orgName}</h1>
<p>
You have been invited to join ${orgName}
Click the link below to verify to join ${orgName} on ${siteConfig.name}.
</p>
<a href="${invLink}">Join Organisation</a>
<p> or </p>
<p>
Copy and paste the following link in your browser:
<br />
${invLink}
</p>
<hr />
<p>
If you didn't request this email, you can ignore it.
</p>
</div>`,
text: `Click the link below to join the orgaisation. ${invLink}`,
tags: [
{
name: "category",
value: "confirm_email",
},
],
});
} catch (error) {
throw new Error("Failed to send verification email");
}
}
| alifarooq9/rapidlaunch/starterkits/saas/src/server/actions/send-org-invite-email.ts | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/server/actions/send-org-invite-email.ts",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 1138
} | 17 |
export type SearchParams = Record<string, string | string[] | undefined>;
export type Option = {
label: string;
value: string | number | boolean;
icon?: React.ComponentType<{ className?: string }>;
};
export interface DataTableFilterOption<TData> {
id?: string;
label: string;
value: keyof TData | string;
items: Option[];
isMulti?: boolean;
}
export interface DataTableSearchableColumn<TData> {
id: keyof TData;
placeholder?: string;
}
export interface DataTableFilterableColumn<TData> {
id: keyof TData;
title: string;
options: Option[];
}
| alifarooq9/rapidlaunch/starterkits/saas/src/types/data-table.ts | {
"file_path": "alifarooq9/rapidlaunch/starterkits/saas/src/types/data-table.ts",
"repo_id": "alifarooq9/rapidlaunch",
"token_count": 208
} | 18 |
'use client';
import { Button } from '@/components/ui/button';
import Link from 'next/link';
import { signInWithEmail } from '@/utils/auth-helpers/server';
import { handleRequest } from '@/utils/auth-helpers/client';
import { useRouter } from 'next/navigation';
import { useState } from 'react';
import { Input } from '../ui/input';
// Define prop type with allowPassword boolean
interface EmailSignInProps {
allowPassword: boolean;
redirectMethod: string;
disableButton?: boolean;
}
export default function EmailSignIn({
allowPassword,
redirectMethod
}: EmailSignInProps) {
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, signInWithEmail, router);
setIsSubmitting(false);
};
return (
<div className="mb-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="email">
Email
</label>
<Input
className="mr-2.5 mb-2 h-full min-h-[44px] w-full px-4 py-3 text-sm font-medium focus:outline-0 dark:placeholder:text-zinc-400"
id="email"
placeholder="[email protected]"
type="email"
name="email"
autoCapitalize="none"
autoComplete="email"
autoCorrect="off"
/>
</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>
) : (
'Sign in'
)}
</Button>
</div>
</form>
{allowPassword && (
<>
<p>
<Link
href="/dashboard/signin/password_signin"
className="font-medium text-sm dark:text-white"
>
Sign in with email and password
</Link>
</p>
<p>
<Link
href="/dashboard/signin/signup"
className="font-medium text-sm dark:text-white"
>
Don't have an account? Sign up
</Link>
</p>
</>
)}
</div>
);
}
| horizon-ui/shadcn-nextjs-boilerplate/components/auth-ui/EmailSignIn.tsx | {
"file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/auth-ui/EmailSignIn.tsx",
"repo_id": "horizon-ui/shadcn-nextjs-boilerplate",
"token_count": 2120
} | 19 |
/*eslint-disable*/
'use client';
import DashboardLayout from '@/components/layout';
import { Button } from '@/components/ui/button';
import { Card } from '@/components/ui/card';
import { User } from '@supabase/supabase-js';
import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { createClient } from '@/utils/supabase/client';
import { getURL, getStatusRedirect } from '@/utils/helpers';
import Notifications from './components/notification-settings';
import { Input } from '@/components/ui/input';
interface Props {
user: User | null | undefined;
userDetails: { [x: string]: any } | null;
}
const supabase = createClient();
export default function Settings(props: Props) {
// Input States
const [nameError, setNameError] = useState<{
status: boolean;
message: string;
}>();
console.log(props.user);
console.log(props.userDetails);
const router = useRouter();
const [isSubmitting, setIsSubmitting] = useState(false);
const handleSubmitEmail = async (e: React.FormEvent<HTMLFormElement>) => {
setIsSubmitting(true);
// Check if the new email is the same as the old email
if (e.currentTarget.newEmail.value === props.user.email) {
e.preventDefault();
setIsSubmitting(false);
return;
}
// Get form data
const newEmail = e.currentTarget.newEmail.value.trim();
const callbackUrl = getURL(
getStatusRedirect(
'/dashboard/settings',
'Success!',
`Your email has been updated.`
)
);
e.preventDefault();
const { error } = await supabase.auth.updateUser(
{ email: newEmail },
{
emailRedirectTo: callbackUrl
}
);
router.push('/dashboard/settings');
setIsSubmitting(false);
};
const handleSubmitName = async (e: React.FormEvent<HTMLFormElement>) => {
setIsSubmitting(true);
// Check if the new name is the same as the old name
if (e.currentTarget.fullName.value === props.user.user_metadata.full_name) {
e.preventDefault();
setIsSubmitting(false);
return;
}
// Get form data
const fullName = e.currentTarget.fullName.value.trim();
const { error } = await supabase
.from('users')
.update({ full_name: fullName })
.eq('id', props.user?.id);
if (error) {
console.log(error);
}
e.preventDefault();
supabase.auth.updateUser({
data: { full_name: fullName }
});
router.push('/dashboard/settings');
setIsSubmitting(false);
};
const notifications = [
{ message: 'Your call has been confirmed.', time: '1 hour ago' },
{ message: 'You have a new message!', time: '1 hour ago' },
{ message: 'Your subscription is expiring soon!', time: '2 hours ago' }
];
return (
<DashboardLayout
user={props.user}
userDetails={props.userDetails}
title="Account Settings"
description="Profile settings."
>
<div className="relative mx-auto flex w-max max-w-full flex-col md:pt-[unset] lg:pt-[100px] lg:pb-[100px]">
<div className="maw-w-full mx-auto w-full flex-col justify-center md:w-full md:flex-row xl:w-full">
<Card
className={
'mb-5 h-min flex items-center aligh-center max-w-full py-8 px-4 dark:border-zinc-800'
}
>
<Avatar className="min-h-[68px] min-w-[68px]">
<AvatarImage src={props.user?.user_metadata.avatar_url} />
<AvatarFallback className="text-2xl font-bold dark:text-zinc-950">
{props.user.user_metadata.full_name
? `${props.user.user_metadata.full_name[0]}`
: `${props.user?.user_metadata.email[0].toUpperCase()}`}
</AvatarFallback>
</Avatar>
<div>
<p className="text-xl font-extrabold text-zinc-950 leading-[100%] dark:text-white pl-4 md:text-3xl">
{props.user.user_metadata.full_name}
</p>
<p className="text-sm font-medium text-zinc-500 dark:text-zinc-400 md:mt-2 pl-4 md:text-base">
CEO and Founder
</p>
</div>
</Card>
<Card
className={
'mb-5 h-min max-w-full pt-8 pb-6 px-6 dark:border-zinc-800'
}
>
<p className="text-xl font-extrabold text-zinc-950 dark:text-white md:text-3xl">
Account Details
</p>
<p className="mb-6 mt-1 text-sm font-medium text-zinc-500 dark:text-zinc-400 md:mt-4 md:text-base">
Here you can change your account information
</p>
<label
className="mb-3 flex cursor-pointer px-2.5 font-bold leading-none text-zinc-950 dark:text-white"
htmlFor={'name'}
>
Your Name
<p className="ml-1 mt-[1px] text-sm font-medium leading-none text-zinc-500 dark:text-zinc-400">
(30 characters maximum)
</p>
</label>
<div className="mb-8 flex flex-col md:flex-row">
<form
className="w-full"
id="nameForm"
onSubmit={(e) => handleSubmitName(e)}
>
<Input
type="text"
name="fullName"
// defaultValue={props.user?.user_metadata.full_name ?? ''}
defaultValue={props.userDetails?.full_name ?? ''}
placeholder="Please enter your full name"
className={`mb-2 mr-4 flex h-full w-full px-4 py-4 outline-none md:mb-0`}
/>
</form>
<Button
className="flex h-full max-h-full w-full items-center justify-center rounded-lg px-4 py-4 text-base font-medium md:ms-4 md:w-[300px]"
form="nameForm"
type="submit"
>
Update name
</Button>
<div className="mt-8 h-px w-full max-w-[90%] self-center bg-zinc-200 dark:bg-white/10 md:mt-0 md:hidden" />
</div>
<p
className={`mb-5 px-2.5 text-red-500 md:px-9 ${
nameError?.status ? 'block' : 'hidden'
}`}
>
{nameError?.message}
</p>
<label
className="mb-3 ml-2.5 flex cursor-pointer px-2.5 font-bold leading-none text-zinc-950 dark:text-white"
htmlFor={'email'}
>
Your Email
<p className="ml-1 mt-[1px] text-sm font-medium leading-none text-zinc-500 dark:text-zinc-400">
(We will email you to verify the change)
</p>
</label>
<div className="mb-8 flex flex-col md:flex-row">
<form
className="w-full"
id="emailForm"
onSubmit={(e) => handleSubmitEmail(e)}
>
<Input
placeholder="Please enter your email"
defaultValue={props.user.email ?? ''}
type="text"
name="newEmail"
className={`mr-4 flex h-full max-w-full w-full items-center justify-center px-4 py-4 outline-none`}
/>
</form>
<Button
className="flex h-full max-h-full w-full items-center justify-center rounded-lg px-4 py-4 text-base md:ms-4 font-medium md:w-[300px]"
type="submit"
form="emailForm"
>
Update email
</Button>
</div>
</Card>
<Notifications notifications={notifications} />
</div>
</div>
</DashboardLayout>
);
}
| horizon-ui/shadcn-nextjs-boilerplate/components/dashboard/settings/index.tsx | {
"file_path": "horizon-ui/shadcn-nextjs-boilerplate/components/dashboard/settings/index.tsx",
"repo_id": "horizon-ui/shadcn-nextjs-boilerplate",
"token_count": 3871
} | 20 |
@import url('https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
--radius: 10px;
--chart: #0F172A;
--background: 0 0% 100%;
--foreground: 240, 10%, 4%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--card: 0, 0%, 100%;
--card-foreground: 0, 0%, 100%;
--popover: 0, 0%, 100%;
--popover-foreground: 0, 0%, 100%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--primary: 240 10% 4%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 240, 10%, 4%;
--accent: 210 40% 96.1%;
--accent-foreground: 240, 10%, 4%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: transparent;
--chart-1: #52525b;
--chart-2: #D4D4D8;
--chart-3: #030712;
--chart-4: #71717a;
--chart-5: #a1a1aa;
}
:root.dark {
--background: 240 10% 4%;
--foreground: 0, 0%, 100%;
--chart: 0, 0%, 100%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--card: 240 10% 4%;
--card-foreground: 0 0% 100%;
--popover: 240 10% 4%;
--popover-foreground: 0 0% 100%;
--border: 240 4% 16%;
--input: 240 4% 16%;
--primary: 0 0% 100%;
--primary-foreground: 240 10% 4%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--accent: 240 4% 16%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;
--ring: 0 0% 0%;
--chart-1: #ffffff;
--chart-2: #71717A;
--chart-3: #030712;
--chart-4: #71717a;
--chart-5: #a1a1aa;
}
body {
font-family: 'Inter', sans-serif;
}
html {
scroll-behavior: smooth;
font-family: 'Inter', sans-serif;
color-scheme: unset !important;
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
font-weight: inherit;
/* 1 */
line-height: inherit;
/* 1 */
color: hsl(var(--foreground));
/* 1 */
margin: 0;
/* 2 */
padding: 0;
/* 3 */
}
option {
color: black;
}
p {
letter-spacing: 0px;
}
img {
pointer-events: none;
}
::-moz-selection {
/* Code for Firefox */
color: white;
background: #09090B;
}
::selection {
color: white;
background: #09090B;
}
input.defaultCheckbox {
color: white;
}
input.defaultCheckbox::before {
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.66662 10.115L12.7946 3.98633L13.7379 4.92899L6.66662 12.0003L2.42395 7.75766L3.36662 6.81499L6.66662 10.115Z' fill='white'/%3E%3C/svg%3E%0A");
fill: currentColor;
opacity: 0;
height: 16px;
width: 16px;
top: 0;
position: absolute;
left: 50%;
transform: translate(-50%, 0px);
}
input.defaultCheckbox::before path {
fill: currentColor;
}
input:checked.defaultCheckbox::before {
opacity: 1;
}
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
}
} | horizon-ui/shadcn-nextjs-boilerplate/styles/globals.css | {
"file_path": "horizon-ui/shadcn-nextjs-boilerplate/styles/globals.css",
"repo_id": "horizon-ui/shadcn-nextjs-boilerplate",
"token_count": 1305
} | 21 |
import { IRoute } from '@/types/types'
// NextJS Requirement
export const isWindowAvailable = () => typeof window !== 'undefined'
export const findCurrentRoute = (
routes: IRoute[],
pathname: string,
): IRoute | undefined => {
for (let route of routes) {
if (route.items) {
const found = findCurrentRoute(route.items, pathname)
if (found) return found
}
if (pathname?.match(route.path) && route) {
return route
}
}
}
export const getActiveRoute = (routes: IRoute[], pathname: string): string => {
const route = findCurrentRoute(routes, pathname)
return route?.name || 'Default Brand Text'
}
export const getActiveNavbar = (
routes: IRoute[],
pathname: string,
): boolean => {
const route = findCurrentRoute(routes, pathname)
if (route?.secondary) return route?.secondary
else return false
}
export const getActiveNavbarText = (
routes: IRoute[],
pathname: string,
): string | boolean => {
return getActiveRoute(routes, pathname) || false
}
| horizon-ui/shadcn-nextjs-boilerplate/utils/navigation.tsx | {
"file_path": "horizon-ui/shadcn-nextjs-boilerplate/utils/navigation.tsx",
"repo_id": "horizon-ui/shadcn-nextjs-boilerplate",
"token_count": 340
} | 22 |
import '@/styles/global.css';
import type { Metadata } from 'next';
import { NextIntlClientProvider, useMessages } from 'next-intl';
import { unstable_setRequestLocale } from 'next-intl/server';
import { DemoBadge } from '@/components/DemoBadge';
import { AllLocales } from '@/utils/AppConfig';
export const metadata: Metadata = {
icons: [
{
rel: 'apple-touch-icon',
url: '/apple-touch-icon.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
url: '/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
url: '/favicon-16x16.png',
},
{
rel: 'icon',
url: '/favicon.ico',
},
],
};
export function generateStaticParams() {
return AllLocales.map(locale => ({ locale }));
}
export default function RootLayout(props: {
children: React.ReactNode;
params: { locale: string };
}) {
unstable_setRequestLocale(props.params.locale);
// Using internationalization in Client Components
const messages = useMessages();
return (
<html lang={props.params.locale}>
<body className="bg-background text-foreground antialiased">
<NextIntlClientProvider
locale={props.params.locale}
messages={messages}
>
{props.children}
<DemoBadge />
</NextIntlClientProvider>
</body>
</html>
);
}
| ixartz/SaaS-Boilerplate/src/app/[locale]/layout.tsx | {
"file_path": "ixartz/SaaS-Boilerplate/src/app/[locale]/layout.tsx",
"repo_id": "ixartz/SaaS-Boilerplate",
"token_count": 595
} | 23 |
'use client';
import type { ColumnDef } from '@tanstack/react-table';
import {
flexRender,
getCoreRowModel,
useReactTable,
} from '@tanstack/react-table';
import { useTranslations } from 'next-intl';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/components/ui/table';
type DataTableProps<TData, TValue> = {
columns: ColumnDef<TData, TValue>[];
data: TData[];
};
export function DataTable<TData, TValue>({
columns,
data,
}: DataTableProps<TData, TValue>) {
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
});
const t = useTranslations('DataTable');
return (
<div className="rounded-md border bg-card">
<Table>
<TableHeader>
{table.getHeaderGroups().map(headerGroup => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext(),
)}
</TableHead>
);
})}
</TableRow>
))}
</TableHeader>
<TableBody>
{table.getRowModel().rows?.length
? (
table.getRowModel().rows.map(row => (
<TableRow
key={row.id}
data-state={row.getIsSelected() && 'selected'}
>
{row.getVisibleCells().map(cell => (
<TableCell key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</TableCell>
))}
</TableRow>
))
)
: (
<TableRow>
<TableCell colSpan={columns.length} className="h-24 text-center">
{t('no_results')}
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</div>
);
}
| ixartz/SaaS-Boilerplate/src/components/ui/data-table.tsx | {
"file_path": "ixartz/SaaS-Boilerplate/src/components/ui/data-table.tsx",
"repo_id": "ixartz/SaaS-Boilerplate",
"token_count": 1249
} | 24 |
export const CTABanner = (props: {
title: string;
description: string;
buttons: React.ReactNode;
}) => (
<div className="rounded-xl bg-muted bg-gradient-to-br from-indigo-400 via-purple-400 to-pink-400 px-6 py-10 text-center">
<div className="text-3xl font-bold text-primary-foreground">
{props.title}
</div>
<div className="mt-2 text-lg font-medium text-muted">
{props.description}
</div>
<div className="mt-6">{props.buttons}</div>
</div>
);
| ixartz/SaaS-Boilerplate/src/features/landing/CTABanner.tsx | {
"file_path": "ixartz/SaaS-Boilerplate/src/features/landing/CTABanner.tsx",
"repo_id": "ixartz/SaaS-Boilerplate",
"token_count": 208
} | 25 |
import { createSharedPathnamesNavigation } from 'next-intl/navigation';
import { AllLocales, AppConfig } from '@/utils/AppConfig';
export const { usePathname, useRouter } = createSharedPathnamesNavigation({
locales: AllLocales,
localePrefix: AppConfig.localePrefix,
});
| ixartz/SaaS-Boilerplate/src/libs/i18nNavigation.ts | {
"file_path": "ixartz/SaaS-Boilerplate/src/libs/i18nNavigation.ts",
"repo_id": "ixartz/SaaS-Boilerplate",
"token_count": 88
} | 26 |
import type { EnumValues } from './Enum';
export const ORG_ROLE = {
ADMIN: 'org:admin',
MEMBER: 'org:member',
} as const;
export type OrgRole = EnumValues<typeof ORG_ROLE>;
export const ORG_PERMISSION = {
// Add Organization Permissions here
} as const;
export type OrgPermission = EnumValues<typeof ORG_PERMISSION>;
| ixartz/SaaS-Boilerplate/src/types/Auth.ts | {
"file_path": "ixartz/SaaS-Boilerplate/src/types/Auth.ts",
"repo_id": "ixartz/SaaS-Boilerplate",
"token_count": 119
} | 27 |
{
"Lucide SVG": {
"scope": "xml",
"description": "Base SVG with Lucide attributes.",
"prefix": [
"svg",
"lucide"
],
"body": [
"<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\"",
">",
" $0",
"</svg>"
]
},
"Rectangle": {
"scope": "xml",
"description": "SVG `rect`angle, with Lucide defaults.",
"prefix": [
"rect",
"<rect"
],
"body": "<rect width=\"${1:20}\" height=\"${2:12}\" x=\"${3:2}\" y=\"${4:6}\" rx=\"${5|2,1|}\"/>"
},
"Square": {
"scope": "xml",
"description": "SVG square `rect`angle, with Lucide defaults.",
"prefix": [
"square",
"rect",
"<rect",
"tile"
],
"body": "<rect width=\"${1:18}\" height=\"$1\" x=\"${2:3}\" y=\"${3:$2}\" rx=\"${4|2,1|}\" />"
},
"Circle": {
"scope": "xml",
"description": "SVG `circle`, with Lucide defaults.",
"prefix": [
"circle",
"<circle"
],
"body": "<circle cx=\"${2:12}\" cy=\"${3:$2}\" r=\"${1|10,2,.5\" fill=\"currentColor|}\" />"
},
"Ellipse": {
"scope": "xml",
"description": "SVG `ellipse`.",
"prefix": [
"ellipse",
"<ellipse"
],
"body": "<ellipse cx=\"${3:12}\" cy=\"${4:$3}\" rx=\"${1:10}\" ry=\"${2:$1}\" />"
},
"Path": {
"scope": "xml",
"description": "SVG custom `path`.",
"prefix": [
"path",
"<path",
"polyline",
"<polyline",
"polygon",
"<polygon"
],
"body": "<path d=\"${1|M,m|}$0\" />"
},
"Line": {
"scope": "xml",
"description": "SVG `path`, preffered to `line` in Lucide.",
"prefix": [
"line",
"<line",
"minus"
],
"body": "<path d=\"M${3:5} ${4:12}${1|h,v|}${2:14}\" />"
},
"Dot": {
"scope": "xml",
"description": "SVG small dot, within the Lucide guidelines.",
"prefix": [
"dot",
"."
],
"body": "<path d=\"M ${1:12} ${2:$1}h.01\" />"
}
}
| lucide-icons/lucide/.vscode/svg.code-snippets | {
"file_path": "lucide-icons/lucide/.vscode/svg.code-snippets",
"repo_id": "lucide-icons/lucide",
"token_count": 1123
} | 28 |
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vitepress';
import sidebar from './sidebar';
const title = 'Lucide';
const socialTitle = 'Lucide Icons';
const description = 'Beautiful & consistent icon toolkit made by the community.';
// https://vitepress.dev/reference/site-config
export default defineConfig({
title,
description,
cleanUrls: true,
outDir: '.vercel/output/static',
srcExclude: ['**/README.md'],
vite: {
resolve: {
alias: [
{
find: /^.*\/VPIconAlignLeft\.vue$/,
replacement: fileURLToPath(
new URL('./theme/components/overrides/VPIconAlignLeft.vue', import.meta.url),
),
},
{
find: /^.*\/VPFooter\.vue$/,
replacement: fileURLToPath(
new URL('./theme/components/overrides/VPFooter.vue', import.meta.url),
),
},
{
find: '~/.vitepress',
replacement: fileURLToPath(new URL('./', import.meta.url)),
},
],
},
},
head: [
[
'script',
{
src: 'https://analytics.lucide.dev/js/script.js',
'data-domain': 'lucide.dev',
defer: '',
},
],
[
'meta',
{
property: 'og:locale',
content: 'en_US',
},
],
[
'meta',
{
property: 'og:type',
content: 'website',
},
],
[
'meta',
{
property: 'og:site_name',
content: title,
},
],
[
'meta',
{
property: 'og:title',
content: socialTitle,
},
],
[
'meta',
{
property: 'og:description',
content: description,
},
],
[
'meta',
{
property: 'og:url',
content: 'https://lucide.dev',
},
],
[
'meta',
{
property: 'og:image',
content: 'https://lucide.dev/og.png',
},
],
[
'meta',
{
property: 'og:image:width',
content: '1200',
},
],
[
'meta',
{
property: 'og:image:height',
content: '630',
},
],
[
'meta',
{
property: 'og:image:type',
content: 'image/png',
},
],
[
'meta',
{
property: 'twitter:card',
content: 'summary_large_image',
},
],
[
'meta',
{
property: 'twitter:title',
content: socialTitle,
},
],
[
'meta',
{
property: 'twitter:description',
content: description,
},
],
[
'meta',
{
property: 'twitter:image',
content: 'https://lucide.dev/og.png',
},
],
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: {
light: '/logo.light.svg',
dark: '/logo.dark.svg',
},
nav: [
{ text: 'Icons', link: '/icons/' },
{ text: 'Guide', link: '/guide/' },
{ text: 'Packages', link: '/packages' },
{ text: 'Showcase', link: '/showcase' },
{ text: 'License', link: '/license' },
],
sidebar,
socialLinks: [
{ icon: 'github', link: 'https://github.com/lucide-icons/lucide' },
{ icon: 'discord', link: 'https://discord.gg/EH6nSts' },
],
footer: {
message: 'Released under the ISC License.',
copyright: `Copyright ${new Date().getFullYear()} Lucide Contributors`,
},
editLink: {
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path',
},
carbonAds: {
code: 'CWYIC53U',
placement: 'lucidedev',
},
},
sitemap: {
hostname: 'https://lucide.dev/',
},
});
| lucide-icons/lucide/docs/.vitepress/config.ts | {
"file_path": "lucide-icons/lucide/docs/.vitepress/config.ts",
"repo_id": "lucide-icons/lucide",
"token_count": 1904
} | 29 |
export type CodeExampleType = {
title: string;
language: string;
code: string;
}[];
| lucide-icons/lucide/docs/.vitepress/lib/codeExamples/types.ts | {
"file_path": "lucide-icons/lucide/docs/.vitepress/lib/codeExamples/types.ts",
"repo_id": "lucide-icons/lucide",
"token_count": 30
} | 30 |
import { computed } from 'vue';
import { useExternalLibs } from '~/.vitepress/theme/composables/useExternalLibs';
import { IconEntity } from '../types';
const useIconsWithExternalLibs = (initialIcons?: IconEntity[]) => {
const { externalIconNodes } = useExternalLibs();
return computed(() => {
let icons = [];
if (initialIcons) {
icons = icons.concat(initialIcons);
}
const externalIconNodesArray = Object.values(externalIconNodes.value);
if (externalIconNodesArray?.length) {
externalIconNodesArray.forEach((iconNodes) => {
if (iconNodes?.length) {
icons = icons.concat(iconNodes);
}
});
}
return icons;
});
};
export default useIconsWithExternalLibs;
| lucide-icons/lucide/docs/.vitepress/theme/composables/useIconsWithExternalLibs.ts | {
"file_path": "lucide-icons/lucide/docs/.vitepress/theme/composables/useIconsWithExternalLibs.ts",
"repo_id": "lucide-icons/lucide",
"token_count": 278
} | 31 |
import { ThumbsUp } from "lucide-react";
function LikeButton() {
return (
<button style={{ color: "#fff" }}>
<ThumbsUp />
Like
</button>
);
}
export default LikeButton; | lucide-icons/lucide/docs/guide/basics/examples/button-example/Button.jsx | {
"file_path": "lucide-icons/lucide/docs/guide/basics/examples/button-example/Button.jsx",
"repo_id": "lucide-icons/lucide",
"token_count": 78
} | 32 |
body {
font-family: sans-serif;
-webkit-font-smoothing: auto;
-moz-font-smoothing: auto;
-moz-osx-font-smoothing: grayscale;
font-smoothing: auto;
text-rendering: optimizeLegibility;
font-smooth: always;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
background: #202127;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
color: #fff;
}
html,
body {
height: 100%;
min-height: 100%;
}
button {
display: flex;
align-items: center;
font-size: 18px;
padding: 10px 20px;
line-height: 24px;
gap: 8px;
border-radius: 24px;
outline: none;
border: none;
background: #111;
transition: all 0.3s ease;
}
button:hover {
background: #F56565;
}
.app {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 32px;
}
| lucide-icons/lucide/docs/guide/basics/examples/styles.css | {
"file_path": "lucide-icons/lucide/docs/guide/basics/examples/styles.css",
"repo_id": "lucide-icons/lucide",
"token_count": 344
} | 33 |
import fs from 'fs';
import path from 'path';
import { readSvgDirectory } from '@lucide/helpers';
const currentDir = process.cwd();
const ICONS_DIR = path.resolve(currentDir, '../icons');
const svgFiles = readSvgDirectory(ICONS_DIR, '.json');
const location = path.resolve(currentDir, '.vitepress/data', 'relatedIcons.json');
if (fs.existsSync(location)) {
fs.unlinkSync(location);
}
const nameWeight = 5;
const tagWeight = 4;
const categoryWeight = 3;
const MAX_RELATED_ICONS = 4 * 17; // grid of 4x17 icons, = 68 icons
const arrayMatches = (a, b) => {
return a.filter((item) => b.includes(item)).length;
};
const nameParts = (icon) =>
[
icon.name,
...(icon.aliases?.map((alias) => (typeof alias === 'string' ? alias : alias.name)) ?? []),
]
.join('-')
.split('-')
.filter((word) => word.length > 2);
const getRelatedIcons = (currentIcon, icons) => {
const iconSimilarity = (item) =>
nameWeight * arrayMatches(nameParts(item), nameParts(currentIcon)) +
categoryWeight * arrayMatches(item.categories ?? [], currentIcon.categories ?? []) +
tagWeight * arrayMatches(item.tags ?? [], currentIcon.tags ?? []);
return icons
.filter((i) => i.name !== currentIcon.name)
.map((icon) => ({ icon, similarity: iconSimilarity(icon) }))
.filter((a) => a.similarity > 0) // @todo: maybe require a minimal non-zero similarity
.sort((a, b) => b.similarity - a.similarity)
.map((i) => i.icon)
.slice(0, MAX_RELATED_ICONS);
};
const iconsMetaDataPromises = svgFiles.map(async (iconName) => {
const metaData = JSON.parse(fs.readFileSync(`../icons/${iconName}`));
const name = iconName.replace('.json', '');
return {
name,
...metaData.default,
};
});
const iconsMetaData = await Promise.all(iconsMetaDataPromises);
const relatedIcons = iconsMetaData.map((icon) => {
const iconRelatedIcons = getRelatedIcons(icon, iconsMetaData);
return [icon.name, iconRelatedIcons.map((i) => i.name)];
});
fs.promises
.writeFile(location, JSON.stringify(Object.fromEntries(relatedIcons), null, 2), 'utf-8')
.then(() => {
console.log('Successfully written relatedIcons.json file');
})
.catch((error) => {
throw new Error(`Something went wrong generating iconNode files,\n ${error}`);
});
| lucide-icons/lucide/docs/scripts/writeIconRelatedIcons.mjs | {
"file_path": "lucide-icons/lucide/docs/scripts/writeIconRelatedIcons.mjs",
"repo_id": "lucide-icons/lucide",
"token_count": 812
} | 34 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M11 21c0-2.5 2-2.5 2-5" />
<path d="M16 21c0-2.5 2-2.5 2-5" />
<path d="m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8" />
<path d="M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z" />
<path d="M6 21c0-2.5 2-2.5 2-5" />
</svg>
| lucide-icons/lucide/icons/alarm-smoke.svg | {
"file_path": "lucide-icons/lucide/icons/alarm-smoke.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 270
} | 35 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 22V8" />
<path d="M5 12H2a10 10 0 0 0 20 0h-3" />
<circle cx="12" cy="5" r="3" />
</svg>
| lucide-icons/lucide/icons/anchor.svg | {
"file_path": "lucide-icons/lucide/icons/anchor.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 145
} | 36 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z" />
<path d="M10 2c1 .5 2 2 2 5" />
</svg>
| lucide-icons/lucide/icons/apple.svg | {
"file_path": "lucide-icons/lucide/icons/apple.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 228
} | 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="M9 12h.01" />
<path d="M15 12h.01" />
<path d="M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5" />
<path d="M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1" />
</svg>
| lucide-icons/lucide/icons/baby.svg | {
"file_path": "lucide-icons/lucide/icons/baby.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 256
} | 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="M13 13v5" />
<path d="M17 11.47V8" />
<path d="M17 11h1a3 3 0 0 1 2.745 4.211" />
<path d="m2 2 20 20" />
<path d="M5 8v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-3" />
<path d="M7.536 7.535C6.766 7.649 6.154 8 5.5 8a2.5 2.5 0 0 1-1.768-4.268" />
<path d="M8.727 3.204C9.306 2.767 9.885 2 11 2c1.56 0 2 1.5 3 1.5s1.72-.5 2.5-.5a1 1 0 1 1 0 5c-.78 0-1.5-.5-2.5-.5a3.149 3.149 0 0 0-.842.12" />
<path d="M9 14.6V18" />
</svg>
| lucide-icons/lucide/icons/beer-off.svg | {
"file_path": "lucide-icons/lucide/icons/beer-off.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 347
} | 39 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10 10h4" />
<path d="M19 7V4a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v3" />
<path d="M20 21a2 2 0 0 0 2-2v-3.851c0-1.39-2-2.962-2-4.829V8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v11a2 2 0 0 0 2 2z" />
<path d="M 22 16 L 2 16" />
<path d="M4 21a2 2 0 0 1-2-2v-3.851c0-1.39 2-2.962 2-4.829V8a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2z" />
<path d="M9 7V4a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v3" />
</svg>
| lucide-icons/lucide/icons/binoculars.svg | {
"file_path": "lucide-icons/lucide/icons/binoculars.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 350
} | 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="m19 3 1 1" />
<path d="m20 2-4.5 4.5" />
<path d="M20 8v13a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20" />
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H14" />
<circle cx="14" cy="8" r="2" />
</svg>
| lucide-icons/lucide/icons/book-key.svg | {
"file_path": "lucide-icons/lucide/icons/book-key.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 208
} | 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="M12 12h.01" />
<path d="M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2" />
<path d="M22 13a18.15 18.15 0 0 1-20 0" />
<rect width="20" height="14" x="2" y="6" rx="2" />
</svg>
| lucide-icons/lucide/icons/briefcase-business.svg | {
"file_path": "lucide-icons/lucide/icons/briefcase-business.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 192
} | 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="m8 2 1.88 1.88" />
<path d="M14.12 3.88 16 2" />
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" />
<path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6" />
<path d="M12 20v-9" />
<path d="M6.53 9C4.6 8.8 3 7.1 3 5" />
<path d="M6 13H2" />
<path d="M3 21c0-2.1 1.7-3.9 3.8-4" />
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4" />
<path d="M22 13h-4" />
<path d="M17.2 17c2.1.1 3.8 1.9 3.8 4" />
</svg>
| lucide-icons/lucide/icons/bug.svg | {
"file_path": "lucide-icons/lucide/icons/bug.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 374
} | 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="m8.5 8.5-1 1a4.95 4.95 0 0 0 7 7l1-1" />
<path d="M11.843 6.187A4.947 4.947 0 0 1 16.5 7.5a4.947 4.947 0 0 1 1.313 4.657" />
<path d="M14 16.5V14" />
<path d="M14 6.5v1.843" />
<path d="M10 10v7.5" />
<path d="m16 7 1-5 1.367.683A3 3 0 0 0 19.708 3H21v1.292a3 3 0 0 0 .317 1.341L22 7l-5 1" />
<path d="m8 17-1 5-1.367-.683A3 3 0 0 0 4.292 21H3v-1.292a3 3 0 0 0-.317-1.341L2 17l5-1" />
<line x1="2" x2="22" y1="2" y2="22" />
</svg>
| lucide-icons/lucide/icons/candy-off.svg | {
"file_path": "lucide-icons/lucide/icons/candy-off.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 359
} | 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"
>
<path d="M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z" />
<path d="M8 14v.5" />
<path d="M16 14v.5" />
<path d="M11.25 16.25h1.5L12 17l-.75-.75Z" />
</svg>
| lucide-icons/lucide/icons/cat.svg | {
"file_path": "lucide-icons/lucide/icons/cat.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 295
} | 45 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M9 5v4" />
<rect width="4" height="6" x="7" y="9" rx="1" />
<path d="M9 15v2" />
<path d="M17 3v2" />
<rect width="4" height="8" x="15" y="5" rx="1" />
<path d="M17 13v3" />
<path d="M3 3v16a2 2 0 0 0 2 2h16" />
</svg>
| lucide-icons/lucide/icons/chart-candlestick.svg | {
"file_path": "lucide-icons/lucide/icons/chart-candlestick.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 218
} | 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"
>
<circle cx="12" cy="17" r="3" />
<path d="M4.2 15.1A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2" />
<path d="m15.7 18.4-.9-.3" />
<path d="m9.2 15.9-.9-.3" />
<path d="m10.6 20.7.3-.9" />
<path d="m13.1 14.2.3-.9" />
<path d="m13.6 20.7-.4-1" />
<path d="m10.8 14.3-.4-1" />
<path d="m8.3 18.6 1-.4" />
<path d="m14.7 15.8 1-.4" />
</svg>
| lucide-icons/lucide/icons/cloud-cog.svg | {
"file_path": "lucide-icons/lucide/icons/cloud-cog.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 303
} | 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"
>
<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.svg | {
"file_path": "lucide-icons/lucide/icons/copy.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 174
} | 48 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M11 2a2 2 0 0 0-2 2v5H4a2 2 0 0 0-2 2v2c0 1.1.9 2 2 2h5v5c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2v-5h5a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2h-5V4a2 2 0 0 0-2-2h-2z" />
</svg>
| lucide-icons/lucide/icons/cross.svg | {
"file_path": "lucide-icons/lucide/icons/cross.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 207
} | 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"
>
<ellipse cx="12" cy="5" rx="9" ry="3" />
<path d="M3 12a9 3 0 0 0 5 2.69" />
<path d="M21 9.3V5" />
<path d="M3 5v14a9 3 0 0 0 6.47 2.88" />
<path d="M12 12v4h4" />
<path d="M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16" />
</svg>
| lucide-icons/lucide/icons/database-backup.svg | {
"file_path": "lucide-icons/lucide/icons/database-backup.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 251
} | 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"
>
<rect width="12" height="12" x="2" y="10" rx="2" ry="2" />
<path d="m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6" />
<path d="M6 18h.01" />
<path d="M10 14h.01" />
<path d="M15 6h.01" />
<path d="M18 9h.01" />
</svg>
| lucide-icons/lucide/icons/dices.svg | {
"file_path": "lucide-icons/lucide/icons/dices.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 234
} | 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="m10 16 1.5 1.5" />
<path d="m14 8-1.5-1.5" />
<path d="M15 2c-1.798 1.998-2.518 3.995-2.807 5.993" />
<path d="m16.5 10.5 1 1" />
<path d="m17 6-2.891-2.891" />
<path d="M2 15c6.667-6 13.333 0 20-6" />
<path d="m20 9 .891.891" />
<path d="M3.109 14.109 4 15" />
<path d="m6.5 12.5 1 1" />
<path d="m7 18 2.891 2.891" />
<path d="M9 22c1.798-1.998 2.518-3.995 2.807-5.993" />
</svg>
| lucide-icons/lucide/icons/dna.svg | {
"file_path": "lucide-icons/lucide/icons/dna.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 325
} | 52 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6.399 6.399C5.362 8.157 4.65 10.189 4.5 12c-.37 4.43 1.27 9.95 7.5 10 3.256-.026 5.259-1.547 6.375-3.625" />
<path d="M19.532 13.875A14.07 14.07 0 0 0 19.5 12c-.36-4.34-3.95-9.96-7.5-10-1.04.012-2.082.502-3.046 1.297" />
<line x1="2" x2="22" y1="2" y2="22" />
</svg>
| lucide-icons/lucide/icons/egg-off.svg | {
"file_path": "lucide-icons/lucide/icons/egg-off.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 255
} | 53 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M21 7h-3a2 2 0 0 1-2-2V2" />
<path d="M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z" />
<path d="M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15" />
<path d="M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11" />
</svg>
| lucide-icons/lucide/icons/file-stack.svg | {
"file_path": "lucide-icons/lucide/icons/file-stack.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 274
} | 54 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z" />
<path d="M18 12v.5" />
<path d="M16 17.93a9.77 9.77 0 0 1 0-11.86" />
<path d="M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33" />
<path d="M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4" />
<path d="m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98" />
</svg>
| lucide-icons/lucide/icons/fish.svg | {
"file_path": "lucide-icons/lucide/icons/fish.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 379
} | 55 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M18 6c0 2-2 2-2 4v10a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V10c0-2-2-2-2-4V2h12z" />
<line x1="6" x2="18" y1="6" y2="6" />
<line x1="12" x2="12" y1="12" y2="12" />
</svg>
| lucide-icons/lucide/icons/flashlight.svg | {
"file_path": "lucide-icons/lucide/icons/flashlight.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 204
} | 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 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1" />
<circle cx="12" cy="8" r="2" />
<path d="M12 10v12" />
<path d="M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z" />
<path d="M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z" />
</svg>
| lucide-icons/lucide/icons/flower-2.svg | {
"file_path": "lucide-icons/lucide/icons/flower-2.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 278
} | 57 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="m22 13.29-3.33-10a.42.42 0 0 0-.14-.18.38.38 0 0 0-.22-.11.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18l-2.26 6.67H8.32L6.1 3.26a.42.42 0 0 0-.1-.18.38.38 0 0 0-.26-.08.39.39 0 0 0-.23.07.42.42 0 0 0-.14.18L2 13.29a.74.74 0 0 0 .27.83L12 21l9.69-6.88a.71.71 0 0 0 .31-.83Z" />
</svg>
| lucide-icons/lucide/icons/gitlab.svg | {
"file_path": "lucide-icons/lucide/icons/gitlab.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 260
} | 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="M4 12h8" />
<path d="M4 18V6" />
<path d="M12 18V6" />
<circle cx="19" cy="16" r="2" />
<path d="M20 10c-2 2-3 3.5-3 6" />
</svg>
| lucide-icons/lucide/icons/heading-6.svg | {
"file_path": "lucide-icons/lucide/icons/heading-6.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 170
} | 59 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M16 10h2" />
<path d="M16 14h2" />
<path d="M6.17 15a3 3 0 0 1 5.66 0" />
<circle cx="9" cy="11" r="2" />
<rect x="2" y="5" width="20" height="14" rx="2" />
</svg>
| lucide-icons/lucide/icons/id-card.svg | {
"file_path": "lucide-icons/lucide/icons/id-card.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 183
} | 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="M18 22H4a2 2 0 0 1-2-2V6" />
<path d="m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18" />
<circle cx="12" cy="8" r="2" />
<rect width="16" height="16" x="6" y="2" rx="2" />
</svg>
| lucide-icons/lucide/icons/images.svg | {
"file_path": "lucide-icons/lucide/icons/images.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 196
} | 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="M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16" />
</svg>
| lucide-icons/lucide/icons/laptop.svg | {
"file_path": "lucide-icons/lucide/icons/laptop.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 171
} | 62 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M15 12h6" />
<path d="M15 6h6" />
<path d="m3 13 3.553-7.724a.5.5 0 0 1 .894 0L11 13" />
<path d="M3 18h18" />
<path d="M4 11h6" />
</svg>
| lucide-icons/lucide/icons/letter-text.svg | {
"file_path": "lucide-icons/lucide/icons/letter-text.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 177
} | 63 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M9 17H7A5 5 0 0 1 7 7h2" />
<path d="M15 7h2a5 5 0 1 1 0 10h-2" />
<line x1="8" x2="16" y1="12" y2="12" />
</svg>
| lucide-icons/lucide/icons/link-2.svg | {
"file_path": "lucide-icons/lucide/icons/link-2.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 163
} | 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"
>
<circle cx="11" cy="11" r="8" />
<path d="m21 21-4.3-4.3" />
<path d="M11 11a2 2 0 0 0 4 0 4 4 0 0 0-8 0 6 6 0 0 0 12 0" />
</svg>
| lucide-icons/lucide/icons/lollipop.svg | {
"file_path": "lucide-icons/lucide/icons/lollipop.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 161
} | 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"
>
<line x1="9" x2="9" y1="4" y2="20" />
<path d="M4 7c0-1.7 1.3-3 3-3h13" />
<path d="M18 20c-1.7 0-3-1.3-3-3V4" />
</svg>
| lucide-icons/lucide/icons/pi.svg | {
"file_path": "lucide-icons/lucide/icons/pi.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 172
} | 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="M2 22h20" />
<path d="M6.36 17.4 4 17l-2-4 1.1-.55a2 2 0 0 1 1.8 0l.17.1a2 2 0 0 0 1.8 0L8 12 5 6l.9-.45a2 2 0 0 1 2.09.2l4.02 3a2 2 0 0 0 2.1.2l4.19-2.06a2.41 2.41 0 0 1 1.73-.17L21 7a1.4 1.4 0 0 1 .87 1.99l-.38.76c-.23.46-.6.84-1.07 1.08L7.58 17.2a2 2 0 0 1-1.22.18Z" />
</svg>
| lucide-icons/lucide/icons/plane-takeoff.svg | {
"file_path": "lucide-icons/lucide/icons/plane-takeoff.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 275
} | 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"
>
<rect width="5" height="5" x="3" y="3" rx="1" />
<rect width="5" height="5" x="16" y="3" rx="1" />
<rect width="5" height="5" x="3" y="16" rx="1" />
<path d="M21 16h-3a2 2 0 0 0-2 2v3" />
<path d="M21 21v.01" />
<path d="M12 7v3a2 2 0 0 1-2 2H7" />
<path d="M3 12h.01" />
<path d="M12 3h.01" />
<path d="M12 16v.01" />
<path d="M16 12h1" />
<path d="M21 12v.01" />
<path d="M12 21v-1" />
</svg>
| lucide-icons/lucide/icons/qr-code.svg | {
"file_path": "lucide-icons/lucide/icons/qr-code.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 315
} | 68 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M4.9 19.1C1 15.2 1 8.8 4.9 4.9" />
<path d="M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5" />
<circle cx="12" cy="12" r="2" />
<path d="M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5" />
<path d="M19.1 4.9C23 8.8 23 15.1 19.1 19" />
</svg>
| lucide-icons/lucide/icons/radio.svg | {
"file_path": "lucide-icons/lucide/icons/radio.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 235
} | 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="M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47" />
<path d="M8 16H3v5" />
<path d="M3 12C3 9.51 4 7.26 5.64 5.64" />
<path d="m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64" />
<path d="M21 12c0 1-.16 1.97-.47 2.87" />
<path d="M21 3v5h-5" />
<path d="M22 22 2 2" />
</svg>
| lucide-icons/lucide/icons/refresh-cw-off.svg | {
"file_path": "lucide-icons/lucide/icons/refresh-cw-off.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 276
} | 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="M6 19V5" />
<path d="M10 19V6.8" />
<path d="M14 19v-7.8" />
<path d="M18 5v4" />
<path d="M18 19v-6" />
<path d="M22 19V9" />
<path d="M2 19V9a4 4 0 0 1 4-4c2 0 4 1.33 6 4s4 4 6 4a4 4 0 1 0-3-6.65" />
</svg>
| lucide-icons/lucide/icons/roller-coaster.svg | {
"file_path": "lucide-icons/lucide/icons/roller-coaster.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 223
} | 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="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z" />
<path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z" />
<path d="M7 21h10" />
<path d="M12 3v18" />
<path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2" />
</svg>
| lucide-icons/lucide/icons/scale.svg | {
"file_path": "lucide-icons/lucide/icons/scale.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 229
} | 72 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M2 22v-5l5-5 5 5-5 5z" />
<path d="M9.5 14.5 16 8" />
<path d="m17 2 5 5-.5.5a3.53 3.53 0 0 1-5 0s0 0 0 0a3.53 3.53 0 0 1 0-5L17 2" />
</svg>
| lucide-icons/lucide/icons/shovel.svg | {
"file_path": "lucide-icons/lucide/icons/shovel.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 183
} | 73 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1" />
</svg>
| lucide-icons/lucide/icons/space.svg | {
"file_path": "lucide-icons/lucide/icons/space.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 131
} | 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="M2 12h10" />
<path d="M9 4v16" />
<path d="m3 9 3 3-3 3" />
<path d="M12 6 9 9 6 6" />
<path d="m6 18 3-3 1.5 1.5" />
<path d="M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z" />
</svg>
| lucide-icons/lucide/icons/thermometer-snowflake.svg | {
"file_path": "lucide-icons/lucide/icons/thermometer-snowflake.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 203
} | 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"
>
<rect width="18" height="12" x="3" y="8" rx="1" />
<path d="M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3" />
<path d="M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3" />
</svg>
| lucide-icons/lucide/icons/toy-brick.svg | {
"file_path": "lucide-icons/lucide/icons/toy-brick.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 194
} | 76 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M6 4v6a6 6 0 0 0 12 0V4" />
<line x1="4" x2="20" y1="20" y2="20" />
</svg>
| lucide-icons/lucide/icons/underline.svg | {
"file_path": "lucide-icons/lucide/icons/underline.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 139
} | 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="M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2" />
<path d="M7 2v20" />
<path d="M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7" />
</svg>
| lucide-icons/lucide/icons/utensils.svg | {
"file_path": "lucide-icons/lucide/icons/utensils.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 182
} | 78 |
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196" />
<path d="M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2" />
<path d="m2 2 20 20" />
</svg>
| lucide-icons/lucide/icons/video-off.svg | {
"file_path": "lucide-icons/lucide/icons/video-off.svg",
"repo_id": "lucide-icons/lucide",
"token_count": 201
} | 79 |
import * as icons from './icons/lucide-icons';
export * from './lib/lucide-angular.component';
export * from './lib/lucide-angular.module';
export * from './lib/lucide-icon.config';
export * from './lib/lucide-icon.provider';
export * from './icons/lucide-icons';
export * from './aliases';
export { icons };
| lucide-icons/lucide/packages/lucide-angular/src/public-api.ts | {
"file_path": "lucide-icons/lucide/packages/lucide-angular/src/public-api.ts",
"repo_id": "lucide-icons/lucide",
"token_count": 110
} | 80 |
import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/preact';
import { airVent } from './testIconNodes';
import { Icon } from '../src/lucide-preact';
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-preact/tests/Icon.spec.tsx | {
"file_path": "lucide-icons/lucide/packages/lucide-preact/tests/Icon.spec.tsx",
"repo_id": "lucide-icons/lucide",
"token_count": 315
} | 81 |
import { createElement, forwardRef, type FunctionComponent } from 'react';
import * as NativeSvg from 'react-native-svg';
import defaultAttributes, { childDefaultAttributes } from './defaultAttributes';
import { IconNode, LucideProps } from './types';
interface IconComponentProps extends LucideProps {
iconNode: IconNode;
}
/**
* Lucide icon component
*
* @component Icon
* @param {object} props
* @param {string} props.color - The color of the icon
* @param {number} props.size - The size of the icon
* @param {number} props.strokeWidth - The stroke width of the icon
* @param {boolean} props.absoluteStrokeWidth - Whether to use absolute stroke width
* @param {string} props.className - The class name of the icon
* @param {IconNode} props.children - The children of the icon
* @param {IconNode} props.iconNode - The icon node of the icon
*
* @returns {ForwardRefExoticComponent} LucideIcon
*/
const Icon = forwardRef<SVGSVGElement, IconComponentProps>(
(
{
color = 'currentColor',
size = 24,
strokeWidth = 2,
absoluteStrokeWidth,
children,
iconNode,
...rest
},
ref,
) => {
const customAttrs = {
stroke: color,
strokeWidth: absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth,
...rest,
};
return createElement(
NativeSvg.Svg as unknown as string,
{
ref,
...defaultAttributes,
width: size,
height: size,
...customAttrs,
},
[
...iconNode.map(([tag, attrs]) => {
const upperCasedTag = (tag.charAt(0).toUpperCase() +
tag.slice(1)) as keyof typeof NativeSvg;
// duplicating the attributes here because generating the OTA update bundles don't inherit the SVG properties from parent (codepush, expo-updates)
return createElement(
NativeSvg[upperCasedTag] as FunctionComponent<LucideProps>,
{ ...childDefaultAttributes, ...customAttrs, ...attrs } as LucideProps,
);
}),
...((Array.isArray(children) ? children : [children]) || []),
],
);
},
);
export default Icon;
| lucide-icons/lucide/packages/lucide-react-native/src/Icon.ts | {
"file_path": "lucide-icons/lucide/packages/lucide-react-native/src/Icon.ts",
"repo_id": "lucide-icons/lucide",
"token_count": 810
} | 82 |
import plugins from '@lucide/rollup-plugins';
import pkg from './package.json' assert { type: 'json' };
import dts from 'rollup-plugin-dts';
import getAliasesEntryNames from './scripts/getAliasesEntryNames.mjs';
const aliasesEntries = await getAliasesEntryNames();
const packageName = 'LucideReact';
const outputFileName = 'lucide-react';
const outputDir = `dist`;
const inputs = [`src/lucide-react.ts`];
const bundles = [
{
format: 'umd',
inputs,
outputDir,
minify: true,
},
{
format: 'umd',
inputs,
outputDir,
},
{
format: 'cjs',
inputs,
outputDir,
},
{
format: 'esm',
inputs: [...inputs, ...aliasesEntries],
outputDir,
preserveModules: true,
},
{
format: 'esm',
inputs: ['src/dynamicIconImports.ts'],
outputFile: 'dynamicIconImports.js',
external: [/src/],
paths: (id) => {
if (id.match(/src/)) {
const [, modulePath] = id.match(/src\/(.*)\.ts/);
return `dist/esm/${modulePath}.js`;
}
},
},
];
const configs = bundles
.map(
({
inputs,
outputDir,
outputFile,
format,
minify,
preserveModules,
entryFileNames,
external = [],
paths,
}) =>
inputs.map((input) => ({
input,
plugins: plugins({ pkg, minify }),
external: ['react', 'prop-types', ...external],
output: {
name: packageName,
...(preserveModules
? {
dir: `${outputDir}/${format}`,
}
: {
file:
outputFile ??
`${outputDir}/${format}/${outputFileName}${minify ? '.min' : ''}.js`,
}),
paths,
entryFileNames,
format,
sourcemap: true,
preserveModules,
preserveModulesRoot: 'src',
globals: {
react: 'react',
'prop-types': 'PropTypes',
},
},
})),
)
.flat();
export default [
{
input: 'src/dynamicIconImports.ts',
output: [
{
file: `dynamicIconImports.d.ts`,
format: 'es',
},
],
plugins: [dts()],
},
{
input: inputs[0],
output: [
{
file: `dist/${outputFileName}.d.ts`,
format: 'es',
},
],
plugins: [dts()],
},
...configs,
];
| lucide-icons/lucide/packages/lucide-react/rollup.config.mjs | {
"file_path": "lucide-icons/lucide/packages/lucide-react/rollup.config.mjs",
"repo_id": "lucide-icons/lucide",
"token_count": 1184
} | 83 |
import { describe, it, expect } from 'vitest';
import { render, cleanup } from '@testing-library/react';
import { Pen, Edit2, Grid, Droplet } from '../src/lucide-react';
import defaultAttributes from '../src/defaultAttributes';
describe('Using lucide icon components', () => {
it('should render an component', () => {
const { container } = render(<Grid />);
expect(container.innerHTML).toMatchSnapshot();
});
it('should render the icon with default attributes', () => {
const { container } = render(<Grid />);
const SVGElement = container.firstElementChild;
expect(SVGElement).toHaveAttribute('xmlns', defaultAttributes.xmlns);
expect(SVGElement).toHaveAttribute('width', String(defaultAttributes.width));
expect(SVGElement).toHaveAttribute('height', String(defaultAttributes.height));
expect(SVGElement).toHaveAttribute('viewBox', defaultAttributes.viewBox);
expect(SVGElement).toHaveAttribute('fill', defaultAttributes.fill);
expect(SVGElement).toHaveAttribute('stroke', defaultAttributes.stroke);
expect(SVGElement).toHaveAttribute('stroke-width', String(defaultAttributes.strokeWidth));
expect(SVGElement).toHaveAttribute('stroke-linecap', defaultAttributes.strokeLinecap);
expect(SVGElement).toHaveAttribute('stroke-linejoin', defaultAttributes.strokeLinejoin);
});
it('should adjust the size, stroke color and stroke width', () => {
const { container } = render(
<Grid
size={48}
stroke="red"
strokeWidth={4}
/>,
);
const SVGElement = container.firstElementChild;
expect(SVGElement).toHaveAttribute('stroke', 'red');
expect(SVGElement).toHaveAttribute('width', '48');
expect(SVGElement).toHaveAttribute('height', '48');
expect(SVGElement).toHaveAttribute('stroke-width', '4');
expect(container.innerHTML).toMatchSnapshot();
});
it('should render the alias icon', () => {
const { container } = render(
<Pen
size={48}
stroke="red"
strokeWidth={4}
/>,
);
const PenIconRenderedHTML = container.innerHTML;
cleanup();
const { container: Edit2Container } = render(
<Edit2
size={48}
stroke="red"
strokeWidth={4}
/>,
);
expect(PenIconRenderedHTML).toBe(Edit2Container.innerHTML);
});
it('should not scale the strokeWidth when absoluteStrokeWidth is set', () => {
const { container, getByTestId } = render(
<Grid
size={48}
stroke="red"
absoluteStrokeWidth
/>,
);
const SVGElement = container.firstElementChild;
expect(SVGElement).toHaveAttribute('stroke', 'red');
expect(SVGElement).toHaveAttribute('width', '48');
expect(SVGElement).toHaveAttribute('height', '48');
expect(SVGElement).toHaveAttribute('stroke-width', '1');
expect(container.innerHTML).toMatchSnapshot();
});
it('should apply all classNames to the element', () => {
const testClass = 'my-class';
const { container } = render(<Droplet className={testClass} />);
expect(container.firstChild).toHaveClass(testClass);
expect(container.firstChild).toHaveClass('lucide');
expect(container.firstChild).toHaveClass('lucide-droplet');
});
});
| lucide-icons/lucide/packages/lucide-react/tests/lucide-react.spec.tsx | {
"file_path": "lucide-icons/lucide/packages/lucide-react/tests/lucide-react.spec.tsx",
"repo_id": "lucide-icons/lucide",
"token_count": 1129
} | 84 |
/* eslint-disable import/no-extraneous-dependencies */
import { basename } from 'path';
import { readSvg } from '@lucide/helpers';
/**
* Build an object in the format: `{ <name>: <contents> }`.
* @param {string[]} svgFiles - A list of filenames.
* @param {Function} getSvg - A function that returns the contents of an SVG file given a filename.
* @returns {Object}
*/
export default function readSVGs(svgFiles, iconsDirectory) {
return svgFiles.map((svgFile) => {
const name = basename(svgFile, '.svg');
const contents = readSvg(svgFile, iconsDirectory);
return { name, contents };
});
}
| lucide-icons/lucide/packages/lucide-static/scripts/readSvgs.mjs | {
"file_path": "lucide-icons/lucide/packages/lucide-static/scripts/readSvgs.mjs",
"repo_id": "lucide-icons/lucide",
"token_count": 205
} | 85 |
<script lang="ts">
import Smile from '../src/icons/smile.svelte'
</script>
<Smile>
<text>Test</text>
</Smile>
| lucide-icons/lucide/packages/lucide-svelte/tests/TestSlots.svelte | {
"file_path": "lucide-icons/lucide/packages/lucide-svelte/tests/TestSlots.svelte",
"repo_id": "lucide-icons/lucide",
"token_count": 49
} | 86 |
/**
* Convert a type string from camelCase to PascalCase
*
* @example
* type Test = CamelToPascal<'fooBar'> // 'FooBar'
*/
export type CamelToPascal<T extends string> = T extends `${infer FirstChar}${infer Rest}`
? `${Capitalize<FirstChar>}${Rest}`
: never;
/**
* Creates a list of components from a list of component names and a component type
*/
export type ComponentList<ComponentNames, ComponentType> = {
[Prop in keyof ComponentNames as CamelToPascal<Prop & string>]: ComponentType;
};
| lucide-icons/lucide/packages/shared/src/utility-types.ts | {
"file_path": "lucide-icons/lucide/packages/shared/src/utility-types.ts",
"repo_id": "lucide-icons/lucide",
"token_count": 153
} | 87 |
import path from 'path';
import tags from '../tags.json' assert { type: 'json' };
import {
readSvgDirectory,
readAllMetadata,
writeFile,
mergeArrays,
getCurrentDirPath,
} 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 svgFiles = readSvgDirectory(ICONS_DIR);
const iconNames = svgFiles.map((icon) => icon.split('.')[0]);
iconNames.forEach((iconName) => {
icons[iconName] = icons[iconName] || {
$schema: '../icon.schema.json',
tags: [],
categories: [],
};
icons[iconName].tags = mergeArrays(icons[iconName].tags, tags[iconName]);
const iconContent = JSON.stringify(icons[iconName], null, 2);
writeFile(iconContent, `${iconName}.json`, path.resolve(currentDir, '../icons'));
});
| lucide-icons/lucide/scripts/migrateTagsToIcons.mjs | {
"file_path": "lucide-icons/lucide/scripts/migrateTagsToIcons.mjs",
"repo_id": "lucide-icons/lucide",
"token_count": 307
} | 88 |
/* eslint-disable import/prefer-default-export */
import path from 'path';
import { fileURLToPath } from 'url';
/**
* Get the current directory path.
*
* @param {string} currentPath
* @returns {string}
*/
export const getCurrentDirPath = (currentPath) => path.dirname(fileURLToPath(currentPath));
| lucide-icons/lucide/tools/build-helpers/src/getCurrentDirPath.mjs | {
"file_path": "lucide-icons/lucide/tools/build-helpers/src/getCurrentDirPath.mjs",
"repo_id": "lucide-icons/lucide",
"token_count": 93
} | 89 |
/* eslint-disable import/prefer-default-export */
import fs from 'fs';
import path from 'path';
import { writeFile } from './writeFile.mjs';
/**
* writes content to a file if it does not exist
*
* @param {string} content
* @param {string} fileName
* @param {string} outputDirectory
*/
export const writeFileIfNotExists = (content, fileName, outputDirectory) => {
if (!fs.existsSync(path.join(outputDirectory, fileName))) {
writeFile(content, fileName, outputDirectory);
}
};
| lucide-icons/lucide/tools/build-helpers/src/writeFileIfNotExists.mjs | {
"file_path": "lucide-icons/lucide/tools/build-helpers/src/writeFileIfNotExists.mjs",
"repo_id": "lucide-icons/lucide",
"token_count": 152
} | 90 |
import withSerwistInit from "@serwist/next";
const withSerwist = withSerwistInit({
// Note: This is only an example. If you use Pages Router,
// use something else that works, such as "service-worker/index.ts".
swSrc: "src/app/sw.ts",
swDest: "public/sw.js",
disable: process.env.NODE_ENV !== "production",
});
const nextConfig = {
redirects: async () => {
return [
{
source: "/dashboard",
destination: "/dashboard/projects",
permanent: false,
},
];
},
trailingSlash: true,
eslint: {
ignoreDuringBuilds: true,
},
};
export default withSerwist(nextConfig);
| moinulmoin/chadnext/next.config.mjs | {
"file_path": "moinulmoin/chadnext/next.config.mjs",
"repo_id": "moinulmoin/chadnext",
"token_count": 242
} | 91 |
export default function Default() {
return null;
}
| moinulmoin/chadnext/src/app/[locale]/@loginDialog/default.tsx | {
"file_path": "moinulmoin/chadnext/src/app/[locale]/@loginDialog/default.tsx",
"repo_id": "moinulmoin/chadnext",
"token_count": 14
} | 92 |
"use server";
import { revalidatePath } from "next/cache";
import { utapi } from "~/lib/uploadthing-server";
import { getImageKeyFromUrl, isOurCdnUrl } from "~/lib/utils";
import { type payload } from "~/types";
import prisma from "~/lib/prisma";
export const updateUser = async (id: string, payload: payload) => {
await prisma.user.update({
where: { id },
data: { ...payload },
});
revalidatePath("/dashboard/settings");
};
export async function removeUserOldImageFromCDN(
newImageUrl: string,
currentImageUrl: string
) {
try {
if (isOurCdnUrl(currentImageUrl)) {
const currentImageFileKey = getImageKeyFromUrl(currentImageUrl);
await utapi.deleteFiles(currentImageFileKey as string);
revalidatePath("/dashboard/settings");
}
} catch (e) {
console.error(e);
const newImageFileKey = getImageKeyFromUrl(newImageUrl);
await utapi.deleteFiles(newImageFileKey as string);
}
}
export async function removeNewImageFromCDN(image: string) {
const imageFileKey = getImageKeyFromUrl(image);
await utapi.deleteFiles(imageFileKey as string);
}
| moinulmoin/chadnext/src/app/[locale]/dashboard/settings/actions.ts | {
"file_path": "moinulmoin/chadnext/src/app/[locale]/dashboard/settings/actions.ts",
"repo_id": "moinulmoin/chadnext",
"token_count": 378
} | 93 |
import { headers } from "next/headers";
import { type NextRequest } from "next/server";
import { buffer } from "node:stream/consumers";
import type Stripe from "stripe";
import { stripe } from "~/lib/stripe";
import prisma from "~/lib/prisma";
export async function POST(req: NextRequest) {
//@ts-expect-error Argument of type 'ReadableStream<any>' is not assignable to parameter of type 'ReadableStream | Readable | AsyncIterable<any>'
const body = await buffer(req.body);
const signature = headers().get("Stripe-Signature") as string;
let event: Stripe.Event | undefined = undefined;
try {
event = stripe.webhooks.constructEvent(
body,
signature,
process.env.STRIPE_WEBHOOK_SECRET as string
);
} catch (error) {
if (error instanceof Error) {
return new Response(`Webhook Error: ${error.message}`, { status: 400 });
}
}
const session = event?.data.object as Stripe.Checkout.Session;
if (event?.type === "checkout.session.completed") {
// Retrieve the subscription details from Stripe.
const subscription = await stripe.subscriptions.retrieve(
session.subscription as string
);
// Update the user stripe into in our database.
// Since this is the initial subscription, we need to update
// the subscription id and customer id.
await prisma.user.update({
where: {
id: session?.metadata?.userId,
},
data: {
stripeSubscriptionId: subscription.id,
stripeCustomerId: subscription.customer as string,
stripePriceId: subscription.items.data[0].price.id,
stripeCurrentPeriodEnd: new Date(
subscription.current_period_end * 1000
),
},
});
}
if (event?.type === "invoice.payment_succeeded") {
// Retrieve the subscription details from Stripe.
const subscription = await stripe.subscriptions.retrieve(
session.subscription as string
);
// Update the price id and set the new period end.
await prisma.user.update({
where: {
stripeSubscriptionId: subscription.id,
},
data: {
stripePriceId: subscription.items.data[0].price.id,
stripeCurrentPeriodEnd: new Date(
subscription.current_period_end * 1000
),
},
});
}
return new Response(null, { status: 200 });
}
| moinulmoin/chadnext/src/app/api/webhooks/stripe/route.ts | {
"file_path": "moinulmoin/chadnext/src/app/api/webhooks/stripe/route.ts",
"repo_id": "moinulmoin/chadnext",
"token_count": 838
} | 94 |
"use client";
import { zodResolver } from "@hookform/resolvers/zod";
import Link from "next/link";
import { useState } from "react";
import { useForm } from "react-hook-form";
import { set, z } from "zod";
import { Button, buttonVariants } from "~/components/ui/button";
import { cn } from "~/lib/utils";
import Icons from "../shared/icons";
import { Input } from "../ui/input";
import { InputOTP, InputOTPGroup, InputOTPSlot } from "../ui/input-otp";
import { Label } from "../ui/label";
import { toast } from "../ui/use-toast";
import { useRouter } from "next/navigation";
const userAuthSchema = z.object({
email: z.string().email("Please enter a valid email address."),
});
type FormData = z.infer<typeof userAuthSchema>;
export default function AuthForm() {
const router = useRouter();
const [currentStep, setCurrentStep] = useState(1);
const [isLoading, setIsLoading] = useState(false);
const [isGithubLoading, setIsGithubLoading] = useState(false);
const [otp, setOTP] = useState("");
const {
register,
handleSubmit,
reset,
formState: { errors },
} = useForm<FormData>({
resolver: zodResolver(userAuthSchema),
});
async function onEmailSubmit(data: FormData) {
setIsLoading(true);
try {
const res = await fetch("/api/auth/login/send-otp", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
if (!res.ok) {
throw new Error("Failed to send OTP");
}
setCurrentStep(2);
toast({
title: "OTP sent!",
description: "Please check your mail inbox",
});
} catch (error) {
toast({
title: "Failed to send OTP",
description: "Please try again later",
variant: "destructive",
});
} finally {
setIsLoading(false);
}
}
async function onOTPSubmit(data: FormData) {
setIsLoading(true);
try {
const res = await fetch("/api/auth/login/verify-otp", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email: data.email, code: otp }),
});
if (!res.ok) {
throw new Error("Invalid OTP");
}
toast({
title: "Successfully verified!",
});
router.push("/dashboard");
} catch (error) {
toast({
title: "Invalid OTP",
description: "Please try again",
variant: "destructive",
});
} finally {
setIsLoading(false);
}
}
return (
<div className={cn("mt-4 flex flex-col gap-4")}>
{currentStep === 1 && (
<>
<form onSubmit={handleSubmit(onEmailSubmit)}>
<div className="flex flex-col gap-2.5">
<div>
<Label className="sr-only" htmlFor="email">
Email
</Label>
<Input
id="email"
placeholder="[email protected]"
type="email"
disabled={isLoading || isGithubLoading}
{...register("email")}
/>
{errors?.email && (
<p className="mt-2 text-xs text-destructive">
{errors?.email.message}
</p>
)}
</div>
<button
type="submit"
className={cn(buttonVariants())}
disabled={isLoading || isGithubLoading}
>
{isLoading && (
<Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
)}
Send OTP
</button>
</div>
</form>
<div className="relative flex justify-center text-xs uppercase">
<span className="bg-background px-2 text-muted-foreground">/</span>
</div>
{isGithubLoading ? (
<Button className="w-full cursor-not-allowed" variant="outline">
<Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
</Button>
) : (
<Link
href="/api/auth/login/github"
className={cn(buttonVariants({ variant: "outline" }))}
onClick={() => setIsGithubLoading(true)}
>
Continue with <Icons.gitHub className="ml-2 h-4 w-4" />
</Link>
)}
</>
)}
{currentStep === 2 && (
<form onSubmit={handleSubmit(onOTPSubmit)}>
<div className="flex flex-col gap-2.5">
<div>
<Label className="sr-only" htmlFor="otp">
OTP
</Label>
<div className="flex justify-center">
<InputOTP
id="otp"
autoFocus
disabled={isLoading}
value={otp}
onChange={setOTP}
maxLength={6}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
</div>
</div>
<Button type="submit" disabled={isLoading || otp.length !== 6}>
{isLoading && (
<Icons.spinner className="mr-2 h-4 w-4 animate-spin" />
)}
Verify OTP
</Button>
</div>
</form>
)}
</div>
);
}
| moinulmoin/chadnext/src/components/layout/auth-form.tsx | {
"file_path": "moinulmoin/chadnext/src/components/layout/auth-form.tsx",
"repo_id": "moinulmoin/chadnext",
"token_count": 2928
} | 95 |
"use client";
import { ThemeProvider as NextThemesProvider } from "next-themes";
import { type ThemeProviderProps } from "next-themes/dist/types";
export default function ThemeProvider({
children,
...props
}: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
| moinulmoin/chadnext/src/components/shared/theme-provider.tsx | {
"file_path": "moinulmoin/chadnext/src/components/shared/theme-provider.tsx",
"repo_id": "moinulmoin/chadnext",
"token_count": 95
} | 96 |
import { type User } from "@prisma/client";
import { z } from "zod";
export type CurrentUser = {
id: string;
name: string;
email: string;
picture: string;
};
export interface payload {
name: string;
email: string;
picture?: string;
}
export const settingsSchema = z.object({
picture: z.string().url(),
name: z
.string({
required_error: "Please type your name.",
})
.min(3, {
message: "Name must be at least 3 characters.",
})
.max(50, {
message: "Name must be at most 50 characters.",
}),
email: z.string().email(),
shortBio: z.string().optional(),
});
export type SettingsValues = z.infer<typeof settingsSchema>;
export type SubscriptionPlan = {
name: string;
description: string;
stripePriceId: string;
};
export type UserSubscriptionPlan = SubscriptionPlan &
Pick<User, "stripeCustomerId" | "stripeSubscriptionId"> & {
stripeCurrentPeriodEnd: number;
isPro: boolean;
};
export interface SendWelcomeEmailProps {
toMail: string;
userName: string;
}
export interface SendOTPProps extends SendWelcomeEmailProps {
code: string;
}
| moinulmoin/chadnext/src/types/index.ts | {
"file_path": "moinulmoin/chadnext/src/types/index.ts",
"repo_id": "moinulmoin/chadnext",
"token_count": 385
} | 97 |
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Icon } from "@/components/ui/icon";
import { icons } from "lucide-react";
interface FeaturesProps {
icon: string;
title: string;
description: string;
}
const featureList: FeaturesProps[] = [
{
icon: "TabletSmartphone",
title: "Mobile Friendly",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. A odio velit cum aliquam, consectetur.",
},
{
icon: "BadgeCheck",
title: "Social Proof",
description:
"Lorem ipsum dolor sit amet consectetur. Natus consectetur, odio ea accusamus aperiam.",
},
{
icon: "Goal",
title: "Targeted Content",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. odio ea accusamus aperiam.",
},
{
icon: "PictureInPicture",
title: "Strong Visuals",
description:
"Lorem elit. A odio velit cum aliquam. Natus consectetur dolores, odio ea accusamus aperiam.",
},
{
icon: "MousePointerClick",
title: "Clear CTA",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing. odio ea accusamus consectetur.",
},
{
icon: "Newspaper",
title: "Clear Headline",
description:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. A odio velit cum aliquam. Natus consectetur.",
},
];
export const FeaturesSection = () => {
return (
<section id="features" className="container py-24 sm:py-32">
<h2 className="text-lg text-primary text-center mb-2 tracking-wider">
Features
</h2>
<h2 className="text-3xl md:text-4xl text-center font-bold mb-4">
What Makes Us Different
</h2>
<h3 className="md:w-1/2 mx-auto text-xl text-center text-muted-foreground mb-8">
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Voluptatem
fugiat, odit similique quasi sint reiciendis quidem iure veritatis optio
facere tenetur.
</h3>
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-4">
{featureList.map(({ icon, title, description }) => (
<div key={title}>
<Card className="h-full bg-background border-0 shadow-none">
<CardHeader className="flex justify-center items-center">
<div className="bg-primary/20 p-2 rounded-full ring-8 ring-primary/10 mb-4">
<Icon
name={icon as keyof typeof icons}
size={24}
color="hsl(var(--primary))"
className="text-primary"
/>
</div>
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent className="text-muted-foreground text-center">
{description}
</CardContent>
</Card>
</div>
))}
</div>
</section>
);
};
| nobruf/shadcn-landing-page/components/layout/sections/features.tsx | {
"file_path": "nobruf/shadcn-landing-page/components/layout/sections/features.tsx",
"repo_id": "nobruf/shadcn-landing-page",
"token_count": 1328
} | 98 |
import { DashboardHeader } from "@/components/header"
import { PostCreateButton } from "@/components/post-create-button"
import { PostItem } from "@/components/post-item"
import { DashboardShell } from "@/components/shell"
export default function DashboardLoading() {
return (
<DashboardShell>
<DashboardHeader heading="Posts" text="Create and manage posts.">
<PostCreateButton />
</DashboardHeader>
<div className="divide-border-200 divide-y rounded-md border">
<PostItem.Skeleton />
<PostItem.Skeleton />
<PostItem.Skeleton />
<PostItem.Skeleton />
<PostItem.Skeleton />
</div>
</DashboardShell>
)
}
| shadcn-ui/taxonomy/app/(dashboard)/dashboard/loading.tsx | {
"file_path": "shadcn-ui/taxonomy/app/(dashboard)/dashboard/loading.tsx",
"repo_id": "shadcn-ui/taxonomy",
"token_count": 257
} | 99 |
import Image from "next/image"
import Link from "next/link"
import { allPosts } from "contentlayer/generated"
import { compareDesc } from "date-fns"
import { formatDate } from "@/lib/utils"
export const metadata = {
title: "Blog",
}
export default async function BlogPage() {
const posts = allPosts
.filter((post) => post.published)
.sort((a, b) => {
return compareDesc(new Date(a.date), new Date(b.date))
})
return (
<div className="container max-w-4xl py-6 lg:py-10">
<div className="flex flex-col items-start gap-4 md:flex-row md:justify-between md:gap-8">
<div className="flex-1 space-y-4">
<h1 className="inline-block font-heading text-4xl tracking-tight lg:text-5xl">
Blog
</h1>
<p className="text-xl text-muted-foreground">
A blog built using Contentlayer. Posts are written in MDX.
</p>
</div>
</div>
<hr className="my-8" />
{posts?.length ? (
<div className="grid gap-10 sm:grid-cols-2">
{posts.map((post, index) => (
<article
key={post._id}
className="group relative flex flex-col space-y-2"
>
{post.image && (
<Image
src={post.image}
alt={post.title}
width={804}
height={452}
className="rounded-md border bg-muted transition-colors"
priority={index <= 1}
/>
)}
<h2 className="text-2xl font-extrabold">{post.title}</h2>
{post.description && (
<p className="text-muted-foreground">{post.description}</p>
)}
{post.date && (
<p className="text-sm text-muted-foreground">
{formatDate(post.date)}
</p>
)}
<Link href={post.slug} className="absolute inset-0">
<span className="sr-only">View Article</span>
</Link>
</article>
))}
</div>
) : (
<p>No posts published.</p>
)}
</div>
)
}
| shadcn-ui/taxonomy/app/(marketing)/blog/page.tsx | {
"file_path": "shadcn-ui/taxonomy/app/(marketing)/blog/page.tsx",
"repo_id": "shadcn-ui/taxonomy",
"token_count": 1153
} | 100 |
"use client"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { SidebarNavItem } from "types"
import { cn } from "@/lib/utils"
import { Icons } from "@/components/icons"
interface DashboardNavProps {
items: SidebarNavItem[]
}
export function DashboardNav({ items }: DashboardNavProps) {
const path = usePathname()
if (!items?.length) {
return null
}
return (
<nav className="grid items-start gap-2">
{items.map((item, index) => {
const Icon = Icons[item.icon || "arrowRight"]
return (
item.href && (
<Link key={index} href={item.disabled ? "/" : item.href}>
<span
className={cn(
"group flex items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground",
path === item.href ? "bg-accent" : "transparent",
item.disabled && "cursor-not-allowed opacity-80"
)}
>
<Icon className="mr-2 h-4 w-4" />
<span>{item.title}</span>
</span>
</Link>
)
)
})}
</nav>
)
}
| shadcn-ui/taxonomy/components/nav.tsx | {
"file_path": "shadcn-ui/taxonomy/components/nav.tsx",
"repo_id": "shadcn-ui/taxonomy",
"token_count": 577
} | 101 |
import * as React from "react"
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
import { cva } from "class-variance-authority"
import { ChevronDown } from "lucide-react"
import { cn } from "@/lib/utils"
const NavigationMenu = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
>(({ className, children, ...props }, ref) => (
<NavigationMenuPrimitive.Root
ref={ref}
className={cn(
"relative z-10 flex flex-1 items-center justify-center",
className
)}
{...props}
>
{children}
<NavigationMenuViewport />
</NavigationMenuPrimitive.Root>
))
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
const NavigationMenuList = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.List>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
>(({ className, ...props }, ref) => (
<NavigationMenuPrimitive.List
ref={ref}
className={cn(
"group flex flex-1 list-none items-center justify-center space-x-1",
className
)}
{...props}
/>
))
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
const NavigationMenuItem = NavigationMenuPrimitive.Item
const navigationMenuTriggerStyle = cva(
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus:bg-accent focus:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none bg-background hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent/50 data-[active]:bg-accent/50 h-10 py-2 px-4 group w-max"
)
const NavigationMenuTrigger = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
>(({ className, children, ...props }, ref) => (
<NavigationMenuPrimitive.Trigger
ref={ref}
className={cn(navigationMenuTriggerStyle(), "group", className)}
{...props}
>
{children}{" "}
<ChevronDown
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
aria-hidden="true"
/>
</NavigationMenuPrimitive.Trigger>
))
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
const NavigationMenuContent = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
>(({ className, ...props }, ref) => (
<NavigationMenuPrimitive.Content
ref={ref}
className={cn(
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
className
)}
{...props}
/>
))
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
const NavigationMenuLink = NavigationMenuPrimitive.Link
const NavigationMenuViewport = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
>(({ className, ...props }, ref) => (
<div className={cn("absolute left-0 top-full flex justify-center")}>
<NavigationMenuPrimitive.Viewport
className={cn(
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
className
)}
ref={ref}
{...props}
/>
</div>
))
NavigationMenuViewport.displayName =
NavigationMenuPrimitive.Viewport.displayName
const NavigationMenuIndicator = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
>(({ className, ...props }, ref) => (
<NavigationMenuPrimitive.Indicator
ref={ref}
className={cn(
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
className
)}
{...props}
>
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
</NavigationMenuPrimitive.Indicator>
))
NavigationMenuIndicator.displayName =
NavigationMenuPrimitive.Indicator.displayName
export {
navigationMenuTriggerStyle,
NavigationMenu,
NavigationMenuList,
NavigationMenuItem,
NavigationMenuContent,
NavigationMenuTrigger,
NavigationMenuLink,
NavigationMenuIndicator,
NavigationMenuViewport,
}
| shadcn-ui/taxonomy/components/ui/navigation-menu.tsx | {
"file_path": "shadcn-ui/taxonomy/components/ui/navigation-menu.tsx",
"repo_id": "shadcn-ui/taxonomy",
"token_count": 1707
} | 102 |
export class RequiresProPlanError extends Error {
constructor(message = "This action requires a pro plan") {
super(message)
}
}
| shadcn-ui/taxonomy/lib/exceptions.ts | {
"file_path": "shadcn-ui/taxonomy/lib/exceptions.ts",
"repo_id": "shadcn-ui/taxonomy",
"token_count": 38
} | 103 |
import { Metadata } from "next"
import Image from "next/image"
import { Button } from "@/registry/new-york/ui/button"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/registry/new-york/ui/card"
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from "@/registry/new-york/ui/tabs"
import { CalendarDateRangePicker } from "@/app/(app)/examples/dashboard/components/date-range-picker"
import { MainNav } from "@/app/(app)/examples/dashboard/components/main-nav"
import { Overview } from "@/app/(app)/examples/dashboard/components/overview"
import { RecentSales } from "@/app/(app)/examples/dashboard/components/recent-sales"
import { Search } from "@/app/(app)/examples/dashboard/components/search"
import TeamSwitcher from "@/app/(app)/examples/dashboard/components/team-switcher"
import { UserNav } from "@/app/(app)/examples/dashboard/components/user-nav"
export const metadata: Metadata = {
title: "Dashboard",
description: "Example dashboard app built using the components.",
}
export default function DashboardPage() {
return (
<>
<div className="md:hidden">
<Image
src="/examples/dashboard-light.png"
width={1280}
height={866}
alt="Dashboard"
className="block dark:hidden"
/>
<Image
src="/examples/dashboard-dark.png"
width={1280}
height={866}
alt="Dashboard"
className="hidden dark:block"
/>
</div>
<div className="hidden flex-col md:flex">
<div className="border-b">
<div className="flex h-16 items-center px-4">
<TeamSwitcher />
<MainNav className="mx-6" />
<div className="ml-auto flex items-center space-x-4">
<Search />
<UserNav />
</div>
</div>
</div>
<div className="flex-1 space-y-4 p-8 pt-6">
<div className="flex items-center justify-between space-y-2">
<h2 className="text-3xl font-bold tracking-tight">Dashboard</h2>
<div className="flex items-center space-x-2">
<CalendarDateRangePicker />
<Button>Download</Button>
</div>
</div>
<Tabs defaultValue="overview" className="space-y-4">
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="analytics" disabled>
Analytics
</TabsTrigger>
<TabsTrigger value="reports" disabled>
Reports
</TabsTrigger>
<TabsTrigger value="notifications" disabled>
Notifications
</TabsTrigger>
</TabsList>
<TabsContent value="overview" className="space-y-4">
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Total Revenue
</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">$45,231.89</div>
<p className="text-xs text-muted-foreground">
+20.1% from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Subscriptions
</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />
<circle cx="9" cy="7" r="4" />
<path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+2350</div>
<p className="text-xs text-muted-foreground">
+180.1% from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">Sales</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<rect width="20" height="14" x="2" y="5" rx="2" />
<path d="M2 10h20" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+12,234</div>
<p className="text-xs text-muted-foreground">
+19% from last month
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">
Active Now
</CardTitle>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
className="h-4 w-4 text-muted-foreground"
>
<path d="M22 12h-4l-3 9L9 3l-3 9H2" />
</svg>
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">+573</div>
<p className="text-xs text-muted-foreground">
+201 since last hour
</p>
</CardContent>
</Card>
</div>
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-7">
<Card className="col-span-4">
<CardHeader>
<CardTitle>Overview</CardTitle>
</CardHeader>
<CardContent className="pl-2">
<Overview />
</CardContent>
</Card>
<Card className="col-span-3">
<CardHeader>
<CardTitle>Recent Sales</CardTitle>
<CardDescription>
You made 265 sales this month.
</CardDescription>
</CardHeader>
<CardContent>
<RecentSales />
</CardContent>
</Card>
</div>
</TabsContent>
</Tabs>
</div>
</div>
</>
)
}
| shadcn-ui/ui/apps/www/app/(app)/examples/dashboard/page.tsx | {
"file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/dashboard/page.tsx",
"repo_id": "shadcn-ui/ui",
"token_count": 4916
} | 104 |
import { ComponentProps } from "react"
import formatDistanceToNow from "date-fns/formatDistanceToNow"
import { cn } from "@/lib/utils"
import { Badge } from "@/registry/new-york/ui/badge"
import { ScrollArea } from "@/registry/new-york/ui/scroll-area"
import { Separator } from "@/registry/new-york/ui/separator"
import { Mail } from "@/app/(app)/examples/mail/data"
import { useMail } from "@/app/(app)/examples/mail/use-mail"
interface MailListProps {
items: Mail[]
}
export function MailList({ items }: MailListProps) {
const [mail, setMail] = useMail()
return (
<ScrollArea className="h-screen">
<div className="flex flex-col gap-2 p-4 pt-0">
{items.map((item) => (
<button
key={item.id}
className={cn(
"flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent",
mail.selected === item.id && "bg-muted"
)}
onClick={() =>
setMail({
...mail,
selected: item.id,
})
}
>
<div className="flex w-full flex-col gap-1">
<div className="flex items-center">
<div className="flex items-center gap-2">
<div className="font-semibold">{item.name}</div>
{!item.read && (
<span className="flex h-2 w-2 rounded-full bg-blue-600" />
)}
</div>
<div
className={cn(
"ml-auto text-xs",
mail.selected === item.id
? "text-foreground"
: "text-muted-foreground"
)}
>
{formatDistanceToNow(new Date(item.date), {
addSuffix: true,
})}
</div>
</div>
<div className="text-xs font-medium">{item.subject}</div>
</div>
<div className="line-clamp-2 text-xs text-muted-foreground">
{item.text.substring(0, 300)}
</div>
{item.labels.length ? (
<div className="flex items-center gap-2">
{item.labels.map((label) => (
<Badge key={label} variant={getBadgeVariantFromLabel(label)}>
{label}
</Badge>
))}
</div>
) : null}
</button>
))}
</div>
</ScrollArea>
)
}
function getBadgeVariantFromLabel(
label: string
): ComponentProps<typeof Badge>["variant"] {
if (["work"].includes(label.toLowerCase())) {
return "default"
}
if (["personal"].includes(label.toLowerCase())) {
return "outline"
}
return "secondary"
}
| shadcn-ui/ui/apps/www/app/(app)/examples/mail/components/mail-list.tsx | {
"file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/mail/components/mail-list.tsx",
"repo_id": "shadcn-ui/ui",
"token_count": 1519
} | 105 |
"use client"
import * as React from "react"
import { Dialog } from "@radix-ui/react-dialog"
import { DotsHorizontalIcon } from "@radix-ui/react-icons"
import { toast } from "@/registry/new-york/hooks/use-toast"
import {
AlertDialog,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/registry/new-york/ui/alert-dialog"
import { Button } from "@/registry/new-york/ui/button"
import {
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from "@/registry/new-york/ui/dialog"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/registry/new-york/ui/dropdown-menu"
import { Label } from "@/registry/new-york/ui/label"
import { Switch } from "@/registry/new-york/ui/switch"
export function PresetActions() {
const [open, setIsOpen] = React.useState(false)
const [showDeleteDialog, setShowDeleteDialog] = React.useState(false)
return (
<>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="secondary">
<span className="sr-only">Actions</span>
<DotsHorizontalIcon className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onSelect={() => setIsOpen(true)}>
Content filter preferences
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
onSelect={() => setShowDeleteDialog(true)}
className="text-red-600"
>
Delete preset
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<Dialog open={open} onOpenChange={setIsOpen}>
<DialogContent>
<DialogHeader>
<DialogTitle>Content filter preferences</DialogTitle>
<DialogDescription>
The content filter flags text that may violate our content policy.
It's powered by our moderation endpoint which is free to use
to moderate your OpenAI API traffic. Learn more.
</DialogDescription>
</DialogHeader>
<div className="py-6">
<h4 className="text-sm text-muted-foreground">
Playground Warnings
</h4>
<div className="flex items-start justify-between space-x-4 pt-3">
<Switch name="show" id="show" defaultChecked={true} />
<Label className="grid gap-1 font-normal" htmlFor="show">
<span className="font-semibold">
Show a warning when content is flagged
</span>
<span className="text-sm text-muted-foreground">
A warning will be shown when sexual, hateful, violent or
self-harm content is detected.
</span>
</Label>
</div>
</div>
<DialogFooter>
<Button variant="secondary" onClick={() => setIsOpen(false)}>
Close
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
<AlertDialog open={showDeleteDialog} onOpenChange={setShowDeleteDialog}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This preset will no longer be
accessible by you or others you've shared it with.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<Button
variant="destructive"
onClick={() => {
setShowDeleteDialog(false)
toast({
description: "This preset has been deleted.",
})
}}
>
Delete
</Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</>
)
}
| shadcn-ui/ui/apps/www/app/(app)/examples/playground/components/preset-actions.tsx | {
"file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/playground/components/preset-actions.tsx",
"repo_id": "shadcn-ui/ui",
"token_count": 1898
} | 106 |
"use client"
import * as React from "react"
import {
ColumnDef,
ColumnFiltersState,
SortingState,
VisibilityState,
flexRender,
getCoreRowModel,
getFacetedRowModel,
getFacetedUniqueValues,
getFilteredRowModel,
getPaginationRowModel,
getSortedRowModel,
useReactTable,
} from "@tanstack/react-table"
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/registry/new-york/ui/table"
import { DataTablePagination } from "./data-table-pagination"
import { DataTableToolbar } from "./data-table-toolbar"
interface DataTableProps<TData, TValue> {
columns: ColumnDef<TData, TValue>[]
data: TData[]
}
export function DataTable<TData, TValue>({
columns,
data,
}: DataTableProps<TData, TValue>) {
const [rowSelection, setRowSelection] = React.useState({})
const [columnVisibility, setColumnVisibility] =
React.useState<VisibilityState>({})
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
[]
)
const [sorting, setSorting] = React.useState<SortingState>([])
const table = useReactTable({
data,
columns,
state: {
sorting,
columnVisibility,
rowSelection,
columnFilters,
},
enableRowSelection: true,
onRowSelectionChange: setRowSelection,
onSortingChange: setSorting,
onColumnFiltersChange: setColumnFilters,
onColumnVisibilityChange: setColumnVisibility,
getCoreRowModel: getCoreRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getSortedRowModel: getSortedRowModel(),
getFacetedRowModel: getFacetedRowModel(),
getFacetedUniqueValues: getFacetedUniqueValues(),
})
return (
<div className="space-y-4">
<DataTableToolbar table={table} />
<div className="rounded-md border">
<Table>
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
)}
</TableHead>
)
})}
</TableRow>
))}
</TableHeader>
<TableBody>
{table.getRowModel().rows?.length ? (
table.getRowModel().rows.map((row) => (
<TableRow
key={row.id}
data-state={row.getIsSelected() && "selected"}
>
{row.getVisibleCells().map((cell) => (
<TableCell key={cell.id}>
{flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
</TableCell>
))}
</TableRow>
))
) : (
<TableRow>
<TableCell
colSpan={columns.length}
className="h-24 text-center"
>
No results.
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</div>
<DataTablePagination table={table} />
</div>
)
}
| shadcn-ui/ui/apps/www/app/(app)/examples/tasks/components/data-table.tsx | {
"file_path": "shadcn-ui/ui/apps/www/app/(app)/examples/tasks/components/data-table.tsx",
"repo_id": "shadcn-ui/ui",
"token_count": 1807
} | 107 |
"use client"
import * as React from "react"
import { getColorFormat, type Color } from "@/lib/colors"
import { cn } from "@/lib/utils"
import { useColors } from "@/hooks/use-colors"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/registry/new-york/ui/select"
import { Skeleton } from "@/registry/new-york/ui/skeleton"
export function ColorFormatSelector({
color,
className,
...props
}: Omit<React.ComponentProps<typeof SelectTrigger>, "color"> & {
color: Color
}) {
const { format, setFormat, isLoading } = useColors()
const formats = React.useMemo(() => getColorFormat(color), [color])
if (isLoading) {
return <ColorFormatSelectorSkeleton />
}
return (
<Select value={format} onValueChange={setFormat}>
<SelectTrigger
className={cn("h-7 w-auto gap-1.5 rounded-lg pr-2 text-xs", className)}
{...props}
>
<span className="font-medium">Format: </span>
<span className="font-mono text-xs text-muted-foreground">
{format}
</span>
</SelectTrigger>
<SelectContent align="end" className="rounded-xl">
{Object.entries(formats).map(([format, value]) => (
<SelectItem
key={format}
value={format}
className="gap-2 rounded-lg [&>span]:flex [&>span]:items-center [&>span]:gap-2"
>
<span className="font-medium">{format}</span>
<span className="font-mono text-xs text-muted-foreground">
{value}
</span>
</SelectItem>
))}
</SelectContent>
</Select>
)
}
export function ColorFormatSelectorSkeleton({
className,
...props
}: React.ComponentProps<typeof Skeleton>) {
return (
<Skeleton
className={cn("h-7 w-[116px] gap-1.5 rounded-lg", className)}
{...props}
/>
)
}
| shadcn-ui/ui/apps/www/components/color-format-selector.tsx | {
"file_path": "shadcn-ui/ui/apps/www/components/color-format-selector.tsx",
"repo_id": "shadcn-ui/ui",
"token_count": 801
} | 108 |
"use client"
import * as React from "react"
import { useTheme } from "next-themes"
import { THEMES, Theme } from "@/lib/themes"
import { cn } from "@/lib/utils"
import { useMediaQuery } from "@/hooks/use-media-query"
import { useThemesConfig } from "@/hooks/use-themes-config"
import { Skeleton } from "@/registry/new-york/ui/skeleton"
import {
ToggleGroup,
ToggleGroupItem,
} from "@/registry/new-york/ui/toggle-group"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/registry/new-york/ui/tooltip"
export function ThemesSwitcher({
themes = THEMES,
className,
}: React.ComponentProps<"div"> & { themes?: Theme[] }) {
const { theme: mode } = useTheme()
const [mounted, setMounted] = React.useState(false)
const { themesConfig, setThemesConfig } = useThemesConfig()
const activeTheme = themesConfig.activeTheme
const isDesktop = useMediaQuery("(min-width: 1024px)")
React.useEffect(() => {
setMounted(true)
}, [])
if (!mounted) {
return (
<div
className={cn(
"flex items-center justify-center gap-0.5 py-4 lg:flex-col lg:justify-start lg:gap-1",
className
)}
>
{themes.map((theme) => (
<div
key={theme.id}
className="flex h-10 w-10 items-center justify-center rounded-lg border-2 border-transparent"
>
<Skeleton className="h-6 w-6 rounded-sm" />
</div>
))}
</div>
)
}
return (
<ToggleGroup
type="single"
value={activeTheme.name}
onValueChange={(value) => {
const theme = themes.find((theme) => theme.name === value)
if (!theme) {
return
}
setThemesConfig({ ...themesConfig, activeTheme: theme })
}}
className={cn(
"flex items-center justify-center gap-0.5 py-4 lg:flex-col lg:justify-start lg:gap-1",
className
)}
>
{themes.map((theme) => {
const isActive = theme.name === activeTheme.name
const isDarkTheme = ["Midnight"].includes(theme.name)
const cssVars =
mounted && mode === "dark" ? theme.cssVars.dark : theme.cssVars.light
return (
<Tooltip key={theme.name}>
<TooltipTrigger asChild>
<ToggleGroupItem
value={theme.name}
className={cn(
"group flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border-2 border-transparent p-0 hover:bg-transparent focus-visible:bg-transparent aria-checked:border-[--color-1]",
mounted && isDarkTheme && mode !== "dark" ? "invert-[1]" : ""
)}
style={
{
...cssVars,
"--color-1": "hsl(var(--chart-1))",
"--color-2": "hsl(var(--chart-2))",
"--color-3": "hsl(var(--chart-3))",
"--color-4": "hsl(var(--chart-4))",
} as React.CSSProperties
}
>
<div className="h-6 w-6 overflow-hidden rounded-sm">
<div
className={cn(
"grid h-12 w-12 -translate-x-1/4 -translate-y-1/4 grid-cols-2 overflow-hidden rounded-md transition-all ease-in-out group-hover:rotate-45",
isActive ? "rotate-45 group-hover:rotate-0" : "rotate-0"
)}
>
<span className="flex h-6 w-6 bg-[--color-1]" />
<span className="flex h-6 w-6 bg-[--color-2]" />
<span className="flex h-6 w-6 bg-[--color-3]" />
<span className="flex h-6 w-6 bg-[--color-4]" />
<span className="sr-only">{theme.name}</span>
</div>
</div>
</ToggleGroupItem>
</TooltipTrigger>
<TooltipContent
side={isDesktop ? "left" : "top"}
className="bg-black text-white"
>
{theme.name}
</TooltipContent>
</Tooltip>
)
})}
</ToggleGroup>
)
}
| shadcn-ui/ui/apps/www/components/themes-selector.tsx | {
"file_path": "shadcn-ui/ui/apps/www/components/themes-selector.tsx",
"repo_id": "shadcn-ui/ui",
"token_count": 2130
} | 109 |
"use client"
import * as React from "react"
export function useCopyToClipboard({
timeout = 2000,
onCopy,
}: {
timeout?: number
onCopy?: () => void
} = {}) {
const [isCopied, setIsCopied] = React.useState(false)
const copyToClipboard = (value: string) => {
if (typeof window === "undefined" || !navigator.clipboard.writeText) {
return
}
if (!value) return
navigator.clipboard.writeText(value).then(() => {
setIsCopied(true)
if (onCopy) {
onCopy()
}
setTimeout(() => {
setIsCopied(false)
}, timeout)
}, console.error)
}
return { isCopied, copyToClipboard }
}
| shadcn-ui/ui/apps/www/hooks/use-copy-to-clipboard.ts | {
"file_path": "shadcn-ui/ui/apps/www/hooks/use-copy-to-clipboard.ts",
"repo_id": "shadcn-ui/ui",
"token_count": 270
} | 110 |
import { themeColorsToCssVariables } from "@/lib/charts"
const _THEMES = [
{
name: "Default",
id: "default-shadcn",
colors: {
background: "0 0% 100%",
foreground: "240 10% 3.9%",
card: "0 0% 100%",
"card-foreground": "240 10% 3.9%",
popover: "0 0% 100%",
"popover-foreground": "240 10% 3.9%",
primary: "240 5.9% 10%",
"primary-foreground": "0 0% 98%",
secondary: "240 4.8% 95.9%",
"secondary-foreground": "240 5.9% 10%",
muted: "240 4.8% 95.9%",
"muted-foreground": "240 3.8% 46.1%",
accent: "240 4.8% 95.9%",
"accent-foreground": "240 5.9% 10%",
destructive: "0 84.2% 60.2%",
"destructive-foreground": "0 0% 98%",
border: "240 5.9% 90%",
input: "240 5.9% 90%",
ring: "240 10% 3.9%",
"chart-1": "173 58% 39%",
"chart-2": "12 76% 61%",
"chart-3": "197 37% 24%",
"chart-4": "43 74% 66%",
"chart-5": "27 87% 67%",
},
colorsDark: {
background: "240 10% 3.9%",
foreground: "0 0% 98%",
card: "240 10% 3.9%",
"card-foreground": "0 0% 98%",
popover: "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
primary: "0 0% 98%",
"primary-foreground": "240 5.9% 10%",
secondary: "240 3.7% 15.9%",
"secondary-foreground": "0 0% 98%",
muted: "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
accent: "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
destructive: "0 62.8% 30.6%",
"destructive-foreground": "0 0% 98%",
border: "240 3.7% 15.9%",
input: "240 3.7% 15.9%",
ring: "240 4.9% 83.9%",
"chart-1": "220 70% 50%",
"chart-5": "160 60% 45%",
"chart-3": "30 80% 55%",
"chart-4": "280 65% 60%",
"chart-2": "340 75% 55%",
},
fontFamily: {
heading: {
name: "Inter",
type: "sans-serif",
},
body: {
name: "Inter",
type: "sans-serif",
},
},
radius: 0.5,
},
{
name: "Palette",
id: "default-palette",
colors: {
background: "0 0% 100%",
foreground: "240 10% 3.9%",
card: "0 0% 100%",
"card-foreground": "240 10% 3.9%",
popover: "0 0% 100%",
"popover-foreground": "240 10% 3.9%",
primary: "240 5.9% 10%",
"primary-foreground": "0 0% 98%",
secondary: "240 4.8% 95.9%",
"secondary-foreground": "240 5.9% 10%",
muted: "240 4.8% 95.9%",
"muted-foreground": "240 3.8% 46.1%",
accent: "240 4.8% 95.9%",
"accent-foreground": "240 5.9% 10%",
destructive: "0 84.2% 60.2%",
"destructive-foreground": "0 0% 98%",
border: "240 5.9% 90%",
input: "240 5.9% 90%",
ring: "240 10% 3.9%",
"chart-1": "12 76% 61%",
"chart-2": "173 58% 39%",
"chart-3": "197 37% 24%",
"chart-4": "43 74% 66%",
"chart-5": "27 87% 67%",
},
colorsDark: {
background: "240 10% 3.9%",
foreground: "0 0% 98%",
card: "240 10% 3.9%",
"card-foreground": "0 0% 98%",
popover: "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
primary: "0 0% 98%",
"primary-foreground": "240 5.9% 10%",
secondary: "240 3.7% 15.9%",
"secondary-foreground": "0 0% 98%",
muted: "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
accent: "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
destructive: "0 62.8% 30.6%",
"destructive-foreground": "0 0% 98%",
border: "240 3.7% 15.9%",
input: "240 3.7% 15.9%",
ring: "240 4.9% 83.9%",
"chart-1": "220 70% 50%",
"chart-2": "160 60% 45%",
"chart-3": "30 80% 55%",
"chart-4": "280 65% 60%",
"chart-5": "340 75% 55%",
},
fontFamily: {
heading: {
name: "Inter",
type: "sans-serif",
},
body: {
name: "Inter",
type: "sans-serif",
},
},
radius: 0.5,
},
{
name: "Sapphire",
id: "default-sapphire",
colors: {
background: "0 0% 100%",
foreground: "222.2 84% 4.9%",
card: "0 0% 100%",
cardForeground: "222.2 84% 4.9%",
popover: "0 0% 100%",
popoverForeground: "222.2 84% 4.9%",
primary: "221.2 83.2% 53.3%",
primaryForeground: "210 40% 98%",
secondary: "210 40% 96.1%",
secondaryForeground: "222.2 47.4% 11.2%",
muted: "210 40% 96.1%",
mutedForeground: "215.4 16.3% 44%",
accent: "210 40% 96.1%",
accentForeground: "222.2 47.4% 11.2%",
destructive: "0 72% 51%",
destructiveForeground: "210 40% 98%",
border: "214.3 31.8% 91.4%",
input: "214.3 31.8% 91.4%",
ring: "221.2 83.2% 53.3%",
"chart-1": "221.2 83.2% 53.3%",
"chart-2": "212 95% 68%",
"chart-3": "216 92% 60%",
"chart-4": "210 98% 78%",
"chart-5": "212 97% 87%",
},
colorsDark: {
background: "240 10% 3.9%",
foreground: "0 0% 98%",
card: "240 10% 3.9%",
"card-foreground": "0 0% 98%",
popover: "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
primary: "221.2 83.2% 53.3%",
primaryForeground: "210 40% 98%",
secondary: "210 40% 96.1%",
secondaryForeground: "222.2 47.4% 11.2%",
muted: "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
accent: "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
destructive: "0 72% 51%",
destructiveForeground: "210 40% 98%",
border: "240 3.7% 15.9%",
input: "240 3.7% 15.9%",
ring: "221.2 83.2% 53.3%",
"chart-1": "221.2 83.2% 53.3%",
"chart-2": "212 95% 68%",
"chart-3": "216 92% 60%",
"chart-4": "210 98% 78%",
"chart-5": "212 97% 87%",
},
fontFamily: {
heading: {
name: "Inter",
type: "sans-serif",
},
body: {
name: "Inter",
type: "sans-serif",
},
},
radius: 0.5,
},
{
name: "Ruby",
id: "default-ruby",
colors: {
background: "0 0% 100%",
foreground: "240 10% 3.9%",
card: "0 0% 100%",
cardForeground: "240 10% 3.9%",
popover: "0 0% 100%",
popoverForeground: "240 10% 3.9%",
primary: "346.8 77.2% 49.8%",
primaryForeground: "355.7 100% 99%",
secondary: "240 4.8% 95.9%",
secondaryForeground: "240 5.9% 10%",
muted: "240 4.8% 95.9%",
mutedForeground: "240 3.8% 45%",
accent: "240 4.8% 95.9%",
accentForeground: "240 5.9% 10%",
destructive: "0 72% 51%",
destructiveForeground: "0 0% 98%",
border: "240 5.9% 90%",
input: "240 5.9% 90%",
ring: "346.8 77.2% 49.8%",
"chart-1": "347 77% 50%",
"chart-2": "352 83% 91%",
"chart-3": "350 80% 72%",
"chart-4": "351 83% 82%",
"chart-5": "349 77% 62%",
},
colorsDark: {
background: "240 10% 3.9%",
foreground: "0 0% 98%",
card: "240 10% 3.9%",
"card-foreground": "0 0% 98%",
popover: "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
primary: "346.8 77.2% 49.8%",
primaryForeground: "355.7 100% 99%",
secondary: "240 4.8% 95.9%",
secondaryForeground: "240 5.9% 10%",
muted: "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
accent: "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
destructive: "0 72% 51%",
destructiveForeground: "0 0% 98%",
border: "240 3.7% 15.9%",
input: "240 3.7% 15.9%",
ring: "221.2 83.2% 53.3%",
"chart-1": "347 77% 50%",
"chart-2": "349 77% 62%",
"chart-3": "350 80% 72%",
"chart-4": "351 83% 82%",
"chart-5": "352 83% 91%",
},
fontFamily: {
heading: {
name: "Inter",
type: "sans-serif",
},
body: {
name: "Inter",
type: "sans-serif",
},
},
radius: 0.5,
},
{
name: "Emerald",
id: "default-emerald",
colors: {
background: "0 0% 100%",
foreground: "240 10% 3.9%",
card: "0 0% 100%",
cardForeground: "240 10% 3.9%",
popover: "0 0% 100%",
popoverForeground: "240 10% 3.9%",
primary: "142 86% 28%",
primaryForeground: "356 29% 98%",
secondary: "240 4.8% 95.9%",
secondaryForeground: "240 5.9% 10%",
muted: "240 4.8% 95.9%",
mutedForeground: "240 3.8% 45%",
accent: "240 4.8% 95.9%",
accentForeground: "240 5.9% 10%",
destructive: "0 72% 51%",
destructiveForeground: "0 0% 98%",
border: "240 5.9% 90%",
input: "240 5.9% 90%",
ring: "142 86% 28%",
"chart-1": "139 65% 20%",
"chart-2": "140 74% 44%",
"chart-3": "142 88% 28%",
"chart-4": "137 55% 15%",
"chart-5": "141 40% 9%",
},
colorsDark: {
background: "240 10% 3.9%",
foreground: "0 0% 98%",
card: "240 10% 3.9%",
"card-foreground": "0 0% 98%",
popover: "240 10% 3.9%",
"popover-foreground": "0 0% 98%",
primary: "142 86% 28%",
primaryForeground: "356 29% 98%",
secondary: "240 4.8% 95.9%",
secondaryForeground: "240 5.9% 10%",
muted: "240 3.7% 15.9%",
"muted-foreground": "240 5% 64.9%",
accent: "240 3.7% 15.9%",
"accent-foreground": "0 0% 98%",
destructive: "0 72% 51%",
destructiveForeground: "0 0% 98%",
border: "240 3.7% 15.9%",
input: "240 3.7% 15.9%",
ring: "142 86% 28%",
"chart-1": "142 88% 28%",
"chart-2": "139 65% 20%",
"chart-3": "140 74% 24%",
"chart-4": "137 55% 15%",
"chart-5": "141 40% 9%",
},
fontFamily: {
heading: {
name: "Inter",
type: "sans-serif",
},
body: {
name: "Inter",
type: "sans-serif",
},
},
radius: 0.5,
},
{
name: "Daylight",
id: "default-daylight",
colors: {
background: "36 39% 88%",
foreground: "36 45% 15%",
primary: "36 45% 70%",
primaryForeground: "36 45% 11%",
secondary: "40 35% 77%",
secondaryForeground: "36 45% 25%",
accent: "36 64% 57%",
accentForeground: "36 72% 17%",
destructive: "0 84% 37%",
destructiveForeground: "0 0% 98%",
muted: "36 33% 75%",
mutedForeground: "36 45% 25%",
card: "36 46% 82%",
cardForeground: "36 45% 20%",
popover: "0 0% 100%",
popoverForeground: "240 10% 3.9%",
border: "36 45% 60%",
input: "36 45% 60%",
ring: "36 45% 30%",
"chart-1": "25 34% 28%",
"chart-2": "26 36% 34%",
"chart-3": "28 40% 40%",
"chart-4": "31 41% 48%",
"chart-5": "35 43% 53%",
},
colorsDark: {
background: "36 39% 88%",
foreground: "36 45% 15%",
primary: "36 45% 70%",
primaryForeground: "36 45% 11%",
secondary: "40 35% 77%",
secondaryForeground: "36 45% 25%",
accent: "36 64% 57%",
accentForeground: "36 72% 17%",
destructive: "0 84% 37%",
destructiveForeground: "0 0% 98%",
muted: "36 33% 75%",
mutedForeground: "36 45% 25%",
card: "36 46% 82%",
cardForeground: "36 45% 20%",
popover: "0 0% 100%",
popoverForeground: "240 10% 3.9%",
border: "36 45% 60%",
input: "36 45% 60%",
ring: "36 45% 30%",
"chart-1": "25 34% 28%",
"chart-2": "26 36% 34%",
"chart-3": "28 40% 40%",
"chart-4": "31 41% 48%",
"chart-5": "35 43% 53%",
},
fontFamily: {
heading: {
name: "DM Sans",
type: "sans-serif",
},
body: {
name: "Space Mono",
type: "monospace",
},
},
},
{
name: "Midnight",
id: "default-midnight",
colors: {
background: "240 5% 6%",
foreground: "60 5% 90%",
primary: "240 0% 90%",
primaryForeground: "60 0% 0%",
secondary: "240 4% 15%",
secondaryForeground: "60 5% 85%",
accent: "240 0% 13%",
accentForeground: "60 0% 100%",
destructive: "0 60% 50%",
destructiveForeground: "0 0% 98%",
muted: "240 5% 25%",
mutedForeground: "60 5% 85%",
card: "240 4% 10%",
cardForeground: "60 5% 90%",
popover: "240 5% 15%",
popoverForeground: "60 5% 85%",
border: "240 6% 20%",
input: "240 6% 20%",
ring: "240 5% 90%",
"chart-1": "359 2% 90%",
"chart-2": "240 1% 74%",
"chart-3": "240 1% 58%",
"chart-4": "240 1% 42%",
"chart-5": "240 2% 26%",
},
colorsDark: {
background: "240 5% 6%",
foreground: "60 5% 90%",
primary: "240 0% 90%",
primaryForeground: "60 0% 0%",
secondary: "240 4% 15%",
secondaryForeground: "60 5% 85%",
accent: "240 0% 13%",
accentForeground: "60 0% 100%",
destructive: "0 60% 50%",
destructiveForeground: "0 0% 98%",
muted: "240 5% 25%",
mutedForeground: "60 5% 85%",
card: "240 4% 10%",
cardForeground: "60 5% 90%",
popover: "240 5% 15%",
popoverForeground: "60 5% 85%",
border: "240 6% 20%",
input: "240 6% 20%",
ring: "240 5% 90%",
"chart-1": "359 2% 90%",
"chart-2": "240 1% 74%",
"chart-3": "240 1% 58%",
"chart-4": "240 1% 42%",
"chart-5": "240 2% 26%",
},
fontFamily: {
heading: {
name: "Manrope",
type: "sans-serif",
},
body: {
name: "Manrope",
type: "sans-serif",
},
},
radius: 0.5,
},
] as const
export const THEMES = _THEMES.map((theme) => ({
...theme,
cssVars: {
light: themeColorsToCssVariables(theme.colors),
dark: themeColorsToCssVariables(theme.colorsDark),
},
}))
export type Theme = (typeof THEMES)[number]
| shadcn-ui/ui/apps/www/lib/themes.ts | {
"file_path": "shadcn-ui/ui/apps/www/lib/themes.ts",
"repo_id": "shadcn-ui/ui",
"token_count": 7280
} | 111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.