UNPKG

goobs-frontend

Version:

A comprehensive React-based libary for building modern web applications

119 lines 4.02 kB
import { default as React } from 'react'; export interface FormFieldTheme { background: string; border: { default: string; focused: string; error: string; }; text: string; label: { default: string; focused: string; error: string; shrunkBackground: string; }; adornment: { default: string; focused: string; }; footerText: { default: string; error: string; info: string; }; fontFamily: string; } export interface FormFieldStyles { theme?: 'light' | 'dark' | 'sacred'; backgroundColor?: string; borderColor?: string; borderFocusedColor?: string; borderErrorColor?: string; textColor?: string; labelColor?: string; labelFocusedColor?: string; labelErrorColor?: string; labelShrunkBackgroundColor?: string; adornmentColor?: string; adornmentFocusedColor?: string; footerTextColor?: string; footerTextErrorColor?: string; footerTextInfoColor?: string; fontFamily?: string; requiredIndicatorColor?: string; requiredIndicatorText?: string; disabled?: boolean; required?: boolean; helperTextType?: 'error' | 'info'; padding?: string; paddingLeft?: string; paddingRight?: string; paddingTop?: string; paddingBottom?: string; margin?: string; marginTop?: string; marginBottom?: string; marginLeft?: string; marginRight?: string; borderRadius?: string; borderWidth?: string; fontSize?: string; fontWeight?: string | number; lineHeight?: string; width?: string; height?: string; minWidth?: string; maxWidth?: string; minHeight?: string; maxHeight?: string; startAdornmentOffset?: string; endAdornmentOffset?: string; arrowTop?: string; arrowRight?: string; arrowBottom?: string; arrowLeft?: string; arrowPadding?: string; labelOffset?: string; labelShrunkOffset?: string; footerMarginTop?: string; footerFontSize?: string; transitionDuration?: string; transitionEasing?: string; } export declare const formFieldThemes: Record<'light' | 'dark' | 'sacred', FormFieldTheme>; export declare const getFormFieldTheme: (styles?: FormFieldStyles) => FormFieldTheme; export declare const getSharedFormFieldStyles: (styles?: FormFieldStyles, isFocused?: boolean) => { themeConfig: FormFieldTheme; borderColor: string; labelColor: string; adornmentColor: string; footerTextColor: string; transition: string; isError: boolean; helperTextType: "error" | "info"; }; export declare const getSharedLabelStyles: (labelColor: string, themeConfig: FormFieldTheme) => React.CSSProperties; export declare const getSharedContainerStyles: (styles?: FormFieldStyles) => React.CSSProperties; export declare const getSharedFooterTextStyles: (footerTextColor: string, themeConfig: FormFieldTheme, styles?: FormFieldStyles) => React.CSSProperties; export declare const getSharedAdornmentStyles: (adornmentColor: string) => React.CSSProperties; export interface SharedFormFieldProps { /** The label for the input. Can be a string or a React node. */ label?: React.ReactNode; /** Error message to display. */ error?: string; /** Whether the field is required. */ required?: boolean; /** Whether the field is disabled. */ disabled?: boolean; /** Comprehensive styling options including theme, custom colors, and layout properties. */ styles?: FormFieldStyles; } export declare const getRequiredLabelText: (label: string, required?: boolean, styles?: FormFieldStyles) => string; export declare const getRequiredIndicatorStyle: (styles?: FormFieldStyles) => React.CSSProperties; export declare const getRequiredProps: (required?: boolean) => { required: boolean; 'aria-required': boolean; }; export declare const validateRequired: (value: string, required?: boolean) => string | undefined; //# sourceMappingURL=formField.d.ts.map