@contractspec/lib.video-gen 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/browser/compositions/api-overview.js +645 -0
  2. package/dist/browser/compositions/index.js +1133 -0
  3. package/dist/browser/compositions/primitives/animated-text.js +144 -0
  4. package/dist/browser/compositions/primitives/brand-frame.js +181 -0
  5. package/dist/browser/compositions/primitives/code-block.js +226 -0
  6. package/dist/browser/compositions/primitives/index.js +656 -0
  7. package/dist/browser/compositions/primitives/progress-bar.js +59 -0
  8. package/dist/browser/compositions/primitives/terminal.js +265 -0
  9. package/dist/browser/compositions/primitives/transition.js +98 -0
  10. package/dist/browser/compositions/social-clip.js +500 -0
  11. package/dist/browser/compositions/terminal-demo.js +558 -0
  12. package/dist/browser/design/index.js +155 -0
  13. package/dist/browser/design/layouts.js +50 -0
  14. package/dist/browser/design/motion.js +43 -0
  15. package/dist/browser/design/tokens.js +28 -0
  16. package/dist/browser/design/typography.js +61 -0
  17. package/dist/browser/docs/compositions.docblock.js +182 -0
  18. package/dist/browser/docs/design.docblock.js +187 -0
  19. package/dist/browser/docs/generators.docblock.js +187 -0
  20. package/dist/browser/docs/rendering.docblock.js +197 -0
  21. package/dist/browser/docs/video-gen.docblock.js +141 -0
  22. package/dist/browser/generators/index.js +416 -0
  23. package/dist/browser/generators/scene-planner.js +205 -0
  24. package/dist/browser/generators/script-generator.js +147 -0
  25. package/dist/browser/generators/video-generator.js +414 -0
  26. package/dist/browser/index.js +1550 -0
  27. package/dist/browser/player/demo-player.js +1136 -0
  28. package/dist/browser/player/index.js +1136 -0
  29. package/dist/browser/remotion/Root.js +1189 -0
  30. package/dist/browser/remotion/index.js +1190 -0
  31. package/dist/browser/renderers/config.js +40 -0
  32. package/dist/browser/renderers/index.js +160 -0
  33. package/dist/browser/renderers/local.js +156 -0
  34. package/dist/browser/types.js +13 -0
  35. package/dist/compositions/api-overview.d.ts +16 -0
  36. package/dist/compositions/api-overview.js +640 -0
  37. package/dist/compositions/index.d.ts +7 -0
  38. package/dist/compositions/index.js +1128 -0
  39. package/dist/compositions/primitives/animated-text.d.ts +22 -0
  40. package/dist/compositions/primitives/animated-text.js +139 -0
  41. package/dist/compositions/primitives/brand-frame.d.ts +14 -0
  42. package/dist/compositions/primitives/brand-frame.js +176 -0
  43. package/dist/compositions/primitives/code-block.d.ts +18 -0
  44. package/dist/compositions/primitives/code-block.js +221 -0
  45. package/dist/compositions/primitives/index.d.ts +12 -0
  46. package/dist/compositions/primitives/index.js +651 -0
  47. package/dist/compositions/primitives/progress-bar.d.ts +12 -0
  48. package/dist/compositions/primitives/progress-bar.js +54 -0
  49. package/dist/compositions/primitives/terminal.d.ts +24 -0
  50. package/dist/compositions/primitives/terminal.js +260 -0
  51. package/dist/compositions/primitives/transition.d.ts +14 -0
  52. package/dist/compositions/primitives/transition.js +93 -0
  53. package/dist/compositions/social-clip.d.ts +16 -0
  54. package/dist/compositions/social-clip.js +495 -0
  55. package/dist/compositions/terminal-demo.d.ts +17 -0
  56. package/dist/compositions/terminal-demo.js +553 -0
  57. package/dist/design/index.d.ts +4 -0
  58. package/dist/design/index.js +150 -0
  59. package/dist/design/layouts.d.ts +69 -0
  60. package/dist/design/layouts.js +45 -0
  61. package/dist/design/motion.d.ts +72 -0
  62. package/dist/design/motion.js +38 -0
  63. package/dist/design/tokens.d.ts +31 -0
  64. package/dist/design/tokens.js +23 -0
  65. package/dist/design/typography.d.ts +61 -0
  66. package/dist/design/typography.js +56 -0
  67. package/dist/docs/compositions.docblock.d.ts +1 -0
  68. package/dist/docs/compositions.docblock.js +183 -0
  69. package/dist/docs/design.docblock.d.ts +1 -0
  70. package/dist/docs/design.docblock.js +188 -0
  71. package/dist/docs/generators.docblock.d.ts +1 -0
  72. package/dist/docs/generators.docblock.js +188 -0
  73. package/dist/docs/rendering.docblock.d.ts +1 -0
  74. package/dist/docs/rendering.docblock.js +198 -0
  75. package/dist/docs/video-gen.docblock.d.ts +1 -0
  76. package/dist/docs/video-gen.docblock.js +142 -0
  77. package/dist/generators/index.d.ts +5 -0
  78. package/dist/generators/index.js +411 -0
  79. package/dist/generators/scene-planner.d.ts +23 -0
  80. package/dist/generators/scene-planner.js +200 -0
  81. package/dist/generators/script-generator.d.ts +49 -0
  82. package/dist/generators/script-generator.js +142 -0
  83. package/dist/generators/video-generator.d.ts +20 -0
  84. package/dist/generators/video-generator.js +409 -0
  85. package/dist/index.d.ts +6 -0
  86. package/dist/index.js +1545 -0
  87. package/dist/node/compositions/api-overview.js +640 -0
  88. package/dist/node/compositions/index.js +1128 -0
  89. package/dist/node/compositions/primitives/animated-text.js +139 -0
  90. package/dist/node/compositions/primitives/brand-frame.js +176 -0
  91. package/dist/node/compositions/primitives/code-block.js +221 -0
  92. package/dist/node/compositions/primitives/index.js +651 -0
  93. package/dist/node/compositions/primitives/progress-bar.js +54 -0
  94. package/dist/node/compositions/primitives/terminal.js +260 -0
  95. package/dist/node/compositions/primitives/transition.js +93 -0
  96. package/dist/node/compositions/social-clip.js +495 -0
  97. package/dist/node/compositions/terminal-demo.js +553 -0
  98. package/dist/node/design/index.js +150 -0
  99. package/dist/node/design/layouts.js +45 -0
  100. package/dist/node/design/motion.js +38 -0
  101. package/dist/node/design/tokens.js +23 -0
  102. package/dist/node/design/typography.js +56 -0
  103. package/dist/node/docs/compositions.docblock.js +182 -0
  104. package/dist/node/docs/design.docblock.js +187 -0
  105. package/dist/node/docs/generators.docblock.js +187 -0
  106. package/dist/node/docs/rendering.docblock.js +197 -0
  107. package/dist/node/docs/video-gen.docblock.js +141 -0
  108. package/dist/node/generators/index.js +411 -0
  109. package/dist/node/generators/scene-planner.js +200 -0
  110. package/dist/node/generators/script-generator.js +142 -0
  111. package/dist/node/generators/video-generator.js +409 -0
  112. package/dist/node/index.js +1545 -0
  113. package/dist/node/player/demo-player.js +1131 -0
  114. package/dist/node/player/index.js +1131 -0
  115. package/dist/node/remotion/Root.js +1184 -0
  116. package/dist/node/remotion/index.js +1185 -0
  117. package/dist/node/renderers/config.js +35 -0
  118. package/dist/node/renderers/index.js +155 -0
  119. package/dist/node/renderers/local.js +151 -0
  120. package/dist/node/types.js +8 -0
  121. package/dist/player/demo-player.d.ts +55 -0
  122. package/dist/player/demo-player.js +1131 -0
  123. package/dist/player/index.d.ts +2 -0
  124. package/dist/player/index.js +1131 -0
  125. package/dist/remotion/Root.d.ts +2 -0
  126. package/dist/remotion/Root.js +1184 -0
  127. package/dist/remotion/index.d.ts +1 -0
  128. package/dist/remotion/index.js +1185 -0
  129. package/dist/renderers/config.d.ts +28 -0
  130. package/dist/renderers/config.js +35 -0
  131. package/dist/renderers/index.d.ts +3 -0
  132. package/dist/renderers/index.js +155 -0
  133. package/dist/renderers/local.d.ts +17 -0
  134. package/dist/renderers/local.js +151 -0
  135. package/dist/types.d.ts +63 -0
  136. package/dist/types.js +8 -0
  137. package/package.json +637 -0
