funuicss 3.9.0 → 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/css/fun.css CHANGED
@@ -2145,6 +2145,7 @@ z-index: 9999 !important;
2145
2145
  top: 0;
2146
2146
  }
2147
2147
 
2148
+
2148
2149
  /* Dropdown Item */
2149
2150
  .dropdown-item {
2150
2151
  padding: 0.4rem 0.8rem;
@@ -4527,101 +4528,62 @@ filter: brightness(90%);
4527
4528
  background-color: rgba(0, 0, 0, 0.1);
4528
4529
  }
4529
4530
 
4530
- .tooltip {
4531
- position: relative;
4532
- display: inline-block;
4533
- }
4534
-
4535
- .tooltip .tip {
4536
- display: block;
4537
- background-color: var(--dark);
4538
- backdrop-filter: var(--raiseBackdrop);
4539
- color: var(--white);
4540
- text-align: center;
4541
- border-radius: var(--radius);
4542
- padding: 0.2rem 0.5rem !important;
4543
- font-weight: 500 !important;
4544
- position: absolute;
4545
- z-index: 10;
4546
- transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
4531
+ /* Portal tooltip specific styles */
4532
+ .tip[style*="position: fixed"] {
4533
+ position: fixed !important;
4534
+ z-index: 9999 !important;
4535
+ background-color: var(--dark) !important;
4536
+ color: var(--white) !important;
4537
+ padding: 0.4rem 0.75rem !important;
4538
+ border-radius: var(--radius) !important;
4539
+ box-shadow: var(--raised) !important;
4547
4540
  font-size: var(--smallFont) !important;
4548
- line-height: normal !important;
4549
- box-shadow: var(--raised);
4550
- width: max-content;
4551
- white-space: nowrap; /* prevents line breaks */
4552
- opacity: 0;
4553
- pointer-events: none;
4554
- }
4555
-
4556
-
4557
- /* Show on hover */
4558
- .tooltip:hover .tip {
4559
- opacity: 1;
4560
- visibility: visible;
4561
- pointer-events: auto;
4562
- }
4563
-
4564
- /* Arrow base */
4565
- .tooltip .tip::after {
4566
- content: "";
4567
- position: absolute;
4568
- border-style: solid;
4569
- }
4570
-
4571
- /* Top Tooltip */
4572
- .tooltip .tip-top {
4573
- bottom: 125%;
4574
- left: 50%;
4575
- transform: translateX(-50%);
4576
- }
4577
- .tooltip .tip-top::after {
4578
- top: 100%;
4579
- left: 50%;
4580
- transform: translateX(-50%);
4581
- border-width: 6px 6px 0 6px;
4582
- border-color: var(--dark) transparent transparent transparent;
4583
- }
4584
-
4585
- /* Bottom Tooltip */
4586
- .tooltip .tip-bottom {
4587
- top: 125%;
4588
- left: 50%;
4589
- transform: translateX(-50%);
4590
- }
4591
- .tooltip .tip-bottom::after {
4592
- bottom: 100%;
4593
- left: 50%;
4594
- transform: translateX(-50%);
4595
- border-width: 0 6px 6px 6px;
4596
- border-color: transparent transparent var(--dark) transparent;
4597
- }
4598
-
4599
- /* Right Tooltip */
4600
- .tooltip .tip-right {
4601
- top: 50%;
4602
- left: 105%;
4603
- transform: translateY(-50%);
4604
- }
4605
- .tooltip .tip-right::after {
4606
- top: 50%;
4607
- left: -6px;
4608
- transform: translateY(-50%);
4609
- border-width: 6px 6px 6px 0;
4610
- border-color: transparent var(--dark) transparent transparent;
4611
- }
4612
-
4613
- /* Left Tooltip */
4614
- .tooltip .tip-left {
4615
- top: 50%;
4616
- right: 105%;
4617
- transform: translateY(-50%);
4618
- }
4619
- .tooltip .tip-left::after {
4620
- top: 50%;
4621
- right: -6px;
4622
- transform: translateY(-50%);
4623
- border-width: 6px 0 6px 6px;
4624
- border-color: transparent transparent transparent var(--dark);
4541
+ max-width: 200px !important;
4542
+ white-space: nowrap !important;
4543
+ pointer-events: none !important;
4544
+ }
4545
+
4546
+ /* Arrow for portal tooltips */
4547
+ .tip[style*="position: fixed"]::after {
4548
+ content: "" !important;
4549
+ position: absolute !important;
4550
+ border-style: solid !important;
4551
+ }
4552
+
4553
+ /* Top arrow */
4554
+ .tip-top[style*="position: fixed"]::after {
4555
+ bottom: -6px !important;
4556
+ left: 50% !important;
4557
+ transform: translateX(-50%) !important;
4558
+ border-width: 6px 6px 0 6px !important;
4559
+ border-color: var(--dark) transparent transparent transparent !important;
4560
+ }
4561
+
4562
+ /* Bottom arrow */
4563
+ .tip-bottom[style*="position: fixed"]::after {
4564
+ top: -6px !important;
4565
+ left: 50% !important;
4566
+ transform: translateX(-50%) !important;
4567
+ border-width: 0 6px 6px 6px !important;
4568
+ border-color: transparent transparent var(--dark) transparent !important;
4569
+ }
4570
+
4571
+ /* Left arrow */
4572
+ .tip-left[style*="position: fixed"]::after {
4573
+ right: -6px !important;
4574
+ top: 50% !important;
4575
+ transform: translateY(-50%) !important;
4576
+ border-width: 6px 0 6px 6px !important;
4577
+ border-color: transparent transparent transparent var(--dark) !important;
4578
+ }
4579
+
4580
+ /* Right arrow */
4581
+ .tip-right[style*="position: fixed"]::after {
4582
+ left: -6px !important;
4583
+ top: 50% !important;
4584
+ transform: translateY(-50%) !important;
4585
+ border-width: 6px 6px 6px 0 !important;
4586
+ border-color: transparent var(--dark) transparent transparent !important;
4625
4587
  }
4626
4588
 
4627
4589
  .snackbar {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.9.0",
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 || "" },
@@ -46,6 +46,7 @@ var Button_1 = __importDefault(require("../button/Button"));
46
46
  var Accordion_1 = __importDefault(require("../accordion/Accordion"));
47
47
  var bs_1 = require("react-icons/bs");
48
48
  var Flex_1 = __importDefault(require("../flex/Flex"));
49
+ var ToolTip_1 = __importDefault(require("../tooltip/ToolTip"));
49
50
  function SideBar(_a) {
50
51
  var _b, _c;
51
52
  var _d = _a.funcss, funcss = _d === void 0 ? '' : _d, _e = _a.position, position = _e === void 0 ? 'left' : _e, _f = _a.open, open = _f === void 0 ? false : _f, header = _a.header, content = _a.content, footer = _a.footer, _g = _a.top, top = _g === void 0 ? 0 : _g, _h = _a.sidebarWidth, sidebarWidth = _h === void 0 ? 250 : _h, _j = _a.iconCSS, iconCSS = _j === void 0 ? '' : _j, _k = _a.sidebarCss, sidebarCss = _k === void 0 ? '' : _k, activeCss = _a.activeCss, _l = _a.bodyCss, bodyCss = _l === void 0 ? '' : _l, _m = _a.popIcon, popIcon = _m === void 0 ? false : _m, _o = _a.dividers, dividers = _o === void 0 ? false : _o, accordionItemCss = _a.accordionItemCss, _p = _a.links, links = _p === void 0 ? [] : _p, children = _a.children, onClose = _a.onClose, togglePrefix = _a.togglePrefix, _q = _a.isAccordion, isAccordion = _q === void 0 ? false : _q, _r = _a.isCollapsed, isCollapsed = _r === void 0 ? true : _r, // Default to true as requested
@@ -166,23 +167,24 @@ function SideBar(_a) {
166
167
  var isActive = link.onClick
167
168
  ? selectedOption === "".concat(section, "-").concat(index)
168
169
  : pathname === link.uri;
169
- return (react_1.default.createElement("div", { onClick: function () {
170
- if (isMobile) {
171
- handleClose();
172
- }
173
- if (link === null || link === void 0 ? void 0 : link.onClick) {
174
- link.onClick();
175
- setselectedOption("".concat(section, "-").concat(index));
176
- }
177
- else {
178
- window.location.href = link.uri;
179
- }
180
- }, key: link.uri, className: 'hover-scale-rotate hover-text-primary' },
181
- react_1.default.createElement("span", { className: " pointer ".concat(iconCSS || '', " ").concat(variant === 'standard' || popIcon
182
- ? "p-1 ".concat(isActive ? 'text-primary' : 'bg border', " central")
183
- : variant === 'minimal' && !isActive
184
- ? 'p-1 central bg'
185
- : ''), style: { lineHeight: 0, borderRadius: '0.4rem', fontSize: collapseIconSize } }, link.icon)));
170
+ return (react_1.default.createElement(ToolTip_1.default, { key: link.uri, message: link.text, tip: 'right' },
171
+ react_1.default.createElement("div", { onClick: function () {
172
+ if (isMobile) {
173
+ handleClose();
174
+ }
175
+ if (link === null || link === void 0 ? void 0 : link.onClick) {
176
+ link.onClick();
177
+ setselectedOption("".concat(section, "-").concat(index));
178
+ }
179
+ else {
180
+ window.location.href = link.uri;
181
+ }
182
+ }, className: 'hover-scale-rotate hover-text-primary' },
183
+ react_1.default.createElement("span", { className: " pointer ".concat(iconCSS || '', " ").concat(variant === 'standard' || popIcon
184
+ ? "p-1 ".concat(isActive ? 'text-primary' : 'bg border', " central")
185
+ : variant === 'minimal' && !isActive
186
+ ? 'p-1 central bg'
187
+ : ''), style: { lineHeight: 0, borderRadius: '0.4rem', fontSize: collapseIconSize } }, link.icon))));
186
188
  }),
187
189
  sectionIndex < Object.keys(groupedLinks).length - 1 && (react_1.default.createElement("div", { className: "mt-1 mb-1 bt fit" }))));
