mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 09:51:39 +00:00
* refactor: move database, navigator scripts to state package * feat: add Schema config for dwn * test: add unit tests for InitializeDatabase * feat: use templated index.html for the DWN frontend * feat: introduce templ generation for templ * chore(deps): update devbox.json to use latest packages * chore: update devbox to use bun * feat: introduce dwn config generation * feat: add motr.mjs for vault management * refactor: move front end from to (alert) * feat: implement devbox integration and devbox-based process management * feat: embed motr.mjs script for offline demo * refactor: embed motr.mjs data in embed.go * chore: update workflows to use actions/checkout@v4 * refactor: move process-compose.yaml to deploy directory * refactor: remove unnecessary JSON conversion
30 lines
1.9 KiB
Templ
30 lines
1.9 KiB
Templ
package blocks
|
|
|
|
type InputState int
|
|
|
|
const (
|
|
InputStateDefault InputState = iota
|
|
InputStateError
|
|
InputStateSuccess
|
|
)
|
|
|
|
templ TextInput(state InputState, label string, placeholder string) {
|
|
switch (state) {
|
|
case InputStateDefault:
|
|
<div class="flex flex-col space-y-1.5 p-6">
|
|
<label class="text-xs font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="name">{ label }</label>
|
|
<input type="text" placeholder="{label}" id="name" value="{value}" class="flex w-full h-10 px-3 py-2 text-sm bg-white border rounded-md peer border-neutral-300 ring-offset-background placeholder:text-neutral-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-400 disabled:cursor-not-allowed disabled:opacity-50"/>
|
|
</div>
|
|
case InputStateError:
|
|
<div class="flex flex-col space-y-1.5 p-6">
|
|
<label class="text-xs font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="name">{ label }</label>
|
|
<input type="text" placeholder="{label}" id="name" value="{value}" class="flex w-full h-10 px-3 py-2 text-sm bg-white border rounded-md peer border-neutral-300 ring-offset-background placeholder:text-neutral-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-400 disabled:cursor-not-allowed disabled:opacity-50"/>
|
|
</div>
|
|
case InputStateSuccess:
|
|
<div class="flex flex-col space-y-1.5 p-6">
|
|
<label class="text-xs font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="name">{ label }</label>
|
|
<input type="text" placeholder="{label}" id="name" value="{value}" class="flex w-full h-10 px-3 py-2 text-sm bg-white border rounded-md peer border-neutral-300 ring-offset-background placeholder:text-neutral-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-neutral-400 disabled:cursor-not-allowed disabled:opacity-50"/>
|
|
</div>
|
|
}
|
|
}
|