@umami/react-zen 1.0.6 → 1.0.7
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 +33 -24
- package/dist/index.d.ts +33 -24
- package/dist/index.js +125 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +126 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.css +1 -1
- package/styles.full.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -82,7 +82,7 @@ type Display = 'none' | 'inline' | 'inline-block' | 'block';
|
|
|
82
82
|
type Cursor = 'auto' | 'default' | 'pointer' | 'wait' | 'text' | 'move' | 'help' | 'not-allowed' | 'none' | 'grab' | 'grabbing';
|
|
83
83
|
type Border = true | 'top' | 'right' | 'bottom' | 'left' | 'none';
|
|
84
84
|
type BorderWidth = 'sm' | 'md' | 'lg' | 'xl';
|
|
85
|
-
type BorderRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' | true;
|
|
85
|
+
type BorderRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'full' | true;
|
|
86
86
|
type BoxShadow = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'inner' | true;
|
|
87
87
|
type FontSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
88
88
|
type HeadingSize = 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
@@ -406,6 +406,18 @@ type DataTableSorting = {
|
|
|
406
406
|
id: string;
|
|
407
407
|
desc: boolean;
|
|
408
408
|
}[];
|
|
409
|
+
/** What `renderCard` gets about the row besides its data. */
|
|
410
|
+
interface DataTableCardContext {
|
|
411
|
+
/** The row's id (see `getRowId`). */
|
|
412
|
+
id: string;
|
|
413
|
+
/** The row's index in `data`. */
|
|
414
|
+
index: number;
|
|
415
|
+
isSelected: boolean;
|
|
416
|
+
/** Selects or deselects the row; without an argument, flips it. */
|
|
417
|
+
toggleSelected: (selected?: boolean) => void;
|
|
418
|
+
/** Each visible column's rendered cell, by column id. */
|
|
419
|
+
cells: Record<string, ReactNode>;
|
|
420
|
+
}
|
|
409
421
|
interface DataTableProps<TData extends RowData = any> extends ComponentProps<typeof Table> {
|
|
410
422
|
data?: TData[];
|
|
411
423
|
displayMode?: 'table' | 'cards';
|
|
@@ -414,6 +426,14 @@ interface DataTableProps<TData extends RowData = any> extends ComponentProps<typ
|
|
|
414
426
|
* (e.g. `'360px'`). Without it, cards stack in a single column.
|
|
415
427
|
*/
|
|
416
428
|
cardMinWidth?: string;
|
|
429
|
+
/**
|
|
430
|
+
* In card mode, renders each row's card in place of the default label/value card. Sorting,
|
|
431
|
+
* filtering, pagination and selection still apply; no checkbox is added, so use `isSelected` and
|
|
432
|
+
* `toggleSelected` from the context.
|
|
433
|
+
*/
|
|
434
|
+
renderCard?: (row: TData, context: DataTableCardContext) => ReactNode;
|
|
435
|
+
/** In card mode, renders a placeholder card while `loading` (default: a placeholder label/value card). */
|
|
436
|
+
renderCardSkeleton?: (index: number) => ReactNode;
|
|
417
437
|
/** Returns a row's unique id. Defaults to the row's `id` property, or its index without one. */
|
|
418
438
|
getRowId?: (row: TData, index: number) => string;
|
|
419
439
|
/** Adds a checkbox column for selecting rows. */
|
|
@@ -442,6 +462,10 @@ interface DataTableProps<TData extends RowData = any> extends ComponentProps<typ
|
|
|
442
462
|
onPageIndexChange?: (pageIndex: number) => void;
|
|
443
463
|
/** Shown when there are no rows to display (default: "No results."). */
|
|
444
464
|
emptyState?: ReactNode;
|
|
465
|
+
/** Shows placeholder rows in place of the data, keeping the headers and column layout. */
|
|
466
|
+
loading?: boolean;
|
|
467
|
+
/** Number of placeholder rows while `loading` (default: `pageSize`, or 5). */
|
|
468
|
+
loadingRows?: number;
|
|
445
469
|
}
|
|
446
470
|
interface DataColumnProps<TData = any> extends Omit<HTMLAttributes<HTMLTableCellElement>, 'children'> {
|
|
447
471
|
id: string;
|
|
@@ -460,7 +484,7 @@ interface DataColumnProps<TData = any> extends Omit<HTMLAttributes<HTMLTableCell
|
|
|
460
484
|
}
|
|
461
485
|
/** Declares a column of a DataTable. Renders nothing on its own. */
|
|
462
486
|
declare function DataColumn<TData = any>(_props: DataColumnProps<TData>): null;
|
|
463
|
-
declare function DataTable<TData extends RowData = any>({ data, displayMode, cardMinWidth, getRowId, selectionMode, selectedRows: selectedRowsProp, defaultSelectedRows, onSelectedRowsChange, sorting: sortingProp, defaultSorting, onSortingChange, filter, pageSize, pageIndex: pageIndexProp, defaultPageIndex, onPageIndexChange, emptyState, className, children, ...props }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
487
|
+
declare function DataTable<TData extends RowData = any>({ data, displayMode, cardMinWidth, renderCard, renderCardSkeleton, getRowId, selectionMode, selectedRows: selectedRowsProp, defaultSelectedRows, onSelectedRowsChange, sorting: sortingProp, defaultSorting, onSortingChange, filter, pageSize, pageIndex: pageIndexProp, defaultPageIndex, onPageIndexChange, emptyState, loading, loadingRows, className, children, ...props }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
464
488
|
|
|
465
489
|
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React$1.ComponentProps<typeof DayPicker> & {
|
|
466
490
|
buttonVariant?: React$1.ComponentProps<typeof Button>["variant"];
|
|
@@ -829,27 +853,6 @@ interface NumberFieldProps extends NumberField$1.Root.Props {
|
|
|
829
853
|
}
|
|
830
854
|
declare const NumberField: React$1.ForwardRefExoticComponent<Omit<NumberFieldProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
831
855
|
|
|
832
|
-
interface RowProps extends FlexboxProps {
|
|
833
|
-
children?: ReactNode;
|
|
834
|
-
reverse?: boolean;
|
|
835
|
-
}
|
|
836
|
-
declare function Row({ reverse, children, ...props }: RowProps): react_jsx_runtime.JSX.Element;
|
|
837
|
-
|
|
838
|
-
interface PageHeaderProps extends RowProps {
|
|
839
|
-
children?: ReactNode;
|
|
840
|
-
}
|
|
841
|
-
declare function PageHeader({ children, ...props }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
842
|
-
interface PageHeaderTitleProps extends Omit<ColumnProps, 'title'> {
|
|
843
|
-
title: ReactNode;
|
|
844
|
-
description?: ReactNode;
|
|
845
|
-
breadcrumb?: ReactNode;
|
|
846
|
-
}
|
|
847
|
-
declare function PageHeaderTitle({ title, description, breadcrumb, children, ...props }: PageHeaderTitleProps): react_jsx_runtime.JSX.Element;
|
|
848
|
-
interface PageHeaderActionsProps extends RowProps {
|
|
849
|
-
children?: ReactNode;
|
|
850
|
-
}
|
|
851
|
-
declare function PageHeaderActions({ children, ...props }: PageHeaderActionsProps): react_jsx_runtime.JSX.Element;
|
|
852
|
-
|
|
853
856
|
interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children'> {
|
|
854
857
|
label?: ReactNode;
|
|
855
858
|
/** Controls whether the value is visible. Leave undefined for uncontrolled behavior. */
|
|
@@ -866,6 +869,12 @@ interface ProgressCircleProps extends ProgressRoot.Props {
|
|
|
866
869
|
}
|
|
867
870
|
declare function ProgressCircle({ className, showPercentage, value, min, max, ...props }: ProgressCircleProps): react_jsx_runtime.JSX.Element;
|
|
868
871
|
|
|
872
|
+
interface RowProps extends FlexboxProps {
|
|
873
|
+
children?: ReactNode;
|
|
874
|
+
reverse?: boolean;
|
|
875
|
+
}
|
|
876
|
+
declare function Row({ reverse, children, ...props }: RowProps): react_jsx_runtime.JSX.Element;
|
|
877
|
+
|
|
869
878
|
interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onSearch' | 'children'> {
|
|
870
879
|
label?: ReactNode;
|
|
871
880
|
/** Debounce delay in milliseconds for `onSearch`. */
|
|
@@ -1540,4 +1549,4 @@ interface ZenProviderProps {
|
|
|
1540
1549
|
}
|
|
1541
1550
|
declare function ZenProvider({ children, theme, colorScheme, palette, toast, tooltip, }: ZenProviderProps): react_jsx_runtime.JSX.Element;
|
|
1542
1551
|
|
|
1543
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AlignContent, type AlignItems, type AlignSelf, AspectRatio, Autocomplete, type AutocompleteProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, type BackgroundColor, type BackgroundColorToken, Badge, Blockquote, type BlockquoteProps, type Border, type BorderColor, type BorderColorToken, type BorderRadius, type BorderWidth, type Bottom, Box, type BoxProps, type BoxRenderProps, type BoxShadow, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type Breakpoint$1 as Breakpoint, type BreakpointKey, Breakpoints, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxGroup, type CheckboxGroupProps, Code, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, type CodeProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorName, type ColorShade, Column, type ColumnProps, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, type Cursor, DataCard, type DataCardProps, DataColumn, type DataColumnProps, DataTable, type DataTableProps, type DataTableSelectionMode, type DataTableSorting, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type Display, Dots, type DotsProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FillColor, type FlexDirection, type FlexDisplay, type FlexGrow, type FlexShrink, type FlexWrap, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, type FontColor, type FontSize, type FontWeight, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormFieldRenderProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, type FormSubmitButtonProps, type Fraction, type Gap, Grid, type GridAutoFlow, type GridColumns, type GridDisplay, type GridProps, type GridRows, type GridTemplateAreas, type GridTemplateColumns, type GridTemplateRows, Heading, type HeadingProps, type HeadingSize, type Height, type HeightViewport, HoverCard, HoverCardContent, HoverCardTrigger, Icon, type IconProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, type JustifyContent, type JustifyItems, type JustifySelf, Kbd, KbdGroup, Label, type Left, type LetterSpacing, type LineHeight, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, type ListSeparatorProps, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, type Margin, type MaxHeight, type MaxWidth, type MaxWidthSpecial, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Meter, type MeterProps, type MinHeight, type MinWidth, Navbar, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, type NegativeSpacing, NumberField, type NumberFieldProps, type ObjectFit, type Opacity, type Overflow, PALETTES, type Padding,
|
|
1552
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AlignContent, type AlignItems, type AlignSelf, AspectRatio, Autocomplete, type AutocompleteProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, type BackgroundColor, type BackgroundColorToken, Badge, Blockquote, type BlockquoteProps, type Border, type BorderColor, type BorderColorToken, type BorderRadius, type BorderWidth, type Bottom, Box, type BoxProps, type BoxRenderProps, type BoxShadow, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type Breakpoint$1 as Breakpoint, type BreakpointKey, Breakpoints, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxGroup, type CheckboxGroupProps, Code, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, type CodeProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorName, type ColorShade, Column, type ColumnProps, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, type Cursor, DataCard, type DataCardProps, DataColumn, type DataColumnProps, DataTable, type DataTableCardContext, type DataTableProps, type DataTableSelectionMode, type DataTableSorting, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type Display, Dots, type DotsProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FillColor, type FlexDirection, type FlexDisplay, type FlexGrow, type FlexShrink, type FlexWrap, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, type FontColor, type FontSize, type FontWeight, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormFieldRenderProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, type FormSubmitButtonProps, type Fraction, type Gap, Grid, type GridAutoFlow, type GridColumns, type GridDisplay, type GridProps, type GridRows, type GridTemplateAreas, type GridTemplateColumns, type GridTemplateRows, Heading, type HeadingProps, type HeadingSize, type Height, type HeightViewport, HoverCard, HoverCardContent, HoverCardTrigger, Icon, type IconProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, type JustifyContent, type JustifyItems, type JustifySelf, Kbd, KbdGroup, Label, type Left, type LetterSpacing, type LineHeight, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, type ListSeparatorProps, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, type Margin, type MaxHeight, type MaxWidth, type MaxWidthSpecial, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Meter, type MeterProps, type MinHeight, type MinWidth, Navbar, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, type NegativeSpacing, NumberField, type NumberFieldProps, type ObjectFit, type Opacity, type Overflow, PALETTES, type Padding, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type Palette, type PaletteColor, PasswordField, type PasswordFieldProps, type PointerEvents, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, type Position, type Primitive, Progress, ProgressCircle, type ProgressCircleProps, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, type RenderProp, ResizableHandle, ResizablePanel, ResizablePanelGroup, type Responsive$1 as Responsive, type Right, Row, type RowProps, ScrollArea, ScrollBar, SearchField, type SearchFieldProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, type SizingSpecial, Skeleton, Slider, type Spacing, Spinner, type SpinnerProps, type StateStyles, type StatusColorToken, StatusLight, type StatusLightProps, type StatusLightVariant, type StrokeColor, type StrokeWidth, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagGroup, type TagGroupProps, type TagProps, type TailwindColor, Text, type TextAlign, type TextColorToken, type TextDecorationStyle, TextField, type TextFieldProps, type TextIndent, type TextProps, type TextRenderProps, type TextTransform, type TextWrap, Textarea, type Theme, ThemeButton, type ThemeButtonProps, type ThemeMode, ThemeSwitcher, type ThemeSwitcherProps, Toast, ToastContext, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastState, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, type ToolbarButtonProps, ToolbarGroup, type ToolbarGroupProps, ToolbarLink, type ToolbarLinkProps, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type Top, type VerticalAlign, type Whitespace, type Width, type WidthViewport, type WordBreak, ZenProvider, type ZenProviderProps, badgeVariants, buttonGroupVariants, buttonVariants, getCssColorValue, isHeightPreset, isMaxHeightPreset, isMaxWidthPreset, isMinHeightPreset, isMinWidthPreset, isWidthPreset, mapAlignContent, mapAlignItems, mapAlignSelf, mapBackgroundColor, mapBorder, mapBorderColor, mapBorderRadius, mapBorderWidth, mapCursor, mapDecorationColor, mapDisplay, mapFlexDirection, mapFlexWrap, mapFontSize, mapFontWeight, mapGap, mapGridAutoFlow, mapGridColumns, mapGridRows, mapHeadingSize, mapHeight, mapJustifyContent, mapJustifyItems, mapLetterSpacing, mapLineHeight, mapMargin, mapMaxHeight, mapMaxWidth, mapMinHeight, mapMinWidth, mapOpacity, mapOverflow, mapPadding, mapPointerEvents, mapPosition, mapShadow, mapSpace, mapStateStyles, mapTextAlign, mapTextColor, mapTextDecorationStyle, mapTextIndent, mapTextTransform, mapTextWrap, mapVerticalAlign, mapWhitespace, mapWidth, mapWordBreak, removeToast, resolveRender, tabsListVariants, toggleVariants, useBreakpoint, useCarousel, useComboboxAnchor, useDebounce, useHighlightedCode, useInitTheme, useIsMobile, useSidebar, useTheme, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ type Display = 'none' | 'inline' | 'inline-block' | 'block';
|
|
|
82
82
|
type Cursor = 'auto' | 'default' | 'pointer' | 'wait' | 'text' | 'move' | 'help' | 'not-allowed' | 'none' | 'grab' | 'grabbing';
|
|
83
83
|
type Border = true | 'top' | 'right' | 'bottom' | 'left' | 'none';
|
|
84
84
|
type BorderWidth = 'sm' | 'md' | 'lg' | 'xl';
|
|
85
|
-
type BorderRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' | true;
|
|
85
|
+
type BorderRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'full' | true;
|
|
86
86
|
type BoxShadow = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'inner' | true;
|
|
87
87
|
type FontSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
88
88
|
type HeadingSize = 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
@@ -406,6 +406,18 @@ type DataTableSorting = {
|
|
|
406
406
|
id: string;
|
|
407
407
|
desc: boolean;
|
|
408
408
|
}[];
|
|
409
|
+
/** What `renderCard` gets about the row besides its data. */
|
|
410
|
+
interface DataTableCardContext {
|
|
411
|
+
/** The row's id (see `getRowId`). */
|
|
412
|
+
id: string;
|
|
413
|
+
/** The row's index in `data`. */
|
|
414
|
+
index: number;
|
|
415
|
+
isSelected: boolean;
|
|
416
|
+
/** Selects or deselects the row; without an argument, flips it. */
|
|
417
|
+
toggleSelected: (selected?: boolean) => void;
|
|
418
|
+
/** Each visible column's rendered cell, by column id. */
|
|
419
|
+
cells: Record<string, ReactNode>;
|
|
420
|
+
}
|
|
409
421
|
interface DataTableProps<TData extends RowData = any> extends ComponentProps<typeof Table> {
|
|
410
422
|
data?: TData[];
|
|
411
423
|
displayMode?: 'table' | 'cards';
|
|
@@ -414,6 +426,14 @@ interface DataTableProps<TData extends RowData = any> extends ComponentProps<typ
|
|
|
414
426
|
* (e.g. `'360px'`). Without it, cards stack in a single column.
|
|
415
427
|
*/
|
|
416
428
|
cardMinWidth?: string;
|
|
429
|
+
/**
|
|
430
|
+
* In card mode, renders each row's card in place of the default label/value card. Sorting,
|
|
431
|
+
* filtering, pagination and selection still apply; no checkbox is added, so use `isSelected` and
|
|
432
|
+
* `toggleSelected` from the context.
|
|
433
|
+
*/
|
|
434
|
+
renderCard?: (row: TData, context: DataTableCardContext) => ReactNode;
|
|
435
|
+
/** In card mode, renders a placeholder card while `loading` (default: a placeholder label/value card). */
|
|
436
|
+
renderCardSkeleton?: (index: number) => ReactNode;
|
|
417
437
|
/** Returns a row's unique id. Defaults to the row's `id` property, or its index without one. */
|
|
418
438
|
getRowId?: (row: TData, index: number) => string;
|
|
419
439
|
/** Adds a checkbox column for selecting rows. */
|
|
@@ -442,6 +462,10 @@ interface DataTableProps<TData extends RowData = any> extends ComponentProps<typ
|
|
|
442
462
|
onPageIndexChange?: (pageIndex: number) => void;
|
|
443
463
|
/** Shown when there are no rows to display (default: "No results."). */
|
|
444
464
|
emptyState?: ReactNode;
|
|
465
|
+
/** Shows placeholder rows in place of the data, keeping the headers and column layout. */
|
|
466
|
+
loading?: boolean;
|
|
467
|
+
/** Number of placeholder rows while `loading` (default: `pageSize`, or 5). */
|
|
468
|
+
loadingRows?: number;
|
|
445
469
|
}
|
|
446
470
|
interface DataColumnProps<TData = any> extends Omit<HTMLAttributes<HTMLTableCellElement>, 'children'> {
|
|
447
471
|
id: string;
|
|
@@ -460,7 +484,7 @@ interface DataColumnProps<TData = any> extends Omit<HTMLAttributes<HTMLTableCell
|
|
|
460
484
|
}
|
|
461
485
|
/** Declares a column of a DataTable. Renders nothing on its own. */
|
|
462
486
|
declare function DataColumn<TData = any>(_props: DataColumnProps<TData>): null;
|
|
463
|
-
declare function DataTable<TData extends RowData = any>({ data, displayMode, cardMinWidth, getRowId, selectionMode, selectedRows: selectedRowsProp, defaultSelectedRows, onSelectedRowsChange, sorting: sortingProp, defaultSorting, onSortingChange, filter, pageSize, pageIndex: pageIndexProp, defaultPageIndex, onPageIndexChange, emptyState, className, children, ...props }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
487
|
+
declare function DataTable<TData extends RowData = any>({ data, displayMode, cardMinWidth, renderCard, renderCardSkeleton, getRowId, selectionMode, selectedRows: selectedRowsProp, defaultSelectedRows, onSelectedRowsChange, sorting: sortingProp, defaultSorting, onSortingChange, filter, pageSize, pageIndex: pageIndexProp, defaultPageIndex, onPageIndexChange, emptyState, loading, loadingRows, className, children, ...props }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
464
488
|
|
|
465
489
|
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React$1.ComponentProps<typeof DayPicker> & {
|
|
466
490
|
buttonVariant?: React$1.ComponentProps<typeof Button>["variant"];
|
|
@@ -829,27 +853,6 @@ interface NumberFieldProps extends NumberField$1.Root.Props {
|
|
|
829
853
|
}
|
|
830
854
|
declare const NumberField: React$1.ForwardRefExoticComponent<Omit<NumberFieldProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
831
855
|
|
|
832
|
-
interface RowProps extends FlexboxProps {
|
|
833
|
-
children?: ReactNode;
|
|
834
|
-
reverse?: boolean;
|
|
835
|
-
}
|
|
836
|
-
declare function Row({ reverse, children, ...props }: RowProps): react_jsx_runtime.JSX.Element;
|
|
837
|
-
|
|
838
|
-
interface PageHeaderProps extends RowProps {
|
|
839
|
-
children?: ReactNode;
|
|
840
|
-
}
|
|
841
|
-
declare function PageHeader({ children, ...props }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
842
|
-
interface PageHeaderTitleProps extends Omit<ColumnProps, 'title'> {
|
|
843
|
-
title: ReactNode;
|
|
844
|
-
description?: ReactNode;
|
|
845
|
-
breadcrumb?: ReactNode;
|
|
846
|
-
}
|
|
847
|
-
declare function PageHeaderTitle({ title, description, breadcrumb, children, ...props }: PageHeaderTitleProps): react_jsx_runtime.JSX.Element;
|
|
848
|
-
interface PageHeaderActionsProps extends RowProps {
|
|
849
|
-
children?: ReactNode;
|
|
850
|
-
}
|
|
851
|
-
declare function PageHeaderActions({ children, ...props }: PageHeaderActionsProps): react_jsx_runtime.JSX.Element;
|
|
852
|
-
|
|
853
856
|
interface PasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children'> {
|
|
854
857
|
label?: ReactNode;
|
|
855
858
|
/** Controls whether the value is visible. Leave undefined for uncontrolled behavior. */
|
|
@@ -866,6 +869,12 @@ interface ProgressCircleProps extends ProgressRoot.Props {
|
|
|
866
869
|
}
|
|
867
870
|
declare function ProgressCircle({ className, showPercentage, value, min, max, ...props }: ProgressCircleProps): react_jsx_runtime.JSX.Element;
|
|
868
871
|
|
|
872
|
+
interface RowProps extends FlexboxProps {
|
|
873
|
+
children?: ReactNode;
|
|
874
|
+
reverse?: boolean;
|
|
875
|
+
}
|
|
876
|
+
declare function Row({ reverse, children, ...props }: RowProps): react_jsx_runtime.JSX.Element;
|
|
877
|
+
|
|
869
878
|
interface SearchFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onSearch' | 'children'> {
|
|
870
879
|
label?: ReactNode;
|
|
871
880
|
/** Debounce delay in milliseconds for `onSearch`. */
|
|
@@ -1540,4 +1549,4 @@ interface ZenProviderProps {
|
|
|
1540
1549
|
}
|
|
1541
1550
|
declare function ZenProvider({ children, theme, colorScheme, palette, toast, tooltip, }: ZenProviderProps): react_jsx_runtime.JSX.Element;
|
|
1542
1551
|
|
|
1543
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AlignContent, type AlignItems, type AlignSelf, AspectRatio, Autocomplete, type AutocompleteProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, type BackgroundColor, type BackgroundColorToken, Badge, Blockquote, type BlockquoteProps, type Border, type BorderColor, type BorderColorToken, type BorderRadius, type BorderWidth, type Bottom, Box, type BoxProps, type BoxRenderProps, type BoxShadow, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type Breakpoint$1 as Breakpoint, type BreakpointKey, Breakpoints, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxGroup, type CheckboxGroupProps, Code, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, type CodeProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorName, type ColorShade, Column, type ColumnProps, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, type Cursor, DataCard, type DataCardProps, DataColumn, type DataColumnProps, DataTable, type DataTableProps, type DataTableSelectionMode, type DataTableSorting, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type Display, Dots, type DotsProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FillColor, type FlexDirection, type FlexDisplay, type FlexGrow, type FlexShrink, type FlexWrap, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, type FontColor, type FontSize, type FontWeight, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormFieldRenderProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, type FormSubmitButtonProps, type Fraction, type Gap, Grid, type GridAutoFlow, type GridColumns, type GridDisplay, type GridProps, type GridRows, type GridTemplateAreas, type GridTemplateColumns, type GridTemplateRows, Heading, type HeadingProps, type HeadingSize, type Height, type HeightViewport, HoverCard, HoverCardContent, HoverCardTrigger, Icon, type IconProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, type JustifyContent, type JustifyItems, type JustifySelf, Kbd, KbdGroup, Label, type Left, type LetterSpacing, type LineHeight, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, type ListSeparatorProps, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, type Margin, type MaxHeight, type MaxWidth, type MaxWidthSpecial, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Meter, type MeterProps, type MinHeight, type MinWidth, Navbar, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, type NegativeSpacing, NumberField, type NumberFieldProps, type ObjectFit, type Opacity, type Overflow, PALETTES, type Padding,
|
|
1552
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AlignContent, type AlignItems, type AlignSelf, AspectRatio, Autocomplete, type AutocompleteProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, type BackgroundColor, type BackgroundColorToken, Badge, Blockquote, type BlockquoteProps, type Border, type BorderColor, type BorderColorToken, type BorderRadius, type BorderWidth, type Bottom, Box, type BoxProps, type BoxRenderProps, type BoxShadow, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, type Breakpoint$1 as Breakpoint, type BreakpointKey, Breakpoints, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CheckboxGroup, type CheckboxGroupProps, Code, CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockFooter, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, type CodeProps, Collapsible, CollapsibleContent, CollapsibleTrigger, type ColorName, type ColorShade, Column, type ColumnProps, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationDialog, type ConfirmationDialogProps, Container, type ContainerProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, type Cursor, DataCard, type DataCardProps, DataColumn, type DataColumnProps, DataTable, type DataTableCardContext, type DataTableProps, type DataTableSelectionMode, type DataTableSorting, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type Display, Dots, type DotsProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, type FillColor, type FlexDirection, type FlexDisplay, type FlexGrow, type FlexShrink, type FlexWrap, Flexbox, type FlexboxProps, FloatingTooltip, type FloatingTooltipProps, type FontColor, type FontSize, type FontWeight, Form, FormButtons, type FormButtonsProps, FormController, type FormControllerProps, FormField, FormFieldArray, type FormFieldArrayProps, type FormFieldProps, type FormFieldRenderProps, type FormProps, FormResetButton, type FormResetButtonProps, FormSubmitButton, type FormSubmitButtonProps, type Fraction, type Gap, Grid, type GridAutoFlow, type GridColumns, type GridDisplay, type GridProps, type GridRows, type GridTemplateAreas, type GridTemplateColumns, type GridTemplateRows, Heading, type HeadingProps, type HeadingSize, type Height, type HeightViewport, HoverCard, HoverCardContent, HoverCardTrigger, Icon, type IconProps, Image, type ImageProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, type JustifyContent, type JustifyItems, type JustifySelf, Kbd, KbdGroup, Label, type Left, type LetterSpacing, type LineHeight, List, ListItem, type ListItemProps, type ListProps, ListSection, type ListSectionProps, ListSeparator, type ListSeparatorProps, Loading, LoadingButton, type LoadingButtonProps, type LoadingProps, type Margin, type MaxHeight, type MaxWidth, type MaxWidthSpecial, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Meter, type MeterProps, type MinHeight, type MinWidth, Navbar, NavbarItem, type NavbarItemProps, NavbarLink, type NavbarLinkProps, type NavbarProps, type NegativeSpacing, NumberField, type NumberFieldProps, type ObjectFit, type Opacity, type Overflow, PALETTES, type Padding, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, type Palette, type PaletteColor, PasswordField, type PasswordFieldProps, type PointerEvents, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, type Position, type Primitive, Progress, ProgressCircle, type ProgressCircleProps, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RadioGroup, RadioGroupItem, type RenderProp, ResizableHandle, ResizablePanel, ResizablePanelGroup, type Responsive$1 as Responsive, type Right, Row, type RowProps, ScrollArea, ScrollBar, SearchField, type SearchFieldProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, type SizingSpecial, Skeleton, Slider, type Spacing, Spinner, type SpinnerProps, type StateStyles, type StatusColorToken, StatusLight, type StatusLightProps, type StatusLightVariant, type StrokeColor, type StrokeWidth, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagGroup, type TagGroupProps, type TagProps, type TailwindColor, Text, type TextAlign, type TextColorToken, type TextDecorationStyle, TextField, type TextFieldProps, type TextIndent, type TextProps, type TextRenderProps, type TextTransform, type TextWrap, Textarea, type Theme, ThemeButton, type ThemeButtonProps, type ThemeMode, ThemeSwitcher, type ThemeSwitcherProps, Toast, ToastContext, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastState, type ToastVariant, Toaster, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, type ToolbarButtonProps, ToolbarGroup, type ToolbarGroupProps, ToolbarLink, type ToolbarLinkProps, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type Top, type VerticalAlign, type Whitespace, type Width, type WidthViewport, type WordBreak, ZenProvider, type ZenProviderProps, badgeVariants, buttonGroupVariants, buttonVariants, getCssColorValue, isHeightPreset, isMaxHeightPreset, isMaxWidthPreset, isMinHeightPreset, isMinWidthPreset, isWidthPreset, mapAlignContent, mapAlignItems, mapAlignSelf, mapBackgroundColor, mapBorder, mapBorderColor, mapBorderRadius, mapBorderWidth, mapCursor, mapDecorationColor, mapDisplay, mapFlexDirection, mapFlexWrap, mapFontSize, mapFontWeight, mapGap, mapGridAutoFlow, mapGridColumns, mapGridRows, mapHeadingSize, mapHeight, mapJustifyContent, mapJustifyItems, mapLetterSpacing, mapLineHeight, mapMargin, mapMaxHeight, mapMaxWidth, mapMinHeight, mapMinWidth, mapOpacity, mapOverflow, mapPadding, mapPointerEvents, mapPosition, mapShadow, mapSpace, mapStateStyles, mapTextAlign, mapTextColor, mapTextDecorationStyle, mapTextIndent, mapTextTransform, mapTextWrap, mapVerticalAlign, mapWhitespace, mapWidth, mapWordBreak, removeToast, resolveRender, tabsListVariants, toggleVariants, useBreakpoint, useCarousel, useComboboxAnchor, useDebounce, useHighlightedCode, useInitTheme, useIsMobile, useSidebar, useTheme, useToast };
|
package/dist/index.js
CHANGED
|
@@ -1398,6 +1398,7 @@ var borderRadiusMap = {
|
|
|
1398
1398
|
xl: "rounded-xl",
|
|
1399
1399
|
"2xl": "rounded-2xl",
|
|
1400
1400
|
"3xl": "rounded-3xl",
|
|
1401
|
+
"4xl": "rounded-4xl",
|
|
1401
1402
|
full: "rounded-full",
|
|
1402
1403
|
true: "rounded-lg"
|
|
1403
1404
|
};
|
|
@@ -3453,6 +3454,16 @@ function Checkbox({ className, ...props }) {
|
|
|
3453
3454
|
}
|
|
3454
3455
|
);
|
|
3455
3456
|
}
|
|
3457
|
+
function Skeleton({ className, ...props }) {
|
|
3458
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3459
|
+
"div",
|
|
3460
|
+
{
|
|
3461
|
+
"data-slot": "skeleton",
|
|
3462
|
+
className: cn.cn("animate-pulse rounded-md bg-muted", className),
|
|
3463
|
+
...props
|
|
3464
|
+
}
|
|
3465
|
+
);
|
|
3466
|
+
}
|
|
3456
3467
|
function Table({ className, ...props }) {
|
|
3457
3468
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3458
3469
|
"div",
|
|
@@ -3574,7 +3585,12 @@ var features = reactTable.tableFeatures({
|
|
|
3574
3585
|
}
|
|
3575
3586
|
});
|
|
3576
3587
|
var SELECTION_COLUMN_WIDTH = "2.5rem";
|
|
3577
|
-
var ROW_CLASS = "grid [&>*:first-child]:pl-4";
|
|
3588
|
+
var ROW_CLASS = "grid [&>*:first-child]:pl-4 [&>*:last-child]:pr-4";
|
|
3589
|
+
var SKELETON_WIDTHS = [70, 50, 85, 60, 40, 75];
|
|
3590
|
+
var DEFAULT_LOADING_ROWS = 5;
|
|
3591
|
+
function skeletonWidth(rowIndex, columnIndex) {
|
|
3592
|
+
return `${SKELETON_WIDTHS[(rowIndex * 2 + columnIndex) % SKELETON_WIDTHS.length]}%`;
|
|
3593
|
+
}
|
|
3578
3594
|
var alignClasses = {
|
|
3579
3595
|
start: "justify-start text-left",
|
|
3580
3596
|
center: "justify-center text-center",
|
|
@@ -3612,6 +3628,8 @@ function DataTable({
|
|
|
3612
3628
|
data = [],
|
|
3613
3629
|
displayMode = "table",
|
|
3614
3630
|
cardMinWidth,
|
|
3631
|
+
renderCard,
|
|
3632
|
+
renderCardSkeleton,
|
|
3615
3633
|
getRowId = defaultGetRowId,
|
|
3616
3634
|
selectionMode = "none",
|
|
3617
3635
|
selectedRows: selectedRowsProp,
|
|
@@ -3626,6 +3644,8 @@ function DataTable({
|
|
|
3626
3644
|
defaultPageIndex = 0,
|
|
3627
3645
|
onPageIndexChange,
|
|
3628
3646
|
emptyState = "No results.",
|
|
3647
|
+
loading = false,
|
|
3648
|
+
loadingRows,
|
|
3629
3649
|
className,
|
|
3630
3650
|
children,
|
|
3631
3651
|
...props
|
|
@@ -3681,7 +3701,11 @@ function DataTable({
|
|
|
3681
3701
|
});
|
|
3682
3702
|
const rows = (isPaginated ? table.getRowModel() : table.getPrePaginatedRowModel()).rows;
|
|
3683
3703
|
const pageCount = isPaginated ? table.getPageCount() : 1;
|
|
3684
|
-
const
|
|
3704
|
+
const skeletonRows = Array.from(
|
|
3705
|
+
{ length: Math.max(loadingRows ?? (isPaginated ? pageSize : DEFAULT_LOADING_ROWS), 0) },
|
|
3706
|
+
(_, index) => index
|
|
3707
|
+
);
|
|
3708
|
+
const pagination = !loading && isPaginated && pageCount > 1 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3685
3709
|
"div",
|
|
3686
3710
|
{
|
|
3687
3711
|
"data-slot": "data-table-pagination",
|
|
@@ -3738,11 +3762,71 @@ function DataTable({
|
|
|
3738
3762
|
alignItems: cardMinWidth ? "start" : void 0,
|
|
3739
3763
|
"data-slot": "data-table",
|
|
3740
3764
|
"data-display-mode": "cards",
|
|
3765
|
+
"data-loading": loading || void 0,
|
|
3766
|
+
"aria-busy": loading || void 0,
|
|
3741
3767
|
children: [
|
|
3742
|
-
|
|
3768
|
+
loading ? skeletonRows.map(
|
|
3769
|
+
(rowIndex) => renderCardSkeleton ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3770
|
+
"div",
|
|
3771
|
+
{
|
|
3772
|
+
"data-slot": "data-table-card",
|
|
3773
|
+
"data-skeleton": "",
|
|
3774
|
+
"aria-hidden": "true",
|
|
3775
|
+
className: "min-w-0",
|
|
3776
|
+
children: renderCardSkeleton(rowIndex)
|
|
3777
|
+
},
|
|
3778
|
+
rowIndex
|
|
3779
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3780
|
+
DataCard,
|
|
3781
|
+
{
|
|
3782
|
+
"data-skeleton": "",
|
|
3783
|
+
"aria-hidden": "true",
|
|
3784
|
+
data: [
|
|
3785
|
+
...isSelectable ? [{ label: "", value: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "size-4 rounded-[4px]" }) }] : [],
|
|
3786
|
+
...visibleColumns.map((column, columnIndex) => ({
|
|
3787
|
+
label: column.label,
|
|
3788
|
+
value: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3789
|
+
Skeleton,
|
|
3790
|
+
{
|
|
3791
|
+
className: "my-0.5 h-4",
|
|
3792
|
+
style: { width: skeletonWidth(rowIndex, columnIndex) }
|
|
3793
|
+
}
|
|
3794
|
+
)
|
|
3795
|
+
}))
|
|
3796
|
+
]
|
|
3797
|
+
},
|
|
3798
|
+
rowIndex
|
|
3799
|
+
)
|
|
3800
|
+
) : rows.length === 0 ? empty : rows.map((row) => {
|
|
3801
|
+
const original = row.original;
|
|
3802
|
+
const isSelected = row.getIsSelected();
|
|
3803
|
+
if (renderCard) {
|
|
3804
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3805
|
+
"div",
|
|
3806
|
+
{
|
|
3807
|
+
"data-slot": "data-table-card",
|
|
3808
|
+
"data-row-id": row.id,
|
|
3809
|
+
"data-state": isSelected ? "selected" : void 0,
|
|
3810
|
+
className: "min-w-0",
|
|
3811
|
+
children: renderCard(original, {
|
|
3812
|
+
id: row.id,
|
|
3813
|
+
index: row.index,
|
|
3814
|
+
isSelected,
|
|
3815
|
+
toggleSelected: (selected) => row.toggleSelected(selected),
|
|
3816
|
+
cells: Object.fromEntries(
|
|
3817
|
+
visibleColumns.map((column) => [
|
|
3818
|
+
column.id,
|
|
3819
|
+
renderCell(column, original, row.index)
|
|
3820
|
+
])
|
|
3821
|
+
)
|
|
3822
|
+
})
|
|
3823
|
+
},
|
|
3824
|
+
row.id
|
|
3825
|
+
);
|
|
3826
|
+
}
|
|
3743
3827
|
const items = visibleColumns.map((column) => ({
|
|
3744
3828
|
label: column.label,
|
|
3745
|
-
value: renderCell(column,
|
|
3829
|
+
value: renderCell(column, original, row.index)
|
|
3746
3830
|
}));
|
|
3747
3831
|
if (isSelectable) {
|
|
3748
3832
|
items.unshift({
|
|
@@ -3751,7 +3835,7 @@ function DataTable({
|
|
|
3751
3835
|
Checkbox,
|
|
3752
3836
|
{
|
|
3753
3837
|
"aria-label": "Select row",
|
|
3754
|
-
checked:
|
|
3838
|
+
checked: isSelected,
|
|
3755
3839
|
onCheckedChange: (checked) => row.toggleSelected(checked)
|
|
3756
3840
|
}
|
|
3757
3841
|
)
|
|
@@ -3761,7 +3845,7 @@ function DataTable({
|
|
|
3761
3845
|
DataCard,
|
|
3762
3846
|
{
|
|
3763
3847
|
"data-row-id": row.id,
|
|
3764
|
-
"data-state":
|
|
3848
|
+
"data-state": isSelected ? "selected" : void 0,
|
|
3765
3849
|
data: items
|
|
3766
3850
|
},
|
|
3767
3851
|
row.id
|
|
@@ -3786,6 +3870,8 @@ function DataTable({
|
|
|
3786
3870
|
role: "table",
|
|
3787
3871
|
"data-slot": "data-table",
|
|
3788
3872
|
"data-selection-mode": isSelectable ? selectionMode : void 0,
|
|
3873
|
+
"data-loading": loading || void 0,
|
|
3874
|
+
"aria-busy": loading || void 0,
|
|
3789
3875
|
className: cn.cn(
|
|
3790
3876
|
"grid overflow-hidden rounded-lg border border-border bg-white dark:bg-black",
|
|
3791
3877
|
className
|
|
@@ -3804,6 +3890,7 @@ function DataTable({
|
|
|
3804
3890
|
"aria-label": "Select all rows",
|
|
3805
3891
|
checked: allSelected,
|
|
3806
3892
|
indeterminate: someSelected && !allSelected,
|
|
3893
|
+
disabled: loading,
|
|
3807
3894
|
onCheckedChange: (checked) => table.toggleAllRowsSelected(checked)
|
|
3808
3895
|
}
|
|
3809
3896
|
) }),
|
|
@@ -3843,7 +3930,38 @@ function DataTable({
|
|
|
3843
3930
|
]
|
|
3844
3931
|
}
|
|
3845
3932
|
) }),
|
|
3846
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { role: "rowgroup", className: "contents", children:
|
|
3933
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { role: "rowgroup", className: "contents", children: loading ? skeletonRows.map((rowIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3934
|
+
TableRow,
|
|
3935
|
+
{
|
|
3936
|
+
role: "row",
|
|
3937
|
+
"aria-hidden": "true",
|
|
3938
|
+
"data-skeleton": "",
|
|
3939
|
+
className: cn.cn(ROW_CLASS, "hover:bg-transparent"),
|
|
3940
|
+
style: rowStyle,
|
|
3941
|
+
children: [
|
|
3942
|
+
isSelectable && /* @__PURE__ */ jsxRuntime.jsx(TableCell, { role: "cell", className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "size-4 rounded-[4px]" }) }),
|
|
3943
|
+
visibleColumns.map((column, columnIndex) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3944
|
+
TableCell,
|
|
3945
|
+
{
|
|
3946
|
+
role: "cell",
|
|
3947
|
+
className: cn.cn(
|
|
3948
|
+
"flex min-w-0 items-center",
|
|
3949
|
+
column.align && alignClasses[column.align]
|
|
3950
|
+
),
|
|
3951
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3952
|
+
Skeleton,
|
|
3953
|
+
{
|
|
3954
|
+
className: "my-0.5 h-4",
|
|
3955
|
+
style: { width: skeletonWidth(rowIndex, columnIndex) }
|
|
3956
|
+
}
|
|
3957
|
+
)
|
|
3958
|
+
},
|
|
3959
|
+
column.id
|
|
3960
|
+
))
|
|
3961
|
+
]
|
|
3962
|
+
},
|
|
3963
|
+
rowIndex
|
|
3964
|
+
)) : rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(TableRow, { role: "row", className: "grid hover:bg-transparent", style: rowStyle, children: /* @__PURE__ */ jsxRuntime.jsx(TableCell, { role: "cell", style: { gridColumn: "1 / -1" }, children: empty }) }) : rows.map((row) => {
|
|
3847
3965
|
const isSelected = isSelectable && row.getIsSelected();
|
|
3848
3966
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3849
3967
|
TableRow,
|
|
@@ -6075,38 +6193,6 @@ var NumberField = React4.forwardRef(function NumberField2({
|
|
|
6075
6193
|
}
|
|
6076
6194
|
);
|
|
6077
6195
|
});
|
|
6078
|
-
function PageHeader({ children, ...props }) {
|
|
6079
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6080
|
-
Row,
|
|
6081
|
-
{
|
|
6082
|
-
width: "100%",
|
|
6083
|
-
paddingY: "4",
|
|
6084
|
-
alignItems: "center",
|
|
6085
|
-
justifyContent: "space-between",
|
|
6086
|
-
border: "bottom",
|
|
6087
|
-
gap: "4",
|
|
6088
|
-
...props,
|
|
6089
|
-
children
|
|
6090
|
-
}
|
|
6091
|
-
);
|
|
6092
|
-
}
|
|
6093
|
-
function PageHeaderTitle({
|
|
6094
|
-
title,
|
|
6095
|
-
description,
|
|
6096
|
-
breadcrumb,
|
|
6097
|
-
children,
|
|
6098
|
-
...props
|
|
6099
|
-
}) {
|
|
6100
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Column, { gap: "1", ...props, children: [
|
|
6101
|
-
breadcrumb,
|
|
6102
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xl", weight: "semibold", children: title }),
|
|
6103
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "muted", children: description }),
|
|
6104
|
-
children
|
|
6105
|
-
] });
|
|
6106
|
-
}
|
|
6107
|
-
function PageHeaderActions({ children, ...props }) {
|
|
6108
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Row, { gap: "2", alignItems: "center", ...props, children });
|
|
6109
|
-
}
|
|
6110
6196
|
var RADIUS = 45;
|
|
6111
6197
|
var CIRCUMFERENCE = RADIUS * 2 * Math.PI;
|
|
6112
6198
|
function ProgressCircle({
|
|
@@ -10015,16 +10101,6 @@ function SheetDescription({
|
|
|
10015
10101
|
}
|
|
10016
10102
|
);
|
|
10017
10103
|
}
|
|
10018
|
-
function Skeleton({ className, ...props }) {
|
|
10019
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10020
|
-
"div",
|
|
10021
|
-
{
|
|
10022
|
-
"data-slot": "skeleton",
|
|
10023
|
-
className: cn.cn("animate-pulse rounded-md bg-muted", className),
|
|
10024
|
-
...props
|
|
10025
|
-
}
|
|
10026
|
-
);
|
|
10027
|
-
}
|
|
10028
10104
|
function TooltipProvider({
|
|
10029
10105
|
delay = 0,
|
|
10030
10106
|
...props
|
|
@@ -11137,9 +11213,6 @@ exports.NavbarItem = NavbarItem;
|
|
|
11137
11213
|
exports.NavbarLink = NavbarLink;
|
|
11138
11214
|
exports.NumberField = NumberField;
|
|
11139
11215
|
exports.PALETTES = PALETTES;
|
|
11140
|
-
exports.PageHeader = PageHeader;
|
|
11141
|
-
exports.PageHeaderActions = PageHeaderActions;
|
|
11142
|
-
exports.PageHeaderTitle = PageHeaderTitle;
|
|
11143
11216
|
exports.Pagination = Pagination;
|
|
11144
11217
|
exports.PaginationContent = PaginationContent;
|
|
11145
11218
|
exports.PaginationEllipsis = PaginationEllipsis;
|