@yahoo/uds 3.130.0 → 3.131.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/components/Banner/Banner.d.cts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- 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.d.cts +1 -1
- package/dist/components/Divider/DividerCore.d.ts +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 +25 -5
- 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/AvatarIcon.d.cts +1 -1
- package/dist/components/client/Avatar/AvatarIcon.d.ts +1 -1
- package/dist/components/client/Avatar/AvatarImage.d.cts +1 -1
- package/dist/components/client/Avatar/AvatarImage.d.ts +1 -1
- package/dist/components/client/Avatar/AvatarText.d.cts +1 -1
- package/dist/components/client/Avatar/AvatarText.d.ts +1 -1
- package/dist/components/client/Avatar/utils.d.cts +1 -1
- package/dist/components/client/Avatar/utils.d.ts +1 -1
- 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.d.cts +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.d.ts +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.d.cts +1 -1
- package/dist/components/client/Button.d.ts +1 -1
- package/dist/components/client/Checkbox.d.cts +1 -1
- package/dist/components/client/Checkbox.d.ts +1 -1
- 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.d.cts +1 -1
- package/dist/components/client/Chip/ChipDismissible.d.ts +1 -1
- 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 +6 -1
- package/dist/components/client/IconButton.js +6 -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/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.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.d.ts +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/Popover/Popover.d.cts +1 -1
- package/dist/components/client/Popover/Popover.d.ts +1 -1
- 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/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.d.cts +1 -1
- package/dist/components/client/Switch.d.ts +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.d.cts +1 -1
- package/dist/components/client/Toast/Toast.d.ts +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.d.cts +3 -2
- package/dist/components/client/Tooltip/TooltipContent.d.ts +3 -2
- 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.d.cts +1 -1
- package/dist/components/client/index.d.ts +1 -1
- 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.d.cts +1 -1
- package/dist/components/experimental/Table.d.ts +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/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- 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.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- 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/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 +47 -47
- package/dist/styles/styler.d.ts +47 -47
- package/dist/styles/stylerTypes.d.cts +1 -1
- package/dist/styles/stylerTypes.d.ts +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 +1334 -1334
- package/dist/uds/generated/componentData.js +1334 -1334
- package/dist/utils/isElevationAlias.d.cts +1 -1
- package/dist/utils/isElevationAlias.d.ts +1 -1
- package/generated/componentData.json +1600 -1602
- 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/components/Box.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalDividerProps, UniversalStackProps } from "../../types/
|
|
2
|
+
import { UniversalDividerProps, UniversalStackProps } from "../../types/src/index.cjs";
|
|
3
3
|
import "../../tokens/types.cjs";
|
|
4
4
|
import { BoxProps } from "../Box.cjs";
|
|
5
5
|
import * as react from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalDividerProps, UniversalStackProps } from "../../types/
|
|
2
|
+
import { UniversalDividerProps, UniversalStackProps } from "../../types/src/index.js";
|
|
3
3
|
import "../../tokens/types.js";
|
|
4
4
|
import { BoxProps } from "../Box.js";
|
|
5
5
|
import * as react from "react";
|
package/dist/components/Icon.cjs
CHANGED
|
@@ -5,6 +5,7 @@ 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");
|
|
8
9
|
|
|
9
10
|
//#region src/components/Icon.tsx
|
|
10
11
|
/**
|
|
@@ -36,8 +37,10 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
37
|
*
|
|
37
38
|
* @related [IconButton](https://uds.build/docs/components/icon-button)
|
|
38
39
|
*/
|
|
39
|
-
const Icon = (0, react.forwardRef)(function BaseIcon({ name:
|
|
40
|
-
const
|
|
40
|
+
const Icon = (0, react.forwardRef)(function BaseIcon({ name: iconName, size = "md", variant = "outline", color = "primary", className, ...props }, ref) {
|
|
41
|
+
const iconDefinition = (0, _yahoo_uds_icons_utils.isIconDefinition)(iconName) ? iconName : void 0;
|
|
42
|
+
const iconComponent = typeof iconName === "function" ? iconName : void 0;
|
|
43
|
+
const availableVariants = iconDefinition ? (0, _yahoo_uds_icons_utils.getIconVariants)(iconDefinition) : [];
|
|
41
44
|
const effectiveVariant = availableVariants.includes(variant) ? variant : availableVariants[0] ?? "fill";
|
|
42
45
|
const isMulticolor = effectiveVariant === "multicolor";
|
|
43
46
|
const styles = require_styles_styler.getStyles({
|
|
@@ -46,6 +49,14 @@ const Icon = (0, react.forwardRef)(function BaseIcon({ name: SVGIcon, size = "md
|
|
|
46
49
|
className: require_styles_styler.cx(className, !isMulticolor && "[&_path]:fill-current")
|
|
47
50
|
});
|
|
48
51
|
const sizePx = require_tokens_configs_sizes.normalIconSizes[size];
|
|
52
|
+
const renderedMarkup = iconDefinition ? (0, _yahoo_uds_icons_utils.getIconMarkup)(iconDefinition, size, effectiveVariant) : null;
|
|
53
|
+
const renderedIcon = renderedMarkup ? null : (0, react.isValidElement)(iconName) ? (0, react.cloneElement)(iconName, {
|
|
54
|
+
size,
|
|
55
|
+
variant: effectiveVariant
|
|
56
|
+
}) : iconComponent ? iconComponent({
|
|
57
|
+
size,
|
|
58
|
+
variant: effectiveVariant
|
|
59
|
+
}) : null;
|
|
49
60
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
50
61
|
ref,
|
|
51
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -55,11 +66,9 @@ const Icon = (0, react.forwardRef)(function BaseIcon({ name: SVGIcon, size = "md
|
|
|
55
66
|
"aria-hidden": "true",
|
|
56
67
|
focusable: "false",
|
|
57
68
|
className: styles,
|
|
69
|
+
dangerouslySetInnerHTML: renderedMarkup ? { __html: renderedMarkup } : void 0,
|
|
58
70
|
...props,
|
|
59
|
-
children:
|
|
60
|
-
size,
|
|
61
|
-
variant: effectiveVariant
|
|
62
|
-
})
|
|
71
|
+
children: renderedIcon
|
|
63
72
|
});
|
|
64
73
|
});
|
|
65
74
|
Icon.displayName = "Icon";
|
package/dist/components/Icon.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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 { forwardRef } from "react";
|
|
4
|
+
import { cloneElement, forwardRef, isValidElement } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { getIconMarkup, getIconVariants, isIconDefinition } from "@yahoo/uds-icons/utils";
|
|
6
7
|
|
|
7
8
|
//#region src/components/Icon.tsx
|
|
8
9
|
/**
|
|
@@ -34,8 +35,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
34
35
|
*
|
|
35
36
|
* @related [IconButton](https://uds.build/docs/components/icon-button)
|
|
36
37
|
*/
|
|
37
|
-
const Icon = forwardRef(function BaseIcon({ name:
|
|
38
|
-
const
|
|
38
|
+
const Icon = forwardRef(function BaseIcon({ name: iconName, size = "md", variant = "outline", color = "primary", className, ...props }, ref) {
|
|
39
|
+
const iconDefinition = isIconDefinition(iconName) ? iconName : void 0;
|
|
40
|
+
const iconComponent = typeof iconName === "function" ? iconName : void 0;
|
|
41
|
+
const availableVariants = iconDefinition ? getIconVariants(iconDefinition) : [];
|
|
39
42
|
const effectiveVariant = availableVariants.includes(variant) ? variant : availableVariants[0] ?? "fill";
|
|
40
43
|
const isMulticolor = effectiveVariant === "multicolor";
|
|
41
44
|
const styles = getStyles({
|
|
@@ -44,6 +47,14 @@ const Icon = forwardRef(function BaseIcon({ name: SVGIcon, size = "md", variant
|
|
|
44
47
|
className: cx(className, !isMulticolor && "[&_path]:fill-current")
|
|
45
48
|
});
|
|
46
49
|
const sizePx = normalIconSizes[size];
|
|
50
|
+
const renderedMarkup = iconDefinition ? getIconMarkup(iconDefinition, size, effectiveVariant) : null;
|
|
51
|
+
const renderedIcon = renderedMarkup ? null : isValidElement(iconName) ? cloneElement(iconName, {
|
|
52
|
+
size,
|
|
53
|
+
variant: effectiveVariant
|
|
54
|
+
}) : iconComponent ? iconComponent({
|
|
55
|
+
size,
|
|
56
|
+
variant: effectiveVariant
|
|
57
|
+
}) : null;
|
|
47
58
|
return /* @__PURE__ */ jsx("svg", {
|
|
48
59
|
ref,
|
|
49
60
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -53,11 +64,9 @@ const Icon = forwardRef(function BaseIcon({ name: SVGIcon, size = "md", variant
|
|
|
53
64
|
"aria-hidden": "true",
|
|
54
65
|
focusable: "false",
|
|
55
66
|
className: styles,
|
|
67
|
+
dangerouslySetInnerHTML: renderedMarkup ? { __html: renderedMarkup } : void 0,
|
|
56
68
|
...props,
|
|
57
|
-
children:
|
|
58
|
-
size,
|
|
59
|
-
variant: effectiveVariant
|
|
60
|
-
})
|
|
69
|
+
children: renderedIcon
|
|
61
70
|
});
|
|
62
71
|
});
|
|
63
72
|
Icon.displayName = "Icon";
|
|
@@ -6,10 +6,12 @@ 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
|
|
10
|
-
lodash_isFunction_js = require_runtime.__toESM(lodash_isFunction_js);
|
|
9
|
+
let _yahoo_uds_icons_utils = require("@yahoo/uds-icons/utils");
|
|
11
10
|
|
|
12
11
|
//#region src/components/IconSlot.tsx
|
|
12
|
+
function isIconRenderOutput(icon) {
|
|
13
|
+
return (0, react.isValidElement)(icon) && (icon.type === react.default.Fragment || typeof icon.type === "string");
|
|
14
|
+
}
|
|
13
15
|
/**
|
|
14
16
|
* A helper container to render a SvgIcon, Icon component, or ReactNode.
|
|
15
17
|
*
|
|
@@ -30,21 +32,38 @@ const IconSlot = (0, react.memo)(function IconSlot({ icon, iconProps, className:
|
|
|
30
32
|
if (!icon) return null;
|
|
31
33
|
const { className: iconPropsClassName, ...props } = iconProps || {};
|
|
32
34
|
const mergedClassName = require_styles_styler.cx(slotClassName, iconPropsClassName);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
name: svgIcon,
|
|
35
|
+
if ((0, _yahoo_uds_icons_utils.isIconDefinition)(icon)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
36
|
+
name: icon,
|
|
36
37
|
...props,
|
|
37
38
|
...rest,
|
|
38
39
|
className: mergedClassName
|
|
39
40
|
});
|
|
40
|
-
if (
|
|
41
|
+
if (typeof icon === "function") {
|
|
41
42
|
const iconEl = icon(iconProps || {});
|
|
43
|
+
if ((0, _yahoo_uds_icons_utils.isIconDefinition)(iconEl)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
44
|
+
name: iconEl,
|
|
45
|
+
...props,
|
|
46
|
+
...rest,
|
|
47
|
+
className: mergedClassName
|
|
48
|
+
});
|
|
49
|
+
if (isIconRenderOutput(iconEl)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
50
|
+
name: icon,
|
|
51
|
+
...props,
|
|
52
|
+
...rest,
|
|
53
|
+
className: mergedClassName
|
|
54
|
+
});
|
|
42
55
|
const elProps = iconEl?.props;
|
|
43
56
|
return (0, react.isValidElement)(iconEl) && (0, react.cloneElement)(iconEl, {
|
|
44
57
|
...rest,
|
|
45
58
|
className: require_styles_styler.cx(mergedClassName, elProps?.className)
|
|
46
59
|
});
|
|
47
60
|
}
|
|
61
|
+
if (isIconRenderOutput(icon)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
62
|
+
name: ((svgIconProps) => (0, react.cloneElement)(icon, svgIconProps)),
|
|
63
|
+
...props,
|
|
64
|
+
...rest,
|
|
65
|
+
className: mergedClassName
|
|
66
|
+
});
|
|
48
67
|
const elProps = icon.props;
|
|
49
68
|
return (0, react.isValidElement)(icon) && (0, react.cloneElement)(icon, {
|
|
50
69
|
...props,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalIconSlot } from "../types/
|
|
2
|
+
import { UniversalIconSlot } from "../types/src/index.cjs";
|
|
3
3
|
import { IconPropsWithSVGProps } from "../tokens/types.cjs";
|
|
4
4
|
import "../tokens/index.cjs";
|
|
5
5
|
import React from "react";
|
|
6
|
+
import { IconDefinition } from "@yahoo/uds-icons/types";
|
|
6
7
|
|
|
7
8
|
//#region src/components/IconSlot.d.ts
|
|
8
9
|
interface IconSlotProps {
|
|
9
10
|
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that a ReactNode. */
|
|
10
|
-
icon?: UniversalIconSlot
|
|
11
|
+
icon?: UniversalIconSlot<IconDefinition>;
|
|
11
12
|
/** Props to spread onto the icon. */
|
|
12
13
|
iconProps?: Omit<IconPropsWithSVGProps, 'name'>;
|
|
13
14
|
className?: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalIconSlot } from "../types/
|
|
2
|
+
import { UniversalIconSlot } from "../types/src/index.js";
|
|
3
3
|
import { IconPropsWithSVGProps } from "../tokens/types.js";
|
|
4
4
|
import "../tokens/index.js";
|
|
5
5
|
import React from "react";
|
|
6
|
+
import { IconDefinition } from "@yahoo/uds-icons/types";
|
|
6
7
|
|
|
7
8
|
//#region src/components/IconSlot.d.ts
|
|
8
9
|
interface IconSlotProps {
|
|
9
10
|
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that a ReactNode. */
|
|
10
|
-
icon?: UniversalIconSlot
|
|
11
|
+
icon?: UniversalIconSlot<IconDefinition>;
|
|
11
12
|
/** Props to spread onto the icon. */
|
|
12
13
|
iconProps?: Omit<IconPropsWithSVGProps, 'name'>;
|
|
13
14
|
className?: string;
|
|
@@ -3,9 +3,12 @@ import { cx } from "../styles/styler.js";
|
|
|
3
3
|
import { Icon } from "./Icon.js";
|
|
4
4
|
import React, { cloneElement, isValidElement, memo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { isIconDefinition } from "@yahoo/uds-icons/utils";
|
|
7
7
|
|
|
8
8
|
//#region src/components/IconSlot.tsx
|
|
9
|
+
function isIconRenderOutput(icon) {
|
|
10
|
+
return isValidElement(icon) && (icon.type === React.Fragment || typeof icon.type === "string");
|
|
11
|
+
}
|
|
9
12
|
/**
|
|
10
13
|
* A helper container to render a SvgIcon, Icon component, or ReactNode.
|
|
11
14
|
*
|
|
@@ -26,21 +29,38 @@ const IconSlot = memo(function IconSlot({ icon, iconProps, className: slotClassN
|
|
|
26
29
|
if (!icon) return null;
|
|
27
30
|
const { className: iconPropsClassName, ...props } = iconProps || {};
|
|
28
31
|
const mergedClassName = cx(slotClassName, iconPropsClassName);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
name: svgIcon,
|
|
32
|
+
if (isIconDefinition(icon)) return /* @__PURE__ */ jsx(Icon, {
|
|
33
|
+
name: icon,
|
|
32
34
|
...props,
|
|
33
35
|
...rest,
|
|
34
36
|
className: mergedClassName
|
|
35
37
|
});
|
|
36
|
-
if (
|
|
38
|
+
if (typeof icon === "function") {
|
|
37
39
|
const iconEl = icon(iconProps || {});
|
|
40
|
+
if (isIconDefinition(iconEl)) return /* @__PURE__ */ jsx(Icon, {
|
|
41
|
+
name: iconEl,
|
|
42
|
+
...props,
|
|
43
|
+
...rest,
|
|
44
|
+
className: mergedClassName
|
|
45
|
+
});
|
|
46
|
+
if (isIconRenderOutput(iconEl)) return /* @__PURE__ */ jsx(Icon, {
|
|
47
|
+
name: icon,
|
|
48
|
+
...props,
|
|
49
|
+
...rest,
|
|
50
|
+
className: mergedClassName
|
|
51
|
+
});
|
|
38
52
|
const elProps = iconEl?.props;
|
|
39
53
|
return isValidElement(iconEl) && cloneElement(iconEl, {
|
|
40
54
|
...rest,
|
|
41
55
|
className: cx(mergedClassName, elProps?.className)
|
|
42
56
|
});
|
|
43
57
|
}
|
|
58
|
+
if (isIconRenderOutput(icon)) return /* @__PURE__ */ jsx(Icon, {
|
|
59
|
+
name: ((svgIconProps) => cloneElement(icon, svgIconProps)),
|
|
60
|
+
...props,
|
|
61
|
+
...rest,
|
|
62
|
+
className: mergedClassName
|
|
63
|
+
});
|
|
44
64
|
const elProps = icon.props;
|
|
45
65
|
return isValidElement(icon) && cloneElement(icon, {
|
|
46
66
|
...props,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalAvatarIconProps } from "../../../types/
|
|
2
|
+
import { UniversalAvatarIconProps } from "../../../types/src/index.cjs";
|
|
3
3
|
import { IconPropsWithSVGProps } from "../../../tokens/types.cjs";
|
|
4
4
|
import "../../../tokens/index.cjs";
|
|
5
5
|
import * as react from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { UniversalAvatarIconProps } from "../../../types/
|
|
3
|
+
import { UniversalAvatarIconProps } from "../../../types/src/index.js";
|
|
4
4
|
import { IconPropsWithSVGProps } from "../../../tokens/types.js";
|
|
5
5
|
import "../../../tokens/index.js";
|
|
6
6
|
import * as react from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { ImagePropsWithImgProps } from "../../../types/
|
|
2
|
+
import { ImagePropsWithImgProps } from "../../../types/src/index.cjs";
|
|
3
3
|
import { UniversalAvatarImageProps } from "../../../tokens/types.cjs";
|
|
4
4
|
import "../../../tokens/index.cjs";
|
|
5
5
|
import { AvatarIconProps } from "./AvatarIcon.cjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { ImagePropsWithImgProps } from "../../../types/
|
|
3
|
+
import { ImagePropsWithImgProps } from "../../../types/src/index.js";
|
|
4
4
|
import { UniversalAvatarImageProps } from "../../../tokens/types.js";
|
|
5
5
|
import "../../../tokens/index.js";
|
|
6
6
|
import { AvatarIconProps } from "./AvatarIcon.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { UniversalAvatarTextProps } from "../../../types/
|
|
3
|
+
import { UniversalAvatarTextProps } from "../../../types/src/index.js";
|
|
4
4
|
import "../../../tokens/index.js";
|
|
5
5
|
import { TextProps } from "../../Text.js";
|
|
6
6
|
import * as react from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "../../../types/
|
|
2
|
+
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "../../../types/src/index.cjs";
|
|
3
3
|
import "../../../tokens/index.cjs";
|
|
4
4
|
import { getStyles } from "../../../styles/styler.cjs";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "../../../types/
|
|
3
|
+
import { AvatarAbbreviationStrategy, AvatarSize, AvatarVariant, UniversalAvatarProps } from "../../../types/src/index.js";
|
|
4
4
|
import "../../../tokens/index.js";
|
|
5
5
|
import { getStyles } from "../../../styles/styler.js";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalBottomSheetProps } from "../../../types/
|
|
2
|
+
import { UniversalBottomSheetProps } from "../../../types/src/index.cjs";
|
|
3
3
|
import { BottomSheetController } from "./useBottomSheetStore.cjs";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { UniversalBottomSheetProps } from "../../../types/
|
|
3
|
+
import { UniversalBottomSheetProps } from "../../../types/src/index.js";
|
|
4
4
|
import { BottomSheetController } from "./useBottomSheetStore.js";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalBottomSheetContentProps } from "../../../types/
|
|
2
|
+
import { UniversalBottomSheetContentProps } from "../../../types/src/index.cjs";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/client/BottomSheet/BottomSheetContent.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { UniversalBottomSheetContentProps } from "../../../types/
|
|
3
|
+
import { UniversalBottomSheetContentProps } from "../../../types/src/index.js";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/client/BottomSheet/BottomSheetContent.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
-
import { BottomSheetVariant } from "../../../types/
|
|
3
|
+
import { BottomSheetVariant } from "../../../types/src/index.js";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/client/BottomSheet/BottomSheetHandle.d.ts
|