@towsila/expo-ui-library 1.5.6 → 1.5.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towsila/expo-ui-library",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -21,7 +21,24 @@ interface Props {
21
21
  function splitIntoSteps(fields: Field[]): Field[][] {
22
22
  const info = fields.filter((f) => f.type !== "password");
23
23
  const security = fields.filter((f) => f.type === "password");
24
- return [info, security].filter((s) => s.length > 0);
24
+
25
+ const steps: Field[][] = [];
26
+
27
+ // Split info fields if more than 3
28
+ if (info.length > 3) {
29
+ const mid = Math.ceil(info.length / 2);
30
+ steps.push(info.slice(0, mid));
31
+ steps.push(info.slice(mid));
32
+ } else if (info.length > 0) {
33
+ steps.push(info);
34
+ }
35
+
36
+ // Add security fields as separate step
37
+ if (security.length > 0) {
38
+ steps.push(security);
39
+ }
40
+
41
+ return steps;
25
42
  }
26
43
 
27
44
  export const DynamicForm: React.FC<Props> = ({