8 lines
1.9 KiB
Plaintext
8 lines
1.9 KiB
Plaintext
|
{
|
||
|
"version": 3,
|
||
|
"sources": ["components/Button.tsx", "islands/Counter.tsx"],
|
||
|
"sourcesContent": ["import { JSX } from \"preact\";\nimport { IS_BROWSER } from \"$fresh/runtime.ts\";\n\nexport function Button(props: JSX.HTMLAttributes<HTMLButtonElement>) {\n return (\n <button\n {...props}\n disabled={!IS_BROWSER || props.disabled}\n class={`px-2 py-1 ${props.class ? props.class : \" \"}`}\n />\n );\n}\n", "import type { Signal } from \"@preact/signals\";\nimport { Button } from \"@components/Button.tsx\";\nimport { IconCircleMinus, IconCirclePlus } from \"@components/icons.tsx\";\n\ninterface CounterProps {\n count: Signal<number>;\n}\n\nexport default function Counter(props: CounterProps) {\n props.count.value = Math.max(1, props.count.value);\n return (\n <div class=\"flex items-center px-1 py-2 rounded-xl\">\n <Button\n class=\"\"\n onClick={() => props.count.value -= 1}\n >\n <IconCircleMinus />\n </Button>\n <input\n class=\"text-3xl bg-transparent inline text-center -mx-4\"\n type=\"number\"\n size={props.count.toString().length}\n value={props.count}\n onInput={(ev) => props.count.value = ev.target?.value}\n />\n <Button onClick={() => props.count.value += 1}>\n <IconCirclePlus />\n </Button>\n </div>\n );\n}\n"],
|
||
|
"mappings": "yQAGO,SAAS,OAAO,MAA8C,CACnE,OACE,EAAC,UACE,GAAG,MACJ,SAAU,CAAC,YAAc,MAAM,SAC/B,MAAO,cAAc,MAAM,MAAQ,MAAM,MAAQ,GAAG,GACtD,CAEJ,CCHe,SAAR,QAAyB,MAAqB,CACnD,aAAM,MAAM,MAAQ,KAAK,IAAI,EAAG,MAAM,MAAM,KAAK,EAE/C,EAAC,OAAI,MAAM,yCACT,YAAC,QACC,MAAM,GACN,QAAS,IAAM,MAAM,MAAM,OAAS,EAEpC,WAAC,uBAAgB,EACnB,EACA,EAAC,SACC,MAAM,mDACN,KAAK,SACL,KAAM,MAAM,MAAM,SAAS,EAAE,OAC7B,MAAO,MAAM,MACb,QAAU,IAAO,MAAM,MAAM,MAAQ,GAAG,QAAQ,MAClD,EACA,EAAC,QAAO,QAAS,IAAM,MAAM,MAAM,OAAS,EAC1C,WAAC,sBAAe,EAClB,GACF,CAEJ",
|
||
|
"names": []
|
||
|
}
|