@andreagiugni/tailwind-dashboard-ui 1.0.29 → 1.0.31
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/{chunk-2BCVEKTG.js → chunk-AMSZD2ZE.js} +5 -4
- package/dist/chunk-AMSZD2ZE.js.map +1 -0
- package/dist/{chunk-HNIERFMV.cjs → chunk-HBQCQWQW.cjs} +5 -4
- package/dist/chunk-HBQCQWQW.cjs.map +1 -0
- package/dist/{chunk-W6E275RF.js → chunk-N4BZYVL4.js} +5 -3
- package/dist/chunk-N4BZYVL4.js.map +1 -0
- package/dist/{chunk-ZULPBSQV.cjs → chunk-XB2NE3EA.cjs} +5 -3
- package/dist/chunk-XB2NE3EA.cjs.map +1 -0
- package/dist/components/Charts/BarChart.cjs +2 -2
- package/dist/components/Charts/BarChart.js +1 -1
- package/dist/components/Charts/LineChart.cjs +2 -2
- package/dist/components/Charts/LineChart.js +1 -1
- package/dist/index.cjs +37 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2BCVEKTG.js.map +0 -1
- package/dist/chunk-HNIERFMV.cjs.map +0 -1
- package/dist/chunk-W6E275RF.js.map +0 -1
- package/dist/chunk-ZULPBSQV.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { BarChart } from './chunk-
|
|
3
|
-
export { LineChart } from './chunk-
|
|
2
|
+
export { BarChart } from './chunk-AMSZD2ZE.js';
|
|
3
|
+
export { LineChart } from './chunk-N4BZYVL4.js';
|
|
4
4
|
export { Calendar, Modal } from './chunk-NJBVRPWW.js';
|
|
5
5
|
export { Editor } from './chunk-PFCUA2W2.js';
|
|
6
6
|
export { ColorPicker } from './chunk-KKDLEGKJ.js';
|
|
@@ -538,54 +538,65 @@ var justifyByAlign = {
|
|
|
538
538
|
center: "justify-center",
|
|
539
539
|
right: "justify-end"
|
|
540
540
|
};
|
|
541
|
+
var getPaginationItems = (currentPage, totalPages) => {
|
|
542
|
+
const total = Math.max(1, totalPages);
|
|
543
|
+
const current = Math.min(Math.max(currentPage, 1), total);
|
|
544
|
+
if (total <= 3) {
|
|
545
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
546
|
+
}
|
|
547
|
+
if (current === 1) {
|
|
548
|
+
return [1, 2, "ellipsis", total];
|
|
549
|
+
}
|
|
550
|
+
if (current === total) {
|
|
551
|
+
return [1, "ellipsis", total - 1, total];
|
|
552
|
+
}
|
|
553
|
+
return [current - 1, current, current + 1];
|
|
554
|
+
};
|
|
541
555
|
var Pagination = ({
|
|
542
556
|
currentPage,
|
|
543
557
|
totalPages,
|
|
544
558
|
onPageChange,
|
|
545
559
|
align
|
|
546
560
|
}) => {
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
);
|
|
561
|
+
const total = Math.max(1, totalPages);
|
|
562
|
+
const current = Math.min(Math.max(currentPage, 1), total);
|
|
563
|
+
const paginationItems = getPaginationItems(current, total);
|
|
551
564
|
const prev = /* @__PURE__ */ jsx(
|
|
552
565
|
"button",
|
|
553
566
|
{
|
|
554
|
-
onClick: () => onPageChange(
|
|
555
|
-
disabled:
|
|
567
|
+
onClick: () => onPageChange(current - 1),
|
|
568
|
+
disabled: current === 1,
|
|
556
569
|
"aria-label": "Previous",
|
|
557
570
|
className: navButton,
|
|
558
571
|
children: "Previous"
|
|
559
572
|
}
|
|
560
573
|
);
|
|
561
|
-
const indices = /* @__PURE__ */
|
|
562
|
-
|
|
563
|
-
pagesAroundCurrent.map((page) => /* @__PURE__ */ jsx(
|
|
574
|
+
const indices = /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: paginationItems.map(
|
|
575
|
+
(item, index) => item === "ellipsis" ? /* @__PURE__ */ jsx("span", { className: "px-2 text-gray-500 dark:text-gray-400", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsx(
|
|
564
576
|
"button",
|
|
565
577
|
{
|
|
566
|
-
onClick: () => onPageChange(
|
|
567
|
-
"aria-current":
|
|
578
|
+
onClick: () => onPageChange(item),
|
|
579
|
+
"aria-current": current === item ? "page" : void 0,
|
|
568
580
|
className: cn(
|
|
569
|
-
"flex w-10 items-center justify-center
|
|
570
|
-
|
|
581
|
+
"flex h-10 w-10 items-center justify-center rounded-lg border text-sm font-medium shadow-theme-xs",
|
|
582
|
+
current === item ? (
|
|
571
583
|
// active page keeps its color on hover (no hover restyle)
|
|
572
|
-
"bg-brand-500 text-white"
|
|
584
|
+
"border-brand-500 bg-brand-500 text-white"
|
|
573
585
|
) : (
|
|
574
586
|
// hover effect applies only to non-active page indices
|
|
575
|
-
"text-gray-700 hover:bg-blue-500/[0.08] hover:text-brand-500 dark:text-gray-400 dark:hover:text-brand-500"
|
|
587
|
+
"border-gray-300 bg-white text-gray-700 hover:bg-blue-500/[0.08] hover:text-brand-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:text-brand-500"
|
|
576
588
|
)
|
|
577
589
|
),
|
|
578
|
-
children:
|
|
590
|
+
children: item
|
|
579
591
|
},
|
|
580
|
-
|
|
581
|
-
)
|
|
582
|
-
|
|
583
|
-
] });
|
|
592
|
+
item
|
|
593
|
+
)
|
|
594
|
+
) });
|
|
584
595
|
const next = /* @__PURE__ */ jsx(
|
|
585
596
|
"button",
|
|
586
597
|
{
|
|
587
|
-
onClick: () => onPageChange(
|
|
588
|
-
disabled:
|
|
598
|
+
onClick: () => onPageChange(current + 1),
|
|
599
|
+
disabled: current === total,
|
|
589
600
|
"aria-label": "Next",
|
|
590
601
|
className: navButton,
|
|
591
602
|
children: "Next"
|