finform-react-builder 1.7.1 → 1.8.0

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 @@
1
+ export declare const Reorder: () => import("react/jsx-runtime").JSX.Element;
@@ -5,4 +5,5 @@ export { ImageComponent } from './ImageComponent';
5
5
  export { CustomButtons } from './CustomButtons';
6
6
  export { generateSchema } from './generateSchema';
7
7
  export { fetchApiData, hasApiConfig, getApiConfig, shouldShowField, useApiData } from './apiUtils';
8
+ export * from './inputs';
8
9
  export type { FieldConfig, ValidationRule, FormButton, ButtonGroup, FormTitle, FormTheme, FinFormProps, ApiConfig, } from './types';
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+ export interface FinAutocompleteOption {
3
+ label: string;
4
+ value: string | number;
5
+ [k: string]: any;
6
+ }
7
+ export interface FinAutocompleteProps {
8
+ id?: string;
9
+ options: FinAutocompleteOption[];
10
+ value: any;
11
+ multiple?: boolean;
12
+ label?: string;
13
+ labelText?: string;
14
+ placeholder?: string;
15
+ onChange: (val: any) => void;
16
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
17
+ disabled?: boolean;
18
+ loading?: boolean;
19
+ error?: boolean;
20
+ helperText?: string;
21
+ onOpen?: () => void;
22
+ noOptionsText?: string;
23
+ }
24
+ export declare const FinAutocomplete: React.FC<FinAutocompleteProps>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface FinCheckboxProps {
3
+ label: string;
4
+ checked: boolean;
5
+ disabled?: boolean;
6
+ onChange: (checked: boolean) => void;
7
+ }
8
+ export declare const FinCheckbox: React.FC<FinCheckboxProps>;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { TextFieldProps } from '@mui/material';
3
+ export type FinDateFieldProps = TextFieldProps & {
4
+ label?: React.ReactNode;
5
+ labelPosition?: 'inner' | 'top' | 'none';
6
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
7
+ [key: string]: any;
8
+ };
9
+ export declare const FinDateField: React.FC<FinDateFieldProps>;
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ export interface FinDragDropListChip {
3
+ text: string;
4
+ bg?: string;
5
+ color?: string;
6
+ radius?: number | string;
7
+ height?: number;
8
+ px?: number;
9
+ }
10
+ export interface FinDragDropListProps<T> {
11
+ items: T[];
12
+ getId: (item: T) => string | number;
13
+ onReorder: (newItems: T[]) => void;
14
+ header?: React.ReactNode;
15
+ disabled?: boolean;
16
+ sx?: any;
17
+ chipText?: string | ((item: T, index: number) => string | undefined);
18
+ helperText?: React.ReactNode | string;
19
+ getText?: (item: T) => string;
20
+ getChip?: (item: T) => FinDragDropListChip | undefined;
21
+ showIndex?: boolean;
22
+ showLeftIcon?: boolean;
23
+ renderItem?: (item: T, isDragging: boolean) => React.ReactNode;
24
+ }
25
+ export declare function FinDragDropList<T>({ items, getId, onReorder, header, disabled, sx, getText, /* getChip */ showIndex, showLeftIcon, renderItem, chipText, helperText }: FinDragDropListProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export type FinGuidelineCardVariant = 'info' | 'infoWithHeader' | 'error' | 'emphasis';
3
+ export interface FinGuidelineCardProps {
4
+ variant: FinGuidelineCardVariant;
5
+ title?: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ icon?: React.ReactNode;
8
+ actions?: React.ReactNode;
9
+ sx?: any;
10
+ items?: string[];
11
+ }
12
+ export declare const FinGuidelineCard: React.FC<FinGuidelineCardProps>;
@@ -0,0 +1,32 @@
1
+ import { default as React } from 'react';
2
+ export interface FinRadioOption {
3
+ label: string;
4
+ value: string | number;
5
+ }
6
+ export interface FinRadioGroupProps {
7
+ /** Optional section heading above the group */
8
+ labelText?: string;
9
+ /** The inner label for the radio group itself (accessible) */
10
+ label?: string;
11
+ /** The currently selected value */
12
+ value: any;
13
+ /** The list of options */
14
+ options: FinRadioOption[];
15
+ /** Horizontal when true, vertical when false */
16
+ row?: boolean;
17
+ /** Handles change */
18
+ onChange: (val: any) => void;
19
+ /** Top heading or none */
20
+ labelPosition?: 'top' | 'none';
21
+ /** Typography variant for the heading */
22
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
23
+ /** Optional helper text under the group */
24
+ helperText?: string;
25
+ /** Optional error state */
26
+ error?: boolean;
27
+ /** Group padding multiplier */
28
+ groupPadding?: number;
29
+ /** Gap between radio options */
30
+ itemGap?: number;
31
+ }
32
+ export declare const FinRadioGroup: React.FC<FinRadioGroupProps>;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { SelectProps } from '@mui/material';
3
+ export interface FinSelectOption {
4
+ label: string;
5
+ value: string | number;
6
+ }
7
+ export interface FinSelectProps extends Omit<SelectProps, 'onChange'> {
8
+ labelText?: string;
9
+ options: FinSelectOption[];
10
+ loading?: boolean;
11
+ helperText?: string;
12
+ onChange?: SelectProps['onChange'];
13
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
14
+ placeholder?: string;
15
+ }
16
+ export declare const FinSelect: React.FC<FinSelectProps>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface FinSwitchProps {
3
+ label?: string;
4
+ checked: boolean;
5
+ disabled?: boolean;
6
+ onChange: (checked: boolean) => void;
7
+ }
8
+ export declare const FinSwitch: React.FC<FinSwitchProps>;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ import { TextFieldProps } from '@mui/material';
3
+ export type FinTextFieldProps = TextFieldProps & {
4
+ hasError?: boolean;
5
+ labelText?: string;
6
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
7
+ endAdornment?: React.ReactNode;
8
+ endorsementText?: string;
9
+ endorsementBg?: string;
10
+ endorsementColor?: string;
11
+ endorsementRadius?: number | string;
12
+ endorsementHeight?: number;
13
+ endorsementPaddingX?: number;
14
+ };
15
+ export declare const FinTextField: React.FC<FinTextFieldProps>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { TextFieldProps } from '@mui/material';
3
+ export type FinTextareaProps = TextFieldProps & {
4
+ labelText?: string;
5
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
6
+ hasError?: boolean;
7
+ };
8
+ export declare const FinTextarea: React.FC<FinTextareaProps>;
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ export interface FinUiHeaderProps {
3
+ title?: React.ReactNode;
4
+ subtitle?: React.ReactNode;
5
+ actions?: React.ReactNode;
6
+ align?: 'left' | 'center' | 'right';
7
+ sx?: any;
8
+ }
9
+ export declare const FinUiHeader: React.FC<FinUiHeaderProps>;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export interface FinVerticalStepperItem {
3
+ label: string;
4
+ description?: string;
5
+ }
6
+ export interface FinVerticalStepperProps {
7
+ items: FinVerticalStepperItem[];
8
+ activeIndex?: number;
9
+ onStepClick?: (index: number) => void;
10
+ sx?: any;
11
+ }
12
+ export declare const FinVerticalStepper: React.FC<FinVerticalStepperProps>;
@@ -0,0 +1,12 @@
1
+ export * from './FinTextField';
2
+ export * from './FinSelect';
3
+ export * from './FinAutocomplete';
4
+ export * from './FinCheckbox';
5
+ export * from './FinSwitch';
6
+ export * from './FinRadioGroup';
7
+ export * from './FinDateField';
8
+ export * from './FinTextarea';
9
+ export * from './FinUiHeader';
10
+ export * from './FinDragDropList';
11
+ export * from './FinGuidelineCard';
12
+ export * from './FinVerticalStepper';
@@ -31,6 +31,8 @@ export interface BaseField {
31
31
  label: string;
32
32
  type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'select' | 'checkbox' | 'toggle' | 'radio' | 'switch' | 'autocomplete' | 'date' | 'textarea' | 'image' | 'title' | 'section' | 'component';
33
33
  placeholder?: string;
34
+ labelPosition?: 'inner' | 'top' | 'none';
35
+ labelVariant?: 'caption' | 'body2' | 'subtitle2' | 'h6';
34
36
  required?: boolean;
35
37
  disabled?: boolean;
36
38
  copyWhenDisabled?: boolean;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './components/FinForm';
2
2
  export * from './components/DocumentUpload';
3
+ export * from './theme';