@yahoo/uds 3.134.1 → 3.135.0-beta.1
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/automated-config/dist/properties.d.cts +1 -1
- package/dist/automated-config/dist/properties.d.ts +1 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.cts +1 -1
- package/dist/automated-config/dist/utils/buildConfigSchema.d.ts +1 -1
- 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 +4 -3
- package/dist/components/{client/Avatar → Avatar}/AvatarIcon.d.ts +4 -4
- 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 +18 -0
- package/dist/components/Avatar/AvatarImage.types.d.ts +18 -0
- package/dist/components/Avatar/AvatarImage.types.js +1 -0
- package/dist/components/Avatar/AvatarImageNoFallback.cjs +51 -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 +49 -0
- package/dist/components/{client/Avatar → Avatar}/AvatarText.cjs +11 -11
- package/dist/components/{client/Avatar → Avatar}/AvatarText.d.cts +4 -3
- package/dist/components/{client/Avatar → Avatar}/AvatarText.d.ts +4 -4
- package/dist/components/{client/Avatar → Avatar}/AvatarText.js +5 -5
- package/dist/components/Avatar/index.cjs +10 -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 +6 -0
- package/dist/components/{client/Avatar → Avatar}/utils.cjs +3 -4
- package/dist/components/{client/Avatar → Avatar}/utils.d.cts +3 -3
- package/dist/components/{client/Avatar → Avatar}/utils.d.ts +3 -4
- package/dist/components/{client/Avatar → Avatar}/utils.js +2 -3
- package/dist/components/Banner/Banner.cjs +2 -2
- package/dist/components/Banner/Banner.d.cts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/Banner/Banner.js +2 -2
- package/dist/components/Banner/utils.d.cts +1 -1
- package/dist/components/Banner/utils.d.ts +1 -1
- package/dist/components/Box.d.cts +1 -1
- package/dist/components/Box.d.ts +1 -1
- package/dist/components/Divider/DividerCore.cjs +1 -1
- package/dist/components/Divider/DividerCore.d.cts +2 -2
- package/dist/components/Divider/DividerCore.d.ts +2 -2
- package/dist/components/Divider/DividerCore.js +1 -1
- package/dist/components/Divider/DividerInternal.d.cts +1 -1
- package/dist/components/Divider/DividerInternal.d.ts +1 -1
- package/dist/components/FormLabel.d.cts +1 -1
- package/dist/components/FormLabel.d.ts +1 -1
- package/dist/components/HStack.d.cts +1 -1
- package/dist/components/HStack.d.ts +1 -1
- package/dist/components/Icon.cjs +15 -6
- package/dist/components/Icon.d.cts +0 -1
- package/dist/components/Icon.d.ts +0 -1
- package/dist/components/Icon.js +16 -7
- package/dist/components/IconSlot.cjs +25 -6
- package/dist/components/IconSlot.d.cts +3 -2
- package/dist/components/IconSlot.d.ts +3 -2
- package/dist/components/IconSlot.js +26 -6
- package/dist/components/Image.d.cts +1 -1
- package/dist/components/Image.d.ts +1 -1
- package/dist/components/Link.d.cts +1 -1
- package/dist/components/Link.d.ts +1 -1
- package/dist/components/Text.d.cts +1 -1
- package/dist/components/Text.d.ts +1 -1
- package/dist/components/VStack.d.cts +1 -1
- package/dist/components/VStack.d.ts +1 -1
- package/dist/components/client/Avatar/AvatarImage.cjs +37 -58
- package/dist/components/client/Avatar/AvatarImage.d.cts +2 -15
- package/dist/components/client/Avatar/AvatarImage.d.ts +2 -15
- package/dist/components/client/Avatar/AvatarImage.js +36 -57
- package/dist/components/client/Avatar/index.cjs +0 -6
- 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/Badge.d.cts +1 -1
- package/dist/components/client/Badge.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheet.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetContent.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetContent.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHandle.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.ts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.js +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.cts +1 -1
- package/dist/components/client/BottomSheet/useBottomSheetSnapModel.d.ts +1 -1
- package/dist/components/client/BottomSheet/utils.d.cts +1 -1
- package/dist/components/client/BottomSheet/utils.d.ts +1 -1
- package/dist/components/client/Button.cjs +1 -1
- package/dist/components/client/Button.d.cts +1 -1
- package/dist/components/client/Button.d.ts +1 -1
- package/dist/components/client/Button.js +1 -1
- package/dist/components/client/Checkbox.cjs +2 -2
- package/dist/components/client/Checkbox.d.cts +1 -1
- package/dist/components/client/Checkbox.d.ts +1 -1
- package/dist/components/client/Checkbox.js +2 -2
- package/dist/components/client/Chip/ChipBase.d.cts +1 -1
- package/dist/components/client/Chip/ChipBase.d.ts +1 -1
- package/dist/components/client/Chip/ChipButton.d.cts +1 -1
- package/dist/components/client/Chip/ChipButton.d.ts +1 -1
- package/dist/components/client/Chip/ChipDismissible.cjs +2 -2
- package/dist/components/client/Chip/ChipDismissible.d.cts +1 -1
- package/dist/components/client/Chip/ChipDismissible.d.ts +1 -1
- package/dist/components/client/Chip/ChipDismissible.js +2 -2
- package/dist/components/client/Chip/ChipLink.d.cts +1 -1
- package/dist/components/client/Chip/ChipLink.d.ts +1 -1
- package/dist/components/client/Chip/ChipToggle.d.cts +1 -1
- package/dist/components/client/Chip/ChipToggle.d.ts +1 -1
- package/dist/components/client/IconButton.cjs +7 -2
- package/dist/components/client/IconButton.js +7 -2
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.d.cts +1 -1
- package/dist/components/client/Input/Input.d.ts +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.d.cts +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.d.ts +1 -1
- package/dist/components/client/Menu/Menu.Content.d.cts +1 -1
- package/dist/components/client/Menu/Menu.Content.d.ts +1 -1
- package/dist/components/client/Menu/Menu.Item.d.cts +1 -1
- package/dist/components/client/Menu/Menu.Item.d.ts +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.cjs +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.d.ts +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 +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.js +1 -1
- package/dist/components/client/Modal/Modal.cjs +3 -3
- package/dist/components/client/Modal/Modal.d.cts +1 -1
- package/dist/components/client/Modal/Modal.d.ts +1 -1
- package/dist/components/client/Modal/Modal.js +3 -3
- package/dist/components/client/Modal/ModalActions.d.cts +1 -1
- package/dist/components/client/Modal/ModalActions.d.ts +1 -1
- package/dist/components/client/Modal/ModalContent.d.cts +1 -1
- package/dist/components/client/Modal/ModalContent.d.ts +1 -1
- package/dist/components/client/Modal/ModalContext.d.cts +1 -1
- package/dist/components/client/Modal/ModalContext.d.ts +1 -1
- package/dist/components/client/Modal/ModalDescription.d.cts +1 -1
- package/dist/components/client/Modal/ModalDescription.d.ts +1 -1
- package/dist/components/client/Modal/ModalTitle.d.cts +1 -1
- package/dist/components/client/Modal/ModalTitle.d.ts +1 -1
- package/dist/components/client/Modal/UDSModalConfigProvider.d.cts +1 -1
- package/dist/components/client/Modal/UDSModalConfigProvider.d.ts +1 -1
- package/dist/components/client/Popover/Popover.d.cts +1 -1
- package/dist/components/client/Popover/Popover.d.ts +1 -1
- package/dist/components/client/Popover/PopoverContent.cjs +3 -3
- package/dist/components/client/Popover/PopoverContent.d.cts +1 -1
- package/dist/components/client/Popover/PopoverContent.d.ts +1 -1
- package/dist/components/client/Popover/PopoverContent.js +3 -3
- package/dist/components/client/Popover/PopoverTrigger.d.cts +1 -1
- package/dist/components/client/Popover/PopoverTrigger.d.ts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +2 -2
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +2 -2
- package/dist/components/client/Popover/index.d.cts +1 -1
- package/dist/components/client/Popover/index.d.ts +1 -1
- package/dist/components/client/Pressable.d.cts +1 -1
- package/dist/components/client/Pressable.d.ts +1 -1
- package/dist/components/client/Radio/Radio.d.cts +1 -1
- package/dist/components/client/Radio/Radio.d.ts +1 -1
- package/dist/components/client/Radio/RadioGroupProvider.d.cts +1 -1
- package/dist/components/client/Radio/RadioGroupProvider.d.ts +1 -1
- package/dist/components/client/SpringMotionConfig.d.cts +1 -1
- package/dist/components/client/SpringMotionConfig.d.ts +1 -1
- package/dist/components/client/Switch.cjs +1 -1
- package/dist/components/client/Switch.d.cts +1 -1
- package/dist/components/client/Switch.d.ts +1 -1
- package/dist/components/client/Switch.js +1 -1
- package/dist/components/client/Tabs/Tab.d.cts +1 -1
- package/dist/components/client/Tabs/Tab.d.ts +1 -1
- package/dist/components/client/Tabs/TabList.d.cts +1 -1
- package/dist/components/client/Tabs/TabList.d.ts +1 -1
- package/dist/components/client/Tabs/TabPanel.d.cts +1 -1
- package/dist/components/client/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/client/Tabs/Tabs.d.cts +1 -1
- package/dist/components/client/Tabs/Tabs.d.ts +1 -1
- package/dist/components/client/Tabs/tabsContext.d.cts +1 -1
- package/dist/components/client/Tabs/tabsContext.d.ts +1 -1
- package/dist/components/client/Toast/Toast.cjs +1 -1
- package/dist/components/client/Toast/Toast.d.cts +1 -1
- package/dist/components/client/Toast/Toast.d.ts +1 -1
- package/dist/components/client/Toast/Toast.js +1 -1
- package/dist/components/client/Toast/ToastContainer.d.cts +1 -1
- package/dist/components/client/Toast/ToastContainer.d.ts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +1 -1
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +1 -1
- package/dist/components/client/Toast/createToast.d.cts +1 -1
- package/dist/components/client/Toast/createToast.d.ts +1 -1
- package/dist/components/client/Tooltip/Tooltip.d.cts +1 -1
- package/dist/components/client/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/client/Tooltip/TooltipContent.cjs +1 -1
- package/dist/components/client/Tooltip/TooltipContent.d.cts +2 -2
- package/dist/components/client/Tooltip/TooltipContent.d.ts +2 -2
- package/dist/components/client/Tooltip/TooltipContent.js +1 -1
- package/dist/components/client/Tooltip/TooltipTrigger.d.cts +1 -1
- package/dist/components/client/Tooltip/TooltipTrigger.d.ts +1 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.cts +1 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.ts +1 -1
- package/dist/components/client/Tooltip/index.d.cts +1 -1
- package/dist/components/client/Tooltip/index.d.ts +1 -1
- package/dist/components/client/buttonConstants.d.cts +1 -1
- package/dist/components/client/buttonConstants.d.ts +1 -1
- package/dist/components/client/index.cjs +1 -7
- package/dist/components/client/index.d.cts +4 -6
- package/dist/components/client/index.d.ts +4 -6
- package/dist/components/client/index.js +2 -5
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.cts +1 -1
- package/dist/components/client/providers/UDSBreakpointsConfigProvider.d.ts +1 -1
- package/dist/components/experimental/Table.cjs +1 -1
- package/dist/components/experimental/Table.d.cts +2 -2
- package/dist/components/experimental/Table.d.ts +2 -2
- 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.d.cts +1 -1
- package/dist/components/experimental/client/SwitchV2.d.ts +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 -7
- package/dist/components/index.d.ts +9 -7
- package/dist/components/index.js +10 -8
- package/dist/config/dist/index.d.cts +1 -1
- package/dist/config/dist/index.d.ts +1 -1
- package/dist/css-tokens/dist/index.d.cts +1 -1
- package/dist/css-tokens/dist/index.d.ts +1 -1
- package/dist/fixtures/dist/index.d.cts +1 -1
- package/dist/fixtures/dist/index.d.ts +1 -1
- package/dist/fixtures/index.d.cts +1 -1
- package/dist/fixtures/index.d.ts +1 -1
- package/dist/fonts/dist/index.d.cts +1 -1
- package/dist/fonts/dist/index.d.ts +1 -1
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +9 -8
- package/dist/modes/dist/index.d.cts +1 -1
- package/dist/modes/dist/index.d.ts +1 -1
- package/dist/motion-tokens/dist/index.d.cts +1 -1
- package/dist/motion-tokens/dist/index.d.ts +1 -1
- package/dist/providers/ColorModeProvider.d.cts +1 -1
- package/dist/providers/ColorModeProvider.d.ts +1 -1
- package/dist/providers/ScaleModeProvider.d.cts +1 -1
- package/dist/providers/ScaleModeProvider.d.ts +1 -1
- package/dist/providers/ThemeProvider.d.cts +1 -1
- package/dist/providers/ThemeProvider.d.ts +1 -1
- package/dist/runtime/bottomSheetConfig.d.cts +1 -1
- package/dist/runtime/bottomSheetConfig.d.ts +1 -1
- package/dist/runtime/breakpointsConfig.d.cts +1 -1
- package/dist/runtime/breakpointsConfig.d.ts +1 -1
- package/dist/runtime/modalConfig.d.cts +1 -1
- package/dist/runtime/modalConfig.d.ts +1 -1
- package/dist/runtime/popoverConfig.d.cts +1 -1
- package/dist/runtime/popoverConfig.d.ts +1 -1
- package/dist/runtime/toastConfig.d.cts +1 -1
- package/dist/runtime/toastConfig.d.ts +1 -1
- package/dist/runtime/tooltipConfig.d.cts +1 -1
- package/dist/runtime/tooltipConfig.d.ts +1 -1
- package/dist/styles/styler.d.cts +21 -21
- package/dist/styles/styler.d.ts +21 -21
- package/dist/styles/stylerTypes.d.cts +1 -1
- package/dist/styles/stylerTypes.d.ts +1 -1
- package/dist/tailwind/dist/commands/generatePurgeCSSData.cjs +6 -2
- package/dist/tailwind/dist/commands/generatePurgeCSSData.d.cts.map +1 -1
- package/dist/tailwind/dist/commands/generatePurgeCSSData.d.ts.map +1 -1
- package/dist/tailwind/dist/commands/generatePurgeCSSData.js +5 -2
- package/dist/tailwind/dist/commands/generatePurgeCSSData.js.map +1 -1
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +4 -4
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +4 -4
- package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
- package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
- package/dist/tokens/configs/borderRadius.d.cts +1 -1
- package/dist/tokens/configs/borderRadius.d.ts +1 -1
- package/dist/tokens/configs/borderWidth.d.cts +1 -1
- package/dist/tokens/configs/borderWidth.d.ts +1 -1
- package/dist/tokens/configs/font.d.cts +1 -1
- package/dist/tokens/configs/font.d.ts +1 -1
- package/dist/tokens/configs/scaleMode.d.cts +1 -1
- package/dist/tokens/configs/scaleMode.d.ts +1 -1
- package/dist/tokens/configs/shadow.d.cts +1 -1
- package/dist/tokens/configs/shadow.d.ts +1 -1
- package/dist/tokens/configs/sizes.d.cts +1 -1
- package/dist/tokens/configs/sizes.d.ts +1 -1
- package/dist/tokens/configs/typography.d.cts +1 -1
- package/dist/tokens/configs/typography.d.ts +1 -1
- package/dist/tokens/index.d.cts +2 -2
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/parseButtonVariants.d.cts +1 -1
- package/dist/tokens/parseButtonVariants.d.ts +1 -1
- package/dist/tokens/types.d.cts +7 -7
- package/dist/tokens/types.d.ts +7 -7
- package/dist/tokens/utils/spectrum.d.cts +1 -1
- package/dist/tokens/utils/spectrum.d.ts +1 -1
- package/dist/types/{dist → src}/index.d.cts +35 -23
- package/dist/types/{dist → src}/index.d.ts +35 -23
- package/dist/uds/generated/componentData.cjs +1718 -1698
- package/dist/uds/generated/componentData.js +1715 -1701
- package/dist/uds/generated/tailwindPurge.cjs +128 -104
- package/dist/uds/generated/tailwindPurge.js +128 -104
- package/dist/utils/isElevationAlias.d.cts +1 -1
- package/dist/utils/isElevationAlias.d.ts +1 -1
- package/generated/componentData.json +2235 -2227
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +1 -1
- package/dist/icons/dist/types.d.cts +0 -30
- package/dist/icons/dist/types.d.ts +0 -30
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ShadowPreset } from "../../types/
|
|
2
|
+
import { ShadowPreset } from "../../types/src/index.cjs";
|
|
3
3
|
import { ArbitraryFixtures, InferArbitraryType } from "../../fixtures/dist/index.cjs";
|
|
4
4
|
import { AllPossibleProperties, PossibleStates } from "./types/ComponentConfig.cjs";
|
|
5
5
|
import { SchemaStateValue } from "./types/ConfigSchema.cjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ShadowPreset } from "../../types/
|
|
2
|
+
import { ShadowPreset } from "../../types/src/index.js";
|
|
3
3
|
import { ArbitraryFixtures, InferArbitraryType } from "../../fixtures/dist/index.js";
|
|
4
4
|
import { AllPossibleProperties, PossibleStates } from "./types/ComponentConfig.js";
|
|
5
5
|
import { SchemaStateValue } from "./types/ConfigSchema.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { BannerInnerShadowOption, ElevationAlias, ShadowVariant, ShadowVariantConfig, ShadowVariantWithInvert } from "../../../types/
|
|
2
|
+
import { BannerInnerShadowOption, ElevationAlias, ShadowVariant, ShadowVariantConfig, ShadowVariantWithInvert } from "../../../types/src/index.cjs";
|
|
3
3
|
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.cjs";
|
|
4
4
|
import { AllPossibleProperties, ComponentConfig, LayerConfig, PossibleStates, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.cjs";
|
|
5
5
|
import { SchemaStateValue } from "../types/ConfigSchema.cjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { BannerInnerShadowOption, ElevationAlias, ShadowVariant, ShadowVariantConfig, ShadowVariantWithInvert } from "../../../types/
|
|
2
|
+
import { BannerInnerShadowOption, ElevationAlias, ShadowVariant, ShadowVariantConfig, ShadowVariantWithInvert } from "../../../types/src/index.js";
|
|
3
3
|
import { ArbitraryFixtures, InferArbitraryType } from "../../../fixtures/dist/index.js";
|
|
4
4
|
import { AllPossibleProperties, ComponentConfig, LayerConfig, PossibleStates, VariantConfig, VariantConfigWithComponentStates, VariantConfigWithProperties } from "../types/ComponentConfig.js";
|
|
5
5
|
import { SchemaStateValue } from "../types/ConfigSchema.js";
|
package/dist/cli/runner.cjs
CHANGED
|
@@ -14,6 +14,10 @@ const require_cli_commands_version = require("./commands/version.cjs");
|
|
|
14
14
|
let node_path = require("node:path");
|
|
15
15
|
let ts_morph = require("ts-morph");
|
|
16
16
|
//#region src/cli/runner.ts
|
|
17
|
+
const isMissingIconsPackageError = (error) => {
|
|
18
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
19
|
+
return message.includes("@yahoo/uds-icons/cli") || message.includes("Cannot find package") || message.includes("ERR_MODULE_NOT_FOUND");
|
|
20
|
+
};
|
|
17
21
|
require_cli.run([
|
|
18
22
|
require_cli_commands_version.versionCommand,
|
|
19
23
|
require_purge.makePurgeCommand(async () => {
|
|
@@ -52,6 +56,42 @@ require_cli.run([
|
|
|
52
56
|
componentData
|
|
53
57
|
};
|
|
54
58
|
}),
|
|
59
|
+
{
|
|
60
|
+
name: "create-icons",
|
|
61
|
+
description: "Create grouped IconDefinition modules from SVG assets directory",
|
|
62
|
+
run: async (props) => {
|
|
63
|
+
const commandModulePath = ["@yahoo/uds-icons", "cli"].join("/");
|
|
64
|
+
try {
|
|
65
|
+
const makeCreateIconsCommand = (await import(commandModulePath)).makeCreateIconsCommand;
|
|
66
|
+
if (typeof makeCreateIconsCommand !== "function") {
|
|
67
|
+
console.log("The @yahoo/uds-icons package is missing create-icons support. Please install or update @yahoo/uds-icons to use this command.");
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
await makeCreateIconsCommand().run(props);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (isMissingIconsPackageError(error)) {
|
|
73
|
+
try {
|
|
74
|
+
const makeCreateIconsCommand = (await import([
|
|
75
|
+
"..",
|
|
76
|
+
"..",
|
|
77
|
+
"..",
|
|
78
|
+
"icons",
|
|
79
|
+
"src",
|
|
80
|
+
"cli",
|
|
81
|
+
"index.ts"
|
|
82
|
+
].join("/"))).makeCreateIconsCommand;
|
|
83
|
+
if (typeof makeCreateIconsCommand === "function") {
|
|
84
|
+
await makeCreateIconsCommand().run(props);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
} catch {}
|
|
88
|
+
console.log("Install @yahoo/uds-icons to use `uds create-icons` (for example: bun add -d @yahoo/uds-icons).");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
55
95
|
require_cli_commands_sync.syncCommand
|
|
56
96
|
]);
|
|
57
97
|
//#endregion
|
package/dist/cli/runner.js
CHANGED
|
@@ -13,6 +13,10 @@ import { versionCommand } from "./commands/version.js";
|
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { Project } from "ts-morph";
|
|
15
15
|
//#region src/cli/runner.ts
|
|
16
|
+
const isMissingIconsPackageError = (error) => {
|
|
17
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
18
|
+
return message.includes("@yahoo/uds-icons/cli") || message.includes("Cannot find package") || message.includes("ERR_MODULE_NOT_FOUND");
|
|
19
|
+
};
|
|
16
20
|
run([
|
|
17
21
|
versionCommand,
|
|
18
22
|
makePurgeCommand(async () => {
|
|
@@ -51,6 +55,42 @@ run([
|
|
|
51
55
|
componentData
|
|
52
56
|
};
|
|
53
57
|
}),
|
|
58
|
+
{
|
|
59
|
+
name: "create-icons",
|
|
60
|
+
description: "Create grouped IconDefinition modules from SVG assets directory",
|
|
61
|
+
run: async (props) => {
|
|
62
|
+
const commandModulePath = ["@yahoo/uds-icons", "cli"].join("/");
|
|
63
|
+
try {
|
|
64
|
+
const makeCreateIconsCommand = (await import(commandModulePath)).makeCreateIconsCommand;
|
|
65
|
+
if (typeof makeCreateIconsCommand !== "function") {
|
|
66
|
+
console.log("The @yahoo/uds-icons package is missing create-icons support. Please install or update @yahoo/uds-icons to use this command.");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
await makeCreateIconsCommand().run(props);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
if (isMissingIconsPackageError(error)) {
|
|
72
|
+
try {
|
|
73
|
+
const makeCreateIconsCommand = (await import([
|
|
74
|
+
"..",
|
|
75
|
+
"..",
|
|
76
|
+
"..",
|
|
77
|
+
"icons",
|
|
78
|
+
"src",
|
|
79
|
+
"cli",
|
|
80
|
+
"index.ts"
|
|
81
|
+
].join("/"))).makeCreateIconsCommand;
|
|
82
|
+
if (typeof makeCreateIconsCommand === "function") {
|
|
83
|
+
await makeCreateIconsCommand().run(props);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
} catch {}
|
|
87
|
+
console.log("Install @yahoo/uds-icons to use `uds create-icons` (for example: bun add -d @yahoo/uds-icons).");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
54
94
|
syncCommand
|
|
55
95
|
]);
|
|
56
96
|
//#endregion
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
"use client";
|
|
3
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
require("
|
|
5
|
-
const
|
|
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");
|
|
6
7
|
let react = require("react");
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
//#region src/components/
|
|
9
|
+
//#region src/components/Avatar/Avatar.tsx
|
|
9
10
|
/**
|
|
10
11
|
* **👤 Avatar Component**
|
|
11
12
|
*
|
|
@@ -13,7 +14,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
13
14
|
* @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.
|
|
14
15
|
* @param props - Combined Avatar props.
|
|
15
16
|
* @returns The Avatar element.
|
|
16
|
-
* @componentType
|
|
17
|
+
* @componentType Server component
|
|
17
18
|
* @example ```tsx
|
|
18
19
|
* import { Avatar } from '@yahoo/uds';
|
|
19
20
|
*
|
|
@@ -26,10 +27,24 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
26
27
|
*
|
|
27
28
|
*/
|
|
28
29
|
const Avatar = (0, react.forwardRef)((props, ref) => {
|
|
29
|
-
|
|
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, {
|
|
30
32
|
ref,
|
|
31
33
|
...props
|
|
32
34
|
});
|
|
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
|
+
});
|
|
33
48
|
});
|
|
34
49
|
Avatar.displayName = "Avatar";
|
|
35
50
|
//#endregion
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { AvatarImageProps } from "./AvatarImage.cjs";
|
|
2
|
+
import { AvatarImageProps } from "./AvatarImage.types.cjs";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
|
|
5
|
-
//#region src/components/
|
|
5
|
+
//#region src/components/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
|
|
14
|
+
* @componentType Server component
|
|
15
15
|
* @example ```tsx
|
|
16
16
|
* import { Avatar } from '@yahoo/uds';
|
|
17
17
|
*
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import { AvatarImageProps } from "./AvatarImage.js";
|
|
2
|
+
import { AvatarImageProps } from "./AvatarImage.types.js";
|
|
4
3
|
import * as _$react from "react";
|
|
5
4
|
|
|
6
|
-
//#region src/components/
|
|
5
|
+
//#region src/components/Avatar/Avatar.d.ts
|
|
7
6
|
type AvatarProps = AvatarImageProps;
|
|
8
7
|
/**
|
|
9
8
|
* **👤 Avatar Component**
|
|
@@ -12,7 +11,7 @@ type AvatarProps = AvatarImageProps;
|
|
|
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
|
|
14
|
+
* @componentType Server component
|
|
16
15
|
* @example ```tsx
|
|
17
16
|
* import { Avatar } from '@yahoo/uds';
|
|
18
17
|
*
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
import { AvatarIcon } from "./AvatarIcon.js";
|
|
3
|
+
import { AvatarText } from "./AvatarText.js";
|
|
4
|
+
import { AvatarImage } from "../client/Avatar/AvatarImage.js";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/
|
|
7
|
+
//#region src/components/Avatar/Avatar.tsx
|
|
7
8
|
/**
|
|
8
9
|
* **👤 Avatar Component**
|
|
9
10
|
*
|
|
@@ -11,7 +12,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
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
|
|
15
|
+
* @componentType Server component
|
|
15
16
|
* @example ```tsx
|
|
16
17
|
* import { Avatar } from '@yahoo/uds';
|
|
17
18
|
*
|
|
@@ -24,10 +25,24 @@ import { jsx } from "react/jsx-runtime";
|
|
|
24
25
|
*
|
|
25
26
|
*/
|
|
26
27
|
const Avatar = forwardRef((props, ref) => {
|
|
27
|
-
|
|
28
|
+
const { src, srcSet, alt, fallback, abbreviationStrategy, slotProps, ...restProps } = props;
|
|
29
|
+
if (src || srcSet) return /* @__PURE__ */ jsx(AvatarImage, {
|
|
28
30
|
ref,
|
|
29
31
|
...props
|
|
30
32
|
});
|
|
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
|
+
});
|
|
31
46
|
});
|
|
32
47
|
Avatar.displayName = "Avatar";
|
|
33
48
|
//#endregion
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
"use client";
|
|
3
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
require("
|
|
5
|
-
const require_styles_styler = require("
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
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");
|
|
10
8
|
let react = require("react");
|
|
9
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
11
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
-
//#region src/components/
|
|
13
|
-
/** Maps avatar variant to icon */
|
|
11
|
+
//#region src/components/Avatar/AvatarIcon.tsx
|
|
14
12
|
const mapVariantToIcon = {
|
|
15
13
|
primary: _yahoo_uds_icons.Person,
|
|
16
14
|
secondary: _yahoo_uds_icons.Building
|
|
@@ -22,10 +20,11 @@ const mapVariantToIcon = {
|
|
|
22
20
|
*
|
|
23
21
|
* @param props - Props for icon variant.
|
|
24
22
|
* @returns The AvatarIcon element.
|
|
23
|
+
* @componentType Server component
|
|
25
24
|
*/
|
|
26
|
-
const AvatarIcon = (0, react.forwardRef)(({ size = "md", variant =
|
|
25
|
+
const AvatarIcon = (0, react.forwardRef)(({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, customSize, icon, slotProps, className, ...props }, ref) => {
|
|
27
26
|
const classNames = (0, react.useMemo)(() => ({
|
|
28
|
-
root:
|
|
27
|
+
root: require_components_Avatar_utils.buildAvatarRootClasses(size, {
|
|
29
28
|
avatarIconVariantRoot: variant,
|
|
30
29
|
overflow: "hidden",
|
|
31
30
|
className: require_styles_styler.cx("overflow-hidden", className)
|
|
@@ -37,7 +36,7 @@ const AvatarIcon = (0, react.forwardRef)(({ size = "md", variant = require_compo
|
|
|
37
36
|
size,
|
|
38
37
|
variant
|
|
39
38
|
]);
|
|
40
|
-
const inlineStyles = (0, react.useMemo)(() =>
|
|
39
|
+
const inlineStyles = (0, react.useMemo)(() => require_components_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
|
|
41
40
|
const iconSvg = icon ?? mapVariantToIcon[variant ?? "primary"];
|
|
42
41
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
43
42
|
ref,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalAvatarIconProps } from "
|
|
3
|
-
import { IconPropsWithSVGProps } from "
|
|
2
|
+
import { UniversalAvatarIconProps } from "../../types/src/index.cjs";
|
|
3
|
+
import { IconPropsWithSVGProps } from "../../tokens/types.cjs";
|
|
4
4
|
import * as _$react from "react";
|
|
5
5
|
|
|
6
|
-
//#region src/components/
|
|
6
|
+
//#region src/components/Avatar/AvatarIcon.d.ts
|
|
7
7
|
type DataAttributes = {
|
|
8
8
|
[name: `data-${string}`]: string;
|
|
9
9
|
};
|
|
@@ -20,6 +20,7 @@ interface AvatarIconProps extends UniversalAvatarIconProps {
|
|
|
20
20
|
*
|
|
21
21
|
* @param props - Props for icon variant.
|
|
22
22
|
* @returns The AvatarIcon element.
|
|
23
|
+
* @componentType Server component
|
|
23
24
|
*/
|
|
24
25
|
declare const AvatarIcon: _$react.ForwardRefExoticComponent<AvatarIconProps & _$react.RefAttributes<HTMLDivElement>>;
|
|
25
26
|
//#endregion
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
2
|
+
import { UniversalAvatarIconProps } from "../../types/src/index.js";
|
|
3
|
+
import { IconPropsWithSVGProps } from "../../tokens/types.js";
|
|
5
4
|
import * as _$react from "react";
|
|
6
5
|
|
|
7
|
-
//#region src/components/
|
|
6
|
+
//#region src/components/Avatar/AvatarIcon.d.ts
|
|
8
7
|
type DataAttributes = {
|
|
9
8
|
[name: `data-${string}`]: string;
|
|
10
9
|
};
|
|
@@ -21,6 +20,7 @@ interface AvatarIconProps extends UniversalAvatarIconProps {
|
|
|
21
20
|
*
|
|
22
21
|
* @param props - Props for icon variant.
|
|
23
22
|
* @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,14 +1,12 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { IconSlot } from "
|
|
5
|
-
import { Box } from "../../Box.js";
|
|
2
|
+
import { cx, getStyles } from "../../styles/styler.js";
|
|
3
|
+
import { Box } from "../Box.js";
|
|
4
|
+
import { IconSlot } from "../IconSlot.js";
|
|
6
5
|
import { DEFAULT_AVATAR_VARIANT, buildAvatarRootClasses, buildInlineSizeStyles } from "./utils.js";
|
|
7
|
-
import { Building, Person } from "@yahoo/uds-icons";
|
|
8
6
|
import { forwardRef, useMemo } from "react";
|
|
7
|
+
import { Building, Person } from "@yahoo/uds-icons";
|
|
9
8
|
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
//#region src/components/
|
|
11
|
-
/** Maps avatar variant to icon */
|
|
9
|
+
//#region src/components/Avatar/AvatarIcon.tsx
|
|
12
10
|
const mapVariantToIcon = {
|
|
13
11
|
primary: Person,
|
|
14
12
|
secondary: Building
|
|
@@ -20,6 +18,7 @@ const mapVariantToIcon = {
|
|
|
20
18
|
*
|
|
21
19
|
* @param props - Props for icon variant.
|
|
22
20
|
* @returns The AvatarIcon element.
|
|
21
|
+
* @componentType Server component
|
|
23
22
|
*/
|
|
24
23
|
const AvatarIcon = forwardRef(({ size = "md", variant = DEFAULT_AVATAR_VARIANT, customSize, icon, slotProps, className, ...props }, ref) => {
|
|
25
24
|
const classNames = useMemo(() => ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { ImagePropsWithImgProps } from "../../types/src/index.cjs";
|
|
3
|
+
import { UniversalAvatarImageProps } from "../../tokens/types.cjs";
|
|
4
|
+
import { AvatarIconProps } from "./AvatarIcon.cjs";
|
|
5
|
+
import { AvatarTextProps } from "./AvatarText.cjs";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Avatar/AvatarImage.types.d.ts
|
|
8
|
+
type DataAttributes = {
|
|
9
|
+
[name: `data-${string}`]: string;
|
|
10
|
+
};
|
|
11
|
+
interface AvatarImageProps extends UniversalAvatarImageProps {
|
|
12
|
+
/** Props to be passed into various slots within the component. */
|
|
13
|
+
slotProps?: {
|
|
14
|
+
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes>;
|
|
15
|
+
} & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { type AvatarImageProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { ImagePropsWithImgProps } from "../../types/src/index.js";
|
|
3
|
+
import { UniversalAvatarImageProps } from "../../tokens/types.js";
|
|
4
|
+
import { AvatarIconProps } from "./AvatarIcon.js";
|
|
5
|
+
import { AvatarTextProps } from "./AvatarText.js";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Avatar/AvatarImage.types.d.ts
|
|
8
|
+
type DataAttributes = {
|
|
9
|
+
[name: `data-${string}`]: string;
|
|
10
|
+
};
|
|
11
|
+
interface AvatarImageProps extends UniversalAvatarImageProps {
|
|
12
|
+
/** Props to be passed into various slots within the component. */
|
|
13
|
+
slotProps?: {
|
|
14
|
+
image?: Partial<Omit<ImagePropsWithImgProps, 'src' | 'srcSet' | 'alt' | 'className' | 'height' | 'width'> & DataAttributes>;
|
|
15
|
+
} & AvatarIconProps['slotProps'] & AvatarTextProps['slotProps'];
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { type AvatarImageProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
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_Image = require("../Image.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
//#region src/components/Avatar/AvatarImageNoFallback.tsx
|
|
11
|
+
/**
|
|
12
|
+
* **AvatarImageNoFallback Component**
|
|
13
|
+
*
|
|
14
|
+
* Renders an Avatar image without client-side fallback dispatch.
|
|
15
|
+
*
|
|
16
|
+
* @param props - Props for image variant.
|
|
17
|
+
* @returns The AvatarImageNoFallback element.
|
|
18
|
+
* @componentType Server component
|
|
19
|
+
*/
|
|
20
|
+
const AvatarImageNoFallback = (0, react.forwardRef)(({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, src, srcSet, customSize, alt, className, imageProps, slotProps, ...props }, ref) => {
|
|
21
|
+
const classNames = (0, react.useMemo)(() => ({
|
|
22
|
+
root: require_components_Avatar_utils.buildAvatarRootClasses(size, {
|
|
23
|
+
avatarImageVariantRoot: variant,
|
|
24
|
+
className: require_styles_styler.cx("overflow-hidden", className)
|
|
25
|
+
}),
|
|
26
|
+
contents: require_styles_styler.cx("w-full", "h-full", "shrink-0", "text-center", "inline-flex", "justify-center", "items-center", "object-cover")
|
|
27
|
+
}), [
|
|
28
|
+
className,
|
|
29
|
+
size,
|
|
30
|
+
variant
|
|
31
|
+
]);
|
|
32
|
+
const inlineStyles = (0, react.useMemo)(() => require_components_Avatar_utils.buildInlineSizeStyles(customSize), [customSize]);
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
34
|
+
ref,
|
|
35
|
+
className: classNames.root,
|
|
36
|
+
style: inlineStyles.root,
|
|
37
|
+
...props,
|
|
38
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Image.Image, {
|
|
39
|
+
src,
|
|
40
|
+
srcSet,
|
|
41
|
+
alt,
|
|
42
|
+
className: classNames.contents,
|
|
43
|
+
style: inlineStyles.contents,
|
|
44
|
+
...imageProps,
|
|
45
|
+
...slotProps?.image
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
AvatarImageNoFallback.displayName = "AvatarImageNoFallback";
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.AvatarImageNoFallback = AvatarImageNoFallback;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { AvatarImageProps } from "./AvatarImage.types.cjs";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Avatar/AvatarImageNoFallback.d.ts
|
|
6
|
+
type AvatarImageNoFallbackProps = AvatarImageProps;
|
|
7
|
+
/**
|
|
8
|
+
* **AvatarImageNoFallback Component**
|
|
9
|
+
*
|
|
10
|
+
* Renders an Avatar image without client-side fallback dispatch.
|
|
11
|
+
*
|
|
12
|
+
* @param props - Props for image variant.
|
|
13
|
+
* @returns The AvatarImageNoFallback element.
|
|
14
|
+
* @componentType Server component
|
|
15
|
+
*/
|
|
16
|
+
declare const AvatarImageNoFallback: _$react.ForwardRefExoticComponent<AvatarImageProps & _$react.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AvatarImageNoFallback, type AvatarImageNoFallbackProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { AvatarImageProps } from "./AvatarImage.types.js";
|
|
3
|
+
import * as _$react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Avatar/AvatarImageNoFallback.d.ts
|
|
6
|
+
type AvatarImageNoFallbackProps = AvatarImageProps;
|
|
7
|
+
/**
|
|
8
|
+
* **AvatarImageNoFallback Component**
|
|
9
|
+
*
|
|
10
|
+
* Renders an Avatar image without client-side fallback dispatch.
|
|
11
|
+
*
|
|
12
|
+
* @param props - Props for image variant.
|
|
13
|
+
* @returns The AvatarImageNoFallback element.
|
|
14
|
+
* @componentType Server component
|
|
15
|
+
*/
|
|
16
|
+
declare const AvatarImageNoFallback: _$react.ForwardRefExoticComponent<AvatarImageProps & _$react.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AvatarImageNoFallback, type AvatarImageNoFallbackProps };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
import { cx } from "../../styles/styler.js";
|
|
3
|
+
import { Box } from "../Box.js";
|
|
4
|
+
import { DEFAULT_AVATAR_VARIANT, buildAvatarRootClasses, buildInlineSizeStyles } from "./utils.js";
|
|
5
|
+
import { Image } from "../Image.js";
|
|
6
|
+
import { forwardRef, useMemo } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/Avatar/AvatarImageNoFallback.tsx
|
|
9
|
+
/**
|
|
10
|
+
* **AvatarImageNoFallback Component**
|
|
11
|
+
*
|
|
12
|
+
* Renders an Avatar image without client-side fallback dispatch.
|
|
13
|
+
*
|
|
14
|
+
* @param props - Props for image variant.
|
|
15
|
+
* @returns The AvatarImageNoFallback element.
|
|
16
|
+
* @componentType Server component
|
|
17
|
+
*/
|
|
18
|
+
const AvatarImageNoFallback = forwardRef(({ size = "md", variant = DEFAULT_AVATAR_VARIANT, src, srcSet, customSize, alt, className, imageProps, slotProps, ...props }, ref) => {
|
|
19
|
+
const classNames = useMemo(() => ({
|
|
20
|
+
root: buildAvatarRootClasses(size, {
|
|
21
|
+
avatarImageVariantRoot: variant,
|
|
22
|
+
className: cx("overflow-hidden", className)
|
|
23
|
+
}),
|
|
24
|
+
contents: cx("w-full", "h-full", "shrink-0", "text-center", "inline-flex", "justify-center", "items-center", "object-cover")
|
|
25
|
+
}), [
|
|
26
|
+
className,
|
|
27
|
+
size,
|
|
28
|
+
variant
|
|
29
|
+
]);
|
|
30
|
+
const inlineStyles = useMemo(() => buildInlineSizeStyles(customSize), [customSize]);
|
|
31
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
32
|
+
ref,
|
|
33
|
+
className: classNames.root,
|
|
34
|
+
style: inlineStyles.root,
|
|
35
|
+
...props,
|
|
36
|
+
children: /* @__PURE__ */ jsx(Image, {
|
|
37
|
+
src,
|
|
38
|
+
srcSet,
|
|
39
|
+
alt,
|
|
40
|
+
className: classNames.contents,
|
|
41
|
+
style: inlineStyles.contents,
|
|
42
|
+
...imageProps,
|
|
43
|
+
...slotProps?.image
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
AvatarImageNoFallback.displayName = "AvatarImageNoFallback";
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AvatarImageNoFallback };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
"use client";
|
|
3
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
require("
|
|
5
|
-
const require_styles_styler = require("
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
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");
|
|
9
8
|
let react = require("react");
|
|
10
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
-
//#region src/components/
|
|
10
|
+
//#region src/components/Avatar/AvatarText.tsx
|
|
12
11
|
/**
|
|
13
12
|
* **AvatarText Component**
|
|
14
13
|
*
|
|
@@ -16,10 +15,11 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
16
15
|
*
|
|
17
16
|
* @param props - Props for text variant.
|
|
18
17
|
* @returns The AvatarText element.
|
|
18
|
+
* @componentType Server component
|
|
19
19
|
*/
|
|
20
|
-
const AvatarText = (0, react.forwardRef)(({ size = "md", variant =
|
|
20
|
+
const AvatarText = (0, react.forwardRef)(({ size = "md", variant = require_components_Avatar_utils.DEFAULT_AVATAR_VARIANT, name, initials, customSize, abbreviationStrategy, className, slotProps, ...props }, ref) => {
|
|
21
21
|
const classNames = (0, react.useMemo)(() => ({
|
|
22
|
-
root:
|
|
22
|
+
root: require_components_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)(() =>
|
|
32
|
+
const inlineStyles = (0, react.useMemo)(() => require_components_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 ||
|
|
44
|
+
children: initials || require_components_Avatar_utils.generateAvatarAbbreviation(name, abbreviationStrategy)
|
|
45
45
|
})
|
|
46
46
|
});
|
|
47
47
|
});
|