{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "App Main component",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->\n<!--\n  The main column of AppShell: the heading, the metric tiles, and the chart panel (beside the activity panel\n  when `activity` is given).\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { Metric } from \"../blocks/metric-row.types\";\n  import type { Point } from \"../blocks/chart-panel.types\";\n  import type { Event } from \"../blocks/activity-feed.types\";\n  import type { OverviewChart, OverviewActivity } from \"../blocks/dashboard-overview.types\";\n\n  export type AppMainProps = {\n    id: string;\n    title: string;\n    metrics: Metric[];\n    chart: OverviewChart;\n    activity?: OverviewActivity;\n    cols?: \"1-2\" | \"1-4\";\n    density?: \"default\" | \"compact\";\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Title from \"../compose/Title.svelte\";\n  import BarChart from \"../components/bar-chart.svelte\";\n  import Panel from \"../components/panel.svelte\";\n  import StatTile from \"../components/stat-tile.svelte\";\n  import Timeline from \"../components/timeline.svelte\";\n  import { tpl } from \"../utils\";\n\n  let { id, title, metrics, chart, activity, cols = \"1-2\", density = \"default\" }: AppMainProps = $props();\n</script>\n\n<Stack\n  gap={(((density as string) === \"compact\") ? \"4\" : \"6\")}\n  align=\"stretch\"\n  class=\"min-w-0\"\n  data-slot=\"app-main\"\n>\n  <Title as={2} size=\"2xl\" weight=\"bold\" id={tpl(\"{0}-title\", id)}>\n    {title}\n  </Title>\n  {#if ((metrics?.length ?? 0) > 0)}\n    <Grid cols={cols} class=\"gap-4\" data-slot=\"items\">\n      {#each metrics as m (m.id)}\n        <Box data-slot=\"item\">\n          <StatTile label={m.label} value={m.value} icon={m.icon} hint={m.hint} />\n        </Box>\n      {/each}\n    </Grid>\n  {/if}\n  {#if activity}\n    <Grid cols=\"1-2\" class=\"items-stretch gap-4\">\n      {#if ((chart.series?.length ?? 0) > 0)}\n        <Panel title={chart.title} description={chart.text} id={tpl(\"{0}-chart\", id)} class=\"h-full\">\n          <BarChart bars={chart.series} label={chart.summary} height={144} />\n        </Panel>\n      {/if}\n      {#if ((activity?.events?.length ?? 0) > 0)}\n        <Panel title={activity?.title} description={activity?.text} id={tpl(\"{0}-feed\", id)} class=\"h-full\">\n          <Timeline items={activity?.events} />\n        </Panel>\n      {/if}\n    </Grid>\n  {:else if ((chart.series?.length ?? 0) > 0)}\n    <Panel title={chart.title} description={chart.text} id={tpl(\"{0}-chart\", id)} class=\"h-full\">\n      <BarChart bars={chart.series} label={chart.summary} height={144} />\n    </Panel>\n  {/if}\n</Stack>\n",
      "path": "components/app-main.svelte",
      "target": "components/app-main.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "app-main",
  "registryDependencies": [
    "activity-feed",
    "bar-chart",
    "box",
    "chart-panel",
    "dashboard-overview",
    "grid",
    "metric-row",
    "panel",
    "stack",
    "stat-tile",
    "timeline",
    "title",
    "utils"
  ],
  "runtime": "svelte",
  "title": "App Main",
  "type": "registry:component"
}
