@yahoo/uds 3.169.1 → 3.171.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/autoVariantTemplates.cjs +218 -0
- package/dist/automated-config/dist/generated/autoVariantTemplates.js +218 -0
- package/dist/components/IconSlot.cjs +1 -1
- package/dist/components/IconSlot.js +1 -1
- package/dist/components/client/Button/Button.cjs +1 -1
- package/dist/components/client/Button/Button.js +1 -1
- package/dist/components/client/IconButton/IconButton.cjs +1 -1
- package/dist/components/client/IconButton/IconButton.js +1 -1
- package/dist/components/client/Menu/Menu.Content.cjs +1 -1
- package/dist/components/client/Menu/Menu.Content.d.cts +6 -0
- package/dist/components/client/Menu/Menu.Content.d.ts +6 -0
- package/dist/components/client/Menu/Menu.Content.js +1 -1
- package/dist/components/client/Modal/Modal.cjs +5 -5
- package/dist/components/client/Modal/Modal.d.cts +1 -0
- package/dist/components/client/Modal/Modal.d.ts +1 -0
- package/dist/components/client/Modal/Modal.js +6 -6
- package/dist/components/client/Popover/Popover.cjs +3 -2
- package/dist/components/client/Popover/Popover.d.cts +2 -1
- package/dist/components/client/Popover/Popover.d.ts +2 -1
- package/dist/components/client/Popover/Popover.js +3 -2
- package/dist/components/client/Popover/PopoverContent.cjs +2 -1
- package/dist/components/client/Popover/PopoverContent.js +2 -1
- package/dist/components/client/Popover/PopoverContext.d.cts +1 -0
- package/dist/components/client/Popover/PopoverContext.d.ts +1 -0
- package/dist/components/client/Popover/PopoverTrigger.cjs +9 -2
- package/dist/components/client/Popover/PopoverTrigger.js +10 -3
- package/dist/components/client/Tooltip/Tooltip.cjs +6 -2
- package/dist/components/client/Tooltip/Tooltip.d.cts +5 -1
- package/dist/components/client/Tooltip/Tooltip.d.ts +5 -1
- package/dist/components/client/Tooltip/Tooltip.js +6 -2
- package/dist/components/client/Tooltip/TooltipContent.cjs +3 -2
- package/dist/components/client/Tooltip/TooltipContent.js +3 -2
- package/dist/components/client/Tooltip/tooltipContext.d.cts +2 -0
- package/dist/components/client/Tooltip/tooltipContext.d.ts +2 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/styles/styleVariantTemplates.cjs +146 -0
- package/dist/styles/styleVariantTemplates.d.cts +161 -0
- package/dist/styles/styleVariantTemplates.d.ts +161 -0
- package/dist/styles/styleVariantTemplates.js +145 -0
- package/dist/styles/styler.cjs +27 -32
- package/dist/styles/styler.d.cts +13 -289
- package/dist/styles/styler.d.ts +13 -289
- package/dist/styles/styler.js +27 -32
- package/dist/styles/stylerTypes.d.cts +1 -1
- package/dist/styles/stylerTypes.d.ts +1 -1
- package/dist/styles/udsTailwindMerge.cjs +522 -0
- package/dist/styles/udsTailwindMerge.d.cts +7 -0
- package/dist/styles/udsTailwindMerge.d.ts +7 -0
- package/dist/styles/udsTailwindMerge.js +520 -0
- package/dist/styles/variantClass.cjs +31 -0
- package/dist/styles/variantClass.d.cts +12 -0
- package/dist/styles/variantClass.d.ts +12 -0
- package/dist/styles/variantClass.js +30 -0
- package/dist/styles/variants.cjs +3 -2
- package/dist/styles/variants.js +1 -1
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/types/dist/index.d.cts +12 -0
- package/dist/types/dist/index.d.ts +12 -0
- package/dist/uds/generated/componentData.cjs +376 -376
- package/dist/uds/generated/componentData.js +376 -376
- package/dist/uds/generated/tailwindPurge.cjs +79 -79
- package/dist/uds/generated/tailwindPurge.js +79 -79
- package/generated/componentData.json +507 -507
- package/generated/tailwindPurge.ts +1 -1
- package/package.json +1 -1
|
@@ -18,11 +18,11 @@ import { ModalTitle } from "./ModalTitle.js";
|
|
|
18
18
|
import { separateChildren } from "./utils.js";
|
|
19
19
|
import { Cross } from "@yahoo/uds-icons";
|
|
20
20
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
21
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
22
22
|
import { Dialog, DialogDismiss } from "@ariakit/react";
|
|
23
23
|
//#region src/components/client/Modal/Modal.tsx
|
|
24
24
|
exposeAriakitScrollbarWidth();
|
|
25
|
-
const Modal = ({ children, open, onClose, onOpen, portal = true, modal = true, includeScrim, closeAriaLabel = "Close", slotProps, hideDismissButton = false, reduceMotion: forceReduceMotion = false, closeIcon = Cross, maxWidth = "auto", maxHeight: maxHeightProp = "auto", fullWidth = false, fullHeight = false, title: titleProp, description: descriptionProp, content: contentProp, actions: actionsProp, scrollBehavior = "outside", className, style }) => {
|
|
25
|
+
const Modal = ({ children, open, unmountOnHide = false, onClose, onOpen, portal = true, modal = true, includeScrim, closeAriaLabel = "Close", slotProps, hideDismissButton = false, reduceMotion: forceReduceMotion = false, closeIcon = Cross, maxWidth = "auto", maxHeight: maxHeightProp = "auto", fullWidth = false, fullHeight = false, title: titleProp, description: descriptionProp, content: contentProp, actions: actionsProp, scrollBehavior = "outside", className, style }) => {
|
|
26
26
|
const prevOpen = useRef(open);
|
|
27
27
|
const positionerRef = useRef(null);
|
|
28
28
|
const { size, variant, animationDuration, animationEasing, gutter } = useModalConfig();
|
|
@@ -52,6 +52,7 @@ const Modal = ({ children, open, onClose, onOpen, portal = true, modal = true, i
|
|
|
52
52
|
reducedMotion,
|
|
53
53
|
durationOut
|
|
54
54
|
]);
|
|
55
|
+
const shouldRenderContent = !unmountOnHide || open || shouldLockScroll;
|
|
55
56
|
useLayoutEffect(() => {
|
|
56
57
|
if (!open) return;
|
|
57
58
|
const positioner = positionerRef.current;
|
|
@@ -149,20 +150,19 @@ const Modal = ({ children, open, onClose, onOpen, portal = true, modal = true, i
|
|
|
149
150
|
}
|
|
150
151
|
})
|
|
151
152
|
}),
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ jsx(ModalContext.Provider, {
|
|
153
154
|
value: {
|
|
154
155
|
scrollBehavior,
|
|
155
156
|
shouldRenderHeader,
|
|
156
157
|
hasContent
|
|
157
158
|
},
|
|
158
|
-
children: [
|
|
159
|
+
children: shouldRenderContent && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
159
160
|
shouldRenderHeader && /* @__PURE__ */ jsxs(HStack, {
|
|
160
161
|
...slotProps?.header,
|
|
161
162
|
className: cx(classNames.header, slotProps?.header?.className),
|
|
162
163
|
children: [!hideDismissButton && /* @__PURE__ */ jsx(DialogDismiss, {
|
|
163
164
|
render: /* @__PURE__ */ jsx(Pressable, {
|
|
164
165
|
"aria-label": closeAriaLabel,
|
|
165
|
-
onClick: (e) => onClose?.(e.nativeEvent),
|
|
166
166
|
...slotProps?.closeIconContainer,
|
|
167
167
|
className: cx(classNames.closeIconContainer, slotProps?.closeIconContainer?.className)
|
|
168
168
|
}),
|
|
@@ -182,7 +182,7 @@ const Modal = ({ children, open, onClose, onOpen, portal = true, modal = true, i
|
|
|
182
182
|
}),
|
|
183
183
|
modalContent || (contentProp ? /* @__PURE__ */ jsx(ModalContent, { children: contentProp }) : /* @__PURE__ */ jsx(Box, { flexGrow: "1" })),
|
|
184
184
|
modalActions || (actionsProp ? /* @__PURE__ */ jsx(ModalActions, { children: actionsProp }) : null)
|
|
185
|
-
]
|
|
185
|
+
] })
|
|
186
186
|
})
|
|
187
187
|
});
|
|
188
188
|
};
|
|
@@ -37,7 +37,7 @@ const POPOVER_OPEN_EVENT = "uds:popover-open";
|
|
|
37
37
|
*
|
|
38
38
|
* @related [Toast](https://uds.build/docs/components/toast), [Tooltip](https://uds.build/docs/components/tooltip)
|
|
39
39
|
**/
|
|
40
|
-
function Popover({ children, placement, open, defaultOpen = false, portal = true, hideArrow = false, hideDismissButton = false, onClose, onOpen, reduceMotion: forceReduceMotion = false, disableAutoFocus = false, disableVerticalSpacing = false, disableHorizontalSpacing = false, sameWidth = false, gutter = 4 }) {
|
|
40
|
+
function Popover({ children, placement, open, defaultOpen = false, portal = true, hideArrow = false, hideDismissButton = false, onClose, onOpen, reduceMotion: forceReduceMotion = false, disableAutoFocus = false, disableVerticalSpacing = false, disableHorizontalSpacing = false, sameWidth = false, gutter = 4, unmountOnHide = false }) {
|
|
41
41
|
const controlledProps = open !== void 0 ? {
|
|
42
42
|
showTimeout: 0,
|
|
43
43
|
hideTimeout: 0,
|
|
@@ -76,7 +76,8 @@ function Popover({ children, placement, open, defaultOpen = false, portal = true
|
|
|
76
76
|
disableVerticalSpacing,
|
|
77
77
|
disableHorizontalSpacing,
|
|
78
78
|
sameWidth,
|
|
79
|
-
gutter
|
|
79
|
+
gutter,
|
|
80
|
+
unmountOnHide
|
|
80
81
|
},
|
|
81
82
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverProvider, {
|
|
82
83
|
placement: ariaKitPlacement,
|
|
@@ -35,7 +35,7 @@ const POPOVER_OPEN_EVENT = "uds:popover-open";
|
|
|
35
35
|
*
|
|
36
36
|
* @related [Toast](https://uds.build/docs/components/toast), [Tooltip](https://uds.build/docs/components/tooltip)
|
|
37
37
|
**/
|
|
38
|
-
function Popover({ children, placement, open, defaultOpen = false, portal = true, hideArrow = false, hideDismissButton = false, onClose, onOpen, reduceMotion: forceReduceMotion = false, disableAutoFocus = false, disableVerticalSpacing = false, disableHorizontalSpacing = false, sameWidth = false, gutter = 4 }) {
|
|
38
|
+
function Popover({ children, placement, open, defaultOpen = false, portal = true, hideArrow = false, hideDismissButton = false, onClose, onOpen, reduceMotion: forceReduceMotion = false, disableAutoFocus = false, disableVerticalSpacing = false, disableHorizontalSpacing = false, sameWidth = false, gutter = 4, unmountOnHide = false }) {
|
|
39
39
|
const controlledProps = open !== void 0 ? {
|
|
40
40
|
showTimeout: 0,
|
|
41
41
|
hideTimeout: 0,
|
|
@@ -74,7 +74,8 @@ function Popover({ children, placement, open, defaultOpen = false, portal = true
|
|
|
74
74
|
disableVerticalSpacing,
|
|
75
75
|
disableHorizontalSpacing,
|
|
76
76
|
sameWidth,
|
|
77
|
-
gutter
|
|
77
|
+
gutter,
|
|
78
|
+
unmountOnHide
|
|
78
79
|
},
|
|
79
80
|
children: /* @__PURE__ */ jsx(PopoverProvider, {
|
|
80
81
|
placement: ariaKitPlacement,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
5
|
-
const require_index = require("../../../fixtures/dist/index.cjs");
|
|
6
5
|
const require_styles_styler = require("../../../styles/styler.cjs");
|
|
7
6
|
const require_components_client_Pressable = require("../Pressable.cjs");
|
|
7
|
+
const require_index = require("../../../fixtures/dist/index.cjs");
|
|
8
8
|
const require_components_IconSlot = require("../../IconSlot.cjs");
|
|
9
9
|
const require_components_Box = require("../../Box.cjs");
|
|
10
10
|
const require_components_client_Popover_PopoverContext = require("./PopoverContext.cjs");
|
|
@@ -103,6 +103,7 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
103
103
|
},
|
|
104
104
|
ref: mergedRef,
|
|
105
105
|
className: classNames.root,
|
|
106
|
+
unmountOnHide: internalContext?.unmountOnHide,
|
|
106
107
|
...slotProps?.root,
|
|
107
108
|
portal: internalContext ? internalContext.portal : true,
|
|
108
109
|
gutter: internalContext?.hideArrow ? gutter : ARROW_HEIGHT + gutter,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
"use client";
|
|
3
|
-
import { spacingMap } from "../../../fixtures/dist/index.js";
|
|
4
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
5
4
|
import { Pressable } from "../Pressable.js";
|
|
5
|
+
import { spacingMap } from "../../../fixtures/dist/index.js";
|
|
6
6
|
import { IconSlot } from "../../IconSlot.js";
|
|
7
7
|
import { Box } from "../../Box.js";
|
|
8
8
|
import { PopoverInternalContext } from "./PopoverContext.js";
|
|
@@ -101,6 +101,7 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
101
101
|
},
|
|
102
102
|
ref: mergedRef,
|
|
103
103
|
className: classNames.root,
|
|
104
|
+
unmountOnHide: internalContext?.unmountOnHide,
|
|
104
105
|
...slotProps?.root,
|
|
105
106
|
portal: internalContext ? internalContext.portal : true,
|
|
106
107
|
gutter: internalContext?.hideArrow ? gutter : ARROW_HEIGHT + gutter,
|
|
@@ -8,14 +8,21 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
let _ariakit_react = require("@ariakit/react");
|
|
9
9
|
//#region src/components/client/Popover/PopoverTrigger.tsx
|
|
10
10
|
function PopoverTrigger({ children }) {
|
|
11
|
-
const
|
|
11
|
+
const internalContext = (0, react.useContext)(require_components_client_Popover_PopoverContext.PopoverInternalContext);
|
|
12
|
+
const open = (0, _ariakit_react.useStoreState)((0, _ariakit_react.usePopoverContext)(), "open");
|
|
13
|
+
const toggleOnClick = !internalContext?.isControlled;
|
|
14
|
+
const handleClick = (event) => {
|
|
15
|
+
if (internalContext?.isControlled && open) internalContext.onClose?.(event.nativeEvent);
|
|
16
|
+
};
|
|
12
17
|
if ((0, react.isValidElement)(children) && children.type !== react.Fragment) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverDisclosure, {
|
|
13
18
|
render: children,
|
|
14
|
-
toggleOnClick
|
|
19
|
+
toggleOnClick,
|
|
20
|
+
onClick: handleClick
|
|
15
21
|
});
|
|
16
22
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverDisclosure, {
|
|
17
23
|
className: "inline",
|
|
18
24
|
toggleOnClick,
|
|
25
|
+
onClick: handleClick,
|
|
19
26
|
children
|
|
20
27
|
});
|
|
21
28
|
}
|
|
@@ -3,17 +3,24 @@
|
|
|
3
3
|
import { PopoverInternalContext } from "./PopoverContext.js";
|
|
4
4
|
import { Fragment, isValidElement, useContext } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { PopoverDisclosure } from "@ariakit/react";
|
|
6
|
+
import { PopoverDisclosure, usePopoverContext, useStoreState } from "@ariakit/react";
|
|
7
7
|
//#region src/components/client/Popover/PopoverTrigger.tsx
|
|
8
8
|
function PopoverTrigger({ children }) {
|
|
9
|
-
const
|
|
9
|
+
const internalContext = useContext(PopoverInternalContext);
|
|
10
|
+
const open = useStoreState(usePopoverContext(), "open");
|
|
11
|
+
const toggleOnClick = !internalContext?.isControlled;
|
|
12
|
+
const handleClick = (event) => {
|
|
13
|
+
if (internalContext?.isControlled && open) internalContext.onClose?.(event.nativeEvent);
|
|
14
|
+
};
|
|
10
15
|
if (isValidElement(children) && children.type !== Fragment) return /* @__PURE__ */ jsx(PopoverDisclosure, {
|
|
11
16
|
render: children,
|
|
12
|
-
toggleOnClick
|
|
17
|
+
toggleOnClick,
|
|
18
|
+
onClick: handleClick
|
|
13
19
|
});
|
|
14
20
|
return /* @__PURE__ */ jsx(PopoverDisclosure, {
|
|
15
21
|
className: "inline",
|
|
16
22
|
toggleOnClick,
|
|
23
|
+
onClick: handleClick,
|
|
17
24
|
children
|
|
18
25
|
});
|
|
19
26
|
}
|
|
@@ -35,7 +35,7 @@ let _ariakit_react = require("@ariakit/react");
|
|
|
35
35
|
*
|
|
36
36
|
* @related [Toast](https://uds.build/docs/components/toast), [Popover](https://uds.build/docs/components/popover)
|
|
37
37
|
**/
|
|
38
|
-
function Tooltip({ children, placement, open, portal = true, hideArrow = false }) {
|
|
38
|
+
function Tooltip({ children, placement, open, portal = true, hideArrow = false, unmountOnHide = false, showTimeout, hideTimeout, gutter }) {
|
|
39
39
|
const isControlled = open !== void 0;
|
|
40
40
|
const controlledProps = isControlled ? {
|
|
41
41
|
showTimeout: 0,
|
|
@@ -48,12 +48,16 @@ function Tooltip({ children, placement, open, portal = true, hideArrow = false }
|
|
|
48
48
|
value: {
|
|
49
49
|
portal,
|
|
50
50
|
isControlled,
|
|
51
|
-
hideArrow
|
|
51
|
+
hideArrow,
|
|
52
|
+
unmountOnHide,
|
|
53
|
+
gutter
|
|
52
54
|
},
|
|
53
55
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.TooltipProvider, {
|
|
54
56
|
placement: ariaKitPlacement,
|
|
55
57
|
animated: animationDuration,
|
|
56
58
|
open,
|
|
59
|
+
showTimeout,
|
|
60
|
+
hideTimeout,
|
|
57
61
|
...controlledProps,
|
|
58
62
|
children
|
|
59
63
|
})
|
|
@@ -37,7 +37,11 @@ declare function Tooltip({
|
|
|
37
37
|
placement,
|
|
38
38
|
open,
|
|
39
39
|
portal,
|
|
40
|
-
hideArrow
|
|
40
|
+
hideArrow,
|
|
41
|
+
unmountOnHide,
|
|
42
|
+
showTimeout,
|
|
43
|
+
hideTimeout,
|
|
44
|
+
gutter
|
|
41
45
|
}: TooltipProps): _$react_jsx_runtime0.JSX.Element;
|
|
42
46
|
declare namespace Tooltip {
|
|
43
47
|
var displayName: string;
|
|
@@ -38,7 +38,11 @@ declare function Tooltip({
|
|
|
38
38
|
placement,
|
|
39
39
|
open,
|
|
40
40
|
portal,
|
|
41
|
-
hideArrow
|
|
41
|
+
hideArrow,
|
|
42
|
+
unmountOnHide,
|
|
43
|
+
showTimeout,
|
|
44
|
+
hideTimeout,
|
|
45
|
+
gutter
|
|
42
46
|
}: TooltipProps): _$react_jsx_runtime0.JSX.Element;
|
|
43
47
|
declare namespace Tooltip {
|
|
44
48
|
var displayName: string;
|
|
@@ -33,7 +33,7 @@ import { TooltipProvider } from "@ariakit/react";
|
|
|
33
33
|
*
|
|
34
34
|
* @related [Toast](https://uds.build/docs/components/toast), [Popover](https://uds.build/docs/components/popover)
|
|
35
35
|
**/
|
|
36
|
-
function Tooltip({ children, placement, open, portal = true, hideArrow = false }) {
|
|
36
|
+
function Tooltip({ children, placement, open, portal = true, hideArrow = false, unmountOnHide = false, showTimeout, hideTimeout, gutter }) {
|
|
37
37
|
const isControlled = open !== void 0;
|
|
38
38
|
const controlledProps = isControlled ? {
|
|
39
39
|
showTimeout: 0,
|
|
@@ -46,12 +46,16 @@ function Tooltip({ children, placement, open, portal = true, hideArrow = false }
|
|
|
46
46
|
value: {
|
|
47
47
|
portal,
|
|
48
48
|
isControlled,
|
|
49
|
-
hideArrow
|
|
49
|
+
hideArrow,
|
|
50
|
+
unmountOnHide,
|
|
51
|
+
gutter
|
|
50
52
|
},
|
|
51
53
|
children: /* @__PURE__ */ jsx(TooltipProvider, {
|
|
52
54
|
placement: ariaKitPlacement,
|
|
53
55
|
animated: animationDuration,
|
|
54
56
|
open,
|
|
57
|
+
showTimeout,
|
|
58
|
+
hideTimeout,
|
|
55
59
|
...controlledProps,
|
|
56
60
|
children
|
|
57
61
|
})
|
|
@@ -20,7 +20,7 @@ let _ariakit_react = require("@ariakit/react");
|
|
|
20
20
|
const ARROW_HEIGHT = 8;
|
|
21
21
|
const ARROW_WIDTH = 12;
|
|
22
22
|
const ARROW_TIP_RADIUS_FRACTION = .5;
|
|
23
|
-
const
|
|
23
|
+
const DEFAULT_GUTTER = 10;
|
|
24
24
|
const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children, maxWidth, startTitleIcon, title, endContent, className, id, slotProps }, ref) {
|
|
25
25
|
const store = (0, _ariakit_react.useTooltipContext)();
|
|
26
26
|
const open = (0, _ariakit_react.useStoreState)(store, "open");
|
|
@@ -72,11 +72,12 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
72
72
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ariakit_react.Tooltip, {
|
|
73
73
|
ref: mergedRef,
|
|
74
74
|
className: classNames.root,
|
|
75
|
+
unmountOnHide: internalContext?.unmountOnHide,
|
|
75
76
|
...slotProps?.root,
|
|
76
77
|
hideOnHoverOutside: internalContext?.isControlled ? false : void 0,
|
|
77
78
|
hideOnInteractOutside: internalContext?.isControlled ? false : void 0,
|
|
78
79
|
portal: internalContext ? internalContext.portal : true,
|
|
79
|
-
gutter:
|
|
80
|
+
gutter: internalContext?.gutter ?? DEFAULT_GUTTER,
|
|
80
81
|
updatePosition: onPositionUpdate,
|
|
81
82
|
getAnchorRect: require_utils_getUnscaledAnchorRect.getUnscaledAnchorRect,
|
|
82
83
|
style: {
|
|
@@ -18,7 +18,7 @@ import { Tooltip, TooltipArrow, useStoreState, useTooltipContext } from "@ariaki
|
|
|
18
18
|
const ARROW_HEIGHT = 8;
|
|
19
19
|
const ARROW_WIDTH = 12;
|
|
20
20
|
const ARROW_TIP_RADIUS_FRACTION = .5;
|
|
21
|
-
const
|
|
21
|
+
const DEFAULT_GUTTER = 10;
|
|
22
22
|
const TooltipContent = forwardRef(function TooltipContent({ children, maxWidth, startTitleIcon, title, endContent, className, id, slotProps }, ref) {
|
|
23
23
|
const store = useTooltipContext();
|
|
24
24
|
const open = useStoreState(store, "open");
|
|
@@ -70,11 +70,12 @@ const TooltipContent = forwardRef(function TooltipContent({ children, maxWidth,
|
|
|
70
70
|
return /* @__PURE__ */ jsxs(Tooltip, {
|
|
71
71
|
ref: mergedRef,
|
|
72
72
|
className: classNames.root,
|
|
73
|
+
unmountOnHide: internalContext?.unmountOnHide,
|
|
73
74
|
...slotProps?.root,
|
|
74
75
|
hideOnHoverOutside: internalContext?.isControlled ? false : void 0,
|
|
75
76
|
hideOnInteractOutside: internalContext?.isControlled ? false : void 0,
|
|
76
77
|
portal: internalContext ? internalContext.portal : true,
|
|
77
|
-
gutter:
|
|
78
|
+
gutter: internalContext?.gutter ?? DEFAULT_GUTTER,
|
|
78
79
|
updatePosition: onPositionUpdate,
|
|
79
80
|
getAnchorRect: getUnscaledAnchorRect,
|
|
80
81
|
style: {
|
|
@@ -7,6 +7,8 @@ interface TooltipInternalContextType {
|
|
|
7
7
|
portal: boolean;
|
|
8
8
|
isControlled: boolean;
|
|
9
9
|
hideArrow: boolean;
|
|
10
|
+
unmountOnHide: boolean;
|
|
11
|
+
gutter?: number;
|
|
10
12
|
}
|
|
11
13
|
declare const TooltipInternalContext: _$react.Context<TooltipInternalContextType | null>;
|
|
12
14
|
//#endregion
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_index = require("./palette/dist/index.cjs");
|
|
4
|
-
const require_index$1 = require("./css-tokens/dist/index.cjs");
|
|
5
|
-
const require_styles_variants = require("./styles/variants.cjs");
|
|
6
3
|
const require_styles_styler = require("./styles/styler.cjs");
|
|
7
4
|
const require_components_client_Pressable = require("./components/client/Pressable.cjs");
|
|
5
|
+
const require_index = require("./palette/dist/index.cjs");
|
|
6
|
+
const require_index$1 = require("./css-tokens/dist/index.cjs");
|
|
8
7
|
const require_components_Icon = require("./components/Icon.cjs");
|
|
9
8
|
const require_components_Text = require("./components/Text.cjs");
|
|
10
9
|
const require_components_Banner_Banner = require("./components/Banner/Banner.cjs");
|
|
@@ -103,6 +102,7 @@ const require_components_client_Pagination_PaginationNumbers = require("./compon
|
|
|
103
102
|
const require_components_client_Pagination_PaginationPrev = require("./components/client/Pagination/PaginationPrev.cjs");
|
|
104
103
|
const require_components_client_Popover_UDSPopoverConfigProvider = require("./components/client/Popover/UDSPopoverConfigProvider.cjs");
|
|
105
104
|
const require_components_client_Popover_Popover = require("./components/client/Popover/Popover.cjs");
|
|
105
|
+
const require_styles_variants = require("./styles/variants.cjs");
|
|
106
106
|
const require_generatedConfigs = require("./automated-config/dist/generated/generatedConfigs.cjs");
|
|
107
107
|
const require_tokens_configs_shadow = require("./tokens/configs/shadow.cjs");
|
|
108
108
|
const require_index$3 = require("./modes/dist/index.cjs");
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
-
import { ALWAYS_PREFIX, alwaysPalette, deprecatedAlwaysPalette, newAlwaysPalette } from "./palette/dist/index.js";
|
|
3
|
-
import { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe } from "./css-tokens/dist/index.js";
|
|
4
|
-
import { variants } from "./styles/variants.js";
|
|
5
2
|
import { cva, cx, getStyles, getStylesCacheKeySymbol } from "./styles/styler.js";
|
|
6
3
|
import { Pressable } from "./components/client/Pressable.js";
|
|
4
|
+
import { ALWAYS_PREFIX, alwaysPalette, deprecatedAlwaysPalette, newAlwaysPalette } from "./palette/dist/index.js";
|
|
5
|
+
import { AVATAR_SIZE_PREFIX, BACKGROUND_BLUR_COLOR_PREFIX, BACKGROUND_BLUR_FALLBACK_COLOR_PREFIX, BACKGROUND_BLUR_RADIUS_PREFIX, BACKGROUND_COLOR_PREFIX, BORDER_RADIUS_PREFIX, BORDER_WIDTH_PREFIX, BUTTON_CONTROL_HEIGHT_VAR, BUTTON_GAP_VAR, BUTTON_SCALE_EFFECT, BUTTON_SCALE_EFFECT_HOVER, BUTTON_SCALE_EFFECT_PRESSED, BUTTON_SCALE_EFFECT_REST, DARK_COLOR_MODE_CLASSNAME, DEFAULT_COLOR_MODE_CLASSNAME, DEFAULT_SCALE_MODE_CLASSNAME, DROP_SHADOW_PREFIX, FONT_FAMILY_PREFIX, FONT_SIZE_PREFIX, FONT_SLANT_PREFIX, FONT_WEIGHT_PREFIX, FONT_WIDTH_PREFIX, ICON_COLOR_OVERRIDE_ATTRIBUTE, ICON_SIZE_OVERRIDE_ATTRIBUTE, ICON_SIZE_PREFIX, INSET_SHADOW_PREFIX, INVERT_COLOR_MODE_CLASSNAME, LARGE_SCALE_MODE_CLASSNAME, LETTER_SPACING_PREFIX, LIGHT_COLOR_MODE_CLASSNAME, LINE_COLOR_PREFIX, LINE_HEIGHT_PREFIX, MEDIUM_SCALE_MODE_CLASSNAME, MOTION_PREFIX, OUTLINE_PREFIX, PSEUDO_STYLE_SELECTOR_MAP, SMALL_SCALE_MODE_CLASSNAME, SPECTRUM_COLOR_PREFIX, SYSTEM_COLOR_MODE_CLASSNAME, TEXT_RESPONSIVE_BREAKPOINT_CLASSNAMES, TEXT_RESPONSIVE_CLASSNAME, TEXT_TRANSFORM_PREFIX, UDS_PREFIX, XLARGE_SCALE_MODE_CLASSNAME, XSMALL_SCALE_MODE_CLASSNAME, XXLARGE_SCALE_MODE_CLASSNAME, XXXLARGE_SCALE_MODE_CLASSNAME, getMotionVar, getShadowLayerValue, textVariantsSafe } from "./css-tokens/dist/index.js";
|
|
7
6
|
import { Icon } from "./components/Icon.js";
|
|
8
7
|
import { Text } from "./components/Text.js";
|
|
9
8
|
import { Banner } from "./components/Banner/Banner.js";
|
|
@@ -102,6 +101,7 @@ import { PaginationNumbers } from "./components/client/Pagination/PaginationNumb
|
|
|
102
101
|
import { PaginationPrev } from "./components/client/Pagination/PaginationPrev.js";
|
|
103
102
|
import { UDSPopoverConfigProvider } from "./components/client/Popover/UDSPopoverConfigProvider.js";
|
|
104
103
|
import { Popover } from "./components/client/Popover/Popover.js";
|
|
104
|
+
import { variants } from "./styles/variants.js";
|
|
105
105
|
import { AvatarConfig, BadgeConfig, BannerConfig, BottomSheetConfig, ButtonConfig, CheckboxConfig, ChipConfig, DividerConfig, IconButtonConfig, InputConfig, LinkConfig, MenuContentConfig, MenuItemConfig, ModalConfig, PaddleNavConfig, PaginationConfig, PopoverConfig, RadioConfig, ScrimConfig, SelectConfig, SelectContentConfig, SelectItemConfig, SwitchConfig, TabConfig, TabsConfig, ToastConfig, TooltipConfig } from "./automated-config/dist/generated/generatedConfigs.js";
|
|
106
106
|
import { shadow } from "./tokens/configs/shadow.js";
|
|
107
107
|
import { DEFAULT_COLOR_MODE, DEFAULT_COLOR_MODE_FOR_APP, DEFAULT_HIGH_CONTRAST_MODE, DEFAULT_REGION_MODE, DEFAULT_SCALE_MODE, DEFAULT_SCALE_MODE_FOR_APP } from "./modes/dist/index.js";
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
//#region src/styles/styleVariantTemplates.ts
|
|
4
|
+
/**
|
|
5
|
+
* Compact class-name templates for the hand-written style props in
|
|
6
|
+
* `./variants.ts`. The enumerated `variants` map stays the build-time source
|
|
7
|
+
* of truth (CSS generation, purging, public `tokens` export); the runtime
|
|
8
|
+
* styler derives class names from these templates instead so the ~50 kB
|
|
9
|
+
* enumeration never enters the client bundle.
|
|
10
|
+
*
|
|
11
|
+
* `variantClass.test.ts` exhaustively asserts template-derived classes equal
|
|
12
|
+
* the `variants` map, so any drift fails CI.
|
|
13
|
+
*/
|
|
14
|
+
const styleVariantTemplates = {
|
|
15
|
+
color: "text-%v",
|
|
16
|
+
placeholderColor: "placeholder:text-%v",
|
|
17
|
+
fontFamily: "uds-font-family-%v",
|
|
18
|
+
fontSize: "uds-font-size-%v",
|
|
19
|
+
fontWeight: "uds-font-weight-%v",
|
|
20
|
+
lineHeight: "uds-line-height-%v",
|
|
21
|
+
letterSpacing: "uds-letter-spacing-%v",
|
|
22
|
+
textAlign: "text-%v",
|
|
23
|
+
textTransform: {
|
|
24
|
+
t: "uds-text-transform-%v",
|
|
25
|
+
e: {
|
|
26
|
+
none: "normal-case",
|
|
27
|
+
uppercase: "uppercase",
|
|
28
|
+
lowercase: "lowercase",
|
|
29
|
+
capitalize: "capitalize"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
spacing: "p-%v",
|
|
33
|
+
spacingHorizontal: "px-%v",
|
|
34
|
+
spacingVertical: "py-%v",
|
|
35
|
+
spacingBottom: "pb-%v",
|
|
36
|
+
spacingEnd: "pe-%v",
|
|
37
|
+
spacingStart: "ps-%v",
|
|
38
|
+
spacingTop: "pt-%v",
|
|
39
|
+
offset: "-m-%v",
|
|
40
|
+
offsetVertical: "-my-%v",
|
|
41
|
+
offsetHorizontal: "-mx-%v",
|
|
42
|
+
offsetBottom: "-mb-%v",
|
|
43
|
+
offsetEnd: "-me-%v",
|
|
44
|
+
offsetStart: "-ms-%v",
|
|
45
|
+
offsetTop: "-mt-%v",
|
|
46
|
+
columnGap: "gap-x-%v",
|
|
47
|
+
rowGap: "gap-y-%v",
|
|
48
|
+
backgroundColor: "bg-%v",
|
|
49
|
+
borderColor: "border-%v",
|
|
50
|
+
borderStartColor: "border-s-%v",
|
|
51
|
+
borderEndColor: "border-e-%v",
|
|
52
|
+
borderBottomColor: "border-b-%v",
|
|
53
|
+
borderTopColor: "border-t-%v",
|
|
54
|
+
borderRadius: "uds-border-radius-%v",
|
|
55
|
+
borderTopStartRadius: "uds-border-top-start-radius-%v",
|
|
56
|
+
borderTopEndRadius: "uds-border-top-end-radius-%v",
|
|
57
|
+
borderBottomStartRadius: "uds-border-bottom-start-radius-%v",
|
|
58
|
+
borderBottomEndRadius: "uds-border-bottom-end-radius-%v",
|
|
59
|
+
borderWidth: "uds-border-width-%v",
|
|
60
|
+
borderVerticalWidth: "uds-border-width-y-%v",
|
|
61
|
+
borderHorizontalWidth: "uds-border-width-x-%v",
|
|
62
|
+
borderStartWidth: "uds-border-width-start-%v",
|
|
63
|
+
borderEndWidth: "uds-border-width-end-%v",
|
|
64
|
+
borderTopWidth: "uds-border-width-top-%v",
|
|
65
|
+
borderBottomWidth: "uds-border-width-bottom-%v",
|
|
66
|
+
avatarSize: "avatarSize-%v",
|
|
67
|
+
iconSize: "iconSize-%v leading-none",
|
|
68
|
+
alignContent: {
|
|
69
|
+
t: "content-%v",
|
|
70
|
+
e: {
|
|
71
|
+
"flex-start": "content-start",
|
|
72
|
+
"flex-end": "content-end",
|
|
73
|
+
"space-between": "content-between",
|
|
74
|
+
"space-around": "content-around"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
alignItems: {
|
|
78
|
+
t: "items-%v",
|
|
79
|
+
e: {
|
|
80
|
+
"flex-start": "items-start",
|
|
81
|
+
"flex-end": "items-end"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
alignSelf: {
|
|
85
|
+
t: "self-%v",
|
|
86
|
+
e: {
|
|
87
|
+
"flex-start": "self-start",
|
|
88
|
+
"flex-end": "self-end"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
flex: "flex-%v",
|
|
92
|
+
flexDirection: {
|
|
93
|
+
t: "flex-%v",
|
|
94
|
+
e: {
|
|
95
|
+
column: "flex-col",
|
|
96
|
+
"column-reverse": "flex-col-reverse"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
flexGrow: {
|
|
100
|
+
t: "grow-[%v]",
|
|
101
|
+
e: {
|
|
102
|
+
"0": "grow-0",
|
|
103
|
+
"1": "grow"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
flexShrink: {
|
|
107
|
+
t: "shrink-%v",
|
|
108
|
+
e: { "1": "shrink" }
|
|
109
|
+
},
|
|
110
|
+
flexWrap: "flex-%v",
|
|
111
|
+
justifyContent: {
|
|
112
|
+
t: "justify-%v",
|
|
113
|
+
e: {
|
|
114
|
+
"flex-start": "justify-start",
|
|
115
|
+
"flex-end": "justify-end",
|
|
116
|
+
"space-between": "justify-between",
|
|
117
|
+
"space-around": "justify-around",
|
|
118
|
+
"space-evenly": "justify-evenly"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
flexBasis: "basis-[%v]",
|
|
122
|
+
display: {
|
|
123
|
+
t: "%v",
|
|
124
|
+
e: { none: "hidden" }
|
|
125
|
+
},
|
|
126
|
+
overflow: "overflow-%v",
|
|
127
|
+
overflowX: "overflow-x-%v",
|
|
128
|
+
overflowY: "overflow-y-%v",
|
|
129
|
+
position: "%v",
|
|
130
|
+
contentFit: "object-%v",
|
|
131
|
+
colorMode: "uds-color-mode-%v",
|
|
132
|
+
scaleMode: "uds-scale-mode-%v",
|
|
133
|
+
width: "w-%v",
|
|
134
|
+
height: "h-%v",
|
|
135
|
+
dropShadow: "uds-drop-shadow-%v",
|
|
136
|
+
insetShadow: "uds-inset-shadow-%v",
|
|
137
|
+
nestedBorderRadiusSize: "uds-nested-border-radius-size-%v",
|
|
138
|
+
nestedBorderRadiusWidth: "uds-nested-border-radius-width-%v",
|
|
139
|
+
nestedBorderRadiusSpacing: "uds-nested-border-radius-spacing-%v",
|
|
140
|
+
nestedBorderRadius: {
|
|
141
|
+
t: "uds-nested-border-radius-%v",
|
|
142
|
+
e: { true: "uds-nested-border-radius" }
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
//#endregion
|
|
146
|
+
exports.styleVariantTemplates = styleVariantTemplates;
|