laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
165 lines (164 loc) • 3.76 kB
JavaScript
"use client";
import { jsx as i, jsxs as o } from "react/jsx-runtime";
import { cn as t } from "../../lib/utils.js";
import { buttonVariants as c } from "./button.js";
import p from "../../node_modules/lucide-react/dist/esm/icons/ellipsis.js";
import m from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
import d from "../../node_modules/lucide-react/dist/esm/icons/chevron-first.js";
import g from "../../node_modules/lucide-react/dist/esm/icons/chevron-last.js";
function C({ className: a, ...n }) {
return /* @__PURE__ */ i(
"nav",
{
role: "navigation",
"aria-label": "pagination",
"data-slot": "pagination",
className: t("mx-auto flex w-full justify-center", a),
...n
}
);
}
function j({
className: a,
...n
}) {
return /* @__PURE__ */ i(
"ul",
{
"data-slot": "pagination-content",
className: t("flex flex-row items-center gap-1", a),
...n
}
);
}
function y({ ...a }) {
return /* @__PURE__ */ i("li", { "data-slot": "pagination-item", ...a });
}
function r({
className: a,
isActive: n,
isDisabled: e,
size: s = "icon",
...l
}) {
return /* @__PURE__ */ i(
"a",
{
"aria-current": n ? "page" : void 0,
"data-slot": "pagination-link",
"data-active": n,
className: t(
c({
variant: n ? "outline" : "ghost",
// variant: isDisabled ? "disabled" : isActive ? "outline" : "ghost",
size: s
}),
e && "pointer-events-none cursor-not-allowed opacity-40",
a
),
...l
}
);
}
function G({
className: a,
label: n,
...e
}) {
return /* @__PURE__ */ o(
r,
{
"aria-label": "Go to previous page",
className: t("gap-1 px-2.5 sm:pl-2.5", a),
...e,
children: [
/* @__PURE__ */ i(d, {}),
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Primo" })
]
}
);
}
function L({
className: a,
label: n,
...e
}) {
return /* @__PURE__ */ o(
r,
{
"aria-label": "Go to previous page",
className: t("gap-1 px-2.5 sm:pl-2.5", a),
...e,
children: [
/* @__PURE__ */ i(u, {}),
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Precedente" })
]
}
);
}
function w({
className: a,
label: n,
...e
}) {
return /* @__PURE__ */ o(
r,
{
"aria-label": "Go to next page",
className: t("gap-1 px-2.5 sm:pr-2.5", a),
...e,
children: [
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Prossimo" }),
/* @__PURE__ */ i(m, {})
]
}
);
}
function z({
className: a,
label: n,
...e
}) {
return /* @__PURE__ */ o(
r,
{
"aria-label": "Go to next page",
className: t("gap-1 px-2.5 sm:pr-2.5", a),
...e,
children: [
/* @__PURE__ */ i("span", { className: "hidden sm:block", children: n ?? "Ultimo" }),
/* @__PURE__ */ i(g, {})
]
}
);
}
function E({
className: a,
...n
}) {
return /* @__PURE__ */ o(
"span",
{
"aria-hidden": !0,
"data-slot": "pagination-ellipsis",
className: t("flex size-9 items-center justify-center", a),
...n,
children: [
/* @__PURE__ */ i(p, { className: "size-4" }),
/* @__PURE__ */ i("span", { className: "sr-only", children: "More pages" })
]
}
);
}
export {
C as Pagination,
j as PaginationContent,
E as PaginationEllipsis,
G as PaginationFirst,
y as PaginationItem,
z as PaginationLast,
r as PaginationLink,
w as PaginationNext,
L as PaginationPrevious
};