Skip to content

Commit bb5b8d6

Browse files
updated to 1.0.0-beta.5
1 parent a6df5af commit bb5b8d6

File tree

10 files changed

+140
-9
lines changed

10 files changed

+140
-9
lines changed

.idea/copilot.data.migration.agent.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copilot.data.migration.ask.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copilot.data.migration.edit.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/developerstring/jetco_library/StepperCompPreview.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fun StepperPreview() {
114114

115115
Column(
116116
modifier = Modifier
117-
.padding(top = 50.dp, bottom = 40.dp)
117+
.padding(top = 50.dp, bottom = 60.dp)
118118
.fillMaxSize()
119119
.padding(16.dp)
120120
) {

jetco/ui/src/main/java/com/developerstring/jetco/ui/cards/ticket/TickerCard.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import androidx.compose.ui.unit.dp
2828
* @param dividerEffect PathEffect for the dashed divider.
2929
* @param dividerStrokeWidth Width of the dashed divider line.
3030
* @param dividerColor Color of the dashed divider line.
31+
* @param notchWeight Vertical position of the notches as a fraction of card height (0f to 1f).
3132
* @param content Card body composable content. Use [TicketContent] to split the card into sections.
3233
*/
3334
@Composable

jetco/ui/src/main/java/com/developerstring/jetco/ui/components/stepper/CompactHorizontalStepper.kt

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,43 @@ import com.developerstring.jetco.ui.components.stepper.model.StepperActionIcons
3030
import com.developerstring.jetco.ui.components.stepper.model.StepperConfig
3131
import com.developerstring.jetco.ui.components.stepper.model.StepperNode
3232

33-
// Compact Horizontal Stepper (for mobile screens)
33+
/**
34+
* A compact horizontal stepper component for Jetpack Compose.
35+
*
36+
* The [CompactHorizontalStepper] arranges steps horizontally in a more space-efficient layout
37+
* compared to [HorizontalStepper]. It is designed for cases where screen width is limited,
38+
* or when you want a cleaner, minimal representation of step progress.
39+
*
40+
* ### Features
41+
* - Displays step nodes with optional icons based on [StepperActionIcons].
42+
* - Provides a **compact layout** with smaller labels and reduced spacing.
43+
* - Supports **custom styling** with [StepperConfig] (colors, spacing, shapes, typography).
44+
* - Allows **step interactions** through [onStepClick] callback.
45+
*
46+
* ### Example Usage
47+
* ```kotlin
48+
* val steps = listOf(
49+
* StepperNode("Login", status = StepperStatus.COMPLETE),
50+
* StepperNode("Details", status = StepperStatus.ACTIVE),
51+
* StepperNode("Summary", status = StepperStatus.IDLE),
52+
* StepperNode("Finish", status = StepperStatus.IDLE),
53+
* )
54+
*
55+
* CompactHorizontalStepper(
56+
* steps = steps,
57+
* currentStep = 2,
58+
* style = StepperConfig(),
59+
* onStepClick = { index -> println("Step $index clicked") }
60+
* )
61+
* ```
62+
*
63+
* @param steps List of [StepperNode] representing the steps in the compact horizontal flow.
64+
* @param currentStep The index of the current active step (0-based).
65+
* @param modifier Modifier to be applied to the stepper layout.
66+
* @param style Styling options for customizing the stepper’s appearance via [StepperConfig].
67+
* @param stepperActionIcons Icons for step states like active, completed, and error.
68+
* @param onStepClick Optional callback invoked with the index when a step is clicked.
69+
*/
3470
@Composable
3571
fun CompactHorizontalStepper(
3672
steps: List<StepperNode>,

jetco/ui/src/main/java/com/developerstring/jetco/ui/components/stepper/HorizontalStepper.kt

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,45 @@ import com.developerstring.jetco.ui.components.stepper.model.StepperConfig
3636
import com.developerstring.jetco.ui.components.stepper.model.StepperNode
3737
import com.developerstring.jetco.ui.components.stepper.model.StepperStatus
3838

39-
// Horizontal Stepper Component
39+
/**
40+
* A customizable horizontal stepper component built with Jetpack Compose.
41+
*
42+
* The [HorizontalStepper] arranges a list of steps horizontally, connected with lines between them.
43+
* Each step is represented by a node and an optional title/label below it.
44+
*
45+
* ### Features
46+
* - Supports **progress animations** for node connectors.
47+
* - Allows **custom icons** for Active, Completed, and Error states via [StepperActionIcons].
48+
* - **Customizable styling** via [StepperConfig] (colors, shape, spacing, typography, path effects, etc.).
49+
* - Steps are **interactive** with [onStepClick] callback support.
50+
* - Labels can be shown or hidden using [showLabels].
51+
* - Supports scrolling if the number of steps exceeds available width via [scrollEnable].
52+
*
53+
* ### Example Usage
54+
* ```kotlin
55+
* val steps = listOf(
56+
* StepperNode("Cart", status = StepperStatus.COMPLETE),
57+
* StepperNode("Delivery", status = StepperStatus.ACTIVE),
58+
* StepperNode("Payment", status = StepperStatus.IDLE),
59+
* StepperNode("Confirmation", status = StepperStatus.IDLE),
60+
* )
61+
*
62+
* HorizontalStepper(
63+
* steps = steps,
64+
* showLabels = true,
65+
* style = StepperConfig(),
66+
* onStepClick = { index -> println("Step $index clicked") }
67+
* )
68+
* ```
69+
*
70+
* @param steps List of [StepperNode] representing the steps in the horizontal flow.
71+
* @param modifier Modifier to be applied to the stepper layout.
72+
* @param style Customization options for the stepper look & feel via [StepperConfig].
73+
* @param stepperActionIcons Icons to display for different step states (active, completed, error).
74+
* @param showLabels Whether to display the step titles/labels below each node.
75+
* @param scrollEnable Whether the stepper should allow horizontal scrolling if content exceeds width.
76+
* @param onStepClick Callback invoked with the step index when a step is clicked. Can be `null` if not needed.
77+
*/
4078
@Composable
4179
fun HorizontalStepper(
4280
steps: List<StepperNode>,

jetco/ui/src/main/java/com/developerstring/jetco/ui/components/stepper/VerticalStepper.kt

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.developerstring.jetco.ui.components.stepper
22

33
import androidx.compose.animation.core.animateFloatAsState
4-
import androidx.compose.animation.core.tween
54
import androidx.compose.foundation.Canvas
65
import androidx.compose.foundation.Image
76
import androidx.compose.foundation.layout.Arrangement
@@ -42,7 +41,41 @@ import com.developerstring.jetco.ui.components.stepper.model.StepperConfig
4241
import com.developerstring.jetco.ui.components.stepper.model.StepperNode
4342
import com.developerstring.jetco.ui.components.stepper.model.StepperStatus
4443

45-
// Vertical Stepper Component
44+
/**
45+
* A customizable vertical stepper component built with Jetpack Compose.
46+
*
47+
* The [VerticalStepper] arranges a list of steps vertically, each step represented by a node and connector line between them.
48+
* Steps can show a title, description, and status (Idle, Active, Complete, or Error).
49+
*
50+
* ### Features
51+
* - Supports **animations** for node and connector line drawing.
52+
* - Allows **custom icons** for Active, Completed, and Error states via [StepperActionIcons].
53+
* - **Customizable styling** via [StepperConfig] (colors, shape, spacing, typography, path effects, etc.).
54+
* - Each step is clickable with [onStepClick] callback.
55+
* - Can be scrollable or fixed using [scrollEnable].
56+
*
57+
* ### Example Usage
58+
* ```kotlin
59+
* val steps = listOf(
60+
* StepperNode("Account Created", "Your account has been created", status = StepperStatus.COMPLETE),
61+
* StepperNode("Profile Setup", "Fill in your profile details", status = StepperStatus.ACTIVE),
62+
* StepperNode("Verification", "Pending verification", status = StepperStatus.IDLE),
63+
* )
64+
*
65+
* VerticalStepper(
66+
* steps = steps,
67+
* style = StepperConfig(),
68+
* onStepClick = { index -> println("Step $index clicked") }
69+
* )
70+
* ```
71+
*
72+
* @param steps List of [StepperNode] representing the steps in the vertical flow.
73+
* @param modifier Modifier to be applied to the stepper layout.
74+
* @param style Customization options for the stepper look & feel via [StepperConfig].
75+
* @param stepperActionIcons Icons to display for different step states (active, completed, error).
76+
* @param scrollEnable Whether the stepper should allow vertical scrolling if content exceeds bounds.
77+
* @param onStepClick Callback invoked with the step index when a step is clicked. Can be `null` if not needed.
78+
*/
4679
@Composable
4780
fun VerticalStepper(
4881
steps: List<StepperNode>,
@@ -59,7 +92,7 @@ fun VerticalStepper(
5992

6093
val animatedProgress by animateFloatAsState(
6194
targetValue = if (animationTriggered) 1f else 0f,
62-
animationSpec = tween(style.animation.durationMillis),
95+
animationSpec = style.animation.animationSpec,
6396
label = "node_animation"
6497
)
6598

@@ -118,6 +151,7 @@ private fun VerticalStepItem(
118151
.width(style.node.size)
119152
.fillMaxHeight()
120153
) {
154+
121155
// Node
122156
Card(
123157
modifier = Modifier

jetco/ui/src/main/java/com/developerstring/jetco/ui/components/stepper/model/StepperConfig.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.developerstring.jetco.ui.components.stepper.model
22

3+
import androidx.compose.animation.core.AnimationSpec
4+
import androidx.compose.animation.core.tween
35
import androidx.compose.foundation.layout.PaddingValues
46
import androidx.compose.foundation.shape.CircleShape
57
import androidx.compose.ui.graphics.Color
@@ -102,10 +104,12 @@ data class StepperConfig(
102104
*
103105
* @property enabled Whether animations are enabled.
104106
* @property durationMillis Duration of node/connector animations in milliseconds.
107+
* @property animationSpec The animation specification to use (default: tween with [durationMillis]).
105108
*/
106109
data class AnimationConfig(
107110
val enabled: Boolean = true,
108-
val durationMillis: Int = 1200
111+
val durationMillis: Int = 1200,
112+
val animationSpec: AnimationSpec<Float> = tween(durationMillis)
109113
)
110114

111115
/**

versions.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ ext {
2525

2626
library = [
2727
groupId : "com.developerstring.jetco",
28-
version_name : "1.0.0-beta.4",
29-
version_code : 4,
28+
version_name : "1.0.0-beta.5",
29+
version_code : 5,
3030
target_sdk : 36,
3131
min_sdk : 21,
3232
compose_min_sdk: 21,

0 commit comments

Comments
 (0)