@aurora-ds/components 0.18.1 → 0.18.2

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.
@@ -19,4 +19,6 @@ export type PaginationProps = {
19
19
  };
20
20
  export type PaginationStyleParams = {
21
21
  disabled?: boolean;
22
+ /** If true, apply the active (current page) styles */
23
+ active?: boolean;
22
24
  };
package/dist/cjs/index.js CHANGED
@@ -2511,7 +2511,7 @@ const PAGINATION_STYLES = theme.createStyles((theme) => ({
2511
2511
  alignItems: 'center',
2512
2512
  gap: theme.spacing.xs,
2513
2513
  },
2514
- pageButton: ({ disabled = false }) => ({
2514
+ pageButton: ({ disabled = false, active = false }) => ({
2515
2515
  display: 'inline-flex',
2516
2516
  alignItems: 'center',
2517
2517
  justifyContent: 'center',
@@ -2527,17 +2527,24 @@ const PAGINATION_STYLES = theme.createStyles((theme) => ({
2527
2527
  fontFamily: 'inherit',
2528
2528
  fontSize: theme.fontSize.md,
2529
2529
  fontWeight: theme.fontWeight.medium,
2530
- backgroundColor: 'transparent',
2531
- color: theme.colors.text,
2530
+ backgroundColor: active ? theme.colors.primary : 'transparent',
2531
+ color: active ? theme.colors.onPrimary : theme.colors.text,
2532
2532
  border: 'none',
2533
2533
  opacity: disabled ? 0.4 : 1,
2534
- ':hover': disabled ? {} : {
2534
+ ':hover': disabled ? {} : (active ? {
2535
+ backgroundColor: theme.colors.primary,
2536
+ color: theme.colors.onPrimary,
2537
+ } : {
2535
2538
  backgroundColor: theme.colors.surfaceHover,
2536
- },
2537
- ':active': disabled ? {} : {
2539
+ }),
2540
+ ':active': disabled ? {} : (active ? {
2541
+ backgroundColor: theme.colors.primary,
2542
+ color: theme.colors.onPrimary,
2543
+ } : {
2538
2544
  backgroundColor: theme.colors.surfaceActive,
2539
- },
2545
+ }),
2540
2546
  }),
2547
+ // kept for backward compatibility in case some usages relied on it directly
2541
2548
  activePageButton: {
2542
2549
  backgroundColor: theme.colors.primary,
2543
2550
  color: theme.colors.onPrimary,
@@ -2629,7 +2636,7 @@ const Pagination = ({ currentPage, totalPages, onPageChange, onPrevious, onNext,
2629
2636
  const isNextDisabled = currentPage === totalPages;
2630
2637
  return (jsxRuntime.jsxs("nav", { "aria-label": ariaLabel, className: styles.root, children: [jsxRuntime.jsx("button", { type: 'button', onClick: handlePrevious, disabled: isPreviousDisabled, "aria-label": 'Page précédente', className: styles.navigationButton({ disabled: isPreviousDisabled }), children: jsxRuntime.jsx(ChevronLeftIcon, {}) }), visiblePages.map((page) => {
2631
2638
  const isActive = page === currentPage;
2632
- return (jsxRuntime.jsx("button", { type: 'button', onClick: () => handlePageClick(page), "aria-label": `Page ${page}`, "aria-current": isActive ? 'page' : undefined, className: `${styles.pageButton({ disabled: false })} ${isActive ? styles.activePageButton : ''}`, children: page }, page));
2639
+ return (jsxRuntime.jsx("button", { type: 'button', onClick: () => handlePageClick(page), "aria-label": `Page ${page}`, "aria-current": isActive ? 'page' : undefined, className: styles.pageButton({ disabled: false, active: isActive }), children: page }, page));
2633
2640
  }), jsxRuntime.jsx("button", { type: 'button', onClick: handleNext, disabled: isNextDisabled, "aria-label": 'Page suivante', className: styles.navigationButton({ disabled: isNextDisabled }), children: jsxRuntime.jsx(ChevronRightIcon, {}) })] }));
2634
2641
  };
2635
2642
  Pagination.displayName = 'Pagination';