@umituz/web-dashboard 11.9.0 → 11.10.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-dashboard",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.10.1",
|
|
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",
|
|
@@ -78,8 +78,14 @@ export const DashboardHeader = ({
|
|
|
78
78
|
return (
|
|
79
79
|
<header className="udb-header">
|
|
80
80
|
<div className="udb-header__lead">
|
|
81
|
-
<Button
|
|
82
|
-
|
|
81
|
+
<Button
|
|
82
|
+
variant="ghost"
|
|
83
|
+
size="icon"
|
|
84
|
+
className="udb-header__mobile-toggle"
|
|
85
|
+
onClick={() => setMobileOpen(true)}
|
|
86
|
+
aria-label={labels.openSidebar ?? labels.expandSidebar}
|
|
87
|
+
>
|
|
88
|
+
<Menu className="udb-header__toggle-icon" aria-hidden="true" />
|
|
83
89
|
</Button>
|
|
84
90
|
|
|
85
91
|
<Button
|
|
@@ -132,7 +138,7 @@ export const DashboardHeader = ({
|
|
|
132
138
|
<DropdownMenu>
|
|
133
139
|
<DropdownMenuTrigger asChild>
|
|
134
140
|
<Button variant="ghost" size="icon" className="udb-header__icon-btn" aria-label={labels.notificationsTitle}>
|
|
135
|
-
<Bell className="udb-header__icon" />
|
|
141
|
+
<Bell className="udb-header__icon" aria-hidden="true" />
|
|
136
142
|
{unreadCount > 0 && <span className="udb-header__unread"><span className="udb-header__unread-core" /></span>}
|
|
137
143
|
|
|
138
144
|
</Button>
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
package/src/styles/chrome.css
CHANGED
|
@@ -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
|
+
}
|