@nukleus-sports/ui-web 0.1.1 → 0.2.1

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.cts CHANGED
@@ -168,9 +168,10 @@ interface BaseTableProps$1<TData, TValue> {
168
168
  getRowClassName?: (row: TData, isRightPane?: boolean) => string;
169
169
  getRowProps?: (row: TData) => React$1.HTMLAttributes<HTMLTableRowElement>;
170
170
  /**
171
- * Optional content rendered after the last row INSIDE the scroll container
172
- * (standard layout only) — e.g. an infinite-scroll sentinel that must be
173
- * measured against the internal scroller rather than the viewport.
171
+ * Optional content rendered after the last row — e.g. an infinite-scroll sentinel. In the
172
+ * standard and fixed-header layouts it sits INSIDE the scroll container, so it's measured
173
+ * against the internal scroller; in split layout there is no internal vertical scroller (the
174
+ * page scrolls), so it renders just after the split grid and is measured against the viewport.
174
175
  */
175
176
  bottomContent?: React$1.ReactNode;
176
177
  }
@@ -1145,6 +1146,26 @@ declare function UndoToast({ toastId, title, description, itemCount, destination
1145
1146
  */
1146
1147
  declare function showUndoToast(options: ShowUndoToastOptions): string | number;
1147
1148
 
1149
+ interface UseInfiniteListOptions {
1150
+ /** Rows rendered on first paint and added per batch. */
1151
+ batchSize?: number;
1152
+ /** Distance from the sentinel at which the next batch is pulled in. */
1153
+ prefetchPx?: number;
1154
+ /** Dataset shape identity -- the window resets only when this changes, not on every refetch. */
1155
+ resetKey?: string | number;
1156
+ /** Scroll container ref, when the list scrolls inside a bounded element instead of the page. */
1157
+ scrollRootRef?: {
1158
+ current: HTMLElement | null;
1159
+ };
1160
+ }
1161
+ /** Client-side windowing over an in-memory array, pairing with `BaseTable` -- see RECONCILIATION.md. */
1162
+ declare function useInfiniteList<T>(items: T[], options?: UseInfiniteListOptions): {
1163
+ visibleItems: T[];
1164
+ sentinelRef: (node: HTMLDivElement | null) => void;
1165
+ hasMore: boolean;
1166
+ displayCount: number;
1167
+ };
1168
+
1148
1169
  declare function cn(...inputs: ClassValue[]): string;
1149
1170
 
1150
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, AvatarTableCell, Badge, type BadgeProps, BaseTable, BaseTasksTable, Button, type ButtonProps, Calendar, CalendarDayButton, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnSize, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FixedHeaderTable, FixedHeaderTableHeader, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconLoader, type IconLoaderProps, InfoCard, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, Loader, type LoaderProps, MobileModalLayout, MobileMultiSelect, MobileSkeleton, MultiSelect, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Pre, Progress, RadioGroup, RadioGroupItem, SafeTableCell, ScrollArea, ScrollBar, ScrollableTableContainer, ScrollableTableLeft, ScrollableTableRight, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type ShowUndoToastOptions, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SortableRowWrapper, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, type TableEmptyProps, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TaskColumnSize, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UndoToast, badgeVariants, buttonVariants, cn, columnSize, createClickableSortableHeader, createSortableHeader, showUndoToast, taskColumnSize, textareaVariants, toggleVariants, useFormField, useSidebar };
1171
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, AvatarTableCell, Badge, type BadgeProps, BaseTable, BaseTasksTable, Button, type ButtonProps, Calendar, CalendarDayButton, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnSize, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FixedHeaderTable, FixedHeaderTableHeader, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconLoader, type IconLoaderProps, InfoCard, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, Loader, type LoaderProps, MobileModalLayout, MobileMultiSelect, MobileSkeleton, MultiSelect, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Pre, Progress, RadioGroup, RadioGroupItem, SafeTableCell, ScrollArea, ScrollBar, ScrollableTableContainer, ScrollableTableLeft, ScrollableTableRight, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type ShowUndoToastOptions, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SortableRowWrapper, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, type TableEmptyProps, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TaskColumnSize, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UndoToast, badgeVariants, buttonVariants, cn, columnSize, createClickableSortableHeader, createSortableHeader, showUndoToast, taskColumnSize, textareaVariants, toggleVariants, useFormField, useInfiniteList, useSidebar };
package/dist/index.d.ts CHANGED
@@ -168,9 +168,10 @@ interface BaseTableProps$1<TData, TValue> {
168
168
  getRowClassName?: (row: TData, isRightPane?: boolean) => string;
169
169
  getRowProps?: (row: TData) => React$1.HTMLAttributes<HTMLTableRowElement>;
170
170
  /**
171
- * Optional content rendered after the last row INSIDE the scroll container
172
- * (standard layout only) — e.g. an infinite-scroll sentinel that must be
173
- * measured against the internal scroller rather than the viewport.
171
+ * Optional content rendered after the last row — e.g. an infinite-scroll sentinel. In the
172
+ * standard and fixed-header layouts it sits INSIDE the scroll container, so it's measured
173
+ * against the internal scroller; in split layout there is no internal vertical scroller (the
174
+ * page scrolls), so it renders just after the split grid and is measured against the viewport.
174
175
  */
175
176
  bottomContent?: React$1.ReactNode;
176
177
  }
