{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "One-off packs of credits with a price: tiles in two or four columns, or rows.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n\nexport type Pack = {\n  id: string;\n  name: string;\n  credits: number;\n  price: number;\n  currency: string;\n  badge: string;\n};\n",
      "path": "blocks/credit-packs.types.ts",
      "target": "blocks/credit-packs.types.ts"
    },
    {
      "content": "<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->\n<!--\n  Packs of credits as tiles: the amount, a badge, the price and a buy button. Axes: columns (2, 4), item (tile,\n  row), tone, density.\n-->\n<script lang=\"ts\">\nimport type { Pack } from \"./credit-packs.types\";\n\nexport type CreditPacksProps = {\n  id: string;\n  title: string;\n  packs: Pack[];\n  empty?: string;\n  badges: Record<string, string>;\n  buy: string;\n  cols?: \"2\" | \"4\";\n  item?: \"tile\" | \"row\";\n  tone?: \"default\" | \"muted\";\n  density?: \"default\" | \"compact\";\n  landmarkLabel?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Badge from \"../compose/Badge.vue\";\nimport Box from \"../compose/Box.vue\";\nimport Button from \"../compose/Button.vue\";\nimport Card from \"../compose/Card.vue\";\nimport CardContent from \"../compose/CardContent.vue\";\nimport Grid from \"../compose/Grid.vue\";\nimport Stack from \"../compose/Stack.vue\";\nimport Text from \"../compose/Text.vue\";\nimport Title from \"../compose/Title.vue\";\nimport EmptyState from \"../components/empty-state.vue\";\nimport SectionFrame from \"../components/section-frame.vue\";\nimport { at, cn, fitCols, fmtMoney } from \"../utils\";\n\nconst {\n  id,\n  title,\n  packs,\n  empty = \"\",\n  badges,\n  buy,\n  cols = \"4\",\n  item = \"tile\",\n  tone = \"default\",\n  density = \"default\",\n  landmarkLabel,\n} = defineProps<CreditPacksProps>();\n</script>\n\n<template>\n  <SectionFrame\n    :id=\"id\"\n    :title=\"title\"\n    :tone=\"tone\"\n    :density=\"density\"\n    :measure=\"(((item as string) === 'row') ? '2xl' : 'default')\"\n    :landmarkLabel=\"landmarkLabel\"\n  >\n    <EmptyState v-if=\"((packs?.length ?? 0) === 0)\" icon=\"coins\" :title=\"empty\" />\n    <Grid v-else\n      :cols=\"\n        (item as string) === 'row' ? '1'\n        : fitCols((((cols as string) === '2') ? '1-2' : '1-4'), (packs?.length ?? 0))\n      \"\n      class=\"gap-4\"\n      data-slot=\"items\"\n    >\n      <Card v-for=\"pack in packs\" :key=\"pack.id\"\n        variant=\"default\"\n        :class=\"cn(\n          'h-full',\n          (\n            (item as string) === 'row' ? 'gap-4 p-4'\n            : (density as string) === 'compact' ? 'gap-4 p-4'\n            : ''\n          )\n        )\"\n        :data-badge=\"pack.badge\"\n      >\n        <CardContent\n          :class=\"cn(\n            'flex h-full gap-4',\n            (((item as string) === 'row') ? 'flex-row flex-wrap items-center justify-between' : 'flex-col')\n          )\"\n        >\n          <Stack gap=\"2\" align=\"start\" :class=\"cn('min-w-0', (((item as string) === 'row') ? 'flex-1' : ''))\">\n            <Box\n              v-if=\"(pack.badge || (((item as string) !== 'row') && (packs.filter((i) => i['badge']).length > 0)))\"\n              class=\"flex min-h-6 items-center\"\n              data-slot=\"badge-slot\"\n            >\n              <Badge v-if=\"pack.badge\" variant=\"default\" size=\"default\" class=\"w-fit shrink-0\">\n                {{ at(badges, pack.badge) }}\n              </Badge>\n            </Box>\n            <Stack gap=\"0\" class=\"min-w-0\">\n              <Title :as=\"3\" size=\"xl\" weight=\"bold\">\n                {{ pack.name }}\n              </Title>\n              <Text size=\"2xl\" weight=\"bold\">\n                {{ fmtMoney(pack.price, pack.currency) }}\n              </Text>\n            </Stack>\n          </Stack>\n          <Button\n            :variant=\"((pack.badge === 'popular') ? 'default' : 'outline')\"\n            size=\"sm\"\n            type=\"button\"\n            :class=\"cn('w-fit shrink-0', (((item as string) === 'row') ? '' : 'mt-auto'))\"\n          >\n            {{ buy }}\n          </Button>\n        </CardContent>\n      </Card>\n    </Grid>\n  </SectionFrame>\n</template>\n",
      "path": "blocks/credit-packs.vue",
      "target": "blocks/credit-packs.vue"
    }
  ],
  "meta": {
    "category": "marketing",
    "group": "pricing",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "credit-packs",
  "registryDependencies": [
    "badge",
    "box",
    "button",
    "card",
    "card-content",
    "empty-state",
    "grid",
    "section-frame",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "vue",
  "title": "Credit Packs",
  "type": "registry:block"
}
