{
  "$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 = (p.label ?? null) -%}\n{%- set v_categories = (p.categories ?? null) -%}\n{%- set v_current = (p.current ?? 'all') -%}\n{%- set v_layout = (p.layout ?? 'chips') -%}\n{%- set v_count = (p.count ?? 'show') -%}\n{%- set v_icon = (p.icon ?? 'show') -%}\n{%- set v_density = (p.density ?? 'default') -%}\n{%- set v_tools = (p.tools ?? null) -%}\n{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}\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 = (og_t(v_chipLike) ? 'inline-flex h-8 items-center gap-2 rounded px-3 inset-ring inset-ring-border' : (og_t(og_eq(v_layout, 'bar')) ? 'inline-flex items-center gap-2 -mb-px border-b px-1 py-2' : (og_t(v_tiles) ? 'flex h-full flex-col items-start gap-4 rounded p-4 inset-ring inset-ring-border' : 'inline-flex w-full items-center gap-2 rounded px-3 py-2'))) -%}\n{%- set v_currentLook = (og_t(v_chipLike) ? 'bg-primary text-primary-foreground' : (og_t(og_eq(v_layout, 'bar')) ? 'border-foreground font-semibold' : (og_t(v_tiles) ? 'inset-ring-foreground font-semibold' : 'bg-muted font-semibold'))) -%}\n{%- set v_otherLook = (og_t(og_eq(v_layout, 'bar')) ? 'border-transparent' : '') -%}\n{%- set v_listShape = (og_t(og_eq(v_layout, 'sidebar')) ? 'flex flex-col gap-2' : (og_t(og_eq(v_layout, 'bar')) ? 'flex flex-wrap gap-2 gap-x-4 border-b border-border' : (og_t(v_tiles) ? 'grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-6' : '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        {{ include('blocks/search-field.html.twig', {'p': {'value': og_coalesce([og_get(v_tools, ['query']), '']), 'label': og_coalesce([og_get(v_tools, ['search']), '']), 'placeholder': og_get(v_tools, ['search'])}}, with_context = false) }}\n        {%- set c_1 -%}\n          {{ include('ui/select/SelectOption.html.twig', {'value': 'sort', 'selected': true, 'attrs': og_attrs(['label', og_get(v_tools, ['sortValue'])])}, with_context = false) }}\n        {%- endset -%}\n        {{ include('compose/Select.html.twig', {'name': 'sort', 'size': 'sm', 'class': 'w-48', 'attrs': og_attrs(['aria-label', og_get(v_tools, ['sort'])]), 'children': c_1}, with_context = false) }}\n        {%- set c_2 -%}\n          {{ og_text(og_get(v_tools, ['shown'])) }}\n        {%- endset -%}\n        {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}\n      {%- endset -%}\n      {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'class': 'mb-4 flex-wrap', 'attrs': og_attrs(['data-slot', 'toolbar']), 'children': c_3}, with_context = false) }}\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                    {{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_c, ['icon'])), 'size': 20}, with_context = false) }}\n                  {%- endset -%}\n                  {{ include('compose/Inline.html.twig', {'class': 'flex size-10 items-center justify-center rounded bg-muted', 'children': c_4}, with_context = false) }}\n                {%- else %}\n                  {{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_c, ['icon'])), 'size': 16}, with_context = false) }}\n                {%- endif %}\n              {%- endif %}\n              {%- set c_5 -%}\n                {{ og_text(og_get(v_c, ['name'])) }}\n              {%- endset -%}\n              {{ include('compose/Inline.html.twig', {'children': c_5}, with_context = false) }}\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                {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_6}, with_context = false) }}\n              {%- endif %}\n            {%- endset -%}\n            {{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_c, ['href']), 'className': og_cnv([og_cnv(['text-sm', v_linkShape, (og_t(og_eq(og_get(v_c, ['id']), v_current)) ? v_currentLook : v_otherLook)])]), 'current': og_eq(og_get(v_c, ['id']), v_current), 'testid': 'item', 'block': true}, 'children': og_markup(c_7)}, with_context = false) }}\n          {%- endset -%}\n          {{ include('compose/ListItem.html.twig', {'attrs': og_attrs(['data-slot', 'categories-row']), 'children': c_8}, with_context = false) }}\n        {%- endfor %}\n      {%- endset -%}\n      {{ include('compose/List.html.twig', {'tag': 'ul', 'class': og_s(v_listShape), 'attrs': og_attrs(['data-slot', 'items']), 'children': c_9}, with_context = false) }}\n    {%- endif %}\n  {%- endset -%}\n  {{ include('compose/Container.html.twig', {'class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', (og_t(og_eq(v_density, 'compact')) ? 'py-2' : 'py-4')])), 'attrs': og_attrs(['data-slot', 'container']), 'children': c_10}, with_context = false) }}\n{%- endset -%}\n{{ include('compose/Block.html.twig', {'tag': 'nav', 'attrs': og_attrs(['aria-label', og_coalesce([v_landmarkLabel, v_label]), 'data-layout', v_layout, 'data-slot', 'category-nav']), 'children': c_11}, with_context = false) }}\n",
      "path": "blocks/category-nav.html.twig",
      "target": "blocks/category-nav.html.twig"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "catalog",
    "kind": "block",
    "tags": [
      "twig",
      "block"
    ]
  },
  "name": "category-nav",
  "registryDependencies": [
    "block",
    "container",
    "group",
    "inline",
    "kit-select",
    "list",
    "list-item",
    "lucide-icon",
    "menu-entry",
    "search-field",
    "select",
    "text",
    "utils"
  ],
  "runtime": "twig",
  "title": "Category Nav",
  "type": "registry:block"
}
