@accelint/design-toolkit
Version:
An open-source component library to serve as part of the entire ecosystem of UX for Accelint.
55 lines (52 loc) • 1.59 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { DateValue } from '@internationalized/date';
import { DateFieldProps } from './types.js';
import 'react-aria-components';
import 'tailwind-variants';
import './styles.js';
/**
* DateField - A comprehensive date input component with segmented editing
*
* Provides accessible date input functionality with separate segments for day,
* month, and year. Includes calendar icon, validation states, and international
* date format support with keyboard navigation between segments.
*
* @example
* // Basic date field
* <DateField label="Birth Date" />
*
* @example
* // Date field with validation
* <DateField
* label="Event Date"
* isRequired
* isInvalid={hasError}
* errorMessage="Please select a valid date"
* />
*
* @example
* // Date field with custom formatting
* <DateField
* label="Meeting Date"
* shortMonth={false}
* placeholder="Select meeting date"
* />
*
* @example
* // Compact date field
* <DateField
* label="Due Date"
* size="small"
* description="When is this task due?"
* />
*
* @example
* // Controlled date field
* <DateField
* label="Selected Date"
* value={selectedDate}
* onChange={setSelectedDate}
* />
*/
declare function DateField<T extends DateValue>({ classNames, description: descriptionProp, errorMessage: errorMessageProp, inputProps, label: labelProp, size, shortMonth, shouldForceLeadingZeros, isDisabled, isInvalid: isInvalidProp, isRequired, ...rest }: DateFieldProps<T>): react_jsx_runtime.JSX.Element;
export { DateField };