@yahoo/uds-mobile 1.1.0-beta.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +9 -4
  3. package/dist/bin/generateTheme.mjs +8 -10
  4. package/dist/bin/{fixtures/dist/index.mjs → uds/dist/fixtures.mjs} +16 -8
  5. package/dist/bin/{palette/dist/index.mjs → uds/dist/tokens/configs/palette/alwaysPalette.mjs} +1 -1
  6. package/dist/bin/uds/dist/tokens/consts/defaultModes.mjs +6 -0
  7. package/dist/bin/{fonts/dist/index.mjs → uds/dist/tokens/consts/fontDeclarationsMap.mjs} +9 -24
  8. package/dist/components/Avatar.d.cts +2 -2
  9. package/dist/components/Avatar.d.mts +2 -2
  10. package/dist/components/Badge.d.cts +3 -3
  11. package/dist/components/Badge.d.mts +3 -3
  12. package/dist/components/Badge.mjs.map +1 -1
  13. package/dist/components/Box.cjs +1 -1
  14. package/dist/components/Box.d.cts +3 -3
  15. package/dist/components/Box.d.mts +3 -3
  16. package/dist/components/Box.mjs +1 -1
  17. package/dist/components/Box.mjs.map +1 -1
  18. package/dist/components/Button.cjs +6 -6
  19. package/dist/components/Button.d.cts +4 -3
  20. package/dist/components/Button.d.cts.map +1 -1
  21. package/dist/components/Button.d.mts +4 -3
  22. package/dist/components/Button.d.mts.map +1 -1
  23. package/dist/components/Button.mjs +1 -1
  24. package/dist/components/Button.mjs.map +1 -1
  25. package/dist/components/Checkbox.cjs +4 -4
  26. package/dist/components/Checkbox.d.cts +3 -3
  27. package/dist/components/Checkbox.d.mts +3 -3
  28. package/dist/components/Checkbox.d.mts.map +1 -1
  29. package/dist/components/Checkbox.mjs +1 -1
  30. package/dist/components/Checkbox.mjs.map +1 -1
  31. package/dist/components/Chip.d.cts +3 -3
  32. package/dist/components/Chip.d.mts +3 -3
  33. package/dist/components/Chip.d.mts.map +1 -1
  34. package/dist/components/Chip.mjs.map +1 -1
  35. package/dist/components/HStack.d.cts +2 -2
  36. package/dist/components/HStack.d.mts +2 -2
  37. package/dist/components/Icon.d.cts +4 -3
  38. package/dist/components/Icon.d.cts.map +1 -1
  39. package/dist/components/Icon.d.mts +4 -3
  40. package/dist/components/Icon.d.mts.map +1 -1
  41. package/dist/components/Icon.mjs.map +1 -1
  42. package/dist/components/IconButton.cjs +5 -5
  43. package/dist/components/IconButton.d.cts +4 -3
  44. package/dist/components/IconButton.d.cts.map +1 -1
  45. package/dist/components/IconButton.d.mts +4 -3
  46. package/dist/components/IconButton.d.mts.map +1 -1
  47. package/dist/components/IconButton.mjs +1 -1
  48. package/dist/components/IconButton.mjs.map +1 -1
  49. package/dist/components/IconSlot.d.cts +2 -2
  50. package/dist/components/IconSlot.d.mts +2 -2
  51. package/dist/components/IconSlot.d.mts.map +1 -1
  52. package/dist/components/Image.d.cts +3 -3
  53. package/dist/components/Image.d.mts +3 -3
  54. package/dist/components/Image.d.mts.map +1 -1
  55. package/dist/components/Image.mjs.map +1 -1
  56. package/dist/components/Input.d.cts +3 -3
  57. package/dist/components/Input.d.mts +3 -3
  58. package/dist/components/Input.d.mts.map +1 -1
  59. package/dist/components/Input.mjs.map +1 -1
  60. package/dist/components/Link.d.cts +4 -3
  61. package/dist/components/Link.d.cts.map +1 -1
  62. package/dist/components/Link.d.mts +4 -3
  63. package/dist/components/Link.d.mts.map +1 -1
  64. package/dist/components/Link.mjs.map +1 -1
  65. package/dist/components/Pressable.d.cts +3 -3
  66. package/dist/components/Pressable.d.mts +3 -3
  67. package/dist/components/Radio.cjs +4 -4
  68. package/dist/components/Radio.d.cts +3 -3
  69. package/dist/components/Radio.d.mts +3 -3
  70. package/dist/components/Radio.mjs +1 -1
  71. package/dist/components/Radio.mjs.map +1 -1
  72. package/dist/components/Screen.d.cts +2 -2
  73. package/dist/components/Screen.d.mts +2 -2
  74. package/dist/components/Screen.d.mts.map +1 -1
  75. package/dist/components/Switch.d.cts +3 -3
  76. package/dist/components/Switch.d.cts.map +1 -1
  77. package/dist/components/Switch.d.mts +3 -3
  78. package/dist/components/Switch.d.mts.map +1 -1
  79. package/dist/components/Switch.mjs.map +1 -1
  80. package/dist/components/Text.d.cts +2 -2
  81. package/dist/components/Text.d.mts +2 -2
  82. package/dist/components/VStack.d.cts +2 -2
  83. package/dist/components/VStack.d.mts +2 -2
  84. package/dist/components/VStack.d.mts.map +1 -1
  85. package/dist/icons/dist/glyphMap.d.cts +1 -1
  86. package/dist/icons/dist/glyphMap.d.cts.map +1 -1
  87. package/dist/icons/dist/glyphMap.d.mts +1 -1
  88. package/dist/icons/dist/glyphMap.d.mts.map +1 -1
  89. package/dist/icons/dist/glyphMap.mjs.map +1 -1
  90. package/dist/icons/dist/svgMap.d.cts.map +1 -1
  91. package/dist/icons/dist/svgMap.d.mts.map +1 -1
  92. package/dist/icons/dist/svgMap.mjs.map +1 -1
  93. package/dist/icons/dist/tokens.mjs.map +1 -1
  94. package/dist/icons/dist/types.d.cts +24 -0
  95. package/dist/icons/dist/types.d.cts.map +1 -0
  96. package/dist/icons/dist/types.d.mts +24 -0
  97. package/dist/icons/dist/types.d.mts.map +1 -0
  98. package/dist/motion.cjs +12 -12
  99. package/dist/motion.d.cts +3 -2
  100. package/dist/motion.d.cts.map +1 -1
  101. package/dist/motion.d.mts +3 -2
  102. package/dist/motion.d.mts.map +1 -1
  103. package/dist/motion.mjs +1 -1
  104. package/dist/motion.mjs.map +1 -1
  105. package/dist/uds/dist/components/Box.d.cts +3 -0
  106. package/dist/uds/dist/components/Box.d.mts +3 -0
  107. package/dist/uds/dist/components/Divider/Divider.d.cts +3 -0
  108. package/dist/uds/dist/components/Divider/Divider.d.mts +3 -0
  109. package/dist/uds/dist/components/Divider/DividerCore.d.cts +4 -0
  110. package/dist/uds/dist/components/Divider/DividerCore.d.mts +4 -0
  111. package/dist/uds/dist/components/Divider/DividerInternal.d.cts +4 -0
  112. package/dist/uds/dist/components/Divider/DividerInternal.d.mts +4 -0
  113. package/dist/uds/dist/components/Divider/index.d.cts +2 -0
  114. package/dist/uds/dist/components/Divider/index.d.mts +2 -0
  115. package/dist/uds/dist/components/FormLabel.d.cts +3 -0
  116. package/dist/uds/dist/components/FormLabel.d.mts +4 -0
  117. package/dist/uds/dist/components/HStack.d.cts +4 -0
  118. package/dist/uds/dist/components/HStack.d.mts +4 -0
  119. package/dist/uds/dist/components/Icon.d.cts +3 -0
  120. package/dist/uds/dist/components/Icon.d.mts +3 -0
  121. package/dist/uds/dist/components/Image.d.cts +2 -0
  122. package/dist/uds/dist/components/Image.d.mts +3 -0
  123. package/dist/uds/dist/components/Link.d.cts +3 -0
  124. package/dist/uds/dist/components/Link.d.mts +3 -0
  125. package/dist/uds/dist/components/Text.d.cts +3 -0
  126. package/dist/uds/dist/components/Text.d.mts +3 -0
  127. package/dist/uds/dist/components/VStack.d.cts +4 -0
  128. package/dist/uds/dist/components/VStack.d.mts +4 -0
  129. package/dist/uds/dist/components/client/Avatar/Avatar.d.cts +2 -0
  130. package/dist/uds/dist/components/client/Avatar/Avatar.d.mts +3 -0
  131. package/dist/uds/dist/components/client/Avatar/AvatarIcon.d.cts +2 -0
  132. package/dist/uds/dist/components/client/Avatar/AvatarIcon.d.mts +3 -0
  133. package/dist/uds/dist/components/client/Avatar/AvatarImage.d.cts +4 -0
  134. package/dist/uds/dist/components/client/Avatar/AvatarImage.d.mts +5 -0
  135. package/dist/uds/dist/components/client/Avatar/AvatarText.d.cts +3 -0
  136. package/dist/uds/dist/components/client/Avatar/AvatarText.d.mts +4 -0
  137. package/dist/uds/dist/components/client/Avatar/index.d.cts +5 -0
  138. package/dist/uds/dist/components/client/Avatar/index.d.mts +5 -0
  139. package/dist/uds/dist/components/client/Badge.d.cts +3 -0
  140. package/dist/uds/dist/components/client/Badge.d.mts +3 -0
  141. package/dist/uds/dist/components/client/Button.d.cts +3 -0
  142. package/dist/uds/dist/components/client/Button.d.mts +3 -0
  143. package/dist/uds/dist/components/client/Checkbox.d.cts +3 -0
  144. package/dist/uds/dist/components/client/Checkbox.d.mts +3 -0
  145. package/dist/uds/dist/components/client/Chip/Chip.d.cts +4 -0
  146. package/dist/uds/dist/components/client/Chip/Chip.d.mts +4 -0
  147. package/dist/uds/dist/components/client/Chip/ChipBase.d.cts +4 -0
  148. package/dist/uds/dist/components/client/Chip/ChipBase.d.mts +4 -0
  149. package/dist/uds/dist/components/client/Chip/ChipButton.d.cts +4 -0
  150. package/dist/uds/dist/components/client/Chip/ChipButton.d.mts +4 -0
  151. package/dist/uds/dist/components/client/Chip/ChipDismissible.d.cts +4 -0
  152. package/dist/uds/dist/components/client/Chip/ChipDismissible.d.mts +4 -0
  153. package/dist/uds/dist/components/client/Chip/ChipLink.d.cts +4 -0
  154. package/dist/uds/dist/components/client/Chip/ChipLink.d.mts +4 -0
  155. package/dist/uds/dist/components/client/Chip/ChipToggle.d.cts +4 -0
  156. package/dist/uds/dist/components/client/Chip/ChipToggle.d.mts +4 -0
  157. package/dist/uds/dist/components/client/Chip/index.d.cts +6 -0
  158. package/dist/uds/dist/components/client/Chip/index.d.mts +6 -0
  159. package/dist/uds/dist/components/client/IconButton.d.cts +3 -0
  160. package/dist/uds/dist/components/client/IconButton.d.mts +3 -0
  161. package/dist/uds/dist/components/client/Input/Input.d.cts +4 -0
  162. package/dist/uds/dist/components/client/Input/Input.d.mts +4 -0
  163. package/dist/uds/dist/components/client/Input/InputHelpText.d.cts +2 -0
  164. package/dist/uds/dist/components/client/Input/InputHelpText.d.mts +3 -0
  165. package/dist/uds/dist/components/client/Input/InputHelpTextInternal.d.cts +5 -0
  166. package/dist/uds/dist/components/client/Input/InputHelpTextInternal.d.mts +6 -0
  167. package/dist/uds/dist/components/client/Input/index.d.cts +3 -0
  168. package/dist/uds/dist/components/client/Input/index.d.mts +3 -0
  169. package/dist/uds/dist/components/client/Menu/Menu.Content.d.cts +4 -0
  170. package/dist/uds/dist/components/client/Menu/Menu.Content.d.mts +4 -0
  171. package/dist/uds/dist/components/client/Menu/Menu.Divider.d.cts +3 -0
  172. package/dist/uds/dist/components/client/Menu/Menu.Divider.d.mts +3 -0
  173. package/dist/uds/dist/components/client/Menu/Menu.Item.d.cts +4 -0
  174. package/dist/uds/dist/components/client/Menu/Menu.Item.d.mts +4 -0
  175. package/dist/uds/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +4 -0
  176. package/dist/uds/dist/components/client/Menu/Menu.ItemCheckbox.d.mts +4 -0
  177. package/dist/uds/dist/components/client/Menu/Menu.Provider.d.cts +2 -0
  178. package/dist/uds/dist/components/client/Menu/Menu.Provider.d.mts +3 -0
  179. package/dist/uds/dist/components/client/Menu/Menu.Trigger.d.cts +4 -0
  180. package/dist/uds/dist/components/client/Menu/Menu.Trigger.d.mts +4 -0
  181. package/dist/uds/dist/components/client/Menu/Menu.d.cts +2 -0
  182. package/dist/uds/dist/components/client/Menu/Menu.d.mts +2 -0
  183. package/dist/uds/dist/components/client/Menu/Menu.index.d.cts +7 -0
  184. package/dist/uds/dist/components/client/Menu/Menu.index.d.mts +7 -0
  185. package/dist/uds/dist/components/client/Menu/index.d.cts +9 -0
  186. package/dist/uds/dist/components/client/Menu/index.d.mts +9 -0
  187. package/dist/uds/dist/components/client/Pressable.d.cts +3 -0
  188. package/dist/uds/dist/components/client/Pressable.d.mts +3 -0
  189. package/dist/uds/dist/components/client/Radio/Radio.d.cts +3 -0
  190. package/dist/uds/dist/components/client/Radio/Radio.d.mts +3 -0
  191. package/dist/uds/dist/components/client/Radio/RadioGroupProvider.d.cts +3 -0
  192. package/dist/uds/dist/components/client/Radio/RadioGroupProvider.d.mts +3 -0
  193. package/dist/uds/dist/components/client/Radio/index.d.cts +3 -0
  194. package/dist/uds/dist/components/client/Radio/index.d.mts +3 -0
  195. package/dist/uds/dist/components/client/SpringMotionConfig.d.cts +3 -0
  196. package/dist/uds/dist/components/client/SpringMotionConfig.d.mts +3 -0
  197. package/dist/uds/dist/components/client/Switch.d.cts +3 -0
  198. package/dist/uds/dist/components/client/Switch.d.mts +3 -0
  199. package/dist/uds/dist/components/client/index.d.cts +33 -0
  200. package/dist/uds/dist/components/client/index.d.mts +33 -0
  201. package/dist/uds/dist/components/index.d.cts +40 -0
  202. package/dist/uds/dist/components/index.d.mts +40 -0
  203. package/dist/uds/dist/index.d.cts +46 -0
  204. package/dist/uds/dist/index.d.mts +46 -0
  205. package/dist/uds/dist/styles/styler.d.cts +2 -0
  206. package/dist/uds/dist/styles/styler.d.mts +2 -0
  207. package/dist/uds/dist/styles/stylerTypes.d.cts +2 -0
  208. package/dist/uds/dist/styles/stylerTypes.d.mts +2 -0
  209. package/dist/uds/dist/tokens/automation/configs/avatar.d.cts +2 -0
  210. package/dist/uds/dist/tokens/automation/configs/avatar.d.mts +2 -0
  211. package/dist/uds/dist/tokens/automation/properties.d.cts +3 -0
  212. package/dist/uds/dist/tokens/automation/properties.d.mts +3 -0
  213. package/dist/uds/dist/tokens/automation/types/ComponentConfig.d.cts +3 -0
  214. package/dist/uds/dist/tokens/automation/types/ComponentConfig.d.mts +3 -0
  215. package/dist/{motion-tokens/dist/index.cjs → uds/dist/tokens/configs/motion.cjs} +2 -2
  216. package/dist/{motion-tokens/dist/index.d.cts → uds/dist/tokens/configs/motion.d.cts} +4 -4
  217. package/dist/uds/dist/tokens/configs/motion.d.cts.map +1 -0
  218. package/dist/{motion-tokens/dist/index.d.mts → uds/dist/tokens/configs/motion.d.mts} +4 -4
  219. package/dist/uds/dist/tokens/configs/motion.d.mts.map +1 -0
  220. package/dist/{motion-tokens/dist/index.mjs → uds/dist/tokens/configs/motion.mjs} +3 -3
  221. package/dist/uds/dist/tokens/configs/motion.mjs.map +1 -0
  222. package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.cts +32 -0
  223. package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.cts.map +1 -0
  224. package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.mts +32 -0
  225. package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.mts.map +1 -0
  226. package/dist/uds/dist/tokens/types.d.cts +426 -0
  227. package/dist/uds/dist/tokens/types.d.cts.map +1 -0
  228. package/dist/uds/dist/tokens/types.d.mts +426 -0
  229. package/dist/uds/dist/tokens/types.d.mts.map +1 -0
  230. package/dist/uds/dist/types.d.cts +2 -0
  231. package/dist/uds/dist/types.d.mts +2 -0
  232. package/fonts/uds-icons.ttf +0 -0
  233. package/package.json +1 -1
  234. package/dist/bin/modes/dist/index.mjs +0 -6
  235. package/dist/motion-tokens/dist/index.d.cts.map +0 -1
  236. package/dist/motion-tokens/dist/index.d.mts.map +0 -1
  237. package/dist/motion-tokens/dist/index.mjs.map +0 -1
  238. package/dist/types/dist/index.d.cts +0 -247
  239. package/dist/types/dist/index.d.cts.map +0 -1
  240. package/dist/types/dist/index.d.mts +0 -247
  241. package/dist/types/dist/index.d.mts.map +0 -1
