@snapdragonsnursery/react-components 1.1.20 → 1.1.22
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/package.json
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Provides consistent pagination styling for tables
|
|
3
3
|
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
import { Button } from "./button";
|
|
7
5
|
import { ChevronLeftIcon, ChevronRightIcon, EllipsisHorizontalIcon } from "@heroicons/react/24/outline";
|
|
8
6
|
|
|
7
|
+
import { cn } from "../../lib/utils";
|
|
8
|
+
import { buttonVariants } from "./button";
|
|
9
|
+
|
|
9
10
|
const Pagination = ({ className, ...props }) => (
|
|
10
11
|
<nav
|
|
11
12
|
role="navigation"
|
|
@@ -32,14 +33,13 @@ PaginationItem.displayName = "PaginationItem";
|
|
|
32
33
|
|
|
33
34
|
const PaginationLink = React.forwardRef(
|
|
34
35
|
({ className, isActive, size = "icon", ...props }, ref) => (
|
|
35
|
-
<
|
|
36
|
+
<a
|
|
36
37
|
aria-current={isActive ? "page" : undefined}
|
|
37
|
-
variant={isActive ? "default" : "outline"}
|
|
38
|
-
size={size}
|
|
39
|
-
ref={ref}
|
|
40
38
|
className={cn(
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
buttonVariants({
|
|
40
|
+
variant: isActive ? "outline" : "ghost",
|
|
41
|
+
size,
|
|
42
|
+
}),
|
|
43
43
|
className
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
@@ -52,7 +52,6 @@ const PaginationPrevious = React.forwardRef(({ className, ...props }, ref) => (
|
|
|
52
52
|
<PaginationLink
|
|
53
53
|
aria-label="Go to previous page"
|
|
54
54
|
size="default"
|
|
55
|
-
ref={ref}
|
|
56
55
|
className={cn("gap-1 pl-2.5", className)}
|
|
57
56
|
{...props}
|
|
58
57
|
>
|
|
@@ -66,7 +65,6 @@ const PaginationNext = React.forwardRef(({ className, ...props }, ref) => (
|
|
|
66
65
|
<PaginationLink
|
|
67
66
|
aria-label="Go to next page"
|
|
68
67
|
size="default"
|
|
69
|
-
ref={ref}
|
|
70
68
|
className={cn("gap-1 pr-2.5", className)}
|
|
71
69
|
{...props}
|
|
72
70
|
>
|