@yahoo/uds 3.135.0 → 3.136.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 (312) hide show
  1. package/dist/automated-config/dist/properties.d.cts +1 -1
  2. package/dist/automated-config/dist/properties.d.ts +1 -1
  3. package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +1 -1
  4. package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +1 -1
  5. package/dist/cli/runner.cjs +0 -40
  6. package/dist/cli/runner.js +0 -40
  7. package/dist/components/Banner/Banner.cjs +2 -2
  8. package/dist/components/Banner/Banner.d.cts +1 -1
  9. package/dist/components/Banner/Banner.d.ts +1 -1
  10. package/dist/components/Banner/Banner.js +2 -2
  11. package/dist/components/Banner/utils.d.cts +1 -1
  12. package/dist/components/Banner/utils.d.ts +1 -1
  13. package/dist/components/Box.d.cts +1 -1
  14. package/dist/components/Box.d.ts +1 -1
  15. package/dist/components/Divider/DividerCore.cjs +1 -1
  16. package/dist/components/Divider/DividerCore.d.cts +2 -2
  17. package/dist/components/Divider/DividerCore.d.ts +2 -2
  18. package/dist/components/Divider/DividerCore.js +1 -1
  19. package/dist/components/Divider/DividerInternal.d.cts +1 -1
  20. package/dist/components/Divider/DividerInternal.d.ts +1 -1
  21. package/dist/components/FormLabel.d.cts +1 -1
  22. package/dist/components/FormLabel.d.ts +1 -1
  23. package/dist/components/HStack.d.cts +1 -1
  24. package/dist/components/HStack.d.ts +1 -1
  25. package/dist/components/Icon.cjs +6 -15
  26. package/dist/components/Icon.d.cts +1 -0
  27. package/dist/components/Icon.d.ts +1 -0
  28. package/dist/components/Icon.js +7 -16
  29. package/dist/components/IconSlot.cjs +6 -25
  30. package/dist/components/IconSlot.d.cts +2 -3
  31. package/dist/components/IconSlot.d.ts +2 -3
  32. package/dist/components/IconSlot.js +6 -26
  33. package/dist/components/Image.d.cts +1 -1
  34. package/dist/components/Image.d.ts +1 -1
  35. package/dist/components/Link.d.cts +1 -1
  36. package/dist/components/Link.d.ts +1 -1
  37. package/dist/components/Text.d.cts +1 -1
  38. package/dist/components/Text.d.ts +1 -1
  39. package/dist/components/VStack.d.cts +1 -1
  40. package/dist/components/VStack.d.ts +1 -1
  41. package/dist/components/{Avatar → client/Avatar}/Avatar.cjs +6 -21
  42. package/dist/components/{Avatar → client/Avatar}/Avatar.d.cts +3 -3
  43. package/dist/components/{Avatar → client/Avatar}/Avatar.d.ts +4 -3
  44. package/dist/components/{Avatar → client/Avatar}/Avatar.js +5 -20
  45. package/dist/components/{Avatar → client/Avatar}/AvatarIcon.cjs +12 -11
  46. package/dist/components/{Avatar → client/Avatar}/AvatarIcon.d.cts +3 -4
  47. package/dist/components/{Avatar → client/Avatar}/AvatarIcon.d.ts +4 -4
  48. package/dist/components/{Avatar → client/Avatar}/AvatarIcon.js +7 -6
  49. package/dist/components/client/Avatar/AvatarImage.cjs +58 -37
  50. package/dist/components/client/Avatar/AvatarImage.d.cts +15 -2
  51. package/dist/components/client/Avatar/AvatarImage.d.ts +15 -2
  52. package/dist/components/client/Avatar/AvatarImage.js +57 -36
  53. package/dist/components/{Avatar → client/Avatar}/AvatarText.cjs +11 -11
  54. package/dist/components/{Avatar → client/Avatar}/AvatarText.d.cts +3 -4
  55. package/dist/components/{Avatar → client/Avatar}/AvatarText.d.ts +4 -4
  56. package/dist/components/{Avatar → client/Avatar}/AvatarText.js +5 -5
  57. package/dist/components/client/Avatar/index.cjs +6 -0
  58. package/dist/components/client/Avatar/index.d.cts +5 -3
  59. package/dist/components/client/Avatar/index.d.ts +5 -3
  60. package/dist/components/client/Avatar/index.js +4 -1
  61. package/dist/components/{Avatar → client/Avatar}/utils.cjs +4 -3
  62. package/dist/components/{Avatar → client/Avatar}/utils.d.cts +3 -3
  63. package/dist/components/{Avatar → client/Avatar}/utils.d.ts +4 -3
  64. package/dist/components/{Avatar → client/Avatar}/utils.js +3 -2
  65. package/dist/components/client/Badge.d.cts +1 -1
  66. package/dist/components/client/Badge.d.ts +1 -1
  67. package/dist/components/client/BottomSheet/BottomSheet.d.cts +1 -1
  68. package/dist/components/client/BottomSheet/BottomSheet.d.ts +1 -1
  69. package/dist/components/client/BottomSheet/BottomSheetContent.d.cts +1 -1
  70. package/dist/components/client/BottomSheet/BottomSheetContent.d.ts +1 -1
  71. package/dist/components/client/BottomSheet/BottomSheetHandle.d.cts +1 -1
  72. package/dist/components/client/BottomSheet/BottomSheetHandle.d.ts +1 -1
  73. package/dist/components/client/BottomSheet/BottomSheetHeader.cjs +1 -1
  74. package/dist/components/client/BottomSheet/BottomSheetHeader.d.cts +1 -1
  75. package/dist/components/client/BottomSheet/BottomSheetHeader.d.ts +1 -1
  76. package/dist/components/client/BottomSheet/BottomSheetHeader.js +1 -1
  77. package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.cts +1 -1
  78. package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.ts +1 -1
  79. package/dist/components/client/BottomSheet/utils.d.cts +1 -1
  80. package/dist/components/client/BottomSheet/utils.d.ts +1 -1
  81. package/dist/components/client/Button.cjs +1 -1
  82. package/dist/components/client/Button.d.cts +1 -1
  83. package/dist/components/client/Button.d.ts +1 -1
  84. package/dist/components/client/Button.js +1 -1
  85. package/dist/components/client/Checkbox.cjs +2 -2
  86. package/dist/components/client/Checkbox.d.cts +1 -1
  87. package/dist/components/client/Checkbox.d.ts +1 -1
  88. package/dist/components/client/Checkbox.js +2 -2
  89. package/dist/components/client/Chip/ChipBase.d.cts +1 -1
  90. package/dist/components/client/Chip/ChipBase.d.ts +1 -1
  91. package/dist/components/client/Chip/ChipButton.d.cts +1 -1
  92. package/dist/components/client/Chip/ChipButton.d.ts +1 -1
  93. package/dist/components/client/Chip/ChipDismissible.cjs +2 -2
  94. package/dist/components/client/Chip/ChipDismissible.d.cts +1 -1
  95. package/dist/components/client/Chip/ChipDismissible.d.ts +1 -1
  96. package/dist/components/client/Chip/ChipDismissible.js +2 -2
  97. package/dist/components/client/Chip/ChipLink.d.cts +1 -1
  98. package/dist/components/client/Chip/ChipLink.d.ts +1 -1
  99. package/dist/components/client/Chip/ChipToggle.d.cts +1 -1
  100. package/dist/components/client/Chip/ChipToggle.d.ts +1 -1
  101. package/dist/components/client/IconButton.cjs +2 -7
  102. package/dist/components/client/IconButton.js +2 -7
  103. package/dist/components/client/Input/Input.cjs +1 -1
  104. package/dist/components/client/Input/Input.d.cts +1 -1
  105. package/dist/components/client/Input/Input.d.ts +1 -1
  106. package/dist/components/client/Input/Input.js +1 -1
  107. package/dist/components/client/Input/InputHelpTextInternal.d.cts +1 -1
  108. package/dist/components/client/Input/InputHelpTextInternal.d.ts +1 -1
  109. package/dist/components/client/Menu/Menu.Content.d.cts +1 -1
  110. package/dist/components/client/Menu/Menu.Content.d.ts +1 -1
  111. package/dist/components/client/Menu/Menu.Item.d.cts +1 -1
  112. package/dist/components/client/Menu/Menu.Item.d.ts +1 -1
  113. package/dist/components/client/Menu/Menu.ItemBase.cjs +1 -1
  114. package/dist/components/client/Menu/Menu.ItemBase.d.cts +1 -1
  115. package/dist/components/client/Menu/Menu.ItemBase.d.ts +1 -1
  116. package/dist/components/client/Menu/Menu.ItemBase.js +1 -1
  117. package/dist/components/client/Menu/Menu.ItemCheckbox.cjs +1 -1
  118. package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +2 -2
  119. package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +2 -2
  120. package/dist/components/client/Menu/Menu.ItemCheckbox.js +1 -1
  121. package/dist/components/client/Modal/Modal.cjs +3 -3
  122. package/dist/components/client/Modal/Modal.d.cts +1 -1
  123. package/dist/components/client/Modal/Modal.d.ts +1 -1
  124. package/dist/components/client/Modal/Modal.js +3 -3
  125. package/dist/components/client/Modal/ModalActions.d.cts +1 -1
  126. package/dist/components/client/Modal/ModalActions.d.ts +1 -1
  127. package/dist/components/client/Modal/ModalContent.d.cts +1 -1
  128. package/dist/components/client/Modal/ModalContent.d.ts +1 -1
  129. package/dist/components/client/Modal/ModalContext.d.cts +1 -1
  130. package/dist/components/client/Modal/ModalContext.d.ts +1 -1
  131. package/dist/components/client/Modal/ModalDescription.d.cts +1 -1
  132. package/dist/components/client/Modal/ModalDescription.d.ts +1 -1
  133. package/dist/components/client/Modal/ModalTitle.d.cts +1 -1
  134. package/dist/components/client/Modal/ModalTitle.d.ts +1 -1
  135. package/dist/components/client/Modal/UDSModalConfigProvider.d.cts +1 -1
  136. package/dist/components/client/Modal/UDSModalConfigProvider.d.ts +1 -1
  137. package/dist/components/client/Popover/Popover.d.cts +1 -1
  138. package/dist/components/client/Popover/Popover.d.ts +1 -1
  139. package/dist/components/client/Popover/PopoverContent.cjs +3 -3
  140. package/dist/components/client/Popover/PopoverContent.d.cts +1 -1
  141. package/dist/components/client/Popover/PopoverContent.d.ts +1 -1
  142. package/dist/components/client/Popover/PopoverContent.js +3 -3
  143. package/dist/components/client/Popover/PopoverTrigger.d.cts +1 -1
  144. package/dist/components/client/Popover/PopoverTrigger.d.ts +1 -1
  145. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
  146. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
  147. package/dist/components/client/Popover/index.d.cts +1 -1
  148. package/dist/components/client/Popover/index.d.ts +1 -1
  149. package/dist/components/client/Pressable.d.cts +1 -1
  150. package/dist/components/client/Pressable.d.ts +1 -1
  151. package/dist/components/client/Radio/Radio.d.cts +1 -1
  152. package/dist/components/client/Radio/Radio.d.ts +1 -1
  153. package/dist/components/client/Radio/RadioGroupProvider.d.cts +1 -1
  154. package/dist/components/client/Radio/RadioGroupProvider.d.ts +1 -1
  155. package/dist/components/client/SpringMotionConfig.d.cts +1 -1
  156. package/dist/components/client/SpringMotionConfig.d.ts +1 -1
  157. package/dist/components/client/Switch.cjs +1 -1
  158. package/dist/components/client/Switch.d.cts +1 -1
  159. package/dist/components/client/Switch.d.ts +1 -1
  160. package/dist/components/client/Switch.js +1 -1
  161. package/dist/components/client/Tabs/Tab.d.cts +1 -1
  162. package/dist/components/client/Tabs/Tab.d.ts +1 -1
  163. package/dist/components/client/Tabs/TabList.d.cts +1 -1
  164. package/dist/components/client/Tabs/TabList.d.ts +1 -1
  165. package/dist/components/client/Tabs/TabPanel.d.cts +1 -1
  166. package/dist/components/client/Tabs/TabPanel.d.ts +1 -1
  167. package/dist/components/client/Tabs/Tabs.d.cts +1 -1
  168. package/dist/components/client/Tabs/Tabs.d.ts +1 -1
  169. package/dist/components/client/Tabs/tabsContext.d.cts +1 -1
  170. package/dist/components/client/Tabs/tabsContext.d.ts +1 -1
  171. package/dist/components/client/Toast/Toast.cjs +1 -1
  172. package/dist/components/client/Toast/Toast.d.cts +1 -1
  173. package/dist/components/client/Toast/Toast.d.ts +1 -1
  174. package/dist/components/client/Toast/Toast.js +1 -1
  175. package/dist/components/client/Toast/ToastContainer.d.cts +1 -1
  176. package/dist/components/client/Toast/ToastContainer.d.ts +1 -1
  177. package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +2 -2
  178. package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +2 -2
  179. package/dist/components/client/Toast/createToast.d.cts +1 -1
  180. package/dist/components/client/Toast/createToast.d.ts +1 -1
  181. package/dist/components/client/Tooltip/Tooltip.d.cts +1 -1
  182. package/dist/components/client/Tooltip/Tooltip.d.ts +1 -1
  183. package/dist/components/client/Tooltip/TooltipContent.cjs +1 -1
  184. package/dist/components/client/Tooltip/TooltipContent.d.cts +2 -2
  185. package/dist/components/client/Tooltip/TooltipContent.d.ts +2 -2
  186. package/dist/components/client/Tooltip/TooltipContent.js +1 -1
  187. package/dist/components/client/Tooltip/TooltipTrigger.d.cts +1 -1
  188. package/dist/components/client/Tooltip/TooltipTrigger.d.ts +1 -1
  189. package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.cts +1 -1
  190. package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.ts +1 -1
  191. package/dist/components/client/Tooltip/index.d.cts +1 -1
  192. package/dist/components/client/Tooltip/index.d.ts +1 -1
  193. package/dist/components/client/buttonConstants.d.cts +1 -1
  194. package/dist/components/client/buttonConstants.d.ts +1 -1
  195. package/dist/components/client/index.cjs +7 -1
  196. package/dist/components/client/index.d.cts +6 -4
  197. package/dist/components/client/index.d.ts +6 -4
  198. package/dist/components/client/index.js +5 -2
  199. package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.cts +1 -1
  200. package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.ts +1 -1
  201. package/dist/components/experimental/Table.cjs +1 -1
  202. package/dist/components/experimental/Table.d.cts +2 -2
  203. package/dist/components/experimental/Table.d.ts +2 -2
  204. package/dist/components/experimental/Table.js +1 -1
  205. package/dist/components/experimental/client/Accordion.cjs +1 -1
  206. package/dist/components/experimental/client/Accordion.js +1 -1
  207. package/dist/components/experimental/client/SegmentedControl.cjs +1 -1
  208. package/dist/components/experimental/client/SegmentedControl.js +1 -1
  209. package/dist/components/experimental/client/SwitchV2.cjs +1 -1
  210. package/dist/components/experimental/client/SwitchV2.d.cts +1 -1
  211. package/dist/components/experimental/client/SwitchV2.d.ts +1 -1
  212. package/dist/components/experimental/client/SwitchV2.js +1 -1
  213. package/dist/components/index.cjs +13 -16
  214. package/dist/components/index.d.cts +7 -9
  215. package/dist/components/index.d.ts +7 -9
  216. package/dist/components/index.js +8 -10
  217. package/dist/config/dist/index.d.cts +1 -1
  218. package/dist/config/dist/index.d.ts +1 -1
  219. package/dist/css-tokens/dist/index.d.cts +1 -1
  220. package/dist/css-tokens/dist/index.d.ts +1 -1
  221. package/dist/fixtures/dist/index.d.cts +1 -1
  222. package/dist/fixtures/dist/index.d.ts +1 -1
  223. package/dist/fixtures/index.d.cts +1 -1
  224. package/dist/fixtures/index.d.ts +1 -1
  225. package/dist/fonts/dist/index.d.cts +1 -1
  226. package/dist/fonts/dist/index.d.ts +1 -1
  227. package/dist/icons/dist/types.d.cts +30 -0
  228. package/dist/icons/dist/types.d.ts +30 -0
  229. package/dist/index.cjs +10 -12
  230. package/dist/index.d.cts +8 -10
  231. package/dist/index.d.ts +8 -10
  232. package/dist/index.js +8 -9
  233. package/dist/modes/dist/index.d.cts +1 -1
  234. package/dist/modes/dist/index.d.ts +1 -1
  235. package/dist/motion-tokens/dist/index.d.cts +1 -1
  236. package/dist/motion-tokens/dist/index.d.ts +1 -1
  237. package/dist/providers/ColorModeProvider.d.cts +1 -1
  238. package/dist/providers/ColorModeProvider.d.ts +1 -1
  239. package/dist/providers/ScaleModeProvider.d.cts +1 -1
  240. package/dist/providers/ScaleModeProvider.d.ts +1 -1
  241. package/dist/providers/ThemeProvider.d.cts +1 -1
  242. package/dist/providers/ThemeProvider.d.ts +1 -1
  243. package/dist/runtime/bottomSheetConfig.d.cts +1 -1
  244. package/dist/runtime/bottomSheetConfig.d.ts +1 -1
  245. package/dist/runtime/breakpointsConfig.d.cts +1 -1
  246. package/dist/runtime/breakpointsConfig.d.ts +1 -1
  247. package/dist/runtime/modalConfig.d.cts +1 -1
  248. package/dist/runtime/modalConfig.d.ts +1 -1
  249. package/dist/runtime/popoverConfig.d.cts +1 -1
  250. package/dist/runtime/popoverConfig.d.ts +1 -1
  251. package/dist/runtime/toastConfig.d.cts +1 -1
  252. package/dist/runtime/toastConfig.d.ts +1 -1
  253. package/dist/runtime/tooltipConfig.d.cts +1 -1
  254. package/dist/runtime/tooltipConfig.d.ts +1 -1
  255. package/dist/styles/styler.d.cts +23 -23
  256. package/dist/styles/styler.d.ts +23 -23
  257. package/dist/styles/stylerTypes.d.cts +1 -1
  258. package/dist/styles/stylerTypes.d.ts +1 -1
  259. package/dist/tailwind/dist/commands/generatePurgeCSSData.cjs +2 -6
  260. package/dist/tailwind/dist/commands/generatePurgeCSSData.d.cts.map +1 -1
  261. package/dist/tailwind/dist/commands/generatePurgeCSSData.d.ts.map +1 -1
  262. package/dist/tailwind/dist/commands/generatePurgeCSSData.js +2 -5
  263. package/dist/tailwind/dist/commands/generatePurgeCSSData.js.map +1 -1
  264. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +4 -4
  265. package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +4 -4
  266. package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
  267. package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
  268. package/dist/tokens/configs/borderRadius.d.cts +1 -1
  269. package/dist/tokens/configs/borderRadius.d.ts +1 -1
  270. package/dist/tokens/configs/borderWidth.d.cts +1 -1
  271. package/dist/tokens/configs/borderWidth.d.ts +1 -1
  272. package/dist/tokens/configs/font.d.cts +1 -1
  273. package/dist/tokens/configs/font.d.ts +1 -1
  274. package/dist/tokens/configs/scaleMode.d.cts +1 -1
  275. package/dist/tokens/configs/scaleMode.d.ts +1 -1
  276. package/dist/tokens/configs/shadow.d.cts +1 -1
  277. package/dist/tokens/configs/shadow.d.ts +1 -1
  278. package/dist/tokens/configs/sizes.d.cts +1 -1
  279. package/dist/tokens/configs/sizes.d.ts +1 -1
  280. package/dist/tokens/configs/typography.d.cts +1 -1
  281. package/dist/tokens/configs/typography.d.ts +1 -1
  282. package/dist/tokens/index.d.cts +2 -2
  283. package/dist/tokens/index.d.ts +2 -2
  284. package/dist/tokens/parseButtonVariants.d.cts +1 -1
  285. package/dist/tokens/parseButtonVariants.d.ts +1 -1
  286. package/dist/tokens/types.d.cts +7 -7
  287. package/dist/tokens/types.d.ts +7 -7
  288. package/dist/tokens/utils/spectrum.d.cts +1 -1
  289. package/dist/tokens/utils/spectrum.d.ts +1 -1
  290. package/dist/types/{src → dist}/index.d.cts +23 -35
  291. package/dist/types/{src → dist}/index.d.ts +23 -35
  292. package/dist/uds/generated/componentData.cjs +350 -370
  293. package/dist/uds/generated/componentData.js +352 -366
  294. package/dist/uds/generated/tailwindPurge.cjs +104 -128
  295. package/dist/uds/generated/tailwindPurge.js +104 -128
  296. package/dist/utils/isElevationAlias.d.cts +1 -1
  297. package/dist/utils/isElevationAlias.d.ts +1 -1
  298. package/generated/componentData.json +457 -465
  299. package/generated/tailwindPurge.ts +3 -3
  300. package/package.json +1 -1
  301. package/dist/components/Avatar/AvatarImage.types.cjs +0 -1
  302. package/dist/components/Avatar/AvatarImage.types.d.cts +0 -18
  303. package/dist/components/Avatar/AvatarImage.types.d.ts +0 -18
  304. package/dist/components/Avatar/AvatarImage.types.js +0 -1
  305. package/dist/components/Avatar/AvatarImageNoFallback.cjs +0 -51
  306. package/dist/components/Avatar/AvatarImageNoFallback.d.cts +0 -18
  307. package/dist/components/Avatar/AvatarImageNoFallback.d.ts +0 -18
  308. package/dist/components/Avatar/AvatarImageNoFallback.js +0 -49
  309. package/dist/components/Avatar/index.cjs +0 -10
  310. package/dist/components/Avatar/index.d.cts +0 -6
  311. package/dist/components/Avatar/index.d.ts +0 -6
  312. package/dist/components/Avatar/index.js +0 -6
