@yamada-ui/pagination 0.1.11 → 0.2.0
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/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/index.mjs +5 -2
- package/dist/pagination-item.d.ts +14 -2
- package/dist/pagination.d.ts +34 -0
- package/dist/use-pagination.d.ts +30 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -20,7 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
Pagination: () => Pagination
|
|
23
|
+
Pagination: () => Pagination,
|
|
24
|
+
usePagination: () => usePagination
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(src_exports);
|
|
26
27
|
|
|
@@ -308,5 +309,6 @@ var Pagination = (0, import_core2.forwardRef)((props, ref) => {
|
|
|
308
309
|
});
|
|
309
310
|
// Annotate the CommonJS export names for ESM import in node:
|
|
310
311
|
0 && (module.exports = {
|
|
311
|
-
Pagination
|
|
312
|
+
Pagination,
|
|
313
|
+
usePagination
|
|
312
314
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-OQAHPAGR.mjs";
|
|
4
4
|
import "./chunk-3JXQPHJH.mjs";
|
|
5
5
|
import "./chunk-IXTXZCRI.mjs";
|
|
6
|
-
import
|
|
6
|
+
import {
|
|
7
|
+
usePagination
|
|
8
|
+
} from "./chunk-3KNXDAHV.mjs";
|
|
7
9
|
export {
|
|
8
|
-
Pagination
|
|
10
|
+
Pagination,
|
|
11
|
+
usePagination
|
|
9
12
|
};
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, FC } from 'react';
|
|
2
2
|
|
|
3
|
-
type Page = number | 'dots' | 'prev' | 'next' | 'first' | 'last';
|
|
4
3
|
type PaginationItemOptions = {
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The type of the page or item assigned to the pagination item.
|
|
6
|
+
*/
|
|
7
|
+
page: number | 'dots' | 'prev' | 'next' | 'first' | 'last';
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, the pagination item will be actived.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
6
13
|
isActive?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, the pagination item will be disabled.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
7
19
|
isDisabled?: boolean;
|
|
8
20
|
};
|
|
9
21
|
type PaginationItemProps = ComponentPropsWithoutRef<'button'> & PaginationItemOptions;
|
package/dist/pagination.d.ts
CHANGED
|
@@ -5,15 +5,49 @@ import { PaginationItemProps } from './pagination-item.js';
|
|
|
5
5
|
import { UsePaginationProps } from './use-pagination.js';
|
|
6
6
|
|
|
7
7
|
type PaginationOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* The pagination button component to use.
|
|
10
|
+
*/
|
|
8
11
|
component?: FC<PaginationItemProps>;
|
|
12
|
+
/**
|
|
13
|
+
* Props for button element.
|
|
14
|
+
*/
|
|
9
15
|
itemProps?: HTMLUIProps<'button'>;
|
|
16
|
+
/**
|
|
17
|
+
* If `true`, display the control buttons.
|
|
18
|
+
*
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
10
21
|
withControls?: Token<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Props for control button element.
|
|
24
|
+
*/
|
|
11
25
|
controlProps?: HTMLUIProps<'button'>;
|
|
26
|
+
/**
|
|
27
|
+
* Props for previous of the control button element.
|
|
28
|
+
*/
|
|
12
29
|
controlPrevProps?: HTMLUIProps<'button'>;
|
|
30
|
+
/**
|
|
31
|
+
* Props for next of the control button element.
|
|
32
|
+
*/
|
|
13
33
|
controlNextProps?: HTMLUIProps<'button'>;
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, display the edge buttons.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
14
39
|
withEdges?: Token<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Props for edge button element.
|
|
42
|
+
*/
|
|
15
43
|
edgeProps?: HTMLUIProps<'button'>;
|
|
44
|
+
/**
|
|
45
|
+
* Props for first of the edge button element.
|
|
46
|
+
*/
|
|
16
47
|
edgeFirstProps?: HTMLUIProps<'button'>;
|
|
48
|
+
/**
|
|
49
|
+
* Props for last of the edge button element.
|
|
50
|
+
*/
|
|
17
51
|
edgeLastProps?: HTMLUIProps<'button'>;
|
|
18
52
|
};
|
|
19
53
|
type PaginationProps = Omit<HTMLUIProps<'div'>, 'onChange' | 'children'> & ThemeProps<'Pagination'> & UsePaginationProps & PaginationOptions;
|
package/dist/use-pagination.d.ts
CHANGED
|
@@ -5,12 +5,42 @@ type PaginationContext = Record<string, CSSUIObject>;
|
|
|
5
5
|
declare const PaginationProvider: react.Provider<PaginationContext>;
|
|
6
6
|
declare const usePaginationContext: () => PaginationContext;
|
|
7
7
|
type UsePaginationProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The page of the pagination.
|
|
10
|
+
* Should be less than `total` and greater than `1`.
|
|
11
|
+
*/
|
|
8
12
|
page?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The initial page of the pagination.
|
|
15
|
+
* Should be less than `total` and greater than `1`.
|
|
16
|
+
*
|
|
17
|
+
* @default 1
|
|
18
|
+
*/
|
|
9
19
|
defaultPage?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The total number of pages in pagination.
|
|
22
|
+
*/
|
|
10
23
|
total: number;
|
|
24
|
+
/** Number of siblings displayed on the left/right side of selected page.
|
|
25
|
+
*
|
|
26
|
+
* @default 1
|
|
27
|
+
*/
|
|
11
28
|
siblings?: Token<number>;
|
|
29
|
+
/**
|
|
30
|
+
* Number of elements visible on the left/right edges.
|
|
31
|
+
*
|
|
32
|
+
* @default 1
|
|
33
|
+
*/
|
|
12
34
|
boundaries?: Token<number>;
|
|
35
|
+
/**
|
|
36
|
+
* If `true`, the pagination all item will be disabled.
|
|
37
|
+
*
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
13
40
|
isDisabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The callback invoked when the page changes.
|
|
43
|
+
*/
|
|
14
44
|
onChange?: (page: number) => void;
|
|
15
45
|
};
|
|
16
46
|
declare const computedRange: (start: number, end: number) => number[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/pagination",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Yamada UI pagination component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.3.
|
|
38
|
+
"@yamada-ui/core": "0.3.1",
|
|
39
39
|
"@yamada-ui/utils": "0.1.1",
|
|
40
|
-
"@yamada-ui/icon": "0.
|
|
40
|
+
"@yamada-ui/icon": "0.2.0",
|
|
41
41
|
"@yamada-ui/use-controllable-state": "0.1.2",
|
|
42
|
-
"@yamada-ui/use-value": "0.1.
|
|
42
|
+
"@yamada-ui/use-value": "0.1.12"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"react": "^18.0.0",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"build:fast": "tsup src",
|
|
74
74
|
"clean": "rimraf dist .turbo",
|
|
75
75
|
"typecheck": "tsc --noEmit",
|
|
76
|
-
"gen:
|
|
76
|
+
"gen:docs": "tsx ../../../scripts/generate-docs"
|
|
77
77
|
}
|
|
78
78
|
}
|