import type React from 'react'; import type { FocusDetail, InputDetail, KeyboardDetail } from './types.js'; export interface DatePickerRef extends HTMLElement { /** Opens the calendar panel. */ open(): void; /** Closes the calendar panel. */ close(): void; /** Focuses the trigger button. */ focus(): void; /** Returns the current date value as ISO string. */ getValue(): string; /** Sets the date value programmatically (ISO format). */ setValue(value: string): void; } /** * Opens a calendar panel in Shadow DOM. Value is an ISO date string. * Emits `cx-change` (not native change). Use `onInput` for typing, `onChange` for calendar selection. * Disable specific dates via the `disabledDates` string array prop. * * In React, reach the imperative methods through a ref: * `const api = useRef(null)`, pass `ref={api}`, then `api.current?.open()`. * Available: open(), close(), focus(), +2 more. * * @csspart base */ export interface DatePickerOwnProps { /** * Unique identifier for the element. * @example 'example-id' */ id?: string; /** * Visible label text. * @example 'Example label' */ label: string; /** * Visual style variant. Allowed values: `outline`, `filled`, `ghost`. * @example 'outline' */ variant?: 'outline' | 'filled' | 'ghost'; /** * Corner radius style. Allowed values: `sharp`, `rounded`. * @example 'sharp' */ shape?: 'sharp' | 'rounded'; /** * Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. * @example 'xs' */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Currently selected item ID(s). * @example 'example' */ selected?: string; /** * Earliest selectable date (ISO 8601 string). * @example 'example' */ min?: string; /** * Latest selectable date (ISO 8601 string). * @example 'example' */ max?: string; /** * Array of ISO date strings or date ranges to disable. * @example ['item-1'] */ disabledDates?: string[]; /** * Date display format string. Allowed values: `iso`, `us-short`, `eu-short`, `eu-dot`. * @example 'iso' */ format?: 'iso' | 'us-short' | 'eu-short' | 'eu-dot'; /** * First day of the week (0=Sunday, 1=Monday, etc.). Allowed values: `monday`, `sunday`. * @example 'monday' */ firstDay?: 'monday' | 'sunday'; /** * Placeholder text shown when empty. * @example 'Enter a value' */ placeholder?: string; /** * Helper text displayed below the input. * @example 'example' */ helperText?: string; /** * Error message text. When set, shows validation error styling. * @example 'This field is invalid' */ error?: string; /** * Disables the component, preventing interaction. * @defaultValue false * @example true */ disabled?: boolean; /** * Marks the field as required for form validation. * @defaultValue false * @example true */ required?: boolean; /** * Makes the component read-only. * @defaultValue false * @example true */ readonly?: boolean; /** * Form field name for submission. * @example 'fieldName' */ name?: string; /** * Currently displayed month/year (ISO string). Controls the calendar view without changing the selected value. * @example 'example' */ viewing?: string; /** * Whether to show ISO week numbers. * @defaultValue false * @example true */ weekNumbers?: boolean; /** * Fires on each user edit before the value is committed. Detail: `InputDetail`. * @example (event) => console.log(event.detail.value) */ onInput?: (event: CustomEvent) => void; /** * Fires when the committed component value or state changes. Detail: `InputDetail`. * @example (event) => console.log(event.detail.value) */ onChange?: (event: CustomEvent) => void; /** * Fires when focus enters the component. Detail: `FocusDetail`. * @example (event) => console.log(event.detail.relatedTarget) */ onFocus?: (event: CustomEvent) => void; /** * Fires when focus leaves the component. Detail: `FocusDetail`. * @example (event) => console.log(event.detail.relatedTarget) */ onBlur?: (event: CustomEvent) => void; /** * Fires when a key is pressed inside the component. Detail: `KeyboardDetail`. * @example (event) => console.log(event.detail.key) */ onKeydown?: (event: CustomEvent) => void; /** * Fires when a key is released inside the component. Detail: `KeyboardDetail`. * @example (event) => console.log(event.detail.key) */ onKeyup?: (event: CustomEvent) => void; /** CSS class applied to the Custom Element host. * @example 'my-component' */ className?: string; /** Inline styles applied to the Custom Element host. * @example { marginTop: 8 } */ style?: React.CSSProperties; } /** * Props for ``: the component's own API plus every standard DOM * attribute and native React event handler, forwarded verbatim to the * `` host — `id`, `data-*`, `aria-*`, `title`, `tabIndex`, * `slot`, `onMouseEnter`, and the rest. Own props always win over a * same-named DOM attribute. */ export type DatePickerProps = DatePickerOwnProps & Omit, keyof DatePickerOwnProps | 'children' | 'dangerouslySetInnerHTML'>; export declare const DatePicker: React.ForwardRefExoticComponent, "children" | "dangerouslySetInnerHTML" | keyof DatePickerOwnProps> & React.RefAttributes>;