@yahoo/uds 3.116.0-beta.1 → 3.116.0-beta.3
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/components/SvgFloatingOverlay.cjs +5 -6
- package/dist/components/SvgFloatingOverlay.js +5 -6
- package/dist/components/client/Popover/PopoverContent.cjs +5 -3
- package/dist/components/client/Popover/PopoverContent.js +5 -3
- package/dist/components/client/Toast/Toast.cjs +2 -2
- package/dist/components/client/Toast/Toast.js +2 -2
- package/dist/components/client/Tooltip/TooltipContent.cjs +36 -35
- package/dist/components/client/Tooltip/TooltipContent.js +37 -36
- package/dist/hooks/useSvgFloatingContent.cjs +18 -1
- package/dist/hooks/useSvgFloatingContent.js +18 -1
- package/dist/styles/styler.d.cts +2 -2
- package/dist/styles/styler.d.ts +2 -2
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts +1 -1
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts +1 -1
- package/dist/uds/generated/componentData.cjs +1014 -1001
- package/dist/uds/generated/componentData.js +1014 -1001
- package/dist/uds/generated/tailwindPurge.cjs +3 -2
- package/dist/uds/generated/tailwindPurge.js +3 -2
- package/generated/componentData.json +1447 -1430
- package/generated/tailwindPurge.ts +2 -2
- package/package.json +1 -1
|
@@ -8,7 +8,6 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
|
|
9
9
|
//#region src/components/SvgFloatingOverlay.tsx
|
|
10
10
|
const SvgFloatingOverlay = ({ blurClassName, blurStyle, childTransitionStyle, svgPath, dimensions, shadows, svgClassNames, shadowFilterId, shadowPadding, arrowHeight, contentWrapperSlotProps, children, borderRadius, svgBaseStyle, svgBorderStyle }) => {
|
|
11
|
-
const sharedSvgClasses = "absolute top-0 left-0 w-full h-full overflow-visible pointer-events-none";
|
|
12
11
|
const svgSharedProps = {
|
|
13
12
|
"aria-hidden": true,
|
|
14
13
|
style: childTransitionStyle,
|
|
@@ -24,7 +23,7 @@ const SvgFloatingOverlay = ({ blurClassName, blurStyle, childTransitionStyle, sv
|
|
|
24
23
|
}),
|
|
25
24
|
svgPath && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
26
25
|
...svgSharedProps,
|
|
27
|
-
className: require_styles_styler.cx(
|
|
26
|
+
className: require_styles_styler.cx("absolute top-0 left-0 w-full h-full overflow-visible pointer-events-none", "z-[2]"),
|
|
28
27
|
children: [
|
|
29
28
|
shadows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("filter", {
|
|
30
29
|
id: shadowFilterId,
|
|
@@ -91,23 +90,23 @@ const SvgFloatingOverlay = ({ blurClassName, blurStyle, childTransitionStyle, sv
|
|
|
91
90
|
position: "relative",
|
|
92
91
|
flexGrow: "1",
|
|
93
92
|
overflow: "hidden",
|
|
94
|
-
|
|
93
|
+
...contentWrapperSlotProps,
|
|
94
|
+
className: require_styles_styler.cx("z-[3]", "max-h-full", "gap-[inherit]", contentWrapperSlotProps?.className),
|
|
95
95
|
style: {
|
|
96
96
|
...childTransitionStyle,
|
|
97
97
|
borderRadius
|
|
98
98
|
},
|
|
99
|
-
...contentWrapperSlotProps,
|
|
100
99
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
101
100
|
overflow: "auto",
|
|
102
101
|
flexGrow: "1",
|
|
103
102
|
display: "block",
|
|
104
|
-
className: "max-h-full",
|
|
103
|
+
className: "max-h-full gap-[inherit]",
|
|
105
104
|
children
|
|
106
105
|
})
|
|
107
106
|
}),
|
|
108
107
|
svgPath && svgClassNames.border && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
109
108
|
...svgSharedProps,
|
|
110
|
-
className: require_styles_styler.cx(
|
|
109
|
+
className: require_styles_styler.cx("absolute top-0 left-0 w-full h-full overflow-visible pointer-events-none", "z-[3]"),
|
|
111
110
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
112
111
|
d: svgPath,
|
|
113
112
|
className: svgClassNames.border,
|
|
@@ -6,7 +6,6 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region src/components/SvgFloatingOverlay.tsx
|
|
8
8
|
const SvgFloatingOverlay = ({ blurClassName, blurStyle, childTransitionStyle, svgPath, dimensions, shadows, svgClassNames, shadowFilterId, shadowPadding, arrowHeight, contentWrapperSlotProps, children, borderRadius, svgBaseStyle, svgBorderStyle }) => {
|
|
9
|
-
const sharedSvgClasses = "absolute top-0 left-0 w-full h-full overflow-visible pointer-events-none";
|
|
10
9
|
const svgSharedProps = {
|
|
11
10
|
"aria-hidden": true,
|
|
12
11
|
style: childTransitionStyle,
|
|
@@ -22,7 +21,7 @@ const SvgFloatingOverlay = ({ blurClassName, blurStyle, childTransitionStyle, sv
|
|
|
22
21
|
}),
|
|
23
22
|
svgPath && /* @__PURE__ */ jsxs("svg", {
|
|
24
23
|
...svgSharedProps,
|
|
25
|
-
className: cx(
|
|
24
|
+
className: cx("absolute top-0 left-0 w-full h-full overflow-visible pointer-events-none", "z-[2]"),
|
|
26
25
|
children: [
|
|
27
26
|
shadows.length > 0 && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("filter", {
|
|
28
27
|
id: shadowFilterId,
|
|
@@ -89,23 +88,23 @@ const SvgFloatingOverlay = ({ blurClassName, blurStyle, childTransitionStyle, sv
|
|
|
89
88
|
position: "relative",
|
|
90
89
|
flexGrow: "1",
|
|
91
90
|
overflow: "hidden",
|
|
92
|
-
|
|
91
|
+
...contentWrapperSlotProps,
|
|
92
|
+
className: cx("z-[3]", "max-h-full", "gap-[inherit]", contentWrapperSlotProps?.className),
|
|
93
93
|
style: {
|
|
94
94
|
...childTransitionStyle,
|
|
95
95
|
borderRadius
|
|
96
96
|
},
|
|
97
|
-
...contentWrapperSlotProps,
|
|
98
97
|
children: /* @__PURE__ */ jsx(Box, {
|
|
99
98
|
overflow: "auto",
|
|
100
99
|
flexGrow: "1",
|
|
101
100
|
display: "block",
|
|
102
|
-
className: "max-h-full",
|
|
101
|
+
className: "max-h-full gap-[inherit]",
|
|
103
102
|
children
|
|
104
103
|
})
|
|
105
104
|
}),
|
|
106
105
|
svgPath && svgClassNames.border && /* @__PURE__ */ jsx("svg", {
|
|
107
106
|
...svgSharedProps,
|
|
108
|
-
className: cx(
|
|
107
|
+
className: cx("absolute top-0 left-0 w-full h-full overflow-visible pointer-events-none", "z-[3]"),
|
|
109
108
|
children: /* @__PURE__ */ jsx("path", {
|
|
110
109
|
d: svgPath,
|
|
111
110
|
className: svgClassNames.border,
|
|
@@ -40,7 +40,6 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
40
40
|
const defaultDismissButtonSize = dismissButtonSize["default"];
|
|
41
41
|
const arrowRef = (0, react.useRef)(null);
|
|
42
42
|
const reducedMotion = internalContext ? internalContext.reducedMotion : false;
|
|
43
|
-
const cssAnimationDuration = reducedMotion ? "duration-0" : "duration-120";
|
|
44
43
|
const animationDuration = reducedMotion || !internalContext ? 0 : internalContext.animationDuration;
|
|
45
44
|
const { internalRef, shift, onPositionUpdate, ...svgFloatingContentProps } = require_hooks_useSvgFloatingContent.useSvgFloatingContent({
|
|
46
45
|
open: open ?? false,
|
|
@@ -93,7 +92,7 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
93
92
|
alignItems: "center",
|
|
94
93
|
justifyContent: "center",
|
|
95
94
|
display: "flex",
|
|
96
|
-
className: require_styles_styler.cx(
|
|
95
|
+
className: require_styles_styler.cx(reducedMotion ? "duration-0" : "duration-120", "transition-[background-color]", "bg-carbon-15/0", "hover:bg-carbon-15/10", "active:bg-carbon-15/15")
|
|
97
96
|
}),
|
|
98
97
|
closeIcon: require_styles_styler.getStyles({
|
|
99
98
|
popoverVariantCloseIcon: "default",
|
|
@@ -118,7 +117,10 @@ const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children,
|
|
|
118
117
|
},
|
|
119
118
|
onClose: internalContext?.onClose,
|
|
120
119
|
sameWidth,
|
|
121
|
-
autoFocusOnShow:
|
|
120
|
+
autoFocusOnShow: internalContext?.disableAutoFocus ? false : (element) => {
|
|
121
|
+
element?.focus({ preventScroll: true });
|
|
122
|
+
return false;
|
|
123
|
+
},
|
|
122
124
|
autoFocusOnHide: !internalContext?.disableAutoFocus,
|
|
123
125
|
children: [
|
|
124
126
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_SvgFloatingOverlay.SvgFloatingOverlay, {
|
|
@@ -38,7 +38,6 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
38
38
|
const defaultDismissButtonSize = dismissButtonSize["default"];
|
|
39
39
|
const arrowRef = useRef(null);
|
|
40
40
|
const reducedMotion = internalContext ? internalContext.reducedMotion : false;
|
|
41
|
-
const cssAnimationDuration = reducedMotion ? "duration-0" : "duration-120";
|
|
42
41
|
const animationDuration = reducedMotion || !internalContext ? 0 : internalContext.animationDuration;
|
|
43
42
|
const { internalRef, shift, onPositionUpdate, ...svgFloatingContentProps } = useSvgFloatingContent({
|
|
44
43
|
open: open ?? false,
|
|
@@ -91,7 +90,7 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
91
90
|
alignItems: "center",
|
|
92
91
|
justifyContent: "center",
|
|
93
92
|
display: "flex",
|
|
94
|
-
className: cx(
|
|
93
|
+
className: cx(reducedMotion ? "duration-0" : "duration-120", "transition-[background-color]", "bg-carbon-15/0", "hover:bg-carbon-15/10", "active:bg-carbon-15/15")
|
|
95
94
|
}),
|
|
96
95
|
closeIcon: getStyles({
|
|
97
96
|
popoverVariantCloseIcon: "default",
|
|
@@ -116,7 +115,10 @@ const PopoverContent = forwardRef(function PopoverContent({ children, className,
|
|
|
116
115
|
},
|
|
117
116
|
onClose: internalContext?.onClose,
|
|
118
117
|
sameWidth,
|
|
119
|
-
autoFocusOnShow:
|
|
118
|
+
autoFocusOnShow: internalContext?.disableAutoFocus ? false : (element) => {
|
|
119
|
+
element?.focus({ preventScroll: true });
|
|
120
|
+
return false;
|
|
121
|
+
},
|
|
120
122
|
autoFocusOnHide: !internalContext?.disableAutoFocus,
|
|
121
123
|
children: [
|
|
122
124
|
/* @__PURE__ */ jsx(SvgFloatingOverlay, {
|
|
@@ -49,7 +49,7 @@ const Toast = ({ message, onClickCloseButton, size: sizeProp, variant: variantPr
|
|
|
49
49
|
const { className: startIconClassName, ...startIconProps } = slotProps?.startIcon ?? {};
|
|
50
50
|
const { className: closeIconContainerClassName, ...closeIconContainerProps } = slotProps?.closeIconContainer ?? {};
|
|
51
51
|
const { className: closeIconClassName, ...closeIconProps } = slotProps?.closeIcon ?? {};
|
|
52
|
-
const
|
|
52
|
+
const reducedMotion = (0, motion_react.useReducedMotion)() || forceReduceMotion;
|
|
53
53
|
const handleClose = () => {
|
|
54
54
|
closeToast?.();
|
|
55
55
|
onClickCloseButton?.(id);
|
|
@@ -72,7 +72,7 @@ const Toast = ({ message, onClickCloseButton, size: sizeProp, variant: variantPr
|
|
|
72
72
|
closeIconContainer: require_styles_styler.getStyles({
|
|
73
73
|
spacing: "2",
|
|
74
74
|
borderRadius: "full",
|
|
75
|
-
className: require_styles_styler.cx(
|
|
75
|
+
className: require_styles_styler.cx(reducedMotion ? "duration-0" : "duration-120", "transition-[background-color]", "bg-carbon-15/0", "hover:bg-carbon-15/10", "active:bg-carbon-15/15", "uds-ring")
|
|
76
76
|
}),
|
|
77
77
|
closeIcon: require_styles_styler.getStyles({
|
|
78
78
|
toastVariantCloseIcon: variant,
|
|
@@ -47,7 +47,7 @@ const Toast = ({ message, onClickCloseButton, size: sizeProp, variant: variantPr
|
|
|
47
47
|
const { className: startIconClassName, ...startIconProps } = slotProps?.startIcon ?? {};
|
|
48
48
|
const { className: closeIconContainerClassName, ...closeIconContainerProps } = slotProps?.closeIconContainer ?? {};
|
|
49
49
|
const { className: closeIconClassName, ...closeIconProps } = slotProps?.closeIcon ?? {};
|
|
50
|
-
const
|
|
50
|
+
const reducedMotion = useReducedMotion() || forceReduceMotion;
|
|
51
51
|
const handleClose = () => {
|
|
52
52
|
closeToast?.();
|
|
53
53
|
onClickCloseButton?.(id);
|
|
@@ -70,7 +70,7 @@ const Toast = ({ message, onClickCloseButton, size: sizeProp, variant: variantPr
|
|
|
70
70
|
closeIconContainer: getStyles({
|
|
71
71
|
spacing: "2",
|
|
72
72
|
borderRadius: "full",
|
|
73
|
-
className: cx(
|
|
73
|
+
className: cx(reducedMotion ? "duration-0" : "duration-120", "transition-[background-color]", "bg-carbon-15/0", "hover:bg-carbon-15/10", "active:bg-carbon-15/15", "uds-ring")
|
|
74
74
|
}),
|
|
75
75
|
closeIcon: getStyles({
|
|
76
76
|
toastVariantCloseIcon: variant,
|
|
@@ -5,6 +5,7 @@ const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
|
5
5
|
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
6
6
|
const require_components_Box = require('../../Box.cjs');
|
|
7
7
|
const require_components_Text = require('../../Text.cjs');
|
|
8
|
+
const require_components_VStack = require('../../VStack.cjs');
|
|
8
9
|
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
9
10
|
const require_hooks_useForkRef = require('../../../hooks/useForkRef.cjs');
|
|
10
11
|
const require_hooks_useSvgFloatingContent = require('../../../hooks/useSvgFloatingContent.cjs');
|
|
@@ -44,10 +45,7 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
44
45
|
root: require_styles_styler.getStyles({
|
|
45
46
|
tooltipSizeRoot: "default",
|
|
46
47
|
tooltipVariantRoot: "default",
|
|
47
|
-
className: require_styles_styler.cx(
|
|
48
|
-
if (maxWidth !== void 0) return typeof maxWidth === "number" ? `max-w-[${maxWidth}px]` : `max-w-[${maxWidth}]`;
|
|
49
|
-
return "max-w-lg";
|
|
50
|
-
}, [maxWidth]), "flex", "z-[9999]", className)
|
|
48
|
+
className: require_styles_styler.cx(maxWidth === void 0 && "max-w-lg", "flex", "z-[9999]", className)
|
|
51
49
|
}),
|
|
52
50
|
svg: require_styles_styler.getStyles({
|
|
53
51
|
tooltipSizeSvg: "default",
|
|
@@ -59,7 +57,7 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
59
57
|
position: "absolute",
|
|
60
58
|
width: "full",
|
|
61
59
|
height: "full",
|
|
62
|
-
className: require_styles_styler.cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]"
|
|
60
|
+
className: require_styles_styler.cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]")
|
|
63
61
|
}),
|
|
64
62
|
title: require_styles_styler.getStyles({ tooltipSizeTitle: "default" }),
|
|
65
63
|
body: require_styles_styler.getStyles({ tooltipSizeBody: "default" }),
|
|
@@ -77,41 +75,44 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
77
75
|
portal: internalContext ? internalContext.portal : true,
|
|
78
76
|
gutter: 10,
|
|
79
77
|
updatePosition: onPositionUpdate,
|
|
80
|
-
style:
|
|
81
|
-
|
|
78
|
+
style: {
|
|
79
|
+
...shift.x !== 0 || shift.y !== 0 ? { transform: `translate(${shift.x}px, ${shift.y}px)` } : void 0,
|
|
80
|
+
...maxWidth !== void 0 ? { maxWidth } : void 0
|
|
81
|
+
},
|
|
82
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_SvgFloatingOverlay.SvgFloatingOverlay, {
|
|
82
83
|
blurClassName: classNames.blur,
|
|
83
84
|
svgClassNames: { base: classNames.svg },
|
|
84
85
|
arrowHeight: ARROW_HEIGHT,
|
|
85
|
-
contentWrapperSlotProps: {
|
|
86
|
-
flexDirection: "column",
|
|
87
|
-
id
|
|
88
|
-
},
|
|
86
|
+
contentWrapperSlotProps: { id },
|
|
89
87
|
...svgFloatingContentProps,
|
|
90
|
-
children:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_VStack.VStack, {
|
|
89
|
+
className: "gap-[inherit]",
|
|
90
|
+
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
columnGap: "1",
|
|
93
|
+
children: [startTitleIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
94
|
+
iconProps: { variant: "fill" },
|
|
95
|
+
icon: startTitleIcon,
|
|
96
|
+
className: classNames.icon
|
|
97
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
98
|
+
className: classNames.title,
|
|
99
|
+
color: "inherit",
|
|
100
|
+
children: title
|
|
101
|
+
})]
|
|
102
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
columnGap: "1.5",
|
|
105
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
106
|
+
className: classNames.body,
|
|
107
|
+
color: "inherit",
|
|
108
|
+
children
|
|
109
|
+
}), endContent && !(0, react.isValidElement)(endContent) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
110
|
+
className: classNames.endContent,
|
|
111
|
+
color: "inherit",
|
|
112
|
+
children: endContent
|
|
113
|
+
}) : endContent]
|
|
101
114
|
})]
|
|
102
|
-
})
|
|
103
|
-
alignItems: "center",
|
|
104
|
-
columnGap: "1.5",
|
|
105
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
106
|
-
className: classNames.body,
|
|
107
|
-
color: "inherit",
|
|
108
|
-
children
|
|
109
|
-
}), endContent && !(0, react.isValidElement)(endContent) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
110
|
-
className: classNames.endContent,
|
|
111
|
-
color: "inherit",
|
|
112
|
-
children: endContent
|
|
113
|
-
}) : endContent]
|
|
114
|
-
})]
|
|
115
|
+
})
|
|
115
116
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.TooltipArrow, {
|
|
116
117
|
ref: arrowRef,
|
|
117
118
|
style: { opacity: 0 }
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
import { cx, getStyles } from "../../../styles/styler.js";
|
|
4
4
|
import { Box } from "../../Box.js";
|
|
5
5
|
import { Text } from "../../Text.js";
|
|
6
|
+
import { VStack } from "../../VStack.js";
|
|
6
7
|
import { IconSlot } from "../../IconSlot.js";
|
|
7
8
|
import { useForkRef } from "../../../hooks/useForkRef.js";
|
|
8
9
|
import { useSvgFloatingContent } from "../../../hooks/useSvgFloatingContent.js";
|
|
9
10
|
import { SvgFloatingOverlay } from "../../SvgFloatingOverlay.js";
|
|
10
11
|
import { useTooltipConfig } from "./UDSTooltipConfigProvider.js";
|
|
11
12
|
import { TooltipInternalContext } from "./tooltipContext.js";
|
|
12
|
-
import { forwardRef, isValidElement, useContext,
|
|
13
|
+
import { forwardRef, isValidElement, useContext, useRef } from "react";
|
|
13
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
15
|
import { Tooltip, TooltipArrow, useStoreState, useTooltipContext } from "@ariakit/react";
|
|
15
16
|
|
|
@@ -42,10 +43,7 @@ const TooltipContent = forwardRef(function TooltipContent({ children, maxWidth,
|
|
|
42
43
|
root: getStyles({
|
|
43
44
|
tooltipSizeRoot: "default",
|
|
44
45
|
tooltipVariantRoot: "default",
|
|
45
|
-
className: cx(
|
|
46
|
-
if (maxWidth !== void 0) return typeof maxWidth === "number" ? `max-w-[${maxWidth}px]` : `max-w-[${maxWidth}]`;
|
|
47
|
-
return "max-w-lg";
|
|
48
|
-
}, [maxWidth]), "flex", "z-[9999]", className)
|
|
46
|
+
className: cx(maxWidth === void 0 && "max-w-lg", "flex", "z-[9999]", className)
|
|
49
47
|
}),
|
|
50
48
|
svg: getStyles({
|
|
51
49
|
tooltipSizeSvg: "default",
|
|
@@ -57,7 +55,7 @@ const TooltipContent = forwardRef(function TooltipContent({ children, maxWidth,
|
|
|
57
55
|
position: "absolute",
|
|
58
56
|
width: "full",
|
|
59
57
|
height: "full",
|
|
60
|
-
className: cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]"
|
|
58
|
+
className: cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]")
|
|
61
59
|
}),
|
|
62
60
|
title: getStyles({ tooltipSizeTitle: "default" }),
|
|
63
61
|
body: getStyles({ tooltipSizeBody: "default" }),
|
|
@@ -75,41 +73,44 @@ const TooltipContent = forwardRef(function TooltipContent({ children, maxWidth,
|
|
|
75
73
|
portal: internalContext ? internalContext.portal : true,
|
|
76
74
|
gutter: 10,
|
|
77
75
|
updatePosition: onPositionUpdate,
|
|
78
|
-
style:
|
|
79
|
-
|
|
76
|
+
style: {
|
|
77
|
+
...shift.x !== 0 || shift.y !== 0 ? { transform: `translate(${shift.x}px, ${shift.y}px)` } : void 0,
|
|
78
|
+
...maxWidth !== void 0 ? { maxWidth } : void 0
|
|
79
|
+
},
|
|
80
|
+
children: [/* @__PURE__ */ jsx(SvgFloatingOverlay, {
|
|
80
81
|
blurClassName: classNames.blur,
|
|
81
82
|
svgClassNames: { base: classNames.svg },
|
|
82
83
|
arrowHeight: ARROW_HEIGHT,
|
|
83
|
-
contentWrapperSlotProps: {
|
|
84
|
-
flexDirection: "column",
|
|
85
|
-
id
|
|
86
|
-
},
|
|
84
|
+
contentWrapperSlotProps: { id },
|
|
87
85
|
...svgFloatingContentProps,
|
|
88
|
-
children:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
children: /* @__PURE__ */ jsxs(VStack, {
|
|
87
|
+
className: "gap-[inherit]",
|
|
88
|
+
children: [title && /* @__PURE__ */ jsxs(Box, {
|
|
89
|
+
alignItems: "center",
|
|
90
|
+
columnGap: "1",
|
|
91
|
+
children: [startTitleIcon && /* @__PURE__ */ jsx(IconSlot, {
|
|
92
|
+
iconProps: { variant: "fill" },
|
|
93
|
+
icon: startTitleIcon,
|
|
94
|
+
className: classNames.icon
|
|
95
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
96
|
+
className: classNames.title,
|
|
97
|
+
color: "inherit",
|
|
98
|
+
children: title
|
|
99
|
+
})]
|
|
100
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
columnGap: "1.5",
|
|
103
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
104
|
+
className: classNames.body,
|
|
105
|
+
color: "inherit",
|
|
106
|
+
children
|
|
107
|
+
}), endContent && !isValidElement(endContent) ? /* @__PURE__ */ jsx(Text, {
|
|
108
|
+
className: classNames.endContent,
|
|
109
|
+
color: "inherit",
|
|
110
|
+
children: endContent
|
|
111
|
+
}) : endContent]
|
|
99
112
|
})]
|
|
100
|
-
})
|
|
101
|
-
alignItems: "center",
|
|
102
|
-
columnGap: "1.5",
|
|
103
|
-
children: [/* @__PURE__ */ jsx(Text, {
|
|
104
|
-
className: classNames.body,
|
|
105
|
-
color: "inherit",
|
|
106
|
-
children
|
|
107
|
-
}), endContent && !isValidElement(endContent) ? /* @__PURE__ */ jsx(Text, {
|
|
108
|
-
className: classNames.endContent,
|
|
109
|
-
color: "inherit",
|
|
110
|
-
children: endContent
|
|
111
|
-
}) : endContent]
|
|
112
|
-
})]
|
|
113
|
+
})
|
|
113
114
|
}), /* @__PURE__ */ jsx(TooltipArrow, {
|
|
114
115
|
ref: arrowRef,
|
|
115
116
|
style: { opacity: 0 }
|
|
@@ -142,7 +142,22 @@ function useSvgFloatingContent({ open, effectivePlacement, borderRadius, arrowRe
|
|
|
142
142
|
arrowTipRadiusFraction
|
|
143
143
|
]);
|
|
144
144
|
const blurStyle = (0, react.useMemo)(() => {
|
|
145
|
-
const style = {
|
|
145
|
+
const style = {};
|
|
146
|
+
if (blurClipPath && dimensions.width > 0 && dimensions.height > 0) {
|
|
147
|
+
let maskWidth = dimensions.width;
|
|
148
|
+
let maskHeight = dimensions.height;
|
|
149
|
+
if (!hideArrow) {
|
|
150
|
+
const arrowSide = require_utils_svgFloatingContentUtils.getArrowSide(effectivePlacement);
|
|
151
|
+
if (arrowSide === "top" || arrowSide === "bottom") maskHeight += arrowHeight;
|
|
152
|
+
else maskWidth += arrowHeight;
|
|
153
|
+
}
|
|
154
|
+
const svgMask = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${maskWidth} ${maskHeight}'><path d='${blurClipPath}' fill='white'/></svg>`;
|
|
155
|
+
const maskUrl = `url("data:image/svg+xml,${encodeURIComponent(svgMask)}")`;
|
|
156
|
+
style.WebkitMaskImage = maskUrl;
|
|
157
|
+
style.maskImage = maskUrl;
|
|
158
|
+
style.WebkitMaskSize = "100% 100%";
|
|
159
|
+
style.maskSize = "100% 100%";
|
|
160
|
+
}
|
|
146
161
|
if (!hideArrow) switch (require_utils_svgFloatingContentUtils.getArrowSide(effectivePlacement)) {
|
|
147
162
|
case "top":
|
|
148
163
|
style.height = `calc(100% + ${arrowHeight}px)`;
|
|
@@ -164,6 +179,8 @@ function useSvgFloatingContent({ open, effectivePlacement, borderRadius, arrowRe
|
|
|
164
179
|
return style;
|
|
165
180
|
}, [
|
|
166
181
|
blurClipPath,
|
|
182
|
+
dimensions.width,
|
|
183
|
+
dimensions.height,
|
|
167
184
|
effectivePlacement,
|
|
168
185
|
hideArrow,
|
|
169
186
|
arrowHeight
|
|
@@ -140,7 +140,22 @@ function useSvgFloatingContent({ open, effectivePlacement, borderRadius, arrowRe
|
|
|
140
140
|
arrowTipRadiusFraction
|
|
141
141
|
]);
|
|
142
142
|
const blurStyle = useMemo(() => {
|
|
143
|
-
const style = {
|
|
143
|
+
const style = {};
|
|
144
|
+
if (blurClipPath && dimensions.width > 0 && dimensions.height > 0) {
|
|
145
|
+
let maskWidth = dimensions.width;
|
|
146
|
+
let maskHeight = dimensions.height;
|
|
147
|
+
if (!hideArrow) {
|
|
148
|
+
const arrowSide = getArrowSide(effectivePlacement);
|
|
149
|
+
if (arrowSide === "top" || arrowSide === "bottom") maskHeight += arrowHeight;
|
|
150
|
+
else maskWidth += arrowHeight;
|
|
151
|
+
}
|
|
152
|
+
const svgMask = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${maskWidth} ${maskHeight}'><path d='${blurClipPath}' fill='white'/></svg>`;
|
|
153
|
+
const maskUrl = `url("data:image/svg+xml,${encodeURIComponent(svgMask)}")`;
|
|
154
|
+
style.WebkitMaskImage = maskUrl;
|
|
155
|
+
style.maskImage = maskUrl;
|
|
156
|
+
style.WebkitMaskSize = "100% 100%";
|
|
157
|
+
style.maskSize = "100% 100%";
|
|
158
|
+
}
|
|
144
159
|
if (!hideArrow) switch (getArrowSide(effectivePlacement)) {
|
|
145
160
|
case "top":
|
|
146
161
|
style.height = `calc(100% + ${arrowHeight}px)`;
|
|
@@ -162,6 +177,8 @@ function useSvgFloatingContent({ open, effectivePlacement, borderRadius, arrowRe
|
|
|
162
177
|
return style;
|
|
163
178
|
}, [
|
|
164
179
|
blurClipPath,
|
|
180
|
+
dimensions.width,
|
|
181
|
+
dimensions.height,
|
|
165
182
|
effectivePlacement,
|
|
166
183
|
hideArrow,
|
|
167
184
|
arrowHeight
|
package/dist/styles/styler.d.cts
CHANGED
|
@@ -160,7 +160,7 @@ declare const getStylesInternal: (props?: ({
|
|
|
160
160
|
fontWeight?: "black" | "thin" | "medium" | "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | "bold" | "extralight" | "light" | "regular" | "semibold" | "extrabold" | undefined;
|
|
161
161
|
lineHeight?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | undefined;
|
|
162
162
|
letterSpacing?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | undefined;
|
|
163
|
-
textAlign?: "
|
|
163
|
+
textAlign?: "start" | "end" | "center" | "justify" | undefined;
|
|
164
164
|
textTransform?: "none" | "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | "uppercase" | "lowercase" | "capitalize" | undefined;
|
|
165
165
|
spacing?: "0" | "1" | "2" | "3" | "4" | "5" | "px" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | undefined;
|
|
166
166
|
spacingHorizontal?: "0" | "1" | "2" | "3" | "4" | "5" | "px" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | undefined;
|
|
@@ -213,7 +213,7 @@ declare const getStylesInternal: (props?: ({
|
|
|
213
213
|
overflowX?: "hidden" | "auto" | "clip" | "visible" | "scroll" | undefined;
|
|
214
214
|
overflowY?: "hidden" | "auto" | "clip" | "visible" | "scroll" | undefined;
|
|
215
215
|
position?: "static" | "fixed" | "absolute" | "relative" | "sticky" | undefined;
|
|
216
|
-
contentFit?: "none" | "
|
|
216
|
+
contentFit?: "none" | "contain" | "fill" | "cover" | "scale-down" | undefined;
|
|
217
217
|
colorMode?: "light" | "dark" | undefined;
|
|
218
218
|
scaleMode?: "small" | "medium" | "xSmall" | "large" | "xLarge" | "xxLarge" | "xxxLarge" | undefined;
|
|
219
219
|
width?: "full" | "fit" | "screen" | undefined;
|
package/dist/styles/styler.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ declare const getStylesInternal: (props?: ({
|
|
|
160
160
|
fontWeight?: "black" | "thin" | "medium" | "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | "bold" | "extralight" | "light" | "regular" | "semibold" | "extrabold" | undefined;
|
|
161
161
|
lineHeight?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | undefined;
|
|
162
162
|
letterSpacing?: "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | undefined;
|
|
163
|
-
textAlign?: "
|
|
163
|
+
textAlign?: "start" | "end" | "center" | "justify" | undefined;
|
|
164
164
|
textTransform?: "none" | "display1" | "display2" | "display3" | "title1" | "title2" | "title3" | "title4" | "headline1" | "body1" | "label1" | "label2" | "label3" | "label4" | "caption1" | "caption2" | "legal1" | "ui1" | "ui2" | "ui3" | "ui4" | "ui5" | "ui6" | "display1/emphasized" | "display2/emphasized" | "display3/emphasized" | "title1/emphasized" | "title2/emphasized" | "title3/emphasized" | "title4/emphasized" | "headline1/emphasized" | "body1/emphasized" | "label1/emphasized" | "label2/emphasized" | "label3/emphasized" | "label4/emphasized" | "caption1/emphasized" | "caption2/emphasized" | "legal1/emphasized" | "ui1/emphasized" | "ui2/emphasized" | "ui3/emphasized" | "ui4/emphasized" | "ui5/emphasized" | "ui6/emphasized" | "uppercase" | "lowercase" | "capitalize" | undefined;
|
|
165
165
|
spacing?: "0" | "1" | "2" | "3" | "4" | "5" | "px" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | undefined;
|
|
166
166
|
spacingHorizontal?: "0" | "1" | "2" | "3" | "4" | "5" | "px" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | undefined;
|
|
@@ -213,7 +213,7 @@ declare const getStylesInternal: (props?: ({
|
|
|
213
213
|
overflowX?: "hidden" | "auto" | "clip" | "visible" | "scroll" | undefined;
|
|
214
214
|
overflowY?: "hidden" | "auto" | "clip" | "visible" | "scroll" | undefined;
|
|
215
215
|
position?: "static" | "fixed" | "absolute" | "relative" | "sticky" | undefined;
|
|
216
|
-
contentFit?: "none" | "
|
|
216
|
+
contentFit?: "none" | "contain" | "fill" | "cover" | "scale-down" | undefined;
|
|
217
217
|
colorMode?: "light" | "dark" | undefined;
|
|
218
218
|
scaleMode?: "small" | "medium" | "xSmall" | "large" | "xLarge" | "xxLarge" | "xxxLarge" | undefined;
|
|
219
219
|
width?: "full" | "fit" | "screen" | undefined;
|
|
@@ -19,6 +19,6 @@ import { FontConfig } from "../../../../types/dist/index.cjs";
|
|
|
19
19
|
* addBase(fontVars);
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-
|
|
22
|
+
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-sans-alt" | "--uds-font-serif" | "--uds-font-serif-alt" | "--uds-font-mono", string>; //#endregion
|
|
23
23
|
//#endregion
|
|
24
24
|
export { getFontStyles };
|
|
@@ -19,6 +19,6 @@ import { FontConfig } from "../../../../types/dist/index.js";
|
|
|
19
19
|
* addBase(fontVars);
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-
|
|
22
|
+
declare function getFontStyles(fontConfig: Partial<FontConfig>): Record<"--uds-font-sans" | "--uds-font-sans-alt" | "--uds-font-serif" | "--uds-font-serif-alt" | "--uds-font-mono", string>; //#endregion
|
|
23
23
|
//#endregion
|
|
24
24
|
export { getFontStyles };
|