@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.
@@ -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 && content !== null && content !== void 0 && typeof document !== "undefined" ? (0, import_react_dom3.createPortal)(
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
  {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SelectDateRange
3
- } from "./chunk-TKRCHZB7.js";
4
- import "./chunk-HRC6TQTZ.js";
3
+ } from "./chunk-PDYEIHUO.js";
4
+ import "./chunk-5P274RXG.js";
5
5
  import "./chunk-J4R734AI.js";
6
6
  import "./chunk-NRLIOMXY.js";
7
7
  import "./chunk-SCVUD2IJ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.149",
3
+ "version": "0.1.151",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",