{
  "$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 { For, type JSX } from \"solid-js\";\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  class?: string;\n};\n\nexport function Rating({ value, label, max = 5, size = 16, class: className }: RatingProps) {\n  const full = Math.round(Math.min(max, Math.max(0, value)));\n  return (\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      <For each={Array.from({ length: max }, (_, i) => i) ?? []}>{(i) => (\n        <LucideIcon name=\"star\" size={size} class={((i < full) ? \"fill-foreground text-foreground\" : \"text-border\")} />\n      )}</For>\n    </Box>\n  );\n}\n",
      "path": "components/rating.tsx",
      "target": "components/rating.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "rating",
  "registryDependencies": [
    "compose",
    "lucide-icon",
    "utils"
  ],
  "runtime": "solid",
  "title": "Rating",
  "type": "registry:component"
}
