@hitesh0009/react-native-basic-form 1.2.7 → 1.2.8

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/dist/Form.js CHANGED
@@ -6,9 +6,9 @@ export const Form = ({ schema = [] }) => {
6
6
  const RenderField = (field, index) => {
7
7
  switch (field.type) {
8
8
  case "button":
9
- return (<Buttons key={index} label={field.label} style={field.style} textStyle={field.textStyle} gap={13} {...(field.buttonProps || {})}/>);
9
+ return (<Buttons key={index} label={field.label} style={field.style} textStyle={field.textStyle} spacing={field.spacing} {...(field.buttonProps || {})}/>);
10
10
  case "input":
11
- return (<InputText key={index} label={field.label} style={field.style} gap={13} {...(field.inputProps || {})}/>);
11
+ return (<InputText key={index} label={field.label} style={field.style} spacing={field.spacing} {...(field.inputProps || {})}/>);
12
12
  default:
13
13
  return null;
14
14
  }
@@ -16,7 +16,7 @@ export const Form = ({ schema = [] }) => {
16
16
  return (<>
17
17
  {schema.map((block, blockIndex) => (<View key={blockIndex} style={{
18
18
  flexDirection: block.layout || "column",
19
- gap: block.gap || 20,
19
+ gap: block.spacing || 20,
20
20
  }}>
21
21
  {block.children.map(RenderField)}
22
22
  </View>))}
@@ -1,8 +1,8 @@
1
1
  import { Text, TouchableOpacity, View } from "react-native";
2
2
  import React from "react";
3
3
  import FormText from "./Text";
4
- const Buttons = ({ label, buttonText, onPress, style, textStyle, gap, labelStyle, }) => {
5
- return (<View style={{ gap: gap !== null && gap !== void 0 ? gap : 13 }}>
4
+ const Buttons = ({ label, buttonText, onPress, style, textStyle, spacing, labelStyle, }) => {
5
+ return (<View style={{ gap: spacing !== null && spacing !== void 0 ? spacing : 13 }}>
6
6
  <FormText label={label || " "} style={labelStyle}/>
7
7
 
8
8
  <TouchableOpacity onPress={onPress} style={[
@@ -1,8 +1,8 @@
1
1
  import { StyleSheet, TextInput, View } from 'react-native';
2
2
  import React from 'react';
3
3
  import FormText from './Text';
4
- const InputText = ({ label, placeholder, value, onChangeText, style, gap, labelStyle, }) => {
5
- return (<View style={{ gap: gap || 13 }}>
4
+ const InputText = ({ label, placeholder, value, onChangeText, style, spacing, labelStyle, }) => {
5
+ return (<View style={{ gap: spacing || 13 }}>
6
6
  <FormText label={label || ' '} style={labelStyle}/>
7
7
  <TextInput placeholder={placeholder} value={value} onChangeText={onChangeText} style={[
8
8
  {
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ImageProps, ImageStyle, TextInputProps, TextStyle, TouchableOpacityProps, ViewStyle } from 'react-native';
2
2
  type BaseField = {
3
3
  label?: string;
4
- gap?: number;
4
+ spacing?: number;
5
5
  style?: ViewStyle;
6
6
  labelStyle?: TextStyle;
7
7
  };
@@ -20,7 +20,7 @@ export type FormButton = BaseField & {
20
20
  export type FormField = FormInput | FormButton;
21
21
  export type FormItem = {
22
22
  layout?: ViewStyle['flexDirection'];
23
- gap?: number;
23
+ spacing?: number;
24
24
  children: FormField[];
25
25
  };
26
26
  export type FormProps = {
@@ -32,13 +32,13 @@ export type ButtonProps = {
32
32
  onPress?: TouchableOpacityProps['onPress'];
33
33
  style?: ViewStyle;
34
34
  textStyle?: TextStyle;
35
- gap?: number;
35
+ spacing?: number;
36
36
  labelStyle?: TextStyle;
37
37
  };
38
38
  export type InputProps = {
39
39
  label?: string;
40
40
  style?: TextInputProps['style'];
41
- gap?: number;
41
+ spacing?: number;
42
42
  labelStyle?: TextStyle;
43
43
  placeholder?: TextInputProps['placeholder'];
44
44
  value?: TextInputProps['value'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitesh0009/react-native-basic-form",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "A lightweight, data-driven form renderer for React Native with fully controlled inputs and flexible styling.",
5
5
  "keywords": [
6
6
  "react-native",
package/src/Form.tsx CHANGED
@@ -14,7 +14,7 @@ export const Form:React.FC<FormProps> = ({ schema = [] }) => {
14
14
  label={field.label}
15
15
  style={field.style}
16
16
  textStyle={field.textStyle}
17
- gap={13}
17
+ spacing={field.spacing}
18
18
  {...(field.buttonProps || {})}
19
19
  />
20
20
  );
@@ -25,7 +25,7 @@ export const Form:React.FC<FormProps> = ({ schema = [] }) => {
25
25
  key={index}
26
26
  label={field.label}
27
27
  style={field.style}
28
- gap={13}
28
+ spacing={field.spacing}
29
29
  {...(field.inputProps || {})}
30
30
  />
31
31
  );
@@ -42,7 +42,7 @@ export const Form:React.FC<FormProps> = ({ schema = [] }) => {
42
42
  key={blockIndex}
43
43
  style={{
44
44
  flexDirection: block.layout || "column",
45
- gap: block.gap || 20,
45
+ gap: block.spacing || 20,
46
46
  }}
47
47
  >
48
48
  {block.children.map(RenderField)}
@@ -9,11 +9,11 @@ const Buttons: React.FC<ButtonProps> = ({
9
9
  onPress,
10
10
  style,
11
11
  textStyle,
12
- gap,
12
+ spacing,
13
13
  labelStyle,
14
14
  }) => {
15
15
  return (
16
- <View style={{ gap: gap ?? 13 }}>
16
+ <View style={{ gap: spacing ?? 13 }}>
17
17
  <FormText label={label || " "} style={labelStyle} />
18
18
 
19
19
  <TouchableOpacity
@@ -9,11 +9,11 @@ const InputText:React.FC<InputProps> = ({
9
9
  value,
10
10
  onChangeText,
11
11
  style,
12
- gap,
12
+ spacing,
13
13
  labelStyle,
14
14
  }) => {
15
15
  return (
16
- <View style={{ gap: gap || 13 }}>
16
+ <View style={{ gap: spacing || 13 }}>
17
17
  <FormText label={label || ' '} style={labelStyle} />
18
18
  <TextInput
19
19
  placeholder={placeholder}
package/src/types.ts CHANGED
@@ -10,7 +10,7 @@ import type {
10
10
 
11
11
  type BaseField = {
12
12
  label?: string;
13
- gap?: number;
13
+ spacing?: number;
14
14
  style?: ViewStyle;
15
15
  labelStyle?: TextStyle;
16
16
  };
@@ -33,7 +33,7 @@ export type FormField = FormInput | FormButton;
33
33
 
34
34
  export type FormItem = {
35
35
  layout?: ViewStyle['flexDirection'];
36
- gap?: number;
36
+ spacing?: number;
37
37
  children: FormField[];
38
38
  };
39
39
 
@@ -48,7 +48,7 @@ export type ButtonProps = {
48
48
  onPress?: TouchableOpacityProps['onPress'];
49
49
  style?: ViewStyle;
50
50
  textStyle?: TextStyle;
51
- gap?: number;
51
+ spacing?: number;
52
52
  labelStyle?: TextStyle;
53
53
  };
54
54
 
@@ -56,7 +56,7 @@ export type ButtonProps = {
56
56
  export type InputProps = {
57
57
  label?: string;
58
58
  style?: TextInputProps['style'];
59
- gap?: number;
59
+ spacing?: number;
60
60
  labelStyle?: TextStyle;
61
61
  placeholder?:TextInputProps['placeholder'],
62
62
  value?:TextInputProps['value'],