{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "ratings-star-summary",
  "title": "Ratings — Star Summary",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-vue/blocks/ratings-star-summary/RatingsStarSummary.vue",
      "content": "<script setup lang=\"ts\">\nimport { Star } from 'lucide-vue-next'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Card, CardContent } from '@/components/ui/card'\nimport { Progress } from '@/components/ui/progress'\nimport { Separator } from '@/components/ui/separator'\n\nconst score = 4.7\nconst total = 2117\n\nconst distribution = [\n  { stars: 5, count: 1587 },\n  { stars: 4, count: 381 },\n  { stars: 3, count: 97 },\n  { stars: 2, count: 31 },\n  { stars: 1, count: 21 },\n]\n\nconst STAR_SLOTS = [1, 2, 3, 4, 5]\n\n/** Fill percentage for one slot, so 4.7 draws a real partial star. */\nfunction fillFor(slot: number) {\n  return `${Math.min(Math.max(score - (slot - 1), 0), 1) * 100}%`\n}\n</script>\n\n<template>\n  <section data-slot=\"ratings-star-summary\" class=\"bg-background\">\n    <div class=\"mx-auto max-w-4xl px-6 py-20 lg:py-28\">\n      <Badge variant=\"secondary\">Reviews</Badge>\n      <h2 class=\"mt-4 text-3xl font-semibold tracking-tight sm:text-4xl\">\n        What {{ total.toLocaleString() }} people say\n      </h2>\n\n      <Card class=\"mt-8\">\n        <CardContent class=\"grid gap-8 p-6 sm:grid-cols-[auto_1fr] sm:gap-12 sm:p-8\">\n          <div class=\"text-center sm:text-left\">\n            <p class=\"font-display text-5xl font-bold tracking-tight\">{{ score.toFixed(1) }}</p>\n            <div\n              class=\"mt-2 flex items-center justify-center gap-0.5 sm:justify-start\"\n              role=\"img\"\n              :aria-label=\"`${score} out of 5`\"\n            >\n              <span v-for=\"slot in STAR_SLOTS\" :key=\"slot\" class=\"relative inline-flex\">\n                <Star class=\"text-muted-foreground/30 size-4\" aria-hidden=\"true\" />\n                <span\n                  class=\"absolute inset-y-0 left-0 overflow-hidden\"\n                  :style=\"{ width: fillFor(slot) }\"\n                  aria-hidden=\"true\"\n                >\n                  <Star class=\"fill-primary text-primary size-4\" />\n                </span>\n              </span>\n            </div>\n            <p class=\"text-muted-foreground mt-2 text-xs\">{{ total.toLocaleString() }} verified reviews</p>\n          </div>\n\n          <Separator orientation=\"vertical\" class=\"hidden h-auto sm:block\" />\n\n          <dl class=\"space-y-2.5\">\n            <div v-for=\"row in distribution\" :key=\"row.stars\" class=\"flex items-center gap-4\">\n              <dt class=\"text-muted-foreground w-12 shrink-0 font-mono text-xs\">{{ row.stars }} star</dt>\n              <dd class=\"flex min-w-0 grow items-center gap-4\">\n                <Progress\n                  :model-value=\"Math.round((row.count / total) * 100)\"\n                  class=\"h-1.5\"\n                  :aria-label=\"`${row.stars} star reviews`\"\n                />\n                <span class=\"text-muted-foreground w-12 shrink-0 text-right font-mono text-xs\">\n                  {{ row.count.toLocaleString() }}\n                </span>\n              </dd>\n            </div>\n          </dl>\n        </CardContent>\n      </Card>\n\n      <div class=\"mt-6 flex flex-wrap items-center gap-4\">\n        <Button variant=\"outline\">Read the one-star reviews</Button>\n        <p class=\"text-muted-foreground text-sm\">They are the useful ones, and we have not hidden them.</p>\n      </div>\n    </div>\n  </section>\n</template>\n",
      "type": "registry:block",
      "target": "~/app/components/blocks/RatingsStarSummary.vue"
    }
  ],
  "dependencies": [
    "lucide-vue-next"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/vue/badge.json",
    "https://uipkge.dev/r/vue/button.json",
    "https://uipkge.dev/r/vue/card.json",
    "https://uipkge.dev/r/vue/progress.json",
    "https://uipkge.dev/r/vue/separator.json"
  ],
  "description": "Aggregate rating summary pairing a large score and partial-star row with a per-star distribution and the review count each bar represents.",
  "categories": [
    "marketing"
  ]
}