@eqtylab/equality 2.5.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global-theme-config.css +9 -1
- package/dist/index.cjs +59 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +60 -10
- package/dist/index.js.map +1 -1
- package/dist/pagination.module.module.css.module.css +79 -0
- package/dist/theme-preflight-global.css +229 -222
- package/dist/theme-preflight-scoped.css +229 -223
- package/dist/theme.module.css +1 -1
- package/dist/theme.module.module.css.module.css +37 -37
- package/package.json +6 -3
package/dist/index.d.cts
CHANGED
|
@@ -566,12 +566,13 @@ interface PaginationProps {
|
|
|
566
566
|
onItemsPerPageChange?: (itemsPerPage: number) => void;
|
|
567
567
|
itemsPerPageOptions?: number[];
|
|
568
568
|
showInfo?: boolean;
|
|
569
|
+
showFirstLast?: boolean;
|
|
569
570
|
maxVisiblePages?: number;
|
|
570
571
|
className?: string;
|
|
571
572
|
type?: string;
|
|
572
573
|
scrollTargetRef?: React$1.RefObject<HTMLElement | null> | string;
|
|
573
574
|
}
|
|
574
|
-
declare const Pagination: ({ currentPage, totalItems, filteredItems, itemsPerPage, onPageChange, onItemsPerPageChange, itemsPerPageOptions, showInfo, maxVisiblePages, className, type, scrollTargetRef, }: PaginationProps) => react_jsx_runtime.JSX.Element | null;
|
|
575
|
+
declare const Pagination: ({ currentPage, totalItems, filteredItems, itemsPerPage, onPageChange, onItemsPerPageChange, itemsPerPageOptions, showInfo, showFirstLast, maxVisiblePages, className, type, scrollTargetRef, }: PaginationProps) => react_jsx_runtime.JSX.Element | null;
|
|
575
576
|
|
|
576
577
|
interface PanelLabelProps {
|
|
577
578
|
className?: string;
|
|
@@ -920,7 +921,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
|
|
|
920
921
|
|
|
921
922
|
declare const iconVariants: (props?: ({
|
|
922
923
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
923
|
-
background?: "
|
|
924
|
+
background?: "square" | "circle" | "transparent" | null | undefined;
|
|
924
925
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
925
926
|
declare const iconElevationVariants: (props?: ({
|
|
926
927
|
elevation?: string | number | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -566,12 +566,13 @@ interface PaginationProps {
|
|
|
566
566
|
onItemsPerPageChange?: (itemsPerPage: number) => void;
|
|
567
567
|
itemsPerPageOptions?: number[];
|
|
568
568
|
showInfo?: boolean;
|
|
569
|
+
showFirstLast?: boolean;
|
|
569
570
|
maxVisiblePages?: number;
|
|
570
571
|
className?: string;
|
|
571
572
|
type?: string;
|
|
572
573
|
scrollTargetRef?: React$1.RefObject<HTMLElement | null> | string;
|
|
573
574
|
}
|
|
574
|
-
declare const Pagination: ({ currentPage, totalItems, filteredItems, itemsPerPage, onPageChange, onItemsPerPageChange, itemsPerPageOptions, showInfo, maxVisiblePages, className, type, scrollTargetRef, }: PaginationProps) => react_jsx_runtime.JSX.Element | null;
|
|
575
|
+
declare const Pagination: ({ currentPage, totalItems, filteredItems, itemsPerPage, onPageChange, onItemsPerPageChange, itemsPerPageOptions, showInfo, showFirstLast, maxVisiblePages, className, type, scrollTargetRef, }: PaginationProps) => react_jsx_runtime.JSX.Element | null;
|
|
575
576
|
|
|
576
577
|
interface PanelLabelProps {
|
|
577
578
|
className?: string;
|
|
@@ -920,7 +921,7 @@ declare const TruncatedDescription: ({ className, description, maxLength, }: Tru
|
|
|
920
921
|
|
|
921
922
|
declare const iconVariants: (props?: ({
|
|
922
923
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
923
|
-
background?: "
|
|
924
|
+
background?: "square" | "circle" | "transparent" | null | undefined;
|
|
924
925
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
925
926
|
declare const iconElevationVariants: (props?: ({
|
|
926
927
|
elevation?: string | number | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { forwardRef, useRef, useMemo, useEffect, useSyncExternalStore, useState,
|
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import styles2 from './alert.module.module.css.module.css';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
6
|
-
import { Check, ChevronRight, Search, Circle, ChevronDown, ChevronUp, X, SearchIcon, CalendarDays, ChevronLeft, Grid3X3, List, AlertOctagon, Home, ArrowUp, ArrowDown, ArrowUpDown, TriangleAlert } from 'lucide-react';
|
|
6
|
+
import { Check, ChevronRight, Search, Circle, ChevronDown, ChevronUp, X, SearchIcon, CalendarDays, ChevronLeft, Grid3X3, List, AlertOctagon, Home, ChevronsLeft, ChevronsRight, ArrowUp, ArrowDown, ArrowUpDown, TriangleAlert } from 'lucide-react';
|
|
7
7
|
import styles from './icon.module.module.css.module.css';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
9
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -2696,6 +2696,8 @@ var SelectSeparator = React15.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
2696
2696
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
2697
2697
|
var ChevronLeftIcon2 = ChevronLeft;
|
|
2698
2698
|
var ChevronRightIcon3 = ChevronRight;
|
|
2699
|
+
var ChevronsLeftIcon = ChevronsLeft;
|
|
2700
|
+
var ChevronsRightIcon = ChevronsRight;
|
|
2699
2701
|
var Pagination = ({
|
|
2700
2702
|
currentPage,
|
|
2701
2703
|
totalItems,
|
|
@@ -2705,6 +2707,7 @@ var Pagination = ({
|
|
|
2705
2707
|
onItemsPerPageChange,
|
|
2706
2708
|
itemsPerPageOptions = [10, 25, 50, 100],
|
|
2707
2709
|
showInfo = true,
|
|
2710
|
+
showFirstLast = true,
|
|
2708
2711
|
maxVisiblePages = 5,
|
|
2709
2712
|
className = "",
|
|
2710
2713
|
type = "",
|
|
@@ -2714,8 +2717,9 @@ var Pagination = ({
|
|
|
2714
2717
|
const startItem = Math.min(filteredItems, 1 + (currentPage - 1) * itemsPerPage);
|
|
2715
2718
|
const endItem = Math.min(currentPage * itemsPerPage, filteredItems);
|
|
2716
2719
|
const hasFilteredItems = filteredItems > 0;
|
|
2717
|
-
const isFirstPage = currentPage
|
|
2718
|
-
const isLastPage = currentPage
|
|
2720
|
+
const isFirstPage = currentPage <= 1;
|
|
2721
|
+
const isLastPage = currentPage >= totalPages;
|
|
2722
|
+
const showFirstLastButtons = showFirstLast && totalPages > maxVisiblePages;
|
|
2719
2723
|
if (totalItems <= itemsPerPageOptions[0]) {
|
|
2720
2724
|
return null;
|
|
2721
2725
|
}
|
|
@@ -2743,12 +2747,18 @@ var Pagination = ({
|
|
|
2743
2747
|
onItemsPerPageChange?.(newItemsPerPage);
|
|
2744
2748
|
onPageChange(1);
|
|
2745
2749
|
};
|
|
2750
|
+
const handleFirstPage = () => {
|
|
2751
|
+
handlePageChange(1);
|
|
2752
|
+
};
|
|
2746
2753
|
const handlePreviousPage = () => {
|
|
2747
2754
|
handlePageChange(Math.max(1, currentPage - 1));
|
|
2748
2755
|
};
|
|
2749
2756
|
const handleNextPage = () => {
|
|
2750
2757
|
handlePageChange(Math.min(totalPages, currentPage + 1));
|
|
2751
2758
|
};
|
|
2759
|
+
const handleLastPage = () => {
|
|
2760
|
+
handlePageChange(totalPages);
|
|
2761
|
+
};
|
|
2752
2762
|
const getVisiblePages = () => {
|
|
2753
2763
|
const pageButtons = [];
|
|
2754
2764
|
let startPage = 1;
|
|
@@ -2761,7 +2771,7 @@ var Pagination = ({
|
|
|
2761
2771
|
startPage = totalPages - maxVisiblePages + 1;
|
|
2762
2772
|
} else {
|
|
2763
2773
|
startPage = currentPage - halfVisible;
|
|
2764
|
-
endPage =
|
|
2774
|
+
endPage = startPage + maxVisiblePages - 1;
|
|
2765
2775
|
}
|
|
2766
2776
|
}
|
|
2767
2777
|
for (let i = startPage; i <= endPage; i++) {
|
|
@@ -2772,6 +2782,8 @@ var Pagination = ({
|
|
|
2772
2782
|
variant: currentPage === i ? "primary" : "tertiary",
|
|
2773
2783
|
size: "sm",
|
|
2774
2784
|
onClick: () => handlePageChange(i),
|
|
2785
|
+
"aria-label": `Page ${i} of ${totalPages}`,
|
|
2786
|
+
"aria-current": currentPage === i ? "page" : void 0,
|
|
2775
2787
|
children: i
|
|
2776
2788
|
},
|
|
2777
2789
|
i
|
|
@@ -2788,7 +2800,14 @@ var Pagination = ({
|
|
|
2788
2800
|
" to"
|
|
2789
2801
|
] }),
|
|
2790
2802
|
onItemsPerPageChange ? /* @__PURE__ */ jsxs(Select, { value: itemsPerPage.toString(), onValueChange: handleItemsPerPageChange, children: [
|
|
2791
|
-
/* @__PURE__ */ jsx(
|
|
2803
|
+
/* @__PURE__ */ jsx(
|
|
2804
|
+
SelectTrigger,
|
|
2805
|
+
{
|
|
2806
|
+
className: styles36["items-per-page-trigger"],
|
|
2807
|
+
"aria-label": "Items per page",
|
|
2808
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
2809
|
+
}
|
|
2810
|
+
),
|
|
2792
2811
|
/* @__PURE__ */ jsx(SelectContent, { children: itemsPerPageOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.toString(), children: option }, option)) })
|
|
2793
2812
|
] }) : /* @__PURE__ */ jsx("span", { children: endItem }),
|
|
2794
2813
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -2798,7 +2817,18 @@ var Pagination = ({
|
|
|
2798
2817
|
type
|
|
2799
2818
|
] })
|
|
2800
2819
|
] }) }),
|
|
2801
|
-
/* @__PURE__ */ jsxs("
|
|
2820
|
+
/* @__PURE__ */ jsxs("nav", { className: styles36["page-navigation-container"], "aria-label": "Pagination", children: [
|
|
2821
|
+
showFirstLastButtons && /* @__PURE__ */ jsx(
|
|
2822
|
+
Button,
|
|
2823
|
+
{
|
|
2824
|
+
variant: "tertiary",
|
|
2825
|
+
size: "sm",
|
|
2826
|
+
onClick: handleFirstPage,
|
|
2827
|
+
disabled: isFirstPage,
|
|
2828
|
+
"aria-label": "First page",
|
|
2829
|
+
children: /* @__PURE__ */ jsx(ChevronsLeftIcon, {})
|
|
2830
|
+
}
|
|
2831
|
+
),
|
|
2802
2832
|
/* @__PURE__ */ jsx(
|
|
2803
2833
|
Button,
|
|
2804
2834
|
{
|
|
@@ -2821,6 +2851,17 @@ var Pagination = ({
|
|
|
2821
2851
|
"aria-label": "Next page",
|
|
2822
2852
|
children: /* @__PURE__ */ jsx(ChevronRightIcon3, {})
|
|
2823
2853
|
}
|
|
2854
|
+
),
|
|
2855
|
+
showFirstLastButtons && /* @__PURE__ */ jsx(
|
|
2856
|
+
Button,
|
|
2857
|
+
{
|
|
2858
|
+
variant: "tertiary",
|
|
2859
|
+
size: "sm",
|
|
2860
|
+
onClick: handleLastPage,
|
|
2861
|
+
disabled: isLastPage,
|
|
2862
|
+
"aria-label": `Last page (${totalPages})`,
|
|
2863
|
+
children: /* @__PURE__ */ jsx(ChevronsRightIcon, {})
|
|
2864
|
+
}
|
|
2824
2865
|
)
|
|
2825
2866
|
] })
|
|
2826
2867
|
] });
|
|
@@ -4073,10 +4114,19 @@ var PortalContainerProvider = ({ container, children }) => /* @__PURE__ */ jsx(P
|
|
|
4073
4114
|
var ThemeProvider = ({ customVars, portalContainer, children }) => {
|
|
4074
4115
|
const [ownPortalContainer, setOwnPortalContainer] = React15.useState(null);
|
|
4075
4116
|
const usesOwnPortal = portalContainer === void 0;
|
|
4076
|
-
return /* @__PURE__ */ jsx(PortalContainerProvider, { container: usesOwnPortal ? ownPortalContainer : portalContainer, children: /* @__PURE__ */ jsxs(
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4117
|
+
return /* @__PURE__ */ jsx(PortalContainerProvider, { container: usesOwnPortal ? ownPortalContainer : portalContainer, children: /* @__PURE__ */ jsxs(
|
|
4118
|
+
"div",
|
|
4119
|
+
{
|
|
4120
|
+
id: "equality-theme-provider-root",
|
|
4121
|
+
"data-equality-root": true,
|
|
4122
|
+
className: styles63.root,
|
|
4123
|
+
style: customVars,
|
|
4124
|
+
children: [
|
|
4125
|
+
children,
|
|
4126
|
+
usesOwnPortal && /* @__PURE__ */ jsx(Portal8, { ref: setOwnPortalContainer })
|
|
4127
|
+
]
|
|
4128
|
+
}
|
|
4129
|
+
) });
|
|
4080
4130
|
};
|
|
4081
4131
|
|
|
4082
4132
|
export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BarGraph, BarGraphSegment, BgGradient, Button, Card, CardContent, CardContentHeader, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, CopyButton, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, Heading, Icon, IconButton, InfoCard, Input, Label2 as Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, ProgressIndicatorStep, RadialGraph, RadioDropdown, RadioGroup2 as RadioGroup, RadioGroupItem, ResourceBadge, ScrollArea, ScrollBar, SearchBar, SectionHeading, SegmentedControls, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastAction, ToastClose, ToastContainer, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, badgeVariants, buttonVariants, reducer, toast, useFormField, usePortalContainer, useTheme, useToast };
|