@ichaingo/pagination 1.5.7-beta → 1.5.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC;IACvE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,SAAS,EACT,KAAK,EAAE,YAAY,EACnB,QAAQ,EACR,eAA8B,EAC9B,WAAW,EACX,MAA+D,EAC/D,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACX,EAAE,qBAAqB,kDA4KvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC;IACvE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,SAAS,EACT,KAAK,EAAE,YAAY,EACnB,QAAQ,EACR,eAA8B,EAC9B,WAAW,EACX,MAA+D,EAC/D,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACX,EAAE,qBAAqB,kDA4KvB"}
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use client';
2
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
+ import { jsx as i, jsxs as d } from "react/jsx-runtime";
3
3
  import * as z from "react";
4
4
  import { Pagination as j, PaginationContent as V, PaginationItem as s, PaginationLink as a, PaginationEllipsis as v } from "@ichaingo/ui/pagination";
5
5
  import { Select as S, SelectTrigger as L, SelectValue as I, SelectContent as R, SelectItem as E } from "@ichaingo/ui/select";
6
6
  import { twMerge as m } from "tailwind-merge";
7
- import { useTranslate as F } from "@ichaingo/tolgee/client";
7
+ import { useTranslations as F } from "next-intl";
8
8
  import { ChevronRight as G, ChevronLeft as T } from "lucide-react";
9
9
  const N = 1e4;
10
10
  function K({
@@ -18,12 +18,12 @@ function K({
18
18
  onPageSizeChange: h,
19
19
  totalLabel: M
20
20
  }) {
21
- const { t: f } = F(), w = Math.min(p, N), l = Math.ceil(w / x), y = () => {
22
- const i = [];
21
+ const f = F(), w = Math.min(p, N), l = Math.ceil(w / x), y = () => {
22
+ const e = [];
23
23
  let o = Math.max(1, r - Math.floor(1.5));
24
24
  const n = Math.min(l, o + 3 - 1);
25
- n - o + 1 < 3 && (o = Math.max(1, n - 3 + 1)), o > 1 && (i.push(
26
- /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
25
+ n - o + 1 < 3 && (o = Math.max(1, n - 3 + 1)), o > 1 && (e.push(
26
+ /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
27
27
  a,
28
28
  {
29
29
  size: "sm",
@@ -35,12 +35,12 @@ function K({
35
35
  children: "1"
36
36
  }
37
37
  ) }, "first")
38
- ), o > 2 && i.push(
39
- /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(v, {}) }, "ellipsis-start")
38
+ ), o > 2 && e.push(
39
+ /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(v, {}) }, "ellipsis-start")
40
40
  ));
41
41
  for (let c = o; c <= n; c++)
42
- i.push(
43
- /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
42
+ e.push(
43
+ /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
44
44
  a,
45
45
  {
46
46
  size: "sm",
@@ -53,10 +53,10 @@ function K({
53
53
  }
54
54
  ) }, c)
55
55
  );
56
- return n < l && (n < l - 1 && i.push(
57
- /* @__PURE__ */ e(s, { className: "cursor-pointer", children: /* @__PURE__ */ e(v, {}) }, "ellipsis-end")
58
- ), i.push(
59
- /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
56
+ return n < l && (n < l - 1 && e.push(
57
+ /* @__PURE__ */ i(s, { className: "cursor-pointer", children: /* @__PURE__ */ i(v, {}) }, "ellipsis-end")
58
+ ), e.push(
59
+ /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
60
60
  a,
61
61
  {
62
62
  size: "sm",
@@ -68,10 +68,10 @@ function K({
68
68
  children: l
69
69
  }
70
70
  ) }, "last")
71
- )), i;
71
+ )), e;
72
72
  };
