{
  "$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 */\nimport { For, type JSX } from \"solid-js\";\nimport { Badge, Box, Button, Card, CardContent, Grid, Stack, Text, Title } from \"../compose\";\nimport { EmptyState } from \"../components/empty-state\";\nimport { SectionFrame } from \"../components/section-frame\";\nimport { at, cn, fitCols, fmtMoney } from \"../utils\";\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\nexport function CreditPacks({\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) {\n  return (\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      {((packs?.length ?? 0) === 0) ? (\n        <EmptyState icon=\"coins\" title={empty} />\n      ) : (\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          <For each={packs ?? []}>{(pack) => (\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                  {(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                      {pack.badge ? (\n                        <Badge variant=\"default\" size=\"default\" class=\"w-fit shrink-0\">\n                          {at(badges, pack.badge)}\n                        </Badge>\n                      ) : null}\n                    </Box>\n                  ) : null}\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          )}</For>\n        </Grid>\n      )}\n    </SectionFrame>\n  );\n}\n",
      "path": "blocks/credit-packs.tsx",
      "target": "blocks/credit-packs.tsx"
    },
    {
      "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": [
      "solid",
      "block"
    ]
  },
  "name": "credit-packs",
  "registryDependencies": [
    "compose",
    "empty-state",
    "section-frame",
    "utils"
  ],
  "runtime": "solid",
  "title": "Credit Packs",
  "type": "registry:block"
}
