@yahoo/uds-mobile 2.18.0 → 2.19.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/components/Pagination/Pagination.cjs +75 -0
- package/dist/components/Pagination/Pagination.d.cts +40 -0
- package/dist/components/Pagination/Pagination.d.cts.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +40 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +75 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/PaginationEllipsis.cjs +64 -0
- package/dist/components/Pagination/PaginationEllipsis.d.cts +21 -0
- package/dist/components/Pagination/PaginationEllipsis.d.cts.map +1 -0
- package/dist/components/Pagination/PaginationEllipsis.d.ts +21 -0
- package/dist/components/Pagination/PaginationEllipsis.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationEllipsis.js +64 -0
- package/dist/components/Pagination/PaginationEllipsis.js.map +1 -0
- package/dist/components/Pagination/PaginationItem.cjs +68 -0
- package/dist/components/Pagination/PaginationItem.d.cts +24 -0
- package/dist/components/Pagination/PaginationItem.d.cts.map +1 -0
- package/dist/components/Pagination/PaginationItem.d.ts +24 -0
- package/dist/components/Pagination/PaginationItem.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationItem.js +68 -0
- package/dist/components/Pagination/PaginationItem.js.map +1 -0
- package/dist/components/Pagination/PaginationLink.cjs +68 -0
- package/dist/components/Pagination/PaginationLink.d.cts +25 -0
- package/dist/components/Pagination/PaginationLink.d.cts.map +1 -0
- package/dist/components/Pagination/PaginationLink.d.ts +25 -0
- package/dist/components/Pagination/PaginationLink.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationLink.js +68 -0
- package/dist/components/Pagination/PaginationLink.js.map +1 -0
- package/dist/components/Pagination/PaginationNext.cjs +72 -0
- package/dist/components/Pagination/PaginationNext.d.cts +24 -0
- package/dist/components/Pagination/PaginationNext.d.cts.map +1 -0
- package/dist/components/Pagination/PaginationNext.d.ts +24 -0
- package/dist/components/Pagination/PaginationNext.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationNext.js +72 -0
- package/dist/components/Pagination/PaginationNext.js.map +1 -0
- package/dist/components/Pagination/PaginationNumbers.cjs +50 -0
- package/dist/components/Pagination/PaginationNumbers.d.cts +23 -0
- package/dist/components/Pagination/PaginationNumbers.d.cts.map +1 -0
- package/dist/components/Pagination/PaginationNumbers.d.ts +23 -0
- package/dist/components/Pagination/PaginationNumbers.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationNumbers.js +50 -0
- package/dist/components/Pagination/PaginationNumbers.js.map +1 -0
- package/dist/components/Pagination/PaginationPrev.cjs +72 -0
- package/dist/components/Pagination/PaginationPrev.d.cts +24 -0
- package/dist/components/Pagination/PaginationPrev.d.cts.map +1 -0
- package/dist/components/Pagination/PaginationPrev.d.ts +24 -0
- package/dist/components/Pagination/PaginationPrev.d.ts.map +1 -0
- package/dist/components/Pagination/PaginationPrev.js +72 -0
- package/dist/components/Pagination/PaginationPrev.js.map +1 -0
- package/dist/components/Pagination/computeVisiblePages.cjs +21 -0
- package/dist/components/Pagination/computeVisiblePages.d.cts +19 -0
- package/dist/components/Pagination/computeVisiblePages.d.cts.map +1 -0
- package/dist/components/Pagination/computeVisiblePages.d.ts +19 -0
- package/dist/components/Pagination/computeVisiblePages.d.ts.map +1 -0
- package/dist/components/Pagination/computeVisiblePages.js +22 -0
- package/dist/components/Pagination/computeVisiblePages.js.map +1 -0
- package/dist/components/Pagination/ellipsisDefault.cjs +28 -0
- package/dist/components/Pagination/ellipsisDefault.d.cts +11 -0
- package/dist/components/Pagination/ellipsisDefault.d.cts.map +1 -0
- package/dist/components/Pagination/ellipsisDefault.d.ts +11 -0
- package/dist/components/Pagination/ellipsisDefault.d.ts.map +1 -0
- package/dist/components/Pagination/ellipsisDefault.js +29 -0
- package/dist/components/Pagination/ellipsisDefault.js.map +1 -0
- package/dist/components/Pagination/ellipsisNone.cjs +24 -0
- package/dist/components/Pagination/ellipsisNone.d.cts +11 -0
- package/dist/components/Pagination/ellipsisNone.d.cts.map +1 -0
- package/dist/components/Pagination/ellipsisNone.d.ts +11 -0
- package/dist/components/Pagination/ellipsisNone.d.ts.map +1 -0
- package/dist/components/Pagination/ellipsisNone.js +25 -0
- package/dist/components/Pagination/ellipsisNone.js.map +1 -0
- package/dist/components/Pagination/index.cjs +18 -0
- package/dist/components/Pagination/index.d.cts +10 -0
- package/dist/components/Pagination/index.d.ts +10 -0
- package/dist/components/Pagination/index.js +10 -0
- package/dist/components/Pagination/paginationContext.cjs +42 -0
- package/dist/components/Pagination/paginationContext.d.cts +34 -0
- package/dist/components/Pagination/paginationContext.d.cts.map +1 -0
- package/dist/components/Pagination/paginationContext.d.ts +34 -0
- package/dist/components/Pagination/paginationContext.d.ts.map +1 -0
- package/dist/components/Pagination/paginationContext.js +38 -0
- package/dist/components/Pagination/paginationContext.js.map +1 -0
- package/dist/components/Pagination/paginationDefaultComponents.cjs +68 -0
- package/dist/components/Pagination/paginationDefaultComponents.d.cts +17 -0
- package/dist/components/Pagination/paginationDefaultComponents.d.cts.map +1 -0
- package/dist/components/Pagination/paginationDefaultComponents.d.ts +17 -0
- package/dist/components/Pagination/paginationDefaultComponents.d.ts.map +1 -0
- package/dist/components/Pagination/paginationDefaultComponents.js +69 -0
- package/dist/components/Pagination/paginationDefaultComponents.js.map +1 -0
- package/dist/components/Pagination/paginationTheme.cjs +67 -0
- package/dist/components/Pagination/paginationTheme.d.cts +28 -0
- package/dist/components/Pagination/paginationTheme.d.cts.map +1 -0
- package/dist/components/Pagination/paginationTheme.d.ts +28 -0
- package/dist/components/Pagination/paginationTheme.d.ts.map +1 -0
- package/dist/components/Pagination/paginationTheme.js +62 -0
- package/dist/components/Pagination/paginationTheme.js.map +1 -0
- package/dist/components/Pagination/range.cjs +10 -0
- package/dist/components/Pagination/range.d.cts +6 -0
- package/dist/components/Pagination/range.d.cts.map +1 -0
- package/dist/components/Pagination/range.d.ts +6 -0
- package/dist/components/Pagination/range.d.ts.map +1 -0
- package/dist/components/Pagination/range.js +11 -0
- package/dist/components/Pagination/range.js.map +1 -0
- package/dist/components/Pagination/usePaginationControlStyles.cjs +78 -0
- package/dist/components/Pagination/usePaginationControlStyles.d.cts +26 -0
- package/dist/components/Pagination/usePaginationControlStyles.d.cts.map +1 -0
- package/dist/components/Pagination/usePaginationControlStyles.d.ts +26 -0
- package/dist/components/Pagination/usePaginationControlStyles.d.ts.map +1 -0
- package/dist/components/Pagination/usePaginationControlStyles.js +78 -0
- package/dist/components/Pagination/usePaginationControlStyles.js.map +1 -0
- package/dist/jest/bun-test-guard.cjs +8 -0
- package/dist/jest/bun-test-guard.d.cts +2 -0
- package/dist/jest/bun-test-guard.d.ts +2 -0
- package/dist/jest/bun-test-guard.js +10 -0
- package/dist/jest/bun-test-guard.js.map +1 -0
- package/dist/jest/mocks/styles.cjs +23 -0
- package/dist/jest/mocks/styles.d.cts +3 -2
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts +3 -2
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +23 -1
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/types/dist/index.d.cts +83 -1
- package/dist/types/dist/index.d.cts.map +1 -1
- package/dist/types/dist/index.d.ts +83 -1
- package/dist/types/dist/index.d.ts.map +1 -1
- package/generated/styles.cjs +75 -0
- package/generated/styles.d.ts +29 -0
- package/generated/styles.mjs +75 -0
- package/generated/unistyles.d.ts +69 -0
- package/package.json +11 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_components_Icon = require("../Icon.cjs");
|
|
5
|
+
const require_components_Text = require("../Text.cjs");
|
|
6
|
+
const require_components_Pagination_paginationContext = require("./paginationContext.cjs");
|
|
7
|
+
const require_components_Pagination_usePaginationControlStyles = require("./usePaginationControlStyles.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_native = require("react-native");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
//#region src/components/Pagination/PaginationPrev.tsx
|
|
12
|
+
/**
|
|
13
|
+
* **PaginationPrev — previous page control**
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* Hidden on the first page. Moves to the previous page when pressed.
|
|
17
|
+
*
|
|
18
|
+
* @category Navigation
|
|
19
|
+
* @platform mobile
|
|
20
|
+
*/
|
|
21
|
+
const PaginationPrev = (0, react.memo)(function PaginationPrev({ label = "Prev", children, onPress, ...rest }) {
|
|
22
|
+
const { activePage, size, variant, onPageChange } = require_components_Pagination_paginationContext.usePaginationContext();
|
|
23
|
+
const [pressed, setPressed] = (0, react.useState)(false);
|
|
24
|
+
(0, react.useEffect)(() => {
|
|
25
|
+
setPressed(false);
|
|
26
|
+
}, [activePage]);
|
|
27
|
+
const { rootStyle, textStyle, iconStyle } = require_components_Pagination_usePaginationControlStyles.usePaginationControlStyles({
|
|
28
|
+
size,
|
|
29
|
+
variant,
|
|
30
|
+
isActive: false,
|
|
31
|
+
pressed,
|
|
32
|
+
layout: "prevNext"
|
|
33
|
+
});
|
|
34
|
+
const handlePress = (0, react.useCallback)((event) => {
|
|
35
|
+
onPress?.(event);
|
|
36
|
+
onPageChange?.(activePage - 1);
|
|
37
|
+
}, [
|
|
38
|
+
activePage,
|
|
39
|
+
onPageChange,
|
|
40
|
+
onPress
|
|
41
|
+
]);
|
|
42
|
+
const resolvedTextColor = (0, react.useMemo)(() => {
|
|
43
|
+
const flat = react_native.StyleSheet.flatten(textStyle);
|
|
44
|
+
return typeof flat?.color === "string" ? flat.color : void 0;
|
|
45
|
+
}, [textStyle]);
|
|
46
|
+
if (activePage <= 1) return null;
|
|
47
|
+
const content = children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
48
|
+
name: "ChevronLeft",
|
|
49
|
+
size: "sm",
|
|
50
|
+
color: iconStyle?.color,
|
|
51
|
+
style: iconStyle
|
|
52
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
53
|
+
color: "inherit",
|
|
54
|
+
variant: "inherit",
|
|
55
|
+
style: textStyle,
|
|
56
|
+
dangerouslySetColor: resolvedTextColor,
|
|
57
|
+
children: label
|
|
58
|
+
})] });
|
|
59
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Pressable, {
|
|
60
|
+
accessibilityLabel: "Go to previous page",
|
|
61
|
+
accessibilityRole: "button",
|
|
62
|
+
onPress: handlePress,
|
|
63
|
+
onPressIn: () => setPressed(true),
|
|
64
|
+
onPressOut: () => setPressed(false),
|
|
65
|
+
style: rootStyle,
|
|
66
|
+
...rest,
|
|
67
|
+
children: content
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
PaginationPrev.displayName = "PaginationPrev";
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.PaginationPrev = PaginationPrev;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalPaginationPrevProps } from "../../types/dist/index.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { PressableProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Pagination/PaginationPrev.d.ts
|
|
7
|
+
/** RN Pressable types differ from web button HTML attributes; keep parity fields only. */
|
|
8
|
+
interface PaginationPrevProps extends Omit<PressableProps, 'children' | 'style'> {
|
|
9
|
+
label?: UniversalPaginationPrevProps['label'];
|
|
10
|
+
children?: UniversalPaginationPrevProps['children'];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* **PaginationPrev — previous page control**
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* Hidden on the first page. Moves to the previous page when pressed.
|
|
17
|
+
*
|
|
18
|
+
* @category Navigation
|
|
19
|
+
* @platform mobile
|
|
20
|
+
*/
|
|
21
|
+
declare const PaginationPrev: _$react.NamedExoticComponent<PaginationPrevProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { PaginationPrev, type PaginationPrevProps };
|
|
24
|
+
//# sourceMappingURL=PaginationPrev.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationPrev.d.cts","names":[],"sources":["../../../src/components/Pagination/PaginationPrev.tsx"],"mappings":";;;;;;;UAYU,mBAAA,SAA4B,IAAA,CAAK,cAAA;EACzC,KAAA,GAAQ,4BAAA;EACR,QAAA,GAAW,4BAAA;AAAA;;;;;;;;;;cAYP,cAAA,EAAc,OAAA,CAAA,oBAAA,CAAA,mBAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalPaginationPrevProps } from "../../types/dist/index.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
import { PressableProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Pagination/PaginationPrev.d.ts
|
|
7
|
+
/** RN Pressable types differ from web button HTML attributes; keep parity fields only. */
|
|
8
|
+
interface PaginationPrevProps extends Omit<PressableProps, 'children' | 'style'> {
|
|
9
|
+
label?: UniversalPaginationPrevProps['label'];
|
|
10
|
+
children?: UniversalPaginationPrevProps['children'];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* **PaginationPrev — previous page control**
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* Hidden on the first page. Moves to the previous page when pressed.
|
|
17
|
+
*
|
|
18
|
+
* @category Navigation
|
|
19
|
+
* @platform mobile
|
|
20
|
+
*/
|
|
21
|
+
declare const PaginationPrev: _$react.NamedExoticComponent<PaginationPrevProps>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { PaginationPrev, type PaginationPrevProps };
|
|
24
|
+
//# sourceMappingURL=PaginationPrev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationPrev.d.ts","names":[],"sources":["../../../src/components/Pagination/PaginationPrev.tsx"],"mappings":";;;;;;;UAYU,mBAAA,SAA4B,IAAA,CAAK,cAAA;EACzC,KAAA,GAAQ,4BAAA;EACR,QAAA,GAAW,4BAAA;AAAA;;;;;;;;;;cAYP,cAAA,EAAc,OAAA,CAAA,oBAAA,CAAA,mBAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { Icon } from "../Icon.js";
|
|
3
|
+
import { Text as Text$1 } from "../Text.js";
|
|
4
|
+
import { usePaginationContext } from "./paginationContext.js";
|
|
5
|
+
import { usePaginationControlStyles } from "./usePaginationControlStyles.js";
|
|
6
|
+
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
|
7
|
+
import { Pressable, StyleSheet } from "react-native";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/Pagination/PaginationPrev.tsx
|
|
10
|
+
/**
|
|
11
|
+
* **PaginationPrev — previous page control**
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* Hidden on the first page. Moves to the previous page when pressed.
|
|
15
|
+
*
|
|
16
|
+
* @category Navigation
|
|
17
|
+
* @platform mobile
|
|
18
|
+
*/
|
|
19
|
+
const PaginationPrev = memo(function PaginationPrev({ label = "Prev", children, onPress, ...rest }) {
|
|
20
|
+
const { activePage, size, variant, onPageChange } = usePaginationContext();
|
|
21
|
+
const [pressed, setPressed] = useState(false);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setPressed(false);
|
|
24
|
+
}, [activePage]);
|
|
25
|
+
const { rootStyle, textStyle, iconStyle } = usePaginationControlStyles({
|
|
26
|
+
size,
|
|
27
|
+
variant,
|
|
28
|
+
isActive: false,
|
|
29
|
+
pressed,
|
|
30
|
+
layout: "prevNext"
|
|
31
|
+
});
|
|
32
|
+
const handlePress = useCallback((event) => {
|
|
33
|
+
onPress?.(event);
|
|
34
|
+
onPageChange?.(activePage - 1);
|
|
35
|
+
}, [
|
|
36
|
+
activePage,
|
|
37
|
+
onPageChange,
|
|
38
|
+
onPress
|
|
39
|
+
]);
|
|
40
|
+
const resolvedTextColor = useMemo(() => {
|
|
41
|
+
const flat = StyleSheet.flatten(textStyle);
|
|
42
|
+
return typeof flat?.color === "string" ? flat.color : void 0;
|
|
43
|
+
}, [textStyle]);
|
|
44
|
+
if (activePage <= 1) return null;
|
|
45
|
+
const content = children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
46
|
+
name: "ChevronLeft",
|
|
47
|
+
size: "sm",
|
|
48
|
+
color: iconStyle?.color,
|
|
49
|
+
style: iconStyle
|
|
50
|
+
}), /* @__PURE__ */ jsx(Text$1, {
|
|
51
|
+
color: "inherit",
|
|
52
|
+
variant: "inherit",
|
|
53
|
+
style: textStyle,
|
|
54
|
+
dangerouslySetColor: resolvedTextColor,
|
|
55
|
+
children: label
|
|
56
|
+
})] });
|
|
57
|
+
return /* @__PURE__ */ jsx(Pressable, {
|
|
58
|
+
accessibilityLabel: "Go to previous page",
|
|
59
|
+
accessibilityRole: "button",
|
|
60
|
+
onPress: handlePress,
|
|
61
|
+
onPressIn: () => setPressed(true),
|
|
62
|
+
onPressOut: () => setPressed(false),
|
|
63
|
+
style: rootStyle,
|
|
64
|
+
...rest,
|
|
65
|
+
children: content
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
PaginationPrev.displayName = "PaginationPrev";
|
|
69
|
+
//#endregion
|
|
70
|
+
export { PaginationPrev };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=PaginationPrev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationPrev.js","names":["Text"],"sources":["../../../src/components/Pagination/PaginationPrev.tsx"],"sourcesContent":["import type { UniversalPaginationPrevProps } from '@yahoo/uds-types';\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport type { PressableProps, TextStyle } from 'react-native';\nimport { Pressable, StyleSheet } from 'react-native';\n\nimport type { StyleProps } from '../../../generated/styles';\nimport { Icon } from '../Icon';\nimport { Text } from '../Text';\nimport { usePaginationContext } from './paginationContext';\nimport { usePaginationControlStyles } from './usePaginationControlStyles';\n\n/** RN Pressable types differ from web button HTML attributes; keep parity fields only. */\ninterface PaginationPrevProps extends Omit<PressableProps, 'children' | 'style'> {\n label?: UniversalPaginationPrevProps['label'];\n children?: UniversalPaginationPrevProps['children'];\n}\n\n/**\n * **PaginationPrev — previous page control**\n *\n * @description\n * Hidden on the first page. Moves to the previous page when pressed.\n *\n * @category Navigation\n * @platform mobile\n */\nconst PaginationPrev = memo(function PaginationPrev({\n label = 'Prev',\n children,\n onPress,\n ...rest\n}: PaginationPrevProps) {\n const { activePage, size, variant, onPageChange } = usePaginationContext();\n const [pressed, setPressed] = useState(false);\n\n // Pressable unmounts when we return null before onPressOut runs; reset on page change.\n useEffect(() => {\n setPressed(false);\n }, [activePage]);\n const { rootStyle, textStyle, iconStyle } = usePaginationControlStyles({\n size,\n variant,\n isActive: false,\n pressed,\n layout: 'prevNext',\n });\n\n const handlePress = useCallback(\n (event: Parameters<NonNullable<PressableProps['onPress']>>[0]) => {\n onPress?.(event);\n onPageChange?.(activePage - 1);\n },\n [activePage, onPageChange, onPress],\n );\n\n const resolvedTextColor = useMemo(() => {\n const flat = StyleSheet.flatten(textStyle);\n return typeof flat?.color === 'string' ? flat.color : undefined;\n }, [textStyle]);\n\n if (activePage <= 1) {\n return null;\n }\n\n const content = children ?? (\n <>\n <Icon\n name=\"ChevronLeft\"\n size=\"sm\"\n color={(iconStyle as TextStyle)?.color as StyleProps['color'] | undefined}\n style={iconStyle}\n />\n <Text\n color=\"inherit\"\n variant=\"inherit\"\n style={textStyle}\n dangerouslySetColor={resolvedTextColor}\n >\n {label}\n </Text>\n </>\n );\n\n return (\n <Pressable\n accessibilityLabel=\"Go to previous page\"\n accessibilityRole=\"button\"\n onPress={handlePress}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n style={rootStyle}\n {...rest}\n >\n {content}\n </Pressable>\n );\n});\n\nPaginationPrev.displayName = 'PaginationPrev';\n\nexport { PaginationPrev, type PaginationPrevProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAM,iBAAiB,KAAK,SAAS,eAAe,EAClD,QAAQ,QACR,UACA,SACA,GAAG,QACmB;CACtB,MAAM,EAAE,YAAY,MAAM,SAAS,iBAAiB,sBAAsB;CAC1E,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAG7C,gBAAgB;EACd,WAAW,MAAM;IAChB,CAAC,WAAW,CAAC;CAChB,MAAM,EAAE,WAAW,WAAW,cAAc,2BAA2B;EACrE;EACA;EACA,UAAU;EACV;EACA,QAAQ;EACT,CAAC;CAEF,MAAM,cAAc,aACjB,UAAiE;EAChE,UAAU,MAAM;EAChB,eAAe,aAAa,EAAE;IAEhC;EAAC;EAAY;EAAc;EAAQ,CACpC;CAED,MAAM,oBAAoB,cAAc;EACtC,MAAM,OAAO,WAAW,QAAQ,UAAU;EAC1C,OAAO,OAAO,MAAM,UAAU,WAAW,KAAK,QAAQ,KAAA;IACrD,CAAC,UAAU,CAAC;CAEf,IAAI,cAAc,GAChB,OAAO;CAGT,MAAM,UAAU,YACd,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;EACE,MAAK;EACL,MAAK;EACL,OAAQ,WAAyB;EACjC,OAAO;EACP,CAAA,EACF,oBAACA,QAAD;EACE,OAAM;EACN,SAAQ;EACR,OAAO;EACP,qBAAqB;YAEpB;EACI,CAAA,CACN,EAAA,CAAA;CAGL,OACE,oBAAC,WAAD;EACE,oBAAmB;EACnB,mBAAkB;EAClB,SAAS;EACT,iBAAiB,WAAW,KAAK;EACjC,kBAAkB,WAAW,MAAM;EACnC,OAAO;EACP,GAAI;YAEH;EACS,CAAA;EAEd;AAEF,eAAe,cAAc"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_components_Pagination_ellipsisDefault = require("./ellipsisDefault.cjs");
|
|
4
|
+
const require_components_Pagination_ellipsisNone = require("./ellipsisNone.cjs");
|
|
5
|
+
//#region src/components/Pagination/computeVisiblePages.ts
|
|
6
|
+
const MIN_MAX_VISIBLE_WITH_ELLIPSIS = 3;
|
|
7
|
+
function computeVisiblePages({ activePage, totalPages, maxVisiblePageNumbers, ellipsisPlacement }) {
|
|
8
|
+
const max = ellipsisPlacement === "none" ? Math.max(1, maxVisiblePageNumbers) : Math.max(MIN_MAX_VISIBLE_WITH_ELLIPSIS, maxVisiblePageNumbers);
|
|
9
|
+
if (totalPages <= 0) return [];
|
|
10
|
+
if (typeof ellipsisPlacement === "function") return ellipsisPlacement({
|
|
11
|
+
activePage,
|
|
12
|
+
totalPages,
|
|
13
|
+
maxVisiblePageNumbers: max
|
|
14
|
+
});
|
|
15
|
+
switch (ellipsisPlacement) {
|
|
16
|
+
case "none": return require_components_Pagination_ellipsisNone.ellipsisNone(activePage, totalPages, max);
|
|
17
|
+
default: return require_components_Pagination_ellipsisDefault.ellipsisDefault(activePage, totalPages, max);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.computeVisiblePages = computeVisiblePages;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationEllipsisPlacement, PaginationVisibleItem } from "../../types/dist/index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/computeVisiblePages.d.ts
|
|
5
|
+
interface ComputeVisiblePagesParams {
|
|
6
|
+
activePage: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
maxVisiblePageNumbers: number;
|
|
9
|
+
ellipsisPlacement: PaginationEllipsisPlacement;
|
|
10
|
+
}
|
|
11
|
+
declare function computeVisiblePages({
|
|
12
|
+
activePage,
|
|
13
|
+
totalPages,
|
|
14
|
+
maxVisiblePageNumbers,
|
|
15
|
+
ellipsisPlacement
|
|
16
|
+
}: ComputeVisiblePagesParams): PaginationVisibleItem[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ComputeVisiblePagesParams, computeVisiblePages };
|
|
19
|
+
//# sourceMappingURL=computeVisiblePages.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeVisiblePages.d.cts","names":[],"sources":["../../../src/components/Pagination/computeVisiblePages.ts"],"mappings":";;;;UAOiB,yBAAA;EACf,UAAA;EACA,UAAA;EACA,qBAAA;EACA,iBAAA,EAAmB,2BAAA;AAAA;AAAA,iBAGL,mBAAA,CAAA;EACd,UAAA;EACA,UAAA;EACA,qBAAA;EACA;AAAA,GACC,yBAAA,GAA4B,qBAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationEllipsisPlacement, PaginationVisibleItem } from "../../types/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/computeVisiblePages.d.ts
|
|
5
|
+
interface ComputeVisiblePagesParams {
|
|
6
|
+
activePage: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
maxVisiblePageNumbers: number;
|
|
9
|
+
ellipsisPlacement: PaginationEllipsisPlacement;
|
|
10
|
+
}
|
|
11
|
+
declare function computeVisiblePages({
|
|
12
|
+
activePage,
|
|
13
|
+
totalPages,
|
|
14
|
+
maxVisiblePageNumbers,
|
|
15
|
+
ellipsisPlacement
|
|
16
|
+
}: ComputeVisiblePagesParams): PaginationVisibleItem[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ComputeVisiblePagesParams, computeVisiblePages };
|
|
19
|
+
//# sourceMappingURL=computeVisiblePages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeVisiblePages.d.ts","names":[],"sources":["../../../src/components/Pagination/computeVisiblePages.ts"],"mappings":";;;;UAOiB,yBAAA;EACf,UAAA;EACA,UAAA;EACA,qBAAA;EACA,iBAAA,EAAmB,2BAAA;AAAA;AAAA,iBAGL,mBAAA,CAAA;EACd,UAAA;EACA,UAAA;EACA,qBAAA;EACA;AAAA,GACC,yBAAA,GAA4B,qBAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { ellipsisDefault } from "./ellipsisDefault.js";
|
|
3
|
+
import { ellipsisNone } from "./ellipsisNone.js";
|
|
4
|
+
//#region src/components/Pagination/computeVisiblePages.ts
|
|
5
|
+
const MIN_MAX_VISIBLE_WITH_ELLIPSIS = 3;
|
|
6
|
+
function computeVisiblePages({ activePage, totalPages, maxVisiblePageNumbers, ellipsisPlacement }) {
|
|
7
|
+
const max = ellipsisPlacement === "none" ? Math.max(1, maxVisiblePageNumbers) : Math.max(MIN_MAX_VISIBLE_WITH_ELLIPSIS, maxVisiblePageNumbers);
|
|
8
|
+
if (totalPages <= 0) return [];
|
|
9
|
+
if (typeof ellipsisPlacement === "function") return ellipsisPlacement({
|
|
10
|
+
activePage,
|
|
11
|
+
totalPages,
|
|
12
|
+
maxVisiblePageNumbers: max
|
|
13
|
+
});
|
|
14
|
+
switch (ellipsisPlacement) {
|
|
15
|
+
case "none": return ellipsisNone(activePage, totalPages, max);
|
|
16
|
+
default: return ellipsisDefault(activePage, totalPages, max);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { computeVisiblePages };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=computeVisiblePages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeVisiblePages.js","names":[],"sources":["../../../src/components/Pagination/computeVisiblePages.ts"],"sourcesContent":["import type { PaginationEllipsisPlacement, PaginationVisibleItem } from '@yahoo/uds-types';\n\nimport { ellipsisDefault } from './ellipsisDefault';\nimport { ellipsisNone } from './ellipsisNone';\n\nconst MIN_MAX_VISIBLE_WITH_ELLIPSIS = 3;\n\nexport interface ComputeVisiblePagesParams {\n activePage: number;\n totalPages: number;\n maxVisiblePageNumbers: number;\n ellipsisPlacement: PaginationEllipsisPlacement;\n}\n\nexport function computeVisiblePages({\n activePage,\n totalPages,\n maxVisiblePageNumbers,\n ellipsisPlacement,\n}: ComputeVisiblePagesParams): PaginationVisibleItem[] {\n const max =\n ellipsisPlacement === 'none'\n ? Math.max(1, maxVisiblePageNumbers)\n : Math.max(MIN_MAX_VISIBLE_WITH_ELLIPSIS, maxVisiblePageNumbers);\n\n if (totalPages <= 0) {\n return [];\n }\n\n if (typeof ellipsisPlacement === 'function') {\n return ellipsisPlacement({ activePage, totalPages, maxVisiblePageNumbers: max });\n }\n\n switch (ellipsisPlacement) {\n case 'none':\n return ellipsisNone(activePage, totalPages, max);\n case 'default':\n default:\n return ellipsisDefault(activePage, totalPages, max);\n }\n}\n"],"mappings":";;;;AAKA,MAAM,gCAAgC;AAStC,SAAgB,oBAAoB,EAClC,YACA,YACA,uBACA,qBACqD;CACrD,MAAM,MACJ,sBAAsB,SAClB,KAAK,IAAI,GAAG,sBAAsB,GAClC,KAAK,IAAI,+BAA+B,sBAAsB;CAEpE,IAAI,cAAc,GAChB,OAAO,EAAE;CAGX,IAAI,OAAO,sBAAsB,YAC/B,OAAO,kBAAkB;EAAE;EAAY;EAAY,uBAAuB;EAAK,CAAC;CAGlF,QAAQ,mBAAR;EACE,KAAK,QACH,OAAO,aAAa,YAAY,YAAY,IAAI;EAElD,SACE,OAAO,gBAAgB,YAAY,YAAY,IAAI"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_components_Pagination_range = require("./range.cjs");
|
|
4
|
+
//#region src/components/Pagination/ellipsisDefault.ts
|
|
5
|
+
/**
|
|
6
|
+
* Pin first and last page when truncated; ellipses only where there is a gap.
|
|
7
|
+
*/
|
|
8
|
+
function ellipsisDefault(activePage, totalPages, maxVisiblePageNumbers) {
|
|
9
|
+
if (totalPages <= maxVisiblePageNumbers) return require_components_Pagination_range.range(1, totalPages);
|
|
10
|
+
const middleBudget = Math.max(1, maxVisiblePageNumbers - 2);
|
|
11
|
+
const half = Math.floor((middleBudget - 1) / 2);
|
|
12
|
+
let windowStart = Math.max(2, activePage - half);
|
|
13
|
+
const windowEnd = Math.min(totalPages - 1, windowStart + middleBudget - 1);
|
|
14
|
+
windowStart = Math.max(2, windowEnd - middleBudget + 1);
|
|
15
|
+
const pageSet = new Set([1, totalPages]);
|
|
16
|
+
for (let i = windowStart; i <= windowEnd; i++) pageSet.add(i);
|
|
17
|
+
const sorted = [...pageSet].sort((a, b) => a - b);
|
|
18
|
+
const result = [];
|
|
19
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
20
|
+
const page = sorted[i];
|
|
21
|
+
const prev = sorted[i - 1];
|
|
22
|
+
if (i > 0 && page - prev > 1) result.push("ellipsis");
|
|
23
|
+
result.push(page);
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.ellipsisDefault = ellipsisDefault;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationVisibleItem } from "../../types/dist/index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/ellipsisDefault.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Pin first and last page when truncated; ellipses only where there is a gap.
|
|
7
|
+
*/
|
|
8
|
+
declare function ellipsisDefault(activePage: number, totalPages: number, maxVisiblePageNumbers: number): PaginationVisibleItem[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ellipsisDefault };
|
|
11
|
+
//# sourceMappingURL=ellipsisDefault.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsisDefault.d.cts","names":[],"sources":["../../../src/components/Pagination/ellipsisDefault.ts"],"mappings":";;;;;;AAA8D;iBAOrD,eAAA,CACP,UAAA,UACA,UAAA,UACA,qBAAA,WACC,qBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationVisibleItem } from "../../types/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/ellipsisDefault.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Pin first and last page when truncated; ellipses only where there is a gap.
|
|
7
|
+
*/
|
|
8
|
+
declare function ellipsisDefault(activePage: number, totalPages: number, maxVisiblePageNumbers: number): PaginationVisibleItem[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ellipsisDefault };
|
|
11
|
+
//# sourceMappingURL=ellipsisDefault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsisDefault.d.ts","names":[],"sources":["../../../src/components/Pagination/ellipsisDefault.ts"],"mappings":";;;;;;AAA8D;iBAOrD,eAAA,CACP,UAAA,UACA,UAAA,UACA,qBAAA,WACC,qBAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { range } from "./range.js";
|
|
3
|
+
//#region src/components/Pagination/ellipsisDefault.ts
|
|
4
|
+
/**
|
|
5
|
+
* Pin first and last page when truncated; ellipses only where there is a gap.
|
|
6
|
+
*/
|
|
7
|
+
function ellipsisDefault(activePage, totalPages, maxVisiblePageNumbers) {
|
|
8
|
+
if (totalPages <= maxVisiblePageNumbers) return range(1, totalPages);
|
|
9
|
+
const middleBudget = Math.max(1, maxVisiblePageNumbers - 2);
|
|
10
|
+
const half = Math.floor((middleBudget - 1) / 2);
|
|
11
|
+
let windowStart = Math.max(2, activePage - half);
|
|
12
|
+
const windowEnd = Math.min(totalPages - 1, windowStart + middleBudget - 1);
|
|
13
|
+
windowStart = Math.max(2, windowEnd - middleBudget + 1);
|
|
14
|
+
const pageSet = new Set([1, totalPages]);
|
|
15
|
+
for (let i = windowStart; i <= windowEnd; i++) pageSet.add(i);
|
|
16
|
+
const sorted = [...pageSet].sort((a, b) => a - b);
|
|
17
|
+
const result = [];
|
|
18
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
19
|
+
const page = sorted[i];
|
|
20
|
+
const prev = sorted[i - 1];
|
|
21
|
+
if (i > 0 && page - prev > 1) result.push("ellipsis");
|
|
22
|
+
result.push(page);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ellipsisDefault };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=ellipsisDefault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsisDefault.js","names":[],"sources":["../../../src/components/Pagination/ellipsisDefault.ts"],"sourcesContent":["import type { PaginationVisibleItem } from '@yahoo/uds-types';\n\nimport { range } from './range';\n\n/**\n * Pin first and last page when truncated; ellipses only where there is a gap.\n */\nfunction ellipsisDefault(\n activePage: number,\n totalPages: number,\n maxVisiblePageNumbers: number,\n): PaginationVisibleItem[] {\n if (totalPages <= maxVisiblePageNumbers) {\n return range(1, totalPages);\n }\n\n const middleBudget = Math.max(1, maxVisiblePageNumbers - 2);\n const half = Math.floor((middleBudget - 1) / 2);\n let windowStart = Math.max(2, activePage - half);\n const windowEnd = Math.min(totalPages - 1, windowStart + middleBudget - 1);\n windowStart = Math.max(2, windowEnd - middleBudget + 1);\n\n const pageSet = new Set<number>([1, totalPages]);\n for (let i = windowStart; i <= windowEnd; i++) {\n pageSet.add(i);\n }\n\n const sorted = [...pageSet].sort((a, b) => a - b);\n const result: PaginationVisibleItem[] = [];\n\n for (let i = 0; i < sorted.length; i++) {\n const page = sorted[i];\n const prev = sorted[i - 1];\n if (i > 0 && page - prev > 1) {\n result.push('ellipsis');\n }\n result.push(page);\n }\n\n return result;\n}\n\nexport { ellipsisDefault };\n"],"mappings":";;;;;;AAOA,SAAS,gBACP,YACA,YACA,uBACyB;CACzB,IAAI,cAAc,uBAChB,OAAO,MAAM,GAAG,WAAW;CAG7B,MAAM,eAAe,KAAK,IAAI,GAAG,wBAAwB,EAAE;CAC3D,MAAM,OAAO,KAAK,OAAO,eAAe,KAAK,EAAE;CAC/C,IAAI,cAAc,KAAK,IAAI,GAAG,aAAa,KAAK;CAChD,MAAM,YAAY,KAAK,IAAI,aAAa,GAAG,cAAc,eAAe,EAAE;CAC1E,cAAc,KAAK,IAAI,GAAG,YAAY,eAAe,EAAE;CAEvD,MAAM,UAAU,IAAI,IAAY,CAAC,GAAG,WAAW,CAAC;CAChD,KAAK,IAAI,IAAI,aAAa,KAAK,WAAW,KACxC,QAAQ,IAAI,EAAE;CAGhB,MAAM,SAAS,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE;CACjD,MAAM,SAAkC,EAAE;CAE1C,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;EACtC,MAAM,OAAO,OAAO;EACpB,MAAM,OAAO,OAAO,IAAI;EACxB,IAAI,IAAI,KAAK,OAAO,OAAO,GACzB,OAAO,KAAK,WAAW;EAEzB,OAAO,KAAK,KAAK;;CAGnB,OAAO"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_components_Pagination_range = require("./range.cjs");
|
|
4
|
+
//#region src/components/Pagination/ellipsisNone.ts
|
|
5
|
+
/**
|
|
6
|
+
* Contiguous window around activePage only; never renders ellipses.
|
|
7
|
+
*/
|
|
8
|
+
function ellipsisNone(activePage, totalPages, maxVisiblePageNumbers) {
|
|
9
|
+
if (totalPages <= maxVisiblePageNumbers) return require_components_Pagination_range.range(1, totalPages);
|
|
10
|
+
const windowSize = maxVisiblePageNumbers;
|
|
11
|
+
let start = activePage - Math.floor((windowSize - 1) / 2);
|
|
12
|
+
let end = start + windowSize - 1;
|
|
13
|
+
if (start < 1) {
|
|
14
|
+
start = 1;
|
|
15
|
+
end = windowSize;
|
|
16
|
+
}
|
|
17
|
+
if (end > totalPages) {
|
|
18
|
+
end = totalPages;
|
|
19
|
+
start = totalPages - windowSize + 1;
|
|
20
|
+
}
|
|
21
|
+
return require_components_Pagination_range.range(start, end);
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.ellipsisNone = ellipsisNone;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationVisibleItem } from "../../types/dist/index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/ellipsisNone.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Contiguous window around activePage only; never renders ellipses.
|
|
7
|
+
*/
|
|
8
|
+
declare function ellipsisNone(activePage: number, totalPages: number, maxVisiblePageNumbers: number): PaginationVisibleItem[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ellipsisNone };
|
|
11
|
+
//# sourceMappingURL=ellipsisNone.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsisNone.d.cts","names":[],"sources":["../../../src/components/Pagination/ellipsisNone.ts"],"mappings":";;;;;;AAA8D;iBAOrD,YAAA,CACP,UAAA,UACA,UAAA,UACA,qBAAA,WACC,qBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationVisibleItem } from "../../types/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Pagination/ellipsisNone.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Contiguous window around activePage only; never renders ellipses.
|
|
7
|
+
*/
|
|
8
|
+
declare function ellipsisNone(activePage: number, totalPages: number, maxVisiblePageNumbers: number): PaginationVisibleItem[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ellipsisNone };
|
|
11
|
+
//# sourceMappingURL=ellipsisNone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsisNone.d.ts","names":[],"sources":["../../../src/components/Pagination/ellipsisNone.ts"],"mappings":";;;;;;AAA8D;iBAOrD,YAAA,CACP,UAAA,UACA,UAAA,UACA,qBAAA,WACC,qBAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { range } from "./range.js";
|
|
3
|
+
//#region src/components/Pagination/ellipsisNone.ts
|
|
4
|
+
/**
|
|
5
|
+
* Contiguous window around activePage only; never renders ellipses.
|
|
6
|
+
*/
|
|
7
|
+
function ellipsisNone(activePage, totalPages, maxVisiblePageNumbers) {
|
|
8
|
+
if (totalPages <= maxVisiblePageNumbers) return range(1, totalPages);
|
|
9
|
+
const windowSize = maxVisiblePageNumbers;
|
|
10
|
+
let start = activePage - Math.floor((windowSize - 1) / 2);
|
|
11
|
+
let end = start + windowSize - 1;
|
|
12
|
+
if (start < 1) {
|
|
13
|
+
start = 1;
|
|
14
|
+
end = windowSize;
|
|
15
|
+
}
|
|
16
|
+
if (end > totalPages) {
|
|
17
|
+
end = totalPages;
|
|
18
|
+
start = totalPages - windowSize + 1;
|
|
19
|
+
}
|
|
20
|
+
return range(start, end);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { ellipsisNone };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=ellipsisNone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ellipsisNone.js","names":[],"sources":["../../../src/components/Pagination/ellipsisNone.ts"],"sourcesContent":["import type { PaginationVisibleItem } from '@yahoo/uds-types';\n\nimport { range } from './range';\n\n/**\n * Contiguous window around activePage only; never renders ellipses.\n */\nfunction ellipsisNone(\n activePage: number,\n totalPages: number,\n maxVisiblePageNumbers: number,\n): PaginationVisibleItem[] {\n if (totalPages <= maxVisiblePageNumbers) {\n return range(1, totalPages);\n }\n\n const windowSize = maxVisiblePageNumbers;\n const half = Math.floor((windowSize - 1) / 2);\n let start = activePage - half;\n let end = start + windowSize - 1;\n\n if (start < 1) {\n start = 1;\n end = windowSize;\n }\n if (end > totalPages) {\n end = totalPages;\n start = totalPages - windowSize + 1;\n }\n\n return range(start, end);\n}\n\nexport { ellipsisNone };\n"],"mappings":";;;;;;AAOA,SAAS,aACP,YACA,YACA,uBACyB;CACzB,IAAI,cAAc,uBAChB,OAAO,MAAM,GAAG,WAAW;CAG7B,MAAM,aAAa;CAEnB,IAAI,QAAQ,aADC,KAAK,OAAO,aAAa,KAAK,EACd;CAC7B,IAAI,MAAM,QAAQ,aAAa;CAE/B,IAAI,QAAQ,GAAG;EACb,QAAQ;EACR,MAAM;;CAER,IAAI,MAAM,YAAY;EACpB,MAAM;EACN,QAAQ,aAAa,aAAa;;CAGpC,OAAO,MAAM,OAAO,IAAI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_components_Pagination_computeVisiblePages = require("./computeVisiblePages.cjs");
|
|
4
|
+
const require_components_Pagination_Pagination = require("./Pagination.cjs");
|
|
5
|
+
const require_components_Pagination_PaginationEllipsis = require("./PaginationEllipsis.cjs");
|
|
6
|
+
const require_components_Pagination_PaginationItem = require("./PaginationItem.cjs");
|
|
7
|
+
const require_components_Pagination_PaginationLink = require("./PaginationLink.cjs");
|
|
8
|
+
const require_components_Pagination_PaginationNext = require("./PaginationNext.cjs");
|
|
9
|
+
const require_components_Pagination_PaginationNumbers = require("./PaginationNumbers.cjs");
|
|
10
|
+
const require_components_Pagination_PaginationPrev = require("./PaginationPrev.cjs");
|
|
11
|
+
exports.Pagination = require_components_Pagination_Pagination.Pagination;
|
|
12
|
+
exports.PaginationEllipsis = require_components_Pagination_PaginationEllipsis.PaginationEllipsis;
|
|
13
|
+
exports.PaginationItem = require_components_Pagination_PaginationItem.PaginationItem;
|
|
14
|
+
exports.PaginationLink = require_components_Pagination_PaginationLink.PaginationLink;
|
|
15
|
+
exports.PaginationNext = require_components_Pagination_PaginationNext.PaginationNext;
|
|
16
|
+
exports.PaginationNumbers = require_components_Pagination_PaginationNumbers.PaginationNumbers;
|
|
17
|
+
exports.PaginationPrev = require_components_Pagination_PaginationPrev.PaginationPrev;
|
|
18
|
+
exports.computeVisiblePages = require_components_Pagination_computeVisiblePages.computeVisiblePages;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { Pagination, PaginationProps } from "./Pagination.cjs";
|
|
3
|
+
import { PaginationEllipsis, PaginationEllipsisProps } from "./PaginationEllipsis.cjs";
|
|
4
|
+
import { PaginationItem, PaginationItemProps } from "./PaginationItem.cjs";
|
|
5
|
+
import { PaginationLink, PaginationLinkProps } from "./PaginationLink.cjs";
|
|
6
|
+
import { PaginationNext, PaginationNextProps } from "./PaginationNext.cjs";
|
|
7
|
+
import { PaginationNumbers, PaginationNumbersProps } from "./PaginationNumbers.cjs";
|
|
8
|
+
import { PaginationPrev, PaginationPrevProps } from "./PaginationPrev.cjs";
|
|
9
|
+
import { ComputeVisiblePagesParams, computeVisiblePages } from "./computeVisiblePages.cjs";
|
|
10
|
+
export { type ComputeVisiblePagesParams, Pagination, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationNumbers, type PaginationNumbersProps, PaginationPrev, type PaginationPrevProps, type PaginationProps, computeVisiblePages };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { Pagination, PaginationProps } from "./Pagination.js";
|
|
3
|
+
import { PaginationEllipsis, PaginationEllipsisProps } from "./PaginationEllipsis.js";
|
|
4
|
+
import { PaginationItem, PaginationItemProps } from "./PaginationItem.js";
|
|
5
|
+
import { PaginationLink, PaginationLinkProps } from "./PaginationLink.js";
|
|
6
|
+
import { PaginationNext, PaginationNextProps } from "./PaginationNext.js";
|
|
7
|
+
import { PaginationNumbers, PaginationNumbersProps } from "./PaginationNumbers.js";
|
|
8
|
+
import { PaginationPrev, PaginationPrevProps } from "./PaginationPrev.js";
|
|
9
|
+
import { ComputeVisiblePagesParams, computeVisiblePages } from "./computeVisiblePages.js";
|
|
10
|
+
export { type ComputeVisiblePagesParams, Pagination, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationNumbers, type PaginationNumbersProps, PaginationPrev, type PaginationPrevProps, type PaginationProps, computeVisiblePages };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { computeVisiblePages } from "./computeVisiblePages.js";
|
|
3
|
+
import { Pagination } from "./Pagination.js";
|
|
4
|
+
import { PaginationEllipsis } from "./PaginationEllipsis.js";
|
|
5
|
+
import { PaginationItem } from "./PaginationItem.js";
|
|
6
|
+
import { PaginationLink } from "./PaginationLink.js";
|
|
7
|
+
import { PaginationNext } from "./PaginationNext.js";
|
|
8
|
+
import { PaginationNumbers } from "./PaginationNumbers.js";
|
|
9
|
+
import { PaginationPrev } from "./PaginationPrev.js";
|
|
10
|
+
export { Pagination, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationNumbers, PaginationPrev, computeVisiblePages };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_components_Pagination_computeVisiblePages = require("./computeVisiblePages.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region src/components/Pagination/paginationContext.tsx
|
|
8
|
+
const defaultGetItemAriaLabel = (page, isActive) => isActive ? `Page ${page}, current page` : `Go to page ${page}`;
|
|
9
|
+
const PaginationContext = (0, react.createContext)(null);
|
|
10
|
+
const PaginationProvider = ({ value, children }) => {
|
|
11
|
+
const contextValue = (0, react.useMemo)(() => value, [value]);
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationContext.Provider, {
|
|
13
|
+
value: contextValue,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
PaginationProvider.displayName = "PaginationProvider";
|
|
18
|
+
function usePaginationContext() {
|
|
19
|
+
const context = (0, react.useContext)(PaginationContext);
|
|
20
|
+
if (!context) throw new Error("Pagination components must be used within a Pagination provider.");
|
|
21
|
+
return context;
|
|
22
|
+
}
|
|
23
|
+
function useVisiblePages() {
|
|
24
|
+
const { activePage, totalPages, maxVisiblePageNumbers, ellipsisPlacement } = usePaginationContext();
|
|
25
|
+
return (0, react.useMemo)(() => require_components_Pagination_computeVisiblePages.computeVisiblePages({
|
|
26
|
+
activePage,
|
|
27
|
+
totalPages,
|
|
28
|
+
maxVisiblePageNumbers,
|
|
29
|
+
ellipsisPlacement
|
|
30
|
+
}), [
|
|
31
|
+
activePage,
|
|
32
|
+
totalPages,
|
|
33
|
+
maxVisiblePageNumbers,
|
|
34
|
+
ellipsisPlacement
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
exports.PaginationContext = PaginationContext;
|
|
39
|
+
exports.PaginationProvider = PaginationProvider;
|
|
40
|
+
exports.defaultGetItemAriaLabel = defaultGetItemAriaLabel;
|
|
41
|
+
exports.usePaginationContext = usePaginationContext;
|
|
42
|
+
exports.useVisiblePages = useVisiblePages;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationEllipsisPlacement, PaginationSize, PaginationVariant, PaginationVisibleItem } from "../../types/dist/index.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Pagination/paginationContext.d.ts
|
|
6
|
+
interface PaginationContextValue {
|
|
7
|
+
activePage: number;
|
|
8
|
+
totalPages: number;
|
|
9
|
+
maxVisiblePageNumbers: number;
|
|
10
|
+
ellipsisPlacement: PaginationEllipsisPlacement;
|
|
11
|
+
size: PaginationSize;
|
|
12
|
+
variant: PaginationVariant;
|
|
13
|
+
getPageHref?: (page: number) => string;
|
|
14
|
+
getItemAriaLabel: (page: number, isActive: boolean) => string;
|
|
15
|
+
onPageChange?: (page: number) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const defaultGetItemAriaLabel: (page: number, isActive: boolean) => string;
|
|
18
|
+
declare const PaginationContext: _$react.Context<PaginationContextValue | null>;
|
|
19
|
+
interface PaginationProviderProps {
|
|
20
|
+
value: PaginationContextValue;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
declare const PaginationProvider: {
|
|
24
|
+
({
|
|
25
|
+
value,
|
|
26
|
+
children
|
|
27
|
+
}: PaginationProviderProps): _$react.JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
declare function usePaginationContext(): PaginationContextValue;
|
|
31
|
+
declare function useVisiblePages(): PaginationVisibleItem[];
|
|
32
|
+
//#endregion
|
|
33
|
+
export { PaginationContext, PaginationProvider, defaultGetItemAriaLabel, usePaginationContext, useVisiblePages };
|
|
34
|
+
//# sourceMappingURL=paginationContext.d.cts.map
|