@cerberus-design/react
Version:
The Cerberus Design React component library.
77 lines (76 loc) • 4.17 kB
TypeScript
import { Field, FieldHelperTextProps as ArkFieldHelperTextProps, FieldInputProps as ArkFieldInputProps, FieldLabelProps as ArkFieldLabelProps, FieldRootProps as ArkFieldRootProps, FieldTextareaProps as ArkFieldTextareaProps, FieldRequiredIndicatorProps as ArkFieldRequiredIndicatorProps } from '@ark-ui/react/field';
import { HTMLArkProps, PolymorphicProps } from '@ark-ui/react';
import { FieldVariantProps } from 'styled-system/recipes';
import { CerberusPrimitiveProps } from '../../system/index';
import { CerberusFieldInput } from './input';
import { ForwardRefExoticComponent, RefAttributes, ReactNode, ClassAttributes, HTMLAttributes } from 'react';
import { BaseCerberusProps } from '../..';
export type FieldRootProps = CerberusPrimitiveProps<ArkFieldRootProps & FieldVariantProps>;
export declare const FieldRoot: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Field.RootProps & RefAttributes<HTMLDivElement>>, "ref"> & RefAttributes<unknown>>;
export type FieldLabelProps = CerberusPrimitiveProps<ArkFieldLabelProps> & {
/**
* Whether to hide the label visually while keeping it accessible to screen readers.
*/
hideLabel?: boolean;
};
export declare const FieldLabel: ForwardRefExoticComponent< BaseCerberusProps & Field.LabelProps & {
children?: ReactNode | undefined;
} & {
/**
* Whether to hide the label visually while keeping it accessible to screen readers.
*/
hideLabel?: boolean;
} & RefAttributes<unknown>>;
export type FieldRequiredIndicatorProps = CerberusPrimitiveProps<ArkFieldRequiredIndicatorProps>;
export declare const FieldRequiredIndicator: {
(props: CerberusPrimitiveProps< BaseCerberusProps & Field.RequiredIndicatorProps & {
children?: ReactNode | undefined;
}>): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export type FieldInputRootProps = CerberusPrimitiveProps<HTMLArkProps<'div'> & FieldVariantProps>;
export declare const FieldInputRoot: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & PolymorphicProps>, "ref"> & RefAttributes<unknown>>;
export type FieldInputProps = CerberusPrimitiveProps<ArkFieldInputProps & FieldVariantProps>;
export declare const FieldInput: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Field.InputProps & RefAttributes<HTMLInputElement>>, "ref"> & RefAttributes<unknown>>;
export type FieldHelperTextProps = CerberusPrimitiveProps<ArkFieldHelperTextProps>;
export declare const FieldHelperText: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Field.HelperTextProps & RefAttributes<HTMLSpanElement>>, "ref"> & RefAttributes<unknown>>;
export type FieldErrorTextProps = CerberusPrimitiveProps<ArkFieldHelperTextProps>;
export declare const FieldErrorText: ForwardRefExoticComponent< BaseCerberusProps & Field.HelperTextProps & {
children?: ReactNode | undefined;
} & RefAttributes<unknown>>;
export type FieldTextareaProps = CerberusPrimitiveProps<ArkFieldTextareaProps>;
export declare const FieldTextarea: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Field.TextareaProps & RefAttributes<HTMLTextAreaElement>>, "ref"> & RefAttributes<unknown>>;
/**
* A named export for the FieldInput component.
* @description [Field Docs](https://cerberus.digitalu.design/react/field)
* @example
* ```tsx
* import { Input } from '@cerberus/react'
*
* <Field
* label="Enter your email"
* helperText="We'll never share your email with anyone else."
* errorText="Email is required."
* required
* >
* <Input type="email" />
* </Field>
* ```
*/
export declare const Input: typeof CerberusFieldInput;
/**
* A named export for the FieldTextarea component.
* @description [Field Docs](https://cerberus.digitalu.design/react/field)
* @example
* ```tsx
* import { Textarea } from '@cerberus/react'
*
* <Field
* label="Comments"
* helperText="Your comments are valuable to us."
* >
* <Textarea />
* </Field>
* ```
*/
export declare const Textarea: ForwardRefExoticComponent<Omit<CerberusPrimitiveProps<Field.TextareaProps & RefAttributes<HTMLTextAreaElement>>, "ref"> & RefAttributes<unknown>>;