Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

feat: new profile ui (#1574)

Devinda Senanayaka4c31af99c892
diff --git a/apps/web/package.json b/apps/web/package.json
index 2d342ed8..a24869f5 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -52,6 +52,7 @@
"cmdk": "^0.2.0",
"date-fns": "^2.30.0",
"framer-motion": "^10.12.22",
+ "jotai": "^2.10.1",
"lodash": "^4.17.21",
"lz-string": "^1.5.0",
"million": "2.6.0-beta.12",
diff --git a/apps/web/src/app/(profile)/[username]/_components/activity-chart.tsx b/apps/web/src/app/(profile)/[username]/_components/activity-chart.tsx
new file mode 100644
index 00000000..d8817916
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/activity-chart.tsx
@@ -0,0 +1,166 @@
+'use client';
+import {
+ ChartContainer,
+ type ChartConfig,
+ ChartTooltip,
+ ChartTooltipContent,
+} from '@repo/ui/components/chart';
+import { Scatter, ScatterChart, XAxis, YAxis, ZAxis } from '@repo/ui/recharts';
+import { format, setWeek, startOfYear } from 'date-fns';
+import { MessageCircle, FileCode, Award } from '@repo/ui/icons';
+import { cn } from '@repo/ui/cn';
+import { atom, useAtom, type PrimitiveAtom } from 'jotai';
+import { useMemo } from 'react';
+import { useIsMobile } from '~/utils/useIsMobile';
+
+const chartConfig = {
+ submissions: {
+ label: 'Submissions',
+ icon: FileCode,
+ },
+ comments: {
+ label: 'Comments',
+ icon: MessageCircle,
+ },
+ badges: {
+ label: 'Badges',
+ icon: Award,
+ },
+} satisfies ChartConfig;
+
+export function ActivityChart(props: {
+ data: {
+ date: Date;
+ day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
+ week: number;
+ month: number;
+ comments: number;
+ badges: number;
+ submissions: number;
+ activity: number;
+ }[];
+}) {
+ return (
+ <ChartContainer config={chartConfig} className="pointer-events-auto aspect-[8/7] h-[270px]">
+ <ScatterChart data={props.data} accessibilityLayer>
+ <ChartTooltip
+ cursor={false}
+ content={({ payload, content, ...props }) => {
+ const innerPayload = (payload?.[0]?.payload as Record<string, number>) ?? {};
+ const customPayload = Object.entries(innerPayload ?? {})
+ .filter(([key]) => key === 'comments' || key === 'badges' || key === 'submissions')
+ .map(([key, val]) => ({ name: key, value: val, payload }));
+ return <ChartTooltipContent {...props} payload={customPayload} />;
+ }}
+ labelFormatter={(_, [val]) => {
+ return format(val?.payload[0].payload.date, 'dd MMM');
+ }}
+ />
+ <XAxis
+ orientation="bottom"
+ dataKey="week"
+ type="category"
+ allowDuplicatedCategory={false}
+ tickLine={false}
+ axisLine={false}
+ tickFormatter={(val, idx) => {
+ return getMonthFromWeek(val, idx);
+ }}
+ />
+
+ <YAxis dataKey="day" type="category" allowDuplicatedCategory={false} hide />
+ <ZAxis dataKey="activity" type="number" />
+ <Scatter
+ // ReCharts has this type defined as Record<string, any> so attempting
+ // to overide it throws an error
+ shape={(props: unknown) => (
+ <ActivitySquare {...(props as { cx: number; cy: number; activity: number })} />
+ )}
+ />
+ </ScatterChart>
+ </ChartContainer>
+ );
+}
+
+function ActivitySquare(props: { cx: number; cy: number; activity: number }) {
+ const { cx, cy, activity } = props;
+ const squareLength = 24;
+ const borderV = 10;
+ const borderH = 12;
+ return (
+ <SquareWrapper>
+ {(isSelected) => (
+ <>
+ <rect
+ x={cx - squareLength / 2}
+ y={cy - squareLength / 2}
+ width={squareLength}
+ height={squareLength}
+ className={cn(getColor(activity), isSelected ? 'stroke-primary stroke-2' : '')}
+ rx={2}
+ />
+ <rect
+ x={cx - borderH / 2 - squareLength / 2}
+ y={cy - borderV / 2 - squareLength / 2}
+ width={squareLength + borderH}
+ height={squareLength + borderV}
+ className="fill-transparent"
+ />
+ </>
+ )}
+ </SquareWrapper>
+ );
+}
+
+const activeNodeAtom = atom<PrimitiveAtom<boolean> | null>(null);
+const SquareWrapper = (props: { children: (isSelected: boolean) => React.ReactElement }) => {
+ const baseSelectedAtom = useMemo(() => atom(false), []);
+ const selectedAtom = useMemo(
+ () =>
+ atom(
+ (get) => get(baseSelectedAtom),
+ (get, set) => {
+ const currentActiveAtom = get(activeNodeAtom);
+ if (currentActiveAtom !== null) {
+ set(currentActiveAtom, false);
+ }
+ set(baseSelectedAtom, true);
+ set(activeNodeAtom, baseSelectedAtom);
+ },
+ ),
+ [baseSelectedAtom],
+ );
+ const [isSelected, toggleSelect] = useAtom(selectedAtom);
+ const isMobile = useIsMobile();
+ function handleClick() {
+ if (isMobile) {
+ toggleSelect();
+ }
+ }
+ return <g onClick={handleClick}>{props.children(isSelected)}</g>;
+};
+
+function getColor(count: number) {
+ if (count < 1) {
+ return 'fill-sky-600/10';
+ } else if (count < 3) {
+ return 'fill-sky-600/30';
+ } else if (count < 5) {
+ return 'fill-sky-600/60';
+ } else if (count < 7) {
+ return 'fill-sky-600/100';
+ }
+ return 'fill-sky-600/100';
+}
+function getMonthFromWeek(weekNumber: number, idx: number) {
+ const year = new Date().getFullYear();
+ // Create a date object for the first day of the given year
+ const firstDayOfYear = startOfYear(new Date(year, 0, 1));
+
+ // Set the week number
+ const targetDate = setWeek(firstDayOfYear, weekNumber, { weekStartsOn: 1 });
+ if (idx % 4 === 0) {
+ return format(targetDate, 'MMM');
+ }
+ return '';
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/badges/aot-2023-badge.tsx b/apps/web/src/app/(profile)/[username]/_components/aot-badges/aot-2023-badge.tsx
similarity index 100%
rename from apps/web/src/app/(profile)/[username]/_components/badges/aot-2023-badge.tsx
rename to apps/web/src/app/(profile)/[username]/_components/aot-badges/aot-2023-badge.tsx
diff --git a/apps/web/src/app/(profile)/[username]/_components/badges.tsx b/apps/web/src/app/(profile)/[username]/_components/badges.tsx
new file mode 100644
index 00000000..8bcc9446
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/badges.tsx
@@ -0,0 +1,89 @@
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from '@repo/ui/components/tooltip';
+
+import {
+ HolidayBronzeBadge,
+ HolidayGoldBadge,
+ HolidayPlatinumBadge,
+ HolidaySilverBadge,
+} from './aot-badges/aot-2023-badge';
+import type { BadgeInfo } from '../user-info';
+import type { FC } from 'react';
+
+export const SlugToBadgeIcon: Record<BadgeInfo['slug'], FC<{ className: string }>> = {
+ 'aot-2023-bronze': HolidayBronzeBadge,
+ 'aot-2023-silver': HolidaySilverBadge,
+ 'aot-2023-gold': HolidayGoldBadge,
+ 'aot-2023-platinum': HolidayPlatinumBadge,
+};
+export function Badges(props: { data: BadgeInfo[] }) {
+ return (
+ <div>
+ <TooltipProvider>
+ <BadgesStuff data={props.data} />
+ </TooltipProvider>
+ </div>
+ );
+}
+
+function BadgesStuff(props: { data: BadgeInfo[] }) {
+ return (
+ <div className="mx-auto grid w-fit grid-cols-4 gap-4 ">
+ {props.data.map((b) => {
+ const Icon = SlugToBadgeIcon[b.slug];
+ return (
+ <Tooltip key={b.slug}>
+ <TooltipTrigger>
+ <Icon className="h-16 w-16" />
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>{b.name}</p>
+ </TooltipContent>
+ </Tooltip>
+ );
+ })}
+ {props.data.length < 12
+ ? Array.from({ length: 12 - props.data.length }).map((i) => (
+ <EmptyBadge key={`empty-badge-${i}`} />
+ ))
+ : null}
+ </div>
+ );
+}
+
+export function EmptyBadge() {
+ return (
+ <svg
+ width="52"
+ height="60"
+ viewBox="0 0 52 60"
+ fill="none"
+ className="h-16 w-16"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <mask
+ id="mask0_408_2530"
+ style={{
+ maskType: 'alpha',
+ }}
+ maskUnits="userSpaceOnUse"
+ x="0"
+ y="0"
+ width="52"
+ height="60"
+ >
+ <path
+ d="M22.9998 1.73207C24.8562 0.660273 27.1434 0.660273 28.9998 1.73207L48.9805 13.268C50.8369 14.3398 51.9805 16.3205 51.9805 18.4641V41.5359C51.9805 43.6795 50.8369 45.6603 48.9805 46.7321L28.9998 58.2679C27.1434 59.3398 24.8562 59.3398 22.9998 58.2679L3.01904 46.7321C1.16264 45.6603 0.019043 43.6795 0.019043 41.5359V18.4641C0.019043 16.3205 1.16264 14.3398 3.01904 13.268L22.9998 1.73207Z"
+ fill="black"
+ />
+ </mask>
+ <g mask="url(#mask0_408_2530)">
+ <path d="M56 0H-4V60H56V0Z" className="dark:fill-muted/50 fill-muted-foreground/50" />
+ </g>
+ </svg>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/card-radial-bg.module.css b/apps/web/src/app/(profile)/[username]/_components/card-radial-bg.module.css
new file mode 100644
index 00000000..bd450731
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/card-radial-bg.module.css
@@ -0,0 +1,15 @@
+@media (min-width: 768px) {
+ .radial-bg::before {
+ @apply pointer-events-none absolute select-none rounded-3xl opacity-0 transition-opacity duration-300 hover:opacity-100;
+ background: radial-gradient(
+ 1000px circle at var(--x) var(--y),
+ var(--color-center) 0,
+ var(--color-mid) 25%,
+ var(--color-fade) 50%,
+ var(--color-outer) 80%
+ );
+ z-index: -1;
+ content: '';
+ inset: -1px;
+ }
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/card-radial-bg.tsx b/apps/web/src/app/(profile)/[username]/_components/card-radial-bg.tsx
new file mode 100644
index 00000000..ada4a5f1
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/card-radial-bg.tsx
@@ -0,0 +1,52 @@
+'use client';
+
+import React from 'react';
+import type { MotionStyle, MotionValue } from 'framer-motion';
+import { motion, useMotionTemplate, useMotionValue } from 'framer-motion';
+import { useIsMobile } from '~/utils/useIsMobile';
+import { cn } from '@repo/ui/cn';
+import { Card } from '@repo/ui/components/card';
+import styles from './card-radial-bg.module.css';
+
+type WrapperStyle = MotionStyle & {
+ '--x': MotionValue<string>;
+ '--y': MotionValue<string>;
+};
+export function CardWithRadialBg(
+ props: React.PropsWithChildren<{ gradient?: string; className?: string }>,
+) {
+ const mouseX = useMotionValue(0);
+ const mouseY = useMotionValue(0);
+ const isMobile = useIsMobile();
+
+ function handleMouseMove(event: React.MouseEvent) {
+ if (isMobile) return;
+ const boundingRect = event.currentTarget.getBoundingClientRect();
+ mouseX.set(event.clientX - boundingRect.left);
+ mouseY.set(event.clientY - boundingRect.top);
+ }
+ return (
+ <motion.div
+ className={cn(
+ styles['radial-bg'],
+ 'pointer-events-none relative md:pointer-events-auto',
+ props.className,
+ )}
+ onMouseMove={handleMouseMove}
+ style={
+ {
+ '--x': useMotionTemplate`${mouseX}px`,
+ '--y': useMotionTemplate`${mouseY}px`,
+ '--color-center': '#3aecf8',
+ '--color-mid': '#5295dc',
+ '--color-fade': 'rgba(255, 255, 255, 0)',
+ '--color-outer': 'transparent',
+ } as WrapperStyle
+ }
+ >
+ <Card className="h-full border bg-transparent bg-gradient-to-br from-neutral-50 to-neutral-100 transition md:hover:border-transparent dark:from-neutral-900/95 dark:to-neutral-950/95">
+ {props.children}
+ </Card>
+ </motion.div>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/badges.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/badges.tsx
deleted file mode 100644
index 21a64fe5..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/badges.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { type FC } from 'react';
-
-import { cn } from '@repo/ui/cn';
-import { Text } from '@repo/ui/components/typography/typography';
-import { Tooltip, TooltipContent, TooltipTrigger } from '@repo/ui/components/tooltip';
-
-import { type BadgeInfo } from './_actions';
-import {
- HolidayBronzeBadge,
- HolidayGoldBadge,
- HolidayPlatinumBadge,
- HolidaySilverBadge,
-} from '../badges/aot-2023-badge';
-import { toast } from '@repo/ui/components/use-toast';
-
-export const SlugToBadgeIcon: Record<BadgeInfo['slug'], FC<{ className: string }>> = {
- 'aot-2023-bronze': HolidayBronzeBadge,
- 'aot-2023-silver': HolidaySilverBadge,
- 'aot-2023-gold': HolidayGoldBadge,
- 'aot-2023-platinum': HolidayPlatinumBadge,
-};
-
-const Badge = ({ slug, name }: BadgeInfo) => {
- const Icon = SlugToBadgeIcon[slug];
-
- if (Icon === undefined) return null;
-
- return (
- <Tooltip>
- <TooltipTrigger>
- <span
- onClick={(e) => {
- navigator.clipboard.writeText(e.currentTarget.innerHTML);
- toast({
- title: 'Copied to clipboard',
- variant: 'success',
- });
- }}
- >
- <Icon className="h-12 w-12" />
- </span>
- </TooltipTrigger>
- <TooltipContent side="bottom">
- <span>{name}</span>
- </TooltipContent>
- </Tooltip>
- );
-};
-
-interface BadgesProps {
- badges: BadgeInfo[];
- className?: string;
-}
-
-export const Badges = ({ badges, className }: BadgesProps) => {
- if (badges.length === 0) return null;
-
- return (
- <div className={cn('border-border flex flex-col gap-4 border-t py-4', className)}>
- <Text intent="leading">Badges</Text>
- <div className="flex flex-wrap gap-2">
- {badges.map((badge) => (
- <Badge key={badge.slug} {...badge} />
- ))}
- </div>
- </div>
- );
-};
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/challenge-history-columns.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/challenge-history-columns.tsx
deleted file mode 100644
index b2e6b2e1..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/challenge-history-columns.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-'use client';
-
-import { type ColumnDef } from '@tanstack/react-table';
-import Link from 'next/link';
-import { getRelativeTimeStrict } from '~/utils/relativeTime';
-import type { HistoricalChallenge } from './_actions';
-
-export const columns: ColumnDef<HistoricalChallenge>[] = [
- {
- accessorKey: 'slug',
- header: 'Challenge',
- cell: ({ row }) => (
- <Link href={`/challenge/${row.original.slug}`} className="underline">
- {row.original.name}
- </Link>
- ),
- },
- {
- accessorKey: 'submissionDate',
- header: 'Last Submission',
- cell: ({ row }) => getRelativeTimeStrict(row.original.submissionDate!),
- },
-];
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/challenge-history.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/challenge-history.tsx
deleted file mode 100644
index b3e74bc3..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/challenge-history.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import { DataTable } from '@repo/ui/components/data-table';
-import { columns } from './challenge-history-columns';
-import type { HistoricalChallenge } from './_actions';
-
-interface Props {
- challenges: HistoricalChallenge[];
-}
-
-export default function ChallengeHistory({ challenges }: Props) {
- return <DataTable data={challenges} columns={columns} />;
-}
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/challenges-progress.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/challenges-progress.tsx
deleted file mode 100644
index a35af1b0..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/challenges-progress.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@repo/ui/components/card';
-import { DifficultyBadge } from '@repo/ui/components/difficulty-badge';
-import { Progress } from '@repo/ui/components/progress';
-import { getSolvedChallenges } from './_actions';
-
-export const DIFFICULTIES = ['BEGINNER', 'EASY', 'MEDIUM', 'HARD', 'EXTREME'] as const;
-
-interface ChallengesProgressProps {
- userId: string;
-}
-
-export async function ChallengesProgress({ userId }: ChallengesProgressProps) {
- const { challenges, percentage, totalChallenges, totalSolved } =
- await getSolvedChallenges(userId);
- return (
- <Card className="flex-grow">
- <CardHeader>
- <CardTitle>Challenges</CardTitle>
- </CardHeader>
- <CardContent>
- <div className="flex flex-grow flex-col gap-2 text-xl">
- {DIFFICULTIES.map((difficulty) => (
- <div key={difficulty} className="flex items-center gap-4 md:gap-6">
- <DifficultyBadge
- className="w-full max-w-[80px] justify-center"
- difficulty={difficulty}
- />
- <Progress
- indicatorClassName={`bg-opacity-75 ${getProgressBarColor(difficulty)}`}
- className="h-1"
- value={(challenges[difficulty].solved / challenges[difficulty].total) * 100}
- />
- <div className="w-16 text-center md:w-20">
- {challenges[difficulty].solved}
- <span className="text-muted-foreground text-sm">
- /{challenges[difficulty].total}
- </span>
- </div>
- </div>
- ))}
- </div>
- </CardContent>
- <CardFooter>
- <div className="text-muted-foreground text-sm">
- Solved: <span className="text-foreground text-xl">{totalSolved}</span>/{totalChallenges} (
- {percentage}%)
- </div>
- </CardFooter>
- </Card>
- );
-}
-
-const getProgressBarColor = (difficulty: string) => {
- switch (difficulty) {
- case 'BEGINNER':
- return 'dark:bg-blue-300 bg-blue-700';
- case 'EASY':
- return 'dark:bg-green-300 bg-green-700';
- case 'MEDIUM':
- return 'dark:bg-yellow-300 bg-yellow-700';
- case 'HARD':
- return 'dark:bg-red-300 bg-red-700';
- case 'EXTREME':
- return 'dark:bg-purple-300 bg-purple-700';
- default:
- return '';
- }
-};
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/index.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/index.tsx
deleted file mode 100644
index 1fef58ac..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/index.tsx
+++ /dev/null
@@ -1,195 +0,0 @@
-'use client';
-import { useEffect, useMemo } from 'react';
-import Link from 'next/link';
-import { usePathname, useRouter } from 'next/navigation';
-
-import type { User } from '@repo/db/types';
-import { MagicIcon } from '@repo/ui/components/magic-icon';
-import {
- Tabs,
- VerticalTabsContent,
- VerticalTabsList,
- VerticalTabsTrigger,
-} from '@repo/ui/components/tabs';
-import { Bookmark, CheckCircle, ChevronRightSquare, Play, Settings, Text } from '@repo/ui/icons';
-
-import { getRelativeTimeStrict } from '~/utils/relativeTime';
-import { stripProtocolAndWWW } from '~/utils/stringUtils';
-
-import { type BadgeInfo } from './_actions';
-import { Badges } from './badges';
-import UserHeader from './user-header';
-
-interface Props {
- // TODO: how do do this union type with just letting prisma halp
- user: Pick<User, 'bio' | 'createdAt' | 'id' | 'image' | 'name'> & {
- userLinks: { id: string | null; url: string }[];
- };
- isOwnProfile: boolean;
- badges: BadgeInfo[];
- children: React.ReactNode;
-}
-type Tab = 'bookmarks' | 'completed' | 'in-progress' | 'overview' | 'shared-solutions';
-
-export function Dashboard({ user, isOwnProfile, badges, children }: Props) {
- const router = useRouter();
-
- const tabs = useMemo(
- () => [
- { name: 'overview', route: `/@${user.name}` },
- { name: 'in-progress', route: `/@${user.name}/in-progress` },
- { name: 'shared-solutions', route: `/@${user.name}/shared-solutions` },
- { name: 'bookmarks', route: `/@${user.name}/bookmarks` },
- { name: 'completed', route: `@${user.name}/completed` },
- ],
- [user.name],
- );
-
- const filteredProfileLinks =
- user.userLinks.length > 0 ? user.userLinks.filter((item) => item.url !== '') : [];
-
- const pathname = usePathname();
- const selectedTab: Tab = useMemo(() => {
- const splitPath = pathname.split('/');
-
- if (splitPath.includes('in-progress')) {
- return 'in-progress';
- }
-
- if (splitPath.includes('shared-solutions')) {
- return 'shared-solutions';
- }
-
- if (splitPath.includes('bookmarks')) {
- return 'bookmarks';
- }
-
- if (splitPath.includes('completed')) {
- return 'completed';
- }
-
- return 'overview';
- }, [pathname]);
-
- useEffect(() => {
- // prefetch every route except for the one we're currently in
- tabs.forEach((tab) => {
- if (selectedTab !== tab.name) {
- router.prefetch(tab.route);
- }
- });
- }, [router, selectedTab, tabs]);
-
- return (
- <div className="container">
- {/* // TODO: GFI: make each page a subroute, put settings & profile into same layout */}
- <Tabs className="flex flex-col gap-8 py-8 md:flex-row" value={selectedTab}>
- <VerticalTabsList>
- <div className="flex flex-col items-center gap-4 md:items-start">
- <div
- className="h-32 w-32 rounded-3xl bg-cover bg-center bg-no-repeat md:h-64 md:w-64"
- style={{ backgroundImage: `url(${user.image ?? '/avatar.jpeg'})` }}
- />
- <div className="flex flex-col items-center gap-2 md:w-full md:items-start">
- <UserHeader user={user} isOwnProfile={isOwnProfile} />
- <span
- className="text-muted-foreground tracking-tight"
- title={`Joined ${user.createdAt.toString()}`}
- >
- Joined {getRelativeTimeStrict(user.createdAt)}
- </span>
- </div>
- {Boolean(filteredProfileLinks.length > 0) && (
- <div className="flex w-full flex-col items-center gap-2 md:items-start">
- {filteredProfileLinks.map((link) => (
- <div className="flex items-center gap-2" key={link.id}>
- <MagicIcon url={link.url} />
- <a
- className="text-neutral-400 hover:text-neutral-600 dark:text-neutral-600 dark:hover:text-neutral-400"
- href={link.url}
- rel="noopener noreferrer"
- target="_blank"
- >
- {stripProtocolAndWWW(link.url)}
- </a>
- </div>
- ))}
- </div>
- )}
- <div className="flex gap-4 md:w-full md:flex-col">
- <VerticalTabsTrigger
- className="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- value="overview"
- onClick={() => {
- router.push(`/@${user.name}`);
- }}
- >
- <Text className="h-4 w-4" />
- <span className="hidden md:block">Overview</span>
- </VerticalTabsTrigger>
- {Boolean(isOwnProfile) && (
- <VerticalTabsTrigger
- className="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- value="completed"
- onClick={() => {
- router.push(`/@${user.name}/completed`);
- }}
- >
- <CheckCircle className="h-4 w-4" />
- <span className="hidden md:block">Completed</span>
- </VerticalTabsTrigger>
- )}
- {Boolean(isOwnProfile) && (
- <VerticalTabsTrigger
- className="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- value="in-progress"
- onClick={() => {
- router.push(`/@${user.name}/in-progress`);
- }}
- >
- <Play className="h-4 w-4" />
- <span className="hidden md:block">In-Progress</span>
- </VerticalTabsTrigger>
- )}
- <VerticalTabsTrigger
- className="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- value="shared-solutions"
- onClick={() => {
- router.push(`/@${user.name}/shared-solutions`);
- }}
- >
- <ChevronRightSquare className="h-4 w-4" />
- <span className="hidden md:block">Shared Solutions</span>
- </VerticalTabsTrigger>
- {Boolean(isOwnProfile) && (
- <>
- <VerticalTabsTrigger
- className="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- value="bookmarks"
- onClick={() => {
- router.push(`/@${user.name}/bookmarks`);
- }}
- >
- <Bookmark className="h-4 w-4" />
- <span className="hidden md:block">Bookmarks</span>
- </VerticalTabsTrigger>
- <Link
- href="/settings"
- className="border-border dark:border-ring data-[state=active]:bg-border ring-offset-background focus-visible:ring-ring data-[state=active]:text-foreground flex items-center justify-center gap-3 whitespace-nowrap rounded-xl border px-1.5 py-1.5 text-sm font-medium transition-all duration-300 hover:bg-neutral-200/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- >
- <Settings className="h-4 w-4" />
- <span className="hidden md:block">Settings</span>
- </Link>
- </>
- )}
- </div>
- <Badges className="flex w-full flex-1" badges={badges} />
- </div>
- </VerticalTabsList>
- <VerticalTabsContent className="shrink grow space-y-4" value={selectedTab}>
- {children}
- </VerticalTabsContent>
- </Tabs>
- </div>
- );
-}
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/overview-tab.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/overview-tab.tsx
deleted file mode 100644
index 8667c5b9..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/overview-tab.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import type { User } from '@repo/db/types';
-import { Card, CardContent, CardHeader, CardTitle } from '@repo/ui/components/card';
-import { Markdown } from '@repo/ui/components/markdown';
-import { ChallengesProgress } from './challenges-progress';
-
-interface Props {
- // TODO: how do do this union type with just letting prisma halp
- user: Pick<User, 'bio' | 'createdAt' | 'id' | 'image' | 'name'> & {
- userLinks: { id: string | null; url: string }[];
- };
-}
-
-export async function OverviewTab({ user }: Props) {
- const hasBio = Boolean(user.bio) && user.bio.trim().length > 0;
-
- return (
- <div className="col-span-4 flex flex-col gap-6 md:min-h-[calc(100vh_-_56px_-_6rem)]">
- <div className="flex flex-col md:flex-row md:gap-6">
- <ChallengesProgress userId={user.id} />
- {/* //Todo: Filling with void for now, may put contributions / something else */}
- <div className="max-w-sm flex-grow" />
- </div>
- <Card className="w-full flex-grow md:max-w-[800px]">
- <CardHeader>
- <CardTitle>Bio</CardTitle>
- </CardHeader>
- <CardContent>
- <div className="w-full break-words text-sm">
- {hasBio ? (
- <Markdown>{user.bio}</Markdown>
- ) : (
- <p className="text-muted-foreground">{user.name} does not have a bio.</p>
- )}
- </div>
- </CardContent>
- </Card>
- </div>
- );
-}
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/user-header.tsx b/apps/web/src/app/(profile)/[username]/_components/dashboard/user-header.tsx
deleted file mode 100644
index d253c98f..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/user-header.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-'use client';
-
-import { type User } from '@repo/db/types';
-import { Flag } from '@repo/ui/icons';
-import { ReportDialog } from '~/components/ReportDialog';
-import { ActionMenu } from '@repo/ui/components/action-menu';
-import { Text } from '@repo/ui/components/typography/typography';
-
-export interface UserHeaderProps {
- user: Pick<User, 'id' | 'name'>;
- isOwnProfile: boolean;
-}
-
-export default function UserHeader({ user, isOwnProfile }: UserHeaderProps) {
- return (
- <div className="flex gap-4">
- <Text intent="h1">{user.name}</Text>
- {!isOwnProfile && (
- <>
- <ReportDialog reportType="USER" userId={user.id}>
- <ActionMenu
- items={[
- {
- key: 'report',
- label: 'Report',
- icon: Flag,
- },
- ]}
- onChange={() => {
- // do nothing
- }}
- />
- </ReportDialog>
- </>
- )}
- </div>
- );
-}
diff --git a/apps/web/src/app/(profile)/[username]/_components/moving-grid.module.css b/apps/web/src/app/(profile)/[username]/_components/moving-grid.module.css
new file mode 100644
index 00000000..cceb8d16
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/moving-grid.module.css
@@ -0,0 +1,30 @@
+@keyframes movingbackground {
+ 0% {
+ transform: translate(0, 0);
+ }
+ 100% {
+ transform: translate(0, -50%);
+ }
+}
+.moving-grid-background {
+ @apply bg-background/90;
+ will-change: transform;
+ background-size: 3rem 3rem;
+ background-image: linear-gradient(to right, #8882 1px, transparent 1px),
+ linear-gradient(to bottom, #8882 1px, transparent 1px);
+ animation: movingbackground 90s linear infinite;
+}
+
+.radial-bg::before {
+ @apply border-background pointer-events-none absolute select-none border opacity-100 transition-opacity duration-300;
+ background: radial-gradient(
+ 1000px circle at var(--x) var(--y),
+ var(--color-center) 0,
+ var(--color-mid) 25%,
+ var(--color-fade) 50%,
+ var(--color-outer) 80%
+ );
+ z-index: -1;
+ content: '';
+ inset: -1px;
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/moving-grid.tsx b/apps/web/src/app/(profile)/[username]/_components/moving-grid.tsx
new file mode 100644
index 00000000..73d89558
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/moving-grid.tsx
@@ -0,0 +1,61 @@
+'use client';
+import {
+ motion,
+ useMotionTemplate,
+ useMotionValue,
+ type MotionStyle,
+ type MotionValue,
+ useSpring,
+} from 'framer-motion';
+import styles from './moving-grid.module.css';
+import { cn } from '@repo/ui/cn';
+import { useIsMobile } from '~/utils/useIsMobile';
+
+type WrapperStyle = MotionStyle & {
+ '--x': MotionValue<string>;
+ '--y': MotionValue<string>;
+};
+
+export function MovingGrid(props: React.PropsWithChildren<{ className?: string }>) {
+ const transition = { damping: 100, stiffness: 1000, type: 'spring' } as const;
+ const mouseX = useMotionValue(43.5);
+ const x = useSpring(mouseX, transition);
+ const mouseY = useMotionValue(80);
+ const y = useSpring(mouseY, transition);
+ const isMobile = useIsMobile();
+
+ function handleMouseMove(event: React.MouseEvent) {
+ if (isMobile) return;
+ const boundingRect = event.currentTarget.getBoundingClientRect();
+ x.set(event.clientX - boundingRect.left);
+ y.set(event.clientY - boundingRect.top);
+ }
+
+ function handleMouseLeave() {
+ if (isMobile) return;
+ x.set(43.5);
+ y.set(80);
+ }
+
+ return (
+ <motion.div
+ onMouseMove={handleMouseMove}
+ onMouseLeave={handleMouseLeave}
+ className={cn('relative overflow-hidden', styles['radial-bg'], props.className)}
+ style={
+ {
+ '--x': useMotionTemplate`${x}px`,
+ '--y': useMotionTemplate`${y}px`,
+ '--color-center': '#3aecf8',
+ '--color-mid': '#5295dc',
+ '--color-fade': 'rgba(255, 255, 255, 0)',
+ '--color-outer': 'transparent',
+ } as WrapperStyle
+ }
+ >
+ <motion.div className={cn('absolute h-[200%] w-full', styles['moving-grid-background'])} />
+ <div className="shadow-background absolute h-full w-full shadow-[inset_0_0_5rem_3.5rem]" />
+ {props.children}
+ </motion.div>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/profile-skeleton.tsx b/apps/web/src/app/(profile)/[username]/_components/profile-skeleton.tsx
deleted file mode 100644
index f7cf454d..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/profile-skeleton.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { Skeleton } from '@repo/ui/components/skeleton';
-
-export function PageContentSkeleton() {
- return (
- <div className="relative flex w-full shrink grow flex-col gap-8">
- <div className=" flex h-1/2 shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-10 md:h-2/5 md:w-4/5">
- <Skeleton className="h-4 w-5/6 max-w-80 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- </div>
- <div className="relative flex shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-20 md:h-3/5">
- <Skeleton className="h-4 w-5/6 max-w-80 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- </div>
- </div>
- );
-}
-
-export function TableSkeleton() {
- return (
- <div className="relative flex h-[300px] w-full shrink grow flex-col gap-8 md:h-[600px]">
- <div className="relative flex shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-20 md:h-3/5">
- <Skeleton className="h-4 w-5/6 max-w-80 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- </div>
- </div>
- );
-}
diff --git a/apps/web/src/app/(profile)/[username]/_components/profile.tsx b/apps/web/src/app/(profile)/[username]/_components/profile.tsx
deleted file mode 100644
index cdedf628..00000000
--- a/apps/web/src/app/(profile)/[username]/_components/profile.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import { prisma } from '@repo/db';
-import type { Metadata } from 'next';
-import { notFound } from 'next/navigation';
-import { Dashboard } from './dashboard';
-import { auth } from '~/server/auth';
-import { getBadges } from './dashboard/_actions';
-
-interface Props {
- username: string;
- children: React.ReactNode;
-}
-
-export const metadata: Metadata = {
- title: 'Profile | TypeHero',
- description: 'View this profile on TypeHero.',
-};
-
-export async function Profile({ username: usernameFromQuery, children }: Props) {
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
- if (!username) return notFound();
-
- const user = await prisma.user.findFirst({
- where: {
- name: {
- equals: username,
- },
- },
- select: {
- id: true,
- createdAt: true,
- bio: true,
- image: true,
- name: true,
- userLinks: true,
- },
- });
-
- if (!user) return notFound();
-
- const session = await auth();
- const isOwnProfile = session?.user?.id === user.id;
-
- const badges = await getBadges(user.id);
-
- return (
- <Dashboard user={user} isOwnProfile={isOwnProfile} badges={badges}>
- {children}
- </Dashboard>
- );
-}
diff --git a/apps/web/src/app/(profile)/[username]/_components/progress-chart.tsx b/apps/web/src/app/(profile)/[username]/_components/progress-chart.tsx
new file mode 100644
index 00000000..a048560c
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/progress-chart.tsx
@@ -0,0 +1,171 @@
+'use client';
+
+import {
+ Label,
+ PolarAngleAxis,
+ PolarRadiusAxis,
+ RadialBar,
+ RadialBarChart,
+} from '@repo/ui/recharts';
+
+import {
+ type ChartConfig,
+ ChartContainer,
+ ChartTooltip,
+ ChartTooltipContent,
+} from '@repo/ui/components/chart';
+import Link from 'next/link';
+import { ArrowUpRight } from '@repo/ui/icons';
+
+const chartConfig = {
+ BEGINNER: {
+ label: 'Beginner',
+ color: 'hsl(var(--chart-1))',
+ },
+ EASY: {
+ label: 'Easy',
+ color: 'hsl(var(--chart-2))',
+ },
+ MEDIUM: {
+ label: 'Medium',
+ color: 'hsl(var(--chart-3))',
+ },
+ HARD: {
+ label: 'Hard',
+ color: 'hsl(var(--chart-4))',
+ },
+ EXTREME: {
+ label: 'Extreme',
+ color: 'hsl(var(--chart-5))',
+ },
+} satisfies ChartConfig;
+
+export function ProgressChart(props: {
+ chartData: {
+ difficulty: string;
+ completed: number;
+ completedPercentage: number;
+ total: number;
+ }[];
+ totalCompleted: number;
+ totalChallenges: number;
+ allCompletedHref: string;
+}) {
+ return (
+ <div className="flex flex-row flex-wrap-reverse items-center justify-center gap-3 lg:items-start">
+ <div className="grid h-fit grid-cols-3 gap-6 lg:grid-cols-2 lg:grid-rows-3">
+ {props.chartData.map((d) => (
+ <LegendItem
+ key={d.difficulty}
+ completed={d.completed}
+ difficulty={d.difficulty}
+ total={d.total}
+ config={chartConfig}
+ />
+ ))}
+ </div>
+ <ChartContainer
+ config={chartConfig}
+ className="[&_.recharts-radial-bar-background-sector]:fill-muted-foreground/20 dark:[&_.recharts-radial-bar-background-sector]:fill-muted/40 aspect-square h-[280px]"
+ >
+ <RadialBarChart
+ data={props.chartData}
+ innerRadius={50}
+ outerRadius={140}
+ startAngle={90}
+ endAngle={-270}
+ barCategoryGap={3}
+ >
+ <ChartTooltip
+ cursor={false}
+ content={<ChartTooltipContent hideLabel nameKey="difficulty" tooltipUnit="%" />}
+ />
+ <PolarAngleAxis domain={[0, 100]} type="number" tickLine={false} tick={false} />
+ <PolarRadiusAxis type="category" tick={false} tickLine={false} axisLine={false}>
+ <Label
+ content={({ viewBox }) => {
+ if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
+ return (
+ <Link href={props.allCompletedHref} className="group">
+ <text
+ x={(viewBox.cx ?? 0) - 5}
+ y={(viewBox.cy ?? 0) - 30}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ className="fill-muted-foreground group-hover:underline"
+ >
+ Total
+ </text>
+
+ <text
+ x={viewBox.cx}
+ y={viewBox.cy}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ className="fill-foreground text-4xl font-bold"
+ >
+ {props.totalCompleted}
+ </text>
+
+ <text
+ x={viewBox.cx}
+ y={(viewBox.cy ?? 0) + 30}
+ textAnchor="middle"
+ dominantBaseline="middle"
+ className="fill-muted-foreground text-sm"
+ >
+ of {props.totalChallenges}
+ </text>
+ <foreignObject
+ x={(viewBox.cx ?? 0) + 10}
+ y={(viewBox.cy ?? 0) - 39}
+ width="20"
+ height="20"
+ >
+ <ArrowUpRight className="text-muted-foreground h-4 w-4" />
+ </foreignObject>
+ </Link>
+ );
+ }
+ }}
+ />
+ </PolarRadiusAxis>
+ <RadialBar
+ dataKey="completedPercentage"
+ cornerRadius={10}
+ minPointSize={-1}
+ background={{
+ className: undefined,
+ fill: '#fff',
+ }}
+ />
+ </RadialBarChart>
+ </ChartContainer>
+ </div>
+ );
+}
+
+function LegendItem(props: {
+ difficulty: string;
+ completed: number;
+ total: number;
+ config: ChartConfig;
+}) {
+ return (
+ <div>
+ <div className="flex flex-row space-x-2">
+ <div
+ className="mt-1.5 h-2.5 w-2.5 rounded-full"
+ style={{ backgroundColor: props.config[props.difficulty]?.color }}
+ />
+ <div>
+ <h1 className="text-muted-foreground">{props.config[props.difficulty]?.label}</h1>
+ <div className="flex flex-row items-baseline space-x-1">
+ <h2 className="text-3xl">{props.completed}</h2>
+ <h3 className="text-muted-foreground text-sm">/ {props.total}</h3>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/_components/shared-solution-card.tsx b/apps/web/src/app/(profile)/[username]/_components/shared-solution-card.tsx
new file mode 100644
index 00000000..60827d35
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/_components/shared-solution-card.tsx
@@ -0,0 +1,47 @@
+import { Card, CardHeader, CardTitle } from '@repo/ui/components/card';
+import { MessageCircle, ThumbsUp } from '@repo/ui/icons';
+
+import type { Difficulty } from '@repo/db/types';
+import {
+ SHADOWS_BY_DIFFICULTY,
+ BORDERS_BY_DIFFICULTY,
+ ChallengeDifficultyIcon,
+} from '~/app/explore/_components/explore-card';
+import { Badge } from '@repo/ui/components/badge';
+
+export interface SharedSolutionCardProps {
+ solution: {
+ commentCount: number;
+ voteCount: number;
+ isPinned: boolean;
+ challenge: { difficulty: Difficulty; name: string };
+ };
+}
+export function SharedSolutionCard(props: SharedSolutionCardProps) {
+ return (
+ <Card
+ className={`group/card bg-background hover:bg-card-hovered xl:min-w-[333px]} relative overflow-hidden duration-300 sm:min-w-[300px]
+ ${SHADOWS_BY_DIFFICULTY[props.solution.challenge.difficulty]}
+ ${BORDERS_BY_DIFFICULTY[props.solution.challenge.difficulty]}
+ `}
+ >
+ <ChallengeDifficultyIcon difficulty={props.solution.challenge.difficulty} />
+ <CardHeader className="relative flex flex-col items-start gap-1 py-5">
+ <CardTitle className="max-w-[75%] truncate text-lg duration-300 lg:text-2xl">
+ {props.solution.challenge.name}
+ </CardTitle>
+ <div className="flex items-center gap-5 text-center duration-300">
+ {props.solution.isPinned ? <Badge>Pinned</Badge> : null}
+ <div className="flex items-center gap-2 text-sm">
+ <MessageCircle size={18} />
+ {props.solution.commentCount}
+ </div>
+ <div className="flex items-center gap-2 text-sm">
+ <ThumbsUp size={18} />
+ {props.solution.voteCount}
+ </div>
+ </div>
+ </CardHeader>
+ </Card>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/bookmarks/_components/bookmarked-challenges-columns.tsx b/apps/web/src/app/(profile)/[username]/bookmarks/_components/bookmarked-challenges-columns.tsx
deleted file mode 100644
index e6443ec0..00000000
--- a/apps/web/src/app/(profile)/[username]/bookmarks/_components/bookmarked-challenges-columns.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-'use client';
-
-import { type ColumnDef } from '@tanstack/react-table';
-import { getRelativeTimeStrict } from '~/utils/relativeTime';
-import Link from 'next/link';
-import type { BookmarkedChallenge } from '../page';
-
-export const bookmarkedChallengedColumns: ColumnDef<BookmarkedChallenge>[] = [
- {
- accessorFn: (bookmark) => bookmark.challenge?.name,
- header: 'Title',
- cell: ({ row }) => (
- <Link className="underline" href={`/challenge/${row.original.challenge?.slug}`}>
- {row.original.challenge?.name}
- </Link>
- ),
- },
- {
- accessorKey: 'createdAt',
- header: 'Date',
- cell: ({ row }) => getRelativeTimeStrict(row.original.createdAt!),
- },
-];
diff --git a/apps/web/src/app/(profile)/[username]/bookmarks/loading.tsx b/apps/web/src/app/(profile)/[username]/bookmarks/loading.tsx
deleted file mode 100644
index b63146bf..00000000
--- a/apps/web/src/app/(profile)/[username]/bookmarks/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { TableSkeleton as default } from '../_components/profile-skeleton';
diff --git a/apps/web/src/app/(profile)/[username]/bookmarks/page.tsx b/apps/web/src/app/(profile)/[username]/bookmarks/page.tsx
deleted file mode 100644
index 50b50f73..00000000
--- a/apps/web/src/app/(profile)/[username]/bookmarks/page.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { prisma } from '@repo/db';
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from '@repo/ui/components/card';
-import { notFound } from 'next/navigation';
-import { withUnstableCache } from '~/utils/withUnstableCache';
-import { createCacheKeyForBookmarksTab } from '../../../challenge/_components/bookmark.action';
-import { DataTable } from '@repo/ui/components/data-table';
-import { bookmarkedChallengedColumns } from './_components/bookmarked-challenges-columns';
-import { auth } from '~/server/auth';
-
-interface Props {
- params: {
- username: string;
- };
-}
-
-export default async function BookmarksPage({ params: { username: usernameFromQuery } }: Props) {
- const session = await auth();
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
-
- if (!username || session?.user?.name !== username) return notFound();
-
- const user = await prisma.user.findFirst({
- where: {
- name: {
- equals: username,
- },
- },
- select: {
- id: true,
- },
- });
-
- if (!user) return notFound();
-
- const bookmarks = await withUnstableCache({
- fn: getBookmarkedChallenges,
- args: [user.id],
- keys: [`bookmarked-challenges`],
- tags: [createCacheKeyForBookmarksTab(user.id)],
- });
-
- return (
- <Card className="col-span-4 md:min-h-[calc(100vh_-_56px_-_6rem)]">
- <CardHeader>
- <CardTitle>Bookmarks</CardTitle>
- <CardDescription className="text-muted-foreground mb-4 text-sm">
- Your bookmarked challenges.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <DataTable data={bookmarks} columns={bookmarkedChallengedColumns} />
- </CardContent>
- </Card>
- );
-}
-
-export type BookmarkedChallenge = Awaited<ReturnType<typeof getBookmarkedChallenges>>[0];
-async function getBookmarkedChallenges(userId: string) {
- return await prisma.bookmark.findMany({
- where: { userId },
- include: {
- challenge: {
- select: {
- id: true,
- slug: true,
- name: true,
- },
- },
- },
- orderBy: {
- createdAt: 'desc',
- },
- });
-}
diff --git a/apps/web/src/app/(profile)/[username]/completed/_components/challenges.tsx b/apps/web/src/app/(profile)/[username]/completed/_components/challenges.tsx
new file mode 100644
index 00000000..b1b4dd4d
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/completed/_components/challenges.tsx
@@ -0,0 +1,67 @@
+'use client';
+import { useState } from 'react';
+import { ExploreCard, type ExploreCardProps } from '~/app/explore/_components/explore-card';
+import { Alert, AlertDescription, AlertTitle } from '@repo/ui/components/alert';
+import { Button } from '@repo/ui/components/button';
+import Link from 'next/link';
+import { DIFFICULTY_COLOR_MAP, FilterBar, type FilterOptions } from './filter-bar';
+import { cn } from '@repo/ui/cn';
+
+export function Challenges(props: {
+ challenges: (ExploreCardProps['challenge'] & { id: number; slug: string })[];
+ isOwnProfile: boolean;
+ username: string;
+ className?: string;
+}) {
+ const [filter, setFilter] = useState<FilterOptions>('ALL');
+ const filteredChallenges = props.challenges.filter((c) => {
+ if (filter === 'ALL') return true;
+ return c.difficulty === filter;
+ });
+
+ return (
+ <div className={cn('flex flex-col justify-center space-y-8', props.className)}>
+ <FilterBar filter={filter} setFilter={setFilter} />
+ {filteredChallenges.length === 0 ? (
+ <Alert className="mx-auto w-fit md:px-8">
+ <AlertTitle className="text-center leading-normal">
+ <span>{props.isOwnProfile ? "You haven't" : `@${props.username} hasn't`}</span>{' '}
+ completed any{' '}
+ <span
+ className="lowercase"
+ style={{
+ color: `hsl(${DIFFICULTY_COLOR_MAP[filter]})`,
+ }}
+ >
+ {filter}
+ </span>{' '}
+ challenges yet
+ </AlertTitle>
+ {props.isOwnProfile ? (
+ <AlertDescription className="flex justify-center">
+ <Button variant="link" size="sm">
+ <Link href={`/explore/${filter.toLowerCase()}`}>
+ Get started with your first <span className="lowercase">{filter}</span> challenge
+ </Link>
+ </Button>
+ </AlertDescription>
+ ) : null}
+ </Alert>
+ ) : null}
+ <div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
+ {filteredChallenges.map((c) => (
+ <Link
+ href={
+ props.isOwnProfile
+ ? `/challenge/${encodeURIComponent(c.slug)}/submissions/${c.submission[0]?.id}`
+ : `/challenge/${encodeURIComponent(c.slug)}`
+ }
+ key={c.id}
+ >
+ <ExploreCard challenge={c} className="min-w-fit xl:min-w-fit" />
+ </Link>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/completed/_components/filter-bar.tsx b/apps/web/src/app/(profile)/[username]/completed/_components/filter-bar.tsx
new file mode 100644
index 00000000..a0daa36f
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/completed/_components/filter-bar.tsx
@@ -0,0 +1,82 @@
+'use client';
+import { ToggleGroup, ToggleGroupItem } from '@repo/ui/components/toggle-group';
+import { motion } from 'framer-motion';
+import { cn } from '@repo/ui/cn';
+import { useState } from 'react';
+import type { Difficulty } from '@repo/db/types';
+
+export type FilterOptions = Exclude<Difficulty, 'EVENT'> | 'ALL';
+
+export const DIFFICULTY_COLOR_MAP: Record<FilterOptions, string> = {
+ ALL: 'var(--foreground)', // Neutral grey for "ALL"
+ BEGINNER: 'var(--difficulty-beginner)', // Using CSS variable for BEGINNER
+ EASY: 'var(--difficulty-easy)', // Using CSS variable for EASY
+ MEDIUM: 'var(--difficulty-medium)', // Using CSS variable for MEDIUM
+ HARD: 'var(--difficulty-hard)', // Using CSS variable for HARD
+ EXTREME: 'var(--difficulty-extreme)',
+};
+
+export function FilterBar(props: {
+ filter: FilterOptions;
+ setFilter: (val: FilterOptions) => void;
+}) {
+ const [hoveredDifficulty, setHoveredDifficulty] = useState<FilterOptions | null>(null);
+ const difficulties: FilterOptions[] = ['ALL', 'BEGINNER', 'EASY', 'MEDIUM', 'HARD', 'EXTREME'];
+ const [lastSelected, setLastSelected] = useState<FilterOptions>('ALL');
+
+ return (
+ <ToggleGroup
+ type="single"
+ onMouseLeave={() => setHoveredDifficulty(null)}
+ value={props.filter}
+ onValueChange={(val: FilterOptions | '') => {
+ if (val === '') {
+ return;
+ }
+ setLastSelected(props.filter);
+ props.setFilter(val);
+ }}
+ className="flex-wrap"
+ >
+ {difficulties.map((difficulty) => (
+ <ToggleGroupItem
+ key={difficulty}
+ value={difficulty}
+ asChild
+ className="hover:text-foreground hover:bg-transparent data-[state=on]:bg-transparent"
+ >
+ <button className="relative " onMouseEnter={() => setHoveredDifficulty(difficulty)}>
+ <span className="z-20">{difficulty}</span>
+ {props.filter === difficulty ? (
+ <motion.div
+ layoutId="underline"
+ initial={
+ {
+ '--color-line': DIFFICULTY_COLOR_MAP[lastSelected],
+ } as unknown as Record<string, string>
+ }
+ animate={
+ {
+ '--color-line': DIFFICULTY_COLOR_MAP[props.filter],
+ } as unknown as Record<string, string>
+ }
+ style={{
+ backgroundColor: 'hsl(var(--color-line))',
+ }}
+ transition={{ duration: 0.3 }}
+ className="absolute -bottom-2 left-0 h-1 w-full"
+ />
+ ) : null}
+ {hoveredDifficulty == difficulty ? (
+ <motion.div
+ transition={{ duration: 0.15 }}
+ layoutId="hover"
+ className={cn('bg-muted absolute inset-0 rounded-md')}
+ />
+ ) : null}
+ </button>
+ </ToggleGroupItem>
+ ))}
+ </ToggleGroup>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/completed/loading.tsx b/apps/web/src/app/(profile)/[username]/completed/loading.tsx
deleted file mode 100644
index b63146bf..00000000
--- a/apps/web/src/app/(profile)/[username]/completed/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { TableSkeleton as default } from '../_components/profile-skeleton';
diff --git a/apps/web/src/app/(profile)/[username]/completed/page.tsx b/apps/web/src/app/(profile)/[username]/completed/page.tsx
index 887c6c18..e231280a 100644
--- a/apps/web/src/app/(profile)/[username]/completed/page.tsx
+++ b/apps/web/src/app/(profile)/[username]/completed/page.tsx
@@ -1,61 +1,85 @@
import { prisma } from '@repo/db';
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from '@repo/ui/components/card';
+import { Challenges } from './_components/challenges';
import { notFound } from 'next/navigation';
-import { createCompletedSubmissionCacheKey } from '~/app/challenge/[slug]/submissions/[[...catchAll]]/cache-keys';
-import { withUnstableCache } from '~/utils/withUnstableCache';
-import { getChallengeHistoryByCategory } from '../_components/dashboard/_actions';
-import ChallengeHistory from '../_components/dashboard/challenge-history';
import { auth } from '~/server/auth';
+import { AlertTitle, Alert, AlertDescription } from '@repo/ui/components/alert';
+import Link from 'next/link';
-interface Props {
- params: {
- username: string;
- };
-}
-
-export default async function CompletedPage({ params: { username: usernameFromQuery } }: Props) {
- const session = await auth();
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
-
- if (!username || session?.user?.name !== username) return notFound();
-
- const user = await prisma.user.findFirst({
- where: {
- name: {
- equals: username,
- },
- },
+export default async function CompletedPage(props: { params: { username: string } }) {
+ const [, username] = decodeURIComponent(props.params.username).split('@');
+ if (username === undefined) {
+ notFound();
+ }
+ const challenges = await prisma.challenge.findMany({
select: {
+ difficulty: true,
id: true,
+ name: true,
+ slug: true,
+ //The submission part below is run as a separate query, this ensures that the most recently successfull submission of the current user is selected
+ submission: {
+ take: 1,
+ orderBy: {
+ createdAt: 'desc',
+ },
+ where: {
+ isSuccessful: true,
+ user: {
+ name: username,
+ },
+ },
+ },
+ updatedAt: true,
+ shortDescription: true,
+ user: {
+ select: { name: true },
+ },
+ _count: {
+ select: {
+ vote: true,
+ comment: true,
+ },
+ },
+ },
+ where: {
+ submission: {
+ some: {
+ isSuccessful: true,
+ user: {
+ name: username,
+ },
+ },
+ },
},
});
-
- if (!user) return notFound();
-
- const challenges = await withUnstableCache({
- fn: getChallengeHistoryByCategory,
- args: ['completed', user.id],
- keys: [`completed-challenges-${user.id}`],
- tags: [createCompletedSubmissionCacheKey(user.id)],
- });
+ const session = await auth();
+ const isOwnProfile = username === session?.user.name;
return (
- <Card className="col-span-4 md:min-h-[calc(100vh_-_56px_-_6rem)]">
- <CardHeader>
- <CardTitle>Completed</CardTitle>
- <CardDescription className="text-muted-foreground mb-4 text-sm">
- Your completed challenges.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <ChallengeHistory challenges={challenges} />
- </CardContent>
- </Card>
+ <div className="mt-8 lg:mt-10">
+ <h1 className="text-muted-foreground text-center text-xl">Completed Challenges</h1>
+ {challenges.length > 0 ? (
+ <Challenges
+ challenges={challenges}
+ isOwnProfile={isOwnProfile}
+ username={username}
+ className="mt-2"
+ />
+ ) : (
+ <Alert className="mx-auto mt-4 w-fit md:px-8">
+ <AlertTitle className="text-center leading-normal">
+ <span>{isOwnProfile ? "You haven't" : `@${username} hasn't`}</span> completed any{' '}
+ challenges yet
+ </AlertTitle>
+ {isOwnProfile ? (
+ <AlertDescription className="flex justify-center">
+ <Link className="text-primary underline-offset-4 hover:underline" href="./explore">
+ Get started with your first challenge
+ </Link>
+ </AlertDescription>
+ ) : null}
+ </Alert>
+ )}
+ </div>
);
}
diff --git a/apps/web/src/app/settings/_components/settings.action.ts b/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.action.ts
similarity index 80%
rename from apps/web/src/app/settings/_components/settings.action.ts
rename to apps/web/src/app/(profile)/[username]/edit/_components/edit-form.action.ts
index accf09bf..0a258f95 100644
--- a/apps/web/src/app/settings/_components/settings.action.ts
+++ b/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.action.ts
@@ -1,26 +1,25 @@
'use server';
import { auth } from '~/server/auth';
-import { revalidatePath } from 'next/cache';
import { prisma } from '@repo/db';
-import type { ProfileSchema } from './schema';
-import { profileSchema } from './schema';
+import { EditFormSchema } from './edit-form.schema';
+import { redirect } from 'next/navigation';
/**
* This will only let you update your own profile
* @param profileData
*/
-export async function updateProfile(profileData: ProfileSchema) {
+export async function updateProfile(profileData: EditFormSchema) {
const session = await auth();
// 1. Checks that the user is logged in
if (!session?.user?.id) return { error: 'unauthorized' };
// 2. test schema validation with zod
- profileSchema.parse(profileData);
+ EditFormSchema.parse(profileData);
// 3. Update the user bio field in the db
- await prisma.user.update({
+ const user = await prisma.user.update({
where: { id: session.user.id },
data: { bio: profileData.bio },
});
@@ -62,7 +61,5 @@ export async function updateProfile(profileData: ProfileSchema) {
}
// do this after we do the shit
- revalidatePath('/settings');
-
- return { success: true };
+ redirect(`/@${user.name}`);
}
diff --git a/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.schema.ts b/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.schema.ts
new file mode 100644
index 00000000..67092f27
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.schema.ts
@@ -0,0 +1,28 @@
+import { z } from 'zod';
+import { createNoProfanitySchemaWithValidate } from '~/utils/antiProfanityZod';
+
+const validUrlWithHttpOrHttps = z.string().refine(
+ (url) => {
+ try {
+ const parsedUrl = new URL(url);
+ return ['https:', 'http:'].includes(parsedUrl.protocol);
+ } catch (error) {
+ return false;
+ }
+ },
+ {
+ message: "URL must have the 'http(s)' protocol",
+ },
+);
+
+export const EditFormSchema = z.object({
+ bio: createNoProfanitySchemaWithValidate((str) => str.max(256)),
+ userLinks: z.array(
+ z.object({
+ url: createNoProfanitySchemaWithValidate((str) => str.url().max(256))
+ .and(validUrlWithHttpOrHttps)
+ .or(z.literal('')),
+ }),
+ ),
+});
+export type EditFormSchema = z.infer<typeof EditFormSchema>;
diff --git a/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.tsx b/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.tsx
new file mode 100644
index 00000000..a00e93cc
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/edit/_components/edit-form.tsx
@@ -0,0 +1,114 @@
+'use client';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { Button } from '@repo/ui/components/button';
+import {
+ Form,
+ FormControl,
+ FormDescription,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from '@repo/ui/components/form';
+import { Separator } from '@repo/ui/components/separator';
+import { Input } from '@repo/ui/components/input';
+import { Textarea } from '@repo/ui/components/textarea';
+import { useFieldArray, useForm } from 'react-hook-form';
+import Link from 'next/link';
+import { cn } from '@repo/ui/cn';
+import { EditFormSchema } from './edit-form.schema';
+import { updateProfile } from './edit-form.action';
+import { toast } from '@repo/ui/components/use-toast';
+
+export function EditForm(props: {
+ className?: string;
+ user: {
+ id: string;
+ bio: string;
+ userLinks: { url: string }[];
+ };
+}) {
+ const form = useForm<EditFormSchema>({
+ resolver: zodResolver(EditFormSchema),
+ defaultValues: {
+ ...props.user,
+ userLinks: [
+ ...props.user.userLinks,
+ ...Array.from({ length: 4 - props.user.userLinks.length }).map(() => ({ url: '' })),
+ ],
+ },
+ mode: 'onTouched',
+ });
+ const userLinksField = useFieldArray({
+ control: form.control,
+ name: 'userLinks',
+ });
+ console.log(userLinksField.fields);
+
+ async function onSubmit(data: EditFormSchema) {
+ try {
+ await updateProfile(data);
+ toast({
+ title: 'Profile updated',
+ description: 'Your profile has been successfully updated !',
+ variant: 'success',
+ });
+ } catch (error) {
+ toast({
+ title: 'Could not update profile',
+ variant: 'destructive',
+ });
+ }
+ }
+
+ return (
+ <Form {...form}>
+ <form
+ onSubmit={form.handleSubmit(onSubmit)}
+ className={cn('flex max-w-sm flex-col lg:max-w-full', props.className)}
+ >
+ <FormField
+ control={form.control}
+ name="bio"
+ render={({ field }) => (
+ <FormItem className="flex max-w-sm flex-col lg:max-w-full lg:flex-row lg:items-center lg:justify-between ">
+ <FormLabel className="w-32">Bio</FormLabel>
+ <div className="max-w-sm grow space-y-2 lg:mx-auto lg:max-w-md">
+ <FormControl>
+ <Textarea {...field} placeholder="Tell others a bit about yourself..." rows={4} />
+ </FormControl>
+ <FormDescription>{form.getValues().bio.length} / 256 characters</FormDescription>
+ <FormMessage />
+ </div>
+ </FormItem>
+ )}
+ />
+
+ <Separator />
+ <FormItem className="flex max-w-sm flex-col lg:max-w-full lg:flex-row lg:items-center lg:justify-between ">
+ <FormLabel className="w-32">User Links</FormLabel>
+ <div className="max-w-sm grow space-y-2 lg:mx-auto lg:max-w-md">
+ {userLinksField.fields.map((field, i) => (
+ <div key={i}>
+ <FormControl>
+ <Input
+ {...form.register(`userLinks.${i}.url`)}
+ defaultValue={field.url}
+ placeholder="https://"
+ />
+ </FormControl>
+ <FormMessage>{form.formState.errors.userLinks?.[i]?.url?.message}</FormMessage>
+ </div>
+ ))}
+ </div>
+ </FormItem>
+ <div className="space-x-2 self-end">
+ <Button variant="outline">
+ <Link href=".">Cancel</Link>
+ </Button>
+ <Button type="submit">Update Profile</Button>
+ </div>
+ </form>
+ </Form>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/edit/page.tsx b/apps/web/src/app/(profile)/[username]/edit/page.tsx
new file mode 100644
index 00000000..38065334
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/edit/page.tsx
@@ -0,0 +1,32 @@
+import { notFound } from 'next/navigation';
+import { EditForm } from './_components/edit-form';
+import { prisma } from '@repo/db';
+
+export default async function EditPage(props: { params: { username: string } }) {
+ const [, username] = decodeURIComponent(props.params.username).split('@');
+ if (username === undefined) {
+ notFound();
+ }
+ const user = await prisma.user.findFirstOrThrow({
+ where: {
+ name: username,
+ },
+ select: {
+ id: true,
+ bio: true,
+ userLinks: {
+ orderBy: {
+ url: 'desc',
+ },
+ },
+ },
+ });
+ return (
+ <div className="container mx-auto pt-8 lg:pt-10">
+ <h1 className="text-muted-foreground text-lg">Update Profile</h1>
+ <div className="mt-4">
+ <EditForm className="space-y-6" user={user} />
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/in-progress/loading.tsx b/apps/web/src/app/(profile)/[username]/in-progress/loading.tsx
deleted file mode 100644
index b63146bf..00000000
--- a/apps/web/src/app/(profile)/[username]/in-progress/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { TableSkeleton as default } from '../_components/profile-skeleton';
diff --git a/apps/web/src/app/(profile)/[username]/in-progress/page.tsx b/apps/web/src/app/(profile)/[username]/in-progress/page.tsx
deleted file mode 100644
index cfe24700..00000000
--- a/apps/web/src/app/(profile)/[username]/in-progress/page.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { prisma } from '@repo/db';
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from '@repo/ui/components/card';
-import { notFound } from 'next/navigation';
-import { createInProgressSubmissionCacheKey } from '~/app/challenge/[slug]/submissions/[[...catchAll]]/cache-keys';
-import { withUnstableCache } from '~/utils/withUnstableCache';
-import { getChallengeHistoryByCategory } from '../_components/dashboard/_actions';
-import ChallengeHistory from '../_components/dashboard/challenge-history';
-import { auth } from '~/server/auth';
-
-interface Props {
- params: {
- username: string;
- };
-}
-
-export default async function InProgressPage({ params: { username: usernameFromQuery } }: Props) {
- const session = await auth();
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
-
- if (!username || session?.user?.name !== username) return notFound();
-
- const user = await prisma.user.findFirst({
- where: {
- name: {
- equals: username,
- },
- },
- select: {
- id: true,
- },
- });
-
- if (!user) return notFound();
-
- const challenges = await withUnstableCache({
- fn: getChallengeHistoryByCategory,
- args: ['in-progress', user.id],
- keys: [`in-progress-challenges-${user.id}`],
- tags: [createInProgressSubmissionCacheKey(user.id)],
- });
-
- return (
- <Card className="col-span-4 md:min-h-[calc(100vh_-_56px_-_6rem)]">
- <CardHeader>
- <CardTitle>In-Progress</CardTitle>
- <CardDescription className="text-muted-foreground mb-4 text-sm">
- Your in-progress challenges.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <ChallengeHistory challenges={challenges} />
- </CardContent>
- </Card>
- );
-}
diff --git a/apps/web/src/app/(profile)/[username]/layout.tsx b/apps/web/src/app/(profile)/[username]/layout.tsx
index 826df057..90be1994 100644
--- a/apps/web/src/app/(profile)/[username]/layout.tsx
+++ b/apps/web/src/app/(profile)/[username]/layout.tsx
@@ -1,11 +1,11 @@
-import { Profile } from './_components/profile';
+import { Footsies } from '~/components/footsies';
-export default async function LayoutProfile({
- children,
- params: { username },
-}: {
- children: React.ReactNode;
- params: { username: string };
-}) {
- return <Profile username={username}>{children}</Profile>;
+export default function LayoutPage(props: { children: React.ReactElement }) {
+ return (
+ <div className="flex h-full flex-col">
+ <div className="container grow pb-8 md:mx-auto">{props.children}</div>
+
+ <Footsies />
+ </div>
+ );
}
diff --git a/apps/web/src/app/(profile)/[username]/loading.tsx b/apps/web/src/app/(profile)/[username]/loading.tsx
deleted file mode 100644
index 156b3eef..00000000
--- a/apps/web/src/app/(profile)/[username]/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { PageContentSkeleton as default } from './_components/profile-skeleton';
diff --git a/apps/web/src/app/(profile)/[username]/page.tsx b/apps/web/src/app/(profile)/[username]/page.tsx
index 8f4c73e7..4070352a 100644
--- a/apps/web/src/app/(profile)/[username]/page.tsx
+++ b/apps/web/src/app/(profile)/[username]/page.tsx
@@ -1,74 +1,332 @@
-import { buildMetaForDefault, buildMetaForUser } from '~/app/metadata';
import { prisma } from '@repo/db';
-import { OverviewTab } from './_components/dashboard/overview-tab';
import { notFound } from 'next/navigation';
-import { getRelativeTimeStrict } from '~/utils/relativeTime';
-
-interface Props {
- params: {
- username: string;
- };
-}
-
-export default async function Page({ params: { username: usernameFromQuery } }: Props) {
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
-
- if (!username) return notFound();
+import { ProgressChart } from './_components/progress-chart';
+import { SharedSolutionCard } from './_components/shared-solution-card';
+import { Button } from '@repo/ui/components/button';
+import { ArrowUpRight, UserPen } from '@repo/ui/icons';
+import Link from 'next/link';
+import { ActivityChart } from './_components/activity-chart';
+import { cn } from '@repo/ui/cn';
+import { Avatar, AvatarImage, AvatarFallback } from '@repo/ui/components/avatar';
+import { Titles } from '~/app/challenge/_components/comments/enhanced-user-badge';
+import {
+ getTitles,
+ getGradient,
+} from '~/app/challenge/_components/comments/enhanced-user-badge.getTitles';
+import { getRelativeTime } from '~/utils/relativeTime';
+import { CardContent, CardHeader } from '@repo/ui/components/card';
+import { Badges, EmptyBadge } from './_components/badges';
+import { CardWithRadialBg } from './_components/card-radial-bg';
+import { MovingGrid } from './_components/moving-grid';
+import { getBadges, getProgressData, getUserActivity } from './user-info';
+import { auth } from '~/server/auth';
+import { MagicIcon } from '@repo/ui/components/magic-icon';
+/* const sampleBadgeData = [
+ { slug: 'aot-2023-bronze', name: 'Advent of TypeScript 2023 Bronze' },
+ { slug: 'aot-2023-silver', name: 'Advent of TypeScript 2023 Bronze' },
+ { slug: 'aot-2023-gold', name: 'Advent of TypeScript 2023 Bronze' },
+ { slug: 'aot-2023-platinum', name: 'Advent of TypeScript 2023 Bronze' },
+] as BadgeInfo[]; */
+export default async function ProfilePage(props: { params: { username: string } }) {
+ const [, username] = decodeURIComponent(props.params.username).split('@');
+ if (username === undefined) {
+ notFound();
+ }
const user = await prisma.user.findFirst({
where: {
- name: {
- equals: username,
- },
+ name: username,
},
select: {
id: true,
- createdAt: true,
bio: true,
- image: true,
name: true,
+ image: true,
+ roles: true,
+ createdAt: true,
userLinks: true,
+ sharedSolution: {
+ take: 3,
+ orderBy: [{ isPinned: 'desc' }, { createdAt: 'desc' }],
+ select: {
+ id: true,
+ _count: {
+ select: {
+ vote: true,
+ solutionComment: true,
+ },
+ },
+ isPinned: true,
+ challenge: {
+ select: {
+ name: true,
+ slug: true,
+ difficulty: true,
+ },
+ },
+ },
+ },
},
});
+ if (user === null) {
+ notFound();
+ }
+ const badges = await getBadges(user.id);
+ const titles = getTitles(user.roles);
+ const gradient = getGradient(user.roles);
+ const progressData = await getProgressData(user.id);
+ const activityData = await getUserActivity(user.id);
+ // TODO: Change form to prevent it from adding empty links?
+ const userLinks = user.userLinks.filter((u) => u.url !== '');
- if (!user) return notFound();
- return <OverviewTab user={user} />;
-}
+ const session = await auth();
+ const isOwnProfile = session?.user?.id === user.id;
+ return (
+ <div className="px-2 pt-8 lg:px-0 lg:pt-10">
+ {/* MobileView */}
+ <div className="flex flex-col space-y-6 lg:hidden">
+ <div className="flex flex-col items-center space-y-2">
+ <Avatar className="h-56 w-56 rounded-lg transition group-hover:-translate-x-1 group-hover:-translate-y-1 group-hover:-rotate-1">
+ <AvatarImage src={user.image ?? ''} alt={`${user.name} profile picture`} />
+ <AvatarFallback className="rounded-lg capitalize">
+ {user.name.slice(0, 1)}
+ </AvatarFallback>
+ </Avatar>
+ <div className="flex flex-col items-center space-y-1">
+ <h1
+ className={cn(
+ 'bg-gradient-to-r bg-clip-text text-3xl font-bold text-transparent',
+ gradient,
+ )}
+ >
+ {user.name}
+ </h1>
+ {isOwnProfile ? (
+ <Link
+ href={`/@${encodeURIComponent(username)}/edit`}
+ className="text-muted-foreground/80 hover:text-foreground flex items-center p-2 transition-colors"
+ >
+ <UserPen className="h-5 w-5 " />
+ </Link>
+ ) : null}
+ <Titles data={titles} />
+ <h2 className="text-muted-foreground text-sm tracking-tight">
+ Joined {getRelativeTime(user.createdAt)}
+ </h2>
+ <div className="flex flex-row space-x-1">
+ {userLinks.map((link) => (
+ <Link key={link.id} className="group p-2" href={link.url}>
+ <MagicIcon
+ url={link.url}
+ className="text-foreground/80 group-hover:text-foreground h-5 w-5 transition-colors"
+ />
+ </Link>
+ ))}
+ </div>
+ {user.bio === '' && isOwnProfile ? (
+ <div className="flex flex-col justify-center">
+ <h1 className="text-center">
+ You haven’t added a bio yet—tell others a bit about yourself !
+ </h1>
+ <Button asChild variant="link" className="text-center" size="sm">
+ <Link href={`/@${encodeURIComponent(username)}/edit`}>Update your bio</Link>
+ </Button>
+ </div>
+ ) : (
+ <div className="max-w-[60ch]">
+ <p className="text-center tracking-tighter ">{user.bio}</p>
+ </div>
+ )}
+ </div>
+ </div>
+ <div>
+ <ProgressChart
+ totalCompleted={progressData.totalSolved}
+ chartData={progressData.chartData}
+ totalChallenges={progressData.totalChallenges}
+ allCompletedHref={`/@${encodeURIComponent(username)}/completed`}
+ />
+ </div>
+ </div>
-export async function generateMetadata({ params: { username: usernameFromQuery } }: Props) {
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
+ {/* Desktop View */}
+ <MovingGrid className="hidden lg:block">
+ <div className="relative flex flex-row flex-wrap items-start justify-between">
+ <div className="flex h-full max-w-full flex-col justify-center space-y-3 lg:max-w-[50%]">
+ <div className="flex flex-row items-end space-x-4">
+ <Avatar className="z-10 h-56 w-56 rounded-lg transition group-hover:-translate-x-1 group-hover:-translate-y-1 group-hover:-rotate-1">
+ <AvatarImage src={user.image ?? ''} alt={`${user.name} profile picture`} />
+ <AvatarFallback className="rounded-lg capitalize">
+ {user.name.slice(0, 1)}
+ </AvatarFallback>
+ </Avatar>
+ <div className="ml-56 flex flex-col space-y-2">
+ <div className="flex flex-row items-baseline space-x-2">
+ <h1
+ className={cn(
+ 'bg-gradient-to-r bg-clip-text text-3xl font-bold text-transparent',
+ gradient,
+ )}
+ >
+ {user.name}
+ </h1>
+ {isOwnProfile ? (
+ <Link
+ href={`/@${encodeURIComponent(username)}/edit`}
+ className="text-muted-foreground/80 hover:text-foreground flex h-6 items-end px-1 transition-colors"
+ >
+ <UserPen className="h-4 w-4 " />
+ </Link>
+ ) : null}
+ </div>
+ <Titles data={titles} />
+ <h2 className="text-muted-foreground text-sm tracking-tight">
+ Joined {getRelativeTime(user.createdAt)}
+ </h2>
+ <div className="flex flex-row space-x-1">
+ {userLinks.map((link) => (
+ <Link key={link.id} className="group p-2" href={link.url}>
+ <MagicIcon
+ url={link.url}
+ className="text-foreground/60 group-hover:text-foreground h-7 w-7 transition-colors"
+ />
+ </Link>
+ ))}
+ </div>
+ </div>
+ </div>
+ {user.bio === '' && isOwnProfile ? (
+ <div className="p-4">
+ <h1>You haven’t added a bio yet—tell others a bit about yourself !</h1>
+ <Button asChild variant="link" className="px-0 " size="sm">
+ <Link href={`/@${encodeURIComponent(username)}/edit`}>Update your bio</Link>
+ </Button>
+ </div>
+ ) : (
+ <div className="max-w-[60ch]">
+ <p className="leading-7 tracking-tight">{user.bio}</p>
+ </div>
+ )}
+ </div>
- if (!username) return {};
+ <div className="h-fit max-w-[50%] items-center">
+ <ProgressChart
+ totalCompleted={progressData.totalSolved}
+ chartData={progressData.chartData}
+ totalChallenges={progressData.totalChallenges}
+ allCompletedHref={`/@${encodeURIComponent(username)}/completed`}
+ />
+ </div>
+ </div>
+ </MovingGrid>
- const user = await prisma.user.findFirst({
- where: {
- name: {
- equals: username,
- },
- },
- select: {
- id: true,
- createdAt: true,
- bio: true,
- image: true,
- name: true,
- },
- });
+ <div className="mt-6 flex flex-wrap justify-center gap-5 lg:mt-8">
+ <CardWithRadialBg className="min-h-[200px] max-w-sm basis-full md:basis-1/2 lg:basis-1/3">
+ <div className="flex h-full flex-col">
+ <CardHeader>
+ <Button
+ asChild
+ size="xs"
+ variant="link"
+ className="text-muted-foreground hover:text-primary w-fit text-lg "
+ >
+ <Link href={`/@${encodeURIComponent(username)}/shared-solutions`}>
+ Shared Solutions
+ <ArrowUpRight className="ml-1 h-4 w-4 " />
+ </Link>
+ </Button>
+ </CardHeader>
- const avatar = user && user.image ? user.image : '';
- const date = user?.createdAt!;
- const dateSince = getRelativeTimeStrict(date);
+ {user.sharedSolution.length === 0 ? (
+ <CardContent className="flex h-full grow flex-col items-center justify-center space-y-3 lg:px-16">
+ <h1 className="text-center">
+ {isOwnProfile
+ ? "It looks like you haven't shared any solutions yet."
+ : `It looks like @${username} hasn't shared any solutions yet.`}
+ </h1>
+ {isOwnProfile ? (
+ <Button asChild variant="link" className="text-center">
+ <Link href={`/@${encodeURIComponent(username)}/completed`}>
+ Explore your completed solutions and share your own!
+ </Link>
+ </Button>
+ ) : null}
+ </CardContent>
+ ) : (
+ <CardContent className="pointer-events-auto flex flex-col space-y-2">
+ {user.sharedSolution.map((s) => (
+ <Link
+ href={`/challenge/${encodeURIComponent(s.challenge?.slug ?? '')}/solutions/${
+ s.id
+ }`}
+ key={s.id}
+ >
+ <SharedSolutionCard
+ solution={{
+ isPinned: s.isPinned,
+ voteCount: s._count.vote,
+ commentCount: s._count.solutionComment,
+ challenge: {
+ name: s.challenge?.name ?? '',
+ difficulty: s.challenge?.difficulty ?? 'EASY',
+ },
+ }}
+ />
+ </Link>
+ ))}
+ </CardContent>
+ )}
+ </div>
+ </CardWithRadialBg>
- if (username)
- return buildMetaForUser({
- username,
- title: `${username}'s profile | TypeHero`,
- description: `View the profile of ${username} on TypeHero.`,
- avatar,
- dateSince,
- });
- return buildMetaForDefault({
- title: 'Profile | TypeHero',
- description: 'View the profile of a user on TypeHero.',
- });
+ <CardWithRadialBg className="max-w-sm basis-full md:basis-1/2 lg:basis-1/3">
+ <div className="flex h-full flex-col">
+ <CardHeader>
+ <h1 className="text-muted-foreground pl-2 text-lg tracking-wide">Badges</h1>
+ </CardHeader>
+ {badges.length === 0 ? (
+ <CardContent className="flex h-full w-full grow flex-col items-center justify-center space-y-3 lg:px-16">
+ <h1 className="text-center md:px-4 lg:px-2">
+ {isOwnProfile
+ ? "You haven't earned a badge yet - keep going, you're close!"
+ : `@${username} is yet to discover an achievement`}
+ </h1>
+ <div className="mx-auto grid w-fit grid-cols-3 gap-4 ">
+ {Array.from({ length: 6 }).map((i) => (
+ <EmptyBadge key={`empty-badge-${i}`} />
+ ))}
+ </div>
+ </CardContent>
+ ) : (
+ <CardContent>
+ <Badges data={badges} />
+ </CardContent>
+ )}
+ </div>
+ </CardWithRadialBg>
+
+ <CardWithRadialBg className="h-fit max-w-sm basis-full md:basis-1/2 lg:basis-1/3">
+ <CardHeader>
+ <h1 className="text-muted-foreground pl-2 text-lg tracking-wide">Recent Activity</h1>
+ </CardHeader>
+ <CardContent className="flex flex-col justify-center">
+ <ActivityChart data={activityData} />
+ </CardContent>
+ </CardWithRadialBg>
+ </div>
+ </div>
+ );
}
+
+/* To be used when we have stats in the future */
+/* function StatCard(props: { title: string; data: string; secondaryData?: string }) {
+ return (
+ <div className="space-y-0.5">
+ <h1 className="text-muted-foreground tracking-tight">{props.title}</h1>
+ <div className="flex flex-row items-baseline space-x-1.5">
+ <p className="text-4xl font-bold">{props.data}</p>
+ {props.secondaryData !== undefined ? <p>{props.secondaryData}</p> : null}
+ </div>
+ </div>
+ );
+} */
diff --git a/apps/web/src/app/(profile)/[username]/shared-solutions/_components/SharedSolutions.tsx b/apps/web/src/app/(profile)/[username]/shared-solutions/_components/SharedSolutions.tsx
new file mode 100644
index 00000000..3ab4b3de
--- /dev/null
+++ b/apps/web/src/app/(profile)/[username]/shared-solutions/_components/SharedSolutions.tsx
@@ -0,0 +1,73 @@
+'use client';
+import { useState } from 'react';
+import {
+ SharedSolutionCard,
+ type SharedSolutionCardProps,
+} from '../../_components/shared-solution-card';
+import {
+ DIFFICULTY_COLOR_MAP,
+ FilterBar,
+ type FilterOptions,
+} from '../../completed/_components/filter-bar';
+import { cn } from '@repo/ui/cn';
+
+import { Alert, AlertDescription, AlertTitle } from '@repo/ui/components/alert';
+import { Button } from '@repo/ui/components/button';
+import Link from 'next/link';
+
+export function SharedSolutions(props: {
+ solutions: (SharedSolutionCardProps['solution'] & { id: number; challenge: { slug: string } })[];
+ className?: string;
+ isOwnProfile: boolean;
+ username: string;
+}) {
+ const [filter, setFilter] = useState<FilterOptions>('ALL');
+ /*TODO: Can be optimized by sending the data, pregrouped from the backend*/
+ const filteredChallenges = props.solutions.filter((c) => {
+ if (filter === 'ALL') return true;
+ return c.challenge.difficulty === filter;
+ });
+ return (
+ <div className={cn('flex flex-col justify-center space-y-8', props.className)}>
+ <FilterBar filter={filter} setFilter={setFilter} />
+
+ {filteredChallenges.length === 0 ? (
+ <Alert className="mx-auto w-fit md:px-8">
+ <AlertTitle className="text-center leading-normal">
+ <span>{props.isOwnProfile ? "You haven't" : `@${props.username} hasn't`}</span>{' '}
+ completed any{' '}
+ <span
+ className="lowercase"
+ style={{
+ color: `hsl(${DIFFICULTY_COLOR_MAP[filter]})`,
+ }}
+ >
+ {filter}
+ </span>{' '}
+ challenges yet
+ </AlertTitle>
+ {props.isOwnProfile ? (
+ <AlertDescription className="flex justify-center">
+ <Button variant="link" size="sm">
+ <Link href={`/explore/${filter.toLowerCase()}`}>
+ Get started with your first <span className="lowercase">{filter}</span> challenge
+ </Link>
+ </Button>
+ </AlertDescription>
+ ) : null}
+ </Alert>
+ ) : null}
+
+ <div className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3">
+ {filteredChallenges.map((s) => (
+ <Link
+ href={`/challenge/${encodeURIComponent(s.challenge.slug)}/solutions/${s.id}`}
+ key={s.challenge.name}
+ >
+ <SharedSolutionCard solution={s} />
+ </Link>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/(profile)/[username]/shared-solutions/_components/shared-solutions-columns.tsx b/apps/web/src/app/(profile)/[username]/shared-solutions/_components/shared-solutions-columns.tsx
deleted file mode 100644
index 1ad9e65b..00000000
--- a/apps/web/src/app/(profile)/[username]/shared-solutions/_components/shared-solutions-columns.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-'use client';
-
-import { type ColumnDef } from '@tanstack/react-table';
-import { getRelativeTimeStrict } from '~/utils/relativeTime';
-import Link from 'next/link';
-import type { SharedSolution } from '../page';
-
-export const sharedSolutionsColumns: ColumnDef<SharedSolution>[] = [
- {
- accessorKey: 'title',
- header: 'Title',
- cell: ({ row }) => (
- <Link
- className="underline"
- href={`/challenge/${row.original.challenge?.slug}/solutions/${row.original.id}`}
- >
- {row.original.title}
- </Link>
- ),
- },
- {
- accessorFn: (solution) => solution.challenge?.name,
- header: 'Challenge',
- cell: ({ row }) => (
- <Link className="underline" href={`/challenge/${row.original.challenge?.slug}`}>
- {row.original.challenge?.name}
- </Link>
- ),
- },
- {
- accessorFn: (solution) => solution._count.vote,
- header: 'Votes',
- },
- {
- accessorKey: 'createdAt',
- header: 'Date',
- cell: ({ row }) => getRelativeTimeStrict(row.original.createdAt),
- },
-];
diff --git a/apps/web/src/app/(profile)/[username]/shared-solutions/loading.tsx b/apps/web/src/app/(profile)/[username]/shared-solutions/loading.tsx
deleted file mode 100644
index b63146bf..00000000
--- a/apps/web/src/app/(profile)/[username]/shared-solutions/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { TableSkeleton as default } from '../_components/profile-skeleton';
diff --git a/apps/web/src/app/(profile)/[username]/shared-solutions/page.tsx b/apps/web/src/app/(profile)/[username]/shared-solutions/page.tsx
index f0523c30..9afb0587 100644
--- a/apps/web/src/app/(profile)/[username]/shared-solutions/page.tsx
+++ b/apps/web/src/app/(profile)/[username]/shared-solutions/page.tsx
@@ -1,93 +1,79 @@
import { prisma } from '@repo/db';
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from '@repo/ui/components/card';
-import { DataTable } from '@repo/ui/components/data-table';
import { notFound } from 'next/navigation';
-import { withUnstableCache } from '~/utils/withUnstableCache';
-import { createCacheKeyForSharedSolutionsTab } from '../../../challenge/[slug]/solutions/_components/_actions';
-import { sharedSolutionsColumns } from './_components/shared-solutions-columns';
+import { SharedSolutions } from './_components/SharedSolutions';
+import { Alert, AlertDescription, AlertTitle } from '@repo/ui/components/alert';
+import Link from 'next/link';
import { auth } from '~/server/auth';
-interface Props {
- params: {
- username: string;
- };
-}
-
-export default async function SharedSolutionsPage({
- params: { username: usernameFromQuery },
-}: Props) {
- const [, username] = decodeURIComponent(usernameFromQuery).split('@');
-
- if (!username) return notFound();
-
- const user = await prisma.user.findFirst({
- where: {
- name: {
- equals: username,
- },
- },
+export default async function SharedSolutionPage(props: { params: { username: string } }) {
+ const [, username] = decodeURIComponent(props.params.username).split('@');
+ if (username === undefined) {
+ notFound();
+ }
+ const sharedSolutions = await prisma.sharedSolution.findMany({
select: {
id: true,
- name: true,
- },
- });
-
- if (!user) return notFound();
-
- const solutions = await withUnstableCache({
- fn: getSharedSolutions,
- args: [user.id],
- keys: [`shared-solutions`],
- tags: [createCacheKeyForSharedSolutionsTab(user.id)],
- });
-
- const session = await auth();
- const isOwnProfile = session?.user?.id === user.id;
-
- return (
- <Card className="col-span-4 md:min-h-[calc(100vh_-_56px_-_6rem)]">
- <CardHeader>
- <CardTitle>Shared Solutions</CardTitle>
- <CardDescription className="text-muted-foreground mb-4 text-sm">
- {isOwnProfile ? 'Your' : `${user.name}'s`} shared challenge solutions.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <DataTable data={solutions} columns={sharedSolutionsColumns} />
- </CardContent>
- </Card>
- );
-}
-
-export type SharedSolutions = Awaited<ReturnType<typeof getSharedSolutions>>;
-export type SharedSolution = SharedSolutions[0];
-async function getSharedSolutions(userId: string) {
- return await prisma.sharedSolution.findMany({
- where: {
- userId,
- },
- orderBy: {
- createdAt: 'desc',
- },
- include: {
- _count: {
+ isPinned: true,
+ challenge: {
select: {
- vote: true,
+ difficulty: true,
+ name: true,
+ slug: true,
},
},
- challenge: {
+ _count: {
select: {
- id: true,
- slug: true,
- name: true,
+ vote: true,
+ solutionComment: true,
},
},
},
+ where: {
+ user: {
+ name: username,
+ },
+ },
});
+ const solutions = sharedSolutions.map((s) => ({
+ id: s.id,
+ commentCount: s._count.solutionComment,
+ voteCount: s._count.vote,
+ isPinned: s.isPinned,
+ challenge: {
+ difficulty: s.challenge?.difficulty ?? 'BEGINNER',
+ name: s.challenge?.name ?? '',
+ slug: s.challenge?.slug ?? '',
+ },
+ }));
+
+ const session = await auth();
+ const isOwnProfile = username === session?.user.name;
+
+ return (
+ <div className="mt-8 lg:mt-10">
+ <h1 className="text-muted-foreground text-center text-xl">Shared Solutions</h1>
+ {solutions.length > 0 ? (
+ <SharedSolutions
+ solutions={solutions}
+ className="mt-2"
+ isOwnProfile={isOwnProfile}
+ username={username}
+ />
+ ) : (
+ <Alert className="mx-auto mt-4 w-fit md:px-8">
+ <AlertTitle className="text-center leading-normal">
+ <span>{isOwnProfile ? "You haven't" : `@${username} hasn't`}</span> shared any{' '}
+ challenges yet
+ </AlertTitle>
+ {isOwnProfile ? (
+ <AlertDescription className="flex justify-center">
+ <Link className="text-primary underline-offset-4 hover:underline" href="./completed">
+ Explore your completed solutions and share your own!
+ </Link>
+ </AlertDescription>
+ ) : null}
+ </Alert>
+ )}
+ </div>
+ );
}
diff --git a/apps/web/src/app/(profile)/[username]/_components/dashboard/_actions.ts b/apps/web/src/app/(profile)/[username]/user-info.ts
similarity index 59%
rename from apps/web/src/app/(profile)/[username]/_components/dashboard/_actions.ts
rename to apps/web/src/app/(profile)/[username]/user-info.ts
index e6d6349e..751f17c7 100644
--- a/apps/web/src/app/(profile)/[username]/_components/dashboard/_actions.ts
+++ b/apps/web/src/app/(profile)/[username]/user-info.ts
@@ -1,75 +1,18 @@
-'use server';
-
import { prisma } from '@repo/db';
-import type { DIFFICULTIES } from './challenges-progress';
-
-export type HistoricalChallenge = Awaited<ReturnType<typeof getChallengeHistoryByCategory>>[0];
-
-type HistoryType = 'completed' | 'in-progress';
-const getPredicateByType = (type: HistoryType, userId: string) => {
- switch (type) {
- case 'in-progress':
- return {
- AND: [
- {
- submission: {
- none: {
- userId,
- isSuccessful: true,
- },
- },
- },
- // Make sure there is at least one submission
- { submission: { some: { userId, isSuccessful: false } } },
- ],
- };
- case 'completed':
- return {
- submission: {
- some: {
- userId,
- isSuccessful: true,
- },
- },
- };
- }
-};
-
-export async function getChallengeHistoryByCategory(type: HistoryType, userId: string) {
- const challenges = await prisma.challenge.findMany({
- where: getPredicateByType(type, userId),
- select: {
- id: true,
- slug: true,
- name: true,
- submission: {
- where: {
- userId,
- },
- orderBy: {
- createdAt: 'desc',
- },
- take: 1,
- select: {
- createdAt: true,
- },
- },
- },
- });
-
- return challenges
- .map((challenge) => ({
- ...challenge,
- submissionDate: challenge.submission[0]?.createdAt,
- }))
- .sort(
- (challengeA, challengeB) =>
- new Date(challengeB.submissionDate!).getTime() -
- new Date(challengeA.submissionDate!).getTime(),
- );
-}
-
-export async function getSolvedChallenges(userId: string) {
+import type { Difficulty as DifficultyWithEvent } from '@repo/db/types';
+import {
+ eachDayOfInterval,
+ getDay,
+ getMonth,
+ getWeek,
+ isSameDay,
+ startOfWeek,
+ subDays,
+} from 'date-fns';
+
+type Difficulty = Exclude<DifficultyWithEvent, 'EVENT'>;
+
+export async function getProgressData(userId: string) {
// Get all successful submissions for the user
const successfulSubmissions = await prisma.submission.findMany({
where: {
@@ -120,53 +63,84 @@ export async function getSolvedChallenges(userId: string) {
// Calculate percentage, total solved and total challenges
const totalSolved = challengesSolved.reduce((acc, challenge) => acc + challenge._count._all, 0);
const totalChallenges = allChallenges.reduce((acc, challenge) => acc + challenge._count._all, 0);
- const percentage = ((totalSolved / totalChallenges) * 100).toFixed(1);
-
- const challenges: Record<
- (typeof DIFFICULTIES)[number],
- {
- solved: number;
- total: number;
- }
- > = {
- BEGINNER: {
- solved: 0,
- total: 0,
- },
- EASY: {
- solved: 0,
- total: 0,
- },
- MEDIUM: {
- solved: 0,
- total: 0,
- },
- HARD: {
- solved: 0,
- total: 0,
- },
- EXTREME: {
- solved: 0,
- total: 0,
- },
- };
+
+ const chartData: {
+ difficulty: Difficulty;
+ completedPercentage: number;
+ completed: number;
+ fill: string;
+ total: number;
+ }[] = [];
// assign values to the challenges object
allChallenges.forEach((challenge) => {
- const difficulty = challenge.difficulty as (typeof DIFFICULTIES)[number];
- challenges[difficulty].total = challenge._count._all;
- challenges[difficulty].solved =
- challengesSolved.find((challenge) => challenge.difficulty === difficulty)?._count._all ?? 0;
+ const solved =
+ challengesSolved.find((solvedC) => solvedC.difficulty === challenge.difficulty)?._count
+ ._all ?? 0;
+
+ chartData.push({
+ difficulty: challenge.difficulty as Difficulty,
+ completed: solved,
+ completedPercentage: Math.round((solved / challenge._count._all) * 100),
+ fill: `var(--color-${challenge.difficulty})`,
+ total: challenge._count._all,
+ });
});
-
+ const difficultyOrder = ['BEGINNER', 'EASY', 'MEDIUM', 'HARD', 'EXTREME'] as const;
+ chartData.sort(
+ (a, b) => difficultyOrder.indexOf(a.difficulty) - difficultyOrder.indexOf(b.difficulty),
+ );
+ console.log({ totalChallenges });
return {
- challenges,
+ chartData,
totalSolved,
totalChallenges,
- percentage,
};
}
+export async function getUserActivity(userId: string) {
+ const endDate = new Date();
+ const startDate = startOfWeek(subDays(endDate, 60), { weekStartsOn: 0 });
+
+ const user = await prisma.user.findFirstOrThrow({
+ where: { id: userId },
+ select: {
+ submission: {
+ where: {
+ createdAt: {
+ gte: startDate,
+ },
+ },
+ },
+ comment: {
+ where: {
+ createdAt: {
+ gte: startDate,
+ },
+ },
+ },
+ },
+ });
+ const days = eachDayOfInterval({ start: startDate, end: endDate }).map((date) => {
+ const comments = user.comment.filter((c) => isSameDay(c.createdAt, date)).length;
+ const badges = 0;
+ const submissions = user.submission.filter((s) => isSameDay(s.createdAt, date)).length;
+ const activity = comments + badges + submissions;
+ return {
+ date,
+ day: getDay(date),
+ week: getWeek(date),
+ month: getMonth(date),
+ submissions,
+ comments,
+ badges,
+ activity,
+ };
+ });
+
+ return days;
+}
+
export interface BadgeInfo {
// eslint-disable-next-line @typescript-eslint/sort-type-constituents
slug: 'aot-2023-bronze' | 'aot-2023-silver' | 'aot-2023-gold' | 'aot-2023-platinum';
diff --git a/apps/web/src/app/aot-2023/_components/about.tsx b/apps/web/src/app/aot-2023/_components/about.tsx
index d5bccf06..1017d9e8 100644
--- a/apps/web/src/app/aot-2023/_components/about.tsx
+++ b/apps/web/src/app/aot-2023/_components/about.tsx
@@ -15,7 +15,7 @@ import {
HolidaySilverBadge,
HolidayGoldBadge,
HolidayPlatinumBadge,
-} from '../../(profile)/[username]/_components/badges/aot-2023-badge';
+} from '~/app/(profile)/[username]/_components/aot-badges/aot-2023-badge';
export function About({ className }: { className?: string }) {
return (
diff --git a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getProfileData.ts b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getProfileData.ts
index 63a1daef..06b03782 100644
--- a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getProfileData.ts
+++ b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getProfileData.ts
@@ -1,8 +1,8 @@
'use server';
import { prisma } from '@repo/db';
-import { getBadges } from '~/app/(profile)/[username]/_components/dashboard/_actions';
import { getTitles } from './enhanced-user-badge.getTitles';
+import { getBadges } from '~/app/(profile)/[username]/user-info';
export async function getProfileData(username: string) {
const user = await prisma.user.findFirstOrThrow({
diff --git a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts
index cf1057d1..f1c9353c 100644
--- a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts
+++ b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts
@@ -26,3 +26,22 @@ export function getTitles(roles: Role[]) {
}
return flairs;
}
+
+const TITLE_TO_CLASSNAME: Record<TitleInfo['type'], string> = {
+ admin: 'bg-gradient-to-r from-rose-400 to-orange-500 dark:from-rose-400 dark:to-orange-300',
+ contributor: 'bg-gradient-to-r from-sky-400 to-cyan-600 dark:from-sky-400 dark:to-cyan-300',
+ supporter:
+ 'bg-gradient-to-r from-emerald-500 to-emerald-600 dark:from-emerald-200 dark:to-emerald-500',
+};
+export function getGradient(roles: Role[]) {
+ if (roles.find((r) => r.role === 'ADMIN')) {
+ return TITLE_TO_CLASSNAME.admin;
+ }
+ if (roles.find((r) => r.role === 'CONTRIBUTOR')) {
+ return TITLE_TO_CLASSNAME.contributor;
+ }
+ if (roles.find((r) => r.role === 'SUPPORTER')) {
+ return TITLE_TO_CLASSNAME.supporter;
+ }
+ return 'text-foreground';
+}
diff --git a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
index 467023a1..318c3190 100644
--- a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
+++ b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
@@ -7,14 +7,14 @@ import { Shield, Sword, Wand2, type LucideIcon } from '@repo/ui/icons';
import { useQuery } from '@tanstack/react-query';
import { getProfileData } from './enhanced-user-badge.getProfileData';
import { useState } from 'react';
-import { SlugToBadgeIcon } from '~/app/(profile)/[username]/_components/dashboard/badges';
-import { type BadgeInfo } from '~/app/(profile)/[username]/_components/dashboard/_actions';
import { cn } from '@repo/ui/cn';
import { type Role } from '@repo/db/types';
import { Button } from '@repo/ui/components/button';
import { HoverCard, HoverCardContent, HoverCardTrigger } from '@repo/ui/components/hover-card';
-import { getTitles, type TitleInfo } from './enhanced-user-badge.getTitles';
+import { getGradient, getTitles, type TitleInfo } from './enhanced-user-badge.getTitles';
import { Skeleton } from '@repo/ui/components/skeleton';
+import type { BadgeInfo } from '~/app/(profile)/[username]/user-info';
+import { SlugToBadgeIcon } from '~/app/(profile)/[username]/_components/badges';
import { Tooltip, TooltipContent, TooltipTrigger } from '@repo/ui/components/tooltip';
interface UserBadgeProps {
@@ -91,7 +91,7 @@ export function UserBadge(props: UserBadgeProps) {
<div className="flex w-max max-w-[calc(39ch)] flex-col space-y-2 ">
<h1
className={cn(
- 'bg-gradient-to-r bg-clip-text font-extrabold text-transparent',
+ 'w-fit bg-gradient-to-r bg-clip-text font-extrabold text-transparent',
gradient,
)}
>
@@ -116,29 +116,12 @@ const TITLE_TO_ICON: Record<TitleInfo['type'], LucideIcon> = {
contributor: Wand2,
};
-const TITLE_TO_CLASSNAME: Record<TitleInfo['type'], string> = {
- admin: 'bg-gradient-to-r from-rose-400 to-orange-500 dark:from-rose-400 dark:to-orange-300',
- contributor: 'bg-gradient-to-r from-sky-400 to-cyan-600 dark:from-sky-400 dark:to-cyan-300',
- supporter:
- 'bg-gradient-to-r from-yellow-500 to-yellow-600 dark:from-yellow-200 dark:to-yellow-500',
-};
-
-function getGradient(roles: Role[]) {
- if (roles.find((r) => r.role === 'ADMIN')) {
- return TITLE_TO_CLASSNAME.admin;
- }
- if (roles.find((r) => r.role === 'CONTRIBUTOR')) {
- return TITLE_TO_CLASSNAME.contributor;
+export function Titles(props: { data: TitleInfo[] }) {
+ if (props.data.length === 0) {
+ return null;
}
- if (roles.find((r) => r.role === 'SUPPORTER')) {
- return TITLE_TO_CLASSNAME.supporter;
- }
- return 'text-foreground';
-}
-
-function Titles(props: { data: TitleInfo[] }) {
return (
- <div className="flex flex-row space-x-2">
+ <div className="flex flex-row flex-wrap gap-2">
{props.data.map((t) => {
const Icon = TITLE_TO_ICON[t.type];
return (
diff --git a/apps/web/src/app/explore/_components/explore-card.tsx b/apps/web/src/app/explore/_components/explore-card.tsx
index 11292cbb..df7b7407 100644
--- a/apps/web/src/app/explore/_components/explore-card.tsx
+++ b/apps/web/src/app/explore/_components/explore-card.tsx
@@ -18,17 +18,14 @@ import {
Triangle,
} from '@repo/ui/icons';
import dynamic from 'next/dynamic';
-import type { ExploreChallengeData } from './explore.action';
+import type { Difficulty, Submission } from '@repo/db/types';
+import { cn } from '@repo/ui/cn';
const RelativeTime = dynamic(() => import('./relative-time'), {
ssr: false,
});
-interface ExploreCardProps {
- challenge: Awaited<ExploreChallengeData>[0];
-}
-
-const BORDERS_BY_DIFFICULTY = {
+export const BORDERS_BY_DIFFICULTY = {
BEGINNER:
'dark:hover:border-difficulty-beginner-dark hover:border-difficulty-beginner dark:group-focus:border-difficulty-beginner-dark group-focus:border-difficulty-beginner',
EASY: 'dark:hover:border-difficulty-easy-dark hover:border-difficulty-easy dark:group-focus:border-difficulty-easy-dark group-focus:border-difficulty-easy',
@@ -42,7 +39,7 @@ const BORDERS_BY_DIFFICULTY = {
'dark:hover:border-difficulty-extreme-dark hover:border-difficulty-extreme dark:group-focus:border-difficulty-extreme-dark group-focus:border-difficulty-extreme',
};
-const SHADOWS_BY_DIFFICULTY = {
+export const SHADOWS_BY_DIFFICULTY = {
BEGINNER:
'hover:shadow-beginner group-focus:shadow-beginner dark:hover:shadow-beginner-dark dark:group-focus:shadow-beginner-dark',
EASY: 'hover:shadow-easy group-focus:shadow-easy dark:hover:shadow-easy-dark dark:group-focus:shadow-easy-dark',
@@ -56,7 +53,7 @@ const SHADOWS_BY_DIFFICULTY = {
'hover:shadow-extreme group-focus:shadow-extreme dark:hover:shadow-extreme-dark dark:group-focus:shadow-extreme-dark',
};
-function ChallengeDifficultyIcon({ difficulty }: { difficulty: string }) {
+export function ChallengeDifficultyIcon({ difficulty }: { difficulty: string }) {
switch (difficulty) {
case 'BEGINNER':
return (
@@ -98,15 +95,34 @@ function ChallengeDifficultyIcon({ difficulty }: { difficulty: string }) {
}
}
-export async function ExploreCard({ challenge }: ExploreCardProps) {
+export interface ExploreCardProps {
+ challenge: {
+ difficulty: Difficulty;
+ name: string;
+ _count: {
+ comment: number;
+ vote: number;
+ };
+ submission: Submission[];
+ user: {
+ name: string;
+ };
+ updatedAt: Date;
+ shortDescription: string;
+ };
+}
+export function ExploreCard({ challenge, className }: ExploreCardProps & { className?: string }) {
const hasBeenSolved = challenge.submission.length > 0;
return (
<Card
- className={`group/card bg-background hover:bg-card-hovered relative overflow-hidden duration-300 sm:min-w-[300px] xl:min-w-[333px]
+ className={cn(
+ `group/card bg-background hover:bg-card-hovered relative overflow-hidden duration-300 sm:min-w-[300px] xl:min-w-[333px]
${SHADOWS_BY_DIFFICULTY[challenge.difficulty]}
${BORDERS_BY_DIFFICULTY[challenge.difficulty]}
- `}
+ `,
+ className,
+ )}
>
<ChallengeDifficultyIcon difficulty={challenge.difficulty} />
<CardHeader className="relative flex flex-col items-start gap-1 py-5">
diff --git a/apps/web/src/app/settings/_components/edit-profile-tab.tsx b/apps/web/src/app/settings/_components/edit-profile-tab.tsx
deleted file mode 100644
index eff1636a..00000000
--- a/apps/web/src/app/settings/_components/edit-profile-tab.tsx
+++ /dev/null
@@ -1,123 +0,0 @@
-'use client';
-
-import { zodResolver } from '@hookform/resolvers/zod';
-import { useFieldArray, useForm } from 'react-hook-form';
-
-import type { User } from '@repo/db/types';
-import { Button } from '@repo/ui/components/button';
-import { Form, FormField, FormItem, FormLabel, FormMessage } from '@repo/ui/components/form';
-import { Input } from '@repo/ui/components/input';
-import { MagicIcon } from '@repo/ui/components/magic-icon';
-import { useToast } from '@repo/ui/components/use-toast';
-
-import { RichMarkdownEditor } from '~/components/rich-markdown-editor';
-
-import { updateProfile } from './settings.action';
-import { profileSchema, type ProfileSchema } from './schema';
-
-interface Props {
- user: User & { userLinks: { id: string | null; url: string }[] };
-}
-
-export function ProfileSettings({ user }: Props) {
- return (
- <div>
- <ProfileForm user={user} />
- </div>
- );
-}
-
-function ProfileForm({ user }: Props) {
- const { toast } = useToast();
-
- // NOTE: make the user links have 4 at all times
- const userLinksLength: number = user.userLinks?.length ?? 0;
- const userLinks = (user.userLinks = [
- ...user.userLinks,
- ...Array(4 - userLinksLength).fill({
- id: null,
- url: '',
- }),
- ])
- // NOTE: sort the user links so empty strings are at the bottom
- .sort((a, b) => b.url.localeCompare(a.url));
-
- const form = useForm<ProfileSchema>({
- resolver: zodResolver(profileSchema),
- mode: 'onChange',
- defaultValues: {
- bio: user.bio,
- userLinks,
- },
- });
-
- const {
- formState: { errors },
- control,
- register,
- } = form;
-
- const { fields } = useFieldArray({
- control,
- name: 'userLinks',
- });
-
- async function onSubmit(data: ProfileSchema) {
- try {
- await updateProfile(data);
- toast({
- title: 'Profile Updated',
- description: 'Your profile has been successfully updated.',
- variant: 'success',
- });
- } catch (error) {
- toast({
- title: 'Could not update profile',
- variant: 'destructive',
- });
- }
- }
-
- return (
- <Form {...form}>
- <form onSubmit={(e) => form.handleSubmit(onSubmit)(e)} className="space-y-8">
- <FormField
- control={form.control}
- name="bio"
- render={({ field }) => (
- <FormItem className="h-[300px] md:w-[600px]">
- <FormLabel>Bio</FormLabel>
- <RichMarkdownEditor onChange={field.onChange} value={field.value} />
- <FormMessage />
- </FormItem>
- )}
- />
- <div className="flex flex-col items-start space-y-3 pt-8">
- <h4 className="text-sm font-medium">Social Links</h4>
- {fields.map((val, i) => {
- return (
- <FormItem className="mb-3" key={`url-link-${i}`}>
- <div className="flex items-center gap-2">
- <MagicIcon url={userLinks[i]?.url ?? ''} />
- <Input
- className="w-64"
- defaultValue={val.url}
- placeholder="Link to social profile"
- {...register(`userLinks.${i}.url`)}
- />
- {errors.userLinks?.[i]?.url?.message ? (
- <div className="text-destructive">{errors.userLinks[i]?.url?.message}</div>
- ) : null}
- </div>
- </FormItem>
- );
- })}
- </div>
-
- <Button type="submit" disabled={form.formState.isSubmitting}>
- Update profile
- </Button>
- </form>
- </Form>
- );
-}
diff --git a/apps/web/src/app/settings/_components/schema.ts b/apps/web/src/app/settings/_components/schema.ts
deleted file mode 100644
index 13860162..00000000
--- a/apps/web/src/app/settings/_components/schema.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { z } from 'zod';
-import { createNoProfanitySchemaWithValidate } from '~/utils/antiProfanityZod';
-
-export const appearanceFormSchema = z.object({
- theme: z.enum(['light', 'dark'], {
- required_error: 'Please select a theme.',
- }),
- font: z.enum(['inter', 'manrope', 'system'], {
- invalid_type_error: 'Select a font',
- required_error: 'Please select a font.',
- }),
-});
-
-export type ApperenceFormSchema = z.infer<typeof appearanceFormSchema>;
-
-// returns true/false if the url contains a https/http proto
-const validUrlWithHttpOrHttps = z.string().refine(
- (url) => {
- try {
- const parsedUrl = new URL(url);
- return ['https:', 'http:'].includes(parsedUrl.protocol);
- } catch (error) {
- return false;
- }
- },
- {
- message: "URL must have the 'http(s)' protocol",
- },
-);
-
-export const profileSchema = z.object({
- bio: createNoProfanitySchemaWithValidate((str) => str.max(256)),
- userLinks: z.array(
- z.object({
- id: z.union([z.string(), z.null()]),
- url: z.union([
- createNoProfanitySchemaWithValidate((str) => str.url().max(256)).and(
- validUrlWithHttpOrHttps,
- ),
- z.literal(''),
- ]),
- }),
- ),
-});
-
-export type ProfileSchema = z.infer<typeof profileSchema>;
diff --git a/apps/web/src/app/settings/_components/settings-skeleton.tsx b/apps/web/src/app/settings/_components/settings-skeleton.tsx
deleted file mode 100644
index fbbbdccd..00000000
--- a/apps/web/src/app/settings/_components/settings-skeleton.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import { Skeleton } from '@repo/ui/components/skeleton';
-
-export function SettingsSkeleton() {
- return (
- <div className="container flex h-full flex-col gap-8 py-8 md:flex-row">
- <div className="flex flex-col gap-4 md:flex-row">
- <div className="flex flex-col items-center gap-4 md:items-start">
- <Skeleton className="h-32 w-32 rounded-3xl bg-cover md:h-64 md:w-64" />
- <Skeleton className="mt-4 h-10 w-60 rounded-lg bg-zinc-300 dark:bg-zinc-700 dark:text-white" />
- <div className="mt-4 flex gap-4 md:w-full md:flex-col">
- {Array.from({ length: 3 }, (_, idx) => (
- <TabsTriggerSkeleton key={idx} />
- ))}
- </div>
- </div>
- </div>
- <div className="relative flex shrink grow flex-col items-center justify-center space-y-4 rounded-3xl border border-zinc-700 py-10 md:w-2/3">
- <Skeleton className="h-4 w-5/6 max-w-80 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-60 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- <Skeleton className="h-4 w-20 rounded-2xl bg-zinc-300 text-neutral-900 dark:bg-zinc-700 dark:text-white" />
- </div>
- </div>
- );
-}
-
-export function TabsTriggerSkeleton() {
- return (
- <div className="flex h-6 flex-row items-center gap-2 rounded-xl border border-zinc-700 px-2 py-4 md:w-64">
- <Skeleton className="h-4 w-4 rounded-md border border-zinc-300 bg-zinc-300 dark:bg-zinc-700" />
- <Skeleton className="hidden h-4 w-16 rounded-2xl bg-zinc-300 text-neutral-900 md:block dark:bg-zinc-700 dark:text-white" />
- </div>
- );
-}
diff --git a/apps/web/src/app/settings/_components/settings.tsx b/apps/web/src/app/settings/_components/settings.tsx
deleted file mode 100644
index 3c063799..00000000
--- a/apps/web/src/app/settings/_components/settings.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-'use client';
-
-import Link from 'next/link';
-
-import type { User } from '@repo/db/types';
-import { Card, CardContent, CardHeader, CardTitle } from '@repo/ui/components/card';
-import {
- Tabs,
- VerticalTabsContent,
- VerticalTabsList,
- VerticalTabsTrigger,
-} from '@repo/ui/components/tabs';
-import { Settings2, User as UserIcon } from '@repo/ui/icons';
-
-import UserHeader from '../../(profile)/[username]/_components/dashboard/user-header';
-import { ProfileSettings } from './edit-profile-tab';
-
-interface Props {
- user: User & { userLinks: { id: string | null; url: string }[] };
-}
-
-export const Settings = async ({ user }: Props) => {
- return (
- <div className="container">
- {/* // TODO: GFI: make each page a subroute, put settings & profile into the same layout */}
- <Tabs className="flex flex-col gap-8 py-8 md:flex-row" defaultValue="settings">
- <VerticalTabsList>
- <div className="flex flex-col items-center gap-4 md:items-start">
- <div
- className="h-32 w-32 rounded-3xl bg-cover bg-center bg-no-repeat md:h-64 md:w-64"
- style={{ backgroundImage: `url(${user.image ?? '/avatar.jpeg'})` }}
- />
- <div className="flex flex-col items-center gap-2 md:w-full md:items-start">
- <UserHeader user={user} isOwnProfile />
- </div>
- <div className="flex gap-4 md:w-full md:flex-col">
- <VerticalTabsTrigger
- className="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 md:justify-normal md:px-3 dark:hover:bg-neutral-700/50 "
- value="settings"
- >
- <Settings2 className="h-4 w-4" />
- <span className="hidden md:block">Settings</span>
- </VerticalTabsTrigger>
- <Link
- href={`/@${user.name}`}
- className="border-border dark:border-ring data-[state=active]:bg-border ring-offset-background focus-visible:ring-ring data-[state=active]:text-foreground flex items-center justify-center gap-3 whitespace-nowrap rounded-xl border px-1.5 py-1.5 text-sm font-medium transition-all duration-300 hover:bg-neutral-200/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm md:justify-normal md:px-3 dark:hover:bg-neutral-700/50"
- >
- <UserIcon className="h-4 w-4" />
- <span className="hidden md:block">Back to Profile</span>
- </Link>
- </div>
- </div>
- </VerticalTabsList>
- <VerticalTabsContent className="shrink grow space-y-4" value="settings">
- <Card className="col-span-4 md:min-h-[calc(100vh_-_56px_-_6rem)]">
- <CardHeader>
- <CardTitle>Settings</CardTitle>
- </CardHeader>
- <CardContent>
- <ProfileSettings user={user} />
- </CardContent>
- </Card>
- </VerticalTabsContent>
- </Tabs>
- </div>
- );
-};
diff --git a/apps/web/src/app/settings/error.tsx b/apps/web/src/app/settings/error.tsx
deleted file mode 100644
index 3ffbdaf0..00000000
--- a/apps/web/src/app/settings/error.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-'use client';
-export default function ErrorBounds() {
- return (
- <div className="flex h-screen flex-col items-center justify-center">
- <h1 className="text-4xl font-bold">404</h1>
- <p className="text-2xl">The page you are looking for is in another castle.</p>
- </div>
- );
-}
diff --git a/apps/web/src/app/settings/loading.tsx b/apps/web/src/app/settings/loading.tsx
deleted file mode 100644
index 8d28c889..00000000
--- a/apps/web/src/app/settings/loading.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { SettingsSkeleton as default } from './_components/settings-skeleton';
diff --git a/apps/web/src/app/settings/page.tsx b/apps/web/src/app/settings/page.tsx
deleted file mode 100644
index f6c5876b..00000000
--- a/apps/web/src/app/settings/page.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { auth } from '~/server/auth';
-import { prisma } from '@repo/db';
-import type { Metadata } from 'next';
-import { Settings } from './_components/settings';
-import { buildMetaForDefault } from '~/app/metadata';
-
-export async function generateMetadata(): Promise<Metadata> {
- return buildMetaForDefault({
- title: 'Settings | TypeHero',
- description: 'Change your settings on TypeHero.',
- });
-}
-
-export default async function SettingsPage() {
- const session = await auth();
-
- if (!session?.user || !session.user.name) {
- return null;
- }
-
- const profileData = await prisma.user.findFirstOrThrow({
- where: {
- id: session.user.id,
- },
- include: {
- userLinks: true,
- },
- orderBy: {
- updatedAt: 'asc',
- },
- });
- return (
- <>
- <Settings user={profileData} />
- </>
- );
-}
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index 35292ac2..4e7dacda 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -198,12 +198,12 @@ async function LoginButton({
<ThemeButton />
</div>
{isAdminOrMod ? (
- <a className="block" href={getAdminUrl()}>
+ <Link className="block" href={getAdminUrl()}>
<DropdownMenuItem className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none dark:hover:bg-neutral-700/50">
<Settings className="mr-2 h-4 w-4" />
<span>Admin</span>
</DropdownMenuItem>
- </a>
+ </Link>
) : null}
{isAdminOrMod ? (
<Link className="block" href="/challenge-playground">
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index 21d5dbba..fb67de1f 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -51,6 +51,12 @@
--difficulty-medium-dark: 31 86% 60%;
--difficulty-hard-dark: 0 91% 71%;
--difficulty-extreme-dark: 269 97% 85%;
+
+ --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%;
}
.dark {
@@ -85,6 +91,18 @@
--error-label: 0 92.2% 64.9%;
--ring: 240 3.7% 15.9%;
+
+ --difficulty-beginner: 199 69% 72%;
+ --difficulty-easy: 142 77% 73%;
+ --difficulty-medium: 31 86% 60%;
+ --difficulty-hard: 0 91% 71%;
+ --difficulty-extreme: 269 97% 85%;
+
+ --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%;
}
}
diff --git a/apps/web/src/utils/useIsMobile.ts b/apps/web/src/utils/useIsMobile.ts
index 36b965da..50c26ad9 100644
--- a/apps/web/src/utils/useIsMobile.ts
+++ b/apps/web/src/utils/useIsMobile.ts
@@ -11,7 +11,11 @@ export function useIsMobile() {
);
const isDev = process.env.NODE_ENV !== 'production';
- if (isDev) setIsMobile(isSmall || isMobile);
+
+ if (isDev) {
+ setIsMobile(isSmall || isMobile);
+ return;
+ }
setIsMobile(isSmall && isMobile);
}, []);
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 3200397f..811be583 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -5,6 +5,7 @@
"exports": {
"./types": "./src/types.ts",
"./icons": "./src/icons.ts",
+ "./recharts": "./src/recharts.ts",
"./cn": "./src/cn.ts",
"./components/*": "./src/components/*"
},
@@ -16,6 +17,9 @@
"icons": [
"./src/icons.ts"
],
+ "recharts": [
+ "./src/recharts.ts"
+ ],
"cn": [
"./src/cn.ts"
],
@@ -51,12 +55,13 @@
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.4",
"@radix-ui/react-toggle": "^1.0.3",
+ "@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.0.6",
"@repo/db": "workspace:*",
"@tanstack/react-table": "^8.20.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
- "lucide-react": "^0.260.0",
+ "lucide-react": "^0.453.0",
"mdast-util-find-and-replace": "^3.0.1",
"next-themes": "^0.2.1",
"react": "18.2.0",
@@ -64,6 +69,7 @@
"react-hook-form": "^7.45.1",
"react-markdown": "^8.0.7",
"react-syntax-highlighter": "^15.5.0",
+ "recharts": "^2.12.7",
"rehype-raw": "^7.0.0",
"remark-gfm": "^3.0.1",
"tailwind-merge": "^1.14.0",
diff --git a/packages/ui/src/components/alert.tsx b/packages/ui/src/components/alert.tsx
index 69e8bffc..81b40338 100644
--- a/packages/ui/src/components/alert.tsx
+++ b/packages/ui/src/components/alert.tsx
@@ -1,9 +1,10 @@
import * as React from 'react';
import { cva, type VariantProps } from 'class-variance-authority';
+
import { cn } from '../cn';
const alertVariants = cva(
- 'relative w-full rounded-lg border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',
+ 'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7',
{
variants: {
variant: {
@@ -24,15 +25,15 @@ const Alert = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
>(({ className, variant, ...props }, ref) => (
- <div className={cn(alertVariants({ variant }), className)} ref={ref} role="alert" {...props} />
+ <div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
));
Alert.displayName = 'Alert';
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
({ className, ...props }, ref) => (
<h5
- className={cn('mb-1 font-medium leading-none tracking-tight', className)}
ref={ref}
+ className={cn('mb-1 font-medium leading-none tracking-tight', className)}
{...props}
/>
),
@@ -43,7 +44,7 @@ const AlertDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
- <div className={cn('text-sm [&_p]:leading-relaxed', className)} ref={ref} {...props} />
+ <div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
));
AlertDescription.displayName = 'AlertDescription';
diff --git a/packages/ui/src/components/chart.tsx b/packages/ui/src/components/chart.tsx
new file mode 100644
index 00000000..ad779cf2
--- /dev/null
+++ b/packages/ui/src/components/chart.tsx
@@ -0,0 +1,332 @@
+'use client';
+
+import * as React from 'react';
+import * as RechartsPrimitive from 'recharts';
+
+import { cn } from '../cn';
+
+// Format: { THEME_NAME: CSS_SELECTOR }
+const THEMES = { light: '', dark: '.dark' } as const;
+
+export type ChartConfig = {
+ [k in string]: {
+ label?: React.ReactNode;
+ icon?: React.ComponentType;
+ } & (
+ | { color?: never; theme: Record<keyof typeof THEMES, string> }
+ | { color?: string; theme?: never }
+ );
+};
+
+interface ChartContextProps {
+ config: ChartConfig;
+}
+
+const ChartContext = React.createContext<ChartContextProps | null>(null);
+
+function useChart() {
+ const context = React.useContext(ChartContext);
+
+ if (!context) {
+ throw new Error('useChart must be used within a <ChartContainer />');
+ }
+
+ return context;
+}
+
+const ChartContainer = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<'div'> & {
+ config: ChartConfig;
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
+ }
+>(({ id, className, children, config, ...props }, ref) => {
+ const uniqueId = React.useId();
+ const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;
+
+ return (
+ <ChartContext.Provider value={{ config }}>
+ <div
+ data-chart={chartId}
+ ref={ref}
+ className={cn(
+ "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
+ className,
+ )}
+ {...props}
+ >
+ <ChartStyle id={chartId} config={config} />
+ <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>
+ </div>
+ </ChartContext.Provider>
+ );
+});
+ChartContainer.displayName = 'Chart';
+
+const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
+ const colorConfig = Object.entries(config).filter(([_, config]) => config.theme || config.color);
+
+ if (!colorConfig.length) {
+ return null;
+ }
+
+ return (
+ <style
+ dangerouslySetInnerHTML={{
+ __html: Object.entries(THEMES)
+ .map(
+ ([theme, prefix]) => `
+${prefix} [data-chart=${id}] {
+${colorConfig
+ .map(([key, itemConfig]) => {
+ const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color;
+ return color ? ` --color-${key}: ${color};` : null;
+ })
+ .join('\n')}
+}
+`,
+ )
+ .join('\n'),
+ }}
+ />
+ );
+};
+
+const ChartTooltip = RechartsPrimitive.Tooltip;
+
+const ChartTooltipContent = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<'div'> &
+ React.ComponentProps<typeof RechartsPrimitive.Tooltip> & {
+ hideLabel?: boolean;
+ hideIndicator?: boolean;
+ indicator?: 'dashed' | 'dot' | 'line';
+ nameKey?: string;
+ labelKey?: string;
+ tooltipUnit?: string;
+ }
+>(
+ (
+ {
+ active,
+ payload,
+ className,
+ indicator = 'dot',
+ hideLabel = false,
+ hideIndicator = false,
+ label,
+ labelFormatter,
+ labelClassName,
+ formatter,
+ color,
+ nameKey,
+ labelKey,
+ tooltipUnit,
+ },
+ ref,
+ ) => {
+ const { config } = useChart();
+
+ const tooltipLabel = React.useMemo(() => {
+ if (hideLabel || !payload?.length) {
+ return null;
+ }
+
+ const [item] = payload;
+ const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
+ const value =
+ !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;
+
+ if (labelFormatter) {
+ return (
+ <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
+ );
+ }
+
+ if (!value) {
+ return null;
+ }
+
+ return <div className={cn('font-medium', labelClassName)}>{value}</div>;
+ }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
+
+ if (!active || !payload?.length) {
+ return null;
+ }
+
+ const nestLabel = payload.length === 1 && indicator !== 'dot';
+
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',
+ className,
+ )}
+ >
+ {!nestLabel ? tooltipLabel : null}
+ <div className="grid gap-1.5">
+ {payload.map((item, index) => {
+ const key = `${nameKey || item.name || item.dataKey || 'value'}`;
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
+ const indicatorColor = color || item.payload.fill || item.color;
+
+ return (
+ <div
+ key={item.dataKey}
+ className={cn(
+ '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
+ indicator === 'dot' && 'items-center',
+ )}
+ >
+ {formatter && item?.value !== undefined && item.name ? (
+ formatter(item.value, item.name, item, index, item.payload)
+ ) : (
+ <>
+ {itemConfig?.icon ? (
+ <itemConfig.icon />
+ ) : (
+ !hideIndicator && (
+ <div
+ className={cn(
+ 'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',
+ {
+ 'h-2.5 w-2.5': indicator === 'dot',
+ 'w-1': indicator === 'line',
+ 'w-0 border-[1.5px] border-dashed bg-transparent':
+ indicator === 'dashed',
+ 'my-0.5': nestLabel && indicator === 'dashed',
+ },
+ )}
+ style={
+ {
+ '--color-bg': indicatorColor,
+ '--color-border': indicatorColor,
+ } as React.CSSProperties
+ }
+ />
+ )
+ )}
+ <div
+ className={cn(
+ 'flex flex-1 justify-between leading-none',
+ nestLabel ? 'items-end' : 'items-center',
+ )}
+ >
+ <div className="grid gap-1.5">
+ {nestLabel ? tooltipLabel : null}
+ <span className="text-muted-foreground">
+ {itemConfig?.label || item.name}
+ </span>
+ </div>
+ {item.value !== undefined && (
+ <span className="text-foreground ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums">
+ {item.value.toLocaleString()}
+ {tooltipUnit && (
+ <span className="text-muted-foreground font-normal">{tooltipUnit}</span>
+ )}
+ </span>
+ )}
+ </div>
+ </>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ );
+ },
+);
+ChartTooltipContent.displayName = 'ChartTooltip';
+
+const ChartLegend = RechartsPrimitive.Legend;
+
+const ChartLegendContent = React.forwardRef<
+ HTMLDivElement,
+ Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> &
+ React.ComponentProps<'div'> & {
+ hideIcon?: boolean;
+ nameKey?: string;
+ }
+>(({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {
+ const { config } = useChart();
+
+ if (!payload?.length) {
+ return null;
+ }
+
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'flex items-center justify-center gap-4',
+ verticalAlign === 'top' ? 'pb-3' : 'pt-3',
+ className,
+ )}
+ >
+ {payload.map((item) => {
+ const key = `${nameKey || item.dataKey || 'value'}`;
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
+
+ return (
+ <div
+ key={item.value}
+ className={cn(
+ '[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3',
+ )}
+ >
+ {itemConfig?.icon && !hideIcon ? (
+ <itemConfig.icon />
+ ) : (
+ <div
+ className="h-2 w-2 shrink-0 rounded-[2px]"
+ style={{
+ backgroundColor: item.color,
+ }}
+ />
+ )}
+ {itemConfig?.label}
+ </div>
+ );
+ })}
+ </div>
+ );
+});
+ChartLegendContent.displayName = 'ChartLegend';
+
+// Helper to extract item config from a payload.
+function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
+ if (typeof payload !== 'object' || payload === null) {
+ return undefined;
+ }
+
+ const payloadPayload =
+ 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null
+ ? payload.payload
+ : undefined;
+
+ let configLabelKey: string = key;
+
+ if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {
+ configLabelKey = payload[key as keyof typeof payload] as string;
+ } else if (
+ payloadPayload &&
+ key in payloadPayload &&
+ typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'
+ ) {
+ configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;
+ }
+
+ return configLabelKey in config ? config[configLabelKey] : config[key];
+}
+
+export {
+ ChartContainer,
+ ChartTooltip,
+ ChartTooltipContent,
+ ChartLegend,
+ ChartLegendContent,
+ ChartStyle,
+};
diff --git a/packages/ui/src/components/form.tsx b/packages/ui/src/components/form.tsx
index 3df7660b..f47ca6ee 100644
--- a/packages/ui/src/components/form.tsx
+++ b/packages/ui/src/components/form.tsx
@@ -86,7 +86,7 @@ const FormLabel = React.forwardRef<
return (
<Label
- className={cn(error && 'text-destructive', className)}
+ className={cn(error && 'text-destructive dark:text-error-label', className)}
htmlFor={formItemId}
ref={ref}
{...props}
diff --git a/packages/ui/src/components/magic-icon.tsx b/packages/ui/src/components/magic-icon.tsx
index c99fc56d..c2dba3a1 100644
--- a/packages/ui/src/components/magic-icon.tsx
+++ b/packages/ui/src/components/magic-icon.tsx
@@ -1,6 +1,7 @@
import { Github, Link as LinkIcon, Linkedin, Twitter, Youtube } from 'lucide-react';
+import { cn } from '../cn';
-export function MagicIcon({ url }: { url: string }) {
+export function MagicIcon({ url, className }: { url: string; className?: string }) {
const githubRegex = /^(?:https?:\/\/)?(?:www\.)?github\.com\/(?:\w+)(\/)?$/;
const twitterRegex = /^(?:https?:\/\/)?(?:www\.)?twitter\.com\/(?:\w+)(\/)?$/;
const linkedinRegex = /^(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:\w+)(\/)?$/;
@@ -8,13 +9,9 @@ export function MagicIcon({ url }: { url: string }) {
const lowercaseUrl = url.toLowerCase();
- if (githubRegex.test(lowercaseUrl))
- return <Github className="h-3 w-3 text-neutral-400 dark:text-neutral-600" />;
- if (twitterRegex.test(lowercaseUrl))
- return <Twitter className="h-3 w-3 text-neutral-400 dark:text-neutral-600" />;
- if (linkedinRegex.test(lowercaseUrl))
- return <Linkedin className="h-3 w-3 text-neutral-400 dark:text-neutral-600" />;
- if (youtubeRegex.test(lowercaseUrl))
- return <Youtube className="h-3 w-3 text-neutral-400 dark:text-neutral-600" />;
- return <LinkIcon className="h-3 w-3 text-neutral-400 dark:text-neutral-600" />;
+ if (githubRegex.test(lowercaseUrl)) return <Github className={cn('h-3 w-3', className)} />;
+ if (twitterRegex.test(lowercaseUrl)) return <Twitter className={cn('h-3 w-3', className)} />;
+ if (linkedinRegex.test(lowercaseUrl)) return <Linkedin className={cn('h-3 w-3', className)} />;
+ if (youtubeRegex.test(lowercaseUrl)) return <Youtube className={cn('h-3 w-3', className)} />;
+ return <LinkIcon className={cn('h-3 w-3', className)} />;
}
diff --git a/packages/ui/src/components/toggle-group.tsx b/packages/ui/src/components/toggle-group.tsx
new file mode 100644
index 00000000..14a72d14
--- /dev/null
+++ b/packages/ui/src/components/toggle-group.tsx
@@ -0,0 +1,57 @@
+'use client';
+
+import * as React from 'react';
+import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
+import { type VariantProps } from 'class-variance-authority';
+
+import { cn } from '../cn';
+import { toggleVariants } from './toggle';
+
+const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
+ size: 'default',
+ variant: 'default',
+});
+
+const ToggleGroup = React.forwardRef<
+ React.ElementRef<typeof ToggleGroupPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
+ VariantProps<typeof toggleVariants>
+>(({ className, variant, size, children, ...props }, ref) => (
+ <ToggleGroupPrimitive.Root
+ ref={ref}
+ className={cn('flex items-center justify-center gap-1', className)}
+ {...props}
+ >
+ <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
+ </ToggleGroupPrimitive.Root>
+));
+
+ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
+
+const ToggleGroupItem = React.forwardRef<
+ React.ElementRef<typeof ToggleGroupPrimitive.Item>,
+ React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
+ VariantProps<typeof toggleVariants>
+>(({ className, children, variant, size, ...props }, ref) => {
+ const context = React.useContext(ToggleGroupContext);
+
+ return (
+ <ToggleGroupPrimitive.Item
+ ref={ref}
+ className={cn(
+ toggleVariants({
+ variant: context.variant || variant,
+ size: context.size || size,
+ }),
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ </ToggleGroupPrimitive.Item>
+ );
+});
+
+ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
+
+export { ToggleGroup, ToggleGroupItem };
diff --git a/packages/ui/src/components/ui/separator.tsx b/packages/ui/src/components/ui/separator.tsx
new file mode 100644
index 00000000..46baeb40
--- /dev/null
+++ b/packages/ui/src/components/ui/separator.tsx
@@ -0,0 +1,26 @@
+'use client';
+
+import * as React from 'react';
+import * as SeparatorPrimitive from '@radix-ui/react-separator';
+
+import { cn } from '@repo/ui/cn';
+
+const Separator = React.forwardRef<
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
+>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
+ <SeparatorPrimitive.Root
+ ref={ref}
+ decorative={decorative}
+ orientation={orientation}
+ className={cn(
+ 'bg-border shrink-0',
+ orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
+ className,
+ )}
+ {...props}
+ />
+));
+Separator.displayName = SeparatorPrimitive.Root.displayName;
+
+export { Separator };
diff --git a/packages/ui/src/icons.ts b/packages/ui/src/icons.ts
index 19197cbb..e6394103 100644
--- a/packages/ui/src/icons.ts
+++ b/packages/ui/src/icons.ts
@@ -1,9 +1,12 @@
export {
AlertCircle,
ArrowDownNarrowWide,
+ ArrowLeft,
ArrowUp,
ArrowUpNarrowWide,
+ ArrowUpRight,
AtSign,
+ Award,
BadgeInfo,
Bell,
BellRing,
@@ -28,9 +31,13 @@ export {
Diamond,
ExternalLink,
Flag,
- Heart,
+ FileCode,
+ FlaskConical,
GitBranch,
Github,
+ Heart,
+ HeartHandshake,
+ History,
Laptop,
Loader,
Loader2,
@@ -49,8 +56,10 @@ export {
Pin,
Play,
Plus,
+ RectangleVertical,
Reply,
RotateCcw,
+ SearchIcon,
Settings,
Settings2,
Shapes,
@@ -65,23 +74,18 @@ export {
Sword,
Swords,
ThumbsUp,
+ Trash,
Trash2,
+ TrendingUp,
TrendingUpIcon,
Triangle,
Twitter,
Unlock,
User,
+ UserPen,
+ Wand2,
X,
XCircle,
- Trash,
Text,
- FlaskConical,
- History,
- // HandHeart,
- HeartHandshake,
- ArrowLeft,
- RectangleVertical,
- SearchIcon,
- Wand2,
type LucideIcon,
} from 'lucide-react';
diff --git a/packages/ui/src/recharts.ts b/packages/ui/src/recharts.ts
new file mode 100644
index 00000000..958dc3f1
--- /dev/null
+++ b/packages/ui/src/recharts.ts
@@ -0,0 +1,16 @@
+export {
+ Label,
+ PolarGrid,
+ PolarRadiusAxis,
+ PolarAngleAxis,
+ RadialBar,
+ RadialBarChart,
+ Scatter,
+ ScatterChart,
+ XAxis,
+ YAxis,
+ ZAxis,
+ CartesianGrid,
+ Cell,
+ Rectangle,
+} from 'recharts';
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0e17e940..f60f38f7 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -55,7 +55,7 @@ importers:
version: 5.3.3
vitest:
specifier: ^0.34.6
apps/admin:
dependencies:
@@ -91,10 +91,10 @@ importers:
version: 2.6.0-beta.12
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -158,7 +158,7 @@ importers:
eslint-plugin-import:
specifier: ^2.27.5
- version: 2.27.5([email protected])
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -200,7 +200,7 @@ importers:
version: 2.0.0
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
@@ -310,7 +310,7 @@ importers:
version: 1.0.0
next:
specifier: 14.2.5
react:
specifier: 18.2.0
version: 18.2.0
@@ -386,13 +386,13 @@ importers:
version: link:../../packages/ui
'@sentry/nextjs':
specifier: ^7.73.0
'@stripe/react-stripe-js':
specifier: ^2.8.0
'@stripe/stripe-js':
specifier: ^4.6.0
- version: 4.7.0
+ version: 4.9.0
'@t3-oss/env-nextjs':
specifier: ^0.6.0
@@ -410,7 +410,7 @@ importers:
'@uploadthing/react':
specifier: ^6.2.2
'@vercel/analytics':
specifier: ^1.1.1
version: 1.1.1
@@ -419,10 +419,10 @@ importers:
version: 0.2.1
'@vercel/speed-insights':
specifier: ^1.0.12
'@vercel/toolbar':
specifier: ^0.1.18
algoliasearch:
specifier: ^4.20.0
version: 4.20.0
@@ -441,6 +441,9 @@ importers:
framer-motion:
specifier: ^10.12.22
+ jotai:
+ specifier: ^2.10.1
+ version: 2.10.1(@types/[email protected])([email protected])
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -458,10 +461,10 @@ importers:
version: 5.0.7
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -488,7 +491,7 @@ importers:
react-instantsearch-nextjs:
specifier: ^0.1.5
react-intersection-observer:
specifier: ^9.5.2
version: 9.5.2([email protected])
@@ -518,7 +521,7 @@ importers:
version: 0.0.1
stripe:
specifier: ^17.1.0
- version: 17.1.0
+ version: 17.2.1
superjson:
specifier: ^2.2.1
version: 2.2.1
@@ -585,7 +588,7 @@ importers:
eslint-plugin-import:
specifier: ^2.27.5
- version: 2.27.5([email protected])
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -615,7 +618,7 @@ importers:
version: link:../db
next-auth:
specifier: 5.0.0-beta.4
devDependencies:
'@repo/lint':
specifier: workspace:*
@@ -716,10 +719,10 @@ importers:
version: 0.4.0(patch_hash=j3oqxjoadtct3pc6tokddngzsm)([email protected])
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
prettier:
specifier: ^3.1.1
version: 3.1.1
@@ -760,7 +763,7 @@ importers:
version: link:../../tooling/config-typescript
'@types/node':
specifier: ^20.4.2
- version: 20.10.4
+ version: 20.16.5
eslint:
specifier: ^8.45.0
version: 8.56.0
@@ -827,6 +830,9 @@ importers:
'@radix-ui/react-toggle':
specifier: ^1.0.3
+ '@radix-ui/react-toggle-group':
+ specifier: ^1.1.0
'@radix-ui/react-tooltip':
specifier: ^1.0.6
@@ -843,14 +849,14 @@ importers:
specifier: ^2.0.0
version: 2.0.0
lucide-react:
- specifier: ^0.260.0
- version: 0.260.0([email protected])
+ specifier: ^0.453.0
+ version: 0.453.0([email protected])
mdast-util-find-and-replace:
specifier: ^3.0.1
version: 3.0.1
next-themes:
specifier: ^0.2.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -866,6 +872,9 @@ importers:
react-syntax-highlighter:
specifier: ^15.5.0
version: 15.5.0([email protected])
+ recharts:
+ specifier: ^2.12.7
rehype-raw:
specifier: ^7.0.0
version: 7.0.0
@@ -902,7 +911,7 @@ importers:
dependencies:
'@next/eslint-plugin-next':
specifier: canary
- version: 15.0.1-canary.1
+ version: 15.0.2-canary.3
'@repo/tsconfig':
specifier: workspace:*
version: link:../config-typescript
@@ -914,7 +923,7 @@ importers:
'@vercel/style-guide':
specifier: ^4.0.2
eslint:
specifier: ^8.45.0
version: 8.45.0
@@ -1916,6 +1925,10 @@ packages:
resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
engines: {node: '>=6.0.0'}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==}
+ engines: {node: '>=6.0.0'}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==}
engines: {node: '>=6.0.0'}
@@ -1924,25 +1937,42 @@ packages:
resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==}
engines: {node: '>=6.0.0'}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
+ engines: {node: '>=6.0.0'}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==}
engines: {node: '>=6.0.0'}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==}
+ engines: {node: '>=6.0.0'}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==}
'@jridgewell/[email protected]':
resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==}
+
'@jridgewell/[email protected]':
resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==}
'@jridgewell/[email protected]':
resolution: {integrity: sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==}
+ '@jridgewell/[email protected]':
+ resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
+
'@kwsites/[email protected]':
resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==}
@@ -1996,8 +2026,8 @@ packages:
resolution: {integrity: sha512-YJqyq6vk39JQfvaNtN83t/p5Jy45+bazRL+V4QI8FPd3FBqFYMEsULiwRLgSJMgFqkk4t4JbeZurz+gILEAFpA==}
- resolution: {integrity: sha512-JYVXvvhq8wnqtJtT33cj2NqkFr7hW6mIhiYi2Me1WPM/YU1LGjpVhR1UUTx1Hla0eU8D1fEgNZ8urDUR6rmzJQ==}
+ resolution: {integrity: sha512-PWI+EwalZZ/t2NMsSgq4Ixo1OhXAy8edBDVBW+WvLPTg5BkhO7+BLrsV8aE8U0y93zdUtqa3Fm472dM5cSSQwQ==}
resolution: {integrity: sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==}
@@ -2384,6 +2414,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-GZsZslMJEyo1VKm5L1ZJY8tGDxZNPAoUeQUIbKeJfoi7Q4kmig5AsgLMYYuyYbfjd8fBmFORAIwYAkXMnXZgZw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==}
peerDependencies:
@@ -2458,6 +2501,15 @@ packages:
'@types/react':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-BUuBvgThEiAXh2DWu93XsT+a3aWrGqolGlqqw5VU1kG7p/ZH2cuDlM1sRLNnY3QcBS69UIz2mcKhMxDsdewhjg==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-n7kDRfx+LB1zLueRDvZ1Pd0bxdJWDUZNQ/GWoxDn2prnuJKRdxsjulejX/ePkOsLi2tTm6P24mDqlMSgQpsT6g==}
peerDependencies:
@@ -2563,6 +2615,15 @@ packages:
'@types/react':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==}
+ peerDependencies:
+ '@types/react': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ==}
peerDependencies:
@@ -2776,6 +2837,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-EA6AMGeq9AEeQDeSH0aZgG198qkfHSbvWTf1HvoDmOB5bBG/qTxjYMWUKMnYiV6J/iP/J8MEFSuB2zRU2n7ODA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-OIClwBkwPG+FKvC4OMTRaa/3cfD069nkKFFL/TQzRzaO42Ce5ivKU9VMKgT7UU6UIkjcQqKBrDOIzWtPGw6e6w==}
peerDependencies:
@@ -2877,6 +2951,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-PpTJV68dZU2oqqgq75Uzto5o/XfOVgkrJ9rulVmfTKxWp3HfUjHE6CP/WLRR4AzPX9HWxw7vFow2me85Yu+Naw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-Pkqg3+Bc98ftZGsl60CLANXQBBQ4W3mTFS9EJvNxKMZ7magklKV69/id1mlAlOFDDfHvlCms0fx8fA4CMKDJHg==}
peerDependencies:
@@ -2890,6 +2977,19 @@ packages:
'@types/react-dom':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-gwoxaKZ0oJ4vIgzsfESBuSgJNdc0rv12VhHgcqN0TEJmmZixXG/2XpsLK8kzNWYcnaoRIEEQc0bEi3dIvdUpjw==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+
'@radix-ui/[email protected]':
resolution: {integrity: sha512-DmNFOiwEc2UDigsYj6clJENma58OelxD24O4IODoZ+3sQc3Zb+L8w1EP+y9laTuKCLAysPw4fD6/v0j4KNV8rg==}
peerDependencies:
@@ -3331,8 +3431,8 @@ packages:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
- '@stripe/[email protected]':
- resolution: {integrity: sha512-Dfdg8UumBu+zDnBgGw30zEE9PIm8lunDUuwy2Bois9bb2sxCohVbD1PpAnasPIZhYfIbigmTHEr/Hg+56Vue6A==}
+ '@stripe/[email protected]':
+ resolution: {integrity: sha512-tMPZQZZXGWyNX7hbgenq+1xEj2oigJ54XddbtSX36VedoKsPBq7dxwRXu4Xd5FdpT3JDyyDtnmvYkaSnH1yHTQ==}
engines: {node: '>=12.16'}
@@ -3486,6 +3586,33 @@ packages:
resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-P2dlU/q51fkOc/Gfl3Ul9kicV7l+ra934qBFXCFhrZMOL6du1TM0pm1ThYvENukyOn5h9v+yMJ9Fn5JK4QozrQ==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-gkK1VVTr5iNiYJ7vWDI+yUFFlszhNMtVeneJ6lUTKPjprsvLLI9/tgEGiXJOnlINJA8FyA88gfnQsHbybVZrYQ==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-5KKk5aKGu2I+O6SONMYSNflgiP0WfZIQvVUMan50wHsLG1G94JlxEVnCpQARfTtzytuY0p/9PXXZb3I7giofIA==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==}
+
resolution: {integrity: sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==}
@@ -3495,8 +3622,8 @@ packages:
resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==}
- '@types/[email protected]':
- resolution: {integrity: sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==}
resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==}
@@ -3504,6 +3631,9 @@ packages:
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
+
resolution: {integrity: sha512-N6gwM01mKhooXaw+IKbUH7wJcIJCn8U60VoaVvom5EiQjmfgevhQ+0+/r17beXW5j8ad2x+WPr0iyOUodCw4/w==}
@@ -3552,6 +3682,12 @@ packages:
resolution: {integrity: sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-DV58qQz9dBMqVVn+qnKwGa51QzCD4YM/tQM16qLKxdf5tqz5W4QwtrMzjSTbabN1cFTSuyxVYBy+QWHjWW8X/g==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==}
+
resolution: {integrity: sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==}
@@ -3786,8 +3922,8 @@ packages:
typescript:
optional: true
- '@vercel/[email protected]':
- resolution: {integrity: sha512-4qcOBDec1jJRbFGu1l/YLrmM9G3hNo3LYCZEQEFcA5gSAW3T94wRzB+7y+eCFWMvEVnDULcre+fXX9MjZr21Vg==}
+ '@vercel/[email protected]':
+ resolution: {integrity: sha512-f+IbPrWn1t3PpbBYtQXbvkrJ7xLzxu1f29bx5ZPF1r2OMXJYOw48/Q/0kz5ukPXGVhOHYyOX/0c8OpYYy8tt2Q==}
peerDependencies:
next: '>=11.0.0'
react: '>=17'
@@ -3815,8 +3951,8 @@ packages:
'@vitest/[email protected]':
resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==}
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==}
@@ -3824,8 +3960,8 @@ packages:
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==}
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==}
@@ -3833,8 +3969,8 @@ packages:
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==}
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==}
@@ -3845,20 +3981,20 @@ packages:
'@webassemblyjs/[email protected]':
resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==}
- '@webassemblyjs/[email protected]':
- resolution: {integrity: sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==}
+ '@webassemblyjs/[email protected]':
+ resolution: {integrity: sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==}
resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==}
@@ -3893,6 +4029,11 @@ packages:
engines: {node: '>=0.4.0'}
hasBin: true
+ resolution: {integrity: sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==}
+ engines: {node: '>=0.4.0'}
+ hasBin: true
+
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
@@ -4121,6 +4262,11 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
+ resolution: {integrity: sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+
resolution: {integrity: sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA==}
@@ -4175,6 +4321,9 @@ packages:
resolution: {integrity: sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA==}
+ resolution: {integrity: sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==}
+
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
@@ -4234,8 +4383,8 @@ packages:
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==}
+ resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==}
engines: {node: '>=6.0'}
@@ -4477,6 +4626,50 @@ packages:
resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
+ resolution: {integrity: sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==}
+ engines: {node: '>=12'}
+
+ resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
@@ -4513,6 +4706,9 @@ packages:
supports-color:
optional: true
+ resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==}
+
resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==}
@@ -4696,6 +4892,9 @@ packages:
resolution: {integrity: sha512-r4x5+FowKG6q+/Wj0W9nidx7QO31BJwmR2uEo+Qh3YLGQ8SbBAFuDFpTxzly/I2gsbrFwBuIjrMp423L3O5U3w==}
+ resolution: {integrity: sha512-NxnmFBHDl5Sachd2P46O7UJiMaMHMLSofoIWVJq3mj8NJgG0umiSeljAVP9lGzjI0UDLJJ5jjoGjcrB8RSbjLQ==}
+
resolution: {integrity: sha512-97g6QgOk8zlDRdgq1WxwgTMgEWGVAQvB5Fdpgc1MkNy56la5SKP9GsMXKDOdqwn90/41a8yPwIGk1Y6WVbeMQA==}
@@ -4717,6 +4916,10 @@ packages:
resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==}
engines: {node: '>=10.13.0'}
+ resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==}
+ engines: {node: '>=10.13.0'}
+
resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==}
engines: {node: '>=0.12'}
@@ -4744,8 +4947,8 @@ packages:
resolution: {integrity: sha512-84QoSLeA7cdTeHpALFNl3ZOstXfvLt426/kaOgmSxmNUOhi4GesKVkhJgIfnsqGNziYezVA8rvZUsXj7oWX2qQ==}
engines: {node: '>=12.x'}
- resolution: {integrity: sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==}
+ resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==}
resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==}
@@ -4906,6 +5109,10 @@ packages:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
engines: {node: '>=6'}
+ resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
+ engines: {node: '>=6'}
+
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
@@ -5151,6 +5358,9 @@ packages:
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
engines: {node: '>= 0.6'}
+ resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==}
+
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
engines: {node: '>=0.8.x'}
@@ -5248,10 +5458,6 @@ packages:
resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
- resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
- engines: {node: ^10.12.0 || >=12.0.0}
-
resolution: {integrity: sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==}
engines: {node: '>=12.0.0'}
@@ -5260,9 +5466,6 @@ packages:
resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
hasBin: true
- resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
-
resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
@@ -5697,6 +5900,10 @@ packages:
resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==}
+ engines: {node: '>=12'}
+
resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==}
@@ -5914,6 +6121,18 @@ packages:
resolution: {integrity: sha512-GPExOkcMsCLBTi1YetY2LmkoY559fss0+0KVa6kOfb2YFe84nAM7Nm/XzuZozah4iHgmBGrCOHL5/cy670SBRw==}
+ resolution: {integrity: sha512-4FycO+BOTl2auLyF2Chvi6KTDqdsdDDtpaL/WHQMs8f3KS1E3loiUShQzAzFA/sMU5cJ0hz/RT1xum9YbG/zaA==}
+ engines: {node: '>=12.20.0'}
+ peerDependencies:
+ '@types/react': '>=17.0.0'
+ react: '>=17.0.0'
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ react:
+ optional: true
+
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
@@ -6121,10 +6340,10 @@ packages:
resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==}
- resolution: {integrity: sha512-xN6wuhUlcXeS4GsxZpd2DZp+m1jEZPckuCr90nQAXKRNl63GZ4KshIcGmqJEUqEygmv8Rf99MhcwF3DqBqQ9Dg==}
+ resolution: {integrity: sha512-kL+RGZCcJi9BvJtzg2kshO192Ddy9hv3ij+cPrVPWSRzgCWCVazoQJxOjAwgK53NomL07HB7GPHW120FimjNhQ==}
peerDependencies:
- react: ^16.5.1 || ^17.0.0 || ^18.0.0
+ react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc
resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==}
@@ -6546,6 +6765,9 @@ packages:
resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
+ resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==}
+
resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==}
hasBin: true
@@ -6784,6 +7006,9 @@ packages:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
+ resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
+
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
@@ -7168,6 +7393,12 @@ packages:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ resolution: {integrity: sha512-OE4hm7XqR0jNOq3Qmk9mFLyd6p2+j6bvbPJ7qlB7+oo0eNcL2l7WQzG6MBnT3EXY6xzkLMUBec3AfewJdA0J8w==}
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+
resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==}
engines: {node: '>=10'}
@@ -7227,6 +7458,16 @@ packages:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
+ resolution: {integrity: sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==}
+
+ resolution: {integrity: sha512-hlLJMhPQfv4/3NBSAyq3gzGg4h2v69RJh6KU7b3pXYNNAELs9kEoXOjbkxdXpALqKBoVmVptGfLpxdaVYqjmXQ==}
+ engines: {node: '>=14'}
+ peerDependencies:
+ react: ^16.0.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0
+
resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==}
engines: {node: '>=4'}
@@ -7450,6 +7691,9 @@ packages:
resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==}
+ resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}
+
resolution: {integrity: sha512-rUzLlXk4uPFnbEaIz3SW8VISTxMuONas88nYWjAWaM2W9VDbt9tyFOr3lq8RhVOFrT3XISoBw8vni5una8qMnQ==}
@@ -7647,8 +7891,8 @@ packages:
resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
- resolution: {integrity: sha512-sNRsJx7LPP2Gg6cBJoHJqhr+UoBVZZRes2BDqbrg+1FDBxJc4Yn+LkrpJ/VnL3XQ3+6I5GrOUnSSFfE/joDFjw==}
+ resolution: {integrity: sha512-Mwb0SitV/UjxTLSUiTlUQ0VDE/gfyQ7OHDGdvDdvKIH4CNNqobPKlzlWhoZHFFU0OA/YsZyBtPULK4JG86BAAg==}
engines: {node: '>=12.*'}
@@ -7732,8 +7976,8 @@ packages:
resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==}
engines: {node: '>=10'}
- resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==}
+ resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==}
engines: {node: '>= 10.13.0'}
peerDependencies:
'@swc/core': '*'
@@ -7753,6 +7997,11 @@ packages:
engines: {node: '>=10'}
hasBin: true
+ resolution: {integrity: sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6/RwRvM9SZjR4GUq8Nk8zj67FzVARr74w==}
+ engines: {node: '>=10'}
+ hasBin: true
+
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
@@ -7763,6 +8012,9 @@ packages:
resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==}
+ resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}
+
resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==}
@@ -7959,6 +8211,9 @@ packages:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
+ resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==}
+
resolution: {integrity: sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==}
engines: {node: '>=14.0'}
@@ -8087,6 +8342,12 @@ packages:
peerDependencies:
browserslist: '>= 4.21.0'
+ resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==}
+ hasBin: true
+ peerDependencies:
+ browserslist: '>= 4.21.0'
+
resolution: {integrity: sha512-eqbUpxSYtofT/aqqXHlaNJhpK94st6rGeEr8d2QmL0gHWKauS9w7J4jQ5Q7Jfmb2kMJj+pXW3duydkev/5G6Mw==}
engines: {node: '>=18.13.0'}
@@ -8166,6 +8427,9 @@ packages:
resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==}
+ resolution: {integrity: sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==}
+
resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==}
engines: {node: '>=v14.18.0'}
@@ -8236,8 +8500,8 @@ packages:
resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==}
- resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==}
+ resolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==}
engines: {node: '>=10.13.0'}
@@ -9203,21 +9467,38 @@ snapshots:
'@jridgewell/sourcemap-codec': 1.4.15
'@jridgewell/trace-mapping': 0.3.18
+ '@jridgewell/[email protected]':
+ dependencies:
+ '@jridgewell/set-array': 1.2.1
+ '@jridgewell/sourcemap-codec': 1.5.0
+ '@jridgewell/trace-mapping': 0.3.25
+
'@jridgewell/[email protected]': {}
'@jridgewell/[email protected]': {}
+ '@jridgewell/[email protected]': {}
+
'@jridgewell/[email protected]': {}
+ '@jridgewell/[email protected]': {}
+
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/gen-mapping': 0.3.3
'@jridgewell/trace-mapping': 0.3.20
+ '@jridgewell/[email protected]':
+ dependencies:
+ '@jridgewell/gen-mapping': 0.3.5
+ '@jridgewell/trace-mapping': 0.3.25
+
'@jridgewell/[email protected]': {}
'@jridgewell/[email protected]': {}
+ '@jridgewell/[email protected]': {}
+
'@jridgewell/[email protected]':
dependencies:
'@jridgewell/resolve-uri': 3.1.0
@@ -9228,6 +9509,11 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.1
'@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/[email protected]':
+ dependencies:
+ '@jridgewell/resolve-uri': 3.1.2
+ '@jridgewell/sourcemap-codec': 1.5.0
+
'@kwsites/[email protected]':
dependencies:
debug: 4.3.4
@@ -9311,7 +9597,7 @@ snapshots:
dependencies:
glob: 7.1.7
dependencies:
fast-glob: 3.3.1
@@ -9706,6 +9992,18 @@ snapshots:
'@types/react': 18.2.20
'@types/react-dom': 18.2.7
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-slot': 1.1.0(@types/[email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.2.20
+ '@types/react-dom': 18.2.7
+
dependencies:
'@babel/runtime': 7.22.6
@@ -9817,6 +10115,12 @@ snapshots:
optionalDependencies:
'@types/react': 18.2.20
+ dependencies:
+ react: 18.2.0
+ optionalDependencies:
+ '@types/react': 18.2.20
+
dependencies:
'@babel/runtime': 7.22.6
@@ -9961,6 +10265,13 @@ snapshots:
optionalDependencies:
'@types/react': 18.2.20
+ dependencies:
+ '@radix-ui/react-use-layout-effect': 1.1.0(@types/[email protected])([email protected])
+ react: 18.2.0
+ optionalDependencies:
+ '@types/react': 18.2.20
+
dependencies:
'@babel/runtime': 7.22.6
@@ -10243,6 +10554,23 @@ snapshots:
'@types/react': 18.2.20
'@types/react-dom': 18.2.7
+ dependencies:
+ '@radix-ui/primitive': 1.1.0
+ '@radix-ui/react-collection': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-compose-refs': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-id': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-use-callback-ref': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.2.20
+ '@types/react-dom': 18.2.7
+
dependencies:
'@babel/runtime': 7.22.6
@@ -10376,6 +10704,21 @@ snapshots:
'@types/react': 18.2.20
'@types/react-dom': 18.2.7
+ dependencies:
+ '@radix-ui/primitive': 1.1.0
+ '@radix-ui/react-context': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-direction': 1.1.0(@types/[email protected])([email protected])
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-roving-focus': 1.1.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.2.20
+ '@types/react-dom': 18.2.7
+
dependencies:
'@babel/runtime': 7.22.6
@@ -10388,6 +10731,17 @@ snapshots:
'@types/react': 18.2.20
'@types/react-dom': 18.2.7
+ dependencies:
+ '@radix-ui/primitive': 1.1.0
+ '@radix-ui/react-primitive': 2.0.0(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])
+ '@radix-ui/react-use-controllable-state': 1.1.0(@types/[email protected])([email protected])
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+ optionalDependencies:
+ '@types/react': 18.2.20
+ '@types/react-dom': 18.2.7
+
dependencies:
'@babel/runtime': 7.22.6
@@ -10738,7 +11092,7 @@ snapshots:
localforage: 1.10.0
tslib: 2.6.0
dependencies:
'@rollup/plugin-commonjs': 24.0.0([email protected])
'@sentry/core': 7.73.0
@@ -10750,7 +11104,7 @@ snapshots:
'@sentry/vercel-edge': 7.73.0
'@sentry/webpack-plugin': 1.20.0
chalk: 3.0.0
react: 18.2.0
rollup: 2.78.0
stacktrace-parser: 0.1.10
@@ -10820,14 +11174,14 @@ snapshots:
'@sindresorhus/[email protected]': {}
dependencies:
- '@stripe/stripe-js': 4.7.0
+ '@stripe/stripe-js': 4.9.0
prop-types: 15.8.1
react: 18.2.0
react-dom: 18.2.0([email protected])
- '@stripe/[email protected]': {}
+ '@stripe/[email protected]': {}
'@swc/[email protected]': {}
@@ -10982,6 +11336,30 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/d3-color': 3.1.3
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/d3-time': 3.0.3
+
+ '@types/[email protected]':
+ dependencies:
+ '@types/d3-path': 3.1.0
+
+ '@types/[email protected]': {}
+
+ '@types/[email protected]': {}
+
dependencies:
'@types/ms': 0.7.31
@@ -10990,18 +11368,20 @@ snapshots:
dependencies:
- '@types/eslint': 8.44.9
- '@types/estree': 1.0.5
+ '@types/eslint': 9.6.1
+ '@types/estree': 1.0.6
- '@types/[email protected]':
+ '@types/[email protected]':
dependencies:
- '@types/estree': 1.0.5
+ '@types/estree': 1.0.6
'@types/json-schema': 7.0.15
'@types/[email protected]': {}
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
'@types/[email protected]': {}
@@ -11016,7 +11396,7 @@ snapshots:
dependencies:
- '@types/node': 20.10.4
+ '@types/node': 20.16.5
'@types/[email protected]': {}
@@ -11026,7 +11406,7 @@ snapshots:
dependencies:
- '@types/node': 20.10.4
+ '@types/node': 20.16.15
'@types/[email protected]': {}
@@ -11044,13 +11424,21 @@ snapshots:
dependencies:
- '@types/node': 20.10.4
+ '@types/node': 20.16.5
form-data: 3.0.1
dependencies:
undici-types: 5.26.5
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 6.19.8
+
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 6.19.8
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -11261,7 +11649,7 @@ snapshots:
'@uploadthing/[email protected]': {}
dependencies:
'@uploadthing/dropzone': 0.1.1
'@uploadthing/shared': 6.2.0(@uploadthing/[email protected])
@@ -11271,7 +11659,7 @@ snapshots:
tailwind-merge: 1.14.0
uploadthing: 6.3.1
optionalDependencies:
transitivePeerDependencies:
- '@uploadthing/mime-types'
@@ -11314,12 +11702,12 @@ snapshots:
satori: 0.0.46
yoga-wasm-web: 0.3.0
optionalDependencies:
react: 18.2.0
dependencies:
'@babel/core': 7.22.10
'@babel/eslint-parser': 7.22.10(@babel/[email protected])([email protected])
@@ -11327,7 +11715,7 @@ snapshots:
'@typescript-eslint/eslint-plugin': 5.59.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint-config-prettier: 8.10.0([email protected])
- eslint-import-resolver-alias: 1.1.2([email protected])
+ eslint-import-resolver-alias: 1.1.2([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))
eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
eslint-plugin-eslint-comments: 3.2.0([email protected])
@@ -11341,7 +11729,7 @@ snapshots:
eslint-plugin-unicorn: 43.0.2([email protected])
prettier-plugin-packagejson: 2.4.3([email protected])
optionalDependencies:
- '@next/eslint-plugin-next': 15.0.1-canary.1
+ '@next/eslint-plugin-next': 15.0.2-canary.3
eslint: 8.45.0
prettier: 3.1.1
typescript: 5.3.3
@@ -11351,7 +11739,7 @@ snapshots:
- jest
- supports-color
dependencies:
'@tinyhttp/app': 1.3.0
chokidar: 3.5.3
@@ -11360,8 +11748,9 @@ snapshots:
get-port: 5.1.1
strip-ansi: 6.0.1
optionalDependencies:
react: 18.2.0
+ vite: 4.5.0(@types/[email protected])([email protected])
'@vitest/[email protected]':
dependencies:
@@ -11391,7 +11780,7 @@ snapshots:
loupe: 2.3.7
pretty-format: 29.7.0
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
'@webassemblyjs/helper-numbers': 1.11.6
'@webassemblyjs/helper-wasm-bytecode': 1.11.6
@@ -11400,7 +11789,7 @@ snapshots:
'@webassemblyjs/[email protected]': {}
- '@webassemblyjs/[email protected]': {}
+ '@webassemblyjs/[email protected]': {}
'@webassemblyjs/[email protected]':
dependencies:
@@ -11410,12 +11799,12 @@ snapshots:
'@webassemblyjs/[email protected]': {}
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.11.6
- '@webassemblyjs/helper-buffer': 1.11.6
+ '@webassemblyjs/ast': 1.12.1
+ '@webassemblyjs/helper-buffer': 1.12.1
'@webassemblyjs/helper-wasm-bytecode': 1.11.6
- '@webassemblyjs/wasm-gen': 1.11.6
+ '@webassemblyjs/wasm-gen': 1.12.1
'@webassemblyjs/[email protected]':
dependencies:
@@ -11427,44 +11816,44 @@ snapshots:
'@webassemblyjs/[email protected]': {}
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.11.6
- '@webassemblyjs/helper-buffer': 1.11.6
+ '@webassemblyjs/ast': 1.12.1
+ '@webassemblyjs/helper-buffer': 1.12.1
'@webassemblyjs/helper-wasm-bytecode': 1.11.6
- '@webassemblyjs/helper-wasm-section': 1.11.6
- '@webassemblyjs/wasm-gen': 1.11.6
- '@webassemblyjs/wasm-opt': 1.11.6
- '@webassemblyjs/wasm-parser': 1.11.6
- '@webassemblyjs/wast-printer': 1.11.6
+ '@webassemblyjs/helper-wasm-section': 1.12.1
+ '@webassemblyjs/wasm-gen': 1.12.1
+ '@webassemblyjs/wasm-opt': 1.12.1
+ '@webassemblyjs/wasm-parser': 1.12.1
+ '@webassemblyjs/wast-printer': 1.12.1
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/ast': 1.12.1
'@webassemblyjs/helper-wasm-bytecode': 1.11.6
'@webassemblyjs/ieee754': 1.11.6
'@webassemblyjs/leb128': 1.11.6
'@webassemblyjs/utf8': 1.11.6
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.11.6
- '@webassemblyjs/helper-buffer': 1.11.6
- '@webassemblyjs/wasm-gen': 1.11.6
- '@webassemblyjs/wasm-parser': 1.11.6
+ '@webassemblyjs/ast': 1.12.1
+ '@webassemblyjs/helper-buffer': 1.12.1
+ '@webassemblyjs/wasm-gen': 1.12.1
+ '@webassemblyjs/wasm-parser': 1.12.1
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/ast': 1.12.1
'@webassemblyjs/helper-api-error': 1.11.6
'@webassemblyjs/helper-wasm-bytecode': 1.11.6
'@webassemblyjs/ieee754': 1.11.6
'@webassemblyjs/leb128': 1.11.6
'@webassemblyjs/utf8': 1.11.6
- '@webassemblyjs/[email protected]':
+ '@webassemblyjs/[email protected]':
dependencies:
- '@webassemblyjs/ast': 1.11.6
+ '@webassemblyjs/ast': 1.12.1
'@xtuc/long': 4.2.2
'@xtuc/[email protected]': {}
@@ -11473,9 +11862,9 @@ snapshots:
dependencies:
- acorn: 8.11.2
+ acorn: 8.13.0
dependencies:
@@ -11487,6 +11876,8 @@ snapshots:
+
dependencies:
debug: 4.3.4
@@ -11749,6 +12140,13 @@ snapshots:
node-releases: 2.0.14
update-browserslist-db: 1.0.13([email protected])
+ dependencies:
+ caniuse-lite: 1.0.30001669
+ electron-to-chromium: 1.5.43
+ node-releases: 2.0.18
+ update-browserslist-db: 1.1.1([email protected])
+
@@ -11801,6 +12199,8 @@ snapshots:
+
@@ -11867,7 +12267,7 @@ snapshots:
@@ -12146,6 +12546,44 @@ snapshots:
+ dependencies:
+ internmap: 2.0.3
+
+
+
+
+ dependencies:
+ d3-color: 3.1.0
+
+
+ dependencies:
+ d3-array: 3.2.4
+ d3-format: 3.1.0
+ d3-interpolate: 3.0.1
+ d3-time: 3.1.0
+ d3-time-format: 4.1.0
+
+ dependencies:
+ d3-path: 3.1.0
+
+ dependencies:
+ d3-time: 3.1.0
+
+ dependencies:
+ d3-array: 3.2.4
+
+
@@ -12166,6 +12604,8 @@ snapshots:
dependencies:
ms: 2.1.2
+
dependencies:
character-entities: 2.0.2
@@ -12322,6 +12762,8 @@ snapshots:
+
@@ -12337,6 +12779,11 @@ snapshots:
graceful-fs: 4.2.11
tapable: 2.2.1
+ dependencies:
+ graceful-fs: 4.2.11
+ tapable: 2.2.1
+
@@ -12395,7 +12842,7 @@ snapshots:
dependencies:
mime-db: 1.52.0
dependencies:
@@ -12579,6 +13026,8 @@ snapshots:
+
@@ -12594,8 +13043,8 @@ snapshots:
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
+ eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
eslint-plugin-jsx-a11y: 6.7.1([email protected])
eslint-plugin-react: 7.32.2([email protected])
eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705([email protected])
@@ -12632,7 +13081,7 @@ snapshots:
eslint: 8.45.0
eslint-plugin-turbo: 2.0.12([email protected])
dependencies:
@@ -12644,13 +13093,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.45.0
- eslint-plugin-import: 2.27.5([email protected])
get-tsconfig: 4.6.2
globby: 13.2.2
is-core-module: 2.12.1
@@ -12667,7 +13116,7 @@ snapshots:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.45.0
get-tsconfig: 4.6.2
globby: 13.2.2
@@ -12685,7 +13134,7 @@ snapshots:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.56.0
get-tsconfig: 4.6.2
globby: 13.2.2
@@ -12698,18 +13147,18 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
+ eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
@@ -12720,7 +13169,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
@@ -12737,7 +13186,7 @@ snapshots:
eslint: 8.45.0
ignore: 5.2.4
dependencies:
array-includes: 3.1.6
array.prototype.flat: 1.3.1
@@ -12746,7 +13195,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12762,7 +13211,7 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
array-includes: 3.1.6
array.prototype.flat: 1.3.1
@@ -12771,7 +13220,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12796,7 +13245,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.56.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12812,29 +13261,6 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
- dependencies:
- array-includes: 3.1.6
- array.prototype.flat: 1.3.1
- array.prototype.flatmap: 1.3.1
- debug: 3.2.7
- doctrine: 2.1.0
- eslint: 8.45.0
- eslint-import-resolver-node: 0.3.7
- has: 1.0.3
- is-core-module: 2.12.1
- is-glob: 4.0.3
- minimatch: 3.1.2
- object.values: 1.1.6
- resolve: 1.22.2
- semver: 6.3.1
- tsconfig-paths: 3.14.2
- transitivePeerDependencies:
- - eslint-import-resolver-typescript
- - eslint-import-resolver-webpack
- - supports-color
-
dependencies:
'@typescript-eslint/utils': 5.59.1([email protected])([email protected])
@@ -13122,6 +13548,8 @@ snapshots:
+
@@ -13211,7 +13639,7 @@ snapshots:
dependencies:
- flat-cache: 3.0.4
+ flat-cache: 3.1.1
dependencies:
@@ -13244,11 +13672,6 @@ snapshots:
locate-path: 7.2.0
path-exists: 5.0.0
- dependencies:
- flatted: 3.2.7
- rimraf: 3.0.2
-
dependencies:
flatted: 3.2.9
@@ -13257,8 +13680,6 @@ snapshots:
-
@@ -13806,6 +14227,8 @@ snapshots:
has: 1.0.3
side-channel: 1.0.4
+
dependencies:
loose-envify: 1.4.0
@@ -13984,7 +14407,7 @@ snapshots:
dependencies:
- '@types/node': 20.10.4
+ '@types/node': 20.16.15
merge-stream: 2.0.0
supports-color: 8.1.1
@@ -13994,6 +14417,11 @@ snapshots:
+ optionalDependencies:
+ '@types/react': 18.2.20
+ react: 18.2.0
+
@@ -14201,7 +14629,7 @@ snapshots:
dependencies:
react: 18.2.0
@@ -14698,15 +15126,15 @@ snapshots:
dependencies:
'@auth/core': 0.19.0
react: 18.3.1
dependencies:
react: 18.2.0
react-dom: 18.2.0([email protected])
@@ -14716,13 +15144,13 @@ snapshots:
react: 18.2.0
react-dom: 18.2.0([email protected])
dependencies:
react: 18.2.0
react-dom: 18.3.1([email protected])
dependencies:
'@next/env': 14.2.5
'@swc/helpers': 0.5.5
@@ -14743,6 +15171,7 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.2.5
'@next/swc-win32-ia32-msvc': 14.2.5
'@next/swc-win32-x64-msvc': 14.2.5
+ '@playwright/test': 1.38.0
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
@@ -14773,7 +15202,7 @@ snapshots:
- '@babel/core'
- babel-plugin-macros
dependencies:
'@next/env': 14.2.5
'@swc/helpers': 0.5.5
@@ -14794,11 +15223,12 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.2.5
'@next/swc-win32-ia32-msvc': 14.2.5
'@next/swc-win32-x64-msvc': 14.2.5
+ '@playwright/test': 1.38.0
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
dependencies:
'@next/env': 14.2.5
'@swc/helpers': 0.5.5
@@ -14819,6 +15249,7 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.2.5
'@next/swc-win32-ia32-msvc': 14.2.5
'@next/swc-win32-x64-msvc': 14.2.5
+ '@playwright/test': 1.38.0
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
@@ -14931,6 +15362,8 @@ snapshots:
+
dependencies:
abbrev: 1.1.1
@@ -15193,6 +15626,8 @@ snapshots:
+
@@ -15427,9 +15862,9 @@ snapshots:
react: 18.2.0
use-sync-external-store: 1.2.0([email protected])
dependencies:
@@ -15522,6 +15957,14 @@ snapshots:
transitivePeerDependencies:
- '@types/react'
+ dependencies:
+ fast-equals: 5.0.1
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+ react-transition-group: 4.4.5([email protected]([email protected]))([email protected])
+
dependencies:
get-nonce: 1.0.1
@@ -15549,6 +15992,15 @@ snapshots:
react: 18.2.0
react-dom: 18.2.0([email protected])
+ dependencies:
+ '@babel/runtime': 7.22.6
+ dom-helpers: 5.2.1
+ loose-envify: 1.4.0
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+
dependencies:
react: 18.2.0
@@ -15602,6 +16054,23 @@ snapshots:
dependencies:
picomatch: 2.3.1
+ dependencies:
+ decimal.js-light: 2.5.1
+
+ dependencies:
+ clsx: 2.0.0
+ eventemitter3: 4.0.7
+ lodash: 4.17.21
+ react: 18.2.0
+ react-dom: 18.3.1([email protected])
+ react-is: 16.13.1
+ recharts-scale: 0.4.5
+ tiny-invariant: 1.3.3
+ victory-vendor: 36.9.2
+
@@ -15915,6 +16384,10 @@ snapshots:
dependencies:
randombytes: 2.1.0
+ dependencies:
+ randombytes: 2.1.0
+
dependencies:
defu: 6.1.3
@@ -16115,9 +16588,9 @@ snapshots:
dependencies:
acorn: 8.10.0
dependencies:
- '@types/node': 20.10.4
+ '@types/node': 20.16.15
qs: 6.11.2
@@ -16238,13 +16711,13 @@ snapshots:
mkdirp: 1.0.4
yallist: 4.0.0
dependencies:
- '@jridgewell/trace-mapping': 0.3.20
+ '@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 3.3.0
- serialize-javascript: 6.0.1
- terser: 5.26.0
+ serialize-javascript: 6.0.2
+ terser: 5.36.0
webpack: 5.89.0
@@ -16254,6 +16727,13 @@ snapshots:
commander: 2.20.3
source-map-support: 0.5.21
+ dependencies:
+ '@jridgewell/source-map': 0.3.6
+ acorn: 8.13.0
+ commander: 2.20.3
+ source-map-support: 0.5.21
+
@@ -16264,6 +16744,8 @@ snapshots:
dependencies:
any-promise: 1.3.0
+
@@ -16446,6 +16928,8 @@ snapshots:
+
dependencies:
'@fastify/busboy': 2.1.0
@@ -16599,6 +17083,12 @@ snapshots:
escalade: 3.1.1
picocolors: 1.0.0
+ dependencies:
+ browserslist: 4.24.2
+ escalade: 3.2.0
+ picocolors: 1.1.1
+
dependencies:
'@uploadthing/mime-types': 0.2.2
@@ -16691,14 +17181,31 @@ snapshots:
unist-util-stringify-position: 4.0.0
vfile-message: 4.0.2
+ dependencies:
+ '@types/d3-array': 3.2.1
+ '@types/d3-ease': 3.0.2
+ '@types/d3-interpolate': 3.0.4
+ '@types/d3-scale': 4.0.8
+ '@types/d3-shape': 3.1.6
+ '@types/d3-time': 3.0.3
+ '@types/d3-timer': 3.0.2
+ d3-array: 3.2.4
+ d3-ease: 3.0.1
+ d3-interpolate: 3.0.1
+ d3-scale: 4.0.2
+ d3-shape: 3.2.0
+ d3-time: 3.1.0
+ d3-timer: 3.0.1
+
dependencies:
cac: 6.7.14
debug: 4.3.4
mlly: 1.4.2
pathe: 1.1.1
picocolors: 1.0.0
- vite: 4.5.0(@types/[email protected])([email protected])
+ vite: 4.5.0(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@types/node'
- less
@@ -16709,21 +17216,32 @@ snapshots:
- supports-color
- terser
dependencies:
esbuild: 0.18.20
postcss: 8.4.31
rollup: 3.28.1
optionalDependencies:
- '@types/node': 20.10.4
+ '@types/node': 20.16.5
fsevents: 2.3.3
- terser: 5.26.0
+ terser: 5.36.0
+
+ dependencies:
+ esbuild: 0.18.20
+ postcss: 8.4.31
+ rollup: 3.28.1
+ optionalDependencies:
+ '@types/node': 20.4.2
+ fsevents: 2.3.3
+ terser: 5.36.0
+ optional: true
dependencies:
'@types/chai': 4.3.9
'@types/chai-subset': 1.3.4
- '@types/node': 20.10.4
+ '@types/node': 20.16.5
'@vitest/expect': 0.34.6
'@vitest/runner': 0.34.6
'@vitest/snapshot': 0.34.6
@@ -16742,8 +17260,8 @@ snapshots:
strip-literal: 1.3.0
tinybench: 2.5.1
tinypool: 0.7.0
- vite: 4.5.0(@types/[email protected])([email protected])
- vite-node: 0.34.6(@types/[email protected])([email protected])
+ vite: 4.5.0(@types/[email protected])([email protected])
+ vite-node: 0.34.6(@types/[email protected])([email protected])
why-is-node-running: 2.2.2
optionalDependencies:
playwright: 1.38.0
@@ -16760,7 +17278,7 @@ snapshots:
dependencies:
glob-to-regexp: 0.4.1
graceful-fs: 4.2.11
@@ -16795,16 +17313,16 @@ snapshots:
dependencies:
'@types/eslint-scope': 3.7.7
- '@types/estree': 1.0.5
- '@webassemblyjs/ast': 1.11.6
- '@webassemblyjs/wasm-edit': 1.11.6
- '@webassemblyjs/wasm-parser': 1.11.6
- acorn: 8.11.2
- acorn-import-assertions: 1.9.0([email protected])
- browserslist: 4.22.2
- chrome-trace-event: 1.0.3
- enhanced-resolve: 5.15.0
- es-module-lexer: 1.4.1
+ '@types/estree': 1.0.6
+ '@webassemblyjs/ast': 1.12.1
+ '@webassemblyjs/wasm-edit': 1.12.1
+ '@webassemblyjs/wasm-parser': 1.12.1
+ acorn: 8.13.0
+ acorn-import-assertions: 1.9.0([email protected])
+ browserslist: 4.24.2
+ chrome-trace-event: 1.0.4
+ enhanced-resolve: 5.17.1
+ es-module-lexer: 1.5.4
eslint-scope: 5.1.1
events: 3.3.0
glob-to-regexp: 0.4.1
@@ -16815,8 +17333,8 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
- terser-webpack-plugin: 5.3.9([email protected])
- watchpack: 2.4.0
+ terser-webpack-plugin: 5.3.10([email protected])
+ watchpack: 2.4.2
webpack-sources: 3.2.3
transitivePeerDependencies:
- '@swc/core'