Skip to content

Open-source status page, incident response and uptime monitoring

feat: tremor charts incl. small fixes (#361)

Maximilian Kaske07e51763311f
diff --git a/apps/web/package.json b/apps/web/package.json
index 27463644c..529aab2cb 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -11,6 +11,7 @@
},
"dependencies": {
"@clerk/nextjs": "4.25.1",
+ "@headlessui/react": "^1.7.17",
"@hookform/resolvers": "3.3.1",
"@openstatus/analytics": "workspace:*",
"@openstatus/api": "workspace:*",
@@ -28,6 +29,7 @@
"@t3-oss/env-nextjs": "0.6.1",
"@tailwindcss/typography": "0.5.10",
"@tanstack/react-table": "8.10.3",
+ "@tremor/react": "^3.8.2",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
diff --git a/apps/web/public/assets/changelog/response-time-charts.png b/apps/web/public/assets/changelog/response-time-charts.png
new file mode 100644
index 000000000..d583c5cd4
Binary files /dev/null and b/apps/web/public/assets/changelog/response-time-charts.png differ
diff --git a/apps/web/src/app/(content)/blog/page.tsx b/apps/web/src/app/(content)/blog/page.tsx
index 325c4cf7a..b1d26262f 100644
--- a/apps/web/src/app/(content)/blog/page.tsx
+++ b/apps/web/src/app/(content)/blog/page.tsx
@@ -1,8 +1,30 @@
+import type { Metadata } from "next";
+import Link from "next/link";
import { allPosts } from "contentlayer/generated";
-import { Thumbnail } from "@/components/content/thumbnail";
+import { Button } from "@openstatus/ui";
+
+import {
+ defaultMetadata,
+ ogMetadata,
+ twitterMetadata,
+} from "@/app/shared-metadata";
+import { Timeline } from "@/components/content/timeline";
import { Shell } from "@/components/dashboard/shell";
+export const metadata: Metadata = {
+ ...defaultMetadata,
+ title: "Blog",
+ openGraph: {
+ ...ogMetadata,
+ title: "Blog | OpenStatus",
+ },
+ twitter: {
+ ...twitterMetadata,
+ title: "Blog | OpenStatus",
+ },
+};
+
export default async function Post() {
const posts = allPosts.sort(
(a, b) =>
@@ -11,14 +33,28 @@ export default async function Post() {
return (
<Shell>
- <div className="grid gap-8">
- <h1 className="text-foreground font-cal text-4xl">Blog</h1>
- <div className="space-y-4">
- {posts.map((post) => (
- <Thumbnail key={post._id} post={post} />
- ))}
- </div>
- </div>
+ <Timeline
+ title="Blog"
+ description="All the latest articles and news from OpenStatus."
+ >
+ {posts.map((post) => (
+ <Timeline.Article
+ key={post.slug}
+ publishedAt={post.publishedAt}
+ imageSrc={post.image}
+ title={post.title}
+ >
+ <div className="prose">
+ <p>{post.description}</p>
+ </div>
+ <div>
+ <Button variant="outline" className="rounded-full" asChild>
+ <Link href={`./blog/${post.slug}`}>Read more</Link>
+ </Button>
+ </div>
+ </Timeline.Article>
+ ))}
+ </Timeline>
</Shell>
);
}
diff --git a/apps/web/src/app/(content)/changelog/page.tsx b/apps/web/src/app/(content)/changelog/page.tsx
index af1edf230..0ffce79e1 100644
--- a/apps/web/src/app/(content)/changelog/page.tsx
+++ b/apps/web/src/app/(content)/changelog/page.tsx
@@ -1,11 +1,28 @@
-import Image from "next/image";
+import type { Metadata } from "next";
import { allChangelogs } from "contentlayer/generated";
+import {
+ defaultMetadata,
+ ogMetadata,
+ twitterMetadata,
+} from "@/app/shared-metadata";
import { Mdx } from "@/components/content/mdx";
+import { Timeline } from "@/components/content/timeline";
import { Shell } from "@/components/dashboard/shell";
-import { formatDate } from "@/lib/utils";
-export default async function Post() {
+export const metadata: Metadata = {
+ ...defaultMetadata,
+ title: "Changelog",
+ openGraph: {
+ ...ogMetadata,
+ title: "Changelog | OpenStatus",
+ },
+ twitter: {
+ ...twitterMetadata,
+ title: "Changelog | OpenStatus",
+ },
+};
+export default async function Changelog() {
const posts = allChangelogs.sort(
(a, b) =>
new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime(),
@@ -13,41 +30,21 @@ export default async function Post() {
return (
<Shell>
- <div className="grid gap-8">
- <div className="grid gap-4 md:grid-cols-5 md:gap-8">
- <div className="md:col-span-1" />
- <div className="grid gap-4 md:col-span-4">
- <h1 className="text-foreground font-cal text-4xl">Changelog</h1>
- <p className="text-muted-foreground">
- All the latest features, fixes and work to OpenStatus.
- </p>
- </div>
- </div>
+ <Timeline
+ title="Changelog"
+ description="All the latest features, fixes and work to OpenStatus."
+ >
{posts.map((post) => (
- <article
+ <Timeline.Article
key={post.slug}
- className="grid gap-4 md:grid-cols-5 md:gap-6"
+ publishedAt={post.publishedAt}
+ imageSrc={post.image}
+ title={post.title}
>
- <time className="text-muted-foreground order-2 font-mono text-sm md:order-1 md:col-span-1">
- {formatDate(new Date(post.publishedAt))}
- </time>
- <div className="relative order-1 h-64 w-full md:order-2 md:col-span-4">
- <Image
- src={post.image}
- fill={true}
- alt={post.title}
- className="border-border rounded-md border object-cover"
- />
- </div>
- <h3 className="text-foreground font-cal order-3 text-2xl md:col-span-4 md:col-start-2">
- {post.title}
- </h3>
- <div className="order-4 md:col-span-4 md:col-start-2">
- <Mdx code={post.body.code} />
- </div>
- </article>
+ <Mdx code={post.body.code} />
+ </Timeline.Article>
))}
- </div>
+ </Timeline>
</Shell>
);
}
diff --git a/apps/web/src/app/(content)/layout.tsx b/apps/web/src/app/(content)/layout.tsx
index fe800ca92..037d14919 100644
--- a/apps/web/src/app/(content)/layout.tsx
+++ b/apps/web/src/app/(content)/layout.tsx
@@ -2,7 +2,7 @@ import * as React from "react";
import { MarketingLayout } from "@/components/layout/marketing-layout";
-export default function BlogLayout({
+export default function ContentLayout({
children,
}: {
children: React.ReactNode;
diff --git a/apps/web/src/app/api/og/post/route.tsx b/apps/web/src/app/api/og/post/route.tsx
index 281eefae5..51f465e0d 100644
--- a/apps/web/src/app/api/og/post/route.tsx
+++ b/apps/web/src/app/api/og/post/route.tsx
@@ -1,6 +1,8 @@
/* eslint-disable @next/next/no-img-element */
import { ImageResponse } from "next/server";
+import { DESCRIPTION, TITLE } from "@/app/shared-metadata";
+
export const runtime = "edge";
const DEFAULT_URL = process.env.VERCEL_URL
@@ -12,9 +14,6 @@ const size = {
height: 630,
};
-const TITLE = "OpenStatus";
-const DESCRIPTION = "An Open Source Alternative for your next Status Page";
-
const interRegular = fetch(
new URL("../../../../public/fonts/Inter-Regular.ttf", import.meta.url),
).then((res) => res.arrayBuffer());
diff --git a/apps/web/src/app/api/og/route.tsx b/apps/web/src/app/api/og/route.tsx
index 42af998e8..ff207b120 100644
--- a/apps/web/src/app/api/og/route.tsx
+++ b/apps/web/src/app/api/og/route.tsx
@@ -1,5 +1,6 @@
import { ImageResponse } from "next/server";
+import { DESCRIPTION, TITLE } from "@/app/shared-metadata";
import { getMonitorListData } from "@/lib/tb";
import { blacklistDates, getMonitorList, getStatus } from "@/lib/tracker";
import { cn, formatDate } from "@/lib/utils";
@@ -11,8 +12,6 @@ const size = {
height: 630,
};
-const TITLE = "OpenStatus";
-const DESCRIPTION = "An Open Source monitoring platform for serverless";
const LIMIT = 40;
const interRegular = fetch(
diff --git a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/chart-wrapper.tsx b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/chart-wrapper.tsx
new file mode 100644
index 000000000..e8d8f3323
--- /dev/null
+++ b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/chart-wrapper.tsx
@@ -0,0 +1,70 @@
+/** NOT USING THE CLIENT TO CALCULATE THE GROUPED DATA */
+import type { Ping, Region } from "@openstatus/tinybird";
+
+import type { Period } from "../utils";
+import { Chart } from "./chart";
+
+export function ChartWrapper({
+ data,
+ period,
+}: {
+ data: Ping[];
+ period: Period;
+}) {
+ const group = groupDataByTimestamp(data, period);
+ return <Chart data={group.data} regions={group.regions} />;
+}
+/**
+ *
+ * @param data expects to be sorted by cronTimestamp
+ * @param period
+ * @returns
+ */
+function groupDataByTimestamp(data: Ping[], period: Period) {
+ let currentTimestamp = 0;
+ const regions: Partial<Record<Region, null>> = {};
+ const _data = data.reduce(
+ (acc, curr) => {
+ const { cronTimestamp, latency, region } = curr;
+ regions[region] = null; // to get the region keys
+ if (cronTimestamp === currentTimestamp) {
+ // overwrite last object in acc
+ const last = acc.pop();
+ if (last) {
+ acc.push({
+ ...last,
+ [region]: latency,
+ });
+ }
+ } else if (cronTimestamp) {
+ currentTimestamp = cronTimestamp;
+ // create new object in acc
+ acc.push({
+ timestamp: renderTimestamp(cronTimestamp, period),
+ [region]: latency,
+ });
+ }
+ return acc;
+ },
+ [] as (Partial<Record<Region, string>> & { timestamp: string })[],
+ );
+ return { regions: Object.keys(regions) as Region[], data: _data.reverse() };
+}
+
+/**
+ * in case we need to change the format of the timestamp
+ * based on the period
+ * @param timestamp
+ * @param period
+ * @returns
+ */
+function renderTimestamp(timestamp: number, period: Period) {
+ const isInDay = ["hour", "day"].includes(period);
+ return new Date(timestamp).toLocaleString("en-US", {
+ year: !isInDay ? "numeric" : undefined,
+ month: !isInDay ? "numeric" : undefined,
+ day: !isInDay ? "numeric" : undefined,
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+}
diff --git a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/chart.tsx b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/chart.tsx
new file mode 100644
index 000000000..f7e3a0182
--- /dev/null
+++ b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/chart.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { Card, LineChart, Title } from "@tremor/react";
+
+import type { Region } from "@openstatus/tinybird";
+
+const dataFormatter = (number: number) =>
+ `${Intl.NumberFormat("us").format(number).toString()}ms`;
+
+interface ChartProps {
+ data: (Partial<Record<Region, string>> & { timestamp: string })[];
+ regions: Region[];
+}
+
+export function Chart({ data, regions }: ChartProps) {
+ return (
+ <Card>
+ <Title>Response Time</Title>
+ <LineChart
+ data={data}
+ yAxisWidth={64}
+ index="timestamp"
+ categories={regions}
+ colors={[
+ "blue",
+ "amber",
+ "cyan",
+ "yellow",
+ "red",
+ "indigo",
+ "lime",
+ "purple",
+ "green",
+ "orange",
+ "sky",
+ "rose",
+ "violet",
+ "teal",
+ "fuchsia",
+ "pink",
+ "emerald",
+ ]}
+ onValueChange={(v) => void 0} // that prop makes the chart interactive
+ valueFormatter={dataFormatter}
+ />
+ </Card>
+ );
+}
diff --git a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/date-picker-preset.tsx b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/date-picker-preset.tsx
new file mode 100644
index 000000000..2a6f03f59
--- /dev/null
+++ b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/_components/date-picker-preset.tsx
@@ -0,0 +1,66 @@
+"use client";
+
+import * as React from "react";
+import { usePathname, useRouter } from "next/navigation";
+import { CalendarIcon } from "lucide-react";
+
+import {
+ Button,
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@openstatus/ui";
+
+import useUpdateSearchParams from "@/hooks/use-update-search-params";
+import { cn } from "@/lib/utils";
+import type { Period } from "../utils";
+
+export function DatePickerPreset({ period }: { period: Period }) {
+ const router = useRouter();
+ const pathname = usePathname();
+ const updateSearchParams = useUpdateSearchParams();
+
+ function onSelect(value: Period) {
+ const searchParams = updateSearchParams({
+ period: value,
+ });
+ router.replace(`${pathname}?${searchParams}`);
+ }
+
+ function renderLabel() {
+ if (period === "hour") return "Last hour";
+ if (period === "day") return "Today";
+ if (period === "3d") return "Last 3 days";
+ return "Pick a range";
+ }
+
+ return (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button
+ id="date"
+ variant={"outline"}
+ className={cn(
+ "w-[140px] justify-start text-left font-normal",
+ !period && "text-muted-foreground",
+ )}
+ >
+ <CalendarIcon className="mr-2 h-4 w-4" />
+ {renderLabel()}
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent>
+ <DropdownMenuItem onClick={() => onSelect("hour")}>
+ Last hour
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => onSelect("day")}>
+ Today
+ </DropdownMenuItem>
+ <DropdownMenuItem onClick={() => onSelect("3d")}>
+ Last 3 days
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ );
+}
diff --git a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/loading.tsx b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/loading.tsx
index fe2b832b5..1ec444487 100644
--- a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/loading.tsx
+++ b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/loading.tsx
@@ -1,17 +1,19 @@
import { Skeleton } from "@openstatus/ui";
-import { Container } from "@/components/dashboard/container";
import { Header } from "@/components/dashboard/header";
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton";
export default function Loading() {
return (
<div className="grid gap-6 md:gap-8">
- <Header.Skeleton />
+ <Header.Skeleton>
+ <Skeleton className="h-9 w-32" />
+ </Header.Skeleton>
+ <Skeleton className="h-[396px] w-full" />
<div className="grid gap-3">
- <div className="flex items-center justify-between gap-3">
- <Skeleton className="h-8 w-64" />
- <Skeleton className="h-8 w-64" />
+ <div className="flex items-center gap-3">
+ <Skeleton className="h-8 w-32" />
+ <Skeleton className="h-8 w-16" />
</div>
<DataTableSkeleton rows={7} />
</div>
diff --git a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/page.tsx b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/page.tsx
index 433dba582..bbad04089 100644
--- a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/page.tsx
+++ b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/page.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
import { notFound } from "next/navigation";
+import { endOfDay, startOfDay } from "date-fns";
import * as z from "zod";
import { availableRegions } from "@openstatus/tinybird";
@@ -9,8 +10,11 @@ import { columns } from "@/components/data-table/columns";
import { DataTable } from "@/components/data-table/data-table";
import { getResponseListData } from "@/lib/tb";
import { api } from "@/trpc/server";
+import { ChartWrapper } from "./_components/chart-wrapper";
+import { DatePickerPreset } from "./_components/date-picker-preset";
+import { getPeriodDate, periods } from "./utils";
-export const revalidate = 0; // revalidate this page every 10 minutes
+export const revalidate = 0;
/**
* allowed URL search params
@@ -19,8 +23,12 @@ const searchParamsSchema = z.object({
statusCode: z.coerce.number().optional(),
region: z.enum(availableRegions).optional(),
cronTimestamp: z.coerce.number().optional(),
- fromDate: z.coerce.number().optional(),
- toDate: z.coerce.number().optional(),
+ fromDate: z.coerce
+ .number()
+ .optional()
+ .default(startOfDay(new Date()).getTime()),
+ toDate: z.coerce.number().optional().default(endOfDay(new Date()).getTime()),
+ period: z.enum(periods).optional().default("hour"),
});
export default async function Page({
@@ -41,15 +49,33 @@ export default async function Page({
return notFound();
}
+ const date = getPeriodDate(search.data.period);
+
const data = await getResponseListData({
monitorId: id,
...search.data,
+ /**
+ * We are overwriting the `fromDate` and `toDate`
+ * to only support presets from the `period`
+ */
+ fromDate: date.from.getTime(),
+ toDate: date.to.getTime(),
});
return (
- <div className="grid gap-6 md:gap-8">
- <Header title={monitor.name} description={monitor.url} />
- {data && <DataTable columns={columns} data={data} />}
+ // overflow-x-scroll needed for the chart.
+ <div className="grid grid-cols-1 gap-6 md:gap-8">
+ <Header
+ title={monitor.name}
+ description={monitor.url}
+ actions={<DatePickerPreset period={search.data.period} />}
+ />
+ {data ? (
+ <>
+ <ChartWrapper period={search.data.period} data={data} />
+ <DataTable columns={columns} data={data} />
+ </>
+ ) : null}
</div>
);
}
diff --git a/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/utils.ts b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/utils.ts
new file mode 100644
index 000000000..eb90b87e6
--- /dev/null
+++ b/apps/web/src/app/app/(dashboard)/[workspaceSlug]/monitors/[id]/data/utils.ts
@@ -0,0 +1,29 @@
+import { endOfDay, startOfDay, subDays, subHours, subMonths } from "date-fns";
+
+export const periods = ["hour", "day", "3d", "7d", "30d"] as const;
+
+export type Period = (typeof periods)[number];
+
+export function getPeriodDate(period: Period) {
+ if (period === "hour")
+ return { from: subHours(new Date(), 1), to: new Date() };
+ if (period === "day")
+ return { from: startOfDay(new Date()), to: endOfDay(new Date()) };
+ if (period === "3d")
+ return {
+ from: subDays(startOfDay(new Date()), 3),
+ to: endOfDay(new Date()),
+ };
+ if (period === "7d")
+ return {
+ from: subDays(startOfDay(new Date()), 7),
+ to: endOfDay(new Date()),
+ };
+ if (period === "30d")
+ return {
+ from: subMonths(startOfDay(new Date()), 1),
+ to: endOfDay(new Date()),
+ };
+ // default to today
+ return { from: startOfDay(new Date()), to: endOfDay(new Date()) };
+}
diff --git a/apps/web/src/app/shared-metadata.ts b/apps/web/src/app/shared-metadata.ts
index 7c3973ae3..1ab4e2802 100644
--- a/apps/web/src/app/shared-metadata.ts
+++ b/apps/web/src/app/shared-metadata.ts
@@ -1,21 +1,26 @@
-const TITLE = "OpenStatus";
-const DESCRIPTION =
+import type { Metadata } from "next";
+
+export const TITLE = "OpenStatus";
+export const DESCRIPTION =
"Open-Source synthetic monitoring with incident management.";
-export const defaultMetadata = {
- title: TITLE,
+export const defaultMetadata: Metadata = {
+ title: {
+ template: `%s | ${TITLE}`,
+ default: TITLE,
+ },
description: DESCRIPTION,
metadataBase: new URL("https://www.openstatus.dev"),
};
-export const twitterMetadata = {
+export const twitterMetadata: Metadata["twitter"] = {
title: TITLE,
description: DESCRIPTION,
card: "summary_large_image",
images: [`/api/og`],
};
-export const ogMetadata = {
+export const ogMetadata: Metadata["openGraph"] = {
title: TITLE,
description: DESCRIPTION,
type: "website",
diff --git a/apps/web/src/components/content/article.tsx b/apps/web/src/components/content/article.tsx
index b1cb68a0b..10e8c505c 100644
--- a/apps/web/src/components/content/article.tsx
+++ b/apps/web/src/components/content/article.tsx
@@ -54,7 +54,7 @@ export function Article({ post }: { post: Post }) {
</div>
</div>
</div>
- <div className="prose-pre:overflow-y-auto prose-pre:max-w-xs md:prose-pre:max-w-none mx-auto max-w-prose ">
+ <div className="prose-pre:overflow-y-auto prose-pre:max-w-xs md:prose-pre:max-w-none mx-auto max-w-prose">
<Mdx code={post.body.code} />
</div>
</article>
diff --git a/apps/web/src/components/content/thumbnail.tsx b/apps/web/src/components/content/thumbnail.tsx
deleted file mode 100644
index ab275abac..000000000
--- a/apps/web/src/components/content/thumbnail.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import Link from "next/link";
-import type { Post } from "contentlayer/generated";
-
-import { formatDate } from "@/lib/utils";
-
-export function Thumbnail({ post }: { post: Post }) {
- return (
- <div key={post.slug}>
- <Link href={`/blog/${post.slug}`}>
- <section>
- <p className="text-foreground font-cal text-2xl">{post.title}</p>
- <p className="text-muted-foreground">{post.description}</p>
- <p className="text-muted-foreground mt-1 text-xs">
- {post.author.name}
- <span className="text-muted-foreground/70 mx-1">&bull;</span>
- {formatDate(new Date(post.publishedAt))}
- <span className="text-muted-foreground/70 mx-1">&bull;</span>
- {post.readingTime}
- </p>
- </section>
- </Link>
- </div>
- );
-}
diff --git a/apps/web/src/components/content/timeline.tsx b/apps/web/src/components/content/timeline.tsx
new file mode 100644
index 000000000..394f7ef89
--- /dev/null
+++ b/apps/web/src/components/content/timeline.tsx
@@ -0,0 +1,55 @@
+import Image from "next/image";
+
+import { formatDate } from "@/lib/utils";
+
+interface TimelineProps {
+ title: string;
+ description: string;
+ children?: React.ReactNode;
+}
+
+export function Timeline({ title, description, children }: TimelineProps) {
+ return (
+ <div className="grid gap-8">
+ <div className="grid gap-4 md:grid-cols-5 md:gap-8">
+ <div className="md:col-span-1" />
+ <div className="grid gap-4 md:col-span-4">
+ <h1 className="text-foreground font-cal text-4xl">{title}</h1>
+ <p className="text-muted-foreground">{description}</p>
+ </div>
+ </div>
+ {children}
+ </div>
+ );
+}
+
+interface ArticleProps {
+ publishedAt: string;
+ imageSrc: string;
+ title: string;
+ children?: React.ReactNode;
+}
+
+function Article({ publishedAt, imageSrc, title, children }: ArticleProps) {
+ return (
+ <article className="grid grid-cols-1 gap-4 md:grid-cols-5 md:gap-6">
+ <time className="text-muted-foreground order-2 font-mono text-sm md:order-1 md:col-span-1">
+ {formatDate(new Date(publishedAt))}
+ </time>
+ <div className="relative order-1 h-64 w-full md:order-2 md:col-span-4">
+ <Image
+ src={imageSrc}
+ fill={true}
+ alt={title}
+ className="border-border rounded-md border object-cover"
+ />
+ </div>
+ <div className="order-3 grid grid-cols-1 gap-4 md:col-span-4 md:col-start-2">
+ <h3 className="text-foreground font-cal text-2xl">{title}</h3>
+ {children}
+ </div>
+ </article>
+ );
+}
+
+Timeline.Article = Article;
diff --git a/apps/web/src/components/dashboard/header.tsx b/apps/web/src/components/dashboard/header.tsx
index 934543b11..5d608622c 100644
--- a/apps/web/src/components/dashboard/header.tsx
+++ b/apps/web/src/components/dashboard/header.tsx
@@ -19,14 +19,14 @@ function Header({ title, description, className, actions }: HeaderProps) {
className,
)}
>
- <div className="grid w-full gap-1">
- <h1 className="font-cal text-3xl">{title}</h1>
+ <div className="flex w-full flex-col gap-1">
+ <h1 className="font-cal truncate text-3xl">{title}</h1>
{description ? (
- <p className="text-muted-foreground">{description}</p>
+ <p className="text-muted-foreground truncate">{description}</p>
) : null}
</div>
{actions ? (
- <div className="flex items-center gap-2">{actions}</div>
+ <div className="flex flex-1 items-center gap-2">{actions}</div>
) : null}
</div>
);
diff --git a/apps/web/src/components/data-table/columns.tsx b/apps/web/src/components/data-table/columns.tsx
index 2bd81dab5..087bbbab0 100644
--- a/apps/web/src/components/data-table/columns.tsx
+++ b/apps/web/src/components/data-table/columns.tsx
@@ -34,8 +34,8 @@ export const columns: ColumnDef<Ping>[] = [
return <DataTableStatusBadge {...{ statusCode }} />;
},
filterFn: (row, id, value) => {
- // needed because value is number, not string
- return `${row.getValue(id)}`.includes(`${value}`);
+ // get the first digit of the status code
+ return value.includes(Number(String(row.getValue(id)).charAt(0)));
},
},
{
@@ -50,10 +50,14 @@ export const columns: ColumnDef<Ping>[] = [
<DataTableColumnHeader column={column} title="Region" />
),
cell: ({ row }) => {
- const region = String(row.getValue("region"));
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-expect-error
- return <div>{regionsDict[region]?.location}</div>;
+ return (
+ <div>
+ <span className="font-mono">{String(row.getValue("region"))} </span>
+ <span className="text-muted-foreground text-xs">
+ {regionsDict[row.original.region]?.location}
+ </span>
+ </div>
+ );
},
filterFn: (row, id, value) => {
return value.includes(row.getValue(id));
diff --git a/apps/web/src/components/data-table/data-table-date-ranger-picker.tsx b/apps/web/src/components/data-table/data-table-date-ranger-picker.tsx
index b6b8f4606..6aeb182c1 100644
--- a/apps/web/src/components/data-table/data-table-date-ranger-picker.tsx
+++ b/apps/web/src/components/data-table/data-table-date-ranger-picker.tsx
@@ -2,7 +2,7 @@
import * as React from "react";
import { usePathname, useRouter, useSearchParams } from "next/navigation";
-import { addDays, format } from "date-fns";
+import { format } from "date-fns";
import { Calendar as CalendarIcon } from "lucide-react";
import type { DateRange } from "react-day-picker";
@@ -15,7 +15,7 @@ import {
} from "@openstatus/ui";
import useUpdateSearchParams from "@/hooks/use-update-search-params";
-import { cn } from "@/lib/utils";
+import { cn, manipulateDate } from "@/lib/utils";
type DataTableDateRangePicker = React.HTMLAttributes<HTMLDivElement>;
@@ -91,20 +91,3 @@ export function DataTableDateRangePicker({
</div>
);
}
-
-/**
- * Whenever you select a date, it will use the midnight timestamp of that date.
- * We need to add a day minus one second to include the whole day.
- */
-function manipulateDate(date?: DateRange | null) {
- const isToDateMidnight = String(date?.to?.getTime()).endsWith("00000");
-
- const addOneDayToDate = date?.to
- ? addDays(new Date(date.to), 1).getTime() - 1
- : null;
-
- return {
- fromDate: date?.from?.getTime() || null,
- toDate: isToDateMidnight ? addOneDayToDate : date?.to?.getTime() || null,
- };
-}
diff --git a/apps/web/src/components/data-table/data-table-faceted-filter.tsx b/apps/web/src/components/data-table/data-table-faceted-filter.tsx
index 2f209e287..ae5673255 100644
--- a/apps/web/src/components/data-table/data-table-faceted-filter.tsx
+++ b/apps/web/src/components/data-table/data-table-faceted-filter.tsx
@@ -25,7 +25,7 @@ interface DataTableFacetedFilter<TData, TValue> {
title?: string;
options: {
label: string;
- value: string;
+ value: string | number;
icon?: React.ComponentType<{ className?: string }>;
}[];
}
@@ -36,7 +36,9 @@ export function DataTableFacetedFilter<TData, TValue>({
options,
}: DataTableFacetedFilter<TData, TValue>) {
const facets = column?.getFacetedUniqueValues();
- const selectedValues = new Set(column?.getFilterValue() as string[]);
+ const selectedValues = new Set(
+ column?.getFilterValue() as (string | number)[],
+ );
return (
<Popover>
diff --git a/apps/web/src/components/data-table/data-table-toolbar.tsx b/apps/web/src/components/data-table/data-table-toolbar.tsx
index a711d38e3..4db87b35b 100644
--- a/apps/web/src/components/data-table/data-table-toolbar.tsx
+++ b/apps/web/src/components/data-table/data-table-toolbar.tsx
@@ -5,6 +5,7 @@ import { X } from "lucide-react";
import { Button } from "@openstatus/ui";
+import { codesDict } from "@/data/code-dictionary";
import { regionsDict } from "@/data/regions-dictionary";
import { DataTableDateRangePicker } from "./data-table-date-ranger-picker";
import { DataTableFacetedFilter } from "./data-table-faceted-filter";
@@ -22,7 +23,19 @@ export function DataTableToolbar<TData>({
return (
<div className="flex flex-wrap items-center justify-between gap-3">
<div className="flex flex-1 items-center gap-2">
- <DataTableFilterInput table={table} />
+ {table.getColumn("statusCode") && (
+ <DataTableFacetedFilter
+ column={table.getColumn("statusCode")}
+ title="Status Code"
+ options={Object.keys(codesDict).map((key) => {
+ const typedKey = key as keyof typeof codesDict;
+ return {
+ label: codesDict[typedKey].label,
+ value: codesDict[typedKey].prefix,
+ };
+ })}
+ />
+ )}
{table.getColumn("region") && (
<DataTableFacetedFilter
column={table.getColumn("region")}
@@ -47,7 +60,7 @@ export function DataTableToolbar<TData>({
</Button>
)}
</div>
- <DataTableDateRangePicker />
+ {/* <DataTableDateRangePicker /> */}
</div>
);
}
diff --git a/apps/web/src/components/data-table/monitor/columns.tsx b/apps/web/src/components/data-table/monitor/columns.tsx
index 3572dcbd4..680f92aaa 100644
--- a/apps/web/src/components/data-table/monitor/columns.tsx
+++ b/apps/web/src/components/data-table/monitor/columns.tsx
@@ -1,5 +1,6 @@
"use client";
+import Link from "next/link";
import type { ColumnDef } from "@tanstack/react-table";
import * as z from "zod";
@@ -19,7 +20,10 @@ export const columns: ColumnDef<
const active = row.getValue("active");
return (
// TODO: add Link on click when we have a better details page
- <div className="flex items-center gap-2">
+ <Link
+ href={`./monitors/${row.original.id}/data`}
+ className="group flex items-center gap-2"
+ >
{active ? (
<span className="relative flex h-2 w-2">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75 duration-1000" />
@@ -30,9 +34,11 @@ export const columns: ColumnDef<
<span className="absolute inline-flex h-2 w-2 rounded-full bg-red-500" />
</span>
)}
- <span className="max-w-[125px] truncate">{row.getValue("name")}</span>
+ <span className="max-w-[125px] truncate group-hover:underline">
+ {row.getValue("name")}
+ </span>
{!active ? <Badge variant="outline">paused</Badge> : null}
- </div>
+ </Link>
);
},
},
diff --git a/apps/web/src/components/layout/marketing-header.tsx b/apps/web/src/components/layout/marketing-header.tsx
index 3b15000b3..92e42f7dc 100644
--- a/apps/web/src/components/layout/marketing-header.tsx
+++ b/apps/web/src/components/layout/marketing-header.tsx
@@ -19,27 +19,27 @@ export function MarketingHeader({ className }: Props) {
return (
<header
- className={cn("grid w-full grid-cols-2 gap-2 md:grid-cols-5", className)}
+ className={cn("grid w-full grid-cols-2 gap-2 sm:grid-cols-5", className)}
>
- <div className="flex items-center md:col-span-1">
+ <div className="flex items-center sm:col-span-1">
<BrandName />
</div>
- <div className="hidden items-center justify-center md:col-span-3 md:flex md:gap-3">
- <Button variant="link" asChild className="md:mr-3">
+ <div className="hidden items-center justify-center sm:col-span-3 sm:flex sm:gap-3">
+ <Button variant="link" asChild>
<Link href="/blog">Blog</Link>
</Button>
- <Button variant="link" asChild className="md:mr-3">
+ <Button variant="link" asChild>
<Link href="/changelog">Changelog</Link>
</Button>
- <Button variant="link" asChild className="md:mr-3">
+ <Button variant="link" asChild>
<Link href="https://docs.openstatus.dev" target="_blank">
Docs
<ArrowUpRight className="ml-1 h-4 w-4 flex-shrink-0" />
</Link>
</Button>
</div>
- <div className="flex items-center justify-end gap-3 md:col-span-1">
- <div className="block md:hidden">
+ <div className="flex items-center justify-end gap-3 sm:col-span-1">
+ <div className="block sm:hidden">
<MarketingMenu />
</div>
<Button asChild className="rounded-full">
diff --git a/apps/web/src/components/layout/marketing-menu.tsx b/apps/web/src/components/layout/marketing-menu.tsx
index 7f50b0bf5..981682002 100644
--- a/apps/web/src/components/layout/marketing-menu.tsx
+++ b/apps/web/src/components/layout/marketing-menu.tsx
@@ -3,7 +3,7 @@
import * as React from "react";
import Link from "next/link";
import { usePathname, useSearchParams } from "next/navigation";
-import { Menu } from "lucide-react";
+import { ArrowUpRight, Menu } from "lucide-react";
import {
Button,
@@ -40,21 +40,32 @@ export function MarketingMenu() {
</SheetTrigger>
<SheetContent>
<SheetHeader>
- <SheetTitle className="text-left">Navigation</SheetTitle>
+ <SheetTitle className="ml-2 text-left">Menu</SheetTitle>
</SheetHeader>
<ul className="mt-4 grid gap-1">
{pages.map(({ href, title }) => {
const isActive = pathname?.startsWith(href);
+ const isExternal = href.startsWith("http");
+ const externalProps = isExternal
+ ? {
+ target: "_blank",
+ rel: "noreferrer",
+ }
+ : {};
return (
- <li key="title" className="w-full">
+ <li key={href} className="-ml-1 w-full">
<Link
href={href}
className={cn(
- "hover:bg-muted/50 hover:text-foreground text-muted-foreground group flex w-full min-w-[200px] items-center rounded-md border border-transparent px-3 py-1",
+ "hover:bg-muted/50 hover:text-foreground text-muted-foreground group inline-flex w-full min-w-[200px] items-center rounded-md border border-transparent px-3 py-1",
isActive && "bg-muted/50 border-border text-foreground",
)}
+ {...externalProps}
>
{title}
+ {isExternal ? (
+ <ArrowUpRight className="ml-1 h-4 w-4 flex-shrink-0" />
+ ) : null}
</Link>
</li>
);
diff --git a/apps/web/src/content/changelog/response-time-charts.mdx b/apps/web/src/content/changelog/response-time-charts.mdx
new file mode 100644
index 000000000..31eaf9c91
--- /dev/null
+++ b/apps/web/src/content/changelog/response-time-charts.mdx
@@ -0,0 +1,10 @@
+---
+title: Response Time Charts
+publishedAt: 2023-10-08
+image: /assets/changelog/response-time-charts.png
+---
+
+You can now assess your monitor's response time using the new charts and get a
+better overview of your monitor's performance.
+
+Powered by [tremor.so](https://tremor.so).
diff --git a/apps/web/src/data/code-dictionary.ts b/apps/web/src/data/code-dictionary.ts
new file mode 100644
index 000000000..d858f7381
--- /dev/null
+++ b/apps/web/src/data/code-dictionary.ts
@@ -0,0 +1,27 @@
+export const codesDict = {
+ "1xx": {
+ prefix: 1,
+ label: "1xx",
+ name: "Informational",
+ },
+ "2xx": {
+ prefix: 2,
+ label: "2xx",
+ name: "Successfull",
+ },
+ "3xx": {
+ prefix: 3,
+ label: "3xx",
+ name: "Redirection",
+ },
+ "4xx": {
+ prefix: 4,
+ label: "4xx",
+ name: "Client Error",
+ },
+ "5xx": {
+ prefix: 5,
+ label: "5xx",
+ name: "Server Error",
+ },
+} as const;
diff --git a/apps/web/src/lib/tb.ts b/apps/web/src/lib/tb.ts
index fdb64e78f..d101e2bf4 100644
--- a/apps/web/src/lib/tb.ts
+++ b/apps/web/src/lib/tb.ts
@@ -16,11 +16,7 @@ import { env } from "@/env";
const tb = new Tinybird({ token: env.TINY_BIRD_API_KEY });
// TODO: add security layer
-export async function getResponseListData(
- props: Partial<
- Pick<ResponseListParams, "region" | "cronTimestamp" | "limit" | "monitorId">
- >,
-) {
+export async function getResponseListData(props: Partial<ResponseListParams>) {
try {
const res = await getResponseList(tb)(props);
return res.data;
diff --git a/apps/web/src/lib/utils.ts b/apps/web/src/lib/utils.ts
index f56a54a5a..7444624bc 100644
--- a/apps/web/src/lib/utils.ts
+++ b/apps/web/src/lib/utils.ts
@@ -1,6 +1,6 @@
import type { ClassValue } from "clsx";
import { clsx } from "clsx";
-import { format } from "date-fns";
+import { addDays, format } from "date-fns";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
@@ -36,3 +36,26 @@ export function numberFormatter(value: number) {
const formatter = Intl.NumberFormat("en", { notation: "compact" });
return formatter.format(value);
}
+
+/**
+ * Whenever you select a date, it will use the midnight timestamp of that date.
+ * We need to add a day minus one second to include the whole day.
+ */
+export function manipulateDate(
+ date?: {
+ from: Date | undefined;
+ to?: Date | undefined;
+ } | null,
+) {
+ const isToDateMidnight = String(date?.to?.getTime()).endsWith("00000");
+
+ // We might wanna use `endOfDay(new Date(date.to))` here
+ const addOneDayToDate = date?.to
+ ? addDays(new Date(date.to), 1).getTime() - 1
+ : null;
+
+ return {
+ fromDate: date?.from?.getTime() || null,
+ toDate: isToDateMidnight ? addOneDayToDate : date?.to?.getTime() || null,
+ };
+}
diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts
index 77f288ca2..505e0c9f9 100644
--- a/apps/web/tailwind.config.ts
+++ b/apps/web/tailwind.config.ts
@@ -1,15 +1,25 @@
const { fontFamily } = require("tailwindcss/defaultTheme");
+/**
+ * TODO: is there a way to merge `tremor` with `shadcn`? At least the colors
+ */
+
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: [
"src/**/*.{ts,tsx}",
- // for vercel integration
+ /* tremor */
+ "./node_modules/@tremor/**/*.{js,ts,jsx,tsx}",
+ // our vercel integration
"../../packages/integrations/**/*.{ts,tsx}",
"../../packages/ui/**/*.{ts,tsx}",
],
theme: {
+ /* Tremor */
+ transparent: "transparent",
+ current: "currentColor",
+ /* */
container: {
center: true,
padding: "2rem",
@@ -56,12 +66,101 @@ module.exports = {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
+ /* Tremor */
+ // light mode
+ tremor: {
+ brand: {
+ faint: "#eff6ff", // blue-50
+ muted: "#bfdbfe", // blue-200
+ subtle: "#60a5fa", // blue-400
+ DEFAULT: "#3b82f6", // blue-500
+ emphasis: "#1d4ed8", // blue-700
+ inverted: "#ffffff", // white
+ },
+ background: {
+ muted: "#f9fafb", // gray-50
+ subtle: "#f3f4f6", // gray-100
+ DEFAULT: "#ffffff", // white
+ emphasis: "#374151", // gray-700
+ },
+ border: {
+ DEFAULT: "#e5e7eb", // gray-200
+ },
+ ring: {
+ DEFAULT: "#e5e7eb", // gray-200
+ },
+ content: {
+ subtle: "#9ca3af", // gray-400
+ DEFAULT: "#6b7280", // gray-500
+ emphasis: "#374151", // gray-700
+ strong: "#111827", // gray-900
+ inverted: "#ffffff", // white
+ },
+ },
+ // dark mode
+ "dark-tremor": {
+ brand: {
+ faint: "#0B1229", // custom
+ muted: "#172554", // blue-950
+ subtle: "#1e40af", // blue-800
+ DEFAULT: "#3b82f6", // blue-500
+ emphasis: "#60a5fa", // blue-400
+ inverted: "#030712", // gray-950
+ },
+ background: {
+ muted: "#131A2B", // custom
+ subtle: "#1f2937", // gray-800
+ DEFAULT: "#111827", // gray-900
+ emphasis: "#d1d5db", // gray-300
+ },
+ border: {
+ DEFAULT: "#1f2937", // gray-800
+ },
+ ring: {
+ DEFAULT: "#1f2937", // gray-800
+ },
+ content: {
+ subtle: "#4b5563", // gray-600
+ DEFAULT: "#6b7280", // gray-600
+ emphasis: "#e5e7eb", // gray-200
+ strong: "#f9fafb", // gray-50
+ inverted: "#000000", // black
+ },
+ },
+ /* */
},
borderRadius: {
lg: `var(--radius)`,
md: `calc(var(--radius) - 2px)`,
sm: "calc(var(--radius) - 4px)",
+ /* Tremor */
+ "tremor-small": "0.375rem",
+ "tremor-default": "0.5rem",
+ "tremor-full": "9999px",
+ /* */
+ },
+ /* Tremor */
+ boxShadow: {
+ // light
+ "tremor-input": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
+ "tremor-card":
+ "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
+ "tremor-dropdown":
+ "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
+ // dark
+ "dark-tremor-input": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
+ "dark-tremor-card":
+ "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
+ "dark-tremor-dropdown":
+ "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
},
+ fontSize: {
+ "tremor-label": ["0.75rem"],
+ "tremor-default": ["0.875rem", { lineHeight: "1.25rem" }],
+ "tremor-title": ["1.125rem", { lineHeight: "1.75rem" }],
+ "tremor-metric": ["1.875rem", { lineHeight: "2.25rem" }],
+ },
+ /* */
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
cal: ["var(--font-calsans)"],
@@ -82,5 +181,40 @@ module.exports = {
},
},
},
- plugins: [require("tailwindcss-animate"), require("@tailwindcss/typography")],
+ /* Tremor */
+ safelist: [
+ {
+ pattern:
+ /^(bg-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
+ variants: ["hover", "ui-selected"],
+ },
+ {
+ pattern:
+ /^(text-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
+ variants: ["hover", "ui-selected"],
+ },
+ {
+ pattern:
+ /^(border-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
+ variants: ["hover", "ui-selected"],
+ },
+ {
+ pattern:
+ /^(ring-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
+ },
+ {
+ pattern:
+ /^(stroke-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
+ },
+ {
+ pattern:
+ /^(fill-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950))$/,
+ },
+ ],
+ /* */
+ plugins: [
+ require("tailwindcss-animate"),
+ require("@tailwindcss/typography"),
+ require("@headlessui/tailwindcss"),
+ ],
};
diff --git a/packages/tinybird/src/validation.ts b/packages/tinybird/src/validation.ts
index ed57b7e07..95703e1df 100644
--- a/packages/tinybird/src/validation.ts
+++ b/packages/tinybird/src/validation.ts
@@ -69,7 +69,7 @@ export const tbParameterResponseList = z.object({
monitorId: z.string().default(""), // REMINDER: remove default once alpha
fromDate: z.number().int().default(0), // always start from a date
toDate: z.number().int().optional(),
- limit: z.number().int().optional().default(2500), // one day has 2448 pings (17 (regions) * 6 (per hour) * 24)
+ limit: z.number().int().optional().default(7500), // one day has 2448 pings (17 (regions) * 6 (per hour) * 24) * 3 days for historical data
region: z.enum(availableRegions).optional(),
cronTimestamp: z.number().int().optional(),
});
@@ -85,7 +85,6 @@ export const groupByRange = ["day", "cron"] as const;
* Params for pipe monitor_list__v0
*/
export const tbParameterMonitorList = z.object({
- siteId: z.string().optional().default("openstatus"), // REMINDER: remove default once alpha
monitorId: z.string().optional().default(""), // REMINDER: remove default once alpha
limit: z.number().int().optional().default(2500), // one day has 2448 pings (17 (regions) * 6 (per hour) * 24)
cronTimestamp: z.number().int().optional(),
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index cdd451d74..f074d543f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -112,6 +112,9 @@ importers:
'@clerk/nextjs':
specifier: 4.25.1
+ '@headlessui/react':
+ specifier: ^1.7.17
'@hookform/resolvers':
specifier: 3.3.1
version: 3.3.1([email protected])
@@ -163,6 +166,9 @@ importers:
'@tanstack/react-table':
specifier: 8.10.3
+ '@tremor/react':
+ specifier: ^3.8.2
'@trpc/client':
specifier: 10.38.5
version: 10.38.5(@trpc/[email protected])
@@ -2010,6 +2016,17 @@ packages:
'@floating-ui/utils': 0.1.6
dev: false
+ resolution: {integrity: sha512-htwHm67Ji5E/pROEAr7f8IKFShuiCKHwUC/UY4vC3I5jiSvGFAYnSYiZO5MlGmads+QqvUkR9ANHEguGrDv72g==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+ dependencies:
+ '@floating-ui/dom': 1.5.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
resolution: {integrity: sha512-5qhlDvjaLmAst/rKb3VdlCinwTF4EYMiVxuuc/HVUjs46W0zgtbMmAZ1UTsDrRTxRmUEzl92mOtWbeeXL26lSQ==}
peerDependencies:
@@ -2021,6 +2038,19 @@ packages:
react-dom: 18.2.0([email protected])
dev: false
+ resolution: {integrity: sha512-JyNk4A0Ezirq8FlXECvRtQOX/iBe5Ize0W/pLkrZjfHW9GUV7Xnq6zm6fyZuQzaHHqEnVizmvlA96e1/CkZv+w==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+ dependencies:
+ '@floating-ui/react-dom': 1.3.0([email protected])([email protected])
+ aria-hidden: 1.2.3
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ tabbable: 6.2.0
+ dev: false
+
/@floating-ui/[email protected]:
resolution: {integrity: sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==}
dev: false
@@ -2056,6 +2086,15 @@ packages:
react-dom: 18.2.0([email protected])
dev: false
+ resolution: {integrity: sha512-3aMdDyYZx9A15euRehpppSyQnb2gIw2s/Uccn2ELIoLQ9oDy0+9oRygNWNjXCD5Dt+w1pxo7C+XoiYvGcqA4Kg==}
+ engines: {node: '>=10'}
+ peerDependencies:
+ tailwindcss: ^3.0
+ dependencies:
+ tailwindcss: 3.3.2
+ dev: false
+
resolution: {integrity: sha512-zs6AURALRF0A1gkuY5iKmRBT7d0JsLC3xVPDjBdRbJqNV3XQv4i2kprZTRAcI9AjjGApTsZbLZv1pZRCB2viwQ==}
engines: {node: '>=16.0.0'}
@@ -5095,6 +5134,27 @@ packages:
resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==}
dev: true
+ resolution: {integrity: sha512-gZ6GTBIiL915U2Tikreooh8nllWEgKd1wnZ3ru0Cm9qmq6TbW+jHikCpHy1KQ2PQkpdKrXi5R2s6f8N4Fj5Imw==}
+ peerDependencies:
+ react: ^18.0.0
+ react-dom: '>=16.6.0'
+ dependencies:
+ '@floating-ui/react': 0.19.2([email protected])([email protected])
+ '@headlessui/react': 1.7.17([email protected])([email protected])
+ '@headlessui/tailwindcss': 0.1.3([email protected])
+ date-fns: 2.30.0
+ react: 18.2.0
+ react-day-picker: 8.8.2([email protected])([email protected])
+ react-dom: 18.2.0([email protected])
+ react-transition-group: 4.4.5([email protected])([email protected])
+ tailwind-merge: 1.14.0
+ transitivePeerDependencies:
+ - prop-types
+ - tailwindcss
+ dev: false
+
resolution: {integrity: sha512-tpGUsoAP+3CD/1KRqMdWZ+zebvB68/86SaVPAYHaEDozTFLQdNqTe98DS/T0S4hfh7WCKbMSObj40SCzE8amKQ==}
peerDependencies:
@@ -5221,6 +5281,28 @@ packages:
'@types/node': 20.8.0
dev: false
+ resolution: {integrity: sha512-2xAVyAUgaXHX9fubjcCbGAUOqYfRJN1em1EKR2HfzWBpObZhwfnZKvofTN4TplMqJdFQao61I+NVSai/vnBvDQ==}
+ dev: false
+
+ resolution: {integrity: sha512-CSAVrHAtM9wfuLJ2tpvvwCU/F22sm7rMHNN+yh9D6O6hyAms3+O0cgMpC1pm6UEUMOntuZC8bMt74PteiDUdCg==}
+ dev: false
+
+ resolution: {integrity: sha512-aMo4eaAOijJjA6uU+GIeW018dvy9+oH5Y2VPPzjjfxevvGQ/oRDs+tfYC9b50Q4BygRR8yE2QCLsrT0WtAVseA==}
+ dev: false
+
+ resolution: {integrity: sha512-zAbCj9lTqW9J9PlF4FwnvEjXZUy75NQqPm7DMHZXuxCFTpuTrdK2NMYGQekf4hlasL78fCYOLu4EE3/tXElwow==}
+ dependencies:
+ '@types/d3-color': 3.1.1
+ dev: false
+
+ resolution: {integrity: sha512-0g/A+mZXgFkQxN3HniRDbXMN79K3CdTpLsevj+PXiTcb2hVyvkZUBg37StmgCQkaD84cUJ4uaDAWq7UJOQy2Tg==}
+ dev: false
+
resolution: {integrity: sha512-dsoJGEIShosKVRBZB0Vo3C8nqSDqVGujJU6tPznsBJxNJNwMF8utmS83nvCBKQYPpjCzaaHcrf66iTRpZosLPw==}
dev: false
@@ -5231,10 +5313,20 @@ packages:
'@types/d3-time': 3.0.0
dev: false
+ resolution: {integrity: sha512-cHMdIq+rhF5IVwAV7t61pcEXfEHsEsrbBUPkFGBwTXuxtTAkBBrnrNA8++6OWm3jwVsXoZYQM8NEekg6CPJ3zw==}
+ dependencies:
+ '@types/d3-path': 3.0.0
+ dev: false
+
resolution: {integrity: sha512-sZLCdHvBUcNby1cB6Fd3ZBrABbjz3v1Vm90nysCQ6Vt7vd6e/h9Lt7SiJUoEX0l4Dzc7P5llKyhqSi1ycSf1Hg==}
dev: false
+ resolution: {integrity: sha512-HNB/9GHqu7Fo8AQiugyJbv6ZxYz58wef0esl4Mv828w1ZKpAshw/uFWVDUcIB9KKFeFKoxS3cHY07FFgtTRZ1g==}
+ dev: false
+
resolution: {integrity: sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==}
dependencies:
@@ -6785,6 +6877,10 @@ packages:
resolution: {integrity: sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==}
dev: false
+ resolution: {integrity: sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA==}
+ dev: false
+
resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==}
dev: false
@@ -7183,6 +7279,10 @@ packages:
dependencies:
ms: 2.1.2
+ resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==}
+ dev: false
+
resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==}
dev: false
@@ -7375,6 +7475,19 @@ packages:
dependencies:
esutils: 2.0.3
+ resolution: {integrity: sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==}
+ dependencies:
+ '@babel/runtime': 7.23.1
+ dev: false
+
+ resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==}
+ dependencies:
+ '@babel/runtime': 7.23.1
+ csstype: 3.1.2
+ dev: false
+
resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
dependencies:
@@ -8231,6 +8344,10 @@ packages:
es5-ext: 0.10.62
dev: true
+ resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==}
+ dev: false
+
resolution: {integrity: sha512-zDWS+Rb1E8BlqqhALSt9kUhss8Qq4nN3iof3gsOdyINksElaPyNBtKUMTR62qhvgVWR0CqCX7sdnKe4MnUbFEA==}
engines: {node: '>=4'}
@@ -8292,6 +8409,11 @@ packages:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+ resolution: {integrity: sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==}
+ engines: {node: '>=6.0.0'}
+ dev: false
+
resolution: {integrity: sha512-F3tRpfkAzb7TT2JNKaJUglyuRjRa+jelQD94s9OSqkfEeytLmupCqQiD+H2KoIXGtp4pB5m4zNmv5m2Ktcr+LA==}
hasBin: true
@@ -12173,6 +12295,10 @@ packages:
cssesc: 3.0.0
util-deprecate: 1.0.2
+ resolution: {integrity: sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==}
+ dev: false
+
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
@@ -12611,6 +12737,10 @@ packages:
resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
+ resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==}
+ dev: false
+
resolution: {integrity: sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw==}
dev: false
@@ -12702,6 +12832,31 @@ packages:
use-sidecar: 1.1.2(@types/[email protected])([email protected])
dev: false
+ resolution: {integrity: sha512-S7szxlaIuiy5UqLhLL1KY3aoyGHbZzsTpYal9eYMwCyKqoqoVLCmIgAgNyIM1FhnP2KyBygASJxdhejrzjMb+w==}
+ peerDependencies:
+ react: ^16.0.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ lodash: 4.17.21
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
+ resolution: {integrity: sha512-OkFsrrMBTvQUwEJthE1KXSOj79z57yvEWeFefeXPib+RmQEI9B1Ub1PgzlzzUyBOvl/TjXt5nF2hmD4NsgAh8A==}
+ peerDependencies:
+ prop-types: ^15.6.0
+ react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ fast-equals: 5.0.1
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-transition-group: 2.9.0([email protected])([email protected])
+ dev: false
+
resolution: {integrity: sha512-yFNHrlVEReVYKsLI5lF05tZoHveA5pGzjFbFJY/3pOqqjGOmMmqx83N4hIjN2n6E1AOa+eQEUxs3CgRnPmT0RQ==}
peerDependencies:
@@ -12740,6 +12895,34 @@ packages:
refractor: 3.6.0
dev: false
+ resolution: {integrity: sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg==}
+ peerDependencies:
+ react: '>=15.0.0'
+ react-dom: '>=15.0.0'
+ dependencies:
+ dom-helpers: 3.4.0
+ loose-envify: 1.4.0
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-lifecycles-compat: 3.0.4
+ dev: false
+
+ resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==}
+ peerDependencies:
+ react: '>=16.6.0'
+ react-dom: '>=16.6.0'
+ dependencies:
+ '@babel/runtime': 7.23.1
+ dom-helpers: 5.2.1
+ loose-envify: 1.4.0
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ dev: false
+
resolution: {integrity: sha512-8GQLa5y0G56kvGQkN7OiaKkjFAhWYVdyFq62ioY2qVtpMrjchVU+3KnqneCyp0+BemOQZkg6WWp/qoCNeEMH6A==}
peerDependencies:
@@ -12815,6 +12998,34 @@ packages:
resolution: {integrity: sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==}
dev: false
+ resolution: {integrity: sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==}
+ dependencies:
+ decimal.js-light: 2.5.1
+ dev: false
+
+ resolution: {integrity: sha512-nciXqQDh3aW8abhwUlA4EBOBusRHLNiKHfpRZiG/yjups1x+auHb2zWPuEcTn/IMiN47vVMMuF8Sr+vcQJtsmw==}
+ engines: {node: '>=12'}
+ peerDependencies:
+ prop-types: ^15.6.0
+ react: ^16.0.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0
+ dependencies:
+ classnames: 2.3.2
+ eventemitter3: 4.0.7
+ lodash: 4.17.21
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+ react-is: 16.13.1
+ react-resize-detector: 8.1.0([email protected])([email protected])
+ recharts-scale: 0.4.5
+ reduce-css-calc: 2.1.8
+ victory-vendor: 36.6.11
+ dev: false
+
resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==}
engines: {node: '>= 0.10'}
@@ -12822,6 +13033,13 @@ packages:
resolve: 1.22.6
dev: false
+ resolution: {integrity: sha512-8liAVezDmUcH+tdzoEGrhfbGcP7nOV4NkGE3a74+qqvE7nt9i4sKLGBuZNOnpI4WiGksiNPklZxva80061QiPg==}
+ dependencies:
+ css-unit-converter: 1.1.2
+ postcss-value-parser: 3.3.1
+ dev: false
+
resolution: {integrity: sha512-SchSn/DWfGb3oAejd+1hhHx01xUoxY+V7TeK0BKqpkLKiQPVFf7DYzEaKmrEVxsWxielKfSK9/Xq66YyxgR1cg==}
peerDependencies:
@@ -13873,6 +14091,10 @@ packages:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
dev: false
+ resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==}
+ dev: false
+
resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==}
dev: false
@@ -14884,6 +15106,25 @@ packages:
vfile-message: 4.0.2
dev: false
+ resolution: {integrity: sha512-nT8kCiJp8dQh8g991J/R5w5eE2KnO8EAIP0xocWlh9l2okngMWglOPoMZzJvek8Q1KUc4XE/mJxTZnvOB1sTYg==}
+ dependencies:
+ '@types/d3-array': 3.0.8
+ '@types/d3-ease': 3.0.0
+ '@types/d3-interpolate': 3.0.2
+ '@types/d3-scale': 4.0.4
+ '@types/d3-shape': 3.1.3
+ '@types/d3-time': 3.0.0
+ '@types/d3-timer': 3.0.0
+ 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
+ dev: false
+
resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==}
engines: {node: '>=v14.18.0'}