@umituz/web-dashboard 11.9.0 → 11.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/web-dashboard",
3
- "version": "11.9.0",
3
+ "version": "11.10.0",
4
4
  "description": "Installable app skeleton for the fleet — layouts, analytics (dependency-free SVG charts), calendar, onboarding flow permissions/module registry; udb-* stylesheet on design-system tokens",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -5,7 +5,9 @@ export function useCountdown(seconds: number | null, onFinish?: () => void) {
5
5
  const [running, setRunning] = useState(seconds != null);
6
6
  const finishedRef = useRef(false);
7
7
  const onFinishRef = useRef(onFinish);
8
- onFinishRef.current = onFinish;
8
+ useEffect(() => {
9
+ onFinishRef.current = onFinish;
10
+ });
9
11
 
10
12
  useEffect(() => {
11
13
  setRemaining(seconds ?? 0);
@@ -1,6 +1,7 @@
1
1
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
2
  import type { TourConfig, TourEngineInstance, UseProductTourOptions, UseProductTourReturn } from "./types";
3
3
  import { createProductTour, isTourCompleted, resetTourCompletion } from "./tourEngine";
4
+ import { useReducedMotion } from "../onboarding/hooks/useReducedMotion";
4
5
 
5
6
  export function useProductTour(options: UseProductTourOptions): UseProductTourReturn {
6
7
  const {
@@ -33,11 +34,15 @@ export function useProductTour(options: UseProductTourOptions): UseProductTourRe
33
34
  }, [isCompleted, tourId, userId]);
34
35
 
35
36
  const onCompleteRef = useRef(onComplete);
36
- onCompleteRef.current = onComplete;
37
37
  const onSkipRef = useRef(onSkip);
38
- onSkipRef.current = onSkip;
39
38
  const onStepChangeRef = useRef(onStepChange);
40
- onStepChangeRef.current = onStepChange;
39
+ useEffect(() => {
40
+ onCompleteRef.current = onComplete;
41
+ onSkipRef.current = onSkip;
42
+ onStepChangeRef.current = onStepChange;
43
+ });
44
+
45
+ const prefersReducedMotion = useReducedMotion();
41
46
 
42
47
  const config: TourConfig = useMemo(
43
48
  () => ({
@@ -49,8 +54,8 @@ export function useProductTour(options: UseProductTourOptions): UseProductTourRe
49
54
  overlayOpacity,
50
55
  stagePadding,
51
56
  stageRadius,
52
- animate,
53
- smoothScroll,
57
+ animate: prefersReducedMotion ? false : animate,
58
+ smoothScroll: prefersReducedMotion ? false : smoothScroll,
54
59
  allowClose,
55
60
  onComplete: () => {
56
61
  setHasCompleted(true);
@@ -78,6 +83,7 @@ export function useProductTour(options: UseProductTourOptions): UseProductTourRe
78
83
  animate,
79
84
  smoothScroll,
80
85
  allowClose,
86
+ prefersReducedMotion,
81
87
  ],
82
88
  );
83
89
 
@@ -2579,3 +2579,14 @@
2579
2579
  opacity: 0.55;
2580
2580
  }
2581
2581
  }
2582
+ @media (prefers-reduced-motion: reduce) {
2583
+ [class*='udb-'],
2584
+ [class*='udb-'] *,
2585
+ [class^='driver-popover'],
2586
+ [class^='driver-popover'] * {
2587
+ animation-duration: 0.01ms !important;
2588
+ animation-iteration-count: 1 !important;
2589
+ transition-duration: 0.01ms !important;
2590
+ scroll-behavior: auto !important;
2591
+ }
2592
+ }