@opengov/form-renderer 0.0.1-beta1

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,19 @@
1
+ import { default as React } from 'react';
2
+ import { LayoutState } from './LayoutContext';
3
+ import { SxProps } from '@mui/material';
4
+ interface FormShellProps {
5
+ children: React.ReactNode;
6
+ onSubmit: (data: any) => void;
7
+ layout?: LayoutState;
8
+ sx?: SxProps;
9
+ }
10
+ export declare function FormShell({ children, onSubmit, layout, sx }: FormShellProps): import("react/jsx-runtime").JSX.Element;
11
+ interface FormProviderProps {
12
+ children: React.ReactNode;
13
+ onSubmit?: (data: any) => void;
14
+ layout?: LayoutState;
15
+ formOptions?: any;
16
+ sx?: SxProps;
17
+ }
18
+ declare function FormProvider({ children, onSubmit, layout, formOptions, sx }: FormProviderProps): import("react/jsx-runtime").JSX.Element;
19
+ export default FormProvider;
@@ -0,0 +1,14 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ export interface LayoutState {
3
+ }
4
+ interface FormLayoutContextProps {
5
+ layout: LayoutState;
6
+ }
7
+ declare const FormLayoutContext: React.Context<FormLayoutContextProps | undefined>;
8
+ interface FormLayoutProviderProps {
9
+ children: ReactNode;
10
+ layout?: LayoutState;
11
+ }
12
+ export declare const FormLayoutProvider: React.FC<FormLayoutProviderProps>;
13
+ export declare const useFormLayout: () => LayoutState;
14
+ export default FormLayoutContext;
@@ -0,0 +1,3 @@
1
+ import { GeneralInputProps } from './types';
2
+ declare function CheckboxInput({ name, label, sx, disabled, rules, ...rest }: GeneralInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export default CheckboxInput;
@@ -0,0 +1,3 @@
1
+ import { GeneralInputProps } from './types';
2
+ declare function DateInput({ name, rules, sx, ...rest }: GeneralInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export default DateInput;
@@ -0,0 +1,8 @@
1
+ interface FormFieldLabelProps {
2
+ children: React.ReactNode;
3
+ internal: boolean;
4
+ required: boolean;
5
+ helpText?: string;
6
+ }
7
+ export default function FormFieldLabel({ children, internal, required, helpText }: FormFieldLabelProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import { TextFieldProps } from '@mui/material';
2
+ import { GeneralInputProps } from './types';
3
+ export default function NumberInput(props: Omit<GeneralInputProps & TextFieldProps, 'type'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { GeneralInputProps } from './types';
2
+ export default function SelectInput({ name, label, options, sx, disabled, rules, ...rest }: GeneralInputProps & {
3
+ options: Array<{
4
+ value: string;
5
+ label: string;
6
+ }>;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { TextFieldProps } from '@mui/material';
2
+ import { GeneralInputProps } from './types';
3
+ declare function TextInput({ name, label, rules, sx, ...rest }: GeneralInputProps & TextFieldProps): import("react/jsx-runtime").JSX.Element;
4
+ export default TextInput;
@@ -0,0 +1,8 @@
1
+ import { SxProps } from '@mui/material';
2
+ export interface GeneralInputProps {
3
+ name: string;
4
+ label: string | JSX.Element;
5
+ sx?: SxProps;
6
+ disabled?: boolean;
7
+ rules: any;
8
+ }
@@ -0,0 +1,9 @@
1
+ import { default as Checkbox } from './fields/Checkbox';
2
+ import { default as DateInput } from './fields/DateInput';
3
+ import { default as TextInput } from './fields/TextInput';
4
+ import { default as NumberInput } from './fields/NumberInput';
5
+ import { default as Select } from './fields/Select';
6
+ import { default as FormFieldLabel } from './fields/FormFieldLabel';
7
+ import { default as FormProvider } from './FormProvider';
8
+ export { FormProvider, FormFieldLabel, Checkbox, DateInput, TextInput, NumberInput, Select };
9
+ export default function FormRenderer(): import("react/jsx-runtime").JSX.Element;
File without changes