@yahoo/uds 3.133.0-beta.1 → 3.133.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/runner.cjs +40 -0
- package/dist/cli/runner.js +40 -0
- package/dist/components/{client/Avatar → Avatar}/Avatar.cjs +21 -6
- package/dist/components/{client/Avatar → Avatar}/Avatar.d.cts +3 -3
- package/dist/components/{client/Avatar → Avatar}/Avatar.d.ts +3 -4
- package/dist/components/{client/Avatar → Avatar}/Avatar.js +20 -5
- package/dist/components/{client/Avatar → Avatar}/AvatarIcon.cjs +11 -12
- package/dist/components/{client/Avatar → Avatar}/AvatarIcon.d.cts +5 -4
- package/dist/components/{client/Avatar → Avatar}/AvatarIcon.d.ts +5 -5
- package/dist/components/{client/Avatar → Avatar}/AvatarIcon.js +6 -7
- package/dist/components/Avatar/AvatarImage.types.cjs +1 -0
- package/dist/components/Avatar/AvatarImage.types.d.cts +19 -0
- package/dist/components/Avatar/AvatarImage.types.d.ts +19 -0
- package/dist/components/Avatar/AvatarImage.types.js +1 -0
- package/dist/components/Avatar/AvatarImageNoFallback.cjs +53 -0
- package/dist/components/Avatar/AvatarImageNoFallback.d.cts +18 -0
- package/dist/components/Avatar/AvatarImageNoFallback.d.ts +18 -0
- package/dist/components/Avatar/AvatarImageNoFallback.js +51 -0
- package/dist/components/{client/Avatar → Avatar}/AvatarText.cjs +11 -11
- package/dist/components/{client/Avatar → Avatar}/AvatarText.d.cts +5 -4
- package/dist/components/{client/Avatar → Avatar}/AvatarText.d.ts +5 -5
- package/dist/components/{client/Avatar → Avatar}/AvatarText.js +5 -5
- package/dist/components/Avatar/index.cjs +11 -0
- package/dist/components/Avatar/index.d.cts +6 -0
- package/dist/components/Avatar/index.d.ts +6 -0
- package/dist/components/Avatar/index.js +7 -0
- package/dist/components/{client/Avatar → Avatar}/utils.cjs +3 -4
- package/dist/components/{client/Avatar → Avatar}/utils.d.cts +4 -4
- package/dist/components/{client/Avatar → Avatar}/utils.d.ts +4 -5
- package/dist/components/{client/Avatar → Avatar}/utils.js +2 -3
- package/dist/components/Banner/Banner.cjs +2 -2
- package/dist/components/Banner/Banner.js +2 -2
- package/dist/components/Divider/DividerCore.cjs +1 -1
- package/dist/components/Divider/DividerCore.d.cts +1 -1
- package/dist/components/Divider/DividerCore.d.ts +1 -1
- package/dist/components/Divider/DividerCore.js +1 -1
- package/dist/components/client/Avatar/AvatarImage.cjs +37 -58
- package/dist/components/client/Avatar/AvatarImage.d.cts +2 -16
- package/dist/components/client/Avatar/AvatarImage.d.ts +2 -16
- package/dist/components/client/Avatar/AvatarImage.js +36 -57
- package/dist/components/client/Avatar/index.cjs +1 -7
- package/dist/components/client/Avatar/index.d.cts +3 -5
- package/dist/components/client/Avatar/index.d.ts +3 -5
- package/dist/components/client/Avatar/index.js +1 -4
- package/dist/components/client/BottomSheet/BottomSheetHeader.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.js +1 -1
- package/dist/components/client/Button.cjs +1 -1
- package/dist/components/client/Button.js +1 -1
- package/dist/components/client/Checkbox.cjs +2 -2
- package/dist/components/client/Checkbox.js +2 -2
- package/dist/components/client/Chip/ChipDismissible.cjs +2 -2
- package/dist/components/client/Chip/ChipDismissible.js +2 -2
- package/dist/components/client/IconButton.cjs +1 -1
- package/dist/components/client/IconButton.js +1 -1
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.cjs +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.js +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.cjs +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.js +1 -1
- package/dist/components/client/Popover/PopoverContent.cjs +3 -3
- package/dist/components/client/Popover/PopoverContent.js +3 -3
- package/dist/components/client/Switch.cjs +1 -1
- package/dist/components/client/Switch.js +1 -1
- package/dist/components/client/Toast/Toast.cjs +1 -1
- package/dist/components/client/Toast/Toast.js +1 -1
- package/dist/components/client/Tooltip/TooltipContent.cjs +1 -1
- package/dist/components/client/Tooltip/TooltipContent.js +1 -1
- package/dist/components/client/index.cjs +1 -7
- package/dist/components/client/index.d.cts +3 -5
- package/dist/components/client/index.d.ts +3 -5
- package/dist/components/client/index.js +2 -5
- package/dist/components/experimental/Table.cjs +1 -1
- package/dist/components/experimental/Table.d.cts +1 -1
- package/dist/components/experimental/Table.d.ts +1 -1
- package/dist/components/experimental/Table.js +1 -1
- package/dist/components/experimental/client/Accordion.cjs +1 -1
- package/dist/components/experimental/client/Accordion.js +1 -1
- package/dist/components/experimental/client/SegmentedControl.cjs +1 -1
- package/dist/components/experimental/client/SegmentedControl.js +1 -1
- package/dist/components/experimental/client/SwitchV2.cjs +1 -1
- package/dist/components/experimental/client/SwitchV2.js +1 -1
- package/dist/components/index.cjs +16 -13
- package/dist/components/index.d.cts +9 -6
- package/dist/components/index.d.ts +9 -6
- package/dist/components/index.js +10 -8
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +9 -8
- package/dist/styles/styler.d.cts +27 -27
- package/dist/styles/styler.d.ts +27 -27
- package/dist/uds/generated/componentData.cjs +1216 -1196
- package/dist/uds/generated/componentData.js +1211 -1197
- package/dist/uds/generated/tailwindPurge.cjs +128 -104
- package/dist/uds/generated/tailwindPurge.js +128 -104
- package/generated/componentData.json +1474 -1464
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import { TextProps } from "../../Text.js";
|
|
2
|
+
import { UniversalAvatarTextProps } from "../../types/src/index.js";
|
|
3
|
+
import "../../tokens/index.js";
|
|
4
|
+
import { TextProps } from "../Text.js";
|
|
6
5
|
import * as react from "react";
|
|
7
6
|
|
|
8
|
-
//#region src/components/
|
|
7
|
+
//#region src/components/Avatar/AvatarText.d.ts
|
|
9
8
|
type DataAttributes = {
|
|
10
9
|
[name: `data-${string}`]: string;
|
|
11
10
|
};
|
|
@@ -22,6 +21,7 @@ interface AvatarTextProps extends UniversalAvatarTextProps {
|
|
|
22
21
|
*
|
|
23
22
|
* @param props - Props for text variant.
|
|
24
23
|
* @returns The AvatarText element.
|
|
24
|
+
* @componentType Server component
|
|
25
25
|
*/
|
|
26
26
|
declare const AvatarText: react.ForwardRefExoticComponent<AvatarTextProps & react.RefAttributes<HTMLDivElement>>;
|
|
27
27
|
//#endregion
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { Text } from "../../Text.js";
|
|
5
|
-
import { Box } from "../../Box.js";
|
|
2
|
+
import { cx } from "../../styles/styler.js";
|
|
3
|
+
import { Box } from "../Box.js";
|
|
6
4
|
import { DEFAULT_AVATAR_SIZE, DEFAULT_AVATAR_VARIANT, buildAvatarRootClasses, buildInlineSizeStyles, generateAvatarAbbreviation } from "./utils.js";
|
|
5
|
+
import { Text } from "../Text.js";
|
|
7
6
|
import { forwardRef, useMemo } from "react";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
9
8
|
|
|
10
|
-
//#region src/components/
|
|
9
|
+
//#region src/components/Avatar/AvatarText.tsx
|
|
11
10
|
/**
|
|
12
11
|
* **AvatarText Component**
|
|
13
12
|
*
|
|
@@ -15,6 +14,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
15
14
|
*
|
|
16
15
|
* @param props - Props for text variant.
|
|
17
16
|
* @returns The AvatarText element.
|
|
17
|
+
* @componentType Server component
|
|
18
18
|
*/
|
|
19
19
|
const AvatarText = forwardRef(({ size = DEFAULT_AVATAR_SIZE, variant = DEFAULT_AVATAR_VARIANT, name, initials, customSize, abbreviationStrategy, className, slotProps, ...props }, ref) => {
|
|
20
20
|
const classNames = useMemo(() => ({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_components_Avatar_AvatarIcon = require('./AvatarIcon.cjs');
|
|
4
|
+
const require_components_Avatar_AvatarImageNoFallback = require('./AvatarImageNoFallback.cjs');
|
|
5
|
+
const require_components_Avatar_AvatarText = require('./AvatarText.cjs');
|
|
6
|
+
const require_components_Avatar_Avatar = require('./Avatar.cjs');
|
|
7
|
+
|
|
8
|
+
exports.Avatar = require_components_Avatar_Avatar.Avatar;
|
|
9
|
+
exports.AvatarIcon = require_components_Avatar_AvatarIcon.AvatarIcon;
|
|
10
|
+
exports.AvatarImageNoFallback = require_components_Avatar_AvatarImageNoFallback.AvatarImageNoFallback;
|
|
11
|
+
exports.AvatarText = require_components_Avatar_AvatarText.AvatarText;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import { AvatarIcon, AvatarIconProps } from "./AvatarIcon.cjs";
|
|
3
|
+
import { AvatarText, AvatarTextProps } from "./AvatarText.cjs";
|
|
4
|
+
import { Avatar, AvatarProps } from "./Avatar.cjs";
|
|
5
|
+
import { AvatarImageNoFallback, AvatarImageNoFallbackProps } from "./AvatarImageNoFallback.cjs";
|
|
6
|
+
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImageNoFallback, type AvatarImageNoFallbackProps, type AvatarProps, AvatarText, type AvatarTextProps };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import { AvatarIcon, AvatarIconProps } from "./AvatarIcon.js";
|
|
3
|
+
import { AvatarText, AvatarTextProps } from "./AvatarText.js";
|
|
4
|
+
import { Avatar, AvatarProps } from "./Avatar.js";
|
|
5
|
+
import { AvatarImageNoFallback, AvatarImageNoFallbackProps } from "./AvatarImageNoFallback.js";
|
|
6
|
+
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImageNoFallback, type AvatarImageNoFallbackProps, type AvatarProps, AvatarText, type AvatarTextProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { AvatarIcon } from "./AvatarIcon.js";
|
|
3
|
+
import { AvatarImageNoFallback } from "./AvatarImageNoFallback.js";
|
|
4
|
+
import { AvatarText } from "./AvatarText.js";
|
|
5
|
+
import { Avatar } from "./Avatar.js";
|
|
6
|
+
|
|
7
|
+
export { Avatar, AvatarIcon, AvatarImageNoFallback, AvatarText };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
"use client";
|
|
3
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('
|
|
5
|
-
const require_styles_styler = require('
|
|
3
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
4
|
+
const require_styles_styler = require('../../styles/styler.cjs');
|
|
6
5
|
let lodash_isFunction_js = require("lodash/isFunction.js");
|
|
7
6
|
lodash_isFunction_js = require_runtime.__toESM(lodash_isFunction_js);
|
|
8
7
|
|
|
9
|
-
//#region src/components/
|
|
8
|
+
//#region src/components/Avatar/utils.ts
|
|
10
9
|
/** Strategies for generating text abbreviation */
|
|
11
10
|
const abbrevStrategies = {
|
|
12
11
|
first: (initials) => initials[0] ?? "",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "
|
|
3
|
-
import "
|
|
4
|
-
import { getStyles } from "
|
|
2
|
+
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "../../types/src/index.cjs";
|
|
3
|
+
import "../../tokens/index.cjs";
|
|
4
|
+
import { getStyles } from "../../styles/styler.cjs";
|
|
5
5
|
|
|
6
|
-
//#region src/components/
|
|
6
|
+
//#region src/components/Avatar/utils.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Generates an abbreviation from a name using a specified strategy.
|
|
9
9
|
*
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import { getStyles } from "../../../styles/styler.js";
|
|
2
|
+
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "../../types/src/index.js";
|
|
3
|
+
import "../../tokens/index.js";
|
|
4
|
+
import { getStyles } from "../../styles/styler.js";
|
|
6
5
|
|
|
7
|
-
//#region src/components/
|
|
6
|
+
//#region src/components/Avatar/utils.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Generates an abbreviation from a name using a specified strategy.
|
|
10
9
|
*
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
|
|
3
|
-
import { cx, getStyles } from "../../../styles/styler.js";
|
|
2
|
+
import { cx, getStyles } from "../../styles/styler.js";
|
|
4
3
|
import { isFunction } from "lodash-es";
|
|
5
4
|
|
|
6
|
-
//#region src/components/
|
|
5
|
+
//#region src/components/Avatar/utils.ts
|
|
7
6
|
/** Strategies for generating text abbreviation */
|
|
8
7
|
const abbrevStrategies = {
|
|
9
8
|
first: (initials) => initials[0] ?? "",
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
3
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
4
4
|
const require_styles_styler = require('../../styles/styler.cjs');
|
|
5
|
-
const require_components_client_Pressable = require('../client/Pressable.cjs');
|
|
6
5
|
const require_components_IconSlot = require('../IconSlot.cjs');
|
|
7
6
|
const require_components_Text = require('../Text.cjs');
|
|
7
|
+
const require_components_client_Pressable = require('../client/Pressable.cjs');
|
|
8
8
|
const require_components_Banner_utils = require('./utils.cjs');
|
|
9
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
10
9
|
let react = require("react");
|
|
10
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
11
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
|
|
13
13
|
//#region src/components/Banner/Banner.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { cx, getStyles } from "../../styles/styler.js";
|
|
3
|
-
import { Pressable } from "../client/Pressable.js";
|
|
4
3
|
import { IconSlot } from "../IconSlot.js";
|
|
5
4
|
import { Text } from "../Text.js";
|
|
5
|
+
import { Pressable } from "../client/Pressable.js";
|
|
6
6
|
import { BANNER_TO_BUTTON_VARIANT, hasDisplayName, separateChildren } from "./utils.js";
|
|
7
|
-
import { Cross } from "@yahoo/uds-icons";
|
|
8
7
|
import { cloneElement, forwardRef, isValidElement } from "react";
|
|
8
|
+
import { Cross } from "@yahoo/uds-icons";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
|
|
11
11
|
//#region src/components/Banner/Banner.tsx
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
3
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
4
4
|
const require_styles_styler = require('../../styles/styler.cjs');
|
|
5
|
-
const require_components_Text = require('../Text.cjs');
|
|
6
5
|
const require_components_Box = require('../Box.cjs');
|
|
6
|
+
const require_components_Text = require('../Text.cjs');
|
|
7
7
|
const require_components_HStack = require('../HStack.cjs');
|
|
8
8
|
const require_components_VStack = require('../VStack.cjs');
|
|
9
9
|
let react = require("react");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { UniversalDividerProps, UniversalStackProps } from "../../types/src/index.cjs";
|
|
3
3
|
import "../../tokens/types.cjs";
|
|
4
|
-
import { BoxProps } from "../Box.cjs";
|
|
5
4
|
import { Text } from "../Text.cjs";
|
|
5
|
+
import { BoxProps } from "../Box.cjs";
|
|
6
6
|
import * as react from "react";
|
|
7
7
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { UniversalDividerProps, UniversalStackProps } from "../../types/src/index.js";
|
|
3
3
|
import "../../tokens/types.js";
|
|
4
|
-
import { BoxProps } from "../Box.js";
|
|
5
4
|
import { Text } from "../Text.js";
|
|
5
|
+
import { BoxProps } from "../Box.js";
|
|
6
6
|
import * as react from "react";
|
|
7
7
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { cx } from "../../styles/styler.js";
|
|
3
|
-
import { Text } from "../Text.js";
|
|
4
3
|
import { Box } from "../Box.js";
|
|
4
|
+
import { Text } from "../Text.js";
|
|
5
5
|
import { HStack } from "../HStack.js";
|
|
6
6
|
import { VStack } from "../VStack.js";
|
|
7
7
|
import { forwardRef, useMemo } from "react";
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
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');
|
|
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');
|
|
11
8
|
let react = require("react");
|
|
12
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
10
|
|
|
@@ -15,77 +12,59 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
15
12
|
/**
|
|
16
13
|
* **AvatarImage Component**
|
|
17
14
|
*
|
|
18
|
-
* Renders an Avatar with an image.
|
|
19
|
-
* a text representation (if a name or initials are provided) and then to an icon.
|
|
15
|
+
* Renders an Avatar with an image.
|
|
20
16
|
*
|
|
21
17
|
* @param props - Props for image variant.
|
|
22
18
|
* @returns The AvatarImage element.
|
|
23
19
|
*/
|
|
24
|
-
const AvatarImage = (0, react.forwardRef)((
|
|
25
|
-
const
|
|
20
|
+
const AvatarImage = (0, react.forwardRef)((props, ref) => {
|
|
21
|
+
const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
|
|
22
|
+
const hasImageSource = Boolean(src || srcSet);
|
|
23
|
+
const imageSourceKey = `${src ?? ""}::${srcSet ?? ""}`;
|
|
24
|
+
const [resolvedImageState, setResolvedImageState] = (0, react.useState)(null);
|
|
26
25
|
(0, react.useEffect)(() => {
|
|
26
|
+
if (!hasImageSource) return;
|
|
27
27
|
let mounted = true;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
const img = new Image();
|
|
29
|
+
img.onload = () => {
|
|
30
|
+
if (mounted) setResolvedImageState({
|
|
31
|
+
sourceKey: imageSourceKey,
|
|
32
|
+
status: "loaded"
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
img.onerror = () => {
|
|
36
|
+
if (mounted) setResolvedImageState({
|
|
37
|
+
sourceKey: imageSourceKey,
|
|
38
|
+
status: "error"
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
if (src) img.src = src;
|
|
42
|
+
if (srcSet) img.srcset = srcSet;
|
|
39
43
|
return () => {
|
|
40
44
|
mounted = false;
|
|
41
45
|
};
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}),
|
|
48
|
-
contents: require_styles_styler.cx("w-full", "h-full", "shrink-0", "text-center", "inline-flex", "justify-center", "items-center", "object-cover")
|
|
49
|
-
}), [
|
|
50
|
-
className,
|
|
51
|
-
size,
|
|
52
|
-
variant
|
|
46
|
+
}, [
|
|
47
|
+
hasImageSource,
|
|
48
|
+
imageSourceKey,
|
|
49
|
+
src,
|
|
50
|
+
srcSet
|
|
53
51
|
]);
|
|
54
|
-
|
|
55
|
-
if (loadingState === "loaded") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
52
|
+
if ((!hasImageSource ? "error" : resolvedImageState?.sourceKey === imageSourceKey ? resolvedImageState.status : "loading") === "loaded") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarImageNoFallback.AvatarImageNoFallback, {
|
|
56
53
|
ref,
|
|
57
|
-
|
|
58
|
-
style: inlineStyles.root,
|
|
59
|
-
...props,
|
|
60
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Image.Image, {
|
|
61
|
-
src,
|
|
62
|
-
srcSet,
|
|
63
|
-
alt,
|
|
64
|
-
className: classNames.contents,
|
|
65
|
-
style: inlineStyles.contents,
|
|
66
|
-
...imageProps,
|
|
67
|
-
...slotProps?.image
|
|
68
|
-
})
|
|
54
|
+
...props
|
|
69
55
|
});
|
|
70
|
-
|
|
71
|
-
...props,
|
|
72
|
-
className,
|
|
73
|
-
size,
|
|
74
|
-
customSize,
|
|
75
|
-
variant
|
|
76
|
-
};
|
|
77
|
-
if (fallback || alt) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Avatar_AvatarText.AvatarText, {
|
|
56
|
+
if (fallback || alt) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarText.AvatarText, {
|
|
78
57
|
ref,
|
|
79
58
|
name: alt,
|
|
80
59
|
initials: fallback,
|
|
81
60
|
abbreviationStrategy,
|
|
82
61
|
slotProps: { text: slotProps?.text },
|
|
83
|
-
...
|
|
62
|
+
...restProps
|
|
84
63
|
});
|
|
85
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
64
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Avatar_AvatarIcon.AvatarIcon, {
|
|
86
65
|
ref,
|
|
87
|
-
|
|
88
|
-
|
|
66
|
+
slotProps: { icon: slotProps?.icon },
|
|
67
|
+
...restProps
|
|
89
68
|
});
|
|
90
69
|
});
|
|
91
70
|
AvatarImage.displayName = "AvatarImage";
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import { UniversalAvatarImageProps } from "../../../tokens/types.cjs";
|
|
4
|
-
import "../../../tokens/index.cjs";
|
|
5
|
-
import { AvatarIconProps } from "./AvatarIcon.cjs";
|
|
6
|
-
import { AvatarTextProps } from "./AvatarText.cjs";
|
|
2
|
+
import { AvatarImageProps } from "../../Avatar/AvatarImage.types.cjs";
|
|
7
3
|
import * as react from "react";
|
|
8
4
|
|
|
9
5
|
//#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
|
-
}
|
|
19
6
|
/**
|
|
20
7
|
* **AvatarImage Component**
|
|
21
8
|
*
|
|
22
|
-
* Renders an Avatar with an image.
|
|
23
|
-
* a text representation (if a name or initials are provided) and then to an icon.
|
|
9
|
+
* Renders an Avatar with an image.
|
|
24
10
|
*
|
|
25
11
|
* @param props - Props for image variant.
|
|
26
12
|
* @returns The AvatarImage element.
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import { UniversalAvatarImageProps } from "../../../tokens/types.js";
|
|
5
|
-
import "../../../tokens/index.js";
|
|
6
|
-
import { AvatarIconProps } from "./AvatarIcon.js";
|
|
7
|
-
import { AvatarTextProps } from "./AvatarText.js";
|
|
3
|
+
import { AvatarImageProps } from "../../Avatar/AvatarImage.types.js";
|
|
8
4
|
import * as react from "react";
|
|
9
5
|
|
|
10
6
|
//#region src/components/client/Avatar/AvatarImage.d.ts
|
|
11
|
-
type DataAttributes = {
|
|
12
|
-
[name: `data-${string}`]: string;
|
|
13
|
-
};
|
|
14
|
-
interface AvatarImageProps extends UniversalAvatarImageProps {
|
|
15
|
-
/** Props to be passed into various slots within the component. */
|
|
16
|
-
slotProps?: {
|
|
17
|
-
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes>;
|
|
18
|
-
} & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
|
|
19
|
-
}
|
|
20
7
|
/**
|
|
21
8
|
* **AvatarImage Component**
|
|
22
9
|
*
|
|
23
|
-
* Renders an Avatar with an image.
|
|
24
|
-
* a text representation (if a name or initials are provided) and then to an icon.
|
|
10
|
+
* Renders an Avatar with an image.
|
|
25
11
|
*
|
|
26
12
|
* @param props - Props for image variant.
|
|
27
13
|
* @returns The AvatarImage element.
|
|
@@ -1,89 +1,68 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AvatarIcon } from "./AvatarIcon.js";
|
|
8
|
-
import { AvatarText } from "./AvatarText.js";
|
|
9
|
-
import { forwardRef, useEffect, useMemo, useState } from "react";
|
|
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";
|
|
10
7
|
import { jsx } from "react/jsx-runtime";
|
|
11
8
|
|
|
12
9
|
//#region src/components/client/Avatar/AvatarImage.tsx
|
|
13
10
|
/**
|
|
14
11
|
* **AvatarImage Component**
|
|
15
12
|
*
|
|
16
|
-
* Renders an Avatar with an image.
|
|
17
|
-
* a text representation (if a name or initials are provided) and then to an icon.
|
|
13
|
+
* Renders an Avatar with an image.
|
|
18
14
|
*
|
|
19
15
|
* @param props - Props for image variant.
|
|
20
16
|
* @returns The AvatarImage element.
|
|
21
17
|
*/
|
|
22
|
-
const AvatarImage = forwardRef((
|
|
23
|
-
const
|
|
18
|
+
const AvatarImage = forwardRef((props, ref) => {
|
|
19
|
+
const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
|
|
20
|
+
const hasImageSource = Boolean(src || srcSet);
|
|
21
|
+
const imageSourceKey = `${src ?? ""}::${srcSet ?? ""}`;
|
|
22
|
+
const [resolvedImageState, setResolvedImageState] = useState(null);
|
|
24
23
|
useEffect(() => {
|
|
24
|
+
if (!hasImageSource) return;
|
|
25
25
|
let mounted = true;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
const img = new Image();
|
|
27
|
+
img.onload = () => {
|
|
28
|
+
if (mounted) setResolvedImageState({
|
|
29
|
+
sourceKey: imageSourceKey,
|
|
30
|
+
status: "loaded"
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
img.onerror = () => {
|
|
34
|
+
if (mounted) setResolvedImageState({
|
|
35
|
+
sourceKey: imageSourceKey,
|
|
36
|
+
status: "error"
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
if (src) img.src = src;
|
|
40
|
+
if (srcSet) img.srcset = srcSet;
|
|
37
41
|
return () => {
|
|
38
42
|
mounted = false;
|
|
39
43
|
};
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
contents: cx("w-full", "h-full", "shrink-0", "text-center", "inline-flex", "justify-center", "items-center", "object-cover")
|
|
47
|
-
}), [
|
|
48
|
-
className,
|
|
49
|
-
size,
|
|
50
|
-
variant
|
|
44
|
+
}, [
|
|
45
|
+
hasImageSource,
|
|
46
|
+
imageSourceKey,
|
|
47
|
+
src,
|
|
48
|
+
srcSet
|
|
51
49
|
]);
|
|
52
|
-
|
|
53
|
-
if (loadingState === "loaded") return /* @__PURE__ */ jsx(Box, {
|
|
50
|
+
if ((!hasImageSource ? "error" : resolvedImageState?.sourceKey === imageSourceKey ? resolvedImageState.status : "loading") === "loaded") return /* @__PURE__ */ jsx(AvatarImageNoFallback, {
|
|
54
51
|
ref,
|
|
55
|
-
|
|
56
|
-
style: inlineStyles.root,
|
|
57
|
-
...props,
|
|
58
|
-
children: /* @__PURE__ */ jsx(Image$1, {
|
|
59
|
-
src,
|
|
60
|
-
srcSet,
|
|
61
|
-
alt,
|
|
62
|
-
className: classNames.contents,
|
|
63
|
-
style: inlineStyles.contents,
|
|
64
|
-
...imageProps,
|
|
65
|
-
...slotProps?.image
|
|
66
|
-
})
|
|
52
|
+
...props
|
|
67
53
|
});
|
|
68
|
-
const sharedProps = {
|
|
69
|
-
...props,
|
|
70
|
-
className,
|
|
71
|
-
size,
|
|
72
|
-
customSize,
|
|
73
|
-
variant
|
|
74
|
-
};
|
|
75
54
|
if (fallback || alt) return /* @__PURE__ */ jsx(AvatarText, {
|
|
76
55
|
ref,
|
|
77
56
|
name: alt,
|
|
78
57
|
initials: fallback,
|
|
79
58
|
abbreviationStrategy,
|
|
80
59
|
slotProps: { text: slotProps?.text },
|
|
81
|
-
...
|
|
60
|
+
...restProps
|
|
82
61
|
});
|
|
83
62
|
return /* @__PURE__ */ jsx(AvatarIcon, {
|
|
84
63
|
ref,
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
slotProps: { icon: slotProps?.icon },
|
|
65
|
+
...restProps
|
|
87
66
|
});
|
|
88
67
|
});
|
|
89
68
|
AvatarImage.displayName = "AvatarImage";
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_components_client_Avatar_AvatarIcon = require('./AvatarIcon.cjs');
|
|
5
|
-
const require_components_client_Avatar_AvatarText = require('./AvatarText.cjs');
|
|
6
4
|
const require_components_client_Avatar_AvatarImage = require('./AvatarImage.cjs');
|
|
7
|
-
const require_components_client_Avatar_Avatar = require('./Avatar.cjs');
|
|
8
5
|
|
|
9
|
-
exports.
|
|
10
|
-
exports.AvatarIcon = require_components_client_Avatar_AvatarIcon.AvatarIcon;
|
|
11
|
-
exports.AvatarImage = require_components_client_Avatar_AvatarImage.AvatarImage;
|
|
12
|
-
exports.AvatarText = require_components_client_Avatar_AvatarText.AvatarText;
|
|
6
|
+
exports.AvatarImage = require_components_client_Avatar_AvatarImage.AvatarImage;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { Avatar, AvatarProps } from "./Avatar.cjs";
|
|
6
|
-
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps };
|
|
2
|
+
import { AvatarImageProps } from "../../Avatar/AvatarImage.types.cjs";
|
|
3
|
+
import { AvatarImage } from "./AvatarImage.cjs";
|
|
4
|
+
export { AvatarImage, type AvatarImageProps };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { Avatar, AvatarProps } from "./Avatar.js";
|
|
7
|
-
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps };
|
|
3
|
+
import { AvatarImageProps } from "../../Avatar/AvatarImage.types.js";
|
|
4
|
+
import { AvatarImage } from "./AvatarImage.js";
|
|
5
|
+
export { AvatarImage, type AvatarImageProps };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
-
import { AvatarIcon } from "./AvatarIcon.js";
|
|
4
|
-
import { AvatarText } from "./AvatarText.js";
|
|
5
3
|
import { AvatarImage } from "./AvatarImage.js";
|
|
6
|
-
import { Avatar } from "./Avatar.js";
|
|
7
4
|
|
|
8
|
-
export {
|
|
5
|
+
export { AvatarImage };
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
-
const require_components_Text = require('../../Text.cjs');
|
|
7
6
|
const require_components_Box = require('../../Box.cjs');
|
|
7
|
+
const require_components_Text = require('../../Text.cjs');
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
|
|
10
10
|
//#region src/components/client/BottomSheet/BottomSheetHeader.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
-
import { Text } from "../../Text.js";
|
|
5
4
|
import { Box } from "../../Box.js";
|
|
5
|
+
import { Text } from "../../Text.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
|
|
8
8
|
//#region src/components/client/BottomSheet/BottomSheetHeader.tsx
|
|
@@ -10,9 +10,9 @@ const require_components_IconSlot = require('../IconSlot.cjs');
|
|
|
10
10
|
const require_generateDefaultClassName = require('../../automated-config/dist/utils/generateDefaultClassName.cjs');
|
|
11
11
|
const require_components_client_buttonConstants = require('./buttonConstants.cjs');
|
|
12
12
|
const require_components_client_SpringMotionConfig = require('./SpringMotionConfig.cjs');
|
|
13
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
14
13
|
let react = require("react");
|
|
15
14
|
react = require_runtime.__toESM(react);
|
|
15
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
16
16
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
17
17
|
let motion_react = require("motion/react");
|
|
18
18
|
|
|
@@ -8,8 +8,8 @@ import { IconSlot } from "../IconSlot.js";
|
|
|
8
8
|
import { generateDefaultClassName } from "../../automated-config/dist/utils/generateDefaultClassName.js";
|
|
9
9
|
import { buttonIconSvgSize } from "./buttonConstants.js";
|
|
10
10
|
import { SpringMotionConfig } from "./SpringMotionConfig.js";
|
|
11
|
-
import { Progress } from "@yahoo/uds-icons";
|
|
12
11
|
import React, { cloneElement, forwardRef, isValidElement, useImperativeHandle, useMemo, useRef } from "react";
|
|
12
|
+
import { Progress } from "@yahoo/uds-icons";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { AnimatePresence, m, useReducedMotion } from "motion/react";
|
|
15
15
|
|