@yahoo/uds 3.135.0 → 3.137.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.
- 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 +0 -40
- package/dist/cli/runner.js +0 -40
- 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 +6 -15
- package/dist/components/Icon.d.cts +1 -0
- package/dist/components/Icon.d.ts +1 -0
- package/dist/components/Icon.js +7 -16
- package/dist/components/IconSlot.cjs +6 -25
- package/dist/components/IconSlot.d.cts +2 -3
- package/dist/components/IconSlot.d.ts +2 -3
- package/dist/components/IconSlot.js +6 -26
- 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/{Avatar → client/Avatar}/Avatar.cjs +6 -21
- package/dist/components/{Avatar → client/Avatar}/Avatar.d.cts +3 -3
- package/dist/components/{Avatar → client/Avatar}/Avatar.d.ts +4 -3
- package/dist/components/{Avatar → client/Avatar}/Avatar.js +5 -20
- package/dist/components/{Avatar → client/Avatar}/AvatarIcon.cjs +12 -11
- package/dist/components/{Avatar → client/Avatar}/AvatarIcon.d.cts +3 -4
- package/dist/components/{Avatar → client/Avatar}/AvatarIcon.d.ts +4 -4
- package/dist/components/{Avatar → client/Avatar}/AvatarIcon.js +7 -6
- package/dist/components/client/Avatar/AvatarImage.cjs +58 -37
- package/dist/components/client/Avatar/AvatarImage.d.cts +15 -2
- package/dist/components/client/Avatar/AvatarImage.d.ts +15 -2
- package/dist/components/client/Avatar/AvatarImage.js +57 -36
- package/dist/components/{Avatar → client/Avatar}/AvatarText.cjs +11 -11
- package/dist/components/{Avatar → client/Avatar}/AvatarText.d.cts +3 -4
- package/dist/components/{Avatar → client/Avatar}/AvatarText.d.ts +4 -4
- package/dist/components/{Avatar → client/Avatar}/AvatarText.js +5 -5
- package/dist/components/client/Avatar/index.cjs +6 -0
- package/dist/components/client/Avatar/index.d.cts +5 -3
- package/dist/components/client/Avatar/index.d.ts +5 -3
- package/dist/components/client/Avatar/index.js +4 -1
- package/dist/components/{Avatar → client/Avatar}/utils.cjs +4 -3
- package/dist/components/{Avatar → client/Avatar}/utils.d.cts +3 -3
- package/dist/components/{Avatar → client/Avatar}/utils.d.ts +4 -3
- package/dist/components/{Avatar → client/Avatar}/utils.js +3 -2
- 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 +2 -7
- package/dist/components/client/IconButton.js +2 -7
- 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 +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
- 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 +7 -1
- package/dist/components/client/index.d.cts +6 -4
- package/dist/components/client/index.d.ts +6 -4
- package/dist/components/client/index.js +5 -2
- 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 +13 -16
- package/dist/components/index.d.cts +7 -9
- package/dist/components/index.d.ts +7 -9
- package/dist/components/index.js +8 -10
- 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/icons/dist/types.d.cts +30 -0
- package/dist/icons/dist/types.d.ts +30 -0
- package/dist/index.cjs +10 -12
- package/dist/index.d.cts +8 -10
- package/dist/index.d.ts +8 -10
- package/dist/index.js +8 -9
- 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 +10 -10
- package/dist/styles/styler.d.ts +10 -10
- package/dist/styles/stylerTypes.d.cts +1 -1
- package/dist/styles/stylerTypes.d.ts +1 -1
- package/dist/tailwind/dist/commands/generatePurgeCSSData.cjs +2 -6
- 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 +2 -5
- 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/{src → dist}/index.d.cts +23 -35
- package/dist/types/{src → dist}/index.d.ts +23 -35
- package/dist/uds/generated/componentData.cjs +622 -642
- package/dist/uds/generated/componentData.js +623 -637
- package/dist/uds/generated/tailwindPurge.cjs +104 -128
- package/dist/uds/generated/tailwindPurge.js +104 -128
- package/dist/utils/isElevationAlias.d.cts +1 -1
- package/dist/utils/isElevationAlias.d.ts +1 -1
- package/generated/componentData.json +774 -782
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +1 -1
- package/dist/components/Avatar/AvatarImage.types.cjs +0 -1
- package/dist/components/Avatar/AvatarImage.types.d.cts +0 -18
- package/dist/components/Avatar/AvatarImage.types.d.ts +0 -18
- package/dist/components/Avatar/AvatarImage.types.js +0 -1
- package/dist/components/Avatar/AvatarImageNoFallback.cjs +0 -51
- package/dist/components/Avatar/AvatarImageNoFallback.d.cts +0 -18
- package/dist/components/Avatar/AvatarImageNoFallback.d.ts +0 -18
- package/dist/components/Avatar/AvatarImageNoFallback.js +0 -49
- package/dist/components/Avatar/index.cjs +0 -10
- package/dist/components/Avatar/index.d.cts +0 -6
- package/dist/components/Avatar/index.d.ts +0 -6
- package/dist/components/Avatar/index.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ShadowPreset } from "../../types/
|
|
2
|
+
import { ShadowPreset } from "../../types/dist/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/dist/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/dist/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/dist/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,10 +14,6 @@ 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
|
-
};
|
|
21
17
|
require_cli.run([
|
|
22
18
|
require_cli_commands_version.versionCommand,
|
|
23
19
|
require_purge.makePurgeCommand(async () => {
|
|
@@ -56,42 +52,6 @@ require_cli.run([
|
|
|
56
52
|
componentData
|
|
57
53
|
};
|
|
58
54
|
}),
|
|
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
|
-
},
|
|
95
55
|
require_cli_commands_sync.syncCommand
|
|
96
56
|
]);
|
|
97
57
|
//#endregion
|
package/dist/cli/runner.js
CHANGED
|
@@ -13,10 +13,6 @@ 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
|
-
};
|
|
20
16
|
run([
|
|
21
17
|
versionCommand,
|
|
22
18
|
makePurgeCommand(async () => {
|
|
@@ -55,42 +51,6 @@ run([
|
|
|
55
51
|
componentData
|
|
56
52
|
};
|
|
57
53
|
}),
|
|
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
|
-
},
|
|
94
54
|
syncCommand
|
|
95
55
|
]);
|
|
96
56
|
//#endregion
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
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");
|
|
5
6
|
const require_components_IconSlot = require("../IconSlot.cjs");
|
|
6
7
|
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 react = require("react");
|
|
10
9
|
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
10
|
+
let react = require("react");
|
|
11
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
12
|
//#region src/components/Banner/Banner.tsx
|
|
13
13
|
const BASE_CLASS = "uds-banner";
|
|
@@ -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";
|
|
3
4
|
import { IconSlot } from "../IconSlot.js";
|
|
4
5
|
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 { cloneElement, forwardRef, isValidElement } from "react";
|
|
8
7
|
import { Cross } from "@yahoo/uds-icons";
|
|
8
|
+
import { cloneElement, forwardRef, isValidElement } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/Banner/Banner.tsx
|
|
11
11
|
const BASE_CLASS = "uds-banner";
|
package/dist/components/Box.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
4
4
|
const require_styles_styler = require("../../styles/styler.cjs");
|
|
5
|
-
const require_components_Box = require("../Box.cjs");
|
|
6
5
|
const require_components_Text = require("../Text.cjs");
|
|
6
|
+
const require_components_Box = require("../Box.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,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalDividerProps, UniversalStackProps } from "../../types/
|
|
3
|
-
import { Text } from "../Text.cjs";
|
|
2
|
+
import { UniversalDividerProps, UniversalStackProps } from "../../types/dist/index.cjs";
|
|
4
3
|
import { BoxProps } from "../Box.cjs";
|
|
4
|
+
import { Text } from "../Text.cjs";
|
|
5
5
|
import * as _$react from "react";
|
|
6
6
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalDividerProps, UniversalStackProps } from "../../types/
|
|
3
|
-
import { Text } from "../Text.js";
|
|
2
|
+
import { UniversalDividerProps, UniversalStackProps } from "../../types/dist/index.js";
|
|
4
3
|
import { BoxProps } from "../Box.js";
|
|
4
|
+
import { Text } from "../Text.js";
|
|
5
5
|
import * as _$react from "react";
|
|
6
6
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { cx } from "../../styles/styler.js";
|
|
3
|
-
import { Box } from "../Box.js";
|
|
4
3
|
import { Text } from "../Text.js";
|
|
4
|
+
import { Box } from "../Box.js";
|
|
5
5
|
import { HStack } from "../HStack.js";
|
|
6
6
|
import { VStack } from "../VStack.js";
|
|
7
7
|
import { forwardRef, useMemo } from "react";
|
package/dist/components/Icon.cjs
CHANGED
|
@@ -5,7 +5,6 @@ const require_styles_styler = require("../styles/styler.cjs");
|
|
|
5
5
|
const require_tokens_configs_sizes = require("../tokens/configs/sizes.cjs");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let _yahoo_uds_icons_utils = require("@yahoo/uds-icons/utils");
|
|
9
8
|
//#region src/components/Icon.tsx
|
|
10
9
|
/**
|
|
11
10
|
* **🎨 A component for displaying icons**
|
|
@@ -36,10 +35,8 @@ let _yahoo_uds_icons_utils = require("@yahoo/uds-icons/utils");
|
|
|
36
35
|
*
|
|
37
36
|
* @related [IconButton](https://uds.build/docs/components/icon-button)
|
|
38
37
|
*/
|
|
39
|
-
const Icon = (0, react.forwardRef)(function BaseIcon({ name:
|
|
40
|
-
const
|
|
41
|
-
const iconComponent = typeof iconName === "function" ? iconName : void 0;
|
|
42
|
-
const availableVariants = iconDefinition ? (0, _yahoo_uds_icons_utils.getIconVariants)(iconDefinition) : [];
|
|
38
|
+
const Icon = (0, react.forwardRef)(function BaseIcon({ name: SVGIcon, size = "md", variant = "outline", color = "primary", className, ...props }, ref) {
|
|
39
|
+
const availableVariants = SVGIcon.metadata?.variants ?? [];
|
|
43
40
|
const effectiveVariant = availableVariants.includes(variant) ? variant : availableVariants[0] ?? "fill";
|
|
44
41
|
const isMulticolor = effectiveVariant === "multicolor";
|
|
45
42
|
const styles = require_styles_styler.getStyles({
|
|
@@ -48,14 +45,6 @@ const Icon = (0, react.forwardRef)(function BaseIcon({ name: iconName, size = "m
|
|
|
48
45
|
className: require_styles_styler.cx(className, !isMulticolor && "[&_path]:fill-current")
|
|
49
46
|
});
|
|
50
47
|
const sizePx = require_tokens_configs_sizes.normalIconSizes[size];
|
|
51
|
-
const renderedMarkup = iconDefinition ? (0, _yahoo_uds_icons_utils.getIconMarkup)(iconDefinition, size, effectiveVariant) : null;
|
|
52
|
-
const renderedIcon = renderedMarkup ? null : (0, react.isValidElement)(iconName) ? (0, react.cloneElement)(iconName, {
|
|
53
|
-
size,
|
|
54
|
-
variant: effectiveVariant
|
|
55
|
-
}) : iconComponent ? iconComponent({
|
|
56
|
-
size,
|
|
57
|
-
variant: effectiveVariant
|
|
58
|
-
}) : null;
|
|
59
48
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
60
49
|
ref,
|
|
61
50
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -65,9 +54,11 @@ const Icon = (0, react.forwardRef)(function BaseIcon({ name: iconName, size = "m
|
|
|
65
54
|
"aria-hidden": "true",
|
|
66
55
|
focusable: "false",
|
|
67
56
|
className: styles,
|
|
68
|
-
dangerouslySetInnerHTML: renderedMarkup ? { __html: renderedMarkup } : void 0,
|
|
69
57
|
...props,
|
|
70
|
-
children:
|
|
58
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SVGIcon, {
|
|
59
|
+
size,
|
|
60
|
+
variant: effectiveVariant
|
|
61
|
+
})
|
|
71
62
|
});
|
|
72
63
|
});
|
|
73
64
|
Icon.displayName = "Icon";
|
package/dist/components/Icon.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { cx, getStyles } from "../styles/styler.js";
|
|
3
3
|
import { normalIconSizes } from "../tokens/configs/sizes.js";
|
|
4
|
-
import {
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { getIconMarkup, getIconVariants, isIconDefinition } from "@yahoo/uds-icons/utils";
|
|
7
6
|
//#region src/components/Icon.tsx
|
|
8
7
|
/**
|
|
9
8
|
* **🎨 A component for displaying icons**
|
|
@@ -34,10 +33,8 @@ import { getIconMarkup, getIconVariants, isIconDefinition } from "@yahoo/uds-ico
|
|
|
34
33
|
*
|
|
35
34
|
* @related [IconButton](https://uds.build/docs/components/icon-button)
|
|
36
35
|
*/
|
|
37
|
-
const Icon = forwardRef(function BaseIcon({ name:
|
|
38
|
-
const
|
|
39
|
-
const iconComponent = typeof iconName === "function" ? iconName : void 0;
|
|
40
|
-
const availableVariants = iconDefinition ? getIconVariants(iconDefinition) : [];
|
|
36
|
+
const Icon = forwardRef(function BaseIcon({ name: SVGIcon, size = "md", variant = "outline", color = "primary", className, ...props }, ref) {
|
|
37
|
+
const availableVariants = SVGIcon.metadata?.variants ?? [];
|
|
41
38
|
const effectiveVariant = availableVariants.includes(variant) ? variant : availableVariants[0] ?? "fill";
|
|
42
39
|
const isMulticolor = effectiveVariant === "multicolor";
|
|
43
40
|
const styles = getStyles({
|
|
@@ -46,14 +43,6 @@ const Icon = forwardRef(function BaseIcon({ name: iconName, size = "md", variant
|
|
|
46
43
|
className: cx(className, !isMulticolor && "[&_path]:fill-current")
|
|
47
44
|
});
|
|
48
45
|
const sizePx = normalIconSizes[size];
|
|
49
|
-
const renderedMarkup = iconDefinition ? getIconMarkup(iconDefinition, size, effectiveVariant) : null;
|
|
50
|
-
const renderedIcon = renderedMarkup ? null : isValidElement(iconName) ? cloneElement(iconName, {
|
|
51
|
-
size,
|
|
52
|
-
variant: effectiveVariant
|
|
53
|
-
}) : iconComponent ? iconComponent({
|
|
54
|
-
size,
|
|
55
|
-
variant: effectiveVariant
|
|
56
|
-
}) : null;
|
|
57
46
|
return /* @__PURE__ */ jsx("svg", {
|
|
58
47
|
ref,
|
|
59
48
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -63,9 +52,11 @@ const Icon = forwardRef(function BaseIcon({ name: iconName, size = "md", variant
|
|
|
63
52
|
"aria-hidden": "true",
|
|
64
53
|
focusable: "false",
|
|
65
54
|
className: styles,
|
|
66
|
-
dangerouslySetInnerHTML: renderedMarkup ? { __html: renderedMarkup } : void 0,
|
|
67
55
|
...props,
|
|
68
|
-
children:
|
|
56
|
+
children: /* @__PURE__ */ jsx(SVGIcon, {
|
|
57
|
+
size,
|
|
58
|
+
variant: effectiveVariant
|
|
59
|
+
})
|
|
69
60
|
});
|
|
70
61
|
});
|
|
71
62
|
Icon.displayName = "Icon";
|
|
@@ -6,11 +6,9 @@ const require_components_Icon = require("./Icon.cjs");
|
|
|
6
6
|
let react = require("react");
|
|
7
7
|
react = require_runtime.__toESM(react);
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
-
let
|
|
9
|
+
let lodash_isFunction_js = require("lodash/isFunction.js");
|
|
10
|
+
lodash_isFunction_js = require_runtime.__toESM(lodash_isFunction_js);
|
|
10
11
|
//#region src/components/IconSlot.tsx
|
|
11
|
-
function isIconRenderOutput(icon) {
|
|
12
|
-
return (0, react.isValidElement)(icon) && (icon.type === react.default.Fragment || typeof icon.type === "string");
|
|
13
|
-
}
|
|
14
12
|
/**
|
|
15
13
|
* A helper container to render a SvgIcon, Icon component, or ReactNode.
|
|
16
14
|
*
|
|
@@ -31,38 +29,21 @@ const IconSlot = (0, react.memo)(function IconSlot({ icon, iconProps, className:
|
|
|
31
29
|
if (!icon) return null;
|
|
32
30
|
const { className: iconPropsClassName, ...props } = iconProps || {};
|
|
33
31
|
const mergedClassName = require_styles_styler.cx(slotClassName, iconPropsClassName);
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
const svgIcon = icon;
|
|
33
|
+
if (svgIcon.metadata?.isSvgIcon) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
34
|
+
name: svgIcon,
|
|
36
35
|
...props,
|
|
37
36
|
...rest,
|
|
38
37
|
className: mergedClassName
|
|
39
38
|
});
|
|
40
|
-
if (
|
|
39
|
+
if ((0, lodash_isFunction_js.default)(icon)) {
|
|
41
40
|
const iconEl = icon(iconProps || {});
|
|
42
|
-
if ((0, _yahoo_uds_icons_utils.isIconDefinition)(iconEl)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
43
|
-
name: iconEl,
|
|
44
|
-
...props,
|
|
45
|
-
...rest,
|
|
46
|
-
className: mergedClassName
|
|
47
|
-
});
|
|
48
|
-
if (isIconRenderOutput(iconEl)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
49
|
-
name: icon,
|
|
50
|
-
...props,
|
|
51
|
-
...rest,
|
|
52
|
-
className: mergedClassName
|
|
53
|
-
});
|
|
54
41
|
const elProps = iconEl?.props;
|
|
55
42
|
return (0, react.isValidElement)(iconEl) && (0, react.cloneElement)(iconEl, {
|
|
56
43
|
...rest,
|
|
57
44
|
className: require_styles_styler.cx(mergedClassName, elProps?.className)
|
|
58
45
|
});
|
|
59
46
|
}
|
|
60
|
-
if (isIconRenderOutput(icon)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
61
|
-
name: ((svgIconProps) => (0, react.cloneElement)(icon, svgIconProps)),
|
|
62
|
-
...props,
|
|
63
|
-
...rest,
|
|
64
|
-
className: mergedClassName
|
|
65
|
-
});
|
|
66
47
|
const elProps = icon.props;
|
|
67
48
|
return (0, react.isValidElement)(icon) && (0, react.cloneElement)(icon, {
|
|
68
49
|
...props,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalIconSlot } from "../types/
|
|
2
|
+
import { UniversalIconSlot } from "../types/dist/index.cjs";
|
|
3
3
|
import { IconPropsWithSVGProps } from "../tokens/types.cjs";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import { IconDefinition } from "@yahoo/uds-icons/types";
|
|
6
5
|
|
|
7
6
|
//#region src/components/IconSlot.d.ts
|
|
8
7
|
interface IconSlotProps {
|
|
9
8
|
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that a ReactNode. */
|
|
10
|
-
icon?: UniversalIconSlot
|
|
9
|
+
icon?: UniversalIconSlot;
|
|
11
10
|
/** Props to spread onto the icon. */
|
|
12
11
|
iconProps?: Omit<IconPropsWithSVGProps, 'name'>;
|
|
13
12
|
className?: string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalIconSlot } from "../types/
|
|
2
|
+
import { UniversalIconSlot } from "../types/dist/index.js";
|
|
3
3
|
import { IconPropsWithSVGProps } from "../tokens/types.js";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import { IconDefinition } from "@yahoo/uds-icons/types";
|
|
6
5
|
|
|
7
6
|
//#region src/components/IconSlot.d.ts
|
|
8
7
|
interface IconSlotProps {
|
|
9
8
|
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that a ReactNode. */
|
|
10
|
-
icon?: UniversalIconSlot
|
|
9
|
+
icon?: UniversalIconSlot;
|
|
11
10
|
/** Props to spread onto the icon. */
|
|
12
11
|
iconProps?: Omit<IconPropsWithSVGProps, 'name'>;
|
|
13
12
|
className?: string;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
import { cx } from "../styles/styler.js";
|
|
3
3
|
import { Icon } from "./Icon.js";
|
|
4
|
-
import
|
|
4
|
+
import { cloneElement, isValidElement, memo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { isFunction } from "lodash-es";
|
|
7
7
|
//#region src/components/IconSlot.tsx
|
|
8
|
-
function isIconRenderOutput(icon) {
|
|
9
|
-
return isValidElement(icon) && (icon.type === React.Fragment || typeof icon.type === "string");
|
|
10
|
-
}
|
|
11
8
|
/**
|
|
12
9
|
* A helper container to render a SvgIcon, Icon component, or ReactNode.
|
|
13
10
|
*
|
|
@@ -28,38 +25,21 @@ const IconSlot = memo(function IconSlot({ icon, iconProps, className: slotClassN
|
|
|
28
25
|
if (!icon) return null;
|
|
29
26
|
const { className: iconPropsClassName, ...props } = iconProps || {};
|
|
30
27
|
const mergedClassName = cx(slotClassName, iconPropsClassName);
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const svgIcon = icon;
|
|
29
|
+
if (svgIcon.metadata?.isSvgIcon) return /* @__PURE__ */ jsx(Icon, {
|
|
30
|
+
name: svgIcon,
|
|
33
31
|
...props,
|
|
34
32
|
...rest,
|
|
35
33
|
className: mergedClassName
|
|
36
34
|
});
|
|
37
|
-
if (
|
|
35
|
+
if (isFunction(icon)) {
|
|
38
36
|
const iconEl = icon(iconProps || {});
|
|
39
|
-
if (isIconDefinition(iconEl)) return /* @__PURE__ */ jsx(Icon, {
|
|
40
|
-
name: iconEl,
|
|
41
|
-
...props,
|
|
42
|
-
...rest,
|
|
43
|
-
className: mergedClassName
|
|
44
|
-
});
|
|
45
|
-
if (isIconRenderOutput(iconEl)) return /* @__PURE__ */ jsx(Icon, {
|
|
46
|
-
name: icon,
|
|
47
|
-
...props,
|
|
48
|
-
...rest,
|
|
49
|
-
className: mergedClassName
|
|
50
|
-
});
|
|
51
37
|
const elProps = iconEl?.props;
|
|
52
38
|
return isValidElement(iconEl) && cloneElement(iconEl, {
|
|
53
39
|
...rest,
|
|
54
40
|
className: cx(mergedClassName, elProps?.className)
|
|
55
41
|
});
|
|
56
42
|
}
|
|
57
|
-
if (isIconRenderOutput(icon)) return /* @__PURE__ */ jsx(Icon, {
|
|
58
|
-
name: ((svgIconProps) => cloneElement(icon, svgIconProps)),
|
|
59
|
-
...props,
|
|
60
|
-
...rest,
|
|
61
|
-
className: mergedClassName
|
|
62
|
-
});
|
|
63
43
|
const elProps = icon.props;
|
|
64
44
|
return isValidElement(icon) && cloneElement(icon, {
|
|
65
45
|
...props,
|