{
  "component": {
    "id": "analytics-dashboard-template",
    "name": "Analytics dashboard template",
    "tier": "pro",
    "exampleId": "analytics-dashboard-template",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/analytics-dashboard-template-demo.tsx",
    "exportName": "AnalyticsDashboardTemplateDemo",
    "sha256": "168936b3fac2b2539ea2dcc70853e0e0c9d0d38e0a1631ddc36000aa10c74a9b",
    "helperImports": [],
    "directComponentImports": [
      "activity-feed",
      "analytics-dashboard-template",
      "line-chart",
      "stats-grid"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/analytics-dashboard-template",
    "registryUrl": "https://tidalui.com/r/pro/analytics-dashboard-template.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/analytics-dashboard-template",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/analytics-dashboard-template",
      "registryUrl": "https://tidalui.com/r/pro/analytics-dashboard-template.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/analytics-dashboard-template.tsx",
    "exports": [
      "TidalActivityFeedGroup",
      "TidalActivityFeedItem",
      "TidalAnalyticsDashboardAction",
      "TidalAnalyticsDashboardTemplate",
      "TidalLineChartPoint",
      "TidalStatsGridMetric"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/analytics-dashboard-template.css",
      "components/ui/stats-grid.css",
      "components/ui/line-chart.css",
      "components/ui/activity-feed.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/stats-grid",
      "@tidal-pro/line-chart",
      "@tidal-pro/activity-feed"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "activity-feed",
      "analytics-dashboard-template",
      "line-chart",
      "stats-grid"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/analytics-dashboard-template.css",
      "components/ui/stats-grid.css",
      "components/ui/line-chart.css",
      "components/ui/activity-feed.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/analytics-dashboard-template.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/analytics-dashboard-template-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useMemo, useState } from \"react\";\n\nimport { TidalAnalyticsDashboardTemplate, type TidalAnalyticsDashboardAction } from \"./components/ui/analytics-dashboard-template\";\n\nimport type { TidalStatsGridMetric } from \"./components/ui/stats-grid\";\n\nimport type { TidalLineChartPoint } from \"./components/ui/line-chart\";\n\nimport type { TidalActivityFeedGroup, TidalActivityFeedItem } from \"./components/ui/activity-feed\";\n\nimport \"./components/ui/stats-grid.css\";\n\nimport \"./components/ui/line-chart.css\";\n\nimport \"./components/ui/activity-feed.css\";\n\nimport \"./components/ui/analytics-dashboard-template.css\";\n\nfunction tidalExampleAvatarDataUri(seed: unknown) {\n  const text = String(seed).replace(/[^a-z0-9]/gi, \"\").slice(-2) || \"UI\";\n  const palette = [\"#333333\", \"#555555\", \"#777777\", \"#999999\", \"#bbbbbb\"];\n  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\"><rect width=\"96\" height=\"96\" rx=\"48\" fill=\"${color}\"/><circle cx=\"48\" cy=\"38\" r=\"17\" fill=\"white\" fill-opacity=\".92\"/><path d=\"M18 92c3-22 15-34 30-34s27 12 30 34\" fill=\"white\" fill-opacity=\".92\"/></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nfunction tidalExampleImageDataUri(label: string) {\n  const safeLabel = label.replace(/[<>&]/g, \"\").slice(0, 28) || \"Sample image\";\n  const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1200 675\"><defs><linearGradient id=\"g\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\"><stop stop-color=\"#171717\"/><stop offset=\"1\" stop-color=\"#555555\"/></linearGradient></defs><rect width=\"1200\" height=\"675\" fill=\"url(#g)\"/><circle cx=\"950\" cy=\"100\" r=\"260\" fill=\"white\" fill-opacity=\".08\"/><text x=\"80\" y=\"570\" fill=\"white\" font-family=\"system-ui,sans-serif\" font-size=\"64\" font-weight=\"700\">${safeLabel}</text></svg>`;\n  return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n}\n\nconst tidalExampleStyles = \".tidal-scope .analytics-demo-footer,\\n.tidal-scope .analytics-demo-footer > div {\\n  min-width: 0;\\n}\\n\\n.tidal-scope .analytics-demo-footer {\\n  display: flex;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 14px;\\n  padding: 12px 2px 2px;\\n  border-top: 1px solid var(--t-border);\\n}\\n\\n.tidal-scope .analytics-demo-footer > div {\\n  display: grid;\\n  gap: 3px;\\n}\\n\\n.tidal-scope .analytics-demo-footer strong,\\n.tidal-scope .analytics-demo-footer span,\\n.tidal-scope .analytics-demo-footer output {\\n  min-width: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .analytics-demo-footer strong,\\n.tidal-scope .analytics-demo-footer output {\\n  color: var(--t-ink);\\n  font-weight: 680;\\n}\\n\\n.tidal-scope .analytics-demo-footer > div:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n@container tidal-analytics-template (max-width: 620px) {\\n  .tidal-scope .analytics-demo-footer {\\n    align-items: flex-start;\\n    flex-direction: column;\\n  }\\n}\";\n\ntype RangeId = \"7d\" | \"30d\" | \"90d\";\n\ntype ActivityFilter = \"all\" | \"unread\";\n\nconst RANGE_DATA: Record<\n  RangeId,\n  {\n    label: string;\n    visits: number;\n    conversion: string;\n    active: number;\n    returnRate: string;\n    points: readonly TidalLineChartPoint[];\n  }\n> = {\n  \"7d\": {\n    label: \"Last 7 days\",\n    visits: 1842,\n    conversion: \"6.8%\",\n    active: 312,\n    returnRate: \"41%\",\n    points: [\n      {\n        id: \"7-mon\",\n        label: \"Oct 8\",\n        value: 218,\n        displayValue: \"218 visits\",\n      },\n      {\n        id: \"7-tue\",\n        label: \"Oct 9\",\n        value: 246,\n        displayValue: \"246 visits\",\n      },\n      {\n        id: \"7-wed\",\n        label: \"Oct 10\",\n        value: 231,\n        displayValue: \"231 visits\",\n      },\n      {\n        id: \"7-thu\",\n        label: \"Oct 11\",\n        value: 275,\n        displayValue: \"275 visits\",\n      },\n      {\n        id: \"7-fri\",\n        label: \"Oct 12\",\n        value: 292,\n        displayValue: \"292 visits\",\n      },\n      {\n        id: \"7-sat\",\n        label: \"Oct 13\",\n        value: 264,\n        displayValue: \"264 visits\",\n      },\n      {\n        id: \"7-sun\",\n        label: \"Oct 14\",\n        value: 316,\n        displayValue: \"316 visits\",\n      },\n    ],\n  },\n  \"30d\": {\n    label: \"Last 30 days\",\n    visits: 7284,\n    conversion: \"6.4%\",\n    active: 894,\n    returnRate: \"38%\",\n    points: [\n      {\n        id: \"30-w1\",\n        label: \"Week 1\",\n        value: 1510,\n        displayValue: \"1,510 visits\",\n      },\n      {\n        id: \"30-w2\",\n        label: \"Week 2\",\n        value: 1748,\n        displayValue: \"1,748 visits\",\n      },\n      {\n        id: \"30-w3\",\n        label: \"Week 3\",\n        value: 1882,\n        displayValue: \"1,882 visits\",\n      },\n      {\n        id: \"30-w4\",\n        label: \"Week 4\",\n        value: 2144,\n        displayValue: \"2,144 visits\",\n      },\n    ],\n  },\n  \"90d\": {\n    label: \"Last 90 days\",\n    visits: 20418,\n    conversion: \"6.1%\",\n    active: 2406,\n    returnRate: \"36%\",\n    points: [\n      {\n        id: \"90-aug\",\n        label: \"August\",\n        value: 6128,\n        displayValue: \"6,128 visits\",\n      },\n      {\n        id: \"90-sep\",\n        label: \"September\",\n        value: 6714,\n        displayValue: \"6,714 visits\",\n      },\n      {\n        id: \"90-oct\",\n        label: \"October\",\n        value: 7576,\n        displayValue: \"7,576 visits\",\n      },\n    ],\n  },\n};\n\nconst INITIAL_ACTIVITY: readonly TidalActivityFeedItem[] = [\n  {\n    id: \"report-opened\",\n    title: \"Mina opened the sample performance report\",\n    dateTime: \"2026-10-14T09:40:00-05:00\",\n    timeLabel: \"9:40 AM\",\n    description:\n      \"The local report note was viewed from this fictional dashboard.\",\n    category: \"Report\",\n    context: \"Performance overview\",\n    unread: true,\n    actor: {\n      name: \"Mina Cole\",\n      detail: \"Fictional analyst\",\n      avatarSrc: tidalExampleAvatarDataUri(\"01\"),\n    },\n  },\n  {\n    id: \"segment-reviewed\",\n    title: \"Jon reviewed the returning visitor sample\",\n    dateTime: \"2026-10-14T08:18:00-05:00\",\n    timeLabel: \"8:18 AM\",\n    description: \"The displayed segment remains part of the local sample data.\",\n    category: \"Segment\",\n    context: \"Returning visitors\",\n    unread: false,\n    actor: {\n      name: \"Jon Bell\",\n      detail: \"Fictional researcher\",\n      avatarSrc: tidalExampleAvatarDataUri(\"02\"),\n    },\n  },\n] as const;\n\nexport function AnalyticsDashboardTemplateDemo() {\n  const generatedId = useId().replace(/:/g, \"\");\n  const chartId = `${generatedId}-traffic-chart`;\n  const activityId = `${generatedId}-activity`;\n  const reportNoteId = `${generatedId}-report-note`;\n  const [range, setRange] = useState<RangeId>(\"7d\");\n  const [selectedPointId, setSelectedPointId] = useState(\n    RANGE_DATA[\"7d\"].points[0].id,\n  );\n  const [activityFilter, setActivityFilter] = useState<ActivityFilter>(\"all\");\n  const [sampleAdded, setSampleAdded] = useState(false);\n  const [message, setMessage] = useState(\"Showing the last 7 days.\");\n  const data = RANGE_DATA[range];\n\n  const activity = useMemo<readonly TidalActivityFeedItem[]>(() => {\n    if (!sampleAdded) return INITIAL_ACTIVITY;\n    return [\n      {\n        id: \"sample-visit\",\n        title: \"A sample visit was added locally\",\n        dateTime: \"2026-10-14T10:05:00-05:00\",\n        timeLabel: \"10:05 AM\",\n        description:\n          \"This fictional event exists only until the preview reloads.\",\n        category: \"Visit\",\n        context: data.label,\n        unread: true,\n        actor: {\n          name: \"Inez Park\",\n          detail: \"Fictional teammate\",\n          avatarSrc: tidalExampleAvatarDataUri(\"03\"),\n        },\n      },\n      ...INITIAL_ACTIVITY,\n    ];\n  }, [data.label, sampleAdded]);\n\n  const visibleActivity = activity.filter(\n    (item) => activityFilter === \"all\" || item.unread,\n  );\n  const activityGroups: readonly TidalActivityFeedGroup[] = [\n    {\n      id: \"today\",\n      label: \"Today\",\n      items: visibleActivity.map((item) => ({\n        ...item,\n        destination: {\n          href: `#${reportNoteId}`,\n          label: `Open local report note for ${String(item.title)}`,\n          linkProps: {\n            onClick: () =>\n              setMessage(`${String(item.title)} opened the local report note.`),\n          },\n        },\n      })),\n    },\n  ];\n  const metrics: readonly TidalStatsGridMetric[] = [\n    {\n      id: \"visits\",\n      label: \"Visits\",\n      value: (data.visits + (sampleAdded ? 1 : 0)).toLocaleString(),\n      valueKey: `${range}-${sampleAdded}`,\n      comparison: \"vs. prior sample\",\n      trend: \"positive\",\n      detail: data.label,\n      href: `#${chartId}`,\n    },\n    {\n      id: \"conversion\",\n      label: \"Conversion\",\n      value: data.conversion,\n      valueKey: range,\n      comparison: \"sample rate\",\n      trend: \"neutral\",\n      detail: \"Fictional conversion\",\n      href: `#${chartId}`,\n    },\n    {\n      id: \"active\",\n      label: \"Active visitors\",\n      value: data.active.toLocaleString(),\n      valueKey: range,\n      comparison: \"current sample\",\n      trend: \"positive\",\n      href: `#${activityId}`,\n    },\n    {\n      id: \"returning\",\n      label: \"Returning\",\n      value: data.returnRate,\n      valueKey: range,\n      comparison: \"sample share\",\n      trend: \"neutral\",\n      href: `#${activityId}`,\n    },\n  ];\n\n  const actions: readonly TidalAnalyticsDashboardAction[] = [\n    {\n      id: \"report-note\",\n      kind: \"link\",\n      href: `#${reportNoteId}`,\n      label: \"Report note\",\n      linkProps: {\n        onClick: () => setMessage(\"The local report note is open below.\"),\n      },\n    },\n    {\n      id: \"add-event\",\n      kind: \"button\",\n      label: \"Add sample event\",\n      emphasis: \"primary\",\n      onAction: () => {\n        if (sampleAdded) {\n          setMessage(\"The sample event is already visible.\");\n          return;\n        }\n        setSampleAdded(true);\n        setActivityFilter(\"all\");\n        setMessage(\"One fictional event was added locally.\");\n      },\n    },\n  ];\n\n  return (\n    <TidalAnalyticsDashboardTemplate\n      title=\"Atlas analytics\"\n      eyebrow=\"Workspace report\"\n      description=\"Review traffic trends, inspect exact values, and follow the activity behind the summary.\"\n      range={{\n        label: \"Reporting range\",\n        value: range,\n        options: (Object.keys(RANGE_DATA) as RangeId[]).map((value) => ({\n          value,\n          label: RANGE_DATA[value].label,\n        })),\n        onValueChange: (value) => {\n          const nextRange = value as RangeId;\n          setRange(nextRange);\n          setSelectedPointId(RANGE_DATA[nextRange].points[0].id);\n          setMessage(`Showing ${RANGE_DATA[nextRange].label.toLowerCase()}.`);\n        },\n      }}\n      actions={actions}\n      stats={{\n        title: \"Performance\",\n        eyebrow: null,\n        description: \"Four measures for the selected reporting range.\",\n        metrics,\n      }}\n      chart={{\n        id: chartId,\n        title: \"Visits over time\",\n        eyebrow: null,\n        description:\n          \"Use the native previous and next controls to inspect an exact point.\",\n        points: data.points,\n        selectedId: selectedPointId,\n        onSelectedChange: (point) => {\n          setSelectedPointId(point.id);\n          setMessage(`${point.label}: ${point.displayValue}.`);\n        },\n        yAxisLabel: \"Visits\",\n        formatAxisValue: (value) => Math.round(value).toLocaleString(),\n        tableLabel: \"View supplied visit data\",\n      }}\n      activity={{\n        id: activityId,\n        title: \"Recent activity\",\n        eyebrow: null,\n        description: \"Events associated with this report.\",\n        groups: activityGroups,\n        filter: {\n          value: activityFilter,\n          label: \"Filter recent activity\",\n          options: [\n            { id: \"all\", label: \"All\", count: activity.length },\n            {\n              id: \"unread\",\n              label: \"Unread\",\n              count: activity.filter((item) => item.unread).length,\n            },\n          ],\n          onValueChange: (value) => {\n            setActivityFilter(value as ActivityFilter);\n            setMessage(`Showing ${value} sample activity.`);\n          },\n        },\n        emptyMessage: \"No sample activity matches this view.\",\n      }}\n      footer={\n        <div className=\"analytics-demo-footer\">\n          <div id={reportNoteId} tabIndex={-1}>\n            <strong>Report note</strong>\n            <span>This note follows the selected activity.</span>\n          </div>\n          <output aria-live=\"polite\">{message}</output>\n          <span>Sample data. Changes stay in this preview.</span>\n        </div>\n      }\n    />\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <AnalyticsDashboardTemplateDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/analytics-dashboard-template.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Consumer-provided label remains required where the component API requires one.",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
