@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,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/Pagination/UDSPaginationConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSPaginationConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("Pagination");
|
|
6
|
+
/** The icon size Pagination hardcoded before runtime config support. */
|
|
7
|
+
const paginationFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured icon size for a Pagination size.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* Pagination 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 usePaginationConfig = (sizeProp) => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
size: sizeProp,
|
|
20
|
+
iconSize: paginationFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = sizeProp ?? context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
size,
|
|
25
|
+
iconSize: context.iconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.UDSPaginationConfigProvider = UDSPaginationConfigProvider;
|
|
30
|
+
exports.usePaginationConfig = usePaginationConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSize, PaginationSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
4
|
+
import { UDSPaginationConfigContextType } from "../../../runtime/paginationConfig.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Pagination/UDSPaginationConfigProvider.d.ts
|
|
8
|
+
declare const UDSPaginationConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSPaginationConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSPaginationConfigProviderProps = UDSConfigProviderProps<UDSPaginationConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured icon size for a Pagination size.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
20
|
+
* Pagination 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 usePaginationConfig: (sizeProp?: PaginationSize | undefined) => {
|
|
25
|
+
size: PaginationSize | undefined;
|
|
26
|
+
iconSize: IconSize;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { type UDSPaginationConfigContextType, UDSPaginationConfigProvider, type UDSPaginationConfigProviderProps, usePaginationConfig };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconSize, PaginationSize } from "../../../types/dist/index.js";
|
|
4
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.js";
|
|
5
|
+
import { UDSPaginationConfigContextType } from "../../../runtime/paginationConfig.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Pagination/UDSPaginationConfigProvider.d.ts
|
|
9
|
+
declare const UDSPaginationConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSPaginationConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSPaginationConfigProviderProps = UDSConfigProviderProps<UDSPaginationConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured icon size for a Pagination size.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
21
|
+
* Pagination 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 usePaginationConfig: (sizeProp?: PaginationSize | undefined) => {
|
|
26
|
+
size: PaginationSize | undefined;
|
|
27
|
+
iconSize: IconSize;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type UDSPaginationConfigContextType, UDSPaginationConfigProvider, type UDSPaginationConfigProviderProps, usePaginationConfig };
|
|
@@ -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/Pagination/UDSPaginationConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSPaginationConfigProvider, useConfigContext } = createUDSConfigProvider("Pagination");
|
|
6
|
+
/** The icon size Pagination hardcoded before runtime config support. */
|
|
7
|
+
const paginationFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured icon size for a Pagination size.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* Pagination 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 usePaginationConfig = (sizeProp) => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
size: sizeProp,
|
|
20
|
+
iconSize: paginationFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = sizeProp ?? context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
size,
|
|
25
|
+
iconSize: context.iconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { UDSPaginationConfigProvider, usePaginationConfig };
|
|
@@ -6,6 +6,7 @@ const require_components_client_Pagination_Pagination = require("./Pagination.cj
|
|
|
6
6
|
const require_components_client_Pagination_PaginationEllipsis = require("./PaginationEllipsis.cjs");
|
|
7
7
|
const require_components_client_Pagination_PaginationItem = require("./PaginationItem.cjs");
|
|
8
8
|
const require_components_client_Pagination_PaginationLink = require("./PaginationLink.cjs");
|
|
9
|
+
const require_components_client_Pagination_UDSPaginationConfigProvider = require("./UDSPaginationConfigProvider.cjs");
|
|
9
10
|
const require_components_client_Pagination_PaginationNext = require("./PaginationNext.cjs");
|
|
10
11
|
const require_components_client_Pagination_PaginationNumbers = require("./PaginationNumbers.cjs");
|
|
11
12
|
const require_components_client_Pagination_PaginationPrev = require("./PaginationPrev.cjs");
|
|
@@ -16,4 +17,6 @@ exports.PaginationLink = require_components_client_Pagination_PaginationLink.Pag
|
|
|
16
17
|
exports.PaginationNext = require_components_client_Pagination_PaginationNext.PaginationNext;
|
|
17
18
|
exports.PaginationNumbers = require_components_client_Pagination_PaginationNumbers.PaginationNumbers;
|
|
18
19
|
exports.PaginationPrev = require_components_client_Pagination_PaginationPrev.PaginationPrev;
|
|
20
|
+
exports.UDSPaginationConfigProvider = require_components_client_Pagination_UDSPaginationConfigProvider.UDSPaginationConfigProvider;
|
|
19
21
|
exports.computeVisiblePages = require_components_client_Pagination_computeVisiblePages.computeVisiblePages;
|
|
22
|
+
exports.usePaginationConfig = require_components_client_Pagination_UDSPaginationConfigProvider.usePaginationConfig;
|
|
@@ -7,4 +7,5 @@ import { PaginationLink, PaginationLinkProps } from "./PaginationLink.cjs";
|
|
|
7
7
|
import { PaginationNext, PaginationNextProps } from "./PaginationNext.cjs";
|
|
8
8
|
import { PaginationNumbers, PaginationNumbersProps } from "./PaginationNumbers.cjs";
|
|
9
9
|
import { PaginationPrev, PaginationPrevProps } from "./PaginationPrev.cjs";
|
|
10
|
-
|
|
10
|
+
import { UDSPaginationConfigProvider, UDSPaginationConfigProviderProps, usePaginationConfig } from "./UDSPaginationConfigProvider.cjs";
|
|
11
|
+
export { Pagination, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationNumbers, type PaginationNumbersProps, PaginationPrev, type PaginationPrevProps, type PaginationProps, UDSPaginationConfigProvider, type UDSPaginationConfigProviderProps, computeVisiblePages, usePaginationConfig };
|
|
@@ -8,4 +8,5 @@ import { PaginationLink, PaginationLinkProps } from "./PaginationLink.js";
|
|
|
8
8
|
import { PaginationNext, PaginationNextProps } from "./PaginationNext.js";
|
|
9
9
|
import { PaginationNumbers, PaginationNumbersProps } from "./PaginationNumbers.js";
|
|
10
10
|
import { PaginationPrev, PaginationPrevProps } from "./PaginationPrev.js";
|
|
11
|
-
|
|
11
|
+
import { UDSPaginationConfigProvider, UDSPaginationConfigProviderProps, usePaginationConfig } from "./UDSPaginationConfigProvider.js";
|
|
12
|
+
export { Pagination, PaginationEllipsis, type PaginationEllipsisProps, PaginationItem, type PaginationItemProps, PaginationLink, type PaginationLinkProps, PaginationNext, type PaginationNextProps, PaginationNumbers, type PaginationNumbersProps, PaginationPrev, type PaginationPrevProps, type PaginationProps, UDSPaginationConfigProvider, type UDSPaginationConfigProviderProps, computeVisiblePages, usePaginationConfig };
|
|
@@ -5,7 +5,8 @@ import { Pagination } from "./Pagination.js";
|
|
|
5
5
|
import { PaginationEllipsis } from "./PaginationEllipsis.js";
|
|
6
6
|
import { PaginationItem } from "./PaginationItem.js";
|
|
7
7
|
import { PaginationLink } from "./PaginationLink.js";
|
|
8
|
+
import { UDSPaginationConfigProvider, usePaginationConfig } from "./UDSPaginationConfigProvider.js";
|
|
8
9
|
import { PaginationNext } from "./PaginationNext.js";
|
|
9
10
|
import { PaginationNumbers } from "./PaginationNumbers.js";
|
|
10
11
|
import { PaginationPrev } from "./PaginationPrev.js";
|
|
11
|
-
export { Pagination, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationNumbers, PaginationPrev, computeVisiblePages };
|
|
12
|
+
export { Pagination, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationNumbers, PaginationPrev, UDSPaginationConfigProvider, computeVisiblePages, usePaginationConfig };
|
|
@@ -29,7 +29,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
|
|
|
29
29
|
gap: SpacingAlias;
|
|
30
30
|
dismissButtonSpacing: SpacingAlias;
|
|
31
31
|
dismissIconSize: number;
|
|
32
|
-
ariaKitPlacement: ("
|
|
32
|
+
ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
|
|
33
33
|
animationDuration: number;
|
|
34
34
|
};
|
|
35
35
|
//#endregion
|
|
@@ -30,7 +30,7 @@ declare function usePopoverConfig(sizeProp?: PopoverSize | undefined, variantPro
|
|
|
30
30
|
gap: SpacingAlias;
|
|
31
31
|
dismissButtonSpacing: SpacingAlias;
|
|
32
32
|
dismissIconSize: number;
|
|
33
|
-
ariaKitPlacement: ("
|
|
33
|
+
ariaKitPlacement: ("top-start" | "top-end" | "bottom-start" | "bottom-end" | ("top" | "bottom" | "left" | "right") | "left-start" | "right-start" | "left-end" | "right-end") | undefined;
|
|
34
34
|
animationDuration: number;
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
@@ -6,6 +6,7 @@ require("../../../_virtual/_rolldown/runtime.cjs");
|
|
|
6
6
|
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
7
7
|
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
8
8
|
const require_components_HStack = require("../../HStack.cjs");
|
|
9
|
+
const require_components_client_Select_UDSSelectItemConfigProvider = require("./UDSSelectItemConfigProvider.cjs");
|
|
9
10
|
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
10
11
|
let react = require("react");
|
|
11
12
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -34,6 +35,7 @@ const buildSelectItemClasses = ({ disabled, className }) => {
|
|
|
34
35
|
*/
|
|
35
36
|
const SelectItem = (0, react.forwardRef)(function SelectItem({ children, className, slotProps, disabled, value, startIcon, ...props }, ref) {
|
|
36
37
|
const isSelected = (0, _ariakit_react.useStoreState)((0, _ariakit_react.useSelectContext)(), "value") === value;
|
|
38
|
+
const { startIconSize, endIconSize } = require_components_client_Select_UDSSelectItemConfigProvider.useSelectItemConfig();
|
|
37
39
|
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
38
40
|
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
39
41
|
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
@@ -132,7 +134,7 @@ const SelectItem = (0, react.forwardRef)(function SelectItem({ children, classNa
|
|
|
132
134
|
icon: startIcon,
|
|
133
135
|
className: classNames.startIcon,
|
|
134
136
|
iconProps: {
|
|
135
|
-
size:
|
|
137
|
+
size: startIconSize,
|
|
136
138
|
variant: isSelected ? "fill" : "outline",
|
|
137
139
|
color: "current",
|
|
138
140
|
...startIconSlotProps
|
|
@@ -157,7 +159,7 @@ const SelectItem = (0, react.forwardRef)(function SelectItem({ children, classNa
|
|
|
157
159
|
icon: _yahoo_uds_icons.Check,
|
|
158
160
|
className: classNames.endIcon,
|
|
159
161
|
iconProps: {
|
|
160
|
-
size:
|
|
162
|
+
size: endIconSize,
|
|
161
163
|
variant: "fill",
|
|
162
164
|
color: "current",
|
|
163
165
|
...endIconSlotProps
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
5
5
|
import { IconSlot } from "../../IconSlot.js";
|
|
6
6
|
import { HStack } from "../../HStack.js";
|
|
7
|
+
import { useSelectItemConfig } from "./UDSSelectItemConfigProvider.js";
|
|
7
8
|
import { Check } from "@yahoo/uds-icons";
|
|
8
9
|
import { forwardRef, useMemo } from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -32,6 +33,7 @@ const buildSelectItemClasses = ({ disabled, className }) => {
|
|
|
32
33
|
*/
|
|
33
34
|
const SelectItem = forwardRef(function SelectItem({ children, className, slotProps, disabled, value, startIcon, ...props }, ref) {
|
|
34
35
|
const isSelected = useStoreState(useSelectContext(), "value") === value;
|
|
36
|
+
const { startIconSize, endIconSize } = useSelectItemConfig();
|
|
35
37
|
const { className: rootClassName, ...rootSlotProps } = slotProps?.root ?? {};
|
|
36
38
|
const { className: textClassName, ...textSlotProps } = slotProps?.text ?? {};
|
|
37
39
|
const { className: startIconClassName, ...startIconSlotProps } = slotProps?.startIcon ?? {};
|
|
@@ -130,7 +132,7 @@ const SelectItem = forwardRef(function SelectItem({ children, className, slotPro
|
|
|
130
132
|
icon: startIcon,
|
|
131
133
|
className: classNames.startIcon,
|
|
132
134
|
iconProps: {
|
|
133
|
-
size:
|
|
135
|
+
size: startIconSize,
|
|
134
136
|
variant: isSelected ? "fill" : "outline",
|
|
135
137
|
color: "current",
|
|
136
138
|
...startIconSlotProps
|
|
@@ -155,7 +157,7 @@ const SelectItem = forwardRef(function SelectItem({ children, className, slotPro
|
|
|
155
157
|
icon: Check,
|
|
156
158
|
className: classNames.endIcon,
|
|
157
159
|
iconProps: {
|
|
158
|
-
size:
|
|
160
|
+
size: endIconSize,
|
|
159
161
|
variant: "fill",
|
|
160
162
|
color: "current",
|
|
161
163
|
...endIconSlotProps
|
|
@@ -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/Select/UDSSelectItemConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSSelectItemConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("SelectItem");
|
|
6
|
+
/** The icon size SelectItem hardcoded before runtime config support. */
|
|
7
|
+
const selectItemFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured start/end icon sizes for SelectItem.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* SelectItem 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 useSelectItemConfig = () => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
startIconSize: selectItemFallbackIconSize,
|
|
20
|
+
endIconSize: selectItemFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
startIconSize: context.startIconSize[size],
|
|
25
|
+
endIconSize: context.endIconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.UDSSelectItemConfigProvider = UDSSelectItemConfigProvider;
|
|
30
|
+
exports.useSelectItemConfig = useSelectItemConfig;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
4
|
+
import { UDSSelectItemConfigContextType } from "../../../runtime/selectItemConfig.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Select/UDSSelectItemConfigProvider.d.ts
|
|
8
|
+
declare const UDSSelectItemConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSSelectItemConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSSelectItemConfigProviderProps = UDSConfigProviderProps<UDSSelectItemConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured start/end icon sizes for SelectItem.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
20
|
+
* SelectItem 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 useSelectItemConfig: () => {
|
|
25
|
+
startIconSize: IconSize;
|
|
26
|
+
endIconSize: IconSize;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { type UDSSelectItemConfigContextType, UDSSelectItemConfigProvider, type UDSSelectItemConfigProviderProps, useSelectItemConfig };
|
|
@@ -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 { UDSSelectItemConfigContextType } from "../../../runtime/selectItemConfig.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Select/UDSSelectItemConfigProvider.d.ts
|
|
9
|
+
declare const UDSSelectItemConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSSelectItemConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSSelectItemConfigProviderProps = UDSConfigProviderProps<UDSSelectItemConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured start/end icon sizes for SelectItem.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
21
|
+
* SelectItem 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 useSelectItemConfig: () => {
|
|
26
|
+
startIconSize: IconSize;
|
|
27
|
+
endIconSize: IconSize;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type UDSSelectItemConfigContextType, UDSSelectItemConfigProvider, type UDSSelectItemConfigProviderProps, useSelectItemConfig };
|
|
@@ -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/Select/UDSSelectItemConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSSelectItemConfigProvider, useConfigContext } = createUDSConfigProvider("SelectItem");
|
|
6
|
+
/** The icon size SelectItem hardcoded before runtime config support. */
|
|
7
|
+
const selectItemFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured start/end icon sizes for SelectItem.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider:
|
|
12
|
+
* SelectItem 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 useSelectItemConfig = () => {
|
|
17
|
+
const context = useConfigContext();
|
|
18
|
+
if (!context) return {
|
|
19
|
+
startIconSize: selectItemFallbackIconSize,
|
|
20
|
+
endIconSize: selectItemFallbackIconSize
|
|
21
|
+
};
|
|
22
|
+
const size = context.defaultSize;
|
|
23
|
+
return {
|
|
24
|
+
startIconSize: context.startIconSize[size],
|
|
25
|
+
endIconSize: context.endIconSize[size]
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { UDSSelectItemConfigProvider, useSelectItemConfig };
|
|
@@ -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_Select_UDSSelectItemConfigProvider = require("./UDSSelectItemConfigProvider.cjs");
|
|
4
5
|
const require_components_client_Select_Select = require("./Select.cjs");
|
|
5
6
|
const require_components_client_Select_SelectContent = require("./SelectContent.cjs");
|
|
6
7
|
const require_components_client_Select_SelectDivider = require("./SelectDivider.cjs");
|
|
@@ -9,3 +10,5 @@ exports.Select = require_components_client_Select_Select.Select;
|
|
|
9
10
|
exports.SelectContent = require_components_client_Select_SelectContent.SelectContent;
|
|
10
11
|
exports.SelectDivider = require_components_client_Select_SelectDivider.SelectDivider;
|
|
11
12
|
exports.SelectItem = require_components_client_Select_SelectItem.SelectItem;
|
|
13
|
+
exports.UDSSelectItemConfigProvider = require_components_client_Select_UDSSelectItemConfigProvider.UDSSelectItemConfigProvider;
|
|
14
|
+
exports.useSelectItemConfig = require_components_client_Select_UDSSelectItemConfigProvider.useSelectItemConfig;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
|
|
2
|
+
import { UDSSelectItemConfigContextType } from "../../../runtime/selectItemConfig.cjs";
|
|
2
3
|
import { Select, SelectProps } from "./Select.cjs";
|
|
3
4
|
import { SelectContent, SelectContentProps } from "./SelectContent.cjs";
|
|
4
5
|
import { SelectDivider, SelectDividerProps } from "./SelectDivider.cjs";
|
|
5
6
|
import { SelectItem, SelectItemProps } from "./SelectItem.cjs";
|
|
6
|
-
|
|
7
|
+
import { UDSSelectItemConfigProvider, UDSSelectItemConfigProviderProps, useSelectItemConfig } from "./UDSSelectItemConfigProvider.cjs";
|
|
8
|
+
export { Select, SelectContent, SelectContentProps, SelectDivider, SelectDividerProps, SelectItem, SelectItemProps, SelectProps, UDSSelectItemConfigContextType, UDSSelectItemConfigProvider, UDSSelectItemConfigProviderProps, useSelectItemConfig };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
"use client";
|
|
3
|
+
import { UDSSelectItemConfigContextType } from "../../../runtime/selectItemConfig.js";
|
|
3
4
|
import { Select, SelectProps } from "./Select.js";
|
|
4
5
|
import { SelectContent, SelectContentProps } from "./SelectContent.js";
|
|
5
6
|
import { SelectDivider, SelectDividerProps } from "./SelectDivider.js";
|
|
6
7
|
import { SelectItem, SelectItemProps } from "./SelectItem.js";
|
|
7
|
-
|
|
8
|
+
import { UDSSelectItemConfigProvider, UDSSelectItemConfigProviderProps, useSelectItemConfig } from "./UDSSelectItemConfigProvider.js";
|
|
9
|
+
export { Select, SelectContent, SelectContentProps, SelectDivider, SelectDividerProps, SelectItem, SelectItemProps, SelectProps, UDSSelectItemConfigContextType, UDSSelectItemConfigProvider, UDSSelectItemConfigProviderProps, useSelectItemConfig };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
+
import { UDSSelectItemConfigProvider, useSelectItemConfig } from "./UDSSelectItemConfigProvider.js";
|
|
3
4
|
import { Select } from "./Select.js";
|
|
4
5
|
import { SelectContent } from "./SelectContent.js";
|
|
5
6
|
import { SelectDivider } from "./SelectDivider.js";
|
|
6
7
|
import { SelectItem } from "./SelectItem.js";
|
|
7
|
-
export { Select, SelectContent, SelectDivider, SelectItem };
|
|
8
|
+
export { Select, SelectContent, SelectDivider, SelectItem, UDSSelectItemConfigProvider, useSelectItemConfig };
|
|
@@ -5,6 +5,7 @@ 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_Text = require("../../Text.cjs");
|
|
8
|
+
const require_components_client_Tabs_UDSTabConfigProvider = require("./UDSTabConfigProvider.cjs");
|
|
8
9
|
const require_components_client_Tabs_tabsContext = require("./tabsContext.cjs");
|
|
9
10
|
let react = require("react");
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -16,6 +17,7 @@ function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, c
|
|
|
16
17
|
const generatedId = (0, react.useId)();
|
|
17
18
|
const uid = value ?? `uds-tab-${generatedId}`;
|
|
18
19
|
const { variant, reduceMotion } = require_components_client_Tabs_tabsContext.useTabsContext();
|
|
20
|
+
const { iconSize } = require_components_client_Tabs_UDSTabConfigProvider.useTabConfig();
|
|
19
21
|
const store = (0, _ariakit_react.useTabContext)();
|
|
20
22
|
if (!store) throw new Error("Tab must be wrapped in a Tabs component");
|
|
21
23
|
const selectedId = (0, _ariakit_react.useStoreState)(store, "selectedId");
|
|
@@ -54,7 +56,7 @@ function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, c
|
|
|
54
56
|
startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
55
57
|
icon: startIcon,
|
|
56
58
|
iconProps: {
|
|
57
|
-
size:
|
|
59
|
+
size: iconSize,
|
|
58
60
|
color: "current"
|
|
59
61
|
},
|
|
60
62
|
className: iconConfigClass,
|
|
@@ -70,7 +72,7 @@ function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, c
|
|
|
70
72
|
endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
71
73
|
icon: endIcon,
|
|
72
74
|
iconProps: {
|
|
73
|
-
size:
|
|
75
|
+
size: iconSize,
|
|
74
76
|
color: "current"
|
|
75
77
|
},
|
|
76
78
|
className: iconConfigClass,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
4
|
import { IconSlot } from "../../IconSlot.js";
|
|
5
5
|
import { Text } from "../../Text.js";
|
|
6
|
+
import { useTabConfig } from "./UDSTabConfigProvider.js";
|
|
6
7
|
import { useTabsContext } from "./tabsContext.js";
|
|
7
8
|
import { isValidElement, useId } from "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -14,6 +15,7 @@ function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, c
|
|
|
14
15
|
const generatedId = useId();
|
|
15
16
|
const uid = value ?? `uds-tab-${generatedId}`;
|
|
16
17
|
const { variant, reduceMotion } = useTabsContext();
|
|
18
|
+
const { iconSize } = useTabConfig();
|
|
17
19
|
const store = useTabContext();
|
|
18
20
|
if (!store) throw new Error("Tab must be wrapped in a Tabs component");
|
|
19
21
|
const selectedId = useStoreState(store, "selectedId");
|
|
@@ -52,7 +54,7 @@ function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, c
|
|
|
52
54
|
startIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
53
55
|
icon: startIcon,
|
|
54
56
|
iconProps: {
|
|
55
|
-
size:
|
|
57
|
+
size: iconSize,
|
|
56
58
|
color: "current"
|
|
57
59
|
},
|
|
58
60
|
className: iconConfigClass,
|
|
@@ -68,7 +70,7 @@ function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, c
|
|
|
68
70
|
endIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
69
71
|
icon: endIcon,
|
|
70
72
|
iconProps: {
|
|
71
|
-
size:
|
|
73
|
+
size: iconSize,
|
|
72
74
|
color: "current"
|
|
73
75
|
},
|
|
74
76
|
className: iconConfigClass,
|
|
@@ -0,0 +1,22 @@
|
|
|
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/Tabs/UDSTabConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSTabConfigProvider, useConfigContext } = require("../providers/createUDSConfigProvider.cjs").createUDSConfigProvider("Tab");
|
|
6
|
+
/** The icon size Tab hardcoded before runtime config support. */
|
|
7
|
+
const tabFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured icon size for Tab.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Tab is
|
|
12
|
+
* used in many apps without a `UDSConfigProvider`, so it gracefully falls back
|
|
13
|
+
* to the previously hardcoded icon size (`sm`) when no config is present.
|
|
14
|
+
*/
|
|
15
|
+
const useTabConfig = () => {
|
|
16
|
+
const context = useConfigContext();
|
|
17
|
+
if (!context) return { iconSize: tabFallbackIconSize };
|
|
18
|
+
return { iconSize: context.iconSize[context.defaultSize] };
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.UDSTabConfigProvider = UDSTabConfigProvider;
|
|
22
|
+
exports.useTabConfig = useTabConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconSize } from "../../../types/dist/index.cjs";
|
|
3
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.cjs";
|
|
4
|
+
import { UDSTabConfigContextType } from "../../../runtime/tabConfig.cjs";
|
|
5
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/client/Tabs/UDSTabConfigProvider.d.ts
|
|
8
|
+
declare const UDSTabConfigProvider: {
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
value
|
|
12
|
+
}: UDSConfigProviderProps<UDSTabConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
type UDSTabConfigProviderProps = UDSConfigProviderProps<UDSTabConfigContextType>;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the configured icon size for Tab.
|
|
18
|
+
*
|
|
19
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Tab is
|
|
20
|
+
* used in many apps without a `UDSConfigProvider`, so it gracefully falls back
|
|
21
|
+
* to the previously hardcoded icon size (`sm`) when no config is present.
|
|
22
|
+
*/
|
|
23
|
+
declare const useTabConfig: () => {
|
|
24
|
+
iconSize: IconSize;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type UDSTabConfigContextType, UDSTabConfigProvider, type UDSTabConfigProviderProps, useTabConfig };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { IconSize } from "../../../types/dist/index.js";
|
|
4
|
+
import { UDSConfigProviderProps } from "../providers/createUDSConfigProvider.js";
|
|
5
|
+
import { UDSTabConfigContextType } from "../../../runtime/tabConfig.js";
|
|
6
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region src/components/client/Tabs/UDSTabConfigProvider.d.ts
|
|
9
|
+
declare const UDSTabConfigProvider: {
|
|
10
|
+
({
|
|
11
|
+
children,
|
|
12
|
+
value
|
|
13
|
+
}: UDSConfigProviderProps<UDSTabConfigContextType>): _$react_jsx_runtime0.JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
type UDSTabConfigProviderProps = UDSConfigProviderProps<UDSTabConfigContextType>;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the configured icon size for Tab.
|
|
19
|
+
*
|
|
20
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Tab is
|
|
21
|
+
* used in many apps without a `UDSConfigProvider`, so it gracefully falls back
|
|
22
|
+
* to the previously hardcoded icon size (`sm`) when no config is present.
|
|
23
|
+
*/
|
|
24
|
+
declare const useTabConfig: () => {
|
|
25
|
+
iconSize: IconSize;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { type UDSTabConfigContextType, UDSTabConfigProvider, type UDSTabConfigProviderProps, useTabConfig };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { createUDSConfigProvider } from "../providers/createUDSConfigProvider.js";
|
|
4
|
+
//#region src/components/client/Tabs/UDSTabConfigProvider.tsx
|
|
5
|
+
const { Provider: UDSTabConfigProvider, useConfigContext } = createUDSConfigProvider("Tab");
|
|
6
|
+
/** The icon size Tab hardcoded before runtime config support. */
|
|
7
|
+
const tabFallbackIconSize = "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the configured icon size for Tab.
|
|
10
|
+
*
|
|
11
|
+
* Unlike other UDS config hooks, this hook does not require a provider: Tab is
|
|
12
|
+
* used in many apps without a `UDSConfigProvider`, so it gracefully falls back
|
|
13
|
+
* to the previously hardcoded icon size (`sm`) when no config is present.
|
|
14
|
+
*/
|
|
15
|
+
const useTabConfig = () => {
|
|
16
|
+
const context = useConfigContext();
|
|
17
|
+
if (!context) return { iconSize: tabFallbackIconSize };
|
|
18
|
+
return { iconSize: context.iconSize[context.defaultSize] };
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { UDSTabConfigProvider, useTabConfig };
|
|
@@ -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_Tabs_UDSTabConfigProvider = require("./UDSTabConfigProvider.cjs");
|
|
4
5
|
const require_components_client_Tabs_Tab = require("./Tab.cjs");
|
|
5
6
|
const require_components_client_Tabs_TabList = require("./TabList.cjs");
|
|
6
7
|
const require_components_client_Tabs_TabPanel = require("./TabPanel.cjs");
|
|
@@ -9,3 +10,5 @@ exports.Tab = require_components_client_Tabs_Tab.Tab;
|
|
|
9
10
|
exports.TabList = require_components_client_Tabs_TabList.TabList;
|
|
10
11
|
exports.TabPanel = require_components_client_Tabs_TabPanel.TabPanel;
|
|
11
12
|
exports.Tabs = require_components_client_Tabs_Tabs.Tabs;
|
|
13
|
+
exports.UDSTabConfigProvider = require_components_client_Tabs_UDSTabConfigProvider.UDSTabConfigProvider;
|
|
14
|
+
exports.useTabConfig = require_components_client_Tabs_UDSTabConfigProvider.useTabConfig;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
import { UDSTabConfigContextType } from "../../../runtime/tabConfig.cjs";
|
|
2
3
|
import { Tab, TabProps } from "./Tab.cjs";
|
|
3
4
|
import { TabList, TabListProps } from "./TabList.cjs";
|
|
4
5
|
import { TabPanel, TabPanelProps } from "./TabPanel.cjs";
|
|
5
6
|
import { Tabs, TabsProps } from "./Tabs.cjs";
|
|
6
7
|
import { TabsVariant } from "./tabsContext.cjs";
|
|
7
|
-
|
|
8
|
+
import { UDSTabConfigProvider, UDSTabConfigProviderProps, useTabConfig } from "./UDSTabConfigProvider.cjs";
|
|
9
|
+
export { Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabProps, Tabs, TabsProps, type TabsVariant, UDSTabConfigContextType, UDSTabConfigProvider, UDSTabConfigProviderProps, useTabConfig };
|