@yahoo/uds 3.166.0 → 3.168.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/generated/generatedConfigs.cjs +92 -46
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +46 -0
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +46 -0
- package/dist/automated-config/dist/generated/generatedConfigs.js +92 -46
- package/dist/automated-config/dist/types/ComponentConfig.d.cts +24 -1
- package/dist/automated-config/dist/types/ComponentConfig.d.ts +24 -1
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.cts +2 -2
- package/dist/automated-config/dist/utils/getConfigVariantProperties.d.ts +2 -2
- package/dist/automated-config/dist/utils/index.cjs +32 -3
- package/dist/automated-config/dist/utils/index.d.cts +9 -1
- package/dist/automated-config/dist/utils/index.d.ts +9 -1
- package/dist/automated-config/dist/utils/index.js +33 -4
- package/dist/cli/commands/sync.cjs +36 -0
- package/dist/cli/commands/sync.js +36 -0
- package/dist/components/IconSlot.cjs +29 -0
- package/dist/components/IconSlot.js +29 -0
- package/dist/components/client/Avatar/AvatarIcon.cjs +3 -0
- package/dist/components/client/Avatar/AvatarIcon.js +3 -0
- package/dist/components/client/Avatar/UDSAvatarConfigProvider.cjs +28 -0
- package/dist/components/client/Avatar/UDSAvatarConfigProvider.d.cts +29 -0
- package/dist/components/client/Avatar/UDSAvatarConfigProvider.d.ts +30 -0
- package/dist/components/client/Avatar/UDSAvatarConfigProvider.js +27 -0
- package/dist/components/client/Avatar/index.cjs +3 -0
- package/dist/components/client/Avatar/index.d.cts +2 -1
- package/dist/components/client/Avatar/index.d.ts +2 -1
- package/dist/components/client/Avatar/index.js +2 -1
- package/dist/components/client/Badge.cjs +4 -1
- package/dist/components/client/Badge.js +4 -1
- package/dist/components/client/Chip/ChipBase.cjs +4 -0
- package/dist/components/client/Chip/ChipBase.js +4 -0
- package/dist/components/client/Chip/UDSChipConfigProvider.cjs +28 -0
- package/dist/components/client/Chip/UDSChipConfigProvider.d.cts +29 -0
- package/dist/components/client/Chip/UDSChipConfigProvider.d.ts +30 -0
- package/dist/components/client/Chip/UDSChipConfigProvider.js +27 -0
- package/dist/components/client/Chip/index.cjs +3 -0
- package/dist/components/client/Chip/index.d.cts +2 -1
- package/dist/components/client/Chip/index.d.ts +2 -1
- package/dist/components/client/Chip/index.js +2 -1
- package/dist/components/client/Input/Input.cjs +10 -2
- package/dist/components/client/Input/Input.js +10 -2
- package/dist/components/client/Input/InputHelpTextInternal.cjs +6 -1
- package/dist/components/client/Input/InputHelpTextInternal.js +6 -1
- package/dist/components/client/Input/UDSInputConfigProvider.cjs +33 -0
- package/dist/components/client/Input/UDSInputConfigProvider.d.cts +32 -0
- package/dist/components/client/Input/UDSInputConfigProvider.d.ts +33 -0
- package/dist/components/client/Input/UDSInputConfigProvider.js +32 -0
- package/dist/components/client/Input/index.cjs +3 -0
- package/dist/components/client/Input/index.d.cts +2 -1
- package/dist/components/client/Input/index.d.ts +2 -1
- package/dist/components/client/Input/index.js +2 -1
- package/dist/components/client/Menu/Menu.ItemBase.cjs +4 -2
- package/dist/components/client/Menu/Menu.ItemBase.js +4 -2
- package/dist/components/client/Menu/UDSMenuItemConfigProvider.cjs +30 -0
- package/dist/components/client/Menu/UDSMenuItemConfigProvider.d.cts +29 -0
- package/dist/components/client/Menu/UDSMenuItemConfigProvider.d.ts +30 -0
- package/dist/components/client/Menu/UDSMenuItemConfigProvider.js +29 -0
- package/dist/components/client/Menu/index.cjs +3 -0
- package/dist/components/client/Menu/index.d.cts +2 -1
- package/dist/components/client/Menu/index.d.ts +2 -1
- package/dist/components/client/Menu/index.js +2 -1
- package/dist/components/client/PaddleNav/PaddleButton.cjs +3 -1
- package/dist/components/client/PaddleNav/PaddleButton.js +3 -1
- package/dist/components/client/PaddleNav/UDSPaddleNavConfigProvider.cjs +30 -0
- package/dist/components/client/PaddleNav/UDSPaddleNavConfigProvider.d.cts +29 -0
- package/dist/components/client/PaddleNav/UDSPaddleNavConfigProvider.d.ts +30 -0
- package/dist/components/client/PaddleNav/UDSPaddleNavConfigProvider.js +29 -0
- package/dist/components/client/PaddleNav/index.cjs +3 -0
- package/dist/components/client/PaddleNav/index.d.cts +3 -1
- package/dist/components/client/PaddleNav/index.d.ts +3 -1
- package/dist/components/client/PaddleNav/index.js +2 -1
- package/dist/components/client/Pagination/PaginationNext.cjs +3 -1
- package/dist/components/client/Pagination/PaginationNext.js +3 -1
- package/dist/components/client/Pagination/PaginationPrev.cjs +3 -1
- package/dist/components/client/Pagination/PaginationPrev.js +3 -1
- package/dist/components/client/Pagination/UDSPaginationConfigProvider.cjs +30 -0
- package/dist/components/client/Pagination/UDSPaginationConfigProvider.d.cts +29 -0
- package/dist/components/client/Pagination/UDSPaginationConfigProvider.d.ts +30 -0
- package/dist/components/client/Pagination/UDSPaginationConfigProvider.js +29 -0
- package/dist/components/client/Pagination/index.cjs +3 -0
- package/dist/components/client/Pagination/index.d.cts +2 -1
- package/dist/components/client/Pagination/index.d.ts +2 -1
- package/dist/components/client/Pagination/index.js +2 -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/Select/SelectItem.cjs +4 -2
- package/dist/components/client/Select/SelectItem.js +4 -2
- package/dist/components/client/Select/UDSSelectItemConfigProvider.cjs +30 -0
- package/dist/components/client/Select/UDSSelectItemConfigProvider.d.cts +29 -0
- package/dist/components/client/Select/UDSSelectItemConfigProvider.d.ts +30 -0
- package/dist/components/client/Select/UDSSelectItemConfigProvider.js +29 -0
- package/dist/components/client/Select/index.cjs +3 -0
- package/dist/components/client/Select/index.d.cts +3 -1
- package/dist/components/client/Select/index.d.ts +3 -1
- package/dist/components/client/Select/index.js +2 -1
- package/dist/components/client/Tabs/Tab.cjs +4 -2
- package/dist/components/client/Tabs/Tab.js +4 -2
- package/dist/components/client/Tabs/UDSTabConfigProvider.cjs +22 -0
- package/dist/components/client/Tabs/UDSTabConfigProvider.d.cts +27 -0
- package/dist/components/client/Tabs/UDSTabConfigProvider.d.ts +28 -0
- package/dist/components/client/Tabs/UDSTabConfigProvider.js +21 -0
- package/dist/components/client/Tabs/index.cjs +3 -0
- package/dist/components/client/Tabs/index.d.cts +3 -1
- package/dist/components/client/Tabs/index.d.ts +3 -1
- package/dist/components/client/Tabs/index.js +2 -1
- package/dist/components/client/UDSBadgeConfigProvider.cjs +28 -0
- package/dist/components/client/UDSBadgeConfigProvider.d.cts +29 -0
- package/dist/components/client/UDSBadgeConfigProvider.d.ts +30 -0
- package/dist/components/client/UDSBadgeConfigProvider.js +27 -0
- package/dist/components/client/index.cjs +27 -0
- package/dist/components/client/index.d.cts +10 -1
- package/dist/components/client/index.d.ts +10 -1
- package/dist/components/client/index.js +10 -1
- package/dist/components/client/providers/UDSConfigProvider.cjs +52 -16
- package/dist/components/client/providers/UDSConfigProvider.d.cts +9 -0
- package/dist/components/client/providers/UDSConfigProvider.d.ts +9 -0
- package/dist/components/client/providers/UDSConfigProvider.js +52 -16
- package/dist/components/client/providers/createUDSConfigProvider.cjs +41 -0
- package/dist/components/client/providers/createUDSConfigProvider.d.cts +38 -0
- package/dist/components/client/providers/createUDSConfigProvider.d.ts +39 -0
- package/dist/components/client/providers/createUDSConfigProvider.js +39 -0
- package/dist/components/index.cjs +27 -0
- package/dist/components/index.d.cts +10 -1
- package/dist/components/index.d.ts +10 -1
- package/dist/components/index.js +10 -1
- package/dist/css/dist/css/utils.cjs +58 -0
- package/dist/css/dist/css/utils.js +58 -0
- package/dist/css/dist/runtimeConfig/hookMetadata.cjs +320 -0
- package/dist/css/dist/runtimeConfig/hookMetadata.js +320 -0
- package/dist/css-tokens/dist/index.cjs +26 -0
- package/dist/css-tokens/dist/index.d.cts +25 -1
- package/dist/css-tokens/dist/index.d.ts +25 -1
- package/dist/css-tokens/dist/index.js +25 -1
- package/dist/index.cjs +47 -0
- package/dist/index.d.cts +21 -3
- package/dist/index.d.ts +21 -3
- package/dist/index.js +20 -2
- package/dist/runtime/avatarConfig.cjs +21 -0
- package/dist/runtime/avatarConfig.d.cts +13 -0
- package/dist/runtime/avatarConfig.d.ts +13 -0
- package/dist/runtime/avatarConfig.js +20 -0
- package/dist/runtime/badgeConfig.cjs +17 -0
- package/dist/runtime/badgeConfig.d.cts +13 -0
- package/dist/runtime/badgeConfig.d.ts +13 -0
- package/dist/runtime/badgeConfig.js +16 -0
- package/dist/runtime/chipConfig.cjs +12 -0
- package/dist/runtime/chipConfig.d.cts +13 -0
- package/dist/runtime/chipConfig.d.ts +13 -0
- package/dist/runtime/chipConfig.js +11 -0
- package/dist/runtime/index.cjs +18 -0
- package/dist/runtime/index.d.cts +10 -1
- package/dist/runtime/index.d.ts +10 -1
- package/dist/runtime/index.js +10 -1
- package/dist/runtime/inputConfig.cjs +14 -0
- package/dist/runtime/inputConfig.d.cts +15 -0
- package/dist/runtime/inputConfig.d.ts +15 -0
- package/dist/runtime/inputConfig.js +13 -0
- package/dist/runtime/menuItemConfig.cjs +13 -0
- package/dist/runtime/menuItemConfig.d.cts +15 -0
- package/dist/runtime/menuItemConfig.d.ts +15 -0
- package/dist/runtime/menuItemConfig.js +12 -0
- package/dist/runtime/paddleNavConfig.cjs +18 -0
- package/dist/runtime/paddleNavConfig.d.cts +13 -0
- package/dist/runtime/paddleNavConfig.d.ts +13 -0
- package/dist/runtime/paddleNavConfig.js +17 -0
- package/dist/runtime/paginationConfig.cjs +12 -0
- package/dist/runtime/paginationConfig.d.cts +13 -0
- package/dist/runtime/paginationConfig.d.ts +13 -0
- package/dist/runtime/paginationConfig.js +11 -0
- package/dist/runtime/selectItemConfig.cjs +13 -0
- package/dist/runtime/selectItemConfig.d.cts +15 -0
- package/dist/runtime/selectItemConfig.d.ts +15 -0
- package/dist/runtime/selectItemConfig.js +12 -0
- package/dist/runtime/tabConfig.cjs +12 -0
- package/dist/runtime/tabConfig.d.cts +14 -0
- package/dist/runtime/tabConfig.d.ts +14 -0
- package/dist/runtime/tabConfig.js +11 -0
- package/dist/runtime/udsConfig.cjs +18 -0
- package/dist/runtime/udsConfig.d.cts +18 -0
- package/dist/runtime/udsConfig.d.ts +18 -0
- package/dist/runtime/udsConfig.js +18 -0
- package/dist/styles/styler.d.cts +9 -9
- package/dist/styles/styler.d.ts +9 -9
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.cjs +92 -46
- package/dist/tailwind-internal/dist/packages/automated-config/dist/generated/generatedConfigs.js +92 -46
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.cjs +32 -3
- package/dist/tailwind-internal/dist/packages/automated-config/dist/utils/index.js +33 -4
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.cjs +26 -0
- package/dist/tailwind-internal/dist/packages/css-tokens/dist/index.js +25 -1
- package/dist/tokens/consts/cssTokens.cjs +2 -0
- package/dist/tokens/consts/cssTokens.d.cts +2 -2
- package/dist/tokens/consts/cssTokens.d.ts +2 -2
- package/dist/tokens/consts/cssTokens.js +2 -2
- package/dist/tokens/index.cjs +2 -0
- package/dist/tokens/index.d.cts +3 -3
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.js +2 -2
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/uds/generated/componentData.cjs +2544 -2427
- package/dist/uds/generated/componentData.js +2544 -2427
- package/dist/uds/generated/tailwindPurge.cjs +40 -3
- package/dist/uds/generated/tailwindPurge.js +40 -3
- package/dist/uds/package.cjs +2 -2
- package/dist/uds/package.js +2 -2
- package/generated/componentData.json +2915 -2748
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +3 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { AvatarSize, IconSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSAvatarConfigContextType } from "../../../runtime/avatarConfig.cjs";
|
|
4
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Avatar/UDSAvatarConfigProvider.d.ts
|
|
8
|
+
declare const UDSAvatarConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSAvatarConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSAvatarConfigProviderProps = UDSConfigProviderProps<UDSAvatarConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured icon size for an Avatar size.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Avatar
|
|
20
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
21
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
22
|
+
* config is present — preserving the previous rendering exactly.
|
|
23
|
+
*/
|
|
24
|
+
declare const useAvatarConfig: (sizeProp?: AvatarSize | undefined) => {
|
|
25
|
+
size: AvatarSize | undefined;
|
|
26
|
+
iconSize: IconSize | undefined;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { type UDSAvatarConfigContextType, UDSAvatarConfigProvider, type UDSAvatarConfigProviderProps, useAvatarConfig };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { AvatarSize, IconSize } from "../../../types/dist/index.js";
|
|
4
|
+
import { UDSAvatarConfigContextType } from "../../../runtime/avatarConfig.js";
|
|
5
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Avatar/UDSAvatarConfigProvider.d.ts
|
|
9
|
+
declare const UDSAvatarConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSAvatarConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSAvatarConfigProviderProps = UDSConfigProviderProps<UDSAvatarConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured icon size for an Avatar size.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Avatar
|
|
21
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
22
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
23
|
+
* config is present — preserving the previous rendering exactly.
|
|
24
|
+
*/
|
|
25
|
+
declare const useAvatarConfig: (sizeProp?: AvatarSize | undefined) => {
|
|
26
|
+
size: AvatarSize | undefined;
|
|
27
|
+
iconSize: IconSize | undefined;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type UDSAvatarConfigContextType, UDSAvatarConfigProvider, type UDSAvatarConfigProviderProps, useAvatarConfig };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { createUDSConfigProvider } from "../providers/createUDSConfigProvider.js";
|
|
4
|
+
//#region src/components/client/Avatar/UDSAvatarConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSAvatarConfigProvider, useConfigContext } = createUDSConfigProvider("Avatar");
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the configured icon size for an Avatar size.
|
|
8
|
+
*
|
|
9
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Avatar
|
|
10
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
11
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
12
|
+
* config is present — preserving the previous rendering exactly.
|
|
13
|
+
*/
|
|
14
|
+
const useAvatarConfig = (sizeProp) => {
|
|
15
|
+
const context = useConfigContext();
|
|
16
|
+
if (!context) return {
|
|
17
|
+
size: sizeProp,
|
|
18
|
+
iconSize: void 0
|
|
19
|
+
};
|
|
20
|
+
const size = sizeProp ?? context.defaultSize;
|
|
21
|
+
return {
|
|
22
|
+
size,
|
|
23
|
+
iconSize: context.iconSize[size]
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { UDSAvatarConfigProvider, useAvatarConfig };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_components_client_Avatar_UDSAvatarConfigProvider = require("./UDSAvatarConfigProvider.cjs");
|
|
4
5
|
const require_components_client_Avatar_AvatarIcon = require("./AvatarIcon.cjs");
|
|
5
6
|
const require_components_client_Avatar_AvatarText = require("./AvatarText.cjs");
|
|
6
7
|
const require_components_client_Avatar_AvatarImage = require("./AvatarImage.cjs");
|
|
@@ -9,3 +10,5 @@ exports.Avatar = require_components_client_Avatar_Avatar.Avatar;
|
|
|
9
10
|
exports.AvatarIcon = require_components_client_Avatar_AvatarIcon.AvatarIcon;
|
|
10
11
|
exports.AvatarImage = require_components_client_Avatar_AvatarImage.AvatarImage;
|
|
11
12
|
exports.AvatarText = require_components_client_Avatar_AvatarText.AvatarText;
|
|
13
|
+
exports.UDSAvatarConfigProvider = require_components_client_Avatar_UDSAvatarConfigProvider.UDSAvatarConfigProvider;
|
|
14
|
+
exports.useAvatarConfig = require_components_client_Avatar_UDSAvatarConfigProvider.useAvatarConfig;
|
|
@@ -3,4 +3,5 @@ import { AvatarIcon, AvatarIconProps } from "./AvatarIcon.cjs";
|
|
|
3
3
|
import { AvatarText, AvatarTextProps } from "./AvatarText.cjs";
|
|
4
4
|
import { AvatarImage, AvatarImageProps } from "./AvatarImage.cjs";
|
|
5
5
|
import { Avatar, AvatarProps } from "./Avatar.cjs";
|
|
6
|
-
|
|
6
|
+
import { UDSAvatarConfigProvider, UDSAvatarConfigProviderProps, useAvatarConfig } from "./UDSAvatarConfigProvider.cjs";
|
|
7
|
+
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps, UDSAvatarConfigProvider, type UDSAvatarConfigProviderProps, useAvatarConfig };
|
|
@@ -4,4 +4,5 @@ import { AvatarIcon, AvatarIconProps } from "./AvatarIcon.js";
|
|
|
4
4
|
import { AvatarText, AvatarTextProps } from "./AvatarText.js";
|
|
5
5
|
import { AvatarImage, AvatarImageProps } from "./AvatarImage.js";
|
|
6
6
|
import { Avatar, AvatarProps } from "./Avatar.js";
|
|
7
|
-
|
|
7
|
+
import { UDSAvatarConfigProvider, UDSAvatarConfigProviderProps, useAvatarConfig } from "./UDSAvatarConfigProvider.js";
|
|
8
|
+
export { Avatar, AvatarIcon, type AvatarIconProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarText, type AvatarTextProps, UDSAvatarConfigProvider, type UDSAvatarConfigProviderProps, useAvatarConfig };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
+
import { UDSAvatarConfigProvider, useAvatarConfig } from "./UDSAvatarConfigProvider.js";
|
|
3
4
|
import { AvatarIcon } from "./AvatarIcon.js";
|
|
4
5
|
import { AvatarText } from "./AvatarText.js";
|
|
5
6
|
import { AvatarImage } from "./AvatarImage.js";
|
|
6
7
|
import { Avatar } from "./Avatar.js";
|
|
7
|
-
export { Avatar, AvatarIcon, AvatarImage, AvatarText };
|
|
8
|
+
export { Avatar, AvatarIcon, AvatarImage, AvatarText, UDSAvatarConfigProvider, useAvatarConfig };
|
|
@@ -5,6 +5,7 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
|
5
5
|
const require_styles_styler = require("../../styles/styler.cjs");
|
|
6
6
|
const require_components_IconSlot = require("../IconSlot.cjs");
|
|
7
7
|
const require_components_HStack = require("../HStack.cjs");
|
|
8
|
+
const require_components_client_UDSBadgeConfigProvider = require("./UDSBadgeConfigProvider.cjs");
|
|
8
9
|
let react = require("react");
|
|
9
10
|
react = require_runtime.__toESM(react);
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -43,6 +44,7 @@ const Badge = (0, react.forwardRef)(function Badge({ variant = "primary", size =
|
|
|
43
44
|
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
44
45
|
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
45
46
|
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
47
|
+
const { iconSize } = require_components_client_UDSBadgeConfigProvider.useBadgeConfig(size);
|
|
46
48
|
const rootStyles = require_styles_styler.getStyles({
|
|
47
49
|
badgeSizeRoot: size,
|
|
48
50
|
badgeVariantRoot: variant,
|
|
@@ -73,8 +75,9 @@ const Badge = (0, react.forwardRef)(function Badge({ variant = "primary", size =
|
|
|
73
75
|
]);
|
|
74
76
|
const iconProps = (0, react.useMemo)(() => ({
|
|
75
77
|
variant: "fill",
|
|
78
|
+
size: iconSize,
|
|
76
79
|
style: { ...iconColor ? { color: iconColor } : {} }
|
|
77
|
-
}), [iconColor]);
|
|
80
|
+
}), [iconColor, iconSize]);
|
|
78
81
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_HStack.HStack, {
|
|
79
82
|
ref,
|
|
80
83
|
gap: "2",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { cx, getStyles } from "../../styles/styler.js";
|
|
4
4
|
import { IconSlot } from "../IconSlot.js";
|
|
5
5
|
import { HStack } from "../HStack.js";
|
|
6
|
+
import { useBadgeConfig } from "./UDSBadgeConfigProvider.js";
|
|
6
7
|
import { forwardRef, useMemo } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/client/Badge.tsx
|
|
@@ -40,6 +41,7 @@ const Badge = forwardRef(function Badge({ variant = "primary", size = "md", minW
|
|
|
40
41
|
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
41
42
|
const { className: endIconClassName, ...endIconSlotProps } = slotProps?.endIcon ?? {};
|
|
42
43
|
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
44
|
+
const { iconSize } = useBadgeConfig(size);
|
|
43
45
|
const rootStyles = getStyles({
|
|
44
46
|
badgeSizeRoot: size,
|
|
45
47
|
badgeVariantRoot: variant,
|
|
@@ -70,8 +72,9 @@ const Badge = forwardRef(function Badge({ variant = "primary", size = "md", minW
|
|
|
70
72
|
]);
|
|
71
73
|
const iconProps = useMemo(() => ({
|
|
72
74
|
variant: "fill",
|
|
75
|
+
size: iconSize,
|
|
73
76
|
style: { ...iconColor ? { color: iconColor } : {} }
|
|
74
|
-
}), [iconColor]);
|
|
77
|
+
}), [iconColor, iconSize]);
|
|
75
78
|
return /* @__PURE__ */ jsxs(HStack, {
|
|
76
79
|
ref,
|
|
77
80
|
gap: "2",
|
|
@@ -7,6 +7,7 @@ const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
|
7
7
|
const require_components_Text = require("../../Text.cjs");
|
|
8
8
|
const require_components_HStack = require("../../HStack.cjs");
|
|
9
9
|
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
10
|
+
const require_components_client_Chip_UDSChipConfigProvider = require("./UDSChipConfigProvider.cjs");
|
|
10
11
|
let react = require("react");
|
|
11
12
|
react = require_runtime.__toESM(react);
|
|
12
13
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -16,6 +17,7 @@ const VARIANT_DEFAULT = "primary";
|
|
|
16
17
|
const MAX_WIDTH_DEFAULT = 200;
|
|
17
18
|
const ChipBase = (0, react.forwardRef)(function ChipBase({ size = SIZE_DEFAULT, minWidth, maxWidth = MAX_WIDTH_DEFAULT, startIcon, endIcon, as: As = "div", reduceMotion: forceReduceMotion, disabled = false, className, slotProps, children, ...rest }, ref) {
|
|
18
19
|
const cssAnimationDuration = require_hooks_usePrefersReducedMotion.usePrefersReducedMotion() || forceReduceMotion ? "duration-0" : "duration-120";
|
|
20
|
+
const { iconSize } = require_components_client_Chip_UDSChipConfigProvider.useChipConfig(size);
|
|
19
21
|
const { className: textClassName, ...textProps } = slotProps?.text ?? {};
|
|
20
22
|
const { className: startIconClassName, ...startIconProps } = slotProps?.startIcon ?? {};
|
|
21
23
|
const { className: endIconClassName, ...endIconProps } = slotProps?.endIcon ?? {};
|
|
@@ -57,6 +59,7 @@ const ChipBase = (0, react.forwardRef)(function ChipBase({ size = SIZE_DEFAULT,
|
|
|
57
59
|
icon: startIcon,
|
|
58
60
|
iconProps: {
|
|
59
61
|
variant: "fill",
|
|
62
|
+
size: iconSize,
|
|
60
63
|
className: require_styles_styler.cx(classNames.icon, startIconClassName),
|
|
61
64
|
...startIconProps
|
|
62
65
|
}
|
|
@@ -73,6 +76,7 @@ const ChipBase = (0, react.forwardRef)(function ChipBase({ size = SIZE_DEFAULT,
|
|
|
73
76
|
icon: endIcon,
|
|
74
77
|
iconProps: {
|
|
75
78
|
variant: "fill",
|
|
79
|
+
size: iconSize,
|
|
76
80
|
className: require_styles_styler.cx(classNames.icon, endIconClassName),
|
|
77
81
|
...endIconProps
|
|
78
82
|
}
|
|
@@ -5,6 +5,7 @@ import { IconSlot } from "../../IconSlot.js";
|
|
|
5
5
|
import { Text } from "../../Text.js";
|
|
6
6
|
import { HStack } from "../../HStack.js";
|
|
7
7
|
import { usePrefersReducedMotion } from "../../../hooks/usePrefersReducedMotion.js";
|
|
8
|
+
import { useChipConfig } from "./UDSChipConfigProvider.js";
|
|
8
9
|
import { forwardRef, useMemo } from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/client/Chip/ChipBase.tsx
|
|
@@ -13,6 +14,7 @@ const VARIANT_DEFAULT = "primary";
|
|
|
13
14
|
const MAX_WIDTH_DEFAULT = 200;
|
|
14
15
|
const ChipBase = forwardRef(function ChipBase({ size = SIZE_DEFAULT, minWidth, maxWidth = MAX_WIDTH_DEFAULT, startIcon, endIcon, as: As = "div", reduceMotion: forceReduceMotion, disabled = false, className, slotProps, children, ...rest }, ref) {
|
|
15
16
|
const cssAnimationDuration = usePrefersReducedMotion() || forceReduceMotion ? "duration-0" : "duration-120";
|
|
17
|
+
const { iconSize } = useChipConfig(size);
|
|
16
18
|
const { className: textClassName, ...textProps } = slotProps?.text ?? {};
|
|
17
19
|
const { className: startIconClassName, ...startIconProps } = slotProps?.startIcon ?? {};
|
|
18
20
|
const { className: endIconClassName, ...endIconProps } = slotProps?.endIcon ?? {};
|
|
@@ -54,6 +56,7 @@ const ChipBase = forwardRef(function ChipBase({ size = SIZE_DEFAULT, minWidth, m
|
|
|
54
56
|
icon: startIcon,
|
|
55
57
|
iconProps: {
|
|
56
58
|
variant: "fill",
|
|
59
|
+
size: iconSize,
|
|
57
60
|
className: cx(classNames.icon, startIconClassName),
|
|
58
61
|
...startIconProps
|
|
59
62
|
}
|
|
@@ -70,6 +73,7 @@ const ChipBase = forwardRef(function ChipBase({ size = SIZE_DEFAULT, minWidth, m
|
|
|
70
73
|
icon: endIcon,
|
|
71
74
|
iconProps: {
|
|
72
75
|
variant: "fill",
|
|
76
|
+
size: iconSize,
|
|
73
77
|
className: cx(classNames.icon, endIconClassName),
|
|
74
78
|
...endIconProps
|
|
75
79
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
//#region src/components/client/Chip/UDSChipConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSChipConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("Chip");
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the configured icon size for a Chip size.
|
|
8
|
+
*
|
|
9
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Chip
|
|
10
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
11
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
12
|
+
* config is present — preserving the previous rendering exactly.
|
|
13
|
+
*/
|
|
14
|
+
const useChipConfig = (sizeProp) => {
|
|
15
|
+
const context = useConfigContext();
|
|
16
|
+
if (!context) return {
|
|
17
|
+
size: sizeProp,
|
|
18
|
+
iconSize: void 0
|
|
19
|
+
};
|
|
20
|
+
const size = sizeProp ?? context.defaultSize;
|
|
21
|
+
return {
|
|
22
|
+
size,
|
|
23
|
+
iconSize: context.iconSize[size]
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
exports.UDSChipConfigProvider = UDSChipConfigProvider;
|
|
28
|
+
exports.useChipConfig = useChipConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { ChipSize, IconSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
4
|
+
import { UDSChipConfigContextType } from "../../../runtime/chipConfig.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Chip/UDSChipConfigProvider.d.ts
|
|
8
|
+
declare const UDSChipConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSChipConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSChipConfigProviderProps = UDSConfigProviderProps<UDSChipConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured icon size for a Chip size.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Chip
|
|
20
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
21
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
22
|
+
* config is present — preserving the previous rendering exactly.
|
|
23
|
+
*/
|
|
24
|
+
declare const useChipConfig: (sizeProp?: ChipSize | undefined) => {
|
|
25
|
+
size: ChipSize | undefined;
|
|
26
|
+
iconSize: IconSize | undefined;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { type UDSChipConfigContextType, UDSChipConfigProvider, type UDSChipConfigProviderProps, useChipConfig };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { ChipSize, IconSize } from "../../../types/dist/index.js";
|
|
4
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.js";
|
|
5
|
+
import { UDSChipConfigContextType } from "../../../runtime/chipConfig.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Chip/UDSChipConfigProvider.d.ts
|
|
9
|
+
declare const UDSChipConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSChipConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSChipConfigProviderProps = UDSConfigProviderProps<UDSChipConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured icon size for a Chip size.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Chip
|
|
21
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
22
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
23
|
+
* config is present — preserving the previous rendering exactly.
|
|
24
|
+
*/
|
|
25
|
+
declare const useChipConfig: (sizeProp?: ChipSize | undefined) => {
|
|
26
|
+
size: ChipSize | undefined;
|
|
27
|
+
iconSize: IconSize | undefined;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type UDSChipConfigContextType, UDSChipConfigProvider, type UDSChipConfigProviderProps, useChipConfig };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { createUDSConfigProvider } from "../providers/createUDSConfigProvider.js";
|
|
4
|
+
//#region src/components/client/Chip/UDSChipConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSChipConfigProvider, useConfigContext } = createUDSConfigProvider("Chip");
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the configured icon size for a Chip size.
|
|
8
|
+
*
|
|
9
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Chip
|
|
10
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
11
|
+
* back to `undefined` (letting `Icon` apply its own default size) when no
|
|
12
|
+
* config is present — preserving the previous rendering exactly.
|
|
13
|
+
*/
|
|
14
|
+
const useChipConfig = (sizeProp) => {
|
|
15
|
+
const context = useConfigContext();
|
|
16
|
+
if (!context) return {
|
|
17
|
+
size: sizeProp,
|
|
18
|
+
iconSize: void 0
|
|
19
|
+
};
|
|
20
|
+
const size = sizeProp ?? context.defaultSize;
|
|
21
|
+
return {
|
|
22
|
+
size,
|
|
23
|
+
iconSize: context.iconSize[size]
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { UDSChipConfigProvider, useChipConfig };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_components_client_Chip_UDSChipConfigProvider = require("./UDSChipConfigProvider.cjs");
|
|
4
5
|
const require_components_client_Chip_ChipButton = require("./ChipButton.cjs");
|
|
5
6
|
const require_components_client_Chip_ChipDismissible = require("./ChipDismissible.cjs");
|
|
6
7
|
const require_components_client_Chip_ChipLink = require("./ChipLink.cjs");
|
|
@@ -11,3 +12,5 @@ exports.ChipButton = require_components_client_Chip_ChipButton.ChipButton;
|
|
|
11
12
|
exports.ChipDismissible = require_components_client_Chip_ChipDismissible.ChipDismissible;
|
|
12
13
|
exports.ChipLink = require_components_client_Chip_ChipLink.ChipLink;
|
|
13
14
|
exports.ChipToggle = require_components_client_Chip_ChipToggle.ChipToggle;
|
|
15
|
+
exports.UDSChipConfigProvider = require_components_client_Chip_UDSChipConfigProvider.UDSChipConfigProvider;
|
|
16
|
+
exports.useChipConfig = require_components_client_Chip_UDSChipConfigProvider.useChipConfig;
|
|
@@ -4,4 +4,5 @@ import { ChipButton, ChipButtonProps } from "./ChipButton.cjs";
|
|
|
4
4
|
import { ChipDismissible, ChipDismissibleProps } from "./ChipDismissible.cjs";
|
|
5
5
|
import { ChipLink, ChipLinkProps } from "./ChipLink.cjs";
|
|
6
6
|
import { ChipToggle, ChipToggleProps } from "./ChipToggle.cjs";
|
|
7
|
-
|
|
7
|
+
import { UDSChipConfigProvider, UDSChipConfigProviderProps, useChipConfig } from "./UDSChipConfigProvider.cjs";
|
|
8
|
+
export { Chip, ChipButton, type ChipButtonProps, ChipDismissible, type ChipDismissibleProps, ChipLink, type ChipLinkProps, type ChipProps, ChipToggle, type ChipToggleProps, UDSChipConfigProvider, type UDSChipConfigProviderProps, useChipConfig };
|
|
@@ -5,4 +5,5 @@ import { ChipButton, ChipButtonProps } from "./ChipButton.js";
|
|
|
5
5
|
import { ChipDismissible, ChipDismissibleProps } from "./ChipDismissible.js";
|
|
6
6
|
import { ChipLink, ChipLinkProps } from "./ChipLink.js";
|
|
7
7
|
import { ChipToggle, ChipToggleProps } from "./ChipToggle.js";
|
|
8
|
-
|
|
8
|
+
import { UDSChipConfigProvider, UDSChipConfigProviderProps, useChipConfig } from "./UDSChipConfigProvider.js";
|
|
9
|
+
export { Chip, ChipButton, type ChipButtonProps, ChipDismissible, type ChipDismissibleProps, ChipLink, type ChipLinkProps, type ChipProps, ChipToggle, type ChipToggleProps, UDSChipConfigProvider, type UDSChipConfigProviderProps, useChipConfig };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
+
import { UDSChipConfigProvider, useChipConfig } from "./UDSChipConfigProvider.js";
|
|
3
4
|
import { ChipButton } from "./ChipButton.js";
|
|
4
5
|
import { ChipDismissible } from "./ChipDismissible.js";
|
|
5
6
|
import { ChipLink } from "./ChipLink.js";
|
|
6
7
|
import { ChipToggle } from "./ChipToggle.js";
|
|
7
8
|
import { Chip } from "./Chip.js";
|
|
8
|
-
export { Chip, ChipButton, ChipDismissible, ChipLink, ChipToggle };
|
|
9
|
+
export { Chip, ChipButton, ChipDismissible, ChipLink, ChipToggle, UDSChipConfigProvider, useChipConfig };
|
|
@@ -9,6 +9,7 @@ const require_components_HStack = require("../../HStack.cjs");
|
|
|
9
9
|
const require_components_VStack = require("../../VStack.cjs");
|
|
10
10
|
const require_hooks_usePrefersReducedMotion = require("../../../hooks/usePrefersReducedMotion.cjs");
|
|
11
11
|
const require_components_client_AnimateHeightChange = require("../AnimateHeightChange.cjs");
|
|
12
|
+
const require_components_client_Input_UDSInputConfigProvider = require("./UDSInputConfigProvider.cjs");
|
|
12
13
|
const require_components_client_Input_InputHelpTextInternal = require("./InputHelpTextInternal.cjs");
|
|
13
14
|
let react = require("react");
|
|
14
15
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -90,6 +91,7 @@ const Input = (0, react.forwardRef)(function Input({ id, label, type = "text", s
|
|
|
90
91
|
const generatedId = (0, react.useId)();
|
|
91
92
|
const uid = id ?? `uds-input-${generatedId}`;
|
|
92
93
|
const helpTextId = `uds-input-${uid}-help-text`;
|
|
94
|
+
const { startIconSize, endIconSize } = require_components_client_Input_UDSInputConfigProvider.useInputConfig(size);
|
|
93
95
|
const { className: inputClassName, ...inputProps } = slotProps?.input ?? {};
|
|
94
96
|
const { className: inputWrapperClassName, ...inputWrapperProps } = slotProps?.inputWrapper ?? {};
|
|
95
97
|
const ref = (0, react.useRef)(null);
|
|
@@ -204,7 +206,10 @@ const Input = (0, react.forwardRef)(function Input({ id, label, type = "text", s
|
|
|
204
206
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StartIcon, {
|
|
205
207
|
icon: startIcon,
|
|
206
208
|
className: classNames.startIcon,
|
|
207
|
-
iconProps:
|
|
209
|
+
iconProps: {
|
|
210
|
+
size: startIconSize,
|
|
211
|
+
...slotProps?.startIcon
|
|
212
|
+
}
|
|
208
213
|
}),
|
|
209
214
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
210
215
|
ref,
|
|
@@ -229,7 +234,10 @@ const Input = (0, react.forwardRef)(function Input({ id, label, type = "text", s
|
|
|
229
234
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndIcon, {
|
|
230
235
|
icon: endIcon,
|
|
231
236
|
className: classNames.endIcon,
|
|
232
|
-
iconProps:
|
|
237
|
+
iconProps: {
|
|
238
|
+
size: endIconSize,
|
|
239
|
+
...slotProps?.endIcon
|
|
240
|
+
}
|
|
233
241
|
})
|
|
234
242
|
})
|
|
235
243
|
]
|
|
@@ -7,6 +7,7 @@ import { HStack } from "../../HStack.js";
|
|
|
7
7
|
import { VStack } from "../../VStack.js";
|
|
8
8
|
import { usePrefersReducedMotion } from "../../../hooks/usePrefersReducedMotion.js";
|
|
9
9
|
import { AnimateHeightChange } from "../AnimateHeightChange.js";
|
|
10
|
+
import { useInputConfig } from "./UDSInputConfigProvider.js";
|
|
10
11
|
import { InputHelpTextInternal as InputHelpTextInternalMemo } from "./InputHelpTextInternal.js";
|
|
11
12
|
import { forwardRef, memo, useCallback, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -87,6 +88,7 @@ const Input = forwardRef(function Input({ id, label, type = "text", size = "md",
|
|
|
87
88
|
const generatedId = useId();
|
|
88
89
|
const uid = id ?? `uds-input-${generatedId}`;
|
|
89
90
|
const helpTextId = `uds-input-${uid}-help-text`;
|
|
91
|
+
const { startIconSize, endIconSize } = useInputConfig(size);
|
|
90
92
|
const { className: inputClassName, ...inputProps } = slotProps?.input ?? {};
|
|
91
93
|
const { className: inputWrapperClassName, ...inputWrapperProps } = slotProps?.inputWrapper ?? {};
|
|
92
94
|
const ref = useRef(null);
|
|
@@ -201,7 +203,10 @@ const Input = forwardRef(function Input({ id, label, type = "text", size = "md",
|
|
|
201
203
|
/* @__PURE__ */ jsx(StartIcon, {
|
|
202
204
|
icon: startIcon,
|
|
203
205
|
className: classNames.startIcon,
|
|
204
|
-
iconProps:
|
|
206
|
+
iconProps: {
|
|
207
|
+
size: startIconSize,
|
|
208
|
+
...slotProps?.startIcon
|
|
209
|
+
}
|
|
205
210
|
}),
|
|
206
211
|
/* @__PURE__ */ jsx("input", {
|
|
207
212
|
ref,
|
|
@@ -226,7 +231,10 @@ const Input = forwardRef(function Input({ id, label, type = "text", size = "md",
|
|
|
226
231
|
children: /* @__PURE__ */ jsx(EndIcon, {
|
|
227
232
|
icon: endIcon,
|
|
228
233
|
className: classNames.endIcon,
|
|
229
|
-
iconProps:
|
|
234
|
+
iconProps: {
|
|
235
|
+
size: endIconSize,
|
|
236
|
+
...slotProps?.endIcon
|
|
237
|
+
}
|
|
230
238
|
})
|
|
231
239
|
})
|
|
232
240
|
]
|
|
@@ -5,11 +5,16 @@ require("../../../_virtual/_rolldown/runtime.cjs");
|
|
|
5
5
|
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
6
6
|
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
7
7
|
const require_components_HStack = require("../../HStack.cjs");
|
|
8
|
+
const require_components_client_Input_UDSInputConfigProvider = require("./UDSInputConfigProvider.cjs");
|
|
8
9
|
let react = require("react");
|
|
9
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
11
|
//#region src/components/client/Input/InputHelpTextInternal.tsx
|
|
11
12
|
const InputHelpTextInternal = (0, react.forwardRef)(function InputHelpTextInternal({ startIcon, endIcon, iconProps, children, size, isFilled, slotProps, ...rest }, ref) {
|
|
12
|
-
const
|
|
13
|
+
const { helperIconSize } = require_components_client_Input_UDSInputConfigProvider.useInputConfig(size);
|
|
14
|
+
const defaultIconProps = {
|
|
15
|
+
variant: "outline",
|
|
16
|
+
size: helperIconSize
|
|
17
|
+
};
|
|
13
18
|
const classNames = {
|
|
14
19
|
helperText: require_styles_styler.cx(require_styles_styler.getStyles({
|
|
15
20
|
inputSizeHelperText: size,
|
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
4
|
import { IconSlot } from "../../IconSlot.js";
|
|
5
5
|
import { HStack } from "../../HStack.js";
|
|
6
|
+
import { useInputConfig } from "./UDSInputConfigProvider.js";
|
|
6
7
|
import { forwardRef, memo } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/client/Input/InputHelpTextInternal.tsx
|
|
9
10
|
const InputHelpTextInternal = forwardRef(function InputHelpTextInternal({ startIcon, endIcon, iconProps, children, size, isFilled, slotProps, ...rest }, ref) {
|
|
10
|
-
const
|
|
11
|
+
const { helperIconSize } = useInputConfig(size);
|
|
12
|
+
const defaultIconProps = {
|
|
13
|
+
variant: "outline",
|
|
14
|
+
size: helperIconSize
|
|
15
|
+
};
|
|
11
16
|
const classNames = {
|
|
12
17
|
helperText: cx(getStyles({
|
|
13
18
|
inputSizeHelperText: size,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
//#region src/components/client/Input/UDSInputConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSInputConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("Input");
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the configured start/end/helper icon sizes for an Input size.
|
|
8
|
+
*
|
|
9
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Input
|
|
10
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
11
|
+
* back to `undefined` for all three slots (letting `Icon` apply its own
|
|
12
|
+
* default size) when no config is present — preserving the previous rendering
|
|
13
|
+
* exactly.
|
|
14
|
+
*/
|
|
15
|
+
const useInputConfig = (sizeProp) => {
|
|
16
|
+
const context = useConfigContext();
|
|
17
|
+
if (!context) return {
|
|
18
|
+
size: sizeProp,
|
|
19
|
+
startIconSize: void 0,
|
|
20
|
+
endIconSize: void 0,
|
|
21
|
+
helperIconSize: void 0
|
|
22
|
+
};
|
|
23
|
+
const size = sizeProp ?? context.defaultSize;
|
|
24
|
+
return {
|
|
25
|
+
size,
|
|
26
|
+
startIconSize: context.startIconSize[size],
|
|
27
|
+
endIconSize: context.endIconSize[size],
|
|
28
|
+
helperIconSize: context.helperIconSize[size]
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.UDSInputConfigProvider = UDSInputConfigProvider;
|
|
33
|
+
exports.useInputConfig = useInputConfig;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSize, InputSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
4
|
+
import { UDSInputConfigContextType } from "../../../runtime/inputConfig.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Input/UDSInputConfigProvider.d.ts
|
|
8
|
+
declare const UDSInputConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSInputConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSInputConfigProviderProps = UDSConfigProviderProps<UDSInputConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured start/end/helper icon sizes for an Input size.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Input
|
|
20
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
21
|
+
* back to `undefined` for all three slots (letting `Icon` apply its own
|
|
22
|
+
* default size) when no config is present — preserving the previous rendering
|
|
23
|
+
* exactly.
|
|
24
|
+
*/
|
|
25
|
+
declare const useInputConfig: (sizeProp?: InputSize | undefined) => {
|
|
26
|
+
size: InputSize | undefined;
|
|
27
|
+
startIconSize: IconSize | undefined;
|
|
28
|
+
endIconSize: IconSize | undefined;
|
|
29
|
+
helperIconSize: IconSize | undefined;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { type UDSInputConfigContextType, UDSInputConfigProvider, type UDSInputConfigProviderProps, useInputConfig };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconSize, InputSize } from "../../../types/dist/index.js";
|
|
4
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.js";
|
|
5
|
+
import { UDSInputConfigContextType } from "../../../runtime/inputConfig.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Input/UDSInputConfigProvider.d.ts
|
|
9
|
+
declare const UDSInputConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSInputConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSInputConfigProviderProps = UDSConfigProviderProps<UDSInputConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured start/end/helper icon sizes for an Input size.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Input
|
|
21
|
+
* is used in many apps without a `UDSConfigProvider`, so it gracefully falls
|
|
22
|
+
* back to `undefined` for all three slots (letting `Icon` apply its own
|
|
23
|
+
* default size) when no config is present — preserving the previous rendering
|
|
24
|
+
* exactly.
|
|
25
|
+
*/
|
|
26
|
+
declare const useInputConfig: (sizeProp?: InputSize | undefined) => {
|
|
27
|
+
size: InputSize | undefined;
|
|
28
|
+
startIconSize: IconSize | undefined;
|
|
29
|
+
endIconSize: IconSize | undefined;
|
|
30
|
+
helperIconSize: IconSize | undefined;
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { type UDSInputConfigContextType, UDSInputConfigProvider, type UDSInputConfigProviderProps, useInputConfig };
|