@yahoo/uds-mobile 2.24.0-beta.1 → 2.24.0-beta.11

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.
Files changed (237) hide show
  1. package/README.md +37 -1
  2. package/dist/components/Avatar/AvatarIcon.cjs +8 -2
  3. package/dist/components/Avatar/AvatarIcon.d.cts.map +1 -1
  4. package/dist/components/Avatar/AvatarIcon.d.ts.map +1 -1
  5. package/dist/components/Avatar/AvatarIcon.js +9 -3
  6. package/dist/components/Avatar/AvatarIcon.js.map +1 -1
  7. package/dist/components/Avatar/AvatarImage.cjs +9 -2
  8. package/dist/components/Avatar/AvatarImage.d.cts.map +1 -1
  9. package/dist/components/Avatar/AvatarImage.d.ts.map +1 -1
  10. package/dist/components/Avatar/AvatarImage.js +10 -3
  11. package/dist/components/Avatar/AvatarImage.js.map +1 -1
  12. package/dist/components/Avatar/AvatarText.cjs +8 -2
  13. package/dist/components/Avatar/AvatarText.d.cts.map +1 -1
  14. package/dist/components/Avatar/AvatarText.d.ts.map +1 -1
  15. package/dist/components/Avatar/AvatarText.js +9 -3
  16. package/dist/components/Avatar/AvatarText.js.map +1 -1
  17. package/dist/components/Avatar/types.d.cts +7 -3
  18. package/dist/components/Avatar/types.d.cts.map +1 -1
  19. package/dist/components/Avatar/types.d.ts +7 -3
  20. package/dist/components/Avatar/types.d.ts.map +1 -1
  21. package/dist/components/Avatar/useAvatarFontScale.cjs +16 -0
  22. package/dist/components/Avatar/useAvatarFontScale.d.cts +7 -0
  23. package/dist/components/Avatar/useAvatarFontScale.d.cts.map +1 -0
  24. package/dist/components/Avatar/useAvatarFontScale.d.ts +7 -0
  25. package/dist/components/Avatar/useAvatarFontScale.d.ts.map +1 -0
  26. package/dist/components/Avatar/useAvatarFontScale.js +16 -0
  27. package/dist/components/Avatar/useAvatarFontScale.js.map +1 -0
  28. package/dist/components/Avatar/utils.cjs +9 -6
  29. package/dist/components/Avatar/utils.d.cts +2 -2
  30. package/dist/components/Avatar/utils.d.cts.map +1 -1
  31. package/dist/components/Avatar/utils.d.ts +2 -2
  32. package/dist/components/Avatar/utils.d.ts.map +1 -1
  33. package/dist/components/Avatar/utils.js +9 -6
  34. package/dist/components/Avatar/utils.js.map +1 -1
  35. package/dist/components/Button/buttonTheme.cjs +16 -7
  36. package/dist/components/Button/buttonTheme.d.cts +13 -6
  37. package/dist/components/Button/buttonTheme.d.cts.map +1 -1
  38. package/dist/components/Button/buttonTheme.d.ts +13 -6
  39. package/dist/components/Button/buttonTheme.d.ts.map +1 -1
  40. package/dist/components/Button/buttonTheme.js +16 -8
  41. package/dist/components/Button/buttonTheme.js.map +1 -1
  42. package/dist/components/Button.cjs +25 -11
  43. package/dist/components/Button.d.cts.map +1 -1
  44. package/dist/components/Button.d.ts.map +1 -1
  45. package/dist/components/Button.js +25 -11
  46. package/dist/components/Button.js.map +1 -1
  47. package/dist/components/Checkbox.cjs +16 -6
  48. package/dist/components/Checkbox.d.cts.map +1 -1
  49. package/dist/components/Checkbox.d.ts.map +1 -1
  50. package/dist/components/Checkbox.js +16 -6
  51. package/dist/components/Checkbox.js.map +1 -1
  52. package/dist/components/Chip/ChipBase.cjs +24 -21
  53. package/dist/components/Chip/ChipBase.js +24 -21
  54. package/dist/components/Chip/ChipBase.js.map +1 -1
  55. package/dist/components/Icon.cjs +22 -6
  56. package/dist/components/Icon.d.cts +6 -5
  57. package/dist/components/Icon.d.cts.map +1 -1
  58. package/dist/components/Icon.d.ts +6 -5
  59. package/dist/components/Icon.d.ts.map +1 -1
  60. package/dist/components/Icon.js +22 -6
  61. package/dist/components/Icon.js.map +1 -1
  62. package/dist/components/IconButton.cjs +17 -6
  63. package/dist/components/IconButton.d.cts +6 -0
  64. package/dist/components/IconButton.d.cts.map +1 -1
  65. package/dist/components/IconButton.d.ts +6 -0
  66. package/dist/components/IconButton.d.ts.map +1 -1
  67. package/dist/components/IconButton.js +18 -7
  68. package/dist/components/IconButton.js.map +1 -1
  69. package/dist/components/Input.cjs +56 -18
  70. package/dist/components/Input.d.cts +5 -0
  71. package/dist/components/Input.d.cts.map +1 -1
  72. package/dist/components/Input.d.ts +5 -0
  73. package/dist/components/Input.d.ts.map +1 -1
  74. package/dist/components/Input.js +56 -18
  75. package/dist/components/Input.js.map +1 -1
  76. package/dist/components/InputHelpText.cjs +7 -1
  77. package/dist/components/InputHelpText.d.cts +2 -0
  78. package/dist/components/InputHelpText.d.cts.map +1 -1
  79. package/dist/components/InputHelpText.d.ts +2 -0
  80. package/dist/components/InputHelpText.d.ts.map +1 -1
  81. package/dist/components/InputHelpText.js +7 -1
  82. package/dist/components/InputHelpText.js.map +1 -1
  83. package/dist/components/Link.cjs +16 -1
  84. package/dist/components/Link.d.cts +6 -0
  85. package/dist/components/Link.d.cts.map +1 -1
  86. package/dist/components/Link.d.ts +6 -0
  87. package/dist/components/Link.d.ts.map +1 -1
  88. package/dist/components/Link.js +16 -1
  89. package/dist/components/Link.js.map +1 -1
  90. package/dist/components/Pagination/Pagination.cjs +18 -10
  91. package/dist/components/Pagination/Pagination.d.cts +2 -0
  92. package/dist/components/Pagination/Pagination.d.cts.map +1 -1
  93. package/dist/components/Pagination/Pagination.d.ts +2 -0
  94. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  95. package/dist/components/Pagination/Pagination.js +18 -10
  96. package/dist/components/Pagination/Pagination.js.map +1 -1
  97. package/dist/components/Pagination/PaginationEllipsis.cjs +8 -2
  98. package/dist/components/Pagination/PaginationEllipsis.d.cts.map +1 -1
  99. package/dist/components/Pagination/PaginationEllipsis.d.ts.map +1 -1
  100. package/dist/components/Pagination/PaginationEllipsis.js +9 -3
  101. package/dist/components/Pagination/PaginationEllipsis.js.map +1 -1
  102. package/dist/components/Pagination/PaginationItem.cjs +2 -1
  103. package/dist/components/Pagination/PaginationItem.js +2 -1
  104. package/dist/components/Pagination/PaginationItem.js.map +1 -1
  105. package/dist/components/Pagination/PaginationLink.cjs +2 -1
  106. package/dist/components/Pagination/PaginationLink.js +2 -1
  107. package/dist/components/Pagination/PaginationLink.js.map +1 -1
  108. package/dist/components/Pagination/PaginationNext.cjs +3 -1
  109. package/dist/components/Pagination/PaginationNext.js +3 -1
  110. package/dist/components/Pagination/PaginationNext.js.map +1 -1
  111. package/dist/components/Pagination/PaginationPrev.cjs +3 -1
  112. package/dist/components/Pagination/PaginationPrev.js +3 -1
  113. package/dist/components/Pagination/PaginationPrev.js.map +1 -1
  114. package/dist/components/Pagination/paginationContext.d.cts +2 -0
  115. package/dist/components/Pagination/paginationContext.d.cts.map +1 -1
  116. package/dist/components/Pagination/paginationContext.d.ts +2 -0
  117. package/dist/components/Pagination/paginationContext.d.ts.map +1 -1
  118. package/dist/components/Pagination/paginationContext.js.map +1 -1
  119. package/dist/components/Pagination/usePaginationControlStyles.cjs +8 -1
  120. package/dist/components/Pagination/usePaginationControlStyles.d.cts.map +1 -1
  121. package/dist/components/Pagination/usePaginationControlStyles.d.ts.map +1 -1
  122. package/dist/components/Pagination/usePaginationControlStyles.js +9 -2
  123. package/dist/components/Pagination/usePaginationControlStyles.js.map +1 -1
  124. package/dist/components/Radio/Radio.cjs +4 -3
  125. package/dist/components/Radio/Radio.js +4 -3
  126. package/dist/components/Radio/Radio.js.map +1 -1
  127. package/dist/components/Select/Select.cjs +29 -6
  128. package/dist/components/Select/Select.d.cts +2 -0
  129. package/dist/components/Select/Select.d.cts.map +1 -1
  130. package/dist/components/Select/Select.d.ts +2 -0
  131. package/dist/components/Select/Select.d.ts.map +1 -1
  132. package/dist/components/Select/Select.js +29 -6
  133. package/dist/components/Select/Select.js.map +1 -1
  134. package/dist/components/Select/SelectContent.cjs +31 -23
  135. package/dist/components/Select/SelectContent.d.cts.map +1 -1
  136. package/dist/components/Select/SelectContent.d.ts.map +1 -1
  137. package/dist/components/Select/SelectContent.js +32 -24
  138. package/dist/components/Select/SelectContent.js.map +1 -1
  139. package/dist/components/Select/SelectItem.cjs +25 -15
  140. package/dist/components/Select/SelectItem.d.cts.map +1 -1
  141. package/dist/components/Select/SelectItem.d.ts.map +1 -1
  142. package/dist/components/Select/SelectItem.js +25 -15
  143. package/dist/components/Select/SelectItem.js.map +1 -1
  144. package/dist/components/Select/SelectTrigger.cjs +27 -13
  145. package/dist/components/Select/SelectTrigger.d.cts.map +1 -1
  146. package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
  147. package/dist/components/Select/SelectTrigger.js +27 -13
  148. package/dist/components/Select/SelectTrigger.js.map +1 -1
  149. package/dist/components/Select/types.d.cts +2 -0
  150. package/dist/components/Select/types.d.cts.map +1 -1
  151. package/dist/components/Select/types.d.ts +2 -0
  152. package/dist/components/Select/types.d.ts.map +1 -1
  153. package/dist/components/Switch.cjs +31 -14
  154. package/dist/components/Switch.d.cts.map +1 -1
  155. package/dist/components/Switch.d.ts.map +1 -1
  156. package/dist/components/Switch.js +31 -14
  157. package/dist/components/Switch.js.map +1 -1
  158. package/dist/components/Tabs/Tab.cjs +8 -4
  159. package/dist/components/Tabs/Tab.d.cts.map +1 -1
  160. package/dist/components/Tabs/Tab.d.ts.map +1 -1
  161. package/dist/components/Tabs/Tab.js +8 -4
  162. package/dist/components/Tabs/Tab.js.map +1 -1
  163. package/dist/components/Text.cjs +5 -0
  164. package/dist/components/Text.d.cts +6 -5
  165. package/dist/components/Text.d.cts.map +1 -1
  166. package/dist/components/Text.d.ts +6 -5
  167. package/dist/components/Text.d.ts.map +1 -1
  168. package/dist/components/Text.js +5 -0
  169. package/dist/components/Text.js.map +1 -1
  170. package/dist/components/UDSProvider.cjs +1 -1
  171. package/dist/components/UDSProvider.d.cts +4 -3
  172. package/dist/components/UDSProvider.d.cts.map +1 -1
  173. package/dist/components/UDSProvider.d.ts +4 -3
  174. package/dist/components/UDSProvider.d.ts.map +1 -1
  175. package/dist/components/UDSProvider.js +1 -1
  176. package/dist/components/UDSProvider.js.map +1 -1
  177. package/dist/fontScaling/FontScalingContext.cjs +35 -3
  178. package/dist/fontScaling/FontScalingContext.d.cts +20 -5
  179. package/dist/fontScaling/FontScalingContext.d.cts.map +1 -1
  180. package/dist/fontScaling/FontScalingContext.d.ts +20 -5
  181. package/dist/fontScaling/FontScalingContext.d.ts.map +1 -1
  182. package/dist/fontScaling/FontScalingContext.js +34 -5
  183. package/dist/fontScaling/FontScalingContext.js.map +1 -1
  184. package/dist/fontScaling/androidNonlinearFontScaling.cjs +250 -0
  185. package/dist/fontScaling/androidNonlinearFontScaling.d.cts +7 -0
  186. package/dist/fontScaling/androidNonlinearFontScaling.d.cts.map +1 -0
  187. package/dist/fontScaling/androidNonlinearFontScaling.d.ts +7 -0
  188. package/dist/fontScaling/androidNonlinearFontScaling.d.ts.map +1 -0
  189. package/dist/fontScaling/androidNonlinearFontScaling.js +251 -0
  190. package/dist/fontScaling/androidNonlinearFontScaling.js.map +1 -0
  191. package/dist/fontScaling/constants.cjs +37 -3
  192. package/dist/fontScaling/constants.d.cts +15 -4
  193. package/dist/fontScaling/constants.d.cts.map +1 -1
  194. package/dist/fontScaling/constants.d.ts +15 -4
  195. package/dist/fontScaling/constants.d.ts.map +1 -1
  196. package/dist/fontScaling/constants.js +37 -4
  197. package/dist/fontScaling/constants.js.map +1 -1
  198. package/dist/fontScaling/index.cjs +2 -1
  199. package/dist/fontScaling/index.d.cts +2 -2
  200. package/dist/fontScaling/index.d.ts +2 -2
  201. package/dist/fontScaling/index.js +3 -3
  202. package/dist/fontScaling/resolveMaxFontSizeMultiplier.cjs +1 -2
  203. package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts +1 -2
  204. package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts.map +1 -1
  205. package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts +1 -2
  206. package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts.map +1 -1
  207. package/dist/fontScaling/resolveMaxFontSizeMultiplier.js +1 -2
  208. package/dist/fontScaling/resolveMaxFontSizeMultiplier.js.map +1 -1
  209. package/dist/fontScaling/types.d.cts +11 -8
  210. package/dist/fontScaling/types.d.cts.map +1 -1
  211. package/dist/fontScaling/types.d.ts +11 -8
  212. package/dist/fontScaling/types.d.ts.map +1 -1
  213. package/dist/fontScaling/useFontScale.cjs +30 -4
  214. package/dist/fontScaling/useFontScale.d.cts +6 -12
  215. package/dist/fontScaling/useFontScale.d.cts.map +1 -1
  216. package/dist/fontScaling/useFontScale.d.ts +6 -12
  217. package/dist/fontScaling/useFontScale.d.ts.map +1 -1
  218. package/dist/fontScaling/useFontScale.js +31 -6
  219. package/dist/fontScaling/useFontScale.js.map +1 -1
  220. package/dist/jest/mocks/styles.cjs +14 -1
  221. package/dist/jest/mocks/styles.d.cts.map +1 -1
  222. package/dist/jest/mocks/styles.d.ts.map +1 -1
  223. package/dist/jest/mocks/styles.js +14 -1
  224. package/dist/jest/mocks/styles.js.map +1 -1
  225. package/dist/mobile/generated/fontMetrics.cjs +534 -534
  226. package/dist/mobile/generated/fontMetrics.js +534 -534
  227. package/dist/mobile/generated/fontMetrics.js.map +1 -1
  228. package/dist/portal.cjs +8 -2
  229. package/dist/portal.d.cts.map +1 -1
  230. package/dist/portal.d.ts.map +1 -1
  231. package/dist/portal.js +8 -2
  232. package/dist/portal.js.map +1 -1
  233. package/fonts/index.cjs +214 -214
  234. package/fonts/index.mjs +214 -214
  235. package/fonts/uds-icons.ttf +0 -0
  236. package/generated/fontMetrics.ts +534 -534
  237. package/package.json +2 -2
