Skip to content

Commit 2e872be

Browse files
nomanrgithub-actions
authored andcommitted
Consistent copy visibility for internal data classes (#28)
1 parent 2cb81fd commit 2e872be

File tree

8 files changed

+59
-77
lines changed

8 files changed

+59
-77
lines changed

lumo-ui/plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "com.nomanr"
7-
version = "1.1.1"
7+
version = "1.2.0"
88

99
gradlePlugin {
1010
plugins {

lumo-ui/plugin/src/main/resources/templates/android/components/NavigationBar.kt.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ object NavigationBarItemDefaults {
273273
fun textStyle(): TextStyle = {{themeName}}.typography.label2
274274
}
275275

276+
@ConsistentCopyVisibility
276277
@Stable
277278
data class NavigationBarItemColors internal constructor(
278279
private val selectedIconColor: Color,

lumo-ui/plugin/src/main/resources/templates/android/components/Slider.kt.template

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.height
1313
import androidx.compose.foundation.layout.padding
1414
import androidx.compose.foundation.layout.width
1515
import androidx.compose.foundation.rememberScrollState
16+
import androidx.compose.foundation.text.BasicText
1617
import androidx.compose.foundation.verticalScroll
1718
import androidx.compose.runtime.Composable
1819
import androidx.compose.runtime.Stable
@@ -182,16 +183,15 @@ private fun SliderPreview() {
182183
.fillMaxSize(),
183184
verticalArrangement = Arrangement.spacedBy(32.dp),
184185
) {
185-
Text(
186+
BasicText(
186187
text = "Slider Components",
187188
style = {{themeName}}.typography.h3,
188189
)
189190

190191
Column {
191-
Text(
192+
BasicText(
192193
text = "Basic Slider",
193194
style = {{themeName}}.typography.h4,
194-
color = {{themeName}}.colors.primary,
195195
)
196196
var value by remember { mutableFloatStateOf(0.5f) }
197197
Slider(
@@ -202,10 +202,9 @@ private fun SliderPreview() {
202202
}
203203

204204
Column {
205-
Text(
205+
BasicText(
206206
text = "Stepped Slider (5 steps)",
207207
style = {{themeName}}.typography.h4,
208-
color = {{themeName}}.colors.primary,
209208
)
210209
var value by remember { mutableFloatStateOf(0.4f) }
211210
Slider(
@@ -217,10 +216,9 @@ private fun SliderPreview() {
217216
}
218217

219218
Column {
220-
Text(
219+
BasicText(
221220
text = "Custom Range (0-100)",
222221
style = {{themeName}}.typography.h4,
223-
color = {{themeName}}.colors.primary,
224222
)
225223
var value by remember { mutableFloatStateOf(30f) }
226224
Row(
@@ -234,7 +232,7 @@ private fun SliderPreview() {
234232
valueRange = 0f..100f,
235233
modifier = Modifier.weight(1f),
236234
)
237-
Text(
235+
BasicText(
238236
text = "${value.toInt()}",
239237
style = {{themeName}}.typography.body1,
240238
modifier = Modifier.width(40.dp),
@@ -243,10 +241,9 @@ private fun SliderPreview() {
243241
}
244242

245243
Column {
246-
Text(
244+
BasicText(
247245
text = "Disabled States",
248246
style = {{themeName}}.typography.h4,
249-
color = {{themeName}}.colors.primary,
250247
)
251248
Slider(
252249
value = 0.3f,
@@ -264,10 +261,9 @@ private fun SliderPreview() {
264261
}
265262

266263
Column {
267-
Text(
264+
BasicText(
268265
text = "Custom Colors",
269266
style = {{themeName}}.typography.h4,
270-
color = {{themeName}}.colors.primary,
271267
)
272268
var value by remember { mutableFloatStateOf(0.5f) }
273269
Slider(
@@ -284,14 +280,13 @@ private fun SliderPreview() {
284280
}
285281

286282
Column {
287-
Text(
283+
BasicText(
288284
text = "Interactive Slider",
289285
style = {{themeName}}.typography.h4,
290-
color = {{themeName}}.colors.primary,
291286
)
292287
var value by remember { mutableFloatStateOf(50f) }
293288
var isEditing by remember { mutableStateOf(false) }
294-
Text(
289+
BasicText(
295290
text = if (isEditing) "Editing..." else "Value: ${value.toInt()}",
296291
style = {{themeName}}.typography.body1,
297292
)
@@ -323,16 +318,15 @@ private fun RangeSliderPreview() {
323318
.fillMaxWidth(),
324319
verticalArrangement = Arrangement.spacedBy(32.dp),
325320
) {
326-
Text(
321+
BasicText(
327322
text = "Range Slider Components",
328323
style = {{themeName}}.typography.h3,
329324
)
330325

331326
Column {
332-
Text(
327+
BasicText(
333328
text = "Basic Range Slider",
334329
style = {{themeName}}.typography.h4,
335-
color = {{themeName}}.colors.primary,
336330
)
337331
var range by remember { mutableStateOf(0.2f..0.8f) }
338332
RangeSlider(
@@ -343,10 +337,9 @@ private fun RangeSliderPreview() {
343337
}
344338

345339
Column {
346-
Text(
340+
BasicText(
347341
text = "Stepped Range Slider (5 steps)",
348342
style = {{themeName}}.typography.h4,
349-
color = {{themeName}}.colors.primary,
350343
)
351344
var range by remember { mutableStateOf(0.2f..0.6f) }
352345
RangeSlider(
@@ -358,10 +351,9 @@ private fun RangeSliderPreview() {
358351
}
359352

360353
Column {
361-
Text(
354+
BasicText(
362355
text = "Custom Range (0-100)",
363356
style = {{themeName}}.typography.h4,
364-
color = {{themeName}}.colors.primary,
365357
)
366358
var range by remember { mutableStateOf(20f..80f) }
367359
Column {
@@ -375,11 +367,11 @@ private fun RangeSliderPreview() {
375367
modifier = Modifier.fillMaxWidth(),
376368
horizontalArrangement = Arrangement.SpaceBetween,
377369
) {
378-
Text(
370+
BasicText(
379371
text = "Start: ${range.start.toInt()}",
380372
style = {{themeName}}.typography.body1,
381373
)
382-
Text(
374+
BasicText(
383375
text = "End: ${range.endInclusive.toInt()}",
384376
style = {{themeName}}.typography.body1,
385377
)
@@ -388,10 +380,9 @@ private fun RangeSliderPreview() {
388380
}
389381

390382
Column {
391-
Text(
383+
BasicText(
392384
text = "Disabled State",
393385
style = {{themeName}}.typography.h4,
394-
color = {{themeName}}.colors.primary,
395386
)
396387
RangeSlider(
397388
value = 0.3f..0.7f,
@@ -402,10 +393,9 @@ private fun RangeSliderPreview() {
402393
}
403394

404395
Column {
405-
Text(
396+
BasicText(
406397
text = "Custom Colors",
407398
style = {{themeName}}.typography.h4,
408-
color = {{themeName}}.colors.primary,
409399
)
410400
var range by remember { mutableStateOf(0.3f..0.7f) }
411401
RangeSlider(
@@ -422,14 +412,13 @@ private fun RangeSliderPreview() {
422412
}
423413

424414
Column {
425-
Text(
415+
BasicText(
426416
text = "Interactive Range Slider",
427417
style = {{themeName}}.typography.h4,
428-
color = {{themeName}}.colors.primary,
429418
)
430419
var range by remember { mutableStateOf(30f..70f) }
431420
var isEditing by remember { mutableStateOf(false) }
432-
Text(
421+
BasicText(
433422
text = if (isEditing) "Editing..." else "Range: ${range.start.toInt()} - ${range.endInclusive.toInt()}",
434423
style = {{themeName}}.typography.body1,
435424
)

lumo-ui/plugin/src/main/resources/templates/android/components/Tooltip.kt.template

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ fun TooltipScope.Tooltip(
136136
) {
137137
Box(
138138
modifier =
139-
Modifier
140-
.sizeIn(
141-
minWidth = TooltipDefaults.MinWidth,
142-
maxWidth = maxWidth,
143-
minHeight = TooltipDefaults.MinHeight,
144-
)
145-
.padding(TooltipDefaults.ContentPadding),
139+
Modifier
140+
.sizeIn(
141+
minWidth = TooltipDefaults.MinWidth,
142+
maxWidth = maxWidth,
143+
minHeight = TooltipDefaults.MinHeight,
144+
)
145+
.padding(TooltipDefaults.ContentPadding),
146146
) {
147147
content()
148148
}
@@ -271,10 +271,10 @@ fun rememberTooltipPositionProvider(
271271
internal fun Modifier.animateTooltip(transition: Transition<Boolean>): Modifier =
272272
composed(
273273
inspectorInfo =
274-
debugInspectorInfo {
275-
name = "animateTooltip"
276-
properties["transition"] = transition
277-
},
274+
debugInspectorInfo {
275+
name = "animateTooltip"
276+
properties["transition"] = transition
277+
},
278278
) {
279279
val inOutScaleAnimationSpec = tween<Float>(durationMillis = 100, easing = FastOutLinearInEasing)
280280
val inOutAlphaAnimationSpec = tween<Float>(durationMillis = 50, easing = FastOutSlowInEasing)
@@ -383,9 +383,9 @@ fun PlainTooltipWithCaret() {
383383
) {
384384
Box(
385385
modifier =
386-
Modifier
387-
.size(40.dp)
388-
.background(Color.Blue),
386+
Modifier
387+
.size(40.dp)
388+
.background(Color.Blue),
389389
)
390390
}
391391
}

lumo-ui/plugin/src/main/resources/templates/android/components/card/Card.kt.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ object CardDefaults {
276276
}
277277
}
278278

279+
@ConsistentCopyVisibility
279280
@Immutable
280281
data class CardColors internal constructor(
281282
private val containerColor: Color,

lumo-ui/plugin/src/main/resources/templates/multiplatform/components/NavigationBar.kt.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ object NavigationBarItemDefaults {
273273
fun textStyle(): TextStyle = {{themeName}}.typography.label2
274274
}
275275

276+
@ConsistentCopyVisibility
276277
@Stable
277278
data class NavigationBarItemColors internal constructor(
278279
private val selectedIconColor: Color,

0 commit comments

Comments
 (0)