{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-header",
  "title": "Dashboard Header",
  "description": "A complete dashboard header: a top bar with a workspace switcher, tabs with a sliding underline, ⌘K search that expands in place with keyboard results, notifications with unread counts and mark all read, and an account menu, over a page header with a live status line, a date range control that updates a KPI strip, and export with progress.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/dashboard-header/dashboard-header.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\ntype Range = \"7d\" | \"30d\" | \"90d\" | \"12m\";\ntype Menu = null | \"ws\" | \"notif\" | \"user\" | \"search\" | \"nav\";\n\nexport interface DashboardHeaderProps {\n  user?: { name: string; email: string };\n  workspaces?: { id: string; name: string; plan: string; color: string }[];\n  tabs?: string[];\n  defaultRange?: Range;\n  onRangeChange?: (range: Range) => void;\n  onNavigate?: (tab: string) => void;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.36)\", bar: \"#0E0E0E\", card: \"#141414\", menu: \"#161616\", border: \"rgba(255,255,255,0.08)\", hover: \"rgba(255,255,255,0.06)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", green: \"#4ADE80\", red: \"#F87171\", accent: \"#60A5FA\", ring: \"rgba(245,244,241,0.6)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.4)\", bar: \"#FFFFFF\", card: \"#FFFFFF\", menu: \"#FFFFFF\", border: \"rgba(10,10,10,0.09)\", hover: \"rgba(10,10,10,0.05)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", green: \"#15803D\", red: \"#DC2626\", accent: \"#2563EB\", ring: \"rgba(10,10,10,0.5)\" },\n};\n\nconst WORKSPACES = [\n  { id: \"nexora\", name: \"Nexora\", plan: \"Team plan\", color: \"#6366F1\" },\n  { id: \"halden\", name: \"Halden Studio\", plan: \"Pro plan\", color: \"#10B981\" },\n  { id: \"personal\", name: \"Personal\", plan: \"Free\", color: \"#F59E0B\" },\n];\nconst TABS = [\"Overview\", \"Analytics\", \"Reports\", \"Customers\", \"Settings\"];\nconst RANGES: Range[] = [\"7d\", \"30d\", \"90d\", \"12m\"];\nconst KPIS: Record<Range, [string, string, number][]> = {\n  \"7d\": [[\"Revenue\", \"$18,420\", 4.2], [\"Active users\", \"3,912\", 2.1], [\"Churn\", \"0.8%\", -0.2]],\n  \"30d\": [[\"Revenue\", \"$76,105\", 8.6], [\"Active users\", \"12,480\", 5.4], [\"Churn\", \"1.1%\", -0.4]],\n  \"90d\": [[\"Revenue\", \"$221,930\", 12.3], [\"Active users\", \"18,206\", 9.8], [\"Churn\", \"1.3%\", 0.1]],\n  \"12m\": [[\"Revenue\", \"$842,600\", 31.5], [\"Active users\", \"24,770\", 22.6], [\"Churn\", \"1.2%\", -0.6]],\n};\nconst NOTIFS = [\n  { id: \"n1\", who: \"Daniel Reyes\", what: \"shared the Q4 revenue report\", when: \"4m\" },\n  { id: \"n2\", who: \"Billing\", what: \"invoice #2046 was paid\", when: \"1h\" },\n  { id: \"n3\", who: \"Mia Okafor\", what: \"mentioned you in Churn analysis\", when: \"3h\" },\n  { id: \"n4\", who: \"Security\", what: \"new sign-in from Berlin\", when: \"1d\" },\n];\nconst SEARCH = [\"Q4 revenue report\", \"Churn analysis\", \"Customers in Germany\", \"Weekly active users\", \"Invoice #2046\", \"Team settings\"];\n\nconst Icon = ({ d, size = 16 }: { d: string; size?: number }) => (\n  <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n    <path d={d} />\n  </svg>\n);\nconst I = {\n  search: \"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm9 2-3.5-3.5\",\n  bell: \"M6 9a6 6 0 1 1 12 0c0 6 2.5 8 2.5 8h-17S6 15 6 9Zm4 11a2 2 0 0 0 4 0\",\n  chev: \"m7 10 5 5 5-5\",\n  check: \"m5 12.5 4.5 4.5L19 7.5\",\n  plus: \"M12 5v14M5 12h14\",\n  menu: \"M4 7h16M4 12h16M4 17h16\",\n  down: \"M12 4v11m0 0-4-4m4 4 4-4M5 20h14\",\n};\n\nexport function DashboardHeader({ user = { name: \"Lena Brandt\", email: \"lena@nexora.io\" }, workspaces = WORKSPACES, tabs = TABS, defaultRange = \"30d\", onRangeChange, onNavigate, theme = \"dark\", className }: DashboardHeaderProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [ws, setWs] = React.useState(workspaces[0].id);\n  const [tab, setTab] = React.useState(tabs[0]);\n  const [range, setRange] = React.useState<Range>(defaultRange);\n  const [menu, setMenu] = React.useState<Menu>(null);\n  const [unread, setUnread] = React.useState<Record<string, boolean>>({ n1: true, n2: true, n3: true });\n  const [query, setQuery] = React.useState(\"\");\n  const [active, setActive] = React.useState(0);\n  const [exportState, setExportState] = React.useState<\"idle\" | \"busy\" | \"done\">(\"idle\");\n  const [toast, setToast] = React.useState<string | null>(null);\n  const rootRef = React.useRef<HTMLElement>(null);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const focusOnce = React.useCallback((el: HTMLElement | null) => el?.focus({ preventScroll: true }), []);\n\n  const current = workspaces.find((w) => w.id === ws)!;\n  const unreadCount = Object.values(unread).filter(Boolean).length;\n  const results = SEARCH.filter((s) => s.toLowerCase().includes(query.trim().toLowerCase())).slice(0, 5);\n\n  React.useEffect(() => {\n    const onKey = (e: KeyboardEvent) => {\n      if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"k\") {\n        e.preventDefault();\n        setMenu(\"search\");\n      } else if (e.key === \"Escape\") setMenu(null);\n    };\n    const onDown = (e: PointerEvent) => {\n      if (!rootRef.current?.contains(e.target as Node)) setMenu(null);\n    };\n    document.addEventListener(\"keydown\", onKey);\n    document.addEventListener(\"pointerdown\", onDown);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      document.removeEventListener(\"pointerdown\", onDown);\n    };\n  }, []);\n  React.useEffect(() => {\n    if (!toast) return;\n    const t = setTimeout(() => setToast(null), 2200);\n    return () => clearTimeout(t);\n  }, [toast]);\n  React.useEffect(\n    () => () => {\n      if (timer.current) clearTimeout(timer.current);\n    },\n    [],\n  );\n\n  const toggle = (m: Menu) => setMenu((cur) => (cur === m ? null : m));\n  const menuKeys = (e: React.KeyboardEvent<HTMLElement>) => {\n    if (![\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(e.key)) return;\n    const items = [...e.currentTarget.querySelectorAll<HTMLElement>(\"[role=menuitem], [role=menuitemradio]\")];\n    const i = items.indexOf(document.activeElement as HTMLElement);\n    e.preventDefault();\n    const n = e.key === \"Home\" ? 0 : e.key === \"End\" ? items.length - 1 : (i + (e.key === \"ArrowDown\" ? 1 : -1) + items.length) % items.length;\n    items[n]?.focus();\n  };\n  const pickRange = (r: Range) => {\n    setRange(r);\n    onRangeChange?.(r);\n  };\n  const pickTab = (t: string) => {\n    setTab(t);\n    setMenu(null);\n    onNavigate?.(t);\n  };\n  const runExport = () => {\n    setExportState(\"busy\");\n    timer.current = setTimeout(\n      () => {\n        setExportState(\"done\");\n        setToast(`Exported ${range} report as CSV`);\n        timer.current = setTimeout(() => setExportState(\"idle\"), 1600);\n      },\n      reduce ? 0 : 1200,\n    );\n  };\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.bar } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const iconBtn = cn(\"relative grid h-9 w-9 shrink-0 cursor-pointer place-items-center rounded-lg border-0 bg-transparent\", focus);\n  const btn = cn(\"flex h-9 shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-3.5 text-[13px] font-medium disabled:cursor-wait\", focus);\n  const pop = { initial: reduce ? false : { opacity: 0, y: -4, scale: 0.98 }, animate: { opacity: 1, y: 0, scale: 1 }, exit: reduce ? undefined : { opacity: 0, y: -4, scale: 0.98 }, transition: { duration: 0.14 } } as const;\n  const menuCls = \"absolute z-30 mt-2 rounded-xl border p-1.5 shadow-[0_16px_40px_-12px_rgba(0,0,0,0.55)]\";\n  const itemCls = cn(\"flex w-full cursor-pointer items-center gap-2.5 rounded-lg border-0 bg-transparent px-2.5 py-2 text-left text-[13px]\", focus, \"focus-visible:ring-offset-0\");\n  const tile = (w: (typeof workspaces)[number], size = 22) => (\n    <span className=\"grid shrink-0 place-items-center rounded-md text-[11px] font-semibold text-white\" style={{ width: size, height: size, background: w.color }} aria-hidden=\"true\">\n      {w.name[0]}\n    </span>\n  );\n  const avatar = (\n    <span className=\"grid h-8 w-8 place-items-center rounded-full text-[12px] font-semibold\" style={{ background: `${p.accent}2a`, color: p.accent }} aria-hidden=\"true\">\n      {user.name\n        .split(\" \")\n        .map((s) => s[0])\n        .join(\"\")}\n    </span>\n  );\n\n  return (\n    <header ref={rootRef} className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      {/* Top bar */}\n      <div className=\"relative flex h-14 items-center gap-1 border-b px-2 @[640px]:gap-2 @[640px]:px-4\" style={{ borderColor: p.border, background: p.bar }}>\n        <button type=\"button\" onClick={() => toggle(\"nav\")} aria-label=\"Open navigation\" aria-expanded={menu === \"nav\"} className={cn(iconBtn, \"@[860px]:hidden\")} style={{ color: p.text, ...ring }}>\n          <Icon d={I.menu} />\n        </button>\n\n        {/* Workspace switcher */}\n        <div className=\"relative\">\n          <button type=\"button\" onClick={() => toggle(\"ws\")} aria-haspopup=\"menu\" aria-expanded={menu === \"ws\"} className={cn(\"flex h-9 cursor-pointer items-center gap-2 rounded-lg border-0 bg-transparent px-2\", focus)} style={{ color: p.text, ...ring }}>\n            {tile(current)}\n            <span className=\"hidden max-w-[140px] truncate text-[13.5px] font-semibold @[480px]:inline\">{current.name}</span>\n            <span style={{ color: p.faint }}>\n              <Icon d={I.chev} size={14} />\n            </span>\n          </button>\n          <AnimatePresence>\n            {menu === \"ws\" && (\n              <motion.div key=\"ws\" role=\"menu\" aria-label=\"Workspaces\" onKeyDown={menuKeys} {...pop} className={cn(menuCls, \"left-0 w-64 origin-top-left\")} style={{ background: p.menu, borderColor: p.border }}>\n                <p className=\"m-0 px-2.5 pt-1.5 pb-1 text-[11px] font-medium tracking-[0.04em] uppercase\" style={{ color: p.faint }}>\n                  Workspaces\n                </p>\n                {workspaces.map((w, i) => (\n                  <button\n                    key={w.id}\n                    type=\"button\"\n                    role=\"menuitemradio\"\n                    aria-checked={ws === w.id}\n                    ref={i === 0 ? focusOnce : undefined}\n                    onClick={() => {\n                      setWs(w.id);\n                      setMenu(null);\n                      setToast(`Switched to ${w.name}`);\n                    }}\n                    className={cn(itemCls, \"hover:bg-[var(--h)]\")}\n                    style={{ color: p.text, [\"--h\" as string]: p.hover, ...ring }}\n                  >\n                    {tile(w, 26)}\n                    <span className=\"min-w-0 flex-1\">\n                      <span className=\"block truncate font-medium\">{w.name}</span>\n                      <span className=\"block text-[11.5px]\" style={{ color: p.faint }}>\n                        {w.plan}\n                      </span>\n                    </span>\n                    {ws === w.id && <Icon d={I.check} size={14} />}\n                  </button>\n                ))}\n                <div className=\"my-1 h-px\" style={{ background: p.border }} />\n                <button type=\"button\" role=\"menuitem\" onClick={() => { setMenu(null); setToast(\"Workspace setup opened\"); }} className={cn(itemCls, \"hover:bg-[var(--h)]\")} style={{ color: p.muted, [\"--h\" as string]: p.hover, ...ring }}>\n                  <Icon d={I.plus} size={14} /> Create workspace\n                </button>\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n\n        {/* Tabs */}\n        <nav aria-label=\"Main\" className=\"ml-2 hidden h-full items-stretch @[860px]:flex\">\n          {tabs.map((t) => (\n            <button key={t} type=\"button\" onClick={() => pickTab(t)} aria-current={tab === t ? \"page\" : undefined} className={cn(\"relative cursor-pointer border-0 bg-transparent px-3 text-[13.5px]\", focus, \"focus-visible:ring-inset\")} style={{ color: tab === t ? p.text : p.muted, fontWeight: tab === t ? 500 : 400, ...ring }}>\n              {t}\n              {tab === t && <motion.span layoutId={`${uid}-tab`} className=\"absolute inset-x-3 -bottom-px h-[2px] rounded-full\" style={{ background: p.on }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 520, damping: 40 }} />}\n            </button>\n          ))}\n        </nav>\n\n        <div className=\"ml-auto flex items-center gap-0.5 @[640px]:gap-1\">\n          {/* Search */}\n          <div className=\"relative\">\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              {menu === \"search\" ? (\n                <motion.div key=\"field\" initial={reduce ? false : { width: 36, opacity: 0.6 }} animate={{ width: \"var(--sw)\", opacity: 1 }} exit={reduce ? undefined : { width: 36, opacity: 0 }} transition={{ type: \"spring\", stiffness: 460, damping: 38 }} className=\"relative [--sw:200px] @[640px]:[--sw:280px]\">\n                  <span className=\"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2\" style={{ color: p.faint }}>\n                    <Icon d={I.search} size={15} />\n                  </span>\n                  <input\n                    ref={focusOnce}\n                    value={query}\n                    onChange={(e) => {\n                      setQuery(e.target.value);\n                      setActive(0);\n                    }}\n                    onKeyDown={(e) => {\n                      if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n                        e.preventDefault();\n                        setActive((a) => (a + (e.key === \"ArrowDown\" ? 1 : -1) + results.length) % Math.max(1, results.length));\n                      } else if (e.key === \"Enter\" && results[active]) {\n                        setToast(`Opened “${results[active]}”`);\n                        setMenu(null);\n                        setQuery(\"\");\n                      }\n                    }}\n                    placeholder=\"Search reports, people…\"\n                    role=\"combobox\"\n                    aria-expanded\n                    aria-controls={`${uid}-results`}\n                    aria-activedescendant={results[active] ? `${uid}-r${active}` : undefined}\n                    aria-label=\"Search\"\n                    className={cn(\"h-9 w-full rounded-lg border pr-3 pl-8 text-[13px]\", focus)}\n                    style={{ borderColor: p.border, background: p.card, color: p.text, ...ring }}\n                  />\n                </motion.div>\n              ) : (\n                <motion.button key=\"btn\" type=\"button\" onClick={() => setMenu(\"search\")} aria-label=\"Search (⌘K)\" className={cn(iconBtn, \"flex items-center justify-center @[640px]:w-auto @[640px]:gap-2 @[640px]:border @[640px]:px-2.5\")} style={{ color: p.muted, borderColor: p.border, ...ring }}>\n                  <Icon d={I.search} size={15} />\n                  <span className=\"hidden text-[12.5px] @[640px]:inline\">Search</span>\n                  <kbd className=\"hidden rounded border px-1 font-sans text-[10.5px] @[640px]:inline\" style={{ borderColor: p.border, color: p.faint }}>\n                    ⌘K\n                  </kbd>\n                </motion.button>\n              )}\n            </AnimatePresence>\n            <AnimatePresence>\n              {menu === \"search\" && (\n                <motion.ul key=\"res\" id={`${uid}-results`} role=\"listbox\" {...pop} className={cn(menuCls, \"right-0 m-0 w-[min(280px,80cqw)] list-none\")} style={{ background: p.menu, borderColor: p.border }}>\n                  {results.length ? (\n                    results.map((r, i) => (\n                      <li\n                        key={r}\n                        id={`${uid}-r${i}`}\n                        role=\"option\"\n                        aria-selected={i === active}\n                        onPointerEnter={() => setActive(i)}\n                        onClick={() => {\n                          setToast(`Opened “${r}”`);\n                          setMenu(null);\n                          setQuery(\"\");\n                        }}\n                        className=\"cursor-pointer rounded-lg px-2.5 py-2 text-[13px]\"\n                        style={{ background: i === active ? p.hover : \"transparent\", color: p.text }}\n                      >\n                        {r}\n                      </li>\n                    ))\n                  ) : (\n                    <li className=\"px-2.5 py-2 text-[13px]\" style={{ color: p.faint }}>\n                      No results\n                    </li>\n                  )}\n                </motion.ul>\n              )}\n            </AnimatePresence>\n          </div>\n\n          {/* Notifications */}\n          <div className=\"relative\">\n            <button type=\"button\" onClick={() => toggle(\"notif\")} aria-haspopup=\"menu\" aria-expanded={menu === \"notif\"} aria-label={`Notifications, ${unreadCount} unread`} className={iconBtn} style={{ color: p.text, ...ring }}>\n              <Icon d={I.bell} />\n              <AnimatePresence>\n                {unreadCount > 0 && (\n                  <motion.span key={unreadCount} initial={reduce ? false : { scale: 0.4 }} animate={{ scale: 1 }} exit={reduce ? undefined : { scale: 0 }} className=\"absolute top-1 right-1 grid h-4 min-w-4 place-items-center rounded-full px-1 text-[10px] font-semibold text-white\" style={{ background: p.red }}>\n                    {unreadCount}\n                  </motion.span>\n                )}\n              </AnimatePresence>\n            </button>\n            <AnimatePresence>\n              {menu === \"notif\" && (\n                <motion.div key=\"notif\" role=\"menu\" aria-label=\"Notifications\" onKeyDown={menuKeys} {...pop} className={cn(menuCls, \"right-0 w-[min(320px,86cqw)] origin-top-right\")} style={{ background: p.menu, borderColor: p.border }}>\n                  <div className=\"flex items-center justify-between px-2.5 pt-1 pb-1.5\">\n                    <span className=\"text-[13px] font-semibold\">Notifications</span>\n                    <button type=\"button\" role=\"menuitem\" ref={focusOnce} disabled={!unreadCount} onClick={() => setUnread({})} className={cn(\"cursor-pointer rounded-md border-0 bg-transparent px-1.5 py-0.5 text-[12px] disabled:cursor-default disabled:opacity-40\", focus)} style={{ color: p.accent, ...ring }}>\n                      Mark all read\n                    </button>\n                  </div>\n                  {NOTIFS.map((n) => (\n                    <button key={n.id} type=\"button\" role=\"menuitem\" onClick={() => setUnread((u) => ({ ...u, [n.id]: false }))} className={cn(itemCls, \"items-start hover:bg-[var(--h)]\")} style={{ color: p.text, [\"--h\" as string]: p.hover, ...ring }}>\n                      <span className=\"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full transition-opacity\" style={{ background: p.accent, opacity: unread[n.id] ? 1 : 0 }} aria-hidden=\"true\" />\n                      <span className=\"min-w-0 flex-1 leading-[1.45]\" style={{ color: unread[n.id] ? p.text : p.muted }}>\n                        <span className=\"font-medium\">{n.who}</span> {n.what}\n                        {unread[n.id] && <span className=\"sr-only\"> (unread)</span>}\n                      </span>\n                      <span className=\"shrink-0 text-[11.5px] tabular-nums\" style={{ color: p.faint }}>\n                        {n.when}\n                      </span>\n                    </button>\n                  ))}\n                </motion.div>\n              )}\n            </AnimatePresence>\n          </div>\n\n          {/* User */}\n          <div className=\"relative\">\n            <button type=\"button\" onClick={() => toggle(\"user\")} aria-haspopup=\"menu\" aria-expanded={menu === \"user\"} aria-label=\"Account menu\" className={cn(\"ml-0.5 grid cursor-pointer place-items-center rounded-full border-0 bg-transparent p-0.5\", focus)} style={ring}>\n              {avatar}\n            </button>\n            <AnimatePresence>\n              {menu === \"user\" && (\n                <motion.div key=\"user\" role=\"menu\" aria-label=\"Account\" onKeyDown={menuKeys} {...pop} className={cn(menuCls, \"right-0 w-56 origin-top-right\")} style={{ background: p.menu, borderColor: p.border }}>\n                  <div className=\"px-2.5 pt-1.5 pb-2\">\n                    <p className=\"m-0 truncate text-[13px] font-semibold\">{user.name}</p>\n                    <p className=\"m-0 truncate text-[12px]\" style={{ color: p.faint }}>\n                      {user.email}\n                    </p>\n                  </div>\n                  <div className=\"mb-1 h-px\" style={{ background: p.border }} />\n                  {[\"Profile\", \"Billing\", \"Keyboard shortcuts\", \"Sign out\"].map((l, i) => (\n                    <button key={l} type=\"button\" role=\"menuitem\" ref={i === 0 ? focusOnce : undefined} onClick={() => { setMenu(null); setToast(l === \"Sign out\" ? \"Signed out (demo)\" : `${l} opened`); }} className={cn(itemCls, \"hover:bg-[var(--h)]\")} style={{ color: l === \"Sign out\" ? p.red : p.text, [\"--h\" as string]: p.hover, ...ring }}>\n                      {l}\n                    </button>\n                  ))}\n                </motion.div>\n              )}\n            </AnimatePresence>\n          </div>\n        </div>\n\n        {/* Mobile nav */}\n        <AnimatePresence>\n          {menu === \"nav\" && (\n            <motion.nav key=\"mnav\" aria-label=\"Main\" initial={reduce ? false : { opacity: 0, y: -6 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, y: -6 }} transition={{ duration: 0.16 }} className=\"absolute inset-x-2 top-full z-30 mt-1.5 flex flex-col rounded-xl border p-1.5 shadow-xl @[860px]:hidden\" style={{ background: p.menu, borderColor: p.border }}>\n              {tabs.map((t, i) => (\n                <button key={t} type=\"button\" ref={i === 0 ? focusOnce : undefined} onClick={() => pickTab(t)} aria-current={tab === t ? \"page\" : undefined} className={cn(itemCls, \"justify-between\")} style={{ color: tab === t ? p.text : p.muted, background: tab === t ? p.hover : \"transparent\", fontWeight: tab === t ? 500 : 400, ...ring }}>\n                  {t}\n                  {tab === t && <Icon d={I.check} size={14} />}\n                </button>\n              ))}\n            </motion.nav>\n          )}\n        </AnimatePresence>\n      </div>\n\n      {/* Page header */}\n      <div className=\"px-4 pt-7 pb-6 @[640px]:px-6 @[640px]:pt-9\">\n        <div className=\"flex flex-col gap-5 @[760px]:flex-row @[760px]:items-end @[760px]:justify-between\">\n          <div className=\"min-w-0\">\n            <p className=\"m-0 flex items-center gap-2 text-[12.5px]\" style={{ color: p.muted }}>\n              <span className=\"relative flex h-2 w-2\">\n                <motion.span className=\"absolute inset-0 rounded-full\" style={{ background: p.green }} animate={reduce ? undefined : { scale: [1, 2.2], opacity: [0.5, 0] }} transition={{ repeat: Infinity, duration: 1.8 }} />\n                <span className=\"relative h-2 w-2 rounded-full\" style={{ background: p.green }} />\n              </span>\n              All systems normal · {current.name}\n            </p>\n            <h1 className=\"m-0 mt-2 text-[24px] font-semibold tracking-[-0.015em] @[640px]:text-[28px]\">\n              {tab === \"Overview\" ? `Good morning, ${user.name.split(\" \")[0]}` : tab}\n            </h1>\n          </div>\n          <div className=\"flex flex-wrap items-center gap-2\">\n            <div role=\"radiogroup\" aria-label=\"Date range\" className=\"flex rounded-lg border p-0.5\" style={{ borderColor: p.border, background: p.bar }}>\n              {RANGES.map((r) => (\n                <button key={r} type=\"button\" role=\"radio\" aria-checked={range === r} onClick={() => pickRange(r)} className={cn(\"relative h-8 cursor-pointer rounded-md border-0 bg-transparent px-3 text-[12.5px] font-medium tabular-nums\", focus)} style={{ color: range === r ? p.onText : p.muted, ...ring }}>\n                  {range === r && <motion.span layoutId={`${uid}-range`} className=\"absolute inset-0 rounded-md\" style={{ background: p.on }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 520, damping: 38 }} />}\n                  <span className=\"relative\">{r}</span>\n                </button>\n              ))}\n            </div>\n            <button type=\"button\" onClick={runExport} disabled={exportState === \"busy\"} className={cn(btn, \"min-w-[96px] border bg-transparent\")} style={{ borderColor: p.border, color: exportState === \"done\" ? p.green : p.text, ...ring }}>\n              {exportState === \"busy\" ? (\n                <motion.span className=\"h-3.5 w-3.5 rounded-full border-2 border-current border-t-transparent\" animate={reduce ? undefined : { rotate: 360 }} transition={{ repeat: Infinity, duration: 0.7, ease: \"linear\" }} aria-hidden=\"true\" />\n              ) : (\n                <Icon d={exportState === \"done\" ? I.check : I.down} size={14} />\n              )}\n              {exportState === \"busy\" ? \"Exporting\" : exportState === \"done\" ? \"Done\" : \"Export\"}\n            </button>\n            <button type=\"button\" onClick={() => setToast(\"New report started\")} className={cn(btn, \"border-0\")} style={{ background: p.on, color: p.onText, ...ring }}>\n              <Icon d={I.plus} size={14} /> New report\n            </button>\n          </div>\n        </div>\n\n        {/* KPI strip */}\n        <dl className=\"m-0 mt-7 grid grid-cols-1 overflow-hidden rounded-xl border @[560px]:grid-cols-3\" style={{ borderColor: p.border, background: p.card }}>\n          {KPIS[range].map(([k, v, d], i) => (\n            <div key={k} className={cn(\"px-4 py-4 @[640px]:px-5\", i > 0 && \"border-t @[560px]:border-t-0 @[560px]:border-l\")} style={{ borderColor: p.border }}>\n              <dt className=\"text-[12.5px]\" style={{ color: p.muted }}>\n                {k}\n              </dt>\n              <dd className=\"m-0 mt-1 flex items-baseline gap-2\">\n                <AnimatePresence mode=\"popLayout\" initial={false}>\n                  <motion.span key={v} initial={reduce ? false : { opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, y: -8 }} transition={{ duration: 0.2 }} className=\"text-[22px] font-semibold tabular-nums tracking-[-0.02em]\">\n                    {v}\n                  </motion.span>\n                </AnimatePresence>\n                <span className=\"text-[12px] font-medium tabular-nums\" style={{ color: (k === \"Churn\" ? d <= 0 : d >= 0) ? p.green : p.red }}>\n                  {d > 0 ? \"+\" : \"\"}\n                  {d}\n                  {k === \"Churn\" ? \" pt\" : \"%\"}\n                </span>\n              </dd>\n            </div>\n          ))}\n        </dl>\n      </div>\n\n      <AnimatePresence>\n        {toast && (\n          <motion.div key={toast} role=\"status\" initial={reduce ? false : { opacity: 0, y: 8 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, y: 8 }} className=\"pointer-events-none mx-auto mb-5 w-fit rounded-full border px-3.5 py-1.5 text-[12.5px]\" style={{ background: p.menu, borderColor: p.border, color: p.text }}>\n            {toast}\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </header>\n  );\n}\n\nexport default DashboardHeader;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}