{
  "title": "Analytics 1",
  "description": "A weekly audience growth statistics widget showcasing active readers and email leads, complete with a highlighted weekly bar chart.",
  "name": "app-analytics-1",
  "dependencies": [
    "recharts"
  ],
  "registryDependencies": [
    "card",
    "badge",
    "chart",
    "button",
    "dropdown-menu"
  ],
  "type": "registry:block",
  "files": [
    {
      "path": "components/blocks/app/analytics/analytics-1.tsx",
      "type": "registry:block",
      "content": "import { BookOpen, ChevronUp, Mail, MoreVertical, RefreshCw, Settings } from \"lucide-react\";\nimport { Bar, BarChart, Cell, XAxis } from \"recharts\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from \"@/components/ui/chart\";\nimport {\n    DropdownMenu,\n    DropdownMenuContent,\n    DropdownMenuItem,\n    DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\n\nconst chartConfig = {\n    normal: {\n        label: \"Subscribers\",\n        color: \"var(--chart-2)\",\n    },\n    highlighted: {\n        label: \"Peak Subscribers\",\n        color: \"var(--chart-1)\",\n    },\n} satisfies ChartConfig;\n\nconst chartData = [\n    { day: \"Mo\", value: 120 },\n    { day: \"Tu\", value: 150 },\n    { day: \"We\", value: 135 },\n    { day: \"Th\", value: 160 },\n    { day: \"Fr\", value: 245 },\n    { day: \"Sa\", value: 98 },\n    { day: \"Su\", value: 110 },\n];\n\nconst metrics = [\n    {\n        title: \"Active Readers\",\n        subtitle: \"Premium members\",\n        value: \"2,840\",\n        badgeText: \"14.2%\",\n        icon: BookOpen,\n    },\n    {\n        title: \"Newsletter Leads\",\n        subtitle: \"Email campaigns\",\n        value: \"918\",\n        badgeText: \"32.1%\",\n        icon: Mail,\n    },\n];\n\nexport const Analytics1 = () => {\n    return (\n        <Card className=\"gap-4\">\n            <CardHeader>\n                <CardTitle>Audience Growth</CardTitle>\n                <CardDescription>Weekly subscription trends</CardDescription>\n                <CardAction>\n                    <DropdownMenu>\n                        <DropdownMenuTrigger\n                            render={\n                                <Button variant=\"ghost\" size=\"icon-xs\" className=\"cursor-pointer\">\n                                    <MoreVertical className=\"size-4\" />\n                                </Button>\n                            }></DropdownMenuTrigger>\n                        <DropdownMenuContent align=\"end\" className=\"w-40\">\n                            <DropdownMenuItem className=\"cursor-pointer gap-2 text-xs\">\n                                <RefreshCw className=\"size-3.5\" />\n                                <span>Refresh</span>\n                            </DropdownMenuItem>\n                            <DropdownMenuItem className=\"cursor-pointer gap-2 text-xs\">\n                                <Settings className=\"size-3.5\" />\n                                <span>Settings</span>\n                            </DropdownMenuItem>\n                        </DropdownMenuContent>\n                    </DropdownMenu>\n                </CardAction>\n            </CardHeader>\n            <CardContent className=\"space-y-4\">\n                <div className=\"bg-muted/40 grid grid-cols-[1fr_auto] items-center gap-4 rounded-md border px-4 py-2.5\">\n                    <div className=\"grid gap-0.5\">\n                        <p className=\"text-3xl font-medium tracking-tight\">3,758</p>\n                        <p className=\"text-muted-foreground text-xs\">Total weekly active subscribers</p>\n                    </div>\n                    <Badge variant=\"outline\">\n                        <ChevronUp className=\"size-3\" />\n                        <span>+18.4%</span>\n                    </Badge>\n                </div>\n                <div className=\"grid gap-4\">\n                    {metrics.map((item, idx) => {\n                        const IconComponent = item.icon;\n                        return (\n                            <div key={idx} className=\"grid grid-cols-[1fr_auto] items-center gap-4\">\n                                <div className=\"flex items-center gap-3\">\n                                    <div className={`bg-muted flex size-10 items-center justify-center rounded-md`}>\n                                        <IconComponent className=\"size-5\" />\n                                    </div>\n                                    <div className=\"grid gap-0.5\">\n                                        <span className=\"text-sm font-medium\">{item.title}</span>\n                                        <span className=\"text-muted-foreground text-xs\">{item.subtitle}</span>\n                                    </div>\n                                </div>\n                                <div className=\"flex items-center gap-2\">\n                                    <span className=\"text-sm font-medium\">{item.value}</span>\n                                    <Badge>\n                                        <ChevronUp className=\"size-3\" />\n                                        <span>{item.badgeText}</span>\n                                    </Badge>\n                                </div>\n                            </div>\n                        );\n                    })}\n                </div>\n                <div className=\"h-36 w-full\">\n                    <ChartContainer config={chartConfig} className=\"h-full w-full\">\n                        <BarChart data={chartData} margin={{ top: 0, right: 0, left: 0, bottom: 0 }}>\n                            <XAxis\n                                dataKey=\"day\"\n                                tickLine={false}\n                                axisLine={false}\n                                tickMargin={8}\n                                className=\"text-muted-foreground text-xs\"\n                            />\n                            <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n                            <Bar dataKey=\"value\" radius={[4, 4, 0, 0]}>\n                                {chartData.map((entry, index) => (\n                                    <Cell\n                                        key={entry.day}\n                                        fill={index === 4 ? \"var(--color-highlighted)\" : \"var(--color-normal)\"}\n                                        className=\"cursor-pointer\"\n                                    />\n                                ))}\n                            </Bar>\n                        </BarChart>\n                    </ChartContainer>\n                </div>\n            </CardContent>\n        </Card>\n    );\n};\n"
    },
    {
      "path": "hooks/use-mobile.ts",
      "type": "registry:hook",
      "content": "import { useEffect, useState } from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n    const [isMobile, setIsMobile] = useState<boolean | undefined>(undefined);\n\n    useEffect(() => {\n        const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n        const onChange = () => {\n            setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n        };\n        mql.addEventListener(\"change\", onChange);\n        setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n        return () => mql.removeEventListener(\"change\", onChange);\n    }, []);\n\n    return !!isMobile;\n}\n"
    }
  ],
  "mcp": {
    "description": "A weekly audience growth statistics widget showcasing active readers and email leads, complete with a highlighted weekly bar chart. Relies on card, badge, chart, button, dropdown-menu. Ideal when an AI agent needs to compose section layouts or application views.",
    "tags": [
      "block",
      "application",
      "analytics"
    ]
  }
}