@mijn-ui/react-pagination 0.0.16 → 0.0.18
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/README.md +1 -1
- package/dist/index.d.ts +33 -2
- package/dist/index.js +6 -5
- package/dist/metafile-esm.json +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
4
|
+
import * as _mijn_ui_react_theme from '@mijn-ui/react-theme';
|
|
5
|
+
import { UnstyledProps, UnstyledComponentWithSlots, PaginationSlots, paginationStyles } from '@mijn-ui/react-theme';
|
|
2
6
|
import * as React from 'react';
|
|
3
|
-
import { UnstyledComponentWithSlots, PaginationSlots, paginationStyles, UnstyledProps } from '@mijn-ui/react-theme';
|
|
4
7
|
|
|
5
8
|
type PaginationBaseProps = UnstyledComponentWithSlots<PaginationSlots>;
|
|
6
9
|
type PaginationContextType = PaginationBaseProps & {
|
|
@@ -14,6 +17,34 @@ type PaginationContextType = PaginationBaseProps & {
|
|
|
14
17
|
goToNextPage: () => void;
|
|
15
18
|
};
|
|
16
19
|
declare const usePaginationContext: () => PaginationContextType;
|
|
20
|
+
declare const usePaginationStyles: (unstyledOverride?: boolean) => {
|
|
21
|
+
classNames: _mijn_ui_react_theme.SlotsToClasses<"base" | "content" | "list" | "listItem" | "previousBtn" | "previousElipsis" | "nextBtn" | "nextElipsis"> | undefined;
|
|
22
|
+
isUnstyled: boolean | undefined;
|
|
23
|
+
base: (slotProps?: ({
|
|
24
|
+
active?: boolean | undefined;
|
|
25
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
26
|
+
content: (slotProps?: ({
|
|
27
|
+
active?: boolean | undefined;
|
|
28
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
29
|
+
list: (slotProps?: ({
|
|
30
|
+
active?: boolean | undefined;
|
|
31
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
32
|
+
listItem: (slotProps?: ({
|
|
33
|
+
active?: boolean | undefined;
|
|
34
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
35
|
+
previousBtn: (slotProps?: ({
|
|
36
|
+
active?: boolean | undefined;
|
|
37
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
38
|
+
previousElipsis: (slotProps?: ({
|
|
39
|
+
active?: boolean | undefined;
|
|
40
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
41
|
+
nextBtn: (slotProps?: ({
|
|
42
|
+
active?: boolean | undefined;
|
|
43
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
44
|
+
nextElipsis: (slotProps?: ({
|
|
45
|
+
active?: boolean | undefined;
|
|
46
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
47
|
+
};
|
|
17
48
|
type PaginationProps = {
|
|
18
49
|
totalPages: number;
|
|
19
50
|
itemsPerPage: number;
|
|
@@ -35,4 +66,4 @@ declare const PaginationPreviousEllipsis: ({ className, unstyled, ...props }: Pa
|
|
|
35
66
|
type PaginationNextEllipsisProps = React.ComponentProps<"span"> & UnstyledProps;
|
|
36
67
|
declare const PaginationNextEllipsis: ({ className, unstyled, ...props }: PaginationNextEllipsisProps) => react_jsx_runtime.JSX.Element | null;
|
|
37
68
|
|
|
38
|
-
export { Pagination, PaginationContent, PaginationList, PaginationNextButton, PaginationNextEllipsis, PaginationPreviousButton, PaginationPreviousEllipsis, type PaginationProps, usePaginationContext };
|
|
69
|
+
export { Pagination, PaginationContent, type PaginationContentProps, PaginationList, type PaginationListProps, PaginationNextButton, type PaginationNextButtonProps, PaginationNextEllipsis, type PaginationNextEllipsisProps, PaginationPreviousButton, PaginationPreviousEllipsis, type PaginationProps, usePaginationContext, usePaginationStyles };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
3
|
// src/pagination.tsx
|
|
4
4
|
import * as React from "react";
|
|
@@ -131,7 +131,7 @@ var PaginationList = ({
|
|
|
131
131
|
...props
|
|
132
132
|
}) => {
|
|
133
133
|
const { currentPage, setPage, paginationRange } = usePaginationContext();
|
|
134
|
-
const { list,
|
|
134
|
+
const { list, listItem, classNames } = usePaginationStyles(unstyled);
|
|
135
135
|
return /* @__PURE__ */ jsx(
|
|
136
136
|
"ul",
|
|
137
137
|
{
|
|
@@ -140,9 +140,9 @@ var PaginationList = ({
|
|
|
140
140
|
children: paginationRange.map((page, index) => /* @__PURE__ */ jsx("li", { onClick: () => setPage(page), children: /* @__PURE__ */ jsx(
|
|
141
141
|
"button",
|
|
142
142
|
{
|
|
143
|
-
className:
|
|
143
|
+
className: listItem({
|
|
144
144
|
active: currentPage === page,
|
|
145
|
-
className: classNames?.
|
|
145
|
+
className: classNames?.listItem
|
|
146
146
|
}),
|
|
147
147
|
children: page
|
|
148
148
|
}
|
|
@@ -232,5 +232,6 @@ export {
|
|
|
232
232
|
PaginationNextEllipsis,
|
|
233
233
|
PaginationPreviousButton,
|
|
234
234
|
PaginationPreviousEllipsis,
|
|
235
|
-
usePaginationContext
|
|
235
|
+
usePaginationContext,
|
|
236
|
+
usePaginationStyles
|
|
236
237
|
};
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/pagination.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/pagination.tsx":{"bytes":10103,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":29,"imports":[{"path":"src/pagination.tsx","kind":"import-statement","original":"./pagination"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Pagination","PaginationContent","PaginationList","PaginationNextButton","PaginationNextEllipsis","PaginationPreviousButton","PaginationPreviousEllipsis","usePaginationContext","usePaginationStyles"],"entryPoint":"src/index.ts","inputs":{"src/pagination.tsx":{"bytesInOutput":6085},"src/index.ts":{"bytesInOutput":0}},"bytes":6341}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-pagination",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.18",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
27
27
|
"@types/react": "^19.0.0",
|
|
28
28
|
"@types/react-dom": "^19.0.0",
|
|
29
|
-
"@mijn-ui/react-core": "0.0.
|
|
30
|
-
"@mijn-ui/react-theme": "0.0.
|
|
29
|
+
"@mijn-ui/react-core": "0.0.7",
|
|
30
|
+
"@mijn-ui/react-theme": "0.0.12",
|
|
31
31
|
"eslint-config-custom": "0.0.1",
|
|
32
32
|
"tsconfig": "0.0.0",
|
|
33
33
|
"tsup-config": "0.0.0"
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@mijn-ui/shared-icons": "0.0.4",
|
|
37
37
|
"@mijn-ui/react-utilities": "0.0.9",
|
|
38
|
-
"@mijn-ui/react-hooks": "0.0.
|
|
38
|
+
"@mijn-ui/react-hooks": "0.0.15"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^19.0",
|
|
42
42
|
"react-dom": "^19.0",
|
|
43
|
-
"@mijn-ui/react-theme": "^0.0.
|
|
44
|
-
"@mijn-ui/react-core": "^0.0.
|
|
43
|
+
"@mijn-ui/react-theme": "^0.0.12",
|
|
44
|
+
"@mijn-ui/react-core": "^0.0.7"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|