@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.
- package/dist/cjs/components/navigation/pagination/Pagination.props.d.ts +2 -0
- package/dist/cjs/index.js +15 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/navigation/pagination/Pagination.props.d.ts +2 -0
- package/dist/esm/index.js +15 -8
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
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:
|
|
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';
|