aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
154 lines • 3.45 kB
TypeScript
import React from "react";
export interface GlassPaginationProps {
/**
* Current page (1-based)
*/
currentPage: number;
/**
* Total number of pages
*/
totalPages: number;
/**
* Callback when page changes
*/
onPageChange: (page: number) => void;
/**
* Maximum number of page buttons to show
*/
maxPageButtons?: number;
/**
* Show first/last page buttons
*/
showFirstLast?: boolean;
/**
* Show previous/next buttons
*/
showPrevNext?: boolean;
/**
* Size variant
*/
size?: "sm" | "md" | "lg";
/**
* Custom className
*/
className?: string;
/**
* Disabled state
*/
disabled?: boolean;
/**
* Loading state
*/
loading?: boolean;
/**
* Accessible label for the pagination component
*/
"aria-label"?: string;
/**
* Whether to announce page changes to screen readers
*/
announcePageChanges?: boolean;
"data-testid"?: string;
}
export interface GlassPaginationContentProps {
/**
* Pagination content
*/
children: React.ReactNode;
/**
* Custom className
*/
className?: string;
}
export interface GlassPaginationItemProps {
/**
* Item content
*/
children: React.ReactNode;
/**
* Whether item is active
*/
isActive?: boolean;
/**
* Whether item is disabled
*/
disabled?: boolean;
/**
* Click handler
*/
onClick?: () => void;
/**
* Size variant
*/
size?: "sm" | "md" | "lg";
/**
* Custom className
*/
className?: string;
/**
* Accessible label
*/
ariaLabel?: string;
/**
* Internal ref for page registration
*/
innerRef?: (el: HTMLDivElement | null) => void;
}
/**
* GlassPagination component
* A glassmorphism pagination component
*/
export declare const GlassPagination: React.FC<GlassPaginationProps>;
/**
* GlassPaginationContent component
* Wrapper for pagination content
*/
export declare const GlassPaginationContent: React.FC<GlassPaginationContentProps>;
/**
* GlassPaginationItem component
* Individual pagination item/button
*/
export declare const GlassPaginationItem: React.FC<GlassPaginationItemProps>;
/**
* Hook for managing pagination state
*/
export declare const usePagination: (initialPage?: number, totalItems?: number, itemsPerPage?: number) => {
currentPage: number;
totalPages: number;
itemsPerPage: number;
setItemsPerPage: React.Dispatch<React.SetStateAction<number>>;
currentItems: {
startIndex: number;
endIndex: number;
};
goToPage: (page: number) => void;
nextPage: () => void;
prevPage: () => void;
firstPage: () => void;
lastPage: () => void;
hasNextPage: boolean;
hasPrevPage: boolean;
};
/**
* Compound pagination component with item info
*/
export interface GlassPaginationWithInfoProps extends GlassPaginationProps {
/**
* Total number of items
*/
totalItems: number;
/**
* Items per page
*/
itemsPerPage: number;
/**
* Item name (e.g., "items", "results", "products")
*/
itemName?: string;
/**
* Show item range info
*/
showItemInfo?: boolean;
}
export declare const GlassPaginationWithInfo: React.FC<GlassPaginationWithInfoProps>;
//# sourceMappingURL=GlassPagination.d.ts.map