@tinacms/toolkit
Version:
Tina is a lightweight but powerful toolkit for creating a site editing ui with javascript components. Tina surfaces superpowers for dev’s to create, expand on and customize a simple yet intuitive ui for editing content.
42 lines (38 loc) • 2.06 kB
TypeScript
/**
*/
import * as React from 'react';
import { FieldProps } from './fieldProps';
import { Form } from '../../forms';
export declare type InputFieldType<ExtraFieldProps, InputProps> = FieldProps<InputProps> & ExtraFieldProps;
export declare function wrapFieldsWithMeta<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => JSX.Element;
export declare function wrapFieldWithError<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => JSX.Element;
interface FieldMetaProps extends React.HTMLAttributes<HTMLElement> {
name: string;
children: any;
label?: string | boolean;
description?: string;
error?: string;
margin?: boolean;
index?: number;
tinaForm: Form;
}
export declare const FieldMeta: ({ name, label, description, error, margin, children, index, tinaForm, ...props }: FieldMetaProps) => JSX.Element;
export declare const FieldWrapper: ({ margin, children, ...props }: {
margin: boolean;
children: React.ReactNode;
} & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>>>) => JSX.Element;
export interface FieldLabel extends React.HTMLAttributes<HTMLLabelElement> {
children?: any | any[];
className?: string;
name?: string;
}
export declare const FieldLabel: ({ children, className, name, ...props }: FieldLabel) => JSX.Element;
export declare const FieldDescription: ({ children, className, ...props }: {
children?: any | any[];
className?: string;
}) => JSX.Element;
export declare const FieldError: ({ children, className, ...props }: {
children?: any | any[];
className?: string;
}) => JSX.Element;
export {};