pi-kiosk-shared 2.2.49 → 2.2.51

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 (50) hide show
  1. package/dist/auditEventCodes.d.ts +1 -1
  2. package/dist/auditEventCodes.d.ts.map +1 -1
  3. package/dist/auditEventCodes.js +10 -0
  4. package/dist/auditEventCodes.js.map +1 -1
  5. package/dist/auditEventDescriptions.d.ts.map +1 -1
  6. package/dist/auditEventDescriptions.js +40 -0
  7. package/dist/auditEventDescriptions.js.map +1 -1
  8. package/dist/auditEventLabels.d.ts.map +1 -1
  9. package/dist/auditEventLabels.js +40 -0
  10. package/dist/auditEventLabels.js.map +1 -1
  11. package/dist/auditMetadataDisplayFields.d.ts.map +1 -1
  12. package/dist/auditMetadataDisplayFields.js +35 -0
  13. package/dist/auditMetadataDisplayFields.js.map +1 -1
  14. package/dist/ui/BottomSheet/BottomSheet.d.ts +12 -1
  15. package/dist/ui/BottomSheet/BottomSheet.d.ts.map +1 -1
  16. package/dist/ui/BottomSheet/BottomSheet.js +71 -10
  17. package/dist/ui/BottomSheet/BottomSheet.js.map +1 -1
  18. package/dist/ui/Dialog/Dialog.d.ts +15 -1
  19. package/dist/ui/Dialog/Dialog.d.ts.map +1 -1
  20. package/dist/ui/Dialog/Dialog.js +68 -10
  21. package/dist/ui/Dialog/Dialog.js.map +1 -1
  22. package/dist/ui/FormField/FormField.d.ts +7 -2
  23. package/dist/ui/FormField/FormField.d.ts.map +1 -1
  24. package/dist/ui/FormField/FormField.js +25 -3
  25. package/dist/ui/FormField/FormField.js.map +1 -1
  26. package/dist/ui/Icon/Star.d.ts +3 -0
  27. package/dist/ui/Icon/Star.d.ts.map +1 -0
  28. package/dist/ui/Icon/Star.js +3 -0
  29. package/dist/ui/Icon/Star.js.map +1 -0
  30. package/dist/ui/Icon/index.d.ts +1 -0
  31. package/dist/ui/Icon/index.d.ts.map +1 -1
  32. package/dist/ui/Icon/index.js +1 -0
  33. package/dist/ui/Icon/index.js.map +1 -1
  34. package/dist/ui/Toast/Toast.d.ts +11 -1
  35. package/dist/ui/Toast/Toast.d.ts.map +1 -1
  36. package/dist/ui/Toast/Toast.js +14 -2
  37. package/dist/ui/Toast/Toast.js.map +1 -1
  38. package/dist/ui/index.d.ts +11 -0
  39. package/dist/ui/index.d.ts.map +1 -1
  40. package/dist/ui/index.js +11 -0
  41. package/dist/ui/index.js.map +1 -1
  42. package/dist/ui/overlay/overlayFocus.d.ts +26 -0
  43. package/dist/ui/overlay/overlayFocus.d.ts.map +1 -0
  44. package/dist/ui/overlay/overlayFocus.js +123 -0
  45. package/dist/ui/overlay/overlayFocus.js.map +1 -0
  46. package/dist/ui/overlay/overlayMotion.d.ts +32 -0
  47. package/dist/ui/overlay/overlayMotion.d.ts.map +1 -0
  48. package/dist/ui/overlay/overlayMotion.js +80 -0
  49. package/dist/ui/overlay/overlayMotion.js.map +1 -0
  50. package/package.json +6 -1