@@ -0,0 +1,69 @@
1
+ import type { VideoFormat } from '@contractspec/lib.contracts-integrations/integrations/providers/video';
2
+ import { VIDEO_FORMATS } from '@contractspec/lib.contracts-integrations/integrations/providers/video';
3
+ export { VIDEO_FORMATS };
4
+ /** Standard FPS for all video output. */
5
+ export declare const DEFAULT_FPS = 30;
6
+ /**
7
+ * Padding and safe zones for text content within video frames.
8
+ * Values are in pixels for 1920x1080; scale proportionally for other formats.
9
+ */
10
+ export declare const videoSafeZone: {
11
+ /** Horizontal padding from edges */
12
+ readonly horizontal: 120;
13
+ /** Vertical padding from edges */
14
+ readonly vertical: 80;
15
+ /** Content area width (1920 - 2 * 120) */
16
+ readonly contentWidth: 1680;
17
+ /** Content area height (1080 - 2 * 80) */
18
+ readonly contentHeight: 920;
19
+ };
20
+ /**
21
+ * Scale safe zone values for a target format.
22
+ */
23
+ export declare function scaleSafeZone(format: VideoFormat): {
24
+ horizontal: number;
25
+ vertical: number;
26
+ contentWidth: number;
27
+ contentHeight: number;
28
+ };
29
+ /**
30
+ * Common layout positions within a 1920x1080 frame.
31
+ * Use with absolute positioning in compositions.
32
+ */
33
+ export declare const videoPositions: {
34
+ /** Centered content */
35
+ readonly center: {
36
+ readonly x: 960;
37
+ readonly y: 540;
38
+ };
39
+ /** Top-left content area start */
40
+ readonly topLeft: {
41
+ readonly x: 120;
42
+ readonly y: 80;
43
+ };
44
+ /** Top-right content area end */
45
+ readonly topRight: {
46
+ readonly x: 1800;
47
+ readonly y: 80;
48
+ };
49
+ /** Bottom-left */
50
+ readonly bottomLeft: {
51
+ readonly x: 120;
52
+ readonly y: 1000;
53
+ };
54
+ /** Bottom-right (for logos, watermarks) */
55
+ readonly bottomRight: {
56
+ readonly x: 1800;
57
+ readonly y: 1000;
58
+ };
59
+ /** Bottom center (for captions) */
60
+ readonly bottomCenter: {
61
+ readonly x: 960;
62
+ readonly y: 960;
63
+ };
64
+ };
65
+ /**
66
+ * Get all format variants for a given primary format.
67
+ * Returns landscape, square, and portrait variants.
68
+ */
69
+ export declare function getAllFormatVariants(): VideoFormat[];
@@ -0,0 +1,45 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // src/design/layouts.ts
5
+ import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
6
+ var DEFAULT_FPS = 30;
7
+ var videoSafeZone = {
8
+ horizontal: 120,
9
+ vertical: 80,
10
+ contentWidth: 1680,
11
+ contentHeight: 920
12
+ };
13
+ function scaleSafeZone(format) {
14
+ const scaleX = format.width / 1920;
15
+ const scaleY = format.height / 1080;
16
+ return {
17
+ horizontal: Math.round(videoSafeZone.horizontal * scaleX),
18
+ vertical: Math.round(videoSafeZone.vertical * scaleY),
19
+ contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
20
+ contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
21
+ };
22
+ }
23
+ var videoPositions = {
24
+ center: { x: 960, y: 540 },
25
+ topLeft: { x: 120, y: 80 },
26
+ topRight: { x: 1800, y: 80 },
27
+ bottomLeft: { x: 120, y: 1000 },
28
+ bottomRight: { x: 1800, y: 1000 },
29
+ bottomCenter: { x: 960, y: 960 }
30
+ };
31
+ function getAllFormatVariants() {
32
+ return [
33
+ VIDEO_FORMATS.landscape,
34
+ VIDEO_FORMATS.square,
35
+ VIDEO_FORMATS.portrait
36
+ ];
37
+ }
38
+ export {
39
+ videoSafeZone,
40
+ videoPositions,
41
+ scaleSafeZone,
42
+ getAllFormatVariants,
43
+ VIDEO_FORMATS,
44
+ DEFAULT_FPS
45
+ };
@@ -0,0 +1,72 @@
1
+ import { Easing } from 'remotion';
2
+ /**
3
+ * Easing functions for video animations.
4
+ * Remotion's interpolate() accepts these directly.
5
+ */
6
+ export declare const videoEasing: {
7
+ /** Smooth entrance -- objects appearing */
8
+ readonly entrance: (t: number) => number;
9
+ /** Smooth exit -- objects disappearing */
10
+ readonly exit: (t: number) => number;
11
+ /** Emphasis/bounce -- drawing attention */
12
+ readonly emphasis: (t: number) => number;
13
+ /** Linear -- constant speed (progress bars, typing) */
14
+ readonly linear: typeof Easing.linear;
15
+ /** Gentle ease -- subtle movements */
16
+ readonly gentle: (t: number) => number;
17
+ /** Spring-like -- playful movements */
18
+ readonly spring: (t: number) => number;
19
+ };
20
+ /**
21
+ * Standard durations in frames.
22
+ * All values assume 30fps unless noted.
23
+ */
24
+ export declare const videoDurations: {
25
+ /** Scene transition (fade, slide, etc.) */
26
+ readonly sceneTransition: 20;
27
+ /** Text entrance animation */
28
+ readonly textEntrance: 15;
29
+ /** Text exit animation */
30
+ readonly textExit: 12;
31
+ /** Code typing speed (frames per character) */
32
+ readonly codeTypingPerChar: 2;
33
+ /** Pause after a section/concept */
34
+ readonly sectionPause: 30;
35
+ /** Brief pause for emphasis */
36
+ readonly emphasisPause: 15;
37
+ /** Logo/brand reveal */
38
+ readonly brandReveal: 25;
39
+ /** Minimum scene duration */
40
+ readonly minScene: 60;
41
+ /** Standard short scene (2s) */
42
+ readonly shortScene: 60;
43
+ /** Standard medium scene (4s) */
44
+ readonly mediumScene: 120;
45
+ /** Standard long scene (8s) */
46
+ readonly longScene: 240;
47
+ };
48
+ /**
49
+ * Pre-built transition configurations for scene-to-scene transitions.
50
+ */
51
+ export declare const videoTransitions: {
52
+ readonly fade: {
53
+ readonly type: "fade";
54
+ readonly durationInFrames: 20;
55
+ };
56
+ readonly slideLeft: {
57
+ readonly type: "slide-left";
58
+ readonly durationInFrames: 20;
59
+ };
60
+ readonly slideRight: {
61
+ readonly type: "slide-right";
62
+ readonly durationInFrames: 20;
63
+ };
64
+ readonly wipe: {
65
+ readonly type: "wipe";
66
+ readonly durationInFrames: 15;
67
+ };
68
+ readonly none: {
69
+ readonly type: "none";
70
+ readonly durationInFrames: 0;
71
+ };
72
+ };
@@ -0,0 +1,38 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // src/design/motion.ts
5
+ import { Easing } from "remotion";
6
+ var videoEasing = {
7
+ entrance: Easing.out(Easing.exp),
8
+ exit: Easing.in(Easing.exp),
9
+ emphasis: Easing.out(Easing.back(1.4)),
10
+ linear: Easing.linear,
11
+ gentle: Easing.bezier(0.25, 0.1, 0.25, 1),
12
+ spring: Easing.out(Easing.back(1.7))
13
+ };
14
+ var videoDurations = {
15
+ sceneTransition: 20,
16
+ textEntrance: 15,
17
+ textExit: 12,
18
+ codeTypingPerChar: 2,
19
+ sectionPause: 30,
20
+ emphasisPause: 15,
21
+ brandReveal: 25,
22
+ minScene: 60,
23
+ shortScene: 60,
24
+ mediumScene: 120,
25
+ longScene: 240
26
+ };
27
+ var videoTransitions = {
28
+ fade: { type: "fade", durationInFrames: 20 },
29
+ slideLeft: { type: "slide-left", durationInFrames: 20 },
30
+ slideRight: { type: "slide-right", durationInFrames: 20 },
31
+ wipe: { type: "wipe", durationInFrames: 15 },
32
+ none: { type: "none", durationInFrames: 0 }
33
+ };
34
+ export {
35
+ videoTransitions,
36
+ videoEasing,
37
+ videoDurations
38
+ };
@@ -0,0 +1,31 @@
1
+ import type { ThemeTokens } from '@contractspec/lib.design-system';
2
+ import { defaultTokens } from '@contractspec/lib.design-system';
3
+ export type { ThemeTokens };
4
+ export { defaultTokens };
5
+ /**
6
+ * Video-specific color extensions built on top of brand tokens.
7
+ */
8
+ export interface VideoColorTokens {
9
+ /** Background for video frames (may differ from web background) */
10
+ canvasBackground: string;
11
+ /** Code block background */
12
+ codeBackground: string;
13
+ /** Terminal background */
14
+ terminalBackground: string;
15
+ /** Terminal text color */
16
+ terminalForeground: string;
17
+ /** Highlight / emphasis color */
18
+ highlight: string;
19
+ /** Gradient start (for branded backgrounds) */
20
+ gradientStart: string;
21
+ /** Gradient end */
22
+ gradientEnd: string;
23
+ }
24
+ export declare const defaultVideoColors: VideoColorTokens;
25
+ /**
26
+ * Combine brand tokens with video color extensions.
27
+ */
28
+ export interface VideoThemeTokens extends ThemeTokens {
29
+ video: VideoColorTokens;
30
+ }
31
+ export declare const defaultVideoTheme: VideoThemeTokens;
@@ -0,0 +1,23 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // src/design/tokens.ts
5
+ import { defaultTokens } from "@contractspec/lib.design-system";
6
+ var defaultVideoColors = {
7
+ canvasBackground: defaultTokens.colors.background,
8
+ codeBackground: "#1e1e2e",
9
+ terminalBackground: "#0d1117",
10
+ terminalForeground: "#c9d1d9",
11
+ highlight: defaultTokens.colors.accent,
12
+ gradientStart: defaultTokens.colors.primary,
13
+ gradientEnd: defaultTokens.colors.accent
14
+ };
15
+ var defaultVideoTheme = {
16
+ ...defaultTokens,
17
+ video: defaultVideoColors
18
+ };
19
+ export {
20
+ defaultVideoTheme,
21
+ defaultVideoColors,
22
+ defaultTokens
23
+ };
@@ -0,0 +1,61 @@
1
+ export interface VideoTypeStyle {
2
+ fontSize: number;
3
+ lineHeight: number;
4
+ fontWeight: number;
5
+ letterSpacing?: number;
6
+ }
7
+ /**
8
+ * Typography scale for 1920x1080 (landscape) videos.
9
+ * Scale down proportionally for smaller formats.
10
+ */
11
+ export declare const videoTypography: {
12
+ /** Main title -- large, bold */
13
+ readonly title: {
14
+ readonly fontSize: 72;
15
+ readonly lineHeight: 1.1;
16
+ readonly fontWeight: 700;
17
+ readonly letterSpacing: -1;
18
+ };
19
+ /** Section heading */
20
+ readonly heading: {
21
+ readonly fontSize: 56;
22
+ readonly lineHeight: 1.2;
23
+ readonly fontWeight: 600;
24
+ readonly letterSpacing: -0.5;
25
+ };
26
+ /** Subheading */
27
+ readonly subheading: {
28
+ readonly fontSize: 40;
29
+ readonly lineHeight: 1.25;
30
+ readonly fontWeight: 500;
31
+ };
32
+ /** Body text */
33
+ readonly body: {
34
+ readonly fontSize: 32;
35
+ readonly lineHeight: 1.5;
36
+ readonly fontWeight: 400;
37
+ };
38
+ /** Code / monospace text */
39
+ readonly code: {
40
+ readonly fontSize: 28;
41
+ readonly lineHeight: 1.6;
42
+ readonly fontWeight: 400;
43
+ };
44
+ /** Small caption text */
45
+ readonly caption: {
46
+ readonly fontSize: 24;
47
+ readonly lineHeight: 1.4;
48
+ readonly fontWeight: 400;
49
+ };
50
+ /** Badge / label text */
51
+ readonly label: {
52
+ readonly fontSize: 20;
53
+ readonly lineHeight: 1.3;
54
+ readonly fontWeight: 600;
55
+ readonly letterSpacing: 1;
56
+ };
57
+ };
58
+ /**
59
+ * Scale typography for a target width relative to 1920px landscape.
60
+ */
61
+ export declare function scaleTypography(style: VideoTypeStyle, targetWidth: number): VideoTypeStyle;
@@ -0,0 +1,56 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // src/design/typography.ts
5
+ var videoTypography = {
6
+ title: {
7
+ fontSize: 72,
8
+ lineHeight: 1.1,
9
+ fontWeight: 700,
10
+ letterSpacing: -1
11
+ },
12
+ heading: {
13
+ fontSize: 56,
14
+ lineHeight: 1.2,
15
+ fontWeight: 600,
16
+ letterSpacing: -0.5
17
+ },
18
+ subheading: {
19
+ fontSize: 40,
20
+ lineHeight: 1.25,
21
+ fontWeight: 500
22
+ },
23
+ body: {
24
+ fontSize: 32,
25
+ lineHeight: 1.5,
26
+ fontWeight: 400
27
+ },
28
+ code: {
29
+ fontSize: 28,
30
+ lineHeight: 1.6,
31
+ fontWeight: 400
32
+ },
33
+ caption: {
34
+ fontSize: 24,
35
+ lineHeight: 1.4,
36
+ fontWeight: 400
37
+ },
38
+ label: {
39
+ fontSize: 20,
40
+ lineHeight: 1.3,
41
+ fontWeight: 600,
42
+ letterSpacing: 1
43
+ }
44
+ };
45
+ function scaleTypography(style, targetWidth) {
46
+ const scale = targetWidth / 1920;
47
+ return {
48
+ ...style,
49
+ fontSize: Math.round(style.fontSize * scale),
50
+ letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
51
+ };
52
+ }
53
+ export {
54
+ videoTypography,
55
+ scaleTypography
56
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,183 @@
1
+ // @bun
2
+ // src/docs/compositions.docblock.ts
3
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
4
+ var compositionsDocBlocks = [
5
+ {
6
+ id: "docs.video-gen.compositions",
7
+ title: "Video Compositions & Primitives",
8
+ summary: "Remotion composition components and reusable primitives for building programmatic videos.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/video-gen/compositions",
12
+ tags: ["video", "remotion", "compositions", "primitives", "react"],
13
+ owners: ["@contractspec/lib.video-gen"],
14
+ body: `# Video Compositions & Primitives
15
+
16
+ Compositions are React components rendered by Remotion. They use \`useCurrentFrame()\`, \`useVideoConfig()\`, and \`interpolate()\` to produce frame-accurate animations. All compositions must be **deterministic**: same props = same visual output.
17
+
18
+ ## Primitive Components
19
+
20
+ Primitives are reusable building blocks for constructing full compositions.
21
+
22
+ \`\`\`ts
23
+ import {
24
+ AnimatedText,
25
+ CodeBlock,
26
+ Terminal,
27
+ BrandFrame,
28
+ ProgressBar,
29
+ SceneTransitionWrapper,
30
+ } from "@contractspec/lib.video-gen/compositions/primitives";
31
+ \`\`\`
32
+
33
+ ### AnimatedText
34
+
35
+ Text with entrance/exit slide + fade animations.
36
+
37
+ | Prop | Type | Default | Description |
38
+ |------|------|---------|-------------|
39
+ | \`text\` | \`string\` | -- | Text content |
40
+ | \`variant\` | \`keyof videoTypography\` | \`"body"\` | Typography preset (title, heading, subheading, body, code, caption, label) |
41
+ | \`enterAt\` | \`number\` | \`0\` | Frame at which text enters |
42
+ | \`exitAt\` | \`number\` | -- | Frame at which text exits (omit to keep visible) |
43
+ | \`color\` | \`string\` | \`"#ffffff"\` | Text color |
44
+ | \`align\` | \`"left" \\| "center" \\| "right"\` | \`"left"\` | Text alignment |
45
+
46
+ ### CodeBlock
47
+
48
+ Syntax-aware code display with typing animation and macOS-style title bar.
49
+
50
+ | Prop | Type | Default | Description |
51
+ |------|------|---------|-------------|
52
+ | \`code\` | \`string\` | -- | Code string to display |
53
+ | \`language\` | \`string\` | \`"typescript"\` | Language label in the title bar |
54
+ | \`startAt\` | \`number\` | \`0\` | Frame at which typing starts |
55
+ | \`typeAnimation\` | \`boolean\` | \`true\` | Animate character-by-character typing |
56
+ | \`filename\` | \`string\` | -- | Filename in the title bar (overrides language) |
57
+
58
+ ### Terminal
59
+
60
+ CLI simulator with command typing, output lines, and cursor animation.
61
+
62
+ | Prop | Type | Default | Description |
63
+ |------|------|---------|-------------|
64
+ | \`lines\` | \`TerminalLine[]\` | -- | Lines to display in sequence |
65
+ | \`startAt\` | \`number\` | \`0\` | Frame at which terminal appears |
66
+ | \`prompt\` | \`string\` | \`"$ "\` | Prompt string before commands |
67
+ | \`title\` | \`string\` | \`"Terminal"\` | Title bar text |
68
+ | \`typingSpeed\` | \`number\` | \`2\` | Frames per character for commands |
69
+
70
+ \`TerminalLine\` types: \`command\` (typed), \`output\` (faded in), \`error\` (red), \`success\` (green), \`comment\` (dimmed with \`#\` prefix).
71
+
72
+ ### BrandFrame
73
+
74
+ Branded container with safe-zone padding, gradient/solid/dark backgrounds, and optional watermark.
75
+
76
+ | Prop | Type | Default | Description |
77
+ |------|------|---------|-------------|
78
+ | \`variant\` | \`"solid" \\| "gradient" \\| "dark"\` | \`"gradient"\` | Background style |
79
+ | \`showBranding\` | \`boolean\` | \`true\` | Show "ContractSpec" watermark |
80
+ | \`animateEntrance\` | \`boolean\` | \`true\` | Fade-in on first frames |
81
+ | \`styleOverrides\` | \`VideoStyleOverrides\` | -- | Override colors, fonts, dark mode |
82
+
83
+ ### ProgressBar
84
+
85
+ Thin progress indicator at the top or bottom of the frame.
86
+
87
+ | Prop | Type | Default | Description |
88
+ |------|------|---------|-------------|
89
+ | \`height\` | \`number\` | \`4\` | Bar height in pixels |
90
+ | \`color\` | \`string\` | primary color | Bar fill color |
91
+ | \`position\` | \`"top" \\| "bottom"\` | \`"bottom"\` | Placement |
92
+
93
+ ### SceneTransitionWrapper
94
+
95
+ Wraps children with entrance/exit transitions (fade, slide-left, slide-right, wipe).
96
+
97
+ | Prop | Type | Default | Description |
98
+ |------|------|---------|-------------|
99
+ | \`type\` | \`SceneTransitionType\` | -- | Transition type |
100
+ | \`durationInFrames\` | \`number\` | -- | Transition duration |
101
+ | \`direction\` | \`"in" \\| "out"\` | -- | Entering or exiting |
102
+
103
+ ## Full Compositions
104
+
105
+ Full compositions combine primitives into complete video templates. They are registered in Remotion Studio via \`RemotionRoot\`.
106
+
107
+ ### ApiOverview
108
+
109
+ Visualizes a ContractSpec definition generating a full API surface. Used for homepage demos and documentation.
110
+
111
+ \`\`\`tsx
112
+ import { ApiOverview } from "@contractspec/lib.video-gen/compositions/api-overview";
113
+
114
+ <ApiOverview
115
+ specName="CreateUser"
116
+ method="POST"
117
+ endpoint="/api/users"
118
+ specCode={\`export const createUser = defineCommand({...})\`}
119
+ generatedOutputs={["REST Endpoint", "GraphQL Mutation", "Prisma Model"]}
120
+ tagline="One spec. Every surface."
121
+ />
122
+ \`\`\`
123
+
124
+ **Scenes**: Title + method badge -> Code typing animation -> Generated outputs fan-out -> Tagline.
125
+
126
+ ### SocialClip
127
+
128
+ Short-form marketing content for LinkedIn, X, YouTube Shorts. Adapts layout for landscape (16:9), square (1:1), and portrait (9:16).
129
+
130
+ \`\`\`tsx
131
+ import { SocialClip } from "@contractspec/lib.video-gen/compositions/social-clip";
132
+
133
+ <SocialClip
134
+ hook="Stop rewriting the same API logic."
135
+ message="Generate REST, GraphQL, DB, SDK from a single spec."
136
+ points={["Deterministic output", "Fully ejectable", "No lock-in"]}
137
+ cta="Try ContractSpec"
138
+ ctaUrl="contractspec.dev"
139
+ />
140
+ \`\`\`
141
+
142
+ **Scenes**: Hook (attention grabber) -> Main message -> Supporting points -> CTA button.
143
+
144
+ ### TerminalDemo
145
+
146
+ CLI command walkthrough with animated terminal. Used in documentation and tutorial videos.
147
+
148
+ \`\`\`tsx
149
+ import { TerminalDemo } from "@contractspec/lib.video-gen/compositions/terminal-demo";
150
+
151
+ <TerminalDemo
152
+ title="Getting Started with ContractSpec"
153
+ subtitle="Define once, generate everything."
154
+ lines={[
155
+ { type: "command", text: "npx contractspec init my-api" },
156
+ { type: "output", text: "Created my-api/ with 3 sample contracts" },
157
+ { type: "command", text: "npx contractspec build" },
158
+ { type: "success", text: "Built 3 contracts -> 18 generated files" },
159
+ ]}
160
+ summary="Ship faster. Stay coherent."
161
+ />
162
+ \`\`\`
163
+
164
+ **Scenes**: Title + subtitle -> Terminal typing animation -> Summary.
165
+
166
+ ## Creating New Compositions
167
+
168
+ 1. Create a new \`.tsx\` file in \`src/compositions/\`.
169
+ 2. Use primitives from \`./primitives/\` and design tokens from \`../design/\`.
170
+ 3. Use \`useCurrentFrame()\` and \`interpolate()\` for frame-based animations.
171
+ 4. Register in \`src/remotion/Root.tsx\` with a \`<Composition>\` entry.
172
+ 5. Export from \`src/compositions/index.ts\`.
173
+ 6. Add the export path to \`package.json\` (both workspace and publishConfig).
174
+
175
+ ### Guardrails
176
+
177
+ - Keep compositions **pure**: no side effects, no network calls, no randomness.
178
+ - Use \`scaleSafeZone()\` and \`scaleTypography()\` to support multiple formats.
179
+ - All timing should be frame-based (not time-based) for deterministic output.
180
+ `
181
+ }
182
+ ];
183
+ registerDocBlocks(compositionsDocBlocks);
@@ -0,0 +1 @@
1
+ export {};