@versini/ui-tooltip 5.0.0 → 5.0.1

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -16
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- @versini/ui-tooltip v5.0.0
2
+ @versini/ui-tooltip v5.0.1
3
3
  © 2025 gizmette.com
4
4
  */
5
5
  try {
6
6
  if (!window.__VERSINI_UI_TOOLTIP__) {
7
7
  window.__VERSINI_UI_TOOLTIP__ = {
8
- version: "5.0.0",
9
- buildTime: "12/16/2025 06:23 PM EST",
8
+ version: "5.0.1",
9
+ buildTime: "12/24/2025 09:20 AM EST",
10
10
  homepage: "https://www.npmjs.com/package/@versini/ui-tooltip",
11
11
  license: "MIT",
12
12
  };
@@ -98,18 +98,18 @@ const getAnimationStyles = ({ animationDuration = 300 })=>{
98
98
  const DEFAULT_DEACTIVATION_DELAY = 5000;
99
99
  const Tooltip = ({ trigger, label, placement = "top", mode = "system", animationDuration = 300, delay = 0, className, tooltipClassName, arrowClassName })=>{
100
100
  const referenceRef = useClickOutside(()=>{
101
- /* v8 ignore next 1 */ delayedRestartTooltip.stop(), setDisabled(false);
102
- });
101
+ /* v8 ignore start */ delayedRestartTooltip.stop(), setDisabled(false);
102
+ /* v8 ignore stop */ });
103
103
  const floatingRef = useRef(null);
104
104
  const floatingArrowRef = useRef(null);
105
105
  const showTimeoutRef = useRef(null);
106
106
  const [showTooltip, setShowTooltip] = useState(false);
107
107
  const [disabled, setDisabled] = useState(false);
108
108
  const [isPositioned, setIsPositioned] = useState(false);
109
- const delayedRestartTooltip = useInterval(()=>{
109
+ /* v8 ignore start - delayed interval callback */ const delayedRestartTooltip = useInterval(()=>{
110
110
  setDisabled(false);
111
111
  }, DEFAULT_DEACTIVATION_DELAY);
112
- const tooltipClasses = getTooltipClasses({
112
+ /* v8 ignore stop */ const tooltipClasses = getTooltipClasses({
113
113
  mode,
114
114
  className,
115
115
  tooltipClassName,
@@ -118,7 +118,7 @@ const Tooltip = ({ trigger, label, placement = "top", mode = "system", animation
118
118
  const animationStyles = getAnimationStyles({
119
119
  animationDuration
120
120
  });
121
- const updatePosition = useCallback(async ()=>{
121
+ /* v8 ignore start - async floating UI positioning */ const updatePosition = useCallback(async ()=>{
122
122
  if (referenceRef.current && floatingRef.current && floatingArrowRef.current) {
123
123
  const { x, y, middlewareData, placement: newPlacement } = await computePosition(referenceRef.current, floatingRef.current, {
124
124
  placement,
@@ -165,7 +165,7 @@ const Tooltip = ({ trigger, label, placement = "top", mode = "system", animation
165
165
  animationStyles,
166
166
  referenceRef
167
167
  ]);
168
- useEffect(()=>{
168
+ /* v8 ignore stop */ /* v8 ignore start - async effect handler */ useEffect(()=>{
169
169
  (async ()=>{
170
170
  if (showTooltip) {
171
171
  await updatePosition();
@@ -177,13 +177,13 @@ const Tooltip = ({ trigger, label, placement = "top", mode = "system", animation
177
177
  updatePosition,
178
178
  showTooltip
179
179
  ]);
180
- useEffect(()=>{
181
- return ()=>{
180
+ /* v8 ignore stop */ useEffect(()=>{
181
+ /* v8 ignore start - cleanup function */ return ()=>{
182
182
  if (showTimeoutRef.current) {
183
183
  clearTimeout(showTimeoutRef.current);
184
184
  }
185
185
  };
186
- }, []);
186
+ /* v8 ignore stop */ }, []);
187
187
  const handleMouseClick = ()=>{
188
188
  if (showTimeoutRef.current) {
189
189
  clearTimeout(showTimeoutRef.current);
@@ -197,16 +197,16 @@ const Tooltip = ({ trigger, label, placement = "top", mode = "system", animation
197
197
  const handleMouseEnter = ()=>{
198
198
  if (!disabled) {
199
199
  if (delay > 0) {
200
- showTimeoutRef.current = setTimeout(()=>{
200
+ /* v8 ignore start - delayed timeout callback */ showTimeoutRef.current = setTimeout(()=>{
201
201
  setShowTooltip(true);
202
202
  showTimeoutRef.current = null;
203
203
  }, delay);
204
- } else {
204
+ /* v8 ignore stop */ } else {
205
205
  setShowTooltip(true);
206
206
  }
207
207
  }
208
208
  };
209
- const handleMouseLeave = ()=>{
209
+ /* v8 ignore start - mouse leave edge case */ const handleMouseLeave = ()=>{
210
210
  if (showTimeoutRef.current) {
211
211
  clearTimeout(showTimeoutRef.current);
212
212
  showTimeoutRef.current = null;
@@ -215,7 +215,7 @@ const Tooltip = ({ trigger, label, placement = "top", mode = "system", animation
215
215
  setShowTooltip(false);
216
216
  }
217
217
  };
218
- return /*#__PURE__*/ jsxs("div", {
218
+ /* v8 ignore stop */ return /*#__PURE__*/ jsxs("div", {
219
219
  className: tooltipClasses.wrapper,
220
220
  ref: referenceRef,
221
221
  onMouseEnter: handleMouseEnter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-tooltip",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -43,12 +43,12 @@
43
43
  "dependencies": {
44
44
  "@floating-ui/dom": "1.7.4",
45
45
  "@tailwindcss/typography": "0.5.19",
46
- "@versini/ui-hooks": "6.0.0",
46
+ "@versini/ui-hooks": "6.0.1",
47
47
  "clsx": "2.1.1",
48
48
  "tailwindcss": "4.1.18"
49
49
  },
50
50
  "sideEffects": [
51
51
  "**/*.css"
52
52
  ],
53
- "gitHead": "30d86d13d4369cc841fc267c970cca423d27bf2f"
53
+ "gitHead": "7b2640a0650a4c3aa6ca078888f765cb400f9f13"
54
54
  }