@dreamtree-org/twreact-ui 2.1.2 → 2.2.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.
Files changed (93) hide show
  1. package/README.md +47 -4
  2. package/ai-skills/dreamtree-ui.md +20 -3
  3. package/dist/_shared/{cn-DPPQUJu1.js → cn-TMJ-_w1a.js} +14 -1
  4. package/dist/_shared/useLatestRef-CdtlnPUz.js +21 -0
  5. package/dist/_shared/useReducedMotion-B_PMM5ER.js +77 -0
  6. package/dist/ai-schema.json +513 -0
  7. package/dist/charts/index.js +6 -76
  8. package/dist/components/motion/BentoExpandGrid.d.ts +10 -0
  9. package/dist/components/motion/BentoExpandGrid.d.ts.map +1 -0
  10. package/dist/components/motion/CountUp.d.ts +9 -0
  11. package/dist/components/motion/CountUp.d.ts.map +1 -0
  12. package/dist/components/motion/DeviceFrame.d.ts +8 -0
  13. package/dist/components/motion/DeviceFrame.d.ts.map +1 -0
  14. package/dist/components/motion/DeviceMorphHero.d.ts +11 -0
  15. package/dist/components/motion/DeviceMorphHero.d.ts.map +1 -0
  16. package/dist/components/motion/LogoMarquee.d.ts +9 -0
  17. package/dist/components/motion/LogoMarquee.d.ts.map +1 -0
  18. package/dist/components/motion/PhotoCollage.d.ts +9 -0
  19. package/dist/components/motion/PhotoCollage.d.ts.map +1 -0
  20. package/dist/components/motion/Reveal.d.ts +9 -0
  21. package/dist/components/motion/Reveal.d.ts.map +1 -0
  22. package/dist/components/motion/RevealGroup.d.ts +5 -0
  23. package/dist/components/motion/RevealGroup.d.ts.map +1 -0
  24. package/dist/components/motion/RotatingBadge.d.ts +9 -0
  25. package/dist/components/motion/RotatingBadge.d.ts.map +1 -0
  26. package/dist/components/motion/ScrollStage.d.ts +11 -0
  27. package/dist/components/motion/ScrollStage.d.ts.map +1 -0
  28. package/dist/components/motion/SmoothScrollProvider.d.ts +18 -0
  29. package/dist/components/motion/SmoothScrollProvider.d.ts.map +1 -0
  30. package/dist/components/motion/StackedCards.d.ts +10 -0
  31. package/dist/components/motion/StackedCards.d.ts.map +1 -0
  32. package/dist/components/motion/StatStrip.d.ts +8 -0
  33. package/dist/components/motion/StatStrip.d.ts.map +1 -0
  34. package/dist/components/motion/TestimonialSpotlight.d.ts +10 -0
  35. package/dist/components/motion/TestimonialSpotlight.d.ts.map +1 -0
  36. package/dist/components/motion/storyData.d.ts +52 -0
  37. package/dist/components/motion/storyData.d.ts.map +1 -0
  38. package/dist/esm/components/motion/BentoExpandGrid.js +144 -0
  39. package/dist/esm/components/motion/CountUp.js +97 -0
  40. package/dist/esm/components/motion/DeviceFrame.js +102 -0
  41. package/dist/esm/components/motion/DeviceMorphHero.js +228 -0
  42. package/dist/esm/components/motion/LogoMarquee.js +144 -0
  43. package/dist/esm/components/motion/PhotoCollage.js +92 -0
  44. package/dist/esm/components/motion/Reveal.js +115 -0
  45. package/dist/esm/components/motion/RevealGroup.js +43 -0
  46. package/dist/esm/components/motion/RotatingBadge.js +66 -0
  47. package/dist/esm/components/motion/ScrollStage.js +62 -0
  48. package/dist/esm/components/motion/SmoothScrollProvider.js +63 -0
  49. package/dist/esm/components/motion/StackedCards.js +166 -0
  50. package/dist/esm/components/motion/StatStrip.js +58 -0
  51. package/dist/esm/components/motion/TestimonialSpotlight.js +209 -0
  52. package/dist/esm/hooks/useScrollProgress.js +107 -0
  53. package/dist/esm/hooks/useSmoothScroll.js +33 -0
  54. package/dist/esm/motion/engine/inView.js +54 -0
  55. package/dist/esm/motion/engine/progress.js +45 -0
  56. package/dist/esm/motion/engine/scheduler.js +67 -0
  57. package/dist/esm/motion/engine/useHydrated.js +17 -0
  58. package/dist/esm/motion/engine/useIsomorphicLayoutEffect.js +7 -0
  59. package/dist/esm/motion/engine/useMergedRef.js +12 -0
  60. package/dist/esm/motion/index.js +16 -0
  61. package/dist/esm/motion/tokens.js +10 -0
  62. package/dist/hooks/useScrollProgress.d.ts +17 -0
  63. package/dist/hooks/useScrollProgress.d.ts.map +1 -0
  64. package/dist/hooks/useSmoothScroll.d.ts +11 -0
  65. package/dist/hooks/useSmoothScroll.d.ts.map +1 -0
  66. package/dist/index.css +1 -1
  67. package/dist/index.esm.css +1 -1
  68. package/dist/motion/engine/inView.d.ts +5 -0
  69. package/dist/motion/engine/inView.d.ts.map +1 -0
  70. package/dist/motion/engine/progress.d.ts +18 -0
  71. package/dist/motion/engine/progress.d.ts.map +1 -0
  72. package/dist/motion/engine/scheduler.d.ts +10 -0
  73. package/dist/motion/engine/scheduler.d.ts.map +1 -0
  74. package/dist/motion/engine/useHydrated.d.ts +3 -0
  75. package/dist/motion/engine/useHydrated.d.ts.map +1 -0
  76. package/dist/motion/engine/useIsomorphicLayoutEffect.d.ts +4 -0
  77. package/dist/motion/engine/useIsomorphicLayoutEffect.d.ts.map +1 -0
  78. package/dist/motion/engine/useMergedRef.d.ts +3 -0
  79. package/dist/motion/engine/useMergedRef.d.ts.map +1 -0
  80. package/dist/motion/index.d.ts +20 -0
  81. package/dist/motion/index.d.ts.map +1 -0
  82. package/dist/motion/index.js +1813 -0
  83. package/dist/motion/tokens.d.ts +6 -0
  84. package/dist/motion/tokens.d.ts.map +1 -0
  85. package/dist/rich-text/index.js +3 -18
  86. package/dist/tokens/tokens.json +21 -0
  87. package/dist/types/motion.d.ts +290 -0
  88. package/dist/types/motion.d.ts.map +1 -0
  89. package/doc/README.md +17 -1
  90. package/mcp/catalog.snapshot.json +952 -5
  91. package/motion/package.json +5 -0
  92. package/package.json +14 -3
  93. package/tokens/tokens.json +6 -0
