@yahoo/uds 3.166.0 → 3.167.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/cli/commands/sync.cjs +36 -0
- package/dist/cli/commands/sync.js +36 -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/index.cjs +45 -0
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +19 -1
- 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/utils/getShadowStyles.d.cts +2 -2
- package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
- package/dist/uds/generated/componentData.cjs +2607 -2490
- package/dist/uds/generated/componentData.js +2607 -2490
- package/dist/uds/generated/tailwindPurge.cjs +38 -2
- package/dist/uds/generated/tailwindPurge.js +38 -2
- package/dist/uds/package.cjs +2 -2
- package/dist/uds/package.js +2 -2
- package/generated/componentData.json +3219 -3052
- package/generated/tailwindPurge.ts +3 -3
- package/package.json +3 -3
|
@@ -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 };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { createUDSConfigProvider } from "../providers/createUDSConfigProvider.js";
|
|
4
|
+
//#region src/components/client/Input/UDSInputConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSInputConfigProvider, useConfigContext } = 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
|
+
export { UDSInputConfigProvider, useInputConfig };
|
|
@@ -1,7 +1,10 @@
|
|
|
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_Input_UDSInputConfigProvider = require("./UDSInputConfigProvider.cjs");
|
|
4
5
|
const require_components_client_Input_Input = require("./Input.cjs");
|
|
5
6
|
const require_components_client_Input_InputHelpText = require("./InputHelpText.cjs");
|
|
6
7
|
exports.Input = require_components_client_Input_Input.Input;
|
|
7
8
|
exports.InputHelpText = require_components_client_Input_InputHelpText.InputHelpText;
|
|
9
|
+
exports.UDSInputConfigProvider = require_components_client_Input_UDSInputConfigProvider.UDSInputConfigProvider;
|
|
10
|
+
exports.useInputConfig = require_components_client_Input_UDSInputConfigProvider.useInputConfig;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { Input, InputProps } from "./Input.cjs";
|
|
3
3
|
import { InputHelpText, InputHelpTextProps } from "./InputHelpText.cjs";
|
|
4
|
-
|
|
4
|
+
import { UDSInputConfigProvider, UDSInputConfigProviderProps, useInputConfig } from "./UDSInputConfigProvider.cjs";
|
|
5
|
+
export { Input, InputHelpText, type InputHelpTextProps, type InputProps, UDSInputConfigProvider, type UDSInputConfigProviderProps, useInputConfig };
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { Input, InputProps } from "./Input.js";
|
|
4
4
|
import { InputHelpText, InputHelpTextProps } from "./InputHelpText.js";
|
|
5
|
-
|
|
5
|
+
import { UDSInputConfigProvider, UDSInputConfigProviderProps, useInputConfig } from "./UDSInputConfigProvider.js";
|
|
6
|
+
export { Input, InputHelpText, type InputHelpTextProps, type InputProps, UDSInputConfigProvider, type UDSInputConfigProviderProps, useInputConfig };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
+
import { UDSInputConfigProvider, useInputConfig } from "./UDSInputConfigProvider.js";
|
|
3
4
|
import { Input } from "./Input.js";
|
|
4
5
|
import { InputHelpText } from "./InputHelpText.js";
|
|
5
|
-
export { Input, InputHelpText };
|
|
6
|
+
export { Input, InputHelpText, UDSInputConfigProvider, useInputConfig };
|
|
@@ -6,6 +6,7 @@ const require_styles_styler = require("../../../styles/styler.cjs");
|
|
|
6
6
|
const require_components_client_Pressable = require("../Pressable.cjs");
|
|
7
7
|
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
8
8
|
const require_components_HStack = require("../../HStack.cjs");
|
|
9
|
+
const require_components_client_Menu_UDSMenuItemConfigProvider = require("./UDSMenuItemConfigProvider.cjs");
|
|
9
10
|
let react = require("react");
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
12
|
let motion_react = require("motion/react");
|
|
@@ -36,6 +37,7 @@ const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0"
|
|
|
36
37
|
disabled,
|
|
37
38
|
className
|
|
38
39
|
});
|
|
40
|
+
const { startIconSize, endIconSize } = require_components_client_Menu_UDSMenuItemConfigProvider.useMenuItemConfig();
|
|
39
41
|
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
40
42
|
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
41
43
|
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
@@ -129,7 +131,7 @@ const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0"
|
|
|
129
131
|
icon: startIcon,
|
|
130
132
|
className: classNames.startIcon,
|
|
131
133
|
iconProps: {
|
|
132
|
-
size:
|
|
134
|
+
size: startIconSize,
|
|
133
135
|
variant: active ? "fill" : "outline",
|
|
134
136
|
color: "current",
|
|
135
137
|
...endIconSlotProps,
|
|
@@ -155,7 +157,7 @@ const MenuItemBase = (0, react.forwardRef)(function MenuItemBase({ spacing = "0"
|
|
|
155
157
|
icon: endIcon,
|
|
156
158
|
className: classNames.endIcon,
|
|
157
159
|
iconProps: {
|
|
158
|
-
size:
|
|
160
|
+
size: endIconSize,
|
|
159
161
|
variant: active ? "fill" : "outline",
|
|
160
162
|
color: "current"
|
|
161
163
|
}
|
|
@@ -4,6 +4,7 @@ import { cx, getStyles } from "../../../styles/styler.js";
|
|
|
4
4
|
import { Pressable } from "../Pressable.js";
|
|
5
5
|
import { IconSlot } from "../../IconSlot.js";
|
|
6
6
|
import { HStack } from "../../HStack.js";
|
|
7
|
+
import { useMenuItemConfig } from "./UDSMenuItemConfigProvider.js";
|
|
7
8
|
import { Children, forwardRef, useMemo } from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
import { AnimatePresence, m } from "motion/react";
|
|
@@ -34,6 +35,7 @@ const MenuItemBase = forwardRef(function MenuItemBase({ spacing = "0", spacingBo
|
|
|
34
35
|
disabled,
|
|
35
36
|
className
|
|
36
37
|
});
|
|
38
|
+
const { startIconSize, endIconSize } = useMenuItemConfig();
|
|
37
39
|
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
38
40
|
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
39
41
|
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
@@ -127,7 +129,7 @@ const MenuItemBase = forwardRef(function MenuItemBase({ spacing = "0", spacingBo
|
|
|
127
129
|
icon: startIcon,
|
|
128
130
|
className: classNames.startIcon,
|
|
129
131
|
iconProps: {
|
|
130
|
-
size:
|
|
132
|
+
size: startIconSize,
|
|
131
133
|
variant: active ? "fill" : "outline",
|
|
132
134
|
color: "current",
|
|
133
135
|
...endIconSlotProps,
|
|
@@ -153,7 +155,7 @@ const MenuItemBase = forwardRef(function MenuItemBase({ spacing = "0", spacingBo
|
|
|
153
155
|
icon: endIcon,
|
|
154
156
|
className: classNames.endIcon,
|
|
155
157
|
iconProps: {
|
|
156
|
-
size:
|
|
158
|
+
size: endIconSize,
|
|
157
159
|
variant: active ? "fill" : "outline",
|
|
158
160
|
color: "current"
|
|
159
161
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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/Menu/UDSMenuItemConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSMenuItemConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("MenuItem");
|
|
6
|
+
/** The icon size MenuItem hardcoded before runtime config support. */
|
|
7
|
+
const menuItemFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured start/end icon sizes for MenuItem.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* MenuItem is used in many apps without a `UDSConfigProvider`, so it
|
|
13
|
+
* gracefully falls back to the previously hardcoded icon size (`sm`) when no
|
|
14
|
+
* config is present.
|
|
15
|
+
*/
|
|
16
|
+
const useMenuItemConfig = () => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
startIconSize: menuItemFallbackIconSize,
|
|
20
|
+
endIconSize: menuItemFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
startIconSize: context.startIconSize[size],
|
|
25
|
+
endIconSize: context.endIconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.UDSMenuItemConfigProvider = UDSMenuItemConfigProvider;
|
|
30
|
+
exports.useMenuItemConfig = useMenuItemConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
4
|
+
import { UDSMenuItemConfigContextType } from "../../../runtime/menuItemConfig.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Menu/UDSMenuItemConfigProvider.d.ts
|
|
8
|
+
declare const UDSMenuItemConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSMenuItemConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSMenuItemConfigProviderProps = UDSConfigProviderProps<UDSMenuItemConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured start/end icon sizes for MenuItem.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
20
|
+
* MenuItem is used in many apps without a `UDSConfigProvider`, so it
|
|
21
|
+
* gracefully falls back to the previously hardcoded icon size (`sm`) when no
|
|
22
|
+
* config is present.
|
|
23
|
+
*/
|
|
24
|
+
declare const useMenuItemConfig: () => {
|
|
25
|
+
startIconSize: IconSize;
|
|
26
|
+
endIconSize: IconSize;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { type UDSMenuItemConfigContextType, UDSMenuItemConfigProvider, type UDSMenuItemConfigProviderProps, useMenuItemConfig };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconSize } from "../../../types/dist/index.js";
|
|
4
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.js";
|
|
5
|
+
import { UDSMenuItemConfigContextType } from "../../../runtime/menuItemConfig.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Menu/UDSMenuItemConfigProvider.d.ts
|
|
9
|
+
declare const UDSMenuItemConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSMenuItemConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSMenuItemConfigProviderProps = UDSConfigProviderProps<UDSMenuItemConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured start/end icon sizes for MenuItem.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
21
|
+
* MenuItem is used in many apps without a `UDSConfigProvider`, so it
|
|
22
|
+
* gracefully falls back to the previously hardcoded icon size (`sm`) when no
|
|
23
|
+
* config is present.
|
|
24
|
+
*/
|
|
25
|
+
declare const useMenuItemConfig: () => {
|
|
26
|
+
startIconSize: IconSize;
|
|
27
|
+
endIconSize: IconSize;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type UDSMenuItemConfigContextType, UDSMenuItemConfigProvider, type UDSMenuItemConfigProviderProps, useMenuItemConfig };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { createUDSConfigProvider } from "../providers/createUDSConfigProvider.js";
|
|
4
|
+
//#region src/components/client/Menu/UDSMenuItemConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSMenuItemConfigProvider, useConfigContext } = createUDSConfigProvider("MenuItem");
|
|
6
|
+
/** The icon size MenuItem hardcoded before runtime config support. */
|
|
7
|
+
const menuItemFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured start/end icon sizes for MenuItem.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* MenuItem is used in many apps without a `UDSConfigProvider`, so it
|
|
13
|
+
* gracefully falls back to the previously hardcoded icon size (`sm`) when no
|
|
14
|
+
* config is present.
|
|
15
|
+
*/
|
|
16
|
+
const useMenuItemConfig = () => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
startIconSize: menuItemFallbackIconSize,
|
|
20
|
+
endIconSize: menuItemFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
startIconSize: context.startIconSize[size],
|
|
25
|
+
endIconSize: context.endIconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { UDSMenuItemConfigProvider, useMenuItemConfig };
|
|
@@ -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_Menu_UDSMenuItemConfigProvider = require("./UDSMenuItemConfigProvider.cjs");
|
|
4
5
|
const require_components_client_Menu_Menu_index = require("./Menu.index.cjs");
|
|
5
6
|
Object.defineProperty(exports, "Menu", {
|
|
6
7
|
enumerable: true,
|
|
@@ -8,3 +9,5 @@ Object.defineProperty(exports, "Menu", {
|
|
|
8
9
|
return require_components_client_Menu_Menu_index.Menu_index_exports;
|
|
9
10
|
}
|
|
10
11
|
});
|
|
12
|
+
exports.UDSMenuItemConfigProvider = require_components_client_Menu_UDSMenuItemConfigProvider.UDSMenuItemConfigProvider;
|
|
13
|
+
exports.useMenuItemConfig = require_components_client_Menu_UDSMenuItemConfigProvider.useMenuItemConfig;
|
|
@@ -6,4 +6,5 @@ import { MenuItemCheckboxProps } from "./Menu.ItemCheckbox.cjs";
|
|
|
6
6
|
import { MenuPlacement, MenuProviderProps } from "./Menu.Provider.cjs";
|
|
7
7
|
import { MenuTriggerProps } from "./Menu.Trigger.cjs";
|
|
8
8
|
import { Menu_index_d_exports } from "./Menu.index.cjs";
|
|
9
|
-
|
|
9
|
+
import { UDSMenuItemConfigProvider, UDSMenuItemConfigProviderProps, useMenuItemConfig } from "./UDSMenuItemConfigProvider.cjs";
|
|
10
|
+
export { Menu_index_d_exports as Menu, type MenuContentProps, type MenuDividerProps, type MenuItemCheckboxProps, type MenuItemProps, type MenuPlacement, type MenuProviderProps, type MenuTriggerProps, UDSMenuItemConfigProvider, type UDSMenuItemConfigProviderProps, useMenuItemConfig };
|
|
@@ -7,4 +7,5 @@ import { MenuItemCheckboxProps } from "./Menu.ItemCheckbox.js";
|
|
|
7
7
|
import { MenuPlacement, MenuProviderProps } from "./Menu.Provider.js";
|
|
8
8
|
import { MenuTriggerProps } from "./Menu.Trigger.js";
|
|
9
9
|
import { Menu_index_d_exports } from "./Menu.index.js";
|
|
10
|
-
|
|
10
|
+
import { UDSMenuItemConfigProvider, UDSMenuItemConfigProviderProps, useMenuItemConfig } from "./UDSMenuItemConfigProvider.js";
|
|
11
|
+
export { Menu_index_d_exports as Menu, type MenuContentProps, type MenuDividerProps, type MenuItemCheckboxProps, type MenuItemProps, type MenuPlacement, type MenuProviderProps, type MenuTriggerProps, UDSMenuItemConfigProvider, type UDSMenuItemConfigProviderProps, useMenuItemConfig };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
+
import { UDSMenuItemConfigProvider, useMenuItemConfig } from "./UDSMenuItemConfigProvider.js";
|
|
3
4
|
import { Menu_index_exports } from "./Menu.index.js";
|
|
4
|
-
export { Menu_index_exports as Menu };
|
|
5
|
+
export { Menu_index_exports as Menu, UDSMenuItemConfigProvider, useMenuItemConfig };
|
|
@@ -6,11 +6,13 @@ const require_styles_styler = require("../../../styles/styler.cjs");
|
|
|
6
6
|
const require_components_Icon = require("../../Icon.cjs");
|
|
7
7
|
const require_components_client_PaddleNav_paddleButtonIcons = require("./paddleButtonIcons.cjs");
|
|
8
8
|
const require_components_client_PaddleNav_paddleNavContext = require("./paddleNavContext.cjs");
|
|
9
|
+
const require_components_client_PaddleNav_UDSPaddleNavConfigProvider = require("./UDSPaddleNavConfigProvider.cjs");
|
|
9
10
|
let react = require("react");
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
12
|
//#region src/components/client/PaddleNav/PaddleButton.tsx
|
|
12
13
|
const PaddleButton = (0, react.forwardRef)(function PaddleButton({ onClick, disabled = false, hidden = false, icon, paddleRole, className, ...rest }, ref) {
|
|
13
14
|
const { variant, size, orientation, registerPaddleHidden } = require_components_client_PaddleNav_paddleNavContext.usePaddleNavContext();
|
|
15
|
+
const { iconSize } = require_components_client_PaddleNav_UDSPaddleNavConfigProvider.usePaddleNavConfig(size);
|
|
14
16
|
(0, react.useLayoutEffect)(() => {
|
|
15
17
|
registerPaddleHidden(paddleRole, hidden);
|
|
16
18
|
return () => registerPaddleHidden(paddleRole, false);
|
|
@@ -39,7 +41,7 @@ const PaddleButton = (0, react.forwardRef)(function PaddleButton({ onClick, disa
|
|
|
39
41
|
"aria-hidden": true,
|
|
40
42
|
className: require_styles_styler.cx("absolute inset-0 -z-10 pointer-events-none rounded-[var(--uds-nested-radius)]", "transition-[background-color,opacity] duration-[180ms] ease-[cubic-bezier(0,0,0.2,1)]", backgroundClass)
|
|
41
43
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
42
|
-
size:
|
|
44
|
+
size: iconSize,
|
|
43
45
|
name: resolvedIcon,
|
|
44
46
|
color: "current",
|
|
45
47
|
className: require_styles_styler.cx(iconSizeClass, iconVariantClass)
|
|
@@ -4,11 +4,13 @@ import { cx, getStyles } from "../../../styles/styler.js";
|
|
|
4
4
|
import { Icon } from "../../Icon.js";
|
|
5
5
|
import { pickDefaultPaddleIcon } from "./paddleButtonIcons.js";
|
|
6
6
|
import { usePaddleNavContext } from "./paddleNavContext.js";
|
|
7
|
+
import { usePaddleNavConfig } from "./UDSPaddleNavConfigProvider.js";
|
|
7
8
|
import { forwardRef, useLayoutEffect, useMemo } from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/client/PaddleNav/PaddleButton.tsx
|
|
10
11
|
const PaddleButton = forwardRef(function PaddleButton({ onClick, disabled = false, hidden = false, icon, paddleRole, className, ...rest }, ref) {
|
|
11
12
|
const { variant, size, orientation, registerPaddleHidden } = usePaddleNavContext();
|
|
13
|
+
const { iconSize } = usePaddleNavConfig(size);
|
|
12
14
|
useLayoutEffect(() => {
|
|
13
15
|
registerPaddleHidden(paddleRole, hidden);
|
|
14
16
|
return () => registerPaddleHidden(paddleRole, false);
|
|
@@ -37,7 +39,7 @@ const PaddleButton = forwardRef(function PaddleButton({ onClick, disabled = fals
|
|
|
37
39
|
"aria-hidden": true,
|
|
38
40
|
className: cx("absolute inset-0 -z-10 pointer-events-none rounded-[var(--uds-nested-radius)]", "transition-[background-color,opacity] duration-[180ms] ease-[cubic-bezier(0,0,0.2,1)]", backgroundClass)
|
|
39
41
|
}), /* @__PURE__ */ jsx(Icon, {
|
|
40
|
-
size:
|
|
42
|
+
size: iconSize,
|
|
41
43
|
name: resolvedIcon,
|
|
42
44
|
color: "current",
|
|
43
45
|
className: cx(iconSizeClass, iconVariantClass)
|
|
@@ -0,0 +1,30 @@
|
|
|
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/PaddleNav/UDSPaddleNavConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSPaddleNavConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("PaddleNav");
|
|
6
|
+
/** The icon size PaddleButton hardcoded before runtime config support. */
|
|
7
|
+
const paddleNavFallbackIconSize = "md";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured icon size for a PaddleNav size.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* PaddleNav is used in many apps without a `UDSConfigProvider`, so it
|
|
13
|
+
* gracefully falls back to the previously hardcoded icon size (`md`) when no
|
|
14
|
+
* config is present.
|
|
15
|
+
*/
|
|
16
|
+
const usePaddleNavConfig = (sizeProp) => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
size: sizeProp,
|
|
20
|
+
iconSize: paddleNavFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = sizeProp ?? context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
size,
|
|
25
|
+
iconSize: context.iconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.UDSPaddleNavConfigProvider = UDSPaddleNavConfigProvider;
|
|
30
|
+
exports.usePaddleNavConfig = usePaddleNavConfig;
|