{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Categories as chips, a bar, a side list, tiles, or chips under a toolbar.",
  "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/organisms/category-nav.json\n    Navigation between product categories as chips, a bar with an underline, a side list, tiles with a big icon, or chips under a toolbar (search, sort and the number shown). The current one carries aria-current. Axes: layout (chips, bar, sidebar, tiles, toolbar), count (show, hide), icon (show, hide), density.\n    Props (p): label, categories, current, layout, count, icon, density, tools, landmarkLabel. -#}\n{%- set v_label = og_def(p['label'], none) -%}\n{%- set v_categories = og_def(p['categories'], none) -%}\n{%- set v_current = og_def(p['current'], 'all') -%}\n{%- set v_layout = og_def(p['layout'], 'chips') -%}\n{%- set v_count = og_def(p['count'], 'show') -%}\n{%- set v_icon = og_def(p['icon'], 'show') -%}\n{%- set v_density = og_def(p['density'], 'default') -%}\n{%- set v_tools = og_def(p['tools'], none) -%}\n{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}\n{%- set v_chipLike = og_or([og_eq(v_layout, 'chips'), og_eq(v_layout, 'toolbar')]) -%}\n{%- set v_tiles = og_eq(v_layout, 'tiles') -%}\n{%- set v_linkShape = ('inline-flex h-8 items-center gap-2 rounded px-3 inset-ring inset-ring-border' if og_t(v_chipLike) else ('inline-flex items-center gap-2 -mb-px border-b px-1 py-2' if og_t(og_eq(v_layout, 'bar')) else ('flex h-full flex-col items-start gap-4 rounded p-4 inset-ring inset-ring-border' if og_t(v_tiles) else 'inline-flex w-full items-center gap-2 rounded px-3 py-2'))) -%}\n{%- set v_currentLook = ('bg-primary text-primary-foreground' if og_t(v_chipLike) else ('border-foreground font-semibold' if og_t(og_eq(v_layout, 'bar')) else ('inset-ring-foreground font-semibold' if og_t(v_tiles) else 'bg-muted font-semibold'))) -%}\n{%- set v_otherLook = ('border-transparent' if og_t(og_eq(v_layout, 'bar')) else '') -%}\n{%- set v_listShape = ('flex flex-col gap-2' if og_t(og_eq(v_layout, 'sidebar')) else ('flex flex-wrap gap-2 gap-x-4 border-b border-border' if og_t(og_eq(v_layout, 'bar')) else ('grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6' if og_t(v_tiles) else 'flex flex-wrap gap-2'))) -%}\n{%- set c_11 -%}\n  {%- set c_10 -%}\n    {%- if og_t(og_eq(v_layout, 'toolbar')) %}\n      {%- set c_3 -%}\n        {{ og_include('blocks/search-field.html.j2', {'p': {'value': og_coalesce([og_get(v_tools, ['query']), '']), 'label': og_coalesce([og_get(v_tools, ['search']), '']), 'placeholder': og_get(v_tools, ['search'])}}) }}\n        {%- set c_1 -%}\n          {{ og_include('ui/select/select-option.html.j2', {'p': {'Value': 'sort', 'Selected': true, 'Attrs': og_attrs(['label', og_get(v_tools, ['sortValue'])])}}) }}\n        {%- endset -%}\n        {{ og_include('compose/select.html.j2', {'p': {'Name': 'sort', 'Size': 'sm', 'Class': 'w-48', 'Attrs': og_attrs(['aria-label', og_get(v_tools, ['sort'])])}, 'children': c_1}) }}\n        {%- set c_2 -%}\n          {{ og_text(og_get(v_tools, ['shown'])) }}\n        {%- endset -%}\n        {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}\n      {%- endset -%}\n      {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'mb-4 flex-wrap', 'Attrs': og_attrs(['data-slot', 'toolbar'])}, 'children': c_3}) }}\n    {%- endif %}\n    {%- if og_t(og_gt(og_len(v_categories), 0)) %}\n      {%- set c_9 -%}\n        {%- for v_c in og_l(v_categories) %}\n          {%- set c_8 -%}\n            {%- set c_7 -%}\n              {%- if og_t(og_eq(v_icon, 'show')) %}\n                {%- if og_t(v_tiles) %}\n                  {%- set c_4 -%}\n                    {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_c, ['icon'])), 'Size': 20}}) }}\n                  {%- endset -%}\n                  {{ og_include('compose/inline.html.j2', {'p': {'Class': 'flex size-10 items-center justify-center rounded bg-muted'}, 'children': c_4}) }}\n                {%- else %}\n                  {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_c, ['icon'])), 'Size': 16}}) }}\n                {%- endif %}\n              {%- endif %}\n              {%- set c_5 -%}\n                {{ og_text(og_get(v_c, ['name'])) }}\n              {%- endset -%}\n              {{ og_include('compose/inline.html.j2', {'p': {}, 'children': c_5}) }}\n              {%- if og_t(og_eq(v_count, 'show')) %}\n                {%- set c_6 -%}\n                  {{ og_text(og_str(og_get(v_c, ['count']))) }}\n                {%- endset -%}\n                {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_6}) }}\n              {%- endif %}\n            {%- endset -%}\n            {{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_c, ['href']), 'className': og_cnv([og_cnv(['text-sm', v_linkShape, (v_currentLook if og_t(og_eq(og_get(v_c, ['id']), v_current)) else v_otherLook)])]), 'current': og_eq(og_get(v_c, ['id']), v_current), 'testid': 'item', 'block': true}, 'children': og_markup(c_7)}) }}\n          {%- endset -%}\n          {{ og_include('compose/list-item.html.j2', {'p': {'Attrs': og_attrs(['data-slot', 'categories-row'])}, 'children': c_8}) }}\n        {%- endfor %}\n      {%- endset -%}\n      {{ og_include('compose/list.html.j2', {'p': {'Tag': 'ul', 'Class': og_s(v_listShape), 'Attrs': og_attrs(['data-slot', 'items'])}, 'children': c_9}) }}\n    {%- endif %}\n  {%- endset -%}\n  {{ og_include('compose/container.html.j2', {'p': {'Class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', ('py-2' if og_t(og_eq(v_density, 'compact')) else 'py-4')])), 'Attrs': og_attrs(['data-slot', 'container'])}, 'children': c_10}) }}\n{%- endset -%}\n{{ og_include('compose/block.html.j2', {'p': {'Tag': 'nav', 'Attrs': og_attrs(['aria-label', og_coalesce([v_landmarkLabel, v_label]), 'data-layout', v_layout, 'data-slot', 'category-nav'])}, 'children': c_11}) }}\n",
      "path": "blocks/category-nav.html.j2",
      "target": "blocks/category-nav.html.j2"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "catalog",
    "kind": "block",
    "tags": [
      "jinja2",
      "block"
    ]
  },
  "name": "category-nav",
  "registryDependencies": [
    "block",
    "container",
    "group",
    "inline",
    "kit-select",
    "list",
    "list-item",
    "lucide-icon",
    "menu-entry",
    "search-field",
    "select",
    "text",
    "utils"
  ],
  "runtime": "jinja2",
  "title": "Category Nav",
  "type": "registry:block"
}
