modified: web/components/base/input.templ modified: web/components/base/input_templ.go modified: web/components/base/range.templ modified: web/components/base/range_templ.go modified: web/components/base/select.templ modified: web/components/base/select_templ.go modified: web/components/base/textarea.templ modified: web/components/base/textarea_templ.go modified: web/components/icons.templ modified: web/components/icons_templ.go modified: web/components/issue.templ modified: web/components/issue_templ.go modified: web/components/layout.templ modified: web/components/layout_templ.go new file: web/components/sidebar.templ new file: web/components/sidebar_templ.go new file: web/components/status.templ new file: web/components/status_templ.go modified: web/handler/issues.go new file: web/handler/task.go modified: web/input.css deleted: web/package-lock.json deleted: web/package.json modified: web/routes/layout.templ modified: web/routes/layout_templ.go modified: web/server/routes.go modified: web/server/server.go modified: web/web.go
57 lines
1.2 KiB
Plaintext
57 lines
1.2 KiB
Plaintext
package base
|
|
|
|
import "fmt"
|
|
|
|
type TextareaProps struct {
|
|
ID string
|
|
Label string
|
|
Name string
|
|
Placeholder string
|
|
Value string
|
|
Description string
|
|
Err string
|
|
Class string
|
|
Size string
|
|
Required bool
|
|
Rows int
|
|
Attrs templ.Attributes
|
|
}
|
|
|
|
templ Textarea(props TextareaProps) {
|
|
<fieldset class="fieldset">
|
|
if props.Label != "" {
|
|
<legend class="fieldset-legend">{ props.Label }</legend>
|
|
}
|
|
<textarea
|
|
{ props.Attrs... }
|
|
id={ props.Name }
|
|
name={ props.Name }
|
|
aria-label={ props.Label }
|
|
placeholder={ props.Placeholder }
|
|
class={
|
|
"textarea",
|
|
props.Class,
|
|
templ.KV("textarea-error", props.Err != ""),
|
|
templ.KV("textarea-xs", props.Size == "xs"),
|
|
templ.KV("textarea-sm", props.Size == "sm"),
|
|
templ.KV("textarea-lg", props.Size == "lg"),
|
|
templ.KV("textarea-xl", props.Size == "xl"),
|
|
}
|
|
if props.Rows > 0 {
|
|
rows={ fmt.Sprintf("%d", props.Rows) }
|
|
} else {
|
|
rows="3"
|
|
}
|
|
if props.Required {
|
|
required
|
|
}
|
|
>
|
|
{ props.Value }
|
|
</textarea>
|
|
if props.Description != "" {
|
|
<div class="label">{ props.Description }</div>
|
|
}
|
|
<div class="h-6 p-0! fieldset-label text-error text-sm">{ props.Err }</div>
|
|
</fieldset>
|
|
}
|