@@ -0,0 +1,107 @@
1
+ 'use client';
2
+ import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';
3
+ import { useState, useEffect } from 'react';
4
+ import { subscribe } from '../motion/engine/scheduler.js';
5
+ import { observe } from '../motion/engine/inView.js';
6
+ import { computeProgress } from '../motion/engine/progress.js';
7
+ import { useLatestRef } from './useLatestRef.js';
8
+
9
+ function createStore(initial) {
10
+ var value = initial;
11
+ var listeners = new Set();
12
+ return {
13
+ get: function get() {
14
+ return value;
15
+ },
16
+ set: function set(next) {
17
+ if (next === value) return;
18
+ value = next;
19
+ listeners.forEach(function (fn) {
20
+ return fn(next);
21
+ });
22
+ },
23
+ subscribe: function subscribe(fn) {
24
+ listeners.add(fn);
25
+ return function () {
26
+ listeners["delete"](fn);
27
+ };
28
+ }
29
+ };
30
+ }
31
+ /**
32
+ * Scroll progress (0–1) of `ref`'s element, without re-rendering React on every frame.
33
+ *
34
+ * Returns a subscription (`get()` / `subscribe(fn)`), writes the value to the element as a
35
+ * CSS custom property (`--dt-p` by default) so CSS can map it to transforms, and calls
36
+ * `onChange`. Work runs on the shared motion frame loop, and only while the element is
37
+ * near the viewport.
38
+ *
39
+ * The value starts at 1 (the final state) and the CSS variable is unset on the server, under
40
+ * reduced motion (pass `enabled: false`) and after unmount, so write CSS with a final-state
41
+ * fallback: `opacity: var(--dt-p, 1)`.
42
+ */
43
+ function useScrollProgress(ref) {
44
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45
+ var _options$mode = options.mode,
46
+ mode = _options$mode === void 0 ? "view" : _options$mode,
47
+ _options$start = options.start,
48
+ start = _options$start === void 0 ? 0 : _options$start,
49
+ _options$end = options.end,
50
+ end = _options$end === void 0 ? 1 : _options$end,
51
+ _options$cssVar = options.cssVar,
52
+ cssVar = _options$cssVar === void 0 ? "--dt-p" : _options$cssVar,
53
+ _options$enabled = options.enabled,
54
+ enabled = _options$enabled === void 0 ? true : _options$enabled;
55
+ var _useState = useState(function () {
56
+ return createStore(1);
57
+ }),
58
+ _useState2 = _slicedToArray(_useState, 1),
59
+ store = _useState2[0];
60
+ var onChangeRef = useLatestRef(options.onChange);
61
+ useEffect(function () {
62
+ var el = ref.current;
63
+ if (!el || !enabled) return undefined;
64
+ var measure = function measure() {
65
+ var rect = el.getBoundingClientRect();
66
+ return computeProgress(rect.top, rect.height, innerHeight, {
67
+ mode: mode,
68
+ start: start,
69
+ end: end
70
+ });
71
+ };
72
+ var _write = function write(p) {
73
+ if (cssVar) el.style.setProperty(cssVar, p.toFixed(4));
74
+ if (p !== store.get()) {
75
+ var _onChangeRef$current;
76
+ store.set(p);
77
+ (_onChangeRef$current = onChangeRef.current) === null || _onChangeRef$current === void 0 || _onChangeRef$current.call(onChangeRef, p);
78
+ }
79
+ };
80
+ var unsubscribe = null;
81
+ var stopObserving = observe(el, function (inView) {
82
+ if (inView && !unsubscribe) {
83
+ unsubscribe = subscribe({
84
+ measure: measure,
85
+ write: function write(p) {
86
+ return _write(p);
87
+ }
88
+ });
89
+ } else if (!inView && unsubscribe) {
90
+ _write(measure()); // settle at 0 or 1 even after a fast fling
91
+ unsubscribe();
92
+ unsubscribe = null;
93
+ }
94
+ }, {
95
+ rootMargin: "25% 0px"
96
+ });
97
+ return function () {
98
+ stopObserving();
99
+ if (unsubscribe) unsubscribe();
100
+ if (cssVar) el.style.removeProperty(cssVar);
101
+ store.set(1);
102
+ };
103
+ }, [ref, enabled, mode, start, end, cssVar, store, onChangeRef]);
104
+ return store;
105
+ }
106
+
107
+ export { useScrollProgress };
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+ import { useContext, createContext } from 'react';
3
+
4
+ function nativeScrollTo(target) {
5
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
6
+ _ref$offset = _ref.offset,
7
+ offset = _ref$offset === void 0 ? 0 : _ref$offset,
8
+ _ref$immediate = _ref.immediate,
9
+ immediate = _ref$immediate === void 0 ? false : _ref$immediate;
10
+ if (typeof window === "undefined") return;
11
+ var el = typeof target === "string" ? document.querySelector(target) : target;
12
+ var top = typeof el === "number" ? el : el ? el.getBoundingClientRect().top + window.scrollY : null;
13
+ if (top == null) return;
14
+ window.scrollTo({
15
+ top: top + offset,
16
+ behavior: immediate ? "auto" : "smooth"
17
+ });
18
+ }
19
+ /** Native scrolling: the value outside a SmoothScrollProvider (or while Lenis is off). */
20
+ var NATIVE_SCROLL = {
21
+ lenis: null,
22
+ scrollTo: nativeScrollTo
23
+ };
24
+ var SmoothScrollContext = /*#__PURE__*/createContext(NATIVE_SCROLL);
25
+ /**
26
+ * `{ lenis, scrollTo }` from the nearest SmoothScrollProvider. Outside one, or while smooth
27
+ * scroll is off, `lenis` is `null` and `scrollTo` uses native `window.scrollTo`.
28
+ */
29
+ function useSmoothScroll() {
30
+ return useContext(SmoothScrollContext);
31
+ }
32
+
33
+ export { NATIVE_SCROLL, SmoothScrollContext, useSmoothScroll };
@@ -0,0 +1,54 @@
1
+ // Internal: one shared IntersectionObserver per (rootMargin, threshold) pair.
2
+ // `observe(el, cb)` calls `cb(isIntersecting, entry)` on every change and
3
+ // returns a function that stops observing. Without IntersectionObserver (old
4
+ // browsers, some test environments) the element counts as always in view.
5
+ var observers = new Map();
6
+ function getObserver(rootMargin, threshold) {
7
+ var key = "".concat(rootMargin, "|").concat(threshold);
8
+ var record = observers.get(key);
9
+ if (!record) {
10
+ var callbacks = new Map();
11
+ var io = new IntersectionObserver(function (entries) {
12
+ entries.forEach(function (entry) {
13
+ var cb = callbacks.get(entry.target);
14
+ if (cb) cb(entry.isIntersecting, entry);
15
+ });
16
+ }, {
17
+ rootMargin: rootMargin,
18
+ threshold: threshold
19
+ });
20
+ record = {
21
+ io: io,
22
+ callbacks: callbacks,
23
+ key: key
24
+ };
25
+ observers.set(key, record);
26
+ }
27
+ return record;
28
+ }
29
+ function observe(el, callback) {
30
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
31
+ _ref$rootMargin = _ref.rootMargin,
32
+ rootMargin = _ref$rootMargin === void 0 ? "0px" : _ref$rootMargin,
33
+ _ref$threshold = _ref.threshold,
34
+ threshold = _ref$threshold === void 0 ? 0 : _ref$threshold;
35
+ if (!el) return function () {};
36
+ if (typeof IntersectionObserver === "undefined") {
37
+ callback(true, null);
38
+ return function () {};
39
+ }
40
+ var record = getObserver(rootMargin, threshold);
41
+ record.callbacks.set(el, callback);
42
+ record.io.observe(el);
43
+ return function () {
44
+ if (!record.callbacks.has(el)) return;
45
+ record.callbacks["delete"](el);
46
+ record.io.unobserve(el);
47
+ if (record.callbacks.size === 0) {
48
+ record.io.disconnect();
49
+ observers["delete"](record.key);
50
+ }
51
+ };
52
+ }
53
+
54
+ export { observe };
@@ -0,0 +1,45 @@
1
+ // Internal: pure scroll-progress maths (unit-tested, no DOM).
2
+ var clamp01 = function clamp01(v) {
3
+ return v > 0 ? v < 1 ? v : 1 : 0;
4
+ };
5
+ var lerp = function lerp(a, b, t) {
6
+ return a + (b - a) * t;
7
+ };
8
+ /** Ease-out cubic: fast start, gentle stop. */
9
+ var easeOut = function easeOut(t) {
10
+ return 1 - Math.pow(1 - t, 3);
11
+ };
12
+ /** Ease-in-out cubic. */
13
+ var easeInOut = function easeInOut(t) {
14
+ return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
15
+ };
16
+ /** Re-map `t` from the window [from, to] to 0–1 (clamped). */
17
+ var segment = function segment(t, from, to) {
18
+ return clamp01((t - from) / (to - from || 1));
19
+ };
20
+ /**
21
+ * Scroll progress of an element.
22
+ * - "view": 0 when its top meets the viewport bottom, 1 when its bottom leaves the viewport top.
23
+ * - "pin": 0 when its top meets the viewport top, 1 when its bottom meets the viewport bottom
24
+ * (the span a `position: sticky` child stays pinned).
25
+ * `start` / `end` narrow the range: progress is re-mapped from [start, end] to 0–1.
26
+ */
27
+ function computeProgress(top, height, viewport) {
28
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
29
+ _ref$mode = _ref.mode,
30
+ mode = _ref$mode === void 0 ? "view" : _ref$mode,
31
+ _ref$start = _ref.start,
32
+ start = _ref$start === void 0 ? 0 : _ref$start,
33
+ _ref$end = _ref.end,
34
+ end = _ref$end === void 0 ? 1 : _ref$end;
35
+ var raw;
36
+ if (mode === "pin") {
37
+ var span = height - viewport;
38
+ raw = span > 0 ? -top / span : top <= 0 ? 1 : 0;
39
+ } else {
40
+ raw = (viewport - top) / (viewport + height || 1);
41
+ }
42
+ return segment(clamp01(raw), start, end);
43
+ }
44
+
45
+ export { clamp01, computeProgress, easeInOut, easeOut, lerp, segment };
@@ -0,0 +1,67 @@
1
+ // Internal motion engine: ONE requestAnimationFrame loop shared by every motion
2
+ // component. Each frame runs every subscriber's `measure()` (DOM reads) first,
3
+ // then every `write(measured, now)` (DOM writes), so reads and writes never
4
+ // interleave and the browser lays out at most once per frame.
5
+ //
6
+ // The loop is idle unless something asks for a frame: a scroll or resize event
7
+ // (passive listeners), a new subscriber, or a subscriber with `loop: true`
8
+ // (time-based work such as CountUp or Lenis). Scenes subscribe only while they
9
+ // are near the viewport (see inView.js), so off-screen sections cost nothing.
10
+ var subscribers = new Set();
11
+ var frameId = 0;
12
+ var listening = false;
13
+ function hasWindow() {
14
+ return typeof window !== "undefined" && typeof window.requestAnimationFrame === "function";
15
+ }
16
+ function runFrame(now) {
17
+ frameId = 0;
18
+ var list = Array.from(subscribers);
19
+ var measured = list.map(function (s) {
20
+ return s.measure ? s.measure() : undefined;
21
+ });
22
+ var again = false;
23
+ list.forEach(function (s, i) {
24
+ if (!subscribers.has(s)) return; // unsubscribed by an earlier write this frame
25
+ if (s.write) s.write(measured[i], now);
26
+ if (s.loop && subscribers.has(s)) again = true;
27
+ });
28
+ if (again) requestFrame();
29
+ }
30
+ /** Ask for one frame (coalesced: many calls before the frame run it once). */
31
+ function requestFrame() {
32
+ if (frameId || !hasWindow()) return;
33
+ frameId = requestAnimationFrame(runFrame);
34
+ }
35
+ var onScrollOrResize = function onScrollOrResize() {
36
+ return requestFrame();
37
+ };
38
+ function listen(on) {
39
+ if (on === listening || typeof window === "undefined") return;
40
+ listening = on;
41
+ var method = on ? "addEventListener" : "removeEventListener";
42
+ window[method]("scroll", onScrollOrResize, {
43
+ passive: true
44
+ });
45
+ window[method]("resize", onScrollOrResize, {
46
+ passive: true
47
+ });
48
+ }
49
+ /**
50
+ * Register `{ measure?, write?, loop? }`. Returns the unsubscribe function.
51
+ * The subscriber gets a frame right away, so it can paint its first state.
52
+ */
53
+ function subscribe(subscriber) {
54
+ subscribers.add(subscriber);
55
+ listen(true);
56
+ requestFrame();
57
+ return function () {
58
+ subscribers["delete"](subscriber);
59
+ if (subscribers.size === 0) {
60
+ listen(false);
61
+ if (frameId && hasWindow()) cancelAnimationFrame(frameId);
62
+ frameId = 0;
63
+ }
64
+ };
65
+ }
66
+
67
+ export { requestFrame, subscribe };
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { useSyncExternalStore } from 'react';
3
+
4
+ var subscribeNever = function subscribeNever() {
5
+ return function () {};
6
+ };
7
+ // Internal: false on the server and while hydrating, true after — without a
8
+ // setState-in-effect. Lets a component render its static final state first.
9
+ function useHydrated() {
10
+ return useSyncExternalStore(subscribeNever, function () {
11
+ return true;
12
+ }, function () {
13
+ return false;
14
+ });
15
+ }
16
+
17
+ export { useHydrated };
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { useLayoutEffect, useEffect } from 'react';
3
+
4
+ // useLayoutEffect warns during SSR; fall back to useEffect on the server.
5
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
6
+
7
+ export { useIsomorphicLayoutEffect };
@@ -0,0 +1,12 @@
1
+ 'use client';
2
+ import { useCallback } from 'react';
3
+ import { setRefs } from '../../utils/position.js';
4
+
5
+ // Internal: one callback ref that feeds a forwarded ref and a local ref.
6
+ function useMergedRef(forwardedRef, localRef) {
7
+ return useCallback(function (node) {
8
+ return setRefs(node, localRef, forwardedRef);
9
+ }, [forwardedRef, localRef]);
10
+ }
11
+
12
+ export { useMergedRef };
@@ -0,0 +1,16 @@
1
+ export { useScrollProgress } from '../hooks/useScrollProgress.js';
2
+ export { default as ScrollStage } from '../components/motion/ScrollStage.js';
3
+ export { default as Reveal } from '../components/motion/Reveal.js';
4
+ export { default as RevealGroup } from '../components/motion/RevealGroup.js';
5
+ export { default as SmoothScrollProvider } from '../components/motion/SmoothScrollProvider.js';
6
+ export { useSmoothScroll } from '../hooks/useSmoothScroll.js';
7
+ export { default as DeviceFrame } from '../components/motion/DeviceFrame.js';
8
+ export { default as LogoMarquee } from '../components/motion/LogoMarquee.js';
9
+ export { default as CountUp } from '../components/motion/CountUp.js';
10
+ export { default as StatStrip } from '../components/motion/StatStrip.js';
11
+ export { default as StackedCards } from '../components/motion/StackedCards.js';
12
+ export { default as DeviceMorphHero } from '../components/motion/DeviceMorphHero.js';
13
+ export { default as BentoExpandGrid } from '../components/motion/BentoExpandGrid.js';
14
+ export { default as TestimonialSpotlight } from '../components/motion/TestimonialSpotlight.js';
15
+ export { default as PhotoCollage } from '../components/motion/PhotoCollage.js';
16
+ export { default as RotatingBadge } from '../components/motion/RotatingBadge.js';
@@ -0,0 +1,10 @@
1
+ // Defaults from the `scroll` group of tokens/tokens.json (kept in sync by
2
+ // src/motion/engine/__tests__/tokens.test.js). Plain numbers so the motion
3
+ // entry does not bundle the token file.
4
+ var SCROLL_STICKY_TOP = 80; // px — scroll.stickyTop
5
+ var SCENE_LENGTH = 300; // vh — scroll.sceneLength
6
+ var SCENE_LENGTH_MOBILE = 150; // vh — scroll.sceneLengthMobile
7
+ /** Below Tailwind's `md` breakpoint. */
8
+ var MOBILE_QUERY = "(max-width: 767px)";
9
+
10
+ export { MOBILE_QUERY, SCENE_LENGTH, SCENE_LENGTH_MOBILE, SCROLL_STICKY_TOP };
@@ -0,0 +1,17 @@
1
+ import { type RefObject } from "react";
2
+ import type { ScrollProgress, UseScrollProgressOptions } from "../types/motion";
3
+ /**
4
+ * Scroll progress (0–1) of `ref`'s element, without re-rendering React on every frame.
5
+ *
6
+ * Returns a subscription (`get()` / `subscribe(fn)`), writes the value to the element as a
7
+ * CSS custom property (`--dt-p` by default) so CSS can map it to transforms, and calls
8
+ * `onChange`. Work runs on the shared motion frame loop, and only while the element is
9
+ * near the viewport.
10
+ *
11
+ * The value starts at 1 (the final state) and the CSS variable is unset on the server, under
12
+ * reduced motion (pass `enabled: false`) and after unmount, so write CSS with a final-state
13
+ * fallback: `opacity: var(--dt-p, 1)`.
14
+ */
15
+ export declare function useScrollProgress(ref: RefObject<HTMLElement | null>, options?: UseScrollProgressOptions): ScrollProgress;
16
+ export default useScrollProgress;
17
+ //# sourceMappingURL=useScrollProgress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollProgress.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK5D,OAAO,KAAK,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAyBhF;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAClC,OAAO,GAAE,wBAA6B,GACrC,cAAc,CA0ChB;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { SmoothScrollContextValue } from "../types/motion";
2
+ /** Native scrolling: the value outside a SmoothScrollProvider (or while Lenis is off). */
3
+ export declare const NATIVE_SCROLL: SmoothScrollContextValue;
4
+ export declare const SmoothScrollContext: import("react").Context<SmoothScrollContextValue>;
5
+ /**
6
+ * `{ lenis, scrollTo }` from the nearest SmoothScrollProvider. Outside one, or while smooth
7
+ * scroll is off, `lenis` is `null` and `scrollTo` uses native `window.scrollTo`.
8
+ */
9
+ export declare function useSmoothScroll(): SmoothScrollContextValue;
10
+ export default useSmoothScroll;
11
+ //# sourceMappingURL=useSmoothScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSmoothScroll.d.ts","sourceRoot":"","sources":["../../src/hooks/useSmoothScroll.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAahE,0FAA0F;AAC1F,eAAO,MAAM,aAAa,EAAE,wBAAoE,CAAC;AAEjG,eAAO,MAAM,mBAAmB,mDAAyD,CAAC;AAE1F;;;GAGG;AACH,wBAAgB,eAAe,IAAI,wBAAwB,CAE1D;AAED,eAAe,eAAe,CAAC"}