@m13v/seo-components 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m13v/seo-components",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "scripts": {
5
5
  "build:css": "tailwind -i src/_build.css -o dist/styles.css --minify",
6
6
  "bump:consumers": "bash scripts/bump-consumers.sh",
@@ -76,12 +76,17 @@ export function FullSiteAnalytics({
76
76
  }
77
77
  let cancelled = false;
78
78
  // Defer init to idle to keep it off the critical path.
79
- const ric =
80
- (typeof window !== "undefined" && window.requestIdleCallback) ||
81
- ((cb: () => void) => setTimeout(cb, 1));
82
- const cic =
83
- (typeof window !== "undefined" && window.cancelIdleCallback) ||
84
- clearTimeout;
79
+ const ric: (
80
+ cb: IdleRequestCallback,
81
+ opts?: IdleRequestOptions,
82
+ ) => number =
83
+ typeof window !== "undefined" && window.requestIdleCallback
84
+ ? window.requestIdleCallback.bind(window)
85
+ : (cb) => setTimeout(cb as unknown as () => void, 1) as unknown as number;
86
+ const cic: (id: number) => void =
87
+ typeof window !== "undefined" && window.cancelIdleCallback
88
+ ? window.cancelIdleCallback.bind(window)
89
+ : (id) => clearTimeout(id);
85
90
  const id = ric(
86
91
  () => {
87
92
  import("posthog-js").then((mod) => {
@@ -9,11 +9,42 @@ import { AbsoluteFill, interpolate, spring, useCurrentFrame, useVideoConfig } fr
9
9
  /* gradient background and a growing progress bar. */
10
10
  /* ------------------------------------------------------------------ */
11
11
 
12
+ type RemotionAccent =
13
+ | "teal"
14
+ | "cyan"
15
+ | "orange"
16
+ | "amber"
17
+ | "rose"
18
+ | "pink"
19
+ | "red"
20
+ | "green"
21
+ | "emerald"
22
+ | "blue"
23
+ | "indigo"
24
+ | "violet"
25
+ | "purple";
26
+
27
+ const ACCENT_HEX: Record<RemotionAccent, { from: string; to: string }> = {
28
+ teal: { from: "#14b8a6", to: "#0d9488" },
29
+ cyan: { from: "#06b6d4", to: "#0891b2" },
30
+ orange: { from: "#fb923c", to: "#ea580c" },
31
+ amber: { from: "#fbbf24", to: "#d97706" },
32
+ rose: { from: "#fb7185", to: "#e11d48" },
33
+ pink: { from: "#f472b6", to: "#db2777" },
34
+ red: { from: "#ef4444", to: "#b91c1c" },
35
+ green: { from: "#22c55e", to: "#15803d" },
36
+ emerald: { from: "#10b981", to: "#047857" },
37
+ blue: { from: "#3b82f6", to: "#1d4ed8" },
38
+ indigo: { from: "#6366f1", to: "#4338ca" },
39
+ violet: { from: "#8b5cf6", to: "#6d28d9" },
40
+ purple: { from: "#a855f7", to: "#7e22ce" },
41
+ };
42
+
12
43
  interface ConceptRevealProps {
13
44
  title: string;
14
45
  subtitle?: string;
15
46
  captions: string[];
16
- accent?: "teal" | "cyan";
47
+ accent?: RemotionAccent;
17
48
  /** Override hex color for the primary gradient stop. If set, takes precedence over `accent`. */
18
49
  accentHex?: string;
19
50
  /** Override hex color for the secondary (dark) gradient stop. If set, takes precedence over `accent`. */
@@ -48,8 +79,9 @@ export function ConceptReveal({
48
79
  extrapolateRight: "clamp",
49
80
  });
50
81
 
51
- const bgA = accentHex ?? (accent === "teal" ? "#14b8a6" : "#06b6d4");
52
- const bgB = accentHexDark ?? (accent === "teal" ? "#0d9488" : "#0891b2");
82
+ const palette = ACCENT_HEX[accent] ?? ACCENT_HEX.teal;
83
+ const bgA = accentHex ?? palette.from;
84
+ const bgB = accentHexDark ?? palette.to;
53
85
 
54
86
  return (
55
87
  <AbsoluteFill
@@ -171,7 +203,7 @@ interface RemotionClipProps {
171
203
  title: string;
172
204
  subtitle?: string;
173
205
  captions: string[];
174
- accent?: "teal" | "cyan";
206
+ accent?: RemotionAccent;
175
207
  /** Override hex color for the primary gradient stop. If set, takes precedence over `accent`. */
176
208
  accentHex?: string;
177
209
  /** Override hex color for the secondary (dark) gradient stop. If set, takes precedence over `accent`. */