{
  "$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\" module>\n  import type { Snippet } from \"svelte\";\n\n  export type RatingProps = {\n    value: number;\n    label: string;\n    max?: number;\n    size?: number;\n    class?: string;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import LucideIcon from \"../icons/LucideIcon.svelte\";\n  import { cn } from \"../utils\";\n\n  let { value, label, max = 5, size = 16, class: className }: RatingProps = $props();\n  const full = $derived(Math.round(Math.min(max, Math.max(0, value))));\n</script>\n\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  {#each Array.from({ length: max }, (_, i) => i) as i (i)}\n    <LucideIcon name=\"star\" size={size} class={((i < full) ? \"fill-foreground text-foreground\" : \"text-border\")} />\n  {/each}\n</Box>\n",
      "path": "components/rating.svelte",
      "target": "components/rating.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "rating",
  "registryDependencies": [
    "box",
    "lucide-icon",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Rating",
  "type": "registry:component"
}
