Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(design-system): charts defrag (#41026)

kemal.earthec6f55c00b29
diff --git a/apps/design-system/__registry__/default/block/chart-area-axes.tsx b/apps/design-system/__registry__/default/block/chart-area-axes.tsx
deleted file mode 100644
index 26713267cbd..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-axes.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'An area chart with axes'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Axes</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: -20,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <YAxis tickLine={false} axisLine={false} tickMargin={8} tickCount={3} />
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-default.tsx b/apps/design-system/__registry__/default/block/chart-area-default.tsx
deleted file mode 100644
index 0ccfe016d7c..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-default.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A simple area chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-gradient.tsx b/apps/design-system/__registry__/default/block/chart-area-gradient.tsx
deleted file mode 100644
index d6e7ad9b621..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-gradient.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'An area chart with gradient fill'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Gradient</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <defs>
- <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
- </linearGradient>
- <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
- </linearGradient>
- </defs>
- <Area
- dataKey="mobile"
- type="natural"
- fill="url(#fillMobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="url(#fillDesktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-icons.tsx b/apps/design-system/__registry__/default/block/chart-area-icons.tsx
deleted file mode 100644
index bc9d0195253..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-icons.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-'use client'
-
-import { TrendingDown, TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'An area chart with icons'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- icon: TrendingDown,
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- icon: TrendingUp,
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Icons</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-interactive.tsx b/apps/design-system/__registry__/default/block/chart-area-interactive.tsx
deleted file mode 100644
index df2579fe8f8..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-interactive.tsx
+++ /dev/null
@@ -1,238 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-import {
- Select_Shadcn_,
- SelectContent_Shadcn_,
- SelectItem_Shadcn_,
- SelectTrigger_Shadcn_,
- SelectValue_Shadcn_,
-} from 'ui'
-
-export const description = 'An interactive area chart'
-
-const chartData = [
- { date: '2024-04-01', desktop: 222, mobile: 150 },
- { date: '2024-04-02', desktop: 97, mobile: 180 },
- { date: '2024-04-03', desktop: 167, mobile: 120 },
- { date: '2024-04-04', desktop: 242, mobile: 260 },
- { date: '2024-04-05', desktop: 373, mobile: 290 },
- { date: '2024-04-06', desktop: 301, mobile: 340 },
- { date: '2024-04-07', desktop: 245, mobile: 180 },
- { date: '2024-04-08', desktop: 409, mobile: 320 },
- { date: '2024-04-09', desktop: 59, mobile: 110 },
- { date: '2024-04-10', desktop: 261, mobile: 190 },
- { date: '2024-04-11', desktop: 327, mobile: 350 },
- { date: '2024-04-12', desktop: 292, mobile: 210 },
- { date: '2024-04-13', desktop: 342, mobile: 380 },
- { date: '2024-04-14', desktop: 137, mobile: 220 },
- { date: '2024-04-15', desktop: 120, mobile: 170 },
- { date: '2024-04-16', desktop: 138, mobile: 190 },
- { date: '2024-04-17', desktop: 446, mobile: 360 },
- { date: '2024-04-18', desktop: 364, mobile: 410 },
- { date: '2024-04-19', desktop: 243, mobile: 180 },
- { date: '2024-04-20', desktop: 89, mobile: 150 },
- { date: '2024-04-21', desktop: 137, mobile: 200 },
- { date: '2024-04-22', desktop: 224, mobile: 170 },
- { date: '2024-04-23', desktop: 138, mobile: 230 },
- { date: '2024-04-24', desktop: 387, mobile: 290 },
- { date: '2024-04-25', desktop: 215, mobile: 250 },
- { date: '2024-04-26', desktop: 75, mobile: 130 },
- { date: '2024-04-27', desktop: 383, mobile: 420 },
- { date: '2024-04-28', desktop: 122, mobile: 180 },
- { date: '2024-04-29', desktop: 315, mobile: 240 },
- { date: '2024-04-30', desktop: 454, mobile: 380 },
- { date: '2024-05-01', desktop: 165, mobile: 220 },
- { date: '2024-05-02', desktop: 293, mobile: 310 },
- { date: '2024-05-03', desktop: 247, mobile: 190 },
- { date: '2024-05-04', desktop: 385, mobile: 420 },
- { date: '2024-05-05', desktop: 481, mobile: 390 },
- { date: '2024-05-06', desktop: 498, mobile: 520 },
- { date: '2024-05-07', desktop: 388, mobile: 300 },
- { date: '2024-05-08', desktop: 149, mobile: 210 },
- { date: '2024-05-09', desktop: 227, mobile: 180 },
- { date: '2024-05-10', desktop: 293, mobile: 330 },
- { date: '2024-05-11', desktop: 335, mobile: 270 },
- { date: '2024-05-12', desktop: 197, mobile: 240 },
- { date: '2024-05-13', desktop: 197, mobile: 160 },
- { date: '2024-05-14', desktop: 448, mobile: 490 },
- { date: '2024-05-15', desktop: 473, mobile: 380 },
- { date: '2024-05-16', desktop: 338, mobile: 400 },
- { date: '2024-05-17', desktop: 499, mobile: 420 },
- { date: '2024-05-18', desktop: 315, mobile: 350 },
- { date: '2024-05-19', desktop: 235, mobile: 180 },
- { date: '2024-05-20', desktop: 177, mobile: 230 },
- { date: '2024-05-21', desktop: 82, mobile: 140 },
- { date: '2024-05-22', desktop: 81, mobile: 120 },
- { date: '2024-05-23', desktop: 252, mobile: 290 },
- { date: '2024-05-24', desktop: 294, mobile: 220 },
- { date: '2024-05-25', desktop: 201, mobile: 250 },
- { date: '2024-05-26', desktop: 213, mobile: 170 },
- { date: '2024-05-27', desktop: 420, mobile: 460 },
- { date: '2024-05-28', desktop: 233, mobile: 190 },
- { date: '2024-05-29', desktop: 78, mobile: 130 },
- { date: '2024-05-30', desktop: 340, mobile: 280 },
- { date: '2024-05-31', desktop: 178, mobile: 230 },
- { date: '2024-06-01', desktop: 178, mobile: 200 },
- { date: '2024-06-02', desktop: 470, mobile: 410 },
- { date: '2024-06-03', desktop: 103, mobile: 160 },
- { date: '2024-06-04', desktop: 439, mobile: 380 },
- { date: '2024-06-05', desktop: 88, mobile: 140 },
- { date: '2024-06-06', desktop: 294, mobile: 250 },
- { date: '2024-06-07', desktop: 323, mobile: 370 },
- { date: '2024-06-08', desktop: 385, mobile: 320 },
- { date: '2024-06-09', desktop: 438, mobile: 480 },
- { date: '2024-06-10', desktop: 155, mobile: 200 },
- { date: '2024-06-11', desktop: 92, mobile: 150 },
- { date: '2024-06-12', desktop: 492, mobile: 420 },
- { date: '2024-06-13', desktop: 81, mobile: 130 },
- { date: '2024-06-14', desktop: 426, mobile: 380 },
- { date: '2024-06-15', desktop: 307, mobile: 350 },
- { date: '2024-06-16', desktop: 371, mobile: 310 },
- { date: '2024-06-17', desktop: 475, mobile: 520 },
- { date: '2024-06-18', desktop: 107, mobile: 170 },
- { date: '2024-06-19', desktop: 341, mobile: 290 },
- { date: '2024-06-20', desktop: 408, mobile: 450 },
- { date: '2024-06-21', desktop: 169, mobile: 210 },
- { date: '2024-06-22', desktop: 317, mobile: 270 },
- { date: '2024-06-23', desktop: 480, mobile: 530 },
- { date: '2024-06-24', desktop: 132, mobile: 180 },
- { date: '2024-06-25', desktop: 141, mobile: 190 },
- { date: '2024-06-26', desktop: 434, mobile: 380 },
- { date: '2024-06-27', desktop: 448, mobile: 490 },
- { date: '2024-06-28', desktop: 149, mobile: 200 },
- { date: '2024-06-29', desktop: 103, mobile: 160 },
- { date: '2024-06-30', desktop: 446, mobile: 400 },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const [timeRange, setTimeRange] = React.useState('90d')
-
- const filteredData = chartData.filter((item) => {
- const date = new Date(item.date)
- const now = new Date()
- let daysToSubtract = 90
- if (timeRange === '30d') {
- daysToSubtract = 30
- } else if (timeRange === '7d') {
- daysToSubtract = 7
- }
- now.setDate(now.getDate() - daysToSubtract)
- return date >= now
- })
-
- return (
- <Card>
- <CardHeader className="flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row">
- <div className="grid flex-1 gap-1 text-center sm:text-left">
- <CardTitle>Area Chart - Interactive</CardTitle>
- <CardDescription>Showing total visitors for the last 3 months</CardDescription>
- </div>
- <Select_Shadcn_ value={timeRange} onValueChange={setTimeRange}>
- <SelectTrigger_Shadcn_
- className="w-[160px] rounded-lg sm:ml-auto"
- aria-label="Select a value"
- >
- <SelectValue_Shadcn_ placeholder="Last 3 months" />
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_ className="rounded-xl">
- <SelectItem_Shadcn_ value="90d" className="rounded-lg">
- Last 3 months
- </SelectItem_Shadcn_>
- <SelectItem_Shadcn_ value="30d" className="rounded-lg">
- Last 30 days
- </SelectItem_Shadcn_>
- <SelectItem_Shadcn_ value="7d" className="rounded-lg">
- Last 7 days
- </SelectItem_Shadcn_>
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- </CardHeader>
- <CardContent className="px-2 pt-4 sm:px-6 sm:pt-6">
- <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
- <AreaChart data={filteredData}>
- <defs>
- <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
- </linearGradient>
- <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
- </linearGradient>
- </defs>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="date"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- minTickGap={32}
- tickFormatter={(value) => {
- const date = new Date(value)
- return date.toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- })
- }}
- />
- <ChartTooltip
- cursor={false}
- content={
- <ChartTooltipContent
- labelFormatter={(value) => {
- return new Date(value).toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- })
- }}
- indicator="dot"
- />
- }
- />
- <Area
- dataKey="mobile"
- type="natural"
- fill="url(#fillMobile)"
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="url(#fillDesktop)"
- stroke="var(--color-desktop)"
- stackId="a"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-legend.tsx b/apps/design-system/__registry__/default/block/chart-area-legend.tsx
deleted file mode 100644
index a58cfa9fbd9..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-legend.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'An area chart with a legend'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Legend</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-linear.tsx b/apps/design-system/__registry__/default/block/chart-area-linear.tsx
deleted file mode 100644
index 8381711c7aa..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-linear.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A linear area chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Linear</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="dot" hideLabel />}
- />
- <Area
- dataKey="desktop"
- type="linear"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-stacked-expand.tsx b/apps/design-system/__registry__/default/block/chart-area-stacked-expand.tsx
deleted file mode 100644
index eca0b1118f7..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-stacked-expand.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A stacked area chart with expand stacking'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80, other: 45 },
- { month: 'February', desktop: 305, mobile: 200, other: 100 },
- { month: 'March', desktop: 237, mobile: 120, other: 150 },
- { month: 'April', desktop: 73, mobile: 190, other: 50 },
- { month: 'May', desktop: 209, mobile: 130, other: 100 },
- { month: 'June', desktop: 214, mobile: 140, other: 160 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-3))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Stacked Expanded</CardTitle>
- <CardDescription>Showing total visitors for the last 6months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- top: 12,
- }}
- stackOffset="expand"
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="other"
- type="natural"
- fill="var(--color-other)"
- fillOpacity={0.1}
- stroke="var(--color-other)"
- stackId="a"
- />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-stacked.tsx b/apps/design-system/__registry__/default/block/chart-area-stacked.tsx
deleted file mode 100644
index 22c0f58558b..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-stacked.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A stacked area chart'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Stacked</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dot" />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-area-step.tsx b/apps/design-system/__registry__/default/block/chart-area-step.tsx
deleted file mode 100644
index 5ac732aeaf4..00000000000
--- a/apps/design-system/__registry__/default/block/chart-area-step.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-'use client'
-
-import { Activity, TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A step area chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- icon: Activity,
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Step</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Area
- dataKey="desktop"
- type="step"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-active.tsx b/apps/design-system/__registry__/default/block/chart-bar-active.tsx
deleted file mode 100644
index b1ab1d95e1a..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-active.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, Rectangle, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with an active bar'
-
-const chartData = [
- { browser: 'chrome', visitors: 187, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 275, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Active</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="browser"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar
- dataKey="visitors"
- strokeWidth={2}
- radius={8}
- activeIndex={2}
- activeBar={({ ...props }) => {
- return (
- <Rectangle
- {...props}
- fillOpacity={0.8}
- stroke={props.payload.fill}
- strokeDasharray={4}
- strokeDashoffset={4}
- />
- )
- }}
- />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-default.tsx b/apps/design-system/__registry__/default/block/chart-bar-default.tsx
deleted file mode 100644
index 1c0596e3b57..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-default.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-horizontal.tsx b/apps/design-system/__registry__/default/block/chart-bar-horizontal.tsx
deleted file mode 100644
index 2305d0a4e1c..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-horizontal.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A horizontal bar chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Horizontal</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- layout="vertical"
- margin={{
- left: -20,
- }}
- >
- <XAxis type="number" dataKey="desktop" hide />
- <YAxis
- dataKey="month"
- type="category"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={5} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-bar-label-custom.tsx
deleted file mode 100644
index 7867342bc6d..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-label-custom.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with a custom label'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
- label: {
- color: 'hsl(var(--background))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Custom Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- layout="vertical"
- margin={{
- right: 16,
- }}
- >
- <CartesianGrid horizontal={false} />
- <YAxis
- dataKey="month"
- type="category"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- hide
- />
- <XAxis dataKey="desktop" type="number" hide />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Bar dataKey="desktop" layout="vertical" fill="var(--color-desktop)" radius={4}>
- <LabelList
- dataKey="month"
- position="insideLeft"
- offset={8}
- className="fill-[--color-label]"
- fontSize={12}
- />
- <LabelList
- dataKey="desktop"
- position="right"
- offset={8}
- className="fill-foreground"
- fontSize={12}
- />
- </Bar>
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-label.tsx b/apps/design-system/__registry__/default/block/chart-bar-label.tsx
deleted file mode 100644
index 3bbdcc7a7ea..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-label.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, LabelList, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with a label'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 20,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8}>
- <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
- </Bar>
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-mixed.tsx b/apps/design-system/__registry__/default/block/chart-bar-mixed.tsx
deleted file mode 100644
index 1790507f73f..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-mixed.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A mixed bar chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Mixed</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- layout="vertical"
- margin={{
- left: 0,
- }}
- >
- <YAxis
- dataKey="browser"
- type="category"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
- />
- <XAxis dataKey="visitors" type="number" hide />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="visitors" layout="vertical" radius={5} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-multiple.tsx b/apps/design-system/__registry__/default/block/chart-bar-multiple.tsx
deleted file mode 100644
index ffb9c61679a..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-multiple.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A multiple bar chart'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Multiple</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dashed" />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
- <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-negative.tsx b/apps/design-system/__registry__/default/block/chart-bar-negative.tsx
deleted file mode 100644
index 43f87ef0762..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-negative.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, Cell, LabelList } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with negative values'
-
-const chartData = [
- { month: 'January', visitors: 186 },
- { month: 'February', visitors: 205 },
- { month: 'March', visitors: -207 },
- { month: 'April', visitors: 173 },
- { month: 'May', visitors: -209 },
- { month: 'June', visitors: 214 },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Negative</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel hideIndicator />}
- />
- <Bar dataKey="visitors">
- <LabelList position="top" dataKey="month" fillOpacity={1} />
- {chartData.map((item) => (
- <Cell
- key={item.month}
- fill={item.visitors > 0 ? 'hsl(var(--chart-1))' : 'hsl(var(--chart-2))'}
- />
- ))}
- </Bar>
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-bar-stacked.tsx b/apps/design-system/__registry__/default/block/chart-bar-stacked.tsx
deleted file mode 100644
index 34a7439e982..00000000000
--- a/apps/design-system/__registry__/default/block/chart-bar-stacked.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'A stacked bar chart with a legend'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Stacked + Legend</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
- <ChartLegend content={<ChartLegendContent />} />
- <Bar dataKey="desktop" stackId="a" fill="var(--color-desktop)" radius={[0, 0, 4, 4]} />
- <Bar dataKey="mobile" stackId="a" fill="var(--color-mobile)" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-composed-actions.tsx b/apps/design-system/__registry__/default/block/chart-composed-actions.tsx
new file mode 100644
index 00000000000..f6eac7312b2
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-composed-actions.tsx
@@ -0,0 +1,106 @@
+'use client'
+
+import {
+ Chart,
+ ChartActions,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartTitle,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartBar,
+ ChartLine,
+} from 'ui-patterns/Chart'
+import { BarChart2, ExternalLink, LineChart } from 'lucide-react'
+import { useState, useEffect } from 'react'
+
+export default function ChartComposedActions() {
+ const [isLoading, setIsLoading] = useState(true)
+ const [chartType, setChartType] = useState<'bar' | 'line'>('bar')
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Opening in Logs Explorer...')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ {
+ label: 'Toggle Chart Type',
+ onClick: () => {
+ setChartType(chartType === 'bar' ? 'line' : 'bar')
+ },
+ icon: chartType === 'bar' ? <LineChart size={12} /> : <BarChart2 size={12} />,
+ },
+ ]
+
+ const data = Array.from({ length: 46 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ requests: Math.floor(Math.random() * 100),
+ }
+ }).reverse()
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Total Requests</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ {chartType === 'bar' ? (
+ <ChartBar
+ data={data}
+ dataKey="requests"
+ showGrid={false}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ ) : (
+ <ChartLine
+ data={data}
+ dataKey="requests"
+ showGrid={true}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ )}
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-composed-basic.tsx b/apps/design-system/__registry__/default/block/chart-composed-basic.tsx
new file mode 100644
index 00000000000..99778d63f43
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-composed-basic.tsx
@@ -0,0 +1,122 @@
+'use client'
+
+import {
+ Chart,
+ ChartActions,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartTitle,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartBar,
+ ChartLine,
+} from 'ui-patterns/Chart'
+import { BarChart2, ExternalLink } from 'lucide-react'
+import { useState, useEffect } from 'react'
+
+export default function ComposedChartBasic() {
+ const [isLoading, setIsLoading] = useState(true)
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Ta da! You clicked me! 🎉')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ const data = Array.from({ length: 46 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ standard_score: Math.floor(Math.random() * 100),
+ }
+ }).reverse()
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Standard Bar Chart</ChartTitle>
+
+ <ChartActions actions={actions} />
+ </ChartHeader>
+
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <ChartBar
+ data={data}
+ dataKey="standard_score"
+ showGrid={false}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Standard Line Chart</ChartTitle>
+
+ <ChartActions actions={actions} />
+ </ChartHeader>
+
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <ChartLine
+ data={data}
+ dataKey="standard_score"
+ showGrid={true}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-composed-demo.tsx b/apps/design-system/__registry__/default/block/chart-composed-demo.tsx
new file mode 100644
index 00000000000..c734900d395
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-composed-demo.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import {
+ Chart,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartMetric,
+} from 'ui-patterns/Chart'
+import { BarChart2 } from 'lucide-react'
+import { LogsBarChart } from 'ui-patterns/LogsBarChart'
+import { useState, useEffect } from 'react'
+
+export default function ComposedChartDemo() {
+ const [isLoading, setIsLoading] = useState(true)
+
+ const data = Array.from({ length: 60 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ ok_count: Math.floor(Math.random() * 100), // Random value 0-99
+ error_count: Math.floor(Math.random() * 50), // Random value 0-50
+ warning_count: Math.floor(Math.random() * 50), // Random value 0-50
+ }
+ }).reverse()
+
+ const totalUsersValue = 4663
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartMetric
+ label="Total Users"
+ value={totalUsersValue.toLocaleString('en-US')}
+ tooltip="This is a tooltip"
+ />
+ <div className="flex items-center gap-6">
+ <ChartMetric label="Warn" value="1.2k" status="warning" align="end" />
+ <ChartMetric label="Err" value="736" status="negative" align="end" />
+ </div>
+ </ChartHeader>
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <LogsBarChart data={data} isFullHeight={true} />
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-composed-metrics.tsx b/apps/design-system/__registry__/default/block/chart-composed-metrics.tsx
new file mode 100644
index 00000000000..0c876d7e589
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-composed-metrics.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import {
+ Chart,
+ ChartCard,
+ ChartHeader,
+ ChartActions,
+ ChartContent,
+ ChartMetric,
+ ChartSparkline,
+} from 'ui-patterns/Chart'
+import { ExternalLink } from 'lucide-react'
+import { useState, useEffect } from 'react'
+import { Skeleton } from 'ui'
+
+export default function ChartComposedMetrics() {
+ const [data, setData] = useState<Array<{ value: number; timestamp: string }>>([])
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Ta da! You clicked me! 🎉')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ useEffect(() => {
+ const now = new Date()
+ setData(
+ Array.from({ length: 12 }, (_, i) => ({
+ value: Math.floor(4000 + i * 100 + (Math.random() * 2000 - 800)),
+ timestamp: new Date(now.getTime() - (11 - i) * 60 * 60 * 1000).toISOString(),
+ }))
+ )
+ }, [])
+
+ const averageValue = data.reduce((acc, curr) => acc + curr.value, 0) / data.length
+
+ const diff = data[data.length - 1]?.value - data[0]?.value || 0
+ const diffPercentage = (diff / averageValue) * 100
+
+ return (
+ <div className="grid grid-cols-2 gap-6 w-full">
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader className="pb-4" align="start">
+ <ChartMetric label="Slow Queries" value={0} />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ </ChartCard>
+ </Chart>
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader className="pb-4" align="start">
+ <ChartMetric label="Sign Ups" value={127} />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ </ChartCard>
+ </Chart>
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader align="start">
+ <ChartMetric
+ label="Active Users"
+ value={averageValue.toLocaleString(undefined, { maximumFractionDigits: 0 })}
+ diffValue={diffPercentage.toFixed(2) + '%'}
+ />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ className="p-0"
+ loadingState={<Skeleton className="w-full h-[6rem] rounded-none mt-4" />}
+ >
+ <ChartSparkline data={data} dataKey="value" />
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader align="start">
+ <ChartMetric
+ label="Active Users"
+ value={averageValue.toLocaleString(undefined, { maximumFractionDigits: 0 })}
+ diffValue={diffPercentage.toFixed(2) + '%'}
+ />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ className="p-0"
+ loadingState={<Skeleton className="w-full h-[6rem] rounded-none mt-4" />}
+ >
+ <ChartSparkline data={data} dataKey="value" />
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-composed-states.tsx b/apps/design-system/__registry__/default/block/chart-composed-states.tsx
new file mode 100644
index 00000000000..4e5aa5d8bd5
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-composed-states.tsx
@@ -0,0 +1,92 @@
+'use client'
+
+import { BarChart2, ExternalLink } from 'lucide-react'
+import {
+ Chart,
+ ChartCard,
+ ChartHeader,
+ ChartTitle,
+ ChartActions,
+ ChartContent,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartDisabledState,
+} from 'ui-patterns/Chart'
+import { Badge } from 'ui'
+
+export default function ChartComposedStates() {
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Ta da! You clicked me! 🎉')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ const disabledActions = [
+ {
+ label: 'Upgrade to Pro',
+ href: '#',
+ },
+ ]
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={true}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Response Errors</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent loadingState={<ChartLoadingState />}>My chart here...</ChartContent>
+ </ChartCard>
+ </Chart>
+
+ <Chart>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Response Errors</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ isEmpty={true}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={20} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ My chart here...
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+
+ <Chart isDisabled={true}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Response Errors</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ loadingState={<ChartLoadingState />}
+ disabledState={
+ <ChartDisabledState
+ icon={<Badge variant="success">Pro</Badge>}
+ label="API Processing Time"
+ description="This chart is available on the Pro plan and above"
+ actions={disabledActions}
+ />
+ }
+ >
+ My chart here...
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-composed-table.tsx b/apps/design-system/__registry__/default/block/chart-composed-table.tsx
new file mode 100644
index 00000000000..303114447e9
--- /dev/null
+++ b/apps/design-system/__registry__/default/block/chart-composed-table.tsx
@@ -0,0 +1,106 @@
+'use client'
+
+import {
+ Chart,
+ ChartActions,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartTitle,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartBar,
+ ChartFooter,
+} from 'ui-patterns/Chart'
+import { BarChart2, ExternalLink } from 'lucide-react'
+import { useState, useEffect } from 'react'
+import { Table, TableHead, TableBody, TableRow, TableCell, TableHeader } from 'ui'
+import { format } from 'date-fns'
+
+export default function ChartComposedTable() {
+ const [isLoading, setIsLoading] = useState(true)
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Opening in Logs Explorer...')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ const data = Array.from({ length: 46 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ standard_score: Math.floor(Math.random() * 100),
+ }
+ }).reverse()
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Standard Bar Chart</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <ChartBar
+ data={data}
+ dataKey="standard_score"
+ showGrid={false}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ </div>
+ </ChartContent>
+ <ChartFooter>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>Timestamp</TableHead>
+ <TableHead className="text-right">Standard Score</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.slice(0, 3).map((item) => (
+ <TableRow key={item.timestamp}>
+ <TableCell className="text-foreground-light">
+ {format(new Date(item.timestamp), 'MMM d, yyyy h:mm a')}
+ </TableCell>
+ <TableCell className="text-right tabular-nums">{item.standard_score}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ </ChartFooter>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/__registry__/default/block/chart-line-default.tsx b/apps/design-system/__registry__/default/block/chart-line-default.tsx
deleted file mode 100644
index 408dc1d6f9f..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-default.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-dots-colors.tsx b/apps/design-system/__registry__/default/block/chart-line-dots-colors.tsx
deleted file mode 100644
index c8a55a0c44b..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-dots-colors.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Dot, Line, LineChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with dots and colors'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- color: 'hsl(var(--chart-2))',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Dots Colors</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 24,
- left: 24,
- right: 24,
- }}
- >
- <CartesianGrid vertical={false} />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
- />
- <Line
- dataKey="visitors"
- type="natural"
- stroke="var(--color-visitors)"
- strokeWidth={2}
- dot={({ payload, ...props }) => {
- return (
- <Dot
- key={payload.browser}
- r={5}
- cx={props.cx}
- cy={props.cy}
- fill={payload.fill}
- stroke={payload.fill}
- />
- )
- }}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-dots-custom.tsx b/apps/design-system/__registry__/default/block/chart-line-dots-custom.tsx
deleted file mode 100644
index 87c69309319..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-dots-custom.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-'use client'
-
-import { GitCommitVertical, TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with custom dots'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Custom Dots</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={({ cx, cy, payload }) => {
- const r = 24
- return (
- <GitCommitVertical
- key={payload.month}
- x={cx - r / 2}
- y={cy - r / 2}
- width={r}
- height={r}
- fill="hsl(var(--background))"
- stroke="var(--color-desktop)"
- />
- )
- }}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-dots.tsx b/apps/design-system/__registry__/default/block/chart-line-dots.tsx
deleted file mode 100644
index cc211f2c2b4..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-dots.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with dots'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Dots</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={{
- fill: 'var(--color-desktop)',
- }}
- activeDot={{
- r: 6,
- }}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-interactive.tsx b/apps/design-system/__registry__/default/block/chart-line-interactive.tsx
deleted file mode 100644
index 5f9c92b9792..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-interactive.tsx
+++ /dev/null
@@ -1,208 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'An interactive line chart'
-
-const chartData = [
- { date: '2024-04-01', desktop: 222, mobile: 150 },
- { date: '2024-04-02', desktop: 97, mobile: 180 },
- { date: '2024-04-03', desktop: 167, mobile: 120 },
- { date: '2024-04-04', desktop: 242, mobile: 260 },
- { date: '2024-04-05', desktop: 373, mobile: 290 },
- { date: '2024-04-06', desktop: 301, mobile: 340 },
- { date: '2024-04-07', desktop: 245, mobile: 180 },
- { date: '2024-04-08', desktop: 409, mobile: 320 },
- { date: '2024-04-09', desktop: 59, mobile: 110 },
- { date: '2024-04-10', desktop: 261, mobile: 190 },
- { date: '2024-04-11', desktop: 327, mobile: 350 },
- { date: '2024-04-12', desktop: 292, mobile: 210 },
- { date: '2024-04-13', desktop: 342, mobile: 380 },
- { date: '2024-04-14', desktop: 137, mobile: 220 },
- { date: '2024-04-15', desktop: 120, mobile: 170 },
- { date: '2024-04-16', desktop: 138, mobile: 190 },
- { date: '2024-04-17', desktop: 446, mobile: 360 },
- { date: '2024-04-18', desktop: 364, mobile: 410 },
- { date: '2024-04-19', desktop: 243, mobile: 180 },
- { date: '2024-04-20', desktop: 89, mobile: 150 },
- { date: '2024-04-21', desktop: 137, mobile: 200 },
- { date: '2024-04-22', desktop: 224, mobile: 170 },
- { date: '2024-04-23', desktop: 138, mobile: 230 },
- { date: '2024-04-24', desktop: 387, mobile: 290 },
- { date: '2024-04-25', desktop: 215, mobile: 250 },
- { date: '2024-04-26', desktop: 75, mobile: 130 },
- { date: '2024-04-27', desktop: 383, mobile: 420 },
- { date: '2024-04-28', desktop: 122, mobile: 180 },
- { date: '2024-04-29', desktop: 315, mobile: 240 },
- { date: '2024-04-30', desktop: 454, mobile: 380 },
- { date: '2024-05-01', desktop: 165, mobile: 220 },
- { date: '2024-05-02', desktop: 293, mobile: 310 },
- { date: '2024-05-03', desktop: 247, mobile: 190 },
- { date: '2024-05-04', desktop: 385, mobile: 420 },
- { date: '2024-05-05', desktop: 481, mobile: 390 },
- { date: '2024-05-06', desktop: 498, mobile: 520 },
- { date: '2024-05-07', desktop: 388, mobile: 300 },
- { date: '2024-05-08', desktop: 149, mobile: 210 },
- { date: '2024-05-09', desktop: 227, mobile: 180 },
- { date: '2024-05-10', desktop: 293, mobile: 330 },
- { date: '2024-05-11', desktop: 335, mobile: 270 },
- { date: '2024-05-12', desktop: 197, mobile: 240 },
- { date: '2024-05-13', desktop: 197, mobile: 160 },
- { date: '2024-05-14', desktop: 448, mobile: 490 },
- { date: '2024-05-15', desktop: 473, mobile: 380 },
- { date: '2024-05-16', desktop: 338, mobile: 400 },
- { date: '2024-05-17', desktop: 499, mobile: 420 },
- { date: '2024-05-18', desktop: 315, mobile: 350 },
- { date: '2024-05-19', desktop: 235, mobile: 180 },
- { date: '2024-05-20', desktop: 177, mobile: 230 },
- { date: '2024-05-21', desktop: 82, mobile: 140 },
- { date: '2024-05-22', desktop: 81, mobile: 120 },
- { date: '2024-05-23', desktop: 252, mobile: 290 },
- { date: '2024-05-24', desktop: 294, mobile: 220 },
- { date: '2024-05-25', desktop: 201, mobile: 250 },
- { date: '2024-05-26', desktop: 213, mobile: 170 },
- { date: '2024-05-27', desktop: 420, mobile: 460 },
- { date: '2024-05-28', desktop: 233, mobile: 190 },
- { date: '2024-05-29', desktop: 78, mobile: 130 },
- { date: '2024-05-30', desktop: 340, mobile: 280 },
- { date: '2024-05-31', desktop: 178, mobile: 230 },
- { date: '2024-06-01', desktop: 178, mobile: 200 },
- { date: '2024-06-02', desktop: 470, mobile: 410 },
- { date: '2024-06-03', desktop: 103, mobile: 160 },
- { date: '2024-06-04', desktop: 439, mobile: 380 },
- { date: '2024-06-05', desktop: 88, mobile: 140 },
- { date: '2024-06-06', desktop: 294, mobile: 250 },
- { date: '2024-06-07', desktop: 323, mobile: 370 },
- { date: '2024-06-08', desktop: 385, mobile: 320 },
- { date: '2024-06-09', desktop: 438, mobile: 480 },
- { date: '2024-06-10', desktop: 155, mobile: 200 },
- { date: '2024-06-11', desktop: 92, mobile: 150 },
- { date: '2024-06-12', desktop: 492, mobile: 420 },
- { date: '2024-06-13', desktop: 81, mobile: 130 },
- { date: '2024-06-14', desktop: 426, mobile: 380 },
- { date: '2024-06-15', desktop: 307, mobile: 350 },
- { date: '2024-06-16', desktop: 371, mobile: 310 },
- { date: '2024-06-17', desktop: 475, mobile: 520 },
- { date: '2024-06-18', desktop: 107, mobile: 170 },
- { date: '2024-06-19', desktop: 341, mobile: 290 },
- { date: '2024-06-20', desktop: 408, mobile: 450 },
- { date: '2024-06-21', desktop: 169, mobile: 210 },
- { date: '2024-06-22', desktop: 317, mobile: 270 },
- { date: '2024-06-23', desktop: 480, mobile: 530 },
- { date: '2024-06-24', desktop: 132, mobile: 180 },
- { date: '2024-06-25', desktop: 141, mobile: 190 },
- { date: '2024-06-26', desktop: 434, mobile: 380 },
- { date: '2024-06-27', desktop: 448, mobile: 490 },
- { date: '2024-06-28', desktop: 149, mobile: 200 },
- { date: '2024-06-29', desktop: 103, mobile: 160 },
- { date: '2024-06-30', desktop: 446, mobile: 400 },
-]
-
-const chartConfig = {
- views: {
- label: 'Page Views',
- },
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const [activeChart, setActiveChart] = React.useState<keyof typeof chartConfig>('desktop')
-
- const total = React.useMemo(
- () => ({
- desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),
- mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),
- }),
- []
- )
-
- return (
- <Card>
- <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
- <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
- <CardTitle>Line Chart - Interactive</CardTitle>
- <CardDescription>Showing total visitors for the last 3 months</CardDescription>
- </div>
- <div className="flex">
- {['desktop', 'mobile'].map((key) => {
- const chart = key as keyof typeof chartConfig
- return (
- <button
- key={chart}
- data-active={activeChart === chart}
- className="flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-muted/50 sm:border-l sm:border-t-0 sm:px-8 sm:py-6"
- onClick={() => setActiveChart(chart)}
- >
- <span className="text-xs text-muted-foreground">{chartConfig[chart].label}</span>
- <span className="text-lg font-bold leading-none sm:text-3xl">
- {total[key as keyof typeof total].toLocaleString()}
- </span>
- </button>
- )
- })}
- </div>
- </CardHeader>
- <CardContent className="px-2 sm:p-6">
- <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="date"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- minTickGap={32}
- tickFormatter={(value) => {
- const date = new Date(value)
- return date.toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- })
- }}
- />
- <ChartTooltip
- content={
- <ChartTooltipContent
- className="w-[150px]"
- nameKey="views"
- labelFormatter={(value) => {
- return new Date(value).toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- })
- }}
- />
- }
- />
- <Line
- dataKey={activeChart}
- type="monotone"
- stroke={`var(--color-${activeChart})`}
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-line-label-custom.tsx
deleted file mode 100644
index 3d84fec03a3..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-label-custom.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, LabelList, Line, LineChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with a custom label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- color: 'hsl(var(--chart-2))',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Custom Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 24,
- left: 24,
- right: 24,
- }}
- >
- <CartesianGrid vertical={false} />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
- />
- <Line
- dataKey="visitors"
- type="natural"
- stroke="var(--color-visitors)"
- strokeWidth={2}
- dot={{
- fill: 'var(--color-visitors)',
- }}
- activeDot={{
- r: 6,
- }}
- >
- <LabelList
- position="top"
- offset={12}
- className="fill-foreground"
- fontSize={12}
- dataKey="browser"
- formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
- />
- </Line>
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-label.tsx b/apps/design-system/__registry__/default/block/chart-line-label.tsx
deleted file mode 100644
index 2c187e95961..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-label.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, LabelList, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with a label'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 20,
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={{
- fill: 'var(--color-desktop)',
- }}
- activeDot={{
- r: 6,
- }}
- >
- <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
- </Line>
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-linear.tsx b/apps/design-system/__registry__/default/block/chart-line-linear.tsx
deleted file mode 100644
index 9219a3c9de4..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-linear.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A linear line chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Linear</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="linear"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-multiple.tsx b/apps/design-system/__registry__/default/block/chart-line-multiple.tsx
deleted file mode 100644
index f09714a2737..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-multiple.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A multiple line chart'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Multiple</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <Line
- dataKey="desktop"
- type="monotone"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- <Line
- dataKey="mobile"
- type="monotone"
- stroke="var(--color-mobile)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-line-step.tsx b/apps/design-system/__registry__/default/block/chart-line-step.tsx
deleted file mode 100644
index 0ab71e07d09..00000000000
--- a/apps/design-system/__registry__/default/block/chart-line-step.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with step'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Step</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="step"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-donut-active.tsx b/apps/design-system/__registry__/default/block/chart-pie-donut-active.tsx
deleted file mode 100644
index 2490b50f65f..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-donut-active.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, Pie, PieChart, Sector } from 'recharts'
-import { PieSectorDataItem } from 'recharts/types/polar/Pie'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A donut chart with an active sector'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Donut Active</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie
- data={chartData}
- dataKey="visitors"
- nameKey="browser"
- innerRadius={60}
- strokeWidth={5}
- activeIndex={0}
- activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
- <Sector {...props} outerRadius={outerRadius + 10} />
- )}
- />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-donut-text.tsx b/apps/design-system/__registry__/default/block/chart-pie-donut-text.tsx
deleted file mode 100644
index cba1eee8492..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-donut-text.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { TrendingUp } from 'lucide-react'
-import { Label, Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A donut chart with text'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 287, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 190, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const totalVisitors = React.useMemo(() => {
- return chartData.reduce((acc, curr) => acc + curr.visitors, 0)
- }, [])
-
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Donut with Text</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie
- data={chartData}
- dataKey="visitors"
- nameKey="browser"
- innerRadius={60}
- strokeWidth={5}
- >
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-3xl font-bold"
- >
- {totalVisitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </Pie>
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-donut.tsx b/apps/design-system/__registry__/default/block/chart-pie-donut.tsx
deleted file mode 100644
index 328fbd4b48a..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-donut.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A donut chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Donut</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" nameKey="browser" innerRadius={60} />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-interactive.tsx b/apps/design-system/__registry__/default/block/chart-pie-interactive.tsx
deleted file mode 100644
index be05cbf8e41..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-interactive.tsx
+++ /dev/null
@@ -1,170 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { Label, Pie, PieChart, Sector } from 'recharts'
-import { PieSectorDataItem } from 'recharts/types/polar/Pie'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartStyle, ChartTooltip, ChartTooltipContent } from 'ui'
-import {
- Select_Shadcn_,
- SelectContent_Shadcn_,
- SelectItem_Shadcn_,
- SelectTrigger_Shadcn_,
- SelectValue_Shadcn_,
-} from 'ui'
-
-export const description = 'An interactive pie chart'
-
-const desktopData = [
- { month: 'january', desktop: 186, fill: 'var(--color-january)' },
- { month: 'february', desktop: 305, fill: 'var(--color-february)' },
- { month: 'march', desktop: 237, fill: 'var(--color-march)' },
- { month: 'april', desktop: 173, fill: 'var(--color-april)' },
- { month: 'may', desktop: 209, fill: 'var(--color-may)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- desktop: {
- label: 'Desktop',
- },
- mobile: {
- label: 'Mobile',
- },
- january: {
- label: 'January',
- color: 'hsl(var(--chart-1))',
- },
- february: {
- label: 'February',
- color: 'hsl(var(--chart-2))',
- },
- march: {
- label: 'March',
- color: 'hsl(var(--chart-3))',
- },
- april: {
- label: 'April',
- color: 'hsl(var(--chart-4))',
- },
- may: {
- label: 'May',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const id = 'pie-interactive'
- const [activeMonth, setActiveMonth] = React.useState(desktopData[0].month)
-
- const activeIndex = React.useMemo(
- () => desktopData.findIndex((item) => item.month === activeMonth),
- [activeMonth]
- )
- const months = React.useMemo(() => desktopData.map((item) => item.month), [])
-
- return (
- <Card data-chart={id} className="flex flex-col">
- <ChartStyle id={id} config={chartConfig} />
- <CardHeader className="flex-row items-start space-y-0 pb-0">
- <div className="grid gap-1">
- <CardTitle>Pie Chart - Interactive</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </div>
- <Select_Shadcn_ value={activeMonth} onValueChange={setActiveMonth}>
- <SelectTrigger_Shadcn_
- className="ml-auto h-7 w-[130px] rounded-lg pl-2.5"
- aria-label="Select a value"
- >
- <SelectValue_Shadcn_ placeholder="Select month" />
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_ align="end" className="rounded-xl">
- {months.map((key) => {
- const config = chartConfig[key as keyof typeof chartConfig]
-
- if (!config) {
- return null
- }
-
- return (
- <SelectItem_Shadcn_ key={key} value={key} className="rounded-lg [&_span]:flex">
- <div className="flex items-center gap-2 text-xs">
- <span
- className="flex h-3 w-3 shrink-0 rounded-sm"
- style={{
- backgroundColor: `var(--color-${key})`,
- }}
- />
- {config?.label}
- </div>
- </SelectItem_Shadcn_>
- )
- })}
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- </CardHeader>
- <CardContent className="flex flex-1 justify-center pb-0">
- <ChartContainer
- id={id}
- config={chartConfig}
- className="mx-auto aspect-square w-full max-w-[300px]"
- >
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie
- data={desktopData}
- dataKey="desktop"
- nameKey="month"
- innerRadius={60}
- strokeWidth={5}
- activeIndex={activeIndex}
- activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
- <g>
- <Sector {...props} outerRadius={outerRadius + 10} />
- <Sector
- {...props}
- outerRadius={outerRadius + 25}
- innerRadius={outerRadius + 12}
- />
- </g>
- )}
- >
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-3xl font-bold"
- >
- {desktopData[activeIndex].desktop.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </Pie>
- </PieChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-pie-label-custom.tsx
deleted file mode 100644
index 5fcae35aabe..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-label-custom.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with a custom label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Custom Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
- <Pie
- data={chartData}
- dataKey="visitors"
- labelLine={false}
- label={({ payload, ...props }) => {
- return (
- <text
- cx={props.cx}
- cy={props.cy}
- x={props.x}
- y={props.y}
- textAnchor={props.textAnchor}
- dominantBaseline={props.dominantBaseline}
- fill="hsla(var(--foreground))"
- >
- {`${
- chartConfig[payload.browser as keyof typeof chartConfig]?.label
- } (${payload.visitors})`}
- </text>
- )
- }}
- nameKey="browser"
- />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-label-list.tsx b/apps/design-system/__registry__/default/block/chart-pie-label-list.tsx
deleted file mode 100644
index 814371c307e..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-label-list.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { LabelList, Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with a label list'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Label List</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
- <Pie data={chartData} dataKey="visitors">
- <LabelList
- dataKey="browser"
- className="fill-background"
- stroke="none"
- fontSize={12}
- formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
- />
- </Pie>
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-label.tsx b/apps/design-system/__registry__/default/block/chart-pie-label.tsx
deleted file mode 100644
index 408bd68fb95..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-label.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with a label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer
- config={chartConfig}
- className="mx-auto aspect-square max-h-[250px] pb-0 [&_.recharts-pie-label-text]:fill-foreground"
- >
- <PieChart>
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" label nameKey="browser" />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-legend.tsx b/apps/design-system/__registry__/default/block/chart-pie-legend.tsx
deleted file mode 100644
index c72830caf17..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-legend.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-'use client'
-
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent } from 'ui'
-
-export const description = 'A pie chart with a legend'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Legend</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[300px]">
- <PieChart>
- <Pie data={chartData} dataKey="visitors" />
- <ChartLegend
- content={<ChartLegendContent nameKey="browser" />}
- className="-translate-y-2 flex-wrap gap-2 [&>*]:basis-1/4 [&>*]:justify-center"
- />
- </PieChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-separator-none.tsx b/apps/design-system/__registry__/default/block/chart-pie-separator-none.tsx
deleted file mode 100644
index ed00866c3b8..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-separator-none.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with no separator'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Separator None</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" nameKey="browser" stroke="0" />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-simple.tsx b/apps/design-system/__registry__/default/block/chart-pie-simple.tsx
deleted file mode 100644
index a16fb87ca56..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-simple.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A simple pie chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" nameKey="browser" />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-pie-stacked.tsx b/apps/design-system/__registry__/default/block/chart-pie-stacked.tsx
deleted file mode 100644
index a2ab16ba711..00000000000
--- a/apps/design-system/__registry__/default/block/chart-pie-stacked.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { TrendingUp } from 'lucide-react'
-import { Label, Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with stacked sections'
-
-const desktopData = [
- { month: 'january', desktop: 186, fill: 'var(--color-january)' },
- { month: 'february', desktop: 305, fill: 'var(--color-february)' },
- { month: 'march', desktop: 237, fill: 'var(--color-march)' },
- { month: 'april', desktop: 173, fill: 'var(--color-april)' },
- { month: 'may', desktop: 209, fill: 'var(--color-may)' },
-]
-
-const mobileData = [
- { month: 'january', mobile: 80, fill: 'var(--color-january)' },
- { month: 'february', mobile: 200, fill: 'var(--color-february)' },
- { month: 'march', mobile: 120, fill: 'var(--color-march)' },
- { month: 'april', mobile: 190, fill: 'var(--color-april)' },
- { month: 'may', mobile: 130, fill: 'var(--color-may)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- desktop: {
- label: 'Desktop',
- },
- mobile: {
- label: 'Mobile',
- },
- january: {
- label: 'January',
- color: 'hsl(var(--chart-1))',
- },
- february: {
- label: 'February',
- color: 'hsl(var(--chart-2))',
- },
- march: {
- label: 'March',
- color: 'hsl(var(--chart-3))',
- },
- april: {
- label: 'April',
- color: 'hsl(var(--chart-4))',
- },
- may: {
- label: 'May',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Stacked</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip
- content={
- <ChartTooltipContent
- labelKey="visitors"
- nameKey="month"
- indicator="line"
- labelFormatter={(_, payload) => {
- return chartConfig[payload?.[0].dataKey as keyof typeof chartConfig].label
- }}
- />
- }
- />
- <Pie data={desktopData} dataKey="desktop" outerRadius={60} />
- <Pie data={mobileData} dataKey="mobile" innerRadius={70} outerRadius={90} />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-default.tsx b/apps/design-system/__registry__/default/block/chart-radar-default.tsx
deleted file mode 100644
index dc3d4e6d553..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-default.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-dots.tsx b/apps/design-system/__registry__/default/block/chart-radar-dots.tsx
deleted file mode 100644
index bedf14de29b..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-dots.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with dots'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center">
- <CardTitle>Radar Chart - Dots</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-circle-fill.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-circle-fill.tsx
deleted file mode 100644
index d17d1536225..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-grid-circle-fill.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid and circle fill'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 285 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 203 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 264 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Circle Filled</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <PolarGrid className="fill-[--color-desktop] opacity-20" gridType="circle" />
- <PolarAngleAxis dataKey="month" />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-circle-no-lines.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-circle-no-lines.tsx
deleted file mode 100644
index 3e602ac5745..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-grid-circle-no-lines.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid and circle fill'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 203 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Circle - No lines</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid gridType="circle" radialLines={false} />
- <PolarAngleAxis dataKey="month" />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-circle.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-circle.tsx
deleted file mode 100644
index 0cc0277a0c4..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-grid-circle.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid and circle'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Circle</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid gridType="circle" />
- <PolarAngleAxis dataKey="month" />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-custom.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-custom.tsx
deleted file mode 100644
index 31614acc9a3..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-grid-custom.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a custom grid'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Custom</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid radialLines={false} polarRadius={[90]} strokeWidth={1} />
- <PolarAngleAxis dataKey="month" />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-fill.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-fill.tsx
deleted file mode 100644
index 7745a10fb13..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-grid-fill.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid filled'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 285 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 203 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 264 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Filled</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid className="fill-[--color-desktop] opacity-20" />
- <PolarAngleAxis dataKey="month" />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-grid-none.tsx b/apps/design-system/__registry__/default/block/chart-radar-grid-none.tsx
deleted file mode 100644
index a75ac15da18..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-grid-none.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with no grid'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid None</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarAngleAxis dataKey="month" />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-icons.tsx b/apps/design-system/__registry__/default/block/chart-radar-icons.tsx
deleted file mode 100644
index b2a83ad3934..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-icons.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-'use client'
-
-import { ArrowDownFromLine, ArrowUpFromLine, TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'A radar chart with icons'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- icon: ArrowDownFromLine,
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- icon: ArrowUpFromLine,
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Icons</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart
- data={chartData}
- margin={{
- top: -40,
- bottom: -10,
- }}
- >
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- <ChartLegend className="mt-8" content={<ChartLegendContent />} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 pt-4 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-label-custom.tsx b/apps/design-system/__registry__/default/block/chart-radar-label-custom.tsx
deleted file mode 100644
index 51edad28517..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-label-custom.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a custom label'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Custom Label</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart
- data={chartData}
- margin={{
- top: 10,
- right: 10,
- bottom: 10,
- left: 10,
- }}
- >
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis
- dataKey="month"
- tick={({ x, y, textAnchor, value, index, ...props }) => {
- const data = chartData[index]
-
- return (
- <text
- x={x}
- y={index === 0 ? y - 10 : y}
- textAnchor={textAnchor}
- fontSize={13}
- fontWeight={500}
- {...props}
- >
- <tspan>{data.desktop}</tspan>
- <tspan className="fill-muted-foreground">/</tspan>
- <tspan>{data.mobile}</tspan>
- <tspan x={x} dy={'1rem'} fontSize={12} className="fill-muted-foreground">
- {data.month}
- </tspan>
- </text>
- )
- }}
- />
-
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-legend.tsx b/apps/design-system/__registry__/default/block/chart-radar-legend.tsx
deleted file mode 100644
index 1500cc422a3..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-legend.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'A radar chart with a legend'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Legend</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart
- data={chartData}
- margin={{
- top: -40,
- bottom: -10,
- }}
- >
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- <ChartLegend className="mt-8" content={<ChartLegendContent />} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 pt-4 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-lines-only.tsx b/apps/design-system/__registry__/default/block/chart-radar-lines-only.tsx
deleted file mode 100644
index acb880c81c3..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-lines-only.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with lines only'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 160 },
- { month: 'February', desktop: 185, mobile: 170 },
- { month: 'March', desktop: 207, mobile: 180 },
- { month: 'April', desktop: 173, mobile: 160 },
- { month: 'May', desktop: 160, mobile: 190 },
- { month: 'June', desktop: 174, mobile: 204 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Lines Only</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid radialLines={false} />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0}
- stroke="var(--color-desktop)"
- strokeWidth={2}
- />
- <Radar
- dataKey="mobile"
- fill="var(--color-mobile)"
- fillOpacity={0}
- stroke="var(--color-mobile)"
- strokeWidth={2}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-multiple.tsx b/apps/design-system/__registry__/default/block/chart-radar-multiple.tsx
deleted file mode 100644
index 5cc44043950..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-multiple.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with multiple data'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Multiple</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radar-radius.tsx b/apps/design-system/__registry__/default/block/chart-radar-radius.tsx
deleted file mode 100644
index f6616c4ac00..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radar-radius.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a radius axis'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Radius Axis</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="line" labelKey="month" />}
- />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- <PolarRadiusAxis
- angle={60}
- stroke="hsla(var(--foreground))"
- orientation="middle"
- axisLine={false}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-grid.tsx b/apps/design-system/__registry__/default/block/chart-radial-grid.tsx
deleted file mode 100644
index fea6deab0c2..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radial-grid.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarGrid, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart with a grid'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Grid</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart data={chartData} innerRadius={30} outerRadius={100}>
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel nameKey="browser" />}
- />
- <PolarGrid gridType="circle" />
- <RadialBar dataKey="visitors" />
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-label.tsx b/apps/design-system/__registry__/default/block/chart-radial-label.tsx
deleted file mode 100644
index 073e8b4ed47..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radial-label.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { LabelList, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart with a label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart
- data={chartData}
- startAngle={-90}
- endAngle={380}
- innerRadius={30}
- outerRadius={110}
- >
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel nameKey="browser" />}
- />
- <RadialBar dataKey="visitors" background>
- <LabelList
- position="insideStart"
- dataKey="browser"
- className="fill-white capitalize mix-blend-luminosity"
- fontSize={11}
- />
- </RadialBar>
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-shape.tsx b/apps/design-system/__registry__/default/block/chart-radial-shape.tsx
deleted file mode 100644
index 120a2df88d4..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radial-shape.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer } from 'ui'
-
-export const description = 'A radial chart with a custom shape'
-
-const chartData = [{ browser: 'safari', visitors: 1260, fill: 'var(--color-safari)' }]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Shape</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart data={chartData} endAngle={100} innerRadius={80} outerRadius={140}>
- <PolarGrid
- gridType="circle"
- radialLines={false}
- stroke="none"
- className="first:fill-muted last:fill-background"
- polarRadius={[86, 74]}
- />
- <RadialBar dataKey="visitors" background />
- <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-4xl font-bold"
- >
- {chartData[0].visitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </PolarRadiusAxis>
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-simple.tsx b/apps/design-system/__registry__/default/block/chart-radial-simple.tsx
deleted file mode 100644
index 6c7590b2573..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radial-simple.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart data={chartData} innerRadius={30} outerRadius={110}>
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel nameKey="browser" />}
- />
- <RadialBar dataKey="visitors" background />
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-stacked.tsx b/apps/design-system/__registry__/default/block/chart-radial-stacked.tsx
deleted file mode 100644
index e38791f9bae..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radial-stacked.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart with stacked sections'
-
-const chartData = [{ month: 'january', desktop: 1260, mobile: 570 }]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const totalVisitors = chartData[0].desktop + chartData[0].mobile
-
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Stacked</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex flex-1 items-center pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square w-full max-w-[250px]">
- <RadialBarChart data={chartData} endAngle={180} innerRadius={80} outerRadius={130}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text x={viewBox.cx} y={viewBox.cy} textAnchor="middle">
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) - 16}
- className="fill-foreground text-2xl font-bold"
- >
- {totalVisitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 4}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </PolarRadiusAxis>
- <RadialBar
- dataKey="desktop"
- stackId="a"
- cornerRadius={5}
- fill="var(--color-desktop)"
- className="stroke-transparent stroke-2"
- />
- <RadialBar
- dataKey="mobile"
- fill="var(--color-mobile)"
- stackId="a"
- cornerRadius={5}
- className="stroke-transparent stroke-2"
- />
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/default/block/chart-radial-text.tsx b/apps/design-system/__registry__/default/block/chart-radial-text.tsx
deleted file mode 100644
index 8dd238c505b..00000000000
--- a/apps/design-system/__registry__/default/block/chart-radial-text.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer } from 'ui'
-
-export const description = 'A radial chart with text'
-
-const chartData = [{ browser: 'safari', visitors: 200, fill: 'var(--color-safari)' }]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Text</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart
- data={chartData}
- startAngle={0}
- endAngle={250}
- innerRadius={80}
- outerRadius={110}
- >
- <PolarGrid
- gridType="circle"
- radialLines={false}
- stroke="none"
- className="first:fill-muted last:fill-background"
- polarRadius={[86, 74]}
- />
- <RadialBar dataKey="visitors" background cornerRadius={10} />
- <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-4xl font-bold"
- >
- {chartData[0].visitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </PolarRadiusAxis>
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/__registry__/index.tsx b/apps/design-system/__registry__/index.tsx
index a98b01a6c46..cf1a7450a49 100644
--- a/apps/design-system/__registry__/index.tsx
+++ b/apps/design-system/__registry__/index.tsx
@@ -2821,149 +2821,6 @@ export const Index: Record<string, any> = {
subcategory: "undefined",
chunks: []
},
- "chart-area-axes": {
- name: "chart-area-axes",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-axes")),
- source: "__registry__/default/block/chart-area-axes.tsx",
- files: ["registry/default/block/chart-area-axes.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-default": {
- name: "chart-area-default",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-default")),
- source: "__registry__/default/block/chart-area-default.tsx",
- files: ["registry/default/block/chart-area-default.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-gradient": {
- name: "chart-area-gradient",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-gradient")),
- source: "__registry__/default/block/chart-area-gradient.tsx",
- files: ["registry/default/block/chart-area-gradient.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-icons": {
- name: "chart-area-icons",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-icons")),
- source: "__registry__/default/block/chart-area-icons.tsx",
- files: ["registry/default/block/chart-area-icons.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-interactive": {
- name: "chart-area-interactive",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-interactive")),
- source: "__registry__/default/block/chart-area-interactive.tsx",
- files: ["registry/default/block/chart-area-interactive.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-legend": {
- name: "chart-area-legend",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-legend")),
- source: "__registry__/default/block/chart-area-legend.tsx",
- files: ["registry/default/block/chart-area-legend.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-linear": {
- name: "chart-area-linear",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-linear")),
- source: "__registry__/default/block/chart-area-linear.tsx",
- files: ["registry/default/block/chart-area-linear.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-stacked-expand": {
- name: "chart-area-stacked-expand",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-stacked-expand")),
- source: "__registry__/default/block/chart-area-stacked-expand.tsx",
- files: ["registry/default/block/chart-area-stacked-expand.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-stacked": {
- name: "chart-area-stacked",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-stacked")),
- source: "__registry__/default/block/chart-area-stacked.tsx",
- files: ["registry/default/block/chart-area-stacked.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-area-step": {
- name: "chart-area-step",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-area-step")),
- source: "__registry__/default/block/chart-area-step.tsx",
- files: ["registry/default/block/chart-area-step.tsx"],
- category: "Charts",
- subcategory: "Area",
- chunks: []
- },
- "chart-bar-active": {
- name: "chart-bar-active",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-active")),
- source: "__registry__/default/block/chart-bar-active.tsx",
- files: ["registry/default/block/chart-bar-active.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
- "chart-bar-default": {
- name: "chart-bar-default",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-default")),
- source: "__registry__/default/block/chart-bar-default.tsx",
- files: ["registry/default/block/chart-bar-default.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
- "chart-bar-horizontal": {
- name: "chart-bar-horizontal",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-horizontal")),
- source: "__registry__/default/block/chart-bar-horizontal.tsx",
- files: ["registry/default/block/chart-bar-horizontal.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
"chart-bar-interactive": {
name: "chart-bar-interactive",
type: "components:block",
@@ -2975,521 +2832,70 @@ export const Index: Record<string, any> = {
subcategory: "Bar",
chunks: []
},
- "chart-bar-label-custom": {
- name: "chart-bar-label-custom",
+ "chart-composed-demo": {
+ name: "chart-composed-demo",
type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-label-custom")),
- source: "__registry__/default/block/chart-bar-label-custom.tsx",
- files: ["registry/default/block/chart-bar-label-custom.tsx"],
+ registryDependencies: ["chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-composed-demo")),
+ source: "__registry__/default/block/chart-composed-demo.tsx",
+ files: ["registry/default/block/chart-composed-demo.tsx"],
category: "Charts",
- subcategory: "Bar",
+ subcategory: "Composed",
chunks: []
},
- "chart-bar-label": {
- name: "chart-bar-label",
+ "chart-composed-basic": {
+ name: "chart-composed-basic",
type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-label")),
- source: "__registry__/default/block/chart-bar-label.tsx",
- files: ["registry/default/block/chart-bar-label.tsx"],
+ registryDependencies: ["chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-composed-basic")),
+ source: "__registry__/default/block/chart-composed-basic.tsx",
+ files: ["registry/default/block/chart-composed-basic.tsx"],
category: "Charts",
- subcategory: "Bar",
+ subcategory: "Composed",
chunks: []
},
- "chart-bar-mixed": {
- name: "chart-bar-mixed",
+ "chart-composed-states": {
+ name: "chart-composed-states",
type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-mixed")),
- source: "__registry__/default/block/chart-bar-mixed.tsx",
- files: ["registry/default/block/chart-bar-mixed.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
- "chart-bar-multiple": {
- name: "chart-bar-multiple",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-multiple")),
- source: "__registry__/default/block/chart-bar-multiple.tsx",
- files: ["registry/default/block/chart-bar-multiple.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
- "chart-bar-negative": {
- name: "chart-bar-negative",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-negative")),
- source: "__registry__/default/block/chart-bar-negative.tsx",
- files: ["registry/default/block/chart-bar-negative.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
- "chart-bar-stacked": {
- name: "chart-bar-stacked",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-bar-stacked")),
- source: "__registry__/default/block/chart-bar-stacked.tsx",
- files: ["registry/default/block/chart-bar-stacked.tsx"],
- category: "Charts",
- subcategory: "Bar",
- chunks: []
- },
- "chart-line-default": {
- name: "chart-line-default",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-default")),
- source: "__registry__/default/block/chart-line-default.tsx",
- files: ["registry/default/block/chart-line-default.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-line-dots-colors": {
- name: "chart-line-dots-colors",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-dots-colors")),
- source: "__registry__/default/block/chart-line-dots-colors.tsx",
- files: ["registry/default/block/chart-line-dots-colors.tsx"],
+ registryDependencies: ["chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-composed-states")),
+ source: "__registry__/default/block/chart-composed-states.tsx",
+ files: ["registry/default/block/chart-composed-states.tsx"],
category: "Charts",
- subcategory: "Line",
+ subcategory: "Composed",
chunks: []
},
- "chart-line-dots-custom": {
- name: "chart-line-dots-custom",
+ "chart-composed-table": {
+ name: "chart-composed-table",
type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-dots-custom")),
- source: "__registry__/default/block/chart-line-dots-custom.tsx",
- files: ["registry/default/block/chart-line-dots-custom.tsx"],
+ registryDependencies: ["chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-composed-table")),
+ source: "__registry__/default/block/chart-composed-table.tsx",
+ files: ["registry/default/block/chart-composed-table.tsx"],
category: "Charts",
- subcategory: "Line",
+ subcategory: "Composed",
chunks: []
},
- "chart-line-dots": {
- name: "chart-line-dots",
+ "chart-composed-metrics": {
+ name: "chart-composed-metrics",
type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-dots")),
- source: "__registry__/default/block/chart-line-dots.tsx",
- files: ["registry/default/block/chart-line-dots.tsx"],
+ registryDependencies: ["chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-composed-metrics")),
+ source: "__registry__/default/block/chart-composed-metrics.tsx",
+ files: ["registry/default/block/chart-composed-metrics.tsx"],
category: "Charts",
- subcategory: "Line",
+ subcategory: "Composed",
chunks: []
},
- "chart-line-interactive": {
- name: "chart-line-interactive",
+ "chart-composed-actions": {
+ name: "chart-composed-actions",
type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-interactive")),
- source: "__registry__/default/block/chart-line-interactive.tsx",
- files: ["registry/default/block/chart-line-interactive.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-line-label-custom": {
- name: "chart-line-label-custom",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-label-custom")),
- source: "__registry__/default/block/chart-line-label-custom.tsx",
- files: ["registry/default/block/chart-line-label-custom.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-line-label": {
- name: "chart-line-label",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-label")),
- source: "__registry__/default/block/chart-line-label.tsx",
- files: ["registry/default/block/chart-line-label.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-line-linear": {
- name: "chart-line-linear",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-linear")),
- source: "__registry__/default/block/chart-line-linear.tsx",
- files: ["registry/default/block/chart-line-linear.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-line-multiple": {
- name: "chart-line-multiple",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-multiple")),
- source: "__registry__/default/block/chart-line-multiple.tsx",
- files: ["registry/default/block/chart-line-multiple.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-line-step": {
- name: "chart-line-step",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-line-step")),
- source: "__registry__/default/block/chart-line-step.tsx",
- files: ["registry/default/block/chart-line-step.tsx"],
- category: "Charts",
- subcategory: "Line",
- chunks: []
- },
- "chart-pie-donut-active": {
- name: "chart-pie-donut-active",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-donut-active")),
- source: "__registry__/default/block/chart-pie-donut-active.tsx",
- files: ["registry/default/block/chart-pie-donut-active.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-donut-text": {
- name: "chart-pie-donut-text",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-donut-text")),
- source: "__registry__/default/block/chart-pie-donut-text.tsx",
- files: ["registry/default/block/chart-pie-donut-text.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-donut": {
- name: "chart-pie-donut",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-donut")),
- source: "__registry__/default/block/chart-pie-donut.tsx",
- files: ["registry/default/block/chart-pie-donut.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-interactive": {
- name: "chart-pie-interactive",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-interactive")),
- source: "__registry__/default/block/chart-pie-interactive.tsx",
- files: ["registry/default/block/chart-pie-interactive.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-label-custom": {
- name: "chart-pie-label-custom",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-label-custom")),
- source: "__registry__/default/block/chart-pie-label-custom.tsx",
- files: ["registry/default/block/chart-pie-label-custom.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-label-list": {
- name: "chart-pie-label-list",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-label-list")),
- source: "__registry__/default/block/chart-pie-label-list.tsx",
- files: ["registry/default/block/chart-pie-label-list.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-label": {
- name: "chart-pie-label",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-label")),
- source: "__registry__/default/block/chart-pie-label.tsx",
- files: ["registry/default/block/chart-pie-label.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-legend": {
- name: "chart-pie-legend",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-legend")),
- source: "__registry__/default/block/chart-pie-legend.tsx",
- files: ["registry/default/block/chart-pie-legend.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-separator-none": {
- name: "chart-pie-separator-none",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-separator-none")),
- source: "__registry__/default/block/chart-pie-separator-none.tsx",
- files: ["registry/default/block/chart-pie-separator-none.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-simple": {
- name: "chart-pie-simple",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-simple")),
- source: "__registry__/default/block/chart-pie-simple.tsx",
- files: ["registry/default/block/chart-pie-simple.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-pie-stacked": {
- name: "chart-pie-stacked",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-pie-stacked")),
- source: "__registry__/default/block/chart-pie-stacked.tsx",
- files: ["registry/default/block/chart-pie-stacked.tsx"],
- category: "Charts",
- subcategory: "Pie",
- chunks: []
- },
- "chart-radar-default": {
- name: "chart-radar-default",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-default")),
- source: "__registry__/default/block/chart-radar-default.tsx",
- files: ["registry/default/block/chart-radar-default.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-dots": {
- name: "chart-radar-dots",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-dots")),
- source: "__registry__/default/block/chart-radar-dots.tsx",
- files: ["registry/default/block/chart-radar-dots.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-grid-circle-fill": {
- name: "chart-radar-grid-circle-fill",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-circle-fill")),
- source: "__registry__/default/block/chart-radar-grid-circle-fill.tsx",
- files: ["registry/default/block/chart-radar-grid-circle-fill.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-grid-circle-no-lines": {
- name: "chart-radar-grid-circle-no-lines",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-circle-no-lines")),
- source: "__registry__/default/block/chart-radar-grid-circle-no-lines.tsx",
- files: ["registry/default/block/chart-radar-grid-circle-no-lines.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-grid-circle": {
- name: "chart-radar-grid-circle",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-circle")),
- source: "__registry__/default/block/chart-radar-grid-circle.tsx",
- files: ["registry/default/block/chart-radar-grid-circle.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-grid-custom": {
- name: "chart-radar-grid-custom",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-custom")),
- source: "__registry__/default/block/chart-radar-grid-custom.tsx",
- files: ["registry/default/block/chart-radar-grid-custom.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-grid-fill": {
- name: "chart-radar-grid-fill",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-fill")),
- source: "__registry__/default/block/chart-radar-grid-fill.tsx",
- files: ["registry/default/block/chart-radar-grid-fill.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-grid-none": {
- name: "chart-radar-grid-none",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-grid-none")),
- source: "__registry__/default/block/chart-radar-grid-none.tsx",
- files: ["registry/default/block/chart-radar-grid-none.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-icons": {
- name: "chart-radar-icons",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-icons")),
- source: "__registry__/default/block/chart-radar-icons.tsx",
- files: ["registry/default/block/chart-radar-icons.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-label-custom": {
- name: "chart-radar-label-custom",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-label-custom")),
- source: "__registry__/default/block/chart-radar-label-custom.tsx",
- files: ["registry/default/block/chart-radar-label-custom.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-legend": {
- name: "chart-radar-legend",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-legend")),
- source: "__registry__/default/block/chart-radar-legend.tsx",
- files: ["registry/default/block/chart-radar-legend.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-lines-only": {
- name: "chart-radar-lines-only",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-lines-only")),
- source: "__registry__/default/block/chart-radar-lines-only.tsx",
- files: ["registry/default/block/chart-radar-lines-only.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-multiple": {
- name: "chart-radar-multiple",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-multiple")),
- source: "__registry__/default/block/chart-radar-multiple.tsx",
- files: ["registry/default/block/chart-radar-multiple.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radar-radius": {
- name: "chart-radar-radius",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radar-radius")),
- source: "__registry__/default/block/chart-radar-radius.tsx",
- files: ["registry/default/block/chart-radar-radius.tsx"],
- category: "Charts",
- subcategory: "Radar",
- chunks: []
- },
- "chart-radial-grid": {
- name: "chart-radial-grid",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radial-grid")),
- source: "__registry__/default/block/chart-radial-grid.tsx",
- files: ["registry/default/block/chart-radial-grid.tsx"],
- category: "Charts",
- subcategory: "Radial",
- chunks: []
- },
- "chart-radial-label": {
- name: "chart-radial-label",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radial-label")),
- source: "__registry__/default/block/chart-radial-label.tsx",
- files: ["registry/default/block/chart-radial-label.tsx"],
- category: "Charts",
- subcategory: "Radial",
- chunks: []
- },
- "chart-radial-shape": {
- name: "chart-radial-shape",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radial-shape")),
- source: "__registry__/default/block/chart-radial-shape.tsx",
- files: ["registry/default/block/chart-radial-shape.tsx"],
- category: "Charts",
- subcategory: "Radial",
- chunks: []
- },
- "chart-radial-simple": {
- name: "chart-radial-simple",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radial-simple")),
- source: "__registry__/default/block/chart-radial-simple.tsx",
- files: ["registry/default/block/chart-radial-simple.tsx"],
- category: "Charts",
- subcategory: "Radial",
- chunks: []
- },
- "chart-radial-stacked": {
- name: "chart-radial-stacked",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radial-stacked")),
- source: "__registry__/default/block/chart-radial-stacked.tsx",
- files: ["registry/default/block/chart-radial-stacked.tsx"],
- category: "Charts",
- subcategory: "Radial",
- chunks: []
- },
- "chart-radial-text": {
- name: "chart-radial-text",
- type: "components:block",
- registryDependencies: ["card","chart"],
- component: React.lazy(() => import("@/registry/default/block/chart-radial-text")),
- source: "__registry__/default/block/chart-radial-text.tsx",
- files: ["registry/default/block/chart-radial-text.tsx"],
+ registryDependencies: ["chart"],
+ component: React.lazy(() => import("@/registry/default/block/chart-composed-actions")),
+ source: "__registry__/default/block/chart-composed-actions.tsx",
+ files: ["registry/default/block/chart-composed-actions.tsx"],
category: "Charts",
- subcategory: "Radial",
+ subcategory: "Composed",
chunks: []
},
},
diff --git a/apps/design-system/components/source-panel.tsx b/apps/design-system/components/source-panel.tsx
index b3489b47c5a..9bcaa0edf9c 100644
--- a/apps/design-system/components/source-panel.tsx
+++ b/apps/design-system/components/source-panel.tsx
@@ -240,12 +240,70 @@ const SourcePanel = forwardRef<HTMLDivElement, React.HTMLProps<HTMLDivElement> &
}
}
+ const RechartsPanel = () => {
+ if (doc.source?.recharts) {
+ return (
+ <div
+ className={cn(
+ 'bg-surface-75/50 border flex items-center p-3 px-5 gap-6 first:rounded-t-md last:rounded-b-md',
+ props.className
+ )}
+ {...props}
+ >
+ <svg
+ width="146"
+ height="24"
+ viewBox="0 0 146 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M124.123 1.21484L109.695 23.9951L108.737 23.3887L107.779 22.7812L122.207 0L124.123 1.21484ZM15.4844 5.4082L2.96387 11.998L15.4844 18.5879L14.4277 20.5957L0 13.002L0.52832 11.998L0 10.9941L14.4277 3.40039L15.4844 5.4082ZM145.335 10.9941L144.807 11.998L145.335 13.002L130.907 20.5957L129.851 18.5879L142.37 11.998L129.851 5.4082L130.907 3.40039L145.335 10.9941ZM68.5801 8.39746C68.8994 8.39746 69.2665 8.43699 69.6807 8.51465C70.0991 8.58798 70.5024 8.74074 70.8906 8.97363C71.2832 9.20658 71.6093 9.55816 71.8682 10.0283C72.127 10.4985 72.2568 11.1286 72.2568 11.918V18.4678H70.7285V17.1221H70.6514C70.6409 17.1439 70.6271 17.1644 70.6152 17.1865C70.598 17.2186 70.5818 17.2524 70.5615 17.2852L70.4443 17.457C70.3581 17.5724 70.2545 17.6916 70.1338 17.8145C70.1245 17.8239 70.1141 17.8324 70.1045 17.8418C70.0734 17.8722 70.0414 17.9023 70.0078 17.9316C69.7839 18.1272 69.5044 18.2981 69.1689 18.4424C68.7678 18.6148 68.2781 18.7012 67.7002 18.7012C67.0703 18.7012 66.4988 18.582 65.9854 18.3447C65.6861 18.2039 65.4237 18.0261 65.1963 17.8135C65.0335 17.6615 64.8876 17.4915 64.7617 17.3027C64.5935 17.0479 64.4739 16.763 64.3994 16.4492C64.3724 16.3357 64.3497 16.2188 64.335 16.0977C64.3344 16.0928 64.3346 16.0879 64.334 16.083C64.3175 15.9423 64.3086 15.7965 64.3086 15.6455C64.3087 15.0766 64.4215 14.6153 64.6455 14.2617C64.7017 14.172 64.7624 14.0869 64.8281 14.0068C64.8444 13.987 64.862 13.9684 64.8789 13.9492C65.0657 13.7362 65.287 13.5583 65.5449 13.4189C65.736 13.3157 65.938 13.2267 66.1494 13.1504C66.3529 13.0768 66.5659 13.0155 66.7881 12.9668C66.9022 12.941 67.0165 12.9167 67.1309 12.8936C67.2457 12.8703 67.3605 12.8477 67.4756 12.8271C67.5904 12.8067 67.7053 12.7873 67.8203 12.7695C67.9354 12.7517 68.0507 12.7358 68.166 12.7207C68.77 12.6431 69.2604 12.5847 69.6357 12.5459C70.0151 12.5027 70.2914 12.4312 70.4639 12.332C70.53 12.2949 70.5836 12.2471 70.625 12.1895C70.6389 12.1701 70.651 12.1496 70.6621 12.1279C70.7063 12.0417 70.7285 11.9374 70.7285 11.8145V11.7627C70.7285 11.4437 70.6849 11.1601 70.5977 10.9121C70.554 10.7881 70.5001 10.6726 70.4346 10.5664C70.3692 10.4603 70.2923 10.3628 70.2051 10.2744C70.0325 10.0977 69.8149 9.9654 69.5527 9.87695C69.4871 9.85481 69.4189 9.83496 69.3477 9.81836C69.1342 9.76858 68.8955 9.74415 68.6318 9.74414C67.9029 9.7442 67.3311 9.90344 66.917 10.2227C66.7617 10.3424 66.6236 10.4651 66.5029 10.5908C66.3458 10.7544 66.2187 10.9237 66.1201 11.0977C66.1177 11.102 66.1147 11.106 66.1123 11.1104L66.0439 11.2451L64.5928 10.7275C64.6561 10.5797 64.7251 10.4395 64.7988 10.3076C64.8087 10.29 64.82 10.2732 64.8301 10.2559C64.8959 10.1423 64.9653 10.0349 65.0391 9.93359C65.0466 9.9232 65.0539 9.91261 65.0615 9.90234C65.0956 9.85658 65.1312 9.81272 65.167 9.76953C65.1741 9.76094 65.1803 9.75165 65.1875 9.74316C65.2256 9.69808 65.2647 9.65451 65.3047 9.6123C65.312 9.6046 65.3188 9.59647 65.3262 9.58887C65.3732 9.54019 65.4221 9.49397 65.4717 9.44922L65.5156 9.41211C65.5531 9.37961 65.59 9.34673 65.6289 9.31641C66.0646 8.97561 66.5394 8.73826 67.0527 8.60449C67.5703 8.46646 68.0797 8.3975 68.5801 8.39746ZM37.4268 8.40137C37.491 8.40408 37.5551 8.40769 37.6191 8.41309C38.0052 8.44542 38.3878 8.52676 38.7666 8.65625C38.8269 8.67688 38.8863 8.69992 38.9453 8.72363C39.0099 8.74954 39.0737 8.77707 39.1367 8.80664C39.4982 8.97651 39.835 9.20692 40.1455 9.49805C40.5595 9.88199 40.8889 10.3914 41.1348 11.0254C41.3807 11.6596 41.5039 12.4405 41.5039 13.3682V14.0156H34.2861C34.2975 14.3591 34.3374 14.677 34.4062 14.9697C34.4355 15.0944 34.4691 15.2146 34.5088 15.3301C34.5156 15.3499 34.5241 15.3691 34.5312 15.3887C34.5726 15.5024 34.6181 15.6123 34.6699 15.7168C34.7686 15.9108 34.8817 16.0874 35.0088 16.2471C35.2209 16.5132 35.4723 16.7314 35.7637 16.9014C35.7835 16.9128 35.8041 16.9227 35.8242 16.9336C35.9066 16.9783 35.9911 17.0191 36.0781 17.0557C36.4686 17.2196 36.9047 17.3027 37.3877 17.3027C37.7888 17.3027 38.1511 17.2468 38.4746 17.1348C38.7205 17.0474 38.9408 16.9278 39.1357 16.7773C39.2006 16.7273 39.263 16.6742 39.3223 16.6172C39.5596 16.3842 39.7426 16.0942 39.8721 15.749L41.3486 16.1641C41.2641 16.4361 41.147 16.6903 41 16.9268C40.8797 17.1202 40.7393 17.3022 40.5771 17.4717C40.5732 17.4758 40.5694 17.4802 40.5654 17.4844C40.4739 17.578 40.3767 17.6666 40.2744 17.75C40.1718 17.8337 40.0636 17.9119 39.9502 17.9854C39.7239 18.1318 39.4764 18.2586 39.207 18.3643C39.1943 18.3692 39.1808 18.3731 39.168 18.3779C39.0606 18.418 38.9505 18.4534 38.8379 18.4854C38.7505 18.5102 38.6618 18.5338 38.5713 18.5537C38.2032 18.6345 37.809 18.6757 37.3887 18.6758C36.9098 18.6758 36.4631 18.6224 36.0498 18.5166C35.6367 18.4109 35.2556 18.2524 34.9082 18.041C34.2182 17.6139 33.6858 17.0182 33.3105 16.2549C33.0626 15.7416 32.8996 15.1719 32.8174 14.5469C32.7764 14.2366 32.7539 13.9129 32.7539 13.5752C32.7539 13.0662 32.8006 12.5872 32.8936 12.1387C32.9168 12.0264 32.9427 11.9161 32.9717 11.8076C33.005 11.6833 33.043 11.5618 33.084 11.4424C33.15 11.2496 33.2246 11.0627 33.3105 10.8828C33.5386 10.4083 33.8218 9.99843 34.1582 9.65137C34.2094 9.59848 34.2627 9.54798 34.3164 9.49805C34.4283 9.39411 34.5451 9.29619 34.668 9.20508C34.7363 9.15438 34.8053 9.10434 34.877 9.05762C35.3818 8.72767 35.95 8.52098 36.5811 8.43848C36.7912 8.41103 37.0083 8.39746 37.2324 8.39746L37.4268 8.40137ZM48.0986 8.40332C48.5247 8.42359 48.9238 8.49477 49.2959 8.61621C49.4448 8.66475 49.5893 8.72142 49.7295 8.78613C49.9397 8.88317 50.1356 8.99496 50.3174 9.12109C50.6207 9.33139 50.8846 9.58181 51.1084 9.87305C51.2426 10.0477 51.3582 10.2331 51.4541 10.4297C51.6143 10.7574 51.7205 11.1165 51.7744 11.5049H50.2471C50.2179 11.3915 50.1797 11.2808 50.1328 11.1738C50.1094 11.1206 50.0835 11.0683 50.0557 11.0166C50.0165 10.9438 49.9718 10.8734 49.9238 10.8037C49.8011 10.6259 49.6509 10.4577 49.4707 10.3008C49.1806 10.0422 48.8166 9.87817 48.3789 9.80859C48.3554 9.80485 48.3316 9.80203 48.3076 9.79883C48.1675 9.78015 48.0199 9.76953 47.8652 9.76953C47.2702 9.76961 46.7483 9.92496 46.2998 10.2354C45.8554 10.5417 45.5081 10.9762 45.2578 11.5371C45.1964 11.6762 45.1428 11.8214 45.0967 11.9727C44.9584 12.4264 44.8887 12.9351 44.8887 13.498C44.8887 14.1236 44.9705 14.6829 45.1309 15.1768C45.1673 15.2888 45.2073 15.3977 45.252 15.5029C45.3749 15.7876 45.5228 16.0405 45.6953 16.2617C45.7385 16.317 45.7828 16.3705 45.8291 16.4219C45.9678 16.5759 46.1205 16.712 46.2871 16.8301C46.7357 17.1449 47.2614 17.3027 47.8652 17.3027C48.1627 17.3027 48.44 17.2641 48.6963 17.1865C48.7819 17.1606 48.8653 17.1302 48.9463 17.0957C49.2697 16.9577 49.5433 16.7587 49.7676 16.5C49.9919 16.2412 50.1522 15.9307 50.2471 15.5684H51.7744C51.6881 16.1551 51.4746 16.684 51.1338 17.1543C50.9655 17.3872 50.7701 17.5967 50.5469 17.7822C50.3238 17.9678 50.073 18.1296 49.7949 18.2676C49.6568 18.3355 49.5128 18.3953 49.3633 18.4463C48.988 18.5743 48.5767 18.6481 48.1299 18.6689C48.043 18.673 47.9548 18.6758 47.8652 18.6758C47.5157 18.6757 47.1843 18.644 46.8711 18.582C46.6625 18.5408 46.462 18.4857 46.2695 18.417C45.9809 18.3139 45.7102 18.1805 45.458 18.0156C45.2057 17.8507 44.9752 17.662 44.7666 17.4502C44.6273 17.3089 44.4978 17.1572 44.3779 16.9951C44.3044 16.8955 44.2361 16.791 44.1699 16.6836C44.0745 16.529 43.9855 16.3671 43.9053 16.1963C43.8748 16.1313 43.8473 16.0646 43.8193 15.998C43.8089 15.9732 43.7972 15.9489 43.7871 15.9238C43.7607 15.858 43.7369 15.791 43.7129 15.7236C43.7035 15.6972 43.6926 15.6712 43.6836 15.6445C43.6647 15.5889 43.6481 15.5323 43.6309 15.4756C43.6159 15.4264 43.6006 15.3771 43.5869 15.3271C43.5749 15.2832 43.5638 15.2389 43.5527 15.1943C43.5375 15.133 43.5232 15.0712 43.5098 15.0088C43.502 14.9725 43.4945 14.9361 43.4873 14.8994C43.4726 14.8244 43.4594 14.7485 43.4473 14.6719C43.4418 14.6372 43.4356 14.6024 43.4307 14.5674C43.4008 14.3561 43.3806 14.139 43.3701 13.916L43.3604 13.5498C43.3604 13.4238 43.3634 13.2991 43.3691 13.1768C43.4005 12.5179 43.5187 11.9131 43.7178 11.3613C43.7777 11.1951 43.8428 11.0324 43.918 10.876C44.1347 10.4276 44.4023 10.0378 44.7168 9.70312C44.9471 9.458 45.2018 9.24178 45.4844 9.05762C45.6527 8.94759 45.8284 8.85108 46.0107 8.76855C46.5574 8.52128 47.1671 8.39746 47.8398 8.39746C47.9272 8.39746 48.0135 8.39928 48.0986 8.40332ZM92.7695 8.40723C93.1189 8.42752 93.4386 8.47846 93.7285 8.55957C93.9217 8.61354 94.1018 8.68075 94.2686 8.76172C94.3973 8.82424 94.516 8.89802 94.6289 8.97656C94.662 8.99963 94.6967 9.02047 94.7285 9.04492C94.8275 9.1205 94.9198 9.20208 95.0088 9.28613C95.1102 9.38205 95.2066 9.48191 95.2949 9.58887C95.5713 9.92322 95.7833 10.3117 95.9316 10.7539L94.5596 11.1416C94.4733 10.9131 94.3459 10.6912 94.1777 10.4756C94.0138 10.2555 93.7896 10.074 93.5049 9.93164C93.2201 9.78932 92.8554 9.71777 92.4111 9.71777C91.9048 9.71781 91.4694 9.81642 91.1035 10.0107C91.0413 10.0438 90.981 10.0795 90.9229 10.1182C90.9122 10.1252 90.9011 10.1314 90.8906 10.1387C90.4894 10.4148 90.2891 10.7663 90.2891 11.1934C90.2891 11.2332 90.2909 11.2724 90.2939 11.3105C90.296 11.3367 90.2992 11.3624 90.3027 11.3877C90.343 11.6768 90.4759 11.9117 90.7031 12.0928C90.8369 12.1994 91.0071 12.2973 91.2139 12.3867C91.4338 12.4818 91.6948 12.568 91.9971 12.6436L93.4727 13.0049C93.6947 13.0588 93.9028 13.1202 94.0967 13.1885C94.1937 13.2226 94.287 13.2592 94.377 13.2969C94.8264 13.4854 95.1876 13.7184 95.46 13.9961L95.6133 14.167C95.6576 14.2219 95.6989 14.2786 95.7373 14.3369C95.7484 14.3538 95.7579 14.3715 95.7686 14.3887C95.796 14.4331 95.8225 14.4781 95.8467 14.5244C95.8579 14.5458 95.8675 14.568 95.8779 14.5898C95.8984 14.6325 95.9178 14.6755 95.9355 14.7197C95.9459 14.7455 95.9554 14.7716 95.9648 14.7979C95.9786 14.8363 95.9911 14.8754 96.0029 14.915C96.0133 14.9498 96.0233 14.9848 96.0322 15.0205C96.0403 15.053 96.0469 15.0859 96.0537 15.1191C96.0619 15.1588 96.0707 15.1986 96.0771 15.2393C96.0803 15.2593 96.0822 15.2795 96.085 15.2998C96.1021 15.4276 96.1133 15.5604 96.1133 15.6982C96.1132 16.1254 96.0214 16.5188 95.8369 16.8779C95.8064 16.9375 95.7729 16.996 95.7373 17.0537C95.7015 17.1116 95.663 17.1686 95.6221 17.2246C95.2985 17.6733 94.8451 18.0282 94.2627 18.2871C93.9779 18.4137 93.67 18.5086 93.3398 18.5732C92.9946 18.641 92.6243 18.6758 92.2295 18.6758C92.1031 18.6758 91.9794 18.6719 91.8584 18.665C91.6157 18.6513 91.384 18.6233 91.1631 18.582C90.9425 18.5408 90.7329 18.4857 90.5342 18.417C90.408 18.3734 90.2873 18.3222 90.1699 18.2676C90.0674 18.2198 89.9688 18.1675 89.873 18.1113C89.8192 18.0797 89.7646 18.0499 89.7129 18.0156C89.6598 17.9805 89.6105 17.9411 89.5605 17.9033C88.9847 17.4686 88.613 16.8643 88.4502 16.0859L89.9004 15.7236C89.9454 15.8982 90.0049 16.058 90.0762 16.2041C90.0955 16.2436 90.1155 16.282 90.1367 16.3193C90.2129 16.454 90.3013 16.5749 90.4023 16.6826C90.4874 16.7732 90.5801 16.8553 90.6826 16.9268C91.0708 17.1942 91.5788 17.328 92.2041 17.3281C92.2931 17.3281 92.3804 17.326 92.4648 17.3213C92.5491 17.3166 92.6312 17.3102 92.7109 17.3008C92.8705 17.282 93.0209 17.2535 93.1621 17.2158C93.2327 17.197 93.3011 17.1759 93.3672 17.1523C93.5654 17.0817 93.7425 16.9891 93.8994 16.876C93.9211 16.8603 93.9414 16.8432 93.9619 16.8271C94.3427 16.5306 94.5342 16.1807 94.5342 15.7754C94.5341 15.4732 94.4411 15.2142 94.2559 14.998C94.2295 14.9673 94.201 14.9372 94.1709 14.9082C94.02 14.7602 93.819 14.6353 93.5674 14.5342C93.416 14.4735 93.2464 14.4216 93.0586 14.3779L91.4014 13.9893C91.2193 13.9461 91.0475 13.8964 90.8848 13.8438C90.8658 13.8376 90.8469 13.8315 90.8281 13.8252C90.7712 13.8061 90.7157 13.7859 90.6611 13.7656C90.6188 13.7499 90.577 13.7342 90.5361 13.7178C90.4915 13.6998 90.4481 13.6809 90.4053 13.6621C90.3695 13.6464 90.3343 13.6306 90.2998 13.6143C90.2484 13.59 90.1981 13.5656 90.1494 13.54C90.1246 13.527 90.1003 13.5134 90.0762 13.5C90.0287 13.4737 89.9822 13.4476 89.9375 13.4199C89.9086 13.4021 89.8812 13.3826 89.8535 13.3643C89.8159 13.3393 89.7787 13.315 89.7432 13.2891C89.6818 13.2442 89.6226 13.1983 89.5674 13.1504L89.3955 12.9863C89.3463 12.9331 89.3004 12.8777 89.2568 12.8213C89.2316 12.7886 89.2088 12.7544 89.1855 12.7207C89.1689 12.6966 89.1514 12.6731 89.1357 12.6484C89.1171 12.6191 89.1003 12.5887 89.083 12.5586C89.0649 12.527 89.0469 12.4954 89.0303 12.4629C89.0148 12.4327 89.0004 12.402 88.9863 12.3711C88.9701 12.3354 88.9549 12.2993 88.9404 12.2627C88.9287 12.233 88.9168 12.2032 88.9062 12.1729C88.8925 12.1334 88.88 12.0933 88.8682 12.0527C88.8599 12.0243 88.852 11.9957 88.8447 11.9668C88.8321 11.9168 88.8212 11.866 88.8115 11.8145C88.8075 11.793 88.8024 11.7717 88.7988 11.75C88.7867 11.6757 88.7777 11.5999 88.7715 11.5225L88.7607 11.2715C88.7607 11.1314 88.7703 10.9953 88.79 10.8633C88.8294 10.5986 88.909 10.3504 89.0273 10.1182C89.0611 10.052 89.0985 9.98739 89.1387 9.92383C89.1687 9.87635 89.1998 9.82921 89.2334 9.7832C89.3131 9.67544 89.4001 9.57276 89.4941 9.47656C89.6355 9.33191 89.7932 9.20051 89.9668 9.08203C90.0245 9.04267 90.0843 9.00523 90.1455 8.96875C90.2067 8.93233 90.2693 8.89682 90.334 8.86328C90.3989 8.82962 90.4657 8.79736 90.5342 8.7666C90.5482 8.76036 90.563 8.75511 90.5771 8.74902C90.7021 8.69514 90.8305 8.64696 90.9629 8.60547C91.0363 8.58248 91.1108 8.56116 91.1865 8.54199C91.3382 8.50353 91.4944 8.47233 91.6553 8.44922C91.7358 8.43767 91.8176 8.4286 91.9004 8.4209C92.066 8.40547 92.2364 8.39748 92.4111 8.39746C92.5338 8.39746 92.6535 8.40052 92.7695 8.40723ZM84.6484 8.52637H86.7705V8.52734H86.7715V9.82129H84.6484V15.6201C84.6484 16.0516 84.7118 16.3761 84.8369 16.5918C84.9663 16.8027 85.1299 16.9453 85.3281 17.0186C85.4354 17.055 85.5459 17.0805 85.6592 17.0977C85.7598 17.1126 85.8626 17.1211 85.9678 17.1211C86.0518 17.1211 86.129 17.1194 86.1982 17.1152C86.2673 17.1109 86.3288 17.1043 86.3828 17.0957L86.6416 17.0439L86.9531 18.416L86.916 18.4268C86.8428 18.452 86.7525 18.4777 86.6445 18.5029C86.6047 18.5125 86.563 18.5239 86.5186 18.5332C86.4723 18.544 86.4226 18.5526 86.3701 18.5605C86.2124 18.5848 86.0269 18.5977 85.8135 18.5977C85.4897 18.5977 85.1705 18.5459 84.8564 18.4414C84.7518 18.4067 84.6475 18.3657 84.5439 18.3193C84.5336 18.3146 84.5239 18.3085 84.5137 18.3037C84.459 18.2781 84.4057 18.2508 84.3535 18.2217C84.3325 18.2099 84.3117 18.1979 84.291 18.1855C84.1667 18.1113 84.05 18.0267 83.9404 17.9316C83.9258 17.919 83.9118 17.9056 83.8975 17.8926C83.761 17.7685 83.6352 17.6291 83.5225 17.4717C83.4158 17.3203 83.3307 17.1526 83.2666 16.9697C83.1696 16.6937 83.1201 16.3819 83.1201 16.0342V9.82129H81.6191V8.52637H83.1201V6.14551H84.6484V8.52637ZM26.3555 5.21289C26.8732 5.21292 27.3446 5.25714 27.7695 5.3457C28.1944 5.43415 28.5731 5.56729 28.9053 5.74414C29.1541 5.87504 29.3787 6.02456 29.5791 6.19238C29.9137 6.47253 30.1812 6.80452 30.3809 7.1875C30.4605 7.34039 30.5301 7.49866 30.5898 7.66211C30.6797 7.90774 30.7471 8.16525 30.792 8.43457C30.837 8.70403 30.8594 8.98531 30.8594 9.27832L30.8525 9.56641C30.848 9.65322 30.8398 9.73875 30.8311 9.82324C30.8296 9.83729 30.8277 9.85125 30.8262 9.86523C30.8178 9.94007 30.8076 10.0139 30.7959 10.0869C30.7911 10.1167 30.7856 10.1463 30.7803 10.1758C30.7711 10.2263 30.7617 10.2765 30.751 10.3262C30.7439 10.3589 30.7363 10.3915 30.7285 10.4238C30.7164 10.4741 30.7033 10.5239 30.6895 10.5732C30.6809 10.6037 30.6723 10.634 30.6631 10.6641C30.6456 10.7214 30.6263 10.7779 30.6064 10.834C30.5973 10.8598 30.5887 10.8856 30.5791 10.9111C30.5657 10.9466 30.5515 10.9817 30.5371 11.0166C30.5186 11.0616 30.4996 11.1063 30.4795 11.1504C30.4769 11.1561 30.4753 11.1623 30.4727 11.168C30.4435 11.2313 30.4133 11.294 30.3809 11.3555C30.0616 11.9595 29.5713 12.4341 28.9111 12.7793C28.7466 12.8642 28.5702 12.9372 28.3828 13.001L31.377 18.4678H29.5127L26.7168 13.2832L26.3809 13.29H23.4814V18.4678H21.876V5.21289H26.3555ZM55.5342 5.21289L55.5352 5.21387V10.0801H55.6641C55.897 9.56672 56.247 9.15941 56.7129 8.85742C57.1832 8.55111 57.8089 8.39746 58.5898 8.39746C58.6745 8.39747 58.7578 8.39907 58.8398 8.40332C59.004 8.41183 59.1628 8.42956 59.3164 8.45508C59.4697 8.48054 59.6179 8.51425 59.7607 8.55664C59.9041 8.59919 60.042 8.65037 60.1748 8.70996C60.2408 8.73958 60.3057 8.77085 60.3691 8.80469C60.6239 8.93855 60.8503 9.10917 61.0479 9.31543C61.2453 9.5216 61.4145 9.76381 61.5547 10.042L61.6533 10.2559C61.6806 10.3205 61.7066 10.3868 61.7305 10.4551L61.7402 10.4844C61.7413 10.4876 61.7421 10.4909 61.7432 10.4941C61.7672 10.5654 61.7892 10.6387 61.8096 10.7139C61.8124 10.7242 61.8147 10.7347 61.8174 10.7451C61.8356 10.8145 61.852 10.8854 61.8672 10.958C61.8709 10.9759 61.8754 10.9937 61.8789 11.0117C61.8918 11.0771 61.9027 11.1439 61.9131 11.2119C61.9161 11.2317 61.92 11.2515 61.9229 11.2715C61.9324 11.3389 61.9401 11.4076 61.9473 11.4775C61.9494 11.4986 61.9522 11.5197 61.9541 11.541C61.9719 11.735 61.9814 11.9386 61.9814 12.1514V18.4678H60.4531V12.2549C60.4531 11.4656 60.2485 10.8553 59.8389 10.4238C59.4333 9.98806 58.8699 9.76953 58.1494 9.76953C57.8992 9.76953 57.6618 9.79579 57.4375 9.84863C57.3255 9.87509 57.2169 9.90863 57.1113 9.94824C57.0584 9.96807 57.0064 9.98956 56.9551 10.0127C56.9039 10.0358 56.8533 10.0605 56.8037 10.0869C56.5609 10.2177 56.3493 10.3858 56.1689 10.5908C56.0579 10.7173 55.9583 10.858 55.8711 11.0127C55.6469 11.4182 55.5352 11.9103 55.5352 12.4883V18.4678H54.0078V5.21289H55.5342ZM79.2119 8.37207C79.3239 8.37208 79.465 8.37363 79.6328 8.37793C79.801 8.38224 79.9284 8.38883 80.0146 8.39746V9.95117C79.9629 9.93823 79.8437 9.91847 79.6582 9.89258C79.5678 9.87752 79.4747 9.86594 79.3789 9.8584L79.082 9.84766C78.6597 9.84774 78.2768 9.92505 77.9336 10.0801C77.8846 10.1022 77.8365 10.1261 77.7891 10.1514C77.6485 10.2257 77.5182 10.3111 77.3994 10.4072C77.3596 10.4394 77.3215 10.4732 77.2842 10.5078C77.1354 10.6457 77.0055 10.8028 76.8955 10.9795C76.6799 11.3289 76.5713 11.7291 76.5713 12.1777V18.4678H75.0439V8.52734H75.0449V8.52637H76.5195V10.0283H76.623C76.6909 9.84406 76.7796 9.67287 76.8887 9.51465C76.926 9.4607 76.9657 9.40834 77.0078 9.35742C77.1713 9.15914 77.3713 8.98343 77.6074 8.83105C78.0225 8.56324 78.4837 8.41244 78.9912 8.37891C79.0638 8.37409 79.1374 8.37208 79.2119 8.37207ZM70.7285 13.4717C70.6637 13.5492 70.5215 13.6209 70.3018 13.6855C70.1962 13.7151 70.0821 13.7421 69.96 13.7686C69.8328 13.7961 69.6968 13.8225 69.5518 13.8467C69.3024 13.885 69.0575 13.9195 68.8184 13.9512C68.7886 13.9551 68.7591 13.96 68.7295 13.9639C68.4665 13.9941 68.2528 14.0195 68.0889 14.041C67.6919 14.0928 67.3207 14.1775 66.9756 14.2939C66.7625 14.3641 66.5746 14.4566 66.4121 14.5723C66.3149 14.6416 66.2266 14.7192 66.1475 14.8047C66.0783 14.8796 66.0218 14.9643 65.9756 15.0576C65.8837 15.2435 65.836 15.4651 65.8359 15.7236C65.8359 16.2384 66.0222 16.6302 66.3916 16.9014C66.4028 16.9096 66.4133 16.9188 66.4248 16.9268C66.66 17.0852 66.9327 17.196 67.2422 17.2607C67.3898 17.2916 67.5455 17.3128 67.71 17.3223C67.7827 17.3265 67.8575 17.3291 67.9336 17.3291C68.3112 17.3291 68.6517 17.2822 68.9551 17.1895C69.0763 17.1524 69.1914 17.1075 69.3008 17.0557C69.3555 17.0297 69.4092 17.0023 69.4609 16.9727C69.8793 16.7354 70.1939 16.428 70.4053 16.0527C70.5668 15.7715 70.6685 15.4797 70.709 15.1768C70.7225 15.0758 70.7285 14.9735 70.7285 14.8701V13.4717ZM37.2324 9.76953C36.8521 9.76954 36.5037 9.82827 36.1875 9.94629C36.0609 9.99362 35.9396 10.051 35.8232 10.1172C35.7654 10.1501 35.7086 10.1851 35.6533 10.2227C35.2133 10.5203 34.875 10.9089 34.6377 11.3877C34.61 11.4436 34.5831 11.4998 34.5586 11.5566C34.4048 11.9172 34.32 12.2971 34.2949 12.6953H39.9502C39.9502 12.625 39.9488 12.5557 39.9453 12.4873C39.9207 12.0098 39.8105 11.5784 39.6143 11.1934C39.3942 10.7533 39.0788 10.4059 38.6689 10.1514C38.2634 9.89694 37.7845 9.76953 37.2324 9.76953ZM23.4814 11.8408H26.3281C26.6818 11.8408 27.0014 11.8147 27.2861 11.7627C27.3573 11.7498 27.4263 11.7359 27.4932 11.7197C27.694 11.671 27.8752 11.607 28.0371 11.5293C28.3636 11.3741 28.6226 11.171 28.8135 10.9189C28.8454 10.8767 28.8752 10.833 28.9033 10.7881C28.9313 10.7435 28.9573 10.6976 28.9814 10.6504C29.0176 10.5804 29.0504 10.5075 29.0801 10.4326C29.1471 10.2631 29.1973 10.0813 29.2305 9.88672C29.243 9.81365 29.254 9.73868 29.2617 9.66211L29.2803 9.27832C29.2803 9.0131 29.2548 8.76434 29.2051 8.53223C29.1926 8.47388 29.1787 8.41659 29.1631 8.36035C29.1165 8.19267 29.0558 8.03444 28.9814 7.88574C28.9704 7.86364 28.9571 7.84283 28.9453 7.82129C28.9155 7.76685 28.8841 7.71394 28.8496 7.66309C28.8195 7.61871 28.7876 7.57582 28.7539 7.53418C28.5674 7.30385 28.3274 7.1144 28.0312 6.96777C27.5955 6.74773 27.019 6.6377 26.3027 6.6377H23.4814V11.8408Z"
+ fill="currentColor"
+ />
+ </svg>
+
+ <div className="flex flex-row items-center justify-between text-sm w-full">
+ <span className="text-foreground-light text-xs">This component uses Recharts</span>
+ {doc.links ? (
+ <div className="flex items-center gap-2 justify-end">
+ {doc.links?.doc && (
+ <Button
+ type="outline"
+ className="rounded-full"
+ icon={<ExternalLink className="text-foreground-muted" strokeWidth={1} />}
+ >
+ <Link href={doc.links.doc} target="_blank" rel="noreferrer">
+ Docs
+ </Link>
+ </Button>
+ )}
+ {doc.links?.api && (
+ <Button
+ type="outline"
+ className="rounded-full"
+ icon={<ExternalLink className="text-foreground-muted" strokeWidth={1} />}
+ >
+ <Link href={doc.links.api} target="_blank" rel="noreferrer">
+ API Reference
+ </Link>
+ </Button>
+ )}
+ </div>
+ ) : null}
+ </div>
+ </div>
+ )
+ }
+ }
+
return (
<div className="flex flex-col -space-y-px">
<RadixPanel />
<VaulPanel />
<InputOtp />
<ReactAccesibleTreeViewPanel />
+ <RechartsPanel />
{/* <ShadcnPanel /> */}
</div>
)
diff --git a/apps/design-system/config/docs.ts b/apps/design-system/config/docs.ts
index 2d5b6d2cd23..7d14cc61da8 100644
--- a/apps/design-system/config/docs.ts
+++ b/apps/design-system/config/docs.ts
@@ -59,13 +59,8 @@ export const docsConfig: DocsConfig = {
priority: true,
},
{
- title: 'Navigation',
- href: '/docs/ui-patterns/navigation',
- items: [],
- },
- {
- title: 'Layout',
- href: '/docs/ui-patterns/layout',
+ title: 'Charts',
+ href: '/docs/ui-patterns/charts',
items: [],
},
{
@@ -78,6 +73,16 @@ export const docsConfig: DocsConfig = {
href: '/docs/ui-patterns/forms',
items: [],
},
+ {
+ title: 'Layout',
+ href: '/docs/ui-patterns/layout',
+ items: [],
+ },
+ {
+ title: 'Navigation',
+ href: '/docs/ui-patterns/navigation',
+ items: [],
+ },
],
},
{
@@ -243,11 +248,6 @@ export const docsConfig: DocsConfig = {
href: '/docs/components/carousel',
items: [],
},
- {
- title: 'Chart',
- href: '/docs/components/chart',
- items: [],
- },
{
title: 'Checkbox',
href: '/docs/components/checkbox',
diff --git a/apps/design-system/content/docs/ui-patterns/charts.mdx b/apps/design-system/content/docs/ui-patterns/charts.mdx
new file mode 100644
index 00000000000..ef2b6cf8ad9
--- /dev/null
+++ b/apps/design-system/content/docs/ui-patterns/charts.mdx
@@ -0,0 +1,281 @@
+---
+title: Charts
+description: Composable charts for Reports, Dashboards and other visualizations.
+links:
+ doc: https://recharts.github.io/en-US/
+source:
+ recharts: true
+---
+
+<ComponentPreview name="chart-composed-demo" peekCode wide />
+
+## About
+
+Charts are an integral part of Observability at Supabase. Charts aim to be composable and reusable for frictionless setup.
+
+Our charts use a combination of our own presentational components and [Recharts](https://recharts.github.io/en-US/) for extensibility.
+
+## Best Practices
+
+1. **Use provided chart types first**: Always try to use the default provided charts first, otherwise passing Recharts compoennts to `<ChartContent>` is possible but not recommended to avoid complexity.
+
+2. **Use the `useChart` context to show loading and disabled states**: The `useChart` context provides boolean flags for child components to show `isLoading` and `isDisabled` states.
+
+3. **Keep it simple**: Try to avoid abstracting the chart content too much. These components should cover most of your presentational needs.
+
+## Examples
+
+### Basic Chart Types
+
+<ComponentPreview name="chart-composed-basic" wide />
+
+### Chart States
+
+<ComponentPreview name="chart-composed-states" wide />
+
+### Charts as Standalone Metrics
+
+<ComponentPreview name="chart-composed-metrics" wide />
+
+### Charts with Actions
+
+<ComponentPreview name="chart-composed-actions" wide />
+
+### Chart with Table
+
+<ComponentPreview name="chart-composed-table" wide />
+
+You can pass through our [Table](/docs/components/table) component to the `ChartFooter` and expect it to be styled correctly. There is no additional need to style the table, `ChartFooter` will handle the styling for you.
+
+## API
+
+### Chart
+
+The root container component that provides chart context to all child components.
+
+| Prop | Type | Default | Description |
+| ------------ | -------------------------------------- | ------- | ------------------------------------------------------------------ |
+| `children` | `React.ReactNode` | - | Chart child components |
+| `isLoading` | `boolean` | `false` | Shows loading state in child components via the `useChart` context |
+| `isDisabled` | `boolean` | `false` | Disables chart interactions via the `useChart` context |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartCard
+
+A card wrapper for the chart. Can be used as a Card component or as a slot.
+
+| Prop | Type | Default | Description |
+| ----------- | -------------------------------------- | ------- | ----------------------------------------------------------------------------- |
+| `children` | `React.ReactNode` | - | Chart content |
+| `asChild` | `boolean` | - | Render as child component (uses Slot) - ideal for removing the `Card` wrapper |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartHeader
+
+Container for chart header content like title and actions.
+
+| Prop | Type | Default | Description |
+| ----------- | -------------------------------------- | ---------- | ------------------------------------------------------------------- |
+| `children` | `React.ReactNode` | - | Header content (typically ChartTitle, ChartActions, or ChartMetric) |
+| `align` | `'start' \| 'center'` | `'center'` | Alignment of header content |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartTitle
+
+Displays the chart title with optional tooltip.
+
+| Prop | Type | Default | Description |
+| ----------- | -------------------------------------- | ------- | ------------------------------------- |
+| `children` | `React.ReactNode` | - | Title text |
+| `tooltip` | `string` | - | Tooltip text shown on help icon hover |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartActions
+
+Renders action buttons or links in the chart header.
+
+| Prop | Type | Default | Description |
+| ----------- | -------------------------------------- | ------- | ---------------------------------------------------------- |
+| `actions` | `ChartAction[]` | - | Array of action objects (see ChartAction type below) |
+| `children` | `React.ReactNode` | - | Custom action content (takes precedence over actions prop) |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+#### ChartAction Type
+
+| Property | Type | Description |
+| ----------- | -------------------- | ----------------------------------------------- |
+| `label` | `string` | Accessible label for the action |
+| `icon` | `React.ReactNode` | Icon component to display |
+| `onClick` | `() => void` | Click handler for button actions |
+| `href` | `string` | URL for link actions |
+| `type` | `'button' \| 'link'` | Action type (auto-detected if href is provided) |
+| `className` | `string` | Additional CSS classes |
+
+### ChartMetric
+
+Displays a metric value with optional status indicator.
+
+| Prop | Type | Default | Description |
+| ----------- | ---------------------------------------------------- | --------- | --------------------------------------------------- |
+| `label` | `string` | - | Metric label text |
+| `value` | `string \| number \| null \| undefined` | - | Metric value to display |
+| `diffValue` | `string \| number \| null \| undefined` | - | Differential value to display (shown as +/- change) |
+| `status` | `'positive' \| 'negative' \| 'warning' \| 'default'` | - | Status indicator color |
+| `align` | `'start' \| 'end'` | `'start'` | Alignment of the metric |
+| `tooltip` | `string` | - | Tooltip text shown on help icon hover |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartContent
+
+Container for the main chart visualization. Handles loading and empty states.
+
+| Prop | Type | Default | Description |
+| ----------------- | -------------------------------------- | ------- | -------------------------------------- |
+| `children` | `React.ReactNode` | - | Chart visualization content |
+| `isEmpty` | `boolean` | `false` | Whether to show empty state |
+| `emptyState` | `React.ReactNode` | - | Custom empty state component |
+| `loadingState` | `React.ReactNode` | - | Custom loading state component |
+| `disabledState` | `React.ReactNode` | - | Custom disabled state component |
+| `disabledActions` | `ChartAction[]` | - | Actions to show when chart is disabled |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartEmptyState
+
+Pre-built empty state component for charts.
+
+| Prop | Type | Default | Description |
+| ------------- | -------------------------------------- | ------- | ------------------------ |
+| `title` | `string` | - | Empty state title |
+| `description` | `string` | - | Empty state description |
+| `icon` | `React.ReactNode` | - | Optional icon to display |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartLoadingState
+
+Pre-built loading state component. Takes no props.
+
+### ChartFooter
+
+Container for footer content below the chart.
+
+| Prop | Type | Default | Description |
+| ----------- | -------------------------------------- | ------- | ---------------------- |
+| `children` | `React.ReactNode` | - | Footer content |
+| `className` | `string` | - | Additional CSS classes |
+| `...props` | `React.HTMLAttributes<HTMLDivElement>` | - | All standard div props |
+
+### ChartConfig
+
+Type definition for chart configuration used with Recharts components.
+
+```tsx
+type ChartConfig = {
+ [key: string]: {
+ label?: React.ReactNode
+ icon?: React.ComponentType
+ } & (
+ | { color?: string; theme?: never }
+ | { color?: never; theme: Record<'light' | 'dark', string> }
+ )
+}
+```
+
+| Property | Type | Description |
+| -------- | ----------------------------------- | -------------------------------------------------------- |
+| `label` | `React.ReactNode` | Label for the data series |
+| `icon` | `React.ComponentType` | Icon component for the data series |
+| `color` | `string` | Single color value (mutually exclusive with theme) |
+| `theme` | `Record<'light' \| 'dark', string>` | Theme-aware color values (mutually exclusive with color) |
+
+### ChartLine
+
+Line chart component for displaying time-series data.
+
+| Prop | Type | Default | Description |
+| ------------------- | --------------------------------------------------------------------- | ----------------------------- | ----------------------------------------------------------------- |
+| `data` | `ChartLineTick[]` | - | Array of data points with timestamp |
+| `dataKey` | `string` | - | Key in data object to plot |
+| `config` | `ChartConfig?` | - | Chart configuration for styling |
+| `onLineClick` | `(datum: ChartLineTick, tooltipData?: CategoricalChartState) => void` | - | Click handler for line points |
+| `DateTimeFormat` | `string` | `'MMM D, YYYY, hh:mma'` | Date format for tooltips and labels |
+| `isFullHeight` | `boolean` | `false` | Whether chart should take full height |
+| `className` | `string` | - | Additional CSS classes |
+| `color` | `string` | `'hsl(var(--brand-default))'` | Line color |
+| `hoverColor` | `string` | `'hsl(var(--brand-500))'` | Line color on hover |
+| `chartHighlight` | `ChartHighlight` | - | Highlight selection configuration |
+| `updateDateRange` | `(from: string, to: string) => void` | - | Callback when date range is updated via highlight |
+| `highlightActions` | `ChartHighlightAction[]` | - | Actions to show when area is highlighted |
+| `syncId` | `string` | - | ID to sync multiple charts |
+| `showHighlightArea` | `boolean` | `true` | Whether to show highlight area |
+| `cursor` | `string` | - | Cursor style (defaults to 'crosshair' if chartHighlight provided) |
+| `showGrid` | `boolean` | `false` | Whether to show grid lines |
+| `showYAxis` | `boolean` | `false` | Whether to show Y-axis |
+| `YAxisProps` | `object` | - | Additional Y-axis props (tick, tickFormatter, width, etc.) |
+| `strokeWidth` | `number` | `1.5` | Line stroke width |
+
+#### ChartLineTick Type
+
+| Property | Type | Description |
+| --------------- | ------------------ | ---------------------------- |
+| `timestamp` | `string` | Timestamp for the data point |
+| `[key: string]` | `string \| number` | Additional data fields |
+
+#### ChartHighlight Type
+
+| Property | Type | Description |
+| ----------------- | ------------------------------------------------------------- | ------------------------------------ |
+| `handleMouseDown` | `(e: { activeLabel?: string; coordinates?: string }) => void` | Mouse down handler |
+| `handleMouseMove` | `(e: { activeLabel?: string; coordinates?: string }) => void` | Mouse move handler |
+| `handleMouseUp` | `(e: { chartX?: number; chartY?: number }) => void` | Mouse up handler |
+| `coordinates` | `{ left?: string; right?: string }` | Highlight area coordinates |
+| `clearHighlight` | `() => void?` | Optional function to clear highlight |
+
+#### ChartHighlightAction Type
+
+| Property | Type | Description |
+| ------------ | -------------------------------------------------------------------------------- | ---------------------------------------------------- |
+| `id` | `string` | Unique identifier for the action |
+| `label` | `string \| ((ctx: { start: string; end: string; clear: () => void }) => string)` | Action label or function that returns label |
+| `icon` | `ReactNode?` | Optional icon component |
+| `isDisabled` | `(ctx: { start: string; end: string; clear: () => void }) => boolean?` | Optional function to determine if action is disabled |
+| `onSelect` | `(ctx: { start: string; end: string; clear: () => void }) => void` | Action selection handler |
+
+### ChartBar
+
+Bar chart component for displaying time-series data.
+
+| Prop | Type | Default | Description |
+| ------------------- | -------------------------------------------------------------------- | ----------------------------- | ----------------------------------------------------------------- |
+| `data` | `ChartBarTick[]` | - | Array of data points with timestamp |
+| `dataKey` | `string` | - | Key in data object to plot |
+| `config` | `ChartConfig?` | - | Chart configuration for styling |
+| `onBarClick` | `(datum: ChartBarTick, tooltipData?: CategoricalChartState) => void` | - | Click handler for bars |
+| `DateTimeFormat` | `string` | `'MMM D, YYYY, hh:mma'` | Date format for tooltips and labels |
+| `isFullHeight` | `boolean` | `false` | Whether chart should take full height |
+| `className` | `string` | - | Additional CSS classes |
+| `color` | `string` | `'hsl(var(--brand-default))'` | Bar color |
+| `hoverColor` | `string` | `'hsl(var(--brand-500))'` | Bar color on hover |
+| `chartHighlight` | `ChartHighlight` | - | Highlight selection configuration |
+| `updateDateRange` | `(from: string, to: string) => void` | - | Callback when date range is updated via highlight |
+| `highlightActions` | `ChartHighlightAction[]` | - | Actions to show when area is highlighted |
+| `syncId` | `string` | - | ID to sync multiple charts |
+| `showHighlightArea` | `boolean` | `true` | Whether to show highlight area |
+| `cursor` | `string` | - | Cursor style (defaults to 'crosshair' if chartHighlight provided) |
+| `showGrid` | `boolean` | `false` | Whether to show grid lines |
+| `showYAxis` | `boolean` | `false` | Whether to show Y-axis |
+| `YAxisProps` | `object` | - | Additional Y-axis props (tick, tickFormatter, width, etc.) |
+
+#### ChartBarTick Type
+
+| Property | Type | Description |
+| --------------- | ------------------ | ---------------------------- |
+| `timestamp` | `string` | Timestamp for the data point |
+| `[key: string]` | `string \| number` | Additional data fields |
diff --git a/apps/design-system/content/docs/ui-patterns/ui-patterns.mdx b/apps/design-system/content/docs/ui-patterns/ui-patterns.mdx
index 51fd64b26fa..b89667e7750 100644
--- a/apps/design-system/content/docs/ui-patterns/ui-patterns.mdx
+++ b/apps/design-system/content/docs/ui-patterns/ui-patterns.mdx
@@ -7,7 +7,7 @@ UI patterns are reusable design solutions that combine multiple components from
These patterns help ensure consistency across Supabase products by establishing standard approaches for:
-- **Charts**: Visualizing data consistently using standardized chart types and styling.
+- **[Charts](/docs/ui-patterns/charts)**: Visualizing data consistently using standardized chart types and styling.
- **[Empty States](/docs/ui-patterns/empty-states)**: Communicating the absence of data and guiding users toward meaningful actions.
- **[Forms](/docs/ui-patterns/forms)**: Building cohesive form experiences in both page layouts and side panels.
- **[Layout](/docs/ui-patterns/layout)**: Creating consistent page structures with proper spacing, max-widths, and content organization.
diff --git a/apps/design-system/contentlayer.config.js b/apps/design-system/contentlayer.config.js
index edc30b91b1d..4d12b6a0886 100644
--- a/apps/design-system/contentlayer.config.js
+++ b/apps/design-system/contentlayer.config.js
@@ -53,6 +53,9 @@ const NestedProperties = defineNestedType(() => ({
reactAccessibleTreeview: {
type: 'boolean',
},
+ recharts: {
+ type: 'boolean',
+ },
},
}))
diff --git a/apps/design-system/eslint.config.cjs b/apps/design-system/eslint.config.cjs
index fec3ac9b3ab..e425bf679a9 100644
--- a/apps/design-system/eslint.config.cjs
+++ b/apps/design-system/eslint.config.cjs
@@ -1,4 +1,12 @@
const { defineConfig } = require('eslint/config')
const supabaseConfig = require('eslint-config-supabase/next')
-module.exports = defineConfig([supabaseConfig])
+module.exports = defineConfig([
+ supabaseConfig,
+ {
+ files: ['registry/**/*.tsx', '__registry__/**/*.tsx'],
+ rules: {
+ 'no-restricted-exports': 'off',
+ },
+ },
+])
diff --git a/apps/design-system/package.json b/apps/design-system/package.json
index 4bbe1a1a286..91f206c5a76 100644
--- a/apps/design-system/package.json
+++ b/apps/design-system/package.json
@@ -19,8 +19,8 @@
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"contentlayer2": "0.4.6",
- "dayjs": "1.11.13",
"date-fns": "^2.30.0",
+ "dayjs": "1.11.13",
"eslint-config-supabase": "workspace:*",
"icons": "workspace:*",
"jotai": "^2.8.0",
diff --git a/apps/design-system/registry/charts.ts b/apps/design-system/registry/charts.ts
index be6ab4c2b48..9a42e5095a0 100644
--- a/apps/design-system/registry/charts.ts
+++ b/apps/design-system/registry/charts.ts
@@ -1,113 +1,6 @@
import { Registry } from './schema'
export const charts: Registry = [
- // Area Charts
- {
- name: 'chart-area-axes',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-axes.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-default',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-default.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-gradient',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-gradient.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-icons',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-icons.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-interactive',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-interactive.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-legend',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-legend.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-linear',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-linear.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-stacked-expand',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-stacked-expand.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-stacked',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-stacked.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
- {
- name: 'chart-area-step',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-area-step.tsx'],
- category: 'Charts',
- subcategory: 'Area',
- },
-
- // Bar Charts
- {
- name: 'chart-bar-active',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-active.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-default',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-default.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-horizontal',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-horizontal.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
{
name: 'chart-bar-interactive',
type: 'components:block',
@@ -117,387 +10,51 @@ export const charts: Registry = [
subcategory: 'Bar',
},
{
- name: 'chart-bar-label-custom',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-label-custom.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-label',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-label.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-mixed',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-mixed.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-multiple',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-multiple.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-negative',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-negative.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
- {
- name: 'chart-bar-stacked',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-bar-stacked.tsx'],
- category: 'Charts',
- subcategory: 'Bar',
- },
-
- // Line Charts
- {
- name: 'chart-line-default',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-default.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-dots-colors',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-dots-colors.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-dots-custom',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-dots-custom.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-dots',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-dots.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-interactive',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-interactive.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-label-custom',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-label-custom.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-label',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-label.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-linear',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-linear.tsx'],
- category: 'Charts',
- subcategory: 'Line',
- },
- {
- name: 'chart-line-multiple',
+ name: 'chart-composed-demo',
type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-multiple.tsx'],
+ registryDependencies: ['chart'],
+ files: ['block/chart-composed-demo.tsx'],
category: 'Charts',
- subcategory: 'Line',
+ subcategory: 'Composed',
},
{
- name: 'chart-line-step',
+ name: 'chart-composed-basic',
type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-line-step.tsx'],
+ registryDependencies: ['chart'],
+ files: ['block/chart-composed-basic.tsx'],
category: 'Charts',
- subcategory: 'Line',
+ subcategory: 'Composed',
},
-
- // Pie Charts
{
- name: 'chart-pie-donut-active',
+ name: 'chart-composed-states',
type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-donut-active.tsx'],
+ registryDependencies: ['chart'],
+ files: ['block/chart-composed-states.tsx'],
category: 'Charts',
- subcategory: 'Pie',
+ subcategory: 'Composed',
},
{
- name: 'chart-pie-donut-text',
+ name: 'chart-composed-table',
type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-donut-text.tsx'],
+ registryDependencies: ['chart'],
+ files: ['block/chart-composed-table.tsx'],
category: 'Charts',
- subcategory: 'Pie',
+ subcategory: 'Composed',
},
{
- name: 'chart-pie-donut',
+ name: 'chart-composed-metrics',
type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-donut.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-interactive',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-interactive.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-label-custom',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-label-custom.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-label-list',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-label-list.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-label',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-label.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-legend',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-legend.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-separator-none',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-separator-none.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-simple',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-simple.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
- {
- name: 'chart-pie-stacked',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-pie-stacked.tsx'],
- category: 'Charts',
- subcategory: 'Pie',
- },
-
- // Radar Charts
- {
- name: 'chart-radar-default',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-default.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-dots',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-dots.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-grid-circle-fill',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-grid-circle-fill.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-grid-circle-no-lines',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-grid-circle-no-lines.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-grid-circle',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-grid-circle.tsx'],
+ registryDependencies: ['chart'],
+ files: ['block/chart-composed-metrics.tsx'],
category: 'Charts',
- subcategory: 'Radar',
+ subcategory: 'Composed',
},
{
- name: 'chart-radar-grid-custom',
+ name: 'chart-composed-actions',
type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-grid-custom.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-grid-fill',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-grid-fill.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-grid-none',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-grid-none.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-icons',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-icons.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-label-custom',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-label-custom.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-legend',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-legend.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-lines-only',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-lines-only.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-multiple',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-multiple.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
- {
- name: 'chart-radar-radius',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radar-radius.tsx'],
- category: 'Charts',
- subcategory: 'Radar',
- },
-
- // Radial Charts
- {
- name: 'chart-radial-grid',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radial-grid.tsx'],
- category: 'Charts',
- subcategory: 'Radial',
- },
- {
- name: 'chart-radial-label',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radial-label.tsx'],
- category: 'Charts',
- subcategory: 'Radial',
- },
- {
- name: 'chart-radial-shape',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radial-shape.tsx'],
- category: 'Charts',
- subcategory: 'Radial',
- },
- {
- name: 'chart-radial-simple',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radial-simple.tsx'],
- category: 'Charts',
- subcategory: 'Radial',
- },
- {
- name: 'chart-radial-stacked',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radial-stacked.tsx'],
- category: 'Charts',
- subcategory: 'Radial',
- },
- {
- name: 'chart-radial-text',
- type: 'components:block',
- registryDependencies: ['card', 'chart'],
- files: ['block/chart-radial-text.tsx'],
+ registryDependencies: ['chart'],
+ files: ['block/chart-composed-actions.tsx'],
category: 'Charts',
- subcategory: 'Radial',
+ subcategory: 'Composed',
},
]
diff --git a/apps/design-system/registry/default/block/chart-area-axes.tsx b/apps/design-system/registry/default/block/chart-area-axes.tsx
deleted file mode 100644
index 26713267cbd..00000000000
--- a/apps/design-system/registry/default/block/chart-area-axes.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'An area chart with axes'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Axes</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: -20,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <YAxis tickLine={false} axisLine={false} tickMargin={8} tickCount={3} />
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-default.tsx b/apps/design-system/registry/default/block/chart-area-default.tsx
deleted file mode 100644
index 0ccfe016d7c..00000000000
--- a/apps/design-system/registry/default/block/chart-area-default.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A simple area chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-gradient.tsx b/apps/design-system/registry/default/block/chart-area-gradient.tsx
deleted file mode 100644
index d6e7ad9b621..00000000000
--- a/apps/design-system/registry/default/block/chart-area-gradient.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'An area chart with gradient fill'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Gradient</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <defs>
- <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
- </linearGradient>
- <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
- </linearGradient>
- </defs>
- <Area
- dataKey="mobile"
- type="natural"
- fill="url(#fillMobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="url(#fillDesktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-icons.tsx b/apps/design-system/registry/default/block/chart-area-icons.tsx
deleted file mode 100644
index bc9d0195253..00000000000
--- a/apps/design-system/registry/default/block/chart-area-icons.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-'use client'
-
-import { TrendingDown, TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'An area chart with icons'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- icon: TrendingDown,
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- icon: TrendingUp,
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Icons</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-interactive.tsx b/apps/design-system/registry/default/block/chart-area-interactive.tsx
deleted file mode 100644
index df2579fe8f8..00000000000
--- a/apps/design-system/registry/default/block/chart-area-interactive.tsx
+++ /dev/null
@@ -1,238 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-import {
- Select_Shadcn_,
- SelectContent_Shadcn_,
- SelectItem_Shadcn_,
- SelectTrigger_Shadcn_,
- SelectValue_Shadcn_,
-} from 'ui'
-
-export const description = 'An interactive area chart'
-
-const chartData = [
- { date: '2024-04-01', desktop: 222, mobile: 150 },
- { date: '2024-04-02', desktop: 97, mobile: 180 },
- { date: '2024-04-03', desktop: 167, mobile: 120 },
- { date: '2024-04-04', desktop: 242, mobile: 260 },
- { date: '2024-04-05', desktop: 373, mobile: 290 },
- { date: '2024-04-06', desktop: 301, mobile: 340 },
- { date: '2024-04-07', desktop: 245, mobile: 180 },
- { date: '2024-04-08', desktop: 409, mobile: 320 },
- { date: '2024-04-09', desktop: 59, mobile: 110 },
- { date: '2024-04-10', desktop: 261, mobile: 190 },
- { date: '2024-04-11', desktop: 327, mobile: 350 },
- { date: '2024-04-12', desktop: 292, mobile: 210 },
- { date: '2024-04-13', desktop: 342, mobile: 380 },
- { date: '2024-04-14', desktop: 137, mobile: 220 },
- { date: '2024-04-15', desktop: 120, mobile: 170 },
- { date: '2024-04-16', desktop: 138, mobile: 190 },
- { date: '2024-04-17', desktop: 446, mobile: 360 },
- { date: '2024-04-18', desktop: 364, mobile: 410 },
- { date: '2024-04-19', desktop: 243, mobile: 180 },
- { date: '2024-04-20', desktop: 89, mobile: 150 },
- { date: '2024-04-21', desktop: 137, mobile: 200 },
- { date: '2024-04-22', desktop: 224, mobile: 170 },
- { date: '2024-04-23', desktop: 138, mobile: 230 },
- { date: '2024-04-24', desktop: 387, mobile: 290 },
- { date: '2024-04-25', desktop: 215, mobile: 250 },
- { date: '2024-04-26', desktop: 75, mobile: 130 },
- { date: '2024-04-27', desktop: 383, mobile: 420 },
- { date: '2024-04-28', desktop: 122, mobile: 180 },
- { date: '2024-04-29', desktop: 315, mobile: 240 },
- { date: '2024-04-30', desktop: 454, mobile: 380 },
- { date: '2024-05-01', desktop: 165, mobile: 220 },
- { date: '2024-05-02', desktop: 293, mobile: 310 },
- { date: '2024-05-03', desktop: 247, mobile: 190 },
- { date: '2024-05-04', desktop: 385, mobile: 420 },
- { date: '2024-05-05', desktop: 481, mobile: 390 },
- { date: '2024-05-06', desktop: 498, mobile: 520 },
- { date: '2024-05-07', desktop: 388, mobile: 300 },
- { date: '2024-05-08', desktop: 149, mobile: 210 },
- { date: '2024-05-09', desktop: 227, mobile: 180 },
- { date: '2024-05-10', desktop: 293, mobile: 330 },
- { date: '2024-05-11', desktop: 335, mobile: 270 },
- { date: '2024-05-12', desktop: 197, mobile: 240 },
- { date: '2024-05-13', desktop: 197, mobile: 160 },
- { date: '2024-05-14', desktop: 448, mobile: 490 },
- { date: '2024-05-15', desktop: 473, mobile: 380 },
- { date: '2024-05-16', desktop: 338, mobile: 400 },
- { date: '2024-05-17', desktop: 499, mobile: 420 },
- { date: '2024-05-18', desktop: 315, mobile: 350 },
- { date: '2024-05-19', desktop: 235, mobile: 180 },
- { date: '2024-05-20', desktop: 177, mobile: 230 },
- { date: '2024-05-21', desktop: 82, mobile: 140 },
- { date: '2024-05-22', desktop: 81, mobile: 120 },
- { date: '2024-05-23', desktop: 252, mobile: 290 },
- { date: '2024-05-24', desktop: 294, mobile: 220 },
- { date: '2024-05-25', desktop: 201, mobile: 250 },
- { date: '2024-05-26', desktop: 213, mobile: 170 },
- { date: '2024-05-27', desktop: 420, mobile: 460 },
- { date: '2024-05-28', desktop: 233, mobile: 190 },
- { date: '2024-05-29', desktop: 78, mobile: 130 },
- { date: '2024-05-30', desktop: 340, mobile: 280 },
- { date: '2024-05-31', desktop: 178, mobile: 230 },
- { date: '2024-06-01', desktop: 178, mobile: 200 },
- { date: '2024-06-02', desktop: 470, mobile: 410 },
- { date: '2024-06-03', desktop: 103, mobile: 160 },
- { date: '2024-06-04', desktop: 439, mobile: 380 },
- { date: '2024-06-05', desktop: 88, mobile: 140 },
- { date: '2024-06-06', desktop: 294, mobile: 250 },
- { date: '2024-06-07', desktop: 323, mobile: 370 },
- { date: '2024-06-08', desktop: 385, mobile: 320 },
- { date: '2024-06-09', desktop: 438, mobile: 480 },
- { date: '2024-06-10', desktop: 155, mobile: 200 },
- { date: '2024-06-11', desktop: 92, mobile: 150 },
- { date: '2024-06-12', desktop: 492, mobile: 420 },
- { date: '2024-06-13', desktop: 81, mobile: 130 },
- { date: '2024-06-14', desktop: 426, mobile: 380 },
- { date: '2024-06-15', desktop: 307, mobile: 350 },
- { date: '2024-06-16', desktop: 371, mobile: 310 },
- { date: '2024-06-17', desktop: 475, mobile: 520 },
- { date: '2024-06-18', desktop: 107, mobile: 170 },
- { date: '2024-06-19', desktop: 341, mobile: 290 },
- { date: '2024-06-20', desktop: 408, mobile: 450 },
- { date: '2024-06-21', desktop: 169, mobile: 210 },
- { date: '2024-06-22', desktop: 317, mobile: 270 },
- { date: '2024-06-23', desktop: 480, mobile: 530 },
- { date: '2024-06-24', desktop: 132, mobile: 180 },
- { date: '2024-06-25', desktop: 141, mobile: 190 },
- { date: '2024-06-26', desktop: 434, mobile: 380 },
- { date: '2024-06-27', desktop: 448, mobile: 490 },
- { date: '2024-06-28', desktop: 149, mobile: 200 },
- { date: '2024-06-29', desktop: 103, mobile: 160 },
- { date: '2024-06-30', desktop: 446, mobile: 400 },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const [timeRange, setTimeRange] = React.useState('90d')
-
- const filteredData = chartData.filter((item) => {
- const date = new Date(item.date)
- const now = new Date()
- let daysToSubtract = 90
- if (timeRange === '30d') {
- daysToSubtract = 30
- } else if (timeRange === '7d') {
- daysToSubtract = 7
- }
- now.setDate(now.getDate() - daysToSubtract)
- return date >= now
- })
-
- return (
- <Card>
- <CardHeader className="flex items-center gap-2 space-y-0 border-b py-5 sm:flex-row">
- <div className="grid flex-1 gap-1 text-center sm:text-left">
- <CardTitle>Area Chart - Interactive</CardTitle>
- <CardDescription>Showing total visitors for the last 3 months</CardDescription>
- </div>
- <Select_Shadcn_ value={timeRange} onValueChange={setTimeRange}>
- <SelectTrigger_Shadcn_
- className="w-[160px] rounded-lg sm:ml-auto"
- aria-label="Select a value"
- >
- <SelectValue_Shadcn_ placeholder="Last 3 months" />
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_ className="rounded-xl">
- <SelectItem_Shadcn_ value="90d" className="rounded-lg">
- Last 3 months
- </SelectItem_Shadcn_>
- <SelectItem_Shadcn_ value="30d" className="rounded-lg">
- Last 30 days
- </SelectItem_Shadcn_>
- <SelectItem_Shadcn_ value="7d" className="rounded-lg">
- Last 7 days
- </SelectItem_Shadcn_>
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- </CardHeader>
- <CardContent className="px-2 pt-4 sm:px-6 sm:pt-6">
- <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
- <AreaChart data={filteredData}>
- <defs>
- <linearGradient id="fillDesktop" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-desktop)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-desktop)" stopOpacity={0.1} />
- </linearGradient>
- <linearGradient id="fillMobile" x1="0" y1="0" x2="0" y2="1">
- <stop offset="5%" stopColor="var(--color-mobile)" stopOpacity={0.8} />
- <stop offset="95%" stopColor="var(--color-mobile)" stopOpacity={0.1} />
- </linearGradient>
- </defs>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="date"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- minTickGap={32}
- tickFormatter={(value) => {
- const date = new Date(value)
- return date.toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- })
- }}
- />
- <ChartTooltip
- cursor={false}
- content={
- <ChartTooltipContent
- labelFormatter={(value) => {
- return new Date(value).toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- })
- }}
- indicator="dot"
- />
- }
- />
- <Area
- dataKey="mobile"
- type="natural"
- fill="url(#fillMobile)"
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="url(#fillDesktop)"
- stroke="var(--color-desktop)"
- stackId="a"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-legend.tsx b/apps/design-system/registry/default/block/chart-area-legend.tsx
deleted file mode 100644
index a58cfa9fbd9..00000000000
--- a/apps/design-system/registry/default/block/chart-area-legend.tsx
+++ /dev/null
@@ -1,98 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'An area chart with a legend'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Legend</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-linear.tsx b/apps/design-system/registry/default/block/chart-area-linear.tsx
deleted file mode 100644
index 8381711c7aa..00000000000
--- a/apps/design-system/registry/default/block/chart-area-linear.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A linear area chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Linear</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="dot" hideLabel />}
- />
- <Area
- dataKey="desktop"
- type="linear"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-stacked-expand.tsx b/apps/design-system/registry/default/block/chart-area-stacked-expand.tsx
deleted file mode 100644
index eca0b1118f7..00000000000
--- a/apps/design-system/registry/default/block/chart-area-stacked-expand.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A stacked area chart with expand stacking'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80, other: 45 },
- { month: 'February', desktop: 305, mobile: 200, other: 100 },
- { month: 'March', desktop: 237, mobile: 120, other: 150 },
- { month: 'April', desktop: 73, mobile: 190, other: 50 },
- { month: 'May', desktop: 209, mobile: 130, other: 100 },
- { month: 'June', desktop: 214, mobile: 140, other: 160 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-3))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Stacked Expanded</CardTitle>
- <CardDescription>Showing total visitors for the last 6months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- top: 12,
- }}
- stackOffset="expand"
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Area
- dataKey="other"
- type="natural"
- fill="var(--color-other)"
- fillOpacity={0.1}
- stroke="var(--color-other)"
- stackId="a"
- />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-stacked.tsx b/apps/design-system/registry/default/block/chart-area-stacked.tsx
deleted file mode 100644
index 22c0f58558b..00000000000
--- a/apps/design-system/registry/default/block/chart-area-stacked.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A stacked area chart'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Stacked</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dot" />} />
- <Area
- dataKey="mobile"
- type="natural"
- fill="var(--color-mobile)"
- fillOpacity={0.4}
- stroke="var(--color-mobile)"
- stackId="a"
- />
- <Area
- dataKey="desktop"
- type="natural"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- stackId="a"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-area-step.tsx b/apps/design-system/registry/default/block/chart-area-step.tsx
deleted file mode 100644
index 5ac732aeaf4..00000000000
--- a/apps/design-system/registry/default/block/chart-area-step.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-'use client'
-
-import { Activity, TrendingUp } from 'lucide-react'
-import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A step area chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- icon: Activity,
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Area Chart - Step</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <AreaChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Area
- dataKey="desktop"
- type="step"
- fill="var(--color-desktop)"
- fillOpacity={0.4}
- stroke="var(--color-desktop)"
- />
- </AreaChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-active.tsx b/apps/design-system/registry/default/block/chart-bar-active.tsx
deleted file mode 100644
index b1ab1d95e1a..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-active.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, Rectangle, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with an active bar'
-
-const chartData = [
- { browser: 'chrome', visitors: 187, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 275, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Active</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="browser"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar
- dataKey="visitors"
- strokeWidth={2}
- radius={8}
- activeIndex={2}
- activeBar={({ ...props }) => {
- return (
- <Rectangle
- {...props}
- fillOpacity={0.8}
- stroke={props.payload.fill}
- strokeDasharray={4}
- strokeDashoffset={4}
- />
- )
- }}
- />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-default.tsx b/apps/design-system/registry/default/block/chart-bar-default.tsx
deleted file mode 100644
index 1c0596e3b57..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-default.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-horizontal.tsx b/apps/design-system/registry/default/block/chart-bar-horizontal.tsx
deleted file mode 100644
index 2305d0a4e1c..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-horizontal.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A horizontal bar chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Horizontal</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- layout="vertical"
- margin={{
- left: -20,
- }}
- >
- <XAxis type="number" dataKey="desktop" hide />
- <YAxis
- dataKey="month"
- type="category"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={5} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-label-custom.tsx b/apps/design-system/registry/default/block/chart-bar-label-custom.tsx
deleted file mode 100644
index 7867342bc6d..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-label-custom.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with a custom label'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
- label: {
- color: 'hsl(var(--background))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Custom Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- layout="vertical"
- margin={{
- right: 16,
- }}
- >
- <CartesianGrid horizontal={false} />
- <YAxis
- dataKey="month"
- type="category"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- hide
- />
- <XAxis dataKey="desktop" type="number" hide />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Bar dataKey="desktop" layout="vertical" fill="var(--color-desktop)" radius={4}>
- <LabelList
- dataKey="month"
- position="insideLeft"
- offset={8}
- className="fill-[--color-label]"
- fontSize={12}
- />
- <LabelList
- dataKey="desktop"
- position="right"
- offset={8}
- className="fill-foreground"
- fontSize={12}
- />
- </Bar>
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-label.tsx b/apps/design-system/registry/default/block/chart-bar-label.tsx
deleted file mode 100644
index 3bbdcc7a7ea..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-label.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, LabelList, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with a label'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 20,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={8}>
- <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
- </Bar>
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-mixed.tsx b/apps/design-system/registry/default/block/chart-bar-mixed.tsx
deleted file mode 100644
index 1790507f73f..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-mixed.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, XAxis, YAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A mixed bar chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Mixed</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart
- accessibilityLayer
- data={chartData}
- layout="vertical"
- margin={{
- left: 0,
- }}
- >
- <YAxis
- dataKey="browser"
- type="category"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => chartConfig[value as keyof typeof chartConfig]?.label}
- />
- <XAxis dataKey="visitors" type="number" hide />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Bar dataKey="visitors" layout="vertical" radius={5} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-multiple.tsx b/apps/design-system/registry/default/block/chart-bar-multiple.tsx
deleted file mode 100644
index ffb9c61679a..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-multiple.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A multiple bar chart'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Multiple</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="dashed" />} />
- <Bar dataKey="desktop" fill="var(--color-desktop)" radius={4} />
- <Bar dataKey="mobile" fill="var(--color-mobile)" radius={4} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-negative.tsx b/apps/design-system/registry/default/block/chart-bar-negative.tsx
deleted file mode 100644
index 43f87ef0762..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-negative.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, Cell, LabelList } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A bar chart with negative values'
-
-const chartData = [
- { month: 'January', visitors: 186 },
- { month: 'February', visitors: 205 },
- { month: 'March', visitors: -207 },
- { month: 'April', visitors: 173 },
- { month: 'May', visitors: -209 },
- { month: 'June', visitors: 214 },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Negative</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel hideIndicator />}
- />
- <Bar dataKey="visitors">
- <LabelList position="top" dataKey="month" fillOpacity={1} />
- {chartData.map((item) => (
- <Cell
- key={item.month}
- fill={item.visitors > 0 ? 'hsl(var(--chart-1))' : 'hsl(var(--chart-2))'}
- />
- ))}
- </Bar>
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-bar-stacked.tsx b/apps/design-system/registry/default/block/chart-bar-stacked.tsx
deleted file mode 100644
index 34a7439e982..00000000000
--- a/apps/design-system/registry/default/block/chart-bar-stacked.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Bar, BarChart, CartesianGrid, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'A stacked bar chart with a legend'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Bar Chart - Stacked + Legend</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <BarChart accessibilityLayer data={chartData}>
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- tickMargin={10}
- axisLine={false}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
- <ChartLegend content={<ChartLegendContent />} />
- <Bar dataKey="desktop" stackId="a" fill="var(--color-desktop)" radius={[0, 0, 4, 4]} />
- <Bar dataKey="mobile" stackId="a" fill="var(--color-mobile)" radius={[4, 4, 0, 0]} />
- </BarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-composed-actions.tsx b/apps/design-system/registry/default/block/chart-composed-actions.tsx
new file mode 100644
index 00000000000..f6eac7312b2
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-composed-actions.tsx
@@ -0,0 +1,106 @@
+'use client'
+
+import {
+ Chart,
+ ChartActions,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartTitle,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartBar,
+ ChartLine,
+} from 'ui-patterns/Chart'
+import { BarChart2, ExternalLink, LineChart } from 'lucide-react'
+import { useState, useEffect } from 'react'
+
+export default function ChartComposedActions() {
+ const [isLoading, setIsLoading] = useState(true)
+ const [chartType, setChartType] = useState<'bar' | 'line'>('bar')
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Opening in Logs Explorer...')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ {
+ label: 'Toggle Chart Type',
+ onClick: () => {
+ setChartType(chartType === 'bar' ? 'line' : 'bar')
+ },
+ icon: chartType === 'bar' ? <LineChart size={12} /> : <BarChart2 size={12} />,
+ },
+ ]
+
+ const data = Array.from({ length: 46 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ requests: Math.floor(Math.random() * 100),
+ }
+ }).reverse()
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Total Requests</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ {chartType === 'bar' ? (
+ <ChartBar
+ data={data}
+ dataKey="requests"
+ showGrid={false}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ ) : (
+ <ChartLine
+ data={data}
+ dataKey="requests"
+ showGrid={true}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ )}
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-composed-basic.tsx b/apps/design-system/registry/default/block/chart-composed-basic.tsx
new file mode 100644
index 00000000000..99778d63f43
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-composed-basic.tsx
@@ -0,0 +1,122 @@
+'use client'
+
+import {
+ Chart,
+ ChartActions,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartTitle,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartBar,
+ ChartLine,
+} from 'ui-patterns/Chart'
+import { BarChart2, ExternalLink } from 'lucide-react'
+import { useState, useEffect } from 'react'
+
+export default function ComposedChartBasic() {
+ const [isLoading, setIsLoading] = useState(true)
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Ta da! You clicked me! 🎉')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ const data = Array.from({ length: 46 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ standard_score: Math.floor(Math.random() * 100),
+ }
+ }).reverse()
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Standard Bar Chart</ChartTitle>
+
+ <ChartActions actions={actions} />
+ </ChartHeader>
+
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <ChartBar
+ data={data}
+ dataKey="standard_score"
+ showGrid={false}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Standard Line Chart</ChartTitle>
+
+ <ChartActions actions={actions} />
+ </ChartHeader>
+
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <ChartLine
+ data={data}
+ dataKey="standard_score"
+ showGrid={true}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-composed-demo.tsx b/apps/design-system/registry/default/block/chart-composed-demo.tsx
new file mode 100644
index 00000000000..c734900d395
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-composed-demo.tsx
@@ -0,0 +1,73 @@
+'use client'
+
+import {
+ Chart,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartMetric,
+} from 'ui-patterns/Chart'
+import { BarChart2 } from 'lucide-react'
+import { LogsBarChart } from 'ui-patterns/LogsBarChart'
+import { useState, useEffect } from 'react'
+
+export default function ComposedChartDemo() {
+ const [isLoading, setIsLoading] = useState(true)
+
+ const data = Array.from({ length: 60 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ ok_count: Math.floor(Math.random() * 100), // Random value 0-99
+ error_count: Math.floor(Math.random() * 50), // Random value 0-50
+ warning_count: Math.floor(Math.random() * 50), // Random value 0-50
+ }
+ }).reverse()
+
+ const totalUsersValue = 4663
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartMetric
+ label="Total Users"
+ value={totalUsersValue.toLocaleString('en-US')}
+ tooltip="This is a tooltip"
+ />
+ <div className="flex items-center gap-6">
+ <ChartMetric label="Warn" value="1.2k" status="warning" align="end" />
+ <ChartMetric label="Err" value="736" status="negative" align="end" />
+ </div>
+ </ChartHeader>
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <LogsBarChart data={data} isFullHeight={true} />
+ </div>
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-composed-metrics.tsx b/apps/design-system/registry/default/block/chart-composed-metrics.tsx
new file mode 100644
index 00000000000..0c876d7e589
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-composed-metrics.tsx
@@ -0,0 +1,100 @@
+'use client'
+
+import {
+ Chart,
+ ChartCard,
+ ChartHeader,
+ ChartActions,
+ ChartContent,
+ ChartMetric,
+ ChartSparkline,
+} from 'ui-patterns/Chart'
+import { ExternalLink } from 'lucide-react'
+import { useState, useEffect } from 'react'
+import { Skeleton } from 'ui'
+
+export default function ChartComposedMetrics() {
+ const [data, setData] = useState<Array<{ value: number; timestamp: string }>>([])
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Ta da! You clicked me! 🎉')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ useEffect(() => {
+ const now = new Date()
+ setData(
+ Array.from({ length: 12 }, (_, i) => ({
+ value: Math.floor(4000 + i * 100 + (Math.random() * 2000 - 800)),
+ timestamp: new Date(now.getTime() - (11 - i) * 60 * 60 * 1000).toISOString(),
+ }))
+ )
+ }, [])
+
+ const averageValue = data.reduce((acc, curr) => acc + curr.value, 0) / data.length
+
+ const diff = data[data.length - 1]?.value - data[0]?.value || 0
+ const diffPercentage = (diff / averageValue) * 100
+
+ return (
+ <div className="grid grid-cols-2 gap-6 w-full">
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader className="pb-4" align="start">
+ <ChartMetric label="Slow Queries" value={0} />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ </ChartCard>
+ </Chart>
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader className="pb-4" align="start">
+ <ChartMetric label="Sign Ups" value={127} />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ </ChartCard>
+ </Chart>
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader align="start">
+ <ChartMetric
+ label="Active Users"
+ value={averageValue.toLocaleString(undefined, { maximumFractionDigits: 0 })}
+ diffValue={diffPercentage.toFixed(2) + '%'}
+ />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ className="p-0"
+ loadingState={<Skeleton className="w-full h-[6rem] rounded-none mt-4" />}
+ >
+ <ChartSparkline data={data} dataKey="value" />
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ <Chart isLoading={!data.length}>
+ <ChartCard>
+ <ChartHeader align="start">
+ <ChartMetric
+ label="Active Users"
+ value={averageValue.toLocaleString(undefined, { maximumFractionDigits: 0 })}
+ diffValue={diffPercentage.toFixed(2) + '%'}
+ />
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ className="p-0"
+ loadingState={<Skeleton className="w-full h-[6rem] rounded-none mt-4" />}
+ >
+ <ChartSparkline data={data} dataKey="value" />
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-composed-states.tsx b/apps/design-system/registry/default/block/chart-composed-states.tsx
new file mode 100644
index 00000000000..4e5aa5d8bd5
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-composed-states.tsx
@@ -0,0 +1,92 @@
+'use client'
+
+import { BarChart2, ExternalLink } from 'lucide-react'
+import {
+ Chart,
+ ChartCard,
+ ChartHeader,
+ ChartTitle,
+ ChartActions,
+ ChartContent,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartDisabledState,
+} from 'ui-patterns/Chart'
+import { Badge } from 'ui'
+
+export default function ChartComposedStates() {
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Ta da! You clicked me! 🎉')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ const disabledActions = [
+ {
+ label: 'Upgrade to Pro',
+ href: '#',
+ },
+ ]
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={true}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Response Errors</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent loadingState={<ChartLoadingState />}>My chart here...</ChartContent>
+ </ChartCard>
+ </Chart>
+
+ <Chart>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Response Errors</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ isEmpty={true}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={20} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ My chart here...
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+
+ <Chart isDisabled={true}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Response Errors</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ loadingState={<ChartLoadingState />}
+ disabledState={
+ <ChartDisabledState
+ icon={<Badge variant="success">Pro</Badge>}
+ label="API Processing Time"
+ description="This chart is available on the Pro plan and above"
+ actions={disabledActions}
+ />
+ }
+ >
+ My chart here...
+ </ChartContent>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-composed-table.tsx b/apps/design-system/registry/default/block/chart-composed-table.tsx
new file mode 100644
index 00000000000..303114447e9
--- /dev/null
+++ b/apps/design-system/registry/default/block/chart-composed-table.tsx
@@ -0,0 +1,106 @@
+'use client'
+
+import {
+ Chart,
+ ChartActions,
+ ChartCard,
+ ChartContent,
+ ChartHeader,
+ ChartTitle,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartBar,
+ ChartFooter,
+} from 'ui-patterns/Chart'
+import { BarChart2, ExternalLink } from 'lucide-react'
+import { useState, useEffect } from 'react'
+import { Table, TableHead, TableBody, TableRow, TableCell, TableHeader } from 'ui'
+import { format } from 'date-fns'
+
+export default function ChartComposedTable() {
+ const [isLoading, setIsLoading] = useState(true)
+
+ const actions = [
+ {
+ label: 'Open in Logs Explorer',
+ onClick: () => {
+ alert('Opening in Logs Explorer...')
+ },
+ icon: <ExternalLink size={12} />,
+ },
+ ]
+
+ const data = Array.from({ length: 46 }, (_, i) => {
+ const date = new Date()
+ date.setMinutes(date.getMinutes() - i * 5) // Each point 5 minutes apart
+
+ return {
+ timestamp: date.toISOString(),
+ standard_score: Math.floor(Math.random() * 100),
+ }
+ }).reverse()
+
+ useEffect(() => {
+ setTimeout(() => {
+ setIsLoading(false)
+ }, 1000)
+ }, [])
+
+ return (
+ <div className="flex flex-col gap-6 w-8/12">
+ <Chart isLoading={isLoading}>
+ <ChartCard>
+ <ChartHeader>
+ <ChartTitle tooltip="This is a tooltip">Standard Bar Chart</ChartTitle>
+ <ChartActions actions={actions} />
+ </ChartHeader>
+ <ChartContent
+ isEmpty={data.length === 0}
+ emptyState={
+ <ChartEmptyState
+ icon={<BarChart2 size={16} />}
+ title="No data to show"
+ description="It may take up to 24 hours for data to refresh"
+ />
+ }
+ loadingState={<ChartLoadingState />}
+ >
+ <div className="h-40">
+ <ChartBar
+ data={data}
+ dataKey="standard_score"
+ showGrid={false}
+ showYAxis={true}
+ YAxisProps={{
+ tickFormatter: (value) => `${value}k`,
+ width: 80,
+ }}
+ isFullHeight={true}
+ />
+ </div>
+ </ChartContent>
+ <ChartFooter>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>Timestamp</TableHead>
+ <TableHead className="text-right">Standard Score</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {data.slice(0, 3).map((item) => (
+ <TableRow key={item.timestamp}>
+ <TableCell className="text-foreground-light">
+ {format(new Date(item.timestamp), 'MMM d, yyyy h:mm a')}
+ </TableCell>
+ <TableCell className="text-right tabular-nums">{item.standard_score}</TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ </ChartFooter>
+ </ChartCard>
+ </Chart>
+ </div>
+ )
+}
diff --git a/apps/design-system/registry/default/block/chart-line-default.tsx b/apps/design-system/registry/default/block/chart-line-default.tsx
deleted file mode 100644
index 408dc1d6f9f..00000000000
--- a/apps/design-system/registry/default/block/chart-line-default.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-dots-colors.tsx b/apps/design-system/registry/default/block/chart-line-dots-colors.tsx
deleted file mode 100644
index c8a55a0c44b..00000000000
--- a/apps/design-system/registry/default/block/chart-line-dots-colors.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Dot, Line, LineChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with dots and colors'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- color: 'hsl(var(--chart-2))',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Dots Colors</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 24,
- left: 24,
- right: 24,
- }}
- >
- <CartesianGrid vertical={false} />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
- />
- <Line
- dataKey="visitors"
- type="natural"
- stroke="var(--color-visitors)"
- strokeWidth={2}
- dot={({ payload, ...props }) => {
- return (
- <Dot
- key={payload.browser}
- r={5}
- cx={props.cx}
- cy={props.cy}
- fill={payload.fill}
- stroke={payload.fill}
- />
- )
- }}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-dots-custom.tsx b/apps/design-system/registry/default/block/chart-line-dots-custom.tsx
deleted file mode 100644
index 87c69309319..00000000000
--- a/apps/design-system/registry/default/block/chart-line-dots-custom.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-'use client'
-
-import { GitCommitVertical, TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with custom dots'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Custom Dots</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={({ cx, cy, payload }) => {
- const r = 24
- return (
- <GitCommitVertical
- key={payload.month}
- x={cx - r / 2}
- y={cy - r / 2}
- width={r}
- height={r}
- fill="hsl(var(--background))"
- stroke="var(--color-desktop)"
- />
- )
- }}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-dots.tsx b/apps/design-system/registry/default/block/chart-line-dots.tsx
deleted file mode 100644
index cc211f2c2b4..00000000000
--- a/apps/design-system/registry/default/block/chart-line-dots.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with dots'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Dots</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={{
- fill: 'var(--color-desktop)',
- }}
- activeDot={{
- r: 6,
- }}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-interactive.tsx b/apps/design-system/registry/default/block/chart-line-interactive.tsx
deleted file mode 100644
index 5f9c92b9792..00000000000
--- a/apps/design-system/registry/default/block/chart-line-interactive.tsx
+++ /dev/null
@@ -1,208 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'An interactive line chart'
-
-const chartData = [
- { date: '2024-04-01', desktop: 222, mobile: 150 },
- { date: '2024-04-02', desktop: 97, mobile: 180 },
- { date: '2024-04-03', desktop: 167, mobile: 120 },
- { date: '2024-04-04', desktop: 242, mobile: 260 },
- { date: '2024-04-05', desktop: 373, mobile: 290 },
- { date: '2024-04-06', desktop: 301, mobile: 340 },
- { date: '2024-04-07', desktop: 245, mobile: 180 },
- { date: '2024-04-08', desktop: 409, mobile: 320 },
- { date: '2024-04-09', desktop: 59, mobile: 110 },
- { date: '2024-04-10', desktop: 261, mobile: 190 },
- { date: '2024-04-11', desktop: 327, mobile: 350 },
- { date: '2024-04-12', desktop: 292, mobile: 210 },
- { date: '2024-04-13', desktop: 342, mobile: 380 },
- { date: '2024-04-14', desktop: 137, mobile: 220 },
- { date: '2024-04-15', desktop: 120, mobile: 170 },
- { date: '2024-04-16', desktop: 138, mobile: 190 },
- { date: '2024-04-17', desktop: 446, mobile: 360 },
- { date: '2024-04-18', desktop: 364, mobile: 410 },
- { date: '2024-04-19', desktop: 243, mobile: 180 },
- { date: '2024-04-20', desktop: 89, mobile: 150 },
- { date: '2024-04-21', desktop: 137, mobile: 200 },
- { date: '2024-04-22', desktop: 224, mobile: 170 },
- { date: '2024-04-23', desktop: 138, mobile: 230 },
- { date: '2024-04-24', desktop: 387, mobile: 290 },
- { date: '2024-04-25', desktop: 215, mobile: 250 },
- { date: '2024-04-26', desktop: 75, mobile: 130 },
- { date: '2024-04-27', desktop: 383, mobile: 420 },
- { date: '2024-04-28', desktop: 122, mobile: 180 },
- { date: '2024-04-29', desktop: 315, mobile: 240 },
- { date: '2024-04-30', desktop: 454, mobile: 380 },
- { date: '2024-05-01', desktop: 165, mobile: 220 },
- { date: '2024-05-02', desktop: 293, mobile: 310 },
- { date: '2024-05-03', desktop: 247, mobile: 190 },
- { date: '2024-05-04', desktop: 385, mobile: 420 },
- { date: '2024-05-05', desktop: 481, mobile: 390 },
- { date: '2024-05-06', desktop: 498, mobile: 520 },
- { date: '2024-05-07', desktop: 388, mobile: 300 },
- { date: '2024-05-08', desktop: 149, mobile: 210 },
- { date: '2024-05-09', desktop: 227, mobile: 180 },
- { date: '2024-05-10', desktop: 293, mobile: 330 },
- { date: '2024-05-11', desktop: 335, mobile: 270 },
- { date: '2024-05-12', desktop: 197, mobile: 240 },
- { date: '2024-05-13', desktop: 197, mobile: 160 },
- { date: '2024-05-14', desktop: 448, mobile: 490 },
- { date: '2024-05-15', desktop: 473, mobile: 380 },
- { date: '2024-05-16', desktop: 338, mobile: 400 },
- { date: '2024-05-17', desktop: 499, mobile: 420 },
- { date: '2024-05-18', desktop: 315, mobile: 350 },
- { date: '2024-05-19', desktop: 235, mobile: 180 },
- { date: '2024-05-20', desktop: 177, mobile: 230 },
- { date: '2024-05-21', desktop: 82, mobile: 140 },
- { date: '2024-05-22', desktop: 81, mobile: 120 },
- { date: '2024-05-23', desktop: 252, mobile: 290 },
- { date: '2024-05-24', desktop: 294, mobile: 220 },
- { date: '2024-05-25', desktop: 201, mobile: 250 },
- { date: '2024-05-26', desktop: 213, mobile: 170 },
- { date: '2024-05-27', desktop: 420, mobile: 460 },
- { date: '2024-05-28', desktop: 233, mobile: 190 },
- { date: '2024-05-29', desktop: 78, mobile: 130 },
- { date: '2024-05-30', desktop: 340, mobile: 280 },
- { date: '2024-05-31', desktop: 178, mobile: 230 },
- { date: '2024-06-01', desktop: 178, mobile: 200 },
- { date: '2024-06-02', desktop: 470, mobile: 410 },
- { date: '2024-06-03', desktop: 103, mobile: 160 },
- { date: '2024-06-04', desktop: 439, mobile: 380 },
- { date: '2024-06-05', desktop: 88, mobile: 140 },
- { date: '2024-06-06', desktop: 294, mobile: 250 },
- { date: '2024-06-07', desktop: 323, mobile: 370 },
- { date: '2024-06-08', desktop: 385, mobile: 320 },
- { date: '2024-06-09', desktop: 438, mobile: 480 },
- { date: '2024-06-10', desktop: 155, mobile: 200 },
- { date: '2024-06-11', desktop: 92, mobile: 150 },
- { date: '2024-06-12', desktop: 492, mobile: 420 },
- { date: '2024-06-13', desktop: 81, mobile: 130 },
- { date: '2024-06-14', desktop: 426, mobile: 380 },
- { date: '2024-06-15', desktop: 307, mobile: 350 },
- { date: '2024-06-16', desktop: 371, mobile: 310 },
- { date: '2024-06-17', desktop: 475, mobile: 520 },
- { date: '2024-06-18', desktop: 107, mobile: 170 },
- { date: '2024-06-19', desktop: 341, mobile: 290 },
- { date: '2024-06-20', desktop: 408, mobile: 450 },
- { date: '2024-06-21', desktop: 169, mobile: 210 },
- { date: '2024-06-22', desktop: 317, mobile: 270 },
- { date: '2024-06-23', desktop: 480, mobile: 530 },
- { date: '2024-06-24', desktop: 132, mobile: 180 },
- { date: '2024-06-25', desktop: 141, mobile: 190 },
- { date: '2024-06-26', desktop: 434, mobile: 380 },
- { date: '2024-06-27', desktop: 448, mobile: 490 },
- { date: '2024-06-28', desktop: 149, mobile: 200 },
- { date: '2024-06-29', desktop: 103, mobile: 160 },
- { date: '2024-06-30', desktop: 446, mobile: 400 },
-]
-
-const chartConfig = {
- views: {
- label: 'Page Views',
- },
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const [activeChart, setActiveChart] = React.useState<keyof typeof chartConfig>('desktop')
-
- const total = React.useMemo(
- () => ({
- desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),
- mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),
- }),
- []
- )
-
- return (
- <Card>
- <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
- <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
- <CardTitle>Line Chart - Interactive</CardTitle>
- <CardDescription>Showing total visitors for the last 3 months</CardDescription>
- </div>
- <div className="flex">
- {['desktop', 'mobile'].map((key) => {
- const chart = key as keyof typeof chartConfig
- return (
- <button
- key={chart}
- data-active={activeChart === chart}
- className="flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-muted/50 sm:border-l sm:border-t-0 sm:px-8 sm:py-6"
- onClick={() => setActiveChart(chart)}
- >
- <span className="text-xs text-muted-foreground">{chartConfig[chart].label}</span>
- <span className="text-lg font-bold leading-none sm:text-3xl">
- {total[key as keyof typeof total].toLocaleString()}
- </span>
- </button>
- )
- })}
- </div>
- </CardHeader>
- <CardContent className="px-2 sm:p-6">
- <ChartContainer config={chartConfig} className="aspect-auto h-[250px] w-full">
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="date"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- minTickGap={32}
- tickFormatter={(value) => {
- const date = new Date(value)
- return date.toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- })
- }}
- />
- <ChartTooltip
- content={
- <ChartTooltipContent
- className="w-[150px]"
- nameKey="views"
- labelFormatter={(value) => {
- return new Date(value).toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- })
- }}
- />
- }
- />
- <Line
- dataKey={activeChart}
- type="monotone"
- stroke={`var(--color-${activeChart})`}
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-label-custom.tsx b/apps/design-system/registry/default/block/chart-line-label-custom.tsx
deleted file mode 100644
index 3d84fec03a3..00000000000
--- a/apps/design-system/registry/default/block/chart-line-label-custom.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, LabelList, Line, LineChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with a custom label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- color: 'hsl(var(--chart-2))',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Custom Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 24,
- left: 24,
- right: 24,
- }}
- >
- <CartesianGrid vertical={false} />
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="line" nameKey="visitors" hideLabel />}
- />
- <Line
- dataKey="visitors"
- type="natural"
- stroke="var(--color-visitors)"
- strokeWidth={2}
- dot={{
- fill: 'var(--color-visitors)',
- }}
- activeDot={{
- r: 6,
- }}
- >
- <LabelList
- position="top"
- offset={12}
- className="fill-foreground"
- fontSize={12}
- dataKey="browser"
- formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
- />
- </Line>
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-label.tsx b/apps/design-system/registry/default/block/chart-line-label.tsx
deleted file mode 100644
index 2c187e95961..00000000000
--- a/apps/design-system/registry/default/block/chart-line-label.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, LabelList, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with a label'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- top: 20,
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <Line
- dataKey="desktop"
- type="natural"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={{
- fill: 'var(--color-desktop)',
- }}
- activeDot={{
- r: 6,
- }}
- >
- <LabelList position="top" offset={12} className="fill-foreground" fontSize={12} />
- </Line>
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-linear.tsx b/apps/design-system/registry/default/block/chart-line-linear.tsx
deleted file mode 100644
index 9219a3c9de4..00000000000
--- a/apps/design-system/registry/default/block/chart-line-linear.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A linear line chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Linear</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="linear"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-multiple.tsx b/apps/design-system/registry/default/block/chart-line-multiple.tsx
deleted file mode 100644
index f09714a2737..00000000000
--- a/apps/design-system/registry/default/block/chart-line-multiple.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A multiple line chart'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Multiple</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <Line
- dataKey="desktop"
- type="monotone"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- <Line
- dataKey="mobile"
- type="monotone"
- stroke="var(--color-mobile)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter>
- <div className="flex w-full items-start gap-2 text-sm">
- <div className="grid gap-2">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </div>
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-line-step.tsx b/apps/design-system/registry/default/block/chart-line-step.tsx
deleted file mode 100644
index 0ab71e07d09..00000000000
--- a/apps/design-system/registry/default/block/chart-line-step.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { CartesianGrid, Line, LineChart, XAxis } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A line chart with step'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 73 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader>
- <CardTitle>Line Chart - Step</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig}>
- <LineChart
- accessibilityLayer
- data={chartData}
- margin={{
- left: 12,
- right: 12,
- }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- dataKey="month"
- tickLine={false}
- axisLine={false}
- tickMargin={8}
- tickFormatter={(value) => value.slice(0, 3)}
- />
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Line
- dataKey="desktop"
- type="step"
- stroke="var(--color-desktop)"
- strokeWidth={2}
- dot={false}
- />
- </LineChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col items-start gap-2 text-sm">
- <div className="flex gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-donut-active.tsx b/apps/design-system/registry/default/block/chart-pie-donut-active.tsx
deleted file mode 100644
index 2490b50f65f..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-donut-active.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, Pie, PieChart, Sector } from 'recharts'
-import { PieSectorDataItem } from 'recharts/types/polar/Pie'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A donut chart with an active sector'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Donut Active</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie
- data={chartData}
- dataKey="visitors"
- nameKey="browser"
- innerRadius={60}
- strokeWidth={5}
- activeIndex={0}
- activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
- <Sector {...props} outerRadius={outerRadius + 10} />
- )}
- />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-donut-text.tsx b/apps/design-system/registry/default/block/chart-pie-donut-text.tsx
deleted file mode 100644
index cba1eee8492..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-donut-text.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { TrendingUp } from 'lucide-react'
-import { Label, Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A donut chart with text'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 287, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 190, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const totalVisitors = React.useMemo(() => {
- return chartData.reduce((acc, curr) => acc + curr.visitors, 0)
- }, [])
-
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Donut with Text</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie
- data={chartData}
- dataKey="visitors"
- nameKey="browser"
- innerRadius={60}
- strokeWidth={5}
- >
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-3xl font-bold"
- >
- {totalVisitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </Pie>
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-donut.tsx b/apps/design-system/registry/default/block/chart-pie-donut.tsx
deleted file mode 100644
index 328fbd4b48a..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-donut.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A donut chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Donut</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" nameKey="browser" innerRadius={60} />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-interactive.tsx b/apps/design-system/registry/default/block/chart-pie-interactive.tsx
deleted file mode 100644
index be05cbf8e41..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-interactive.tsx
+++ /dev/null
@@ -1,170 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { Label, Pie, PieChart, Sector } from 'recharts'
-import { PieSectorDataItem } from 'recharts/types/polar/Pie'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartStyle, ChartTooltip, ChartTooltipContent } from 'ui'
-import {
- Select_Shadcn_,
- SelectContent_Shadcn_,
- SelectItem_Shadcn_,
- SelectTrigger_Shadcn_,
- SelectValue_Shadcn_,
-} from 'ui'
-
-export const description = 'An interactive pie chart'
-
-const desktopData = [
- { month: 'january', desktop: 186, fill: 'var(--color-january)' },
- { month: 'february', desktop: 305, fill: 'var(--color-february)' },
- { month: 'march', desktop: 237, fill: 'var(--color-march)' },
- { month: 'april', desktop: 173, fill: 'var(--color-april)' },
- { month: 'may', desktop: 209, fill: 'var(--color-may)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- desktop: {
- label: 'Desktop',
- },
- mobile: {
- label: 'Mobile',
- },
- january: {
- label: 'January',
- color: 'hsl(var(--chart-1))',
- },
- february: {
- label: 'February',
- color: 'hsl(var(--chart-2))',
- },
- march: {
- label: 'March',
- color: 'hsl(var(--chart-3))',
- },
- april: {
- label: 'April',
- color: 'hsl(var(--chart-4))',
- },
- may: {
- label: 'May',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const id = 'pie-interactive'
- const [activeMonth, setActiveMonth] = React.useState(desktopData[0].month)
-
- const activeIndex = React.useMemo(
- () => desktopData.findIndex((item) => item.month === activeMonth),
- [activeMonth]
- )
- const months = React.useMemo(() => desktopData.map((item) => item.month), [])
-
- return (
- <Card data-chart={id} className="flex flex-col">
- <ChartStyle id={id} config={chartConfig} />
- <CardHeader className="flex-row items-start space-y-0 pb-0">
- <div className="grid gap-1">
- <CardTitle>Pie Chart - Interactive</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </div>
- <Select_Shadcn_ value={activeMonth} onValueChange={setActiveMonth}>
- <SelectTrigger_Shadcn_
- className="ml-auto h-7 w-[130px] rounded-lg pl-2.5"
- aria-label="Select a value"
- >
- <SelectValue_Shadcn_ placeholder="Select month" />
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_ align="end" className="rounded-xl">
- {months.map((key) => {
- const config = chartConfig[key as keyof typeof chartConfig]
-
- if (!config) {
- return null
- }
-
- return (
- <SelectItem_Shadcn_ key={key} value={key} className="rounded-lg [&_span]:flex">
- <div className="flex items-center gap-2 text-xs">
- <span
- className="flex h-3 w-3 shrink-0 rounded-sm"
- style={{
- backgroundColor: `var(--color-${key})`,
- }}
- />
- {config?.label}
- </div>
- </SelectItem_Shadcn_>
- )
- })}
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- </CardHeader>
- <CardContent className="flex flex-1 justify-center pb-0">
- <ChartContainer
- id={id}
- config={chartConfig}
- className="mx-auto aspect-square w-full max-w-[300px]"
- >
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie
- data={desktopData}
- dataKey="desktop"
- nameKey="month"
- innerRadius={60}
- strokeWidth={5}
- activeIndex={activeIndex}
- activeShape={({ outerRadius = 0, ...props }: PieSectorDataItem) => (
- <g>
- <Sector {...props} outerRadius={outerRadius + 10} />
- <Sector
- {...props}
- outerRadius={outerRadius + 25}
- innerRadius={outerRadius + 12}
- />
- </g>
- )}
- >
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-3xl font-bold"
- >
- {desktopData[activeIndex].desktop.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </Pie>
- </PieChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-label-custom.tsx b/apps/design-system/registry/default/block/chart-pie-label-custom.tsx
deleted file mode 100644
index 5fcae35aabe..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-label-custom.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with a custom label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Custom Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
- <Pie
- data={chartData}
- dataKey="visitors"
- labelLine={false}
- label={({ payload, ...props }) => {
- return (
- <text
- cx={props.cx}
- cy={props.cy}
- x={props.x}
- y={props.y}
- textAnchor={props.textAnchor}
- dominantBaseline={props.dominantBaseline}
- fill="hsla(var(--foreground))"
- >
- {`${
- chartConfig[payload.browser as keyof typeof chartConfig]?.label
- } (${payload.visitors})`}
- </text>
- )
- }}
- nameKey="browser"
- />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-label-list.tsx b/apps/design-system/registry/default/block/chart-pie-label-list.tsx
deleted file mode 100644
index 814371c307e..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-label-list.tsx
+++ /dev/null
@@ -1,78 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { LabelList, Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with a label list'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Label List</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip content={<ChartTooltipContent nameKey="visitors" hideLabel />} />
- <Pie data={chartData} dataKey="visitors">
- <LabelList
- dataKey="browser"
- className="fill-background"
- stroke="none"
- fontSize={12}
- formatter={(value: keyof typeof chartConfig) => chartConfig[value]?.label}
- />
- </Pie>
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-label.tsx b/apps/design-system/registry/default/block/chart-pie-label.tsx
deleted file mode 100644
index 408bd68fb95..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-label.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with a label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer
- config={chartConfig}
- className="mx-auto aspect-square max-h-[250px] pb-0 [&_.recharts-pie-label-text]:fill-foreground"
- >
- <PieChart>
- <ChartTooltip content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" label nameKey="browser" />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-legend.tsx b/apps/design-system/registry/default/block/chart-pie-legend.tsx
deleted file mode 100644
index c72830caf17..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-legend.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-'use client'
-
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent } from 'ui'
-
-export const description = 'A pie chart with a legend'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Legend</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[300px]">
- <PieChart>
- <Pie data={chartData} dataKey="visitors" />
- <ChartLegend
- content={<ChartLegendContent nameKey="browser" />}
- className="-translate-y-2 flex-wrap gap-2 [&>*]:basis-1/4 [&>*]:justify-center"
- />
- </PieChart>
- </ChartContainer>
- </CardContent>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-separator-none.tsx b/apps/design-system/registry/default/block/chart-pie-separator-none.tsx
deleted file mode 100644
index ed00866c3b8..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-separator-none.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with no separator'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Separator None</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" nameKey="browser" stroke="0" />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-simple.tsx b/apps/design-system/registry/default/block/chart-pie-simple.tsx
deleted file mode 100644
index a16fb87ca56..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-simple.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A simple pie chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <Pie data={chartData} dataKey="visitors" nameKey="browser" />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-pie-stacked.tsx b/apps/design-system/registry/default/block/chart-pie-stacked.tsx
deleted file mode 100644
index a2ab16ba711..00000000000
--- a/apps/design-system/registry/default/block/chart-pie-stacked.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-'use client'
-
-import * as React from 'react'
-import { TrendingUp } from 'lucide-react'
-import { Label, Pie, PieChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A pie chart with stacked sections'
-
-const desktopData = [
- { month: 'january', desktop: 186, fill: 'var(--color-january)' },
- { month: 'february', desktop: 305, fill: 'var(--color-february)' },
- { month: 'march', desktop: 237, fill: 'var(--color-march)' },
- { month: 'april', desktop: 173, fill: 'var(--color-april)' },
- { month: 'may', desktop: 209, fill: 'var(--color-may)' },
-]
-
-const mobileData = [
- { month: 'january', mobile: 80, fill: 'var(--color-january)' },
- { month: 'february', mobile: 200, fill: 'var(--color-february)' },
- { month: 'march', mobile: 120, fill: 'var(--color-march)' },
- { month: 'april', mobile: 190, fill: 'var(--color-april)' },
- { month: 'may', mobile: 130, fill: 'var(--color-may)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- desktop: {
- label: 'Desktop',
- },
- mobile: {
- label: 'Mobile',
- },
- january: {
- label: 'January',
- color: 'hsl(var(--chart-1))',
- },
- february: {
- label: 'February',
- color: 'hsl(var(--chart-2))',
- },
- march: {
- label: 'March',
- color: 'hsl(var(--chart-3))',
- },
- april: {
- label: 'April',
- color: 'hsl(var(--chart-4))',
- },
- may: {
- label: 'May',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Pie Chart - Stacked</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <PieChart>
- <ChartTooltip
- content={
- <ChartTooltipContent
- labelKey="visitors"
- nameKey="month"
- indicator="line"
- labelFormatter={(_, payload) => {
- return chartConfig[payload?.[0].dataKey as keyof typeof chartConfig].label
- }}
- />
- }
- />
- <Pie data={desktopData} dataKey="desktop" outerRadius={60} />
- <Pie data={mobileData} dataKey="mobile" innerRadius={70} outerRadius={90} />
- </PieChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-default.tsx b/apps/design-system/registry/default/block/chart-radar-default.tsx
deleted file mode 100644
index dc3d4e6d553..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-default.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-dots.tsx b/apps/design-system/registry/default/block/chart-radar-dots.tsx
deleted file mode 100644
index bedf14de29b..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-dots.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with dots'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center">
- <CardTitle>Radar Chart - Dots</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-circle-fill.tsx b/apps/design-system/registry/default/block/chart-radar-grid-circle-fill.tsx
deleted file mode 100644
index d17d1536225..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-grid-circle-fill.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid and circle fill'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 285 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 203 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 264 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Circle Filled</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent />} />
- <PolarGrid className="fill-[--color-desktop] opacity-20" gridType="circle" />
- <PolarAngleAxis dataKey="month" />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-circle-no-lines.tsx b/apps/design-system/registry/default/block/chart-radar-grid-circle-no-lines.tsx
deleted file mode 100644
index 3e602ac5745..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-grid-circle-no-lines.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid and circle fill'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 203 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Circle - No lines</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid gridType="circle" radialLines={false} />
- <PolarAngleAxis dataKey="month" />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-circle.tsx b/apps/design-system/registry/default/block/chart-radar-grid-circle.tsx
deleted file mode 100644
index 0cc0277a0c4..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-grid-circle.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid and circle'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Circle</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid gridType="circle" />
- <PolarAngleAxis dataKey="month" />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-custom.tsx b/apps/design-system/registry/default/block/chart-radar-grid-custom.tsx
deleted file mode 100644
index 31614acc9a3..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-grid-custom.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a custom grid'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Custom</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid radialLines={false} polarRadius={[90]} strokeWidth={1} />
- <PolarAngleAxis dataKey="month" />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-fill.tsx b/apps/design-system/registry/default/block/chart-radar-grid-fill.tsx
deleted file mode 100644
index 7745a10fb13..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-grid-fill.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a grid filled'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 285 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 203 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 264 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid Filled</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarGrid className="fill-[--color-desktop] opacity-20" />
- <PolarAngleAxis dataKey="month" />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.5} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-grid-none.tsx b/apps/design-system/registry/default/block/chart-radar-grid-none.tsx
deleted file mode 100644
index a75ac15da18..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-grid-none.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with no grid'
-
-const chartData = [
- { month: 'January', desktop: 186 },
- { month: 'February', desktop: 305 },
- { month: 'March', desktop: 237 },
- { month: 'April', desktop: 273 },
- { month: 'May', desktop: 209 },
- { month: 'June', desktop: 214 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Grid None</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarAngleAxis dataKey="month" />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0.6}
- dot={{
- r: 4,
- fillOpacity: 1,
- }}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-icons.tsx b/apps/design-system/registry/default/block/chart-radar-icons.tsx
deleted file mode 100644
index b2a83ad3934..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-icons.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-'use client'
-
-import { ArrowDownFromLine, ArrowUpFromLine, TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'A radar chart with icons'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- icon: ArrowDownFromLine,
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- icon: ArrowUpFromLine,
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Icons</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart
- data={chartData}
- margin={{
- top: -40,
- bottom: -10,
- }}
- >
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- <ChartLegend className="mt-8" content={<ChartLegendContent />} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 pt-4 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-label-custom.tsx b/apps/design-system/registry/default/block/chart-radar-label-custom.tsx
deleted file mode 100644
index 51edad28517..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-label-custom.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a custom label'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Custom Label</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart
- data={chartData}
- margin={{
- top: 10,
- right: 10,
- bottom: 10,
- left: 10,
- }}
- >
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis
- dataKey="month"
- tick={({ x, y, textAnchor, value, index, ...props }) => {
- const data = chartData[index]
-
- return (
- <text
- x={x}
- y={index === 0 ? y - 10 : y}
- textAnchor={textAnchor}
- fontSize={13}
- fontWeight={500}
- {...props}
- >
- <tspan>{data.desktop}</tspan>
- <tspan className="fill-muted-foreground">/</tspan>
- <tspan>{data.mobile}</tspan>
- <tspan x={x} dy={'1rem'} fontSize={12} className="fill-muted-foreground">
- {data.month}
- </tspan>
- </text>
- )
- }}
- />
-
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-legend.tsx b/apps/design-system/registry/default/block/chart-radar-legend.tsx
deleted file mode 100644
index 1500cc422a3..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-legend.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import {
- ChartConfig,
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
-} from 'ui'
-
-export const description = 'A radar chart with a legend'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Legend</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent>
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart
- data={chartData}
- margin={{
- top: -40,
- bottom: -10,
- }}
- >
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- <ChartLegend className="mt-8" content={<ChartLegendContent />} />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 pt-4 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-lines-only.tsx b/apps/design-system/registry/default/block/chart-radar-lines-only.tsx
deleted file mode 100644
index acb880c81c3..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-lines-only.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with lines only'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 160 },
- { month: 'February', desktop: 185, mobile: 170 },
- { month: 'March', desktop: 207, mobile: 180 },
- { month: 'April', desktop: 173, mobile: 160 },
- { month: 'May', desktop: 160, mobile: 190 },
- { month: 'June', desktop: 174, mobile: 204 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Lines Only</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid radialLines={false} />
- <Radar
- dataKey="desktop"
- fill="var(--color-desktop)"
- fillOpacity={0}
- stroke="var(--color-desktop)"
- strokeWidth={2}
- />
- <Radar
- dataKey="mobile"
- fill="var(--color-mobile)"
- fillOpacity={0}
- stroke="var(--color-mobile)"
- strokeWidth={2}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-multiple.tsx b/apps/design-system/registry/default/block/chart-radar-multiple.tsx
deleted file mode 100644
index 5cc44043950..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-multiple.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with multiple data'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Multiple</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
- <PolarAngleAxis dataKey="month" />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radar-radius.tsx b/apps/design-system/registry/default/block/chart-radar-radius.tsx
deleted file mode 100644
index f6616c4ac00..00000000000
--- a/apps/design-system/registry/default/block/chart-radar-radius.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radar chart with a radius axis'
-
-const chartData = [
- { month: 'January', desktop: 186, mobile: 80 },
- { month: 'February', desktop: 305, mobile: 200 },
- { month: 'March', desktop: 237, mobile: 120 },
- { month: 'April', desktop: 73, mobile: 190 },
- { month: 'May', desktop: 209, mobile: 130 },
- { month: 'June', desktop: 214, mobile: 140 },
-]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card>
- <CardHeader className="items-center pb-4">
- <CardTitle>Radar Chart - Radius Axis</CardTitle>
- <CardDescription>Showing total visitors for the last 6 months</CardDescription>
- </CardHeader>
- <CardContent className="pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadarChart data={chartData}>
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent indicator="line" labelKey="month" />}
- />
- <PolarGrid />
- <Radar dataKey="desktop" fill="var(--color-desktop)" fillOpacity={0.6} />
- <Radar dataKey="mobile" fill="var(--color-mobile)" />
- <PolarRadiusAxis
- angle={60}
- stroke="hsla(var(--foreground))"
- orientation="middle"
- axisLine={false}
- />
- </RadarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="flex items-center gap-2 leading-none text-muted-foreground">
- January - June 2024
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radial-grid.tsx b/apps/design-system/registry/default/block/chart-radial-grid.tsx
deleted file mode 100644
index fea6deab0c2..00000000000
--- a/apps/design-system/registry/default/block/chart-radial-grid.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { PolarGrid, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart with a grid'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Grid</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart data={chartData} innerRadius={30} outerRadius={100}>
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel nameKey="browser" />}
- />
- <PolarGrid gridType="circle" />
- <RadialBar dataKey="visitors" />
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radial-label.tsx b/apps/design-system/registry/default/block/chart-radial-label.tsx
deleted file mode 100644
index 073e8b4ed47..00000000000
--- a/apps/design-system/registry/default/block/chart-radial-label.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { LabelList, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart with a label'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Label</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart
- data={chartData}
- startAngle={-90}
- endAngle={380}
- innerRadius={30}
- outerRadius={110}
- >
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel nameKey="browser" />}
- />
- <RadialBar dataKey="visitors" background>
- <LabelList
- position="insideStart"
- dataKey="browser"
- className="fill-white capitalize mix-blend-luminosity"
- fontSize={11}
- />
- </RadialBar>
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radial-shape.tsx b/apps/design-system/registry/default/block/chart-radial-shape.tsx
deleted file mode 100644
index 120a2df88d4..00000000000
--- a/apps/design-system/registry/default/block/chart-radial-shape.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer } from 'ui'
-
-export const description = 'A radial chart with a custom shape'
-
-const chartData = [{ browser: 'safari', visitors: 1260, fill: 'var(--color-safari)' }]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Shape</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart data={chartData} endAngle={100} innerRadius={80} outerRadius={140}>
- <PolarGrid
- gridType="circle"
- radialLines={false}
- stroke="none"
- className="first:fill-muted last:fill-background"
- polarRadius={[86, 74]}
- />
- <RadialBar dataKey="visitors" background />
- <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-4xl font-bold"
- >
- {chartData[0].visitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </PolarRadiusAxis>
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radial-simple.tsx b/apps/design-system/registry/default/block/chart-radial-simple.tsx
deleted file mode 100644
index 6c7590b2573..00000000000
--- a/apps/design-system/registry/default/block/chart-radial-simple.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart'
-
-const chartData = [
- { browser: 'chrome', visitors: 275, fill: 'var(--color-chrome)' },
- { browser: 'safari', visitors: 200, fill: 'var(--color-safari)' },
- { browser: 'firefox', visitors: 187, fill: 'var(--color-firefox)' },
- { browser: 'edge', visitors: 173, fill: 'var(--color-edge)' },
- { browser: 'other', visitors: 90, fill: 'var(--color-other)' },
-]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- chrome: {
- label: 'Chrome',
- color: 'hsl(var(--chart-1))',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
- firefox: {
- label: 'Firefox',
- color: 'hsl(var(--chart-3))',
- },
- edge: {
- label: 'Edge',
- color: 'hsl(var(--chart-4))',
- },
- other: {
- label: 'Other',
- color: 'hsl(var(--chart-5))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart data={chartData} innerRadius={30} outerRadius={110}>
- <ChartTooltip
- cursor={false}
- content={<ChartTooltipContent hideLabel nameKey="browser" />}
- />
- <RadialBar dataKey="visitors" background />
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radial-stacked.tsx b/apps/design-system/registry/default/block/chart-radial-stacked.tsx
deleted file mode 100644
index e38791f9bae..00000000000
--- a/apps/design-system/registry/default/block/chart-radial-stacked.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from 'ui'
-
-export const description = 'A radial chart with stacked sections'
-
-const chartData = [{ month: 'january', desktop: 1260, mobile: 570 }]
-
-const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'hsl(var(--chart-1))',
- },
- mobile: {
- label: 'Mobile',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- const totalVisitors = chartData[0].desktop + chartData[0].mobile
-
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Stacked</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex flex-1 items-center pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square w-full max-w-[250px]">
- <RadialBarChart data={chartData} endAngle={180} innerRadius={80} outerRadius={130}>
- <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
- <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text x={viewBox.cx} y={viewBox.cy} textAnchor="middle">
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) - 16}
- className="fill-foreground text-2xl font-bold"
- >
- {totalVisitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 4}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </PolarRadiusAxis>
- <RadialBar
- dataKey="desktop"
- stackId="a"
- cornerRadius={5}
- fill="var(--color-desktop)"
- className="stroke-transparent stroke-2"
- />
- <RadialBar
- dataKey="mobile"
- fill="var(--color-mobile)"
- stackId="a"
- cornerRadius={5}
- className="stroke-transparent stroke-2"
- />
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/block/chart-radial-text.tsx b/apps/design-system/registry/default/block/chart-radial-text.tsx
deleted file mode 100644
index 8dd238c505b..00000000000
--- a/apps/design-system/registry/default/block/chart-radial-text.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-'use client'
-
-import { TrendingUp } from 'lucide-react'
-import { Label, PolarGrid, PolarRadiusAxis, RadialBar, RadialBarChart } from 'recharts'
-
-import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from 'ui'
-import { ChartConfig, ChartContainer } from 'ui'
-
-export const description = 'A radial chart with text'
-
-const chartData = [{ browser: 'safari', visitors: 200, fill: 'var(--color-safari)' }]
-
-const chartConfig = {
- visitors: {
- label: 'Visitors',
- },
- safari: {
- label: 'Safari',
- color: 'hsl(var(--chart-2))',
- },
-} satisfies ChartConfig
-
-export default function Component() {
- return (
- <Card className="flex flex-col">
- <CardHeader className="items-center pb-0">
- <CardTitle>Radial Chart - Text</CardTitle>
- <CardDescription>January - June 2024</CardDescription>
- </CardHeader>
- <CardContent className="flex-1 pb-0">
- <ChartContainer config={chartConfig} className="mx-auto aspect-square max-h-[250px]">
- <RadialBarChart
- data={chartData}
- startAngle={0}
- endAngle={250}
- innerRadius={80}
- outerRadius={110}
- >
- <PolarGrid
- gridType="circle"
- radialLines={false}
- stroke="none"
- className="first:fill-muted last:fill-background"
- polarRadius={[86, 74]}
- />
- <RadialBar dataKey="visitors" background cornerRadius={10} />
- <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>
- <Label
- content={({ viewBox }) => {
- if (viewBox && 'cx' in viewBox && 'cy' in viewBox) {
- return (
- <text
- x={viewBox.cx}
- y={viewBox.cy}
- textAnchor="middle"
- dominantBaseline="middle"
- >
- <tspan
- x={viewBox.cx}
- y={viewBox.cy}
- className="fill-foreground text-4xl font-bold"
- >
- {chartData[0].visitors.toLocaleString()}
- </tspan>
- <tspan
- x={viewBox.cx}
- y={(viewBox.cy || 0) + 24}
- className="fill-muted-foreground"
- >
- Visitors
- </tspan>
- </text>
- )
- }
- }}
- />
- </PolarRadiusAxis>
- </RadialBarChart>
- </ChartContainer>
- </CardContent>
- <CardFooter className="flex-col gap-2 text-sm">
- <div className="flex items-center gap-2 font-medium leading-none">
- Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
- </div>
- <div className="leading-none text-muted-foreground">
- Showing total visitors for the last 6 months
- </div>
- </CardFooter>
- </Card>
- )
-}
diff --git a/apps/design-system/registry/default/example/logs-bar-chart.tsx b/apps/design-system/registry/default/example/logs-bar-chart.tsx
index 3b0a83db34e..31c3473e43d 100644
--- a/apps/design-system/registry/default/example/logs-bar-chart.tsx
+++ b/apps/design-system/registry/default/example/logs-bar-chart.tsx
@@ -16,7 +16,7 @@ export default function LogsBarChartDemo() {
}).reverse()
return (
- <div className="w-full h-64">
+ <div className="w-full h-24">
<LogsBarChart data={data} />
</div>
)
diff --git a/packages/ui-patterns/package.json b/packages/ui-patterns/package.json
index d63410dd7e3..915a6e99e92 100644
--- a/packages/ui-patterns/package.json
+++ b/packages/ui-patterns/package.json
@@ -605,11 +605,16 @@
"./MetricCard": {
"import": "./src/MetricCard/index.tsx",
"types": "./src/MetricCard/index.tsx"
+ },
+ "./Chart": {
+ "import": "./src/Chart/index.tsx",
+ "types": "./src/Chart/index.tsx"
}
},
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"@monaco-editor/react": "^4.6.0",
+ "@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-visually-hidden": "^1.1.3",
"@std/toml": "jsr:^1.0.11",
"@supabase/sql-to-rest": "^0.1.6",
diff --git a/packages/ui-patterns/src/Chart/charts/chart-bar.tsx b/packages/ui-patterns/src/Chart/charts/chart-bar.tsx
new file mode 100644
index 00000000000..a55bbf7001a
--- /dev/null
+++ b/packages/ui-patterns/src/Chart/charts/chart-bar.tsx
@@ -0,0 +1,230 @@
+'use client'
+
+import { useState, ReactNode } from 'react'
+import {
+ Bar,
+ Cell,
+ BarChart as RechartBarChart,
+ XAxis,
+ YAxis,
+ ReferenceArea,
+ CartesianGrid,
+} from 'recharts'
+import type { CategoricalChartState } from 'recharts/types/chart/types'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, cn } from 'ui'
+import dayjs from 'dayjs'
+import { useTheme } from 'next-themes'
+
+const CHART_COLORS = {
+ TICK: 'hsl(var(--background-overlay-hover))',
+ AXIS: 'hsl(var(--background-overlay-hover))',
+ BRAND: 'hsl(var(--brand-default))',
+ BRAND_HOVER: 'hsl(var(--brand-500))',
+}
+
+export type ChartBarTick = {
+ timestamp: string
+ [key: string]: string | number
+}
+
+export type ChartHighlight = {
+ handleMouseDown: (e: { activeLabel?: string; coordinates?: string }) => void
+ handleMouseMove: (e: { activeLabel?: string; coordinates?: string }) => void
+ handleMouseUp: (e: { chartX?: number; chartY?: number }) => void
+ coordinates: { left?: string; right?: string }
+ clearHighlight?: () => void
+}
+
+export type ChartHighlightAction = {
+ id: string
+ label: string | ((ctx: { start: string; end: string; clear: () => void }) => string)
+ icon?: ReactNode
+ isDisabled?: (ctx: { start: string; end: string; clear: () => void }) => boolean
+ onSelect: (ctx: { start: string; end: string; clear: () => void }) => void
+}
+
+export interface ChartBarProps {
+ data: ChartBarTick[]
+ dataKey: string
+ config?: ChartConfig
+ onBarClick?: (datum: ChartBarTick, tooltipData?: CategoricalChartState) => void
+ DateTimeFormat?: string
+ isFullHeight?: boolean
+ className?: string
+ color?: string
+ hoverColor?: string
+ chartHighlight?: ChartHighlight
+ updateDateRange?: (from: string, to: string) => void
+ highlightActions?: ChartHighlightAction[]
+ syncId?: string
+ showHighlightArea?: boolean
+ cursor?: string
+ showGrid?: boolean
+ showYAxis?: boolean
+ YAxisProps?: {
+ tick?: boolean
+ tickFormatter?: (value: any) => string
+ width?: number
+ [key: string]: any
+ }
+}
+
+export const ChartBar = ({
+ data,
+ dataKey,
+ config,
+ onBarClick,
+ DateTimeFormat = 'MMM D, YYYY, hh:mma',
+ isFullHeight = false,
+ className,
+ color = CHART_COLORS.BRAND,
+ hoverColor = CHART_COLORS.BRAND_HOVER,
+ chartHighlight,
+ updateDateRange,
+ highlightActions,
+ syncId,
+ showHighlightArea = true,
+ cursor,
+ showGrid = false,
+ showYAxis = false,
+ YAxisProps,
+}: ChartBarProps) => {
+ const [focusDataIndex, setFocusDataIndex] = useState<number | null>(null)
+ const { resolvedTheme } = useTheme()
+ const isDarkMode = resolvedTheme?.includes('dark')
+
+ if (data.length === 0) {
+ return null
+ }
+
+ const chartConfig: ChartConfig = config || {
+ [dataKey]: {
+ label: dataKey,
+ },
+ }
+
+ const showHighlightActions =
+ showHighlightArea &&
+ chartHighlight?.coordinates.left &&
+ chartHighlight?.coordinates.right &&
+ chartHighlight?.coordinates.left !== chartHighlight?.coordinates.right
+
+ const chartCursor = cursor || (chartHighlight ? 'crosshair' : 'default')
+
+ const yAxisConfig = {
+ tick: showYAxis,
+ hide: !showYAxis,
+ tickMargin: showYAxis ? YAxisProps?.tickMargin ?? 4 : 0,
+ width: showYAxis ? YAxisProps?.width ?? undefined : 0,
+ axisLine: { stroke: CHART_COLORS.AXIS },
+ tickLine: { stroke: CHART_COLORS.AXIS },
+ ...YAxisProps,
+ }
+
+ const margin = {
+ top: 0,
+ right: 0,
+ left: showYAxis ? -40 : 0,
+ bottom: 0,
+ }
+
+ return (
+ <div
+ data-testid="chart-bar"
+ className={cn('flex flex-col gap-y-3 w-full', isFullHeight ? 'h-full' : 'h-24', className)}
+ >
+ <ChartContainer className="!w-full h-full" config={chartConfig}>
+ <RechartBarChart
+ data={data}
+ syncId={syncId}
+ margin={margin}
+ style={{ cursor: chartCursor }}
+ onMouseMove={(e: any) => {
+ if (e.activeTooltipIndex !== focusDataIndex) {
+ setFocusDataIndex(e.activeTooltipIndex)
+ }
+
+ if (chartHighlight) {
+ const activeTimestamp = data[e.activeTooltipIndex]?.timestamp
+ chartHighlight.handleMouseMove({
+ activeLabel: activeTimestamp?.toString(),
+ coordinates: e.activeLabel,
+ })
+ }
+ }}
+ onMouseDown={(e: any) => {
+ if (chartHighlight && e.activeTooltipIndex !== undefined) {
+ const activeTimestamp = data[e.activeTooltipIndex]?.timestamp
+ chartHighlight.handleMouseDown({
+ activeLabel: activeTimestamp?.toString(),
+ coordinates: e.activeLabel,
+ })
+ }
+ }}
+ onMouseUp={(e: any) => {
+ if (chartHighlight) {
+ chartHighlight.handleMouseUp({
+ chartX: e?.chartX,
+ chartY: e?.chartY,
+ })
+ }
+ }}
+ onMouseLeave={() => {
+ setFocusDataIndex(null)
+ if (chartHighlight?.clearHighlight) {
+ chartHighlight.clearHighlight()
+ }
+ }}
+ onClick={(tooltipData) => {
+ const datum = tooltipData?.activePayload?.[0]?.payload
+ if (onBarClick) onBarClick(datum, tooltipData)
+ }}
+ >
+ {showGrid && <CartesianGrid vertical={false} stroke={CHART_COLORS.AXIS} />}
+ <YAxis {...yAxisConfig} />
+ <XAxis
+ dataKey="timestamp"
+ interval={data.length - 2}
+ tick={false}
+ axisLine={{ stroke: CHART_COLORS.AXIS }}
+ tickLine={{ stroke: CHART_COLORS.AXIS }}
+ />
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ className="text-foreground-light -mt-5"
+ labelFormatter={(v: string) => dayjs(v).format(DateTimeFormat)}
+ />
+ }
+ />
+ {/* Selection highlight area */}
+ {showHighlightActions && (
+ <ReferenceArea
+ x1={chartHighlight?.coordinates.left}
+ x2={chartHighlight?.coordinates.right}
+ strokeOpacity={0.5}
+ stroke={isDarkMode ? '#FFFFFF' : '#0C3925'}
+ fill={isDarkMode ? '#FFFFFF' : '#0C3925'}
+ fillOpacity={0.2}
+ />
+ )}
+ <Bar dataKey={dataKey} fill={color} maxBarSize={24}>
+ {data?.map((_entry: ChartBarTick, index: number) => (
+ <Cell
+ className="cursor-pointer transition-colors"
+ key={`bar-${index}`}
+ fill={focusDataIndex === index || focusDataIndex === null ? color : hoverColor}
+ />
+ ))}
+ </Bar>
+ </RechartBarChart>
+ </ChartContainer>
+ {data && data.length > 0 && (
+ <div className="text-foreground-lighter -mt-10 flex items-center justify-between text-[10px] font-mono">
+ <span>{dayjs(data[0]['timestamp']).format(DateTimeFormat)}</span>
+ <span>{dayjs(data[data.length - 1]?.['timestamp']).format(DateTimeFormat)}</span>
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/packages/ui-patterns/src/Chart/charts/chart-line.tsx b/packages/ui-patterns/src/Chart/charts/chart-line.tsx
new file mode 100644
index 00000000000..2acf85578c4
--- /dev/null
+++ b/packages/ui-patterns/src/Chart/charts/chart-line.tsx
@@ -0,0 +1,230 @@
+'use client'
+
+import { useState, ReactNode } from 'react'
+import {
+ Area,
+ AreaChart as RechartAreaChart,
+ XAxis,
+ YAxis,
+ ReferenceArea,
+ CartesianGrid,
+} from 'recharts'
+import type { CategoricalChartState } from 'recharts/types/chart/types'
+import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, cn } from 'ui'
+import dayjs from 'dayjs'
+import { useTheme } from 'next-themes'
+
+const CHART_COLORS = {
+ TICK: 'hsl(var(--background-overlay-hover))',
+ AXIS: 'hsl(var(--background-overlay-hover))',
+ BRAND: 'hsl(var(--brand-default))',
+ BRAND_HOVER: 'hsl(var(--brand-500))',
+}
+
+export type ChartLineTick = {
+ timestamp: string
+ [key: string]: string | number
+}
+
+export type ChartHighlight = {
+ handleMouseDown: (e: { activeLabel?: string; coordinates?: string }) => void
+ handleMouseMove: (e: { activeLabel?: string; coordinates?: string }) => void
+ handleMouseUp: (e: { chartX?: number; chartY?: number }) => void
+ coordinates: { left?: string; right?: string }
+ clearHighlight?: () => void
+}
+
+export type ChartHighlightAction = {
+ id: string
+ label: string | ((ctx: { start: string; end: string; clear: () => void }) => string)
+ icon?: ReactNode
+ isDisabled?: (ctx: { start: string; end: string; clear: () => void }) => boolean
+ onSelect: (ctx: { start: string; end: string; clear: () => void }) => void
+}
+
+export interface ChartLineProps {
+ data: ChartLineTick[]
+ dataKey: string
+ config?: ChartConfig
+ onLineClick?: (datum: ChartLineTick, tooltipData?: CategoricalChartState) => void
+ DateTimeFormat?: string
+ isFullHeight?: boolean
+ className?: string
+ color?: string
+ hoverColor?: string
+ chartHighlight?: ChartHighlight
+ updateDateRange?: (from: string, to: string) => void
+ highlightActions?: ChartHighlightAction[]
+ syncId?: string
+ showHighlightArea?: boolean
+ cursor?: string
+ showGrid?: boolean
+ showYAxis?: boolean
+ YAxisProps?: {
+ tick?: boolean
+ tickFormatter?: (value: any) => string
+ width?: number
+ [key: string]: any
+ }
+ strokeWidth?: number
+}
+
+export const ChartLine = ({
+ data,
+ dataKey,
+ config,
+ onLineClick,
+ DateTimeFormat = 'MMM D, YYYY, hh:mma',
+ isFullHeight = false,
+ className,
+ color = CHART_COLORS.BRAND,
+ hoverColor = CHART_COLORS.BRAND_HOVER,
+ chartHighlight,
+ updateDateRange,
+ highlightActions,
+ syncId,
+ showHighlightArea = true,
+ cursor,
+ showGrid = false,
+ showYAxis = false,
+ YAxisProps,
+ strokeWidth = 1.5,
+}: ChartLineProps) => {
+ const [focusDataIndex, setFocusDataIndex] = useState<number | null>(null)
+ const { resolvedTheme } = useTheme()
+ const isDarkMode = resolvedTheme?.includes('dark')
+
+ if (data.length === 0) {
+ return null
+ }
+
+ const chartConfig: ChartConfig = config || {
+ [dataKey]: {
+ label: dataKey,
+ },
+ }
+
+ const showHighlightActions =
+ showHighlightArea &&
+ chartHighlight?.coordinates.left &&
+ chartHighlight?.coordinates.right &&
+ chartHighlight?.coordinates.left !== chartHighlight?.coordinates.right
+
+ const chartCursor = cursor || (chartHighlight ? 'crosshair' : 'default')
+
+ const yAxisConfig = {
+ tick: showYAxis,
+ hide: !showYAxis,
+ tickMargin: showYAxis ? YAxisProps?.tickMargin ?? 4 : 0,
+ width: showYAxis ? YAxisProps?.width ?? undefined : 0,
+ axisLine: { stroke: CHART_COLORS.AXIS },
+ tickLine: { stroke: CHART_COLORS.AXIS },
+ ...YAxisProps,
+ }
+
+ const margin = {
+ top: 0,
+ right: 0,
+ left: showYAxis ? -40 : 0,
+ bottom: 0,
+ }
+
+ return (
+ <div
+ data-testid="chart-line"
+ className={cn('flex flex-col gap-y-3 w-full', isFullHeight ? 'h-full' : 'h-24', className)}
+ >
+ <ChartContainer className="!w-full h-full" config={chartConfig}>
+ <RechartAreaChart
+ data={data}
+ syncId={syncId}
+ margin={margin}
+ style={{ cursor: chartCursor }}
+ onMouseMove={(e: any) => {
+ if (e.activeTooltipIndex !== focusDataIndex) {
+ setFocusDataIndex(e.activeTooltipIndex)
+ }
+
+ if (chartHighlight) {
+ const activeTimestamp = data[e.activeTooltipIndex]?.timestamp
+ chartHighlight.handleMouseMove({
+ activeLabel: activeTimestamp?.toString(),
+ coordinates: e.activeLabel,
+ })
+ }
+ }}
+ onMouseDown={(e: any) => {
+ if (chartHighlight && e.activeTooltipIndex !== undefined) {
+ const activeTimestamp = data[e.activeTooltipIndex]?.timestamp
+ chartHighlight.handleMouseDown({
+ activeLabel: activeTimestamp?.toString(),
+ coordinates: e.activeLabel,
+ })
+ }
+ }}
+ onMouseUp={(e: any) => {
+ if (chartHighlight) {
+ chartHighlight.handleMouseUp({
+ chartX: e?.chartX,
+ chartY: e?.chartY,
+ })
+ }
+ }}
+ onMouseLeave={() => {
+ setFocusDataIndex(null)
+ if (chartHighlight?.clearHighlight) {
+ chartHighlight.clearHighlight()
+ }
+ }}
+ onClick={(tooltipData) => {
+ const datum = tooltipData?.activePayload?.[0]?.payload
+ if (onLineClick) onLineClick(datum, tooltipData)
+ }}
+ >
+ {showGrid && <CartesianGrid vertical={false} stroke={CHART_COLORS.AXIS} />}
+ <YAxis {...yAxisConfig} />
+ <XAxis
+ dataKey="timestamp"
+ interval={data.length - 2}
+ tick={false}
+ axisLine={{ stroke: CHART_COLORS.AXIS }}
+ tickLine={{ stroke: CHART_COLORS.AXIS }}
+ />
+ <ChartTooltip
+ content={
+ <ChartTooltipContent
+ className="text-foreground-light -mt-5"
+ labelFormatter={(v: string) => dayjs(v).format(DateTimeFormat)}
+ />
+ }
+ />
+ {/* Selection highlight area */}
+ {showHighlightActions && (
+ <ReferenceArea
+ x1={chartHighlight?.coordinates.left}
+ x2={chartHighlight?.coordinates.right}
+ strokeOpacity={0.5}
+ stroke={isDarkMode ? '#FFFFFF' : '#0C3925'}
+ fill={isDarkMode ? '#FFFFFF' : '#0C3925'}
+ fillOpacity={0.2}
+ />
+ )}
+ <Area
+ type="step"
+ dataKey={dataKey}
+ fill={focusDataIndex !== null ? hoverColor : color}
+ fillOpacity={0.1}
+ stroke={focusDataIndex !== null ? hoverColor : color}
+ strokeWidth={strokeWidth}
+ />
+ </RechartAreaChart>
+ </ChartContainer>
+ {data && data.length > 0 && (
+ <div className="text-foreground-lighter -mt-10 flex items-center justify-between text-[10px] font-mono">
+ <span>{dayjs(data[0]['timestamp']).format(DateTimeFormat)}</span>
+ <span>{dayjs(data[data.length - 1]?.['timestamp']).format(DateTimeFormat)}</span>
+ </div>
+ )}
+ </div>
+ )
+}
diff --git a/packages/ui-patterns/src/Chart/index.tsx b/packages/ui-patterns/src/Chart/index.tsx
new file mode 100644
index 00000000000..6ad5bd1f724
--- /dev/null
+++ b/packages/ui-patterns/src/Chart/index.tsx
@@ -0,0 +1,611 @@
+'use client'
+
+import * as React from 'react'
+import { useContext, useState, useMemo, useRef } from 'react'
+import { Slot } from '@radix-ui/react-slot'
+import {
+ Button,
+ Card,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+ Skeleton,
+ ChartContainer,
+ cn,
+} from 'ui'
+import { HelpCircle, Loader2 } from 'lucide-react'
+import Link from 'next/link'
+import {
+ BarChart,
+ Bar,
+ XAxis,
+ YAxis,
+ ResponsiveContainer,
+ Area,
+ AreaChart,
+ Tooltip as RechartsTooltip,
+ TooltipProps as RechartsTooltipProps,
+} from 'recharts'
+import dayjs from 'dayjs'
+
+/* Chart Config */
+export type ChartConfig = {
+ [key: string]: {
+ label?: React.ReactNode
+ icon?: React.ComponentType
+ } & (
+ | { color?: string; theme?: never }
+ | { color?: never; theme: Record<'light' | 'dark', string> } /* come back to this */
+ )
+}
+
+/* Chart Context */
+interface ChartContextValue {
+ isLoading?: boolean
+ isDisabled?: boolean
+}
+
+const ChartContext = React.createContext<ChartContextValue>({
+ isLoading: false,
+ isDisabled: false,
+})
+
+export const useChart = () => {
+ return useContext(ChartContext)
+}
+
+/* Chart Base */
+interface ChartProps extends React.HTMLAttributes<HTMLDivElement> {
+ children: React.ReactNode
+ isLoading?: boolean
+ isDisabled?: boolean
+ className?: string
+}
+
+const Chart = React.forwardRef<HTMLDivElement, ChartProps>(
+ ({ children, isLoading = false, isDisabled = false, className, ...props }, ref) => {
+ return (
+ <ChartContext.Provider value={{ isLoading, isDisabled }}>
+ <div ref={ref} className={cn('relative w-full', className)} {...props}>
+ {children}
+ </div>
+ </ChartContext.Provider>
+ )
+ }
+)
+Chart.displayName = 'Chart'
+
+/* Chart Card */
+interface ChartCardProps extends React.HTMLAttributes<HTMLDivElement> {
+ asChild?: boolean
+ children: React.ReactNode
+ className?: string
+}
+
+const ChartCard = React.forwardRef<HTMLDivElement, ChartCardProps>(
+ ({ children, className, asChild, ...props }, ref) => {
+ const Comp = asChild ? Slot : Card
+ return (
+ <Comp ref={ref} className={cn('relative w-full', className)} {...props}>
+ {children}
+ </Comp>
+ )
+ }
+)
+ChartCard.displayName = 'ChartCard'
+
+/* Chart Header Components */
+interface ChartHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
+ align?: 'start' | 'center'
+ children: React.ReactNode
+}
+
+const ChartHeader = React.forwardRef<HTMLDivElement, ChartHeaderProps>(
+ ({ children, className, align = 'center', ...props }, ref) => {
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'py-4 px-6 flex flex-row justify-between gap-2 space-y-0 pb-0 border-b-0 relative',
+ align === 'center' ? 'items-center' : 'items-start',
+ className
+ )}
+ {...props}
+ >
+ {children}
+ </div>
+ )
+ }
+)
+ChartHeader.displayName = 'ChartHeader'
+
+interface ChartTitleProps extends React.HTMLAttributes<HTMLDivElement> {
+ children: React.ReactNode
+ tooltip?: string
+}
+
+const ChartTitle = React.forwardRef<HTMLDivElement, ChartTitleProps>(
+ ({ children, className, tooltip, ...props }, ref) => {
+ return (
+ <h3 ref={ref} className={cn('h3 flex items-center gap-2', className)} {...props}>
+ <span>{children}</span>
+ {tooltip && (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <HelpCircle
+ size={14}
+ strokeWidth={1.5}
+ className="text-foreground-lighter hover:text-foreground-light transition-colors cursor-help"
+ />
+ </TooltipTrigger>
+ <TooltipContent>{tooltip}</TooltipContent>
+ </Tooltip>
+ )}
+ </h3>
+ )
+ }
+)
+ChartTitle.displayName = 'ChartTitle'
+
+export type ChartAction = {
+ label: string
+ icon?: React.ReactNode
+ onClick?: () => void
+ href?: string
+ type?: 'button' | 'link'
+ className?: string
+}
+
+interface ChartActionsProps extends React.HTMLAttributes<HTMLDivElement> {
+ actions?: ChartAction[]
+ children?: React.ReactNode
+}
+
+const ChartActions = React.forwardRef<HTMLDivElement, ChartActionsProps>(
+ ({ actions, children, className, ...props }, ref) => {
+ if (children) {
+ return (
+ <div ref={ref} className={cn('flex items-center gap-2', className)} {...props}>
+ {children}
+ </div>
+ )
+ }
+
+ if (actions && actions.length > 0) {
+ return (
+ <div ref={ref} className={cn('flex items-center gap-2', className)} {...props}>
+ {actions.map((action, index) => {
+ const isLink = !!action.href
+
+ return (
+ <Tooltip key={index}>
+ <TooltipTrigger asChild>
+ <Button
+ type="default"
+ size="tiny"
+ className={cn('px-1.5 text-foreground-lighter', action.className)}
+ onClick={action.onClick}
+ asChild={isLink}
+ >
+ {isLink ? (
+ <Link href={action.href!}>
+ {action.icon}
+ <span className="sr-only">{action.label}</span>
+ </Link>
+ ) : (
+ <>
+ {action.icon}
+ <span className="sr-only">{action.label}</span>
+ </>
+ )}
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="top">{action.label}</TooltipContent>
+ </Tooltip>
+ )
+ })}
+ </div>
+ )
+ }
+
+ return null
+ }
+)
+ChartActions.displayName = 'ChartActions'
+
+/* Chart Metric */
+interface ChartMetricProps extends React.HTMLAttributes<HTMLDivElement> {
+ label: string
+ value: string | number | null | undefined
+ diffValue?: string | number | null | undefined
+ status?: 'positive' | 'negative' | 'warning' | 'default'
+ align?: 'start' | 'end'
+ tooltip?: string
+ className?: string
+}
+
+const ChartMetric = React.forwardRef<HTMLDivElement, ChartMetricProps>(
+ ({ label, value, diffValue, className, status, align = 'start', tooltip, ...props }, ref) => {
+ const { isLoading } = useChart()
+
+ const { variant, formattedDiffValue } = useMemo(() => {
+ if (diffValue === null || diffValue === undefined) {
+ return { variant: 'default' as const, formattedDiffValue: null }
+ }
+
+ const numValue = typeof diffValue === 'string' ? parseFloat(diffValue) : diffValue
+
+ if (isNaN(numValue)) {
+ return { variant: 'default' as const, formattedDiffValue: String(diffValue) }
+ }
+
+ const variant: 'positive' | 'negative' | 'default' =
+ numValue > 0 ? 'positive' : numValue < 0 ? 'negative' : 'default'
+
+ const formattedDiffValue = numValue > 0 ? `+${diffValue}` : String(diffValue)
+
+ return { variant, formattedDiffValue }
+ }, [diffValue])
+
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'flex gap-0.5 flex-col',
+ align === 'start' ? 'items-start' : 'items-end',
+ className
+ )}
+ {...props}
+ >
+ <div className="flex items-center gap-2">
+ {status && (
+ <span
+ className={cn(
+ 'flex-shrink-0 w-1.5 h-1.5 rounded-full flex',
+ status === 'positive' && 'bg-brand',
+ status === 'negative' && 'bg-destructive',
+ status === 'warning' && 'bg-warning',
+ status === 'default' && 'bg-foreground-lighter'
+ )}
+ />
+ )}
+ <h3 className="text-xs font-mono uppercase flex items-center gap-1.5 text-foreground-light my-0">
+ <span>{label}</span>
+ {tooltip && (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <HelpCircle
+ size={12}
+ strokeWidth={1.5}
+ className="text-foreground-lighter hover:text-foreground-light transition-colors cursor-help"
+ />
+ </TooltipTrigger>
+ <TooltipContent>{tooltip}</TooltipContent>
+ </Tooltip>
+ )}
+ </h3>
+ </div>
+ <span className="text-foreground text-xl tabular-nums">
+ {isLoading ? <Skeleton className="w-12 h-6" /> : value}
+ </span>
+ {diffValue !== null && diffValue !== undefined && !isLoading && (
+ <ChartValueDifferential variant={variant}>{formattedDiffValue}</ChartValueDifferential>
+ )}
+ </div>
+ )
+ }
+)
+ChartMetric.displayName = 'ChartMetric'
+
+/* Chart Content */
+interface ChartContentProps extends React.HTMLAttributes<HTMLDivElement> {
+ children: React.ReactNode
+ className?: string
+ isEmpty?: boolean
+ emptyState?: React.ReactNode
+ loadingState?: React.ReactNode
+ disabledState?: React.ReactNode
+ disabledActions?: ChartAction[]
+}
+
+const ChartContent = React.forwardRef<HTMLDivElement, ChartContentProps>(
+ (
+ {
+ children,
+ className,
+ isEmpty = false,
+ emptyState,
+ loadingState,
+ disabledState,
+ disabledActions,
+ ...props
+ },
+ ref
+ ) => {
+ const { isLoading, isDisabled } = useChart()
+ let content: React.ReactNode
+
+ if (isDisabled) {
+ content = disabledState
+ } else if (isLoading) {
+ content = loadingState
+ } else if (isEmpty) {
+ content = emptyState
+ } else {
+ content = children
+ }
+
+ return (
+ <div ref={ref} className={cn('px-6 pt-4 pb-6', className)} {...props}>
+ {content}
+ </div>
+ )
+ }
+)
+ChartContent.displayName = 'ChartContent'
+
+/* Chart Empty State */
+interface ChartEmptyStateProps extends React.HTMLAttributes<HTMLDivElement> {
+ className?: string
+ icon?: React.ReactNode
+ title: string
+ description: string
+}
+
+const ChartEmptyState = React.forwardRef<HTMLDivElement, ChartEmptyStateProps>(
+ ({ className, icon, title, description, ...props }, ref) => {
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ 'h-40 border border-dashed border-control items-center justify-center flex flex-col',
+ className
+ )}
+ {...props}
+ >
+ {icon && (
+ <div className="flex items-center justify-center w-6 h-6 text-foreground-lighter mb-1">
+ {icon}
+ </div>
+ )}
+ <h3 className="text-sm font-medium text-foreground-light">{title}</h3>
+ <p className="text-sm text-foreground-lighter">{description}</p>
+ </div>
+ )
+ }
+)
+ChartEmptyState.displayName = 'ChartEmptyState'
+
+/* Chart Loading State */
+const ChartLoadingState = () => {
+ return (
+ <div className="h-40 border border-dashed border-control items-center justify-center flex flex-col">
+ <Loader2 size={20} className="animate-spin text-foreground-muted" />
+ </div>
+ )
+}
+ChartLoadingState.displayName = 'ChartLoadingState'
+
+/* Chart Disabled State */
+type ChartDisabledStateActions = {
+ icon?: React.ReactNode
+ label: string
+ href?: string
+ onClick?: () => void
+ type?: 'button' | 'link'
+ className?: string
+}
+interface ChartDisabledStateProps extends React.HTMLAttributes<HTMLDivElement> {
+ icon?: React.ReactNode
+ label: string
+ description: string
+ actions?: ChartDisabledStateActions[]
+}
+
+const ChartDisabledState = ({ icon, label, description, actions }: ChartDisabledStateProps) => {
+ const [isHoveringButton, setIsHoveringButton] = useState(false)
+ const startDate = '2025-01-01'
+
+ const getExpDemoChartData = useMemo(() => {
+ return new Array(20).fill(0).map((_, index) => ({
+ period_start: new Date(startDate).getTime() + index * 1000,
+ demo: Math.floor(Math.pow(1.25, index) * 10),
+ max_demo: 1000,
+ }))
+ }, [])
+
+ const getDemoChartData = useRef(
+ new Array(20).fill(0).map((_, index) => ({
+ period_start: new Date(startDate).getTime() + index * 1000,
+ demo: Math.floor(Math.random() * 10) + 1,
+ max_demo: 1000,
+ }))
+ )
+
+ const demoData = isHoveringButton ? getExpDemoChartData : getDemoChartData.current
+
+ return (
+ <>
+ <div className="relative h-40">
+ <ChartContainer
+ config={
+ {
+ demo: {
+ label: 'Demo',
+ color: 'hsl(var(--brand-default))',
+ },
+ } satisfies ChartConfig
+ }
+ className="h-full w-full"
+ >
+ <BarChart data={demoData}>
+ <XAxis dataKey="period_start" hide />
+ <YAxis hide />
+ <Bar dataKey="demo" fill="hsl(var(--brand-default))" />
+ </BarChart>
+ </ChartContainer>
+ </div>
+ <div className="absolute inset-0 bg-surface-100/80 backdrop-blur-md w-full h-full flex flex-col items-center justify-center">
+ {icon && (
+ <div className="flex items-center justify-center w-6 h-6 text-foreground-lighter mb-1">
+ {icon}
+ </div>
+ )}
+ <h3 className="text-sm font-medium text-foreground">{label}</h3>
+ <p className="text-sm text-foreground-light">{description}</p>
+ {actions && actions.length > 0 && (
+ <div className="flex items-center gap-2 mt-3">
+ {actions.map((action, index) => (
+ <Button
+ key={index}
+ type="primary"
+ size="tiny"
+ className={cn(action.className)}
+ onClick={action.onClick}
+ asChild={!!action.href}
+ onMouseEnter={() => setIsHoveringButton(true)}
+ onMouseLeave={() => setIsHoveringButton(false)}
+ >
+ {action.href ? <Link href={action.href}>{action.label}</Link> : <>{action.label}</>}
+ </Button>
+ ))}
+ </div>
+ )}
+ </div>
+ </>
+ )
+}
+ChartDisabledState.displayName = 'ChartDisabledState'
+
+/* Chart Footer */
+const chartTableClasses = `[&_tr]:border-b [&_tr]:border-border [&_thead_tr]:!bg-transparent [&_thead_th]:!py-2 [&_thead_th]:h-auto [&_tbody_td]:py-2.5 [&_tbody_td]:text-xs [&_table]:mb-1 [&_table]:border-b [&_table]:border-border`
+
+interface ChartFooterProps extends React.HTMLAttributes<HTMLDivElement> {
+ children: React.ReactNode
+}
+
+const ChartFooter = React.forwardRef<HTMLDivElement, ChartFooterProps>(
+ ({ children, className, ...props }, ref) => {
+ return (
+ <div ref={ref} className={cn('border-t', className, chartTableClasses)} {...props}>
+ {children}
+ </div>
+ )
+ }
+)
+ChartFooter.displayName = 'ChartFooter'
+
+/* Metric Chart Components */
+interface ChartValueDifferentialProps extends React.HTMLAttributes<HTMLDivElement> {
+ variant?: 'positive' | 'negative' | 'default'
+}
+
+const ChartValueDifferential = React.forwardRef<HTMLDivElement, ChartValueDifferentialProps>(
+ ({ className, variant = 'default', ...props }, ref) => {
+ const { isLoading } = useChart()
+
+ if (isLoading) {
+ return <Skeleton className="w-16 h-5" />
+ }
+
+ return (
+ <span
+ ref={ref}
+ className={cn(
+ variant === 'positive'
+ ? 'text-brand'
+ : variant === 'negative'
+ ? 'text-destructive'
+ : 'text-foreground-light',
+ 'tabular-nums text-sm',
+ className
+ )}
+ {...props}
+ />
+ )
+ }
+)
+ChartValueDifferential.displayName = 'ChartValueDifferential'
+
+const ChartSparklineTooltip = ({ active, payload, label }: RechartsTooltipProps<any, any>) => {
+ if (!active || !payload || !payload.length) return null
+
+ const formatTimestamp = (timestamp: string) => {
+ const date = dayjs(timestamp)
+ const hour = date.hour()
+ const period = hour >= 12 ? 'pm' : 'am'
+ const displayHour = hour % 12 || 12
+
+ return `${date.format('MMM D')}, ${displayHour}${period}`
+ }
+
+ return (
+ <div className="bg-black/90 text-white p-2 rounded text-xs">
+ {label && (
+ <div className="dark:text-foreground-light text-white/60">
+ {formatTimestamp(payload[0].payload.timestamp)}
+ </div>
+ )}
+ <div>{payload[0].value.toLocaleString(undefined, { maximumFractionDigits: 0 })}</div>
+ </div>
+ )
+}
+
+interface ChartSparklineProps extends React.HTMLAttributes<HTMLDivElement> {
+ data?: Array<{ value: number; [key: string]: any }>
+ dataKey?: string
+ className?: string
+}
+
+const ChartSparkline = React.forwardRef<HTMLDivElement, ChartSparklineProps>(
+ ({ className, data, dataKey, ...props }, ref) => {
+ if (!data || data.length === 0) {
+ return null
+ }
+
+ return (
+ <div ref={ref} className={cn('w-full h-24 pt-4 relative', className)} {...props}>
+ <ResponsiveContainer width="100%" height="100%" className="relative">
+ <AreaChart data={data} margin={{ top: 5, left: 0, right: 0, bottom: 0 }}>
+ <defs>
+ <linearGradient id="sparklineGradient" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="hsl(var(--brand-default))" stopOpacity={0.8} />
+ <stop offset="95%" stopColor="hsl(var(--brand-default))" stopOpacity={0} />
+ </linearGradient>
+ </defs>
+ <RechartsTooltip content={<ChartSparklineTooltip />} />
+ <Area
+ type="step"
+ dataKey={dataKey || 'value'}
+ fill="url(#sparklineGradient)"
+ fillOpacity={0.1}
+ stroke="hsl(var(--brand-default))"
+ strokeWidth={1.5}
+ />
+ </AreaChart>
+ </ResponsiveContainer>
+ </div>
+ )
+ }
+)
+ChartSparkline.displayName = 'ChartSparkline'
+
+/* Exports */
+export {
+ Chart,
+ ChartCard,
+ ChartHeader,
+ ChartTitle,
+ ChartActions,
+ ChartMetric,
+ ChartContent,
+ ChartEmptyState,
+ ChartLoadingState,
+ ChartDisabledState,
+ ChartFooter,
+ ChartValueDifferential,
+ ChartSparklineTooltip,
+ ChartSparkline,
+}
+export { ChartBar, type ChartBarTick, type ChartBarProps } from './charts/chart-bar'
+export { ChartLine, type ChartLineTick, type ChartLineProps } from './charts/chart-line'
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9477b821c8a..e397f47d747 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -266,7 +266,7 @@ importers:
next-contentlayer2:
specifier: 0.4.6
next-themes:
specifier: ^0.3.0
@@ -417,7 +417,7 @@ importers:
'@sentry/nextjs':
specifier: 'catalog:'
'@supabase/supabase-js':
specifier: 'catalog:'
version: 2.87.0
@@ -1415,7 +1415,7 @@ importers:
next-contentlayer2:
specifier: 0.4.6
next-themes:
specifier: ^0.3.0
@@ -1599,7 +1599,7 @@ importers:
'@sentry/nextjs':
specifier: 'catalog:'
'@supabase/supabase-js':
specifier: 'catalog:'
version: 2.87.0
@@ -2462,6 +2462,9 @@ importers:
'@monaco-editor/react':
specifier: ^4.6.0
+ '@radix-ui/react-slot':
+ specifier: ^1.2.4
+ version: 1.2.4(@types/[email protected])([email protected])
'@radix-ui/react-visually-hidden':
specifier: ^1.1.3
@@ -7321,6 +7324,15 @@ packages:
'@types/react':
optional: true
+ '@radix-ui/[email protected]':
+ resolution: {integrity: sha512-Jl+bCv8HxKnlTLVrcDE8zTMJ09R9/ukw4qBs/oZClOfoQk/cOTbDn+NceXfV7j09YPVQUryJPHurafcSg6EVKA==}
+ 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-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow==}
peerDependencies:
@@ -25741,6 +25753,13 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.3
+ dependencies:
+ '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
+ react: 18.3.1
+ optionalDependencies:
+ '@types/react': 18.3.3
+
dependencies:
'@babel/runtime': 7.26.10
@@ -26672,7 +26691,7 @@ snapshots:
'@sentry/[email protected]': {}
dependencies:
'@opentelemetry/api': 1.9.0
'@opentelemetry/semantic-conventions': 1.38.0
@@ -35396,7 +35415,7 @@ snapshots:
dependencies:
'@contentlayer2/utils': 0.4.3