{
  "$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 = og_def(p['product'], none) -%}\n{%- set v_labels = og_def(p['labels'], none) -%}\n{%- set v_badges = og_def(p['badges'], none) -%}\n{%- set v_layout = og_def(p['layout'], 'vertical') -%}\n{%- set v_media = og_def(p['media'], 'image') -%}\n{%- set v_ratio = og_def(p['ratio'], '4/3') -%}\n{%- set v_rating = og_def(p['rating'], 'show') -%}\n{%- set v_action = og_def(p['action'], 'button') -%}\n{%- set v_density = og_def(p['density'], 'default') -%}\n{%- set c_16 -%}\n  {%- if og_t(og_eq(v_media, 'image')) %}\n    {%- set c_2 -%}\n      {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_product, ['name']), 'src': og_get(v_product, ['image']), 'ratio': v_ratio, 'className': og_cnv(['h-full'])}}) }}\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        {{ og_include('compose/badge.html.j2', {'p': {'Variant': 'default', 'Size': 'default', 'Class': 'absolute left-4 top-4'}, 'children': c_1}) }}\n      {%- endif %}\n    {%- endset -%}\n    {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['relative shrink-0', ('sm:w-48' if og_t(og_eq(v_layout, 'horizontal')) else '')]))}, 'children': c_2}) }}\n  {%- endif %}\n  {%- set c_15 -%}\n    {%- set c_3 -%}\n      {{ og_text(og_get(v_product, ['category'])) }}\n    {%- endset -%}\n    {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'uppercase tracking-wide text-muted-foreground'}, 'children': c_3}) }}\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        {{ og_include('compose/link.html.j2', {'p': {'Href': og_url(og_s(og_get(v_product, ['href']))), 'Variant': 'default', 'Attrs': og_attrs(['data-slot', 'open'])}, 'children': c_4}) }}\n      {%- else %}\n        {{ og_text(og_get(v_product, ['name'])) }}\n      {%- endif %}\n    {%- endset -%}\n    {{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'base', 'Weight': 'bold'}, 'children': c_5}) }}\n    {%- if og_t(og_eq(v_rating, 'show')) %}\n      {%- set c_7 -%}\n        {{ og_include('blocks/rating.html.j2', {'p': {'value': og_get(v_product, ['rating']), 'label': og_tpl(og_get(v_labels, ['ratingLabel']), [og_get(v_product, ['rating'])])}}) }}\n        {%- set c_6 -%}\n          {{ og_text(og_tpl(og_get(v_labels, ['reviews']), [og_get(v_product, ['reviews'])])) }}\n        {%- endset -%}\n        {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_6}) }}\n      {%- endset -%}\n      {{ og_include('compose/group.html.j2', {'p': {'Gap': '2'}, 'children': c_7}) }}\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      {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_8}) }}\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        {{ og_include('compose/text.html.j2', {'p': {'Size': 'xl', 'Weight': 'bold'}, 'children': c_9}) }}\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            {{ og_include('compose/inline.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_10}) }}\n            {{ og_text(og_money(og_get(v_product, ['compareAt']), og_get(v_product, ['currency']))) }}\n          {%- endset -%}\n          {{ og_include('compose/text.html.j2', {'p': {'Tag': 'del', 'Size': 'sm', 'Class': 'relative text-muted-foreground', 'Attrs': og_attrs(['data-slot', 'compare-at'])}, 'children': c_11}) }}\n        {%- endif %}\n      {%- endset -%}\n      {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'baseline', 'Class': 'flex-wrap'}, 'children': c_12}) }}\n      {%- if og_t(og_eq(v_action, 'button')) %}\n        {%- set c_13 -%}\n          {{ og_text((og_get(v_labels, ['add']) if og_t(og_get(v_product, ['inStock'])) else og_get(v_labels, ['soldOut']))) }}\n        {%- endset -%}\n        {{ og_include('compose/button.html.j2', {'p': {'Variant': og_s(('default' if og_t(og_get(v_product, ['inStock'])) else 'outline')), 'Size': 'sm', 'Disabled': og_t(not (og_t(og_get(v_product, ['inStock']))))}, 'children': c_13}) }}\n      {%- endif %}\n    {%- endset -%}\n    {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Justify': 'between', 'Class': 'mt-auto pt-2'}, 'children': c_14}) }}\n  {%- endset -%}\n  {{ og_include('compose/card-content.html.j2', {'p': {'Class': 'flex flex-1 flex-col gap-2'}, 'children': c_15}) }}\n{%- endset -%}\n{{ og_include('compose/block.html.j2', {'p': {'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', ('flex flex-col sm:flex-row' if og_t(og_eq(v_layout, 'horizontal')) else 'flex flex-col')])), 'Attrs': og_attrs(['data-slot', 'card', 'data-layout', v_layout])}, 'children': c_16}) }}\n",
      "path": "blocks/product-card.html.j2",
      "target": "blocks/product-card.html.j2"
    }
  ],
  "meta": {
    "category": "general",
    "kind": "block",
    "tags": [
      "jinja2",
      "block"
    ]
  },
  "name": "product-card",
  "registryDependencies": [
    "badge",
    "block",
    "box",
    "button",
    "card-content",
    "group",
    "inline",
    "link",
    "media-frame",
    "rating",
    "text",
    "title",
    "utils"
  ],
  "runtime": "jinja2",
  "title": "Product Card",
  "type": "registry:block"
}
