import type { CalendarRootProps, CalendarRootEmits, RangeCalendarRootProps, RangeCalendarRootEmits, MonthPickerRootProps, YearPickerRootProps, DateRange, CalendarCellTriggerProps } from 'reka-ui'; import type { VNode } from 'vue'; import type { DateValue } from '@internationalized/date'; import type { AppConfig } from '@nuxt/schema'; import theme from '#build/b24ui/calendar'; import type { ButtonProps } from './Button.vue'; import type { IconComponent } from '../types/icons'; import type { LinkPropsKeys } from './Link.vue'; import type { ComponentConfig } from '../types/tv'; type Calendar = ComponentConfig; export type CalendarType = 'date' | 'month' | 'year'; export type CalendarView = 'day' | 'month' | 'year'; type CalendarDefaultValue = R extends true ? DateRange : M extends true ? DateValue[] : DateValue; type CalendarModelValue = R extends true ? (DateRange | null) : M extends true ? (DateValue[] | undefined) : (DateValue | undefined); type _CalendarRootProps = Omit; type _RangeCalendarRootProps = Omit; type _MonthPickerRootProps = Pick; type _YearPickerRootProps = Pick; /** * @memo: we not use variant */ export interface CalendarProps extends _RangeCalendarRootProps, _CalendarRootProps, _MonthPickerRootProps, _YearPickerRootProps { /** * The element or component this component should render as. * @defaultValue 'div' */ as?: any; /** * The type of picker. * - `date` renders a day calendar whose heading can switch to a month then year view. * - `month` renders a standalone month picker. * - `year` renders a standalone year picker. * @defaultValue 'date' */ type?: CalendarType; /** * The icon to use for the next year control. * @defaultValue icons.chevronDoubleRight * @IconComponent */ nextYearIcon?: IconComponent; /** * Configure the next year button. * `{ color: 'air-tertiary' }`{lang="ts-type"} */ nextYear?: Omit; /** * The icon to use for the next month control. * @defaultValue icons.chevronRight * @IconComponent */ nextMonthIcon?: IconComponent; /** * Configure the next month button. * `{ color: 'air-tertiary' }`{lang="ts-type"} */ nextMonth?: Omit; /** * The icon to use for the previous year control. * @defaultValue icons.chevronDoubleLeft * @IconComponent */ prevYearIcon?: IconComponent; /** * Configure the prev year button. * `{ color: 'air-tertiary' }`{lang="ts-type"} */ prevYear?: Omit; /** * The icon to use for the previous month control. * @defaultValue icons.chevronLeft * @IconComponent */ prevMonthIcon?: IconComponent; /** * Configure the prev month button. * `{ color: 'air-tertiary' }`{lang="ts-type"} */ prevMonth?: Omit; /** * Whether to make the heading a button that switches between the day, month and year views. * Has no effect when `type` is `year`. Can be an object to override the button props. * `{ color: 'air-tertiary', block: true }`{lang="ts-type"} * @defaultValue true */ viewControl?: boolean | Omit; /** * @defaultValue 'air-primary' */ color?: Calendar['variants']['color']; /** * @defaultValue 'md' */ size?: Calendar['variants']['size']; /** Whether or not a range of dates can be selected */ range?: R & boolean; /** Whether or not multiple dates can be selected */ multiple?: M & boolean; /** Show month controls */ monthControls?: boolean; /** Show year controls */ yearControls?: boolean; defaultValue?: CalendarDefaultValue; modelValue?: CalendarModelValue; weekNumbers?: boolean; class?: any; b24ui?: Calendar['slots']; } export interface CalendarEmits extends Omit { 'update:modelValue': [value: CalendarModelValue]; 'update:placeholder': [date: DateValue]; 'update:startValue': [date: DateValue | undefined]; 'update:validModelValue': [date: DateRange]; } export interface CalendarSlots { 'heading'?: (props: { value: string; view: CalendarView; date: DateValue; setView: (view: CalendarView) => void; setPlaceholder: (date: DateValue) => void; }) => VNode[]; 'day'?: (props: Pick) => VNode[]; 'week-day'?: (props: { day: string; }) => VNode[]; 'month-cell'?: (props: { month: DateValue; selected: boolean; disabled: boolean; }) => VNode[]; 'year-cell'?: (props: { year: DateValue; selected: boolean; disabled: boolean; }) => VNode[]; } declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal & { "onUpdate:modelValue"?: ((value: CalendarModelValue) => any) | undefined; "onUpdate:placeholder"?: ((date: DateValue) => any) | undefined; "onUpdate:validModelValue"?: ((date: DateRange) => any) | undefined; "onUpdate:startValue"?: ((date: DateValue | undefined) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: {}) => void; attrs: any; slots: CalendarSlots; emit: ((evt: "update:modelValue", value: CalendarModelValue) => void) & ((evt: "update:placeholder", date: DateValue) => void) & ((evt: "update:validModelValue", date: DateRange) => void) & ((evt: "update:startValue", date: DateValue | undefined) => void); }>) => import("vue").VNode & { __ctx?: NonNullable>; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};