eai-frontend-components 2.0.18 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -80,7 +80,7 @@ declare const AvatarImage: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitiv
80
80
  declare const AvatarFallback: React$1.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
81
81
 
82
82
  declare const badgeVariants: (props?: ({
83
- variant?: "default" | "secondary" | "surface" | "destructive" | "outline" | "green" | "red" | "gray" | "blue" | "orange" | null | undefined;
83
+ variant?: "default" | "outline" | "destructive" | "secondary" | "surface" | "green" | "red" | "gray" | "blue" | "orange" | null | undefined;
84
84
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
85
85
  interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
86
86
  }
@@ -105,7 +105,7 @@ declare const BreadcrumbEllipsis: {
105
105
  };
106
106
 
107
107
  declare const buttonVariants: (props?: ({
108
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
108
+ variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
109
109
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
110
110
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
111
111
  interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -208,7 +208,7 @@ declare const Command: React$1.ForwardRefExoticComponent<Omit<{
208
208
  ref?: React$1.Ref<HTMLDivElement>;
209
209
  } & {
210
210
  asChild?: boolean;
211
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
211
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
212
212
  label?: string;
213
213
  shouldFilter?: boolean;
214
214
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -224,7 +224,7 @@ declare const CommandInput: React$1.ForwardRefExoticComponent<Omit<Omit<Pick<Pic
224
224
  ref?: React$1.Ref<HTMLInputElement>;
225
225
  } & {
226
226
  asChild?: boolean;
227
- }, "key" | "asChild" | keyof React$1.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
227
+ }, "key" | "asChild" | keyof React$1.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
228
228
  value?: string;
229
229
  onValueChange?: (search: string) => void;
230
230
  } & React$1.RefAttributes<HTMLInputElement>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
@@ -234,7 +234,7 @@ declare const CommandList: React$1.ForwardRefExoticComponent<Omit<{
234
234
  ref?: React$1.Ref<HTMLDivElement>;
235
235
  } & {
236
236
  asChild?: boolean;
237
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
237
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
238
238
  label?: string;
239
239
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
240
240
  declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
@@ -243,14 +243,14 @@ declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
243
243
  ref?: React$1.Ref<HTMLDivElement>;
244
244
  } & {
245
245
  asChild?: boolean;
246
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
246
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
247
247
  declare const CommandGroup: React$1.ForwardRefExoticComponent<Omit<{
248
248
  children?: React$1.ReactNode;
249
249
  } & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
250
250
  ref?: React$1.Ref<HTMLDivElement>;
251
251
  } & {
252
252
  asChild?: boolean;
253
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
253
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
254
254
  heading?: React$1.ReactNode;
255
255
  value?: string;
256
256
  forceMount?: boolean;
@@ -259,7 +259,7 @@ declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick
259
259
  ref?: React$1.Ref<HTMLDivElement>;
260
260
  } & {
261
261
  asChild?: boolean;
262
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
262
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
263
263
  alwaysRender?: boolean;
264
264
  } & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
265
265
  declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
@@ -268,7 +268,7 @@ declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
268
268
  ref?: React$1.Ref<HTMLDivElement>;
269
269
  } & {
270
270
  asChild?: boolean;
271
- }, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
271
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "onSelect" | "value" | "disabled"> & {
272
272
  disabled?: boolean;
273
273
  onSelect?: (value: string) => void;
274
274
  value?: string;
@@ -408,8 +408,93 @@ declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefA
408
408
 
409
409
  declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
410
410
 
411
+ /**
412
+ * Type for mask modification functions.
413
+ * Fallback for projects without @react-input/mask types.
414
+ */
415
+ type MaskModifyFunction = Modify;
416
+ /**
417
+ * Modify function for phone number input mask.
418
+ * Automatically adjusts between landline and mobile phone formats.
419
+ *
420
+ * @param value - Current input value
421
+ * @param data - New input data
422
+ * @param selectionStart - Cursor start position
423
+ * @param selectionEnd - Cursor end position
424
+ * @returns Mask configuration object
425
+ */
411
426
  declare const modifyPhone: Modify;
427
+ /**
428
+ * Creates a phone number mask based on the input length.
429
+ * - Landline: (XX) XXXX-XXXX
430
+ * - Mobile: (XX) X XXXX-XXXX
431
+ *
432
+ * @param value - Phone number string (can be null)
433
+ * @returns Mask configuration object with pattern and replacement rules
434
+ *
435
+ * @example
436
+ * ```tsx
437
+ * const mask = maskPhone('11987654321');
438
+ * // Returns: { mask: '(__) _ ____-____', replacement: { _: /\d/ } }
439
+ * ```
440
+ */
441
+ declare function maskPhone(value: string | null): {
442
+ mask: string;
443
+ replacement: {
444
+ _: RegExp;
445
+ };
446
+ };
447
+ /**
448
+ * Modify function for CPF/CNPJ input mask.
449
+ * Automatically switches between CPF and CNPJ formats based on input length.
450
+ *
451
+ * @param value - Current input value
452
+ * @param data - New input data
453
+ * @param selectionStart - Cursor start position
454
+ * @param selectionEnd - Cursor end position
455
+ * @returns Mask configuration object
456
+ */
412
457
  declare const modifyCpfCnpj: Modify;
458
+ /**
459
+ * Creates a CPF or CNPJ mask based on the input length.
460
+ * - CPF: XXX.XXX.XXX-XX (up to 11 digits)
461
+ * - CNPJ: XX.XXX.XXX/XXXX-XX (12+ digits)
462
+ *
463
+ * @param value - CPF/CNPJ string (can be null)
464
+ * @returns Mask configuration object with pattern and replacement rules
465
+ *
466
+ * @example
467
+ * ```tsx
468
+ * const cpfMask = maskCpfCnpj('12345678901');
469
+ * // Returns: { mask: '___.___.___-___', replacement: { _: /\d/ } }
470
+ *
471
+ * const cnpjMask = maskCpfCnpj('12345678000195');
472
+ * // Returns: { mask: '__.___.___/____-__', replacement: { _: /\d/ } }
473
+ * ```
474
+ */
475
+ declare function maskCpfCnpj(value: string | null): {
476
+ mask: string;
477
+ replacement: {
478
+ _: RegExp;
479
+ };
480
+ };
481
+ /**
482
+ * Removes all non-numeric characters from a string.
483
+ * Useful for extracting only digits from masked inputs.
484
+ *
485
+ * @param value - String with potential mask characters
486
+ * @returns String containing only numeric characters
487
+ *
488
+ * @example
489
+ * ```tsx
490
+ * const cleaned = removeMaskNumber('(11) 9 8765-4321');
491
+ * // Returns: '11987654321'
492
+ *
493
+ * const cleanCpf = removeMaskNumber('123.456.789-01');
494
+ * // Returns: '12345678901'
495
+ * ```
496
+ */
497
+ declare const removeMaskNumber: (value: string) => string;
413
498
 
414
499
  declare const Pagination: {
415
500
  ({ className, ...props }: React$1.ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
@@ -808,7 +893,7 @@ interface Props$8 {
808
893
  declare const FormInputMask: React.FC<Props$8>;
809
894
 
810
895
  declare const multiSelectVariants: (props?: ({
811
- variant?: "default" | "secondary" | "destructive" | "inverted" | null | undefined;
896
+ variant?: "default" | "destructive" | "secondary" | "inverted" | null | undefined;
812
897
  } & class_variance_authority_dist_types.ClassProp) | undefined) => string;
813
898
  interface MultiSelectOption {
814
899
  value: string;
@@ -1535,5 +1620,5 @@ declare const addDaysToToday: (days: number) => Date;
1535
1620
 
1536
1621
  declare function isUUIDv4(str: string): boolean;
1537
1622
 
1538
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_THEME_DATA, DataTable, DataTableExport, DataTableFooter, DataTableHeader, DataTableRows, DatePickerWithRange as DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormCombobox, FormControl, FormDataRange, FormDescription, FormField, FormInput, FormInputCheckbox, FormInputColor, FormInputCpfCnpj, FormInputCurrency, FormInputDate, FormInputDecimal, FormInputFile, FormInputGhost, FormInputMask, FormInputPassWord, FormInputPercent, FormInputPhone, FormInputSwitch, FormInputText, FormItem, FormLabel, FormMessage, FormRadioGroup, FormSelect, FormTextarea, Header, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, LabelWithTitle, ModuleSwitcher, MultiSelect, NavFooter, NavMain, NavSubmenuCollapsible, NavSubmenuDropdown, NavUser, NotFound, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarItem, SidebarItemTwoLines, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarSubmenuType, SidebarTrigger, Skeleton, Slider, StepNewForm, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast$1 as Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UseCalendar, aYearAgo, addDaysToToday, badgeVariants, buttonVariants, cn, convertBytesToMB, convertDaysToMonth, convertGbToMb, convertMbToGb, convertMonthToDays, convertSecondsToMinutes, formHelpText, formLabel, formLabelAndSubLabel, formMessage, formatCpfCnpj, formatDate, formatDateCalendar, formatDateTime, formatDecimal, formatNumber, formatPhone, getFirstDayOf90DaysAgo, getFirstDayOfCurrentMonth, getTailwindColorShades, invertDate, isUUIDv4, modifyCpfCnpj, modifyPhone, replaceThemeTailwindColors, roundNumber, stringDateToDate, stringToDate, stringToNumber, toast, useFormField, useSidebar, useTheme, useToast };
1539
- export type { ActionRow, ActionTable, ButtonProps, CalendarProps, CarouselApi, ComboboxOption, DataTableProps, ExportDataTable, FiltersActions, Module, MultiSelectOption, OriginalDataTableData, PropsStepNewForm, RadioOption, SelectOption, SidebarPage, TailwindColorName };
1623
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_THEME_DATA, DataTable, DataTableExport, DataTableFooter, DataTableHeader, DataTableRows, DatePickerWithRange as DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormCombobox, FormControl, FormDataRange, FormDescription, FormField, FormInput, FormInputCheckbox, FormInputColor, FormInputCpfCnpj, FormInputCurrency, FormInputDate, FormInputDecimal, FormInputFile, FormInputGhost, FormInputMask, FormInputPassWord, FormInputPercent, FormInputPhone, FormInputSwitch, FormInputText, FormItem, FormLabel, FormMessage, FormRadioGroup, FormSelect, FormTextarea, Header, HoverCard, HoverCardContent, HoverCardTrigger, Input, Label, LabelWithTitle, ModuleSwitcher, MultiSelect, NavFooter, NavMain, NavSubmenuCollapsible, NavSubmenuDropdown, NavUser, NotFound, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarItem, SidebarItemTwoLines, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarSubmenuType, SidebarTrigger, Skeleton, Slider, StepNewForm, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast$1 as Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UseCalendar, aYearAgo, addDaysToToday, badgeVariants, buttonVariants, cn, convertBytesToMB, convertDaysToMonth, convertGbToMb, convertMbToGb, convertMonthToDays, convertSecondsToMinutes, formHelpText, formLabel, formLabelAndSubLabel, formMessage, formatCpfCnpj, formatDate, formatDateCalendar, formatDateTime, formatDecimal, formatNumber, formatPhone, getFirstDayOf90DaysAgo, getFirstDayOfCurrentMonth, getTailwindColorShades, invertDate, isUUIDv4, maskCpfCnpj, maskPhone, modifyCpfCnpj, modifyPhone, removeMaskNumber, replaceThemeTailwindColors, roundNumber, stringDateToDate, stringToDate, stringToNumber, toast, useFormField, useSidebar, useTheme, useToast };
1624
+ export type { ActionRow, ActionTable, ButtonProps, CalendarProps, CarouselApi, ChartConfig, ComboboxOption, DataTableProps, ExportDataTable, FiltersActions, MaskModifyFunction, Module, MultiSelectOption, OriginalDataTableData, PropsStepNewForm, RadioOption, SelectOption, SidebarPage, TailwindColorName };