Skip to content

Commit fc5ca61

Browse files
authored
Merge pull request #1 from yusuf0405/v1.0.1
V1.0.1
2 parents 4e09cec + c38abfd commit fc5ca61

File tree

22 files changed

+213
-565
lines changed

22 files changed

+213
-565
lines changed

composeApp/build.gradle.kts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
}
1111

1212
kotlin {
13-
jvmToolchain(11)
13+
jvmToolchain(libs.versions.jvm.get().toInt())
1414
androidTarget {
1515
//https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-test.html
1616
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
@@ -41,7 +41,11 @@ kotlin {
4141

4242
sourceSets {
4343
commonMain.dependencies {
44-
implementation(project(":designsystem"))
44+
// Use internal library
45+
// implementation(project(":designsystem"))
46+
// Use remote library
47+
implementation(libs.desingnsystem)
48+
4549
implementation(compose.runtime)
4650
implementation(compose.foundation)
4751
implementation(compose.material3)
@@ -67,21 +71,20 @@ kotlin {
6771
jsMain.dependencies {
6872
implementation(compose.html.core)
6973
}
70-
7174
}
7275
}
7376

7477
android {
7578
namespace = "org.joseph.designsystem"
76-
compileSdk = 35
79+
compileSdk = libs.versions.compileSdk.get().toInt()
7780

7881
defaultConfig {
79-
minSdk = 21
80-
targetSdk = 35
82+
minSdk = libs.versions.minSdk.get().toInt()
83+
targetSdk = libs.versions.targetSdk.get().toInt()
8184

8285
applicationId = "org.joseph.designsystem.androidApp"
83-
versionCode = 1
84-
versionName = "1.0.0"
86+
versionCode = libs.versions.versionCode.get().toInt()
87+
versionName = libs.versions.version.get()
8588

8689
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
8790
}
@@ -100,7 +103,7 @@ compose.desktop {
100103
nativeDistributions {
101104
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
102105
packageName = "DesignSystem"
103-
packageVersion = "1.0.0"
106+
packageVersion = libs.versions.version.get()
104107

105108
linux {
106109
iconFile.set(project.file("desktopAppIcons/LinuxIcon.png"))
@@ -114,4 +117,4 @@ compose.desktop {
114117
}
115118
}
116119
}
117-
}
120+
}

composeApp/src/commonMain/kotlin/org/joseph/designsystem/App.kt

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,48 @@
11
package org.joseph.designsystem
22

3-
import androidx.compose.animation.core.*
3+
import androidx.compose.animation.core.Animatable
4+
import androidx.compose.animation.core.LinearEasing
5+
import androidx.compose.animation.core.tween
46
import androidx.compose.foundation.Image
57
import androidx.compose.foundation.background
6-
import androidx.compose.foundation.isSystemInDarkTheme
7-
import androidx.compose.foundation.layout.*
8-
import androidx.compose.material3.*
9-
import androidx.compose.runtime.*
8+
import androidx.compose.foundation.layout.Column
9+
import androidx.compose.foundation.layout.Spacer
10+
import androidx.compose.foundation.layout.WindowInsets
11+
import androidx.compose.foundation.layout.fillMaxSize
12+
import androidx.compose.foundation.layout.padding
13+
import androidx.compose.foundation.layout.safeDrawing
14+
import androidx.compose.foundation.layout.size
15+
import androidx.compose.foundation.layout.widthIn
16+
import androidx.compose.foundation.layout.windowInsetsPadding
17+
import androidx.compose.material3.ButtonDefaults
18+
import androidx.compose.material3.ElevatedButton
19+
import androidx.compose.material3.Icon
20+
import androidx.compose.material3.Text
21+
import androidx.compose.material3.TextButton
22+
import androidx.compose.runtime.Composable
23+
import androidx.compose.runtime.LaunchedEffect
24+
import androidx.compose.runtime.getValue
25+
import androidx.compose.runtime.mutableStateOf
26+
import androidx.compose.runtime.remember
27+
import androidx.compose.runtime.setValue
1028
import androidx.compose.ui.Alignment
1129
import androidx.compose.ui.Modifier
1230
import androidx.compose.ui.draw.rotate
1331
import androidx.compose.ui.graphics.ColorFilter
1432
import androidx.compose.ui.platform.LocalUriHandler
1533
import androidx.compose.ui.text.font.FontFamily
1634
import androidx.compose.ui.unit.dp
17-
import designsystem.composeapp.generated.resources.*
35+
import designsystem.composeapp.generated.resources.IndieFlower_Regular
36+
import designsystem.composeapp.generated.resources.Res
37+
import designsystem.composeapp.generated.resources.cyclone
38+
import designsystem.composeapp.generated.resources.ic_cyclone
39+
import designsystem.composeapp.generated.resources.ic_dark_mode
40+
import designsystem.composeapp.generated.resources.ic_light_mode
41+
import designsystem.composeapp.generated.resources.ic_rotate_right
42+
import designsystem.composeapp.generated.resources.open_github
43+
import designsystem.composeapp.generated.resources.run
44+
import designsystem.composeapp.generated.resources.stop
45+
import designsystem.composeapp.generated.resources.theme
1846
import kotlinx.coroutines.isActive
1947
import org.jetbrains.compose.resources.Font
2048
import org.jetbrains.compose.resources.stringResource
@@ -33,11 +61,11 @@ internal fun App() = DesignSystemTheme {
3361
Text(
3462
text = stringResource(Res.string.cyclone),
3563
fontFamily = FontFamily(Font(Res.font.IndieFlower_Regular)),
36-
style = MaterialTheme.typography.displayLarge
64+
style = DesignSystemTheme.typography.titleLarge.bold,
65+
color = DesignSystemTheme.colors.textPrimary
3766
)
3867

3968
var isRotating by remember { mutableStateOf(false) }
40-
4169
val rotate = remember { Animatable(0f) }
4270
val target = 360f
4371
if (isRotating) {
@@ -59,7 +87,7 @@ internal fun App() = DesignSystemTheme {
5987
.padding(16.dp)
6088
.run { rotate(rotate.value) },
6189
imageVector = vectorResource(Res.drawable.ic_cyclone),
62-
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onSurface),
90+
colorFilter = ColorFilter.tint(DesignSystemTheme.colors.primary),
6391
contentDescription = null
6492
)
6593

@@ -72,9 +100,14 @@ internal fun App() = DesignSystemTheme {
72100
Icon(vectorResource(Res.drawable.ic_rotate_right), contentDescription = null)
73101
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
74102
Text(
75-
stringResource(if (isRotating) Res.string.stop else Res.string.run)
103+
text = stringResource(if (isRotating) Res.string.stop else Res.string.run),
104+
style = DesignSystemTheme.typography.bodySmall.bold,
105+
color = DesignSystemTheme.colors.textPrimary
76106
)
77-
}
107+
},
108+
colors = ButtonDefaults.elevatedButtonColors(
109+
containerColor = DesignSystemTheme.colors.backgroundModal
110+
),
78111
)
79112

80113
var isDark by LocalThemeIsDark.current
@@ -89,16 +122,27 @@ internal fun App() = DesignSystemTheme {
89122
content = {
90123
Icon(vectorResource(icon), contentDescription = null)
91124
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
92-
Text(stringResource(Res.string.theme))
93-
}
125+
Text(
126+
text = stringResource(Res.string.theme),
127+
style = DesignSystemTheme.typography.bodySmall.bold,
128+
color = DesignSystemTheme.colors.textPrimary
129+
)
130+
},
131+
colors = ButtonDefaults.elevatedButtonColors(
132+
containerColor = DesignSystemTheme.colors.backgroundModal
133+
),
94134
)
95135

96136
val uriHandler = LocalUriHandler.current
97137
TextButton(
98138
modifier = Modifier.padding(horizontal = 8.dp, vertical = 4.dp).widthIn(min = 200.dp),
99139
onClick = { uriHandler.openUri("https://github.com/terrakok") },
100140
) {
101-
Text(stringResource(Res.string.open_github))
141+
Text(
142+
text = stringResource(Res.string.open_github),
143+
style = DesignSystemTheme.typography.bodyMedium.medium,
144+
color = DesignSystemTheme.colors.textPrimary
145+
)
102146
}
103147
}
104148
}

