@oscarpalmer/oui 0.20.0 → 0.21.0

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.
@@ -383,10 +383,7 @@ function onObservation(entries: ResizeObserverEntry[]): void {
383
383
  }
384
384
 
385
385
  function onPointerdown(event: Event): void {
386
- if (
387
- (event.type === 'mousedown' && supportsTouch.value) ||
388
- (event.type === 'touchstart' && !supportsTouch.value)
389
- ) {
386
+ if (supportsTouch.value ? event.type === 'mousedown' : event.type === 'touchstart') {
390
387
  return;
391
388
  }
392
389
 
package/src/js/tooltip.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import {isNullableOrWhitespace} from '@oscarpalmer/atoms/is';
2
2
  import {on} from '@oscarpalmer/toretto/event';
3
3
  import {findAncestor} from '@oscarpalmer/toretto/find';
4
- import {attributable} from './attributable';
5
- import {Floatable} from './floatable';
4
+ import {attributable} from './internal/attributable';
5
+ import {Floatable} from './internal/floatable';
6
6
 
7
7
  type Attributes = {
8
8
  ariaDescribedby: string | null;
@@ -84,6 +84,7 @@ function closeTooltips(next: Tooltip | undefined): void {
84
84
  requestAnimationFrame(() => {
85
85
  active.timer = setTimeout(() => {
86
86
  TOOLTIPS_ACTIVE.delete(active);
87
+
87
88
  active.floatable?.toggle(false);
88
89
  }, delay) as never;
89
90
  });
@@ -243,6 +244,7 @@ function onToggle(event: Event, activate: boolean): void {
243
244
 
244
245
  tooltip.timer ??= setTimeout(() => {
245
246
  TOOLTIPS_ACTIVE.delete(tooltip);
247
+
246
248
  tooltip.floatable.toggle(false);
247
249
  }, delay) as never;
248
250
  });
@@ -262,7 +264,7 @@ function reset(anchor: HTMLElement, attributes: Attributes): void {
262
264
  }
263
265
  }
264
266
 
265
- function setDelay(value: number): void {
267
+ function setTooltipDelay(value: number): void {
266
268
  delay = typeof value === 'number' && value >= 0 ? value : delay;
267
269
  }
268
270
 
@@ -304,4 +306,4 @@ on(document, 'touchstart', onActivate);
304
306
 
305
307
  //
306
308
 
307
- export {setDelay};
309
+ export {setTooltipDelay};