laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
1,265 lines (1,059 loc) • 110 kB
TypeScript
import * as AccordionPrimitive from '@radix-ui/react-accordion';
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { ClassProp } from 'class-variance-authority/types';
import { ClassValue } from 'clsx';
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
import { ColumnDef } from '@tanstack/react-table';
import { Command as Command_2 } from 'cmdk';
import { ComponentProps } from 'react';
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
import { ControllerProps } from 'react-hook-form';
import { DayPicker } from 'react-day-picker';
import { default as default_2 } from 'react';
import { default as default_3 } from 'embla-carousel-react';
import { DialogContentProps } from '@radix-ui/react-dialog';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { Drawer as Drawer_2 } from 'vaul';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { FieldError } from 'react-hook-form';
import { FieldPath } from 'react-hook-form';
import { FieldValues } from 'react-hook-form';
import { FormProviderProps } from 'react-hook-form';
import { ForwardRefExoticComponent } from 'react';
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
import { HTMLAttributes } from 'react';
import { JSX } from 'react/jsx-runtime';
import { JSX as JSX_2 } from 'react';
import * as LabelPrimitive from '@radix-ui/react-label';
import { Locale } from 'date-fns';
import * as LucideIcons from 'lucide-react';
import * as MenubarPrimitive from '@radix-ui/react-menubar';
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
import { OnChangeFn } from '@tanstack/react-table';
import { OTPInput } from 'input-otp';
import * as PopoverPrimitive from '@radix-ui/react-popover';
import * as ProgressPrimitive from '@radix-ui/react-progress';
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
import * as React_2 from 'react';
import { ReactElement } from 'react';
import { ReactNode } from 'react';
import * as RechartsPrimitive from 'recharts';
import { RefAttributes } from 'react';
import { RefObject } from 'react';
import * as ResizablePrimitive from 'react-resizable-panels';
import { Row } from '@tanstack/react-table';
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
import * as SelectPrimitive from '@radix-ui/react-select';
import * as SeparatorPrimitive from '@radix-ui/react-separator';
import { SeparatorProps } from '@radix-ui/react-separator';
import * as SliderPrimitive from '@radix-ui/react-slider';
import { Slot } from '@radix-ui/react-slot';
import * as SwitchPrimitive from '@radix-ui/react-switch';
import * as TabsPrimitive from '@radix-ui/react-tabs';
import { Toaster as Toaster_2 } from 'sonner';
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
import * as TogglePrimitive from '@radix-ui/react-toggle';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import { UseAskResult } from 'use-ask';
import { UseEmblaCarouselType } from 'embla-carousel-react';
import { UseFormReturn } from 'react-hook-form';
import { VariantProps } from 'class-variance-authority';
declare type AcceptItem = "pdf" | "doc" | "docx" | "xls" | "xlsx" | "ppt" | "pptx" | "txt" | "csv" | "jpg" | "jpeg" | "png" | "gif" | "image" | "video" | "audio";
export declare function Accordion({ ...props }: AccordionProps): JSX.Element;
export declare function AccordionContent({ className, children, ...props }: AccordionContentProps): JSX.Element;
declare type AccordionContentProps = React_2.ComponentProps<typeof AccordionPrimitive.Content>;
export declare function AccordionItem({ className, ...props }: AccordionItemProps): JSX.Element;
declare type AccordionItemProps = React_2.ComponentProps<typeof AccordionPrimitive.Item>;
declare type AccordionProps = React_2.ComponentProps<typeof AccordionPrimitive.Root>;
export declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): JSX.Element;
declare type AccordionTriggerProps = React_2.ComponentProps<typeof AccordionPrimitive.Trigger>;
declare type AdditionalMessageOptions = Omit<ChatMessageProps, keyof Message>;
export declare function Alert({ className, variant, ...props }: AlertProps): JSX.Element;
export declare function AlertDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function AlertDialog({ ...props }: AlertDialogProps): JSX.Element;
export declare function AlertDialogAction({ className, ...props }: AlertDialogActionProps): JSX.Element;
declare type AlertDialogActionProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Action>;
export declare function AlertDialogCancel({ className, ...props }: AlertDialogCancelProps): JSX.Element;
declare type AlertDialogCancelProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Cancel>;
export declare function AlertDialogContent({ className, ...props }: AlertDialogContentProps): JSX.Element;
declare type AlertDialogContentProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Content>;
export declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): JSX.Element;
declare type AlertDialogDescriptionProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Description>;
export declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): JSX.Element;
declare type AlertDialogFooterProps = React_2.ComponentProps<"div">;
export declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): JSX.Element;
declare type AlertDialogHeaderProps = React_2.ComponentProps<"div">;
declare type AlertDialogProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Root>;
export declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): JSX.Element;
declare type AlertDialogTitleProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Title>;
export declare function AlertDialogTrigger({ ...props }: AlertDialogTriggerProps): JSX.Element;
declare type AlertDialogTriggerProps = React_2.ComponentProps<typeof AlertDialogPrimitive.Trigger>;
declare type AlertProps = React_2.ComponentProps<"div"> & VariantProps<typeof alertVariants>;
export declare function AlertTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
declare const alertVariants: (props?: ({
variant?: "default" | "destructive" | null | undefined;
} & ClassProp) | undefined) => string;
declare type Animation_2 = VariantProps<typeof chatBubbleVariants>["animation"];
export declare function AppDialog({ children, trigger, title, description, footer, size, open, defaultOpen, onOpenChange, triggerClassName, headerClassName, bodyClassName, footerClassName, disabled, asChild, preventClose, ...contentProps }: Readonly<AppDialogProps>): JSX.Element;
export declare interface AppDialogProps extends Omit<DialogContentProps, "title"> {
/** Element that triggers the dialog on click */
trigger?: React_2.ReactNode;
/** Dialog title displayed in the header */
title: string | React_2.ReactNode;
/** Dialog description displayed below the title */
description?: string | React_2.ReactNode;
/** Footer content (typically action buttons) */
footer?: React_2.ReactNode;
/** Size variant of the dialog */
size?: "sm" | "default" | "lg" | "xl" | "full";
/** Whether the dialog can be closed by clicking the overlay */
closeOnOverlay?: boolean;
/** Controlled open state */
open?: boolean;
/** Default open state for uncontrolled usage */
defaultOpen?: boolean;
/** Callback when open state changes */
onOpenChange?: (open: boolean) => void;
/** Additional className for the dialog */
className?: string;
/** Additional className for the trigger wrapper */
triggerClassName?: string;
/** Additional className for the dialog content */
contentClassName?: string;
/** Additional className for the dialog's header */
headerClassName?: string;
/** Additional className for the dialog's body */
bodyClassName?: string;
/** Additional className for the dialog's footer */
footerClassName?: string;
/** Whether to disable the trigger */
disabled?: boolean;
/** Whether to use asChild pattern for trigger (for custom elements) */
asChild?: boolean;
preventClose?: "overlay" | "all";
}
export declare function AppEditor({ defaultValue, onMarkdownEdit, plugins, toolbars, placeholder, onlyMarkdown, className, }: AppEditorProps): JSX.Element;
declare type AppEditorPlugin = "clear" | "counter";
declare interface AppEditorProps {
defaultValue?: string;
onMarkdownEdit?: (markdown: string) => void;
plugins?: AppEditorPlugin[];
toolbars?: AppEditorToolbar[];
placeholder?: string;
onlyMarkdown?: boolean;
className?: string;
}
declare type AppEditorToolbar = "block-format" | "font-format" | "history";
export declare const AppForm: ({ items, cols, form, submitText, onSubmit, isSubmitting, showSubmitButton, }: AppFormProps) => JSX.Element;
export declare interface AppFormItem {
label: string;
component: "input" | "select" | "textarea" | "checkbox" | "multiselect" | "datepicker" | "radio" | "switch" | "slider" | "async" | "async-multiple";
name: string;
inputType?: ComponentProps<"input">["type"];
defaultValue?: string | boolean | number | string[] | Date | number[];
options?: AppSelectOption[];
disabled?: boolean;
placeholder?: string;
caption?: string;
calendarRange?: [Date, Date];
min?: number;
max?: number;
step?: number;
fetcher?: (query?: string) => Promise<any[]>;
renderOptionItem?: (option: any) => React.ReactNode;
resolveOptionValue?: (option: any) => string;
renderSelectedValue?: (option: any) => React.ReactNode;
initialOptions?: any[];
notFound?: React.ReactNode;
noResultsMessage?: string;
debounce?: number;
clearable?: boolean;
}
declare interface AppFormProps {
cols?: "1" | "2" | "3";
items: AppFormItem[];
form: UseFormReturn<any>;
submitText?: string;
onSubmit?: (data: any) => void;
isSubmitting?: boolean;
showSubmitButton?: boolean;
}
export declare function AppKanban<T = any>({ columns, initialTasks, onTaskMove, onTaskEdit, onTaskCreate, taskActions, renderTaskContent, className, allowTaskCreate, }: AppKanbanConfig<T>): JSX.Element;
export declare type AppKanbanColumn = {
id: string;
label: string;
};
export declare type AppKanbanConfig<T = any> = {
columns: AppKanbanColumn[];
initialTasks: Record<string, AppKanbanTask<T>[]>;
onTaskMove?: (taskId: string, fromColumn: string, toColumn: string) => void;
onTaskEdit?: (task: AppKanbanTask<T>, columnId: string) => void;
onTaskCreate?: (columnId: string) => void;
taskActions?: (task: AppKanbanTask<T>, columnId: string) => KanbanBoardCardAction[];
renderTaskContent?: (task: AppKanbanTask<T>, columnId: string) => ReactNode;
className?: string;
allowTaskCreate?: boolean;
createTaskLabel?: string;
};
export declare type AppKanbanTask<T = any> = {
id: string;
title: string;
description?: string;
data?: T;
meta?: KanbanBoardCardMetaItem[];
icon?: IconName;
createTaskLabel?: string;
};
/**
* @deprecated This component is deprecated. Please use AppSelect component instead.
*/
export declare function AppMultipleSelectDropdown({ options, value, onChange, onClear, placeholder, disabled, size, label, labelClassName, emptyMessage, className, searchPlaceholder, searchable, cancelLabel, maxSelectedItems, }: MultipleSelectDropdownProps): JSX.Element;
/**
* @deprecated This interface is deprecated. Please use AppSelect component instead.
*/
export declare interface AppMultipleSelectOption {
value: string;
label: string;
disabled?: boolean;
}
export declare function AppRadioGroup({ options, value, defaultValue, onValueChange, label, description, disabled, required, name, orientation, loop, className, wrpClassName, optionClassName, layout, error, id, "data-testid": dataTestId, }: AppRadioGroupProps): JSX.Element;
export declare interface AppRadioGroupOption {
value: string;
label: string | React_2.ReactNode;
description?: string | React_2.ReactNode;
disabled?: boolean;
icon?: IconName;
}
export declare interface AppRadioGroupProps {
options: AppRadioGroupOption[];
value?: string;
defaultValue?: string;
onValueChange?: (value: string) => void;
label?: string | React_2.ReactNode;
description?: string | React_2.ReactNode;
disabled?: boolean;
required?: boolean;
name?: string;
orientation?: "horizontal" | "vertical";
loop?: boolean;
className?: string;
wrpClassName?: string;
optionClassName?: string;
layout?: "default" | "card";
error?: string;
id?: string;
"data-testid"?: string;
}
export declare function AppSelect(props: AppSelectProps): JSX.Element;
export declare interface AppSelectOption {
value: string | number;
label: string | React.ReactNode;
disabled?: boolean;
group?: string;
fixed?: boolean;
}
export declare type AppSelectProps = SingleSelectProps | MultiSelectProps;
export declare function AppSidebar({ navigation, navigationFooter, versions, defaultVersion, headerContent, footerContent, showRail, linkComponent: LinkComponent, linkProps, ...props }: AppSidebarProps): JSX.Element;
declare interface AppSidebarProps extends React_2.ComponentProps<typeof Sidebar> {
navigation: NavGroup[];
navigationFooter?: NavGroup[];
versions?: string[];
defaultVersion?: string;
headerContent?: React_2.ReactNode;
footerContent?: React_2.ReactNode;
showRail?: boolean;
linkComponent?: React_2.ComponentType<any>;
linkProps?: Record<string, any>;
}
export declare interface AppStep {
id: number;
label: React_2.ReactNode;
component: React_2.ReactNode;
completed?: boolean;
disabled?: boolean;
loading?: boolean;
"data-testid"?: string;
}
export declare function AppStepper({ steps, align, size, showSeparators, defaultStep, allowStepNavigation, allowClickOnlyCompleted, onStepClick, indicators, id, "data-testid": dataTestId, ...stepperProps }: AppStepperProps): JSX.Element;
export declare interface AppStepperProps extends Omit<StepperProps, "children"> {
steps: AppStep[];
align?: "horizontal" | "vertical";
size?: "sm" | "md";
showSeparators?: boolean;
defaultStep?: number;
allowStepNavigation?: boolean;
allowClickOnlyCompleted?: boolean;
onStepClick?: (step: AppStep, index: number) => void;
indicators?: StepIndicators;
id?: string;
"data-testid"?: string;
}
export declare function AppTooltip({ content, children, label, labelClassName, header, variant, triggerVariant, size, className, wrpClassName, contentClassName, side, align, sideOffset, matchTriggerWidth, delayDuration, disabled, asChild, }: AppTooltipProps): JSX.Element;
export declare type AppTooltipAlign = "start" | "center" | "end";
declare interface AppTooltipProps {
/** Content displayed inside the tooltip */
content: React_2.ReactNode;
/** Element that triggers the tooltip on hover/focus */
children: React_2.ReactNode;
/** Optional label displayed above the tooltip trigger */
label?: string | React_2.ReactNode;
/** Optional header displayed at the top of the tooltip content */
header?: string | React_2.ReactNode;
/** Tooltip content variant - affects background and styling */
variant?: AppTooltipVariant;
/** Trigger element variant - affects hover states */
triggerVariant?: VariantProps<typeof tooltipTriggerVariants>["variant"];
/** Size of the trigger element */
size?: VariantProps<typeof tooltipTriggerVariants>["size"];
/** Additional className for the trigger wrapper */
className?: string;
/** Additional className for the outer wrapper (includes label) */
wrpClassName?: string;
/** Additional className for the tooltip content */
contentClassName?: string;
/** Additional className for the label */
labelClassName?: string;
/** Side where the tooltip appears */
side?: AppTooltipSide;
/** Alignment of the tooltip relative to the trigger */
align?: AppTooltipAlign;
/** Offset from the trigger in pixels */
sideOffset?: number;
/** Whether the tooltip should match the trigger's width */
matchTriggerWidth?: boolean;
/** Delay before showing tooltip (ms) */
delayDuration?: number;
/** Whether to disable the tooltip */
disabled?: boolean;
/** Whether to use asChild pattern for trigger (for custom elements) */
asChild?: boolean;
}
export declare type AppTooltipSide = "top" | "right" | "bottom" | "left";
export declare type AppTooltipVariant = "primary" | "card";
export declare function AspectRatio({ ...props }: AspectRatioProps): JSX.Element;
declare type AspectRatioProps = React.ComponentProps<typeof AspectRatioPrimitive.Root>;
export declare function AsyncSelect<T = Option_2>({ fetcher, initialOptions, debounce, renderOptionItem, resolveOptionValue, renderSelectedValue, notFound, label, placeholder, value, onChange, disabled, className, wrpClassName, noResultsMessage, clearable, multiple, size, id, "data-testid": dataTestId, }: AsyncSelectProps<T>): JSX.Element;
declare interface AsyncSelectMultipleProps<T> extends VariantProps<typeof selectTriggerVariants> {
multiple: boolean;
fetcher: (query?: string) => Promise<T[]>;
initialOptions?: T[];
debounce?: number;
renderOptionItem: (option: T) => React_2.ReactNode;
resolveOptionValue: (option: T) => string;
renderSelectedValue: (option: T) => React_2.ReactNode;
notFound?: React_2.ReactNode;
value?: string[];
onChange?: (value: string[]) => void;
label?: string | React_2.ReactNode;
placeholder?: string;
disabled?: boolean;
className?: string;
wrpClassName?: string;
noResultsMessage?: string;
clearable?: boolean;
id?: string;
"data-testid"?: string;
}
declare type AsyncSelectProps<T> = AsyncSelectSingleProps<T> | AsyncSelectMultipleProps<T>;
declare interface AsyncSelectSingleProps<T> extends VariantProps<typeof selectTriggerVariants> {
multiple?: false;
fetcher: (query?: string) => Promise<T[]>;
initialOptions?: T[];
debounce?: number;
renderOptionItem: (option: T) => React_2.ReactNode;
resolveOptionValue: (option: T) => string;
renderSelectedValue: (option: T) => React_2.ReactNode;
notFound?: React_2.ReactNode;
value?: string;
onChange?: (value: string) => void;
label?: string | React_2.ReactNode;
placeholder?: string;
disabled?: boolean;
className?: string;
wrpClassName?: string;
noResultsMessage?: string;
clearable?: boolean;
id?: string;
"data-testid"?: string;
}
declare interface Attachment {
name?: string;
contentType?: string;
url: string;
}
export declare function AudioVisualizer({ stream, isRecording, onClick, }: AudioVisualizerProps): JSX.Element;
declare interface AudioVisualizerProps {
stream: MediaStream | null;
isRecording: boolean;
onClick: () => void;
}
export declare function Avatar({ className, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Root>): JSX.Element;
export declare function AvatarFallback({ className, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Fallback>): JSX.Element;
export declare function AvatarImage({ className, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Image>): JSX.Element;
export declare interface AvatarItem {
src: string;
alt?: string;
}
export declare function Badge({ className, variant, asChild, disabled, iconLeft, iconRight, ...props }: BadgeProps & React_2.ComponentProps<"span">): JSX.Element;
export declare interface BadgeProps extends React_2.ComponentPropsWithoutRef<"span"> {
variant?: "default" | "destructive" | "warning" | "success" | "outline" | "outline-primary" | "outline-destructive" | "outline-warning" | "outline-success" | "secondary" | "ghost" | "ghost-destructive" | "ghost-accent" | "ghost-warning" | "ghost-success" | "link";
asChild?: boolean;
disabled?: boolean;
iconLeft?: IconName;
iconRight?: IconName;
}
export declare const badgeVariants: (props?: ({
variant?: "link" | "default" | "destructive" | "warning" | "success" | "outline" | "outline-primary" | "outline-destructive" | "outline-warning" | "outline-success" | "secondary" | "ghost" | "ghost-destructive" | "ghost-accent" | "ghost-warning" | "ghost-success" | null | undefined;
} & ClassProp) | undefined) => string;
declare type BarItemDataType = RepeatDataType | NoRepeatDataType;
export declare type BaseColumnConfig<TData> = {
id?: string;
accessorKey?: DeepKeys<TData>;
sortable?: boolean;
filterable?: boolean;
searchable?: boolean;
pinned?: "left" | "right";
cell?: (value: any, row: TData, tableRow: Row<TData>) => React.ReactNode;
} & HeaderConfig;
declare type BaseProps = {
options: AppSelectOption[];
placeholder?: string;
searchPlaceholder?: string;
emptyPlaceholder?: string;
addItemPlaceholder?: string;
itemCountMessage?: (selected: number) => string;
maxSelectedMessage?: (max: number) => string;
label?: string | React.ReactNode;
className?: string;
labelClassName?: string;
wrpClassName?: string;
searchable?: boolean;
creatable?: boolean;
isSingleSelectClearable?: boolean;
disabled?: boolean;
groupBy?: keyof AppSelectOption;
maxSelected?: number;
showChipsInsteadOfCount?: boolean;
size?: SelectSizeType_2;
onClear?: () => void;
id?: string;
"data-testid"?: string;
};
export declare function Breadcrumb({ ...props }: React_2.ComponentProps<"nav">): JSX.Element;
export declare function BreadcrumbEllipsis({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
export declare function BreadcrumbItem({ className, ...props }: React_2.ComponentProps<"li">): JSX.Element;
export declare function BreadcrumbLink({ asChild, className, ...props }: React_2.ComponentProps<"a"> & {
asChild?: boolean;
}): JSX.Element;
export declare function BreadcrumbList({ className, ...props }: React_2.ComponentProps<"ol">): JSX.Element;
export declare function BreadcrumbPage({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
export declare function BreadcrumbSeparator({ children, className, ...props }: React_2.ComponentProps<"li">): JSX.Element;
export declare function Button({ className, variant, size, asChild, iconLeft, iconRight, isLoading, ...props }: ButtonProps): JSX.Element;
export declare interface ButtonProps extends React_2.ComponentProps<"button"> {
variant?: ButtonVariant;
size?: ButtonSize;
asChild?: boolean;
iconLeft?: IconName;
iconRight?: IconName;
isLoading?: boolean;
}
export declare type ButtonSize = "default" | "sm" | "lg" | "icon";
export declare type ButtonVariant = "default" | "destructive" | "outline" | "outline-primary" | "outline-destructive" | "secondary" | "ghost" | "ghost-destructive" | "ghost-accent" | "link";
export declare const buttonVariants: (props?: ({
variant?: "link" | "default" | "destructive" | "outline" | "outline-primary" | "outline-destructive" | "secondary" | "ghost" | "ghost-destructive" | "ghost-accent" | null | undefined;
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
} & ClassProp) | undefined) => string;
export declare function Calendar({ className, classNames, showOutsideDays, buttonVariant, formatters, components, locale, ...props }: CalendarProps): JSX.Element;
export declare interface CalendarAppointment {
id: number;
title: string;
description?: string;
date: string;
startTime: string;
endTime?: string;
color?: string;
attributes?: {
key: string;
value: default_2.ReactNode | string;
showPreview?: boolean;
showTooltip?: boolean;
}[];
className?: string;
groupBy?: string;
}
export declare type CalendarProps = React_2.ComponentProps<typeof DayPicker> & {
buttonVariant?: React_2.ComponentProps<typeof Button>["variant"];
};
export declare function Card({ className, size, ...props }: CardProps): JSX.Element;
export declare function CardContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function CardDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function CardFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function CardHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare interface CardProps extends React_2.ComponentProps<"div"> {
size?: CardSize;
}
declare type CardSize = "default" | "sm" | "lg" | "none";
export declare function CardTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React_2.ComponentProps<"div"> & CarouselProps): JSX.Element;
declare type CarouselApi = UseEmblaCarouselType[1];
export declare function CarouselContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function CarouselItem({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
export declare function CarouselNext({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
declare type CarouselOptions = UseCarouselParameters[0];
declare type CarouselPlugin = UseCarouselParameters[1];
export declare function CarouselPrevious({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
declare type CarouselProps = {
opts?: CarouselOptions;
plugins?: CarouselPlugin;
orientation?: "horizontal" | "vertical";
setApi?: (api: CarouselApi) => void;
};
declare const Chart: default_2.FC<ChartProps>;
export declare type ChartConfig = {
[k in string]: {
label?: React_2.ReactNode;
icon?: React_2.ComponentType;
} & ({
color?: string;
theme?: never;
} | {
color?: never;
theme: Record<keyof typeof THEMES, string>;
});
};
export declare function ChartContainer({ id, className, children, config, ...props }: React_2.ComponentProps<"div"> & {
config: ChartConfig;
children: React_2.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
}): JSX.Element;
export declare const ChartLegend: typeof RechartsPrimitive.Legend;
export declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: {
className?: string;
hideIcon?: boolean;
payload?: Array<{
value?: string;
dataKey?: string;
color?: string;
}>;
verticalAlign?: "top" | "middle" | "bottom";
nameKey?: string;
} & React_2.HTMLAttributes<HTMLDivElement>): JSX.Element | null;
declare interface ChartProps {
data: GanttDataType[];
className?: string;
onBarDoubleClick?: OnBarDoubleClickType;
onBarChange?: OnBarChangeType;
treeTitle?: string;
}
export declare const ChartStyle: ({ id, config }: {
id: string;
config: ChartConfig;
}) => JSX.Element | null;
export declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
export declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: {
active?: boolean;
payload?: Array<{
dataKey?: string;
name?: string;
value?: any;
color?: string;
payload?: any;
}>;
label?: string | number;
className?: string;
indicator?: "line" | "dot" | "dashed";
hideLabel?: boolean;
hideIndicator?: boolean;
labelFormatter?: (value: any, payload: any) => React_2.ReactNode;
labelClassName?: string;
formatter?: (value: any, name: any, item: any, index: number, payload: any) => React_2.ReactNode;
color?: string;
nameKey?: string;
labelKey?: string;
} & React_2.HTMLAttributes<HTMLDivElement>): JSX.Element | null;
export declare function Chat({ messages, welcomeTitle, handleSubmit, input, handleInputChange, stop, isGenerating, append, suggestions, className, onRateResponse, setMessages, transcribeAudio, allowAttachments, onEdit, onMessageSave, }: ChatProps): JSX.Element;
export declare namespace Chat {
var displayName: string;
}
declare const chatBubbleVariants: (props?: ({
isUser?: boolean | null | undefined;
animation?: "none" | "scale" | "slide" | "fade" | null | undefined;
} & ClassProp) | undefined) => string;
export declare const ChatContainer: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;
export declare const ChatForm: ForwardRefExoticComponent<ChatFormProps & RefAttributes<HTMLFormElement>>;
declare interface ChatFormProps {
className?: string;
isPending: boolean;
handleSubmit: (event?: {
preventDefault?: () => void;
}, options?: {
experimental_attachments?: FileList;
}) => void;
children: (props: {
files: File[] | null;
setFiles: React.Dispatch<React.SetStateAction<File[] | null>>;
}) => ReactElement;
}
export declare const ChatMessage: default_2.FC<ChatMessageProps>;
export declare interface ChatMessageProps extends Message {
showTimeStamp?: boolean;
animation?: Animation_2;
actions?: default_2.ReactNode;
editable?: boolean;
onEdit?: (newContent: string) => void;
onMessageSave?: (messageId: string, content: string) => void;
}
export declare function ChatMessages({ messages, children, }: React.PropsWithChildren<{
messages: Message[];
}>): JSX.Element;
declare type ChatProps = ChatPropsWithoutSuggestions | ChatPropsWithSuggestions;
declare interface ChatPropsBase {
handleSubmit: (event?: {
preventDefault?: () => void;
}, options?: {
experimental_attachments?: FileList;
}) => void;
messages: Array<Message>;
input: string;
className?: string;
handleInputChange: React.ChangeEventHandler<HTMLTextAreaElement>;
isGenerating: boolean;
stop?: () => void;
onRateResponse?: (messageId: string, rating: "thumbs-up" | "thumbs-down") => void;
setMessages?: (messages: any[]) => void;
transcribeAudio?: (blob: Blob) => Promise<string>;
allowAttachments?: boolean;
onEdit?: (messageId: string, newContent: string) => void;
onMessageSave?: (messageId: string, content: string) => void;
welcomeTitle?: string;
}
declare interface ChatPropsWithoutSuggestions extends ChatPropsBase {
append?: never;
suggestions?: never;
}
declare interface ChatPropsWithSuggestions extends ChatPropsBase {
append: (message: {
role: "user";
content: string;
}) => void;
suggestions: string[];
}
export declare function Checkbox({ className, checked, ...props }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>): JSX.Element;
export declare function CircularProgress({ value, renderLabel, className, progressClassName, labelClassName, showLabel, shape, size, strokeWidth, circleStrokeWidth, progressStrokeWidth, }: CircularProgressProps): JSX.Element;
declare interface CircularProgressProps {
value: number;
renderLabel?: (progress: number) => number | string;
size?: number;
strokeWidth?: number;
circleStrokeWidth?: number;
progressStrokeWidth?: number;
shape?: "square" | "round";
className?: string;
progressClassName?: string;
labelClassName?: string;
showLabel?: boolean;
}
export declare function cn(...inputs: ClassValue[]): string;
export declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): JSX.Element;
export declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): JSX.Element;
export declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): JSX.Element;
export declare const Command: React_2.ForwardRefExoticComponent<Omit<{
children?: React_2.ReactNode;
} & Pick<Pick<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React_2.HTMLAttributes<HTMLDivElement>> & {
ref?: React_2.Ref<HTMLDivElement>;
} & {
asChild?: boolean;
}, "key" | keyof React_2.HTMLAttributes<HTMLDivElement> | "asChild"> & {
label?: string;
shouldFilter?: boolean;
filter?: (value: string, search: string, keywords?: string[]) => number;
defaultValue?: string;
value?: string;
onValueChange?: (value: string) => void;
loop?: boolean;
disablePointerSelection?: boolean;
vimBindings?: boolean;
} & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
export declare function CommandDialog({ title, description, children, ...props }: React_2.ComponentProps<typeof Dialog> & {
title?: string;
description?: string;
}): JSX.Element;
export declare function CommandEmpty({ ...props }: React_2.ComponentProps<typeof Command_2.Empty>): JSX.Element;
export declare function CommandGroup({ className, ...props }: React_2.ComponentProps<typeof Command_2.Group>): JSX.Element;
export declare function CommandInput({ className, ...props }: React_2.ComponentProps<typeof Command_2.Input>): JSX.Element;
export declare function CommandItem({ className, ...props }: React_2.ComponentProps<typeof Command_2.Item>): JSX.Element;
export declare function CommandList({ className, ...props }: React_2.ComponentProps<typeof Command_2.List>): JSX.Element;
export declare function CommandSeparator({ className, ...props }: React_2.ComponentProps<typeof Command_2.Separator>): JSX.Element;
export declare function CommandShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
declare const confirm_2: (payload: ConfirmOptions) => Promise<boolean>;
export { confirm_2 as confirm }
export declare interface ConfirmedCell {
fromId: string;
toId: string;
id?: string;
value: any;
}
export declare interface ConfirmedCellsData {
editedCells: ConfirmedCell[];
toDefaultCells: ConfirmedCell[];
}
export declare const Confirmer: () => JSX.Element;
declare interface ConfirmOptions {
title?: React.ReactNode;
description?: React.ReactNode;
cancelText?: React.ReactNode;
actionText?: React.ReactNode;
CancelProps?: React.ComponentProps<typeof AlertDialogCancel>;
ActionProps?: React.ComponentProps<typeof Button>;
variant?: "default" | "destructive";
}
export declare function ContextMenu({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Root>): JSX.Element;
export declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): JSX.Element;
export declare function ContextMenuContent({ className, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Content>): JSX.Element;
export declare function ContextMenuGroup({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Group>): JSX.Element;
export declare function ContextMenuItem({ className, inset, variant, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Item> & {
inset?: boolean;
variant?: "default" | "destructive";
}): JSX.Element;
export declare function ContextMenuLabel({ className, inset, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Label> & {
inset?: boolean;
}): JSX.Element;
export declare function ContextMenuPortal({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Portal>): JSX.Element;
export declare function ContextMenuRadioGroup({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): JSX.Element;
export declare function ContextMenuRadioItem({ className, children, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): JSX.Element;
export declare function ContextMenuSeparator({ className, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Separator>): JSX.Element;
export declare function ContextMenuShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
export declare function ContextMenuSub({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Sub>): JSX.Element;
export declare function ContextMenuSubContent({ className, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.SubContent>): JSX.Element;
export declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
inset?: boolean;
}): JSX.Element;
export declare function ContextMenuTrigger({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Trigger>): JSX.Element;
declare const Controls: default_2.FC<ControlsProps>;
declare interface ControlsProps {
className?: string;
}
export declare function CopyButton({ content, copyMessage }: CopyButtonProps): JSX.Element;
declare type CopyButtonProps = {
content: string;
copyMessage?: string;
};
/**
* Creates an action column (not sortable/filterable/searchable)
* @example
* createActionColumn<Person>({
* id: "actions",
* header: "Azioni",
* pinned: "right",
* cell: (row) => <Button>Edit {row.name}</Button>
* })
*/
export declare function createActionColumn<TData>(config: {
id: string;
pinned?: "left" | "right";
cell: (row: TData) => React.ReactNode;
} & HeaderConfig): ColumnDef<TData>;
/**
* Creates a boolean column with sensible defaults
* @example
* createBooleanColumn<Person>({
* accessorKey: "is_active",
* header: "Attivo",
* filterable: true,
* cell: (value) => value ? "✓" : "✗"
* })
*/
export declare function createBooleanColumn<TData>(config: BaseColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates a boolean filter badge
* @example
* createBooleanFilter("is_active", "Attivo", "checked")
*/
export declare function createBooleanFilter(columnId: string, columnAccessorKey: string, columnLabel: string, operator: "checked" | "unchecked" | "eq" | "ne", value?: boolean): DataTableBadgeFilter;
/**
* Creates a computed column with a specific type (allows filtering/sorting based on computed value)
* Useful when you want to compute a value from row data but still have type-specific filtering
* @example
* // Age in months (computed from age)
* createComputedColumn<Person>({
* id: "age_months",
* header: "Età (mesi)",
* type: "number",
* cell: (row) => row.age * 12,
* sortable: true
* })
*/
export declare function createComputedColumn<TData>(config: {
id?: string;
type: "string" | "number" | "boolean" | "date" | "datetime";
cell: (row: TData) => React.ReactNode;
pinned?: "left" | "right";
sortable?: boolean;
filterable?: boolean;
searchable?: boolean;
} & HeaderConfig): ColumnDef<TData>;
/**
* Creates a date column with sensible defaults
* @example
* createDateColumn<Person>({
* accessorKey: "birth_date",
* header: "Data di nascita",
* sortable: true,
* filterable: true
* })
*/
export declare function createDateColumn<TData>(config: BaseColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates a date filter badge
* @example
* createDateFilter("birth_date", "Data di nascita", "date_after", "2000-01-01")
*/
export declare function createDateFilter(columnId: string, columnAccessorKey: string, columnLabel: string, operator: "eq" | "date_before" | "date_after" | "eq_null" | "n_eq_null", value?: string): DataTableBadgeFilter;
/**
* Creates a datetime column with sensible defaults
* @example
* createDateTimeColumn<Person>({
* accessorKey: "created_at",
* header: "Data creazione",
* sortable: true,
* filterable: true
* })
*/
export declare function createDateTimeColumn<TData>(config: BaseColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates a datetime filter badge
* @example
* createDateTimeFilter("created_at", "Data creazione", "date_time_after", "2024-01-01T00:00:00")
*/
export declare function createDateTimeFilter(columnId: string, columnAccessorKey: string, columnLabel: string, operator: "date_time_before" | "date_time_after" | "eq_null" | "n_eq_null", value?: string): DataTableBadgeFilter;
/**
* Creates a display-only column (no data binding, for computed/derived values)
* @example
* // Computed full name column
* createDisplayColumn<Person>({
* id: "full_name",
* header: "Nome Completo",
* cell: (row) => `${row.firstName} ${row.lastName}`,
* searchable: true // Can make it searchable if needed
* })
*
* // Status badge column
* createDisplayColumn<Person>({
* id: "status_badge",
* header: "Stato",
* cell: (row) => <Badge color={row.is_active ? "green" : "red"}>{row.status}</Badge>
* })
*/
export declare function createDisplayColumn<TData>(config: {
id?: string;
cell: (row: TData) => React.ReactNode;
pinned?: "left" | "right";
searchable?: boolean;
} & HeaderConfig): ColumnDef<TData>;
/**
* Creates a filter badge with auto-generated ID
* @example
* createFilterBadge({
* columnId: "name",
* columnLabel: "Nome",
* columnType: "string",
* columnAccessorKey: "name",
* operator: "like",
* value: "John"
* })
*/
export declare function createFilterBadge(config: FilterBadgeConfig): DataTableBadgeFilter;
/**
* Creates multiple filter badges at once
* @example
* createFilterBadges([
* { columnId: "name", columnLabel: "Nome", columnType: "string", operator: "like", value: "John" },
* { columnId: "age", columnLabel: "Età", columnType: "number", operator: "gt", value: 25 }
* ])
*/
export declare function createFilterBadges(configs: FilterBadgeConfig[]): DataTableBadgeFilter[];
/**
* Creates initial state configuration for DataTable
* @example
* createInitialState({
* filters: [createStringFilter("name", "Nome", "like", "John")],
* searchbarFilter: "active users",
* sorting: [{ column: "name", order: "asc" }],
* pagination: { pageIndex: 0, pageSize: 20 }
* })
*/
export declare function createInitialState<TData = Record<string, unknown>>(config: InitialStateConfig<TData>): DataTableState<TData>;
/**
* Creates a list filter badge
* @example
* createListFilter("role", "Ruolo", "list_single_select", "array_overlap", ["Admin"], roleOptions)
*/
export declare function createListFilter(columnId: string, columnAccessorKey: string, columnLabel: string, columnType: "list_single_select" | "list_multi_select", operator: "array_overlap" | "n_array_overlap" | "eq_null" | "n_eq_null", value?: Array<string | number>, listOptions?: AppSelectOption[]): DataTableBadgeFilter;
/**
* Creates a multi select list column (array where user can select multiple values)
* @example
* createMultiSelectColumn<Person>({
* accessorKey: "tags",
* header: "Tags",
* options: ["frontend", "backend", "devops"],
* filterable: true
* })
*/
export declare function createMultiSelectColumn<TData>(config: ListColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates a number column with sensible defaults
* @example
* createNumberColumn<Person>({
* accessorKey: "age",
* header: "Età",
* sortable: true,
* filterable: true
* })
*
* // Display-only computed column
* createNumberColumn<Person>({
* id: "age_in_months",
* header: "Età (mesi)",
* cell: (_, row) => row.age * 12
* })
*/
export declare function createNumberColumn<TData>(config: BaseColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates a number filter badge
* @example
* createNumberFilter("age", "Età", "gt", 25)
*/
export declare function createNumberFilter(columnId: string, columnAccessorKey: string, columnLabel: string, operator: "eq" | "ne" | "lt" | "le" | "gt" | "ge" | "eq_null" | "n_eq_null", value?: number): DataTableBadgeFilter;
/**
* Creates a single select list column (array where user can select one value)
* @example
* createSingleSelectColumn<Person>({
* accessorKey: "role",
* header: "Ruolo",
* options: ["Admin", "User", "Guest"],
* filterable: true
* })
*/
export declare function createSingleSelectColumn<TData>(config: ListColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates sorting configuration
* @example
* createSorting([
* { column: "name", order: "asc" },
* { column: "age", order: "desc" }
* ])
*/
export declare function createSorting(sorts: Array<{
column: string;
order: "asc" | "desc";
}>): DataTableSorting;
/**
* Creates a string column with sensible defaults
* @example
* // Data-bound column
* createStringColumn<Person>({
* accessorKey: "name",
* header: "Nome",
* sortable: true,
* filterable: true
* })
*
* // Nested object path (supports dot notation, including nullable/optional objects)
* createStringColumn<Person>({
* accessorKey: "address.city",
* header: "Città",
* sortable: true,
* filterable: true
* })
*
* // Nullable nested object (e.g., item?: PricingItem | null)
* createStringColumn<Order>({
* accessorKey: "item.cod_master_pu",
* header: "Master PU",
* sortable: true
* })
*
* // Multiple columns with same accessor (use unique IDs)
* createStringColumn<Person>({
* id: "name_display",
* accessorKey: "name",
* header: "Nome (Display)",
* cell: (value) => <strong>{value}</strong>
* })
*
* // Display-only column (no accessorKey)
* createStringColumn<Person>({
* id: "custom_display",
* header: "Custom",
* cell: (_, row) => `${row.firstName} ${row.lastName}`
* })
*/
export declare function createStringColumn<TData>(config: BaseColumnConfig<TData>): ColumnDef<TData>;
/**
* Creates a string filter badge
* @example
* createStringFilter("name", "Nome", "like", "John")
*/
export declare function createStringFilter(columnId: string, columnAccessorKey: string, columnLabel: string, operator: "like" | "n_like" | "starts_with" | "ends_with" | "eq" | "ne" | "eq_null" | "n_eq_null", value?: string): DataTableBadgeFilter;
export declare interface CrossTableCell {
render?: (fromId: string, toId: string, id?: string) => ReactNode;
value?: number | string | null;
bgColor?: string;
textColor?: string;
fromId: string;
toId: string;
id?: string;
editable?: boolean;
}
export declare interface CrossTableData {
headerTop: CrossTableHeader[];
headerLeft: CrossTableHeader[];
data: (CrossTableCell | null)[][];
}
export declare interface CrossTableHeader {
id: string;
label: string;
}
export declare function DataCrossTable({ crossTableData, filterable, loading, emptyComponent, className, notFoundMessage, cornerHeaderFrom, cornerHeaderTo, minWidthCell, editable, editMode, onEditModeChange, onSelectedRow, selectedRow, rowSortAsc, }: DataCrossTableProps): JSX.Element;
export declare const DataCrossTableButtonsGroup: default_2.FC<DataCrossTableButtonsGroupProps>;
export declare interface DataCrossTableButtonsGroupProps {
className?: string;
}
declare interface DataCrossTableContextType {
editedCells: Record<string, {
value: any;
cell: CrossTableCell;
}>;
setEditedCells: default_2.Dispatch<default_2.SetStateAction<Record<string, {
value: any;
cell: CrossTableCell;
}>>>;
toDefaultCells: Record<string, {
value: any;
cell: CrossTableCell;
}>;
setToDefaultCells: default_2.Dispatch<default_2.SetStateAction<Record<string, {
value: any;
cell: CrossTableCell;
}>>>;
editMode: boolean;
setEditMode: (mode: boolean) => void;
onConfirmedCells?: (data: ConfirmedCellsData) => void;
editConfirmLabel: string;
editCancelLabel: string;
editRestoreDefaultLabel: string;
showDefaultActionButton: boolean;
cellEditTitleLabel: string;
cellEditModifiedLabel: string;
cellConfirmButtonLabel: string;
cellCancelButtonLabel: string;
cellResetButtonLabel: string;
}
export declare interface DataCrossTableProps {
crossTableData: CrossTableData;
filterable?: boolean;
loading?: boolean;
emptyComponent?: ReactNode;
c