designsystem/build.gradle.kts

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ plugins {
1010
id("com.vanniktech.maven.publish") version "0.30.0"
1111
}
1212

13-
group = "org.joseph.designsystem"
14-
version = "1.0.0"
13+
group = libs.versions.groupId.get()
14+
version = libs.versions.version.get()
1515

1616
kotlin {
17-
jvmToolchain(11)
17+
jvmToolchain(libs.versions.jvm.get().toInt())
1818
jvm()
1919
androidTarget {
2020
publishLibraryVariants("release")
2121
withSourcesJar(publish = true)
2222
}
2323

24-
2524
js {
2625
browser()
2726
binaries.executable()
@@ -65,16 +64,15 @@ kotlin {
6564
jsMain.dependencies {
6665
implementation(compose.html.core)
6766
}
68-
6967
}
7068
}
7169

7270
android {
7371
namespace = "org.joseph.designsystem"
74-
compileSdk = 35
72+
compileSdk = libs.versions.compileSdk.get().toInt()
7573

7674
defaultConfig {
77-
minSdk = 21
75+
minSdk = libs.versions.minSdk.get().toInt()
7876
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
7977
}
8078

@@ -92,15 +90,14 @@ dependencies {
9290
}
9391

9492
mavenPublishing {
95-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
93+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = false)
9694
signAllPublications()
9795
}
9896

99-
10097
publishing.publications.withType<MavenPublication>()
10198
.configureEach {
102-
groupId = "org.joseph.designsystem"
103-
version = "1.0.0"
99+
groupId = libs.versions.groupId.get()
100+
version = libs.versions.version.get()
104101

105102
pom {
106103
name.set("Designsystem")
@@ -138,15 +135,9 @@ publishing.publications.withType<MavenPublication>()
138135
publishing {
139136
repositories {
140137
mavenLocal()
141-
142138
maven {
143139
name = "BuildDir"
144140
url = uri(rootProject.layout.buildDirectory.dir("maven-repo"))
145141
}
146-
147-
maven {
148-
149-
}
150142
}
151-
}
152-
143+
}
251 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)