{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.",
  "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/cart-table.json\n    The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.\n    Props (p): lines, labels, media, density, field. -#}\n{%- set v_lines = og_def(p['lines'], none) -%}\n{%- set v_labels = og_def(p['labels'], none) -%}\n{%- set v_media = og_def(p['media'], 'image') -%}\n{%- set v_density = og_def(p['density'], 'default') -%}\n{%- set v_field = og_def(p['field'], 'qty') -%}\n{%- set c_23 -%}\n  {%- set c_22 -%}\n    {%- set c_1 -%}\n      {{ og_text(og_get(v_labels, ['caption'])) }}\n    {%- endset -%}\n    {{ og_include('compose/table-caption.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_1}) }}\n    {%- set c_9 -%}\n      {%- set c_8 -%}\n        {%- set c_2 -%}\n          {{ og_text(og_get(v_labels, ['product'])) }}\n        {%- endset -%}\n        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_2}) }}\n        {%- set c_3 -%}\n          {{ og_text(og_get(v_labels, ['price'])) }}\n        {%- endset -%}\n        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 sm:table-cell', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_3}) }}\n        {%- set c_4 -%}\n          {{ og_text(og_get(v_labels, ['qty'])) }}\n        {%- endset -%}\n        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_4}) }}\n        {%- set c_5 -%}\n          {{ og_text(og_get(v_labels, ['total'])) }}\n        {%- endset -%}\n        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_5}) }}\n        {%- set c_7 -%}\n          {%- set c_6 -%}\n            {{ og_text(og_get(v_labels, ['remove'])) }}\n          {%- endset -%}\n          {{ og_include('compose/inline.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_6}) }}\n        {%- endset -%}\n        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_7}) }}\n      {%- endset -%}\n      {{ og_include('compose/table-row.html.j2', {'p': {}, 'children': c_8}) }}\n    {%- endset -%}\n    {{ og_include('compose/table-head.html.j2', {'p': {}, 'children': c_9}) }}\n    {%- set c_21 -%}\n      {%- for v_line in og_l(v_lines) %}\n        {%- set c_20 -%}\n          {%- set c_14 -%}\n            {%- set c_13 -%}\n              {%- if og_t(og_eq(v_media, 'image')) %}\n                {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_line, ['name']), 'src': og_get(v_line, ['image']), 'ratio': '1/1', 'className': og_cnv(['hidden size-14 shrink-0 sm:block'])}}) }}\n              {%- endif %}\n              {%- set c_12 -%}\n                {%- set c_10 -%}\n                  {{ og_text(og_get(v_line, ['name'])) }}\n                {%- endset -%}\n                {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_10}) }}\n                {%- set c_11 -%}\n                  {{ og_text(og_get(v_line, ['variant'])) }}\n                {%- endset -%}\n                {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_11}) }}\n              {%- endset -%}\n              {{ og_include('compose/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_12}) }}\n            {%- endset -%}\n            {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center'}, 'children': c_13}) }}\n          {%- endset -%}\n          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': og_s(og_cnv([('py-2' if og_t(og_eq(v_density, 'compact')) else 'py-4')]))}, 'children': c_14}) }}\n          {%- set c_15 -%}\n            {{ og_text(og_money(og_get(v_line, ['price']), og_get(v_line, ['currency']))) }}\n          {%- endset -%}\n          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden sm:table-cell'}, 'children': c_15}) }}\n          {%- set c_16 -%}\n            {{ og_include('blocks/number-field.html.j2', {'p': {'value': og_str(og_get(v_line, ['qty'])), 'name': og_tpl('{0}-{1}', [v_field, og_get(v_line, ['id'])]), 'min': '1', 'label': og_get(v_labels, ['qty']), 'decrease': og_get(v_labels, ['decrease']), 'increase': og_get(v_labels, ['increase'])}}) }}\n          {%- endset -%}\n          {{ og_include('compose/table-cell.html.j2', {'p': {}, 'children': c_16}) }}\n          {%- set c_17 -%}\n            {{ og_text(og_money(og_mul(og_get(v_line, ['price']), og_get(v_line, ['qty'])), og_get(v_line, ['currency']))) }}\n          {%- endset -%}\n          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'font-semibold'}, 'children': c_17}) }}\n          {%- set c_19 -%}\n            {%- set c_18 -%}\n              {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'x', 'Size': 16}}) }}\n            {%- endset -%}\n            {{ og_include('compose/button.html.j2', {'p': {'Variant': 'ghost', 'Size': 'sm', 'Layout': 'icon', 'AriaLabel': og_s(og_get(v_labels, ['remove']))}, 'children': c_18}) }}\n          {%- endset -%}\n          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'text-right'}, 'children': c_19}) }}\n        {%- endset -%}\n        {{ og_include('compose/table-row.html.j2', {'p': {'Class': 'border-t border-border', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_20}) }}\n      {%- endfor %}\n    {%- endset -%}\n    {{ og_include('compose/table-body.html.j2', {'p': {}, 'children': c_21}) }}\n  {%- endset -%}\n  {{ og_include('compose/table.html.j2', {'p': {'Class': 'w-full text-left text-sm', 'Attrs': og_attrs(['data-slot', 'cart-table'])}, 'children': c_22}) }}\n{%- endset -%}\n{{ og_include('compose/box.html.j2', {'p': {'Class': 'w-full overflow-x-auto', 'Attrs': og_attrs(['data-slot', 'cart-table-root'])}, 'children': c_23}) }}\n{%- if og_t(og_gt(og_len(v_lines), 0)) %}\n  {%- set c_26 -%}\n    {%- set c_24 -%}\n      {{ og_text(og_get(v_labels, ['subtotal'])) }}\n      {{ og_text(' ') }}\n      {{ og_text(og_money(og_sum_by(v_lines, 'price', 'qty'), og_first_of(v_lines, 'currency'))) }}\n    {%- endset -%}\n    {{ og_include('compose/text.html.j2', {'p': {'Size': 'base', 'Weight': 'bold', 'Attrs': og_attrs(['data-slot', 'subtotal'])}, 'children': c_24}) }}\n    {%- set c_25 -%}\n      {{ og_text(og_get(v_labels, ['checkout'])) }}\n    {%- endset -%}\n    {{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default'}, 'children': c_25}) }}\n  {%- endset -%}\n  {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'between', 'Class': 'mt-4 flex-wrap border-t border-border pt-4', 'Attrs': og_attrs(['data-slot', 'cart-footer'])}, 'children': c_26}) }}\n{%- endif %}\n",
      "path": "blocks/cart-table.html.j2",
      "target": "blocks/cart-table.html.j2"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "jinja2",
      "component"
    ]
  },
  "name": "cart-table",
  "registryDependencies": [
    "box",
    "button",
    "group",
    "inline",
    "lucide-icon",
    "media-frame",
    "number-field",
    "stack",
    "table",
    "table-body",
    "table-caption",
    "table-cell",
    "table-head",
    "table-head-cell",
    "table-row",
    "text",
    "utils"
  ],
  "runtime": "jinja2",
  "title": "Cart Table",
  "type": "registry:component"
}
