@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and TailwindCSS
87 lines (86 loc) • 3.03 kB
TypeScript
import { Themes } from "../../constants.js";
import { DialogProps } from "../Dialog/Dialog.types.js";
import { Orientations, PickerVariants, TimeVariants } from "./DateTimePicker.constants.js";
import { CombinedRefs as CombinedRefs$1, PopoverProps } from "../Popover/Popover.types.js";
import { HTMLAttributes, ReactNode } from "react";
import { TimeOutput } from "react-timekeeper";
//#region src/components/DateTimePicker/DateTimePicker.types.d.ts
type CombinedRefs = {
calendar: HTMLDivElement | null;
input: HTMLInputElement | null;
picker: CombinedRefs$1 | null;
};
type DialogPropsOverride = Partial<Omit<DialogProps, 'children' | 'defaultOpen' | 'disabled' | 'onDismiss' | 'onToggle' | 'open' | 'popover' | 'trigger'>>;
type PopoverPropsOverride = Partial<Omit<PopoverProps, 'children' | 'disabled' | 'onOpenChange' | 'open' | 'popover' | 'toggleOnTriggerClick' | 'trigger' | 'triggerAsButton' | 'withArrow'>>;
interface DateTimePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onBlur' | 'onChange' | 'onFocus' | 'onKeyDown' | 'onKeyUp' | 'placeholder' | 'popover'> {
amPm?: boolean;
clearable?: boolean;
defaultOpen?: boolean;
defaultValue?: Date | null;
description?: ReactNode;
disabled?: boolean;
error?: Error | ReactNode;
fullWidth?: boolean;
i18n?: {
buttons?: {
clear?: string;
close?: string;
now?: string;
today?: string;
};
calendar?: {
fastNext?: string;
fastPrevious?: string;
next?: string;
previous?: string;
};
tabs?: {
bar?: string;
date?: string;
time?: string;
};
};
id?: string;
label?: ReactNode;
labelElement?: keyof HTMLElementTagNameMap;
maxDate?: 'today' | Date;
maxDateTime?: 'now' | Date;
maxTime?: 'now' | Date;
minDate?: 'today' | Date;
minDateTime?: 'now' | Date;
minTime?: 'now' | Date;
modal?: boolean;
name?: string;
open?: boolean;
orientation?: `${Orientations}`;
pickerVariant?: `${PickerVariants}`;
placeholder?: string;
popover?: DialogPropsOverride | PopoverPropsOverride;
readOnly?: boolean;
required?: boolean;
staticPicker?: boolean;
success?: ReactNode;
theme?: Themes;
timeVariant?: `${TimeVariants}`;
value?: Date | null;
withClose?: boolean;
withDatePicker?: boolean;
withNow?: boolean;
withPicker?: boolean;
withTimePicker?: boolean;
withToday?: boolean;
onChange?: (newDate: Date | null) => void;
onClear?: () => void;
onClose?: () => void;
onDateChange?: (newDate: Date | null, newDateTime: Date | null) => void;
onDismiss?: () => void;
onFieldChange?: (type: 'ampm' | 'day' | 'hour' | 'minute' | 'month' | 'second' | 'year', newValue: Date | null) => void;
onNow?: () => void;
onOpen?: () => void;
onOpenChange?: (open: boolean) => void;
onTimeChange?: (newTime: TimeOutput | null, newDateTime: Date | null) => void;
onToday?: () => void;
}
//#endregion
export { CombinedRefs, DateTimePickerProps };
//# sourceMappingURL=DateTimePicker.types.d.ts.map