ivt
Version:
Ivt Components Library
63 lines (57 loc) • 3.03 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';
import React__default from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
import { DayPicker } from 'react-day-picker';
import * as PopoverPrimitive from '@radix-ui/react-popover';
declare const buttonVariants: (props?: ({
variant?: "default" | "destructive" | "outline" | "secondary" | "selection" | "upload" | "ghost" | "link" | "table" | null | undefined;
size?: "default" | "sm" | "lg" | "icon" | "normal" | "icon-sm" | "icon-lg" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
asChild?: boolean;
isAction?: boolean;
subtle?: boolean;
}
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, fromYear, toYear, ...props }: React.ComponentProps<typeof DayPicker> & {
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
}): react_jsx_runtime.JSX.Element;
declare function Popover({ ...props }: React__default.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
interface DatePickerProps extends Omit<React__default.ComponentProps<typeof Calendar>, "mode" | "selected" | "onSelect"> {
/** Data selecionada (pode ser Date ou string parseável) */
date: Date | string | undefined | null;
/** Função chamada ao selecionar uma data */
setDate: (date: Date | undefined) => void;
/** Texto exibido quando não há data selecionada */
placeholder?: string;
/** ID opcional do botão */
id?: string;
/** Props extras para o botão */
buttonProps?: ButtonProps;
/** Props extras para o popover */
popoverProps?: React__default.ComponentProps<typeof Popover>;
/** Classe extra para o conteúdo do popover */
popoverContentClassName?: string;
/** Classe extra para o botão */
className?: string;
/**
* Permite desabilitar datas específicas (igual ao Calendar do shadcn)
* Pode ser um boolean, ou uma função que recebe a data e retorna boolean
*/
disabled?: boolean | ((date: Date) => boolean);
/**
* Mês padrão a ser mostrado (caso nenhuma data esteja selecionada)
* Por padrão, será o mês atual.
*/
defaultMonth?: Date;
/**
* Define se o botão de limpar (X) a data deve ser exibido.
* @default true
*/
clearable?: boolean;
}
declare function DatePicker({ date, setDate, placeholder, id, buttonProps, popoverProps, popoverContentClassName, className, disabled, defaultMonth, clearable, ...props }: DatePickerProps): react_jsx_runtime.JSX.Element;
export { DatePicker };
export type { DatePickerProps };