@@ -1,5 +1,5 @@
1
1
 
2
- import { UniversalStackProps } from "../types/src/index.cjs";
2
+ import { UniversalStackProps } from "../types/dist/index.cjs";
3
3
  import { DivProps } from "./Box.cjs";
4
4
  import * as _$react from "react";
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- import { UniversalStackProps } from "../types/src/index.js";
2
+ import { UniversalStackProps } from "../types/dist/index.js";
3
3
  import { DivProps } from "./Box.js";
4
4
  import * as _$react from "react";
5
5
 
@@ -1,12 +1,11 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
+ "use client";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("../../_virtual/_rolldown/runtime.cjs");
4
- const require_components_Avatar_AvatarIcon = require("./AvatarIcon.cjs");
5
- const require_components_Avatar_AvatarText = require("./AvatarText.cjs");
6
- const require_components_client_Avatar_AvatarImage = require("../client/Avatar/AvatarImage.cjs");
4
+ require("../../../_virtual/_rolldown/runtime.cjs");
5
+ const require_components_client_Avatar_AvatarImage = require("./AvatarImage.cjs");
7
6
  let react = require("react");
8
7
  let react_jsx_runtime = require("react/jsx-runtime");
9
- //#region src/components/Avatar/Avatar.tsx
8
+ //#region src/components/client/Avatar/Avatar.tsx
10
9
  /**
11
10
  * **👤 Avatar Component**
12
11
  *
@@ -14,7 +13,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
14
13
  * @usage The Avatar component should be used whenever you need to visually represent a user's identity in your application. This includes places like profile headers, user lists, chat messages, and comment sections. It's ideal for providing a consistent visual cue for users, whether by displaying a profile image, generating initials from a name, or falling back to a default icon when no image is available.
15
14
  * @param props - Combined Avatar props.
16
15
  * @returns The Avatar element.
17
- * @componentType Server component
16
+ * @componentType Client component
18
17
  * @example ```tsx
19
18
  * import { Avatar } from '@yahoo/uds';
20
19
  *
@@ -27,24 +26,10 @@ let react_jsx_runtime = require("react/jsx-runtime");
27
26
  *
28
27
  */
