alerts, toast amd breadcrum

This commit is contained in:
JACS 2026-05-03 00:06:23 -05:00
parent aa651083cd
commit 1f95f86829
12 changed files with 525 additions and 1 deletions

View file

@ -369,6 +369,48 @@ type FormtablerCardBody struct {
ButtonLink string
}
// FormtablerAlert represents a single alert component.
type FormtablerAlert struct {
Type string // "success", "warning", "danger", "info"
Title string
Description string
List []string // if set, renders as <ul class="alert-list">
Important bool
Minor bool
ShowClose bool
Action string // "Action" button text
Link string // "Link" anchor text
Buttons bool // "Okay" / "Cancel" buttons
Avatar bool
Class string
}
// FormtablerBreadcrumbItem represents a single item in the breadcrumb trail.
type FormtablerBreadcrumbItem struct {
Title string
Link string // empty for the last (active) item
HomeIcon bool // render home icon instead of text for the first item
}
// FormtablerBreadcrumb represents a breadcrumb navigation component.
type FormtablerBreadcrumb struct {
Items []FormtablerBreadcrumbItem
Separator string // optional: "dots", "arrows", "bullets"
Class string
}
// FormtablerToast represents a toast notification component.
type FormtablerToast struct {
ID string
Show bool
HideHeader bool
PersonName string
PersonSrc string
Date string
Text string
Cookies bool // renders cookie consent variant
}
// FormtablerCardProgress represents a progress bar in the card.
type FormtablerCardProgress struct {
Percent int
@ -431,6 +473,14 @@ type FormtablerFormElementsPage struct {
ValidationStates FormtablerValidationStates
}
// FormtablerComponentsPage is the page-specific struct for the combined demo
// showing alerts, toasts, and breadcrumbs.
type FormtablerComponentsPage struct {
Alerts []FormtablerAlert
Breadcrumbs []FormtablerBreadcrumb
Toasts []FormtablerToast
}
// TablerPageData holds the common data for all tabler pages.
// It should NOT contain component-specific fields like tables or forms.
// Add those by creating a page-specific struct that embeds TablerPageData