@momo-kits/stepper 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.ts +101 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/stepper",
3
- "version": "0.77.4",
3
+ "version": "0.77.5-beta.01",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},
package/types.ts CHANGED
@@ -1,34 +1,135 @@
1
1
  import {ViewStyle} from 'react-native';
2
2
 
3
+ /**
4
+ * Properties for the StepperButton component, which represents the individual
5
+ * increment and decrement buttons in a stepper control.
6
+ */
3
7
  export type StepperButtonProps = {
8
+ /**
9
+ * Optional. If `true`, the button is disabled and not interactive.
10
+ * Defaults to `false` if not provided.
11
+ */
4
12
  disabled?: boolean;
13
+
14
+ /**
15
+ * Determines the button's function in the stepper, either increment ('+') or decrement ('-').
16
+ */
5
17
  sign?: '+' | '-';
18
+
19
+ /**
20
+ * Optional. Specifies the size of the button. If not provided, a default size is used.
21
+ */
6
22
  size?: 'large' | 'small';
23
+
24
+ /**
25
+ * A callback function that is triggered when the button is pressed.
26
+ */
7
27
  onPress: () => void;
8
28
  };
9
29
 
30
+ /**
31
+ * Properties for the StepperValue component, which displays the current value
32
+ * within a stepper control and allows for direct input.
33
+ */
10
34
  export type StepperValueProps = {
35
+ /**
36
+ * The current numeric value displayed by the stepper.
37
+ */
11
38
  value: number;
39
+
40
+ /**
41
+ * Optional. If `true`, the value display is disabled and not interactive.
42
+ * Defaults to `false` if not provided.
43
+ */
12
44
  disabled?: boolean;
45
+
46
+ /**
47
+ * Optional. Specifies the size of the value display. If not provided, a default size is used.
48
+ */
13
49
  size?: 'large' | 'small';
50
+
51
+ /**
52
+ * Optional. If `true`, the value display is editable, and users can input values directly.
53
+ * Defaults to `false` if not provided.
54
+ */
14
55
  editable?: boolean;
56
+
57
+ /**
58
+ * Optional. A callback function that is triggered when the value changes, receiving the new value as a parameter.
59
+ */
15
60
  onValueChange?: (value: string) => void;
16
61
  };
17
62
 
63
+ /**
64
+ * General properties for the Stepper component, which combines the buttons and value display
65
+ * to provide a full feature numeric stepper control.
66
+ */
18
67
  export type StepperProps = {
68
+ /**
69
+ * The initial value when the stepper is first rendered.
70
+ */
19
71
  defaultValue: number;
72
+
73
+ /**
74
+ * Optional. The minimum allowable value for the stepper. If not provided, there is no minimum.
75
+ */
20
76
  min?: number;
77
+
78
+ /**
79
+ * Optional. The maximum allowable value for the stepper. If not provided, there is no maximum.
80
+ */
21
81
  max?: number;
82
+
83
+ /**
84
+ * Optional. Specifies whether the entire stepper control or specific parts are disabled.
85
+ * Can be a single boolean (to disable all) or an array of booleans (to control individual components).
86
+ */
22
87
  disabled?: boolean | boolean[];
88
+
89
+ /**
90
+ * Optional. The step increment used for each button press. Defaults to 1 if not provided.
91
+ */
23
92
  step?: number;
93
+
94
+ /**
95
+ * Optional. Specifies the size of the stepper components. If not provided, a default size is used.
96
+ */
24
97
  size?: 'large' | 'small';
98
+
99
+ /**
100
+ * Optional. If `true`, the value display is editable, and users can input values directly.
101
+ * Defaults to `false` if not provided.
102
+ */
25
103
  editable?: boolean;
104
+
105
+ /**
106
+ * Optional. A callback function that is triggered when the stepper's value changes, receiving the new value as a parameter.
107
+ */
26
108
  onValueChange?: (value: number) => void;
109
+
110
+ /**
111
+ * Optional. Custom styles to apply to the Stepper component. Can be used to adjust the visual presentation or layout.
112
+ */
27
113
  style?: ViewStyle | ViewStyle[];
28
114
  };
29
115
 
116
+ /**
117
+ * Specifies the disabled state for each part of the Stepper component, allowing
118
+ * individual parts to be disabled as needed.
119
+ */
30
120
  export type DisabledStatus = {
121
+ /**
122
+ * If `true`, the increment (plus) button is disabled.
123
+ */
31
124
  plus: boolean;
125
+
126
+ /**
127
+ * If `true`, the decrement (minus) button is disabled.
128
+ */
32
129
  minus: boolean;
130
+
131
+ /**
132
+ * If `true`, the value display (number) is disabled, preventing direct input.
133
+ */
33
134
  number: boolean;
34
135
  };