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

@ -44,6 +44,103 @@ func SampleNavbarMenu() TablerMenu {
}
}
// SampleComponents returns sample data for alerts, breadcrumbs, and toasts.
func SampleComponents() FormtablerComponentsPage {
return FormtablerComponentsPage{
Alerts: []FormtablerAlert{
{
Type: "success",
Title: "Success alert!",
ShowClose: true,
},
{
Type: "warning",
Title: "Warning alert with description",
Description: "This is a warning alert with additional description text to provide more context to the user.",
List: []string{"Item one is important", "Item two requires attention", "Item three is optional"},
},
{
Type: "danger",
Title: "Danger alert",
Action: "Undo",
Buttons: true,
},
{
Type: "info",
Title: "Info alert with link",
Link: "Learn more",
ShowClose: true,
},
{
Type: "success",
Title: "Important alert",
Important: true,
ShowClose: true,
},
{
Type: "warning",
Title: "Minor alert variant",
Minor: true,
},
},
Breadcrumbs: []FormtablerBreadcrumb{
{
Items: []FormtablerBreadcrumbItem{
{Title: "Home", Link: "/", HomeIcon: true},
{Title: "Library", Link: "/library"},
{Title: "Data"},
},
},
{
Separator: "arrows",
Items: []FormtablerBreadcrumbItem{
{Title: "Dashboard", Link: "/"},
{Title: "Components", Link: "/components"},
{Title: "Alerts"},
},
},
{
Separator: "dots",
Items: []FormtablerBreadcrumbItem{
{Title: "Home", Link: "/", HomeIcon: true},
{Title: "Settings", Link: "/settings"},
{Title: "Profile"},
},
},
},
Toasts: []FormtablerToast{
{
ID: "simple",
Show: true,
PersonName: "Paweł Kuna",
PersonSrc: "/static/avatars/000m.jpg",
Date: "2 mins ago",
Text: "Hello, world! This is a toast message.",
},
{
ID: "avatar-toast",
Show: true,
PersonName: "Jeffie Lewzey",
PersonSrc: "/static/avatars/052f.jpg",
Date: "5 mins ago",
Text: "Your report has been generated successfully.",
},
{
ID: "cookies",
Show: true,
Date: "just now",
Cookies: true,
},
{
ID: "no-header",
Show: true,
HideHeader: true,
Text: "This toast has no header — just a plain message body.",
},
},
}
}
// SampleCards returns 6 sample cards showing different variants.
func SampleCards() []FormtablerCard {
defaultBody := &FormtablerCardBody{