finform-react-builder 1.2.2 → 1.3.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.
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { FormButton } from './types';
3
+ interface CustomButtonsProps {
4
+ buttons: FormButton[];
5
+ disabled?: boolean;
6
+ }
7
+ export declare const CustomButtons: React.FC<CustomButtonsProps>;
8
+ export {};
@@ -2,5 +2,6 @@ export { FinForm } from './FinForm';
2
2
  export { FieldRenderer } from './FieldRenderer';
3
3
  export { StepNavigation } from './StepNavigation';
4
4
  export { ImageComponent } from './ImageComponent';
5
+ export { CustomButtons } from './CustomButtons';
5
6
  export { generateSchema } from './generateSchema';
6
- export type { FieldConfig, BaseField, TextField, NumberField, SelectField, CheckboxField, DateField, ImageField, FinFormProps, FieldRendererProps, ValidationRule, StepNavigationProps, } from './types';
7
+ export type { FieldConfig, BaseField, TextField, NumberField, SelectField, CheckboxField, DateField, ImageField, FinFormProps, FieldRendererProps, ValidationRule, StepNavigationProps, FormButton, FormTitle, FormTheme, } from './types';
@@ -9,9 +9,11 @@ export interface ValidationRule {
9
9
  custom?: (value: any) => boolean | string;
10
10
  }
11
11
  export interface BaseField {
12
+ id?: string;
13
+ title?: string;
12
14
  name: string;
13
15
  label: string;
14
- type: 'text' | 'email' | 'password' | 'number' | 'select' | 'checkbox' | 'date' | 'textarea' | 'image';
16
+ type: 'text' | 'email' | 'password' | 'number' | 'select' | 'checkbox' | 'date' | 'textarea' | 'image' | 'title' | 'section';
15
17
  placeholder?: string;
16
18
  required?: boolean;
17
19
  disabled?: boolean;
@@ -59,15 +61,64 @@ export interface ImageField extends BaseField {
59
61
  style?: React.CSSProperties;
60
62
  className?: string;
61
63
  onClick?: () => void;
64
+ defaultValue?: string;
65
+ }
66
+ export interface TitleField extends BaseField {
67
+ type: 'title';
68
+ variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
69
+ color?: string;
70
+ align?: 'left' | 'center' | 'right';
71
+ sx?: any;
72
+ }
73
+ export interface SectionField extends BaseField {
74
+ type: 'section';
75
+ variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
76
+ color?: string;
77
+ align?: 'left' | 'center' | 'right';
78
+ sx?: any;
79
+ }
80
+ export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | DateField | ImageField | TitleField | SectionField;
81
+ export interface FormButton {
82
+ text: string;
83
+ color?: string;
84
+ size?: 'small' | 'medium' | 'large';
85
+ onClick?: () => void;
86
+ disabled?: boolean;
87
+ loading?: boolean;
88
+ position?: string;
89
+ sx?: any;
90
+ }
91
+ export interface FormTitle {
92
+ text: string;
93
+ variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
94
+ color?: string;
95
+ align?: 'left' | 'center' | 'right';
96
+ sx?: any;
97
+ }
98
+ export interface FormTheme {
99
+ primaryColor?: string;
100
+ secondaryColor?: string;
101
+ backgroundColor?: string;
102
+ textColor?: string;
103
+ borderRadius?: number | string;
104
+ spacing?: number;
105
+ typography?: {
106
+ fontFamily?: string;
107
+ fontSize?: number | string;
108
+ };
62
109
  }
63
- export type FieldConfig = TextField | NumberField | SelectField | CheckboxField | DateField | ImageField;
64
110
  export interface FinFormProps {
111
+ id?: string;
112
+ title?: FormTitle;
113
+ theme?: FormTheme;
65
114
  fields: FieldConfig[];
66
115
  onSubmit: (data: any) => void;
67
116
  onChange?: (data: any) => void;
68
117
  submitButtonText?: string;
69
118
  onSubmitClick?: (data: any) => void;
70
119
  defaultValues?: Record<string, any>;
120
+ showSubmitButton?: boolean;
121
+ buttons?: FormButton[];
71
122
  isMultiStep?: boolean;
72
123
  currentStep?: number;
73
124
  onStepChange?: (currentStep: number, totalSteps: number) => void;