From 5268becd1cf9f4b5669e65527e5fb6282368ebbf Mon Sep 17 00:00:00 2001 From: John O'Reilly Date: Tue, 31 Oct 2023 14:09:16 +0000 Subject: [PATCH] use material 3 for wasm based compose for web --- compose-web-wasm/build.gradle.kts | 2 +- compose-web-wasm/src/wasmJsMain/kotlin/Main.kt | 2 +- .../src/wasmJsMain/kotlin/PeopleInSpaceScreen.kt | 14 +++++++------- kotlin-js-store/yarn.lock | 5 +++++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/compose-web-wasm/build.gradle.kts b/compose-web-wasm/build.gradle.kts index 60e5f79b..c8a0ee06 100644 --- a/compose-web-wasm/build.gradle.kts +++ b/compose-web-wasm/build.gradle.kts @@ -41,7 +41,7 @@ kotlin { dependencies { implementation(compose.runtime) implementation(compose.foundation) - implementation(compose.material) + implementation(compose.material3) implementation(compose.components.resources) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2-wasm1") diff --git a/compose-web-wasm/src/wasmJsMain/kotlin/Main.kt b/compose-web-wasm/src/wasmJsMain/kotlin/Main.kt index d7d9e502..4a8096f9 100644 --- a/compose-web-wasm/src/wasmJsMain/kotlin/Main.kt +++ b/compose-web-wasm/src/wasmJsMain/kotlin/Main.kt @@ -1,7 +1,7 @@ import androidx.compose.runtime.* import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.window.CanvasBasedWindow -import androidx.compose.material.Text +import androidx.compose.material3.Text @OptIn(ExperimentalComposeUiApi::class) fun main() { diff --git a/compose-web-wasm/src/wasmJsMain/kotlin/PeopleInSpaceScreen.kt b/compose-web-wasm/src/wasmJsMain/kotlin/PeopleInSpaceScreen.kt index 8a73d356..e0e78f76 100644 --- a/compose-web-wasm/src/wasmJsMain/kotlin/PeopleInSpaceScreen.kt +++ b/compose-web-wasm/src/wasmJsMain/kotlin/PeopleInSpaceScreen.kt @@ -12,8 +12,8 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.material.ProvideTextStyle -import androidx.compose.material.Text +import androidx.compose.material3.ProvideTextStyle +import androidx.compose.material3.Text import androidx.compose.runtime.* import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.text.font.FontWeight @@ -24,8 +24,8 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.material.MaterialTheme -import androidx.compose.material.Text +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -102,7 +102,7 @@ fun PersonView( Column { Text( person.name, - style = if (person.name == selectedPerson?.name) MaterialTheme.typography.h6 else MaterialTheme.typography.body1 + style = if (person.name == selectedPerson?.name) MaterialTheme.typography.titleLarge else MaterialTheme.typography.bodyLarge ) Text(text = person.craft, style = TextStyle(color = Color.DarkGray, fontSize = 14.sp)) @@ -119,7 +119,7 @@ fun PersonDetailsView(person: Assignment) { item(person) { - Text(person.name, style = MaterialTheme.typography.h4) + Text(person.name, style = MaterialTheme.typography.headlineMedium) Spacer(modifier = Modifier.size(12.dp)) val personImageUrl = person.personImageUrl @@ -130,7 +130,7 @@ fun PersonDetailsView(person: Assignment) { Spacer(modifier = Modifier.size(24.dp)) val bio = person.personBio ?: "" - Text(bio, style = MaterialTheme.typography.body1) + Text(bio, style = MaterialTheme.typography.bodyLarge) } } } diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 6e096a6a..ef00a641 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -223,6 +223,11 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@js-joda/core@3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273" + integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg== + "@leichtgewicht/ip-codec@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b"