@sia.soul/sia-react-ui 0.1.149 → 0.1.151
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/{chunk-HRC6TQTZ.js → chunk-5P274RXG.js} +4 -2
- package/dist/{chunk-G5YXOCSY.js → chunk-GA5HA2A4.js} +1 -1
- package/dist/{chunk-TKRCHZB7.js → chunk-PDYEIHUO.js} +1 -1
- package/dist/core.cjs +4 -2
- package/dist/core.css +35 -2
- package/dist/core.js +2 -2
- package/dist/game.css +35 -2
- package/dist/index.cjs +1789 -1621
- package/dist/index.css +63 -2
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +444 -278
- package/dist/select-date-range.cjs +4 -2
- package/dist/select-date-range.js +2 -2
- package/package.json +1 -1
|
@@ -4053,9 +4053,10 @@ function Floating({
|
|
|
4053
4053
|
const leaveTimer = (0, import_react18.useRef)();
|
|
4054
4054
|
const contentId = (0, import_react18.useId)();
|
|
4055
4055
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
4056
|
+
const hasContent = content !== null && content !== void 0 && typeof content !== "boolean" && !(typeof content === "string" && content.trim() === "");
|
|
4056
4057
|
const [visible, setVisible] = useControllableState({ value: open, defaultValue: defaultOpen, onChange: onOpenChange });
|
|
4057
4058
|
const [position, setPosition] = (0, import_react18.useState)();
|
|
4058
|
-
const motion = useOverlayMotion(!!visible, overlayRef, "tooltip", "bottom", !!position, void 0, !overlayClassName.includes("sia-form-item__error-popover"));
|
|
4059
|
+
const motion = useOverlayMotion(!!visible && hasContent, overlayRef, "tooltip", "bottom", !!position, void 0, !overlayClassName.includes("sia-form-item__error-popover"));
|
|
4059
4060
|
const [portalContainer, setPortalContainer] = (0, import_react18.useState)(null);
|
|
4060
4061
|
(0, import_react18.useLayoutEffect)(() => {
|
|
4061
4062
|
if (!motion.present) return;
|
|
@@ -4067,6 +4068,7 @@ function Floating({
|
|
|
4067
4068
|
if (!closeSelfRef.current) closeSelfRef.current = () => setVisibleRef.current(false);
|
|
4068
4069
|
const exclusiveTooltip = role === "tooltip" && triggers.includes("hover");
|
|
4069
4070
|
function openNow() {
|
|
4071
|
+
if (!hasContent) return;
|
|
4070
4072
|
if (exclusiveTooltip && activeTooltipClose !== closeSelfRef.current) {
|
|
4071
4073
|
activeTooltipClose?.();
|
|
4072
4074
|
activeTooltipClose = closeSelfRef.current;
|
|
@@ -4179,7 +4181,7 @@ function Floating({
|
|
|
4179
4181
|
} } : {},
|
|
4180
4182
|
"aria-describedby": visible ? contentId : void 0
|
|
4181
4183
|
});
|
|
4182
|
-
const overlay = motion.present &&
|
|
4184
|
+
const overlay = motion.present && hasContent && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
|
|
4183
4185
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
4184
4186
|
"span",
|
|
4185
4187
|
{
|