{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A product as a card: picture, optional badge, category, name, rating, summary, price (and the old price struck through when `compareAt` is higher) and an add button. Axes: layout (vertical, horizontal), media (image, none), ratio, rating (show, hide), action (button, none), densi",
  "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/product-card.json\n    A product as a card: picture, optional badge, category, name, rating, summary, price (and the old price struck through when `compareAt` is higher) and an add button. Axes: layout (vertical, horizontal), media (image, none), ratio, rating (show, hide), action (button, none), density.\n    Props (p): product, labels, badges, layout, media, ratio, rating, action, density. -#}\n{%- set v_product = (p.product ?? null) -%}\n{%- set v_labels = (p.labels ?? null) -%}\n{%- set v_badges = (p.badges ?? null) -%}\n{%- set v_layout = (p.layout ?? 'vertical') -%}\n{%- set v_media = (p.media ?? 'image') -%}\n{%- set v_ratio = (p.ratio ?? '4/3') -%}\n{%- set v_rating = (p.rating ?? 'show') -%}\n{%- set v_action = (p.action ?? 'button') -%}\n{%- set v_density = (p.density ?? 'default') -%}\n{%- set c_16 -%}\n  {%- if og_t(og_eq(v_media, 'image')) %}\n    {%- set c_2 -%}\n      {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_product, ['name']), 'src': og_get(v_product, ['image']), 'ratio': v_ratio, 'className': og_cnv(['h-full'])}}, with_context = false) }}\n      {%- if og_t(og_get(v_product, ['badge'])) %}\n        {%- set c_1 -%}\n          {{ og_text(og_at(v_badges, og_get(v_product, ['badge']))) }}\n        {%- endset -%}\n        {{ include('compose/Badge.html.twig', {'variant': 'default', 'size': 'default', 'class': 'absolute left-4 top-4', 'children': c_1}, with_context = false) }}\n      {%- endif %}\n    {%- endset -%}\n    {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['relative shrink-0', (og_t(og_eq(v_layout, 'horizontal')) ? 'sm:w-48' : '')])), 'children': c_2}, with_context = false) }}\n  {%- endif %}\n  {%- set c_15 -%}\n    {%- set c_3 -%}\n      {{ og_text(og_get(v_product, ['category'])) }}\n    {%- endset -%}\n    {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'uppercase tracking-wide text-muted-foreground', 'children': c_3}, with_context = false) }}\n    {%- set c_5 -%}\n      {%- if og_t(og_get(v_product, ['href'])) %}\n        {%- set c_4 -%}\n          {{ og_text(og_get(v_product, ['name'])) }}\n        {%- endset -%}\n        {{ include('compose/Link.html.twig', {'href': og_url(og_s(og_get(v_product, ['href']))), 'variant': 'default', 'attrs': og_attrs(['data-slot', 'open']), 'children': c_4}, with_context = false) }}\n      {%- else %}\n        {{ og_text(og_get(v_product, ['name'])) }}\n      {%- endif %}\n    {%- endset -%}\n    {{ include('compose/Title.html.twig', {'as': 3, 'size': 'base', 'weight': 'bold', 'children': c_5}, with_context = false) }}\n    {%- if og_t(og_eq(v_rating, 'show')) %}\n      {%- set c_7 -%}\n        {{ include('blocks/rating.html.twig', {'p': {'value': og_get(v_product, ['rating']), 'label': og_tpl(og_get(v_labels, ['ratingLabel']), [og_get(v_product, ['rating'])])}}, with_context = false) }}\n        {%- set c_6 -%}\n          {{ og_text(og_tpl(og_get(v_labels, ['reviews']), [og_get(v_product, ['reviews'])])) }}\n        {%- endset -%}\n        {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_6}, with_context = false) }}\n      {%- endset -%}\n      {{ include('compose/Group.html.twig', {'gap': '2', 'children': c_7}, with_context = false) }}\n    {%- endif %}\n    {%- if og_t(og_eq(v_density, 'default')) %}\n      {%- set c_8 -%}\n        {{ og_text(og_get(v_product, ['summary'])) }}\n      {%- endset -%}\n      {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_8}, with_context = false) }}\n    {%- endif %}\n    {%- set c_14 -%}\n      {%- set c_12 -%}\n        {%- set c_9 -%}\n          {{ og_text(og_money(og_get(v_product, ['price']), og_get(v_product, ['currency']))) }}\n        {%- endset -%}\n        {{ include('compose/Text.html.twig', {'size': 'xl', 'weight': 'bold', 'children': c_9}, with_context = false) }}\n        {%- if og_t(og_and([og_get(v_product, ['compareAt']), og_gt(og_get(v_product, ['compareAt']), og_get(v_product, ['price']))])) %}\n          {%- set c_11 -%}\n            {%- set c_10 -%}\n              {{ og_text(og_get(v_labels, ['was'])) }}\n            {%- endset -%}\n            {{ include('compose/Inline.html.twig', {'class': 'sr-only', 'children': c_10}, with_context = false) }}\n            {{ og_text(og_money(og_get(v_product, ['compareAt']), og_get(v_product, ['currency']))) }}\n          {%- endset -%}\n          {{ include('compose/Text.html.twig', {'tag': 'del', 'size': 'sm', 'class': 'relative text-muted-foreground', 'attrs': og_attrs(['data-slot', 'compare-at']), 'children': c_11}, with_context = false) }}\n        {%- endif %}\n      {%- endset -%}\n      {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'baseline', 'class': 'flex-wrap', 'children': c_12}, with_context = false) }}\n      {%- if og_t(og_eq(v_action, 'button')) %}\n        {%- set c_13 -%}\n          {{ og_text((og_t(og_get(v_product, ['inStock'])) ? og_get(v_labels, ['add']) : og_get(v_labels, ['soldOut']))) }}\n        {%- endset -%}\n        {{ include('compose/Button.html.twig', {'variant': og_s((og_t(og_get(v_product, ['inStock'])) ? 'default' : 'outline')), 'size': 'sm', 'disabled': og_t(not (og_t(og_get(v_product, ['inStock'])))), 'children': c_13}, with_context = false) }}\n      {%- endif %}\n    {%- endset -%}\n    {{ include('compose/Group.html.twig', {'gap': '4', 'justify': 'between', 'class': 'mt-auto pt-2', 'children': c_14}, with_context = false) }}\n  {%- endset -%}\n  {{ include('compose/CardContent.html.twig', {'class': 'flex flex-1 flex-col gap-2', 'children': c_15}, with_context = false) }}\n{%- endset -%}\n{{ include('compose/Block.html.twig', {'tag': 'article', 'class': og_s(og_cnv(['flex flex-col gap-8 bg-card p-6 text-card-foreground inset-ring inset-ring-border rounded', 'h-full gap-4 overflow-hidden', (og_t(og_eq(v_layout, 'horizontal')) ? 'flex flex-col sm:flex-row' : 'flex flex-col')])), 'attrs': og_attrs(['data-slot', 'card', 'data-layout', v_layout]), 'children': c_16}, with_context = false) }}\n",
      "path": "blocks/product-card.html.twig",
      "target": "blocks/product-card.html.twig"
    }
  ],
  "meta": {
    "category": "general",
    "kind": "block",
    "tags": [
      "twig",
      "block"
    ]
  },
  "name": "product-card",
  "registryDependencies": [
    "badge",
    "block",
    "box",
    "button",
    "card-content",
    "group",
    "inline",
    "link",
    "media-frame",
    "rating",
    "text",
    "title",
    "utils"
  ],
  "runtime": "twig",
  "title": "Product Card",
  "type": "registry:block"
}
