@yahoo/uds-mobile 2.17.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/bin/generateTheme.mjs +7 -2
- package/dist/bin/mobile/scripts/utils/configToRNMappings.mjs +4 -0
- 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/components/Popover/Popover.cjs +92 -0
- package/dist/components/Popover/Popover.d.cts +26 -0
- package/dist/components/Popover/Popover.d.cts.map +1 -0
- package/dist/components/Popover/Popover.d.ts +26 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/Popover.js +92 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Popover/PopoverContent.cjs +124 -0
- package/dist/components/Popover/PopoverContent.d.cts +15 -0
- package/dist/components/Popover/PopoverContent.d.cts.map +1 -0
- package/dist/components/Popover/PopoverContent.d.ts +15 -0
- package/dist/components/Popover/PopoverContent.d.ts.map +1 -0
- package/dist/components/Popover/PopoverContent.js +124 -0
- package/dist/components/Popover/PopoverContent.js.map +1 -0
- package/dist/components/Popover/PopoverContext.cjs +14 -0
- package/dist/components/Popover/PopoverContext.d.cts +10 -0
- package/dist/components/Popover/PopoverContext.d.cts.map +1 -0
- package/dist/components/Popover/PopoverContext.d.ts +10 -0
- package/dist/components/Popover/PopoverContext.d.ts.map +1 -0
- package/dist/components/Popover/PopoverContext.js +13 -0
- package/dist/components/Popover/PopoverContext.js.map +1 -0
- package/dist/components/Popover/PopoverDescription.cjs +23 -0
- package/dist/components/Popover/PopoverDescription.d.cts +15 -0
- package/dist/components/Popover/PopoverDescription.d.cts.map +1 -0
- package/dist/components/Popover/PopoverDescription.d.ts +15 -0
- package/dist/components/Popover/PopoverDescription.d.ts.map +1 -0
- package/dist/components/Popover/PopoverDescription.js +23 -0
- package/dist/components/Popover/PopoverDescription.js.map +1 -0
- package/dist/components/Popover/PopoverDismiss.cjs +22 -0
- package/dist/components/Popover/PopoverDismiss.d.cts +15 -0
- package/dist/components/Popover/PopoverDismiss.d.cts.map +1 -0
- package/dist/components/Popover/PopoverDismiss.d.ts +15 -0
- package/dist/components/Popover/PopoverDismiss.d.ts.map +1 -0
- package/dist/components/Popover/PopoverDismiss.js +22 -0
- package/dist/components/Popover/PopoverDismiss.js.map +1 -0
- package/dist/components/Popover/PopoverFrame.cjs +56 -0
- package/dist/components/Popover/PopoverFrame.d.cts +23 -0
- package/dist/components/Popover/PopoverFrame.d.cts.map +1 -0
- package/dist/components/Popover/PopoverFrame.d.ts +23 -0
- package/dist/components/Popover/PopoverFrame.d.ts.map +1 -0
- package/dist/components/Popover/PopoverFrame.js +55 -0
- package/dist/components/Popover/PopoverFrame.js.map +1 -0
- package/dist/components/Popover/PopoverPortalLayer.cjs +45 -0
- package/dist/components/Popover/PopoverPortalLayer.d.cts +15 -0
- package/dist/components/Popover/PopoverPortalLayer.d.cts.map +1 -0
- package/dist/components/Popover/PopoverPortalLayer.d.ts +15 -0
- package/dist/components/Popover/PopoverPortalLayer.d.ts.map +1 -0
- package/dist/components/Popover/PopoverPortalLayer.js +45 -0
- package/dist/components/Popover/PopoverPortalLayer.js.map +1 -0
- package/dist/components/Popover/PopoverSurface.cjs +228 -0
- package/dist/components/Popover/PopoverSurface.d.cts +26 -0
- package/dist/components/Popover/PopoverSurface.d.cts.map +1 -0
- package/dist/components/Popover/PopoverSurface.d.ts +26 -0
- package/dist/components/Popover/PopoverSurface.d.ts.map +1 -0
- package/dist/components/Popover/PopoverSurface.js +227 -0
- package/dist/components/Popover/PopoverSurface.js.map +1 -0
- package/dist/components/Popover/PopoverTitle.cjs +23 -0
- package/dist/components/Popover/PopoverTitle.d.cts +15 -0
- package/dist/components/Popover/PopoverTitle.d.cts.map +1 -0
- package/dist/components/Popover/PopoverTitle.d.ts +15 -0
- package/dist/components/Popover/PopoverTitle.d.ts.map +1 -0
- package/dist/components/Popover/PopoverTitle.js +23 -0
- package/dist/components/Popover/PopoverTitle.js.map +1 -0
- package/dist/components/Popover/PopoverTrigger.cjs +88 -0
- package/dist/components/Popover/PopoverTrigger.d.cts +15 -0
- package/dist/components/Popover/PopoverTrigger.d.cts.map +1 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +15 -0
- package/dist/components/Popover/PopoverTrigger.d.ts.map +1 -0
- package/dist/components/Popover/PopoverTrigger.js +88 -0
- package/dist/components/Popover/PopoverTrigger.js.map +1 -0
- package/dist/components/Popover/index.cjs +14 -0
- package/dist/components/Popover/index.d.cts +9 -0
- package/dist/components/Popover/index.d.ts +9 -0
- package/dist/components/Popover/index.js +8 -0
- package/dist/components/Popover/popoverFrameGeometry.cjs +177 -0
- package/dist/components/Popover/popoverFrameGeometry.d.cts +48 -0
- package/dist/components/Popover/popoverFrameGeometry.d.cts.map +1 -0
- package/dist/components/Popover/popoverFrameGeometry.d.ts +48 -0
- package/dist/components/Popover/popoverFrameGeometry.d.ts.map +1 -0
- package/dist/components/Popover/popoverFrameGeometry.js +177 -0
- package/dist/components/Popover/popoverFrameGeometry.js.map +1 -0
- package/dist/components/Popover/popoverLayer.cjs +16 -0
- package/dist/components/Popover/popoverLayer.d.cts +8 -0
- package/dist/components/Popover/popoverLayer.d.cts.map +1 -0
- package/dist/components/Popover/popoverLayer.d.ts +8 -0
- package/dist/components/Popover/popoverLayer.d.ts.map +1 -0
- package/dist/components/Popover/popoverLayer.js +16 -0
- package/dist/components/Popover/popoverLayer.js.map +1 -0
- package/dist/components/Popover/types.cjs +1 -0
- package/dist/components/Popover/types.d.cts +170 -0
- package/dist/components/Popover/types.d.cts.map +1 -0
- package/dist/components/Popover/types.d.ts +170 -0
- package/dist/components/Popover/types.d.ts.map +1 -0
- package/dist/components/Popover/types.js +1 -0
- package/dist/components/Toast/ToastProvider.cjs +1 -1
- package/dist/components/Toast/ToastProvider.js +1 -1
- package/dist/components/internal/Overlay/index.cjs +4 -0
- package/dist/components/internal/Overlay/index.d.cts +4 -2
- package/dist/components/internal/Overlay/index.d.ts +4 -2
- package/dist/components/internal/Overlay/index.js +3 -1
- package/dist/components/internal/Overlay/types.d.cts +47 -1
- package/dist/components/internal/Overlay/types.d.cts.map +1 -1
- package/dist/components/internal/Overlay/types.d.ts +47 -1
- package/dist/components/internal/Overlay/types.d.ts.map +1 -1
- package/dist/components/internal/Overlay/useAnchoredPosition.cjs +225 -0
- package/dist/components/internal/Overlay/useAnchoredPosition.d.cts +22 -0
- package/dist/components/internal/Overlay/useAnchoredPosition.d.cts.map +1 -0
- package/dist/components/internal/Overlay/useAnchoredPosition.d.ts +22 -0
- package/dist/components/internal/Overlay/useAnchoredPosition.d.ts.map +1 -0
- package/dist/components/internal/Overlay/useAnchoredPosition.js +225 -0
- package/dist/components/internal/Overlay/useAnchoredPosition.js.map +1 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.cjs +22 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.d.cts +12 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.d.cts.map +1 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.d.ts +12 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.d.ts.map +1 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.js +22 -0
- package/dist/components/internal/Overlay/useOverlayDismiss.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/react-native.cjs +14 -0
- package/dist/jest/mocks/react-native.d.cts +29 -1
- package/dist/jest/mocks/react-native.d.cts.map +1 -1
- package/dist/jest/mocks/react-native.d.ts +29 -1
- package/dist/jest/mocks/react-native.d.ts.map +1 -1
- package/dist/jest/mocks/react-native.js +13 -1
- package/dist/jest/mocks/react-native.js.map +1 -1
- package/dist/jest/mocks/styles.cjs +83 -0
- package/dist/jest/mocks/styles.d.cts +6 -2
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts +6 -2
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +80 -1
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/jest/setup.cjs +46 -3
- package/dist/jest/setup.d.cts.map +1 -1
- package/dist/jest/setup.d.ts.map +1 -1
- package/dist/jest/setup.js +46 -3
- package/dist/jest/setup.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 +81 -0
- package/generated/styles.d.ts +42 -1
- package/generated/styles.mjs +81 -0
- package/generated/unistyles.d.ts +82 -0
- package/package.json +21 -1
|
@@ -0,0 +1,78 @@
|
|
|
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_paginationTheme = require("./paginationTheme.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_native = require("react-native");
|
|
7
|
+
let react_native_unistyles = require("react-native-unistyles");
|
|
8
|
+
//#region src/components/Pagination/usePaginationControlStyles.ts
|
|
9
|
+
function usePaginationControlStyles({ size, variant, isActive, pressed, layout = "page" }) {
|
|
10
|
+
const { theme } = (0, react_native_unistyles.useUnistyles)();
|
|
11
|
+
const active = isActive ? "on" : "off";
|
|
12
|
+
const interaction = pressed ? "pressed" : "rest";
|
|
13
|
+
const prevNextActive = "off";
|
|
14
|
+
return {
|
|
15
|
+
rootStyle: (0, react.useMemo)(() => {
|
|
16
|
+
const { controlSize, borderRadius } = require_components_Pagination_paginationTheme.getPaginationControlMetrics(theme, size);
|
|
17
|
+
const variantActive = layout === "prevNext" ? prevNextActive : active;
|
|
18
|
+
return [
|
|
19
|
+
layout === "page" ? paginationStaticStyles.pageRoot : paginationStaticStyles.prevNextRoot,
|
|
20
|
+
require_components_Pagination_paginationTheme.getMergedPaginationControlRootStyle(theme, size, variant, variantActive, interaction),
|
|
21
|
+
{
|
|
22
|
+
borderRadius,
|
|
23
|
+
...layout === "page" ? {
|
|
24
|
+
height: controlSize,
|
|
25
|
+
width: controlSize
|
|
26
|
+
} : { minHeight: controlSize }
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
}, [
|
|
30
|
+
active,
|
|
31
|
+
interaction,
|
|
32
|
+
layout,
|
|
33
|
+
size,
|
|
34
|
+
theme,
|
|
35
|
+
variant
|
|
36
|
+
]),
|
|
37
|
+
textStyle: (0, react.useMemo)(() => {
|
|
38
|
+
const variantActive = layout === "prevNext" ? prevNextActive : active;
|
|
39
|
+
return [paginationStaticStyles.text, require_components_Pagination_paginationTheme.getMergedPaginationTextStyle(theme, size, variant, variantActive, interaction)];
|
|
40
|
+
}, [
|
|
41
|
+
active,
|
|
42
|
+
interaction,
|
|
43
|
+
layout,
|
|
44
|
+
size,
|
|
45
|
+
theme,
|
|
46
|
+
variant
|
|
47
|
+
]),
|
|
48
|
+
iconStyle: (0, react.useMemo)(() => require_components_Pagination_paginationTheme.getMergedPaginationIconStyle(theme, size, variant, layout === "prevNext" ? prevNextActive : active, interaction), [
|
|
49
|
+
active,
|
|
50
|
+
interaction,
|
|
51
|
+
layout,
|
|
52
|
+
size,
|
|
53
|
+
theme,
|
|
54
|
+
variant
|
|
55
|
+
])
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const paginationStaticStyles = react_native.StyleSheet.create({
|
|
59
|
+
pageRoot: {
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
justifyContent: "center",
|
|
62
|
+
flexShrink: 0
|
|
63
|
+
},
|
|
64
|
+
prevNextRoot: {
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
flexDirection: "row",
|
|
67
|
+
flexShrink: 0,
|
|
68
|
+
gap: 4,
|
|
69
|
+
justifyContent: "center"
|
|
70
|
+
},
|
|
71
|
+
text: {
|
|
72
|
+
flexShrink: 0,
|
|
73
|
+
fontVariant: ["tabular-nums"],
|
|
74
|
+
textAlign: "center"
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.usePaginationControlStyles = usePaginationControlStyles;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationSize, PaginationVariant } from "../../types/dist/index.cjs";
|
|
3
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Pagination/usePaginationControlStyles.d.ts
|
|
6
|
+
interface UsePaginationControlStylesOptions {
|
|
7
|
+
size: PaginationSize;
|
|
8
|
+
variant: PaginationVariant;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
pressed: boolean;
|
|
11
|
+
layout?: 'page' | 'prevNext';
|
|
12
|
+
}
|
|
13
|
+
declare function usePaginationControlStyles({
|
|
14
|
+
size,
|
|
15
|
+
variant,
|
|
16
|
+
isActive,
|
|
17
|
+
pressed,
|
|
18
|
+
layout
|
|
19
|
+
}: UsePaginationControlStylesOptions): {
|
|
20
|
+
rootStyle: StyleProp<ViewStyle>;
|
|
21
|
+
textStyle: StyleProp<TextStyle>;
|
|
22
|
+
iconStyle: StyleProp<TextStyle>;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { usePaginationControlStyles };
|
|
26
|
+
//# sourceMappingURL=usePaginationControlStyles.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaginationControlStyles.d.cts","names":[],"sources":["../../../src/components/Pagination/usePaginationControlStyles.ts"],"mappings":";;;;;UAcU,iCAAA;EACR,IAAA,EAAM,cAAA;EACN,OAAA,EAAS,iBAAA;EACT,QAAA;EACA,OAAA;EACA,MAAA;AAAA;AAAA,iBAGO,0BAAA,CAAA;EACP,IAAA;EACA,OAAA;EACA,QAAA;EACA,OAAA;EACA;AAAA,GACC,iCAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { PaginationSize, PaginationVariant } from "../../types/dist/index.js";
|
|
3
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Pagination/usePaginationControlStyles.d.ts
|
|
6
|
+
interface UsePaginationControlStylesOptions {
|
|
7
|
+
size: PaginationSize;
|
|
8
|
+
variant: PaginationVariant;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
pressed: boolean;
|
|
11
|
+
layout?: 'page' | 'prevNext';
|
|
12
|
+
}
|
|
13
|
+
declare function usePaginationControlStyles({
|
|
14
|
+
size,
|
|
15
|
+
variant,
|
|
16
|
+
isActive,
|
|
17
|
+
pressed,
|
|
18
|
+
layout
|
|
19
|
+
}: UsePaginationControlStylesOptions): {
|
|
20
|
+
rootStyle: StyleProp<ViewStyle>;
|
|
21
|
+
textStyle: StyleProp<TextStyle>;
|
|
22
|
+
iconStyle: StyleProp<TextStyle>;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { usePaginationControlStyles };
|
|
26
|
+
//# sourceMappingURL=usePaginationControlStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaginationControlStyles.d.ts","names":[],"sources":["../../../src/components/Pagination/usePaginationControlStyles.ts"],"mappings":";;;;;UAcU,iCAAA;EACR,IAAA,EAAM,cAAA;EACN,OAAA,EAAS,iBAAA;EACT,QAAA;EACA,OAAA;EACA,MAAA;AAAA;AAAA,iBAGO,0BAAA,CAAA;EACP,IAAA;EACA,OAAA;EACA,QAAA;EACA,OAAA;EACA;AAAA,GACC,iCAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { getMergedPaginationControlRootStyle, getMergedPaginationIconStyle, getMergedPaginationTextStyle, getPaginationControlMetrics } from "./paginationTheme.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
import { useUnistyles } from "react-native-unistyles";
|
|
6
|
+
//#region src/components/Pagination/usePaginationControlStyles.ts
|
|
7
|
+
function usePaginationControlStyles({ size, variant, isActive, pressed, layout = "page" }) {
|
|
8
|
+
const { theme } = useUnistyles();
|
|
9
|
+
const active = isActive ? "on" : "off";
|
|
10
|
+
const interaction = pressed ? "pressed" : "rest";
|
|
11
|
+
const prevNextActive = "off";
|
|
12
|
+
return {
|
|
13
|
+
rootStyle: useMemo(() => {
|
|
14
|
+
const { controlSize, borderRadius } = getPaginationControlMetrics(theme, size);
|
|
15
|
+
const variantActive = layout === "prevNext" ? prevNextActive : active;
|
|
16
|
+
return [
|
|
17
|
+
layout === "page" ? paginationStaticStyles.pageRoot : paginationStaticStyles.prevNextRoot,
|
|
18
|
+
getMergedPaginationControlRootStyle(theme, size, variant, variantActive, interaction),
|
|
19
|
+
{
|
|
20
|
+
borderRadius,
|
|
21
|
+
...layout === "page" ? {
|
|
22
|
+
height: controlSize,
|
|
23
|
+
width: controlSize
|
|
24
|
+
} : { minHeight: controlSize }
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
}, [
|
|
28
|
+
active,
|
|
29
|
+
interaction,
|
|
30
|
+
layout,
|
|
31
|
+
size,
|
|
32
|
+
theme,
|
|
33
|
+
variant
|
|
34
|
+
]),
|
|
35
|
+
textStyle: useMemo(() => {
|
|
36
|
+
const variantActive = layout === "prevNext" ? prevNextActive : active;
|
|
37
|
+
return [paginationStaticStyles.text, getMergedPaginationTextStyle(theme, size, variant, variantActive, interaction)];
|
|
38
|
+
}, [
|
|
39
|
+
active,
|
|
40
|
+
interaction,
|
|
41
|
+
layout,
|
|
42
|
+
size,
|
|
43
|
+
theme,
|
|
44
|
+
variant
|
|
45
|
+
]),
|
|
46
|
+
iconStyle: useMemo(() => getMergedPaginationIconStyle(theme, size, variant, layout === "prevNext" ? prevNextActive : active, interaction), [
|
|
47
|
+
active,
|
|
48
|
+
interaction,
|
|
49
|
+
layout,
|
|
50
|
+
size,
|
|
51
|
+
theme,
|
|
52
|
+
variant
|
|
53
|
+
])
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const paginationStaticStyles = StyleSheet.create({
|
|
57
|
+
pageRoot: {
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
justifyContent: "center",
|
|
60
|
+
flexShrink: 0
|
|
61
|
+
},
|
|
62
|
+
prevNextRoot: {
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
flexDirection: "row",
|
|
65
|
+
flexShrink: 0,
|
|
66
|
+
gap: 4,
|
|
67
|
+
justifyContent: "center"
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
flexShrink: 0,
|
|
71
|
+
fontVariant: ["tabular-nums"],
|
|
72
|
+
textAlign: "center"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { usePaginationControlStyles };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=usePaginationControlStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaginationControlStyles.js","names":[],"sources":["../../../src/components/Pagination/usePaginationControlStyles.ts"],"sourcesContent":["import type { PaginationSize, PaginationVariant } from '@yahoo/uds-types';\nimport { useMemo } from 'react';\nimport type { StyleProp, TextStyle, ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- pagination token lookups for variant + size layers\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport {\n getMergedPaginationControlRootStyle,\n getMergedPaginationIconStyle,\n getMergedPaginationTextStyle,\n getPaginationControlMetrics,\n} from './paginationTheme';\n\ninterface UsePaginationControlStylesOptions {\n size: PaginationSize;\n variant: PaginationVariant;\n isActive: boolean;\n pressed: boolean;\n layout?: 'page' | 'prevNext';\n}\n\nfunction usePaginationControlStyles({\n size,\n variant,\n isActive,\n pressed,\n layout = 'page',\n}: UsePaginationControlStylesOptions) {\n const { theme } = useUnistyles();\n const active: 'on' | 'off' = isActive ? 'on' : 'off';\n const interaction = pressed ? 'pressed' : 'rest';\n const prevNextActive: 'on' | 'off' = 'off';\n\n const rootStyle = useMemo<StyleProp<ViewStyle>>(() => {\n const { controlSize, borderRadius } = getPaginationControlMetrics(theme, size);\n const variantActive = layout === 'prevNext' ? prevNextActive : active;\n\n return [\n layout === 'page' ? paginationStaticStyles.pageRoot : paginationStaticStyles.prevNextRoot,\n getMergedPaginationControlRootStyle(theme, size, variant, variantActive, interaction),\n {\n borderRadius,\n ...(layout === 'page'\n ? { height: controlSize, width: controlSize }\n : { minHeight: controlSize }),\n },\n ];\n }, [active, interaction, layout, size, theme, variant]);\n\n const textStyle = useMemo<StyleProp<TextStyle>>(() => {\n const variantActive = layout === 'prevNext' ? prevNextActive : active;\n\n return [\n paginationStaticStyles.text,\n getMergedPaginationTextStyle(theme, size, variant, variantActive, interaction),\n ];\n }, [active, interaction, layout, size, theme, variant]);\n\n const iconStyle = useMemo<StyleProp<TextStyle>>(\n () =>\n getMergedPaginationIconStyle(\n theme,\n size,\n variant,\n layout === 'prevNext' ? prevNextActive : active,\n interaction,\n ),\n [active, interaction, layout, size, theme, variant],\n );\n\n return { rootStyle, textStyle, iconStyle };\n}\n\nconst paginationStaticStyles = StyleSheet.create({\n pageRoot: {\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n },\n prevNextRoot: {\n alignItems: 'center',\n flexDirection: 'row',\n flexShrink: 0,\n gap: 4,\n justifyContent: 'center',\n },\n text: {\n flexShrink: 0,\n fontVariant: ['tabular-nums'],\n textAlign: 'center',\n },\n});\n\nexport { usePaginationControlStyles };\n"],"mappings":";;;;;;AAsBA,SAAS,2BAA2B,EAClC,MACA,SACA,UACA,SACA,SAAS,UAC2B;CACpC,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,SAAuB,WAAW,OAAO;CAC/C,MAAM,cAAc,UAAU,YAAY;CAC1C,MAAM,iBAA+B;CAuCrC,OAAO;EAAE,WArCS,cAAoC;GACpD,MAAM,EAAE,aAAa,iBAAiB,4BAA4B,OAAO,KAAK;GAC9E,MAAM,gBAAgB,WAAW,aAAa,iBAAiB;GAE/D,OAAO;IACL,WAAW,SAAS,uBAAuB,WAAW,uBAAuB;IAC7E,oCAAoC,OAAO,MAAM,SAAS,eAAe,YAAY;IACrF;KACE;KACA,GAAI,WAAW,SACX;MAAE,QAAQ;MAAa,OAAO;MAAa,GAC3C,EAAE,WAAW,aAAa;KAC/B;IACF;KACA;GAAC;GAAQ;GAAa;GAAQ;GAAM;GAAO;GAAQ,CAuBpC;EAAE,WArBF,cAAoC;GACpD,MAAM,gBAAgB,WAAW,aAAa,iBAAiB;GAE/D,OAAO,CACL,uBAAuB,MACvB,6BAA6B,OAAO,MAAM,SAAS,eAAe,YAAY,CAC/E;KACA;GAAC;GAAQ;GAAa;GAAQ;GAAM;GAAO;GAAQ,CAczB;EAAE,WAZb,cAEd,6BACE,OACA,MACA,SACA,WAAW,aAAa,iBAAiB,QACzC,YACD,EACH;GAAC;GAAQ;GAAa;GAAQ;GAAM;GAAO;GAAQ,CAGb;EAAE;;AAG5C,MAAM,yBAAyB,WAAW,OAAO;CAC/C,UAAU;EACR,YAAY;EACZ,gBAAgB;EAChB,YAAY;EACb;CACD,cAAc;EACZ,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,KAAK;EACL,gBAAgB;EACjB;CACD,MAAM;EACJ,YAAY;EACZ,aAAa,CAAC,eAAe;EAC7B,WAAW;EACZ;CACF,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
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_internal_Overlay_useControllableState = require("../internal/Overlay/useControllableState.cjs");
|
|
5
|
+
const require_components_Popover_PopoverContext = require("./PopoverContext.cjs");
|
|
6
|
+
const require_components_Popover_popoverLayer = require("./popoverLayer.cjs");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
//#region src/components/Popover/Popover.tsx
|
|
10
|
+
const DEFAULT_PLACEMENT = "bottom";
|
|
11
|
+
const DEFAULT_OFFSET = 9;
|
|
12
|
+
const DEFAULT_COLLISION_PADDING = 12;
|
|
13
|
+
/**
|
|
14
|
+
* The root popover component for React Native.
|
|
15
|
+
*
|
|
16
|
+
* Manages open state, trigger measurement, and anchored positioning for a
|
|
17
|
+
* floating surface. Use with {@link PopoverTrigger} and {@link PopoverContent}.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Popover>
|
|
22
|
+
* <PopoverTrigger render={<Button>Open popover</Button>} />
|
|
23
|
+
* <PopoverContent>
|
|
24
|
+
* <PopoverTitle>Storage almost full</PopoverTitle>
|
|
25
|
+
* <PopoverDescription>Review large files or upgrade your plan.</PopoverDescription>
|
|
26
|
+
* </PopoverContent>
|
|
27
|
+
* </Popover>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const Popover = (0, react.memo)(function Popover({ children, open: openProp, defaultOpen = false, onOpenChange, onOpen, onClose, placement = DEFAULT_PLACEMENT, align, offset = DEFAULT_OFFSET, alignOffset = 0, avoidCollisions = true, collisionPadding = DEFAULT_COLLISION_PADDING, width = "content", sameWidth = false, hideArrow = false, hideDismissButton = false, dismissible = true, closeAccessibilityLabel = "Close popover", reduceMotion = false, insets, blurTarget }) {
|
|
31
|
+
const id = (0, react.useId)();
|
|
32
|
+
const triggerRef = (0, react.useRef)(null);
|
|
33
|
+
const [triggerRect, setTriggerRect] = (0, react.useState)(null);
|
|
34
|
+
const [open, setOpenState] = require_components_internal_Overlay_useControllableState.useControllableState({
|
|
35
|
+
value: openProp,
|
|
36
|
+
defaultValue: defaultOpen,
|
|
37
|
+
onChange: onOpenChange
|
|
38
|
+
});
|
|
39
|
+
const previousOpenRef = (0, react.useRef)(open);
|
|
40
|
+
const setOpen = setOpenState;
|
|
41
|
+
(0, react.useEffect)(() => {
|
|
42
|
+
if (previousOpenRef.current === open) return;
|
|
43
|
+
previousOpenRef.current = open;
|
|
44
|
+
if (open) onOpen?.();
|
|
45
|
+
else onClose?.();
|
|
46
|
+
}, [
|
|
47
|
+
onClose,
|
|
48
|
+
onOpen,
|
|
49
|
+
open
|
|
50
|
+
]);
|
|
51
|
+
(0, react.useEffect)(() => {
|
|
52
|
+
if (!open) return;
|
|
53
|
+
require_components_Popover_popoverLayer.notifyPopoverOpened(id);
|
|
54
|
+
}, [id, open]);
|
|
55
|
+
(0, react.useEffect)(() => require_components_Popover_popoverLayer.subscribeToPopoverLayer((openedId) => {
|
|
56
|
+
if (openedId !== id && open) setOpen(false);
|
|
57
|
+
}), [
|
|
58
|
+
id,
|
|
59
|
+
open,
|
|
60
|
+
setOpen
|
|
61
|
+
]);
|
|
62
|
+
const contextValue = {
|
|
63
|
+
id,
|
|
64
|
+
open,
|
|
65
|
+
setOpen,
|
|
66
|
+
triggerRef,
|
|
67
|
+
triggerRect,
|
|
68
|
+
setTriggerRect,
|
|
69
|
+
placement,
|
|
70
|
+
align,
|
|
71
|
+
offset,
|
|
72
|
+
alignOffset,
|
|
73
|
+
avoidCollisions,
|
|
74
|
+
collisionPadding,
|
|
75
|
+
width,
|
|
76
|
+
sameWidth,
|
|
77
|
+
hideArrow,
|
|
78
|
+
hideDismissButton,
|
|
79
|
+
dismissible,
|
|
80
|
+
closeAccessibilityLabel,
|
|
81
|
+
reduceMotion,
|
|
82
|
+
insets,
|
|
83
|
+
blurTarget
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Popover_PopoverContext.PopoverContext.Provider, {
|
|
86
|
+
value: contextValue,
|
|
87
|
+
children
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
Popover.displayName = "Popover";
|
|
91
|
+
//#endregion
|
|
92
|
+
exports.Popover = Popover;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { PopoverProps } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Popover/Popover.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The root popover component for React Native.
|
|
8
|
+
*
|
|
9
|
+
* Manages open state, trigger measurement, and anchored positioning for a
|
|
10
|
+
* floating surface. Use with {@link PopoverTrigger} and {@link PopoverContent}.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Popover>
|
|
15
|
+
* <PopoverTrigger render={<Button>Open popover</Button>} />
|
|
16
|
+
* <PopoverContent>
|
|
17
|
+
* <PopoverTitle>Storage almost full</PopoverTitle>
|
|
18
|
+
* <PopoverDescription>Review large files or upgrade your plan.</PopoverDescription>
|
|
19
|
+
* </PopoverContent>
|
|
20
|
+
* </Popover>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const Popover: _$react.NamedExoticComponent<PopoverProps>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Popover };
|
|
26
|
+
//# sourceMappingURL=Popover.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.d.cts","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"mappings":";;;;;;;;AAMiE;;;;;;;;;;;;;;cAuB3D,OAAA,EAAO,OAAA,CAAA,oBAAA,CAAA,YAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { PopoverProps } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Popover/Popover.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* The root popover component for React Native.
|
|
8
|
+
*
|
|
9
|
+
* Manages open state, trigger measurement, and anchored positioning for a
|
|
10
|
+
* floating surface. Use with {@link PopoverTrigger} and {@link PopoverContent}.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Popover>
|
|
15
|
+
* <PopoverTrigger render={<Button>Open popover</Button>} />
|
|
16
|
+
* <PopoverContent>
|
|
17
|
+
* <PopoverTitle>Storage almost full</PopoverTitle>
|
|
18
|
+
* <PopoverDescription>Review large files or upgrade your plan.</PopoverDescription>
|
|
19
|
+
* </PopoverContent>
|
|
20
|
+
* </Popover>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const Popover: _$react.NamedExoticComponent<PopoverProps>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Popover };
|
|
26
|
+
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"mappings":";;;;;;;;AAMiE;;;;;;;;;;;;;;cAuB3D,OAAA,EAAO,OAAA,CAAA,oBAAA,CAAA,YAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useControllableState } from "../internal/Overlay/useControllableState.js";
|
|
3
|
+
import { PopoverContext } from "./PopoverContext.js";
|
|
4
|
+
import { notifyPopoverOpened, subscribeToPopoverLayer } from "./popoverLayer.js";
|
|
5
|
+
import { memo, useEffect, useId, useRef, useState } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Popover/Popover.tsx
|
|
8
|
+
const DEFAULT_PLACEMENT = "bottom";
|
|
9
|
+
const DEFAULT_OFFSET = 9;
|
|
10
|
+
const DEFAULT_COLLISION_PADDING = 12;
|
|
11
|
+
/**
|
|
12
|
+
* The root popover component for React Native.
|
|
13
|
+
*
|
|
14
|
+
* Manages open state, trigger measurement, and anchored positioning for a
|
|
15
|
+
* floating surface. Use with {@link PopoverTrigger} and {@link PopoverContent}.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Popover>
|
|
20
|
+
* <PopoverTrigger render={<Button>Open popover</Button>} />
|
|
21
|
+
* <PopoverContent>
|
|
22
|
+
* <PopoverTitle>Storage almost full</PopoverTitle>
|
|
23
|
+
* <PopoverDescription>Review large files or upgrade your plan.</PopoverDescription>
|
|
24
|
+
* </PopoverContent>
|
|
25
|
+
* </Popover>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
const Popover = memo(function Popover({ children, open: openProp, defaultOpen = false, onOpenChange, onOpen, onClose, placement = DEFAULT_PLACEMENT, align, offset = DEFAULT_OFFSET, alignOffset = 0, avoidCollisions = true, collisionPadding = DEFAULT_COLLISION_PADDING, width = "content", sameWidth = false, hideArrow = false, hideDismissButton = false, dismissible = true, closeAccessibilityLabel = "Close popover", reduceMotion = false, insets, blurTarget }) {
|
|
29
|
+
const id = useId();
|
|
30
|
+
const triggerRef = useRef(null);
|
|
31
|
+
const [triggerRect, setTriggerRect] = useState(null);
|
|
32
|
+
const [open, setOpenState] = useControllableState({
|
|
33
|
+
value: openProp,
|
|
34
|
+
defaultValue: defaultOpen,
|
|
35
|
+
onChange: onOpenChange
|
|
36
|
+
});
|
|
37
|
+
const previousOpenRef = useRef(open);
|
|
38
|
+
const setOpen = setOpenState;
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (previousOpenRef.current === open) return;
|
|
41
|
+
previousOpenRef.current = open;
|
|
42
|
+
if (open) onOpen?.();
|
|
43
|
+
else onClose?.();
|
|
44
|
+
}, [
|
|
45
|
+
onClose,
|
|
46
|
+
onOpen,
|
|
47
|
+
open
|
|
48
|
+
]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!open) return;
|
|
51
|
+
notifyPopoverOpened(id);
|
|
52
|
+
}, [id, open]);
|
|
53
|
+
useEffect(() => subscribeToPopoverLayer((openedId) => {
|
|
54
|
+
if (openedId !== id && open) setOpen(false);
|
|
55
|
+
}), [
|
|
56
|
+
id,
|
|
57
|
+
open,
|
|
58
|
+
setOpen
|
|
59
|
+
]);
|
|
60
|
+
const contextValue = {
|
|
61
|
+
id,
|
|
62
|
+
open,
|
|
63
|
+
setOpen,
|
|
64
|
+
triggerRef,
|
|
65
|
+
triggerRect,
|
|
66
|
+
setTriggerRect,
|
|
67
|
+
placement,
|
|
68
|
+
align,
|
|
69
|
+
offset,
|
|
70
|
+
alignOffset,
|
|
71
|
+
avoidCollisions,
|
|
72
|
+
collisionPadding,
|
|
73
|
+
width,
|
|
74
|
+
sameWidth,
|
|
75
|
+
hideArrow,
|
|
76
|
+
hideDismissButton,
|
|
77
|
+
dismissible,
|
|
78
|
+
closeAccessibilityLabel,
|
|
79
|
+
reduceMotion,
|
|
80
|
+
insets,
|
|
81
|
+
blurTarget
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ jsx(PopoverContext.Provider, {
|
|
84
|
+
value: contextValue,
|
|
85
|
+
children
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
Popover.displayName = "Popover";
|
|
89
|
+
//#endregion
|
|
90
|
+
export { Popover };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=Popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.js","names":[],"sources":["../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import { memo, useEffect, useId, useRef, useState } from 'react';\nimport type { View } from 'react-native';\n\nimport { useControllableState } from '../internal/Overlay';\nimport { PopoverContext } from './PopoverContext';\nimport { notifyPopoverOpened, subscribeToPopoverLayer } from './popoverLayer';\nimport type { PopoverContextValue, PopoverProps } from './types';\n\nconst DEFAULT_PLACEMENT = 'bottom';\nconst DEFAULT_OFFSET = 9;\nconst DEFAULT_COLLISION_PADDING = 12;\n\n/**\n * The root popover component for React Native.\n *\n * Manages open state, trigger measurement, and anchored positioning for a\n * floating surface. Use with {@link PopoverTrigger} and {@link PopoverContent}.\n *\n * @example\n * ```tsx\n * <Popover>\n * <PopoverTrigger render={<Button>Open popover</Button>} />\n * <PopoverContent>\n * <PopoverTitle>Storage almost full</PopoverTitle>\n * <PopoverDescription>Review large files or upgrade your plan.</PopoverDescription>\n * </PopoverContent>\n * </Popover>\n * ```\n */\nconst Popover = memo(function Popover({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpen,\n onClose,\n placement = DEFAULT_PLACEMENT,\n align,\n offset = DEFAULT_OFFSET,\n alignOffset = 0,\n avoidCollisions = true,\n collisionPadding = DEFAULT_COLLISION_PADDING,\n width = 'content',\n sameWidth = false,\n hideArrow = false,\n hideDismissButton = false,\n dismissible = true,\n closeAccessibilityLabel = 'Close popover',\n reduceMotion = false,\n insets,\n blurTarget,\n}: PopoverProps) {\n const id = useId();\n const triggerRef = useRef<View | null>(null);\n const [triggerRect, setTriggerRect] = useState<PopoverContextValue['triggerRect']>(null);\n const [open, setOpenState] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n const previousOpenRef = useRef(open);\n const setOpen = setOpenState;\n\n useEffect(() => {\n if (previousOpenRef.current === open) {\n return;\n }\n\n previousOpenRef.current = open;\n\n if (open) {\n onOpen?.();\n } else {\n onClose?.();\n }\n }, [onClose, onOpen, open]);\n\n useEffect(() => {\n if (!open) {\n return;\n }\n\n notifyPopoverOpened(id);\n }, [id, open]);\n\n useEffect(\n () =>\n subscribeToPopoverLayer((openedId) => {\n if (openedId !== id && open) {\n setOpen(false);\n }\n }),\n [id, open, setOpen],\n );\n\n const contextValue: PopoverContextValue = {\n id,\n open,\n setOpen,\n triggerRef,\n triggerRect,\n setTriggerRect,\n placement,\n align,\n offset,\n alignOffset,\n avoidCollisions,\n collisionPadding,\n width,\n sameWidth,\n hideArrow,\n hideDismissButton,\n dismissible,\n closeAccessibilityLabel,\n reduceMotion,\n insets,\n blurTarget,\n };\n\n return <PopoverContext.Provider value={contextValue}>{children}</PopoverContext.Provider>;\n});\n\nPopover.displayName = 'Popover';\n\nexport { Popover };\n"],"mappings":";;;;;;;AAQA,MAAM,oBAAoB;AAC1B,MAAM,iBAAiB;AACvB,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;AAmBlC,MAAM,UAAU,KAAK,SAAS,QAAQ,EACpC,UACA,MAAM,UACN,cAAc,OACd,cACA,QACA,SACA,YAAY,mBACZ,OACA,SAAS,gBACT,cAAc,GACd,kBAAkB,MAClB,mBAAmB,2BACnB,QAAQ,WACR,YAAY,OACZ,YAAY,OACZ,oBAAoB,OACpB,cAAc,MACd,0BAA0B,iBAC1B,eAAe,OACf,QACA,cACe;CACf,MAAM,KAAK,OAAO;CAClB,MAAM,aAAa,OAAoB,KAAK;CAC5C,MAAM,CAAC,aAAa,kBAAkB,SAA6C,KAAK;CACxF,MAAM,CAAC,MAAM,gBAAgB,qBAAqB;EAChD,OAAO;EACP,cAAc;EACd,UAAU;EACX,CAAC;CACF,MAAM,kBAAkB,OAAO,KAAK;CACpC,MAAM,UAAU;CAEhB,gBAAgB;EACd,IAAI,gBAAgB,YAAY,MAC9B;EAGF,gBAAgB,UAAU;EAE1B,IAAI,MACF,UAAU;OAEV,WAAW;IAEZ;EAAC;EAAS;EAAQ;EAAK,CAAC;CAE3B,gBAAgB;EACd,IAAI,CAAC,MACH;EAGF,oBAAoB,GAAG;IACtB,CAAC,IAAI,KAAK,CAAC;CAEd,gBAEI,yBAAyB,aAAa;EACpC,IAAI,aAAa,MAAM,MACrB,QAAQ,MAAM;GAEhB,EACJ;EAAC;EAAI;EAAM;EAAQ,CACpB;CAED,MAAM,eAAoC;EACxC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CAED,OAAO,oBAAC,eAAe,UAAhB;EAAyB,OAAO;EAAe;EAAmC,CAAA;EACzF;AAEF,QAAQ,cAAc"}
|
|
@@ -0,0 +1,124 @@
|
|
|
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_internal_Overlay_useAnchoredPosition = require("../internal/Overlay/useAnchoredPosition.cjs");
|
|
5
|
+
const require_components_Popover_PopoverContext = require("./PopoverContext.cjs");
|
|
6
|
+
const require_components_Popover_PopoverPortalLayer = require("./PopoverPortalLayer.cjs");
|
|
7
|
+
const require_components_Popover_PopoverSurface = require("./PopoverSurface.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let generated_styles = require("../../../generated/styles");
|
|
11
|
+
let react_native_reanimated = require("react-native-reanimated");
|
|
12
|
+
//#region src/components/Popover/PopoverContent.tsx
|
|
13
|
+
const ARROW_HEIGHT = 12;
|
|
14
|
+
const ARROW_WIDTH = 22;
|
|
15
|
+
const ANIMATION_DURATION = 200;
|
|
16
|
+
/**
|
|
17
|
+
* Floating content surface for {@link Popover}.
|
|
18
|
+
*
|
|
19
|
+
* Renders the anchored surface, arrow, optional dismiss button, blur/elevation
|
|
20
|
+
* background, and open/close transition in a full-window portal layer.
|
|
21
|
+
*/
|
|
22
|
+
const PopoverContent = (0, react.memo)(function PopoverContent({ children, maxWidth, maxHeight, style, onLayout, ...props }) {
|
|
23
|
+
const context = require_components_Popover_PopoverContext.usePopoverContext();
|
|
24
|
+
const { align, alignOffset, avoidCollisions, collisionPadding, dismissible, hideArrow, insets, offset, open, placement, reduceMotion, sameWidth, setOpen, triggerRect, width } = context;
|
|
25
|
+
const [contentSize, setContentSize] = (0, react.useState)({
|
|
26
|
+
width: 0,
|
|
27
|
+
height: 0
|
|
28
|
+
});
|
|
29
|
+
const [shouldRender, setShouldRender] = (0, react.useState)(open);
|
|
30
|
+
const dismiss = (0, react.useCallback)(() => setOpen(false), [setOpen]);
|
|
31
|
+
const { contentStyle, arrowStyle, anchorReady, resolvedPlacement, maxWidth: positionedMaxWidth } = require_components_internal_Overlay_useAnchoredPosition.useAnchoredPosition({
|
|
32
|
+
triggerRect,
|
|
33
|
+
contentSize,
|
|
34
|
+
placement,
|
|
35
|
+
align,
|
|
36
|
+
offset: offset + (hideArrow ? 0 : ARROW_HEIGHT),
|
|
37
|
+
alignOffset,
|
|
38
|
+
avoidCollisions,
|
|
39
|
+
collisionPadding,
|
|
40
|
+
width,
|
|
41
|
+
sameWidth,
|
|
42
|
+
insets,
|
|
43
|
+
arrowHeight: ARROW_HEIGHT,
|
|
44
|
+
arrowWidth: ARROW_WIDTH
|
|
45
|
+
});
|
|
46
|
+
const isPositionedOpen = open && anchorReady && contentSize.height > 0;
|
|
47
|
+
const animationDistance = Math.min(offset, 12);
|
|
48
|
+
const animationSide = resolvedPlacement.split("-")[0];
|
|
49
|
+
const shouldAnimateVertically = animationSide === "top" || animationSide === "bottom";
|
|
50
|
+
const animationTranslate = (animationSide === "top" || animationSide === "start" ? 1 : -1) * animationDistance;
|
|
51
|
+
const progress = (0, react_native_reanimated.useDerivedValue)(() => (0, react_native_reanimated.withTiming)(isPositionedOpen ? 1 : 0, {
|
|
52
|
+
duration: reduceMotion ? 0 : ANIMATION_DURATION,
|
|
53
|
+
easing: react_native_reanimated.Easing.out(react_native_reanimated.Easing.ease)
|
|
54
|
+
}), [isPositionedOpen, reduceMotion]);
|
|
55
|
+
const animatedStyle = (0, react_native_reanimated.useAnimatedStyle)(() => {
|
|
56
|
+
return {
|
|
57
|
+
opacity: progress.value,
|
|
58
|
+
transform: [{ scale: .97 + progress.value * .03 }, shouldAnimateVertically ? { translateY: animationTranslate * (1 - progress.value) } : { translateX: animationTranslate * (1 - progress.value) }]
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const handleLayout = (0, react.useCallback)((event) => {
|
|
62
|
+
const { width: layoutWidth, height: layoutHeight } = event.nativeEvent.layout;
|
|
63
|
+
setContentSize({
|
|
64
|
+
width: layoutWidth,
|
|
65
|
+
height: layoutHeight
|
|
66
|
+
});
|
|
67
|
+
onLayout?.(event);
|
|
68
|
+
}, [onLayout]);
|
|
69
|
+
(0, react.useEffect)(() => {
|
|
70
|
+
if (open) {
|
|
71
|
+
setShouldRender(true);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (reduceMotion) {
|
|
75
|
+
setShouldRender(false);
|
|
76
|
+
setContentSize({
|
|
77
|
+
width: 0,
|
|
78
|
+
height: 0
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const timeout = setTimeout(() => {
|
|
83
|
+
setShouldRender(false);
|
|
84
|
+
setContentSize({
|
|
85
|
+
width: 0,
|
|
86
|
+
height: 0
|
|
87
|
+
});
|
|
88
|
+
}, ANIMATION_DURATION);
|
|
89
|
+
return () => clearTimeout(timeout);
|
|
90
|
+
}, [open, reduceMotion]);
|
|
91
|
+
generated_styles.popoverStyles.useVariants({});
|
|
92
|
+
if (!shouldRender) return null;
|
|
93
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Popover_PopoverPortalLayer.PopoverPortalLayer, {
|
|
94
|
+
open,
|
|
95
|
+
dismissible,
|
|
96
|
+
onDismiss: dismiss,
|
|
97
|
+
children: (layerDismiss) => {
|
|
98
|
+
const surface = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Popover_PopoverSurface.PopoverSurface, {
|
|
99
|
+
animatedStyle,
|
|
100
|
+
arrowHeight: ARROW_HEIGHT,
|
|
101
|
+
arrowStyle,
|
|
102
|
+
arrowWidth: ARROW_WIDTH,
|
|
103
|
+
contentSize,
|
|
104
|
+
contentStyle,
|
|
105
|
+
maxHeight,
|
|
106
|
+
maxWidth,
|
|
107
|
+
onDismiss: layerDismiss,
|
|
108
|
+
onLayout: handleLayout,
|
|
109
|
+
positionedMaxWidth,
|
|
110
|
+
resolvedPlacement,
|
|
111
|
+
style,
|
|
112
|
+
...props,
|
|
113
|
+
children
|
|
114
|
+
});
|
|
115
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Popover_PopoverContext.PopoverContext.Provider, {
|
|
116
|
+
value: context,
|
|
117
|
+
children: surface
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
PopoverContent.displayName = "PopoverContent";
|
|
123
|
+
//#endregion
|
|
124
|
+
exports.PopoverContent = PopoverContent;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { PopoverContentProps } from "./types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Popover/PopoverContent.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Floating content surface for {@link Popover}.
|
|
8
|
+
*
|
|
9
|
+
* Renders the anchored surface, arrow, optional dismiss button, blur/elevation
|
|
10
|
+
* background, and open/close transition in a full-window portal layer.
|
|
11
|
+
*/
|
|
12
|
+
declare const PopoverContent: _$react.NamedExoticComponent<PopoverContentProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { PopoverContent };
|
|
15
|
+
//# sourceMappingURL=PopoverContent.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverContent.d.cts","names":[],"sources":["../../../src/components/Popover/PopoverContent.tsx"],"mappings":";;;;;;;;AASmD;;;cAY7C,cAAA,EAAc,OAAA,CAAA,oBAAA,CAAA,mBAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import { PopoverContentProps } from "./types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Popover/PopoverContent.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Floating content surface for {@link Popover}.
|
|
8
|
+
*
|
|
9
|
+
* Renders the anchored surface, arrow, optional dismiss button, blur/elevation
|
|
10
|
+
* background, and open/close transition in a full-window portal layer.
|
|
11
|
+
*/
|
|
12
|
+
declare const PopoverContent: _$react.NamedExoticComponent<PopoverContentProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { PopoverContent };
|
|
15
|
+
//# sourceMappingURL=PopoverContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverContent.d.ts","names":[],"sources":["../../../src/components/Popover/PopoverContent.tsx"],"mappings":";;;;;;;;AASmD;;;cAY7C,cAAA,EAAc,OAAA,CAAA,oBAAA,CAAA,mBAAA"}
|