package/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  - [Quick Start](#quick-start)
8
8
  - [Components](#components)
9
9
  - [Icons](#icons)
10
+ - [Accessibility and Text Scaling](#accessibility-and-text-scaling)
10
11
  - [Fonts](#fonts)
11
12
  - [CLI](#cli)
12
13
  - [Testing](#testing)
@@ -17,11 +18,12 @@
17
18
 
18
19
  `@yahoo/uds-mobile` brings UDS to React Native. It provides:
19
20
 
20
- - **Pre-built Components**: Avatar, Badge, Button, Checkbox, Chip, Divider, Icon, IconButton, Image, Input, InputHelpText, Link, Radio, RadioGroup, Switch, Tabs, Text, and layout primitives (Box, VStack, HStack, Screen)
21
+ - **Pre-built Components**: Avatar, Badge, Button, Checkbox, Chip, Divider, Icon, IconButton, Image, Input, InputHelpText, Link, Pagination, Radio, RadioGroup, Select, Switch, Tabs, Text, and layout primitives (Box, VStack, HStack, Screen)
21
22
  - **Theming**: Full light/dark mode support with automatic system preference detection
22
23
  - **Design Token Integration**: Colors, typography, spacing, and motion configs synced from UDS tokens
23
24
  - **Animations**: Smooth, physics-based animations using Reanimated with motion parity to web
24
25
  - **Icon Support**: Icon font and SVG icon rendering with full UDS icon library
26
+ - **Dynamic Type**: Text, icons, and bounded controls respond to system text-size settings
25
27
 
26
28
  ### Key Dependencies
27
29
 
@@ -476,6 +478,40 @@ const animatedStyle = useAnimatedStyle(() => ({
476
478
  }));
477
479
  ```
478
480
 
481
+ ## Accessibility and Text Scaling
482
+
483
+ UDS Mobile automatically scales text, font icons, multicolor SVG icons, and supported control
484
+ geometry with the iOS and Android system text-size settings. Every text style caps at 2x or below by
485
+ default, with the largest display and title styles tapering further.
486
+
487
+ Most apps need no configuration. To override the defaults, pass a stable configuration object to
488
+ `UDSGestureProvider`:
489
+
490
+ ```tsx
491
+ import type { FontScalingConfig } from '@yahoo/uds-mobile/fontScaling';
492
+ import { UDSGestureProvider } from '@yahoo/uds-mobile/UDSGestureProvider';
493
+
494
+ const FONT_SCALING: FontScalingConfig = {
495
+ variants: { body1: null }, // Let body text follow the system without a cap
496
+ control: 2,
497
+ };
498
+
499
+ <UDSGestureProvider fontScaling={FONT_SCALING}>
500
+ <App />
501
+ </UDSGestureProvider>;
502
+ ```
503
+
504
+ See the [Accessibility and text scaling guide](https://uds.build/docs/mobile/accessibility) for the
505
+ default cap table, per-component overrides, custom-component hooks, known limits, and device test
506
+ matrix.
507
+
508
+ When upgrading from manual scaling workarounds, remove app-level geometry multiplication only after
509
+ comparing the screen with UDS defaults; applying both can make controls oversized. App-owned
510
+ composite controls should use `useFontScale(cap, baseSize)`. As a temporary rollback,
511
+ `fontScaling={{ enabled: false }}` restores the pre-feature behavior: native text scaling remains,
512
+ while UDS-added caps, ramps, multicolor-icon scaling, and control geometry growth are disabled.
513
+ An explicit `maxFontSizeMultiplier` on a component still opts that component back into scaling.
514
+
479
515
  ## Fonts
480
516
 
481
517
  ### Font Handling
@@ -2,26 +2,31 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../_virtual/_rolldown/runtime.cjs");
4
4
  const require_components_Box = require("../Box.cjs");
5
+ const require_fontScaling_useMaxFontSizeMultiplier = require("../../fontScaling/useMaxFontSizeMultiplier.cjs");
5
6
  const require_components_IconSlot = require("../IconSlot.cjs");
7
+ const require_components_Avatar_useAvatarFontScale = require("./useAvatarFontScale.cjs");
6
8
  const require_components_Avatar_utils = require("./utils.cjs");
7
9
  let react = require("react");
8
10
  let react_native = require("react-native");
9
11
  let react_jsx_runtime = require("react/jsx-runtime");
10
12
  let generated_styles = require("../../../generated/styles");
11
13
  //#region src/components/Avatar/AvatarIcon.tsx
12
- const AvatarIcon = (0, react.memo)(function AvatarIcon({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, icon, customSize, style, accessibilityLabel, alt, ref, ...viewProps }) {
14
+ const AvatarIcon = (0, react.memo)(function AvatarIcon({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, icon, customSize, maxFontSizeMultiplier, style, accessibilityLabel, alt, ref, ...viewProps }) {
15
+ const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
13
16
  generated_styles.avatarStyles.useVariants({
14
17
  size,
15
18
  icon: variant
16
19
  });
20
+ const fontScaleFactor = require_components_Avatar_useAvatarFontScale.useAvatarFontScale(resolvedMaxFontSizeMultiplier);
17
21
  const rootStyle = (0, react.useMemo)(() => [
18
22
  generated_styles.avatarStyles.root,
19
23
  avatarStaticStyles.root,
20
- require_components_Avatar_utils.getAvatarCustomSizeStyle(customSize),
24
+ require_components_Avatar_utils.getAvatarSizeStyle(generated_styles.avatarStyles.root, customSize, fontScaleFactor),
21
25
  style
22
26
  ], [
23
27
  generated_styles.avatarStyles.root,
24
28
  customSize,
29
+ fontScaleFactor,
25
30
  style
26
31
  ]);
27
32
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
@@ -33,6 +38,7 @@ const AvatarIcon = (0, react.memo)(function AvatarIcon({ size = "md", variant =
33
38
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
34
39
  icon: icon ?? require_components_Avatar_utils.getDefaultAvatarIcon(variant),
35
40
  variant: "fill",
41
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
36
42
  style: generated_styles.avatarStyles.icon
37
43
  })
38
44
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.d.cts","names":[],"sources":["../../../src/components/Avatar/AvatarIcon.tsx"],"mappings":";;;;;cAcM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
1
+ {"version":3,"file":"AvatarIcon.d.cts","names":[],"sources":["../../../src/components/Avatar/AvatarIcon.tsx"],"mappings":";;;;;cAgBM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.d.ts","names":[],"sources":["../../../src/components/Avatar/AvatarIcon.tsx"],"mappings":";;;;;cAcM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
1
+ {"version":3,"file":"AvatarIcon.d.ts","names":[],"sources":["../../../src/components/Avatar/AvatarIcon.tsx"],"mappings":";;;;;cAgBM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
@@ -1,25 +1,30 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
2
  import { Box } from "../Box.js";
3
+ import { useMaxFontSizeMultiplier } from "../../fontScaling/useMaxFontSizeMultiplier.js";
3
4
  import { IconSlot } from "../IconSlot.js";
4
- import { DEFAULT_AVATAR_VARIANT, getAvatarCustomSizeStyle, getDefaultAvatarIcon } from "./utils.js";
5
+ import { useAvatarFontScale } from "./useAvatarFontScale.js";
6
+ import { DEFAULT_AVATAR_VARIANT, getAvatarSizeStyle, getDefaultAvatarIcon } from "./utils.js";
5
7
  import { memo, useMemo } from "react";
6
8
  import { StyleSheet } from "react-native";
7
9
  import { jsx } from "react/jsx-runtime";
8
10
  import { avatarStyles } from "../../../generated/styles";
9
11
  //#region src/components/Avatar/AvatarIcon.tsx
10
- const AvatarIcon = memo(function AvatarIcon({ size = "md", variant = DEFAULT_AVATAR_VARIANT, icon, customSize, style, accessibilityLabel, alt, ref, ...viewProps }) {
12
+ const AvatarIcon = memo(function AvatarIcon({ size = "md", variant = DEFAULT_AVATAR_VARIANT, icon, customSize, maxFontSizeMultiplier, style, accessibilityLabel, alt, ref, ...viewProps }) {
13
+ const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
11
14
  avatarStyles.useVariants({
12
15
  size,
13
16
  icon: variant
14
17
  });
18
+ const fontScaleFactor = useAvatarFontScale(resolvedMaxFontSizeMultiplier);
15
19
  const rootStyle = useMemo(() => [
16
20
  avatarStyles.root,
17
21
  avatarStaticStyles.root,
18
- getAvatarCustomSizeStyle(customSize),
22
+ getAvatarSizeStyle(avatarStyles.root, customSize, fontScaleFactor),
19
23
  style
20
24
  ], [
21
25
  avatarStyles.root,
22
26
  customSize,
27
+ fontScaleFactor,
23
28
  style
24
29
  ]);
25
30
  return /* @__PURE__ */ jsx(Box, {
@@ -31,6 +36,7 @@ const AvatarIcon = memo(function AvatarIcon({ size = "md", variant = DEFAULT_AVA
31
36
  children: /* @__PURE__ */ jsx(IconSlot, {
32
37
  icon: icon ?? getDefaultAvatarIcon(variant),
33
38
  variant: "fill",
39
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
34
40
  style: avatarStyles.icon
35
41
  })
36
42
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarIcon.js","names":[],"sources":["../../../src/components/Avatar/AvatarIcon.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { Box } from '../Box';\nimport { IconSlot } from '../IconSlot';\nimport type { AvatarIconProps } from './types';\nimport {\n DEFAULT_AVATAR_SIZE,\n DEFAULT_AVATAR_VARIANT,\n getAvatarCustomSizeStyle,\n getDefaultAvatarIcon,\n} from './utils';\n\nconst AvatarIcon = memo(function AvatarIcon({\n size = DEFAULT_AVATAR_SIZE,\n variant = DEFAULT_AVATAR_VARIANT,\n icon,\n customSize,\n style,\n accessibilityLabel,\n alt,\n ref,\n ...viewProps\n}: AvatarIconProps) {\n avatarStyles.useVariants({ size, icon: variant });\n\n const rootStyle = useMemo(\n () => [avatarStyles.root, avatarStaticStyles.root, getAvatarCustomSizeStyle(customSize), style],\n [avatarStyles.root, customSize, style],\n );\n\n return (\n <Box\n ref={ref}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel ?? alt}\n {...viewProps}\n style={rootStyle}\n >\n <IconSlot\n icon={icon ?? getDefaultAvatarIcon(variant)}\n variant=\"fill\"\n style={avatarStyles.icon}\n />\n </Box>\n );\n});\n\nAvatarIcon.displayName = 'AvatarIcon';\n\nconst avatarStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n },\n});\n\nexport { AvatarIcon };\n"],"mappings":";;;;;;;;;AAcA,MAAM,aAAa,KAAK,SAAS,WAAW,EAC1C,OAAA,MACA,UAAU,wBACV,MACA,YACA,OACA,oBACA,KACA,KACA,GAAG,aACe;CAClB,aAAa,YAAY;EAAE;EAAM,MAAM;EAAS,CAAC;CAEjD,MAAM,YAAY,cACV;EAAC,aAAa;EAAM,mBAAmB;EAAM,yBAAyB,WAAW;EAAE;EAAM,EAC/F;EAAC,aAAa;EAAM;EAAY;EAAM,CACvC;CAED,OACE,oBAAC,KAAD;EACO;EACL,mBAAkB;EAClB,oBAAoB,sBAAsB;EAC1C,GAAI;EACJ,OAAO;YAEP,oBAAC,UAAD;GACE,MAAM,QAAQ,qBAAqB,QAAQ;GAC3C,SAAQ;GACR,OAAO,aAAa;GACpB,CAAA;EACE,CAAA;EAER;AAEF,WAAW,cAAc;AAEzB,MAAM,qBAAqB,WAAW,OAAO,EAC3C,MAAM;CACJ,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACX,EACF,CAAC"}
1
+ {"version":3,"file":"AvatarIcon.js","names":[],"sources":["../../../src/components/Avatar/AvatarIcon.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { useMaxFontSizeMultiplier } from '../../fontScaling/useMaxFontSizeMultiplier';\nimport { Box } from '../Box';\nimport { IconSlot } from '../IconSlot';\nimport type { AvatarIconProps } from './types';\nimport { useAvatarFontScale } from './useAvatarFontScale';\nimport {\n DEFAULT_AVATAR_SIZE,\n DEFAULT_AVATAR_VARIANT,\n getAvatarSizeStyle,\n getDefaultAvatarIcon,\n} from './utils';\n\nconst AvatarIcon = memo(function AvatarIcon({\n size = DEFAULT_AVATAR_SIZE,\n variant = DEFAULT_AVATAR_VARIANT,\n icon,\n customSize,\n maxFontSizeMultiplier,\n style,\n accessibilityLabel,\n alt,\n ref,\n ...viewProps\n}: AvatarIconProps) {\n const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier('control', maxFontSizeMultiplier);\n avatarStyles.useVariants({ size, icon: variant });\n const fontScaleFactor = useAvatarFontScale(resolvedMaxFontSizeMultiplier);\n\n const rootStyle = useMemo(\n () => [\n avatarStyles.root,\n avatarStaticStyles.root,\n getAvatarSizeStyle(avatarStyles.root, customSize, fontScaleFactor),\n style,\n ],\n [avatarStyles.root, customSize, fontScaleFactor, style],\n );\n\n return (\n <Box\n ref={ref}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel ?? alt}\n {...viewProps}\n style={rootStyle}\n >\n <IconSlot\n icon={icon ?? getDefaultAvatarIcon(variant)}\n variant=\"fill\"\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={avatarStyles.icon}\n />\n </Box>\n );\n});\n\nAvatarIcon.displayName = 'AvatarIcon';\n\nconst avatarStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n },\n});\n\nexport { AvatarIcon };\n"],"mappings":";;;;;;;;;;;AAgBA,MAAM,aAAa,KAAK,SAAS,WAAW,EAC1C,OAAA,MACA,UAAU,wBACV,MACA,YACA,uBACA,OACA,oBACA,KACA,KACA,GAAG,aACe;CAClB,MAAM,gCAAgC,yBAAyB,WAAW,sBAAsB;CAChG,aAAa,YAAY;EAAE;EAAM,MAAM;EAAS,CAAC;CACjD,MAAM,kBAAkB,mBAAmB,8BAA8B;CAEzE,MAAM,YAAY,cACV;EACJ,aAAa;EACb,mBAAmB;EACnB,mBAAmB,aAAa,MAAM,YAAY,gBAAgB;EAClE;EACD,EACD;EAAC,aAAa;EAAM;EAAY;EAAiB;EAAM,CACxD;CAED,OACE,oBAAC,KAAD;EACO;EACL,mBAAkB;EAClB,oBAAoB,sBAAsB;EAC1C,GAAI;EACJ,OAAO;YAEP,oBAAC,UAAD;GACE,MAAM,QAAQ,qBAAqB,QAAQ;GAC3C,SAAQ;GACR,uBAAuB;GACvB,OAAO,aAAa;GACpB,CAAA;EACE,CAAA;EAER;AAEF,WAAW,cAAc;AAEzB,MAAM,qBAAqB,WAAW,OAAO,EAC3C,MAAM;CACJ,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACX,EACF,CAAC"}
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../_virtual/_rolldown/runtime.cjs");
4
4
  const require_components_Box = require("../Box.cjs");
5
+ const require_fontScaling_useMaxFontSizeMultiplier = require("../../fontScaling/useMaxFontSizeMultiplier.cjs");
6
+ const require_components_Avatar_useAvatarFontScale = require("./useAvatarFontScale.cjs");
5
7
  const require_components_Avatar_utils = require("./utils.cjs");
6
8
  const require_components_Avatar_AvatarIcon = require("./AvatarIcon.cjs");
7
9
  const require_components_Avatar_AvatarText = require("./AvatarText.cjs");
@@ -10,21 +12,24 @@ let react_native = require("react-native");
10
12
  let react_jsx_runtime = require("react/jsx-runtime");
11
13
  let generated_styles = require("../../../generated/styles");
12
14
  //#region src/components/Avatar/AvatarImage.tsx
13
- const AvatarImage = (0, react.memo)(function AvatarImage({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, src, alt, fallback, icon, abbreviationStrategy, customSize, style, accessibilityLabel, ref, ...viewProps }) {
15
+ const AvatarImage = (0, react.memo)(function AvatarImage({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, src, alt, fallback, icon, abbreviationStrategy, customSize, maxFontSizeMultiplier, style, accessibilityLabel, ref, ...viewProps }) {
16
+ const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
14
17
  const [imageError, setImageError] = (0, react.useState)(false);
15
18
  const shouldShowImage = Boolean(src) && !imageError;
16
19
  generated_styles.avatarStyles.useVariants({
17
20
  size,
18
21
  image: variant
19
22
  });
23
+ const fontScaleFactor = require_components_Avatar_useAvatarFontScale.useAvatarFontScale(resolvedMaxFontSizeMultiplier);
20
24
  const rootStyle = (0, react.useMemo)(() => [
21
25
  generated_styles.avatarStyles.root,
22
26
  avatarStaticStyles.root,
23
- require_components_Avatar_utils.getAvatarCustomSizeStyle(customSize),
27
+ require_components_Avatar_utils.getAvatarSizeStyle(generated_styles.avatarStyles.root, customSize, fontScaleFactor),
24
28
  style
25
29
  ], [
26
30
  generated_styles.avatarStyles.root,
27
31
  customSize,
32
+ fontScaleFactor,
28
33
  style
29
34
  ]);
30
35
  if (!shouldShowImage) {
@@ -36,6 +41,7 @@ const AvatarImage = (0, react.memo)(function AvatarImage({ size = "md", variant
36
41
  initials: fallback,
37
42
  abbreviationStrategy,
38
43
  customSize,
44
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
39
45
  accessibilityLabel: accessibilityLabel ?? alt ?? fallback,
40
46
  style,
41
47
  ...viewProps
@@ -46,6 +52,7 @@ const AvatarImage = (0, react.memo)(function AvatarImage({ size = "md", variant
46
52
  variant,
47
53
  icon,
48
54
  customSize,
55
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
49
56
  accessibilityLabel: accessibilityLabel ?? alt,
50
57
  style,
51
58
  ...viewProps
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarImage.d.cts","names":[],"sources":["../../../src/components/Avatar/AvatarImage.tsx"],"mappings":";;;;;cAUM,WAAA,EAAW,OAAA,CAAA,oBAAA,CAAA,gBAAA"}
1
+ {"version":3,"file":"AvatarImage.d.cts","names":[],"sources":["../../../src/components/Avatar/AvatarImage.tsx"],"mappings":";;;;;cAYM,WAAA,EAAW,OAAA,CAAA,oBAAA,CAAA,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarImage.d.ts","names":[],"sources":["../../../src/components/Avatar/AvatarImage.tsx"],"mappings":";;;;;cAUM,WAAA,EAAW,OAAA,CAAA,oBAAA,CAAA,gBAAA"}
1
+ {"version":3,"file":"AvatarImage.d.ts","names":[],"sources":["../../../src/components/Avatar/AvatarImage.tsx"],"mappings":";;;;;cAYM,WAAA,EAAW,OAAA,CAAA,oBAAA,CAAA,gBAAA"}
@@ -1,6 +1,8 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
2
  import { Box } from "../Box.js";
3
- import { DEFAULT_AVATAR_VARIANT, getAvatarCustomSizeStyle } from "./utils.js";
3
+ import { useMaxFontSizeMultiplier } from "../../fontScaling/useMaxFontSizeMultiplier.js";
4
+ import { useAvatarFontScale } from "./useAvatarFontScale.js";
5
+ import { DEFAULT_AVATAR_VARIANT, getAvatarSizeStyle } from "./utils.js";
4
6
  import { AvatarIcon } from "./AvatarIcon.js";
5
7
  import { AvatarText } from "./AvatarText.js";
6
8
  import { memo, useMemo, useState } from "react";
@@ -8,21 +10,24 @@ import { Image, StyleSheet } from "react-native";
8
10
  import { jsx } from "react/jsx-runtime";
9
11
  import { avatarStyles } from "../../../generated/styles";
10
12
  //#region src/components/Avatar/AvatarImage.tsx
11
- const AvatarImage = memo(function AvatarImage({ size = "md", variant = DEFAULT_AVATAR_VARIANT, src, alt, fallback, icon, abbreviationStrategy, customSize, style, accessibilityLabel, ref, ...viewProps }) {
13
+ const AvatarImage = memo(function AvatarImage({ size = "md", variant = DEFAULT_AVATAR_VARIANT, src, alt, fallback, icon, abbreviationStrategy, customSize, maxFontSizeMultiplier, style, accessibilityLabel, ref, ...viewProps }) {
14
+ const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
12
15
  const [imageError, setImageError] = useState(false);
13
16
  const shouldShowImage = Boolean(src) && !imageError;
14
17
  avatarStyles.useVariants({
15
18
  size,
16
19
  image: variant
17
20
  });
21
+ const fontScaleFactor = useAvatarFontScale(resolvedMaxFontSizeMultiplier);
18
22
  const rootStyle = useMemo(() => [
19
23
  avatarStyles.root,
20
24
  avatarStaticStyles.root,
21
- getAvatarCustomSizeStyle(customSize),
25
+ getAvatarSizeStyle(avatarStyles.root, customSize, fontScaleFactor),
22
26
  style
23
27
  ], [
24
28
  avatarStyles.root,
25
29
  customSize,
30
+ fontScaleFactor,
26
31
  style
27
32
  ]);
28
33
  if (!shouldShowImage) {
@@ -34,6 +39,7 @@ const AvatarImage = memo(function AvatarImage({ size = "md", variant = DEFAULT_A
34
39
  initials: fallback,
35
40
  abbreviationStrategy,
36
41
  customSize,
42
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
37
43
  accessibilityLabel: accessibilityLabel ?? alt ?? fallback,
38
44
  style,
39
45
  ...viewProps
@@ -44,6 +50,7 @@ const AvatarImage = memo(function AvatarImage({ size = "md", variant = DEFAULT_A
44
50
  variant,
45
51
  icon,
46
52
  customSize,
53
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
47
54
  accessibilityLabel: accessibilityLabel ?? alt,
48
55
  style,
49
56
  ...viewProps
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarImage.js","names":["RNImage"],"sources":["../../../src/components/Avatar/AvatarImage.tsx"],"sourcesContent":["import { memo, useMemo, useState } from 'react';\nimport { Image as RNImage, StyleSheet } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { Box } from '../Box';\nimport { AvatarIcon } from './AvatarIcon';\nimport { AvatarText } from './AvatarText';\nimport type { AvatarImageProps } from './types';\nimport { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, getAvatarCustomSizeStyle } from './utils';\n\nconst AvatarImage = memo(function AvatarImage({\n size = DEFAULT_AVATAR_SIZE,\n variant = DEFAULT_AVATAR_VARIANT,\n src,\n alt,\n fallback,\n icon,\n abbreviationStrategy,\n customSize,\n style,\n accessibilityLabel,\n ref,\n ...viewProps\n}: AvatarImageProps) {\n const [imageError, setImageError] = useState(false);\n const shouldShowImage = Boolean(src) && !imageError;\n\n avatarStyles.useVariants({ size, image: variant });\n\n const rootStyle = useMemo(\n () => [avatarStyles.root, avatarStaticStyles.root, getAvatarCustomSizeStyle(customSize), style],\n [avatarStyles.root, customSize, style],\n );\n\n if (!shouldShowImage) {\n if (fallback || alt) {\n return (\n <AvatarText\n ref={ref}\n size={size}\n variant={variant}\n name={alt}\n initials={fallback}\n abbreviationStrategy={abbreviationStrategy}\n customSize={customSize}\n accessibilityLabel={accessibilityLabel ?? alt ?? fallback}\n style={style}\n {...viewProps}\n />\n );\n }\n\n return (\n <AvatarIcon\n ref={ref}\n size={size}\n variant={variant}\n icon={icon}\n customSize={customSize}\n accessibilityLabel={accessibilityLabel ?? alt}\n style={style}\n {...viewProps}\n />\n );\n }\n\n return (\n <Box\n ref={ref}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel ?? alt}\n {...viewProps}\n style={rootStyle}\n >\n <RNImage\n source={{ uri: src }}\n accessibilityLabel={alt}\n onError={() => setImageError(true)}\n style={avatarStaticStyles.image}\n />\n </Box>\n );\n});\n\nAvatarImage.displayName = 'AvatarImage';\n\nconst avatarStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n});\n\nexport { AvatarImage };\n"],"mappings":";;;;;;;;;;AAUA,MAAM,cAAc,KAAK,SAAS,YAAY,EAC5C,OAAA,MACA,UAAU,wBACV,KACA,KACA,UACA,MACA,sBACA,YACA,OACA,oBACA,KACA,GAAG,aACgB;CACnB,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,kBAAkB,QAAQ,IAAI,IAAI,CAAC;CAEzC,aAAa,YAAY;EAAE;EAAM,OAAO;EAAS,CAAC;CAElD,MAAM,YAAY,cACV;EAAC,aAAa;EAAM,mBAAmB;EAAM,yBAAyB,WAAW;EAAE;EAAM,EAC/F;EAAC,aAAa;EAAM;EAAY;EAAM,CACvC;CAED,IAAI,CAAC,iBAAiB;EACpB,IAAI,YAAY,KACd,OACE,oBAAC,YAAD;GACO;GACC;GACG;GACT,MAAM;GACN,UAAU;GACY;GACV;GACZ,oBAAoB,sBAAsB,OAAO;GAC1C;GACP,GAAI;GACJ,CAAA;EAIN,OACE,oBAAC,YAAD;GACO;GACC;GACG;GACH;GACM;GACZ,oBAAoB,sBAAsB;GACnC;GACP,GAAI;GACJ,CAAA;;CAIN,OACE,oBAAC,KAAD;EACO;EACL,mBAAkB;EAClB,oBAAoB,sBAAsB;EAC1C,GAAI;EACJ,OAAO;YAEP,oBAACA,OAAD;GACE,QAAQ,EAAE,KAAK,KAAK;GACpB,oBAAoB;GACpB,eAAe,cAAc,KAAK;GAClC,OAAO,mBAAmB;GAC1B,CAAA;EACE,CAAA;EAER;AAEF,YAAY,cAAc;AAE1B,MAAM,qBAAqB,WAAW,OAAO;CAC3C,MAAM;EACJ,YAAY;EACZ,gBAAgB;EAChB,UAAU;EACX;CACD,OAAO;EACL,QAAQ;EACR,OAAO;EACR;CACF,CAAC"}
1
+ {"version":3,"file":"AvatarImage.js","names":["RNImage"],"sources":["../../../src/components/Avatar/AvatarImage.tsx"],"sourcesContent":["import { memo, useMemo, useState } from 'react';\nimport { Image as RNImage, StyleSheet } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { useMaxFontSizeMultiplier } from '../../fontScaling/useMaxFontSizeMultiplier';\nimport { Box } from '../Box';\nimport { AvatarIcon } from './AvatarIcon';\nimport { AvatarText } from './AvatarText';\nimport type { AvatarImageProps } from './types';\nimport { useAvatarFontScale } from './useAvatarFontScale';\nimport { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, getAvatarSizeStyle } from './utils';\n\nconst AvatarImage = memo(function AvatarImage({\n size = DEFAULT_AVATAR_SIZE,\n variant = DEFAULT_AVATAR_VARIANT,\n src,\n alt,\n fallback,\n icon,\n abbreviationStrategy,\n customSize,\n maxFontSizeMultiplier,\n style,\n accessibilityLabel,\n ref,\n ...viewProps\n}: AvatarImageProps) {\n const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier('control', maxFontSizeMultiplier);\n const [imageError, setImageError] = useState(false);\n const shouldShowImage = Boolean(src) && !imageError;\n\n avatarStyles.useVariants({ size, image: variant });\n const fontScaleFactor = useAvatarFontScale(resolvedMaxFontSizeMultiplier);\n\n const rootStyle = useMemo(\n () => [\n avatarStyles.root,\n avatarStaticStyles.root,\n getAvatarSizeStyle(avatarStyles.root, customSize, fontScaleFactor),\n style,\n ],\n [avatarStyles.root, customSize, fontScaleFactor, style],\n );\n\n if (!shouldShowImage) {\n if (fallback || alt) {\n return (\n <AvatarText\n ref={ref}\n size={size}\n variant={variant}\n name={alt}\n initials={fallback}\n abbreviationStrategy={abbreviationStrategy}\n customSize={customSize}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n accessibilityLabel={accessibilityLabel ?? alt ?? fallback}\n style={style}\n {...viewProps}\n />\n );\n }\n\n return (\n <AvatarIcon\n ref={ref}\n size={size}\n variant={variant}\n icon={icon}\n customSize={customSize}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n accessibilityLabel={accessibilityLabel ?? alt}\n style={style}\n {...viewProps}\n />\n );\n }\n\n return (\n <Box\n ref={ref}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel ?? alt}\n {...viewProps}\n style={rootStyle}\n >\n <RNImage\n source={{ uri: src }}\n accessibilityLabel={alt}\n onError={() => setImageError(true)}\n style={avatarStaticStyles.image}\n />\n </Box>\n );\n});\n\nAvatarImage.displayName = 'AvatarImage';\n\nconst avatarStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n },\n image: {\n height: '100%',\n width: '100%',\n },\n});\n\nexport { AvatarImage };\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,cAAc,KAAK,SAAS,YAAY,EAC5C,OAAA,MACA,UAAU,wBACV,KACA,KACA,UACA,MACA,sBACA,YACA,uBACA,OACA,oBACA,KACA,GAAG,aACgB;CACnB,MAAM,gCAAgC,yBAAyB,WAAW,sBAAsB;CAChG,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,kBAAkB,QAAQ,IAAI,IAAI,CAAC;CAEzC,aAAa,YAAY;EAAE;EAAM,OAAO;EAAS,CAAC;CAClD,MAAM,kBAAkB,mBAAmB,8BAA8B;CAEzE,MAAM,YAAY,cACV;EACJ,aAAa;EACb,mBAAmB;EACnB,mBAAmB,aAAa,MAAM,YAAY,gBAAgB;EAClE;EACD,EACD;EAAC,aAAa;EAAM;EAAY;EAAiB;EAAM,CACxD;CAED,IAAI,CAAC,iBAAiB;EACpB,IAAI,YAAY,KACd,OACE,oBAAC,YAAD;GACO;GACC;GACG;GACT,MAAM;GACN,UAAU;GACY;GACV;GACZ,uBAAuB;GACvB,oBAAoB,sBAAsB,OAAO;GAC1C;GACP,GAAI;GACJ,CAAA;EAIN,OACE,oBAAC,YAAD;GACO;GACC;GACG;GACH;GACM;GACZ,uBAAuB;GACvB,oBAAoB,sBAAsB;GACnC;GACP,GAAI;GACJ,CAAA;;CAIN,OACE,oBAAC,KAAD;EACO;EACL,mBAAkB;EAClB,oBAAoB,sBAAsB;EAC1C,GAAI;EACJ,OAAO;YAEP,oBAACA,OAAD;GACE,QAAQ,EAAE,KAAK,KAAK;GACpB,oBAAoB;GACpB,eAAe,cAAc,KAAK;GAClC,OAAO,mBAAmB;GAC1B,CAAA;EACE,CAAA;EAER;AAEF,YAAY,cAAc;AAE1B,MAAM,qBAAqB,WAAW,OAAO;CAC3C,MAAM;EACJ,YAAY;EACZ,gBAAgB;EAChB,UAAU;EACX;CACD,OAAO;EACL,QAAQ;EACR,OAAO;EACR;CACF,CAAC"}
@@ -2,26 +2,31 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../../_virtual/_rolldown/runtime.cjs");
4
4
  const require_components_Box = require("../Box.cjs");
5
+ const require_fontScaling_useMaxFontSizeMultiplier = require("../../fontScaling/useMaxFontSizeMultiplier.cjs");
5
6
  const require_components_Text = require("../Text.cjs");
7
+ const require_components_Avatar_useAvatarFontScale = require("./useAvatarFontScale.cjs");
6
8
  const require_components_Avatar_utils = require("./utils.cjs");
7
9
  let react = require("react");
8
10
  let react_native = require("react-native");
9
11
  let react_jsx_runtime = require("react/jsx-runtime");
10
12
  let generated_styles = require("../../../generated/styles");
11
13
  //#region src/components/Avatar/AvatarText.tsx
12
- const AvatarText = (0, react.memo)(function AvatarText({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, name, initials, abbreviationStrategy, customSize, style, accessibilityLabel, ref, ...viewProps }) {
14
+ const AvatarText = (0, react.memo)(function AvatarText({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, name, initials, abbreviationStrategy, customSize, maxFontSizeMultiplier, style, accessibilityLabel, ref, ...viewProps }) {
15
+ const resolvedMaxFontSizeMultiplier = require_fontScaling_useMaxFontSizeMultiplier.useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
13
16
  generated_styles.avatarStyles.useVariants({
14
17
  size,
15
18
  text: variant
16
19
  });
20
+ const fontScaleFactor = require_components_Avatar_useAvatarFontScale.useAvatarFontScale(resolvedMaxFontSizeMultiplier);
17
21
  const rootStyle = (0, react.useMemo)(() => [
18
22
  generated_styles.avatarStyles.root,
19
23
  avatarStaticStyles.root,
20
- require_components_Avatar_utils.getAvatarCustomSizeStyle(customSize),
24
+ require_components_Avatar_utils.getAvatarSizeStyle(generated_styles.avatarStyles.root, customSize, fontScaleFactor),
21
25
  style
22
26
  ], [
23
27
  generated_styles.avatarStyles.root,
24
28
  customSize,
29
+ fontScaleFactor,
25
30
  style
26
31
  ]);
27
32
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
@@ -34,6 +39,7 @@ const AvatarText = (0, react.memo)(function AvatarText({ size = "md", variant =
34
39
  color: "inherit",
35
40
  variant: "inherit",
36
41
  numberOfLines: 1,
42
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
37
43
  style: generated_styles.avatarStyles.text,
38
44
  children: initials || require_components_Avatar_utils.generateAvatarAbbreviation(name, abbreviationStrategy)
39
45
  })
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarText.d.cts","names":[],"sources":["../../../src/components/Avatar/AvatarText.tsx"],"mappings":";;;;;cAcM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
1
+ {"version":3,"file":"AvatarText.d.cts","names":[],"sources":["../../../src/components/Avatar/AvatarText.tsx"],"mappings":";;;;;cAgBM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarText.d.ts","names":[],"sources":["../../../src/components/Avatar/AvatarText.tsx"],"mappings":";;;;;cAcM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
1
+ {"version":3,"file":"AvatarText.d.ts","names":[],"sources":["../../../src/components/Avatar/AvatarText.tsx"],"mappings":";;;;;cAgBM,UAAA,EAAU,OAAA,CAAA,oBAAA,CAAA,eAAA"}
@@ -1,25 +1,30 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
2
  import { Box } from "../Box.js";
3
+ import { useMaxFontSizeMultiplier } from "../../fontScaling/useMaxFontSizeMultiplier.js";
3
4
  import { Text as Text$1 } from "../Text.js";
4
- import { DEFAULT_AVATAR_VARIANT, generateAvatarAbbreviation, getAvatarCustomSizeStyle } from "./utils.js";
5
+ import { useAvatarFontScale } from "./useAvatarFontScale.js";
6
+ import { DEFAULT_AVATAR_VARIANT, generateAvatarAbbreviation, getAvatarSizeStyle } from "./utils.js";
5
7
  import { memo, useMemo } from "react";
6
8
  import { StyleSheet } from "react-native";
7
9
  import { jsx } from "react/jsx-runtime";
8
10
  import { avatarStyles } from "../../../generated/styles";
9
11
  //#region src/components/Avatar/AvatarText.tsx
10
- const AvatarText = memo(function AvatarText({ size = "md", variant = DEFAULT_AVATAR_VARIANT, name, initials, abbreviationStrategy, customSize, style, accessibilityLabel, ref, ...viewProps }) {
12
+ const AvatarText = memo(function AvatarText({ size = "md", variant = DEFAULT_AVATAR_VARIANT, name, initials, abbreviationStrategy, customSize, maxFontSizeMultiplier, style, accessibilityLabel, ref, ...viewProps }) {
13
+ const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier("control", maxFontSizeMultiplier);
11
14
  avatarStyles.useVariants({
12
15
  size,
13
16
  text: variant
14
17
  });
18
+ const fontScaleFactor = useAvatarFontScale(resolvedMaxFontSizeMultiplier);
15
19
  const rootStyle = useMemo(() => [
16
20
  avatarStyles.root,
17
21
  avatarStaticStyles.root,
18
- getAvatarCustomSizeStyle(customSize),
22
+ getAvatarSizeStyle(avatarStyles.root, customSize, fontScaleFactor),
19
23
  style
20
24
  ], [
21
25
  avatarStyles.root,
22
26
  customSize,
27
+ fontScaleFactor,
23
28
  style
24
29
  ]);
25
30
  return /* @__PURE__ */ jsx(Box, {
@@ -32,6 +37,7 @@ const AvatarText = memo(function AvatarText({ size = "md", variant = DEFAULT_AVA
32
37
  color: "inherit",
33
38
  variant: "inherit",
34
39
  numberOfLines: 1,
40
+ maxFontSizeMultiplier: resolvedMaxFontSizeMultiplier,
35
41
  style: avatarStyles.text,
36
42
  children: initials || generateAvatarAbbreviation(name, abbreviationStrategy)
37
43
  })
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarText.js","names":["Text"],"sources":["../../../src/components/Avatar/AvatarText.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { Box } from '../Box';\nimport { Text } from '../Text';\nimport type { AvatarTextProps } from './types';\nimport {\n DEFAULT_AVATAR_SIZE,\n DEFAULT_AVATAR_VARIANT,\n generateAvatarAbbreviation,\n getAvatarCustomSizeStyle,\n} from './utils';\n\nconst AvatarText = memo(function AvatarText({\n size = DEFAULT_AVATAR_SIZE,\n variant = DEFAULT_AVATAR_VARIANT,\n name,\n initials,\n abbreviationStrategy,\n customSize,\n style,\n accessibilityLabel,\n ref,\n ...viewProps\n}: AvatarTextProps) {\n avatarStyles.useVariants({ size, text: variant });\n\n const rootStyle = useMemo(\n () => [avatarStyles.root, avatarStaticStyles.root, getAvatarCustomSizeStyle(customSize), style],\n [avatarStyles.root, customSize, style],\n );\n\n return (\n <Box\n ref={ref}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel ?? name ?? initials}\n {...viewProps}\n style={rootStyle}\n >\n <Text color=\"inherit\" variant=\"inherit\" numberOfLines={1} style={avatarStyles.text}>\n {initials || generateAvatarAbbreviation(name, abbreviationStrategy)}\n </Text>\n </Box>\n );\n});\n\nAvatarText.displayName = 'AvatarText';\n\nconst avatarStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n },\n});\n\nexport { AvatarText };\n"],"mappings":";;;;;;;;;AAcA,MAAM,aAAa,KAAK,SAAS,WAAW,EAC1C,OAAA,MACA,UAAU,wBACV,MACA,UACA,sBACA,YACA,OACA,oBACA,KACA,GAAG,aACe;CAClB,aAAa,YAAY;EAAE;EAAM,MAAM;EAAS,CAAC;CAEjD,MAAM,YAAY,cACV;EAAC,aAAa;EAAM,mBAAmB;EAAM,yBAAyB,WAAW;EAAE;EAAM,EAC/F;EAAC,aAAa;EAAM;EAAY;EAAM,CACvC;CAED,OACE,oBAAC,KAAD;EACO;EACL,mBAAkB;EAClB,oBAAoB,sBAAsB,QAAQ;EAClD,GAAI;EACJ,OAAO;YAEP,oBAACA,QAAD;GAAM,OAAM;GAAU,SAAQ;GAAU,eAAe;GAAG,OAAO,aAAa;aAC3E,YAAY,2BAA2B,MAAM,qBAAqB;GAC9D,CAAA;EACH,CAAA;EAER;AAEF,WAAW,cAAc;AAEzB,MAAM,qBAAqB,WAAW,OAAO,EAC3C,MAAM;CACJ,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACX,EACF,CAAC"}
1
+ {"version":3,"file":"AvatarText.js","names":["Text"],"sources":["../../../src/components/Avatar/AvatarText.tsx"],"sourcesContent":["import { memo, useMemo } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { useMaxFontSizeMultiplier } from '../../fontScaling/useMaxFontSizeMultiplier';\nimport { Box } from '../Box';\nimport { Text } from '../Text';\nimport type { AvatarTextProps } from './types';\nimport { useAvatarFontScale } from './useAvatarFontScale';\nimport {\n DEFAULT_AVATAR_SIZE,\n DEFAULT_AVATAR_VARIANT,\n generateAvatarAbbreviation,\n getAvatarSizeStyle,\n} from './utils';\n\nconst AvatarText = memo(function AvatarText({\n size = DEFAULT_AVATAR_SIZE,\n variant = DEFAULT_AVATAR_VARIANT,\n name,\n initials,\n abbreviationStrategy,\n customSize,\n maxFontSizeMultiplier,\n style,\n accessibilityLabel,\n ref,\n ...viewProps\n}: AvatarTextProps) {\n const resolvedMaxFontSizeMultiplier = useMaxFontSizeMultiplier('control', maxFontSizeMultiplier);\n avatarStyles.useVariants({ size, text: variant });\n const fontScaleFactor = useAvatarFontScale(resolvedMaxFontSizeMultiplier);\n\n const rootStyle = useMemo(\n () => [\n avatarStyles.root,\n avatarStaticStyles.root,\n getAvatarSizeStyle(avatarStyles.root, customSize, fontScaleFactor),\n style,\n ],\n [avatarStyles.root, customSize, fontScaleFactor, style],\n );\n\n return (\n <Box\n ref={ref}\n accessibilityRole=\"image\"\n accessibilityLabel={accessibilityLabel ?? name ?? initials}\n {...viewProps}\n style={rootStyle}\n >\n <Text\n color=\"inherit\"\n variant=\"inherit\"\n numberOfLines={1}\n maxFontSizeMultiplier={resolvedMaxFontSizeMultiplier}\n style={avatarStyles.text}\n >\n {initials || generateAvatarAbbreviation(name, abbreviationStrategy)}\n </Text>\n </Box>\n );\n});\n\nAvatarText.displayName = 'AvatarText';\n\nconst avatarStaticStyles = StyleSheet.create({\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n },\n});\n\nexport { AvatarText };\n"],"mappings":";;;;;;;;;;;AAgBA,MAAM,aAAa,KAAK,SAAS,WAAW,EAC1C,OAAA,MACA,UAAU,wBACV,MACA,UACA,sBACA,YACA,uBACA,OACA,oBACA,KACA,GAAG,aACe;CAClB,MAAM,gCAAgC,yBAAyB,WAAW,sBAAsB;CAChG,aAAa,YAAY;EAAE;EAAM,MAAM;EAAS,CAAC;CACjD,MAAM,kBAAkB,mBAAmB,8BAA8B;CAEzE,MAAM,YAAY,cACV;EACJ,aAAa;EACb,mBAAmB;EACnB,mBAAmB,aAAa,MAAM,YAAY,gBAAgB;EAClE;EACD,EACD;EAAC,aAAa;EAAM;EAAY;EAAiB;EAAM,CACxD;CAED,OACE,oBAAC,KAAD;EACO;EACL,mBAAkB;EAClB,oBAAoB,sBAAsB,QAAQ;EAClD,GAAI;EACJ,OAAO;YAEP,oBAACA,QAAD;GACE,OAAM;GACN,SAAQ;GACR,eAAe;GACf,uBAAuB;GACvB,OAAO,aAAa;aAEnB,YAAY,2BAA2B,MAAM,qBAAqB;GAC9D,CAAA;EACH,CAAA;EAER;AAEF,WAAW,cAAc;AAEzB,MAAM,qBAAqB,WAAW,OAAO,EAC3C,MAAM;CACJ,YAAY;CACZ,gBAAgB;CAChB,UAAU;CACX,EACF,CAAC"}
@@ -5,17 +5,21 @@ import { Ref } from "react";
5
5
  import { View, ViewProps } from "react-native";
6
6
 
7
7
  //#region src/components/Avatar/types.d.ts
8
- interface AvatarImageProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarImageProps, 'className' | 'srcSet'> {
8
+ interface AvatarFontScalingProps {
9
+ /** Caps avatar content and geometry at the control scale. Set null to remove the cap. @default 2 */
10
+ maxFontSizeMultiplier?: number | null;
11
+ }
12
+ interface AvatarImageProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarImageProps, 'className' | 'srcSet'>, AvatarFontScalingProps {
9
13
  /** Ref to the underlying View. */
10
14
  ref?: Ref<View>;
11
15
  /** Custom icon to display if the image fails and no text fallback is available. */
12
16
  icon?: IconSlotType;
13
17
  }
14
- interface AvatarTextProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarTextProps, 'className'> {
18
+ interface AvatarTextProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarTextProps, 'className'>, AvatarFontScalingProps {
15
19
  /** Ref to the underlying View. */
16
20
  ref?: Ref<View>;
17
21
  }
18
- interface AvatarIconProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarIconProps<IconSlotType>, 'className'> {
22
+ interface AvatarIconProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarIconProps<IconSlotType>, 'className'>, AvatarFontScalingProps {
19
23
  /** Ref to the underlying View. */
20
24
  ref?: Ref<View>;
21
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/Avatar/types.ts"],"mappings":";;;;;;;UAaU,gBAAA,SACA,IAAA,CAAK,SAAA,eAAwB,IAAA,CAAK,yBAAA;;EAE1C,GAAA,GAAM,GAAA,CAAI,IAAA;EAFV;EAIA,IAAA,GAAO,YAAA;AAAA;AAAA,UAGC,eAAA,SACA,IAAA,CAAK,SAAA,eAAwB,IAAA,CAAK,wBAAA;EANhC;EAQV,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,eAAA,SACA,IAAA,CAAK,SAAA,eAAwB,IAAA,CAAK,wBAAA,CAAyB,YAAA;EAd9B;EAgBrC,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,WAAA,SAAoB,IAAA,CAAK,gBAAA;EAnBpB;EAqBb,GAAA;AAAA"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../../src/components/Avatar/types.ts"],"mappings":";;;;;;;UAaU,sBAAA;;EAER,qBAAA;AAAA;AAAA,UAGQ,gBAAA,SAEN,IAAA,CAAK,SAAA,eACL,IAAA,CAAK,yBAAA,2BACL,sBAAA;EAPF;EASA,GAAA,GAAM,GAAA,CAAI,IAAA;EANF;EAQR,IAAA,GAAO,YAAA;AAAA;AAAA,UAGC,eAAA,SAEN,IAAA,CAAK,SAAA,eACL,IAAA,CAAK,wBAAA,gBACL,sBAAA;EAZK;EAcP,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,eAAA,SAEN,IAAA,CAAK,SAAA,eACL,IAAA,CAAK,wBAAA,CAAyB,YAAA,iBAC9B,sBAAA;EAtBA;EAwBF,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,WAAA,SAAoB,IAAA,CAAK,gBAAA;EAzBT;EA2BxB,GAAA;AAAA"}
@@ -5,17 +5,21 @@ import { Ref } from "react";
5
5
  import { View, ViewProps } from "react-native";
6
6
 
7
7
  //#region src/components/Avatar/types.d.ts
8
- interface AvatarImageProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarImageProps, 'className' | 'srcSet'> {
8
+ interface AvatarFontScalingProps {
9
+ /** Caps avatar content and geometry at the control scale. Set null to remove the cap. @default 2 */
10
+ maxFontSizeMultiplier?: number | null;
11
+ }
12
+ interface AvatarImageProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarImageProps, 'className' | 'srcSet'>, AvatarFontScalingProps {
9
13
  /** Ref to the underlying View. */
10
14
  ref?: Ref<View>;
11
15
  /** Custom icon to display if the image fails and no text fallback is available. */
12
16
  icon?: IconSlotType;
13
17
  }
14
- interface AvatarTextProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarTextProps, 'className'> {
18
+ interface AvatarTextProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarTextProps, 'className'>, AvatarFontScalingProps {
15
19
  /** Ref to the underlying View. */
16
20
  ref?: Ref<View>;
17
21
  }
18
- interface AvatarIconProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarIconProps<IconSlotType>, 'className'> {
22
+ interface AvatarIconProps extends Omit<ViewProps, 'children'>, Omit<UniversalAvatarIconProps<IconSlotType>, 'className'>, AvatarFontScalingProps {
19
23
  /** Ref to the underlying View. */
20
24
  ref?: Ref<View>;
21
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/Avatar/types.ts"],"mappings":";;;;;;;UAaU,gBAAA,SACA,IAAA,CAAK,SAAA,eAAwB,IAAA,CAAK,yBAAA;;EAE1C,GAAA,GAAM,GAAA,CAAI,IAAA;EAFV;EAIA,IAAA,GAAO,YAAA;AAAA;AAAA,UAGC,eAAA,SACA,IAAA,CAAK,SAAA,eAAwB,IAAA,CAAK,wBAAA;EANhC;EAQV,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,eAAA,SACA,IAAA,CAAK,SAAA,eAAwB,IAAA,CAAK,wBAAA,CAAyB,YAAA;EAd9B;EAgBrC,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,WAAA,SAAoB,IAAA,CAAK,gBAAA;EAnBpB;EAqBb,GAAA;AAAA"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/components/Avatar/types.ts"],"mappings":";;;;;;;UAaU,sBAAA;;EAER,qBAAA;AAAA;AAAA,UAGQ,gBAAA,SAEN,IAAA,CAAK,SAAA,eACL,IAAA,CAAK,yBAAA,2BACL,sBAAA;EAPF;EASA,GAAA,GAAM,GAAA,CAAI,IAAA;EANF;EAQR,IAAA,GAAO,YAAA;AAAA;AAAA,UAGC,eAAA,SAEN,IAAA,CAAK,SAAA,eACL,IAAA,CAAK,wBAAA,gBACL,sBAAA;EAZK;EAcP,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,eAAA,SAEN,IAAA,CAAK,SAAA,eACL,IAAA,CAAK,wBAAA,CAAyB,YAAA,iBAC9B,sBAAA;EAtBA;EAwBF,GAAA,GAAM,GAAA,CAAI,IAAA;AAAA;AAAA,UAGF,WAAA,SAAoB,IAAA,CAAK,gBAAA;EAzBT;EA2BxB,GAAA;AAAA"}
@@ -0,0 +1,16 @@
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_fontScaling_useFontScale = require("../../fontScaling/useFontScale.cjs");
5
+ let generated_styles = require("../../../generated/styles");
6
+ //#region src/components/Avatar/useAvatarFontScale.ts
7
+ /** Keep every avatar content type on one size-aware scale that contains text and icons. */
8
+ function useAvatarFontScale(maxFontSizeMultiplier) {
9
+ const textStyle = generated_styles.avatarStyles.text;
10
+ const iconStyle = generated_styles.avatarStyles.icon;
11
+ const textScaleFactor = require_fontScaling_useFontScale.useComponentFontScale(maxFontSizeMultiplier, (typeof textStyle.lineHeight === "number" ? textStyle.lineHeight : void 0) ?? (typeof textStyle.fontSize === "number" ? textStyle.fontSize : void 0));
12
+ const iconScaleFactor = require_fontScaling_useFontScale.useComponentFontScale(maxFontSizeMultiplier, (typeof iconStyle.fontSize === "number" ? iconStyle.fontSize : void 0) ?? (typeof iconStyle.lineHeight === "number" ? iconStyle.lineHeight : void 0));
13
+ return Math.max(textScaleFactor, iconScaleFactor);
14
+ }
15
+ //#endregion
16
+ exports.useAvatarFontScale = useAvatarFontScale;
@@ -0,0 +1,7 @@
1
+
2
+ //#region src/components/Avatar/useAvatarFontScale.d.ts
3
+ /** Keep every avatar content type on one size-aware scale that contains text and icons. */
4
+ declare function useAvatarFontScale(maxFontSizeMultiplier?: number): number;
5
+ //#endregion
6
+ export { useAvatarFontScale };
7
+ //# sourceMappingURL=useAvatarFontScale.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarFontScale.d.cts","names":[],"sources":["../../../src/components/Avatar/useAvatarFontScale.ts"],"mappings":";;;iBAMS,kBAAA,CAAmB,qBAAA"}
@@ -0,0 +1,7 @@
1
+
2
+ //#region src/components/Avatar/useAvatarFontScale.d.ts
3
+ /** Keep every avatar content type on one size-aware scale that contains text and icons. */
4
+ declare function useAvatarFontScale(maxFontSizeMultiplier?: number): number;
5
+ //#endregion
6
+ export { useAvatarFontScale };
7
+ //# sourceMappingURL=useAvatarFontScale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarFontScale.d.ts","names":[],"sources":["../../../src/components/Avatar/useAvatarFontScale.ts"],"mappings":";;;iBAMS,kBAAA,CAAmB,qBAAA"}
@@ -0,0 +1,16 @@
1
+ /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
+ import { useComponentFontScale } from "../../fontScaling/useFontScale.js";
3
+ import { avatarStyles } from "../../../generated/styles";
4
+ //#region src/components/Avatar/useAvatarFontScale.ts
5
+ /** Keep every avatar content type on one size-aware scale that contains text and icons. */
6
+ function useAvatarFontScale(maxFontSizeMultiplier) {
7
+ const textStyle = avatarStyles.text;
8
+ const iconStyle = avatarStyles.icon;
9
+ const textScaleFactor = useComponentFontScale(maxFontSizeMultiplier, (typeof textStyle.lineHeight === "number" ? textStyle.lineHeight : void 0) ?? (typeof textStyle.fontSize === "number" ? textStyle.fontSize : void 0));
10
+ const iconScaleFactor = useComponentFontScale(maxFontSizeMultiplier, (typeof iconStyle.fontSize === "number" ? iconStyle.fontSize : void 0) ?? (typeof iconStyle.lineHeight === "number" ? iconStyle.lineHeight : void 0));
11
+ return Math.max(textScaleFactor, iconScaleFactor);
12
+ }
13
+ //#endregion
14
+ export { useAvatarFontScale };
15
+
16
+ //# sourceMappingURL=useAvatarFontScale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarFontScale.js","names":[],"sources":["../../../src/components/Avatar/useAvatarFontScale.ts"],"sourcesContent":["import type { TextStyle } from 'react-native';\n\nimport { avatarStyles } from '../../../generated/styles';\nimport { useComponentFontScale } from '../../fontScaling/useFontScale';\n\n/** Keep every avatar content type on one size-aware scale that contains text and icons. */\nfunction useAvatarFontScale(maxFontSizeMultiplier?: number): number {\n const textStyle = avatarStyles.text as TextStyle;\n const iconStyle = avatarStyles.icon as TextStyle;\n const textScaleFactor = useComponentFontScale(\n maxFontSizeMultiplier,\n (typeof textStyle.lineHeight === 'number' ? textStyle.lineHeight : undefined) ??\n (typeof textStyle.fontSize === 'number' ? textStyle.fontSize : undefined),\n );\n const iconScaleFactor = useComponentFontScale(\n maxFontSizeMultiplier,\n (typeof iconStyle.fontSize === 'number' ? iconStyle.fontSize : undefined) ??\n (typeof iconStyle.lineHeight === 'number' ? iconStyle.lineHeight : undefined),\n );\n\n return Math.max(textScaleFactor, iconScaleFactor);\n}\n\nexport { useAvatarFontScale };\n"],"mappings":";;;;;AAMA,SAAS,mBAAmB,uBAAwC;CAClE,MAAM,YAAY,aAAa;CAC/B,MAAM,YAAY,aAAa;CAC/B,MAAM,kBAAkB,sBACtB,wBACC,OAAO,UAAU,eAAe,WAAW,UAAU,aAAa,KAAA,OAChE,OAAO,UAAU,aAAa,WAAW,UAAU,WAAW,KAAA,GAClE;CACD,MAAM,kBAAkB,sBACtB,wBACC,OAAO,UAAU,aAAa,WAAW,UAAU,WAAW,KAAA,OAC5D,OAAO,UAAU,eAAe,WAAW,UAAU,aAAa,KAAA,GACtE;CAED,OAAO,KAAK,IAAI,iBAAiB,gBAAgB"}
@@ -21,11 +21,14 @@ function generateAvatarAbbreviation(name, strategy = "firstAndLast") {
21
21
  const initials = name.trim().split(/\s+/).filter(Boolean).map((word) => word[0]?.toUpperCase() ?? "");
22
22
  return abbreviationStrategies[strategy](initials);
23
23
  }
24
- function getAvatarCustomSizeStyle(customSize) {
25
- return customSize === void 0 ? void 0 : {
26
- width: customSize,
27
- height: customSize
28
- };
24
+ function getAvatarSizeStyle(rootStyle, customSize, fontScaleFactor) {
25
+ if (customSize === void 0 && fontScaleFactor === 1) return;
26
+ const width = customSize ?? rootStyle.width;
27
+ const height = customSize ?? rootStyle.height;
28
+ return typeof width === "number" && typeof height === "number" ? {
29
+ width: Math.round(width * fontScaleFactor),
30
+ height: Math.round(height * fontScaleFactor)
31
+ } : void 0;
29
32
  }
30
33
  function getDefaultAvatarIcon(variant) {
31
34
  return DEFAULT_AVATAR_ICON[variant];
@@ -34,5 +37,5 @@ function getDefaultAvatarIcon(variant) {
34
37
  exports.DEFAULT_AVATAR_SIZE = DEFAULT_AVATAR_SIZE;
35
38
  exports.DEFAULT_AVATAR_VARIANT = DEFAULT_AVATAR_VARIANT;
36
39
  exports.generateAvatarAbbreviation = generateAvatarAbbreviation;
37
- exports.getAvatarCustomSizeStyle = getAvatarCustomSizeStyle;
40
+ exports.getAvatarSizeStyle = getAvatarSizeStyle;
38
41
  exports.getDefaultAvatarIcon = getDefaultAvatarIcon;
@@ -7,8 +7,8 @@ import { ViewStyle } from "react-native";
7
7
  declare const DEFAULT_AVATAR_SIZE: AvatarSize;
8
8
  declare const DEFAULT_AVATAR_VARIANT: AvatarVariant;
9
9
  declare function generateAvatarAbbreviation(name?: string, strategy?: AvatarAbbreviationStrategy): string;
10
- declare function getAvatarCustomSizeStyle(customSize?: number): ViewStyle | undefined;
10
+ declare function getAvatarSizeStyle(rootStyle: ViewStyle, customSize: number | undefined, fontScaleFactor: number): ViewStyle | undefined;
11
11
  declare function getDefaultAvatarIcon(variant: AvatarVariant): IconSlotType;
12
12
  //#endregion
13
- export { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, generateAvatarAbbreviation, getAvatarCustomSizeStyle, getDefaultAvatarIcon };
13
+ export { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, generateAvatarAbbreviation, getAvatarSizeStyle, getDefaultAvatarIcon };
14
14
  //# sourceMappingURL=utils.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.cts","names":[],"sources":["../../../src/components/Avatar/utils.ts"],"mappings":";;;;;;cAKM,mBAAA,EAAqB,UAAA;AAAA,cACrB,sBAAA,EAAwB,aAAA;AAAA,iBAoBrB,0BAAA,CACP,IAAA,WACA,QAAA,GAAU,0BAAA;AAAA,iBAgBH,wBAAA,CAAyB,UAAA,YAAsB,SAAA;AAAA,iBAI/C,oBAAA,CAAqB,OAAA,EAAS,aAAA,GAAgB,YAAA"}
1
+ {"version":3,"file":"utils.d.cts","names":[],"sources":["../../../src/components/Avatar/utils.ts"],"mappings":";;;;;;cAKM,mBAAA,EAAqB,UAAA;AAAA,cACrB,sBAAA,EAAwB,aAAA;AAAA,iBAoBrB,0BAAA,CACP,IAAA,WACA,QAAA,GAAU,0BAAA;AAAA,iBAgBH,kBAAA,CACP,SAAA,EAAW,SAAA,EACX,UAAA,sBACA,eAAA,WACC,SAAA;AAAA,iBAgBM,oBAAA,CAAqB,OAAA,EAAS,aAAA,GAAgB,YAAA"}
@@ -7,8 +7,8 @@ import { ViewStyle } from "react-native";
7
7
  declare const DEFAULT_AVATAR_SIZE: AvatarSize;
8
8
  declare const DEFAULT_AVATAR_VARIANT: AvatarVariant;
9
9
  declare function generateAvatarAbbreviation(name?: string, strategy?: AvatarAbbreviationStrategy): string;
10
- declare function getAvatarCustomSizeStyle(customSize?: number): ViewStyle | undefined;
10
+ declare function getAvatarSizeStyle(rootStyle: ViewStyle, customSize: number | undefined, fontScaleFactor: number): ViewStyle | undefined;
11
11
  declare function getDefaultAvatarIcon(variant: AvatarVariant): IconSlotType;
12
12
  //#endregion
13
- export { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, generateAvatarAbbreviation, getAvatarCustomSizeStyle, getDefaultAvatarIcon };
13
+ export { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, generateAvatarAbbreviation, getAvatarSizeStyle, getDefaultAvatarIcon };
14
14
  //# sourceMappingURL=utils.d.ts.map