188
190
  })))))),
@@ -2,6 +2,12 @@ import * as React from 'react';
2
2
  interface ToolTipProps {
3
3
  funcss?: string;
4
4
  children?: React.ReactNode;
5
+ content?: React.ReactNode;
6
+ message?: React.ReactNode;
7
+ animation?: string;
8
+ duration?: number;
9
+ tip?: 'top' | 'bottom' | 'left' | 'right';
10
+ usePortal?: boolean;
5
11
  }
6
- export default function ToolTip({ funcss, children, ...rest }: ToolTipProps): React.JSX.Element;
12
+ export default function ToolTip({ funcss, children, content, message, animation, duration, tip, usePortal, ...rest }: ToolTipProps): React.JSX.Element;
7
13
  export {};
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
  var __assign = (this && this.__assign) || function () {
3
4
  __assign = Object.assign || function(t) {
4
5
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -57,7 +58,78 @@ var __rest = (this && this.__rest) || function (s, e) {
57
58
  Object.defineProperty(exports, "__esModule", { value: true });
58
59
  exports.default = ToolTip;
59
60
  var React = __importStar(require("react"));
61
+ var react_dom_1 = require("react-dom");
60
62
  function ToolTip(_a) {
61
- var funcss = _a.funcss, children = _a.children, rest = __rest(_a, ["funcss", "children"]);
62
- return (React.createElement("span", __assign({ className: "tooltip ".concat(funcss !== null && funcss !== void 0 ? funcss : '') }, rest), children));
63
+ var funcss = _a.funcss, children = _a.children, content = _a.content, message = _a.message, animation = _a.animation, duration = _a.duration, _b = _a.tip, tip = _b === void 0 ? 'top' : _b, _c = _a.usePortal, usePortal = _c === void 0 ? true : _c, rest = __rest(_a, ["funcss", "children", "content", "message", "animation", "duration", "tip", "usePortal"]);
64
+ var _d = React.useState(false), isVisible = _d[0], setIsVisible = _d[1];
65
+ var _e = React.useState({ x: 0, y: 0 }), coords = _e[0], setCoords = _e[1];
66
+ var triggerRef = React.useRef(null);
67
+ var text = message || content || children;
68
+ var handleMouseEnter = function () {
69
+ if (triggerRef.current) {
70
+ var rect = triggerRef.current.getBoundingClientRect();
71
+ var x = rect.left + (rect.width / 2);
72
+ var y = rect.top;
73
+ if (tip === 'bottom') {
74
+ y = rect.bottom;
75
+ }
76
+ else if (tip === 'left') {
77
+ x = rect.left;
78
+ y = rect.top + (rect.height / 2);
79
+ }
80
+ else if (tip === 'right') {
81
+ x = rect.right;
82
+ y = rect.top + (rect.height / 2);
83
+ }
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 });
88
+ setIsVisible(true);
89
+ }
90
+ };
91
+ var handleMouseLeave = function () {
92
+ setIsVisible(false);
93
+ };
94
+ // Don't render portal-related JSX during SSR
95
+ var isBrowser = typeof window !== 'undefined';
96
+ var tooltipStyle = isBrowser ? {
97
+ position: 'fixed',
98
+ top: coords.y,
99
+ left: coords.x,
100
+ zIndex: 9999,
101
+ opacity: isVisible ? 1 : 0,
102
+ transition: 'opacity 0.2s ease',
103
+ pointerEvents: 'none',
104
+ transform: tip === 'top' ? 'translate(-50%, -100%)' :
105
+ tip === 'bottom' ? 'translate(-50%, 0)' :
106
+ tip === 'left' ? 'translate(-100%, -50%)' :
107
+ 'translate(0, -50%)',
108
+ } : {};
109
+ return (React.createElement(React.Fragment, null,
110
+ React.createElement("span", __assign({ ref: triggerRef, className: "tooltip ".concat(funcss), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, rest),
111
+ !usePortal && text && (React.createElement("div", { className: "tip tip-".concat(tip) }, text)),
112
+ children && children !== text ? children : null),
113
+ isBrowser && usePortal && text && isVisible && (0, react_dom_1.createPortal)(React.createElement("div", { className: "tip tip-".concat(tip), style: tooltipStyle }, text), document.body)));
63
114
  }
115
+ // import * as React from 'react';
116
+ // import Tip from './Tip';
117
+ // interface ToolTipProps {
118
+ // funcss?: string;
119
+ // children?: React.ReactNode;
120
+ // content?: React.ReactNode;
121
+ // message?: React.ReactNode;
122
+ // animation?: string;
123
+ // duration?: number;
124
+ // }
125
+ // export default function ToolTip({ funcss, children, content, message, animation, duration, ...rest }: ToolTipProps) {
126
+ // const text = message || content || children;
127
+ // return (
128
+ // <span
129
+ // className={`tooltip ${funcss}`}
130
+ // {...rest}
131
+ // >
132
+ // {text && <Tip tip="top" content={text} animation={animation} duration={duration} />}
133
+ // </span>
134
+ // );
135
+ // }