import { DatePreset } from "../Calendar/presets.mjs"; import { FieldBaseProps } from "../FieldBase/FieldBase.mjs"; import { WidthProp } from "@marigold/system"; import { Ref } from "react"; import RAC from "react-aria-components"; import { DateValue } from "react-aria-components/DatePicker"; type RemovedProps = 'isDisabled' | 'isDateUnavailable' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'style' | 'className' | 'isOpen'; export interface DatePickerProps extends Omit, RemovedProps>, Pick, 'label' | 'addon' | 'description' | 'errorMessage'> { /** * Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. */ dateUnavailable?: RAC.DatePickerProps['isDateUnavailable']; /** * If `true`, the date picker is disabled. * @default false */ disabled?: RAC.DatePickerProps['isDisabled']; /** * If `true`, the date picker is required. * @default false */ required?: RAC.DatePickerProps['isRequired']; /** * If `true`, the date picker is readOnly. * @default false */ readOnly?: RAC.DatePickerProps['isReadOnly']; /** * If `true`, the field is considered invalid and if set the errorMessage is shown instead of the `description`. * @default false */ error?: RAC.DatePickerProps['isInvalid']; /** * Whether the calendar is open by default (controlled). * @default false */ open?: RAC.DatePickerProps['isOpen']; /** * Visual variant of the component. Which values exist is defined by the theme * and listed in the "Appearance" section of the component's documentation. */ variant?: string; /** * Size of the component. Which values exist is defined by the theme and listed * in the "Appearance" section of the component's documentation. */ size?: string; /** * Sets the width of the field. You can see allowed tokens here: https://tailwindcss.com/docs/width * * Numeric/scale values are spacing-scale tokens, not pixels: `width={64}` * resolves to `calc(var(--spacing) * 64)` ~= 16rem (256px), not 64px. */ width?: WidthProp['width']; /** * Quick-select presets rendered beside the calendar in the popover. In * the small-screen tray, a "Quick selection" row above the grid switches * the sheet to the preset list in place. Accepts built-in keys (see * `BuiltInDatePresetKey`) with localized labels, and custom presets with * a `label` and a date value or resolver function. Selecting a preset * applies the date; the overlay stays open. */ presets?: readonly DatePreset[]; } declare const DatePickerBase: ({ dateUnavailable, disabled, required, readOnly, error, variant, size, open, granularity, presets, onChange, ref, ...rest }: DatePickerProps & { ref?: Ref; }) => import("react").JSX.Element; export { DatePickerBase as DatePicker };