@@ -1145,6 +1146,26 @@ declare function UndoToast({ toastId, title, description, itemCount, destination
1145
1146
  */
1146
1147
  declare function showUndoToast(options: ShowUndoToastOptions): string | number;
1147
1148
 
1149
+ interface UseInfiniteListOptions {
1150
+ /** Rows rendered on first paint and added per batch. */
1151
+ batchSize?: number;
1152
+ /** Distance from the sentinel at which the next batch is pulled in. */
1153
+ prefetchPx?: number;
1154
+ /** Dataset shape identity -- the window resets only when this changes, not on every refetch. */
1155
+ resetKey?: string | number;
1156
+ /** Scroll container ref, when the list scrolls inside a bounded element instead of the page. */
1157
+ scrollRootRef?: {
1158
+ current: HTMLElement | null;
1159
+ };
1160
+ }
1161
+ /** Client-side windowing over an in-memory array, pairing with `BaseTable` -- see RECONCILIATION.md. */
1162
+ declare function useInfiniteList<T>(items: T[], options?: UseInfiniteListOptions): {
1163
+ visibleItems: T[];
1164
+ sentinelRef: (node: HTMLDivElement | null) => void;
1165
+ hasMore: boolean;
1166
+ displayCount: number;
1167
+ };
1168
+
1148
1169
  declare function cn(...inputs: ClassValue[]): string;
1149
1170
 
1150
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, AvatarTableCell, Badge, type BadgeProps, BaseTable, BaseTasksTable, Button, type ButtonProps, Calendar, CalendarDayButton, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnSize, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FixedHeaderTable, FixedHeaderTableHeader, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconLoader, type IconLoaderProps, InfoCard, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, Loader, type LoaderProps, MobileModalLayout, MobileMultiSelect, MobileSkeleton, MultiSelect, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Pre, Progress, RadioGroup, RadioGroupItem, SafeTableCell, ScrollArea, ScrollBar, ScrollableTableContainer, ScrollableTableLeft, ScrollableTableRight, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type ShowUndoToastOptions, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SortableRowWrapper, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, type TableEmptyProps, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TaskColumnSize, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UndoToast, badgeVariants, buttonVariants, cn, columnSize, createClickableSortableHeader, createSortableHeader, showUndoToast, taskColumnSize, textareaVariants, toggleVariants, useFormField, useSidebar };
1171
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, AvatarTableCell, Badge, type BadgeProps, BaseTable, BaseTasksTable, Button, type ButtonProps, Calendar, CalendarDayButton, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColumnSize, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FixedHeaderTable, FixedHeaderTableHeader, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, IconLoader, type IconLoaderProps, InfoCard, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, Loader, type LoaderProps, MobileModalLayout, MobileMultiSelect, MobileSkeleton, MultiSelect, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Pre, Progress, RadioGroup, RadioGroupItem, SafeTableCell, ScrollArea, ScrollBar, ScrollableTableContainer, ScrollableTableLeft, ScrollableTableRight, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, type ShowUndoToastOptions, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, SortableRowWrapper, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableEmpty, type TableEmptyProps, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, type TaskColumnSize, Textarea, type TextareaProps, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UndoToast, badgeVariants, buttonVariants, cn, columnSize, createClickableSortableHeader, createSortableHeader, showUndoToast, taskColumnSize, textareaVariants, toggleVariants, useFormField, useInfiniteList, useSidebar };
package/dist/index.js CHANGED
@@ -1116,6 +1116,7 @@ function BaseTable({
1116
1116
  ]
1117
1117
  }
