feat: Updates rectangular size to be a modal form, some style updates to other views.
This commit is contained in:
24
Sources/Styleguide/Tooltip.swift
Normal file
24
Sources/Styleguide/Tooltip.swift
Normal file
@@ -0,0 +1,24 @@
|
||||
import Elementary
|
||||
|
||||
public struct Tooltip<Inner: HTML & Sendable>: HTML, Sendable {
|
||||
|
||||
let tooltip: String
|
||||
let inner: Inner
|
||||
|
||||
public init(
|
||||
_ tooltip: String,
|
||||
@HTMLBuilder inner: () -> Inner
|
||||
) {
|
||||
self.tooltip = tooltip
|
||||
self.inner = inner()
|
||||
}
|
||||
|
||||
public var body: some HTML<HTMLTag.div> {
|
||||
div(
|
||||
.class("tooltip"),
|
||||
.data("tip", value: tooltip)
|
||||
) {
|
||||
inner
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user