73
- return w <= b[0] ? null : /* @__PURE__ */ e(j, { className: m("w-full max-w-[100vw] mt-3", k), children: /* @__PURE__ */ d(V, { className: "w-full flex flex-row items-center justify-between flex-wrap", children: [
74
- u.includes("total") && /* @__PURE__ */ e(s, { className: "mr-auto order-1 flex-1 overflow-hidden md:overflow-visible md:order-0 ", children: M || /* @__PURE__ */ d("span", { className: "text-sm block text-subtitle w-full truncate", children: [
73
+ return w <= b[0] ? null : /* @__PURE__ */ i(j, { className: m("w-full max-w-[100vw] mt-3", k), children: /* @__PURE__ */ d(V, { className: "w-full flex flex-row items-center justify-between flex-wrap", children: [
74
+ u.includes("total") && /* @__PURE__ */ i(s, { className: "mr-auto order-1 flex-1 overflow-hidden md:overflow-visible md:order-0 ", children: M || /* @__PURE__ */ d("span", { className: "text-sm block text-subtitle w-full truncate", children: [
75
75
  f("common.pagination.total"),
76
76
  " ",
77
77
  p,
@@ -79,10 +79,10 @@ function K({
79
79
  f("common.pagination.item"),
80
80
  p > N ? `${f("common.pagination.totalTip")}` : ""
81
81
  ] }) }, "total"),
82
- /* @__PURE__ */ e("div", { className: "w-full md:w-auto md:flex-2 flex items-center justify-center", children: u.filter((i) => i !== "total" && i !== "sizes").map((i) => {
83
- switch (i) {
82
+ /* @__PURE__ */ i("div", { className: "w-full md:w-auto md:flex-2 flex items-center justify-center", children: u.filter((e) => e !== "total" && e !== "sizes").map((e) => {
83
+ switch (e) {
84
84
  case "prev":
85
- return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
85
+ return /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
86
86
  a,
87
87
  {
88
88
  "aria-label": "Go to previous page",
@@ -92,13 +92,13 @@ function K({
92
92
  r === 1 ? "pointer-events-none opacity-50" : ""
93
93
  ),
94
94
  onClick: () => t == null ? void 0 : t(Math.max(1, r - 1)),
95
- children: /* @__PURE__ */ e(T, { size: 16 })
95
+ children: /* @__PURE__ */ i(T, { size: 16 })
96
96
  }
97
97
  ) }, "prev");
98
98
  case "page":
99
- return /* @__PURE__ */ e(z.Fragment, { children: y() }, "page");
99
+ return /* @__PURE__ */ i(z.Fragment, { children: y() }, "page");
100
100
  case "next":
101
- return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(
101
+ return /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(
102
102
  a,
103
103
  {
104
104
  size: "sm",
@@ -107,7 +107,7 @@ function K({
107
107
  r === l ? "pointer-events-none opacity-50" : ""
108
108
  ),
109
109
  onClick: () => t == null ? void 0 : t(Math.min(l, r + 1)),
110
- children: /* @__PURE__ */ e(G, { size: 16 })
110
+ children: /* @__PURE__ */ i(G, { size: 16 })
111
111
  }
112
112
  ) }, "next");
113
113
  default:
@@ -115,22 +115,22 @@ function K({
115
115
  }
116
116
  }) }),
117
117
  u.includes("sizes") && h && /* @__PURE__ */ d(s, { className: "gap-2 flex shrink-0 order-1 lg:order-0 items-center py-0.5 flex-1 justify-end", children: [
118
- /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: f("common.pagination.sizeLabel") }),
118
+ /* @__PURE__ */ i("span", { className: "text-sm text-muted-foreground", children: f("common.pagination.sizeLabel") }),
119
119
  /* @__PURE__ */ d(
120
120
  S,
121
121
  {
122
122
  value: x.toString(),
123
- onValueChange: (i) => h(Number(i)),
123
+ onValueChange: (e) => h(Number(e)),
124
124
  children: [
125
- /* @__PURE__ */ e(
125
+ /* @__PURE__ */ i(
126
126
  L,
127
127
  {
128
128
  size: "sm",
129
129
  className: "border-1 border-input w-[70px] focus:ring-0 text-black bg-background focus-visible:outline-0 focus-ring-0 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-input py-1",
130
- children: /* @__PURE__ */ e(I, {})
130
+ children: /* @__PURE__ */ i(I, {})
131
131
  }
132
132
  ),
133
- /* @__PURE__ */ e(R, { className: "w-20 bg-module", children: b.map((i) => /* @__PURE__ */ e(E, { value: i.toString(), className: "text-sm px-2 py-1 cursor-pointer hover:bg-background", children: i }, i)) })
133
+ /* @__PURE__ */ i(R, { className: "w-20 bg-module", children: b.map((e) => /* @__PURE__ */ i(E, { value: e.toString(), className: "text-sm px-2 py-1 cursor-pointer hover:bg-background", children: e }, e)) })
134
134
  ]
135
135
  }
136
136
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichaingo/pagination",
3
- "version": "1.5.7-beta",
3
+ "version": "1.5.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -16,9 +16,10 @@
16
16
  "dependencies": {
17
17
  "react": "19.1.1",
18
18
  "react-dom": "19.1.1",
19
+ "next-intl": "4.6.1",
19
20
  "tailwind-merge": "3.3.1",
20
21
  "lucide-react": "0.539.0",
21
- "@ichaingo/ui": "1.5.7-beta"
22
+ "@ichaingo/ui": "1.5.7"
22
23
  },
23
24
  "devDependencies": {
24
25
  "rollup-plugin-preserve-use-client": "3.0.1"
package/src/index.tsx CHANGED
@@ -15,8 +15,7 @@ import {
15
15
  SelectValue,
16
16
  } from "@ichaingo/ui/select";
17
17
  import { twMerge } from "tailwind-merge";
18
- import { useTranslate } from "@ichaingo/tolgee/client";
19
-
18
+ import { useTranslations } from "next-intl";
20
19
  import { ChevronLeft, ChevronRight } from "lucide-react";
21
20
 
22
21
  interface CustomPaginationProps {
@@ -42,7 +41,7 @@ export default function CustomPagination({
42
41
  onPageSizeChange,
43
42
  totalLabel
44
43
  }: CustomPaginationProps) {
45
- const { t } = useTranslate();
44
+ const t = useTranslations()
46
45
  const total = Math.min(initialTotal, limit)
47
46
  const totalPages = Math.ceil(total / pageSize);
48
47
 
package/tsconfig.json CHANGED
@@ -2,9 +2,6 @@
2
2
  "files": [],
3
3
  "include": [],
4
4
  "references": [
5
- {
6
- "path": "../tolgee"
7
- },
8
5
  {
9
6
  "path": "../ui"
10
7
  },
package/tsconfig.lib.json CHANGED
@@ -43,9 +43,6 @@
43
43
  ],
44
44
  "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"],
45
45
  "references": [
46
- {
47
- "path": "../tolgee/tsconfig.lib.json"
48
- },
49
46
  {
50
47
  "path": "../ui/tsconfig.lib.json"
51
48
  }
package/vite.config.ts CHANGED
@@ -42,7 +42,7 @@ export default defineConfig(() => ({
42
42
  rollupOptions: {
43
43
  // External packages that should not be bundled into your library.
44
44
  external: [
45
- 'react', 'react-dom', 'react/jsx-runtime', 'tailwind-merge', 'lucide-react', '@ichaingo/tolgee',
45
+ 'react', 'react-dom', 'react/jsx-runtime', 'tailwind-merge', 'lucide-react', 'next-intl',
46
46
  /^@ichaingo\/.+/,
47
47
  /^@radix-ui\/.+/
48
48
  ],