11package goaster
22
3- // Constants for different levels of toast notifications.
3+ // Predefined toast levels
44const (
55 DefaultLevel Level = "default"
66 SuccessLevel Level = "success"
@@ -9,29 +9,19 @@ const (
99 InfoLevel Level = "info"
1010)
1111
12- // Default SVG icons for each level of toast notifications.
13- // These are inline SVGs for default icons, which can be replaced by the user.
12+ // Predefined toast positions
1413const (
15- defaultDefaultIcon = `<svg xmlns="http://www.w3.org/2000/svg" style="stroke: currentColor;" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`
16- defaultSuccessIcon = `<svg xmlns="http://www.w3.org/2000/svg" style="stroke: currentColor;" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`
17- defaultErrorIcon = `<svg xmlns="http://www.w3.org/2000/svg" style="stroke: currentColor;" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`
18- defaultWarningIcon = `<svg xmlns="http://www.w3.org/2000/svg" style="stroke: currentColor;" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg>`
19- defaultInfoIcon = `<svg xmlns="http://www.w3.org/2000/svg" style="stroke: currentColor;" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`
14+ TopRight = Position ("top-right" )
15+ TopLeft = Position ("top-left" )
16+ TopCenter = Position ("top-center" )
17+ BottomRight = Position ("bottom-right" )
18+ BottomLeft = Position ("bottom-left" )
19+ BottomCenter = Position ("bottom-center" )
2020)
2121
22- // Position constants define where the toast will appear on the screen.
23- var (
24- TopRight = Position {Name : "top-right" , CSS : gttContainerTopRight ()}
25- TopLeft = Position {Name : "top-left" , CSS : gttContainerTopLeft ()}
26- TopCenter = Position {Name : "top-center" , CSS : gttContainerTopCenter ()}
27- BottomRight = Position {Name : "bottom-right" , CSS : gttContainerBottomRight ()}
28- BottomLeft = Position {Name : "bottom-left" , CSS : gttContainerBottomLeft ()}
29- BottomCenter = Position {Name : "bottom-center" , CSS : gttContainerBottomCenter ()}
30- )
31-
32- // Variant constants define the style variant to be used for the toast.
22+ // Predefined style variants
3323const (
34- Accent = "accent"
35- AccentLight = "accent_light"
36- AccentDark = "accent_dark"
24+ Accent = Variant ( "accent" )
25+ AccentLight = Variant ( "accent_light" )
26+ AccentDark = Variant ( "accent_dark" )
3727)
0 commit comments