mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
Major documentation reorganization and improvements: ## Documentation Cleanup - Deleted 13 old status/report MD files from root - Moved old reports to docs/archive/ for reference - Removed USAGE.md, WHITE_LABEL.md, TESTING_GUIDE.md - Now only 9 essential MD files at root (LLM.md, README.md, etc.) ## New Comprehensive Documentation Created in app/content/docs/ (visible on ui.hanzo.ai): ### Frameworks (/docs/frameworks/) - Multi-framework overview and comparison - React guide (8KB) - hooks, Next.js, TypeScript - Vue guide (4.6KB) - Composition API, Nuxt ### Packages (/docs/packages/) - Complete package documentation (6.3KB) - @hanzo/ui, @hanzo/auth, @hanzo/commerce, @hanzo/brand ### Testing (/docs/testing/) - Comprehensive testing guide (7.6KB) - Unit, E2E, visual regression, accessibility - Vitest, Playwright, CI/CD examples ### White-Label (/docs/white-label/) - Fork and rebrand guide (6.4KB) - Publishing, deployment, syncing with upstream ## Navigation & UX Improvements - Updated sidebar navigation with 4 new sections - Added comprehensive footer with quick links - 4-column footer: Getting Started, Frameworks, Resources, Community - Version number in footer (v5.0.0) ## Technical Fixes - Fixed build:registry workspace references (www,v4 → app) - Removed deprecated prettier import order options - Updated site config with version and Discord link ## Updated Documentation - README.md - Concise, feature-rich overview - LLM.md - Documentation structure rules and recent updates - All 175 MDX files accessible and building correctly Deployment ready for ui.hanzo.ai
178 lines
5.3 KiB
TypeScript
178 lines
5.3 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { CalendarIcon } from "lucide-react"
|
|
import { DateRange } from "react-day-picker"
|
|
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts"
|
|
|
|
import { Button } from "@/registry/default/ui/button"
|
|
import { Calendar } from "@/registry/default/ui/calendar"
|
|
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardFooter,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from "@/registry/default/ui/card"
|
|
import {
|
|
ChartConfig,
|
|
ChartContainer,
|
|
ChartTooltip,
|
|
ChartTooltipContent,
|
|
} from "@/registry/default/ui/chart"
|
|
import {
|
|
Popover,
|
|
PopoverContent,
|
|
PopoverTrigger,
|
|
} from "@/registry/default/ui/popover"
|
|
|
|
const chartData = [
|
|
{ date: "2025-06-01", visitors: 178 },
|
|
{ date: "2025-06-02", visitors: 470 },
|
|
{ date: "2025-06-03", visitors: 103 },
|
|
{ date: "2025-06-04", visitors: 439 },
|
|
{ date: "2025-06-05", visitors: 88 },
|
|
{ date: "2025-06-06", visitors: 294 },
|
|
{ date: "2025-06-07", visitors: 323 },
|
|
{ date: "2025-06-08", visitors: 385 },
|
|
{ date: "2025-06-09", visitors: 438 },
|
|
{ date: "2025-06-10", visitors: 155 },
|
|
{ date: "2025-06-11", visitors: 92 },
|
|
{ date: "2025-06-12", visitors: 492 },
|
|
{ date: "2025-06-13", visitors: 81 },
|
|
{ date: "2025-06-14", visitors: 426 },
|
|
{ date: "2025-06-15", visitors: 307 },
|
|
{ date: "2025-06-16", visitors: 371 },
|
|
{ date: "2025-06-17", visitors: 475 },
|
|
{ date: "2025-06-18", visitors: 107 },
|
|
{ date: "2025-06-19", visitors: 341 },
|
|
{ date: "2025-06-20", visitors: 408 },
|
|
{ date: "2025-06-21", visitors: 169 },
|
|
{ date: "2025-06-22", visitors: 317 },
|
|
{ date: "2025-06-23", visitors: 480 },
|
|
{ date: "2025-06-24", visitors: 132 },
|
|
{ date: "2025-06-25", visitors: 141 },
|
|
{ date: "2025-06-26", visitors: 434 },
|
|
{ date: "2025-06-27", visitors: 448 },
|
|
{ date: "2025-06-28", visitors: 149 },
|
|
{ date: "2025-06-29", visitors: 103 },
|
|
{ date: "2025-06-30", visitors: 446 },
|
|
]
|
|
|
|
const total = chartData.reduce((acc, curr) => acc + curr.visitors, 0)
|
|
|
|
const chartConfig = {
|
|
visitors: {
|
|
label: "Visitors",
|
|
color: "hsl(var(--primary))",
|
|
},
|
|
} satisfies ChartConfig
|
|
|
|
export default function Calendar27() {
|
|
const [range, setRange] = React.useState<DateRange | undefined>({
|
|
from: new Date(2025, 5, 5),
|
|
to: new Date(2025, 5, 20),
|
|
})
|
|
const filteredData = React.useMemo(() => {
|
|
if (!range?.from && !range?.to) {
|
|
return chartData
|
|
}
|
|
|
|
return chartData.filter((item) => {
|
|
const date = new Date(item.date)
|
|
return date >= range.from! && date <= range.to!
|
|
})
|
|
}, [range])
|
|
|
|
return (
|
|
<Card className="@container/card w-full max-w-xl">
|
|
<CardHeader className="@md/card:grid relative flex flex-col border-b">
|
|
<CardTitle>Web Analytics</CardTitle>
|
|
<CardDescription>
|
|
Showing total visitors for this month.
|
|
</CardDescription>
|
|
<Popover>
|
|
<PopoverTrigger asChild>
|
|
<Button variant="outline" className="absolute right-4 top-4">
|
|
<CalendarIcon />
|
|
{range?.from && range?.to
|
|
? `${range.from.toLocaleDateString()} - ${range.to.toLocaleDateString()}`
|
|
: "June 2025"}
|
|
</Button>
|
|
</PopoverTrigger>
|
|
<PopoverContent className="w-auto overflow-hidden p-0" align="end">
|
|
<Calendar
|
|
className="w-full"
|
|
mode="range"
|
|
defaultMonth={range?.from}
|
|
selected={range}
|
|
onSelect={setRange}
|
|
disableNavigation
|
|
startMonth={range?.from}
|
|
fixedWeeks
|
|
showOutsideDays
|
|
disabled={{
|
|
after: new Date(2025, 5, 31),
|
|
}}
|
|
/>
|
|
</PopoverContent>
|
|
</Popover>
|
|
</CardHeader>
|
|
<CardContent className="px-4">
|
|
<ChartContainer
|
|
config={chartConfig}
|
|
className="aspect-auto h-[250px] w-full"
|
|
>
|
|
<BarChart
|
|
accessibilityLayer
|
|
data={filteredData}
|
|
margin={{
|
|
left: 12,
|
|
right: 12,
|
|
}}
|
|
>
|
|
<CartesianGrid vertical={false} />
|
|
<XAxis
|
|
dataKey="date"
|
|
tickLine={false}
|
|
axisLine={false}
|
|
tickMargin={8}
|
|
minTickGap={20}
|
|
tickFormatter={(value) => {
|
|
const date = new Date(value)
|
|
return date.toLocaleDateString("en-US", {
|
|
day: "numeric",
|
|
})
|
|
}}
|
|
/>
|
|
<ChartTooltip
|
|
content={
|
|
<ChartTooltipContent
|
|
className="w-[150px]"
|
|
nameKey="visitors"
|
|
labelFormatter={(value) => {
|
|
return new Date(value).toLocaleDateString("en-US", {
|
|
month: "short",
|
|
day: "numeric",
|
|
year: "numeric",
|
|
})
|
|
}}
|
|
/>
|
|
}
|
|
/>
|
|
<Bar dataKey="visitors" fill={`var(--color-visitors)`} radius={4} />
|
|
</BarChart>
|
|
</ChartContainer>
|
|
</CardContent>
|
|
<CardFooter className="border-t pt-6">
|
|
<div className="text-sm">
|
|
You had{" "}
|
|
<span className="font-semibold">{total.toLocaleString()}</span>{" "}
|
|
visitors for the month of June.
|
|
</div>
|
|
</CardFooter>
|
|
</Card>
|
|
)
|
|
}
|