Compare commits

...

9 Commits
0.1.5 ... 0.1.8

7 changed files with 50 additions and 5 deletions

View File

@@ -1,5 +1,17 @@
# Changelog
## 0.1.8
* `Compose`: `1.2.0-alpha01-dev731`
## 0.1.7
Add Toggle builder
## 0.1.6
* Add support of UIKitButton size and group
## 0.1.5
* Fix access to `UIKitSticky`

View File

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

View File

@@ -1,9 +1,9 @@
[versions]
kt = "1.6.21"
jb-compose = "1.2.0-alpha01-dev686"
jb-compose = "1.2.0-alpha01-dev731"
jb-dokka = "1.6.21"
gh-release = "2.3.7"
gh-release = "2.4.1"
[libraries]

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -0,0 +1,26 @@
package dev.inmo.jsuikit.elements
import androidx.compose.runtime.Composable
import dev.inmo.jsuikit.modifiers.UIKitToggle
import dev.inmo.jsuikit.modifiers.include
import dev.inmo.jsuikit.utils.Attrs
import org.jetbrains.compose.web.attributes.ButtonType
import org.jetbrains.compose.web.attributes.type
import org.jetbrains.compose.web.dom.Button
import org.jetbrains.compose.web.dom.ContentBuilder
import org.w3c.dom.HTMLButtonElement
@Composable
fun Toggle(
attrs: Attrs<HTMLButtonElement>,
contentBuilder: ContentBuilder<HTMLButtonElement>
) {
Button(
{
include(UIKitToggle)
type(ButtonType.Button)
attrs.builder(this)
},
contentBuilder
)
}

View File

@@ -12,5 +12,12 @@ sealed class UIKitButton(suffix: String?) : UIKitModifier {
object Link : Type("link")
}
sealed class Size(suffix: String) : UIKitButton(suffix) {
object Small : Size("small")
object Large : Size("large")
}
object Group : UIKitButton("group")
companion object : UIKitButton(null)
}

View File

@@ -38,7 +38,7 @@ sealed class UIKitToggle(
class Custom internal constructor(otherAttrs: Map<String, String>) : UIKitToggle(otherAttrs = otherAttrs)
companion object {
companion object : UIKitToggle(otherAttrs = mapOf("uk-toggle" to "")) {
operator fun invoke(
target: String? = null,
mode: Mode? = null,