@sytechui/pagination 2.2.27
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/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/chunk-5S65XA6Q.mjs +82 -0
- package/dist/chunk-BIG4ST5P.mjs +217 -0
- package/dist/chunk-BNRXGTRW.mjs +18 -0
- package/dist/chunk-MA7OMMHX.mjs +18 -0
- package/dist/chunk-RL6XUYZP.mjs +235 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +589 -0
- package/dist/index.mjs +27 -0
- package/dist/pagination-cursor.d.mts +12 -0
- package/dist/pagination-cursor.d.ts +12 -0
- package/dist/pagination-cursor.js +37 -0
- package/dist/pagination-cursor.mjs +7 -0
- package/dist/pagination-item.d.mts +11 -0
- package/dist/pagination-item.d.ts +11 -0
- package/dist/pagination-item.js +113 -0
- package/dist/pagination-item.mjs +8 -0
- package/dist/pagination.d.mts +13 -0
- package/dist/pagination.d.ts +13 -0
- package/dist/pagination.js +570 -0
- package/dist/pagination.mjs +11 -0
- package/dist/use-pagination-item.d.mts +53 -0
- package/dist/use-pagination-item.d.ts +53 -0
- package/dist/use-pagination-item.js +105 -0
- package/dist/use-pagination-item.mjs +7 -0
- package/dist/use-pagination.d.mts +374 -0
- package/dist/use-pagination.d.ts +374 -0
- package/dist/use-pagination.js +269 -0
- package/dist/use-pagination.mjs +9 -0
- package/package.json +63 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _sytechui_system from '@sytechui/system';
|
|
2
|
+
import { UsePaginationItemProps } from './use-pagination-item.mjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@react-types/shared';
|
|
5
|
+
import '@sytechui/use-pagination';
|
|
6
|
+
|
|
7
|
+
interface PaginationItemProps extends UsePaginationItemProps {
|
|
8
|
+
}
|
|
9
|
+
declare const PaginationItem: _sytechui_system.InternalForwardRefRenderFunction<"li", PaginationItemProps, never>;
|
|
10
|
+
|
|
11
|
+
export { type PaginationItemProps, PaginationItem as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _sytechui_system from '@sytechui/system';
|
|
2
|
+
import { UsePaginationItemProps } from './use-pagination-item.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@react-types/shared';
|
|
5
|
+
import '@sytechui/use-pagination';
|
|
6
|
+
|
|
7
|
+
interface PaginationItemProps extends UsePaginationItemProps {
|
|
8
|
+
}
|
|
9
|
+
declare const PaginationItem: _sytechui_system.InternalForwardRefRenderFunction<"li", PaginationItemProps, never>;
|
|
10
|
+
|
|
11
|
+
export { type PaginationItemProps, PaginationItem as default };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/pagination-item.tsx
|
|
22
|
+
var pagination_item_exports = {};
|
|
23
|
+
__export(pagination_item_exports, {
|
|
24
|
+
default: () => pagination_item_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(pagination_item_exports);
|
|
27
|
+
var import_system = require("@sytechui/system");
|
|
28
|
+
|
|
29
|
+
// src/use-pagination-item.ts
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_utils = require("@react-aria/utils");
|
|
32
|
+
var import_shared_utils = require("@sytechui/shared-utils");
|
|
33
|
+
var import_react_utils = require("@sytechui/react-utils");
|
|
34
|
+
var import_interactions = require("@react-aria/interactions");
|
|
35
|
+
var import_focus = require("@react-aria/focus");
|
|
36
|
+
var import_theme = require("@sytechui/theme");
|
|
37
|
+
function usePaginationItem(props) {
|
|
38
|
+
const {
|
|
39
|
+
as,
|
|
40
|
+
ref,
|
|
41
|
+
value,
|
|
42
|
+
children,
|
|
43
|
+
isActive,
|
|
44
|
+
isDisabled,
|
|
45
|
+
onPress,
|
|
46
|
+
onClick,
|
|
47
|
+
getAriaLabel,
|
|
48
|
+
className,
|
|
49
|
+
...otherProps
|
|
50
|
+
} = props;
|
|
51
|
+
const isLink = !!(props == null ? void 0 : props.href);
|
|
52
|
+
const Component = as || isLink ? "a" : "li";
|
|
53
|
+
const shouldFilterDOMProps = typeof Component === "string";
|
|
54
|
+
const domRef = (0, import_react_utils.useDOMRef)(ref);
|
|
55
|
+
const router = (0, import_utils.useRouter)();
|
|
56
|
+
const ariaLabel = (0, import_react.useMemo)(
|
|
57
|
+
() => isActive ? `${getAriaLabel == null ? void 0 : getAriaLabel(value)} active` : getAriaLabel == null ? void 0 : getAriaLabel(value),
|
|
58
|
+
[value, isActive]
|
|
59
|
+
);
|
|
60
|
+
const { isPressed, pressProps } = (0, import_interactions.usePress)({
|
|
61
|
+
isDisabled,
|
|
62
|
+
onPress
|
|
63
|
+
});
|
|
64
|
+
const { focusProps, isFocused, isFocusVisible } = (0, import_focus.useFocusRing)({});
|
|
65
|
+
const { isHovered, hoverProps } = (0, import_interactions.useHover)({ isDisabled });
|
|
66
|
+
const getItemProps = (props2 = {}) => {
|
|
67
|
+
return {
|
|
68
|
+
ref: domRef,
|
|
69
|
+
role: "button",
|
|
70
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
71
|
+
"aria-label": ariaLabel,
|
|
72
|
+
"aria-current": (0, import_shared_utils.dataAttr)(isActive),
|
|
73
|
+
"aria-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
|
|
74
|
+
"data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
|
|
75
|
+
"data-active": (0, import_shared_utils.dataAttr)(isActive),
|
|
76
|
+
"data-focus": (0, import_shared_utils.dataAttr)(isFocused),
|
|
77
|
+
"data-hover": (0, import_shared_utils.dataAttr)(isHovered),
|
|
78
|
+
"data-pressed": (0, import_shared_utils.dataAttr)(isPressed),
|
|
79
|
+
"data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
|
|
80
|
+
...(0, import_shared_utils.mergeProps)(
|
|
81
|
+
props2,
|
|
82
|
+
pressProps,
|
|
83
|
+
focusProps,
|
|
84
|
+
hoverProps,
|
|
85
|
+
(0, import_react_utils.filterDOMProps)(otherProps, {
|
|
86
|
+
enabled: shouldFilterDOMProps
|
|
87
|
+
})
|
|
88
|
+
),
|
|
89
|
+
className: (0, import_theme.cn)(className, props2.className),
|
|
90
|
+
onClick: (e) => {
|
|
91
|
+
(0, import_shared_utils.chain)(pressProps == null ? void 0 : pressProps.onClick, onClick)(e);
|
|
92
|
+
(0, import_utils.handleLinkClick)(e, router, props2.href, props2.routerOptions);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
Component,
|
|
98
|
+
children,
|
|
99
|
+
ariaLabel,
|
|
100
|
+
isFocused,
|
|
101
|
+
isFocusVisible,
|
|
102
|
+
getItemProps
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// src/pagination-item.tsx
|
|
107
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
108
|
+
var PaginationItem = (0, import_system.forwardRef)((props, ref) => {
|
|
109
|
+
const { Component, children, getItemProps } = usePaginationItem({ ...props, ref });
|
|
110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...getItemProps(), children });
|
|
111
|
+
});
|
|
112
|
+
PaginationItem.displayName = "HeroUI.PaginationItem";
|
|
113
|
+
var pagination_item_default = PaginationItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _sytechui_system from '@sytechui/system';
|
|
2
|
+
import { UsePaginationProps } from './use-pagination.mjs';
|
|
3
|
+
import 'tailwind-variants';
|
|
4
|
+
import '@sytechui/theme';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '@sytechui/use-pagination';
|
|
7
|
+
import '@react-types/shared';
|
|
8
|
+
|
|
9
|
+
interface PaginationProps extends UsePaginationProps {
|
|
10
|
+
}
|
|
11
|
+
declare const Pagination: _sytechui_system.InternalForwardRefRenderFunction<"nav", PaginationProps, never>;
|
|
12
|
+
|
|
13
|
+
export { type PaginationProps, Pagination as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _sytechui_system from '@sytechui/system';
|
|
2
|
+
import { UsePaginationProps } from './use-pagination.js';
|
|
3
|
+
import 'tailwind-variants';
|
|
4
|
+
import '@sytechui/theme';
|
|
5
|
+
import 'react';
|
|
6
|
+
import '@sytechui/use-pagination';
|
|
7
|
+
import '@react-types/shared';
|
|
8
|
+
|
|
9
|
+
interface PaginationProps extends UsePaginationProps {
|
|
10
|
+
}
|
|
11
|
+
declare const Pagination: _sytechui_system.InternalForwardRefRenderFunction<"nav", PaginationProps, never>;
|
|
12
|
+
|
|
13
|
+
export { type PaginationProps, Pagination as default };
|