diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f64d34..3c8704f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.0.31 + +* Support of `UIKitVisibility` + ## 0.0.30 * Add `UIKitComment` diff --git a/gradle.properties b/gradle.properties index 042885e..0d2ba91 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,4 +9,4 @@ android.enableJetifier=true # Project data group=dev.inmo -version=0.0.30 +version=0.0.31 diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitVisibility.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitVisibility.kt new file mode 100644 index 0000000..7470123 --- /dev/null +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitVisibility.kt @@ -0,0 +1,30 @@ +package dev.inmo.jsuikit.modifiers + +sealed class UIKitVisibility(classname: String) : UIKitModifier { + override val classes: Array = arrayOf(classname) + + sealed class Hidden(suffix: String?) : UIKitModifier { + override val classes: Array = arrayOf("uk-hidden${suffix ?.let { "-$it" } ?: ""}") + + object Hover : Hidden("hover") + sealed class Touch(suffix: String?) : Hidden(suffix) { + override val classes: Array = arrayOf("${suffix ?: ""}touch") + + object No : Touch("no") + + companion object : Touch(null) + } + + companion object : Hidden(null) { + val NoTouch = Touch.No + } + } + + sealed class Invisible(suffix: String?) : UIKitModifier { + override val classes: Array = arrayOf("uk-invisible${suffix ?.let { "-$it" } ?: ""}") + + object Hover : Invisible("hover") + + companion object : Invisible(null) + } +}