@facter/ds-core 1.16.0 → 1.18.0

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.mts CHANGED
@@ -360,6 +360,8 @@ interface DataTableSearchProps {
360
360
  interface DataTableFiltersProps {
361
361
  /** Children: Individual filters */
362
362
  children?: React$1.ReactNode;
363
+ /** Callback when any column filter changes (server-side filtering) */
364
+ onChange?: (filters: _tanstack_react_table.ColumnFiltersState) => void;
363
365
  /** Custom className */
364
366
  className?: string;
365
367
  }
@@ -369,14 +371,16 @@ interface DataTableFilterOption {
369
371
  icon?: React$1.ReactNode;
370
372
  }
371
373
  interface DataTableFilterProps {
372
- /** Coluna para filtrar */
373
- column: string;
374
+ /** Coluna para filtrar (opcional para server-side only) */
375
+ column?: string;
374
376
  /** Label do filtro */
375
377
  title: string;
376
378
  /** Opções de filtro */
377
379
  options: DataTableFilterOption[];
378
380
  /** Permitir seleção múltipla */
379
381
  multiSelect?: boolean;
382
+ /** Callback para server-side filtering (recebe valor selecionado ou undefined para "todos") */
383
+ onValueChange?: (value: string | undefined) => void;
380
384
  /** Custom className */
381
385
  className?: string;
382
386
  }
@@ -389,6 +393,14 @@ interface DataTableContentProps {
389
393
  highlightOnHover?: boolean;
390
394
  /** Callback quando uma row é clicada */
391
395
  onRowClick?: (row: unknown) => void;
396
+ /**
397
+ * Habilita scroll vertical com altura calculada automaticamente.
398
+ * O header das colunas fica sticky e apenas as rows fazem scroll.
399
+ * O bottomOffset controla a margem inferior (default: 16px).
400
+ */
401
+ scrollable?: boolean;
402
+ /** Margem inferior em px para o cálculo de altura automática (default: 16) */
403
+ scrollBottomOffset?: number;
392
404
  /** Custom className */
393
405
  className?: string;
394
406
  }
@@ -2669,6 +2681,40 @@ declare const StatsCard: typeof StatsCardRoot & {
2669
2681
  Today: typeof StatsCardToday;
2670
2682
  };
2671
2683
 
2684
+ interface UseAvailableHeightOptions {
2685
+ /** Bottom margin in pixels (default: 16) */
2686
+ bottomOffset?: number;
2687
+ /** Minimum height in pixels (default: 200) */
2688
+ minHeight?: number;
2689
+ /** Whether the calculation is enabled (default: true) */
2690
+ enabled?: boolean;
2691
+ }
2692
+ /**
2693
+ * Hook that calculates the available height from an element's top position
2694
+ * to the bottom of the viewport. Useful for making containers fill remaining space.
2695
+ *
2696
+ * Recalculates on window resize automatically.
2697
+ *
2698
+ * @example
2699
+ * ```tsx
2700
+ * function MyTable() {
2701
+ * const { ref, height } = useAvailableHeight({ bottomOffset: 32 })
2702
+ * return (
2703
+ * <div ref={ref} style={{ maxHeight: height }}>
2704
+ * {content}
2705
+ * </div>
2706
+ * )
2707
+ * }
2708
+ * ```
2709
+ */
2710
+ declare function useAvailableHeight<T extends HTMLElement = HTMLDivElement>(options?: UseAvailableHeightOptions): {
2711
+ ref: React$1.RefObject<T | null>;
2712
+ height: number | undefined;
2713
+ style: {
2714
+ maxHeight: string;
2715
+ } | undefined;
2716
+ };
2717
+
2672
2718
  type Theme = 'dark' | 'light' | 'system';
2673
2719
  interface ThemeProviderProps {
2674
2720
  children: React$1.ReactNode;
@@ -2691,4 +2737,4 @@ declare const useTheme: () => ThemeProviderState;
2691
2737
  */
2692
2738
  declare function cn(...inputs: ClassValue[]): string;
2693
2739
 
2694
- export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
2740
+ export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useAvailableHeight, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
package/dist/index.d.ts CHANGED
@@ -360,6 +360,8 @@ interface DataTableSearchProps {
360
360
  interface DataTableFiltersProps {
361
361
  /** Children: Individual filters */
362
362
  children?: React$1.ReactNode;
363
+ /** Callback when any column filter changes (server-side filtering) */
364
+ onChange?: (filters: _tanstack_react_table.ColumnFiltersState) => void;
363
365
  /** Custom className */
364
366
  className?: string;
365
367
  }
@@ -369,14 +371,16 @@ interface DataTableFilterOption {
369
371
  icon?: React$1.ReactNode;
370
372
  }
371
373
  interface DataTableFilterProps {
372
- /** Coluna para filtrar */
373
- column: string;
374
+ /** Coluna para filtrar (opcional para server-side only) */
375
+ column?: string;
374
376
  /** Label do filtro */
375
377
  title: string;
376
378
  /** Opções de filtro */
377
379
  options: DataTableFilterOption[];
378
380
  /** Permitir seleção múltipla */
379
381
  multiSelect?: boolean;
382
+ /** Callback para server-side filtering (recebe valor selecionado ou undefined para "todos") */
383
+ onValueChange?: (value: string | undefined) => void;
380
384
  /** Custom className */
381
385
  className?: string;
382
386
  }
@@ -389,6 +393,14 @@ interface DataTableContentProps {
389
393
  highlightOnHover?: boolean;
390
394
  /** Callback quando uma row é clicada */
391
395
  onRowClick?: (row: unknown) => void;
396
+ /**
397
+ * Habilita scroll vertical com altura calculada automaticamente.
398
+ * O header das colunas fica sticky e apenas as rows fazem scroll.
399
+ * O bottomOffset controla a margem inferior (default: 16px).
400
+ */
401
+ scrollable?: boolean;
402
+ /** Margem inferior em px para o cálculo de altura automática (default: 16) */
403
+ scrollBottomOffset?: number;
392
404
  /** Custom className */
393
405
  className?: string;
394
406
  }
@@ -2669,6 +2681,40 @@ declare const StatsCard: typeof StatsCardRoot & {
2669
2681
  Today: typeof StatsCardToday;
2670
2682
  };
2671
2683
 
2684
+ interface UseAvailableHeightOptions {
2685
+ /** Bottom margin in pixels (default: 16) */
2686
+ bottomOffset?: number;
2687
+ /** Minimum height in pixels (default: 200) */
2688
+ minHeight?: number;
2689
+ /** Whether the calculation is enabled (default: true) */
2690
+ enabled?: boolean;
2691
+ }
2692
+ /**
2693
+ * Hook that calculates the available height from an element's top position
2694
+ * to the bottom of the viewport. Useful for making containers fill remaining space.
2695
+ *
2696
+ * Recalculates on window resize automatically.
2697
+ *
2698
+ * @example
2699
+ * ```tsx
2700
+ * function MyTable() {
2701
+ * const { ref, height } = useAvailableHeight({ bottomOffset: 32 })
2702
+ * return (
2703
+ * <div ref={ref} style={{ maxHeight: height }}>
2704
+ * {content}
2705
+ * </div>
2706
+ * )
2707
+ * }
2708
+ * ```
2709
+ */
2710
+ declare function useAvailableHeight<T extends HTMLElement = HTMLDivElement>(options?: UseAvailableHeightOptions): {
2711
+ ref: React$1.RefObject<T | null>;
2712
+ height: number | undefined;
2713
+ style: {
2714
+ maxHeight: string;
2715
+ } | undefined;
2716
+ };
2717
+
2672
2718
  type Theme = 'dark' | 'light' | 'system';
2673
2719
  interface ThemeProviderProps {
2674
2720
  children: React$1.ReactNode;
@@ -2691,4 +2737,4 @@ declare const useTheme: () => ThemeProviderState;
2691
2737
  */
2692
2738
  declare function cn(...inputs: ClassValue[]): string;
2693
2739
 
2694
- export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
2740
+ export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useAvailableHeight, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
package/dist/index.js CHANGED
@@ -1423,6 +1423,32 @@ var DENSITY_CONFIG = {
1423
1423
  padding: "py-3 px-4"
1424
1424
  }
1425
1425
  };
1426
+ function useAvailableHeight(options = {}) {
1427
+ const { bottomOffset = 16, minHeight = 200, enabled = true } = options;
1428
+ const ref = React10.useRef(null);
1429
+ const [height, setHeight] = React10.useState(void 0);
1430
+ const calculate = React10.useCallback(() => {
1431
+ const el = ref.current;
1432
+ if (!el || !enabled) return;
1433
+ const rect = el.getBoundingClientRect();
1434
+ const available = window.innerHeight - rect.top - bottomOffset;
1435
+ setHeight(Math.max(minHeight, Math.round(available)));
1436
+ }, [bottomOffset, minHeight, enabled]);
1437
+ React10.useEffect(() => {
1438
+ if (!enabled) return;
1439
+ const frame = requestAnimationFrame(calculate);
1440
+ window.addEventListener("resize", calculate);
1441
+ return () => {
1442
+ cancelAnimationFrame(frame);
1443
+ window.removeEventListener("resize", calculate);
1444
+ };
1445
+ }, [calculate, enabled]);
1446
+ return {
1447
+ ref,
1448
+ height,
1449
+ style: height ? { maxHeight: `${height}px` } : void 0
1450
+ };
1451
+ }
1426
1452
  var Table = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
1427
1453
  "table",
1428
1454
  {
@@ -1506,6 +1532,8 @@ var DataTableContent = React10__namespace.memo(function DataTableContent2({
1506
1532
  stripedRows = false,
1507
1533
  highlightOnHover = true,
1508
1534
  onRowClick,
1535
+ scrollable = false,
1536
+ scrollBottomOffset = 16,
1509
1537
  className
1510
1538
  }) {
1511
1539
  const table = useDataTable();
@@ -1513,10 +1541,15 @@ var DataTableContent = React10__namespace.memo(function DataTableContent2({
1513
1541
  const { density } = useDataTableDensity();
1514
1542
  const { config: emptyStateConfig } = useDataTableEmptyStateConfig();
1515
1543
  const { isLoading, skeletonRows } = useDataTableLoadingState();
1544
+ const { ref, style: scrollStyle } = useAvailableHeight({
1545
+ bottomOffset: scrollBottomOffset,
1546
+ enabled: scrollable
1547
+ });
1516
1548
  const densityStyles = DENSITY_CONFIG[density];
1517
1549
  const cellClasses = cn(densityStyles.padding, densityStyles.fontSize);
1518
1550
  const columnCount = table.getVisibleLeafColumns().length;
1519
1551
  const hasRows = table.getRowModel().rows?.length > 0;
1552
+ const effectiveStickyHeader = stickyHeader || scrollable;
1520
1553
  if (!hasRows && isEmpty && !isLoading) {
1521
1554
  return /* @__PURE__ */ jsxRuntime.jsx(
1522
1555
  EmptyState,
@@ -1528,34 +1561,50 @@ var DataTableContent = React10__namespace.memo(function DataTableContent2({
1528
1561
  }
1529
1562
  );
1530
1563
  }
1531
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("rounded-md overflow-auto bg-card", className), children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
1532
- /* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: cn(stickyHeader && "sticky top-0 z-10 bg-background"), children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(
1533
- TableHead,
1534
- {
1535
- className: cn(cellClasses, "font-medium"),
1536
- style: { width: header.getSize() !== 150 ? header.getSize() : void 0 },
1537
- children: header.isPlaceholder ? null : reactTable.flexRender(
1538
- header.column.columnDef.header,
1539
- header.getContext()
1540
- )
1541
- },
1542
- header.id
1543
- )) }, headerGroup.id)) }),
1544
- /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: isLoading ? Array.from({ length: skeletonRows }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { className: "animate-pulse", children: Array.from({ length: columnCount || 4 }).map((_2, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-muted rounded w-3/4" }) }, colIndex)) }, `skeleton-${index}`)) : table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
1545
- TableRow,
1546
- {
1547
- "data-state": row.getIsSelected() && "selected",
1548
- className: cn(
1549
- highlightOnHover && "hover:bg-muted/50",
1550
- stripedRows && index % 2 === 1 && "bg-muted/30",
1551
- onRowClick && "cursor-pointer"
1564
+ return /* @__PURE__ */ jsxRuntime.jsx(
1565
+ "div",
1566
+ {
1567
+ ref,
1568
+ className: cn("rounded-md overflow-auto bg-card", className),
1569
+ style: scrollStyle,
1570
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Table, { children: [
1571
+ /* @__PURE__ */ jsxRuntime.jsx(
1572
+ TableHeader,
1573
+ {
1574
+ className: cn(
1575
+ effectiveStickyHeader && "sticky top-0 z-10 bg-background shadow-[0_1px_0_0_hsl(var(--border))]"
1576
+ ),
1577
+ children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(
1578
+ TableHead,
1579
+ {
1580
+ className: cn(cellClasses, "font-medium"),
1581
+ style: { width: header.getSize() !== 150 ? header.getSize() : void 0 },
1582
+ children: header.isPlaceholder ? null : reactTable.flexRender(
1583
+ header.column.columnDef.header,
1584
+ header.getContext()
1585
+ )
1586
+ },
1587
+ header.id
1588
+ )) }, headerGroup.id))
1589
+ }
1552
1590
  ),
1553
- onClick: onRowClick ? () => onRowClick(row) : void 0,
1554
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
1555
- },
1556
- row.id
1557
- )) })
1558
- ] }) });
1591
+ /* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: isLoading ? Array.from({ length: skeletonRows }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { className: "animate-pulse", children: Array.from({ length: columnCount || 4 }).map((_2, colIndex) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 bg-muted rounded w-3/4" }) }, colIndex)) }, `skeleton-${index}`)) : table.getRowModel().rows.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
1592
+ TableRow,
1593
+ {
1594
+ "data-state": row.getIsSelected() && "selected",
1595
+ className: cn(
1596
+ highlightOnHover && "hover:bg-muted/50",
1597
+ stripedRows && index % 2 === 1 && "bg-muted/30",
1598
+ onRowClick && "cursor-pointer"
1599
+ ),
1600
+ onClick: onRowClick ? () => onRowClick(row) : void 0,
1601
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: cellClasses, children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
1602
+ },
1603
+ row.id
1604
+ )) })
1605
+ ] })
1606
+ }
1607
+ );
1559
1608
  });
1560
1609
  DataTableContent.displayName = "DataTable.Content";
1561
1610
  var DataTableToolbar = React10__namespace.memo(function DataTableToolbar2({
@@ -1602,32 +1651,38 @@ var DataTableSearch = React10__namespace.memo(function DataTableSearch2({
1602
1651
  className
1603
1652
  }) {
1604
1653
  const table = useDataTableInstance();
1605
- const columnInstance = table.getColumn(column);
1654
+ const columnInstance = column ? table.getColumn(column) : null;
1606
1655
  const [value, setValue] = React10__namespace.useState(
1607
1656
  columnInstance?.getFilterValue() ?? ""
1608
1657
  );
1609
1658
  const debouncedValue = useDebounce(value, debounce);
1610
1659
  React10__namespace.useEffect(() => {
1611
- columnInstance?.setFilterValue(debouncedValue);
1660
+ if (columnInstance) {
1661
+ columnInstance.setFilterValue(debouncedValue || void 0);
1662
+ }
1612
1663
  if (onSearch) {
1613
1664
  onSearch(debouncedValue);
1614
1665
  }
1615
1666
  }, [debouncedValue, columnInstance, onSearch]);
1616
1667
  React10__namespace.useEffect(() => {
1617
- const filterValue = columnInstance?.getFilterValue() ?? "";
1668
+ if (!columnInstance) return;
1669
+ const filterValue = columnInstance.getFilterValue() ?? "";
1618
1670
  if (filterValue !== value) {
1619
1671
  setValue(filterValue);
1620
1672
  }
1621
1673
  }, [columnInstance?.getFilterValue()]);
1622
- return /* @__PURE__ */ jsxRuntime.jsx(
1623
- Input,
1624
- {
1625
- placeholder,
1626
- value,
1627
- onChange: (e) => setValue(e.target.value),
1628
- className: cn("h-9 w-[150px] lg:w-[250px]", className)
1629
- }
1630
- );
1674
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative w-[150px] lg:w-[250px]", className), children: [
1675
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" }),
1676
+ /* @__PURE__ */ jsxRuntime.jsx(
1677
+ Input,
1678
+ {
1679
+ placeholder,
1680
+ value,
1681
+ onChange: (e) => setValue(e.target.value),
1682
+ className: "h-9 pl-9"
1683
+ }
1684
+ )
1685
+ ] });
1631
1686
  });
