mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-15 12:53:51 +00:00
40 lines
877 B
Kotlin
40 lines
877 B
Kotlin
|
package dev.inmo.jsuikit.defaults
|
||
|
|
||
|
import androidx.compose.runtime.Composable
|
||
|
import dev.inmo.jsuikit.defaults.modifers.UIKitModifier
|
||
|
import dev.inmo.jsuikit.defaults.modifers.include
|
||
|
import org.jetbrains.compose.web.dom.Span
|
||
|
import org.jetbrains.compose.web.dom.Text
|
||
|
|
||
|
sealed interface Label {
|
||
|
val suffix: String
|
||
|
|
||
|
@Composable
|
||
|
operator fun invoke(
|
||
|
text: String,
|
||
|
vararg modifiers: UIKitModifier
|
||
|
) = Span(
|
||
|
{
|
||
|
classes("uk-label", "uk-label-$suffix")
|
||
|
include(*modifiers)
|
||
|
}
|
||
|
) {
|
||
|
Text(text)
|
||
|
}
|
||
|
|
||
|
object Success : Label {
|
||
|
override val suffix: String
|
||
|
get() = "success"
|
||
|
}
|
||
|
|
||
|
object Warning : Label {
|
||
|
override val suffix: String
|
||
|
get() = "warning"
|
||
|
}
|
||
|
|
||
|
object Error : Label {
|
||
|
override val suffix: String
|
||
|
get() = "danger"
|
||
|
}
|
||
|
}
|