@@ -14,18 +14,22 @@ package com.orange.ouds.core.utilities
1414
1515import androidx.compose.foundation.background
1616import androidx.compose.foundation.layout.Box
17+ import androidx.compose.foundation.layout.PaddingValues
1718import androidx.compose.foundation.layout.padding
1819import androidx.compose.material3.Text
1920import androidx.compose.runtime.Composable
2021import androidx.compose.ui.Alignment
2122import androidx.compose.ui.Modifier
2223import androidx.compose.ui.draw.alpha
2324import androidx.compose.ui.graphics.Color
25+ import androidx.compose.ui.graphics.RectangleShape
26+ import androidx.compose.ui.graphics.Shape
2427import androidx.compose.ui.platform.LocalInspectionMode
2528import androidx.compose.ui.text.TextStyle
2629import androidx.compose.ui.text.font.FontFamily
2730import androidx.compose.ui.text.style.TextAlign
2831import androidx.compose.ui.unit.dp
32+ import androidx.compose.ui.unit.sp
2933import com.orange.ouds.core.theme.LocalColorMode
3034import com.orange.ouds.core.theme.OudsTheme
3135import com.orange.ouds.core.theme.dashedBorder
@@ -35,6 +39,8 @@ internal fun CheckedContent(
3539 expression : Boolean ,
3640 exceptionMessage : () -> String ,
3741 previewMessage : () -> String = { "⛔" },
42+ previewMessagePaddingValues : PaddingValues = PaddingValues (all = OudsTheme .spaces.fixed.small),
43+ shape : Shape = RectangleShape ,
3844 content : @Composable () -> Unit
3945) {
4046 // Throw an exception at runtime if expression is false
@@ -50,16 +56,17 @@ internal fun CheckedContent(
5056 val backgroundColor = if (LocalColorMode .current != null ) Color .Black .copy(alpha = 0.68f ) else Color .Transparent
5157 Box (
5258 modifier = Modifier
53- .dashedBorder(width = 1 .dp, color = color, intervals = listOf (10 .dp, 5 .dp))
59+ .dashedBorder(width = 1 .dp, color = color, shape = shape, intervals = listOf (10 .dp, 5 .dp))
5460 .background(backgroundColor),
5561 contentAlignment = Alignment .Center
5662 ) {
5763 Box (modifier = Modifier .alpha(0f )) { content() } // Add content but hide it in order to make room for the text
5864 Text (
59- modifier = Modifier .padding(OudsTheme .spaces.fixed.small ),
65+ modifier = Modifier .padding(previewMessagePaddingValues ),
6066 text = previewMessage(),
6167 color = color,
6268 textAlign = TextAlign .Center ,
69+ fontSize = 14 .sp,
6370 style = TextStyle (fontFamily = FontFamily .Monospace )
6471 )
6572 }
0 commit comments