@yahoo/uds-mobile 2.23.3 → 2.24.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -13
- package/dist/bin/automated-config/dist/generated/generatedConfigs.mjs +92 -46
- package/dist/components/Avatar/AvatarIcon.cjs +8 -2
- package/dist/components/Avatar/AvatarIcon.d.cts.map +1 -1
- package/dist/components/Avatar/AvatarIcon.d.ts.map +1 -1
- package/dist/components/Avatar/AvatarIcon.js +9 -3
- package/dist/components/Avatar/AvatarIcon.js.map +1 -1
- package/dist/components/Avatar/AvatarImage.cjs +9 -2
- package/dist/components/Avatar/AvatarImage.d.cts.map +1 -1
- package/dist/components/Avatar/AvatarImage.d.ts.map +1 -1
- package/dist/components/Avatar/AvatarImage.js +10 -3
- package/dist/components/Avatar/AvatarImage.js.map +1 -1
- package/dist/components/Avatar/AvatarText.cjs +8 -2
- package/dist/components/Avatar/AvatarText.d.cts.map +1 -1
- package/dist/components/Avatar/AvatarText.d.ts.map +1 -1
- package/dist/components/Avatar/AvatarText.js +9 -3
- package/dist/components/Avatar/AvatarText.js.map +1 -1
- package/dist/components/Avatar/types.d.cts +7 -3
- package/dist/components/Avatar/types.d.cts.map +1 -1
- package/dist/components/Avatar/types.d.ts +7 -3
- package/dist/components/Avatar/types.d.ts.map +1 -1
- package/dist/components/Avatar/useAvatarFontScale.cjs +16 -0
- package/dist/components/Avatar/useAvatarFontScale.d.cts +7 -0
- package/dist/components/Avatar/useAvatarFontScale.d.cts.map +1 -0
- package/dist/components/Avatar/useAvatarFontScale.d.ts +7 -0
- package/dist/components/Avatar/useAvatarFontScale.d.ts.map +1 -0
- package/dist/components/Avatar/useAvatarFontScale.js +16 -0
- package/dist/components/Avatar/useAvatarFontScale.js.map +1 -0
- package/dist/components/Avatar/utils.cjs +9 -6
- package/dist/components/Avatar/utils.d.cts +2 -2
- package/dist/components/Avatar/utils.d.cts.map +1 -1
- package/dist/components/Avatar/utils.d.ts +2 -2
- package/dist/components/Avatar/utils.d.ts.map +1 -1
- package/dist/components/Avatar/utils.js +9 -6
- package/dist/components/Avatar/utils.js.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/Button/buttonTheme.cjs +31 -9
- package/dist/components/Button/buttonTheme.d.cts +24 -5
- package/dist/components/Button/buttonTheme.d.cts.map +1 -1
- package/dist/components/Button/buttonTheme.d.ts +24 -5
- package/dist/components/Button/buttonTheme.d.ts.map +1 -1
- package/dist/components/Button/buttonTheme.js +31 -10
- package/dist/components/Button/buttonTheme.js.map +1 -1
- package/dist/components/Button.cjs +35 -8
- package/dist/components/Button.d.cts +7 -0
- package/dist/components/Button.d.cts.map +1 -1
- package/dist/components/Button.d.ts +7 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +35 -8
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Checkbox.cjs +42 -9
- package/dist/components/Checkbox.d.cts +7 -0
- package/dist/components/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox.d.ts +7 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +42 -9
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Chip/ChipBase.cjs +31 -14
- package/dist/components/Chip/ChipBase.d.cts.map +1 -1
- package/dist/components/Chip/ChipBase.d.ts.map +1 -1
- package/dist/components/Chip/ChipBase.js +31 -14
- package/dist/components/Chip/ChipBase.js.map +1 -1
- package/dist/components/Chip/ChipDismissible.cjs +3 -1
- package/dist/components/Chip/ChipDismissible.js +3 -1
- package/dist/components/Chip/ChipDismissible.js.map +1 -1
- package/dist/components/Chip/types.d.cts +7 -0
- package/dist/components/Chip/types.d.cts.map +1 -1
- package/dist/components/Chip/types.d.ts +7 -0
- package/dist/components/Chip/types.d.ts.map +1 -1
- package/dist/components/Icon.cjs +24 -5
- package/dist/components/Icon.d.cts +11 -2
- package/dist/components/Icon.d.cts.map +1 -1
- package/dist/components/Icon.d.ts +11 -2
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js +24 -5
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/IconButton.cjs +17 -6
- package/dist/components/IconButton.d.cts +6 -0
- package/dist/components/IconButton.d.cts.map +1 -1
- package/dist/components/IconButton.d.ts +6 -0
- package/dist/components/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton.js +18 -7
- package/dist/components/IconButton.js.map +1 -1
- package/dist/components/Input.cjs +56 -18
- package/dist/components/Input.d.cts +5 -0
- package/dist/components/Input.d.cts.map +1 -1
- package/dist/components/Input.d.ts +5 -0
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +56 -18
- package/dist/components/Input.js.map +1 -1
- package/dist/components/InputHelpText.cjs +7 -1
- package/dist/components/InputHelpText.d.cts +2 -0
- package/dist/components/InputHelpText.d.cts.map +1 -1
- package/dist/components/InputHelpText.d.ts +2 -0
- package/dist/components/InputHelpText.d.ts.map +1 -1
- package/dist/components/InputHelpText.js +7 -1
- package/dist/components/InputHelpText.js.map +1 -1
- package/dist/components/Link.cjs +13 -1
- package/dist/components/Link.d.cts +7 -0
- package/dist/components/Link.d.cts.map +1 -1
- package/dist/components/Link.d.ts +7 -0
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +13 -1
- package/dist/components/Link.js.map +1 -1
- package/dist/components/Pagination/Pagination.cjs +18 -10
- package/dist/components/Pagination/Pagination.d.cts +2 -0
- package/dist/components/Pagination/Pagination.d.cts.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +18 -10
- package/dist/components/Pagination/Pagination.js.map +1 -1
- package/dist/components/Pagination/PaginationEllipsis.cjs +8 -2
- package/dist/components/Pagination/PaginationEllipsis.d.cts.map +1 -1
- package/dist/components/Pagination/PaginationEllipsis.d.ts.map +1 -1
- package/dist/components/Pagination/PaginationEllipsis.js +9 -3
- package/dist/components/Pagination/PaginationEllipsis.js.map +1 -1
- package/dist/components/Pagination/PaginationItem.cjs +2 -1
- package/dist/components/Pagination/PaginationItem.js +2 -1
- package/dist/components/Pagination/PaginationItem.js.map +1 -1
- package/dist/components/Pagination/PaginationLink.cjs +2 -1
- package/dist/components/Pagination/PaginationLink.js +2 -1
- package/dist/components/Pagination/PaginationLink.js.map +1 -1
- package/dist/components/Pagination/PaginationNext.cjs +3 -1
- package/dist/components/Pagination/PaginationNext.js +3 -1
- package/dist/components/Pagination/PaginationNext.js.map +1 -1
- package/dist/components/Pagination/PaginationPrev.cjs +3 -1
- package/dist/components/Pagination/PaginationPrev.js +3 -1
- package/dist/components/Pagination/PaginationPrev.js.map +1 -1
- package/dist/components/Pagination/paginationContext.d.cts +2 -0
- package/dist/components/Pagination/paginationContext.d.cts.map +1 -1
- package/dist/components/Pagination/paginationContext.d.ts +2 -0
- package/dist/components/Pagination/paginationContext.d.ts.map +1 -1
- package/dist/components/Pagination/paginationContext.js.map +1 -1
- package/dist/components/Pagination/usePaginationControlStyles.cjs +8 -1
- package/dist/components/Pagination/usePaginationControlStyles.d.cts.map +1 -1
- package/dist/components/Pagination/usePaginationControlStyles.d.ts.map +1 -1
- package/dist/components/Pagination/usePaginationControlStyles.js +9 -2
- package/dist/components/Pagination/usePaginationControlStyles.js.map +1 -1
- package/dist/components/Radio/Radio.cjs +30 -11
- package/dist/components/Radio/Radio.d.cts +7 -0
- package/dist/components/Radio/Radio.d.cts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +7 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +30 -11
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Select/Select.cjs +29 -6
- package/dist/components/Select/Select.d.cts +2 -0
- package/dist/components/Select/Select.d.cts.map +1 -1
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +29 -6
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectContent.cjs +31 -23
- package/dist/components/Select/SelectContent.d.cts.map +1 -1
- package/dist/components/Select/SelectContent.d.ts.map +1 -1
- package/dist/components/Select/SelectContent.js +32 -24
- package/dist/components/Select/SelectContent.js.map +1 -1
- package/dist/components/Select/SelectItem.cjs +25 -15
- package/dist/components/Select/SelectItem.d.cts.map +1 -1
- package/dist/components/Select/SelectItem.d.ts.map +1 -1
- package/dist/components/Select/SelectItem.js +25 -15
- package/dist/components/Select/SelectItem.js.map +1 -1
- package/dist/components/Select/SelectTrigger.cjs +27 -13
- package/dist/components/Select/SelectTrigger.d.cts.map +1 -1
- package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
- package/dist/components/Select/SelectTrigger.js +27 -13
- package/dist/components/Select/SelectTrigger.js.map +1 -1
- package/dist/components/Select/types.d.cts +2 -0
- package/dist/components/Select/types.d.cts.map +1 -1
- package/dist/components/Select/types.d.ts +2 -0
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Switch.cjs +48 -8
- package/dist/components/Switch.d.cts +7 -0
- package/dist/components/Switch.d.cts.map +1 -1
- package/dist/components/Switch.d.ts +7 -0
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +48 -8
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Tabs/Tab.cjs +17 -3
- package/dist/components/Tabs/Tab.d.cts.map +1 -1
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +17 -3
- package/dist/components/Tabs/Tab.js.map +1 -1
- package/dist/components/Tabs/Tabs.cjs +8 -3
- package/dist/components/Tabs/Tabs.d.cts +9 -1
- package/dist/components/Tabs/Tabs.d.cts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +9 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +8 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/tabsContexts.d.cts +2 -0
- package/dist/components/Tabs/tabsContexts.d.cts.map +1 -1
- package/dist/components/Tabs/tabsContexts.d.ts +2 -0
- package/dist/components/Tabs/tabsContexts.d.ts.map +1 -1
- package/dist/components/Tabs/tabsContexts.js.map +1 -1
- package/dist/components/Text.cjs +9 -1
- package/dist/components/Text.d.cts +11 -2
- package/dist/components/Text.d.cts.map +1 -1
- package/dist/components/Text.d.ts +11 -2
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/Text.js +9 -1
- package/dist/components/Text.js.map +1 -1
- package/dist/components/UDSProvider.cjs +6 -2
- package/dist/components/UDSProvider.d.cts +9 -0
- package/dist/components/UDSProvider.d.cts.map +1 -1
- package/dist/components/UDSProvider.d.ts +9 -0
- package/dist/components/UDSProvider.d.ts.map +1 -1
- package/dist/components/UDSProvider.js +6 -2
- package/dist/components/UDSProvider.js.map +1 -1
- package/dist/components/internal/Overlay/index.cjs +1 -1
- package/dist/components/internal/Overlay/index.js +1 -1
- package/dist/fontScaling/FontScalingContext.cjs +67 -0
- package/dist/fontScaling/FontScalingContext.d.cts +53 -0
- package/dist/fontScaling/FontScalingContext.d.cts.map +1 -0
- package/dist/fontScaling/FontScalingContext.d.ts +53 -0
- package/dist/fontScaling/FontScalingContext.d.ts.map +1 -0
- package/dist/fontScaling/FontScalingContext.js +63 -0
- package/dist/fontScaling/FontScalingContext.js.map +1 -0
- package/dist/fontScaling/androidNonlinearFontScaling.cjs +250 -0
- package/dist/fontScaling/androidNonlinearFontScaling.d.cts +7 -0
- package/dist/fontScaling/androidNonlinearFontScaling.d.cts.map +1 -0
- package/dist/fontScaling/androidNonlinearFontScaling.d.ts +7 -0
- package/dist/fontScaling/androidNonlinearFontScaling.d.ts.map +1 -0
- package/dist/fontScaling/androidNonlinearFontScaling.js +251 -0
- package/dist/fontScaling/androidNonlinearFontScaling.js.map +1 -0
- package/dist/fontScaling/constants.cjs +106 -0
- package/dist/fontScaling/constants.d.cts +60 -0
- package/dist/fontScaling/constants.d.cts.map +1 -0
- package/dist/fontScaling/constants.d.ts +60 -0
- package/dist/fontScaling/constants.d.ts.map +1 -0
- package/dist/fontScaling/constants.js +103 -0
- package/dist/fontScaling/constants.js.map +1 -0
- package/dist/fontScaling/index.cjs +14 -0
- package/dist/fontScaling/index.d.cts +8 -0
- package/dist/fontScaling/index.d.ts +8 -0
- package/dist/fontScaling/index.js +6 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.cjs +37 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts +35 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts.map +1 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts +35 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts.map +1 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.js +38 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.js.map +1 -0
- package/dist/fontScaling/types.cjs +1 -0
- package/dist/fontScaling/types.d.cts +54 -0
- package/dist/fontScaling/types.d.cts.map +1 -0
- package/dist/fontScaling/types.d.ts +54 -0
- package/dist/fontScaling/types.d.ts.map +1 -0
- package/dist/fontScaling/types.js +1 -0
- package/dist/fontScaling/useFontScale.cjs +58 -0
- package/dist/fontScaling/useFontScale.d.cts +12 -0
- package/dist/fontScaling/useFontScale.d.cts.map +1 -0
- package/dist/fontScaling/useFontScale.d.ts +12 -0
- package/dist/fontScaling/useFontScale.d.ts.map +1 -0
- package/dist/fontScaling/useFontScale.js +57 -0
- package/dist/fontScaling/useFontScale.js.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.cjs +24 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.cts +16 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.cts.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.ts +16 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.ts.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.js +24 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.js.map +1 -0
- package/dist/jest/mocks/react-native.cjs +19 -4
- package/dist/jest/mocks/react-native.d.cts +8 -5
- package/dist/jest/mocks/react-native.d.cts.map +1 -1
- package/dist/jest/mocks/react-native.d.ts +8 -5
- package/dist/jest/mocks/react-native.d.ts.map +1 -1
- package/dist/jest/mocks/react-native.js +18 -5
- package/dist/jest/mocks/react-native.js.map +1 -1
- package/dist/jest/mocks/styles.cjs +28 -1
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +28 -1
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/jest/setup.cjs +4 -0
- package/dist/jest/setup.d.cts.map +1 -1
- package/dist/jest/setup.d.ts.map +1 -1
- package/dist/jest/setup.js +4 -0
- package/dist/jest/setup.js.map +1 -1
- package/dist/mobile/generated/fontMetrics.cjs +530 -530
- package/dist/mobile/generated/fontMetrics.js +530 -530
- package/dist/mobile/generated/fontMetrics.js.map +1 -1
- package/dist/portal.cjs +8 -2
- package/dist/portal.d.cts.map +1 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.js +8 -2
- package/dist/portal.js.map +1 -1
- package/dist/types/dist/index.d.cts.map +1 -1
- package/dist/types/dist/index.d.ts.map +1 -1
- package/fonts/index.cjs +214 -214
- package/fonts/index.mjs +214 -214
- package/fonts/uds-icons.ttf +0 -0
- package/generated/fontMetrics.ts +530 -530
- package/generated/styles.d.ts +5 -28
- package/generated/unistyles.d.ts +0 -27
- package/package.json +11 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
import { HStack } from "./HStack.js";
|
|
3
|
+
import { useMaxFontSizeMultiplier } from "../fontScaling/useMaxFontSizeMultiplier.js";
|
|
3
4
|
import { IconSlot } from "./IconSlot.js";
|
|
4
5
|
import { Text } from "./Text.js";
|
|
5
6
|
import { memo, useMemo } from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { inputStyles } from "../../generated/styles";
|
|
8
9
|
//#region src/components/InputHelpText.tsx
|
|
9
|
-
const InputHelpText = memo(function InputHelpText({ children, startIcon, endIcon, iconProps, size = "md", isFilled = false, disabled: _disabled, readOnly, hasError, pressed, ref, ...hStackProps }) {
|
|
10
|
+
const InputHelpText = memo(function InputHelpText({ children, startIcon, endIcon, iconProps, size = "md", isFilled = false, disabled: _disabled, readOnly, hasError, pressed, maxFontSizeMultiplier, ref, ...hStackProps }) {
|
|
10
11
|
const { style: iconStyle, variant = "outline", ...resolvedIconProps } = iconProps ?? {};
|
|
11
12
|
const value = isFilled ? "filled" : "empty";
|
|
13
|
+
const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
|
|
12
14
|
inputStyles.useVariants({
|
|
13
15
|
size,
|
|
14
16
|
value,
|
|
@@ -28,16 +30,20 @@ const InputHelpText = memo(function InputHelpText({ children, startIcon, endIcon
|
|
|
28
30
|
startIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
29
31
|
icon: startIcon,
|
|
30
32
|
variant,
|
|
33
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
31
34
|
style: resolvedIconStyle,
|
|
32
35
|
...resolvedIconProps
|
|
33
36
|
}),
|
|
34
37
|
/* @__PURE__ */ jsx(Text, {
|
|
38
|
+
variant: "inherit",
|
|
39
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
35
40
|
style: inputStyles.helperText,
|
|
36
41
|
children
|
|
37
42
|
}),
|
|
38
43
|
endIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
39
44
|
icon: endIcon,
|
|
40
45
|
variant,
|
|
46
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
41
47
|
style: resolvedIconStyle,
|
|
42
48
|
...resolvedIconProps
|
|
43
49
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputHelpText.js","names":[],"sources":["../../src/components/InputHelpText.tsx"],"sourcesContent":["import type { InputSize } from '@yahoo/uds-types';\nimport type { ReactNode, Ref } from 'react';\nimport { memo, useMemo } from 'react';\nimport type { View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport type { HStackProps } from './HStack';\nimport { HStack } from './HStack';\nimport type { IconSlotProps, IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport type { TextProps } from './Text';\nimport { Text } from './Text';\n\ninterface InputHelpTextProps extends Omit<HStackProps, 'children' | 'ref'> {\n /** Ref to the underlying root View. */\n ref?: Ref<View>;\n /** Helper text content. */\n children?: ReactNode;\n /** Icon to render before the help text. */\n startIcon?: IconSlotType;\n /** Icon to render after the help text. */\n endIcon?: IconSlotType;\n /** Props to apply to both helper icons. */\n iconProps?: Omit<IconSlotProps, 'icon' | 'ref'>;\n /** Input size used to resolve configured helper text styles. */\n size?: InputSize;\n /** Whether the associated input has a value. */\n isFilled?: boolean;\n /** Whether the associated input is disabled. */\n disabled?: boolean;\n /** Whether the associated input is read-only. */\n readOnly?: boolean;\n /** Whether the associated input has a validation error. */\n hasError?: boolean;\n /** Whether the associated input is focused or pressed. */\n pressed?: boolean;\n}\n\nconst InputHelpText = memo(function InputHelpText({\n children,\n startIcon,\n endIcon,\n iconProps,\n size = 'md',\n isFilled = false,\n disabled: _disabled,\n readOnly,\n hasError,\n pressed,\n ref,\n ...hStackProps\n}: InputHelpTextProps) {\n const { style: iconStyle, variant = 'outline', ...resolvedIconProps } = iconProps ?? {};\n const value = isFilled ? 'filled' : 'empty';\n\n inputStyles.useVariants({\n size,\n value,\n pressed,\n readonly: readOnly,\n invalid: hasError,\n });\n\n const resolvedIconStyle = useMemo(\n () => [inputStyles.helperIcon, iconStyle],\n [iconStyle, inputStyles.helperIcon],\n );\n\n if (children === null || children === undefined || children === false) {\n return null;\n }\n\n return (\n <HStack ref={ref} columnGap=\"1\" alignItems=\"center\" spacingTop=\"2\" {...hStackProps}>\n {startIcon && (\n <IconSlot\n icon={startIcon}\n variant={variant}\n style={resolvedIconStyle}\n {...resolvedIconProps}\n />\n )}\n\n <Text
|
|
1
|
+
{"version":3,"file":"InputHelpText.js","names":[],"sources":["../../src/components/InputHelpText.tsx"],"sourcesContent":["import type { InputSize } from '@yahoo/uds-types';\nimport type { ReactNode, Ref } from 'react';\nimport { memo, useMemo } from 'react';\nimport type { View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport { useMaxFontSizeMultiplier } from '../fontScaling/useMaxFontSizeMultiplier';\nimport type { HStackProps } from './HStack';\nimport { HStack } from './HStack';\nimport type { IconSlotProps, IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport type { TextProps } from './Text';\nimport { Text } from './Text';\n\ninterface InputHelpTextProps extends Omit<HStackProps, 'children' | 'ref'> {\n /** Ref to the underlying root View. */\n ref?: Ref<View>;\n /** Helper text content. */\n children?: ReactNode;\n /** Icon to render before the help text. */\n startIcon?: IconSlotType;\n /** Icon to render after the help text. */\n endIcon?: IconSlotType;\n /** Props to apply to both helper icons. */\n iconProps?: Omit<IconSlotProps, 'icon' | 'ref'>;\n /** Input size used to resolve configured helper text styles. */\n size?: InputSize;\n /** Whether the associated input has a value. */\n isFilled?: boolean;\n /** Whether the associated input is disabled. */\n disabled?: boolean;\n /** Whether the associated input is read-only. */\n readOnly?: boolean;\n /** Whether the associated input has a validation error. */\n hasError?: boolean;\n /** Whether the associated input is focused or pressed. */\n pressed?: boolean;\n /** Caps helper text and icons at the control scale. Set null to remove the cap. @default 2 */\n maxFontSizeMultiplier?: number | null;\n}\n\nconst InputHelpText = memo(function InputHelpText({\n children,\n startIcon,\n endIcon,\n iconProps,\n size = 'md',\n isFilled = false,\n disabled: _disabled,\n readOnly,\n hasError,\n pressed,\n maxFontSizeMultiplier,\n ref,\n ...hStackProps\n}: InputHelpTextProps) {\n const { style: iconStyle, variant = 'outline', ...resolvedIconProps } = iconProps ?? {};\n const value = isFilled ? 'filled' : 'empty';\n const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier('control', maxFontSizeMultiplier);\n\n inputStyles.useVariants({\n size,\n value,\n pressed,\n readonly: readOnly,\n invalid: hasError,\n });\n\n const resolvedIconStyle = useMemo(\n () => [inputStyles.helperIcon, iconStyle],\n [iconStyle, inputStyles.helperIcon],\n );\n\n if (children === null || children === undefined || children === false) {\n return null;\n }\n\n return (\n <HStack ref={ref} columnGap=\"1\" alignItems=\"center\" spacingTop=\"2\" {...hStackProps}>\n {startIcon && (\n <IconSlot\n icon={startIcon}\n variant={variant}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={resolvedIconStyle}\n {...resolvedIconProps}\n />\n )}\n\n <Text\n variant=\"inherit\"\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={inputStyles.helperText as TextProps['style']}\n >\n {children}\n </Text>\n\n {endIcon && (\n <IconSlot\n icon={endIcon}\n variant={variant}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={resolvedIconStyle}\n {...resolvedIconProps}\n />\n )}\n </HStack>\n );\n});\n\nInputHelpText.displayName = 'InputHelpText';\n\nexport { InputHelpText, type InputHelpTextProps };\n"],"mappings":";;;;;;;;;AAyCA,MAAM,gBAAgB,KAAK,SAAS,cAAc,EAChD,UACA,WACA,SACA,WACA,OAAO,MACP,WAAW,OACX,UAAU,WACV,UACA,UACA,SACA,uBACA,KACA,GAAG,eACkB;CACrB,MAAM,EAAE,OAAO,WAAW,UAAU,WAAW,GAAG,sBAAsB,aAAa,EAAE;CACvF,MAAM,QAAQ,WAAW,WAAW;CACpC,MAAM,gCAAgC,yBAAyB,WAAW,sBAAsB;CAEhG,YAAY,YAAY;EACtB;EACA;EACA;EACA,UAAU;EACV,SAAS;EACV,CAAC;CAEF,MAAM,oBAAoB,cAClB,CAAC,YAAY,YAAY,UAAU,EACzC,CAAC,WAAW,YAAY,WAAW,CACpC;CAED,IAAI,aAAa,QAAQ,aAAa,KAAA,KAAa,aAAa,OAC9D,OAAO;CAGT,OACE,qBAAC,QAAD;EAAa;EAAK,WAAU;EAAI,YAAW;EAAS,YAAW;EAAI,GAAI;YAAvE;GACG,aACC,oBAAC,UAAD;IACE,MAAM;IACG;IACT,uBAAuB;IACvB,OAAO;IACP,GAAI;IACJ,CAAA;GAGJ,oBAAC,MAAD;IACE,SAAQ;IACR,uBAAuB;IACvB,OAAO,YAAY;IAElB;IACI,CAAA;GAEN,WACC,oBAAC,UAAD;IACE,MAAM;IACG;IACT,uBAAuB;IACvB,OAAO;IACP,GAAI;IACJ,CAAA;GAEG;;EAEX;AAEF,cAAc,cAAc"}
|
package/dist/components/Link.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_fontScaling_FontScalingContext = require("../fontScaling/FontScalingContext.cjs");
|
|
5
|
+
const require_fontScaling_constants = require("../fontScaling/constants.cjs");
|
|
6
|
+
const require_fontScaling_useMaxFontSizeMultiplier = require("../fontScaling/useMaxFontSizeMultiplier.cjs");
|
|
4
7
|
const require_components_IconSlot = require("./IconSlot.cjs");
|
|
5
8
|
let react = require("react");
|
|
6
9
|
let react_native = require("react-native");
|
|
@@ -40,6 +43,7 @@ const noUnderline = { textDecorationLine: "none" };
|
|
|
40
43
|
* @usage
|
|
41
44
|
* - Use for navigation actions
|
|
42
45
|
* - Can be nested within Text for inline links
|
|
46
|
+
* - Inline icons stay at their designed size while link text scales
|
|
43
47
|
* - Use alwaysUnderline for links that need to be visually distinct
|
|
44
48
|
*
|
|
45
49
|
* @accessibility
|
|
@@ -50,8 +54,12 @@ const noUnderline = { textDecorationLine: "none" };
|
|
|
50
54
|
* @see {@link Button} for primary actions
|
|
51
55
|
* @see {@link Text} for non-interactive text
|
|
52
56
|
*/
|
|
53
|
-
const Link = (0, react.memo)(function Link({ children, variant = "primary", textVariant, alwaysUnderline = false, startIcon, endIcon, onPress, style, ref, ...rest }) {
|
|
57
|
+
const Link = (0, react.memo)(function Link({ children, variant = "primary", textVariant, alwaysUnderline = false, startIcon, endIcon, maxFontSizeMultiplier, onPress, style, ref, ...rest }) {
|
|
54
58
|
const [pressed, setPressed] = (0, react.useState)(false);
|
|
59
|
+
const dynamicTypeRampEnabled = require_fontScaling_FontScalingContext.useDynamicTypeRampEnabled();
|
|
60
|
+
const resolvedTextVariant = textVariant;
|
|
61
|
+
const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier(resolvedTextVariant, maxFontSizeMultiplier);
|
|
62
|
+
const dynamicTypeRamp = dynamicTypeRampEnabled && resolvedTextVariant ? require_fontScaling_constants.DEFAULT_DYNAMIC_TYPE_RAMPS[resolvedTextVariant] : void 0;
|
|
55
63
|
const handlePressIn = (0, react.useCallback)(() => {
|
|
56
64
|
setPressed(true);
|
|
57
65
|
}, []);
|
|
@@ -125,12 +133,15 @@ const Link = (0, react.memo)(function Link({ children, variant = "primary", text
|
|
|
125
133
|
onPressIn: handlePressIn,
|
|
126
134
|
onPressOut: handlePressOut,
|
|
127
135
|
suppressHighlighting: true,
|
|
136
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
137
|
+
dynamicTypeRamp,
|
|
128
138
|
style: textStyles,
|
|
129
139
|
...rest,
|
|
130
140
|
children: [
|
|
131
141
|
startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
132
142
|
icon: startIcon,
|
|
133
143
|
variant: "outline",
|
|
144
|
+
allowFontScaling: false,
|
|
134
145
|
style: startIconStyles
|
|
135
146
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
136
147
|
style: noUnderline,
|
|
@@ -143,6 +154,7 @@ const Link = (0, react.memo)(function Link({ children, variant = "primary", text
|
|
|
143
154
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
144
155
|
icon: endIcon,
|
|
145
156
|
variant: "outline",
|
|
157
|
+
allowFontScaling: false,
|
|
146
158
|
style: endIconStyles
|
|
147
159
|
})] })
|
|
148
160
|
]
|
|
@@ -16,6 +16,12 @@ interface LinkProps extends UniversalLinkProps<IconSlotType> {
|
|
|
16
16
|
ref?: Ref<Text>;
|
|
17
17
|
/** Link content, typically text */
|
|
18
18
|
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Caps how far the link text grows with the OS text-size setting. Inline
|
|
21
|
+
* icons keep their designed size. Set null to remove the text cap; override
|
|
22
|
+
* app-wide via UDSFontScalingProvider.
|
|
23
|
+
*/
|
|
24
|
+
maxFontSizeMultiplier?: number | null;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* **🔗 A navigation link component**
|
|
@@ -45,6 +51,7 @@ interface LinkProps extends UniversalLinkProps<IconSlotType> {
|
|
|
45
51
|
* @usage
|
|
46
52
|
* - Use for navigation actions
|
|
47
53
|
* - Can be nested within Text for inline links
|
|
54
|
+
* - Inline icons stay at their designed size while link text scales
|
|
48
55
|
* - Use alwaysUnderline for links that need to be visually distinct
|
|
49
56
|
*
|
|
50
57
|
* @accessibility
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.cts","names":[],"sources":["../../src/components/Link.tsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Link.d.cts","names":[],"sources":["../../src/components/Link.tsx"],"mappings":";;;;;;;;;UA2BU,SAAA,SAAkB,kBAAA,CAAmB,YAAA;;EAE7C,KAAA,GAAQ,SAAA;EAFU;EAIlB,OAAA,GAAU,WAAA;EAJmC;EAM7C,GAAA,GAAM,GAAA,CAAI,IAAA;EAFA;EAIV,QAAA,GAAW,SAAA;EAFL;;;;;EAQN,qBAAA;AAAA;;;;;;;;;;;;;AAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0CjB,IAAA,EAAI,OAAA,CAAA,oBAAA,CAAA,SAAA"}
|
|
@@ -16,6 +16,12 @@ interface LinkProps extends UniversalLinkProps<IconSlotType> {
|
|
|
16
16
|
ref?: Ref<Text>;
|
|
17
17
|
/** Link content, typically text */
|
|
18
18
|
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Caps how far the link text grows with the OS text-size setting. Inline
|
|
21
|
+
* icons keep their designed size. Set null to remove the text cap; override
|
|
22
|
+
* app-wide via UDSFontScalingProvider.
|
|
23
|
+
*/
|
|
24
|
+
maxFontSizeMultiplier?: number | null;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* **🔗 A navigation link component**
|
|
@@ -45,6 +51,7 @@ interface LinkProps extends UniversalLinkProps<IconSlotType> {
|
|
|
45
51
|
* @usage
|
|
46
52
|
* - Use for navigation actions
|
|
47
53
|
* - Can be nested within Text for inline links
|
|
54
|
+
* - Inline icons stay at their designed size while link text scales
|
|
48
55
|
* - Use alwaysUnderline for links that need to be visually distinct
|
|
49
56
|
*
|
|
50
57
|
* @accessibility
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","names":[],"sources":["../../src/components/Link.tsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Link.d.ts","names":[],"sources":["../../src/components/Link.tsx"],"mappings":";;;;;;;;;UA2BU,SAAA,SAAkB,kBAAA,CAAmB,YAAA;;EAE7C,KAAA,GAAQ,SAAA;EAFU;EAIlB,OAAA,GAAU,WAAA;EAJmC;EAM7C,GAAA,GAAM,GAAA,CAAI,IAAA;EAFA;EAIV,QAAA,GAAW,SAAA;EAFL;;;;;EAQN,qBAAA;AAAA;;;;;;;;;;;;;AAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0CjB,IAAA,EAAI,OAAA,CAAA,oBAAA,CAAA,SAAA"}
|
package/dist/components/Link.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useDynamicTypeRampEnabled } from "../fontScaling/FontScalingContext.js";
|
|
3
|
+
import { DEFAULT_DYNAMIC_TYPE_RAMPS } from "../fontScaling/constants.js";
|
|
4
|
+
import { useMaxFontSizeMultiplier } from "../fontScaling/useMaxFontSizeMultiplier.js";
|
|
2
5
|
import { IconSlot } from "./IconSlot.js";
|
|
3
6
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
4
7
|
import { Text } from "react-native";
|
|
@@ -37,6 +40,7 @@ const noUnderline = { textDecorationLine: "none" };
|
|
|
37
40
|
* @usage
|
|
38
41
|
* - Use for navigation actions
|
|
39
42
|
* - Can be nested within Text for inline links
|
|
43
|
+
* - Inline icons stay at their designed size while link text scales
|
|
40
44
|
* - Use alwaysUnderline for links that need to be visually distinct
|
|
41
45
|
*
|
|
42
46
|
* @accessibility
|
|
@@ -47,8 +51,12 @@ const noUnderline = { textDecorationLine: "none" };
|
|
|
47
51
|
* @see {@link Button} for primary actions
|
|
48
52
|
* @see {@link Text} for non-interactive text
|
|
49
53
|
*/
|
|
50
|
-
const Link = memo(function Link({ children, variant = "primary", textVariant, alwaysUnderline = false, startIcon, endIcon, onPress, style, ref, ...rest }) {
|
|
54
|
+
const Link = memo(function Link({ children, variant = "primary", textVariant, alwaysUnderline = false, startIcon, endIcon, maxFontSizeMultiplier, onPress, style, ref, ...rest }) {
|
|
51
55
|
const [pressed, setPressed] = useState(false);
|
|
56
|
+
const dynamicTypeRampEnabled = useDynamicTypeRampEnabled();
|
|
57
|
+
const resolvedTextVariant = textVariant;
|
|
58
|
+
const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier(resolvedTextVariant, maxFontSizeMultiplier);
|
|
59
|
+
const dynamicTypeRamp = dynamicTypeRampEnabled && resolvedTextVariant ? DEFAULT_DYNAMIC_TYPE_RAMPS[resolvedTextVariant] : void 0;
|
|
52
60
|
const handlePressIn = useCallback(() => {
|
|
53
61
|
setPressed(true);
|
|
54
62
|
}, []);
|
|
@@ -122,12 +130,15 @@ const Link = memo(function Link({ children, variant = "primary", textVariant, al
|
|
|
122
130
|
onPressIn: handlePressIn,
|
|
123
131
|
onPressOut: handlePressOut,
|
|
124
132
|
suppressHighlighting: true,
|
|
133
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
134
|
+
dynamicTypeRamp,
|
|
125
135
|
style: textStyles,
|
|
126
136
|
...rest,
|
|
127
137
|
children: [
|
|
128
138
|
startIcon && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconSlot, {
|
|
129
139
|
icon: startIcon,
|
|
130
140
|
variant: "outline",
|
|
141
|
+
allowFontScaling: false,
|
|
131
142
|
style: startIconStyles
|
|
132
143
|
}), /* @__PURE__ */ jsx(Text, {
|
|
133
144
|
style: noUnderline,
|
|
@@ -140,6 +151,7 @@ const Link = memo(function Link({ children, variant = "primary", textVariant, al
|
|
|
140
151
|
}), /* @__PURE__ */ jsx(IconSlot, {
|
|
141
152
|
icon: endIcon,
|
|
142
153
|
variant: "outline",
|
|
154
|
+
allowFontScaling: false,
|
|
143
155
|
style: endIconStyles
|
|
144
156
|
})] })
|
|
145
157
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","names":["RNText"],"sources":["../../src/components/Link.tsx"],"sourcesContent":["import type { UniversalLinkProps } from '@yahoo/uds-types';\nimport type { ReactNode, Ref } from 'react';\nimport { memo, useCallback, useMemo, useState } from 'react';\nimport type { GestureResponderEvent, TextStyle } from 'react-native';\nimport { Text as RNText } from 'react-native';\nimport Animated, {\n Easing,\n interpolateColor,\n useAnimatedStyle,\n useDerivedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useAnimatedTheme } from 'react-native-unistyles/reanimated';\n\nimport { linkStyles } from '../../generated/styles';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport type { TextProps } from './Text';\n\nconst AnimatedText = Animated.Text;\n\n// Prevent icons from inheriting underline from parent/theme (matches web behavior)\nconst noUnderline: TextStyle = { textDecorationLine: 'none' };\n\ninterface LinkProps extends UniversalLinkProps<IconSlotType> {\n /** Style override for the link text */\n style?: TextStyle;\n /** Callback fired when the link is pressed */\n onPress?: TextProps['onPress'];\n /** Ref to the underlying Text element */\n ref?: Ref<RNText>;\n /** Link content, typically text */\n children?: ReactNode;\n}\n\n/**\n * **🔗 A navigation link component**\n *\n * @description\n * A styled link component for navigation. Rendered as Text so it can be\n * nested inline within other Text. Supports optional start/end icons.\n *\n * @category Interactive\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Link } from '@yahoo/uds-mobile/Link';\n *\n * // Standalone link\n * <Link onPress={() => navigate('/profile')}>Go to Profile</Link>\n *\n * // Inline within text\n * <Text>Read our <Link>Terms of Service</Link> and <Link>Privacy Policy</Link>.</Text>\n *\n * // With icons\n * <Link startIcon=\"AffiliateLink\">External link</Link>\n * <Link endIcon=\"ChevronRight\">Navigate forward</Link>\n * ```\n *\n * @usage\n * - Use for navigation actions\n * - Can be nested within Text for inline links\n * - Use alwaysUnderline for links that need to be visually distinct\n *\n * @accessibility\n * - Link text is the accessible name\n * - Shows underline on press for visual feedback\n * - Use descriptive link text (avoid \"click here\")\n *\n * @see {@link Button} for primary actions\n * @see {@link Text} for non-interactive text\n */\nconst Link = memo(function Link({\n children,\n variant = 'primary',\n textVariant,\n alwaysUnderline = false,\n startIcon,\n endIcon,\n onPress,\n style,\n ref,\n ...rest\n}: LinkProps) {\n const [pressed, setPressed] = useState(false);\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n // Must have onPress for touch events to register (RN requirement)\n // Even without a user-provided handler, we need a function to make text touchable\n const handlePress = useCallback(\n (event: GestureResponderEvent) => {\n onPress?.(event);\n },\n [onPress],\n );\n\n linkStyles.useVariants({\n textStyle: textVariant,\n variant,\n pressed,\n });\n\n // Get theme as SharedValue for worklet access (zero re-renders)\n const animatedTheme = useAnimatedTheme();\n\n // Derive underline visibility from pressed state\n // useDerivedValue handles the animation automatically when deps change\n const underlineProgress = useDerivedValue(() => {\n const targetValue = pressed || alwaysUnderline ? 1 : 0;\n return withTiming(targetValue, {\n duration: 150,\n easing: Easing.bezier(0, 0, 0.2, 1),\n });\n }, [pressed, alwaysUnderline]);\n\n // Combined animated style for color and underline\n const animatedTextStyle = useAnimatedStyle(() => {\n // Access text color from theme using variant path\n const components = animatedTheme.value.components;\n const state = pressed ? 'pressed' : 'rest';\n const textVariantPath = `link/variant/${variant}/rootText/${state}` as const;\n const textColor = components[textVariantPath]?.color;\n\n if (!textColor) {\n return {};\n }\n\n const color = withTiming(textColor, {\n duration: 150,\n easing: Easing.bezier(0, 0, 0.2, 1),\n });\n\n // Interpolate underline opacity: 0 = transparent, 1 = text color\n const underlineColor = interpolateColor(\n underlineProgress.value,\n [0, 1],\n ['transparent', textColor],\n );\n\n return {\n color,\n textDecorationColor: underlineColor,\n };\n });\n\n const textStyles = useMemo(() => {\n return [linkStyles.root, linkStyles.text, animatedTextStyle, style];\n }, [linkStyles.text, animatedTextStyle, style, linkStyles.root]);\n\n const startIconStyles = useMemo(() => {\n return [linkStyles.icon, linkStyles.iconStart, noUnderline];\n }, [linkStyles.icon, linkStyles.iconStart, noUnderline]);\n\n const endIconStyles = useMemo(() => {\n return [linkStyles.icon, linkStyles.iconEnd, noUnderline];\n }, [linkStyles.icon, linkStyles.iconEnd, noUnderline]);\n\n return (\n <AnimatedText\n ref={ref}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting\n style={textStyles}\n {...rest}\n >\n {startIcon && (\n <>\n <IconSlot
|
|
1
|
+
{"version":3,"file":"Link.js","names":["RNText"],"sources":["../../src/components/Link.tsx"],"sourcesContent":["import type { UniversalLinkProps } from '@yahoo/uds-types';\nimport type { ReactNode, Ref } from 'react';\nimport { memo, useCallback, useMemo, useState } from 'react';\nimport type { GestureResponderEvent, TextStyle } from 'react-native';\nimport { Text as RNText } from 'react-native';\nimport Animated, {\n Easing,\n interpolateColor,\n useAnimatedStyle,\n useDerivedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport { useAnimatedTheme } from 'react-native-unistyles/reanimated';\n\nimport { linkStyles } from '../../generated/styles';\nimport { DEFAULT_DYNAMIC_TYPE_RAMPS } from '../fontScaling/constants';\nimport { useDynamicTypeRampEnabled } from '../fontScaling/FontScalingContext';\nimport { useMaxFontSizeMultiplier } from '../fontScaling/useMaxFontSizeMultiplier';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport type { TextProps, TextVariant } from './Text';\n\nconst AnimatedText = Animated.Text;\n\n// Prevent icons from inheriting underline from parent/theme (matches web behavior)\nconst noUnderline: TextStyle = { textDecorationLine: 'none' };\n\ninterface LinkProps extends UniversalLinkProps<IconSlotType> {\n /** Style override for the link text */\n style?: TextStyle;\n /** Callback fired when the link is pressed */\n onPress?: TextProps['onPress'];\n /** Ref to the underlying Text element */\n ref?: Ref<RNText>;\n /** Link content, typically text */\n children?: ReactNode;\n /**\n * Caps how far the link text grows with the OS text-size setting. Inline\n * icons keep their designed size. Set null to remove the text cap; override\n * app-wide via UDSFontScalingProvider.\n */\n maxFontSizeMultiplier?: number | null;\n}\n\n/**\n * **🔗 A navigation link component**\n *\n * @description\n * A styled link component for navigation. Rendered as Text so it can be\n * nested inline within other Text. Supports optional start/end icons.\n *\n * @category Interactive\n * @platform mobile\n *\n * @example\n * ```tsx\n * import { Link } from '@yahoo/uds-mobile/Link';\n *\n * // Standalone link\n * <Link onPress={() => navigate('/profile')}>Go to Profile</Link>\n *\n * // Inline within text\n * <Text>Read our <Link>Terms of Service</Link> and <Link>Privacy Policy</Link>.</Text>\n *\n * // With icons\n * <Link startIcon=\"AffiliateLink\">External link</Link>\n * <Link endIcon=\"ChevronRight\">Navigate forward</Link>\n * ```\n *\n * @usage\n * - Use for navigation actions\n * - Can be nested within Text for inline links\n * - Inline icons stay at their designed size while link text scales\n * - Use alwaysUnderline for links that need to be visually distinct\n *\n * @accessibility\n * - Link text is the accessible name\n * - Shows underline on press for visual feedback\n * - Use descriptive link text (avoid \"click here\")\n *\n * @see {@link Button} for primary actions\n * @see {@link Text} for non-interactive text\n */\nconst Link = memo(function Link({\n children,\n variant = 'primary',\n textVariant,\n alwaysUnderline = false,\n startIcon,\n endIcon,\n maxFontSizeMultiplier,\n onPress,\n style,\n ref,\n ...rest\n}: LinkProps) {\n const [pressed, setPressed] = useState(false);\n const dynamicTypeRampEnabled = useDynamicTypeRampEnabled();\n const resolvedTextVariant = textVariant as TextVariant | undefined;\n const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier(\n resolvedTextVariant,\n maxFontSizeMultiplier,\n );\n const dynamicTypeRamp =\n dynamicTypeRampEnabled && resolvedTextVariant\n ? DEFAULT_DYNAMIC_TYPE_RAMPS[resolvedTextVariant]\n : undefined;\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n // Must have onPress for touch events to register (RN requirement)\n // Even without a user-provided handler, we need a function to make text touchable\n const handlePress = useCallback(\n (event: GestureResponderEvent) => {\n onPress?.(event);\n },\n [onPress],\n );\n\n linkStyles.useVariants({\n textStyle: textVariant,\n variant,\n pressed,\n });\n\n // Get theme as SharedValue for worklet access (zero re-renders)\n const animatedTheme = useAnimatedTheme();\n\n // Derive underline visibility from pressed state\n // useDerivedValue handles the animation automatically when deps change\n const underlineProgress = useDerivedValue(() => {\n const targetValue = pressed || alwaysUnderline ? 1 : 0;\n return withTiming(targetValue, {\n duration: 150,\n easing: Easing.bezier(0, 0, 0.2, 1),\n });\n }, [pressed, alwaysUnderline]);\n\n // Combined animated style for color and underline\n const animatedTextStyle = useAnimatedStyle(() => {\n // Access text color from theme using variant path\n const components = animatedTheme.value.components;\n const state = pressed ? 'pressed' : 'rest';\n const textVariantPath = `link/variant/${variant}/rootText/${state}` as const;\n const textColor = components[textVariantPath]?.color;\n\n if (!textColor) {\n return {};\n }\n\n const color = withTiming(textColor, {\n duration: 150,\n easing: Easing.bezier(0, 0, 0.2, 1),\n });\n\n // Interpolate underline opacity: 0 = transparent, 1 = text color\n const underlineColor = interpolateColor(\n underlineProgress.value,\n [0, 1],\n ['transparent', textColor],\n );\n\n return {\n color,\n textDecorationColor: underlineColor,\n };\n });\n\n const textStyles = useMemo(() => {\n return [linkStyles.root, linkStyles.text, animatedTextStyle, style];\n }, [linkStyles.text, animatedTextStyle, style, linkStyles.root]);\n\n const startIconStyles = useMemo(() => {\n return [linkStyles.icon, linkStyles.iconStart, noUnderline];\n }, [linkStyles.icon, linkStyles.iconStart, noUnderline]);\n\n const endIconStyles = useMemo(() => {\n return [linkStyles.icon, linkStyles.iconEnd, noUnderline];\n }, [linkStyles.icon, linkStyles.iconEnd, noUnderline]);\n\n return (\n <AnimatedText\n ref={ref}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n dynamicTypeRamp={dynamicTypeRamp}\n style={textStyles}\n {...rest}\n >\n {startIcon && (\n <>\n <IconSlot\n icon={startIcon}\n variant=\"outline\"\n allowFontScaling={false}\n style={startIconStyles}\n />\n {/* TODO: need to add hairline space character to icon font so we can have space between icon and text https://hybridheroes.de/blog/2022-11-17-text-with-inline-icons-in-react-native/ */}\n <RNText style={noUnderline}>{' \\u200A'}</RNText>\n </>\n )}\n {children}\n {endIcon && (\n <>\n {/* TODO: need to add hairline space character to icon font so we can have space between icon and text https://hybridheroes.de/blog/2022-11-17-text-with-inline-icons-in-react-native/ */}\n <RNText style={noUnderline}>{' \\u200A'}</RNText>\n <IconSlot\n icon={endIcon}\n variant=\"outline\"\n allowFontScaling={false}\n style={endIconStyles}\n />\n </>\n )}\n </AnimatedText>\n );\n});\n\nLink.displayName = 'Link';\n\nexport { Link, type LinkProps };\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,eAAe,SAAS;AAG9B,MAAM,cAAyB,EAAE,oBAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0D7D,MAAM,OAAO,KAAK,SAAS,KAAK,EAC9B,UACA,UAAU,WACV,aACA,kBAAkB,OAClB,WACA,SACA,uBACA,SACA,OACA,KACA,GAAG,QACS;CACZ,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAC7C,MAAM,yBAAyB,2BAA2B;CAC1D,MAAM,sBAAsB;CAC5B,MAAM,gCAAgC,yBACpC,qBACA,sBACD;CACD,MAAM,kBACJ,0BAA0B,sBACtB,2BAA2B,uBAC3B,KAAA;CAEN,MAAM,gBAAgB,kBAAkB;EACtC,WAAW,KAAK;IACf,EAAE,CAAC;CAEN,MAAM,iBAAiB,kBAAkB;EACvC,WAAW,MAAM;IAChB,EAAE,CAAC;CAIN,MAAM,cAAc,aACjB,UAAiC;EAChC,UAAU,MAAM;IAElB,CAAC,QAAQ,CACV;CAED,WAAW,YAAY;EACrB,WAAW;EACX;EACA;EACD,CAAC;CAGF,MAAM,gBAAgB,kBAAkB;CAIxC,MAAM,oBAAoB,sBAAsB;EAE9C,OAAO,WADa,WAAW,kBAAkB,IAAI,GACtB;GAC7B,UAAU;GACV,QAAQ,OAAO,OAAO,GAAG,GAAG,IAAK,EAAE;GACpC,CAAC;IACD,CAAC,SAAS,gBAAgB,CAAC;CAG9B,MAAM,oBAAoB,uBAAuB;EAK/C,MAAM,YAHa,cAAc,MAAM,WAGV,gBADW,QAAQ,YADlC,UAAU,YAAY,WAEW;EAE/C,IAAI,CAAC,WACH,OAAO,EAAE;EAeX,OAAO;GACL,OAbY,WAAW,WAAW;IAClC,UAAU;IACV,QAAQ,OAAO,OAAO,GAAG,GAAG,IAAK,EAAE;IACpC,CAUM;GACL,qBARqB,iBACrB,kBAAkB,OAClB,CAAC,GAAG,EAAE,EACN,CAAC,eAAe,UAAU,CAKS;GACpC;GACD;CAEF,MAAM,aAAa,cAAc;EAC/B,OAAO;GAAC,WAAW;GAAM,WAAW;GAAM;GAAmB;GAAM;IAClE;EAAC,WAAW;EAAM;EAAmB;EAAO,WAAW;EAAK,CAAC;CAEhE,MAAM,kBAAkB,cAAc;EACpC,OAAO;GAAC,WAAW;GAAM,WAAW;GAAW;GAAY;IAC1D;EAAC,WAAW;EAAM,WAAW;EAAW;EAAY,CAAC;CAExD,MAAM,gBAAgB,cAAc;EAClC,OAAO;GAAC,WAAW;GAAM,WAAW;GAAS;GAAY;IACxD;EAAC,WAAW;EAAM,WAAW;EAAS;EAAY,CAAC;CAEtD,OACE,qBAAC,cAAD;EACO;EACL,SAAS;EACT,WAAW;EACX,YAAY;EACZ,sBAAA;EACA,uBAAuB;EACN;EACjB,OAAO;EACP,GAAI;YATN;GAWG,aACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,UAAD;IACE,MAAM;IACN,SAAQ;IACR,kBAAkB;IAClB,OAAO;IACP,CAAA,EAEF,oBAACA,MAAD;IAAQ,OAAO;cAAc;IAAmB,CAAA,CAC/C,EAAA,CAAA;GAEJ;GACA,WACC,qBAAA,UAAA,EAAA,UAAA,CAEE,oBAACA,MAAD;IAAQ,OAAO;cAAc;IAAmB,CAAA,EAChD,oBAAC,UAAD;IACE,MAAM;IACN,SAAQ;IACR,kBAAkB;IAClB,OAAO;IACP,CAAA,CACD,EAAA,CAAA;GAEQ;;EAEjB;AAEF,KAAK,cAAc"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_fontScaling_FontScalingContext = require("../../fontScaling/FontScalingContext.cjs");
|
|
4
5
|
const require_components_HStack = require("../HStack.cjs");
|
|
6
|
+
const require_fontScaling_useMaxFontSizeMultiplier = require("../../fontScaling/useMaxFontSizeMultiplier.cjs");
|
|
5
7
|
const require_components_Pagination_paginationContext = require("./paginationContext.cjs");
|
|
6
8
|
const require_components_Pagination_paginationTheme = require("./paginationTheme.cjs");
|
|
7
9
|
let react = require("react");
|
|
@@ -34,8 +36,9 @@ let react_native_unistyles = require("react-native-unistyles");
|
|
|
34
36
|
* </Pagination>
|
|
35
37
|
* ```
|
|
36
38
|
*/
|
|
37
|
-
const Pagination = (0, react.memo)(function Pagination({ activePage, totalPages, maxVisiblePageNumbers = 7, ellipsisPlacement = "none", size = "md", variant = "default", getPageHref, getItemAriaLabel = require_components_Pagination_paginationContext.defaultGetItemAriaLabel, onPageChange, children, accessibilityLabel = "Pagination", ...rest }) {
|
|
39
|
+
const Pagination = (0, react.memo)(function Pagination({ activePage, totalPages, maxVisiblePageNumbers = 7, ellipsisPlacement = "none", size = "md", variant = "default", getPageHref, getItemAriaLabel = require_components_Pagination_paginationContext.defaultGetItemAriaLabel, onPageChange, children, accessibilityLabel = "Pagination", maxFontSizeMultiplier, ...rest }) {
|
|
38
40
|
const { theme } = (0, react_native_unistyles.useUnistyles)();
|
|
41
|
+
const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
|
|
39
42
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Pagination_paginationContext.PaginationProvider, {
|
|
40
43
|
value: (0, react.useMemo)(() => ({
|
|
41
44
|
activePage,
|
|
@@ -44,6 +47,7 @@ const Pagination = (0, react.memo)(function Pagination({ activePage, totalPages,
|
|
|
44
47
|
ellipsisPlacement,
|
|
45
48
|
size,
|
|
46
49
|
variant,
|
|
50
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
47
51
|
getPageHref,
|
|
48
52
|
getItemAriaLabel,
|
|
49
53
|
onPageChange
|
|
@@ -54,19 +58,23 @@ const Pagination = (0, react.memo)(function Pagination({ activePage, totalPages,
|
|
|
54
58
|
ellipsisPlacement,
|
|
55
59
|
size,
|
|
56
60
|
variant,
|
|
61
|
+
resolvedMaxFontSizeMultiplier,
|
|
57
62
|
getPageHref,
|
|
58
63
|
getItemAriaLabel,
|
|
59
64
|
onPageChange
|
|
60
65
|
]),
|
|
61
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_fontScaling_FontScalingContext.ResolvedControlFontScalingProvider, {
|
|
67
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
68
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_HStack.HStack, {
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
justifyContent: "center",
|
|
71
|
+
accessibilityLabel,
|
|
72
|
+
accessibilityRole: "none",
|
|
73
|
+
gap: (0, react.useMemo)(() => require_components_Pagination_paginationTheme.getPaginationRootGapStyle(theme, size), [size, theme]).gap,
|
|
74
|
+
alignSelf: "stretch",
|
|
75
|
+
...rest,
|
|
76
|
+
children
|
|
77
|
+
})
|
|
70
78
|
})
|
|
71
79
|
});
|
|
72
80
|
});
|
|
@@ -7,6 +7,8 @@ import { ViewProps } from "react-native";
|
|
|
7
7
|
interface PaginationProps extends Omit<UniversalPaginationProps, 'className' | 'children'>, Pick<ViewProps, 'children'> {
|
|
8
8
|
/** Accessible label for the pagination control group. @default 'Pagination' */
|
|
9
9
|
accessibilityLabel?: string;
|
|
10
|
+
/** Caps page labels, icons, and control geometry. Set null to remove the cap. @default 2 */
|
|
11
|
+
maxFontSizeMultiplier?: number | null;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* **Pagination — numbered page navigation component**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.cts","names":[],"sources":["../../../src/components/Pagination/Pagination.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Pagination.d.cts","names":[],"sources":["../../../src/components/Pagination/Pagination.tsx"],"mappings":";;;;;;UAaU,eAAA,SACA,IAAA,CAAK,wBAAA,6BAAqD,IAAA,CAAK,SAAA;;EAEvE,kBAAA;EAHQ;EAKR,qBAAA;AAAA;;;;;;;;;;;;;;;AAAqB;;;;;;;;;;;;cA6BjB,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
|
|
@@ -7,6 +7,8 @@ import { ViewProps } from "react-native";
|
|
|
7
7
|
interface PaginationProps extends Omit<UniversalPaginationProps, 'className' | 'children'>, Pick<ViewProps, 'children'> {
|
|
8
8
|
/** Accessible label for the pagination control group. @default 'Pagination' */
|
|
9
9
|
accessibilityLabel?: string;
|
|
10
|
+
/** Caps page labels, icons, and control geometry. Set null to remove the cap. @default 2 */
|
|
11
|
+
maxFontSizeMultiplier?: number | null;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* **Pagination — numbered page navigation component**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","names":[],"sources":["../../../src/components/Pagination/Pagination.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","names":[],"sources":["../../../src/components/Pagination/Pagination.tsx"],"mappings":";;;;;;UAaU,eAAA,SACA,IAAA,CAAK,wBAAA,6BAAqD,IAAA,CAAK,SAAA;;EAEvE,kBAAA;EAHQ;EAKR,qBAAA;AAAA;;;;;;;;;;;;;;;AAAqB;;;;;;;;;;;;cA6BjB,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { ResolvedControlFontScalingProvider } from "../../fontScaling/FontScalingContext.js";
|
|
2
3
|
import { HStack } from "../HStack.js";
|
|
4
|
+
import { useMaxFontSizeMultiplier } from "../../fontScaling/useMaxFontSizeMultiplier.js";
|
|
3
5
|
import { PaginationProvider, defaultGetItemAriaLabel } from "./paginationContext.js";
|
|
4
6
|
import { getPaginationRootGapStyle } from "./paginationTheme.js";
|
|
5
7
|
import { memo, useMemo } from "react";
|
|
@@ -32,8 +34,9 @@ import { useUnistyles } from "react-native-unistyles";
|
|
|
32
34
|
* </Pagination>
|
|
33
35
|
* ```
|
|
34
36
|
*/
|
|
35
|
-
const Pagination = memo(function Pagination({ activePage, totalPages, maxVisiblePageNumbers = 7, ellipsisPlacement = "none", size = "md", variant = "default", getPageHref, getItemAriaLabel = defaultGetItemAriaLabel, onPageChange, children, accessibilityLabel = "Pagination", ...rest }) {
|
|
37
|
+
const Pagination = memo(function Pagination({ activePage, totalPages, maxVisiblePageNumbers = 7, ellipsisPlacement = "none", size = "md", variant = "default", getPageHref, getItemAriaLabel = defaultGetItemAriaLabel, onPageChange, children, accessibilityLabel = "Pagination", maxFontSizeMultiplier, ...rest }) {
|
|
36
38
|
const { theme } = useUnistyles();
|
|
39
|
+
const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
|
|
37
40
|
return /* @__PURE__ */ jsx(PaginationProvider, {
|
|
38
41
|
value: useMemo(() => ({
|
|
39
42
|
activePage,
|
|
@@ -42,6 +45,7 @@ const Pagination = memo(function Pagination({ activePage, totalPages, maxVisible
|
|
|
42
45
|
ellipsisPlacement,
|
|
43
46
|
size,
|
|
44
47
|
variant,
|
|
48
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
45
49
|
getPageHref,
|
|
46
50
|
getItemAriaLabel,
|
|
47
51
|
onPageChange
|
|
@@ -52,19 +56,23 @@ const Pagination = memo(function Pagination({ activePage, totalPages, maxVisible
|
|
|
52
56
|
ellipsisPlacement,
|
|
53
57
|
size,
|
|
54
58
|
variant,
|
|
59
|
+
resolvedMaxFontSizeMultiplier,
|
|
55
60
|
getPageHref,
|
|
56
61
|
getItemAriaLabel,
|
|
57
62
|
onPageChange
|
|
58
63
|
]),
|
|
59
|
-
children: /* @__PURE__ */ jsx(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
children: /* @__PURE__ */ jsx(ResolvedControlFontScalingProvider, {
|
|
65
|
+
maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
|
|
66
|
+
children: /* @__PURE__ */ jsx(HStack, {
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
accessibilityLabel,
|
|
70
|
+
accessibilityRole: "none",
|
|
71
|
+
gap: useMemo(() => getPaginationRootGapStyle(theme, size), [size, theme]).gap,
|
|
72
|
+
alignSelf: "stretch",
|
|
73
|
+
...rest,
|
|
74
|
+
children
|
|
75
|
+
})
|
|
68
76
|
})
|
|
69
77
|
});
|
|
70
78
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import type { UniversalPaginationProps } from '@yahoo/uds-types';\nimport { memo, useMemo } from 'react';\nimport type { ViewProps } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- root gap from pagination size tokens\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport type { StyleProps } from '../../../generated/styles';\nimport { HStack } from '../HStack';\nimport { defaultGetItemAriaLabel, PaginationProvider } from './paginationContext';\nimport { getPaginationRootGapStyle } from './paginationTheme';\n\ninterface PaginationProps\n extends Omit<UniversalPaginationProps, 'className' | 'children'>, Pick<ViewProps, 'children'> {\n /** Accessible label for the pagination control group. @default 'Pagination' */\n accessibilityLabel?: string;\n}\n\n/**\n * **Pagination — numbered page navigation component**\n *\n * @description\n * Compose with `PaginationPrev`, `PaginationNumbers`, and `PaginationNext`.\n * The consumer owns `activePage` state.\n *\n * @category Navigation\n * @platform mobile\n *\n * @example\n * ```tsx\n * import {\n * Pagination,\n * PaginationNext,\n * PaginationNumbers,\n * PaginationPrev,\n * } from '@yahoo/uds-mobile/Pagination';\n *\n * <Pagination activePage={page} totalPages={10} onPageChange={setPage} accessibilityLabel=\"Results\">\n * <PaginationPrev />\n * <PaginationNumbers />\n * <PaginationNext />\n * </Pagination>\n * ```\n */\nconst Pagination = memo(function Pagination({\n activePage,\n totalPages,\n maxVisiblePageNumbers = 7,\n ellipsisPlacement = 'none',\n size = 'md',\n variant = 'default',\n getPageHref,\n getItemAriaLabel = defaultGetItemAriaLabel,\n onPageChange,\n children,\n accessibilityLabel = 'Pagination',\n ...rest\n}: PaginationProps) {\n const { theme } = useUnistyles();\n\n const contextValue = useMemo(\n () => ({\n activePage,\n totalPages,\n maxVisiblePageNumbers,\n ellipsisPlacement,\n size,\n variant,\n getPageHref,\n getItemAriaLabel,\n onPageChange,\n }),\n [\n activePage,\n totalPages,\n maxVisiblePageNumbers,\n ellipsisPlacement,\n size,\n variant,\n getPageHref,\n getItemAriaLabel,\n onPageChange,\n ],\n );\n\n const rootGapStyle = useMemo(() => getPaginationRootGapStyle(theme, size), [size, theme]);\n\n return (\n <PaginationProvider value={contextValue}>\n <HStack\n
|
|
1
|
+
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import type { UniversalPaginationProps } from '@yahoo/uds-types';\nimport { memo, useMemo } from 'react';\nimport type { ViewProps } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- root gap from pagination size tokens\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport type { StyleProps } from '../../../generated/styles';\nimport { ResolvedControlFontScalingProvider } from '../../fontScaling/FontScalingContext';\nimport { useMaxFontSizeMultiplier } from '../../fontScaling/useMaxFontSizeMultiplier';\nimport { HStack } from '../HStack';\nimport { defaultGetItemAriaLabel, PaginationProvider } from './paginationContext';\nimport { getPaginationRootGapStyle } from './paginationTheme';\n\ninterface PaginationProps\n extends Omit<UniversalPaginationProps, 'className' | 'children'>, Pick<ViewProps, 'children'> {\n /** Accessible label for the pagination control group. @default 'Pagination' */\n accessibilityLabel?: string;\n /** Caps page labels, icons, and control geometry. Set null to remove the cap. @default 2 */\n maxFontSizeMultiplier?: number | null;\n}\n\n/**\n * **Pagination — numbered page navigation component**\n *\n * @description\n * Compose with `PaginationPrev`, `PaginationNumbers`, and `PaginationNext`.\n * The consumer owns `activePage` state.\n *\n * @category Navigation\n * @platform mobile\n *\n * @example\n * ```tsx\n * import {\n * Pagination,\n * PaginationNext,\n * PaginationNumbers,\n * PaginationPrev,\n * } from '@yahoo/uds-mobile/Pagination';\n *\n * <Pagination activePage={page} totalPages={10} onPageChange={setPage} accessibilityLabel=\"Results\">\n * <PaginationPrev />\n * <PaginationNumbers />\n * <PaginationNext />\n * </Pagination>\n * ```\n */\nconst Pagination = memo(function Pagination({\n activePage,\n totalPages,\n maxVisiblePageNumbers = 7,\n ellipsisPlacement = 'none',\n size = 'md',\n variant = 'default',\n getPageHref,\n getItemAriaLabel = defaultGetItemAriaLabel,\n onPageChange,\n children,\n accessibilityLabel = 'Pagination',\n maxFontSizeMultiplier,\n ...rest\n}: PaginationProps) {\n const { theme } = useUnistyles();\n const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier('control', maxFontSizeMultiplier);\n\n const contextValue = useMemo(\n () => ({\n activePage,\n totalPages,\n maxVisiblePageNumbers,\n ellipsisPlacement,\n size,\n variant,\n maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,\n getPageHref,\n getItemAriaLabel,\n onPageChange,\n }),\n [\n activePage,\n totalPages,\n maxVisiblePageNumbers,\n ellipsisPlacement,\n size,\n variant,\n resolvedMaxFontSizeMultiplier,\n getPageHref,\n getItemAriaLabel,\n onPageChange,\n ],\n );\n\n const rootGapStyle = useMemo(() => getPaginationRootGapStyle(theme, size), [size, theme]);\n\n return (\n <PaginationProvider value={contextValue}>\n <ResolvedControlFontScalingProvider maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}>\n <HStack\n alignItems=\"center\"\n justifyContent=\"center\"\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"none\"\n gap={rootGapStyle.gap as StyleProps['columnGap'] | undefined}\n alignSelf=\"stretch\"\n {...rest}\n >\n {children}\n </HStack>\n </ResolvedControlFontScalingProvider>\n </PaginationProvider>\n );\n});\n\nPagination.displayName = 'Pagination';\n\nexport { Pagination, type PaginationProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAM,aAAa,KAAK,SAAS,WAAW,EAC1C,YACA,YACA,wBAAwB,GACxB,oBAAoB,QACpB,OAAO,MACP,UAAU,WACV,aACA,mBAAmB,yBACnB,cACA,UACA,qBAAqB,cACrB,uBACA,GAAG,QACe;CAClB,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,gCAAgC,yBAAyB,WAAW,sBAAsB;CA+BhG,OACE,oBAAC,oBAAD;EAAoB,OA9BD,eACZ;GACL;GACA;GACA;GACA;GACA;GACA;GACA,uBAAuB;GACvB;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAMsC;YACrC,oBAAC,oCAAD;GAAoC,uBAAuB;aACzD,oBAAC,QAAD;IACE,YAAW;IACX,gBAAe;IACK;IACpB,mBAAkB;IAClB,KAVa,cAAc,0BAA0B,OAAO,KAAK,EAAE,CAAC,MAAM,MAAM,CAU/D,CAAC;IAClB,WAAU;IACV,GAAI;IAEH;IACM,CAAA;GAC0B,CAAA;EAClB,CAAA;EAEvB;AAEF,WAAW,cAAc"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
|
+
const require_fontScaling_useFontScale = require("../../fontScaling/useFontScale.cjs");
|
|
4
5
|
const require_components_Text = require("../Text.cjs");
|
|
5
6
|
const require_components_Pagination_paginationContext = require("./paginationContext.cjs");
|
|
6
7
|
const require_components_Pagination_paginationTheme = require("./paginationTheme.cjs");
|
|
@@ -19,13 +20,16 @@ let react_native_unistyles = require("react-native-unistyles");
|
|
|
19
20
|
* @platform mobile
|
|
20
21
|
*/
|
|
21
22
|
const PaginationEllipsis = (0, react.memo)(function PaginationEllipsis({ style }) {
|
|
22
|
-
const { size, variant } = require_components_Pagination_paginationContext.usePaginationContext();
|
|
23
|
+
const { size, variant, maxFontSizeMultiplier } = require_components_Pagination_paginationContext.usePaginationContext();
|
|
23
24
|
const { theme } = (0, react_native_unistyles.useUnistyles)();
|
|
25
|
+
const sizeTextStyle = require_components_Pagination_paginationTheme.getPaginationSizeLayerStyle(theme, size, "text");
|
|
26
|
+
const fontScaleFactor = require_fontScaling_useFontScale.useComponentFontScale(maxFontSizeMultiplier, typeof sizeTextStyle.lineHeight === "number" ? sizeTextStyle.lineHeight : sizeTextStyle.fontSize);
|
|
24
27
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
25
28
|
accessibilityElementsHidden: true,
|
|
26
29
|
importantForAccessibility: "no-hide-descendants",
|
|
27
30
|
style: (0, react.useMemo)(() => {
|
|
28
|
-
const { controlSize, borderRadius } = require_components_Pagination_paginationTheme.getPaginationControlMetrics(theme, size);
|
|
31
|
+
const { controlSize: baseControlSize, borderRadius } = require_components_Pagination_paginationTheme.getPaginationControlMetrics(theme, size);
|
|
32
|
+
const controlSize = Math.round(baseControlSize * fontScaleFactor);
|
|
29
33
|
return [
|
|
30
34
|
paginationStaticStyles.root,
|
|
31
35
|
require_components_Pagination_paginationTheme.getMergedPaginationControlRootStyle(theme, size, variant, "off", "rest"),
|
|
@@ -37,6 +41,7 @@ const PaginationEllipsis = (0, react.memo)(function PaginationEllipsis({ style }
|
|
|
37
41
|
style
|
|
38
42
|
];
|
|
39
43
|
}, [
|
|
44
|
+
fontScaleFactor,
|
|
40
45
|
size,
|
|
41
46
|
style,
|
|
42
47
|
theme,
|
|
@@ -45,6 +50,7 @@ const PaginationEllipsis = (0, react.memo)(function PaginationEllipsis({ style }
|
|
|
45
50
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
46
51
|
color: "inherit",
|
|
47
52
|
variant: "inherit",
|
|
53
|
+
maxFontSizeMultiplier,
|
|
48
54
|
style: (0, react.useMemo)(() => require_components_Pagination_paginationTheme.getMergedPaginationTextStyle(theme, size, variant, "off", "rest"), [
|
|
49
55
|
size,
|
|
50
56
|
theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationEllipsis.d.cts","names":[],"sources":["../../../src/components/Pagination/PaginationEllipsis.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"PaginationEllipsis.d.cts","names":[],"sources":["../../../src/components/Pagination/PaginationEllipsis.tsx"],"mappings":";;;;;UAgBU,uBAAA;EACR,KAAA,GAAQ,SAAA,CAAU,SAAA;AAAA;AAhBgD;;;;;;;;;AAAA,cA4B9D,kBAAA,EAAkB,OAAA,CAAA,oBAAA,CAAA,uBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationEllipsis.d.ts","names":[],"sources":["../../../src/components/Pagination/PaginationEllipsis.tsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"PaginationEllipsis.d.ts","names":[],"sources":["../../../src/components/Pagination/PaginationEllipsis.tsx"],"mappings":";;;;;UAgBU,uBAAA;EACR,KAAA,GAAQ,SAAA,CAAU,SAAA;AAAA;AAhBgD;;;;;;;;;AAAA,cA4B9D,kBAAA,EAAkB,OAAA,CAAA,oBAAA,CAAA,uBAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { useComponentFontScale } from "../../fontScaling/useFontScale.js";
|
|
2
3
|
import { Text as Text$1 } from "../Text.js";
|
|
3
4
|
import { usePaginationContext } from "./paginationContext.js";
|
|
4
|
-
import { getMergedPaginationControlRootStyle, getMergedPaginationTextStyle, getPaginationControlMetrics } from "./paginationTheme.js";
|
|
5
|
+
import { getMergedPaginationControlRootStyle, getMergedPaginationTextStyle, getPaginationControlMetrics, getPaginationSizeLayerStyle } from "./paginationTheme.js";
|
|
5
6
|
import { memo, useMemo } from "react";
|
|
6
7
|
import { StyleSheet, View } from "react-native";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -17,13 +18,16 @@ import { useUnistyles } from "react-native-unistyles";
|
|
|
17
18
|
* @platform mobile
|
|
18
19
|
*/
|
|
19
20
|
const PaginationEllipsis = memo(function PaginationEllipsis({ style }) {
|
|
20
|
-
const { size, variant } = usePaginationContext();
|
|
21
|
+
const { size, variant, maxFontSizeMultiplier } = usePaginationContext();
|
|
21
22
|
const { theme } = useUnistyles();
|
|
23
|
+
const sizeTextStyle = getPaginationSizeLayerStyle(theme, size, "text");
|
|
24
|
+
const fontScaleFactor = useComponentFontScale(maxFontSizeMultiplier, typeof sizeTextStyle.lineHeight === "number" ? sizeTextStyle.lineHeight : sizeTextStyle.fontSize);
|
|
22
25
|
return /* @__PURE__ */ jsx(View, {
|
|
23
26
|
accessibilityElementsHidden: true,
|
|
24
27
|
importantForAccessibility: "no-hide-descendants",
|
|
25
28
|
style: useMemo(() => {
|
|
26
|
-
const { controlSize, borderRadius } = getPaginationControlMetrics(theme, size);
|
|
29
|
+
const { controlSize: baseControlSize, borderRadius } = getPaginationControlMetrics(theme, size);
|
|
30
|
+
const controlSize = Math.round(baseControlSize * fontScaleFactor);
|
|
27
31
|
return [
|
|
28
32
|
paginationStaticStyles.root,
|
|
29
33
|
getMergedPaginationControlRootStyle(theme, size, variant, "off", "rest"),
|
|
@@ -35,6 +39,7 @@ const PaginationEllipsis = memo(function PaginationEllipsis({ style }) {
|
|
|
35
39
|
style
|
|
36
40
|
];
|
|
37
41
|
}, [
|
|
42
|
+
fontScaleFactor,
|
|
38
43
|
size,
|
|
39
44
|
style,
|
|
40
45
|
theme,
|
|
@@ -43,6 +48,7 @@ const PaginationEllipsis = memo(function PaginationEllipsis({ style }) {
|
|
|
43
48
|
children: /* @__PURE__ */ jsx(Text$1, {
|
|
44
49
|
color: "inherit",
|
|
45
50
|
variant: "inherit",
|
|
51
|
+
maxFontSizeMultiplier,
|
|
46
52
|
style: useMemo(() => getMergedPaginationTextStyle(theme, size, variant, "off", "rest"), [
|
|
47
53
|
size,
|
|
48
54
|
theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationEllipsis.js","names":["Text"],"sources":["../../../src/components/Pagination/PaginationEllipsis.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- pagination token lookups\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { Text } from '../Text';\nimport { usePaginationContext } from './paginationContext';\nimport {\n getMergedPaginationControlRootStyle,\n getMergedPaginationTextStyle,\n getPaginationControlMetrics,\n} from './paginationTheme';\n\ninterface PaginationEllipsisProps {\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * **PaginationEllipsis — truncated page range indicator**\n *\n * @description\n * Non-interactive ellipsis shown when page numbers are collapsed.\n *\n * @category Navigation\n * @platform mobile\n */\nconst PaginationEllipsis = memo(function PaginationEllipsis({ style }: PaginationEllipsisProps) {\n const { size, variant } = usePaginationContext();\n const { theme } = useUnistyles();\n\n const rootStyle = useMemo<StyleProp<ViewStyle>>(() => {\n const { controlSize, borderRadius } = getPaginationControlMetrics(theme, size);\n\n return [\n paginationStaticStyles.root,\n getMergedPaginationControlRootStyle(theme, size, variant, 'off', 'rest'),\n {\n borderRadius,\n height: controlSize,\n width: controlSize,\n },\n style,\n ];\n }, [size, style, theme, variant]);\n\n const textStyle = useMemo(\n () => getMergedPaginationTextStyle(theme, size, variant, 'off', 'rest'),\n [size, theme, variant],\n );\n\n return (\n <View\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={rootStyle}\n >\n <Text
|
|
1
|
+
{"version":3,"file":"PaginationEllipsis.js","names":["Text"],"sources":["../../../src/components/Pagination/PaginationEllipsis.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport type { StyleProp, TextStyle, ViewStyle } from 'react-native';\nimport { StyleSheet, View } from 'react-native';\n// eslint-disable-next-line uds/no-use-unistyles -- pagination token lookups\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { useComponentFontScale } from '../../fontScaling/useFontScale';\nimport { Text } from '../Text';\nimport { usePaginationContext } from './paginationContext';\nimport {\n getMergedPaginationControlRootStyle,\n getMergedPaginationTextStyle,\n getPaginationControlMetrics,\n getPaginationSizeLayerStyle,\n} from './paginationTheme';\n\ninterface PaginationEllipsisProps {\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * **PaginationEllipsis — truncated page range indicator**\n *\n * @description\n * Non-interactive ellipsis shown when page numbers are collapsed.\n *\n * @category Navigation\n * @platform mobile\n */\nconst PaginationEllipsis = memo(function PaginationEllipsis({ style }: PaginationEllipsisProps) {\n const { size, variant, maxFontSizeMultiplier } = usePaginationContext();\n const { theme } = useUnistyles();\n const sizeTextStyle = getPaginationSizeLayerStyle(theme, size, 'text') as TextStyle;\n const fontScaleFactor = useComponentFontScale(\n maxFontSizeMultiplier,\n typeof sizeTextStyle.lineHeight === 'number'\n ? sizeTextStyle.lineHeight\n : sizeTextStyle.fontSize,\n );\n\n const rootStyle = useMemo<StyleProp<ViewStyle>>(() => {\n const { controlSize: baseControlSize, borderRadius } = getPaginationControlMetrics(theme, size);\n const controlSize = Math.round(baseControlSize * fontScaleFactor);\n\n return [\n paginationStaticStyles.root,\n getMergedPaginationControlRootStyle(theme, size, variant, 'off', 'rest'),\n {\n borderRadius,\n height: controlSize,\n width: controlSize,\n },\n style,\n ];\n }, [fontScaleFactor, size, style, theme, variant]);\n\n const textStyle = useMemo(\n () => getMergedPaginationTextStyle(theme, size, variant, 'off', 'rest'),\n [size, theme, variant],\n );\n\n return (\n <View\n accessibilityElementsHidden\n importantForAccessibility=\"no-hide-descendants\"\n style={rootStyle}\n >\n <Text\n color=\"inherit\"\n variant=\"inherit\"\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n style={textStyle}\n >\n …\n </Text>\n </View>\n );\n});\n\nPaginationEllipsis.displayName = 'PaginationEllipsis';\n\nconst paginationStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n },\n});\n\nexport { PaginationEllipsis, type PaginationEllipsisProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA,MAAM,qBAAqB,KAAK,SAAS,mBAAmB,EAAE,SAAkC;CAC9F,MAAM,EAAE,MAAM,SAAS,0BAA0B,sBAAsB;CACvE,MAAM,EAAE,UAAU,cAAc;CAChC,MAAM,gBAAgB,4BAA4B,OAAO,MAAM,OAAO;CACtE,MAAM,kBAAkB,sBACtB,uBACA,OAAO,cAAc,eAAe,WAChC,cAAc,aACd,cAAc,SACnB;CAuBD,OACE,oBAAC,MAAD;EACE,6BAAA;EACA,2BAA0B;EAC1B,OAzBc,cAAoC;GACpD,MAAM,EAAE,aAAa,iBAAiB,iBAAiB,4BAA4B,OAAO,KAAK;GAC/F,MAAM,cAAc,KAAK,MAAM,kBAAkB,gBAAgB;GAEjE,OAAO;IACL,uBAAuB;IACvB,oCAAoC,OAAO,MAAM,SAAS,OAAO,OAAO;IACxE;KACE;KACA,QAAQ;KACR,OAAO;KACR;IACD;IACD;KACA;GAAC;GAAiB;GAAM;GAAO;GAAO;GAAQ,CAW7B;YAEhB,oBAACA,QAAD;GACE,OAAM;GACN,SAAQ;GACe;GACvB,OAfY,cACV,6BAA6B,OAAO,MAAM,SAAS,OAAO,OAAO,EACvE;IAAC;IAAM;IAAO;IAAQ,CAaF;aACjB;GAEM,CAAA;EACF,CAAA;EAET;AAEF,mBAAmB,cAAc;AAEjC,MAAM,yBAAyB,WAAW,OAAO,EAC/C,MAAM;CACJ,YAAY;CACZ,gBAAgB;CAChB,YAAY;CACb,EACF,CAAC"}
|
|
@@ -18,7 +18,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
18
18
|
* @platform mobile
|
|
19
19
|
*/
|
|
20
20
|
const PaginationItem = (0, react.memo)(function PaginationItem({ page, children, onPress, ...rest }) {
|
|
21
|
-
const { activePage, size, variant, getItemAriaLabel, onPageChange } = require_components_Pagination_paginationContext.usePaginationContext();
|
|
21
|
+
const { activePage, size, variant, maxFontSizeMultiplier, getItemAriaLabel, onPageChange } = require_components_Pagination_paginationContext.usePaginationContext();
|
|
22
22
|
const isActive = page === activePage;
|
|
23
23
|
const [pressed, setPressed] = (0, react.useState)(false);
|
|
24
24
|
const { rootStyle, textStyle } = require_components_Pagination_usePaginationControlStyles.usePaginationControlStyles({
|
|
@@ -57,6 +57,7 @@ const PaginationItem = (0, react.memo)(function PaginationItem({ page, children,
|
|
|
57
57
|
children: typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
58
58
|
color: "inherit",
|
|
59
59
|
variant: "inherit",
|
|
60
|
+
maxFontSizeMultiplier,
|
|
60
61
|
style: textStyle,
|
|
61
62
|
dangerouslySetColor: resolvedTextColor,
|
|
62
63
|
children: label
|
|
@@ -16,7 +16,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
16
16
|
* @platform mobile
|
|
17
17
|
*/
|
|
18
18
|
const PaginationItem = memo(function PaginationItem({ page, children, onPress, ...rest }) {
|
|
19
|
-
const { activePage, size, variant, getItemAriaLabel, onPageChange } = usePaginationContext();
|
|
19
|
+
const { activePage, size, variant, maxFontSizeMultiplier, getItemAriaLabel, onPageChange } = usePaginationContext();
|
|
20
20
|
const isActive = page === activePage;
|
|
21
21
|
const [pressed, setPressed] = useState(false);
|
|
22
22
|
const { rootStyle, textStyle } = usePaginationControlStyles({
|
|
@@ -55,6 +55,7 @@ const PaginationItem = memo(function PaginationItem({ page, children, onPress, .
|
|
|
55
55
|
children: typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ jsx(Text$1, {
|
|
56
56
|
color: "inherit",
|
|
57
57
|
variant: "inherit",
|
|
58
|
+
maxFontSizeMultiplier,
|
|
58
59
|
style: textStyle,
|
|
59
60
|
dangerouslySetColor: resolvedTextColor,
|
|
60
61
|
children: label
|