29
28
  const Avatar = (0, react.forwardRef)((props, ref) => {
30
- const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
31
- if (src || srcSet) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Avatar_AvatarImage.AvatarImage, {
29
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Avatar_AvatarImage.AvatarImage, {
32
30
  ref,
33
31
  ...props
34
32
  });
35
- if (fallback || alt) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarText.AvatarText, {
36
- ref,
37
- name: alt,
38
- initials: fallback,
39
- abbreviationStrategy,
40
- slotProps: { text: slotProps?.text },
41
- ...restProps
42
- });
43
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarIcon.AvatarIcon, {
44
- ref,
45
- slotProps: { icon: slotProps?.icon },
46
- ...restProps
47
- });
48
33
  });
49
34
  Avatar.displayName = "Avatar";
50
35
  //#endregion
@@ -1,8 +1,8 @@
1
1
 
2
- import { AvatarImageProps } from "./AvatarImage.types.cjs";
2
+ import { AvatarImageProps } from "./AvatarImage.cjs";
3
3
  import * as _$react from "react";
4
4
 
5
- //#region src/components/Avatar/Avatar.d.ts
5
+ //#region src/components/client/Avatar/Avatar.d.ts
6
6
  type AvatarProps = AvatarImageProps;
7
7
  /**
8
8
  * **👤 Avatar Component**
@@ -11,7 +11,7 @@ type AvatarProps = AvatarImageProps;
11
11
  * @usage The Avatar component should be used whenever you need to visually represent a user's identity in your application. This includes places like profile headers, user lists, chat messages, and comment sections. It's ideal for providing a consistent visual cue for users, whether by displaying a profile image, generating initials from a name, or falling back to a default icon when no image is available.
12
12
  * @param props - Combined Avatar props.
13
13
  * @returns The Avatar element.
14
- * @componentType Server component
14
+ * @componentType Client component
15
15
  * @example ```tsx
16
16
  * import { Avatar } from '@yahoo/uds';
17
17
  *
@@ -1,8 +1,9 @@
1
1
 
2
- import { AvatarImageProps } from "./AvatarImage.types.js";
2
+ "use client";
3
+ import { AvatarImageProps } from "./AvatarImage.js";
3
4
  import * as _$react from "react";
4
5
 
5
- //#region src/components/Avatar/Avatar.d.ts
6
+ //#region src/components/client/Avatar/Avatar.d.ts
6
7
  type AvatarProps = AvatarImageProps;
7
8
  /**
8
9
  * **👤 Avatar Component**
@@ -11,7 +12,7 @@ type AvatarProps = AvatarImageProps;
11
12
  * @usage The Avatar component should be used whenever you need to visually represent a user's identity in your application. This includes places like profile headers, user lists, chat messages, and comment sections. It's ideal for providing a consistent visual cue for users, whether by displaying a profile image, generating initials from a name, or falling back to a default icon when no image is available.
12
13
  * @param props - Combined Avatar props.
13
14
  * @returns The Avatar element.
14
- * @componentType Server component
15
+ * @componentType Client component
15
16
  * @example ```tsx
16
17
  * import { Avatar } from '@yahoo/uds';
17
18
  *
@@ -1,10 +1,9 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { AvatarIcon } from "./AvatarIcon.js";
3
- import { AvatarText } from "./AvatarText.js";
4
- import { AvatarImage } from "../client/Avatar/AvatarImage.js";
2
+ "use client";
3
+ import { AvatarImage } from "./AvatarImage.js";
5
4
  import { forwardRef } from "react";
6
5
  import { jsx } from "react/jsx-runtime";
7
- //#region src/components/Avatar/Avatar.tsx
6
+ //#region src/components/client/Avatar/Avatar.tsx
8
7
  /**
9
8
  * **👤 Avatar Component**
10
9
  *
@@ -12,7 +11,7 @@ import { jsx } from "react/jsx-runtime";
12
11
  * @usage The Avatar component should be used whenever you need to visually represent a user's identity in your application. This includes places like profile headers, user lists, chat messages, and comment sections. It's ideal for providing a consistent visual cue for users, whether by displaying a profile image, generating initials from a name, or falling back to a default icon when no image is available.
13
12
  * @param props - Combined Avatar props.
14
13
  * @returns The Avatar element.
15
- * @componentType Server component
14
+ * @componentType Client component
16
15
  * @example ```tsx
17
16
  * import { Avatar } from '@yahoo/uds';
18
17
  *
@@ -25,24 +24,10 @@ import { jsx } from "react/jsx-runtime";
25
24
  *
26
25
  */
