1// Code generated by templ - DO NOT EDIT.
2
3package systemviews
4
5//lint:file-ignore SA4006 This context is only used if a nested component is present.
6
7import "github.com/a-h/templ"
8import templruntime "github.com/a-h/templ/runtime"
9
10func Icon(name systemIcon) templ.Component {
11 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
12 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
13 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
14 return templ_7745c5c3_CtxErr
15 }
16 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
17 if !templ_7745c5c3_IsBuffer {
18 defer func() {
19 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
20 if templ_7745c5c3_Err == nil {
21 templ_7745c5c3_Err = templ_7745c5c3_BufErr
22 }
23 }()
24 }
25 ctx = templ.InitializeContext(ctx)
26 templ_7745c5c3_Var1 := templ.GetChildren(ctx)
27 if templ_7745c5c3_Var1 == nil {
28 templ_7745c5c3_Var1 = templ.NopComponent
29 }
30 ctx = templ.ClearChildren(ctx)
31 var templ_7745c5c3_Var2 = []any{iconClass(name)}
32 templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
33 if templ_7745c5c3_Err != nil {
34 return templ_7745c5c3_Err
35 }
36 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<svg class=\"")
37 if templ_7745c5c3_Err != nil {
38 return templ_7745c5c3_Err
39 }
40 var templ_7745c5c3_Var3 string
41 templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.ResolveAttributeValue(templ.CSSClasses(templ_7745c5c3_Var2).String())
42 if templ_7745c5c3_Err != nil {
43 return templ.Error{Err: templ_7745c5c3_Err, FileName: `icons.templ`, Line: 1, Col: 0}
44 }
45 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
46 if templ_7745c5c3_Err != nil {
47 return templ_7745c5c3_Err
48 }
49 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\">")
50 if templ_7745c5c3_Err != nil {
51 return templ_7745c5c3_Err
52 }
53 if name == iconTrash {
54 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<path d=\"M10 11v6\"></path> <path d=\"M14 11v6\"></path> <path d=\"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\"></path> <path d=\"M3 6h18\"></path> <path d=\"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\"></path>")
55 if templ_7745c5c3_Err != nil {
56 return templ_7745c5c3_Err
57 }
58 } else if name == iconX {
59 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "<path d=\"M18 6 6 18\"></path> <path d=\"m6 6 12 12\"></path>")
60 if templ_7745c5c3_Err != nil {
61 return templ_7745c5c3_Err
62 }
63 } else if name == iconSearch {
64 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<path d=\"m21 21-4.34-4.34\"></path> <circle cx=\"11\" cy=\"11\" r=\"8\"></circle>")
65 if templ_7745c5c3_Err != nil {
66 return templ_7745c5c3_Err
67 }
68 } else if name == iconSave {
69 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<path d=\"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\"></path> <path d=\"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\"></path> <path d=\"M7 3v4a1 1 0 0 0 1 1h7\"></path>")
70 if templ_7745c5c3_Err != nil {
71 return templ_7745c5c3_Err
72 }
73 } else if name == iconPlus {
74 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "<path d=\"M5 12h14\"></path> <path d=\"M12 5v14\"></path>")
75 if templ_7745c5c3_Err != nil {
76 return templ_7745c5c3_Err
77 }
78 } else if name == iconExternal {
79 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<path d=\"M15 3h6v6\"></path> <path d=\"M10 14 21 3\"></path> <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\"></path>")
80 if templ_7745c5c3_Err != nil {
81 return templ_7745c5c3_Err
82 }
83 } else if name == iconRotateCCW {
84 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\"></path> <path d=\"M3 3v5h5\"></path>")
85 if templ_7745c5c3_Err != nil {
86 return templ_7745c5c3_Err
87 }
88 } else if name == iconCheck {
89 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<path d=\"M20 6 9 17l-5-5\"></path>")
90 if templ_7745c5c3_Err != nil {
91 return templ_7745c5c3_Err
92 }
93 } else if name == iconHistory {
94 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "<path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\"></path> <path d=\"M3 3v5h5\"></path> <path d=\"M12 7v5l4 2\"></path>")
95 if templ_7745c5c3_Err != nil {
96 return templ_7745c5c3_Err
97 }
98 } else if name == iconFolder {
99 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\"></path>")
100 if templ_7745c5c3_Err != nil {
101 return templ_7745c5c3_Err
102 }
103 } else if name == iconTag {
104 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<path d=\"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\"></path> <circle cx=\"7.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\"></circle>")
105 if templ_7745c5c3_Err != nil {
106 return templ_7745c5c3_Err
107 }
108 } else if name == iconSettings {
109 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<path d=\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\"></path> <circle cx=\"12\" cy=\"12\" r=\"3\"></circle>")
110 if templ_7745c5c3_Err != nil {
111 return templ_7745c5c3_Err
112 }
113 } else if name == iconAlert {
114 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"></path> <path d=\"M12 9v4\"></path> <path d=\"M12 17h.01\"></path>")
115 if templ_7745c5c3_Err != nil {
116 return templ_7745c5c3_Err
117 }
118 } else {
119 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<circle cx=\"12\" cy=\"12\" r=\"10\"></circle> <path d=\"M9.09 9a3 3 0 1 1 5.83 1c0 2-3 2-3 4\"></path> <path d=\"M12 17h.01\"></path>")
120 if templ_7745c5c3_Err != nil {
121 return templ_7745c5c3_Err
122 }
123 }
124 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</svg>")
125 if templ_7745c5c3_Err != nil {
126 return templ_7745c5c3_Err
127 }
128 return nil
129 })
130}
131
132func ButtonIconLabel(name systemIcon, label string) templ.Component {
133 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
134 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
135 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
136 return templ_7745c5c3_CtxErr
137 }
138 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
139 if !templ_7745c5c3_IsBuffer {
140 defer func() {
141 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
142 if templ_7745c5c3_Err == nil {
143 templ_7745c5c3_Err = templ_7745c5c3_BufErr
144 }
145 }()
146 }
147 ctx = templ.InitializeContext(ctx)
148 templ_7745c5c3_Var4 := templ.GetChildren(ctx)
149 if templ_7745c5c3_Var4 == nil {
150 templ_7745c5c3_Var4 = templ.NopComponent
151 }
152 ctx = templ.ClearChildren(ctx)
153 templ_7745c5c3_Err = Icon(name).Render(ctx, templ_7745c5c3_Buffer)
154 if templ_7745c5c3_Err != nil {
155 return templ_7745c5c3_Err
156 }
157 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<span>")
158 if templ_7745c5c3_Err != nil {
159 return templ_7745c5c3_Err
160 }
161 var templ_7745c5c3_Var5 string
162 templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(label)
163 if templ_7745c5c3_Err != nil {
164 return templ.Error{Err: templ_7745c5c3_Err, FileName: `icons.templ`, Line: 59, Col: 14}
165 }
166 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
167 if templ_7745c5c3_Err != nil {
168 return templ_7745c5c3_Err
169 }
170 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</span>")
171 if templ_7745c5c3_Err != nil {
172 return templ_7745c5c3_Err
173 }
174 return nil
175 })
176}
177
178func IconOnly(name systemIcon, label string) templ.Component {
179 return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
180 templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
181 if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
182 return templ_7745c5c3_CtxErr
183 }
184 templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
185 if !templ_7745c5c3_IsBuffer {
186 defer func() {
187 templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
188 if templ_7745c5c3_Err == nil {
189 templ_7745c5c3_Err = templ_7745c5c3_BufErr
190 }
191 }()
192 }
193 ctx = templ.InitializeContext(ctx)
194 templ_7745c5c3_Var6 := templ.GetChildren(ctx)
195 if templ_7745c5c3_Var6 == nil {
196 templ_7745c5c3_Var6 = templ.NopComponent
197 }
198 ctx = templ.ClearChildren(ctx)
199 templ_7745c5c3_Err = Icon(name).Render(ctx, templ_7745c5c3_Buffer)
200 if templ_7745c5c3_Err != nil {
201 return templ_7745c5c3_Err
202 }
203 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<span class=\"sv-sr-only\">")
204 if templ_7745c5c3_Err != nil {
205 return templ_7745c5c3_Err
206 }
207 var templ_7745c5c3_Var7 string
208 templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(label)
209 if templ_7745c5c3_Err != nil {
210 return templ.Error{Err: templ_7745c5c3_Err, FileName: `icons.templ`, Line: 64, Col: 33}
211 }
212 _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
213 if templ_7745c5c3_Err != nil {
214 return templ_7745c5c3_Err
215 }
216 templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</span>")
217 if templ_7745c5c3_Err != nil {
218 return templ_7745c5c3_Err
219 }
220 return nil
221 })
222}
223
224var _ = templruntime.GeneratedTemplate