{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "One to five stars (a review's grade, the average of a product). The value is read as the label; the stars themselves are decoration.",
  "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 */\nimport { type ReactNode } from \"react\";\nimport { Box } from \"../compose\";\nimport { LucideIcon } from \"../icons/LucideIcon\";\nimport { cn } from \"../utils\";\n\nexport type RatingProps = {\n  value: number;\n  label: string;\n  max?: number;\n  size?: number;\n  className?: string;\n};\n\nexport function Rating({ value, label, max = 5, size = 16, className }: RatingProps) {\n  const full = Math.round(Math.min(max, Math.max(0, value)));\n  return (\n    <Box\n      className={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      {(Array.from({ length: max }, (_, i) => i) ?? []).map((i) => (\n        <LucideIcon key={i}\n          name=\"star\"\n          size={size}\n          className={((i < full) ? \"fill-foreground text-foreground\" : \"text-border\")}\n        />\n      ))}\n    </Box>\n  );\n}\n",
      "path": "components/rating.tsx",
      "target": "components/rating.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "react",
      "component"
    ]
  },
  "name": "rating",
  "registryDependencies": [
    "compose",
    "lucide-icon",
    "utils"
  ],
  "runtime": "react",
  "title": "Rating",
  "type": "registry:component"
}
