add AlertCloseButton

This commit is contained in:
InsanusMokrassar 2022-02-09 13:53:56 +06:00
parent 53c728d7bc
commit dcc8646f18

View File

@ -2,11 +2,11 @@ package dev.inmo.jsuikit.elements
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import dev.inmo.jsuikit.buildAndAddAttribute import dev.inmo.jsuikit.buildAndAddAttribute
import dev.inmo.jsuikit.modifiers.UIKitAnimation import dev.inmo.jsuikit.modifiers.*
import dev.inmo.jsuikit.utils.Attrs import dev.inmo.jsuikit.utils.Attrs
import dev.inmo.jsuikit.utils.Milliseconds import dev.inmo.jsuikit.utils.Milliseconds
import org.jetbrains.compose.web.dom.ContentBuilder import org.jetbrains.compose.web.dom.*
import org.jetbrains.compose.web.dom.Div import org.w3c.dom.HTMLAnchorElement
import org.w3c.dom.HTMLDivElement import org.w3c.dom.HTMLDivElement
@Composable @Composable
@ -28,3 +28,20 @@ fun Alert(
}, },
content content
) )
@Composable
fun AlertCloseButton(
attrs: Attrs<HTMLAnchorElement> = Attrs.empty(),
content: ContentBuilder<HTMLAnchorElement> = @Composable {}
) {
A(
null,
{
include(UIKitAlert.Close)
attr("uk-close", "")
attrs.builder(this)
},
content
)
}