@donotdev/components 0.0.20 → 0.0.22
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/dist/advanced/Carousel/Carousel.d.ts +21 -0
- package/dist/advanced/Carousel/Carousel.d.ts.map +1 -0
- package/dist/advanced/Carousel/Carousel.js +34 -0
- package/dist/advanced/Carousel/CarouselContent.d.ts +67 -0
- package/dist/advanced/Carousel/CarouselContent.d.ts.map +1 -0
- package/dist/advanced/Carousel/CarouselContent.js +529 -0
- package/dist/advanced/Carousel/CarouselSkeleton.d.ts +10 -0
- package/dist/advanced/Carousel/CarouselSkeleton.d.ts.map +1 -0
- package/dist/advanced/Carousel/CarouselSkeleton.js +51 -0
- package/dist/advanced/Carousel/index.d.ts +3 -0
- package/dist/advanced/Carousel/index.d.ts.map +1 -0
- package/dist/advanced/Carousel/index.js +2 -0
- package/dist/advanced/Code/CodeContent.js +2 -2
- package/dist/advanced/Crawl/Crawl.d.ts +44 -0
- package/dist/advanced/Crawl/Crawl.d.ts.map +1 -0
- package/dist/advanced/Crawl/Crawl.js +72 -0
- package/dist/advanced/Crawl/CrawlContent.d.ts +32 -0
- package/dist/advanced/Crawl/CrawlContent.d.ts.map +1 -0
- package/dist/advanced/Crawl/CrawlContent.js +118 -0
- package/dist/advanced/Crawl/index.d.ts +3 -0
- package/dist/advanced/Crawl/index.d.ts.map +1 -0
- package/dist/advanced/Crawl/index.js +3 -0
- package/dist/advanced/Crawl/utils/parseHtml.d.ts +72 -0
- package/dist/advanced/Crawl/utils/parseHtml.d.ts.map +1 -0
- package/dist/advanced/Crawl/utils/parseHtml.js +145 -0
- package/dist/advanced/Marquee/Marquee.d.ts +19 -0
- package/dist/advanced/Marquee/Marquee.d.ts.map +1 -0
- package/dist/advanced/Marquee/Marquee.js +35 -0
- package/dist/advanced/Marquee/MarqueeContent.d.ts +32 -0
- package/dist/advanced/Marquee/MarqueeContent.d.ts.map +1 -0
- package/dist/advanced/Marquee/MarqueeContent.js +192 -0
- package/dist/advanced/Marquee/MarqueeSkeleton.d.ts +10 -0
- package/dist/advanced/Marquee/MarqueeSkeleton.d.ts.map +1 -0
- package/dist/advanced/Marquee/MarqueeSkeleton.js +36 -0
- package/dist/advanced/Marquee/index.d.ts +3 -0
- package/dist/advanced/Marquee/index.d.ts.map +1 -0
- package/dist/advanced/Marquee/index.js +3 -0
- package/dist/advanced/Reveal/Reveal.d.ts +39 -0
- package/dist/advanced/Reveal/Reveal.d.ts.map +1 -0
- package/dist/advanced/Reveal/Reveal.js +69 -0
- package/dist/advanced/Reveal/index.d.ts +3 -0
- package/dist/advanced/Reveal/index.d.ts.map +1 -0
- package/dist/advanced/Reveal/index.js +3 -0
- package/dist/advanced/Roadmap/Roadmap.d.ts +15 -0
- package/dist/advanced/Roadmap/Roadmap.d.ts.map +1 -0
- package/dist/advanced/Roadmap/Roadmap.js +16 -0
- package/dist/advanced/Roadmap/RoadmapContent.d.ts +32 -0
- package/dist/advanced/Roadmap/RoadmapContent.d.ts.map +1 -0
- package/dist/advanced/Roadmap/RoadmapContent.js +61 -0
- package/dist/advanced/Roadmap/index.d.ts +4 -0
- package/dist/advanced/Roadmap/index.d.ts.map +1 -0
- package/dist/advanced/Roadmap/index.js +3 -0
- package/dist/advanced/SplitReveal/SplitReveal.d.ts +97 -0
- package/dist/advanced/SplitReveal/SplitReveal.d.ts.map +1 -0
- package/dist/advanced/SplitReveal/SplitReveal.js +43 -0
- package/dist/advanced/SplitReveal/index.d.ts +3 -0
- package/dist/advanced/SplitReveal/index.d.ts.map +1 -0
- package/dist/advanced/SplitReveal/index.js +2 -0
- package/dist/advanced/StackedCards/StackedCards.d.ts +19 -0
- package/dist/advanced/StackedCards/StackedCards.d.ts.map +1 -0
- package/dist/advanced/StackedCards/StackedCards.js +22 -0
- package/dist/advanced/StackedCards/StackedCardsContent.d.ts +43 -0
- package/dist/advanced/StackedCards/StackedCardsContent.d.ts.map +1 -0
- package/dist/advanced/StackedCards/StackedCardsContent.js +52 -0
- package/dist/advanced/StackedCards/index.d.ts +4 -0
- package/dist/advanced/StackedCards/index.d.ts.map +1 -0
- package/dist/advanced/StackedCards/index.js +3 -0
- package/dist/advanced/index.d.ts +14 -0
- package/dist/advanced/index.d.ts.map +1 -1
- package/dist/advanced/index.js +7 -0
- package/dist/atomic/Alert/index.d.ts +1 -1
- package/dist/atomic/Badge/index.d.ts +1 -1
- package/dist/atomic/Button/index.d.ts +1 -1
- package/dist/atomic/Combobox/index.d.ts +3 -1
- package/dist/atomic/Combobox/index.d.ts.map +1 -1
- package/dist/atomic/Combobox/index.js +2 -2
- package/dist/atomic/CommandDialog/index.d.ts.map +1 -1
- package/dist/atomic/CommandDialog/index.js +1 -1
- package/dist/atomic/Dialog/index.d.ts.map +1 -1
- package/dist/atomic/Dialog/index.js +1 -1
- package/dist/atomic/HeroSection/index.d.ts +1 -1
- package/dist/atomic/Rating/index.d.ts +1 -1
- package/dist/atomic/Sheet/index.d.ts.map +1 -1
- package/dist/atomic/Sheet/index.js +1 -1
- package/dist/atomic/Stepper/index.d.ts +1 -1
- package/dist/atomic/Tabs/index.d.ts +1 -1
- package/dist/atomic/Tag/index.d.ts +1 -1
- package/dist/atomic/Toaster/ToastPrimitive.d.ts +1 -1
- package/dist/atomic/Toggle/index.d.ts +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/styles/index.css +1410 -111
- package/dist/utils/variants.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type MarqueeProps<T = unknown> = {
|
|
3
|
+
items: T[];
|
|
4
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
itemClassName?: string;
|
|
7
|
+
gap?: 'none' | 'tight' | 'medium' | 'large';
|
|
8
|
+
speed?: number;
|
|
9
|
+
direction?: 'left' | 'right' | 'up' | 'down' | 'auto';
|
|
10
|
+
pauseOnHover?: boolean;
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
reducedMotion?: 'respect' | 'ignore';
|
|
13
|
+
behavior?: 'bounce' | 'infinite' | 'auto';
|
|
14
|
+
pauseOnFocusWithin?: boolean;
|
|
15
|
+
easing?: 'linear' | 'ease-in-out' | 'ease-out';
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Marquee Content Component - Core implementation
|
|
19
|
+
*
|
|
20
|
+
* This is the heavy implementation that gets lazy loaded.
|
|
21
|
+
* The wrapper component handles Suspense and fallbacks.
|
|
22
|
+
*
|
|
23
|
+
* Production-grade marquee with:
|
|
24
|
+
* - Perfect accessibility (WCAG 2.1 AA compliant)
|
|
25
|
+
* - Reduced motion support
|
|
26
|
+
* - Smart behavior detection
|
|
27
|
+
* - Intersection Observer optimization
|
|
28
|
+
* - SSR/CSR safe with graceful fallbacks
|
|
29
|
+
*/
|
|
30
|
+
declare function Marquee<T = unknown>({ items, renderItem, className, itemClassName, gap, speed, direction, pauseOnHover, ariaLabel, reducedMotion, behavior, pauseOnFocusWithin, easing, }: MarqueeProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default Marquee;
|
|
32
|
+
//# sourceMappingURL=MarqueeContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarqueeContent.d.ts","sourceRoot":"","sources":["../../../src/advanced/Marquee/MarqueeContent.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI;IACtC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,QAAQ,GAAG,aAAa,GAAG,UAAU,CAAC;CAChD,CAAC;AAsBF;;;;;;;;;;;;GAYG;AACH,iBAAS,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,EAC5B,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,GAAwB,EACxB,KAAU,EACV,SAAkB,EAClB,YAAmB,EACnB,SAAS,EAET,aAAyB,EACzB,QAAiB,EACjB,kBAAyB,EACzB,MAAsB,GACvB,EAAE,YAAY,CAAC,CAAC,CAAC,2CAiNjB;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Marquee/MarqueeContent.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Marquee Content Component
|
|
5
|
+
* @description Production-grade marquee with accessibility, reduced motion support, and smart behavior detection
|
|
6
|
+
*
|
|
7
|
+
* @version 0.0.1
|
|
8
|
+
* @since 0.0.1
|
|
9
|
+
* @author AMBROISE PARK Consulting
|
|
10
|
+
*/
|
|
11
|
+
import { useRef, useState, useEffect } from 'react';
|
|
12
|
+
import { cn } from '../../utils/helpers';
|
|
13
|
+
import { GAP_VARIANT } from '../../styles/componentConstants';
|
|
14
|
+
import Stack from '../../atomic/Stack';
|
|
15
|
+
import { observeElement } from '../../utils/intersectionObserver';
|
|
16
|
+
import { addEventListener } from '../../utils/eventListener';
|
|
17
|
+
const GAP_VALUES = {
|
|
18
|
+
none: 0,
|
|
19
|
+
tight: 8,
|
|
20
|
+
medium: 16,
|
|
21
|
+
large: 32,
|
|
22
|
+
};
|
|
23
|
+
const GAP_CLASS = {
|
|
24
|
+
none: 'dndev-gap-none',
|
|
25
|
+
tight: 'dndev-gap-sm',
|
|
26
|
+
medium: 'dndev-gap-md',
|
|
27
|
+
large: 'dndev-gap-lg',
|
|
28
|
+
};
|
|
29
|
+
const EASING_VALUES = {
|
|
30
|
+
linear: 'linear',
|
|
31
|
+
'ease-in-out': 'ease-in-out',
|
|
32
|
+
'ease-out': 'ease-out',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Marquee Content Component - Core implementation
|
|
36
|
+
*
|
|
37
|
+
* This is the heavy implementation that gets lazy loaded.
|
|
38
|
+
* The wrapper component handles Suspense and fallbacks.
|
|
39
|
+
*
|
|
40
|
+
* Production-grade marquee with:
|
|
41
|
+
* - Perfect accessibility (WCAG 2.1 AA compliant)
|
|
42
|
+
* - Reduced motion support
|
|
43
|
+
* - Smart behavior detection
|
|
44
|
+
* - Intersection Observer optimization
|
|
45
|
+
* - SSR/CSR safe with graceful fallbacks
|
|
46
|
+
*/
|
|
47
|
+
function Marquee({ items, renderItem, className, itemClassName, gap = GAP_VARIANT.MEDIUM, speed = 48, direction = 'auto', pauseOnHover = true, ariaLabel,
|
|
48
|
+
// Framework defaults
|
|
49
|
+
reducedMotion = 'respect', behavior = 'auto', pauseOnFocusWithin = true, easing = 'ease-in-out', }) {
|
|
50
|
+
const [isRTL, setIsRTL] = useState(false);
|
|
51
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (typeof window === 'undefined')
|
|
54
|
+
return;
|
|
55
|
+
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
56
|
+
setPrefersReducedMotion(mediaQuery.matches);
|
|
57
|
+
const handleChange = (e) => {
|
|
58
|
+
setPrefersReducedMotion(e.matches);
|
|
59
|
+
};
|
|
60
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
61
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
62
|
+
}, []);
|
|
63
|
+
// Read document.dir reactively after mount (SSR-safe)
|
|
64
|
+
// Uses MutationObserver to react to runtime dir attribute changes (e.g., language switcher)
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (typeof document === 'undefined')
|
|
67
|
+
return;
|
|
68
|
+
const htmlEl = document.documentElement;
|
|
69
|
+
setIsRTL(htmlEl.dir === 'rtl');
|
|
70
|
+
const observer = new MutationObserver(() => {
|
|
71
|
+
setIsRTL(htmlEl.dir === 'rtl');
|
|
72
|
+
});
|
|
73
|
+
observer.observe(htmlEl, { attributes: true, attributeFilter: ['dir'] });
|
|
74
|
+
return () => observer.disconnect();
|
|
75
|
+
}, []);
|
|
76
|
+
// Determine final direction
|
|
77
|
+
let finalDirection = direction;
|
|
78
|
+
if (direction === 'auto') {
|
|
79
|
+
finalDirection = isRTL ? 'right' : 'left';
|
|
80
|
+
}
|
|
81
|
+
// Check if vertical scrolling
|
|
82
|
+
const isVertical = finalDirection === 'up' || finalDirection === 'down';
|
|
83
|
+
// Smart behavior detection
|
|
84
|
+
const shouldAnimate = reducedMotion === 'ignore' || !prefersReducedMotion;
|
|
85
|
+
let finalBehavior = behavior;
|
|
86
|
+
if (behavior === 'auto') {
|
|
87
|
+
// Auto-detect: bounce for small item counts, infinite for many items
|
|
88
|
+
finalBehavior = items.length <= 20 ? 'bounce' : 'infinite';
|
|
89
|
+
}
|
|
90
|
+
// State for dynamic calculations
|
|
91
|
+
const containerRef = useRef(null);
|
|
92
|
+
const [cycleMs, setCycleMs] = useState(8000);
|
|
93
|
+
const [scrollDistance, setScrollDistance] = useState(0);
|
|
94
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
95
|
+
const [contentOverflows, setContentOverflows] = useState(false);
|
|
96
|
+
// Intersection Observer for performance optimization
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!containerRef.current)
|
|
99
|
+
return;
|
|
100
|
+
const cleanup = observeElement(containerRef.current, (entry) => setIsVisible(entry.isIntersecting), { threshold: 0 });
|
|
101
|
+
return cleanup;
|
|
102
|
+
}, []);
|
|
103
|
+
// Content measurement and resize handling
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!containerRef.current ||
|
|
106
|
+
typeof window === 'undefined' ||
|
|
107
|
+
!shouldAnimate)
|
|
108
|
+
return;
|
|
109
|
+
const container = containerRef.current;
|
|
110
|
+
const track = container.querySelector('[data-marquee-track]');
|
|
111
|
+
if (!track)
|
|
112
|
+
return;
|
|
113
|
+
const measureContent = () => {
|
|
114
|
+
const containerSize = isVertical
|
|
115
|
+
? container.clientHeight
|
|
116
|
+
: container.clientWidth;
|
|
117
|
+
const contentSize = isVertical ? track.scrollHeight : track.scrollWidth;
|
|
118
|
+
const overflow = Math.max(0, contentSize - containerSize);
|
|
119
|
+
setContentOverflows(overflow > 0);
|
|
120
|
+
if (overflow > 0) {
|
|
121
|
+
const pxPerSec = Math.min(512, Math.max(12, speed));
|
|
122
|
+
if (finalBehavior === 'bounce') {
|
|
123
|
+
// Bounce animation: go to end, then return (2x distance)
|
|
124
|
+
const durationMs = ((overflow * 2) / pxPerSec) * 1000;
|
|
125
|
+
setCycleMs(Math.max(2000, Math.floor(durationMs)));
|
|
126
|
+
setScrollDistance(overflow);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// Infinite scroll: use full content width for seamless loop
|
|
130
|
+
const durationMs = ((contentSize + GAP_VALUES[gap]) / pxPerSec) * 1000;
|
|
131
|
+
setCycleMs(Math.max(2000, Math.floor(durationMs)));
|
|
132
|
+
setScrollDistance(contentSize + GAP_VALUES[gap]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// Content fits in container - no animation needed
|
|
137
|
+
setCycleMs(0);
|
|
138
|
+
setScrollDistance(0);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
// Initial measurement
|
|
142
|
+
const initialMeasure = () => requestAnimationFrame(measureContent);
|
|
143
|
+
initialMeasure();
|
|
144
|
+
// Responsive resize handling with feature detection
|
|
145
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
146
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
147
|
+
requestAnimationFrame(measureContent);
|
|
148
|
+
});
|
|
149
|
+
resizeObserver.observe(container);
|
|
150
|
+
return () => resizeObserver.disconnect();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
// Fallback for older browsers
|
|
154
|
+
const handleResize = () => requestAnimationFrame(measureContent);
|
|
155
|
+
return addEventListener(window, 'resize', handleResize);
|
|
156
|
+
}
|
|
157
|
+
}, [items, speed, isVertical, shouldAnimate, finalBehavior, gap]);
|
|
158
|
+
// Determine CSS animation direction
|
|
159
|
+
const getAnimationDirection = () => {
|
|
160
|
+
if (isVertical) {
|
|
161
|
+
return finalDirection === 'up' ? 'normal' : 'reverse';
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
return finalDirection === 'left' ? 'normal' : 'reverse';
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
// Render content - handle both bounce and infinite behaviors
|
|
168
|
+
const renderContent = () => {
|
|
169
|
+
if (finalBehavior === 'infinite' && contentOverflows) {
|
|
170
|
+
// Infinite scroll: duplicate content for seamless loop
|
|
171
|
+
return [...items, ...items].map((item, idx) => (_jsx("div", { className: cn('dndev-flex-shrink-0', itemClassName), children: renderItem(item, idx % items.length) }, idx)));
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
// Bounce or no-overflow: single set of items
|
|
175
|
+
return items.map((item, idx) => (_jsx("div", { className: cn('dndev-flex-shrink-0', itemClassName), children: renderItem(item, idx) }, idx)));
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
return (_jsx("div", { ref: containerRef, className: cn('dndev-relative dndev-overflow-hidden', pauseOnHover && 'group', pauseOnFocusWithin && 'focus-within:group', className), role: "region", "aria-label": ariaLabel ||
|
|
179
|
+
`${finalBehavior === 'infinite' ? 'Scrolling' : 'Bouncing'} content with ${items.length} items`, "aria-live": shouldAnimate && isVisible ? 'off' : 'polite', children: _jsx(Stack, { className: "marquee-track", direction: isVertical ? 'column' : 'row', align: !isVertical ? 'center' : undefined, gap: gap, "data-marquee-track": true, "data-marquee-direction": isVertical ? 'vertical' : 'horizontal', "data-marquee-behavior": finalBehavior, "data-marquee-reduced-motion": !shouldAnimate, style: {
|
|
180
|
+
['--marquee-duration']: shouldAnimate && isVisible && contentOverflows
|
|
181
|
+
? `${cycleMs}ms`
|
|
182
|
+
: '0ms',
|
|
183
|
+
['--marquee-direction']: getAnimationDirection(),
|
|
184
|
+
['--marquee-distance']: isVertical
|
|
185
|
+
? `${scrollDistance}px`
|
|
186
|
+
: `${scrollDistance}px`,
|
|
187
|
+
['--marquee-easing']: EASING_VALUES[easing],
|
|
188
|
+
// Pause animation when not visible or reduced motion is preferred
|
|
189
|
+
animationPlayState: !shouldAnimate || !isVisible ? 'paused' : 'running',
|
|
190
|
+
}, children: renderContent() }) }));
|
|
191
|
+
}
|
|
192
|
+
export default Marquee;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type MarqueeSkeletonProps = {
|
|
2
|
+
className?: string;
|
|
3
|
+
itemCount?: number;
|
|
4
|
+
itemWidth?: string;
|
|
5
|
+
gap?: 'none' | 'tight' | 'medium' | 'large';
|
|
6
|
+
direction?: 'horizontal' | 'vertical';
|
|
7
|
+
};
|
|
8
|
+
declare function MarqueeSkeleton({ className, itemCount, itemWidth, gap, direction, }: MarqueeSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default MarqueeSkeleton;
|
|
10
|
+
//# sourceMappingURL=MarqueeSkeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarqueeSkeleton.d.ts","sourceRoot":"","sources":["../../../src/advanced/Marquee/MarqueeSkeleton.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACvC,CAAC;AASF,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,SAAa,EACb,SAAS,EACT,GAAwB,EACxB,SAAwB,GACzB,EAAE,oBAAoB,2CAsCtB;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Marquee/MarqueeSkeleton.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Marquee Skeleton Component
|
|
5
|
+
* @description Loading skeleton for Marquee component
|
|
6
|
+
*
|
|
7
|
+
* @version 0.0.1
|
|
8
|
+
* @since 0.0.1
|
|
9
|
+
* @author AMBROISE PARK Consulting
|
|
10
|
+
*/
|
|
11
|
+
import { cn } from '../../utils/helpers';
|
|
12
|
+
import { GAP_VARIANT } from '../../styles/componentConstants';
|
|
13
|
+
import Stack from '../../atomic/Stack';
|
|
14
|
+
const GAP_VALUE = {
|
|
15
|
+
none: 'var(--gap-none)',
|
|
16
|
+
tight: 'var(--gap-sm)',
|
|
17
|
+
medium: 'var(--gap-md)',
|
|
18
|
+
large: 'var(--gap-lg)',
|
|
19
|
+
};
|
|
20
|
+
function MarqueeSkeleton({ className, itemCount = 8, itemWidth, gap = GAP_VARIANT.MEDIUM, direction = 'horizontal', }) {
|
|
21
|
+
const isVertical = direction === 'vertical';
|
|
22
|
+
return (_jsx("div", { className: cn('dndev-relative dndev-overflow-hidden', className), role: "status", "aria-label": "Loading content", children: _jsx(Stack, { direction: isVertical ? 'column' : 'row', align: !isVertical ? 'center' : undefined, gap: gap, children: Array.from({ length: itemCount * 2 }).map((_, idx) => (_jsx("div", { className: "dndev-flex-shrink-0 dndev-animate-pulse", style: isVertical
|
|
23
|
+
? {
|
|
24
|
+
height: '4rem',
|
|
25
|
+
width: '100%',
|
|
26
|
+
backgroundColor: 'var(--muted)',
|
|
27
|
+
borderRadius: 'var(--radius-lg)',
|
|
28
|
+
}
|
|
29
|
+
: {
|
|
30
|
+
height: '4rem',
|
|
31
|
+
width: itemWidth || '4rem',
|
|
32
|
+
backgroundColor: 'var(--muted)',
|
|
33
|
+
borderRadius: 'var(--radius-lg)',
|
|
34
|
+
} }, idx))) }) }));
|
|
35
|
+
}
|
|
36
|
+
export default MarqueeSkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/advanced/Marquee/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Reveal Component
|
|
3
|
+
* @description Reveal component for staggered animations. Features viewport-based visibility detection, directional animations, customizable stagger delays, and support for string arrays or ReactNode arrays.
|
|
4
|
+
*
|
|
5
|
+
* @version 0.0.2
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
* @author AMBROISE PARK Consulting
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode, type ComponentType } from 'react';
|
|
10
|
+
export interface RevealProps {
|
|
11
|
+
items: string[] | ReactNode[];
|
|
12
|
+
direction?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' | 'alternate-h' | 'alternate-v';
|
|
13
|
+
stagger?: number;
|
|
14
|
+
threshold?: number;
|
|
15
|
+
distance?: number;
|
|
16
|
+
duration?: number;
|
|
17
|
+
once?: boolean;
|
|
18
|
+
viewport?: boolean;
|
|
19
|
+
overrides?: Array<{
|
|
20
|
+
index: number;
|
|
21
|
+
direction: 'left' | 'right' | 'top' | 'bottom' | 'fade-in';
|
|
22
|
+
}>;
|
|
23
|
+
className?: string;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Industry-standard reveal animation component
|
|
28
|
+
* Based on patterns from Framer Motion, AOS, and modern design systems
|
|
29
|
+
*
|
|
30
|
+
* Features:
|
|
31
|
+
* - SSR-safe with progressive enhancement
|
|
32
|
+
* - Hardware-accelerated animations
|
|
33
|
+
* - Reduced motion support
|
|
34
|
+
* - Proper stagger timing
|
|
35
|
+
* - 100% Lighthouse compliant
|
|
36
|
+
*/
|
|
37
|
+
declare const Reveal: ComponentType<RevealProps>;
|
|
38
|
+
export default Reveal;
|
|
39
|
+
//# sourceMappingURL=Reveal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reveal.d.ts","sourceRoot":"","sources":["../../../src/advanced/Reveal/Reveal.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,aAAa,EAEnB,MAAM,OAAO,CAAC;AAKf,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC9B,SAAS,CAAC,EACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,QAAQ,GACR,SAAS,GACT,aAAa,GACb,aAAa,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;KAC5D,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,EAAE,aAAa,CAAC,WAAW,CA4FtC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Reveal/Reveal.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Reveal Component
|
|
5
|
+
* @description Reveal component for staggered animations. Features viewport-based visibility detection, directional animations, customizable stagger delays, and support for string arrays or ReactNode arrays.
|
|
6
|
+
*
|
|
7
|
+
* @version 0.0.2
|
|
8
|
+
* @since 0.0.1
|
|
9
|
+
* @author AMBROISE PARK Consulting
|
|
10
|
+
*/
|
|
11
|
+
import { useCallback, } from 'react';
|
|
12
|
+
import { cn } from '../../utils/helpers';
|
|
13
|
+
import { useViewportVisibility } from '../../hooks/useViewportVisibility';
|
|
14
|
+
/**
|
|
15
|
+
* Industry-standard reveal animation component
|
|
16
|
+
* Based on patterns from Framer Motion, AOS, and modern design systems
|
|
17
|
+
*
|
|
18
|
+
* Features:
|
|
19
|
+
* - SSR-safe with progressive enhancement
|
|
20
|
+
* - Hardware-accelerated animations
|
|
21
|
+
* - Reduced motion support
|
|
22
|
+
* - Proper stagger timing
|
|
23
|
+
* - 100% Lighthouse compliant
|
|
24
|
+
*/
|
|
25
|
+
const Reveal = ({ items = [], direction = 'fade-in', stagger = 100, threshold, distance, duration, once = false, // Default to false for re-triggering
|
|
26
|
+
viewport = true, // Default to true for viewport-based animation
|
|
27
|
+
overrides = [], className, children, }) => {
|
|
28
|
+
const { ref: containerRef, isVisible, hasTriggered, visibleItems, isItemVisible, } = useViewportVisibility({
|
|
29
|
+
threshold,
|
|
30
|
+
once,
|
|
31
|
+
trackItems: viewport,
|
|
32
|
+
enableScrollListener: viewport,
|
|
33
|
+
});
|
|
34
|
+
// Calculate direction for each item (memoized for performance)
|
|
35
|
+
const getItemDirection = useCallback((index) => {
|
|
36
|
+
// Check for override first
|
|
37
|
+
const override = overrides.find((o) => o.index === index);
|
|
38
|
+
if (override)
|
|
39
|
+
return override.direction;
|
|
40
|
+
// Apply pattern-based direction
|
|
41
|
+
switch (direction) {
|
|
42
|
+
case 'alternate-h':
|
|
43
|
+
return index % 2 === 0 ? 'left' : 'right';
|
|
44
|
+
case 'alternate-v':
|
|
45
|
+
return index % 2 === 0 ? 'top' : 'bottom';
|
|
46
|
+
default:
|
|
47
|
+
return direction;
|
|
48
|
+
}
|
|
49
|
+
}, [direction, overrides]);
|
|
50
|
+
// Render items with proper stagger timing
|
|
51
|
+
// Always wrap in div - no cloneElement needed (React 19 compatible)
|
|
52
|
+
const renderItems = () => items.map((item, index) => {
|
|
53
|
+
const itemDirection = getItemDirection(index);
|
|
54
|
+
const delayMs = index * stagger;
|
|
55
|
+
const shouldAnimate = viewport ? isItemVisible(index) : isVisible;
|
|
56
|
+
return (_jsx("div", { className: "dndev-reveal-item", "data-direction": itemDirection, "data-visible": shouldAnimate, style: {
|
|
57
|
+
'--reveal-delay': `${delayMs}ms`,
|
|
58
|
+
'--reveal-index': index,
|
|
59
|
+
...(distance !== undefined && {
|
|
60
|
+
'--reveal-distance': `${distance}vw`,
|
|
61
|
+
}),
|
|
62
|
+
...(duration !== undefined && {
|
|
63
|
+
'--reveal-duration': `${duration}ms`,
|
|
64
|
+
}),
|
|
65
|
+
}, children: item }, typeof item === 'string' ? item : index));
|
|
66
|
+
});
|
|
67
|
+
return (_jsx("div", { ref: containerRef, className: cn('dndev-reveal-container', isVisible && 'dndev-reveal-visible', className), "data-direction": direction, "data-stagger": stagger, children: items.length > 0 ? renderItems() : children }));
|
|
68
|
+
};
|
|
69
|
+
export default Reveal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/advanced/Reveal/index.ts"],"names":[],"mappings":"AAEA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Roadmap Component
|
|
3
|
+
* @description Timeline component with horizontal (desktop) / vertical (mobile) layout.
|
|
4
|
+
* Features animated progress line, glowing nodes, and lift-on-hover cards.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.0.2
|
|
7
|
+
* @since 0.0.1
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import RoadmapContent from './RoadmapContent';
|
|
11
|
+
import type { ComponentProps } from 'react';
|
|
12
|
+
export type { RoadmapProps, RoadmapStep } from './RoadmapContent';
|
|
13
|
+
declare const Roadmap: (props: ComponentProps<typeof RoadmapContent>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default Roadmap;
|
|
15
|
+
//# sourceMappingURL=Roadmap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Roadmap.d.ts","sourceRoot":"","sources":["../../../src/advanced/Roadmap/Roadmap.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAElE,QAAA,MAAM,OAAO,GAAoB,OAAO,cAAc,CAAC,OAAO,cAAc,CAAC,4CAE5E,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Roadmap/Roadmap.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Roadmap Component
|
|
5
|
+
* @description Timeline component with horizontal (desktop) / vertical (mobile) layout.
|
|
6
|
+
* Features animated progress line, glowing nodes, and lift-on-hover cards.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.0.2
|
|
9
|
+
* @since 0.0.1
|
|
10
|
+
* @author AMBROISE PARK Consulting
|
|
11
|
+
*/
|
|
12
|
+
import RoadmapContent from './RoadmapContent';
|
|
13
|
+
const Roadmap = function Roadmap(props) {
|
|
14
|
+
return _jsx(RoadmapContent, { ...props });
|
|
15
|
+
};
|
|
16
|
+
export default Roadmap;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CardContent, CardVariant } from '../../atomic/Card';
|
|
2
|
+
import type { LucideIcon } from 'lucide-react';
|
|
3
|
+
import './Roadmap.css';
|
|
4
|
+
export interface RoadmapStep {
|
|
5
|
+
/** Phase label (e.g., "Week 1", "Days 1-2") */
|
|
6
|
+
phase: string;
|
|
7
|
+
/** Lucide icon for the timeline node */
|
|
8
|
+
icon: LucideIcon;
|
|
9
|
+
/** Step title */
|
|
10
|
+
title: string;
|
|
11
|
+
/** Step subtitle */
|
|
12
|
+
subtitle: string;
|
|
13
|
+
/** Optional description paragraph */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Optional content - shown in popover on click */
|
|
16
|
+
content?: CardContent;
|
|
17
|
+
/** Optional onClick handler for navigation or actions */
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface RoadmapProps {
|
|
21
|
+
/** Array of roadmap steps */
|
|
22
|
+
steps: RoadmapStep[];
|
|
23
|
+
/** Optional className */
|
|
24
|
+
className?: string;
|
|
25
|
+
/** Card variant (default, glass, etc.) */
|
|
26
|
+
variant?: CardVariant;
|
|
27
|
+
/** Layout: auto = horizontal on desktop / vertical on mobile; vertical = always vertical; horizontal = always horizontal */
|
|
28
|
+
layout?: 'auto' | 'vertical' | 'horizontal';
|
|
29
|
+
}
|
|
30
|
+
declare const RoadmapContent: ({ steps, className, variant, layout, }: RoadmapProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default RoadmapContent;
|
|
32
|
+
//# sourceMappingURL=RoadmapContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoadmapContent.d.ts","sourceRoot":"","sources":["../../../src/advanced/Roadmap/RoadmapContent.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,EAAE,UAAU,CAAC;IACjB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,4HAA4H;IAC5H,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;CAC7C;AAED,QAAA,MAAM,cAAc,GAA2B,wCAK5C,YAAY,4CA0Gd,CAAC;AA0DF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Roadmap/RoadmapContent.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Roadmap Content Component
|
|
5
|
+
* @description Timeline component with horizontal (desktop) / vertical (mobile) layout.
|
|
6
|
+
* Features animated progress line, glowing nodes, and cards with content at bottom.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.0.4
|
|
9
|
+
* @since 0.0.1
|
|
10
|
+
* @author AMBROISE PARK Consulting
|
|
11
|
+
*/
|
|
12
|
+
import { useState, useEffect, useSyncExternalStore } from 'react';
|
|
13
|
+
import { cn } from '../../utils/helpers';
|
|
14
|
+
import Card, { renderCardContent } from '../../atomic/Card';
|
|
15
|
+
import { useIntersectionObserver } from '../../hooks/useIntersectionObserver';
|
|
16
|
+
/** Laptop breakpoint threshold (1024px) — matches @donotdev/core BREAKPOINT_THRESHOLDS */
|
|
17
|
+
const LAPTOP_QUERY = '(min-width: 1024px)';
|
|
18
|
+
const subscribe = (cb) => {
|
|
19
|
+
const mql = window.matchMedia(LAPTOP_QUERY);
|
|
20
|
+
mql.addEventListener('change', cb);
|
|
21
|
+
return () => mql.removeEventListener('change', cb);
|
|
22
|
+
};
|
|
23
|
+
const getSnapshot = () => window.matchMedia(LAPTOP_QUERY).matches;
|
|
24
|
+
const getServerSnapshot = () => true;
|
|
25
|
+
function useIsLaptopOrDesktop() {
|
|
26
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
27
|
+
}
|
|
28
|
+
import './Roadmap.css';
|
|
29
|
+
const RoadmapContent = function RoadmapContent({ steps, className, variant, layout = 'auto', }) {
|
|
30
|
+
const [activeStep, setActiveStep] = useState(0);
|
|
31
|
+
const isLaptop = useIsLaptopOrDesktop();
|
|
32
|
+
const useVertical = layout === 'vertical' || (layout === 'auto' && !isLaptop);
|
|
33
|
+
const useHorizontal = layout === 'horizontal' || (layout === 'auto' && isLaptop);
|
|
34
|
+
const progressPercentage = steps.length > 1 ? (activeStep / (steps.length - 1)) * 100 : 0;
|
|
35
|
+
// Horizontal layout (desktop grid)
|
|
36
|
+
if (useHorizontal) {
|
|
37
|
+
return (_jsx("div", { className: cn('dndev-roadmap', className), children: _jsxs("div", { className: "dndev-roadmap-desktop", style: { ['--step-count']: steps.length }, children: [_jsxs("div", { className: "dndev-roadmap-timeline", children: [_jsx("div", { className: "dndev-roadmap-timeline-bg" }), _jsx("div", { className: "dndev-roadmap-timeline-progress", style: { width: `${progressPercentage}%` } })] }), _jsx("div", { className: "dndev-roadmap-grid", style: { gridTemplateColumns: `repeat(${steps.length}, 1fr)` }, children: steps.map((step, index) => {
|
|
38
|
+
const Icon = step.icon;
|
|
39
|
+
const isActive = index <= activeStep;
|
|
40
|
+
const isCurrent = index === activeStep;
|
|
41
|
+
return (_jsxs("div", { className: "dndev-roadmap-step", onMouseEnter: () => setActiveStep(index), children: [_jsx("div", { className: "dndev-roadmap-node", "data-active": isActive, children: _jsx(Icon, {}) }), _jsxs(Card, { title: step.title, subtitle: step.subtitle, variant: variant, className: "dndev-roadmap-card", "data-active": isCurrent, onClick: step.onClick, footer: step.content ? (_jsx("div", { className: "dndev-roadmap-content", children: renderCardContent(step.content) })) : undefined, children: [_jsx("span", { className: "dndev-roadmap-phase", children: step.phase }), step.description && (_jsx("p", { className: "dndev-roadmap-description", children: step.description }))] })] }, index));
|
|
42
|
+
}) })] }) }));
|
|
43
|
+
}
|
|
44
|
+
// Vertical layout (scroll-based activation)
|
|
45
|
+
return (_jsx("div", { className: cn('dndev-roadmap', className), children: _jsxs("div", { className: "dndev-roadmap-mobile", children: [_jsx("div", { className: "dndev-roadmap-timeline-vertical", children: _jsx("div", { className: "dndev-roadmap-timeline-vertical-progress", style: { height: `${progressPercentage}%` } }) }), steps.map((step, index) => (_jsx(RoadmapStepMobile, { step: step, index: index, isActive: index <= activeStep, variant: variant, onEnter: () => setActiveStep(index) }, index)))] }) }));
|
|
46
|
+
};
|
|
47
|
+
// Mobile step with IntersectionObserver for scroll-based activation
|
|
48
|
+
const RoadmapStepMobile = ({ step, index, isActive, variant, onEnter }) => {
|
|
49
|
+
const { ref, isIntersecting } = useIntersectionObserver({
|
|
50
|
+
threshold: 0.5,
|
|
51
|
+
rootMargin: '0px 0px -20% 0px',
|
|
52
|
+
});
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (typeof window !== 'undefined' && isIntersecting) {
|
|
55
|
+
onEnter();
|
|
56
|
+
}
|
|
57
|
+
}, [isIntersecting, onEnter]);
|
|
58
|
+
const Icon = step.icon;
|
|
59
|
+
return (_jsxs("div", { ref: ref, className: "dndev-roadmap-step-mobile", children: [_jsx("div", { className: "dndev-roadmap-node-mobile", "data-active": isActive, children: _jsx(Icon, {}) }), _jsxs(Card, { title: step.title, subtitle: step.subtitle, variant: variant, className: "dndev-roadmap-card-mobile", "data-active": isActive, onClick: step.onClick, footer: step.content ? (_jsx("div", { className: "dndev-roadmap-content", children: renderCardContent(step.content) })) : undefined, children: [_jsx("span", { className: "dndev-roadmap-phase", children: step.phase }), step.description && (_jsx("p", { className: "dndev-roadmap-description", children: step.description }))] })] }));
|
|
60
|
+
};
|
|
61
|
+
export default RoadmapContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/advanced/Roadmap/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|