{
  "$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/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n    Source: packages/compose-gen/specs/parts/bar-chart.json\n    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.\n    Props (p): bars, label, max, height, className. -#}\n{%- set v_bars = og_def(p['bars'], none) -%}\n{%- set v_label = og_def(p['label'], none) -%}\n{%- set v_max = og_def(p['max'], none) -%}\n{%- set v_height = og_def(p['height'], 160) -%}\n{%- set v_top = og_max([1, og_coalesce([v_max, og_max_by(v_bars, 'value')])]) -%}\n{%- set c_6 -%}\n  {%- set c_2 -%}\n    {%- for v_b in og_l(v_bars) %}\n      {%- set c_1 -%}\n        {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['w-full rounded', ('bg-muted-foreground' if og_t(og_get(v_b, ['muted'])) else 'bg-primary')])), 'Attrs': og_attrs(['style', og_css(['height', og_max([2, og_round(og_mul(og_div(og_get(v_b, ['value']), v_top), 100))]), '%']), 'data-bar', og_get(v_b, ['id'])])}}) }}\n      {%- endset -%}\n      {{ og_include('compose/box.html.j2', {'p': {'Class': 'flex h-full min-w-0 flex-1 items-end', 'Attrs': og_attrs(['title', og_coalesce([og_get(v_b, ['title']), og_get(v_b, ['label'])]), 'data-slot', 'bar'])}, 'children': c_1}) }}\n    {%- endfor %}\n  {%- endset -%}\n  {{ og_include('compose/box.html.j2', {'p': {'Class': 'flex min-w-0 items-end gap-2', 'Attrs': og_attrs(['role', 'img', 'aria-label', v_label, 'style', og_css(['height', v_height, 'px'])])}, 'children': c_2}) }}\n  {%- set c_5 -%}\n    {%- for v_b in og_l(v_bars) %}\n      {%- set c_4 -%}\n        {%- set c_3 -%}\n          {{ og_text(og_get(v_b, ['label'])) }}\n        {%- endset -%}\n        {{ og_include('compose/text.html.j2', {'p': {'Class': 'absolute left-1/2 top-0 m-0 -translate-x-1/2 whitespace-nowrap text-xs font-medium text-muted-foreground'}, 'children': c_3}) }}\n      {%- endset -%}\n      {{ og_include('compose/box.html.j2', {'p': {'Class': 'relative h-4 min-w-0 flex-1', 'Attrs': og_attrs(['data-slot', 'bar'])}, 'children': c_4}) }}\n    {%- endfor %}\n  {%- endset -%}\n  {{ og_include('compose/box.html.j2', {'p': {'Class': 'mt-2 flex min-w-0 gap-2', 'Attrs': og_attrs(['aria-hidden', 'true'])}, 'children': c_5}) }}\n{%- endset -%}\n{{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['min-w-0', og_def(p['className'], '')])), 'Attrs': og_attrs(['data-slot', 'bar-chart'])}, 'children': c_6}) }}\n",
      "path": "blocks/bar-chart.html.j2",
      "target": "blocks/bar-chart.html.j2"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "jinja2",
      "component"
    ]
  },
  "name": "bar-chart",
  "registryDependencies": [
    "box",
    "text",
    "utils"
  ],
  "runtime": "jinja2",
  "title": "Bar Chart",
  "type": "registry:component"
}
