next-helios-fe 1.8.58 → 1.8.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-helios-fe",
3
- "version": "1.8.58",
3
+ "version": "1.8.59",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -184,42 +184,43 @@ export const Tooltip: React.FC<TooltipProps> = ({
184
184
  onMouseLeave={() => setVisible(false)}
185
185
  >
186
186
  {children}
187
- {createPortal(
188
- <div
189
- ref={tooltipRef}
190
- className={`absolute z-50 duration-200 transition-opacity ${
191
- visible ? "opacity-100" : "opacity-0 pointer-events-none"
192
- } ${options?.enableHover ? "" : "pointer-events-none"}`}
193
- style={getTooltipPosition()}
194
- >
195
- {position === "bottom" && (
196
- <div className="flex justify-center">
197
- <div style={getTooltipArrowPosition()}></div>
198
- </div>
199
- )}
200
- <div className="flex items-center">
201
- {position === "right" && (
187
+ {typeof document !== "undefined" &&
188
+ createPortal(
189
+ <div
190
+ ref={tooltipRef}
191
+ className={`absolute z-50 duration-200 transition-opacity ${
192
+ visible ? "opacity-100" : "opacity-0 pointer-events-none"
193
+ } ${options?.enableHover ? "" : "pointer-events-none"}`}
194
+ style={getTooltipPosition()}
195
+ >
196
+ {position === "bottom" && (
202
197
  <div className="flex justify-center">
203
198
  <div style={getTooltipArrowPosition()}></div>
204
199
  </div>
205
200
  )}
206
- <div className="max-w-96 w-fit px-3 py-1.5 rounded-md bg-black/75 text-sm text-white">
207
- {content}
201
+ <div className="flex items-center">
202
+ {position === "right" && (
203
+ <div className="flex justify-center">
204
+ <div style={getTooltipArrowPosition()}></div>
205
+ </div>
206
+ )}
207
+ <div className="max-w-96 w-fit px-3 py-1.5 rounded-md bg-black/75 text-sm text-white">
208
+ {content}
209
+ </div>
210
+ {position === "left" && (
211
+ <div className="flex justify-center">
212
+ <div style={getTooltipArrowPosition()}></div>
213
+ </div>
214
+ )}
208
215
  </div>
209
- {position === "left" && (
216
+ {position === "top" && (
210
217
  <div className="flex justify-center">
211
218
  <div style={getTooltipArrowPosition()}></div>
212
219
  </div>
213
220
  )}
214
- </div>
215
- {position === "top" && (
216
- <div className="flex justify-center">
217
- <div style={getTooltipArrowPosition()}></div>
218
- </div>
219
- )}
220
- </div>,
221
- document.body
222
- )}
221
+ </div>,
222
+ document.body
223
+ )}
223
224
  </div>
224
225
  );
225
226
  };