{
  "$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<!--\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\" module>\n  import type { Snippet } from \"svelte\";\n  import type { Pack } from \"./credit-packs.types\";\n\n  export 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 lang=\"ts\">\n  import Badge from \"../compose/Badge.svelte\";\n  import Box from \"../compose/Box.svelte\";\n  import Button from \"../compose/Button.svelte\";\n  import Card from \"../compose/Card.svelte\";\n  import CardContent from \"../compose/CardContent.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import Title from \"../compose/Title.svelte\";\n  import EmptyState from \"../components/empty-state.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import { at, cn, fitCols, fmtMoney } from \"../utils\";\n\n  let {\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  }: CreditPacksProps = $props();\n</script>\n\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  {#if ((packs?.length ?? 0) === 0)}\n    <EmptyState icon=\"coins\" title={empty} />\n  {:else}\n    <Grid\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      {#each packs as pack (pack.id)}\n        <Card\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              {#if (pack.badge || (((item as string) !== \"row\") && (packs.filter((i) => i[\"badge\"]).length > 0)))}\n                <Box class=\"flex min-h-6 items-center\" data-slot=\"badge-slot\">\n                  {#if pack.badge}\n                    <Badge variant=\"default\" size=\"default\" class=\"w-fit shrink-0\">\n                      {at(badges, pack.badge)}\n                    </Badge>\n                  {/if}\n                </Box>\n              {/if}\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      {/each}\n    </Grid>\n  {/if}\n</SectionFrame>\n",
      "path": "blocks/credit-packs.svelte",
      "target": "blocks/credit-packs.svelte"
    },
    {
      "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"
    }
  ],
  "meta": {
    "category": "marketing",
    "group": "pricing",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "credit-packs",
  "registryDependencies": [
    "badge",
    "box",
    "button",
    "card",
    "card-content",
    "empty-state",
    "grid",
    "section-frame",
    "stack",
    "text",
    "title",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Credit Packs",
  "type": "registry:block"
}
