- button.css: replaced with go-backend multi-class selector version + ghost variant rules
- badge.css: replaced with go-backend pill-shape version + primary variant
- card.css: replaced with go-backend token-based header/body/footer version
- card.templ: migrated from children passthrough to typed CardProps{Header/Body/Footer}
- ui_test.go: rewrote TestCard_RendersChildren -> TestCard_RendersTypedRegions; added TestBadge_PrimaryVariant; added textComponent helper + io import
- auth_login.templ, auth_signup.templ: migrated Card usage to typed CardProps API
- tablos.templ: migrated TabloCard to typed CardProps API with extracted tabloCardBody
- planning.templ, tasks.templ, events.templ, etapes.templ: all compound button class strings updated to multi-class pattern
- go test ./... passes (all packages green)
- just generate succeeds
24 lines
612 B
Text
24 lines
612 B
Text
package ui
|
|
|
|
// CardProps is the input to the Card templ component.
|
|
// Header, Body, and Footer are optional typed regions — nil fields are omitted
|
|
// from the rendered output (no empty wrapper divs).
|
|
type CardProps struct {
|
|
Header templ.Component
|
|
Body templ.Component
|
|
Footer templ.Component
|
|
}
|
|
|
|
templ Card(props CardProps) {
|
|
<section class="ui-card">
|
|
if props.Header != nil {
|
|
<div class="ui-card-header">@props.Header</div>
|
|
}
|
|
if props.Body != nil {
|
|
<div class="ui-card-body">@props.Body</div>
|
|
}
|
|
if props.Footer != nil {
|
|
<div class="ui-card-footer">@props.Footer</div>
|
|
}
|
|
</section>
|
|
}
|