feature: Add DS module (#26)

* feature: Add DS module

* feature: Use FloconTheme

* feature: Migrate MaterialTheme to FloconTheme

* fix: Merge

---------

Co-authored-by: Raphael Teyssandier <rteyssandier@sephora.fr>
This commit is contained in:
Raphael Teyssandier 2025-08-04 09:08:58 +02:00 • committed by GitHub
parent 595ccf77d2
commit 35e2a4a0f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 553 additions and 275 deletions

View file

@ -10,5 +10,7 @@ plugins {
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.ktlint) apply false // Ajout de Ktlint
alias(libs.plugins.aboutLibraries) apply false // Ajout de Ktlint
alias(libs.plugins.aboutLibraries) apply false
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
alias(libs.plugins.android.lint) apply false // Ajout de Ktlint
}

View file

@ -75,16 +75,11 @@ kotlin {
implementation(libs.koin.android)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.materialIconsExtended)
implementation(compose.ui)
// TODO Remove
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtimeCompose)
implementation(projects.shared)
implementation(libs.kotlinx.coroutinesCore)
implementation(project.dependencies.platform(libs.koin.bom))
@ -101,6 +96,9 @@ kotlin {
implementation(libs.sqlite.bundled)
implementation(libs.aboutlibraries.core)
implementation(libs.aboutlibraries.compose.m3) // Material 3
implementation(projects.shared)
implementation(projects.library.designsystem)
}
commonTest.dependencies {
implementation(libs.kotlin.test)

View file

@ -7,10 +7,9 @@ import androidx.compose.foundation.layout.safeContentPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import io.github.openflocon.flocondesktop.app.AppViewModel
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.common.ui.feedback.FeedbackDisplayerView
import io.github.openflocon.flocondesktop.main.ui.MainScreen
import io.github.openflocon.library.designsystem.FloconTheme
import org.koin.compose.viewmodel.koinViewModel
@Composable
@ -22,7 +21,7 @@ fun App() {
Modifier
.safeContentPadding()
.fillMaxSize()
.background(FloconColors.background),
.background(FloconTheme.colorScheme.background),
) {
MainScreen(
modifier = Modifier

View file

@ -5,6 +5,7 @@ import androidx.compose.material3.darkColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
@Deprecated("Use FloconTheme.colorScheme")
object FloconColors {
val primary = Color(0xff0A84FF) // Your main accent color (Apple Blue)
val onPrimary = Color(0xffF2F2F7) // Text/icons on primary
@ -54,6 +55,7 @@ val FloconColorScheme =
outline = FloconColors.secondary.copy(alpha = 0.5f),
)
@Deprecated("Use FloconTheme from DS module")
@Composable
fun FloconTheme(content: @Composable () -> Unit) {
MaterialTheme(

View file

@ -16,6 +16,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import io.github.openflocon.library.designsystem.FloconTheme
import org.koin.compose.koinInject
@Composable
@ -41,8 +42,8 @@ fun BoxScope.FeedbackDisplayerView(modifier: Modifier = Modifier) {
) { data ->
Snackbar(
snackbarData = data,
containerColor = MaterialTheme.colorScheme.inverseSurface, // Invert surface for contrast
contentColor = MaterialTheme.colorScheme.inverseOnSurface, // Invert onSurface for contrast
containerColor = FloconTheme.colorScheme.inverseSurface, // Invert surface for contrast
contentColor = FloconTheme.colorScheme.inverseOnSurface, // Invert onSurface for contrast
shape = RoundedCornerShape(8.dp),
)
}

View file

@ -11,15 +11,14 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.features.analytics.ui.model.AnalyticsRowUiModel
import io.github.openflocon.library.designsystem.FloconTheme
@Composable
fun AnalyticsDetailView(modifier: Modifier = Modifier, state: AnalyticsRowUiModel) {
@ -27,7 +26,7 @@ fun AnalyticsDetailView(modifier: Modifier = Modifier, state: AnalyticsRowUiMode
val linesLabelWidth: Dp = 130.dp
SelectionContainer(
modifier
.background(FloconColors.background)
.background(FloconTheme.colorScheme.background)
.verticalScroll(scrollState)
.padding(all = 18.dp),
) {
@ -72,8 +71,8 @@ fun AnalyticsDetailLineTextView(
) {
Text(
text = value,
style = MaterialTheme.typography.bodyMedium, // Body text for the URL
color = MaterialTheme.colorScheme.onBackground, // Primary text color
style = FloconTheme.typography.bodyMedium, // Body text for the URL
color = FloconTheme.colorScheme.onBackground, // Primary text color
modifier = Modifier.weight(1f), // Takes remaining space
)
}
@ -92,8 +91,8 @@ fun AnalyticsDetailLineView(
) {
Text(
text = label,
style = MaterialTheme.typography.titleSmall, // Slightly smaller title for details
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
style = FloconTheme.typography.titleSmall, // Slightly smaller title for details
color = FloconTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
modifier = Modifier.width(labelWidth).padding(end = 8.dp),
)
content()

View file

@ -22,6 +22,7 @@ import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.analytics.ui.model.AnalyticsRowUiModel
import io.github.openflocon.flocondesktop.features.analytics.ui.model.previewAnalyticsRowUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -43,14 +44,14 @@ fun AnalyticsRowView(
) {
Text(
text = model.eventName,
style = MaterialTheme.typography.titleSmall,
color = MaterialTheme.colorScheme.onPrimaryContainer,
style = FloconTheme.typography.titleSmall,
color = FloconTheme.colorScheme.onPrimaryContainer,
)
Text(
text = model.dateFormatted,
style = MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Light),
color = MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.4f),
style = FloconTheme.typography.titleSmall.copy(fontWeight = FontWeight.Light),
color = FloconTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.4f),
)
FlowRow(
@ -61,12 +62,15 @@ fun AnalyticsRowView(
model.properties.fastForEach {
Row(
Modifier
.background(shape = RoundedCornerShape(20.dp), color = Color.White.copy(alpha = 0.1f))
.background(
shape = RoundedCornerShape(20.dp),
color = Color.White.copy(alpha = 0.1f)
)
.padding(horizontal = 12.dp, vertical = 1.dp),
) {
Text(
text = it.name + " :",
style = MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Light),
style = FloconTheme.typography.titleSmall.copy(fontWeight = FontWeight.Light),
color = MaterialTheme.colorScheme.onPrimaryContainer,
)
Text(
@ -80,8 +84,8 @@ fun AnalyticsRowView(
Text(
text = "...",
modifier =
Modifier
.padding(horizontal = 4.dp),
Modifier
.padding(horizontal = 4.dp),
style = MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Bold),
color = MaterialTheme.colorScheme.onPrimaryContainer,
)

View file

@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@ -26,6 +25,7 @@ import io.github.openflocon.flocondesktop.features.dashboard.ui.view.items.Dashb
import io.github.openflocon.flocondesktop.features.dashboard.ui.view.items.DashboardPlainTextView
import io.github.openflocon.flocondesktop.features.dashboard.ui.view.items.DashboardTextFieldView
import io.github.openflocon.flocondesktop.features.dashboard.ui.view.items.DashboardTextView
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -37,7 +37,8 @@ fun DashboardItemView(
modifier: Modifier = Modifier,
) {
val backColor = FloconColors.pannel
val textColor = FloconColors.onSurface
val textColor = FloconTheme.colorScheme.onSurface
Box(
modifier = modifier.shadow(
elevation = 4.dp,
@ -53,7 +54,7 @@ fun DashboardItemView(
modifier = Modifier.fillMaxWidth().padding(horizontal = 4.dp),
textAlign = TextAlign.Center,
text = viewState.sectionName,
style = MaterialTheme.typography.headlineSmall.copy(
style = FloconTheme.typography.headlineSmall.copy(
fontWeight = FontWeight.Bold,
),
color = textColor,

View file

@ -20,6 +20,7 @@ import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.dashboard.ui.model.DashboardItemViewState
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -47,7 +48,7 @@ internal fun DashboardCheckBoxView(
) {
Text(
style = MaterialTheme.typography.bodySmall.copy(
color = FloconColors.onSurface,
color = FloconTheme.colorScheme.onSurface,
),
text = rowItem.label,
)

View file

@ -26,7 +26,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -40,7 +40,7 @@ fun DatabaseQueryView(
Column(
modifier = modifier
.background(
color = MaterialTheme.colorScheme.surfaceVariant,
color = FloconTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(12.dp),
)
.padding(16.dp),

View file

@ -12,7 +12,6 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -22,8 +21,9 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastForEach
import io.github.openflocon.flocondesktop.common.ui.FloconColorScheme
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.database.ui.model.DatabaseRowUiModel
import io.github.openflocon.flocondesktop.features.database.ui.model.QueryResultUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -66,8 +66,8 @@ fun DatabaseResultView(
result.columns.fastForEach { item ->
Text(
item,
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
color = FloconTheme.colorScheme.onSurface,
modifier = Modifier.width(columnsWidth)
.padding(all = 4.dp),
)
@ -95,8 +95,8 @@ fun DatabaseResultView(
row.items.forEach { item ->
Text(
item ?: "null",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f),
style = FloconTheme.typography.bodySmall,
color = FloconTheme.colorScheme.onSurface.copy(alpha = 0.7f),
modifier = Modifier.width(columnsWidth)
.padding(horizontal = 4.dp),
)
@ -125,9 +125,9 @@ private fun DatabaseResultViewPreviewValues() {
val result = QueryResultUiModel.Values(
columns = listOf("ID", "Name", "Email"),
rows = listOf(
io.github.openflocon.flocondesktop.features.database.ui.model.DatabaseRowUiModel(items = listOf("1", "John Doe", "john.doe@example.com")),
io.github.openflocon.flocondesktop.features.database.ui.model.DatabaseRowUiModel(items = listOf("2", "Jane Smith", "jane.smith@example.com")),
io.github.openflocon.flocondesktop.features.database.ui.model.DatabaseRowUiModel(items = listOf("3", "Peter Jones", null)),
DatabaseRowUiModel(items = listOf("1", "John Doe", "john.doe@example.com")),
DatabaseRowUiModel(items = listOf("2", "Jane Smith", "jane.smith@example.com")),
DatabaseRowUiModel(items = listOf("3", "Peter Jones", null)),
),
)
FloconTheme {

View file

@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -24,10 +23,10 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.database.ui.model.DatabasesStateUiModel
import io.github.openflocon.flocondesktop.features.database.ui.model.DeviceDataBaseUiModel
import io.github.openflocon.flocondesktop.features.database.ui.model.previewDeviceDataBaseUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -49,8 +48,8 @@ internal fun DatabaseSelectorView(
) {
Text(
text = "Database : ",
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
color = FloconTheme.colorScheme.onBackground,
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
)
Spacer(modifier = Modifier.width(4.dp))
@ -63,12 +62,12 @@ internal fun DatabaseSelectorView(
DatabasesStateUiModel.Empty -> {
Text(
modifier =
Modifier
.background(MaterialTheme.colorScheme.onBackground, shape = shape)
.padding(contentPadding),
Modifier
.background(FloconTheme.colorScheme.onBackground, shape = shape)
.padding(contentPadding),
text = "No Databases Found",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.background,
style = FloconTheme.typography.bodySmall,
color = FloconTheme.colorScheme.background,
)
}
@ -77,13 +76,13 @@ internal fun DatabaseSelectorView(
DatabaseView(
database = databasesState.selected,
textColor = MaterialTheme.colorScheme.background,
textColor = FloconTheme.colorScheme.background,
modifier =
Modifier
.clip(shape)
.background(MaterialTheme.colorScheme.onBackground)
.clickable { expanded = true }
.padding(contentPadding),
Modifier
.clip(shape)
.background(FloconTheme.colorScheme.onBackground)
.clickable { expanded = true }
.padding(contentPadding),
)
DropdownMenu(
@ -95,7 +94,7 @@ internal fun DatabaseSelectorView(
text = {
DatabaseView(
database = database,
textColor = MaterialTheme.colorScheme.onBackground,
textColor = FloconTheme.colorScheme.onBackground,
modifier = Modifier.padding(all = 4.dp),
)
},
@ -122,7 +121,7 @@ private fun DatabaseView(
modifier = modifier,
text = database.name, // Device Name
color = textColor,
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
)
}
@ -132,7 +131,7 @@ private fun DatabaseViewPreview() {
FloconTheme {
DatabaseView(
database = previewDeviceDataBaseUiModel(),
textColor = MaterialTheme.colorScheme.background,
textColor = FloconTheme.colorScheme.background,
)
}
}

View file

@ -21,10 +21,10 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.ContextualItem
import io.github.openflocon.flocondesktop.common.ui.ContextualView
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.files.ui.model.FilePathUiModel
import io.github.openflocon.flocondesktop.features.files.ui.model.FileTypeUiModel
import io.github.openflocon.flocondesktop.features.files.ui.model.FileUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -69,23 +69,23 @@ fun FileItemRow(
Column(modifier = Modifier.weight(1f)) {
Text(
text = file.name,
style = MaterialTheme.typography.bodyLarge,
style = FloconTheme.typography.bodyLarge,
maxLines = 1,
color = MaterialTheme.colorScheme.onSurface,
color = FloconTheme.colorScheme.onSurface,
overflow = TextOverflow.Ellipsis,
)
// Informations additionnelles (taille, date de modification)
// if (!file.isDirectory) {
// Text(
// text = "${viewModel.formatFileSize(file.size)}",
// style = MaterialTheme.typography.bodySmall,
// color = MaterialTheme.colorScheme.onSurfaceVariant
// style = FloconTheme.typography.bodySmall,
// color = FloconTheme.colorScheme.onSurfaceVariant
// )
// }
// Text(
// text = viewModel.formatLastModifiedDate(file.lastModified),
// style = MaterialTheme.typography.bodySmall,
// color = MaterialTheme.colorScheme.onSurfaceVariant
// style = FloconTheme.typography.bodySmall,
// color = FloconTheme.colorScheme.onSurfaceVariant
// )
}

View file

@ -27,10 +27,10 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.files.ui.model.FilePathUiModel
import io.github.openflocon.flocondesktop.features.files.ui.model.FileTypeUiModel
import io.github.openflocon.flocondesktop.features.files.ui.model.FileUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -52,8 +52,8 @@ fun FilesTopBar(
Text(
text = "Files",
modifier = Modifier.padding(bottom = 12.dp),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.titleLarge,
color = FloconTheme.colorScheme.onSurface,
)
Row(
@ -69,20 +69,18 @@ fun FilesTopBar(
Box(
modifier = Modifier.weight(1f)
.clip(RoundedCornerShape(6.dp))
.background(FloconColors.onSurface.copy(alpha = 0.1f))
.background(FloconTheme.colorScheme.onSurface.copy(alpha = 0.1f))
.padding(vertical = 4.dp, horizontal = 12.dp),
) {
Text(
current?.name ?: "",
style = MaterialTheme.typography.bodyLarge,
style = FloconTheme.typography.bodyLarge,
maxLines = 1,
color = MaterialTheme.colorScheme.onSurface,
color = FloconTheme.colorScheme.onSurface,
)
}
TopBarButton(
onClick = {
onDeleteContent()
},
onClick = onDeleteContent,
enabled = isDirectory,
icon = Icons.Outlined.Delete
)

View file

@ -19,7 +19,6 @@ import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -38,11 +37,11 @@ import androidx.compose.ui.window.Dialog
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import coil3.compose.AsyncImage
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.images.ui.ImagesViewModel
import io.github.openflocon.flocondesktop.features.images.ui.model.ImagesStateUiModel
import io.github.openflocon.flocondesktop.features.images.ui.model.ImagesUiModel
import io.github.openflocon.flocondesktop.features.images.ui.model.previewImagesStateUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.viewmodel.koinViewModel
@ -95,8 +94,8 @@ private fun ImagesScreen(
Text(
text = "Images",
modifier = Modifier.padding(bottom = 12.dp),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.titleLarge,
color = FloconTheme.colorScheme.onSurface,
)
Box(modifier = Modifier.weight(1f))

View file

@ -34,6 +34,7 @@ import io.github.openflocon.flocondesktop.features.network.ui.view.detail.Detail
import io.github.openflocon.flocondesktop.features.network.ui.view.detail.DetailLineView
import io.github.openflocon.flocondesktop.features.network.ui.view.detail.DetailSectionTitleView
import io.github.openflocon.flocondesktop.features.network.ui.view.detail.ExpandedSectionView
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -58,10 +59,10 @@ fun NetworkDetailView(
Column(
modifier =
modifier
.background(FloconColors.background)
.verticalScroll(scrollState) // Rendre le contenu défilable
.padding(all = 12.dp),
modifier
.background(FloconTheme.colorScheme.background)
.verticalScroll(scrollState) // Rendre le contenu défilable
.padding(all = 12.dp),
) {
DetailSectionTitleView(
isExpanded = isRequestExpanded,
@ -77,11 +78,11 @@ fun NetworkDetailView(
) {
Column(
modifier =
Modifier
.background(
color = MaterialTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(12.dp),
).padding(horizontal = 8.dp, vertical = 4.dp),
Modifier
.background(
color = FloconTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(12.dp),
).padding(horizontal = 8.dp, vertical = 4.dp),
) {
DetailLineTextView(
modifier = Modifier.fillMaxWidth(),
@ -99,10 +100,13 @@ fun NetworkDetailView(
is NetworkDetailViewState.Method.MethodName -> {
Text(
text = m.name,
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.bodySmall,
color = FloconTheme.colorScheme.onSurface,
modifier = Modifier.weight(2f)
.background(color = FloconColors.pannel.copy(alpha = 0.8f), shape = RoundedCornerShape(4.dp))
.background(
color = FloconColors.pannel.copy(alpha = 0.8f),
shape = RoundedCornerShape(4.dp)
)
.padding(horizontal = 8.dp, vertical = 6.dp),
)
}
@ -145,11 +149,11 @@ fun NetworkDetailView(
) {
Column(
modifier =
Modifier
.background(
color = MaterialTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(12.dp),
).padding(horizontal = 8.dp, vertical = 4.dp),
Modifier
.background(
color = FloconTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(12.dp),
).padding(horizontal = 8.dp, vertical = 4.dp),
) {
DetailLineTextView(
modifier = Modifier.fillMaxWidth(),
@ -212,10 +216,10 @@ fun NetworkDetailView(
HorizontalDivider(
modifier =
Modifier
.fillMaxWidth()
.padding(start = 12.dp)
.padding(vertical = 12.dp),
Modifier
.fillMaxWidth()
.padding(start = 12.dp)
.padding(vertical = 12.dp),
)
DetailSectionTitleView(
@ -280,22 +284,22 @@ private fun NetworkDetailViewPreview() {
FloconTheme {
NetworkDetailView(
state =
NetworkDetailViewState(
fullUrl = "http://www.google.com",
method = NetworkDetailViewState.Method.Http(NetworkMethodUi.Http.GET),
status =
NetworkStatusUi(
text = "200",
isSuccess = true,
),
requestHeaders =
listOf(
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
),
requestBody =
"""
NetworkDetailViewState(
fullUrl = "http://www.google.com",
method = NetworkDetailViewState.Method.Http(NetworkMethodUi.Http.GET),
status =
NetworkStatusUi(
text = "200",
isSuccess = true,
),
requestHeaders =
listOf(
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
),
requestBody =
"""
{
"id": "123",
"name": "Flocon App",
@ -308,18 +312,18 @@ private fun NetworkDetailViewPreview() {
}
}
""".trimIndent(),
responseHeaders =
listOf(
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
),
requestTimeFormatted = "00:00:00.000",
durationFormatted = "300ms",
responseBody =
"""
responseHeaders =
listOf(
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
previewNetworkDetailHeaderUi(),
),
requestTimeFormatted = "00:00:00.000",
durationFormatted = "300ms",
responseBody =
"""
{
"networkStatusUi": "success",
"message": "Data received and processed.",
@ -329,10 +333,10 @@ private fun NetworkDetailViewPreview() {
}
}
""".trimIndent(),
requestSize = "0kb",
responseSize = "0kb",
graphQlSection = null,
),
requestSize = "0kb",
responseSize = "0kb",
graphQlSection = null,
),
modifier = Modifier.padding(16.dp), // Padding pour la preview
onCopy = { },
)

View file

@ -27,6 +27,7 @@ import io.github.openflocon.flocondesktop.features.network.ui.model.OnNetworkIte
import io.github.openflocon.flocondesktop.features.network.ui.model.previewNetworkItemViewState
import io.github.openflocon.flocondesktop.features.network.ui.view.components.MethodView
import io.github.openflocon.flocondesktop.features.network.ui.view.components.StatusView
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
/**
@ -50,9 +51,9 @@ fun NetworkItemView(
onUserAction: (OnNetworkItemUserAction) -> Unit,
modifier: Modifier = Modifier,
) {
// Use MaterialTheme.typography for consistent text sizes
val bodySmall = MaterialTheme.typography.bodySmall.copy(fontSize = 11.sp)
val labelSmall = MaterialTheme.typography.labelSmall // Even smaller, good for labels/tags
// Use FloconTheme.typography for consistent text sizes
val bodySmall = FloconTheme.typography.bodySmall.copy(fontSize = 11.sp)
val labelSmall = FloconTheme.typography.labelSmall // Even smaller, good for labels/tags
ContextualView(
listOf(
@ -102,7 +103,7 @@ fun NetworkItemView(
Text(
state.dateFormatted,
style = bodySmall,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f),
color = FloconTheme.colorScheme.onSurface.copy(alpha = 0.7f),
)
}
@ -110,8 +111,8 @@ fun NetworkItemView(
MethodView(
method = state.method,
modifier =
Modifier
.width(columnWidths.methodWidth),
Modifier
.width(columnWidths.methodWidth),
)
// Route - Takes remaining space (weight)
@ -121,7 +122,7 @@ fun NetworkItemView(
maxLines = 2,
overflow = TextOverflow.Ellipsis,
style = bodySmall,
color = MaterialTheme.colorScheme.onSurface,
color = FloconTheme.colorScheme.onSurface,
modifier = Modifier.weight(1f)
.padding(horizontal = 4.dp),
)
@ -132,9 +133,12 @@ fun NetworkItemView(
maxLines = 2,
overflow = TextOverflow.Ellipsis,
style = bodySmall,
color = MaterialTheme.colorScheme.onSurface,
color = FloconTheme.colorScheme.onSurface,
modifier = Modifier.weight(2f)
.background(color = FloconColors.pannel.copy(alpha = 0.8f), shape = RoundedCornerShape(4.dp))
.background(
color = FloconColors.pannel.copy(alpha = 0.8f),
shape = RoundedCornerShape(4.dp)
)
.padding(horizontal = 8.dp, vertical = 6.dp),
)
}
@ -147,7 +151,10 @@ fun NetworkItemView(
style = bodySmall,
color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.weight(2f)
.background(color = FloconColors.pannel.copy(alpha = 0.8f), shape = RoundedCornerShape(4.dp))
.background(
color = FloconColors.pannel.copy(alpha = 0.8f),
shape = RoundedCornerShape(4.dp)
)
.padding(horizontal = 8.dp, vertical = 6.dp),
)
}
@ -160,7 +167,10 @@ fun NetworkItemView(
style = bodySmall,
color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.weight(2f)
.background(color = FloconColors.pannel.copy(alpha = 0.8f), shape = RoundedCornerShape(4.dp))
.background(
color = FloconColors.pannel.copy(alpha = 0.8f),
shape = RoundedCornerShape(4.dp)
)
.padding(horizontal = 8.dp, vertical = 6.dp),
)
}

View file

@ -24,7 +24,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.network.ui.NetworkViewModel
import io.github.openflocon.flocondesktop.features.network.ui.model.NetworkDetailViewState
import io.github.openflocon.flocondesktop.features.network.ui.model.NetworkItemViewState
@ -33,6 +32,7 @@ import io.github.openflocon.flocondesktop.features.network.ui.model.previewGraph
import io.github.openflocon.flocondesktop.features.network.ui.model.previewNetworkItemViewState
import io.github.openflocon.flocondesktop.features.network.ui.view.components.NetworkFilterBar
import io.github.openflocon.flocondesktop.features.network.ui.view.components.NetworkItemHeaderView
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.viewmodel.koinViewModel
@ -76,8 +76,8 @@ fun NetworkScreen(
.fillMaxWidth()
.background(FloconColors.pannel)
.padding(all = 12.dp),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.titleLarge,
color = FloconTheme.colorScheme.onSurface,
)
NetworkFilterBar(
modifier =

View file

@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
@ -29,6 +28,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.unit.dp
import io.github.openflocon.library.designsystem.FloconTheme
@Composable
fun FilterBar(
@ -49,24 +49,24 @@ fun FilterBar(
// Custom styled BasicTextField
Box(
modifier =
Modifier
.weight(1f)
.height(48.dp)
.clip(RoundedCornerShape(12.dp))
.background(MaterialTheme.colorScheme.surfaceVariant)
.padding(horizontal = 12.dp, vertical = 8.dp),
Modifier
.weight(1f)
.height(48.dp)
.clip(RoundedCornerShape(12.dp))
.background(FloconTheme.colorScheme.surfaceVariant)
.padding(horizontal = 12.dp, vertical = 8.dp),
contentAlignment = Alignment.CenterStart,
) {
if (displayPlaceholder) {
Text(
text = placeholderText,
style =
MaterialTheme.typography.bodySmall.copy(
color =
MaterialTheme.colorScheme.onSurfaceVariant.copy(
alpha = 0.4f,
FloconTheme.typography.bodySmall.copy(
color =
FloconTheme.colorScheme.onSurfaceVariant.copy(
alpha = 0.4f,
),
),
),
)
}
BasicTextField(
@ -76,9 +76,9 @@ fun FilterBar(
onTextChangedCallback(filterText)
},
singleLine = true,
textStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurface),
textStyle = FloconTheme.typography.bodySmall.copy(color = FloconTheme.colorScheme.onSurface),
modifier = Modifier.fillMaxWidth(),
cursorBrush = SolidColor(MaterialTheme.colorScheme.primary),
cursorBrush = SolidColor(FloconTheme.colorScheme.primary),
)
}
@ -91,14 +91,14 @@ fun FilterBar(
Text(
text = "Clear",
modifier =
Modifier
.clip(RoundedCornerShape(12.dp))
.clickable {
filterText = ""
onTextChangedCallback("")
}.padding(horizontal = 12.dp),
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f),
style = MaterialTheme.typography.titleMedium,
Modifier
.clip(RoundedCornerShape(12.dp))
.clickable {
filterText = ""
onTextChangedCallback("")
}.padding(horizontal = 12.dp),
color = FloconTheme.colorScheme.onSurface.copy(alpha = 0.7f),
style = FloconTheme.typography.titleMedium,
)
}
}

View file

@ -1,22 +1,22 @@
package io.github.openflocon.flocondesktop.features.network.ui.view.components
import androidx.compose.foundation.layout.Box
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import io.github.openflocon.library.designsystem.FloconTheme
@Composable
fun HeaderLabelItem(
text: String,
contentAlignment: Alignment = Alignment.Center,
modifier: Modifier = Modifier,
contentAlignment: Alignment = Alignment.Center,
) {
val typo = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold)
val textColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.7f)
val typo = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold)
val textColor = FloconTheme.colorScheme.onSurface.copy(alpha = 0.7f)
Box(
modifier = modifier,

View file

@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -19,8 +18,8 @@ import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.network.ui.model.NetworkMethodUi
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.ui.tooling.preview.Preview
@ -40,7 +39,8 @@ private val deleteMethodText = Color(0xFFDC3545)
private val otherMethodBackground = Color(0xFF6C757D).copy(alpha = 0.3f) // Muted gray for OTHER
private val otherMethodText = Color(0xFF6C757D)
private val graphQlQueryMethodBackground = Color(0XAAE235A9).copy(alpha = 0.8f) // Muted gray for OTHER
private val graphQlQueryMethodBackground =
Color(0XAAE235A9).copy(alpha = 0.8f) // Muted gray for OTHER
private val graphQlQueryMethodText = Color(0XAAFFFFFF)
private val grpcMethodBackground = Color(0xff71CCCB)
@ -85,11 +85,11 @@ fun NetworkTag(
) {
Row(
modifier =
modifier
.background(
color = backgroundColor,
shape = RoundedCornerShape(20.dp), // Pill shape
).padding(horizontal = 4.dp, vertical = 2.dp),
modifier
.background(
color = backgroundColor,
shape = RoundedCornerShape(20.dp), // Pill shape
).padding(horizontal = 4.dp, vertical = 2.dp),
// Padding inside the tag
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
@ -107,7 +107,7 @@ fun NetworkTag(
text = text,
color = textColor,
fontSize = textSize,
style = MaterialTheme.typography.bodySmall,
style = FloconTheme.typography.bodySmall,
)
}
}

View file

@ -3,15 +3,14 @@ package io.github.openflocon.flocondesktop.features.network.ui.view.components
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.text.BasicText
import androidx.compose.foundation.text.TextAutoSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.sp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.network.ui.model.NetworkStatusUi
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
// Custom colors for networkStatusUi/method views to integrate better with the theme
@ -29,13 +28,13 @@ fun StatusView(
) {
Box(modifier = modifier, contentAlignment = Alignment.Center) {
BasicText(
text = status.text.toString(),
text = status.text,
autoSize = TextAutoSize.StepBased(
maxFontSize = textSize,
minFontSize = 8.sp,
),
maxLines = 1,
style = MaterialTheme.typography.labelSmall.copy(
style = FloconTheme.typography.labelSmall.copy(
color = when (status.isSuccess) {
true -> successTagText
false -> errorTagText
@ -51,10 +50,10 @@ private fun StatusView_Preview() {
FloconTheme {
StatusView(
status =
NetworkStatusUi(
text = "200",
isSuccess = true,
),
NetworkStatusUi(
text = "200",
isSuccess = true,
),
)
}
}

View file

@ -6,13 +6,12 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -24,7 +23,7 @@ fun CodeBlockView(
modifier =
modifier
.background(
color = MaterialTheme.colorScheme.surfaceVariant,
color = FloconTheme.colorScheme.surfaceVariant,
shape = RoundedCornerShape(8.dp),
).padding(8.dp),
) {
@ -32,8 +31,8 @@ fun CodeBlockView(
SelectionContainer {
Text(
text = code,
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace),
color = FloconTheme.colorScheme.onSurface,
style = FloconTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace),
)
}
}

View file

@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -15,9 +14,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastForEachIndexed
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.network.ui.model.NetworkDetailHeaderUi
import io.github.openflocon.flocondesktop.features.network.ui.model.previewNetworkDetailHeaderUi
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -53,14 +52,14 @@ fun DetailHeadersItemView(
) {
Text(
text = state.name,
style = MaterialTheme.typography.bodySmall, // Slightly smaller title for details
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
style = FloconTheme.typography.bodySmall, // Slightly smaller title for details
color = FloconTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
modifier = Modifier.width(labelWidth).padding(end = 8.dp),
)
Text(
text = state.value,
style = MaterialTheme.typography.bodySmall, // Body text for the URL
color = MaterialTheme.colorScheme.onBackground, // Primary text color
style = FloconTheme.typography.bodySmall, // Body text for the URL
color = FloconTheme.colorScheme.onBackground, // Primary text color
modifier = Modifier.weight(1f), // Takes remaining space
)
}

View file

@ -13,7 +13,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -30,8 +30,8 @@ fun DetailLineTextView(
) {
Text(
text = value,
style = MaterialTheme.typography.bodyMedium, // Body text for the URL
color = MaterialTheme.colorScheme.onBackground, // Primary text color
style = FloconTheme.typography.bodyMedium, // Body text for the URL
color = FloconTheme.colorScheme.onBackground, // Primary text color
modifier = Modifier.weight(1f), // Takes remaining space
)
}
@ -50,8 +50,8 @@ fun DetailLineView(
) {
Text(
text = label,
style = MaterialTheme.typography.titleSmall, // Slightly smaller title for details
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
style = FloconTheme.typography.titleSmall, // Slightly smaller title for details
color = FloconTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
modifier = Modifier.width(labelWidth).padding(end = 8.dp),
)
SelectionContainer {

View file

@ -4,13 +4,12 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -32,15 +31,15 @@ fun DetailSectionTitleView(
) {
Text(
text = if (isExpanded) "▼" else "▶", // Toggle icon
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f),
style = MaterialTheme.typography.titleMedium,
color = FloconTheme.colorScheme.onBackground.copy(alpha = 0.7f),
style = FloconTheme.typography.titleMedium,
)
}
}
Text(
text = title,
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onBackground,
style = FloconTheme.typography.titleMedium,
color = FloconTheme.colorScheme.onBackground,
modifier = Modifier.weight(1f), // Takes remaining space
)
if (onCopy != null) {
@ -50,8 +49,8 @@ fun DetailSectionTitleView(
) {
Text(
text = "📄", // Copy icon
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f),
style = MaterialTheme.typography.titleMedium,
color = FloconTheme.colorScheme.onBackground.copy(alpha = 0.7f),
style = FloconTheme.typography.titleMedium,
)
}
}

View file

@ -13,9 +13,9 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastForEach
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.table.ui.model.TableRowUiModel
import io.github.openflocon.flocondesktop.features.table.ui.model.previewTableRowUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -39,8 +39,8 @@ fun TableRowView(
Modifier
.width(columnsWidth)
.padding(horizontal = 4.dp),
style = MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Bold),
color = MaterialTheme.colorScheme.onPrimaryContainer,
style = FloconTheme.typography.titleSmall.copy(fontWeight = FontWeight.Bold),
color = FloconTheme.colorScheme.onPrimaryContainer,
)
}
}
@ -52,8 +52,8 @@ fun TableRowView(
Modifier
.width(columnsWidth)
.padding(horizontal = 4.dp),
style = MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Thin),
color = MaterialTheme.colorScheme.onPrimaryContainer,
style = FloconTheme.typography.titleSmall.copy(fontWeight = FontWeight.Thin),
color = FloconTheme.colorScheme.onPrimaryContainer,
)
}
}

View file

@ -19,7 +19,6 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -43,6 +42,7 @@ import io.github.openflocon.flocondesktop.features.table.ui.model.TablesStateUiM
import io.github.openflocon.flocondesktop.features.table.ui.model.items
import io.github.openflocon.flocondesktop.features.table.ui.model.previewTableContentStateUiModel
import io.github.openflocon.flocondesktop.features.table.ui.model.previewTablesStateUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.viewmodel.koinViewModel
@ -94,8 +94,8 @@ fun TableScreen(
) {
Text(
text = "Tables",
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.titleLarge,
color = FloconTheme.colorScheme.onSurface,
)
TableSelectorView(
@ -143,8 +143,8 @@ fun TableScreen(
if (index < tableItems.lastIndex) {
HorizontalDivider(
modifier =
Modifier.fillMaxWidth()
.padding(top = 4.dp),
Modifier.fillMaxWidth()
.padding(top = 4.dp),
)
}
}
@ -157,10 +157,10 @@ fun TableScreen(
selectedItem?.let {
TableDetailView(
modifier =
Modifier
.align(Alignment.TopEnd)
.fillMaxHeight()
.width(500.dp),
Modifier
.align(Alignment.TopEnd)
.fillMaxHeight()
.width(500.dp),
state = it,
)
}
@ -174,7 +174,7 @@ fun TableDetailView(modifier: Modifier = Modifier, state: TableRowUiModel) {
val linesLabelWidth: Dp = 130.dp
SelectionContainer(
modifier
.background(FloconColors.background)
.background(FloconTheme.colorScheme.background)
.verticalScroll(scrollState) // Rendre le contenu défilable
.padding(all = 18.dp),
) {
@ -207,8 +207,8 @@ fun TableDetailLineTextView(
) {
Text(
text = value,
style = MaterialTheme.typography.bodyMedium, // Body text for the URL
color = MaterialTheme.colorScheme.onBackground, // Primary text color
style = FloconTheme.typography.bodyMedium, // Body text for the URL
color = FloconTheme.colorScheme.onBackground, // Primary text color
modifier = Modifier.weight(1f), // Takes remaining space
)
}
@ -227,8 +227,8 @@ fun TableDetailLineView(
) {
Text(
text = label,
style = MaterialTheme.typography.titleSmall, // Slightly smaller title for details
color = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
style = FloconTheme.typography.titleSmall, // Slightly smaller title for details
color = FloconTheme.colorScheme.onBackground.copy(alpha = 0.7f), // Muted label color
modifier = Modifier.width(labelWidth).padding(end = 8.dp),
)
content()

View file

@ -24,10 +24,10 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.features.table.ui.model.DeviceTableUiModel
import io.github.openflocon.flocondesktop.features.table.ui.model.TablesStateUiModel
import io.github.openflocon.flocondesktop.features.table.ui.model.previewDeviceTableUiModel
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -49,8 +49,8 @@ internal fun TableSelectorView(
) {
Text(
text = "Table : ",
color = MaterialTheme.colorScheme.onBackground,
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
color = FloconTheme.colorScheme.onBackground,
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
)
Spacer(modifier = Modifier.width(4.dp))
@ -63,9 +63,9 @@ internal fun TableSelectorView(
TablesStateUiModel.Empty -> {
Text(
modifier =
Modifier
.background(MaterialTheme.colorScheme.onBackground, shape = shape)
.padding(contentPadding),
Modifier
.background(FloconTheme.colorScheme.onBackground, shape = shape)
.padding(contentPadding),
text = "No Table Found",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.background,
@ -77,13 +77,13 @@ internal fun TableSelectorView(
TableView(
table = tablesState.selected,
textColor = MaterialTheme.colorScheme.background,
textColor = FloconTheme.colorScheme.background,
modifier =
Modifier
.clip(shape)
.background(MaterialTheme.colorScheme.onBackground)
.clickable { expanded = true }
.padding(contentPadding),
Modifier
.clip(shape)
.background(FloconTheme.colorScheme.onBackground)
.clickable { expanded = true }
.padding(contentPadding),
)
DropdownMenu(
@ -95,7 +95,7 @@ internal fun TableSelectorView(
text = {
TableView(
table = table,
textColor = MaterialTheme.colorScheme.onBackground,
textColor = FloconTheme.colorScheme.onBackground,
modifier = Modifier.padding(all = 4.dp),
)
},

View file

@ -31,6 +31,7 @@ import androidx.compose.ui.window.Dialog
import io.github.openflocon.flocondesktop.common.ui.FloconColorScheme
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.viewmodel.koinViewModel
@ -89,14 +90,14 @@ private fun SettingsScreen(
) {
Text(
text = "Settings",
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.titleLarge,
color = FloconTheme.colorScheme.onSurface,
)
SettingsButton(
shape = RoundedCornerShape(12.dp),
modifier = Modifier.align(Alignment.CenterEnd),
onClick = { onClickLicenses() },
onClick = onClickLicenses,
text = "Licenses",
)
}
@ -114,7 +115,7 @@ private fun SettingsScreen(
.padding(horizontal = 8.dp),
text = "Please setup ADB first, this field is mandatory",
color = Color.Red,
style = MaterialTheme.typography.bodySmall,
style = FloconTheme.typography.bodySmall,
)
} else {
Text(
@ -123,12 +124,12 @@ private fun SettingsScreen(
.padding(horizontal = 8.dp),
text = "ADB configuraton is valid",
color = Color.Green,
style = MaterialTheme.typography.bodySmall,
style = FloconTheme.typography.bodySmall,
)
}
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = androidx.compose.ui.Alignment.CenterVertically,
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
Box(
@ -142,17 +143,17 @@ private fun SettingsScreen(
if (adbPathText.isEmpty())
Text(
text = "Ex: /Users/youruser/Library/Android/sdk/platform-tools/adb",
style = MaterialTheme.typography.bodySmall,
color = FloconColors.onSurface.copy(alpha = 0.45f),
style = FloconTheme.typography.bodySmall,
color = FloconTheme.colorScheme.onSurface.copy(alpha = 0.45f),
)
BasicTextField(
modifier = Modifier.fillMaxWidth(),
textStyle = MaterialTheme.typography.bodySmall.copy(
color = FloconColors.onSurface,
textStyle = FloconTheme.typography.bodySmall.copy(
color = FloconTheme.colorScheme.onSurface,
),
value = adbPathText,
onValueChange = { onAdbPathChanged(it) },
cursorBrush = SolidColor(MaterialTheme.colorScheme.onSurface),
cursorBrush = SolidColor(FloconTheme.colorScheme.onSurface),
)
}
SettingsButton(
@ -195,7 +196,7 @@ private fun SettingsButton(
) {
Text(
text = text,
style = MaterialTheme.typography.bodySmall.copy(
style = FloconTheme.typography.bodySmall.copy(
color = Color.Black,
),
)

View file

@ -33,10 +33,10 @@ import flocondesktop.composeapp.generated.resources.Res
import flocondesktop.composeapp.generated.resources.smartphone
import io.github.openflocon.flocondesktop.common.ui.FloconColorScheme
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.flocondesktop.main.ui.model.DeviceItemUiModel
import io.github.openflocon.flocondesktop.main.ui.model.DevicesStateUiModel
import io.github.openflocon.flocondesktop.main.ui.model.previewDeviceItemUiModelPreview
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.ui.tooling.preview.Preview
@ -73,8 +73,8 @@ internal fun DeviceSelectorView(
Text(
text = "No Devices Found",
modifier = Modifier.padding(vertical = 4.dp, horizontal = 12.dp),
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurface,
style = FloconTheme.typography.bodyMedium,
color = FloconTheme.colorScheme.onSurface,
)
}
@ -142,17 +142,17 @@ private fun DeviceView(
Text(
text = device.deviceName, // Device Name
color = FloconColorScheme.onSurface,
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Bold),
)
Text(
text = device.appName,
color = FloconColorScheme.onSurface.copy(alpha = 0.5f),
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Thin),
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Thin),
)
Text(
text = device.appPackageName,
color = FloconColorScheme.onSurface.copy(alpha = 0.5f),
style = MaterialTheme.typography.bodySmall.copy(fontWeight = FontWeight.Thin),
style = FloconTheme.typography.bodySmall.copy(fontWeight = FontWeight.Thin),
)
}
}

View file

@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
@ -40,6 +39,7 @@ import io.github.openflocon.flocondesktop.main.ui.model.leftpanel.LeftPanelState
import io.github.openflocon.flocondesktop.main.ui.model.leftpanel.previewLeftPannelState
import io.github.openflocon.flocondesktop.main.ui.model.previewDevicesStateUiModel
import io.github.openflocon.flocondesktop.main.ui.view.DeviceSelectorView
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.ui.tooling.preview.Preview
@ -70,7 +70,7 @@ fun LeftPanelView(
Text(
"Flocon",
fontSize = 32.sp,
style = MaterialTheme.typography.titleLarge.copy(
style = FloconTheme.typography.titleLarge.copy(
color = FloconColorScheme.onSurface,
fontWeight = FontWeight.Bold,
),

View file

@ -1,13 +1,13 @@
package io.github.openflocon.flocondesktop.main.ui.view.leftpannel
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconColorScheme
import io.github.openflocon.library.designsystem.FloconTheme
@Composable
fun PannelLabel(
@ -21,7 +21,7 @@ fun PannelLabel(
bottom = 4.dp,
),
text = text,
style = MaterialTheme.typography.bodyLarge.copy(
style = FloconTheme.typography.bodyLarge.copy(
fontWeight = FontWeight.Thin,
color = FloconColorScheme.onSurface.copy(alpha = 0.5f),
),

View file

@ -11,7 +11,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -21,7 +20,7 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import io.github.openflocon.flocondesktop.common.ui.FloconColorScheme
import io.github.openflocon.flocondesktop.common.ui.FloconColors
import io.github.openflocon.flocondesktop.common.ui.FloconTheme
import io.github.openflocon.library.designsystem.FloconTheme
import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable
@ -56,7 +55,7 @@ fun PannelView(
Text(
text = text,
color = FloconColorScheme.onSurface,
style = MaterialTheme.typography.bodyMedium,
style = FloconTheme.typography.bodyMedium,
)
}
}

View file

@ -1,5 +1,5 @@
[versions]
agp = "8.7.3"
agp = "8.8.0"
android-compileSdk = "35"
android-minSdk = "24"
android-targetSdk = "35"
@ -27,6 +27,9 @@ room = "2.7.1"
ksp = "2.2.0-2.0.2"
ktlintGradle = "13.0.0"
aboutLibraries = "12.2.4"
kotlinStdlib = "2.2.0"
runner = "1.5.2"
core = "1.5.0"
[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
@ -70,7 +73,10 @@ sqlite-bundled = { module = "androidx.sqlite:sqlite-bundled", version.ref = "sql
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutLibraries" }
# Compose UI modules (choose one or both)
aboutlibraries-compose-core = { module = "com.mikepenz:aboutlibraries-compose-core", version.ref = "aboutLibraries" } # Common compose core
aboutlibraries-compose-m3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutLibraries" } # Material 3 UI
aboutlibraries-compose-m3 = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutLibraries" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlinStdlib" }
androidx-runner = { group = "androidx.test", name = "runner", version.ref = "runner" }
androidx-core = { group = "androidx.test", name = "core", version.ref = "core" } # Material 3 UI
[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
@ -86,3 +92,5 @@ ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
room = { id = "androidx.room", version.ref = "room" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlintGradle" }
aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutLibraries" }
android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
android-lint = { id = "com.android.lint", version.ref = "agp" }

View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,83 @@
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.composeHotReload)
alias(libs.plugins.androidLibrary)
}
kotlin {
jvmToolchain(21)
compilerOptions {
// Pour Kotlin 1.9+
freeCompilerArgs.add("-opt-in=kotlin.time.ExperimentalTime")
freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi")
}
androidTarget()
jvm("desktop")
sourceSets {
androidMain.dependencies {
implementation(libs.androidx.activity.compose)
implementation(project.dependencies.platform(libs.koin.bom))
implementation(libs.koin.android)
}
commonMain {
dependencies {
implementation(libs.kotlin.stdlib)
api(compose.runtime)
api(compose.foundation)
api(compose.animation)
api(compose.material3)
api(compose.materialIconsExtended)
api(compose.ui)
api(compose.components.resources)
api(compose.components.uiToolingPreview)
}
}
commonTest {
dependencies {
implementation(libs.kotlin.test)
}
}
}
}
android {
namespace = "io.github.openflocon.library.designsystem"
compileSdk = libs.versions.android.compileSdk
.get()
.toInt()
defaultConfig {
minSdk = libs.versions.android.minSdk
.get()
.toInt()
targetSdk = libs.versions.android.targetSdk
.get()
.toInt()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

View file

@ -0,0 +1,24 @@
package io.github.openflocon.library.designsystem
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("io.github.openflocon.library.designsystem.test", appContext.packageName)
}
}

View file

@ -0,0 +1,16 @@
package io.github.openflocon.library.designsystem
import kotlin.test.Test
import kotlin.test.assertEquals
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>

View file

@ -0,0 +1,49 @@
package io.github.openflocon.library.designsystem
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Shapes
import androidx.compose.material3.Typography
import androidx.compose.material3.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ReadOnlyComposable
import io.github.openflocon.library.designsystem.theme.FloconDarkColorScheme
import io.github.openflocon.library.designsystem.theme.FloconLightColorScheme
object FloconTheme {
val colorScheme: ColorScheme
@Composable @ReadOnlyComposable get() = MaterialTheme.colorScheme
val typography: Typography
@Composable @ReadOnlyComposable get() = MaterialTheme.typography
val shapes: Shapes
@Composable @ReadOnlyComposable get() = MaterialTheme.shapes
}
@Composable
fun FloconTheme(
isDarkTheme: Boolean = isSystemInDarkTheme(), // TODO Add setting and override
content: @Composable () -> Unit
) {
val colorScheme = if (isDarkTheme)
FloconDarkColorScheme
else
FloconLightColorScheme
val ripple = ripple()
MaterialTheme(
colorScheme = colorScheme,
typography = MaterialTheme.typography // Or define your custom typography,
) {
CompositionLocalProvider(
LocalIndication provides ripple,
content = content
)
}
}

View file

@ -0,0 +1,79 @@
package io.github.openflocon.library.designsystem.theme
import androidx.compose.material3.darkColorScheme
import androidx.compose.ui.graphics.Color
private object FloconColors {
val primary = Color(0xff0A84FF) // Your main accent color (Apple Blue)
val onPrimary = Color(0xffF2F2F7) // Text/icons on primary
val surface = Color(0xFF2C2C2E) // For cards, sheets, distinct elements
val onSurface = Color(0xffF2F2F7) // Primary text on surfaces
val background = Color(0xff1E1E1E) // Your main app background
val onBackground = Color(0xffF2F2F7) // Primary text on background
val pannel = Color(0xff1E1F22)
val secondary = Color(0xffAEAEB2) // For secondary UI elements, less prominent text
val onSecondary = Color(0xff1E1E1E) // Dark text/icons on secondary
val tertiary = Color(0xFFBF5AF2) // An optional third accent (soft purple)
val onTertiary = Color(0xffF2F2F7) // Text/icons on tertiary
val error = Color(0xFFCF6679) // Standard error color
val onError = Color(0xFF000000) // Text/icons on error color
}
internal val FloconDarkColorScheme = darkColorScheme(
primary = FloconColors.primary,
onPrimary = FloconColors.onPrimary,
primaryContainer = FloconColors.primary.copy(alpha = 0.2f),
onPrimaryContainer = FloconColors.onPrimary,
secondary = FloconColors.secondary,
onSecondary = FloconColors.onSecondary,
secondaryContainer = FloconColors.secondary.copy(alpha = 0.2f),
onSecondaryContainer = FloconColors.onSecondary,
tertiary = FloconColors.tertiary,
onTertiary = FloconColors.onTertiary,
tertiaryContainer = FloconColors.tertiary.copy(alpha = 0.2f),
onTertiaryContainer = FloconColors.onTertiary,
background = FloconColors.background,
onBackground = FloconColors.onBackground,
surface = FloconColors.surface,
onSurface = FloconColors.onSurface,
surfaceVariant = FloconColors.surface.copy(alpha = 0.8f),
onSurfaceVariant = FloconColors.onSurface,
error = FloconColors.error,
onError = FloconColors.onError,
errorContainer = Color(0xFFF2B8B5), // These specific error container colors are hardcoded Material 3 defaults
onErrorContainer = Color(0xFF601410),
outline = FloconColors.secondary.copy(alpha = 0.5f),
)
// TODO Add light colors
internal val FloconLightColorScheme = darkColorScheme(
primary = FloconColors.primary,
onPrimary = FloconColors.onPrimary,
primaryContainer = FloconColors.primary.copy(alpha = 0.2f),
onPrimaryContainer = FloconColors.onPrimary,
secondary = FloconColors.secondary,
onSecondary = FloconColors.onSecondary,
secondaryContainer = FloconColors.secondary.copy(alpha = 0.2f),
onSecondaryContainer = FloconColors.onSecondary,
tertiary = FloconColors.tertiary,
onTertiary = FloconColors.onTertiary,
tertiaryContainer = FloconColors.tertiary.copy(alpha = 0.2f),
onTertiaryContainer = FloconColors.onTertiary,
background = FloconColors.background,
onBackground = FloconColors.onBackground,
surface = FloconColors.surface,
onSurface = FloconColors.onSurface,
surfaceVariant = FloconColors.surface.copy(alpha = 0.8f),
onSurfaceVariant = FloconColors.onSurface,
error = FloconColors.error,
onError = FloconColors.onError,
errorContainer = Color(0xFFF2B8B5), // These specific error container colors are hardcoded Material 3 defaults
onErrorContainer = Color(0xFF601410),
outline = FloconColors.secondary.copy(alpha = 0.5f),
)

View file

@ -34,4 +34,5 @@ plugins {
include(":composeApp")
include(":server")
include(":shared")
include(":shared")
include(":library:designsystem")