{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Post Card block",
  "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 Post = {\n  id: string;\n  title: string;\n  excerpt: string;\n  category: string;\n  author: string;\n  date: string;\n  minutes: number;\n  icon: string;\n  href?: string;\n  image?: string;\n};\n\nexport type PostLabels = {\n  minutes: string;\n  by: string;\n  read: string;\n  empty: string;\n};\n",
      "path": "blocks/post-card.types.ts",
      "target": "blocks/post-card.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  A post as a card: cover picture, category, title, excerpt, author line and a read link. Axes: layout\n  (vertical, horizontal), media (image, none), meta (full, short: the date only, news: date and title only),\n  density.\n-->\n<script lang=\"ts\">\nimport type { Post, PostLabels } from \"./post-card.types\";\n\nexport type PostCardProps = {\n  post: Post;\n  labels: PostLabels;\n  layout?: \"vertical\" | \"horizontal\";\n  media?: \"image\" | \"none\";\n  meta?: \"full\" | \"short\" | \"news\";\n  density?: \"default\" | \"compact\";\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Block from \"../compose/Block.vue\";\nimport Box from \"../compose/Box.vue\";\nimport CardContent from \"../compose/CardContent.vue\";\nimport Group from \"../compose/Group.vue\";\nimport Link from \"../compose/Link.vue\";\nimport LucideIcon from \"../icons/LucideIcon.vue\";\nimport Text from \"../compose/Text.vue\";\nimport Title from \"../compose/Title.vue\";\nimport MediaFrame from \"../components/media-frame.vue\";\nimport { defaults } from \"../presets/defaults\";\nimport { cn, tpl, urlOf } from \"../utils\";\n\nconst {\n  post,\n  labels,\n  layout = \"vertical\",\n  media = \"image\",\n  meta = \"full\",\n  density = \"default\",\n} = defineProps<PostCardProps>();\n</script>\n\n<template>\n  <Block v-if=\"((meta as string) === 'news')\"\n    tag=\"article\"\n    :class=\"cn(\n      'flex flex-col gap-2 overflow-hidden rounded p-0 inset-ring inset-ring-border',\n      defaults.news.card\n    )\"\n    :data-layout=\"layout\"\n    data-meta=\"news\"\n    data-slot=\"item\"\n  >\n    <Box :class=\"cn('relative shrink-0 overflow-hidden', defaults.news.cover)\" data-slot=\"news-cover\">\n      <MediaFrame :alt=\"post.title\" :src=\"post.image\" :class=\"cn('size-full', defaults.media.rounded)\" />\n      <Title\n        :as=\"3\"\n        size=\"xs\"\n        weight=\"semibold\"\n        :class=\"cn(\n          'pointer-events-none absolute inset-x-12 line-clamp-2 text-center leading-5 text-foreground',\n          defaults.news.title\n        )\"\n        data-slot=\"news-title\"\n      >\n        {{ post.title }}\n      </Title>\n    </Box>\n    <Group\n      gap=\"2\"\n      align=\"center\"\n      :class=\"cn('w-full px-2 text-muted-foreground', defaults.news.strip)\"\n      data-slot=\"news-date\"\n    >\n      <LucideIcon name=\"calendar\" :size=\"16\" />\n      <Text size=\"xs\" weight=\"bold\" class=\"leading-4\">\n        {{ post.date }}\n      </Text>\n      <Text v-if=\"post.category\" size=\"xs\" weight=\"bold\" class=\"leading-4\">\n        {{ post.category }}\n      </Text>\n    </Group>\n  </Block>\n  <Block v-else\n    tag=\"article\"\n    :class=\"cn(\n      'flex flex-col gap-8 bg-card p-6 text-card-foreground inset-ring inset-ring-border rounded',\n      'h-full gap-4 overflow-hidden',\n      (((layout as string) === 'horizontal') ? 'flex flex-col sm:flex-row' : 'flex flex-col')\n    )\"\n    data-slot=\"card\"\n    :data-layout=\"layout\"\n    :data-meta=\"meta\"\n  >\n    <Box\n      v-if=\"((media as string) === 'image')\"\n      :class=\"cn('relative shrink-0', (((layout as string) === 'horizontal') ? 'sm:w-64' : ''))\"\n    >\n      <MediaFrame :alt=\"post.title\" :src=\"post.image\" class=\"h-full\" />\n    </Box>\n    <CardContent class=\"flex flex-1 flex-col gap-2\">\n      <Group v-if=\"((meta as string) !== 'news')\" gap=\"2\" align=\"center\">\n        <LucideIcon :name=\"post.icon\" :size=\"16\" />\n        <Text size=\"xs\" class=\"uppercase tracking-wide text-muted-foreground\">\n          {{ post.category }}\n        </Text>\n      </Group>\n      <Title :as=\"3\" size=\"xl\" weight=\"bold\">\n        {{ post.title }}\n      </Title>\n      <Text\n        v-if=\"(((density as string) === 'default') && ((meta as string) !== 'news'))\"\n        size=\"sm\"\n        class=\"text-muted-foreground\"\n      >\n        {{ post.excerpt }}\n      </Text>\n      <Group v-if=\"((meta as string) !== 'news')\" gap=\"2\" class=\"mt-auto flex-wrap pt-2 text-muted-foreground\">\n        <Text v-if=\"((meta as string) === 'full')\" size=\"xs\">\n          {{ tpl(labels.by, post.author) }}\n        </Text>\n        <Text size=\"xs\">\n          {{ post.date }}\n        </Text>\n        <Text v-if=\"((meta as string) === 'full')\" size=\"xs\">\n          {{ tpl(labels.minutes, post.minutes) }}\n        </Text>\n      </Group>\n      <Link\n        v-if=\"(((meta as string) !== 'news') && post.href)\"\n        :href=\"urlOf(post.href)\"\n        variant=\"default\"\n        data-slot=\"read\"\n      >\n        {{ labels.read }}\n      </Link>\n    </CardContent>\n  </Block>\n</template>\n",
      "path": "blocks/post-card.vue",
      "target": "blocks/post-card.vue"
    }
  ],
  "meta": {
    "category": "general",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "post-card",
  "registryDependencies": [
    "block",
    "box",
    "card-content",
    "group",
    "link",
    "lucide-icon",
    "media-frame",
    "presets",
    "text",
    "title",
    "utils"
  ],
  "runtime": "vue",
  "title": "Post Card",
  "type": "registry:block"
}
