Skip to content

Commit

Permalink
type updates
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKurt committed Oct 29, 2024
1 parent 3746a33 commit a3bf724
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/ui-shadcn/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { tv } from "tailwind-variants";



import { cn } from "@/lib/utils";

export type ButtonVariants =
Expand All @@ -20,7 +22,7 @@ export type ButtonVariants =
| "disabled"
| undefined;

interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
variant?: string;
size?: string;
disabled?: boolean;
Expand All @@ -30,7 +32,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
iconPosition?: "left" | "right";
}

type ButtonSizes = "default" | "sm" | "md" | "lg" | "icon" | undefined;
export type ButtonSizes = "default" | "sm" | "md" | "lg" | "icon" | undefined;

const buttonVariants = tv({
base: "inline-flex h-[32px] items-center justify-center gap-2 whitespace-nowrap rounded-[8px] px-[12px] py-[8px] font-mono text-[14px] font-medium leading-[16px] ring-offset-white transition-colors hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 disabled:pointer-events-none dark:ring-offset-neutral-950",
Expand Down
9 changes: 5 additions & 4 deletions src/ui-shadcn/pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import * as React from "react";



import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";

import { cn } from "@/lib/utils";
import { ButtonProps, buttonVariants } from "@/ui-shadcn/button";

import { ButtonProps, ButtonSizes, buttonVariants } from "@/ui-shadcn/button";
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
<nav
role="navigation"
Expand Down Expand Up @@ -38,7 +39,7 @@ const PaginationLink = ({ className, isActive, size = "icon", ...props }: Pagina
className={cn(
buttonVariants({
variant: isActive ? "outlined-primary" : "outlined-secondary",
size,
size: size as ButtonSizes,
}),
className,
)}
Expand Down Expand Up @@ -96,4 +97,4 @@ export {
PaginationLink,
PaginationNext,
PaginationPrevious,
};
};

0 comments on commit a3bf724

Please sign in to comment.