@momo-kits/step 0.77.4 → 0.77.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/StepsHorizontal.tsx +1 -1
- package/StepsVertical.tsx +1 -0
- package/package.json +1 -1
- package/styles.ts +1 -1
- package/types.ts +73 -0
package/StepsHorizontal.tsx
CHANGED
|
@@ -12,7 +12,7 @@ const StepsHorizontal: FC<StepsProps> = ({steps, size, activeIndex}) => {
|
|
|
12
12
|
let typoStyle = getStepTypo(activeIndex, ii, error, size);
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<View style={{flex: 1, alignItems: 'center'}}>
|
|
15
|
+
<View key={`Step ${ii}`} style={{flex: 1, alignItems: 'center'}}>
|
|
16
16
|
{!!time && (
|
|
17
17
|
<Text
|
|
18
18
|
style={styles.textCenter}
|
package/StepsVertical.tsx
CHANGED
package/package.json
CHANGED
package/styles.ts
CHANGED
package/types.ts
CHANGED
|
@@ -1,23 +1,96 @@
|
|
|
1
1
|
import {ViewStyle} from 'react-native';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Properties for the Steps component, a guided progress through a sequence of procedural steps.
|
|
5
|
+
*/
|
|
3
6
|
export type StepsProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Optional. If `true`, the steps are laid out in a horizontal manner.
|
|
9
|
+
* If `false`, the steps are laid out vertically.
|
|
10
|
+
* Defaults to `false` (vertical) if not provided.
|
|
11
|
+
*/
|
|
4
12
|
horizontal?: boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An array of `Step` items representing each individual step in the sequence.
|
|
16
|
+
* Each `Step` has its own set of properties such as title, description, etc.
|
|
17
|
+
*/
|
|
5
18
|
steps: Step[];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional. Specifies the size of the steps. Affects all step items within the component.
|
|
22
|
+
* If not provided, a default size is used.
|
|
23
|
+
*/
|
|
6
24
|
size?: 'small' | 'large';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The index of the currently active step within the steps sequence,
|
|
28
|
+
* starting from 0 for the first step.
|
|
29
|
+
*/
|
|
7
30
|
activeIndex: number;
|
|
8
31
|
};
|
|
9
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Represents a single step within the Steps component. Each step has a
|
|
35
|
+
* title and can have optional properties such as a description or error state.
|
|
36
|
+
*/
|
|
10
37
|
export type Step = {
|
|
38
|
+
/**
|
|
39
|
+
* The title of the step, briefly describing the purpose or task of this stage.
|
|
40
|
+
*/
|
|
11
41
|
title: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Optional. More detailed text about this particular step.
|
|
45
|
+
* It can provide users with guidance on what to expect or what's required.
|
|
46
|
+
*/
|
|
12
47
|
description?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Optional. If `true`, the step is marked as having an error, typically displayed
|
|
51
|
+
* with an error icon and error styles. Defaults to `false` if not provided.
|
|
52
|
+
*/
|
|
13
53
|
error?: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optional. A string representing the time associated with this step.
|
|
57
|
+
* It could be the duration, a specific time, or date, depending on the context.
|
|
58
|
+
*/
|
|
14
59
|
time?: string;
|
|
15
60
|
};
|
|
16
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Properties for the StepIcon component, which displays an icon
|
|
64
|
+
* representing a step within the Steps component.
|
|
65
|
+
*/
|
|
17
66
|
export type StepIconProps = {
|
|
67
|
+
/**
|
|
68
|
+
* Optional. Specifies the size of the step icon. If not provided, a default size is used.
|
|
69
|
+
*/
|
|
18
70
|
size?: 'small' | 'large';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Optional. The background color of the step icon.
|
|
74
|
+
* If not provided, a default background color is used.
|
|
75
|
+
*/
|
|
19
76
|
backgroundColor?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Optional. The border color of the step icon.
|
|
80
|
+
* If not provided, a default border color is used.
|
|
81
|
+
*/
|
|
20
82
|
borderColor?: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Optional. If `true`, the step icon is marked as being in an error state,
|
|
86
|
+
* typically displayed with an error icon and error styles.
|
|
87
|
+
* Defaults to `false` if not provided.
|
|
88
|
+
*/
|
|
21
89
|
error?: boolean;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Optional. Custom styles to apply to the StepIcon component.
|
|
93
|
+
* Can be used to adjust the visual presentation or layout.
|
|
94
|
+
*/
|
|
22
95
|
style?: ViewStyle;
|
|
23
96
|
};
|