1632
1687
  var DataTableFilters = React10__namespace.memo(function DataTableFilters2({
1633
1688
  onChange,
@@ -1649,21 +1704,26 @@ var DataTableFilter = React10__namespace.memo(function DataTableFilter2({
1649
1704
  column: columnId,
1650
1705
  title,
1651
1706
  options,
1707
+ onValueChange: onServerValueChange,
1652
1708
  className
1653
1709
  }) {
1654
1710
  const table = useDataTableInstance();
1655
- const column = table.getColumn(columnId);
1711
+ const column = columnId ? table.getColumn(columnId) : null;
1656
1712
  const filterValue = column?.getFilterValue() ?? [];
1657
- const currentValue = filterValue.length > 0 ? filterValue[0] : "all";
1713
+ const [localValue, setLocalValue] = React10__namespace.useState("all");
1714
+ const currentValue = column ? filterValue.length > 0 ? filterValue[0] : "all" : localValue;
1658
1715
  const handleValueChange = React10__namespace.useCallback(
1659
1716
  (value) => {
1660
- if (value === "all") {
1661
- column?.setFilterValue(void 0);
1662
- } else {
1663
- column?.setFilterValue([value]);
1717
+ const resolvedValue = value === "all" ? void 0 : value;
1718
+ if (column) {
1719
+ column.setFilterValue(resolvedValue ? [resolvedValue] : void 0);
1720
+ }
1721
+ if (onServerValueChange) {
1722
+ onServerValueChange(resolvedValue);
1664
1723
  }
1724
+ setLocalValue(value);
1665
1725
  },
1666
- [column]
1726
+ [column, onServerValueChange]
1667
1727
  );
1668
1728
  return /* @__PURE__ */ jsxRuntime.jsxs(
1669
1729
  Select,
@@ -8686,6 +8746,7 @@ exports.itemCardIconVariants = itemCardIconVariants;
8686
8746
  exports.itemCardVariants = itemCardVariants;
8687
8747
  exports.loader = loader;
8688
8748
  exports.toast = toast;
8749
+ exports.useAvailableHeight = useAvailableHeight;
8689
8750
  exports.useDashboardLayout = useDashboardLayout;
8690
8751
  exports.useDataTable = useDataTable;
8691
8752
  exports.useDataTableColumnVisibility = useDataTableColumnVisibility;