Merge pull request #46 from InsanusMokrassar/0.0.45

0.0.45
This commit is contained in:
InsanusMokrassar 2022-03-16 16:04:17 +06:00 committed by GitHub
commit 6144ee5723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 0.0.45
* `Add support of containers in `UIKitContainer` modifiers and `Container` function
## 0.0.44
* `Versions`:

View File

@ -9,4 +9,4 @@ android.enableJetifier=true
# Project data
group=dev.inmo
version=0.0.44
version=0.0.45

View File

@ -0,0 +1,21 @@
package dev.inmo.jsuikit.elements
import androidx.compose.runtime.Composable
import dev.inmo.jsuikit.modifiers.UIKitContainer
import dev.inmo.jsuikit.modifiers.include
import dev.inmo.jsuikit.utils.Attrs
import org.jetbrains.compose.web.dom.ContentBuilder
import org.jetbrains.compose.web.dom.Div
import org.w3c.dom.HTMLDivElement
@Composable
fun Container(
attrs: Attrs<HTMLDivElement> = Attrs.empty(),
contentBuilder: ContentBuilder<HTMLDivElement> = {}
) = Div(
{
include(UIKitContainer)
attrs.builder.invoke(this)
},
contentBuilder
)

View File

@ -0,0 +1,19 @@
package dev.inmo.jsuikit.modifiers
sealed class UIKitContainer(
override val classes: Array<String> = emptyArray(),
override val otherAttrs: Map<String, String> = emptyMap()
) : UIKitModifier {
sealed class Size(size: String) : UIKitContainer(arrayOf("uk-container-$size")) {
object XSmall : Size("xsmall")
object Small : Size("small")
object Large : Size("large")
object XLarge : Size("xlarge")
object Expand : Size("expand")
}
companion object : UIKitContainer(
arrayOf("uk-container")
)
}