@yahoo/uds 3.125.1 → 3.127.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/autoVariants.cjs +60 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +14 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +14 -0
- package/dist/automated-config/dist/generated/autoVariants.js +60 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +5169 -495
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +526 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +526 -1
- package/dist/automated-config/dist/generated/generatedConfigs.js +5167 -496
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +2558 -1490
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +4 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +2558 -1490
- package/dist/automated-config/dist/properties.cjs +12 -0
- package/dist/automated-config/dist/properties.d.cts +4 -0
- package/dist/automated-config/dist/properties.d.ts +4 -0
- package/dist/automated-config/dist/properties.js +12 -0
- 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 +103 -6
- package/dist/automated-config/dist/utils/index.js +103 -6
- package/dist/components/Banner/Banner.cjs +167 -0
- package/dist/components/Banner/Banner.d.cts +56 -0
- package/dist/components/Banner/Banner.d.ts +56 -0
- package/dist/components/Banner/Banner.js +165 -0
- package/dist/components/Banner/BannerContent.cjs +20 -0
- package/dist/components/Banner/BannerContent.d.cts +13 -0
- package/dist/components/Banner/BannerContent.d.ts +13 -0
- package/dist/components/Banner/BannerContent.js +18 -0
- package/dist/components/Banner/BannerDescription.cjs +47 -0
- package/dist/components/Banner/BannerDescription.d.cts +36 -0
- package/dist/components/Banner/BannerDescription.d.ts +36 -0
- package/dist/components/Banner/BannerDescription.js +45 -0
- package/dist/components/Banner/BannerTitle.cjs +42 -0
- package/dist/components/Banner/BannerTitle.d.cts +34 -0
- package/dist/components/Banner/BannerTitle.d.ts +34 -0
- package/dist/components/Banner/BannerTitle.js +40 -0
- package/dist/components/Banner/index.cjs +11 -0
- package/dist/components/Banner/index.d.cts +6 -0
- package/dist/components/Banner/index.d.ts +6 -0
- package/dist/components/Banner/index.js +7 -0
- package/dist/components/Banner/utils.cjs +56 -0
- package/dist/components/Banner/utils.d.cts +26 -0
- package/dist/components/Banner/utils.d.ts +26 -0
- package/dist/components/Banner/utils.js +52 -0
- package/dist/components/Divider/DividerCore.cjs +1 -1
- package/dist/components/Divider/DividerCore.js +1 -1
- package/dist/components/client/Avatar/AvatarIcon.cjs +2 -2
- package/dist/components/client/Avatar/AvatarIcon.js +2 -2
- package/dist/components/client/Avatar/AvatarText.cjs +1 -1
- package/dist/components/client/Avatar/AvatarText.js +1 -1
- package/dist/components/client/Badge.cjs +1 -1
- package/dist/components/client/Badge.js +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.cjs +1 -1
- package/dist/components/client/BottomSheet/BottomSheetHeader.js +1 -1
- package/dist/components/client/Button.cjs +1 -1
- package/dist/components/client/Button.js +1 -1
- package/dist/components/client/Checkbox.cjs +2 -2
- package/dist/components/client/Checkbox.js +2 -2
- package/dist/components/client/Chip/ChipBase.cjs +2 -2
- package/dist/components/client/Chip/ChipBase.js +2 -2
- package/dist/components/client/Chip/ChipDismissible.cjs +2 -2
- package/dist/components/client/Chip/ChipDismissible.js +2 -2
- package/dist/components/client/IconButton.cjs +1 -1
- package/dist/components/client/IconButton.js +1 -1
- package/dist/components/client/Input/Input.cjs +1 -1
- package/dist/components/client/Input/Input.js +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.cjs +1 -1
- package/dist/components/client/Input/InputHelpTextInternal.js +1 -1
- package/dist/components/client/Menu/Menu.ItemBase.cjs +2 -2
- package/dist/components/client/Menu/Menu.ItemBase.js +2 -2
- package/dist/components/client/Menu/Menu.ItemCheckbox.cjs +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.js +1 -1
- package/dist/components/client/Popover/PopoverContent.cjs +3 -3
- package/dist/components/client/Popover/PopoverContent.js +3 -3
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
- package/dist/components/client/Switch.cjs +1 -1
- package/dist/components/client/Switch.js +1 -1
- package/dist/components/client/Tabs/Tab.cjs +80 -0
- package/dist/components/client/Tabs/Tab.d.cts +20 -0
- package/dist/components/client/Tabs/Tab.d.ts +21 -0
- package/dist/components/client/Tabs/Tab.js +78 -0
- package/dist/components/client/Tabs/TabList.cjs +132 -0
- package/dist/components/client/Tabs/TabList.d.cts +9 -0
- package/dist/components/client/Tabs/TabList.d.ts +10 -0
- package/dist/components/client/Tabs/TabList.js +130 -0
- package/dist/components/client/Tabs/TabPanel.cjs +22 -0
- package/dist/components/client/Tabs/TabPanel.d.cts +9 -0
- package/dist/components/client/Tabs/TabPanel.d.ts +10 -0
- package/dist/components/client/Tabs/TabPanel.js +20 -0
- package/dist/components/client/Tabs/Tabs.cjs +53 -0
- package/dist/components/client/Tabs/Tabs.d.cts +45 -0
- package/dist/components/client/Tabs/Tabs.d.ts +46 -0
- package/dist/components/client/Tabs/Tabs.js +51 -0
- package/dist/components/client/Tabs/index.cjs +12 -0
- package/dist/components/client/Tabs/index.d.cts +7 -0
- package/dist/components/client/Tabs/index.d.ts +8 -0
- package/dist/components/client/Tabs/index.js +8 -0
- package/dist/components/client/Tabs/tabsContext.cjs +18 -0
- package/dist/components/client/Tabs/tabsContext.d.cts +15 -0
- package/dist/components/client/Tabs/tabsContext.d.ts +16 -0
- package/dist/components/client/Tabs/tabsContext.js +15 -0
- package/dist/components/client/Toast/Toast.cjs +3 -3
- package/dist/components/client/Toast/Toast.js +3 -3
- package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +5 -5
- package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +5 -5
- package/dist/components/client/Tooltip/TooltipContent.cjs +2 -2
- package/dist/components/client/Tooltip/TooltipContent.js +2 -2
- package/dist/components/client/index.cjs +9 -1
- package/dist/components/client/index.d.cts +7 -1
- package/dist/components/client/index.d.ts +7 -1
- package/dist/components/client/index.js +6 -2
- package/dist/components/experimental/Spinner.cjs +1 -1
- package/dist/components/experimental/Spinner.js +1 -1
- package/dist/components/experimental/Table.cjs +1 -1
- package/dist/components/experimental/Table.js +1 -1
- package/dist/components/experimental/client/Accordion.cjs +4 -4
- package/dist/components/experimental/client/Accordion.js +4 -4
- package/dist/components/experimental/client/Modal.cjs +2 -2
- package/dist/components/experimental/client/Modal.js +2 -2
- package/dist/components/experimental/client/SegmentedControl.cjs +3 -3
- package/dist/components/experimental/client/SegmentedControl.js +3 -3
- package/dist/components/experimental/client/SwitchV2.cjs +1 -1
- package/dist/components/experimental/client/SwitchV2.js +1 -1
- package/dist/components/experimental/client/index.cjs +0 -5
- package/dist/components/experimental/client/index.d.cts +1 -2
- package/dist/components/experimental/client/index.d.ts +1 -2
- package/dist/components/experimental/client/index.js +1 -2
- package/dist/components/experimental/index.cjs +0 -9
- package/dist/components/experimental/index.d.cts +1 -2
- package/dist/components/experimental/index.d.ts +1 -2
- package/dist/components/experimental/index.js +1 -6
- package/dist/components/index.cjs +27 -3
- package/dist/components/index.d.cts +11 -1
- package/dist/components/index.d.ts +11 -1
- package/dist/components/index.js +20 -4
- package/dist/config/dist/index.cjs +1496 -339
- package/dist/config/dist/index.js +1496 -339
- package/dist/index.cjs +22 -3
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +13 -5
- package/dist/styles/styler.d.cts +107 -93
- package/dist/styles/styler.d.ts +107 -93
- package/dist/styles/variants.d.cts +74 -0
- package/dist/styles/variants.d.ts +74 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.cjs +60 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.js +60 -0
- package/dist/tailwind/dist/automated-config/dist/generated/autoVariants.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.cjs +5169 -495
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.js +5167 -496
- package/dist/tailwind/dist/automated-config/dist/generated/generatedConfigs.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/properties.cjs +12 -0
- package/dist/tailwind/dist/automated-config/dist/properties.js +12 -0
- package/dist/tailwind/dist/automated-config/dist/properties.js.map +1 -1
- package/dist/tailwind/dist/automated-config/dist/utils/index.cjs +103 -6
- package/dist/tailwind/dist/automated-config/dist/utils/index.js +103 -6
- package/dist/tailwind/dist/automated-config/dist/utils/index.js.map +1 -1
- package/dist/tailwind/dist/config/dist/index.cjs +1496 -339
- package/dist/tailwind/dist/config/dist/index.js +1496 -339
- package/dist/tailwind/dist/config/dist/index.js.map +1 -1
- package/dist/tailwind/dist/css/utils.cjs +3 -1
- package/dist/tailwind/dist/css/utils.js +3 -1
- package/dist/tailwind/dist/css/utils.js.map +1 -1
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +36 -2
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +36 -2
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js.map +1 -1
- package/dist/tailwind/dist/tailwind/plugins/components.cjs +3 -0
- package/dist/tailwind/dist/tailwind/plugins/components.js +4 -1
- package/dist/tailwind/dist/tailwind/plugins/components.js.map +1 -1
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.cts +4 -4
- package/dist/tailwind/dist/tailwind/utils/getShadowStyles.d.ts +4 -4
- package/dist/tailwind/dist/types/dist/index.d.cts.map +1 -1
- package/dist/tailwind/dist/types/dist/index.d.ts.map +1 -1
- package/dist/tokens/automation/configs/index.cjs +3 -0
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +3 -0
- package/dist/tokens/automation/index.d.cts +2 -2
- package/dist/tokens/automation/index.d.ts +2 -2
- package/dist/tokens/automation/index.js +2 -2
- package/dist/tokens/index.cjs +3 -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/types/dist/index.d.cts +70 -1
- package/dist/types/dist/index.d.ts +70 -1
- package/dist/uds/generated/componentData.cjs +1030 -774
- package/dist/uds/generated/componentData.js +893 -679
- package/dist/uds/generated/tailwindPurge.cjs +41 -43
- package/dist/uds/generated/tailwindPurge.js +41 -43
- package/generated/componentData.json +1693 -1432
- package/generated/tailwindPurge.ts +4 -4
- package/package.json +1 -1
- package/dist/components/experimental/client/Tabs.cjs +0 -76
- package/dist/components/experimental/client/Tabs.d.cts +0 -31
- package/dist/components/experimental/client/Tabs.d.ts +0 -32
- package/dist/components/experimental/client/Tabs.js +0 -71
|
@@ -9,9 +9,9 @@ const require_generateDefaultClassName = require('../../automated-config/dist/ut
|
|
|
9
9
|
const require_components_client_buttonConstants = require('./buttonConstants.cjs');
|
|
10
10
|
const require_components_client_SpringMotionConfig = require('./SpringMotionConfig.cjs');
|
|
11
11
|
const require_components_client_Button = require('./Button.cjs');
|
|
12
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
12
13
|
let react = require("react");
|
|
13
14
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
15
15
|
let motion_react = require("motion/react");
|
|
16
16
|
|
|
17
17
|
//#region src/components/client/IconButton.tsx
|
|
@@ -7,9 +7,9 @@ import { generateDefaultClassName } from "../../automated-config/dist/utils/gene
|
|
|
7
7
|
import { buttonIconSvgSize } from "./buttonConstants.js";
|
|
8
8
|
import { SpringMotionConfig } from "./SpringMotionConfig.js";
|
|
9
9
|
import { iconMotionVariants, loadingMotionVariants } from "./Button.js";
|
|
10
|
+
import { Progress } from "@yahoo/uds-icons";
|
|
10
11
|
import { forwardRef, useImperativeHandle, useMemo, useRef } from "react";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { Progress } from "@yahoo/uds-icons";
|
|
13
13
|
import { AnimatePresence, m, useReducedMotion } from "motion/react";
|
|
14
14
|
|
|
15
15
|
//#region src/components/client/IconButton.tsx
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
+
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
6
7
|
const require_components_Box = require('../../Box.cjs');
|
|
7
8
|
const require_components_HStack = require('../../HStack.cjs');
|
|
8
9
|
const require_components_VStack = require('../../VStack.cjs');
|
|
9
|
-
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
10
10
|
const require_components_client_AnimateHeightChange = require('../AnimateHeightChange.cjs');
|
|
11
11
|
const require_components_client_Input_InputHelpTextInternal = require('./InputHelpTextInternal.cjs');
|
|
12
12
|
let react = require("react");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
+
import { IconSlot } from "../../IconSlot.js";
|
|
4
5
|
import { Box } from "../../Box.js";
|
|
5
6
|
import { HStack } from "../../HStack.js";
|
|
6
7
|
import { VStack } from "../../VStack.js";
|
|
7
|
-
import { IconSlot } from "../../IconSlot.js";
|
|
8
8
|
import { AnimateHeightChange } from "../AnimateHeightChange.js";
|
|
9
9
|
import { InputHelpTextInternal as InputHelpTextInternalMemo } from "./InputHelpTextInternal.js";
|
|
10
10
|
import { forwardRef, memo, useCallback, useId, useImperativeHandle, useRef, useState } from "react";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
-
const require_components_HStack = require('../../HStack.cjs');
|
|
7
6
|
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
7
|
+
const require_components_HStack = require('../../HStack.cjs');
|
|
8
8
|
let react = require("react");
|
|
9
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
-
import { HStack } from "../../HStack.js";
|
|
5
4
|
import { IconSlot } from "../../IconSlot.js";
|
|
5
|
+
import { HStack } from "../../HStack.js";
|
|
6
6
|
import { forwardRef, memo } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
-
const require_components_HStack = require('../../HStack.cjs');
|
|
7
|
-
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
8
6
|
const require_components_client_Pressable = require('../Pressable.cjs');
|
|
7
|
+
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
8
|
+
const require_components_HStack = require('../../HStack.cjs');
|
|
9
9
|
let react = require("react");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
let motion_react = require("motion/react");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
-
import { HStack } from "../../HStack.js";
|
|
5
|
-
import { IconSlot } from "../../IconSlot.js";
|
|
6
4
|
import { Pressable } from "../Pressable.js";
|
|
5
|
+
import { IconSlot } from "../../IconSlot.js";
|
|
6
|
+
import { HStack } from "../../HStack.js";
|
|
7
7
|
import { Children, forwardRef, useMemo } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { AnimatePresence, m } from "motion/react";
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
6
|
const require_components_client_Menu_Menu_ItemBase = require('./Menu.ItemBase.cjs');
|
|
7
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
7
8
|
let react = require("react");
|
|
8
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
10
10
|
let _ariakit_react = require("@ariakit/react");
|
|
11
11
|
let _ariakit_react_menu = require("@ariakit/react/menu");
|
|
12
12
|
|
|
@@ -88,6 +88,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
|
|
|
88
88
|
*
|
|
89
89
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
|
90
90
|
**/
|
|
91
|
-
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "
|
|
91
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "rootProps" | "hideEndIcon" | "active"> & react.RefAttributes<HTMLDivElement>>;
|
|
92
92
|
//#endregion
|
|
93
93
|
export { MenuItemCheckbox, type MenuItemCheckboxProps };
|
|
@@ -89,6 +89,6 @@ interface MenuItemCheckboxProps extends Omit<PressableProps, 'asChild'>, HtmlBut
|
|
|
89
89
|
*
|
|
90
90
|
* @related [Menu](https://uds.build/docs/components/menu), [Menu.Item](https://uds.build/docs/components/menu-item)
|
|
91
91
|
**/
|
|
92
|
-
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "
|
|
92
|
+
declare const MenuItemCheckbox: react.ForwardRefExoticComponent<Omit<MenuItemCheckboxProps, "rootProps" | "hideEndIcon" | "active"> & react.RefAttributes<HTMLDivElement>>;
|
|
93
93
|
//#endregion
|
|
94
94
|
export { MenuItemCheckbox, type MenuItemCheckboxProps };
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
4
|
import { MenuItemBase } from "./Menu.ItemBase.js";
|
|
5
|
+
import { Check } from "@yahoo/uds-icons";
|
|
5
6
|
import { forwardRef, useCallback, useEffect, useMemo, useRef } from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
import { Check } from "@yahoo/uds-icons";
|
|
8
8
|
import { useStoreState } from "@ariakit/react";
|
|
9
9
|
import { MenuItemCheckbox as MenuItemCheckbox$2, useMenuContext } from "@ariakit/react/menu";
|
|
10
10
|
|
|
@@ -4,18 +4,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_index = require('../../../fixtures/dist/index.cjs');
|
|
6
6
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
7
|
-
const require_components_Box = require('../../Box.cjs');
|
|
8
|
-
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
9
7
|
const require_components_client_Pressable = require('../Pressable.cjs');
|
|
8
|
+
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
9
|
+
const require_components_Box = require('../../Box.cjs');
|
|
10
10
|
const require_components_client_Popover_PopoverContext = require('./PopoverContext.cjs');
|
|
11
11
|
const require_components_client_Popover_UDSPopoverConfigProvider = require('./UDSPopoverConfigProvider.cjs');
|
|
12
12
|
const require_hooks_useForkRef = require('../../../hooks/useForkRef.cjs');
|
|
13
13
|
const require_hooks_useSvgFloatingContent = require('../../../hooks/useSvgFloatingContent.cjs');
|
|
14
14
|
const require_utils_getUnscaledAnchorRect = require('../../../utils/getUnscaledAnchorRect.cjs');
|
|
15
15
|
const require_components_SvgFloatingOverlay = require('../../SvgFloatingOverlay.cjs');
|
|
16
|
+
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
16
17
|
let react = require("react");
|
|
17
18
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
18
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
19
19
|
let _ariakit_react = require("@ariakit/react");
|
|
20
20
|
|
|
21
21
|
//#region src/components/client/Popover/PopoverContent.tsx
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { spacingMap } from "../../../fixtures/dist/index.js";
|
|
4
4
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
5
|
-
import { Box } from "../../Box.js";
|
|
6
|
-
import { IconSlot } from "../../IconSlot.js";
|
|
7
5
|
import { Pressable } from "../Pressable.js";
|
|
6
|
+
import { IconSlot } from "../../IconSlot.js";
|
|
7
|
+
import { Box } from "../../Box.js";
|
|
8
8
|
import { PopoverInternalContext } from "./PopoverContext.js";
|
|
9
9
|
import { usePopoverConfig } from "./UDSPopoverConfigProvider.js";
|
|
10
10
|
import { useForkRef } from "../../../hooks/useForkRef.js";
|
|
11
11
|
import { useSvgFloatingContent } from "../../../hooks/useSvgFloatingContent.js";
|
|
12
12
|
import { getUnscaledAnchorRect } from "../../../utils/getUnscaledAnchorRect.js";
|
|
13
13
|
import { SvgFloatingOverlay } from "../../SvgFloatingOverlay.js";
|
|
14
|
+
import { Cross } from "@yahoo/uds-icons";
|
|
14
15
|
import { forwardRef, useContext, useRef } from "react";
|
|
15
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
import { Cross } from "@yahoo/uds-icons";
|
|
17
17
|
import { Popover, PopoverArrow, PopoverDismiss, usePopoverContext, useStoreState } from "@ariakit/react";
|
|
18
18
|
|
|
19
19
|
//#region src/components/client/Popover/PopoverContent.tsx
|
|
@@ -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
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
5
5
|
const require_styles_styler = require('../../styles/styler.cjs');
|
|
6
|
+
const require_components_IconSlot = require('../IconSlot.cjs');
|
|
6
7
|
const require_components_Box = require('../Box.cjs');
|
|
7
8
|
const require_components_FormLabel = require('../FormLabel.cjs');
|
|
8
|
-
const require_components_IconSlot = require('../IconSlot.cjs');
|
|
9
9
|
const require_components_client_SpringMotionConfig = require('./SpringMotionConfig.cjs');
|
|
10
10
|
let react = require("react");
|
|
11
11
|
react = require_runtime.__toESM(react);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
3
|
import { cx, getStyles } from "../../styles/styler.js";
|
|
4
|
+
import { IconSlot } from "../IconSlot.js";
|
|
4
5
|
import { Box } from "../Box.js";
|
|
5
6
|
import { FormLabel } from "../FormLabel.js";
|
|
6
|
-
import { IconSlot } from "../IconSlot.js";
|
|
7
7
|
import { SpringMotionConfig } from "./SpringMotionConfig.js";
|
|
8
8
|
import React, { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
+
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
+
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
7
|
+
const require_components_Text = require('../../Text.cjs');
|
|
8
|
+
const require_components_client_Tabs_tabsContext = require('./tabsContext.cjs');
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let _ariakit_react = require("@ariakit/react");
|
|
12
|
+
|
|
13
|
+
//#region src/components/client/Tabs/Tab.tsx
|
|
14
|
+
/** Matches {@link TabList} sliding-indicator underline (token CSS variables on the tab root). */
|
|
15
|
+
const tabRootUnderlineClassName = require_styles_styler.cx("pointer-events-none absolute bottom-0 left-0 right-0", "h-[var(--uds-tab-underline-width,0px)] bg-[var(--uds-tab-underline-color,transparent)]", "transition-[height,background-color] duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]");
|
|
16
|
+
function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, className }) {
|
|
17
|
+
const generatedId = (0, react.useId)();
|
|
18
|
+
const uid = value ?? `uds-tab-${generatedId}`;
|
|
19
|
+
const { variant, disableMotion } = require_components_client_Tabs_tabsContext.useTabsContext();
|
|
20
|
+
const store = (0, _ariakit_react.useTabContext)();
|
|
21
|
+
if (!store) throw new Error("Tab must be wrapped in a Tabs component");
|
|
22
|
+
const selectedId = (0, _ariakit_react.useStoreState)(store, "selectedId");
|
|
23
|
+
const activeState = disabled || selectedId !== uid ? "off" : "on";
|
|
24
|
+
const rootBaseClass = require_styles_styler.getStyles({
|
|
25
|
+
tabSizeRoot: "default",
|
|
26
|
+
tabVariantRoot: variant,
|
|
27
|
+
tabVariantActiveRoot: "off"
|
|
28
|
+
});
|
|
29
|
+
const rootOnClass = require_styles_styler.getStyles({
|
|
30
|
+
tabSizeRoot: "default",
|
|
31
|
+
tabVariantRoot: variant,
|
|
32
|
+
tabVariantActiveRoot: "on"
|
|
33
|
+
});
|
|
34
|
+
const configClass = activeState === "on" ? require_styles_styler.cx(rootOnClass, !disableMotion && require_styles_styler.cx("!bg-transparent", "!shadow-none")) : rootBaseClass;
|
|
35
|
+
const iconConfigClass = require_styles_styler.getStyles({
|
|
36
|
+
tabSizeIcon: "default",
|
|
37
|
+
tabVariantIcon: variant,
|
|
38
|
+
tabVariantActiveIcon: activeState
|
|
39
|
+
});
|
|
40
|
+
const tabClass = require_styles_styler.cx(configClass, "inline-flex items-center shrink-0 box-border relative", !disableMotion && "z-[1]", "cursor-pointer select-none whitespace-nowrap", !disabled && "uds-ring", disabled && "opacity-50 cursor-default pointer-events-none", "border-solid border-b-solid", "transition-colors duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]", className);
|
|
41
|
+
const resolvedContent = asChild && (0, react.isValidElement)(children) ? children.props.children ?? null : children;
|
|
42
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ariakit_react.Tab, {
|
|
43
|
+
id: uid,
|
|
44
|
+
disabled,
|
|
45
|
+
className: tabClass,
|
|
46
|
+
render: asChild && (0, react.isValidElement)(children) ? children : void 0,
|
|
47
|
+
children: [
|
|
48
|
+
!(activeState === "on" && !disableMotion) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
className: tabRootUnderlineClassName
|
|
51
|
+
}) : null,
|
|
52
|
+
startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
53
|
+
icon: startIcon,
|
|
54
|
+
iconProps: {
|
|
55
|
+
size: "sm",
|
|
56
|
+
color: "current"
|
|
57
|
+
},
|
|
58
|
+
className: iconConfigClass
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
61
|
+
variant: "inherit",
|
|
62
|
+
as: "span",
|
|
63
|
+
color: "current",
|
|
64
|
+
children: resolvedContent
|
|
65
|
+
}),
|
|
66
|
+
endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
67
|
+
icon: endIcon,
|
|
68
|
+
iconProps: {
|
|
69
|
+
size: "sm",
|
|
70
|
+
color: "current"
|
|
71
|
+
},
|
|
72
|
+
className: iconConfigClass
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
Tab.displayName = "Tab";
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
exports.Tab = Tab;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabProps } from "../../../types/dist/index.cjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/client/Tabs/Tab.d.ts
|
|
6
|
+
type TabProps = UniversalTabProps;
|
|
7
|
+
declare function Tab({
|
|
8
|
+
value,
|
|
9
|
+
children,
|
|
10
|
+
startIcon,
|
|
11
|
+
endIcon,
|
|
12
|
+
disabled,
|
|
13
|
+
asChild,
|
|
14
|
+
className
|
|
15
|
+
}: TabProps): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
declare namespace Tab {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Tab, type TabProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { UniversalTabProps } from "../../../types/dist/index.js";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/client/Tabs/Tab.d.ts
|
|
7
|
+
type TabProps = UniversalTabProps;
|
|
8
|
+
declare function Tab({
|
|
9
|
+
value,
|
|
10
|
+
children,
|
|
11
|
+
startIcon,
|
|
12
|
+
endIcon,
|
|
13
|
+
disabled,
|
|
14
|
+
asChild,
|
|
15
|
+
className
|
|
16
|
+
}: TabProps): react_jsx_runtime0.JSX.Element;
|
|
17
|
+
declare namespace Tab {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Tab, type TabProps };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
|
+
import { IconSlot } from "../../IconSlot.js";
|
|
5
|
+
import { Text } from "../../Text.js";
|
|
6
|
+
import { useTabsContext } from "./tabsContext.js";
|
|
7
|
+
import { isValidElement, useId } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Tab as Tab$1, useStoreState, useTabContext } from "@ariakit/react";
|
|
10
|
+
|
|
11
|
+
//#region src/components/client/Tabs/Tab.tsx
|
|
12
|
+
/** Matches {@link TabList} sliding-indicator underline (token CSS variables on the tab root). */
|
|
13
|
+
const tabRootUnderlineClassName = cx("pointer-events-none absolute bottom-0 left-0 right-0", "h-[var(--uds-tab-underline-width,0px)] bg-[var(--uds-tab-underline-color,transparent)]", "transition-[height,background-color] duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]");
|
|
14
|
+
function Tab({ value, children, startIcon, endIcon, disabled, asChild = false, className }) {
|
|
15
|
+
const generatedId = useId();
|
|
16
|
+
const uid = value ?? `uds-tab-${generatedId}`;
|
|
17
|
+
const { variant, disableMotion } = useTabsContext();
|
|
18
|
+
const store = useTabContext();
|
|
19
|
+
if (!store) throw new Error("Tab must be wrapped in a Tabs component");
|
|
20
|
+
const selectedId = useStoreState(store, "selectedId");
|
|
21
|
+
const activeState = disabled || selectedId !== uid ? "off" : "on";
|
|
22
|
+
const rootBaseClass = getStyles({
|
|
23
|
+
tabSizeRoot: "default",
|
|
24
|
+
tabVariantRoot: variant,
|
|
25
|
+
tabVariantActiveRoot: "off"
|
|
26
|
+
});
|
|
27
|
+
const rootOnClass = getStyles({
|
|
28
|
+
tabSizeRoot: "default",
|
|
29
|
+
tabVariantRoot: variant,
|
|
30
|
+
tabVariantActiveRoot: "on"
|
|
31
|
+
});
|
|
32
|
+
const configClass = activeState === "on" ? cx(rootOnClass, !disableMotion && cx("!bg-transparent", "!shadow-none")) : rootBaseClass;
|
|
33
|
+
const iconConfigClass = getStyles({
|
|
34
|
+
tabSizeIcon: "default",
|
|
35
|
+
tabVariantIcon: variant,
|
|
36
|
+
tabVariantActiveIcon: activeState
|
|
37
|
+
});
|
|
38
|
+
const tabClass = cx(configClass, "inline-flex items-center shrink-0 box-border relative", !disableMotion && "z-[1]", "cursor-pointer select-none whitespace-nowrap", !disabled && "uds-ring", disabled && "opacity-50 cursor-default pointer-events-none", "border-solid border-b-solid", "transition-colors duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]", className);
|
|
39
|
+
const resolvedContent = asChild && isValidElement(children) ? children.props.children ?? null : children;
|
|
40
|
+
return /* @__PURE__ */ jsxs(Tab$1, {
|
|
41
|
+
id: uid,
|
|
42
|
+
disabled,
|
|
43
|
+
className: tabClass,
|
|
44
|
+
render: asChild && isValidElement(children) ? children : void 0,
|
|
45
|
+
children: [
|
|
46
|
+
!(activeState === "on" && !disableMotion) ? /* @__PURE__ */ jsx("div", {
|
|
47
|
+
"aria-hidden": true,
|
|
48
|
+
className: tabRootUnderlineClassName
|
|
49
|
+
}) : null,
|
|
50
|
+
startIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
51
|
+
icon: startIcon,
|
|
52
|
+
iconProps: {
|
|
53
|
+
size: "sm",
|
|
54
|
+
color: "current"
|
|
55
|
+
},
|
|
56
|
+
className: iconConfigClass
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsx(Text, {
|
|
59
|
+
variant: "inherit",
|
|
60
|
+
as: "span",
|
|
61
|
+
color: "current",
|
|
62
|
+
children: resolvedContent
|
|
63
|
+
}),
|
|
64
|
+
endIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
65
|
+
icon: endIcon,
|
|
66
|
+
iconProps: {
|
|
67
|
+
size: "sm",
|
|
68
|
+
color: "current"
|
|
69
|
+
},
|
|
70
|
+
className: iconConfigClass
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
Tab.displayName = "Tab";
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { Tab };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
+
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
|
+
const require_components_client_Tabs_tabsContext = require('./tabsContext.cjs');
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _ariakit_react = require("@ariakit/react");
|
|
10
|
+
let motion_react = require("motion/react");
|
|
11
|
+
|
|
12
|
+
//#region src/components/client/Tabs/TabList.tsx
|
|
13
|
+
/** Matches {@link Tab} per-tab underline (token CSS variables on the indicator root). */
|
|
14
|
+
const tabRootUnderlineClassName = require_styles_styler.cx("pointer-events-none absolute bottom-0 left-0 right-0", "h-[var(--uds-tab-underline-width,0px)] bg-[var(--uds-tab-underline-color,transparent)]", "transition-[height,background-color] duration-[240ms] ease-[cubic-bezier(0.2,0,0,1)]");
|
|
15
|
+
const SELECTION_TRANSITION = "left 240ms cubic-bezier(0.2, 0, 0, 1), top 240ms cubic-bezier(0.2, 0, 0, 1), width 240ms cubic-bezier(0.2, 0, 0, 1), height 240ms cubic-bezier(0.2, 0, 0, 1)";
|
|
16
|
+
/** Token vars set on {@link Tab} roots; the sliding indicator is a sibling, so it must mirror the selected tab's computed values (incl. :hover / :active). */
|
|
17
|
+
const TAB_UNDERLINE_COLOR_VAR = "--uds-tab-underline-color";
|
|
18
|
+
const TAB_UNDERLINE_WIDTH_VAR = "--uds-tab-underline-width";
|
|
19
|
+
const TabList = (0, react.forwardRef)(function TabList({ children, scrollable, className, ...props }, ref) {
|
|
20
|
+
const { variant, disableMotion } = require_components_client_Tabs_tabsContext.useTabsContext();
|
|
21
|
+
const selectedId = (0, _ariakit_react.useStoreState)((0, _ariakit_react.useTabContext)(), "selectedId");
|
|
22
|
+
const listRef = (0, react.useRef)(null);
|
|
23
|
+
const indicatorRef = (0, react.useRef)(null);
|
|
24
|
+
const skipNextTransitionRef = (0, react.useRef)(true);
|
|
25
|
+
const reducedMotion = (0, motion_react.useReducedMotion)();
|
|
26
|
+
const applyIndicator = (0, react.useCallback)(() => {
|
|
27
|
+
const listEl = listRef.current;
|
|
28
|
+
const indicatorEl = indicatorRef.current;
|
|
29
|
+
if (!listEl || !indicatorEl || disableMotion) return;
|
|
30
|
+
const selected = listEl.querySelector("[role=\"tab\"][aria-selected=\"true\"]:not([aria-disabled=\"true\"])");
|
|
31
|
+
if (!selected) {
|
|
32
|
+
indicatorEl.style.opacity = "0";
|
|
33
|
+
indicatorEl.style.transition = "none";
|
|
34
|
+
indicatorEl.style.removeProperty(TAB_UNDERLINE_COLOR_VAR);
|
|
35
|
+
indicatorEl.style.removeProperty(TAB_UNDERLINE_WIDTH_VAR);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const listRect = listEl.getBoundingClientRect();
|
|
39
|
+
const tabRect = selected.getBoundingClientRect();
|
|
40
|
+
const skipTransition = skipNextTransitionRef.current || reducedMotion;
|
|
41
|
+
skipNextTransitionRef.current = false;
|
|
42
|
+
indicatorEl.style.left = `${tabRect.left - listRect.left + listEl.scrollLeft}px`;
|
|
43
|
+
indicatorEl.style.top = `${tabRect.top - listRect.top + listEl.scrollTop}px`;
|
|
44
|
+
indicatorEl.style.width = `${tabRect.width}px`;
|
|
45
|
+
indicatorEl.style.height = `${tabRect.height}px`;
|
|
46
|
+
indicatorEl.style.opacity = "1";
|
|
47
|
+
indicatorEl.style.transition = skipTransition ? "none" : SELECTION_TRANSITION;
|
|
48
|
+
const cs = getComputedStyle(selected);
|
|
49
|
+
const underlineColor = cs.getPropertyValue(TAB_UNDERLINE_COLOR_VAR).trim();
|
|
50
|
+
const underlineWidth = cs.getPropertyValue(TAB_UNDERLINE_WIDTH_VAR).trim();
|
|
51
|
+
if (underlineColor) indicatorEl.style.setProperty(TAB_UNDERLINE_COLOR_VAR, underlineColor);
|
|
52
|
+
else indicatorEl.style.removeProperty(TAB_UNDERLINE_COLOR_VAR);
|
|
53
|
+
if (underlineWidth) indicatorEl.style.setProperty(TAB_UNDERLINE_WIDTH_VAR, underlineWidth);
|
|
54
|
+
else indicatorEl.style.removeProperty(TAB_UNDERLINE_WIDTH_VAR);
|
|
55
|
+
}, [disableMotion, reducedMotion]);
|
|
56
|
+
(0, react.useLayoutEffect)(() => {
|
|
57
|
+
applyIndicator();
|
|
58
|
+
}, [selectedId, applyIndicator]);
|
|
59
|
+
(0, react.useLayoutEffect)(() => {
|
|
60
|
+
if (disableMotion) return;
|
|
61
|
+
const listEl = listRef.current;
|
|
62
|
+
if (!listEl) return;
|
|
63
|
+
const ro = new ResizeObserver(() => applyIndicator());
|
|
64
|
+
ro.observe(listEl);
|
|
65
|
+
const onScroll = () => applyIndicator();
|
|
66
|
+
listEl.addEventListener("scroll", onScroll, { passive: true });
|
|
67
|
+
window.addEventListener("resize", applyIndicator);
|
|
68
|
+
return () => {
|
|
69
|
+
ro.disconnect();
|
|
70
|
+
listEl.removeEventListener("scroll", onScroll);
|
|
71
|
+
window.removeEventListener("resize", applyIndicator);
|
|
72
|
+
};
|
|
73
|
+
}, [disableMotion, applyIndicator]);
|
|
74
|
+
/** Re-sync underline tokens when the selected tab's hover/pressed state changes (indicator does not receive those pseudos). */
|
|
75
|
+
(0, react.useLayoutEffect)(() => {
|
|
76
|
+
if (disableMotion) return;
|
|
77
|
+
const listEl = listRef.current;
|
|
78
|
+
if (!listEl) return;
|
|
79
|
+
const selected = listEl.querySelector("[role=\"tab\"][aria-selected=\"true\"]:not([aria-disabled=\"true\"])");
|
|
80
|
+
if (!selected) return;
|
|
81
|
+
const bump = () => applyIndicator();
|
|
82
|
+
const events = [
|
|
83
|
+
"mouseenter",
|
|
84
|
+
"mouseleave",
|
|
85
|
+
"mousedown",
|
|
86
|
+
"mouseup",
|
|
87
|
+
"pointerdown",
|
|
88
|
+
"pointerup"
|
|
89
|
+
];
|
|
90
|
+
events.forEach((e) => selected.addEventListener(e, bump));
|
|
91
|
+
return () => events.forEach((e) => selected.removeEventListener(e, bump));
|
|
92
|
+
}, [
|
|
93
|
+
selectedId,
|
|
94
|
+
disableMotion,
|
|
95
|
+
applyIndicator
|
|
96
|
+
]);
|
|
97
|
+
const setListRef = (el) => {
|
|
98
|
+
listRef.current = el;
|
|
99
|
+
if (typeof ref === "function") ref(el);
|
|
100
|
+
else if (ref) ref.current = el;
|
|
101
|
+
};
|
|
102
|
+
const tablistConfigClass = require_styles_styler.getStyles({ tabsVariantRoot: variant });
|
|
103
|
+
const indicatorClass = require_styles_styler.cx(require_styles_styler.getStyles({
|
|
104
|
+
tabSizeRoot: "default",
|
|
105
|
+
tabVariantRoot: variant,
|
|
106
|
+
tabVariantActiveRoot: "on"
|
|
107
|
+
}), "!m-0 !p-0 !gap-0 box-border pointer-events-none", "absolute z-0 min-w-0 min-h-0");
|
|
108
|
+
const styles = require_styles_styler.cx(tablistConfigClass, "flex flex-row items-center", scrollable ? "overflow-x-auto overflow-y-clip scrollbar-none [overflow-clip-margin:6px]" : "overflow-clip [overflow-clip-margin:8px]", !disableMotion && "relative", className);
|
|
109
|
+
const indicatorBoxStyle = !disableMotion ? {
|
|
110
|
+
opacity: 0,
|
|
111
|
+
transition: "none"
|
|
112
|
+
} : {};
|
|
113
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ariakit_react.TabList, {
|
|
114
|
+
ref: setListRef,
|
|
115
|
+
className: styles,
|
|
116
|
+
...props,
|
|
117
|
+
children: [!disableMotion ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
118
|
+
ref: indicatorRef,
|
|
119
|
+
className: indicatorClass,
|
|
120
|
+
style: indicatorBoxStyle,
|
|
121
|
+
"aria-hidden": true,
|
|
122
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
123
|
+
"aria-hidden": true,
|
|
124
|
+
className: tabRootUnderlineClassName
|
|
125
|
+
})
|
|
126
|
+
}) : null, children]
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
TabList.displayName = "TabList";
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
exports.TabList = TabList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalTabListProps } from "../../../types/dist/index.cjs";
|
|
3
|
+
import * as react from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/client/Tabs/TabList.d.ts
|
|
6
|
+
type TabListProps = UniversalTabListProps;
|
|
7
|
+
declare const TabList: react.ForwardRefExoticComponent<UniversalTabListProps & react.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { TabList, type TabListProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";
|
|
3
|
+
import { UniversalTabListProps } from "../../../types/dist/index.js";
|
|
4
|
+
import * as react from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/client/Tabs/TabList.d.ts
|
|
7
|
+
type TabListProps = UniversalTabListProps;
|
|
8
|
+
declare const TabList: react.ForwardRefExoticComponent<UniversalTabListProps & react.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { TabList, type TabListProps };
|