1118
1118
  ),
1119
+ bottomContent,
1119
1120
  !loading && !table.getRowModel().rows?.length && /* @__PURE__ */ jsx12(
1120
1121
  TableEmpty,
1121
1122
  {
@@ -3913,7 +3914,13 @@ function Loader({
3913
3914
  }
3914
3915
 
3915
3916
  // src/components/mobile-modal-layout.tsx
3916
- import { Dialog as Dialog2, DialogContent as DialogContent2, DialogOverlay as DialogOverlay2, DialogPortal as DialogPortal2 } from "@radix-ui/react-dialog";
3917
+ import {
3918
+ Dialog as Dialog2,
3919
+ DialogContent as DialogContent2,
3920
+ DialogOverlay as DialogOverlay2,
3921
+ DialogPortal as DialogPortal2,
3922
+ DialogTitle as DialogTitle2
3923
+ } from "@radix-ui/react-dialog";
3917
3924
  import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
3918
3925
  function ArrowLeftIcon2({ width = 20, height = 20, className }) {
3919
3926
  return /* @__PURE__ */ jsx27(
@@ -4033,7 +4040,7 @@ var MobileModalLayout = ({
4033
4040
  !showBackButton && isDialog ? "px-9" : "px-2"
4034
4041
  ),
4035
4042
  children: [
4036
- /* @__PURE__ */ jsx27(
4043
+ /* @__PURE__ */ jsx27(DialogTitle2, { asChild: true, children: /* @__PURE__ */ jsx27(
4037
4044
  "div",
4038
4045
  {
4039
4046
  className: cn(
@@ -4043,7 +4050,7 @@ var MobileModalLayout = ({
4043
4050
  ),
4044
4051
  children: title
4045
4052
  }
4046
- ),
4053
+ ) }),
4047
4054
  actionContext && actionContext,
4048
4055
  cancelButtonName && /* @__PURE__ */ jsx27(
4049
4056
  Button,
@@ -6244,6 +6251,40 @@ function showUndoToast(options) {
6244
6251
  { duration }
6245
6252
  );
6246
6253
  }
6254
+
6255
+ // src/hooks/use-infinite-list.ts
6256
+ import { useCallback as useCallback3, useEffect as useEffect9, useMemo as useMemo2, useState as useState9 } from "react";
6257
+ function useInfiniteList(items, options = {}) {
6258
+ const { batchSize = 100, prefetchPx = 300, resetKey, scrollRootRef } = options;
6259
+ const [displayCount, setDisplayCount] = useState9(batchSize);
6260
+ const [sentinelNode, setSentinelNode] = useState9(null);
6261
+ const sentinelRef = useCallback3((node) => setSentinelNode(node), []);
6262
+ useEffect9(() => {
6263
+ setDisplayCount(batchSize);
6264
+ }, [resetKey, batchSize]);
6265
+ const effectiveCount = Math.min(
6266
+ Math.max(displayCount, batchSize),
6267
+ Math.max(items.length, batchSize)
6268
+ );
6269
+ const hasMore = effectiveCount < items.length;
6270
+ useEffect9(() => {
6271
+ if (!hasMore || !sentinelNode) return;
6272
+ const observer = new IntersectionObserver(
6273
+ (entries) => {
6274
+ if (entries[0].isIntersecting) setDisplayCount((prev) => prev + batchSize);
6275
+ },
6276
+ {
6277
+ threshold: 0,
6278
+ root: scrollRootRef?.current ?? null,
6279
+ rootMargin: `${prefetchPx}px 0px ${prefetchPx}px 0px`
6280
+ }
6281
+ );
6282
+ observer.observe(sentinelNode);
6283
+ return () => observer.disconnect();
6284
+ }, [hasMore, batchSize, prefetchPx, scrollRootRef, displayCount, sentinelNode]);
6285
+ const visibleItems = useMemo2(() => items.slice(0, effectiveCount), [items, effectiveCount]);
6286
+ return { visibleItems, sentinelRef, hasMore, displayCount: effectiveCount };
6287
+ }
6247
6288
  export {
6248
6289
  Accordion,
6249
6290
  AccordionContent,
@@ -6456,6 +6497,7 @@ export {
6456
6497
  toast2 as toast,
6457
6498
  toggleVariants,
6458
6499
  useFormField,
6500
+ useInfiniteList,
6459
6501
  useSidebar
6460
6502
  };
6461
6503
  //# sourceMappingURL=index.js.map