@snapdragonsnursery/react-components 1.1.21 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapdragonsnursery/react-components",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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
- <Button
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
- "h-9 w-9 p-0",
42
- isActive && "bg-primary text-primary-foreground hover:bg-primary/90",
39
+ buttonVariants({
40
+ variant: isActive ? "outline" : "ghost",
41
+ size,
42
+ }),
43
43
  className
44
44
  )}
45
45
  {...props}
@@ -51,13 +51,12 @@ PaginationLink.displayName = "PaginationLink";
51
51
  const PaginationPrevious = React.forwardRef(({ className, ...props }, ref) => (
52
52
  <PaginationLink
53
53
  aria-label="Go to previous page"
54
- size="icon"
55
- ref={ref}
56
- className={cn("gap-1", className)}
54
+ size="default"
55
+ className={cn("gap-1 pl-2.5", className)}
57
56
  {...props}
58
57
  >
59
58
  <ChevronLeftIcon className="h-4 w-4" />
60
- <span className="sr-only">Previous</span>
59
+ <span>Previous</span>
61
60
  </PaginationLink>
62
61
  ));
63
62
  PaginationPrevious.displayName = "PaginationPrevious";
@@ -65,13 +64,12 @@ PaginationPrevious.displayName = "PaginationPrevious";
65
64
  const PaginationNext = React.forwardRef(({ className, ...props }, ref) => (
66
65
  <PaginationLink
67
66
  aria-label="Go to next page"
68
- size="icon"
69
- ref={ref}
70
- className={cn("gap-1", className)}
67
+ size="default"
68
+ className={cn("gap-1 pr-2.5", className)}
71
69
  {...props}
72
70
  >
71
+ <span>Next</span>
73
72
  <ChevronRightIcon className="h-4 w-4" />
74
- <span className="sr-only">Next</span>
75
73
  </PaginationLink>
76
74
  ));
77
75
  PaginationNext.displayName = "PaginationNext";