@yahoo/uds 3.131.0-beta.2 → 3.131.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/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 +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 +5 -25
- 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 +1 -6
- package/dist/components/client/IconButton.js +1 -6
- 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 +2 -2
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +2 -2
- 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 +2 -3
- package/dist/components/client/Tooltip/TooltipContent.d.ts +2 -3
- 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/icons/dist/types.d.cts +30 -0
- package/dist/icons/dist/types.d.ts +30 -0
- 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 +66 -66
- package/dist/styles/styler.d.ts +66 -66
- package/dist/styles/stylerTypes.d.cts +1 -1
- package/dist/styles/stylerTypes.d.ts +1 -1
- 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 +1547 -1547
- package/dist/uds/generated/componentData.js +1547 -1547
- package/dist/uds/package.cjs +1 -1
- package/dist/uds/package.js +1 -1
- package/dist/utils/isElevationAlias.d.cts +1 -1
- package/dist/utils/isElevationAlias.d.ts +1 -1
- package/generated/componentData.json +2006 -2004
- package/package.json +2 -2
|
@@ -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/components/Box.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalDividerProps, UniversalStackProps } from "../../types/
|
|
2
|
+
import { UniversalDividerProps, UniversalStackProps } from "../../types/dist/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/dist/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,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
|
|
|
10
9
|
//#region src/components/Icon.tsx
|
|
11
10
|
/**
|
|
@@ -37,10 +36,8 @@ let _yahoo_uds_icons_utils = require("@yahoo/uds-icons/utils");
|
|
|
37
36
|
*
|
|
38
37
|
* @related [IconButton](https://uds.build/docs/components/icon-button)
|
|
39
38
|
*/
|
|
40
|
-
const Icon = (0, react.forwardRef)(function BaseIcon({ name:
|
|
41
|
-
const
|
|
42
|
-
const iconComponent = typeof iconName === "function" ? iconName : void 0;
|
|
43
|
-
const availableVariants = iconDefinition ? (0, _yahoo_uds_icons_utils.getIconVariants)(iconDefinition) : [];
|
|
39
|
+
const Icon = (0, react.forwardRef)(function BaseIcon({ name: SVGIcon, size = "md", variant = "outline", color = "primary", className, ...props }, ref) {
|
|
40
|
+
const availableVariants = SVGIcon.metadata?.variants ?? [];
|
|
44
41
|
const effectiveVariant = availableVariants.includes(variant) ? variant : availableVariants[0] ?? "fill";
|
|
45
42
|
const isMulticolor = effectiveVariant === "multicolor";
|
|
46
43
|
const styles = require_styles_styler.getStyles({
|
|
@@ -49,14 +46,6 @@ const Icon = (0, react.forwardRef)(function BaseIcon({ name: iconName, size = "m
|
|
|
49
46
|
className: require_styles_styler.cx(className, !isMulticolor && "[&_path]:fill-current")
|
|
50
47
|
});
|
|
51
48
|
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;
|
|
60
49
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
61
50
|
ref,
|
|
62
51
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -66,9 +55,11 @@ const Icon = (0, react.forwardRef)(function BaseIcon({ name: iconName, size = "m
|
|
|
66
55
|
"aria-hidden": "true",
|
|
67
56
|
focusable: "false",
|
|
68
57
|
className: styles,
|
|
69
|
-
dangerouslySetInnerHTML: renderedMarkup ? { __html: renderedMarkup } : void 0,
|
|
70
58
|
...props,
|
|
71
|
-
children:
|
|
59
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SVGIcon, {
|
|
60
|
+
size,
|
|
61
|
+
variant: effectiveVariant
|
|
62
|
+
})
|
|
72
63
|
});
|
|
73
64
|
});
|
|
74
65
|
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
|
|
|
8
7
|
//#region src/components/Icon.tsx
|
|
9
8
|
/**
|
|
@@ -35,10 +34,8 @@ import { getIconMarkup, getIconVariants, isIconDefinition } from "@yahoo/uds-ico
|
|
|
35
34
|
*
|
|
36
35
|
* @related [IconButton](https://uds.build/docs/components/icon-button)
|
|
37
36
|
*/
|
|
38
|
-
const Icon = forwardRef(function BaseIcon({ name:
|
|
39
|
-
const
|
|
40
|
-
const iconComponent = typeof iconName === "function" ? iconName : void 0;
|
|
41
|
-
const availableVariants = iconDefinition ? getIconVariants(iconDefinition) : [];
|
|
37
|
+
const Icon = forwardRef(function BaseIcon({ name: SVGIcon, size = "md", variant = "outline", color = "primary", className, ...props }, ref) {
|
|
38
|
+
const availableVariants = SVGIcon.metadata?.variants ?? [];
|
|
42
39
|
const effectiveVariant = availableVariants.includes(variant) ? variant : availableVariants[0] ?? "fill";
|
|
43
40
|
const isMulticolor = effectiveVariant === "multicolor";
|
|
44
41
|
const styles = getStyles({
|
|
@@ -47,14 +44,6 @@ const Icon = forwardRef(function BaseIcon({ name: iconName, size = "md", variant
|
|
|
47
44
|
className: cx(className, !isMulticolor && "[&_path]:fill-current")
|
|
48
45
|
});
|
|
49
46
|
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;
|
|
58
47
|
return /* @__PURE__ */ jsx("svg", {
|
|
59
48
|
ref,
|
|
60
49
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -64,9 +53,11 @@ const Icon = forwardRef(function BaseIcon({ name: iconName, size = "md", variant
|
|
|
64
53
|
"aria-hidden": "true",
|
|
65
54
|
focusable: "false",
|
|
66
55
|
className: styles,
|
|
67
|
-
dangerouslySetInnerHTML: renderedMarkup ? { __html: renderedMarkup } : void 0,
|
|
68
56
|
...props,
|
|
69
|
-
children:
|
|
57
|
+
children: /* @__PURE__ */ jsx(SVGIcon, {
|
|
58
|
+
size,
|
|
59
|
+
variant: effectiveVariant
|
|
60
|
+
})
|
|
70
61
|
});
|
|
71
62
|
});
|
|
72
63
|
Icon.displayName = "Icon";
|
|
@@ -6,12 +6,10 @@ 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
|
|
|
11
12
|
//#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
|
-
}
|
|
15
13
|
/**
|
|
16
14
|
* A helper container to render a SvgIcon, Icon component, or ReactNode.
|
|
17
15
|
*
|
|
@@ -32,38 +30,21 @@ const IconSlot = (0, react.memo)(function IconSlot({ icon, iconProps, className:
|
|
|
32
30
|
if (!icon) return null;
|
|
33
31
|
const { className: iconPropsClassName, ...props } = iconProps || {};
|
|
34
32
|
const mergedClassName = require_styles_styler.cx(slotClassName, iconPropsClassName);
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const svgIcon = icon;
|
|
34
|
+
if (svgIcon.metadata?.isSvgIcon) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
35
|
+
name: svgIcon,
|
|
37
36
|
...props,
|
|
38
37
|
...rest,
|
|
39
38
|
className: mergedClassName
|
|
40
39
|
});
|
|
41
|
-
if (
|
|
40
|
+
if ((0, lodash_isFunction_js.default)(icon)) {
|
|
42
41
|
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
|
-
});
|
|
55
42
|
const elProps = iconEl?.props;
|
|
56
43
|
return (0, react.isValidElement)(iconEl) && (0, react.cloneElement)(iconEl, {
|
|
57
44
|
...rest,
|
|
58
45
|
className: require_styles_styler.cx(mergedClassName, elProps?.className)
|
|
59
46
|
});
|
|
60
47
|
}
|
|
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
|
-
});
|
|
67
48
|
const elProps = icon.props;
|
|
68
49
|
return (0, react.isValidElement)(icon) && (0, react.cloneElement)(icon, {
|
|
69
50
|
...props,
|
|
@@ -1,14 +1,13 @@
|
|
|
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 "../tokens/index.cjs";
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { IconDefinition } from "@yahoo/uds-icons/types";
|
|
7
6
|
|
|
8
7
|
//#region src/components/IconSlot.d.ts
|
|
9
8
|
interface IconSlotProps {
|
|
10
9
|
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that a ReactNode. */
|
|
11
|
-
icon?: UniversalIconSlot
|
|
10
|
+
icon?: UniversalIconSlot;
|
|
12
11
|
/** Props to spread onto the icon. */
|
|
13
12
|
iconProps?: Omit<IconPropsWithSVGProps, 'name'>;
|
|
14
13
|
className?: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
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 "../tokens/index.js";
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { IconDefinition } from "@yahoo/uds-icons/types";
|
|
7
6
|
|
|
8
7
|
//#region src/components/IconSlot.d.ts
|
|
9
8
|
interface IconSlotProps {
|
|
10
9
|
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that a ReactNode. */
|
|
11
|
-
icon?: UniversalIconSlot
|
|
10
|
+
icon?: UniversalIconSlot;
|
|
12
11
|
/** Props to spread onto the icon. */
|
|
13
12
|
iconProps?: Omit<IconPropsWithSVGProps, 'name'>;
|
|
14
13
|
className?: string;
|
|
@@ -3,12 +3,9 @@ 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 { isFunction } from "lodash-es";
|
|
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
|
-
}
|
|
12
9
|
/**
|
|
13
10
|
* A helper container to render a SvgIcon, Icon component, or ReactNode.
|
|
14
11
|
*
|
|
@@ -29,38 +26,21 @@ const IconSlot = memo(function IconSlot({ icon, iconProps, className: slotClassN
|
|
|
29
26
|
if (!icon) return null;
|
|
30
27
|
const { className: iconPropsClassName, ...props } = iconProps || {};
|
|
31
28
|
const mergedClassName = cx(slotClassName, iconPropsClassName);
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const svgIcon = icon;
|
|
30
|
+
if (svgIcon.metadata?.isSvgIcon) return /* @__PURE__ */ jsx(Icon, {
|
|
31
|
+
name: svgIcon,
|
|
34
32
|
...props,
|
|
35
33
|
...rest,
|
|
36
34
|
className: mergedClassName
|
|
37
35
|
});
|
|
38
|
-
if (
|
|
36
|
+
if (isFunction(icon)) {
|
|
39
37
|
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
|
-
});
|
|
52
38
|
const elProps = iconEl?.props;
|
|
53
39
|
return isValidElement(iconEl) && cloneElement(iconEl, {
|
|
54
40
|
...rest,
|
|
55
41
|
className: cx(mergedClassName, elProps?.className)
|
|
56
42
|
});
|
|
57
43
|
}
|
|
58
|
-
if (isIconRenderOutput(icon)) return /* @__PURE__ */ jsx(Icon, {
|
|
59
|
-
name: ((svgIconProps) => cloneElement(icon, svgIconProps)),
|
|
60
|
-
...props,
|
|
61
|
-
...rest,
|
|
62
|
-
className: mergedClassName
|
|
63
|
-
});
|
|
64
44
|
const elProps = icon.props;
|
|
65
45
|
return isValidElement(icon) && cloneElement(icon, {
|
|
66
46
|
...props,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { UniversalAvatarIconProps } from "../../../types/
|
|
2
|
+
import { UniversalAvatarIconProps } from "../../../types/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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/dist/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
|