{
  "$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/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/parts/rating.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/icons\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// RatingProps are the props of Rating; the values are the JSON shapes of the TypeScript props.\ntype RatingProps struct {\n\tValue any `json:\"value\"`\n\tLabel any `json:\"label\"`\n\tMax any `json:\"max\"`\n\tSize any `json:\"size\"`\n\tClass string `json:\"className\"`\n}\n\n// 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.\ntempl Rating(p RatingProps) {\n\t{{ vValue := p.Value }}\n\t{{ vLabel := p.Label }}\n\t{{ vMax := uiutils.Def(p.Max, float64(5)) }}\n\t{{ vSize := uiutils.Def(p.Size, float64(16)) }}\n\t{{ vFull := any(uiutils.Round(uiutils.Min(vMax, uiutils.Max(float64(0), vValue)))) }}\n\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"inline-flex items-center gap-0\", p.Class)), Attrs: uiutils.Attrs(\"role\", \"img\", \"aria-label\", vLabel, \"data-slot\", \"rating\", \"data-value\", vFull)}}) {\n\t\tfor _, vI := range uiutils.L(uiutils.Range(vMax)) {\n\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"star\", Size: uiutils.I(vSize), Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Lt(vI, vFull)), \"fill-foreground text-foreground\", \"text-border\"))})\n\t\t}\n\t}\n}\n",
      "path": "blocks/rating.templ",
      "target": "blocks/rating.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "rating",
  "registryDependencies": [
    "box",
    "kit-box",
    "lucide-icon",
    "utils"
  ],
  "runtime": "templ",
  "title": "Rating",
  "type": "registry:component"
}
