eai-frontend-components 2.0.20 → 2.0.22

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
@@ -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" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "onSelect" | "value" | "disabled"> & {
271
+ }, "key" | "asChild" | keyof React$1.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
272
272
  disabled?: boolean;
273
273
  onSelect?: (value: string) => void;
274
274
  value?: string;
@@ -1012,6 +1012,7 @@ interface Props$2 {
1012
1012
  control: any;
1013
1013
  name: string;
1014
1014
  label: string;
1015
+ topLabel?: string;
1015
1016
  subLabel?: string;
1016
1017
  helpText?: JSX.Element;
1017
1018
  className?: string;
@@ -1594,8 +1595,48 @@ declare function getTailwindColorShades(): {
1594
1595
  type TailwindColorName = keyof ReturnType<typeof getTailwindColorShades>;
1595
1596
  declare const replaceThemeTailwindColors: (theme: string, tailwindColor: string) => HTMLStyleElement;
1596
1597
 
1598
+ /**
1599
+ * Formats a phone number string with proper mask.
1600
+ * Automatically detects landline vs mobile format.
1601
+ *
1602
+ * @param telefone - Raw phone number string
1603
+ * @param removerCountryCode - Whether to remove country code (55) if present
1604
+ * @returns Formatted phone number string
1605
+ *
1606
+ * @example
1607
+ * ```tsx
1608
+ * formatPhone('11987654321') // '(11) 9 8765-4321'
1609
+ * formatPhone('1134567890') // '(11) 3456-7890'
1610
+ * ```
1611
+ */
1597
1612
  declare function formatPhone(telefone: string, removerCountryCode?: boolean): string;
1613
+ /**
1614
+ * Formats a CPF or CNPJ string with proper mask.
1615
+ * Automatically detects CPF vs CNPJ format based on length.
1616
+ *
1617
+ * @param cpfCnpj - Raw CPF/CNPJ string
1618
+ * @returns Formatted CPF/CNPJ string
1619
+ *
1620
+ * @example
1621
+ * ```tsx
1622
+ * formatCpfCnpj('12345678901') // '123.456.789-01'
1623
+ * formatCpfCnpj('12345678000195') // '12.345.678/0001-95'
1624
+ * ```
1625
+ */
1598
1626
  declare function formatCpfCnpj(cpfCnpj?: string): string;
1627
+ /**
1628
+ * Formats a date to Brazilian format (DD/MM/YYYY).
1629
+ *
1630
+ * @param date - Date string, Date object, or undefined
1631
+ * @param separator - Date separator (default: '/')
1632
+ * @returns Formatted date string in Brazilian format
1633
+ *
1634
+ * @example
1635
+ * ```tsx
1636
+ * formatDate('2023-12-25') // '25/12/2023'
1637
+ * formatDate(new Date()) // '13/10/2025'
1638
+ * ```
1639
+ */
1599
1640
  declare const formatDate: (date: string | Date | undefined, separator?: string) => string;
1600
1641
  declare const formatDateTime: (date: Date | undefined, returnSeconds?: boolean) => string;
1601
1642
  declare function formatDateCalendar(date: Date | undefined): string;
@@ -1609,7 +1650,74 @@ declare const convertBytesToMB: (bytes: number) => number;
1609
1650
  declare const convertMonthToDays: (months: number) => number;
1610
1651
  declare const convertDaysToMonth: (days: number) => number;
1611
1652
  declare const formatNumber: (value: number) => string;
1653
+ /**
1654
+ * Formats a number with Brazilian decimal format.
1655
+ *
1656
+ * @param value - Numeric value to format
1657
+ * @param decimalPlaces - Number of decimal places (default: 2)
1658
+ * @returns Formatted decimal string
1659
+ *
1660
+ * @example
1661
+ * ```tsx
1662
+ * formatDecimal(1234.56) // '1.234,56'
1663
+ * formatDecimal(1000.1, 1) // '1.000,1'
1664
+ * ```
1665
+ */
1612
1666
  declare const formatDecimal: (value: number, decimalPlaces?: number) => string;
1667
+ /**
1668
+ * Formats a number as percentage with Brazilian decimal format.
1669
+ *
1670
+ * @param value - Numeric value to format
1671
+ * @param decimalPlaces - Number of decimal places (default: 2)
1672
+ * @returns Formatted percentage string
1673
+ *
1674
+ * @example
1675
+ * ```tsx
1676
+ * formatPercent(15.5) // '% 15,50'
1677
+ * formatPercent(100, 0) // '% 100'
1678
+ * ```
1679
+ */
1680
+ declare const formatPercent: (value: number, decimalPlaces?: number) => string;
1681
+ /**
1682
+ * Formats a number as Brazilian currency (BRL).
1683
+ *
1684
+ * @param value - Numeric value to format
1685
+ * @param decimalPlaces - Number of decimal places (default: 2)
1686
+ * @returns Formatted currency string
1687
+ *
1688
+ * @example
1689
+ * ```tsx
1690
+ * formatCurrency(1234.56) // 'R$ 1.234,56'
1691
+ * formatCurrency(1000, 0) // 'R$ 1.000'
1692
+ * ```
1693
+ */
1694
+ declare const formatCurrency: (value: number, decimalPlaces?: number) => string;
1695
+ declare const isInvalidCurrencyValue: (rawValue: string | undefined) => boolean;
1696
+ /**
1697
+ * Formats an MSISDN (mobile phone number) to display format.
1698
+ *
1699
+ * @param value - Raw MSISDN string
1700
+ * @returns Formatted MSISDN string
1701
+ *
1702
+ * @example
1703
+ * ```tsx
1704
+ * formatMsisdn('5511987654321') // '(11) 98765-4321'
1705
+ * ```
1706
+ */
1707
+ declare function formatMsisdn(value?: string): string;
1708
+ /**
1709
+ * Formats a CEP (Brazilian postal code) with proper mask.
1710
+ *
1711
+ * @param cep - Raw CEP string
1712
+ * @returns Formatted CEP string (XXXXX-XXX)
1713
+ *
1714
+ * @example
1715
+ * ```tsx
1716
+ * formatCEP('01234567') // '01234-567'
1717
+ * formatCEP('12345') // '12345'
1718
+ * ```
1719
+ */
1720
+ declare function formatCEP(cep?: string): string;
1613
1721
 
1614
1722
  declare const getFirstDayOfCurrentMonth: () => Date;
1615
1723
  declare const getFirstDayOf90DaysAgo: () => Date;
@@ -1620,5 +1728,5 @@ declare const addDaysToToday: (days: number) => Date;
1620
1728
 
1621
1729
  declare function isUUIDv4(str: string): boolean;
1622
1730
 
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 };
1731
+ 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, formatCEP, formatCpfCnpj, formatCurrency, formatDate, formatDateCalendar, formatDateTime, formatDecimal, formatMsisdn, formatNumber, formatPercent, formatPhone, getFirstDayOf90DaysAgo, getFirstDayOfCurrentMonth, getTailwindColorShades, invertDate, isInvalidCurrencyValue, isUUIDv4, maskCpfCnpj, maskPhone, modifyCpfCnpj, modifyPhone, removeMaskNumber, replaceThemeTailwindColors, roundNumber, stringDateToDate, stringToDate, stringToNumber, toast, useFormField, useSidebar, useTheme, useToast };
1624
1732
  export type { ActionRow, ActionTable, ButtonProps, CalendarProps, CarouselApi, ChartConfig, ComboboxOption, DataTableProps, ExportDataTable, FiltersActions, MaskModifyFunction, Module, MultiSelectOption, OriginalDataTableData, PropsStepNewForm, RadioOption, SelectOption, SidebarPage, TailwindColorName };