@bizapps/design-system-testing 1.0.5 → 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/main.cjs +128 -111
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.cts +8 -5
- package/dist/main.d.ts +8 -5
- package/dist/main.js +128 -112
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.d.cts
CHANGED
|
@@ -398,6 +398,7 @@ declare function DialogContent({ className, children, showCloseButton, ...props
|
|
|
398
398
|
showCloseButton?: boolean;
|
|
399
399
|
}): react_jsx_runtime.JSX.Element;
|
|
400
400
|
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
401
|
+
declare function DialogBody({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
401
402
|
declare function DialogFooter({ className, showCloseButton, children, ...props }: ComponentProps<'div'> & {
|
|
402
403
|
showCloseButton?: boolean;
|
|
403
404
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -702,14 +703,16 @@ declare const SidebarTrigger: react.ForwardRefExoticComponent<Omit<react.ClassAt
|
|
|
702
703
|
isLoading?: boolean;
|
|
703
704
|
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
704
705
|
|
|
705
|
-
interface
|
|
706
|
+
interface AppShellItem {
|
|
706
707
|
label: string;
|
|
707
708
|
icon?: React.ReactNode;
|
|
708
709
|
active?: boolean;
|
|
709
710
|
onClick?: () => void;
|
|
711
|
+
permission?: string | string[];
|
|
712
|
+
permissionMode?: 'any' | 'all';
|
|
710
713
|
}
|
|
711
|
-
interface
|
|
712
|
-
items?:
|
|
714
|
+
interface AppShellProps {
|
|
715
|
+
items?: AppShellItem[];
|
|
713
716
|
activeItem?: string;
|
|
714
717
|
onItemClick?: (label: string) => void;
|
|
715
718
|
brandName?: string;
|
|
@@ -725,7 +728,7 @@ interface SideBarProps {
|
|
|
725
728
|
*
|
|
726
729
|
* Use `mainClassName` to control styles on the inner `<main>` (scroll, padding, etc.).
|
|
727
730
|
*/
|
|
728
|
-
declare function
|
|
731
|
+
declare function AppShell({ items, activeItem, onItemClick, brandName, showHeader, className, mainClassName, children, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
729
732
|
|
|
730
733
|
declare function Textarea({ className, ...props }: ComponentProps<'textarea'>): react_jsx_runtime.JSX.Element;
|
|
731
734
|
|
|
@@ -1974,4 +1977,4 @@ interface TCCEProviderProps {
|
|
|
1974
1977
|
}
|
|
1975
1978
|
declare function TCCEProvider({ children, permissions, toasterPosition, tooltipDelayDuration, }: TCCEProviderProps): react_jsx_runtime.JSX.Element;
|
|
1976
1979
|
|
|
1977
|
-
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, Calendar, CalendarDayButton, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, 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, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator,
|
|
1980
|
+
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, Calendar, CalendarDayButton, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, SidebarProvider, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, matchPermission, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
package/dist/main.d.ts
CHANGED
|
@@ -398,6 +398,7 @@ declare function DialogContent({ className, children, showCloseButton, ...props
|
|
|
398
398
|
showCloseButton?: boolean;
|
|
399
399
|
}): react_jsx_runtime.JSX.Element;
|
|
400
400
|
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
401
|
+
declare function DialogBody({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
401
402
|
declare function DialogFooter({ className, showCloseButton, children, ...props }: ComponentProps<'div'> & {
|
|
402
403
|
showCloseButton?: boolean;
|
|
403
404
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -702,14 +703,16 @@ declare const SidebarTrigger: react.ForwardRefExoticComponent<Omit<react.ClassAt
|
|
|
702
703
|
isLoading?: boolean;
|
|
703
704
|
}, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
704
705
|
|
|
705
|
-
interface
|
|
706
|
+
interface AppShellItem {
|
|
706
707
|
label: string;
|
|
707
708
|
icon?: React.ReactNode;
|
|
708
709
|
active?: boolean;
|
|
709
710
|
onClick?: () => void;
|
|
711
|
+
permission?: string | string[];
|
|
712
|
+
permissionMode?: 'any' | 'all';
|
|
710
713
|
}
|
|
711
|
-
interface
|
|
712
|
-
items?:
|
|
714
|
+
interface AppShellProps {
|
|
715
|
+
items?: AppShellItem[];
|
|
713
716
|
activeItem?: string;
|
|
714
717
|
onItemClick?: (label: string) => void;
|
|
715
718
|
brandName?: string;
|
|
@@ -725,7 +728,7 @@ interface SideBarProps {
|
|
|
725
728
|
*
|
|
726
729
|
* Use `mainClassName` to control styles on the inner `<main>` (scroll, padding, etc.).
|
|
727
730
|
*/
|
|
728
|
-
declare function
|
|
731
|
+
declare function AppShell({ items, activeItem, onItemClick, brandName, showHeader, className, mainClassName, children, }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
729
732
|
|
|
730
733
|
declare function Textarea({ className, ...props }: ComponentProps<'textarea'>): react_jsx_runtime.JSX.Element;
|
|
731
734
|
|
|
@@ -1974,4 +1977,4 @@ interface TCCEProviderProps {
|
|
|
1974
1977
|
}
|
|
1975
1978
|
declare function TCCEProvider({ children, permissions, toasterPosition, tooltipDelayDuration, }: TCCEProviderProps): react_jsx_runtime.JSX.Element;
|
|
1976
1979
|
|
|
1977
|
-
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, Calendar, CalendarDayButton, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, 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, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator,
|
|
1980
|
+
export { type AbilityContextValue, AbilityProvider, type AbilityProviderProps, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, type AnimationTokens, AppShell, type AppShellItem, type AppShellProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button$1 as Button, Calendar, CalendarDayButton, type CalendarEvent, type CalendarView, Can, CanNot, type CanNotProps, type CanProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CellAlignment, Checkbox, ColorPicker, ColorPickerAlpha, type ColorPickerAlphaProps, ColorPickerEyeDropper, type ColorPickerEyeDropperProps, ColorPickerFormat, type ColorPickerFormatProps, ColorPickerHue, type ColorPickerHueProps, ColorPickerOutput, type ColorPickerOutputProps, ColorPickerPresets, type ColorPickerPresetsProps, type ColorPickerProps, ColorPickerSelection, type ColorPickerSelectionProps, type ColumnMeta, Combobox, type ComboboxOption, type ComboboxProps, DataTable, DataTableCardView, type DataTableCardViewProps, DataTableColumnFilter, type DataTableColumnFilterProps, DataTableFooter, type DataTableFooterProps, DataTableHeaderCell, type DataTableHeaderCellProps, type DataTableProps, DataTableRowActions, type DataTableRowActionsProps, DataTableSearch, type DataTableSearchProps, DataTableSkeleton, type DataTableSkeletonProps, DataTableToolbar, type DataTableToolbarProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, type DropzoneContentProps, DropzoneEmptyState, type DropzoneEmptyStateProps, type DropzoneProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, type EventCalendarProps, type EventCreateRange, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, type FilterOptionProps, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, type LogoKey, MiniCalendar, MiniCalendarDay, type MiniCalendarDayProps, MiniCalendarDays, type MiniCalendarDaysProps, MiniCalendarNavigation, type MiniCalendarNavigationProps, type MiniCalendarProps, Navbar, type NavbarDropdownItem, type NavbarNavLink, type NavbarNotification, type NavbarProps, type NavbarUtilityLink, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, type PinInputProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, RadioGroup, RadioGroupItem, type RowAction, SegmentedControl, SegmentedControlItem, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger$1 as SelectTrigger, SelectValue, Separator, SidebarProvider, SidebarTrigger, Skeleton, Slider, type SortDirection, type SortRecord, Spinner, SpinnerDots, type SpinnerDotsProps, SpinnerLoader, type SpinnerLoaderProps, type SpinnerProps, Status, StatusIndicator, type StatusIndicatorProps, StatusLabel, type StatusLabelProps, type StatusProps, Switch, TCCEProvider, type TCCEProviderProps, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, type TableCellSize, type TableClassNames, type TableColumnDef, type TableContextType, TableFooter, TableHead, TableHeader, TablePagination, type TablePaginationProps, TableRow, type TableVariant, Tabs, TabsContent, TabsList, TabsTrigger, Text, type TextAs, type TextProps, type TextSize, type TextWeight, Textarea, type ToastAction, type ToastItem, type ToastType, Toaster, type ToasterPosition, type ToasterProps, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseTableDataProps, type UseTableDataReturn, type UseTableFilteringProps, type UseTableFilteringReturn, type UseTableGlobalFilterProps, type UseTableGlobalFilterReturn, type UseTableSizingProps, type UseTableSizingReturn, type UseTableSortingProps, type UseTableSortingReturn, type UseTableVisibilityProps, type UseTableVisibilityReturn, alertVariants, animation, avatarVariants, badgeVariants, buttonVariants$1 as buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, matchPermission, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { SearchIcon, BellIcon, CircleHelpIcon, Menu, ChevronDownIcon, LoaderCircle, ChevronLeftIcon, MoreHorizontalIcon, ChevronRightIcon, MinusIcon, CheckIcon, ChevronUpIcon, X,
|
|
2
|
+
import { SearchIcon, BellIcon, CircleHelpIcon, Menu, ChevronDownIcon, LoaderCircle, ChevronLeftIcon, MoreHorizontalIcon, ChevronRightIcon, MinusIcon, CheckIcon, ChevronUpIcon, X, ChevronLeft, ChevronRight, ExternalLinkIcon, XIcon, ChevronsUpDownIcon, UploadIcon, Loader2Icon, LoaderIcon, PipetteIcon, CalendarIcon, Funnel, ArrowUp, ArrowDown, ArrowUpDown, Ellipsis, Rows2, Eye, Search, House, Plane, Wallet, LayoutDashboardIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, CircleCheckIcon } from 'lucide-react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -399,8 +399,8 @@ var buttonVariants = cva(
|
|
|
399
399
|
primary: "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/80 focus-visible:ring-primary/30",
|
|
400
400
|
secondary: "cursor-pointer bg-secondary text-secondary-foreground hover:bg-[var(--color-orange-700)] focus-visible:ring-secondary/30",
|
|
401
401
|
cancel: "cursor-pointer bg-destructive text-secondary-foreground hover:bg-[var(--color-red-600)] focus-visible:ring-destructive/30",
|
|
402
|
-
outline: "
|
|
403
|
-
ghost: "cursor-pointer bg-transparent text-muted-foreground hover:bg-foreground/10 hover:text-primary focus-visible:ring-ring/30",
|
|
402
|
+
outline: "border border-foreground/50 bg-transparent text-muted-foreground hover:bg-foreground/50 hover:text-white",
|
|
403
|
+
ghost: "cursor-pointer bg-transparent text-muted-foreground hover:bg-foreground/10 hover:text-primary focus-visible:ring-ring/30 border-none",
|
|
404
404
|
cancelGhost: "cursor-pointer bg-destructive/10 text-red-600 hover:bg-destructive/15 hover:text-red-600 focus-visible:ring-ring/30"
|
|
405
405
|
},
|
|
406
406
|
size: {
|
|
@@ -999,7 +999,7 @@ function CarouselPrevious({
|
|
|
999
999
|
variant,
|
|
1000
1000
|
size,
|
|
1001
1001
|
className: cn(
|
|
1002
|
-
"absolute touch-manipulation",
|
|
1002
|
+
"cursor-pointer hover:bg-foreground/5 hover:text-foreground font-border border-solid border-foreground/10 absolute touch-manipulation",
|
|
1003
1003
|
orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
1004
1004
|
className
|
|
1005
1005
|
),
|
|
@@ -1008,7 +1008,7 @@ function CarouselPrevious({
|
|
|
1008
1008
|
"aria-label": "Previous slide",
|
|
1009
1009
|
...props,
|
|
1010
1010
|
children: [
|
|
1011
|
-
/* @__PURE__ */ jsx(
|
|
1011
|
+
/* @__PURE__ */ jsx(ChevronLeft, { className: "size-4", "aria-hidden": "true" }),
|
|
1012
1012
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
|
|
1013
1013
|
]
|
|
1014
1014
|
}
|
|
@@ -1028,7 +1028,7 @@ function CarouselNext({
|
|
|
1028
1028
|
variant,
|
|
1029
1029
|
size,
|
|
1030
1030
|
className: cn(
|
|
1031
|
-
"absolute touch-manipulation",
|
|
1031
|
+
"cursor-pointer hover:bg-foreground/5 hover:text-foreground border border-solid border-foreground/10 absolute touch-manipulation",
|
|
1032
1032
|
orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
1033
1033
|
className
|
|
1034
1034
|
),
|
|
@@ -1037,7 +1037,7 @@ function CarouselNext({
|
|
|
1037
1037
|
"aria-label": "Next slide",
|
|
1038
1038
|
...props,
|
|
1039
1039
|
children: [
|
|
1040
|
-
/* @__PURE__ */ jsx(
|
|
1040
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "size-4", "aria-hidden": "true" }),
|
|
1041
1041
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
|
|
1042
1042
|
]
|
|
1043
1043
|
}
|
|
@@ -2371,10 +2371,7 @@ function DialogPortal({ children, ...props }) {
|
|
|
2371
2371
|
function DialogClose({ ...props }) {
|
|
2372
2372
|
return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", ...props });
|
|
2373
2373
|
}
|
|
2374
|
-
function DialogOverlay({
|
|
2375
|
-
className,
|
|
2376
|
-
...props
|
|
2377
|
-
}) {
|
|
2374
|
+
function DialogOverlay({ className, ...props }) {
|
|
2378
2375
|
return /* @__PURE__ */ jsx(Dialog$1.Overlay, { "data-slot": "dialog-overlay", asChild: true, forceMount: true, ...props, children: /* @__PURE__ */ jsx(
|
|
2379
2376
|
motion.div,
|
|
2380
2377
|
{
|
|
@@ -2447,6 +2444,16 @@ function DialogHeader({ className, ...props }) {
|
|
|
2447
2444
|
}
|
|
2448
2445
|
);
|
|
2449
2446
|
}
|
|
2447
|
+
function DialogBody({ className, ...props }) {
|
|
2448
|
+
return /* @__PURE__ */ jsx(
|
|
2449
|
+
"div",
|
|
2450
|
+
{
|
|
2451
|
+
"data-slot": "dialog-body",
|
|
2452
|
+
className: cn("flex-1 overflow-y-auto px-6 pb-6", className),
|
|
2453
|
+
...props
|
|
2454
|
+
}
|
|
2455
|
+
);
|
|
2456
|
+
}
|
|
2450
2457
|
function DialogFooter({
|
|
2451
2458
|
className,
|
|
2452
2459
|
showCloseButton = false,
|
|
@@ -3060,7 +3067,7 @@ var DropzoneContext = createContext(void 0);
|
|
|
3060
3067
|
var dropzoneVariants = cva("", {
|
|
3061
3068
|
variants: {
|
|
3062
3069
|
border: {
|
|
3063
|
-
default: "border-solid",
|
|
3070
|
+
default: "border border-solid border-foreground/15",
|
|
3064
3071
|
dashed: "border-dashed border-foreground/50"
|
|
3065
3072
|
}
|
|
3066
3073
|
},
|
|
@@ -3110,14 +3117,14 @@ var Dropzone = ({
|
|
|
3110
3117
|
"data-slot": "dropzone",
|
|
3111
3118
|
"data-border": border ?? "default",
|
|
3112
3119
|
className: cn(
|
|
3113
|
-
"relative h-auto w-full flex-col overflow-hidden p-8",
|
|
3120
|
+
"cursor-auto relative h-auto w-full flex-col overflow-hidden p-8",
|
|
3114
3121
|
dropzoneVariants({ border }),
|
|
3115
|
-
isDragActive && "bg-
|
|
3122
|
+
isDragActive && "bg-foreground/10 outline-none",
|
|
3116
3123
|
className
|
|
3117
3124
|
),
|
|
3118
3125
|
disabled,
|
|
3119
3126
|
type: "button",
|
|
3120
|
-
variant: "
|
|
3127
|
+
variant: "ghost",
|
|
3121
3128
|
...getRootProps(),
|
|
3122
3129
|
children: [
|
|
3123
3130
|
/* @__PURE__ */ jsx("input", { ...getInputProps(), disabled }),
|
|
@@ -4643,6 +4650,84 @@ function NavigationMenuIndicator({
|
|
|
4643
4650
|
}
|
|
4644
4651
|
);
|
|
4645
4652
|
}
|
|
4653
|
+
function matchPermission(pattern, permission) {
|
|
4654
|
+
if (pattern === "*") return true;
|
|
4655
|
+
if (pattern === permission) return true;
|
|
4656
|
+
const patternParts = pattern.split(".");
|
|
4657
|
+
const permParts = permission.split(".");
|
|
4658
|
+
if (patternParts.length !== permParts.length) return false;
|
|
4659
|
+
return patternParts.every((part, i) => part === "*" || part === permParts[i]);
|
|
4660
|
+
}
|
|
4661
|
+
function matchesAny(permissionSet, permission) {
|
|
4662
|
+
if (permissionSet.has(permission)) return true;
|
|
4663
|
+
for (const pattern of permissionSet) {
|
|
4664
|
+
if (matchPermission(pattern, permission)) return true;
|
|
4665
|
+
}
|
|
4666
|
+
return false;
|
|
4667
|
+
}
|
|
4668
|
+
var AbilityContext = createContext(void 0);
|
|
4669
|
+
AbilityContext.displayName = "AbilityContext";
|
|
4670
|
+
function AbilityProvider({ children, permissions }) {
|
|
4671
|
+
const [permissionSet, setPermissionSet] = useState(
|
|
4672
|
+
() => new Set(permissions ?? [])
|
|
4673
|
+
);
|
|
4674
|
+
const can = useCallback(
|
|
4675
|
+
(perms, mode = "any") => {
|
|
4676
|
+
const list = Array.isArray(perms) ? perms : [perms];
|
|
4677
|
+
if (list.length === 0) return false;
|
|
4678
|
+
if (permissionSet.has("*")) return true;
|
|
4679
|
+
if (mode === "all") {
|
|
4680
|
+
return list.every((p) => matchesAny(permissionSet, p));
|
|
4681
|
+
}
|
|
4682
|
+
return list.some((p) => matchesAny(permissionSet, p));
|
|
4683
|
+
},
|
|
4684
|
+
[permissionSet]
|
|
4685
|
+
);
|
|
4686
|
+
const setAbilities = useCallback((perms) => {
|
|
4687
|
+
setPermissionSet(new Set(perms));
|
|
4688
|
+
}, []);
|
|
4689
|
+
const clearAbilities = useCallback(() => {
|
|
4690
|
+
setPermissionSet(/* @__PURE__ */ new Set());
|
|
4691
|
+
}, []);
|
|
4692
|
+
const syncedKey = useRef(permissions ? permissions.join("|") : null);
|
|
4693
|
+
useEffect(() => {
|
|
4694
|
+
if (permissions === void 0) return;
|
|
4695
|
+
const key = permissions.join("|");
|
|
4696
|
+
if (key === syncedKey.current) return;
|
|
4697
|
+
syncedKey.current = key;
|
|
4698
|
+
setPermissionSet(new Set(permissions));
|
|
4699
|
+
}, [permissions]);
|
|
4700
|
+
const value = useMemo(
|
|
4701
|
+
() => ({ can, setAbilities, clearAbilities }),
|
|
4702
|
+
[can, setAbilities, clearAbilities]
|
|
4703
|
+
);
|
|
4704
|
+
return /* @__PURE__ */ jsx(AbilityContext.Provider, { value, children });
|
|
4705
|
+
}
|
|
4706
|
+
function useAbility() {
|
|
4707
|
+
const context = useContext(AbilityContext);
|
|
4708
|
+
if (!context) {
|
|
4709
|
+
throw new Error("useAbility must be used within an AbilityProvider");
|
|
4710
|
+
}
|
|
4711
|
+
return context;
|
|
4712
|
+
}
|
|
4713
|
+
function useCan(permissions, mode = "any") {
|
|
4714
|
+
const { can } = useAbility();
|
|
4715
|
+
return can(permissions, mode);
|
|
4716
|
+
}
|
|
4717
|
+
function Can({ permission, mode = "any", negate = false, fallback = null, children }) {
|
|
4718
|
+
const { can } = useAbility();
|
|
4719
|
+
const hasPermission = can(permission, mode);
|
|
4720
|
+
const show = negate ? !hasPermission : hasPermission;
|
|
4721
|
+
if (typeof children === "function") {
|
|
4722
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: children(show) });
|
|
4723
|
+
}
|
|
4724
|
+
return show ? /* @__PURE__ */ jsx(Fragment$1, { children }) : /* @__PURE__ */ jsx(Fragment$1, { children: fallback });
|
|
4725
|
+
}
|
|
4726
|
+
Can.displayName = "Can";
|
|
4727
|
+
function CanNot({ permission, mode = "any", fallback = null, children }) {
|
|
4728
|
+
return /* @__PURE__ */ jsx(Can, { permission, mode, negate: true, fallback, children });
|
|
4729
|
+
}
|
|
4730
|
+
CanNot.displayName = "CanNot";
|
|
4646
4731
|
var SidebarContext = createContext({
|
|
4647
4732
|
open: true,
|
|
4648
4733
|
setOpen: () => {
|
|
@@ -4871,7 +4956,7 @@ function SidebarBrand({ brandName }) {
|
|
|
4871
4956
|
/* @__PURE__ */ jsx("span", { className: "truncate text-sm font-semibold", children: brandName })
|
|
4872
4957
|
] });
|
|
4873
4958
|
}
|
|
4874
|
-
function
|
|
4959
|
+
function AppShell({
|
|
4875
4960
|
items = defaultItems,
|
|
4876
4961
|
activeItem,
|
|
4877
4962
|
onItemClick,
|
|
@@ -4887,20 +4972,32 @@ function SideBar({
|
|
|
4887
4972
|
/* @__PURE__ */ jsx(SidebarTrigger, { variant: "ghost", className: "size-8 shrink-0" }),
|
|
4888
4973
|
/* @__PURE__ */ jsx(SidebarBrand, { brandName })
|
|
4889
4974
|
] }),
|
|
4890
|
-
/* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((item) =>
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4975
|
+
/* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((item) => {
|
|
4976
|
+
const menuItem = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(
|
|
4977
|
+
SidebarMenuButton,
|
|
4978
|
+
{
|
|
4979
|
+
isActive: activeItem === item.label || item.active,
|
|
4980
|
+
onClick: () => {
|
|
4981
|
+
item.onClick?.();
|
|
4982
|
+
onItemClick?.(item.label);
|
|
4983
|
+
},
|
|
4984
|
+
children: [
|
|
4985
|
+
item.icon,
|
|
4986
|
+
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
4987
|
+
]
|
|
4988
|
+
}
|
|
4989
|
+
) }, item.label);
|
|
4990
|
+
if (!item.permission) return menuItem;
|
|
4991
|
+
return /* @__PURE__ */ jsx(
|
|
4992
|
+
Can,
|
|
4993
|
+
{
|
|
4994
|
+
permission: item.permission,
|
|
4995
|
+
mode: item.permissionMode,
|
|
4996
|
+
children: menuItem
|
|
4897
4997
|
},
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
]
|
|
4902
|
-
}
|
|
4903
|
-
) }, item.label)) }) }) }) })
|
|
4998
|
+
item.label
|
|
4999
|
+
);
|
|
5000
|
+
}) }) }) }) })
|
|
4904
5001
|
] }),
|
|
4905
5002
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col", children: [
|
|
4906
5003
|
showHeader && /* @__PURE__ */ jsx("header", { className: "flex h-14 items-center justify-between border-b px-4", children: /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: brandName }) }),
|
|
@@ -7408,96 +7505,15 @@ function DataTableSearch({
|
|
|
7408
7505
|
)
|
|
7409
7506
|
] });
|
|
7410
7507
|
}
|
|
7411
|
-
function matchPermission(pattern, permission) {
|
|
7412
|
-
if (pattern === "*") return true;
|
|
7413
|
-
if (pattern === permission) return true;
|
|
7414
|
-
const patternParts = pattern.split(".");
|
|
7415
|
-
const permParts = permission.split(".");
|
|
7416
|
-
if (patternParts.length !== permParts.length) return false;
|
|
7417
|
-
return patternParts.every((part, i) => part === "*" || part === permParts[i]);
|
|
7418
|
-
}
|
|
7419
|
-
function matchesAny(permissionSet, permission) {
|
|
7420
|
-
if (permissionSet.has(permission)) return true;
|
|
7421
|
-
for (const pattern of permissionSet) {
|
|
7422
|
-
if (matchPermission(pattern, permission)) return true;
|
|
7423
|
-
}
|
|
7424
|
-
return false;
|
|
7425
|
-
}
|
|
7426
|
-
var AbilityContext = createContext(void 0);
|
|
7427
|
-
AbilityContext.displayName = "AbilityContext";
|
|
7428
|
-
function AbilityProvider({ children, permissions }) {
|
|
7429
|
-
const [permissionSet, setPermissionSet] = useState(
|
|
7430
|
-
() => new Set(permissions ?? [])
|
|
7431
|
-
);
|
|
7432
|
-
const can = useCallback(
|
|
7433
|
-
(perms, mode = "any") => {
|
|
7434
|
-
const list = Array.isArray(perms) ? perms : [perms];
|
|
7435
|
-
if (list.length === 0) return false;
|
|
7436
|
-
if (permissionSet.has("*")) return true;
|
|
7437
|
-
if (mode === "all") {
|
|
7438
|
-
return list.every((p) => matchesAny(permissionSet, p));
|
|
7439
|
-
}
|
|
7440
|
-
return list.some((p) => matchesAny(permissionSet, p));
|
|
7441
|
-
},
|
|
7442
|
-
[permissionSet]
|
|
7443
|
-
);
|
|
7444
|
-
const setAbilities = useCallback((perms) => {
|
|
7445
|
-
setPermissionSet(new Set(perms));
|
|
7446
|
-
}, []);
|
|
7447
|
-
const clearAbilities = useCallback(() => {
|
|
7448
|
-
setPermissionSet(/* @__PURE__ */ new Set());
|
|
7449
|
-
}, []);
|
|
7450
|
-
const syncedKey = useRef(permissions ? permissions.join("|") : null);
|
|
7451
|
-
useEffect(() => {
|
|
7452
|
-
if (permissions === void 0) return;
|
|
7453
|
-
const key = permissions.join("|");
|
|
7454
|
-
if (key === syncedKey.current) return;
|
|
7455
|
-
syncedKey.current = key;
|
|
7456
|
-
setPermissionSet(new Set(permissions));
|
|
7457
|
-
}, [permissions]);
|
|
7458
|
-
const value = useMemo(
|
|
7459
|
-
() => ({ can, setAbilities, clearAbilities }),
|
|
7460
|
-
[can, setAbilities, clearAbilities]
|
|
7461
|
-
);
|
|
7462
|
-
return /* @__PURE__ */ jsx(AbilityContext.Provider, { value, children });
|
|
7463
|
-
}
|
|
7464
|
-
function useAbility() {
|
|
7465
|
-
const context = useContext(AbilityContext);
|
|
7466
|
-
if (!context) {
|
|
7467
|
-
throw new Error("useAbility must be used within an AbilityProvider");
|
|
7468
|
-
}
|
|
7469
|
-
return context;
|
|
7470
|
-
}
|
|
7471
|
-
function useCan(permissions, mode = "any") {
|
|
7472
|
-
const { can } = useAbility();
|
|
7473
|
-
return can(permissions, mode);
|
|
7474
|
-
}
|
|
7475
|
-
function Can({ permission, mode = "any", negate = false, fallback = null, children }) {
|
|
7476
|
-
const { can } = useAbility();
|
|
7477
|
-
const hasPermission = can(permission, mode);
|
|
7478
|
-
const show = negate ? !hasPermission : hasPermission;
|
|
7479
|
-
if (typeof children === "function") {
|
|
7480
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children: children(show) });
|
|
7481
|
-
}
|
|
7482
|
-
return show ? /* @__PURE__ */ jsx(Fragment$1, { children }) : /* @__PURE__ */ jsx(Fragment$1, { children: fallback });
|
|
7483
|
-
}
|
|
7484
|
-
Can.displayName = "Can";
|
|
7485
|
-
function CanNot({ permission, mode = "any", fallback = null, children }) {
|
|
7486
|
-
return /* @__PURE__ */ jsx(Can, { permission, mode, negate: true, fallback, children });
|
|
7487
|
-
}
|
|
7488
|
-
CanNot.displayName = "CanNot";
|
|
7489
7508
|
function TCCEProvider({
|
|
7490
7509
|
children,
|
|
7491
7510
|
permissions,
|
|
7492
7511
|
toasterPosition,
|
|
7493
7512
|
tooltipDelayDuration
|
|
7494
7513
|
}) {
|
|
7495
|
-
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: tooltipDelayDuration, children: /* @__PURE__ */
|
|
7496
|
-
children,
|
|
7497
|
-
/* @__PURE__ */ jsx(Toaster, { position: toasterPosition })
|
|
7498
|
-
] }) });
|
|
7514
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: tooltipDelayDuration, children: /* @__PURE__ */ jsx(AbilityProvider, { permissions, children: /* @__PURE__ */ jsx(Toaster, { position: toasterPosition, children }) }) });
|
|
7499
7515
|
}
|
|
7500
7516
|
|
|
7501
|
-
export { AbilityProvider, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge2 as Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Can, CanNot, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, ColorPicker, ColorPickerAlpha, ColorPickerEyeDropper, ColorPickerFormat, ColorPickerHue, ColorPickerOutput, ColorPickerPresets, ColorPickerSelection, Combobox, DataTable, DataTableCardView, DataTableColumnFilter, DataTableFooter, DataTableHeaderCell, DataTableRowActions, DataTableSearch, DataTableSkeleton, DataTableToolbar, DatePicker, 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, Dropzone, DropzoneContent, DropzoneEmptyState, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, MiniCalendar, MiniCalendarDay, MiniCalendarDays, MiniCalendarNavigation, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, SegmentedControl, SegmentedControlItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator,
|
|
7517
|
+
export { AbilityProvider, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge2 as Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Can, CanNot, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, ColorPicker, ColorPickerAlpha, ColorPickerEyeDropper, ColorPickerFormat, ColorPickerHue, ColorPickerOutput, ColorPickerPresets, ColorPickerSelection, Combobox, DataTable, DataTableCardView, DataTableColumnFilter, DataTableFooter, DataTableHeaderCell, DataTableRowActions, DataTableSearch, DataTableSkeleton, DataTableToolbar, DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, DropzoneContent, DropzoneEmptyState, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventCalendar, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, FilterOption, Input, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Link, Logo, MiniCalendar, MiniCalendarDay, MiniCalendarDays, MiniCalendarNavigation, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PinInput, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, SegmentedControl, SegmentedControlItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SidebarProvider, SidebarTrigger, Skeleton, Slider, Spinner, SpinnerDots, SpinnerLoader, Status, StatusIndicator, StatusLabel, Switch, TCCEProvider, TEXT_SIZES, TEXT_WEIGHTS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, Toaster, Toggle, ToggleGroup2 as ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, animation, avatarVariants, badgeVariants2 as badgeVariants, buttonVariants, columnFiltersToArrayQueryParams, columnFiltersToJsonString, columnFiltersToQueryParams, columnFiltersToRecord, createBackendParams, createBackendParamsWithFilters, duration, ease, fadeIn, getActiveFilterCount, getActiveFilterValues, getColumnValueCounts, getUniqueColumnValues, hasActiveFilters, linkVariants, logos, matchPermission, mergeFilters, multiSelectFilter, navigationMenuTriggerStyle, parseJsonToFilters, parseQueryParamsToFilters, progressIndicatorVariants, progressVariants, scaleIn, searchInArray, skeletonVariants, slideRight, slideUp, sortRecordToSortingState, sortingStateToJsonString, sortingStateToRecord, spinnerDotsVariants, spinnerLoaderVariants, spinnerVariants, spring, stagger, toggleVariants, tooltipContentVariants, transition, useAbility, useAppForm, useCan, useCarousel, useColorPicker, useColumnFilter, useTableContext, useTableData, useTableFiltering, useTableGlobalFilter, useTableSizing, useTableSorting, useTableVisibility, useToast };
|
|
7502
7518
|
//# sourceMappingURL=main.js.map
|
|
7503
7519
|
//# sourceMappingURL=main.js.map
|