{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A row of vertical bars (sales by day, orders by week) with a caption under each bar. The chart is one image for assistive technology: `label` carries the summary, the bar values are in the captions and titles.",
  "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 * A row of vertical bars (sales by day, orders by week) with a caption under each bar. The chart is one image\n * for assistive technology: `label` carries the summary, the bar values are in the captions and titles.\n */\nimport { For, type JSX } from \"solid-js\";\nimport { Box, Text } from \"../compose\";\nimport { cn, cssValue } from \"../utils\";\nimport type { Bar } from \"./bar-chart.types\";\n\nexport type BarChartProps = {\n  bars: Bar[];\n  label: string;\n  max?: number;\n  height?: number;\n  class?: string;\n};\n\nexport function BarChart({ bars, label, max, height = 160, class: className }: BarChartProps) {\n  const top = Math.max(1, (max ?? bars.reduce((m, i) => Math.max(m, i.value), 0)));\n  return (\n    <Box class={cn(\"min-w-0\", className)} data-slot=\"bar-chart\">\n      <Box class=\"flex min-w-0 items-end gap-2\" role=\"img\" aria-label={label} style={`height:${cssValue(height)}px`}>\n        <For each={bars ?? []}>{(b) => (\n          <Box class=\"flex h-full min-w-0 flex-1 items-end\" title={(b.title ?? b.label)} data-slot=\"bar\">\n            <Box\n              class={cn(\"w-full rounded\", (b.muted ? \"bg-muted-foreground\" : \"bg-primary\"))}\n              style={`height:${cssValue(Math.max(2, Math.round(((b.value / top) * 100))))}%`}\n              data-bar={b.id}\n            />\n          </Box>\n        )}</For>\n      </Box>\n      <Box class=\"mt-2 flex min-w-0 gap-2\" aria-hidden=\"true\">\n        <For each={bars ?? []}>{(b) => (\n          <Box class=\"relative h-4 min-w-0 flex-1\" data-slot=\"bar\">\n            <Text class={\"absolute left-1/2 top-0 m-0 -translate-x-1/2 whitespace-nowrap text-xs font-medium text-muted-foreground\"}>\n              {b.label}\n            </Text>\n          </Box>\n        )}</For>\n      </Box>\n    </Box>\n  );\n}\n",
      "path": "components/bar-chart.tsx",
      "target": "components/bar-chart.tsx"
    },
    {
      "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\nexport type Bar = {\n  id: string;\n  label: string;\n  value: number;\n  title?: string;\n  muted?: boolean;\n};\n",
      "path": "components/bar-chart.types.ts",
      "target": "components/bar-chart.types.ts"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "bar-chart",
  "registryDependencies": [
    "compose",
    "utils"
  ],
  "runtime": "solid",
  "title": "Bar Chart",
  "type": "registry:component"
}