@@ -0,0 +1,80 @@
1
+ import { useEffect, useState } from 'react';
2
+ /**
3
+ * Short overlay enter/exit motion (Dialog / BottomSheet / Toast).
4
+ * Tokens from shared theme.css; fallbacks match Spec defaults when unset.
5
+ */
6
+ export const OVERLAY_MOTION_TRANSITION = 'transition-[opacity,transform] duration-[var(--motion-duration-base,150ms)] ease-[var(--motion-easing-standard,ease)] motion-reduce:transition-none';
7
+ /** Settled (visible) panel/toast surface. */
8
+ export const OVERLAY_MOTION_ENTERED = 'opacity-100 translate-y-0 scale-100';
9
+ /** Pre-enter / exiting panel (brief opacity + transform). */
10
+ export const OVERLAY_MOTION_EXITED = 'opacity-0 translate-y-1 scale-[0.98]';
11
+ /** Backdrop fade only. */
12
+ export const OVERLAY_BACKDROP_ENTERED = 'opacity-100';
13
+ export const OVERLAY_BACKDROP_EXITED = 'opacity-0';
14
+ /** Exit delay covers --motion-duration-base (200ms in theme) + small buffer. */
15
+ export const OVERLAY_EXIT_MS = 220;
16
+ export function prefersReducedMotion() {
17
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
18
+ return false;
19
+ }
20
+ return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
21
+ }
22
+ /**
23
+ * Mount-gated presence for controlled overlays (`open`).
24
+ * Open mounts synchronously; exit holds DOM for OVERLAY_EXIT_MS (skipped when reduce).
25
+ */
26
+ export function useOverlayPresence(open) {
27
+ const [held, setHeld] = useState(open);
28
+ const [visible, setVisible] = useState(() => open && prefersReducedMotion());
29
+ if (open && !held) {
30
+ setHeld(true);
31
+ }
32
+ useEffect(() => {
33
+ if (open) {
34
+ if (prefersReducedMotion()) {
35
+ setVisible(true);
36
+ return;
37
+ }
38
+ setVisible(false);
39
+ const id = requestAnimationFrame(() => {
40
+ setVisible(true);
41
+ });
42
+ return () => {
43
+ cancelAnimationFrame(id);
44
+ };
45
+ }
46
+ setVisible(false);
47
+ if (prefersReducedMotion()) {
48
+ setHeld(false);
49
+ return;
50
+ }
51
+ const timer = window.setTimeout(() => {
52
+ setHeld(false);
53
+ }, OVERLAY_EXIT_MS);
54
+ return () => {
55
+ window.clearTimeout(timer);
56
+ };
57
+ }, [open]);
58
+ return { mounted: open || held, visible };
59
+ }
60
+ /**
61
+ * One-shot enter for presentational surfaces that mount when shown
62
+ * (prefer `useOverlayPresence` when exit hold is needed, e.g. Toast `open`).
63
+ */
64
+ export function useEnterMotion() {
65
+ const [entered, setEntered] = useState(() => prefersReducedMotion());
66
+ useEffect(() => {
67
+ if (prefersReducedMotion()) {
68
+ setEntered(true);
69
+ return;
70
+ }
71
+ const id = requestAnimationFrame(() => {
72
+ setEntered(true);
73
+ });
74
+ return () => {
75
+ cancelAnimationFrame(id);
76
+ };
77
+ }, []);
78
+ return entered;
79
+ }
80
+ //# sourceMappingURL=overlayMotion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlayMotion.js","sourceRoot":"","sources":["../../../src/ui/overlay/overlayMotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EA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"pi-kiosk-shared",
3
- "version": "2.2.49",
3
+ "version": "2.2.51",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Shared types, API contracts, and error classes for Pi Kiosk system",
@@ -198,6 +198,11 @@
198
198
  "import": "./dist/ui/index.js",
199
199
  "require": "./dist/ui/index.js"
200
200
  },
201
+ "./ui/Icon": {
202
+ "types": "./dist/ui/Icon/index.d.ts",
203
+ "import": "./dist/ui/Icon/index.js",
204
+ "require": "./dist/ui/Icon/index.js"
205
+ },
201
206
  "./ui/tvShim": {
202
207
  "types": "./dist/ui/tvShim.d.ts",
203
208
  "import": "./dist/ui/tvShim.js",