edit sources

This commit is contained in:
Abel Luck 2026-03-30 13:49:00 +02:00
parent 847aeae772
commit 328a70ff9b
7 changed files with 512 additions and 38 deletions

View file

@ -273,7 +273,16 @@ def input_field(
placeholder: str = "",
help_text: str | None = None,
signal_name: str | None = None,
disabled: bool = False,
) -> Renderable:
class_name = (
"mt-2 block w-full rounded-2xl border-0 px-3.5 py-2.5 text-sm shadow-sm ring-1 "
+ (
"cursor-not-allowed bg-slate-100 text-slate-500 ring-slate-200"
if disabled
else "bg-white text-slate-900 ring-slate-200 placeholder:text-slate-400 focus:outline-hidden focus:ring-2 focus:ring-amber-500"
)
)
return h.div[
h.label(for_=field_id, class_="block text-sm font-medium text-slate-900")[
label
@ -285,7 +294,8 @@ def input_field(
type="text",
value=value,
placeholder=placeholder,
class_="mt-2 block w-full rounded-2xl border-0 bg-white px-3.5 py-2.5 text-sm text-slate-900 shadow-sm ring-1 ring-slate-200 placeholder:text-slate-400 focus:outline-hidden focus:ring-2 focus:ring-amber-500",
disabled=disabled,
class_=class_name,
),
help_text and h.p(class_="mt-2 text-xs text-slate-500")[help_text],
]