{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Rating component",
  "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  One to five stars (a review's grade, the average of a product). The value is read as the label; the stars\n  themselves are decoration.\n-->\n<script lang=\"ts\">\nexport type RatingProps = {\n  value: number;\n  label: string;\n  max?: number;\n  size?: number;\n  class?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport Box from \"../compose/Box.vue\";\nimport LucideIcon from \"../icons/LucideIcon.vue\";\nimport { cn } from \"../utils\";\n\nconst { value, label, max = 5, size = 16, class: className } = defineProps<RatingProps>();\nconst full = computed(() => Math.round(Math.min(max, Math.max(0, value))));\n</script>\n\n<template>\n  <Box\n    :class=\"cn('inline-flex items-center gap-0', className)\"\n    role=\"img\"\n    :aria-label=\"label\"\n    data-slot=\"rating\"\n    :data-value=\"full\"\n  >\n    <LucideIcon\n      v-for=\"i in Array.from({ length: max }, (_, i) => i)\"\n      :key=\"i\"\n      name=\"star\"\n      :size=\"size\"\n      :class=\"((i < full) ? 'fill-foreground text-foreground' : 'text-border')\"\n    />\n  </Box>\n</template>\n",
      "path": "components/rating.vue",
      "target": "components/rating.vue"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "vue",
      "component"
    ]
  },
  "name": "rating",
  "registryDependencies": [
    "box",
    "lucide-icon",
    "utils"
  ],
  "runtime": "vue",
  "title": "Rating",
  "type": "registry:component"
}
