-
Notifications
You must be signed in to change notification settings - Fork 1
/
avatars.go
104 lines (96 loc) · 2.28 KB
/
avatars.go
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package avatars
import htmx "github.com/zeiss/fiber-htmx"
// AvatarProps represents the properties for an avatar.
type AvatarProps struct {
ClassNames htmx.ClassNames
}
// AvatarRounded generates an avatar based on the provided properties.
func AvatarRoundedMedium(p AvatarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.ClassNames{
"avatar": true,
}.Merge(p.ClassNames),
htmx.Div(
htmx.ClassNames{
"w-24": true,
"rounded": true,
},
htmx.Group(children...),
),
)
}
// AvatarRoundedSmall generates an extra small avatar based on the provided properties.
func AvatarRoundedSmall(p AvatarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.ClassNames{
"avatar": true,
}.Merge(p.ClassNames),
htmx.Div(
htmx.ClassNames{
"w-8": true,
"rounded": true,
},
htmx.Group(children...),
),
)
}
// AvatarRoundedLarge generates a large avatar based on the provided properties.
func AvatarRoundedLarge(p AvatarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.ClassNames{
"avatar": true,
}.Merge(p.ClassNames),
htmx.Div(
htmx.ClassNames{
"w-32": true,
"rounded": true,
},
htmx.Group(children...),
),
)
}
// AvatarRoundMedium generates a round avatar based on the provided properties.
func AvatarRoundMedium(p AvatarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.ClassNames{
"avatar": true,
}.Merge(p.ClassNames),
htmx.Div(
htmx.ClassNames{
"w-24": true,
"rounded-full": true,
},
htmx.Group(children...),
),
)
}
// AvatarRoundSmall generates an extra small round avatar based on the provided properties.
func AvatarRoundSmall(p AvatarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.ClassNames{
"avatar": true,
}.Merge(p.ClassNames),
htmx.Div(
htmx.ClassNames{
"w-8": true,
"rounded-full": true,
},
htmx.Group(children...),
),
)
}
// AvatarRoundLarge generates a large round avatar based on the provided properties.
func AvatarRoundLarge(p AvatarProps, children ...htmx.Node) htmx.Node {
return htmx.Div(
htmx.ClassNames{
"avatar": true,
}.Merge(p.ClassNames),
htmx.Div(
htmx.ClassNames{
"w-32": true,
"rounded-full": true,
},
htmx.Group(children...),
),
)
}