feat: Adds page header styles, starts an Alert component.
This commit is contained in:
28
Sources/Styleguide/Alert.swift
Normal file
28
Sources/Styleguide/Alert.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
import Elementary
|
||||
|
||||
public struct Alert<Content: HTML>: HTML {
|
||||
|
||||
let inner: Content
|
||||
|
||||
public init(@HTMLBuilder content: () -> Content) {
|
||||
self.inner = content()
|
||||
}
|
||||
|
||||
public var body: some HTML<HTMLTag.div> {
|
||||
div(.class("flex space-x-2")) {
|
||||
SVG(.triangleAlert)
|
||||
inner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Alert: Sendable where Content: Sendable {}
|
||||
|
||||
extension Alert where Content == p<HTMLText> {
|
||||
|
||||
public init(_ description: String) {
|
||||
self.init {
|
||||
p { description }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user