@donotdev/components 0.0.21 → 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/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/Sheet/index.d.ts.map +1 -1
- package/dist/atomic/Sheet/index.js +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/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselSkeleton.d.ts","sourceRoot":"","sources":["../../../src/advanced/Carousel/CarouselSkeleton.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,SAAa,EACb,UAAiB,EACjB,QAAgB,EAChB,YAAoB,GACrB,EAAE,qBAAqB,2CAiGvB;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Carousel/CarouselSkeleton.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Carousel Skeleton Component
|
|
5
|
+
* @description Loading skeleton for Carousel 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 Stack from '../../atomic/Stack';
|
|
13
|
+
function CarouselSkeleton({ className, itemCount = 1, showArrows = true, showDots = false, showProgress = false, }) {
|
|
14
|
+
return (_jsxs("div", { className: cn('dndev-relative dndev-overflow-hidden', className), role: "status", "aria-label": "Loading carousel", children: [_jsx("div", { className: "dndev-overflow-hidden", children: _jsx(Stack, { direction: "row", children: Array.from({ length: itemCount }).map((_, index) => (_jsx("div", { className: "dndev-w-full dndev-flex-shrink-0", children: _jsx("div", { className: "dndev-animate-pulse", style: {
|
|
15
|
+
height: '16rem',
|
|
16
|
+
backgroundColor: 'var(--muted)',
|
|
17
|
+
borderRadius: 'var(--radius-lg)',
|
|
18
|
+
} }) }, index))) }) }), showArrows && (_jsxs(_Fragment, { children: [_jsx("div", { className: "dndev-absolute dndev-z-breadcrumbs dndev-animate-pulse", style: {
|
|
19
|
+
insetInlineStart: '1rem',
|
|
20
|
+
top: '50%',
|
|
21
|
+
transform: 'translateY(-50%)',
|
|
22
|
+
width: '2.5rem',
|
|
23
|
+
height: '2.5rem',
|
|
24
|
+
backgroundColor: 'var(--muted)',
|
|
25
|
+
borderRadius: 'var(--radius)',
|
|
26
|
+
} }), _jsx("div", { className: "dndev-absolute dndev-z-breadcrumbs dndev-animate-pulse", style: {
|
|
27
|
+
insetInlineEnd: '1rem',
|
|
28
|
+
top: '50%',
|
|
29
|
+
transform: 'translateY(-50%)',
|
|
30
|
+
width: '2.5rem',
|
|
31
|
+
height: '2.5rem',
|
|
32
|
+
backgroundColor: 'var(--muted)',
|
|
33
|
+
borderRadius: 'var(--radius)',
|
|
34
|
+
} })] })), showDots && (_jsx(Stack, { direction: "row", gap: "tight", className: "dndev-absolute dndev-z-breadcrumbs", style: {
|
|
35
|
+
bottom: '1rem',
|
|
36
|
+
insetInlineStart: '50%',
|
|
37
|
+
transform: 'translateX(-50%)',
|
|
38
|
+
}, children: Array.from({ length: itemCount }).map((_, index) => (_jsx("div", { className: "dndev-animate-pulse", style: {
|
|
39
|
+
width: '0.5rem',
|
|
40
|
+
height: '0.5rem',
|
|
41
|
+
backgroundColor: 'var(--muted)',
|
|
42
|
+
borderRadius: '9999px',
|
|
43
|
+
} }, index))) })), showProgress && (_jsx("div", { className: "dndev-absolute dndev-animate-pulse", style: {
|
|
44
|
+
bottom: 0,
|
|
45
|
+
insetInlineStart: 0,
|
|
46
|
+
insetInlineEnd: 0,
|
|
47
|
+
height: '0.25rem',
|
|
48
|
+
backgroundColor: 'var(--muted)',
|
|
49
|
+
} }))] }));
|
|
50
|
+
}
|
|
51
|
+
export default CarouselSkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/advanced/Carousel/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -59,8 +59,8 @@ function Code({ children, language = 'tsx', className, showLineNumbers = true, w
|
|
|
59
59
|
// Dynamic import - gracefully fails if shiki not installed
|
|
60
60
|
// Use JavaScript RegExp engine (no WASM) for best performance and Lighthouse scores
|
|
61
61
|
const [{ getSingletonHighlighter }, { createJavaScriptRegexEngine }] = await Promise.all([
|
|
62
|
-
import('shiki'),
|
|
63
|
-
import('shiki/engine/javascript'),
|
|
62
|
+
import(/* @vite-ignore */ 'shiki'),
|
|
63
|
+
import(/* @vite-ignore */ 'shiki/engine/javascript'),
|
|
64
64
|
]);
|
|
65
65
|
const langs = [
|
|
66
66
|
'typescript',
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Crawl Component - Thin wrapper with lazy loading
|
|
3
|
+
* @description Cinematic 3D text crawl. Intro renders immediately (eager),
|
|
4
|
+
* heavy 3D animation loads lazily after user clicks play.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.0.2
|
|
7
|
+
* @since 0.0.1
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode, type CSSProperties } from 'react';
|
|
11
|
+
export interface CrawlProps {
|
|
12
|
+
/** Optional intro text displayed with play button overlay. Accepts ReactNode or string. */
|
|
13
|
+
intro?: ReactNode | string;
|
|
14
|
+
/** Optional title rendered at the start of the crawl. Accepts ReactNode or string. */
|
|
15
|
+
title?: ReactNode | string;
|
|
16
|
+
/** Main crawl content. Accepts ReactNode, string (auto-paragraphs), or string[]. */
|
|
17
|
+
content: ReactNode | string | string[];
|
|
18
|
+
/** Duration of the crawl animation in seconds. @default 26 */
|
|
19
|
+
duration?: number;
|
|
20
|
+
/** Height of the content area in viewport units. @default "150vh" */
|
|
21
|
+
contentHeight?: string;
|
|
22
|
+
/** Tilt angle for the 3D perspective effect in degrees. */
|
|
23
|
+
tiltAngle?: number;
|
|
24
|
+
/** Custom CSS classes applied to the container */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Custom inline styles applied to the container */
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
/** ARIA label for accessibility */
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Cinematic 3D text crawl component with lazy loading.
|
|
33
|
+
*
|
|
34
|
+
* ## Performance
|
|
35
|
+
* - Intro overlay renders IMMEDIATELY (LCP-optimized)
|
|
36
|
+
* - Heavy 3D animation lazy loads after user clicks play
|
|
37
|
+
* - Zero initial bundle impact for animation code
|
|
38
|
+
*
|
|
39
|
+
* @version 0.0.3
|
|
40
|
+
* @since 0.0.1
|
|
41
|
+
*/
|
|
42
|
+
declare const Crawl: ({ content, intro, title, duration, contentHeight, tiltAngle, className, style, "aria-label": ariaLabel, }: CrawlProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export default Crawl;
|
|
44
|
+
//# sourceMappingURL=Crawl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Crawl.d.ts","sourceRoot":"","sources":["../../../src/advanced/Crawl/Crawl.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AASf,MAAM,WAAW,UAAU;IACzB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,sFAAsF;IACtF,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,oFAAoF;IACpF,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,KAAK,GAAI,2GAUZ,UAAU,4CA+GZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Crawl/Crawl.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Crawl Component - Thin wrapper with lazy loading
|
|
5
|
+
* @description Cinematic 3D text crawl. Intro renders immediately (eager),
|
|
6
|
+
* heavy 3D animation loads lazily after user clicks play.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.0.2
|
|
9
|
+
* @since 0.0.1
|
|
10
|
+
* @author AMBROISE PARK Consulting
|
|
11
|
+
*/
|
|
12
|
+
import { useState, useMemo, lazy, Suspense, } from 'react';
|
|
13
|
+
import { cn } from '../../utils/helpers';
|
|
14
|
+
import { parseHtml } from './utils/parseHtml';
|
|
15
|
+
// Lazy load heavy 3D animation content
|
|
16
|
+
const CrawlContent = lazy(() => import('./CrawlContent'));
|
|
17
|
+
/**
|
|
18
|
+
* Cinematic 3D text crawl component with lazy loading.
|
|
19
|
+
*
|
|
20
|
+
* ## Performance
|
|
21
|
+
* - Intro overlay renders IMMEDIATELY (LCP-optimized)
|
|
22
|
+
* - Heavy 3D animation lazy loads after user clicks play
|
|
23
|
+
* - Zero initial bundle impact for animation code
|
|
24
|
+
*
|
|
25
|
+
* @version 0.0.3
|
|
26
|
+
* @since 0.0.1
|
|
27
|
+
*/
|
|
28
|
+
const Crawl = ({ content, intro, title, duration = 36, contentHeight = '150vh', tiltAngle, className, style, 'aria-label': ariaLabel, }) => {
|
|
29
|
+
const [showPlayOverlay, setShowPlayOverlay] = useState(true);
|
|
30
|
+
// Parse intro immediately (lightweight)
|
|
31
|
+
const resolvedIntro = useMemo(() => {
|
|
32
|
+
if (intro == null)
|
|
33
|
+
return null;
|
|
34
|
+
return typeof intro === 'string' ? (_jsx("div", { className: "dndev-crawl-intro-text", children: parseHtml(intro, {
|
|
35
|
+
allowedTags: ['u', 'br', 'i', 'em', 'strong', 'b'],
|
|
36
|
+
}) })) : (intro);
|
|
37
|
+
}, [intro]);
|
|
38
|
+
const handlePlayClick = () => {
|
|
39
|
+
setShowPlayOverlay(false);
|
|
40
|
+
};
|
|
41
|
+
return (_jsxs("div", { className: cn('dndev-crawl-container', 'dndev-relative dndev-overflow-hidden', className), style: { ...style, height: 'calc(100dvh - var(--header-height))' }, "aria-label": ariaLabel || 'Animated text crawl', role: "region", "aria-live": "polite", children: [showPlayOverlay && (_jsxs("div", { className: "dndev-absolute dndev-inset-0 dndev-flex dndev-flex-col dndev-items-center dndev-justify-center", style: {
|
|
42
|
+
zIndex: 30,
|
|
43
|
+
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
|
44
|
+
backdropFilter: 'blur(4px)',
|
|
45
|
+
}, children: [resolvedIntro && (_jsx("div", { className: "dndev-w-full", style: {
|
|
46
|
+
paddingInline: 'var(--content-padding)',
|
|
47
|
+
marginBottom: '3rem',
|
|
48
|
+
}, children: _jsx("div", { className: "dndev-crawl-intro-content", children: resolvedIntro }) })), _jsx("button", { onClick: handlePlayClick, style: {
|
|
49
|
+
width: '96px',
|
|
50
|
+
height: '96px',
|
|
51
|
+
borderRadius: '50%',
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
justifyContent: 'center',
|
|
55
|
+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
|
56
|
+
border: '4px solid rgba(255, 255, 255, 0.4)',
|
|
57
|
+
backdropFilter: 'blur(4px)',
|
|
58
|
+
cursor: 'pointer',
|
|
59
|
+
transition: 'all var(--dur-normal) var(--ease-in-out)',
|
|
60
|
+
}, onMouseEnter: (e) => {
|
|
61
|
+
e.currentTarget.style.backgroundColor =
|
|
62
|
+
'rgba(255, 255, 255, 0.3)';
|
|
63
|
+
e.currentTarget.style.borderColor = 'rgba(255, 255, 255, 0.6)';
|
|
64
|
+
e.currentTarget.style.transform = 'scale(1.1)';
|
|
65
|
+
}, onMouseLeave: (e) => {
|
|
66
|
+
e.currentTarget.style.backgroundColor =
|
|
67
|
+
'rgba(255, 255, 255, 0.2)';
|
|
68
|
+
e.currentTarget.style.borderColor = 'rgba(255, 255, 255, 0.4)';
|
|
69
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
70
|
+
}, "aria-label": "Start animated introduction", children: _jsx("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "white", style: { marginInlineStart: '4px' }, children: _jsx("path", { d: "M8 5v14l11-7z" }) }) })] })), !showPlayOverlay && (_jsx(Suspense, { fallback: null, children: _jsx(CrawlContent, { title: title, content: content, duration: duration, contentHeight: contentHeight, tiltAngle: tiltAngle }) }))] }));
|
|
71
|
+
};
|
|
72
|
+
export default Crawl;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview CrawlContent - Heavy 3D animation content (lazy loaded)
|
|
3
|
+
* @description Contains the 3D perspective animation, starfield, and text crawl.
|
|
4
|
+
* Lazy loaded after user clicks play to keep initial bundle small.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.0.1
|
|
7
|
+
* @since 0.0.1
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
export interface CrawlContentProps {
|
|
12
|
+
/** Optional title rendered at the start of the crawl */
|
|
13
|
+
title?: ReactNode | string;
|
|
14
|
+
/** Main crawl content */
|
|
15
|
+
content: ReactNode | string | string[];
|
|
16
|
+
/** Duration of the crawl animation in seconds */
|
|
17
|
+
duration?: number;
|
|
18
|
+
/** Height of the content area in viewport units */
|
|
19
|
+
contentHeight?: string;
|
|
20
|
+
/** Tilt angle for the 3D perspective effect */
|
|
21
|
+
tiltAngle?: number;
|
|
22
|
+
/** Callback when animation is paused */
|
|
23
|
+
onPause?: () => void;
|
|
24
|
+
/** Callback when animation resumes */
|
|
25
|
+
onResume?: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Heavy 3D crawl animation content - lazy loaded
|
|
29
|
+
*/
|
|
30
|
+
declare const CrawlContent: ({ content, title, duration, contentHeight, tiltAngle, onPause, onResume, }: CrawlContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default CrawlContent;
|
|
32
|
+
//# sourceMappingURL=CrawlContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrawlContent.d.ts","sourceRoot":"","sources":["../../../src/advanced/Crawl/CrawlContent.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAOf,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,yBAAyB;IACzB,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;IACvC,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,QAAA,MAAM,YAAY,GAAI,4EAQnB,iBAAiB,4CAgKnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Crawl/CrawlContent.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview CrawlContent - Heavy 3D animation content (lazy loaded)
|
|
5
|
+
* @description Contains the 3D perspective animation, starfield, and text crawl.
|
|
6
|
+
* Lazy loaded after user clicks play to keep initial bundle small.
|
|
7
|
+
*
|
|
8
|
+
* @version 0.0.1
|
|
9
|
+
* @since 0.0.1
|
|
10
|
+
* @author AMBROISE PARK Consulting
|
|
11
|
+
*/
|
|
12
|
+
import { useEffect, useRef, useState, useMemo, isValidElement, } from 'react';
|
|
13
|
+
const isClient = () => typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
14
|
+
import { parseHtml } from './utils/parseHtml';
|
|
15
|
+
/**
|
|
16
|
+
* Heavy 3D crawl animation content - lazy loaded
|
|
17
|
+
*/
|
|
18
|
+
const CrawlContent = ({ content, title, duration = 26, contentHeight = '150vh', tiltAngle, onPause, onResume, }) => {
|
|
19
|
+
const textRef = useRef(null);
|
|
20
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
21
|
+
// Normalize title/content to ReactNodes
|
|
22
|
+
const renderStringAsParagraphs = (value) => {
|
|
23
|
+
if (!value || typeof value !== 'string')
|
|
24
|
+
return null;
|
|
25
|
+
const blocks = value
|
|
26
|
+
.split(/\n\s*\n/)
|
|
27
|
+
.map((block) => block.trim())
|
|
28
|
+
.filter((block) => block.length > 0);
|
|
29
|
+
return blocks.map((block, idx) => (_jsx("p", { children: parseHtml(block, {
|
|
30
|
+
allowedTags: ['u', 'br', 'i', 'em', 'strong', 'b'],
|
|
31
|
+
}) }, `p-${idx}`)));
|
|
32
|
+
};
|
|
33
|
+
const resolvedTitle = useMemo(() => {
|
|
34
|
+
if (!title)
|
|
35
|
+
return null;
|
|
36
|
+
return typeof title === 'string' ? (_jsx("h2", { className: "dndev-crawl-title", children: parseHtml(title, {
|
|
37
|
+
allowedTags: ['u', 'br', 'i', 'em', 'strong', 'b'],
|
|
38
|
+
}) })) : (title);
|
|
39
|
+
}, [title]);
|
|
40
|
+
const resolvedContent = useMemo(() => {
|
|
41
|
+
if (isValidElement(content))
|
|
42
|
+
return content;
|
|
43
|
+
if (Array.isArray(content)) {
|
|
44
|
+
const items = content
|
|
45
|
+
.map((item) => (typeof item === 'string' ? item.trim() : ''))
|
|
46
|
+
.filter((s) => s && s.length > 0);
|
|
47
|
+
return items.map((item, idx) => (_jsx("p", { children: parseHtml(item, {
|
|
48
|
+
allowedTags: ['u', 'br', 'i', 'em', 'strong', 'b'],
|
|
49
|
+
}) }, `c-${idx}`)));
|
|
50
|
+
}
|
|
51
|
+
if (typeof content === 'string') {
|
|
52
|
+
return renderStringAsParagraphs(content);
|
|
53
|
+
}
|
|
54
|
+
return content;
|
|
55
|
+
}, [content]);
|
|
56
|
+
// Animation style
|
|
57
|
+
const animationStyle = useMemo(() => {
|
|
58
|
+
const style = {
|
|
59
|
+
'--crawl-content-height': contentHeight,
|
|
60
|
+
animationName: 'dndev-crawl-animation',
|
|
61
|
+
animationDuration: `${duration}s`,
|
|
62
|
+
animationTimingFunction: 'linear',
|
|
63
|
+
animationIterationCount: 'infinite',
|
|
64
|
+
animationFillMode: 'forwards',
|
|
65
|
+
animationPlayState: isPaused ? 'paused' : 'running',
|
|
66
|
+
};
|
|
67
|
+
if (tiltAngle !== undefined) {
|
|
68
|
+
style['--crawl-tilt'] = `${tiltAngle}deg`;
|
|
69
|
+
}
|
|
70
|
+
return style;
|
|
71
|
+
}, [isPaused, duration, contentHeight, tiltAngle]);
|
|
72
|
+
// Handle reduced motion preference
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!isClient() || !textRef.current)
|
|
75
|
+
return;
|
|
76
|
+
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
77
|
+
const handleChange = () => {
|
|
78
|
+
if (mediaQuery.matches && textRef.current) {
|
|
79
|
+
textRef.current.classList.add('dndev-crawl-reduced-motion');
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
handleChange();
|
|
83
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
84
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
85
|
+
}, []);
|
|
86
|
+
// Handle click to pause
|
|
87
|
+
const handleClick = () => {
|
|
88
|
+
if (isPaused) {
|
|
89
|
+
setIsPaused(false);
|
|
90
|
+
onResume?.();
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
setIsPaused(true);
|
|
94
|
+
onPause?.();
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "dndev-crawl-3d-container", onClick: handleClick, children: _jsx("div", { ref: textRef, className: "dndev-crawl-text", style: {
|
|
98
|
+
...animationStyle,
|
|
99
|
+
willChange: !isPaused ? 'transform' : 'auto',
|
|
100
|
+
}, children: _jsxs("div", { className: "dndev-crawl-content", children: [resolvedTitle, resolvedContent] }) }) }), isPaused && (_jsx("div", { className: "dndev-absolute dndev-inset-0 dndev-flex dndev-items-center dndev-justify-center", style: {
|
|
101
|
+
zIndex: 30,
|
|
102
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
103
|
+
backdropFilter: 'blur(2px)',
|
|
104
|
+
}, onClick: handleClick, children: _jsx("button", { style: {
|
|
105
|
+
width: '96px',
|
|
106
|
+
height: '96px',
|
|
107
|
+
borderRadius: '50%',
|
|
108
|
+
display: 'flex',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
justifyContent: 'center',
|
|
111
|
+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
|
|
112
|
+
border: '4px solid rgba(255, 255, 255, 0.4)',
|
|
113
|
+
backdropFilter: 'blur(4px)',
|
|
114
|
+
cursor: 'pointer',
|
|
115
|
+
transition: 'all var(--dur-normal) var(--ease-in-out)',
|
|
116
|
+
}, "aria-label": "Resume animation", children: _jsx("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "white", children: _jsx("path", { d: "M6 4h4v16H6V4zm8 0h4v16h-4V4z" }) }) }) })), _jsxs("div", { className: "dndev-crawl-stars", children: [_jsx("div", { className: "dndev-crawl-stars-layer-1" }), _jsx("div", { className: "dndev-crawl-stars-layer-2" }), _jsx("div", { className: "dndev-crawl-stars-layer-3" })] })] }));
|
|
117
|
+
};
|
|
118
|
+
export default CrawlContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/advanced/Crawl/index.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview HTML Parser Utility
|
|
3
|
+
* @description Parse simple HTML tags into React components. Provides safe HTML parsing with configurable allowed tags and line break preservation.
|
|
4
|
+
*
|
|
5
|
+
* @version 0.0.1
|
|
6
|
+
* @since 0.0.1
|
|
7
|
+
* @author AMBROISE PARK Consulting
|
|
8
|
+
*/
|
|
9
|
+
import { type JSX, type ReactNode, type ReactElement } from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* Supported HTML tags for parsing
|
|
12
|
+
*
|
|
13
|
+
* @version 0.0.1
|
|
14
|
+
* @since 0.0.1
|
|
15
|
+
* @author AMBROISE PARK Consulting
|
|
16
|
+
*/
|
|
17
|
+
export type SupportedHtmlTag = 'p' | 'br' | 'u' | 'i' | 'em' | 'strong' | 'b';
|
|
18
|
+
/**
|
|
19
|
+
* Options for HTML parsing
|
|
20
|
+
*
|
|
21
|
+
* @version 0.0.1
|
|
22
|
+
* @since 0.0.1
|
|
23
|
+
* @author AMBROISE PARK Consulting
|
|
24
|
+
*/
|
|
25
|
+
export interface ParseHtmlOptions {
|
|
26
|
+
/** Allowed HTML tags to parse */
|
|
27
|
+
allowedTags?: SupportedHtmlTag[];
|
|
28
|
+
/** Whether to preserve line breaks as <br/> tags */
|
|
29
|
+
preserveLineBreaks?: boolean;
|
|
30
|
+
/** Custom class names for parsed elements */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse HTML string into React components
|
|
35
|
+
*
|
|
36
|
+
* @param html - HTML string to parse
|
|
37
|
+
* @param options - Parsing options
|
|
38
|
+
* @returns Array of React elements
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* const html = "Hello <u>world</u> and <i>italic</i> text";
|
|
43
|
+
* const elements = parseHtml(html);
|
|
44
|
+
* // Returns: [React.Fragment with "Hello ", <u>world</u>, " and ", <i>italic</i>, " text"]
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @version 0.0.1
|
|
48
|
+
* @since 0.0.1
|
|
49
|
+
* @author AMBROISE PARK Consulting
|
|
50
|
+
*/
|
|
51
|
+
export declare function parseHtml(html: string, options?: ParseHtmlOptions): ReactNode[];
|
|
52
|
+
/**
|
|
53
|
+
* Parse HTML and wrap in a single React element
|
|
54
|
+
*
|
|
55
|
+
* @param html - HTML string to parse
|
|
56
|
+
* @param wrapper - Wrapper element type (default: 'div')
|
|
57
|
+
* @param options - Parsing options
|
|
58
|
+
* @returns React element containing parsed HTML
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* const html = "Hello <u>world</u>";
|
|
63
|
+
* const element = parseHtmlElement(html, 'p');
|
|
64
|
+
* // Returns: <p>Hello <u>world</u></p>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @version 0.0.1
|
|
68
|
+
* @since 0.0.1
|
|
69
|
+
* @author AMBROISE PARK Consulting
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseHtmlElement(html: string, wrapper?: keyof JSX.IntrinsicElements, options?: ParseHtmlOptions): ReactElement;
|
|
72
|
+
//# sourceMappingURL=parseHtml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseHtml.d.ts","sourceRoot":"","sources":["../../../../src/advanced/Crawl/utils/parseHtml.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,QAAQ,GAAG,GAAG,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAqB,GAC7B,SAAS,EAAE,CAuFb;AAkCD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAM,GAAG,CAAC,iBAAyB,EAC5C,OAAO,GAAE,gBAAqB,GAC7B,YAAY,CASd"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// packages/components/src/advanced/Crawl/utils/parseHtml.tsx
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview HTML Parser Utility
|
|
4
|
+
* @description Parse simple HTML tags into React components. Provides safe HTML parsing with configurable allowed tags and line break preservation.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.0.1
|
|
7
|
+
* @since 0.0.1
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import { createElement, } from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* Parse HTML string into React components
|
|
13
|
+
*
|
|
14
|
+
* @param html - HTML string to parse
|
|
15
|
+
* @param options - Parsing options
|
|
16
|
+
* @returns Array of React elements
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const html = "Hello <u>world</u> and <i>italic</i> text";
|
|
21
|
+
* const elements = parseHtml(html);
|
|
22
|
+
* // Returns: [React.Fragment with "Hello ", <u>world</u>, " and ", <i>italic</i>, " text"]
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @version 0.0.1
|
|
26
|
+
* @since 0.0.1
|
|
27
|
+
* @author AMBROISE PARK Consulting
|
|
28
|
+
*/
|
|
29
|
+
export function parseHtml(html, options = {}) {
|
|
30
|
+
const { allowedTags = ['p', 'br', 'u', 'i', 'em', 'strong', 'b'], preserveLineBreaks = true, className, } = options;
|
|
31
|
+
if (!html || typeof html !== 'string') {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
// Handle line breaks first if enabled
|
|
35
|
+
let processedHtml = html;
|
|
36
|
+
if (preserveLineBreaks) {
|
|
37
|
+
processedHtml = processedHtml.replace(/\n/g, '<br/>');
|
|
38
|
+
}
|
|
39
|
+
// Split by opening tags
|
|
40
|
+
const parts = processedHtml.split(/(<[^>]+>)/);
|
|
41
|
+
const result = [];
|
|
42
|
+
let key = 0;
|
|
43
|
+
for (let i = 0; i < parts.length; i++) {
|
|
44
|
+
const part = parts[i];
|
|
45
|
+
if (!part)
|
|
46
|
+
continue;
|
|
47
|
+
// Check if it's a self-closing tag (like <br/> or <br />)
|
|
48
|
+
const selfClosingMatch = part.match(/^<(\w+)(?:\s[^>]*)?\s*\/>$/);
|
|
49
|
+
if (selfClosingMatch && selfClosingMatch[1]) {
|
|
50
|
+
const tagName = selfClosingMatch[1].toLowerCase();
|
|
51
|
+
if (allowedTags.includes(tagName)) {
|
|
52
|
+
// Create the React element for self-closing tags
|
|
53
|
+
const element = createHtmlElement(tagName, '', className, key++);
|
|
54
|
+
if (element) {
|
|
55
|
+
result.push(element);
|
|
56
|
+
}
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Check if it's an opening tag
|
|
61
|
+
const openingTagMatch = part.match(/^<(\w+)(?:\s[^>]*)?>$/);
|
|
62
|
+
if (openingTagMatch && openingTagMatch[1]) {
|
|
63
|
+
const tagName = openingTagMatch[1].toLowerCase();
|
|
64
|
+
if (allowedTags.includes(tagName)) {
|
|
65
|
+
// Find the corresponding closing tag
|
|
66
|
+
const closingTag = `</${tagName}>`;
|
|
67
|
+
let content = '';
|
|
68
|
+
let j = i + 1;
|
|
69
|
+
// Collect content until closing tag
|
|
70
|
+
while (j < parts.length &&
|
|
71
|
+
parts[j] &&
|
|
72
|
+
!parts[j].includes(closingTag)) {
|
|
73
|
+
content += parts[j];
|
|
74
|
+
j++;
|
|
75
|
+
}
|
|
76
|
+
// Remove closing tag from the last part
|
|
77
|
+
if (j < parts.length && parts[j]) {
|
|
78
|
+
content += parts[j].replace(closingTag, '');
|
|
79
|
+
}
|
|
80
|
+
// Create the React element
|
|
81
|
+
const element = createHtmlElement(tagName, content, className, key++);
|
|
82
|
+
if (element) {
|
|
83
|
+
result.push(element);
|
|
84
|
+
}
|
|
85
|
+
// Skip processed parts
|
|
86
|
+
i = j;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Regular text content
|
|
91
|
+
if (part && !part.startsWith('<')) {
|
|
92
|
+
result.push(part);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Create a React element for the given HTML tag
|
|
99
|
+
*/
|
|
100
|
+
function createHtmlElement(tagName, content, className, key) {
|
|
101
|
+
const props = { key };
|
|
102
|
+
if (className) {
|
|
103
|
+
props.className = className;
|
|
104
|
+
}
|
|
105
|
+
switch (tagName) {
|
|
106
|
+
case 'p':
|
|
107
|
+
return createElement('p', props, content);
|
|
108
|
+
case 'br':
|
|
109
|
+
return createElement('br', props);
|
|
110
|
+
case 'u':
|
|
111
|
+
return createElement('u', props, content);
|
|
112
|
+
case 'i':
|
|
113
|
+
case 'em':
|
|
114
|
+
return createElement('em', props, content);
|
|
115
|
+
case 'strong':
|
|
116
|
+
case 'b':
|
|
117
|
+
return createElement('strong', props, content);
|
|
118
|
+
default:
|
|
119
|
+
return content;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Parse HTML and wrap in a single React element
|
|
124
|
+
*
|
|
125
|
+
* @param html - HTML string to parse
|
|
126
|
+
* @param wrapper - Wrapper element type (default: 'div')
|
|
127
|
+
* @param options - Parsing options
|
|
128
|
+
* @returns React element containing parsed HTML
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* const html = "Hello <u>world</u>";
|
|
133
|
+
* const element = parseHtmlElement(html, 'p');
|
|
134
|
+
* // Returns: <p>Hello <u>world</u></p>
|
|
135
|
+
* ```
|
|
136
|
+
*
|
|
137
|
+
* @version 0.0.1
|
|
138
|
+
* @since 0.0.1
|
|
139
|
+
* @author AMBROISE PARK Consulting
|
|
140
|
+
*/
|
|
141
|
+
export function parseHtmlElement(html, wrapper = 'div', options = {}) {
|
|
142
|
+
const parsed = parseHtml(html, options);
|
|
143
|
+
const { className } = options;
|
|
144
|
+
return createElement(wrapper, className ? { className } : {}, ...parsed);
|
|
145
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export type { MarqueeProps } from './MarqueeContent';
|
|
3
|
+
declare const MarqueeContent: import("react").LazyExoticComponent<typeof import("./MarqueeContent").default>;
|
|
4
|
+
/**
|
|
5
|
+
* Marquee Component with lazy loading built-in
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Smooth CSS animations with hardware acceleration
|
|
9
|
+
* - Pause on hover
|
|
10
|
+
* - RTL language support
|
|
11
|
+
* - Configurable speed and direction
|
|
12
|
+
* - Responsive gap spacing
|
|
13
|
+
* - Lazy loading by default
|
|
14
|
+
*
|
|
15
|
+
* Perfect for showcasing partner logos, testimonials, or any repeating content
|
|
16
|
+
*/
|
|
17
|
+
declare const Marquee: (props: ComponentProps<typeof MarqueeContent>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default Marquee;
|
|
19
|
+
//# sourceMappingURL=Marquee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marquee.d.ts","sourceRoot":"","sources":["../../../src/advanced/Marquee/Marquee.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,QAAA,MAAM,cAAc,gFAAyC,CAAC;AAE9D;;;;;;;;;;;;GAYG;AAEH,QAAA,MAAM,OAAO,GAAI,OAAO,cAAc,CAAC,OAAO,cAAc,CAAC,4CAmB5D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// packages/components/src/advanced/Marquee/Marquee.tsx
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Marquee Component
|
|
5
|
+
* @description Marquee component with lazy loading built-in. Features smooth CSS animations with hardware acceleration, pause on hover, RTL language support, configurable speed and direction, and responsive gap spacing.
|
|
6
|
+
*
|
|
7
|
+
* @version 0.0.1
|
|
8
|
+
* @since 0.0.1
|
|
9
|
+
* @author AMBROISE PARK Consulting
|
|
10
|
+
*/
|
|
11
|
+
import { Suspense, lazy } from 'react';
|
|
12
|
+
import { GAP_VARIANT } from '../../styles/componentConstants';
|
|
13
|
+
import MarqueeSkeleton from './MarqueeSkeleton';
|
|
14
|
+
// Lazy load the actual marquee implementation
|
|
15
|
+
const MarqueeContent = lazy(() => import('./MarqueeContent'));
|
|
16
|
+
/**
|
|
17
|
+
* Marquee Component with lazy loading built-in
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Smooth CSS animations with hardware acceleration
|
|
21
|
+
* - Pause on hover
|
|
22
|
+
* - RTL language support
|
|
23
|
+
* - Configurable speed and direction
|
|
24
|
+
* - Responsive gap spacing
|
|
25
|
+
* - Lazy loading by default
|
|
26
|
+
*
|
|
27
|
+
* Perfect for showcasing partner logos, testimonials, or any repeating content
|
|
28
|
+
*/
|
|
29
|
+
const Marquee = (props) => {
|
|
30
|
+
const { gap = GAP_VARIANT.MEDIUM, direction = 'auto', ...otherProps } = props;
|
|
31
|
+
// Determine if vertical for skeleton
|
|
32
|
+
const isVertical = direction === 'up' || direction === 'down';
|
|
33
|
+
return (_jsx(Suspense, { fallback: _jsx(MarqueeSkeleton, { itemCount: 8, gap: gap, direction: isVertical ? 'vertical' : 'horizontal' }), children: _jsx(MarqueeContent, { gap: gap, direction: direction, ...otherProps }) }));
|
|
34
|
+
};
|
|
35
|
+
export default Marquee;
|