@aws-northstar/ui
Version:
NorthStar Design System v2
65 lines (64 loc) • 2.23 kB
TypeScript
import { Schema as FormRendererSchema, Field as FormRendererField } from '@data-driven-forms/react-form-renderer/common-types';
import { FormTemplateRenderProps } from '@data-driven-forms/react-form-renderer/common-types/form-template-render-props';
import { HeaderProps } from '@cloudscape-design/components/header';
import { FormFieldProps as CloudscapeFormFieldProps } from '@cloudscape-design/components/form-field';
import { FormProps } from '@cloudscape-design/components/form';
export declare const componentTypes: {
ALERT: string;
CODE_EDITOR: string;
COLUMN_LAYOUT: string;
CUSTOM: string;
CUSTOM_LAYOUT: string;
DATA_RANGE_PICKER: string;
DATE_INPUT: string;
EXPANDABLE_SECTION: string;
FIELD_GROUP: string;
MARKDOWN_EDITOR: string;
REVIEW: string;
TIME_INPUT: string;
TEXT_FIELD: "text-field";
FIELD_ARRAY: "field-array";
CHECKBOX: "checkbox";
SUB_FORM: "sub-form";
RADIO: "radio";
TABS: "tabs";
TAB_ITEM: "tab-item";
DATE_PICKER: "date-picker";
TIME_PICKER: "time-picker";
WIZARD: "wizard";
SWITCH: "switch";
TEXTAREA: "textarea";
SELECT: "select";
PLAIN_TEXT: "plain-text";
BUTTON: "button";
INPUT_ADDON_GROUP: "input-addon-group";
INPUT_ADDON_BUTTON_GROUP: "input-addon-button-group";
DUAL_LIST_SELECT: "dual-list-select";
SLIDER: "slider";
};
export interface FormFieldProps extends Pick<CloudscapeFormFieldProps, 'label' | 'description' | 'i18nStrings' | 'stretch' | 'secondaryControl'> {
helperText?: CloudscapeFormFieldProps['constraintText'];
}
export interface Field extends FormRendererField, FormFieldProps {
}
export type Schema = Omit<FormRendererSchema, 'title'> & {
header?: FormRendererSchema['title'];
headerVariant?: HeaderProps['variant'];
variant?: FormProps['variant'];
info?: HeaderProps['info'];
cancelLabel?: string;
canCancel?: boolean;
resetLabel?: string;
canReset?: boolean;
submitLabel?: string;
fields: Field[];
};
export type RenderProps = Omit<FormTemplateRenderProps, 'schema'> & {
schema: Schema;
};
export interface Option {
label: string;
value: string;
description: string;
disabled?: boolean;
}