strata-react 0.1.13 → 0.1.14
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/README.md +1 -1
- package/dist/components/thumbnail.d.ts +31 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +106 -33
- package/dist/index.js.map +1 -1
- package/dist/lib/in-view.d.ts +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Options for {@link useInView}. */
|
|
3
|
+
export type InViewOptions = {
|
|
4
|
+
/** Watch only while this is true. Default true. */
|
|
5
|
+
active?: boolean;
|
|
6
|
+
/** How far outside the scroll region still counts as in view (IntersectionObserver `rootMargin`). */
|
|
7
|
+
rootMargin?: string;
|
|
8
|
+
/** Stay in view after the first time, and stop watching. */
|
|
9
|
+
once?: boolean;
|
|
10
|
+
/** What to report where `IntersectionObserver` does not exist. Default false. */
|
|
11
|
+
unsupported?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Whether an element is within `rootMargin` of its scroll region (the nearest
|
|
15
|
+
* `[data-strata-scroll]` ancestor, else the viewport). Returns a callback ref, so it follows the
|
|
16
|
+
* element as it mounts and unmounts.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useInView({ active, rootMargin, once, unsupported }?: InViewOptions): {
|
|
19
|
+
ref: React.Dispatch<React.SetStateAction<Element | null>>;
|
|
20
|
+
inView: boolean;
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strata-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|