27
26
  const Avatar = forwardRef((props, ref) => {
28
- const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
29
- if (src || srcSet) return /* @__PURE__ */ jsx(AvatarImage, {
27
+ return /* @__PURE__ */ jsx(AvatarImage, {
30
28
  ref,
31
29
  ...props
32
30
  });
33
- if (fallback || alt) return /* @__PURE__ */ jsx(AvatarText, {
34
- ref,
35
- name: alt,
36
- initials: fallback,
37
- abbreviationStrategy,
38
- slotProps: { text: slotProps?.text },
39
- ...restProps
40
- });
41
- return /* @__PURE__ */ jsx(AvatarIcon, {
42
- ref,
43
- slotProps: { icon: slotProps?.icon },
44
- ...restProps
45
- });
46
31
  });
47
32
  Avatar.displayName = "Avatar";
48
33
  //#endregion
@@ -1,14 +1,16 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
+ "use client";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("../../_virtual/_rolldown/runtime.cjs");
4
- const require_styles_styler = require("../../styles/styler.cjs");
5
- const require_components_Box = require("../Box.cjs");
6
- const require_components_IconSlot = require("../IconSlot.cjs");
7
- const require_components_Avatar_utils = require("./utils.cjs");
8
- let react = require("react");
4
+ require("../../../_virtual/_rolldown/runtime.cjs");
5
+ const require_styles_styler = require("../../../styles/styler.cjs");
6
+ const require_components_IconSlot = require("../../IconSlot.cjs");
7
+ const require_components_Box = require("../../Box.cjs");
8
+ const require_components_client_Avatar_utils = require("./utils.cjs");
9
9
  let _yahoo_uds_icons = require("@yahoo/uds-icons");
10
+ let react = require("react");
10
11
  let react_jsx_runtime = require("react/jsx-runtime");
11
- //#region src/components/Avatar/AvatarIcon.tsx
12
+ //#region src/components/client/Avatar/AvatarIcon.tsx
13
+ /** Maps avatar variant to icon */
12
14
  const mapVariantToIcon = {
13
15
  primary: _yahoo_uds_icons.Person,
14
16
  secondary: _yahoo_uds_icons.Building
@@ -20,11 +22,10 @@ const mapVariantToIcon = {
20
22
  *
21
23
  * @param props - Props for icon variant.
22
24
  * @returns The AvatarIcon element.
23
- * @componentType Server component
24
25
  */
25
- const AvatarIcon = (0, react.forwardRef)(({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, customSize, icon, slotProps, className, ...props }, ref) => {
26
+ const AvatarIcon = (0, react.forwardRef)(({ size = "md", variant = require_components_client_Avatar_utils.DEFAULT_AVATAR_VARIANT, customSize, icon, slotProps, className, ...props }, ref) => {
26
27
  const classNames = (0, react.useMemo)(() => ({
27
- root: require_components_Avatar_utils.buildAvatarRootClasses(size, {
28
+ root: require_components_client_Avatar_utils.buildAvatarRootClasses(size, {
28
29
  avatarIconVariantRoot: variant,
29
30
  overflow: "hidden",
30
31
  className: require_styles_styler.cx("overflow-hidden", className)
@@ -36,7 +37,7 @@ const AvatarIcon = (0, react.forwardRef)(({ size = "md", variant = require_compo
36
37
  size,
37
38
  variant
38
39
  ]);
39
- const inlineStyles = (0, react.useMemo)(() => require_components_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
40
+ const inlineStyles = (0, react.useMemo)(() => require_components_client_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
40
41
  const iconSvg = icon ?? mapVariantToIcon[variant ?? "primary"];
41
42
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
42
43
  ref,
@@ -1,9 +1,9 @@
1
1
 
2
- import { UniversalAvatarIconProps } from "../../types/src/index.cjs";
3
- import { IconPropsWithSVGProps } from "../../tokens/types.cjs";
2
+ import { UniversalAvatarIconProps } from "../../../types/dist/index.cjs";
3
+ import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
4
4
  import * as _$react from "react";
5
5
 
6
- //#region src/components/Avatar/AvatarIcon.d.ts
6
+ //#region src/components/client/Avatar/AvatarIcon.d.ts
7
7
  type DataAttributes = {
8
8
  [name: `data-${string}`]: string;
9
9
  };
@@ -20,7 +20,6 @@ interface AvatarIconProps extends UniversalAvatarIconProps {
20
20
  *
21
21
  * @param props - Props for icon variant.
22
22
  * @returns The AvatarIcon element.
23
- * @componentType Server component
24
23
  */
25
24
  declare const AvatarIcon: _$react.ForwardRefExoticComponent<AvatarIconProps & _$react.RefAttributes<HTMLDivElement>>;
26
25
  //#endregion
@@ -1,9 +1,10 @@
1
1
 
2
- import { UniversalAvatarIconProps } from "../../types/src/index.js";
3
- import { IconPropsWithSVGProps } from "../../tokens/types.js";
2
+ "use client";
3
+ import { UniversalAvatarIconProps } from "../../../types/dist/index.js";
4
+ import { IconPropsWithSVGProps } from "../../../tokens/types.js";
4
5
  import * as _$react from "react";
5
6
 
6
- //#region src/components/Avatar/AvatarIcon.d.ts
7
+ //#region src/components/client/Avatar/AvatarIcon.d.ts
7
8
  type DataAttributes = {
8
9
  [name: `data-${string}`]: string;
9
10
  };
@@ -20,7 +21,6 @@ interface AvatarIconProps extends UniversalAvatarIconProps {
20
21
  *
21
22
  * @param props - Props for icon variant.
22
23
  * @returns The AvatarIcon element.
23
- * @componentType Server component
24
24
  */
25
25
  declare const AvatarIcon: _$react.ForwardRefExoticComponent<AvatarIconProps & _$react.RefAttributes<HTMLDivElement>>;
26
26
  //#endregion
@@ -1,12 +1,14 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
- import { cx, getStyles } from "../../styles/styler.js";
3
- import { Box } from "../Box.js";
4
- import { IconSlot } from "../IconSlot.js";
2
+ "use client";
3
+ import { cx, getStyles } from "../../../styles/styler.js";
4
+ import { IconSlot } from "../../IconSlot.js";
5
+ import { Box } from "../../Box.js";
5
6
  import { DEFAULT_AVATAR_VARIANT, buildAvatarRootClasses, buildInlineSizeStyles } from "./utils.js";
6
- import { forwardRef, useMemo } from "react";
7
7
  import { Building, Person } from "@yahoo/uds-icons";
8
+ import { forwardRef, useMemo } from "react";
8
9
  import { jsx } from "react/jsx-runtime";
9
- //#region src/components/Avatar/AvatarIcon.tsx
10
+ //#region src/components/client/Avatar/AvatarIcon.tsx
11
+ /** Maps avatar variant to icon */
10
12
  const mapVariantToIcon = {
11
13
  primary: Person,
12
14
  secondary: Building
@@ -18,7 +20,6 @@ const mapVariantToIcon = {
18
20
  *
19
21
  * @param props - Props for icon variant.
20
22
  * @returns The AvatarIcon element.
21
- * @componentType Server component
22
23
  */
23
24
  const AvatarIcon = forwardRef(({ size = "md", variant = DEFAULT_AVATAR_VARIANT, customSize, icon, slotProps, className, ...props }, ref) => {
24
25
  const classNames = useMemo(() => ({
@@ -2,68 +2,89 @@
2
2
  "use client";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("../../../_virtual/_rolldown/runtime.cjs");
5
- const require_components_Avatar_AvatarIcon = require("../../Avatar/AvatarIcon.cjs");
6
- const require_components_Avatar_AvatarImageNoFallback = require("../../Avatar/AvatarImageNoFallback.cjs");
7
- const require_components_Avatar_AvatarText = require("../../Avatar/AvatarText.cjs");
5
+ const require_styles_styler = require("../../../styles/styler.cjs");
6
+ const require_components_Box = require("../../Box.cjs");
7
+ const require_components_Image = require("../../Image.cjs");
8
+ const require_components_client_Avatar_utils = require("./utils.cjs");
9
+ const require_components_client_Avatar_AvatarIcon = require("./AvatarIcon.cjs");
10
+ const require_components_client_Avatar_AvatarText = require("./AvatarText.cjs");
8
11
  let react = require("react");
9
12
  let react_jsx_runtime = require("react/jsx-runtime");
10
13
  //#region src/components/client/Avatar/AvatarImage.tsx
11
14
  /**
12
15
  * **AvatarImage Component**
13
16
  *
14
- * Renders an Avatar with an image.
17
+ * Renders an Avatar with an image. If the image fails to load, it falls back first to
18
+ * a text representation (if a name or initials are provided) and then to an icon.
15
19
  *
16
20
  * @param props - Props for image variant.
17
21
  * @returns The AvatarImage element.
18
22
  */
19
- const AvatarImage = (0, react.forwardRef)((props, ref) => {
20
- const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
21
- const hasImageSource = Boolean(src || srcSet);
22
- const imageSourceKey = `${src ?? ""}::${srcSet ?? ""}`;
23
- const [resolvedImageState, setResolvedImageState] = (0, react.useState)(null);
23
+ const AvatarImage = (0, react.forwardRef)(({ size = "md", variant = require_components_client_Avatar_utils.DEFAULT_AVATAR_VARIANT, src, srcSet, customSize, alt, abbreviationStrategy, fallback, className, imageProps, slotProps, ...props }, ref) => {
24
+ const [loadingState, setLoadingState] = (0, react.useState)("loading");
24
25
  (0, react.useEffect)(() => {
25
- if (!hasImageSource) return;
26
26
  let mounted = true;
27
- const img = new Image();
28
- img.onload = () => {
29
- if (mounted) setResolvedImageState({
30
- sourceKey: imageSourceKey,
31
- status: "loaded"
32
- });
33
- };
34
- img.onerror = () => {
35
- if (mounted) setResolvedImageState({
36
- sourceKey: imageSourceKey,
37
- status: "error"
38
- });
39
- };
40
- if (src) img.src = src;
41
- if (srcSet) img.srcset = srcSet;
27
+ if (src || srcSet) {
28
+ const img = new Image();
29
+ img.onload = () => {
30
+ if (mounted) setLoadingState("loaded");
31
+ };
32
+ img.onerror = () => {
33
+ if (mounted) setLoadingState("error");
34
+ };
35
+ if (src) img.src = src;
36
+ if (srcSet) img.srcset = srcSet;
37
+ } else setLoadingState("error");
42
38
  return () => {
43
39
  mounted = false;
44
40
  };
45
- }, [
46
- hasImageSource,
47
- imageSourceKey,
48
- src,
49
- srcSet
41
+ }, [src, srcSet]);
42
+ const classNames = (0, react.useMemo)(() => ({
43
+ root: require_components_client_Avatar_utils.buildAvatarRootClasses(size, {
44
+ avatarImageVariantRoot: variant,
45
+ className: require_styles_styler.cx("overflow-hidden", className)
46
+ }),
47
+ contents: require_styles_styler.cx("w-full", "h-full", "shrink-0", "text-center", "inline-flex", "justify-center", "items-center", "object-cover")
48
+ }), [
49
+ className,
50
+ size,
51
+ variant
50
52
  ]);
51
- if ((!hasImageSource ? "error" : resolvedImageState?.sourceKey === imageSourceKey ? resolvedImageState.status : "loading") === "loaded") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarImageNoFallback.AvatarImageNoFallback, {
53
+ const inlineStyles = (0, react.useMemo)(() => require_components_client_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
54
+ if (loadingState === "loaded") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
52
55
  ref,
53
- ...props
56
+ className: classNames.root,
57
+ style: inlineStyles.root,
58
+ ...props,
59
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Image.Image, {
60
+ src,
61
+ srcSet,
62
+ alt,
63
+ className: classNames.contents,
64
+ style: inlineStyles.contents,
65
+ ...imageProps,
66
+ ...slotProps?.image
67
+ })
54
68
  });
55
- if (fallback || alt) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarText.AvatarText, {
69
+ const sharedProps = {
70
+ ...props,
71
+ className,
72
+ size,
73
+ customSize,
74
+ variant
75
+ };
76
+ if (fallback || alt) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Avatar_AvatarText.AvatarText, {
56
77
  ref,
57
78
  name: alt,
58
79
  initials: fallback,
59
80
  abbreviationStrategy,
60
81
  slotProps: { text: slotProps?.text },
61
- ...restProps
82
+ ...sharedProps
62
83
  });
63
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarIcon.AvatarIcon, {
84
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Avatar_AvatarIcon.AvatarIcon, {
64
85
  ref,
65
- slotProps: { icon: slotProps?.icon },
66
- ...restProps
86
+ ...sharedProps,
87
+ slotProps: { icon: slotProps?.icon }
67
88
  });
68
89
  });
69
90
  AvatarImage.displayName = "AvatarImage";
@@ -1,12 +1,25 @@
1
1
 
2
- import { AvatarImageProps } from "../../Avatar/AvatarImage.types.cjs";
2
+ import { ImagePropsWithImgProps } from "../../../types/dist/index.cjs";
3
+ import { UniversalAvatarImageProps } from "../../../tokens/types.cjs";
4
+ import { AvatarIconProps } from "./AvatarIcon.cjs";
5
+ import { AvatarTextProps } from "./AvatarText.cjs";
3
6
  import * as _$react from "react";
4
7
 
5
8
  //#region src/components/client/Avatar/AvatarImage.d.ts
9
+ type DataAttributes = {
10
+ [name: `data-${string}`]: string;
11
+ };
12
+ interface AvatarImageProps extends UniversalAvatarImageProps {
13
+ /** Props to be passed into various slots within the component. */
14
+ slotProps?: {
15
+ image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes>;
16
+ } & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
17
+ }
6
18
  /**
7
19
  * **AvatarImage Component**
8
20
  *
9
- * Renders an Avatar with an image.
21
+ * Renders an Avatar with an image. If the image fails to load, it falls back first to
22
+ * a text representation (if a name or initials are provided) and then to an icon.
10
23
  *
11
24
  * @param props - Props for image variant.
12
25
  * @returns The AvatarImage element.
@@ -1,13 +1,26 @@
1
1
 
2
2
  "use client";
3
- import { AvatarImageProps } from "../../Avatar/AvatarImage.types.js";
3
+ import { ImagePropsWithImgProps } from "../../../types/dist/index.js";
4
+ import { UniversalAvatarImageProps } from "../../../tokens/types.js";
5
+ import { AvatarIconProps } from "./AvatarIcon.js";
6
+ import { AvatarTextProps } from "./AvatarText.js";
4
7
  import * as _$react from "react";
5
8
 
6
9
  //#region src/components/client/Avatar/AvatarImage.d.ts
10
+ type DataAttributes = {
11
+ [name: `data-${string}`]: string;
12
+ };
13
+ interface AvatarImageProps extends UniversalAvatarImageProps {
14
+ /** Props to be passed into various slots within the component. */
15
+ slotProps?: {
16
+ image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes>;
17
+ } & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
18
+ }
7
19
  /**
8
20
  * **AvatarImage Component**
9
21
  *
10
- * Renders an Avatar with an image.
22
+ * Renders an Avatar with an image. If the image fails to load, it falls back first to
23
+ * a text representation (if a name or initials are provided) and then to an icon.
11
24
  *
12
25
  * @param props - Props for image variant.
13
26
  * @returns The AvatarImage element.
@@ -1,67 +1,88 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
2
  "use client";
3
- import { AvatarIcon } from "../../Avatar/AvatarIcon.js";
4
- import { AvatarImageNoFallback } from "../../Avatar/AvatarImageNoFallback.js";
5
- import { AvatarText } from "../../Avatar/AvatarText.js";
6
- import { forwardRef, useEffect, useState } from "react";
3
+ import { cx } from "../../../styles/styler.js";
4
+ import { Box } from "../../Box.js";
5
+ import { Image as Image$1 } from "../../Image.js";
6
+ import { DEFAULT_AVATAR_VARIANT, buildAvatarRootClasses, buildInlineSizeStyles } from "./utils.js";
7
+ import { AvatarIcon } from "./AvatarIcon.js";
8
+ import { AvatarText } from "./AvatarText.js";
9
+ import { forwardRef, useEffect, useMemo, useState } from "react";
7
10
  import { jsx } from "react/jsx-runtime";
8
11
  //#region src/components/client/Avatar/AvatarImage.tsx
9
12
  /**
10
13
  * **AvatarImage Component**
11
14
  *
12
- * Renders an Avatar with an image.
15
+ * Renders an Avatar with an image. If the image fails to load, it falls back first to
16
+ * a text representation (if a name or initials are provided) and then to an icon.
13
17
  *
14
18
  * @param props - Props for image variant.
15
19
  * @returns The AvatarImage element.
16
20
  */
17
- const AvatarImage = forwardRef((props, ref) => {
18
- const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
19
- const hasImageSource = Boolean(src || srcSet);
20
- const imageSourceKey = `${src ?? ""}::${srcSet ?? ""}`;
21
- const [resolvedImageState, setResolvedImageState] = useState(null);
21
+ const AvatarImage = forwardRef(({ size = "md", variant = DEFAULT_AVATAR_VARIANT, src, srcSet, customSize, alt, abbreviationStrategy, fallback, className, imageProps, slotProps, ...props }, ref) => {
22
+ const [loadingState, setLoadingState] = useState("loading");
22
23
  useEffect(() => {
23
- if (!hasImageSource) return;
24
24
  let mounted = true;
25
- const img = new Image();
26
- img.onload = () => {
27
- if (mounted) setResolvedImageState({
28
- sourceKey: imageSourceKey,
29
- status: "loaded"
30
- });
31
- };
32
- img.onerror = () => {
33
- if (mounted) setResolvedImageState({
34
- sourceKey: imageSourceKey,
35
- status: "error"
36
- });
37
- };
38
- if (src) img.src = src;
39
- if (srcSet) img.srcset = srcSet;
25
+ if (src || srcSet) {
26
+ const img = new Image();
27
+ img.onload = () => {
28
+ if (mounted) setLoadingState("loaded");
29
+ };
30
+ img.onerror = () => {
31
+ if (mounted) setLoadingState("error");
32
+ };
33
+ if (src) img.src = src;
34
+ if (srcSet) img.srcset = srcSet;
35
+ } else setLoadingState("error");
40
36
  return () => {
41
37
  mounted = false;
42
38
  };
43
- }, [
44
- hasImageSource,
45
- imageSourceKey,
46
- src,
47
- srcSet
39
+ }, [src, srcSet]);
40
+ const classNames = useMemo(() => ({
41
+ root: buildAvatarRootClasses(size, {
42
+ avatarImageVariantRoot: variant,
43
+ className: cx("overflow-hidden", className)
44
+ }),
45
+ contents: cx("w-full", "h-full", "shrink-0", "text-center", "inline-flex", "justify-center", "items-center", "object-cover")
46
+ }), [
47
+ className,
48
+ size,
49
+ variant
48
50
  ]);
49
- if ((!hasImageSource ? "error" : resolvedImageState?.sourceKey === imageSourceKey ? resolvedImageState.status : "loading") === "loaded") return /* @__PURE__ */ jsx(AvatarImageNoFallback, {
51
+ const inlineStyles = useMemo(() => buildInlineSizeStyles(customSize), [customSize]);
52
+ if (loadingState === "loaded") return /* @__PURE__ */ jsx(Box, {
50
53
  ref,
51
- ...props
54
+ className: classNames.root,
55
+ style: inlineStyles.root,
56
+ ...props,
57
+ children: /* @__PURE__ */ jsx(Image$1, {
58
+ src,
59
+ srcSet,
60
+ alt,
61
+ className: classNames.contents,
62
+ style: inlineStyles.contents,
63
+ ...imageProps,
64
+ ...slotProps?.image
65
+ })
52
66
  });
67
+ const sharedProps = {
68
+ ...props,
69
+ className,
70
+ size,
71
+ customSize,
72
+ variant
73
+ };
53
74
  if (fallback || alt) return /* @__PURE__ */ jsx(AvatarText, {
54
75
  ref,
55
76
  name: alt,
56
77
  initials: fallback,
57
78
  abbreviationStrategy,
58
79
  slotProps: { text: slotProps?.text },
59
- ...restProps
80
+ ...sharedProps
60
81
  });
61
82
  return /* @__PURE__ */ jsx(AvatarIcon, {
62
83
  ref,
63
- slotProps: { icon: slotProps?.icon },
64
- ...restProps
84
+ ...sharedProps,
85
+ slotProps: { icon: slotProps?.icon }
65
86
  });
66
87
  });
67
88
  AvatarImage.displayName = "AvatarImage";
@@ -1,13 +1,14 @@
1
1
  /*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
2
+ "use client";
2
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("../../_virtual/_rolldown/runtime.cjs");
4
- const require_styles_styler = require("../../styles/styler.cjs");
5
- const require_components_Box = require("../Box.cjs");
6
- const require_components_Avatar_utils = require("./utils.cjs");
7
- const require_components_Text = require("../Text.cjs");
4
+ require("../../../_virtual/_rolldown/runtime.cjs");
5
+ const require_styles_styler = require("../../../styles/styler.cjs");
6
+ const require_components_Text = require("../../Text.cjs");
7
+ const require_components_Box = require("../../Box.cjs");
8
+ const require_components_client_Avatar_utils = require("./utils.cjs");
8
9
  let react = require("react");
9
10
  let react_jsx_runtime = require("react/jsx-runtime");
10
- //#region src/components/Avatar/AvatarText.tsx
11
+ //#region src/components/client/Avatar/AvatarText.tsx
11
12
  /**
12
13
  * **AvatarText Component**
13
14
  *
@@ -15,11 +16,10 @@ let react_jsx_runtime = require("react/jsx-runtime");
15
16
  *
16
17
  * @param props - Props for text variant.
17
18
  * @returns The AvatarText element.
18
- * @componentType Server component
19
19
  */
20
- const AvatarText = (0, react.forwardRef)(({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, name, initials, customSize, abbreviationStrategy, className, slotProps, ...props }, ref) => {
20
+ const AvatarText = (0, react.forwardRef)(({ size = "md", variant = require_components_client_Avatar_utils.DEFAULT_AVATAR_VARIANT, name, initials, customSize, abbreviationStrategy, className, slotProps, ...props }, ref) => {
21
21
  const classNames = (0, react.useMemo)(() => ({
22
- root: require_components_Avatar_utils.buildAvatarRootClasses(size, {
22
+ root: require_components_client_Avatar_utils.buildAvatarRootClasses(size, {
23
23
  avatarTextVariantRoot: variant,
24
24
  className: require_styles_styler.cx("overflow-hidden", "truncate", className)
25
25
  }),
@@ -29,7 +29,7 @@ const AvatarText = (0, react.forwardRef)(({ size = "md", variant = require_compo
29
29
  size,
30
30
  variant
31
31
  ]);
32
- const inlineStyles = (0, react.useMemo)(() => require_components_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
32
+ const inlineStyles = (0, react.useMemo)(() => require_components_client_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
33
33
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
34
34
  ref,
35
35
  className: classNames.root,
@@ -41,7 +41,7 @@ const AvatarText = (0, react.forwardRef)(({ size = "md", variant = require_compo
41
41
  className: classNames.text,
42
42
  style: inlineStyles.contents,
43
43
  ...slotProps?.text,
44
- children: initials || require_components_Avatar_utils.generateAvatarAbbreviation(name, abbreviationStrategy)
44
+ children: initials || require_components_client_Avatar_utils.generateAvatarAbbreviation(name, abbreviationStrategy)
45
45
  })
46
46
  });
47
47
  });