funuicss 3.9.1 → 3.9.2

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,5 +1,5 @@
1
1
  {
2
- "version": "3.9.1",
2
+ "version": "3.9.2",
3
3
  "name": "funuicss",
4
4
  "description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
5
5
  "main": "index.js",
package/ui/form/Form.js CHANGED
@@ -770,7 +770,7 @@ var Form = function (props) {
770
770
  console.warn('Form: No fields configured. Please provide fields prop or configure via theme.');
771
771
  return null;
772
772
  }
773
- return (react_1.default.createElement("div", { className: "form-wrapper ".concat(centered ? 'center' : '', " ").concat(className), style: { width: "100%", maxWidth: width || "450px" } },
773
+ return (react_1.default.createElement("div", { className: "form-wrapper p-5 ".concat(centered ? 'center' : '', " ").concat(className), style: { width: "100%", maxWidth: width || "450px" } },
774
774
  title && (react_1.default.createElement("div", { className: "form-header", style: { marginBottom: '2rem' } },
775
775
  react_1.default.createElement(Text_1.default, { text: title, size: titleSize || "3xl", color: titleColor || "", block: true }),
776
776
  description && (react_1.default.createElement(Text_1.default, { article: true, size: descriptionSize || "sm", color: descriptionColor || "" },
@@ -65,7 +65,7 @@ function ToolTip(_a) {
65
65
  var _e = React.useState({ x: 0, y: 0 }), coords = _e[0], setCoords = _e[1];
66
66
  var triggerRef = React.useRef(null);
67
67
  var text = message || content || children;
68
- var handleMouseEnter = function (e) {
68
+ var handleMouseEnter = function () {
69
69
  if (triggerRef.current) {
70
70
  var rect = triggerRef.current.getBoundingClientRect();
71
71
  var x = rect.left + (rect.width / 2);
@@ -81,17 +81,22 @@ function ToolTip(_a) {
81
81
  x = rect.right;
82
82
  y = rect.top + (rect.height / 2);
83
83
  }
84
- setCoords({ x: x, y: y });
84
+ // Safely get scroll position
85
+ var scrollX_1 = typeof window !== 'undefined' ? window.scrollX : 0;
86
+ var scrollY_1 = typeof window !== 'undefined' ? window.scrollY : 0;
87
+ setCoords({ x: x + scrollX_1, y: y + scrollY_1 });
85
88
  setIsVisible(true);
86
89
  }
87
90
  };
88
91
  var handleMouseLeave = function () {
89
92
  setIsVisible(false);
90
93
  };
91
- var tooltipStyle = {
94
+ // Don't render portal-related JSX during SSR
95
+ var isBrowser = typeof window !== 'undefined';
96
+ var tooltipStyle = isBrowser ? {
92
97
  position: 'fixed',
93
- top: coords.y + window.scrollY,
94
- left: coords.x + window.scrollX,
98
+ top: coords.y,
99
+ left: coords.x,
95
100
  zIndex: 9999,
96
101
  opacity: isVisible ? 1 : 0,
97
102
  transition: 'opacity 0.2s ease',
@@ -100,12 +105,12 @@ function ToolTip(_a) {
100
105
  tip === 'bottom' ? 'translate(-50%, 0)' :
101
106
  tip === 'left' ? 'translate(-100%, -50%)' :
102
107
  'translate(0, -50%)',
103
- };
108
+ } : {};
104
109
  return (React.createElement(React.Fragment, null,
105
110
  React.createElement("span", __assign({ ref: triggerRef, className: "tooltip ".concat(funcss), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, rest),
106
111
  !usePortal && text && (React.createElement("div", { className: "tip tip-".concat(tip) }, text)),
107
112
  children && children !== text ? children : null),
108
- usePortal && text && isVisible && (0, react_dom_1.createPortal)(React.createElement("div", { className: "tip tip-".concat(tip), style: tooltipStyle }, text), document.body)));
113
+ isBrowser && usePortal && text && isVisible && (0, react_dom_1.createPortal)(React.createElement("div", { className: "tip tip-".concat(tip), style: tooltipStyle }, text), document.body)));
109
114
  }
110
115
  // import * as React from 'react';
111
116
  // import Tip from './Tip';