-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathalert.go
More file actions
45 lines (39 loc) · 1.3 KB
/
alert.go
File metadata and controls
45 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package herald
import "charm.land/lipgloss/v2"
// AlertType identifies a GitHub-style alert category.
type AlertType int
const (
// AlertNote renders a blue informational alert.
AlertNote AlertType = iota
// AlertTip renders a green helpful-hint alert.
AlertTip
// AlertImportant renders a purple important-information alert.
AlertImportant
// AlertWarning renders a yellow/amber warning alert.
AlertWarning
// AlertCaution renders a red caution/danger alert.
AlertCaution
)
// AlertConfig holds the display properties for a single alert type.
type AlertConfig struct {
Icon string // Unicode icon for the header line
Label string // Text label (e.g. "Note")
Style lipgloss.Style // Foreground color applied to bar, icon, label, and content
}
// Default icon constants for each alert type. All are plain Unicode (no emoji)
// for broad terminal compatibility.
const (
DefaultAlertNoteIcon = "○"
DefaultAlertTipIcon = "▸"
DefaultAlertImportantIcon = "‼"
DefaultAlertWarningIcon = "⚠"
DefaultAlertCautionIcon = "◇"
)
// Default label constants for each alert type.
const (
DefaultAlertNoteLabel = "Note"
DefaultAlertTipLabel = "Tip"
DefaultAlertImportantLabel = "Important"
DefaultAlertWarningLabel = "Warning"
DefaultAlertCautionLabel = "Caution"
)