{
  "$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 = (p.lines ?? null) -%}\n{%- set v_labels = (p.labels ?? null) -%}\n{%- set v_media = (p.media ?? 'image') -%}\n{%- set v_density = (p.density ?? 'default') -%}\n{%- set v_field = (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    {{ include('compose/TableCaption.html.twig', {'class': 'sr-only', 'children': c_1}, with_context = false) }}\n    {%- set c_9 -%}\n      {%- set c_8 -%}\n        {%- set c_2 -%}\n          {{ og_text(og_get(v_labels, ['product'])) }}\n        {%- endset -%}\n        {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_2}, with_context = false) }}\n        {%- set c_3 -%}\n          {{ og_text(og_get(v_labels, ['price'])) }}\n        {%- endset -%}\n        {{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 sm:table-cell', 'attrs': og_attrs(['scope', 'col']), 'children': c_3}, with_context = false) }}\n        {%- set c_4 -%}\n          {{ og_text(og_get(v_labels, ['qty'])) }}\n        {%- endset -%}\n        {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_4}, with_context = false) }}\n        {%- set c_5 -%}\n          {{ og_text(og_get(v_labels, ['total'])) }}\n        {%- endset -%}\n        {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_5}, with_context = false) }}\n        {%- set c_7 -%}\n          {%- set c_6 -%}\n            {{ og_text(og_get(v_labels, ['remove'])) }}\n          {%- endset -%}\n          {{ include('compose/Inline.html.twig', {'class': 'sr-only', 'children': c_6}, with_context = false) }}\n        {%- endset -%}\n        {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_7}, with_context = false) }}\n      {%- endset -%}\n      {{ include('compose/TableRow.html.twig', {'children': c_8}, with_context = false) }}\n    {%- endset -%}\n    {{ include('compose/TableHead.html.twig', {'children': c_9}, with_context = false) }}\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                {{ include('blocks/media-frame.html.twig', {'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'])}}, with_context = false) }}\n              {%- endif %}\n              {%- set c_12 -%}\n                {%- set c_10 -%}\n                  {{ og_text(og_get(v_line, ['name'])) }}\n                {%- endset -%}\n                {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_10}, with_context = false) }}\n                {%- set c_11 -%}\n                  {{ og_text(og_get(v_line, ['variant'])) }}\n                {%- endset -%}\n                {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_11}, with_context = false) }}\n              {%- endset -%}\n              {{ include('compose/Stack.html.twig', {'gap': '0', 'children': c_12}, with_context = false) }}\n            {%- endset -%}\n            {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'children': c_13}, with_context = false) }}\n          {%- endset -%}\n          {{ include('compose/TableCell.html.twig', {'class': og_s(og_cnv([(og_t(og_eq(v_density, 'compact')) ? 'py-2' : 'py-4')])), 'children': c_14}, with_context = false) }}\n          {%- set c_15 -%}\n            {{ og_text(og_money(og_get(v_line, ['price']), og_get(v_line, ['currency']))) }}\n          {%- endset -%}\n          {{ include('compose/TableCell.html.twig', {'class': 'hidden sm:table-cell', 'children': c_15}, with_context = false) }}\n          {%- set c_16 -%}\n            {{ include('blocks/number-field.html.twig', {'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'])}}, with_context = false) }}\n          {%- endset -%}\n          {{ include('compose/TableCell.html.twig', {'children': c_16}, with_context = false) }}\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          {{ include('compose/TableCell.html.twig', {'class': 'font-semibold', 'children': c_17}, with_context = false) }}\n          {%- set c_19 -%}\n            {%- set c_18 -%}\n              {{ include('icons/LucideIcon.html.twig', {'name': 'x', 'size': 16}, with_context = false) }}\n            {%- endset -%}\n            {{ include('compose/Button.html.twig', {'variant': 'ghost', 'size': 'sm', 'layout': 'icon', 'ariaLabel': og_s(og_get(v_labels, ['remove'])), 'children': c_18}, with_context = false) }}\n          {%- endset -%}\n          {{ include('compose/TableCell.html.twig', {'class': 'text-right', 'children': c_19}, with_context = false) }}\n        {%- endset -%}\n        {{ include('compose/TableRow.html.twig', {'class': 'border-t border-border', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_20}, with_context = false) }}\n      {%- endfor %}\n    {%- endset -%}\n    {{ include('compose/TableBody.html.twig', {'children': c_21}, with_context = false) }}\n  {%- endset -%}\n  {{ include('compose/Table.html.twig', {'class': 'w-full text-left text-sm', 'attrs': og_attrs(['data-slot', 'cart-table']), 'children': c_22}, with_context = false) }}\n{%- endset -%}\n{{ include('compose/Box.html.twig', {'class': 'w-full overflow-x-auto', 'attrs': og_attrs(['data-slot', 'cart-table-root']), 'children': c_23}, with_context = false) }}\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    {{ include('compose/Text.html.twig', {'size': 'base', 'weight': 'bold', 'attrs': og_attrs(['data-slot', 'subtotal']), 'children': c_24}, with_context = false) }}\n    {%- set c_25 -%}\n      {{ og_text(og_get(v_labels, ['checkout'])) }}\n    {%- endset -%}\n    {{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'default', 'children': c_25}, with_context = false) }}\n  {%- endset -%}\n  {{ include('compose/Group.html.twig', {'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}, with_context = false) }}\n{%- endif %}\n",
      "path": "blocks/cart-table.html.twig",
      "target": "blocks/cart-table.html.twig"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "twig",
      "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": "twig",
  "title": "Cart Table",
  "type": "registry:component"
}