@@ -1,8 +1,9 @@
1
1
 
2
- import { ButtonVariantFlat, IconButtonSize, IconVariant } from "../types/dist/index.mjs";
2
+ import { IconVariant } from "../icons/dist/types.mjs";
3
+ import { ButtonVariantFlat, IconButtonSize } from "../uds/dist/tokens/types.mjs";
3
4
  import { IconName } from "./Icon.mjs";
4
5
  import { PressableProps as PressableProps$1 } from "./Pressable.mjs";
5
- import * as react7 from "react";
6
+ import * as react17 from "react";
6
7
  import { Ref } from "react";
7
8
  import { View } from "react-native";
8
9
 
@@ -39,7 +40,7 @@ interface IconButtonProps extends Omit<PressableProps$1, 'children'> {
39
40
  * <IconButton name="Settings" loading />
40
41
  * ```
41
42
  */
42
- declare const IconButton: react7.NamedExoticComponent<IconButtonProps>;
43
+ declare const IconButton: react17.NamedExoticComponent<IconButtonProps>;
43
44
  //#endregion
44
45
  export { IconButton, type IconButtonProps };
45
46
  //# sourceMappingURL=IconButton.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.mts","names":[],"sources":["../../src/components/IconButton.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;UA6CU,eAAA,SAAwB,KAAK;;QAE/B;EAFE;EAA6B,OAAA,CAAA,EAI3B,iBAJ2B;EAE/B;EAEI,IAAA,CAAA,EAEH,cAFG;EAEH;EAEO,WAAA,CAAA,EAAA,WAAA;EAOJ,OAAA,CAAA,EAAA,OAAA;EAAJ;;;AAf8B;;QAe9B,IAAI;;;;;;;;;;;;;;;;;cAsBN,YAAU,MAAA,CAAA,qBAAA"}
1
+ {"version":3,"file":"IconButton.d.mts","names":[],"sources":["../../src/components/IconButton.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;UA6CU,eAAA,SAAwB,KAAK;;QAE/B;;EAFE,OAAA,CAAA,EAIE,iBAJc;EAAa;EAE/B,IAAA,CAAA,EAIC,cAJD;EAEI;EAEH,WAAA,CAAA,EAEO,WAFP;EAEO,OAAA,CAAA,EAAA,OAAA;EAOJ;;;;EAsBN,cA0HJ,CAAA,EAAA,OAAA;QAhJM,IAAI;;;;;;;;;;;;;;;;;cAsBN,YAAU,OAAA,CAAA,qBAAA"}
@@ -1,5 +1,5 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- import { SCALE_EFFECTS } from "../motion-tokens/dist/index.mjs";
2
+ import { SCALE_EFFECTS } from "../uds/dist/tokens/configs/motion.mjs";
3
3
  import { BUTTON_SPRING_CONFIG } from "../motion.mjs";
4
4
  import { Icon } from "./Icon.mjs";
5
5
  import { AnimatedPressable } from "./Pressable.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.mjs","names":["IconButton","foundationStyles"],"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonVariantFlat, IconButtonSize, IconVariant } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useMemo, useState } from 'react';\nimport type { View } from 'react-native';\nimport { ActivityIndicator } from 'react-native';\nimport {\n Easing,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withSpring,\n withTiming,\n} from 'react-native-reanimated';\nimport { useAnimatedTheme, useAnimatedVariantColor } from 'react-native-unistyles/reanimated';\n\nimport { buttonStyles, iconButtonStyles, styles as foundationStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport type { IconName } from './Icon';\nimport { Icon } from './Icon';\nimport type { PressableProps } from './Pressable';\nimport { AnimatedPressable } from './Pressable';\n\n/* -------------------------------------------------------------------------- */\n/* Animation Helpers */\n/* -------------------------------------------------------------------------- */\n\nfunction interpolateShadowAlpha(shadow: string, alpha: number): string {\n 'worklet';\n if (!shadow || alpha >= 1) {\n return shadow;\n }\n if (alpha <= 0) {\n return '';\n }\n\n return shadow.replace(/rgba\\(([^,]+),\\s*([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/g, (_, r, g, b, a) => {\n const newAlpha = parseFloat(a) * alpha;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha.toFixed(3)})`;\n });\n}\n\n/* -------------------------------------------------------------------------- */\n/* IconButton Props */\n/* -------------------------------------------------------------------------- */\n\ninterface IconButtonProps extends Omit<PressableProps, 'children'> {\n /** Icon to render from the icons package. */\n name: IconName;\n /** @default 'primary' */\n variant?: ButtonVariantFlat;\n /** @default 'md' */\n size?: IconButtonSize;\n /** @default 'outline' */\n iconVariant?: IconVariant;\n loading?: boolean;\n /**\n * Disable motion effects (scale on press, icon animations)\n * @default false\n */\n disableEffects?: boolean;\n ref?: Ref<View>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* IconButton Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **An icon button element that can be used to trigger an action**\n *\n * Features animated scale effect on press and smooth color transitions\n * matching the web UDS IconButton behavior.\n *\n * @example\n * ```tsx\n * import { IconButton } from '@yahoo/uds-mobile';\n *\n * <IconButton name=\"Add\" onPress={() => console.log('pressed')} />\n * <IconButton name=\"Close\" variant=\"secondary\" size=\"sm\" />\n * <IconButton name=\"Settings\" loading />\n * ```\n */\nconst IconButton = memo(function IconButton({\n name,\n variant = 'primary',\n size = 'md',\n iconVariant = 'outline',\n loading,\n disabled,\n style,\n accessibilityLabel,\n accessibilityHint,\n disableEffects = false,\n onPressIn,\n onPressOut,\n ref,\n ...props\n}: IconButtonProps) {\n const isDisabled = disabled || loading;\n const shouldAnimate = !disableEffects && !isDisabled;\n\n /* --------------------------------- State ---------------------------------- */\n const [pressed, setPressed] = useState(false);\n\n // Apply layer-based styles with compound variant support\n iconButtonStyles.useVariants({ size });\n buttonStyles.useVariants({ variant, disabled: isDisabled, pressed });\n\n // Animate colors using Unistyles' useAnimatedVariantColor\n const backgroundColor = useAnimatedVariantColor(buttonStyles.root, 'backgroundColor');\n const borderColor = useAnimatedVariantColor(buttonStyles.root, 'borderColor');\n\n // Get animated theme for boxShadow\n const animatedTheme = useAnimatedTheme();\n\n /* ------------------------------- Animation -------------------------------- */\n const scale = useSharedValue<number>(SCALE_EFFECTS.none);\n\n const handlePressIn = useCallback<NonNullable<PressableProps['onPressIn']>>(\n (event) => {\n setPressed(true);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.down, BUTTON_SPRING_CONFIG);\n }\n onPressIn?.(event);\n },\n [shouldAnimate, scale, onPressIn],\n );\n\n const handlePressOut = useCallback<NonNullable<PressableProps['onPressOut']>>(\n (event) => {\n setPressed(false);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG);\n }\n onPressOut?.(event);\n },\n [shouldAnimate, scale, onPressOut],\n );\n\n const a11yState = useMemo(() => ({ disabled: isDisabled, busy: loading }), [isDisabled, loading]);\n\n /* --------------------------------- Styles --------------------------------- */\n // Animate pressed state for shadow\n const pressProgress = useDerivedValue(\n () => withTiming(pressed ? 1 : 0, { duration: 220, easing: Easing.bezier(0, 0, 0.2, 1) }),\n [pressed],\n );\n\n // Animate using Unistyles' variant color system + boxShadow from theme\n const animatedRootStyle = useAnimatedStyle(() => {\n // Get boxShadow from theme using flattened path (no camelCase conversion needed!)\n const components = animatedTheme.value.components as unknown as Record<\n string,\n Record<string, unknown>\n >;\n const shadowPressed =\n (components[`button/variant/${variant}/root/pressed`]?.boxShadow as string) ?? '';\n\n return {\n transform: [{ scale: scale.value }],\n backgroundColor: withTiming(backgroundColor.value, {\n duration: 220,\n easing: Easing.bezier(0, 0, 0.2, 1),\n }),\n borderColor: withTiming(borderColor.value, {\n duration: 220,\n easing: Easing.bezier(0, 0, 0.2, 1),\n }),\n boxShadow: interpolateShadowAlpha(shadowPressed, pressProgress.value),\n };\n });\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <AnimatedPressable\n ref={ref}\n disabled={isDisabled}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n accessibilityLabel={loading ? `${accessibilityLabel ?? ''}, loading` : accessibilityLabel}\n accessibilityHint={accessibilityHint}\n accessibilityRole=\"button\"\n accessibilityState={a11yState}\n style={[\n iconButtonStyles.root,\n buttonStyles.root,\n foundationStyles.foundation,\n animatedRootStyle,\n typeof style === 'function' ? style({ pressed }) : style,\n ]}\n {...props}\n >\n {loading ? (\n <ActivityIndicator size={buttonStyles.icon.fontSize} color={buttonStyles.icon.color} />\n ) : (\n <Icon name={name} variant={iconVariant} style={buttonStyles.icon} />\n )}\n </AnimatedPressable>\n );\n});\n\nIconButton.displayName = 'IconButton';\n\nexport { IconButton, type IconButtonProps };\n"],"mappings":";;;;;;;;;;;;;AA0BA,SAAS,uBAAuB,QAAgB,OAAuB;AACrE;AACA,KAAI,CAAC,UAAU,SAAS,EACtB,QAAO;AAET,KAAI,SAAS,EACX,QAAO;AAGT,QAAO,OAAO,QAAQ,sDAAsD,GAAG,GAAG,GAAG,GAAG,MAAM;AAE5F,SAAO,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KADZ,WAAW,EAAE,GAAG,OACS,QAAQ,EAAE,CAAC;GACrD;;;;;;;;;;;;;;;;;AA4CJ,MAAM,aAAa,KAAK,SAASA,aAAW,EAC1C,MACA,UAA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AAQ,OAAO,OAAO,GAAG,GAAG,IAAK,EAAE;IACpC,CAAC;GACF,aAAa,WAAW,YAAY,OAAO;IACzC,UAAU;IACV,QAAQ,OAAO,OAAO,GAAG,GAAG,IAAK,EAAE;IACpC,CAAC;GACF,WAAW,uBAAuB,eAAe,cAAc,MAAM;GACtE;GACD;AAGF,QACE,oBAAC;EACM;EACL,UAAU;EACV,WAAW;EACX,YAAY;EACZ,eAAc;EACd,YAAW;EACX,gBAAe;EACf,UAAS;EACT,oBAAoB,UAAU,GAAG,sBAAsB,GAAG,aAAa;EACpD;EACnB,mBAAkB;EAClB,oBAAoB;EACpB,OAAO;GACL,iBAAiB;GACjB,aAAa;GACbC,OAAiB;GACjB;GACA,OAAO,UAAU,aAAa,MAAM,EAAE,SAAS,CAAC,GAAG;GACpD;EACD,GAAI;YAEH,UACC,oBAAC;GAAkB,MAAM,aAAa,KAAK;GAAU,OAAO,aAAa,KAAK;IAAS,GAEvF,oBAAC;GAAW;GAAM,SAAS;GAAa,OAAO,aAAa;IAAQ;GAEpD;EAEtB;AAEF,WAAW,cAAc"}
1
+ {"version":3,"file":"IconButton.mjs","names":["IconButton","foundationStyles"],"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonVariantFlat, IconButtonSize, IconVariant } from '@yahoo/uds/tokens';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useMemo, useState } from 'react';\nimport type { View } from 'react-native';\nimport { ActivityIndicator } from 'react-native';\nimport {\n Easing,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withSpring,\n withTiming,\n} from 'react-native-reanimated';\nimport { useAnimatedTheme, useAnimatedVariantColor } from 'react-native-unistyles/reanimated';\n\nimport { buttonStyles, iconButtonStyles, styles as foundationStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport type { IconName } from './Icon';\nimport { Icon } from './Icon';\nimport type { PressableProps } from './Pressable';\nimport { AnimatedPressable } from './Pressable';\n\n/* -------------------------------------------------------------------------- */\n/* Animation Helpers */\n/* -------------------------------------------------------------------------- */\n\nfunction interpolateShadowAlpha(shadow: string, alpha: number): string {\n 'worklet';\n if (!shadow || alpha >= 1) {\n return shadow;\n }\n if (alpha <= 0) {\n return '';\n }\n\n return shadow.replace(/rgba\\(([^,]+),\\s*([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/g, (_, r, g, b, a) => {\n const newAlpha = parseFloat(a) * alpha;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha.toFixed(3)})`;\n });\n}\n\n/* -------------------------------------------------------------------------- */\n/* IconButton Props */\n/* -------------------------------------------------------------------------- */\n\ninterface IconButtonProps extends Omit<PressableProps, 'children'> {\n /** Icon to render from the icons package. */\n name: IconName;\n /** @default 'primary' */\n variant?: ButtonVariantFlat;\n /** @default 'md' */\n size?: IconButtonSize;\n /** @default 'outline' */\n iconVariant?: IconVariant;\n loading?: boolean;\n /**\n * Disable motion effects (scale on press, icon animations)\n * @default false\n */\n disableEffects?: boolean;\n ref?: Ref<View>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* IconButton Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **An icon button element that can be used to trigger an action**\n *\n * Features animated scale effect on press and smooth color transitions\n * matching the web UDS IconButton behavior.\n *\n * @example\n * ```tsx\n * import { IconButton } from '@yahoo/uds-mobile';\n *\n * <IconButton name=\"Add\" onPress={() => console.log('pressed')} />\n * <IconButton name=\"Close\" variant=\"secondary\" size=\"sm\" />\n * <IconButton name=\"Settings\" loading />\n * ```\n */\nconst IconButton = memo(function IconButton({\n name,\n variant = 'primary',\n size = 'md',\n iconVariant = 'outline',\n loading,\n disabled,\n style,\n accessibilityLabel,\n accessibilityHint,\n disableEffects = false,\n onPressIn,\n onPressOut,\n ref,\n ...props\n}: IconButtonProps) {\n const isDisabled = disabled || loading;\n const shouldAnimate = !disableEffects && !isDisabled;\n\n /* --------------------------------- State ---------------------------------- */\n const [pressed, setPressed] = useState(false);\n\n // Apply layer-based styles with compound variant support\n iconButtonStyles.useVariants({ size });\n buttonStyles.useVariants({ variant, disabled: isDisabled, pressed });\n\n // Animate colors using Unistyles' useAnimatedVariantColor\n const backgroundColor = useAnimatedVariantColor(buttonStyles.root, 'backgroundColor');\n const borderColor = useAnimatedVariantColor(buttonStyles.root, 'borderColor');\n\n // Get animated theme for boxShadow\n const animatedTheme = useAnimatedTheme();\n\n /* ------------------------------- Animation -------------------------------- */\n const scale = useSharedValue<number>(SCALE_EFFECTS.none);\n\n const handlePressIn = useCallback<NonNullable<PressableProps['onPressIn']>>(\n (event) => {\n setPressed(true);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.down, BUTTON_SPRING_CONFIG);\n }\n onPressIn?.(event);\n },\n [shouldAnimate, scale, onPressIn],\n );\n\n const handlePressOut = useCallback<NonNullable<PressableProps['onPressOut']>>(\n (event) => {\n setPressed(false);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG);\n }\n onPressOut?.(event);\n },\n [shouldAnimate, scale, onPressOut],\n );\n\n const a11yState = useMemo(() => ({ disabled: isDisabled, busy: loading }), [isDisabled, loading]);\n\n /* --------------------------------- Styles --------------------------------- */\n // Animate pressed state for shadow\n const pressProgress = useDerivedValue(\n () => withTiming(pressed ? 1 : 0, { duration: 220, easing: Easing.bezier(0, 0, 0.2, 1) }),\n [pressed],\n );\n\n // Animate using Unistyles' variant color system + boxShadow from theme\n const animatedRootStyle = useAnimatedStyle(() => {\n // Get boxShadow from theme using flattened path (no camelCase conversion needed!)\n const components = animatedTheme.value.components as unknown as Record<\n string,\n Record<string, unknown>\n >;\n const shadowPressed =\n (components[`button/variant/${variant}/root/pressed`]?.boxShadow as string) ?? '';\n\n return {\n transform: [{ scale: scale.value }],\n backgroundColor: withTiming(backgroundColor.value, {\n duration: 220,\n easing: Easing.bezier(0, 0, 0.2, 1),\n }),\n borderColor: withTiming(borderColor.value, {\n duration: 220,\n easing: Easing.bezier(0, 0, 0.2, 1),\n }),\n boxShadow: interpolateShadowAlpha(shadowPressed, pressProgress.value),\n };\n });\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <AnimatedPressable\n ref={ref}\n disabled={isDisabled}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n accessibilityLabel={loading ? `${accessibilityLabel ?? ''}, loading` : accessibilityLabel}\n accessibilityHint={accessibilityHint}\n accessibilityRole=\"button\"\n accessibilityState={a11yState}\n style={[\n iconButtonStyles.root,\n buttonStyles.root,\n foundationStyles.foundation,\n animatedRootStyle,\n typeof style === 'function' ? style({ pressed }) : style,\n ]}\n {...props}\n >\n {loading ? (\n <ActivityIndicator size={buttonStyles.icon.fontSize} color={buttonStyles.icon.color} />\n ) : (\n <Icon name={name} variant={iconVariant} style={buttonStyles.icon} />\n )}\n </AnimatedPressable>\n );\n});\n\nIconButton.displayName = 'IconButton';\n\nexport { IconButton, type IconButtonProps };\n"],"mappings":";;;;;;;;;;;;;AA0BA,SAAS,uBAAuB,QAAgB,OAAuB;AACrE;AACA,KAAI,CAAC,UAAU,SAAS,EACtB,QAAO;AAET,KAAI,SAAS,EACX,QAAO;AAGT,QAAO,OAAO,QAAQ,sDAAsD,GAAG,GAAG,GAAG,GAAG,MAAM;AAE5F,SAAO,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KADZ,WAAW,EAAE,GAAG,OACS,QAAQ,EAAE,CAAC;GACrD;;;;;;;;;;;;;;;;;AA4CJ,MAAM,aAAa,KAAK,SAASA,aAAW,EAC1C,MACA,UAAU,WACV,OAAO,MACP,cAAc,WACd,SACA,UACA,OACA,oBACA,mBACA,iBAAiB,OACjB,WACA,YACA,KACA,GAAG,SACe;CAClB,MAAM,aAAa,YAAY;CAC/B,MAAM,gBAAgB,CAAC,kBAAkB,CAAC;CAG1C,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;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AGF,QACE,oBAAC;EACM;EACL,UAAU;EACV,WAAW;EACX,YAAY;EACZ,eAAc;EACd,YAAW;EACX,gBAAe;EACf,UAAS;EACT,oBAAoB,UAAU,GAAG,sBAAsB,GAAG,aAAa;EACpD;EACnB,mBAAkB;EAClB,oBAAoB;EACpB,OAAO;GACL,iBAAiB;GACjB,aAAa;GACbC,OAAiB;GACjB;GACA,OAAO,UAAU,aAAa,MAAM,EAAE,SAAS,CAAC,GAAG;GACpD;EACD,GAAI;YAEH,UACC,oBAAC;GAAkB,MAAM,aAAa,KAAK;GAAU,OAAO,aAAa,KAAK;IAAS,GAEvF,oBAAC;GAAW;GAAM,SAAS;GAAa,OAAO,aAAa;IAAQ;GAEpD;EAEtB;AAEF,WAAW,cAAc"}
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { IconName, IconProps } from "./Icon.cjs";
3
- import * as react9 from "react";
3
+ import * as react5 from "react";
4
4
  import { ReactElement, Ref } from "react";
5
5
  import { Text } from "react-native";
6
6
 
@@ -39,7 +39,7 @@ interface IconSlotProps extends IconPropsWithoutName {
39
39
  * - Pass Icon component for custom props
40
40
  * - Pass function for dynamic rendering
41
41
  */
42
- declare const IconSlot: react9.NamedExoticComponent<IconSlotProps>;
42
+ declare const IconSlot: react5.NamedExoticComponent<IconSlotProps>;
43
43
  //#endregion
44
44
  export { IconSlot, type IconSlotProps, type IconSlotType };
45
45
  //# sourceMappingURL=IconSlot.d.cts.map
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { IconName, IconProps } from "./Icon.mjs";
3
- import * as react8 from "react";
3
+ import * as react16 from "react";
4
4
  import { ReactElement, Ref } from "react";
5
5
  import { Text } from "react-native";
6
6
 
@@ -39,7 +39,7 @@ interface IconSlotProps extends IconPropsWithoutName {
39
39
  * - Pass Icon component for custom props
40
40
  * - Pass function for dynamic rendering
41
41
  */
42
- declare const IconSlot: react8.NamedExoticComponent<IconSlotProps>;
42
+ declare const IconSlot: react16.NamedExoticComponent<IconSlotProps>;
43
43
  //#endregion
44
44
  export { IconSlot, type IconSlotProps, type IconSlotType };
45
45
  //# sourceMappingURL=IconSlot.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconSlot.d.mts","names":[],"sources":["../../src/components/IconSlot.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAOK,oBAAA,GAAuB,KAAK;KAE5B,YAAA,GACD,WACA,aAAa,0BACA,yBAAyB,aAAa;UAE7C,aAAA,SAAsB;EAP3B,GAAA,CAAA,EAQG,GARH,CAQO,IARP,CAAA;EAEA;EACD,IAAA,CAAA,EAOK,YAPL;;;;;;;AAEkD;;;;;;AAEF;;;;;;;;;;;;;;;;cAkC9C,UAAQ,MAAA,CAAA,qBAAA"}
1
+ {"version":3,"file":"IconSlot.d.mts","names":[],"sources":["../../src/components/IconSlot.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAOK,oBAAA,GAAuB,KAAK;KAE5B,YAAA,GACD,WACA,aAAa,0BACA,yBAAyB,aAAa;UAE7C,aAAA,SAAsB;EAP3B,GAAA,CAAA,EAQG,GARH,CAQO,IARP,CAAA;EAEA;EACD,IAAA,CAAA,EAOK,YAPL;;;;;;;AAEkD;;;;;;AAEF;;;;;;;;;;;;;;;;cAkC9C,UAAQ,OAAA,CAAA,qBAAA"}
@@ -1,6 +1,6 @@
1
1
 
2
- import { UniversalImageProps } from "../types/dist/index.cjs";
3
- import * as react10 from "react";
2
+ import { UniversalImageProps } from "../uds/dist/tokens/types.cjs";
3
+ import * as react12 from "react";
4
4
  import { Ref } from "react";
5
5
  import { Image as Image$1, ImageProps as ImageProps$1 } from "react-native";
6
6
  import { StyleProps } from "../../generated/styles";
@@ -79,7 +79,7 @@ interface ImageProps extends Omit<ImageProps$1, 'source' | 'src' | 'width' | 'he
79
79
  * <Image src={require('./local-image.png')} contentFit="cover" borderRadius="md" />
80
80
  * ```
81
81
  */
82
- declare const Image: react10.NamedExoticComponent<ImageProps>;
82
+ declare const Image: react12.NamedExoticComponent<ImageProps>;
83
83
  //#endregion
84
84
  export { Image, type ImageProps };
85
85
  //# sourceMappingURL=Image.d.cts.map
@@ -1,6 +1,6 @@
1
1
 
2
- import { UniversalImageProps } from "../types/dist/index.mjs";
3
- import * as react9 from "react";
2
+ import { UniversalImageProps } from "../uds/dist/tokens/types.mjs";
3
+ import * as react19 from "react";
4
4
  import { Ref } from "react";
5
5
  import { Image as Image$1, ImageProps as ImageProps$1 } from "react-native";
6
6
  import { StyleProps } from "../../generated/styles";
@@ -79,7 +79,7 @@ interface ImageProps extends Omit<ImageProps$1, 'source' | 'src' | 'width' | 'he
79
79
  * <Image src={require('./local-image.png')} contentFit="cover" borderRadius="md" />
80
80
  * ```
81
81
  */
82
- declare const Image: react9.NamedExoticComponent<ImageProps>;
82
+ declare const Image: react19.NamedExoticComponent<ImageProps>;
83
83
  //#endregion
84
84
  export { Image, type ImageProps };
85
85
  //# sourceMappingURL=Image.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.d.mts","names":[],"sources":["../../src/components/Image.tsx"],"sourcesContent":[],"mappings":";;;;;;;;KASK,UAAA,GAAa,YAAY;UAUpB,UAAA,SAAmB,KAC3B;EAXG,GAAA,CAAA,EAcG,GAdH,CAcO,OAdG,CAAA;EAUL;EACR,GAAA,EAKK,mBALL,CAAA,KAAA,CAAA;EAGU;EAAJ,GAAA,CAAA,EAAA,MAAA;EAED;EAQQ,KAAA,CAAA,EAAA,MAAA;EAEK;EAEH,MAAA,CAAA,EAAA,MAAA;EACQ;EACF,UAAA,CAAA,EANR,UAMQ;EACK,eAAA,CAAA,EALR,UAKQ,CAAA,iBAAA,CAAA;EACF,YAAA,CAAA,EAJT,UAIS,CAAA,cAAA,CAAA;EACV,oBAAA,CAAA,EAJS,UAIT,CAAA,sBAAA,CAAA;EACK,kBAAA,CAAA,EAJE,UAIF,CAAA,oBAAA,CAAA;EACF,uBAAA,CAAA,EAJS,UAIT,CAAA,yBAAA,CAAA;EACA,qBAAA,CAAA,EAJO,UAIP,CAA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A,SAAA,CAAA;EACE,iBAAA,CAAA,EAJK,UAIL,CAAA,mBAAA,CAAA;EACF,eAAA,CAAA,EAJK,UAIL,CAAA,iBAAA,CAAA;EACJ,aAAA,CAAA,EAJO,UAIP,CAAA,eAAA,CAAA;EACQ,UAAA,CAAA,EAJJ,UAII,CAAA,YAAA,CAAA;EACE,YAAA,CAAA,EAJJ,UAII,CAAA,cAAA,CAAA;EACJ,UAAA,CAAA,EAJF,UAIE,CAAA,YAAA,CAAA;EACH,MAAA,CAAA,EAJH,UAIG,CAAA,QAAA,CAAA;EACE,cAAA,CAAA,EAJG,UAIH,CAAA,gBAAA,CAAA;EACF,gBAAA,CAAA,EAJO,UAIP,CAAA,kBAAA,CAAA;EACA,YAAA,CAAA,EAJG,UAIH,CAAA,cAAA,CAAA;EACH,SAAA,CAAA,EAJG,UAIH,CAAA,WAAA,CAAA;EAhEkB,WAAA,CAAA,EA6Db,UA7Da,CAAA,aAAA,CAAA;EAAI,SAAA,CAAA,EA8DnB,UA9DmB,CAAA,WAAA,CAAA;EAiF3B,SAmIJ,CAAA,EArJY,UAkBH,CAAA,WAAA,CAAA;WAjBA;;;;;;;;;;;;;;;;cAiBL,OAAK,OAAA,CAAA,qBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Image.mjs","names":["CONTENT_FIT_TO_RESIZE_MODE: Record<ContentFit, ImageStyle['resizeMode']>","Image","RNImage"],"sources":["../../src/components/Image.tsx"],"sourcesContent":["import type { UniversalImageProps } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { memo, useMemo } from 'react';\nimport type { ImageProps as RNImageProps, ImageStyle } from 'react-native';\nimport { Image as RNImage } from 'react-native';\n\nimport type { StyleProps } from '../../generated/styles';\nimport { styles } from '../../generated/styles';\n\ntype ContentFit = NonNullable<UniversalImageProps['contentFit']>;\n\nconst CONTENT_FIT_TO_RESIZE_MODE: Record<ContentFit, ImageStyle['resizeMode']> = {\n cover: 'cover',\n contain: 'contain',\n fill: 'stretch',\n none: 'center',\n 'scale-down': 'contain',\n};\n\ninterface ImageProps extends Omit<\n RNImageProps,\n 'source' | 'src' | 'width' | 'height' | 'borderRadius'\n> {\n ref?: Ref<RNImage>;\n /** Image source URL or require() */\n src: UniversalImageProps['src'];\n /** Alt text for accessibility */\n alt?: string;\n /** Image width */\n width?: number;\n /** Image height */\n height?: number;\n /** How to fit the image within its container */\n contentFit?: ContentFit;\n // Background\n backgroundColor?: StyleProps['backgroundColor'];\n // Border\n borderRadius?: StyleProps['borderRadius'];\n borderTopStartRadius?: StyleProps['borderTopStartRadius'];\n borderTopEndRadius?: StyleProps['borderTopEndRadius'];\n borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];\n borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];\n borderColor?: StyleProps['borderColor'];\n borderStartColor?: StyleProps['borderStartColor'];\n borderEndColor?: StyleProps['borderEndColor'];\n borderTopColor?: StyleProps['borderTopColor'];\n borderBottomColor?: StyleProps['borderBottomColor'];\n borderWidth?: StyleProps['borderWidth'];\n borderVerticalWidth?: StyleProps['borderVerticalWidth'];\n borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];\n borderStartWidth?: StyleProps['borderStartWidth'];\n borderEndWidth?: StyleProps['borderEndWidth'];\n borderTopWidth?: StyleProps['borderTopWidth'];\n borderBottomWidth?: StyleProps['borderBottomWidth'];\n // Flex\n alignContent?: StyleProps['alignContent'];\n alignItems?: StyleProps['alignItems'];\n alignSelf?: StyleProps['alignSelf'];\n flex?: StyleProps['flex'];\n flexDirection?: StyleProps['flexDirection'];\n flexGrow?: StyleProps['flexGrow'];\n flexShrink?: StyleProps['flexShrink'];\n flexWrap?: StyleProps['flexWrap'];\n justifyContent?: StyleProps['justifyContent'];\n // Layout\n display?: StyleProps['display'];\n overflow?: StyleProps['overflow'];\n // Spacing\n spacing?: StyleProps['spacing'];\n spacingHorizontal?: StyleProps['spacingHorizontal'];\n spacingVertical?: StyleProps['spacingVertical'];\n spacingBottom?: StyleProps['spacingBottom'];\n spacingEnd?: StyleProps['spacingEnd'];\n spacingStart?: StyleProps['spacingStart'];\n spacingTop?: StyleProps['spacingTop'];\n offset?: StyleProps['offset'];\n offsetVertical?: StyleProps['offsetVertical'];\n offsetHorizontal?: StyleProps['offsetHorizontal'];\n offsetBottom?: StyleProps['offsetBottom'];\n offsetEnd?: StyleProps['offsetEnd'];\n offsetStart?: StyleProps['offsetStart'];\n offsetTop?: StyleProps['offsetTop'];\n columnGap?: StyleProps['columnGap'];\n rowGap?: StyleProps['rowGap'];\n}\n\n/**\n * **A component for displaying images**\n *\n * @description\n * Wrapper for the React Native Image component with UDS styling props.\n *\n * @example\n * ```tsx\n * import { Image } from '~/components/ui/Image';\n *\n * <Image src=\"https://example.com/image.png\" width={200} height={150} />\n * <Image src={require('./local-image.png')} contentFit=\"cover\" borderRadius=\"md\" />\n * ```\n */\nconst Image = memo(function Image({\n src,\n alt,\n width,\n height,\n contentFit = 'cover',\n style,\n // background\n backgroundColor,\n // border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // flex\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n flexWrap,\n justifyContent,\n // layout\n display,\n overflow,\n // spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n columnGap,\n rowGap,\n ref,\n ...props\n}: ImageProps) {\n // Apply styles using useVariants\n styles.useVariants({\n backgroundColor,\n // border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // flex\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n flexWrap,\n justifyContent,\n // layout\n display,\n overflow,\n // spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n columnGap,\n rowGap,\n });\n\n const source = useMemo(() => (typeof src === 'string' ? { uri: src } : src), [src]);\n\n // styles.foundation must be in deps - it returns a new reference when variants change\n const imageStyles = useMemo(\n () => [styles.foundation as ImageStyle, { width, height }, style],\n [styles.foundation, width, height, style],\n );\n\n return (\n <RNImage\n ref={ref}\n source={source}\n accessibilityLabel={alt}\n resizeMode={CONTENT_FIT_TO_RESIZE_MODE[contentFit]}\n style={imageStyles}\n {...props}\n />\n );\n});\n\nImage.displayName = 'Image';\n\nexport { Image, type ImageProps };\n"],"mappings":";;;;;;;AAWA,MAAMA,6BAA2E;CAC/E,OAAO;CACP,SAAS;CACT,MAAM;CACN,MAAM;CACN,cAAc;CACf;;;;;;;;;;;;;;;AAmFD,MAAM,QAAQ,KAAK,SAASC,QAAM,EAChC,KACA,KACA,OACA,QACA,aAAa,SACb,OAEA,iBAEA,cACA,sBACA,oBACA,yBACA,uBACA,aACA,kBACA,gBACA,gBACA,mBACA,aACA,qBACA,uBACA,kBACA,gBACA,gBACA,mBAEA,cACA,YACA,WACA,MACA,eACA,UACA,YACA,UACA,gBAEA,SACA,UAEA,SACA,mBACA,iBACA,eACA,YACA,cACA,YACA,QACA,gBACA,kBACA,cACA,WACA,aACA,WACA,WACA,QACA,KACA,GAAG,SACU;AAEb,QAAO,YAAY;EACjB;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,SAAS,cAAe,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAG,KAAM,CAAC,IAAI,CAAC;CAGnF,MAAM,cAAc,cACZ;EAAC,OAAO;EAA0B;GAAE;GAAO;GAAQ;EAAE;EAAM,EACjE;EAAC,OAAO;EAAY;EAAO;EAAQ;EAAM,CAC1C;AAED,QACE,oBAACC;EACM;EACG;EACR,oBAAoB;EACpB,YAAY,2BAA2B;EACvC,OAAO;EACP,GAAI;GACJ;EAEJ;AAEF,MAAM,cAAc"}
1
+ {"version":3,"file":"Image.mjs","names":["CONTENT_FIT_TO_RESIZE_MODE: Record<ContentFit, ImageStyle['resizeMode']>","Image","RNImage"],"sources":["../../src/components/Image.tsx"],"sourcesContent":["import type { UniversalImageProps } from '@yahoo/uds/tokens';\nimport type { Ref } from 'react';\nimport { memo, useMemo } from 'react';\nimport type { ImageProps as RNImageProps, ImageStyle } from 'react-native';\nimport { Image as RNImage } from 'react-native';\n\nimport type { StyleProps } from '../../generated/styles';\nimport { styles } from '../../generated/styles';\n\ntype ContentFit = NonNullable<UniversalImageProps['contentFit']>;\n\nconst CONTENT_FIT_TO_RESIZE_MODE: Record<ContentFit, ImageStyle['resizeMode']> = {\n cover: 'cover',\n contain: 'contain',\n fill: 'stretch',\n none: 'center',\n 'scale-down': 'contain',\n};\n\ninterface ImageProps extends Omit<\n RNImageProps,\n 'source' | 'src' | 'width' | 'height' | 'borderRadius'\n> {\n ref?: Ref<RNImage>;\n /** Image source URL or require() */\n src: UniversalImageProps['src'];\n /** Alt text for accessibility */\n alt?: string;\n /** Image width */\n width?: number;\n /** Image height */\n height?: number;\n /** How to fit the image within its container */\n contentFit?: ContentFit;\n // Background\n backgroundColor?: StyleProps['backgroundColor'];\n // Border\n borderRadius?: StyleProps['borderRadius'];\n borderTopStartRadius?: StyleProps['borderTopStartRadius'];\n borderTopEndRadius?: StyleProps['borderTopEndRadius'];\n borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];\n borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];\n borderColor?: StyleProps['borderColor'];\n borderStartColor?: StyleProps['borderStartColor'];\n borderEndColor?: StyleProps['borderEndColor'];\n borderTopColor?: StyleProps['borderTopColor'];\n borderBottomColor?: StyleProps['borderBottomColor'];\n borderWidth?: StyleProps['borderWidth'];\n borderVerticalWidth?: StyleProps['borderVerticalWidth'];\n borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];\n borderStartWidth?: StyleProps['borderStartWidth'];\n borderEndWidth?: StyleProps['borderEndWidth'];\n borderTopWidth?: StyleProps['borderTopWidth'];\n borderBottomWidth?: StyleProps['borderBottomWidth'];\n // Flex\n alignContent?: StyleProps['alignContent'];\n alignItems?: StyleProps['alignItems'];\n alignSelf?: StyleProps['alignSelf'];\n flex?: StyleProps['flex'];\n flexDirection?: StyleProps['flexDirection'];\n flexGrow?: StyleProps['flexGrow'];\n flexShrink?: StyleProps['flexShrink'];\n flexWrap?: StyleProps['flexWrap'];\n justifyContent?: StyleProps['justifyContent'];\n // Layout\n display?: StyleProps['display'];\n overflow?: StyleProps['overflow'];\n // Spacing\n spacing?: StyleProps['spacing'];\n spacingHorizontal?: StyleProps['spacingHorizontal'];\n spacingVertical?: StyleProps['spacingVertical'];\n spacingBottom?: StyleProps['spacingBottom'];\n spacingEnd?: StyleProps['spacingEnd'];\n spacingStart?: StyleProps['spacingStart'];\n spacingTop?: StyleProps['spacingTop'];\n offset?: StyleProps['offset'];\n offsetVertical?: StyleProps['offsetVertical'];\n offsetHorizontal?: StyleProps['offsetHorizontal'];\n offsetBottom?: StyleProps['offsetBottom'];\n offsetEnd?: StyleProps['offsetEnd'];\n offsetStart?: StyleProps['offsetStart'];\n offsetTop?: StyleProps['offsetTop'];\n columnGap?: StyleProps['columnGap'];\n rowGap?: StyleProps['rowGap'];\n}\n\n/**\n * **A component for displaying images**\n *\n * @description\n * Wrapper for the React Native Image component with UDS styling props.\n *\n * @example\n * ```tsx\n * import { Image } from '~/components/ui/Image';\n *\n * <Image src=\"https://example.com/image.png\" width={200} height={150} />\n * <Image src={require('./local-image.png')} contentFit=\"cover\" borderRadius=\"md\" />\n * ```\n */\nconst Image = memo(function Image({\n src,\n alt,\n width,\n height,\n contentFit = 'cover',\n style,\n // background\n backgroundColor,\n // border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // flex\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n flexWrap,\n justifyContent,\n // layout\n display,\n overflow,\n // spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n columnGap,\n rowGap,\n ref,\n ...props\n}: ImageProps) {\n // Apply styles using useVariants\n styles.useVariants({\n backgroundColor,\n // border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // flex\n alignContent,\n alignItems,\n alignSelf,\n flex,\n flexDirection,\n flexGrow,\n flexShrink,\n flexWrap,\n justifyContent,\n // layout\n display,\n overflow,\n // spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n columnGap,\n rowGap,\n });\n\n const source = useMemo(() => (typeof src === 'string' ? { uri: src } : src), [src]);\n\n // styles.foundation must be in deps - it returns a new reference when variants change\n const imageStyles = useMemo(\n () => [styles.foundation as ImageStyle, { width, height }, style],\n [styles.foundation, width, height, style],\n );\n\n return (\n <RNImage\n ref={ref}\n source={source}\n accessibilityLabel={alt}\n resizeMode={CONTENT_FIT_TO_RESIZE_MODE[contentFit]}\n style={imageStyles}\n {...props}\n />\n );\n});\n\nImage.displayName = 'Image';\n\nexport { Image, type ImageProps };\n"],"mappings":";;;;;;;AAWA,MAAMA,6BAA2E;CAC/E,OAAO;CACP,SAAS;CACT,MAAM;CACN,MAAM;CACN,cAAc;CACf;;;;;;;;;;;;;;;AAmFD,MAAM,QAAQ,KAAK,SAASC,QAAM,EAChC,KACA,KACA,OACA,QACA,aAAa,SACb,OAEA,iBAEA,cACA,sBACA,oBACA,yBACA,uBACA,aACA,kBACA,gBACA,gBACA,mBACA,aACA,qBACA,uBACA,kBACA,gBACA,gBACA,mBAEA,cACA,YACA,WACA,MACA,eACA,UACA,YACA,UACA,gBAEA,SACA,UAEA,SACA,mBACA,iBACA,eACA,YACA,cACA,YACA,QACA,gBACA,kBACA,cACA,WACA,aACA,WACA,WACA,QACA,KACA,GAAG,SACU;AAEb,QAAO,YAAY;EACjB;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,SAAS,cAAe,OAAO,QAAQ,WAAW,EAAE,KAAK,KAAK,GAAG,KAAM,CAAC,IAAI,CAAC;CAGnF,MAAM,cAAc,cACZ;EAAC,OAAO;EAA0B;GAAE;GAAO;GAAQ;EAAE;EAAM,EACjE;EAAC,OAAO;EAAY;EAAO;EAAQ;EAAM,CAC1C;AAED,QACE,oBAACC;EACM;EACG;EACR,oBAAoB;EACpB,YAAY,2BAA2B;EACvC,OAAO;EACP,GAAI;GACJ;EAEJ;AAEF,MAAM,cAAc"}
@@ -1,8 +1,8 @@
1
1
 
2
- import { UniversalInputProps } from "../types/dist/index.cjs";
2
+ import { UniversalInputProps } from "../uds/dist/tokens/types.cjs";
3
3
  import { IconSlotType } from "./IconSlot.cjs";
4
4
  import { SizeProps } from "../types.cjs";
5
- import * as react11 from "react";
5
+ import * as react16 from "react";
6
6
  import { Ref } from "react";
7
7
  import { TextInput, TextInputProps } from "react-native";
8
8
 
@@ -33,7 +33,7 @@ interface InputProps extends Omit<UniversalInputProps<IconSlotType>, 'width'>, O
33
33
  *
34
34
  * @see The {@link https://uds.build/docs/components/input Input Docs} for more info
35
35
  */
36
- declare const Input: react11.NamedExoticComponent<InputProps>;
36
+ declare const Input: react16.NamedExoticComponent<InputProps>;
37
37
  //#endregion
38
38
  export { Input, type InputProps };
39
39
  //# sourceMappingURL=Input.d.cts.map
@@ -1,8 +1,8 @@
1
1
 
2
- import { UniversalInputProps } from "../types/dist/index.mjs";
2
+ import { UniversalInputProps } from "../uds/dist/tokens/types.mjs";
3
3
  import { IconSlotType } from "./IconSlot.mjs";
4
4
  import { SizeProps } from "../types.mjs";
5
- import * as react11 from "react";
5
+ import * as react9 from "react";
6
6
  import { Ref } from "react";
7
7
  import { TextInput, TextInputProps } from "react-native";
8
8
 
@@ -33,7 +33,7 @@ interface InputProps extends Omit<UniversalInputProps<IconSlotType>, 'width'>, O
33
33
  *
34
34
  * @see The {@link https://uds.build/docs/components/input Input Docs} for more info
35
35
  */
36
- declare const Input: react11.NamedExoticComponent<InputProps>;
36
+ declare const Input: react9.NamedExoticComponent<InputProps>;
37
37
  //#endregion
38
38
  export { Input, type InputProps };
39
39
  //# sourceMappingURL=Input.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.mts","names":[],"sources":["../../src/components/Input.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;UAmBU,UAAA,SAEN,KAAK,oBAAoB,yBACzB,KAAK,uCACL,KAAK;QACD,IAAI;AAdmC;;;;;;;;;;;AAavC;;;;;;;;;;;;;cA+BF,OAAK,OAAA,CAAA,qBAAA"}
1
+ {"version":3,"file":"Input.d.mts","names":[],"sources":["../../src/components/Input.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;UAmBU,UAAA,SAEN,KAAK,oBAAoB,yBACzB,KAAK,uCACL,KAAK;QACD,IAAI;AAdmC;;;;;;;;;;;AAavC;;;;;;;;;;;;;cA+BF,OAAK,MAAA,CAAA,qBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.mjs","names":["Input","Text"],"sources":["../../src/components/Input.tsx"],"sourcesContent":["import type { UniversalInputProps } from '@yahoo/uds-types';\nimport { isFunction } from 'lodash-es';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { TextInputProps } from 'react-native';\nimport { TextInput, View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport type { SizeProps } from '../types';\nimport { HStack } from './HStack';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport { Text } from './Text';\nimport { VStack } from './VStack';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\ninterface InputProps\n extends\n Omit<UniversalInputProps<IconSlotType>, 'width'>,\n Omit<TextInputProps, 'style' | 'editable'>,\n Pick<SizeProps, 'width'> {\n ref?: Ref<TextInput>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **📦 An input that allows users to enter text and collect data.**\n *\n * @description\n * An input field is a component that takes text typed into it. It can also serve\n * as a way to display a selection and trigger a dropdown menu. Inputs are interactive\n * elements that users can click, tap, or otherwise engage with to collect data.\n *\n * @example\n * ```tsx\n * import { Input } from '@yahoo/uds-mobile';\n *\n * <Input label=\"Name\" placeholder=\"Enter your name\" required />\n * ```\n *\n * @usage\n * - Forms: For collecting data like names, emails, passwords, etc.\n * - Search Bars: Allowing users to enter search queries.\n * - Filters/Settings: When users need to specify preferences.\n * - Feedback/Comments: Letting users leave reviews or comments.\n *\n * @see The {@link https://uds.build/docs/components/input Input Docs} for more info\n */\nconst Input = memo(function Input({\n // Input props\n label,\n size = 'md',\n startIcon,\n endIcon,\n helpText,\n helperTextIcon,\n hasError,\n disabled,\n readOnly,\n required,\n // Size props\n width = '100%',\n // TextInput props\n defaultValue,\n value: controlledValue,\n onChangeText,\n onFocus,\n onBlur,\n placeholder,\n placeholderTextColor,\n ref,\n ...textInputProps\n}: InputProps) {\n const generatedId = useId();\n const uid = `uds-input-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const [internalValue, setInternalValue] = useState(defaultValue ?? '');\n const [isFocused, setIsFocused] = useState(false);\n\n // Support both controlled and uncontrolled modes\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : internalValue;\n const valueState = value ? 'filled' : 'empty';\n\n /* -------------------------------- Handlers -------------------------------- */\n const handleChangeText = useCallback(\n (text: string) => {\n if (!isControlled) {\n setInternalValue(text);\n }\n onChangeText?.(text);\n },\n [isControlled, onChangeText],\n );\n\n const handleFocus = useCallback<NonNullable<TextInputProps['onFocus']>>(\n (e) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback<NonNullable<TextInputProps['onBlur']>>(\n (e) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n /* --------------------------------- Styles --------------------------------- */\n inputStyles.useVariants({\n size,\n value: valueState,\n disabled,\n pressed: isFocused,\n readonly: readOnly,\n invalid: hasError,\n });\n\n // Get placeholder color from theme styles\n const computedPlaceholderColor = placeholderTextColor ?? inputStyles.inputPlaceholder.color;\n\n const rootStyle = useMemo(() => [{ width, opacity: disabled ? 0.5 : 1 }], [width, disabled]);\n\n const inputWrapperStyle = useMemo(\n () => [\n inputStyles.inputWrapper,\n { flexDirection: 'row' as const, alignItems: 'center' as const },\n ],\n [inputStyles.inputWrapper],\n );\n\n // Android-specific fixes: TextInput on Android has rendering issues with text visibility\n // - includeFontPadding: false removes Android's extra font padding that can clip text\n // - textAlignVertical: 'center' ensures text is vertically centered in the input\n // - paddingVertical: 0 removes default padding that interferes with flex layout\n const textInputStyle = useMemo(\n () => [\n inputStyles.input,\n {\n flex: 1,\n includeFontPadding: false,\n textAlignVertical: 'center' as const,\n paddingVertical: 0,\n },\n ],\n [inputStyles.input],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n const content = isFunction(label) ? label() : label;\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-end\" spacingBottom=\"2\">\n <Text style={inputStyles.label}>{content}</Text>\n {required && <Text style={inputStyles.labelRequired}>*</Text>}\n </HStack>\n );\n }, [label, required, inputStyles.label, inputStyles.labelRequired]);\n\n const startIconContent = useMemo(() => {\n if (!startIcon) {\n return null;\n }\n return <IconSlot icon={startIcon} variant=\"outline\" style={inputStyles.startIcon} />;\n }, [startIcon, inputStyles.startIcon]);\n\n const endIconContent = useMemo(() => {\n if (!endIcon) {\n return null;\n }\n return <IconSlot icon={endIcon} variant=\"outline\" style={inputStyles.endIcon} />;\n }, [endIcon, inputStyles.endIcon]);\n\n const helpTextContent = useMemo(() => {\n if (!helpText) {\n return null;\n }\n const content = isFunction(helpText) ? helpText() : helpText;\n return (\n <HStack columnGap=\"1\" alignItems=\"center\" spacingTop=\"2\">\n {helperTextIcon && <IconSlot icon={helperTextIcon} style={inputStyles.helperIcon} />}\n <Text style={inputStyles.helperText}>{content}</Text>\n </HStack>\n );\n }, [helpText, helperTextIcon, inputStyles.helperIcon, inputStyles.helperText]);\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <VStack style={rootStyle}>\n {labelContent}\n\n <View\n style={inputWrapperStyle}\n accessible\n accessibilityRole=\"none\"\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n >\n {startIconContent}\n\n <TextInput\n ref={ref}\n nativeID={uid}\n value={value}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n onBlur={handleBlur}\n placeholder={placeholder}\n placeholderTextColor={computedPlaceholderColor}\n editable={!disabled && !readOnly}\n style={textInputStyle}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n accessibilityHint={typeof helpText === 'string' ? helpText : undefined}\n accessibilityState={{ disabled }}\n {...textInputProps}\n />\n\n {endIconContent}\n </View>\n\n {helpTextContent}\n </VStack>\n );\n});\n\nInput.displayName = 'Input';\n\nexport { Input, type InputProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,QAAQ,KAAK,SAASA,QAAM,EAEhC,OACA,OAAO,MACP,WACA,SACA,UACA,gBACA,UACA,UACA,UACA,UAEA,QAAQ,QAER,cACA,OAAO,iBACP,cACA,SACA,QACA,aACA,sBACA,KACA,GAAG,kBACU;CAEb,MAAM,MAAM,aADQ,OAAO;CAI3B,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,GAAG;CACtE,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAGjD,MAAM,eAAe,oBAAoB;CACzC,MAAM,QAAQ,eAAe,kBAAkB;CAC/C,MAAM,aAAa,QAAQ,WAAW;CAGtC,MAAM,mBAAmB,aACtB,SAAiB;AAChB,MAAI,CAAC,aACH,kBAAiB,KAAK;AAExB,iBAAe,KAAK;IAEtB,CAAC,cAAc,aAAa,CAC7B;CAED,MAAM,cAAc,aACjB,MAAM;AACL,eAAa,KAAK;AACl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,CAAC;CAElC,MAAM,kBAAkB,cAAc;AACpC,MAAI,CAAC,SACH,QAAO;EAET,MAAM,UAAU,WAAW,SAAS,GAAG,UAAU,GAAG;AACpD,SACE,qBAAC;GAAO,WAAU;GAAI,YAAW;GAAS,YAAW;cAClD,kBAAkB,oBAAC;IAAS,MAAM;IAAgB,OAAO,YAAY;KAAc,EACpF,oBAACA;IAAK,OAAO,YAAY;cAAa;KAAe;IAC9C;IAEV;EAAC;EAAU;EAAgB,YAAY;EAAY,YAAY;EAAW,CAAC;AAG9E,QACE,qBAAC;EAAO,OAAO;;GACZ;GAED,qBAAC;IACC,OAAO;IACP;IACA,mBAAkB;IAClB,oBAAoB,OAAO,UAAU,WAAW,QAAQ;;KAEvD;KAED,oBAAC;MACM;MACL,UAAU;MACH;MACP,cAAc;MACd,SAAS;MACT,QAAQ;MACK;MACb,sBAAsB;MACtB,UAAU,CAAC,YAAY,CAAC;MACxB,OAAO;MACP,oBAAoB,OAAO,UAAU,WAAW,QAAQ;MACxD,mBAAmB,OAAO,aAAa,WAAW,WAAW;MAC7D,oBAAoB,EAAE,UAAU;MAChC,GAAI;OACJ;KAED;;KACI;GAEN;;GACM;EAEX;AAEF,MAAM,cAAc"}
1
+ {"version":3,"file":"Input.mjs","names":["Input","Text"],"sources":["../../src/components/Input.tsx"],"sourcesContent":["import type { UniversalInputProps } from '@yahoo/uds/tokens';\nimport { isFunction } from 'lodash-es';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { TextInputProps } from 'react-native';\nimport { TextInput, View } from 'react-native';\n\nimport { inputStyles } from '../../generated/styles';\nimport type { SizeProps } from '../types';\nimport { HStack } from './HStack';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport { Text } from './Text';\nimport { VStack } from './VStack';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\ninterface InputProps\n extends\n Omit<UniversalInputProps<IconSlotType>, 'width'>,\n Omit<TextInputProps, 'style' | 'editable'>,\n Pick<SizeProps, 'width'> {\n ref?: Ref<TextInput>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **📦 An input that allows users to enter text and collect data.**\n *\n * @description\n * An input field is a component that takes text typed into it. It can also serve\n * as a way to display a selection and trigger a dropdown menu. Inputs are interactive\n * elements that users can click, tap, or otherwise engage with to collect data.\n *\n * @example\n * ```tsx\n * import { Input } from '@yahoo/uds-mobile';\n *\n * <Input label=\"Name\" placeholder=\"Enter your name\" required />\n * ```\n *\n * @usage\n * - Forms: For collecting data like names, emails, passwords, etc.\n * - Search Bars: Allowing users to enter search queries.\n * - Filters/Settings: When users need to specify preferences.\n * - Feedback/Comments: Letting users leave reviews or comments.\n *\n * @see The {@link https://uds.build/docs/components/input Input Docs} for more info\n */\nconst Input = memo(function Input({\n // Input props\n label,\n size = 'md',\n startIcon,\n endIcon,\n helpText,\n helperTextIcon,\n hasError,\n disabled,\n readOnly,\n required,\n // Size props\n width = '100%',\n // TextInput props\n defaultValue,\n value: controlledValue,\n onChangeText,\n onFocus,\n onBlur,\n placeholder,\n placeholderTextColor,\n ref,\n ...textInputProps\n}: InputProps) {\n const generatedId = useId();\n const uid = `uds-input-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const [internalValue, setInternalValue] = useState(defaultValue ?? '');\n const [isFocused, setIsFocused] = useState(false);\n\n // Support both controlled and uncontrolled modes\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : internalValue;\n const valueState = value ? 'filled' : 'empty';\n\n /* -------------------------------- Handlers -------------------------------- */\n const handleChangeText = useCallback(\n (text: string) => {\n if (!isControlled) {\n setInternalValue(text);\n }\n onChangeText?.(text);\n },\n [isControlled, onChangeText],\n );\n\n const handleFocus = useCallback<NonNullable<TextInputProps['onFocus']>>(\n (e) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback<NonNullable<TextInputProps['onBlur']>>(\n (e) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n /* --------------------------------- Styles --------------------------------- */\n inputStyles.useVariants({\n size,\n value: valueState,\n disabled,\n pressed: isFocused,\n readonly: readOnly,\n invalid: hasError,\n });\n\n // Get placeholder color from theme styles\n const computedPlaceholderColor = placeholderTextColor ?? inputStyles.inputPlaceholder.color;\n\n const rootStyle = useMemo(() => [{ width, opacity: disabled ? 0.5 : 1 }], [width, disabled]);\n\n const inputWrapperStyle = useMemo(\n () => [\n inputStyles.inputWrapper,\n { flexDirection: 'row' as const, alignItems: 'center' as const },\n ],\n [inputStyles.inputWrapper],\n );\n\n // Android-specific fixes: TextInput on Android has rendering issues with text visibility\n // - includeFontPadding: false removes Android's extra font padding that can clip text\n // - textAlignVertical: 'center' ensures text is vertically centered in the input\n // - paddingVertical: 0 removes default padding that interferes with flex layout\n const textInputStyle = useMemo(\n () => [\n inputStyles.input,\n {\n flex: 1,\n includeFontPadding: false,\n textAlignVertical: 'center' as const,\n paddingVertical: 0,\n },\n ],\n [inputStyles.input],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n const content = isFunction(label) ? label() : label;\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-end\" spacingBottom=\"2\">\n <Text style={inputStyles.label}>{content}</Text>\n {required && <Text style={inputStyles.labelRequired}>*</Text>}\n </HStack>\n );\n }, [label, required, inputStyles.label, inputStyles.labelRequired]);\n\n const startIconContent = useMemo(() => {\n if (!startIcon) {\n return null;\n }\n return <IconSlot icon={startIcon} variant=\"outline\" style={inputStyles.startIcon} />;\n }, [startIcon, inputStyles.startIcon]);\n\n const endIconContent = useMemo(() => {\n if (!endIcon) {\n return null;\n }\n return <IconSlot icon={endIcon} variant=\"outline\" style={inputStyles.endIcon} />;\n }, [endIcon, inputStyles.endIcon]);\n\n const helpTextContent = useMemo(() => {\n if (!helpText) {\n return null;\n }\n const content = isFunction(helpText) ? helpText() : helpText;\n return (\n <HStack columnGap=\"1\" alignItems=\"center\" spacingTop=\"2\">\n {helperTextIcon && <IconSlot icon={helperTextIcon} style={inputStyles.helperIcon} />}\n <Text style={inputStyles.helperText}>{content}</Text>\n </HStack>\n );\n }, [helpText, helperTextIcon, inputStyles.helperIcon, inputStyles.helperText]);\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <VStack style={rootStyle}>\n {labelContent}\n\n <View\n style={inputWrapperStyle}\n accessible\n accessibilityRole=\"none\"\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n >\n {startIconContent}\n\n <TextInput\n ref={ref}\n nativeID={uid}\n value={value}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n onBlur={handleBlur}\n placeholder={placeholder}\n placeholderTextColor={computedPlaceholderColor}\n editable={!disabled && !readOnly}\n style={textInputStyle}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n accessibilityHint={typeof helpText === 'string' ? helpText : undefined}\n accessibilityState={{ disabled }}\n {...textInputProps}\n />\n\n {endIconContent}\n </View>\n\n {helpTextContent}\n </VStack>\n );\n});\n\nInput.displayName = 'Input';\n\nexport { Input, type InputProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,QAAQ,KAAK,SAASA,QAAM,EAEhC,OACA,OAAO,MACP,WACA,SACA,UACA,gBACA,UACA,UACA,UACA,UAEA,QAAQ,QAER,cACA,OAAO,iBACP,cACA,SACA,QACA,aACA,sBACA,KACA,GAAG,kBACU;CAEb,MAAM,MAAM,aADQ,OAAO;CAI3B,MAAM,CAAC,eAAe,oBAAoB,SAAS,gBAAgB,GAAG;CACtE,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAGjD,MAAM,eAAe,oBAAoB;CACzC,MAAM,QAAQ,eAAe,kBAAkB;CAC/C,MAAM,aAAa,QAAQ,WAAW;CAGtC,MAAM,mBAAmB,aACtB,SAAi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BAAiB,cAAc;AACnC,MAAI,CAAC,QACH,QAAO;AAET,SAAO,oBAAC;GAAS,MAAM;GAAS,SAAQ;GAAU,OAAO,YAAY;IAAW;IAC/E,CAAC,SAAS,YAAY,QAAQ,CAAC;CAElC,MAAM,kBAAkB,cAAc;AACpC,MAAI,CAAC,SACH,QAAO;EAET,MAAM,UAAU,WAAW,SAAS,GAAG,UAAU,GAAG;AACpD,SACE,qBAAC;GAAO,WAAU;GAAI,YAAW;GAAS,YAAW;cAClD,kBAAkB,oBAAC;IAAS,MAAM;IAAgB,OAAO,YAAY;KAAc,EACpF,oBAACA;IAAK,OAAO,YAAY;cAAa;KAAe;IAC9C;IAEV;EAAC;EAAU;EAAgB,YAAY;EAAY,YAAY;EAAW,CAAC;AAG9E,QACE,qBAAC;EAAO,OAAO;;GACZ;GAED,qBAAC;IACC,OAAO;IACP;IACA,mBAAkB;IAClB,oBAAoB,OAAO,UAAU,WAAW,QAAQ;;KAEvD;KAED,oBAAC;MACM;MACL,UAAU;MACH;MACP,cAAc;MACd,SAAS;MACT,QAAQ;MACK;MACb,sBAAsB;MACtB,UAAU,CAAC,YAAY,CAAC;MACxB,OAAO;MACP,oBAAoB,OAAO,UAAU,WAAW,QAAQ;MACxD,mBAAmB,OAAO,aAAa,WAAW,WAAW;MAC7D,oBAAoB,EAAE,UAAU;MAChC,GAAI;OACJ;KAED;;KACI;GAEN;;GACM;EAEX;AAEF,MAAM,cAAc"}
@@ -1,8 +1,9 @@
1
1
 
2
- import { UniversalLinkProps } from "../types/dist/index.cjs";
2
+ import { UniversalLinkProps } from "../uds/dist/tokens/types.cjs";
3
+ import "../uds/dist/index.cjs";
3
4
  import { IconSlotType } from "./IconSlot.cjs";
4
5
  import { TextProps as TextProps$1 } from "./Text.cjs";
5
- import * as react14 from "react";
6
+ import * as react11 from "react";
6
7
  import { ReactNode, Ref } from "react";
7
8
  import { Text, TextStyle } from "react-native";
8
9
 
@@ -38,7 +39,7 @@ interface LinkProps extends UniversalLinkProps<IconSlotType> {
38
39
  *
39
40
  * @see The {@link https://uds.build/docs/components/link Link Docs} for more info
40
41
  */
41
- declare const Link: react14.NamedExoticComponent<LinkProps>;
42
+ declare const Link: react11.NamedExoticComponent<LinkProps>;
42
43
  //#endregion
43
44
  export { Link, type LinkProps };
44
45
  //# sourceMappingURL=Link.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.cts","names":[],"sources":["../../src/components/Link.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;UAwBU,SAAA,SAAkB,mBAAmB;;EAArC,KAAA,CAAA,EAEA,SAFU;EAA2B,OAAA,CAAA,EAGnC,WAHmC,CAAA,SAAA,CAAA;EAErC,GAAA,CAAA,EAEF,GAFE,CAEE,IAFF,CAAA;EACE,QAAA,CAAA,EAEC,SAFD;;;;;;AAHkC;;;;;;;;;;;;;;;;;;;;cAgCxC,MAAI,OAAA,CAAA,qBAAA"}
1
+ {"version":3,"file":"Link.d.cts","names":[],"sources":["../../src/components/Link.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;UAwBU,SAAA,SAAkB,mBAAmB;;UAErC;EAFA,OAAA,CAAA,EAGE,WAHQ,CAAA,SAAA,CAAA;EAA2B,GAAA,CAAA,EAIvC,GAJuC,CAInC,IAJmC,CAAA;EAErC,QAAA,CAAA,EAGG,SAHH;;;;;;;AAFoC;;;;;;;;;;;;;;;;;;;cAgCxC,MAAI,OAAA,CAAA,qBAAA"}
@@ -1,8 +1,9 @@
1
1
 
2
- import { UniversalLinkProps } from "../types/dist/index.mjs";
2
+ import { UniversalLinkProps } from "../uds/dist/tokens/types.mjs";
3
+ import "../uds/dist/index.mjs";
3
4
  import { IconSlotType } from "./IconSlot.mjs";
4
5
  import { TextProps as TextProps$1 } from "./Text.mjs";
5
- import * as react12 from "react";
6
+ import * as react8 from "react";
6
7
  import { ReactNode, Ref } from "react";
7
8
  import { Text, TextStyle } from "react-native";
8
9
 
@@ -38,7 +39,7 @@ interface LinkProps extends UniversalLinkProps<IconSlotType> {
38
39
  *
39
40
  * @see The {@link https://uds.build/docs/components/link Link Docs} for more info
40
41
  */
41
- declare const Link: react12.NamedExoticComponent<LinkProps>;
42
+ declare const Link: react8.NamedExoticComponent<LinkProps>;
42
43
  //#endregion
43
44
  export { Link, type LinkProps };
44
45
  //# sourceMappingURL=Link.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.mts","names":[],"sources":["../../src/components/Link.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;UAwBU,SAAA,SAAkB,mBAAmB;;EAArC,KAAA,CAAA,EAEA,SAFU;EAA2B,OAAA,CAAA,EAGnC,WAHmC,CAAA,SAAA,CAAA;EAErC,GAAA,CAAA,EAEF,GAFE,CAEE,IAFF,CAAA;EACE,QAAA,CAAA,EAEC,SAFD;;;;;;AAHkC;;;;;;;;;;;;;;;;;;;;cAgCxC,MAAI,OAAA,CAAA,qBAAA"}
1
+ {"version":3,"file":"Link.d.mts","names":[],"sources":["../../src/components/Link.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;UAwBU,SAAA,SAAkB,mBAAmB;;UAErC;EAFA,OAAA,CAAA,EAGE,WAHQ,CAAA,SAAA,CAAA;EAA2B,GAAA,CAAA,EAIvC,GAJuC,CAInC,IAJmC,CAAA;EAErC,QAAA,CAAA,EAGG,SAHH;;;;;;;AAFoC;;;;;;;;;;;;;;;;;;;cAgCxC,MAAI,MAAA,CAAA,qBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Link.mjs","names":["noUnderline: TextStyle","Link","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 */\n style?: TextStyle;\n onPress?: TextProps['onPress'];\n ref?: Ref<RNText>;\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 * @example\n * ```tsx\n * import { Link } from '@yahoo/uds-mobile';\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 * @see The {@link https://uds.build/docs/components/link Link Docs} for more info\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 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 icon={startIcon} variant=\"outline\" style={startIconStyles} />\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 icon={endIcon} variant=\"outline\" style={endIconStyles} />\n </>\n )}\n </AnimatedText>\n );\n});\n\nLink.displayName = 'Link';\n\nexport { Link, type LinkProps };\n"],"mappings":";;;;;;;;;;AAmBA,MAAM,eAAe,SAAS;AAG9B,MAAMA,cAAyB,EAAE,oBAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;AAkC7D,MAAM,OAAO,KAAK,SAASC,OAAK,EAC9B,UACA,UAAU,WACV,aACA,kBAAkB,OAClB,WACA,SACA,SACA,OACA,KACA,GAAG,QACS;CACZ,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,MAAM,gBAAgB,kBAAkB;AACtC,aAAW,KAAK;IACf,EAAE,CAAC;CAEN,MAAM,iBAAiB,kBAAkB;AACvC,aAAW,MAAM;IAChB,EAAE,CAAC;CAIN,MAAM,cAAc,aACjB,UAAiC;AAChC,YAAU,MAAM;IAElB,CAAC,QAAQ,CACV;AAED,YAAW,YAAY;EACrB,WAAW;EACX;EACA;EACD,CAAC;CAGF,MAAM,gBAAgB,kBAAkB;CAIxC,MAAM,oBAAoB,sBAAsB;AAE9C,SAAO,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,WAEf,gBAAgB,QAAQ,YADlC,UAAU,YAAY,UAEU;AAc9C,SAAO;GACL,OAbY,WAAW,WAAW;IAClC,UAAU;IACV,QAAQ,OAAO,OAAO,GAAG,GAAG,IAAK,EAAE;IACpC,CAAC;GAWA,qBARqB,iBACrB,kBAAkB,OAClB,CAAC,GAAG,EAAE,EACN,CAAC,eAAe,UAAU,CAC3B;GAKA;GACD;CAEF,MAAM,aAAa,cAAc;AAC/B,SAAO;GAAC,WAAW;GAAM,WAAW;GAAM;GAAmB;GAAM;IAClE;EAAC,WAAW;EAAM;EAAmB;EAAO,WAAW;EAAK,CAAC;CAEhE,MAAM,kBAAkB,cAAc;AACpC,SAAO;GAAC,WAAW;GAAM,WAAW;GAAW;GAAY;IAC1D;EAAC,WAAW;EAAM,WAAW;EAAW;EAAY,CAAC;CAExD,MAAM,gBAAgB,cAAc;AAClC,SAAO;GAAC,WAAW;GAAM,WAAW;GAAS;GAAY;IACxD;EAAC,WAAW;EAAM,WAAW;EAAS;EAAY,CAAC;AAEtD,QACE,qBAAC;EACM;EACL,SAAS;EACT,WAAW;EACX,YAAY;EACZ;EACA,OAAO;EACP,GAAI;;GAEH,aACC,4CACE,oBAAC;IAAS,MAAM;IAAW,SAAQ;IAAU,OAAO;KAAmB,EAEvE,oBAACC;IAAO,OAAO;cAAc;KAAmB,IAC/C;GAEJ;GACA,WACC,4CAEE,oBAACA;IAAO,OAAO;cAAc;KAAmB,EAChD,oBAAC;IAAS,MAAM;IAAS,SAAQ;IAAU,OAAO;KAAiB,IAClE;;GAEQ;EAEjB;AAEF,KAAK,cAAc"}
1
+ {"version":3,"file":"Link.mjs","names":["noUnderline: TextStyle","Link","RNText"],"sources":["../../src/components/Link.tsx"],"sourcesContent":["import type { UniversalLinkProps } from '@yahoo/uds';\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 */\n style?: TextStyle;\n onPress?: TextProps['onPress'];\n ref?: Ref<RNText>;\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 * @example\n * ```tsx\n * import { Link } from '@yahoo/uds-mobile';\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 * @see The {@link https://uds.build/docs/components/link Link Docs} for more info\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 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 icon={startIcon} variant=\"outline\" style={startIconStyles} />\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 icon={endIcon} variant=\"outline\" style={endIconStyles} />\n </>\n )}\n </AnimatedText>\n );\n});\n\nLink.displayName = 'Link';\n\nexport { Link, type LinkProps };\n"],"mappings":";;;;;;;;;;AAmBA,MAAM,eAAe,SAAS;AAG9B,MAAMA,cAAyB,EAAE,oBAAoB,QAAQ;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AAgB,cAAc;AAClC,SAAO;GAAC,WAAW;GAAM,WAAW;GAAS;GAAY;IACxD;EAAC,WAAW;EAAM,WAAW;EAAS;EAAY,CAAC;AAEtD,QACE,qBAAC;EACM;EACL,SAAS;EACT,WAAW;EACX,YAAY;EACZ;EACA,OAAO;EACP,GAAI;;GAEH,aACC,4CACE,oBAAC;IAAS,MAAM;IAAW,SAAQ;IAAU,OAAO;KAAmB,EAEvE,oBAACC;IAAO,OAAO;cAAc;KAAmB,IAC/C;GAEJ;GACA,WACC,4CAEE,oBAACA;IAAO,OAAO;cAAc;KAAmB,EAChD,oBAAC;IAAS,MAAM;IAAS,SAAQ;IAAU,OAAO;KAAiB,IAClE;;GAEQ;EAEjB;AAEF,KAAK,cAAc"}
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { SizeProps } from "../types.cjs";
3
- import * as react12 from "react";
3
+ import * as react13 from "react";
4
4
  import { Ref } from "react";
5
5
  import { PressableProps as PressableProps$1, View } from "react-native";
6
6
  import { StyleProps } from "../../generated/styles";
@@ -83,8 +83,8 @@ interface PressableProps extends PressableProps$1, SizeProps {
83
83
  *
84
84
  * @see The {@link https://uds.build/docs/components/pressable Pressable Docs} for more info
85
85
  */
86
- declare const Pressable: react12.NamedExoticComponent<PressableProps>;
87
- declare const AnimatedPressable: react12.FunctionComponent<react_native_reanimated0.AnimatedProps<PressableProps>>;
86
+ declare const Pressable: react13.NamedExoticComponent<PressableProps>;
87
+ declare const AnimatedPressable: react13.FunctionComponent<react_native_reanimated0.AnimatedProps<PressableProps>>;
88
88
  //#endregion
89
89
  export { AnimatedPressable, Pressable, type PressableProps };
90
90
  //# sourceMappingURL=Pressable.d.cts.map
@@ -1,6 +1,6 @@
1
1
 
2
2
  import { SizeProps } from "../types.mjs";
3
- import * as react13 from "react";
3
+ import * as react14 from "react";
4
4
  import { Ref } from "react";
5
5
  import { PressableProps as PressableProps$1, View } from "react-native";
6
6
  import { StyleProps } from "../../generated/styles";
@@ -83,8 +83,8 @@ interface PressableProps extends PressableProps$1, SizeProps {
83
83
  *
84
84
  * @see The {@link https://uds.build/docs/components/pressable Pressable Docs} for more info
85
85
  */
86
- declare const Pressable: react13.NamedExoticComponent<PressableProps>;
87
- declare const AnimatedPressable: react13.FunctionComponent<react_native_reanimated0.AnimatedProps<PressableProps>>;
86
+ declare const Pressable: react14.NamedExoticComponent<PressableProps>;
87
+ declare const AnimatedPressable: react14.FunctionComponent<react_native_reanimated0.AnimatedProps<PressableProps>>;
88
88
  //#endregion
89
89
  export { AnimatedPressable, Pressable, type PressableProps };
90
90
  //# sourceMappingURL=Pressable.d.mts.map
@@ -1,7 +1,7 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
2
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
3
- const require_index = require('../motion-tokens/dist/index.cjs');
4
- const require_motion = require('../motion.cjs');
3
+ const require_motion = require('../uds/dist/tokens/configs/motion.cjs');
4
+ const require_motion$1 = require('../motion.cjs');
5
5
  const require_components_Text = require('./Text.cjs');
6
6
  const require_components_HStack = require('./HStack.cjs');
7
7
  const require_components_Pressable = require('./Pressable.cjs');
@@ -50,8 +50,8 @@ const Radio = (0, react.memo)(function Radio$1({ label, labelPosition = "start",
50
50
  return checked ? "checked" : "unchecked";
51
51
  }, [checked]);
52
52
  const shouldAnimate = !reduceMotion;
53
- const scaleProgress = (0, react_native_reanimated.useDerivedValue)(() => shouldAnimate ? (0, react_native_reanimated.withSpring)(pressed ? require_index.SCALE_EFFECTS.down : require_index.SCALE_EFFECTS.none, require_motion.BUTTON_SPRING_CONFIG) : require_index.SCALE_EFFECTS.none, [pressed, shouldAnimate]);
54
- const circleProgress = (0, react_native_reanimated.useDerivedValue)(() => shouldAnimate ? (0, react_native_reanimated.withSpring)(checked ? 1 : 0, require_motion.BUTTON_SPRING_CONFIG) : checked ? 1 : 0, [checked, shouldAnimate]);
53
+ const scaleProgress = (0, react_native_reanimated.useDerivedValue)(() => shouldAnimate ? (0, react_native_reanimated.withSpring)(pressed ? require_motion.SCALE_EFFECTS.down : require_motion.SCALE_EFFECTS.none, require_motion$1.BUTTON_SPRING_CONFIG) : require_motion.SCALE_EFFECTS.none, [pressed, shouldAnimate]);
54
+ const circleProgress = (0, react_native_reanimated.useDerivedValue)(() => shouldAnimate ? (0, react_native_reanimated.withSpring)(checked ? 1 : 0, require_motion$1.BUTTON_SPRING_CONFIG) : checked ? 1 : 0, [checked, shouldAnimate]);
55
55
  const radioAnimatedStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ transform: [{ scale: scaleProgress.value }] }));
56
56
  const circleAnimatedStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({
57
57
  opacity: (0, react_native_reanimated.interpolate)(circleProgress.value, [0, 1], [0, 1]),
@@ -1,6 +1,6 @@
1
1
 
2
- import { UniversalRadioProps } from "../types/dist/index.cjs";
3
- import * as react19 from "react";
2
+ import { UniversalRadioProps } from "../uds/dist/tokens/types.cjs";
3
+ import * as react18 from "react";
4
4
  import { Ref } from "react";
5
5
  import { View, ViewProps } from "react-native";
6
6
 
@@ -40,7 +40,7 @@ interface RadioProps extends Omit<ViewProps, 'style'>, UniversalRadioProps {
40
40
  *
41
41
  * @see The {@link https://uds.build/docs/components/radio Radio Docs} for more info
42
42
  */
43
- declare const Radio: react19.NamedExoticComponent<RadioProps>;
43
+ declare const Radio: react18.NamedExoticComponent<RadioProps>;
44
44
  //#endregion
45
45
  export { Radio, type RadioProps };
46
46
  //# sourceMappingURL=Radio.d.cts.map
@@ -1,6 +1,6 @@
1
1
 
2
- import { UniversalRadioProps } from "../types/dist/index.mjs";
3
- import * as react17 from "react";
2
+ import { UniversalRadioProps } from "../uds/dist/tokens/types.mjs";
3
+ import * as react10 from "react";
4
4
  import { Ref } from "react";
5
5
  import { View, ViewProps } from "react-native";
6
6
 
@@ -40,7 +40,7 @@ interface RadioProps extends Omit<ViewProps, 'style'>, UniversalRadioProps {
40
40
  *
41
41
  * @see The {@link https://uds.build/docs/components/radio Radio Docs} for more info
42
42
  */
43
- declare const Radio: react17.NamedExoticComponent<RadioProps>;
43
+ declare const Radio: react10.NamedExoticComponent<RadioProps>;
44
44
  //#endregion
45
45
  export { Radio, type RadioProps };
46
46
  //# sourceMappingURL=Radio.d.mts.map
@@ -1,5 +1,5 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- import { SCALE_EFFECTS } from "../motion-tokens/dist/index.mjs";
2
+ import { SCALE_EFFECTS } from "../uds/dist/tokens/configs/motion.mjs";
3
3
  import { BUTTON_SPRING_CONFIG } from "../motion.mjs";
4
4
  import { Text } from "./Text.mjs";
5
5
  import { HStack } from "./HStack.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.mjs","names":["VARIANT_ERROR_MAP: Record<RadioVariant, RadioStyleVariant>","Radio","valueState: RadioValueState","styleVariant: RadioStyleVariant"],"sources":["../../src/components/Radio.tsx"],"sourcesContent":["import type { RadioVariant, UniversalRadioProps } from '@yahoo/uds-types';\nimport type { Ref } from 'react';\nimport { isValidElement, memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { View, ViewProps } from 'react-native';\nimport Animated, {\n interpolate,\n useAnimatedStyle,\n useDerivedValue,\n withSpring,\n} from 'react-native-reanimated';\n\nimport { radioStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport { HStack } from './HStack';\nimport { Pressable } from './Pressable';\nimport { Text } from './Text';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** Derived from RadioValue - maps boolean to 'checked'/'unchecked' string literals */\ntype RadioValueState = 'checked' | 'unchecked';\n\ninterface RadioProps extends Omit<ViewProps, 'style'>, UniversalRadioProps {\n ref?: Ref<View>;\n /** Default checked state for uncontrolled mode */\n defaultChecked?: boolean;\n /** Whether the radio is disabled */\n disabled?: boolean;\n /** Whether the radio is required */\n required?: boolean;\n /** Callback fired when the checked state changes */\n onChange?: (checked: boolean) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Variant Mapping */\n/* -------------------------------------------------------------------------- */\n\n/** All style variants available in the generated styles (includes error variants) */\ntype RadioStyleVariant = 'primary' | 'secondary' | 'alert' | 'alert-secondary';\n\nconst VARIANT_ERROR_MAP: Record<RadioVariant, RadioStyleVariant> = {\n primary: 'alert',\n secondary: 'alert-secondary',\n};\n\n/* -------------------------------------------------------------------------- */\n/* Radio Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **⚙️ A radio component**\n *\n * @componentType Client component\n *\n * @description\n * A radio component allows users to select one option from a set.\n * Unlike checkbox, radio buttons cannot have multiple selected in a group,\n * allowing only one selection at a time.\n *\n * @example\n * ```tsx\n * import { Radio } from '@yahoo/uds-mobile';\n *\n * <Radio label=\"Option A\" />\n * <Radio label=\"Option B\" checked={true} onChange={setChecked} />\n * ```\n *\n * @usage\n * - Forms: For selecting a single option from multiple choices\n * - Settings: For toggling between mutually exclusive preferences\n *\n * @see The {@link https://uds.build/docs/components/radio Radio Docs} for more info\n */\nconst Radio = memo(function Radio({\n // Radio props\n label,\n labelPosition = 'start',\n variant: variantProp = 'primary',\n size = 'md',\n checked: checkedProp,\n hasError,\n reduceMotion,\n // Native props\n defaultChecked,\n disabled,\n required,\n onChange,\n ref,\n ...viewProps\n}: RadioProps) {\n const generatedId = useId();\n const uid = `uds-radio-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = useState<boolean>(\n isControlled ? checkedProp : (defaultChecked ?? false),\n );\n const [pressed, setPressed] = useState(false);\n\n // Use controlled value if provided, otherwise use internal state\n const checked = isControlled ? checkedProp : internalChecked;\n\n /* ------------------------------ Derived Values ---------------------------- */\n const valueState: RadioValueState = useMemo(() => {\n return checked ? 'checked' : 'unchecked';\n }, [checked]);\n\n /* -------------------------------- Animation ------------------------------- */\n const shouldAnimate = !reduceMotion;\n\n // Scale animation for press feedback (disabled when reduceMotion is true)\n const scaleProgress = useDerivedValue(\n () =>\n shouldAnimate\n ? withSpring(pressed ? SCALE_EFFECTS.down : SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG)\n : SCALE_EFFECTS.none, // No scale effect when reduceMotion is true\n [pressed, shouldAnimate],\n );\n\n // Circle visibility animation (for the inner dot)\n // When reduceMotion is true, still show/hide the circle but without animation\n const circleProgress = useDerivedValue(\n () => (shouldAnimate ? withSpring(checked ? 1 : 0, BUTTON_SPRING_CONFIG) : checked ? 1 : 0),\n [checked, shouldAnimate],\n );\n\n const radioAnimatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scaleProgress.value }],\n }));\n\n const circleAnimatedStyle = useAnimatedStyle(() => ({\n opacity: interpolate(circleProgress.value, [0, 1], [0, 1]),\n transform: [{ scale: interpolate(circleProgress.value, [0, 1], [0.5, 1]) }],\n }));\n\n /* -------------------------------- Handlers -------------------------------- */\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const newChecked = !checked;\n\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n\n onChange?.(newChecked);\n }, [disabled, checked, isControlled, onChange]);\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n /* --------------------------------- Styles --------------------------------- */\n // Compute the style variant (primary/secondary maps to alert variants when hasError)\n const styleVariant: RadioStyleVariant = hasError ? VARIANT_ERROR_MAP[variantProp] : variantProp;\n\n radioStyles.useVariants({\n size,\n variant: styleVariant, // primary, secondary, alert, alert-secondary\n value: valueState, // checked, unchecked\n pressed,\n });\n\n const rootStyle = useMemo(\n () => [radioStyles.root, { opacity: disabled ? 0.5 : 1 }],\n [radioStyles.root, disabled],\n );\n\n const radioBoxStyle = useMemo(\n () => [\n radioStyles.radio,\n {\n alignItems: 'center' as const,\n justifyContent: 'center' as const,\n borderRadius: 9999,\n },\n radioAnimatedStyle,\n ],\n [radioStyles.radio, radioAnimatedStyle],\n );\n\n // Inner circle size: fixed 8x8px to match web implementation\n const INNER_CIRCLE_SIZE = 8;\n\n const circleStyle = useMemo(\n () => [\n radioStyles.radioCircle,\n {\n width: INNER_CIRCLE_SIZE,\n height: INNER_CIRCLE_SIZE,\n borderRadius: 9999,\n },\n circleAnimatedStyle,\n ],\n [radioStyles.radioCircle, circleAnimatedStyle],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n\n const content =\n typeof label === 'function' ? label() : isValidElement(label) ? label : String(label);\n\n const textContent =\n typeof content === 'string' ? <Text style={radioStyles.text}>{content}</Text> : content;\n\n if (required) {\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-start\">\n {textContent}\n <Text style={radioStyles.text}>*</Text>\n </HStack>\n );\n }\n\n return textContent;\n }, [label, required, radioStyles.text]);\n\n const a11yState = useMemo(\n () => ({\n disabled,\n checked,\n }),\n [disabled, checked],\n );\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <Pressable\n ref={ref}\n nativeID={uid}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n disabled={disabled}\n flexDirection={labelPosition === 'start' ? 'row' : 'row-reverse'}\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n accessibilityRole=\"radio\"\n accessibilityState={a11yState}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n {...viewProps}\n style={rootStyle}\n >\n <Animated.View style={radioBoxStyle}>\n <Animated.View style={circleStyle} />\n </Animated.View>\n\n {labelContent}\n </Pressable>\n );\n});\n\nRadio.displayName = 'Radio';\n\nexport { Radio, type RadioProps };\n"],"mappings":";;;;;;;;;;;;AA2CA,MAAMA,oBAA6D;CACjE,SAAS;CACT,WAAW;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,MAAM,QAAQ,KAAK,SAASC,QAAM,EAEhC,OACA,gBAAgB,SAChB,SAAS,cAAc,WACvB,OAAO,MACP,SAA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Ed;AAEF,MAAM,cAAc"}
1
+ {"version":3,"file":"Radio.mjs","names":["VARIANT_ERROR_MAP: Record<RadioVariant, RadioStyleVariant>","Radio","valueState: RadioValueState","styleVariant: RadioStyleVariant"],"sources":["../../src/components/Radio.tsx"],"sourcesContent":["import type { RadioVariant, UniversalRadioProps } from '@yahoo/uds/tokens';\nimport type { Ref } from 'react';\nimport { isValidElement, memo, useCallback, useId, useMemo, useState } from 'react';\nimport type { View, ViewProps } from 'react-native';\nimport Animated, {\n interpolate,\n useAnimatedStyle,\n useDerivedValue,\n withSpring,\n} from 'react-native-reanimated';\n\nimport { radioStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport { HStack } from './HStack';\nimport { Pressable } from './Pressable';\nimport { Text } from './Text';\n\n/* -------------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------------- */\n\n/** Derived from RadioValue - maps boolean to 'checked'/'unchecked' string literals */\ntype RadioValueState = 'checked' | 'unchecked';\n\ninterface RadioProps extends Omit<ViewProps, 'style'>, UniversalRadioProps {\n ref?: Ref<View>;\n /** Default checked state for uncontrolled mode */\n defaultChecked?: boolean;\n /** Whether the radio is disabled */\n disabled?: boolean;\n /** Whether the radio is required */\n required?: boolean;\n /** Callback fired when the checked state changes */\n onChange?: (checked: boolean) => void;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Variant Mapping */\n/* -------------------------------------------------------------------------- */\n\n/** All style variants available in the generated styles (includes error variants) */\ntype RadioStyleVariant = 'primary' | 'secondary' | 'alert' | 'alert-secondary';\n\nconst VARIANT_ERROR_MAP: Record<RadioVariant, RadioStyleVariant> = {\n primary: 'alert',\n secondary: 'alert-secondary',\n};\n\n/* -------------------------------------------------------------------------- */\n/* Radio Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **⚙️ A radio component**\n *\n * @componentType Client component\n *\n * @description\n * A radio component allows users to select one option from a set.\n * Unlike checkbox, radio buttons cannot have multiple selected in a group,\n * allowing only one selection at a time.\n *\n * @example\n * ```tsx\n * import { Radio } from '@yahoo/uds-mobile';\n *\n * <Radio label=\"Option A\" />\n * <Radio label=\"Option B\" checked={true} onChange={setChecked} />\n * ```\n *\n * @usage\n * - Forms: For selecting a single option from multiple choices\n * - Settings: For toggling between mutually exclusive preferences\n *\n * @see The {@link https://uds.build/docs/components/radio Radio Docs} for more info\n */\nconst Radio = memo(function Radio({\n // Radio props\n label,\n labelPosition = 'start',\n variant: variantProp = 'primary',\n size = 'md',\n checked: checkedProp,\n hasError,\n reduceMotion,\n // Native props\n defaultChecked,\n disabled,\n required,\n onChange,\n ref,\n ...viewProps\n}: RadioProps) {\n const generatedId = useId();\n const uid = `uds-radio-${generatedId}`;\n\n /* --------------------------------- State ---------------------------------- */\n const isControlled = checkedProp !== undefined;\n const [internalChecked, setInternalChecked] = useState<boolean>(\n isControlled ? checkedProp : (defaultChecked ?? false),\n );\n const [pressed, setPressed] = useState(false);\n\n // Use controlled value if provided, otherwise use internal state\n const checked = isControlled ? checkedProp : internalChecked;\n\n /* ------------------------------ Derived Values ---------------------------- */\n const valueState: RadioValueState = useMemo(() => {\n return checked ? 'checked' : 'unchecked';\n }, [checked]);\n\n /* -------------------------------- Animation ------------------------------- */\n const shouldAnimate = !reduceMotion;\n\n // Scale animation for press feedback (disabled when reduceMotion is true)\n const scaleProgress = useDerivedValue(\n () =>\n shouldAnimate\n ? withSpring(pressed ? SCALE_EFFECTS.down : SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG)\n : SCALE_EFFECTS.none, // No scale effect when reduceMotion is true\n [pressed, shouldAnimate],\n );\n\n // Circle visibility animation (for the inner dot)\n // When reduceMotion is true, still show/hide the circle but without animation\n const circleProgress = useDerivedValue(\n () => (shouldAnimate ? withSpring(checked ? 1 : 0, BUTTON_SPRING_CONFIG) : checked ? 1 : 0),\n [checked, shouldAnimate],\n );\n\n const radioAnimatedStyle = useAnimatedStyle(() => ({\n transform: [{ scale: scaleProgress.value }],\n }));\n\n const circleAnimatedStyle = useAnimatedStyle(() => ({\n opacity: interpolate(circleProgress.value, [0, 1], [0, 1]),\n transform: [{ scale: interpolate(circleProgress.value, [0, 1], [0.5, 1]) }],\n }));\n\n /* -------------------------------- Handlers -------------------------------- */\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const newChecked = !checked;\n\n if (!isControlled) {\n setInternalChecked(newChecked);\n }\n\n onChange?.(newChecked);\n }, [disabled, checked, isControlled, onChange]);\n\n const handlePressIn = useCallback(() => {\n setPressed(true);\n }, []);\n\n const handlePressOut = useCallback(() => {\n setPressed(false);\n }, []);\n\n /* --------------------------------- Styles --------------------------------- */\n // Compute the style variant (primary/secondary maps to alert variants when hasError)\n const styleVariant: RadioStyleVariant = hasError ? VARIANT_ERROR_MAP[variantProp] : variantProp;\n\n radioStyles.useVariants({\n size,\n variant: styleVariant, // primary, secondary, alert, alert-secondary\n value: valueState, // checked, unchecked\n pressed,\n });\n\n const rootStyle = useMemo(\n () => [radioStyles.root, { opacity: disabled ? 0.5 : 1 }],\n [radioStyles.root, disabled],\n );\n\n const radioBoxStyle = useMemo(\n () => [\n radioStyles.radio,\n {\n alignItems: 'center' as const,\n justifyContent: 'center' as const,\n borderRadius: 9999,\n },\n radioAnimatedStyle,\n ],\n [radioStyles.radio, radioAnimatedStyle],\n );\n\n // Inner circle size: fixed 8x8px to match web implementation\n const INNER_CIRCLE_SIZE = 8;\n\n const circleStyle = useMemo(\n () => [\n radioStyles.radioCircle,\n {\n width: INNER_CIRCLE_SIZE,\n height: INNER_CIRCLE_SIZE,\n borderRadius: 9999,\n },\n circleAnimatedStyle,\n ],\n [radioStyles.radioCircle, circleAnimatedStyle],\n );\n\n /* ---------------------------- Render Helpers ------------------------------ */\n const labelContent = useMemo(() => {\n if (!label) {\n return null;\n }\n\n const content =\n typeof label === 'function' ? label() : isValidElement(label) ? label : String(label);\n\n const textContent =\n typeof content === 'string' ? <Text style={radioStyles.text}>{content}</Text> : content;\n\n if (required) {\n return (\n <HStack columnGap=\"1\" alignItems=\"flex-start\">\n {textContent}\n <Text style={radioStyles.text}>*</Text>\n </HStack>\n );\n }\n\n return textContent;\n }, [label, required, radioStyles.text]);\n\n const a11yState = useMemo(\n () => ({\n disabled,\n checked,\n }),\n [disabled, checked],\n );\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <Pressable\n ref={ref}\n nativeID={uid}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n disabled={disabled}\n flexDirection={labelPosition === 'start' ? 'row' : 'row-reverse'}\n alignItems=\"center\"\n alignSelf=\"flex-start\"\n accessibilityRole=\"radio\"\n accessibilityState={a11yState}\n accessibilityLabel={typeof label === 'string' ? label : undefined}\n {...viewProps}\n style={rootStyle}\n >\n <Animated.View style={radioBoxStyle}>\n <Animated.View style={circleStyle} />\n </Animated.View>\n\n {labelContent}\n </Pressable>\n );\n});\n\nRadio.displayName = 'Radio';\n\nexport { Radio, type RadioProps };\n"],"mappings":";;;;;;;;;;;;AA2CA,MAAMA,oBAA6D;CACjE,SAAS;CACT,WAAW;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,MAAM,QAAQ,KAAK,SAASC,QAAM,EAEhC,OACA,gBAAgB,SAChB,SAAS,cAAc,WACvB,OAAO,MACP,SAAS,aACT,UACA,cAEA,gBACA,UACA,UACA,UACA,KACA,GAAG,aACU;CAEb,MAAM,MAAM,aADQ,OAAO;CAI3B,MAAM,eAAe,gBAAgB;CACrC,MAAM,CAAC,iBAAiB,sBAAsB,SAC5C,eAAe,cAAe,kBAAkB,MACjD;CACD,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAG7C,MAAM,UAAU,eAAe,cAAc;CAG7C,MAAMC,aAA8B,cAAc;AAChD,SAAO,UAAU,YAAY;IAC5B,CAAC,QAAQ,CAAC;CAGb,MAAM,gBAAgB,CAAC;CAGvB,MAAM,gBAAgB,sBAElB,gBACI,WAAW,UAAU,cAAc,OAAO,cAAc,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