{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-01",
  "type": "registry:block",
  "title": "Dashboard with Revenue and Customers",
  "description": "A dashboard with revenue and customers block.",
  "author": "ephraim duncan <https://ephraimduncan.com>",
  "registryDependencies": [
    "avatar",
    "button",
    "chart",
    "dialog",
    "dropdown-menu",
    "field",
    "input",
    "input-group",
    "popover",
    "progress",
    "separator",
    "sidebar",
    "table",
    "toggle-group"
  ],
  "dependencies": [
    "date-fns",
    "lucide-react",
    "recharts"
  ],
  "files": [
    {
      "path": "content/components/dashboard/dashboard-01/dashboard-sidebar.tsx",
      "type": "registry:component",
      "target": "components/dashboard-01/dashboard-sidebar.tsx",
      "content": "'use client';\n\nimport {\n  ArrowLeftRight,\n  BriefcaseBusiness,\n  ChartNoAxesCombined,\n  Check,\n  ChevronDown,\n  CircleHelp,\n  CirclePlus,\n  CreditCard,\n  LayoutDashboard,\n  Moon,\n  Settings,\n  Users,\n} from 'lucide-react';\nimport { useState } from 'react';\nimport { Button } from '@/components/ui/button';\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from '@/components/ui/dialog';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Field, FieldGroup, FieldLabel } from '@/components/ui/field';\nimport { Input } from '@/components/ui/input';\nimport { Progress } from '@/components/ui/progress';\nimport {\n  Sidebar,\n  SidebarContent,\n  SidebarFooter,\n  SidebarGroup,\n  SidebarGroupLabel,\n  SidebarHeader,\n  SidebarMenu,\n  SidebarMenuButton,\n  SidebarMenuItem,\n  useSidebar,\n} from '@/components/ui/sidebar';\nimport { cn } from '@/lib/utils';\n\nexport function DashboardSidebar() {\n  const { isMobile, setOpenMobile, state } = useSidebar();\n  const [workspaces, setWorkspaces] = useState([\n    'Lumen Labs',\n    'Halcyon Studio',\n    'Pinecrest Co.',\n  ]);\n  const [workspace, setWorkspace] = useState('Lumen Labs');\n  const [creating, setCreating] = useState(false);\n  const [name, setName] = useState('');\n\n  return (\n    <>\n      <Sidebar collapsible=\"icon\">\n        <SidebarHeader className=\"px-3 pt-3.5 pb-5\">\n          <SidebarMenu>\n            <SidebarMenuItem>\n              <DropdownMenu>\n                <DropdownMenuTrigger\n                  render={\n                    <SidebarMenuButton\n                      aria-label={`${workspace}, switch workspace`}\n                      className=\"h-9 gap-2 rounded-lg px-2 font-medium group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0!\"\n                    />\n                  }\n                >\n                  <span className=\"flex size-5 shrink-0 items-center justify-center rounded-[5px] bg-blue-500 font-semibold text-[0.6875rem] text-white\">\n                    {workspace.slice(0, 1)}\n                  </span>\n                  <span className=\"flex-1 truncate group-data-[collapsible=icon]:hidden\">\n                    {workspace}\n                  </span>\n                  <ChevronDown className=\"text-muted-foreground group-data-[collapsible=icon]:hidden\" />\n                </DropdownMenuTrigger>\n                <DropdownMenuContent\n                  className={cn(\n                    'rounded-[10px] p-1.5',\n                    state === 'collapsed' && !isMobile\n                      ? 'w-56'\n                      : 'w-(--anchor-width)'\n                  )}\n                  side={state === 'collapsed' && !isMobile ? 'right' : 'bottom'}\n                  sideOffset={8}\n                >\n                  <DropdownMenuGroup>\n                    <DropdownMenuLabel className=\"px-2.5 py-2\">\n                      Workspaces\n                    </DropdownMenuLabel>\n                    {workspaces.map((item, index) => (\n                      <DropdownMenuItem\n                        className={cn(\n                          'min-h-9 gap-2.5 px-2.5',\n                          item === workspace && 'bg-accent'\n                        )}\n                        key={item}\n                        onClick={() => setWorkspace(item)}\n                      >\n                        <span\n                          className={cn(\n                            'flex size-5 shrink-0 items-center justify-center rounded-[5px] font-semibold text-[0.6875rem]',\n                            index === 0\n                              ? 'bg-blue-500 text-white'\n                              : 'bg-muted text-muted-foreground'\n                          )}\n                        >\n                          {item.slice(0, 1)}\n                        </span>\n                        <span className=\"flex-1 truncate\">{item}</span>\n                        {item === workspace && <Check aria-label=\"Selected\" />}\n                      </DropdownMenuItem>\n                    ))}\n                  </DropdownMenuGroup>\n                  <DropdownMenuSeparator />\n                  <DropdownMenuGroup>\n                    <DropdownMenuItem\n                      className=\"min-h-9 gap-2.5 px-2.5\"\n                      onClick={() => setCreating(true)}\n                    >\n                      <CirclePlus />\n                      Create workspace\n                    </DropdownMenuItem>\n                  </DropdownMenuGroup>\n                </DropdownMenuContent>\n              </DropdownMenu>\n            </SidebarMenuItem>\n          </SidebarMenu>\n        </SidebarHeader>\n        <SidebarContent>\n          <SidebarGroup className=\"px-3 py-0\">\n            <SidebarGroupLabel className=\"px-2.5 text-[0.6875rem] tracking-wider\">\n              WORKSPACE\n            </SidebarGroupLabel>\n            <SidebarMenu className=\"gap-0.5\">\n              {navigation.map((item) => (\n                <SidebarMenuItem\n                  className={\n                    item.label === 'Overview'\n                      ? 'before:-left-3 before:absolute before:top-2.5 before:h-4 before:w-0.75 before:rounded-r-sm before:bg-blue-500'\n                      : undefined\n                  }\n                  key={item.label}\n                >\n                  <SidebarMenuButton\n                    className=\"h-9 gap-2.5 rounded-lg px-2.5\"\n                    isActive={item.label === 'Overview'}\n                    onClick={() => setOpenMobile(false)}\n                    render={\n                      <a aria-label={item.label} href={item.href}>\n                        <item.icon\n                          aria-hidden=\"true\"\n                          className={\n                            item.label === 'Overview'\n                              ? undefined\n                              : 'text-muted-foreground'\n                          }\n                        />\n                        <span className=\"flex-1 group-data-[collapsible=icon]:hidden\">\n                          {item.label}\n                        </span>\n                        {item.label === 'Customers' && (\n                          <div className=\"rounded-full bg-muted px-1.5 text-[0.6875rem] text-muted-foreground tabular-nums group-data-[collapsible=icon]:hidden\">\n                            12\n                          </div>\n                        )}\n                      </a>\n                    }\n                    tooltip={item.label}\n                  />\n                </SidebarMenuItem>\n              ))}\n            </SidebarMenu>\n          </SidebarGroup>\n        </SidebarContent>\n        <SidebarFooter className=\"gap-3 px-3 pb-5\">\n          <SidebarMenu className=\"gap-0.5\">\n            <SidebarMenuItem>\n              <DropdownMenu>\n                <DropdownMenuTrigger\n                  render={\n                    <SidebarMenuButton\n                      aria-label=\"Settings\"\n                      className=\"h-9 gap-2.5 rounded-lg px-2.5\"\n                      tooltip=\"Settings\"\n                    />\n                  }\n                >\n                  <Settings className=\"text-muted-foreground\" />\n                  <span className=\"group-data-[collapsible=icon]:hidden\">\n                    Settings\n                  </span>\n                </DropdownMenuTrigger>\n                <DropdownMenuContent\n                  className=\"w-64 rounded-[10px] p-1.5\"\n                  side=\"top\"\n                  sideOffset={8}\n                >\n                  <DropdownMenuGroup>\n                    <DropdownMenuItem\n                      className=\"min-h-9 gap-2.5 px-2.5\"\n                      render={\n                        <a\n                          aria-label=\"Company profile\"\n                          href=\"/settings/company\"\n                        >\n                          <BriefcaseBusiness />\n                          Company profile\n                        </a>\n                      }\n                    />\n                    <DropdownMenuItem\n                      className=\"min-h-9 gap-2.5 px-2.5\"\n                      render={\n                        <a aria-label=\"Team\" href=\"/settings/team\">\n                          <Users />\n                          Team\n                        </a>\n                      }\n                    />\n                    <DropdownMenuItem\n                      className=\"min-h-9 gap-2.5 px-2.5\"\n                      render={\n                        <a aria-label=\"Billing\" href=\"/settings/billing\">\n                          <CreditCard />\n                          Billing\n                        </a>\n                      }\n                    />\n                    <DropdownMenuItem\n                      className=\"min-h-9 gap-2.5 px-2.5\"\n                      closeOnClick={false}\n                      onClick={() =>\n                        document.documentElement.classList.toggle('dark')\n                      }\n                    >\n                      <Moon />\n                      <span className=\"flex-1\">Appearance</span>\n                      <div className=\"text-muted-foreground text-xs\">\n                        <span className=\"dark:hidden\">Light</span>\n                        <span className=\"not-dark:hidden\">Dark</span>\n                      </div>\n                    </DropdownMenuItem>\n                  </DropdownMenuGroup>\n                </DropdownMenuContent>\n              </DropdownMenu>\n            </SidebarMenuItem>\n            <SidebarMenuItem>\n              <SidebarMenuButton\n                className=\"h-9 gap-2.5 rounded-lg px-2.5\"\n                render={\n                  <a\n                    aria-label=\"Help and support\"\n                    href=\"mailto:support@lumenlabs.io\"\n                  >\n                    <CircleHelp className=\"text-muted-foreground\" />\n                    <span className=\"group-data-[collapsible=icon]:hidden\">\n                      Help &amp; support\n                    </span>\n                  </a>\n                }\n                tooltip=\"Help and support\"\n              />\n            </SidebarMenuItem>\n          </SidebarMenu>\n          <div className=\"flex flex-col gap-3 rounded-[10px] border border-border bg-background p-3 group-data-[collapsible=icon]:hidden dark:border-input dark:bg-input/30\">\n            <div className=\"flex items-center justify-between text-[0.8125rem]\">\n              <span className=\"font-medium\">Monthly volume</span>\n              <div className=\"text-[0.8125rem] text-muted-foreground tabular-nums\">\n                72%\n              </div>\n            </div>\n            <Progress\n              aria-label=\"Monthly volume used\"\n              className=\"[&_[data-slot=progress-indicator]]:bg-blue-500 [&_[data-slot=progress-track]]:bg-border\"\n              value={72.4}\n            />\n            <p className=\"text-muted-foreground text-xs tabular-nums\">\n              $72,400 of $100,000 used\n            </p>\n          </div>\n        </SidebarFooter>\n      </Sidebar>\n      <Dialog onOpenChange={setCreating} open={creating}>\n        <DialogContent>\n          <form\n            className=\"flex flex-col gap-5\"\n            onSubmit={(event) => {\n              event.preventDefault();\n              const nextName = name.trim();\n              if (!nextName) {\n                return;\n              }\n              if (!workspaces.includes(nextName)) {\n                setWorkspaces([...workspaces, nextName]);\n              }\n              setWorkspace(nextName);\n              setName('');\n              setCreating(false);\n            }}\n          >\n            <DialogHeader>\n              <DialogTitle>Create workspace</DialogTitle>\n              <DialogDescription>\n                Add a workspace to this dashboard preview.\n              </DialogDescription>\n            </DialogHeader>\n            <FieldGroup>\n              <Field>\n                <FieldLabel htmlFor=\"workspace-name\">Workspace name</FieldLabel>\n                <Input\n                  autoComplete=\"organization\"\n                  id=\"workspace-name\"\n                  maxLength={60}\n                  name=\"workspace-name\"\n                  onChange={(event) => setName(event.target.value)}\n                  pattern=\".*\\S.*\"\n                  required\n                  value={name}\n                />\n              </Field>\n            </FieldGroup>\n            <DialogFooter>\n              <Button\n                onClick={() => setCreating(false)}\n                type=\"button\"\n                variant=\"outline\"\n              >\n                Cancel\n              </Button>\n              <Button type=\"submit\">Create workspace</Button>\n            </DialogFooter>\n          </form>\n        </DialogContent>\n      </Dialog>\n    </>\n  );\n}\n\nconst navigation = [\n  { label: 'Overview', href: '#overview', icon: LayoutDashboard },\n  { label: 'Customers', href: '#customers', icon: Users },\n  { label: 'Transactions', href: '/transactions', icon: ArrowLeftRight },\n  { label: 'Payouts', href: '/payouts', icon: CreditCard },\n  { label: 'Reports', href: '#revenue', icon: ChartNoAxesCombined },\n];\n"
    },
    {
      "path": "content/components/dashboard/dashboard-01/app/page.tsx",
      "type": "registry:page",
      "target": "app/page.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\nimport { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';\nimport { cn } from '@/lib/utils';\nimport { CustomersTable } from '@/components/dashboard-01/customers-table';\nimport { DashboardCharts } from '@/components/dashboard-01/dashboard-charts';\nimport { DashboardHeader } from '@/components/dashboard-01/dashboard-header';\nimport { DashboardSidebar } from '@/components/dashboard-01/dashboard-sidebar';\n\nexport default function Page() {\n  const [period, setPeriod] = useState<'day' | 'week' | 'month' | 'year'>(\n    'week'\n  );\n  const [range, setRange] = useState({ from: '2025-11-10', to: '2025-11-16' });\n\n  const bindTheme = (node: HTMLElement | null) => {\n    if (!node) {\n      return;\n    }\n    const onKey = (event: KeyboardEvent) => {\n      const target = event.target as HTMLElement;\n      if (\n        event.key === 'D' &&\n        event.shiftKey &&\n        !target.isContentEditable &&\n        !['INPUT', 'TEXTAREA', 'SELECT'].includes(target.tagName)\n      ) {\n        document.documentElement.classList.toggle('dark');\n      }\n    };\n    window.addEventListener('keydown', onKey);\n    return () => window.removeEventListener('keydown', onKey);\n  };\n\n  return (\n    <SidebarProvider\n      className=\"isolate min-h-dvh bg-background font-sans text-foreground antialiased [--chart-1:#3b82f6] [--chart-2:#d4d4d8] [--font-sans:system-ui,sans-serif] [--sidebar-width-icon:3.5rem]! [--sidebar-width:15.5rem]! **:data-[slot=sidebar-group-label]:transition-none **:data-[slot=sidebar-menu-button]:transition-none **:data-[slot=sidebar-container]:ease-[cubic-bezier(0.23,1,0.32,1)] **:data-[slot=sidebar-gap]:ease-[cubic-bezier(0.23,1,0.32,1)] dark:[--chart-2:#3f3f46] dark:[--sidebar-accent:#1a1a1a] dark:[--sidebar:#0d0d0d]\"\n      defaultOpen={false}\n    >\n      <a\n        className=\"sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50 focus:rounded-lg focus:bg-background focus:p-3\"\n        href=\"#overview\"\n      >\n        Skip to dashboard\n      </a>\n      <DashboardSidebar />\n      <SidebarInset className=\"min-w-0\" id=\"overview\" ref={bindTheme}>\n        <DashboardHeader\n          onPeriodChange={setPeriod}\n          onRangeChange={setRange}\n          period={period}\n          range={range}\n        />\n        <div className=\"@container/metrics border-b\">\n          <dl className=\"grid @3xl/metrics:grid-cols-4 grid-cols-2\">\n            {metrics.map((metric) => (\n              <div\n                className=\"flex min-w-0 flex-col justify-center gap-2 border-b @3xl/metrics:border-b-0 @3xl/metrics:not-first:border-l @3xl/metrics:px-7 px-4 py-6 even:border-l [&:nth-last-child(-n+2)]:border-b-0\"\n                key={metric.label}\n              >\n                <dt className=\"truncate text-muted-foreground text-sm sm:text-[0.9375rem]\">\n                  {metric.label}\n                </dt>\n                <dd className=\"flex flex-wrap items-baseline gap-2.5\">\n                  <span className=\"font-semibold text-[1.75rem] tabular-nums tracking-tight\">\n                    {metric.value}\n                  </span>\n                  <span\n                    className={cn(\n                      'font-medium text-[0.8125rem] tabular-nums',\n                      metric.changeClass\n                    )}\n                  >\n                    {metric.change}\n                  </span>\n                </dd>\n              </div>\n            ))}\n          </dl>\n        </div>\n        <DashboardCharts from={range.from} period={period} to={range.to} />\n        <CustomersTable />\n      </SidebarInset>\n    </SidebarProvider>\n  );\n}\n\nconst metrics = [\n  {\n    label: 'New customers',\n    value: '1,284',\n    change: '+8.2%',\n    changeClass: 'text-green-600 dark:text-green-400',\n  },\n  {\n    label: 'Success rate',\n    value: '97.4%',\n    change: '+0.6%',\n    changeClass: 'text-green-600 dark:text-green-400',\n  },\n  {\n    label: 'Failure rate',\n    value: '2.6%',\n    change: '-0.6%',\n    changeClass: 'text-red-600 dark:text-red-400',\n  },\n  {\n    label: 'Refunds',\n    value: '38',\n    change: '0.0%',\n    changeClass: 'text-muted-foreground',\n  },\n];\n"
    },
    {
      "path": "content/components/dashboard/dashboard-01/customers-table.tsx",
      "type": "registry:component",
      "target": "components/dashboard-01/customers-table.tsx",
      "content": "'use client';\n\nimport {\n  DownloadIcon,\n  EllipsisIcon,\n  EyeIcon,\n  FunnelIcon,\n  MailIcon,\n  SearchIcon,\n  XIcon,\n} from 'lucide-react';\nimport { useState } from 'react';\nimport { Button } from '@/components/ui/button';\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from '@/components/ui/dialog';\nimport {\n  DropdownMenu,\n  DropdownMenuCheckboxItem,\n  DropdownMenuContent,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport {\n  InputGroup,\n  InputGroupAddon,\n  InputGroupInput,\n  InputGroupText,\n} from '@/components/ui/input-group';\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from '@/components/ui/table';\nimport { cn } from '@/lib/utils';\n\nconst easeOut = 'ease-[cubic-bezier(0.23,1,0.32,1)]';\nconst press = `${easeOut} transition-[scale,background-color] duration-150 active:scale-[0.96] motion-reduce:active:scale-100`;\nconst swap = `${easeOut} fade-in zoom-in-95 motion-reduce:zoom-in-100 animate-in duration-150`;\n\nexport function CustomersTable() {\n  const [query, setQuery] = useState('');\n  const [selected, setSelected] = useState<Record<Facet, readonly string[]>>({\n    Plan: [],\n    Status: [],\n  });\n  const [page, setPage] = useState(1);\n  const [customer, setCustomer] = useState<Customer | null>(null);\n\n  const bindSearch = (node: HTMLInputElement | null) => {\n    if (!node) {\n      return;\n    }\n\n    const focusSearch = (event: KeyboardEvent) => {\n      if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k') {\n        event.preventDefault();\n        node.focus();\n      }\n    };\n    window.addEventListener('keydown', focusSearch);\n    return () => window.removeEventListener('keydown', focusSearch);\n  };\n\n  const term = query.trim().toLocaleLowerCase();\n  const filtered = customers.filter(\n    (item) =>\n      (!term ||\n        item.name.toLocaleLowerCase().includes(term) ||\n        item.email.toLocaleLowerCase().includes(term)) &&\n      (!selected.Plan.length || selected.Plan.includes(item.plan)) &&\n      (!selected.Status.length || selected.Status.includes(item.status))\n  );\n\n  const pageCount = Math.max(1, Math.ceil(filtered.length / 9));\n  const visibleCustomers = filtered.slice((page - 1) * 9, page * 9);\n  const filterCount = selected.Plan.length + selected.Status.length;\n  const toggle = (facet: Facet, option: string) => {\n    setSelected((current) => ({\n      ...current,\n      [facet]: current[facet].includes(option)\n        ? current[facet].filter((item) => item !== option)\n        : [...current[facet], option],\n    }));\n    setPage(1);\n  };\n  const clear = (facet?: Facet) => {\n    setSelected((current) =>\n      facet ? { ...current, [facet]: [] } : { Plan: [], Status: [] }\n    );\n    setPage(1);\n  };\n\n  const exportCustomers = () => {\n    const csv = [\n      ['Customer', 'Email', 'Signed up', 'Plan', 'Status'],\n      ...filtered.map((item) => [\n        item.name,\n        item.email,\n        item.signedUp,\n        item.plan,\n        item.status,\n      ]),\n    ]\n      .map((row) =>\n        row.map((value) => `\"${value.replaceAll('\"', '\"\"')}\"`).join(',')\n      )\n      .join('\\n');\n    const url = URL.createObjectURL(\n      new Blob([csv], { type: 'text/csv;charset=utf-8' })\n    );\n    const link = document.createElement('a');\n    link.href = url;\n    link.download = 'customers.csv';\n    link.click();\n    URL.revokeObjectURL(url);\n  };\n\n  return (\n    <section className=\"@container/customers w-full\" id=\"customers\">\n      <div className=\"flex @3xl/customers:flex-row flex-col @3xl/customers:items-center @3xl/customers:justify-between gap-4 p-4 sm:p-7 sm:py-6\">\n        <div>\n          <h2 className=\"font-semibold text-[18px] leading-6\">New customers</h2>\n          <p className=\"mt-1 text-[13px] text-muted-foreground\">\n            Recent signups across all plans\n          </p>\n        </div>\n        <div className=\"flex min-w-0 flex-1 flex-wrap items-center @3xl/customers:justify-end gap-2\">\n          {filterCount > 0 && (\n            <fieldset\n              aria-label=\"Active customer filters\"\n              className=\"flex flex-wrap items-center gap-2\"\n            >\n              {facets.map(\n                (facet) =>\n                  selected[facet].length > 0 && (\n                    <div\n                      className={cn(\n                        swap,\n                        'flex h-7 items-center rounded-md bg-muted pl-2 text-[0.8125rem]'\n                      )}\n                      key={facet}\n                    >\n                      <DropdownMenu>\n                        <DropdownMenuTrigger\n                          render={\n                            <button\n                              className=\"flex h-full max-w-56 items-center gap-1 rounded-l-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50\"\n                              type=\"button\"\n                            />\n                          }\n                        >\n                          <span className=\"text-muted-foreground\">\n                            {facet}:\n                          </span>\n                          <span className=\"truncate font-medium\">\n                            {selected[facet].join(', ')}\n                          </span>\n                        </DropdownMenuTrigger>\n                        <DropdownMenuContent className=\"w-44 rounded-[10px] p-1.5\">\n                          <DropdownMenuGroup>\n                            {options[facet].map((option) => (\n                              <DropdownMenuCheckboxItem\n                                checked={selected[facet].includes(option)}\n                                className=\"min-h-9 px-2.5\"\n                                closeOnClick={false}\n                                key={option}\n                                onCheckedChange={() => toggle(facet, option)}\n                              >\n                                {option}\n                              </DropdownMenuCheckboxItem>\n                            ))}\n                          </DropdownMenuGroup>\n                        </DropdownMenuContent>\n                      </DropdownMenu>\n                      <button\n                        aria-label={`Remove ${facet.toLowerCase()} filter`}\n                        className=\"flex h-full w-6 items-center justify-center rounded-r-md text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50\"\n                        onClick={() => clear(facet)}\n                        type=\"button\"\n                      >\n                        <XIcon aria-hidden=\"true\" className=\"size-3.5\" />\n                      </button>\n                    </div>\n                  )\n              )}\n              <Button\n                onClick={() => clear()}\n                size=\"sm\"\n                type=\"button\"\n                variant=\"ghost\"\n              >\n                Clear all\n              </Button>\n            </fieldset>\n          )}\n          <label className=\"sr-only\" htmlFor=\"customer-search\">\n            Search customers\n          </label>\n          <InputGroup className=\"h-9 @3xl/customers:w-60 w-full border-border bg-background dark:border-input\">\n            <InputGroupAddon>\n              <InputGroupText>\n                <SearchIcon aria-hidden=\"true\" />\n              </InputGroupText>\n            </InputGroupAddon>\n            <InputGroupInput\n              className=\"text-[16px] sm:text-sm\"\n              id=\"customer-search\"\n              name=\"customer-search\"\n              onChange={(event) => {\n                setQuery(event.target.value);\n                setPage(1);\n              }}\n              placeholder=\"Search customers\"\n              ref={bindSearch}\n              type=\"search\"\n              value={query}\n            />\n            <InputGroupAddon align=\"inline-end\">\n              <kbd className=\"hidden rounded border bg-muted px-1.5 py-0.5 font-medium text-[10px] sm:block\">\n                ⌘K\n              </kbd>\n            </InputGroupAddon>\n          </InputGroup>\n          <div className=\"flex gap-2\">\n            <DropdownMenu>\n              <DropdownMenuTrigger\n                render={\n                  <Button\n                    className={cn(press, 'h-9 flex-1 sm:flex-none')}\n                    size=\"lg\"\n                    variant=\"outline\"\n                  />\n                }\n              >\n                <FunnelIcon aria-hidden=\"true\" />\n                Filter{filterCount ? ` (${filterCount})` : ''}\n              </DropdownMenuTrigger>\n              <DropdownMenuContent align=\"end\" className=\"w-48\">\n                {facets.map((facet, index) => (\n                  <DropdownMenuGroup key={facet}>\n                    {index > 0 && <DropdownMenuSeparator />}\n                    <DropdownMenuLabel>{facet}</DropdownMenuLabel>\n                    {options[facet].map((option) => (\n                      <DropdownMenuCheckboxItem\n                        checked={selected[facet].includes(option)}\n                        key={option}\n                        onCheckedChange={() => toggle(facet, option)}\n                      >\n                        {option}\n                      </DropdownMenuCheckboxItem>\n                    ))}\n                  </DropdownMenuGroup>\n                ))}\n                {filterCount > 0 && (\n                  <>\n                    <DropdownMenuSeparator />\n                    <DropdownMenuGroup>\n                      <DropdownMenuItem onClick={() => clear()}>\n                        Clear filters\n                      </DropdownMenuItem>\n                    </DropdownMenuGroup>\n                  </>\n                )}\n              </DropdownMenuContent>\n            </DropdownMenu>\n            <Button\n              className={cn(press, 'h-9 flex-1 sm:flex-none')}\n              onClick={exportCustomers}\n              size=\"lg\"\n              variant=\"outline\"\n            >\n              <DownloadIcon aria-hidden=\"true\" />\n              Export\n            </Button>\n          </div>\n        </div>\n      </div>\n\n      <div className=\"border-t\">\n        <Table className=\"min-w-245 table-fixed [&_td:first-child]:pl-4 sm:[&_td:first-child]:pl-7 [&_td:last-child]:pr-4 sm:[&_td:last-child]:pr-7 [&_th:first-child]:pl-4 sm:[&_th:first-child]:pl-7 [&_th:last-child]:pr-4 sm:[&_th:last-child]:pr-7\">\n          <colgroup>\n            <col className=\"w-[27%]\" />\n            <col className=\"w-[23%]\" />\n            <col className=\"w-[18%]\" />\n            <col className=\"w-[12%]\" />\n            <col className=\"w-[calc(20%-68px)]\" />\n            <col className=\"w-17\" />\n          </colgroup>\n          <TableHeader>\n            <TableRow className=\"h-11 hover:bg-transparent\">\n              <TableHead className=\"px-2 text-muted-foreground text-xs\">\n                Customer\n              </TableHead>\n              <TableHead className=\"px-2 text-muted-foreground text-xs\">\n                Email\n              </TableHead>\n              <TableHead className=\"px-2 text-muted-foreground text-xs\">\n                Signed up\n              </TableHead>\n              <TableHead className=\"px-2 text-muted-foreground text-xs\">\n                Plan\n              </TableHead>\n              <TableHead className=\"px-2 text-muted-foreground text-xs\">\n                Status\n              </TableHead>\n              <TableHead>\n                <span className=\"sr-only\">Actions</span>\n              </TableHead>\n            </TableRow>\n          </TableHeader>\n          <TableBody>\n            {visibleCustomers.map((item) => (\n              <TableRow className=\"h-14\" key={item.email}>\n                <TableCell className=\"px-2 py-0 font-medium text-sm\">\n                  {item.name}\n                </TableCell>\n                <TableCell className=\"px-2 py-0 text-muted-foreground text-sm\">\n                  {item.email}\n                </TableCell>\n                <TableCell className=\"px-2 py-0 text-muted-foreground text-sm\">\n                  {item.signedUp}\n                </TableCell>\n                <TableCell className=\"px-2 py-0 text-sm\">{item.plan}</TableCell>\n                <TableCell className=\"px-2 py-0\">\n                  <StatusDot status={item.status} />\n                </TableCell>\n                <TableCell className=\"px-0 py-0 text-right\">\n                  <DropdownMenu>\n                    <DropdownMenuTrigger\n                      render={\n                        <Button\n                          aria-label={`Actions for ${item.name}`}\n                          size=\"icon-sm\"\n                          variant=\"ghost\"\n                        />\n                      }\n                    >\n                      <EllipsisIcon aria-hidden=\"true\" />\n                    </DropdownMenuTrigger>\n                    <DropdownMenuContent\n                      align=\"end\"\n                      className=\"w-60 rounded-[10px] p-1.5\"\n                      sideOffset={6}\n                    >\n                      <DropdownMenuGroup>\n                        <DropdownMenuLabel className=\"flex flex-col gap-1 px-2.5 py-2\">\n                          <div className=\"truncate font-medium text-foreground text-sm\">\n                            {item.name}\n                          </div>\n                          <div className=\"truncate font-normal text-xs\">\n                            {item.email}\n                          </div>\n                        </DropdownMenuLabel>\n                      </DropdownMenuGroup>\n                      <DropdownMenuSeparator />\n                      <DropdownMenuGroup>\n                        <DropdownMenuItem\n                          className=\"min-h-9 gap-2.5 px-2.5\"\n                          onClick={() => setCustomer(item)}\n                        >\n                          <EyeIcon\n                            aria-hidden=\"true\"\n                            className=\"text-muted-foreground\"\n                          />\n                          View customer\n                        </DropdownMenuItem>\n                        <DropdownMenuItem\n                          className=\"min-h-9 gap-2.5 px-2.5\"\n                          render={\n                            <a\n                              aria-label={`Send email to ${item.name}`}\n                              href={`mailto:${item.email}`}\n                            >\n                              <MailIcon\n                                aria-hidden=\"true\"\n                                className=\"text-muted-foreground\"\n                              />\n                              Send email\n                            </a>\n                          }\n                        />\n                      </DropdownMenuGroup>\n                    </DropdownMenuContent>\n                  </DropdownMenu>\n                </TableCell>\n              </TableRow>\n            ))}\n            {!visibleCustomers.length && (\n              <TableRow className=\"h-28 hover:bg-transparent\">\n                <TableCell\n                  className=\"text-center text-muted-foreground text-sm\"\n                  colSpan={6}\n                >\n                  No customers match your search and filters.\n                </TableCell>\n              </TableRow>\n            )}\n          </TableBody>\n        </Table>\n      </div>\n\n      <div className=\"flex flex-col gap-3 border-t p-4 sm:flex-row sm:items-center sm:justify-between sm:px-7\">\n        <p aria-live=\"polite\" className=\"text-[13px] text-muted-foreground\">\n          {filtered.length\n            ? `${(page - 1) * 9 + 1}–${Math.min(page * 9, filtered.length)} of ${filtered.length} customers`\n            : '0 customers'}\n        </p>\n        <nav aria-label=\"Customer pages\" className=\"flex items-center gap-1\">\n          <Button\n            disabled={page === 1}\n            onClick={() => setPage((current) => Math.max(1, current - 1))}\n            size=\"sm\"\n            variant=\"outline\"\n          >\n            Previous\n          </Button>\n          {Array.from({ length: pageCount }, (_, index) => index + 1).map(\n            (number) => (\n              <Button\n                aria-current={page === number ? 'page' : undefined}\n                key={number}\n                onClick={() => setPage(number)}\n                size=\"icon-sm\"\n                variant={page === number ? 'secondary' : 'ghost'}\n              >\n                {number}\n              </Button>\n            )\n          )}\n          <Button\n            disabled={page === pageCount}\n            onClick={() =>\n              setPage((current) => Math.min(pageCount, current + 1))\n            }\n            size=\"sm\"\n            variant=\"outline\"\n          >\n            Next\n          </Button>\n        </nav>\n      </div>\n\n      <Dialog\n        onOpenChange={(open) => {\n          if (!open) {\n            setCustomer(null);\n          }\n        }}\n        open={customer !== null}\n      >\n        <DialogContent className=\"sm:max-w-md\">\n          {customer && (\n            <>\n              <DialogHeader>\n                <DialogTitle>{customer.name}</DialogTitle>\n                <DialogDescription>\n                  Customer details and signup information.\n                </DialogDescription>\n              </DialogHeader>\n              <dl className=\"grid grid-cols-[88px_1fr] gap-x-4 gap-y-3 text-sm\">\n                <dt className=\"text-muted-foreground\">Email</dt>\n                <dd className=\"min-w-0 break-all\">{customer.email}</dd>\n                <dt className=\"text-muted-foreground\">Signed up</dt>\n                <dd>{customer.signedUp}</dd>\n                <dt className=\"text-muted-foreground\">Plan</dt>\n                <dd>{customer.plan}</dd>\n                <dt className=\"text-muted-foreground\">Status</dt>\n                <dd>\n                  <StatusDot status={customer.status} />\n                </dd>\n              </dl>\n              <DialogFooter>\n                <Button\n                  render={\n                    <a\n                      aria-label={`Contact ${customer.name}`}\n                      href={`mailto:${customer.email}`}\n                    >\n                      <MailIcon aria-hidden=\"true\" />\n                      Contact customer\n                    </a>\n                  }\n                />\n              </DialogFooter>\n            </>\n          )}\n        </DialogContent>\n      </Dialog>\n    </section>\n  );\n}\n\nfunction StatusDot({ status }: { readonly status: Status }) {\n  return (\n    <span className=\"inline-flex items-center gap-2 text-sm\">\n      <span\n        aria-hidden=\"true\"\n        className={cn('size-1.5 rounded-full', statusDots[status])}\n      />\n      {status}\n    </span>\n  );\n}\n\ntype Plan = 'Starter' | 'Pro' | 'Team';\ntype Status = 'Active' | 'Pending' | 'Under review' | 'Rejected' | 'Inactive';\n\ntype Customer = {\n  readonly name: string;\n  readonly email: string;\n  readonly signedUp: string;\n  readonly plan: Plan;\n  readonly status: Status;\n};\n\nconst customers: readonly Customer[] = [\n  {\n    name: 'Priya Raman',\n    email: 'priya.raman@lumenlabs.io',\n    signedUp: 'Today, 9:12 AM',\n    plan: 'Pro',\n    status: 'Active',\n  },\n  {\n    name: 'Daniel Okafor',\n    email: 'd.okafor@fastmail.com',\n    signedUp: 'Today, 8:40 AM',\n    plan: 'Starter',\n    status: 'Pending',\n  },\n  {\n    name: 'Mei Lin Chen',\n    email: 'meilin@outlook.com',\n    signedUp: 'Yesterday, 6:05 PM',\n    plan: 'Team',\n    status: 'Active',\n  },\n  {\n    name: 'Tomás Herrera',\n    email: 'tomas.h@gmail.com',\n    signedUp: 'Yesterday, 2:31 PM',\n    plan: 'Pro',\n    status: 'Under review',\n  },\n  {\n    name: 'Aisha Bello',\n    email: 'aisha.bello@proton.me',\n    signedUp: '11 Nov, 4:18 PM',\n    plan: 'Starter',\n    status: 'Rejected',\n  },\n  {\n    name: 'Lucas Moreau',\n    email: 'l.moreau@yahoo.fr',\n    signedUp: '11 Nov, 11:02 AM',\n    plan: 'Team',\n    status: 'Active',\n  },\n  {\n    name: 'Hannah Weiss',\n    email: 'hannah.w@gmail.com',\n    signedUp: '10 Nov, 7:44 PM',\n    plan: 'Pro',\n    status: 'Pending',\n  },\n  {\n    name: 'Kenji Sato',\n    email: 'kenji.sato@icloud.com',\n    signedUp: '10 Nov, 3:15 PM',\n    plan: 'Starter',\n    status: 'Inactive',\n  },\n  {\n    name: 'Olivia Brooks',\n    email: 'olivia@brooks.studio',\n    signedUp: '9 Nov, 10:27 AM',\n    plan: 'Team',\n    status: 'Active',\n  },\n  {\n    name: 'Sofia Alvarez',\n    email: 'sofia@northstar.co',\n    signedUp: '9 Nov, 8:16 AM',\n    plan: 'Pro',\n    status: 'Active',\n  },\n  {\n    name: 'Marcus Johnson',\n    email: 'marcus.j@hey.com',\n    signedUp: '8 Nov, 5:42 PM',\n    plan: 'Team',\n    status: 'Under review',\n  },\n  {\n    name: 'Elena Petrova',\n    email: 'elena@kinetic.design',\n    signedUp: '8 Nov, 1:20 PM',\n    plan: 'Starter',\n    status: 'Pending',\n  },\n  {\n    name: 'Noah Williams',\n    email: 'noah@fieldnotes.app',\n    signedUp: '7 Nov, 4:55 PM',\n    plan: 'Pro',\n    status: 'Active',\n  },\n  {\n    name: 'Fatima Zahra',\n    email: 'fatima.z@proton.me',\n    signedUp: '7 Nov, 11:09 AM',\n    plan: 'Team',\n    status: 'Active',\n  },\n  {\n    name: 'Ethan Park',\n    email: 'ethan.park@icloud.com',\n    signedUp: '6 Nov, 6:33 PM',\n    plan: 'Starter',\n    status: 'Inactive',\n  },\n  {\n    name: 'Amara Nwosu',\n    email: 'amara@woven.studio',\n    signedUp: '6 Nov, 2:08 PM',\n    plan: 'Pro',\n    status: 'Rejected',\n  },\n  {\n    name: 'Gabriel Silva',\n    email: 'gabriel@orbit.dev',\n    signedUp: '5 Nov, 9:47 AM',\n    plan: 'Team',\n    status: 'Active',\n  },\n  {\n    name: 'Leila Haddad',\n    email: 'leila.h@fastmail.com',\n    signedUp: '4 Nov, 3:26 PM',\n    plan: 'Starter',\n    status: 'Pending',\n  },\n];\n\ntype Facet = 'Plan' | 'Status';\nconst facets: readonly Facet[] = ['Plan', 'Status'];\nconst options: Record<Facet, readonly string[]> = {\n  Plan: ['Starter', 'Pro', 'Team'],\n  Status: ['Active', 'Pending', 'Under review', 'Rejected', 'Inactive'],\n};\n\nconst statusDots: Record<Status, string> = {\n  Active: 'bg-green-500',\n  Pending: 'bg-amber-500',\n  'Under review': 'bg-blue-500',\n  Rejected: 'bg-red-500',\n  Inactive: 'bg-muted-foreground/40',\n};\n"
    },
    {
      "path": "content/components/dashboard/dashboard-01/dashboard-header.tsx",
      "type": "registry:component",
      "target": "components/dashboard-01/dashboard-header.tsx",
      "content": "'use client';\n\nimport { format, parseISO } from 'date-fns';\nimport {\n  Bell,\n  CalendarDays,\n  ChartNoAxesCombined,\n  ChevronDown,\n  LockKeyhole,\n  LogOut,\n  Moon,\n  PanelLeftClose,\n  PanelLeftOpen,\n  Sun,\n  UserRound,\n} from 'lucide-react';\nimport { type ComponentProps, useState } from 'react';\nimport { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';\nimport { Button } from '@/components/ui/button';\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from '@/components/ui/dialog';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuGroup,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Field, FieldGroup, FieldLabel } from '@/components/ui/field';\nimport { Input } from '@/components/ui/input';\nimport {\n  Popover,\n  PopoverContent,\n  PopoverDescription,\n  PopoverTitle,\n  PopoverTrigger,\n} from '@/components/ui/popover';\nimport { Separator } from '@/components/ui/separator';\nimport { useSidebar } from '@/components/ui/sidebar';\nimport { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';\nimport { cn } from '@/lib/utils';\nimport type { DashboardCharts } from '@/components/dashboard-01/dashboard-charts';\n\ntype ChartOptions = ComponentProps<typeof DashboardCharts>;\ntype DateRange = Pick<ChartOptions, 'from' | 'to'>;\n\nconst press =\n  'ease-[cubic-bezier(0.23,1,0.32,1)] transition-[scale,background-color] duration-150 active:scale-[0.96] motion-reduce:active:scale-100';\n\nexport function DashboardHeader({\n  period,\n  range,\n  onPeriodChange,\n  onRangeChange,\n}: {\n  period: ChartOptions['period'];\n  range: DateRange;\n  onPeriodChange: (period: ChartOptions['period']) => void;\n  onRangeChange: (range: DateRange) => void;\n}) {\n  const { isMobile, openMobile, state, toggleSidebar } = useSidebar();\n  const sidebarOpen = isMobile ? openMobile : state === 'expanded';\n  const [customRange, setCustomRange] = useState<DateRange | null>(null);\n  const [unread, setUnread] = useState(true);\n  const [notificationsOpen, setNotificationsOpen] = useState(false);\n  const from = parseISO(range.from);\n  const to = parseISO(range.to);\n  const rangeLabel =\n    range.from === range.to\n      ? format(to, 'd MMM')\n      : `${format(from, from.getMonth() === to.getMonth() && from.getFullYear() === to.getFullYear() ? 'd' : 'd MMM')} – ${format(to, 'd MMM')}`;\n\n  return (\n    <>\n      <header className=\"flex min-h-15 flex-wrap items-center justify-between gap-3 border-b px-4 py-3 lg:px-7 lg:py-2\">\n        <div className=\"flex items-center gap-3\">\n          <Button\n            aria-expanded={sidebarOpen}\n            aria-label={sidebarOpen ? 'Collapse sidebar' : 'Expand sidebar'}\n            onClick={toggleSidebar}\n            size=\"icon-sm\"\n            type=\"button\"\n            variant=\"ghost\"\n          >\n            {sidebarOpen ? (\n              <PanelLeftClose aria-hidden=\"true\" />\n            ) : (\n              <PanelLeftOpen aria-hidden=\"true\" />\n            )}\n          </Button>\n          <h1 className=\"font-semibold text-lg tracking-tight\">Overview</h1>\n          <p className=\"text-[0.8125rem] text-muted-foreground max-sm:hidden\">\n            Updated 2 min ago\n          </p>\n        </div>\n        <div className=\"flex flex-wrap items-center gap-2 sm:gap-3\">\n          <ToggleGroup\n            aria-label=\"Chart period\"\n            className=\"rounded-[9px] border bg-muted/50 p-0.75\"\n            onValueChange={(values) => {\n              const next = periods.find((item) => item.value === values[0]);\n              if (!next) {\n                return;\n              }\n              onPeriodChange(next.value);\n              onRangeChange({ from: next.from, to: '2025-11-16' });\n            }}\n            size=\"sm\"\n            spacing={0.5}\n            value={[period]}\n          >\n            {periods.map((item) => (\n              <ToggleGroupItem\n                className=\"h-7 min-w-0 rounded-md px-3 text-[0.8125rem]\"\n                key={item.value}\n                value={item.value}\n              >\n                {item.label}\n              </ToggleGroupItem>\n            ))}\n          </ToggleGroup>\n          <DropdownMenu>\n            <DropdownMenuTrigger\n              render={\n                <Button\n                  aria-label={`Date range: ${rangeLabel}`}\n                  className={press}\n                  size=\"lg\"\n                  variant=\"outline\"\n                />\n              }\n            >\n              <CalendarDays data-icon=\"inline-start\" />\n              {rangeLabel}\n            </DropdownMenuTrigger>\n            <DropdownMenuContent\n              align=\"end\"\n              className=\"w-50 rounded-[10px] p-1.5\"\n            >\n              <DropdownMenuGroup>\n                <DropdownMenuLabel className=\"sr-only\">\n                  Date range\n                </DropdownMenuLabel>\n                <DropdownMenuRadioGroup\n                  onValueChange={(value) => {\n                    const next = ranges.find((item) => item.from === value);\n                    if (next) {\n                      onRangeChange({ from: next.from, to: '2025-11-16' });\n                    }\n                  }}\n                  value={range.to === '2025-11-16' ? range.from : ''}\n                >\n                  {ranges.map((item) => (\n                    <DropdownMenuRadioItem\n                      className=\"min-h-8.5 px-2.5\"\n                      key={item.label}\n                      value={item.from}\n                    >\n                      {item.label}\n                    </DropdownMenuRadioItem>\n                  ))}\n                </DropdownMenuRadioGroup>\n              </DropdownMenuGroup>\n              <DropdownMenuSeparator />\n              <DropdownMenuGroup>\n                <DropdownMenuItem\n                  className=\"min-h-8.5 px-2.5\"\n                  onClick={() => setCustomRange(range)}\n                >\n                  Custom range…\n                </DropdownMenuItem>\n              </DropdownMenuGroup>\n            </DropdownMenuContent>\n          </DropdownMenu>\n          <Separator className=\"h-5! max-sm:hidden\" orientation=\"vertical\" />\n          <Button\n            aria-label=\"Toggle dark mode\"\n            className={cn(press, 'relative')}\n            onClick={() => document.documentElement.classList.toggle('dark')}\n            size=\"icon-lg\"\n            title=\"Toggle dark mode (Shift+D)\"\n            type=\"button\"\n            variant=\"ghost\"\n          >\n            <Sun className=\"scale-100 opacity-100 transition-[opacity,scale] duration-150 ease-out dark:scale-50 dark:opacity-0\" />\n            <Moon className=\"absolute scale-50 opacity-0 transition-[opacity,scale] duration-150 ease-out dark:scale-100 dark:opacity-100\" />\n          </Button>\n          <Popover onOpenChange={setNotificationsOpen} open={notificationsOpen}>\n            <PopoverTrigger\n              render={\n                <Button\n                  aria-label={\n                    unread ? 'Notifications, unread updates' : 'Notifications'\n                  }\n                  className={cn(press, 'relative')}\n                  size=\"icon-lg\"\n                  variant=\"ghost\"\n                />\n              }\n            >\n              <Bell />\n              {unread && (\n                <span className=\"absolute top-2 right-2 size-1.5 rounded-full bg-blue-500 ring-2 ring-background\" />\n              )}\n            </PopoverTrigger>\n            <PopoverContent\n              align=\"end\"\n              className=\"w-90 max-w-[calc(100vw-2rem)] gap-0 overflow-hidden rounded-xl p-0\"\n              sideOffset={8}\n            >\n              <div className=\"flex h-13 items-center justify-between gap-3 border-b px-4\">\n                <PopoverTitle>Notifications</PopoverTitle>\n                <div className=\"text-muted-foreground text-xs tabular-nums\">\n                  {unread ? '2 unread' : 'All read'}\n                </div>\n                <PopoverDescription className=\"sr-only\">\n                  Recent workspace activity.\n                </PopoverDescription>\n              </div>\n              <Button\n                className=\"h-auto w-full items-start justify-start gap-3 whitespace-normal rounded-none p-4 text-left font-normal\"\n                onClick={() => setNotificationsOpen(false)}\n                render={\n                  <a href=\"#revenue\">\n                    <div className=\"flex size-9 shrink-0 items-center justify-center rounded-lg border bg-background\">\n                      <ChartNoAxesCombined\n                        aria-hidden=\"true\"\n                        className=\"size-4 text-muted-foreground\"\n                      />\n                    </div>\n                    <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n                      <div className=\"flex items-center justify-between gap-3 text-sm\">\n                        <span className=\"font-medium\">Weekly report</span>\n                        <time className=\"shrink-0 text-muted-foreground text-xs\">\n                          2m ago\n                        </time>\n                      </div>\n                      <p className=\"text-[0.8125rem] text-muted-foreground leading-5\">\n                        10–16 Nov · $42,910 in revenue\n                      </p>\n                      <p className=\"text-muted-foreground text-xs\">\n                        3,482 charges processed\n                      </p>\n                    </div>\n                    <span\n                      aria-hidden=\"true\"\n                      className={\n                        unread\n                          ? 'mt-1.5 size-1.5 shrink-0 rounded-full bg-blue-500'\n                          : 'mt-1.5 size-1.5 shrink-0'\n                      }\n                    />\n                  </a>\n                }\n                variant=\"ghost\"\n              />\n              <Separator />\n              <Button\n                className=\"h-auto w-full items-start justify-start gap-3 whitespace-normal rounded-none p-4 text-left font-normal\"\n                onClick={() => setNotificationsOpen(false)}\n                render={\n                  <a href=\"#customers\">\n                    <Avatar className=\"size-9 rounded-lg after:rounded-lg\">\n                      <AvatarImage\n                        alt=\"\"\n                        className=\"rounded-lg\"\n                        src=\"https://i.pravatar.cc/96?img=47\"\n                      />\n                      <AvatarFallback className=\"rounded-lg\">PR</AvatarFallback>\n                    </Avatar>\n                    <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n                      <div className=\"flex items-center justify-between gap-3 text-sm\">\n                        <span className=\"font-medium\">\n                          Priya Raman signed up\n                        </span>\n                        <time className=\"shrink-0 text-muted-foreground text-xs\">\n                          18m ago\n                        </time>\n                      </div>\n                      <p className=\"text-[0.8125rem] text-muted-foreground leading-5\">\n                        Joined Lumen Labs on the Pro plan.\n                      </p>\n                    </div>\n                    <span\n                      aria-hidden=\"true\"\n                      className={\n                        unread\n                          ? 'mt-1.5 size-1.5 shrink-0 rounded-full bg-blue-500'\n                          : 'mt-1.5 size-1.5 shrink-0'\n                      }\n                    />\n                  </a>\n                }\n                variant=\"ghost\"\n              />\n              <div className=\"flex items-center justify-end border-t px-3 py-2\">\n                <Button\n                  disabled={!unread}\n                  onClick={() => setUnread(false)}\n                  size=\"sm\"\n                  type=\"button\"\n                  variant=\"ghost\"\n                >\n                  Mark all as read\n                </Button>\n              </div>\n            </PopoverContent>\n          </Popover>\n          <DropdownMenu>\n            <DropdownMenuTrigger\n              render={\n                <Button\n                  aria-label=\"Account menu\"\n                  className={cn(press, 'gap-2 rounded-full pr-2.5 pl-1')}\n                  size=\"lg\"\n                  variant=\"outline\"\n                />\n              }\n            >\n              <Avatar className=\"size-7\">\n                <AvatarFallback className=\"bg-muted font-semibold text-[0.6875rem] text-foreground\">\n                  EB\n                </AvatarFallback>\n              </Avatar>\n              <ChevronDown data-icon=\"inline-end\" />\n            </DropdownMenuTrigger>\n            <DropdownMenuContent\n              align=\"end\"\n              className=\"w-60 rounded-[10px] p-1.5\"\n            >\n              <DropdownMenuGroup>\n                <DropdownMenuLabel className=\"flex flex-col gap-0.5 px-2.5 py-2\">\n                  <div className=\"font-medium text-foreground text-sm\">\n                    Ephraim Brooks\n                  </div>\n                  <div className=\"font-normal text-[0.8125rem]\">\n                    ephraim@lumenlabs.io\n                  </div>\n                </DropdownMenuLabel>\n              </DropdownMenuGroup>\n              <DropdownMenuSeparator />\n              <DropdownMenuGroup>\n                <DropdownMenuItem\n                  className=\"min-h-8.5 gap-2.5 px-2.5\"\n                  render={\n                    <a aria-label=\"Profile\" href=\"/settings/profile\">\n                      <UserRound />\n                      Profile\n                    </a>\n                  }\n                />\n                <DropdownMenuItem\n                  className=\"min-h-8.5 gap-2.5 px-2.5\"\n                  render={\n                    <a\n                      aria-label=\"Notifications\"\n                      href=\"/settings/notifications\"\n                    >\n                      <Bell />\n                      Notifications\n                    </a>\n                  }\n                />\n                <DropdownMenuItem\n                  className=\"min-h-8.5 gap-2.5 px-2.5\"\n                  render={\n                    <a aria-label=\"Security\" href=\"/settings/security\">\n                      <LockKeyhole />\n                      Security\n                    </a>\n                  }\n                />\n              </DropdownMenuGroup>\n              <DropdownMenuSeparator />\n              <DropdownMenuGroup>\n                <DropdownMenuItem\n                  className=\"min-h-8.5 gap-2.5 px-2.5\"\n                  render={\n                    <a aria-label=\"Log out\" href=\"/login\">\n                      <LogOut />\n                      Log out\n                    </a>\n                  }\n                  variant=\"destructive\"\n                />\n              </DropdownMenuGroup>\n            </DropdownMenuContent>\n          </DropdownMenu>\n        </div>\n      </header>\n      <Dialog\n        onOpenChange={(open) => {\n          if (!open) {\n            setCustomRange(null);\n          }\n        }}\n        open={customRange !== null}\n      >\n        <DialogContent>\n          {customRange && (\n            <form\n              className=\"flex flex-col gap-5\"\n              onSubmit={(event) => {\n                event.preventDefault();\n                if (\n                  customRange.from &&\n                  customRange.to &&\n                  customRange.from <= customRange.to\n                ) {\n                  onRangeChange(customRange);\n                  setCustomRange(null);\n                }\n              }}\n            >\n              <DialogHeader>\n                <DialogTitle>Custom date range</DialogTitle>\n                <DialogDescription>\n                  Choose the dates to include in your charts.\n                </DialogDescription>\n              </DialogHeader>\n              <FieldGroup>\n                <Field>\n                  <FieldLabel htmlFor=\"dashboard-from\">Start date</FieldLabel>\n                  <Input\n                    id=\"dashboard-from\"\n                    max={customRange.to}\n                    name=\"from\"\n                    onChange={(event) =>\n                      setCustomRange({\n                        ...customRange,\n                        from: event.target.value,\n                      })\n                    }\n                    required\n                    type=\"date\"\n                    value={customRange.from}\n                  />\n                </Field>\n                <Field>\n                  <FieldLabel htmlFor=\"dashboard-to\">End date</FieldLabel>\n                  <Input\n                    id=\"dashboard-to\"\n                    min={customRange.from}\n                    name=\"to\"\n                    onChange={(event) =>\n                      setCustomRange({ ...customRange, to: event.target.value })\n                    }\n                    required\n                    type=\"date\"\n                    value={customRange.to}\n                  />\n                </Field>\n              </FieldGroup>\n              <DialogFooter>\n                <Button\n                  onClick={() => setCustomRange(null)}\n                  type=\"button\"\n                  variant=\"outline\"\n                >\n                  Cancel\n                </Button>\n                <Button className={press} type=\"submit\">\n                  Apply range\n                </Button>\n              </DialogFooter>\n            </form>\n          )}\n        </DialogContent>\n      </Dialog>\n    </>\n  );\n}\n\nconst periods = [\n  { label: 'Day', value: 'day', from: '2025-11-16' },\n  { label: 'Week', value: 'week', from: '2025-11-10' },\n  { label: 'Month', value: 'month', from: '2025-10-18' },\n  { label: 'Year', value: 'year', from: '2025-01-01' },\n] as const;\n\nconst ranges = [\n  { label: 'Last 7 days', from: '2025-11-10' },\n  { label: 'Last 14 days', from: '2025-11-03' },\n  { label: 'Last 30 days', from: '2025-10-18' },\n  { label: 'This quarter', from: '2025-10-01' },\n  { label: 'Year to date', from: '2025-01-01' },\n];\n"
    },
    {
      "path": "content/components/dashboard/dashboard-01/dashboard-charts.tsx",
      "type": "registry:component",
      "target": "components/dashboard-01/dashboard-charts.tsx",
      "content": "'use client';\n\nimport { format, parseISO } from 'date-fns';\nimport {\n  Area,\n  CartesianGrid,\n  ComposedChart,\n  Line,\n  XAxis,\n  YAxis,\n} from 'recharts';\nimport {\n  type ChartConfig,\n  ChartContainer,\n  ChartTooltip,\n  ChartTooltipContent,\n} from '@/components/ui/chart';\nimport { cn } from '@/lib/utils';\n\nconst swap =\n  'ease-[cubic-bezier(0.23,1,0.32,1)] fade-in zoom-in-95 motion-reduce:zoom-in-100 animate-in duration-150';\n\nexport function DashboardCharts({\n  period,\n  from,\n  to,\n}: {\n  period: 'day' | 'week' | 'month' | 'year';\n  from: string;\n  to: string;\n}) {\n  const hourly = from === to;\n  const start = days.findIndex((day) => day.date >= from);\n  const current = days.filter((day) => day.date >= from && day.date <= to);\n  const prior = days.slice(start - current.length, start);\n  const data = hourly\n    ? hours(current[0], prior[0])\n    : current.map((day, index) => ({\n        date: day.date,\n        revenue: day.revenue,\n        priorRevenue: prior[index]?.revenue ?? 0,\n        charges: day.charges,\n        priorCharges: prior[index]?.charges ?? 0,\n      }));\n  const tickStep = Math.max(1, Math.ceil(data.length / 7));\n  const ticks = data\n    .filter((_, index) => index % tickStep === 0)\n    .map((row) => row.date);\n  const tickFormat = hourly ? 'ha' : data.length > 90 ? 'MMM' : 'd MMM';\n  const labelFormat = hourly ? 'EEE, d MMM, ha' : 'EEE, d MMM yyyy';\n\n  return (\n    <div className=\"@container/charts border-b\">\n      <div className=\"grid @4xl/charts:grid-cols-2\">\n        {panels.map((panel) => {\n          const total = data.reduce((sum, row) => sum + row[panel.current], 0);\n          const previous = data.reduce(\n            (sum, row) => sum + row[panel.previous],\n            0\n          );\n          const change = previous ? ((total - previous) / previous) * 100 : 0;\n          const config = {\n            [panel.current]: {\n              label: `This ${period}`,\n              color: 'var(--chart-1)',\n            },\n            [panel.previous]: {\n              label: `Last ${period}`,\n              color: 'var(--chart-2)',\n            },\n          } satisfies ChartConfig;\n\n          return (\n            <section\n              aria-labelledby={`${panel.id}-title`}\n              className=\"@container/panel flex min-h-100 min-w-0 flex-col gap-7 border-t @4xl/charts:border-t-0 @4xl/charts:not-first:border-l p-4 py-7 first:border-t-0 sm:px-7\"\n              id={panel.id}\n              key={panel.id}\n            >\n              <div className=\"relative flex flex-col gap-2\">\n                <h2\n                  className=\"text-[0.9375rem] text-muted-foreground\"\n                  id={`${panel.id}-title`}\n                >\n                  {panel.title}\n                </h2>\n                <div className=\"flex flex-wrap items-baseline gap-2.5\">\n                  <p className=\"font-semibold text-[1.75rem] tabular-nums tracking-tight\">\n                    {panel.currency ? '$' : ''}\n                    {total.toLocaleString('en-US')}\n                  </p>\n                  <p\n                    className={cn(\n                      'font-medium text-[0.8125rem] tabular-nums',\n                      change < 0\n                        ? 'text-red-600 dark:text-red-400'\n                        : 'text-green-600 dark:text-green-400'\n                    )}\n                  >\n                    {change > 0 ? '+' : ''}\n                    {change.toFixed(1)}%\n                  </p>\n                  <p className=\"text-[0.8125rem] text-muted-foreground\">\n                    vs. last {period}\n                  </p>\n                </div>\n                <div className=\"@lg/panel:absolute @lg/panel:top-1 @lg/panel:right-0 flex items-center gap-4 text-[0.8125rem]\">\n                  <div className=\"flex items-center gap-2\">\n                    <span\n                      aria-hidden=\"true\"\n                      className=\"h-0.75 w-2.5 rounded-full bg-chart-1\"\n                    />\n                    This {period}\n                  </div>\n                  <div className=\"flex items-center gap-2\">\n                    <span\n                      aria-hidden=\"true\"\n                      className=\"h-0.75 w-2.5 rounded-full bg-chart-2\"\n                    />\n                    Last {period}\n                  </div>\n                </div>\n              </div>\n              {data.length ? (\n                <ChartContainer\n                  className={cn(swap, 'aspect-auto h-63 w-full')}\n                  config={config}\n                  key={`${from}-${to}`}\n                >\n                  <ComposedChart\n                    accessibilityLayer\n                    data={data}\n                    margin={{ top: 8, right: 8, bottom: 0, left: 0 }}\n                  >\n                    <CartesianGrid\n                      stroke=\"var(--border)\"\n                      strokeDasharray=\"3 4\"\n                      vertical={false}\n                    />\n                    <XAxis\n                      axisLine={false}\n                      dataKey=\"date\"\n                      height={40}\n                      minTickGap={24}\n                      tickFormatter={(date: string) =>\n                        format(parseISO(date), tickFormat)\n                      }\n                      tickLine={false}\n                      tickMargin={16}\n                      ticks={ticks}\n                    />\n                    <YAxis\n                      axisLine={false}\n                      domain={[0, 'auto']}\n                      tickCount={4}\n                      tickFormatter={(value: number) =>\n                        `${panel.currency ? '$' : ''}${value >= 1000 ? `${value / 1000}k` : value}`\n                      }\n                      tickLine={false}\n                      tickMargin={8}\n                      width={48}\n                    />\n                    <ChartTooltip\n                      content={\n                        <ChartTooltipContent\n                          className=\"w-47.5 rounded-[10px] bg-popover px-3 py-2.5\"\n                          formatter={(value, name) => (\n                            <div className=\"flex w-full items-center gap-2\">\n                              <span\n                                aria-hidden=\"true\"\n                                className={cn(\n                                  'size-2 shrink-0 rounded-xs',\n                                  name === panel.current\n                                    ? 'bg-chart-1'\n                                    : 'bg-chart-2'\n                                )}\n                              />\n                              <span className=\"flex-1 text-muted-foreground\">\n                                {name === panel.current\n                                  ? `This ${period}`\n                                  : `Last ${period}`}\n                              </span>\n                              <span className=\"font-medium text-foreground tabular-nums\">\n                                {panel.currency ? '$' : ''}\n                                {Number(value).toLocaleString('en-US')}\n                              </span>\n                            </div>\n                          )}\n                          labelClassName=\"font-normal text-muted-foreground\"\n                          labelFormatter={(label) =>\n                            typeof label === 'string'\n                              ? format(parseISO(label), labelFormat)\n                              : label\n                          }\n                        />\n                      }\n                      cursor={{\n                        stroke: 'var(--chart-1)',\n                        strokeDasharray: '3 3',\n                      }}\n                    />\n                    <Area\n                      activeDot={false}\n                      dataKey={panel.current}\n                      fill=\"var(--chart-1)\"\n                      fillOpacity={0.1}\n                      isAnimationActive={false}\n                      stroke=\"none\"\n                      tooltipType=\"none\"\n                      type=\"linear\"\n                    />\n                    <Line\n                      activeDot={{\n                        r: 5,\n                        fill: 'var(--chart-1)',\n                        stroke: 'var(--background)',\n                        strokeWidth: 2,\n                      }}\n                      dataKey={panel.current}\n                      dot={data.length === 1}\n                      isAnimationActive={false}\n                      stroke=\"var(--chart-1)\"\n                      strokeWidth={2.5}\n                      type=\"linear\"\n                    />\n                    <Line\n                      activeDot={{\n                        r: 4,\n                        fill: 'var(--chart-2)',\n                        stroke: 'var(--background)',\n                        strokeWidth: 2,\n                      }}\n                      dataKey={panel.previous}\n                      dot={data.length === 1}\n                      isAnimationActive={false}\n                      stroke=\"var(--chart-2)\"\n                      strokeWidth={2}\n                      type=\"linear\"\n                    />\n                  </ComposedChart>\n                </ChartContainer>\n              ) : (\n                <p className=\"flex flex-1 items-center justify-center text-muted-foreground text-sm\">\n                  No data for this date range.\n                </p>\n              )}\n            </section>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n\nconst panels = [\n  {\n    id: 'revenue',\n    title: 'Revenue',\n    current: 'revenue',\n    previous: 'priorRevenue',\n    currency: true,\n  },\n  {\n    id: 'charges',\n    title: 'Charges',\n    current: 'charges',\n    previous: 'priorCharges',\n    currency: false,\n  },\n] as const;\n\ntype Day = { date: string; revenue: number; charges: number };\n\n// Seeded LCG so every render draws the same two years of demo data.\nlet seed = 20_251_116;\nconst random = () => {\n  seed = (Math.imul(seed, 1_664_525) + 1_013_904_223) >>> 0;\n  return seed / 2 ** 32;\n};\n\nconst days: Day[] = Array.from({ length: 731 }, (_, index) => {\n  const date = new Date(Date.UTC(2023, 10, 17 + index));\n  const growth = 1 + index / 731;\n  const weekend = date.getUTCDay() % 6 === 0 ? 0.62 : 1;\n  const season =\n    1 + 0.12 * Math.sin(((date.getUTCMonth() - 3) / 12) * Math.PI * 2);\n  const spike = random() < 0.04 ? 1.6 : 1;\n  const revenue = Math.round(\n    3400 * growth * weekend * season * spike * (0.82 + random() * 0.36)\n  );\n  return {\n    date: date.toISOString().slice(0, 10),\n    revenue,\n    charges: Math.round((revenue / 13.5) * (0.9 + random() * 0.2)),\n  };\n});\n\nconst activity = [\n  0.54, 0.46, 0.38, 0.35, 0.41, 0.58, 0.74, 0.97, 1.12, 1.38, 1.21, 1.53, 1.29,\n  1.41, 1.67, 1.48, 1.31, 1.58, 1.36, 1.19, 1.04, 0.86, 0.72, 0.63,\n];\n\n// Split a day's totals across 24 hours. Noise is keyed on the date so the\n// same day always draws the same curve, and the hourly shares sum to the day.\nfunction hours(day: Day | undefined, previous: Day | undefined) {\n  if (!(day && previous)) {\n    return [];\n  }\n  const weights = [day, previous].map((row) => {\n    const key = Number(row.date.replaceAll('-', ''));\n    const noisy = activity.map(\n      (weight, hour) =>\n        weight * (0.8 + 0.4 * ((Math.sin(key + hour * 7.31) + 1) / 2))\n    );\n    const total = noisy.reduce((sum, weight) => sum + weight, 0);\n    return noisy.map((weight) => weight / total);\n  });\n  let share = 0;\n  let priorShare = 0;\n  return activity.map((_, hour) => {\n    const from = share;\n    const priorFrom = priorShare;\n    share += weights[0][hour];\n    priorShare += weights[1][hour];\n    return {\n      date: `${day.date}T${String(hour).padStart(2, '0')}:00:00`,\n      revenue: Math.round(day.revenue * share) - Math.round(day.revenue * from),\n      priorRevenue:\n        Math.round(previous.revenue * priorShare) -\n        Math.round(previous.revenue * priorFrom),\n      charges: Math.round(day.charges * share) - Math.round(day.charges * from),\n      priorCharges:\n        Math.round(previous.charges * priorShare) -\n        Math.round(previous.charges * priorFrom),\n    };\n  });\n}\n"
    }
  ],
  "categories": [
    "dashboard"
  ]
}