{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "smart-home-01",
  "title": "Smart Home",
  "author": "VenusUI",
  "description": "A smart-home panel with a thermostat, light switches and live power use.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://venusui.com/r/thermostat.json",
    "https://venusui.com/r/light-switch-panel.json"
  ],
  "files": [
    {
      "path": "registry/default/blocks/smart-home-01/components/smart-home-01.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Zap } from \"lucide-react\"\n\nimport { LightSwitchPanel } from \"@/registry/default/ui/light-switch-panel\"\nimport { Thermostat } from \"@/registry/default/ui/thermostat\"\n\nconst LIGHTS = [\n  { id: \"living\", label: \"Living\", defaultOn: true },\n  { id: \"kitchen\", label: \"Kitchen\" },\n  { id: \"hall\", label: \"Hall\", defaultOn: true },\n  { id: \"porch\", label: \"Porch\" },\n]\nconst WATTS = 9\nconst INSIDE = 19\n\n/** A smart-home panel: the thermostat, the light switches and what they're using right now. */\nexport function SmartHome01() {\n  const [target, setTarget] = React.useState(21)\n  const [lights, setLights] = React.useState(LIGHTS.filter((light) => light.defaultOn).map((light) => light.id))\n  const heating = target > INSIDE + 0.4\n  const usage = lights.length * WATTS + (heating ? Math.round((target - INSIDE) * 180) : 0)\n\n  return (\n    <section aria-labelledby=\"smart-home-01-title\" className=\"py-24 sm:py-28\">\n      <div className=\"mx-auto max-w-6xl px-4 sm:px-6\">\n        <div className=\"flex flex-wrap items-end justify-between gap-4\">\n          <div>\n            <p className=\"text-sm text-muted-foreground\">Home · Tuesday evening</p>\n            <h2 id=\"smart-home-01-title\" className=\"mt-1 text-3xl font-semibold tracking-tight sm:text-4xl\">\n              Welcome home\n            </h2>\n          </div>\n          <p aria-live=\"polite\" className=\"flex items-center gap-2 rounded-full border px-3 py-1.5 text-sm\">\n            <Zap aria-hidden=\"true\" className=\"size-4 text-amber-500\" />\n            Using <span className=\"font-mono font-medium tabular-nums\">{usage} W</span> now\n          </p>\n        </div>\n        <div className=\"mt-10 grid grid-cols-[minmax(0,1fr)] gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]\">\n          <div className=\"flex flex-col items-center gap-4 rounded-2xl border bg-card p-8 text-card-foreground\">\n            <h3 className=\"self-start text-sm font-medium text-muted-foreground\">Climate</h3>\n            <Thermostat defaultValue={target} current={INSIDE} onValueChange={setTarget} />\n            <p className=\"text-sm text-muted-foreground\">{heating ? `Warming the house by ${(target - INSIDE).toFixed(1)}°` : \"Holding steady\"}</p>\n          </div>\n          <div className=\"flex flex-col gap-4 rounded-2xl border bg-card p-8 text-card-foreground\">\n            <h3 className=\"text-sm font-medium text-muted-foreground\">Lights</h3>\n            <LightSwitchPanel switches={LIGHTS} value={lights} onValueChange={setLights} className=\"mx-auto max-w-lg\" />\n            <p className=\"text-center text-sm text-muted-foreground\">\n              {lights.length} of {LIGHTS.length} on · about {lights.length * WATTS} W\n            </p>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "content"
  ],
  "type": "registry:block"
}