@lilt-ui/charts 0.8.0 → 0.9.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.
@@ -0,0 +1,28 @@
1
+ import { ReactElement } from 'react';
2
+ /** How long a skeleton takes to leave once data has landed (lilt-skeleton-exit in loading.css). */
3
+ export declare const SKELETON_EXIT_MS = 240;
4
+ /**
5
+ * Where a leaving skeleton sinks to: the floor its marks grow from, the edge its bars grow from,
6
+ * or the middle its rings and webs grow from. The data's own entrance starts from the same place.
7
+ */
8
+ export type SkeletonExitOrigin = 'bottom' | 'left' | 'center';
9
+ /**
10
+ * Follows a skeleton through its exit. When loading ends it reports `leaving` for
11
+ * SKELETON_EXIT_MS, then lets the data in. Reduced motion skips the exit, and loading again
12
+ * mid-exit brings the skeleton straight back.
13
+ */
14
+ export declare function useSkeletonExit(loading: boolean, reduced: boolean): boolean;
15
+ interface SkeletonExitProps {
16
+ leaving: boolean;
17
+ origin: SkeletonExitOrigin;
18
+ /** What the card shows in place while loading, then its data. Its root must be a DOM element. */
19
+ children: ReactElement;
20
+ }
21
+ /**
22
+ * Holds a card's loading view through its exit. While leaving it keeps rendering exactly the
23
+ * last loading view, the very same elements, so nothing redraws from the data that has just
24
+ * landed; its root is marked to freeze every loop inside it on its current frame and sink toward
25
+ * `origin` as it fades. Once gone, the data view mounts with its own entrance.
26
+ */
27
+ export declare function SkeletonExit({ leaving, origin, children }: SkeletonExitProps): ReactElement;
28
+ export {};