Skip to content

Commit 46f233c

Browse files
committed
Merge branch 'main' into release
v0.4.0 release
2 parents 066bcf0 + 9b17a39 commit 46f233c

File tree

23 files changed

+627
-252
lines changed

23 files changed

+627
-252
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.gradle
2+
.kotlin
23
build
34
.idea

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Material 3 wrapper components for Compose HTML based on [Material Web](https://github.com/material-components/material-web)
66

7-
For unified multiplatform APIs which are more akin to those in `androidx.compose`, check out [Compose Multiplatform Material](https://github.com/huanshankeji/compose-multiplatform-material).
7+
For unified multiplatform APIs which are more akin to those in `androidx.compose`, check out [Compose Multiplatform Material](https://github.com/huanshankeji/compose-multiplatform-material) which also depends on this library.
88

99
For Material 2 support, you are recommended to check out [KMDC](https://github.com/mpetuska/kmdc) instead. For information on our obsolete work on legacy Material 2 components, check out [the legacy README](/legacy/README.md).
1010

@@ -20,6 +20,8 @@ Here is a list of supported compoent APIs:
2020
- `MdIcon`
2121
- `MdIconButton`, `MdFilledIconButton`, `MdFilledTonalIconButton`, `MdOutlinedIconButton`
2222
- `MdList`, `MdListItem`
23+
- `MdMenu`, `MdMenuItem`, `MdSubMenu`
24+
- `MdLinearProgress`, `MdCircularProgress`
2325
- `MdSwitch`, `LabelWithMdSwitch`
2426
- `MdFilledTextField`, `MdOutlinedTextField`
2527

@@ -52,6 +54,15 @@ kotlin {
5254
}
5355
```
5456

57+
This project depends on [Kobweb](https://github.com/varabyte/kobweb) which is not published to Maven Central yet, so you have to add the following Maven repository:
58+
59+
```kotlin
60+
repositories {
61+
mavenCentral()
62+
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public")
63+
}
64+
```
65+
5566
### Material Symbols & Icons
5667

5768
The Material 3 module uses [Material Symbols & Icons](https://fonts.google.com/icons), but doesn't depend on the stylesheet directly. For Material Icons to work properly, you may need to configure your project following the quick instructions below or [the developer guide](https://developers.google.com/fonts/docs/material_symbols).

buildSrc/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ plugins {
22
`kotlin-dsl`
33
}
44
repositories {
5-
//mavenLocal()
5+
mavenLocal() // TODO comment out when not needed
66
gradlePluginPortal()
77
//maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
88
}
99

10-
val huanshankejiGradlePluginsVersion = "0.5.1"
11-
1210
dependencies {
13-
implementation(kotlin("gradle-plugin", "1.9.23"))
14-
implementation("org.jetbrains.compose:compose-gradle-plugin:1.6.2")
11+
// With Kotlin 2.0.20, a "Could not parse POM" build error occurs in the JVM projects of some dependent projects.
12+
val kotlinVersion = "2.0.10"
13+
implementation(kotlin("gradle-plugin", kotlinVersion))
14+
implementation("org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlinVersion")
15+
implementation("org.jetbrains.compose:compose-gradle-plugin:1.7.0")
16+
val huanshankejiGradlePluginsVersion = "0.6.0" // don't use a snapshot version in a main branch
1517
implementation("com.huanshankeji:kotlin-common-gradle-plugins:$huanshankejiGradlePluginsVersion")
1618
implementation("com.huanshankeji.team:gradle-plugins:$huanshankejiGradlePluginsVersion")
17-
implementation("com.huanshankeji:common-gradle-dependencies:0.7.1-20240314")
19+
implementation("com.huanshankeji:common-gradle-dependencies:0.8.0-20241016") // don't use a snapshot version in a main branch
1820
}

buildSrc/src/main/kotlin/VersionsAndDependencies.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import com.huanshankeji.CommonDependencies
22

3-
const val projectVersion = "0.3.0"
3+
const val projectVersion = "0.4.0"
44

55
object DependencyVersions {
6-
val kobweb = "0.17.3"
7-
val materialWeb = "1.4.1"
6+
val kobweb = "0.19.2"
7+
val materialWeb = "2.2.0"
88

99

1010
// legacy versions that don't need to be updated
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
id("com.huanshankeji.kotlin-multiplatform-js-browser-conventions")
3+
kotlin("plugin.compose")
4+
id("org.jetbrains.compose")
5+
id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
6+
}
7+
8+
repositories {
9+
mavenCentral()
10+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
11+
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public") // for Kobweb
12+
}
13+
14+
group = "com.huanshankeji"
15+
version = projectVersion
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
plugins {
2-
id("com.huanshankeji.kotlin-multiplatform-js-browser-conventions")
3-
id("org.jetbrains.compose")
2+
id("lib-conventions-without-publishing")
43
id("com.huanshankeji.kotlin-multiplatform-sonatype-ossrh-publish-conventions")
5-
}
6-
7-
repositories {
8-
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
9-
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public") // for Kobweb
10-
}
11-
12-
group = "com.huanshankeji"
13-
version = projectVersion
4+
}

compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/LoadingState.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/Attrs.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ fun AttrsScope<*>.attr(attr: String, value: Boolean = true) =
1515
fun AttrsScope<*>.attr(attr: String, value: Int) =
1616
attr(attr, value.toString())
1717

18+
fun AttrsScope<*>.attr(attr: String, value: Number) =
19+
attr(attr, value.toString())
20+
1821
/**
1922
* Adds an attribute that has an explicit [Boolean] value unlike [attr].
2023
*/
@@ -34,6 +37,10 @@ fun AttrsScope<*>.attrIfNotNull(attr: String, value: Int?) {
3437
value?.let { attr(attr, it) }
3538
}
3639

40+
fun AttrsScope<*>.attrIfNotNull(attr: String, value: Number?) {
41+
value?.let { attr(attr, it) }
42+
}
43+
3744

3845
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/slot
3946
fun AttrsScope<*>.slot(value: String) =

compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/ext/Attrs.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ fun AttrsScope<*>.ariaLabel(value: String) =
2929

3030
// https://www.w3schools.com/tags/att_disabled.asp
3131
// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
32-
fun AttrsScope<*>.disabled(disabled: Boolean?) {
33-
disabled?.let { disabled(it) }
34-
}
32+
fun AttrsScope<*>.disabled(value: Boolean?) =
33+
attrIfNotNull("disabled", value)
3534

3635
// https://www.w3schools.com/tags/att_href.asp
3736
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href
@@ -140,5 +139,6 @@ fun AttrsScope<*>.enterKeyHintIfValid(value: String) {
140139
}
141140

142141

142+
// https://www.w3schools.com/tags/att_selected.asp
143143
fun AttrsScope<*>.selected(value: Boolean?) =
144144
attrIfNotNull("selected", value)

compose-html-material-legacy/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import com.huanshankeji.team.`Shreck Ye`
22
import com.huanshankeji.team.pomForTeamDefaultOpenSource
33

44
plugins {
5-
`lib-conventions`
5+
`lib-conventions-without-publishing`
66
}
77

88
kotlin {

0 commit comments

Comments
 (0)